primitive-admin 1.0.49 → 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.
- package/README.md +102 -2
- package/assets/skill/skills/primitive-platform/SKILL.md +85 -30
- package/dist/bin/primitive.d.ts +2 -0
- package/dist/bin/primitive.js +66 -1
- package/dist/bin/primitive.js.map +1 -1
- package/dist/src/commands/admins.d.ts +2 -0
- package/dist/src/commands/analytics.d.ts +2 -0
- package/dist/src/commands/apps.d.ts +2 -0
- package/dist/src/commands/apps.js +20 -0
- package/dist/src/commands/apps.js.map +1 -1
- package/dist/src/commands/auth.d.ts +2 -0
- package/dist/src/commands/blob-buckets.d.ts +2 -0
- package/dist/src/commands/catalog.d.ts +2 -0
- package/dist/src/commands/collection-type-configs.d.ts +2 -0
- package/dist/src/commands/collections.d.ts +2 -0
- package/dist/src/commands/comparisons.d.ts +2 -0
- package/dist/src/commands/cron-triggers.d.ts +2 -0
- package/dist/src/commands/cron-triggers.js +8 -15
- package/dist/src/commands/cron-triggers.js.map +1 -1
- package/dist/src/commands/database-types.d.ts +2 -0
- package/dist/src/commands/databases.d.ts +2 -0
- package/dist/src/commands/databases.js +31 -0
- package/dist/src/commands/databases.js.map +1 -1
- package/dist/src/commands/documents.d.ts +2 -0
- package/dist/src/commands/email-templates.d.ts +2 -0
- package/dist/src/commands/env.d.ts +12 -0
- package/dist/src/commands/group-type-configs.d.ts +2 -0
- package/dist/src/commands/groups.d.ts +2 -0
- package/dist/src/commands/guides.d.ts +84 -0
- package/dist/src/commands/guides.js +201 -24
- package/dist/src/commands/guides.js.map +1 -1
- package/dist/src/commands/init.d.ts +17 -0
- package/dist/src/commands/init.js +63 -25
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/integrations.d.ts +2 -0
- package/dist/src/commands/integrations.js +22 -5
- package/dist/src/commands/integrations.js.map +1 -1
- package/dist/src/commands/llm.d.ts +2 -0
- package/dist/src/commands/prompts.d.ts +2 -0
- package/dist/src/commands/rule-sets.d.ts +2 -0
- package/dist/src/commands/secrets.d.ts +2 -0
- package/dist/src/commands/skill.d.ts +2 -0
- package/dist/src/commands/sync.d.ts +113 -0
- package/dist/src/commands/sync.js +366 -12
- package/dist/src/commands/sync.js.map +1 -1
- package/dist/src/commands/tokens.d.ts +2 -0
- package/dist/src/commands/tokens.js +104 -1
- package/dist/src/commands/tokens.js.map +1 -1
- package/dist/src/commands/users.d.ts +2 -0
- package/dist/src/commands/waitlist.d.ts +2 -0
- package/dist/src/commands/waitlist.js +1 -1
- package/dist/src/commands/waitlist.js.map +1 -1
- package/dist/src/commands/webhooks.d.ts +2 -0
- package/dist/src/commands/workflows.d.ts +49 -0
- package/dist/src/commands/workflows.js +74 -21
- package/dist/src/commands/workflows.js.map +1 -1
- package/dist/src/lib/api-client.d.ts +1244 -0
- package/dist/src/lib/api-client.js +30 -0
- package/dist/src/lib/api-client.js.map +1 -1
- package/dist/src/lib/auth-flow.d.ts +8 -0
- package/dist/src/lib/cli-manifest.d.ts +60 -0
- package/dist/src/lib/cli-manifest.js +70 -0
- package/dist/src/lib/cli-manifest.js.map +1 -0
- package/dist/src/lib/config.d.ts +37 -0
- package/dist/src/lib/confirm-prompt.d.ts +66 -0
- package/dist/src/lib/confirm-prompt.js +85 -0
- package/dist/src/lib/confirm-prompt.js.map +1 -0
- package/dist/src/lib/constants.d.ts +2 -0
- package/dist/src/lib/crash-handlers.d.ts +20 -0
- package/dist/src/lib/crash-handlers.js +49 -0
- package/dist/src/lib/crash-handlers.js.map +1 -0
- package/dist/src/lib/credentials-store.d.ts +79 -0
- package/dist/src/lib/csv.d.ts +48 -0
- package/dist/src/lib/db-codegen/dbFingerprint.d.ts +10 -0
- package/dist/src/lib/db-codegen/dbGenerator.d.ts +111 -0
- package/dist/src/lib/db-codegen/dbNaming.d.ts +45 -0
- package/dist/src/lib/db-codegen/dbTemplates.d.ts +97 -0
- package/dist/src/lib/db-codegen/dbTemplates.js +31 -10
- package/dist/src/lib/db-codegen/dbTemplates.js.map +1 -1
- package/dist/src/lib/db-codegen/dbTsTypes.d.ts +78 -0
- package/dist/src/lib/db-codegen/dbTsTypes.js +2 -2
- package/dist/src/lib/db-codegen/dbTsTypes.js.map +1 -1
- package/dist/src/lib/env-resolver.d.ts +62 -0
- package/dist/src/lib/fetch.d.ts +5 -0
- package/dist/src/lib/init-config.d.ts +46 -0
- package/dist/src/lib/init-config.js +7 -0
- package/dist/src/lib/init-config.js.map +1 -1
- package/dist/src/lib/migration-nag.d.ts +49 -0
- package/dist/src/lib/output.d.ts +49 -0
- package/dist/src/lib/output.js +25 -1
- package/dist/src/lib/output.js.map +1 -1
- package/dist/src/lib/paginate.d.ts +33 -0
- package/dist/src/lib/project-config.d.ts +97 -0
- package/dist/src/lib/refresh-admin-credentials.d.ts +65 -0
- package/dist/src/lib/resolve-platform.d.ts +45 -0
- package/dist/src/lib/resolve-platform.js +43 -0
- package/dist/src/lib/resolve-platform.js.map +1 -0
- package/dist/src/lib/skill-installer.d.ts +23 -0
- package/dist/src/lib/snapshots.d.ts +99 -0
- package/dist/src/lib/snapshots.js +357 -0
- package/dist/src/lib/snapshots.js.map +1 -0
- package/dist/src/lib/sync-paths.d.ts +72 -0
- package/dist/src/lib/sync-paths.js +29 -1
- package/dist/src/lib/sync-paths.js.map +1 -1
- package/dist/src/lib/template.d.ts +93 -0
- package/dist/src/lib/token-inject.d.ts +56 -0
- package/dist/src/lib/token-inject.js +204 -0
- package/dist/src/lib/token-inject.js.map +1 -0
- package/dist/src/lib/toml-database-config.d.ts +132 -0
- package/dist/src/lib/toml-params-validator.d.ts +95 -0
- package/dist/src/lib/version-check.d.ts +10 -0
- package/dist/src/lib/workflow-fragments.d.ts +41 -0
- package/dist/src/lib/workflow-toml-validator.d.ts +86 -0
- package/dist/src/lib/workflow-toml-validator.js +31 -1
- package/dist/src/lib/workflow-toml-validator.js.map +1 -1
- package/dist/src/types/index.d.ts +513 -0
- package/dist/src/validators.d.ts +64 -0
- package/dist/src/validators.js +63 -0
- package/dist/src/validators.js.map +1 -0
- package/package.json +7 -1
|
@@ -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.
|
|
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/",
|