primitive-admin 1.1.0-alpha.8 → 1.1.0-alpha.80

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 (522) hide show
  1. package/README.md +444 -106
  2. package/assets/skill/skills/primitive-platform/SKILL.md +811 -0
  3. package/dist/bin/primitive.d.ts +2 -0
  4. package/dist/bin/primitive.js +373 -21
  5. package/dist/bin/primitive.js.map +1 -1
  6. package/dist/src/commands/admins.d.ts +2 -0
  7. package/dist/src/commands/admins.js +128 -19
  8. package/dist/src/commands/admins.js.map +1 -1
  9. package/dist/src/commands/analytics.d.ts +2 -0
  10. package/dist/src/commands/analytics.js +700 -55
  11. package/dist/src/commands/analytics.js.map +1 -1
  12. package/dist/src/commands/apps.d.ts +2 -0
  13. package/dist/src/commands/apps.js +54 -96
  14. package/dist/src/commands/apps.js.map +1 -1
  15. package/dist/src/commands/auth.d.ts +2 -0
  16. package/dist/src/commands/auth.js +196 -105
  17. package/dist/src/commands/auth.js.map +1 -1
  18. package/dist/src/commands/blob-buckets.d.ts +2 -0
  19. package/dist/src/commands/blob-buckets.js +330 -0
  20. package/dist/src/commands/blob-buckets.js.map +1 -0
  21. package/dist/src/commands/catalog.d.ts +2 -0
  22. package/dist/src/commands/catalog.js +37 -38
  23. package/dist/src/commands/catalog.js.map +1 -1
  24. package/dist/src/commands/collection-type-configs.d.ts +2 -0
  25. package/dist/src/commands/collection-type-configs.js +84 -0
  26. package/dist/src/commands/collection-type-configs.js.map +1 -0
  27. package/dist/src/commands/collections.d.ts +2 -0
  28. package/dist/src/commands/collections.js +565 -0
  29. package/dist/src/commands/collections.js.map +1 -0
  30. package/dist/src/commands/comparisons.d.ts +2 -0
  31. package/dist/src/commands/comparisons.js +6 -6
  32. package/dist/src/commands/comparisons.js.map +1 -1
  33. package/dist/src/commands/config.d.ts +46 -0
  34. package/dist/src/commands/config.js +465 -0
  35. package/dist/src/commands/config.js.map +1 -0
  36. package/dist/src/commands/connections.d.ts +2 -0
  37. package/dist/src/commands/connections.js +100 -0
  38. package/dist/src/commands/connections.js.map +1 -0
  39. package/dist/src/commands/cron-triggers.d.ts +2 -0
  40. package/dist/src/commands/cron-triggers.js +265 -0
  41. package/dist/src/commands/cron-triggers.js.map +1 -0
  42. package/dist/src/commands/database-type-configs.d.ts +2 -0
  43. package/dist/src/commands/database-type-configs.js +163 -0
  44. package/dist/src/commands/database-type-configs.js.map +1 -0
  45. package/dist/src/commands/database-types.d.ts +2 -0
  46. package/dist/src/commands/database-types.js +171 -0
  47. package/dist/src/commands/database-types.js.map +1 -0
  48. package/dist/src/commands/databases.d.ts +65 -0
  49. package/dist/src/commands/databases.js +1859 -238
  50. package/dist/src/commands/databases.js.map +1 -1
  51. package/dist/src/commands/documents.d.ts +2 -0
  52. package/dist/src/commands/documents.js +2062 -19
  53. package/dist/src/commands/documents.js.map +1 -1
  54. package/dist/src/commands/email-templates.d.ts +2 -0
  55. package/dist/src/commands/email-templates.js +174 -0
  56. package/dist/src/commands/email-templates.js.map +1 -0
  57. package/dist/src/commands/env.d.ts +23 -0
  58. package/dist/src/commands/env.js +385 -0
  59. package/dist/src/commands/env.js.map +1 -0
  60. package/dist/src/commands/feature-flags.d.ts +14 -0
  61. package/dist/src/commands/feature-flags.js +116 -0
  62. package/dist/src/commands/feature-flags.js.map +1 -0
  63. package/dist/src/commands/functions.d.ts +20 -0
  64. package/dist/src/commands/functions.js +672 -0
  65. package/dist/src/commands/functions.js.map +1 -0
  66. package/dist/src/commands/group-type-configs.d.ts +2 -0
  67. package/dist/src/commands/group-type-configs.js +86 -0
  68. package/dist/src/commands/group-type-configs.js.map +1 -0
  69. package/dist/src/commands/groups.d.ts +2 -0
  70. package/dist/src/commands/groups.js +39 -108
  71. package/dist/src/commands/groups.js.map +1 -1
  72. package/dist/src/commands/guides.d.ts +223 -0
  73. package/dist/src/commands/guides.js +617 -65
  74. package/dist/src/commands/guides.js.map +1 -1
  75. package/dist/src/commands/init.d.ts +37 -0
  76. package/dist/src/commands/init.js +1693 -208
  77. package/dist/src/commands/init.js.map +1 -1
  78. package/dist/src/commands/integrations.d.ts +2 -0
  79. package/dist/src/commands/integrations.js +402 -182
  80. package/dist/src/commands/integrations.js.map +1 -1
  81. package/dist/src/commands/llm.d.ts +2 -0
  82. package/dist/src/commands/llm.js +13 -8
  83. package/dist/src/commands/llm.js.map +1 -1
  84. package/dist/src/commands/locks.d.ts +8 -0
  85. package/dist/src/commands/locks.js +160 -0
  86. package/dist/src/commands/locks.js.map +1 -0
  87. package/dist/src/commands/metadata-category-configs.d.ts +12 -0
  88. package/dist/src/commands/metadata-category-configs.js +112 -0
  89. package/dist/src/commands/metadata-category-configs.js.map +1 -0
  90. package/dist/src/commands/metadata.d.ts +2 -0
  91. package/dist/src/commands/metadata.js +281 -0
  92. package/dist/src/commands/metadata.js.map +1 -0
  93. package/dist/src/commands/prompts.d.ts +2 -0
  94. package/dist/src/commands/prompts.js +275 -621
  95. package/dist/src/commands/prompts.js.map +1 -1
  96. package/dist/src/commands/rule-sets.d.ts +3 -0
  97. package/dist/src/commands/rule-sets.js +137 -147
  98. package/dist/src/commands/rule-sets.js.map +1 -1
  99. package/dist/src/commands/scripts.d.ts +30 -0
  100. package/dist/src/commands/scripts.js +679 -0
  101. package/dist/src/commands/scripts.js.map +1 -0
  102. package/dist/src/commands/secrets.d.ts +2 -0
  103. package/dist/src/commands/secrets.js +108 -0
  104. package/dist/src/commands/secrets.js.map +1 -0
  105. package/dist/src/commands/sessions.d.ts +2 -0
  106. package/dist/src/commands/sessions.js +75 -0
  107. package/dist/src/commands/sessions.js.map +1 -0
  108. package/dist/src/commands/settings.d.ts +18 -0
  109. package/dist/src/commands/settings.js +54 -0
  110. package/dist/src/commands/settings.js.map +1 -0
  111. package/dist/src/commands/skill.d.ts +2 -0
  112. package/dist/src/commands/skill.js +29 -0
  113. package/dist/src/commands/skill.js.map +1 -0
  114. package/dist/src/commands/sync-app-settings.d.ts +158 -0
  115. package/dist/src/commands/sync-app-settings.js +328 -0
  116. package/dist/src/commands/sync-app-settings.js.map +1 -0
  117. package/dist/src/commands/sync.d.ts +2514 -0
  118. package/dist/src/commands/sync.js +16106 -848
  119. package/dist/src/commands/sync.js.map +1 -1
  120. package/dist/src/commands/tokens.d.ts +2 -0
  121. package/dist/src/commands/tokens.js +130 -21
  122. package/dist/src/commands/tokens.js.map +1 -1
  123. package/dist/src/commands/users.d.ts +2 -0
  124. package/dist/src/commands/users.js +532 -23
  125. package/dist/src/commands/users.js.map +1 -1
  126. package/dist/src/commands/vars.d.ts +8 -0
  127. package/dist/src/commands/vars.js +96 -0
  128. package/dist/src/commands/vars.js.map +1 -0
  129. package/dist/src/commands/waitlist.d.ts +2 -0
  130. package/dist/src/commands/waitlist.js +10 -10
  131. package/dist/src/commands/waitlist.js.map +1 -1
  132. package/dist/src/commands/webhooks.d.ts +2 -0
  133. package/dist/src/commands/webhooks.js +562 -0
  134. package/dist/src/commands/webhooks.js.map +1 -0
  135. package/dist/src/commands/workflows.d.ts +116 -0
  136. package/dist/src/commands/workflows.js +1638 -729
  137. package/dist/src/commands/workflows.js.map +1 -1
  138. package/dist/src/lib/access-rule-display.d.ts +21 -0
  139. package/dist/src/lib/access-rule-display.js +34 -0
  140. package/dist/src/lib/access-rule-display.js.map +1 -0
  141. package/dist/src/lib/api-client.d.ts +2147 -0
  142. package/dist/src/lib/api-client.js +2042 -160
  143. package/dist/src/lib/api-client.js.map +1 -1
  144. package/dist/src/lib/app-match-guard.d.ts +44 -0
  145. package/dist/src/lib/app-match-guard.js +72 -0
  146. package/dist/src/lib/app-match-guard.js.map +1 -0
  147. package/dist/src/lib/app-settings-descriptor.d.ts +263 -0
  148. package/dist/src/lib/app-settings-descriptor.js +584 -0
  149. package/dist/src/lib/app-settings-descriptor.js.map +1 -0
  150. package/dist/src/lib/auth-flow.d.ts +8 -0
  151. package/dist/src/lib/batch.d.ts +26 -0
  152. package/dist/src/lib/batch.js +32 -0
  153. package/dist/src/lib/batch.js.map +1 -0
  154. package/dist/src/lib/block-layout.d.ts +160 -0
  155. package/dist/src/lib/block-layout.js +451 -0
  156. package/dist/src/lib/block-layout.js.map +1 -0
  157. package/dist/src/lib/block-selector.d.ts +58 -0
  158. package/dist/src/lib/block-selector.js +92 -0
  159. package/dist/src/lib/block-selector.js.map +1 -0
  160. package/dist/src/lib/canonical-json.d.ts +12 -0
  161. package/dist/src/lib/canonical-json.js +35 -0
  162. package/dist/src/lib/canonical-json.js.map +1 -0
  163. package/dist/src/lib/channel.d.ts +30 -0
  164. package/dist/src/lib/channel.js +68 -0
  165. package/dist/src/lib/channel.js.map +1 -0
  166. package/dist/src/lib/cli-manifest.d.ts +68 -0
  167. package/dist/src/lib/cli-manifest.js +71 -0
  168. package/dist/src/lib/cli-manifest.js.map +1 -0
  169. package/dist/src/lib/codegen-shared/generatedFiles.d.ts +101 -0
  170. package/dist/src/lib/codegen-shared/generatedFiles.js +191 -0
  171. package/dist/src/lib/codegen-shared/generatedFiles.js.map +1 -0
  172. package/dist/src/lib/codegen-shared/prettierStable.d.ts +262 -0
  173. package/dist/src/lib/codegen-shared/prettierStable.js +610 -0
  174. package/dist/src/lib/codegen-shared/prettierStable.js.map +1 -0
  175. package/dist/src/lib/codegen-shared/resolveCodegenSourceDir.d.ts +38 -0
  176. package/dist/src/lib/codegen-shared/resolveCodegenSourceDir.js +46 -0
  177. package/dist/src/lib/codegen-shared/resolveCodegenSourceDir.js.map +1 -0
  178. package/dist/src/lib/config-json-field.d.ts +28 -0
  179. package/dist/src/lib/config-json-field.js +56 -0
  180. package/dist/src/lib/config-json-field.js.map +1 -0
  181. package/dist/src/lib/config-object-descriptor.d.ts +127 -0
  182. package/dist/src/lib/config-object-descriptor.js +696 -0
  183. package/dist/src/lib/config-object-descriptor.js.map +1 -0
  184. package/dist/src/lib/config-payload.d.ts +85 -0
  185. package/dist/src/lib/config-payload.js +116 -0
  186. package/dist/src/lib/config-payload.js.map +1 -0
  187. package/dist/src/lib/config-surface.d.ts +140 -0
  188. package/dist/src/lib/config-surface.js +317 -0
  189. package/dist/src/lib/config-surface.js.map +1 -0
  190. package/dist/src/lib/config-toml.d.ts +10 -0
  191. package/dist/src/lib/config-toml.js +42 -0
  192. package/dist/src/lib/config-toml.js.map +1 -0
  193. package/dist/src/lib/config.d.ts +71 -0
  194. package/dist/src/lib/config.js +71 -68
  195. package/dist/src/lib/config.js.map +1 -1
  196. package/dist/src/lib/confirm-prompt.d.ts +83 -0
  197. package/dist/src/lib/confirm-prompt.js +110 -0
  198. package/dist/src/lib/confirm-prompt.js.map +1 -0
  199. package/dist/src/lib/constants.d.ts +11 -0
  200. package/dist/src/lib/constants.js +12 -0
  201. package/dist/src/lib/constants.js.map +1 -0
  202. package/dist/src/lib/crash-handlers.d.ts +20 -0
  203. package/dist/src/lib/crash-handlers.js +49 -0
  204. package/dist/src/lib/crash-handlers.js.map +1 -0
  205. package/dist/src/lib/credentials-store.d.ts +104 -0
  206. package/dist/src/lib/credentials-store.js +336 -0
  207. package/dist/src/lib/credentials-store.js.map +1 -0
  208. package/dist/src/lib/csv.d.ts +47 -0
  209. package/dist/src/lib/csv.js +172 -0
  210. package/dist/src/lib/csv.js.map +1 -0
  211. package/dist/src/lib/data-input.d.ts +23 -0
  212. package/dist/src/lib/data-input.js +50 -0
  213. package/dist/src/lib/data-input.js.map +1 -0
  214. package/dist/src/lib/db-codegen/dbFingerprint.d.ts +10 -0
  215. package/dist/src/lib/db-codegen/dbFingerprint.js +17 -0
  216. package/dist/src/lib/db-codegen/dbFingerprint.js.map +1 -0
  217. package/dist/src/lib/db-codegen/dbGenerator.d.ts +67 -0
  218. package/dist/src/lib/db-codegen/dbGenerator.js +170 -0
  219. package/dist/src/lib/db-codegen/dbGenerator.js.map +1 -0
  220. package/dist/src/lib/db-codegen/dbNaming.d.ts +87 -0
  221. package/dist/src/lib/db-codegen/dbNaming.js +180 -0
  222. package/dist/src/lib/db-codegen/dbNaming.js.map +1 -0
  223. package/dist/src/lib/db-codegen/dbTemplates.d.ts +272 -0
  224. package/dist/src/lib/db-codegen/dbTemplates.js +480 -0
  225. package/dist/src/lib/db-codegen/dbTemplates.js.map +1 -0
  226. package/dist/src/lib/db-codegen/dbTsTypes.d.ts +73 -0
  227. package/dist/src/lib/db-codegen/dbTsTypes.js +139 -0
  228. package/dist/src/lib/db-codegen/dbTsTypes.js.map +1 -0
  229. package/dist/src/lib/db-codegen/dbTypeIR.d.ts +146 -0
  230. package/dist/src/lib/db-codegen/dbTypeIR.js +517 -0
  231. package/dist/src/lib/db-codegen/dbTypeIR.js.map +1 -0
  232. package/dist/src/lib/db-codegen/generated-operation-def-descriptor.d.ts +112 -0
  233. package/dist/src/lib/db-codegen/generated-operation-def-descriptor.js +211 -0
  234. package/dist/src/lib/db-codegen/generated-operation-def-descriptor.js.map +1 -0
  235. package/dist/src/lib/document-export-permissions.d.ts +30 -0
  236. package/dist/src/lib/document-export-permissions.js +54 -0
  237. package/dist/src/lib/document-export-permissions.js.map +1 -0
  238. package/dist/src/lib/env-resolver-core.d.ts +253 -0
  239. package/dist/src/lib/env-resolver-core.js +459 -0
  240. package/dist/src/lib/env-resolver-core.js.map +1 -0
  241. package/dist/src/lib/env-resolver.d.ts +99 -0
  242. package/dist/src/lib/env-resolver.js +153 -0
  243. package/dist/src/lib/env-resolver.js.map +1 -0
  244. package/dist/src/lib/fetch.d.ts +5 -0
  245. package/dist/src/lib/function-bundle.d.ts +141 -0
  246. package/dist/src/lib/function-bundle.js +333 -0
  247. package/dist/src/lib/function-bundle.js.map +1 -0
  248. package/dist/src/lib/function-collect.d.ts +123 -0
  249. package/dist/src/lib/function-collect.js +594 -0
  250. package/dist/src/lib/function-collect.js.map +1 -0
  251. package/dist/src/lib/function-db-types.d.ts +187 -0
  252. package/dist/src/lib/function-db-types.js +782 -0
  253. package/dist/src/lib/function-db-types.js.map +1 -0
  254. package/dist/src/lib/function-document-types.d.ts +50 -0
  255. package/dist/src/lib/function-document-types.js +163 -0
  256. package/dist/src/lib/function-document-types.js.map +1 -0
  257. package/dist/src/lib/function-grants-preflight.d.ts +64 -0
  258. package/dist/src/lib/function-grants-preflight.js +100 -0
  259. package/dist/src/lib/function-grants-preflight.js.map +1 -0
  260. package/dist/src/lib/function-log-tail.d.ts +83 -0
  261. package/dist/src/lib/function-log-tail.js +115 -0
  262. package/dist/src/lib/function-log-tail.js.map +1 -0
  263. package/dist/src/lib/function-schema-codegen.d.ts +118 -0
  264. package/dist/src/lib/function-schema-codegen.js +402 -0
  265. package/dist/src/lib/function-schema-codegen.js.map +1 -0
  266. package/dist/src/lib/function-sync.d.ts +263 -0
  267. package/dist/src/lib/function-sync.js +604 -0
  268. package/dist/src/lib/function-sync.js.map +1 -0
  269. package/dist/src/lib/function-triggers.d.ts +66 -0
  270. package/dist/src/lib/function-triggers.js +285 -0
  271. package/dist/src/lib/function-triggers.js.map +1 -0
  272. package/dist/src/lib/function-typecheck.d.ts +86 -0
  273. package/dist/src/lib/function-typecheck.js +370 -0
  274. package/dist/src/lib/function-typecheck.js.map +1 -0
  275. package/dist/src/lib/generated-allowlist.d.ts +28 -0
  276. package/dist/src/lib/generated-allowlist.js +281 -0
  277. package/dist/src/lib/generated-allowlist.js.map +1 -0
  278. package/dist/src/lib/generated-config-surfaces.d.ts +1445 -0
  279. package/dist/src/lib/generated-config-surfaces.js +5836 -0
  280. package/dist/src/lib/generated-config-surfaces.js.map +1 -0
  281. package/dist/src/lib/generated-sdk-types.d.ts +12 -0
  282. package/dist/src/lib/generated-sdk-types.js +13 -0
  283. package/dist/src/lib/generated-sdk-types.js.map +1 -0
  284. package/dist/src/lib/generated-template-lint.d.ts +212 -0
  285. package/dist/src/lib/generated-template-lint.js +624 -0
  286. package/dist/src/lib/generated-template-lint.js.map +1 -0
  287. package/dist/src/lib/generated-workflow-model-fields.d.ts +20 -0
  288. package/dist/src/lib/generated-workflow-model-fields.js +53 -0
  289. package/dist/src/lib/generated-workflow-model-fields.js.map +1 -0
  290. package/dist/src/lib/google-client-secret-status.d.ts +35 -0
  291. package/dist/src/lib/google-client-secret-status.js +56 -0
  292. package/dist/src/lib/google-client-secret-status.js.map +1 -0
  293. package/dist/src/lib/init-adopt.d.ts +16 -0
  294. package/dist/src/lib/init-adopt.js +34 -0
  295. package/dist/src/lib/init-adopt.js.map +1 -0
  296. package/dist/src/lib/init-assets.d.ts +39 -0
  297. package/dist/src/lib/init-assets.js +97 -0
  298. package/dist/src/lib/init-assets.js.map +1 -0
  299. package/dist/src/lib/init-client-platforms.d.ts +14 -0
  300. package/dist/src/lib/init-client-platforms.js +71 -0
  301. package/dist/src/lib/init-client-platforms.js.map +1 -0
  302. package/dist/src/lib/init-config.d.ts +98 -0
  303. package/dist/src/lib/init-config.js +186 -0
  304. package/dist/src/lib/init-config.js.map +1 -0
  305. package/dist/src/lib/init-email-redirect-uris.d.ts +37 -0
  306. package/dist/src/lib/init-email-redirect-uris.js +46 -0
  307. package/dist/src/lib/init-email-redirect-uris.js.map +1 -0
  308. package/dist/src/lib/init-ios-links.d.ts +91 -0
  309. package/dist/src/lib/init-ios-links.js +219 -0
  310. package/dist/src/lib/init-ios-links.js.map +1 -0
  311. package/dist/src/lib/init-plan.d.ts +80 -0
  312. package/dist/src/lib/init-plan.js +95 -0
  313. package/dist/src/lib/init-plan.js.map +1 -0
  314. package/dist/src/lib/init-production-env.d.ts +48 -0
  315. package/dist/src/lib/init-production-env.js +59 -0
  316. package/dist/src/lib/init-production-env.js.map +1 -0
  317. package/dist/src/lib/init-schema.d.ts +74 -0
  318. package/dist/src/lib/init-schema.js +358 -0
  319. package/dist/src/lib/init-schema.js.map +1 -0
  320. package/dist/src/lib/init-xcode.d.ts +34 -0
  321. package/dist/src/lib/init-xcode.js +138 -0
  322. package/dist/src/lib/init-xcode.js.map +1 -0
  323. package/dist/src/lib/integration-request-config.d.ts +30 -0
  324. package/dist/src/lib/integration-request-config.js +145 -0
  325. package/dist/src/lib/integration-request-config.js.map +1 -0
  326. package/dist/src/lib/integration-selector.d.ts +42 -0
  327. package/dist/src/lib/integration-selector.js +46 -0
  328. package/dist/src/lib/integration-selector.js.map +1 -0
  329. package/dist/src/lib/ios-app-id.d.ts +34 -0
  330. package/dist/src/lib/ios-app-id.js +69 -0
  331. package/dist/src/lib/ios-app-id.js.map +1 -0
  332. package/dist/src/lib/local-state.d.ts +55 -0
  333. package/dist/src/lib/local-state.js +167 -0
  334. package/dist/src/lib/local-state.js.map +1 -0
  335. package/dist/src/lib/local-test-cases.d.ts +63 -0
  336. package/dist/src/lib/local-test-cases.js +136 -0
  337. package/dist/src/lib/local-test-cases.js.map +1 -0
  338. package/dist/src/lib/log-inspection.d.ts +680 -0
  339. package/dist/src/lib/log-inspection.js +784 -0
  340. package/dist/src/lib/log-inspection.js.map +1 -0
  341. package/dist/src/lib/migration-nag.d.ts +49 -0
  342. package/dist/src/lib/migration-nag.js +164 -0
  343. package/dist/src/lib/migration-nag.js.map +1 -0
  344. package/dist/src/lib/object-status-filter.d.ts +22 -0
  345. package/dist/src/lib/object-status-filter.js +45 -0
  346. package/dist/src/lib/object-status-filter.js.map +1 -0
  347. package/dist/src/lib/output.d.ts +109 -0
  348. package/dist/src/lib/output.js +191 -8
  349. package/dist/src/lib/output.js.map +1 -1
  350. package/dist/src/lib/package-manager.d.ts +140 -0
  351. package/dist/src/lib/package-manager.js +305 -0
  352. package/dist/src/lib/package-manager.js.map +1 -0
  353. package/dist/src/lib/paginate.d.ts +83 -0
  354. package/dist/src/lib/paginate.js +95 -0
  355. package/dist/src/lib/paginate.js.map +1 -0
  356. package/dist/src/lib/platform-owned.d.ts +63 -0
  357. package/dist/src/lib/platform-owned.js +85 -0
  358. package/dist/src/lib/platform-owned.js.map +1 -0
  359. package/dist/src/lib/project-config.d.ts +122 -0
  360. package/dist/src/lib/project-config.js +244 -0
  361. package/dist/src/lib/project-config.js.map +1 -0
  362. package/dist/src/lib/query-operators.d.ts +43 -0
  363. package/dist/src/lib/query-operators.js +80 -0
  364. package/dist/src/lib/query-operators.js.map +1 -0
  365. package/dist/src/lib/record-filter.d.ts +18 -0
  366. package/dist/src/lib/record-filter.js +55 -0
  367. package/dist/src/lib/record-filter.js.map +1 -0
  368. package/dist/src/lib/refresh-admin-credentials.d.ts +65 -0
  369. package/dist/src/lib/refresh-admin-credentials.js +103 -0
  370. package/dist/src/lib/refresh-admin-credentials.js.map +1 -0
  371. package/dist/src/lib/resolve-init-dev-port.d.ts +56 -0
  372. package/dist/src/lib/resolve-init-dev-port.js +55 -0
  373. package/dist/src/lib/resolve-init-dev-port.js.map +1 -0
  374. package/dist/src/lib/resolve-init-server.d.ts +64 -0
  375. package/dist/src/lib/resolve-init-server.js +77 -0
  376. package/dist/src/lib/resolve-init-server.js.map +1 -0
  377. package/dist/src/lib/resolve-platform.d.ts +74 -0
  378. package/dist/src/lib/resolve-platform.js +105 -0
  379. package/dist/src/lib/resolve-platform.js.map +1 -0
  380. package/dist/src/lib/run-status.d.ts +19 -0
  381. package/dist/src/lib/run-status.generated.d.ts +39 -0
  382. package/dist/src/lib/run-status.generated.js +66 -0
  383. package/dist/src/lib/run-status.generated.js.map +1 -0
  384. package/dist/src/lib/run-status.js +19 -0
  385. package/dist/src/lib/run-status.js.map +1 -0
  386. package/dist/src/lib/server-text-normalization.d.ts +51 -0
  387. package/dist/src/lib/server-text-normalization.js +90 -0
  388. package/dist/src/lib/server-text-normalization.js.map +1 -0
  389. package/dist/src/lib/server-url.d.ts +22 -0
  390. package/dist/src/lib/server-url.js +33 -0
  391. package/dist/src/lib/server-url.js.map +1 -0
  392. package/dist/src/lib/signing-secret-status.d.ts +81 -0
  393. package/dist/src/lib/signing-secret-status.js +116 -0
  394. package/dist/src/lib/signing-secret-status.js.map +1 -0
  395. package/dist/src/lib/skill-installer.d.ts +25 -0
  396. package/dist/src/lib/skill-installer.js +266 -0
  397. package/dist/src/lib/skill-installer.js.map +1 -0
  398. package/dist/src/lib/snapshots.d.ts +98 -0
  399. package/dist/src/lib/snapshots.js +294 -0
  400. package/dist/src/lib/snapshots.js.map +1 -0
  401. package/dist/src/lib/swift-codegen/dbGenerator.d.ts +113 -0
  402. package/dist/src/lib/swift-codegen/dbGenerator.js +914 -0
  403. package/dist/src/lib/swift-codegen/dbGenerator.js.map +1 -0
  404. package/dist/src/lib/swift-codegen/dbSwiftTypes.d.ts +42 -0
  405. package/dist/src/lib/swift-codegen/dbSwiftTypes.js +100 -0
  406. package/dist/src/lib/swift-codegen/dbSwiftTypes.js.map +1 -0
  407. package/dist/src/lib/swift-codegen/generator.d.ts +94 -0
  408. package/dist/src/lib/swift-codegen/generator.js +440 -0
  409. package/dist/src/lib/swift-codegen/generator.js.map +1 -0
  410. package/dist/src/lib/swift-codegen/schemaToSwift.d.ts +72 -0
  411. package/dist/src/lib/swift-codegen/schemaToSwift.js +644 -0
  412. package/dist/src/lib/swift-codegen/schemaToSwift.js.map +1 -0
  413. package/dist/src/lib/swift-codegen/siblingSymbols.d.ts +94 -0
  414. package/dist/src/lib/swift-codegen/siblingSymbols.js +155 -0
  415. package/dist/src/lib/swift-codegen/siblingSymbols.js.map +1 -0
  416. package/dist/src/lib/swift-codegen/swiftNaming.d.ts +85 -0
  417. package/dist/src/lib/swift-codegen/swiftNaming.js +198 -0
  418. package/dist/src/lib/swift-codegen/swiftNaming.js.map +1 -0
  419. package/dist/src/lib/sync-dir-selector.d.ts +21 -0
  420. package/dist/src/lib/sync-dir-selector.js +30 -0
  421. package/dist/src/lib/sync-dir-selector.js.map +1 -0
  422. package/dist/src/lib/sync-paths.d.ts +123 -0
  423. package/dist/src/lib/sync-paths.js +193 -0
  424. package/dist/src/lib/sync-paths.js.map +1 -0
  425. package/dist/src/lib/sync-resource-types.d.ts +563 -0
  426. package/dist/src/lib/sync-resource-types.js +1073 -0
  427. package/dist/src/lib/sync-resource-types.js.map +1 -0
  428. package/dist/src/lib/sync-selectors.d.ts +95 -0
  429. package/dist/src/lib/sync-selectors.js +228 -0
  430. package/dist/src/lib/sync-selectors.js.map +1 -0
  431. package/dist/src/lib/template.d.ts +170 -0
  432. package/dist/src/lib/template.js +484 -68
  433. package/dist/src/lib/template.js.map +1 -1
  434. package/dist/src/lib/test-case-file-names.d.ts +40 -0
  435. package/dist/src/lib/test-case-file-names.js +91 -0
  436. package/dist/src/lib/test-case-file-names.js.map +1 -0
  437. package/dist/src/lib/test-case-keys.d.ts +29 -0
  438. package/dist/src/lib/test-case-keys.js +55 -0
  439. package/dist/src/lib/test-case-keys.js.map +1 -0
  440. package/dist/src/lib/test-case-variables.d.ts +29 -0
  441. package/dist/src/lib/test-case-variables.js +71 -0
  442. package/dist/src/lib/test-case-variables.js.map +1 -0
  443. package/dist/src/lib/token-inject.d.ts +56 -0
  444. package/dist/src/lib/token-inject.js +204 -0
  445. package/dist/src/lib/token-inject.js.map +1 -0
  446. package/dist/src/lib/toml-database-config.d.ts +123 -0
  447. package/dist/src/lib/toml-database-config.js +544 -0
  448. package/dist/src/lib/toml-database-config.js.map +1 -0
  449. package/dist/src/lib/toml-metadata-config.d.ts +151 -0
  450. package/dist/src/lib/toml-metadata-config.js +476 -0
  451. package/dist/src/lib/toml-metadata-config.js.map +1 -0
  452. package/dist/src/lib/toml-native-form.d.ts +46 -0
  453. package/dist/src/lib/toml-native-form.js +78 -0
  454. package/dist/src/lib/toml-native-form.js.map +1 -0
  455. package/dist/src/lib/toml-params-validator.d.ts +129 -0
  456. package/dist/src/lib/toml-params-validator.js +298 -0
  457. package/dist/src/lib/toml-params-validator.js.map +1 -0
  458. package/dist/src/lib/toml-scalar-edit.d.ts +43 -0
  459. package/dist/src/lib/toml-scalar-edit.js +283 -0
  460. package/dist/src/lib/toml-scalar-edit.js.map +1 -0
  461. package/dist/src/lib/user-selector.d.ts +24 -0
  462. package/dist/src/lib/user-selector.js +33 -0
  463. package/dist/src/lib/user-selector.js.map +1 -0
  464. package/dist/src/lib/version-check.d.ts +35 -0
  465. package/dist/src/lib/version-check.js +241 -0
  466. package/dist/src/lib/version-check.js.map +1 -0
  467. package/dist/src/lib/watch.d.ts +121 -0
  468. package/dist/src/lib/watch.js +169 -0
  469. package/dist/src/lib/watch.js.map +1 -0
  470. package/dist/src/lib/web-url.d.ts +40 -0
  471. package/dist/src/lib/web-url.js +76 -0
  472. package/dist/src/lib/web-url.js.map +1 -0
  473. package/dist/src/lib/workflow-apply.d.ts +110 -0
  474. package/dist/src/lib/workflow-apply.js +164 -0
  475. package/dist/src/lib/workflow-apply.js.map +1 -0
  476. package/dist/src/lib/workflow-codegen/generated-schema-descriptor.d.ts +129 -0
  477. package/dist/src/lib/workflow-codegen/generated-schema-descriptor.js +269 -0
  478. package/dist/src/lib/workflow-codegen/generated-schema-descriptor.js.map +1 -0
  479. package/dist/src/lib/workflow-codegen/generator.d.ts +96 -0
  480. package/dist/src/lib/workflow-codegen/generator.js +361 -0
  481. package/dist/src/lib/workflow-codegen/generator.js.map +1 -0
  482. package/dist/src/lib/workflow-codegen/invokerIR.d.ts +94 -0
  483. package/dist/src/lib/workflow-codegen/invokerIR.js +76 -0
  484. package/dist/src/lib/workflow-codegen/invokerIR.js.map +1 -0
  485. package/dist/src/lib/workflow-codegen/naming.d.ts +33 -0
  486. package/dist/src/lib/workflow-codegen/naming.js +81 -0
  487. package/dist/src/lib/workflow-codegen/naming.js.map +1 -0
  488. package/dist/src/lib/workflow-codegen/schemaToTs.d.ts +80 -0
  489. package/dist/src/lib/workflow-codegen/schemaToTs.js +303 -0
  490. package/dist/src/lib/workflow-codegen/schemaToTs.js.map +1 -0
  491. package/dist/src/lib/workflow-config-apply.d.ts +70 -0
  492. package/dist/src/lib/workflow-config-apply.js +137 -0
  493. package/dist/src/lib/workflow-config-apply.js.map +1 -0
  494. package/dist/src/lib/workflow-config-sidecar.d.ts +63 -0
  495. package/dist/src/lib/workflow-config-sidecar.js +96 -0
  496. package/dist/src/lib/workflow-config-sidecar.js.map +1 -0
  497. package/dist/src/lib/workflow-defaults.d.ts +29 -0
  498. package/dist/src/lib/workflow-defaults.js +41 -0
  499. package/dist/src/lib/workflow-defaults.js.map +1 -0
  500. package/dist/src/lib/workflow-field-descriptor.d.ts +91 -0
  501. package/dist/src/lib/workflow-field-descriptor.js +153 -0
  502. package/dist/src/lib/workflow-field-descriptor.js.map +1 -0
  503. package/dist/src/lib/workflow-fragments.d.ts +64 -0
  504. package/dist/src/lib/workflow-fragments.js +342 -0
  505. package/dist/src/lib/workflow-fragments.js.map +1 -0
  506. package/dist/src/lib/workflow-include-preserve.d.ts +76 -0
  507. package/dist/src/lib/workflow-include-preserve.js +286 -0
  508. package/dist/src/lib/workflow-include-preserve.js.map +1 -0
  509. package/dist/src/lib/workflow-payload.d.ts +98 -0
  510. package/dist/src/lib/workflow-payload.js +178 -0
  511. package/dist/src/lib/workflow-payload.js.map +1 -0
  512. package/dist/src/lib/workflow-toml-validator.d.ts +207 -0
  513. package/dist/src/lib/workflow-toml-validator.js +762 -0
  514. package/dist/src/lib/workflow-toml-validator.js.map +1 -0
  515. package/dist/src/lib/workflow-usage.d.ts +198 -0
  516. package/dist/src/lib/workflow-usage.js +312 -0
  517. package/dist/src/lib/workflow-usage.js.map +1 -0
  518. package/dist/src/types/index.d.ts +591 -0
  519. package/dist/src/validators.d.ts +65 -0
  520. package/dist/src/validators.js +64 -0
  521. package/dist/src/validators.js.map +1 -0
  522. package/package.json +34 -9
