@spacefast/common 0.0.26 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (302) hide show
  1. package/dist/agents/connect-targets.d.ts +6 -146
  2. package/dist/agents/connect-targets.js +63 -295
  3. package/dist/agents/private-key-oauth.d.ts +31 -1
  4. package/dist/agents/private-key-oauth.js +124 -33
  5. package/dist/agents/registry/core.d.ts +292 -0
  6. package/dist/agents/registry/core.js +1388 -0
  7. package/dist/agents/registry/deeplink-probes.d.ts +23 -0
  8. package/dist/agents/registry/deeplink-probes.js +18 -0
  9. package/dist/agents/registry/node.d.ts +56 -0
  10. package/dist/agents/registry/node.js +339 -0
  11. package/dist/brand-assets-build.js +1 -2
  12. package/dist/brand-assets.js +4 -7
  13. package/dist/brand.d.ts +17 -0
  14. package/dist/brand.js +24 -4
  15. package/dist/config/domains.d.ts +55 -28
  16. package/dist/config/domains.js +85 -41
  17. package/dist/config/index.js +1 -2
  18. package/dist/contracts/abuse.js +9 -24
  19. package/dist/contracts/access-profiles.d.ts +86 -0
  20. package/dist/contracts/access-profiles.js +89 -0
  21. package/dist/contracts/access.d.ts +21 -27
  22. package/dist/contracts/access.js +33 -64
  23. package/dist/contracts/activity.d.ts +18 -1
  24. package/dist/contracts/activity.js +70 -26
  25. package/dist/contracts/analytics.js +8 -10
  26. package/dist/contracts/api-keys.d.ts +77 -52
  27. package/dist/contracts/api-keys.js +44 -24
  28. package/dist/contracts/application-journal.d.ts +216 -0
  29. package/dist/contracts/application-journal.js +167 -0
  30. package/dist/contracts/auth.d.ts +90 -17
  31. package/dist/contracts/auth.js +86 -17
  32. package/dist/contracts/beta.d.ts +9 -4
  33. package/dist/contracts/beta.js +20 -16
  34. package/dist/contracts/billing.js +7 -11
  35. package/dist/contracts/bootstrap.d.ts +791 -0
  36. package/dist/contracts/bootstrap.js +51 -0
  37. package/dist/contracts/builds.d.ts +186 -7
  38. package/dist/contracts/builds.js +75 -21
  39. package/dist/contracts/channels.d.ts +43 -0
  40. package/dist/contracts/channels.js +25 -9
  41. package/dist/contracts/cli.d.ts +7 -0
  42. package/dist/contracts/cli.js +6 -0
  43. package/dist/contracts/collab-public.d.ts +1 -1
  44. package/dist/contracts/collab-public.js +5 -8
  45. package/dist/contracts/comments.d.ts +45 -35
  46. package/dist/contracts/comments.js +107 -77
  47. package/dist/contracts/commerce.d.ts +165 -0
  48. package/dist/contracts/commerce.js +146 -0
  49. package/dist/contracts/common.d.ts +3 -3
  50. package/dist/contracts/common.js +18 -29
  51. package/dist/contracts/content-contract-verification.d.ts +521 -0
  52. package/dist/contracts/content-contract-verification.js +320 -0
  53. package/dist/contracts/content-platform-fixture.d.ts +1278 -0
  54. package/dist/contracts/content-platform-fixture.js +44 -0
  55. package/dist/contracts/content-program.d.ts +994 -0
  56. package/dist/contracts/content-program.js +658 -0
  57. package/dist/contracts/content-sync.d.ts +290 -0
  58. package/dist/contracts/content-sync.js +167 -0
  59. package/dist/contracts/content.d.ts +432 -0
  60. package/dist/contracts/content.js +303 -0
  61. package/dist/contracts/continuation.d.ts +17 -1
  62. package/dist/contracts/continuation.js +23 -23
  63. package/dist/contracts/countries.js +3 -4
  64. package/dist/contracts/crons.d.ts +17 -0
  65. package/dist/contracts/crons.js +33 -15
  66. package/dist/contracts/dashboard-prefs.d.ts +56 -0
  67. package/dist/contracts/dashboard-prefs.js +51 -0
  68. package/dist/contracts/device-auth.d.ts +234 -37
  69. package/dist/contracts/device-auth.js +267 -53
  70. package/dist/contracts/docs.d.ts +6 -10
  71. package/dist/contracts/docs.js +5 -13
  72. package/dist/contracts/domains.d.ts +499 -102
  73. package/dist/contracts/domains.js +169 -58
  74. package/dist/contracts/email-preferences.d.ts +3 -3
  75. package/dist/contracts/email-preferences.js +6 -7
  76. package/dist/contracts/enums.d.ts +26 -26
  77. package/dist/contracts/enums.js +61 -54
  78. package/dist/contracts/error-code-meta.d.ts +269 -7
  79. package/dist/contracts/error-code-meta.js +80 -5
  80. package/dist/contracts/error-codes.d.ts +5 -5
  81. package/dist/contracts/error-codes.js +78 -16
  82. package/dist/contracts/events.d.ts +100 -20
  83. package/dist/contracts/events.js +107 -20
  84. package/dist/contracts/execution.d.ts +47 -66
  85. package/dist/contracts/execution.js +51 -64
  86. package/dist/contracts/feature-lifecycle.d.ts +70 -14
  87. package/dist/contracts/feature-lifecycle.js +86 -15
  88. package/dist/contracts/features.d.ts +100 -37
  89. package/dist/contracts/features.js +21 -27
  90. package/dist/contracts/fixtures/content-platform-v1.json +1108 -0
  91. package/dist/contracts/frame-session.d.ts +192 -0
  92. package/dist/contracts/frame-session.js +164 -0
  93. package/dist/contracts/functions.d.ts +218 -211
  94. package/dist/contracts/functions.js +273 -260
  95. package/dist/contracts/grant-copy.d.ts +43 -0
  96. package/dist/contracts/grant-copy.js +44 -0
  97. package/dist/contracts/grants.d.ts +64 -56
  98. package/dist/contracts/grants.js +124 -23
  99. package/dist/contracts/ids.d.ts +4 -1
  100. package/dist/contracts/ids.js +4 -1
  101. package/dist/contracts/internal.d.ts +5 -4
  102. package/dist/contracts/internal.js +12 -3
  103. package/dist/contracts/mcp.d.ts +17 -0
  104. package/dist/contracts/mcp.js +23 -0
  105. package/dist/contracts/me.d.ts +6 -1
  106. package/dist/contracts/me.js +12 -6
  107. package/dist/contracts/notifications.d.ts +27 -29
  108. package/dist/contracts/notifications.js +9 -4
  109. package/dist/contracts/oauth-resources.d.ts +112 -10
  110. package/dist/contracts/oauth-resources.js +116 -11
  111. package/dist/contracts/oauth-scope-actions.d.ts +90 -0
  112. package/dist/contracts/oauth-scope-actions.js +126 -0
  113. package/dist/contracts/operations.d.ts +27 -4
  114. package/dist/contracts/operations.js +11 -5
  115. package/dist/contracts/pages.d.ts +29 -5
  116. package/dist/contracts/pages.js +22 -5
  117. package/dist/contracts/partner-notifications.d.ts +3 -0
  118. package/dist/contracts/partner-notifications.js +65 -0
  119. package/dist/contracts/{platform.d.ts → partner.d.ts} +29 -42
  120. package/dist/contracts/{platform.js → partner.js} +27 -40
  121. package/dist/contracts/plan-policy.d.ts +1 -1
  122. package/dist/contracts/principal-assertion.d.ts +43 -0
  123. package/dist/contracts/principal-assertion.js +67 -0
  124. package/dist/contracts/principals.d.ts +73 -0
  125. package/dist/contracts/principals.js +59 -0
  126. package/dist/contracts/privacy.d.ts +11 -0
  127. package/dist/contracts/privacy.js +17 -0
  128. package/dist/contracts/problem-document.js +3 -4
  129. package/dist/contracts/publish-archive.d.ts +116 -18
  130. package/dist/contracts/publish-archive.js +6 -3
  131. package/dist/contracts/push-new.d.ts +4 -4
  132. package/dist/contracts/quotas.js +3 -3
  133. package/dist/contracts/realtime.d.ts +52 -0
  134. package/dist/contracts/realtime.js +54 -0
  135. package/dist/contracts/repository-connections.d.ts +1 -1
  136. package/dist/contracts/repository-connections.js +6 -2
  137. package/dist/contracts/resources.d.ts +105 -14
  138. package/dist/contracts/resources.js +145 -21
  139. package/dist/contracts/route-inventory.d.ts +358 -0
  140. package/dist/contracts/route-inventory.js +141 -0
  141. package/dist/contracts/runtime-api.d.ts +112 -35
  142. package/dist/contracts/runtime-api.js +86 -66
  143. package/dist/contracts/runtime-app.d.ts +11 -21
  144. package/dist/contracts/runtime-app.js +39 -24
  145. package/dist/contracts/runtime-components.d.ts +143 -0
  146. package/dist/contracts/runtime-components.js +199 -0
  147. package/dist/contracts/runtime-db.d.ts +45 -19
  148. package/dist/contracts/runtime-db.js +85 -20
  149. package/dist/contracts/runtime-purge.js +3 -5
  150. package/dist/contracts/runtime-services.d.ts +43 -75
  151. package/dist/contracts/runtime-services.js +29 -49
  152. package/dist/contracts/runtime-storage.d.ts +14 -14
  153. package/dist/contracts/runtime-storage.js +28 -13
  154. package/dist/contracts/sf-config-v1.d.ts +14 -18
  155. package/dist/contracts/slugs.js +13 -4
  156. package/dist/contracts/space-config.d.ts +235 -28
  157. package/dist/contracts/space-config.js +246 -91
  158. package/dist/contracts/spaces.d.ts +360 -255
  159. package/dist/contracts/spaces.js +190 -122
  160. package/dist/contracts/superadmin-activity.d.ts +3 -43
  161. package/dist/contracts/superadmin-activity.js +6 -30
  162. package/dist/contracts/superadmin-emails.d.ts +1 -0
  163. package/dist/contracts/superadmin-emails.js +17 -1
  164. package/dist/contracts/superadmin-runtime.d.ts +199 -0
  165. package/dist/contracts/superadmin-runtime.js +141 -0
  166. package/dist/contracts/superadmin-search.d.ts +22 -2
  167. package/dist/contracts/superadmin-search.js +14 -6
  168. package/dist/contracts/superadmin-spaces.d.ts +435 -186
  169. package/dist/contracts/superadmin-spaces.js +131 -25
  170. package/dist/contracts/superadmin-teams.d.ts +3 -0
  171. package/dist/contracts/superadmin-teams.js +1 -2
  172. package/dist/contracts/superadmin-tenants.d.ts +627 -6
  173. package/dist/contracts/superadmin-tenants.js +32 -7
  174. package/dist/contracts/superadmin.d.ts +98 -16
  175. package/dist/contracts/superadmin.js +63 -10
  176. package/dist/contracts/tags.d.ts +85 -58
  177. package/dist/contracts/tags.js +44 -34
  178. package/dist/contracts/teams.d.ts +72 -9
  179. package/dist/contracts/teams.js +84 -25
  180. package/dist/contracts/tenants.d.ts +135 -0
  181. package/dist/contracts/tenants.js +120 -0
  182. package/dist/contracts/test-triggers.d.ts +70 -0
  183. package/dist/contracts/test-triggers.js +116 -0
  184. package/dist/contracts/theme-json.js +3 -8
  185. package/dist/contracts/transfers.d.ts +1 -0
  186. package/dist/contracts/transfers.js +1 -0
  187. package/dist/contracts/usage.d.ts +209 -0
  188. package/dist/contracts/usage.js +124 -12
  189. package/dist/contracts/variables.d.ts +2 -2
  190. package/dist/contracts/variables.js +9 -13
  191. package/dist/contracts/webhooks.d.ts +13 -5
  192. package/dist/contracts/webhooks.js +3 -1
  193. package/dist/contracts/zero.d.ts +57 -64
  194. package/dist/contracts/zero.js +68 -66
  195. package/dist/dashboard-paths/index.d.ts +24 -21
  196. package/dist/dashboard-paths/index.js +35 -47
  197. package/dist/dashboard-paths/route-reservations.generated.d.ts +2 -0
  198. package/dist/dashboard-paths/route-reservations.generated.js +36 -0
  199. package/dist/docs/agent-arrival.d.ts +92 -0
  200. package/dist/docs/agent-arrival.js +227 -0
  201. package/dist/docs/agent-output-policy.d.ts +6 -0
  202. package/dist/docs/agent-output-policy.js +22 -0
  203. package/dist/docs/agent-prose.d.ts +11 -17
  204. package/dist/docs/agent-prose.js +62 -37
  205. package/dist/docs/agent-setup.d.ts +72 -41
  206. package/dist/docs/agent-setup.js +336 -436
  207. package/dist/docs/catalog.d.ts +147 -89
  208. package/dist/docs/catalog.js +157 -42
  209. package/dist/docs/error-docs.d.ts +2098 -1
  210. package/dist/docs/error-docs.js +281 -16
  211. package/dist/docs/index-build.d.ts +0 -1
  212. package/dist/docs/index-build.js +2 -3
  213. package/dist/docs/page-context-prompt.d.ts +77 -0
  214. package/dist/docs/page-context-prompt.js +131 -0
  215. package/dist/docs/reference-urls.d.ts +46 -0
  216. package/dist/docs/reference-urls.js +79 -0
  217. package/dist/docs/search.d.ts +6 -8
  218. package/dist/docs/search.js +10 -13
  219. package/dist/docs/skill-distribution.d.ts +4 -1
  220. package/dist/docs/skill-distribution.js +10 -5
  221. package/dist/docs/skills.d.ts +117 -117
  222. package/dist/docs/skills.js +120 -72
  223. package/dist/docs/start-prompts.d.ts +45 -0
  224. package/dist/docs/start-prompts.js +62 -0
  225. package/dist/domain-exploration.js +9 -13
  226. package/dist/og-template.d.ts +56 -0
  227. package/dist/og-template.js +56 -0
  228. package/dist/slug-policy/index.js +5 -11
  229. package/dist/utils/browser-credential.d.ts +13 -6
  230. package/dist/utils/browser-credential.js +14 -7
  231. package/dist/utils/build-settings.d.ts +16 -0
  232. package/dist/utils/build-settings.js +63 -17
  233. package/dist/utils/canonical-json.d.ts +3 -5
  234. package/dist/utils/canonical-json.js +3 -5
  235. package/dist/utils/cast-transport.d.ts +5 -17
  236. package/dist/utils/cast-transport.js +6 -19
  237. package/dist/utils/claim-token.js +1 -2
  238. package/dist/utils/comment-avatars.js +4 -6
  239. package/dist/utils/concurrency.js +2 -3
  240. package/dist/utils/content-type.d.ts +7 -6
  241. package/dist/utils/content-type.js +73 -51
  242. package/dist/utils/credential-policy.d.ts +50 -6
  243. package/dist/utils/credential-policy.js +123 -57
  244. package/dist/utils/egress-policy.fixtures.json +1 -1
  245. package/dist/utils/generate-space-name.d.ts +3 -8
  246. package/dist/utils/generate-space-name.js +3 -8
  247. package/dist/utils/grants.d.ts +0 -1
  248. package/dist/utils/grants.js +4 -7
  249. package/dist/utils/gravatar.d.ts +2 -4
  250. package/dist/utils/gravatar.js +6 -12
  251. package/dist/utils/id-hints.js +14 -23
  252. package/dist/utils/idempotency.d.ts +3 -3
  253. package/dist/utils/idempotency.js +6 -7
  254. package/dist/utils/local-space-state.d.ts +15 -15
  255. package/dist/utils/local-space-state.js +34 -23
  256. package/dist/utils/oauth-signed-query.d.ts +3 -5
  257. package/dist/utils/oauth-signed-query.js +6 -9
  258. package/dist/utils/one-shot-replay.d.ts +3 -5
  259. package/dist/utils/one-shot-replay.js +3 -5
  260. package/dist/utils/page-colors.d.ts +4 -10
  261. package/dist/utils/page-colors.js +11 -35
  262. package/dist/utils/page-fonts.js +6 -11
  263. package/dist/utils/page-preview.d.ts +0 -1
  264. package/dist/utils/page-preview.js +0 -1
  265. package/dist/utils/pages.d.ts +22 -11
  266. package/dist/utils/pages.js +70 -30
  267. package/dist/utils/privacy-regions.d.ts +19 -0
  268. package/dist/utils/privacy-regions.js +91 -0
  269. package/dist/utils/publish-form-data.d.ts +4 -5
  270. package/dist/utils/publish-form-data.js +2 -3
  271. package/dist/utils/publish-policy.d.ts +10 -23
  272. package/dist/utils/publish-policy.js +63 -116
  273. package/dist/utils/query-client.d.ts +2 -0
  274. package/dist/utils/query-client.js +10 -1
  275. package/dist/utils/runtime-paths.d.ts +4 -4
  276. package/dist/utils/runtime-paths.js +6 -8
  277. package/dist/utils/runtime-upload.d.ts +4 -0
  278. package/dist/utils/runtime-upload.js +5 -0
  279. package/dist/utils/secure-local-file.d.ts +3 -3
  280. package/dist/utils/secure-local-file.js +18 -24
  281. package/dist/utils/space-config.d.ts +11 -14
  282. package/dist/utils/space-config.js +10 -16
  283. package/dist/utils/static-runtime-policy.d.ts +5 -8
  284. package/dist/utils/static-runtime-policy.generated.d.ts +16 -0
  285. package/dist/utils/static-runtime-policy.generated.js +70 -0
  286. package/dist/utils/static-runtime-policy.js +17 -84
  287. package/dist/utils/storage-policy.js +1 -2
  288. package/dist/utils/upload-session.js +8 -14
  289. package/dist/utils/version-path.js +11 -19
  290. package/dist/utils/wpcom-auth-redirects.d.ts +5 -14
  291. package/dist/utils/wpcom-auth-redirects.js +1 -4
  292. package/dist/vocabulary.d.ts +7 -7
  293. package/dist/vocabulary.js +30 -16
  294. package/package.json +14 -2
  295. package/dist/agents/client-registry.d.ts +0 -22
  296. package/dist/agents/client-registry.js +0 -41
  297. package/dist/docs/agent-handoff-document.d.ts +0 -15
  298. package/dist/docs/agent-handoff-document.js +0 -180
  299. package/dist/docs/agent-solutions.d.ts +0 -110
  300. package/dist/docs/agent-solutions.js +0 -183
  301. package/dist/utils/query-keys.d.ts +0 -84
  302. package/dist/utils/query-keys.js +0 -108
