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/index.js
CHANGED
|
@@ -2058,6 +2058,47 @@ var setupInstallationRequestSchema = z26.object({
|
|
|
2058
2058
|
}).strict()
|
|
2059
2059
|
}).strict();
|
|
2060
2060
|
|
|
2061
|
+
// ../shared/dist/setup-claim.js
|
|
2062
|
+
import { z as z27 } from "zod";
|
|
2063
|
+
var setupClaimCodeSchema = z27.string().regex(/^[0-9A-HJKMNP-TV-Z]{8}$/u);
|
|
2064
|
+
var setupClaimBindingSchema = z27.object({
|
|
2065
|
+
siteId: z27.string().uuid(),
|
|
2066
|
+
runId: z27.string().uuid()
|
|
2067
|
+
});
|
|
2068
|
+
var setupClaimReceiptSchema = setupClaimBindingSchema.extend({
|
|
2069
|
+
status: z27.literal("claimed"),
|
|
2070
|
+
requestId: z27.string().uuid(),
|
|
2071
|
+
workspaceId: z27.string().uuid(),
|
|
2072
|
+
userId: z27.string().uuid(),
|
|
2073
|
+
claimedAt: z27.string().datetime({ offset: true })
|
|
2074
|
+
}).strict();
|
|
2075
|
+
var setupClaimInspectionSchema = setupClaimBindingSchema.extend({
|
|
2076
|
+
status: z27.literal("pending"),
|
|
2077
|
+
requestId: z27.string().uuid(),
|
|
2078
|
+
siteName: z27.string(),
|
|
2079
|
+
userId: z27.string().uuid(),
|
|
2080
|
+
accountEmail: z27.string().email(),
|
|
2081
|
+
workspaceId: z27.string().uuid(),
|
|
2082
|
+
workspaceName: z27.string(),
|
|
2083
|
+
expiresAt: z27.string().datetime({ offset: true })
|
|
2084
|
+
}).strict();
|
|
2085
|
+
var setupClaimDenialSchema = z27.object({
|
|
2086
|
+
status: z27.enum([
|
|
2087
|
+
"invalid_claim_request",
|
|
2088
|
+
"invalid_installation",
|
|
2089
|
+
"already_claimed",
|
|
2090
|
+
"project_expired",
|
|
2091
|
+
"invalid_guest_session",
|
|
2092
|
+
"stale_setup_review",
|
|
2093
|
+
"verified_account_required",
|
|
2094
|
+
"workspace_access_denied",
|
|
2095
|
+
"workspace_entitlement_required",
|
|
2096
|
+
"site_limit_reached",
|
|
2097
|
+
"provisional_relationship_conflict",
|
|
2098
|
+
"rate_limited"
|
|
2099
|
+
])
|
|
2100
|
+
}).strict();
|
|
2101
|
+
|
|
2061
2102
|
// ../cli/dist/analytics/static-scan.js
|
|
2062
2103
|
import ts from "typescript";
|
|
2063
2104
|
|
|
@@ -2263,16 +2304,16 @@ function createAnalyticsCliRequestHeaders(config) {
|
|
|
2263
2304
|
}
|
|
2264
2305
|
|
|
2265
2306
|
// ../cli/dist/commands/analytics/public-key.js
|
|
2266
|
-
import { z as
|
|
2267
|
-
var responseSchema =
|
|
2268
|
-
ok:
|
|
2269
|
-
data:
|
|
2270
|
-
rawPublicKey:
|
|
2307
|
+
import { z as z28 } from "zod";
|
|
2308
|
+
var responseSchema = z28.object({
|
|
2309
|
+
ok: z28.literal(true),
|
|
2310
|
+
data: z28.object({
|
|
2311
|
+
rawPublicKey: z28.string().regex(/^pk_siteplane_[A-Za-z0-9_-]{16}_[A-Za-z0-9_-]{43}$/)
|
|
2271
2312
|
})
|
|
2272
2313
|
});
|
|
2273
|
-
var errorResponseSchema =
|
|
2274
|
-
error:
|
|
2275
|
-
code:
|
|
2314
|
+
var errorResponseSchema = z28.object({
|
|
2315
|
+
error: z28.object({
|
|
2316
|
+
code: z28.string().regex(/^[a-z][a-z0-9_.-]+$/u)
|
|
2276
2317
|
})
|
|
2277
2318
|
});
|
|
2278
2319
|
async function analyticsPublicKeyCommand(input) {
|
|
@@ -2294,13 +2335,13 @@ async function analyticsPublicKeyCommand(input) {
|
|
|
2294
2335
|
}
|
|
2295
2336
|
|
|
2296
2337
|
// ../cli/dist/commands/analytics/prepare.js
|
|
2297
|
-
import { z as
|
|
2298
|
-
var resultSchema =
|
|
2299
|
-
ok:
|
|
2300
|
-
data:
|
|
2301
|
-
rawPublicKey:
|
|
2302
|
-
generation:
|
|
2303
|
-
status:
|
|
2338
|
+
import { z as z29 } from "zod";
|
|
2339
|
+
var resultSchema = z29.object({
|
|
2340
|
+
ok: z29.literal(true),
|
|
2341
|
+
data: z29.object({
|
|
2342
|
+
rawPublicKey: z29.string().regex(/^pk_siteplane_[A-Za-z0-9_-]{16}_[A-Za-z0-9_-]{43}$/u),
|
|
2343
|
+
generation: z29.number().int().positive(),
|
|
2344
|
+
status: z29.enum([
|
|
2304
2345
|
"setup_started",
|
|
2305
2346
|
"test_mode",
|
|
2306
2347
|
"active",
|
|
@@ -2310,8 +2351,8 @@ var resultSchema = z28.object({
|
|
|
2310
2351
|
])
|
|
2311
2352
|
}).strict()
|
|
2312
2353
|
}).strict();
|
|
2313
|
-
var errorSchema =
|
|
2314
|
-
error:
|
|
2354
|
+
var errorSchema = z29.object({
|
|
2355
|
+
error: z29.object({ code: z29.string().regex(/^[a-z][a-z0-9_.-]+$/u) })
|
|
2315
2356
|
});
|
|
2316
2357
|
|
|
2317
2358
|
// ../cli/dist/commands/analytics/test.js
|
|
@@ -2506,19 +2547,19 @@ function requireContentExportScope(scopes) {
|
|
|
2506
2547
|
import { access, chmod, open, readFile as readFile5, rename, rm } from "fs/promises";
|
|
2507
2548
|
import { randomUUID as randomUUID2 } from "crypto";
|
|
2508
2549
|
import { join as join3 } from "path";
|
|
2509
|
-
import { z as
|
|
2510
|
-
var siteplaneProjectConfigSchema =
|
|
2511
|
-
version:
|
|
2512
|
-
apiBaseUrl:
|
|
2513
|
-
siteId:
|
|
2514
|
-
publicSiteKeyId:
|
|
2515
|
-
publicSiteKey:
|
|
2516
|
-
runId:
|
|
2517
|
-
appDirectory:
|
|
2518
|
-
taskContractVersion:
|
|
2519
|
-
adminProtocolVersion:
|
|
2550
|
+
import { z as z30 } from "zod";
|
|
2551
|
+
var siteplaneProjectConfigSchema = z30.object({
|
|
2552
|
+
version: z30.literal(2),
|
|
2553
|
+
apiBaseUrl: z30.string().url(),
|
|
2554
|
+
siteId: z30.string().uuid(),
|
|
2555
|
+
publicSiteKeyId: z30.string().uuid(),
|
|
2556
|
+
publicSiteKey: z30.string().trim().min(1),
|
|
2557
|
+
runId: z30.string().uuid(),
|
|
2558
|
+
appDirectory: z30.string().min(1),
|
|
2559
|
+
taskContractVersion: z30.literal("siteplane.setup-task.v2"),
|
|
2560
|
+
adminProtocolVersion: z30.literal(2),
|
|
2520
2561
|
packages: siteSetupPackagesSchema,
|
|
2521
|
-
fieldContractHash:
|
|
2562
|
+
fieldContractHash: z30.string().regex(/^sha256:[0-9a-f]{64}$/iu).optional()
|
|
2522
2563
|
}).strict();
|
|
2523
2564
|
async function readProjectPackageJson(projectDir) {
|
|
2524
2565
|
return JSON.parse(await readFile5(join3(projectDir, "package.json"), "utf8"));
|
|
@@ -2578,26 +2619,27 @@ import { randomUUID as randomUUID3 } from "crypto";
|
|
|
2578
2619
|
import { chmod as chmod2, lstat, mkdir as mkdir5, open as open2, readFile as readFile6, rename as rename2, rm as rm2 } from "fs/promises";
|
|
2579
2620
|
import { dirname as dirname5, join as join4, relative } from "path";
|
|
2580
2621
|
import { promisify } from "util";
|
|
2581
|
-
import { z as
|
|
2582
|
-
var localSetupInstallationSchema =
|
|
2583
|
-
key:
|
|
2584
|
-
idempotencyKey:
|
|
2585
|
-
apiBaseUrl:
|
|
2622
|
+
import { z as z31 } from "zod";
|
|
2623
|
+
var localSetupInstallationSchema = z31.object({
|
|
2624
|
+
key: z31.string().regex(/^[A-Za-z0-9_-]{43}$/u),
|
|
2625
|
+
idempotencyKey: z31.string().uuid(),
|
|
2626
|
+
apiBaseUrl: z31.string().url(),
|
|
2586
2627
|
request: setupInstallationRequestSchema,
|
|
2587
|
-
bootstrapAcknowledged:
|
|
2628
|
+
bootstrapAcknowledged: z31.boolean()
|
|
2588
2629
|
}).strict();
|
|
2589
|
-
var siteplaneCredentialsSchema =
|
|
2590
|
-
accessToken:
|
|
2591
|
-
siteRevalidationSecret:
|
|
2630
|
+
var siteplaneCredentialsSchema = z31.object({
|
|
2631
|
+
accessToken: z31.string().trim().min(1),
|
|
2632
|
+
siteRevalidationSecret: z31.string().trim().min(1),
|
|
2592
2633
|
installation: localSetupInstallationSchema.optional(),
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2634
|
+
claimReceipt: setupClaimReceiptSchema.optional(),
|
|
2635
|
+
adminSession: z31.object({
|
|
2636
|
+
secret: z31.string().regex(/^[A-Za-z0-9_-]{43}$/u),
|
|
2637
|
+
generation: z31.string().uuid()
|
|
2596
2638
|
}).strict().optional()
|
|
2597
2639
|
}).strict();
|
|
2598
|
-
var localSetupCredentialsSchema =
|
|
2640
|
+
var localSetupCredentialsSchema = z31.union([
|
|
2599
2641
|
siteplaneCredentialsSchema,
|
|
2600
|
-
|
|
2642
|
+
z31.object({ installation: localSetupInstallationSchema }).strict()
|
|
2601
2643
|
]);
|
|
2602
2644
|
async function assertLocalCredentialsPathSafe(projectDir, options = {}) {
|
|
2603
2645
|
const path = join4(projectDir, ".siteplane/credentials.json");
|
|
@@ -2670,6 +2712,12 @@ async function writeCredentialsAtomically(path, credentials) {
|
|
|
2670
2712
|
try {
|
|
2671
2713
|
await rename2(temporaryPath, path);
|
|
2672
2714
|
await chmod2(path, 384);
|
|
2715
|
+
const directory = await open2(dirname5(path), "r");
|
|
2716
|
+
try {
|
|
2717
|
+
await directory.sync();
|
|
2718
|
+
} finally {
|
|
2719
|
+
await directory.close();
|
|
2720
|
+
}
|
|
2673
2721
|
} catch (error) {
|
|
2674
2722
|
await rm2(temporaryPath, { force: true });
|
|
2675
2723
|
throw error;
|
|
@@ -2689,7 +2737,7 @@ async function gitPathMatches(projectDir, path, command) {
|
|
|
2689
2737
|
// ../cli/dist/commands/init.js
|
|
2690
2738
|
import { access as access3 } from "fs/promises";
|
|
2691
2739
|
import { join as join7, relative as relative3 } from "path";
|
|
2692
|
-
import { z as
|
|
2740
|
+
import { z as z34 } from "zod";
|
|
2693
2741
|
|
|
2694
2742
|
// ../cli/dist/commands/setup-preflight.js
|
|
2695
2743
|
import { createHash as createHash2 } from "crypto";
|
|
@@ -2701,11 +2749,11 @@ import { parse as parseYaml } from "yaml";
|
|
|
2701
2749
|
import { createRequire } from "module";
|
|
2702
2750
|
import { readFile as readFile7 } from "fs/promises";
|
|
2703
2751
|
import { join as join5 } from "path";
|
|
2704
|
-
import { z as
|
|
2705
|
-
var packageSchema =
|
|
2706
|
-
name:
|
|
2707
|
-
version:
|
|
2708
|
-
peerDependencies:
|
|
2752
|
+
import { z as z32 } from "zod";
|
|
2753
|
+
var packageSchema = z32.object({
|
|
2754
|
+
name: z32.string().optional(),
|
|
2755
|
+
version: z32.string(),
|
|
2756
|
+
peerDependencies: z32.record(z32.string(), z32.string()).optional()
|
|
2709
2757
|
});
|
|
2710
2758
|
async function readInstalledPackage(projectDir, name2) {
|
|
2711
2759
|
const require2 = createRequire(join5(projectDir, "package.json"));
|
|
@@ -2723,7 +2771,7 @@ async function readInstalledPackage(projectDir, name2) {
|
|
|
2723
2771
|
// ../cli/dist/commands/setup-preflight.js
|
|
2724
2772
|
import { access as access2, readFile as readFile8, realpath, readdir, readlink } from "fs/promises";
|
|
2725
2773
|
import { dirname as dirname6, join as join6, relative as relative2, resolve, sep } from "path";
|
|
2726
|
-
import { z as
|
|
2774
|
+
import { z as z33 } from "zod";
|
|
2727
2775
|
|
|
2728
2776
|
// ../cli/dist/commands/setup-process.js
|
|
2729
2777
|
import { spawn } from "child_process";
|
|
@@ -2824,29 +2872,29 @@ async function setupVercelApi(cwd, endpoint, body, method, options) {
|
|
|
2824
2872
|
}
|
|
2825
2873
|
|
|
2826
2874
|
// ../cli/dist/commands/setup-preflight.js
|
|
2827
|
-
var manifestSchema =
|
|
2828
|
-
packageManager:
|
|
2829
|
-
engines:
|
|
2830
|
-
dependencies:
|
|
2831
|
-
devDependencies:
|
|
2832
|
-
scripts:
|
|
2833
|
-
workspaces:
|
|
2834
|
-
});
|
|
2835
|
-
var vercelProjectSchema =
|
|
2836
|
-
id:
|
|
2837
|
-
accountId:
|
|
2838
|
-
name:
|
|
2839
|
-
nodeVersion:
|
|
2840
|
-
rootDirectory:
|
|
2841
|
-
framework:
|
|
2842
|
-
installCommand:
|
|
2843
|
-
buildCommand:
|
|
2844
|
-
link:
|
|
2845
|
-
type:
|
|
2846
|
-
repo:
|
|
2847
|
-
repoId:
|
|
2848
|
-
org:
|
|
2849
|
-
productionBranch:
|
|
2875
|
+
var manifestSchema = z33.object({
|
|
2876
|
+
packageManager: z33.string().optional(),
|
|
2877
|
+
engines: z33.object({ node: z33.string().optional() }).optional(),
|
|
2878
|
+
dependencies: z33.record(z33.string(), z33.string()).optional(),
|
|
2879
|
+
devDependencies: z33.record(z33.string(), z33.string()).optional(),
|
|
2880
|
+
scripts: z33.record(z33.string(), z33.string()).optional(),
|
|
2881
|
+
workspaces: z33.unknown().optional()
|
|
2882
|
+
});
|
|
2883
|
+
var vercelProjectSchema = z33.object({
|
|
2884
|
+
id: z33.string(),
|
|
2885
|
+
accountId: z33.string(),
|
|
2886
|
+
name: z33.string(),
|
|
2887
|
+
nodeVersion: z33.string().nullable().optional(),
|
|
2888
|
+
rootDirectory: z33.string().nullable().optional(),
|
|
2889
|
+
framework: z33.string().nullable().optional(),
|
|
2890
|
+
installCommand: z33.string().nullable().optional(),
|
|
2891
|
+
buildCommand: z33.string().nullable().optional(),
|
|
2892
|
+
link: z33.object({
|
|
2893
|
+
type: z33.string(),
|
|
2894
|
+
repo: z33.string().optional(),
|
|
2895
|
+
repoId: z33.union([z33.string(), z33.number()]).optional(),
|
|
2896
|
+
org: z33.string().optional(),
|
|
2897
|
+
productionBranch: z33.string().optional()
|
|
2850
2898
|
}).nullable().optional()
|
|
2851
2899
|
});
|
|
2852
2900
|
var exists = async (path) => access2(path).then(() => true, () => false);
|
|
@@ -2903,9 +2951,9 @@ async function inspectSetupLocalProject(projectDir) {
|
|
|
2903
2951
|
const rootManifest = manifestSchema.parse(JSON.parse(await readFile8(join6(lockfileRoot, "package.json"), "utf8")));
|
|
2904
2952
|
if (lockfileRoot !== projectDirectory) {
|
|
2905
2953
|
const workspaceFile = join6(lockfileRoot, "pnpm-workspace.yaml");
|
|
2906
|
-
const workspace = lockName === "pnpm-lock.yaml" && await exists(workspaceFile) ?
|
|
2907
|
-
|
|
2908
|
-
|
|
2954
|
+
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([
|
|
2955
|
+
z33.array(z33.string()),
|
|
2956
|
+
z33.object({ packages: z33.array(z33.string()) }).transform((value) => value.packages)
|
|
2909
2957
|
]).parse(rootManifest.workspaces);
|
|
2910
2958
|
const selected = relative2(lockfileRoot, projectDirectory).split(sep).join("/");
|
|
2911
2959
|
if (!workspace.some((pattern) => !pattern.startsWith("!") && minimatch(selected, pattern)) || workspace.some((pattern) => pattern.startsWith("!") && minimatch(selected, pattern.slice(1))))
|
|
@@ -2919,11 +2967,11 @@ async function inspectSetupLocalProject(projectDir) {
|
|
|
2919
2967
|
break;
|
|
2920
2968
|
}
|
|
2921
2969
|
const lockText = await readFile8(join6(lockfileRoot, lockName), "utf8");
|
|
2922
|
-
const npmLock = lockName === "package-lock.json" ?
|
|
2923
|
-
lockfileVersion:
|
|
2924
|
-
packages:
|
|
2925
|
-
version:
|
|
2926
|
-
peerDependencies:
|
|
2970
|
+
const npmLock = lockName === "package-lock.json" ? z33.object({
|
|
2971
|
+
lockfileVersion: z33.number(),
|
|
2972
|
+
packages: z33.record(z33.string(), z33.object({
|
|
2973
|
+
version: z33.string().optional(),
|
|
2974
|
+
peerDependencies: z33.record(z33.string(), z33.string()).optional()
|
|
2927
2975
|
})).optional()
|
|
2928
2976
|
}).parse(JSON.parse(lockText)) : null;
|
|
2929
2977
|
async function version2(name3) {
|
|
@@ -3063,9 +3111,9 @@ async function setupPreflightCommand(input) {
|
|
|
3063
3111
|
linkDirectory = dirname6(linkDirectory);
|
|
3064
3112
|
if (!await exists(join6(linkDirectory, ".vercel/project.json")))
|
|
3065
3113
|
fail("vercel_project_not_linked", "Link this application to its intended Vercel project before setup; Siteplane will not guess a target.");
|
|
3066
|
-
const linked =
|
|
3067
|
-
projectId:
|
|
3068
|
-
orgId:
|
|
3114
|
+
const linked = z33.object({
|
|
3115
|
+
projectId: z33.string().regex(/^prj_[A-Za-z0-9]+$/u),
|
|
3116
|
+
orgId: z33.string().regex(/^(?:team|user)_[A-Za-z0-9]+$/u)
|
|
3069
3117
|
}).parse(JSON.parse(await readFile8(join6(linkDirectory, ".vercel/project.json"), "utf8")));
|
|
3070
3118
|
const project = vercelProjectSchema.parse(await setupVercelApi(linkDirectory, `/v9/projects/${linked.projectId}?teamId=${linked.orgId}`));
|
|
3071
3119
|
if (project.id !== linked.projectId || project.accountId !== linked.orgId)
|
|
@@ -3079,11 +3127,11 @@ async function setupPreflightCommand(input) {
|
|
|
3079
3127
|
fail("vercel_production_branch_conflict", "The local branch differs from the bound Vercel Production branch.");
|
|
3080
3128
|
if (project.link?.repo && project.link.org && !local.git.remote?.replace(/\.git$/u, "").endsWith(`${project.link.org}/${project.link.repo}`))
|
|
3081
3129
|
fail("vercel_git_conflict", "The local origin repository differs from the Vercel Git connection.");
|
|
3082
|
-
const env =
|
|
3083
|
-
envs:
|
|
3084
|
-
key:
|
|
3085
|
-
value:
|
|
3086
|
-
target:
|
|
3130
|
+
const env = z33.object({
|
|
3131
|
+
envs: z33.array(z33.object({
|
|
3132
|
+
key: z33.string(),
|
|
3133
|
+
value: z33.string().optional(),
|
|
3134
|
+
target: z33.array(z33.string()).optional()
|
|
3087
3135
|
}))
|
|
3088
3136
|
}).parse(await setupVercelApi(linkDirectory, `/v10/projects/${linked.projectId}/env?teamId=${linked.orgId}`));
|
|
3089
3137
|
const corepack = env.envs.some((item) => item.key === "ENABLE_EXPERIMENTAL_COREPACK" && item.value === "1" && item.target?.includes("production"));
|
|
@@ -3173,26 +3221,26 @@ async function initCommand(input) {
|
|
|
3173
3221
|
]
|
|
3174
3222
|
};
|
|
3175
3223
|
}
|
|
3176
|
-
var siteSetupBootstrapDataSchema =
|
|
3177
|
-
credentialPurpose:
|
|
3178
|
-
apiBaseUrl:
|
|
3179
|
-
siteId:
|
|
3180
|
-
publicSiteKeyId:
|
|
3181
|
-
publicSiteKey:
|
|
3182
|
-
accessToken:
|
|
3183
|
-
siteRevalidationSecret:
|
|
3184
|
-
runId:
|
|
3224
|
+
var siteSetupBootstrapDataSchema = z34.object({
|
|
3225
|
+
credentialPurpose: z34.literal("site_setup"),
|
|
3226
|
+
apiBaseUrl: z34.string().url(),
|
|
3227
|
+
siteId: z34.string().uuid(),
|
|
3228
|
+
publicSiteKeyId: z34.string().uuid(),
|
|
3229
|
+
publicSiteKey: z34.string().trim().min(1),
|
|
3230
|
+
accessToken: z34.string().trim().min(1),
|
|
3231
|
+
siteRevalidationSecret: z34.string().regex(/^[A-Za-z0-9_-]{43}$/u),
|
|
3232
|
+
runId: z34.string().uuid(),
|
|
3185
3233
|
packages: siteSetupPackagesSchema
|
|
3186
3234
|
}).strict();
|
|
3187
|
-
var featureBootstrapDataSchema =
|
|
3188
|
-
credentialPurpose:
|
|
3189
|
-
apiBaseUrl:
|
|
3190
|
-
siteId:
|
|
3191
|
-
accessToken:
|
|
3235
|
+
var featureBootstrapDataSchema = z34.object({
|
|
3236
|
+
credentialPurpose: z34.enum(["analytics", "booking"]),
|
|
3237
|
+
apiBaseUrl: z34.string().url(),
|
|
3238
|
+
siteId: z34.string().uuid(),
|
|
3239
|
+
accessToken: z34.string().trim().min(1)
|
|
3192
3240
|
}).strict();
|
|
3193
|
-
var bootstrapResponseSchema =
|
|
3194
|
-
ok:
|
|
3195
|
-
data:
|
|
3241
|
+
var bootstrapResponseSchema = z34.object({
|
|
3242
|
+
ok: z34.literal(true),
|
|
3243
|
+
data: z34.discriminatedUnion("credentialPurpose", [
|
|
3196
3244
|
siteSetupBootstrapDataSchema,
|
|
3197
3245
|
featureBootstrapDataSchema
|
|
3198
3246
|
])
|
|
@@ -3236,6 +3284,7 @@ async function persistSiteSetupBootstrap(input, bootstrap, appDirectory, install
|
|
|
3236
3284
|
const previousCredentials = previous ? await access3(join7(input.projectDir, ".siteplane/credentials.json")).then(() => readLocalSetupCredentials(input.projectDir), () => null) : null;
|
|
3237
3285
|
const credentialsPath = await writeLocalCredentials(input.projectDir, {
|
|
3238
3286
|
...previousCredentials && "adminSession" in previousCredentials && previousCredentials.adminSession ? { adminSession: previousCredentials.adminSession } : {},
|
|
3287
|
+
...previousCredentials && "claimReceipt" in previousCredentials && previousCredentials.claimReceipt ? { claimReceipt: previousCredentials.claimReceipt } : {},
|
|
3239
3288
|
accessToken: bootstrap.accessToken,
|
|
3240
3289
|
siteRevalidationSecret: bootstrap.siteRevalidationSecret,
|
|
3241
3290
|
...installation ?? previousCredentials?.installation ? { installation: installation ?? previousCredentials?.installation } : {}
|
|
@@ -3351,7 +3400,7 @@ async function collectSourceFiles(directory) {
|
|
|
3351
3400
|
import { execFile as execFile2 } from "child_process";
|
|
3352
3401
|
import { readFile as readFile9 } from "fs/promises";
|
|
3353
3402
|
import { promisify as promisify2 } from "util";
|
|
3354
|
-
import { z as
|
|
3403
|
+
import { z as z35 } from "zod";
|
|
3355
3404
|
|
|
3356
3405
|
// ../cli/dist/scan/next-source-scan.js
|
|
3357
3406
|
import ts2 from "typescript";
|
|
@@ -3361,32 +3410,32 @@ var editableComponentNames = new Set(["Image", "Text", "LongText", "Link"].map((
|
|
|
3361
3410
|
|
|
3362
3411
|
// ../cli/dist/commands/site-setup.js
|
|
3363
3412
|
var execFileAsync2 = promisify2(execFile2);
|
|
3364
|
-
var safeErrorSchema =
|
|
3365
|
-
code:
|
|
3366
|
-
message:
|
|
3413
|
+
var safeErrorSchema = z35.object({
|
|
3414
|
+
code: z35.string().trim().min(1),
|
|
3415
|
+
message: z35.string().trim().min(1)
|
|
3367
3416
|
}).passthrough();
|
|
3368
|
-
var errorResponseSchema2 =
|
|
3369
|
-
var contextDataSchema =
|
|
3417
|
+
var errorResponseSchema2 = z35.object({ ok: z35.literal(false), error: safeErrorSchema }).passthrough();
|
|
3418
|
+
var contextDataSchema = z35.object({
|
|
3370
3419
|
task: siteSetupTaskSchema.refine((task) => task.run !== null)
|
|
3371
3420
|
}).strict();
|
|
3372
|
-
var contextResponseSchema =
|
|
3373
|
-
var applyDataSchema =
|
|
3374
|
-
status:
|
|
3375
|
-
runId:
|
|
3376
|
-
contractVersionId:
|
|
3377
|
-
fieldContractHash:
|
|
3378
|
-
editorDefinitionHash:
|
|
3379
|
-
fieldCount:
|
|
3380
|
-
routeCount:
|
|
3421
|
+
var contextResponseSchema = z35.object({ ok: z35.literal(true), data: contextDataSchema }).strict();
|
|
3422
|
+
var applyDataSchema = z35.object({
|
|
3423
|
+
status: z35.enum(["applied", "ready_for_review"]),
|
|
3424
|
+
runId: z35.string().uuid().optional(),
|
|
3425
|
+
contractVersionId: z35.string().uuid().optional(),
|
|
3426
|
+
fieldContractHash: z35.string().regex(/^sha256:[0-9a-f]{64}$/u),
|
|
3427
|
+
editorDefinitionHash: z35.string().regex(/^sha256:[0-9a-f]{64}$/u).optional(),
|
|
3428
|
+
fieldCount: z35.number().int().nonnegative().optional(),
|
|
3429
|
+
routeCount: z35.number().int().nonnegative().optional()
|
|
3381
3430
|
}).strict();
|
|
3382
|
-
var applyResponseSchema =
|
|
3383
|
-
var verifyDataSchema =
|
|
3384
|
-
status:
|
|
3385
|
-
runId:
|
|
3386
|
-
deploymentOrigin:
|
|
3387
|
-
deploymentRevision:
|
|
3431
|
+
var applyResponseSchema = z35.object({ ok: z35.literal(true), data: applyDataSchema }).strict();
|
|
3432
|
+
var verifyDataSchema = z35.object({
|
|
3433
|
+
status: z35.literal("ready_for_review"),
|
|
3434
|
+
runId: z35.string().uuid().optional(),
|
|
3435
|
+
deploymentOrigin: z35.string().url().optional(),
|
|
3436
|
+
deploymentRevision: z35.string().optional()
|
|
3388
3437
|
}).strict();
|
|
3389
|
-
var verifyResponseSchema =
|
|
3438
|
+
var verifyResponseSchema = z35.object({ ok: z35.literal(true), data: verifyDataSchema }).strict();
|
|
3390
3439
|
async function siteSetupContextCommand(input) {
|
|
3391
3440
|
const response = await postSiteSetup(input, "context", {});
|
|
3392
3441
|
const parsed = contextResponseSchema.safeParse(response.payload);
|
|
@@ -3483,19 +3532,19 @@ async function readGitRevision(projectDir) {
|
|
|
3483
3532
|
import { randomBytes, randomUUID as randomUUID4 } from "crypto";
|
|
3484
3533
|
import { access as access4 } from "fs/promises";
|
|
3485
3534
|
import { join as join9, relative as relative5 } from "path";
|
|
3486
|
-
import { z as
|
|
3487
|
-
var bootstrapResponseSchema2 =
|
|
3488
|
-
ok:
|
|
3535
|
+
import { z as z36 } from "zod";
|
|
3536
|
+
var bootstrapResponseSchema2 = z36.object({
|
|
3537
|
+
ok: z36.literal(true),
|
|
3489
3538
|
data: siteSetupBootstrapDataSchema
|
|
3490
3539
|
}).strict();
|
|
3491
3540
|
|
|
3492
3541
|
// ../cli/dist/commands/setup-review.js
|
|
3493
|
-
import { z as
|
|
3494
|
-
var responseSchema2 =
|
|
3495
|
-
ok:
|
|
3496
|
-
data:
|
|
3497
|
-
reviewUrl:
|
|
3498
|
-
expiresAt:
|
|
3542
|
+
import { z as z37 } from "zod";
|
|
3543
|
+
var responseSchema2 = z37.object({
|
|
3544
|
+
ok: z37.literal(true),
|
|
3545
|
+
data: z37.object({
|
|
3546
|
+
reviewUrl: z37.string().url(),
|
|
3547
|
+
expiresAt: z37.string().datetime({ offset: true })
|
|
3499
3548
|
}).strict()
|
|
3500
3549
|
}).strict();
|
|
3501
3550
|
|
|
@@ -3509,8 +3558,8 @@ import ts3 from "typescript";
|
|
|
3509
3558
|
import { randomUUID as randomUUID6 } from "crypto";
|
|
3510
3559
|
import { lstat as lstat3, mkdir as mkdir7, open as open4, readFile as readFile11, rm as rm4, rmdir } from "fs/promises";
|
|
3511
3560
|
import { resolve as resolve2 } from "path";
|
|
3512
|
-
import { z as
|
|
3513
|
-
var ownerSchema =
|
|
3561
|
+
import { z as z38 } from "zod";
|
|
3562
|
+
var ownerSchema = z38.object({ pid: z38.number().int().positive(), nonce: z38.string().uuid() }).strict();
|
|
3514
3563
|
|
|
3515
3564
|
// ../cli/dist/config/build-provenance.js
|
|
3516
3565
|
import { createHash as createHash3 } from "crypto";
|
|
@@ -3518,23 +3567,23 @@ import { execFile as execFile3 } from "child_process";
|
|
|
3518
3567
|
import { lstat as lstat4, readFile as readFile12, writeFile as writeFile5, mkdir as mkdir8 } from "fs/promises";
|
|
3519
3568
|
import { dirname as dirname8, isAbsolute as isAbsolute2, join as join11, relative as relative7, resolve as resolve3, sep as sep3 } from "path";
|
|
3520
3569
|
import { isDeepStrictEqual, promisify as promisify3 } from "util";
|
|
3521
|
-
import { z as
|
|
3570
|
+
import { z as z39 } from "zod";
|
|
3522
3571
|
var execute = promisify3(execFile3);
|
|
3523
3572
|
var name = ".siteplane/build-source.json";
|
|
3524
|
-
var oid =
|
|
3525
|
-
var entrySchema =
|
|
3526
|
-
path:
|
|
3527
|
-
mode:
|
|
3573
|
+
var oid = z39.string().regex(/^[0-9a-f]{40}$/u);
|
|
3574
|
+
var entrySchema = z39.object({
|
|
3575
|
+
path: z39.string().min(1).max(4096),
|
|
3576
|
+
mode: z39.enum(["100644", "100755", "120000"]),
|
|
3528
3577
|
oid
|
|
3529
3578
|
}).strict();
|
|
3530
|
-
var schema =
|
|
3531
|
-
version:
|
|
3579
|
+
var schema = z39.object({
|
|
3580
|
+
version: z39.literal(2),
|
|
3532
3581
|
revision: oid,
|
|
3533
|
-
commit:
|
|
3534
|
-
entries:
|
|
3535
|
-
providerConfigurations:
|
|
3536
|
-
path:
|
|
3537
|
-
source:
|
|
3582
|
+
commit: z39.string().min(1).max(1048576),
|
|
3583
|
+
entries: z39.array(entrySchema).min(1).max(1e5),
|
|
3584
|
+
providerConfigurations: z39.array(z39.object({
|
|
3585
|
+
path: z39.string().max(4096).regex(/(?:^|\/)vercel\.json$/u),
|
|
3586
|
+
source: z39.string().max(1048576)
|
|
3538
3587
|
}).strict()).max(1e3)
|
|
3539
3588
|
}).strict();
|
|
3540
3589
|
async function writeBuildProvenance(checkout, revision) {
|
|
@@ -3583,38 +3632,38 @@ import { createHash as createHash4, randomBytes as randomBytes2, randomUUID as r
|
|
|
3583
3632
|
import { access as access6, mkdir as mkdir9, mkdtemp, rm as rm5, writeFile as writeFile6 } from "fs/promises";
|
|
3584
3633
|
import { tmpdir } from "os";
|
|
3585
3634
|
import { join as join12 } from "path";
|
|
3586
|
-
import { z as
|
|
3587
|
-
var envSchema =
|
|
3588
|
-
id:
|
|
3589
|
-
key:
|
|
3590
|
-
target:
|
|
3591
|
-
type:
|
|
3592
|
-
comment:
|
|
3593
|
-
updatedAt:
|
|
3594
|
-
});
|
|
3595
|
-
var deploymentSchema =
|
|
3596
|
-
id:
|
|
3597
|
-
projectId:
|
|
3598
|
-
ownerId:
|
|
3599
|
-
target:
|
|
3600
|
-
readyState:
|
|
3601
|
-
createdAt:
|
|
3602
|
-
url:
|
|
3603
|
-
meta:
|
|
3604
|
-
gitSource:
|
|
3605
|
-
});
|
|
3606
|
-
var buildProofSchema =
|
|
3607
|
-
node:
|
|
3608
|
-
packageManager:
|
|
3609
|
-
packageManagerVersion:
|
|
3610
|
-
lockfileHash:
|
|
3611
|
-
revision:
|
|
3612
|
-
fieldContractHash:
|
|
3613
|
-
siteplane:
|
|
3614
|
-
runtimeNext:
|
|
3615
|
-
analytics:
|
|
3616
|
-
next:
|
|
3617
|
-
react:
|
|
3635
|
+
import { z as z40 } from "zod";
|
|
3636
|
+
var envSchema = z40.object({
|
|
3637
|
+
id: z40.string(),
|
|
3638
|
+
key: z40.string(),
|
|
3639
|
+
target: z40.array(z40.string()),
|
|
3640
|
+
type: z40.string(),
|
|
3641
|
+
comment: z40.string().optional(),
|
|
3642
|
+
updatedAt: z40.number().optional()
|
|
3643
|
+
});
|
|
3644
|
+
var deploymentSchema = z40.object({
|
|
3645
|
+
id: z40.string(),
|
|
3646
|
+
projectId: z40.string(),
|
|
3647
|
+
ownerId: z40.string().optional(),
|
|
3648
|
+
target: z40.string().nullable(),
|
|
3649
|
+
readyState: z40.string(),
|
|
3650
|
+
createdAt: z40.number(),
|
|
3651
|
+
url: z40.string(),
|
|
3652
|
+
meta: z40.record(z40.string(), z40.unknown()).optional(),
|
|
3653
|
+
gitSource: z40.object({ sha: z40.string().optional() }).nullable().optional()
|
|
3654
|
+
});
|
|
3655
|
+
var buildProofSchema = z40.object({
|
|
3656
|
+
node: z40.string(),
|
|
3657
|
+
packageManager: z40.enum(["npm", "pnpm"]),
|
|
3658
|
+
packageManagerVersion: z40.string(),
|
|
3659
|
+
lockfileHash: z40.string(),
|
|
3660
|
+
revision: z40.string(),
|
|
3661
|
+
fieldContractHash: z40.string(),
|
|
3662
|
+
siteplane: z40.string(),
|
|
3663
|
+
runtimeNext: z40.string(),
|
|
3664
|
+
analytics: z40.string().optional(),
|
|
3665
|
+
next: z40.string(),
|
|
3666
|
+
react: z40.string()
|
|
3618
3667
|
}).strict();
|
|
3619
3668
|
var defaults = {
|
|
3620
3669
|
preflight: setupPreflightCommand,
|
|
@@ -3628,6 +3677,9 @@ var defaults = {
|
|
|
3628
3677
|
now: Date.now,
|
|
3629
3678
|
pause: (milliseconds) => new Promise((resolve4) => setTimeout(resolve4, milliseconds))
|
|
3630
3679
|
};
|
|
3680
|
+
|
|
3681
|
+
// ../cli/dist/commands/setup-claim.js
|
|
3682
|
+
import { z as z41 } from "zod";
|
|
3631
3683
|
export {
|
|
3632
3684
|
bookingCheckCommand,
|
|
3633
3685
|
bookingInitCommand,
|