@cloudflare/deploy-helpers 0.6.9 → 0.7.1
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.
|
@@ -1082,7 +1082,13 @@ function createWorkerUploadForm(worker, bindings, options) {
|
|
|
1082
1082
|
const metadata = {
|
|
1083
1083
|
...main.type !== "commonjs" ? { main_module: main.name } : { body_part: main.name },
|
|
1084
1084
|
bindings: metadataBindings,
|
|
1085
|
-
|
|
1085
|
+
// Both directions of the container/Durable Object link are sent as
|
|
1086
|
+
// configured: the API resolves a container's Durable Object from either this
|
|
1087
|
+
// `class_name` or an `exports` entry naming the container by `name`.
|
|
1088
|
+
containers: worker.containers === void 0 ? void 0 : worker.containers.map((c) => ({
|
|
1089
|
+
...c.name !== void 0 && { name: c.name },
|
|
1090
|
+
...c.class_name !== void 0 && { class_name: c.class_name }
|
|
1091
|
+
})),
|
|
1086
1092
|
...compatibility_date && { compatibility_date },
|
|
1087
1093
|
...compatibility_flags && {
|
|
1088
1094
|
compatibility_flags
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { createWorkerUploadForm, fromMimeType, moduleTypeMimeType } from './chunk-
|
|
1
|
+
export { createWorkerUploadForm, fromMimeType, moduleTypeMimeType } from './chunk-LRKPOFWK.mjs';
|
|
2
2
|
import './chunk-Q72B4Q5Z.mjs';
|
package/dist/index.d.mts
CHANGED
|
@@ -972,7 +972,7 @@ type CreatePreviewRequestParams = {
|
|
|
972
972
|
};
|
|
973
973
|
type UpdatePreviewRequestParams = Omit<CreatePreviewRequestParams, "name">;
|
|
974
974
|
type PreviewRequestOptions = {
|
|
975
|
-
|
|
975
|
+
ignoreBaseConfig?: boolean;
|
|
976
976
|
};
|
|
977
977
|
type PreviewDefaults = {
|
|
978
978
|
observability?: Observability;
|
|
@@ -1004,10 +1004,10 @@ type PreviewBaseConfigPatch = Partial<Omit<PreviewBaseConfig, "env">> & {
|
|
|
1004
1004
|
};
|
|
1005
1005
|
declare function getPreview(config: Config, accountId: string, workerName: string, previewIdentifier: string): Promise<PreviewResource>;
|
|
1006
1006
|
declare function createPreview(config: Config, accountId: string, workerName: string, request: CreatePreviewRequestParams, options?: PreviewRequestOptions): Promise<PreviewResource>;
|
|
1007
|
-
declare function editPreview(config: Config, accountId: string, workerName: string, previewIdentifier: string, request: UpdatePreviewRequestParams
|
|
1007
|
+
declare function editPreview(config: Config, accountId: string, workerName: string, previewIdentifier: string, request: UpdatePreviewRequestParams): Promise<PreviewResource>;
|
|
1008
1008
|
declare function deletePreview(config: Config, accountId: string, workerName: string, previewIdentifier: string): Promise<void>;
|
|
1009
1009
|
declare function getPreviewDeployment(config: Config, accountId: string, workerName: string, previewIdentifier: string, deploymentIdentifier?: string): Promise<DeploymentResource>;
|
|
1010
|
-
declare function createPreviewDeployment(config: Config, accountId: string, workerName: string, previewIdentifier: string, request: Partial<CreatePreviewDeploymentRequestParams
|
|
1010
|
+
declare function createPreviewDeployment(config: Config, accountId: string, workerName: string, previewIdentifier: string, request: Partial<CreatePreviewDeploymentRequestParams>): Promise<DeploymentResource>;
|
|
1011
1011
|
declare function patchPreviewDeployment(config: Config, accountId: string, workerName: string, previewIdentifier: string, env: Record<string, Binding | null>, annotations?: {
|
|
1012
1012
|
"workers/message"?: string;
|
|
1013
1013
|
"workers/tag"?: string;
|
|
@@ -1040,7 +1040,7 @@ type PreviewArgs = {
|
|
|
1040
1040
|
tag?: string;
|
|
1041
1041
|
message?: string;
|
|
1042
1042
|
json?: boolean;
|
|
1043
|
-
|
|
1043
|
+
ignoreBaseConfig: boolean;
|
|
1044
1044
|
workerName?: string;
|
|
1045
1045
|
"worker-name"?: string;
|
|
1046
1046
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { fetchResult, fetchPagedListResult, logger, confirm, fetchListResult, prompt, select } from './chunk-Z4LB73IF.mjs';
|
|
2
2
|
export { initDeployHelpersContext } from './chunk-Z4LB73IF.mjs';
|
|
3
|
-
import { extractBindingsOfType, isUnsafeBindingType, getBindings, createWorkerUploadForm, moduleTypeMimeType } from './chunk-
|
|
4
|
-
export { convertConfigToBindings, createWorkerUploadForm, extractBindingsOfType, fromMimeType, getBindings, handleUnsafeCapnp, isUnsafeBindingType, moduleTypeMimeType } from './chunk-
|
|
3
|
+
import { extractBindingsOfType, isUnsafeBindingType, getBindings, createWorkerUploadForm, moduleTypeMimeType } from './chunk-LRKPOFWK.mjs';
|
|
4
|
+
export { convertConfigToBindings, createWorkerUploadForm, extractBindingsOfType, fromMimeType, getBindings, handleUnsafeCapnp, isUnsafeBindingType, moduleTypeMimeType } from './chunk-LRKPOFWK.mjs';
|
|
5
5
|
import { __commonJS, __name, __require, __toESM, __export } from './chunk-Q72B4Q5Z.mjs';
|
|
6
6
|
import assert3 from 'node:assert';
|
|
7
7
|
import { readFileSync, mkdirSync, writeFileSync, createReadStream } from 'node:fs';
|
|
@@ -10,7 +10,7 @@ import path__default, { resolve, extname, isAbsolute, sep } from 'node:path';
|
|
|
10
10
|
import url2, { URLSearchParams as URLSearchParams$1 } from 'node:url';
|
|
11
11
|
import * as cli from '@cloudflare/cli-shared-helpers';
|
|
12
12
|
import { cancel } from '@cloudflare/cli-shared-helpers';
|
|
13
|
-
import { INHERIT_SYMBOL, APIError, UserError, getEnvironmentVariableFactory, isNonInteractiveOrCI, getHostFromRoute, retryOnAPIFailure, ParseError, getComplianceRegionSubdomain, configFileName, formatTime, getSubdomainMixedStateCheckDisabled, LOGGER_LEVELS, SERVICE_TAG_PREFIX, ENVIRONMENT_TAG_PREFIX, getDurableObjectExports, partitionExports, getWranglerTmpDir, parsePackageJSON, getInstalledPackageVersion, FatalError, readFileSync as readFileSync$1, parseJSON, getBindingTypeFriendlyName, getBindingLocalSupport, assertNever, experimental_readRawConfig, experimental_patchConfig, PatchConfigError, COMPLIANCE_REGION_CONFIG_UNKNOWN, constructWranglerConfig, getCIMatchTag, formatConfigSnippet,
|
|
13
|
+
import { INHERIT_SYMBOL, APIError, UserError, getEnvironmentVariableFactory, isNonInteractiveOrCI, getHostFromRoute, retryOnAPIFailure, ParseError, getComplianceRegionSubdomain, configFileName, formatTime, getSubdomainMixedStateCheckDisabled, LOGGER_LEVELS, SERVICE_TAG_PREFIX, ENVIRONMENT_TAG_PREFIX, getDurableObjectExports, partitionExports, getWranglerTmpDir, parsePackageJSON, getInstalledPackageVersion, FatalError, readFileSync as readFileSync$1, parseJSON, getBindingTypeFriendlyName, getBindingLocalSupport, assertNever, experimental_readRawConfig, experimental_patchConfig, PatchConfigError, COMPLIANCE_REGION_CONFIG_UNKNOWN, constructWranglerConfig, getCIMatchTag, formatConfigSnippet, DEFAULT_COMPAT_DATE, hasDurableObjectExports, getDockerPath, parseNonHyphenedUuid, getWorkersCIBranchName } from '@cloudflare/workers-utils';
|
|
14
14
|
import { execSync, spawn } from 'node:child_process';
|
|
15
15
|
import { Response, FormData } from 'undici';
|
|
16
16
|
import chalk6 from 'chalk';
|
|
@@ -25450,7 +25450,7 @@ function validateWorkerProps(props, config2) {
|
|
|
25450
25450
|
);
|
|
25451
25451
|
}
|
|
25452
25452
|
if (!compatibilityDate) {
|
|
25453
|
-
const compatibilityDateStr =
|
|
25453
|
+
const compatibilityDateStr = DEFAULT_COMPAT_DATE;
|
|
25454
25454
|
throw new UserError(
|
|
25455
25455
|
`A compatibility_date is required when uploading a Worker. Add the following to your ${configFileName(config2.configPath)} file:
|
|
25456
25456
|
\`\`\`
|
|
@@ -26519,7 +26519,7 @@ async function getPreview(config2, accountId, workerName, previewIdentifier) {
|
|
|
26519
26519
|
}
|
|
26520
26520
|
__name(getPreview, "getPreview");
|
|
26521
26521
|
async function createPreview(config2, accountId, workerName, request2, options) {
|
|
26522
|
-
const queryParams = options?.
|
|
26522
|
+
const queryParams = options?.ignoreBaseConfig ? new URLSearchParams({ ignore_base_config: "true" }) : void 0;
|
|
26523
26523
|
return fetchResult(
|
|
26524
26524
|
config2,
|
|
26525
26525
|
`/accounts/${accountId}/workers/workers/${workerName}/previews`,
|
|
@@ -26532,8 +26532,7 @@ async function createPreview(config2, accountId, workerName, request2, options)
|
|
|
26532
26532
|
);
|
|
26533
26533
|
}
|
|
26534
26534
|
__name(createPreview, "createPreview");
|
|
26535
|
-
async function editPreview(config2, accountId, workerName, previewIdentifier, request2
|
|
26536
|
-
const queryParams = options?.ignoreDefaults ? new URLSearchParams({ ignore_defaults: "true" }) : void 0;
|
|
26535
|
+
async function editPreview(config2, accountId, workerName, previewIdentifier, request2) {
|
|
26537
26536
|
return fetchResult(
|
|
26538
26537
|
config2,
|
|
26539
26538
|
`/accounts/${accountId}/workers/workers/${workerName}/previews/${encodeURIComponent(
|
|
@@ -26543,8 +26542,7 @@ async function editPreview(config2, accountId, workerName, previewIdentifier, re
|
|
|
26543
26542
|
method: "PATCH",
|
|
26544
26543
|
headers: { "Content-Type": "application/json" },
|
|
26545
26544
|
body: JSON.stringify(request2)
|
|
26546
|
-
}
|
|
26547
|
-
queryParams
|
|
26545
|
+
}
|
|
26548
26546
|
);
|
|
26549
26547
|
}
|
|
26550
26548
|
__name(editPreview, "editPreview");
|
|
@@ -26569,8 +26567,7 @@ async function getPreviewDeployment(config2, accountId, workerName, previewIdent
|
|
|
26569
26567
|
);
|
|
26570
26568
|
}
|
|
26571
26569
|
__name(getPreviewDeployment, "getPreviewDeployment");
|
|
26572
|
-
async function createPreviewDeployment(config2, accountId, workerName, previewIdentifier, request2
|
|
26573
|
-
const queryParams = options?.ignoreDefaults ? new URLSearchParams({ ignore_defaults: "true" }) : void 0;
|
|
26570
|
+
async function createPreviewDeployment(config2, accountId, workerName, previewIdentifier, request2) {
|
|
26574
26571
|
return fetchResult(
|
|
26575
26572
|
config2,
|
|
26576
26573
|
`/accounts/${accountId}/workers/workers/${workerName}/previews/${encodeURIComponent(
|
|
@@ -26580,8 +26577,7 @@ async function createPreviewDeployment(config2, accountId, workerName, previewId
|
|
|
26580
26577
|
method: "POST",
|
|
26581
26578
|
headers: { "Content-Type": "application/json" },
|
|
26582
26579
|
body: JSON.stringify(request2)
|
|
26583
|
-
}
|
|
26584
|
-
queryParams
|
|
26580
|
+
}
|
|
26585
26581
|
);
|
|
26586
26582
|
}
|
|
26587
26583
|
__name(createPreviewDeployment, "createPreviewDeployment");
|
|
@@ -27180,7 +27176,7 @@ async function preview(accountId, args, config2, buildResult, assetsOptions) {
|
|
|
27180
27176
|
}
|
|
27181
27177
|
}
|
|
27182
27178
|
const previewIdentifier = previewName;
|
|
27183
|
-
const
|
|
27179
|
+
const ignoreBaseConfig = args.ignoreBaseConfig;
|
|
27184
27180
|
const fallbackTag = !args.tag && shouldUseCIMetadataFallback() ? getHeadCommitRef() : void 0;
|
|
27185
27181
|
const fallbackMessage = !args.message && shouldUseCIMetadataFallback() ? getHeadCommitMessage() : void 0;
|
|
27186
27182
|
let existingPreview = null;
|
|
@@ -27204,7 +27200,7 @@ async function preview(accountId, args, config2, buildResult, assetsOptions) {
|
|
|
27204
27200
|
accountId,
|
|
27205
27201
|
workerName,
|
|
27206
27202
|
{ name: previewName, ...assemblePreviewScriptSettings(config2) },
|
|
27207
|
-
{
|
|
27203
|
+
{ ignoreBaseConfig }
|
|
27208
27204
|
);
|
|
27209
27205
|
} else {
|
|
27210
27206
|
const previewRequest = assemblePreviewScriptSettings(config2);
|
|
@@ -27214,8 +27210,7 @@ async function preview(accountId, args, config2, buildResult, assetsOptions) {
|
|
|
27214
27210
|
accountId,
|
|
27215
27211
|
workerName,
|
|
27216
27212
|
previewIdentifier,
|
|
27217
|
-
previewRequest
|
|
27218
|
-
{ ignoreDefaults }
|
|
27213
|
+
previewRequest
|
|
27219
27214
|
);
|
|
27220
27215
|
} else {
|
|
27221
27216
|
previewResource = existingPreview;
|
|
@@ -27238,8 +27233,7 @@ async function preview(accountId, args, config2, buildResult, assetsOptions) {
|
|
|
27238
27233
|
accountId,
|
|
27239
27234
|
workerName,
|
|
27240
27235
|
previewResource.id,
|
|
27241
|
-
deploymentRequest
|
|
27242
|
-
{ ignoreDefaults }
|
|
27236
|
+
deploymentRequest
|
|
27243
27237
|
);
|
|
27244
27238
|
if (args.json) {
|
|
27245
27239
|
logger.log(
|