@spacefast/common 0.0.26 → 0.2.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/dist/agents/connect-targets.d.ts +6 -146
- package/dist/agents/connect-targets.js +63 -295
- package/dist/agents/private-key-oauth.d.ts +31 -1
- package/dist/agents/private-key-oauth.js +124 -33
- package/dist/agents/registry/core.d.ts +292 -0
- package/dist/agents/registry/core.js +1388 -0
- package/dist/agents/registry/deeplink-probes.d.ts +23 -0
- package/dist/agents/registry/deeplink-probes.js +18 -0
- package/dist/agents/registry/node.d.ts +56 -0
- package/dist/agents/registry/node.js +339 -0
- package/dist/brand-assets-build.js +1 -2
- package/dist/brand-assets.js +4 -7
- package/dist/brand.d.ts +17 -0
- package/dist/brand.js +24 -4
- package/dist/config/domains.d.ts +55 -28
- package/dist/config/domains.js +85 -41
- package/dist/config/index.js +1 -2
- package/dist/contracts/abuse.js +9 -24
- package/dist/contracts/access-profiles.d.ts +86 -0
- package/dist/contracts/access-profiles.js +89 -0
- package/dist/contracts/access.d.ts +21 -27
- package/dist/contracts/access.js +33 -64
- package/dist/contracts/activity.d.ts +18 -1
- package/dist/contracts/activity.js +70 -26
- package/dist/contracts/analytics.js +8 -10
- package/dist/contracts/api-keys.d.ts +77 -52
- package/dist/contracts/api-keys.js +44 -24
- package/dist/contracts/application-journal.d.ts +216 -0
- package/dist/contracts/application-journal.js +167 -0
- package/dist/contracts/auth.d.ts +90 -17
- package/dist/contracts/auth.js +86 -17
- package/dist/contracts/beta.d.ts +9 -4
- package/dist/contracts/beta.js +20 -16
- package/dist/contracts/billing.js +7 -11
- package/dist/contracts/bootstrap.d.ts +791 -0
- package/dist/contracts/bootstrap.js +51 -0
- package/dist/contracts/builds.d.ts +192 -7
- package/dist/contracts/builds.js +84 -21
- package/dist/contracts/channels.d.ts +43 -0
- package/dist/contracts/channels.js +25 -9
- package/dist/contracts/cli.d.ts +7 -0
- package/dist/contracts/cli.js +6 -0
- package/dist/contracts/collab-public.d.ts +1 -1
- package/dist/contracts/collab-public.js +5 -8
- package/dist/contracts/comments.d.ts +45 -35
- package/dist/contracts/comments.js +107 -77
- package/dist/contracts/commerce.d.ts +165 -0
- package/dist/contracts/commerce.js +146 -0
- package/dist/contracts/common.d.ts +3 -3
- package/dist/contracts/common.js +18 -29
- package/dist/contracts/content-contract-verification.d.ts +521 -0
- package/dist/contracts/content-contract-verification.js +320 -0
- package/dist/contracts/content-platform-fixture.d.ts +1278 -0
- package/dist/contracts/content-platform-fixture.js +44 -0
- package/dist/contracts/content-program.d.ts +994 -0
- package/dist/contracts/content-program.js +658 -0
- package/dist/contracts/content-sync.d.ts +290 -0
- package/dist/contracts/content-sync.js +167 -0
- package/dist/contracts/content.d.ts +432 -0
- package/dist/contracts/content.js +303 -0
- package/dist/contracts/continuation.d.ts +17 -1
- package/dist/contracts/continuation.js +23 -23
- package/dist/contracts/countries.js +3 -4
- package/dist/contracts/crons.d.ts +17 -0
- package/dist/contracts/crons.js +33 -15
- package/dist/contracts/dashboard-prefs.d.ts +56 -0
- package/dist/contracts/dashboard-prefs.js +51 -0
- package/dist/contracts/device-auth.d.ts +234 -37
- package/dist/contracts/device-auth.js +267 -53
- package/dist/contracts/docs.d.ts +6 -10
- package/dist/contracts/docs.js +5 -13
- package/dist/contracts/domains.d.ts +499 -102
- package/dist/contracts/domains.js +169 -58
- package/dist/contracts/email-preferences.d.ts +3 -3
- package/dist/contracts/email-preferences.js +6 -7
- package/dist/contracts/enums.d.ts +26 -26
- package/dist/contracts/enums.js +61 -54
- package/dist/contracts/error-code-meta.d.ts +273 -7
- package/dist/contracts/error-code-meta.js +81 -5
- package/dist/contracts/error-codes.d.ts +5 -5
- package/dist/contracts/error-codes.js +79 -16
- package/dist/contracts/events.d.ts +100 -20
- package/dist/contracts/events.js +107 -20
- package/dist/contracts/execution.d.ts +47 -66
- package/dist/contracts/execution.js +51 -64
- package/dist/contracts/feature-lifecycle.d.ts +70 -14
- package/dist/contracts/feature-lifecycle.js +86 -15
- package/dist/contracts/features.d.ts +100 -37
- package/dist/contracts/features.js +21 -27
- package/dist/contracts/fixtures/content-platform-v1.json +1108 -0
- package/dist/contracts/frame-session.d.ts +192 -0
- package/dist/contracts/frame-session.js +164 -0
- package/dist/contracts/functions.d.ts +218 -211
- package/dist/contracts/functions.js +273 -260
- package/dist/contracts/grant-copy.d.ts +43 -0
- package/dist/contracts/grant-copy.js +44 -0
- package/dist/contracts/grants.d.ts +64 -56
- package/dist/contracts/grants.js +124 -23
- package/dist/contracts/ids.d.ts +4 -1
- package/dist/contracts/ids.js +4 -1
- package/dist/contracts/internal.d.ts +5 -4
- package/dist/contracts/internal.js +12 -3
- package/dist/contracts/mcp.d.ts +17 -0
- package/dist/contracts/mcp.js +23 -0
- package/dist/contracts/me.d.ts +6 -1
- package/dist/contracts/me.js +12 -6
- package/dist/contracts/notifications.d.ts +27 -29
- package/dist/contracts/notifications.js +9 -4
- package/dist/contracts/oauth-resources.d.ts +121 -10
- package/dist/contracts/oauth-resources.js +130 -11
- package/dist/contracts/oauth-scope-actions.d.ts +90 -0
- package/dist/contracts/oauth-scope-actions.js +126 -0
- package/dist/contracts/operations.d.ts +27 -4
- package/dist/contracts/operations.js +11 -5
- package/dist/contracts/pages.d.ts +29 -5
- package/dist/contracts/pages.js +22 -5
- package/dist/contracts/partner-notifications.d.ts +3 -0
- package/dist/contracts/partner-notifications.js +65 -0
- package/dist/contracts/{platform.d.ts → partner.d.ts} +29 -42
- package/dist/contracts/{platform.js → partner.js} +27 -40
- package/dist/contracts/plan-policy.d.ts +1 -1
- package/dist/contracts/principal-assertion.d.ts +43 -0
- package/dist/contracts/principal-assertion.js +67 -0
- package/dist/contracts/principals.d.ts +73 -0
- package/dist/contracts/principals.js +59 -0
- package/dist/contracts/privacy.d.ts +11 -0
- package/dist/contracts/privacy.js +17 -0
- package/dist/contracts/problem-document.js +3 -4
- package/dist/contracts/publish-archive.d.ts +116 -18
- package/dist/contracts/publish-archive.js +6 -3
- package/dist/contracts/push-new.d.ts +4 -4
- package/dist/contracts/quotas.js +3 -3
- package/dist/contracts/realtime.d.ts +52 -0
- package/dist/contracts/realtime.js +54 -0
- package/dist/contracts/repository-connections.d.ts +1 -1
- package/dist/contracts/repository-connections.js +6 -2
- package/dist/contracts/resources.d.ts +105 -14
- package/dist/contracts/resources.js +145 -21
- package/dist/contracts/route-inventory.d.ts +358 -0
- package/dist/contracts/route-inventory.js +141 -0
- package/dist/contracts/runtime-api.d.ts +112 -35
- package/dist/contracts/runtime-api.js +86 -66
- package/dist/contracts/runtime-app.d.ts +11 -21
- package/dist/contracts/runtime-app.js +39 -24
- package/dist/contracts/runtime-components.d.ts +143 -0
- package/dist/contracts/runtime-components.js +199 -0
- package/dist/contracts/runtime-db.d.ts +45 -19
- package/dist/contracts/runtime-db.js +85 -20
- package/dist/contracts/runtime-purge.js +3 -5
- package/dist/contracts/runtime-services.d.ts +43 -75
- package/dist/contracts/runtime-services.js +29 -49
- package/dist/contracts/runtime-storage.d.ts +14 -14
- package/dist/contracts/runtime-storage.js +28 -13
- package/dist/contracts/sf-config-v1.d.ts +14 -18
- package/dist/contracts/slugs.js +13 -4
- package/dist/contracts/space-config.d.ts +235 -28
- package/dist/contracts/space-config.js +246 -91
- package/dist/contracts/spaces.d.ts +360 -255
- package/dist/contracts/spaces.js +190 -122
- package/dist/contracts/superadmin-activity.d.ts +3 -43
- package/dist/contracts/superadmin-activity.js +6 -30
- package/dist/contracts/superadmin-emails.d.ts +1 -0
- package/dist/contracts/superadmin-emails.js +17 -1
- package/dist/contracts/superadmin-runtime.d.ts +199 -0
- package/dist/contracts/superadmin-runtime.js +141 -0
- package/dist/contracts/superadmin-search.d.ts +22 -2
- package/dist/contracts/superadmin-search.js +14 -6
- package/dist/contracts/superadmin-spaces.d.ts +435 -186
- package/dist/contracts/superadmin-spaces.js +131 -25
- package/dist/contracts/superadmin-teams.d.ts +3 -0
- package/dist/contracts/superadmin-teams.js +1 -2
- package/dist/contracts/superadmin-tenants.d.ts +627 -6
- package/dist/contracts/superadmin-tenants.js +32 -7
- package/dist/contracts/superadmin.d.ts +98 -16
- package/dist/contracts/superadmin.js +63 -10
- package/dist/contracts/tags.d.ts +85 -58
- package/dist/contracts/tags.js +44 -34
- package/dist/contracts/teams.d.ts +72 -9
- package/dist/contracts/teams.js +84 -25
- package/dist/contracts/tenants.d.ts +135 -0
- package/dist/contracts/tenants.js +120 -0
- package/dist/contracts/test-triggers.d.ts +70 -0
- package/dist/contracts/test-triggers.js +116 -0
- package/dist/contracts/theme-json.js +3 -8
- package/dist/contracts/transfers.d.ts +1 -0
- package/dist/contracts/transfers.js +1 -0
- package/dist/contracts/usage.d.ts +209 -0
- package/dist/contracts/usage.js +124 -12
- package/dist/contracts/variables.d.ts +2 -2
- package/dist/contracts/variables.js +9 -13
- package/dist/contracts/webhooks.d.ts +13 -5
- package/dist/contracts/webhooks.js +3 -1
- package/dist/contracts/zero.d.ts +57 -64
- package/dist/contracts/zero.js +68 -66
- package/dist/dashboard-paths/index.d.ts +24 -21
- package/dist/dashboard-paths/index.js +35 -47
- package/dist/dashboard-paths/route-reservations.generated.d.ts +2 -0
- package/dist/dashboard-paths/route-reservations.generated.js +36 -0
- package/dist/docs/agent-arrival.d.ts +92 -0
- package/dist/docs/agent-arrival.js +227 -0
- package/dist/docs/agent-output-policy.d.ts +6 -0
- package/dist/docs/agent-output-policy.js +22 -0
- package/dist/docs/agent-prose.d.ts +11 -17
- package/dist/docs/agent-prose.js +62 -37
- package/dist/docs/agent-setup.d.ts +72 -41
- package/dist/docs/agent-setup.js +336 -436
- package/dist/docs/catalog.d.ts +147 -89
- package/dist/docs/catalog.js +157 -42
- package/dist/docs/error-docs.d.ts +2102 -1
- package/dist/docs/error-docs.js +285 -16
- package/dist/docs/index-build.d.ts +0 -1
- package/dist/docs/index-build.js +2 -3
- package/dist/docs/page-context-prompt.d.ts +77 -0
- package/dist/docs/page-context-prompt.js +131 -0
- package/dist/docs/reference-urls.d.ts +46 -0
- package/dist/docs/reference-urls.js +79 -0
- package/dist/docs/search.d.ts +6 -8
- package/dist/docs/search.js +10 -13
- package/dist/docs/skill-distribution.d.ts +4 -1
- package/dist/docs/skill-distribution.js +10 -5
- package/dist/docs/skills.d.ts +117 -117
- package/dist/docs/skills.js +120 -72
- package/dist/docs/start-prompts.d.ts +45 -0
- package/dist/docs/start-prompts.js +62 -0
- package/dist/domain-exploration.js +9 -13
- package/dist/og-template.d.ts +56 -0
- package/dist/og-template.js +56 -0
- package/dist/slug-policy/index.js +5 -11
- package/dist/utils/browser-credential.d.ts +13 -6
- package/dist/utils/browser-credential.js +14 -7
- package/dist/utils/build-settings.d.ts +16 -0
- package/dist/utils/build-settings.js +63 -17
- package/dist/utils/canonical-json.d.ts +3 -5
- package/dist/utils/canonical-json.js +3 -5
- package/dist/utils/cast-transport.d.ts +5 -17
- package/dist/utils/cast-transport.js +6 -19
- package/dist/utils/claim-token.js +1 -2
- package/dist/utils/comment-avatars.js +4 -6
- package/dist/utils/concurrency.js +2 -3
- package/dist/utils/content-type.d.ts +7 -6
- package/dist/utils/content-type.js +73 -51
- package/dist/utils/credential-policy.d.ts +50 -6
- package/dist/utils/credential-policy.js +123 -57
- package/dist/utils/egress-policy.fixtures.json +1 -1
- package/dist/utils/generate-space-name.d.ts +3 -8
- package/dist/utils/generate-space-name.js +3 -8
- package/dist/utils/grants.d.ts +0 -1
- package/dist/utils/grants.js +4 -7
- package/dist/utils/gravatar.d.ts +2 -4
- package/dist/utils/gravatar.js +6 -12
- package/dist/utils/id-hints.js +14 -23
- package/dist/utils/idempotency.d.ts +3 -3
- package/dist/utils/idempotency.js +6 -7
- package/dist/utils/local-space-state.d.ts +15 -15
- package/dist/utils/local-space-state.js +34 -23
- package/dist/utils/oauth-signed-query.d.ts +3 -5
- package/dist/utils/oauth-signed-query.js +6 -9
- package/dist/utils/one-shot-replay.d.ts +3 -5
- package/dist/utils/one-shot-replay.js +3 -5
- package/dist/utils/page-colors.d.ts +4 -10
- package/dist/utils/page-colors.js +11 -35
- package/dist/utils/page-fonts.js +6 -11
- package/dist/utils/page-preview.d.ts +0 -1
- package/dist/utils/page-preview.js +0 -1
- package/dist/utils/pages.d.ts +22 -11
- package/dist/utils/pages.js +70 -30
- package/dist/utils/privacy-regions.d.ts +19 -0
- package/dist/utils/privacy-regions.js +91 -0
- package/dist/utils/publish-form-data.d.ts +4 -5
- package/dist/utils/publish-form-data.js +2 -3
- package/dist/utils/publish-policy.d.ts +10 -23
- package/dist/utils/publish-policy.js +63 -116
- package/dist/utils/query-client.d.ts +2 -0
- package/dist/utils/query-client.js +10 -1
- package/dist/utils/runtime-paths.d.ts +4 -4
- package/dist/utils/runtime-paths.js +6 -8
- package/dist/utils/runtime-upload.d.ts +4 -0
- package/dist/utils/runtime-upload.js +5 -0
- package/dist/utils/secure-local-file.d.ts +3 -3
- package/dist/utils/secure-local-file.js +18 -24
- package/dist/utils/space-config.d.ts +11 -14
- package/dist/utils/space-config.js +10 -16
- package/dist/utils/static-runtime-policy.d.ts +5 -8
- package/dist/utils/static-runtime-policy.generated.d.ts +16 -0
- package/dist/utils/static-runtime-policy.generated.js +70 -0
- package/dist/utils/static-runtime-policy.js +17 -84
- package/dist/utils/storage-policy.js +1 -2
- package/dist/utils/upload-session.js +8 -14
- package/dist/utils/version-path.js +11 -19
- package/dist/utils/wpcom-auth-redirects.d.ts +5 -14
- package/dist/utils/wpcom-auth-redirects.js +1 -4
- package/dist/vocabulary.d.ts +7 -7
- package/dist/vocabulary.js +30 -16
- package/package.json +14 -2
- package/dist/agents/client-registry.d.ts +0 -22
- package/dist/agents/client-registry.js +0 -41
- package/dist/docs/agent-handoff-document.d.ts +0 -15
- package/dist/docs/agent-handoff-document.js +0 -180
- package/dist/docs/agent-solutions.d.ts +0 -110
- package/dist/docs/agent-solutions.js +0 -183
- package/dist/utils/query-keys.d.ts +0 -84
- package/dist/utils/query-keys.js +0 -108
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { CursorPaginationSchema, ProblemDetailsSchema } from "./common.js";
|
|
3
|
+
import { meResponseSchema } from "./me.js";
|
|
4
|
+
import { SpaceSchema } from "./resources.js";
|
|
5
|
+
import { spaceRuntimeStatusSchema } from "./spaces.js";
|
|
6
|
+
import { TeamDetailSchema, TeamSummarySchema } from "./teams.js";
|
|
7
|
+
// `GET /v1/bootstrap`: the one-hop cold start. Every field here is an existing
|
|
8
|
+
// contract referenced by name — `me` is what `GET /v1/me` returns, `teams` is
|
|
9
|
+
// what `GET /v1/teams` returns, and so on — so a client can seed its per-resource
|
|
10
|
+
// caches from this payload without a second definition of anything.
|
|
11
|
+
export const bootstrapQuerySchema = z.object({
|
|
12
|
+
teamRef: z
|
|
13
|
+
.string()
|
|
14
|
+
.optional()
|
|
15
|
+
.describe("Team id or slug to resolve. It also scopes slug resolution for `spaceRef` and selects the team on the support boot payload. Present but blank is a request error, never `not_requested`."),
|
|
16
|
+
spaceRef: z
|
|
17
|
+
.string()
|
|
18
|
+
.optional()
|
|
19
|
+
.describe("Space reference: a `spc_` id, a hostname or URL, or a slug. Slugs resolve only within spaces you can already reach, so an unclaimed space is reachable by id or hostname only. Present but blank is a request error, never `not_requested`."),
|
|
20
|
+
});
|
|
21
|
+
// The per-slot problem: the RFC 9457 document minus `requestId` (the request has
|
|
22
|
+
// exactly one, and repeating it in every slot of a 200 body is noise).
|
|
23
|
+
// Everything else is byte-identical to the 4xx document, so the same error
|
|
24
|
+
// renderer works on a slot problem unchanged — there is no second taxonomy.
|
|
25
|
+
export const bootstrapProblemSchema = ProblemDetailsSchema.omit({ requestId: true }).describe("Why this slot did not resolve: the same problem document the dedicated endpoint would have returned, minus the request id carried by the response itself.");
|
|
26
|
+
/**
|
|
27
|
+
* A resolution slot. A caller reaches a value ONLY through `status: "resolved"`.
|
|
28
|
+
* This is deliberate: the dashboard's space read is route admission, and a bare
|
|
29
|
+
* `null` invites reading "could not resolve" as "nothing was asked for".
|
|
30
|
+
*/
|
|
31
|
+
function bootstrapSlot(value, description) {
|
|
32
|
+
return z
|
|
33
|
+
.discriminatedUnion("status", [
|
|
34
|
+
z.object({ status: z.literal("resolved"), value }),
|
|
35
|
+
z.object({ status: z.literal("unresolved"), problem: bootstrapProblemSchema }),
|
|
36
|
+
z.object({ status: z.literal("not_requested") }),
|
|
37
|
+
])
|
|
38
|
+
.describe(`${description}: the resolved value, the problem that stopped it, or not asked for.`);
|
|
39
|
+
}
|
|
40
|
+
export const bootstrapResponseSchema = z.object({
|
|
41
|
+
me: meResponseSchema
|
|
42
|
+
.nullable()
|
|
43
|
+
.describe("The authenticated identity, exactly as `GET /v1/me` returns it. Null only for a claim-token caller, which has no identity."),
|
|
44
|
+
teams: z
|
|
45
|
+
.array(TeamSummarySchema)
|
|
46
|
+
.describe("The teams this credential can act for, newest-first — the same set `GET /v1/teams` returns. Empty for a claim-token caller."),
|
|
47
|
+
teamsPagination: CursorPaginationSchema.describe("Paging for `teams`. `hasMore: true` means this credential reaches more teams than the boot payload carried; page the rest from `GET /v1/teams`."),
|
|
48
|
+
resolvedTeam: bootstrapSlot(TeamDetailSchema, "The team named by `teamRef`"),
|
|
49
|
+
resolvedSpace: bootstrapSlot(SpaceSchema, "The space named by `spaceRef`"),
|
|
50
|
+
spaceRuntime: bootstrapSlot(spaceRuntimeStatusSchema, "Serving status of the resolved space"),
|
|
51
|
+
});
|
|
@@ -125,6 +125,12 @@ declare const InternalBuildExecutionSchema: z.ZodObject<{
|
|
|
125
125
|
command: "command";
|
|
126
126
|
timeout: "timeout";
|
|
127
127
|
}>>;
|
|
128
|
+
observedCliError: z.ZodOptional<z.ZodObject<{
|
|
129
|
+
code: z.ZodString;
|
|
130
|
+
message: z.ZodString;
|
|
131
|
+
retryable: z.ZodOptional<z.ZodBoolean>;
|
|
132
|
+
recovery: z.ZodOptional<z.ZodString>;
|
|
133
|
+
}, z.core.$strip>>;
|
|
128
134
|
artifactDeadlineAt: z.ZodOptional<z.ZodString>;
|
|
129
135
|
launch: z.ZodOptional<z.ZodObject<{
|
|
130
136
|
state: z.ZodEnum<{
|
|
@@ -170,6 +176,37 @@ export declare const BuildSchema: z.ZodObject<{
|
|
|
170
176
|
branch: z.ZodOptional<z.ZodString>;
|
|
171
177
|
pullRequestNumber: z.ZodOptional<z.ZodNumber>;
|
|
172
178
|
}, z.core.$strict>], "kind">;
|
|
179
|
+
source: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
180
|
+
kind: z.ZodEnum<{
|
|
181
|
+
build: "build";
|
|
182
|
+
agent: "agent";
|
|
183
|
+
api: "api";
|
|
184
|
+
dashboard: "dashboard";
|
|
185
|
+
cli: "cli";
|
|
186
|
+
git: "git";
|
|
187
|
+
direct_upload: "direct_upload";
|
|
188
|
+
import: "import";
|
|
189
|
+
variable_update: "variable_update";
|
|
190
|
+
config_update: "config_update";
|
|
191
|
+
}>;
|
|
192
|
+
client: z.ZodOptional<z.ZodString>;
|
|
193
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
194
|
+
commit: z.ZodOptional<z.ZodString>;
|
|
195
|
+
message: z.ZodOptional<z.ZodString>;
|
|
196
|
+
dirty: z.ZodOptional<z.ZodBoolean>;
|
|
197
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
198
|
+
git: z.ZodOptional<z.ZodObject<{
|
|
199
|
+
repository: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
200
|
+
repositoryFullName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
201
|
+
repositoryUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
202
|
+
ref: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
203
|
+
branch: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
204
|
+
branchAliasUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
205
|
+
commit: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
206
|
+
commitSha: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
207
|
+
pullRequestNumber: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
208
|
+
}, z.core.$catchall<z.ZodUnknown>>>;
|
|
209
|
+
}, z.core.$strip>>>;
|
|
173
210
|
settingsSnapshot: z.ZodObject<{
|
|
174
211
|
rootDirectory: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
175
212
|
installDirectory: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
@@ -193,8 +230,8 @@ export declare const BuildSchema: z.ZodObject<{
|
|
|
193
230
|
code: z.ZodString;
|
|
194
231
|
severity: z.ZodEnum<{
|
|
195
232
|
info: "info";
|
|
196
|
-
error: "error";
|
|
197
233
|
warning: "warning";
|
|
234
|
+
error: "error";
|
|
198
235
|
}>;
|
|
199
236
|
message: z.ZodString;
|
|
200
237
|
path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -244,8 +281,77 @@ export declare const buildCreateRequestSchema: z.ZodObject<{
|
|
|
244
281
|
code: z.ZodString;
|
|
245
282
|
severity: z.ZodEnum<{
|
|
246
283
|
info: "info";
|
|
284
|
+
warning: "warning";
|
|
247
285
|
error: "error";
|
|
286
|
+
}>;
|
|
287
|
+
message: z.ZodString;
|
|
288
|
+
path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
289
|
+
provider: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
290
|
+
registrar: "registrar";
|
|
291
|
+
infra: "infra";
|
|
292
|
+
dns: "dns";
|
|
293
|
+
runtime: "runtime";
|
|
294
|
+
}>>>;
|
|
295
|
+
details: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
296
|
+
fix: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
297
|
+
retryable: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
298
|
+
}, z.core.$strip>>>;
|
|
299
|
+
wait: z.ZodDefault<z.ZodBoolean>;
|
|
300
|
+
}, z.core.$strict>;
|
|
301
|
+
export declare const buildSourceSchema: z.ZodEnum<{
|
|
302
|
+
wordpress: "wordpress";
|
|
303
|
+
}>;
|
|
304
|
+
export declare const wordpressBuildTriggerRequestSchema: z.ZodObject<{
|
|
305
|
+
source: z.ZodLiteral<"wordpress">;
|
|
306
|
+
sourceUrl: z.ZodString;
|
|
307
|
+
}, z.core.$strict>;
|
|
308
|
+
/**
|
|
309
|
+
* `POST /v1/spaces/{spaceId}/builds` takes either a caller-described build or a
|
|
310
|
+
* named managed source. `source` is a real discriminator, not a plain union
|
|
311
|
+
* arm: zod routes the body to exactly one variant and reports the failure
|
|
312
|
+
* inside it, so a validation problem keeps its RFC 6901 pointer
|
|
313
|
+
* (`/input/kind`, `/sourceUrl`) instead of collapsing to a top-level
|
|
314
|
+
* `invalid_union` with nowhere to point. Both variants are strict, so a body
|
|
315
|
+
* carrying `source` alongside `input` is rejected rather than quietly read as
|
|
316
|
+
* a caller-described build.
|
|
317
|
+
*/
|
|
318
|
+
export declare const spaceBuildCreateRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
319
|
+
source: z.ZodLiteral<"wordpress">;
|
|
320
|
+
sourceUrl: z.ZodString;
|
|
321
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
322
|
+
input: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
323
|
+
kind: z.ZodLiteral<"archive">;
|
|
324
|
+
sourceMetadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
325
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
326
|
+
kind: z.ZodLiteral<"repository">;
|
|
327
|
+
repositoryConnectionId: z.ZodString;
|
|
328
|
+
ref: z.ZodOptional<z.ZodString>;
|
|
329
|
+
commit: z.ZodOptional<z.ZodString>;
|
|
330
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
331
|
+
pullRequestNumber: z.ZodOptional<z.ZodNumber>;
|
|
332
|
+
}, z.core.$strip>], "kind">;
|
|
333
|
+
settings: z.ZodOptional<z.ZodObject<{
|
|
334
|
+
rootDirectory: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
335
|
+
installDirectory: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
336
|
+
installCommand: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
337
|
+
buildCommand: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
338
|
+
outputDirectory: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
339
|
+
ignoredBuildCommand: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
340
|
+
frameworkPreset: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
341
|
+
platformPreset: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
342
|
+
allowUnsupportedPlatformFeatures: z.ZodOptional<z.ZodBoolean>;
|
|
343
|
+
timeoutSeconds: z.ZodOptional<z.ZodNumber>;
|
|
344
|
+
}, z.core.$strip>>;
|
|
345
|
+
target: z.ZodOptional<z.ZodObject<{
|
|
346
|
+
channel: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
|
|
347
|
+
preview: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
348
|
+
}, z.core.$strip>>;
|
|
349
|
+
diagnostics: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
350
|
+
code: z.ZodString;
|
|
351
|
+
severity: z.ZodEnum<{
|
|
352
|
+
info: "info";
|
|
248
353
|
warning: "warning";
|
|
354
|
+
error: "error";
|
|
249
355
|
}>;
|
|
250
356
|
message: z.ZodString;
|
|
251
357
|
path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -260,6 +366,18 @@ export declare const buildCreateRequestSchema: z.ZodObject<{
|
|
|
260
366
|
retryable: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
261
367
|
}, z.core.$strip>>>;
|
|
262
368
|
wait: z.ZodDefault<z.ZodBoolean>;
|
|
369
|
+
source: z.ZodOptional<z.ZodUndefined>;
|
|
370
|
+
}, z.core.$strict>], "source">;
|
|
371
|
+
export declare const buildPreflightQuerySchema: z.ZodObject<{
|
|
372
|
+
source: z.ZodEnum<{
|
|
373
|
+
wordpress: "wordpress";
|
|
374
|
+
}>;
|
|
375
|
+
sourceUrl: z.ZodString;
|
|
376
|
+
}, z.core.$strict>;
|
|
377
|
+
export declare const buildPreflightResponseSchema: z.ZodObject<{
|
|
378
|
+
data: z.ZodObject<{
|
|
379
|
+
ready: z.ZodLiteral<true>;
|
|
380
|
+
}, z.core.$strict>;
|
|
263
381
|
}, z.core.$strip>;
|
|
264
382
|
export declare const buildSourceArchiveUploadSchema: z.ZodObject<{
|
|
265
383
|
id: z.ZodString;
|
|
@@ -291,7 +409,8 @@ export declare const buildSourceArchiveUploadSchema: z.ZodObject<{
|
|
|
291
409
|
contentType: z.ZodOptional<z.ZodString>;
|
|
292
410
|
}, z.core.$strip>>>;
|
|
293
411
|
links: z.ZodObject<{
|
|
294
|
-
|
|
412
|
+
refresh: z.ZodString;
|
|
413
|
+
resume: z.ZodOptional<z.ZodString>;
|
|
295
414
|
finalize: z.ZodString;
|
|
296
415
|
}, z.core.$strip>;
|
|
297
416
|
details: z.ZodOptional<z.ZodObject<{
|
|
@@ -307,8 +426,8 @@ export declare const buildSourceArchiveUploadSchema: z.ZodObject<{
|
|
|
307
426
|
code: z.ZodString;
|
|
308
427
|
severity: z.ZodEnum<{
|
|
309
428
|
info: "info";
|
|
310
|
-
error: "error";
|
|
311
429
|
warning: "warning";
|
|
430
|
+
error: "error";
|
|
312
431
|
}>;
|
|
313
432
|
message: z.ZodString;
|
|
314
433
|
path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -348,6 +467,37 @@ export declare const buildCreateResponseSchema: z.ZodObject<{
|
|
|
348
467
|
branch: z.ZodOptional<z.ZodString>;
|
|
349
468
|
pullRequestNumber: z.ZodOptional<z.ZodNumber>;
|
|
350
469
|
}, z.core.$strict>], "kind">;
|
|
470
|
+
source: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
471
|
+
kind: z.ZodEnum<{
|
|
472
|
+
build: "build";
|
|
473
|
+
agent: "agent";
|
|
474
|
+
api: "api";
|
|
475
|
+
dashboard: "dashboard";
|
|
476
|
+
cli: "cli";
|
|
477
|
+
git: "git";
|
|
478
|
+
direct_upload: "direct_upload";
|
|
479
|
+
import: "import";
|
|
480
|
+
variable_update: "variable_update";
|
|
481
|
+
config_update: "config_update";
|
|
482
|
+
}>;
|
|
483
|
+
client: z.ZodOptional<z.ZodString>;
|
|
484
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
485
|
+
commit: z.ZodOptional<z.ZodString>;
|
|
486
|
+
message: z.ZodOptional<z.ZodString>;
|
|
487
|
+
dirty: z.ZodOptional<z.ZodBoolean>;
|
|
488
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
489
|
+
git: z.ZodOptional<z.ZodObject<{
|
|
490
|
+
repository: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
491
|
+
repositoryFullName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
492
|
+
repositoryUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
493
|
+
ref: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
494
|
+
branch: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
495
|
+
branchAliasUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
496
|
+
commit: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
497
|
+
commitSha: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
498
|
+
pullRequestNumber: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
499
|
+
}, z.core.$catchall<z.ZodUnknown>>>;
|
|
500
|
+
}, z.core.$strip>>>;
|
|
351
501
|
settingsSnapshot: z.ZodObject<{
|
|
352
502
|
rootDirectory: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
353
503
|
installDirectory: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
@@ -371,8 +521,8 @@ export declare const buildCreateResponseSchema: z.ZodObject<{
|
|
|
371
521
|
code: z.ZodString;
|
|
372
522
|
severity: z.ZodEnum<{
|
|
373
523
|
info: "info";
|
|
374
|
-
error: "error";
|
|
375
524
|
warning: "warning";
|
|
525
|
+
error: "error";
|
|
376
526
|
}>;
|
|
377
527
|
message: z.ZodString;
|
|
378
528
|
path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -420,7 +570,8 @@ export declare const buildCreateResponseSchema: z.ZodObject<{
|
|
|
420
570
|
contentType: z.ZodOptional<z.ZodString>;
|
|
421
571
|
}, z.core.$strip>>>;
|
|
422
572
|
links: z.ZodObject<{
|
|
423
|
-
|
|
573
|
+
refresh: z.ZodString;
|
|
574
|
+
resume: z.ZodOptional<z.ZodString>;
|
|
424
575
|
finalize: z.ZodString;
|
|
425
576
|
}, z.core.$strip>;
|
|
426
577
|
details: z.ZodOptional<z.ZodObject<{
|
|
@@ -436,8 +587,8 @@ export declare const buildCreateResponseSchema: z.ZodObject<{
|
|
|
436
587
|
code: z.ZodString;
|
|
437
588
|
severity: z.ZodEnum<{
|
|
438
589
|
info: "info";
|
|
439
|
-
error: "error";
|
|
440
590
|
warning: "warning";
|
|
591
|
+
error: "error";
|
|
441
592
|
}>;
|
|
442
593
|
message: z.ZodString;
|
|
443
594
|
path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -482,6 +633,37 @@ export declare const buildListResponseSchema: z.ZodObject<{
|
|
|
482
633
|
branch: z.ZodOptional<z.ZodString>;
|
|
483
634
|
pullRequestNumber: z.ZodOptional<z.ZodNumber>;
|
|
484
635
|
}, z.core.$strict>], "kind">;
|
|
636
|
+
source: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
637
|
+
kind: z.ZodEnum<{
|
|
638
|
+
build: "build";
|
|
639
|
+
agent: "agent";
|
|
640
|
+
api: "api";
|
|
641
|
+
dashboard: "dashboard";
|
|
642
|
+
cli: "cli";
|
|
643
|
+
git: "git";
|
|
644
|
+
direct_upload: "direct_upload";
|
|
645
|
+
import: "import";
|
|
646
|
+
variable_update: "variable_update";
|
|
647
|
+
config_update: "config_update";
|
|
648
|
+
}>;
|
|
649
|
+
client: z.ZodOptional<z.ZodString>;
|
|
650
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
651
|
+
commit: z.ZodOptional<z.ZodString>;
|
|
652
|
+
message: z.ZodOptional<z.ZodString>;
|
|
653
|
+
dirty: z.ZodOptional<z.ZodBoolean>;
|
|
654
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
655
|
+
git: z.ZodOptional<z.ZodObject<{
|
|
656
|
+
repository: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
657
|
+
repositoryFullName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
658
|
+
repositoryUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
659
|
+
ref: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
660
|
+
branch: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
661
|
+
branchAliasUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
662
|
+
commit: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
663
|
+
commitSha: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
664
|
+
pullRequestNumber: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
665
|
+
}, z.core.$catchall<z.ZodUnknown>>>;
|
|
666
|
+
}, z.core.$strip>>>;
|
|
485
667
|
settingsSnapshot: z.ZodObject<{
|
|
486
668
|
rootDirectory: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
487
669
|
installDirectory: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
@@ -505,8 +687,8 @@ export declare const buildListResponseSchema: z.ZodObject<{
|
|
|
505
687
|
code: z.ZodString;
|
|
506
688
|
severity: z.ZodEnum<{
|
|
507
689
|
info: "info";
|
|
508
|
-
error: "error";
|
|
509
690
|
warning: "warning";
|
|
691
|
+
error: "error";
|
|
510
692
|
}>;
|
|
511
693
|
message: z.ZodString;
|
|
512
694
|
path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -558,4 +740,7 @@ export type InternalBuildExecutionLaunch = z.infer<typeof buildExecutionLaunchSc
|
|
|
558
740
|
export type InternalBuildExecutionSupervision = z.infer<typeof buildExecutionSupervisionSchema>;
|
|
559
741
|
export type BuildCreateRequest = z.infer<typeof buildCreateRequestSchema>;
|
|
560
742
|
export type BuildCreateResponse = z.infer<typeof buildCreateResponseSchema>;
|
|
743
|
+
export type WordPressBuildTriggerRequest = z.infer<typeof wordpressBuildTriggerRequestSchema>;
|
|
744
|
+
export type SpaceBuildCreateRequest = z.infer<typeof spaceBuildCreateRequestSchema>;
|
|
745
|
+
export type BuildPreflightQuery = z.infer<typeof buildPreflightQuerySchema>;
|
|
561
746
|
export {};
|
package/dist/contracts/builds.js
CHANGED
|
@@ -2,6 +2,8 @@ import { z } from "zod";
|
|
|
2
2
|
import { CursorPaginationSchema, baseDiagnosticSchema, cursorListQuerySchema, dataEnvelope, } from "./common.js";
|
|
3
3
|
import { buildStatus } from "./enums.js";
|
|
4
4
|
import { uploadInstructionsSchema } from "./internal.js";
|
|
5
|
+
import { PublishSourceSchema } from "./resources.js";
|
|
6
|
+
import { wordpressDataSourceUrlSchema } from "./space-config.js";
|
|
5
7
|
import { versionLogEntrySchema } from "./spaces.js";
|
|
6
8
|
const nullableCommandSchema = z.string().trim().min(1).nullable();
|
|
7
9
|
const buildTimeoutSecondsSchema = z.number().int().min(60).max(7200);
|
|
@@ -54,8 +56,6 @@ export const BuildTargetSchema = z
|
|
|
54
56
|
preview: z.boolean().default(false).describe("Whether the build targets preview behavior."),
|
|
55
57
|
})
|
|
56
58
|
.describe("Where a successful build should publish or run in preview mode.");
|
|
57
|
-
// Shared by InternalBuildSourceSchema and InternalBuildInputSchema: both carry
|
|
58
|
-
// this exact archive-source member in their `kind` discriminated union.
|
|
59
59
|
const internalArchiveBuildSourceSchema = z.object({
|
|
60
60
|
kind: z.literal("archive").describe("Build from an uploaded source archive."),
|
|
61
61
|
uploadId: z.string().optional().describe("Upload session (`upl_`) carrying the archive."),
|
|
@@ -81,11 +81,7 @@ const internalArchiveBuildSourceSchema = z.object({
|
|
|
81
81
|
compressedBytes: z.number().int().nonnegative().optional(),
|
|
82
82
|
expandedBytes: z.number().int().nonnegative().optional(),
|
|
83
83
|
fileCount: z.number().int().nonnegative().optional(),
|
|
84
|
-
expiresAt: z
|
|
85
|
-
.string()
|
|
86
|
-
.datetime()
|
|
87
|
-
.optional()
|
|
88
|
-
.describe("Server-enforced upload expiry while the archive is waiting for upload."),
|
|
84
|
+
expiresAt: z.string().datetime().optional().describe("Server-enforced upload expiry."),
|
|
89
85
|
});
|
|
90
86
|
const InternalBuildSourceSchema = z
|
|
91
87
|
.discriminatedUnion("kind", [
|
|
@@ -156,7 +152,7 @@ export const BuildCreateInputSchema = z
|
|
|
156
152
|
sourceMetadata: z
|
|
157
153
|
.record(z.string(), z.unknown())
|
|
158
154
|
.optional()
|
|
159
|
-
.describe("
|
|
155
|
+
.describe("Source provenance for the produced version."),
|
|
160
156
|
})
|
|
161
157
|
.strict(),
|
|
162
158
|
z.object({
|
|
@@ -169,10 +165,9 @@ export const BuildCreateInputSchema = z
|
|
|
169
165
|
}),
|
|
170
166
|
])
|
|
171
167
|
.describe("What a new build should run against.");
|
|
172
|
-
// One phase-timeline entry the
|
|
173
|
-
// (apps/control-plane/src/builds/runner.ts BUILD_PHASES)
|
|
174
|
-
//
|
|
175
|
-
// app-level concern, not a shared contract.
|
|
168
|
+
// One phase-timeline entry the runner appends via recordBuildPhase
|
|
169
|
+
// (apps/control-plane/src/builds/runner.ts BUILD_PHASES). `phase` stays a plain
|
|
170
|
+
// string: the runner's phase vocabulary is app-level, not a shared contract.
|
|
176
171
|
const buildExecutionPhaseSchema = z.object({
|
|
177
172
|
phase: z.string().min(1).describe("Build phase name. See `BUILD_PHASES` in `builds/runner.ts`."),
|
|
178
173
|
at: z.string().datetime(),
|
|
@@ -189,6 +184,12 @@ const buildExecutionSupervisionSchema = z.object({
|
|
|
189
184
|
owner: z.string().min(1),
|
|
190
185
|
leaseExpiresAt: z.string().datetime(),
|
|
191
186
|
});
|
|
187
|
+
const buildExecutionObservedCliErrorSchema = z.object({
|
|
188
|
+
code: z.string().min(1).max(128),
|
|
189
|
+
message: z.string().min(1).max(8_192),
|
|
190
|
+
retryable: z.boolean().optional(),
|
|
191
|
+
recovery: z.string().min(1).max(8_192).optional(),
|
|
192
|
+
});
|
|
192
193
|
const InternalBuildExecutionSchema = z
|
|
193
194
|
.object({
|
|
194
195
|
runner: z.string().nullable().default(null),
|
|
@@ -198,6 +199,9 @@ const InternalBuildExecutionSchema = z
|
|
|
198
199
|
logOffset: z.number().int().nonnegative().optional(),
|
|
199
200
|
exitCode: z.number().int().min(0).max(255).optional(),
|
|
200
201
|
terminationReason: z.enum(["command", "timeout"]).optional(),
|
|
202
|
+
observedCliError: buildExecutionObservedCliErrorSchema
|
|
203
|
+
.optional()
|
|
204
|
+
.describe("The observer stores the latest structured CLI error with the remote log cursor."),
|
|
201
205
|
artifactDeadlineAt: z
|
|
202
206
|
.string()
|
|
203
207
|
.datetime()
|
|
@@ -211,12 +215,15 @@ const InternalBuildExecutionSchema = z
|
|
|
211
215
|
.optional()
|
|
212
216
|
.describe("Phase timeline that the runner appends to with `recordBuildPhase`."),
|
|
213
217
|
})
|
|
214
|
-
.describe("Internal runner execution metadata
|
|
218
|
+
.describe("Internal runner execution metadata. Not part of the public Build resource.");
|
|
215
219
|
export const BuildSchema = z.object({
|
|
216
220
|
id: z.string().describe("Build id (`bld_`); opaque and never derived from a version id."),
|
|
217
221
|
spaceId: z.string().describe("Space (`spc_`) the build produces a version for."),
|
|
218
222
|
status: buildStatus.describe("Build lifecycle status."),
|
|
219
223
|
input: PublicBuildInputSchema,
|
|
224
|
+
source: PublishSourceSchema.nullable()
|
|
225
|
+
.default(null)
|
|
226
|
+
.describe("Publish provenance as declared at build start (client, git ref data, publish message). Present on failed and running builds too; the produced version's `source` is the authoritative copy once one exists. Null when nothing was declared."),
|
|
220
227
|
settingsSnapshot: BuildSettingsSchema,
|
|
221
228
|
target: BuildTargetSchema,
|
|
222
229
|
retryOfBuildId: z
|
|
@@ -238,16 +245,73 @@ export const BuildSchema = z.object({
|
|
|
238
245
|
startedAt: z.string().datetime().nullable().describe("When the runner picked the build up."),
|
|
239
246
|
finishedAt: z.string().datetime().nullable().describe("When the build reached a terminal state."),
|
|
240
247
|
});
|
|
241
|
-
export const buildCreateRequestSchema = z
|
|
248
|
+
export const buildCreateRequestSchema = z
|
|
249
|
+
.object({
|
|
242
250
|
input: BuildCreateInputSchema,
|
|
243
251
|
settings: BuildSettingsOverrideSchema.optional().describe("Per-run settings overrides, persisted as `settingsSnapshot` after resolution."),
|
|
244
252
|
target: BuildTargetSchema.partial().optional(),
|
|
245
253
|
diagnostics: z
|
|
246
254
|
.array(baseDiagnosticSchema)
|
|
247
255
|
.optional()
|
|
248
|
-
.describe("
|
|
256
|
+
.describe("Diagnostics already known before the build is queued."),
|
|
249
257
|
wait: z.boolean().default(false),
|
|
250
|
-
})
|
|
258
|
+
})
|
|
259
|
+
// Strict so a typo is a validation failure instead of a silently dropped
|
|
260
|
+
// field, and so a body that names a managed `source` can never be read as a
|
|
261
|
+
// caller-described build.
|
|
262
|
+
.strict();
|
|
263
|
+
// A build source is a named way of deciding what to build. `wordpress` reads
|
|
264
|
+
// the Space's configured WordPress source and its connected production
|
|
265
|
+
// repository, so the caller names the source and nothing else — no input,
|
|
266
|
+
// commands, settings, refs, or targets.
|
|
267
|
+
//
|
|
268
|
+
// It is an enum of one, and adding a second value is not a one-line edit: each
|
|
269
|
+
// source owns a request variant in the create union, a resolver that finds its
|
|
270
|
+
// repository, and its own preflight branch. The enum is how a caller names a
|
|
271
|
+
// source, not an extension point.
|
|
272
|
+
export const buildSourceSchema = z
|
|
273
|
+
.enum(["wordpress"])
|
|
274
|
+
.describe("Managed build source that decides what to build on the caller's behalf. `wordpress` is the only one.");
|
|
275
|
+
export const wordpressBuildTriggerRequestSchema = z
|
|
276
|
+
.object({
|
|
277
|
+
source: z.literal("wordpress").describe("Build the Space's configured WordPress source."),
|
|
278
|
+
sourceUrl: wordpressDataSourceUrlSchema.describe("Configured WordPress URL that changed, as stored in the Space's data sources."),
|
|
279
|
+
})
|
|
280
|
+
.strict()
|
|
281
|
+
.describe("Trigger a production build for a Space's configured WordPress source.");
|
|
282
|
+
/**
|
|
283
|
+
* `POST /v1/spaces/{spaceId}/builds` takes either a caller-described build or a
|
|
284
|
+
* named managed source. `source` is a real discriminator, not a plain union
|
|
285
|
+
* arm: zod routes the body to exactly one variant and reports the failure
|
|
286
|
+
* inside it, so a validation problem keeps its RFC 6901 pointer
|
|
287
|
+
* (`/input/kind`, `/sourceUrl`) instead of collapsing to a top-level
|
|
288
|
+
* `invalid_union` with nowhere to point. Both variants are strict, so a body
|
|
289
|
+
* carrying `source` alongside `input` is rejected rather than quietly read as
|
|
290
|
+
* a caller-described build.
|
|
291
|
+
*/
|
|
292
|
+
export const spaceBuildCreateRequestSchema = z
|
|
293
|
+
.discriminatedUnion("source", [
|
|
294
|
+
wordpressBuildTriggerRequestSchema,
|
|
295
|
+
buildCreateRequestSchema.extend({
|
|
296
|
+
source: z
|
|
297
|
+
.undefined()
|
|
298
|
+
.optional()
|
|
299
|
+
.meta({ description: "Omit `source` to describe the build yourself." }),
|
|
300
|
+
}),
|
|
301
|
+
])
|
|
302
|
+
.describe("A caller-described build, or a build triggered from a managed source.");
|
|
303
|
+
export const buildPreflightQuerySchema = z
|
|
304
|
+
.object({
|
|
305
|
+
source: buildSourceSchema,
|
|
306
|
+
sourceUrl: wordpressDataSourceUrlSchema.describe("Configured WordPress URL to check, as stored in the Space's data sources."),
|
|
307
|
+
})
|
|
308
|
+
.strict()
|
|
309
|
+
.describe("Which managed source to check before triggering builds from it.");
|
|
310
|
+
export const buildPreflightResponseSchema = dataEnvelope(z
|
|
311
|
+
.object({
|
|
312
|
+
ready: z.literal(true).describe("The source can trigger production builds right now."),
|
|
313
|
+
})
|
|
314
|
+
.strict());
|
|
251
315
|
export const buildSourceArchiveUploadSchema = uploadInstructionsSchema;
|
|
252
316
|
export const buildCreateResponseSchema = dataEnvelope(z.object({
|
|
253
317
|
build: BuildSchema,
|
|
@@ -264,17 +328,16 @@ export const buildLogListResponseSchema = z.object({
|
|
|
264
328
|
data: z.array(versionLogEntrySchema),
|
|
265
329
|
pagination: CursorPaginationSchema,
|
|
266
330
|
});
|
|
267
|
-
// Branch-to-channel integration config (spec "Lifecycle model":
|
|
268
|
-
//
|
|
269
|
-
//
|
|
270
|
-
// named channels ship.
|
|
331
|
+
// Branch-to-channel integration config (spec "Lifecycle model": mapping rules
|
|
332
|
+
// live on the Space as integration config). Launch only supports `live`; keep
|
|
333
|
+
// the stored config aligned with publish/finalize until named channels ship.
|
|
271
334
|
export const spaceBuildIntegrationSchema = z
|
|
272
335
|
.object({
|
|
273
336
|
branchChannels: z
|
|
274
337
|
.record(z.string().min(1).describe("Git branch or ref name."), z.literal("live").describe("Channel the branch's builds promote to."))
|
|
275
338
|
.describe("Exact branch or ref name to channel name, for example `{ main: 'live' }`."),
|
|
276
339
|
})
|
|
277
|
-
.describe("Per-space build integration config
|
|
340
|
+
.describe("Per-space build integration config: where repository builds promote.");
|
|
278
341
|
/** Channel a repository build promotes to, or null when the ref is unmapped (default channel applies). */
|
|
279
342
|
export function resolveBuildChannel(integration, ref) {
|
|
280
343
|
return integration?.branchChannels[ref] ?? null;
|
|
@@ -1,10 +1,33 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
export declare const channelChangeKindSchema: z.ZodEnum<{
|
|
3
|
+
publish: "publish";
|
|
4
|
+
rollback: "rollback";
|
|
5
|
+
promote: "promote";
|
|
6
|
+
}>;
|
|
7
|
+
export type ChannelChangeKind = z.infer<typeof channelChangeKindSchema>;
|
|
8
|
+
export declare const channelLastChangeSchema: z.ZodObject<{
|
|
9
|
+
kind: z.ZodNullable<z.ZodEnum<{
|
|
10
|
+
publish: "publish";
|
|
11
|
+
rollback: "rollback";
|
|
12
|
+
promote: "promote";
|
|
13
|
+
}>>;
|
|
14
|
+
at: z.ZodString;
|
|
15
|
+
}, z.core.$strip>;
|
|
16
|
+
export type ChannelLastChange = z.infer<typeof channelLastChangeSchema>;
|
|
2
17
|
export declare const channelListItemSchema: z.ZodObject<{
|
|
3
18
|
name: z.ZodString;
|
|
4
19
|
currentVersionId: z.ZodNullable<z.ZodString>;
|
|
5
20
|
currentDeploymentUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
6
21
|
previousVersionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
7
22
|
updatedAt: z.ZodString;
|
|
23
|
+
lastChange: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
24
|
+
kind: z.ZodNullable<z.ZodEnum<{
|
|
25
|
+
publish: "publish";
|
|
26
|
+
rollback: "rollback";
|
|
27
|
+
promote: "promote";
|
|
28
|
+
}>>;
|
|
29
|
+
at: z.ZodString;
|
|
30
|
+
}, z.core.$strip>>>;
|
|
8
31
|
}, z.core.$strip>;
|
|
9
32
|
export type ChannelListItem = z.infer<typeof channelListItemSchema>;
|
|
10
33
|
export declare const channelHistoryEntrySchema: z.ZodObject<{
|
|
@@ -15,10 +38,16 @@ export declare const channelHistoryEntrySchema: z.ZodObject<{
|
|
|
15
38
|
system: "system";
|
|
16
39
|
user: "user";
|
|
17
40
|
api_key: "api_key";
|
|
41
|
+
partner_token: "partner_token";
|
|
18
42
|
oauth_client: "oauth_client";
|
|
19
43
|
anonymous_claim: "anonymous_claim";
|
|
20
44
|
}>>>;
|
|
21
45
|
actorId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
46
|
+
kind: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
47
|
+
publish: "publish";
|
|
48
|
+
rollback: "rollback";
|
|
49
|
+
promote: "promote";
|
|
50
|
+
}>>>;
|
|
22
51
|
at: z.ZodString;
|
|
23
52
|
}, z.core.$strip>;
|
|
24
53
|
export type ChannelHistoryEntry = z.infer<typeof channelHistoryEntrySchema>;
|
|
@@ -29,6 +58,14 @@ export declare const channelListResponseSchema: z.ZodObject<{
|
|
|
29
58
|
currentDeploymentUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
30
59
|
previousVersionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
31
60
|
updatedAt: z.ZodString;
|
|
61
|
+
lastChange: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
62
|
+
kind: z.ZodNullable<z.ZodEnum<{
|
|
63
|
+
publish: "publish";
|
|
64
|
+
rollback: "rollback";
|
|
65
|
+
promote: "promote";
|
|
66
|
+
}>>;
|
|
67
|
+
at: z.ZodString;
|
|
68
|
+
}, z.core.$strip>>>;
|
|
32
69
|
}, z.core.$strip>>;
|
|
33
70
|
}, z.core.$strip>;
|
|
34
71
|
export declare const channelHistoryResponseSchema: z.ZodObject<{
|
|
@@ -40,10 +77,16 @@ export declare const channelHistoryResponseSchema: z.ZodObject<{
|
|
|
40
77
|
system: "system";
|
|
41
78
|
user: "user";
|
|
42
79
|
api_key: "api_key";
|
|
80
|
+
partner_token: "partner_token";
|
|
43
81
|
oauth_client: "oauth_client";
|
|
44
82
|
anonymous_claim: "anonymous_claim";
|
|
45
83
|
}>>>;
|
|
46
84
|
actorId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
85
|
+
kind: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
86
|
+
publish: "publish";
|
|
87
|
+
rollback: "rollback";
|
|
88
|
+
promote: "promote";
|
|
89
|
+
}>>>;
|
|
47
90
|
at: z.ZodString;
|
|
48
91
|
}, z.core.$strip>>;
|
|
49
92
|
}, z.core.$strip>;
|