primitive-admin 1.0.52 → 1.0.54

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 (141) hide show
  1. package/README.md +38 -10
  2. package/dist/bin/primitive.js +6 -0
  3. package/dist/bin/primitive.js.map +1 -1
  4. package/dist/src/commands/auth.js +16 -6
  5. package/dist/src/commands/auth.js.map +1 -1
  6. package/dist/src/commands/blob-buckets.js +84 -7
  7. package/dist/src/commands/blob-buckets.js.map +1 -1
  8. package/dist/src/commands/catalog.js +3 -3
  9. package/dist/src/commands/catalog.js.map +1 -1
  10. package/dist/src/commands/collections.js +12 -9
  11. package/dist/src/commands/collections.js.map +1 -1
  12. package/dist/src/commands/database-types.js +11 -1
  13. package/dist/src/commands/database-types.js.map +1 -1
  14. package/dist/src/commands/databases.js +197 -74
  15. package/dist/src/commands/databases.js.map +1 -1
  16. package/dist/src/commands/group-type-configs.js +1 -9
  17. package/dist/src/commands/group-type-configs.js.map +1 -1
  18. package/dist/src/commands/groups.js +12 -6
  19. package/dist/src/commands/groups.js.map +1 -1
  20. package/dist/src/commands/guides.d.ts +161 -0
  21. package/dist/src/commands/guides.js +502 -84
  22. package/dist/src/commands/guides.js.map +1 -1
  23. package/dist/src/commands/init.js +77 -45
  24. package/dist/src/commands/init.js.map +1 -1
  25. package/dist/src/commands/integrations.js +2 -2
  26. package/dist/src/commands/integrations.js.map +1 -1
  27. package/dist/src/commands/metadata.d.ts +2 -0
  28. package/dist/src/commands/metadata.js +344 -0
  29. package/dist/src/commands/metadata.js.map +1 -0
  30. package/dist/src/commands/prompts.js +2 -2
  31. package/dist/src/commands/prompts.js.map +1 -1
  32. package/dist/src/commands/rule-sets.d.ts +1 -0
  33. package/dist/src/commands/rule-sets.js +25 -3
  34. package/dist/src/commands/rule-sets.js.map +1 -1
  35. package/dist/src/commands/scripts.d.ts +2 -0
  36. package/dist/src/commands/scripts.js +667 -0
  37. package/dist/src/commands/scripts.js.map +1 -0
  38. package/dist/src/commands/sync.d.ts +212 -16
  39. package/dist/src/commands/sync.js +1688 -287
  40. package/dist/src/commands/sync.js.map +1 -1
  41. package/dist/src/commands/vars.d.ts +8 -0
  42. package/dist/src/commands/vars.js +110 -0
  43. package/dist/src/commands/vars.js.map +1 -0
  44. package/dist/src/commands/webhooks.js +17 -3
  45. package/dist/src/commands/webhooks.js.map +1 -1
  46. package/dist/src/commands/workflows.d.ts +30 -0
  47. package/dist/src/commands/workflows.js +651 -52
  48. package/dist/src/commands/workflows.js.map +1 -1
  49. package/dist/src/lib/api-client.d.ts +123 -19
  50. package/dist/src/lib/api-client.js +128 -4
  51. package/dist/src/lib/api-client.js.map +1 -1
  52. package/dist/src/lib/batch.d.ts +26 -0
  53. package/dist/src/lib/batch.js +32 -0
  54. package/dist/src/lib/batch.js.map +1 -0
  55. package/dist/src/lib/block-layout.d.ts +160 -0
  56. package/dist/src/lib/block-layout.js +451 -0
  57. package/dist/src/lib/block-layout.js.map +1 -0
  58. package/dist/src/lib/codegen-shared/generatedFiles.d.ts +61 -0
  59. package/dist/src/lib/codegen-shared/generatedFiles.js +127 -0
  60. package/dist/src/lib/codegen-shared/generatedFiles.js.map +1 -0
  61. package/dist/src/lib/codegen-shared/resolveCodegenSourceDir.d.ts +68 -0
  62. package/dist/src/lib/codegen-shared/resolveCodegenSourceDir.js +168 -0
  63. package/dist/src/lib/codegen-shared/resolveCodegenSourceDir.js.map +1 -0
  64. package/dist/src/lib/config-toml.d.ts +10 -0
  65. package/dist/src/lib/config-toml.js +42 -0
  66. package/dist/src/lib/config-toml.js.map +1 -0
  67. package/dist/src/lib/config.d.ts +16 -0
  68. package/dist/src/lib/config.js +41 -0
  69. package/dist/src/lib/config.js.map +1 -1
  70. package/dist/src/lib/constants.d.ts +9 -0
  71. package/dist/src/lib/constants.js +9 -0
  72. package/dist/src/lib/constants.js.map +1 -1
  73. package/dist/src/lib/csv.d.ts +1 -2
  74. package/dist/src/lib/csv.js +3 -8
  75. package/dist/src/lib/csv.js.map +1 -1
  76. package/dist/src/lib/db-codegen/dbGenerator.d.ts +35 -7
  77. package/dist/src/lib/db-codegen/dbGenerator.js +384 -125
  78. package/dist/src/lib/db-codegen/dbGenerator.js.map +1 -1
  79. package/dist/src/lib/db-codegen/dbNaming.d.ts +29 -0
  80. package/dist/src/lib/db-codegen/dbNaming.js +58 -0
  81. package/dist/src/lib/db-codegen/dbNaming.js.map +1 -1
  82. package/dist/src/lib/db-codegen/dbTemplates.d.ts +114 -5
  83. package/dist/src/lib/db-codegen/dbTemplates.js +163 -16
  84. package/dist/src/lib/db-codegen/dbTemplates.js.map +1 -1
  85. package/dist/src/lib/db-codegen/dbTsTypes.d.ts +7 -3
  86. package/dist/src/lib/db-codegen/dbTsTypes.js +23 -1
  87. package/dist/src/lib/db-codegen/dbTsTypes.js.map +1 -1
  88. package/dist/src/lib/generated-allowlist.js +52 -0
  89. package/dist/src/lib/generated-allowlist.js.map +1 -1
  90. package/dist/src/lib/init-config.d.ts +13 -0
  91. package/dist/src/lib/init-config.js +21 -2
  92. package/dist/src/lib/init-config.js.map +1 -1
  93. package/dist/src/lib/output.d.ts +42 -5
  94. package/dist/src/lib/output.js +70 -4
  95. package/dist/src/lib/output.js.map +1 -1
  96. package/dist/src/lib/query-operators.d.ts +43 -0
  97. package/dist/src/lib/query-operators.js +80 -0
  98. package/dist/src/lib/query-operators.js.map +1 -0
  99. package/dist/src/lib/template.d.ts +9 -5
  100. package/dist/src/lib/template.js +58 -45
  101. package/dist/src/lib/template.js.map +1 -1
  102. package/dist/src/lib/toml-database-config.d.ts +10 -19
  103. package/dist/src/lib/toml-database-config.js +28 -59
  104. package/dist/src/lib/toml-database-config.js.map +1 -1
  105. package/dist/src/lib/toml-metadata-config.d.ts +147 -0
  106. package/dist/src/lib/toml-metadata-config.js +463 -0
  107. package/dist/src/lib/toml-metadata-config.js.map +1 -0
  108. package/dist/src/lib/toml-native-form.d.ts +46 -0
  109. package/dist/src/lib/toml-native-form.js +78 -0
  110. package/dist/src/lib/toml-native-form.js.map +1 -0
  111. package/dist/src/lib/toml-params-validator.d.ts +34 -0
  112. package/dist/src/lib/toml-params-validator.js +118 -3
  113. package/dist/src/lib/toml-params-validator.js.map +1 -1
  114. package/dist/src/lib/workflow-apply.d.ts +86 -0
  115. package/dist/src/lib/workflow-apply.js +127 -0
  116. package/dist/src/lib/workflow-apply.js.map +1 -0
  117. package/dist/src/lib/workflow-codegen/generated-schema-descriptor.d.ts +129 -0
  118. package/dist/src/lib/workflow-codegen/generated-schema-descriptor.js +269 -0
  119. package/dist/src/lib/workflow-codegen/generated-schema-descriptor.js.map +1 -0
  120. package/dist/src/lib/workflow-codegen/generator.d.ts +74 -0
  121. package/dist/src/lib/workflow-codegen/generator.js +215 -0
  122. package/dist/src/lib/workflow-codegen/generator.js.map +1 -0
  123. package/dist/src/lib/workflow-codegen/naming.d.ts +33 -0
  124. package/dist/src/lib/workflow-codegen/naming.js +81 -0
  125. package/dist/src/lib/workflow-codegen/naming.js.map +1 -0
  126. package/dist/src/lib/workflow-codegen/schemaToTs.d.ts +64 -0
  127. package/dist/src/lib/workflow-codegen/schemaToTs.js +282 -0
  128. package/dist/src/lib/workflow-codegen/schemaToTs.js.map +1 -0
  129. package/dist/src/lib/workflow-fragments.js +3 -3
  130. package/dist/src/lib/workflow-fragments.js.map +1 -1
  131. package/dist/src/lib/workflow-payload.d.ts +68 -0
  132. package/dist/src/lib/workflow-payload.js +150 -0
  133. package/dist/src/lib/workflow-payload.js.map +1 -0
  134. package/dist/src/lib/workflow-toml-validator.d.ts +1 -1
  135. package/dist/src/lib/workflow-toml-validator.js +37 -1
  136. package/dist/src/lib/workflow-toml-validator.js.map +1 -1
  137. package/dist/src/types/index.d.ts +11 -0
  138. package/dist/src/validators.d.ts +4 -3
  139. package/dist/src/validators.js +6 -5
  140. package/dist/src/validators.js.map +1 -1
  141. package/package.json +5 -3
