@spacefast/common 0.0.10 → 0.0.12

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.
Files changed (122) hide show
  1. package/dist/agents/connect-targets.d.ts +4 -4
  2. package/dist/agents/connect-targets.js +3 -3
  3. package/dist/agents/private-key-oauth.d.ts +37 -0
  4. package/dist/agents/private-key-oauth.js +158 -0
  5. package/dist/config/domains.js +1 -1
  6. package/dist/config/index.d.ts +1 -0
  7. package/dist/config/index.js +1 -0
  8. package/dist/config/postgres-budget.d.ts +126 -0
  9. package/dist/config/postgres-budget.js +135 -0
  10. package/dist/config/postgres-budget.json +50 -0
  11. package/dist/contracts/access.d.ts +42 -24
  12. package/dist/contracts/access.js +73 -34
  13. package/dist/contracts/activity.d.ts +1 -1
  14. package/dist/contracts/activity.js +5 -5
  15. package/dist/contracts/api-keys.d.ts +53 -45
  16. package/dist/contracts/api-keys.js +1 -0
  17. package/dist/contracts/archives.d.ts +8 -8
  18. package/dist/contracts/builds.d.ts +8 -8
  19. package/dist/contracts/builds.js +28 -48
  20. package/dist/contracts/channels.js +1 -2
  21. package/dist/contracts/comments.d.ts +55 -19
  22. package/dist/contracts/comments.js +56 -17
  23. package/dist/contracts/common.d.ts +4 -3
  24. package/dist/contracts/common.js +2 -0
  25. package/dist/contracts/deployments.d.ts +3 -3
  26. package/dist/contracts/device-auth.d.ts +14 -12
  27. package/dist/contracts/docs.d.ts +5 -5
  28. package/dist/contracts/domains.d.ts +261 -1330
  29. package/dist/contracts/domains.js +39 -301
  30. package/dist/contracts/email-preferences.d.ts +50 -0
  31. package/dist/contracts/email-preferences.js +44 -0
  32. package/dist/contracts/enums.d.ts +1 -1
  33. package/dist/contracts/error-code-meta.d.ts +84 -15
  34. package/dist/contracts/error-code-meta.js +28 -4
  35. package/dist/contracts/error-codes.d.ts +1 -1
  36. package/dist/contracts/error-codes.js +24 -6
  37. package/dist/contracts/events.d.ts +13 -13
  38. package/dist/contracts/feature-lifecycle.d.ts +644 -2
  39. package/dist/contracts/feature-lifecycle.js +685 -2
  40. package/dist/contracts/features.d.ts +236 -24
  41. package/dist/contracts/features.js +3 -272
  42. package/dist/contracts/ids.d.ts +1 -2
  43. package/dist/contracts/ids.js +1 -2
  44. package/dist/contracts/internal.d.ts +3 -3
  45. package/dist/contracts/mcp.d.ts +6 -6
  46. package/dist/contracts/me.js +1 -1
  47. package/dist/contracts/mounts.d.ts +142 -0
  48. package/dist/contracts/mounts.js +56 -0
  49. package/dist/contracts/oauth-resources.d.ts +5 -5
  50. package/dist/contracts/oauth-resources.js +1 -0
  51. package/dist/contracts/operations.d.ts +2 -2
  52. package/dist/contracts/pages.d.ts +2 -2
  53. package/dist/contracts/pages.js +8 -3
  54. package/dist/contracts/plan-policy.d.ts +1 -1
  55. package/dist/contracts/platform.d.ts +3 -3
  56. package/dist/contracts/resources.d.ts +12 -20
  57. package/dist/contracts/resources.js +13 -37
  58. package/dist/contracts/runtime-api.d.ts +330 -16
  59. package/dist/contracts/runtime-api.js +58 -14
  60. package/dist/contracts/sf-config-v1.js +1 -1
  61. package/dist/contracts/sites.d.ts +12 -12
  62. package/dist/contracts/sites.js +18 -11
  63. package/dist/contracts/space-config.d.ts +2 -3
  64. package/dist/contracts/space-config.js +3 -1
  65. package/dist/contracts/spaces.d.ts +143 -102
  66. package/dist/contracts/spaces.js +109 -43
  67. package/dist/contracts/superadmin-emails.d.ts +25 -1
  68. package/dist/contracts/superadmin-emails.js +10 -15
  69. package/dist/contracts/superadmin-runtime.d.ts +2 -2
  70. package/dist/contracts/superadmin-spaces.d.ts +6 -14
  71. package/dist/contracts/tags.d.ts +43 -13
  72. package/dist/contracts/tags.js +195 -11
  73. package/dist/contracts/transfers.d.ts +1 -1
  74. package/dist/contracts/variables.d.ts +4 -4
  75. package/dist/contracts/variables.js +4 -3
  76. package/dist/contracts/webhooks.d.ts +2 -2
  77. package/dist/contracts/zero.d.ts +329 -7
  78. package/dist/contracts/zero.js +121 -2
  79. package/dist/dashboard-paths/index.d.ts +1 -1
  80. package/dist/docs/agent-setup.d.ts +4 -2
  81. package/dist/docs/agent-setup.js +15 -7
  82. package/dist/docs/agent-solutions.js +1 -1
  83. package/dist/docs/catalog.d.ts +8 -10
  84. package/dist/docs/catalog.js +8 -10
  85. package/dist/docs/error-docs.js +86 -18
  86. package/dist/utils/access-grant.d.ts +14 -0
  87. package/dist/utils/access-grant.js +88 -0
  88. package/dist/utils/access-match.d.ts +7 -0
  89. package/dist/utils/access-match.fixtures.json +513 -0
  90. package/dist/utils/access-match.js +32 -16
  91. package/dist/utils/access-verdict.fixtures.json +421 -0
  92. package/dist/utils/credential-policy.d.ts +1 -1
  93. package/dist/utils/dns-instructions.d.ts +29 -0
  94. package/dist/utils/dns-instructions.js +78 -0
  95. package/dist/utils/domain-diagnostics.d.ts +29 -0
  96. package/dist/utils/domain-diagnostics.js +63 -0
  97. package/dist/utils/egress-policy.fixtures.json +51 -0
  98. package/dist/utils/id-hints.d.ts +1 -0
  99. package/dist/utils/id-hints.js +55 -13
  100. package/dist/utils/page-colors.d.ts +50 -0
  101. package/dist/utils/page-colors.js +167 -0
  102. package/dist/utils/page-fonts.d.ts +2 -0
  103. package/dist/utils/page-fonts.js +4 -0
  104. package/dist/utils/pages.d.ts +8 -1
  105. package/dist/utils/pages.js +123 -37
  106. package/dist/utils/production-runtime.d.ts +18 -0
  107. package/dist/utils/production-runtime.js +28 -0
  108. package/dist/utils/query-keys.d.ts +6 -7
  109. package/dist/utils/query-keys.js +11 -12
  110. package/dist/utils/sf-config-v1.fixtures.json +9 -0
  111. package/dist/utils/sf-config-v1.js +28 -19
  112. package/dist/utils/source-archive-policy.d.ts +2 -0
  113. package/dist/utils/source-archive-policy.js +2 -0
  114. package/dist/utils/static-runtime-policy.fixtures.json +57 -0
  115. package/dist/utils/static-runtime-policy.js +1 -1
  116. package/package.json +5 -4
  117. package/dist/contracts/annotations.d.ts +0 -327
  118. package/dist/contracts/annotations.js +0 -235
  119. package/dist/contracts/generated-feature-launch-entries.d.ts +0 -2
  120. package/dist/contracts/generated-feature-launch-entries.js +0 -518
  121. package/dist/contracts/publishes.d.ts +0 -135
  122. package/dist/contracts/publishes.js +0 -162
