@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.
Files changed (320) hide show
  1. package/brand-assets/LICENSE-Haskoy.txt +93 -0
  2. package/brand-assets/haskoy-latin-variable.woff2 +0 -0
  3. package/brand-assets/spacefast-favicon.svg +4 -4
  4. package/brand-assets/spacefast-sf-full-bleed.svg +3 -3
  5. package/brand-assets/spacefast-wordmark.svg +2 -4
  6. package/dist/agents/connect-targets.d.ts +6 -146
  7. package/dist/agents/connect-targets.js +63 -295
  8. package/dist/agents/private-key-oauth.d.ts +31 -2
  9. package/dist/agents/private-key-oauth.js +166 -92
  10. package/dist/agents/registry/core.d.ts +292 -0
  11. package/dist/agents/registry/core.js +1388 -0
  12. package/dist/agents/registry/deeplink-probes.d.ts +23 -0
  13. package/dist/agents/registry/deeplink-probes.js +18 -0
  14. package/dist/agents/registry/node.d.ts +56 -0
  15. package/dist/agents/registry/node.js +339 -0
  16. package/dist/brand-assets-build.js +3 -6
  17. package/dist/brand-assets.d.ts +5 -15
  18. package/dist/brand-assets.js +12 -14
  19. package/dist/brand.d.ts +17 -0
  20. package/dist/brand.js +24 -4
  21. package/dist/config/domains.d.ts +79 -12
  22. package/dist/config/domains.js +128 -29
  23. package/dist/config/index.js +1 -2
  24. package/dist/contracts/abuse.js +9 -24
  25. package/dist/contracts/access-profiles.d.ts +86 -0
  26. package/dist/contracts/access-profiles.js +89 -0
  27. package/dist/contracts/access.d.ts +24 -30
  28. package/dist/contracts/access.js +33 -64
  29. package/dist/contracts/activity.d.ts +18 -1
  30. package/dist/contracts/activity.js +72 -26
  31. package/dist/contracts/analytics.js +8 -10
  32. package/dist/contracts/api-keys.d.ts +77 -52
  33. package/dist/contracts/api-keys.js +44 -24
  34. package/dist/contracts/application-journal.d.ts +216 -0
  35. package/dist/contracts/application-journal.js +167 -0
  36. package/dist/contracts/auth.d.ts +90 -17
  37. package/dist/contracts/auth.js +86 -17
  38. package/dist/contracts/beta.d.ts +9 -4
  39. package/dist/contracts/beta.js +20 -16
  40. package/dist/contracts/billing.d.ts +2 -1
  41. package/dist/contracts/billing.js +37 -11
  42. package/dist/contracts/bootstrap.d.ts +791 -0
  43. package/dist/contracts/bootstrap.js +51 -0
  44. package/dist/contracts/builds.d.ts +209 -18
  45. package/dist/contracts/builds.js +93 -27
  46. package/dist/contracts/channels.d.ts +43 -0
  47. package/dist/contracts/channels.js +25 -9
  48. package/dist/contracts/cli.d.ts +7 -0
  49. package/dist/contracts/cli.js +6 -0
  50. package/dist/contracts/collab-public.d.ts +1 -1
  51. package/dist/contracts/collab-public.js +5 -8
  52. package/dist/contracts/comments.d.ts +44 -34
  53. package/dist/contracts/comments.js +107 -77
  54. package/dist/contracts/commerce.d.ts +165 -0
  55. package/dist/contracts/commerce.js +146 -0
  56. package/dist/contracts/common.d.ts +3 -3
  57. package/dist/contracts/common.js +20 -31
  58. package/dist/contracts/content-contract-verification.d.ts +521 -0
  59. package/dist/contracts/content-contract-verification.js +320 -0
  60. package/dist/contracts/content-platform-fixture.d.ts +1278 -0
  61. package/dist/contracts/content-platform-fixture.js +44 -0
  62. package/dist/contracts/content-program.d.ts +994 -0
  63. package/dist/contracts/content-program.js +658 -0
  64. package/dist/contracts/content-sync.d.ts +290 -0
  65. package/dist/contracts/content-sync.js +167 -0
  66. package/dist/contracts/content.d.ts +432 -0
  67. package/dist/contracts/content.js +303 -0
  68. package/dist/contracts/continuation.d.ts +17 -1
  69. package/dist/contracts/continuation.js +23 -23
  70. package/dist/contracts/countries.js +3 -4
  71. package/dist/contracts/crons.d.ts +52 -0
  72. package/dist/contracts/crons.js +60 -0
  73. package/dist/contracts/dashboard-prefs.d.ts +56 -0
  74. package/dist/contracts/dashboard-prefs.js +51 -0
  75. package/dist/contracts/device-auth.d.ts +234 -37
  76. package/dist/contracts/device-auth.js +267 -53
  77. package/dist/contracts/docs.d.ts +1 -5
  78. package/dist/contracts/docs.js +7 -15
  79. package/dist/contracts/domains.d.ts +501 -93
  80. package/dist/contracts/domains.js +193 -55
  81. package/dist/contracts/email-preferences.d.ts +3 -3
  82. package/dist/contracts/email-preferences.js +6 -7
  83. package/dist/contracts/enums.d.ts +27 -26
  84. package/dist/contracts/enums.js +68 -61
  85. package/dist/contracts/error-code-meta.d.ts +283 -7
  86. package/dist/contracts/error-code-meta.js +97 -5
  87. package/dist/contracts/error-codes.d.ts +5 -5
  88. package/dist/contracts/error-codes.js +82 -17
  89. package/dist/contracts/events.d.ts +100 -20
  90. package/dist/contracts/events.js +107 -20
  91. package/dist/contracts/execution.d.ts +48 -64
  92. package/dist/contracts/execution.js +52 -62
  93. package/dist/contracts/feature-lifecycle.d.ts +73 -27
  94. package/dist/contracts/feature-lifecycle.js +86 -26
  95. package/dist/contracts/features.d.ts +68 -19
  96. package/dist/contracts/features.js +42 -41
  97. package/dist/contracts/fixtures/content-platform-v1.json +1108 -0
  98. package/dist/contracts/frame-session.d.ts +192 -0
  99. package/dist/contracts/frame-session.js +164 -0
  100. package/dist/contracts/functions.d.ts +338 -164
  101. package/dist/contracts/functions.js +367 -198
  102. package/dist/contracts/git.d.ts +27 -33
  103. package/dist/contracts/git.js +10 -11
  104. package/dist/contracts/grant-copy.d.ts +43 -0
  105. package/dist/contracts/grant-copy.js +44 -0
  106. package/dist/contracts/grants.d.ts +62 -54
  107. package/dist/contracts/grants.js +124 -23
  108. package/dist/contracts/ids.d.ts +4 -1
  109. package/dist/contracts/ids.js +6 -3
  110. package/dist/contracts/internal.d.ts +8 -18
  111. package/dist/contracts/internal.js +13 -14
  112. package/dist/contracts/mcp.d.ts +28 -0
  113. package/dist/contracts/mcp.js +28 -0
  114. package/dist/contracts/me.d.ts +6 -1
  115. package/dist/contracts/me.js +12 -6
  116. package/dist/contracts/notifications.d.ts +27 -29
  117. package/dist/contracts/notifications.js +9 -4
  118. package/dist/contracts/oauth-resources.d.ts +112 -10
  119. package/dist/contracts/oauth-resources.js +116 -11
  120. package/dist/contracts/oauth-scope-actions.d.ts +90 -0
  121. package/dist/contracts/oauth-scope-actions.js +126 -0
  122. package/dist/contracts/operations.d.ts +27 -4
  123. package/dist/contracts/operations.js +12 -6
  124. package/dist/contracts/pages.d.ts +31 -7
  125. package/dist/contracts/pages.js +22 -5
  126. package/dist/contracts/partner-notifications.d.ts +3 -0
  127. package/dist/contracts/partner-notifications.js +65 -0
  128. package/dist/contracts/{platform.d.ts → partner.d.ts} +29 -42
  129. package/dist/contracts/{platform.js → partner.js} +27 -40
  130. package/dist/contracts/plan-policy.js +1 -1
  131. package/dist/contracts/principal-assertion.d.ts +43 -0
  132. package/dist/contracts/principal-assertion.js +67 -0
  133. package/dist/contracts/principals.d.ts +73 -0
  134. package/dist/contracts/principals.js +59 -0
  135. package/dist/contracts/privacy.d.ts +11 -0
  136. package/dist/contracts/privacy.js +17 -0
  137. package/dist/contracts/problem-document.js +3 -4
  138. package/dist/contracts/publish-archive.d.ts +269 -161
  139. package/dist/contracts/publish-archive.js +11 -1
  140. package/dist/contracts/push-new.d.ts +8 -8
  141. package/dist/contracts/quotas.js +5 -5
  142. package/dist/contracts/realtime.d.ts +52 -0
  143. package/dist/contracts/realtime.js +54 -0
  144. package/dist/contracts/repository-connections.d.ts +44 -31
  145. package/dist/contracts/repository-connections.js +17 -5
  146. package/dist/contracts/resources.d.ts +105 -14
  147. package/dist/contracts/resources.js +150 -26
  148. package/dist/contracts/route-inventory.d.ts +358 -0
  149. package/dist/contracts/route-inventory.js +141 -0
  150. package/dist/contracts/runtime-api.d.ts +206 -82
  151. package/dist/contracts/runtime-api.js +131 -70
  152. package/dist/contracts/runtime-app.d.ts +13 -23
  153. package/dist/contracts/runtime-app.js +39 -24
  154. package/dist/contracts/runtime-components.d.ts +143 -0
  155. package/dist/contracts/runtime-components.js +199 -0
  156. package/dist/contracts/runtime-db.d.ts +49 -23
  157. package/dist/contracts/runtime-db.js +87 -22
  158. package/dist/contracts/runtime-purge.d.ts +8 -0
  159. package/dist/contracts/runtime-purge.js +5 -0
  160. package/dist/contracts/runtime-services.d.ts +43 -75
  161. package/dist/contracts/runtime-services.js +29 -49
  162. package/dist/contracts/runtime-storage.d.ts +15 -14
  163. package/dist/contracts/runtime-storage.js +30 -14
  164. package/dist/contracts/sf-config-v1.d.ts +48 -14
  165. package/dist/contracts/slugs.js +13 -4
  166. package/dist/contracts/space-config.d.ts +283 -19
  167. package/dist/contracts/space-config.js +430 -80
  168. package/dist/contracts/spaces.d.ts +376 -290
  169. package/dist/contracts/spaces.js +200 -135
  170. package/dist/contracts/superadmin-activity.d.ts +3 -43
  171. package/dist/contracts/superadmin-activity.js +6 -30
  172. package/dist/contracts/superadmin-emails.d.ts +1 -0
  173. package/dist/contracts/superadmin-emails.js +17 -1
  174. package/dist/contracts/superadmin-runtime.d.ts +199 -0
  175. package/dist/contracts/superadmin-runtime.js +141 -0
  176. package/dist/contracts/superadmin-search.d.ts +22 -2
  177. package/dist/contracts/superadmin-search.js +14 -6
  178. package/dist/contracts/superadmin-spaces.d.ts +438 -189
  179. package/dist/contracts/superadmin-spaces.js +131 -25
  180. package/dist/contracts/superadmin-teams.d.ts +5 -2
  181. package/dist/contracts/superadmin-teams.js +1 -2
  182. package/dist/contracts/superadmin-tenants.d.ts +627 -12
  183. package/dist/contracts/superadmin-tenants.js +32 -13
  184. package/dist/contracts/superadmin.d.ts +232 -37
  185. package/dist/contracts/superadmin.js +106 -22
  186. package/dist/contracts/tags.d.ts +85 -58
  187. package/dist/contracts/tags.js +47 -37
  188. package/dist/contracts/teams.d.ts +86 -26
  189. package/dist/contracts/teams.js +90 -31
  190. package/dist/contracts/tenants.d.ts +135 -0
  191. package/dist/contracts/tenants.js +120 -0
  192. package/dist/contracts/test-triggers.d.ts +70 -0
  193. package/dist/contracts/test-triggers.js +116 -0
  194. package/dist/contracts/theme-json.js +3 -8
  195. package/dist/contracts/transfers.d.ts +1 -0
  196. package/dist/contracts/transfers.js +3 -2
  197. package/dist/contracts/usage.d.ts +209 -0
  198. package/dist/contracts/usage.js +124 -12
  199. package/dist/contracts/variables.d.ts +2 -2
  200. package/dist/contracts/variables.js +9 -13
  201. package/dist/contracts/webhooks.d.ts +13 -5
  202. package/dist/contracts/webhooks.js +3 -1
  203. package/dist/contracts/zero.d.ts +72 -81
  204. package/dist/contracts/zero.js +80 -78
  205. package/dist/dashboard-paths/index.d.ts +24 -21
  206. package/dist/dashboard-paths/index.js +35 -47
  207. package/dist/dashboard-paths/route-reservations.generated.d.ts +2 -0
  208. package/dist/dashboard-paths/route-reservations.generated.js +36 -0
  209. package/dist/docs/agent-arrival.d.ts +92 -0
  210. package/dist/docs/agent-arrival.js +227 -0
  211. package/dist/docs/agent-output-policy.d.ts +6 -0
  212. package/dist/docs/agent-output-policy.js +22 -0
  213. package/dist/docs/agent-prose.d.ts +12 -18
  214. package/dist/docs/agent-prose.js +73 -51
  215. package/dist/docs/agent-setup.d.ts +72 -41
  216. package/dist/docs/agent-setup.js +339 -436
  217. package/dist/docs/catalog.d.ts +153 -95
  218. package/dist/docs/catalog.js +163 -48
  219. package/dist/docs/error-docs.d.ts +2098 -1
  220. package/dist/docs/error-docs.js +421 -144
  221. package/dist/docs/index-build.d.ts +0 -1
  222. package/dist/docs/index-build.js +2 -3
  223. package/dist/docs/page-context-prompt.d.ts +77 -0
  224. package/dist/docs/page-context-prompt.js +131 -0
  225. package/dist/docs/reference-urls.d.ts +46 -0
  226. package/dist/docs/reference-urls.js +79 -0
  227. package/dist/docs/search.d.ts +6 -8
  228. package/dist/docs/search.js +10 -13
  229. package/dist/docs/skill-distribution.d.ts +4 -1
  230. package/dist/docs/skill-distribution.js +10 -5
  231. package/dist/docs/skills.d.ts +120 -120
  232. package/dist/docs/skills.js +121 -73
  233. package/dist/docs/start-prompts.d.ts +45 -0
  234. package/dist/docs/start-prompts.js +62 -0
  235. package/dist/domain-exploration.js +9 -13
  236. package/dist/og-template.d.ts +56 -0
  237. package/dist/og-template.js +56 -0
  238. package/dist/slug-policy/index.js +5 -11
  239. package/dist/test-helpers/fetch-stub.js +1 -0
  240. package/dist/utils/browser-credential.d.ts +13 -6
  241. package/dist/utils/browser-credential.js +14 -7
  242. package/dist/utils/build-settings.d.ts +21 -1
  243. package/dist/utils/build-settings.js +133 -15
  244. package/dist/utils/canonical-json.d.ts +3 -5
  245. package/dist/utils/canonical-json.js +4 -5
  246. package/dist/utils/cast-transport.d.ts +5 -17
  247. package/dist/utils/cast-transport.js +6 -19
  248. package/dist/utils/claim-token.js +1 -2
  249. package/dist/utils/comment-avatars.js +4 -6
  250. package/dist/utils/concurrency.js +3 -3
  251. package/dist/utils/content-type.d.ts +7 -6
  252. package/dist/utils/content-type.js +73 -51
  253. package/dist/utils/credential-policy.d.ts +50 -6
  254. package/dist/utils/credential-policy.js +126 -59
  255. package/dist/utils/dns-instructions.js +9 -9
  256. package/dist/utils/egress-policy.fixtures.json +1 -1
  257. package/dist/utils/error-code.js +1 -0
  258. package/dist/utils/generate-space-name.d.ts +3 -8
  259. package/dist/utils/generate-space-name.js +3 -8
  260. package/dist/utils/grant-decision.fixtures.json +2 -2
  261. package/dist/utils/grants.d.ts +0 -1
  262. package/dist/utils/grants.js +7 -8
  263. package/dist/utils/gravatar.d.ts +2 -4
  264. package/dist/utils/gravatar.js +6 -12
  265. package/dist/utils/id-hints.js +14 -23
  266. package/dist/utils/idempotency.d.ts +3 -3
  267. package/dist/utils/idempotency.js +6 -7
  268. package/dist/utils/local-space-state.d.ts +23 -26
  269. package/dist/utils/local-space-state.js +46 -46
  270. package/dist/utils/oauth-signed-query.d.ts +3 -5
  271. package/dist/utils/oauth-signed-query.js +6 -9
  272. package/dist/utils/one-shot-replay.d.ts +7 -6
  273. package/dist/utils/one-shot-replay.js +3 -5
  274. package/dist/utils/page-colors.d.ts +15 -19
  275. package/dist/utils/page-colors.js +23 -45
  276. package/dist/utils/page-fonts.d.ts +1 -1
  277. package/dist/utils/page-fonts.js +8 -20
  278. package/dist/utils/page-preview.d.ts +0 -1
  279. package/dist/utils/page-preview.js +0 -1
  280. package/dist/utils/pages.d.ts +33 -3
  281. package/dist/utils/pages.js +83 -30
  282. package/dist/utils/privacy-regions.d.ts +19 -0
  283. package/dist/utils/privacy-regions.js +91 -0
  284. package/dist/utils/publish-form-data.d.ts +4 -5
  285. package/dist/utils/publish-form-data.js +2 -3
  286. package/dist/utils/publish-policy.d.ts +11 -17
  287. package/dist/utils/publish-policy.fixtures.json +11 -5
  288. package/dist/utils/publish-policy.js +65 -110
  289. package/dist/utils/query-client.d.ts +2 -0
  290. package/dist/utils/query-client.js +10 -1
  291. package/dist/utils/runtime-paths.d.ts +4 -4
  292. package/dist/utils/runtime-paths.js +6 -8
  293. package/dist/utils/runtime-upload.d.ts +9 -0
  294. package/dist/utils/runtime-upload.js +12 -0
  295. package/dist/utils/secure-local-file.d.ts +3 -3
  296. package/dist/utils/secure-local-file.js +23 -40
  297. package/dist/utils/space-config.d.ts +12 -15
  298. package/dist/utils/space-config.js +13 -16
  299. package/dist/utils/static-runtime-policy.d.ts +10 -7
  300. package/dist/utils/static-runtime-policy.fixtures.json +38 -41
  301. package/dist/utils/static-runtime-policy.generated.d.ts +16 -0
  302. package/dist/utils/static-runtime-policy.generated.js +70 -0
  303. package/dist/utils/static-runtime-policy.js +31 -132
  304. package/dist/utils/storage-policy.js +1 -2
  305. package/dist/utils/upload-session.d.ts +4 -1
  306. package/dist/utils/upload-session.js +41 -19
  307. package/dist/utils/version-path.js +11 -19
  308. package/dist/utils/wpcom-auth-redirects.d.ts +5 -14
  309. package/dist/utils/wpcom-auth-redirects.js +1 -4
  310. package/dist/vocabulary.d.ts +13 -13
  311. package/dist/vocabulary.js +52 -27
  312. package/package.json +15 -18
  313. package/dist/agents/client-registry.d.ts +0 -22
  314. package/dist/agents/client-registry.js +0 -41
  315. package/dist/docs/agent-handoff-document.d.ts +0 -15
  316. package/dist/docs/agent-handoff-document.js +0 -180
  317. package/dist/docs/agent-solutions.d.ts +0 -110
  318. package/dist/docs/agent-solutions.js +0 -183
  319. package/dist/utils/query-keys.d.ts +0 -84
  320. package/dist/utils/query-keys.js +0 -108