@@ -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 });
@@ -117,8 +117,8 @@ export declare const variableMutationResponseSchema: z.ZodObject<{
117
117
  code: z.ZodString;
118
118
  severity: z.ZodEnum<{
119
119
  info: "info";
120
- error: "error";
121
120
  warning: "warning";
121
+ error: "error";
122
122
  }>;
123
123
  message: z.ZodString;
124
124
  path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -161,8 +161,8 @@ export declare const variableDeleteResponseSchema: z.ZodObject<{
161
161
  code: z.ZodString;
162
162
  severity: z.ZodEnum<{
163
163
  info: "info";
164
- error: "error";
165
164
  warning: "warning";
165
+ error: "error";
166
166
  }>;
167
167
  message: z.ZodString;
168
168
  path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -1,10 +1,9 @@
1
1
  import { z } from "zod";
2
2
  import { AsyncOperationSchema, CursorPaginationSchema, cursorListQuerySchema } from "./common.js";
3
- // Variable (the platform spec "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 (the platform spec "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
- // (the platform spec "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<{
@@ -94,8 +102,8 @@ export declare const webhookDeliverySchema: z.ZodObject<{
94
102
  code: z.ZodString;
95
103
  severity: z.ZodEnum<{
96
104
  info: "info";
97
- error: "error";
98
105
  warning: "warning";
106
+ error: "error";
99
107
  }>;
100
108
  message: z.ZodString;
101
109
  path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -135,8 +143,8 @@ export declare const webhookDeliveryListResponseSchema: z.ZodObject<{
135
143
  code: z.ZodString;
136
144
  severity: z.ZodEnum<{
137
145
  info: "info";
138
- error: "error";
139
146
  warning: "warning";
147
+ error: "error";
140
148
  }>;
141
149
  message: z.ZodString;
142
150
  path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -1,5 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import { baseDiagnosticSchema, CursorPaginationSchema, cursorListQuerySchema } from "./common.js";
3
+ import { tenantMode } from "./enums.js";
3
4
  export const webhookCreateSchema = z.object({
4
5
  teamId: z.string().min(1).optional(),
5
6
  url: z.string().url(),
@@ -15,6 +16,7 @@ export const webhookPatchSchema = z
15
16
  export const webhookSchema = z.object({
16
17
  id: z.string(),
17
18
  tenantId: z.string(),
19
+ mode: tenantMode.describe("`test` when the owning tenant is a linked test tenant, `live` otherwise."),
18
20
  principal: z
19
21
  .object({
20
22
  tenantId: z.string(),
@@ -36,7 +38,7 @@ export const webhookListResponseSchema = z.object({
36
38
  data: z.array(webhookSchema),
37
39
  pagination: CursorPaginationSchema,
38
40
  });
39
- export const webhookRotateSecretSchema = z.object({
41
+ export const webhookRotateSchema = z.object({
40
42
  expireNow: z.boolean().default(false),
41
43
  });
42
44
  export const webhookDeliverySchema = z.object({