primitive-admin 1.2.0-alpha.13 → 1.2.0-alpha.15

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 (324) hide show
  1. package/README.md +102 -78
  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 +79 -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 +220 -18
  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.js +19 -2
  14. package/dist/src/commands/apps.js.map +1 -1
  15. package/dist/src/commands/auth.js +11 -1
  16. package/dist/src/commands/auth.js.map +1 -1
  17. package/dist/src/commands/collections.js +13 -0
  18. package/dist/src/commands/collections.js.map +1 -1
  19. package/dist/src/commands/config.d.ts +1 -1
  20. package/dist/src/commands/config.js +40 -9
  21. package/dist/src/commands/config.js.map +1 -1
  22. package/dist/src/commands/connections.js +2 -0
  23. package/dist/src/commands/connections.js.map +1 -1
  24. package/dist/src/commands/database-type-configs.js +5 -3
  25. package/dist/src/commands/database-type-configs.js.map +1 -1
  26. package/dist/src/commands/databases.js +6 -4
  27. package/dist/src/commands/databases.js.map +1 -1
  28. package/dist/src/commands/db3-types.js +2 -0
  29. package/dist/src/commands/db3-types.js.map +1 -1
  30. package/dist/src/commands/db3.d.ts +12 -0
  31. package/dist/src/commands/db3.js +345 -11
  32. package/dist/src/commands/db3.js.map +1 -1
  33. package/dist/src/commands/documents.d.ts +52 -12
  34. package/dist/src/commands/documents.js +120 -29
  35. package/dist/src/commands/documents.js.map +1 -1
  36. package/dist/src/commands/email-templates.js +72 -0
  37. package/dist/src/commands/email-templates.js.map +1 -1
  38. package/dist/src/commands/functions.js +47 -10
  39. package/dist/src/commands/functions.js.map +1 -1
  40. package/dist/src/commands/groups.js +18 -3
  41. package/dist/src/commands/groups.js.map +1 -1
  42. package/dist/src/commands/init.js +7 -1
  43. package/dist/src/commands/init.js.map +1 -1
  44. package/dist/src/commands/integrations.js +80 -47
  45. package/dist/src/commands/integrations.js.map +1 -1
  46. package/dist/src/commands/metadata-category-configs.js +2 -0
  47. package/dist/src/commands/metadata-category-configs.js.map +1 -1
  48. package/dist/src/commands/metadata.js +41 -0
  49. package/dist/src/commands/metadata.js.map +1 -1
  50. package/dist/src/commands/prompts.js +73 -47
  51. package/dist/src/commands/prompts.js.map +1 -1
  52. package/dist/src/commands/rule-sets.js +2 -0
  53. package/dist/src/commands/rule-sets.js.map +1 -1
  54. package/dist/src/commands/schemas.d.ts +15 -0
  55. package/dist/src/commands/schemas.js +122 -0
  56. package/dist/src/commands/schemas.js.map +1 -0
  57. package/dist/src/commands/secrets.js +45 -3
  58. package/dist/src/commands/secrets.js.map +1 -1
  59. package/dist/src/commands/sessions.js +2 -0
  60. package/dist/src/commands/sessions.js.map +1 -1
  61. package/dist/src/commands/sync-schemas.d.ts +202 -0
  62. package/dist/src/commands/sync-schemas.js +629 -0
  63. package/dist/src/commands/sync-schemas.js.map +1 -0
  64. package/dist/src/commands/sync-user-properties.d.ts +118 -0
  65. package/dist/src/commands/sync-user-properties.js +276 -0
  66. package/dist/src/commands/sync-user-properties.js.map +1 -0
  67. package/dist/src/commands/sync.d.ts +243 -12
  68. package/dist/src/commands/sync.js +1474 -314
  69. package/dist/src/commands/sync.js.map +1 -1
  70. package/dist/src/commands/user-properties.d.ts +14 -0
  71. package/dist/src/commands/user-properties.js +79 -0
  72. package/dist/src/commands/user-properties.js.map +1 -0
  73. package/dist/src/commands/users.js +912 -18
  74. package/dist/src/commands/users.js.map +1 -1
  75. package/dist/src/commands/waitlist.js +39 -4
  76. package/dist/src/commands/waitlist.js.map +1 -1
  77. package/dist/src/lib/analytics-query.d.ts +58 -0
  78. package/dist/src/lib/analytics-query.js +134 -0
  79. package/dist/src/lib/analytics-query.js.map +1 -0
  80. package/dist/src/lib/api-client.d.ts +779 -95
  81. package/dist/src/lib/api-client.js +369 -166
  82. package/dist/src/lib/api-client.js.map +1 -1
  83. package/dist/src/lib/block-selector.d.ts +9 -15
  84. package/dist/src/lib/block-selector.js +9 -20
  85. package/dist/src/lib/block-selector.js.map +1 -1
  86. package/dist/src/lib/cli-manifest.d.ts +8 -0
  87. package/dist/src/lib/cli-manifest.js +10 -1
  88. package/dist/src/lib/cli-manifest.js.map +1 -1
  89. package/dist/src/lib/cli-version.d.ts +14 -0
  90. package/dist/src/lib/cli-version.js +38 -0
  91. package/dist/src/lib/cli-version.js.map +1 -0
  92. package/dist/src/lib/codegen-shared/prettierStable.d.ts +41 -0
  93. package/dist/src/lib/codegen-shared/prettierStable.js +146 -24
  94. package/dist/src/lib/codegen-shared/prettierStable.js.map +1 -1
  95. package/dist/src/lib/command-status.d.ts +110 -0
  96. package/dist/src/lib/command-status.js +184 -0
  97. package/dist/src/lib/command-status.js.map +1 -0
  98. package/dist/src/lib/config-object-descriptor.d.ts +6 -0
  99. package/dist/src/lib/config-object-descriptor.js +71 -0
  100. package/dist/src/lib/config-object-descriptor.js.map +1 -1
  101. package/dist/src/lib/config-toml.d.ts +11 -2
  102. package/dist/src/lib/config-toml.js +25 -2
  103. package/dist/src/lib/config-toml.js.map +1 -1
  104. package/dist/src/lib/data-input.d.ts +1 -1
  105. package/dist/src/lib/data-input.js +1 -1
  106. package/dist/src/lib/db-codegen/dbTsTypes.d.ts +1 -1
  107. package/dist/src/lib/db-codegen/dbTsTypes.js +3 -0
  108. package/dist/src/lib/db-codegen/dbTsTypes.js.map +1 -1
  109. package/dist/src/lib/db-codegen/dbTypeIR.d.ts +11 -1
  110. package/dist/src/lib/db-codegen/dbTypeIR.js +11 -5
  111. package/dist/src/lib/db-codegen/dbTypeIR.js.map +1 -1
  112. package/dist/src/lib/db-type-records.d.ts +95 -0
  113. package/dist/src/lib/db-type-records.js +219 -0
  114. package/dist/src/lib/db-type-records.js.map +1 -0
  115. package/dist/src/lib/db3-export.d.ts +65 -9
  116. package/dist/src/lib/db3-export.js +159 -22
  117. package/dist/src/lib/db3-export.js.map +1 -1
  118. package/dist/src/lib/db3-index-output.d.ts +69 -3
  119. package/dist/src/lib/db3-index-output.js +142 -4
  120. package/dist/src/lib/db3-index-output.js.map +1 -1
  121. package/dist/src/lib/db3-type-models.d.ts +39 -7
  122. package/dist/src/lib/db3-type-models.js +138 -27
  123. package/dist/src/lib/db3-type-models.js.map +1 -1
  124. package/dist/src/lib/deprecation.d.ts +2 -2
  125. package/dist/src/lib/deprecation.js +2 -2
  126. package/dist/src/lib/experimental-apis.d.ts +36 -0
  127. package/dist/src/lib/experimental-apis.js +46 -0
  128. package/dist/src/lib/experimental-apis.js.map +1 -0
  129. package/dist/src/lib/file-attachment.d.ts +24 -0
  130. package/dist/src/lib/file-attachment.js +31 -0
  131. package/dist/src/lib/file-attachment.js.map +1 -0
  132. package/dist/src/lib/function-authorize-check.d.ts +1 -1
  133. package/dist/src/lib/function-authorize-check.js +2 -1
  134. package/dist/src/lib/function-authorize-check.js.map +1 -1
  135. package/dist/src/lib/function-authorize-view.js +4 -0
  136. package/dist/src/lib/function-authorize-view.js.map +1 -1
  137. package/dist/src/lib/function-bundle.d.ts +27 -5
  138. package/dist/src/lib/function-bundle.js +106 -7
  139. package/dist/src/lib/function-bundle.js.map +1 -1
  140. package/dist/src/lib/function-collect.d.ts +2 -0
  141. package/dist/src/lib/function-collect.js +36 -7
  142. package/dist/src/lib/function-collect.js.map +1 -1
  143. package/dist/src/lib/function-db-types.d.ts +57 -40
  144. package/dist/src/lib/function-db-types.js +246 -285
  145. package/dist/src/lib/function-db-types.js.map +1 -1
  146. package/dist/src/lib/function-document-types.d.ts +19 -7
  147. package/dist/src/lib/function-document-types.js +24 -12
  148. package/dist/src/lib/function-document-types.js.map +1 -1
  149. package/dist/src/lib/function-run.d.ts +1 -1
  150. package/dist/src/lib/function-run.js +1 -1
  151. package/dist/src/lib/function-run.js.map +1 -1
  152. package/dist/src/lib/function-schema-codegen.d.ts +58 -18
  153. package/dist/src/lib/function-schema-codegen.js +85 -74
  154. package/dist/src/lib/function-schema-codegen.js.map +1 -1
  155. package/dist/src/lib/function-schema-refs.d.ts +98 -0
  156. package/dist/src/lib/function-schema-refs.js +177 -0
  157. package/dist/src/lib/function-schema-refs.js.map +1 -0
  158. package/dist/src/lib/function-sync.d.ts +38 -4
  159. package/dist/src/lib/function-sync.js +83 -14
  160. package/dist/src/lib/function-sync.js.map +1 -1
  161. package/dist/src/lib/function-typecheck.d.ts +52 -0
  162. package/dist/src/lib/function-typecheck.js +171 -54
  163. package/dist/src/lib/function-typecheck.js.map +1 -1
  164. package/dist/src/lib/generated-build-flags.d.ts +13 -0
  165. package/dist/src/lib/generated-build-flags.js +14 -0
  166. package/dist/src/lib/generated-build-flags.js.map +1 -0
  167. package/dist/src/lib/generated-config-surfaces.d.ts +211 -11
  168. package/dist/src/lib/generated-config-surfaces.js +579 -69
  169. package/dist/src/lib/generated-config-surfaces.js.map +1 -1
  170. package/dist/src/lib/generated-sdk-types.d.ts +1 -1
  171. package/dist/src/lib/generated-sdk-types.js +1 -1
  172. package/dist/src/lib/generated-sdk-types.js.map +1 -1
  173. package/dist/src/lib/integration-test-request.d.ts +54 -0
  174. package/dist/src/lib/integration-test-request.js +207 -0
  175. package/dist/src/lib/integration-test-request.js.map +1 -0
  176. package/dist/src/lib/log-inspection.d.ts +3 -0
  177. package/dist/src/lib/log-inspection.js +1 -0
  178. package/dist/src/lib/log-inspection.js.map +1 -1
  179. package/dist/src/lib/metadata-report.d.ts +85 -0
  180. package/dist/src/lib/metadata-report.js +81 -0
  181. package/dist/src/lib/metadata-report.js.map +1 -0
  182. package/dist/src/lib/output.d.ts +1 -1
  183. package/dist/src/lib/output.js +1 -1
  184. package/dist/src/lib/platform-owned.js +5 -0
  185. package/dist/src/lib/platform-owned.js.map +1 -1
  186. package/dist/src/lib/primitive-declaration-names.d.ts +21 -0
  187. package/dist/src/lib/primitive-declaration-names.js +22 -0
  188. package/dist/src/lib/primitive-declaration-names.js.map +1 -0
  189. package/dist/src/lib/primitive-declaration.d.ts +143 -0
  190. package/dist/src/lib/primitive-declaration.js +658 -0
  191. package/dist/src/lib/primitive-declaration.js.map +1 -0
  192. package/dist/src/lib/prompt-schema-codegen.d.ts +36 -12
  193. package/dist/src/lib/prompt-schema-codegen.js +82 -98
  194. package/dist/src/lib/prompt-schema-codegen.js.map +1 -1
  195. package/dist/src/lib/prompt-schema-document.d.ts +35 -0
  196. package/dist/src/lib/prompt-schema-document.js +92 -0
  197. package/dist/src/lib/prompt-schema-document.js.map +1 -0
  198. package/dist/src/lib/prompt-schema-refs.d.ts +164 -0
  199. package/dist/src/lib/prompt-schema-refs.js +452 -0
  200. package/dist/src/lib/prompt-schema-refs.js.map +1 -0
  201. package/dist/src/lib/records-verbs.d.ts +12 -2
  202. package/dist/src/lib/records-verbs.js +7 -2
  203. package/dist/src/lib/records-verbs.js.map +1 -1
  204. package/dist/src/lib/register-commands.d.ts +28 -0
  205. package/dist/src/lib/register-commands.js +101 -0
  206. package/dist/src/lib/register-commands.js.map +1 -0
  207. package/dist/src/lib/retired-imports.d.ts +53 -0
  208. package/dist/src/lib/retired-imports.js +120 -0
  209. package/dist/src/lib/retired-imports.js.map +1 -0
  210. package/dist/src/lib/schema-codegen/compiledSpace.d.ts +62 -0
  211. package/dist/src/lib/schema-codegen/compiledSpace.js +103 -0
  212. package/dist/src/lib/schema-codegen/compiledSpace.js.map +1 -0
  213. package/dist/src/lib/schema-codegen/generated-db3-bridge.d.ts +86 -0
  214. package/dist/src/lib/schema-codegen/generated-db3-bridge.js +221 -0
  215. package/dist/src/lib/schema-codegen/generated-db3-bridge.js.map +1 -0
  216. package/dist/src/lib/schema-codegen/generated-db3-query-capabilities.d.ts +85 -0
  217. package/dist/src/lib/schema-codegen/generated-db3-query-capabilities.js +86 -0
  218. package/dist/src/lib/schema-codegen/generated-db3-query-capabilities.js.map +1 -0
  219. package/dist/src/lib/schema-codegen/generated-field-grammar.d.ts +209 -0
  220. package/dist/src/lib/schema-codegen/generated-field-grammar.js +379 -0
  221. package/dist/src/lib/schema-codegen/generated-field-grammar.js.map +1 -0
  222. package/dist/src/lib/schema-codegen/generated-field-table.d.ts +80 -0
  223. package/dist/src/lib/schema-codegen/generated-field-table.js +542 -0
  224. package/dist/src/lib/schema-codegen/generated-field-table.js.map +1 -0
  225. package/dist/src/lib/schema-codegen/generated-prompt-schemas.d.ts +195 -0
  226. package/dist/src/lib/schema-codegen/generated-prompt-schemas.js +503 -0
  227. package/dist/src/lib/schema-codegen/generated-prompt-schemas.js.map +1 -0
  228. package/dist/src/lib/schema-codegen/generated-schema-descriptor.d.ts +129 -0
  229. package/dist/src/lib/schema-codegen/generated-schema-descriptor.js +154 -1
  230. package/dist/src/lib/schema-codegen/generated-schema-descriptor.js.map +1 -1
  231. package/dist/src/lib/schema-codegen/generated-schema-file.d.ts +129 -0
  232. package/dist/src/lib/schema-codegen/generated-schema-file.js +475 -0
  233. package/dist/src/lib/schema-codegen/generated-schema-file.js.map +1 -0
  234. package/dist/src/lib/schema-codegen/generated-schema-provenance.d.ts +115 -0
  235. package/dist/src/lib/schema-codegen/generated-schema-provenance.js +274 -0
  236. package/dist/src/lib/schema-codegen/generated-schema-provenance.js.map +1 -0
  237. package/dist/src/lib/schema-codegen/generated-schema-refs.d.ts +366 -0
  238. package/dist/src/lib/schema-codegen/generated-schema-refs.js +1789 -0
  239. package/dist/src/lib/schema-codegen/generated-schema-refs.js.map +1 -0
  240. package/dist/src/lib/schema-codegen/namedRefs.d.ts +56 -0
  241. package/dist/src/lib/schema-codegen/namedRefs.js +143 -0
  242. package/dist/src/lib/schema-codegen/namedRefs.js.map +1 -0
  243. package/dist/src/lib/schema-codegen/schemaChanges.d.ts +74 -0
  244. package/dist/src/lib/schema-codegen/schemaChanges.js +277 -0
  245. package/dist/src/lib/schema-codegen/schemaChanges.js.map +1 -0
  246. package/dist/src/lib/schema-codegen/schemaDocs.d.ts +69 -0
  247. package/dist/src/lib/schema-codegen/schemaDocs.js +219 -0
  248. package/dist/src/lib/schema-codegen/schemaDocs.js.map +1 -0
  249. package/dist/src/lib/schema-codegen/schemaIR.d.ts +158 -0
  250. package/dist/src/lib/schema-codegen/schemaIR.js +279 -0
  251. package/dist/src/lib/schema-codegen/schemaIR.js.map +1 -0
  252. package/dist/src/lib/schema-codegen/schemaToTs.d.ts +40 -13
  253. package/dist/src/lib/schema-codegen/schemaToTs.js +124 -160
  254. package/dist/src/lib/schema-codegen/schemaToTs.js.map +1 -1
  255. package/dist/src/lib/schema-codegen/valuesLists.d.ts +35 -0
  256. package/dist/src/lib/schema-codegen/valuesLists.js +128 -0
  257. package/dist/src/lib/schema-codegen/valuesLists.js.map +1 -0
  258. package/dist/src/lib/schema-family-index.d.ts +228 -0
  259. package/dist/src/lib/schema-family-index.js +813 -0
  260. package/dist/src/lib/schema-family-index.js.map +1 -0
  261. package/dist/src/lib/schema-pins.d.ts +82 -0
  262. package/dist/src/lib/schema-pins.js +198 -0
  263. package/dist/src/lib/schema-pins.js.map +1 -0
  264. package/dist/src/lib/schema-preview.d.ts +244 -0
  265. package/dist/src/lib/schema-preview.js +498 -0
  266. package/dist/src/lib/schema-preview.js.map +1 -0
  267. package/dist/src/lib/skill-installer.d.ts +2 -2
  268. package/dist/src/lib/skill-installer.js +2 -21
  269. package/dist/src/lib/skill-installer.js.map +1 -1
  270. package/dist/src/lib/step-run-table.d.ts +1 -2
  271. package/dist/src/lib/step-run-table.js +1 -2
  272. package/dist/src/lib/step-run-table.js.map +1 -1
  273. package/dist/src/lib/swift-codegen/agentGenerator.d.ts +2 -1
  274. package/dist/src/lib/swift-codegen/agentGenerator.js +24 -22
  275. package/dist/src/lib/swift-codegen/agentGenerator.js.map +1 -1
  276. package/dist/src/lib/swift-codegen/banners.d.ts +12 -0
  277. package/dist/src/lib/swift-codegen/banners.js +12 -0
  278. package/dist/src/lib/swift-codegen/banners.js.map +1 -1
  279. package/dist/src/lib/swift-codegen/functionGenerator.d.ts +36 -1
  280. package/dist/src/lib/swift-codegen/functionGenerator.js +167 -50
  281. package/dist/src/lib/swift-codegen/functionGenerator.js.map +1 -1
  282. package/dist/src/lib/swift-codegen/schemaToSwift.d.ts +31 -7
  283. package/dist/src/lib/swift-codegen/schemaToSwift.js +213 -177
  284. package/dist/src/lib/swift-codegen/schemaToSwift.js.map +1 -1
  285. package/dist/src/lib/swift-codegen/sharedGenerator.d.ts +45 -0
  286. package/dist/src/lib/swift-codegen/sharedGenerator.js +120 -0
  287. package/dist/src/lib/swift-codegen/sharedGenerator.js.map +1 -0
  288. package/dist/src/lib/swift-codegen/userPropertiesGenerator.d.ts +30 -0
  289. package/dist/src/lib/swift-codegen/userPropertiesGenerator.js +69 -0
  290. package/dist/src/lib/swift-codegen/userPropertiesGenerator.js.map +1 -0
  291. package/dist/src/lib/sync-resource-types.d.ts +37 -5
  292. package/dist/src/lib/sync-resource-types.js +53 -5
  293. package/dist/src/lib/sync-resource-types.js.map +1 -1
  294. package/dist/src/lib/sync-selectors.d.ts +7 -0
  295. package/dist/src/lib/sync-selectors.js +22 -2
  296. package/dist/src/lib/sync-selectors.js.map +1 -1
  297. package/dist/src/lib/test-runs.d.ts +45 -0
  298. package/dist/src/lib/test-runs.js +150 -0
  299. package/dist/src/lib/test-runs.js.map +1 -0
  300. package/dist/src/lib/test-users.d.ts +25 -0
  301. package/dist/src/lib/test-users.js +36 -0
  302. package/dist/src/lib/test-users.js.map +1 -0
  303. package/dist/src/lib/toml-database-config.d.ts +2 -1
  304. package/dist/src/lib/toml-database-config.js +4 -3
  305. package/dist/src/lib/toml-database-config.js.map +1 -1
  306. package/dist/src/lib/toml-scalar-edit.js +6 -4
  307. package/dist/src/lib/toml-scalar-edit.js.map +1 -1
  308. package/dist/src/lib/user-index.d.ts +80 -0
  309. package/dist/src/lib/user-index.js +166 -0
  310. package/dist/src/lib/user-index.js.map +1 -0
  311. package/dist/src/lib/user-properties/generated-properties-schema.d.ts +159 -0
  312. package/dist/src/lib/user-properties/generated-properties-schema.js +471 -0
  313. package/dist/src/lib/user-properties/generated-properties-schema.js.map +1 -0
  314. package/dist/src/lib/user-properties/user-properties-codegen.d.ts +55 -0
  315. package/dist/src/lib/user-properties/user-properties-codegen.js +129 -0
  316. package/dist/src/lib/user-properties/user-properties-codegen.js.map +1 -0
  317. package/dist/src/lib/user-walk.d.ts +31 -0
  318. package/dist/src/lib/user-walk.js +102 -0
  319. package/dist/src/lib/user-walk.js.map +1 -0
  320. package/dist/src/lib/worker-perf-format.d.ts +22 -0
  321. package/dist/src/lib/worker-perf-format.js +27 -0
  322. package/dist/src/lib/worker-perf-format.js.map +1 -0
  323. package/dist/src/types/index.d.ts +13 -34
  324. package/package.json +5 -3