@@ -0,0 +1,116 @@
1
+ // Reserved trigger values ("magic inputs") for LINKED TEST TENANTS
2
+ // (partner-operations spec §1 "Test mode", L31-34). Stripe models test-mode
3
+ // failures with magic inputs — a card number like `4000000000000341` that a
4
+ // LIVE charge treats as an ordinary (invalid) number but a TEST charge turns
5
+ // into a specific decline. We do the same for the partner API: a partner puts a
6
+ // reserved token into the NATURAL input of an existing operation and, on a TEST
7
+ // tenant only, that operation produces a specific failure state instead of
8
+ // succeeding. There is NO new route and NO new field — a trigger is an ordinary
9
+ // input value the caller already controls.
10
+ //
11
+ // The catalog itself is `TEST_TRIGGER_META` below — token, carrier and effect
12
+ // per trigger, in one record, so the published API documentation renders from
13
+ // the same data the detector matches on rather than a prose copy of it.
14
+ //
15
+ // The tokens carry a `sf-sim-` prefix so they are implausible as an organic name
16
+ // and are valid across every carrier (a DNS label, a URL hostname, a slug, and a
17
+ // principal id are all lowercase-hyphen-safe). A LIVE tenant treats the very same
18
+ // value as ordinary input — the gate is `mode === "test"`, applied by every
19
+ // interpreting call site (see `resolveTestTrigger`).
20
+ //
21
+ // FIDELITY (spec caveat): the `rate_limit` trigger FABRICATES a 429 problem
22
+ // document — the partner-API rate limiter of ops §8 does not exist yet, so this
23
+ // simulates the response a real limiter would return, not a real limiter. The
24
+ // domain/TLS triggers synthesize provider (wp.cloud) SSL-info responses through
25
+ // the simulated driver; there is no real DNS/cert in test mode.
26
+ import { z } from "zod";
27
+ export const testTriggerValues = [
28
+ "build_failure",
29
+ "domain_verification_pending",
30
+ "domain_verification_failed",
31
+ "tls_failure",
32
+ "rate_limit",
33
+ "webhook_retry",
34
+ "principal_suspension",
35
+ "usage_correction",
36
+ ];
37
+ export const testTrigger = z.enum(testTriggerValues);
38
+ /**
39
+ * Every trigger, in one record: the reserved token, the input that carries it,
40
+ * and what a test tenant gets instead of success.
41
+ *
42
+ * `carrier` and `effect` are contract text, not commentary — the partner API
43
+ * document renders its trigger table straight from them, so a renamed token or
44
+ * a new trigger cannot leave the published contract describing something else.
45
+ *
46
+ * No token is a substring of another, so a plain `includes` scan is unambiguous.
47
+ * Keep them lowercase — the detector lowercases the input, and every carrier (a
48
+ * DNS label, a slug, a principal id) is compared case-insensitively.
49
+ */
50
+ export const TEST_TRIGGER_META = {
51
+ build_failure: {
52
+ sentinel: "sf-sim-build-fail",
53
+ carrier: "space slug",
54
+ effect: "the space's next build fails",
55
+ },
56
+ domain_verification_pending: {
57
+ sentinel: "sf-sim-domain-pending",
58
+ carrier: "custom domain name",
59
+ effect: "domain verification stays pending",
60
+ },
61
+ domain_verification_failed: {
62
+ sentinel: "sf-sim-domain-fail",
63
+ carrier: "custom domain name",
64
+ effect: "domain verification fails",
65
+ },
66
+ tls_failure: {
67
+ sentinel: "sf-sim-tls-fail",
68
+ carrier: "custom domain name",
69
+ effect: "certificate issuance fails",
70
+ },
71
+ rate_limit: {
72
+ sentinel: "sf-sim-rate-limit",
73
+ carrier: "space slug (on create)",
74
+ effect: "the create returns 429 `rate_limited`",
75
+ },
76
+ webhook_retry: {
77
+ sentinel: "sf-sim-webhook-retry",
78
+ carrier: "webhook URL",
79
+ effect: "delivery fails and enters the retry schedule",
80
+ },
81
+ principal_suspension: {
82
+ sentinel: "sf-sim-suspend",
83
+ carrier: "external principal id",
84
+ effect: "the principal is suspended",
85
+ },
86
+ usage_correction: {
87
+ sentinel: "sf-sim-usage-correction",
88
+ carrier: "space slug",
89
+ effect: "the next settled usage sample appends a linked correction",
90
+ },
91
+ };
92
+ // Return the trigger whose reserved token appears in `input`, or null. Carrier-
93
+ // agnostic: `input` may be a slug, a hostname, a URL, or a principal id. The
94
+ // token may be the whole value or a label within it (`sf-sim-tls-fail.acme.dev`).
95
+ // This does NOT gate on mode — it is pure detection; `resolveTestTrigger` adds
96
+ // the test-tenant gate.
97
+ export function detectTestTrigger(input) {
98
+ if (!input)
99
+ return null;
100
+ const haystack = input.toLowerCase();
101
+ for (const trigger of testTriggerValues) {
102
+ if (haystack.includes(TEST_TRIGGER_META[trigger].sentinel))
103
+ return trigger;
104
+ }
105
+ return null;
106
+ }
107
+ // The one gate every interpreting call site shares: a trigger fires ONLY for a
108
+ // `mode === "test"` tenant. A live tenant (or any non-test mode) always resolves
109
+ // null, so the same input flows through the ordinary path — the no-leak-to-live
110
+ // guarantee, in one place. `mode` is the owning tenant's mode (a `TenantMode`, or
111
+ // the raw `tenants.mode` string).
112
+ export function resolveTestTrigger(mode, input) {
113
+ if (mode !== "test")
114
+ return null;
115
+ return detectTestTrigger(input);
116
+ }
@@ -1,13 +1,8 @@
1
1
  import { z } from "zod";
