@cloudflare/workers-utils 0.4.0 → 0.5.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.
@@ -1,5 +1,4 @@
1
1
  import { RouterConfig, AssetConfig } from '@cloudflare/workers-shared';
2
- import { Cloudflare } from 'cloudflare';
3
2
 
4
3
  /**
5
4
  * A symbol to inherit a binding from the deployed worker.
@@ -834,6 +833,25 @@ type ContainerApp = {
834
833
  /** @defaults to 2 GB */
835
834
  disk_mb?: number;
836
835
  };
836
+ wrangler_ssh?: {
837
+ /**
838
+ * If enabled, those with write access to a container will be able to SSH into it through Wrangler.
839
+ * @default false
840
+ */
841
+ enabled: boolean;
842
+ /**
843
+ * Port that the SSH service is running on
844
+ * @defaults to 22
845
+ */
846
+ port?: number;
847
+ };
848
+ /**
849
+ * SSH public keys to put in the container's authorized_keys file.
850
+ */
851
+ authorized_keys?: {
852
+ name: string;
853
+ public_key: string;
854
+ }[];
837
855
  /**
838
856
  * @deprecated Use top level `containers` fields instead.
839
857
  * `configuration.image` should be `image`
@@ -2192,40 +2210,4 @@ interface EnvironmentMap {
2192
2210
  }
2193
2211
  declare const defaultWranglerConfig: Config;
2194
2212
 
2195
- type RoutesRes = {
2196
- id: string;
2197
- pattern: string;
2198
- zone_name: string;
2199
- script: string;
2200
- }[];
2201
- interface APIWorkerConfig {
2202
- name: string;
2203
- entrypoint: string;
2204
- tags: string[] | null;
2205
- compatibility_date: string;
2206
- compatibility_flags: string[];
2207
- logpush: boolean | undefined;
2208
- routes: RoutesRes;
2209
- tail_consumers: TailConsumer[] | undefined | null;
2210
- migration_tag?: string;
2211
- domains: Cloudflare.Workers.Domain[];
2212
- schedules: Cloudflare.Workers.Scripts.Schedules.ScheduleGetResponse.Schedule[];
2213
- assets?: AssetConfig;
2214
- bindings: WorkerMetadata["bindings"];
2215
- observability: Cloudflare.Workers.Beta.Worker.Observability | undefined;
2216
- limits: {
2217
- cpu_ms: number;
2218
- } | undefined;
2219
- placement: Cloudflare.Workers.Beta.Workers.Version.Placement | undefined;
2220
- subdomain: {
2221
- enabled: boolean;
2222
- previews_enabled: boolean;
2223
- };
2224
- }
2225
- /**
2226
- * Given the information of multiple Workers (representing different environments),
2227
- * construct a Wrangler config file for the application.
2228
- */
2229
- declare function constructWranglerConfig(workerOrWorkers: APIWorkerConfig | APIWorkerConfig[]): RawConfig;
2230
-
2231
- export { type CfWorkerLoader as $, type Assets as A, type CfWasmModuleBindings as B, type CfWorkerInit as C, type DurableObjectMigration as D, type Environment as E, type CfTextBlobBindings as F, type CfBrowserBinding as G, type CfAIBinding as H, type CfImagesBinding as I, type CfMediaBinding as J, type CfVersionMetadataBinding as K, type CfDataBlobBindings as L, type CfDurableObject as M, type CfWorkflow as N, type Observability as O, type CfQueue as P, type CfR2Bucket as Q, type RawConfig as R, type StreamingTailConsumer as S, type TailConsumer as T, type UserLimits as U, type CfD1Database as V, type WorkerMetadataBinding as W, type CfVectorize as X, type CfSecretsStoreSecrets as Y, type ZoneIdRoute as Z, type CfHelloWorld as _, type Config as a, type CfRateLimit as a0, type CfHyperdrive as a1, type CfService as a2, type CfVpcService as a3, type CfAnalyticsEngineDataset as a4, type CfDispatchNamespace as a5, type CfMTlsCertificate as a6, type CfLogfwdr as a7, type CfLogfwdrBinding as a8, type CfAssetsBinding as a9, type CfPipeline as aa, type CfUnsafeBinding as ab, type CfCapnp as ac, type CfUnsafe as ad, type CfDurableObjectMigrations as ae, type CfPlacement as af, type CfTailConsumer as ag, type CfUserLimits as ah, type CfWorkerContext as ai, type CfWorkerSourceMap as aj, type Json as ak, type AssetConfigMetadata as al, type WorkerMetadata as am, type ServiceMetadataRes as an, INHERIT_SYMBOL as ao, SERVICE_TAG_PREFIX as ap, ENVIRONMENT_TAG_PREFIX as aq, PATH_TO_DEPLOY_CONFIG as ar, type RawDevConfig as b, type ConfigFields as c, type RawEnvironment as d, type RedirectedRawConfig as e, defaultWranglerConfig as f, constructWranglerConfig as g, type ZoneNameRoute as h, type CustomDomainRoute as i, type Route as j, type CloudchamberConfig as k, type ContainerApp as l, type DurableObjectBindings as m, type WorkflowBinding as n, type EnvironmentNonInheritable as o, type Rule as p, type ConfigModuleRuleType as q, type DispatchNamespaceOutbound as r, type DockerConfiguration as s, type ContainerEngine as t, type CfScriptFormat as u, type CfModuleType as v, type CfModule as w, type CfVars as x, type CfKvNamespace as y, type CfSendEmailBindings as z };
2213
+ export { type CfRateLimit as $, type Assets as A, type CfTextBlobBindings as B, type CfWorkerInit as C, type DurableObjectMigration as D, type Environment as E, type CfBrowserBinding as F, type CfAIBinding as G, type CfImagesBinding as H, type CfMediaBinding as I, type CfVersionMetadataBinding as J, type CfDataBlobBindings as K, type CfDurableObject as L, type CfWorkflow as M, type CfQueue as N, type Observability as O, type CfR2Bucket as P, type CfD1Database as Q, type RawConfig as R, type StreamingTailConsumer as S, type TailConsumer as T, type UserLimits as U, type CfVectorize as V, type WorkerMetadataBinding as W, type CfSecretsStoreSecrets as X, type CfHelloWorld as Y, type ZoneIdRoute as Z, type CfWorkerLoader as _, type RedirectedRawConfig as a, type CfHyperdrive as a0, type CfService as a1, type CfVpcService as a2, type CfAnalyticsEngineDataset as a3, type CfDispatchNamespace as a4, type CfMTlsCertificate as a5, type CfLogfwdr as a6, type CfLogfwdrBinding as a7, type CfAssetsBinding as a8, type CfPipeline as a9, type CfUnsafeBinding as aa, type CfCapnp as ab, type CfUnsafe as ac, type CfDurableObjectMigrations as ad, type CfPlacement as ae, type CfTailConsumer as af, type CfUserLimits as ag, type CfWorkerContext as ah, type CfWorkerSourceMap as ai, type Json as aj, type AssetConfigMetadata as ak, type WorkerMetadata as al, type ServiceMetadataRes as am, INHERIT_SYMBOL as an, SERVICE_TAG_PREFIX as ao, ENVIRONMENT_TAG_PREFIX as ap, PATH_TO_DEPLOY_CONFIG as aq, type Config as b, type RawDevConfig as c, type ConfigFields as d, type RawEnvironment as e, defaultWranglerConfig as f, type ZoneNameRoute as g, type CustomDomainRoute as h, type Route as i, type CloudchamberConfig as j, type ContainerApp as k, type DurableObjectBindings as l, type WorkflowBinding as m, type EnvironmentNonInheritable as n, type Rule as o, type ConfigModuleRuleType as p, type DispatchNamespaceOutbound as q, type DockerConfiguration as r, type ContainerEngine as s, type CfScriptFormat as t, type CfModuleType as u, type CfModule as v, type CfVars as w, type CfKvNamespace as x, type CfSendEmailBindings as y, type CfWasmModuleBindings as z };
package/dist/index.d.mts CHANGED
@@ -1,6 +1,7 @@
1
- import { C as CfWorkerInit, R as RawConfig, a as Config, W as WorkerMetadataBinding } from './browser-BVVJ_rUA.mjs';
2
- export { al as AssetConfigMetadata, A as Assets, H as CfAIBinding, a4 as CfAnalyticsEngineDataset, a9 as CfAssetsBinding, G as CfBrowserBinding, ac as CfCapnp, V as CfD1Database, L as CfDataBlobBindings, a5 as CfDispatchNamespace, M as CfDurableObject, ae as CfDurableObjectMigrations, _ as CfHelloWorld, a1 as CfHyperdrive, I as CfImagesBinding, y as CfKvNamespace, a7 as CfLogfwdr, a8 as CfLogfwdrBinding, a6 as CfMTlsCertificate, J as CfMediaBinding, w as CfModule, v as CfModuleType, aa as CfPipeline, af as CfPlacement, P as CfQueue, Q as CfR2Bucket, a0 as CfRateLimit, u as CfScriptFormat, Y as CfSecretsStoreSecrets, z as CfSendEmailBindings, a2 as CfService, ag as CfTailConsumer, F as CfTextBlobBindings, ad as CfUnsafe, ab as CfUnsafeBinding, ah as CfUserLimits, x as CfVars, X as CfVectorize, K as CfVersionMetadataBinding, a3 as CfVpcService, B as CfWasmModuleBindings, ai as CfWorkerContext, $ as CfWorkerLoader, aj as CfWorkerSourceMap, N as CfWorkflow, k as CloudchamberConfig, c as ConfigFields, q as ConfigModuleRuleType, l as ContainerApp, t as ContainerEngine, i as CustomDomainRoute, r as DispatchNamespaceOutbound, s as DockerConfiguration, m as DurableObjectBindings, D as DurableObjectMigration, aq as ENVIRONMENT_TAG_PREFIX, E as Environment, o as EnvironmentNonInheritable, ao as INHERIT_SYMBOL, ak as Json, O as Observability, ar as PATH_TO_DEPLOY_CONFIG, b as RawDevConfig, d as RawEnvironment, e as RedirectedRawConfig, j as Route, p as Rule, ap as SERVICE_TAG_PREFIX, an as ServiceMetadataRes, S as StreamingTailConsumer, T as TailConsumer, U as UserLimits, am as WorkerMetadata, n as WorkflowBinding, Z as ZoneIdRoute, h as ZoneNameRoute, g as constructWranglerConfig, f as defaultWranglerConfig } from './browser-BVVJ_rUA.mjs';
1
+ import { C as CfWorkerInit, R as RawConfig, b as Config, W as WorkerMetadataBinding } from './config-cFPB-c8J.mjs';
2
+ export { ak as AssetConfigMetadata, A as Assets, G as CfAIBinding, a3 as CfAnalyticsEngineDataset, a8 as CfAssetsBinding, F as CfBrowserBinding, ab as CfCapnp, Q as CfD1Database, K as CfDataBlobBindings, a4 as CfDispatchNamespace, L as CfDurableObject, ad as CfDurableObjectMigrations, Y as CfHelloWorld, a0 as CfHyperdrive, H as CfImagesBinding, x as CfKvNamespace, a6 as CfLogfwdr, a7 as CfLogfwdrBinding, a5 as CfMTlsCertificate, I as CfMediaBinding, v as CfModule, u as CfModuleType, a9 as CfPipeline, ae as CfPlacement, N as CfQueue, P as CfR2Bucket, $ as CfRateLimit, t as CfScriptFormat, X as CfSecretsStoreSecrets, y as CfSendEmailBindings, a1 as CfService, af as CfTailConsumer, B as CfTextBlobBindings, ac as CfUnsafe, aa as CfUnsafeBinding, ag as CfUserLimits, w as CfVars, V as CfVectorize, J as CfVersionMetadataBinding, a2 as CfVpcService, z as CfWasmModuleBindings, ah as CfWorkerContext, _ as CfWorkerLoader, ai as CfWorkerSourceMap, M as CfWorkflow, j as CloudchamberConfig, d as ConfigFields, p as ConfigModuleRuleType, k as ContainerApp, s as ContainerEngine, h as CustomDomainRoute, q as DispatchNamespaceOutbound, r as DockerConfiguration, l as DurableObjectBindings, D as DurableObjectMigration, ap as ENVIRONMENT_TAG_PREFIX, E as Environment, n as EnvironmentNonInheritable, an as INHERIT_SYMBOL, aj as Json, O as Observability, aq as PATH_TO_DEPLOY_CONFIG, c as RawDevConfig, e as RawEnvironment, a as RedirectedRawConfig, i as Route, o as Rule, ao as SERVICE_TAG_PREFIX, am as ServiceMetadataRes, S as StreamingTailConsumer, T as TailConsumer, U as UserLimits, al as WorkerMetadata, m as WorkflowBinding, Z as ZoneIdRoute, g as ZoneNameRoute, f as defaultWranglerConfig } from './config-cFPB-c8J.mjs';
3
3
  import * as jsoncParser from 'jsonc-parser';