@@ -28,6 +28,32 @@ export interface BlobInfo {
28
28
  uploaded?: string | null;
29
29
  etag?: string | null;
30
30
  }
31
+ /**
32
+ * An app as `GET /admin/api/apps/{appId}` serializes it. Dates are ISO-8601
33
+ * strings. The lineage fields are null on an app with no parent, and
34
+ * `ownerAdminId`, `branch`, `idleDays` and `expiresAt` appear only on a child.
35
+ */
36
+ export interface AdminApp {
37
+ appId: string;
38
+ name: string;
39
+ mode: string;
40
+ baseUrl: string | null;
41
+ createdBy: string | null;
42
+ /** The format new root documents are minted in, or null when the app never chose. */
43
+ rootDocumentFormat: string | null;
44
+ protection: string;
45
+ parentAppId: string | null;
46
+ childSlug: string | null;
47
+ lastActivityAt: string | null;
48
+ ownerAdminId?: string | null;
49
+ branch?: string | null;
50
+ idleDays?: number | null;
51
+ expiresAt?: string | null;
52
+ createdAt: string;
53
+ modifiedAt: string;
54
+ /** The app's remaining settings (auth, CORS, passkeys, invitations, …). */
55
+ [setting: string]: unknown;
56
+ }
31
57
  /**
32
58
  * One child app as `GET /admin/api/apps/{appId}/children` lists it. Dates
33
59
  * are ISO-8601 strings.
@@ -61,15 +87,283 @@ export interface ChildPreviewOrigins {
61
87
  previewOrigins: string[];
62
88
  }
63
89
  /** One row of a db3's index registry, as `db3/:id/indexes` answers it. */