@@ -0,0 +1,150 @@
1
+ /**
2
+ * Shared TOML → workflow-payload builder (#1177).
3
+ *
4
+ * Background: the CLI built the create/update workflow payload in THREE
5
+ * separate hand-enumerated literals — `workflows create --from-file`
6
+ * (`cli/src/commands/workflows.ts`), the `sync push` create branch
7
+ * (`cli/src/commands/sync.ts`), and the `sync push` update branch (the metadata
8
+ * PATCH in `cli/src/lib/workflow-apply.ts`). Because each site listed the
9
+ * `[workflow]` fields by hand, they drifted apart: a field added to one path was
10
+ * silently dropped by the others. `status` was the 4th field lost this way
11
+ * (after `syncCallable` #807, `accessRule` #571, `runAs` #1081); the audit also
12
+ * found `capabilities` (#1172) and `perAppMaxRunning` / `perAppMaxQueued` /
13
+ * `queueTtlSeconds` dropped from at least one path.
14
+ *
15
+ * The fix: one shared builder that owns the `[workflow]`-derived field list.
16
+ * All three call-sites spread its output; only the per-field presence coalescing
17
+ * and the create-only `syncCallable` inclusion differ by `mode`, so the field
18
+ * list itself lives in exactly one place and can't drift again. A unit
19
+ * drift-guard asserts the builder's key set (see
20
+ * `cli/tests/unit/workflow-payload-fields.test.ts`).
21
+ *
22
+ * What the builder does NOT own (structural / call-site-specific wiring the
23
+ * callers still attach): `workflowKey`, `steps`, and the `metadataManifest`
24
+ * declared-access manifest (#1304) — the sync paths always attach it, create
25
+ * --from-file never does.
26
+ *
27
+ * Presence semantics, by mode:
28
+ * - create: optional strings coalesce absent/empty → `undefined` (omit; the
29
+ * server default applies). `capabilities` forwards the raw array (absent →
30
+ * omit). Schemas omit when absent.
31
+ * - update: optional strings distinguish explicit-clear from leave-unset via
32
+ * `x !== undefined ? (x || null) : undefined`. `status` forwards the bare
33
+ * value (matching the server's hasOwnProperty path). Schemas send `null`
34
+ * when absent so a cleared schema round-trips.
35
+ * - booleans (`requiresClientApply`, and `syncCallable` on create) are raw
36
+ * pass-through so an explicit `false` is preserved and only a truly-absent
37
+ * key drops.
38
+ * - `syncCallable` is OMITTED in `mode: "update"`: the server re-validates
39
+ * `syncCallable: true` against the CURRENTLY-active steps, so the update
40
+ * path must send it as a deferred second PATCH after the new steps are live
41
+ * (#807). `applyWorkflowBody` owns that second PATCH.
42
+ */
43
+ /**
44
+ * Parse a JSON schema field that TOML may present as a string OR (for an inline
45
+ * table) as an already-parsed object. Kept here in `cli/src/lib` so the builder
46
+ * owns its own parse decision rather than importing back into a command module
47
+ * (#1177 dependency-direction decision).
48
+ */
49
+ export function safeJsonParse(value) {
50
+ if (value === undefined || value === null)
51
+ return undefined;
52
+ if (typeof value === "string")
53
+ return JSON.parse(value);
54
+ return value; // Already an object (TOML parsed it as a table)
55
+ }
56
+ /**
57
+ * The `[workflow]`-derived keys the builder emits, per mode. Exported so the
58
+ * drift-guard unit test can assert the key set hasn't silently lost a field —
59
+ * the recurring bug class this builder closes. `update` omits `syncCallable`
60
+ * (deferred second PATCH, #807); everything else is shared.
61
+ */
62
+ export const WORKFLOW_PAYLOAD_FIELDS_CREATE = [
63
+ "name",
64
+ "description",
65
+ "status",
66
+ "accessRule",
67
+ "runAs",
68
+ "capabilities",
69
+ "perUserMaxRunning",
70
+ "perUserMaxQueued",
71
+ "perAppMaxRunning",
72
+ "perAppMaxQueued",
73
+ "queueTtlSeconds",
74
+ "dequeueOrder",
75
+ "requiresClientApply",
76
+ "inputSchema",
77
+ "outputSchema",
78
+ "syncCallable",
79
+ ];
80
+ export const WORKFLOW_PAYLOAD_FIELDS_UPDATE = WORKFLOW_PAYLOAD_FIELDS_CREATE.filter((f) => f !== "syncCallable");
81
+ /**
82
+ * Build the workflow payload's `[workflow]`-derived fields from a parsed TOML
83
+ * `[workflow]` table. `workflow` is `tomlData.workflow` (already merged with any
84
+ * explicit CLI flag overrides by the caller). Callers spread the result into
85
+ * the create/update payload and attach the structural fields themselves
86
+ * (`workflowKey`, `steps`, `metadataManifest`).
87
+ */
88
+ export function buildWorkflowPayloadFromToml(workflow, { mode }) {
89
+ const create = mode === "create";
90
+ const payload = {
91
+ name: workflow.name,
92
+ description: workflow.description,
93
+ // status — create coalesces absent/empty → omit (server default `draft`
94
+ // applies); update forwards the bare value so it round-trips and an
95
+ // explicit "" surfaces the server's validation error rather than a silent
96
+ // no-op (matches the pre-existing update path).
97
+ status: create ? workflow.status || undefined : workflow.status,
98
+ // accessRule / runAs — create coalesces absent/empty → omit; update
99
+ // distinguishes explicit clear ("" → null) from leave-unset (absent →
100
+ // undefined).
101
+ accessRule: create
102
+ ? workflow.accessRule || undefined
103
+ : workflow.accessRule !== undefined
104
+ ? workflow.accessRule || null
105
+ : undefined,
106
+ runAs: create
107
+ ? workflow.runAs || undefined
108
+ : workflow.runAs !== undefined
109
+ ? workflow.runAs || null
110
+ : undefined,
111
+ // capabilities — create forwards the raw array (absent → omit); update
112
+ // forwards presence-aware so an explicit array round-trips. (The server
113
+ // update PATCH persist for capabilities is tracked separately in #1232; the
114
+ // round-trip guard asserts capabilities on the create leg only.)
115
+ capabilities: create
116
+ ? workflow.capabilities
117
+ : workflow.capabilities !== undefined
118
+ ? workflow.capabilities
119
+ : undefined,
120
+ // Queue limits — raw numeric pass-through both modes (absent → omit).
121
+ perUserMaxRunning: workflow.perUserMaxRunning,
122
+ perUserMaxQueued: workflow.perUserMaxQueued,
123
+ perAppMaxRunning: workflow.perAppMaxRunning,
124
+ perAppMaxQueued: workflow.perAppMaxQueued,
125
+ queueTtlSeconds: workflow.queueTtlSeconds,
126
+ dequeueOrder: workflow.dequeueOrder,
127
+ // requiresClientApply — raw boolean pass-through so an explicit `false` is
128
+ // preserved and only a truly-absent key drops (server default applies).
129
+ requiresClientApply: workflow.requiresClientApply,
130
+ // Schemas — parse a JSON string (or accept an inline table). Create omits
131
+ // when absent; update sends null so a cleared schema round-trips.
132
+ inputSchema: workflow.inputSchema
133
+ ? safeJsonParse(workflow.inputSchema)
134
+ : create
135
+ ? undefined
136
+ : null,
137
+ outputSchema: workflow.outputSchema
138
+ ? safeJsonParse(workflow.outputSchema)
139
+ : create
140
+ ? undefined
141
+ : null,
142
+ };
143
+ // syncCallable — create includes it (raw boolean pass-through); update omits
144
+ // it (deferred second PATCH, #807 — see module doc).
145
+ if (create) {
146
+ payload.syncCallable = workflow.syncCallable;
147
+ }
148
+ return payload;
149
+ }
150
+ //# sourceMappingURL=workflow-payload.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow-payload.js","sourceRoot":"","sources":["../../../src/lib/workflow-payload.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAIH;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,KAAU;IACtC,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,SAAS,CAAC;IAC5D,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACxD,OAAO,KAAK,CAAC,CAAC,gDAAgD;AAChE,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG;IAC5C,MAAM;IACN,aAAa;IACb,QAAQ;IACR,YAAY;IACZ,OAAO;IACP,cAAc;IACd,mBAAmB;IACnB,kBAAkB;IAClB,kBAAkB;IAClB,iBAAiB;IACjB,iBAAiB;IACjB,cAAc;IACd,qBAAqB;IACrB,aAAa;IACb,cAAc;IACd,cAAc;CACN,CAAC;AAEX,MAAM,CAAC,MAAM,8BAA8B,GAAG,8BAA8B,CAAC,MAAM,CACjF,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,cAAc,CACH,CAAC;AAE3B;;;;;;GAMG;AACH,MAAM,UAAU,4BAA4B,CAC1C,QAAa,EACb,EAAE,IAAI,EAAiC;IAEvC,MAAM,MAAM,GAAG,IAAI,KAAK,QAAQ,CAAC;IAEjC,MAAM,OAAO,GAAwB;QACnC,IAAI,EAAE,QAAQ,CAAC,IAAI;QACnB,WAAW,EAAE,QAAQ,CAAC,WAAW;QACjC,wEAAwE;QACxE,oEAAoE;QACpE,0EAA0E;QAC1E,gDAAgD;QAChD,MAAM,EAAE,MAAM,CAAC,CAAC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C,CAAC,SAAS;gBACX,CAAC,CAAC,IAAI;QACV,YAAY,EAAE,QAAQ,CAAC,YAAY;YACjC,CAAC,CAAC,aAAa,CAAC,QAAQ,CAAC,YAAY,CAAC;YACtC,CAAC,CAAC,MAAM;gBACN,CAAC,CAAC,SAAS;gBACX,CAAC,CAAC,IAAI;KACX,CAAC;IAEF,6EAA6E;IAC7E,qDAAqD;IACrD,IAAI,MAAM,EAAE,CAAC;QACX,OAAO,CAAC,YAAY,GAAG,QAAQ,CAAC,YAAY,CAAC;IAC/C,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -73,7 +73,7 @@ export type WorkflowTomlError = {
73
73
  /**
74
74
  * Walk a parsed workflow TOML document and return all unknown-field errors.
75
75
  *
76
- * @param tomlData The output of `TOML.parse()` for a workflow TOML file.
76
+ * @param tomlData The output of `parseConfigToml()` for a workflow TOML file.
77
77
  * @returns An array of error objects, one per offending field. Empty if no
78
78
  * errors were found.
79
79
  */