@@ -2,7 +2,7 @@ import { z } from "zod";
2
2
  import { AsyncOperationSchema, baseDiagnosticSchema, CursorPaginationSchema, cursorListQuerySchema, } from "./common.js";
3
3
  import { versionStatus, spaceStatus } from "./enums.js";
4
4
  import { conventionFilesSchema, uploadInstructionsSchema, manifestFileSchema } from "./internal.js";
5
- import { ChannelPointerSchema, VersionSchema, PublishSourceSchema, SpaceSchema, spaceSettingsDigestSchema, } from "./resources.js";
5
+ import { VersionSchema, PublishSourceSchema, SpaceSchema, spaceSettingsDigestSchema, } from "./resources.js";
6
6
  import { spaceConfigSchema, spacePlacementConfigSchema } from "./space-config.js";
7
7
  import { principalIdSchema } from "./transfers.js";
8
8
  import { zeroRuntimeKindSchema } from "./zero.js";
@@ -87,13 +87,6 @@ export const spacePatchSchema = z
87
87
  .boolean()
88
88
  .optional()
89
89
  .describe("Hide the live production site from search engines. Applies only to claimed spaces' live hostnames; preview and version hostnames are always noindex."),
90
- password: z
91
- .string()
92
- .min(1)
93
- .max(255)
94
- .nullable()
95
- .optional()
96
- .describe("Sets (string) or removes (null) space password protection."),
97
90
  })
98
91
  // Strict so an unknown field (notably `slug`) is rejected with a validation
99
92
  // error rather than silently stripped. Slug rename is a deliberately