90
+ /** What a db3 index is (#5220). */
91
+ export type Db3IndexKind = "scalar" | "members" | "text" | "vector";
92
+ /** Where a db3 index lives (#5220). */
93
+ export type Db3IndexPlacement = "server" | "device" | "both";
94
+ /** A `vector` index's options on its registration (#5225): how devices search the field. */
95
+ export interface Db3VectorIndexOptions {
96
+ distance?: "cos" | "l2";
97
+ index?: "exact" | {
98
+ mode: "ann";
99
+ nbucket?: number;
100
+ codesize?: number;
101
+ quantizer?: "pq" | "opq" | "bq";
102
+ };
103
+ }
64
104
  export interface Db3IndexRow {
65
105
  name: string;
66
106
  model: string;
67
107
  fields: string[];
68
108
  unique: boolean;
109
+ /** `true` for a string-set field's member index; absent on any other. */
110
+ members?: boolean;
69
111
  origins: Array<{
70
112
  kind: "declaration" | "named";
71
113
  unique: boolean;
72
114
  }>;
115
+ /** What the index is; a server from before #5220 lists none. */
116
+ kind?: Db3IndexKind;
117
+ /** Where the index lives; a server from before #5220 lists none. */
118
+ on?: Db3IndexPlacement;
119
+ /** A text index's options, every one filled in (#5222); absent on any other kind. */
120
+ text?: Db3TextIndexOptions;
121
+ /** A vector index's options filled in, with its field's `dims` and `element` (#5229); absent on any other kind. */
122
+ vector?: Db3VectorIndexOptions & {
123
+ dims?: number;
124
+ element?: "f32" | "f16" | "i8";
125
+ };
126
+ /** A vector index's generation: new at every registration (#5229). */
127
+ generation?: number;
128
+ /** A vector index's model revision: moved on when its model is deleted (#5229). */
129
+ revision?: number;
130
+ /** An `ann` vector index's shared model, once a device uploaded one (#5229). */
131
+ annModel?: Db3IndexAnnModel;
132
+ }
133
+ /** An `ann` vector index's shared model as `GET db3/:id/indexes` lists it (#5229). */
134
+ export interface Db3IndexAnnModel {
135
+ revision: number;
136
+ trainedAt: string;
137
+ rows: number;
138
+ bytes: number;
139
+ format: string;
140
+ }
141
+ /** What `db3/:id/records/:model/explain` takes (#5240): the read, as its records route takes it, and an optional force. */
142
+ export interface Db3ExplainRequest {
143
+ op: "query" | "count" | "aggregate";
144
+ filter?: Record<string, any>;
145
+ options?: {
146
+ sort?: unknown;
147
+ limit?: number | string;
148
+ cursor?: string;
149
+ include?: unknown;
150
+ };
151
+ aggregate?: Record<string, unknown>;
152
+ /** An index of the model to force the read onto, or `"none"`. */
153
+ index?: string;
154
+ }
155
+ /** One statement an explained read ran (#5240). */
156
+ export interface Db3ExplainedStatement {
157
+ model: string;
158
+ sql: string;
159
+ runs: number;
160
+ plan: string[] | null;
161
+ planError?: string;
162
+ indexes: string[];
163
+ scan: boolean;
164
+ }
165
+ /** What `db3/:id/records/:model/explain` answers (#5240). */
166
+ export interface Db3ExplainAnswer {
167
+ op: "query" | "count" | "aggregate";
168
+ model: string;
169
+ index: string | null;
170
+ indexes: string[];
171
+ scanned: string[];
172
+ statements: Db3ExplainedStatement[];
173
+ answered: number;
174
+ cost: {
175
+ rowsRead: number | null;
176
+ rowsWritten: number | null;
177
+ };
178
+ stats: boolean;
179
+ sqlite: string;
180
+ }
181
+ /** A text index's tokenizer (#5222). */
182
+ export type Db3TextTokenizer = "unicode61" | "porter";
183
+ /** A text index's options (#5222): as `list` answers them every one is filled in; a registration gives any. */
184
+ export interface Db3TextIndexOptions {
185
+ tokenizer: Db3TextTokenizer;
186
+ prefix: number[];
187
+ weights: Record<string, number>;
188
+ }
189
+ /** `GET`/`PATCH users/index/limits`: the shard limit overrides and effective limits, and the property caps. */
190
+ export interface UserIndexLimitsAnswer {
191
+ overrides: Record<string, number | null> | null;
192
+ effective: Record<string, unknown>;
193
+ caps?: {
194
+ effective: Record<string, number>;
195
+ overrides: Record<string, number | null> | null;
196
+ };
197
+ }
198
+ /** One revalidation slice of an app's user index: when it ran, what started it, and its counts. */
199
+ export type UserIndexSlice = {
200
+ at: string;
201
+ startedAt: string;
202
+ durationMs: number;
203
+ trigger: "alarm" | "demand";
204
+ intervalMs: number;
205
+ nextAt: string;
206
+ batches: number;
207
+ continuations: number;
208
+ behind: boolean;
209
+ hinted: number;
210
+ verified: number;
211
+ stamped: number;
212
+ reprojected: number;
213
+ deleted: number;
214
+ applied: number;
215
+ misplaced: number;
216
+ failed: number;
217
+ sourcePages: number;
218
+ swept: number;
219
+ invitationClaims: number;
220
+ };
221
+ /**
222
+ * `POST users/index/reconcile`: 202 once one slice ran, or 200 with no slice
223
+ * while the app is being deleted.
224
+ */
225
+ export type UserIndexReconcileAnswer = {
226
+ ok: boolean;
227
+ started: true;
228
+ mode: "slice";
229
+ slice: UserIndexSlice;
230
+ reason?: undefined;
231
+ } | {
232
+ ok: boolean;
233
+ started: false;
234
+ reason: "closed";
235
+ };
236
+ /** The body of `POST users/walks` (#5393): the batch function, the walk's key, which users in what batches. */
237
+ export interface UserWalkStartBody {
238
+ function: string;
239
+ key: string;
240
+ filter?: Record<string, unknown>;
241
+ sort?: Record<string, 1 | -1>;
242
+ input?: unknown;
243
+ batchSize?: number;
244
+ concurrency?: number;
245
+ snapshot?: boolean;
246
+ }
247
+ /** A started (or found) users walk. */
248
+ export interface UserWalkStartAnswer {
249
+ runId: string;
250
+ walkId: string;
251
+ key: string;
252
+ status: string;
253
+ existing: boolean;
254
+ }
255
+ /** A users walk read: the coordinator's view (null when it holds no state) and the walk's run row. */
256
+ export interface UserWalkAnswer {
257
+ status: {
258
+ status: string;
259
+ walk: Record<string, any> | null;
260
+ };
261
+ run: Record<string, any>;
262
+ /** On a terminate only: whether this call ended the walk. */
263
+ terminated?: boolean;
264
+ }
265
+ /** The active user properties schema, as `GET users/properties` answers it. */
266
+ export interface UserPropertiesActive {
267
+ version: number;
268
+ hash: string;
269
+ fields: Record<string, any>;
270
+ uniqueConstraints: Array<{
271
+ name: string;
272
+ fields: string[];
273
+ }>;
274
+ modifiedAt: string | null;
275
+ }
276
+ /** `GET users/properties`. */
277
+ export interface UserPropertiesState {
278
+ appId: string;
279
+ active: UserPropertiesActive | null;
280
+ /** Always null: a push publishes or is refused at once. */
281
+ staged: null;
282
+ removedFields: Record<string, {
283
+ type: string;
284
+ removedAt: string;
285
+ }>;
286
+ caps: {
287
+ effective: Record<string, number>;
288
+ overrides: Record<string, number | null> | null;
289
+ };
290
+ }
291
+ /** One member with their properties, as `GET users/{userId}`, `POST users/get-by` and a property write answer it (#5386). */
292
+ export interface AppUserWithProperties {
293
+ userId: string;
294
+ email: string | null;
295
+ name: string | null;
296
+ avatarUrl: string | null;
297
+ role: string | null;
298
+ status: string;
299
+ disabledAt?: string;
300
+ addedAt: string | null;
301
+ testUser: boolean;
302
+ properties: Record<string, unknown>;
303
+ }
304
+ /** A property write's body (#5386): a merge-patch (null clears), set additions and removals, and a condition checked inside the write. */
305
+ export interface AppUserPropertiesWrite {
306
+ patch?: Record<string, unknown>;
307
+ addToSet?: Record<string, string[]>;
308
+ removeFromSet?: Record<string, string[]>;
309
+ condition?: Record<string, unknown>;
310
+ }
311
+ /** `PUT users/properties`. */
312
+ export interface UserPropertiesPushAnswer {
313
+ outcome: "published" | "unchanged" | "would-publish";
314
+ active?: UserPropertiesActive | null;
315
+ removedFields?: Record<string, {
316
+ type: string;
317
+ removedAt: string;
318
+ }>;
319
+ checks?: Array<Record<string, unknown>>;
320
+ }
321
+ /** One version of a `schemas/` file, as `GET …/schemas` lists it (#5532). */
322
+ export interface SchemaFileMeta {
323
+ file: string;
324
+ version: number;
325
+ tombstone: boolean;
326
+ /** sha256 hex of the source; null on a tombstone. */
327
+ sourceHash: string | null;
328
+ /** The file's def names, in file order; empty on a tombstone. */
329
+ defs: string[];
330
+ createdAt: string;
331
+ }
332
+ /** One version of a `schemas/` file with its source and compiled defs (`GET …/schemas/:file`). */
333
+ export interface SchemaFileVersion extends SchemaFileMeta {
334
+ /** Whether this is the file's current version. */
335
+ current: boolean;
336
+ createdBy: string;
337
+ source: string | null;
338
+ /**
339
+ * The compiled defs and, for a version stored since #5533, each def's
340
+ * provenance: where it inlined refs and the hash of each def it inlined.
341
+ */
342
+ compiled: {
343
+ defs: Record<string, unknown>;
344
+ provenance?: Record<string, SchemaFileProvenance>;
345
+ } | null;
346
+ }
347
+ /** One def's provenance: inlined pointer → the chain of refs inlined there, each with its def's hash (#5533). */
348
+ export type SchemaFileProvenance = Record<string, {
349
+ chain: Array<{
350
+ ref: string;
351
+ hash: string;
352
+ }>;
353
+ }>;
354
+ /** What a `schemas/` push answers (`PUT …/schemas/:file`). */
355
+ export interface SchemaPushAnswer extends SchemaFileMeta {
356
+ outcome: "created" | "unchanged" | "tombstoned";
357
+ warnings: string[];
358
+ }
359
+ /** One live file's source, as `POST …/schemas/pull` answers it. */
360
+ export interface SchemaPullItem {
361
+ file: string;
362
+ version: number;
363
+ sourceHash: string;
364
+ defs: string[];
365
+ createdAt: string;
366
+ source: string;
73
367
  }