4
+ export { constructWranglerConfig } from './browser.mjs';
4
5
  import '@cloudflare/workers-shared';
5
6
  import 'cloudflare';
6
7
 
@@ -444,7 +445,9 @@ type VariableNames =
444
445
  /** Docker host configuration (handled separately from environment variable factory). */
445
446
  | "WRANGLER_DOCKER_HOST"
446
447
  /** Docker host configuration (handled separately from environment variable factory). */
447
- | "DOCKER_HOST";
448
+ | "DOCKER_HOST"
449
+ /** Environment variable used to signal that the current process is being run by the open-next deploy command. */
450
+ | "OPEN_NEXT_DEPLOY";
448
451
  type DeprecatedNames = "CF_ACCOUNT_ID" | "CF_API_TOKEN" | "CF_API_KEY" | "CF_EMAIL" | "CF_API_BASE_URL";
449
452
  type ElementType<A> = A extends readonly (infer T)[] ? T : never;
450
453
  /**
@@ -658,7 +661,12 @@ declare const getWranglerHideBanner: () => boolean;
658
661
  * `CLOUDFLARE_ENV` specifies the currently selected Wrangler/Cloudflare environment.
659
662
  */
660
663
  declare const getCloudflareEnv: () => string | undefined;
664
+ /**
665
+ * `OPEN_NEXT_DEPLOY` is an environment variables that indicates that the current process is being
666
+ * run by the open-next deploy command
667
+ */
668
+ declare const getOpenNextDeployFromEnv: () => string | undefined;
661
669
 
