From 20112cbef836135ae887b8b5f7c52c00a8751c2f Mon Sep 17 00:00:00 2001 From: Nicolas De Loof Date: Thu, 2 Oct 2025 14:09:33 +0200 Subject: [PATCH] implement imageBuild API Signed-off-by: Nicolas De Loof --- lib/docker-client.ts | 271 +++++++++++++----- lib/http.ts | 36 ++- lib/{models => types}/Address.ts | 0 lib/{models => types}/AuthConfig.ts | 8 +- lib/{models => types}/BuildCache.ts | 0 lib/{models => types}/BuildInfo.ts | 18 +- lib/{models => types}/BuildPruneResponse.ts | 0 lib/{models => types}/ChangeType.ts | 0 lib/{models => types}/ClusterInfo.ts | 6 +- lib/{models => types}/ClusterVolume.ts | 8 +- lib/{models => types}/ClusterVolumeInfo.ts | 0 .../ClusterVolumePublishStatusInner.ts | 0 lib/{models => types}/ClusterVolumeSpec.ts | 2 +- .../ClusterVolumeSpecAccessMode.ts | 6 +- ...SpecAccessModeAccessibilityRequirements.ts | 0 ...lusterVolumeSpecAccessModeCapacityRange.ts | 0 ...ClusterVolumeSpecAccessModeSecretsInner.ts | 0 lib/{models => types}/Commit.ts | 0 lib/{models => types}/Config.ts | 4 +- lib/{models => types}/ConfigCreateRequest.ts | 2 +- lib/{models => types}/ConfigReference.ts | 0 lib/{models => types}/ConfigSpec.ts | 2 +- .../ContainerBlkioStatEntry.ts | 8 +- lib/{models => types}/ContainerBlkioStats.ts | 18 +- lib/{models => types}/ContainerCPUStats.ts | 12 +- lib/{models => types}/ContainerCPUUsage.ts | 8 +- lib/{models => types}/ContainerConfig.ts | 2 +- .../ContainerCreateRequest.ts | 6 +- .../ContainerCreateResponse.ts | 0 .../ContainerInspectResponse.ts | 14 +- lib/{models => types}/ContainerMemoryStats.ts | 16 +- .../ContainerNetworkStats.ts | 20 +- lib/{models => types}/ContainerPidsStats.ts | 4 +- .../ContainerPruneResponse.ts | 0 lib/{models => types}/ContainerState.ts | 2 +- .../ContainerStatsResponse.ts | 34 +-- lib/{models => types}/ContainerStatus.ts | 0 .../ContainerStorageStats.ts | 8 +- lib/{models => types}/ContainerSummary.ts | 12 +- .../ContainerSummaryHealth.ts | 0 .../ContainerSummaryHostConfig.ts | 0 .../ContainerSummaryNetworkSettings.ts | 2 +- .../ContainerThrottlingData.ts | 6 +- lib/{models => types}/ContainerTopResponse.ts | 0 .../ContainerUpdateRequest.ts | 12 +- .../ContainerUpdateResponse.ts | 0 .../ContainerWaitExitError.ts | 0 .../ContainerWaitResponse.ts | 2 +- lib/{models => types}/ContainerdInfo.ts | 2 +- .../ContainerdInfoNamespaces.ts | 0 lib/{models => types}/CreateImageInfo.ts | 12 +- lib/{models => types}/DeviceInfo.ts | 0 lib/{models => types}/DeviceMapping.ts | 0 lib/{models => types}/DeviceRequest.ts | 0 lib/{models => types}/DistributionInspect.ts | 4 +- lib/{models => types}/Driver.ts | 0 lib/{models => types}/DriverData.ts | 0 lib/{models => types}/EndpointIPAMConfig.ts | 0 lib/{models => types}/EndpointPortConfig.ts | 0 lib/{models => types}/EndpointResource.ts | 0 lib/{models => types}/EndpointSettings.ts | 2 +- lib/{models => types}/EndpointSpec.ts | 2 +- lib/{models => types}/EngineDescription.ts | 2 +- .../EngineDescriptionPluginsInner.ts | 0 lib/{models => types}/ErrorDetail.ts | 4 +- lib/{models => types}/ErrorResponse.ts | 2 +- lib/{models => types}/EventActor.ts | 0 lib/{models => types}/EventMessage.ts | 8 +- lib/{models => types}/ExecConfig.ts | 0 lib/{models => types}/ExecInspectResponse.ts | 2 +- lib/{models => types}/ExecStartConfig.ts | 0 lib/{models => types}/FileInfo.ts | 0 lib/{models => types}/FilesystemChange.ts | 2 +- lib/{models => types}/FirewallInfo.ts | 0 .../GenericResourcesInner.ts | 4 +- ...nericResourcesInnerDiscreteResourceSpec.ts | 0 .../GenericResourcesInnerNamedResourceSpec.ts | 0 lib/{models => types}/Health.ts | 2 +- lib/{models => types}/HealthConfig.ts | 0 lib/{models => types}/HealthcheckResult.ts | 0 lib/{models => types}/HistoryResponseItem.ts | 0 lib/{models => types}/HostConfig.ts | 18 +- .../HostConfigAllOfLogConfig.ts | 0 lib/{models => types}/IDResponse.ts | 0 lib/{models => types}/IPAM.ts | 2 +- lib/{models => types}/IPAMConfig.ts | 0 lib/{models => types}/ImageConfig.ts | 2 +- .../ImageDeleteResponseItem.ts | 0 lib/{models => types}/ImageID.ts | 0 lib/{models => types}/ImageInspect.ts | 12 +- lib/{models => types}/ImageInspectMetadata.ts | 0 lib/{models => types}/ImageInspectRootFS.ts | 0 lib/{models => types}/ImageManifestSummary.ts | 8 +- .../ImageManifestSummaryAttestationData.ts | 2 +- .../ImageManifestSummaryImageData.ts | 4 +- .../ImageManifestSummaryImageDataSize.ts | 0 .../ImageManifestSummarySize.ts | 0 lib/{models => types}/ImagePruneResponse.ts | 2 +- .../ImageSearchResponseItem.ts | 10 +- lib/{models => types}/ImageSummary.ts | 4 +- lib/{models => types}/IndexInfo.ts | 0 lib/{models => types}/JoinTokens.ts | 0 lib/{models => types}/Limit.ts | 0 lib/{models => types}/LocalNodeState.ts | 0 lib/{models => types}/ManagerStatus.ts | 2 +- lib/{models => types}/Mount.ts | 8 +- lib/{models => types}/MountBindOptions.ts | 0 lib/{models => types}/MountImageOptions.ts | 0 lib/{models => types}/MountPoint.ts | 0 lib/{models => types}/MountTmpfsOptions.ts | 0 lib/{models => types}/MountVolumeOptions.ts | 2 +- .../MountVolumeOptionsDriverConfig.ts | 0 lib/{models => types}/Network.ts | 6 +- .../NetworkAttachmentConfig.ts | 0 .../NetworkConnectRequest.ts | 2 +- lib/{models => types}/NetworkCreateRequest.ts | 4 +- .../NetworkCreateResponse.ts | 0 .../NetworkDisconnectRequest.ts | 0 lib/{models => types}/NetworkInspect.ts | 8 +- lib/{models => types}/NetworkPruneResponse.ts | 0 lib/{models => types}/NetworkSettings.ts | 6 +- lib/{models => types}/NetworkSummary.ts | 6 +- lib/{models => types}/NetworkTaskInfo.ts | 0 lib/{models => types}/NetworkingConfig.ts | 2 +- lib/{models => types}/Node.ts | 10 +- lib/{models => types}/NodeDescription.ts | 8 +- lib/{models => types}/NodeSpec.ts | 0 lib/{models => types}/NodeState.ts | 0 lib/{models => types}/NodeStatus.ts | 2 +- lib/{models => types}/OCIDescriptor.ts | 18 +- lib/{models => types}/OCIPlatform.ts | 10 +- lib/{models => types}/ObjectVersion.ts | 0 lib/{models => types}/PeerInfo.ts | 0 lib/{models => types}/PeerNode.ts | 0 lib/{models => types}/Platform.ts | 0 lib/{models => types}/Plugin.ts | 4 +- lib/{models => types}/PluginConfig.ts | 20 +- lib/{models => types}/PluginConfigArgs.ts | 0 .../PluginConfigInterface.ts | 0 lib/{models => types}/PluginConfigLinux.ts | 2 +- lib/{models => types}/PluginConfigNetwork.ts | 0 lib/{models => types}/PluginConfigRootfs.ts | 4 +- lib/{models => types}/PluginConfigUser.ts | 0 lib/{models => types}/PluginDevice.ts | 0 lib/{models => types}/PluginEnv.ts | 0 lib/{models => types}/PluginMount.ts | 0 lib/{models => types}/PluginPrivilege.ts | 0 lib/{models => types}/PluginSettings.ts | 4 +- lib/{models => types}/PluginsInfo.ts | 0 lib/{models => types}/PortBinding.ts | 0 lib/{models => types}/PortStatus.ts | 2 +- lib/{models => types}/PortSummary.ts | 0 lib/{models => types}/ProcessConfig.ts | 10 +- lib/{models => types}/ProgressDetail.ts | 4 +- lib/{models => types}/PushImageInfo.ts | 10 +- lib/{models => types}/Reachability.ts | 0 .../RegistryServiceConfig.ts | 2 +- lib/{models => types}/ResourceObject.ts | 2 +- lib/{models => types}/Resources.ts | 10 +- .../ResourcesBlkioWeightDeviceInner.ts | 0 .../ResourcesUlimitsInner.ts | 0 lib/{models => types}/RestartPolicy.ts | 0 lib/{models => types}/Runtime.ts | 6 +- lib/{models => types}/Secret.ts | 4 +- lib/{models => types}/SecretCreateRequest.ts | 2 +- lib/{models => types}/SecretSpec.ts | 2 +- lib/{models => types}/Service.ts | 12 +- lib/{models => types}/ServiceCreateRequest.ts | 12 +- .../ServiceCreateResponse.ts | 0 lib/{models => types}/ServiceEndpoint.ts | 6 +- .../ServiceEndpointVirtualIPsInner.ts | 0 lib/{models => types}/ServiceInfo.ts | 2 +- lib/{models => types}/ServiceJobStatus.ts | 2 +- lib/{models => types}/ServiceServiceStatus.ts | 0 lib/{models => types}/ServiceSpec.ts | 12 +- lib/{models => types}/ServiceSpecMode.ts | 4 +- .../ServiceSpecModeReplicated.ts | 0 .../ServiceSpecModeReplicatedJob.ts | 0 .../ServiceSpecRollbackConfig.ts | 0 .../ServiceSpecUpdateConfig.ts | 0 lib/{models => types}/ServiceUpdateRequest.ts | 12 +- .../ServiceUpdateResponse.ts | 0 lib/{models => types}/ServiceUpdateStatus.ts | 0 lib/{models => types}/Swarm.ts | 8 +- lib/{models => types}/SwarmInfo.ts | 6 +- lib/{models => types}/SwarmInitRequest.ts | 2 +- lib/{models => types}/SwarmJoinRequest.ts | 0 lib/{models => types}/SwarmSpec.ts | 12 +- lib/{models => types}/SwarmSpecCAConfig.ts | 2 +- .../SwarmSpecCAConfigExternalCAsInner.ts | 0 lib/{models => types}/SwarmSpecDispatcher.ts | 0 .../SwarmSpecEncryptionConfig.ts | 0 .../SwarmSpecOrchestration.ts | 0 lib/{models => types}/SwarmSpecRaft.ts | 0 .../SwarmSpecTaskDefaults.ts | 2 +- .../SwarmSpecTaskDefaultsLogDriver.ts | 0 lib/{models => types}/SwarmUnlockRequest.ts | 0 lib/{models => types}/SystemAuthResponse.ts | 0 .../SystemDataUsageResponse.ts | 8 +- lib/{models => types}/SystemInfo.ts | 20 +- .../SystemInfoDefaultAddressPoolsInner.ts | 0 lib/{models => types}/SystemVersion.ts | 4 +- .../SystemVersionComponentsInner.ts | 0 .../SystemVersionPlatform.ts | 0 lib/{models => types}/TLSInfo.ts | 0 lib/{models => types}/Task.ts | 10 +- lib/{models => types}/TaskSpec.ts | 16 +- .../TaskSpecContainerSpec.ts | 14 +- .../TaskSpecContainerSpecConfigsInner.ts | 2 +- .../TaskSpecContainerSpecConfigsInnerFile.ts | 0 .../TaskSpecContainerSpecDNSConfig.ts | 0 .../TaskSpecContainerSpecPrivileges.ts | 8 +- ...TaskSpecContainerSpecPrivilegesAppArmor.ts | 0 ...ecContainerSpecPrivilegesCredentialSpec.ts | 0 ...ecContainerSpecPrivilegesSELinuxContext.ts | 0 .../TaskSpecContainerSpecPrivilegesSeccomp.ts | 0 .../TaskSpecContainerSpecSecretsInner.ts | 2 +- .../TaskSpecContainerSpecSecretsInnerFile.ts | 0 lib/{models => types}/TaskSpecLogDriver.ts | 0 .../TaskSpecNetworkAttachmentSpec.ts | 0 lib/{models => types}/TaskSpecPlacement.ts | 4 +- .../TaskSpecPlacementPreferencesInner.ts | 2 +- ...TaskSpecPlacementPreferencesInnerSpread.ts | 0 lib/{models => types}/TaskSpecPluginSpec.ts | 2 +- lib/{models => types}/TaskSpecResources.ts | 4 +- .../TaskSpecRestartPolicy.ts | 0 lib/{models => types}/TaskState.ts | 0 lib/{models => types}/TaskStatus.ts | 6 +- lib/{models => types}/ThrottleDevice.ts | 0 lib/{models => types}/UnlockKeyResponse.ts | 0 lib/{models => types}/Volume.ts | 4 +- lib/{models => types}/VolumeCreateOptions.ts | 2 +- lib/{models => types}/VolumeListResponse.ts | 2 +- lib/{models => types}/VolumePruneResponse.ts | 0 lib/{models => types}/VolumeUpdateRequest.ts | 2 +- lib/{models => types}/VolumeUsageData.ts | 0 lib/{models => types}/index.ts | 0 openapi-config.yaml | 5 +- package-lock.json | 80 +++++- package.json | 4 +- templates/model/model.mustache | 2 +- test/build.test.ts | 69 +++++ 242 files changed, 749 insertions(+), 460 deletions(-) rename lib/{models => types}/Address.ts (100%) rename lib/{models => types}/AuthConfig.ts (91%) rename lib/{models => types}/BuildCache.ts (100%) rename lib/{models => types}/BuildInfo.ts (70%) rename lib/{models => types}/BuildPruneResponse.ts (100%) rename lib/{models => types}/ChangeType.ts (100%) rename lib/{models => types}/ClusterInfo.ts (92%) rename lib/{models => types}/ClusterVolume.ts (82%) rename lib/{models => types}/ClusterVolumeInfo.ts (100%) rename lib/{models => types}/ClusterVolumePublishStatusInner.ts (100%) rename lib/{models => types}/ClusterVolumeSpec.ts (93%) rename lib/{models => types}/ClusterVolumeSpecAccessMode.ts (95%) rename lib/{models => types}/ClusterVolumeSpecAccessModeAccessibilityRequirements.ts (100%) rename lib/{models => types}/ClusterVolumeSpecAccessModeCapacityRange.ts (100%) rename lib/{models => types}/ClusterVolumeSpecAccessModeSecretsInner.ts (100%) rename lib/{models => types}/Commit.ts (100%) rename lib/{models => types}/Config.ts (88%) rename lib/{models => types}/ConfigCreateRequest.ts (96%) rename lib/{models => types}/ConfigReference.ts (100%) rename lib/{models => types}/ConfigSpec.ts (96%) rename lib/{models => types}/ContainerBlkioStatEntry.ts (92%) rename lib/{models => types}/ContainerBlkioStats.ts (78%) rename lib/{models => types}/ContainerCPUStats.ts (76%) rename lib/{models => types}/ContainerCPUUsage.ts (92%) rename lib/{models => types}/ContainerConfig.ts (98%) rename lib/{models => types}/ContainerCreateRequest.ts (95%) rename lib/{models => types}/ContainerCreateResponse.ts (100%) rename lib/{models => types}/ContainerInspectResponse.ts (90%) rename lib/{models => types}/ContainerMemoryStats.ts (88%) rename lib/{models => types}/ContainerNetworkStats.ts (86%) rename lib/{models => types}/ContainerPidsStats.ts (95%) rename lib/{models => types}/ContainerPruneResponse.ts (100%) rename lib/{models => types}/ContainerState.ts (98%) rename lib/{models => types}/ContainerStatsResponse.ts (69%) rename lib/{models => types}/ContainerStatus.ts (100%) rename lib/{models => types}/ContainerStorageStats.ts (85%) rename lib/{models => types}/ContainerSummary.ts (89%) rename lib/{models => types}/ContainerSummaryHealth.ts (100%) rename lib/{models => types}/ContainerSummaryHostConfig.ts (100%) rename lib/{models => types}/ContainerSummaryNetworkSettings.ts (93%) rename lib/{models => types}/ContainerThrottlingData.ts (93%) rename lib/{models => types}/ContainerTopResponse.ts (100%) rename lib/{models => types}/ContainerUpdateRequest.ts (93%) rename lib/{models => types}/ContainerUpdateResponse.ts (100%) rename lib/{models => types}/ContainerWaitExitError.ts (100%) rename lib/{models => types}/ContainerWaitResponse.ts (92%) rename lib/{models => types}/ContainerdInfo.ts (92%) rename lib/{models => types}/ContainerdInfoNamespaces.ts (100%) rename lib/{models => types}/CreateImageInfo.ts (77%) rename lib/{models => types}/DeviceInfo.ts (100%) rename lib/{models => types}/DeviceMapping.ts (100%) rename lib/{models => types}/DeviceRequest.ts (100%) rename lib/{models => types}/DistributionInspect.ts (89%) rename lib/{models => types}/Driver.ts (100%) rename lib/{models => types}/DriverData.ts (100%) rename lib/{models => types}/EndpointIPAMConfig.ts (100%) rename lib/{models => types}/EndpointPortConfig.ts (100%) rename lib/{models => types}/EndpointResource.ts (100%) rename lib/{models => types}/EndpointSettings.ts (97%) rename lib/{models => types}/EndpointSpec.ts (94%) rename lib/{models => types}/EngineDescription.ts (91%) rename lib/{models => types}/EngineDescriptionPluginsInner.ts (100%) rename lib/{models => types}/ErrorDetail.ts (95%) rename lib/{models => types}/ErrorResponse.ts (97%) rename lib/{models => types}/EventActor.ts (100%) rename lib/{models => types}/EventMessage.ts (91%) rename lib/{models => types}/ExecConfig.ts (100%) rename lib/{models => types}/ExecInspectResponse.ts (94%) rename lib/{models => types}/ExecStartConfig.ts (100%) rename lib/{models => types}/FileInfo.ts (100%) rename lib/{models => types}/FilesystemChange.ts (94%) rename lib/{models => types}/FirewallInfo.ts (100%) rename lib/{models => types}/GenericResourcesInner.ts (90%) rename lib/{models => types}/GenericResourcesInnerDiscreteResourceSpec.ts (100%) rename lib/{models => types}/GenericResourcesInnerNamedResourceSpec.ts (100%) rename lib/{models => types}/Health.ts (95%) rename lib/{models => types}/HealthConfig.ts (100%) rename lib/{models => types}/HealthcheckResult.ts (100%) rename lib/{models => types}/HistoryResponseItem.ts (100%) rename lib/{models => types}/HostConfig.ts (96%) rename lib/{models => types}/HostConfigAllOfLogConfig.ts (100%) rename lib/{models => types}/IDResponse.ts (100%) rename lib/{models => types}/IPAM.ts (95%) rename lib/{models => types}/IPAMConfig.ts (100%) rename lib/{models => types}/ImageConfig.ts (97%) rename lib/{models => types}/ImageDeleteResponseItem.ts (100%) rename lib/{models => types}/ImageID.ts (100%) rename lib/{models => types}/ImageInspect.ts (91%) rename lib/{models => types}/ImageInspectMetadata.ts (100%) rename lib/{models => types}/ImageInspectRootFS.ts (100%) rename lib/{models => types}/ImageManifestSummary.ts (83%) rename lib/{models => types}/ImageManifestSummaryAttestationData.ts (98%) rename lib/{models => types}/ImageManifestSummaryImageData.ts (86%) rename lib/{models => types}/ImageManifestSummaryImageDataSize.ts (100%) rename lib/{models => types}/ImageManifestSummarySize.ts (100%) rename lib/{models => types}/ImagePruneResponse.ts (92%) rename lib/{models => types}/ImageSearchResponseItem.ts (88%) rename lib/{models => types}/ImageSummary.ts (96%) rename lib/{models => types}/IndexInfo.ts (100%) rename lib/{models => types}/JoinTokens.ts (100%) rename lib/{models => types}/Limit.ts (100%) rename lib/{models => types}/LocalNodeState.ts (100%) rename lib/{models => types}/ManagerStatus.ts (94%) rename lib/{models => types}/Mount.ts (88%) rename lib/{models => types}/MountBindOptions.ts (100%) rename lib/{models => types}/MountImageOptions.ts (100%) rename lib/{models => types}/MountPoint.ts (100%) rename lib/{models => types}/MountTmpfsOptions.ts (100%) rename lib/{models => types}/MountVolumeOptions.ts (92%) rename lib/{models => types}/MountVolumeOptionsDriverConfig.ts (100%) rename lib/{models => types}/Network.ts (94%) rename lib/{models => types}/NetworkAttachmentConfig.ts (100%) rename lib/{models => types}/NetworkConnectRequest.ts (93%) rename lib/{models => types}/NetworkCreateRequest.ts (94%) rename lib/{models => types}/NetworkCreateResponse.ts (100%) rename lib/{models => types}/NetworkDisconnectRequest.ts (100%) rename lib/{models => types}/NetworkInspect.ts (92%) rename lib/{models => types}/NetworkPruneResponse.ts (100%) rename lib/{models => types}/NetworkSettings.ts (97%) rename lib/{models => types}/NetworkSummary.ts (94%) rename lib/{models => types}/NetworkTaskInfo.ts (100%) rename lib/{models => types}/NetworkingConfig.ts (94%) rename lib/{models => types}/Node.ts (80%) rename lib/{models => types}/NodeDescription.ts (80%) rename lib/{models => types}/NodeSpec.ts (100%) rename lib/{models => types}/NodeState.ts (100%) rename lib/{models => types}/NodeStatus.ts (94%) rename lib/{models => types}/OCIDescriptor.ts (84%) rename lib/{models => types}/OCIPlatform.ts (92%) rename lib/{models => types}/ObjectVersion.ts (100%) rename lib/{models => types}/PeerInfo.ts (100%) rename lib/{models => types}/PeerNode.ts (100%) rename lib/{models => types}/Platform.ts (100%) rename lib/{models => types}/Plugin.ts (89%) rename lib/{models => types}/PluginConfig.ts (66%) rename lib/{models => types}/PluginConfigArgs.ts (100%) rename lib/{models => types}/PluginConfigInterface.ts (100%) rename lib/{models => types}/PluginConfigLinux.ts (93%) rename lib/{models => types}/PluginConfigNetwork.ts (100%) rename lib/{models => types}/PluginConfigRootfs.ts (94%) rename lib/{models => types}/PluginConfigUser.ts (100%) rename lib/{models => types}/PluginDevice.ts (100%) rename lib/{models => types}/PluginEnv.ts (100%) rename lib/{models => types}/PluginMount.ts (100%) rename lib/{models => types}/PluginPrivilege.ts (100%) rename lib/{models => types}/PluginSettings.ts (88%) rename lib/{models => types}/PluginsInfo.ts (100%) rename lib/{models => types}/PortBinding.ts (100%) rename lib/{models => types}/PortStatus.ts (92%) rename lib/{models => types}/PortSummary.ts (100%) rename lib/{models => types}/ProcessConfig.ts (86%) rename lib/{models => types}/ProgressDetail.ts (94%) rename lib/{models => types}/PushImageInfo.ts (78%) rename lib/{models => types}/Reachability.ts (100%) rename lib/{models => types}/RegistryServiceConfig.ts (97%) rename lib/{models => types}/ResourceObject.ts (93%) rename lib/{models => types}/Resources.ts (94%) rename lib/{models => types}/ResourcesBlkioWeightDeviceInner.ts (100%) rename lib/{models => types}/ResourcesUlimitsInner.ts (100%) rename lib/{models => types}/RestartPolicy.ts (100%) rename lib/{models => types}/Runtime.ts (94%) rename lib/{models => types}/Secret.ts (88%) rename lib/{models => types}/SecretCreateRequest.ts (96%) rename lib/{models => types}/SecretSpec.ts (96%) rename lib/{models => types}/Service.ts (71%) rename lib/{models => types}/ServiceCreateRequest.ts (75%) rename lib/{models => types}/ServiceCreateResponse.ts (100%) rename lib/{models => types}/ServiceEndpoint.ts (79%) rename lib/{models => types}/ServiceEndpointVirtualIPsInner.ts (100%) rename lib/{models => types}/ServiceInfo.ts (93%) rename lib/{models => types}/ServiceJobStatus.ts (94%) rename lib/{models => types}/ServiceServiceStatus.ts (100%) rename lib/{models => types}/ServiceSpec.ts (76%) rename lib/{models => types}/ServiceSpecMode.ts (85%) rename lib/{models => types}/ServiceSpecModeReplicated.ts (100%) rename lib/{models => types}/ServiceSpecModeReplicatedJob.ts (100%) rename lib/{models => types}/ServiceSpecRollbackConfig.ts (100%) rename lib/{models => types}/ServiceSpecUpdateConfig.ts (100%) rename lib/{models => types}/ServiceUpdateRequest.ts (75%) rename lib/{models => types}/ServiceUpdateResponse.ts (100%) rename lib/{models => types}/ServiceUpdateStatus.ts (100%) rename lib/{models => types}/Swarm.ts (89%) rename lib/{models => types}/SwarmInfo.ts (89%) rename lib/{models => types}/SwarmInitRequest.ts (98%) rename lib/{models => types}/SwarmJoinRequest.ts (100%) rename lib/{models => types}/SwarmSpec.ts (72%) rename lib/{models => types}/SwarmSpecCAConfig.ts (93%) rename lib/{models => types}/SwarmSpecCAConfigExternalCAsInner.ts (100%) rename lib/{models => types}/SwarmSpecDispatcher.ts (100%) rename lib/{models => types}/SwarmSpecEncryptionConfig.ts (100%) rename lib/{models => types}/SwarmSpecOrchestration.ts (100%) rename lib/{models => types}/SwarmSpecRaft.ts (100%) rename lib/{models => types}/SwarmSpecTaskDefaults.ts (90%) rename lib/{models => types}/SwarmSpecTaskDefaultsLogDriver.ts (100%) rename lib/{models => types}/SwarmUnlockRequest.ts (100%) rename lib/{models => types}/SystemAuthResponse.ts (100%) rename lib/{models => types}/SystemDataUsageResponse.ts (80%) rename lib/{models => types}/SystemInfo.ts (95%) rename lib/{models => types}/SystemInfoDefaultAddressPoolsInner.ts (100%) rename lib/{models => types}/SystemVersion.ts (92%) rename lib/{models => types}/SystemVersionComponentsInner.ts (100%) rename lib/{models => types}/SystemVersionPlatform.ts (100%) rename lib/{models => types}/TLSInfo.ts (100%) rename lib/{models => types}/Task.ts (83%) rename lib/{models => types}/TaskSpec.ts (70%) rename lib/{models => types}/TaskSpecContainerSpec.ts (89%) rename lib/{models => types}/TaskSpecContainerSpecConfigsInner.ts (92%) rename lib/{models => types}/TaskSpecContainerSpecConfigsInnerFile.ts (100%) rename lib/{models => types}/TaskSpecContainerSpecDNSConfig.ts (100%) rename lib/{models => types}/TaskSpecContainerSpecPrivileges.ts (86%) rename lib/{models => types}/TaskSpecContainerSpecPrivilegesAppArmor.ts (100%) rename lib/{models => types}/TaskSpecContainerSpecPrivilegesCredentialSpec.ts (100%) rename lib/{models => types}/TaskSpecContainerSpecPrivilegesSELinuxContext.ts (100%) rename lib/{models => types}/TaskSpecContainerSpecPrivilegesSeccomp.ts (100%) rename lib/{models => types}/TaskSpecContainerSpecSecretsInner.ts (91%) rename lib/{models => types}/TaskSpecContainerSpecSecretsInnerFile.ts (100%) rename lib/{models => types}/TaskSpecLogDriver.ts (100%) rename lib/{models => types}/TaskSpecNetworkAttachmentSpec.ts (100%) rename lib/{models => types}/TaskSpecPlacement.ts (95%) rename lib/{models => types}/TaskSpecPlacementPreferencesInner.ts (94%) rename lib/{models => types}/TaskSpecPlacementPreferencesInnerSpread.ts (100%) rename lib/{models => types}/TaskSpecPluginSpec.ts (95%) rename lib/{models => types}/TaskSpecResources.ts (89%) rename lib/{models => types}/TaskSpecRestartPolicy.ts (100%) rename lib/{models => types}/TaskState.ts (100%) rename lib/{models => types}/TaskStatus.ts (84%) rename lib/{models => types}/ThrottleDevice.ts (100%) rename lib/{models => types}/UnlockKeyResponse.ts (100%) rename lib/{models => types}/Volume.ts (93%) rename lib/{models => types}/VolumeCreateOptions.ts (94%) rename lib/{models => types}/VolumeListResponse.ts (95%) rename lib/{models => types}/VolumePruneResponse.ts (100%) rename lib/{models => types}/VolumeUpdateRequest.ts (92%) rename lib/{models => types}/VolumeUsageData.ts (100%) rename lib/{models => types}/index.ts (100%) create mode 100644 test/build.test.ts diff --git a/lib/docker-client.ts b/lib/docker-client.ts index 18a3726..1fbcd54 100644 --- a/lib/docker-client.ts +++ b/lib/docker-client.ts @@ -4,7 +4,7 @@ import * as path from 'path'; import * as os from 'os'; import * as http from 'http'; import * as tls from 'tls'; -import * as models from './models/index.js'; +import * as types from './types/index.js'; import { HTTPClient } from './http.js'; import { SocketAgent } from './socket.js'; import { Filter } from './filter.js'; @@ -17,20 +17,9 @@ import { isFileNotFoundError, parseDockerHost, } from './util.js'; -import type { Platform } from './models/index.js'; +import type { AuthConfig, Platform } from './types/index.js'; import type { SecureContextOptions } from 'tls'; -export interface Credentials { - username: string; - password: string; - email: string; - serveraddress: string; -} - -export interface IdentityToken { - token: string; -} - // noinspection JSUnusedGlobalSymbols export class DockerClient { private api: HTTPClient; @@ -259,7 +248,7 @@ export class DockerClient { // --- Authentication - public authCredentials(credentials: Credentials | IdentityToken): string { + public authCredentials(credentials: any): string { const jsonString = JSON.stringify(credentials); const base64 = Buffer.from(jsonString, 'utf8').toString('base64'); // Convert standard Base64 to URL and filename safe alphabet (RFC 4648) @@ -274,9 +263,9 @@ export class DockerClient { * @param authConfig Authentication to check */ public async systemAuth( - authConfig: models.AuthConfig, - ): Promise { - return this.api.post('/auth', authConfig); + authConfig: types.AuthConfig, + ): Promise { + return this.api.post('/auth', authConfig); } /** @@ -285,8 +274,8 @@ export class DockerClient { */ public async systemDataUsage( type?: Array<'container' | 'image' | 'volume' | 'build-cache'>, - ): Promise { - return this.api.get('/system/df', { + ): Promise { + return this.api.get('/system/df', { type: type, }); } @@ -301,7 +290,7 @@ export class DockerClient { * @param options.filters Filters to process on the event list. Available filters: - 'config' config name or ID - 'container' container name or ID - 'daemon' daemon name or ID - 'event' event type - 'image' image name or ID - 'label' image or container label - 'network' network name or ID - 'node' node ID - 'plugin' plugin name or ID - 'scope' local or swarm - 'secret' secret name or ID - 'service' service name or ID - 'type' object to filter by, one of 'container', 'image', 'volume', 'network', 'daemon', 'plugin', 'node', 'service', 'secret' or 'config' - 'volume' volume name */ public async systemEvents( - callback: (event: models.EventMessage) => void, + callback: (event: types.EventMessage) => void, options?: { since?: string; until?: string; @@ -313,8 +302,9 @@ export class DockerClient { callback: (data: Buffer) => { data.toString('utf-8') .split('\n') + .filter((line) => line.trim() !== '') .forEach((line) => { - callback(JSON.parse(line) as models.EventMessage); + callback(JSON.parse(line) as types.EventMessage); }); }, }); @@ -333,16 +323,16 @@ export class DockerClient { /** * Get system information */ - public async systemInfo(): Promise { - return this.api.get('/info'); + public async systemInfo(): Promise { + return this.api.get('/info'); } /** * Returns the version of Docker that is running and various information about the system that Docker is running on. * Get version */ - public async systemVersion(): Promise { - return this.api.get('/version'); + public async systemVersion(): Promise { + return this.api.get('/version'); } // --- Containers API @@ -378,7 +368,7 @@ export class DockerClient { public async containerArchiveInfo( id: string, path: string, - ): Promise { + ): Promise { return this.api .sendHTTPRequest('HEAD', `/containers/${id}/archive`, { params: { @@ -390,7 +380,7 @@ export class DockerClient { 'x-docker-container-path-stat' ] as string; const json = Buffer.from(header, 'base64').toString('utf-8'); - return models.FileInfo.fromJSON(json); + return types.FileInfo.fromJSON(json); }); } @@ -446,8 +436,8 @@ export class DockerClient { */ public async containerChanges( id: string, - ): Promise> { - return this.api.get>( + ): Promise> { + return this.api.get>( `/containers/${id}/changes`, ); } @@ -460,13 +450,13 @@ export class DockerClient { * @param options.platform Platform in the format 'os[/arch[/variant]]' used for image lookup. When specified, the daemon checks if the requested image is present in the local image cache with the given OS and Architecture, and otherwise returns a '404' status. If the option is not set, the host\'s native OS and Architecture are used to look up the image in the image cache. However, if no platform is passed and the given image does exist in the local image cache, but its OS or architecture does not match, the container is created with the available image, and a warning is added to the 'Warnings' field in the response, for example; WARNING: The requested image\'s platform (linux/arm64/v8) does not match the detected host platform (linux/amd64) and no specific platform was requested */ public async containerCreate( - spec: models.ContainerCreateRequest, + spec: types.ContainerCreateRequest, options?: { name?: string; platform?: string; }, - ): Promise { - return this.api.post( + ): Promise { + return this.api.post( '/containers/create', options, spec, @@ -518,8 +508,8 @@ export class DockerClient { options?: { size?: boolean; }, - ): Promise { - return this.api.get( + ): Promise { + return this.api.get( `/containers/${id}/json`, options, ); @@ -555,8 +545,8 @@ export class DockerClient { limit?: number; size?: boolean; filters?: Filter; - }): Promise> { - return this.api.get>( + }): Promise> { + return this.api.get>( '/containers/json', options, ); @@ -616,8 +606,8 @@ export class DockerClient { */ public async containerPrune(options?: { filters?: string; - }): Promise { - return this.api.post( + }): Promise { + return this.api.post( '/containers/prune', options, ); @@ -699,8 +689,8 @@ export class DockerClient { stream?: boolean; oneShot?: boolean; }, - ): Promise { - return this.api.get( + ): Promise { + return this.api.get( `/containers/${id}/stats`, { stream: false, // FIXME implement streaming mode @@ -741,8 +731,8 @@ export class DockerClient { options?: { psArgs?: string; }, - ): Promise { - return this.api.get( + ): Promise { + return this.api.get( `/containers/${id}/top`, { ps_args: options?.psArgs, @@ -767,9 +757,9 @@ export class DockerClient { */ public async containerUpdate( id: string, - update: models.ContainerUpdateRequest, - ): Promise { - return this.api.post( + update: types.ContainerUpdateRequest, + ): Promise { + return this.api.post( `/containers/${id}/update`, update, ); @@ -787,8 +777,8 @@ export class DockerClient { options?: { condition?: 'not-running' | 'next-exit' | 'removed'; }, - ): Promise { - return this.api.post( + ): Promise { + return this.api.post( `/containers/${id}/wait`, undefined, options, @@ -836,7 +826,7 @@ export class DockerClient { */ public async networkConnect( id: string, - container: models.NetworkConnectRequest, + container: types.NetworkConnectRequest, ): Promise { return this.api.post(`/networks/${id}/connect`, container); } @@ -846,8 +836,8 @@ export class DockerClient { * @param config Network configuration */ public async networkCreate( - config: models.NetworkCreateRequest, - ): Promise { + config: types.NetworkCreateRequest, + ): Promise { return this.api.post('/networks/create', undefined, config); } @@ -866,7 +856,7 @@ export class DockerClient { */ public async networkDisconnect( id: string, - container: models.NetworkDisconnectRequest, + container: types.NetworkDisconnectRequest, ): Promise { return this.api.post(`/networks/${id}/disconnect`, container); } @@ -884,7 +874,7 @@ export class DockerClient { verbose?: boolean; scope?: string; }, - ): Promise { + ): Promise { return this.api.get(`/networks/${id}`, options); } @@ -896,7 +886,7 @@ export class DockerClient { */ public async networkList(options?: { filters?: Filter; - }): Promise> { + }): Promise> { return this.api.get('/networks', options); } @@ -906,7 +896,7 @@ export class DockerClient { */ public async networkPrune( filters?: Filter, - ): Promise { + ): Promise { return this.api.post('/networks/prune', filters); } @@ -917,8 +907,8 @@ export class DockerClient { * @param spec Volume configuration */ public async volumeCreate( - spec: models.VolumeCreateOptions, - ): Promise { + spec: types.VolumeCreateOptions, + ): Promise { return this.api.post('/volumes/create', undefined, spec, { Accept: '*/*', }); @@ -944,7 +934,7 @@ export class DockerClient { * Inspect a volume * @param id Volume name or ID */ - public async volumeInspect(id: string): Promise { + public async volumeInspect(id: string): Promise { return this.api.get(`/volumes/${id}`); } @@ -954,7 +944,7 @@ export class DockerClient { */ public async volumeList( filters?: Filter, - ): Promise { + ): Promise { return this.api.get(`/volumes`, { filters: filters, }); @@ -966,7 +956,7 @@ export class DockerClient { */ public async volumePrune( filters?: Filter, - ): Promise { + ): Promise { return this.api.post('/volumes/prune', { filters: filters, }); @@ -981,7 +971,7 @@ export class DockerClient { */ public async distributionInspect( name: string, - ): Promise { + ): Promise { return this.api.get(`/distribution/${name}/json`); } @@ -999,10 +989,134 @@ export class DockerClient { minFreeSpace?: number; all?: boolean; filters?: Filter; - }): Promise { + }): Promise { return this.api.post('/build/prune', options); } + /** + * Build an image from a tar archive with a `Dockerfile` in it. The `Dockerfile` specifies how the image is built from the tar archive. It is typically in the archive\'s root, but can be at a different path or have a different name by specifying the `dockerfile` parameter. [See the `Dockerfile` reference for more information](https://docs.docker.com/engine/reference/builder/). The Docker daemon performs a preliminary validation of the `Dockerfile` before starting the build, and returns an error if the syntax is incorrect. After that, each instruction is run one-by-one until the ID of the new image is output. The build is canceled if the client drops the connection by quitting or being killed. + * Build an image + * + * @param buildContext A tar archive compressed with one of the following algorithms: identity (no compression), gzip, bzip2, xz. + * @param dockerfile Path within the build context to the `Dockerfile`. This is ignored if `remote` is specified and points to an external `Dockerfile`. + * @param t A name and optional tag to apply to the image in the `name:tag` format. If you omit the tag the default `latest` value is assumed. You can provide several `t` parameters. + * @param extrahosts Extra hosts to add to /etc/hosts + * @param remote A Git repository URI or HTTP/HTTPS context URI. If the URI points to a single text file, the file’s contents are placed into a file called `Dockerfile` and the image is built from that file. If the URI points to a tarball, the file is downloaded by the daemon and the contents therein used as the context for the build. If the URI points to a tarball and the `dockerfile` parameter is also specified, there must be a file with the corresponding path inside the tarball. + * @param q Suppress verbose build output. + * @param nocache Do not use the cache when building the image. + * @param cachefrom JSON array of images used for build cache resolution. + * @param pull Attempt to pull the image even if an older image exists locally. + * @param rm Remove intermediate containers after a successful build. + * @param forcerm Always remove intermediate containers, even upon failure. + * @param memory Set memory limit for build. + * @param memswap Total memory (memory + swap). Set as `-1` to disable swap. + * @param cpushares CPU shares (relative weight). + * @param cpusetcpus CPUs in which to allow execution (e.g., `0-3`, `0,1`). + * @param cpuperiod The length of a CPU period in microseconds. + * @param cpuquota Microseconds of CPU time that the container can get in a CPU period. + * @param buildargs JSON map of string pairs for build-time variables. Users pass these values at build-time. Docker uses the buildargs as the environment context for commands run via the `Dockerfile` RUN instruction, or for variable expansion in other `Dockerfile` instructions. This is not meant for passing secret values. For example, the build arg `FOO=bar` would become `{\"FOO\":\"bar\"}` in JSON. This would result in the query parameter `buildargs={\"FOO\":\"bar\"}`. Note that `{\"FOO\":\"bar\"}` should be URI component encoded. [Read more about the buildargs instruction.](https://docs.docker.com/engine/reference/builder/#arg) + * @param shmsize Size of `/dev/shm` in bytes. The size must be greater than 0. If omitted the system uses 64MB. + * @param squash Squash the resulting images layers into a single layer. *(Experimental release only.)* + * @param labels Arbitrary key/value labels to set on the image, as a JSON map of string pairs. + * @param networkmode Sets the networking mode for the run commands during build. Supported standard values are: `bridge`, `host`, `none`, and `container:<name|id>`. Any other value is taken as a custom network\'s name or ID to which this container should connect to. + * @param contentType + * @param xRegistryConfig This is a base64-encoded JSON object with auth configurations for multiple registries that a build may refer to. The key is a registry URL, and the value is an auth configuration object, [as described in the authentication section](#section/Authentication). For example: ``` { \"docker.example.com\": { \"username\": \"janedoe\", \"password\": \"hunter2\" }, \"https://index.docker.io/v1/\": { \"username\": \"mobydock\", \"password\": \"conta1n3rize14\" } } ``` Only the registry domain name (and port if not the default 443) are required. However, for legacy reasons, the Docker Hub registry must be specified with both a `https://` prefix and a `/v1/` suffix even though Docker will prefer to use the v2 registry API. + * @param platform Platform in the format os[/arch[/variant]] + * @param target Target build stage + * @param outputs BuildKit output configuration in the format of a stringified JSON array of objects. Each object must have two top-level properties: `Type` and `Attrs`. The `Type` property must be set to \'moby\'. The `Attrs` property is a map of attributes for the BuildKit output configuration. See https://docs.docker.com/build/exporters/oci-docker/ for more information. Example: ``` [{\"Type\":\"moby\",\"Attrs\":{\"type\":\"image\",\"force-compression\":\"true\",\"compression\":\"zstd\"}}] ``` + * @param version Version of the builder backend to use. - `1` is the first generation classic (deprecated) builder in the Docker daemon (default) - `2` is [BuildKit](https://github.com/moby/buildkit) + */ + public async imageBuild( + buildContext: stream.Readable, + callback: (event: types.BuildInfo) => void, + options?: { + dockerfile?: string; + tag?: string; + extrahosts?: string; + remote?: string; + quiet?: boolean; + nocache?: boolean; + cachefrom?: string; + pull?: string; + rm?: boolean; + forcerm?: boolean; + memory?: number; + memswap?: number; + cpushares?: number; + cpusetcpus?: string; + cpuperiod?: number; + cpuquota?: number; + buildargs?: string; + shmsize?: number; + squash?: boolean; + labels?: string; + networkmode?: string; + credentials?: Record; + platform?: string; + target?: string; + outputs?: string; + version?: '1' | '2'; + }, + ): Promise { + const headers: Record = {}; + headers['Content-Type'] = 'application/x-tar'; + + if (options?.credentials) { + headers['X-Registry-Config'] = this.authCredentials( + options.credentials, + ); + } + let imageID: string; + return this.api + .post( + '/build', + { + dockerfile: options?.dockerfile, + t: options?.tag, + extrahosts: options?.extrahosts, + remote: options?.remote, + q: options?.quiet, + nocache: options?.nocache, + cachefrom: options?.cachefrom, + pull: options?.pull, + rm: options?.rm, + forcerm: options?.forcerm, + memory: options?.memory, + memswap: options?.memswap, + cpushares: options?.cpushares, + cpusetcpus: options?.cpusetcpus, + cpuperiod: options?.cpuperiod, + cpuquota: options?.cpuquota, + buildargs: options?.buildargs, + shmsize: options?.shmsize, + squash: options?.squash, + labels: options?.labels, + networkmode: options?.networkmode, + platform: options?.platform, + target: options?.target, + outputs: options?.outputs, + version: options?.version || '2', + }, + buildContext, + headers, + (data: Buffer) => { + data.toString('utf-8') + .split('\n') + .filter((line) => line.trim() !== '') + .forEach((line) => { + let buildInfo = JSON.parse(line) as types.BuildInfo; + if (buildInfo.id === 'moby.image.id') { + imageID = buildInfo.aux?.ID || ''; + } + callback(buildInfo); + }); + }, + ) + .then(() => { + return imageID; + }); + } + /** * Create a new image from a container * @param container The ID or name of the container to commit @@ -1023,9 +1137,9 @@ export class DockerClient { author?: string; pause?: boolean; changes?: string; - containerConfig?: models.ContainerConfig; + containerConfig?: types.ContainerConfig; }, - ): Promise { + ): Promise { return this.api.post(`/commit`, { container: container, repo: options?.repo, @@ -1061,7 +1175,7 @@ export class DockerClient { repo?: string; tag?: string; message?: string; - credentials?: Credentials | IdentityToken; + credentials?: AuthConfig; changes?: Array; platform?: string; inputImage?: string; @@ -1092,10 +1206,9 @@ export class DockerClient { (data: Buffer) => { data.toString('utf-8') .split('\n') + .filter((line) => line.trim() !== '') .forEach((line) => { - if (line) { - callback(JSON.parse(line)); - } + callback(JSON.parse(line)); }); }, ); @@ -1117,7 +1230,7 @@ export class DockerClient { noprune?: boolean; platforms?: Array; }, - ): Promise> { + ): Promise> { return this.api.delete(`/images/${name}`, options); } @@ -1130,7 +1243,7 @@ export class DockerClient { public async imageGet( name: string, w: stream.Writable, - platform?: models.Platform, + platform?: types.Platform, ): Promise { return this.api.get( `/images/${name}/get`, @@ -1150,7 +1263,7 @@ export class DockerClient { */ public async imageGetAll( names: Array, - platform?: models.Platform, + platform?: types.Platform, ): Promise { return this.api.get(`/images/get`, { names: names, @@ -1170,7 +1283,7 @@ export class DockerClient { options?: { platform?: string; }, - ): Promise> { + ): Promise> { return this.api.get(`/image/${name}/history`, options); } @@ -1186,7 +1299,7 @@ export class DockerClient { options?: { manifests?: boolean; }, - ): Promise { + ): Promise { return this.api.get(`/images/${name}/json`, options); } @@ -1206,7 +1319,7 @@ export class DockerClient { sharedSize?: boolean; digests?: boolean; manifests?: boolean; - }): Promise> { + }): Promise> { return this.api.get('/images/json', options); } @@ -1242,7 +1355,7 @@ export class DockerClient { */ public async imagePrune( filters?: Filter, - ): Promise { + ): Promise { return this.api.post(`/images/prune`, { filters: filters, }); @@ -1259,7 +1372,7 @@ export class DockerClient { public async imagePush( name: string, options: { - credentials: Credentials | IdentityToken; + credentials: AuthConfig; tag?: string; platform?: Platform; callback: (event: any) => void; @@ -1313,8 +1426,8 @@ export class DockerClient { */ public async containerExec( id: string, - execConfig: models.ExecConfig, - ): Promise { + execConfig: types.ExecConfig, + ): Promise { return this.api.post(`/containers/${id}/exec`, undefined, execConfig); } @@ -1323,7 +1436,7 @@ export class DockerClient { * Inspect an exec instance * @param id Exec instance ID */ - public async execInspect(id: string): Promise { + public async execInspect(id: string): Promise { return this.api.get(`/exec/${id}/json`); } @@ -1353,7 +1466,7 @@ export class DockerClient { */ public async execStart( id: string, - execStartConfig?: models.ExecStartConfig, + execStartConfig?: types.ExecStartConfig, ): Promise { return this.api.post(`/exec/${id}/start`, undefined, execStartConfig); } diff --git a/lib/http.ts b/lib/http.ts index 1d142f6..5b4168a 100644 --- a/lib/http.ts +++ b/lib/http.ts @@ -30,6 +30,30 @@ export class ConflictError extends Error { } } +// Function to parse content-type header and extract charset parameter +function parseContentType(contentType?: string): { + type: string; + charset?: string; +} { + if (!contentType) { + return { type: '' }; + } + + const parts = contentType.split(';').map((part) => part.trim()); + const type = parts[0]?.toLowerCase() || ''; + + let charset: string | undefined; + for (let i = 1; i < parts.length; i++) { + const param = parts[i]?.toLowerCase() || ''; + if (param.startsWith('charset=')) { + charset = param.split('=')[1]; + break; + } + } + + return { type, charset }; +} + // Function to extract error message from response body function getErrorMessageFromResp( res: http.IncomingMessage, @@ -77,7 +101,7 @@ export class HTTPClient { options?: { params?: Record; data?: any; - callback?: (data: Buffer) => void; + callback?: (data: Buffer, encoding?: string) => void; accept?: string; headers?: Record; }, @@ -191,14 +215,16 @@ export class HTTPClient { // Check for Docker stream content types const contentType = res.headers['content-type']; + const { type: mimeType, charset } = + parseContentType(contentType); const isDockerStream = - contentType === DOCKER_RAW_STREAM || - contentType === DOCKER_MULTIPLEXED_STREAM; + mimeType === DOCKER_RAW_STREAM || + mimeType === DOCKER_MULTIPLEXED_STREAM; if (isDockerStream && callback) { // For upgrade protocols, forward all data directly to callback res.on('data', (data: Buffer) => { - callback(data); + callback(data, charset || 'utf8'); }); // Resolve immediately with upgrade response @@ -212,7 +238,7 @@ export class HTTPClient { callback ) { res.on('data', (chunk: Buffer) => { - callback(chunk); + callback(chunk, charset); }); res.on('end', () => handleResponseEnd()); diff --git a/lib/models/Address.ts b/lib/types/Address.ts similarity index 100% rename from lib/models/Address.ts rename to lib/types/Address.ts diff --git a/lib/models/AuthConfig.ts b/lib/types/AuthConfig.ts similarity index 91% rename from lib/models/AuthConfig.ts rename to lib/types/AuthConfig.ts index c5f52e3..ebc406a 100644 --- a/lib/models/AuthConfig.ts +++ b/lib/types/AuthConfig.ts @@ -19,14 +19,14 @@ */ export interface AuthConfig { - Username?: string; + username?: string; - Password?: string; + password?: string; /** * Email is an optional value associated with the username. > **Deprecated**: This field is deprecated since docker 1.11 (API v1.23) and will be removed in a future release. */ - Email?: string; + email?: string; - Serveraddress?: string; + serveraddress?: string; } diff --git a/lib/models/BuildCache.ts b/lib/types/BuildCache.ts similarity index 100% rename from lib/models/BuildCache.ts rename to lib/types/BuildCache.ts diff --git a/lib/models/BuildInfo.ts b/lib/types/BuildInfo.ts similarity index 70% rename from lib/models/BuildInfo.ts rename to lib/types/BuildInfo.ts index 25b2097..c20b2e9 100644 --- a/lib/models/BuildInfo.ts +++ b/lib/types/BuildInfo.ts @@ -18,20 +18,20 @@ Do not edit the class manually. */ -import { type ErrorDetail } from '../models/ErrorDetail.js'; -import { type ImageID } from '../models/ImageID.js'; -import { type ProgressDetail } from '../models/ProgressDetail.js'; +import { type ErrorDetail } from '../types/ErrorDetail.js'; +import { type ImageID } from '../types/ImageID.js'; +import { type ProgressDetail } from '../types/ProgressDetail.js'; export interface BuildInfo { - Id?: string; + id?: string; - Stream?: string; + stream?: string; - ErrorDetail?: ErrorDetail; + errorDetail?: ErrorDetail; - Status?: string; + status?: string; - ProgressDetail?: ProgressDetail; + progressDetail?: ProgressDetail; - Aux?: ImageID; + aux?: ImageID; } diff --git a/lib/models/BuildPruneResponse.ts b/lib/types/BuildPruneResponse.ts similarity index 100% rename from lib/models/BuildPruneResponse.ts rename to lib/types/BuildPruneResponse.ts diff --git a/lib/models/ChangeType.ts b/lib/types/ChangeType.ts similarity index 100% rename from lib/models/ChangeType.ts rename to lib/types/ChangeType.ts diff --git a/lib/models/ClusterInfo.ts b/lib/types/ClusterInfo.ts similarity index 92% rename from lib/models/ClusterInfo.ts rename to lib/types/ClusterInfo.ts index 9be9c0c..09c13dd 100644 --- a/lib/models/ClusterInfo.ts +++ b/lib/types/ClusterInfo.ts @@ -18,9 +18,9 @@ Do not edit the class manually. */ -import { type ObjectVersion } from '../models/ObjectVersion.js'; -import { type SwarmSpec } from '../models/SwarmSpec.js'; -import { type TLSInfo } from '../models/TLSInfo.js'; +import { type ObjectVersion } from '../types/ObjectVersion.js'; +import { type SwarmSpec } from '../types/SwarmSpec.js'; +import { type TLSInfo } from '../types/TLSInfo.js'; /** * ClusterInfo represents information about the swarm as is returned by the \"/info\" endpoint. Join-tokens are not included. diff --git a/lib/models/ClusterVolume.ts b/lib/types/ClusterVolume.ts similarity index 82% rename from lib/models/ClusterVolume.ts rename to lib/types/ClusterVolume.ts index 5ab4b7c..409a4ca 100644 --- a/lib/models/ClusterVolume.ts +++ b/lib/types/ClusterVolume.ts @@ -18,10 +18,10 @@ Do not edit the class manually. */ -import { type ClusterVolumeInfo } from '../models/ClusterVolumeInfo.js'; -import { type ClusterVolumePublishStatusInner } from '../models/ClusterVolumePublishStatusInner.js'; -import { type ClusterVolumeSpec } from '../models/ClusterVolumeSpec.js'; -import { type ObjectVersion } from '../models/ObjectVersion.js'; +import { type ClusterVolumeInfo } from '../types/ClusterVolumeInfo.js'; +import { type ClusterVolumePublishStatusInner } from '../types/ClusterVolumePublishStatusInner.js'; +import { type ClusterVolumeSpec } from '../types/ClusterVolumeSpec.js'; +import { type ObjectVersion } from '../types/ObjectVersion.js'; /** * Options and information specific to, and only present on, Swarm CSI cluster volumes. diff --git a/lib/models/ClusterVolumeInfo.ts b/lib/types/ClusterVolumeInfo.ts similarity index 100% rename from lib/models/ClusterVolumeInfo.ts rename to lib/types/ClusterVolumeInfo.ts diff --git a/lib/models/ClusterVolumePublishStatusInner.ts b/lib/types/ClusterVolumePublishStatusInner.ts similarity index 100% rename from lib/models/ClusterVolumePublishStatusInner.ts rename to lib/types/ClusterVolumePublishStatusInner.ts diff --git a/lib/models/ClusterVolumeSpec.ts b/lib/types/ClusterVolumeSpec.ts similarity index 93% rename from lib/models/ClusterVolumeSpec.ts rename to lib/types/ClusterVolumeSpec.ts index f045d1c..184351d 100644 --- a/lib/models/ClusterVolumeSpec.ts +++ b/lib/types/ClusterVolumeSpec.ts @@ -18,7 +18,7 @@ Do not edit the class manually. */ -import { type ClusterVolumeSpecAccessMode } from '../models/ClusterVolumeSpecAccessMode.js'; +import { type ClusterVolumeSpecAccessMode } from '../types/ClusterVolumeSpecAccessMode.js'; /** * Cluster-specific options used to create the volume. diff --git a/lib/models/ClusterVolumeSpecAccessMode.ts b/lib/types/ClusterVolumeSpecAccessMode.ts similarity index 95% rename from lib/models/ClusterVolumeSpecAccessMode.ts rename to lib/types/ClusterVolumeSpecAccessMode.ts index 8b9c9c3..b1df310 100644 --- a/lib/models/ClusterVolumeSpecAccessMode.ts +++ b/lib/types/ClusterVolumeSpecAccessMode.ts @@ -18,9 +18,9 @@ Do not edit the class manually. */ -import { type ClusterVolumeSpecAccessModeAccessibilityRequirements } from '../models/ClusterVolumeSpecAccessModeAccessibilityRequirements.js'; -import { type ClusterVolumeSpecAccessModeCapacityRange } from '../models/ClusterVolumeSpecAccessModeCapacityRange.js'; -import { type ClusterVolumeSpecAccessModeSecretsInner } from '../models/ClusterVolumeSpecAccessModeSecretsInner.js'; +import { type ClusterVolumeSpecAccessModeAccessibilityRequirements } from '../types/ClusterVolumeSpecAccessModeAccessibilityRequirements.js'; +import { type ClusterVolumeSpecAccessModeCapacityRange } from '../types/ClusterVolumeSpecAccessModeCapacityRange.js'; +import { type ClusterVolumeSpecAccessModeSecretsInner } from '../types/ClusterVolumeSpecAccessModeSecretsInner.js'; /** * Defines how the volume is used by tasks. diff --git a/lib/models/ClusterVolumeSpecAccessModeAccessibilityRequirements.ts b/lib/types/ClusterVolumeSpecAccessModeAccessibilityRequirements.ts similarity index 100% rename from lib/models/ClusterVolumeSpecAccessModeAccessibilityRequirements.ts rename to lib/types/ClusterVolumeSpecAccessModeAccessibilityRequirements.ts diff --git a/lib/models/ClusterVolumeSpecAccessModeCapacityRange.ts b/lib/types/ClusterVolumeSpecAccessModeCapacityRange.ts similarity index 100% rename from lib/models/ClusterVolumeSpecAccessModeCapacityRange.ts rename to lib/types/ClusterVolumeSpecAccessModeCapacityRange.ts diff --git a/lib/models/ClusterVolumeSpecAccessModeSecretsInner.ts b/lib/types/ClusterVolumeSpecAccessModeSecretsInner.ts similarity index 100% rename from lib/models/ClusterVolumeSpecAccessModeSecretsInner.ts rename to lib/types/ClusterVolumeSpecAccessModeSecretsInner.ts diff --git a/lib/models/Commit.ts b/lib/types/Commit.ts similarity index 100% rename from lib/models/Commit.ts rename to lib/types/Commit.ts diff --git a/lib/models/Config.ts b/lib/types/Config.ts similarity index 88% rename from lib/models/Config.ts rename to lib/types/Config.ts index 17661dc..13d553e 100644 --- a/lib/models/Config.ts +++ b/lib/types/Config.ts @@ -18,8 +18,8 @@ Do not edit the class manually. */ -import { type ConfigSpec } from '../models/ConfigSpec.js'; -import { type ObjectVersion } from '../models/ObjectVersion.js'; +import { type ConfigSpec } from '../types/ConfigSpec.js'; +import { type ObjectVersion } from '../types/ObjectVersion.js'; export interface Config { ID?: string; diff --git a/lib/models/ConfigCreateRequest.ts b/lib/types/ConfigCreateRequest.ts similarity index 96% rename from lib/models/ConfigCreateRequest.ts rename to lib/types/ConfigCreateRequest.ts index eb4175a..79fa758 100644 --- a/lib/models/ConfigCreateRequest.ts +++ b/lib/types/ConfigCreateRequest.ts @@ -18,7 +18,7 @@ Do not edit the class manually. */ -import { type Driver } from '../models/Driver.js'; +import { type Driver } from '../types/Driver.js'; export interface ConfigCreateRequest { /** diff --git a/lib/models/ConfigReference.ts b/lib/types/ConfigReference.ts similarity index 100% rename from lib/models/ConfigReference.ts rename to lib/types/ConfigReference.ts diff --git a/lib/models/ConfigSpec.ts b/lib/types/ConfigSpec.ts similarity index 96% rename from lib/models/ConfigSpec.ts rename to lib/types/ConfigSpec.ts index fc24c1a..9211e5d 100644 --- a/lib/models/ConfigSpec.ts +++ b/lib/types/ConfigSpec.ts @@ -18,7 +18,7 @@ Do not edit the class manually. */ -import { type Driver } from '../models/Driver.js'; +import { type Driver } from '../types/Driver.js'; export interface ConfigSpec { /** diff --git a/lib/models/ContainerBlkioStatEntry.ts b/lib/types/ContainerBlkioStatEntry.ts similarity index 92% rename from lib/models/ContainerBlkioStatEntry.ts rename to lib/types/ContainerBlkioStatEntry.ts index 0f2829a..3c3ce0c 100644 --- a/lib/models/ContainerBlkioStatEntry.ts +++ b/lib/types/ContainerBlkioStatEntry.ts @@ -22,11 +22,11 @@ * Blkio stats entry. This type is Linux-specific and omitted for Windows containers. */ export interface ContainerBlkioStatEntry { - Major?: number; + major?: number; - Minor?: number; + minor?: number; - Op?: string; + op?: string; - Value?: number; + value?: number; } diff --git a/lib/models/ContainerBlkioStats.ts b/lib/types/ContainerBlkioStats.ts similarity index 78% rename from lib/models/ContainerBlkioStats.ts rename to lib/types/ContainerBlkioStats.ts index 0baa602..073d7bd 100644 --- a/lib/models/ContainerBlkioStats.ts +++ b/lib/types/ContainerBlkioStats.ts @@ -18,46 +18,46 @@ Do not edit the class manually. */ -import { type ContainerBlkioStatEntry } from '../models/ContainerBlkioStatEntry.js'; +import { type ContainerBlkioStatEntry } from '../types/ContainerBlkioStatEntry.js'; /** * BlkioStats stores all IO service stats for data read and write. This type is Linux-specific and holds many fields that are specific to cgroups v1. On a cgroup v2 host, all fields other than `io_service_bytes_recursive` are omitted or `null`. This type is only populated on Linux and omitted for Windows containers. */ export interface ContainerBlkioStats { - IoServiceBytesRecursive?: Array; + io_service_bytes_recursive?: Array; /** * This field is only available when using Linux containers with cgroups v1. It is omitted or `null` when using cgroups v2. */ - IoServicedRecursive?: Array | null; + io_serviced_recursive?: Array | null; /** * This field is only available when using Linux containers with cgroups v1. It is omitted or `null` when using cgroups v2. */ - IoQueueRecursive?: Array | null; + io_queue_recursive?: Array | null; /** * This field is only available when using Linux containers with cgroups v1. It is omitted or `null` when using cgroups v2. */ - IoServiceTimeRecursive?: Array | null; + io_service_time_recursive?: Array | null; /** * This field is only available when using Linux containers with cgroups v1. It is omitted or `null` when using cgroups v2. */ - IoWaitTimeRecursive?: Array | null; + io_wait_time_recursive?: Array | null; /** * This field is only available when using Linux containers with cgroups v1. It is omitted or `null` when using cgroups v2. */ - IoMergedRecursive?: Array | null; + io_merged_recursive?: Array | null; /** * This field is only available when using Linux containers with cgroups v1. It is omitted or `null` when using cgroups v2. */ - IoTimeRecursive?: Array | null; + io_time_recursive?: Array | null; /** * This field is only available when using Linux containers with cgroups v1. It is omitted or `null` when using cgroups v2. */ - SectorsRecursive?: Array | null; + sectors_recursive?: Array | null; } diff --git a/lib/models/ContainerCPUStats.ts b/lib/types/ContainerCPUStats.ts similarity index 76% rename from lib/models/ContainerCPUStats.ts rename to lib/types/ContainerCPUStats.ts index 70dce10..4e9a58f 100644 --- a/lib/models/ContainerCPUStats.ts +++ b/lib/types/ContainerCPUStats.ts @@ -18,24 +18,24 @@ Do not edit the class manually. */ -import { type ContainerCPUUsage } from '../models/ContainerCPUUsage.js'; -import { type ContainerThrottlingData } from '../models/ContainerThrottlingData.js'; +import { type ContainerCPUUsage } from '../types/ContainerCPUUsage.js'; +import { type ContainerThrottlingData } from '../types/ContainerThrottlingData.js'; /** * CPU related info of the container */ export interface ContainerCPUStats { - CpuUsage?: ContainerCPUUsage | null; + cpu_usage?: ContainerCPUUsage | null; /** * System Usage. This field is Linux-specific and omitted for Windows containers. */ - SystemCpuUsage?: number | null; + system_cpu_usage?: number | null; /** * Number of online CPUs. This field is Linux-specific and omitted for Windows containers. */ - OnlineCpus?: number | null; + online_cpus?: number | null; - ThrottlingData?: ContainerThrottlingData | null; + throttling_data?: ContainerThrottlingData | null; } diff --git a/lib/models/ContainerCPUUsage.ts b/lib/types/ContainerCPUUsage.ts similarity index 92% rename from lib/models/ContainerCPUUsage.ts rename to lib/types/ContainerCPUUsage.ts index 39e09e2..82117cb 100644 --- a/lib/models/ContainerCPUUsage.ts +++ b/lib/types/ContainerCPUUsage.ts @@ -25,20 +25,20 @@ export interface ContainerCPUUsage { /** * Total CPU time consumed in nanoseconds (Linux) or 100\'s of nanoseconds (Windows). */ - TotalUsage?: number; + total_usage?: number; /** * Total CPU time (in nanoseconds) consumed per core (Linux). This field is Linux-specific when using cgroups v1. It is omitted when using cgroups v2 and Windows containers. */ - PercpuUsage?: Array | null; + percpu_usage?: Array | null; /** * Time (in nanoseconds) spent by tasks of the cgroup in kernel mode (Linux), or time spent (in 100\'s of nanoseconds) by all container processes in kernel mode (Windows). Not populated for Windows containers using Hyper-V isolation. */ - UsageInKernelmode?: number; + usage_in_kernelmode?: number; /** * Time (in nanoseconds) spent by tasks of the cgroup in user mode (Linux), or time spent (in 100\'s of nanoseconds) by all container processes in kernel mode (Windows). Not populated for Windows containers using Hyper-V isolation. */ - UsageInUsermode?: number; + usage_in_usermode?: number; } diff --git a/lib/models/ContainerConfig.ts b/lib/types/ContainerConfig.ts similarity index 98% rename from lib/models/ContainerConfig.ts rename to lib/types/ContainerConfig.ts index 999192e..5e6ef0d 100644 --- a/lib/models/ContainerConfig.ts +++ b/lib/types/ContainerConfig.ts @@ -18,7 +18,7 @@ Do not edit the class manually. */ -import { type HealthConfig } from '../models/HealthConfig.js'; +import { type HealthConfig } from '../types/HealthConfig.js'; /** * Configuration for a container that is portable between hosts. diff --git a/lib/models/ContainerCreateRequest.ts b/lib/types/ContainerCreateRequest.ts similarity index 95% rename from lib/models/ContainerCreateRequest.ts rename to lib/types/ContainerCreateRequest.ts index 229aaa1..fab4cba 100644 --- a/lib/models/ContainerCreateRequest.ts +++ b/lib/types/ContainerCreateRequest.ts @@ -18,9 +18,9 @@ Do not edit the class manually. */ -import { type HealthConfig } from '../models/HealthConfig.js'; -import { type HostConfig } from '../models/HostConfig.js'; -import { type NetworkingConfig } from '../models/NetworkingConfig.js'; +import { type HealthConfig } from '../types/HealthConfig.js'; +import { type HostConfig } from '../types/HostConfig.js'; +import { type NetworkingConfig } from '../types/NetworkingConfig.js'; export interface ContainerCreateRequest { /** diff --git a/lib/models/ContainerCreateResponse.ts b/lib/types/ContainerCreateResponse.ts similarity index 100% rename from lib/models/ContainerCreateResponse.ts rename to lib/types/ContainerCreateResponse.ts diff --git a/lib/models/ContainerInspectResponse.ts b/lib/types/ContainerInspectResponse.ts similarity index 90% rename from lib/models/ContainerInspectResponse.ts rename to lib/types/ContainerInspectResponse.ts index 7152150..7fce537 100644 --- a/lib/models/ContainerInspectResponse.ts +++ b/lib/types/ContainerInspectResponse.ts @@ -18,13 +18,13 @@ Do not edit the class manually. */ -import { type ContainerConfig } from '../models/ContainerConfig.js'; -import { type ContainerState } from '../models/ContainerState.js'; -import { type DriverData } from '../models/DriverData.js'; -import { type HostConfig } from '../models/HostConfig.js'; -import { type MountPoint } from '../models/MountPoint.js'; -import { type NetworkSettings } from '../models/NetworkSettings.js'; -import { type OCIDescriptor } from '../models/OCIDescriptor.js'; +import { type ContainerConfig } from '../types/ContainerConfig.js'; +import { type ContainerState } from '../types/ContainerState.js'; +import { type DriverData } from '../types/DriverData.js'; +import { type HostConfig } from '../types/HostConfig.js'; +import { type MountPoint } from '../types/MountPoint.js'; +import { type NetworkSettings } from '../types/NetworkSettings.js'; +import { type OCIDescriptor } from '../types/OCIDescriptor.js'; export interface ContainerInspectResponse { /** diff --git a/lib/models/ContainerMemoryStats.ts b/lib/types/ContainerMemoryStats.ts similarity index 88% rename from lib/models/ContainerMemoryStats.ts rename to lib/types/ContainerMemoryStats.ts index 4c625b3..1be52fe 100644 --- a/lib/models/ContainerMemoryStats.ts +++ b/lib/types/ContainerMemoryStats.ts @@ -25,40 +25,40 @@ export interface ContainerMemoryStats { /** * Current `res_counter` usage for memory. This field is Linux-specific and omitted for Windows containers. */ - Usage?: number | null; + usage?: number | null; /** * Maximum usage ever recorded. This field is Linux-specific and only supported on cgroups v1. It is omitted when using cgroups v2 and for Windows containers. */ - MaxUsage?: number | null; + max_usage?: number | null; /** * All the stats exported via memory.stat. when using cgroups v2. This field is Linux-specific and omitted for Windows containers. */ - Stats?: { [key: string]: number | null }; + stats?: { [key: string]: number | null }; /** * Number of times memory usage hits limits. This field is Linux-specific and only supported on cgroups v1. It is omitted when using cgroups v2 and for Windows containers. */ - Failcnt?: number | null; + failcnt?: number | null; /** * This field is Linux-specific and omitted for Windows containers. */ - Limit?: number | null; + limit?: number | null; /** * Committed bytes. This field is Windows-specific and omitted for Linux containers. */ - Commitbytes?: number | null; + commitbytes?: number | null; /** * Peak committed bytes. This field is Windows-specific and omitted for Linux containers. */ - Commitpeakbytes?: number | null; + commitpeakbytes?: number | null; /** * Private working set. This field is Windows-specific and omitted for Linux containers. */ - Privateworkingset?: number | null; + privateworkingset?: number | null; } diff --git a/lib/models/ContainerNetworkStats.ts b/lib/types/ContainerNetworkStats.ts similarity index 86% rename from lib/models/ContainerNetworkStats.ts rename to lib/types/ContainerNetworkStats.ts index 5708ce1..872bae3 100644 --- a/lib/models/ContainerNetworkStats.ts +++ b/lib/types/ContainerNetworkStats.ts @@ -25,50 +25,50 @@ export interface ContainerNetworkStats { /** * Bytes received. Windows and Linux. */ - RxBytes?: number; + rx_bytes?: number; /** * Packets received. Windows and Linux. */ - RxPackets?: number; + rx_packets?: number; /** * Received errors. Not used on Windows. This field is Linux-specific and always zero for Windows containers. */ - RxErrors?: number; + rx_errors?: number; /** * Incoming packets dropped. Windows and Linux. */ - RxDropped?: number; + rx_dropped?: number; /** * Bytes sent. Windows and Linux. */ - TxBytes?: number; + tx_bytes?: number; /** * Packets sent. Windows and Linux. */ - TxPackets?: number; + tx_packets?: number; /** * Sent errors. Not used on Windows. This field is Linux-specific and always zero for Windows containers. */ - TxErrors?: number; + tx_errors?: number; /** * Outgoing packets dropped. Windows and Linux. */ - TxDropped?: number; + tx_dropped?: number; /** * Endpoint ID. Not used on Linux. This field is Windows-specific and omitted for Linux containers. */ - EndpointId?: string | null; + endpoint_id?: string | null; /** * Instance ID. Not used on Linux. This field is Windows-specific and omitted for Linux containers. */ - InstanceId?: string | null; + instance_id?: string | null; } diff --git a/lib/models/ContainerPidsStats.ts b/lib/types/ContainerPidsStats.ts similarity index 95% rename from lib/models/ContainerPidsStats.ts rename to lib/types/ContainerPidsStats.ts index 2ee4a49..5de6a96 100644 --- a/lib/models/ContainerPidsStats.ts +++ b/lib/types/ContainerPidsStats.ts @@ -25,10 +25,10 @@ export interface ContainerPidsStats { /** * Current is the number of PIDs in the cgroup. */ - Current?: number | null; + current?: number | null; /** * Limit is the hard limit on the number of pids in the cgroup. A \"Limit\" of 0 means that there is no limit. */ - Limit?: number | null; + limit?: number | null; } diff --git a/lib/models/ContainerPruneResponse.ts b/lib/types/ContainerPruneResponse.ts similarity index 100% rename from lib/models/ContainerPruneResponse.ts rename to lib/types/ContainerPruneResponse.ts diff --git a/lib/models/ContainerState.ts b/lib/types/ContainerState.ts similarity index 98% rename from lib/models/ContainerState.ts rename to lib/types/ContainerState.ts index dc0d9e2..9084e86 100644 --- a/lib/models/ContainerState.ts +++ b/lib/types/ContainerState.ts @@ -18,7 +18,7 @@ Do not edit the class manually. */ -import { type Health } from '../models/Health.js'; +import { type Health } from '../types/Health.js'; /** * ContainerState stores container\'s running state. It\'s part of ContainerJSONBase and will be returned by the \"inspect\" command. diff --git a/lib/models/ContainerStatsResponse.ts b/lib/types/ContainerStatsResponse.ts similarity index 69% rename from lib/models/ContainerStatsResponse.ts rename to lib/types/ContainerStatsResponse.ts index 6150300..29c71df 100644 --- a/lib/models/ContainerStatsResponse.ts +++ b/lib/types/ContainerStatsResponse.ts @@ -18,11 +18,11 @@ Do not edit the class manually. */ -import { type ContainerBlkioStats } from '../models/ContainerBlkioStats.js'; -import { type ContainerCPUStats } from '../models/ContainerCPUStats.js'; -import { type ContainerMemoryStats } from '../models/ContainerMemoryStats.js'; -import { type ContainerPidsStats } from '../models/ContainerPidsStats.js'; -import { type ContainerStorageStats } from '../models/ContainerStorageStats.js'; +import { type ContainerBlkioStats } from '../types/ContainerBlkioStats.js'; +import { type ContainerCPUStats } from '../types/ContainerCPUStats.js'; +import { type ContainerMemoryStats } from '../types/ContainerMemoryStats.js'; +import { type ContainerPidsStats } from '../types/ContainerPidsStats.js'; +import { type ContainerStorageStats } from '../types/ContainerStorageStats.js'; /** * Statistics sample for a container. @@ -31,42 +31,42 @@ export interface ContainerStatsResponse { /** * Name of the container */ - Name?: string | null; + name?: string | null; /** * ID of the container */ - Id?: string | null; + id?: string | null; /** * Date and time at which this sample was collected. The value is formatted as [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) with nano-seconds. */ - Read?: Date; + read?: Date; /** * Date and time at which this first sample was collected. This field is not propagated if the \"one-shot\" option is set. If the \"one-shot\" option is set, this field may be omitted, empty, or set to a default date (`0001-01-01T00:00:00Z`). The value is formatted as [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) with nano-seconds. */ - Preread?: Date; + preread?: Date; - PidsStats?: ContainerPidsStats | null; + pids_stats?: ContainerPidsStats | null; - BlkioStats?: ContainerBlkioStats | null; + blkio_stats?: ContainerBlkioStats | null; /** * The number of processors on the system. This field is Windows-specific and always zero for Linux containers. */ - NumProcs?: number; + num_procs?: number; - StorageStats?: ContainerStorageStats | null; + storage_stats?: ContainerStorageStats | null; - CpuStats?: ContainerCPUStats | null; + cpu_stats?: ContainerCPUStats | null; - PrecpuStats?: ContainerCPUStats | null; + precpu_stats?: ContainerCPUStats | null; - MemoryStats?: ContainerMemoryStats; + memory_stats?: ContainerMemoryStats; /** * Network statistics for the container per interface. This field is omitted if the container has no networking enabled. */ - Networks?: any | null; + networks?: any | null; } diff --git a/lib/models/ContainerStatus.ts b/lib/types/ContainerStatus.ts similarity index 100% rename from lib/models/ContainerStatus.ts rename to lib/types/ContainerStatus.ts diff --git a/lib/models/ContainerStorageStats.ts b/lib/types/ContainerStorageStats.ts similarity index 85% rename from lib/models/ContainerStorageStats.ts rename to lib/types/ContainerStorageStats.ts index c3acc8b..59278e4 100644 --- a/lib/models/ContainerStorageStats.ts +++ b/lib/types/ContainerStorageStats.ts @@ -22,11 +22,11 @@ * StorageStats is the disk I/O stats for read/write on Windows. This type is Windows-specific and omitted for Linux containers. */ export interface ContainerStorageStats { - ReadCountNormalized?: number | null; + read_count_normalized?: number | null; - ReadSizeBytes?: number | null; + read_size_bytes?: number | null; - WriteCountNormalized?: number | null; + write_count_normalized?: number | null; - WriteSizeBytes?: number | null; + write_size_bytes?: number | null; } diff --git a/lib/models/ContainerSummary.ts b/lib/types/ContainerSummary.ts similarity index 89% rename from lib/models/ContainerSummary.ts rename to lib/types/ContainerSummary.ts index 51b15cc..4234b38 100644 --- a/lib/models/ContainerSummary.ts +++ b/lib/types/ContainerSummary.ts @@ -18,12 +18,12 @@ Do not edit the class manually. */ -import { type ContainerSummaryHealth } from '../models/ContainerSummaryHealth.js'; -import { type ContainerSummaryHostConfig } from '../models/ContainerSummaryHostConfig.js'; -import { type ContainerSummaryNetworkSettings } from '../models/ContainerSummaryNetworkSettings.js'; -import { type MountPoint } from '../models/MountPoint.js'; -import { type OCIDescriptor } from '../models/OCIDescriptor.js'; -import { type PortSummary } from '../models/PortSummary.js'; +import { type ContainerSummaryHealth } from '../types/ContainerSummaryHealth.js'; +import { type ContainerSummaryHostConfig } from '../types/ContainerSummaryHostConfig.js'; +import { type ContainerSummaryNetworkSettings } from '../types/ContainerSummaryNetworkSettings.js'; +import { type MountPoint } from '../types/MountPoint.js'; +import { type OCIDescriptor } from '../types/OCIDescriptor.js'; +import { type PortSummary } from '../types/PortSummary.js'; export interface ContainerSummary { /** diff --git a/lib/models/ContainerSummaryHealth.ts b/lib/types/ContainerSummaryHealth.ts similarity index 100% rename from lib/models/ContainerSummaryHealth.ts rename to lib/types/ContainerSummaryHealth.ts diff --git a/lib/models/ContainerSummaryHostConfig.ts b/lib/types/ContainerSummaryHostConfig.ts similarity index 100% rename from lib/models/ContainerSummaryHostConfig.ts rename to lib/types/ContainerSummaryHostConfig.ts diff --git a/lib/models/ContainerSummaryNetworkSettings.ts b/lib/types/ContainerSummaryNetworkSettings.ts similarity index 93% rename from lib/models/ContainerSummaryNetworkSettings.ts rename to lib/types/ContainerSummaryNetworkSettings.ts index df8cf71..ea85929 100644 --- a/lib/models/ContainerSummaryNetworkSettings.ts +++ b/lib/types/ContainerSummaryNetworkSettings.ts @@ -18,7 +18,7 @@ Do not edit the class manually. */ -import { type EndpointSettings } from '../models/EndpointSettings.js'; +import { type EndpointSettings } from '../types/EndpointSettings.js'; /** * Summary of the container\'s network settings diff --git a/lib/models/ContainerThrottlingData.ts b/lib/types/ContainerThrottlingData.ts similarity index 93% rename from lib/models/ContainerThrottlingData.ts rename to lib/types/ContainerThrottlingData.ts index afd2e82..a26b08f 100644 --- a/lib/models/ContainerThrottlingData.ts +++ b/lib/types/ContainerThrottlingData.ts @@ -25,15 +25,15 @@ export interface ContainerThrottlingData { /** * Number of periods with throttling active. */ - Periods?: number; + periods?: number; /** * Number of periods when the container hit its throttling limit. */ - ThrottledPeriods?: number; + throttled_periods?: number; /** * Aggregated time (in nanoseconds) the container was throttled for. */ - ThrottledTime?: number; + throttled_time?: number; } diff --git a/lib/models/ContainerTopResponse.ts b/lib/types/ContainerTopResponse.ts similarity index 100% rename from lib/models/ContainerTopResponse.ts rename to lib/types/ContainerTopResponse.ts diff --git a/lib/models/ContainerUpdateRequest.ts b/lib/types/ContainerUpdateRequest.ts similarity index 93% rename from lib/models/ContainerUpdateRequest.ts rename to lib/types/ContainerUpdateRequest.ts index d94fe23..5cedcdd 100644 --- a/lib/models/ContainerUpdateRequest.ts +++ b/lib/types/ContainerUpdateRequest.ts @@ -18,12 +18,12 @@ Do not edit the class manually. */ -import { type DeviceMapping } from '../models/DeviceMapping.js'; -import { type DeviceRequest } from '../models/DeviceRequest.js'; -import { type ResourcesBlkioWeightDeviceInner } from '../models/ResourcesBlkioWeightDeviceInner.js'; -import { type ResourcesUlimitsInner } from '../models/ResourcesUlimitsInner.js'; -import { type RestartPolicy } from '../models/RestartPolicy.js'; -import { type ThrottleDevice } from '../models/ThrottleDevice.js'; +import { type DeviceMapping } from '../types/DeviceMapping.js'; +import { type DeviceRequest } from '../types/DeviceRequest.js'; +import { type ResourcesBlkioWeightDeviceInner } from '../types/ResourcesBlkioWeightDeviceInner.js'; +import { type ResourcesUlimitsInner } from '../types/ResourcesUlimitsInner.js'; +import { type RestartPolicy } from '../types/RestartPolicy.js'; +import { type ThrottleDevice } from '../types/ThrottleDevice.js'; export interface ContainerUpdateRequest { /** diff --git a/lib/models/ContainerUpdateResponse.ts b/lib/types/ContainerUpdateResponse.ts similarity index 100% rename from lib/models/ContainerUpdateResponse.ts rename to lib/types/ContainerUpdateResponse.ts diff --git a/lib/models/ContainerWaitExitError.ts b/lib/types/ContainerWaitExitError.ts similarity index 100% rename from lib/models/ContainerWaitExitError.ts rename to lib/types/ContainerWaitExitError.ts diff --git a/lib/models/ContainerWaitResponse.ts b/lib/types/ContainerWaitResponse.ts similarity index 92% rename from lib/models/ContainerWaitResponse.ts rename to lib/types/ContainerWaitResponse.ts index 7a59415..f9cf56f 100644 --- a/lib/models/ContainerWaitResponse.ts +++ b/lib/types/ContainerWaitResponse.ts @@ -18,7 +18,7 @@ Do not edit the class manually. */ -import { type ContainerWaitExitError } from '../models/ContainerWaitExitError.js'; +import { type ContainerWaitExitError } from '../types/ContainerWaitExitError.js'; /** * OK response to ContainerWait operation diff --git a/lib/models/ContainerdInfo.ts b/lib/types/ContainerdInfo.ts similarity index 92% rename from lib/models/ContainerdInfo.ts rename to lib/types/ContainerdInfo.ts index 8ea0bd8..3208e84 100644 --- a/lib/models/ContainerdInfo.ts +++ b/lib/types/ContainerdInfo.ts @@ -18,7 +18,7 @@ Do not edit the class manually. */ -import { type ContainerdInfoNamespaces } from '../models/ContainerdInfoNamespaces.js'; +import { type ContainerdInfoNamespaces } from '../types/ContainerdInfoNamespaces.js'; /** * Information for connecting to the containerd instance that is used by the daemon. This is included for debugging purposes only. diff --git a/lib/models/ContainerdInfoNamespaces.ts b/lib/types/ContainerdInfoNamespaces.ts similarity index 100% rename from lib/models/ContainerdInfoNamespaces.ts rename to lib/types/ContainerdInfoNamespaces.ts diff --git a/lib/models/CreateImageInfo.ts b/lib/types/CreateImageInfo.ts similarity index 77% rename from lib/models/CreateImageInfo.ts rename to lib/types/CreateImageInfo.ts index a3d0e4b..5ddbcca 100644 --- a/lib/models/CreateImageInfo.ts +++ b/lib/types/CreateImageInfo.ts @@ -18,15 +18,15 @@ Do not edit the class manually. */ -import { type ErrorDetail } from '../models/ErrorDetail.js'; -import { type ProgressDetail } from '../models/ProgressDetail.js'; +import { type ErrorDetail } from '../types/ErrorDetail.js'; +import { type ProgressDetail } from '../types/ProgressDetail.js'; export interface CreateImageInfo { - Id?: string; + id?: string; - ErrorDetail?: ErrorDetail; + errorDetail?: ErrorDetail; - Status?: string; + status?: string; - ProgressDetail?: ProgressDetail; + progressDetail?: ProgressDetail; } diff --git a/lib/models/DeviceInfo.ts b/lib/types/DeviceInfo.ts similarity index 100% rename from lib/models/DeviceInfo.ts rename to lib/types/DeviceInfo.ts diff --git a/lib/models/DeviceMapping.ts b/lib/types/DeviceMapping.ts similarity index 100% rename from lib/models/DeviceMapping.ts rename to lib/types/DeviceMapping.ts diff --git a/lib/models/DeviceRequest.ts b/lib/types/DeviceRequest.ts similarity index 100% rename from lib/models/DeviceRequest.ts rename to lib/types/DeviceRequest.ts diff --git a/lib/models/DistributionInspect.ts b/lib/types/DistributionInspect.ts similarity index 89% rename from lib/models/DistributionInspect.ts rename to lib/types/DistributionInspect.ts index de11354..dd1ba11 100644 --- a/lib/models/DistributionInspect.ts +++ b/lib/types/DistributionInspect.ts @@ -18,8 +18,8 @@ Do not edit the class manually. */ -import { type OCIDescriptor } from '../models/OCIDescriptor.js'; -import { type OCIPlatform } from '../models/OCIPlatform.js'; +import { type OCIDescriptor } from '../types/OCIDescriptor.js'; +import { type OCIPlatform } from '../types/OCIPlatform.js'; /** * Describes the result obtained from contacting the registry to retrieve image metadata. diff --git a/lib/models/Driver.ts b/lib/types/Driver.ts similarity index 100% rename from lib/models/Driver.ts rename to lib/types/Driver.ts diff --git a/lib/models/DriverData.ts b/lib/types/DriverData.ts similarity index 100% rename from lib/models/DriverData.ts rename to lib/types/DriverData.ts diff --git a/lib/models/EndpointIPAMConfig.ts b/lib/types/EndpointIPAMConfig.ts similarity index 100% rename from lib/models/EndpointIPAMConfig.ts rename to lib/types/EndpointIPAMConfig.ts diff --git a/lib/models/EndpointPortConfig.ts b/lib/types/EndpointPortConfig.ts similarity index 100% rename from lib/models/EndpointPortConfig.ts rename to lib/types/EndpointPortConfig.ts diff --git a/lib/models/EndpointResource.ts b/lib/types/EndpointResource.ts similarity index 100% rename from lib/models/EndpointResource.ts rename to lib/types/EndpointResource.ts diff --git a/lib/models/EndpointSettings.ts b/lib/types/EndpointSettings.ts similarity index 97% rename from lib/models/EndpointSettings.ts rename to lib/types/EndpointSettings.ts index dfe5d78..fa976c8 100644 --- a/lib/models/EndpointSettings.ts +++ b/lib/types/EndpointSettings.ts @@ -18,7 +18,7 @@ Do not edit the class manually. */ -import { type EndpointIPAMConfig } from '../models/EndpointIPAMConfig.js'; +import { type EndpointIPAMConfig } from '../types/EndpointIPAMConfig.js'; /** * Configuration for a network endpoint. diff --git a/lib/models/EndpointSpec.ts b/lib/types/EndpointSpec.ts similarity index 94% rename from lib/models/EndpointSpec.ts rename to lib/types/EndpointSpec.ts index bae3965..33594b2 100644 --- a/lib/models/EndpointSpec.ts +++ b/lib/types/EndpointSpec.ts @@ -18,7 +18,7 @@ Do not edit the class manually. */ -import { type EndpointPortConfig } from '../models/EndpointPortConfig.js'; +import { type EndpointPortConfig } from '../types/EndpointPortConfig.js'; /** * Properties that can be configured to access and load balance a service. diff --git a/lib/models/EngineDescription.ts b/lib/types/EngineDescription.ts similarity index 91% rename from lib/models/EngineDescription.ts rename to lib/types/EngineDescription.ts index aa76f50..9f6fdad 100644 --- a/lib/models/EngineDescription.ts +++ b/lib/types/EngineDescription.ts @@ -18,7 +18,7 @@ Do not edit the class manually. */ -import { type EngineDescriptionPluginsInner } from '../models/EngineDescriptionPluginsInner.js'; +import { type EngineDescriptionPluginsInner } from '../types/EngineDescriptionPluginsInner.js'; /** * EngineDescription provides information about an engine. diff --git a/lib/models/EngineDescriptionPluginsInner.ts b/lib/types/EngineDescriptionPluginsInner.ts similarity index 100% rename from lib/models/EngineDescriptionPluginsInner.ts rename to lib/types/EngineDescriptionPluginsInner.ts diff --git a/lib/models/ErrorDetail.ts b/lib/types/ErrorDetail.ts similarity index 95% rename from lib/models/ErrorDetail.ts rename to lib/types/ErrorDetail.ts index db1a1e8..0757a37 100644 --- a/lib/models/ErrorDetail.ts +++ b/lib/types/ErrorDetail.ts @@ -19,7 +19,7 @@ */ export interface ErrorDetail { - Code?: number; + code?: number; - Message?: string; + message?: string; } diff --git a/lib/models/ErrorResponse.ts b/lib/types/ErrorResponse.ts similarity index 97% rename from lib/models/ErrorResponse.ts rename to lib/types/ErrorResponse.ts index 68c99a7..519534c 100644 --- a/lib/models/ErrorResponse.ts +++ b/lib/types/ErrorResponse.ts @@ -25,5 +25,5 @@ export interface ErrorResponse { /** * The error message. */ - Message: string; + message: string; } diff --git a/lib/models/EventActor.ts b/lib/types/EventActor.ts similarity index 100% rename from lib/models/EventActor.ts rename to lib/types/EventActor.ts diff --git a/lib/models/EventMessage.ts b/lib/types/EventMessage.ts similarity index 91% rename from lib/models/EventMessage.ts rename to lib/types/EventMessage.ts index 232de48..51109cc 100644 --- a/lib/models/EventMessage.ts +++ b/lib/types/EventMessage.ts @@ -18,7 +18,7 @@ Do not edit the class manually. */ -import { type EventActor } from '../models/EventActor.js'; +import { type EventActor } from '../types/EventActor.js'; /** * EventMessage represents the information an event contains. @@ -39,17 +39,17 @@ export interface EventMessage { /** * Scope of the event. Engine events are `local` scope. Cluster (Swarm) events are `swarm` scope. */ - Scope?: EventMessageScopeEnum; + scope?: EventMessageScopeEnum; /** * Timestamp of event */ - Time?: number; + time?: number; /** * Timestamp of event, with nanosecond accuracy */ - TimeNano?: number; + timeNano?: number; } export type EventMessageTypeEnum = diff --git a/lib/models/ExecConfig.ts b/lib/types/ExecConfig.ts similarity index 100% rename from lib/models/ExecConfig.ts rename to lib/types/ExecConfig.ts diff --git a/lib/models/ExecInspectResponse.ts b/lib/types/ExecInspectResponse.ts similarity index 94% rename from lib/models/ExecInspectResponse.ts rename to lib/types/ExecInspectResponse.ts index a7b4616..7b373d3 100644 --- a/lib/models/ExecInspectResponse.ts +++ b/lib/types/ExecInspectResponse.ts @@ -18,7 +18,7 @@ Do not edit the class manually. */ -import { type ProcessConfig } from '../models/ProcessConfig.js'; +import { type ProcessConfig } from '../types/ProcessConfig.js'; export interface ExecInspectResponse { CanRemove?: boolean; diff --git a/lib/models/ExecStartConfig.ts b/lib/types/ExecStartConfig.ts similarity index 100% rename from lib/models/ExecStartConfig.ts rename to lib/types/ExecStartConfig.ts diff --git a/lib/models/FileInfo.ts b/lib/types/FileInfo.ts similarity index 100% rename from lib/models/FileInfo.ts rename to lib/types/FileInfo.ts diff --git a/lib/models/FilesystemChange.ts b/lib/types/FilesystemChange.ts similarity index 94% rename from lib/models/FilesystemChange.ts rename to lib/types/FilesystemChange.ts index 0f1caad..1d874e6 100644 --- a/lib/models/FilesystemChange.ts +++ b/lib/types/FilesystemChange.ts @@ -18,7 +18,7 @@ Do not edit the class manually. */ -import { type ChangeType } from '../models/ChangeType.js'; +import { type ChangeType } from '../types/ChangeType.js'; /** * Change in the container\'s filesystem. diff --git a/lib/models/FirewallInfo.ts b/lib/types/FirewallInfo.ts similarity index 100% rename from lib/models/FirewallInfo.ts rename to lib/types/FirewallInfo.ts diff --git a/lib/models/GenericResourcesInner.ts b/lib/types/GenericResourcesInner.ts similarity index 90% rename from lib/models/GenericResourcesInner.ts rename to lib/types/GenericResourcesInner.ts index 7f95079..03a722b 100644 --- a/lib/models/GenericResourcesInner.ts +++ b/lib/types/GenericResourcesInner.ts @@ -18,8 +18,8 @@ Do not edit the class manually. */ -import { type GenericResourcesInnerDiscreteResourceSpec } from '../models/GenericResourcesInnerDiscreteResourceSpec.js'; -import { type GenericResourcesInnerNamedResourceSpec } from '../models/GenericResourcesInnerNamedResourceSpec.js'; +import { type GenericResourcesInnerDiscreteResourceSpec } from '../types/GenericResourcesInnerDiscreteResourceSpec.js'; +import { type GenericResourcesInnerNamedResourceSpec } from '../types/GenericResourcesInnerNamedResourceSpec.js'; export interface GenericResourcesInner { NamedResourceSpec?: GenericResourcesInnerNamedResourceSpec; diff --git a/lib/models/GenericResourcesInnerDiscreteResourceSpec.ts b/lib/types/GenericResourcesInnerDiscreteResourceSpec.ts similarity index 100% rename from lib/models/GenericResourcesInnerDiscreteResourceSpec.ts rename to lib/types/GenericResourcesInnerDiscreteResourceSpec.ts diff --git a/lib/models/GenericResourcesInnerNamedResourceSpec.ts b/lib/types/GenericResourcesInnerNamedResourceSpec.ts similarity index 100% rename from lib/models/GenericResourcesInnerNamedResourceSpec.ts rename to lib/types/GenericResourcesInnerNamedResourceSpec.ts diff --git a/lib/models/Health.ts b/lib/types/Health.ts similarity index 95% rename from lib/models/Health.ts rename to lib/types/Health.ts index a29b03e..dd74fd2 100644 --- a/lib/models/Health.ts +++ b/lib/types/Health.ts @@ -18,7 +18,7 @@ Do not edit the class manually. */ -import { type HealthcheckResult } from '../models/HealthcheckResult.js'; +import { type HealthcheckResult } from '../types/HealthcheckResult.js'; /** * Health stores information about the container\'s healthcheck results. diff --git a/lib/models/HealthConfig.ts b/lib/types/HealthConfig.ts similarity index 100% rename from lib/models/HealthConfig.ts rename to lib/types/HealthConfig.ts diff --git a/lib/models/HealthcheckResult.ts b/lib/types/HealthcheckResult.ts similarity index 100% rename from lib/models/HealthcheckResult.ts rename to lib/types/HealthcheckResult.ts diff --git a/lib/models/HistoryResponseItem.ts b/lib/types/HistoryResponseItem.ts similarity index 100% rename from lib/models/HistoryResponseItem.ts rename to lib/types/HistoryResponseItem.ts diff --git a/lib/models/HostConfig.ts b/lib/types/HostConfig.ts similarity index 96% rename from lib/models/HostConfig.ts rename to lib/types/HostConfig.ts index e4a18bb..88deab4 100644 --- a/lib/models/HostConfig.ts +++ b/lib/types/HostConfig.ts @@ -18,15 +18,15 @@ Do not edit the class manually. */ -import { type DeviceMapping } from '../models/DeviceMapping.js'; -import { type DeviceRequest } from '../models/DeviceRequest.js'; -import { type HostConfigAllOfLogConfig } from '../models/HostConfigAllOfLogConfig.js'; -import { type Mount } from '../models/Mount.js'; -import { type PortBinding } from '../models/PortBinding.js'; -import { type ResourcesBlkioWeightDeviceInner } from '../models/ResourcesBlkioWeightDeviceInner.js'; -import { type ResourcesUlimitsInner } from '../models/ResourcesUlimitsInner.js'; -import { type RestartPolicy } from '../models/RestartPolicy.js'; -import { type ThrottleDevice } from '../models/ThrottleDevice.js'; +import { type DeviceMapping } from '../types/DeviceMapping.js'; +import { type DeviceRequest } from '../types/DeviceRequest.js'; +import { type HostConfigAllOfLogConfig } from '../types/HostConfigAllOfLogConfig.js'; +import { type Mount } from '../types/Mount.js'; +import { type PortBinding } from '../types/PortBinding.js'; +import { type ResourcesBlkioWeightDeviceInner } from '../types/ResourcesBlkioWeightDeviceInner.js'; +import { type ResourcesUlimitsInner } from '../types/ResourcesUlimitsInner.js'; +import { type RestartPolicy } from '../types/RestartPolicy.js'; +import { type ThrottleDevice } from '../types/ThrottleDevice.js'; /** * Container configuration that depends on the host we are running on diff --git a/lib/models/HostConfigAllOfLogConfig.ts b/lib/types/HostConfigAllOfLogConfig.ts similarity index 100% rename from lib/models/HostConfigAllOfLogConfig.ts rename to lib/types/HostConfigAllOfLogConfig.ts diff --git a/lib/models/IDResponse.ts b/lib/types/IDResponse.ts similarity index 100% rename from lib/models/IDResponse.ts rename to lib/types/IDResponse.ts diff --git a/lib/models/IPAM.ts b/lib/types/IPAM.ts similarity index 95% rename from lib/models/IPAM.ts rename to lib/types/IPAM.ts index c7ae5f1..9e03ac5 100644 --- a/lib/models/IPAM.ts +++ b/lib/types/IPAM.ts @@ -18,7 +18,7 @@ Do not edit the class manually. */ -import { type IPAMConfig } from '../models/IPAMConfig.js'; +import { type IPAMConfig } from '../types/IPAMConfig.js'; export interface IPAM { /** diff --git a/lib/models/IPAMConfig.ts b/lib/types/IPAMConfig.ts similarity index 100% rename from lib/models/IPAMConfig.ts rename to lib/types/IPAMConfig.ts diff --git a/lib/models/ImageConfig.ts b/lib/types/ImageConfig.ts similarity index 97% rename from lib/models/ImageConfig.ts rename to lib/types/ImageConfig.ts index d20ad3c..59290cc 100644 --- a/lib/models/ImageConfig.ts +++ b/lib/types/ImageConfig.ts @@ -18,7 +18,7 @@ Do not edit the class manually. */ -import { type HealthConfig } from '../models/HealthConfig.js'; +import { type HealthConfig } from '../types/HealthConfig.js'; /** * Configuration of the image. These fields are used as defaults when starting a container from the image. diff --git a/lib/models/ImageDeleteResponseItem.ts b/lib/types/ImageDeleteResponseItem.ts similarity index 100% rename from lib/models/ImageDeleteResponseItem.ts rename to lib/types/ImageDeleteResponseItem.ts diff --git a/lib/models/ImageID.ts b/lib/types/ImageID.ts similarity index 100% rename from lib/models/ImageID.ts rename to lib/types/ImageID.ts diff --git a/lib/models/ImageInspect.ts b/lib/types/ImageInspect.ts similarity index 91% rename from lib/models/ImageInspect.ts rename to lib/types/ImageInspect.ts index 9baedaa..50729c4 100644 --- a/lib/models/ImageInspect.ts +++ b/lib/types/ImageInspect.ts @@ -18,12 +18,12 @@ Do not edit the class manually. */ -import { type DriverData } from '../models/DriverData.js'; -import { type ImageConfig } from '../models/ImageConfig.js'; -import { type ImageInspectMetadata } from '../models/ImageInspectMetadata.js'; -import { type ImageInspectRootFS } from '../models/ImageInspectRootFS.js'; -import { type ImageManifestSummary } from '../models/ImageManifestSummary.js'; -import { type OCIDescriptor } from '../models/OCIDescriptor.js'; +import { type DriverData } from '../types/DriverData.js'; +import { type ImageConfig } from '../types/ImageConfig.js'; +import { type ImageInspectMetadata } from '../types/ImageInspectMetadata.js'; +import { type ImageInspectRootFS } from '../types/ImageInspectRootFS.js'; +import { type ImageManifestSummary } from '../types/ImageManifestSummary.js'; +import { type OCIDescriptor } from '../types/OCIDescriptor.js'; /** * Information about an image in the local image cache. diff --git a/lib/models/ImageInspectMetadata.ts b/lib/types/ImageInspectMetadata.ts similarity index 100% rename from lib/models/ImageInspectMetadata.ts rename to lib/types/ImageInspectMetadata.ts diff --git a/lib/models/ImageInspectRootFS.ts b/lib/types/ImageInspectRootFS.ts similarity index 100% rename from lib/models/ImageInspectRootFS.ts rename to lib/types/ImageInspectRootFS.ts diff --git a/lib/models/ImageManifestSummary.ts b/lib/types/ImageManifestSummary.ts similarity index 83% rename from lib/models/ImageManifestSummary.ts rename to lib/types/ImageManifestSummary.ts index d325d7e..2dad997 100644 --- a/lib/models/ImageManifestSummary.ts +++ b/lib/types/ImageManifestSummary.ts @@ -18,10 +18,10 @@ Do not edit the class manually. */ -import { type ImageManifestSummaryAttestationData } from '../models/ImageManifestSummaryAttestationData.js'; -import { type ImageManifestSummaryImageData } from '../models/ImageManifestSummaryImageData.js'; -import { type ImageManifestSummarySize } from '../models/ImageManifestSummarySize.js'; -import { type OCIDescriptor } from '../models/OCIDescriptor.js'; +import { type ImageManifestSummaryAttestationData } from '../types/ImageManifestSummaryAttestationData.js'; +import { type ImageManifestSummaryImageData } from '../types/ImageManifestSummaryImageData.js'; +import { type ImageManifestSummarySize } from '../types/ImageManifestSummarySize.js'; +import { type OCIDescriptor } from '../types/OCIDescriptor.js'; /** * ImageManifestSummary represents a summary of an image manifest. diff --git a/lib/models/ImageManifestSummaryAttestationData.ts b/lib/types/ImageManifestSummaryAttestationData.ts similarity index 98% rename from lib/models/ImageManifestSummaryAttestationData.ts rename to lib/types/ImageManifestSummaryAttestationData.ts index 68889ba..2ce9bef 100644 --- a/lib/models/ImageManifestSummaryAttestationData.ts +++ b/lib/types/ImageManifestSummaryAttestationData.ts @@ -25,5 +25,5 @@ export interface ImageManifestSummaryAttestationData { /** * The digest of the image manifest that this attestation is for. */ - _for: string; + For: string; } diff --git a/lib/models/ImageManifestSummaryImageData.ts b/lib/types/ImageManifestSummaryImageData.ts similarity index 86% rename from lib/models/ImageManifestSummaryImageData.ts rename to lib/types/ImageManifestSummaryImageData.ts index d468792..62527be 100644 --- a/lib/models/ImageManifestSummaryImageData.ts +++ b/lib/types/ImageManifestSummaryImageData.ts @@ -18,8 +18,8 @@ Do not edit the class manually. */ -import { type ImageManifestSummaryImageDataSize } from '../models/ImageManifestSummaryImageDataSize.js'; -import { type OCIPlatform } from '../models/OCIPlatform.js'; +import { type ImageManifestSummaryImageDataSize } from '../types/ImageManifestSummaryImageDataSize.js'; +import { type OCIPlatform } from '../types/OCIPlatform.js'; /** * The image data for the image manifest. This field is only populated when Kind is \"image\". diff --git a/lib/models/ImageManifestSummaryImageDataSize.ts b/lib/types/ImageManifestSummaryImageDataSize.ts similarity index 100% rename from lib/models/ImageManifestSummaryImageDataSize.ts rename to lib/types/ImageManifestSummaryImageDataSize.ts diff --git a/lib/models/ImageManifestSummarySize.ts b/lib/types/ImageManifestSummarySize.ts similarity index 100% rename from lib/models/ImageManifestSummarySize.ts rename to lib/types/ImageManifestSummarySize.ts diff --git a/lib/models/ImagePruneResponse.ts b/lib/types/ImagePruneResponse.ts similarity index 92% rename from lib/models/ImagePruneResponse.ts rename to lib/types/ImagePruneResponse.ts index 336c696..2856c29 100644 --- a/lib/models/ImagePruneResponse.ts +++ b/lib/types/ImagePruneResponse.ts @@ -18,7 +18,7 @@ Do not edit the class manually. */ -import { type ImageDeleteResponseItem } from '../models/ImageDeleteResponseItem.js'; +import { type ImageDeleteResponseItem } from '../types/ImageDeleteResponseItem.js'; export interface ImagePruneResponse { /** diff --git a/lib/models/ImageSearchResponseItem.ts b/lib/types/ImageSearchResponseItem.ts similarity index 88% rename from lib/models/ImageSearchResponseItem.ts rename to lib/types/ImageSearchResponseItem.ts index 04e70c9..c105075 100644 --- a/lib/models/ImageSearchResponseItem.ts +++ b/lib/types/ImageSearchResponseItem.ts @@ -19,16 +19,16 @@ */ export interface ImageSearchResponseItem { - Description?: string; + description?: string; - IsOfficial?: boolean; + is_official?: boolean; /** * Whether this repository has automated builds enabled. <p><br /></p> > **Deprecated**: This field is deprecated and will always be \"false\". */ - IsAutomated?: boolean; + is_automated?: boolean; - Name?: string; + name?: string; - StarCount?: number; + star_count?: number; } diff --git a/lib/models/ImageSummary.ts b/lib/types/ImageSummary.ts similarity index 96% rename from lib/models/ImageSummary.ts rename to lib/types/ImageSummary.ts index 52fd05d..c535069 100644 --- a/lib/models/ImageSummary.ts +++ b/lib/types/ImageSummary.ts @@ -18,8 +18,8 @@ Do not edit the class manually. */ -import { type ImageManifestSummary } from '../models/ImageManifestSummary.js'; -import { type OCIDescriptor } from '../models/OCIDescriptor.js'; +import { type ImageManifestSummary } from '../types/ImageManifestSummary.js'; +import { type OCIDescriptor } from '../types/OCIDescriptor.js'; export interface ImageSummary { /** diff --git a/lib/models/IndexInfo.ts b/lib/types/IndexInfo.ts similarity index 100% rename from lib/models/IndexInfo.ts rename to lib/types/IndexInfo.ts diff --git a/lib/models/JoinTokens.ts b/lib/types/JoinTokens.ts similarity index 100% rename from lib/models/JoinTokens.ts rename to lib/types/JoinTokens.ts diff --git a/lib/models/Limit.ts b/lib/types/Limit.ts similarity index 100% rename from lib/models/Limit.ts rename to lib/types/Limit.ts diff --git a/lib/models/LocalNodeState.ts b/lib/types/LocalNodeState.ts similarity index 100% rename from lib/models/LocalNodeState.ts rename to lib/types/LocalNodeState.ts diff --git a/lib/models/ManagerStatus.ts b/lib/types/ManagerStatus.ts similarity index 94% rename from lib/models/ManagerStatus.ts rename to lib/types/ManagerStatus.ts index 87f11ae..83d99c2 100644 --- a/lib/models/ManagerStatus.ts +++ b/lib/types/ManagerStatus.ts @@ -18,7 +18,7 @@ Do not edit the class manually. */ -import { type Reachability } from '../models/Reachability.js'; +import { type Reachability } from '../types/Reachability.js'; /** * ManagerStatus represents the status of a manager. It provides the current status of a node\'s manager component, if the node is a manager. diff --git a/lib/models/Mount.ts b/lib/types/Mount.ts similarity index 88% rename from lib/models/Mount.ts rename to lib/types/Mount.ts index bb1b35a..0caeaaf 100644 --- a/lib/models/Mount.ts +++ b/lib/types/Mount.ts @@ -18,10 +18,10 @@ Do not edit the class manually. */ -import { type MountBindOptions } from '../models/MountBindOptions.js'; -import { type MountImageOptions } from '../models/MountImageOptions.js'; -import { type MountTmpfsOptions } from '../models/MountTmpfsOptions.js'; -import { type MountVolumeOptions } from '../models/MountVolumeOptions.js'; +import { type MountBindOptions } from '../types/MountBindOptions.js'; +import { type MountImageOptions } from '../types/MountImageOptions.js'; +import { type MountTmpfsOptions } from '../types/MountTmpfsOptions.js'; +import { type MountVolumeOptions } from '../types/MountVolumeOptions.js'; export interface Mount { /** diff --git a/lib/models/MountBindOptions.ts b/lib/types/MountBindOptions.ts similarity index 100% rename from lib/models/MountBindOptions.ts rename to lib/types/MountBindOptions.ts diff --git a/lib/models/MountImageOptions.ts b/lib/types/MountImageOptions.ts similarity index 100% rename from lib/models/MountImageOptions.ts rename to lib/types/MountImageOptions.ts diff --git a/lib/models/MountPoint.ts b/lib/types/MountPoint.ts similarity index 100% rename from lib/models/MountPoint.ts rename to lib/types/MountPoint.ts diff --git a/lib/models/MountTmpfsOptions.ts b/lib/types/MountTmpfsOptions.ts similarity index 100% rename from lib/models/MountTmpfsOptions.ts rename to lib/types/MountTmpfsOptions.ts diff --git a/lib/models/MountVolumeOptions.ts b/lib/types/MountVolumeOptions.ts similarity index 92% rename from lib/models/MountVolumeOptions.ts rename to lib/types/MountVolumeOptions.ts index 269f3d6..a46b959 100644 --- a/lib/models/MountVolumeOptions.ts +++ b/lib/types/MountVolumeOptions.ts @@ -18,7 +18,7 @@ Do not edit the class manually. */ -import { type MountVolumeOptionsDriverConfig } from '../models/MountVolumeOptionsDriverConfig.js'; +import { type MountVolumeOptionsDriverConfig } from '../types/MountVolumeOptionsDriverConfig.js'; /** * Optional configuration for the `volume` type. diff --git a/lib/models/MountVolumeOptionsDriverConfig.ts b/lib/types/MountVolumeOptionsDriverConfig.ts similarity index 100% rename from lib/models/MountVolumeOptionsDriverConfig.ts rename to lib/types/MountVolumeOptionsDriverConfig.ts diff --git a/lib/models/Network.ts b/lib/types/Network.ts similarity index 94% rename from lib/models/Network.ts rename to lib/types/Network.ts index 6a19dcd..70129ce 100644 --- a/lib/models/Network.ts +++ b/lib/types/Network.ts @@ -18,9 +18,9 @@ Do not edit the class manually. */ -import { type ConfigReference } from '../models/ConfigReference.js'; -import { type IPAM } from '../models/IPAM.js'; -import { type PeerInfo } from '../models/PeerInfo.js'; +import { type ConfigReference } from '../types/ConfigReference.js'; +import { type IPAM } from '../types/IPAM.js'; +import { type PeerInfo } from '../types/PeerInfo.js'; export interface Network { /** diff --git a/lib/models/NetworkAttachmentConfig.ts b/lib/types/NetworkAttachmentConfig.ts similarity index 100% rename from lib/models/NetworkAttachmentConfig.ts rename to lib/types/NetworkAttachmentConfig.ts diff --git a/lib/models/NetworkConnectRequest.ts b/lib/types/NetworkConnectRequest.ts similarity index 93% rename from lib/models/NetworkConnectRequest.ts rename to lib/types/NetworkConnectRequest.ts index afb2e98..1db1fa2 100644 --- a/lib/models/NetworkConnectRequest.ts +++ b/lib/types/NetworkConnectRequest.ts @@ -18,7 +18,7 @@ Do not edit the class manually. */ -import { type EndpointSettings } from '../models/EndpointSettings.js'; +import { type EndpointSettings } from '../types/EndpointSettings.js'; export interface NetworkConnectRequest { /** diff --git a/lib/models/NetworkCreateRequest.ts b/lib/types/NetworkCreateRequest.ts similarity index 94% rename from lib/models/NetworkCreateRequest.ts rename to lib/types/NetworkCreateRequest.ts index a9ae552..14ad320 100644 --- a/lib/models/NetworkCreateRequest.ts +++ b/lib/types/NetworkCreateRequest.ts @@ -18,8 +18,8 @@ Do not edit the class manually. */ -import { type ConfigReference } from '../models/ConfigReference.js'; -import { type IPAM } from '../models/IPAM.js'; +import { type ConfigReference } from '../types/ConfigReference.js'; +import { type IPAM } from '../types/IPAM.js'; export interface NetworkCreateRequest { /** diff --git a/lib/models/NetworkCreateResponse.ts b/lib/types/NetworkCreateResponse.ts similarity index 100% rename from lib/models/NetworkCreateResponse.ts rename to lib/types/NetworkCreateResponse.ts diff --git a/lib/models/NetworkDisconnectRequest.ts b/lib/types/NetworkDisconnectRequest.ts similarity index 100% rename from lib/models/NetworkDisconnectRequest.ts rename to lib/types/NetworkDisconnectRequest.ts diff --git a/lib/models/NetworkInspect.ts b/lib/types/NetworkInspect.ts similarity index 92% rename from lib/models/NetworkInspect.ts rename to lib/types/NetworkInspect.ts index a744983..f9d944d 100644 --- a/lib/models/NetworkInspect.ts +++ b/lib/types/NetworkInspect.ts @@ -18,10 +18,10 @@ Do not edit the class manually. */ -import { type ConfigReference } from '../models/ConfigReference.js'; -import { type EndpointResource } from '../models/EndpointResource.js'; -import { type IPAM } from '../models/IPAM.js'; -import { type PeerInfo } from '../models/PeerInfo.js'; +import { type ConfigReference } from '../types/ConfigReference.js'; +import { type EndpointResource } from '../types/EndpointResource.js'; +import { type IPAM } from '../types/IPAM.js'; +import { type PeerInfo } from '../types/PeerInfo.js'; /** * The body of the \"get network\" http response message. diff --git a/lib/models/NetworkPruneResponse.ts b/lib/types/NetworkPruneResponse.ts similarity index 100% rename from lib/models/NetworkPruneResponse.ts rename to lib/types/NetworkPruneResponse.ts diff --git a/lib/models/NetworkSettings.ts b/lib/types/NetworkSettings.ts similarity index 97% rename from lib/models/NetworkSettings.ts rename to lib/types/NetworkSettings.ts index b8ea2f0..52c456c 100644 --- a/lib/models/NetworkSettings.ts +++ b/lib/types/NetworkSettings.ts @@ -18,9 +18,9 @@ Do not edit the class manually. */ -import { type Address } from '../models/Address.js'; -import { type EndpointSettings } from '../models/EndpointSettings.js'; -import { type PortBinding } from '../models/PortBinding.js'; +import { type Address } from '../types/Address.js'; +import { type EndpointSettings } from '../types/EndpointSettings.js'; +import { type PortBinding } from '../types/PortBinding.js'; /** * NetworkSettings exposes the network settings in the API diff --git a/lib/models/NetworkSummary.ts b/lib/types/NetworkSummary.ts similarity index 94% rename from lib/models/NetworkSummary.ts rename to lib/types/NetworkSummary.ts index 9af7708..f58aa4e 100644 --- a/lib/models/NetworkSummary.ts +++ b/lib/types/NetworkSummary.ts @@ -18,9 +18,9 @@ Do not edit the class manually. */ -import { type ConfigReference } from '../models/ConfigReference.js'; -import { type IPAM } from '../models/IPAM.js'; -import { type PeerInfo } from '../models/PeerInfo.js'; +import { type ConfigReference } from '../types/ConfigReference.js'; +import { type IPAM } from '../types/IPAM.js'; +import { type PeerInfo } from '../types/PeerInfo.js'; /** * Network list response item diff --git a/lib/models/NetworkTaskInfo.ts b/lib/types/NetworkTaskInfo.ts similarity index 100% rename from lib/models/NetworkTaskInfo.ts rename to lib/types/NetworkTaskInfo.ts diff --git a/lib/models/NetworkingConfig.ts b/lib/types/NetworkingConfig.ts similarity index 94% rename from lib/models/NetworkingConfig.ts rename to lib/types/NetworkingConfig.ts index 01c1014..49ed81e 100644 --- a/lib/models/NetworkingConfig.ts +++ b/lib/types/NetworkingConfig.ts @@ -18,7 +18,7 @@ Do not edit the class manually. */ -import { type EndpointSettings } from '../models/EndpointSettings.js'; +import { type EndpointSettings } from '../types/EndpointSettings.js'; /** * NetworkingConfig represents the container\'s networking configuration for each of its interfaces. It is used for the networking configs specified in the `docker create` and `docker network connect` commands. diff --git a/lib/models/Node.ts b/lib/types/Node.ts similarity index 80% rename from lib/models/Node.ts rename to lib/types/Node.ts index 3fa3b4a..d3b2095 100644 --- a/lib/models/Node.ts +++ b/lib/types/Node.ts @@ -18,11 +18,11 @@ Do not edit the class manually. */ -import { type ManagerStatus } from '../models/ManagerStatus.js'; -import { type NodeDescription } from '../models/NodeDescription.js'; -import { type NodeSpec } from '../models/NodeSpec.js'; -import { type NodeStatus } from '../models/NodeStatus.js'; -import { type ObjectVersion } from '../models/ObjectVersion.js'; +import { type ManagerStatus } from '../types/ManagerStatus.js'; +import { type NodeDescription } from '../types/NodeDescription.js'; +import { type NodeSpec } from '../types/NodeSpec.js'; +import { type NodeStatus } from '../types/NodeStatus.js'; +import { type ObjectVersion } from '../types/ObjectVersion.js'; export interface Node { ID?: string; diff --git a/lib/models/NodeDescription.ts b/lib/types/NodeDescription.ts similarity index 80% rename from lib/models/NodeDescription.ts rename to lib/types/NodeDescription.ts index f111dd2..963db21 100644 --- a/lib/models/NodeDescription.ts +++ b/lib/types/NodeDescription.ts @@ -18,10 +18,10 @@ Do not edit the class manually. */ -import { type EngineDescription } from '../models/EngineDescription.js'; -import { type Platform } from '../models/Platform.js'; -import { type ResourceObject } from '../models/ResourceObject.js'; -import { type TLSInfo } from '../models/TLSInfo.js'; +import { type EngineDescription } from '../types/EngineDescription.js'; +import { type Platform } from '../types/Platform.js'; +import { type ResourceObject } from '../types/ResourceObject.js'; +import { type TLSInfo } from '../types/TLSInfo.js'; /** * NodeDescription encapsulates the properties of the Node as reported by the agent. diff --git a/lib/models/NodeSpec.ts b/lib/types/NodeSpec.ts similarity index 100% rename from lib/models/NodeSpec.ts rename to lib/types/NodeSpec.ts diff --git a/lib/models/NodeState.ts b/lib/types/NodeState.ts similarity index 100% rename from lib/models/NodeState.ts rename to lib/types/NodeState.ts diff --git a/lib/models/NodeStatus.ts b/lib/types/NodeStatus.ts similarity index 94% rename from lib/models/NodeStatus.ts rename to lib/types/NodeStatus.ts index 4a4d8b9..d6f7743 100644 --- a/lib/models/NodeStatus.ts +++ b/lib/types/NodeStatus.ts @@ -18,7 +18,7 @@ Do not edit the class manually. */ -import { type NodeState } from '../models/NodeState.js'; +import { type NodeState } from '../types/NodeState.js'; /** * NodeStatus represents the status of a node. It provides the current status of the node, as seen by the manager. diff --git a/lib/models/OCIDescriptor.ts b/lib/types/OCIDescriptor.ts similarity index 84% rename from lib/models/OCIDescriptor.ts rename to lib/types/OCIDescriptor.ts index 39b38a9..b6da7cc 100644 --- a/lib/models/OCIDescriptor.ts +++ b/lib/types/OCIDescriptor.ts @@ -18,7 +18,7 @@ Do not edit the class manually. */ -import { type OCIPlatform } from '../models/OCIPlatform.js'; +import { type OCIPlatform } from '../types/OCIPlatform.js'; /** * A descriptor struct containing digest, media type, and size, as defined in the [OCI Content Descriptors Specification](https://github.com/opencontainers/image-spec/blob/v1.0.1/descriptor.md). @@ -27,37 +27,37 @@ export interface OCIDescriptor { /** * The media type of the object this schema refers to. */ - MediaType?: string; + mediaType?: string; /** * The digest of the targeted content. */ - Digest?: string; + digest?: string; /** * The size in bytes of the blob. */ - Size?: number; + size?: number; /** * List of URLs from which this object MAY be downloaded. */ - Urls?: Array | null; + urls?: Array | null; /** * Arbitrary metadata relating to the targeted content. */ - Annotations?: { [key: string]: string } | null; + annotations?: { [key: string]: string } | null; /** * Data is an embedding of the targeted content. This is encoded as a base64 string when marshalled to JSON (automatically, by encoding/json). If present, Data can be used directly to avoid fetching the targeted content. */ - Data?: string | null; + data?: string | null; - Platform?: OCIPlatform | null; + platform?: OCIPlatform | null; /** * ArtifactType is the IANA media type of this artifact. */ - ArtifactType?: string | null; + artifactType?: string | null; } diff --git a/lib/models/OCIPlatform.ts b/lib/types/OCIPlatform.ts similarity index 92% rename from lib/models/OCIPlatform.ts rename to lib/types/OCIPlatform.ts index 5be259d..fe8b0a2 100644 --- a/lib/models/OCIPlatform.ts +++ b/lib/types/OCIPlatform.ts @@ -25,25 +25,25 @@ export interface OCIPlatform { /** * The CPU architecture, for example `amd64` or `ppc64`. */ - Architecture?: string; + architecture?: string; /** * The operating system, for example `linux` or `windows`. */ - Os?: string; + os?: string; /** * Optional field specifying the operating system version, for example on Windows `10.0.19041.1165`. */ - OsVersion?: string; + 'os.version'?: string; /** * Optional field specifying an array of strings, each listing a required OS feature (for example on Windows `win32k`). */ - OsFeatures?: Array; + 'os.features'?: Array; /** * Optional field specifying a variant of the CPU, for example `v7` to specify ARMv7 when architecture is `arm`. */ - Variant?: string; + variant?: string; } diff --git a/lib/models/ObjectVersion.ts b/lib/types/ObjectVersion.ts similarity index 100% rename from lib/models/ObjectVersion.ts rename to lib/types/ObjectVersion.ts diff --git a/lib/models/PeerInfo.ts b/lib/types/PeerInfo.ts similarity index 100% rename from lib/models/PeerInfo.ts rename to lib/types/PeerInfo.ts diff --git a/lib/models/PeerNode.ts b/lib/types/PeerNode.ts similarity index 100% rename from lib/models/PeerNode.ts rename to lib/types/PeerNode.ts diff --git a/lib/models/Platform.ts b/lib/types/Platform.ts similarity index 100% rename from lib/models/Platform.ts rename to lib/types/Platform.ts diff --git a/lib/models/Plugin.ts b/lib/types/Plugin.ts similarity index 89% rename from lib/models/Plugin.ts rename to lib/types/Plugin.ts index 6996f5d..455392a 100644 --- a/lib/models/Plugin.ts +++ b/lib/types/Plugin.ts @@ -18,8 +18,8 @@ Do not edit the class manually. */ -import { type PluginConfig } from '../models/PluginConfig.js'; -import { type PluginSettings } from '../models/PluginSettings.js'; +import { type PluginConfig } from '../types/PluginConfig.js'; +import { type PluginSettings } from '../types/PluginSettings.js'; /** * A plugin for the Engine API diff --git a/lib/models/PluginConfig.ts b/lib/types/PluginConfig.ts similarity index 66% rename from lib/models/PluginConfig.ts rename to lib/types/PluginConfig.ts index d452f95..9c66aa9 100644 --- a/lib/models/PluginConfig.ts +++ b/lib/types/PluginConfig.ts @@ -18,14 +18,14 @@ Do not edit the class manually. */ -import { type PluginConfigArgs } from '../models/PluginConfigArgs.js'; -import { type PluginConfigInterface } from '../models/PluginConfigInterface.js'; -import { type PluginConfigLinux } from '../models/PluginConfigLinux.js'; -import { type PluginConfigNetwork } from '../models/PluginConfigNetwork.js'; -import { type PluginConfigRootfs } from '../models/PluginConfigRootfs.js'; -import { type PluginConfigUser } from '../models/PluginConfigUser.js'; -import { type PluginEnv } from '../models/PluginEnv.js'; -import { type PluginMount } from '../models/PluginMount.js'; +import { type PluginConfigArgs } from '../types/PluginConfigArgs.js'; +import { type PluginConfigInterface } from '../types/PluginConfigInterface.js'; +import { type PluginConfigLinux } from '../types/PluginConfigLinux.js'; +import { type PluginConfigNetwork } from '../types/PluginConfigNetwork.js'; +import { type PluginConfigRootfs } from '../types/PluginConfigRootfs.js'; +import { type PluginConfigUser } from '../types/PluginConfigUser.js'; +import { type PluginEnv } from '../types/PluginEnv.js'; +import { type PluginMount } from '../types/PluginMount.js'; /** * The config of a plugin. @@ -40,7 +40,7 @@ export interface PluginConfig { Documentation: string; - _interface: PluginConfigInterface; + Interface: PluginConfigInterface; Entrypoint: Array; @@ -64,5 +64,5 @@ export interface PluginConfig { Args: PluginConfigArgs; - Rootfs?: PluginConfigRootfs; + rootfs?: PluginConfigRootfs; } diff --git a/lib/models/PluginConfigArgs.ts b/lib/types/PluginConfigArgs.ts similarity index 100% rename from lib/models/PluginConfigArgs.ts rename to lib/types/PluginConfigArgs.ts diff --git a/lib/models/PluginConfigInterface.ts b/lib/types/PluginConfigInterface.ts similarity index 100% rename from lib/models/PluginConfigInterface.ts rename to lib/types/PluginConfigInterface.ts diff --git a/lib/models/PluginConfigLinux.ts b/lib/types/PluginConfigLinux.ts similarity index 93% rename from lib/models/PluginConfigLinux.ts rename to lib/types/PluginConfigLinux.ts index 090069c..3792c82 100644 --- a/lib/models/PluginConfigLinux.ts +++ b/lib/types/PluginConfigLinux.ts @@ -18,7 +18,7 @@ Do not edit the class manually. */ -import { type PluginDevice } from '../models/PluginDevice.js'; +import { type PluginDevice } from '../types/PluginDevice.js'; export interface PluginConfigLinux { Capabilities: Array; diff --git a/lib/models/PluginConfigNetwork.ts b/lib/types/PluginConfigNetwork.ts similarity index 100% rename from lib/models/PluginConfigNetwork.ts rename to lib/types/PluginConfigNetwork.ts diff --git a/lib/models/PluginConfigRootfs.ts b/lib/types/PluginConfigRootfs.ts similarity index 94% rename from lib/models/PluginConfigRootfs.ts rename to lib/types/PluginConfigRootfs.ts index e6bfb6a..75a866b 100644 --- a/lib/models/PluginConfigRootfs.ts +++ b/lib/types/PluginConfigRootfs.ts @@ -19,7 +19,7 @@ */ export interface PluginConfigRootfs { - Type?: string; + type?: string; - DiffIds?: Array; + diff_ids?: Array; } diff --git a/lib/models/PluginConfigUser.ts b/lib/types/PluginConfigUser.ts similarity index 100% rename from lib/models/PluginConfigUser.ts rename to lib/types/PluginConfigUser.ts diff --git a/lib/models/PluginDevice.ts b/lib/types/PluginDevice.ts similarity index 100% rename from lib/models/PluginDevice.ts rename to lib/types/PluginDevice.ts diff --git a/lib/models/PluginEnv.ts b/lib/types/PluginEnv.ts similarity index 100% rename from lib/models/PluginEnv.ts rename to lib/types/PluginEnv.ts diff --git a/lib/models/PluginMount.ts b/lib/types/PluginMount.ts similarity index 100% rename from lib/models/PluginMount.ts rename to lib/types/PluginMount.ts diff --git a/lib/models/PluginPrivilege.ts b/lib/types/PluginPrivilege.ts similarity index 100% rename from lib/models/PluginPrivilege.ts rename to lib/types/PluginPrivilege.ts diff --git a/lib/models/PluginSettings.ts b/lib/types/PluginSettings.ts similarity index 88% rename from lib/models/PluginSettings.ts rename to lib/types/PluginSettings.ts index b801bf8..3507424 100644 --- a/lib/models/PluginSettings.ts +++ b/lib/types/PluginSettings.ts @@ -18,8 +18,8 @@ Do not edit the class manually. */ -import { type PluginDevice } from '../models/PluginDevice.js'; -import { type PluginMount } from '../models/PluginMount.js'; +import { type PluginDevice } from '../types/PluginDevice.js'; +import { type PluginMount } from '../types/PluginMount.js'; /** * user-configurable settings for the plugin. diff --git a/lib/models/PluginsInfo.ts b/lib/types/PluginsInfo.ts similarity index 100% rename from lib/models/PluginsInfo.ts rename to lib/types/PluginsInfo.ts diff --git a/lib/models/PortBinding.ts b/lib/types/PortBinding.ts similarity index 100% rename from lib/models/PortBinding.ts rename to lib/types/PortBinding.ts diff --git a/lib/models/PortStatus.ts b/lib/types/PortStatus.ts similarity index 92% rename from lib/models/PortStatus.ts rename to lib/types/PortStatus.ts index 6a9a059..c30e260 100644 --- a/lib/models/PortStatus.ts +++ b/lib/types/PortStatus.ts @@ -18,7 +18,7 @@ Do not edit the class manually. */ -import { type EndpointPortConfig } from '../models/EndpointPortConfig.js'; +import { type EndpointPortConfig } from '../types/EndpointPortConfig.js'; /** * represents the port status of a task\'s host ports whose service has published host ports diff --git a/lib/models/PortSummary.ts b/lib/types/PortSummary.ts similarity index 100% rename from lib/models/PortSummary.ts rename to lib/types/PortSummary.ts diff --git a/lib/models/ProcessConfig.ts b/lib/types/ProcessConfig.ts similarity index 86% rename from lib/models/ProcessConfig.ts rename to lib/types/ProcessConfig.ts index 4d09b4a..dd13f51 100644 --- a/lib/models/ProcessConfig.ts +++ b/lib/types/ProcessConfig.ts @@ -19,13 +19,13 @@ */ export interface ProcessConfig { - Privileged?: boolean; + privileged?: boolean; - User?: string; + user?: string; - Tty?: boolean; + tty?: boolean; - Entrypoint?: string; + entrypoint?: string; - Arguments?: Array; + arguments?: Array; } diff --git a/lib/models/ProgressDetail.ts b/lib/types/ProgressDetail.ts similarity index 94% rename from lib/models/ProgressDetail.ts rename to lib/types/ProgressDetail.ts index 4c5a3e5..8e393ae 100644 --- a/lib/models/ProgressDetail.ts +++ b/lib/types/ProgressDetail.ts @@ -19,7 +19,7 @@ */ export interface ProgressDetail { - Current?: number; + current?: number; - Total?: number; + total?: number; } diff --git a/lib/models/PushImageInfo.ts b/lib/types/PushImageInfo.ts similarity index 78% rename from lib/models/PushImageInfo.ts rename to lib/types/PushImageInfo.ts index 80961a3..a7b578f 100644 --- a/lib/models/PushImageInfo.ts +++ b/lib/types/PushImageInfo.ts @@ -18,13 +18,13 @@ Do not edit the class manually. */ -import { type ErrorDetail } from '../models/ErrorDetail.js'; -import { type ProgressDetail } from '../models/ProgressDetail.js'; +import { type ErrorDetail } from '../types/ErrorDetail.js'; +import { type ProgressDetail } from '../types/ProgressDetail.js'; export interface PushImageInfo { - ErrorDetail?: ErrorDetail; + errorDetail?: ErrorDetail; - Status?: string; + status?: string; - ProgressDetail?: ProgressDetail; + progressDetail?: ProgressDetail; } diff --git a/lib/models/Reachability.ts b/lib/types/Reachability.ts similarity index 100% rename from lib/models/Reachability.ts rename to lib/types/Reachability.ts diff --git a/lib/models/RegistryServiceConfig.ts b/lib/types/RegistryServiceConfig.ts similarity index 97% rename from lib/models/RegistryServiceConfig.ts rename to lib/types/RegistryServiceConfig.ts index 23ab0f1..c42fb4b 100644 --- a/lib/models/RegistryServiceConfig.ts +++ b/lib/types/RegistryServiceConfig.ts @@ -18,7 +18,7 @@ Do not edit the class manually. */ -import { type IndexInfo } from '../models/IndexInfo.js'; +import { type IndexInfo } from '../types/IndexInfo.js'; /** * RegistryServiceConfig stores daemon registry services configuration. diff --git a/lib/models/ResourceObject.ts b/lib/types/ResourceObject.ts similarity index 93% rename from lib/models/ResourceObject.ts rename to lib/types/ResourceObject.ts index 53b0cfb..e58bdc1 100644 --- a/lib/models/ResourceObject.ts +++ b/lib/types/ResourceObject.ts @@ -18,7 +18,7 @@ Do not edit the class manually. */ -import { type GenericResourcesInner } from '../models/GenericResourcesInner.js'; +import { type GenericResourcesInner } from '../types/GenericResourcesInner.js'; /** * An object describing the resources which can be advertised by a node and requested by a task. diff --git a/lib/models/Resources.ts b/lib/types/Resources.ts similarity index 94% rename from lib/models/Resources.ts rename to lib/types/Resources.ts index 5493492..3431e0b 100644 --- a/lib/models/Resources.ts +++ b/lib/types/Resources.ts @@ -18,11 +18,11 @@ Do not edit the class manually. */ -import { type DeviceMapping } from '../models/DeviceMapping.js'; -import { type DeviceRequest } from '../models/DeviceRequest.js'; -import { type ResourcesBlkioWeightDeviceInner } from '../models/ResourcesBlkioWeightDeviceInner.js'; -import { type ResourcesUlimitsInner } from '../models/ResourcesUlimitsInner.js'; -import { type ThrottleDevice } from '../models/ThrottleDevice.js'; +import { type DeviceMapping } from '../types/DeviceMapping.js'; +import { type DeviceRequest } from '../types/DeviceRequest.js'; +import { type ResourcesBlkioWeightDeviceInner } from '../types/ResourcesBlkioWeightDeviceInner.js'; +import { type ResourcesUlimitsInner } from '../types/ResourcesUlimitsInner.js'; +import { type ThrottleDevice } from '../types/ThrottleDevice.js'; /** * A container\'s resources (cgroups config, ulimits, etc) diff --git a/lib/models/ResourcesBlkioWeightDeviceInner.ts b/lib/types/ResourcesBlkioWeightDeviceInner.ts similarity index 100% rename from lib/models/ResourcesBlkioWeightDeviceInner.ts rename to lib/types/ResourcesBlkioWeightDeviceInner.ts diff --git a/lib/models/ResourcesUlimitsInner.ts b/lib/types/ResourcesUlimitsInner.ts similarity index 100% rename from lib/models/ResourcesUlimitsInner.ts rename to lib/types/ResourcesUlimitsInner.ts diff --git a/lib/models/RestartPolicy.ts b/lib/types/RestartPolicy.ts similarity index 100% rename from lib/models/RestartPolicy.ts rename to lib/types/RestartPolicy.ts diff --git a/lib/models/Runtime.ts b/lib/types/Runtime.ts similarity index 94% rename from lib/models/Runtime.ts rename to lib/types/Runtime.ts index 66dd086..303fbe2 100644 --- a/lib/models/Runtime.ts +++ b/lib/types/Runtime.ts @@ -25,15 +25,15 @@ export interface Runtime { /** * Name and, optional, path, of the OCI executable binary. If the path is omitted, the daemon searches the host\'s `$PATH` for the binary and uses the first result. */ - Path?: string; + path?: string; /** * List of command-line arguments to pass to the runtime when invoked. */ - RuntimeArgs?: Array | null; + runtimeArgs?: Array | null; /** * Information specific to the runtime. While this API specification does not define data provided by runtimes, the following well-known properties may be provided by runtimes: `org.opencontainers.runtime-spec.features`: features structure as defined in the [OCI Runtime Specification](https://github.com/opencontainers/runtime-spec/blob/main/features.md), in a JSON string representation. <p><br /></p> > **Note**: The information returned in this field, including the > formatting of values and labels, should not be considered stable, > and may change without notice. */ - Status?: { [key: string]: string } | null; + status?: { [key: string]: string } | null; } diff --git a/lib/models/Secret.ts b/lib/types/Secret.ts similarity index 88% rename from lib/models/Secret.ts rename to lib/types/Secret.ts index b45417f..8c3bf29 100644 --- a/lib/models/Secret.ts +++ b/lib/types/Secret.ts @@ -18,8 +18,8 @@ Do not edit the class manually. */ -import { type ObjectVersion } from '../models/ObjectVersion.js'; -import { type SecretSpec } from '../models/SecretSpec.js'; +import { type ObjectVersion } from '../types/ObjectVersion.js'; +import { type SecretSpec } from '../types/SecretSpec.js'; export interface Secret { ID?: string; diff --git a/lib/models/SecretCreateRequest.ts b/lib/types/SecretCreateRequest.ts similarity index 96% rename from lib/models/SecretCreateRequest.ts rename to lib/types/SecretCreateRequest.ts index 13b7b92..ebf2148 100644 --- a/lib/models/SecretCreateRequest.ts +++ b/lib/types/SecretCreateRequest.ts @@ -18,7 +18,7 @@ Do not edit the class manually. */ -import { type Driver } from '../models/Driver.js'; +import { type Driver } from '../types/Driver.js'; export interface SecretCreateRequest { /** diff --git a/lib/models/SecretSpec.ts b/lib/types/SecretSpec.ts similarity index 96% rename from lib/models/SecretSpec.ts rename to lib/types/SecretSpec.ts index cf4cc41..22f2247 100644 --- a/lib/models/SecretSpec.ts +++ b/lib/types/SecretSpec.ts @@ -18,7 +18,7 @@ Do not edit the class manually. */ -import { type Driver } from '../models/Driver.js'; +import { type Driver } from '../types/Driver.js'; export interface SecretSpec { /** diff --git a/lib/models/Service.ts b/lib/types/Service.ts similarity index 71% rename from lib/models/Service.ts rename to lib/types/Service.ts index b9653ba..a3ee60e 100644 --- a/lib/models/Service.ts +++ b/lib/types/Service.ts @@ -18,12 +18,12 @@ Do not edit the class manually. */ -import { type ObjectVersion } from '../models/ObjectVersion.js'; -import { type ServiceEndpoint } from '../models/ServiceEndpoint.js'; -import { type ServiceJobStatus } from '../models/ServiceJobStatus.js'; -import { type ServiceServiceStatus } from '../models/ServiceServiceStatus.js'; -import { type ServiceSpec } from '../models/ServiceSpec.js'; -import { type ServiceUpdateStatus } from '../models/ServiceUpdateStatus.js'; +import { type ObjectVersion } from '../types/ObjectVersion.js'; +import { type ServiceEndpoint } from '../types/ServiceEndpoint.js'; +import { type ServiceJobStatus } from '../types/ServiceJobStatus.js'; +import { type ServiceServiceStatus } from '../types/ServiceServiceStatus.js'; +import { type ServiceSpec } from '../types/ServiceSpec.js'; +import { type ServiceUpdateStatus } from '../types/ServiceUpdateStatus.js'; export interface Service { ID?: string; diff --git a/lib/models/ServiceCreateRequest.ts b/lib/types/ServiceCreateRequest.ts similarity index 75% rename from lib/models/ServiceCreateRequest.ts rename to lib/types/ServiceCreateRequest.ts index dca7d10..578a502 100644 --- a/lib/models/ServiceCreateRequest.ts +++ b/lib/types/ServiceCreateRequest.ts @@ -18,12 +18,12 @@ Do not edit the class manually. */ -import { type EndpointSpec } from '../models/EndpointSpec.js'; -import { type NetworkAttachmentConfig } from '../models/NetworkAttachmentConfig.js'; -import { type ServiceSpecMode } from '../models/ServiceSpecMode.js'; -import { type ServiceSpecRollbackConfig } from '../models/ServiceSpecRollbackConfig.js'; -import { type ServiceSpecUpdateConfig } from '../models/ServiceSpecUpdateConfig.js'; -import { type TaskSpec } from '../models/TaskSpec.js'; +import { type EndpointSpec } from '../types/EndpointSpec.js'; +import { type NetworkAttachmentConfig } from '../types/NetworkAttachmentConfig.js'; +import { type ServiceSpecMode } from '../types/ServiceSpecMode.js'; +import { type ServiceSpecRollbackConfig } from '../types/ServiceSpecRollbackConfig.js'; +import { type ServiceSpecUpdateConfig } from '../types/ServiceSpecUpdateConfig.js'; +import { type TaskSpec } from '../types/TaskSpec.js'; export interface ServiceCreateRequest { /** diff --git a/lib/models/ServiceCreateResponse.ts b/lib/types/ServiceCreateResponse.ts similarity index 100% rename from lib/models/ServiceCreateResponse.ts rename to lib/types/ServiceCreateResponse.ts diff --git a/lib/models/ServiceEndpoint.ts b/lib/types/ServiceEndpoint.ts similarity index 79% rename from lib/models/ServiceEndpoint.ts rename to lib/types/ServiceEndpoint.ts index 1aed34f..75bce15 100644 --- a/lib/models/ServiceEndpoint.ts +++ b/lib/types/ServiceEndpoint.ts @@ -18,9 +18,9 @@ Do not edit the class manually. */ -import { type EndpointPortConfig } from '../models/EndpointPortConfig.js'; -import { type EndpointSpec } from '../models/EndpointSpec.js'; -import { type ServiceEndpointVirtualIPsInner } from '../models/ServiceEndpointVirtualIPsInner.js'; +import { type EndpointPortConfig } from '../types/EndpointPortConfig.js'; +import { type EndpointSpec } from '../types/EndpointSpec.js'; +import { type ServiceEndpointVirtualIPsInner } from '../types/ServiceEndpointVirtualIPsInner.js'; export interface ServiceEndpoint { Spec?: EndpointSpec; diff --git a/lib/models/ServiceEndpointVirtualIPsInner.ts b/lib/types/ServiceEndpointVirtualIPsInner.ts similarity index 100% rename from lib/models/ServiceEndpointVirtualIPsInner.ts rename to lib/types/ServiceEndpointVirtualIPsInner.ts diff --git a/lib/models/ServiceInfo.ts b/lib/types/ServiceInfo.ts similarity index 93% rename from lib/models/ServiceInfo.ts rename to lib/types/ServiceInfo.ts index f591b5e..01b5ee1 100644 --- a/lib/models/ServiceInfo.ts +++ b/lib/types/ServiceInfo.ts @@ -18,7 +18,7 @@ Do not edit the class manually. */ -import { type NetworkTaskInfo } from '../models/NetworkTaskInfo.js'; +import { type NetworkTaskInfo } from '../types/NetworkTaskInfo.js'; /** * represents service parameters with the list of service\'s tasks diff --git a/lib/models/ServiceJobStatus.ts b/lib/types/ServiceJobStatus.ts similarity index 94% rename from lib/models/ServiceJobStatus.ts rename to lib/types/ServiceJobStatus.ts index e780757..92be5ca 100644 --- a/lib/models/ServiceJobStatus.ts +++ b/lib/types/ServiceJobStatus.ts @@ -18,7 +18,7 @@ Do not edit the class manually. */ -import { type ObjectVersion } from '../models/ObjectVersion.js'; +import { type ObjectVersion } from '../types/ObjectVersion.js'; /** * The status of the service when it is in one of ReplicatedJob or GlobalJob modes. Absent on Replicated and Global mode services. The JobIteration is an ObjectVersion, but unlike the Service\'s version, does not need to be sent with an update request. diff --git a/lib/models/ServiceServiceStatus.ts b/lib/types/ServiceServiceStatus.ts similarity index 100% rename from lib/models/ServiceServiceStatus.ts rename to lib/types/ServiceServiceStatus.ts diff --git a/lib/models/ServiceSpec.ts b/lib/types/ServiceSpec.ts similarity index 76% rename from lib/models/ServiceSpec.ts rename to lib/types/ServiceSpec.ts index eeee153..f251974 100644 --- a/lib/models/ServiceSpec.ts +++ b/lib/types/ServiceSpec.ts @@ -18,12 +18,12 @@ Do not edit the class manually. */ -import { type EndpointSpec } from '../models/EndpointSpec.js'; -import { type NetworkAttachmentConfig } from '../models/NetworkAttachmentConfig.js'; -import { type ServiceSpecMode } from '../models/ServiceSpecMode.js'; -import { type ServiceSpecRollbackConfig } from '../models/ServiceSpecRollbackConfig.js'; -import { type ServiceSpecUpdateConfig } from '../models/ServiceSpecUpdateConfig.js'; -import { type TaskSpec } from '../models/TaskSpec.js'; +import { type EndpointSpec } from '../types/EndpointSpec.js'; +import { type NetworkAttachmentConfig } from '../types/NetworkAttachmentConfig.js'; +import { type ServiceSpecMode } from '../types/ServiceSpecMode.js'; +import { type ServiceSpecRollbackConfig } from '../types/ServiceSpecRollbackConfig.js'; +import { type ServiceSpecUpdateConfig } from '../types/ServiceSpecUpdateConfig.js'; +import { type TaskSpec } from '../types/TaskSpec.js'; /** * User modifiable configuration for a service. diff --git a/lib/models/ServiceSpecMode.ts b/lib/types/ServiceSpecMode.ts similarity index 85% rename from lib/models/ServiceSpecMode.ts rename to lib/types/ServiceSpecMode.ts index 4f78a69..70629ec 100644 --- a/lib/models/ServiceSpecMode.ts +++ b/lib/types/ServiceSpecMode.ts @@ -18,8 +18,8 @@ Do not edit the class manually. */ -import { type ServiceSpecModeReplicated } from '../models/ServiceSpecModeReplicated.js'; -import { type ServiceSpecModeReplicatedJob } from '../models/ServiceSpecModeReplicatedJob.js'; +import { type ServiceSpecModeReplicated } from '../types/ServiceSpecModeReplicated.js'; +import { type ServiceSpecModeReplicatedJob } from '../types/ServiceSpecModeReplicatedJob.js'; /** * Scheduling mode for the service. diff --git a/lib/models/ServiceSpecModeReplicated.ts b/lib/types/ServiceSpecModeReplicated.ts similarity index 100% rename from lib/models/ServiceSpecModeReplicated.ts rename to lib/types/ServiceSpecModeReplicated.ts diff --git a/lib/models/ServiceSpecModeReplicatedJob.ts b/lib/types/ServiceSpecModeReplicatedJob.ts similarity index 100% rename from lib/models/ServiceSpecModeReplicatedJob.ts rename to lib/types/ServiceSpecModeReplicatedJob.ts diff --git a/lib/models/ServiceSpecRollbackConfig.ts b/lib/types/ServiceSpecRollbackConfig.ts similarity index 100% rename from lib/models/ServiceSpecRollbackConfig.ts rename to lib/types/ServiceSpecRollbackConfig.ts diff --git a/lib/models/ServiceSpecUpdateConfig.ts b/lib/types/ServiceSpecUpdateConfig.ts similarity index 100% rename from lib/models/ServiceSpecUpdateConfig.ts rename to lib/types/ServiceSpecUpdateConfig.ts diff --git a/lib/models/ServiceUpdateRequest.ts b/lib/types/ServiceUpdateRequest.ts similarity index 75% rename from lib/models/ServiceUpdateRequest.ts rename to lib/types/ServiceUpdateRequest.ts index fd3c2b9..22b4915 100644 --- a/lib/models/ServiceUpdateRequest.ts +++ b/lib/types/ServiceUpdateRequest.ts @@ -18,12 +18,12 @@ Do not edit the class manually. */ -import { type EndpointSpec } from '../models/EndpointSpec.js'; -import { type NetworkAttachmentConfig } from '../models/NetworkAttachmentConfig.js'; -import { type ServiceSpecMode } from '../models/ServiceSpecMode.js'; -import { type ServiceSpecRollbackConfig } from '../models/ServiceSpecRollbackConfig.js'; -import { type ServiceSpecUpdateConfig } from '../models/ServiceSpecUpdateConfig.js'; -import { type TaskSpec } from '../models/TaskSpec.js'; +import { type EndpointSpec } from '../types/EndpointSpec.js'; +import { type NetworkAttachmentConfig } from '../types/NetworkAttachmentConfig.js'; +import { type ServiceSpecMode } from '../types/ServiceSpecMode.js'; +import { type ServiceSpecRollbackConfig } from '../types/ServiceSpecRollbackConfig.js'; +import { type ServiceSpecUpdateConfig } from '../types/ServiceSpecUpdateConfig.js'; +import { type TaskSpec } from '../types/TaskSpec.js'; export interface ServiceUpdateRequest { /** diff --git a/lib/models/ServiceUpdateResponse.ts b/lib/types/ServiceUpdateResponse.ts similarity index 100% rename from lib/models/ServiceUpdateResponse.ts rename to lib/types/ServiceUpdateResponse.ts diff --git a/lib/models/ServiceUpdateStatus.ts b/lib/types/ServiceUpdateStatus.ts similarity index 100% rename from lib/models/ServiceUpdateStatus.ts rename to lib/types/ServiceUpdateStatus.ts diff --git a/lib/models/Swarm.ts b/lib/types/Swarm.ts similarity index 89% rename from lib/models/Swarm.ts rename to lib/types/Swarm.ts index 5c2c825..7d31bc0 100644 --- a/lib/models/Swarm.ts +++ b/lib/types/Swarm.ts @@ -18,10 +18,10 @@ Do not edit the class manually. */ -import { type JoinTokens } from '../models/JoinTokens.js'; -import { type ObjectVersion } from '../models/ObjectVersion.js'; -import { type SwarmSpec } from '../models/SwarmSpec.js'; -import { type TLSInfo } from '../models/TLSInfo.js'; +import { type JoinTokens } from '../types/JoinTokens.js'; +import { type ObjectVersion } from '../types/ObjectVersion.js'; +import { type SwarmSpec } from '../types/SwarmSpec.js'; +import { type TLSInfo } from '../types/TLSInfo.js'; export interface Swarm { /** diff --git a/lib/models/SwarmInfo.ts b/lib/types/SwarmInfo.ts similarity index 89% rename from lib/models/SwarmInfo.ts rename to lib/types/SwarmInfo.ts index 45b71a5..a45bf6a 100644 --- a/lib/models/SwarmInfo.ts +++ b/lib/types/SwarmInfo.ts @@ -18,9 +18,9 @@ Do not edit the class manually. */ -import { type ClusterInfo } from '../models/ClusterInfo.js'; -import { type LocalNodeState } from '../models/LocalNodeState.js'; -import { type PeerNode } from '../models/PeerNode.js'; +import { type ClusterInfo } from '../types/ClusterInfo.js'; +import { type LocalNodeState } from '../types/LocalNodeState.js'; +import { type PeerNode } from '../types/PeerNode.js'; /** * Represents generic information about swarm. diff --git a/lib/models/SwarmInitRequest.ts b/lib/types/SwarmInitRequest.ts similarity index 98% rename from lib/models/SwarmInitRequest.ts rename to lib/types/SwarmInitRequest.ts index fb0a181..7269b06 100644 --- a/lib/models/SwarmInitRequest.ts +++ b/lib/types/SwarmInitRequest.ts @@ -18,7 +18,7 @@ Do not edit the class manually. */ -import { type SwarmSpec } from '../models/SwarmSpec.js'; +import { type SwarmSpec } from '../types/SwarmSpec.js'; export interface SwarmInitRequest { /** diff --git a/lib/models/SwarmJoinRequest.ts b/lib/types/SwarmJoinRequest.ts similarity index 100% rename from lib/models/SwarmJoinRequest.ts rename to lib/types/SwarmJoinRequest.ts diff --git a/lib/models/SwarmSpec.ts b/lib/types/SwarmSpec.ts similarity index 72% rename from lib/models/SwarmSpec.ts rename to lib/types/SwarmSpec.ts index a9b0694..4328e0e 100644 --- a/lib/models/SwarmSpec.ts +++ b/lib/types/SwarmSpec.ts @@ -18,12 +18,12 @@ Do not edit the class manually. */ -import { type SwarmSpecCAConfig } from '../models/SwarmSpecCAConfig.js'; -import { type SwarmSpecDispatcher } from '../models/SwarmSpecDispatcher.js'; -import { type SwarmSpecEncryptionConfig } from '../models/SwarmSpecEncryptionConfig.js'; -import { type SwarmSpecOrchestration } from '../models/SwarmSpecOrchestration.js'; -import { type SwarmSpecRaft } from '../models/SwarmSpecRaft.js'; -import { type SwarmSpecTaskDefaults } from '../models/SwarmSpecTaskDefaults.js'; +import { type SwarmSpecCAConfig } from '../types/SwarmSpecCAConfig.js'; +import { type SwarmSpecDispatcher } from '../types/SwarmSpecDispatcher.js'; +import { type SwarmSpecEncryptionConfig } from '../types/SwarmSpecEncryptionConfig.js'; +import { type SwarmSpecOrchestration } from '../types/SwarmSpecOrchestration.js'; +import { type SwarmSpecRaft } from '../types/SwarmSpecRaft.js'; +import { type SwarmSpecTaskDefaults } from '../types/SwarmSpecTaskDefaults.js'; /** * User modifiable swarm configuration. diff --git a/lib/models/SwarmSpecCAConfig.ts b/lib/types/SwarmSpecCAConfig.ts similarity index 93% rename from lib/models/SwarmSpecCAConfig.ts rename to lib/types/SwarmSpecCAConfig.ts index 659c5f2..8aa95eb 100644 --- a/lib/models/SwarmSpecCAConfig.ts +++ b/lib/types/SwarmSpecCAConfig.ts @@ -18,7 +18,7 @@ Do not edit the class manually. */ -import { type SwarmSpecCAConfigExternalCAsInner } from '../models/SwarmSpecCAConfigExternalCAsInner.js'; +import { type SwarmSpecCAConfigExternalCAsInner } from '../types/SwarmSpecCAConfigExternalCAsInner.js'; /** * CA configuration. diff --git a/lib/models/SwarmSpecCAConfigExternalCAsInner.ts b/lib/types/SwarmSpecCAConfigExternalCAsInner.ts similarity index 100% rename from lib/models/SwarmSpecCAConfigExternalCAsInner.ts rename to lib/types/SwarmSpecCAConfigExternalCAsInner.ts diff --git a/lib/models/SwarmSpecDispatcher.ts b/lib/types/SwarmSpecDispatcher.ts similarity index 100% rename from lib/models/SwarmSpecDispatcher.ts rename to lib/types/SwarmSpecDispatcher.ts diff --git a/lib/models/SwarmSpecEncryptionConfig.ts b/lib/types/SwarmSpecEncryptionConfig.ts similarity index 100% rename from lib/models/SwarmSpecEncryptionConfig.ts rename to lib/types/SwarmSpecEncryptionConfig.ts diff --git a/lib/models/SwarmSpecOrchestration.ts b/lib/types/SwarmSpecOrchestration.ts similarity index 100% rename from lib/models/SwarmSpecOrchestration.ts rename to lib/types/SwarmSpecOrchestration.ts diff --git a/lib/models/SwarmSpecRaft.ts b/lib/types/SwarmSpecRaft.ts similarity index 100% rename from lib/models/SwarmSpecRaft.ts rename to lib/types/SwarmSpecRaft.ts diff --git a/lib/models/SwarmSpecTaskDefaults.ts b/lib/types/SwarmSpecTaskDefaults.ts similarity index 90% rename from lib/models/SwarmSpecTaskDefaults.ts rename to lib/types/SwarmSpecTaskDefaults.ts index 37062e5..89ed69d 100644 --- a/lib/models/SwarmSpecTaskDefaults.ts +++ b/lib/types/SwarmSpecTaskDefaults.ts @@ -18,7 +18,7 @@ Do not edit the class manually. */ -import { type SwarmSpecTaskDefaultsLogDriver } from '../models/SwarmSpecTaskDefaultsLogDriver.js'; +import { type SwarmSpecTaskDefaultsLogDriver } from '../types/SwarmSpecTaskDefaultsLogDriver.js'; /** * Defaults for creating tasks in this cluster. diff --git a/lib/models/SwarmSpecTaskDefaultsLogDriver.ts b/lib/types/SwarmSpecTaskDefaultsLogDriver.ts similarity index 100% rename from lib/models/SwarmSpecTaskDefaultsLogDriver.ts rename to lib/types/SwarmSpecTaskDefaultsLogDriver.ts diff --git a/lib/models/SwarmUnlockRequest.ts b/lib/types/SwarmUnlockRequest.ts similarity index 100% rename from lib/models/SwarmUnlockRequest.ts rename to lib/types/SwarmUnlockRequest.ts diff --git a/lib/models/SystemAuthResponse.ts b/lib/types/SystemAuthResponse.ts similarity index 100% rename from lib/models/SystemAuthResponse.ts rename to lib/types/SystemAuthResponse.ts diff --git a/lib/models/SystemDataUsageResponse.ts b/lib/types/SystemDataUsageResponse.ts similarity index 80% rename from lib/models/SystemDataUsageResponse.ts rename to lib/types/SystemDataUsageResponse.ts index 032de14..cea2819 100644 --- a/lib/models/SystemDataUsageResponse.ts +++ b/lib/types/SystemDataUsageResponse.ts @@ -18,10 +18,10 @@ Do not edit the class manually. */ -import { type BuildCache } from '../models/BuildCache.js'; -import { type ContainerSummary } from '../models/ContainerSummary.js'; -import { type ImageSummary } from '../models/ImageSummary.js'; -import { type Volume } from '../models/Volume.js'; +import { type BuildCache } from '../types/BuildCache.js'; +import { type ContainerSummary } from '../types/ContainerSummary.js'; +import { type ImageSummary } from '../types/ImageSummary.js'; +import { type Volume } from '../types/Volume.js'; export interface SystemDataUsageResponse { LayersSize?: number; diff --git a/lib/models/SystemInfo.ts b/lib/types/SystemInfo.ts similarity index 95% rename from lib/models/SystemInfo.ts rename to lib/types/SystemInfo.ts index 5a40463..7eca3c1 100644 --- a/lib/models/SystemInfo.ts +++ b/lib/types/SystemInfo.ts @@ -18,16 +18,16 @@ Do not edit the class manually. */ -import { type Commit } from '../models/Commit.js'; -import { type ContainerdInfo } from '../models/ContainerdInfo.js'; -import { type DeviceInfo } from '../models/DeviceInfo.js'; -import { type FirewallInfo } from '../models/FirewallInfo.js'; -import { type GenericResourcesInner } from '../models/GenericResourcesInner.js'; -import { type PluginsInfo } from '../models/PluginsInfo.js'; -import { type RegistryServiceConfig } from '../models/RegistryServiceConfig.js'; -import { type Runtime } from '../models/Runtime.js'; -import { type SwarmInfo } from '../models/SwarmInfo.js'; -import { type SystemInfoDefaultAddressPoolsInner } from '../models/SystemInfoDefaultAddressPoolsInner.js'; +import { type Commit } from '../types/Commit.js'; +import { type ContainerdInfo } from '../types/ContainerdInfo.js'; +import { type DeviceInfo } from '../types/DeviceInfo.js'; +import { type FirewallInfo } from '../types/FirewallInfo.js'; +import { type GenericResourcesInner } from '../types/GenericResourcesInner.js'; +import { type PluginsInfo } from '../types/PluginsInfo.js'; +import { type RegistryServiceConfig } from '../types/RegistryServiceConfig.js'; +import { type Runtime } from '../types/Runtime.js'; +import { type SwarmInfo } from '../types/SwarmInfo.js'; +import { type SystemInfoDefaultAddressPoolsInner } from '../types/SystemInfoDefaultAddressPoolsInner.js'; export interface SystemInfo { /** diff --git a/lib/models/SystemInfoDefaultAddressPoolsInner.ts b/lib/types/SystemInfoDefaultAddressPoolsInner.ts similarity index 100% rename from lib/models/SystemInfoDefaultAddressPoolsInner.ts rename to lib/types/SystemInfoDefaultAddressPoolsInner.ts diff --git a/lib/models/SystemVersion.ts b/lib/types/SystemVersion.ts similarity index 92% rename from lib/models/SystemVersion.ts rename to lib/types/SystemVersion.ts index c4a28de..7321d1b 100644 --- a/lib/models/SystemVersion.ts +++ b/lib/types/SystemVersion.ts @@ -18,8 +18,8 @@ Do not edit the class manually. */ -import { type SystemVersionComponentsInner } from '../models/SystemVersionComponentsInner.js'; -import { type SystemVersionPlatform } from '../models/SystemVersionPlatform.js'; +import { type SystemVersionComponentsInner } from '../types/SystemVersionComponentsInner.js'; +import { type SystemVersionPlatform } from '../types/SystemVersionPlatform.js'; /** * Response of Engine API: GET \"/version\" diff --git a/lib/models/SystemVersionComponentsInner.ts b/lib/types/SystemVersionComponentsInner.ts similarity index 100% rename from lib/models/SystemVersionComponentsInner.ts rename to lib/types/SystemVersionComponentsInner.ts diff --git a/lib/models/SystemVersionPlatform.ts b/lib/types/SystemVersionPlatform.ts similarity index 100% rename from lib/models/SystemVersionPlatform.ts rename to lib/types/SystemVersionPlatform.ts diff --git a/lib/models/TLSInfo.ts b/lib/types/TLSInfo.ts similarity index 100% rename from lib/models/TLSInfo.ts rename to lib/types/TLSInfo.ts diff --git a/lib/models/Task.ts b/lib/types/Task.ts similarity index 83% rename from lib/models/Task.ts rename to lib/types/Task.ts index bcec4ac..1ad1066 100644 --- a/lib/models/Task.ts +++ b/lib/types/Task.ts @@ -18,11 +18,11 @@ Do not edit the class manually. */ -import { type GenericResourcesInner } from '../models/GenericResourcesInner.js'; -import { type ObjectVersion } from '../models/ObjectVersion.js'; -import { type TaskSpec } from '../models/TaskSpec.js'; -import { type TaskState } from '../models/TaskState.js'; -import { type TaskStatus } from '../models/TaskStatus.js'; +import { type GenericResourcesInner } from '../types/GenericResourcesInner.js'; +import { type ObjectVersion } from '../types/ObjectVersion.js'; +import { type TaskSpec } from '../types/TaskSpec.js'; +import { type TaskState } from '../types/TaskState.js'; +import { type TaskStatus } from '../types/TaskStatus.js'; export interface Task { /** diff --git a/lib/models/TaskSpec.ts b/lib/types/TaskSpec.ts similarity index 70% rename from lib/models/TaskSpec.ts rename to lib/types/TaskSpec.ts index d831824..3958c63 100644 --- a/lib/models/TaskSpec.ts +++ b/lib/types/TaskSpec.ts @@ -18,14 +18,14 @@ Do not edit the class manually. */ -import { type NetworkAttachmentConfig } from '../models/NetworkAttachmentConfig.js'; -import { type TaskSpecContainerSpec } from '../models/TaskSpecContainerSpec.js'; -import { type TaskSpecLogDriver } from '../models/TaskSpecLogDriver.js'; -import { type TaskSpecNetworkAttachmentSpec } from '../models/TaskSpecNetworkAttachmentSpec.js'; -import { type TaskSpecPlacement } from '../models/TaskSpecPlacement.js'; -import { type TaskSpecPluginSpec } from '../models/TaskSpecPluginSpec.js'; -import { type TaskSpecResources } from '../models/TaskSpecResources.js'; -import { type TaskSpecRestartPolicy } from '../models/TaskSpecRestartPolicy.js'; +import { type NetworkAttachmentConfig } from '../types/NetworkAttachmentConfig.js'; +import { type TaskSpecContainerSpec } from '../types/TaskSpecContainerSpec.js'; +import { type TaskSpecLogDriver } from '../types/TaskSpecLogDriver.js'; +import { type TaskSpecNetworkAttachmentSpec } from '../types/TaskSpecNetworkAttachmentSpec.js'; +import { type TaskSpecPlacement } from '../types/TaskSpecPlacement.js'; +import { type TaskSpecPluginSpec } from '../types/TaskSpecPluginSpec.js'; +import { type TaskSpecResources } from '../types/TaskSpecResources.js'; +import { type TaskSpecRestartPolicy } from '../types/TaskSpecRestartPolicy.js'; /** * User modifiable task configuration. diff --git a/lib/models/TaskSpecContainerSpec.ts b/lib/types/TaskSpecContainerSpec.ts similarity index 89% rename from lib/models/TaskSpecContainerSpec.ts rename to lib/types/TaskSpecContainerSpec.ts index c9a133e..3015aa2 100644 --- a/lib/models/TaskSpecContainerSpec.ts +++ b/lib/types/TaskSpecContainerSpec.ts @@ -18,13 +18,13 @@ Do not edit the class manually. */ -import { type HealthConfig } from '../models/HealthConfig.js'; -import { type Mount } from '../models/Mount.js'; -import { type ResourcesUlimitsInner } from '../models/ResourcesUlimitsInner.js'; -import { type TaskSpecContainerSpecConfigsInner } from '../models/TaskSpecContainerSpecConfigsInner.js'; -import { type TaskSpecContainerSpecDNSConfig } from '../models/TaskSpecContainerSpecDNSConfig.js'; -import { type TaskSpecContainerSpecPrivileges } from '../models/TaskSpecContainerSpecPrivileges.js'; -import { type TaskSpecContainerSpecSecretsInner } from '../models/TaskSpecContainerSpecSecretsInner.js'; +import { type HealthConfig } from '../types/HealthConfig.js'; +import { type Mount } from '../types/Mount.js'; +import { type ResourcesUlimitsInner } from '../types/ResourcesUlimitsInner.js'; +import { type TaskSpecContainerSpecConfigsInner } from '../types/TaskSpecContainerSpecConfigsInner.js'; +import { type TaskSpecContainerSpecDNSConfig } from '../types/TaskSpecContainerSpecDNSConfig.js'; +import { type TaskSpecContainerSpecPrivileges } from '../types/TaskSpecContainerSpecPrivileges.js'; +import { type TaskSpecContainerSpecSecretsInner } from '../types/TaskSpecContainerSpecSecretsInner.js'; /** * Container spec for the service.