74
368
  export declare class ApiError extends Error {
75
369
  statusCode: number;
@@ -182,6 +476,14 @@ interface EmailTemplateDetail {
182
476
  description: string;
183
477
  }[];
184
478
  }
479
+ /** The server's rendering of an email template, from the preview route. */
480
+ export interface EmailTemplatePreview {
481
+ renderedSubject: string;
482
+ renderedHtml: string;
483
+ renderedText: string;
484
+ /** The variable values that were rendered: the type's samples, overridden by the caller's. */
485
+ sampleVariables: Record<string, string>;
486
+ }
185
487
  interface EmailTemplateUpsertResult {
186
488
  emailType: string;
187
489
  templateId: string;
@@ -192,6 +494,32 @@ interface EmailTemplateUpsertResult {
192
494
  modifiedAt: string;
193
495
  warnings: string[];
194
496
  }
497
+ /**
498
+ * #5105 — which `+primitivetest` test users an analytics read counted:
499
+ * `exclude` real users only, `include` everyone, `only` test users alone.
500
+ */
501
+ type AnalyticsTestUsersMode = "include" | "exclude" | "only";
502
+ /** The `testUsers` query parameter an analytics read accepts (#5105). */
503
+ interface AnalyticsTestUsersParam {
504
+ testUsers?: AnalyticsTestUsersMode;
505
+ }
506
+ /**
507
+ * #5251 — `_bust=1`: the analytics read recomputes instead of answering from
508
+ * the server's cache.
509
+ */
510
+ interface AnalyticsFreshParam {
511
+ _bust?: "1";
512
+ }
513
+ /**
514
+ * #5251 — one `filter[<field>][<operator>]` entry of an events or errors
515
+ * query, with the server's operator name (`is`, `is not`, `contains`,
516
+ * `starts with`).
517
+ */
518
+ export interface AnalyticsFilterParam {
519
+ field: string;
520
+ operator: string;
521
+ value: string;
522
+ }
195
523
  interface AnalyticsTiming {
196
524
  total_ms: number;
197
525
  wae_queries: number[];
@@ -200,6 +528,8 @@ interface AnalyticsMetricResponse {
200
528
  value: number;
201
529
  previous: number;
202
530
  deltaPct: number;
531
+ /** #5105 — the mode the server applied. */
532
+ testUsers: AnalyticsTestUsersMode;
203
533
  _timing: AnalyticsTiming;
204
534
  }
205
535
  interface AnalyticsGrowthResponse {
@@ -211,6 +541,8 @@ interface AnalyticsGrowthResponse {
211
541
  current_active: number;
212
542
  previous_active: number;
213
543
  deltaPct: number;
544
+ /** #5105 — the mode the server applied. */
545
+ testUsers: AnalyticsTestUsersMode;
214
546
  _timing: AnalyticsTiming;
215
547
  }
216
548
  interface AnalyticsDailyActivePoint {
@@ -221,6 +553,8 @@ interface AnalyticsDailyActivePoint {
221
553
  interface AnalyticsDailyActiveResponse {
222
554
  window_days: number;
223
555
  rows: AnalyticsDailyActivePoint[];
556
+ /** #5105 — the mode the server applied. */
557
+ testUsers: AnalyticsTestUsersMode;
224
558
  _timing: AnalyticsTiming;
225
559
  }
226
560
  interface AnalyticsCohortRow {
@@ -233,6 +567,8 @@ interface AnalyticsCohortResponse {
233
567
  weeks: number[];
234
568
  rows: AnalyticsCohortRow[];
235
569
  averages: (number | null)[];
570
+ /** #5105 — the mode the server applied. */
571
+ testUsers: AnalyticsTestUsersMode;
236
572
  _timing: AnalyticsTiming;
237
573
  }
238
574
  interface AnalyticsUserSummary {
@@ -263,6 +599,8 @@ interface AnalyticsTopUsersResponse {
263
599
  windowDays: number;
264
600
  limit: number;
265
601
  results: AnalyticsTopUserRow[];
602
+ /** #5105 — the mode the server applied. */
603
+ testUsers: AnalyticsTestUsersMode;
266
604
  _timing: AnalyticsTiming;
267
605
  }
268
606
  interface AnalyticsUserSearchResponse {
@@ -276,6 +614,8 @@ interface AnalyticsUserSearchResponse {
276
614
  offset?: number;
277
615
  /** True when more rows match than this page returned; page with `offset`. */
278
616
  truncated?: boolean;
617
+ /** #5105 — the mode the server applied. */
618
+ testUsers: AnalyticsTestUsersMode;
279
619
  }
280
620
  interface AnalyticsUserDetailResponse {
281
621
  user: {
@@ -324,6 +664,8 @@ interface AnalyticsEventsResponse {
324
664
  page_size: number;
325
665
  total_rows: number;
326
666
  rows: AnalyticsEventRow[];
667
+ /** #5105 — the mode the server applied. */
668
+ testUsers: AnalyticsTestUsersMode;
327
669
  _timing: AnalyticsTiming;
328
670
  }
329
671
  interface AnalyticsGroupedRow {
@@ -335,6 +677,8 @@ interface AnalyticsGroupedRow {
335
677
  interface AnalyticsEventsGroupedResponse {
336
678
  group_by: string;
337
679
  rows: AnalyticsGroupedRow[];
680
+ /** #5105 — the mode the server applied. */
681
+ testUsers: AnalyticsTestUsersMode;
338
682
  _timing: AnalyticsTiming;
339
683
  }
340
684
  interface AnalyticsErrorGroupExemplar {
@@ -367,6 +711,54 @@ interface AnalyticsErrorsGroupsResponse {
367
711
  rows: AnalyticsErrorGroupRow[];
368
712
  _timing: AnalyticsTiming;
369
713
  }
714
+ /** One db3 query shape's cost over the window, per endpoint and function (#5244). */
715
+ interface AnalyticsDb3QueryRow {
716
+ shape_id: string;
717
+ type: string;
718
+ model: string;
719
+ op: string;
720
+ filter: string;
721
+ sort: string;
722
+ include: string;
723
+ endpoint: string;
724
+ function_id: string | null;
725
+ function_key: string | null;
726
+ calls: number;
727
+ rows_read: number;
728
+ rows_returned: number;
729
+ rows_read_per_call: number;
730
+ /** `null` when the calls returned nothing. */
731
+ rows_read_per_returned: number | null;
732
+ scanned_calls: number;
733
+ counters_known_calls: number;
734
+ }
735
+ /** What `GET analytics/db3/queries` answers (#5244). */
736
+ interface AnalyticsDb3QueriesResponse {
737
+ window_days: number;
738
+ order_by: "rowsRead" | "rowsPerReturned";
739
+ rows: AnalyticsDb3QueryRow[];
740
+ _timing: AnalyticsTiming;
741
+ }
742
+ /** One endpoint's (and function's) requests over the window (#5244). */
743
+ interface AnalyticsRequestRow {
744
+ method: string;
745
+ path: string;
746
+ function_id: string | null;
747
+ function_key: string | null;
748
+ requests: number;
749
+ wall_ms_avg: number;
750
+ wall_ms_p50: number;
751
+ wall_ms_p95: number;
752
+ dynamo_calls_per_request: number;
753
+ dynamo_ms_per_request: number;
754
+ cold_starts: number;
755
+ }
756
+ /** What `GET analytics/requests` answers (#5244). */
757
+ interface AnalyticsRequestsResponse {
758
+ window_days: number;
759
+ rows: AnalyticsRequestRow[];
760
+ _timing: AnalyticsTiming;
761
+ }
370
762
  /**
371
763
  * What a `DELETE` on a status-carrying object answers (#2887, #2907).
372
764
  *
@@ -393,6 +785,34 @@ export interface IntegrationWritePayload {
393
785
  timeoutMs?: number;
394
786
  status?: string;
395
787
  }
788
+ /** A multipart part sent with an integration test request. */
789
+ export interface IntegrationTestMultipartField {
790
+ fieldName: string;
791
+ /** `value` sends `value` as a text part; `attachment` sends the attachment at `attachmentIndex`. */
792
+ type: "value" | "attachment";
793
+ value?: string;
794
+ attachmentIndex?: number;
795
+ }
796
+ /** Body accepted by `POST …/integrations/{id}/test`: the request under test. */
797
+ export interface IntegrationTestPayload {
798
+ method?: string;
799
+ path?: string;
800
+ query?: unknown;
801
+ /** A JSON body. */
802
+ body?: unknown;
803
+ headers?: Record<string, string>;
804
+ /** A url-encoded body; a name with an array value is sent as a repeated key. */
805
+ form?: Record<string, string | string[]>;
806
+ /** How the body is built; absent means JSON (or `form` when given). */
807
+ bodyMode?: "raw" | "multipart";
808
+ /** Files, each `{ name, type, data }` with `data` in base64. */
809
+ attachments?: Array<{
810
+ name: string;
811
+ type: string;
812
+ data: string;
813
+ }>;
814
+ multipartFields?: IntegrationTestMultipartField[];
815
+ }
396
816
  /**
397
817
  * Integration detail response. `requestConfig` is only on the detail — the
398
818
  * list summary does not carry it.
@@ -603,10 +1023,7 @@ export declare class ApiClient {
603
1023
  */
604
1024
  removeChildPreviewOrigin(parentAppId: string, slug: string, origin: string): Promise<ChildPreviewOrigins>;
605
1025
  private childPreviewOriginsPath;
606
- getApp(appId: string): Promise<{
607
- id: string;
608
- name: string;
609
- }>;
1026
+ getApp(appId: string): Promise<AdminApp>;
610
1027
  deleteApp(appId: string): Promise<void>;
611
1028
  getAppSettings(appId: string): Promise<any>;
612
1029
  updateAppSettings(appId: string, settings: any): Promise<any>;
@@ -615,6 +1032,22 @@ export declare class ApiClient {
615
1032
  role?: string;
616
1033
  name?: string;
617
1034
  avatarUrl?: string | null;
1035
+ initialProperties?: Record<string, unknown>;
1036
+ }): Promise<any>;
1037
+ /**
1038
+ * Invite an email to the app as a console admin
1039
+ * (`POST /admin/api/apps/:appId/users/invite`): the invitation, with its
1040
+ * `inviteToken` and the `initialProperties` it gives the invitee at
1041
+ * acceptance (filling only what they have not set).
1042
+ */
1043
+ inviteUser(appId: string, data: {
1044
+ email: string;
1045
+ role?: "admin" | "member";
1046
+ expiresAt?: string;
1047
+ sendEmail?: boolean;
1048
+ note?: string;
1049
+ source?: string;
1050
+ initialProperties?: Record<string, unknown>;
618
1051
  }): Promise<any>;
619
1052
  /**
620
1053
  * Set a member's display name and/or avatar URL
@@ -634,16 +1067,205 @@ export declare class ApiClient {
634
1067
  rebuildUserSearchText(appId: string): Promise<{
635
1068
  count: number;
636
1069
  }>;
1070
+ /**
1071
+ * One page of an app's users from the user index
1072
+ * (`POST /admin/api/apps/:appId/users/query`): the records-query filter and
1073
+ * sort over base fields and `properties.<name>`, at most 1,000 per page.
1074
+ */
1075
+ queryUsers(appId: string, body: {
1076
+ filter?: Record<string, unknown>;
1077
+ sort?: unknown;
1078
+ limit?: number;
1079
+ cursor?: string;
1080
+ }): Promise<{
1081
+ items: any[];
1082
+ hasMore: boolean;
1083
+ nextCursor?: string;
1084
+ prevCursor?: string;
1085
+ meta: any;
1086
+ }>;
1087
+ /** How many of an app's users match (`POST /admin/api/apps/:appId/users/count`). */
1088
+ countUsers(appId: string, body: {
1089
+ filter?: Record<string, unknown>;
1090
+ }): Promise<{
1091
+ count: number;
1092
+ meta: any;
1093
+ }>;
1094
+ /**
1095
+ * The state of an app's user index (`GET /admin/api/apps/:appId/users/index`):
1096
+ * the generation, each shard with its bound and counts, superseded
1097
+ * generations, a rebuild in progress, queued applies, the last apply and
1098
+ * reconciliation, the limits and whether the shard ceiling is reached.
1099
+ */
1100
+ getUserIndexStatus(appId: string): Promise<any>;
1101
+ /**
1102
+ * Start a report of which user metadata categories still hold rows on the
1103
+ * app's current members (`POST /admin/api/apps/:appId/users/metadata-report`).
1104
+ */
1105
+ startUserMetadataReport(appId: string): Promise<{
1106
+ ok: boolean;
1107
+ runId: string;
1108
+ resourceType: string;
1109
+ status: string;
1110
+ statusUrl: string;
1111
+ }>;
1112
+ /**
1113
+ * Read a user metadata report run, or the app's newest when `runId` is
1114
+ * absent (`GET /admin/api/apps/:appId/users/metadata-report`).
1115
+ */
1116
+ getUserMetadataReport(appId: string, runId?: string): Promise<any>;
1117
+ /** Start building the next generation of an app's user index (`POST /admin/api/apps/:appId/users/index/rebuild`). */
1118
+ rebuildUserIndex(appId: string): Promise<{
1119
+ ok: boolean;
1120
+ generation: number;
1121
+ build: any;
1122
+ }>;
1123
+ /**
1124
+ * Run one revalidation slice of an app's user index now
1125
+ * (`POST /admin/api/apps/:appId/users/index/reconcile`), answered when it is
1126
+ * done; `started: false` while the app is being deleted.
1127
+ */
1128
+ reconcileUserIndex(appId: string): Promise<UserIndexReconcileAnswer>;
1129
+ /**
1130
+ * Start (or find) a walk over an app's users with the admin as its starter
1131
+ * (`POST /admin/api/apps/:appId/users/walks`); `existing` says the key named
1132
+ * a walk that already existed.
1133
+ */
1134
+ startUserWalk(appId: string, body: UserWalkStartBody): Promise<UserWalkStartAnswer>;
1135
+ /** A users walk by its run id (`GET /admin/api/apps/:appId/users/walks/:runId`). */
1136
+ getUserWalk(appId: string, runId: string): Promise<UserWalkAnswer>;
1137
+ /** Stop a users walk (`POST /admin/api/apps/:appId/users/walks/:runId/terminate`); batches in flight finish. */
1138
+ terminateUserWalk(appId: string, runId: string): Promise<UserWalkAnswer & {
1139
+ terminated: boolean;
1140
+ }>;
1141
+ /**
1142
+ * An app's user index limit overrides and the limits in effect, with the
1143
+ * property caps beside them (`GET /admin/api/apps/:appId/users/index/limits`).
1144
+ */
1145
+ getUserIndexLimits(appId: string): Promise<UserIndexLimitsAnswer>;
1146
+ /**
1147
+ * Set (a positive integer) or clear (`null`) an app's user index limit
1148
+ * overrides (`PATCH /admin/api/apps/:appId/users/index/limits`).
1149
+ */
1150
+ patchUserIndexLimits(appId: string, body: {
1151
+ shardThreshold?: number | null;
1152
+ shardBytes?: number | null;
1153
+ shardCeiling?: number | null;
1154
+ maxFields?: number | null;
1155
+ maxUnique?: number | null;
1156
+ maxIndexed?: number | null;
1157
+ maxBytes?: number | null;
1158
+ }): Promise<UserIndexLimitsAnswer>;
1159
+ /**
1160
+ * An app's user properties schema (`GET /admin/api/apps/:appId/users/properties`):
1161
+ * the active version, a push being validated, the removed fields and the caps.
1162
+ * While a push validates, this read also resumes its walk.
1163
+ */
1164
+ getUserProperties(appId: string): Promise<UserPropertiesState>;
1165
+ /**
1166
+ * Push the text of `user-properties.toml` (`PUT /admin/api/apps/:appId/users/properties`):
1167
+ * 200 `published` or `unchanged`, 400 when refused; `dryRun` judges it and
1168
+ * writes nothing.
1169
+ */
1170
+ pushUserProperties(appId: string, body: {
1171
+ schema: string;
1172
+ expectedModifiedAt?: string | null;
1173
+ }, options?: {
1174
+ dryRun?: boolean;
1175
+ }): Promise<UserPropertiesPushAnswer>;
1176
+ /**
1177
+ * The current version of each of an app's `schemas/` files
1178
+ * (`GET /admin/api/apps/:appId/schemas`); a tombstoned file only with
1179
+ * `includeTombstoned`.
1180
+ */
1181
+ listSchemaFiles(appId: string, options?: {
1182
+ includeTombstoned?: boolean;
1183
+ }): Promise<{
1184
+ items: SchemaFileMeta[];
1185
+ hasMore: boolean;
1186
+ }>;
1187
+ /**
1188
+ * One version of a `schemas/` file, the current one unless `version` names
1189
+ * another (`GET /admin/api/apps/:appId/schemas/:file`); 404
1190
+ * `SCHEMA_FILE_NOT_FOUND` or `SCHEMA_VERSION_NOT_FOUND`.
1191
+ */
1192
+ getSchemaFile(appId: string, file: string, options?: {
1193
+ version?: number;
1194
+ }): Promise<SchemaFileVersion>;
1195
+ /**
1196
+ * Push the text of `schemas/<file>.toml` with its compiled defs
1197
+ * (`PUT /admin/api/apps/:appId/schemas/:file`): `created` or `unchanged`;
1198
+ * 409 `CONFLICT` when the current version is not `expectedVersion`.
1199
+ */
1200
+ pushSchemaFile(appId: string, file: string, body: {
1201
+ source: string;
1202
+ compiled?: {
1203
+ defs: Record<string, unknown>;
1204
+ provenance?: Record<string, SchemaFileProvenance>;
1205
+ };
1206
+ expectedVersion?: number;
1207
+ }): Promise<SchemaPushAnswer>;
1208
+ /**
1209
+ * Write a tombstone version of a `schemas/` file (`PUT
1210
+ * /admin/api/apps/:appId/schemas/:file` with `{ tombstone: true }`), pinned
1211
+ * to `expectedVersion` when given.
1212
+ */
1213
+ tombstoneSchemaFile(appId: string, file: string, expectedVersion?: number): Promise<SchemaPushAnswer>;
1214
+ /**
1215
+ * The source of every live `schemas/` file, or of `files` only
1216
+ * (`POST /admin/api/apps/:appId/schemas/pull`); a named file with no live
1217
+ * version is listed under `missing`.
1218
+ */
1219
+ pullSchemaFiles(appId: string, files?: string[]): Promise<{
1220
+ items: SchemaPullItem[];
1221
+ missing: string[];
1222
+ }>;
1223
+ /** One member with their properties (`GET /admin/api/apps/:appId/users/:userId`); 404 `USER_NOT_FOUND` for a user who is no member. */
1224
+ getAppUser(appId: string, userId: string): Promise<AppUserWithProperties>;
1225
+ /**
1226
+ * The member who holds a unique property value or a unique constraint's
1227
+ * values (`POST /admin/api/apps/:appId/users/get-by`): `{ user }`, null when
1228
+ * no member holds it.
1229
+ */
1230
+ getAppUserBy(appId: string, selector: {
1231
+ field: string;
1232
+ value: unknown;
1233
+ } | {
1234
+ constraint: string;
1235
+ values: unknown[];
1236
+ }): Promise<{
1237
+ user: AppUserWithProperties | null;
1238
+ }>;
1239
+ /** Apply a property write to one member (`PATCH /admin/api/apps/:appId/users/:userId/properties`); answers the member after it. */
1240
+ setAppUserProperties(appId: string, userId: string, body: AppUserPropertiesWrite): Promise<AppUserWithProperties>;
1241
+ /** An aggregate over an app's users (`POST /admin/api/apps/:appId/users/aggregate`). */
1242
+ aggregateUsers(appId: string, body: {
1243
+ options: {
1244
+ operations: Array<{
1245
+ type: string;
1246
+ field?: string;
1247
+ }>;
1248
+ groupBy?: unknown[];
1249
+ filter?: Record<string, unknown>;
1250
+ sort?: unknown;
1251
+ limit?: number;
1252
+ };
1253
+ }): Promise<{
1254
+ result: any[];
1255
+ meta: any;
1256
+ }>;
637
1257
  listUsers(appId: string, params?: {
638
1258
  name?: string;
639
1259
  email?: string;
640
1260
  userId?: string;
641
1261
  limit?: number;
642
1262
  cursor?: string;
1263
+ testUsers?: "include" | "exclude" | "only";
643
1264
  }): Promise<{
644
1265
  items: any[];
645
1266
  hasMore?: boolean;
646
1267
  nextCursor?: string | null;
1268
+ scanned?: number;
647
1269
  }>;
648
1270
  /**
649
1271
  * @deprecated Use {@link setUserAvailability} with `"disable"`
@@ -657,21 +1279,13 @@ export declare class ApiClient {
657
1279
  * routes already existed; nothing on the CLI reached them.
658
1280
  */
659
1281
  setUserAvailability(appId: string, userId: string, action: "enable" | "disable"): Promise<void>;
1282
+ updateUserRole(appId: string, userId: string, role: "admin" | "member"): Promise<any>;
660
1283
  /**
661
- * #2803 — the platform's feature flags. A server-owned admin toggle with a
662
- * console but, until now, no CLI: the same "one control, both surfaces" rule
663
- * the carrying types get.
664
- */
665
- listFeatureFlags(): Promise<any>;
666
- /**
667
- * The flag itself, not the `{ flag }` envelope the route answers with —
668
- * `feature-flags get` prints the key, the enabled state and the per-app
669
- * overrides, and reading them off the envelope printed a blank row.
1284
+ * Make the app user with `newOwnerEmail` the app's owner; the previous
1285
+ * owner becomes an admin. The email resolves to a userId through
1286
+ * {@link lookupUserByEmail}, and an email no user of the app has rejects
1287
+ * with a message naming it.
670
1288
  */
671
- getFeatureFlag(flagKey: string): Promise<any>;
672
- /** Same envelope, same unwrap: `enable`/`disable` print the updated flag. */
673
- setFeatureFlagEnabled(flagKey: string, enabled: boolean): Promise<any>;
674
- updateUserRole(appId: string, userId: string, role: "admin" | "member"): Promise<any>;
675
1289
  transferOwnership(appId: string, newOwnerEmail: string): Promise<void>;
676
1290
  transferAdminOwnership(appId: string, adminId: string): Promise<any>;
677
1291
  listAppAdmins(appId: string): Promise<any[]>;
@@ -693,6 +1307,19 @@ export declare class ApiClient {
693
1307
  nextCursor?: string;
694
1308
  hasMore?: boolean;
695
1309
  }>;
1310
+ /**
1311
+ * `GET /app/{appId}/api/invitations/{invitationId}` — one invitation with
1312
+ * its `inviteToken` (the bearer credential an accept link carries) and its
1313
+ * `status`. Readable by an app admin/owner or the inviter.
1314
+ */
1315
+ getInvitation(appId: string, invitationId: string): Promise<{
1316
+ invitationId: string;
1317
+ email: string;
1318
+ role: string;
1319
+ inviteToken: string | null;
1320
+ status: "pending" | "expired" | "accepted";
1321
+ [key: string]: any;
1322
+ }>;
696
1323
  createInvitation(appId: string, data: {
697
1324
  email: string;
698
1325
  role: "admin" | "member";
@@ -738,7 +1365,7 @@ export declare class ApiClient {
738
1365
  /**
739
1366
  * An integration's named configs. Test cases pin a config by NAME so the
740
1367
  * sidecar is portable across apps (#2769); this is the map pull and push
741
- * resolve that name through, the same way prompts/workflows/scripts do.
1368
+ * resolve that name through, the same way prompts do.
742
1369
  */
743
1370
  listIntegrationConfigs(appId: string, integrationId: string): Promise<{
744
1371
  items: any[];
@@ -754,7 +1381,7 @@ export declare class ApiClient {
754
1381
  deleteIntegration(appId: string, integrationId: string, hard?: boolean | {
755
1382
  hard?: boolean;
756
1383
  }): Promise<ArchiveEnvelope>;
757
- testIntegration(appId: string, integrationId: string, payload: any): Promise<any>;
1384
+ testIntegration(appId: string, integrationId: string, payload: IntegrationTestPayload): Promise<any>;
758
1385
  listIntegrationLogs(appId: string, integrationId: string, params?: {
759
1386
  limit?: number;
760
1387
  status?: string;
@@ -774,7 +1401,7 @@ export declare class ApiClient {
774
1401
  }): Promise<any>;
775
1402
  updateAppSecret(appId: string, secretId: string, payload: {
776
1403
  value?: string;
777
- summary?: string;
1404
+ summary?: string | null;
778
1405
  }): Promise<any>;
779
1406
  upsertAppSecret(appId: string, key: string, payload: {
780
1407
  value: string;
@@ -1169,25 +1796,6 @@ export declare class ApiClient {
1169
1796
  configName?: string;
1170
1797
  description?: string;
1171
1798
  }): Promise<any>;
1172
- listScripts(appId: string): Promise<{
1173
- items: any[];
1174
- }>;
1175
- getScript(appId: string, scriptId: string): Promise<any>;
1176
- /**
1177
- * List a script's versioned configs (the `ScriptConfig` rows). Each config
1178
- * is a distinct block version: `configId` is the stable version selector,
1179
- * `contentHash` is its content identity, and `status` reports whether it is
1180
- * `active`/`draft`/`archived`. The script header's `activeConfigId` names
1181
- * the version that was live. Used by `scripts configs list`.
1182
- */
1183
- listScriptConfigs(appId: string, scriptId: string): Promise<{
1184
- items: any[];
1185
- }>;
1186
- /**
1187
- * One version of a script, body included. A body the server cannot load
1188
- * answers a 404 naming the version rather than an empty body.
1189
- */
1190
- getScriptConfig(appId: string, scriptId: string, configId: string): Promise<any>;
1191
1799
  getPromptSchema(appId: string, promptId: string): Promise<{
1192
1800
  promptId: string;
1193
1801
  promptKey: string;
@@ -1275,46 +1883,44 @@ export declare class ApiClient {
1275
1883
  comparisonGroup?: string;
1276
1884
  testCaseIds?: string[];
1277
1885
  }): Promise<any>;
1886
+ /**
1887
+ * One page of a block's test runs, newest first. The endpoint paginates
1888
+ * (default 50, cap 100) and reports `nextCursor`.
1889
+ */
1278
1890
  listTestRuns(appId: string, blockType: "prompt" | "integration", blockId: string, params?: {
1279
- limit?: number;
1280
- comparisonGroup?: string;
1281
- }): Promise<{
1282
- items: any[];
1283
- }>;
1284
- listWorkflows(appId: string, params?: {
1285
- status?: string;
1286
1891
  limit?: number;
1287
1892
  cursor?: string;
1288
1893
  }): Promise<{
1289
1894
  items: any[];
1290
1895
  hasMore?: boolean;
1291
- nextCursor?: string | null;
1292
- }>;
1293
- getWorkflow(appId: string, workflowId: string): Promise<any>;
1294
- listWorkflowConfigs(appId: string, workflowId: string): Promise<{
1295
- items: any[];
1896
+ nextCursor?: string;
1296
1897
  }>;
1297
- getWorkflowConfig(appId: string, workflowId: string, configId: string): Promise<any>;
1898
+ /**
1899
+ * One of a block's test runs: the object `listTestRuns` lists for it. The
1900
+ * run id travels as one path segment, so a `/`, `?` or `#` in it can never
1901
+ * reach the listing or the query.
1902
+ */
1903
+ getTestRun(appId: string, blockType: "prompt" | "integration", blockId: string, runId: string): Promise<any>;
1298
1904
  getAnalyticsTopUsers(appId: string, params?: {
1299
1905
  windowDays?: number;
1300
1906
  limit?: number;
1301
- }): Promise<AnalyticsTopUsersResponse>;
1907
+ } & AnalyticsTestUsersParam & AnalyticsFreshParam): Promise<AnalyticsTopUsersResponse>;
1302
1908
  getAnalyticsIntegrationMetrics(appId: string, params?: {
1303
1909
  windowDays?: number;
1304
- }): Promise<AnalyticsIntegrationMetricsResponse>;
1305
- getAnalyticsOverviewDau(appId: string): Promise<AnalyticsMetricResponse>;
1306
- getAnalyticsOverviewWau(appId: string): Promise<AnalyticsMetricResponse>;
1307
- getAnalyticsOverviewMau(appId: string): Promise<AnalyticsMetricResponse>;
1910
+ } & AnalyticsFreshParam): Promise<AnalyticsIntegrationMetricsResponse>;
1911
+ getAnalyticsOverviewDau(appId: string, params?: AnalyticsTestUsersParam & AnalyticsFreshParam): Promise<AnalyticsMetricResponse>;
1912
+ getAnalyticsOverviewWau(appId: string, params?: AnalyticsTestUsersParam & AnalyticsFreshParam): Promise<AnalyticsMetricResponse>;
1913
+ getAnalyticsOverviewMau(appId: string, params?: AnalyticsTestUsersParam & AnalyticsFreshParam): Promise<AnalyticsMetricResponse>;
1308
1914
  getAnalyticsOverviewGrowth(appId: string, params?: {
1309
1915
  windowDays?: number;
1310
- }): Promise<AnalyticsGrowthResponse>;
1916
+ } & AnalyticsTestUsersParam & AnalyticsFreshParam): Promise<AnalyticsGrowthResponse>;
1311
1917
  getAnalyticsDailyActive(appId: string, params?: {
1312
1918
  windowDays?: number;
1313
- }): Promise<AnalyticsDailyActiveResponse>;
1919
+ } & AnalyticsTestUsersParam & AnalyticsFreshParam): Promise<AnalyticsDailyActiveResponse>;
1314
1920
  getAnalyticsRollingActive(appId: string, params?: {
1315
1921
  windowDays?: number;
1316
- }): Promise<AnalyticsDailyActiveResponse>;
1317
- getAnalyticsCohortRetention(appId: string): Promise<AnalyticsCohortResponse>;
1922
+ } & AnalyticsTestUsersParam & AnalyticsFreshParam): Promise<AnalyticsDailyActiveResponse>;
1923
+ getAnalyticsCohortRetention(appId: string, params?: AnalyticsTestUsersParam & AnalyticsFreshParam): Promise<AnalyticsCohortResponse>;
1318
1924
  getAnalyticsUserSearch(appId: string, params: {
1319
1925
  q?: string;
1320
1926
  limit?: number;
@@ -1325,28 +1931,45 @@ export declare class ApiClient {
1325
1931
  signupEndDay?: string;
1326
1932
  /** #3127 — row offset, accepted only with a signup filter. */
1327
1933
  offset?: number;
1328
- }): Promise<AnalyticsUserSearchResponse>;
1329
- getAnalyticsUserDetail(appId: string, userUlid: string): Promise<AnalyticsUserDetailResponse>;
1330
- getAnalyticsUserSnapshot(appId: string, userUlid: string): Promise<AnalyticsUserSnapshotResponse>;
1934
+ } & AnalyticsTestUsersParam & AnalyticsFreshParam): Promise<AnalyticsUserSearchResponse>;
1935
+ getAnalyticsUserDetail(appId: string, userUlid: string, params?: AnalyticsFreshParam): Promise<AnalyticsUserDetailResponse>;
1936
+ getAnalyticsUserSnapshot(appId: string, userUlid: string, params?: AnalyticsFreshParam): Promise<AnalyticsUserSnapshotResponse>;
1937
+ /**
1938
+ * #5251 — `path` with `params` set as `get` sets them, then one appended
1939
+ * `filter[<field>][<operator>]` entry per filter, in order. `get`'s record
1940
+ * cannot hold two entries under one key; the server ANDs them all.
1941
+ */
1942
+ private analyticsFilteredGet;
1331
1943
  getAnalyticsEvents(appId: string, params?: {
1332
1944
  windowDays?: number;
1333
1945
  page?: number;
1334
1946
  [key: string]: any;
1335
- }): Promise<AnalyticsEventsResponse>;
1947
+ } & AnalyticsTestUsersParam & AnalyticsFreshParam, filters?: AnalyticsFilterParam[]): Promise<AnalyticsEventsResponse>;
1336
1948
  getAnalyticsEventsGrouped(appId: string, params?: {
1337
1949
  groupBy?: string;
1338
1950
  windowDays?: number;
1339
1951
  [key: string]: any;
1340
- }): Promise<AnalyticsEventsGroupedResponse>;
1952
+ } & AnalyticsTestUsersParam & AnalyticsFreshParam, filters?: AnalyticsFilterParam[]): Promise<AnalyticsEventsGroupedResponse>;
1341
1953
  getAnalyticsErrorsGroups(appId: string, params?: {
1342
1954
  windowDays?: number;
1343
1955
  limit?: number;
1344
1956
  [key: string]: any;
1345
- }): Promise<AnalyticsErrorsGroupsResponse>;
1957
+ } & AnalyticsFreshParam, filters?: AnalyticsFilterParam[]): Promise<AnalyticsErrorsGroupsResponse>;
1958
+ /** The app's db3 query shapes that read the most rows (#5244). */
1959
+ getAnalyticsDb3Queries(appId: string, params?: {
1960
+ windowDays?: number;
1961
+ limit?: number;
1962
+ orderBy?: "rowsRead" | "rowsPerReturned";
1963
+ } & AnalyticsFreshParam): Promise<AnalyticsDb3QueriesResponse>;
1964
+ /** The app's request wall time and DynamoDB round trips per endpoint and function (#5244). */
1965
+ getAnalyticsRequests(appId: string, params?: {
1966
+ windowDays?: number;
1967
+ limit?: number;
1968
+ } & AnalyticsFreshParam): Promise<AnalyticsRequestsResponse>;
1346
1969
  getAnalyticsTopPrompts(appId: string, params?: {
1347
1970
  windowDays?: number;
1348
1971
  limit?: number;
1349
- }): Promise<TopPromptsResponse>;
1972
+ } & AnalyticsFreshParam): Promise<TopPromptsResponse>;
1350
1973
  /**
1351
1974
  * The signed-in admin's own profile, `role` included.
1352
1975
  *
@@ -1377,31 +2000,20 @@ export declare class ApiClient {
1377
2000
  role?: "admin" | "super-admin";
1378
2001
  }): Promise<any>;
1379
2002
  reindexAdmin(adminId: string): Promise<void>;
1380
- listAllAdminInvitations(): Promise<any[]>;
2003
+ /** `reindexAdmin` with the route's answer, for callers that print it. */
2004
+ reindexAdminWithResult(adminId: string): Promise<{
2005
+ success: boolean;
2006
+ adminId: string;
2007
+ reindexedAt: string;
2008
+ }>;
2009
+ /** One address's pending admin invitations; the route requires the address. */
2010
+ listAllAdminInvitations(email: string): Promise<any[]>;
1381
2011
  createGlobalAdminInvitation(data: {
1382
2012
  email: string;
1383
2013
  appCreationLimit?: number;
1384
2014
  expiresInDays?: number;
1385
2015
  }): Promise<any>;
