void 0.25.0 → 0.26.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/{account-cmd-DcR1ywt8.mjs → account-cmd-CDry3B5V.mjs} +4 -4
- package/dist/{application-analysis-BVsVqc11.mjs → application-analysis-DC2yPvzY.mjs} +1 -1
- package/dist/{application-routing-B7QEjqSR.mjs → application-routing-C9khgLiS.mjs} +1 -1
- package/dist/{auth-CdgZ9uag.mjs → auth-B60QDbjg.mjs} +1 -1
- package/dist/{auth-7wuZ5ob8.mjs → auth-D52yG7hl.mjs} +3 -3
- package/dist/{auth-link-Z6E5DYvM.mjs → auth-link-DjeOptYi.mjs} +4 -4
- package/dist/{auth-router-BdM4avI8.mjs → auth-router-BRxIuqDi.mjs} +5 -5
- package/dist/{build-cmd-CEE7D-hM.mjs → build-cmd-Ce3C8huo.mjs} +4 -4
- package/dist/{cache-TcZnBLtH.mjs → cache-CS8Yxr5a.mjs} +4 -4
- package/dist/{cancel-deploy-CYoZmcmR.mjs → cancel-deploy-mZsD88Xa.mjs} +3 -3
- package/dist/{cf-access-AHKBzmuu.mjs → cf-access-YTlqvAsk.mjs} +1 -1
- package/dist/cli/cli.mjs +40 -40
- package/dist/cli/cloudflare-operation-process.mjs +1 -1
- package/dist/cli/env-schema-probe.d.mts +1 -1
- package/dist/client-BxVixJBI.mjs +2 -0
- package/dist/{client-RsPo8wsP.mjs → client-mC-dFGDD.mjs} +5 -5
- package/dist/{cloudflare-operations-CjaV4lZi.mjs → cloudflare-operations-DYa3coIk.mjs} +1 -1
- package/dist/{cloudflare-operations-BhbK6yTq.mjs → cloudflare-operations-DoQrVHAt.mjs} +1 -1
- package/dist/{connect-DCvUmPXY.mjs → connect-H6EvP62X.mjs} +6 -6
- package/dist/{create-project-eAPgYq35.mjs → create-project-B2kk9Q0o.mjs} +4 -4
- package/dist/{create-project-C734I-Mu.mjs → create-project-Dbb4uiN-.mjs} +1 -1
- package/dist/{db-C07GEdKF.mjs → db-DpCKZto0.mjs} +21 -21
- package/dist/{delete-pKMVsrpJ.mjs → delete-CxlSvsvW.mjs} +6 -6
- package/dist/{deploy-DfsAe-T0.mjs → deploy-CeEbnv4b.mjs} +38 -24
- package/dist/{deploy-BDu1vhSH.mjs → deploy-qmiLE1G1.mjs} +1 -1
- package/dist/{domain-D3uA9ize.mjs → domain-B_9VgOm6.mjs} +6 -6
- package/dist/{email-z3o2cwjH.mjs → email-BokHgjKj.mjs} +6 -6
- package/dist/{env-3Q8-_2IH.mjs → env-BdTc-K2L.mjs} +6 -5
- package/dist/{env-public-BX_r8HR6.d.mts → env-public-DR7ZM6d-.d.mts} +1 -1
- package/dist/{fetch-stream-IvCYKyQL.mjs → fetch-stream-Nm3hkZbT.mjs} +8 -1
- package/dist/{gen-NjwoG9FK.mjs → gen-BhDlTpwW.mjs} +1 -1
- package/dist/gen-qCBwH3fZ.mjs +2 -0
- package/dist/{github-cmd-DquUq-b1.mjs → github-cmd-hhkTzlGS.mjs} +4 -4
- package/dist/{handler-CZ4nAylQ.d.mts → handler-BeK3weD4.d.mts} +1 -1
- package/dist/{help-DRZXC4fj.mjs → help-Bv44e2tm.mjs} +13 -9
- package/dist/help-Dw5f9Xrg.mjs +2 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +30 -17
- package/dist/{info-BmA3_IFZ.mjs → info-DhtTKh65.mjs} +1 -1
- package/dist/{init-DT7yuuyl.mjs → init-BMf4T03q.mjs} +10 -9
- package/dist/{limits-Bq5LG8Id.d.mts → limits-CFsDKQvU.d.mts} +1 -10
- package/dist/{limits-Cjuk2VPm.mjs → limits-D0vD1M9A.mjs} +1 -22
- package/dist/{link-CXOlqh2F.mjs → link-BqYsSS_I.mjs} +5 -5
- package/dist/{list-eEWVJEPn.mjs → list-_kBToO-l.mjs} +7 -6
- package/dist/{live-Chw1eIMv.d.mts → live-iAuEH1hd.d.mts} +1 -1
- package/dist/{local-d1-Df4XpwhW.mjs → local-d1-fGxYrVD6.mjs} +1 -1
- package/dist/login-D7meQg_3.mjs +2 -0
- package/dist/{login-pWQHYVu2.mjs → login-DFuo-RWO.mjs} +4 -4
- package/dist/{logs-DnxVX7TR.mjs → logs-DYgnh6dH.mjs} +5 -5
- package/dist/{node-BkyRWRx8.mjs → node-C6Q6e1Es.mjs} +1 -1
- package/dist/{operator-args-CAVcmwUt.mjs → operator-args-DdY54Bgb.mjs} +1 -1
- package/dist/{operator-auth-CkmTE3rt.mjs → operator-auth-2dsGlTT5.mjs} +4 -8
- package/dist/{operator-client-LmwjxT6q.mjs → operator-client-BFqpp6z0.mjs} +3 -3
- package/dist/{operator-cmd-d-IEKgNk.mjs → operator-cmd-CUGHXrQf.mjs} +27 -9
- package/dist/operator-cmd-DRPvhpjM.mjs +2 -0
- package/dist/{output-BBsUwdyT.mjs → output-BvdaehtE.mjs} +26 -2
- package/dist/pages/client.d.mts +1 -1
- package/dist/pages/index.mjs +1 -1
- package/dist/pages/islands-plugin.mjs +1 -1
- package/dist/pages/protocol.d.mts +2 -2
- package/dist/{plan-NPpwZ_kc.mjs → plan-CJGEeTEI.mjs} +2 -2
- package/dist/plan-COtUvdMA.mjs +2 -0
- package/dist/{platform-args-Bzf8JPc2.mjs → platform-args-DSV2p4nY.mjs} +4 -2
- package/dist/platform-args-Dcy_5b_Y.mjs +2 -0
- package/dist/{platform-auth-config-0V0lA3pF.mjs → platform-auth-config-Bosx7U1h.mjs} +18 -17
- package/dist/{platform-auth-protection-DFeJ-JkK.mjs → platform-auth-protection-DcbL_LW_.mjs} +6 -6
- package/dist/{platform-auth-recovery-ICy4muq6.mjs → platform-auth-recovery-WfTZ8K6o.mjs} +5 -5
- package/dist/{platform-cmd-D7vSWMvV.mjs → platform-cmd-DbKtQb_4.mjs} +45 -20
- package/dist/{platform-cmd-BPySFOew.mjs → platform-cmd-dyFUof0t.mjs} +1 -1
- package/dist/{platform-discovery-DDDUvnqp.mjs → platform-discovery-BC0HCKYt.mjs} +18 -4
- package/dist/{platform-domain-CUdY064e.mjs → platform-domain-Bsq43AJp.mjs} +5 -4
- package/dist/{platform-lifecycle-BaUdTRPU.mjs → platform-lifecycle--5gWmDoI.mjs} +1 -1
- package/dist/{platform-lifecycle-Dm09JNkn.mjs → platform-lifecycle-Cfi0o6xM.mjs} +863 -35
- package/dist/{platform-management-Bp6aoH2C.mjs → platform-management-Bbwf6-Dq.mjs} +1 -1
- package/dist/{platform-management-BSEc_ZeG.mjs → platform-management-BrF9STZp.mjs} +173 -30
- package/dist/{platform-plans-config-B0pOVQyW.mjs → platform-plans-config-DU-8nC2Y.mjs} +2 -2
- package/dist/{platform-recovery-WOZ95Uze.mjs → platform-recovery-DQAqAQYu.mjs} +3 -3
- package/dist/{platform-registry-KfNEF84O.mjs → platform-registry-P387v42A.mjs} +17 -10
- package/dist/prepare-BBknoZI1.mjs +2 -0
- package/dist/{prepare-39EvOhI6.mjs → prepare-BMrRWLwP.mjs} +3 -2
- package/dist/{prepare-DnaKBi--.mjs → prepare-WoUubFKL.mjs} +1 -1
- package/dist/{project-IOjBU8R6.mjs → project-BiaPQ7ur.mjs} +1 -1
- package/dist/{project-BkbfDs0V.mjs → project-DQstYTxO.mjs} +1 -1
- package/dist/{project-cmd-Bs5A392E.mjs → project-cmd-BbH2LptN.mjs} +18 -18
- package/dist/{project-team-ohAWWaew.mjs → project-team-Yiww3-go.mjs} +5 -5
- package/dist/{project-token-CP01Jna6.mjs → project-token-BrtT2NkY.mjs} +4 -4
- package/dist/{project-zero-trust-BzkVgx35.mjs → project-zero-trust-nYJ2V2nc.mjs} +5 -5
- package/dist/{protocol-CjF_iI9X.d.mts → protocol-BX8t2jiw.d.mts} +1 -1
- package/dist/{provision-BEv0k-qz.mjs → provision-DMTPG8Rh.mjs} +1 -1
- package/dist/{provision-Btj1jppf.mjs → provision-VeqAC77A.mjs} +13 -1
- package/dist/{requests-B3PBuGlX.mjs → requests-TIz_jtSu.mjs} +4 -4
- package/dist/{rollback-DDub9GsO.mjs → rollback-dBqICPzj.mjs} +5 -5
- package/dist/{runner-Ol0TNjk6.mjs → runner--2KF6Kua.mjs} +1 -1
- package/dist/{runner-CXA9Fh8h.mjs → runner-voIltZrY.mjs} +1 -1
- package/dist/runtime/ai.d.mts +10 -11
- package/dist/runtime/ai.mjs +13 -18
- package/dist/runtime/client-react.mjs +1 -1
- package/dist/runtime/client-solid.mjs +1 -1
- package/dist/runtime/client-svelte.mjs +1 -1
- package/dist/runtime/client-vue.mjs +1 -1
- package/dist/runtime/client.mjs +1 -1
- package/dist/runtime/env-public.d.mts +1 -1
- package/dist/runtime/fetch-stream.mjs +1 -1
- package/dist/runtime/handler.d.mts +1 -1
- package/dist/runtime/limits.d.mts +2 -2
- package/dist/runtime/limits.mjs +2 -2
- package/dist/runtime/live-client.d.mts +1 -1
- package/dist/runtime/live.d.mts +1 -1
- package/dist/runtime/migration-handler.mjs +33 -7
- package/dist/runtime/routing.d.mts +1 -1
- package/dist/runtime/sandbox.d.mts +1 -1
- package/dist/runtime/sandbox.mjs +12 -22
- package/dist/runtime/validator.d.mts +1 -1
- package/dist/runtime/ws-server.d.mts +1 -1
- package/dist/runtime/ws.d.mts +1 -1
- package/dist/{sandbox-XZAqzFlG.d.mts → sandbox-C5LFoJMf.d.mts} +7 -7
- package/dist/{scan-C7okrLyM.mjs → scan-C8dA7iM4.mjs} +10 -6
- package/dist/{secret-3c72lY1U.mjs → secret-AKnNXNP5.mjs} +6 -6
- package/dist/{subcommand-prompt-Dhom39bd.mjs → subcommand-prompt-B6WS9Aoz.mjs} +1 -1
- package/dist/validate-pna7R3Pv.mjs +2 -0
- package/dist/{validate-ctOrgiS3.mjs → validate-ymhap6M_.mjs} +1 -1
- package/dist/{ws-CL1w7GXU.d.mts → ws-C79j4aED.d.mts} +1 -1
- package/package.json +7 -7
- package/skills/void/SKILL.md +5 -2
- package/skills/void/docs/guide/ai.md +65 -62
- package/skills/void/docs/guide/app-types.md +1 -1
- package/skills/void/docs/guide/database.md +15 -0
- package/skills/void/docs/guide/live.md +2 -0
- package/skills/void/docs/guide/pages-routing/actions-and-forms.md +1 -1
- package/skills/void/docs/guide/platform/installation/credentials.md +2 -2
- package/skills/void/docs/guide/platform/installation/first-deployment.md +5 -1
- package/skills/void/docs/guide/platform/installation/maintenance.md +3 -1
- package/skills/void/docs/guide/platform/installation/setup.md +1 -1
- package/skills/void/docs/guide/platform/installation/uninstall.md +44 -11
- package/skills/void/docs/guide/sandboxes.md +39 -20
- package/skills/void/docs/reference/api/resources.md +11 -14
- package/skills/void/docs/reference/api.md +35 -34
- package/skills/void/docs/reference/cli/auth.md +3 -1
- package/skills/void/docs/reference/cli/platform-config.md +2 -2
- package/skills/void/docs/reference/cli/platform-installation.md +14 -12
- package/skills/void/docs/reference/cli/platform.md +4 -2
- package/skills/void/docs/reference/cli.md +1 -1
- package/skills/void/docs/reference/resource-inference.md +1 -0
- package/dist/client-B4Me-9HE.mjs +0 -2
- package/dist/gen-ById9r2j.mjs +0 -2
- package/dist/help-DPGBwomV.mjs +0 -2
- package/dist/login-C98-sw79.mjs +0 -2
- package/dist/plan-D1Q5rf-r.mjs +0 -2
- package/dist/platform-args-Cq6EjQro.mjs +0 -2
- package/dist/prepare-CnjcTV2s.mjs +0 -2
- package/dist/validate-Dq_L3s0S.mjs +0 -2
|
@@ -12,16 +12,7 @@ declare class UsageLimit extends Error {
|
|
|
12
12
|
}): Response;
|
|
13
13
|
getResponse(): Response;
|
|
14
14
|
}
|
|
15
|
-
type LimitHandlers<T, R, L> = {
|
|
16
|
-
ok(value: T): R | Promise<R>;
|
|
17
|
-
limited(limit: UsageLimit): L | Promise<L>;
|
|
18
|
-
};
|
|
19
|
-
interface LimitOperation<T> {
|
|
20
|
-
match<R, L>(handlers: LimitHandlers<T, R, L>): Promise<R | L>;
|
|
21
|
-
}
|
|
22
|
-
/** Lazy, single-execution operation. Quota callbacks never catch failures from the user's ok handler. */
|
|
23
|
-
declare function limitOperation<T>(execute: () => Promise<T>, classify?: (error: unknown) => UsageLimit | null, prepare?: (value: T, limited: (limit: UsageLimit) => unknown) => T): LimitOperation<T>;
|
|
24
15
|
declare function asUsageLimit(error: unknown): UsageLimit | null;
|
|
25
16
|
declare function limitFromResponse(response: Response, resource: UsageLimitData["resource"]): Promise<UsageLimit | null>;
|
|
26
17
|
//#endregion
|
|
27
|
-
export {
|
|
18
|
+
export { readUsageLimit$1 as a, limitFromResponse as i, UsageLimitData$1 as n, asUsageLimit as r, UsageLimit as t };
|
|
@@ -25,27 +25,6 @@ var UsageLimit = class extends Error {
|
|
|
25
25
|
return this.response();
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
|
-
/** Lazy, single-execution operation. Quota callbacks never catch failures from the user's ok handler. */
|
|
29
|
-
function limitOperation(execute, classify = asUsageLimit, prepare) {
|
|
30
|
-
let result;
|
|
31
|
-
return Object.freeze({
|
|
32
|
-
get then() {
|
|
33
|
-
throw new TypeError("Use .match({ ok, limited }) to execute this operation.");
|
|
34
|
-
},
|
|
35
|
-
async match(handlers) {
|
|
36
|
-
if (typeof handlers?.ok !== "function" || typeof handlers?.limited !== "function") throw new TypeError("Both ok and limited handlers are required.");
|
|
37
|
-
let value;
|
|
38
|
-
try {
|
|
39
|
-
value = await (result ??= Promise.resolve().then(execute));
|
|
40
|
-
} catch (error) {
|
|
41
|
-
const limit = classify(error);
|
|
42
|
-
if (limit) return handlers.limited(limit);
|
|
43
|
-
throw error;
|
|
44
|
-
}
|
|
45
|
-
return handlers.ok(prepare ? prepare(value, handlers.limited) : value);
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
28
|
function asUsageLimit(error) {
|
|
50
29
|
if (error instanceof UsageLimit) return error;
|
|
51
30
|
const data = readUsageLimit(error);
|
|
@@ -65,4 +44,4 @@ async function limitFromResponse(response, resource) {
|
|
|
65
44
|
});
|
|
66
45
|
}
|
|
67
46
|
//#endregion
|
|
68
|
-
export { readUsageLimit$1 as
|
|
47
|
+
export { readUsageLimit$1 as i, asUsageLimit as n, limitFromResponse as r, UsageLimit as t };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { l as writeProjectConfig, r as readProjectConfig, t as attachSelectedPlatform } from "./project-
|
|
2
|
-
import { c as getToken, s as getSiteDomain } from "./auth-
|
|
1
|
+
import { l as writeProjectConfig, r as readProjectConfig, t as attachSelectedPlatform } from "./project-DQstYTxO.mjs";
|
|
2
|
+
import { c as getToken, s as getSiteDomain } from "./auth-D52yG7hl.mjs";
|
|
3
3
|
import { H as outro, L as log, O as cancel } from "./prompts-6OSVA7DJ.mjs";
|
|
4
|
-
import { r as PlatformClient } from "./client-
|
|
5
|
-
import { c as import_picocolors } from "./output-
|
|
6
|
-
import { a as promptProjectSelection, r as promptAndCreateProject } from "./create-project-
|
|
4
|
+
import { r as PlatformClient } from "./client-mC-dFGDD.mjs";
|
|
5
|
+
import { c as import_picocolors } from "./output-BvdaehtE.mjs";
|
|
6
|
+
import { a as promptProjectSelection, r as promptAndCreateProject } from "./create-project-B2kk9Q0o.mjs";
|
|
7
7
|
import { r as resolveProjectBySlug } from "./resolve-project-BG5ORGID.mjs";
|
|
8
8
|
//#region src/cli/link.ts
|
|
9
9
|
function projectLabel(slug, root, url) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { n as readDeploymentPlatform, r as readProjectConfig } from "./project-
|
|
2
|
-
import { c as getToken } from "./auth-
|
|
1
|
+
import { n as readDeploymentPlatform, r as readProjectConfig } from "./project-DQstYTxO.mjs";
|
|
2
|
+
import { c as getToken } from "./auth-D52yG7hl.mjs";
|
|
3
3
|
import { H as outro, L as log } from "./prompts-6OSVA7DJ.mjs";
|
|
4
|
-
import { r as PlatformClient } from "./client-
|
|
5
|
-
import { a as ensureUtc, c as import_picocolors,
|
|
4
|
+
import { r as PlatformClient } from "./client-mC-dFGDD.mjs";
|
|
5
|
+
import { a as ensureUtc, c as import_picocolors, f as tablePrefix, i as dim, o as formatCount } from "./output-BvdaehtE.mjs";
|
|
6
6
|
import { r as resolveProjectBySlug } from "./resolve-project-BG5ORGID.mjs";
|
|
7
7
|
//#region src/cli/list.ts
|
|
8
8
|
async function runListCommand(root, slug) {
|
|
@@ -42,7 +42,7 @@ async function runListCommand(root, slug) {
|
|
|
42
42
|
}
|
|
43
43
|
async function showCloudflareDeployments(root, slug) {
|
|
44
44
|
if (slug) throw new Error("project: A project name selects a Void platform project and is not used for direct Cloudflare apps.");
|
|
45
|
-
const { readCloudflareWorkerStatus, resolveCloudflareOperationContext } = await import("./cloudflare-operations-
|
|
45
|
+
const { readCloudflareWorkerStatus, resolveCloudflareOperationContext } = await import("./cloudflare-operations-DoQrVHAt.mjs");
|
|
46
46
|
const status = await readCloudflareWorkerStatus(resolveCloudflareOperationContext(root));
|
|
47
47
|
if (status.versions.length === 0) {
|
|
48
48
|
outro(`No deployments for ${status.workerName}.`);
|
|
@@ -112,7 +112,8 @@ function formatDeploymentRow(d, activeDeploymentId) {
|
|
|
112
112
|
manifest = JSON.parse(d.manifest);
|
|
113
113
|
} catch {}
|
|
114
114
|
const appType = manifest?.type ?? (manifest?.framework ? "framework" : "void");
|
|
115
|
-
const
|
|
115
|
+
const pathRuleCount = Object.keys(manifest?.pathRevalidate ?? {}).length;
|
|
116
|
+
const isr = manifest?.revalidate && manifest.revalidate > 0 ? `${manifest.revalidate}s` : pathRuleCount > 0 ? formatCount(pathRuleCount, "rule") : "-";
|
|
116
117
|
const source = d.source ?? "-";
|
|
117
118
|
const commit = d.commit ? d.commit.slice(0, 7) : "-";
|
|
118
119
|
const statusRaw = computeDisplayStatus(d, activeDeploymentId);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as AuthUser } from "./auth-DkcFflXV.mjs";
|
|
2
|
-
import { a as CloudEnv, r as CloudContext } from "./handler-
|
|
2
|
+
import { a as CloudEnv, r as CloudContext } from "./handler-BeK3weD4.mjs";
|
|
3
3
|
//#region src/runtime/live.d.ts
|
|
4
4
|
type MaybePromise<T> = T | Promise<T>;
|
|
5
5
|
type LiveControlRequest = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as join, i as isAbsolute, u as resolve } from "./dist-BVqXeR_h.mjs";
|
|
2
2
|
import { y as readRootWranglerConfig } from "./wrangler-DhUerFkW.mjs";
|
|
3
|
-
import { r as getMiniflareDatabasePath } from "./runner
|
|
3
|
+
import { r as getMiniflareDatabasePath } from "./runner--2KF6Kua.mjs";
|
|
4
4
|
import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
5
5
|
import { createHash } from "node:crypto";
|
|
6
6
|
//#region src/local-d1.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as getApiUrl, c as getToken, f as removeToken, g as saveToken, h as savePlatformToken, l as getTokenSource, m as runPlatformLogin, p as runLogin } from "./auth-
|
|
1
|
+
import { a as getApiUrl, c as getToken, f as removeToken, g as saveToken, h as savePlatformToken, l as getTokenSource, m as runPlatformLogin, p as runLogin } from "./auth-D52yG7hl.mjs";
|
|
2
2
|
import { H as outro, K as select, L as log, O as cancel, tt as isCancel } from "./prompts-6OSVA7DJ.mjs";
|
|
3
|
-
import { a as isExpiredTokenError, r as PlatformClient } from "./client-
|
|
4
|
-
import { c as import_picocolors, r as createSpinner } from "./output-
|
|
3
|
+
import { a as isExpiredTokenError, r as PlatformClient } from "./client-mC-dFGDD.mjs";
|
|
4
|
+
import { c as import_picocolors, r as createSpinner } from "./output-BvdaehtE.mjs";
|
|
5
5
|
//#region src/cli/login.ts
|
|
6
6
|
async function selectPlatformLoginMethod(platform, requestedId) {
|
|
7
7
|
const providers = platform?.authenticationProviders ?? ["github", "google"];
|
|
@@ -29,7 +29,7 @@ async function selectPlatformLoginMethod(platform, requestedId) {
|
|
|
29
29
|
return methods.find((method) => method.id === provider);
|
|
30
30
|
}
|
|
31
31
|
async function promptForLoginToken(root = process.cwd(), platform) {
|
|
32
|
-
const { id: provider, label: providerName } = await selectPlatformLoginMethod(platform ?? await import("./platform-cmd-
|
|
32
|
+
const { id: provider, label: providerName } = await selectPlatformLoginMethod(platform ?? await import("./platform-cmd-dyFUof0t.mjs").then(({ discoverPlatform }) => discoverPlatform(getApiUrl(root))));
|
|
33
33
|
const s = createSpinner();
|
|
34
34
|
s.start(`Opening browser for ${providerName} login...`);
|
|
35
35
|
try {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { n as readDeploymentPlatform, r as readProjectConfig } from "./project-
|
|
2
|
-
import { c as getToken } from "./auth-
|
|
1
|
+
import { n as readDeploymentPlatform, r as readProjectConfig } from "./project-DQstYTxO.mjs";
|
|
2
|
+
import { c as getToken } from "./auth-D52yG7hl.mjs";
|
|
3
3
|
import { $ as wrapTextWithPrefix, H as outro, L as log } from "./prompts-6OSVA7DJ.mjs";
|
|
4
|
-
import { r as PlatformClient } from "./client-
|
|
5
|
-
import { c as import_picocolors, i as dim, o as formatCount } from "./output-
|
|
4
|
+
import { r as PlatformClient } from "./client-mC-dFGDD.mjs";
|
|
5
|
+
import { c as import_picocolors, i as dim, o as formatCount } from "./output-BvdaehtE.mjs";
|
|
6
6
|
//#region src/cli/logs.ts
|
|
7
7
|
async function runLogsCommand(root, filter, range, deployment, level) {
|
|
8
8
|
console.log();
|
|
9
9
|
const platform = readDeploymentPlatform(root);
|
|
10
10
|
if (platform === "cloudflare") {
|
|
11
|
-
const { resolveCloudflareOperationContext, tailCloudflareWorker } = await import("./cloudflare-operations-
|
|
11
|
+
const { resolveCloudflareOperationContext, tailCloudflareWorker } = await import("./cloudflare-operations-DoQrVHAt.mjs");
|
|
12
12
|
if (range !== "1h") log.warn("Cloudflare tail streams live logs; --range does not select historical entries.");
|
|
13
13
|
if (level && level !== "all" && level !== "error") log.warn("Cloudflare tail cannot filter individual console levels; showing all invocation logs.");
|
|
14
14
|
await tailCloudflareWorker(resolveCloudflareOperationContext(root), {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as join } from "./dist-BVqXeR_h.mjs";
|
|
2
2
|
import { n as loadVoidAuthConfig, t as findVoidAuthConfig } from "./config-DPByhVck.mjs";
|
|
3
3
|
import { m as readConfig } from "./config-Br_JZD6u.mjs";
|
|
4
|
-
import { r as getMiniflareDatabasePath } from "./runner
|
|
4
|
+
import { r as getMiniflareDatabasePath } from "./runner--2KF6Kua.mjs";
|
|
5
5
|
import { a as loadLocalEnv } from "./env-_v349JBd.mjs";
|
|
6
6
|
import { r as resolveVoidAuthMigrationSchema } from "./drizzle-Beb2Am5S.mjs";
|
|
7
7
|
import { n as applyPgAuthMigrations, r as applySqliteAuthMigrations, t as applyMySqlAuthMigrations } from "./auth-migrations-9vif1uj8.mjs";
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
import { C as
|
|
2
|
-
import { n as OperatorClient, r as OperatorClientError } from "./operator-client-
|
|
1
|
+
import { C as deleteKeyringPassword, T as writeKeyringPassword, c as normalizePlatformApiUrl, i as getActivePlatformConnection, r as findPlatformConnections, u as platformCredentialAccount, w as readKeyringPassword } from "./platform-registry-P387v42A.mjs";
|
|
2
|
+
import { n as OperatorClient, r as OperatorClientError } from "./operator-client-BFqpp6z0.mjs";
|
|
3
3
|
/** Operator authority never comes from repository-controlled metadata. */
|
|
4
4
|
function resolveOperatorOrigin(connection = "") {
|
|
5
5
|
if (connection) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
normalized = normalizePlatformApiUrl(connection);
|
|
9
|
-
} catch {}
|
|
10
|
-
const matches = listPlatformConnections().filter((entry) => entry.id === connection || entry.installationId === connection || entry.apiUrl === normalized);
|
|
11
|
-
if (matches.length !== 1) throw new OperatorClientError("Select a registered platform connection ID or URL. Run `void connect <url> --no-login` to register it first.", "invalid_connection");
|
|
6
|
+
const matches = findPlatformConnections(connection);
|
|
7
|
+
if (matches.length !== 1) throw new OperatorClientError("Select a registered platform slug or URL. Run `void connect <url> --no-login` to register it first.", "invalid_connection");
|
|
12
8
|
return matches[0].apiUrl;
|
|
13
9
|
}
|
|
14
10
|
if (process.env.VOID_API_URL) return normalizePlatformApiUrl(process.env.VOID_API_URL);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as normalizePlatformApiUrl } from "./platform-registry-P387v42A.mjs";
|
|
2
2
|
import { t as cfAccessHeaders } from "./cf-access-TWNzXltp.mjs";
|
|
3
|
-
import { t as ensureCloudflaredToken } from "./cf-access-
|
|
3
|
+
import { t as ensureCloudflaredToken } from "./cf-access-YTlqvAsk.mjs";
|
|
4
4
|
const OPERATOR_MAX_TIMEOUT_MS = 36e5;
|
|
5
5
|
var OperatorClientError = class extends Error {
|
|
6
6
|
code;
|
|
@@ -71,7 +71,7 @@ var OperatorClient = class {
|
|
|
71
71
|
}
|
|
72
72
|
if (!data || typeof data !== "object" || Array.isArray(data)) throw new OperatorClientError("Operator API returned an invalid response object.", "invalid_response", response.status);
|
|
73
73
|
const result = data;
|
|
74
|
-
if (!response.ok) throw new OperatorClientError(typeof result.message === "string" ? result.message : `Operator request failed (HTTP ${response.status}).`, typeof result.error === "string" ? result.error : "request_failed", response.status, result.details);
|
|
74
|
+
if (!response.ok) throw new OperatorClientError(typeof result.message === "string" ? result.message : typeof result.error === "string" ? result.error === "Platform disabled" && result.reason === "maintenance" ? `Operator request failed (HTTP ${response.status}): the platform is paused for an upgrade or repair. Retry when it finishes.` : `Operator request failed (HTTP ${response.status}): ${result.error}.${result.error === "Platform disabled" ? " Run `void platform enable`." : ""}` : `Operator request failed (HTTP ${response.status}).`, typeof result.error === "string" ? result.error : "request_failed", response.status, result.details);
|
|
75
75
|
if (result.partial === true || result.ok === false) throw new OperatorClientError("The operation did not fully complete. Inspect the partial result before retrying.", "partial_failure", response.status, result);
|
|
76
76
|
return result;
|
|
77
77
|
} finally {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { n as OperatorClient, r as OperatorClientError } from "./operator-client-
|
|
2
|
-
import { a as resolveOperatorOrigin, i as removeOperatorToken, n as readOperatorApiTokenStdin, o as saveOperatorToken, r as readOperatorToken, t as exchangeOperatorSession } from "./operator-auth-
|
|
1
|
+
import { n as OperatorClient, r as OperatorClientError } from "./operator-client-BFqpp6z0.mjs";
|
|
2
|
+
import { a as resolveOperatorOrigin, i as removeOperatorToken, n as readOperatorApiTokenStdin, o as saveOperatorToken, r as readOperatorToken, t as exchangeOperatorSession } from "./operator-auth-2dsGlTT5.mjs";
|
|
3
3
|
import { createHash } from "node:crypto";
|
|
4
4
|
import { setTimeout } from "node:timers/promises";
|
|
5
5
|
import { createInterface } from "node:readline/promises";
|
|
6
6
|
//#region src/cli/operator-cmd.ts
|
|
7
7
|
const MAX_RUNTIME_FOLLOW_ROWS = 1e4;
|
|
8
|
+
const BUILD_LOG_DRAIN_TIMEOUT_MS = 12e4;
|
|
8
9
|
function printable(value) {
|
|
9
10
|
if (value === null || value === void 0) return "—";
|
|
10
11
|
if (typeof value === "string") return value.replace(/[\u0000-\u001f\u007f]/g, " ");
|
|
@@ -42,11 +43,28 @@ function eventLines(events, indent) {
|
|
|
42
43
|
if (!events.length) return [`${indent}(none)`];
|
|
43
44
|
return events.flatMap((event, index) => [`${indent}${index + 1}.`, ...humanLines(event, `${indent} `)]);
|
|
44
45
|
}
|
|
46
|
+
const LABEL_WORDS = {
|
|
47
|
+
api: "API",
|
|
48
|
+
dns: "DNS",
|
|
49
|
+
github: "GitHub",
|
|
50
|
+
http: "HTTP",
|
|
51
|
+
id: "ID",
|
|
52
|
+
ids: "IDs",
|
|
53
|
+
oauth: "OAuth",
|
|
54
|
+
oidc: "OIDC",
|
|
55
|
+
url: "URL",
|
|
56
|
+
urls: "URLs"
|
|
57
|
+
};
|
|
58
|
+
function fieldLabel(key) {
|
|
59
|
+
const words = key.replace(/([a-z0-9])([A-Z])/g, "$1 $2").split(/[\s_-]+/).filter(Boolean).map((word) => LABEL_WORDS[word.toLowerCase()] ?? word.toLowerCase());
|
|
60
|
+
if (words[0]) words[0] = words[0][0].toUpperCase() + words[0].slice(1);
|
|
61
|
+
return words.join(" ");
|
|
62
|
+
}
|
|
45
63
|
function humanLines(value, indent = "") {
|
|
46
64
|
if (Array.isArray(value)) return table(value, indent);
|
|
47
65
|
if (!value || typeof value !== "object") return [`${indent}${printable(value)}`];
|
|
48
66
|
return Object.entries(value).flatMap(([key, item]) => {
|
|
49
|
-
const label = key
|
|
67
|
+
const label = fieldLabel(key);
|
|
50
68
|
if (Array.isArray(item)) return [`${indent}${label}:`, ...key === "events" ? eventLines(item, `${indent} `) : table(item, `${indent} `)];
|
|
51
69
|
if (item && typeof item === "object") return [`${indent}${label}:`, ...humanLines(item, `${indent} `)];
|
|
52
70
|
return [`${indent}${label}: ${printable(item)}`];
|
|
@@ -137,9 +155,9 @@ async function runAuth(origin, args) {
|
|
|
137
155
|
if (args.action === "login" || args.action === "token" && args.tokenStdin) {
|
|
138
156
|
if (!args.tokenStdin && !process.stdin.isTTY) throw new OperatorClientError("Browser login requires an interactive terminal. Use --token-stdin to exchange an API session.", "interactive_login_required");
|
|
139
157
|
const apiToken = args.tokenStdin ? await readOperatorApiTokenStdin() : await (async () => {
|
|
140
|
-
const { discoverPlatform } = await import("./platform-cmd-
|
|
141
|
-
const { selectPlatformLoginMethod } = await import("./login-
|
|
142
|
-
const { runPlatformLogin } = await import("./auth-
|
|
158
|
+
const { discoverPlatform } = await import("./platform-cmd-dyFUof0t.mjs");
|
|
159
|
+
const { selectPlatformLoginMethod } = await import("./login-D7meQg_3.mjs");
|
|
160
|
+
const { runPlatformLogin } = await import("./auth-B60QDbjg.mjs");
|
|
143
161
|
return runPlatformLogin(origin, (await selectPlatformLoginMethod(await discoverPlatform(origin), args.providerExplicit ? args.provider : void 0)).id, (url) => process.stderr.write(`Sign in at ${url}\n`));
|
|
144
162
|
})();
|
|
145
163
|
const session = await exchangeOperatorSession(origin, apiToken);
|
|
@@ -313,7 +331,7 @@ async function migrateDeploymentAssets(client, origin, args) {
|
|
|
313
331
|
}
|
|
314
332
|
async function runOperatorCommand(args) {
|
|
315
333
|
if (!args.action) {
|
|
316
|
-
const { printHelpPage } = await import("./help-
|
|
334
|
+
const { printHelpPage } = await import("./help-Dw5f9Xrg.mjs");
|
|
317
335
|
printHelpPage(["platform", args.group]);
|
|
318
336
|
return;
|
|
319
337
|
}
|
|
@@ -363,7 +381,7 @@ async function runOperatorCommand(args) {
|
|
|
363
381
|
if (args.action === "logs" && args.group !== "email") outputLogs(result, args.json);
|
|
364
382
|
else if (args.group === "system" && args.action === "asset-migrations" && !args.json && Array.isArray(result.deployments)) console.log([
|
|
365
383
|
...humanLines({ pagination: result.pagination }),
|
|
366
|
-
"
|
|
384
|
+
"Deployments:",
|
|
367
385
|
...eventLines(result.deployments, " ")
|
|
368
386
|
].join("\n"));
|
|
369
387
|
else output(result, args.json);
|
|
@@ -371,4 +389,4 @@ async function runOperatorCommand(args) {
|
|
|
371
389
|
}
|
|
372
390
|
}
|
|
373
391
|
//#endregion
|
|
374
|
-
export { runOperatorCommand };
|
|
392
|
+
export { runOperatorCommand as a, humanLines as i, confirmOperatorMutation as n, followOperatorLogs as r, BUILD_LOG_DRAIN_TIMEOUT_MS as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as __toESM } from "./rolldown-runtime-DXIUcv95.mjs";
|
|
2
2
|
import { t as require_picocolors } from "./picocolors-BTps1_gs.mjs";
|
|
3
|
-
import { L as log, P as isCI, nt as settings, q as spinner } from "./prompts-6OSVA7DJ.mjs";
|
|
3
|
+
import { B as note$1, L as log, P as isCI, nt as settings, q as spinner } from "./prompts-6OSVA7DJ.mjs";
|
|
4
4
|
//#region src/cli/output.ts
|
|
5
5
|
var import_picocolors = /* @__PURE__ */ __toESM(require_picocolors(), 1);
|
|
6
6
|
function formatCount(count, singular, plural = `${singular}s`) {
|
|
@@ -54,6 +54,30 @@ function createSpinner(options, isTerminal = process.stdout.isTTY === true) {
|
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
|
+
/** Narrowest terminal the shared box renderer can draw a note in, guide bar included. */
|
|
58
|
+
const MIN_NOTE_COLUMNS = 6;
|
|
59
|
+
/**
|
|
60
|
+
* The shared box renderer throws when the terminal is narrower than its smallest box (a 0x0 pty
|
|
61
|
+
* reports 0 columns). Treat a non-positive width as unknown, like `stdout.columns || 80` elsewhere
|
|
62
|
+
* in the CLI, and draw tiny terminals at the narrowest width the box supports.
|
|
63
|
+
*/
|
|
64
|
+
function note(...args) {
|
|
65
|
+
const [message, title, opts] = args;
|
|
66
|
+
const output = opts?.output ?? process.stdout;
|
|
67
|
+
const columns = output.columns;
|
|
68
|
+
if (typeof columns !== "number" || columns >= MIN_NOTE_COLUMNS) {
|
|
69
|
+
note$1(...args);
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
const sized = {
|
|
73
|
+
columns: columns > 0 ? MIN_NOTE_COLUMNS : 80,
|
|
74
|
+
write: (chunk) => output.write(chunk)
|
|
75
|
+
};
|
|
76
|
+
note$1(message, title, {
|
|
77
|
+
...opts,
|
|
78
|
+
output: sized
|
|
79
|
+
});
|
|
80
|
+
}
|
|
57
81
|
function sectionTitle(title) {
|
|
58
82
|
return import_picocolors.default.reset(import_picocolors.default.blue(title));
|
|
59
83
|
}
|
|
@@ -86,4 +110,4 @@ function ensureUtc(s) {
|
|
|
86
110
|
return s + "Z";
|
|
87
111
|
}
|
|
88
112
|
//#endregion
|
|
89
|
-
export { ensureUtc as a, import_picocolors as c,
|
|
113
|
+
export { ensureUtc as a, import_picocolors as c, sectionTitle as d, tablePrefix as f, dim as i, note as l, cliCommandName as n, formatCount as o, createSpinner as r, helpLine as s, categoryTitle as t, sanitizeTerminalText as u };
|
package/dist/pages/client.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as PageObject } from "../protocol-
|
|
1
|
+
import { t as PageObject } from "../protocol-BX8t2jiw.mjs";
|
|
2
2
|
import { n as CacheForInput, r as CacheForResult } from "../prefetch-Ce6la4EI.mjs";
|
|
3
3
|
import { UsageLimitData } from "@void/edge";
|
|
4
4
|
import { ActionUrl, ResolveActionBody, ResolveActionParams } from "void/routes";
|
package/dist/pages/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as join } from "../dist-BVqXeR_h.mjs";
|
|
2
2
|
import { r as resolvePagesDir } from "../project-paths-GgcMozYz.mjs";
|
|
3
3
|
import { m as readConfig } from "../config-Br_JZD6u.mjs";
|
|
4
|
-
import { a as resolveNamedLayout, i as resolveLayoutIds, n as resolveEffectiveLayoutChain, r as resolveLayoutChain, t as scanPages } from "../scan-
|
|
4
|
+
import { a as resolveNamedLayout, i as resolveLayoutIds, n as resolveEffectiveLayoutChain, r as resolveLayoutChain, t as scanPages } from "../scan-C8dA7iM4.mjs";
|
|
5
5
|
import { i as parseRedirectsFile } from "../headers-2rKda9Y6.mjs";
|
|
6
6
|
import { i as resolveHead, n as renderHeadToString, r as renderHtmlAttrs, t as renderBodyAttrs } from "../head-D_QRR5Yd.mjs";
|
|
7
7
|
import { t as serializePageData } from "../serialize-BPvnNQuA.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as dirname, u as resolve } from "../dist-BVqXeR_h.mjs";
|
|
2
2
|
import { n as isIdentifier, r as isLiteral } from "../ast-CPGPjb0V.mjs";
|
|
3
|
-
import { n as resolveEffectiveLayoutChain, t as scanPages } from "../scan-
|
|
3
|
+
import { n as resolveEffectiveLayoutChain, t as scanPages } from "../scan-C8dA7iM4.mjs";
|
|
4
4
|
import { t as MagicString } from "../dist-AoCzRTJE.mjs";
|
|
5
5
|
import { existsSync, readFileSync, readdirSync } from "node:fs";
|
|
6
6
|
import { normalizePath, parseSync } from "vite";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { w as ValidationError } from "../handler-
|
|
2
|
-
import { a as handlePageMutation, i as handlePageGet, n as PageRenderResult, o as safeJsonStringify, r as flattenValidationErrors, t as PageObject } from "../protocol-
|
|
1
|
+
import { w as ValidationError } from "../handler-BeK3weD4.mjs";
|
|
2
|
+
import { a as handlePageMutation, i as handlePageGet, n as PageRenderResult, o as safeJsonStringify, r as flattenValidationErrors, t as PageObject } from "../protocol-BX8t2jiw.mjs";
|
|
3
3
|
export { PageObject, PageRenderResult, ValidationError, flattenValidationErrors, handlePageGet, handlePageMutation, safeJsonStringify };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MIGRATION_CLASSIFIER_VERSION, canonicalJson, canonicalSql, classifySqlMigration, getMigrationPlanHashInput, tokenizeSql } from "@void/deploy-core";
|
|
1
|
+
import { MIGRATION_CLASSIFIER_VERSION, canonicalJson, canonicalSql, classifySqlMigration, getMigrationPlanHashInput, splitSqlStatements, tokenizeSql } from "@void/deploy-core";
|
|
2
2
|
import { createHash } from "node:crypto";
|
|
3
3
|
//#region src/migrations/plan.ts
|
|
4
4
|
const DESTRUCTIVE_PRAGMA = "-- void:allow-destructive";
|
|
@@ -41,7 +41,7 @@ function classifyMigration(migration) {
|
|
|
41
41
|
return {
|
|
42
42
|
...base,
|
|
43
43
|
planHash: hashPlan(base),
|
|
44
|
-
...classification.kind === "legacy-unsplit-multi-statement" ? { warnings: [`
|
|
44
|
+
...classification.kind === "legacy-unsplit-multi-statement" && splitSqlStatements(sql) === null ? { warnings: [`Add a \`--> statement-breakpoint\` line after each complete SQL statement in migration ${migration.name}.`] } : {}
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
47
|
function buildMigrationPlanBundle(migrations) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as operatorGroups, r as parseOperatorArgs } from "./operator-args-
|
|
1
|
+
import { n as operatorGroups, r as parseOperatorArgs } from "./operator-args-DdY54Bgb.mjs";
|
|
2
2
|
import { PLATFORM_LOGIN_KINDS, normalizePlatformDashboardUrl, parsePlatformLoginId } from "@void/platform";
|
|
3
3
|
import { parsePlatformPlanId } from "@void/platform/plans";
|
|
4
4
|
//#region src/cli/platform-config-args.ts
|
|
@@ -416,6 +416,7 @@ function parsePlatformArgs(args) {
|
|
|
416
416
|
if (subcommand === "uninstall") {
|
|
417
417
|
const parsed = parseSelector(rest.filter((arg) => ![
|
|
418
418
|
"--purge-data",
|
|
419
|
+
"--purge-resources",
|
|
419
420
|
"--delete-zone",
|
|
420
421
|
"--keep-zone"
|
|
421
422
|
].includes(arg)), subcommand, { allowYes: true });
|
|
@@ -424,7 +425,8 @@ function parsePlatformArgs(args) {
|
|
|
424
425
|
subcommand,
|
|
425
426
|
selector: parsed.selector,
|
|
426
427
|
plan: parsed.plan,
|
|
427
|
-
purgeData: rest.includes("--purge-data"),
|
|
428
|
+
purgeData: rest.includes("--purge-data") || rest.includes("--purge-resources"),
|
|
429
|
+
purgeResources: rest.includes("--purge-resources"),
|
|
428
430
|
yes: parsed.yes,
|
|
429
431
|
deleteZone: rest.includes("--delete-zone") ? true : rest.includes("--keep-zone") ? false : null
|
|
430
432
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { u as openBrowser } from "./auth-
|
|
1
|
+
import { u as openBrowser } from "./auth-D52yG7hl.mjs";
|
|
2
2
|
import { A as confirm, K as select, U as password, X as text, tt as isCancel, z as multiselect } from "./prompts-6OSVA7DJ.mjs";
|
|
3
|
-
import { n as OperatorClient } from "./operator-client-
|
|
4
|
-
import { a as resolveOperatorOrigin, r as readOperatorToken } from "./operator-auth-
|
|
3
|
+
import { n as OperatorClient } from "./operator-client-BFqpp6z0.mjs";
|
|
4
|
+
import { a as resolveOperatorOrigin, r as readOperatorToken } from "./operator-auth-2dsGlTT5.mjs";
|
|
5
|
+
import { i as humanLines } from "./operator-cmd-CUGHXrQf.mjs";
|
|
5
6
|
import { parsePlatformAdmissionPolicy, parsePlatformLoginConfiguration } from "@void/platform";
|
|
6
7
|
import { stripVTControlCharacters } from "node:util";
|
|
7
8
|
import { execFile } from "node:child_process";
|
|
@@ -12,8 +13,8 @@ function value(input) {
|
|
|
12
13
|
if (isCancel(input) || typeof input === "symbol") throw new Error("platform: Cancelled.");
|
|
13
14
|
return input;
|
|
14
15
|
}
|
|
15
|
-
function print(result) {
|
|
16
|
-
console.log(JSON.stringify(result, null, 2));
|
|
16
|
+
function print(result, json) {
|
|
17
|
+
console.log(json ? JSON.stringify(result, null, 2) : humanLines(result).join("\n"));
|
|
17
18
|
}
|
|
18
19
|
async function apply(client, path, body, args) {
|
|
19
20
|
const preview = await client.request(path, {
|
|
@@ -140,11 +141,11 @@ async function configurationInput(args, existing) {
|
|
|
140
141
|
}
|
|
141
142
|
async function runPlatformAuthConfig(args) {
|
|
142
143
|
if (args.action === "recover") {
|
|
143
|
-
const { runPlatformAuthRecovery } = await import("./platform-auth-recovery-
|
|
144
|
+
const { runPlatformAuthRecovery } = await import("./platform-auth-recovery-WfTZ8K6o.mjs");
|
|
144
145
|
return runPlatformAuthRecovery(args);
|
|
145
146
|
}
|
|
146
147
|
if (args.action === "protection") {
|
|
147
|
-
const { runPlatformProtectionConfig } = await import("./platform-auth-protection-
|
|
148
|
+
const { runPlatformProtectionConfig } = await import("./platform-auth-protection-DcbL_LW_.mjs");
|
|
148
149
|
return runPlatformProtectionConfig(args);
|
|
149
150
|
}
|
|
150
151
|
const origin = resolveOperatorOrigin(args.connection);
|
|
@@ -152,11 +153,11 @@ async function runPlatformAuthConfig(args) {
|
|
|
152
153
|
const listing = await client.request("/config/auth");
|
|
153
154
|
if (!args.action) {
|
|
154
155
|
if (!process.stdin.isTTY || args.json) {
|
|
155
|
-
print(listing);
|
|
156
|
+
print(listing, args.json);
|
|
156
157
|
return;
|
|
157
158
|
}
|
|
158
159
|
if (!listing.initialized) {
|
|
159
|
-
print(await apply(client, "/config/auth/initialize", {}, args));
|
|
160
|
+
print(await apply(client, "/config/auth/initialize", {}, args), args.json);
|
|
160
161
|
console.log("Run void platform auth login, then return to void platform config auth.");
|
|
161
162
|
return;
|
|
162
163
|
}
|
|
@@ -266,11 +267,11 @@ async function runPlatformAuthConfig(args) {
|
|
|
266
267
|
});
|
|
267
268
|
}
|
|
268
269
|
if (args.action === "list") {
|
|
269
|
-
print(listing);
|
|
270
|
+
print(listing, args.json);
|
|
270
271
|
return;
|
|
271
272
|
}
|
|
272
273
|
if (args.action === "initialize") {
|
|
273
|
-
print(await apply(client, "/config/auth/initialize", {}, args));
|
|
274
|
+
print(await apply(client, "/config/auth/initialize", {}, args), args.json);
|
|
274
275
|
return;
|
|
275
276
|
}
|
|
276
277
|
if (!listing.initialized) throw new Error("platform: Run void platform config auth initialize, then sign in again.");
|
|
@@ -321,17 +322,17 @@ async function runPlatformAuthConfig(args) {
|
|
|
321
322
|
print(await apply(client, "/config/auth/admission", {
|
|
322
323
|
revision: listing.revision,
|
|
323
324
|
admission: parsePlatformAdmissionPolicy(admission)
|
|
324
|
-
}, args));
|
|
325
|
+
}, args), args.json);
|
|
325
326
|
return;
|
|
326
327
|
}
|
|
327
328
|
const method = listing.methods.find((method) => method.id === args.target);
|
|
328
329
|
if (args.action !== "add" && !method) throw new Error("platform: Login method not found. Run void platform config auth list.");
|
|
329
330
|
if (args.action === "show") {
|
|
330
|
-
print(method);
|
|
331
|
+
print(method, args.json);
|
|
331
332
|
return;
|
|
332
333
|
}
|
|
333
334
|
if (args.action === "test") {
|
|
334
|
-
print(await testMethod(client, args.target, args));
|
|
335
|
+
print(await testMethod(client, args.target, args), args.json);
|
|
335
336
|
return;
|
|
336
337
|
}
|
|
337
338
|
if (args.action === "add" || args.action === "configure") {
|
|
@@ -340,7 +341,7 @@ async function runPlatformAuthConfig(args) {
|
|
|
340
341
|
print(await apply(client, `/config/auth/connections/${encodeURIComponent(input.configuration.id)}/configure`, {
|
|
341
342
|
...input,
|
|
342
343
|
revision: args.action === "add" ? null : method.revision
|
|
343
|
-
}, args));
|
|
344
|
+
}, args), args.json);
|
|
344
345
|
if (!args.plan && !args.json) console.log(`Test and enable it with void platform config auth enable ${input.configuration.id}.`);
|
|
345
346
|
return;
|
|
346
347
|
}
|
|
@@ -348,7 +349,7 @@ async function runPlatformAuthConfig(args) {
|
|
|
348
349
|
if ((args.action === "enable" || args.action === "link") && !testId) {
|
|
349
350
|
if (!process.stdin.isTTY || args.plan || args.json) throw new Error("platform: Complete a login test and supply its --test-id.");
|
|
350
351
|
const tested = await testMethod(client, args.target, args);
|
|
351
|
-
print(tested);
|
|
352
|
+
print(tested, args.json);
|
|
352
353
|
if (tested.complete !== true || typeof tested.id !== "string") throw new Error("platform: Complete the browser test before enabling or linking this login.");
|
|
353
354
|
testId = tested.id;
|
|
354
355
|
if (args.action === "enable" && value(await confirm({
|
|
@@ -362,7 +363,7 @@ async function runPlatformAuthConfig(args) {
|
|
|
362
363
|
print(await apply(client, `/config/auth/connections/${encodeURIComponent(args.target)}/${args.action}`, {
|
|
363
364
|
revision: method.revision,
|
|
364
365
|
...testId ? { testId } : {}
|
|
365
|
-
}, args));
|
|
366
|
+
}, args), args.json);
|
|
366
367
|
}
|
|
367
368
|
//#endregion
|
|
368
369
|
export { runPlatformAuthConfig };
|
package/dist/{platform-auth-protection-DFeJ-JkK.mjs → platform-auth-protection-DcbL_LW_.mjs}
RENAMED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { S as writePendingInstallationSecrets, c as normalizePlatformApiUrl, m as readInstallationRecoverySecrets, p as promoteInstallationSecrets, t as acquirePlatformLifecycleLock, v as resolveInstallationManifest, x as writeInstallationManifest } from "./platform-registry-P387v42A.mjs";
|
|
2
2
|
import { t as cfAccessHeaders } from "./cf-access-TWNzXltp.mjs";
|
|
3
|
-
import { n as ensurePlatformAccessToken } from "./cf-access-
|
|
3
|
+
import { n as ensurePlatformAccessToken } from "./cf-access-YTlqvAsk.mjs";
|
|
4
4
|
import { A as confirm, tt as isCancel } from "./prompts-6OSVA7DJ.mjs";
|
|
5
|
-
import { n as OperatorClient } from "./operator-client-
|
|
6
|
-
import { a as resolveOperatorOrigin, r as readOperatorToken } from "./operator-auth-
|
|
7
|
-
import {
|
|
8
|
-
import { d as verifyPlatformInstallationOwnership, l as selectAuthoritativePlatformManifest } from "./platform-management-
|
|
5
|
+
import { n as OperatorClient } from "./operator-client-BFqpp6z0.mjs";
|
|
6
|
+
import { a as resolveOperatorOrigin, r as readOperatorToken } from "./operator-auth-2dsGlTT5.mjs";
|
|
7
|
+
import { G as preparePlatformAccessSetup, K as PlatformCloudflareClient, U as checkpointPlatformAccessResources, V as resolvePlatformCloudflareCredential, W as parsePlatformAccessSetupSpec, n as resolvePlatformInstallDatabaseUrl, s as acquirePlatformDatabaseLifecycleLock } from "./platform-lifecycle-Cfi0o6xM.mjs";
|
|
8
|
+
import { d as verifyPlatformInstallationOwnership, l as selectAuthoritativePlatformManifest } from "./platform-management-BrF9STZp.mjs";
|
|
9
9
|
import { parsePlatformAccessProtection, platformProtectionProofMessage } from "@void/platform";
|
|
10
10
|
import { createHmac } from "node:crypto";
|
|
11
11
|
import { readFile } from "node:fs/promises";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { u as openBrowser } from "./auth-
|
|
1
|
+
import { m as readInstallationRecoverySecrets, t as acquirePlatformLifecycleLock, v as resolveInstallationManifest } from "./platform-registry-P387v42A.mjs";
|
|
2
|
+
import { u as openBrowser } from "./auth-D52yG7hl.mjs";
|
|
3
3
|
import { A as confirm, tt as isCancel } from "./prompts-6OSVA7DJ.mjs";
|
|
4
|
-
import { a as resolveOperatorOrigin } from "./operator-auth-
|
|
5
|
-
import {
|
|
6
|
-
import { d as verifyPlatformInstallationOwnership, l as selectAuthoritativePlatformManifest } from "./platform-management-
|
|
4
|
+
import { a as resolveOperatorOrigin } from "./operator-auth-2dsGlTT5.mjs";
|
|
5
|
+
import { K as PlatformCloudflareClient, V as resolvePlatformCloudflareCredential, c as acquirePlatformDatabaseLifecycleLockConnection, l as platformDatabaseClientUrl, n as resolvePlatformInstallDatabaseUrl } from "./platform-lifecycle-Cfi0o6xM.mjs";
|
|
6
|
+
import { d as verifyPlatformInstallationOwnership, l as selectAuthoritativePlatformManifest } from "./platform-management-BrF9STZp.mjs";
|
|
7
7
|
import { parsePlatformAccessProtection, parsePlatformAdmissionPolicy, parsePlatformLoginConfiguration, platformAuthenticationRecoveryMessage, validatePlatformAdmissionPolicy } from "@void/platform";
|
|
8
8
|
import { createCipheriv, createDecipheriv, createHash, createHmac, hkdfSync, randomBytes, randomUUID } from "node:crypto";
|
|
9
9
|
import { execFile } from "node:child_process";
|