primitive-admin 1.1.0-alpha.4 → 1.1.0-alpha.41

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 (219) hide show
  1. package/README.md +325 -31
  2. package/assets/skill/skills/primitive-platform/SKILL.md +281 -0
  3. package/dist/bin/primitive.d.ts +2 -0
  4. package/dist/bin/primitive.js +268 -16
  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 +123 -18
  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 +464 -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 +55 -13
  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 +177 -7
  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 +422 -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 +34 -35
  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 +178 -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 +515 -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/cron-triggers.d.ts +2 -0
  34. package/dist/src/commands/cron-triggers.js +357 -0
  35. package/dist/src/commands/cron-triggers.js.map +1 -0
  36. package/dist/src/commands/database-types.d.ts +2 -0
  37. package/dist/src/commands/database-types.js +471 -0
  38. package/dist/src/commands/database-types.js.map +1 -0
  39. package/dist/src/commands/databases.d.ts +2 -0
  40. package/dist/src/commands/databases.js +1462 -83
  41. package/dist/src/commands/databases.js.map +1 -1
  42. package/dist/src/commands/documents.d.ts +2 -0
  43. package/dist/src/commands/documents.js +518 -11
  44. package/dist/src/commands/documents.js.map +1 -1
  45. package/dist/src/commands/email-templates.d.ts +2 -0
  46. package/dist/src/commands/email-templates.js +281 -0
  47. package/dist/src/commands/email-templates.js.map +1 -0
  48. package/dist/src/commands/env.d.ts +12 -0
  49. package/dist/src/commands/env.js +260 -0
  50. package/dist/src/commands/env.js.map +1 -0
  51. package/dist/src/commands/group-type-configs.d.ts +2 -0
  52. package/dist/src/commands/group-type-configs.js +181 -0
  53. package/dist/src/commands/group-type-configs.js.map +1 -0
  54. package/dist/src/commands/groups.d.ts +2 -0
  55. package/dist/src/commands/groups.js +48 -45
  56. package/dist/src/commands/groups.js.map +1 -1
  57. package/dist/src/commands/guides.d.ts +159 -0
  58. package/dist/src/commands/guides.js +449 -35
  59. package/dist/src/commands/guides.js.map +1 -1
  60. package/dist/src/commands/init.d.ts +17 -0
  61. package/dist/src/commands/init.js +811 -201
  62. package/dist/src/commands/init.js.map +1 -1
  63. package/dist/src/commands/integrations.d.ts +2 -0
  64. package/dist/src/commands/integrations.js +533 -46
  65. package/dist/src/commands/integrations.js.map +1 -1
  66. package/dist/src/commands/llm.d.ts +2 -0
  67. package/dist/src/commands/llm.js +4 -2
  68. package/dist/src/commands/llm.js.map +1 -1
  69. package/dist/src/commands/metadata.d.ts +2 -0
  70. package/dist/src/commands/metadata.js +194 -0
  71. package/dist/src/commands/metadata.js.map +1 -0
  72. package/dist/src/commands/prompts.d.ts +2 -0
  73. package/dist/src/commands/prompts.js +50 -52
  74. package/dist/src/commands/prompts.js.map +1 -1
  75. package/dist/src/commands/rule-sets.d.ts +3 -0
  76. package/dist/src/commands/rule-sets.js +388 -0
  77. package/dist/src/commands/rule-sets.js.map +1 -0
  78. package/dist/src/commands/scripts.d.ts +2 -0
  79. package/dist/src/commands/scripts.js +667 -0
  80. package/dist/src/commands/scripts.js.map +1 -0
  81. package/dist/src/commands/secrets.d.ts +2 -0
  82. package/dist/src/commands/secrets.js +108 -0
  83. package/dist/src/commands/secrets.js.map +1 -0
  84. package/dist/src/commands/skill.d.ts +2 -0
  85. package/dist/src/commands/skill.js +29 -0
  86. package/dist/src/commands/skill.js.map +1 -0
  87. package/dist/src/commands/sync.d.ts +175 -0
  88. package/dist/src/commands/sync.js +4412 -233
  89. package/dist/src/commands/sync.js.map +1 -1
  90. package/dist/src/commands/tokens.d.ts +2 -0
  91. package/dist/src/commands/tokens.js +122 -19
  92. package/dist/src/commands/tokens.js.map +1 -1
  93. package/dist/src/commands/users.d.ts +2 -0
  94. package/dist/src/commands/users.js +440 -22
  95. package/dist/src/commands/users.js.map +1 -1
  96. package/dist/src/commands/waitlist.d.ts +2 -0
  97. package/dist/src/commands/waitlist.js +10 -10
  98. package/dist/src/commands/waitlist.js.map +1 -1
  99. package/dist/src/commands/webhooks.d.ts +2 -0
  100. package/dist/src/commands/webhooks.js +391 -0
  101. package/dist/src/commands/webhooks.js.map +1 -0
  102. package/dist/src/commands/workflows.d.ts +49 -0
  103. package/dist/src/commands/workflows.js +1009 -123
  104. package/dist/src/commands/workflows.js.map +1 -1
  105. package/dist/src/lib/api-client.d.ts +1283 -0
  106. package/dist/src/lib/api-client.js +1129 -83
  107. package/dist/src/lib/api-client.js.map +1 -1
  108. package/dist/src/lib/auth-flow.d.ts +8 -0
  109. package/dist/src/lib/block-layout.d.ts +160 -0
  110. package/dist/src/lib/block-layout.js +451 -0
  111. package/dist/src/lib/block-layout.js.map +1 -0
  112. package/dist/src/lib/cli-manifest.d.ts +60 -0
  113. package/dist/src/lib/cli-manifest.js +70 -0
  114. package/dist/src/lib/cli-manifest.js.map +1 -0
  115. package/dist/src/lib/config.d.ts +53 -0
  116. package/dist/src/lib/config.js +92 -53
  117. package/dist/src/lib/config.js.map +1 -1
  118. package/dist/src/lib/confirm-prompt.d.ts +83 -0
  119. package/dist/src/lib/confirm-prompt.js +110 -0
  120. package/dist/src/lib/confirm-prompt.js.map +1 -0
  121. package/dist/src/lib/constants.d.ts +2 -0
  122. package/dist/src/lib/constants.js +3 -0
  123. package/dist/src/lib/constants.js.map +1 -0
  124. package/dist/src/lib/crash-handlers.d.ts +20 -0
  125. package/dist/src/lib/crash-handlers.js +49 -0
  126. package/dist/src/lib/crash-handlers.js.map +1 -0
  127. package/dist/src/lib/credentials-store.d.ts +79 -0
  128. package/dist/src/lib/credentials-store.js +307 -0
  129. package/dist/src/lib/credentials-store.js.map +1 -0
  130. package/dist/src/lib/csv.d.ts +48 -0
  131. package/dist/src/lib/csv.js +177 -0
  132. package/dist/src/lib/csv.js.map +1 -0
  133. package/dist/src/lib/db-codegen/dbFingerprint.d.ts +10 -0
  134. package/dist/src/lib/db-codegen/dbFingerprint.js +17 -0
  135. package/dist/src/lib/db-codegen/dbFingerprint.js.map +1 -0
  136. package/dist/src/lib/db-codegen/dbGenerator.d.ts +111 -0
  137. package/dist/src/lib/db-codegen/dbGenerator.js +371 -0
  138. package/dist/src/lib/db-codegen/dbGenerator.js.map +1 -0
  139. package/dist/src/lib/db-codegen/dbNaming.d.ts +45 -0
  140. package/dist/src/lib/db-codegen/dbNaming.js +104 -0
  141. package/dist/src/lib/db-codegen/dbNaming.js.map +1 -0
  142. package/dist/src/lib/db-codegen/dbTemplates.d.ts +97 -0
  143. package/dist/src/lib/db-codegen/dbTemplates.js +159 -0
  144. package/dist/src/lib/db-codegen/dbTemplates.js.map +1 -0
  145. package/dist/src/lib/db-codegen/dbTsTypes.d.ts +78 -0
  146. package/dist/src/lib/db-codegen/dbTsTypes.js +112 -0
  147. package/dist/src/lib/db-codegen/dbTsTypes.js.map +1 -0
  148. package/dist/src/lib/env-resolver.d.ts +62 -0
  149. package/dist/src/lib/env-resolver.js +121 -0
  150. package/dist/src/lib/env-resolver.js.map +1 -0
  151. package/dist/src/lib/fetch.d.ts +5 -0
  152. package/dist/src/lib/generated-allowlist.d.ts +28 -0
  153. package/dist/src/lib/generated-allowlist.js +220 -0
  154. package/dist/src/lib/generated-allowlist.js.map +1 -0
  155. package/dist/src/lib/init-config.d.ts +59 -0
  156. package/dist/src/lib/init-config.js +113 -0
  157. package/dist/src/lib/init-config.js.map +1 -0
  158. package/dist/src/lib/migration-nag.d.ts +49 -0
  159. package/dist/src/lib/migration-nag.js +163 -0
  160. package/dist/src/lib/migration-nag.js.map +1 -0
  161. package/dist/src/lib/output.d.ts +86 -0
  162. package/dist/src/lib/output.js +150 -8
  163. package/dist/src/lib/output.js.map +1 -1
  164. package/dist/src/lib/paginate.d.ts +33 -0
  165. package/dist/src/lib/paginate.js +42 -0
  166. package/dist/src/lib/paginate.js.map +1 -0
  167. package/dist/src/lib/project-config.d.ts +97 -0
  168. package/dist/src/lib/project-config.js +209 -0
  169. package/dist/src/lib/project-config.js.map +1 -0
  170. package/dist/src/lib/query-operators.d.ts +43 -0
  171. package/dist/src/lib/query-operators.js +80 -0
  172. package/dist/src/lib/query-operators.js.map +1 -0
  173. package/dist/src/lib/refresh-admin-credentials.d.ts +65 -0
  174. package/dist/src/lib/refresh-admin-credentials.js +103 -0
  175. package/dist/src/lib/refresh-admin-credentials.js.map +1 -0
  176. package/dist/src/lib/resolve-platform.d.ts +45 -0
  177. package/dist/src/lib/resolve-platform.js +43 -0
  178. package/dist/src/lib/resolve-platform.js.map +1 -0
  179. package/dist/src/lib/skill-installer.d.ts +23 -0
  180. package/dist/src/lib/skill-installer.js +135 -0
  181. package/dist/src/lib/skill-installer.js.map +1 -0
  182. package/dist/src/lib/snapshots.d.ts +99 -0
  183. package/dist/src/lib/snapshots.js +357 -0
  184. package/dist/src/lib/snapshots.js.map +1 -0
  185. package/dist/src/lib/sync-paths.d.ts +72 -0
  186. package/dist/src/lib/sync-paths.js +130 -0
  187. package/dist/src/lib/sync-paths.js.map +1 -0
  188. package/dist/src/lib/template.d.ts +97 -0
  189. package/dist/src/lib/template.js +336 -62
  190. package/dist/src/lib/template.js.map +1 -1
  191. package/dist/src/lib/token-inject.d.ts +56 -0
  192. package/dist/src/lib/token-inject.js +204 -0
  193. package/dist/src/lib/token-inject.js.map +1 -0
  194. package/dist/src/lib/toml-database-config.d.ts +152 -0
  195. package/dist/src/lib/toml-database-config.js +600 -0
  196. package/dist/src/lib/toml-database-config.js.map +1 -0
  197. package/dist/src/lib/toml-metadata-config.d.ts +139 -0
  198. package/dist/src/lib/toml-metadata-config.js +427 -0
  199. package/dist/src/lib/toml-metadata-config.js.map +1 -0
  200. package/dist/src/lib/toml-params-validator.d.ts +129 -0
  201. package/dist/src/lib/toml-params-validator.js +298 -0
  202. package/dist/src/lib/toml-params-validator.js.map +1 -0
  203. package/dist/src/lib/version-check.d.ts +10 -0
  204. package/dist/src/lib/version-check.js +172 -0
  205. package/dist/src/lib/version-check.js.map +1 -0
  206. package/dist/src/lib/workflow-apply.d.ts +66 -0
  207. package/dist/src/lib/workflow-apply.js +117 -0
  208. package/dist/src/lib/workflow-apply.js.map +1 -0
  209. package/dist/src/lib/workflow-fragments.d.ts +41 -0
  210. package/dist/src/lib/workflow-fragments.js +121 -0
  211. package/dist/src/lib/workflow-fragments.js.map +1 -0
  212. package/dist/src/lib/workflow-toml-validator.d.ts +95 -0
  213. package/dist/src/lib/workflow-toml-validator.js +323 -0
  214. package/dist/src/lib/workflow-toml-validator.js.map +1 -0
  215. package/dist/src/types/index.d.ts +520 -0
  216. package/dist/src/validators.d.ts +64 -0
  217. package/dist/src/validators.js +63 -0
  218. package/dist/src/validators.js.map +1 -0
  219. package/package.json +18 -4