@@ -60,7 +60,7 @@ export const KNOWN_KINDS_FOR_DRIFT_GUARD = KNOWN_KINDS;
60
60
  /**
61
61
  * Walk a parsed workflow TOML document and return all unknown-field errors.
62
62
  *
63
- * @param tomlData The output of `TOML.parse()` for a workflow TOML file.
63
+ * @param tomlData The output of `parseConfigToml()` for a workflow TOML file.
64
64
  * @returns An array of error objects, one per offending field. Empty if no
65
65
  * errors were found.
66
66
  */
@@ -227,6 +227,42 @@ function validateStepObject(step, stepIndex, parentStepId, errors) {
227
227
  parentStepId,
228
228
  });
229
229
  }
230
+ // #1252 — form-urlencoded body conflict. `[steps.request.form]` encodes an
231
+ // `application/x-www-form-urlencoded` body; it cannot coexist with a
232
+ // `request.body` or a raw/multipart `bodyMode`. The runtime rejects the same
233
+ // combination, but catching it at push time gives a clearer, earlier
234
+ // diagnostic. (`request.form` itself needs no allowlist entry — the validator
235
+ // only checks top-level step fields, and `request` is already allowlisted.)
236
+ if (step.kind === "integration.call" &&
237
+ step.request !== null &&
238
+ typeof step.request === "object" &&
239
+ !Array.isArray(step.request)) {
240
+ const req = step.request;
241
+ const hasForm = req.form !== undefined && req.form !== null;
242
+ if (hasForm) {
243
+ if (req.body !== undefined && req.body !== null) {
244
+ errors.push({
245
+ stepIndex,
246
+ stepId,
247
+ field: "request.form",
248
+ hint: "`request.form` (application/x-www-form-urlencoded) cannot be combined with `request.body`. " +
249
+ "Use one request body — either the JSON `body` or the `form` table.",
250
+ parentStepId,
251
+ });
252
+ }
253
+ const mode = step.bodyMode;
254
+ if (mode === "raw" || mode === "multipart") {
255
+ errors.push({
256
+ stepIndex,
257
+ stepId,
258
+ field: "request.form",
259
+ hint: `\`request.form\` (application/x-www-form-urlencoded) cannot be combined with bodyMode "${mode}". ` +
260
+ "Remove `form` or the `bodyMode`.",
261
+ parentStepId,
262
+ });
263
+ }
264
+ }
265
+ }
230
266
  }