2
2
  // WordPress `theme.json`-compatible subset used only to infer Pages tokens.
3
- // Real WP theme.json carries dozens of unrelated keys (layout, blocks,
4
- // customTemplates, styles, ...); this schema accepts the file as a loose
5
- // object (`.passthrough()`) and only validates the two branches Pages
6
- // actually consume: `settings.color.palette` and
7
- // `settings.typography.fontFamilies`. Everything else rides through
8
- // unvalidated and is simply never read — this is not a reimplementation of
9
- // WP_Theme_JSON, just the safe slice that reaches presentation-only gate
10
- // pages.
3
+ // The file is accepted as a loose object; only `settings.color.palette` and
4
+ // `settings.typography.fontFamilies` are validated. Every other WP key rides
5
+ // through unvalidated and is never read.
11
6
  const presetSlug = z
12
7
  .string()
13
8
  .min(1)
@@ -16,6 +16,7 @@ export declare const transferPrincipalSchema: z.ZodObject<{
16
16
  tenantId: z.ZodString;
17
17
  }, z.core.$strip>;
18
18
  export declare const spaceTransferCreateSchema: z.ZodObject<{
19
+ spaceId: z.ZodString;
19
20
  to: z.ZodObject<{
20
21
  principalType: z.ZodEnum<{
21
22
  team: "team";
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import { spaceTransferStatus } from "./enums.js";
3
- // Tenant-local external principal id grammar (internal-docs/platform.md
3
+ // Tenant-local external principal id grammar (the platform spec
4
4
  // "Principal"): 1-256 chars, no whitespace, no `/` or `\`, no
5
5
  // control/non-printable characters. Team principal ids are Better Auth team
6
6
  // ids and trivially satisfy the same grammar.
@@ -15,7 +15,7 @@ export const principalIdSchema = z
15
15
  }))
