primitive-admin 1.2.0-alpha.14 → 1.2.0-alpha.16

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 (400) hide show
  1. package/README.md +181 -73
  2. package/assets/skill/skills/primitive-platform/SKILL.md +87 -23
  3. package/dist/bin/primitive.js +11 -82
  4. package/dist/bin/primitive.js.map +1 -1
  5. package/dist/src/commands/admins.js +80 -17
  6. package/dist/src/commands/admins.js.map +1 -1
  7. package/dist/src/commands/agent-sessions.js +2 -0
  8. package/dist/src/commands/agent-sessions.js.map +1 -1
  9. package/dist/src/commands/analytics.js +181 -12
  10. package/dist/src/commands/analytics.js.map +1 -1
  11. package/dist/src/commands/apps-children.js +2 -0
  12. package/dist/src/commands/apps-children.js.map +1 -1
  13. package/dist/src/commands/apps-transitions.d.ts +39 -0
  14. package/dist/src/commands/apps-transitions.js +198 -0
  15. package/dist/src/commands/apps-transitions.js.map +1 -0
  16. package/dist/src/commands/apps.d.ts +11 -0
  17. package/dist/src/commands/apps.js +65 -3
  18. package/dist/src/commands/apps.js.map +1 -1
  19. package/dist/src/commands/auth-sessions.js +2 -0
  20. package/dist/src/commands/auth-sessions.js.map +1 -1
  21. package/dist/src/commands/auth.js +16 -1
  22. package/dist/src/commands/auth.js.map +1 -1
  23. package/dist/src/commands/blob-buckets.js +2 -0
  24. package/dist/src/commands/blob-buckets.js.map +1 -1
  25. package/dist/src/commands/collections.js +2 -0
  26. package/dist/src/commands/collections.js.map +1 -1
  27. package/dist/src/commands/comparisons.js +2 -0
  28. package/dist/src/commands/comparisons.js.map +1 -1
  29. package/dist/src/commands/config.d.ts +1 -1
  30. package/dist/src/commands/config.js +42 -9
  31. package/dist/src/commands/config.js.map +1 -1
  32. package/dist/src/commands/connections.js +2 -0
  33. package/dist/src/commands/connections.js.map +1 -1
  34. package/dist/src/commands/database-type-configs.js +5 -3
  35. package/dist/src/commands/database-type-configs.js.map +1 -1
  36. package/dist/src/commands/databases.js +6 -4
  37. package/dist/src/commands/databases.js.map +1 -1
  38. package/dist/src/commands/db3-types.js +2 -0
  39. package/dist/src/commands/db3-types.js.map +1 -1
  40. package/dist/src/commands/db3.d.ts +12 -0
  41. package/dist/src/commands/db3.js +408 -31
  42. package/dist/src/commands/db3.js.map +1 -1
  43. package/dist/src/commands/documents.d.ts +52 -12
  44. package/dist/src/commands/documents.js +120 -29
  45. package/dist/src/commands/documents.js.map +1 -1
  46. package/dist/src/commands/email-templates.js +74 -0
  47. package/dist/src/commands/email-templates.js.map +1 -1
  48. package/dist/src/commands/env.js +2 -0
  49. package/dist/src/commands/env.js.map +1 -1
  50. package/dist/src/commands/functions.js +90 -11
  51. package/dist/src/commands/functions.js.map +1 -1
  52. package/dist/src/commands/groups.js +20 -3
  53. package/dist/src/commands/groups.js.map +1 -1
  54. package/dist/src/commands/guides.js +2 -0
  55. package/dist/src/commands/guides.js.map +1 -1
  56. package/dist/src/commands/hosting.d.ts +8 -0
  57. package/dist/src/commands/hosting.js +346 -0
  58. package/dist/src/commands/hosting.js.map +1 -0
  59. package/dist/src/commands/init.js +9 -1
  60. package/dist/src/commands/init.js.map +1 -1
  61. package/dist/src/commands/integrations.js +82 -47
  62. package/dist/src/commands/integrations.js.map +1 -1
  63. package/dist/src/commands/locks.js +2 -0
  64. package/dist/src/commands/locks.js.map +1 -1
  65. package/dist/src/commands/metadata-category-configs.js +2 -0
  66. package/dist/src/commands/metadata-category-configs.js.map +1 -1
  67. package/dist/src/commands/metadata.js +41 -0
  68. package/dist/src/commands/metadata.js.map +1 -1
  69. package/dist/src/commands/prompts.js +75 -47
  70. package/dist/src/commands/prompts.js.map +1 -1
  71. package/dist/src/commands/rate-counters.d.ts +19 -0
  72. package/dist/src/commands/rate-counters.js +104 -0
  73. package/dist/src/commands/rate-counters.js.map +1 -0
  74. package/dist/src/commands/rule-sets.js +2 -0
  75. package/dist/src/commands/rule-sets.js.map +1 -1
  76. package/dist/src/commands/schemas.d.ts +15 -0
  77. package/dist/src/commands/schemas.js +122 -0
  78. package/dist/src/commands/schemas.js.map +1 -0
  79. package/dist/src/commands/secrets.js +47 -3
  80. package/dist/src/commands/secrets.js.map +1 -1
  81. package/dist/src/commands/sessions.js +2 -0
  82. package/dist/src/commands/sessions.js.map +1 -1
  83. package/dist/src/commands/skill.js +2 -0
  84. package/dist/src/commands/skill.js.map +1 -1
  85. package/dist/src/commands/sync-schemas.d.ts +202 -0
  86. package/dist/src/commands/sync-schemas.js +629 -0
  87. package/dist/src/commands/sync-schemas.js.map +1 -0
  88. package/dist/src/commands/sync-user-properties.d.ts +118 -0
  89. package/dist/src/commands/sync-user-properties.js +276 -0
  90. package/dist/src/commands/sync-user-properties.js.map +1 -0
  91. package/dist/src/commands/sync.d.ts +344 -14
  92. package/dist/src/commands/sync.js +1834 -345
  93. package/dist/src/commands/sync.js.map +1 -1
  94. package/dist/src/commands/tokens.js +2 -0
  95. package/dist/src/commands/tokens.js.map +1 -1
  96. package/dist/src/commands/transitions.d.ts +54 -0
  97. package/dist/src/commands/transitions.js +418 -0
  98. package/dist/src/commands/transitions.js.map +1 -0
  99. package/dist/src/commands/usage.d.ts +18 -0
  100. package/dist/src/commands/usage.js +343 -0
  101. package/dist/src/commands/usage.js.map +1 -0
  102. package/dist/src/commands/user-properties.d.ts +14 -0
  103. package/dist/src/commands/user-properties.js +79 -0
  104. package/dist/src/commands/user-properties.js.map +1 -0
  105. package/dist/src/commands/users.js +878 -16
  106. package/dist/src/commands/users.js.map +1 -1
  107. package/dist/src/commands/vars.js +2 -0
  108. package/dist/src/commands/vars.js.map +1 -1
  109. package/dist/src/commands/waitlist.js +39 -4
  110. package/dist/src/commands/waitlist.js.map +1 -1
  111. package/dist/src/lib/analytics-query.d.ts +58 -0
  112. package/dist/src/lib/analytics-query.js +134 -0
  113. package/dist/src/lib/analytics-query.js.map +1 -0
  114. package/dist/src/lib/api-client.d.ts +1354 -97
  115. package/dist/src/lib/api-client.js +513 -164
  116. package/dist/src/lib/api-client.js.map +1 -1
  117. package/dist/src/lib/app-settings-descriptor.d.ts +1 -1
  118. package/dist/src/lib/app-settings-descriptor.js +6 -0
  119. package/dist/src/lib/app-settings-descriptor.js.map +1 -1
  120. package/dist/src/lib/auth-flow.d.ts +33 -0
  121. package/dist/src/lib/auth-flow.js +404 -13
  122. package/dist/src/lib/auth-flow.js.map +1 -1
  123. package/dist/src/lib/block-selector.d.ts +9 -15
  124. package/dist/src/lib/block-selector.js +9 -20
  125. package/dist/src/lib/block-selector.js.map +1 -1
  126. package/dist/src/lib/cli-manifest.d.ts +9 -0
  127. package/dist/src/lib/cli-manifest.js +10 -1
  128. package/dist/src/lib/cli-manifest.js.map +1 -1
  129. package/dist/src/lib/cli-version.d.ts +14 -0
  130. package/dist/src/lib/cli-version.js +38 -0
  131. package/dist/src/lib/cli-version.js.map +1 -0
  132. package/dist/src/lib/codegen-shared/prettierStable.d.ts +41 -0
  133. package/dist/src/lib/codegen-shared/prettierStable.js +146 -24
  134. package/dist/src/lib/codegen-shared/prettierStable.js.map +1 -1
  135. package/dist/src/lib/command-groups.d.ts +30 -0
  136. package/dist/src/lib/command-groups.js +109 -0
  137. package/dist/src/lib/command-groups.js.map +1 -0
  138. package/dist/src/lib/command-status.d.ts +147 -0
  139. package/dist/src/lib/command-status.js +266 -0
  140. package/dist/src/lib/command-status.js.map +1 -0
  141. package/dist/src/lib/config-object-descriptor.d.ts +6 -0
  142. package/dist/src/lib/config-object-descriptor.js +71 -1
  143. package/dist/src/lib/config-object-descriptor.js.map +1 -1
  144. package/dist/src/lib/config-toml.d.ts +11 -2
  145. package/dist/src/lib/config-toml.js +25 -2
  146. package/dist/src/lib/config-toml.js.map +1 -1
  147. package/dist/src/lib/data-input.d.ts +1 -1
  148. package/dist/src/lib/data-input.js +1 -1
  149. package/dist/src/lib/db-codegen/dbTsTypes.d.ts +1 -1
  150. package/dist/src/lib/db-codegen/dbTsTypes.js +3 -0
  151. package/dist/src/lib/db-codegen/dbTsTypes.js.map +1 -1
  152. package/dist/src/lib/db-codegen/dbTypeIR.d.ts +18 -1
  153. package/dist/src/lib/db-codegen/dbTypeIR.js +14 -5
  154. package/dist/src/lib/db-codegen/dbTypeIR.js.map +1 -1
  155. package/dist/src/lib/db-type-records.d.ts +106 -0
  156. package/dist/src/lib/db-type-records.js +224 -0
  157. package/dist/src/lib/db-type-records.js.map +1 -0
  158. package/dist/src/lib/db3-export.d.ts +51 -14
  159. package/dist/src/lib/db3-export.js +136 -28
  160. package/dist/src/lib/db3-export.js.map +1 -1
  161. package/dist/src/lib/db3-index-output.d.ts +92 -4
  162. package/dist/src/lib/db3-index-output.js +183 -11
  163. package/dist/src/lib/db3-index-output.js.map +1 -1
  164. package/dist/src/lib/db3-type-models.d.ts +49 -7
  165. package/dist/src/lib/db3-type-models.js +159 -28
  166. package/dist/src/lib/db3-type-models.js.map +1 -1
  167. package/dist/src/lib/deprecation.d.ts +2 -2
  168. package/dist/src/lib/deprecation.js +2 -2
  169. package/dist/src/lib/experimental-apis.d.ts +36 -0
  170. package/dist/src/lib/experimental-apis.js +46 -0
  171. package/dist/src/lib/experimental-apis.js.map +1 -0
  172. package/dist/src/lib/file-attachment.d.ts +24 -0
  173. package/dist/src/lib/file-attachment.js +31 -0
  174. package/dist/src/lib/file-attachment.js.map +1 -0
  175. package/dist/src/lib/function-authorize-check.d.ts +1 -1
  176. package/dist/src/lib/function-authorize-check.js +2 -1
  177. package/dist/src/lib/function-authorize-check.js.map +1 -1
  178. package/dist/src/lib/function-authorize-view.d.ts +12 -0
  179. package/dist/src/lib/function-authorize-view.js +38 -0
  180. package/dist/src/lib/function-authorize-view.js.map +1 -1
  181. package/dist/src/lib/function-bundle.d.ts +27 -5
  182. package/dist/src/lib/function-bundle.js +106 -7
  183. package/dist/src/lib/function-bundle.js.map +1 -1
  184. package/dist/src/lib/function-collect.d.ts +15 -0
  185. package/dist/src/lib/function-collect.js +73 -14
  186. package/dist/src/lib/function-collect.js.map +1 -1
  187. package/dist/src/lib/function-db-types.d.ts +63 -40
  188. package/dist/src/lib/function-db-types.js +289 -293
  189. package/dist/src/lib/function-db-types.js.map +1 -1
  190. package/dist/src/lib/function-document-types.d.ts +19 -7
  191. package/dist/src/lib/function-document-types.js +24 -12
  192. package/dist/src/lib/function-document-types.js.map +1 -1
  193. package/dist/src/lib/function-lint.d.ts +24 -1
  194. package/dist/src/lib/function-lint.js +123 -1
  195. package/dist/src/lib/function-lint.js.map +1 -1
  196. package/dist/src/lib/function-run.d.ts +1 -1
  197. package/dist/src/lib/function-run.js +1 -1
  198. package/dist/src/lib/function-run.js.map +1 -1
  199. package/dist/src/lib/function-schema-codegen.d.ts +85 -21
  200. package/dist/src/lib/function-schema-codegen.js +191 -85
  201. package/dist/src/lib/function-schema-codegen.js.map +1 -1
  202. package/dist/src/lib/function-schema-refs.d.ts +98 -0
  203. package/dist/src/lib/function-schema-refs.js +177 -0
  204. package/dist/src/lib/function-schema-refs.js.map +1 -0
  205. package/dist/src/lib/function-sync.d.ts +38 -4
  206. package/dist/src/lib/function-sync.js +91 -14
  207. package/dist/src/lib/function-sync.js.map +1 -1
  208. package/dist/src/lib/function-typecheck.d.ts +52 -0
  209. package/dist/src/lib/function-typecheck.js +171 -54
  210. package/dist/src/lib/function-typecheck.js.map +1 -1
  211. package/dist/src/lib/generated-build-flags.d.ts +13 -0
  212. package/dist/src/lib/generated-build-flags.js +14 -0
  213. package/dist/src/lib/generated-build-flags.js.map +1 -0
  214. package/dist/src/lib/generated-command-status.d.ts +6 -0
  215. package/dist/src/lib/generated-command-status.js +469 -0
  216. package/dist/src/lib/generated-command-status.js.map +1 -0
  217. package/dist/src/lib/generated-config-surfaces.d.ts +239 -14
  218. package/dist/src/lib/generated-config-surfaces.js +670 -85
  219. package/dist/src/lib/generated-config-surfaces.js.map +1 -1
  220. package/dist/src/lib/generated-sdk-types.d.ts +1 -1
  221. package/dist/src/lib/generated-sdk-types.js +1 -1
  222. package/dist/src/lib/generated-sdk-types.js.map +1 -1
  223. package/dist/src/lib/hosting-build.d.ts +97 -0
  224. package/dist/src/lib/hosting-build.js +204 -0
  225. package/dist/src/lib/hosting-build.js.map +1 -0
  226. package/dist/src/lib/hosting-client.d.ts +167 -0
  227. package/dist/src/lib/hosting-client.js +340 -0
  228. package/dist/src/lib/hosting-client.js.map +1 -0
  229. package/dist/src/lib/hosting-environments.d.ts +32 -0
  230. package/dist/src/lib/hosting-environments.js +74 -0
  231. package/dist/src/lib/hosting-environments.js.map +1 -0
  232. package/dist/src/lib/hosting-errors.d.ts +30 -0
  233. package/dist/src/lib/hosting-errors.js +43 -0
  234. package/dist/src/lib/hosting-errors.js.map +1 -0
  235. package/dist/src/lib/hosting-token.d.ts +46 -0
  236. package/dist/src/lib/hosting-token.js +60 -0
  237. package/dist/src/lib/hosting-token.js.map +1 -0
  238. package/dist/src/lib/hosting-wait.d.ts +42 -0
  239. package/dist/src/lib/hosting-wait.js +84 -0
  240. package/dist/src/lib/hosting-wait.js.map +1 -0
  241. package/dist/src/lib/hosting-wfp-upload.d.ts +86 -0
  242. package/dist/src/lib/hosting-wfp-upload.js +149 -0
  243. package/dist/src/lib/hosting-wfp-upload.js.map +1 -0
  244. package/dist/src/lib/integration-test-request.d.ts +54 -0
  245. package/dist/src/lib/integration-test-request.js +207 -0
  246. package/dist/src/lib/integration-test-request.js.map +1 -0
  247. package/dist/src/lib/invoker-shared-enums.d.ts +35 -0
  248. package/dist/src/lib/invoker-shared-enums.js +98 -0
  249. package/dist/src/lib/invoker-shared-enums.js.map +1 -0
  250. package/dist/src/lib/log-inspection.d.ts +4 -1
  251. package/dist/src/lib/log-inspection.js.map +1 -1
  252. package/dist/src/lib/metadata-report.d.ts +85 -0
  253. package/dist/src/lib/metadata-report.js +81 -0
  254. package/dist/src/lib/metadata-report.js.map +1 -0
  255. package/dist/src/lib/output.d.ts +1 -1
  256. package/dist/src/lib/output.js +1 -1
  257. package/dist/src/lib/platform-owned.js +5 -0
  258. package/dist/src/lib/platform-owned.js.map +1 -1
  259. package/dist/src/lib/primitive-declaration-names.d.ts +21 -0
  260. package/dist/src/lib/primitive-declaration-names.js +22 -0
  261. package/dist/src/lib/primitive-declaration-names.js.map +1 -0
  262. package/dist/src/lib/primitive-declaration.d.ts +174 -0
  263. package/dist/src/lib/primitive-declaration.js +792 -0
  264. package/dist/src/lib/primitive-declaration.js.map +1 -0
  265. package/dist/src/lib/prompt-schema-codegen.d.ts +36 -12
  266. package/dist/src/lib/prompt-schema-codegen.js +94 -98
  267. package/dist/src/lib/prompt-schema-codegen.js.map +1 -1
  268. package/dist/src/lib/prompt-schema-document.d.ts +35 -0
  269. package/dist/src/lib/prompt-schema-document.js +92 -0
  270. package/dist/src/lib/prompt-schema-document.js.map +1 -0
  271. package/dist/src/lib/prompt-schema-refs.d.ts +173 -0
  272. package/dist/src/lib/prompt-schema-refs.js +478 -0
  273. package/dist/src/lib/prompt-schema-refs.js.map +1 -0
  274. package/dist/src/lib/records-verbs.d.ts +12 -2
  275. package/dist/src/lib/records-verbs.js +7 -2
  276. package/dist/src/lib/records-verbs.js.map +1 -1
  277. package/dist/src/lib/register-commands.d.ts +36 -0
  278. package/dist/src/lib/register-commands.js +37 -0
  279. package/dist/src/lib/register-commands.js.map +1 -0
  280. package/dist/src/lib/retired-imports.d.ts +53 -0
  281. package/dist/src/lib/retired-imports.js +120 -0
  282. package/dist/src/lib/retired-imports.js.map +1 -0
  283. package/dist/src/lib/schema-codegen/compiledSpace.d.ts +62 -0
  284. package/dist/src/lib/schema-codegen/compiledSpace.js +103 -0
  285. package/dist/src/lib/schema-codegen/compiledSpace.js.map +1 -0
  286. package/dist/src/lib/schema-codegen/generated-db3-bridge.d.ts +86 -0
  287. package/dist/src/lib/schema-codegen/generated-db3-bridge.js +227 -0
  288. package/dist/src/lib/schema-codegen/generated-db3-bridge.js.map +1 -0
  289. package/dist/src/lib/schema-codegen/generated-db3-query-capabilities.d.ts +85 -0
  290. package/dist/src/lib/schema-codegen/generated-db3-query-capabilities.js +86 -0
  291. package/dist/src/lib/schema-codegen/generated-db3-query-capabilities.js.map +1 -0
  292. package/dist/src/lib/schema-codegen/generated-field-grammar.d.ts +218 -0
  293. package/dist/src/lib/schema-codegen/generated-field-grammar.js +397 -0
  294. package/dist/src/lib/schema-codegen/generated-field-grammar.js.map +1 -0
  295. package/dist/src/lib/schema-codegen/generated-field-table.d.ts +80 -0
  296. package/dist/src/lib/schema-codegen/generated-field-table.js +542 -0
  297. package/dist/src/lib/schema-codegen/generated-field-table.js.map +1 -0
  298. package/dist/src/lib/schema-codegen/generated-prompt-schemas.d.ts +195 -0
  299. package/dist/src/lib/schema-codegen/generated-prompt-schemas.js +503 -0
  300. package/dist/src/lib/schema-codegen/generated-prompt-schemas.js.map +1 -0
  301. package/dist/src/lib/schema-codegen/generated-schema-descriptor.d.ts +129 -0
  302. package/dist/src/lib/schema-codegen/generated-schema-descriptor.js +154 -1
  303. package/dist/src/lib/schema-codegen/generated-schema-descriptor.js.map +1 -1
  304. package/dist/src/lib/schema-codegen/generated-schema-file.d.ts +129 -0
  305. package/dist/src/lib/schema-codegen/generated-schema-file.js +475 -0
  306. package/dist/src/lib/schema-codegen/generated-schema-file.js.map +1 -0
  307. package/dist/src/lib/schema-codegen/generated-schema-provenance.d.ts +115 -0
  308. package/dist/src/lib/schema-codegen/generated-schema-provenance.js +274 -0
  309. package/dist/src/lib/schema-codegen/generated-schema-provenance.js.map +1 -0
  310. package/dist/src/lib/schema-codegen/generated-schema-refs.d.ts +366 -0
  311. package/dist/src/lib/schema-codegen/generated-schema-refs.js +1789 -0
  312. package/dist/src/lib/schema-codegen/generated-schema-refs.js.map +1 -0
  313. package/dist/src/lib/schema-codegen/generated-schema-shape.d.ts +27 -0
  314. package/dist/src/lib/schema-codegen/generated-schema-shape.js +126 -0
  315. package/dist/src/lib/schema-codegen/generated-schema-shape.js.map +1 -0
  316. package/dist/src/lib/schema-codegen/namedRefs.d.ts +56 -0
  317. package/dist/src/lib/schema-codegen/namedRefs.js +143 -0
  318. package/dist/src/lib/schema-codegen/namedRefs.js.map +1 -0
  319. package/dist/src/lib/schema-codegen/schemaChanges.d.ts +74 -0
  320. package/dist/src/lib/schema-codegen/schemaChanges.js +277 -0
  321. package/dist/src/lib/schema-codegen/schemaChanges.js.map +1 -0
  322. package/dist/src/lib/schema-codegen/schemaDocs.d.ts +69 -0
  323. package/dist/src/lib/schema-codegen/schemaDocs.js +219 -0
  324. package/dist/src/lib/schema-codegen/schemaDocs.js.map +1 -0
  325. package/dist/src/lib/schema-codegen/schemaIR.d.ts +158 -0
  326. package/dist/src/lib/schema-codegen/schemaIR.js +279 -0
  327. package/dist/src/lib/schema-codegen/schemaIR.js.map +1 -0
  328. package/dist/src/lib/schema-codegen/schemaToTs.d.ts +40 -13
  329. package/dist/src/lib/schema-codegen/schemaToTs.js +124 -160
  330. package/dist/src/lib/schema-codegen/schemaToTs.js.map +1 -1
  331. package/dist/src/lib/schema-codegen/valuesLists.d.ts +48 -0
  332. package/dist/src/lib/schema-codegen/valuesLists.js +144 -0
  333. package/dist/src/lib/schema-codegen/valuesLists.js.map +1 -0
  334. package/dist/src/lib/schema-family-index.d.ts +228 -0
  335. package/dist/src/lib/schema-family-index.js +813 -0
  336. package/dist/src/lib/schema-family-index.js.map +1 -0
  337. package/dist/src/lib/schema-pins.d.ts +82 -0
  338. package/dist/src/lib/schema-pins.js +198 -0
  339. package/dist/src/lib/schema-pins.js.map +1 -0
  340. package/dist/src/lib/schema-preview.d.ts +244 -0
  341. package/dist/src/lib/schema-preview.js +498 -0
  342. package/dist/src/lib/schema-preview.js.map +1 -0
  343. package/dist/src/lib/skill-installer.d.ts +2 -2
  344. package/dist/src/lib/skill-installer.js +2 -21
  345. package/dist/src/lib/skill-installer.js.map +1 -1
  346. package/dist/src/lib/step-run-table.d.ts +1 -2
  347. package/dist/src/lib/step-run-table.js +1 -2
  348. package/dist/src/lib/step-run-table.js.map +1 -1
  349. package/dist/src/lib/swift-codegen/agentGenerator.d.ts +2 -1
  350. package/dist/src/lib/swift-codegen/agentGenerator.js +24 -22
  351. package/dist/src/lib/swift-codegen/agentGenerator.js.map +1 -1
  352. package/dist/src/lib/swift-codegen/banners.d.ts +12 -0
  353. package/dist/src/lib/swift-codegen/banners.js +12 -0
  354. package/dist/src/lib/swift-codegen/banners.js.map +1 -1
  355. package/dist/src/lib/swift-codegen/functionGenerator.d.ts +36 -1
  356. package/dist/src/lib/swift-codegen/functionGenerator.js +168 -50
  357. package/dist/src/lib/swift-codegen/functionGenerator.js.map +1 -1
  358. package/dist/src/lib/swift-codegen/schemaToSwift.d.ts +31 -7
  359. package/dist/src/lib/swift-codegen/schemaToSwift.js +213 -177
  360. package/dist/src/lib/swift-codegen/schemaToSwift.js.map +1 -1
  361. package/dist/src/lib/swift-codegen/sharedGenerator.d.ts +45 -0
  362. package/dist/src/lib/swift-codegen/sharedGenerator.js +165 -0
  363. package/dist/src/lib/swift-codegen/sharedGenerator.js.map +1 -0
  364. package/dist/src/lib/swift-codegen/userPropertiesGenerator.d.ts +30 -0
  365. package/dist/src/lib/swift-codegen/userPropertiesGenerator.js +69 -0
  366. package/dist/src/lib/swift-codegen/userPropertiesGenerator.js.map +1 -0
  367. package/dist/src/lib/sync-resource-types.d.ts +37 -5
  368. package/dist/src/lib/sync-resource-types.js +50 -5
  369. package/dist/src/lib/sync-resource-types.js.map +1 -1
  370. package/dist/src/lib/sync-selectors.d.ts +7 -0
  371. package/dist/src/lib/sync-selectors.js +22 -2
  372. package/dist/src/lib/sync-selectors.js.map +1 -1
  373. package/dist/src/lib/test-runs.d.ts +45 -0
  374. package/dist/src/lib/test-runs.js +150 -0
  375. package/dist/src/lib/test-runs.js.map +1 -0
  376. package/dist/src/lib/toml-database-config.d.ts +2 -1
  377. package/dist/src/lib/toml-database-config.js +7 -4
  378. package/dist/src/lib/toml-database-config.js.map +1 -1
  379. package/dist/src/lib/toml-scalar-edit.js +6 -4
  380. package/dist/src/lib/toml-scalar-edit.js.map +1 -1
  381. package/dist/src/lib/transition-warnings.d.ts +21 -0
  382. package/dist/src/lib/transition-warnings.js +49 -0
  383. package/dist/src/lib/transition-warnings.js.map +1 -0
  384. package/dist/src/lib/user-index.d.ts +80 -0
  385. package/dist/src/lib/user-index.js +166 -0
  386. package/dist/src/lib/user-index.js.map +1 -0
  387. package/dist/src/lib/user-properties/generated-properties-schema.d.ts +159 -0
  388. package/dist/src/lib/user-properties/generated-properties-schema.js +471 -0
  389. package/dist/src/lib/user-properties/generated-properties-schema.js.map +1 -0
  390. package/dist/src/lib/user-properties/user-properties-codegen.d.ts +55 -0
  391. package/dist/src/lib/user-properties/user-properties-codegen.js +129 -0
  392. package/dist/src/lib/user-properties/user-properties-codegen.js.map +1 -0
  393. package/dist/src/lib/user-walk.d.ts +31 -0
  394. package/dist/src/lib/user-walk.js +102 -0
  395. package/dist/src/lib/user-walk.js.map +1 -0
  396. package/dist/src/lib/worker-perf-format.d.ts +22 -0
  397. package/dist/src/lib/worker-perf-format.js +27 -0
  398. package/dist/src/lib/worker-perf-format.js.map +1 -0
  399. package/dist/src/types/index.d.ts +13 -34
  400. package/package.json +5 -3