231
267
  /**
232
268
  * Render a multi-line diagnostic for a list of errors. Designed for the
@@ -1 +1 @@
1
- {"version":3,"file":"workflow-toml-validator.js","sourceRoot":"","sources":["../../../src/lib/workflow-toml-validator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EACL,4BAA4B,EAC5B,qBAAqB,GACtB,MAAM,0BAA0B,CAAC;AAElC;;;GAGG;AACH,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAS,4BAA4B,CAAC,CAAC;AAEzE;;;;GAIG;AACH,MAAM,WAAW,GAAG,IAAI,GAAG,CAAS,qBAAqB,CAAC,CAAC;AAE3D;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAC7C,kBAAkB,CAAC;AAErB;;;GAGG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAwB,WAAW,CAAC;AA4B5E;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,QAAa;IAChD,MAAM,MAAM,GAAwB,EAAE,CAAC;IAEvC,IAAI,QAAQ,KAAK,IAAI,IAAI,QAAQ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b,CAAC,CAAC,wBAAwB;gBAC1B,CAAC,CAAC,EAAE,CAAC;QACT,KAAK,CAAC,IAAI,CACR,KAAK,IAAI,GAAG,MAAM,GAAG,UAAU,uBAAuB,GAAG,CAAC,KAAK,IAAI,CACpE,CAAC;QACF,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;IAC9B,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
@@ -41,6 +41,9 @@ export interface AppSettings {
41
41
  }> | null;
42
42
  hasPasskey?: boolean;
43
43
  magicLinkEnabled?: boolean;
44
+ appleSignInEnabled?: boolean | null;
45
+ appleAudiences?: string[] | null;
46
+ otpEnabled?: boolean;
44
47
  }
45
48
  export interface User {
46
49
  userId: string;
@@ -481,6 +484,10 @@ export interface SyncState {
481
484
  modifiedAt: string;
482
485
  contentHash?: string;
483
486
  }>;
487
+ vars?: Record<string, {
488
+ modifiedAt: string;
489
+ contentHash?: string;
490
+ }>;
484
491
  groupTypeConfigs?: Record<string, {
485
492
  modifiedAt: string;
486
493
  contentHash?: string;
@@ -489,6 +496,10 @@ export interface SyncState {
489
496
  modifiedAt: string;
490
497
  contentHash?: string;
491
498
  }>;
499
+ metadataCategoryConfigs?: Record<string, {
500
+ modifiedAt: string;
501
+ contentHash?: string;
502
+ }>;
492
503
  webhooks?: Record<string, {
493
504
  id: string;
494
505
  modifiedAt: string;
@@ -18,8 +18,9 @@
18
18
  * 2. The raw validators (`validateWorkflowToml`, `validateOperations`) and
19
19
  * their formatters (`formatWorkflowTomlErrors`, `formatIssue`). These are
20
20
  * **pure functions over already-parsed TOML** — they do not read files or
21
- * parse TOML themselves. The consumer is responsible for parsing (e.g. with
22
- * `@iarna/toml`) and, for workflows, for any `include` expansion. There is
21
+ * parse TOML themselves. The consumer is responsible for parsing (config
22
+ * files via `parseConfigToml`) and, for workflows, for any `include`
23
+ * expansion. There is
23
24
  * no coupling on a specific TOML parser version; pass whatever parsed
24
25
  * object/operations[] you already have.
25
26
  *
@@ -46,7 +47,7 @@ export interface WorkflowTomlSourceResult {
46
47
  * Validate a workflow TOML **source string** the exact way `sync push` does.
47
48
  *
48
49
  * Runs the identical pipeline `sync push` runs on every workflow file:
49
- * `TOML.parse(raw)` → `expandWorkflowTomlData(parsed, filePath)`
50
+ * `parseConfigToml(raw)` → `expandWorkflowTomlData(parsed, filePath)`
50
51
  * → `validateWorkflowToml(expanded)` → `formatWorkflowTomlErrors(...)`.
51
52
  *
52
53
  * The `include` fragment expansion resolves fragments relative to
@@ -18,8 +18,9 @@
18
18
  * 2. The raw validators (`validateWorkflowToml`, `validateOperations`) and
19
19
  * their formatters (`formatWorkflowTomlErrors`, `formatIssue`). These are
20
20
  * **pure functions over already-parsed TOML** — they do not read files or
21
- * parse TOML themselves. The consumer is responsible for parsing (e.g. with
22
- * `@iarna/toml`) and, for workflows, for any `include` expansion. There is
21
+ * parse TOML themselves. The consumer is responsible for parsing (config
22
+ * files via `parseConfigToml`) and, for workflows, for any `include`
23
+ * expansion. There is
23
24
  * no coupling on a specific TOML parser version; pass whatever parsed
24
25
  * object/operations[] you already have.
25
26
  *
@@ -27,7 +28,7 @@
27
28
  * `locateOperationLine`) are intentionally NOT exported — they are
28
29
  * implementation details of `validateOperations`.
29
30
  */