@@ -0,0 +1,584 @@
1
+ /**
2
+ * Shared field descriptor for app-settings TOML sync (issue #1033).
3
+ *
4
+ * A single source of truth describing every app setting that round-trips
5
+ * through `app.toml`. It drives BOTH directions:
6
+ * - pull (`serializeAppSettingsToToml`): server settings -> `app.toml` object
7
+ * - push (`parseTomlToAppSettings`): `app.toml` object -> settings payload
8
+ *
9
+ * Driving serializer and parser from one table means the two can never drift
10
+ * apart, and a single drift test can assert the descriptor stays in step with
11
+ * the server's `GET /settings` response and `PUT /settings` allow-list. This
12
+ * generalizes the earlier hand-maintained `AUTH_BOOLEAN_KEYS` /
13
+ * `RECOGNIZED_AUTH_KEYS` pattern to every section, and fully replaces it.
14
+ *
15
+ * Design decisions of record (issue #1033):
16
+ * - Google is a typed client MAP (#2891): `googleClients` renders as
17
+ * `[auth.google.clients.<type>]`, and each entry's `clientSecret` holds a
18
+ * whole `{{secrets.KEY}}` reference rather than the secret itself, so the
19
+ * map round-trips through `app.toml` like any other setting.
20
+ * - `[cors]` is always emitted (the `mode` key is `emit: "always"`), even in
21
+ * universal mode. A one-time diff on the next pull for existing apps is
22
+ * acceptable.
23
+ * - `[invitations]` is an additive table for the member-invitation fields.
24
+ * - Nothing is writable-but-excluded any more (#2891). The legacy passkey
25
+ * pair and the three Google/redirect scalars are RETIRED: not writable, not
26
+ * synced, and refused by name with their own guidance when an old
27
+ * `app.toml` still carries them.
28
+ * - Push type mismatches are field-named validation errors — no silent
29
+ * coercion of a mistyped TOML value.
30
+ * - THE FILE IS THE WHOLE TRUTH (#2880, sponsor 2026-08-21). `app.toml` used
31
+ * to be the one surface where an omitted key preserved the server's value,
32
+ * while every other type follows "the local file is the source of truth"
33
+ * (#1567). That exception is gone: push emits a value for EVERY writable
34
+ * field, and a key the file does not carry clears the field or resets it to
35
+ * its declared default (`APP_SETTINGS_ABSENT_VALUES`). `[app].name` and
36
+ * `[app].mode` are the two exceptions — no default, identity-critical, and
37
+ * `mode: null` is a 400 — so their absence is a validation error instead.
38
+ */
39
+ import { findUnknownDocumentKeys, requireConfigSurface, } from "./config-surface.js";
40
+ import { retiredConfigKey } from "./generated-config-surfaces.js";
41
+ import { canonicalizeSecretReference } from "./server-text-normalization.js";
42
+ /**
43
+ * The vendored `app-settings` definition (#2644) this module projects. Read
44
+ * once at load; a missing definition fails loudly rather than yielding an
45
+ * empty descriptor that would silently sync nothing.
46
+ */
47
+ const APP_SETTINGS_SURFACE = requireConfigSurface("app-settings");
48
+ /**
49
+ * Every field that round-trips through `app.toml` — DERIVED from the
50
+ * `app-settings` configuration-object definition (#2644), not listed.
51
+ *
52
+ * The definition already states each field's section (its table's TOML path),
53
+ * its `app.toml` key, its type and its `emit` rule, and the coverage guard
54
+ * holds it against the `App` model. Restating those 26 entries here made
55
+ * adding a setting two edits that a parity test then compared — the "two lists
56
+ * and a test they agree" shape the design gate rejected (2026-08-12). One edit
57
+ * in the definition now reaches the server allow-list
58
+ * (`settings-fields.ts`), this descriptor, and both directions of the sync.
59
+ *
60
+ * `json` in the definition is this module's `object` — the same shape under the
61
+ * name each side has always used for it.
62
+ */
63
+ export const APP_SETTINGS_DESCRIPTOR = APP_SETTINGS_SURFACE.tables.flatMap((table) => table.fields.map((field) => ({
64
+ field: field.field,
65
+ section: table.tomlPath[0],
66
+ key: field.tomlKey,
67
+ type: (field.type === "json" ? "object" : field.type),
68
+ emit: field.emit,
69
+ })));
70
+ /**
71
+ * Section render order for a stable, diff-friendly `app.toml` — the
72
+ * definition's table order (#2644), so a new section is rendered by being
73
+ * declared there.
74
+ */
75
+ export const APP_SETTINGS_SECTIONS = APP_SETTINGS_SURFACE.tables.map((table) => table.tomlPath[0]);
76
+ /**
77
+ * `GET /settings` keys that are computed/read-only and never sync (no server
78
+ * setter). The external coverage drift test classifies these here.
79
+ */
80
+ export const IGNORED_GET_KEYS = new Set([
81
+ "appId",
82
+ // `hasGoogleAuth`, `googleClientSecretSet` and `googleClientSecretStatus` are
83
+ // GONE (#2891), not ignored: the first could not describe a per-platform
84
+ // configuration, and the other two existed only to report a value the server
85
+ // refused to send back. The map states availability per entry and the stored
86
+ // reference is echoed, so a response still carrying any of them is a server
87
+ // this CLI does not understand — worth failing the drift guard over.
88
+ //
89
+ // `hasAppleAuth` / `hasPasskey` stay: the asymmetry is deliberate, since
90
+ // Apple and passkeys have no map to derive per-platform truth from.
91
+ "hasAppleAuth",
92
+ "hasPasskey",
93
+ // #2884 — compatibility fields DERIVED from the one email sign-in flow; the
94
+ // tenant PUT and app.toml retired them, GET still emits both for older
95
+ // clients. Computed, never synced.
96
+ "magicLinkEnabled",
97
+ "otpEnabled",
98
+ "createdAt",
99
+ "modifiedAt",
100
+ ]);
101
+ /**
102
+ * Fields that ARE still writable server-side (present in the `PUT /settings`
103
+ * allow-list) but are deliberately excluded from TOML because a newer field
104
+ * supersedes them. Kept distinct from `IGNORED_GET_KEYS` so the coverage test's
105
+ * "every allow-listed field is covered" claim stays true — these are excluded,
106
+ * not read-only. (Codex design-review concern #1.)
107
+ */
108
+ export const DEPRECATED_WRITABLE_EXCLUDED = new Set(
109
+ // Derived (#2644): `deprecated` is exactly "still writable, superseded by
110
+ // another field", which is what this set has always meant.
111
+ APP_SETTINGS_SURFACE.tables.flatMap((table) => Object.entries(table.notExposed)
112
+ .filter(([, classification]) => classification.kind === "deprecated")
113
+ .map(([field]) => field)));
114
+ export const APP_SETTINGS_ABSENT_VALUES = {
115
+ // [app]
116
+ name: { required: true },
117
+ mode: { required: true },
118
+ baseUrl: { value: null },
119
+ waitlistEnabled: { value: false },
120
+ waitlistNotifyAdmins: { value: true },
121
+ directLlmEnabled: { value: false },
122
+ allowedDomains: { value: null },
123
+ testAccountBaseEmails: { value: null },
124
+ // #2816: absent ⇒ cleared, which puts the app back on the DEPLOYMENT's
125
+ // large-document window rather than on a number of its own. There is no
126
+ // default to reset to for the same reason the field has none.
127
+ largeDocumentWindowDays: { value: null },
128
+ // [auth]
129
+ googleOAuthEnabled: { value: null },
130
+ googleClients: { value: null },
131
+ passkeyEnabled: { value: false },
132
+ // #2884: the one email sign-in setting, absent ⇒ `true` because that is what
133
+ // `GET /settings` reports for a row storing none of the three fields
134
+ // (`isEmailSignInEnabled`) — the equality the table above exists to hold.
135
+ // Stated consequence: a hand-authored file that never carried the key pushes
136
+ // email sign-in ON, exactly as omitting `magicLinkEnabled` / `otpEnabled`
137
+ // did before the collapse. A pulled file always states the setting
138
+ // (`emit: "always"`), so this only bites a file authored without it.
139
+ emailSignInEnabled: { value: true },
140
+ appleSignInEnabled: { value: null },
141
+ appleAudiences: { value: null },
142
+ emailRedirectUris: { value: null },
143
+ passkeyRpConfig: { value: null },
144
+ // #3027 — absent means the default "preferred" policy, which is what
145
+ // `GET /settings` reports (`app.passkeyUserVerification ?? null`) for a row
146
+ // that stores none. A file without the key pushes null, not "preferred", so
147
+ // the app keeps following the default rather than pinning today's value.
148
+ passkeyUserVerification: { value: null },
149
+ // [cors]
150
+ corsMode: { value: "universal" },
151
+ corsAllowedOrigins: { value: null },
152
+ corsAllowCredentials: { value: false },
153
+ corsAllowedMethods: { value: null },
154
+ corsAllowedHeaders: { value: null },
155
+ corsExposedHeaders: { value: null },
156
+ corsMaxAge: { value: null },
157
+ // [invitations]
158
+ memberInvitationsEnabled: { value: false },
159
+ memberInvitationLimit: { value: 5 },
160
+ };
161
+ /**
162
+ * The absent-key rule for one field, or a loud failure.
163
+ *
164
+ * Deliberately a throw rather than a `?? null` fallback: under whole-truth push
165
+ * an unlisted field would be CLEARED on every push by a table nobody updated.
166
+ */
167
+ export function appSettingAbsentValue(field) {
168
+ const entry = APP_SETTINGS_ABSENT_VALUES[field];
169
+ if (!entry) {
170
+ throw new Error(`app.toml: no absent-key rule declared for the setting \`${field}\`. ` +
171
+ `Add it to APP_SETTINGS_ABSENT_VALUES (cli/src/lib/app-settings-descriptor.ts) ` +
172
+ `— push sends a value for every writable field (#2880).`);
173
+ }
174
+ return entry;
175
+ }
176
+ /** Fields whose absence is a validation error rather than a clear (#2880). */
177
+ export const REQUIRED_APP_SETTING_FIELDS = APP_SETTINGS_DESCRIPTOR.filter((d) => APP_SETTINGS_ABSENT_VALUES[d.field]?.required === true).map((d) => d.field);
178
+ /**
179
+ * The value the SERVER would hold after accepting this one (#2880 DSO-003).
180
+ *
181
+ * The comparison runs on the local side only: push forwards what the file says
182
+ * and the server normalizes it, so without this an authored-but-noncanonical
183
+ * value (`baseUrl` with a trailing slash, a mixed-case test-account email)
184
+ * differs from the record the server returns FOREVER — and baseline restamping
185
+ * cannot save it, because after an apply the remote hash matches the new
186
+ * baseline while the local hash still does not, re-classifying `local-edited`
187
+ * on every run.
188
+ *
189
+ * Mirrors the rules in `settings-controller.ts` (`baseUrl` trim + trailing
190
+ * slash), `validateTestAccountBaseEmails` (trim, lower-case, dedupe) and
191
+ * `validateRedirectUris` (trim, dedupe). Only the NORMALIZATION is mirrored,
192
+ * never the rejection: an entry the server would refuse stays as authored so
193
+ * the server's own 400 is what the operator sees.
194
+ */
195
+ export function canonicalizeAppSettingValue(field, value) {
196
+ if (value === null || value === undefined)
197
+ return value;
198
+ if (field === "baseUrl") {
199
+ if (typeof value !== "string")
200
+ return value;
201
+ const trimmed = value.trim().replace(/\/+$/, "");
202
+ return trimmed === "" ? null : trimmed;
203
+ }
204
+ if (field === "testAccountBaseEmails" || field === "emailRedirectUris") {
205
+ if (!Array.isArray(value))
206
+ return value;
207
+ const lower = field === "testAccountBaseEmails";
208
+ const seen = new Set();
209
+ const out = [];
210
+ for (const entry of value) {
211
+ if (typeof entry !== "string") {
212
+ out.push(entry);
213
+ continue;
214
+ }
215
+ const normalized = lower ? entry.trim().toLowerCase() : entry.trim();
216
+ if (seen.has(normalized))
217
+ continue;
218
+ seen.add(normalized);
219
+ out.push(normalized);
220
+ }
221
+ return out;
222
+ }
223
+ if (field === "appleAudiences") {
224
+ if (!Array.isArray(value))
225
+ return value;
226
+ // The controller filters non-empty strings and stores `null` for an empty
227
+ // result, so a list of blanks is the same state as no list at all.
228
+ return value.filter((v) => typeof v === "string" && v.length > 0);
229
+ }
230
+ if (field === "googleClients")
231
+ return canonicalizeGoogleClients(value);
232
+ return value;
233
+ }
234
+ /**
235
+ * The typed Google client map as the server STORES it (#2880 DSO-003).
236
+ *
237
+ * `validateGoogleClientsWrite` (`src/services/google-clients.ts`) rewrites each
238
+ * accepted entry: the `clientId` is trimmed, the `clientSecret` is stored as
239
+ * the canonical `{{secrets.KEY}}` reference, the redirect URIs are trimmed and
240
+ * de-duplicated (`validateRedirectUris`), and an entry that states none at all
241
+ * stores the empty list. Without mirroring that, an authored
242
+ * `clientId = " 123.apps... "` — or a `{{ secrets.KEY }}` written with the
243
+ * spacing TOML makes easy — is a `Modified` row on every run against a value
244
+ * push already applied.
245
+ *
246
+ * Normalization only, never rejection: an entry the server would refuse (a
247
+ * `clientSecret` that is not a reference, a URI it will not take) is left as
248
+ * authored so the `PUT`'s own 400 is what the operator sees.
249
+ */
250
+ function canonicalizeGoogleClients(value) {
251
+ if (!value || typeof value !== "object" || Array.isArray(value))
252
+ return value;
253
+ const clients = value.clients;
254
+ if (!clients || typeof clients !== "object" || Array.isArray(clients)) {
255
+ return value;
256
+ }
257
+ const out = {};
258
+ for (const [type, entry] of Object.entries(clients)) {
259
+ if (!entry || typeof entry !== "object" || Array.isArray(entry)) {
260
+ out[type] = entry;
261
+ continue;
262
+ }
263
+ const source = entry;
264
+ const canonical = { ...source };
265
+ if (typeof source.clientId === "string") {
266
+ canonical.clientId = source.clientId.trim();
267
+ }
268
+ if (source.clientSecret !== undefined) {
269
+ canonical.clientSecret = canonicalizeSecretReference(source.clientSecret);
270
+ }
271
+ // Trimmed and de-duplicated, and materialized when the entry states none —
272
+ // the server stores `[]` either way, so "no key" and "empty list" are one
273
+ // state rather than a difference no push can close.
274
+ canonical.redirectUris = Array.isArray(source.redirectUris)
275
+ ? [
276
+ ...new Set(source.redirectUris.map((uri) => typeof uri === "string" ? uri.trim() : uri)),
277
+ ]
278
+ : [];
279
+ out[type] = canonical;
280
+ }
281
+ return { clients: out };
282
+ }
283
+ /**
284
+ * One field's comparable value — what `config diff` and the push gate both read.
285
+ *
286
+ * Canonicalized as above, then flattened to `null` when the value is "empty"
287
+ * under an `emit: "whenSet"` field's own rule. That second step is the
288
+ * app-settings copy of what `projectConfigForComparison` does for every other
289
+ * type (#2731): pull OMITS an empty `whenSet` value, so the file it round-trips
290
+ * to has no key, and comparing `[]` against "no key" would be a difference no
291
+ * push could ever converge.
292
+ */
293
+ export function comparableAppSettingValue(descriptor, value) {
294
+ const canonical = canonicalizeAppSettingValue(descriptor.field, value);
295
+ if (canonical === undefined)
296
+ return null;
297
+ if (descriptor.emit === "whenSet" && isEmptyForEmit(canonical, descriptor.type)) {
298
+ return null;
299
+ }
300
+ return canonical ?? null;
301
+ }
302
+ /**
303
+ * Project a settings record (either side) onto the full writable field set.
304
+ *
305
+ * `excludeName` is the cross-app rule (#2880 DSO-001): while a cross-app push's
306
+ * name exclusion is active, BOTH sides and the stamped baseline are hashed
307
+ * without `name`, so `classifyPushChange`'s `remoteHash === baselineHash ⇒
308
+ * local-edited` arithmetic stays valid.
309
+ */
310
+ export function projectAppSettingsForComparison(settings, options = {}) {
311
+ const projected = {};
312
+ for (const d of APP_SETTINGS_DESCRIPTOR) {
313
+ if (options.excludeName && d.field === "name")
314
+ continue;
315
+ const raw = settings?.[d.field];
316
+ const absent = APP_SETTINGS_ABSENT_VALUES[d.field];
317
+ projected[d.field] = comparableAppSettingValue(d, raw === undefined && absent && absent.required !== true
318
+ ? absent.value
319
+ : raw);
320
+ }
321
+ return projected;
322
+ }
323
+ const DESCRIPTOR_BY_SECTION = (() => {
324
+ const m = new Map();
325
+ for (const d of APP_SETTINGS_DESCRIPTOR) {
326
+ const list = m.get(d.section) ?? [];
327
+ list.push(d);
328
+ m.set(d.section, list);
329
+ }
330
+ return m;
331
+ })();
332
+ /** Descriptor `field` names, for parity/coverage tests. */
333
+ export const DESCRIPTOR_FIELDS = new Set(APP_SETTINGS_DESCRIPTOR.map((d) => d.field));
334
+ function typeOfValue(value) {
335
+ if (value === null || value === undefined)
336
+ return "null";
337
+ if (typeof value === "boolean")
338
+ return "boolean";
339
+ if (typeof value === "number")
340
+ return "number";
341
+ if (typeof value === "string")
342
+ return "string";
343
+ if (Array.isArray(value))
344
+ return "string[]";
345
+ if (typeof value === "object")
346
+ return "object";
347
+ return "unknown";
348
+ }
349
+ /** True if a value should be omitted under `emit: "whenSet"`. */
350
+ function isEmptyForEmit(value, type) {
351
+ if (value === null || value === undefined)
352
+ return true;
353
+ if (type === "string")
354
+ return value === "";
355
+ if (type === "string[]")
356
+ return !Array.isArray(value) || value.length === 0;
357
+ if (type === "object")
358
+ return (typeof value !== "object" ||
359
+ value === null ||
360
+ Object.keys(value).length === 0);
361
+ return false; // booleans (false) and numbers (0) are meaningful, never empty
362
+ }
363
+ /**
364
+ * Validate a push value against its descriptor type. Returns an error string
365
+ * (field-named) on mismatch, or `null` when the value is acceptable. Arrays are
366
+ * checked element-by-element so a `["a", 1]` mistype is caught.
367
+ */
368
+ function typeError(descriptor, value) {
369
+ const actual = typeOfValue(value);
370
+ if (actual === "null")
371
+ return null; // null clears; server owns clear semantics
372
+ if (descriptor.type === "string[]") {
373
+ if (!Array.isArray(value) || !value.every((v) => typeof v === "string")) {
374
+ return `[${descriptor.section}].${descriptor.key} must be an array of strings (got ${actual})`;
375
+ }
376
+ return null;
377
+ }
378
+ if (descriptor.type === "object") {
379
+ if (actual !== "object") {
380
+ return `[${descriptor.section}].${descriptor.key} must be a table (got ${actual})`;
381
+ }
382
+ return null;
383
+ }
384
+ if (actual !== descriptor.type) {
385
+ return `[${descriptor.section}].${descriptor.key} must be a ${descriptor.type} (got ${actual})`;
386
+ }
387
+ return null;
388
+ }
389
+ /**
390
+ * Build one `app.toml` section object from server settings (pull direction).
391
+ * Applies each field's `emit` rule; a `null` value is always omitted (TOML
392
+ * cannot encode null).
393
+ */
394
+ export function serializeSection(settings, section) {
395
+ const out = {};
396
+ for (const d of DESCRIPTOR_BY_SECTION.get(section) ?? []) {
397
+ const value = settings[d.field];
398
+ if (value === null || value === undefined)
399
+ continue;
400
+ if (d.emit === "whenSet" && isEmptyForEmit(value, d.type))
401
+ continue;
402
+ out[d.key] = value;
403
+ }
404
+ return out;
405
+ }
406
+ /**
407
+ * Build the full `app.toml` data object (all sections) from server settings.
408
+ * Empty sections are omitted, though in practice every section has at least one
409
+ * `emit: "always"` key so all four are present.
410
+ */
411
+ export function serializeAppSettingsToToml(settings) {
412
+ const data = {};
413
+ for (const section of APP_SETTINGS_SECTIONS) {
414
+ const obj = serializeSection(settings, section);
415
+ if (Object.keys(obj).length > 0)
416
+ data[section] = obj;
417
+ }
418
+ return data;
419
+ }
420
+ /**
421
+ * Is `[app].name` out of this call entirely? ONE reading of the two spellings
422
+ * the callers use (#2936), so the parse and the payload can never disagree
423
+ * about whether the field is in play: `isCrossAppPush` is the raw cross-app
424
+ * determination, `excludeName` the already-computed answer from
425
+ * `appSettingsNameExcluded` (which also covers the recorded-exclusion case).
426
+ */
427
+ function appSettingsNameStripped(options) {
428
+ return !!(options.isCrossAppPush || options.excludeName);
429
+ }
430
+ /**
431
+ * Translate a parsed `app.toml` object into the settings the FILE STATES —
432
+ * only the keys it carries. This is the parse half; `buildAppSettingsPayload`
433
+ * below turns it into the whole-truth `PUT /settings` body by filling in what
434
+ * the file omits. An unrecognized key or table and a type
435
+ * mismatch are both hard errors the caller must treat as abort-before-PUT
436
+ * (#2644 criterion 6: push rejects what it does not recognize, for every
437
+ * configuration surface, so a typo fails locally instead of being ignored).
438
+ *
439
+ * A per-entry `clientSecret` that is not a whole `{{secrets.KEY}}` reference is
440
+ * the server's rejection to make (#2256): the push forwards the map and the
441
+ * `PUT` answers 400 with `GOOGLE_CLIENT_SECRET_MUST_BE_SECRET_REF`. Duplicating
442
+ * the shape rule here would put two definitions of "valid reference" in play.
443
+ *
444
+ * A RETIRED key (#2891) is different: it is not a value the server can judge,
445
+ * it is a line that has to be deleted, so the parser refuses it locally with
446
+ * the guidance that names its replacement.
447
+ *
448
+ * `isCrossAppPush` — or `excludeName`, the same rule as the caller computed it
449
+ * (#2880 DSO-001, `appSettingsNameExcluded`) — strips `name` so a cross-app
450
+ * push never overwrites the target app's name. The strip has to happen HERE and
451
+ * not only in the payload builder below (#2936): a field the body will not
452
+ * carry is not a field this file gets to refuse, or a slot bound to another app
453
+ * aborts diff and push over a `[app].name` neither of them was going to send.
454
+ */
455
+ export function parseTomlToAppSettings(tomlData, options = {}) {
456
+ const excludeName = appSettingsNameStripped(options);
457
+ const settings = {};
458
+ const warnings = [];
459
+ const errors = [];
460
+ // #2644 criterion 6 — a top-level table the definition does not declare is a
461
+ // hard error, the same posture every per-entity file has. Silently ignoring
462
+ // it made a typo'd header (`[curs]`) push as though the section it meant were
463
+ // absent, so the settings it carried were never applied.
464
+ for (const key of findUnknownDocumentKeys(tomlData, APP_SETTINGS_SURFACE)) {
465
+ errors.push(`app.toml: unrecognized top-level table [${key}]. Check the spelling ` +
466
+ `against the tables app.toml accepts (${APP_SETTINGS_SECTIONS.map((s) => `[${s}]`).join(", ")}), or upgrade the CLI if the server is newer than this one.`);
467
+ }
468
+ for (const section of APP_SETTINGS_SECTIONS) {
469
+ const sectionData = tomlData?.[section];
470
+ if (sectionData === undefined || sectionData === null)
471
+ continue;
472
+ if (typeof sectionData !== "object" || Array.isArray(sectionData)) {
473
+ errors.push(`[${section}] must be a table`);
474
+ continue;
475
+ }
476
+ const descriptors = DESCRIPTOR_BY_SECTION.get(section) ?? [];
477
+ const byKey = new Map(descriptors.map((d) => [d.key, d]));
478
+ for (const key of Object.keys(sectionData)) {
479
+ const d = byKey.get(key);
480
+ if (!d) {
481
+ // A RETIRED key is not an unknown key (#2803's rule, extended to
482
+ // app-settings by #2891/DSO-2891-005). "Check the spelling, or upgrade
483
+ // the CLI" is exactly backwards for a key the platform removed on
484
+ // purpose, and every pre-reshape `app.toml` still carries these lines —
485
+ // so the parser consults the shared retired set directly and says where
486
+ // the value moved to. Keyed under `app`, the app-settings surface's
487
+ // identifier, whichever section the key was authored in.
488
+ const retired = retiredConfigKey("app", key);
489
+ if (retired) {
490
+ errors.push(`app.toml: [${section}].${key} — ${retired.toml}`);
491
+ continue;
492
+ }
493
+ // #2644 criterion 6 — REJECTED, not warned-and-ignored. `app.toml` is a
494
+ // registered configuration surface like every other file, and an
495
+ // ignored key is a setting the author believes they changed.
496
+ errors.push(`app.toml: unrecognized key [${section}].${key}. Remove it or ` +
497
+ `upgrade the CLI if the server is newer than this one. ` +
498
+ `Recognized keys: ${descriptors.map((x) => x.key).join(", ")}.`);
499
+ continue;
500
+ }
501
+ if (excludeName && d.field === "name")
502
+ continue;
503
+ const value = sectionData[key];
504
+ const err = typeError(d, value);
505
+ if (err) {
506
+ errors.push(err);
507
+ continue;
508
+ }
509
+ settings[d.field] = value;
510
+ }
511
+ }
512
+ return { settings, warnings, errors };
513
+ }
514
+ /**
515
+ * `[app].name` / `[app].mode` absent — the two keys whole-truth push refuses to
516
+ * fill in for the author (#2880).
517
+ *
518
+ * Read from the DOCUMENT rather than the parse result, so a cross-app push
519
+ * (which strips `name` before validating) still requires the file to state one.
520
+ * `mode` has no default and `mode: null` is a 400; more to the point, a deleted
521
+ * `mode` line silently resetting an invite-only app to public is the wrong
522
+ * failure to choose.
523
+ */
524
+ export function missingRequiredKeyErrors(tomlData) {
525
+ const errors = [];
526
+ for (const field of REQUIRED_APP_SETTING_FIELDS) {
527
+ const d = APP_SETTINGS_DESCRIPTOR.find((x) => x.field === field);
528
+ if (!d)
529
+ continue;
530
+ const section = tomlData?.[d.section];
531
+ const present = section !== null &&
532
+ typeof section === "object" &&
533
+ !Array.isArray(section) &&
534
+ section[d.key] !== undefined;
535
+ if (present)
536
+ continue;
537
+ errors.push(`app.toml: [${d.section}].${d.key} is required — \`config push\` applies ` +
538
+ `app.toml as the whole truth, and this field has no default to fall ` +
539
+ `back to. Add the line (\`config pull --only app\` writes it).`);
540
+ }
541
+ return errors;
542
+ }
543
+ /**
544
+ * The whole-truth `PUT /settings` body (#2880 criterion 4).
545
+ *
546
+ * Every writable field gets a value: the authored one where the file carries
547
+ * the key, its `APP_SETTINGS_ABSENT_VALUES` entry where it does not. That is
548
+ * what makes `app.toml` mean what every other configuration file means — the
549
+ * local file is the state, not a patch over whatever the server happens to
550
+ * hold (#1567). The controller applies only the keys in the body (`if (field in
551
+ * updates)`), so the completeness has to come from here.
552
+ *
553
+ * Values are forwarded AS AUTHORED, never canonicalized: the server owns its
554
+ * own normalization, and a CLI that rewrote the value before sending it would
555
+ * be pushing something the operator did not write. The canonicalization in
556
+ * `canonicalizeAppSettingValue` is for the local COMPARISON only.
557
+ *
558
+ * `excludeName` (and `isCrossAppPush`, which implies it) leaves `name` out of
559
+ * the body entirely, so a cross-app push never renames the target app.
560
+ */
561
+ export function buildAppSettingsPayload(tomlData, options = {}) {
562
+ const parsed = parseTomlToAppSettings(tomlData, options);
563
+ const errors = [...parsed.errors, ...missingRequiredKeyErrors(tomlData)];
564
+ if (errors.length > 0) {
565
+ return { settings: {}, warnings: parsed.warnings, errors };
566
+ }
567
+ const excludeName = appSettingsNameStripped(options);
568
+ const settings = {};
569
+ for (const d of APP_SETTINGS_DESCRIPTOR) {
570
+ if (excludeName && d.field === "name")
571
+ continue;
572
+ if (d.field in parsed.settings) {
573
+ settings[d.field] = parsed.settings[d.field];
574
+ continue;
575
+ }
576
+ const absent = appSettingAbsentValue(d.field);
577
+ // Required fields never reach here — their absence already errored above.
578
+ if (absent.required === true)
579
+ continue;
580
+ settings[d.field] = absent.value;
581
+ }
582
+ return { settings, warnings: parsed.warnings, errors: [] };
583
+ }
584
+ //# sourceMappingURL=app-settings-descriptor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-settings-descriptor.js","sourceRoot":"","sources":["../../../src/lib/app-settings-descriptor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,OAAO,EACL,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAC;AAE7E;;;;GAIG;AACH,MAAM,oBAAoB,GAAG,oBAAoB,CAAC,cAAc,CAAC,CAAC;AA8BlE;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAClC,oBAAoB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAC5C,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAC3B,KAAK,EAAE,KAAK,CAAC,KAAK;IAClB,OAAO,EAAE,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,MAAM,CAAC,MAAM,EAAE,GAAG,wBAAwB,CAAC,QAAQ,CAAC,CAAC,CAAC;IACzE,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtB,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;IAC7D,CAAC;IAED,MAAM,WAAW,GAAG,uBAAuB,CAAC,OAAO,CAAC,CAAC;IACrD,MAAM,QAAQ,GAAwB,EAAE,CAAC;IACzC,KAAK,MAAM,CAAC,IAAI,uBAAuB,EAAE,CAAC;QACxC,IAAI,WAAW,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM;YAAE,SAAS;QAChD,IAAI,CAAC,CAAC,KAAK,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YAC/B,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;YAC7C,SAAS;QACX,CAAC;QACD,MAAM,MAAM,GAAG,qBAAqB,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QAC9C,0EAA0E;QAC1E,IAAI,MAAM,CAAC,QAAQ,KAAK,IAAI;YAAE,SAAS;QACvC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC;IACnC,CAAC;IACD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;AAC7D,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { Credentials } from "../types/index.js";
2
+ interface AuthResult {
3
+ success: boolean;
4
+ credentials?: Credentials;
5
+ error?: string;
6
+ }
7
+ export declare function browserLogin(serverUrl: string): Promise<AuthResult>;
8
+ export {};
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Shared helpers for the CLI's batch-import commands
3
+ * (`databases import` and `databases import-csv`).
4
+ */
5
+ /** Split an array into fixed-size chunks. */
6
+ export declare function chunk<T>(items: T[], size: number): T[][];
7
+ export interface ParseBatchSizeOptions {
8
+ /** Largest batch size the caller will accept. */
9
+ max: number;
10
+ /** Message shown when the value exceeds `max`. */
11
+ overMaxMessage: string;
12
+ }
13
+ /**
14
+ * Parse and validate a `--batch-size` flag value.
15
+ *
16
+ * Returns the parsed integer on success, or a human-readable error message
17
+ * on failure (non-integer, `< 1`, or over the caller's ceiling). Callers
18
+ * decide how to surface the error — typically `error(msg); process.exit(1)`.
19
+ * Validating up front means a bad `--batch-size` fails before any write, so
20
+ * there are no partial imports.
21
+ */
22
+ export declare function parseBatchSize(raw: string, opts: ParseBatchSizeOptions): {
23
+ value: number;
24
+ } | {
25
+ error: string;
26
+ };