@@ -28,6 +28,61 @@ export interface BlobInfo {
28
28
  uploaded?: string | null;
29
29
  etag?: string | null;
30
30
  }
31
+ /**
32
+ * The `authorize` and `input` fields of one function version as the admin API
33
+ * answers it (a configs-list item, a version get, a push answer). `input` is
34
+ * the list of top-level input keys the version's `authorize` callable declared,
35
+ * recorded by the server at push; `null` for a version without `authorize` and
36
+ * for one that declared no list. Annotate a version read with it to type the
37
+ * two fields.
38
+ */
39
+ export interface FunctionVersionInputFields {
40
+ authorize?: boolean;
41
+ input?: string[] | null;
42
+ /** #5840 — whether this version opens to signed-out callers. */
43
+ signedOut?: boolean;
44
+ }
45
+ /**
46
+ * The live version's `authorize` flag and `input` list as the function get
47
+ * and each functions-list item answer them. Both are `null` when no version is
48
+ * active; `activeConfigInput` is also `null` when the live version recorded no
49
+ * list.
50
+ */
51
+ export interface FunctionActiveInputFields {
52
+ activeConfigAuthorize?: boolean | null;
53
+ activeConfigInput?: string[] | null;
54
+ /**
55
+ * #5840 — whether the live version opens to signed-out callers while the
56
+ * app's `signedOutAccess` is on; `null` when no version is active.
57
+ */
58
+ activeConfigSignedOut?: boolean | null;
59
+ }
60
+ /**
61
+ * An app as `GET /admin/api/apps/{appId}` serializes it. Dates are ISO-8601
62
+ * strings. The lineage fields are null on an app with no parent, and
63
+ * `ownerAdminId`, `branch`, `idleDays` and `expiresAt` appear only on a child.
64
+ */
65
+ export interface AdminApp {
66
+ appId: string;
67
+ name: string;
68
+ mode: string;
69
+ baseUrl: string | null;
70
+ createdBy: string | null;
71
+ /** The format new root documents are minted in, or null when the app never chose. */
72
+ rootDocumentFormat: string | null;
73
+ protection: string;
74
+ parentAppId: string | null;
75
+ childSlug: string | null;
76
+ lastActivityAt: string | null;
77
+ ownerAdminId?: string | null;
78
+ branch?: string | null;
79
+ idleDays?: number | null;
80
+ expiresAt?: string | null;
81
+ createdAt: string;
82
+ modifiedAt: string;
83
+ /** The app's remaining settings (auth, CORS, passkeys, invitations, …). */
84
+ [setting: string]: unknown;
85
+ }
31
86
  /**
32
87
  * One child app as `GET /admin/api/apps/{appId}/children` lists it. Dates
33
88
  * are ISO-8601 strings.
@@ -61,6 +116,20 @@ export interface ChildPreviewOrigins {
61
116
  previewOrigins: string[];
62
117
  }
63
118
  /** One row of a db3's index registry, as `db3/:id/indexes` answers it. */