30
- import * as TOML from "@iarna/toml";
31
+ import { parseConfigToml } from "./lib/config-toml.js";
31
32
  import { validateWorkflowToml, formatWorkflowTomlErrors, } from "./lib/workflow-toml-validator.js";
32
33
  import { expandWorkflowTomlData } from "./lib/workflow-fragments.js";
33
34
  export { validateWorkflowToml, formatWorkflowTomlErrors, } from "./lib/workflow-toml-validator.js";
@@ -36,7 +37,7 @@ export { validateOperations, formatIssue, } from "./lib/toml-params-validator.js
36
37
  * Validate a workflow TOML **source string** the exact way `sync push` does.
37
38
  *
38
39
  * Runs the identical pipeline `sync push` runs on every workflow file:
39
- * `TOML.parse(raw)` → `expandWorkflowTomlData(parsed, filePath)`
40
+ * `parseConfigToml(raw)` → `expandWorkflowTomlData(parsed, filePath)`
40
41
  * → `validateWorkflowToml(expanded)` → `formatWorkflowTomlErrors(...)`.
41
42
  *
42
43
  * The `include` fragment expansion resolves fragments relative to
@@ -52,7 +53,7 @@ export { validateOperations, formatIssue, } from "./lib/toml-params-validator.js
52
53
  * `null` when the source is valid.