@@ -238,6 +231,44 @@ export const spaceClaimReminderSchema = z.object({
238
231
  export const spaceClaimReminderResponseSchema = z.object({
239
232
  accepted: z.literal(true),
240
233
  });
234
+ // Shared by spaceVersionCreateSchema and publishRequestSchema: both accept the
235
+ // same manifest-mutation fields and enforce the same "requires a declared
236
+ // files manifest / snapshot mode" rules on them.
237
+ const manifestMutationFieldsSchema = {
238
+ deletePaths: z
239
+ .array(z.string().min(1))
240
+ .default([])
241
+ .describe("Explicit paths to remove when publishMode is additive. Omitted paths are retained; only paths listed here are deleted."),
242
+ immutableAssetPrefixes: z
243
+ .array(z.string().min(2))
244
+ .optional()
245
+ .describe("Publisher-owned directory prefixes whose declared files are immutable generation assets. Snapshot publishes retain the current generation's matching files for exactly one subsequent generation."),
246
+ };
247
+ function refineManifestMutationRules(value, ctx) {
248
+ if (value.files === undefined && value.deletePaths.length > 0) {
249
+ ctx.addIssue({
250
+ code: z.ZodIssueCode.custom,
251
+ message: "deletePaths requires a declared files manifest.",
252
+ path: ["deletePaths"],
253
+ });
254
+ }
255
+ if (value.immutableAssetPrefixes !== undefined) {
256
+ if (value.files === undefined) {
257
+ ctx.addIssue({
258
+ code: z.ZodIssueCode.custom,
259
+ message: "immutableAssetPrefixes requires a declared files manifest.",
260
+ path: ["immutableAssetPrefixes"],
261
+ });
262
+ }
263
+ if (value.publishMode !== "snapshot") {
264
+ ctx.addIssue({
265
+ code: z.ZodIssueCode.custom,
266
+ message: "immutableAssetPrefixes requires snapshot publish mode.",
267
+ path: ["immutableAssetPrefixes"],
268
+ });
269
+ }
270
+ }
271
+ }
241
272
  export const spaceVersionCreateSchema = z
242
273
  .object({
243
274
  source: PublishSourceSchema.optional().describe('Publish provenance recorded on the version; defaults to {kind: "direct_upload"}.'),
@@ -257,24 +288,17 @@ export const spaceVersionCreateSchema = z
257
288
  conventionFiles: conventionFilesSchema
258
289
  .optional()
259
290
  .describe("Routing convention contents used when deciding whether this publish is unchanged. The same values are supplied again when the version is finalized."),
291
+ finalize: z
292
+ .object({ channel: z.literal("live").nullable().optional() })
293
+ .optional()
294
+ .describe("Finalize intent for a declared upload. When every declared file lands, the version finalizes itself; the explicit finalize call remains available for recovery and replay."),
260
295
  files: z
261
296
  .array(manifestFileSchema)
262
297
  .optional()
263
298
  .describe("Full desired file manifest. For first deploys, send path/size/contentType without hashes so upload can begin immediately. For updates, include sha256 to let the server skip unchanged files. Omit entirely for an open session: the upload token then authorizes any policy-valid path within plan caps and finalize derives the manifest from what was uploaded."),
264
- deletePaths: z
265
- .array(z.string().min(1))
266
- .default([])
267
- .describe("Explicit paths to remove when publishMode is additive. Omitted paths are retained; only paths listed here are deleted."),
299
+ ...manifestMutationFieldsSchema,
268
300
  })
269
- .superRefine((value, ctx) => {
270
- if (value.files === undefined && value.deletePaths.length > 0) {
271
- ctx.addIssue({
272
- code: z.ZodIssueCode.custom,
273
- message: "deletePaths requires a declared files manifest.",
274
- path: ["deletePaths"],
275
- });
276
- }
277
- });
301
+ .superRefine(refineManifestMutationRules);
278
302
  export const spaceVersionListSchema = z.object({
279
303
  data: z.array(VersionSchema),
280
304
  pagination: CursorPaginationSchema,
@@ -467,16 +491,31 @@ export const spaceVersionFileDiffEntrySchema = z.object({
467
491
  format: z.literal("unified"),
468
492
  content: z.string(),
469
493
  truncated: z.boolean(),
494
+ truncationReason: z.literal("patch_byte_limit").nullable(),
470
495
  })
471
496
  .nullable(),
497
+ patchOmission: z
498
+ .enum(["input_too_large", "not_previewable", "content_unavailable", "patch_budget_exhausted"])
499
+ .nullable(),
472
500
  });
473
- export const spaceVersionFileDiffQuerySchema = z.object({
501
+ export const spaceVersionFileDiffQuerySchema = cursorListQuerySchema.extend({
474
502
  baseVersionId: z.string().optional(),
475
503
  });
476
504
  export const spaceVersionFileDiffResponseSchema = z.object({
477
505
  versionId: z.string(),
478
506
  baseVersionId: z.string().nullable(),
479
507
  files: z.array(spaceVersionFileDiffEntrySchema),
508
+ pagination: CursorPaginationSchema,
509
+ limits: z.object({
510
+ maxFiles: z.number().int().positive(),
511
+ maxInputBytes: z.number().int().positive(),
512
+ maxPatchBytes: z.number().int().positive(),
513
+ readConcurrency: z.number().int().positive(),
514
+ }),
515
+ usage: z.object({
516
+ inputBytes: z.number().int().nonnegative(),
517
+ patchBytes: z.number().int().nonnegative(),
518
+ }),
480
519
  });
481
520
  // Upload state is inferable (internal-docs/platform.md L2216): `upload` present means bytes are
482
521
  // still needed (then finalize); `versionId` null means the manifest matched and nothing changed.
@@ -504,11 +543,20 @@ export const publishRequestSchema = z
504
543
  .array(manifestFileSchema)
505
544
  .optional()
506
545
  .describe("Desired file manifest for a declared publish session. Clients upload returned paths, then finalize. Omit for inline one-shot and open-session publishes."),
507
- deletePaths: z
508
- .array(z.string().min(1))
509
- .default([])
510
- .describe("Explicit paths to remove when publishMode is additive. Omitted paths are retained; only paths listed here are deleted."),
546
+ ...manifestMutationFieldsSchema,
511
547
  source: PublishSourceSchema.optional().describe('Publish provenance recorded on the version; defaults to {kind: "direct_upload"}.'),
548
+ // Same fields, same bounds as spaceVersionCreateSchema: a publish that ran
549
+ // a build carries its transcript and provenance whichever door it enters
550
+ // by, so the first version of a space is not poorer than its second.
551
+ sourceMetadata: z
552
+ .record(z.string(), z.unknown())
553
+ .optional()
554
+ .describe("Additional control-plane-only provenance for build/deploy read models."),
555
+ buildLog: z
556
+ .string()
557
+ .max(64_000)
558
+ .optional()
559
+ .describe("Bounded build transcript for deploys that ran a local build before publishing."),
512
560
  publishMode: z
513
561
  .enum(["additive", "snapshot"])
514
562
  .default("additive")
@@ -543,13 +591,7 @@ export const publishRequestSchema = z
543
591
  path: ["principal", "id"],
544
592
  });
545
593
  }
546
- if (value.files === undefined && value.deletePaths.length > 0) {
547
- ctx.addIssue({
548
- code: z.ZodIssueCode.custom,
549
- message: "deletePaths requires a declared files manifest.",
550
- path: ["deletePaths"],
551
- });
552
- }
594
+ refineManifestMutationRules(value, ctx);
553
595
  });