@@ -0,0 +1,600 @@
1
+ /**
2
+ * Helpers for emitting `DatabaseTypeOperation` configs as native TOML.
3
+ *
4
+ * Background (issue #752): historically `sync pull` serialized
5
+ * `definition` and `params` as JSON strings stuffed into a single TOML
6
+ * field, which produced unreviewable 800-char one-liners. This module
7
+ * lets us emit them as nested TOML tables when they're representable,
8
+ * while preserving the existing file's shape so we don't generate
9
+ * surprise diffs.
10
+ *
11
+ * Three responsibilities:
12
+ * 1. `detectExistingOperationForms()` — read the raw TOML source and
13
+ * decide, per operation name, whether the file uses JSON-string
14
+ * form ("legacy") or nested-table form ("native") for each of
15
+ * `definition` and `params`. This drives form preservation on
16
+ * `sync pull`.
17
+ * 2. `canEmitNative()` — recursively check whether a JS value is
18
+ * representable as a TOML value. Returns a reason string if not.
19
+ * Mainly catches `null` and mixed-type arrays, which `@iarna/toml`
20
+ * either rejects or silently mangles.
21
+ * 3. `buildDatabaseTypeTomlData()` — builds the JS object that we
22
+ * hand to `TOML.stringify`. Per operation, decides JSON-string vs
23
+ * native based on (existing form, can-emit, override mode).
24
+ */
25
+ import * as TOML from "@iarna/toml";
26
+ import { serializeDeclaredAccessManifest } from "./toml-metadata-config.js";
27
+ /**
28
+ * Classify a single-line TOML field value (the text after `key = `) as
29
+ * native or legacy form.
30
+ *
31
+ * An inline table (`{ ... }`) or inline array (`[ ... ]`) is native TOML —
32
+ * the operator/param structure is written directly, so `sync pull` should
33
+ * re-emit it through the native-emission path rather than collapse it back
34
+ * to an opaque JSON string. A quoted string (`'...'` / `"..."`) is the
35
+ * legacy JSON-string form.
36
+ *
37
+ * This is the fix for issue #1255: previously ANY `definition = <value>`
38
+ * one-liner was classified `legacy`, so an author who wrote the compact
39
+ * inline form `definition = { filter = { "$in" = [1, 2] } }` got an opaque
40
+ * JSON string back on the next pull (churn). Distinguishing the two makes
41
+ * the inline form round-trip stably through the existing native-emission
42
+ * path.
43
+ *
44
+ * Exported for reuse by `[[subscriptions]]` form detection (issue #803).
45
+ */
46
+ export function classifyInlineFieldForm(rawValue) {
47
+ const trimmed = rawValue.trimStart();
48
+ if (trimmed.startsWith("{") || trimmed.startsWith("["))
49
+ return "native";
50
+ return "legacy";
51
+ }
52
+ /**
53
+ * Inspect the raw TOML source for a database-type file and decide which
54
+ * form each operation's `definition`/`params` currently use.
55
+ *
56
+ * Detection is intentionally simple: we walk `[[operations]]` blocks in
57
+ * source order and, for each one, look for either a `definition = '...'`
58
+ * line (legacy) or an `[operations.definition]` / `[operations.definition.X]`
59
+ * sub-header (native).
60
+ */
61
+ export function detectExistingOperationForms(rawToml) {
62
+ const lines = rawToml.split(/\r?\n/);
63
+ const operations = [];
64
+ let current = null;
65
+ // `inSubTable` flips to true the moment we descend into a sub-table of
66
+ // the current operation (e.g. `[operations.definition]` or
67
+ // `[[operations.params]]`). Once true, subsequent `name = "..."` /
68
+ // `definition = "..."` / `params = "..."` lines belong to the sub-table,
69
+ // not to the operation itself, so we must not let them overwrite the
70
+ // op-level fields (review feedback r3246634568).
71
+ let inSubTable = false;
72
+ for (const rawLine of lines) {
73
+ const line = rawLine.trim();
74
+ if (line === "[[operations]]") {
75
+ if (current)
76
+ operations.push(current);
77
+ current = { name: null, definition: null, params: null };
78
+ inSubTable = false;
79
+ continue;
80
+ }
81
+ if (!current)
82
+ continue;
83
+ // Sub-header for this op's definition or params.
84
+ if (/^\[operations\.definition(\..+)?\]/.test(line) || /^\[\[operations\.definition\..+\]\]/.test(line)) {
85
+ if (current.definition === null)
86
+ current.definition = "native";
87
+ inSubTable = true;
88
+ continue;
89
+ }
90
+ if (/^\[\[operations\.params\]\]/.test(line) || /^\[operations\.params(\..+)?\]/.test(line)) {
91
+ if (current.params === null)
92
+ current.params = "native";
93
+ inSubTable = true;
94
+ continue;
95
+ }
96
+ // A new top-level array-of-tables block ends the operation's scope
97
+ // for our purposes. We don't fully parse TOML here; we just stop
98
+ // ascribing later lines to this op.
99
+ if (/^\[\[/.test(line) && !line.startsWith("[[operations.")) {
100
+ operations.push(current);
101
+ current = null;
102
+ inSubTable = false;
103
+ continue;
104
+ }
105
+ if (/^\[/.test(line) && !line.startsWith("[operations.")) {
106
+ operations.push(current);
107
+ current = null;
108
+ inSubTable = false;
109
+ continue;
110
+ }
111
+ // Op-level fields. Skip if we've already descended into a sub-table —
112
+ // a `name = "id"` inside `[[operations.params]]` belongs to the param,
113
+ // not to the operation. Same for any other key we recognize here.
114
+ if (inSubTable)
115
+ continue;
116
+ const m = line.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\s*=\s*(.*)$/);
117
+ if (!m)
118
+ continue;
119
+ const key = m[1];
120
+ const value = m[2];
121
+ if (key === "name") {
122
+ const nameMatch = value.match(/^["'](.+)["']\s*$/);
123
+ if (nameMatch)
124
+ current.name = nameMatch[1];
125
+ }
126
+ else if (key === "definition" && current.definition === null) {
127
+ // Distinguish the inline-table form (`definition = { ... }`) from the
128
+ // legacy JSON-string form (`definition = '...'`) so an inline author
129
+ // round-trips through native emission, not back to a JSON string
130
+ // (issue #1255).
131
+ current.definition = classifyInlineFieldForm(value);
132
+ }
133
+ else if (key === "params" && current.params === null) {
134
+ current.params = classifyInlineFieldForm(value);
135
+ }
136
+ }
137
+ if (current)
138
+ operations.push(current);
139
+ const definition = new Map();
140
+ const params = new Map();
141
+ for (const op of operations) {
142
+ if (!op.name)
143
+ continue;
144
+ if (op.definition)
145
+ definition.set(op.name, op.definition);
146
+ if (op.params)
147
+ params.set(op.name, op.params);
148
+ }
149
+ return { definition, params };
150
+ }
151
+ /**
152
+ * Recursively check whether a JS value can be safely serialized to TOML
153
+ * using `@iarna/toml`. Returns null if OK, a reason string otherwise.
154
+ *
155
+ * Things TOML can't represent (in `@iarna/toml`):
156
+ * - `null` (TOML has no null).
157
+ * - Arrays containing values of different "TOML types" (e.g. mixed
158
+ * string and number). Spec-wise TOML 1.0 actually allows this, but
159
+ * `@iarna/toml` is strict and throws.
160
+ * - `undefined` (different from null but equally not representable).
161
+ */
162
+ export function canEmitNative(value) {
163
+ if (value === null)
164
+ return "value is null";
165
+ if (value === undefined)
166
+ return "value is undefined";
167
+ if (Array.isArray(value)) {
168
+ if (value.length > 0) {
169
+ const types = new Set();
170
+ for (const item of value) {
171
+ if (item === null)
172
+ return "array contains null";
173
+ if (Array.isArray(item))
174
+ types.add("array");
175
+ else
176
+ types.add(typeof item);
177
+ }
178
+ if (types.size > 1) {
179
+ return `array contains mixed types (${[...types].sort().join(", ")})`;
180
+ }
181
+ }
182
+ for (const item of value) {
183
+ const sub = canEmitNative(item);
184
+ if (sub)
185
+ return sub;
186
+ }
187
+ return null;
188
+ }
189
+ if (typeof value === "object") {
190
+ for (const v of Object.values(value)) {
191
+ const sub = canEmitNative(v);
192
+ if (sub)
193
+ return sub;
194
+ }
195
+ return null;
196
+ }
197
+ // primitives: string, number, boolean.
198
+ return null;
199
+ }
200
+ /**
201
+ * Normalize a `params` value into a sorted array of
202
+ * `{ name, type, required, ... }` rows, suitable for emitting as
203
+ * `[[operations.params]]`. Accepts both shapes the wire/parser supports:
204
+ * - object form: `{ projectId: { type: "string", required: true } }`
205
+ * - array form: `[{ name: "projectId", type: "string", required: true }]`
206
+ */
207
+ export function normalizeParamsToArray(params) {
208
+ if (params == null)
209
+ return null;
210
+ if (Array.isArray(params)) {
211
+ return params
212
+ .map((p) => ({ ...p }))
213
+ .filter((p) => p && typeof p === "object");
214
+ }
215
+ if (typeof params === "object") {
216
+ return Object.entries(params).map(([name, spec]) => ({
217
+ name,
218
+ ...(spec && typeof spec === "object" ? spec : {}),
219
+ }));
220
+ }
221
+ return null;
222
+ }
223
+ /**
224
+ * Default form for a new operation (no existing form hint): native.
225
+ * That matches the issue's "new file from server → native by default"
226
+ * requirement.
227
+ */
228
+ const DEFAULT_FORM = "native";
229
+ /**
230
+ * Build the JS object to pass to `TOML.stringify` for a database-type
231
+ * config file. Per operation:
232
+ * - If the chosen form is "native" AND `definition` is TOML-emittable,
233
+ * emit `[operations.definition]` (nested table).
234
+ * - Else emit `definition = '<json string>'` and log a message.
235
+ * - Same logic independently for `params`, but the native form for
236
+ * params is `[[operations.params]]` (array-of-tables).
237
+ */
238
+ export function buildDatabaseTypeTomlData(typeConfig, operations, ruleSetIdToName, options = {}) {
239
+ const hints = options.hints;
240
+ const defaultForm = options.defaultForm ?? DEFAULT_FORM;
241
+ const log = options.logger ?? (() => { });
242
+ // Prefer the parsed-from-key-based-reference name when present
243
+ // (`_ruleSetName` is set by `parseDatabaseTypeToml` when the source TOML
244
+ // uses the modern `ruleSetName = "..."` form). This makes the
245
+ // parse → serialize cycle a no-op for the rule-set field even when the
246
+ // caller passes an empty `ruleSetIdToName` map (e.g. `sync migrate-toml`,
247
+ // review feedback r3246633010).
248
+ let ruleSetName = "";
249
+ if (typeConfig._ruleSetName) {
250
+ ruleSetName = typeConfig._ruleSetName;
251
+ }
252
+ else if (typeConfig.ruleSetId) {
253
+ ruleSetName = ruleSetIdToName.get(typeConfig.ruleSetId) || "";
254
+ }
255
+ const data = {
256
+ type: {
257
+ databaseType: typeConfig.databaseType,
258
+ ruleSetName,
259
+ },
260
+ };
261
+ if (typeConfig.metadataAccess) {
262
+ data.type.celContextAccess = typeConfig.metadataAccess;
263
+ }
264
+ if (typeConfig.defaultAccess) {
265
+ data.type.defaultAccess = typeConfig.defaultAccess;
266
+ }
267
+ if (typeConfig.autoPopulatedFields) {
268
+ data.type.autoPopulatedFields = typeConfig.autoPopulatedFields;
269
+ }
270
+ // timestamps (issue #748) — emitted as an inline table under `[type]`. The
271
+ // server returns the parsed `{ create?, update?, models? }` object, which
272
+ // serializes 1:1 so a pull → push cycle is idempotent.
273
+ if (typeConfig.timestamps) {
274
+ data.type.timestamps = typeConfig.timestamps;
275
+ }
276
+ if (typeConfig.triggers) {
277
+ data.triggers = typeConfig.triggers;
278
+ }
279
+ // Issue #666: inline schema TOML. The server-side `schema` field is a raw
280
+ // TOML string of `[models.*.fields.*]` blocks. Parse + merge into the same
281
+ // TOML object so the result serializes as `[models.<Name>.fields.<field>]`
282
+ // headers (matches the round-2 plan-of-record CLI sync layout).
283
+ if (typeConfig.schema && typeof typeConfig.schema === "string") {
284
+ try {
285
+ const parsedSchema = TOML.parse(typeConfig.schema);
286
+ if (parsedSchema?.models) {
287
+ data.models = parsedSchema.models;
288
+ }
289
+ }
290
+ catch {
291
+ // If the stored TOML is malformed (operationally surprising), don't
292
+ // crash the serializer — fall through without the models block.
293
+ }
294
+ }
295
+ // Declared-access manifest (issue #1304, P-C): merge the top-level
296
+ // `[metadata]` + `secrets` fragments so a pull→push→pull cycle round-trips.
297
+ // Emitted before the operations-only early return so a type with a manifest
298
+ // but no operations still writes it.
299
+ Object.assign(data, serializeDeclaredAccessManifest(typeConfig.metadataManifest));
300
+ // Subscriptions (issue #803) — emitted as `[[subscriptions]]` array-of-
301
+ // tables, independent of operations. Built before the operations-only
302
+ // early return so a type with subscriptions but no operations still emits
303
+ // them.
304
+ const subscriptionRows = buildSubscriptionRows(options.subscriptions, log);
305
+ if (operations.length === 0) {
306
+ if (subscriptionRows.length > 0) {
307
+ data.subscriptions = subscriptionRows;
308
+ }
309
+ return data;
310
+ }
311
+ data.operations = operations.map((op) => {
312
+ const opRow = {
313
+ name: op.name,
314
+ type: op.type,
315
+ modelName: op.modelName,
316
+ };
317
+ if (op.access) {
318
+ opRow.access = op.access;
319
+ }
320
+ // ---- definition ----
321
+ const defForm = hints?.definition.get(op.name) ?? defaultForm;
322
+ const defValue = typeof op.definition === "string"
323
+ ? safeParseJson(op.definition)
324
+ : op.definition;
325
+ let definitionEmitted = false;
326
+ if (defForm === "native" && defValue && typeof defValue === "object") {
327
+ const reason = canEmitNative(defValue);
328
+ if (reason) {
329
+ log(`Operation '${op.name}': cannot emit \`definition\` as native TOML (${reason}); falling back to JSON string for this field.`);
330
+ }
331
+ else {
332
+ opRow.definition = defValue;
333
+ definitionEmitted = true;
334
+ }
335
+ }
336
+ if (!definitionEmitted) {
337
+ opRow.definition = typeof op.definition === "object"
338
+ ? JSON.stringify(op.definition)
339
+ : op.definition;
340
+ }
341
+ // ---- params ----
342
+ if (op.params != null) {
343
+ const paramsForm = hints?.params.get(op.name) ?? defaultForm;
344
+ let paramsEmitted = false;
345
+ if (paramsForm === "native") {
346
+ const paramsParsed = typeof op.params === "string"
347
+ ? safeParseJson(op.params)
348
+ : op.params;
349
+ const paramsArray = normalizeParamsToArray(paramsParsed);
350
+ if (paramsArray && paramsArray.length > 0) {
351
+ const reason = canEmitNative(paramsArray);
352
+ if (reason) {
353
+ log(`Operation '${op.name}': cannot emit \`params\` as native TOML (${reason}); falling back to JSON string for this field.`);
354
+ }
355
+ else {
356
+ opRow.params = paramsArray;
357
+ paramsEmitted = true;
358
+ }
359
+ }
360
+ else if (paramsArray && paramsArray.length === 0) {
361
+ // Empty params: skip entirely rather than emitting an empty table.
362
+ paramsEmitted = true;
363
+ }
364
+ }
365
+ if (!paramsEmitted) {
366
+ opRow.params = typeof op.params === "object"
367
+ ? JSON.stringify(op.params)
368
+ : op.params;
369
+ }
370
+ }
371
+ return opRow;
372
+ });
373
+ if (subscriptionRows.length > 0) {
374
+ data.subscriptions = subscriptionRows;
375
+ }
376
+ return data;
377
+ }
378
+ /**
379
+ * Build the `[[subscriptions]]` rows for a database-type TOML file from the
380
+ * server's sanitized subscription list (issue #803).
381
+ *
382
+ * Emits the canonical TOML key order and uses the wire key `access` (we read
383
+ * both `access` and `accessRule` on parse, but always emit `access` so a
384
+ * pull → push round-trip is stable). `select` / `emit` are plain string
385
+ * arrays; `params` is an inline object. Falls back to a JSON string for any
386
+ * field that TOML can't represent natively (mirrors operations'
387
+ * `definition` / `params` fallback), so an exotic `params` shape never
388
+ * breaks serialization.
389
+ */
390
+ function buildSubscriptionRows(subscriptions, log) {
391
+ if (!Array.isArray(subscriptions) || subscriptions.length === 0)
392
+ return [];
393
+ return subscriptions.map((sub) => {
394
+ const row = {
395
+ subscriptionKey: sub.subscriptionKey,
396
+ displayName: sub.displayName,
397
+ modelName: sub.modelName,
398
+ };
399
+ if (sub.description != null && sub.description !== "") {
400
+ row.description = sub.description;
401
+ }
402
+ if (sub.filter != null) {
403
+ row.filter = sub.filter;
404
+ }
405
+ if (sub.access != null) {
406
+ row.access = sub.access;
407
+ }
408
+ // `select` / `emit`: server sanitizes to arrays (or null). Emit when a
409
+ // non-empty array is present.
410
+ if (Array.isArray(sub.select) && sub.select.length > 0) {
411
+ row.select = sub.select;
412
+ }
413
+ if (Array.isArray(sub.emit) && sub.emit.length > 0) {
414
+ row.emit = sub.emit;
415
+ }
416
+ // `params`: server sanitizes to an object (or {}). Emit when non-empty.
417
+ if (sub.params &&
418
+ typeof sub.params === "object" &&
419
+ !Array.isArray(sub.params) &&
420
+ Object.keys(sub.params).length > 0) {
421
+ const reason = canEmitNative(sub.params);
422
+ if (reason) {
423
+ log(`Subscription '${sub.subscriptionKey}': cannot emit \`params\` as native TOML (${reason}); falling back to JSON string.`);
424
+ row.params = JSON.stringify(sub.params);
425
+ }
426
+ else {
427
+ row.params = sub.params;
428
+ }
429
+ }
430
+ // `status`: only emit when not the default "active" so round-tripped
431
+ // files stay clean.
432
+ if (sub.status && sub.status !== "active") {
433
+ row.status = sub.status;
434
+ }
435
+ return row;
436
+ });
437
+ }
438
+ function safeParseJson(s) {
439
+ try {
440
+ return JSON.parse(s);
441
+ }
442
+ catch {
443
+ return s;
444
+ }
445
+ }
446
+ /**
447
+ * Thrown when a `[[subscriptions]]` block declares both `accessRule` and
448
+ * `access` with different values. We never silently drop the field
449
+ * (issue #803 maintainer decision): prefer `access` when they agree, error
450
+ * when they conflict so the operator fixes the source of truth.
451
+ */
452
+ export class SubscriptionAccessKeyConflictError extends Error {
453
+ subscriptionKey;
454
+ constructor(subscriptionKey) {
455
+ super(`Subscription ${subscriptionKey ? `'${subscriptionKey}' ` : ""}declares both \`access\` and \`accessRule\` with different values. ` +
456
+ `Use one (prefer \`access\`, the wire/server key) or make them identical.`);
457
+ this.subscriptionKey = subscriptionKey;
458
+ this.name = "SubscriptionAccessKeyConflictError";
459
+ }
460
+ }
461
+ /**
462
+ * Resolve the subscription `access` CEL expression from a TOML row.
463
+ *
464
+ * The server's wire key is `access`; the issue author (and the guides) used
465
+ * `accessRule`. We accept both: prefer `access` when present, fall back to
466
+ * `accessRule`, and never silently drop the field. If both are present with
467
+ * different values, throw so the conflict is surfaced rather than guessed.
468
+ */
469
+ export function resolveSubscriptionAccess(sub) {
470
+ const hasAccess = sub.access !== undefined && sub.access !== null;
471
+ const hasAccessRule = sub.accessRule !== undefined && sub.accessRule !== null;
472
+ if (hasAccess && hasAccessRule && sub.access !== sub.accessRule) {
473
+ throw new SubscriptionAccessKeyConflictError(sub.subscriptionKey);
474
+ }
475
+ if (hasAccess)
476
+ return sub.access;
477
+ if (hasAccessRule)
478
+ return sub.accessRule;
479
+ return undefined;
480
+ }
481
+ /**
482
+ * Normalize a `[[subscriptions]]` TOML row into the server's wire shape.
483
+ *
484
+ * Mirrors `normalizeOperationFromToml`. Maps the `accessRule`→`access`
485
+ * alias (issue #803), and passes `select` / `emit` / `params` through in
486
+ * native form — the server stores them as JSON strings and re-parses on
487
+ * read (`sanitizeSubscription`), so the parse → push → pull round-trip is
488
+ * symmetric with operations' `definition` / `params`.
489
+ *
490
+ * `filter` stays required server-side; we forward whatever is present (or
491
+ * undefined) and let the controller's clean named 400 surface.
492
+ */
493
+ export function normalizeSubscriptionFromToml(sub) {
494
+ const normalized = {
495
+ subscriptionKey: sub.subscriptionKey,
496
+ displayName: sub.displayName,
497
+ modelName: sub.modelName,
498
+ filter: sub.filter,
499
+ access: resolveSubscriptionAccess(sub),
500
+ };
501
+ // Optional fields are *always* assigned (explicit `null` when absent),
502
+ // mirroring how `normalizeOperationFromToml` always assigns `params`
503
+ // (`= null` when absent). This is load-bearing for the update path: when an
504
+ // operator deletes one of these lines from a `[[subscriptions]]` block and
505
+ // re-pushes, the explicit `null` survives `JSON.stringify` in the PUT body
506
+ // (only `undefined` keys are dropped), passes the controller's
507
+ // `if (body.X !== undefined)` guard, and clears the prior server value.
508
+ // Leaving these `undefined` would silently retain the old server value and
509
+ // re-emit the just-deleted field on the next pull (a spurious diff, and for
510
+ // `select` a tighter-than-intended projection left live).
511
+ normalized.description =
512
+ sub.description !== undefined ? sub.description : null;
513
+ if (sub.status !== undefined) {
514
+ normalized.status = sub.status;
515
+ }
516
+ // `select` / `emit` are plain string arrays in native TOML form. The
517
+ // server validates and JSON-stringifies them; we forward as-is (or `null`
518
+ // to clear a removed line).
519
+ normalized.select = sub.select !== undefined ? sub.select : null;
520
+ normalized.emit = sub.emit !== undefined ? sub.emit : null;
521
+ // `params` accepts either native object form
522
+ // (`{ projectId = { type = "string" } }`) or the array-of-tables form
523
+ // (`[[subscriptions.params]]` rows with a `name` key). Convert array form
524
+ // back to the object the server expects, mirroring operations' params.
525
+ // Always assign (`null` when absent) so a removed `params` clears.
526
+ if (sub.params != null) {
527
+ if (Array.isArray(sub.params)) {
528
+ const obj = {};
529
+ for (const row of sub.params) {
530
+ if (!row || typeof row !== "object" || !row.name)
531
+ continue;
532
+ const { name, ...rest } = row;
533
+ obj[name] = rest;
534
+ }
535
+ normalized.params = obj;
536
+ }
537
+ else if (typeof sub.params === "object") {
538
+ normalized.params = sub.params;
539
+ }
540
+ else {
541
+ normalized.params = null;
542
+ }
543
+ }
544
+ else {
545
+ normalized.params = null;
546
+ }
547
+ return normalized;
548
+ }
549
+ /**
550
+ * After parsing TOML, normalize the `definition` and `params` of each
551
+ * operation row into the JS objects the server expects. Handles both
552
+ * native and legacy forms transparently. The server payload is the
553
+ * source of truth; native TOML is purely a source-control affordance.
554
+ *
555
+ * Mirrors `parseDatabaseTypeToml` in `sync.ts`, but is broken out here
556
+ * so the migrate-toml command can call it without re-implementing.
557
+ */
558
+ export function normalizeOperationFromToml(op) {
559
+ const normalized = {
560
+ name: op.name,
561
+ type: op.type,
562
+ modelName: op.modelName,
563
+ // `access` is optional — when the parent type sets `defaultAccess`,
564
+ // an operation may inherit by omitting this key. Keep null so the
565
+ // server-side controller decides whether to require it.
566
+ access: op.access ?? null,
567
+ };
568
+ if (typeof op.definition === "string") {
569
+ normalized.definition = safeParseJson(op.definition);
570
+ }
571
+ else {
572
+ // Preserve undefined-vs-set parity with the legacy parser by always
573
+ // assigning the key.
574
+ normalized.definition = op.definition;
575
+ }
576
+ if (op.params != null) {
577
+ if (typeof op.params === "string") {
578
+ normalized.params = safeParseJson(op.params);
579
+ }
580
+ else if (Array.isArray(op.params)) {
581
+ // Convert array form back into object form for the server payload.
582
+ const obj = {};
583
+ for (const row of op.params) {
584
+ if (!row || typeof row !== "object" || !row.name)
585
+ continue;
586
+ const { name, ...rest } = row;
587
+ obj[name] = rest;
588
+ }
589
+ normalized.params = obj;
590
+ }
591
+ else if (typeof op.params === "object") {
592
+ normalized.params = op.params;
593
+ }
594
+ }
595
+ else {
596
+ normalized.params = null;
597
+ }
598
+ return normalized;
599
+ }
600
+ //# sourceMappingURL=toml-database-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toml-database-config.js","sourceRoot":"","sources":["../../../src/lib/toml-database-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,IAAI,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,+BAA+B,EAAE,MAAM,2BAA2B,CAAC;AAI5E;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,uBAAuB,CAAC,QAAgB;IACtD,MAAM,OAAO,GAAG,QAAQ,CAAC,SAAS,EAAE,CAAC;IACrC,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC;QAAE,OAAO,QAAQ,CAAC;IACxE,OAAO,QAAQ,CAAC;AAClB,CAAC;AASD;;;;;;;;GAQG;AACH,MAAM,UAAU,4BAA4B,CAAC,OAAe;IAC1D,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACrC,MAAM,UAAU,GAAsF,EAAE,CAAC;IACzG,IAAI,OAAO,GAA2F,IAAI,CAAC;IAC3G,uEAAuE;IACvE,2DAA2D;IAC3D,mEAAmE;IACnE,yEAAyE;IACzE,qEAAqE;IACrE,iDAAiD;IACjD,IAAI,UAAU,GAAG,KAAK,CAAC;IAEvB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