119
+ /** What a db3 index is (#5220). */
120
+ export type Db3IndexKind = "scalar" | "members" | "text" | "vector";
121
+ /** Where a db3 index lives (#5220). */
122
+ export type Db3IndexPlacement = "server" | "device" | "both";
123
+ /** A `vector` index's options on its registration (#5225): how devices search the field. */
124
+ export interface Db3VectorIndexOptions {
125
+ distance?: "cos" | "l2";
126
+ index?: "exact" | {
127
+ mode: "ann";
128
+ nbucket?: number;
129
+ codesize?: number;
130
+ quantizer?: "pq" | "opq" | "bq";
131
+ };
132
+ }
64
133
  export interface Db3IndexRow {
65
134
  name: string;
66
135
  model: string;
@@ -72,6 +141,292 @@ export interface Db3IndexRow {
72
141
  kind: "declaration" | "named";
73
142
  unique: boolean;
74
143
  }>;
144
+ /** What the index is; a server from before #5220 lists none. */
145
+ kind?: Db3IndexKind;
146
+ /** Where the index lives; a server from before #5220 lists none. */
147
+ on?: Db3IndexPlacement;
148
+ /** A text index's options, every one filled in (#5222); absent on any other kind. */
149
+ text?: Db3TextIndexOptions;
150
+ /** A vector index's options filled in, with its field's `dims` and `element` (#5229); absent on any other kind. */
151
+ vector?: Db3VectorIndexOptions & {
152
+ dims?: number;
153
+ element?: "f32" | "f16" | "i8";
154
+ };
155
+ /** A vector index's generation: new at every registration (#5229). */
156
+ generation?: number;
157
+ /** A vector index's model revision: moved on when its model is deleted (#5229). */
158
+ revision?: number;
159
+ /** An `ann` vector index's shared model, once a device uploaded one (#5229). */
160
+ annModel?: Db3IndexAnnModel;
161
+ }
162
+ /** An `ann` vector index's shared model as `GET db3/:id/indexes` lists it (#5229). */
163
+ export interface Db3IndexAnnModel {
164
+ revision: number;
165
+ trainedAt: string;
166
+ rows: number;
167
+ bytes: number;
168
+ format: string;
169
+ }
170
+ /** What `db3/:id/records/:model/explain` takes (#5240): the read, as its records route takes it, and an optional force. */
171
+ export interface Db3ExplainRequest {
172
+ op: "query" | "count" | "aggregate";
173
+ filter?: Record<string, any>;
174
+ options?: {
175
+ sort?: unknown;
176
+ limit?: number | string;
177
+ cursor?: string;
178
+ include?: unknown;
179
+ };
180
+ aggregate?: Record<string, unknown>;
181
+ /** An index of the model to force the read onto, or `"none"`. */
182
+ index?: string;
183
+ }
184
+ /** One statement an explained read ran (#5240). */
185
+ export interface Db3ExplainedStatement {
186
+ model: string;
187
+ sql: string;
188
+ runs: number;
189
+ plan: string[] | null;
190
+ planError?: string;
191
+ indexes: string[];
192
+ scan: boolean;
193
+ }
194
+ /** What `db3/:id/records/:model/explain` answers (#5240). */
195
+ export interface Db3ExplainAnswer {
196
+ op: "query" | "count" | "aggregate";
197
+ model: string;
198
+ index: string | null;
199
+ indexes: string[];
200
+ scanned: string[];
201
+ statements: Db3ExplainedStatement[];
202
+ answered: number;
203
+ cost: {
204
+ rowsRead: number | null;
205
+ rowsWritten: number | null;
206
+ };
207
+ stats: boolean;
208
+ sqlite: string;
209
+ }
210
+ /** A text index's tokenizer (#5222). */
211
+ export type Db3TextTokenizer = "unicode61" | "porter";
212
+ /** A text index's options (#5222): as `list` answers them every one is filled in; a registration gives any. */
213
+ export interface Db3TextIndexOptions {
214
+ tokenizer: Db3TextTokenizer;
215
+ prefix: number[];
216
+ weights: Record<string, number>;
217
+ }
218
+ /** `GET`/`PATCH users/index/limits`: the shard limit overrides and effective limits, and the property caps. */
219
+ export interface UserIndexLimitsAnswer {
220
+ overrides: Record<string, number | null> | null;
221
+ effective: Record<string, unknown>;
222
+ caps?: {
223
+ effective: Record<string, number>;
224
+ overrides: Record<string, number | null> | null;
225
+ };
226
+ }
227
+ /** One revalidation slice of an app's user index: when it ran, what started it, and its counts. */
228
+ export type UserIndexSlice = {
229
+ at: string;
230
+ startedAt: string;
231
+ durationMs: number;
232
+ trigger: "alarm" | "demand";
233
+ intervalMs: number;
234
+ nextAt: string;
235
+ batches: number;
236
+ continuations: number;
237
+ behind: boolean;
238
+ hinted: number;
239
+ verified: number;
240
+ stamped: number;
241
+ reprojected: number;
242
+ deleted: number;
243
+ applied: number;
244
+ misplaced: number;
245
+ failed: number;
246
+ sourcePages: number;
247
+ swept: number;
248
+ invitationClaims: number;
249
+ };
250
+ /**
251
+ * `POST users/index/reconcile`: 202 once one slice ran, or 200 with no slice
252
+ * while the app is being deleted.
253
+ */
254
+ export type UserIndexReconcileAnswer = {
255
+ ok: boolean;
256
+ started: true;
257
+ mode: "slice";
258
+ slice: UserIndexSlice;
259
+ reason?: undefined;
260
+ } | {
261
+ ok: boolean;
262
+ started: false;
263
+ reason: "closed";
264
+ };
265
+ /** The body of `POST users/walks` (#5393): the batch function, the walk's key, which users in what batches. */
266
+ export interface UserWalkStartBody {
267
+ function: string;
268
+ key: string;
269
+ filter?: Record<string, unknown>;
270
+ sort?: Record<string, 1 | -1>;
271
+ input?: unknown;
272
+ batchSize?: number;
273
+ concurrency?: number;
274
+ snapshot?: boolean;
275
+ }
276
+ /** A started (or found) users walk. */
277
+ export interface UserWalkStartAnswer {
278
+ runId: string;
279
+ walkId: string;
280
+ key: string;
281
+ status: string;
282
+ existing: boolean;
283
+ }
284
+ /** A users walk read: the coordinator's view (null when it holds no state) and the walk's run row. */
285
+ export interface UserWalkAnswer {
286
+ status: {
287
+ status: string;
288
+ walk: Record<string, any> | null;
289
+ };
290
+ run: Record<string, any>;
291
+ /** On a terminate only: whether this call ended the walk. */
292
+ terminated?: boolean;
293
+ }
294
+ /** One window length of a rate counter, as `GET rate-counters/:key` answers it. */
295
+ export interface RateCounterWindow {
296
+ windowSeconds: number;
297
+ /** The limit of the latest lease request. */
298
+ limit: number;
299
+ windowStart: string;
300
+ windowEnd: string;
301
+ granted: number;
302
+ returned: number;
303
+ held: number;
304
+ remaining: number;
305
+ /** Lease requests answered with no slots in the window. */
306
+ emptyGrants: number;
307
+ /** Isolates holding leases in the window; `leases` lists at most 50. */
308
+ leaseCount: number;
309
+ leases: Array<{
310
+ isolateId: string;
311
+ granted: number;
312
+ returned: number;
313
+ lastLeaseAt: string;
314
+ }>;
315
+ previous: {
316
+ windowStart: string;
317
+ granted: number;
318
+ returned: number;
319
+ emptyGrants: number;
320
+ } | null;
321
+ }
322
+ /** `GET /admin/api/apps/:appId/rate-counters/:key`: `counters` is empty for a key nothing counted. */
323
+ export interface RateCounterState {
324
+ appId: string;
325
+ key: string;
326
+ counters: RateCounterWindow[];
327
+ }
328
+ /** The active user properties schema, as `GET users/properties` answers it. */
329
+ export interface UserPropertiesActive {
330
+ version: number;
331
+ hash: string;
332
+ fields: Record<string, any>;
333
+ uniqueConstraints: Array<{
334
+ name: string;
335
+ fields: string[];
336
+ }>;
337
+ modifiedAt: string | null;
338
+ }
339
+ /** `GET users/properties`. */
340
+ export interface UserPropertiesState {
341
+ appId: string;
342
+ active: UserPropertiesActive | null;
343
+ /** Always null: a push publishes or is refused at once. */
344
+ staged: null;
345
+ removedFields: Record<string, {
346
+ type: string;
347
+ removedAt: string;
348
+ }>;
349
+ caps: {
350
+ effective: Record<string, number>;
351
+ overrides: Record<string, number | null> | null;
352
+ };
353
+ }
354
+ /** One member with their properties, as `GET users/{userId}`, `POST users/get-by` and a property write answer it (#5386). */
355
+ export interface AppUserWithProperties {
356
+ userId: string;
357
+ email: string | null;
358
+ name: string | null;
359
+ avatarUrl: string | null;
360
+ role: string | null;
361
+ status: string;
362
+ disabledAt?: string;
363
+ addedAt: string | null;
364
+ testUser: boolean;
365
+ properties: Record<string, unknown>;
366
+ }
367
+ /** A property write's body (#5386): a merge-patch (null clears), set additions and removals, and a condition checked inside the write. */
368
+ export interface AppUserPropertiesWrite {
369
+ patch?: Record<string, unknown>;
370
+ addToSet?: Record<string, string[]>;
371
+ removeFromSet?: Record<string, string[]>;
372
+ condition?: Record<string, unknown>;
373
+ }
374
+ /** `PUT users/properties`. */
375
+ export interface UserPropertiesPushAnswer {
376
+ outcome: "published" | "unchanged" | "would-publish";
377
+ active?: UserPropertiesActive | null;
378
+ removedFields?: Record<string, {
379
+ type: string;
380
+ removedAt: string;
381
+ }>;
382
+ checks?: Array<Record<string, unknown>>;
383
+ }
384
+ /** One version of a `schemas/` file, as `GET …/schemas` lists it (#5532). */
385
+ export interface SchemaFileMeta {
386
+ file: string;
387
+ version: number;
388
+ tombstone: boolean;
389
+ /** sha256 hex of the source; null on a tombstone. */
390
+ sourceHash: string | null;
391
+ /** The file's def names, in file order; empty on a tombstone. */
392
+ defs: string[];
393
+ createdAt: string;
394
+ }
395
+ /** One version of a `schemas/` file with its source and compiled defs (`GET …/schemas/:file`). */
396
+ export interface SchemaFileVersion extends SchemaFileMeta {
397
+ /** Whether this is the file's current version. */
398
+ current: boolean;
399
+ createdBy: string;
400
+ source: string | null;
401
+ /**
402
+ * The compiled defs and, for a version stored since #5533, each def's
403
+ * provenance: where it inlined refs and the hash of each def it inlined.
404
+ */
405
+ compiled: {
406
+ defs: Record<string, unknown>;
407
+ provenance?: Record<string, SchemaFileProvenance>;
408
+ } | null;
409
+ }
410
+ /** One def's provenance: inlined pointer → the chain of refs inlined there, each with its def's hash (#5533). */
411
+ export type SchemaFileProvenance = Record<string, {
412
+ chain: Array<{
413
+ ref: string;
414
+ hash: string;
415
+ }>;
416
+ }>;
417
+ /** What a `schemas/` push answers (`PUT …/schemas/:file`). */
418
+ export interface SchemaPushAnswer extends SchemaFileMeta {
419
+ outcome: "created" | "unchanged" | "tombstoned";
420
+ warnings: string[];
421
+ }
422
+ /** One live file's source, as `POST …/schemas/pull` answers it. */
423
+ export interface SchemaPullItem {
424
+ file: string;
425
+ version: number;
426
+ sourceHash: string;
427
+ defs: string[];
428
+ createdAt: string;
429
+ source: string;
75
430
  }
