@spacefast/common 0.0.12 → 0.0.17
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/client-registry.d.ts +22 -0
- package/dist/agents/client-registry.js +41 -0
- package/dist/agents/connect-targets.d.ts +51 -6
- package/dist/agents/connect-targets.js +93 -28
- package/dist/brand.d.ts +0 -11
- package/dist/brand.js +0 -20
- package/dist/config/domains.d.ts +15 -6
- package/dist/config/domains.js +24 -10
- package/dist/config/postgres-budget.d.ts +3 -0
- package/dist/config/postgres-budget.js +6 -1
- package/dist/config/postgres-budget.json +2 -1
- package/dist/contracts/abuse.js +1 -1
- package/dist/contracts/access.d.ts +486 -1196
- package/dist/contracts/access.js +323 -1054
- package/dist/contracts/activity.d.ts +1 -1
- package/dist/contracts/activity.js +11 -15
- package/dist/contracts/api-keys.d.ts +16 -0
- package/dist/contracts/api-keys.js +11 -9
- package/dist/contracts/archives.d.ts +1 -2
- package/dist/contracts/archives.js +15 -17
- package/dist/contracts/beta.js +1 -1
- package/dist/contracts/builds.js +14 -14
- package/dist/contracts/channels.js +2 -2
- package/dist/contracts/comments.d.ts +143 -99
- package/dist/contracts/comments.js +194 -79
- package/dist/contracts/common.d.ts +12 -12
- package/dist/contracts/common.js +33 -30
- package/dist/contracts/continuation.js +5 -5
- package/dist/contracts/countries.js +2 -7
- package/dist/contracts/data-source-routes.d.ts +20 -0
- package/dist/contracts/data-source-routes.js +15 -0
- package/dist/contracts/device-auth.d.ts +13 -9
- package/dist/contracts/device-auth.js +12 -12
- package/dist/contracts/docs.d.ts +10 -10
- package/dist/contracts/domains.js +39 -33
- package/dist/contracts/enums.d.ts +4 -14
- package/dist/contracts/enums.js +3 -10
- package/dist/contracts/error-code-meta.d.ts +122 -56
- package/dist/contracts/error-code-meta.js +43 -19
- package/dist/contracts/error-codes.d.ts +7 -4
- package/dist/contracts/error-codes.js +48 -24
- package/dist/contracts/events.d.ts +22 -15
- package/dist/contracts/events.js +33 -5
- package/dist/contracts/execution.d.ts +238 -0
- package/dist/contracts/execution.js +309 -0
- package/dist/contracts/feature-lifecycle.d.ts +39 -188
- package/dist/contracts/feature-lifecycle.js +52 -196
- package/dist/contracts/features.d.ts +13 -115
- package/dist/contracts/features.js +5 -35
- package/dist/contracts/functions.d.ts +597 -0
- package/dist/contracts/functions.js +475 -0
- package/dist/contracts/grants.d.ts +1175 -0
- package/dist/contracts/grants.js +783 -0
- package/dist/contracts/ids.d.ts +7 -5
- package/dist/contracts/ids.js +7 -7
- package/dist/contracts/internal.js +2 -2
- package/dist/contracts/mcp.d.ts +17 -556
- package/dist/contracts/mcp.js +9 -103
- package/dist/contracts/me.js +3 -4
- package/dist/contracts/notifications.d.ts +108 -0
- package/dist/contracts/notifications.js +54 -0
- package/dist/contracts/oauth-resources.d.ts +22 -5
- package/dist/contracts/oauth-resources.js +23 -2
- package/dist/contracts/operations.d.ts +0 -48
- package/dist/contracts/operations.js +0 -19
- package/dist/contracts/pages.d.ts +10 -14
- package/dist/contracts/pages.js +17 -21
- package/dist/contracts/plan-policy.d.ts +1 -8
- package/dist/contracts/plan-policy.js +1 -4
- package/dist/contracts/platform.d.ts +78 -30
- package/dist/contracts/platform.js +69 -20
- package/dist/contracts/problem-document.d.ts +14 -0
- package/dist/contracts/problem-document.js +35 -0
- package/dist/contracts/push-new.d.ts +41 -2
- package/dist/contracts/push-new.js +4 -0
- package/dist/contracts/quotas.d.ts +0 -1
- package/dist/contracts/quotas.js +0 -5
- package/dist/contracts/repository-connections.d.ts +1 -1
- package/dist/contracts/resources.d.ts +16 -71
- package/dist/contracts/resources.js +13 -16
- package/dist/contracts/runtime-api.d.ts +666 -303
- package/dist/contracts/runtime-api.js +272 -113
- package/dist/contracts/runtime-app.d.ts +168 -0
- package/dist/contracts/runtime-app.js +42 -0
- package/dist/contracts/runtime-db.d.ts +424 -0
- package/dist/contracts/runtime-db.js +108 -0
- package/dist/contracts/runtime-storage.d.ts +120 -0
- package/dist/contracts/runtime-storage.js +40 -0
- package/dist/contracts/sf-config-v1.d.ts +54 -1
- package/dist/contracts/sf-config-v1.js +2 -2
- package/dist/contracts/sites.d.ts +6 -0
- package/dist/contracts/sites.js +30 -11
- package/dist/contracts/space-config.d.ts +91 -121
- package/dist/contracts/space-config.js +464 -42
- package/dist/contracts/spaces.d.ts +300 -171
- package/dist/contracts/spaces.js +128 -98
- package/dist/contracts/superadmin-emails.d.ts +2 -2
- package/dist/contracts/superadmin-spaces.d.ts +26 -130
- package/dist/contracts/superadmin-spaces.js +22 -0
- package/dist/contracts/superadmin-tenants.js +4 -4
- package/dist/contracts/superadmin.d.ts +4 -0
- package/dist/contracts/superadmin.js +14 -1
- package/dist/contracts/tags.d.ts +6 -6
- package/dist/contracts/tags.js +1 -1
- package/dist/contracts/teams.d.ts +9 -9
- package/dist/contracts/teams.js +25 -16
- package/dist/contracts/theme-json.js +1 -1
- package/dist/contracts/transfers.d.ts +0 -1
- package/dist/contracts/transfers.js +4 -4
- package/dist/contracts/variables.js +3 -3
- package/dist/contracts/zero.d.ts +384 -596
- package/dist/contracts/zero.js +167 -299
- package/dist/dashboard-paths/index.d.ts +18 -3
- package/dist/dashboard-paths/index.js +19 -0
- package/dist/docs/agent-handoff-document.d.ts +2 -2
- package/dist/docs/agent-handoff-document.js +8 -7
- package/dist/docs/agent-prose.d.ts +22 -3
- package/dist/docs/agent-prose.js +227 -55
- package/dist/docs/agent-setup.d.ts +14 -11
- package/dist/docs/agent-setup.js +289 -61
- package/dist/docs/agent-solutions.d.ts +6 -6
- package/dist/docs/agent-solutions.js +24 -22
- package/dist/docs/catalog.d.ts +53 -98
- package/dist/docs/catalog.js +90 -117
- package/dist/docs/error-docs.js +304 -236
- package/dist/docs/skill-distribution.d.ts +2 -0
- package/dist/docs/skill-distribution.js +7 -4
- package/dist/docs/skills.d.ts +546 -0
- package/dist/docs/skills.js +340 -0
- package/dist/utils/auth-redirect.d.ts +1 -3
- package/dist/utils/auth-redirect.js +1 -21
- package/dist/utils/browser-credential.d.ts +19 -0
- package/dist/utils/browser-credential.js +62 -0
- package/dist/utils/build-settings.d.ts +2 -0
- package/dist/utils/build-settings.js +61 -9
- package/dist/utils/comment-avatars.d.ts +7 -0
- package/dist/utils/comment-avatars.js +42 -0
- package/dist/utils/content-type.d.ts +3 -3
- package/dist/utils/content-type.js +38 -61
- package/dist/utils/credential-policy.d.ts +1 -1
- package/dist/utils/credential-policy.js +4 -0
- package/dist/utils/domain-diagnostics.d.ts +5 -5
- package/dist/utils/domain-diagnostics.js +21 -10
- package/dist/utils/egress-policy.fixtures.json +1 -1
- package/dist/utils/grants.d.ts +53 -0
- package/dist/utils/grants.js +160 -0
- package/dist/utils/local-space-state.d.ts +78 -4
- package/dist/utils/local-space-state.js +384 -82
- package/dist/utils/one-shot-replay.d.ts +14 -0
- package/dist/utils/one-shot-replay.js +21 -0
- package/dist/utils/page-preview.d.ts +7 -0
- package/dist/utils/page-preview.js +9 -0
- package/dist/utils/pages.d.ts +2 -5
- package/dist/utils/pages.js +64 -33
- package/dist/utils/publish-form-data.d.ts +22 -0
- package/dist/utils/publish-form-data.js +26 -0
- package/dist/utils/publish-policy.d.ts +34 -4
- package/dist/utils/publish-policy.js +149 -62
- package/dist/utils/query-keys.d.ts +8 -10
- package/dist/utils/query-keys.js +14 -10
- package/dist/utils/runtime-paths.d.ts +3 -0
- package/dist/utils/runtime-paths.js +7 -0
- package/dist/utils/secure-local-file.d.ts +73 -0
- package/dist/utils/secure-local-file.js +1373 -0
- package/dist/utils/space-config.d.ts +17 -4
- package/dist/utils/space-config.js +151 -8
- package/dist/utils/static-runtime-policy.d.ts +5 -0
- package/dist/utils/static-runtime-policy.js +54 -10
- package/dist/utils/storage-policy.d.ts +20 -0
- package/dist/utils/storage-policy.fixtures.json +174 -0
- package/dist/utils/storage-policy.js +193 -0
- package/dist/utils/upload-session.d.ts +15 -1
- package/dist/utils/upload-session.js +68 -2
- package/dist/utils/version-file-browser.d.ts +13 -0
- package/dist/utils/version-file-browser.js +59 -0
- package/package.json +20 -1
- package/dist/contracts/mounts.d.ts +0 -142
- package/dist/contracts/mounts.js +0 -56
- package/dist/utils/access-grant.d.ts +0 -14
- package/dist/utils/access-grant.js +0 -88
- package/dist/utils/access-match.d.ts +0 -46
- package/dist/utils/access-match.fixtures.json +0 -513
- package/dist/utils/access-match.js +0 -312
- package/dist/utils/access-verdict.fixtures.json +0 -421
- package/dist/utils/asset-fingerprint.d.ts +0 -53
- package/dist/utils/asset-fingerprint.js +0 -574
- package/dist/utils/sf-config-v1.d.ts +0 -2
- package/dist/utils/sf-config-v1.fixtures.json +0 -9
- package/dist/utils/sf-config-v1.js +0 -551
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export declare const ACTIVITY_EVENT_CODES: readonly ["space.created", "space.claimed", "feedback.lead_claim_pending", "space.transferred", "space.move_requested", "space.moved", "space.expired", "space.disabled", "space.enabled", "space.deleted", "space.config_updated", "space.slug_updated", "
|
|
2
|
+
export declare const ACTIVITY_EVENT_CODES: readonly ["space.created", "space.claimed", "feedback.lead_claim_pending", "space.transferred", "space.move_requested", "space.moved", "space.expired", "space.disabled", "space.enabled", "space.deleted", "space.config_updated", "space.slug_updated", "site.provision_requested", "site.placement_hold_set", "site.placement_hold_cleared", "site.burst_toggled", "space.access_logout_all", "space.access_transfer_scrub", "space.share_link_created", "space.share_link_revoked", "space.access_request_created", "space.access_request_resolved", "space.grant_created", "space.grant_updated", "space.grant_revoked", "team.access_defaults_updated", "version.created", "version.ready", "version.warning", "version.failed", "version.expired", "version.canceled", "version.deleted", "version.retention_warning", "version.retention_deleted", "channel.promoted", "build.created", "build.succeeded", "build.failed", "build.canceled", "build.skipped", "domain.created", "domain.verified", "domain.verification_failed", "domain.control_lost", "domain.dns_updated", "domain.nameservers_updated", "domain.registration_purchased", "domain.registration_renewed", "domain.registration_expiring", "domain.registration_expired", "domain.transfer_in_started", "domain.transfer_out_started", "domain.deleted", "domain.attached", "domain.activated", "domain.blocked", "domain.detached", "transfer.requested", "transfer.confirmed", "transfer.completed", "transfer.canceled", "transfer.expired", "transfer.failed", "variable.updated", "variable.deleted", "api_key.created", "api_key.updated", "api_key.revoked", "agent_handoff.created", "agent_handoff.redeemed", "agent_handoff.revoked", "webhook.created", "webhook.updated", "webhook.secret_rotated", "webhook.disabled", "webhook.deleted", "team.updated", "team.slug_updated", "team.member_added", "team.member_removed", "team.member_role_updated", "team.builds_deploys_quota_exceeded", "tenant.past_due", "tenant.suspended", "tenant.reactivated", "tenant.deleted", "export.ready", "export.failed", "import.ready", "import.failed", "comment.token_minted", "comment.created", "comment.reply_created", "comment.archived", "comment.unarchived", "abuse_report.created", "abuse_report.updated", "claim.blocked_takedown", "claim.authority_rotated", "user.created", "user.signed_in", "user.deleted", "user.impersonation_started", "user.impersonation_stopped", "user.two_factor_enabled", "user.two_factor_disabled"];
|
|
3
3
|
export type ActivityEventCode = (typeof ACTIVITY_EVENT_CODES)[number];
|
|
4
4
|
export declare function isActivityEventCode(value: string): value is ActivityEventCode;
|
|
5
5
|
export declare function isValidActivityEventFilter(filter: string): boolean;
|
|
@@ -2,7 +2,7 @@ import { z } from "zod";
|
|
|
2
2
|
import { AnyObjectSchema, CursorPaginationSchema, cursorListQuerySchema } from "./common.js";
|
|
3
3
|
// The single event taxonomy (internal-docs/platform.md "Event taxonomy").
|
|
4
4
|
// Every emitted activity event and every webhook `events` filter selects on
|
|
5
|
-
// these codes.
|
|
5
|
+
// these codes.
|
|
6
6
|
// `appendActivityEvent` is typed against this list, so emitting a code that is
|
|
7
7
|
// not in the table is a typecheck (CI) failure.
|
|
8
8
|
export const ACTIVITY_EVENT_CODES = [
|
|
@@ -19,31 +19,22 @@ export const ACTIVITY_EVENT_CODES = [
|
|
|
19
19
|
"space.deleted",
|
|
20
20
|
"space.config_updated",
|
|
21
21
|
"space.slug_updated",
|
|
22
|
-
"space.password_updated",
|
|
23
22
|
// site
|
|
24
23
|
"site.provision_requested",
|
|
25
24
|
"site.placement_hold_set",
|
|
26
25
|
"site.placement_hold_cleared",
|
|
27
26
|
"site.burst_toggled",
|
|
28
|
-
// access
|
|
29
|
-
// activity event; operator mints are audited and owner-visible (X-27).
|
|
27
|
+
// access
|
|
30
28
|
"space.access_logout_all",
|
|
31
29
|
"space.access_transfer_scrub",
|
|
32
|
-
"space.access_operator_token",
|
|
33
|
-
"space.sharing_updated",
|
|
34
30
|
"space.share_link_created",
|
|
35
31
|
"space.share_link_revoked",
|
|
36
|
-
"space.invite_created",
|
|
37
|
-
"space.invite_revoked",
|
|
38
32
|
"space.access_request_created",
|
|
39
33
|
"space.access_request_resolved",
|
|
40
|
-
"space.
|
|
34
|
+
"space.grant_created",
|
|
35
|
+
"space.grant_updated",
|
|
36
|
+
"space.grant_revoked",
|
|
41
37
|
"team.access_defaults_updated",
|
|
42
|
-
"team.service_token_created",
|
|
43
|
-
"team.service_token_revoked",
|
|
44
|
-
"team.access_connection_created",
|
|
45
|
-
"team.access_connection_updated",
|
|
46
|
-
"team.access_connection_revoked",
|
|
47
38
|
// version
|
|
48
39
|
"version.created",
|
|
49
40
|
"version.ready",
|
|
@@ -135,6 +126,7 @@ export const ACTIVITY_EVENT_CODES = [
|
|
|
135
126
|
// claim (additive extension: a claim attempt against a taken-down space is
|
|
136
127
|
// flagged, never silently 404ed — internal-docs/platform.md "Abuse Posture")
|
|
137
128
|
"claim.blocked_takedown",
|
|
129
|
+
"claim.authority_rotated",
|
|
138
130
|
// user (additive extension: account lifecycle plus the 2FA and
|
|
139
131
|
// admin-impersonation effects that must surface through ActivityEvent —
|
|
140
132
|
// internal-docs/platform.md Better Auth usage). `user.created` fires once on
|
|
@@ -201,7 +193,11 @@ export const activityQuerySchema = cursorListQuerySchema.extend({
|
|
|
201
193
|
.describe("Filter to events owned by a team or an external customer principal."),
|
|
202
194
|
principalId: z.string().min(1).optional().describe("Filter to a single principal id."),
|
|
203
195
|
spaceId: z.string().min(1).optional().describe("Filter to events for one space."),
|
|
204
|
-
code: z
|
|
196
|
+
code: z
|
|
197
|
+
.string()
|
|
198
|
+
.min(1)
|
|
199
|
+
.optional()
|
|
200
|
+
.describe("Filter to one event code, for example `space.created`."),
|
|
205
201
|
since: z.string().datetime().optional().describe("Only events at or after this time."),
|
|
206
202
|
until: z.string().datetime().optional().describe("Only events at or before this time."),
|
|
207
203
|
});
|
|
@@ -5,6 +5,7 @@ export declare const StatticActionSchema: z.ZodEnum<{
|
|
|
5
5
|
"teams:create": "teams:create";
|
|
6
6
|
"spaces:read": "spaces:read";
|
|
7
7
|
"spaces:write": "spaces:write";
|
|
8
|
+
"spaces:rename": "spaces:rename";
|
|
8
9
|
"domains:read": "domains:read";
|
|
9
10
|
"mcp:tools": "mcp:tools";
|
|
10
11
|
"*": "*";
|
|
@@ -34,6 +35,7 @@ export declare const StatticActionSchema: z.ZodEnum<{
|
|
|
34
35
|
"webhooks:read": "webhooks:read";
|
|
35
36
|
"webhooks:write": "webhooks:write";
|
|
36
37
|
"builds:read": "builds:read";
|
|
38
|
+
"builds:trigger": "builds:trigger";
|
|
37
39
|
"builds:create": "builds:create";
|
|
38
40
|
"teams:write": "teams:write";
|
|
39
41
|
"teams:members.write": "teams:members.write";
|
|
@@ -87,6 +89,7 @@ export declare const ApiCredentialPolicySchema: z.ZodObject<{
|
|
|
87
89
|
"teams:create": "teams:create";
|
|
88
90
|
"spaces:read": "spaces:read";
|
|
89
91
|
"spaces:write": "spaces:write";
|
|
92
|
+
"spaces:rename": "spaces:rename";
|
|
90
93
|
"domains:read": "domains:read";
|
|
91
94
|
"mcp:tools": "mcp:tools";
|
|
92
95
|
"*": "*";
|
|
@@ -116,6 +119,7 @@ export declare const ApiCredentialPolicySchema: z.ZodObject<{
|
|
|
116
119
|
"webhooks:read": "webhooks:read";
|
|
117
120
|
"webhooks:write": "webhooks:write";
|
|
118
121
|
"builds:read": "builds:read";
|
|
122
|
+
"builds:trigger": "builds:trigger";
|
|
119
123
|
"builds:create": "builds:create";
|
|
120
124
|
"teams:write": "teams:write";
|
|
121
125
|
"teams:members.write": "teams:members.write";
|
|
@@ -191,6 +195,7 @@ export declare const ApiKeySchema: z.ZodObject<{
|
|
|
191
195
|
"teams:create": "teams:create";
|
|
192
196
|
"spaces:read": "spaces:read";
|
|
193
197
|
"spaces:write": "spaces:write";
|
|
198
|
+
"spaces:rename": "spaces:rename";
|
|
194
199
|
"domains:read": "domains:read";
|
|
195
200
|
"mcp:tools": "mcp:tools";
|
|
196
201
|
"*": "*";
|
|
@@ -220,6 +225,7 @@ export declare const ApiKeySchema: z.ZodObject<{
|
|
|
220
225
|
"webhooks:read": "webhooks:read";
|
|
221
226
|
"webhooks:write": "webhooks:write";
|
|
222
227
|
"builds:read": "builds:read";
|
|
228
|
+
"builds:trigger": "builds:trigger";
|
|
223
229
|
"builds:create": "builds:create";
|
|
224
230
|
"teams:write": "teams:write";
|
|
225
231
|
"teams:members.write": "teams:members.write";
|
|
@@ -303,6 +309,7 @@ export declare const ApiKeyListResponseSchema: z.ZodObject<{
|
|
|
303
309
|
"teams:create": "teams:create";
|
|
304
310
|
"spaces:read": "spaces:read";
|
|
305
311
|
"spaces:write": "spaces:write";
|
|
312
|
+
"spaces:rename": "spaces:rename";
|
|
306
313
|
"domains:read": "domains:read";
|
|
307
314
|
"mcp:tools": "mcp:tools";
|
|
308
315
|
"*": "*";
|
|
@@ -332,6 +339,7 @@ export declare const ApiKeyListResponseSchema: z.ZodObject<{
|
|
|
332
339
|
"webhooks:read": "webhooks:read";
|
|
333
340
|
"webhooks:write": "webhooks:write";
|
|
334
341
|
"builds:read": "builds:read";
|
|
342
|
+
"builds:trigger": "builds:trigger";
|
|
335
343
|
"builds:create": "builds:create";
|
|
336
344
|
"teams:write": "teams:write";
|
|
337
345
|
"teams:members.write": "teams:members.write";
|
|
@@ -395,6 +403,7 @@ export declare const ApiKeyCreateRequestSchema: z.ZodObject<{
|
|
|
395
403
|
"teams:create": "teams:create";
|
|
396
404
|
"spaces:read": "spaces:read";
|
|
397
405
|
"spaces:write": "spaces:write";
|
|
406
|
+
"spaces:rename": "spaces:rename";
|
|
398
407
|
"domains:read": "domains:read";
|
|
399
408
|
"mcp:tools": "mcp:tools";
|
|
400
409
|
"*": "*";
|
|
@@ -424,6 +433,7 @@ export declare const ApiKeyCreateRequestSchema: z.ZodObject<{
|
|
|
424
433
|
"webhooks:read": "webhooks:read";
|
|
425
434
|
"webhooks:write": "webhooks:write";
|
|
426
435
|
"builds:read": "builds:read";
|
|
436
|
+
"builds:trigger": "builds:trigger";
|
|
427
437
|
"builds:create": "builds:create";
|
|
428
438
|
"teams:write": "teams:write";
|
|
429
439
|
"teams:members.write": "teams:members.write";
|
|
@@ -469,6 +479,7 @@ export declare const ApiKeyPatchRequestSchema: z.ZodObject<{
|
|
|
469
479
|
"teams:create": "teams:create";
|
|
470
480
|
"spaces:read": "spaces:read";
|
|
471
481
|
"spaces:write": "spaces:write";
|
|
482
|
+
"spaces:rename": "spaces:rename";
|
|
472
483
|
"domains:read": "domains:read";
|
|
473
484
|
"mcp:tools": "mcp:tools";
|
|
474
485
|
"*": "*";
|
|
@@ -498,6 +509,7 @@ export declare const ApiKeyPatchRequestSchema: z.ZodObject<{
|
|
|
498
509
|
"webhooks:read": "webhooks:read";
|
|
499
510
|
"webhooks:write": "webhooks:write";
|
|
500
511
|
"builds:read": "builds:read";
|
|
512
|
+
"builds:trigger": "builds:trigger";
|
|
501
513
|
"builds:create": "builds:create";
|
|
502
514
|
"teams:write": "teams:write";
|
|
503
515
|
"teams:members.write": "teams:members.write";
|
|
@@ -542,6 +554,7 @@ export declare const ApiKeyScopedCreateRequestSchema: z.ZodObject<{
|
|
|
542
554
|
"teams:create": "teams:create";
|
|
543
555
|
"spaces:read": "spaces:read";
|
|
544
556
|
"spaces:write": "spaces:write";
|
|
557
|
+
"spaces:rename": "spaces:rename";
|
|
545
558
|
"domains:read": "domains:read";
|
|
546
559
|
"mcp:tools": "mcp:tools";
|
|
547
560
|
"*": "*";
|
|
@@ -571,6 +584,7 @@ export declare const ApiKeyScopedCreateRequestSchema: z.ZodObject<{
|
|
|
571
584
|
"webhooks:read": "webhooks:read";
|
|
572
585
|
"webhooks:write": "webhooks:write";
|
|
573
586
|
"builds:read": "builds:read";
|
|
587
|
+
"builds:trigger": "builds:trigger";
|
|
574
588
|
"builds:create": "builds:create";
|
|
575
589
|
"teams:write": "teams:write";
|
|
576
590
|
"teams:members.write": "teams:members.write";
|
|
@@ -601,6 +615,7 @@ export declare const ApiKeyScopedPatchRequestSchema: z.ZodObject<{
|
|
|
601
615
|
"teams:create": "teams:create";
|
|
602
616
|
"spaces:read": "spaces:read";
|
|
603
617
|
"spaces:write": "spaces:write";
|
|
618
|
+
"spaces:rename": "spaces:rename";
|
|
604
619
|
"domains:read": "domains:read";
|
|
605
620
|
"mcp:tools": "mcp:tools";
|
|
606
621
|
"*": "*";
|
|
@@ -630,6 +645,7 @@ export declare const ApiKeyScopedPatchRequestSchema: z.ZodObject<{
|
|
|
630
645
|
"webhooks:read": "webhooks:read";
|
|
631
646
|
"webhooks:write": "webhooks:write";
|
|
632
647
|
"builds:read": "builds:read";
|
|
648
|
+
"builds:trigger": "builds:trigger";
|
|
633
649
|
"builds:create": "builds:create";
|
|
634
650
|
"teams:write": "teams:write";
|
|
635
651
|
"teams:members.write": "teams:members.write";
|
|
@@ -11,6 +11,7 @@ export const StatticActionSchema = z.enum([
|
|
|
11
11
|
"spaces:read",
|
|
12
12
|
"spaces:create",
|
|
13
13
|
"spaces:write",
|
|
14
|
+
"spaces:rename",
|
|
14
15
|
"spaces:delete",
|
|
15
16
|
"spaces:publish",
|
|
16
17
|
"spaces:transfer",
|
|
@@ -32,6 +33,7 @@ export const StatticActionSchema = z.enum([
|
|
|
32
33
|
"webhooks:read",
|
|
33
34
|
"webhooks:write",
|
|
34
35
|
"builds:read",
|
|
36
|
+
"builds:trigger",
|
|
35
37
|
"builds:create",
|
|
36
38
|
"teams:read",
|
|
37
39
|
"teams:create",
|
|
@@ -46,7 +48,7 @@ export const StatticActionSchema = z.enum([
|
|
|
46
48
|
"runtime:manage",
|
|
47
49
|
"*",
|
|
48
50
|
]);
|
|
49
|
-
const DescribedStatticActionSchema = StatticActionSchema.describe("
|
|
51
|
+
const DescribedStatticActionSchema = StatticActionSchema.describe("Namespaced IAM-lite action (`noun:verb`), or `*` for all actions.");
|
|
50
52
|
const RESOURCE_PREFIX = "stt://tenant/";
|
|
51
53
|
function isResourceSegment(value) {
|
|
52
54
|
return Boolean(value && value.length > 0 && !/[\s/\\]/.test(value));
|
|
@@ -98,7 +100,7 @@ const StatticResourceSchema = z
|
|
|
98
100
|
.refine((value) => parseStatticResource(value) !== null, {
|
|
99
101
|
message: "Resource must be a stt:// URI from the StatticResource union (tenant, principal, site, space, site space, domain, or domain-group).",
|
|
100
102
|
})
|
|
101
|
-
.describe("
|
|
103
|
+
.describe("Resource URI from the resource union: stt://tenant/{t}, …/principal/(team|external)/{id}[/*], …/site/{id}[/*], …/space/{id}[/*], …/site/{id}/space/{id}[/*], …/domain/{id}, or …/domain-group/{id}.");
|
|
102
104
|
export const ApiCredentialPolicySchema = z
|
|
103
105
|
.object({
|
|
104
106
|
version: z
|
|
@@ -127,11 +129,11 @@ export const ApiCredentialPolicySchema = z
|
|
|
127
129
|
})
|
|
128
130
|
.strict()
|
|
129
131
|
.optional()
|
|
130
|
-
.describe("
|
|
132
|
+
.describe("AND condition attributes. Unresolvable attributes fail closed: no match for allow, and match for deny."),
|
|
131
133
|
})
|
|
132
134
|
.strict())
|
|
133
135
|
.min(1)
|
|
134
|
-
.describe("Evaluation: explicit deny wins, explicit allow permits, otherwise implicit deny."),
|
|
136
|
+
.describe("Evaluation order: explicit deny wins, explicit allow permits, otherwise implicit deny."),
|
|
135
137
|
})
|
|
136
138
|
.strict()
|
|
137
139
|
.describe("IAM-lite access policy evaluated for every credentialed request.");
|
|
@@ -145,12 +147,12 @@ export const ApiKeyPresetSchema = z
|
|
|
145
147
|
"team_admin",
|
|
146
148
|
"billing_viewer",
|
|
147
149
|
])
|
|
148
|
-
.describe("Named policy preset compiled into a concrete access policy
|
|
150
|
+
.describe("Named policy preset compiled into a concrete access policy when the key is created.");
|
|
149
151
|
// `system` is never a principal type: runtime/internal credentials are
|
|
150
152
|
// platform-owned and omit ownerPrincipal entirely (internal-docs/platform.md).
|
|
151
153
|
const ApiKeyOwnerPrincipalSchema = z.object({
|
|
152
154
|
type: z.enum(["team", "external"]).describe("Principal type that owns this key."),
|
|
153
|
-
id: z.string().min(1).describe("Stable principal id (Better Auth team id or external id)."),
|
|
155
|
+
id: z.string().min(1).describe("Stable principal id (Better Auth team id, or external id)."),
|
|
154
156
|
});
|
|
155
157
|
const ApiKeySubjectSchema = z.object({
|
|
156
158
|
type: z
|
|
@@ -188,7 +190,7 @@ export const ApiKeyListQuerySchema = cursorListQuerySchema.extend({
|
|
|
188
190
|
.string()
|
|
189
191
|
.min(1)
|
|
190
192
|
.optional()
|
|
191
|
-
.describe("Owning team whose keys to list. Defaults to the caller's own team
|
|
193
|
+
.describe("Owning team whose keys to list. Defaults to the caller's own team. Any team that the credential policy reaches is allowed."),
|
|
192
194
|
});
|
|
193
195
|
export const ApiKeyListResponseSchema = z.object({
|
|
194
196
|
data: z.array(ApiKeySchema),
|
|
@@ -200,7 +202,7 @@ export const ApiKeyCreateRequestSchema = z.object({
|
|
|
200
202
|
.string()
|
|
201
203
|
.min(1)
|
|
202
204
|
.optional()
|
|
203
|
-
.describe("Owning team for the new key. Defaults to the caller's own team
|
|
205
|
+
.describe("Owning team for the new key. Defaults to the caller's own team. Authorization is by the credential policy, not key ownership."),
|
|
204
206
|
preset: ApiKeyPresetSchema.optional(),
|
|
205
207
|
policy: ApiCredentialPolicySchema.nullable()
|
|
206
208
|
.optional()
|
|
@@ -250,7 +252,7 @@ export const ApiKeyScopeSchema = z
|
|
|
250
252
|
z.object({ kind: z.literal("team"), teamId: z.string().min(1) }).strict(),
|
|
251
253
|
z.object({ kind: z.literal("space"), spaceId: z.string().min(1) }).strict(),
|
|
252
254
|
])
|
|
253
|
-
.describe("Explicit, finite policy target. A space scope narrows the derived policy to exactly that space
|
|
255
|
+
.describe("Explicit, finite policy target. A space scope narrows the derived policy to exactly that space, never the owning team's whole tree.");
|
|
254
256
|
export const ApiKeyScopedCreateRequestSchema = z
|
|
255
257
|
.object({
|
|
256
258
|
name: z.string().trim().min(1).max(255).optional().describe("Human-readable key name."),
|
|
@@ -6,8 +6,7 @@ export declare const archiveListQuerySchema: z.ZodObject<{
|
|
|
6
6
|
export declare const spaceExportRequestSchema: z.ZodObject<{
|
|
7
7
|
versionIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
8
8
|
includeFiles: z.ZodDefault<z.ZodBoolean>;
|
|
9
|
-
|
|
10
|
-
}, z.core.$strip>;
|
|
9
|
+
}, z.core.$strict>;
|
|
11
10
|
export declare const spaceExportArchiveSchema: z.ZodObject<{
|
|
12
11
|
contentType: z.ZodLiteral<"application/zip">;
|
|
13
12
|
downloadUrl: z.ZodString;
|
|
@@ -2,7 +2,8 @@ import { z } from "zod";
|
|
|
2
2
|
import { baseDiagnosticSchema, CursorPaginationSchema, cursorListQuerySchema } from "./common.js";
|
|
3
3
|
import { uploadInstructionsSchema } from "./internal.js";
|
|
4
4
|
export const archiveListQuerySchema = cursorListQuerySchema;
|
|
5
|
-
export const spaceExportRequestSchema = z
|
|
5
|
+
export const spaceExportRequestSchema = z
|
|
6
|
+
.object({
|
|
6
7
|
versionIds: z
|
|
7
8
|
.array(z.string().min(1))
|
|
8
9
|
.min(1)
|
|
@@ -11,12 +12,9 @@ export const spaceExportRequestSchema = z.object({
|
|
|
11
12
|
includeFiles: z
|
|
12
13
|
.boolean()
|
|
13
14
|
.default(true)
|
|
14
|
-
.describe("
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
.default(true)
|
|
18
|
-
.describe("Include explicit space config (the space access policy) in the archive. Version manifests are always included."),
|
|
19
|
-
});
|
|
15
|
+
.describe("Pass `true` to include version file trees and compiled serving artifacts. Pass `false` for a config-only archive that is not self-servable and cannot be re-imported."),
|
|
16
|
+
})
|
|
17
|
+
.strict();
|
|
20
18
|
export const spaceExportArchiveSchema = z.object({
|
|
21
19
|
// Zip-only contract: spacefast_export_v1 archives are always zip (the spec
|
|
22
20
|
// allows "zip or tar"; one format keeps the enum honest).
|
|
@@ -35,8 +33,8 @@ export const spaceExportArchiveSchema = z.object({
|
|
|
35
33
|
.describe("SHA-256 of the archive bytes (64 lowercase hex characters), for verification."),
|
|
36
34
|
});
|
|
37
35
|
export const spaceExportSchema = z.object({
|
|
38
|
-
id: z.string().describe("
|
|
39
|
-
spaceId: z.string().describe("
|
|
36
|
+
id: z.string().describe("The export handle id (`exp_…`)."),
|
|
37
|
+
spaceId: z.string().describe("The source space id (`spc_…`)."),
|
|
40
38
|
status: z
|
|
41
39
|
.enum(["queued", "running", "ready", "failed", "expired"])
|
|
42
40
|
.describe("Export lifecycle. `expired` means the archive download window has passed."),
|
|
@@ -54,8 +52,8 @@ export const spaceExportSchema = z.object({
|
|
|
54
52
|
.string()
|
|
55
53
|
.nullable()
|
|
56
54
|
.describe("Operation (op_…) tracking the asynchronous export work."),
|
|
57
|
-
createdAt: z.string().datetime().describe("
|
|
58
|
-
updatedAt: z.string().datetime().describe("
|
|
55
|
+
createdAt: z.string().datetime().describe("Instant when the export handle was created."),
|
|
56
|
+
updatedAt: z.string().datetime().describe("Instant when the export handle last changed."),
|
|
59
57
|
});
|
|
60
58
|
export const spaceExportListResponseSchema = z.object({
|
|
61
59
|
data: z.array(spaceExportSchema),
|
|
@@ -83,11 +81,11 @@ export const spaceImportRequestSchema = z.object({
|
|
|
83
81
|
publish: z
|
|
84
82
|
.boolean()
|
|
85
83
|
.default(false)
|
|
86
|
-
.describe("
|
|
84
|
+
.describe("Pass `true` to promote the newest imported version to the live channel after it materializes. Imported versions never go public implicitly."),
|
|
87
85
|
});
|
|
88
86
|
export const spaceImportSchema = z.object({
|
|
89
|
-
id: z.string().describe("
|
|
90
|
-
targetSpaceId: z.string().describe("
|
|
87
|
+
id: z.string().describe("The import handle id (`imp_…`)."),
|
|
88
|
+
targetSpaceId: z.string().describe("The target space id (`spc_…`) the import materializes into."),
|
|
91
89
|
status: z
|
|
92
90
|
.enum([
|
|
93
91
|
"created",
|
|
@@ -101,7 +99,7 @@ export const spaceImportSchema = z.object({
|
|
|
101
99
|
.describe("Import lifecycle. Upload-kind imports wait in `waiting_for_archive` until the archive is uploaded and the import is finalized."),
|
|
102
100
|
archiveUpload: uploadInstructionsSchema
|
|
103
101
|
.optional()
|
|
104
|
-
.describe("Archive upload instructions
|
|
102
|
+
.describe("Archive upload instructions. This is the same upload contract as publish. Present while status is `waiting_for_archive`: PUT the archive to `{baseUrl}/{files[0]}` with the session token, then POST `links.finalize`. Each fetch of the import mints a fresh token."),
|
|
105
103
|
draftVersionIds: z
|
|
106
104
|
.array(z.string())
|
|
107
105
|
.describe("Version ids (ver_…) minted and owned by this import."),
|
|
@@ -113,8 +111,8 @@ export const spaceImportSchema = z.object({
|
|
|
113
111
|
.string()
|
|
114
112
|
.nullable()
|
|
115
113
|
.describe("Operation (op_…) tracking the asynchronous import work."),
|
|
116
|
-
createdAt: z.string().datetime().describe("
|
|
117
|
-
updatedAt: z.string().datetime().describe("
|
|
114
|
+
createdAt: z.string().datetime().describe("Instant when the import handle was created."),
|
|
115
|
+
updatedAt: z.string().datetime().describe("Instant when the import handle last changed."),
|
|
118
116
|
});
|
|
119
117
|
export const spaceImportListResponseSchema = z.object({
|
|
120
118
|
data: z.array(spaceImportSchema),
|
package/dist/contracts/beta.js
CHANGED
|
@@ -91,7 +91,7 @@ export const SuperadminBetaSignupSchema = z.object({
|
|
|
91
91
|
invitedBy: z
|
|
92
92
|
.string()
|
|
93
93
|
.nullable()
|
|
94
|
-
.describe("Inviting operator
|
|
94
|
+
.describe("Inviting operator user id; null when auto-approved (Automattician signup)."),
|
|
95
95
|
enrolledUserId: z.string().nullable(),
|
|
96
96
|
createdAt: z.string().datetime(),
|
|
97
97
|
});
|
package/dist/contracts/builds.js
CHANGED
|
@@ -27,7 +27,7 @@ export const BuildSettingsSchema = z
|
|
|
27
27
|
allowUnsupportedPlatformFeatures: z.boolean().default(false),
|
|
28
28
|
timeoutSeconds: buildTimeoutSecondsSchema,
|
|
29
29
|
})
|
|
30
|
-
.describe("Resolved build settings. Builds persist this as an immutable settingsSnapshot
|
|
30
|
+
.describe("Resolved build settings. Builds persist this as an immutable `settingsSnapshot`.");
|
|
31
31
|
export const BuildTargetSchema = z
|
|
32
32
|
.object({
|
|
33
33
|
channel: z
|
|
@@ -39,7 +39,7 @@ export const BuildTargetSchema = z
|
|
|
39
39
|
.describe("Channel to promote when the build succeeds; null means no automatic promotion."),
|
|
40
40
|
preview: z.boolean().default(false).describe("Whether the build targets preview behavior."),
|
|
41
41
|
})
|
|
42
|
-
.describe("Where a successful build should publish or preview.");
|
|
42
|
+
.describe("Where a successful build should publish or run in preview mode.");
|
|
43
43
|
// Shared by InternalBuildSourceSchema and InternalBuildInputSchema: both carry
|
|
44
44
|
// this exact archive-source member in their `kind` discriminated union.
|
|
45
45
|
const internalArchiveBuildSourceSchema = z.object({
|
|
@@ -48,7 +48,7 @@ const internalArchiveBuildSourceSchema = z.object({
|
|
|
48
48
|
sourceMetadata: z
|
|
49
49
|
.record(z.string(), z.unknown())
|
|
50
50
|
.optional()
|
|
51
|
-
.describe("Internal source provenance copied to the produced
|
|
51
|
+
.describe("Internal source provenance copied to the produced version."),
|
|
52
52
|
objectKey: z.string().optional().describe("Internal staged archive object key."),
|
|
53
53
|
uploadedAt: z.string().datetime().optional().describe("When the archive finished staging."),
|
|
54
54
|
recoveredAt: z
|
|
@@ -76,7 +76,7 @@ const InternalBuildSourceSchema = z
|
|
|
76
76
|
}),
|
|
77
77
|
internalArchiveBuildSourceSchema,
|
|
78
78
|
])
|
|
79
|
-
.describe("Legacy internal build source shape retained while build routes migrate to input.");
|
|
79
|
+
.describe("Legacy internal build source shape, retained while build routes migrate to input.");
|
|
80
80
|
const InternalBuildInputSchema = z
|
|
81
81
|
.discriminatedUnion("kind", [
|
|
82
82
|
internalArchiveBuildSourceSchema,
|
|
@@ -126,7 +126,7 @@ export const PublicBuildInputSchema = z
|
|
|
126
126
|
})
|
|
127
127
|
.strict(),
|
|
128
128
|
])
|
|
129
|
-
.describe("Public build input. Internal clone URLs and staged object keys are
|
|
129
|
+
.describe("Public build input. Internal clone URLs and staged object keys are hidden.");
|
|
130
130
|
export const BuildCreateInputSchema = z
|
|
131
131
|
.discriminatedUnion("kind", [
|
|
132
132
|
z
|
|
@@ -135,7 +135,7 @@ export const BuildCreateInputSchema = z
|
|
|
135
135
|
sourceMetadata: z
|
|
136
136
|
.record(z.string(), z.unknown())
|
|
137
137
|
.optional()
|
|
138
|
-
.describe("Optional source provenance for the produced
|
|
138
|
+
.describe("Optional source provenance for the produced version."),
|
|
139
139
|
})
|
|
140
140
|
.strict(),
|
|
141
141
|
z.object({
|
|
@@ -153,7 +153,7 @@ export const BuildCreateInputSchema = z
|
|
|
153
153
|
// plain string here since the runner's specific phase vocabulary is an
|
|
154
154
|
// app-level concern, not a shared contract.
|
|
155
155
|
const buildExecutionPhaseSchema = z.object({
|
|
156
|
-
phase: z.string().min(1).describe("Build phase name
|
|
156
|
+
phase: z.string().min(1).describe("Build phase name. See `BUILD_PHASES` in `builds/runner.ts`."),
|
|
157
157
|
at: z.string().datetime(),
|
|
158
158
|
});
|
|
159
159
|
const buildExecutionLaunchSchema = z.object({
|
|
@@ -188,11 +188,11 @@ const InternalBuildExecutionSchema = z
|
|
|
188
188
|
phases: z
|
|
189
189
|
.array(buildExecutionPhaseSchema)
|
|
190
190
|
.optional()
|
|
191
|
-
.describe("Phase timeline the runner appends to
|
|
191
|
+
.describe("Phase timeline that the runner appends to with `recordBuildPhase`."),
|
|
192
192
|
})
|
|
193
193
|
.describe("Internal runner execution metadata surfaced only where appropriate.");
|
|
194
194
|
export const BuildSchema = z.object({
|
|
195
|
-
id: z.string().describe("Build id (`bld_`); opaque
|
|
195
|
+
id: z.string().describe("Build id (`bld_`); opaque and never derived from a version id."),
|
|
196
196
|
spaceId: z.string().describe("Space (`spc_`) the build produces a version for."),
|
|
197
197
|
status: buildStatus.describe("Build lifecycle status."),
|
|
198
198
|
input: PublicBuildInputSchema,
|
|
@@ -206,12 +206,12 @@ export const BuildSchema = z.object({
|
|
|
206
206
|
producedVersionId: z
|
|
207
207
|
.string()
|
|
208
208
|
.nullable()
|
|
209
|
-
.describe("Version (`ver_`) minted by a
|
|
209
|
+
.describe("Version (`ver_`) minted by a successful build; null otherwise."),
|
|
210
210
|
reusedVersionId: z
|
|
211
211
|
.string()
|
|
212
212
|
.nullable()
|
|
213
213
|
.default(null)
|
|
214
|
-
.describe("Existing version reused by a
|
|
214
|
+
.describe("Existing version reused by a successful no-change build; null otherwise."),
|
|
215
215
|
diagnostics: z.array(baseDiagnosticSchema).default([]),
|
|
216
216
|
createdAt: z.string().datetime(),
|
|
217
217
|
startedAt: z.string().datetime().nullable().describe("When the runner picked the build up."),
|
|
@@ -221,7 +221,7 @@ export const buildCreateRequestSchema = z.object({
|
|
|
221
221
|
input: BuildCreateInputSchema,
|
|
222
222
|
settings: BuildSettingsSchema.partial()
|
|
223
223
|
.optional()
|
|
224
|
-
.describe("Per-run settings overrides
|
|
224
|
+
.describe("Per-run settings overrides, persisted as `settingsSnapshot` after resolution."),
|
|
225
225
|
target: BuildTargetSchema.partial().optional(),
|
|
226
226
|
diagnostics: z
|
|
227
227
|
.array(baseDiagnosticSchema)
|
|
@@ -253,9 +253,9 @@ export const spaceBuildIntegrationSchema = z
|
|
|
253
253
|
.object({
|
|
254
254
|
branchChannels: z
|
|
255
255
|
.record(z.string().min(1).describe("Git branch or ref name."), z.literal("live").describe("Channel the branch's builds promote to."))
|
|
256
|
-
.describe("Exact branch
|
|
256
|
+
.describe("Exact branch or ref name to channel name, for example `{ main: 'live' }`."),
|
|
257
257
|
})
|
|
258
|
-
.describe("Per-space build integration config
|
|
258
|
+
.describe("Per-space build integration config that defines where repository builds promote.");
|
|
259
259
|
/** Channel a repository build promotes to, or null when the ref is unmapped (default channel applies). */
|
|
260
260
|
export function resolveBuildChannel(integration, ref) {
|
|
261
261
|
return integration?.branchChannels[ref] ?? null;
|
|
@@ -21,7 +21,7 @@ export const channelListItemSchema = z.object({
|
|
|
21
21
|
.nullable()
|
|
22
22
|
.optional()
|
|
23
23
|
.describe("Last version this channel served before the current pointer (rollback target)."),
|
|
24
|
-
updatedAt: z.string().datetime().describe("
|
|
24
|
+
updatedAt: z.string().datetime().describe("Instant when this channel pointer last moved."),
|
|
25
25
|
});
|
|
26
26
|
// One entry of a channel's promotion history (the deploy log): a single
|
|
27
27
|
// `channel.promoted` event, newest first. This is the audit trail of every
|
|
@@ -40,7 +40,7 @@ export const channelHistoryEntrySchema = z.object({
|
|
|
40
40
|
.optional()
|
|
41
41
|
.describe("Kind of actor that performed the promotion."),
|
|
42
42
|
actorId: z.string().nullable().optional().describe("Identifier of the promoting actor."),
|
|
43
|
-
at: z.string().datetime().describe("
|
|
43
|
+
at: z.string().datetime().describe("Instant when the promotion happened."),
|
|
44
44
|
});
|
|
45
45
|
export const channelListResponseSchema = z.object({
|
|
46
46
|
data: z.array(channelListItemSchema),
|