primitive-admin 1.0.48 → 1.0.50

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 (120) hide show
  1. package/README.md +102 -2
  2. package/assets/skill/skills/primitive-platform/SKILL.md +85 -30
  3. package/dist/bin/primitive.d.ts +2 -0
  4. package/dist/bin/primitive.js +66 -1
  5. package/dist/bin/primitive.js.map +1 -1
  6. package/dist/src/commands/admins.d.ts +2 -0
  7. package/dist/src/commands/analytics.d.ts +2 -0
  8. package/dist/src/commands/apps.d.ts +2 -0
  9. package/dist/src/commands/apps.js +20 -0
  10. package/dist/src/commands/apps.js.map +1 -1
  11. package/dist/src/commands/auth.d.ts +2 -0
  12. package/dist/src/commands/blob-buckets.d.ts +2 -0
  13. package/dist/src/commands/catalog.d.ts +2 -0
  14. package/dist/src/commands/collection-type-configs.d.ts +2 -0
  15. package/dist/src/commands/collections.d.ts +2 -0
  16. package/dist/src/commands/comparisons.d.ts +2 -0
  17. package/dist/src/commands/cron-triggers.d.ts +2 -0
  18. package/dist/src/commands/cron-triggers.js +8 -15
  19. package/dist/src/commands/cron-triggers.js.map +1 -1
  20. package/dist/src/commands/database-types.d.ts +2 -0
  21. package/dist/src/commands/databases.d.ts +2 -0
  22. package/dist/src/commands/databases.js +31 -0
  23. package/dist/src/commands/databases.js.map +1 -1
  24. package/dist/src/commands/documents.d.ts +2 -0
  25. package/dist/src/commands/email-templates.d.ts +2 -0
  26. package/dist/src/commands/env.d.ts +12 -0
  27. package/dist/src/commands/group-type-configs.d.ts +2 -0
  28. package/dist/src/commands/groups.d.ts +2 -0
  29. package/dist/src/commands/guides.d.ts +84 -0
  30. package/dist/src/commands/guides.js +201 -24
  31. package/dist/src/commands/guides.js.map +1 -1
  32. package/dist/src/commands/init.d.ts +17 -0
  33. package/dist/src/commands/init.js +63 -25
  34. package/dist/src/commands/init.js.map +1 -1
  35. package/dist/src/commands/integrations.d.ts +2 -0
  36. package/dist/src/commands/integrations.js +22 -5
  37. package/dist/src/commands/integrations.js.map +1 -1
  38. package/dist/src/commands/llm.d.ts +2 -0
  39. package/dist/src/commands/prompts.d.ts +2 -0
  40. package/dist/src/commands/rule-sets.d.ts +2 -0
  41. package/dist/src/commands/secrets.d.ts +2 -0
  42. package/dist/src/commands/skill.d.ts +2 -0
  43. package/dist/src/commands/sync.d.ts +113 -0
  44. package/dist/src/commands/sync.js +366 -12
  45. package/dist/src/commands/sync.js.map +1 -1
  46. package/dist/src/commands/tokens.d.ts +2 -0
  47. package/dist/src/commands/tokens.js +104 -1
  48. package/dist/src/commands/tokens.js.map +1 -1
  49. package/dist/src/commands/users.d.ts +2 -0
  50. package/dist/src/commands/waitlist.d.ts +2 -0
  51. package/dist/src/commands/waitlist.js +1 -1
  52. package/dist/src/commands/waitlist.js.map +1 -1
  53. package/dist/src/commands/webhooks.d.ts +2 -0
  54. package/dist/src/commands/workflows.d.ts +49 -0
  55. package/dist/src/commands/workflows.js +74 -21
  56. package/dist/src/commands/workflows.js.map +1 -1
  57. package/dist/src/lib/api-client.d.ts +1244 -0
  58. package/dist/src/lib/api-client.js +30 -0
  59. package/dist/src/lib/api-client.js.map +1 -1
  60. package/dist/src/lib/auth-flow.d.ts +8 -0
  61. package/dist/src/lib/cli-manifest.d.ts +60 -0
  62. package/dist/src/lib/cli-manifest.js +70 -0
  63. package/dist/src/lib/cli-manifest.js.map +1 -0
  64. package/dist/src/lib/config.d.ts +37 -0
  65. package/dist/src/lib/confirm-prompt.d.ts +66 -0
  66. package/dist/src/lib/confirm-prompt.js +85 -0
  67. package/dist/src/lib/confirm-prompt.js.map +1 -0
  68. package/dist/src/lib/constants.d.ts +2 -0
  69. package/dist/src/lib/crash-handlers.d.ts +20 -0
  70. package/dist/src/lib/crash-handlers.js +49 -0
  71. package/dist/src/lib/crash-handlers.js.map +1 -0
  72. package/dist/src/lib/credentials-store.d.ts +79 -0
  73. package/dist/src/lib/csv.d.ts +48 -0
  74. package/dist/src/lib/db-codegen/dbFingerprint.d.ts +10 -0
  75. package/dist/src/lib/db-codegen/dbGenerator.d.ts +111 -0
  76. package/dist/src/lib/db-codegen/dbNaming.d.ts +45 -0
  77. package/dist/src/lib/db-codegen/dbTemplates.d.ts +97 -0
  78. package/dist/src/lib/db-codegen/dbTemplates.js +31 -10
  79. package/dist/src/lib/db-codegen/dbTemplates.js.map +1 -1
  80. package/dist/src/lib/db-codegen/dbTsTypes.d.ts +78 -0
  81. package/dist/src/lib/db-codegen/dbTsTypes.js +2 -2
  82. package/dist/src/lib/db-codegen/dbTsTypes.js.map +1 -1
  83. package/dist/src/lib/env-resolver.d.ts +62 -0
  84. package/dist/src/lib/fetch.d.ts +5 -0
  85. package/dist/src/lib/init-config.d.ts +46 -0
  86. package/dist/src/lib/init-config.js +7 -0
  87. package/dist/src/lib/init-config.js.map +1 -1
  88. package/dist/src/lib/migration-nag.d.ts +49 -0
  89. package/dist/src/lib/output.d.ts +49 -0
  90. package/dist/src/lib/output.js +25 -1
  91. package/dist/src/lib/output.js.map +1 -1
  92. package/dist/src/lib/paginate.d.ts +33 -0
  93. package/dist/src/lib/project-config.d.ts +97 -0
  94. package/dist/src/lib/refresh-admin-credentials.d.ts +65 -0
  95. package/dist/src/lib/resolve-platform.d.ts +45 -0
  96. package/dist/src/lib/resolve-platform.js +43 -0
  97. package/dist/src/lib/resolve-platform.js.map +1 -0
  98. package/dist/src/lib/skill-installer.d.ts +23 -0
  99. package/dist/src/lib/snapshots.d.ts +99 -0
  100. package/dist/src/lib/snapshots.js +357 -0
  101. package/dist/src/lib/snapshots.js.map +1 -0
  102. package/dist/src/lib/sync-paths.d.ts +72 -0
  103. package/dist/src/lib/sync-paths.js +29 -1
  104. package/dist/src/lib/sync-paths.js.map +1 -1
  105. package/dist/src/lib/template.d.ts +93 -0
  106. package/dist/src/lib/token-inject.d.ts +56 -0
  107. package/dist/src/lib/token-inject.js +204 -0
  108. package/dist/src/lib/token-inject.js.map +1 -0
  109. package/dist/src/lib/toml-database-config.d.ts +132 -0
  110. package/dist/src/lib/toml-params-validator.d.ts +95 -0
  111. package/dist/src/lib/version-check.d.ts +10 -0
  112. package/dist/src/lib/workflow-fragments.d.ts +41 -0
  113. package/dist/src/lib/workflow-toml-validator.d.ts +86 -0
  114. package/dist/src/lib/workflow-toml-validator.js +31 -1
  115. package/dist/src/lib/workflow-toml-validator.js.map +1 -1
  116. package/dist/src/types/index.d.ts +513 -0
  117. package/dist/src/validators.d.ts +64 -0
  118. package/dist/src/validators.js +63 -0
  119. package/dist/src/validators.js.map +1 -0
  120. package/package.json +8 -2
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Public subpath export: `primitive-admin/validators` (issue #983).
3
+ *
4
+ * Re-exports the TOML validators that `sync push` runs as its load-bearing
5
+ * gate, so external tooling (e.g. `primitive-docs`) can validate the exact
6
+ * same way the published CLI does — instead of re-implementing the parse /
7
+ * expand / validate flow against submodule source and silently drifting.
8
+ *
9
+ * Two kinds of entry points are exported:
10
+ *
11
+ * 1. `validateWorkflowTomlSource(raw, filePath)` — the **source-level**
12
+ * wrapper. Runs the identical parse → fragment-expand → validate → format
13
+ * path that `sync push` runs for workflow TOML (`cli/src/commands/sync.ts`:
14
+ * `parseTomlFile()` → `validateWorkflowToml()` → `formatWorkflowTomlErrors()`).
15
+ * Use this when you have the raw TOML string and want zero divergence from
16
+ * `sync push`, including `include` fragment expansion.
17
+ *
18
+ * 2. The raw validators (`validateWorkflowToml`, `validateOperations`) and
19
+ * their formatters (`formatWorkflowTomlErrors`, `formatIssue`). These are
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
23
+ * no coupling on a specific TOML parser version; pass whatever parsed
24
+ * object/operations[] you already have.
25
+ *
26
+ * Internal helpers (`collectParamRefs`, `declaredParamNames`,
27
+ * `locateOperationLine`) are intentionally NOT exported — they are
28
+ * implementation details of `validateOperations`.
29
+ */
30
+ import * as TOML from "@iarna/toml";
31
+ import { validateWorkflowToml, formatWorkflowTomlErrors, } from "./lib/workflow-toml-validator.js";
32
+ import { expandWorkflowTomlData } from "./lib/workflow-fragments.js";
33
+ export { validateWorkflowToml, formatWorkflowTomlErrors, } from "./lib/workflow-toml-validator.js";
34
+ export { validateOperations, formatIssue, } from "./lib/toml-params-validator.js";
35
+ /**
36
+ * Validate a workflow TOML **source string** the exact way `sync push` does.
37
+ *
38
+ * Runs the identical pipeline `sync push` runs on every workflow file:
39
+ * `TOML.parse(raw)` → `expandWorkflowTomlData(parsed, filePath)`
40
+ * → `validateWorkflowToml(expanded)` → `formatWorkflowTomlErrors(...)`.
41
+ *
42
+ * The `include` fragment expansion resolves fragments relative to
43
+ * `<filePath>/../../workflow-fragments/` — pass the real (or intended) on-disk
44
+ * path of the workflow so fragment resolution matches `sync push`. If the
45
+ * source uses no `include` key the expander is a no-op and `filePath` is only
46
+ * used for error attribution.
47
+ *
48
+ * @param raw The raw workflow TOML source string.
49
+ * @param filePath The workflow's file path (used for fragment resolution and
50
+ * error attribution).
51
+ * @returns `{ errors, formatted }` — `errors` is empty and `formatted` is
52
+ * `null` when the source is valid.
53
+ */
54
+ export function validateWorkflowTomlSource(raw, filePath) {
55
+ const parsed = TOML.parse(raw);
56
+ const expanded = expandWorkflowTomlData(parsed, filePath);
57
+ const errors = validateWorkflowToml(expanded);
58
+ return {
59
+ errors,
60
+ formatted: errors.length > 0 ? formatWorkflowTomlErrors(filePath, errors) : null,
61
+ };
62
+ }
63
+ //# sourceMappingURL=validators.js.map
@@ -0,0 +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"}
package/package.json CHANGED
@@ -1,11 +1,17 @@
1
1
  {
2
2
  "name": "primitive-admin",
3
- "version": "1.0.48",
3
+ "version": "1.0.50",
4
4
  "description": "CLI for administering Primitive applications",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "primitive": "dist/bin/primitive.js"
8
8
  },
9
+ "exports": {
10
+ "./validators": {
11
+ "types": "./dist/src/validators.d.ts",
12
+ "import": "./dist/src/validators.js"
13
+ }
14
+ },
9
15
  "files": [
10
16
  "dist/",
11
17
  "assets/",
@@ -43,7 +49,7 @@
43
49
  "chalk": "^5.3.0",
44
50
  "commander": "^12.1.0",
45
51
  "inquirer": "^9.2.12",
46
- "js-bao": "^0.5.0",
52
+ "js-bao": "^0.5.1",
47
53
  "mime-types": "^2.1.35",
48
54
  "open": "^10.0.3",
49
55
  "tar": "^7.5.11",