76
431
  export declare class ApiError extends Error {
77
432
  statusCode: number;
@@ -184,6 +539,14 @@ interface EmailTemplateDetail {
184
539
  description: string;
185
540
  }[];
186
541
  }
542
+ /** The server's rendering of an email template, from the preview route. */
543
+ export interface EmailTemplatePreview {
544
+ renderedSubject: string;
545
+ renderedHtml: string;
546
+ renderedText: string;
547
+ /** The variable values that were rendered: the type's samples, overridden by the caller's. */
548
+ sampleVariables: Record<string, string>;
549
+ }
187
550
  interface EmailTemplateUpsertResult {
188
551
  emailType: string;
189
552
  templateId: string;
@@ -203,6 +566,23 @@ type AnalyticsTestUsersMode = "include" | "exclude" | "only";
203
566
  interface AnalyticsTestUsersParam {
204
567
  testUsers?: AnalyticsTestUsersMode;
205
568
  }
569
+ /**
570
+ * #5251 — `_bust=1`: the analytics read recomputes instead of answering from
571
+ * the server's cache.
572
+ */
573
+ interface AnalyticsFreshParam {
574
+ _bust?: "1";
575
+ }
576
+ /**
577
+ * #5251 — one `filter[<field>][<operator>]` entry of an events or errors
578
+ * query, with the server's operator name (`is`, `is not`, `contains`,
579
+ * `starts with`).
580
+ */
581
+ export interface AnalyticsFilterParam {
582
+ field: string;
583
+ operator: string;
584
+ value: string;
585
+ }
206
586
  interface AnalyticsTiming {
207
587
  total_ms: number;
208
588
  wae_queries: number[];
@@ -278,6 +658,439 @@ interface AnalyticsUserSummary {
278
658
  interface AnalyticsTopUserRow extends AnalyticsUserSummary {
279
659
  firstSeenInWindow: string;
280
660
  }
661
+ /** One meter of a usage month (`GET apps/{appId}/usage`). */
662
+ export interface UsageMonthMeter {
663
+ meter: string;
664
+ kind: "usage" | "storage";
665
+ unit: string;
666
+ quantity: number;
667
+ /** Estimated cost in millionths of a dollar, unrounded. */
668
+ estCostMicros: number;
669
+ bytes: number;
670
+ points: number;
671
+ }
672
+ /** One meter of one day of a usage month. */
673
+ export interface UsageDayMeter {
674
+ meter: string;
675
+ kind: "usage" | "storage";
676
+ quantity: number;
677
+ estCostMicros: number;
678
+ bytes: number;
679
+ points: number;
680
+ source: "live" | "closed";
681
+ frozen: boolean;
682
+ }
683
+ /** A stored transition override: the value, when it was set (epoch ms) and by whom (#5821). */
684
+ export interface AppTransitionOverride {
685
+ v: string;
686
+ at: number;
687
+ by: string;
688
+ }
689
+ /** One platform transition's state for an app, with its registry entry (#5821). */
690
+ export interface AppTransitionState {
691
+ transition: string;
692
+ value: string;
693
+ source: "override" | "parent" | "newAppsFrom" | "default";
694
+ override: AppTransitionOverride | null;
695
+ values: string[];
696
+ v1: string;
697
+ v2: string;
698
+ existingAppsDefault: string;
699
+ newAppsFrom: string;
700
+ owner: string;
701
+ removeBy: string;
702
+ autoMove: "off" | "non-production" | "all";
703
+ migration: TransitionMigrationRecord | null;
704
+ }
705
+ /**
706
+ * An app's record of a transition's data migration (#5823): every field but
707
+ * `name` is null when the app has no record yet.
708
+ */
709
+ export interface TransitionMigrationRecord {
710
+ name: string;
711
+ status: "queued" | "running" | "blocked" | "complete" | null;
712
+ /** The handler's position. */
713
+ cursor: string | null;
714
+ counts: {
715
+ scanned: number;
716
+ migrated: number;
717
+ skipped: number;
718
+ } | null;
719
+ /** The app-side step a blocked migration waits for. */
720
+ waitingOn: string | null;
721
+ finishedAt: string | null;
722
+ /** While a rerun is in progress, the earlier completion's finish time. */
723
+ previousFinishedAt: string | null;
724
+ startedAt: string | null;
725
+ lastRunAt: string | null;
726
+ lastError: {
727
+ at: string;
728
+ message: string;
729
+ } | null;
730
+ }
731
+ /** `GET apps/{appId}/transitions`: every registered transition's state for the app (#5821). */
732
+ export interface AppTransitionsResponse {
733
+ appId: string;
734
+ parentAppId: string | null;
735
+ transitions: AppTransitionState[];
736
+ }
737
+ /** A committed transition set, or `unchanged: true` for one equal to the app's override (#5821). */
738
+ export type AppTransitionSetResponse = {
739
+ appId: string;
740
+ transition: string;
741
+ from: string;
742
+ to: string;
743
+ changeId: string;
744
+ at: number;
745
+ by: string;
746
+ } | {
747
+ appId: string;
748
+ transition: string;
749
+ value: string;
750
+ unchanged: true;
751
+ };
752
+ /** One row of an app's transition history (#5821). */
753
+ export interface AppTransitionChange {
754
+ changeId: string;
755
+ transition: string;
756
+ from: string | null;
757
+ to: string | null;
758
+ /** Epoch ms. */
759
+ at: number | null;
760
+ by: string | null;
761
+ reason: string | null;
762
+ children: string[] | null;
763
+ reading: Record<string, unknown> | null;
764
+ }
765
+ /** One registered transition's facts, as `GET transitions` lists them (#5822). */
766
+ export interface TransitionListEntry {
767
+ transition: string;
768
+ values: string[];
769
+ v1: string;
770
+ v2: string;
771
+ existingAppsDefault: string;
772
+ newAppsFrom: string;
773
+ counter: string;
774
+ window: {
775
+ moveDays: number;
776
+ contractDays: number;
777
+ };
778
+ owner: string;
779
+ removeBy: string;
780
+ autoMove: "off" | "non-production" | "all";
781
+ migration: string | null;
782
+ firstReadAt: string | null;
783
+ /** This environment's contract-ready record, or null (#5824). */
784
+ contractReady: TransitionContractReady | null;
785
+ }
786
+ /** A transition's contract-ready record in one environment (#5824). */
787
+ export interface TransitionContractReady {
788
+ ready: boolean;
789
+ /** ISO instant of the sweep that wrote it. */
790
+ at: string;
791
+ /** Apps the sweep counted. */
792
+ apps: number;
793
+ /** The environment-wide count over `contractDays`. */
794
+ count: number;
795
+ }
796
+ /** `GET transitions`: the registry, and apps per value from one budgeted walk (#5822). */
797
+ export interface TransitionListResponse {
798
+ environment: string;
799
+ transitions: TransitionListEntry[];
800
+ apps: {
801
+ counted: number;
802
+ complete: boolean;
803
+ coveredThrough: string | null;
804
+ byValue: Record<string, Record<string, number>>;
805
+ } | null;
806
+ }
807
+ /** One app's line of a transition report (#5822). */
808
+ export interface TransitionReportItem {
809
+ appId: string;
810
+ name: string | null;
811
+ parentAppId: string | null;
812
+ deleted: boolean;
813
+ value: string | null;
814
+ source: "override" | "parent" | "newAppsFrom" | "default" | null;
815
+ override: AppTransitionOverride | null;
816
+ counts: Array<{
817
+ callSite: string;
818
+ count: number;
819
+ }>;
820
+ countsTruncated: boolean;
821
+ total: number;
822
+ lastUseAt: string | null;
823
+ droppedPoints: number;
824
+ movesWith: string | null;
825
+ migration: TransitionMigrationRecord | null;
826
+ eligibleAt: string | null;
827
+ eligibleOn: string | null;
828
+ eligibility: "moved" | "eligible" | "waiting" | "no-first-read" | "with-parent" | "incomplete" | null;
829
+ }
830
+ /** `GET transitions/{transition}/report`: one page of apps (#5822). */
831
+ export interface TransitionReportResponse {
832
+ transition: string;
833
+ environment: string;
834
+ source: "wae" | "sink";
835
+ window: {
836
+ since: string;
837
+ until: string;
838
+ days: number;
839
+ };
840
+ firstReadAt: string | null;
841
+ /** The transition's migration and where its nightly walk stands, or null when it declares none (#5823). */
842
+ migration: {
843
+ name: string;
844
+ walk: {
845
+ pass: number;
846
+ after: string | null;
847
+ appsCovered: number;
848
+ finished: boolean;
849
+ lastRunAt: string | null;
850
+ } | null;
851
+ } | null;
852
+ items: TransitionReportItem[];
853
+ truncated: boolean;
854
+ hasMore: boolean;
855
+ nextCursor: string | null;
856
+ }
857
+ /** One row of the deprecated-calls report: one app, operation, source and client kind (#5916). */
858
+ export interface DeprecatedCall {
859
+ appId: string;
860
+ /** Recorded on an admin surface for no app of its own: `appId` is the admin partition. */
861
+ platform: boolean;
862
+ /** `<surface>:<METHOD> /<pattern>` for HTTP, `ws:<type>` for a WebSocket message. */
863
+ operation: string;
864
+ /** `api`, `fn` or `ws`. */
865
+ source: string;
866
+ /** `js`, `swift`, `cli`, `fn` or `unknown`. */
867
+ client: string;
868
+ /** Calls in the window; sampling-weighted on Analytics Engine, so an estimate there. */
869
+ count: number;
870
+ lastUseAt: string | null;
871
+ }
872
+ /** `GET transitions/deprecated-calls`: recent calls to deprecated operations (#5916). */
873
+ export interface DeprecatedCallsResponse {
874
+ environment: string;
875
+ source: "wae" | "sink";
876
+ window: {
877
+ since: string;
878
+ until: string;
879
+ days: number;
880
+ };
881
+ /** Most calls first. */
882
+ calls: DeprecatedCall[];
883
+ /** The rows reached the limit: narrow with an app or an operation. */
884
+ truncated: boolean;
885
+ }
886
+ /** The reading the move step decides a unit on (#5824). */
887
+ export interface TransitionReading {
888
+ count: number;
889
+ droppedPoints: number;
890
+ environment: string;
891
+ source: string;
892
+ windowStart: string;
893
+ windowEnd: string;
894
+ observedAt: string;
895
+ firstReadAt: string | null;
896
+ }
897
+ /** One unit not on V2 in a transition's move plan (#5824). */
898
+ export interface TransitionMovePlanItem {
899
+ appId: string;
900
+ name: string | null;
901
+ parentAppId: string | null;
902
+ /** What the next run does when it reaches the unit. */
903
+ action: "move" | "move-if-migrated" | "hold";
904
+ reason: string | null;
905
+ /** The member a `migration` hold names. */
906
+ member: string | null;
907
+ /** `behind`: the nightly walk has passed the unit in this pass, so it waits for the next. */
908
+ walk: "ahead" | "behind";
909
+ children: string[];
910
+ reading: TransitionReading;
911
+ total: number;
912
+ droppedPoints: number;
913
+ lastUseAt: string | null;
914
+ eligibleAt: string | null;
915
+ migration: Array<{
916
+ appId: string;
917
+ status: string | null;
918
+ }> | null;
919
+ }
920
+ /** `GET transitions/{transition}/move-plan`: one page of what the next move run would do (#5824). */
921
+ export interface TransitionMovePlanResponse {
922
+ transition: string;
923
+ environment: string;
924
+ source: "wae" | "sink";
925
+ autoMove: "off" | "non-production" | "all";
926
+ allowed: boolean;
927
+ firstReadAt: string | null;
928
+ window: {
929
+ since: string;
930
+ until: string;
931
+ days: number;
932
+ };
933
+ walk: {
934
+ after: string | null;
935
+ pass: number;
936
+ finished: boolean;
937
+ retry: {
938
+ appId: string;
939
+ } | null;
940
+ skip: string[];
941
+ sweepDue: boolean;
942
+ } | null;
943
+ contractReady: TransitionContractReady | null;
944
+ items: TransitionMovePlanItem[];
945
+ hasMore: boolean;
946
+ nextCursor: string | null;
947
+ }
948
+ /** An app's usage and estimated cost for a month, by meter and by day. */
949
+ export interface AppUsageMonthResponse {
950
+ appId: string;
951
+ month: string;
952
+ current: boolean;
953
+ source: "wae" | "sink" | null;
954
+ app: {
955
+ name: string | null;
956
+ parentAppId: string | null;
957
+ createdByAdminId: string | null;
958
+ deleted: boolean;
959
+ };
960
+ meters: UsageMonthMeter[];
961
+ days: Array<{
962
+ day: string;
963
+ estCostMicros: number;
964
+ meters: UsageDayMeter[];
965
+ }>;
966
+ storage: {
967
+ current: Array<{
968
+ meter: string;
969
+ bytes: number;
970
+ }>;
971
+ };
972
+ /** A parent app's children, one line each. */
973
+ children?: Array<{
974
+ appId: string;
975
+ name: string | null;
976
+ deleted: boolean;
977
+ estCostMicros: number;
978
+ meters: Array<{
979
+ meter: string;
980
+ kind: "usage" | "storage";
981
+ quantity: number;
982
+ estCostMicros: number;
983
+ }>;
984
+ }>;
985
+ total: {
986
+ estCostMicros: number;
987
+ app: number;
988
+ children: number;
989
+ };
990
+ truncated: boolean;
991
+ }
992
+ /** A live usage window: ISO 8601 bounds, UTC, half-open. */
993
+ export interface UsageWindowParams {
994
+ since?: string;
995
+ until?: string;
996
+ }
997
+ /** An app's top users over a window. */
998
+ export interface AppUsageTopUsersResponse {
999
+ appId: string;
1000
+ since: string;
1001
+ until: string;
1002
+ by: "quantity" | "cost";
1003
+ meter: string | null;
1004
+ rows: Array<{
1005
+ billedTo: string;
1006
+ quantity: number | null;
1007
+ estCostMicros: number;
1008
+ points: number;
1009
+ }>;
1010
+ }
1011
+ /** One user's usage over a window and the bytes they own. */
1012
+ export interface AppUsageUserResponse {
1013
+ appId: string;
1014
+ billedTo: string;
1015
+ since: string;
1016
+ until: string;
1017
+ meters: Array<{
1018
+ meter: string;
1019
+ unit: string;
1020
+ quantity: number;
1021
+ estCostMicros: number;
1022
+ bytes: number;
1023
+ points: number;
1024
+ }>;
1025
+ storage: Array<{
1026
+ meter: string;
1027
+ bytes: number;
1028
+ }>;
1029
+ }
1030
+ /** An app's system usage by origin, source, resource and meter. */
1031
+ export interface AppUsageSystemResponse {
1032
+ appId: string;
1033
+ since: string;
1034
+ until: string;
1035
+ meter: string | null;
1036
+ rows: Array<{
1037
+ origin: string;
1038
+ source: string;
1039
+ resourceId: string;
1040
+ meter: string;
1041
+ quantity: number;
1042
+ estCostMicros: number;
1043
+ points: number;
1044
+ }>;
1045
+ truncated: boolean;
1046
+ }
1047
+ /** What the super-admin month-to-date rankings share. */
1048
+ export interface UsageMonthToDate {
1049
+ month: string;
1050
+ basis: "usage+storage";
1051
+ source: "wae" | "sink" | null;
1052
+ /** False when a walk stopped at its page budget. */
1053
+ complete: boolean;
1054
+ /** When incomplete, the last app id the walk reached. */
1055
+ coveredThrough: string | null;
1056
+ }
1057
+ /** The cost fields of a ranking row, in millionths of a dollar. */
1058
+ export interface UsageCostFields {
1059
+ usageEstCostMicros: number;
1060
+ storageEstCostMicros: number;
1061
+ estCostMicros: number;
1062
+ points: number;
1063
+ }
1064
+ /** The top apps by estimated cost, month to date. */
1065
+ export interface UsageTopAppsResponse extends UsageMonthToDate {
1066
+ rows: Array<UsageCostFields & {
1067
+ appId: string;
1068
+ name: string | null;
1069
+ deleted: boolean;
1070
+ parentAppId: string | null;
1071
+ createdByAdminId: string | null;
1072
+ }>;
1073
+ }
1074
+ /** The top developers by estimated cost, month to date. */
1075
+ export interface UsageTopDevelopersResponse extends UsageMonthToDate {
1076
+ rows: Array<UsageCostFields & {
1077
+ adminId: string | null;
1078
+ email: string | null;
1079
+ name: string | null;
1080
+ }>;
1081
+ }
1082
+ /** One usage job's state. */
1083
+ export interface UsageJobView {
1084
+ startedAt: string | null;
1085
+ lastRunAt: string | null;
1086
+ cursor: unknown;
1087
+ appsCovered: number | null;
1088
+ finished: boolean | null;
1089
+ }
1090
+ /** Every usage job's state, null for a job that never ran. */
1091
+ export interface UsageJobsResponse {
1092
+ jobs: Record<string, UsageJobView | null>;
1093
+ }
281
1094
  interface AnalyticsTopUsersResponse {
282
1095
  windowDays: number;
283
1096
  limit: number;
@@ -394,6 +1207,54 @@ interface AnalyticsErrorsGroupsResponse {
394
1207
  rows: AnalyticsErrorGroupRow[];
395
1208
  _timing: AnalyticsTiming;
396
1209
  }
1210
+ /** One db3 query shape's cost over the window, per endpoint and function (#5244). */
1211
+ interface AnalyticsDb3QueryRow {
1212
+ shape_id: string;
1213
+ type: string;
1214
+ model: string;
1215
+ op: string;
1216
+ filter: string;
1217
+ sort: string;
1218
+ include: string;
1219
+ endpoint: string;
1220
+ function_id: string | null;
1221
+ function_key: string | null;
1222
+ calls: number;
1223
+ rows_read: number;
1224
+ rows_returned: number;
1225
+ rows_read_per_call: number;
1226
+ /** `null` when the calls returned nothing. */
1227
+ rows_read_per_returned: number | null;
1228
+ scanned_calls: number;
1229
+ counters_known_calls: number;
1230
+ }
1231
+ /** What `GET analytics/db3/queries` answers (#5244). */
1232
+ interface AnalyticsDb3QueriesResponse {
1233
+ window_days: number;
1234
+ order_by: "rowsRead" | "rowsPerReturned";
1235
+ rows: AnalyticsDb3QueryRow[];
1236
+ _timing: AnalyticsTiming;
1237
+ }
1238
+ /** One endpoint's (and function's) requests over the window (#5244). */
1239
+ interface AnalyticsRequestRow {
1240
+ method: string;
1241
+ path: string;
1242
+ function_id: string | null;
1243
+ function_key: string | null;
1244
+ requests: number;
1245
+ wall_ms_avg: number;
1246
+ wall_ms_p50: number;
1247
+ wall_ms_p95: number;
1248
+ dynamo_calls_per_request: number;
1249
+ dynamo_ms_per_request: number;
1250
+ cold_starts: number;
1251
+ }
1252
+ /** What `GET analytics/requests` answers (#5244). */
1253
+ interface AnalyticsRequestsResponse {
1254
+ window_days: number;
1255
+ rows: AnalyticsRequestRow[];
1256
+ _timing: AnalyticsTiming;
1257
+ }
397
1258
  /**
398
1259
  * What a `DELETE` on a status-carrying object answers (#2887, #2907).
399
1260
  *
@@ -420,6 +1281,34 @@ export interface IntegrationWritePayload {
420
1281
  timeoutMs?: number;
421
1282
  status?: string;
422
1283
  }
1284
+ /** A multipart part sent with an integration test request. */
1285
+ export interface IntegrationTestMultipartField {
1286
+ fieldName: string;
1287
+ /** `value` sends `value` as a text part; `attachment` sends the attachment at `attachmentIndex`. */
1288
+ type: "value" | "attachment";
1289
+ value?: string;
1290
+ attachmentIndex?: number;
1291
+ }
1292
+ /** Body accepted by `POST …/integrations/{id}/test`: the request under test. */
1293
+ export interface IntegrationTestPayload {
1294
+ method?: string;
1295
+ path?: string;
1296
+ query?: unknown;
1297
+ /** A JSON body. */
1298
+ body?: unknown;
1299
+ headers?: Record<string, string>;
1300
+ /** A url-encoded body; a name with an array value is sent as a repeated key. */
1301
+ form?: Record<string, string | string[]>;
1302
+ /** How the body is built; absent means JSON (or `form` when given). */
1303
+ bodyMode?: "raw" | "multipart";
1304
+ /** Files, each `{ name, type, data }` with `data` in base64. */
1305
+ attachments?: Array<{
1306
+ name: string;
1307
+ type: string;
1308
+ data: string;
1309
+ }>;
1310
+ multipartFields?: IntegrationTestMultipartField[];
1311
+ }
423
1312
  /**
424
1313
  * Integration detail response. `requestConfig` is only on the detail — the
425
1314
  * list summary does not carry it.
@@ -548,6 +1437,29 @@ export declare class ApiClient {
548
1437
  scope: string[];
549
1438
  apps: string[];
550
1439
  }>;
1440
+ /**
1441
+ * #5787 — what `primitive hosting` may send for the current credentials:
1442
+ * a CI token as it is (it cannot derive), or else nothing until a token is
1443
+ * derived; and whether an unexpired step-up that may reach `appId` is
1444
+ * stored. Throws the usual not-logged-in refusal.
1445
+ */
1446
+ hostingCredentials(appId: string): Promise<{
1447
+ ciToken: string | null;
1448
+ stepUp: boolean;
1449
+ }>;
1450
+ /**
1451
+ * #5787 — `POST /admin/api/auth/token` for hosting: a `write`-only token of
1452
+ * 15 minutes derived from the login, or from the stored step-up on a
1453
+ * protected app, pinned to `appId` when that bearer is pinned and unpinned
1454
+ * otherwise. Sent with exactly that bearer and never retried with another.
1455
+ */
1456
+ deriveHostingToken(input: {
1457
+ appId: string;
1458
+ from: "login" | "step-up";
1459
+ }): Promise<{
1460
+ accessToken: string;
1461
+ expiresAt: string;
1462
+ }>;
551
1463
  get<T = any>(path: string, params?: Record<string, any>): Promise<T>;
552
1464
  post<T = any>(path: string, body?: any): Promise<T>;
553
1465
  put<T = any>(path: string, body?: any): Promise<T>;
@@ -630,10 +1542,7 @@ export declare class ApiClient {
630
1542
  */
631
1543
  removeChildPreviewOrigin(parentAppId: string, slug: string, origin: string): Promise<ChildPreviewOrigins>;
632
1544
  private childPreviewOriginsPath;
633
- getApp(appId: string): Promise<{
634
- id: string;
635
- name: string;
636
- }>;
1545
+ getApp(appId: string): Promise<AdminApp>;
637
1546
  deleteApp(appId: string): Promise<void>;
638
1547
  getAppSettings(appId: string): Promise<any>;
639
1548
  updateAppSettings(appId: string, settings: any): Promise<any>;
@@ -642,6 +1551,22 @@ export declare class ApiClient {
642
1551
  role?: string;
643
1552
  name?: string;
644
1553
  avatarUrl?: string | null;
1554
+ initialProperties?: Record<string, unknown>;
1555
+ }): Promise<any>;
1556
+ /**
1557
+ * Invite an email to the app as a console admin
1558
+ * (`POST /admin/api/apps/:appId/users/invite`): the invitation, with its
1559
+ * `inviteToken` and the `initialProperties` it gives the invitee at
1560
+ * acceptance (filling only what they have not set).
1561
+ */
1562
+ inviteUser(appId: string, data: {
1563
+ email: string;
1564
+ role?: "admin" | "member";
1565
+ expiresAt?: string;
1566
+ sendEmail?: boolean;
1567
+ note?: string;
1568
+ source?: string;
1569
+ initialProperties?: Record<string, unknown>;
645
1570
  }): Promise<any>;
646
1571
  /**
647
1572
  * Set a member's display name and/or avatar URL
@@ -661,6 +1586,195 @@ export declare class ApiClient {
661
1586
  rebuildUserSearchText(appId: string): Promise<{
662
1587
  count: number;
663
1588
  }>;
1589
+ /**
1590
+ * One page of an app's users from the user index
1591
+ * (`POST /admin/api/apps/:appId/users/query`): the records-query filter and
1592
+ * sort over base fields and `properties.<name>`, at most 1,000 per page.
1593
+ */
1594
+ queryUsers(appId: string, body: {
1595
+ filter?: Record<string, unknown>;
1596
+ sort?: unknown;
1597
+ limit?: number;
1598
+ cursor?: string;
1599
+ }): Promise<{
1600
+ items: any[];
1601
+ hasMore: boolean;
1602
+ nextCursor?: string;
1603
+ prevCursor?: string;
1604
+ meta: any;
1605
+ }>;
1606
+ /** How many of an app's users match (`POST /admin/api/apps/:appId/users/count`). */
1607
+ countUsers(appId: string, body: {
1608
+ filter?: Record<string, unknown>;
1609
+ }): Promise<{
1610
+ count: number;
1611
+ meta: any;
1612
+ }>;
1613
+ /**
1614
+ * The state of an app's user index (`GET /admin/api/apps/:appId/users/index`):
1615
+ * the generation, each shard with its bound and counts, superseded
1616
+ * generations, a rebuild in progress, queued applies, the last apply and
1617
+ * reconciliation, the limits and whether the shard ceiling is reached.
1618
+ */
1619
+ getUserIndexStatus(appId: string): Promise<any>;
1620
+ /**
1621
+ * Start a report of which user metadata categories still hold rows on the
1622
+ * app's current members (`POST /admin/api/apps/:appId/users/metadata-report`).
1623
+ */
1624
+ startUserMetadataReport(appId: string): Promise<{
1625
+ ok: boolean;
1626
+ runId: string;
1627
+ resourceType: string;
1628
+ status: string;
1629
+ statusUrl: string;
1630
+ }>;
1631
+ /**
1632
+ * Read a user metadata report run, or the app's newest when `runId` is
1633
+ * absent (`GET /admin/api/apps/:appId/users/metadata-report`).
1634
+ */
1635
+ getUserMetadataReport(appId: string, runId?: string): Promise<any>;
1636
+ /** Start building the next generation of an app's user index (`POST /admin/api/apps/:appId/users/index/rebuild`). */
1637
+ rebuildUserIndex(appId: string): Promise<{
1638
+ ok: boolean;
1639
+ generation: number;
1640
+ build: any;
1641
+ }>;
1642
+ /**
1643
+ * Run one revalidation slice of an app's user index now
1644
+ * (`POST /admin/api/apps/:appId/users/index/reconcile`), answered when it is
1645
+ * done; `started: false` while the app is being deleted.
1646
+ */
1647
+ reconcileUserIndex(appId: string): Promise<UserIndexReconcileAnswer>;
1648
+ /**
1649
+ * Start (or find) a walk over an app's users with the admin as its starter
1650
+ * (`POST /admin/api/apps/:appId/users/walks`); `existing` says the key named
1651
+ * a walk that already existed.
1652
+ */
1653
+ startUserWalk(appId: string, body: UserWalkStartBody): Promise<UserWalkStartAnswer>;
1654
+ /** A users walk by its run id (`GET /admin/api/apps/:appId/users/walks/:runId`). */
1655
+ getUserWalk(appId: string, runId: string): Promise<UserWalkAnswer>;
1656
+ /** A rate counter's state by key (`GET /admin/api/apps/:appId/rate-counters/:key`). */
1657
+ getRateCounter(appId: string, key: string): Promise<RateCounterState>;
1658
+ /** Stop a users walk (`POST /admin/api/apps/:appId/users/walks/:runId/terminate`); batches in flight finish. */
1659
+ terminateUserWalk(appId: string, runId: string): Promise<UserWalkAnswer & {
1660
+ terminated: boolean;
1661
+ }>;
1662
+ /**
1663
+ * An app's user index limit overrides and the limits in effect, with the
1664
+ * property caps beside them (`GET /admin/api/apps/:appId/users/index/limits`).
1665
+ */
1666
+ getUserIndexLimits(appId: string): Promise<UserIndexLimitsAnswer>;
1667
+ /**
1668
+ * Set (a positive integer) or clear (`null`) an app's user index limit
1669
+ * overrides (`PATCH /admin/api/apps/:appId/users/index/limits`).
1670
+ */
1671
+ patchUserIndexLimits(appId: string, body: {
1672
+ shardThreshold?: number | null;
1673
+ shardBytes?: number | null;
1674
+ shardCeiling?: number | null;
1675
+ maxFields?: number | null;
1676
+ maxUnique?: number | null;
1677
+ maxIndexed?: number | null;
1678
+ maxBytes?: number | null;
1679
+ }): Promise<UserIndexLimitsAnswer>;
1680
+ /**
1681
+ * An app's user properties schema (`GET /admin/api/apps/:appId/users/properties`):
1682
+ * the active version, a push being validated, the removed fields and the caps.
1683
+ * While a push validates, this read also resumes its walk.
1684
+ */
1685
+ getUserProperties(appId: string): Promise<UserPropertiesState>;
1686
+ /**
1687
+ * Push the text of `user-properties.toml` (`PUT /admin/api/apps/:appId/users/properties`):
1688
+ * 200 `published` or `unchanged`, 400 when refused; `dryRun` judges it and
1689
+ * writes nothing.
1690
+ */
1691
+ pushUserProperties(appId: string, body: {
1692
+ schema: string;
1693
+ expectedModifiedAt?: string | null;
1694
+ }, options?: {
1695
+ dryRun?: boolean;
1696
+ }): Promise<UserPropertiesPushAnswer>;
1697
+ /**
1698
+ * The current version of each of an app's `schemas/` files
1699
+ * (`GET /admin/api/apps/:appId/schemas`); a tombstoned file only with
1700
+ * `includeTombstoned`.
1701
+ */
1702
+ listSchemaFiles(appId: string, options?: {
1703
+ includeTombstoned?: boolean;
1704
+ }): Promise<{
1705
+ items: SchemaFileMeta[];
1706
+ hasMore: boolean;
1707
+ }>;
1708
+ /**
1709
+ * One version of a `schemas/` file, the current one unless `version` names
1710
+ * another (`GET /admin/api/apps/:appId/schemas/:file`); 404
1711
+ * `SCHEMA_FILE_NOT_FOUND` or `SCHEMA_VERSION_NOT_FOUND`.
1712
+ */
1713
+ getSchemaFile(appId: string, file: string, options?: {
1714
+ version?: number;
1715
+ }): Promise<SchemaFileVersion>;
1716
+ /**
1717
+ * Push the text of `schemas/<file>.toml` with its compiled defs
1718
+ * (`PUT /admin/api/apps/:appId/schemas/:file`): `created` or `unchanged`;
1719
+ * 409 `CONFLICT` when the current version is not `expectedVersion`.
1720
+ */
1721
+ pushSchemaFile(appId: string, file: string, body: {
1722
+ source: string;
1723
+ compiled?: {
1724
+ defs: Record<string, unknown>;
1725
+ provenance?: Record<string, SchemaFileProvenance>;
1726
+ };
1727
+ expectedVersion?: number;
1728
+ }): Promise<SchemaPushAnswer>;
1729
+ /**
1730
+ * Write a tombstone version of a `schemas/` file (`PUT
1731
+ * /admin/api/apps/:appId/schemas/:file` with `{ tombstone: true }`), pinned
1732
+ * to `expectedVersion` when given.
1733
+ */
1734
+ tombstoneSchemaFile(appId: string, file: string, expectedVersion?: number): Promise<SchemaPushAnswer>;
1735
+ /**
1736
+ * The source of every live `schemas/` file, or of `files` only
1737
+ * (`POST /admin/api/apps/:appId/schemas/pull`); a named file with no live
1738
+ * version is listed under `missing`.
1739
+ */
1740
+ pullSchemaFiles(appId: string, files?: string[]): Promise<{
1741
+ items: SchemaPullItem[];
1742
+ missing: string[];
1743
+ }>;
1744
+ /** One member with their properties (`GET /admin/api/apps/:appId/users/:userId`); 404 `USER_NOT_FOUND` for a user who is no member. */
1745
+ getAppUser(appId: string, userId: string): Promise<AppUserWithProperties>;
1746
+ /**
1747
+ * The member who holds a unique property value or a unique constraint's
1748
+ * values (`POST /admin/api/apps/:appId/users/get-by`): `{ user }`, null when
1749
+ * no member holds it.
1750
+ */
1751
+ getAppUserBy(appId: string, selector: {
1752
+ field: string;
1753
+ value: unknown;
1754
+ } | {
1755
+ constraint: string;
1756
+ values: unknown[];
1757
+ }): Promise<{
1758
+ user: AppUserWithProperties | null;
1759
+ }>;
1760
+ /** Apply a property write to one member (`PATCH /admin/api/apps/:appId/users/:userId/properties`); answers the member after it. */
1761
+ setAppUserProperties(appId: string, userId: string, body: AppUserPropertiesWrite): Promise<AppUserWithProperties>;
1762
+ /** An aggregate over an app's users (`POST /admin/api/apps/:appId/users/aggregate`). */
1763
+ aggregateUsers(appId: string, body: {
1764
+ options: {
1765
+ operations: Array<{
1766
+ type: string;
1767
+ field?: string;
1768
+ }>;
1769
+ groupBy?: unknown[];
1770
+ filter?: Record<string, unknown>;
1771
+ sort?: unknown;
1772
+ limit?: number;
1773
+ };
1774
+ }): Promise<{
1775
+ result: any[];
1776
+ meta: any;
1777
+ }>;
664
1778
  listUsers(appId: string, params?: {
665
1779
  name?: string;
666
1780
  email?: string;
@@ -686,21 +1800,13 @@ export declare class ApiClient {
686
1800
  * routes already existed; nothing on the CLI reached them.
687
1801
  */
688
1802
  setUserAvailability(appId: string, userId: string, action: "enable" | "disable"): Promise<void>;
1803
+ updateUserRole(appId: string, userId: string, role: "admin" | "member"): Promise<any>;
689
1804
  /**
690
- * #2803 — the platform's feature flags. A server-owned admin toggle with a
691
- * console but, until now, no CLI: the same "one control, both surfaces" rule
692
- * the carrying types get.
693
- */
694
- listFeatureFlags(): Promise<any>;
695
- /**
696
- * The flag itself, not the `{ flag }` envelope the route answers with —
697
- * `feature-flags get` prints the key, the enabled state and the per-app
698
- * overrides, and reading them off the envelope printed a blank row.
1805
+ * Make the app user with `newOwnerEmail` the app's owner; the previous
1806
+ * owner becomes an admin. The email resolves to a userId through
1807
+ * {@link lookupUserByEmail}, and an email no user of the app has rejects
1808
+ * with a message naming it.
699
1809
  */
700
- getFeatureFlag(flagKey: string): Promise<any>;
701
- /** Same envelope, same unwrap: `enable`/`disable` print the updated flag. */
702
- setFeatureFlagEnabled(flagKey: string, enabled: boolean): Promise<any>;
703
- updateUserRole(appId: string, userId: string, role: "admin" | "member"): Promise<any>;
704
1810
  transferOwnership(appId: string, newOwnerEmail: string): Promise<void>;
705
1811
  transferAdminOwnership(appId: string, adminId: string): Promise<any>;
706
1812
  listAppAdmins(appId: string): Promise<any[]>;
@@ -722,6 +1828,19 @@ export declare class ApiClient {
722
1828
  nextCursor?: string;
723
1829
  hasMore?: boolean;
724
1830
  }>;
1831
+ /**
1832
+ * `GET /app/{appId}/api/invitations/{invitationId}` — one invitation with
1833
+ * its `inviteToken` (the bearer credential an accept link carries) and its
1834
+ * `status`. Readable by an app admin/owner or the inviter.
1835
+ */
1836
+ getInvitation(appId: string, invitationId: string): Promise<{
1837
+ invitationId: string;
1838
+ email: string;
1839
+ role: string;
1840
+ inviteToken: string | null;
1841
+ status: "pending" | "expired" | "accepted";
1842
+ [key: string]: any;
1843
+ }>;
725
1844
  createInvitation(appId: string, data: {
726
1845
  email: string;
727
1846
  role: "admin" | "member";
@@ -767,7 +1886,7 @@ export declare class ApiClient {
767
1886
  /**
768
1887
  * An integration's named configs. Test cases pin a config by NAME so the
769
1888
  * sidecar is portable across apps (#2769); this is the map pull and push
770
- * resolve that name through, the same way prompts/workflows/scripts do.
1889
+ * resolve that name through, the same way prompts do.
771
1890
  */
772
1891
  listIntegrationConfigs(appId: string, integrationId: string): Promise<{
773
1892
  items: any[];
@@ -783,7 +1902,7 @@ export declare class ApiClient {
783
1902
  deleteIntegration(appId: string, integrationId: string, hard?: boolean | {
784
1903
  hard?: boolean;
785
1904
  }): Promise<ArchiveEnvelope>;
786
- testIntegration(appId: string, integrationId: string, payload: any): Promise<any>;
1905
+ testIntegration(appId: string, integrationId: string, payload: IntegrationTestPayload): Promise<any>;
787
1906
  listIntegrationLogs(appId: string, integrationId: string, params?: {
788
1907
  limit?: number;
789
1908
  status?: string;
@@ -803,7 +1922,7 @@ export declare class ApiClient {
803
1922
  }): Promise<any>;
804
1923
  updateAppSecret(appId: string, secretId: string, payload: {
805
1924
  value?: string;
806
- summary?: string;
1925
+ summary?: string | null;
807
1926
  }): Promise<any>;
808
1927
  upsertAppSecret(appId: string, key: string, payload: {
809
1928
  value: string;
@@ -818,9 +1937,11 @@ export declare class ApiClient {
818
1937
  expectNotExists?: boolean;
819
1938
  }): Promise<any>;
820
1939
  deleteAppConfigVar(appId: string, key: string, expectedModifiedAt?: string): Promise<any>;
1940
+ /** Every function of the app; each item carries {@link FunctionActiveInputFields}. */
821
1941
  listFunctions(appId: string): Promise<{
822
1942
  items: any[];
823
1943
  }>;
1944
+ /** One function; the answer carries {@link FunctionActiveInputFields}. */
824
1945
  getFunction(appId: string, functionId: string): Promise<any>;
825
1946
  createFunction(appId: string, payload: any): Promise<any>;
826
1947
  updateFunction(appId: string, functionId: string, payload: any): Promise<any>;
@@ -1010,7 +2131,8 @@ export declare class ApiClient {
1010
2131
  * Paging is opt-in on the server: with no `limit` and no `cursor` every
1011
2132
  * version comes back, which is what this method did before paging existed and
1012
2133
  * what an already-installed CLI still asks for. A caller that passes either
1013
- * gets the shared `{ items, hasMore, nextCursor }` page.
2134
+ * gets the shared `{ items, hasMore, nextCursor }` page. Each item carries
2135
+ * {@link FunctionVersionInputFields}.
1014
2136
  */
1015
2137
  listFunctionConfigs(appId: string, functionId: string, options?: {
1016
2138
  limit?: number;
@@ -1026,6 +2148,7 @@ export declare class ApiClient {
1026
2148
  * from the next call.
1027
2149
  */
1028
2150
  activateFunctionConfig(appId: string, functionId: string, configId: string): Promise<any>;
2151
+ /** One version; the answer carries {@link FunctionVersionInputFields}. */
1029
2152
  getFunctionConfig(appId: string, functionId: string, configId: string): Promise<any>;
1030
2153
  /**
1031
2154
  * The stored envelope: the authored TOML bytes, every source file and the
@@ -1198,25 +2321,6 @@ export declare class ApiClient {
1198
2321
  configName?: string;
1199
2322
  description?: string;
1200
2323
  }): Promise<any>;
1201
- listScripts(appId: string): Promise<{
1202
- items: any[];
1203
- }>;
1204
- getScript(appId: string, scriptId: string): Promise<any>;
1205
- /**
1206
- * List a script's versioned configs (the `ScriptConfig` rows). Each config
1207
- * is a distinct block version: `configId` is the stable version selector,
1208
- * `contentHash` is its content identity, and `status` reports whether it is
1209
- * `active`/`draft`/`archived`. The script header's `activeConfigId` names
1210
- * the version that was live. Used by `scripts configs list`.
1211
- */
1212
- listScriptConfigs(appId: string, scriptId: string): Promise<{
1213
- items: any[];
1214
- }>;
1215
- /**
1216
- * One version of a script, body included. A body the server cannot load
1217
- * answers a 404 naming the version rather than an empty body.
1218
- */
1219
- getScriptConfig(appId: string, scriptId: string, configId: string): Promise<any>;
1220
2324
  getPromptSchema(appId: string, promptId: string): Promise<{
1221
2325
  promptId: string;
1222
2326
  promptKey: string;
@@ -1304,46 +2408,44 @@ export declare class ApiClient {
1304
2408
  comparisonGroup?: string;
1305
2409
  testCaseIds?: string[];
1306
2410
  }): Promise<any>;
2411
+ /**
2412
+ * One page of a block's test runs, newest first. The endpoint paginates
2413
+ * (default 50, cap 100) and reports `nextCursor`.
2414
+ */
1307
2415
  listTestRuns(appId: string, blockType: "prompt" | "integration", blockId: string, params?: {
1308
- limit?: number;
1309
- comparisonGroup?: string;
1310
- }): Promise<{
1311
- items: any[];
1312
- }>;
1313
- listWorkflows(appId: string, params?: {
1314
- status?: string;
1315
2416
  limit?: number;
1316
2417
  cursor?: string;
1317
2418
  }): Promise<{
1318
2419
  items: any[];
1319
2420
  hasMore?: boolean;
1320
- nextCursor?: string | null;
1321
- }>;
1322
- getWorkflow(appId: string, workflowId: string): Promise<any>;
1323
- listWorkflowConfigs(appId: string, workflowId: string): Promise<{
1324
- items: any[];
2421
+ nextCursor?: string;
1325
2422
  }>;
1326
- getWorkflowConfig(appId: string, workflowId: string, configId: string): Promise<any>;
2423
+ /**
2424
+ * One of a block's test runs: the object `listTestRuns` lists for it. The
2425
+ * run id travels as one path segment, so a `/`, `?` or `#` in it can never
2426
+ * reach the listing or the query.
2427
+ */
2428
+ getTestRun(appId: string, blockType: "prompt" | "integration", blockId: string, runId: string): Promise<any>;
1327
2429
  getAnalyticsTopUsers(appId: string, params?: {
1328
2430
  windowDays?: number;
1329
2431
  limit?: number;
1330
- } & AnalyticsTestUsersParam): Promise<AnalyticsTopUsersResponse>;
2432
+ } & AnalyticsTestUsersParam & AnalyticsFreshParam): Promise<AnalyticsTopUsersResponse>;
1331
2433
  getAnalyticsIntegrationMetrics(appId: string, params?: {
1332
2434
  windowDays?: number;
1333
- }): Promise<AnalyticsIntegrationMetricsResponse>;
1334
- getAnalyticsOverviewDau(appId: string, params?: AnalyticsTestUsersParam): Promise<AnalyticsMetricResponse>;
1335
- getAnalyticsOverviewWau(appId: string, params?: AnalyticsTestUsersParam): Promise<AnalyticsMetricResponse>;
1336
- getAnalyticsOverviewMau(appId: string, params?: AnalyticsTestUsersParam): Promise<AnalyticsMetricResponse>;
2435
+ } & AnalyticsFreshParam): Promise<AnalyticsIntegrationMetricsResponse>;
2436
+ getAnalyticsOverviewDau(appId: string, params?: AnalyticsTestUsersParam & AnalyticsFreshParam): Promise<AnalyticsMetricResponse>;
2437
+ getAnalyticsOverviewWau(appId: string, params?: AnalyticsTestUsersParam & AnalyticsFreshParam): Promise<AnalyticsMetricResponse>;
2438
+ getAnalyticsOverviewMau(appId: string, params?: AnalyticsTestUsersParam & AnalyticsFreshParam): Promise<AnalyticsMetricResponse>;
1337
2439
  getAnalyticsOverviewGrowth(appId: string, params?: {
1338
2440
  windowDays?: number;
1339
- } & AnalyticsTestUsersParam): Promise<AnalyticsGrowthResponse>;
2441
+ } & AnalyticsTestUsersParam & AnalyticsFreshParam): Promise<AnalyticsGrowthResponse>;
1340
2442
  getAnalyticsDailyActive(appId: string, params?: {
1341
2443
  windowDays?: number;
1342
- } & AnalyticsTestUsersParam): Promise<AnalyticsDailyActiveResponse>;
2444
+ } & AnalyticsTestUsersParam & AnalyticsFreshParam): Promise<AnalyticsDailyActiveResponse>;
1343
2445
  getAnalyticsRollingActive(appId: string, params?: {
1344
2446
  windowDays?: number;
1345
- } & AnalyticsTestUsersParam): Promise<AnalyticsDailyActiveResponse>;
1346
- getAnalyticsCohortRetention(appId: string, params?: AnalyticsTestUsersParam): Promise<AnalyticsCohortResponse>;
2447
+ } & AnalyticsTestUsersParam & AnalyticsFreshParam): Promise<AnalyticsDailyActiveResponse>;
2448
+ getAnalyticsCohortRetention(appId: string, params?: AnalyticsTestUsersParam & AnalyticsFreshParam): Promise<AnalyticsCohortResponse>;
1347
2449
  getAnalyticsUserSearch(appId: string, params: {
1348
2450
  q?: string;
1349
2451
  limit?: number;
@@ -1354,28 +2456,113 @@ export declare class ApiClient {
1354
2456
  signupEndDay?: string;
1355
2457
  /** #3127 — row offset, accepted only with a signup filter. */
1356
2458
  offset?: number;
1357
- } & AnalyticsTestUsersParam): Promise<AnalyticsUserSearchResponse>;
1358
- getAnalyticsUserDetail(appId: string, userUlid: string): Promise<AnalyticsUserDetailResponse>;
1359
- getAnalyticsUserSnapshot(appId: string, userUlid: string): Promise<AnalyticsUserSnapshotResponse>;
2459
+ } & AnalyticsTestUsersParam & AnalyticsFreshParam): Promise<AnalyticsUserSearchResponse>;
2460
+ getAnalyticsUserDetail(appId: string, userUlid: string, params?: AnalyticsFreshParam): Promise<AnalyticsUserDetailResponse>;
2461
+ getAnalyticsUserSnapshot(appId: string, userUlid: string, params?: AnalyticsFreshParam): Promise<AnalyticsUserSnapshotResponse>;
2462
+ /**
2463
+ * #5251 — `path` with `params` set as `get` sets them, then one appended
2464
+ * `filter[<field>][<operator>]` entry per filter, in order. `get`'s record
2465
+ * cannot hold two entries under one key; the server ANDs them all.
2466
+ */
2467
+ private analyticsFilteredGet;
1360
2468
  getAnalyticsEvents(appId: string, params?: {
1361
2469
  windowDays?: number;
1362
2470
  page?: number;
1363
2471
  [key: string]: any;
1364
- } & AnalyticsTestUsersParam): Promise<AnalyticsEventsResponse>;
2472
+ } & AnalyticsTestUsersParam & AnalyticsFreshParam, filters?: AnalyticsFilterParam[]): Promise<AnalyticsEventsResponse>;
1365
2473
  getAnalyticsEventsGrouped(appId: string, params?: {
1366
2474
  groupBy?: string;
1367
2475
  windowDays?: number;
1368
2476
  [key: string]: any;
1369
- } & AnalyticsTestUsersParam): Promise<AnalyticsEventsGroupedResponse>;
2477
+ } & AnalyticsTestUsersParam & AnalyticsFreshParam, filters?: AnalyticsFilterParam[]): Promise<AnalyticsEventsGroupedResponse>;
1370
2478
  getAnalyticsErrorsGroups(appId: string, params?: {
1371
2479
  windowDays?: number;
1372
2480
  limit?: number;
1373
2481
  [key: string]: any;
1374
- }): Promise<AnalyticsErrorsGroupsResponse>;
2482
+ } & AnalyticsFreshParam, filters?: AnalyticsFilterParam[]): Promise<AnalyticsErrorsGroupsResponse>;
2483
+ /** The app's db3 query shapes that read the most rows (#5244). */
2484
+ getAnalyticsDb3Queries(appId: string, params?: {
2485
+ windowDays?: number;
2486
+ limit?: number;
2487
+ orderBy?: "rowsRead" | "rowsPerReturned";
2488
+ } & AnalyticsFreshParam): Promise<AnalyticsDb3QueriesResponse>;
2489
+ /** The app's request wall time and DynamoDB round trips per endpoint and function (#5244). */
2490
+ getAnalyticsRequests(appId: string, params?: {
2491
+ windowDays?: number;
2492
+ limit?: number;
2493
+ } & AnalyticsFreshParam): Promise<AnalyticsRequestsResponse>;
1375
2494
  getAnalyticsTopPrompts(appId: string, params?: {
1376
2495
  windowDays?: number;
1377
2496
  limit?: number;
1378
- }): Promise<TopPromptsResponse>;
2497
+ } & AnalyticsFreshParam): Promise<TopPromptsResponse>;
2498
+ /** An app's platform transitions: each one's value and where it came from. */
2499
+ getAppTransitions(appId: string): Promise<AppTransitionsResponse>;
2500
+ /** Set one platform transition on one app, with a reason (super-admin). */
2501
+ setAppTransition(appId: string, transition: string, body: {
2502
+ value: string;
2503
+ reason: string;
2504
+ }): Promise<AppTransitionSetResponse>;
2505
+ /** One page of an app's transition changes, newest first (super-admin). */
2506
+ listAppTransitionChanges(appId: string, params?: {
2507
+ transition?: string;
2508
+ limit?: number;
2509
+ cursor?: string;
2510
+ }): Promise<{
2511
+ items: AppTransitionChange[];
2512
+ hasMore: boolean;
2513
+ nextCursor?: string;
2514
+ }>;
2515
+ /** The registered transitions, with apps per value from one budgeted walk (super-admin). */
2516
+ listTransitions(params?: {
2517
+ after?: string;
2518
+ counts?: boolean;
2519
+ }): Promise<TransitionListResponse>;
2520
+ /** One page of a transition's report: each app's state, use by call site and eligible date (super-admin). */
2521
+ getTransitionReport(transition: string, params?: {
2522
+ only?: "all" | "in-use";
2523
+ limit?: number;
2524
+ cursor?: string;
2525
+ }): Promise<TransitionReportResponse>;
2526
+ /** One page of a transition's move plan: what the daily move step would do with each unit (super-admin, #5824). */
2527
+ getTransitionMovePlan(transition: string, params?: {
2528
+ limit?: number;
2529
+ cursor?: string;
2530
+ }): Promise<TransitionMovePlanResponse>;
2531
+ /** Recent calls to deprecated operations, by app, operation, source and client (super-admin). */
2532
+ getDeprecatedCalls(params?: {
2533
+ days?: number;
2534
+ appId?: string;
2535
+ operation?: string;
2536
+ limit?: number;
2537
+ }): Promise<DeprecatedCallsResponse>;
2538
+ /** An app's usage and estimated cost for `month` (`YYYY-MM`, default the current month). */
2539
+ getAppUsage(appId: string, params?: {
2540
+ month?: string;
2541
+ }): Promise<AppUsageMonthResponse>;
2542
+ /** An app's top users over a window, by a meter's quantity or by cost. */
2543
+ getAppUsageTopUsers(appId: string, params?: {
2544
+ meter?: string;
2545
+ by?: "cost";
2546
+ } & UsageWindowParams & {
2547
+ limit?: number;
2548
+ }): Promise<AppUsageTopUsersResponse>;
2549
+ /** One user's usage over a window and the bytes they own. */
2550
+ getAppUsageUser(appId: string, userId: string, params?: UsageWindowParams): Promise<AppUsageUserResponse>;
2551
+ /** An app's system usage over a window, by origin, source, resource and meter. */
2552
+ getAppUsageSystem(appId: string, params?: UsageWindowParams & {
2553
+ meter?: string;
2554
+ limit?: number;
2555
+ }): Promise<AppUsageSystemResponse>;
2556
+ /** The top apps by estimated cost, month to date (super-admin). */
2557
+ listUsageTopApps(params?: {
2558
+ limit?: number;
2559
+ }): Promise<UsageTopAppsResponse>;
2560
+ /** The top developers by estimated cost, month to date (super-admin). */
2561
+ listUsageTopDevelopers(params?: {
2562
+ limit?: number;
2563
+ }): Promise<UsageTopDevelopersResponse>;
2564
+ /** The usage jobs' state (super-admin). */
2565
+ getUsageJobs(): Promise<UsageJobsResponse>;
1379
2566
  /**
1380
2567
  * The signed-in admin's own profile, `role` included.
1381
2568
  *
@@ -1406,31 +2593,20 @@ export declare class ApiClient {
1406
2593
  role?: "admin" | "super-admin";
1407
2594
  }): Promise<any>;
1408
2595
  reindexAdmin(adminId: string): Promise<void>;
1409
- listAllAdminInvitations(): Promise<any[]>;
2596
+ /** `reindexAdmin` with the route's answer, for callers that print it. */
2597
+ reindexAdminWithResult(adminId: string): Promise<{
2598
+ success: boolean;
2599
+ adminId: string;
2600
+ reindexedAt: string;
2601
+ }>;
2602
+ /** One address's pending admin invitations; the route requires the address. */
2603
+ listAllAdminInvitations(email: string): Promise<any[]>;
1410
2604
  createGlobalAdminInvitation(data: {
1411
2605
  email: string;
1412
2606
  appCreationLimit?: number;
1413
2607
  expiresInDays?: number;
1414
2608
  }): Promise<any>;