1386
2016
  deleteGlobalAdminInvitation(invitationId: string): Promise<void>;
1387
- listPromptCatalog(params?: {
1388
- status?: string;
1389
- limit?: number;
1390
- cursor?: string;
1391
- }): Promise<any>;
1392
- getPromptCatalogItem(catalogId: string): Promise<any>;
1393
- createPromptCatalogItem(payload: any): Promise<any>;
1394
- updatePromptCatalogItem(catalogId: string, payload: any): Promise<any>;
1395
- deletePromptCatalogItem(catalogId: string): Promise<void>;
1396
- listIntegrationCatalog(params?: {
1397
- status?: string;
1398
- limit?: number;
1399
- cursor?: string;
1400
- }): Promise<any>;
1401
- getIntegrationCatalogItem(catalogId: string): Promise<any>;
1402
- createIntegrationCatalogItem(payload: any): Promise<any>;
1403
- updateIntegrationCatalogItem(catalogId: string, payload: any): Promise<any>;
1404
- deleteIntegrationCatalogItem(catalogId: string): Promise<void>;
1405
2017
  startBatchTests(appId: string, blockType: "prompt" | "integration", blockId: string, payload?: {
1406
2018
  comparisonGroup?: string;
1407
2019
  overrideConfigId?: string;
@@ -1468,6 +2080,15 @@ export declare class ApiClient {
1468
2080
  sentTo: string;
1469
2081
  error?: string;
1470
2082
  }>;
2083
+ /**
2084
+ * Render the saved template (or the built-in default) for an email type
2085
+ * without sending it. `variables` override the type's sample values. The
2086
+ * app id and the type are each encoded as one path segment, so no value of
2087
+ * either can select another route.
2088
+ */
2089
+ previewEmailTemplate(appId: string, emailType: string, payload?: {
2090
+ variables?: Record<string, string | number | boolean | null>;
2091
+ }): Promise<EmailTemplatePreview>;
1471
2092
  createToken(appId: string, data: {
1472
2093
  name: string;
1473
2094
  ttl?: string;
@@ -2152,11 +2773,12 @@ export declare class ApiClient {
2152
2773
  }>;
2153
2774
  /**
2154
2775
  * Apply an ordered multi-model create/patch/delete blob atomically (issue
2155
- * #1964 Phase 4, wrapping the #1517 `bulkUpdate` facade). All-or-nothing:
2156
- * a validation failure commits nothing. Returns the facade's
2157
- * `{ applied, added, updated, deleted }`.
2776
+ * #1964 Phase 4, wrapping the #1517 `bulkUpdate` facade): `POST
2777
+ * records/batch`, at most 100 operations. All-or-nothing: a validation
2778
+ * failure commits nothing. Returns the facade's `{ applied, added,
2779
+ * updated, deleted }`, and on a db3 `reads` when the batch carried reads.
2158
2780
  */
2159
- bulkDocumentRecords(appId: string, documentId: string, operations: Array<Record<string, unknown>>, extra?: {
2781
+ batchDocumentRecords(appId: string, documentId: string, operations: Array<Record<string, unknown>>, extra?: {
2160
2782
  documentFormat?: 1 | 3;
2161
2783
  }): Promise<{
2162
2784
  applied: number;
@@ -2175,6 +2797,7 @@ export declare class ApiClient {
2175
2797
  id: string;
2176
2798
  created: boolean;
2177
2799
  }>;
2800
+ reads?: Array<Record<string, any>>;
2178
2801
  }>;
2179
2802
  /** `/app/<app>/api/db3/<id>`, the id encoded: every `db3.*` route's prefix. */
2180
2803
  private db3Path;
@@ -2183,8 +2806,10 @@ export declare class ApiClient {
2183
2806
  indexes: Db3IndexRow[];
2184
2807
  }>;
2185
2808
  /**
2186
- * `POST db3/:id/indexes` with `{ model, field | fields, unique?, name? }` →
2187
- * `{ index }`. The route applies the registration rules.
2809
+ * `POST db3/:id/indexes` with `{ model, field | fields, unique?, name? }`,
2810
+ * `{ model, field, members: true }` for a member index, or `{ model, field
2811
+ * | fields, kind: "text", on, text? }` for a text index → `{ index }`. The
2812
+ * route applies the registration rules.
2188
2813
  */
2189
2814
  registerDb3Index(appId: string, db3Id: string, body: {
2190
2815
  model: string;
@@ -2192,6 +2817,12 @@ export declare class ApiClient {
2192
2817
  fields?: string[];
2193
2818
  unique?: boolean;
2194
2819
  name?: string;
2820
+ members?: boolean;
2821
+ kind?: Db3IndexKind;
2822
+ on?: Db3IndexPlacement;
2823
+ text?: Partial<Db3TextIndexOptions>;
2824
+ /** A `vector` index's options (#5225). */
2825
+ vector?: Db3VectorIndexOptions;
2195
2826
  }): Promise<{
2196
2827
  index: Db3IndexRow;
2197
2828
  }>;
@@ -2200,6 +2831,28 @@ export declare class ApiClient {
2200
2831
  ok: boolean;
2201
2832
  name: string;
2202
2833
  }>;
2834
+ /**
2835
+ * `GET db3/:id/indexes/:name/model` (#5229): a vector index's shared model,
2836
+ * its bytes as uploaded and the `X-Index-Model-*` headers it was uploaded
2837
+ * with.
2838
+ */
2839
+ fetchDb3IndexModel(appId: string, db3Id: string, name: string): Promise<{
2840
+ data: Buffer;
2841
+ generation: number;
2842
+ revision: number;
2843
+ rows: number;
2844
+ trainedAt: string;
2845
+ format: string;
2846
+ }>;
2847
+ /**
2848
+ * `DELETE db3/:id/indexes/:name/model` (#5229) → `{ ok, name, revision }`:
2849
+ * the model (or an upload under way) gone, `revision` the index's new one.
2850
+ */
2851
+ deleteDb3IndexModel(appId: string, db3Id: string, name: string): Promise<{
2852
+ ok: boolean;
2853
+ name: string;
2854
+ revision: number;
2855
+ }>;
2203
2856
  /** The db3 mount of {@link queryDocumentRecords}: `GET db3/:id/records/:model`. */
2204
2857
  queryDb3Records(appId: string, db3Id: string, modelName: string, queryOptions?: {
2205
2858
  filter?: Record<string, any>;
@@ -2218,6 +2871,12 @@ export declare class ApiClient {
2218
2871
  aggregateDb3Records(appId: string, db3Id: string, modelName: string, options: Parameters<ApiClient["aggregateDocumentRecords"]>[3]): Promise<{
2219
2872
  result: unknown;
2220
2873
  }>;
2874
+ /**
2875
+ * `POST db3/:id/records/:model/explain` (#5240): run a query, count or
2876
+ * aggregate on the server, forced onto `index` (or off indexes, `"none"`)
2877
+ * when given, and answer how it read.
2878
+ */
2879
+ explainDb3Read(appId: string, db3Id: string, modelName: string, body: Db3ExplainRequest): Promise<Db3ExplainAnswer>;
2221
2880
  /** The db3 mount of {@link saveDocumentRecord}: `POST db3/:id/records/:model`. */
2222
2881
  saveDb3Record(appId: string, db3Id: string, modelName: string, body: {
2223
2882
  id: string;
@@ -2237,8 +2896,19 @@ export declare class ApiClient {
2237
2896
  deleteDb3Record(appId: string, db3Id: string, modelName: string, recordId: string): Promise<{
2238
2897
  deleted: boolean;
2239
2898
  }>;
2240
- /** The db3 mount of {@link bulkDocumentRecords}: `POST db3/:id/records/bulk`. */
2241
- bulkDb3Records(appId: string, db3Id: string, operations: Array<Record<string, unknown>>): ReturnType<ApiClient["bulkDocumentRecords"]>;
2899
+ /** The db3 mount of {@link batchDocumentRecords}: `POST db3/:id/records/batch`. */
2900
+ batchDb3Records(appId: string, db3Id: string, operations: Array<Record<string, unknown>>): ReturnType<ApiClient["batchDocumentRecords"]>;
2901
+ /**
2902
+ * Several reads of a db3 in one request (#5243): `POST db3/:id/records/batch-read`,
2903
+ * each answered at its index from one state of the db3. `atomic: false`
2904
+ * answers a refused read in its place rather than refusing the request.
2905
+ */
2906
+ batchReadDb3Records(appId: string, db3Id: string, operations: Array<Record<string, unknown>>, options?: {
2907
+ atomic?: boolean;
2908
+ }): Promise<{
2909
+ results: Array<Record<string, any>>;
2910
+ cost?: Record<string, unknown>;
2911
+ }>;
2242
2912
  /** The db3 mount of {@link getDocumentSchema}: `GET db3/:id/schema`. */
2243
2913
  getDb3Schema(appId: string, db3Id: string): Promise<any>;
2244
2914
  /** `?limit=&cursor=` for a listing. */
@@ -2361,6 +3031,20 @@ export declare class ApiClient {
2361
3031
  nextCursor?: string;
2362
3032
  hasMore?: boolean;
2363
3033
  }>;
3034
+ /**
3035
+ * Every db3 a member reaches through the admin API (#5253): held, shared
3036
+ * with them, then app access, each row with its `via`; `via` narrows to
3037
+ * some of the three ways.
3038
+ */
3039
+ listDb3ForUser(appId: string, userId: string, params?: {
3040
+ via?: string[];
3041
+ limit?: number;
3042
+ cursor?: string;
3043
+ }): Promise<{
3044
+ items: any[];
3045
+ nextCursor?: string;
3046
+ hasMore?: boolean;
3047
+ }>;
2364
3048
  /** Transfer a db3 to `to` (`app` or `user:<userId>`) through the admin API (#4804). */
2365
3049
  transferDb3(appId: string, db3Id: string, to: string): Promise<any>;
2366
3050
  /** Remove or restore a db3's owner row through the admin API (#4804): `{ id, custodian, ownerRow, changed }`. */