@depup/cloudflare__vite-plugin 1.62.5-depup.3 → 1.63.0-depup.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 +3 -4
- package/changes.json +2 -6
- package/dist/index.d.mts +2 -0
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +58 -28
- package/dist/index.mjs.map +1 -1
- package/dist/{package-lawJwEL5.mjs → package-CE3IVRQw.mjs} +2 -2
- package/dist/{package-lawJwEL5.mjs.map → package-CE3IVRQw.mjs.map} +1 -1
- package/package.json +15 -19
package/README.md
CHANGED
|
@@ -13,16 +13,15 @@ npm install @depup/cloudflare__vite-plugin
|
|
|
13
13
|
|
|
14
14
|
| Field | Value |
|
|
15
15
|
|-------|-------|
|
|
16
|
-
| Original | [@cloudflare/vite-plugin](https://www.npmjs.com/package/@cloudflare/vite-plugin) @ 1.
|
|
17
|
-
| Processed | 2026-10-
|
|
16
|
+
| Original | [@cloudflare/vite-plugin](https://www.npmjs.com/package/@cloudflare/vite-plugin) @ 1.63.0 |
|
|
17
|
+
| Processed | 2026-10-07 |
|
|
18
18
|
| Smoke test | failed |
|
|
19
|
-
| Deps updated |
|
|
19
|
+
| Deps updated | 1 |
|
|
20
20
|
|
|
21
21
|
## Dependency Changes
|
|
22
22
|
|
|
23
23
|
| Dependency | From | To |
|
|
24
24
|
|------------|------|-----|
|
|
25
|
-
| workerd | 1.20261001.1 | ^1.20261006.1 |
|
|
26
25
|
| ws | 8.21.0 | ^8.22.0 |
|
|
27
26
|
|
|
28
27
|
---
|
package/changes.json
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"bumped": {
|
|
3
|
-
"workerd": {
|
|
4
|
-
"from": "1.20261001.1",
|
|
5
|
-
"to": "^1.20261006.1"
|
|
6
|
-
},
|
|
7
3
|
"ws": {
|
|
8
4
|
"from": "8.21.0",
|
|
9
5
|
"to": "^8.22.0"
|
|
10
6
|
}
|
|
11
7
|
},
|
|
12
|
-
"timestamp": "2026-10-
|
|
13
|
-
"totalUpdated":
|
|
8
|
+
"timestamp": "2026-10-07T00:35:58.190Z",
|
|
9
|
+
"totalUpdated": 1
|
|
14
10
|
}
|
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,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;AAEwB;AASd;;AAeE,iBCXE,UAAA,CDWF,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;
|
|
@@ -45652,7 +45662,7 @@ function mapWorkerMetadataBindings(bindings) {
|
|
|
45652
45662
|
}, {});
|
|
45653
45663
|
}
|
|
45654
45664
|
__name$6(mapWorkerMetadataBindings, "mapWorkerMetadataBindings");
|
|
45655
|
-
var DEFAULT_COMPAT_DATE = "2026-10-
|
|
45665
|
+
var DEFAULT_COMPAT_DATE = "2026-10-06";
|
|
45656
45666
|
function constructWranglerConfig(config$2) {
|
|
45657
45667
|
const mappedBindings = mapWorkerMetadataBindings(config$2.bindings);
|
|
45658
45668
|
const durableObjectClassNames = config$2.bindings.filter((binding) => binding.type === "durable_object_namespace" && binding.script_name === config$2.name).map((durableObject) => durableObject.class_name);
|
|
@@ -47586,6 +47596,7 @@ function startTunnel(options) {
|
|
|
47586
47596
|
const reminderIntervalMs = options.reminderIntervalMs ?? DEFAULT_TUNNEL_REMINDER_INTERVAL_MS;
|
|
47587
47597
|
const defaultExpiryMs = options.expiryMs ?? DEFAULT_TUNNEL_EXPIRY_MS;
|
|
47588
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" });
|
|
47589
47600
|
const timeFormatter = new Intl.DateTimeFormat(void 0, { timeStyle: "short" });
|
|
47590
47601
|
const readyPromise = spawnCloudflared(isNamedTunnel ? [
|
|
47591
47602
|
"tunnel",
|
|
@@ -47595,7 +47606,8 @@ function startTunnel(options) {
|
|
|
47595
47606
|
"tunnel",
|
|
47596
47607
|
"--no-autoupdate",
|
|
47597
47608
|
"--url",
|
|
47598
|
-
options.origin.href
|
|
47609
|
+
options.origin.href,
|
|
47610
|
+
...(options.allowedMail ?? []).flatMap((allowedMail) => ["--allowed-mail", allowedMail])
|
|
47599
47611
|
], {
|
|
47600
47612
|
stdio: "pipe",
|
|
47601
47613
|
env: options.token ? { TUNNEL_TOKEN: options.token } : void 0,
|
|
@@ -51361,7 +51373,7 @@ var qr_default = encodeQR;
|
|
|
51361
51373
|
//#endregion
|
|
51362
51374
|
//#region src/plugins/tunnel.ts
|
|
51363
51375
|
function createPublicExposureWarning(mode, name, shortcutPressed) {
|
|
51364
|
-
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:");
|
|
51365
51377
|
const concerns = [
|
|
51366
51378
|
"Call ungated endpoints",
|
|
51367
51379
|
"Trigger logic that uses remote bindings",
|
|
@@ -51385,19 +51397,23 @@ function createPublicExposureWarning(mode, name, shortcutPressed) {
|
|
|
51385
51397
|
}
|
|
51386
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.";
|
|
51387
51399
|
const QUICK_TUNNEL_ALLOWED_HOST = ".trycloudflare.com";
|
|
51400
|
+
function normalizeAllowedMail(allowedMail) {
|
|
51401
|
+
return allowedMail?.length ? allowedMail : void 0;
|
|
51402
|
+
}
|
|
51388
51403
|
var TunnelManager = class {
|
|
51389
51404
|
#logger;
|
|
51390
51405
|
#origin;
|
|
51391
51406
|
#publicUrls;
|
|
51392
51407
|
#requestedTunnel;
|
|
51408
|
+
#requestedAllowedMail;
|
|
51393
51409
|
#tunnel;
|
|
51394
51410
|
#abortController;
|
|
51395
51411
|
#hasWarnedAboutSse = false;
|
|
51396
51412
|
constructor(logger$2) {
|
|
51397
51413
|
this.#logger = logger$2;
|
|
51398
51414
|
}
|
|
51399
|
-
isStarted(origin, name) {
|
|
51400
|
-
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));
|
|
51401
51417
|
}
|
|
51402
51418
|
isOpen() {
|
|
51403
51419
|
if (!this.#tunnel) return this.#origin !== void 0;
|
|
@@ -51409,12 +51425,14 @@ var TunnelManager = class {
|
|
|
51409
51425
|
return isOpen;
|
|
51410
51426
|
}
|
|
51411
51427
|
async startTunnel(options) {
|
|
51428
|
+
const allowedMail = normalizeAllowedMail(options.allowedMail);
|
|
51412
51429
|
try {
|
|
51413
51430
|
if (this.#tunnel) this.dispose();
|
|
51414
51431
|
const abortController = new AbortController();
|
|
51415
51432
|
this.#abortController = abortController;
|
|
51416
51433
|
this.#origin = options.origin;
|
|
51417
51434
|
this.#requestedTunnel = options.name;
|
|
51435
|
+
this.#requestedAllowedMail = allowedMail ? [...allowedMail] : void 0;
|
|
51418
51436
|
this.#logger.info(import_picocolors$5.default.dim("\n ➜ Starting tunnel (usually takes a few seconds)...\n"));
|
|
51419
51437
|
this.#logger.warn(createPublicExposureWarning(options.mode, options.name, options.shortcutPressed ?? false));
|
|
51420
51438
|
const namedTunnel = options.name !== void 0 ? await wrangler.unstable_resolveNamedTunnel(options.name, new URL(options.origin), {
|
|
@@ -51437,6 +51455,7 @@ Add \`${QUICK_TUNNEL_ALLOWED_HOST}\` to \`preview.allowedHosts\` in your Vite co
|
|
|
51437
51455
|
const tunnel = startTunnel({
|
|
51438
51456
|
origin: new URL(options.origin),
|
|
51439
51457
|
token: namedTunnel?.token,
|
|
51458
|
+
allowedMail,
|
|
51440
51459
|
extendHint: "Press a + enter to extend by 1 hour.",
|
|
51441
51460
|
logger: {
|
|
51442
51461
|
log: (message) => this.#logger.info(message),
|
|
@@ -51489,6 +51508,7 @@ Add \`${QUICK_TUNNEL_ALLOWED_HOST}\` to \`preview.allowedHosts\` in your Vite co
|
|
|
51489
51508
|
this.#origin = void 0;
|
|
51490
51509
|
this.#publicUrls = void 0;
|
|
51491
51510
|
this.#requestedTunnel = void 0;
|
|
51511
|
+
this.#requestedAllowedMail = void 0;
|
|
51492
51512
|
this.#tunnel = void 0;
|
|
51493
51513
|
this.#hasWarnedAboutSse = false;
|
|
51494
51514
|
debuglog("Disposing tunnel...");
|
|
@@ -51585,7 +51605,7 @@ async function resolvePreviewTunnelOrigin(server) {
|
|
|
51585
51605
|
async function setupDevTunnel(server, ctx, manager, shortcutPressed) {
|
|
51586
51606
|
const origin = await resolveDevTunnelOrigin(server);
|
|
51587
51607
|
const tunnel = ctx.resolvedPluginConfig.tunnel;
|
|
51588
|
-
if (manager.isStarted(origin, tunnel.name)) {
|
|
51608
|
+
if (manager.isStarted(origin, tunnel.name, tunnel.allowedMail)) {
|
|
51589
51609
|
debuglog("Tunnel is already started on", origin);
|
|
51590
51610
|
return;
|
|
51591
51611
|
}
|
|
@@ -51594,6 +51614,7 @@ async function setupDevTunnel(server, ctx, manager, shortcutPressed) {
|
|
|
51594
51614
|
origin,
|
|
51595
51615
|
shortcutPressed,
|
|
51596
51616
|
name: tunnel.name,
|
|
51617
|
+
allowedMail: tunnel.allowedMail,
|
|
51597
51618
|
accountId: ctx.entryWorkerConfig?.account_id,
|
|
51598
51619
|
complianceRegion: ctx.entryWorkerConfig?.compliance_region,
|
|
51599
51620
|
allowedHosts: true
|
|
@@ -51621,7 +51642,7 @@ async function setupPreviewTunnel(server, ctx, manager, shortcutPressed) {
|
|
|
51621
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`));
|
|
51622
51643
|
const tunnel = ctx.resolvedPluginConfig.tunnel;
|
|
51623
51644
|
const origin = resolvedOrigin.toString();
|
|
51624
|
-
if (manager.isStarted(origin, tunnel.name)) {
|
|
51645
|
+
if (manager.isStarted(origin, tunnel.name, tunnel.allowedMail)) {
|
|
51625
51646
|
debuglog("Tunnel is already started on", origin);
|
|
51626
51647
|
return;
|
|
51627
51648
|
}
|
|
@@ -51630,6 +51651,7 @@ async function setupPreviewTunnel(server, ctx, manager, shortcutPressed) {
|
|
|
51630
51651
|
origin,
|
|
51631
51652
|
shortcutPressed,
|
|
51632
51653
|
name: tunnel.name,
|
|
51654
|
+
allowedMail: tunnel.allowedMail,
|
|
51633
51655
|
allowedHosts: preview?.allowedHosts,
|
|
51634
51656
|
accountId: ctx.allWorkerConfigs[0]?.account_id,
|
|
51635
51657
|
complianceRegion: ctx.allWorkerConfigs[0]?.compliance_region
|
|
@@ -56627,6 +56649,7 @@ const AssetsSchema = strictObject({
|
|
|
56627
56649
|
"404-page",
|
|
56628
56650
|
"none"
|
|
56629
56651
|
]).optional(),
|
|
56652
|
+
basePath: string().optional(),
|
|
56630
56653
|
runWorkerFirst: union([array(string()), boolean()]).optional()
|
|
56631
56654
|
});
|
|
56632
56655
|
const BrowserBindingSchema = strictObject({
|
|
@@ -57877,6 +57900,7 @@ function convertBindingsAndAssets(config$2, result) {
|
|
|
57877
57900
|
if (assetsBindingName !== void 0) assets.binding = assetsBindingName;
|
|
57878
57901
|
if (config$2.assets?.htmlHandling !== void 0) assets.html_handling = config$2.assets.htmlHandling;
|
|
57879
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;
|
|
57880
57904
|
if (config$2.assets?.runWorkerFirst !== void 0) assets.run_worker_first = config$2.assets.runWorkerFirst;
|
|
57881
57905
|
result.assets = assets;
|
|
57882
57906
|
}
|
|
@@ -65986,13 +66010,17 @@ function resolveWorkerConfig(options) {
|
|
|
65986
66010
|
});
|
|
65987
66011
|
}
|
|
65988
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
|
+
}
|
|
65989
66016
|
const resolvedNewConfig = normalizeNewConfig(pluginConfig.experimental?.newConfig);
|
|
65990
66017
|
const shared = {
|
|
65991
66018
|
persistState: pluginConfig.persistState ?? true,
|
|
65992
66019
|
inspectorPort: pluginConfig.inspectorPort,
|
|
65993
66020
|
tunnel: typeof pluginConfig.tunnel === "boolean" ? { autoStart: pluginConfig.tunnel } : {
|
|
65994
66021
|
autoStart: pluginConfig.tunnel?.autoStart ?? false,
|
|
65995
|
-
name: pluginConfig.tunnel?.name
|
|
66022
|
+
name: pluginConfig.tunnel?.name,
|
|
66023
|
+
allowedMail: pluginConfig.tunnel?.allowedMail?.length ? pluginConfig.tunnel.allowedMail : void 0
|
|
65996
66024
|
},
|
|
65997
66025
|
experimental: {
|
|
65998
66026
|
headersAndRedirectsDevModeSupport: pluginConfig.experimental?.headersAndRedirectsDevModeSupport,
|
|
@@ -80765,7 +80793,7 @@ var __name$1 = (target$1, value) => __defProp$1(target$1, "name", {
|
|
|
80765
80793
|
});
|
|
80766
80794
|
|
|
80767
80795
|
//#endregion
|
|
80768
|
-
//#region ../workers-auth/dist/chunk-
|
|
80796
|
+
//#region ../workers-auth/dist/chunk-NDZDTP46.mjs
|
|
80769
80797
|
var import_undici$2 = require_undici();
|
|
80770
80798
|
createRequire(import.meta.url || (typeof __filename === "string" ? __filename : "/"));
|
|
80771
80799
|
var hasWarnedAboutDeprecatedV1ApiToken = false;
|
|
@@ -81160,7 +81188,7 @@ function getCachedTemporaryPreviewAccount(storage) {
|
|
|
81160
81188
|
return temporaryPreviewAccount;
|
|
81161
81189
|
}
|
|
81162
81190
|
__name$1(getCachedTemporaryPreviewAccount, "getCachedTemporaryPreviewAccount");
|
|
81163
|
-
async function requestPowSolution(
|
|
81191
|
+
async function requestPowSolution(temporaryAccountLogger) {
|
|
81164
81192
|
const response = await (0, import_undici$2.fetch)(getTemporaryPreviewChallengeUrl(), {
|
|
81165
81193
|
method: "POST",
|
|
81166
81194
|
headers: { "Content-Type": "application/json" },
|
|
@@ -81176,7 +81204,7 @@ async function requestPowSolution(logger$2) {
|
|
|
81176
81204
|
const { challengeToken, seed, k, g } = body.result ?? {};
|
|
81177
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" });
|
|
81178
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" });
|
|
81179
|
-
|
|
81207
|
+
temporaryAccountLogger.log("Solving proof-of-work challenge…");
|
|
81180
81208
|
return solveChallenge({
|
|
81181
81209
|
challengeToken,
|
|
81182
81210
|
seed,
|
|
@@ -81185,8 +81213,8 @@ async function requestPowSolution(logger$2) {
|
|
|
81185
81213
|
});
|
|
81186
81214
|
}
|
|
81187
81215
|
__name$1(requestPowSolution, "requestPowSolution");
|
|
81188
|
-
async function createTemporaryPreviewAccount(
|
|
81189
|
-
const pow = await requestPowSolution(
|
|
81216
|
+
async function createTemporaryPreviewAccount(temporaryAccountLogger, request$2) {
|
|
81217
|
+
const pow = await requestPowSolution(temporaryAccountLogger);
|
|
81190
81218
|
const response = await (0, import_undici$2.fetch)(getTemporaryPreviewUrl(), {
|
|
81191
81219
|
method: "POST",
|
|
81192
81220
|
headers: { "Content-Type": "application/json" },
|
|
@@ -81246,7 +81274,7 @@ async function getOrCreateTemporaryPreviewAccount(options) {
|
|
|
81246
81274
|
};
|
|
81247
81275
|
}
|
|
81248
81276
|
if (!await options.prompt(TEMPORARY_TERMS_PROMPT, TEMPORARY_TERMS_NOTICE)) throw new UserError(TEMPORARY_TERMS_ERROR, { telemetryMessage: "user temporary terms not accepted" });
|
|
81249
|
-
const temporaryPreviewAccount = await createTemporaryPreviewAccount(options.
|
|
81277
|
+
const temporaryPreviewAccount = await createTemporaryPreviewAccount(options.temporaryAccountLogger, options.request);
|
|
81250
81278
|
options.storage.write(temporaryPreviewAccount);
|
|
81251
81279
|
return {
|
|
81252
81280
|
account: temporaryPreviewAccount,
|
|
@@ -82201,7 +82229,6 @@ function createOAuthFlow(ctx) {
|
|
|
82201
82229
|
if (!ctx.temporary) throw new UserError("Temporary preview accounts are not supported by this CLI.", { telemetryMessage: "user temporary account unsupported" });
|
|
82202
82230
|
const result = await getOrCreateTemporaryPreviewAccount({
|
|
82203
82231
|
...ctx.temporary,
|
|
82204
|
-
logger: ctx.logger,
|
|
82205
82232
|
...temporaryRequest ? { request: temporaryRequest } : {}
|
|
82206
82233
|
});
|
|
82207
82234
|
activeTemporaryAccount = result.account;
|
|
@@ -83239,7 +83266,7 @@ function scrubEncryptedCredentials(options) {
|
|
|
83239
83266
|
__name$1(scrubEncryptedCredentials, "scrubEncryptedCredentials");
|
|
83240
83267
|
|
|
83241
83268
|
//#endregion
|
|
83242
|
-
//#region ../workers-auth/dist/chunk-
|
|
83269
|
+
//#region ../workers-auth/dist/chunk-PGZZHNWG.mjs
|
|
83243
83270
|
createRequire(import.meta.url || (typeof __filename === "string" ? __filename : "/"));
|
|
83244
83271
|
function createPreferences(getConfigPath) {
|
|
83245
83272
|
function getUserPreferencesPath() {
|
|
@@ -83916,10 +83943,10 @@ function createFileStorage(format$3, getPath) {
|
|
|
83916
83943
|
}
|
|
83917
83944
|
__name$1(createFileStorage, "createFileStorage");
|
|
83918
83945
|
function createTemporaryTermsPrompt(deps) {
|
|
83919
|
-
const {
|
|
83946
|
+
const { temporaryAccountLogger, prompt } = deps;
|
|
83920
83947
|
return /* @__PURE__ */ __name$1(async function ensureTemporaryTermsAccepted(question, notice) {
|
|
83921
83948
|
if (isNonInteractiveOrCI()) {
|
|
83922
|
-
|
|
83949
|
+
temporaryAccountLogger.log(notice);
|
|
83923
83950
|
return true;
|
|
83924
83951
|
}
|
|
83925
83952
|
const answer = await prompt(question);
|
|
@@ -83947,9 +83974,9 @@ function notLoggedInErrorBodies(loginCommand) {
|
|
|
83947
83974
|
};
|
|
83948
83975
|
}
|
|
83949
83976
|
__name$1(notLoggedInErrorBodies, "notLoggedInErrorBodies");
|
|
83950
|
-
function logTemporaryPreviewAccount(
|
|
83977
|
+
function logTemporaryPreviewAccount(temporaryAccountLogger, temporaryPreviewAccount, cached$2) {
|
|
83951
83978
|
const claimExpiresAt = new Date(temporaryPreviewAccount.claim.expiresAt);
|
|
83952
|
-
|
|
83979
|
+
temporaryAccountLogger.log(dedent`
|
|
83953
83980
|
Temporary account ready:
|
|
83954
83981
|
Account: ${temporaryPreviewAccount.account.name} (${cached$2 ? "reused" : "created"})
|
|
83955
83982
|
Claim within: ${formatDistanceToNowStrict(claimExpiresAt)}
|
|
@@ -83959,6 +83986,7 @@ function logTemporaryPreviewAccount(logger$2, temporaryPreviewAccount, cached$2)
|
|
|
83959
83986
|
__name$1(logTemporaryPreviewAccount, "logTemporaryPreviewAccount");
|
|
83960
83987
|
function createCloudflareAuth(descriptor, ctx) {
|
|
83961
83988
|
const { logger: logger$2 } = ctx;
|
|
83989
|
+
const temporaryAccountLogger = ctx.temporaryAccountLogger ?? logger$2;
|
|
83962
83990
|
const cliName = descriptor.cliName;
|
|
83963
83991
|
const NOT_LOGGED_IN_ERROR_BODIES = notLoggedInErrorBodies(descriptor.commands.login);
|
|
83964
83992
|
const NOT_LOGGED_IN_WHOAMI_TIP = `
|
|
@@ -83991,9 +84019,10 @@ Run \`${descriptor.commands.whoami}\` to check your current authentication statu
|
|
|
83991
84019
|
temporary: {
|
|
83992
84020
|
storage: createFileStorage(descriptor.fileFormat, descriptor.getTemporaryAccountConfigPath),
|
|
83993
84021
|
prompt: createTemporaryTermsPrompt({
|
|
83994
|
-
|
|
84022
|
+
temporaryAccountLogger,
|
|
83995
84023
|
prompt: ctx.prompt
|
|
83996
|
-
})
|
|
84024
|
+
}),
|
|
84025
|
+
temporaryAccountLogger
|
|
83997
84026
|
}
|
|
83998
84027
|
});
|
|
83999
84028
|
function setProfile(profile) {
|
|
@@ -84168,7 +84197,7 @@ ${accounts.map((account) => ` \`${redactAccountName ? "(redacted)" : account.na
|
|
|
84168
84197
|
if (latchedTemporaryAccount) return latchedTemporaryAccount.account.id;
|
|
84169
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" });
|
|
84170
84199
|
const { account: temporaryPreviewAccount, cached: cached$2 } = await oauthFlow.activateTemporaryAccount();
|
|
84171
|
-
logTemporaryPreviewAccount(
|
|
84200
|
+
logTemporaryPreviewAccount(temporaryAccountLogger, temporaryPreviewAccount, cached$2);
|
|
84172
84201
|
return temporaryPreviewAccount.account.id;
|
|
84173
84202
|
}
|
|
84174
84203
|
const result = await loginOrRefreshIfRequired(config$2);
|
|
@@ -85214,7 +85243,7 @@ var require_command_exists = /* @__PURE__ */ __commonJS$3({ "../../node_modules/
|
|
|
85214
85243
|
}) });
|
|
85215
85244
|
|
|
85216
85245
|
//#endregion
|
|
85217
|
-
//#region ../deploy-helpers/dist/chunk-
|
|
85246
|
+
//#region ../deploy-helpers/dist/chunk-DSGVRFIS.mjs
|
|
85218
85247
|
var import_undici$1 = require_undici();
|
|
85219
85248
|
var import_command_exists = require_command_exists();
|
|
85220
85249
|
createRequire(import.meta.url || (typeof __filename === "string" ? __filename : "/"));
|
|
@@ -85261,6 +85290,7 @@ function createWorkerUploadForm(worker, bindings, options) {
|
|
|
85261
85290
|
const assetConfig = {
|
|
85262
85291
|
html_handling: assets?.assetConfig?.html_handling,
|
|
85263
85292
|
not_found_handling: assets?.assetConfig?.not_found_handling,
|
|
85293
|
+
base_path: assets?.assetConfig?.base_path,
|
|
85264
85294
|
run_worker_first: assets?.run_worker_first,
|
|
85265
85295
|
_redirects: assets?._redirects,
|
|
85266
85296
|
_headers: assets?._headers
|
|
@@ -85784,7 +85814,7 @@ __name(createWorkerUploadForm, "createWorkerUploadForm");
|
|
|
85784
85814
|
//#endregion
|
|
85785
85815
|
//#region ../remote-bindings/dist/index.mjs
|
|
85786
85816
|
var import_undici = require_undici();
|
|
85787
|
-
var version$2 = "0.0.
|
|
85817
|
+
var version$2 = "0.0.44";
|
|
85788
85818
|
var NoDefaultValueProvided = class extends UserError {
|
|
85789
85819
|
constructor() {
|
|
85790
85820
|
super("This command cannot be run in a non-interactive context", { telemetryMessage: "remote bindings prompt default missing" });
|