@spacefast/common 0.0.2
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 +42 -0
- package/dist/brand.d.ts +15 -0
- package/dist/brand.js +24 -0
- package/dist/config/domains.d.ts +30 -0
- package/dist/config/domains.js +75 -0
- package/dist/config/index.d.ts +1 -0
- package/dist/config/index.js +3 -0
- package/dist/contracts/abuse.d.ts +93 -0
- package/dist/contracts/abuse.js +50 -0
- package/dist/contracts/access.d.ts +409 -0
- package/dist/contracts/access.js +396 -0
- package/dist/contracts/account.d.ts +28 -0
- package/dist/contracts/account.js +54 -0
- package/dist/contracts/activity.d.ts +118 -0
- package/dist/contracts/activity.js +180 -0
- package/dist/contracts/analytics.d.ts +56 -0
- package/dist/contracts/analytics.js +91 -0
- package/dist/contracts/annotations.d.ts +327 -0
- package/dist/contracts/annotations.js +234 -0
- package/dist/contracts/api-keys.d.ts +517 -0
- package/dist/contracts/api-keys.js +235 -0
- package/dist/contracts/archives.d.ts +332 -0
- package/dist/contracts/archives.js +120 -0
- package/dist/contracts/auth.d.ts +86 -0
- package/dist/contracts/auth.js +82 -0
- package/dist/contracts/beta.d.ts +106 -0
- package/dist/contracts/beta.js +104 -0
- package/dist/contracts/billing.d.ts +328 -0
- package/dist/contracts/billing.js +203 -0
- package/dist/contracts/builds.d.ts +504 -0
- package/dist/contracts/builds.js +248 -0
- package/dist/contracts/channels.d.ts +49 -0
- package/dist/contracts/channels.js +51 -0
- package/dist/contracts/common.d.ts +238 -0
- package/dist/contracts/common.js +175 -0
- package/dist/contracts/deployments.d.ts +574 -0
- package/dist/contracts/deployments.js +97 -0
- package/dist/contracts/device-auth.d.ts +194 -0
- package/dist/contracts/device-auth.js +162 -0
- package/dist/contracts/domains.d.ts +6115 -0
- package/dist/contracts/domains.js +1435 -0
- package/dist/contracts/enums.d.ts +196 -0
- package/dist/contracts/enums.js +211 -0
- package/dist/contracts/error-code-meta.d.ts +1560 -0
- package/dist/contracts/error-code-meta.js +400 -0
- package/dist/contracts/error-codes.d.ts +13 -0
- package/dist/contracts/error-codes.js +416 -0
- package/dist/contracts/events.d.ts +398 -0
- package/dist/contracts/events.js +320 -0
- package/dist/contracts/fast-domain-search.d.ts +19 -0
- package/dist/contracts/fast-domain-search.js +22 -0
- package/dist/contracts/features.d.ts +240 -0
- package/dist/contracts/features.js +406 -0
- package/dist/contracts/git.d.ts +288 -0
- package/dist/contracts/git.js +116 -0
- package/dist/contracts/ids.d.ts +35 -0
- package/dist/contracts/ids.js +45 -0
- package/dist/contracts/intercom.d.ts +6 -0
- package/dist/contracts/intercom.js +5 -0
- package/dist/contracts/internal.d.ts +103 -0
- package/dist/contracts/internal.js +92 -0
- package/dist/contracts/mcp.d.ts +788 -0
- package/dist/contracts/mcp.js +161 -0
- package/dist/contracts/me.d.ts +81 -0
- package/dist/contracts/me.js +104 -0
- package/dist/contracts/oauth-resources.d.ts +30 -0
- package/dist/contracts/oauth-resources.js +61 -0
- package/dist/contracts/operations.d.ts +54 -0
- package/dist/contracts/operations.js +14 -0
- package/dist/contracts/plan-policy.d.ts +85 -0
- package/dist/contracts/plan-policy.js +75 -0
- package/dist/contracts/platform.d.ts +359 -0
- package/dist/contracts/platform.js +216 -0
- package/dist/contracts/push-new.d.ts +156 -0
- package/dist/contracts/push-new.js +52 -0
- package/dist/contracts/quotas.d.ts +16 -0
- package/dist/contracts/quotas.js +36 -0
- package/dist/contracts/repository-connections.d.ts +231 -0
- package/dist/contracts/repository-connections.js +106 -0
- package/dist/contracts/resources.d.ts +529 -0
- package/dist/contracts/resources.js +209 -0
- package/dist/contracts/routes.d.ts +45 -0
- package/dist/contracts/routes.js +31 -0
- package/dist/contracts/runtime-api.d.ts +449 -0
- package/dist/contracts/runtime-api.js +513 -0
- package/dist/contracts/sites.d.ts +393 -0
- package/dist/contracts/sites.js +121 -0
- package/dist/contracts/slugs.d.ts +31 -0
- package/dist/contracts/slugs.js +47 -0
- package/dist/contracts/space-config.d.ts +216 -0
- package/dist/contracts/space-config.js +237 -0
- package/dist/contracts/space-theme.d.ts +25 -0
- package/dist/contracts/space-theme.js +49 -0
- package/dist/contracts/spaces.d.ts +2760 -0
- package/dist/contracts/spaces.js +589 -0
- package/dist/contracts/superadmin-activity.d.ts +205 -0
- package/dist/contracts/superadmin-activity.js +107 -0
- package/dist/contracts/superadmin-emails.d.ts +212 -0
- package/dist/contracts/superadmin-emails.js +112 -0
- package/dist/contracts/superadmin-queues.d.ts +414 -0
- package/dist/contracts/superadmin-queues.js +202 -0
- package/dist/contracts/superadmin-runtime.d.ts +27 -0
- package/dist/contracts/superadmin-runtime.js +38 -0
- package/dist/contracts/superadmin-spaces.d.ts +429 -0
- package/dist/contracts/superadmin-spaces.js +82 -0
- package/dist/contracts/superadmin-tenants.d.ts +180 -0
- package/dist/contracts/superadmin-tenants.js +117 -0
- package/dist/contracts/superadmin.d.ts +654 -0
- package/dist/contracts/superadmin.js +309 -0
- package/dist/contracts/tags.d.ts +1140 -0
- package/dist/contracts/tags.js +1050 -0
- package/dist/contracts/teams.d.ts +233 -0
- package/dist/contracts/teams.js +174 -0
- package/dist/contracts/telemetry.d.ts +2 -0
- package/dist/contracts/telemetry.js +1 -0
- package/dist/contracts/transfers.d.ts +105 -0
- package/dist/contracts/transfers.js +48 -0
- package/dist/contracts/variables.d.ts +189 -0
- package/dist/contracts/variables.js +82 -0
- package/dist/contracts/webhooks.d.ts +159 -0
- package/dist/contracts/webhooks.js +59 -0
- package/dist/contracts/zero.d.ts +1538 -0
- package/dist/contracts/zero.js +755 -0
- package/dist/docs/agent-prose.d.ts +35 -0
- package/dist/docs/agent-prose.js +153 -0
- package/dist/docs/agent-setup.d.ts +6 -0
- package/dist/docs/agent-setup.js +164 -0
- package/dist/docs/agent-solutions.d.ts +110 -0
- package/dist/docs/agent-solutions.js +181 -0
- package/dist/docs/error-docs.d.ts +12 -0
- package/dist/docs/error-docs.js +1601 -0
- package/dist/docs/skill-distribution.d.ts +12 -0
- package/dist/docs/skill-distribution.js +18 -0
- package/dist/domain-exploration.d.ts +108 -0
- package/dist/domain-exploration.js +488 -0
- package/dist/domain-normalize.d.ts +1 -0
- package/dist/domain-normalize.js +14 -0
- package/dist/domain-zones.d.ts +1 -0
- package/dist/domain-zones.js +5272 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/utils/access-policy.d.ts +39 -0
- package/dist/utils/access-policy.js +232 -0
- package/dist/utils/api.d.ts +4 -0
- package/dist/utils/api.js +13 -0
- package/dist/utils/auth-redirect.d.ts +1 -0
- package/dist/utils/auth-redirect.js +48 -0
- package/dist/utils/auth.d.ts +5 -0
- package/dist/utils/auth.js +13 -0
- package/dist/utils/build-settings.d.ts +49 -0
- package/dist/utils/build-settings.js +366 -0
- package/dist/utils/claim-token.d.ts +1 -0
- package/dist/utils/claim-token.js +9 -0
- package/dist/utils/collections.d.ts +1 -0
- package/dist/utils/collections.js +5 -0
- package/dist/utils/concurrency.d.ts +1 -0
- package/dist/utils/concurrency.js +18 -0
- package/dist/utils/content-type.d.ts +10 -0
- package/dist/utils/content-type.js +145 -0
- package/dist/utils/error-display.d.ts +7 -0
- package/dist/utils/error-display.js +42 -0
- package/dist/utils/error.d.ts +1 -0
- package/dist/utils/error.js +3 -0
- package/dist/utils/generate-space-name.d.ts +14 -0
- package/dist/utils/generate-space-name.js +95 -0
- package/dist/utils/git-repository.d.ts +5 -0
- package/dist/utils/git-repository.js +99 -0
- package/dist/utils/guards.d.ts +1 -0
- package/dist/utils/guards.js +3 -0
- package/dist/utils/publish-detection.d.ts +10 -0
- package/dist/utils/publish-detection.js +118 -0
- package/dist/utils/publish-policy.d.ts +69 -0
- package/dist/utils/publish-policy.js +429 -0
- package/dist/utils/query-client.d.ts +7 -0
- package/dist/utils/query-client.js +21 -0
- package/dist/utils/query-keys.d.ts +75 -0
- package/dist/utils/query-keys.js +78 -0
- package/dist/utils/runtime-paths.d.ts +7 -0
- package/dist/utils/runtime-paths.js +28 -0
- package/dist/utils/runtime-upload.d.ts +19 -0
- package/dist/utils/runtime-upload.js +27 -0
- package/dist/utils/slug.d.ts +5 -0
- package/dist/utils/slug.js +13 -0
- package/dist/utils/space-config.d.ts +75 -0
- package/dist/utils/space-config.js +415 -0
- package/dist/utils/space-theme.d.ts +16 -0
- package/dist/utils/space-theme.js +89 -0
- package/dist/utils/static-runtime-policy.d.ts +17 -0
- package/dist/utils/static-runtime-policy.js +103 -0
- package/dist/utils/upload-session.d.ts +34 -0
- package/dist/utils/upload-session.js +69 -0
- package/dist/utils/urls.d.ts +2 -0
- package/dist/utils/urls.js +7 -0
- package/dist/utils/version-path.d.ts +6 -0
- package/dist/utils/version-path.js +51 -0
- package/dist/utils/wpcom-auth-redirects.d.ts +14 -0
- package/dist/utils/wpcom-auth-redirects.js +49 -0
- package/dist/utils/zero-realtime-signature.d.ts +12 -0
- package/dist/utils/zero-realtime-signature.js +45 -0
- package/dist/vocabulary.d.ts +230 -0
- package/dist/vocabulary.js +218 -0
- package/package.json +58 -0
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { CursorPaginationSchema, baseDiagnosticSchema, cursorListQuerySchema, dataEnvelope, } from "./common.js";
|
|
3
|
+
import { buildStatus } from "./enums.js";
|
|
4
|
+
import { uploadInstructionsSchema } from "./internal.js";
|
|
5
|
+
import { versionLogEntrySchema } from "./spaces.js";
|
|
6
|
+
const nullableCommandSchema = z.string().trim().min(1).nullable();
|
|
7
|
+
const buildTimeoutSecondsSchema = z.number().int().min(60).max(7200).default(900);
|
|
8
|
+
const scpStyleGitRemotePattern = /^[^@\s/:]+@[^:\s]+:[^\s]+$/;
|
|
9
|
+
const gitCloneUrlSchema = z
|
|
10
|
+
.string()
|
|
11
|
+
.trim()
|
|
12
|
+
.min(1)
|
|
13
|
+
.refine((value) => scpStyleGitRemotePattern.test(value) || z.string().url().safeParse(value).success, "Clone URL must be a URL or scp-style Git remote.");
|
|
14
|
+
// Build (`bld_`, internal-docs/platform.md "Build"): a first-class resource with
|
|
15
|
+
// its own table; ids are opaque and NEVER derived from version ids. The runner
|
|
16
|
+
// mints the produced version through the normal finalize path.
|
|
17
|
+
export const BuildSettingsSchema = z
|
|
18
|
+
.object({
|
|
19
|
+
rootDirectory: nullableCommandSchema.default(null),
|
|
20
|
+
installDirectory: nullableCommandSchema.default(null),
|
|
21
|
+
installCommand: nullableCommandSchema.default(null),
|
|
22
|
+
buildCommand: nullableCommandSchema.default(null),
|
|
23
|
+
outputDirectory: nullableCommandSchema.default(null),
|
|
24
|
+
ignoredBuildCommand: nullableCommandSchema.default(null),
|
|
25
|
+
frameworkPreset: nullableCommandSchema.default(null),
|
|
26
|
+
platformPreset: nullableCommandSchema.default(null),
|
|
27
|
+
allowUnsupportedPlatformFeatures: z.boolean().default(false),
|
|
28
|
+
timeoutSeconds: buildTimeoutSecondsSchema,
|
|
29
|
+
})
|
|
30
|
+
.describe("Resolved build settings. Builds persist this as an immutable settingsSnapshot.");
|
|
31
|
+
export const BuildTargetSchema = z
|
|
32
|
+
.object({
|
|
33
|
+
channel: z
|
|
34
|
+
.string()
|
|
35
|
+
.trim()
|
|
36
|
+
.min(1)
|
|
37
|
+
.nullable()
|
|
38
|
+
.default(null)
|
|
39
|
+
.describe("Channel to promote when the build succeeds; null means no automatic promotion."),
|
|
40
|
+
preview: z.boolean().default(false).describe("Whether the build targets preview behavior."),
|
|
41
|
+
})
|
|
42
|
+
.describe("Where a successful build should publish or preview.");
|
|
43
|
+
const InternalBuildSourceSchema = z
|
|
44
|
+
.discriminatedUnion("kind", [
|
|
45
|
+
z.object({
|
|
46
|
+
kind: z.literal("git").describe("Legacy build input from a git repository."),
|
|
47
|
+
repo: z.string().describe("Repository identifier (e.g. owner/name or clone URL)."),
|
|
48
|
+
ref: z.string().describe("Branch, tag, or ref to build."),
|
|
49
|
+
commit: z.string().optional().describe("Exact commit built, once resolved."),
|
|
50
|
+
}),
|
|
51
|
+
z.object({
|
|
52
|
+
kind: z.literal("archive").describe("Build from an uploaded source archive."),
|
|
53
|
+
uploadId: z.string().optional().describe("Upload session (`upl_`) carrying the archive."),
|
|
54
|
+
sourceMetadata: z
|
|
55
|
+
.record(z.string(), z.unknown())
|
|
56
|
+
.optional()
|
|
57
|
+
.describe("Internal source provenance copied to the produced Version."),
|
|
58
|
+
objectKey: z.string().optional().describe("Internal staged archive object key."),
|
|
59
|
+
uploadedAt: z.string().datetime().optional().describe("When the archive finished staging."),
|
|
60
|
+
recoveredAt: z
|
|
61
|
+
.string()
|
|
62
|
+
.datetime()
|
|
63
|
+
.optional()
|
|
64
|
+
.describe("When an interrupted archive upload was recovered."),
|
|
65
|
+
sha256: z.string().optional().describe("SHA-256 checksum of the staged source archive."),
|
|
66
|
+
compressedBytes: z.number().int().nonnegative().optional(),
|
|
67
|
+
expandedBytes: z.number().int().nonnegative().optional(),
|
|
68
|
+
fileCount: z.number().int().nonnegative().optional(),
|
|
69
|
+
expiresAt: z
|
|
70
|
+
.string()
|
|
71
|
+
.datetime()
|
|
72
|
+
.optional()
|
|
73
|
+
.describe("Server-enforced upload expiry while the archive is waiting for upload."),
|
|
74
|
+
}),
|
|
75
|
+
])
|
|
76
|
+
.describe("Legacy internal build source shape retained while build routes migrate to input.");
|
|
77
|
+
const InternalBuildInputSchema = z
|
|
78
|
+
.discriminatedUnion("kind", [
|
|
79
|
+
z.object({
|
|
80
|
+
kind: z.literal("archive").describe("Build from an uploaded source archive."),
|
|
81
|
+
uploadId: z.string().optional().describe("Upload session (`upl_`) carrying the archive."),
|
|
82
|
+
sourceMetadata: z
|
|
83
|
+
.record(z.string(), z.unknown())
|
|
84
|
+
.optional()
|
|
85
|
+
.describe("Internal source provenance copied to the produced Version."),
|
|
86
|
+
objectKey: z.string().optional().describe("Internal staged archive object key."),
|
|
87
|
+
uploadedAt: z.string().datetime().optional().describe("When the archive finished staging."),
|
|
88
|
+
recoveredAt: z
|
|
89
|
+
.string()
|
|
90
|
+
.datetime()
|
|
91
|
+
.optional()
|
|
92
|
+
.describe("When an interrupted archive upload was recovered."),
|
|
93
|
+
sha256: z.string().optional().describe("SHA-256 checksum of the staged source archive."),
|
|
94
|
+
compressedBytes: z.number().int().nonnegative().optional(),
|
|
95
|
+
expandedBytes: z.number().int().nonnegative().optional(),
|
|
96
|
+
fileCount: z.number().int().nonnegative().optional(),
|
|
97
|
+
expiresAt: z
|
|
98
|
+
.string()
|
|
99
|
+
.datetime()
|
|
100
|
+
.optional()
|
|
101
|
+
.describe("Server-enforced upload expiry while the archive is waiting for upload."),
|
|
102
|
+
}),
|
|
103
|
+
z.object({
|
|
104
|
+
kind: z.literal("connected_repository").describe("Build from a repository connection."),
|
|
105
|
+
repositoryConnectionId: z.string().describe("Repository connection (`rpc_`) to build from."),
|
|
106
|
+
ref: z.string().describe("Branch, tag, or ref to build."),
|
|
107
|
+
commit: z.string().optional().describe("Exact commit built, once resolved."),
|
|
108
|
+
branch: z.string().optional().describe("Branch name when the ref is a commit SHA."),
|
|
109
|
+
pullRequestNumber: z.number().int().positive().optional(),
|
|
110
|
+
repository: z
|
|
111
|
+
.object({
|
|
112
|
+
provider: z.string(),
|
|
113
|
+
repositoryId: z.string().nullable(),
|
|
114
|
+
repositoryName: z.string().nullable(),
|
|
115
|
+
repositoryFullName: z.string().nullable(),
|
|
116
|
+
defaultBranch: z.string().nullable(),
|
|
117
|
+
productionBranch: z.string().nullable(),
|
|
118
|
+
})
|
|
119
|
+
.optional()
|
|
120
|
+
.describe("Immutable repository identity snapshot captured when the Build was created."),
|
|
121
|
+
}),
|
|
122
|
+
z.object({
|
|
123
|
+
kind: z.literal("git_url").describe("Build from a short-lived clone URL."),
|
|
124
|
+
cloneUrl: gitCloneUrlSchema.describe("Short-lived clone URL; do not persist credentials."),
|
|
125
|
+
ref: z.string().describe("Branch, tag, or ref to build."),
|
|
126
|
+
commit: z.string().optional().describe("Exact commit built, once resolved."),
|
|
127
|
+
}),
|
|
128
|
+
])
|
|
129
|
+
.describe("What the build runs against.");
|
|
130
|
+
export const PublicBuildInputSchema = z
|
|
131
|
+
.discriminatedUnion("kind", [
|
|
132
|
+
z
|
|
133
|
+
.object({
|
|
134
|
+
kind: z.literal("archive").describe("Build from an uploaded source archive."),
|
|
135
|
+
})
|
|
136
|
+
.strict(),
|
|
137
|
+
z
|
|
138
|
+
.object({
|
|
139
|
+
kind: z
|
|
140
|
+
.literal("repository")
|
|
141
|
+
.describe("Build from repository source where clone credentials are not exposed."),
|
|
142
|
+
ref: z.string().describe("Branch, tag, or ref to build."),
|
|
143
|
+
commit: z.string().optional().describe("Exact commit built, once resolved."),
|
|
144
|
+
branch: z.string().optional().describe("Branch name when available."),
|
|
145
|
+
pullRequestNumber: z.number().int().positive().optional(),
|
|
146
|
+
})
|
|
147
|
+
.strict(),
|
|
148
|
+
])
|
|
149
|
+
.describe("Public build input. Internal clone URLs and staged object keys are not exposed.");
|
|
150
|
+
export const BuildCreateInputSchema = z
|
|
151
|
+
.discriminatedUnion("kind", [
|
|
152
|
+
z
|
|
153
|
+
.object({
|
|
154
|
+
kind: z.literal("archive").describe("Build from an uploaded source archive."),
|
|
155
|
+
sourceMetadata: z
|
|
156
|
+
.record(z.string(), z.unknown())
|
|
157
|
+
.optional()
|
|
158
|
+
.describe("Optional source provenance for the produced Version."),
|
|
159
|
+
})
|
|
160
|
+
.strict(),
|
|
161
|
+
z.object({
|
|
162
|
+
kind: z.literal("repository").describe("Build from a repository connection."),
|
|
163
|
+
repositoryConnectionId: z.string().describe("Repository connection (`rpc_`) to build from."),
|
|
164
|
+
ref: z.string().optional().describe("Branch, tag, or ref to build."),
|
|
165
|
+
commit: z.string().optional().describe("Exact commit built, once resolved."),
|
|
166
|
+
branch: z.string().optional().describe("Branch name when the ref is a commit SHA."),
|
|
167
|
+
pullRequestNumber: z.number().int().positive().optional(),
|
|
168
|
+
}),
|
|
169
|
+
])
|
|
170
|
+
.describe("What a new build should run against.");
|
|
171
|
+
const InternalBuildExecutionSchema = z
|
|
172
|
+
.object({
|
|
173
|
+
runner: z.string().nullable().default(null),
|
|
174
|
+
runnerJobId: z.string().nullable().default(null),
|
|
175
|
+
sandboxId: z.string().nullable().default(null),
|
|
176
|
+
region: z.string().nullable().default(null),
|
|
177
|
+
metadata: z.record(z.string(), z.unknown()).default({}),
|
|
178
|
+
})
|
|
179
|
+
.describe("Internal runner execution metadata surfaced only where appropriate.");
|
|
180
|
+
export const BuildSchema = z.object({
|
|
181
|
+
id: z.string().describe("Build id (`bld_`); opaque, never derived from a version id."),
|
|
182
|
+
spaceId: z.string().describe("Space (`spc_`) the build produces a version for."),
|
|
183
|
+
status: buildStatus.describe("Build lifecycle status."),
|
|
184
|
+
input: PublicBuildInputSchema,
|
|
185
|
+
settingsSnapshot: BuildSettingsSchema,
|
|
186
|
+
target: BuildTargetSchema,
|
|
187
|
+
retryOfBuildId: z
|
|
188
|
+
.string()
|
|
189
|
+
.nullable()
|
|
190
|
+
.default(null)
|
|
191
|
+
.describe("Original build retried by this build."),
|
|
192
|
+
producedVersionId: z
|
|
193
|
+
.string()
|
|
194
|
+
.nullable()
|
|
195
|
+
.describe("Version (`ver_`) minted by a succeeded build; null otherwise."),
|
|
196
|
+
reusedVersionId: z
|
|
197
|
+
.string()
|
|
198
|
+
.nullable()
|
|
199
|
+
.default(null)
|
|
200
|
+
.describe("Existing version reused by a succeeded no-change build; null otherwise."),
|
|
201
|
+
diagnostics: z.array(baseDiagnosticSchema).default([]),
|
|
202
|
+
createdAt: z.string().datetime(),
|
|
203
|
+
startedAt: z.string().datetime().nullable().describe("When the runner picked the build up."),
|
|
204
|
+
finishedAt: z.string().datetime().nullable().describe("When the build reached a terminal state."),
|
|
205
|
+
});
|
|
206
|
+
export const buildCreateRequestSchema = z.object({
|
|
207
|
+
input: BuildCreateInputSchema,
|
|
208
|
+
settings: BuildSettingsSchema.partial()
|
|
209
|
+
.optional()
|
|
210
|
+
.describe("Per-run settings overrides; persisted as settingsSnapshot after resolution."),
|
|
211
|
+
target: BuildTargetSchema.partial().optional(),
|
|
212
|
+
diagnostics: z
|
|
213
|
+
.array(baseDiagnosticSchema)
|
|
214
|
+
.optional()
|
|
215
|
+
.describe("Optional diagnostics already known before the build is queued."),
|
|
216
|
+
wait: z.boolean().default(false),
|
|
217
|
+
});
|
|
218
|
+
export const buildSourceArchiveUploadSchema = uploadInstructionsSchema;
|
|
219
|
+
export const buildCreateResponseSchema = dataEnvelope(z.object({
|
|
220
|
+
build: BuildSchema,
|
|
221
|
+
upload: buildSourceArchiveUploadSchema.nullable().default(null),
|
|
222
|
+
}));
|
|
223
|
+
export const buildListQuerySchema = cursorListQuerySchema;
|
|
224
|
+
export const buildListResponseSchema = z.object({
|
|
225
|
+
data: z.array(BuildSchema),
|
|
226
|
+
pagination: CursorPaginationSchema,
|
|
227
|
+
});
|
|
228
|
+
// Build logs share the ONE runtime log-entry shape with version logs (spec
|
|
229
|
+
// "Log routes"): plain cursor-list params, no bespoke LogQuery type.
|
|
230
|
+
export const buildLogListResponseSchema = z.object({
|
|
231
|
+
data: z.array(versionLogEntrySchema),
|
|
232
|
+
pagination: CursorPaginationSchema,
|
|
233
|
+
});
|
|
234
|
+
// Branch-to-channel integration config (spec "Lifecycle model": "branch-to-
|
|
235
|
+
// channel mapping rules live on the Space as integration config"). Launch only
|
|
236
|
+
// supports `live`; keep the stored config aligned with publish/finalize until
|
|
237
|
+
// named channels ship.
|
|
238
|
+
export const spaceBuildIntegrationSchema = z
|
|
239
|
+
.object({
|
|
240
|
+
branchChannels: z
|
|
241
|
+
.record(z.string().min(1).describe("Git branch or ref name."), z.literal("live").describe("Channel the branch's builds promote to."))
|
|
242
|
+
.describe("Exact branch/ref name to channel name, e.g. { main: 'live' }."),
|
|
243
|
+
})
|
|
244
|
+
.describe("Per-space build integration config: where repository builds promote.");
|
|
245
|
+
/** Channel a repository build promotes to, or null when the ref is unmapped (default channel applies). */
|
|
246
|
+
export function resolveBuildChannel(integration, ref) {
|
|
247
|
+
return integration?.branchChannels[ref] ?? null;
|
|
248
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const channelListItemSchema: z.ZodObject<{
|
|
3
|
+
name: z.ZodString;
|
|
4
|
+
currentVersionId: z.ZodNullable<z.ZodString>;
|
|
5
|
+
currentDeploymentUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
6
|
+
previousVersionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
7
|
+
updatedAt: z.ZodString;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
export type ChannelListItem = z.infer<typeof channelListItemSchema>;
|
|
10
|
+
export declare const channelHistoryEntrySchema: z.ZodObject<{
|
|
11
|
+
versionId: z.ZodString;
|
|
12
|
+
channel: z.ZodString;
|
|
13
|
+
previousVersionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
14
|
+
actorType: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
15
|
+
user: "user";
|
|
16
|
+
api_key: "api_key";
|
|
17
|
+
oauth_client: "oauth_client";
|
|
18
|
+
anonymous_claim: "anonymous_claim";
|
|
19
|
+
system: "system";
|
|
20
|
+
}>>>;
|
|
21
|
+
actorId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
22
|
+
at: z.ZodString;
|
|
23
|
+
}, z.core.$strip>;
|
|
24
|
+
export type ChannelHistoryEntry = z.infer<typeof channelHistoryEntrySchema>;
|
|
25
|
+
export declare const channelListResponseSchema: z.ZodObject<{
|
|
26
|
+
data: z.ZodArray<z.ZodObject<{
|
|
27
|
+
name: z.ZodString;
|
|
28
|
+
currentVersionId: z.ZodNullable<z.ZodString>;
|
|
29
|
+
currentDeploymentUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
30
|
+
previousVersionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
31
|
+
updatedAt: z.ZodString;
|
|
32
|
+
}, z.core.$strip>>;
|
|
33
|
+
}, z.core.$strip>;
|
|
34
|
+
export declare const channelHistoryResponseSchema: z.ZodObject<{
|
|
35
|
+
data: z.ZodArray<z.ZodObject<{
|
|
36
|
+
versionId: z.ZodString;
|
|
37
|
+
channel: z.ZodString;
|
|
38
|
+
previousVersionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
39
|
+
actorType: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
40
|
+
user: "user";
|
|
41
|
+
api_key: "api_key";
|
|
42
|
+
oauth_client: "oauth_client";
|
|
43
|
+
anonymous_claim: "anonymous_claim";
|
|
44
|
+
system: "system";
|
|
45
|
+
}>>>;
|
|
46
|
+
actorId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
47
|
+
at: z.ZodString;
|
|
48
|
+
}, z.core.$strip>>;
|
|
49
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
// Channels READ surface (internal-docs/platform.md "Channels"): a read-only
|
|
3
|
+
// projection over the existing `channels` table and the `channel.promoted`
|
|
4
|
+
// activity log. No writes, no new storage — promotion stays owned by the
|
|
5
|
+
// publish/version lifecycle. Additive only.
|
|
6
|
+
// One row of the channel list: where each named channel points right now.
|
|
7
|
+
// `currentVersionId` is the live pointer (`channels.versionId`); weighted
|
|
8
|
+
// pointers are not surfaced here yet (live-only at launch).
|
|
9
|
+
export const channelListItemSchema = z.object({
|
|
10
|
+
name: z.string().describe("Channel name; `live` is the default channel."),
|
|
11
|
+
currentVersionId: z
|
|
12
|
+
.string()
|
|
13
|
+
.nullable()
|
|
14
|
+
.describe("Version this channel currently serves, or null before first publish."),
|
|
15
|
+
currentDeploymentUrl: z
|
|
16
|
+
.string()
|
|
17
|
+
.nullable()
|
|
18
|
+
.optional()
|
|
19
|
+
.describe("Immutable URL of the currently-served version, when known."),
|
|
20
|
+
previousVersionId: z
|
|
21
|
+
.string()
|
|
22
|
+
.nullable()
|
|
23
|
+
.optional()
|
|
24
|
+
.describe("Last version this channel served before the current pointer (rollback target)."),
|
|
25
|
+
updatedAt: z.string().datetime().describe("When this channel pointer last moved."),
|
|
26
|
+
});
|
|
27
|
+
// One entry of a channel's promotion history (the deploy log): a single
|
|
28
|
+
// `channel.promoted` event, newest first. This is the audit trail of every
|
|
29
|
+
// pointer move on the channel.
|
|
30
|
+
export const channelHistoryEntrySchema = z.object({
|
|
31
|
+
versionId: z.string().describe("Version the channel was promoted to."),
|
|
32
|
+
channel: z.string().describe("Channel that moved."),
|
|
33
|
+
previousVersionId: z
|
|
34
|
+
.string()
|
|
35
|
+
.nullable()
|
|
36
|
+
.optional()
|
|
37
|
+
.describe("Version the channel served immediately before this promotion."),
|
|
38
|
+
actorType: z
|
|
39
|
+
.enum(["user", "api_key", "oauth_client", "anonymous_claim", "system"])
|
|
40
|
+
.nullable()
|
|
41
|
+
.optional()
|
|
42
|
+
.describe("Kind of actor that performed the promotion."),
|
|
43
|
+
actorId: z.string().nullable().optional().describe("Identifier of the promoting actor."),
|
|
44
|
+
at: z.string().datetime().describe("When the promotion happened."),
|
|
45
|
+
});
|
|
46
|
+
export const channelListResponseSchema = z.object({
|
|
47
|
+
data: z.array(channelListItemSchema),
|
|
48
|
+
});
|
|
49
|
+
export const channelHistoryResponseSchema = z.object({
|
|
50
|
+
data: z.array(channelHistoryEntrySchema),
|
|
51
|
+
});
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const AnyObjectSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
3
|
+
export declare const SpaceViewerSchema: z.ZodObject<{
|
|
4
|
+
title: z.ZodNullable<z.ZodString>;
|
|
5
|
+
description: z.ZodNullable<z.ZodString>;
|
|
6
|
+
ogImagePath: z.ZodNullable<z.ZodString>;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
export declare const baseDiagnosticSchema: z.ZodObject<{
|
|
9
|
+
code: z.ZodString;
|
|
10
|
+
severity: z.ZodEnum<{
|
|
11
|
+
info: "info";
|
|
12
|
+
warning: "warning";
|
|
13
|
+
error: "error";
|
|
14
|
+
}>;
|
|
15
|
+
message: z.ZodString;
|
|
16
|
+
path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
17
|
+
provider: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
18
|
+
wpcloud: "wpcloud";
|
|
19
|
+
dns: "dns";
|
|
20
|
+
registrar: "registrar";
|
|
21
|
+
runtime: "runtime";
|
|
22
|
+
}>>>;
|
|
23
|
+
details: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
24
|
+
fix: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
25
|
+
retryable: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
export type Diagnostic = z.infer<typeof baseDiagnosticSchema>;
|
|
28
|
+
export declare const DnsInstructionSchema: z.ZodObject<{
|
|
29
|
+
type: z.ZodEnum<{
|
|
30
|
+
A: "A";
|
|
31
|
+
AAAA: "AAAA";
|
|
32
|
+
CNAME: "CNAME";
|
|
33
|
+
TXT: "TXT";
|
|
34
|
+
ALIAS: "ALIAS";
|
|
35
|
+
}>;
|
|
36
|
+
name: z.ZodString;
|
|
37
|
+
value: z.ZodString;
|
|
38
|
+
ttl: z.ZodOptional<z.ZodNumber>;
|
|
39
|
+
purpose: z.ZodEnum<{
|
|
40
|
+
verification: "verification";
|
|
41
|
+
routing: "routing";
|
|
42
|
+
ssl: "ssl";
|
|
43
|
+
}>;
|
|
44
|
+
}, z.core.$strip>;
|
|
45
|
+
export type DnsInstruction = z.infer<typeof DnsInstructionSchema>;
|
|
46
|
+
export declare const requiredActionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
47
|
+
type: z.ZodLiteral<"dns">;
|
|
48
|
+
instructions: z.ZodArray<z.ZodObject<{
|
|
49
|
+
type: z.ZodEnum<{
|
|
50
|
+
A: "A";
|
|
51
|
+
AAAA: "AAAA";
|
|
52
|
+
CNAME: "CNAME";
|
|
53
|
+
TXT: "TXT";
|
|
54
|
+
ALIAS: "ALIAS";
|
|
55
|
+
}>;
|
|
56
|
+
name: z.ZodString;
|
|
57
|
+
value: z.ZodString;
|
|
58
|
+
ttl: z.ZodOptional<z.ZodNumber>;
|
|
59
|
+
purpose: z.ZodEnum<{
|
|
60
|
+
verification: "verification";
|
|
61
|
+
routing: "routing";
|
|
62
|
+
ssl: "ssl";
|
|
63
|
+
}>;
|
|
64
|
+
}, z.core.$strip>>;
|
|
65
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
66
|
+
type: z.ZodLiteral<"confirm_move">;
|
|
67
|
+
conflictId: z.ZodString;
|
|
68
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
69
|
+
type: z.ZodLiteral<"verify_domain">;
|
|
70
|
+
domainId: z.ZodString;
|
|
71
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
72
|
+
type: z.ZodLiteral<"renew">;
|
|
73
|
+
domainId: z.ZodString;
|
|
74
|
+
}, z.core.$strip>], "type">;
|
|
75
|
+
export type RequiredAction = z.infer<typeof requiredActionSchema>;
|
|
76
|
+
export declare const requiredActionsSchema: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
77
|
+
type: z.ZodLiteral<"dns">;
|
|
78
|
+
instructions: z.ZodArray<z.ZodObject<{
|
|
79
|
+
type: z.ZodEnum<{
|
|
80
|
+
A: "A";
|
|
81
|
+
AAAA: "AAAA";
|
|
82
|
+
CNAME: "CNAME";
|
|
83
|
+
TXT: "TXT";
|
|
84
|
+
ALIAS: "ALIAS";
|
|
85
|
+
}>;
|
|
86
|
+
name: z.ZodString;
|
|
87
|
+
value: z.ZodString;
|
|
88
|
+
ttl: z.ZodOptional<z.ZodNumber>;
|
|
89
|
+
purpose: z.ZodEnum<{
|
|
90
|
+
verification: "verification";
|
|
91
|
+
routing: "routing";
|
|
92
|
+
ssl: "ssl";
|
|
93
|
+
}>;
|
|
94
|
+
}, z.core.$strip>>;
|
|
95
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
96
|
+
type: z.ZodLiteral<"confirm_move">;
|
|
97
|
+
conflictId: z.ZodString;
|
|
98
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
99
|
+
type: z.ZodLiteral<"verify_domain">;
|
|
100
|
+
domainId: z.ZodString;
|
|
101
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
102
|
+
type: z.ZodLiteral<"renew">;
|
|
103
|
+
domainId: z.ZodString;
|
|
104
|
+
}, z.core.$strip>], "type">>;
|
|
105
|
+
export declare const ApiErrorResponseSchema: z.ZodObject<{
|
|
106
|
+
error: z.ZodObject<{
|
|
107
|
+
code: z.ZodString;
|
|
108
|
+
message: z.ZodString;
|
|
109
|
+
param: z.ZodOptional<z.ZodString>;
|
|
110
|
+
docsUrl: z.ZodString;
|
|
111
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
112
|
+
suggestions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
113
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
114
|
+
}, z.core.$strip>;
|
|
115
|
+
}, z.core.$strip>;
|
|
116
|
+
export declare function dataEnvelope<T extends z.ZodType>(data: T): z.ZodObject<{
|
|
117
|
+
data: T;
|
|
118
|
+
}, z.core.$strip>;
|
|
119
|
+
export declare const ApiUploadInstructionSchema: z.ZodObject<{
|
|
120
|
+
id: z.ZodString;
|
|
121
|
+
expiresAt: z.ZodString;
|
|
122
|
+
method: z.ZodLiteral<"PUT">;
|
|
123
|
+
url: z.ZodUnion<[z.ZodString, z.ZodString]>;
|
|
124
|
+
contentType: z.ZodString;
|
|
125
|
+
maxBytes: z.ZodNumber;
|
|
126
|
+
}, z.core.$strip>;
|
|
127
|
+
export type ApiUploadInstruction = z.infer<typeof ApiUploadInstructionSchema>;
|
|
128
|
+
export declare const CursorPaginationSchema: z.ZodObject<{
|
|
129
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
130
|
+
hasMore: z.ZodBoolean;
|
|
131
|
+
}, z.core.$strip>;
|
|
132
|
+
export declare const cursorListQuerySchema: z.ZodObject<{
|
|
133
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
134
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
135
|
+
}, z.core.$strip>;
|
|
136
|
+
export declare function makeOffsetListSchema<Key extends string, Item extends z.ZodType, Pagination extends z.ZodType>(itemsKey: Key, item: Item, pagination: Pagination): z.ZodObject<{ [K in Key]: z.ZodArray<Item>; } & {
|
|
137
|
+
total: z.ZodNumber;
|
|
138
|
+
limit: z.ZodNumber;
|
|
139
|
+
offset: z.ZodNumber;
|
|
140
|
+
pagination: Pagination;
|
|
141
|
+
} extends infer T ? { -readonly [P in keyof T]: T[P]; } : never, z.core.$strip>;
|
|
142
|
+
export declare const AsyncOperationProgressSchema: z.ZodObject<{
|
|
143
|
+
stage: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
144
|
+
message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
145
|
+
nextCheckAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
146
|
+
}, z.core.$strip>;
|
|
147
|
+
export type AsyncOperationProgress = z.infer<typeof AsyncOperationProgressSchema>;
|
|
148
|
+
export declare const OperationProgressSchema: z.ZodObject<{
|
|
149
|
+
total: z.ZodNumber;
|
|
150
|
+
completed: z.ZodNumber;
|
|
151
|
+
failed: z.ZodNumber;
|
|
152
|
+
}, z.core.$strip>;
|
|
153
|
+
export declare const AsyncOperationSchema: z.ZodObject<{
|
|
154
|
+
id: z.ZodString;
|
|
155
|
+
kind: z.ZodString;
|
|
156
|
+
status: z.ZodEnum<{
|
|
157
|
+
failed: "failed";
|
|
158
|
+
queued: "queued";
|
|
159
|
+
running: "running";
|
|
160
|
+
succeeded: "succeeded";
|
|
161
|
+
canceled: "canceled";
|
|
162
|
+
}>;
|
|
163
|
+
resources: z.ZodArray<z.ZodObject<{
|
|
164
|
+
type: z.ZodString;
|
|
165
|
+
id: z.ZodString;
|
|
166
|
+
}, z.core.$strip>>;
|
|
167
|
+
progress: z.ZodOptional<z.ZodObject<{
|
|
168
|
+
total: z.ZodNumber;
|
|
169
|
+
completed: z.ZodNumber;
|
|
170
|
+
failed: z.ZodNumber;
|
|
171
|
+
}, z.core.$strip>>;
|
|
172
|
+
diagnostics: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
173
|
+
code: z.ZodString;
|
|
174
|
+
severity: z.ZodEnum<{
|
|
175
|
+
info: "info";
|
|
176
|
+
warning: "warning";
|
|
177
|
+
error: "error";
|
|
178
|
+
}>;
|
|
179
|
+
message: z.ZodString;
|
|
180
|
+
path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
181
|
+
provider: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
182
|
+
wpcloud: "wpcloud";
|
|
183
|
+
dns: "dns";
|
|
184
|
+
registrar: "registrar";
|
|
185
|
+
runtime: "runtime";
|
|
186
|
+
}>>>;
|
|
187
|
+
details: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
188
|
+
fix: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
189
|
+
retryable: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
190
|
+
}, z.core.$strip>>>;
|
|
191
|
+
createdAt: z.ZodString;
|
|
192
|
+
finishedAt: z.ZodOptional<z.ZodString>;
|
|
193
|
+
}, z.core.$strip>;
|
|
194
|
+
export type AsyncOperation = z.infer<typeof AsyncOperationSchema>;
|
|
195
|
+
export declare function mutationEnvelope<T extends z.ZodType>(data: T): z.ZodObject<{
|
|
196
|
+
data: T;
|
|
197
|
+
operation: z.ZodNullable<z.ZodObject<{
|
|
198
|
+
id: z.ZodString;
|
|
199
|
+
kind: z.ZodString;
|
|
200
|
+
status: z.ZodEnum<{
|
|
201
|
+
failed: "failed";
|
|
202
|
+
queued: "queued";
|
|
203
|
+
running: "running";
|
|
204
|
+
succeeded: "succeeded";
|
|
205
|
+
canceled: "canceled";
|
|
206
|
+
}>;
|
|
207
|
+
resources: z.ZodArray<z.ZodObject<{
|
|
208
|
+
type: z.ZodString;
|
|
209
|
+
id: z.ZodString;
|
|
210
|
+
}, z.core.$strip>>;
|
|
211
|
+
progress: z.ZodOptional<z.ZodObject<{
|
|
212
|
+
total: z.ZodNumber;
|
|
213
|
+
completed: z.ZodNumber;
|
|
214
|
+
failed: z.ZodNumber;
|
|
215
|
+
}, z.core.$strip>>;
|
|
216
|
+
diagnostics: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
217
|
+
code: z.ZodString;
|
|
218
|
+
severity: z.ZodEnum<{
|
|
219
|
+
info: "info";
|
|
220
|
+
warning: "warning";
|
|
221
|
+
error: "error";
|
|
222
|
+
}>;
|
|
223
|
+
message: z.ZodString;
|
|
224
|
+
path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
225
|
+
provider: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
226
|
+
wpcloud: "wpcloud";
|
|
227
|
+
dns: "dns";
|
|
228
|
+
registrar: "registrar";
|
|
229
|
+
runtime: "runtime";
|
|
230
|
+
}>>>;
|
|
231
|
+
details: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
232
|
+
fix: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
233
|
+
retryable: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
234
|
+
}, z.core.$strip>>>;
|
|
235
|
+
createdAt: z.ZodString;
|
|
236
|
+
finishedAt: z.ZodOptional<z.ZodString>;
|
|
237
|
+
}, z.core.$strip>>;
|
|
238
|
+
}, z.core.$strip>;
|