@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,192 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const frameTargetV1Schema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
3
|
+
kind: z.ZodLiteral<"live">;
|
|
4
|
+
versionId: z.ZodTemplateLiteral<`ver_${string}`>;
|
|
5
|
+
routeRevision: z.core.$ZodBranded<z.ZodString, "ContentProgramSha256", "out">;
|
|
6
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
7
|
+
kind: z.ZodLiteral<"version">;
|
|
8
|
+
versionId: z.ZodTemplateLiteral<`ver_${string}`>;
|
|
9
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
10
|
+
kind: z.ZodLiteral<"branch">;
|
|
11
|
+
branch: z.ZodString;
|
|
12
|
+
versionId: z.ZodTemplateLiteral<`ver_${string}`>;
|
|
13
|
+
branchRevision: z.core.$ZodBranded<z.ZodString, "ContentProgramSha256", "out">;
|
|
14
|
+
}, z.core.$strict>], "kind">;
|
|
15
|
+
export type FrameTargetV1 = z.infer<typeof frameTargetV1Schema>;
|
|
16
|
+
export declare const framePrincipalV1Schema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
17
|
+
kind: z.ZodLiteral<"anonymous">;
|
|
18
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
19
|
+
kind: z.ZodLiteral<"user">;
|
|
20
|
+
id: z.ZodString;
|
|
21
|
+
assertionNonce: z.ZodString;
|
|
22
|
+
}, z.core.$strict>], "kind">;
|
|
23
|
+
export type FramePrincipalV1 = z.infer<typeof framePrincipalV1Schema>;
|
|
24
|
+
export declare const frameAudienceV1Schema: z.ZodObject<{
|
|
25
|
+
spaceId: z.ZodTemplateLiteral<`spc_${string}`>;
|
|
26
|
+
runtimeInstanceId: z.ZodString;
|
|
27
|
+
host: z.core.$ZodBranded<z.ZodString, "ExactOrigin", "out">;
|
|
28
|
+
}, z.core.$strict>;
|
|
29
|
+
export type FrameAudienceV1 = z.infer<typeof frameAudienceV1Schema>;
|
|
30
|
+
export declare const frameLinkRevisionV1Schema: z.ZodObject<{
|
|
31
|
+
id: z.ZodTemplateLiteral<`lnk_${string}`>;
|
|
32
|
+
revision: z.ZodNumber;
|
|
33
|
+
}, z.core.$strict>;
|
|
34
|
+
export type FrameLinkRevisionV1 = z.infer<typeof frameLinkRevisionV1Schema>;
|
|
35
|
+
export declare const frameGrantDecisionV1Schema: z.ZodObject<{
|
|
36
|
+
format: z.ZodLiteral<"spacefast.frame-grant-decision">;
|
|
37
|
+
version: z.ZodLiteral<1>;
|
|
38
|
+
audience: z.ZodObject<{
|
|
39
|
+
spaceId: z.ZodTemplateLiteral<`spc_${string}`>;
|
|
40
|
+
runtimeInstanceId: z.ZodString;
|
|
41
|
+
host: z.core.$ZodBranded<z.ZodString, "ExactOrigin", "out">;
|
|
42
|
+
}, z.core.$strict>;
|
|
43
|
+
link: z.ZodObject<{
|
|
44
|
+
id: z.ZodTemplateLiteral<`lnk_${string}`>;
|
|
45
|
+
revision: z.ZodNumber;
|
|
46
|
+
}, z.core.$strict>;
|
|
47
|
+
principal: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
48
|
+
kind: z.ZodLiteral<"anonymous">;
|
|
49
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
50
|
+
kind: z.ZodLiteral<"user">;
|
|
51
|
+
id: z.ZodString;
|
|
52
|
+
assertionNonce: z.ZodString;
|
|
53
|
+
}, z.core.$strict>], "kind">;
|
|
54
|
+
target: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
55
|
+
kind: z.ZodLiteral<"live">;
|
|
56
|
+
versionId: z.ZodTemplateLiteral<`ver_${string}`>;
|
|
57
|
+
routeRevision: z.core.$ZodBranded<z.ZodString, "ContentProgramSha256", "out">;
|
|
58
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
59
|
+
kind: z.ZodLiteral<"version">;
|
|
60
|
+
versionId: z.ZodTemplateLiteral<`ver_${string}`>;
|
|
61
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
62
|
+
kind: z.ZodLiteral<"branch">;
|
|
63
|
+
branch: z.ZodString;
|
|
64
|
+
versionId: z.ZodTemplateLiteral<`ver_${string}`>;
|
|
65
|
+
branchRevision: z.core.$ZodBranded<z.ZodString, "ContentProgramSha256", "out">;
|
|
66
|
+
}, z.core.$strict>], "kind">;
|
|
67
|
+
surface: z.ZodEnum<{
|
|
68
|
+
"wordpress.editor": "wordpress.editor";
|
|
69
|
+
"wordpress.preview": "wordpress.preview";
|
|
70
|
+
}>;
|
|
71
|
+
parentOrigin: z.core.$ZodBranded<z.ZodString, "ExactOrigin", "out">;
|
|
72
|
+
capabilities: z.ZodArray<z.ZodEnum<{
|
|
73
|
+
"page.view": "page.view";
|
|
74
|
+
"comments.read": "comments.read";
|
|
75
|
+
"comments.write": "comments.write";
|
|
76
|
+
"content.publish": "content.publish";
|
|
77
|
+
"access.manage": "access.manage";
|
|
78
|
+
}>>;
|
|
79
|
+
accessGeneration: z.ZodNumber;
|
|
80
|
+
sessionVersion: z.ZodNumber;
|
|
81
|
+
}, z.core.$strict>;
|
|
82
|
+
export type FrameGrantDecisionV1 = z.infer<typeof frameGrantDecisionV1Schema>;
|
|
83
|
+
export declare const frameLaunchTicketClaimsV1Schema: z.ZodObject<{
|
|
84
|
+
format: z.ZodLiteral<"spacefast.frame-launch-ticket">;
|
|
85
|
+
version: z.ZodLiteral<1>;
|
|
86
|
+
ticketId: z.ZodString;
|
|
87
|
+
flow: z.ZodEnum<{
|
|
88
|
+
launch: "launch";
|
|
89
|
+
renewal: "renewal";
|
|
90
|
+
}>;
|
|
91
|
+
maxUses: z.ZodLiteral<1>;
|
|
92
|
+
audience: z.ZodObject<{
|
|
93
|
+
spaceId: z.ZodTemplateLiteral<`spc_${string}`>;
|
|
94
|
+
runtimeInstanceId: z.ZodString;
|
|
95
|
+
host: z.core.$ZodBranded<z.ZodString, "ExactOrigin", "out">;
|
|
96
|
+
}, z.core.$strict>;
|
|
97
|
+
link: z.ZodObject<{
|
|
98
|
+
id: z.ZodTemplateLiteral<`lnk_${string}`>;
|
|
99
|
+
revision: z.ZodNumber;
|
|
100
|
+
}, z.core.$strict>;
|
|
101
|
+
principal: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
102
|
+
kind: z.ZodLiteral<"anonymous">;
|
|
103
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
104
|
+
kind: z.ZodLiteral<"user">;
|
|
105
|
+
id: z.ZodString;
|
|
106
|
+
assertionNonce: z.ZodString;
|
|
107
|
+
}, z.core.$strict>], "kind">;
|
|
108
|
+
target: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
109
|
+
kind: z.ZodLiteral<"live">;
|
|
110
|
+
versionId: z.ZodTemplateLiteral<`ver_${string}`>;
|
|
111
|
+
routeRevision: z.core.$ZodBranded<z.ZodString, "ContentProgramSha256", "out">;
|
|
112
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
113
|
+
kind: z.ZodLiteral<"version">;
|
|
114
|
+
versionId: z.ZodTemplateLiteral<`ver_${string}`>;
|
|
115
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
116
|
+
kind: z.ZodLiteral<"branch">;
|
|
117
|
+
branch: z.ZodString;
|
|
118
|
+
versionId: z.ZodTemplateLiteral<`ver_${string}`>;
|
|
119
|
+
branchRevision: z.core.$ZodBranded<z.ZodString, "ContentProgramSha256", "out">;
|
|
120
|
+
}, z.core.$strict>], "kind">;
|
|
121
|
+
surface: z.ZodEnum<{
|
|
122
|
+
"wordpress.editor": "wordpress.editor";
|
|
123
|
+
"wordpress.preview": "wordpress.preview";
|
|
124
|
+
}>;
|
|
125
|
+
parentOrigin: z.core.$ZodBranded<z.ZodString, "ExactOrigin", "out">;
|
|
126
|
+
capabilities: z.ZodArray<z.ZodEnum<{
|
|
127
|
+
"page.view": "page.view";
|
|
128
|
+
"comments.read": "comments.read";
|
|
129
|
+
"comments.write": "comments.write";
|
|
130
|
+
"content.publish": "content.publish";
|
|
131
|
+
"access.manage": "access.manage";
|
|
132
|
+
}>>;
|
|
133
|
+
grantDecisionDigest: z.core.$ZodBranded<z.ZodString, "ContentProgramSha256", "out">;
|
|
134
|
+
accessGeneration: z.ZodNumber;
|
|
135
|
+
sessionVersion: z.ZodNumber;
|
|
136
|
+
issuedAt: z.ZodNumber;
|
|
137
|
+
expiresAt: z.ZodNumber;
|
|
138
|
+
}, z.core.$strict>;
|
|
139
|
+
export type FrameLaunchTicketClaimsV1 = z.infer<typeof frameLaunchTicketClaimsV1Schema>;
|
|
140
|
+
export declare const frameSessionClaimsV1Schema: z.ZodObject<{
|
|
141
|
+
format: z.ZodLiteral<"spacefast.frame-session">;
|
|
142
|
+
version: z.ZodLiteral<1>;
|
|
143
|
+
launchTicketId: z.ZodString;
|
|
144
|
+
audience: z.ZodObject<{
|
|
145
|
+
spaceId: z.ZodTemplateLiteral<`spc_${string}`>;
|
|
146
|
+
runtimeInstanceId: z.ZodString;
|
|
147
|
+
host: z.core.$ZodBranded<z.ZodString, "ExactOrigin", "out">;
|
|
148
|
+
}, z.core.$strict>;
|
|
149
|
+
link: z.ZodObject<{
|
|
150
|
+
id: z.ZodTemplateLiteral<`lnk_${string}`>;
|
|
151
|
+
revision: z.ZodNumber;
|
|
152
|
+
}, z.core.$strict>;
|
|
153
|
+
principal: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
154
|
+
kind: z.ZodLiteral<"anonymous">;
|
|
155
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
156
|
+
kind: z.ZodLiteral<"user">;
|
|
157
|
+
id: z.ZodString;
|
|
158
|
+
assertionNonce: z.ZodString;
|
|
159
|
+
}, z.core.$strict>], "kind">;
|
|
160
|
+
target: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
161
|
+
kind: z.ZodLiteral<"live">;
|
|
162
|
+
versionId: z.ZodTemplateLiteral<`ver_${string}`>;
|
|
163
|
+
routeRevision: z.core.$ZodBranded<z.ZodString, "ContentProgramSha256", "out">;
|
|
164
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
165
|
+
kind: z.ZodLiteral<"version">;
|
|
166
|
+
versionId: z.ZodTemplateLiteral<`ver_${string}`>;
|
|
167
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
168
|
+
kind: z.ZodLiteral<"branch">;
|
|
169
|
+
branch: z.ZodString;
|
|
170
|
+
versionId: z.ZodTemplateLiteral<`ver_${string}`>;
|
|
171
|
+
branchRevision: z.core.$ZodBranded<z.ZodString, "ContentProgramSha256", "out">;
|
|
172
|
+
}, z.core.$strict>], "kind">;
|
|
173
|
+
surface: z.ZodEnum<{
|
|
174
|
+
"wordpress.editor": "wordpress.editor";
|
|
175
|
+
"wordpress.preview": "wordpress.preview";
|
|
176
|
+
}>;
|
|
177
|
+
parentOrigin: z.core.$ZodBranded<z.ZodString, "ExactOrigin", "out">;
|
|
178
|
+
capabilities: z.ZodArray<z.ZodEnum<{
|
|
179
|
+
"page.view": "page.view";
|
|
180
|
+
"comments.read": "comments.read";
|
|
181
|
+
"comments.write": "comments.write";
|
|
182
|
+
"content.publish": "content.publish";
|
|
183
|
+
"access.manage": "access.manage";
|
|
184
|
+
}>>;
|
|
185
|
+
grantDecisionDigest: z.core.$ZodBranded<z.ZodString, "ContentProgramSha256", "out">;
|
|
186
|
+
accessGeneration: z.ZodNumber;
|
|
187
|
+
sessionVersion: z.ZodNumber;
|
|
188
|
+
nonce: z.ZodString;
|
|
189
|
+
issuedAt: z.ZodNumber;
|
|
190
|
+
expiresAt: z.ZodNumber;
|
|
191
|
+
}, z.core.$strict>;
|
|
192
|
+
export type FrameSessionClaimsV1 = z.infer<typeof frameSessionClaimsV1Schema>;
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { contentProgramSha256Schema } from "./content-program.js";
|
|
3
|
+
import { grantCapabilitySchema } from "./grants.js";
|
|
4
|
+
import { registeredIdSchema } from "./ids.js";
|
|
5
|
+
import { exactOriginSchema } from "./principal-assertion.js";
|
|
6
|
+
export const frameTargetV1Schema = z.discriminatedUnion("kind", [
|
|
7
|
+
z
|
|
8
|
+
.object({
|
|
9
|
+
kind: z.literal("live"),
|
|
10
|
+
versionId: registeredIdSchema("ver"),
|
|
11
|
+
routeRevision: contentProgramSha256Schema,
|
|
12
|
+
})
|
|
13
|
+
.strict(),
|
|
14
|
+
z.object({ kind: z.literal("version"), versionId: registeredIdSchema("ver") }).strict(),
|
|
15
|
+
z
|
|
16
|
+
.object({
|
|
17
|
+
kind: z.literal("branch"),
|
|
18
|
+
branch: z.string().min(1).max(255),
|
|
19
|
+
versionId: registeredIdSchema("ver"),
|
|
20
|
+
branchRevision: contentProgramSha256Schema,
|
|
21
|
+
})
|
|
22
|
+
.strict(),
|
|
23
|
+
]);
|
|
24
|
+
export const framePrincipalV1Schema = z.discriminatedUnion("kind", [
|
|
25
|
+
z.object({ kind: z.literal("anonymous") }).strict(),
|
|
26
|
+
z
|
|
27
|
+
.object({
|
|
28
|
+
kind: z.literal("user"),
|
|
29
|
+
id: z.string().min(1).max(255),
|
|
30
|
+
assertionNonce: z.string().min(16).max(512),
|
|
31
|
+
})
|
|
32
|
+
.strict(),
|
|
33
|
+
]);
|
|
34
|
+
export const frameAudienceV1Schema = z
|
|
35
|
+
.object({
|
|
36
|
+
spaceId: registeredIdSchema("spc"),
|
|
37
|
+
runtimeInstanceId: z.string().min(1).max(255),
|
|
38
|
+
host: exactOriginSchema,
|
|
39
|
+
})
|
|
40
|
+
.strict();
|
|
41
|
+
// A Link's public revision is the positive integer generation on its owned
|
|
42
|
+
// Grant. Editing or revoking the Link increments that generation. Frame tokens
|
|
43
|
+
// bind the number directly so the runtime can compare it with the current
|
|
44
|
+
// projection without translating a second revision scheme.
|
|
45
|
+
export const frameLinkRevisionV1Schema = z
|
|
46
|
+
.object({
|
|
47
|
+
id: registeredIdSchema("lnk"),
|
|
48
|
+
revision: z.number().int().positive(),
|
|
49
|
+
})
|
|
50
|
+
.strict();
|
|
51
|
+
function validateFrameAuthority(claims, context, subject) {
|
|
52
|
+
if (!claims.capabilities.includes("page.view")) {
|
|
53
|
+
context.addIssue({
|
|
54
|
+
code: "custom",
|
|
55
|
+
path: ["capabilities"],
|
|
56
|
+
message: `${subject} require page.view`,
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
if (new Set(claims.capabilities).size !== claims.capabilities.length) {
|
|
60
|
+
context.addIssue({
|
|
61
|
+
code: "custom",
|
|
62
|
+
path: ["capabilities"],
|
|
63
|
+
message: "capabilities must be unique",
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
if (claims.surface === "wordpress.editor" && claims.principal.kind === "anonymous") {
|
|
67
|
+
context.addIssue({
|
|
68
|
+
code: "custom",
|
|
69
|
+
path: ["principal"],
|
|
70
|
+
message: "WordPress editor Frames require a durable principal",
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
if (claims.surface === "wordpress.editor" && !claims.capabilities.includes("content.publish")) {
|
|
74
|
+
context.addIssue({
|
|
75
|
+
code: "custom",
|
|
76
|
+
path: ["capabilities"],
|
|
77
|
+
message: "WordPress editor Frames require content.publish",
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
export const frameGrantDecisionV1Schema = z
|
|
82
|
+
.object({
|
|
83
|
+
format: z.literal("spacefast.frame-grant-decision"),
|
|
84
|
+
version: z.literal(1),
|
|
85
|
+
audience: frameAudienceV1Schema,
|
|
86
|
+
link: frameLinkRevisionV1Schema,
|
|
87
|
+
principal: framePrincipalV1Schema,
|
|
88
|
+
target: frameTargetV1Schema,
|
|
89
|
+
surface: z.enum(["wordpress.editor", "wordpress.preview"]),
|
|
90
|
+
parentOrigin: exactOriginSchema,
|
|
91
|
+
capabilities: z.array(grantCapabilitySchema).min(1).max(5),
|
|
92
|
+
accessGeneration: z.number().int().nonnegative(),
|
|
93
|
+
sessionVersion: z.number().int().nonnegative(),
|
|
94
|
+
})
|
|
95
|
+
.strict()
|
|
96
|
+
.superRefine((decision, context) => validateFrameAuthority(decision, context, "Frame Grant decisions"));
|
|
97
|
+
export const frameLaunchTicketClaimsV1Schema = z
|
|
98
|
+
.object({
|
|
99
|
+
format: z.literal("spacefast.frame-launch-ticket"),
|
|
100
|
+
version: z.literal(1),
|
|
101
|
+
ticketId: z.string().min(16).max(512),
|
|
102
|
+
flow: z.enum(["launch", "renewal"]),
|
|
103
|
+
maxUses: z.literal(1),
|
|
104
|
+
audience: frameAudienceV1Schema,
|
|
105
|
+
link: frameLinkRevisionV1Schema,
|
|
106
|
+
principal: framePrincipalV1Schema,
|
|
107
|
+
target: frameTargetV1Schema,
|
|
108
|
+
surface: z.enum(["wordpress.editor", "wordpress.preview"]),
|
|
109
|
+
parentOrigin: exactOriginSchema,
|
|
110
|
+
capabilities: z.array(grantCapabilitySchema).min(1).max(5),
|
|
111
|
+
grantDecisionDigest: contentProgramSha256Schema,
|
|
112
|
+
accessGeneration: z.number().int().nonnegative(),
|
|
113
|
+
sessionVersion: z.number().int().nonnegative(),
|
|
114
|
+
issuedAt: z.number().int().nonnegative(),
|
|
115
|
+
expiresAt: z.number().int().positive(),
|
|
116
|
+
})
|
|
117
|
+
.strict()
|
|
118
|
+
.superRefine((ticket, context) => {
|
|
119
|
+
if (ticket.expiresAt <= ticket.issuedAt || ticket.expiresAt - ticket.issuedAt > 60) {
|
|
120
|
+
context.addIssue({
|
|
121
|
+
code: "custom",
|
|
122
|
+
path: ["expiresAt"],
|
|
123
|
+
message: "a Frame launch ticket must expire within 60 seconds",
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
validateFrameAuthority(ticket, context, "Frame launch tickets");
|
|
127
|
+
});
|
|
128
|
+
export const frameSessionClaimsV1Schema = z
|
|
129
|
+
.object({
|
|
130
|
+
format: z.literal("spacefast.frame-session"),
|
|
131
|
+
version: z.literal(1),
|
|
132
|
+
launchTicketId: z.string().min(16).max(512),
|
|
133
|
+
audience: frameAudienceV1Schema,
|
|
134
|
+
link: frameLinkRevisionV1Schema,
|
|
135
|
+
principal: framePrincipalV1Schema,
|
|
136
|
+
target: frameTargetV1Schema,
|
|
137
|
+
surface: z.enum(["wordpress.editor", "wordpress.preview"]),
|
|
138
|
+
parentOrigin: exactOriginSchema,
|
|
139
|
+
capabilities: z.array(grantCapabilitySchema).min(1).max(5),
|
|
140
|
+
grantDecisionDigest: contentProgramSha256Schema,
|
|
141
|
+
accessGeneration: z.number().int().nonnegative(),
|
|
142
|
+
sessionVersion: z.number().int().nonnegative(),
|
|
143
|
+
nonce: z.string().min(16).max(512),
|
|
144
|
+
issuedAt: z.number().int().nonnegative(),
|
|
145
|
+
expiresAt: z.number().int().positive(),
|
|
146
|
+
})
|
|
147
|
+
.strict()
|
|
148
|
+
.superRefine((claims, context) => {
|
|
149
|
+
if (claims.expiresAt <= claims.issuedAt) {
|
|
150
|
+
context.addIssue({
|
|
151
|
+
code: "custom",
|
|
152
|
+
path: ["expiresAt"],
|
|
153
|
+
message: "expiresAt must be after issuedAt",
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
if (claims.expiresAt - claims.issuedAt > 15 * 60) {
|
|
157
|
+
context.addIssue({
|
|
158
|
+
code: "custom",
|
|
159
|
+
path: ["expiresAt"],
|
|
160
|
+
message: "Frame sessions cannot live longer than 15 minutes",
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
validateFrameAuthority(claims, context, "Frame sessions");
|
|
164
|
+
});
|