@spacefast/common 0.0.26 → 0.2.1
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 +186 -7
- package/dist/contracts/builds.js +75 -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 +269 -7
- package/dist/contracts/error-code-meta.js +80 -5
- package/dist/contracts/error-codes.d.ts +5 -5
- package/dist/contracts/error-codes.js +78 -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 +112 -10
- package/dist/contracts/oauth-resources.js +116 -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 +2098 -1
- package/dist/docs/error-docs.js +281 -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,67 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { registeredIdSchema } from "./ids.js";
|
|
3
|
+
function isExactHttpOrigin(value) {
|
|
4
|
+
let url;
|
|
5
|
+
try {
|
|
6
|
+
url = new URL(value);
|
|
7
|
+
}
|
|
8
|
+
catch {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
return ((url.protocol === "https:" || url.protocol === "http:") &&
|
|
12
|
+
url.origin === value &&
|
|
13
|
+
url.pathname === "/" &&
|
|
14
|
+
url.search === "" &&
|
|
15
|
+
url.hash === "" &&
|
|
16
|
+
url.username === "" &&
|
|
17
|
+
url.password === "");
|
|
18
|
+
}
|
|
19
|
+
export const exactOriginSchema = z
|
|
20
|
+
.string()
|
|
21
|
+
.url()
|
|
22
|
+
.max(2_000)
|
|
23
|
+
.refine(isExactHttpOrigin, "must be an exact HTTP origin without path, credentials, query, or fragment")
|
|
24
|
+
.brand();
|
|
25
|
+
const principalAudienceSchema = z
|
|
26
|
+
.object({
|
|
27
|
+
spaceId: registeredIdSchema("spc"),
|
|
28
|
+
runtimeInstanceId: z.string().min(1).max(255),
|
|
29
|
+
host: exactOriginSchema,
|
|
30
|
+
})
|
|
31
|
+
.strict();
|
|
32
|
+
const principalSubjectSchema = z
|
|
33
|
+
.object({
|
|
34
|
+
issuer: z.string().min(1).max(255),
|
|
35
|
+
subject: z.string().min(1).max(512),
|
|
36
|
+
})
|
|
37
|
+
.strict();
|
|
38
|
+
const principalAssertionFields = {
|
|
39
|
+
format: z.literal("spacefast.principal"),
|
|
40
|
+
version: z.literal(1),
|
|
41
|
+
audience: principalAudienceSchema,
|
|
42
|
+
sessionVersion: z.number().int().nonnegative(),
|
|
43
|
+
accessGeneration: z.number().int().nonnegative(),
|
|
44
|
+
nonce: z.string().min(16).max(512),
|
|
45
|
+
issuedAt: z.number().int().nonnegative(),
|
|
46
|
+
expiresAt: z.number().int().positive(),
|
|
47
|
+
};
|
|
48
|
+
export const principalAssertionV1Schema = z
|
|
49
|
+
.union([
|
|
50
|
+
z
|
|
51
|
+
.object({
|
|
52
|
+
...principalAssertionFields,
|
|
53
|
+
actor: z.object({ kind: z.literal("user"), id: z.string().min(1).max(255) }).strict(),
|
|
54
|
+
subject: principalSubjectSchema.optional(),
|
|
55
|
+
})
|
|
56
|
+
.strict(),
|
|
57
|
+
z
|
|
58
|
+
.object({
|
|
59
|
+
...principalAssertionFields,
|
|
60
|
+
actor: z.object({ kind: z.literal("service"), id: z.string().min(1).max(255) }).strict(),
|
|
61
|
+
})
|
|
62
|
+
.strict(),
|
|
63
|
+
])
|
|
64
|
+
.refine((assertion) => assertion.expiresAt > assertion.issuedAt, {
|
|
65
|
+
path: ["expiresAt"],
|
|
66
|
+
message: "expiresAt must be after issuedAt",
|
|
67
|
+
});
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* An external principal: the partner's own customer, as this platform knows it.
|
|
4
|
+
*
|
|
5
|
+
* A principal is materialized the first time it owns something here, never by
|
|
6
|
+
* registration — there is no "create principal" call, and the id is whatever
|
|
7
|
+
* the partner already calls that customer in its own system. `principalId` is
|
|
8
|
+
* therefore the partner's id verbatim, casing included; matching within a
|
|
9
|
+
* tenant is case-insensitive, so `Cus_ABC` and `cus_abc` are one principal and
|
|
10
|
+
* the first spelling seen is the one kept.
|
|
11
|
+
*
|
|
12
|
+
* `principalType` is a literal rather than the team/external union the resource
|
|
13
|
+
* refs use: teams are principals too, but they are addressed as teams and have
|
|
14
|
+
* their own surface. This resource exists to answer "who are my customers", and
|
|
15
|
+
* only external principals are.
|
|
16
|
+
*/
|
|
17
|
+
export declare const PrincipalSchema: z.ZodObject<{
|
|
18
|
+
principalType: z.ZodLiteral<"external">;
|
|
19
|
+
principalId: z.ZodString;
|
|
20
|
+
mode: z.ZodEnum<{
|
|
21
|
+
live: "live";
|
|
22
|
+
test: "test";
|
|
23
|
+
}>;
|
|
24
|
+
spaceCount: z.ZodNumber;
|
|
25
|
+
status: z.ZodEnum<{
|
|
26
|
+
active: "active";
|
|
27
|
+
suspended: "suspended";
|
|
28
|
+
closed: "closed";
|
|
29
|
+
}>;
|
|
30
|
+
statusReason: z.ZodNullable<z.ZodString>;
|
|
31
|
+
statusChangedAt: z.ZodNullable<z.ZodString>;
|
|
32
|
+
statusActor: z.ZodNullable<z.ZodEnum<{
|
|
33
|
+
spacefast: "spacefast";
|
|
34
|
+
partner: "partner";
|
|
35
|
+
}>>;
|
|
36
|
+
assignedPlan: z.ZodNullable<z.ZodString>;
|
|
37
|
+
createdAt: z.ZodString;
|
|
38
|
+
updatedAt: z.ZodString;
|
|
39
|
+
}, z.core.$strip>;
|
|
40
|
+
export type Principal = z.infer<typeof PrincipalSchema>;
|
|
41
|
+
export declare const principalListSchema: z.ZodObject<{
|
|
42
|
+
data: z.ZodArray<z.ZodObject<{
|
|
43
|
+
principalType: z.ZodLiteral<"external">;
|
|
44
|
+
principalId: z.ZodString;
|
|
45
|
+
mode: z.ZodEnum<{
|
|
46
|
+
live: "live";
|
|
47
|
+
test: "test";
|
|
48
|
+
}>;
|
|
49
|
+
spaceCount: z.ZodNumber;
|
|
50
|
+
status: z.ZodEnum<{
|
|
51
|
+
active: "active";
|
|
52
|
+
suspended: "suspended";
|
|
53
|
+
closed: "closed";
|
|
54
|
+
}>;
|
|
55
|
+
statusReason: z.ZodNullable<z.ZodString>;
|
|
56
|
+
statusChangedAt: z.ZodNullable<z.ZodString>;
|
|
57
|
+
statusActor: z.ZodNullable<z.ZodEnum<{
|
|
58
|
+
spacefast: "spacefast";
|
|
59
|
+
partner: "partner";
|
|
60
|
+
}>>;
|
|
61
|
+
assignedPlan: z.ZodNullable<z.ZodString>;
|
|
62
|
+
createdAt: z.ZodString;
|
|
63
|
+
updatedAt: z.ZodString;
|
|
64
|
+
}, z.core.$strip>>;
|
|
65
|
+
pagination: z.ZodObject<{
|
|
66
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
67
|
+
hasMore: z.ZodBoolean;
|
|
68
|
+
}, z.core.$strip>;
|
|
69
|
+
}, z.core.$strip>;
|
|
70
|
+
export type PrincipalList = z.infer<typeof principalListSchema>;
|
|
71
|
+
export declare const PrincipalParamsSchema: z.ZodObject<{
|
|
72
|
+
principalId: z.ZodString;
|
|
73
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { principalLifecycleStatusSchema, principalStatusActorSchema } from "./commerce.js";
|
|
3
|
+
import { CursorPaginationSchema, cursorListQuerySchema } from "./common.js";
|
|
4
|
+
import { tenantMode } from "./enums.js";
|
|
5
|
+
/**
|
|
6
|
+
* An external principal: the partner's own customer, as this platform knows it.
|
|
7
|
+
*
|
|
8
|
+
* A principal is materialized the first time it owns something here, never by
|
|
9
|
+
* registration — there is no "create principal" call, and the id is whatever
|
|
10
|
+
* the partner already calls that customer in its own system. `principalId` is
|
|
11
|
+
* therefore the partner's id verbatim, casing included; matching within a
|
|
12
|
+
* tenant is case-insensitive, so `Cus_ABC` and `cus_abc` are one principal and
|
|
13
|
+
* the first spelling seen is the one kept.
|
|
14
|
+
*
|
|
15
|
+
* `principalType` is a literal rather than the team/external union the resource
|
|
16
|
+
* refs use: teams are principals too, but they are addressed as teams and have
|
|
17
|
+
* their own surface. This resource exists to answer "who are my customers", and
|
|
18
|
+
* only external principals are.
|
|
19
|
+
*/
|
|
20
|
+
export const PrincipalSchema = z.object({
|
|
21
|
+
principalType: z
|
|
22
|
+
.literal("external")
|
|
23
|
+
.describe("Always `external`: teams are principals too, but they have their own surface."),
|
|
24
|
+
principalId: z
|
|
25
|
+
.string()
|
|
26
|
+
.describe("The partner's own id for this customer, in the casing it was first seen."),
|
|
27
|
+
mode: tenantMode.describe("`test` when this principal belongs to a linked test tenant, `live` otherwise."),
|
|
28
|
+
spaceCount: z
|
|
29
|
+
.number()
|
|
30
|
+
.int()
|
|
31
|
+
.nonnegative()
|
|
32
|
+
.describe("Spaces this principal currently owns in the tenant."),
|
|
33
|
+
status: principalLifecycleStatusSchema.describe("Lifecycle status. `active` by default; `suspended` reversibly halts the principal's spaces and mutations; `closed` is terminal."),
|
|
34
|
+
statusReason: z
|
|
35
|
+
.string()
|
|
36
|
+
.nullable()
|
|
37
|
+
.describe("Free-text reason recorded with the last status change, or null."),
|
|
38
|
+
statusChangedAt: z
|
|
39
|
+
.string()
|
|
40
|
+
.datetime()
|
|
41
|
+
.nullable()
|
|
42
|
+
.describe("When the status last changed, or null while never changed from the default."),
|
|
43
|
+
statusActor: principalStatusActorSchema
|
|
44
|
+
.nullable()
|
|
45
|
+
.describe("Who applied the current status: `partner` (the tenant) or `spacefast` (unliftable by the partner). Null while never changed."),
|
|
46
|
+
assignedPlan: z
|
|
47
|
+
.string()
|
|
48
|
+
.nullable()
|
|
49
|
+
.describe("Plan name assigned from the tenant's catalog, or null to fall back to defaultPlan."),
|
|
50
|
+
createdAt: z.string().datetime().describe("When this principal first owned something here."),
|
|
51
|
+
updatedAt: z.string().datetime().describe("When this principal was last seen owning something."),
|
|
52
|
+
});
|
|
53
|
+
export const principalListSchema = z.object({
|
|
54
|
+
data: z.array(PrincipalSchema),
|
|
55
|
+
pagination: CursorPaginationSchema,
|
|
56
|
+
});
|
|
57
|
+
export const PrincipalParamsSchema = z.object({
|
|
58
|
+
principalId: z.string().min(1).describe("The partner's own id for this customer."),
|
|
59
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const privacySettingsSchema: z.ZodObject<{
|
|
3
|
+
analyticsOptOut: z.ZodBoolean;
|
|
4
|
+
advertisingOptOut: z.ZodBoolean;
|
|
5
|
+
}, z.core.$strip>;
|
|
6
|
+
export type PrivacySettings = z.infer<typeof privacySettingsSchema>;
|
|
7
|
+
export declare const privacySettingsPatchSchema: z.ZodObject<{
|
|
8
|
+
analyticsOptOut: z.ZodOptional<z.ZodBoolean>;
|
|
9
|
+
advertisingOptOut: z.ZodOptional<z.ZodBoolean>;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
export type PrivacySettingsPatch = z.infer<typeof privacySettingsPatchSchema>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
// Account-level privacy choices, modeled on WordPress.com's `/me/settings`
|
|
3
|
+
// pair (`tracks_opt_out`, `advertising_targeting_opt_out`). These are durable
|
|
4
|
+
// server-side settings, distinct from the browser cookie-consent buckets: the
|
|
5
|
+
// cookie answers "what may run in THIS browser", these answer "what may this
|
|
6
|
+
// ACCOUNT's data be used for" on every device.
|
|
7
|
+
export const privacySettingsSchema = z.object({
|
|
8
|
+
analyticsOptOut: z
|
|
9
|
+
.boolean()
|
|
10
|
+
.describe("Opt out of product analytics. When true, no analytics events are recorded for this account, in the browser or server-side."),
|
|
11
|
+
advertisingOptOut: z
|
|
12
|
+
.boolean()
|
|
13
|
+
.describe("Do-not-sell/share election (CCPA). When true, the account is excluded from any advertising or audience use."),
|
|
14
|
+
});
|
|
15
|
+
export const privacySettingsPatchSchema = privacySettingsSchema
|
|
16
|
+
.partial()
|
|
17
|
+
.describe("Fields to change; omitted fields are left alone.");
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
// Reader for the RFC 9457 problem document every 4xx/5xx response carries, so
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
// and public field names — this only extracts the wire members.
|
|
1
|
+
// Reader for the RFC 9457 problem document every 4xx/5xx response carries, so
|
|
2
|
+
// the CLI, MCP, and SDK share one definition of the wire members. Callers keep
|
|
3
|
+
// their own entry guards, message fallbacks, and public field names.
|
|
5
4
|
/** Returns undefined when the payload cannot be a problem document at all. */
|
|
6
5
|
export function parseProblemDocument(payload) {
|
|
7
6
|
if (!payload || typeof payload !== "object" || Array.isArray(payload)) {
|
|
@@ -5,7 +5,7 @@ export declare const archivePublishReceiptSchema: z.ZodObject<{
|
|
|
5
5
|
slug: z.ZodString;
|
|
6
6
|
title: z.ZodString;
|
|
7
7
|
publicName: z.ZodString;
|
|
8
|
-
defaultHostname: z.ZodString
|
|
8
|
+
defaultHostname: z.ZodOptional<z.ZodString>;
|
|
9
9
|
liveUrl: z.ZodNullable<z.ZodString>;
|
|
10
10
|
}, z.core.$strip>;
|
|
11
11
|
build: z.ZodObject<{
|
|
@@ -30,6 +30,37 @@ export declare const archivePublishReceiptSchema: z.ZodObject<{
|
|
|
30
30
|
branch: z.ZodOptional<z.ZodString>;
|
|
31
31
|
pullRequestNumber: z.ZodOptional<z.ZodNumber>;
|
|
32
32
|
}, z.core.$strict>], "kind">;
|
|
33
|
+
source: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
34
|
+
kind: z.ZodEnum<{
|
|
35
|
+
build: "build";
|
|
36
|
+
agent: "agent";
|
|
37
|
+
api: "api";
|
|
38
|
+
dashboard: "dashboard";
|
|
39
|
+
cli: "cli";
|
|
40
|
+
git: "git";
|
|
41
|
+
direct_upload: "direct_upload";
|
|
42
|
+
import: "import";
|
|
43
|
+
variable_update: "variable_update";
|
|
44
|
+
config_update: "config_update";
|
|
45
|
+
}>;
|
|
46
|
+
client: z.ZodOptional<z.ZodString>;
|
|
47
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
48
|
+
commit: z.ZodOptional<z.ZodString>;
|
|
49
|
+
message: z.ZodOptional<z.ZodString>;
|
|
50
|
+
dirty: z.ZodOptional<z.ZodBoolean>;
|
|
51
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
52
|
+
git: z.ZodOptional<z.ZodObject<{
|
|
53
|
+
repository: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
54
|
+
repositoryFullName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
55
|
+
repositoryUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
56
|
+
ref: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
57
|
+
branch: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
58
|
+
branchAliasUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
59
|
+
commit: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
60
|
+
commitSha: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
61
|
+
pullRequestNumber: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
62
|
+
}, z.core.$catchall<z.ZodUnknown>>>;
|
|
63
|
+
}, z.core.$strip>>>;
|
|
33
64
|
settingsSnapshot: z.ZodObject<{
|
|
34
65
|
rootDirectory: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
35
66
|
installDirectory: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
@@ -53,8 +84,8 @@ export declare const archivePublishReceiptSchema: z.ZodObject<{
|
|
|
53
84
|
code: z.ZodString;
|
|
54
85
|
severity: z.ZodEnum<{
|
|
55
86
|
info: "info";
|
|
56
|
-
error: "error";
|
|
57
87
|
warning: "warning";
|
|
88
|
+
error: "error";
|
|
58
89
|
}>;
|
|
59
90
|
message: z.ZodString;
|
|
60
91
|
path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -86,7 +117,7 @@ export declare const archivePublishReceiptSchema: z.ZodObject<{
|
|
|
86
117
|
finalizing: "finalizing";
|
|
87
118
|
ready: "ready";
|
|
88
119
|
}>;
|
|
89
|
-
immutableUrl: z.ZodString
|
|
120
|
+
immutableUrl: z.ZodNullable<z.ZodString>;
|
|
90
121
|
ref: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
91
122
|
number: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
92
123
|
manifestHash: z.ZodNullable<z.ZodString>;
|
|
@@ -114,6 +145,15 @@ export declare const archivePublishReceiptSchema: z.ZodObject<{
|
|
|
114
145
|
retryAfter: z.ZodOptional<z.ZodNumber>;
|
|
115
146
|
hint: z.ZodString;
|
|
116
147
|
}, z.core.$strip>;
|
|
148
|
+
git: z.ZodOptional<z.ZodObject<{
|
|
149
|
+
managedBy: z.ZodEnum<{
|
|
150
|
+
spacefast: "spacefast";
|
|
151
|
+
github: "github";
|
|
152
|
+
}>;
|
|
153
|
+
remoteUrl: z.ZodNullable<z.ZodString>;
|
|
154
|
+
repository: z.ZodNullable<z.ZodString>;
|
|
155
|
+
defaultBranch: z.ZodNullable<z.ZodString>;
|
|
156
|
+
}, z.core.$strip>>;
|
|
117
157
|
access: z.ZodOptional<z.ZodObject<{
|
|
118
158
|
url: z.ZodString;
|
|
119
159
|
token: z.ZodString;
|
|
@@ -129,8 +169,8 @@ export declare const archivePublishReceiptSchema: z.ZodObject<{
|
|
|
129
169
|
code: z.ZodString;
|
|
130
170
|
severity: z.ZodEnum<{
|
|
131
171
|
info: "info";
|
|
132
|
-
error: "error";
|
|
133
172
|
warning: "warning";
|
|
173
|
+
error: "error";
|
|
134
174
|
}>;
|
|
135
175
|
message: z.ZodString;
|
|
136
176
|
path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -154,9 +194,8 @@ export declare const archivePublishReceiptSchema: z.ZodObject<{
|
|
|
154
194
|
/**
|
|
155
195
|
* `build` is the discriminant: a remote-build publish carries one, an ordinary
|
|
156
196
|
* publish never does. The archive member is tried first because the ordinary
|
|
157
|
-
* receipt
|
|
158
|
-
*
|
|
159
|
-
* every caller's `"build" in receipt` check answering false.
|
|
197
|
+
* receipt also matches a finished build's receipt and would strip the build off
|
|
198
|
+
* it, leaving every caller's `"build" in receipt` check answering false.
|
|
160
199
|
*/
|
|
161
200
|
export declare const publishResponseReceiptSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
162
201
|
space: z.ZodObject<{
|
|
@@ -164,7 +203,7 @@ export declare const publishResponseReceiptSchema: z.ZodUnion<readonly [z.ZodObj
|
|
|
164
203
|
slug: z.ZodString;
|
|
165
204
|
title: z.ZodString;
|
|
166
205
|
publicName: z.ZodString;
|
|
167
|
-
defaultHostname: z.ZodString
|
|
206
|
+
defaultHostname: z.ZodOptional<z.ZodString>;
|
|
168
207
|
liveUrl: z.ZodNullable<z.ZodString>;
|
|
169
208
|
}, z.core.$strip>;
|
|
170
209
|
build: z.ZodObject<{
|
|
@@ -189,6 +228,37 @@ export declare const publishResponseReceiptSchema: z.ZodUnion<readonly [z.ZodObj
|
|
|
189
228
|
branch: z.ZodOptional<z.ZodString>;
|
|
190
229
|
pullRequestNumber: z.ZodOptional<z.ZodNumber>;
|
|
191
230
|
}, z.core.$strict>], "kind">;
|
|
231
|
+
source: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
232
|
+
kind: z.ZodEnum<{
|
|
233
|
+
build: "build";
|
|
234
|
+
agent: "agent";
|
|
235
|
+
api: "api";
|
|
236
|
+
dashboard: "dashboard";
|
|
237
|
+
cli: "cli";
|
|
238
|
+
git: "git";
|
|
239
|
+
direct_upload: "direct_upload";
|
|
240
|
+
import: "import";
|
|
241
|
+
variable_update: "variable_update";
|
|
242
|
+
config_update: "config_update";
|
|
243
|
+
}>;
|
|
244
|
+
client: z.ZodOptional<z.ZodString>;
|
|
245
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
246
|
+
commit: z.ZodOptional<z.ZodString>;
|
|
247
|
+
message: z.ZodOptional<z.ZodString>;
|
|
248
|
+
dirty: z.ZodOptional<z.ZodBoolean>;
|
|
249
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
250
|
+
git: z.ZodOptional<z.ZodObject<{
|
|
251
|
+
repository: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
252
|
+
repositoryFullName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
253
|
+
repositoryUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
254
|
+
ref: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
255
|
+
branch: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
256
|
+
branchAliasUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
257
|
+
commit: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
258
|
+
commitSha: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
259
|
+
pullRequestNumber: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
260
|
+
}, z.core.$catchall<z.ZodUnknown>>>;
|
|
261
|
+
}, z.core.$strip>>>;
|
|
192
262
|
settingsSnapshot: z.ZodObject<{
|
|
193
263
|
rootDirectory: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
194
264
|
installDirectory: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
@@ -212,8 +282,8 @@ export declare const publishResponseReceiptSchema: z.ZodUnion<readonly [z.ZodObj
|
|
|
212
282
|
code: z.ZodString;
|
|
213
283
|
severity: z.ZodEnum<{
|
|
214
284
|
info: "info";
|
|
215
|
-
error: "error";
|
|
216
285
|
warning: "warning";
|
|
286
|
+
error: "error";
|
|
217
287
|
}>;
|
|
218
288
|
message: z.ZodString;
|
|
219
289
|
path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -245,7 +315,7 @@ export declare const publishResponseReceiptSchema: z.ZodUnion<readonly [z.ZodObj
|
|
|
245
315
|
finalizing: "finalizing";
|
|
246
316
|
ready: "ready";
|
|
247
317
|
}>;
|
|
248
|
-
immutableUrl: z.ZodString
|
|
318
|
+
immutableUrl: z.ZodNullable<z.ZodString>;
|
|
249
319
|
ref: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
250
320
|
number: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
251
321
|
manifestHash: z.ZodNullable<z.ZodString>;
|
|
@@ -273,6 +343,15 @@ export declare const publishResponseReceiptSchema: z.ZodUnion<readonly [z.ZodObj
|
|
|
273
343
|
retryAfter: z.ZodOptional<z.ZodNumber>;
|
|
274
344
|
hint: z.ZodString;
|
|
275
345
|
}, z.core.$strip>;
|
|
346
|
+
git: z.ZodOptional<z.ZodObject<{
|
|
347
|
+
managedBy: z.ZodEnum<{
|
|
348
|
+
spacefast: "spacefast";
|
|
349
|
+
github: "github";
|
|
350
|
+
}>;
|
|
351
|
+
remoteUrl: z.ZodNullable<z.ZodString>;
|
|
352
|
+
repository: z.ZodNullable<z.ZodString>;
|
|
353
|
+
defaultBranch: z.ZodNullable<z.ZodString>;
|
|
354
|
+
}, z.core.$strip>>;
|
|
276
355
|
access: z.ZodOptional<z.ZodObject<{
|
|
277
356
|
url: z.ZodString;
|
|
278
357
|
token: z.ZodString;
|
|
@@ -288,8 +367,8 @@ export declare const publishResponseReceiptSchema: z.ZodUnion<readonly [z.ZodObj
|
|
|
288
367
|
code: z.ZodString;
|
|
289
368
|
severity: z.ZodEnum<{
|
|
290
369
|
info: "info";
|
|
291
|
-
error: "error";
|
|
292
370
|
warning: "warning";
|
|
371
|
+
error: "error";
|
|
293
372
|
}>;
|
|
294
373
|
message: z.ZodString;
|
|
295
374
|
path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -315,7 +394,7 @@ export declare const publishResponseReceiptSchema: z.ZodUnion<readonly [z.ZodObj
|
|
|
315
394
|
slug: z.ZodString;
|
|
316
395
|
title: z.ZodString;
|
|
317
396
|
publicName: z.ZodString;
|
|
318
|
-
defaultHostname: z.ZodString
|
|
397
|
+
defaultHostname: z.ZodOptional<z.ZodString>;
|
|
319
398
|
liveUrl: z.ZodNullable<z.ZodString>;
|
|
320
399
|
}, z.core.$strip>;
|
|
321
400
|
access: z.ZodOptional<z.ZodObject<{
|
|
@@ -337,7 +416,7 @@ export declare const publishResponseReceiptSchema: z.ZodUnion<readonly [z.ZodObj
|
|
|
337
416
|
finalizing: "finalizing";
|
|
338
417
|
ready: "ready";
|
|
339
418
|
}>;
|
|
340
|
-
immutableUrl: z.ZodString
|
|
419
|
+
immutableUrl: z.ZodNullable<z.ZodString>;
|
|
341
420
|
ref: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
342
421
|
number: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
343
422
|
manifestHash: z.ZodNullable<z.ZodString>;
|
|
@@ -365,6 +444,23 @@ export declare const publishResponseReceiptSchema: z.ZodUnion<readonly [z.ZodObj
|
|
|
365
444
|
retryAfter: z.ZodOptional<z.ZodNumber>;
|
|
366
445
|
hint: z.ZodString;
|
|
367
446
|
}, z.core.$strip>;
|
|
447
|
+
git: z.ZodOptional<z.ZodObject<{
|
|
448
|
+
managedBy: z.ZodEnum<{
|
|
449
|
+
spacefast: "spacefast";
|
|
450
|
+
github: "github";
|
|
451
|
+
}>;
|
|
452
|
+
remoteUrl: z.ZodNullable<z.ZodString>;
|
|
453
|
+
repository: z.ZodNullable<z.ZodString>;
|
|
454
|
+
defaultBranch: z.ZodNullable<z.ZodString>;
|
|
455
|
+
}, z.core.$strip>>;
|
|
456
|
+
authMode: z.ZodOptional<z.ZodEnum<{
|
|
457
|
+
anonymous: "anonymous";
|
|
458
|
+
authenticated: "authenticated";
|
|
459
|
+
}>>;
|
|
460
|
+
persistence: z.ZodOptional<z.ZodEnum<{
|
|
461
|
+
managed: "managed";
|
|
462
|
+
temporary: "temporary";
|
|
463
|
+
}>>;
|
|
368
464
|
operation: z.ZodOptional<z.ZodObject<{
|
|
369
465
|
id: z.ZodString;
|
|
370
466
|
kind: z.ZodString;
|
|
@@ -388,8 +484,8 @@ export declare const publishResponseReceiptSchema: z.ZodUnion<readonly [z.ZodObj
|
|
|
388
484
|
code: z.ZodString;
|
|
389
485
|
severity: z.ZodEnum<{
|
|
390
486
|
info: "info";
|
|
391
|
-
error: "error";
|
|
392
487
|
warning: "warning";
|
|
488
|
+
error: "error";
|
|
393
489
|
}>;
|
|
394
490
|
message: z.ZodString;
|
|
395
491
|
path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -436,7 +532,8 @@ export declare const publishResponseReceiptSchema: z.ZodUnion<readonly [z.ZodObj
|
|
|
436
532
|
contentType: z.ZodOptional<z.ZodString>;
|
|
437
533
|
}, z.core.$strip>>>;
|
|
438
534
|
links: z.ZodObject<{
|
|
439
|
-
|
|
535
|
+
refresh: z.ZodString;
|
|
536
|
+
resume: z.ZodOptional<z.ZodString>;
|
|
440
537
|
finalize: z.ZodString;
|
|
441
538
|
}, z.core.$strip>;
|
|
442
539
|
details: z.ZodOptional<z.ZodObject<{
|
|
@@ -452,8 +549,8 @@ export declare const publishResponseReceiptSchema: z.ZodUnion<readonly [z.ZodObj
|
|
|
452
549
|
code: z.ZodString;
|
|
453
550
|
severity: z.ZodEnum<{
|
|
454
551
|
info: "info";
|
|
455
|
-
error: "error";
|
|
456
552
|
warning: "warning";
|
|
553
|
+
error: "error";
|
|
457
554
|
}>;
|
|
458
555
|
message: z.ZodString;
|
|
459
556
|
path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -470,17 +567,17 @@ export declare const publishResponseReceiptSchema: z.ZodUnion<readonly [z.ZodObj
|
|
|
470
567
|
}, z.core.$strip>>;
|
|
471
568
|
}, z.core.$strip>>;
|
|
472
569
|
claim: z.ZodOptional<z.ZodObject<{
|
|
570
|
+
expiresAt: z.ZodString;
|
|
473
571
|
key: z.ZodString;
|
|
474
572
|
url: z.ZodString;
|
|
475
573
|
claimUrl: z.ZodString;
|
|
476
|
-
expiresAt: z.ZodString;
|
|
477
574
|
}, z.core.$strip>>;
|
|
478
575
|
diagnostics: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
479
576
|
code: z.ZodString;
|
|
480
577
|
severity: z.ZodEnum<{
|
|
481
578
|
info: "info";
|
|
482
|
-
error: "error";
|
|
483
579
|
warning: "warning";
|
|
580
|
+
error: "error";
|
|
484
581
|
}>;
|
|
485
582
|
message: z.ZodString;
|
|
486
583
|
path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -495,6 +592,7 @@ export declare const publishResponseReceiptSchema: z.ZodUnion<readonly [z.ZodObj
|
|
|
495
592
|
retryable: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
496
593
|
}, z.core.$strip>>>;
|
|
497
594
|
links: z.ZodOptional<z.ZodObject<{
|
|
595
|
+
refresh: z.ZodOptional<z.ZodString>;
|
|
498
596
|
resume: z.ZodOptional<z.ZodString>;
|
|
499
597
|
finalize: z.ZodOptional<z.ZodString>;
|
|
500
598
|
promote: z.ZodOptional<z.ZodString>;
|
|
@@ -2,6 +2,7 @@ import { z } from "zod";
|
|
|
2
2
|
import { publishedAccessSchema } from "./access.js";
|
|
3
3
|
import { BuildSchema } from "./builds.js";
|
|
4
4
|
import { baseDiagnosticSchema } from "./common.js";
|
|
5
|
+
import { spaceGitSchema } from "./resources.js";
|
|
5
6
|
import { publishActivationSchema, publishNextSchema, publishReceiptSchema, publishReceiptSpaceSchema, publishReceiptVersionSchema, spaceClaimReceiptSchema, } from "./spaces.js";
|
|
6
7
|
export const archivePublishReceiptSchema = z.object({
|
|
7
8
|
space: publishReceiptSpaceSchema,
|
|
@@ -9,6 +10,9 @@ export const archivePublishReceiptSchema = z.object({
|
|
|
9
10
|
version: publishReceiptVersionSchema.optional(),
|
|
10
11
|
activation: publishActivationSchema.optional(),
|
|
11
12
|
next: publishNextSchema,
|
|
13
|
+
// Same block, same meaning as the ordinary receipt: a build publish is still
|
|
14
|
+
// a publish, and the caller still wants to know how to push the next one.
|
|
15
|
+
git: spaceGitSchema.optional(),
|
|
12
16
|
access: publishedAccessSchema.optional(),
|
|
13
17
|
claim: spaceClaimReceiptSchema.optional(),
|
|
14
18
|
diagnostics: z.array(baseDiagnosticSchema).optional(),
|
|
@@ -22,9 +26,8 @@ export const archivePublishReceiptSchema = z.object({
|
|
|
22
26
|
/**
|
|
23
27
|
* `build` is the discriminant: a remote-build publish carries one, an ordinary
|
|
24
28
|
* publish never does. The archive member is tried first because the ordinary
|
|
25
|
-
* receipt
|
|
26
|
-
*
|
|
27
|
-
* every caller's `"build" in receipt` check answering false.
|
|
29
|
+
* receipt also matches a finished build's receipt and would strip the build off
|
|
30
|
+
* it, leaving every caller's `"build" in receipt` check answering false.
|
|
28
31
|
*/
|
|
29
32
|
export const publishResponseReceiptSchema = z.union([
|
|
30
33
|
archivePublishReceiptSchema,
|
|
@@ -9,8 +9,8 @@ export declare const pushNewSessionStatusSchema: z.ZodEnum<{
|
|
|
9
9
|
waiting_for_upload: "waiting_for_upload";
|
|
10
10
|
}>;
|
|
11
11
|
export declare const pushNewSourceKindSchema: z.ZodEnum<{
|
|
12
|
-
direct_upload: "direct_upload";
|
|
13
12
|
git: "git";
|
|
13
|
+
direct_upload: "direct_upload";
|
|
14
14
|
}>;
|
|
15
15
|
export declare const pushNewUploadModeSchema: z.ZodEnum<{
|
|
16
16
|
static_publish: "static_publish";
|
|
@@ -28,8 +28,8 @@ export declare const PushNewSessionSchema: z.ZodObject<{
|
|
|
28
28
|
waiting_for_upload: "waiting_for_upload";
|
|
29
29
|
}>;
|
|
30
30
|
sourceKind: z.ZodEnum<{
|
|
31
|
-
direct_upload: "direct_upload";
|
|
32
31
|
git: "git";
|
|
32
|
+
direct_upload: "direct_upload";
|
|
33
33
|
}>;
|
|
34
34
|
uploadMode: z.ZodNullable<z.ZodEnum<{
|
|
35
35
|
static_publish: "static_publish";
|
|
@@ -86,8 +86,8 @@ export declare const PushNewCreateSessionResponseSchema: z.ZodObject<{
|
|
|
86
86
|
waiting_for_upload: "waiting_for_upload";
|
|
87
87
|
}>;
|
|
88
88
|
sourceKind: z.ZodEnum<{
|
|
89
|
-
direct_upload: "direct_upload";
|
|
90
89
|
git: "git";
|
|
90
|
+
direct_upload: "direct_upload";
|
|
91
91
|
}>;
|
|
92
92
|
uploadMode: z.ZodNullable<z.ZodEnum<{
|
|
93
93
|
static_publish: "static_publish";
|
|
@@ -175,8 +175,8 @@ export declare const PushNewStatusResponseSchema: z.ZodObject<{
|
|
|
175
175
|
spaceSlug: z.ZodString;
|
|
176
176
|
errorCode: z.ZodNullable<z.ZodString>;
|
|
177
177
|
sourceKind: z.ZodEnum<{
|
|
178
|
-
direct_upload: "direct_upload";
|
|
179
178
|
git: "git";
|
|
179
|
+
direct_upload: "direct_upload";
|
|
180
180
|
}>;
|
|
181
181
|
remoteExpiresAt: z.ZodNullable<z.ZodString>;
|
|
182
182
|
uploadMode: z.ZodNullable<z.ZodEnum<{
|
package/dist/contracts/quotas.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// Crude worst-case quotas (the platform spec "Abuse Posture"): hard,
|
|
2
2
|
// launch-day abuse controls that exist independently of plan limits. One named
|
|
3
|
-
// raise-only table
|
|
4
|
-
//
|
|
5
|
-
//
|
|
3
|
+
// raise-only table: raise a limit later, never lower one. Enforcement points
|
|
4
|
+
// live in the control plane and reference these names; every trip emits
|
|
5
|
+
// activity/ops events so thresholds are tuned from data.
|
|
6
6
|
export const WORST_CASE_QUOTAS = {
|
|
7
7
|
// Per-version artifact ceiling (sum of file bytes; enforced at manifest intake).
|
|
8
8
|
maxArtifactBytes: 2 * 1024 * 1024 * 1024,
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The realtime cache lane's wire contract: one schema, both ends of the socket.
|
|
3
|
+
*
|
|
4
|
+
* The control plane publishes `resource.changed` onto a Space's Cast notice room
|
|
5
|
+
* whenever a mutation moves something a dashboard reads back
|
|
6
|
+
* (`apps/control-plane/src/comments/notices.ts`), and the dashboard turns those
|
|
7
|
+
* notices into targeted query invalidations
|
|
8
|
+
* (`packages/app-shell/src/lib/realtime-invalidation.ts`). Nothing renders this
|
|
9
|
+
* notice — it is read by code only — so the two sides agreeing on the shape is
|
|
10
|
+
* the entire contract, and they agree by importing the same schema rather than
|
|
11
|
+
* by keeping two copies in step.
|
|
12
|
+
*
|
|
13
|
+
* This lane is deliberately not part of the HTTP API: it carries no data, only
|
|
14
|
+
* the name of what moved. A missed notice costs a later refetch, never
|
|
15
|
+
* correctness.
|
|
16
|
+
*/
|
|
17
|
+
import { z } from "zod";
|
|
18
|
+
/** The notice kind. Shares the `notice` event with Cast's own comment kinds. */
|
|
19
|
+
export declare const RESOURCE_CHANGED = "resource.changed";
|
|
20
|
+
/**
|
|
21
|
+
* The payload shape.
|
|
22
|
+
*
|
|
23
|
+
* `resource` is singular and names the kind of thing that moved rather than a
|
|
24
|
+
* table or a query key, so the receiver can map it onto whatever keys it holds.
|
|
25
|
+
* `ids` is advisory and deliberately lenient: a notice may name exactly what
|
|
26
|
+
* moved or nothing at all, and a list a build cannot read falls back to the
|
|
27
|
+
* empty list — which reads as "the whole resource kind moved". The failure mode
|
|
28
|
+
* of a malformed notice should be a broader refresh, never a missed one.
|
|
29
|
+
*
|
|
30
|
+
* camelCase and self-contained: a receiver reads `resource`/`spaceId`/`ids` and
|
|
31
|
+
* nothing else. The snake_case fields that ride alongside on the wire belong to
|
|
32
|
+
* the rendered notice lanes that share this room.
|
|
33
|
+
*/
|
|
34
|
+
export declare const resourceChangedNoticeSchema: z.ZodObject<{
|
|
35
|
+
kind: z.ZodLiteral<"resource.changed">;
|
|
36
|
+
resource: z.ZodString;
|
|
37
|
+
spaceId: z.ZodString;
|
|
38
|
+
ids: z.ZodCatch<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
39
|
+
}, z.core.$strip>;
|
|
40
|
+
export type ResourceChangedNoticePayload = z.infer<typeof resourceChangedNoticeSchema>;
|
|
41
|
+
/**
|
|
42
|
+
* The publisher's only way to shape a notice.
|
|
43
|
+
*
|
|
44
|
+
* Omitting `ids` (or passing an empty list) sends no `ids` field at all — JSON
|
|
45
|
+
* has no undefined — which is the "this whole resource moved" signal: always
|
|
46
|
+
* correct, just less targeted.
|
|
47
|
+
*/
|
|
48
|
+
export declare function resourceChangedNotice(input: {
|
|
49
|
+
resource: string;
|
|
50
|
+
spaceId: string;
|
|
51
|
+
ids?: readonly string[] | undefined;
|
|
52
|
+
}): ResourceChangedNoticePayload;
|