> **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are > mutually exclusive. PluginSpec is only used when the Runtime field > is set to `plugin`. NetworkAttachmentSpec is used when the Runtime > field is set to `attachment`. diff --git a/lib/models/TaskSpecContainerSpecConfigsInner.ts b/lib/types/TaskSpecContainerSpecConfigsInner.ts similarity index 92% rename from lib/models/TaskSpecContainerSpecConfigsInner.ts rename to lib/types/TaskSpecContainerSpecConfigsInner.ts index cc7eaec..7eaf545 100644 --- a/lib/models/TaskSpecContainerSpecConfigsInner.ts +++ b/lib/types/TaskSpecContainerSpecConfigsInner.ts @@ -18,7 +18,7 @@ Do not edit the class manually. */ -import { type TaskSpecContainerSpecConfigsInnerFile } from '../models/TaskSpecContainerSpecConfigsInnerFile.js'; +import { type TaskSpecContainerSpecConfigsInnerFile } from '../types/TaskSpecContainerSpecConfigsInnerFile.js'; export interface TaskSpecContainerSpecConfigsInner { File?: TaskSpecContainerSpecConfigsInnerFile; diff --git a/lib/models/TaskSpecContainerSpecConfigsInnerFile.ts b/lib/types/TaskSpecContainerSpecConfigsInnerFile.ts similarity index 100% rename from lib/models/TaskSpecContainerSpecConfigsInnerFile.ts rename to lib/types/TaskSpecContainerSpecConfigsInnerFile.ts diff --git a/lib/models/TaskSpecContainerSpecDNSConfig.ts b/lib/types/TaskSpecContainerSpecDNSConfig.ts similarity index 100% rename from lib/models/TaskSpecContainerSpecDNSConfig.ts rename to lib/types/TaskSpecContainerSpecDNSConfig.ts diff --git a/lib/models/TaskSpecContainerSpecPrivileges.ts b/lib/types/TaskSpecContainerSpecPrivileges.ts similarity index 86% rename from lib/models/TaskSpecContainerSpecPrivileges.ts rename to lib/types/TaskSpecContainerSpecPrivileges.ts index 202e41f..8e53102 100644 --- a/lib/models/TaskSpecContainerSpecPrivileges.ts +++ b/lib/types/TaskSpecContainerSpecPrivileges.ts @@ -18,10 +18,10 @@ Do not edit the class manually. */ -import { type TaskSpecContainerSpecPrivilegesAppArmor } from '../models/TaskSpecContainerSpecPrivilegesAppArmor.js'; -import { type TaskSpecContainerSpecPrivilegesCredentialSpec } from '../models/TaskSpecContainerSpecPrivilegesCredentialSpec.js'; -import { type TaskSpecContainerSpecPrivilegesSELinuxContext } from '../models/TaskSpecContainerSpecPrivilegesSELinuxContext.js'; -import { type TaskSpecContainerSpecPrivilegesSeccomp } from '../models/TaskSpecContainerSpecPrivilegesSeccomp.js'; +import { type TaskSpecContainerSpecPrivilegesAppArmor } from '../types/TaskSpecContainerSpecPrivilegesAppArmor.js'; +import { type TaskSpecContainerSpecPrivilegesCredentialSpec } from '../types/TaskSpecContainerSpecPrivilegesCredentialSpec.js'; +import { type TaskSpecContainerSpecPrivilegesSELinuxContext } from '../types/TaskSpecContainerSpecPrivilegesSELinuxContext.js'; +import { type TaskSpecContainerSpecPrivilegesSeccomp } from '../types/TaskSpecContainerSpecPrivilegesSeccomp.js'; /** * Security options for the container diff --git a/lib/models/TaskSpecContainerSpecPrivilegesAppArmor.ts b/lib/types/TaskSpecContainerSpecPrivilegesAppArmor.ts similarity index 100% rename from lib/models/TaskSpecContainerSpecPrivilegesAppArmor.ts rename to lib/types/TaskSpecContainerSpecPrivilegesAppArmor.ts diff --git a/lib/models/TaskSpecContainerSpecPrivilegesCredentialSpec.ts b/lib/types/TaskSpecContainerSpecPrivilegesCredentialSpec.ts similarity index 100% rename from lib/models/TaskSpecContainerSpecPrivilegesCredentialSpec.ts rename to lib/types/TaskSpecContainerSpecPrivilegesCredentialSpec.ts diff --git a/lib/models/TaskSpecContainerSpecPrivilegesSELinuxContext.ts b/lib/types/TaskSpecContainerSpecPrivilegesSELinuxContext.ts similarity index 100% rename from lib/models/TaskSpecContainerSpecPrivilegesSELinuxContext.ts rename to lib/types/TaskSpecContainerSpecPrivilegesSELinuxContext.ts diff --git a/lib/models/TaskSpecContainerSpecPrivilegesSeccomp.ts b/lib/types/TaskSpecContainerSpecPrivilegesSeccomp.ts similarity index 100% rename from lib/models/TaskSpecContainerSpecPrivilegesSeccomp.ts rename to lib/types/TaskSpecContainerSpecPrivilegesSeccomp.ts diff --git a/lib/models/TaskSpecContainerSpecSecretsInner.ts b/lib/types/TaskSpecContainerSpecSecretsInner.ts similarity index 91% rename from lib/models/TaskSpecContainerSpecSecretsInner.ts rename to lib/types/TaskSpecContainerSpecSecretsInner.ts index 081e207..c7ae43e 100644 --- a/lib/models/TaskSpecContainerSpecSecretsInner.ts +++ b/lib/types/TaskSpecContainerSpecSecretsInner.ts @@ -18,7 +18,7 @@ Do not edit the class manually. */ -import { type TaskSpecContainerSpecSecretsInnerFile } from '../models/TaskSpecContainerSpecSecretsInnerFile.js'; +import { type TaskSpecContainerSpecSecretsInnerFile } from '../types/TaskSpecContainerSpecSecretsInnerFile.js'; export interface TaskSpecContainerSpecSecretsInner { File?: TaskSpecContainerSpecSecretsInnerFile; diff --git a/lib/models/TaskSpecContainerSpecSecretsInnerFile.ts b/lib/types/TaskSpecContainerSpecSecretsInnerFile.ts similarity index 100% rename from lib/models/TaskSpecContainerSpecSecretsInnerFile.ts rename to lib/types/TaskSpecContainerSpecSecretsInnerFile.ts diff --git a/lib/models/TaskSpecLogDriver.ts b/lib/types/TaskSpecLogDriver.ts similarity index 100% rename from lib/models/TaskSpecLogDriver.ts rename to lib/types/TaskSpecLogDriver.ts diff --git a/lib/models/TaskSpecNetworkAttachmentSpec.ts b/lib/types/TaskSpecNetworkAttachmentSpec.ts similarity index 100% rename from lib/models/TaskSpecNetworkAttachmentSpec.ts rename to lib/types/TaskSpecNetworkAttachmentSpec.ts diff --git a/lib/models/TaskSpecPlacement.ts b/lib/types/TaskSpecPlacement.ts similarity index 95% rename from lib/models/TaskSpecPlacement.ts rename to lib/types/TaskSpecPlacement.ts index 0264d15..441789f 100644 --- a/lib/models/TaskSpecPlacement.ts +++ b/lib/types/TaskSpecPlacement.ts @@ -18,8 +18,8 @@ Do not edit the class manually. */ -import { type Platform } from '../models/Platform.js'; -import { type TaskSpecPlacementPreferencesInner } from '../models/TaskSpecPlacementPreferencesInner.js'; +import { type Platform } from '../types/Platform.js'; +import { type TaskSpecPlacementPreferencesInner } from '../types/TaskSpecPlacementPreferencesInner.js'; export interface TaskSpecPlacement { /** diff --git a/lib/models/TaskSpecPlacementPreferencesInner.ts b/lib/types/TaskSpecPlacementPreferencesInner.ts similarity index 94% rename from lib/models/TaskSpecPlacementPreferencesInner.ts rename to lib/types/TaskSpecPlacementPreferencesInner.ts index b0acd4e..f9a5726 100644 --- a/lib/models/TaskSpecPlacementPreferencesInner.ts +++ b/lib/types/TaskSpecPlacementPreferencesInner.ts @@ -18,7 +18,7 @@ Do not edit the class manually. */ -import { type TaskSpecPlacementPreferencesInnerSpread } from '../models/TaskSpecPlacementPreferencesInnerSpread.js'; +import { type TaskSpecPlacementPreferencesInnerSpread } from '../types/TaskSpecPlacementPreferencesInnerSpread.js'; export interface TaskSpecPlacementPreferencesInner { Spread?: TaskSpecPlacementPreferencesInnerSpread; diff --git a/lib/models/TaskSpecPlacementPreferencesInnerSpread.ts b/lib/types/TaskSpecPlacementPreferencesInnerSpread.ts similarity index 100% rename from lib/models/TaskSpecPlacementPreferencesInnerSpread.ts rename to lib/types/TaskSpecPlacementPreferencesInnerSpread.ts diff --git a/lib/models/TaskSpecPluginSpec.ts b/lib/types/TaskSpecPluginSpec.ts similarity index 95% rename from lib/models/TaskSpecPluginSpec.ts rename to lib/types/TaskSpecPluginSpec.ts index 8eec86a..4461932 100644 --- a/lib/models/TaskSpecPluginSpec.ts +++ b/lib/types/TaskSpecPluginSpec.ts @@ -18,7 +18,7 @@ Do not edit the class manually. */ -import { type PluginPrivilege } from '../models/PluginPrivilege.js'; +import { type PluginPrivilege } from '../types/PluginPrivilege.js'; /** * Plugin spec for the service. *(Experimental release only.)*


> **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are > mutually exclusive. PluginSpec is only used when the Runtime field > is set to `plugin`. NetworkAttachmentSpec is used when the Runtime > field is set to `attachment`. diff --git a/lib/models/TaskSpecResources.ts b/lib/types/TaskSpecResources.ts similarity index 89% rename from lib/models/TaskSpecResources.ts rename to lib/types/TaskSpecResources.ts index 83d48f0..11420fc 100644 --- a/lib/models/TaskSpecResources.ts +++ b/lib/types/TaskSpecResources.ts @@ -18,8 +18,8 @@ Do not edit the class manually. */ -import { type Limit } from '../models/Limit.js'; -import { type ResourceObject } from '../models/ResourceObject.js'; +import { type Limit } from '../types/Limit.js'; +import { type ResourceObject } from '../types/ResourceObject.js'; /** * Resource requirements which apply to each individual container created as part of the service. diff --git a/lib/models/TaskSpecRestartPolicy.ts b/lib/types/TaskSpecRestartPolicy.ts similarity index 100% rename from lib/models/TaskSpecRestartPolicy.ts rename to lib/types/TaskSpecRestartPolicy.ts diff --git a/lib/models/TaskState.ts b/lib/types/TaskState.ts similarity index 100% rename from lib/models/TaskState.ts rename to lib/types/TaskState.ts diff --git a/lib/models/TaskStatus.ts b/lib/types/TaskStatus.ts similarity index 84% rename from lib/models/TaskStatus.ts rename to lib/types/TaskStatus.ts index c12308a..23bf3f1 100644 --- a/lib/models/TaskStatus.ts +++ b/lib/types/TaskStatus.ts @@ -18,9 +18,9 @@ Do not edit the class manually. */ -import { type ContainerStatus } from '../models/ContainerStatus.js'; -import { type PortStatus } from '../models/PortStatus.js'; -import { type TaskState } from '../models/TaskState.js'; +import { type ContainerStatus } from '../types/ContainerStatus.js'; +import { type PortStatus } from '../types/PortStatus.js'; +import { type TaskState } from '../types/TaskState.js'; /** * represents the status of a task. diff --git a/lib/models/ThrottleDevice.ts b/lib/types/ThrottleDevice.ts similarity index 100% rename from lib/models/ThrottleDevice.ts rename to lib/types/ThrottleDevice.ts diff --git a/lib/models/UnlockKeyResponse.ts b/lib/types/UnlockKeyResponse.ts similarity index 100% rename from lib/models/UnlockKeyResponse.ts rename to lib/types/UnlockKeyResponse.ts diff --git a/lib/models/Volume.ts b/lib/types/Volume.ts similarity index 93% rename from lib/models/Volume.ts rename to lib/types/Volume.ts index f35fc17..24ec0a2 100644 --- a/lib/models/Volume.ts +++ b/lib/types/Volume.ts @@ -18,8 +18,8 @@ Do not edit the class manually. */ -import { type ClusterVolume } from '../models/ClusterVolume.js'; -import { type VolumeUsageData } from '../models/VolumeUsageData.js'; +import { type ClusterVolume } from '../types/ClusterVolume.js'; +import { type VolumeUsageData } from '../types/VolumeUsageData.js'; export interface Volume { /** diff --git a/lib/models/VolumeCreateOptions.ts b/lib/types/VolumeCreateOptions.ts similarity index 94% rename from lib/models/VolumeCreateOptions.ts rename to lib/types/VolumeCreateOptions.ts index ae7268c..2bc0325 100644 --- a/lib/models/VolumeCreateOptions.ts +++ b/lib/types/VolumeCreateOptions.ts @@ -18,7 +18,7 @@ Do not edit the class manually. */ -import { type ClusterVolumeSpec } from '../models/ClusterVolumeSpec.js'; +import { type ClusterVolumeSpec } from '../types/ClusterVolumeSpec.js'; /** * Volume configuration diff --git a/lib/models/VolumeListResponse.ts b/lib/types/VolumeListResponse.ts similarity index 95% rename from lib/models/VolumeListResponse.ts rename to lib/types/VolumeListResponse.ts index 4023579..988d2b0 100644 --- a/lib/models/VolumeListResponse.ts +++ b/lib/types/VolumeListResponse.ts @@ -18,7 +18,7 @@ Do not edit the class manually. */ -import { type Volume } from '../models/Volume.js'; +import { type Volume } from '../types/Volume.js'; /** * Volume list response diff --git a/lib/models/VolumePruneResponse.ts b/lib/types/VolumePruneResponse.ts similarity index 100% rename from lib/models/VolumePruneResponse.ts rename to lib/types/VolumePruneResponse.ts diff --git a/lib/models/VolumeUpdateRequest.ts b/lib/types/VolumeUpdateRequest.ts similarity index 92% rename from lib/models/VolumeUpdateRequest.ts rename to lib/types/VolumeUpdateRequest.ts index c8529ed..059ebed 100644 --- a/lib/models/VolumeUpdateRequest.ts +++ b/lib/types/VolumeUpdateRequest.ts @@ -18,7 +18,7 @@ Do not edit the class manually. */ -import { type ClusterVolumeSpec } from '../models/ClusterVolumeSpec.js'; +import { type ClusterVolumeSpec } from '../types/ClusterVolumeSpec.js'; /** * Volume configuration diff --git a/lib/models/VolumeUsageData.ts b/lib/types/VolumeUsageData.ts similarity index 100% rename from lib/models/VolumeUsageData.ts rename to lib/types/VolumeUsageData.ts diff --git a/lib/models/index.ts b/lib/types/index.ts similarity index 100% rename from lib/models/index.ts rename to lib/types/index.ts diff --git a/openapi-config.yaml b/openapi-config.yaml index 62cc9f2..cc096f0 100644 --- a/openapi-config.yaml +++ b/openapi-config.yaml @@ -3,10 +3,11 @@ templateDir: templates importFileExtension: .js supportsES6: true platform: node +modelPackage: types globalProperties: - supportingFiles: models/index.ts + supportingFiles: types/index.ts models: "" files: model/index.mustache: templateType: SupportingFiles - destinationFilename: models/index.ts + destinationFilename: types/index.ts diff --git a/package-lock.json b/package-lock.json index ef42e0d..6022dc2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,12 +9,14 @@ "version": "0.0.2", "license": "Apache-2.0", "dependencies": { - "ssh2": "^1.16.0" + "ssh2": "^1.16.0", + "tar-stream": "^3.1.4" }, "devDependencies": { "@openapitools/openapi-generator-cli": "^2.23.4", "@types/node": "^24.5.2", "@types/ssh2": "^1.15.5", + "@types/tar-stream": "^3.1.4", "oxlint": "^1.16.0", "oxlint-tsgolint": "^0.2.0", "prettier": "^3.6.2", @@ -1437,6 +1439,16 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/tar-stream": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/@types/tar-stream/-/tar-stream-3.1.4.tgz", + "integrity": "sha512-921gW0+g29mCJX0fRvqeHzBlE/XclDaAG0Ousy1LCghsOhvaKacDeRGEVzQP9IPfKn8Vysy7FEXAIxycpc/CMg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@vitest/expect": { "version": "3.2.4", "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-3.2.4.tgz", @@ -1675,6 +1687,20 @@ "proxy-from-env": "^1.1.0" } }, + "node_modules/b4a": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.7.3.tgz", + "integrity": "sha512-5Q2mfq2WfGuFp3uS//0s6baOJLMoVduPYVeNmDYxu5OUA1/cBfvr2RIS7vi62LdNj/urk1hfmj867I3qt6uZ7Q==", + "license": "Apache-2.0", + "peerDependencies": { + "react-native-b4a": "*" + }, + "peerDependenciesMeta": { + "react-native-b4a": { + "optional": true + } + } + }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -1682,6 +1708,12 @@ "dev": true, "license": "MIT" }, + "node_modules/bare-events": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.7.0.tgz", + "integrity": "sha512-b3N5eTW1g7vXkw+0CXh/HazGTcO5KYuu/RCNaJbDMPI6LHDi+7qe8EmxKUVe1sUbY2KZOVZFyj62x0OEz9qyAA==", + "license": "Apache-2.0" + }, "node_modules/base64-js": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", @@ -2413,6 +2445,15 @@ "node": ">=0.10.0" } }, + "node_modules/events-universal": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/events-universal/-/events-universal-1.0.1.tgz", + "integrity": "sha512-LUd5euvbMLpwOF8m6ivPCbhQeSiYVNb8Vs0fQ8QjXo0JTkEHpz8pxdQf0gStltaPpw0Cca8b39KxvK9cfKRiAw==", + "license": "Apache-2.0", + "dependencies": { + "bare-events": "^2.7.0" + } + }, "node_modules/expect-type": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.2.2.tgz", @@ -2423,6 +2464,12 @@ "node": ">=12.0.0" } }, + "node_modules/fast-fifo": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.3.2.tgz", + "integrity": "sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ==", + "license": "MIT" + }, "node_modules/fast-safe-stringify": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz", @@ -3925,6 +3972,17 @@ "dev": true, "license": "MIT" }, + "node_modules/streamx": { + "version": "2.23.0", + "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.23.0.tgz", + "integrity": "sha512-kn+e44esVfn2Fa/O0CPFcex27fjIL6MkVae0Mm6q+E6f0hWv578YCERbv+4m02cjxvDsPKLnmxral/rR6lBMAg==", + "license": "MIT", + "dependencies": { + "events-universal": "^1.0.0", + "fast-fifo": "^1.3.2", + "text-decoder": "^1.1.0" + } + }, "node_modules/string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", @@ -4146,6 +4204,26 @@ "node": ">=8" } }, + "node_modules/tar-stream": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-3.1.7.tgz", + "integrity": "sha512-qJj60CXt7IU1Ffyc3NJMjh6EkuCFej46zUqJ4J7pqYlThyd9bO0XBTmcOIhSzZJVWfsLks0+nle/j538YAW9RQ==", + "license": "MIT", + "dependencies": { + "b4a": "^1.6.4", + "fast-fifo": "^1.2.0", + "streamx": "^2.15.0" + } + }, + "node_modules/text-decoder": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/text-decoder/-/text-decoder-1.2.3.tgz", + "integrity": "sha512-3/o9z3X0X0fTupwsYvR03pJ/DjWuqqrfwBgTQzdWDiQSm9KitAyz/9WqsT2JQW7KV2m+bC2ol/zqpW37NHxLaA==", + "license": "Apache-2.0", + "dependencies": { + "b4a": "^1.6.4" + } + }, "node_modules/thenify": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", diff --git a/package.json b/package.json index 2fbb864..6516263 100644 --- a/package.json +++ b/package.json @@ -51,12 +51,14 @@ "format.check": "prettier --check ." }, "dependencies": { - "ssh2": "^1.16.0" + "ssh2": "^1.16.0", + "tar-stream": "^3.1.4" }, "devDependencies": { "@openapitools/openapi-generator-cli": "^2.23.4", "@types/node": "^24.5.2", "@types/ssh2": "^1.15.5", + "@types/tar-stream": "^3.1.4", "oxlint": "^1.16.0", "oxlint-tsgolint": "^0.2.0", "prettier": "^3.6.2", diff --git a/templates/model/model.mustache b/templates/model/model.mustache index ac1dd68..6c3169c 100644 --- a/templates/model/model.mustache +++ b/templates/model/model.mustache @@ -26,7 +26,7 @@ export interface {{classname}} { * {{.}} */ {{/description}} - {{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#isNullable}} | null{{/isNullable}}; + '{{baseName}}'{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#isNullable}} | null{{/isNullable}}; {{/vars}} } {{#hasEnums}} diff --git a/test/build.test.ts b/test/build.test.ts new file mode 100644 index 0000000..1945d3e --- /dev/null +++ b/test/build.test.ts @@ -0,0 +1,69 @@ +import { expect, test } from 'vitest'; +import { DockerClient } from '../lib/docker-client.js'; +import * as tar from 'tar-stream'; +import { fail } from 'node:assert'; + +test('imageBuild: build image from Dockerfile with tar-stream context', async () => { + const client = await DockerClient.fromDockerConfig(); + const testImageName = 'test-build-image'; + const testTag = 'latest'; + + try { + const pack = tar.pack(); + pack.entry( + { name: 'Dockerfile' }, + `FROM scratch +COPY test.txt /test.txt +`, + ); + pack.entry({ name: 'test.txt' }, 'Hello from Docker build test!'); + pack.finalize(); + + const buildEvents: any[] = []; + let eventCount = 0; + const builtImage = await client + .imageBuild( + pack, + (event) => { + eventCount++; + buildEvents.push(event); + console.log( + ` Build event ${eventCount}:`, + JSON.stringify(event), + ); + }, + { + tag: `${testImageName}:${testTag}`, + rm: true, + forcerm: true, + }, + ) + .catch((error: any) => { + fail(error); + }); + + expect(buildEvents.length).toBeGreaterThan(0); + expect(builtImage).toBeDefined(); + + // Inspect the built builtImage to confirm it was created successfully + console.log(` Inspecting built image ${builtImage}`); + const imageInspect = await client.imageInspect(builtImage); + console.log(' Image found! Build was successful.'); + + expect(imageInspect.RepoTags).toContain(`${testImageName}:${testTag}`); + console.log(` Image size: ${imageInspect.Size} bytes`); + } finally { + // Clean up: delete the test image + console.log(' Cleaning up test image...'); + try { + await client.imageDelete(`${testImageName}:${testTag}`, { + force: true, + }); + console.log(' Test image deleted successfully'); + } catch (cleanupError) { + console.log( + ` Warning: Failed to delete test image: ${(cleanupError as any)?.message}`, + ); + } + } +}, 60000); // 60 second timeout