1415
2609
  deleteGlobalAdminInvitation(invitationId: string): Promise<void>;
1416
- listPromptCatalog(params?: {
1417
- status?: string;
1418
- limit?: number;
1419
- cursor?: string;
1420
- }): Promise<any>;
1421
- getPromptCatalogItem(catalogId: string): Promise<any>;
1422
- createPromptCatalogItem(payload: any): Promise<any>;
1423
- updatePromptCatalogItem(catalogId: string, payload: any): Promise<any>;
1424
- deletePromptCatalogItem(catalogId: string): Promise<void>;
1425
- listIntegrationCatalog(params?: {
1426
- status?: string;
1427
- limit?: number;
1428
- cursor?: string;
1429
- }): Promise<any>;
1430
- getIntegrationCatalogItem(catalogId: string): Promise<any>;
1431
- createIntegrationCatalogItem(payload: any): Promise<any>;
1432
- updateIntegrationCatalogItem(catalogId: string, payload: any): Promise<any>;
1433
- deleteIntegrationCatalogItem(catalogId: string): Promise<void>;
1434
2610
  startBatchTests(appId: string, blockType: "prompt" | "integration", blockId: string, payload?: {
1435
2611
  comparisonGroup?: string;
1436
2612
  overrideConfigId?: string;
@@ -1497,6 +2673,15 @@ export declare class ApiClient {
1497
2673
  sentTo: string;
1498
2674
  error?: string;
1499
2675
  }>;
2676
+ /**
2677
+ * Render the saved template (or the built-in default) for an email type
2678
+ * without sending it. `variables` override the type's sample values. The
2679
+ * app id and the type are each encoded as one path segment, so no value of
2680
+ * either can select another route.
2681
+ */
2682
+ previewEmailTemplate(appId: string, emailType: string, payload?: {
2683
+ variables?: Record<string, string | number | boolean | null>;
2684
+ }): Promise<EmailTemplatePreview>;
1500
2685
  createToken(appId: string, data: {
1501
2686
  name: string;
1502
2687
  ttl?: string;
@@ -1674,6 +2859,7 @@ export declare class ApiClient {
1674
2859
  }, expectedModifiedAt?: string, options?: {
1675
2860
  dryRun?: boolean;
1676
2861
  acceptWarnings?: boolean;
2862
+ allowFieldRemoval?: boolean;
1677
2863
  }): Promise<any>;
1678
2864
  deleteDatabaseTypeConfig(appId: string, databaseType: string, options?: {
1679
2865
  force?: boolean;
@@ -2181,11 +3367,12 @@ export declare class ApiClient {
2181
3367
  }>;
2182
3368
  /**
2183
3369
  * Apply an ordered multi-model create/patch/delete blob atomically (issue
2184
- * #1964 Phase 4, wrapping the #1517 `bulkUpdate` facade). All-or-nothing:
2185
- * a validation failure commits nothing. Returns the facade's
2186
- * `{ applied, added, updated, deleted }`.
3370
+ * #1964 Phase 4, wrapping the #1517 `bulkUpdate` facade): `POST
3371
+ * records/batch`, at most 100 operations. All-or-nothing: a validation
3372
+ * failure commits nothing. Returns the facade's `{ applied, added,
3373
+ * updated, deleted }`, and on a db3 `reads` when the batch carried reads.
2187
3374
  */
2188
- bulkDocumentRecords(appId: string, documentId: string, operations: Array<Record<string, unknown>>, extra?: {
3375
+ batchDocumentRecords(appId: string, documentId: string, operations: Array<Record<string, unknown>>, extra?: {
2189
3376
  documentFormat?: 1 | 3;
2190
3377
  }): Promise<{
2191
3378
  applied: number;
@@ -2204,6 +3391,7 @@ export declare class ApiClient {
2204
3391
  id: string;
2205
3392
  created: boolean;
2206
3393
  }>;
3394
+ reads?: Array<Record<string, any>>;
2207
3395
  }>;
2208
3396
  /** `/app/<app>/api/db3/<id>`, the id encoded: every `db3.*` route's prefix. */
2209
3397
  private db3Path;
@@ -2213,8 +3401,9 @@ export declare class ApiClient {
2213
3401
  }>;
2214
3402
  /**
2215
3403
  * `POST db3/:id/indexes` with `{ model, field | fields, unique?, name? }`,
2216
- * or `{ model, field, members: true }` for a member index → `{ index }`.
2217
- * The route applies the registration rules.
3404
+ * `{ model, field, members: true }` for a member index, or `{ model, field
3405
+ * | fields, kind: "text", on, text? }` for a text index → `{ index }`. The
3406
+ * route applies the registration rules.
2218
3407
  */
2219
3408
  registerDb3Index(appId: string, db3Id: string, body: {
2220
3409
  model: string;
@@ -2223,6 +3412,11 @@ export declare class ApiClient {
2223
3412
  unique?: boolean;
2224
3413
  name?: string;
2225
3414
  members?: boolean;
3415
+ kind?: Db3IndexKind;
3416
+ on?: Db3IndexPlacement;
3417
+ text?: Partial<Db3TextIndexOptions>;
3418
+ /** A `vector` index's options (#5225). */
3419
+ vector?: Db3VectorIndexOptions;
2226
3420
  }): Promise<{
2227
3421
  index: Db3IndexRow;
2228
3422
  }>;
@@ -2231,6 +3425,28 @@ export declare class ApiClient {
2231
3425
  ok: boolean;
2232
3426
  name: string;
2233
3427
  }>;
3428
+ /**
3429
+ * `GET db3/:id/indexes/:name/model` (#5229): a vector index's shared model,
3430
+ * its bytes as uploaded and the `X-Index-Model-*` headers it was uploaded
3431
+ * with.
3432
+ */
3433
+ fetchDb3IndexModel(appId: string, db3Id: string, name: string): Promise<{
3434
+ data: Buffer;
3435
+ generation: number;
3436
+ revision: number;
3437
+ rows: number;
3438
+ trainedAt: string;
3439
+ format: string;
3440
+ }>;
3441
+ /**
3442
+ * `DELETE db3/:id/indexes/:name/model` (#5229) → `{ ok, name, revision }`:
3443
+ * the model (or an upload under way) gone, `revision` the index's new one.
3444
+ */
3445
+ deleteDb3IndexModel(appId: string, db3Id: string, name: string): Promise<{
3446
+ ok: boolean;
3447
+ name: string;
3448
+ revision: number;
3449
+ }>;
2234
3450
  /** The db3 mount of {@link queryDocumentRecords}: `GET db3/:id/records/:model`. */
2235
3451
  queryDb3Records(appId: string, db3Id: string, modelName: string, queryOptions?: {
2236
3452
  filter?: Record<string, any>;
@@ -2249,6 +3465,12 @@ export declare class ApiClient {
2249
3465
  aggregateDb3Records(appId: string, db3Id: string, modelName: string, options: Parameters<ApiClient["aggregateDocumentRecords"]>[3]): Promise<{
2250
3466
  result: unknown;
2251
3467
  }>;
3468
+ /**
3469
+ * `POST db3/:id/records/:model/explain` (#5240): run a query, count or
3470
+ * aggregate on the server, forced onto `index` (or off indexes, `"none"`)
3471
+ * when given, and answer how it read.
3472
+ */
3473
+ explainDb3Read(appId: string, db3Id: string, modelName: string, body: Db3ExplainRequest): Promise<Db3ExplainAnswer>;
2252
3474
  /** The db3 mount of {@link saveDocumentRecord}: `POST db3/:id/records/:model`. */
2253
3475
  saveDb3Record(appId: string, db3Id: string, modelName: string, body: {
2254
3476
  id: string;
@@ -2268,8 +3490,19 @@ export declare class ApiClient {
2268
3490
  deleteDb3Record(appId: string, db3Id: string, modelName: string, recordId: string): Promise<{
2269
3491
  deleted: boolean;
2270
3492
  }>;
2271
- /** The db3 mount of {@link bulkDocumentRecords}: `POST db3/:id/records/bulk`. */
2272
- bulkDb3Records(appId: string, db3Id: string, operations: Array<Record<string, unknown>>): ReturnType<ApiClient["bulkDocumentRecords"]>;
3493
+ /** The db3 mount of {@link batchDocumentRecords}: `POST db3/:id/records/batch`. */
3494
+ batchDb3Records(appId: string, db3Id: string, operations: Array<Record<string, unknown>>): ReturnType<ApiClient["batchDocumentRecords"]>;
3495
+ /**
3496
+ * Several reads of a db3 in one request (#5243): `POST db3/:id/records/batch-read`,
3497
+ * each answered at its index from one state of the db3. `atomic: false`
3498
+ * answers a refused read in its place rather than refusing the request.
3499
+ */
3500
+ batchReadDb3Records(appId: string, db3Id: string, operations: Array<Record<string, unknown>>, options?: {
3501
+ atomic?: boolean;
3502
+ }): Promise<{
3503
+ results: Array<Record<string, any>>;
3504
+ cost?: Record<string, unknown>;
3505
+ }>;
2273
3506
  /** The db3 mount of {@link getDocumentSchema}: `GET db3/:id/schema`. */
2274
3507
  getDb3Schema(appId: string, db3Id: string): Promise<any>;
2275
3508
  /** `?limit=&cursor=` for a listing. */
@@ -2347,6 +3580,13 @@ export declare class ApiClient {
2347
3580
  }): Promise<any>;
2348
3581
  /** `GET db3/:id` (#4804): the db3, with the caller's grant when it reads it through one. */
2349
3582
  getDb3(appId: string, db3Id: string): Promise<any>;
3583
+ /**
3584
+ * `PUT db3/:id` (#5890): rename a db3, answered as `getDb3` answers it with
3585
+ * the new title.
3586
+ */
3587
+ updateDb3(appId: string, db3Id: string, body: {
3588
+ title: string;
3589
+ }): Promise<any>;
2350
3590
  /** `DELETE db3/:id` (#4804): the documents delete for a db3. */
2351
3591
  deleteDb3(appId: string, db3Id: string): Promise<any>;
2352
3592
  /** The db3 mount of {@link getDocumentStats}: `GET db3/:id/stats`. */
@@ -2392,6 +3632,20 @@ export declare class ApiClient {
2392
3632
  nextCursor?: string;
2393
3633
  hasMore?: boolean;
2394
3634
  }>;
3635
+ /**
3636
+ * Every db3 a member reaches through the admin API (#5253): held, shared
3637
+ * with them, then app access, each row with its `via`; `via` narrows to
3638
+ * some of the three ways.
3639
+ */
3640
+ listDb3ForUser(appId: string, userId: string, params?: {
3641
+ via?: string[];
3642
+ limit?: number;
3643
+ cursor?: string;
3644
+ }): Promise<{
3645
+ items: any[];
3646
+ nextCursor?: string;
3647
+ hasMore?: boolean;
3648
+ }>;
2395
3649
  /** Transfer a db3 to `to` (`app` or `user:<userId>`) through the admin API (#4804). */
2396
3650
  transferDb3(appId: string, db3Id: string, to: string): Promise<any>;
2397
3651
  /** Remove or restore a db3's owner row through the admin API (#4804): `{ id, custodian, ownerRow, changed }`. */
@@ -2415,7 +3669,9 @@ export declare class ApiClient {
2415
3669
  getDb3TypeConfig(appId: string, name: string): Promise<any>;
2416
3670
  /**
2417
3671
  * `PUT db3-types/:name` (#4802): create or update the type, and push its new
2418
- * revision to every db3 of it. `dryRun` judges the body and persists nothing.
3672
+ * revision to every db3 of it. `dryRun` judges the body and persists nothing;
3673
+ * `allowFieldRemoval` asks for the append-only override (#6019), which the
3674
+ * server takes only on an app whose stored settings enable it.
2419
3675
  */
2420
3676
  pushDb3Type(appId: string, name: string, data: {
2421
3677
  ruleSetId?: string | null;
@@ -2427,6 +3683,7 @@ export declare class ApiClient {
2427
3683
  expectedModifiedAt?: string;
2428
3684
  }, options?: {
2429
3685
  dryRun?: boolean;
3686
+ allowFieldRemoval?: boolean;
2430
3687
  }): Promise<any>;
2431
3688
  /** `DELETE db3-types/:name` (#4802): refused while a db3 is of the type. */
2432
3689
  deleteDb3Type(appId: string, name: string): Promise<any>;