53
54
  */
54
55
  export function validateWorkflowTomlSource(raw, filePath) {
55
- const parsed = TOML.parse(raw);
56
+ const parsed = parseConfigToml(raw);
56
57
  const expanded = expandWorkflowTomlData(parsed, filePath);
57
58
  const errors = validateWorkflowToml(expanded);
58
59
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"validators.js","sourceRoot":"","sources":["../../src/validators.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,IAAI,MAAM,aAAa,CAAC;AACpC,OAAO,EACL,oBAAoB,EACpB,wBAAwB,GAEzB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,OAAO,EACL,oBAAoB,EACpB,wBAAwB,GAEzB,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EACL,kBAAkB,EAClB,WAAW,GAIZ,MAAM,gCAAgC,CAAC;AAexC;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,0BAA0B,CACxC,GAAW,EACX,QAAgB;IAEhB,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAwB,CAAC;IACtD,MAAM,QAAQ,GAAG,sBAAsB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC1D,MAAM,MAAM,GAAG,oBAAoB,CAAC,QAAQ,CAAC,CAAC;IAC9C,OAAO;QACL,MAAM;QACN,SAAS,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,wBAAwB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI;KACjF,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"validators.js","sourceRoot":"","sources":["../../src/validators.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EACL,oBAAoB,EACpB,wBAAwB,GAEzB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,OAAO,EACL,oBAAoB,EACpB,wBAAwB,GAEzB,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EACL,kBAAkB,EAClB,WAAW,GAIZ,MAAM,gCAAgC,CAAC;AAexC;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,0BAA0B,CACxC,GAAW,EACX,QAAgB;IAEhB,MAAM,MAAM,GAAG,eAAe,CAAC,GAAG,CAAwB,CAAC;IAC3D,MAAM,QAAQ,GAAG,sBAAsB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC1D,MAAM,MAAM,GAAG,oBAAoB,CAAC,QAAQ,CAAC,CAAC;IAC9C,OAAO;QACL,MAAM;QACN,SAAS,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,wBAAwB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI;KACjF,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "primitive-admin",
3
- "version": "1.0.52",
3
+ "version": "1.0.54",
4
4
  "description": "CLI for administering Primitive applications",
5
5
  "type": "module",
6
6
  "bin": {
@@ -20,7 +20,9 @@
20
20
  "scripts": {
21
21
  "gen:allowlist": "node scripts/gen-allowlist.mjs",
22
22
  "gen:allowlist:check": "node scripts/gen-allowlist.mjs --check",
23
- "prebuild": "node scripts/gen-allowlist.mjs",
23
+ "gen:workflow-descriptor": "node scripts/gen-workflow-schema-descriptor.mjs",
24
+ "gen:workflow-descriptor:check": "node scripts/gen-workflow-schema-descriptor.mjs --check",
25
+ "prebuild": "node scripts/gen-allowlist.mjs && node scripts/gen-workflow-schema-descriptor.mjs",
24
26
  "build": "tsc",
25
27
  "typecheck": "tsc --noEmit",
26
28
  "prepublishOnly": "pnpm run build",
@@ -46,7 +48,6 @@
46
48
  "node": ">=18.0.0"
47
49
  },
48
50
  "dependencies": {
49
- "@iarna/toml": "^2.2.5",
50
51
  "@inquirer/prompts": "^7.5.0",
51
52
  "@inquirer/search": "^4.1.0",
52
53
  "chalk": "^5.3.0",
@@ -55,6 +56,7 @@
55
56
  "js-bao": "^0.5.1",
56
57
  "mime-types": "^2.1.35",
57
58
  "open": "^10.0.3",
59
+ "smol-toml": "1.7.0",
58
60
  "tar": "^7.5.11",
59
61
  "ulid": "^2.4.0"
60
62
  },