16
16
  .describe("Tenant-local principal id: a team id or an integrator external customer id.");
17
17
  // Request `to` omits tenantId: transfers are tenant-local and the tenant is
18
- // inferred from the space (internal-docs/platform.md "Transfer semantics").
18
+ // inferred from the space (the platform spec "Transfer semantics").
19
19
  export const transferPrincipalInputSchema = z.object({
20
20
  principalType: z
21
21
  .enum(["team", "external"])
@@ -27,6 +27,7 @@ export const transferPrincipalSchema = transferPrincipalInputSchema.extend({
27
27
  tenantId: z.string().min(1).describe("Tenant both transfer parties live in."),
28
28
  });
29
29
  export const spaceTransferCreateSchema = z.object({
30
+ spaceId: z.string().min(1).describe("Space to transfer (`spc_`)."),
30
31
  to: transferPrincipalInputSchema.describe("Receiving principal. Must live in the space's tenant; cross-tenant transfers are unsupported."),
31
32
  });
32
33
  export const spaceTransferSchema = z.object({
@@ -59,3 +59,212 @@ export declare const functionUsagePushSchema: z.ZodObject<{
59
59
  observedAt: z.ZodString;
60
60
  }, z.core.$strip>;
61
61
  export type FunctionUsagePush = z.infer<typeof functionUsagePushSchema>;
62
+ export declare const USAGE_DIMENSIONS: readonly ["data_transfer_bytes", "served_requests", "stored_byte_hours", "build_minutes", "build_count", "custom_domain_days", "space_days"];
63
+ export declare const usageDimensionSchema: z.ZodEnum<{
64
+ data_transfer_bytes: "data_transfer_bytes";
65
+ served_requests: "served_requests";
66
+ stored_byte_hours: "stored_byte_hours";
67
+ build_minutes: "build_minutes";
68
+ build_count: "build_count";
69
+ custom_domain_days: "custom_domain_days";
70
+ space_days: "space_days";
71
+ }>;
72
+ export type UsageDimension = z.infer<typeof usageDimensionSchema>;
73
+ export declare const usageQuantitySchema: z.ZodString;
74
+ export declare const usageRecordSchema: z.ZodObject<{
75
+ usageRecordId: z.ZodString;
76
+ tenantId: z.ZodString;
77
+ principalType: z.ZodEnum<{
78
+ team: "team";
79
+ external: "external";
80
+ }>;
81
+ principalId: z.ZodString;
82
+ spaceId: z.ZodNullable<z.ZodString>;
83
+ bucketStart: z.ZodString;
84
+ bucketEnd: z.ZodString;
85
+ region: z.ZodNullable<z.ZodString>;
86
+ mode: z.ZodEnum<{
87
+ live: "live";
88
+ test: "test";
89
+ }>;
90
+ dimension: z.ZodEnum<{
91
+ data_transfer_bytes: "data_transfer_bytes";
92
+ served_requests: "served_requests";
93
+ stored_byte_hours: "stored_byte_hours";
94
+ build_minutes: "build_minutes";
95
+ build_count: "build_count";
96
+ custom_domain_days: "custom_domain_days";
97
+ space_days: "space_days";
98
+ }>;
99
+ measuredQuantity: z.ZodString;
100
+ billableQuantity: z.ZodString;
101
+ state: z.ZodEnum<{
102
+ final: "final";
103
+ estimated: "estimated";
104
+ }>;
105
+ corrects: z.ZodNullable<z.ZodString>;
106
+ correlationId: z.ZodNullable<z.ZodString>;
107
+ createdAt: z.ZodString;
108
+ }, z.core.$strict>;
109
+ export type UsageLedgerRecord = z.infer<typeof usageRecordSchema>;
110
+ export declare const usageListQuerySchema: z.ZodObject<{
111
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
112
+ cursor: z.ZodOptional<z.ZodString>;
113
+ from: z.ZodOptional<z.ZodString>;
114
+ to: z.ZodOptional<z.ZodString>;
115
+ principalId: z.ZodOptional<z.ZodString>;
116
+ spaceId: z.ZodOptional<z.ZodString>;
117
+ dimension: z.ZodOptional<z.ZodEnum<{
118
+ data_transfer_bytes: "data_transfer_bytes";
119
+ served_requests: "served_requests";
120
+ stored_byte_hours: "stored_byte_hours";
121
+ build_minutes: "build_minutes";
122
+ build_count: "build_count";
123
+ custom_domain_days: "custom_domain_days";
124
+ space_days: "space_days";
125
+ }>>;
126
+ granularity: z.ZodDefault<z.ZodLiteral<"hour">>;
127
+ }, z.core.$strict>;
128
+ export type UsageListQuery = z.infer<typeof usageListQuerySchema>;
129
+ export declare const usageListResponseSchema: z.ZodObject<{
130
+ data: z.ZodArray<z.ZodObject<{
131
+ usageRecordId: z.ZodString;
132
+ tenantId: z.ZodString;
133
+ principalType: z.ZodEnum<{
134
+ team: "team";
135
+ external: "external";
136
+ }>;
137
+ principalId: z.ZodString;
138
+ spaceId: z.ZodNullable<z.ZodString>;
139
+ bucketStart: z.ZodString;
140
+ bucketEnd: z.ZodString;
141
+ region: z.ZodNullable<z.ZodString>;
142
+ mode: z.ZodEnum<{
143
+ live: "live";
144
+ test: "test";
145
+ }>;
146
+ dimension: z.ZodEnum<{
147
+ data_transfer_bytes: "data_transfer_bytes";
148
+ served_requests: "served_requests";
149
+ stored_byte_hours: "stored_byte_hours";
150
+ build_minutes: "build_minutes";
151
+ build_count: "build_count";
152
+ custom_domain_days: "custom_domain_days";
153
+ space_days: "space_days";
154
+ }>;
155
+ measuredQuantity: z.ZodString;
156
+ billableQuantity: z.ZodString;
157
+ state: z.ZodEnum<{
158
+ final: "final";
159
+ estimated: "estimated";
160
+ }>;
161
+ corrects: z.ZodNullable<z.ZodString>;
162
+ correlationId: z.ZodNullable<z.ZodString>;
163
+ createdAt: z.ZodString;
164
+ }, z.core.$strict>>;
165
+ pagination: z.ZodObject<{
166
+ nextCursor: z.ZodNullable<z.ZodString>;
167
+ hasMore: z.ZodBoolean;
168
+ }, z.core.$strip>;
169
+ }, z.core.$strip>;
170
+ export declare const usagePeriodTotalsSchema: z.ZodObject<{
171
+ data_transfer_bytes: z.ZodOptional<z.ZodString>;
172
+ served_requests: z.ZodOptional<z.ZodString>;
173
+ stored_byte_hours: z.ZodOptional<z.ZodString>;
174
+ build_minutes: z.ZodOptional<z.ZodString>;
175
+ build_count: z.ZodOptional<z.ZodString>;
176
+ custom_domain_days: z.ZodOptional<z.ZodString>;
177
+ space_days: z.ZodOptional<z.ZodString>;
178
+ }, z.core.$strict>;
179
+ export declare const usagePeriodSchema: z.ZodObject<{
180
+ id: z.ZodString;
181
+ tenantId: z.ZodString;
182
+ mode: z.ZodEnum<{
183
+ live: "live";
184
+ test: "test";
185
+ }>;
186
+ periodStart: z.ZodString;
187
+ periodEnd: z.ZodString;
188
+ status: z.ZodEnum<{
189
+ final: "final";
190
+ open: "open";
191
+ }>;
192
+ totals: z.ZodObject<{
193
+ data_transfer_bytes: z.ZodOptional<z.ZodString>;
194
+ served_requests: z.ZodOptional<z.ZodString>;
195
+ stored_byte_hours: z.ZodOptional<z.ZodString>;
196
+ build_minutes: z.ZodOptional<z.ZodString>;
197
+ build_count: z.ZodOptional<z.ZodString>;
198
+ custom_domain_days: z.ZodOptional<z.ZodString>;
199
+ space_days: z.ZodOptional<z.ZodString>;
200
+ }, z.core.$strict>;
201
+ checksum: z.ZodNullable<z.ZodString>;
202
+ finalizedAt: z.ZodNullable<z.ZodString>;
203
+ }, z.core.$strict>;
204
+ export type UsagePeriod = z.infer<typeof usagePeriodSchema>;
205
+ export declare const usagePeriodListQuerySchema: z.ZodObject<{
206
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
207
+ cursor: z.ZodOptional<z.ZodString>;
208
+ mode: z.ZodOptional<z.ZodEnum<{
209
+ live: "live";
210
+ test: "test";
211
+ }>>;
212
+ }, z.core.$strict>;
213
+ export declare const usagePeriodListResponseSchema: z.ZodObject<{
214
+ data: z.ZodArray<z.ZodObject<{
215
+ id: z.ZodString;
216
+ tenantId: z.ZodString;
217
+ mode: z.ZodEnum<{
218
+ live: "live";
219
+ test: "test";
220
+ }>;
221
+ periodStart: z.ZodString;
222
+ periodEnd: z.ZodString;
223
+ status: z.ZodEnum<{
224
+ final: "final";
225
+ open: "open";
226
+ }>;
227
+ totals: z.ZodObject<{
228
+ data_transfer_bytes: z.ZodOptional<z.ZodString>;
229
+ served_requests: z.ZodOptional<z.ZodString>;
230
+ stored_byte_hours: z.ZodOptional<z.ZodString>;
231
+ build_minutes: z.ZodOptional<z.ZodString>;
232
+ build_count: z.ZodOptional<z.ZodString>;
233
+ custom_domain_days: z.ZodOptional<z.ZodString>;
234
+ space_days: z.ZodOptional<z.ZodString>;
235
+ }, z.core.$strict>;
236
+ checksum: z.ZodNullable<z.ZodString>;
237
+ finalizedAt: z.ZodNullable<z.ZodString>;
238
+ }, z.core.$strict>>;
239
+ pagination: z.ZodObject<{
240
+ nextCursor: z.ZodNullable<z.ZodString>;
241
+ hasMore: z.ZodBoolean;
242
+ }, z.core.$strip>;
243
+ }, z.core.$strip>;
244
+ export declare const usagePeriodResponseSchema: z.ZodObject<{
245
+ data: z.ZodObject<{
246
+ id: z.ZodString;
247
+ tenantId: z.ZodString;
248
+ mode: z.ZodEnum<{
249
+ live: "live";
250
+ test: "test";
251
+ }>;
252
+ periodStart: z.ZodString;
253
+ periodEnd: z.ZodString;
254
+ status: z.ZodEnum<{
255
+ final: "final";
256
+ open: "open";
257
+ }>;
258
+ totals: z.ZodObject<{
259
+ data_transfer_bytes: z.ZodOptional<z.ZodString>;
260
+ served_requests: z.ZodOptional<z.ZodString>;
261
+ stored_byte_hours: z.ZodOptional<z.ZodString>;
262
+ build_minutes: z.ZodOptional<z.ZodString>;
263
+ build_count: z.ZodOptional<z.ZodString>;
264
+ custom_domain_days: z.ZodOptional<z.ZodString>;
265
+ space_days: z.ZodOptional<z.ZodString>;
266
+ }, z.core.$strict>;
267
+ checksum: z.ZodNullable<z.ZodString>;
268
+ finalizedAt: z.ZodNullable<z.ZodString>;
269
+ }, z.core.$strict>;
270
+ }, z.core.$strip>;
@@ -1,19 +1,16 @@
1
1
  import { z } from "zod";
2
+ import { CursorPaginationSchema, cursorListQuerySchema } from "./common.js";
2
3
  /**
3
4
  * Resolutions the hosting provider keeps usage at. Hour is retained about a
4
5
  * week, day about two months, month about two years.
5
6
  */
6
7
  export const USAGE_RESOLUTIONS = ["hour", "day", "month"];
7
8
  export const usageResolutionSchema = z.enum(USAGE_RESOLUTIONS);
8
- // Served by `GET /v1/spaces/{spaceId}/usage`: what one Space actually consumed,
9
- // measured by the infrastructure that served it rather than derived from what
10
- // was published.
9
+ // Served by `GET /v1/spaces/{spaceId}/usage`: what one Space consumed, measured
10
+ // by the infrastructure that served it.
11
11
  //
12
- // Every number here is a MEASUREMENT OF A PAST PERIOD, not a live gauge, and the
13
- // contract says so out loud: `period` is the window measured and `sampledAt` is
14
- // when we last asked. Nothing in this response means "right now". The meter
15
- // behind it is a time series with real ingestion delay, so a reading is only
16
- // trusted once its period has settled — expect the period to end an hour or so
12
+ // Every number measures a past period, never "right now". The meter behind it
13
+ // has real ingestion delay, so expect the measured period to end an hour or so
17
14
  // before you read it.
18
15
  export const spaceUsageMeasurementSchema = z.object({
19
16
  period: z
@@ -47,12 +44,11 @@ export const spaceUsageResponseSchema = z.object({
47
44
  spaceId: z.string().describe("The space the usage was measured for."),
48
45
  usage: spaceUsageMeasurementSchema
49
46
  .nullable()
50
- .describe("Null when this space has never been measured a space that has not served yet, or one whose first measurement period has not settled."),
47
+ .describe("Null when this space has never been measured, either because it has not served yet or because its first measurement period has not settled."),
51
48
  });
52
49
  // Posted by the Functions host's tail Worker after an isolate finishes serving.
53
- // Counts only never messages. Function LOGS travel a different path, into the
54
- // space's own log stream, and merging the two would quietly turn this into a
55
- // second log pipeline.
50
+ // Counts only, never messages. Function logs travel a different path, into the
51
+ // space's own log stream.
56
52
  export const functionUsagePushSchema = z.object({
57
53
  spaceId: z.string().min(1).describe("The space whose functions ran."),
58
54
  versionId: z.string().min(1).describe("The version whose bundle served the requests."),
@@ -62,3 +58,119 @@ export const functionUsagePushSchema = z.object({
62
58
  .string()
63
59
  .describe("The reporter's clock at delivery. The control plane buckets by hour on receipt."),
64
60
  });
61
+ export const USAGE_DIMENSIONS = [
62
+ "data_transfer_bytes",
63
+ "served_requests",
64
+ "stored_byte_hours",
65
+ "build_minutes",
66
+ "build_count",
67
+ "custom_domain_days",
68
+ "space_days",
69
+ ];
70
+ export const usageDimensionSchema = z
71
+ .enum(USAGE_DIMENSIONS)
72
+ .describe("Meter that produced this usage record.");
73
+ export const usageQuantitySchema = z
74
+ .string()
75
+ .regex(/^-?[0-9]+$/)
76
+ .describe("Signed integer quantity in the dimension's normalized unit.");
77
+ export const usageRecordSchema = z
78
+ .object({
79
+ usageRecordId: z.string().describe("Immutable usage record id."),
80
+ tenantId: z.string().describe("Tenant that owns the charge."),
81
+ principalType: z.enum(["external", "team"]).describe("Principal type for attribution."),
82
+ principalId: z.string().describe("Stable principal id for attribution."),
83
+ spaceId: z.string().nullable().describe("Space that produced the usage, when applicable."),
84
+ bucketStart: z.string().datetime().describe("Start of the UTC measurement bucket."),
85
+ bucketEnd: z.string().datetime().describe("End of the UTC measurement bucket."),
86
+ region: z.string().nullable().describe("Serving region that measured the usage."),
87
+ mode: z.enum(["live", "test"]).describe("Tenant mode that produced the usage."),
88
+ dimension: usageDimensionSchema,
89
+ measuredQuantity: usageQuantitySchema.describe("Quantity the meter observed."),
90
+ billableQuantity: usageQuantitySchema.describe("Quantity billed after included usage and credits. Test usage is always zero."),
91
+ state: z.enum(["estimated", "final"]).describe("Whether the measurement can still settle."),
92
+ corrects: z
93
+ .string()
94
+ .nullable()
95
+ .describe("Earlier usage record corrected by this append-only record."),
96
+ correlationId: z
97
+ .string()
98
+ .nullable()
99
+ .describe("Request or event id that caused this usage, when applicable."),
100
+ createdAt: z.string().datetime().describe("Time the ledger appended this record."),
101
+ })
102
+ .strict()
103
+ .describe("One immutable usage ledger record.");
104
+ export const usageListQuerySchema = cursorListQuerySchema
105
+ .extend({
106
+ from: z.string().datetime().optional().describe("Include buckets that end after this instant."),
107
+ to: z
108
+ .string()
109
+ .datetime()
110
+ .optional()
111
+ .describe("Include buckets that start before this instant."),
112
+ principalId: z
113
+ .string()
114
+ .trim()
115
+ .min(1)
116
+ .max(255)
117
+ .optional()
118
+ .describe("Return only records billed to this external principal."),
119
+ spaceId: z
120
+ .string()
121
+ .trim()
122
+ .min(1)
123
+ .max(64)
124
+ .optional()
125
+ .describe("Return only records for this space."),
126
+ dimension: usageDimensionSchema.optional(),
127
+ granularity: z
128
+ .literal("hour")
129
+ .default("hour")
130
+ .describe("Ledger bucket granularity. Version 1 records hourly buckets."),
131
+ })
132
+ .strict();
133
+ export const usageListResponseSchema = z.object({
134
+ data: z.array(usageRecordSchema),
135
+ pagination: CursorPaginationSchema,
136
+ });
137
+ export const usagePeriodTotalsSchema = z
138
+ .object({
139
+ data_transfer_bytes: usageQuantitySchema.optional(),
140
+ served_requests: usageQuantitySchema.optional(),
141
+ stored_byte_hours: usageQuantitySchema.optional(),
142
+ build_minutes: usageQuantitySchema.optional(),
143
+ build_count: usageQuantitySchema.optional(),
144
+ custom_domain_days: usageQuantitySchema.optional(),
145
+ space_days: usageQuantitySchema.optional(),
146
+ })
147
+ .strict();
148
+ export const usagePeriodSchema = z
149
+ .object({
150
+ id: z.string().describe("Billing period id."),
151
+ tenantId: z.string().describe("Tenant that owns this billing period."),
152
+ mode: z.enum(["live", "test"]),
153
+ periodStart: z.string().datetime(),
154
+ periodEnd: z.string().datetime(),
155
+ status: z.enum(["open", "final"]),
156
+ totals: usagePeriodTotalsSchema,
157
+ checksum: z
158
+ .string()
159
+ .nullable()
160
+ .describe("SHA-256 checksum of frozen final totals. Open periods have no checksum."),
161
+ finalizedAt: z.string().datetime().nullable(),
162
+ })
163
+ .strict();
164
+ export const usagePeriodListQuerySchema = cursorListQuerySchema
165
+ .extend({
166
+ mode: z
167
+ .enum(["live", "test"])
168
+ .optional()
169
+ .describe("Return periods for the live tenant or its linked test tenant."),
170
+ })
171
+ .strict();
172
+ export const usagePeriodListResponseSchema = z.object({
173
+ data: z.array(usagePeriodSchema),
174
+ pagination: CursorPaginationSchema,
175
+ });
176
+ export const usagePeriodResponseSchema = z.object({ data: usagePeriodSchema });
@@ -124,7 +124,7 @@ export declare const variableMutationResponseSchema: z.ZodObject<{
124
124
  path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
125
125
  provider: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
126
126
  registrar: "registrar";
127
- wpcloud: "wpcloud";
127
+ infra: "infra";
128
128
  dns: "dns";
129
129
  runtime: "runtime";
130
130
  }>>>;
@@ -168,7 +168,7 @@ export declare const variableDeleteResponseSchema: z.ZodObject<{
168
168
  path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
169
169
  provider: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
170
170
  registrar: "registrar";
171
- wpcloud: "wpcloud";
171
+ infra: "infra";
172
172
  dns: "dns";
173
173
  runtime: "runtime";
174
174
  }>>>;
@@ -1,10 +1,9 @@
1
1
  import { z } from "zod";
2
2
  import { AsyncOperationSchema, CursorPaginationSchema, cursorListQuerySchema } from "./common.js";
3
- // Variable (internal-docs/platform.md "Product Data Shapes"): one model for
4
- // every scope. Resolution order at finalize is space -> principal. A space IS
5
- // a site, so a space variable is the site variable — there is no third scope
6
- // underneath it. Secret values are write-only after creation: never returned
7
- // by API, CLI, UI, diagnostics, logs, or activity.
3
+ // One model for every scope. Resolution order at finalize is space ->
4
+ // principal; a space IS a site, so there is no third scope underneath. Secret
5
+ // values are write-only after creation: never returned by API, CLI, UI,
6
+ // diagnostics, logs, or activity.
8
7
  export const variableScope = z.enum(["space", "principal"]);
9
8
  export const variableNameSchema = z
10
9
  .string()
@@ -28,11 +27,10 @@ export const VariableSchema = z.object({
28
27
  createdAt: z.string().datetime().describe("Instant when the variable was created."),
29
28
  updatedAt: z.string().datetime().describe("Instant when the value was last written."),
30
29
  });
31
- // Version provenance (internal-docs/platform.md "Variable rules"): versions
32
- // record which variable names and value hashes they were finalized with —
33
- // never values. Stored only for internal cascade and synchronization; it is
34
- // never echoed on the public Version resource because historical rows cannot
35
- // distinguish sealed-value hashes safely.
30
+ // Versions record the variable names and value hashes they were finalized
31
+ // with, never values. Internal to cascade and synchronization: never echoed on
32
+ // the public Version resource, because historical rows cannot distinguish
33
+ // sealed-value hashes safely.
36
34
  export const variableProvenanceSchema = z
37
35
  .array(z.object({
38
36
  name: z.string().describe("Variable name the version was finalized with."),
@@ -66,9 +64,7 @@ export const spaceVariableListResponseSchema = z.object({
66
64
  data: z.array(z.union([VariableSchema, SystemVariableSchema])),
67
65
  pagination: CursorPaginationSchema,
68
66
  });
69
- // Variable mutations return the debounced cascade operation
70
- // (internal-docs/platform.md "Debounce contract"): every coalesced PUT/DELETE
71
- // returns the same pending `op_` id, so "mutation returns `operation`" holds.
67
+ // Every coalesced PUT/DELETE returns the same pending `op_` id.
72
68
  export const variableMutationResponseSchema = z.object({
73
69
  data: VariableSchema,
74
70
  operation: AsyncOperationSchema.nullable().describe("The debounced re-finalize cascade this write coalesced into; null when no cascade was required."),
@@ -15,6 +15,10 @@ export declare const webhookPatchSchema: z.ZodObject<{
15
15
  export declare const webhookSchema: z.ZodObject<{
16
16
  id: z.ZodString;
17
17
  tenantId: z.ZodString;
18
+ mode: z.ZodEnum<{
19
+ live: "live";
20
+ test: "test";
21
+ }>;
18
22
  principal: z.ZodNullable<z.ZodObject<{
19
23
  tenantId: z.ZodString;
20
24
  principalType: z.ZodEnum<{
@@ -27,8 +31,8 @@ export declare const webhookSchema: z.ZodObject<{
27
31
  events: z.ZodArray<z.ZodString>;
28
32
  status: z.ZodEnum<{
29
33
  active: "active";
30
- deleted: "deleted";
31
34
  disabled: "disabled";
35
+ deleted: "deleted";
32
36
  failing: "failing";
33
37
  }>;
34
38
  secret: z.ZodOptional<z.ZodString>;
@@ -45,6 +49,10 @@ export declare const webhookListResponseSchema: z.ZodObject<{
45
49
  data: z.ZodArray<z.ZodObject<{
46
50
  id: z.ZodString;
47
51
  tenantId: z.ZodString;
52
+ mode: z.ZodEnum<{
53
+ live: "live";
54
+ test: "test";
55
+ }>;
48
56
  principal: z.ZodNullable<z.ZodObject<{
49
57
  tenantId: z.ZodString;
50
58
  principalType: z.ZodEnum<{
@@ -57,8 +65,8 @@ export declare const webhookListResponseSchema: z.ZodObject<{
57
65
  events: z.ZodArray<z.ZodString>;
58
66
  status: z.ZodEnum<{
59
67
  active: "active";
60
- deleted: "deleted";
61
68
  disabled: "disabled";
69
+ deleted: "deleted";
62
70
  failing: "failing";
63
71
  }>;
64
72
  secret: z.ZodOptional<z.ZodString>;
@@ -72,7 +80,7 @@ export declare const webhookListResponseSchema: z.ZodObject<{
72
80
  hasMore: z.ZodBoolean;
73
81
  }, z.core.$strip>;
74
82
  }, z.core.$strip>;
75
- export declare const webhookRotateSecretSchema: z.ZodObject<{
83
+ export declare const webhookRotateSchema: z.ZodObject<{
76
84
  expireNow: z.ZodDefault<z.ZodBoolean>;
77
85
  }, z.core.$strip>;
78
86
  export declare const webhookDeliverySchema: z.ZodObject<{
@@ -101,7 +109,7 @@ export declare const webhookDeliverySchema: z.ZodObject<{
101
109
  path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
102
110
  provider: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
103
111
  registrar: "registrar";
104
- wpcloud: "wpcloud";
112
+ infra: "infra";
105
113
  dns: "dns";
106
114
  runtime: "runtime";
107
115
  }>>>;
@@ -142,7 +150,7 @@ export declare const webhookDeliveryListResponseSchema: z.ZodObject<{
142
150
  path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
143
151
  provider: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
144
152
  registrar: "registrar";
145
- wpcloud: "wpcloud";
153
+ infra: "infra";
146
154
  dns: "dns";
147
155
  runtime: "runtime";
148
156
  }>>>;