siteplane 0.1.52 → 0.1.53
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 +14 -0
- package/dist/bin/siteplane.js +372 -214
- package/dist/index.js +235 -183
- package/dist/next.js +226 -181
- package/package.json +1 -1
package/dist/next.js
CHANGED
|
@@ -2261,6 +2261,47 @@ var setupInstallationRequestSchema = z26.object({
|
|
|
2261
2261
|
}).strict()
|
|
2262
2262
|
}).strict();
|
|
2263
2263
|
|
|
2264
|
+
// ../shared/dist/setup-claim.js
|
|
2265
|
+
import { z as z27 } from "zod";
|
|
2266
|
+
var setupClaimCodeSchema = z27.string().regex(/^[0-9A-HJKMNP-TV-Z]{8}$/u);
|
|
2267
|
+
var setupClaimBindingSchema = z27.object({
|
|
2268
|
+
siteId: z27.string().uuid(),
|
|
2269
|
+
runId: z27.string().uuid()
|
|
2270
|
+
});
|
|
2271
|
+
var setupClaimReceiptSchema = setupClaimBindingSchema.extend({
|
|
2272
|
+
status: z27.literal("claimed"),
|
|
2273
|
+
requestId: z27.string().uuid(),
|
|
2274
|
+
workspaceId: z27.string().uuid(),
|
|
2275
|
+
userId: z27.string().uuid(),
|
|
2276
|
+
claimedAt: z27.string().datetime({ offset: true })
|
|
2277
|
+
}).strict();
|
|
2278
|
+
var setupClaimInspectionSchema = setupClaimBindingSchema.extend({
|
|
2279
|
+
status: z27.literal("pending"),
|
|
2280
|
+
requestId: z27.string().uuid(),
|
|
2281
|
+
siteName: z27.string(),
|
|
2282
|
+
userId: z27.string().uuid(),
|
|
2283
|
+
accountEmail: z27.string().email(),
|
|
2284
|
+
workspaceId: z27.string().uuid(),
|
|
2285
|
+
workspaceName: z27.string(),
|
|
2286
|
+
expiresAt: z27.string().datetime({ offset: true })
|
|
2287
|
+
}).strict();
|
|
2288
|
+
var setupClaimDenialSchema = z27.object({
|
|
2289
|
+
status: z27.enum([
|
|
2290
|
+
"invalid_claim_request",
|
|
2291
|
+
"invalid_installation",
|
|
2292
|
+
"already_claimed",
|
|
2293
|
+
"project_expired",
|
|
2294
|
+
"invalid_guest_session",
|
|
2295
|
+
"stale_setup_review",
|
|
2296
|
+
"verified_account_required",
|
|
2297
|
+
"workspace_access_denied",
|
|
2298
|
+
"workspace_entitlement_required",
|
|
2299
|
+
"site_limit_reached",
|
|
2300
|
+
"provisional_relationship_conflict",
|
|
2301
|
+
"rate_limited"
|
|
2302
|
+
])
|
|
2303
|
+
}).strict();
|
|
2304
|
+
|
|
2264
2305
|
// ../cli/dist/analytics/static-scan.js
|
|
2265
2306
|
import ts from "typescript";
|
|
2266
2307
|
|
|
@@ -2313,16 +2354,16 @@ function createAnalyticsCliRequestHeaders(config) {
|
|
|
2313
2354
|
}
|
|
2314
2355
|
|
|
2315
2356
|
// ../cli/dist/commands/analytics/public-key.js
|
|
2316
|
-
import { z as
|
|
2317
|
-
var responseSchema =
|
|
2318
|
-
ok:
|
|
2319
|
-
data:
|
|
2320
|
-
rawPublicKey:
|
|
2357
|
+
import { z as z28 } from "zod";
|
|
2358
|
+
var responseSchema = z28.object({
|
|
2359
|
+
ok: z28.literal(true),
|
|
2360
|
+
data: z28.object({
|
|
2361
|
+
rawPublicKey: z28.string().regex(/^pk_siteplane_[A-Za-z0-9_-]{16}_[A-Za-z0-9_-]{43}$/)
|
|
2321
2362
|
})
|
|
2322
2363
|
});
|
|
2323
|
-
var errorResponseSchema =
|
|
2324
|
-
error:
|
|
2325
|
-
code:
|
|
2364
|
+
var errorResponseSchema = z28.object({
|
|
2365
|
+
error: z28.object({
|
|
2366
|
+
code: z28.string().regex(/^[a-z][a-z0-9_.-]+$/u)
|
|
2326
2367
|
})
|
|
2327
2368
|
});
|
|
2328
2369
|
async function analyticsPublicKeyCommand(input) {
|
|
@@ -2344,13 +2385,13 @@ async function analyticsPublicKeyCommand(input) {
|
|
|
2344
2385
|
}
|
|
2345
2386
|
|
|
2346
2387
|
// ../cli/dist/commands/analytics/prepare.js
|
|
2347
|
-
import { z as
|
|
2348
|
-
var resultSchema =
|
|
2349
|
-
ok:
|
|
2350
|
-
data:
|
|
2351
|
-
rawPublicKey:
|
|
2352
|
-
generation:
|
|
2353
|
-
status:
|
|
2388
|
+
import { z as z29 } from "zod";
|
|
2389
|
+
var resultSchema = z29.object({
|
|
2390
|
+
ok: z29.literal(true),
|
|
2391
|
+
data: z29.object({
|
|
2392
|
+
rawPublicKey: z29.string().regex(/^pk_siteplane_[A-Za-z0-9_-]{16}_[A-Za-z0-9_-]{43}$/u),
|
|
2393
|
+
generation: z29.number().int().positive(),
|
|
2394
|
+
status: z29.enum([
|
|
2354
2395
|
"setup_started",
|
|
2355
2396
|
"test_mode",
|
|
2356
2397
|
"active",
|
|
@@ -2360,8 +2401,8 @@ var resultSchema = z28.object({
|
|
|
2360
2401
|
])
|
|
2361
2402
|
}).strict()
|
|
2362
2403
|
}).strict();
|
|
2363
|
-
var errorSchema =
|
|
2364
|
-
error:
|
|
2404
|
+
var errorSchema = z29.object({
|
|
2405
|
+
error: z29.object({ code: z29.string().regex(/^[a-z][a-z0-9_.-]+$/u) })
|
|
2365
2406
|
});
|
|
2366
2407
|
|
|
2367
2408
|
// ../cli/dist/commands/analytics/test.js
|
|
@@ -2394,19 +2435,19 @@ ${bookingRulesTemplate}`;
|
|
|
2394
2435
|
import { access, chmod, open, readFile as readFile5, rename, rm } from "fs/promises";
|
|
2395
2436
|
import { randomUUID as randomUUID2 } from "crypto";
|
|
2396
2437
|
import { join as join3 } from "path";
|
|
2397
|
-
import { z as
|
|
2398
|
-
var siteplaneProjectConfigSchema =
|
|
2399
|
-
version:
|
|
2400
|
-
apiBaseUrl:
|
|
2401
|
-
siteId:
|
|
2402
|
-
publicSiteKeyId:
|
|
2403
|
-
publicSiteKey:
|
|
2404
|
-
runId:
|
|
2405
|
-
appDirectory:
|
|
2406
|
-
taskContractVersion:
|
|
2407
|
-
adminProtocolVersion:
|
|
2438
|
+
import { z as z30 } from "zod";
|
|
2439
|
+
var siteplaneProjectConfigSchema = z30.object({
|
|
2440
|
+
version: z30.literal(2),
|
|
2441
|
+
apiBaseUrl: z30.string().url(),
|
|
2442
|
+
siteId: z30.string().uuid(),
|
|
2443
|
+
publicSiteKeyId: z30.string().uuid(),
|
|
2444
|
+
publicSiteKey: z30.string().trim().min(1),
|
|
2445
|
+
runId: z30.string().uuid(),
|
|
2446
|
+
appDirectory: z30.string().min(1),
|
|
2447
|
+
taskContractVersion: z30.literal("siteplane.setup-task.v2"),
|
|
2448
|
+
adminProtocolVersion: z30.literal(2),
|
|
2408
2449
|
packages: siteSetupPackagesSchema,
|
|
2409
|
-
fieldContractHash:
|
|
2450
|
+
fieldContractHash: z30.string().regex(/^sha256:[0-9a-f]{64}$/iu).optional()
|
|
2410
2451
|
}).strict();
|
|
2411
2452
|
async function readProjectConfig(projectDir) {
|
|
2412
2453
|
return siteplaneProjectConfigSchema.parse(JSON.parse(await readFile5(join3(projectDir, "siteplane.config.json"), "utf8")));
|
|
@@ -2418,26 +2459,27 @@ import { randomUUID as randomUUID3 } from "crypto";
|
|
|
2418
2459
|
import { chmod as chmod2, lstat, mkdir as mkdir5, open as open2, readFile as readFile6, rename as rename2, rm as rm2 } from "fs/promises";
|
|
2419
2460
|
import { dirname as dirname5, join as join4, relative } from "path";
|
|
2420
2461
|
import { promisify } from "util";
|
|
2421
|
-
import { z as
|
|
2422
|
-
var localSetupInstallationSchema =
|
|
2423
|
-
key:
|
|
2424
|
-
idempotencyKey:
|
|
2425
|
-
apiBaseUrl:
|
|
2462
|
+
import { z as z31 } from "zod";
|
|
2463
|
+
var localSetupInstallationSchema = z31.object({
|
|
2464
|
+
key: z31.string().regex(/^[A-Za-z0-9_-]{43}$/u),
|
|
2465
|
+
idempotencyKey: z31.string().uuid(),
|
|
2466
|
+
apiBaseUrl: z31.string().url(),
|
|
2426
2467
|
request: setupInstallationRequestSchema,
|
|
2427
|
-
bootstrapAcknowledged:
|
|
2468
|
+
bootstrapAcknowledged: z31.boolean()
|
|
2428
2469
|
}).strict();
|
|
2429
|
-
var siteplaneCredentialsSchema =
|
|
2430
|
-
accessToken:
|
|
2431
|
-
siteRevalidationSecret:
|
|
2470
|
+
var siteplaneCredentialsSchema = z31.object({
|
|
2471
|
+
accessToken: z31.string().trim().min(1),
|
|
2472
|
+
siteRevalidationSecret: z31.string().trim().min(1),
|
|
2432
2473
|
installation: localSetupInstallationSchema.optional(),
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2474
|
+
claimReceipt: setupClaimReceiptSchema.optional(),
|
|
2475
|
+
adminSession: z31.object({
|
|
2476
|
+
secret: z31.string().regex(/^[A-Za-z0-9_-]{43}$/u),
|
|
2477
|
+
generation: z31.string().uuid()
|
|
2436
2478
|
}).strict().optional()
|
|
2437
2479
|
}).strict();
|
|
2438
|
-
var localSetupCredentialsSchema =
|
|
2480
|
+
var localSetupCredentialsSchema = z31.union([
|
|
2439
2481
|
siteplaneCredentialsSchema,
|
|
2440
|
-
|
|
2482
|
+
z31.object({ installation: localSetupInstallationSchema }).strict()
|
|
2441
2483
|
]);
|
|
2442
2484
|
async function assertLocalCredentialsPathSafe(projectDir, options = {}) {
|
|
2443
2485
|
const path = join4(projectDir, ".siteplane/credentials.json");
|
|
@@ -2498,7 +2540,7 @@ async function gitPathMatches(projectDir, path, command) {
|
|
|
2498
2540
|
// ../cli/dist/commands/init.js
|
|
2499
2541
|
import { access as access3 } from "fs/promises";
|
|
2500
2542
|
import { join as join7, relative as relative3 } from "path";
|
|
2501
|
-
import { z as
|
|
2543
|
+
import { z as z34 } from "zod";
|
|
2502
2544
|
|
|
2503
2545
|
// ../cli/dist/commands/setup-preflight.js
|
|
2504
2546
|
import { createHash as createHash2 } from "crypto";
|
|
@@ -2510,11 +2552,11 @@ import { parse as parseYaml } from "yaml";
|
|
|
2510
2552
|
import { createRequire } from "module";
|
|
2511
2553
|
import { readFile as readFile7 } from "fs/promises";
|
|
2512
2554
|
import { join as join5 } from "path";
|
|
2513
|
-
import { z as
|
|
2514
|
-
var packageSchema =
|
|
2515
|
-
name:
|
|
2516
|
-
version:
|
|
2517
|
-
peerDependencies:
|
|
2555
|
+
import { z as z32 } from "zod";
|
|
2556
|
+
var packageSchema = z32.object({
|
|
2557
|
+
name: z32.string().optional(),
|
|
2558
|
+
version: z32.string(),
|
|
2559
|
+
peerDependencies: z32.record(z32.string(), z32.string()).optional()
|
|
2518
2560
|
});
|
|
2519
2561
|
async function readInstalledPackage(projectDir, name2) {
|
|
2520
2562
|
const require2 = createRequire(join5(projectDir, "package.json"));
|
|
@@ -2532,7 +2574,7 @@ async function readInstalledPackage(projectDir, name2) {
|
|
|
2532
2574
|
// ../cli/dist/commands/setup-preflight.js
|
|
2533
2575
|
import { access as access2, readFile as readFile8, realpath, readdir, readlink } from "fs/promises";
|
|
2534
2576
|
import { dirname as dirname6, join as join6, relative as relative2, resolve, sep } from "path";
|
|
2535
|
-
import { z as
|
|
2577
|
+
import { z as z33 } from "zod";
|
|
2536
2578
|
|
|
2537
2579
|
// ../cli/dist/commands/setup-process.js
|
|
2538
2580
|
import { spawn } from "child_process";
|
|
@@ -2633,29 +2675,29 @@ async function setupVercelApi(cwd, endpoint, body, method, options) {
|
|
|
2633
2675
|
}
|
|
2634
2676
|
|
|
2635
2677
|
// ../cli/dist/commands/setup-preflight.js
|
|
2636
|
-
var manifestSchema =
|
|
2637
|
-
packageManager:
|
|
2638
|
-
engines:
|
|
2639
|
-
dependencies:
|
|
2640
|
-
devDependencies:
|
|
2641
|
-
scripts:
|
|
2642
|
-
workspaces:
|
|
2678
|
+
var manifestSchema = z33.object({
|
|
2679
|
+
packageManager: z33.string().optional(),
|
|
2680
|
+
engines: z33.object({ node: z33.string().optional() }).optional(),
|
|
2681
|
+
dependencies: z33.record(z33.string(), z33.string()).optional(),
|
|
2682
|
+
devDependencies: z33.record(z33.string(), z33.string()).optional(),
|
|
2683
|
+
scripts: z33.record(z33.string(), z33.string()).optional(),
|
|
2684
|
+
workspaces: z33.unknown().optional()
|
|
2643
2685
|
});
|
|
2644
|
-
var vercelProjectSchema =
|
|
2645
|
-
id:
|
|
2646
|
-
accountId:
|
|
2647
|
-
name:
|
|
2648
|
-
nodeVersion:
|
|
2649
|
-
rootDirectory:
|
|
2650
|
-
framework:
|
|
2651
|
-
installCommand:
|
|
2652
|
-
buildCommand:
|
|
2653
|
-
link:
|
|
2654
|
-
type:
|
|
2655
|
-
repo:
|
|
2656
|
-
repoId:
|
|
2657
|
-
org:
|
|
2658
|
-
productionBranch:
|
|
2686
|
+
var vercelProjectSchema = z33.object({
|
|
2687
|
+
id: z33.string(),
|
|
2688
|
+
accountId: z33.string(),
|
|
2689
|
+
name: z33.string(),
|
|
2690
|
+
nodeVersion: z33.string().nullable().optional(),
|
|
2691
|
+
rootDirectory: z33.string().nullable().optional(),
|
|
2692
|
+
framework: z33.string().nullable().optional(),
|
|
2693
|
+
installCommand: z33.string().nullable().optional(),
|
|
2694
|
+
buildCommand: z33.string().nullable().optional(),
|
|
2695
|
+
link: z33.object({
|
|
2696
|
+
type: z33.string(),
|
|
2697
|
+
repo: z33.string().optional(),
|
|
2698
|
+
repoId: z33.union([z33.string(), z33.number()]).optional(),
|
|
2699
|
+
org: z33.string().optional(),
|
|
2700
|
+
productionBranch: z33.string().optional()
|
|
2659
2701
|
}).nullable().optional()
|
|
2660
2702
|
});
|
|
2661
2703
|
var exists = async (path) => access2(path).then(() => true, () => false);
|
|
@@ -2712,9 +2754,9 @@ async function inspectSetupLocalProject(projectDir) {
|
|
|
2712
2754
|
const rootManifest = manifestSchema.parse(JSON.parse(await readFile8(join6(lockfileRoot, "package.json"), "utf8")));
|
|
2713
2755
|
if (lockfileRoot !== projectDirectory) {
|
|
2714
2756
|
const workspaceFile = join6(lockfileRoot, "pnpm-workspace.yaml");
|
|
2715
|
-
const workspace = lockName === "pnpm-lock.yaml" && await exists(workspaceFile) ?
|
|
2716
|
-
|
|
2717
|
-
|
|
2757
|
+
const workspace = lockName === "pnpm-lock.yaml" && await exists(workspaceFile) ? z33.object({ packages: z33.array(z33.string()) }).parse(parseYaml(await readFile8(workspaceFile, "utf8"))).packages : z33.union([
|
|
2758
|
+
z33.array(z33.string()),
|
|
2759
|
+
z33.object({ packages: z33.array(z33.string()) }).transform((value) => value.packages)
|
|
2718
2760
|
]).parse(rootManifest.workspaces);
|
|
2719
2761
|
const selected = relative2(lockfileRoot, projectDirectory).split(sep).join("/");
|
|
2720
2762
|
if (!workspace.some((pattern) => !pattern.startsWith("!") && minimatch(selected, pattern)) || workspace.some((pattern) => pattern.startsWith("!") && minimatch(selected, pattern.slice(1))))
|
|
@@ -2728,11 +2770,11 @@ async function inspectSetupLocalProject(projectDir) {
|
|
|
2728
2770
|
break;
|
|
2729
2771
|
}
|
|
2730
2772
|
const lockText = await readFile8(join6(lockfileRoot, lockName), "utf8");
|
|
2731
|
-
const npmLock = lockName === "package-lock.json" ?
|
|
2732
|
-
lockfileVersion:
|
|
2733
|
-
packages:
|
|
2734
|
-
version:
|
|
2735
|
-
peerDependencies:
|
|
2773
|
+
const npmLock = lockName === "package-lock.json" ? z33.object({
|
|
2774
|
+
lockfileVersion: z33.number(),
|
|
2775
|
+
packages: z33.record(z33.string(), z33.object({
|
|
2776
|
+
version: z33.string().optional(),
|
|
2777
|
+
peerDependencies: z33.record(z33.string(), z33.string()).optional()
|
|
2736
2778
|
})).optional()
|
|
2737
2779
|
}).parse(JSON.parse(lockText)) : null;
|
|
2738
2780
|
async function version2(name3) {
|
|
@@ -2872,9 +2914,9 @@ async function setupPreflightCommand(input) {
|
|
|
2872
2914
|
linkDirectory = dirname6(linkDirectory);
|
|
2873
2915
|
if (!await exists(join6(linkDirectory, ".vercel/project.json")))
|
|
2874
2916
|
fail("vercel_project_not_linked", "Link this application to its intended Vercel project before setup; Siteplane will not guess a target.");
|
|
2875
|
-
const linked =
|
|
2876
|
-
projectId:
|
|
2877
|
-
orgId:
|
|
2917
|
+
const linked = z33.object({
|
|
2918
|
+
projectId: z33.string().regex(/^prj_[A-Za-z0-9]+$/u),
|
|
2919
|
+
orgId: z33.string().regex(/^(?:team|user)_[A-Za-z0-9]+$/u)
|
|
2878
2920
|
}).parse(JSON.parse(await readFile8(join6(linkDirectory, ".vercel/project.json"), "utf8")));
|
|
2879
2921
|
const project = vercelProjectSchema.parse(await setupVercelApi(linkDirectory, `/v9/projects/${linked.projectId}?teamId=${linked.orgId}`));
|
|
2880
2922
|
if (project.id !== linked.projectId || project.accountId !== linked.orgId)
|
|
@@ -2888,11 +2930,11 @@ async function setupPreflightCommand(input) {
|
|
|
2888
2930
|
fail("vercel_production_branch_conflict", "The local branch differs from the bound Vercel Production branch.");
|
|
2889
2931
|
if (project.link?.repo && project.link.org && !local.git.remote?.replace(/\.git$/u, "").endsWith(`${project.link.org}/${project.link.repo}`))
|
|
2890
2932
|
fail("vercel_git_conflict", "The local origin repository differs from the Vercel Git connection.");
|
|
2891
|
-
const env =
|
|
2892
|
-
envs:
|
|
2893
|
-
key:
|
|
2894
|
-
value:
|
|
2895
|
-
target:
|
|
2933
|
+
const env = z33.object({
|
|
2934
|
+
envs: z33.array(z33.object({
|
|
2935
|
+
key: z33.string(),
|
|
2936
|
+
value: z33.string().optional(),
|
|
2937
|
+
target: z33.array(z33.string()).optional()
|
|
2896
2938
|
}))
|
|
2897
2939
|
}).parse(await setupVercelApi(linkDirectory, `/v10/projects/${linked.projectId}/env?teamId=${linked.orgId}`));
|
|
2898
2940
|
const corepack = env.envs.some((item) => item.key === "ENABLE_EXPERIMENTAL_COREPACK" && item.value === "1" && item.target?.includes("production"));
|
|
@@ -2954,26 +2996,26 @@ function safeGitRemote(value) {
|
|
|
2954
2996
|
}
|
|
2955
2997
|
|
|
2956
2998
|
// ../cli/dist/commands/init.js
|
|
2957
|
-
var siteSetupBootstrapDataSchema =
|
|
2958
|
-
credentialPurpose:
|
|
2959
|
-
apiBaseUrl:
|
|
2960
|
-
siteId:
|
|
2961
|
-
publicSiteKeyId:
|
|
2962
|
-
publicSiteKey:
|
|
2963
|
-
accessToken:
|
|
2964
|
-
siteRevalidationSecret:
|
|
2965
|
-
runId:
|
|
2999
|
+
var siteSetupBootstrapDataSchema = z34.object({
|
|
3000
|
+
credentialPurpose: z34.literal("site_setup"),
|
|
3001
|
+
apiBaseUrl: z34.string().url(),
|
|
3002
|
+
siteId: z34.string().uuid(),
|
|
3003
|
+
publicSiteKeyId: z34.string().uuid(),
|
|
3004
|
+
publicSiteKey: z34.string().trim().min(1),
|
|
3005
|
+
accessToken: z34.string().trim().min(1),
|
|
3006
|
+
siteRevalidationSecret: z34.string().regex(/^[A-Za-z0-9_-]{43}$/u),
|
|
3007
|
+
runId: z34.string().uuid(),
|
|
2966
3008
|
packages: siteSetupPackagesSchema
|
|
2967
3009
|
}).strict();
|
|
2968
|
-
var featureBootstrapDataSchema =
|
|
2969
|
-
credentialPurpose:
|
|
2970
|
-
apiBaseUrl:
|
|
2971
|
-
siteId:
|
|
2972
|
-
accessToken:
|
|
3010
|
+
var featureBootstrapDataSchema = z34.object({
|
|
3011
|
+
credentialPurpose: z34.enum(["analytics", "booking"]),
|
|
3012
|
+
apiBaseUrl: z34.string().url(),
|
|
3013
|
+
siteId: z34.string().uuid(),
|
|
3014
|
+
accessToken: z34.string().trim().min(1)
|
|
2973
3015
|
}).strict();
|
|
2974
|
-
var bootstrapResponseSchema =
|
|
2975
|
-
ok:
|
|
2976
|
-
data:
|
|
3016
|
+
var bootstrapResponseSchema = z34.object({
|
|
3017
|
+
ok: z34.literal(true),
|
|
3018
|
+
data: z34.discriminatedUnion("credentialPurpose", [
|
|
2977
3019
|
siteSetupBootstrapDataSchema,
|
|
2978
3020
|
featureBootstrapDataSchema
|
|
2979
3021
|
])
|
|
@@ -3024,7 +3066,7 @@ async function collectSourceFiles(directory) {
|
|
|
3024
3066
|
import { execFile as execFile2 } from "child_process";
|
|
3025
3067
|
import { readFile as readFile9 } from "fs/promises";
|
|
3026
3068
|
import { promisify as promisify2 } from "util";
|
|
3027
|
-
import { z as
|
|
3069
|
+
import { z as z35 } from "zod";
|
|
3028
3070
|
|
|
3029
3071
|
// ../cli/dist/scan/next-source-scan.js
|
|
3030
3072
|
import ts2 from "typescript";
|
|
@@ -3721,32 +3763,32 @@ function isPositionalFieldReference(value) {
|
|
|
3721
3763
|
|
|
3722
3764
|
// ../cli/dist/commands/site-setup.js
|
|
3723
3765
|
var execFileAsync2 = promisify2(execFile2);
|
|
3724
|
-
var safeErrorSchema =
|
|
3725
|
-
code:
|
|
3726
|
-
message:
|
|
3766
|
+
var safeErrorSchema = z35.object({
|
|
3767
|
+
code: z35.string().trim().min(1),
|
|
3768
|
+
message: z35.string().trim().min(1)
|
|
3727
3769
|
}).passthrough();
|
|
3728
|
-
var errorResponseSchema2 =
|
|
3729
|
-
var contextDataSchema =
|
|
3770
|
+
var errorResponseSchema2 = z35.object({ ok: z35.literal(false), error: safeErrorSchema }).passthrough();
|
|
3771
|
+
var contextDataSchema = z35.object({
|
|
3730
3772
|
task: siteSetupTaskSchema.refine((task) => task.run !== null)
|
|
3731
3773
|
}).strict();
|
|
3732
|
-
var contextResponseSchema =
|
|
3733
|
-
var applyDataSchema =
|
|
3734
|
-
status:
|
|
3735
|
-
runId:
|
|
3736
|
-
contractVersionId:
|
|
3737
|
-
fieldContractHash:
|
|
3738
|
-
editorDefinitionHash:
|
|
3739
|
-
fieldCount:
|
|
3740
|
-
routeCount:
|
|
3774
|
+
var contextResponseSchema = z35.object({ ok: z35.literal(true), data: contextDataSchema }).strict();
|
|
3775
|
+
var applyDataSchema = z35.object({
|
|
3776
|
+
status: z35.enum(["applied", "ready_for_review"]),
|
|
3777
|
+
runId: z35.string().uuid().optional(),
|
|
3778
|
+
contractVersionId: z35.string().uuid().optional(),
|
|
3779
|
+
fieldContractHash: z35.string().regex(/^sha256:[0-9a-f]{64}$/u),
|
|
3780
|
+
editorDefinitionHash: z35.string().regex(/^sha256:[0-9a-f]{64}$/u).optional(),
|
|
3781
|
+
fieldCount: z35.number().int().nonnegative().optional(),
|
|
3782
|
+
routeCount: z35.number().int().nonnegative().optional()
|
|
3741
3783
|
}).strict();
|
|
3742
|
-
var applyResponseSchema =
|
|
3743
|
-
var verifyDataSchema =
|
|
3744
|
-
status:
|
|
3745
|
-
runId:
|
|
3746
|
-
deploymentOrigin:
|
|
3747
|
-
deploymentRevision:
|
|
3784
|
+
var applyResponseSchema = z35.object({ ok: z35.literal(true), data: applyDataSchema }).strict();
|
|
3785
|
+
var verifyDataSchema = z35.object({
|
|
3786
|
+
status: z35.literal("ready_for_review"),
|
|
3787
|
+
runId: z35.string().uuid().optional(),
|
|
3788
|
+
deploymentOrigin: z35.string().url().optional(),
|
|
3789
|
+
deploymentRevision: z35.string().optional()
|
|
3748
3790
|
}).strict();
|
|
3749
|
-
var verifyResponseSchema =
|
|
3791
|
+
var verifyResponseSchema = z35.object({ ok: z35.literal(true), data: verifyDataSchema }).strict();
|
|
3750
3792
|
async function siteSetupContextCommand(input) {
|
|
3751
3793
|
const response = await postSiteSetup(input, "context", {});
|
|
3752
3794
|
const parsed = contextResponseSchema.safeParse(response.payload);
|
|
@@ -3843,19 +3885,19 @@ async function readGitRevision(projectDir) {
|
|
|
3843
3885
|
import { randomBytes, randomUUID as randomUUID4 } from "crypto";
|
|
3844
3886
|
import { access as access4 } from "fs/promises";
|
|
3845
3887
|
import { join as join9, relative as relative5 } from "path";
|
|
3846
|
-
import { z as
|
|
3847
|
-
var bootstrapResponseSchema2 =
|
|
3848
|
-
ok:
|
|
3888
|
+
import { z as z36 } from "zod";
|
|
3889
|
+
var bootstrapResponseSchema2 = z36.object({
|
|
3890
|
+
ok: z36.literal(true),
|
|
3849
3891
|
data: siteSetupBootstrapDataSchema
|
|
3850
3892
|
}).strict();
|
|
3851
3893
|
|
|
3852
3894
|
// ../cli/dist/commands/setup-review.js
|
|
3853
|
-
import { z as
|
|
3854
|
-
var responseSchema2 =
|
|
3855
|
-
ok:
|
|
3856
|
-
data:
|
|
3857
|
-
reviewUrl:
|
|
3858
|
-
expiresAt:
|
|
3895
|
+
import { z as z37 } from "zod";
|
|
3896
|
+
var responseSchema2 = z37.object({
|
|
3897
|
+
ok: z37.literal(true),
|
|
3898
|
+
data: z37.object({
|
|
3899
|
+
reviewUrl: z37.string().url(),
|
|
3900
|
+
expiresAt: z37.string().datetime({ offset: true })
|
|
3859
3901
|
}).strict()
|
|
3860
3902
|
}).strict();
|
|
3861
3903
|
|
|
@@ -3869,8 +3911,8 @@ import ts3 from "typescript";
|
|
|
3869
3911
|
import { randomUUID as randomUUID6 } from "crypto";
|
|
3870
3912
|
import { lstat as lstat3, mkdir as mkdir7, open as open4, readFile as readFile11, rm as rm4, rmdir } from "fs/promises";
|
|
3871
3913
|
import { resolve as resolve2 } from "path";
|
|
3872
|
-
import { z as
|
|
3873
|
-
var ownerSchema =
|
|
3914
|
+
import { z as z38 } from "zod";
|
|
3915
|
+
var ownerSchema = z38.object({ pid: z38.number().int().positive(), nonce: z38.string().uuid() }).strict();
|
|
3874
3916
|
|
|
3875
3917
|
// ../cli/dist/config/build-provenance.js
|
|
3876
3918
|
import { createHash as createHash3 } from "crypto";
|
|
@@ -3878,23 +3920,23 @@ import { execFile as execFile3 } from "child_process";
|
|
|
3878
3920
|
import { lstat as lstat4, readFile as readFile12, writeFile as writeFile5, mkdir as mkdir8 } from "fs/promises";
|
|
3879
3921
|
import { dirname as dirname8, isAbsolute as isAbsolute2, join as join11, relative as relative7, resolve as resolve3, sep as sep3 } from "path";
|
|
3880
3922
|
import { isDeepStrictEqual, promisify as promisify3 } from "util";
|
|
3881
|
-
import { z as
|
|
3923
|
+
import { z as z39 } from "zod";
|
|
3882
3924
|
var execute = promisify3(execFile3);
|
|
3883
3925
|
var name = ".siteplane/build-source.json";
|
|
3884
|
-
var oid =
|
|
3885
|
-
var entrySchema =
|
|
3886
|
-
path:
|
|
3887
|
-
mode:
|
|
3926
|
+
var oid = z39.string().regex(/^[0-9a-f]{40}$/u);
|
|
3927
|
+
var entrySchema = z39.object({
|
|
3928
|
+
path: z39.string().min(1).max(4096),
|
|
3929
|
+
mode: z39.enum(["100644", "100755", "120000"]),
|
|
3888
3930
|
oid
|
|
3889
3931
|
}).strict();
|
|
3890
|
-
var schema =
|
|
3891
|
-
version:
|
|
3932
|
+
var schema = z39.object({
|
|
3933
|
+
version: z39.literal(2),
|
|
3892
3934
|
revision: oid,
|
|
3893
|
-
commit:
|
|
3894
|
-
entries:
|
|
3895
|
-
providerConfigurations:
|
|
3896
|
-
path:
|
|
3897
|
-
source:
|
|
3935
|
+
commit: z39.string().min(1).max(1048576),
|
|
3936
|
+
entries: z39.array(entrySchema).min(1).max(1e5),
|
|
3937
|
+
providerConfigurations: z39.array(z39.object({
|
|
3938
|
+
path: z39.string().max(4096).regex(/(?:^|\/)vercel\.json$/u),
|
|
3939
|
+
source: z39.string().max(1048576)
|
|
3898
3940
|
}).strict()).max(1e3)
|
|
3899
3941
|
}).strict();
|
|
3900
3942
|
var gitHash = (type, content) => createHash3("sha1").update(`${type} ${content.length}\0`).update(content).digest("hex");
|
|
@@ -3994,7 +4036,7 @@ async function readBuildProvenance(projectDirectory) {
|
|
|
3994
4036
|
const original = configurations.get(entry.path);
|
|
3995
4037
|
if (contents && original && entry.mode !== "120000") {
|
|
3996
4038
|
try {
|
|
3997
|
-
const object =
|
|
4039
|
+
const object = z39.record(z39.string(), z39.unknown());
|
|
3998
4040
|
const actual = object.parse(JSON.parse(contents.toString("utf8")));
|
|
3999
4041
|
const expected = object.parse(JSON.parse(original));
|
|
4000
4042
|
if (!Object.hasOwn(expected, "version") && actual.version === 2)
|
|
@@ -4048,38 +4090,38 @@ import { createHash as createHash4, randomBytes as randomBytes2, randomUUID as r
|
|
|
4048
4090
|
import { access as access6, mkdir as mkdir9, mkdtemp, rm as rm5, writeFile as writeFile6 } from "fs/promises";
|
|
4049
4091
|
import { tmpdir } from "os";
|
|
4050
4092
|
import { join as join12 } from "path";
|
|
4051
|
-
import { z as
|
|
4052
|
-
var envSchema =
|
|
4053
|
-
id:
|
|
4054
|
-
key:
|
|
4055
|
-
target:
|
|
4056
|
-
type:
|
|
4057
|
-
comment:
|
|
4058
|
-
updatedAt:
|
|
4093
|
+
import { z as z40 } from "zod";
|
|
4094
|
+
var envSchema = z40.object({
|
|
4095
|
+
id: z40.string(),
|
|
4096
|
+
key: z40.string(),
|
|
4097
|
+
target: z40.array(z40.string()),
|
|
4098
|
+
type: z40.string(),
|
|
4099
|
+
comment: z40.string().optional(),
|
|
4100
|
+
updatedAt: z40.number().optional()
|
|
4059
4101
|
});
|
|
4060
|
-
var deploymentSchema =
|
|
4061
|
-
id:
|
|
4062
|
-
projectId:
|
|
4063
|
-
ownerId:
|
|
4064
|
-
target:
|
|
4065
|
-
readyState:
|
|
4066
|
-
createdAt:
|
|
4067
|
-
url:
|
|
4068
|
-
meta:
|
|
4069
|
-
gitSource:
|
|
4102
|
+
var deploymentSchema = z40.object({
|
|
4103
|
+
id: z40.string(),
|
|
4104
|
+
projectId: z40.string(),
|
|
4105
|
+
ownerId: z40.string().optional(),
|
|
4106
|
+
target: z40.string().nullable(),
|
|
4107
|
+
readyState: z40.string(),
|
|
4108
|
+
createdAt: z40.number(),
|
|
4109
|
+
url: z40.string(),
|
|
4110
|
+
meta: z40.record(z40.string(), z40.unknown()).optional(),
|
|
4111
|
+
gitSource: z40.object({ sha: z40.string().optional() }).nullable().optional()
|
|
4070
4112
|
});
|
|
4071
|
-
var buildProofSchema =
|
|
4072
|
-
node:
|
|
4073
|
-
packageManager:
|
|
4074
|
-
packageManagerVersion:
|
|
4075
|
-
lockfileHash:
|
|
4076
|
-
revision:
|
|
4077
|
-
fieldContractHash:
|
|
4078
|
-
siteplane:
|
|
4079
|
-
runtimeNext:
|
|
4080
|
-
analytics:
|
|
4081
|
-
next:
|
|
4082
|
-
react:
|
|
4113
|
+
var buildProofSchema = z40.object({
|
|
4114
|
+
node: z40.string(),
|
|
4115
|
+
packageManager: z40.enum(["npm", "pnpm"]),
|
|
4116
|
+
packageManagerVersion: z40.string(),
|
|
4117
|
+
lockfileHash: z40.string(),
|
|
4118
|
+
revision: z40.string(),
|
|
4119
|
+
fieldContractHash: z40.string(),
|
|
4120
|
+
siteplane: z40.string(),
|
|
4121
|
+
runtimeNext: z40.string(),
|
|
4122
|
+
analytics: z40.string().optional(),
|
|
4123
|
+
next: z40.string(),
|
|
4124
|
+
react: z40.string()
|
|
4083
4125
|
}).strict();
|
|
4084
4126
|
var defaults = {
|
|
4085
4127
|
preflight: setupPreflightCommand,
|
|
@@ -4094,6 +4136,9 @@ var defaults = {
|
|
|
4094
4136
|
pause: (milliseconds) => new Promise((resolve5) => setTimeout(resolve5, milliseconds))
|
|
4095
4137
|
};
|
|
4096
4138
|
|
|
4139
|
+
// ../cli/dist/commands/setup-claim.js
|
|
4140
|
+
import { z as z41 } from "zod";
|
|
4141
|
+
|
|
4097
4142
|
// src/next.ts
|
|
4098
4143
|
var SiteplaneNextContractError = class extends Error {
|
|
4099
4144
|
constructor(code, message) {
|