@cloudflare/containers-shared 0.17.0 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/index.d.mts +135 -20
- package/dist/index.mjs +4366 -60
- package/dist/metafile-esm.json +1 -1
- package/package.json +7 -5
package/README.md
CHANGED
|
@@ -16,3 +16,5 @@ Workers SDK packages.
|
|
|
16
16
|
|
|
17
17
|
- Cloudchamber/Containers API client
|
|
18
18
|
- Utils for constructing and running docker commands
|
|
19
|
+
- SSH transport shared by Wrangler and cf (OpenSSH and stdio proxy modes)
|
|
20
|
+
- Managed registry image list/delete operations shared by Wrangler and cf
|
package/dist/index.d.mts
CHANGED
|
@@ -1665,12 +1665,12 @@ declare namespace CreateApplicationRolloutRequest {
|
|
|
1665
1665
|
*
|
|
1666
1666
|
*/
|
|
1667
1667
|
enum step_percentage {
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1668
|
+
_5 = 5,
|
|
1669
|
+
_10 = 10,
|
|
1670
|
+
_20 = 20,
|
|
1671
|
+
_25 = 25,
|
|
1672
|
+
_50 = 50,
|
|
1673
|
+
_100 = 100
|
|
1674
1674
|
}
|
|
1675
1675
|
/**
|
|
1676
1676
|
* Kind of the rollout process.
|
|
@@ -3513,7 +3513,7 @@ declare function dockerBuild(dockerPath: string, options: {
|
|
|
3513
3513
|
* @param options - The validated Container configs and Docker build environment.
|
|
3514
3514
|
*/
|
|
3515
3515
|
declare function buildAndWriteContainerOutput(options: {
|
|
3516
|
-
containers:
|
|
3516
|
+
containers: ParsedInputContainerConfig[];
|
|
3517
3517
|
root: string;
|
|
3518
3518
|
pathToDocker: string;
|
|
3519
3519
|
}): Promise<void>;
|
|
@@ -3730,15 +3730,6 @@ declare const cleanupContainers: (dockerPath: string, imageTags: Set<string>) =>
|
|
|
3730
3730
|
*/
|
|
3731
3731
|
declare function getContainerIdsByImageTags(dockerPath: string, imageTags: Set<string>): string[];
|
|
3732
3732
|
declare const getContainerIdsFromImage: (dockerPath: string, ancestorImage: string) => string[];
|
|
3733
|
-
/**
|
|
3734
|
-
* While all ports are exposed in prod, a limitation of local dev with docker is that
|
|
3735
|
-
* users will have to manually expose ports in their Dockerfile.
|
|
3736
|
-
* We want to fail early and clearly if a user tries to develop with a container
|
|
3737
|
-
* that has no ports exposed and is definitely not accessible.
|
|
3738
|
-
*
|
|
3739
|
-
* (A user could still use `getTCPPort()` on a port that is not exposed, but we leave that error for runtime.)
|
|
3740
|
-
*/
|
|
3741
|
-
declare function checkExposedPorts(dockerPath: string, options: ContainerDevOptions): Promise<void>;
|
|
3742
3733
|
/**
|
|
3743
3734
|
* Generates a random container build id
|
|
3744
3735
|
*/
|
|
@@ -3804,9 +3795,8 @@ declare function pullImage(dockerPath: string, options: Exclude<ContainerDevOpti
|
|
|
3804
3795
|
* will be called before starting the local development server, and by a rebuild
|
|
3805
3796
|
* hotkey during development.
|
|
3806
3797
|
*
|
|
3807
|
-
* Because this runs when local dev starts,
|
|
3808
|
-
*
|
|
3809
|
-
* expose any ports.
|
|
3798
|
+
* Because this runs when local dev starts, it also checks that the Docker CLI
|
|
3799
|
+
* is installed.
|
|
3810
3800
|
*
|
|
3811
3801
|
* @param args - Image preparation callbacks, Docker settings, and compliance configuration.
|
|
3812
3802
|
* @returns Whether image preparation was aborted before completion.
|
|
@@ -3896,4 +3886,129 @@ type CreateContainerDevPlanOptions = {
|
|
|
3896
3886
|
*/
|
|
3897
3887
|
declare function createContainerDevPlan(options: CreateContainerDevPlanOptions): ContainerDevPlan | undefined;
|
|
3898
3888
|
|
|
3899
|
-
|
|
3889
|
+
interface ContainerSshArgs {
|
|
3890
|
+
id: string;
|
|
3891
|
+
command?: string[];
|
|
3892
|
+
stdio?: boolean;
|
|
3893
|
+
cipher?: string;
|
|
3894
|
+
logFile?: string;
|
|
3895
|
+
escapeChar?: string;
|
|
3896
|
+
configFile?: string;
|
|
3897
|
+
pkcs11?: string;
|
|
3898
|
+
identityFile?: string;
|
|
3899
|
+
macSpec?: string;
|
|
3900
|
+
option?: string | string[];
|
|
3901
|
+
tag?: string;
|
|
3902
|
+
}
|
|
3903
|
+
declare const containersSshOptions: {
|
|
3904
|
+
readonly cipher: {
|
|
3905
|
+
readonly describe: "Sets `ssh -c`: Select the cipher specification for encrypting the session";
|
|
3906
|
+
readonly type: "string";
|
|
3907
|
+
readonly hidden: true;
|
|
3908
|
+
readonly deprecated: true;
|
|
3909
|
+
};
|
|
3910
|
+
readonly "log-file": {
|
|
3911
|
+
readonly describe: "Sets `ssh -E`: Append debug logs to log_file instead of standard error";
|
|
3912
|
+
readonly type: "string";
|
|
3913
|
+
readonly hidden: true;
|
|
3914
|
+
readonly deprecated: true;
|
|
3915
|
+
};
|
|
3916
|
+
readonly "escape-char": {
|
|
3917
|
+
readonly describe: "Sets `ssh -e`: Set the escape character for sessions with a pty (default: '~')";
|
|
3918
|
+
readonly type: "string";
|
|
3919
|
+
readonly hidden: true;
|
|
3920
|
+
readonly deprecated: true;
|
|
3921
|
+
};
|
|
3922
|
+
readonly "config-file": {
|
|
3923
|
+
readonly alias: "F";
|
|
3924
|
+
readonly describe: "Sets `ssh -F`: Specify an alternative per-user ssh configuration file";
|
|
3925
|
+
readonly type: "string";
|
|
3926
|
+
readonly hidden: true;
|
|
3927
|
+
readonly deprecated: true;
|
|
3928
|
+
};
|
|
3929
|
+
readonly pkcs11: {
|
|
3930
|
+
readonly describe: "Sets `ssh -I`: Specify the PKCS#11 shared library ssh should use to communicate with a PKCS#11 token providing keys for user authentication";
|
|
3931
|
+
readonly type: "string";
|
|
3932
|
+
readonly hidden: true;
|
|
3933
|
+
readonly deprecated: true;
|
|
3934
|
+
};
|
|
3935
|
+
readonly "identity-file": {
|
|
3936
|
+
readonly alias: "i";
|
|
3937
|
+
readonly describe: "Sets `ssh -i`: Select a file from which the identity (private key) for public key authentication is read";
|
|
3938
|
+
readonly type: "string";
|
|
3939
|
+
readonly hidden: true;
|
|
3940
|
+
readonly deprecated: true;
|
|
3941
|
+
};
|
|
3942
|
+
readonly "mac-spec": {
|
|
3943
|
+
readonly describe: "Sets `ssh -m`: A comma-separated list of MAC (message authentication code) algorithms, specified in order of preference";
|
|
3944
|
+
readonly type: "string";
|
|
3945
|
+
readonly hidden: true;
|
|
3946
|
+
readonly deprecated: true;
|
|
3947
|
+
};
|
|
3948
|
+
readonly option: {
|
|
3949
|
+
readonly alias: "o";
|
|
3950
|
+
readonly describe: "Sets `ssh -o`: Set options in the format used in the ssh configuration file. May be repeated";
|
|
3951
|
+
readonly type: "string";
|
|
3952
|
+
readonly hidden: true;
|
|
3953
|
+
readonly deprecated: true;
|
|
3954
|
+
};
|
|
3955
|
+
readonly tag: {
|
|
3956
|
+
readonly describe: "Sets `ssh -P`: Specify a tag name that may be used to select configuration in ssh_config";
|
|
3957
|
+
readonly type: "string";
|
|
3958
|
+
readonly hidden: true;
|
|
3959
|
+
readonly deprecated: true;
|
|
3960
|
+
};
|
|
3961
|
+
readonly stdio: {
|
|
3962
|
+
readonly describe: "Proxy SSH traffic over stdin/stdout";
|
|
3963
|
+
readonly type: "boolean";
|
|
3964
|
+
};
|
|
3965
|
+
};
|
|
3966
|
+
/**
|
|
3967
|
+
* Connect to a Container over SSH. Before calling, configure the OpenAPI client
|
|
3968
|
+
* with the account API base URL and authentication, and call
|
|
3969
|
+
* initContainersSharedContext to supply the CLI's logger.
|
|
3970
|
+
*/
|
|
3971
|
+
declare function sshCommand(sshArgs: ContainerSshArgs): Promise<void>;
|
|
3972
|
+
declare function verifySshInstalled(sshPath: string): Promise<undefined>;
|
|
3973
|
+
declare function shouldUseStdio(sshArgs: {
|
|
3974
|
+
stdio?: boolean;
|
|
3975
|
+
}): boolean;
|
|
3976
|
+
|
|
3977
|
+
interface DeleteContainerImageResult {
|
|
3978
|
+
digest: string;
|
|
3979
|
+
/** Present when deletion succeeded but the garbage-collection request failed. */
|
|
3980
|
+
warning?: string;
|
|
3981
|
+
}
|
|
3982
|
+
interface ContainerImageRepository {
|
|
3983
|
+
name: string;
|
|
3984
|
+
tags: string[];
|
|
3985
|
+
}
|
|
3986
|
+
interface RegistryOptions {
|
|
3987
|
+
accountId: string;
|
|
3988
|
+
complianceConfig?: ComplianceConfig;
|
|
3989
|
+
}
|
|
3990
|
+
/**
|
|
3991
|
+
* List visible image tags in the managed registry. Configure the shared OpenAPI
|
|
3992
|
+
* client with account credentials and API base URL before calling.
|
|
3993
|
+
*/
|
|
3994
|
+
declare function listContainerImages({ accountId, complianceConfig, filter, }: RegistryOptions & {
|
|
3995
|
+
filter?: string;
|
|
3996
|
+
}): Promise<ContainerImageRepository[]>;
|
|
3997
|
+
/** Validate an account-relative IMAGE:TAG before prompting or issuing requests. */
|
|
3998
|
+
declare function parseContainerImageTag(image: string): {
|
|
3999
|
+
repository: string;
|
|
4000
|
+
tag: string;
|
|
4001
|
+
};
|
|
4002
|
+
/**
|
|
4003
|
+
* Delete a managed registry image tag and request layer garbage collection.
|
|
4004
|
+
* The caller must obtain confirmation and configure the shared OpenAPI client
|
|
4005
|
+
* with account credentials and API base URL before calling.
|
|
4006
|
+
* @returns The deleted digest and an optional warning if requesting GC failed.
|
|
4007
|
+
*/
|
|
4008
|
+
declare function deleteContainerImage({ accountId, complianceConfig, image, }: RegistryOptions & {
|
|
4009
|
+
image: string;
|
|
4010
|
+
}): Promise<DeleteContainerImageResult>;
|
|
4011
|
+
/** Returns whether a value matches the OCI image tag grammar. */
|
|
4012
|
+
declare function isValidImageTag(value: string): boolean;
|
|
4013
|
+
|
|
4014
|
+
export { type AccountDefaults, type AccountID, type AccountLimit, type AccountLocation, type AccountLocationLimits, type AccountLocationLimitsAsProperty, type AccountRegistryToken, AccountService, type AddressAssignment, ApiError, type Application, type ApplicationAffinities, ApplicationAffinityColocation, ApplicationAffinityHardwareGeneration, type ApplicationConstraintPop, type ApplicationConstraints, type ApplicationHealth, type ApplicationHealthInstances, type ApplicationID, type ApplicationJob, type ApplicationJobsConfig, ApplicationMutationError, type ApplicationName, type ApplicationNotFoundError, type ApplicationObservability, type ApplicationPriorities, type ApplicationPriority, ApplicationRollout, type ApplicationRolloutActiveGracePeriod, type ApplicationRolloutProgress, type ApplicationSchedulingHint, type ApplicationStatus, ApplicationsService, AssignIPv4, AssignIPv6, type BadRequestError, BadRequestWithCodeError, type BuildArgs, type BuiltContainerImage, type BuiltImage, CancelError, CancelablePromise, type City, type Command, type CompleteAccountCustomer, type CompleteAccountLocationCustomer, type ContainerBuildCommandArgs, type ContainerDevOptions, type ContainerDevPlan, type ContainerDevRuntimeOptions, type ContainerImagePreparation, ContainerImagePreparationStatus, ContainerImagePreparationsService, type ContainerImageRepository, ContainerNetworkMode, type ContainerNormalizedConfig, type ContainerPushCommandArgs, type ContainerSshArgs, type ContainersSharedContext, type CreateApplicationBadRequest, type CreateApplicationJobBadRequest, type CreateApplicationJobRequest, type CreateApplicationRequest, CreateApplicationRolloutRequest, type CreateDeploymentBadRequest, type CreateDeploymentV2RequestBody, type CreateDurableObjectApplicationRequest, type CreateImageRegistryRequestBody, type CreateSSHPublicKeyError, type CreateSSHPublicKeyRequestBody, type CustomerImageRegistry, DEFAULT_CONTAINER_EGRESS_INTERCEPTOR_IMAGE, type DNSConfiguration, type DashApplication, type DashApplicationDurableObjectInstance, type DashApplicationInstance, type DashApplicationInstances, type DeleteContainerImageResult, type DeleteDeploymentError, type DeleteImageRegistryResponse, type DeploymentAlreadyExists, type DeploymentCheck, type DeploymentCheckHTTP, type DeploymentCheckHTTPRequestBody, DeploymentCheckKind, type DeploymentCheckRequestBody, DeploymentCheckType, type DeploymentCreationError, type DeploymentID, type DeploymentListError, type DeploymentLocation, type DeploymentModificationError, DeploymentMutationError, DeploymentNotFoundError, DeploymentPlacementState, type DeploymentQueuedDetails, DeploymentQueuedReason, type DeploymentReplacementError, DeploymentSchedulingState, type DeploymentSecretMap, type DeploymentState, DeploymentType, type DeploymentV2, type DeploymentVersion, DeploymentsService, Diff, type Disk, type DiskMB, type DiskSizeWithUnit, type DockerfileConfig, type DockerfileContainerConfig, type Domain, type DurableObjectNamespace, DurableObjectStatusHealth, type DurableObjectsConfiguration, type Duration, type EmptyResponse, type Entrypoint, type EnvironmentVariable, type EnvironmentVariableName, type EnvironmentVariableValue, EventName, EventType, type ExecFormParam, ExternalRegistryKind, FUSE_CONTAINER_PRIVILEGES, type GenericErrorDetails, type GenericErrorResponseWithRequestID, type GenericMessageResponse, type GetDeploymentError, type GetPlacementError, HTTPMethod, type IP, type IPAllocation, type IPAllocationConfiguration, type IPAllocationsWithFilter, IPType, type IPV4, IPsService, type ISO8601Timestamp, type Identity, type Image, type ImageRef, ImageRegistriesService, ImageRegistryAlreadyExistsError, type ImageRegistryAuth, type ImageRegistryCredentialsConfiguration, ImageRegistryIsPublic, ImageRegistryNotAllowedError, ImageRegistryNotFoundError, ImageRegistryPermissions, type ImageRegistryProtoDomain, type ImageRegistryProtocol, ImageRegistryProtocolAlreadyExists, ImageRegistryProtocolIsReferencedError, ImageRegistryProtocolNotFound, type ImageRegistryProtocols, type ImageURIConfig, InstanceType, type InstanceTypeOrLimits, type InternalError, type JobEvents, type JobID, type JobNotFoundError, type JobSecretMap, type JobStatus, JobStatusHealth, type JobTimeoutSeconds, JobsService, type Label, type LabelName, type LabelValue, type ListApplications, type ListDeploymentsV2, type ListIPsIsAllocated, type ListPlacements, type ListPlacementsError, type ListSSHPublicKeys, type ListSSHPublicKeysError, type ListSecretsMetadata, type Location, type LocationID, MF_DEV_CONTAINER_PREFIX, type MemorySizeWithUnit, type ModifyApplicationBadRequest, type ModifyApplicationJobBadRequest, type ModifyApplicationJobRequest, type ModifyApplicationRequestBody, type ModifyDeploymentBadRequest, type ModifyDeploymentV2RequestBody, type ModifyMeRequestBody, type ModifySecretRequestBody, type ModifyUserDeploymentConfiguration, type Network, NetworkMode, type NetworkParameters, NodeGroup, type Observability, type ObservabilityLogs, OpenAPI, type OpenAPIConfig, type PaginatedResult, type Placement, type PlacementEvent, type PlacementEvents, type PlacementID, type PlacementNotFoundError, type PlacementStatus, PlacementStatusHealth, type PlacementWithEvents, PlacementsService, type PlainTextSecretValue, type Port, type PortRange, type PortRangeAllocation, type PrepareContainerImageRequestBody, ProvisionerConfiguration, type Ref, type Region, type ReplaceDeploymentRequestBody, type ResolvedContainerDeployment, type ResultInfo, type RolloutID, RolloutStep, type RolloutStepRequest, RolloutsService, type SSHPublicKey, type SSHPublicKeyID, type SSHPublicKeyItem, SSHPublicKeyNotFoundError, type SchedulerDeploymentConfiguration, SchedulingPolicy, type Secret, SecretAccessType, type SecretMap, type SecretMetadata, type SecretName, SecretNameAlreadyExists, SecretNotFound, SecretsService, type SecretsStoreRef, type SharedContainerConfig, SshPublicKeysService, type UnAuthorizedError, type UnixTimestamp, type UnknownAccount, UpdateApplicationRolloutRequest, type UpdateRolloutResponse, type UserDeploymentConfiguration, type UserSSHPublicKey, type VerifyDockerInstalledOptions, type ViteLogger, type WranglerLogger, type WranglerSSHConfig, type WranglerSSHResponse, apply, buildAndMaybePush, buildAndWriteContainerOutput, buildCommand, buildContainerImages, cleanApplicationFromAPI, cleanForInstanceType, cleanupBuiltImages, cleanupContainers, configRolloutStepsToAPI, configureOpenAPIForContainerPull, containerPrivilegesAllowed, containersSshOptions, createContainerDevPlan, createDurableObjectNamespaceResolver, deleteContainerImage, deployContainers, dockerBuild, dockerImageInspect, dockerLoginImageRegistry, ensureContainerLimits, ensureImageFitsLimits, fetchPagedListResult, fetchResult, formatError, generateContainerBuildId, getAndValidateRegistryType, getCloudflareContainerRegistry, getCloudflareRegistryWithAccountNamespace, getContainerAccount, getContainerIdsByImageTags, getContainerIdsFromImage, getContainerImageTag, getDevContainerImageName, getDockerHostFromEnv, getDockerSocketFromContext, getEgressInterceptorImage, getEgressInterceptorPlatform, getInstanceTypeUsage, inferInstanceType, initContainersSharedContext, isCloudflareRegistryImage, isDockerRunning, isDockerfileContainerConfig, isValidImageTag, listContainerImages, listDurableObjects, logger, normalizeContainerImageRepositoryName, parseContainerImageTag, prepareContainerImagesForDev, promiseSpinner, pullEgressInterceptorImage, pullImage, pushBuiltContainerImage, pushCommand, pushImageIfChanged, request, requestPaginated, resolveDockerHost, resolveImageName, runDockerCmd, runDockerCmdWithOutput, shouldUseStdio, sortObjectRecursive, sshCommand, startContainerBuild, stripUndefined, validateAndEncodeGarKey, verifyDockerInstalled, verifySshInstalled };
|