@spacefast/common 0.0.24 → 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/brand-assets/LICENSE-Haskoy.txt +93 -0
- package/brand-assets/haskoy-latin-variable.woff2 +0 -0
- package/brand-assets/spacefast-favicon.svg +4 -4
- package/brand-assets/spacefast-sf-full-bleed.svg +3 -3
- package/brand-assets/spacefast-wordmark.svg +2 -4
- 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 -2
- package/dist/agents/private-key-oauth.js +166 -92
- 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 +3 -6
- package/dist/brand-assets.d.ts +5 -15
- package/dist/brand-assets.js +12 -14
- package/dist/brand.d.ts +17 -0
- package/dist/brand.js +24 -4
- package/dist/config/domains.d.ts +79 -12
- package/dist/config/domains.js +128 -29
- 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 +24 -30
- package/dist/contracts/access.js +33 -64
- package/dist/contracts/activity.d.ts +18 -1
- package/dist/contracts/activity.js +72 -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.d.ts +2 -1
- package/dist/contracts/billing.js +37 -11
- package/dist/contracts/bootstrap.d.ts +791 -0
- package/dist/contracts/bootstrap.js +51 -0
- package/dist/contracts/builds.d.ts +209 -18
- package/dist/contracts/builds.js +93 -27
- 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 +44 -34
- 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 +20 -31
- 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 +52 -0
- package/dist/contracts/crons.js +60 -0
- 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 +1 -5
- package/dist/contracts/docs.js +7 -15
- package/dist/contracts/domains.d.ts +501 -93
- package/dist/contracts/domains.js +193 -55
- package/dist/contracts/email-preferences.d.ts +3 -3
- package/dist/contracts/email-preferences.js +6 -7
- package/dist/contracts/enums.d.ts +27 -26
- package/dist/contracts/enums.js +68 -61
- package/dist/contracts/error-code-meta.d.ts +283 -7
- package/dist/contracts/error-code-meta.js +97 -5
- package/dist/contracts/error-codes.d.ts +5 -5
- package/dist/contracts/error-codes.js +82 -17
- package/dist/contracts/events.d.ts +100 -20
- package/dist/contracts/events.js +107 -20
- package/dist/contracts/execution.d.ts +48 -64
- package/dist/contracts/execution.js +52 -62
- package/dist/contracts/feature-lifecycle.d.ts +73 -27
- package/dist/contracts/feature-lifecycle.js +86 -26
- package/dist/contracts/features.d.ts +68 -19
- package/dist/contracts/features.js +42 -41
- 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 +338 -164
- package/dist/contracts/functions.js +367 -198
- package/dist/contracts/git.d.ts +27 -33
- package/dist/contracts/git.js +10 -11
- package/dist/contracts/grant-copy.d.ts +43 -0
- package/dist/contracts/grant-copy.js +44 -0
- package/dist/contracts/grants.d.ts +62 -54
- package/dist/contracts/grants.js +124 -23
- package/dist/contracts/ids.d.ts +4 -1
- package/dist/contracts/ids.js +6 -3
- package/dist/contracts/internal.d.ts +8 -18
- package/dist/contracts/internal.js +13 -14
- package/dist/contracts/mcp.d.ts +28 -0
- package/dist/contracts/mcp.js +28 -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 +12 -6
- package/dist/contracts/pages.d.ts +31 -7
- 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.js +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 +269 -161
- package/dist/contracts/publish-archive.js +11 -1
- package/dist/contracts/push-new.d.ts +8 -8
- package/dist/contracts/quotas.js +5 -5
- package/dist/contracts/realtime.d.ts +52 -0
- package/dist/contracts/realtime.js +54 -0
- package/dist/contracts/repository-connections.d.ts +44 -31
- package/dist/contracts/repository-connections.js +17 -5
- package/dist/contracts/resources.d.ts +105 -14
- package/dist/contracts/resources.js +150 -26
- package/dist/contracts/route-inventory.d.ts +358 -0
- package/dist/contracts/route-inventory.js +141 -0
- package/dist/contracts/runtime-api.d.ts +206 -82
- package/dist/contracts/runtime-api.js +131 -70
- package/dist/contracts/runtime-app.d.ts +13 -23
- 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 +49 -23
- package/dist/contracts/runtime-db.js +87 -22
- package/dist/contracts/runtime-purge.d.ts +8 -0
- package/dist/contracts/runtime-purge.js +5 -0
- package/dist/contracts/runtime-services.d.ts +43 -75
- package/dist/contracts/runtime-services.js +29 -49
- package/dist/contracts/runtime-storage.d.ts +15 -14
- package/dist/contracts/runtime-storage.js +30 -14
- package/dist/contracts/sf-config-v1.d.ts +48 -14
- package/dist/contracts/slugs.js +13 -4
- package/dist/contracts/space-config.d.ts +283 -19
- package/dist/contracts/space-config.js +430 -80
- package/dist/contracts/spaces.d.ts +376 -290
- package/dist/contracts/spaces.js +200 -135
- 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 +438 -189
- package/dist/contracts/superadmin-spaces.js +131 -25
- package/dist/contracts/superadmin-teams.d.ts +5 -2
- package/dist/contracts/superadmin-teams.js +1 -2
- package/dist/contracts/superadmin-tenants.d.ts +627 -12
- package/dist/contracts/superadmin-tenants.js +32 -13
- package/dist/contracts/superadmin.d.ts +232 -37
- package/dist/contracts/superadmin.js +106 -22
- package/dist/contracts/tags.d.ts +85 -58
- package/dist/contracts/tags.js +47 -37
- package/dist/contracts/teams.d.ts +86 -26
- package/dist/contracts/teams.js +90 -31
- 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 +3 -2
- 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 +72 -81
- package/dist/contracts/zero.js +80 -78
- 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 +12 -18
- package/dist/docs/agent-prose.js +73 -51
- package/dist/docs/agent-setup.d.ts +72 -41
- package/dist/docs/agent-setup.js +339 -436
- package/dist/docs/catalog.d.ts +153 -95
- package/dist/docs/catalog.js +163 -48
- package/dist/docs/error-docs.d.ts +2098 -1
- package/dist/docs/error-docs.js +421 -144
- 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 +120 -120
- package/dist/docs/skills.js +121 -73
- 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/test-helpers/fetch-stub.js +1 -0
- package/dist/utils/browser-credential.d.ts +13 -6
- package/dist/utils/browser-credential.js +14 -7
- package/dist/utils/build-settings.d.ts +21 -1
- package/dist/utils/build-settings.js +133 -15
- package/dist/utils/canonical-json.d.ts +3 -5
- package/dist/utils/canonical-json.js +4 -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 +3 -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 +126 -59
- package/dist/utils/dns-instructions.js +9 -9
- package/dist/utils/egress-policy.fixtures.json +1 -1
- package/dist/utils/error-code.js +1 -0
- package/dist/utils/generate-space-name.d.ts +3 -8
- package/dist/utils/generate-space-name.js +3 -8
- package/dist/utils/grant-decision.fixtures.json +2 -2
- package/dist/utils/grants.d.ts +0 -1
- package/dist/utils/grants.js +7 -8
- 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 +23 -26
- package/dist/utils/local-space-state.js +46 -46
- 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 +7 -6
- package/dist/utils/one-shot-replay.js +3 -5
- package/dist/utils/page-colors.d.ts +15 -19
- package/dist/utils/page-colors.js +23 -45
- package/dist/utils/page-fonts.d.ts +1 -1
- package/dist/utils/page-fonts.js +8 -20
- package/dist/utils/page-preview.d.ts +0 -1
- package/dist/utils/page-preview.js +0 -1
- package/dist/utils/pages.d.ts +33 -3
- package/dist/utils/pages.js +83 -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 +11 -17
- package/dist/utils/publish-policy.fixtures.json +11 -5
- package/dist/utils/publish-policy.js +65 -110
- 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 +9 -0
- package/dist/utils/runtime-upload.js +12 -0
- package/dist/utils/secure-local-file.d.ts +3 -3
- package/dist/utils/secure-local-file.js +23 -40
- package/dist/utils/space-config.d.ts +12 -15
- package/dist/utils/space-config.js +13 -16
- package/dist/utils/static-runtime-policy.d.ts +10 -7
- package/dist/utils/static-runtime-policy.fixtures.json +38 -41
- 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 +31 -132
- package/dist/utils/storage-policy.js +1 -2
- package/dist/utils/upload-session.d.ts +4 -1
- package/dist/utils/upload-session.js +41 -19
- 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 +13 -13
- package/dist/vocabulary.js +52 -27
- package/package.json +15 -18
- 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,216 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const APPLICATION_JOURNAL_MAX_DELIVERY_ATTEMPTS = 12;
|
|
3
|
+
export declare const applicationJournalEntryIdSchema: z.core.$ZodBranded<z.ZodString, "ApplicationJournalEntryId", "out">;
|
|
4
|
+
export type ApplicationJournalEntryId = z.infer<typeof applicationJournalEntryIdSchema>;
|
|
5
|
+
export declare const applicationJournalEntryV1Schema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
6
|
+
kind: z.ZodLiteral<"application-event">;
|
|
7
|
+
payload: z.ZodObject<{
|
|
8
|
+
name: z.ZodString;
|
|
9
|
+
body: z.ZodJSONSchema;
|
|
10
|
+
}, z.core.$strict>;
|
|
11
|
+
format: z.ZodLiteral<"spacefast.application-journal">;
|
|
12
|
+
version: z.ZodLiteral<1>;
|
|
13
|
+
id: z.core.$ZodBranded<z.ZodString, "ApplicationJournalEntryId", "out">;
|
|
14
|
+
spaceId: z.ZodTemplateLiteral<`spc_${string}`>;
|
|
15
|
+
operationId: z.ZodTemplateLiteral<`op_${string}`>;
|
|
16
|
+
effectOrdinal: z.ZodNumber;
|
|
17
|
+
store: z.ZodEnum<{
|
|
18
|
+
wordpress: "wordpress";
|
|
19
|
+
lakebed: "lakebed";
|
|
20
|
+
}>;
|
|
21
|
+
payloadDigest: z.core.$ZodBranded<z.ZodString, "ContentProgramSha256", "out">;
|
|
22
|
+
createdAt: z.ZodString;
|
|
23
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
24
|
+
kind: z.ZodLiteral<"mail">;
|
|
25
|
+
payload: z.ZodObject<{
|
|
26
|
+
messageId: z.ZodString;
|
|
27
|
+
from: z.ZodObject<{
|
|
28
|
+
email: z.ZodString;
|
|
29
|
+
name: z.ZodOptional<z.ZodString>;
|
|
30
|
+
}, z.core.$strict>;
|
|
31
|
+
to: z.ZodArray<z.ZodObject<{
|
|
32
|
+
email: z.ZodString;
|
|
33
|
+
name: z.ZodOptional<z.ZodString>;
|
|
34
|
+
}, z.core.$strict>>;
|
|
35
|
+
subject: z.ZodString;
|
|
36
|
+
body: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
37
|
+
kind: z.ZodLiteral<"text">;
|
|
38
|
+
text: z.ZodString;
|
|
39
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
40
|
+
kind: z.ZodLiteral<"html">;
|
|
41
|
+
html: z.ZodString;
|
|
42
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
43
|
+
kind: z.ZodLiteral<"multipart">;
|
|
44
|
+
text: z.ZodString;
|
|
45
|
+
html: z.ZodString;
|
|
46
|
+
}, z.core.$strict>], "kind">;
|
|
47
|
+
replyTo: z.ZodOptional<z.ZodObject<{
|
|
48
|
+
email: z.ZodString;
|
|
49
|
+
name: z.ZodOptional<z.ZodString>;
|
|
50
|
+
}, z.core.$strict>>;
|
|
51
|
+
}, z.core.$strict>;
|
|
52
|
+
format: z.ZodLiteral<"spacefast.application-journal">;
|
|
53
|
+
version: z.ZodLiteral<1>;
|
|
54
|
+
id: z.core.$ZodBranded<z.ZodString, "ApplicationJournalEntryId", "out">;
|
|
55
|
+
spaceId: z.ZodTemplateLiteral<`spc_${string}`>;
|
|
56
|
+
operationId: z.ZodTemplateLiteral<`op_${string}`>;
|
|
57
|
+
effectOrdinal: z.ZodNumber;
|
|
58
|
+
store: z.ZodEnum<{
|
|
59
|
+
wordpress: "wordpress";
|
|
60
|
+
lakebed: "lakebed";
|
|
61
|
+
}>;
|
|
62
|
+
payloadDigest: z.core.$ZodBranded<z.ZodString, "ContentProgramSha256", "out">;
|
|
63
|
+
createdAt: z.ZodString;
|
|
64
|
+
}, z.core.$strict>], "kind">;
|
|
65
|
+
export type ApplicationJournalEntryV1 = z.infer<typeof applicationJournalEntryV1Schema>;
|
|
66
|
+
export declare const applicationJournalDeliveryFenceV1Schema: z.ZodObject<{
|
|
67
|
+
entryId: z.core.$ZodBranded<z.ZodString, "ApplicationJournalEntryId", "out">;
|
|
68
|
+
sink: z.ZodString;
|
|
69
|
+
attempt: z.ZodNumber;
|
|
70
|
+
leaseId: z.ZodString;
|
|
71
|
+
leaseExpiresAt: z.ZodString;
|
|
72
|
+
}, z.core.$strict>;
|
|
73
|
+
export type ApplicationJournalDeliveryFenceV1 = z.infer<typeof applicationJournalDeliveryFenceV1Schema>;
|
|
74
|
+
export declare const applicationJournalDeliveryReceiptV1Schema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
75
|
+
status: z.ZodLiteral<"delivered">;
|
|
76
|
+
downstreamReceipt: z.ZodString;
|
|
77
|
+
format: z.ZodLiteral<"spacefast.application-delivery">;
|
|
78
|
+
version: z.ZodLiteral<1>;
|
|
79
|
+
fence: z.ZodObject<{
|
|
80
|
+
entryId: z.core.$ZodBranded<z.ZodString, "ApplicationJournalEntryId", "out">;
|
|
81
|
+
sink: z.ZodString;
|
|
82
|
+
attempt: z.ZodNumber;
|
|
83
|
+
leaseId: z.ZodString;
|
|
84
|
+
leaseExpiresAt: z.ZodString;
|
|
85
|
+
}, z.core.$strict>;
|
|
86
|
+
idempotencyKey: z.ZodString;
|
|
87
|
+
recordedAt: z.ZodString;
|
|
88
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
89
|
+
status: z.ZodLiteral<"retry">;
|
|
90
|
+
problem: z.ZodObject<{
|
|
91
|
+
code: z.ZodString;
|
|
92
|
+
detail: z.ZodString;
|
|
93
|
+
retryable: z.ZodLiteral<true>;
|
|
94
|
+
}, z.core.$strict>;
|
|
95
|
+
retryAt: z.ZodString;
|
|
96
|
+
format: z.ZodLiteral<"spacefast.application-delivery">;
|
|
97
|
+
version: z.ZodLiteral<1>;
|
|
98
|
+
fence: z.ZodObject<{
|
|
99
|
+
entryId: z.core.$ZodBranded<z.ZodString, "ApplicationJournalEntryId", "out">;
|
|
100
|
+
sink: z.ZodString;
|
|
101
|
+
attempt: z.ZodNumber;
|
|
102
|
+
leaseId: z.ZodString;
|
|
103
|
+
leaseExpiresAt: z.ZodString;
|
|
104
|
+
}, z.core.$strict>;
|
|
105
|
+
idempotencyKey: z.ZodString;
|
|
106
|
+
recordedAt: z.ZodString;
|
|
107
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
108
|
+
status: z.ZodLiteral<"dead-letter">;
|
|
109
|
+
problem: z.ZodObject<{
|
|
110
|
+
code: z.ZodString;
|
|
111
|
+
detail: z.ZodString;
|
|
112
|
+
retryable: z.ZodLiteral<false>;
|
|
113
|
+
}, z.core.$strict>;
|
|
114
|
+
format: z.ZodLiteral<"spacefast.application-delivery">;
|
|
115
|
+
version: z.ZodLiteral<1>;
|
|
116
|
+
fence: z.ZodObject<{
|
|
117
|
+
entryId: z.core.$ZodBranded<z.ZodString, "ApplicationJournalEntryId", "out">;
|
|
118
|
+
sink: z.ZodString;
|
|
119
|
+
attempt: z.ZodNumber;
|
|
120
|
+
leaseId: z.ZodString;
|
|
121
|
+
leaseExpiresAt: z.ZodString;
|
|
122
|
+
}, z.core.$strict>;
|
|
123
|
+
idempotencyKey: z.ZodString;
|
|
124
|
+
recordedAt: z.ZodString;
|
|
125
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
126
|
+
status: z.ZodLiteral<"ambiguous">;
|
|
127
|
+
problem: z.ZodObject<{
|
|
128
|
+
code: z.ZodString;
|
|
129
|
+
detail: z.ZodString;
|
|
130
|
+
retryable: z.ZodLiteral<false>;
|
|
131
|
+
}, z.core.$strict>;
|
|
132
|
+
operatorActionRequired: z.ZodLiteral<true>;
|
|
133
|
+
format: z.ZodLiteral<"spacefast.application-delivery">;
|
|
134
|
+
version: z.ZodLiteral<1>;
|
|
135
|
+
fence: z.ZodObject<{
|
|
136
|
+
entryId: z.core.$ZodBranded<z.ZodString, "ApplicationJournalEntryId", "out">;
|
|
137
|
+
sink: z.ZodString;
|
|
138
|
+
attempt: z.ZodNumber;
|
|
139
|
+
leaseId: z.ZodString;
|
|
140
|
+
leaseExpiresAt: z.ZodString;
|
|
141
|
+
}, z.core.$strict>;
|
|
142
|
+
idempotencyKey: z.ZodString;
|
|
143
|
+
recordedAt: z.ZodString;
|
|
144
|
+
}, z.core.$strict>], "status">;
|
|
145
|
+
export type ApplicationJournalDeliveryReceiptV1 = z.infer<typeof applicationJournalDeliveryReceiptV1Schema>;
|
|
146
|
+
export declare const applicationJournalDeliveryClaimV1Schema: z.ZodObject<{
|
|
147
|
+
entry: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
148
|
+
kind: z.ZodLiteral<"application-event">;
|
|
149
|
+
payload: z.ZodObject<{
|
|
150
|
+
name: z.ZodString;
|
|
151
|
+
body: z.ZodJSONSchema;
|
|
152
|
+
}, z.core.$strict>;
|
|
153
|
+
format: z.ZodLiteral<"spacefast.application-journal">;
|
|
154
|
+
version: z.ZodLiteral<1>;
|
|
155
|
+
id: z.core.$ZodBranded<z.ZodString, "ApplicationJournalEntryId", "out">;
|
|
156
|
+
spaceId: z.ZodTemplateLiteral<`spc_${string}`>;
|
|
157
|
+
operationId: z.ZodTemplateLiteral<`op_${string}`>;
|
|
158
|
+
effectOrdinal: z.ZodNumber;
|
|
159
|
+
store: z.ZodEnum<{
|
|
160
|
+
wordpress: "wordpress";
|
|
161
|
+
lakebed: "lakebed";
|
|
162
|
+
}>;
|
|
163
|
+
payloadDigest: z.core.$ZodBranded<z.ZodString, "ContentProgramSha256", "out">;
|
|
164
|
+
createdAt: z.ZodString;
|
|
165
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
166
|
+
kind: z.ZodLiteral<"mail">;
|
|
167
|
+
payload: z.ZodObject<{
|
|
168
|
+
messageId: z.ZodString;
|
|
169
|
+
from: z.ZodObject<{
|
|
170
|
+
email: z.ZodString;
|
|
171
|
+
name: z.ZodOptional<z.ZodString>;
|
|
172
|
+
}, z.core.$strict>;
|
|
173
|
+
to: z.ZodArray<z.ZodObject<{
|
|
174
|
+
email: z.ZodString;
|
|
175
|
+
name: z.ZodOptional<z.ZodString>;
|
|
176
|
+
}, z.core.$strict>>;
|
|
177
|
+
subject: z.ZodString;
|
|
178
|
+
body: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
179
|
+
kind: z.ZodLiteral<"text">;
|
|
180
|
+
text: z.ZodString;
|
|
181
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
182
|
+
kind: z.ZodLiteral<"html">;
|
|
183
|
+
html: z.ZodString;
|
|
184
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
185
|
+
kind: z.ZodLiteral<"multipart">;
|
|
186
|
+
text: z.ZodString;
|
|
187
|
+
html: z.ZodString;
|
|
188
|
+
}, z.core.$strict>], "kind">;
|
|
189
|
+
replyTo: z.ZodOptional<z.ZodObject<{
|
|
190
|
+
email: z.ZodString;
|
|
191
|
+
name: z.ZodOptional<z.ZodString>;
|
|
192
|
+
}, z.core.$strict>>;
|
|
193
|
+
}, z.core.$strict>;
|
|
194
|
+
format: z.ZodLiteral<"spacefast.application-journal">;
|
|
195
|
+
version: z.ZodLiteral<1>;
|
|
196
|
+
id: z.core.$ZodBranded<z.ZodString, "ApplicationJournalEntryId", "out">;
|
|
197
|
+
spaceId: z.ZodTemplateLiteral<`spc_${string}`>;
|
|
198
|
+
operationId: z.ZodTemplateLiteral<`op_${string}`>;
|
|
199
|
+
effectOrdinal: z.ZodNumber;
|
|
200
|
+
store: z.ZodEnum<{
|
|
201
|
+
wordpress: "wordpress";
|
|
202
|
+
lakebed: "lakebed";
|
|
203
|
+
}>;
|
|
204
|
+
payloadDigest: z.core.$ZodBranded<z.ZodString, "ContentProgramSha256", "out">;
|
|
205
|
+
createdAt: z.ZodString;
|
|
206
|
+
}, z.core.$strict>], "kind">;
|
|
207
|
+
fence: z.ZodObject<{
|
|
208
|
+
entryId: z.core.$ZodBranded<z.ZodString, "ApplicationJournalEntryId", "out">;
|
|
209
|
+
sink: z.ZodString;
|
|
210
|
+
attempt: z.ZodNumber;
|
|
211
|
+
leaseId: z.ZodString;
|
|
212
|
+
leaseExpiresAt: z.ZodString;
|
|
213
|
+
}, z.core.$strict>;
|
|
214
|
+
idempotencyKey: z.ZodString;
|
|
215
|
+
}, z.core.$strict>;
|
|
216
|
+
export type ApplicationJournalDeliveryClaimV1 = z.infer<typeof applicationJournalDeliveryClaimV1Schema>;
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { contentProgramSha256Schema } from "./content-program.js";
|
|
3
|
+
import { registeredIdSchema } from "./ids.js";
|
|
4
|
+
export const APPLICATION_JOURNAL_MAX_DELIVERY_ATTEMPTS = 12;
|
|
5
|
+
export const applicationJournalEntryIdSchema = z
|
|
6
|
+
.string()
|
|
7
|
+
.min(1)
|
|
8
|
+
.max(512)
|
|
9
|
+
.regex(/^spc_[A-Za-z0-9]+:op_[A-Za-z0-9]+:[0-9]+$/)
|
|
10
|
+
.brand();
|
|
11
|
+
const journalEmailAddressSchema = z
|
|
12
|
+
.object({
|
|
13
|
+
email: z.string().email(),
|
|
14
|
+
name: z.string().trim().min(1).max(200).optional(),
|
|
15
|
+
})
|
|
16
|
+
.strict();
|
|
17
|
+
const journalMailBodySchema = z.discriminatedUnion("kind", [
|
|
18
|
+
z.object({ kind: z.literal("text"), text: z.string().max(1_000_000) }).strict(),
|
|
19
|
+
z.object({ kind: z.literal("html"), html: z.string().max(1_000_000) }).strict(),
|
|
20
|
+
z
|
|
21
|
+
.object({
|
|
22
|
+
kind: z.literal("multipart"),
|
|
23
|
+
text: z.string().max(1_000_000),
|
|
24
|
+
html: z.string().max(1_000_000),
|
|
25
|
+
})
|
|
26
|
+
.strict(),
|
|
27
|
+
]);
|
|
28
|
+
const journalEntryFields = {
|
|
29
|
+
format: z.literal("spacefast.application-journal"),
|
|
30
|
+
version: z.literal(1),
|
|
31
|
+
id: applicationJournalEntryIdSchema,
|
|
32
|
+
spaceId: registeredIdSchema("spc"),
|
|
33
|
+
operationId: registeredIdSchema("op"),
|
|
34
|
+
effectOrdinal: z.number().int().nonnegative(),
|
|
35
|
+
store: z.enum(["wordpress", "lakebed"]),
|
|
36
|
+
payloadDigest: contentProgramSha256Schema,
|
|
37
|
+
createdAt: z.string().datetime({ offset: true }),
|
|
38
|
+
};
|
|
39
|
+
export const applicationJournalEntryV1Schema = z
|
|
40
|
+
.discriminatedUnion("kind", [
|
|
41
|
+
z
|
|
42
|
+
.object({
|
|
43
|
+
...journalEntryFields,
|
|
44
|
+
kind: z.literal("application-event"),
|
|
45
|
+
payload: z
|
|
46
|
+
.object({
|
|
47
|
+
name: z.string().min(1).max(255),
|
|
48
|
+
body: z.json(),
|
|
49
|
+
})
|
|
50
|
+
.strict(),
|
|
51
|
+
})
|
|
52
|
+
.strict(),
|
|
53
|
+
z
|
|
54
|
+
.object({
|
|
55
|
+
...journalEntryFields,
|
|
56
|
+
kind: z.literal("mail"),
|
|
57
|
+
payload: z
|
|
58
|
+
.object({
|
|
59
|
+
messageId: z.string().min(1).max(255),
|
|
60
|
+
from: journalEmailAddressSchema,
|
|
61
|
+
to: z.array(journalEmailAddressSchema).min(1).max(100),
|
|
62
|
+
subject: z.string().min(1).max(998),
|
|
63
|
+
body: journalMailBodySchema,
|
|
64
|
+
replyTo: journalEmailAddressSchema.optional(),
|
|
65
|
+
})
|
|
66
|
+
.strict(),
|
|
67
|
+
})
|
|
68
|
+
.strict(),
|
|
69
|
+
])
|
|
70
|
+
.refine((entry) => entry.id === `${entry.spaceId}:${entry.operationId}:${entry.effectOrdinal}`, {
|
|
71
|
+
path: ["id"],
|
|
72
|
+
message: "journal entry id must be the space, operation, and effect ordinal",
|
|
73
|
+
});
|
|
74
|
+
const deliveryProblemSchema = z
|
|
75
|
+
.object({
|
|
76
|
+
code: z.string().min(1).max(160),
|
|
77
|
+
detail: z.string().min(1).max(4_000),
|
|
78
|
+
retryable: z.boolean(),
|
|
79
|
+
})
|
|
80
|
+
.strict();
|
|
81
|
+
export const applicationJournalDeliveryFenceV1Schema = z
|
|
82
|
+
.object({
|
|
83
|
+
entryId: applicationJournalEntryIdSchema,
|
|
84
|
+
sink: z.string().min(1).max(160),
|
|
85
|
+
attempt: z.number().int().positive().max(APPLICATION_JOURNAL_MAX_DELIVERY_ATTEMPTS),
|
|
86
|
+
leaseId: z.string().min(1).max(255),
|
|
87
|
+
leaseExpiresAt: z.string().datetime({ offset: true }),
|
|
88
|
+
})
|
|
89
|
+
.strict();
|
|
90
|
+
const journalDeliveryReceiptFields = {
|
|
91
|
+
format: z.literal("spacefast.application-delivery"),
|
|
92
|
+
version: z.literal(1),
|
|
93
|
+
// Recording completion must atomically compare this entire tuple with the
|
|
94
|
+
// delivery row that granted the claim. Matching only the lease id is unsafe.
|
|
95
|
+
fence: applicationJournalDeliveryFenceV1Schema,
|
|
96
|
+
idempotencyKey: z.string().min(1).max(512),
|
|
97
|
+
recordedAt: z.string().datetime({ offset: true }),
|
|
98
|
+
};
|
|
99
|
+
export const applicationJournalDeliveryReceiptV1Schema = z
|
|
100
|
+
.discriminatedUnion("status", [
|
|
101
|
+
z
|
|
102
|
+
.object({
|
|
103
|
+
...journalDeliveryReceiptFields,
|
|
104
|
+
status: z.literal("delivered"),
|
|
105
|
+
downstreamReceipt: z.string().min(1).max(2_000),
|
|
106
|
+
})
|
|
107
|
+
.strict(),
|
|
108
|
+
z
|
|
109
|
+
.object({
|
|
110
|
+
...journalDeliveryReceiptFields,
|
|
111
|
+
status: z.literal("retry"),
|
|
112
|
+
problem: deliveryProblemSchema.extend({ retryable: z.literal(true) }),
|
|
113
|
+
retryAt: z.string().datetime({ offset: true }),
|
|
114
|
+
})
|
|
115
|
+
.strict(),
|
|
116
|
+
z
|
|
117
|
+
.object({
|
|
118
|
+
...journalDeliveryReceiptFields,
|
|
119
|
+
status: z.literal("dead-letter"),
|
|
120
|
+
problem: deliveryProblemSchema.extend({ retryable: z.literal(false) }),
|
|
121
|
+
})
|
|
122
|
+
.strict(),
|
|
123
|
+
z
|
|
124
|
+
.object({
|
|
125
|
+
...journalDeliveryReceiptFields,
|
|
126
|
+
status: z.literal("ambiguous"),
|
|
127
|
+
problem: deliveryProblemSchema.extend({ retryable: z.literal(false) }),
|
|
128
|
+
operatorActionRequired: z.literal(true),
|
|
129
|
+
})
|
|
130
|
+
.strict(),
|
|
131
|
+
])
|
|
132
|
+
.refine((receipt) => receipt.idempotencyKey === `${receipt.fence.entryId}:${receipt.fence.sink}`, {
|
|
133
|
+
path: ["idempotencyKey"],
|
|
134
|
+
message: "delivery idempotency key must bind the journal entry and sink",
|
|
135
|
+
})
|
|
136
|
+
.refine((receipt) => receipt.status !== "retry" ||
|
|
137
|
+
receipt.fence.attempt < APPLICATION_JOURNAL_MAX_DELIVERY_ATTEMPTS, {
|
|
138
|
+
path: ["status"],
|
|
139
|
+
message: "the final delivery attempt must terminate as dead-letter or ambiguous",
|
|
140
|
+
})
|
|
141
|
+
.refine((receipt) => Date.parse(receipt.recordedAt) <= Date.parse(receipt.fence.leaseExpiresAt), {
|
|
142
|
+
path: ["recordedAt"],
|
|
143
|
+
message: "delivery completion must be recorded before its lease expires",
|
|
144
|
+
});
|
|
145
|
+
export const applicationJournalDeliveryClaimV1Schema = z
|
|
146
|
+
.object({
|
|
147
|
+
entry: applicationJournalEntryV1Schema,
|
|
148
|
+
fence: applicationJournalDeliveryFenceV1Schema,
|
|
149
|
+
idempotencyKey: z.string().min(1).max(512),
|
|
150
|
+
})
|
|
151
|
+
.strict()
|
|
152
|
+
.superRefine((claim, context) => {
|
|
153
|
+
if (claim.fence.entryId !== claim.entry.id) {
|
|
154
|
+
context.addIssue({
|
|
155
|
+
code: "custom",
|
|
156
|
+
path: ["fence", "entryId"],
|
|
157
|
+
message: "delivery fence must bind the claimed journal entry",
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
if (claim.idempotencyKey !== `${claim.entry.id}:${claim.fence.sink}`) {
|
|
161
|
+
context.addIssue({
|
|
162
|
+
code: "custom",
|
|
163
|
+
path: ["idempotencyKey"],
|
|
164
|
+
message: "delivery claim idempotency key must bind the journal entry and sink",
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
});
|
package/dist/contracts/auth.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
1
2
|
export declare const betterAuthAdditionalFields: {
|
|
2
3
|
readonly user: {
|
|
3
4
|
readonly tenantId: {
|
|
@@ -12,18 +13,6 @@ export declare const betterAuthAdditionalFields: {
|
|
|
12
13
|
readonly returned: true;
|
|
13
14
|
readonly input: false;
|
|
14
15
|
};
|
|
15
|
-
readonly username: {
|
|
16
|
-
readonly type: "string";
|
|
17
|
-
readonly required: false;
|
|
18
|
-
readonly returned: true;
|
|
19
|
-
readonly input: false;
|
|
20
|
-
};
|
|
21
|
-
readonly displayUsername: {
|
|
22
|
-
readonly type: "string";
|
|
23
|
-
readonly required: false;
|
|
24
|
-
readonly returned: true;
|
|
25
|
-
readonly input: false;
|
|
26
|
-
};
|
|
27
16
|
readonly isAutomattician: {
|
|
28
17
|
readonly type: "boolean";
|
|
29
18
|
readonly required: false;
|
|
@@ -31,17 +20,17 @@ export declare const betterAuthAdditionalFields: {
|
|
|
31
20
|
readonly returned: true;
|
|
32
21
|
readonly input: false;
|
|
33
22
|
};
|
|
34
|
-
readonly
|
|
35
|
-
readonly type: "
|
|
23
|
+
readonly automatticianCheckedAt: {
|
|
24
|
+
readonly type: "string";
|
|
36
25
|
readonly required: false;
|
|
37
|
-
readonly returned:
|
|
26
|
+
readonly returned: true;
|
|
38
27
|
readonly input: false;
|
|
39
28
|
};
|
|
40
|
-
readonly
|
|
29
|
+
readonly automatticBetaGrant: {
|
|
41
30
|
readonly type: "boolean";
|
|
42
31
|
readonly required: false;
|
|
43
32
|
readonly defaultValue: false;
|
|
44
|
-
readonly returned:
|
|
33
|
+
readonly returned: false;
|
|
45
34
|
readonly input: false;
|
|
46
35
|
};
|
|
47
36
|
readonly betaEnrolledAt: {
|
|
@@ -84,3 +73,87 @@ export type BetterAuthCustomSessionUser = {
|
|
|
84
73
|
wpcomUserId?: string | null;
|
|
85
74
|
isSuperadmin?: boolean;
|
|
86
75
|
};
|
|
76
|
+
/**
|
|
77
|
+
* What this deployment can sign people in with. The sign-in page renders its
|
|
78
|
+
* available controls from this response; the account-specific email lane is a
|
|
79
|
+
* separate Better Auth decision after the person presses Continue. Everything
|
|
80
|
+
* here is public by construction: presence booleans, and client ids and site
|
|
81
|
+
* keys the browser gets by design. No secret ever widens this shape.
|
|
82
|
+
*/
|
|
83
|
+
export declare const authMethodsResponseSchema: z.ZodObject<{
|
|
84
|
+
providers: z.ZodObject<{
|
|
85
|
+
wpcom: z.ZodBoolean;
|
|
86
|
+
google: z.ZodBoolean;
|
|
87
|
+
github: z.ZodBoolean;
|
|
88
|
+
}, z.core.$strip>;
|
|
89
|
+
emailOtp: z.ZodBoolean;
|
|
90
|
+
password: z.ZodBoolean;
|
|
91
|
+
captcha: z.ZodNullable<z.ZodObject<{
|
|
92
|
+
provider: z.ZodLiteral<"turnstile">;
|
|
93
|
+
siteKey: z.ZodString;
|
|
94
|
+
}, z.core.$strip>>;
|
|
95
|
+
googleOneTapClientId: z.ZodNullable<z.ZodString>;
|
|
96
|
+
}, z.core.$strip>;
|
|
97
|
+
export type AuthMethodsResponse = z.infer<typeof authMethodsResponseSchema>;
|
|
98
|
+
/** The email-first sign-in decision made by Better Auth after email entry. */
|
|
99
|
+
export declare const authEmailContinueRequestSchema: z.ZodObject<{
|
|
100
|
+
email: z.ZodString;
|
|
101
|
+
}, z.core.$strip>;
|
|
102
|
+
export declare const authEmailContinueResponseSchema: z.ZodObject<{
|
|
103
|
+
method: z.ZodEnum<{
|
|
104
|
+
password: "password";
|
|
105
|
+
"email-otp": "email-otp";
|
|
106
|
+
}>;
|
|
107
|
+
}, z.core.$strip>;
|
|
108
|
+
export type AuthEmailContinueRequest = z.infer<typeof authEmailContinueRequestSchema>;
|
|
109
|
+
export type AuthEmailContinueResponse = z.infer<typeof authEmailContinueResponseSchema>;
|
|
110
|
+
/** How a verified address earned its place on the account. */
|
|
111
|
+
export declare const AUTH_EMAIL_VERIFICATION_METHODS: readonly ["email_code", "oauth", "admin", "migration"];
|
|
112
|
+
/**
|
|
113
|
+
* One verified address on an account. Unverified addresses are never listed.
|
|
114
|
+
* A pending one is a code challenge, not a row, until its code is entered.
|
|
115
|
+
*/
|
|
116
|
+
export declare const authAccountEmailSchema: z.ZodObject<{
|
|
117
|
+
id: z.ZodString;
|
|
118
|
+
email: z.ZodString;
|
|
119
|
+
isPrimary: z.ZodBoolean;
|
|
120
|
+
verifiedAt: z.ZodString;
|
|
121
|
+
verificationMethod: z.ZodEnum<{
|
|
122
|
+
oauth: "oauth";
|
|
123
|
+
email_code: "email_code";
|
|
124
|
+
admin: "admin";
|
|
125
|
+
migration: "migration";
|
|
126
|
+
}>;
|
|
127
|
+
}, z.core.$strip>;
|
|
128
|
+
export declare const authAccountEmailListResponseSchema: z.ZodObject<{
|
|
129
|
+
emails: z.ZodArray<z.ZodObject<{
|
|
130
|
+
id: z.ZodString;
|
|
131
|
+
email: z.ZodString;
|
|
132
|
+
isPrimary: z.ZodBoolean;
|
|
133
|
+
verifiedAt: z.ZodString;
|
|
134
|
+
verificationMethod: z.ZodEnum<{
|
|
135
|
+
oauth: "oauth";
|
|
136
|
+
email_code: "email_code";
|
|
137
|
+
admin: "admin";
|
|
138
|
+
migration: "migration";
|
|
139
|
+
}>;
|
|
140
|
+
}, z.core.$strip>>;
|
|
141
|
+
}, z.core.$strip>;
|
|
142
|
+
export declare const authAccountEmailAddRequestSchema: z.ZodObject<{
|
|
143
|
+
email: z.ZodString;
|
|
144
|
+
}, z.core.$strip>;
|
|
145
|
+
export declare const authAccountEmailAddResponseSchema: z.ZodObject<{
|
|
146
|
+
email: z.ZodString;
|
|
147
|
+
expiresAt: z.ZodString;
|
|
148
|
+
}, z.core.$strip>;
|
|
149
|
+
export declare const authAccountEmailVerifyRequestSchema: z.ZodObject<{
|
|
150
|
+
email: z.ZodString;
|
|
151
|
+
code: z.ZodString;
|
|
152
|
+
}, z.core.$strip>;
|
|
153
|
+
export declare const authSetPasswordRequestSchema: z.ZodObject<{
|
|
154
|
+
password: z.ZodString;
|
|
155
|
+
}, z.core.$strip>;
|
|
156
|
+
export declare const authSetPasswordResponseSchema: z.ZodObject<{
|
|
157
|
+
passwordSet: z.ZodLiteral<true>;
|
|
158
|
+
}, z.core.$strip>;
|
|
159
|
+
export type AuthAccountEmail = z.infer<typeof authAccountEmailSchema>;
|
package/dist/contracts/auth.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
1
2
|
export const betterAuthAdditionalFields = {
|
|
2
3
|
user: {
|
|
3
4
|
tenantId: {
|
|
@@ -12,18 +13,6 @@ export const betterAuthAdditionalFields = {
|
|
|
12
13
|
returned: true,
|
|
13
14
|
input: false,
|
|
14
15
|
},
|
|
15
|
-
username: {
|
|
16
|
-
type: "string",
|
|
17
|
-
required: false,
|
|
18
|
-
returned: true,
|
|
19
|
-
input: false,
|
|
20
|
-
},
|
|
21
|
-
displayUsername: {
|
|
22
|
-
type: "string",
|
|
23
|
-
required: false,
|
|
24
|
-
returned: true,
|
|
25
|
-
input: false,
|
|
26
|
-
},
|
|
27
16
|
isAutomattician: {
|
|
28
17
|
type: "boolean",
|
|
29
18
|
required: false,
|
|
@@ -31,17 +20,18 @@ export const betterAuthAdditionalFields = {
|
|
|
31
20
|
returned: true,
|
|
32
21
|
input: false,
|
|
33
22
|
},
|
|
34
|
-
|
|
35
|
-
type: "
|
|
23
|
+
automatticianCheckedAt: {
|
|
24
|
+
type: "string",
|
|
36
25
|
required: false,
|
|
37
|
-
returned:
|
|
26
|
+
returned: true,
|
|
38
27
|
input: false,
|
|
39
28
|
},
|
|
40
|
-
|
|
29
|
+
// Automattic-domain beta-admission provenance, never employee identity.
|
|
30
|
+
automatticBetaGrant: {
|
|
41
31
|
type: "boolean",
|
|
42
32
|
required: false,
|
|
43
33
|
defaultValue: false,
|
|
44
|
-
returned:
|
|
34
|
+
returned: false,
|
|
45
35
|
input: false,
|
|
46
36
|
},
|
|
47
37
|
betaEnrolledAt: {
|
|
@@ -66,6 +56,11 @@ export const betterAuthAdditionalFields = {
|
|
|
66
56
|
},
|
|
67
57
|
},
|
|
68
58
|
session: {
|
|
59
|
+
// Deliberate alias, not a second field: the organization plugin's schema
|
|
60
|
+
// remap (`activeOrganizationId` → column `activeTeamId`) owns the WRITE
|
|
61
|
+
// path, while this declaration exposes the same column to clients under
|
|
62
|
+
// the product's "team" naming. One column, two logical names — sessions
|
|
63
|
+
// may carry either spelling depending on which side serialized them.
|
|
69
64
|
activeTeamId: {
|
|
70
65
|
type: "string",
|
|
71
66
|
required: false,
|
|
@@ -80,3 +75,77 @@ export const betterAuthAdditionalFields = {
|
|
|
80
75
|
},
|
|
81
76
|
},
|
|
82
77
|
};
|
|
78
|
+
/**
|
|
79
|
+
* What this deployment can sign people in with. The sign-in page renders its
|
|
80
|
+
* available controls from this response; the account-specific email lane is a
|
|
81
|
+
* separate Better Auth decision after the person presses Continue. Everything
|
|
82
|
+
* here is public by construction: presence booleans, and client ids and site
|
|
83
|
+
* keys the browser gets by design. No secret ever widens this shape.
|
|
84
|
+
*/
|
|
85
|
+
export const authMethodsResponseSchema = z.object({
|
|
86
|
+
providers: z.object({
|
|
87
|
+
wpcom: z.boolean(),
|
|
88
|
+
google: z.boolean(),
|
|
89
|
+
github: z.boolean(),
|
|
90
|
+
}),
|
|
91
|
+
/** Sign in with a mailed one-time code. Off when auth mail has no sender. */
|
|
92
|
+
emailOtp: z.boolean(),
|
|
93
|
+
/** A password may be used to sign in (never to sign up). */
|
|
94
|
+
password: z.boolean(),
|
|
95
|
+
/** Turnstile widget config for the unauthenticated forms, or null when off. */
|
|
96
|
+
captcha: z
|
|
97
|
+
.object({
|
|
98
|
+
provider: z.literal("turnstile"),
|
|
99
|
+
siteKey: z.string(),
|
|
100
|
+
})
|
|
101
|
+
.nullable(),
|
|
102
|
+
/** Google's public client id, needed by the One Tap script. */
|
|
103
|
+
googleOneTapClientId: z.string().nullable(),
|
|
104
|
+
});
|
|
105
|
+
/** The email-first sign-in decision made by Better Auth after email entry. */
|
|
106
|
+
export const authEmailContinueRequestSchema = z.object({
|
|
107
|
+
email: z.string().trim().email(),
|
|
108
|
+
});
|
|
109
|
+
export const authEmailContinueResponseSchema = z.object({
|
|
110
|
+
method: z.enum(["password", "email-otp"]),
|
|
111
|
+
});
|
|
112
|
+
/** How a verified address earned its place on the account. */
|
|
113
|
+
export const AUTH_EMAIL_VERIFICATION_METHODS = [
|
|
114
|
+
"email_code",
|
|
115
|
+
"oauth",
|
|
116
|
+
"admin",
|
|
117
|
+
"migration",
|
|
118
|
+
];
|
|
119
|
+
/**
|
|
120
|
+
* One verified address on an account. Unverified addresses are never listed.
|
|
121
|
+
* A pending one is a code challenge, not a row, until its code is entered.
|
|
122
|
+
*/
|
|
123
|
+
export const authAccountEmailSchema = z.object({
|
|
124
|
+
id: z.string(),
|
|
125
|
+
email: z.string(),
|
|
126
|
+
/** The address the account is addressed by: notices, Gravatar, sign-in mail. */
|
|
127
|
+
isPrimary: z.boolean(),
|
|
128
|
+
verifiedAt: z.string(),
|
|
129
|
+
verificationMethod: z.enum(AUTH_EMAIL_VERIFICATION_METHODS),
|
|
130
|
+
});
|
|
131
|
+
export const authAccountEmailListResponseSchema = z.object({
|
|
132
|
+
emails: z.array(authAccountEmailSchema),
|
|
133
|
+
});
|
|
134
|
+
export const authAccountEmailAddRequestSchema = z.object({
|
|
135
|
+
email: z.string().min(3).max(320),
|
|
136
|
+
});
|
|
137
|
+
export const authAccountEmailAddResponseSchema = z.object({
|
|
138
|
+
/** Where the code went, as typed. */
|
|
139
|
+
email: z.string(),
|
|
140
|
+
expiresAt: z.string(),
|
|
141
|
+
});
|
|
142
|
+
export const authAccountEmailVerifyRequestSchema = z.object({
|
|
143
|
+
email: z.string().min(3).max(320),
|
|
144
|
+
code: z.string().min(1).max(16),
|
|
145
|
+
});
|
|
146
|
+
export const authSetPasswordRequestSchema = z.object({
|
|
147
|
+
password: z.string().min(8).max(128),
|
|
148
|
+
});
|
|
149
|
+
export const authSetPasswordResponseSchema = z.object({
|
|
150
|
+
passwordSet: z.literal(true),
|
|
151
|
+
});
|
package/dist/contracts/beta.d.ts
CHANGED
|
@@ -26,6 +26,13 @@ export declare const betaSignupCreateSchema: z.ZodObject<{
|
|
|
26
26
|
export declare const betaSignupReceiptSchema: z.ZodObject<{
|
|
27
27
|
ok: z.ZodLiteral<true>;
|
|
28
28
|
}, z.core.$strip>;
|
|
29
|
+
export declare const betaVisitorResponseSchema: z.ZodObject<{
|
|
30
|
+
earlyAccessGranted: z.ZodBoolean;
|
|
31
|
+
source: z.ZodNullable<z.ZodEnum<{
|
|
32
|
+
network: "network";
|
|
33
|
+
account: "account";
|
|
34
|
+
}>>;
|
|
35
|
+
}, z.core.$strip>;
|
|
29
36
|
export declare const betaAcceptSchema: z.ZodObject<{
|
|
30
37
|
token: z.ZodString;
|
|
31
38
|
}, z.core.$strip>;
|
|
@@ -60,8 +67,7 @@ export declare const SuperadminBetaSignupSchema: z.ZodObject<{
|
|
|
60
67
|
invited: "invited";
|
|
61
68
|
enrolled: "enrolled";
|
|
62
69
|
}>;
|
|
63
|
-
|
|
64
|
-
wpcom: z.ZodBoolean;
|
|
70
|
+
automatticDomain: z.ZodBoolean;
|
|
65
71
|
invitedAt: z.ZodNullable<z.ZodString>;
|
|
66
72
|
tokenExpiresAt: z.ZodNullable<z.ZodString>;
|
|
67
73
|
invitedBy: z.ZodNullable<z.ZodString>;
|
|
@@ -87,8 +93,7 @@ export declare const SuperadminBetaSignupListSchema: z.ZodObject<{
|
|
|
87
93
|
invited: "invited";
|
|
88
94
|
enrolled: "enrolled";
|
|
89
95
|
}>;
|
|
90
|
-
|
|
91
|
-
wpcom: z.ZodBoolean;
|
|
96
|
+
automatticDomain: z.ZodBoolean;
|
|
92
97
|
invitedAt: z.ZodNullable<z.ZodString>;
|
|
93
98
|
tokenExpiresAt: z.ZodNullable<z.ZodString>;
|
|
94
99
|
invitedBy: z.ZodNullable<z.ZodString>;
|