@cloudflare/vite-plugin 1.62.4 → 1.63.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/dist/index.d.mts
CHANGED
|
@@ -53,6 +53,8 @@ type PersistState = boolean | {
|
|
|
53
53
|
type TunnelConfig = {
|
|
54
54
|
autoStart?: boolean;
|
|
55
55
|
name?: string;
|
|
56
|
+
/** Email addresses or domain patterns allowed to authenticate to a Quick Tunnel. */
|
|
57
|
+
allowedMail?: string[];
|
|
56
58
|
};
|
|
57
59
|
interface BaseWorkerConfig {
|
|
58
60
|
viteEnvironment?: {
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/utils.ts","../src/workers-configs.ts","../src/plugin-config.ts","../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;ACsDK,KDEO,OCFP,CAAA,CAAA,CAAA,GDEoB,OCFpB,CDE4B,CCF5B,EAAA,SAA8B,CAAA;;;;AAE9B,KAzBO,YAAA,GAAe,IAyBH,CAzBQ,eA0B7B,EAAA,MA1BoD,mBA2BpD,CAAA;KAJE,8BAAA,UAAwC;ACN7C,KDQK,mBAAA,GACF,iCCTqB,GDUrB,8BCVqB;AACxB,KDWK,iCAAA,GCXmB,MDYjB,8BCZiB,CAAA,gBAAA,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/utils.ts","../src/workers-configs.ts","../src/plugin-config.ts","../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;ACsDK,KDEO,OCFP,CAAA,CAAA,CAAA,GDEoB,OCFpB,CDE4B,CCF5B,EAAA,SAA8B,CAAA;;;;AAE9B,KAzBO,YAAA,GAAe,IAyBH,CAzBQ,eA0B7B,EAAA,MA1BoD,mBA2BpD,CAAA;KAJE,8BAAA,UAAwC;ACN7C,KDQK,mBAAA,GACF,iCCTqB,GDUrB,8BCVqB;AACxB,KDWK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DWF,YAAA,CAAA,ECX2B,YDW3B,CAAA,ECX+C,IAAA,CAAK,MDWpD,EAAA"}
|
package/dist/index.mjs
CHANGED
|
@@ -8,7 +8,7 @@ import path__default, { basename, dirname, isAbsolute, join, relative, resolve }
|
|
|
8
8
|
import assert from "node:assert";
|
|
9
9
|
import os, { arch, release } from "node:os";
|
|
10
10
|
import * as util from "node:util";
|
|
11
|
-
import { TextEncoder as TextEncoder$1, format, inspect, promisify, stripVTControlCharacters, styleText } from "node:util";
|
|
11
|
+
import { TextEncoder as TextEncoder$1, format, inspect, isDeepStrictEqual, promisify, stripVTControlCharacters, styleText } from "node:util";
|
|
12
12
|
import process$1, { exit, stdin, stdout } from "node:process";
|
|
13
13
|
import tty from "node:tty";
|
|
14
14
|
import url, { URL as URL$1, URLSearchParams as URLSearchParams$1, fileURLToPath, pathToFileURL } from "node:url";
|
|
@@ -13890,7 +13890,7 @@ function createFatalError$1(message, isJson, options) {
|
|
|
13890
13890
|
__name$6(createFatalError$1, "createFatalError");
|
|
13891
13891
|
|
|
13892
13892
|
//#endregion
|
|
13893
|
-
//#region ../workers-utils/dist/chunk-
|
|
13893
|
+
//#region ../workers-utils/dist/chunk-TAK63GWY.mjs
|
|
13894
13894
|
createRequire(import.meta.url || (typeof __filename === "string" ? __filename : "/"));
|
|
13895
13895
|
function hasKnownExportType(entry) {
|
|
13896
13896
|
const type = entry?.type;
|
|
@@ -16349,10 +16349,18 @@ function findRedirectedWranglerConfig(cwd, userConfigPath) {
|
|
|
16349
16349
|
But the redirected configuration path it points to, "${path__default.relative(".", redirectedConfigPath)}", does not exist.
|
|
16350
16350
|
`, { telemetryMessage: false });
|
|
16351
16351
|
if (userConfigPath) {
|
|
16352
|
-
|
|
16352
|
+
const expectedDeployConfigPath = path__default.join(path__default.dirname(userConfigPath), PATH_TO_DEPLOY_CONFIG);
|
|
16353
|
+
if (expectedDeployConfigPath !== deployConfigPath) throw new UserError(esm_default$1`
|
|
16353
16354
|
Found both a user configuration file at "${path__default.relative(".", userConfigPath)}"
|
|
16354
16355
|
and a deploy configuration file at "${path__default.relative(".", deployConfigPath)}".
|
|
16355
16356
|
But these do not share the same base path so it is not clear which should be used.
|
|
16357
|
+
|
|
16358
|
+
A deploy configuration file is generated by a build tool to redirect Wrangler to the configuration it generated.
|
|
16359
|
+
It is only applied when it sits alongside the user configuration file, which here would be "${path__default.relative(".", expectedDeployConfigPath)}".
|
|
16360
|
+
|
|
16361
|
+
Please either delete "${path__default.relative(".", deployConfigPath)}" if it is left over from a previous build,
|
|
16362
|
+
or try running this command from the directory containing the configuration you want to use.
|
|
16363
|
+
See https://developers.cloudflare.com/workers/wrangler/configuration/#generated-wrangler-configuration
|
|
16356
16364
|
`, { telemetryMessage: false });
|
|
16357
16365
|
}
|
|
16358
16366
|
return {
|
|
@@ -43167,6 +43175,7 @@ var validateAssetsConfig = /* @__PURE__ */ __name$6((diagnostics, field, value)
|
|
|
43167
43175
|
"404-page",
|
|
43168
43176
|
"none"
|
|
43169
43177
|
]) && isValid;
|
|
43178
|
+
isValid = validateOptionalProperty(diagnostics, field, "base_path", value.base_path, "string") && isValid;
|
|
43170
43179
|
if (value.run_worker_first !== void 0) if (typeof value.run_worker_first === "boolean") isValid = validateOptionalProperty(diagnostics, field, "run_worker_first", value.run_worker_first, "boolean") && isValid;
|
|
43171
43180
|
else if (Array.isArray(value.run_worker_first)) isValid = validateOptionalTypedArray(diagnostics, "assets.run_worker_first", value.run_worker_first, "string") && isValid;
|
|
43172
43181
|
else {
|
|
@@ -43178,6 +43187,7 @@ var validateAssetsConfig = /* @__PURE__ */ __name$6((diagnostics, field, value)
|
|
|
43178
43187
|
"binding",
|
|
43179
43188
|
"html_handling",
|
|
43180
43189
|
"not_found_handling",
|
|
43190
|
+
"base_path",
|
|
43181
43191
|
"run_worker_first"
|
|
43182
43192
|
]) && isValid;
|
|
43183
43193
|
return isValid;
|
|
@@ -43602,7 +43612,11 @@ function validateContainerApp(envName, topLevelName, configPath, options = {}) {
|
|
|
43602
43612
|
}
|
|
43603
43613
|
validateOptionalTypedArray(diagnostics, `${field}.constraints.tiers`, constraints.tiers, "number");
|
|
43604
43614
|
validateOptionalProperty(diagnostics, `${field}.constraints`, "jurisdiction", constraints.jurisdiction, "string");
|
|
43605
|
-
if (constraints.jurisdiction && ![
|
|
43615
|
+
if (constraints.jurisdiction && ![
|
|
43616
|
+
"eu",
|
|
43617
|
+
"fedramp",
|
|
43618
|
+
"us"
|
|
43619
|
+
].includes(constraints.jurisdiction)) diagnostics.errors.push(`${field}.constraints.jurisdiction must be one of: "eu", "fedramp", "us"`);
|
|
43606
43620
|
if (validateOptionalTypedArray(diagnostics, `${field}.constraints.regions`, constraints.regions, "string") && constraints.regions && Array.isArray(constraints.regions)) {
|
|
43607
43621
|
const validRegions = [
|
|
43608
43622
|
"ENAM",
|
|
@@ -45648,7 +45662,7 @@ function mapWorkerMetadataBindings(bindings) {
|
|
|
45648
45662
|
}, {});
|
|
45649
45663
|
}
|
|
45650
45664
|
__name$6(mapWorkerMetadataBindings, "mapWorkerMetadataBindings");
|
|
45651
|
-
var DEFAULT_COMPAT_DATE = "2026-10-
|
|
45665
|
+
var DEFAULT_COMPAT_DATE = "2026-10-06";
|
|
45652
45666
|
function constructWranglerConfig(config$2) {
|
|
45653
45667
|
const mappedBindings = mapWorkerMetadataBindings(config$2.bindings);
|
|
45654
45668
|
const durableObjectClassNames = config$2.bindings.filter((binding) => binding.type === "durable_object_namespace" && binding.script_name === config$2.name).map((durableObject) => durableObject.class_name);
|
|
@@ -47582,6 +47596,7 @@ function startTunnel(options) {
|
|
|
47582
47596
|
const reminderIntervalMs = options.reminderIntervalMs ?? DEFAULT_TUNNEL_REMINDER_INTERVAL_MS;
|
|
47583
47597
|
const defaultExpiryMs = options.expiryMs ?? DEFAULT_TUNNEL_EXPIRY_MS;
|
|
47584
47598
|
const isNamedTunnel = options.token !== void 0;
|
|
47599
|
+
if (isNamedTunnel && (options.allowedMail?.length ?? 0) > 0) throw new UserError("The `allowedMail` option is only supported for Quick Tunnels.", { telemetryMessage: "tunnel allowed mail named tunnel conflict" });
|
|
47585
47600
|
const timeFormatter = new Intl.DateTimeFormat(void 0, { timeStyle: "short" });
|
|
47586
47601
|
const readyPromise = spawnCloudflared(isNamedTunnel ? [
|
|
47587
47602
|
"tunnel",
|
|
@@ -47591,7 +47606,8 @@ function startTunnel(options) {
|
|
|
47591
47606
|
"tunnel",
|
|
47592
47607
|
"--no-autoupdate",
|
|
47593
47608
|
"--url",
|
|
47594
|
-
options.origin.href
|
|
47609
|
+
options.origin.href,
|
|
47610
|
+
...(options.allowedMail ?? []).flatMap((allowedMail) => ["--allowed-mail", allowedMail])
|
|
47595
47611
|
], {
|
|
47596
47612
|
stdio: "pipe",
|
|
47597
47613
|
env: options.token ? { TUNNEL_TOKEN: options.token } : void 0,
|
|
@@ -51357,7 +51373,7 @@ var qr_default = encodeQR;
|
|
|
51357
51373
|
//#endregion
|
|
51358
51374
|
//#region src/plugins/tunnel.ts
|
|
51359
51375
|
function createPublicExposureWarning(mode, name, shortcutPressed) {
|
|
51360
|
-
const intro = name === void 0 ? import_picocolors$5.default.dim("Once connected, this tunnel
|
|
51376
|
+
const intro = name === void 0 ? import_picocolors$5.default.dim("Once connected, this tunnel may be ") + "publicly accessible" + import_picocolors$5.default.dim(". Anyone who can reach it can:") : import_picocolors$5.default.dim("Once connected, this tunnel may be reachable from the Internet. Anyone who can reach it can:");
|
|
51361
51377
|
const concerns = [
|
|
51362
51378
|
"Call ungated endpoints",
|
|
51363
51379
|
"Trigger logic that uses remote bindings",
|
|
@@ -51381,19 +51397,23 @@ function createPublicExposureWarning(mode, name, shortcutPressed) {
|
|
|
51381
51397
|
}
|
|
51382
51398
|
const QUICK_TUNNEL_SSE_WARNING = "Quick tunnels do not support Server-Sent Events (SSE). Use a named Cloudflare Tunnel if you need SSE over a public URL.";
|
|
51383
51399
|
const QUICK_TUNNEL_ALLOWED_HOST = ".trycloudflare.com";
|
|
51400
|
+
function normalizeAllowedMail(allowedMail) {
|
|
51401
|
+
return allowedMail?.length ? allowedMail : void 0;
|
|
51402
|
+
}
|
|
51384
51403
|
var TunnelManager = class {
|
|
51385
51404
|
#logger;
|
|
51386
51405
|
#origin;
|
|
51387
51406
|
#publicUrls;
|
|
51388
51407
|
#requestedTunnel;
|
|
51408
|
+
#requestedAllowedMail;
|
|
51389
51409
|
#tunnel;
|
|
51390
51410
|
#abortController;
|
|
51391
51411
|
#hasWarnedAboutSse = false;
|
|
51392
51412
|
constructor(logger$2) {
|
|
51393
51413
|
this.#logger = logger$2;
|
|
51394
51414
|
}
|
|
51395
|
-
isStarted(origin, name) {
|
|
51396
|
-
return this.#origin === origin && this.#requestedTunnel === name;
|
|
51415
|
+
isStarted(origin, name, allowedMail) {
|
|
51416
|
+
return this.#origin === origin && this.#requestedTunnel === name && isDeepStrictEqual(this.#requestedAllowedMail, normalizeAllowedMail(allowedMail));
|
|
51397
51417
|
}
|
|
51398
51418
|
isOpen() {
|
|
51399
51419
|
if (!this.#tunnel) return this.#origin !== void 0;
|
|
@@ -51405,12 +51425,14 @@ var TunnelManager = class {
|
|
|
51405
51425
|
return isOpen;
|
|
51406
51426
|
}
|
|
51407
51427
|
async startTunnel(options) {
|
|
51428
|
+
const allowedMail = normalizeAllowedMail(options.allowedMail);
|
|
51408
51429
|
try {
|
|
51409
51430
|
if (this.#tunnel) this.dispose();
|
|
51410
51431
|
const abortController = new AbortController();
|
|
51411
51432
|
this.#abortController = abortController;
|
|
51412
51433
|
this.#origin = options.origin;
|
|
51413
51434
|
this.#requestedTunnel = options.name;
|
|
51435
|
+
this.#requestedAllowedMail = allowedMail ? [...allowedMail] : void 0;
|
|
51414
51436
|
this.#logger.info(import_picocolors$5.default.dim("\n ➜ Starting tunnel (usually takes a few seconds)...\n"));
|
|
51415
51437
|
this.#logger.warn(createPublicExposureWarning(options.mode, options.name, options.shortcutPressed ?? false));
|
|
51416
51438
|
const namedTunnel = options.name !== void 0 ? await wrangler.unstable_resolveNamedTunnel(options.name, new URL(options.origin), {
|
|
@@ -51433,6 +51455,7 @@ Add \`${QUICK_TUNNEL_ALLOWED_HOST}\` to \`preview.allowedHosts\` in your Vite co
|
|
|
51433
51455
|
const tunnel = startTunnel({
|
|
51434
51456
|
origin: new URL(options.origin),
|
|
51435
51457
|
token: namedTunnel?.token,
|
|
51458
|
+
allowedMail,
|
|
51436
51459
|
extendHint: "Press a + enter to extend by 1 hour.",
|
|
51437
51460
|
logger: {
|
|
51438
51461
|
log: (message) => this.#logger.info(message),
|
|
@@ -51485,6 +51508,7 @@ Add \`${QUICK_TUNNEL_ALLOWED_HOST}\` to \`preview.allowedHosts\` in your Vite co
|
|
|
51485
51508
|
this.#origin = void 0;
|
|
51486
51509
|
this.#publicUrls = void 0;
|
|
51487
51510
|
this.#requestedTunnel = void 0;
|
|
51511
|
+
this.#requestedAllowedMail = void 0;
|
|
51488
51512
|
this.#tunnel = void 0;
|
|
51489
51513
|
this.#hasWarnedAboutSse = false;
|
|
51490
51514
|
debuglog("Disposing tunnel...");
|
|
@@ -51581,7 +51605,7 @@ async function resolvePreviewTunnelOrigin(server) {
|
|
|
51581
51605
|
async function setupDevTunnel(server, ctx, manager, shortcutPressed) {
|
|
51582
51606
|
const origin = await resolveDevTunnelOrigin(server);
|
|
51583
51607
|
const tunnel = ctx.resolvedPluginConfig.tunnel;
|
|
51584
|
-
if (manager.isStarted(origin, tunnel.name)) {
|
|
51608
|
+
if (manager.isStarted(origin, tunnel.name, tunnel.allowedMail)) {
|
|
51585
51609
|
debuglog("Tunnel is already started on", origin);
|
|
51586
51610
|
return;
|
|
51587
51611
|
}
|
|
@@ -51590,6 +51614,7 @@ async function setupDevTunnel(server, ctx, manager, shortcutPressed) {
|
|
|
51590
51614
|
origin,
|
|
51591
51615
|
shortcutPressed,
|
|
51592
51616
|
name: tunnel.name,
|
|
51617
|
+
allowedMail: tunnel.allowedMail,
|
|
51593
51618
|
accountId: ctx.entryWorkerConfig?.account_id,
|
|
51594
51619
|
complianceRegion: ctx.entryWorkerConfig?.compliance_region,
|
|
51595
51620
|
allowedHosts: true
|
|
@@ -51617,7 +51642,7 @@ async function setupPreviewTunnel(server, ctx, manager, shortcutPressed) {
|
|
|
51617
51642
|
if (originalPort !== 0 && resolvedPort !== originalPort) server.config.logger.info(import_picocolors$5.default.dim(`Port ${originalPort} is in use, using ${resolvedPort} instead for preview tunnel sharing.\n`));
|
|
51618
51643
|
const tunnel = ctx.resolvedPluginConfig.tunnel;
|
|
51619
51644
|
const origin = resolvedOrigin.toString();
|
|
51620
|
-
if (manager.isStarted(origin, tunnel.name)) {
|
|
51645
|
+
if (manager.isStarted(origin, tunnel.name, tunnel.allowedMail)) {
|
|
51621
51646
|
debuglog("Tunnel is already started on", origin);
|
|
51622
51647
|
return;
|
|
51623
51648
|
}
|
|
@@ -51626,6 +51651,7 @@ async function setupPreviewTunnel(server, ctx, manager, shortcutPressed) {
|
|
|
51626
51651
|
origin,
|
|
51627
51652
|
shortcutPressed,
|
|
51628
51653
|
name: tunnel.name,
|
|
51654
|
+
allowedMail: tunnel.allowedMail,
|
|
51629
51655
|
allowedHosts: preview?.allowedHosts,
|
|
51630
51656
|
accountId: ctx.allWorkerConfigs[0]?.account_id,
|
|
51631
51657
|
complianceRegion: ctx.allWorkerConfigs[0]?.compliance_region
|
|
@@ -56623,6 +56649,7 @@ const AssetsSchema = strictObject({
|
|
|
56623
56649
|
"404-page",
|
|
56624
56650
|
"none"
|
|
56625
56651
|
]).optional(),
|
|
56652
|
+
basePath: string().optional(),
|
|
56626
56653
|
runWorkerFirst: union([array(string()), boolean()]).optional()
|
|
56627
56654
|
});
|
|
56628
56655
|
const BrowserBindingSchema = strictObject({
|
|
@@ -56979,7 +57006,11 @@ const StandardContainerBaseSchema = BaseContainerSchema.extend({
|
|
|
56979
57006
|
"OC",
|
|
56980
57007
|
"AFR"
|
|
56981
57008
|
])).optional(),
|
|
56982
|
-
jurisdiction: _enum([
|
|
57009
|
+
jurisdiction: _enum([
|
|
57010
|
+
"eu",
|
|
57011
|
+
"fedramp",
|
|
57012
|
+
"us"
|
|
57013
|
+
]).optional()
|
|
56983
57014
|
}).optional(),
|
|
56984
57015
|
rollout: strictObject({
|
|
56985
57016
|
kind: _enum([
|
|
@@ -57869,6 +57900,7 @@ function convertBindingsAndAssets(config$2, result) {
|
|
|
57869
57900
|
if (assetsBindingName !== void 0) assets.binding = assetsBindingName;
|
|
57870
57901
|
if (config$2.assets?.htmlHandling !== void 0) assets.html_handling = config$2.assets.htmlHandling;
|
|
57871
57902
|
if (config$2.assets?.notFoundHandling !== void 0) assets.not_found_handling = config$2.assets.notFoundHandling;
|
|
57903
|
+
if (config$2.assets?.basePath !== void 0) assets.base_path = config$2.assets.basePath;
|
|
57872
57904
|
if (config$2.assets?.runWorkerFirst !== void 0) assets.run_worker_first = config$2.assets.runWorkerFirst;
|
|
57873
57905
|
result.assets = assets;
|
|
57874
57906
|
}
|
|
@@ -65978,13 +66010,17 @@ function resolveWorkerConfig(options) {
|
|
|
65978
66010
|
});
|
|
65979
66011
|
}
|
|
65980
66012
|
async function resolvePluginConfig(pluginConfig, userConfig, viteEnv) {
|
|
66013
|
+
if (typeof pluginConfig.tunnel === "object") {
|
|
66014
|
+
if (pluginConfig.tunnel.name !== void 0 && (pluginConfig.tunnel.allowedMail?.length ?? 0) > 0) throw new Error("`tunnel.allowedMail` is only supported for Quick Tunnels and cannot be used together with `tunnel.name`.");
|
|
66015
|
+
}
|
|
65981
66016
|
const resolvedNewConfig = normalizeNewConfig(pluginConfig.experimental?.newConfig);
|
|
65982
66017
|
const shared = {
|
|
65983
66018
|
persistState: pluginConfig.persistState ?? true,
|
|
65984
66019
|
inspectorPort: pluginConfig.inspectorPort,
|
|
65985
66020
|
tunnel: typeof pluginConfig.tunnel === "boolean" ? { autoStart: pluginConfig.tunnel } : {
|
|
65986
66021
|
autoStart: pluginConfig.tunnel?.autoStart ?? false,
|
|
65987
|
-
name: pluginConfig.tunnel?.name
|
|
66022
|
+
name: pluginConfig.tunnel?.name,
|
|
66023
|
+
allowedMail: pluginConfig.tunnel?.allowedMail?.length ? pluginConfig.tunnel.allowedMail : void 0
|
|
65988
66024
|
},
|
|
65989
66025
|
experimental: {
|
|
65990
66026
|
headersAndRedirectsDevModeSupport: pluginConfig.experimental?.headersAndRedirectsDevModeSupport,
|
|
@@ -80757,7 +80793,7 @@ var __name$1 = (target$1, value) => __defProp$1(target$1, "name", {
|
|
|
80757
80793
|
});
|
|
80758
80794
|
|
|
80759
80795
|
//#endregion
|
|
80760
|
-
//#region ../workers-auth/dist/chunk-
|
|
80796
|
+
//#region ../workers-auth/dist/chunk-NDZDTP46.mjs
|
|
80761
80797
|
var import_undici$2 = require_undici();
|
|
80762
80798
|
createRequire(import.meta.url || (typeof __filename === "string" ? __filename : "/"));
|
|
80763
80799
|
var hasWarnedAboutDeprecatedV1ApiToken = false;
|
|
@@ -81152,7 +81188,7 @@ function getCachedTemporaryPreviewAccount(storage) {
|
|
|
81152
81188
|
return temporaryPreviewAccount;
|
|
81153
81189
|
}
|
|
81154
81190
|
__name$1(getCachedTemporaryPreviewAccount, "getCachedTemporaryPreviewAccount");
|
|
81155
|
-
async function requestPowSolution(
|
|
81191
|
+
async function requestPowSolution(temporaryAccountLogger) {
|
|
81156
81192
|
const response = await (0, import_undici$2.fetch)(getTemporaryPreviewChallengeUrl(), {
|
|
81157
81193
|
method: "POST",
|
|
81158
81194
|
headers: { "Content-Type": "application/json" },
|
|
@@ -81168,7 +81204,7 @@ async function requestPowSolution(logger$2) {
|
|
|
81168
81204
|
const { challengeToken, seed, k, g } = body.result ?? {};
|
|
81169
81205
|
if (challengeToken === void 0 || seed === void 0 || k === void 0 || g === void 0) throw new FatalError("Failed to request a proof-of-work challenge because the response was missing required fields.", { telemetryMessage: "deploy temporary account challenge incomplete" });
|
|
81170
81206
|
if (!Number.isInteger(k) || !Number.isInteger(g) || k <= 0 || g <= 0 || k * g > POW_MAX_ITERATIONS || Buffer.from(seed, "base64url").length !== 32) throw new FatalError("The proof-of-work challenge is not supported by this version of Wrangler.", { telemetryMessage: "deploy temporary account challenge difficulty unsupported" });
|
|
81171
|
-
|
|
81207
|
+
temporaryAccountLogger.log("Solving proof-of-work challenge…");
|
|
81172
81208
|
return solveChallenge({
|
|
81173
81209
|
challengeToken,
|
|
81174
81210
|
seed,
|
|
@@ -81177,8 +81213,8 @@ async function requestPowSolution(logger$2) {
|
|
|
81177
81213
|
});
|
|
81178
81214
|
}
|
|
81179
81215
|
__name$1(requestPowSolution, "requestPowSolution");
|
|
81180
|
-
async function createTemporaryPreviewAccount(
|
|
81181
|
-
const pow = await requestPowSolution(
|
|
81216
|
+
async function createTemporaryPreviewAccount(temporaryAccountLogger, request$2) {
|
|
81217
|
+
const pow = await requestPowSolution(temporaryAccountLogger);
|
|
81182
81218
|
const response = await (0, import_undici$2.fetch)(getTemporaryPreviewUrl(), {
|
|
81183
81219
|
method: "POST",
|
|
81184
81220
|
headers: { "Content-Type": "application/json" },
|
|
@@ -81238,7 +81274,7 @@ async function getOrCreateTemporaryPreviewAccount(options) {
|
|
|
81238
81274
|
};
|
|
81239
81275
|
}
|
|
81240
81276
|
if (!await options.prompt(TEMPORARY_TERMS_PROMPT, TEMPORARY_TERMS_NOTICE)) throw new UserError(TEMPORARY_TERMS_ERROR, { telemetryMessage: "user temporary terms not accepted" });
|
|
81241
|
-
const temporaryPreviewAccount = await createTemporaryPreviewAccount(options.
|
|
81277
|
+
const temporaryPreviewAccount = await createTemporaryPreviewAccount(options.temporaryAccountLogger, options.request);
|
|
81242
81278
|
options.storage.write(temporaryPreviewAccount);
|
|
81243
81279
|
return {
|
|
81244
81280
|
account: temporaryPreviewAccount,
|
|
@@ -82193,7 +82229,6 @@ function createOAuthFlow(ctx) {
|
|
|
82193
82229
|
if (!ctx.temporary) throw new UserError("Temporary preview accounts are not supported by this CLI.", { telemetryMessage: "user temporary account unsupported" });
|
|
82194
82230
|
const result = await getOrCreateTemporaryPreviewAccount({
|
|
82195
82231
|
...ctx.temporary,
|
|
82196
|
-
logger: ctx.logger,
|
|
82197
82232
|
...temporaryRequest ? { request: temporaryRequest } : {}
|
|
82198
82233
|
});
|
|
82199
82234
|
activeTemporaryAccount = result.account;
|
|
@@ -83231,7 +83266,7 @@ function scrubEncryptedCredentials(options) {
|
|
|
83231
83266
|
__name$1(scrubEncryptedCredentials, "scrubEncryptedCredentials");
|
|
83232
83267
|
|
|
83233
83268
|
//#endregion
|
|
83234
|
-
//#region ../workers-auth/dist/chunk-
|
|
83269
|
+
//#region ../workers-auth/dist/chunk-PGZZHNWG.mjs
|
|
83235
83270
|
createRequire(import.meta.url || (typeof __filename === "string" ? __filename : "/"));
|
|
83236
83271
|
function createPreferences(getConfigPath) {
|
|
83237
83272
|
function getUserPreferencesPath() {
|
|
@@ -83908,10 +83943,10 @@ function createFileStorage(format$3, getPath) {
|
|
|
83908
83943
|
}
|
|
83909
83944
|
__name$1(createFileStorage, "createFileStorage");
|
|
83910
83945
|
function createTemporaryTermsPrompt(deps) {
|
|
83911
|
-
const {
|
|
83946
|
+
const { temporaryAccountLogger, prompt } = deps;
|
|
83912
83947
|
return /* @__PURE__ */ __name$1(async function ensureTemporaryTermsAccepted(question, notice) {
|
|
83913
83948
|
if (isNonInteractiveOrCI()) {
|
|
83914
|
-
|
|
83949
|
+
temporaryAccountLogger.log(notice);
|
|
83915
83950
|
return true;
|
|
83916
83951
|
}
|
|
83917
83952
|
const answer = await prompt(question);
|
|
@@ -83939,9 +83974,9 @@ function notLoggedInErrorBodies(loginCommand) {
|
|
|
83939
83974
|
};
|
|
83940
83975
|
}
|
|
83941
83976
|
__name$1(notLoggedInErrorBodies, "notLoggedInErrorBodies");
|
|
83942
|
-
function logTemporaryPreviewAccount(
|
|
83977
|
+
function logTemporaryPreviewAccount(temporaryAccountLogger, temporaryPreviewAccount, cached$2) {
|
|
83943
83978
|
const claimExpiresAt = new Date(temporaryPreviewAccount.claim.expiresAt);
|
|
83944
|
-
|
|
83979
|
+
temporaryAccountLogger.log(dedent`
|
|
83945
83980
|
Temporary account ready:
|
|
83946
83981
|
Account: ${temporaryPreviewAccount.account.name} (${cached$2 ? "reused" : "created"})
|
|
83947
83982
|
Claim within: ${formatDistanceToNowStrict(claimExpiresAt)}
|
|
@@ -83951,6 +83986,7 @@ function logTemporaryPreviewAccount(logger$2, temporaryPreviewAccount, cached$2)
|
|
|
83951
83986
|
__name$1(logTemporaryPreviewAccount, "logTemporaryPreviewAccount");
|
|
83952
83987
|
function createCloudflareAuth(descriptor, ctx) {
|
|
83953
83988
|
const { logger: logger$2 } = ctx;
|
|
83989
|
+
const temporaryAccountLogger = ctx.temporaryAccountLogger ?? logger$2;
|
|
83954
83990
|
const cliName = descriptor.cliName;
|
|
83955
83991
|
const NOT_LOGGED_IN_ERROR_BODIES = notLoggedInErrorBodies(descriptor.commands.login);
|
|
83956
83992
|
const NOT_LOGGED_IN_WHOAMI_TIP = `
|
|
@@ -83983,9 +84019,10 @@ Run \`${descriptor.commands.whoami}\` to check your current authentication statu
|
|
|
83983
84019
|
temporary: {
|
|
83984
84020
|
storage: createFileStorage(descriptor.fileFormat, descriptor.getTemporaryAccountConfigPath),
|
|
83985
84021
|
prompt: createTemporaryTermsPrompt({
|
|
83986
|
-
|
|
84022
|
+
temporaryAccountLogger,
|
|
83987
84023
|
prompt: ctx.prompt
|
|
83988
|
-
})
|
|
84024
|
+
}),
|
|
84025
|
+
temporaryAccountLogger
|
|
83989
84026
|
}
|
|
83990
84027
|
});
|
|
83991
84028
|
function setProfile(profile) {
|
|
@@ -84160,7 +84197,7 @@ ${accounts.map((account) => ` \`${redactAccountName ? "(redacted)" : account.na
|
|
|
84160
84197
|
if (latchedTemporaryAccount) return latchedTemporaryAccount.account.id;
|
|
84161
84198
|
if (getAPIToken$1()) throw new UserError("You're already authenticated with Cloudflare, so `--temporary` can't be used. Temporary preview accounts are only for unauthenticated use. Either remove `--temporary` to use your existing account, or log out (and unset CLOUDFLARE_API_TOKEN) first.", { telemetryMessage: "user temporary account already authenticated" });
|
|
84162
84199
|
const { account: temporaryPreviewAccount, cached: cached$2 } = await oauthFlow.activateTemporaryAccount();
|
|
84163
|
-
logTemporaryPreviewAccount(
|
|
84200
|
+
logTemporaryPreviewAccount(temporaryAccountLogger, temporaryPreviewAccount, cached$2);
|
|
84164
84201
|
return temporaryPreviewAccount.account.id;
|
|
84165
84202
|
}
|
|
84166
84203
|
const result = await loginOrRefreshIfRequired(config$2);
|
|
@@ -84857,6 +84894,8 @@ var CF_CLIENT_REGISTERED_SCOPES = [
|
|
|
84857
84894
|
"zone-disable-esc.write",
|
|
84858
84895
|
"zone-dns-settings.read",
|
|
84859
84896
|
"zone-dns-settings.write",
|
|
84897
|
+
"zone-observability.read",
|
|
84898
|
+
"zone-observability.write",
|
|
84860
84899
|
"zone-security-center-insights.read",
|
|
84861
84900
|
"zone-security-center-insights.write",
|
|
84862
84901
|
"zone-settings.read",
|
|
@@ -85204,7 +85243,7 @@ var require_command_exists = /* @__PURE__ */ __commonJS$3({ "../../node_modules/
|
|
|
85204
85243
|
}) });
|
|
85205
85244
|
|
|
85206
85245
|
//#endregion
|
|
85207
|
-
//#region ../deploy-helpers/dist/chunk-
|
|
85246
|
+
//#region ../deploy-helpers/dist/chunk-DSGVRFIS.mjs
|
|
85208
85247
|
var import_undici$1 = require_undici();
|
|
85209
85248
|
var import_command_exists = require_command_exists();
|
|
85210
85249
|
createRequire(import.meta.url || (typeof __filename === "string" ? __filename : "/"));
|
|
@@ -85251,6 +85290,7 @@ function createWorkerUploadForm(worker, bindings, options) {
|
|
|
85251
85290
|
const assetConfig = {
|
|
85252
85291
|
html_handling: assets?.assetConfig?.html_handling,
|
|
85253
85292
|
not_found_handling: assets?.assetConfig?.not_found_handling,
|
|
85293
|
+
base_path: assets?.assetConfig?.base_path,
|
|
85254
85294
|
run_worker_first: assets?.run_worker_first,
|
|
85255
85295
|
_redirects: assets?._redirects,
|
|
85256
85296
|
_headers: assets?._headers
|
|
@@ -85774,7 +85814,7 @@ __name(createWorkerUploadForm, "createWorkerUploadForm");
|
|
|
85774
85814
|
//#endregion
|
|
85775
85815
|
//#region ../remote-bindings/dist/index.mjs
|
|
85776
85816
|
var import_undici = require_undici();
|
|
85777
|
-
var version$2 = "0.0.
|
|
85817
|
+
var version$2 = "0.0.44";
|
|
85778
85818
|
var NoDefaultValueProvided = class extends UserError {
|
|
85779
85819
|
constructor() {
|
|
85780
85820
|
super("This command cannot be run in a non-interactive context", { telemetryMessage: "remote bindings prompt default missing" });
|