662
670
  declare function getGlobalWranglerConfigPath(): string;
663
671
 
664
- export { APIError, COMPLIANCE_REGION_CONFIG_PUBLIC, COMPLIANCE_REGION_CONFIG_UNKNOWN, CfWorkerInit, CommandLineArgsError, type ComplianceConfig, Config, type ConfigBindingOptions, DeprecationError, FatalError, type File, JsonFriendlyFatalError, type Location, type Message, MissingConfigError, type NormalizeAndValidateConfigArgs, type PackageJSON, ParseError, PatchConfigError, RawConfig, type ResolveConfigPathOptions, type TelemetryMessage, UserError, WorkerMetadataBinding, assertNever, bucketFormatMessage, configFileName, configFormat, createFatalError, experimental_patchConfig, experimental_readRawConfig, findWranglerConfig, formatCompatibilityDate, formatConfigSnippet, friendlyBindingNames, getBooleanEnvironmentVariableFactory, getBuildConditionsFromEnv, getBuildPlatformFromEnv, getC3CommandFromEnv, getCIGeneratePreviewAlias, getCIMatchTag, getCIOverrideName, getCIOverrideNetworkModeHost, getCloudflareApiBaseUrl, getCloudflareApiEnvironmentFromEnv, getCloudflareComplianceRegion, getCloudflareEnv, getCloudflareIncludeProcessEnvFromEnv, getCloudflareLoadDevVarsFromDotEnv, getComplianceRegionSubdomain, getD1ExtraLocationChoices, getDisableConfigWatching, getDockerPath, getEnvironmentVariableFactory, getGlobalWranglerConfigPath, getOutputFileDirectoryFromEnv, getOutputFilePathFromEnv, getRegistryPath, getSanitizeLogs, getSubdomainMixedStateCheckDisabled, getTraceHeader, getWorkersCIBranchName, getWranglerHideBanner, getWranglerSendErrorReportsFromEnv, getWranglerSendMetricsFromEnv, hasProperty, indexLocation, isOptionalProperty, isPagesConfig, isRequiredProperty, isValidR2BucketName, mapWorkerMetadataBindings, normalizeAndValidateConfig, parseByteSize, parseHumanDuration, parseJSON, parseJSONC, parseNonHyphenedUuid, parsePackageJSON, parseTOML, readFileSync, readFileSyncToBuffer, resolveWranglerConfigPath, searchLocation, validatePagesConfig };
672
+ export { APIError, COMPLIANCE_REGION_CONFIG_PUBLIC, COMPLIANCE_REGION_CONFIG_UNKNOWN, CfWorkerInit, CommandLineArgsError, type ComplianceConfig, Config, type ConfigBindingOptions, DeprecationError, FatalError, type File, JsonFriendlyFatalError, type Location, type Message, MissingConfigError, type NormalizeAndValidateConfigArgs, type PackageJSON, ParseError, PatchConfigError, RawConfig, type ResolveConfigPathOptions, type TelemetryMessage, UserError, WorkerMetadataBinding, assertNever, bucketFormatMessage, configFileName, configFormat, createFatalError, experimental_patchConfig, experimental_readRawConfig, findWranglerConfig, formatCompatibilityDate, formatConfigSnippet, friendlyBindingNames, getBooleanEnvironmentVariableFactory, getBuildConditionsFromEnv, getBuildPlatformFromEnv, getC3CommandFromEnv, getCIGeneratePreviewAlias, getCIMatchTag, getCIOverrideName, getCIOverrideNetworkModeHost, getCloudflareApiBaseUrl, getCloudflareApiEnvironmentFromEnv, getCloudflareComplianceRegion, getCloudflareEnv, getCloudflareIncludeProcessEnvFromEnv, getCloudflareLoadDevVarsFromDotEnv, getComplianceRegionSubdomain, getD1ExtraLocationChoices, getDisableConfigWatching, getDockerPath, getEnvironmentVariableFactory, getGlobalWranglerConfigPath, getOpenNextDeployFromEnv, getOutputFileDirectoryFromEnv, getOutputFilePathFromEnv, getRegistryPath, getSanitizeLogs, getSubdomainMixedStateCheckDisabled, getTraceHeader, getWorkersCIBranchName, getWranglerHideBanner, getWranglerSendErrorReportsFromEnv, getWranglerSendMetricsFromEnv, hasProperty, indexLocation, isOptionalProperty, isPagesConfig, isRequiredProperty, isValidR2BucketName, mapWorkerMetadataBindings, normalizeAndValidateConfig, parseByteSize, parseHumanDuration, parseJSON, parseJSONC, parseNonHyphenedUuid, parsePackageJSON, parseTOML, readFileSync, readFileSyncToBuffer, resolveWranglerConfigPath, searchLocation, validatePagesConfig };