554
596
  export const publishUploadReceiptSchema = z.object({
555
597
  ...uploadInstructionsSchema.shape,
@@ -569,9 +611,43 @@ export const publishReceiptVersionSchema = z.object({
569
611
  number: z.number().int().positive().nullable().optional(),
570
612
  manifestHash: z.string().nullable(),
571
613
  });
614
+ // Liveness is never a version status — it is the channel pointer, reported
615
+ // here. "Ready and live" (activated), "ready but outraced" (superseded), and
616
+ // "ready by design" (unpromoted) are three different receipts.
617
+ export const publishActivationSchema = z.object({
618
+ channel: z
619
+ .enum(["live"])
620
+ .nullable()
621
+ .describe("Channel this publish targeted. null = ready version without promotion."),
622
+ outcome: z
623
+ .enum(["activated", "unpromoted", "superseded", "pending"])
624
+ .describe("activated: the live pointer moved to this version. unpromoted: ready with channel null, by request. superseded: ready, but a newer publish holds the live pointer. pending: not settled yet."),
625
+ currentLiveVersionId: z
626
+ .string()
627
+ .nullable()
628
+ .describe("The version currently serving live traffic, or null when the space has none."),
629
+ });
630
+ // The receipt's normative next step: the deterministic projection of
631
+ // (version status, activation outcome, pending bytes, operation state). An
632
+ // agent drives the whole lifecycle by branching on `action` alone.
633
+ export const publishNextSchema = z.object({
634
+ action: z
635
+ .enum(["done", "upload", "finalize", "poll"])
636
+ .describe("done: stop, this request's intent is settled. upload: PUT the upload targets, then follow the finalize link. finalize: all bytes are present, POST url to commit. poll: server-side work in flight, GET url after retryAfter seconds."),
637
+ url: z.string().optional().describe("The endpoint the action applies to."),
638
+ retryAfter: z
639
+ .number()
640
+ .int()
641
+ .positive()
642
+ .optional()
643
+ .describe("Polling cadence in seconds; present only when action is poll."),
644
+ hint: z.string().max(140).describe("One plain sentence for an agent mid-loop."),
645
+ });
572
646
  export const publishReceiptSchema = z.object({
573
647
  space: publishReceiptSpaceSchema,
574
648
  version: publishReceiptVersionSchema,
649
+ activation: publishActivationSchema,
650
+ next: publishNextSchema,
575
651
  operation: AsyncOperationSchema.optional().describe("Background finalize operation when publish work continues asynchronously."),
576
652
  // Paste-ready one-liner (URL + claim nudge) so agents propagate consistent
577
653
  // claim copy into transcripts (internal-docs/platform.md M1a "share blurb").
@@ -671,15 +747,6 @@ export const spaceRuntimeStatusSchema = z.object({
671
747
  pendingVersionStatus: versionStatus.nullable(),
672
748
  operation: AsyncOperationSchema.nullable(),
673
749
  });
674
- // Channel listing entry: the channel name plus its spec ChannelPointer.
675
- export const spaceChannelSchema = z.object({
676
- name: z.string().describe('Channel name; "live" is the default channel.'),
677
- pointer: ChannelPointerSchema,
678
- });
679
- export const spaceChannelListResponseSchema = z.object({
680
- data: z.array(spaceChannelSchema),
681
- pagination: CursorPaginationSchema,
682
- });
683
750
  export const spaceApplyChangeBaseSchema = z.object({
684
751
  kind: z.enum(["variable", "routing", "password", "settings"]),
685
752
  name: z.string(),
@@ -690,7 +757,6 @@ export const spaceApplyChangeSchema = spaceApplyChangeBaseSchema.extend({
690
757
  id: z.string(),
691
758
  sourceSurface: z.string(),
692
759
  applyMode: spaceApplyModeSchema,
693
- changesetId: z.string().optional(),
694
760
  before: z.record(z.string(), z.unknown()).nullable().optional(),
695
761
  after: z.record(z.string(), z.unknown()).nullable().optional(),
696
762
  metadata: z.record(z.string(), z.unknown()).optional(),
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- export declare const superadminEmailStatusValues: readonly ["all", "scheduled", "sent", "delivered", "bounced", "dropped", "complained", "opened", "clicked", "failed"];
2
+ export declare const superadminEmailStatusValues: readonly ["all", "scheduled", "sent", "suppressed", "delivered", "bounced", "dropped", "complained", "opened", "clicked", "failed"];
3
3
  export declare const superadminEmailCategoryValues: readonly ["transactional", "announcements", "offers", "system", "invites"];
4
4
  export declare const superadminEmailListQuerySchema: z.ZodObject<{
5
5
  limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
@@ -11,6 +11,7 @@ export declare const superadminEmailListQuerySchema: z.ZodObject<{
11
11
  dropped: "dropped";
12
12
  scheduled: "scheduled";
13
13
  sent: "sent";
14
+ suppressed: "suppressed";
14
15
  bounced: "bounced";
15
16
  complained: "complained";
16
17
  opened: "opened";
@@ -49,6 +50,12 @@ export declare const superadminEmailSendSchema: z.ZodObject<{
49
50
  offers: "offers";
50
51
  invites: "invites";
51
52
  }>>;
53
+ preferenceTopic: z.ZodEnum<{
54
+ system: "system";
55
+ announcements: "announcements";
56
+ offers: "offers";
57
+ invites: "invites";
58
+ }>;
52
59
  type: z.ZodDefault<z.ZodString>;
53
60
  props: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
54
61
  sendAt: z.ZodOptional<z.ZodString>;
@@ -92,6 +99,13 @@ export declare const SuperadminEmailSchema: z.ZodObject<{
92
99
  type: z.ZodString;
93
100
  template: z.ZodString;
94
101
  category: z.ZodString;
102
+ preferenceTopic: z.ZodNullable<z.ZodEnum<{
103
+ system: "system";
104
+ announcements: "announcements";
105
+ offers: "offers";
106
+ invites: "invites";
107
+ }>>;
108
+ essentialAuth: z.ZodBoolean;
95
109
  props: z.ZodRecord<z.ZodString, z.ZodUnknown>;
96
110
  options: z.ZodRecord<z.ZodString, z.ZodUnknown>;
97
111
  metadata: z.ZodNullable<z.ZodObject<{
@@ -125,6 +139,7 @@ export declare const SuperadminEmailSchema: z.ZodObject<{
125
139
  fakeOpenedAt: z.ZodNullable<z.ZodString>;
126
140
  combinedOpenedAt: z.ZodNullable<z.ZodString>;
127
141
  unsubscribedAt: z.ZodNullable<z.ZodString>;
142
+ suppressedAt: z.ZodNullable<z.ZodString>;
128
143
  failedAt: z.ZodNullable<z.ZodString>;
129
144
  createdAt: z.ZodString;
130
145
  updatedAt: z.ZodString;
@@ -148,6 +163,13 @@ export declare const SuperadminEmailListSchema: z.ZodObject<{
148
163
  type: z.ZodString;
149
164
  template: z.ZodString;
150
165
  category: z.ZodString;
166
+ preferenceTopic: z.ZodNullable<z.ZodEnum<{
167
+ system: "system";
168
+ announcements: "announcements";
169
+ offers: "offers";
170
+ invites: "invites";
171
+ }>>;
172
+ essentialAuth: z.ZodBoolean;
151
173
  props: z.ZodRecord<z.ZodString, z.ZodUnknown>;
152
174
  options: z.ZodRecord<z.ZodString, z.ZodUnknown>;
153
175
  metadata: z.ZodNullable<z.ZodObject<{
@@ -181,6 +203,7 @@ export declare const SuperadminEmailListSchema: z.ZodObject<{
181
203
  fakeOpenedAt: z.ZodNullable<z.ZodString>;
182
204
  combinedOpenedAt: z.ZodNullable<z.ZodString>;
183
205
  unsubscribedAt: z.ZodNullable<z.ZodString>;
206
+ suppressedAt: z.ZodNullable<z.ZodString>;
184
207
  failedAt: z.ZodNullable<z.ZodString>;
185
208
  createdAt: z.ZodString;
186
209
  updatedAt: z.ZodString;
@@ -203,6 +226,7 @@ export declare const SuperadminEmailSendResultSchema: z.ZodObject<{
203
226
  error: "error";
204
227
  scheduled: "scheduled";
205
228
  sent: "sent";
229
+ suppressed: "suppressed";
206
230
  }>;
207
231
  error: z.ZodOptional<z.ZodString>;
208
232
  }, z.core.$strip>>;
@@ -1,10 +1,12 @@
1
1
  import { z } from "zod";
2
2
  import { makeOffsetListSchema } from "./common.js";
3
+ import { emailCategoryValues, emailPreferenceTopicValues } from "./email-preferences.js";
3
4
  import { superadminPaginationSchema } from "./superadmin.js";
4
5
  export const superadminEmailStatusValues = [
5
6
  "all",
6
7
  "scheduled",
7
8
  "sent",
9
+ "suppressed",
8
10
  "delivered",
9
11
  "bounced",
10
12
  "dropped",
@@ -13,20 +15,9 @@ export const superadminEmailStatusValues = [
13
15
  "clicked",
14
16
  "failed",
15
17
  ];
16
- // "invites" is the invite/request sending stream (access-plan X-25): mail
17
- // carrying sender-authored content to arbitrary non-user addresses is
18
- // attacker-adjacent, so it is categorized apart from transactional mail —
19
- // burned reputation on the invite stream must never take down password
20
- // resets. Stream-level isolation at the provider (a separate SES
21
- // configuration set / sending identity) is an infra follow-up; the category
22
- // is the seam it keys off.
23
- export const superadminEmailCategoryValues = [
24
- "transactional",
25
- "announcements",
26
- "offers",
27
- "system",
28
- "invites",
29
- ];
18
+ // Delivery category is provider-facing telemetry/routing. Recipient control is
19
+ // modeled independently by preferenceTopic; essential auth has no topic.
20
+ export const superadminEmailCategoryValues = emailCategoryValues;
30
21
  export const superadminEmailListQuerySchema = z.object({
31
22
  limit: z.coerce.number().int().min(1).max(100).default(25),
32
23
  offset: z.coerce.number().int().min(0).default(0),
@@ -44,6 +35,7 @@ export const superadminEmailSendSchema = z.object({
44
35
  html: z.string().optional(),
45
36
  template: z.string().trim().min(1).default("generic-message"),
46
37
  category: z.enum(superadminEmailCategoryValues).default("transactional"),
38
+ preferenceTopic: z.enum(emailPreferenceTopicValues),
47
39
  type: z.string().trim().min(1).default("generic-message"),
48
40
  props: z.record(z.string(), z.unknown()).default({}),
49
41
  sendAt: z.string().datetime().optional(),
@@ -90,6 +82,8 @@ export const SuperadminEmailSchema = z.object({
90
82
  type: z.string(),
91
83
  template: z.string(),
92
84
  category: z.string(),
85
+ preferenceTopic: z.enum(emailPreferenceTopicValues).nullable(),
86
+ essentialAuth: z.boolean(),
93
87
  props: z.record(z.string(), z.unknown()),
94
88
  options: z.record(z.string(), z.unknown()),
95
89
  metadata: SuperadminEmailMetadataSchema.nullable(),
@@ -104,6 +98,7 @@ export const SuperadminEmailSchema = z.object({
104
98
  fakeOpenedAt: z.string().datetime().nullable(),
105
99
  combinedOpenedAt: z.string().datetime().nullable(),
106
100
  unsubscribedAt: z.string().datetime().nullable(),
101
+ suppressedAt: z.string().datetime().nullable(),
107
102
  failedAt: z.string().datetime().nullable(),
108
103
  createdAt: z.string().datetime(),
109
104
  updatedAt: z.string().datetime(),
@@ -114,7 +109,7 @@ export const SuperadminEmailSendResultSchema = z.object({
114
109
  id: z.string(),
115
110
  userId: z.string().nullable().optional(),
116
111
  email: z.string().optional(),
117
- status: z.enum(["sent", "scheduled", "error"]),
112
+ status: z.enum(["sent", "scheduled", "suppressed", "error"]),
118
113
  error: z.string().optional(),
119
114
  })),
120
115
  });
@@ -8,8 +8,8 @@ export declare const superadminEdgePurgeSchema: z.ZodObject<{
8
8
  uris: z.ZodNullable<z.ZodArray<z.ZodString>>;
9
9
  status: z.ZodEnum<{
10
10
  pending: "pending";
11
- purged: "purged";
12
11
  superseded: "superseded";
12
+ purged: "purged";
13
13
  }>;
14
14
  executedAt: z.ZodNullable<z.ZodString>;
15
15
  createdAt: z.ZodString;
@@ -17,8 +17,8 @@ export declare const superadminEdgePurgeSchema: z.ZodObject<{
17
17
  export declare const superadminEdgePurgeListQuerySchema: z.ZodObject<{
18
18
  status: z.ZodOptional<z.ZodEnum<{
19
19
  pending: "pending";
20
- purged: "purged";
21
20
  superseded: "superseded";
21
+ purged: "purged";
22
22
  }>>;
23
23
  providerSiteId: z.ZodOptional<z.ZodString>;
24
24
  hostname: z.ZodOptional<z.ZodString>;
@@ -187,11 +187,7 @@ export declare const SuperadminSpaceDetailSchema: z.ZodObject<{
187
187
  }>;
188
188
  moving: z.ZodBoolean;
189
189
  channels: z.ZodRecord<z.ZodString, z.ZodObject<{
190
- versionId: z.ZodOptional<z.ZodString>;
191
- weighted: z.ZodOptional<z.ZodArray<z.ZodObject<{
192
- versionId: z.ZodString;
193
- percentage: z.ZodNumber;
194
- }, z.core.$strip>>>;
190
+ versionId: z.ZodString;
195
191
  updatedAt: z.ZodString;
196
192
  }, z.core.$strip>>;
197
193
  config: z.ZodNullable<z.ZodObject<{
@@ -258,7 +254,6 @@ export declare const SuperadminSpaceDetailSchema: z.ZodObject<{
258
254
  timeoutSeconds: z.ZodOptional<z.ZodNumber>;
259
255
  }, z.core.$strict>>;
260
256
  placement: z.ZodOptional<z.ZodObject<{
261
- region: z.ZodOptional<z.ZodString>;
262
257
  mode: z.ZodOptional<z.ZodEnum<{
263
258
  shared: "shared";
264
259
  dedicated: "dedicated";
@@ -288,6 +283,7 @@ export declare const SuperadminSpaceDetailSchema: z.ZodObject<{
288
283
  ipCidrs: z.ZodOptional<z.ZodArray<z.ZodString>>;
289
284
  agent: z.ZodOptional<z.ZodString>;
290
285
  country: z.ZodOptional<z.ZodString>;
286
+ countryNotIn: z.ZodOptional<z.ZodArray<z.ZodString>>;
291
287
  header: z.ZodOptional<z.ZodObject<{
292
288
  name: z.ZodString;
293
289
  value: z.ZodString;
@@ -362,8 +358,8 @@ export declare const SuperadminSpaceDetailSchema: z.ZodObject<{
362
358
  code: z.ZodString;
363
359
  severity: z.ZodEnum<{
364
360
  info: "info";
365
- warning: "warning";
366
361
  error: "error";
362
+ warning: "warning";
367
363
  }>;
368
364
  message: z.ZodString;
369
365
  path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -572,11 +568,7 @@ export declare const SuperadminAnonymousSpaceAssignResponseSchema: z.ZodObject<{
572
568
  }>;
573
569
  moving: z.ZodBoolean;
574
570
  channels: z.ZodRecord<z.ZodString, z.ZodObject<{
575
- versionId: z.ZodOptional<z.ZodString>;
576
- weighted: z.ZodOptional<z.ZodArray<z.ZodObject<{
577
- versionId: z.ZodString;
578
- percentage: z.ZodNumber;
579
- }, z.core.$strip>>>;
571
+ versionId: z.ZodString;
580
572
  updatedAt: z.ZodString;
581
573
  }, z.core.$strip>>;
582
574
  config: z.ZodNullable<z.ZodObject<{
@@ -643,7 +635,6 @@ export declare const SuperadminAnonymousSpaceAssignResponseSchema: z.ZodObject<{
643
635
  timeoutSeconds: z.ZodOptional<z.ZodNumber>;
644
636
  }, z.core.$strict>>;
645
637
  placement: z.ZodOptional<z.ZodObject<{
646
- region: z.ZodOptional<z.ZodString>;
647
638
  mode: z.ZodOptional<z.ZodEnum<{
648
639
  shared: "shared";
649
640
  dedicated: "dedicated";
@@ -673,6 +664,7 @@ export declare const SuperadminAnonymousSpaceAssignResponseSchema: z.ZodObject<{
673
664
  ipCidrs: z.ZodOptional<z.ZodArray<z.ZodString>>;
674
665
  agent: z.ZodOptional<z.ZodString>;
675
666
  country: z.ZodOptional<z.ZodString>;
667
+ countryNotIn: z.ZodOptional<z.ZodArray<z.ZodString>>;
676
668
  header: z.ZodOptional<z.ZodObject<{
677
669
  name: z.ZodString;
678
670
  value: z.ZodString;
@@ -747,8 +739,8 @@ export declare const SuperadminAnonymousSpaceAssignResponseSchema: z.ZodObject<{
747
739
  code: z.ZodString;
748
740
  severity: z.ZodEnum<{
749
741
  info: "info";
750
- warning: "warning";
751
742
  error: "error";
743
+ warning: "warning";
752
744
  }>;
753
745
  message: z.ZodString;
754
746
  path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -81,8 +81,8 @@ export declare const tagConsentPolicySchema: z.ZodObject<{
81
81
  code: z.ZodString;
82
82
  severity: z.ZodEnum<{
83
83
  info: "info";
84
- warning: "warning";
85
84
  error: "error";
85
+ warning: "warning";
86
86
  }>;
87
87
  message: z.ZodString;
88
88
  path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -100,6 +100,16 @@ export declare const tagConsentPolicySchema: z.ZodObject<{
100
100
  export type TagConsentPolicy = z.infer<typeof tagConsentPolicySchema>;
101
101
  export declare function isKnownTagConsentCategory(value: string): value is TagConsentCategory;
102
102
  export declare function mergeTagConsentPolicyInputs(...policies: unknown[]): Record<string, unknown> | undefined;
103
+ export declare const TAG_GRAPH_MAX_ENCODED_BYTES: number;
104
+ export declare const TAG_GRAPH_MAX_REQUEST_BODY_BYTES: number;
105
+ export declare const TAG_GRAPH_MAX_TAGS = 256;
106
+ export declare const TAG_GRAPH_MAX_TRIGGERS = 256;
107
+ export declare const TAG_GRAPH_MAX_VARIABLES = 256;
108
+ export declare const TAG_GRAPH_MAX_SYSTEM_MODULES = 64;
109
+ export declare const TAG_GRAPH_MAX_ARRAY_ITEMS = 256;
110
+ export declare const TAG_GRAPH_MAX_OBJECT_KEYS = 64;
111
+ export declare const TAG_GRAPH_MAX_STRING_BYTES: number;
112
+ export declare const TAG_GRAPH_MAX_DEPTH = 16;
103
113
  export declare const tagGraphSchema: z.ZodObject<{
104
114
  format: z.ZodDefault<z.ZodLiteral<"spacefast.tag_graph.v1">>;
105
115
  tags: z.ZodDefault<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
@@ -108,6 +118,22 @@ export declare const tagGraphSchema: z.ZodObject<{
108
118
  systemModules: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
109
119
  consentPolicy: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
110
120
  }, z.core.$loose>;
121
+ export declare const tagGraphCloneSchema: z.ZodObject<{
122
+ format: z.ZodDefault<z.ZodLiteral<"spacefast.tag_graph.v1">>;
123
+ tags: z.ZodDefault<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
124
+ triggers: z.ZodDefault<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
125
+ variables: z.ZodDefault<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
126
+ systemModules: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
127
+ consentPolicy: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
128
+ }, z.core.$loose>;
129
+ export declare const tagGraphWriteSchema: z.ZodObject<{
130
+ format: z.ZodDefault<z.ZodLiteral<"spacefast.tag_graph.v1">>;
131
+ tags: z.ZodDefault<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
132
+ triggers: z.ZodDefault<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
133
+ variables: z.ZodDefault<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
134
+ systemModules: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
135
+ consentPolicy: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
136
+ }, z.core.$strict>;
111
137
  export type TagGraph = z.infer<typeof tagGraphSchema>;
112
138
  export declare const emptyTagGraph: TagGraph;
113
139
  export declare const tagValidationResultSchema: z.ZodObject<{
@@ -116,8 +142,8 @@ export declare const tagValidationResultSchema: z.ZodObject<{
116
142
  code: z.ZodString;
117
143
  severity: z.ZodEnum<{
118
144
  info: "info";
119
- warning: "warning";
120
145
  error: "error";
146
+ warning: "warning";
121
147
  }>;
122
148
  message: z.ZodString;
123
149
  path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -165,8 +191,8 @@ export declare const tagVersionSchema: z.ZodObject<{
165
191
  code: z.ZodString;
166
192
  severity: z.ZodEnum<{
167
193
  info: "info";
168
- warning: "warning";
169
194
  error: "error";
195
+ warning: "warning";
170
196
  }>;
171
197
  message: z.ZodString;
172
198
  path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -235,8 +261,8 @@ export declare const tagVersionListResponseSchema: z.ZodObject<{
235
261
  code: z.ZodString;
236
262
  severity: z.ZodEnum<{
237
263
  info: "info";
238
- warning: "warning";
239
264
  error: "error";
265
+ warning: "warning";
240
266
  }>;
241
267
  message: z.ZodString;
242
268
  path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -298,8 +324,8 @@ export declare const tagVersionResponseSchema: z.ZodObject<{
298
324
  code: z.ZodString;
299
325
  severity: z.ZodEnum<{
300
326
  info: "info";
301
- warning: "warning";
302
327
  error: "error";
328
+ warning: "warning";
303
329
  }>;
304
330
  message: z.ZodString;
305
331
  path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -337,7 +363,7 @@ export declare const tagVersionCreateSchema: z.ZodObject<{
337
363
  variables: z.ZodDefault<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
338
364
  systemModules: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
339
365
  consentPolicy: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
340
- }, z.core.$loose>>;
366
+ }, z.core.$strict>>;
341
367
  }, z.core.$strip>;
342
368
  export declare const tagVersionPatchSchema: z.ZodObject<{
343
369
  title: z.ZodOptional<z.ZodString>;
@@ -365,7 +391,7 @@ export declare const tagGraphPutSchema: z.ZodObject<{
365
391
  variables: z.ZodDefault<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
366
392
  systemModules: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
367
393
  consentPolicy: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
368
- }, z.core.$loose>;
394
+ }, z.core.$strict>;
369
395
  }, z.core.$strip>;
370
396
  export declare const tagGraphPatchSchema: z.ZodObject<{
371
397
  baseGraphRevision: z.ZodNumber;
@@ -383,7 +409,7 @@ export declare const tagGraphPatchSchema: z.ZodObject<{
383
409
  variables: z.ZodDefault<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
384
410
  systemModules: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
385
411
  consentPolicy: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
386
- }, z.core.$loose>;
412
+ }, z.core.$strict>;
387
413
  }, z.core.$strip>>;
388
414
  }, z.core.$strip>;
389
415
  export declare const tagValidateResponseSchema: z.ZodObject<{
@@ -393,8 +419,8 @@ export declare const tagValidateResponseSchema: z.ZodObject<{
393
419
  code: z.ZodString;
394
420
  severity: z.ZodEnum<{
395
421
  info: "info";
396
- warning: "warning";
397
422
  error: "error";
423
+ warning: "warning";
398
424
  }>;
399
425
  message: z.ZodString;
400
426
  path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -614,8 +640,8 @@ export declare const tagApplyResponseSchema: z.ZodObject<{
614
640
  code: z.ZodString;
615
641
  severity: z.ZodEnum<{
616
642
  info: "info";
617
- warning: "warning";
618
643
  error: "error";
644
+ warning: "warning";
619
645
  }>;
620
646
  message: z.ZodString;
621
647
  path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -647,8 +673,8 @@ export declare const tagApplyResponseSchema: z.ZodObject<{
647
673
  code: z.ZodString;
648
674
  severity: z.ZodEnum<{
649
675
  info: "info";
650
- warning: "warning";
651
676
  error: "error";
677
+ warning: "warning";
652
678
  }>;
653
679
  message: z.ZodString;
654
680
  path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -755,6 +781,10 @@ export declare const tagTriggerPresetSchema: z.ZodEnum<{
755
781
  file_download: "file_download";
756
782
  scroll_depth: "scroll_depth";
757
783
  }>;
784
+ export declare const TAG_TEMPLATE_MAX_SELECTIONS = 256;
785
+ export declare const TAG_TEMPLATE_MAX_TRIGGERS: 5;
786
+ export declare const TAG_TEMPLATE_MAX_CONSENT_CATEGORIES: number;
787
+ export declare const TAG_TEMPLATE_MAX_ENVIRONMENTS: number;
758
788
  export type TagTriggerPreset = z.infer<typeof tagTriggerPresetSchema>;
759
789
  export declare const TAG_TRIGGER_PRESETS: Array<{
760
790
  id: TagTriggerPreset;
@@ -992,8 +1022,8 @@ export declare const tagConsentPolicyResponseSchema: z.ZodObject<{
992
1022
  code: z.ZodString;
993
1023
  severity: z.ZodEnum<{
994
1024
  info: "info";
995
- warning: "warning";
996
1025
  error: "error";
1026
+ warning: "warning";
997
1027
  }>;
998
1028
  message: z.ZodString;
999
1029
  path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -1070,7 +1100,7 @@ export declare const tagTemplateGraphSchema: z.ZodObject<{
1070
1100
  variables: z.ZodDefault<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
1071
1101
  systemModules: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1072
1102
  consentPolicy: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1073
- }, z.core.$loose>>;
1103
+ }, z.core.$strict>>;
1074
1104
  }, z.core.$strip>;
1075
1105
  export declare const TAG_TEMPLATE_DEFINITIONS: TagTemplateDefinition[];
1076
1106
  export declare function listTagTemplates(): {