primitive-admin 1.1.0-alpha.6 → 1.1.0-alpha.60
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 +389 -71
- package/assets/skill/skills/primitive-platform/SKILL.md +670 -0
- package/dist/bin/primitive.d.ts +2 -0
- package/dist/bin/primitive.js +287 -17
- package/dist/bin/primitive.js.map +1 -1
- package/dist/src/commands/admins.d.ts +2 -0
- package/dist/src/commands/admins.js +138 -19
- package/dist/src/commands/admins.js.map +1 -1
- package/dist/src/commands/analytics.d.ts +2 -0
- package/dist/src/commands/analytics.js +554 -55
- package/dist/src/commands/analytics.js.map +1 -1
- package/dist/src/commands/apps.d.ts +2 -0
- package/dist/src/commands/apps.js +27 -80
- package/dist/src/commands/apps.js.map +1 -1
- package/dist/src/commands/auth.d.ts +2 -0
- package/dist/src/commands/auth.js +177 -7
- package/dist/src/commands/auth.js.map +1 -1
- package/dist/src/commands/blob-buckets.d.ts +2 -0
- package/dist/src/commands/blob-buckets.js +330 -0
- package/dist/src/commands/blob-buckets.js.map +1 -0
- package/dist/src/commands/catalog.d.ts +2 -0
- package/dist/src/commands/catalog.js +37 -38
- package/dist/src/commands/catalog.js.map +1 -1
- package/dist/src/commands/collection-type-configs.d.ts +2 -0
- package/dist/src/commands/collection-type-configs.js +92 -0
- package/dist/src/commands/collection-type-configs.js.map +1 -0
- package/dist/src/commands/collections.d.ts +2 -0
- package/dist/src/commands/collections.js +526 -0
- package/dist/src/commands/collections.js.map +1 -0
- package/dist/src/commands/comparisons.d.ts +2 -0
- package/dist/src/commands/comparisons.js +6 -6
- package/dist/src/commands/comparisons.js.map +1 -1
- package/dist/src/commands/config.d.ts +35 -0
- package/dist/src/commands/config.js +437 -0
- package/dist/src/commands/config.js.map +1 -0
- package/dist/src/commands/connections.d.ts +2 -0
- package/dist/src/commands/connections.js +100 -0
- package/dist/src/commands/connections.js.map +1 -0
- package/dist/src/commands/cron-triggers.d.ts +2 -0
- package/dist/src/commands/cron-triggers.js +204 -0
- package/dist/src/commands/cron-triggers.js.map +1 -0
- package/dist/src/commands/database-types.d.ts +2 -0
- package/dist/src/commands/database-types.js +171 -0
- package/dist/src/commands/database-types.js.map +1 -0
- package/dist/src/commands/databases.d.ts +65 -0
- package/dist/src/commands/databases.js +2153 -96
- package/dist/src/commands/databases.js.map +1 -1
- package/dist/src/commands/documents.d.ts +2 -0
- package/dist/src/commands/documents.js +1230 -19
- package/dist/src/commands/documents.js.map +1 -1
- package/dist/src/commands/email-templates.d.ts +2 -0
- package/dist/src/commands/email-templates.js +174 -0
- package/dist/src/commands/email-templates.js.map +1 -0
- package/dist/src/commands/env.d.ts +12 -0
- package/dist/src/commands/env.js +260 -0
- package/dist/src/commands/env.js.map +1 -0
- package/dist/src/commands/group-type-configs.d.ts +2 -0
- package/dist/src/commands/group-type-configs.js +86 -0
- package/dist/src/commands/group-type-configs.js.map +1 -0
- package/dist/src/commands/groups.d.ts +2 -0
- package/dist/src/commands/groups.js +38 -99
- package/dist/src/commands/groups.js.map +1 -1
- package/dist/src/commands/guides.d.ts +223 -0
- package/dist/src/commands/guides.js +617 -65
- package/dist/src/commands/guides.js.map +1 -1
- package/dist/src/commands/init.d.ts +17 -0
- package/dist/src/commands/init.js +964 -202
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/integrations.d.ts +2 -0
- package/dist/src/commands/integrations.js +484 -205
- package/dist/src/commands/integrations.js.map +1 -1
- package/dist/src/commands/llm.d.ts +2 -0
- package/dist/src/commands/llm.js +13 -8
- package/dist/src/commands/llm.js.map +1 -1
- package/dist/src/commands/locks.d.ts +8 -0
- package/dist/src/commands/locks.js +160 -0
- package/dist/src/commands/locks.js.map +1 -0
- package/dist/src/commands/metadata.d.ts +2 -0
- package/dist/src/commands/metadata.js +406 -0
- package/dist/src/commands/metadata.js.map +1 -0
- package/dist/src/commands/prompts.d.ts +2 -0
- package/dist/src/commands/prompts.js +135 -355
- package/dist/src/commands/prompts.js.map +1 -1
- package/dist/src/commands/rule-sets.d.ts +3 -0
- package/dist/src/commands/rule-sets.js +271 -0
- package/dist/src/commands/rule-sets.js.map +1 -0
- package/dist/src/commands/scripts.d.ts +20 -0
- package/dist/src/commands/scripts.js +739 -0
- package/dist/src/commands/scripts.js.map +1 -0
- package/dist/src/commands/secrets.d.ts +2 -0
- package/dist/src/commands/secrets.js +108 -0
- package/dist/src/commands/secrets.js.map +1 -0
- package/dist/src/commands/sessions.d.ts +2 -0
- package/dist/src/commands/sessions.js +75 -0
- package/dist/src/commands/sessions.js.map +1 -0
- package/dist/src/commands/settings.d.ts +18 -0
- package/dist/src/commands/settings.js +54 -0
- package/dist/src/commands/settings.js.map +1 -0
- package/dist/src/commands/skill.d.ts +2 -0
- package/dist/src/commands/skill.js +29 -0
- package/dist/src/commands/skill.js.map +1 -0
- package/dist/src/commands/sync-app-settings.d.ts +125 -0
- package/dist/src/commands/sync-app-settings.js +380 -0
- package/dist/src/commands/sync-app-settings.js.map +1 -0
- package/dist/src/commands/sync.d.ts +958 -0
- package/dist/src/commands/sync.js +8954 -812
- package/dist/src/commands/sync.js.map +1 -1
- package/dist/src/commands/tokens.d.ts +2 -0
- package/dist/src/commands/tokens.js +130 -21
- package/dist/src/commands/tokens.js.map +1 -1
- package/dist/src/commands/users.d.ts +2 -0
- package/dist/src/commands/users.js +440 -22
- package/dist/src/commands/users.js.map +1 -1
- package/dist/src/commands/vars.d.ts +8 -0
- package/dist/src/commands/vars.js +96 -0
- package/dist/src/commands/vars.js.map +1 -0
- package/dist/src/commands/waitlist.d.ts +2 -0
- package/dist/src/commands/waitlist.js +10 -10
- package/dist/src/commands/waitlist.js.map +1 -1
- package/dist/src/commands/webhooks.d.ts +2 -0
- package/dist/src/commands/webhooks.js +442 -0
- package/dist/src/commands/webhooks.js.map +1 -0
- package/dist/src/commands/workflows.d.ts +94 -0
- package/dist/src/commands/workflows.js +1581 -448
- package/dist/src/commands/workflows.js.map +1 -1
- package/dist/src/lib/api-client.d.ts +1814 -0
- package/dist/src/lib/api-client.js +1655 -103
- package/dist/src/lib/api-client.js.map +1 -1
- package/dist/src/lib/app-settings-descriptor.d.ts +130 -0
- package/dist/src/lib/app-settings-descriptor.js +262 -0
- package/dist/src/lib/app-settings-descriptor.js.map +1 -0
- package/dist/src/lib/auth-flow.d.ts +8 -0
- package/dist/src/lib/batch.d.ts +26 -0
- package/dist/src/lib/batch.js +32 -0
- package/dist/src/lib/batch.js.map +1 -0
- package/dist/src/lib/block-layout.d.ts +160 -0
- package/dist/src/lib/block-layout.js +451 -0
- package/dist/src/lib/block-layout.js.map +1 -0
- package/dist/src/lib/canonical-json.d.ts +12 -0
- package/dist/src/lib/canonical-json.js +35 -0
- package/dist/src/lib/canonical-json.js.map +1 -0
- package/dist/src/lib/channel.d.ts +30 -0
- package/dist/src/lib/channel.js +68 -0
- package/dist/src/lib/channel.js.map +1 -0
- package/dist/src/lib/cli-manifest.d.ts +68 -0
- package/dist/src/lib/cli-manifest.js +71 -0
- package/dist/src/lib/cli-manifest.js.map +1 -0
- package/dist/src/lib/codegen-shared/generatedFiles.d.ts +97 -0
- package/dist/src/lib/codegen-shared/generatedFiles.js +184 -0
- package/dist/src/lib/codegen-shared/generatedFiles.js.map +1 -0
- package/dist/src/lib/codegen-shared/prettierStable.d.ts +262 -0
- package/dist/src/lib/codegen-shared/prettierStable.js +610 -0
- package/dist/src/lib/codegen-shared/prettierStable.js.map +1 -0
- package/dist/src/lib/codegen-shared/resolveCodegenSourceDir.d.ts +68 -0
- package/dist/src/lib/codegen-shared/resolveCodegenSourceDir.js +168 -0
- package/dist/src/lib/codegen-shared/resolveCodegenSourceDir.js.map +1 -0
- package/dist/src/lib/config-object-descriptor.d.ts +108 -0
- package/dist/src/lib/config-object-descriptor.js +607 -0
- package/dist/src/lib/config-object-descriptor.js.map +1 -0
- package/dist/src/lib/config-payload.d.ts +85 -0
- package/dist/src/lib/config-payload.js +105 -0
- package/dist/src/lib/config-payload.js.map +1 -0
- package/dist/src/lib/config-surface.d.ts +93 -0
- package/dist/src/lib/config-surface.js +178 -0
- package/dist/src/lib/config-surface.js.map +1 -0
- package/dist/src/lib/config-toml.d.ts +10 -0
- package/dist/src/lib/config-toml.js +42 -0
- package/dist/src/lib/config-toml.js.map +1 -0
- package/dist/src/lib/config.d.ts +53 -0
- package/dist/src/lib/config.js +92 -53
- package/dist/src/lib/config.js.map +1 -1
- package/dist/src/lib/confirm-prompt.d.ts +83 -0
- package/dist/src/lib/confirm-prompt.js +110 -0
- package/dist/src/lib/confirm-prompt.js.map +1 -0
- package/dist/src/lib/constants.d.ts +11 -0
- package/dist/src/lib/constants.js +12 -0
- package/dist/src/lib/constants.js.map +1 -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 +89 -0
- package/dist/src/lib/credentials-store.js +330 -0
- package/dist/src/lib/credentials-store.js.map +1 -0
- package/dist/src/lib/csv.d.ts +47 -0
- package/dist/src/lib/csv.js +172 -0
- package/dist/src/lib/csv.js.map +1 -0
- package/dist/src/lib/data-input.d.ts +23 -0
- package/dist/src/lib/data-input.js +50 -0
- package/dist/src/lib/data-input.js.map +1 -0
- package/dist/src/lib/db-codegen/dbFingerprint.d.ts +10 -0
- package/dist/src/lib/db-codegen/dbFingerprint.js +17 -0
- package/dist/src/lib/db-codegen/dbFingerprint.js.map +1 -0
- package/dist/src/lib/db-codegen/dbGenerator.d.ts +67 -0
- package/dist/src/lib/db-codegen/dbGenerator.js +170 -0
- package/dist/src/lib/db-codegen/dbGenerator.js.map +1 -0
- package/dist/src/lib/db-codegen/dbNaming.d.ts +87 -0
- package/dist/src/lib/db-codegen/dbNaming.js +180 -0
- package/dist/src/lib/db-codegen/dbNaming.js.map +1 -0
- package/dist/src/lib/db-codegen/dbTemplates.d.ts +272 -0
- package/dist/src/lib/db-codegen/dbTemplates.js +480 -0
- package/dist/src/lib/db-codegen/dbTemplates.js.map +1 -0
- package/dist/src/lib/db-codegen/dbTsTypes.d.ts +73 -0
- package/dist/src/lib/db-codegen/dbTsTypes.js +139 -0
- package/dist/src/lib/db-codegen/dbTsTypes.js.map +1 -0
- package/dist/src/lib/db-codegen/dbTypeIR.d.ts +146 -0
- package/dist/src/lib/db-codegen/dbTypeIR.js +517 -0
- package/dist/src/lib/db-codegen/dbTypeIR.js.map +1 -0
- package/dist/src/lib/db-codegen/generated-operation-def-descriptor.d.ts +112 -0
- package/dist/src/lib/db-codegen/generated-operation-def-descriptor.js +211 -0
- package/dist/src/lib/db-codegen/generated-operation-def-descriptor.js.map +1 -0
- package/dist/src/lib/env-resolver.d.ts +62 -0
- package/dist/src/lib/env-resolver.js +121 -0
- package/dist/src/lib/env-resolver.js.map +1 -0
- package/dist/src/lib/fetch.d.ts +5 -0
- package/dist/src/lib/generated-allowlist.d.ts +28 -0
- package/dist/src/lib/generated-allowlist.js +266 -0
- package/dist/src/lib/generated-allowlist.js.map +1 -0
- package/dist/src/lib/generated-config-surfaces.d.ts +578 -0
- package/dist/src/lib/generated-config-surfaces.js +3630 -0
- package/dist/src/lib/generated-config-surfaces.js.map +1 -0
- package/dist/src/lib/generated-template-lint.d.ts +206 -0
- package/dist/src/lib/generated-template-lint.js +589 -0
- package/dist/src/lib/generated-template-lint.js.map +1 -0
- package/dist/src/lib/generated-workflow-model-fields.d.ts +20 -0
- package/dist/src/lib/generated-workflow-model-fields.js +53 -0
- package/dist/src/lib/generated-workflow-model-fields.js.map +1 -0
- package/dist/src/lib/google-client-secret-status.d.ts +35 -0
- package/dist/src/lib/google-client-secret-status.js +56 -0
- package/dist/src/lib/google-client-secret-status.js.map +1 -0
- package/dist/src/lib/init-config.d.ts +81 -0
- package/dist/src/lib/init-config.js +149 -0
- package/dist/src/lib/init-config.js.map +1 -0
- package/dist/src/lib/log-inspection.d.ts +568 -0
- package/dist/src/lib/log-inspection.js +639 -0
- package/dist/src/lib/log-inspection.js.map +1 -0
- package/dist/src/lib/migration-nag.d.ts +49 -0
- package/dist/src/lib/migration-nag.js +163 -0
- package/dist/src/lib/migration-nag.js.map +1 -0
- package/dist/src/lib/output.d.ts +109 -0
- package/dist/src/lib/output.js +191 -8
- package/dist/src/lib/output.js.map +1 -1
- package/dist/src/lib/package-manager.d.ts +140 -0
- package/dist/src/lib/package-manager.js +305 -0
- package/dist/src/lib/package-manager.js.map +1 -0
- package/dist/src/lib/paginate.d.ts +83 -0
- package/dist/src/lib/paginate.js +95 -0
- package/dist/src/lib/paginate.js.map +1 -0
- package/dist/src/lib/platform-owned.d.ts +51 -0
- package/dist/src/lib/platform-owned.js +64 -0
- package/dist/src/lib/platform-owned.js.map +1 -0
- package/dist/src/lib/project-config.d.ts +97 -0
- package/dist/src/lib/project-config.js +219 -0
- package/dist/src/lib/project-config.js.map +1 -0
- package/dist/src/lib/query-operators.d.ts +43 -0
- package/dist/src/lib/query-operators.js +80 -0
- package/dist/src/lib/query-operators.js.map +1 -0
- package/dist/src/lib/record-filter.d.ts +18 -0
- package/dist/src/lib/record-filter.js +55 -0
- package/dist/src/lib/record-filter.js.map +1 -0
- package/dist/src/lib/refresh-admin-credentials.d.ts +65 -0
- package/dist/src/lib/refresh-admin-credentials.js +103 -0
- package/dist/src/lib/refresh-admin-credentials.js.map +1 -0
- package/dist/src/lib/resolve-init-dev-port.d.ts +56 -0
- package/dist/src/lib/resolve-init-dev-port.js +55 -0
- package/dist/src/lib/resolve-init-dev-port.js.map +1 -0
- package/dist/src/lib/resolve-init-server.d.ts +71 -0
- package/dist/src/lib/resolve-init-server.js +94 -0
- package/dist/src/lib/resolve-init-server.js.map +1 -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/run-status.d.ts +19 -0
- package/dist/src/lib/run-status.generated.d.ts +39 -0
- package/dist/src/lib/run-status.generated.js +66 -0
- package/dist/src/lib/run-status.generated.js.map +1 -0
- package/dist/src/lib/run-status.js +19 -0
- package/dist/src/lib/run-status.js.map +1 -0
- package/dist/src/lib/signing-secret-status.d.ts +81 -0
- package/dist/src/lib/signing-secret-status.js +116 -0
- package/dist/src/lib/signing-secret-status.js.map +1 -0
- package/dist/src/lib/skill-installer.d.ts +25 -0
- package/dist/src/lib/skill-installer.js +266 -0
- package/dist/src/lib/skill-installer.js.map +1 -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/swift-codegen/dbGenerator.d.ts +100 -0
- package/dist/src/lib/swift-codegen/dbGenerator.js +682 -0
- package/dist/src/lib/swift-codegen/dbGenerator.js.map +1 -0
- package/dist/src/lib/swift-codegen/dbSwiftTypes.d.ts +42 -0
- package/dist/src/lib/swift-codegen/dbSwiftTypes.js +100 -0
- package/dist/src/lib/swift-codegen/dbSwiftTypes.js.map +1 -0
- package/dist/src/lib/swift-codegen/generator.d.ts +85 -0
- package/dist/src/lib/swift-codegen/generator.js +266 -0
- package/dist/src/lib/swift-codegen/generator.js.map +1 -0
- package/dist/src/lib/swift-codegen/schemaToSwift.d.ts +72 -0
- package/dist/src/lib/swift-codegen/schemaToSwift.js +644 -0
- package/dist/src/lib/swift-codegen/schemaToSwift.js.map +1 -0
- package/dist/src/lib/swift-codegen/siblingSymbols.d.ts +90 -0
- package/dist/src/lib/swift-codegen/siblingSymbols.js +152 -0
- package/dist/src/lib/swift-codegen/siblingSymbols.js.map +1 -0
- package/dist/src/lib/swift-codegen/swiftNaming.d.ts +85 -0
- package/dist/src/lib/swift-codegen/swiftNaming.js +198 -0
- package/dist/src/lib/swift-codegen/swiftNaming.js.map +1 -0
- package/dist/src/lib/sync-paths.d.ts +72 -0
- package/dist/src/lib/sync-paths.js +130 -0
- package/dist/src/lib/sync-paths.js.map +1 -0
- package/dist/src/lib/sync-resource-types.d.ts +445 -0
- package/dist/src/lib/sync-resource-types.js +812 -0
- package/dist/src/lib/sync-resource-types.js.map +1 -0
- package/dist/src/lib/sync-selectors.d.ts +95 -0
- package/dist/src/lib/sync-selectors.js +228 -0
- package/dist/src/lib/sync-selectors.js.map +1 -0
- package/dist/src/lib/template.d.ts +121 -0
- package/dist/src/lib/template.js +447 -67
- package/dist/src/lib/template.js.map +1 -1
- 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 +123 -0
- package/dist/src/lib/toml-database-config.js +527 -0
- package/dist/src/lib/toml-database-config.js.map +1 -0
- package/dist/src/lib/toml-metadata-config.d.ts +151 -0
- package/dist/src/lib/toml-metadata-config.js +476 -0
- package/dist/src/lib/toml-metadata-config.js.map +1 -0
- package/dist/src/lib/toml-native-form.d.ts +46 -0
- package/dist/src/lib/toml-native-form.js +78 -0
- package/dist/src/lib/toml-native-form.js.map +1 -0
- package/dist/src/lib/toml-params-validator.d.ts +129 -0
- package/dist/src/lib/toml-params-validator.js +298 -0
- package/dist/src/lib/toml-params-validator.js.map +1 -0
- package/dist/src/lib/toml-scalar-edit.d.ts +43 -0
- package/dist/src/lib/toml-scalar-edit.js +283 -0
- package/dist/src/lib/toml-scalar-edit.js.map +1 -0
- package/dist/src/lib/user-selector.d.ts +24 -0
- package/dist/src/lib/user-selector.js +33 -0
- package/dist/src/lib/user-selector.js.map +1 -0
- package/dist/src/lib/version-check.d.ts +35 -0
- package/dist/src/lib/version-check.js +241 -0
- package/dist/src/lib/version-check.js.map +1 -0
- package/dist/src/lib/watch.d.ts +121 -0
- package/dist/src/lib/watch.js +169 -0
- package/dist/src/lib/watch.js.map +1 -0
- package/dist/src/lib/workflow-apply.d.ts +51 -0
- package/dist/src/lib/workflow-apply.js +89 -0
- package/dist/src/lib/workflow-apply.js.map +1 -0
- package/dist/src/lib/workflow-codegen/generated-schema-descriptor.d.ts +129 -0
- package/dist/src/lib/workflow-codegen/generated-schema-descriptor.js +269 -0
- package/dist/src/lib/workflow-codegen/generated-schema-descriptor.js.map +1 -0
- package/dist/src/lib/workflow-codegen/generator.d.ts +96 -0
- package/dist/src/lib/workflow-codegen/generator.js +361 -0
- package/dist/src/lib/workflow-codegen/generator.js.map +1 -0
- package/dist/src/lib/workflow-codegen/invokerIR.d.ts +83 -0
- package/dist/src/lib/workflow-codegen/invokerIR.js +71 -0
- package/dist/src/lib/workflow-codegen/invokerIR.js.map +1 -0
- package/dist/src/lib/workflow-codegen/naming.d.ts +33 -0
- package/dist/src/lib/workflow-codegen/naming.js +81 -0
- package/dist/src/lib/workflow-codegen/naming.js.map +1 -0
- package/dist/src/lib/workflow-codegen/schemaToTs.d.ts +80 -0
- package/dist/src/lib/workflow-codegen/schemaToTs.js +303 -0
- package/dist/src/lib/workflow-codegen/schemaToTs.js.map +1 -0
- package/dist/src/lib/workflow-config-apply.d.ts +70 -0
- package/dist/src/lib/workflow-config-apply.js +137 -0
- package/dist/src/lib/workflow-config-apply.js.map +1 -0
- package/dist/src/lib/workflow-config-sidecar.d.ts +63 -0
- package/dist/src/lib/workflow-config-sidecar.js +96 -0
- package/dist/src/lib/workflow-config-sidecar.js.map +1 -0
- package/dist/src/lib/workflow-field-descriptor.d.ts +91 -0
- package/dist/src/lib/workflow-field-descriptor.js +153 -0
- package/dist/src/lib/workflow-field-descriptor.js.map +1 -0
- package/dist/src/lib/workflow-fragments.d.ts +64 -0
- package/dist/src/lib/workflow-fragments.js +342 -0
- package/dist/src/lib/workflow-fragments.js.map +1 -0
- package/dist/src/lib/workflow-include-preserve.d.ts +71 -0
- package/dist/src/lib/workflow-include-preserve.js +153 -0
- package/dist/src/lib/workflow-include-preserve.js.map +1 -0
- package/dist/src/lib/workflow-payload.d.ts +86 -0
- package/dist/src/lib/workflow-payload.js +168 -0
- package/dist/src/lib/workflow-payload.js.map +1 -0
- package/dist/src/lib/workflow-toml-validator.d.ts +199 -0
- package/dist/src/lib/workflow-toml-validator.js +754 -0
- package/dist/src/lib/workflow-toml-validator.js.map +1 -0
- package/dist/src/types/index.d.ts +533 -0
- package/dist/src/validators.d.ts +65 -0
- package/dist/src/validators.js +64 -0
- package/dist/src/validators.js.map +1 -0
- package/package.json +32 -6
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `primitive config` — the local TOML authoring surface (issue #2645).
|
|
3
|
+
*
|
|
4
|
+
* Server-side configuration is authored in TOML and applied with `sync push`,
|
|
5
|
+
* so the commands that replaced the eleven config-setting flags are these
|
|
6
|
+
* three: `fields` documents the surface that per-flag `--help` used to, `new`
|
|
7
|
+
* scaffolds an object, and `set` edits one key from a script.
|
|
8
|
+
*
|
|
9
|
+
* They live under `config` rather than under `sync` because none of them
|
|
10
|
+
* touches the network. `sync` is reconciliation — `pull`, `diff`, `status`,
|
|
11
|
+
* `push` all talk to the server — and a local file edit spelled as a `sync`
|
|
12
|
+
* verb reads as one. The three-way split the spec settles on is: the
|
|
13
|
+
* per-surface groups (`workflows`, `webhooks`, …) read and operate, `config`
|
|
14
|
+
* authors the local files, `sync` reconciles repo and server.
|
|
15
|
+
*/
|
|
16
|
+
import { Command } from "commander";
|
|
17
|
+
import { type ConfigObjectDescriptor } from "../lib/config-object-descriptor.js";
|
|
18
|
+
/**
|
|
19
|
+
* Why `value` cannot be what `path` declares, or `null` when it can.
|
|
20
|
+
*
|
|
21
|
+
* `config set` used to check only that a path was DECLARED, so
|
|
22
|
+
* `integration.timeoutMs=fast` wrote a string into a number field and the
|
|
23
|
+
* mistake surfaced as a server error on the next push. The descriptor exists to
|
|
24
|
+
* carry what per-flag `--help` used to carry (criterion 7), and that has to
|
|
25
|
+
* include the type — otherwise removing the flags traded a fast local error for
|
|
26
|
+
* a slow remote one.
|
|
27
|
+
*
|
|
28
|
+
* Deliberately silent about anything it cannot judge: an undeclared path (the
|
|
29
|
+
* declared-path check owns that message — two errors for one mistake is worse
|
|
30
|
+
* than one), the interior of a `table` / `table[]` / `json` field, and a var
|
|
31
|
+
* file's own keys. Those shapes belong to the server, and mirroring them here
|
|
32
|
+
* would be a second copy that goes stale.
|
|
33
|
+
*/
|
|
34
|
+
export declare function fieldTypeMismatch(descriptor: ConfigObjectDescriptor, path: string, value: string | number | boolean): string | null;
|
|
35
|
+
export declare function registerConfigCommands(program: Command): void;
|
|
@@ -0,0 +1,437 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `primitive config` — the local TOML authoring surface (issue #2645).
|
|
3
|
+
*
|
|
4
|
+
* Server-side configuration is authored in TOML and applied with `sync push`,
|
|
5
|
+
* so the commands that replaced the eleven config-setting flags are these
|
|
6
|
+
* three: `fields` documents the surface that per-flag `--help` used to, `new`
|
|
7
|
+
* scaffolds an object, and `set` edits one key from a script.
|
|
8
|
+
*
|
|
9
|
+
* They live under `config` rather than under `sync` because none of them
|
|
10
|
+
* touches the network. `sync` is reconciliation — `pull`, `diff`, `status`,
|
|
11
|
+
* `push` all talk to the server — and a local file edit spelled as a `sync`
|
|
12
|
+
* verb reads as one. The three-way split the spec settles on is: the
|
|
13
|
+
* per-surface groups (`workflows`, `webhooks`, …) read and operate, `config`
|
|
14
|
+
* authors the local files, `sync` reconciles repo and server.
|
|
15
|
+
*/
|
|
16
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
|
|
17
|
+
import { join, basename } from "path";
|
|
18
|
+
import chalk from "chalk";
|
|
19
|
+
import { resolveAppId } from "../lib/config.js";
|
|
20
|
+
import { resolveSyncDir, isAutoResolvedSyncDir } from "../lib/sync-paths.js";
|
|
21
|
+
import { CONFIG_OBJECT_DESCRIPTORS, getConfigObjectDescriptor, } from "../lib/config-object-descriptor.js";
|
|
22
|
+
import { PUSH_PRUNE_SPECS, isSafeSyncFilename, } from "../lib/sync-resource-types.js";
|
|
23
|
+
import { platformOwnedAuthoringError } from "../lib/platform-owned.js";
|
|
24
|
+
import { filesDeclaringKey } from "../lib/sync-selectors.js";
|
|
25
|
+
import { setTomlScalar, parseScalarLiteral, TomlEditError, } from "../lib/toml-scalar-edit.js";
|
|
26
|
+
import { success, error, info, keyValue, divider, json } from "../lib/output.js";
|
|
27
|
+
function ensureDir(dirPath) {
|
|
28
|
+
if (!existsSync(dirPath)) {
|
|
29
|
+
mkdirSync(dirPath, { recursive: true });
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The sync slot for a LOCAL command (issue #2645).
|
|
34
|
+
*
|
|
35
|
+
* `config new`, `config set` and `config fields` never call the API, so an explicit
|
|
36
|
+
* `--dir` is enough on its own — resolving an app id first would make them
|
|
37
|
+
* require a login they do not need. Without `--dir` they fall back to the same
|
|
38
|
+
* per-environment slot every other sync command uses.
|
|
39
|
+
*/
|
|
40
|
+
function resolveLocalSyncDir(appId, options) {
|
|
41
|
+
if (options.dir)
|
|
42
|
+
return options.dir;
|
|
43
|
+
// Outside a project there is no per-app slot: `resolveSyncDir` answers
|
|
44
|
+
// `./config` whatever the app id is. Resolving one anyway would exit these
|
|
45
|
+
// commands with "No app specified" for want of a login they never use — and
|
|
46
|
+
// scaffolding a file before you have an app is exactly the order the
|
|
47
|
+
// TOML-only path asks for (`config new`, edit, `sync push`).
|
|
48
|
+
if (!isAutoResolvedSyncDir(undefined)) {
|
|
49
|
+
return resolveSyncDir({ appId: "", userDir: undefined });
|
|
50
|
+
}
|
|
51
|
+
const resolvedAppId = resolveAppId(appId, options);
|
|
52
|
+
const configDir = resolveSyncDir({ appId: resolvedAppId, userDir: undefined });
|
|
53
|
+
info(`Using per-environment sync directory: ${configDir}`);
|
|
54
|
+
return configDir;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* The `--only` selector key for a file — the key `sync push` itself derives.
|
|
58
|
+
*
|
|
59
|
+
* Not always the file name: a metadata-category config lives at
|
|
60
|
+
* `<resourceType>.<category>.toml` but is keyed by the `resourceType#category`
|
|
61
|
+
* pair, so telling the user to push `--only metadata-category-config/<basename>`
|
|
62
|
+
* would print a command that resolves to nothing.
|
|
63
|
+
*/
|
|
64
|
+
function pushSelectorKey(descriptor, filePath) {
|
|
65
|
+
const spec = PUSH_PRUNE_SPECS.find((s) => s.resourceType.label === descriptor.type);
|
|
66
|
+
return spec ? spec.keyFromFile(filePath) : basename(filePath, ".toml");
|
|
67
|
+
}
|
|
68
|
+
/** Every configurable type name, for an error message. */
|
|
69
|
+
function configTypeList() {
|
|
70
|
+
return CONFIG_OBJECT_DESCRIPTORS.map((d) => d.type).join(", ");
|
|
71
|
+
}
|
|
72
|
+
function requireConfigDescriptor(type) {
|
|
73
|
+
const descriptor = getConfigObjectDescriptor(type);
|
|
74
|
+
if (!descriptor) {
|
|
75
|
+
error(`Unknown configuration type '${type}'. Configurable types: ${configTypeList()}`);
|
|
76
|
+
process.exit(1);
|
|
77
|
+
}
|
|
78
|
+
return descriptor;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Whether `path` names something the type declares.
|
|
82
|
+
*
|
|
83
|
+
* An exact field match is obvious. A declared `table` / `table[]` / `json`
|
|
84
|
+
* field also covers everything BELOW it — `requestConfig.method`,
|
|
85
|
+
* `verification.jwt.header`, `vars.API_BASE_URL` — because those subtrees are
|
|
86
|
+
* free-form by design and enumerating them would be a second, always-stale
|
|
87
|
+
* copy of the server's shape.
|
|
88
|
+
*/
|
|
89
|
+
function isDeclaredFieldPath(descriptor, path) {
|
|
90
|
+
// `vars.toml` is a flat table of the app's own keys — every root-level key is
|
|
91
|
+
// legitimate, and the key format is validated by the push preflight.
|
|
92
|
+
if (descriptor.freeFormRootKeys && !path.includes("."))
|
|
93
|
+
return true;
|
|
94
|
+
for (const field of descriptor.fields) {
|
|
95
|
+
if (field.path === path)
|
|
96
|
+
return true;
|
|
97
|
+
if ((field.type === "table" || field.type === "table[]" || field.type === "json") &&
|
|
98
|
+
path.startsWith(`${field.path}.`)) {
|
|
99
|
+
return true;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Why `value` cannot be what `path` declares, or `null` when it can.
|
|
106
|
+
*
|
|
107
|
+
* `config set` used to check only that a path was DECLARED, so
|
|
108
|
+
* `integration.timeoutMs=fast` wrote a string into a number field and the
|
|
109
|
+
* mistake surfaced as a server error on the next push. The descriptor exists to
|
|
110
|
+
* carry what per-flag `--help` used to carry (criterion 7), and that has to
|
|
111
|
+
* include the type — otherwise removing the flags traded a fast local error for
|
|
112
|
+
* a slow remote one.
|
|
113
|
+
*
|
|
114
|
+
* Deliberately silent about anything it cannot judge: an undeclared path (the
|
|
115
|
+
* declared-path check owns that message — two errors for one mistake is worse
|
|
116
|
+
* than one), the interior of a `table` / `table[]` / `json` field, and a var
|
|
117
|
+
* file's own keys. Those shapes belong to the server, and mirroring them here
|
|
118
|
+
* would be a second copy that goes stale.
|
|
119
|
+
*/
|
|
120
|
+
export function fieldTypeMismatch(descriptor, path, value) {
|
|
121
|
+
const field = descriptor.fields.find((f) => f.path === path);
|
|
122
|
+
if (!field)
|
|
123
|
+
return null;
|
|
124
|
+
const expected = field.type === "number" || field.type === "boolean" || field.type === "string"
|
|
125
|
+
? field.type
|
|
126
|
+
: null;
|
|
127
|
+
if (!expected || typeof value === expected)
|
|
128
|
+
return null;
|
|
129
|
+
return (`'${path}' is declared ${expected}, but '${value}' is a ${typeof value}. ` +
|
|
130
|
+
`Run 'primitive config fields ${descriptor.type}' to see the surface.`);
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Resolve a `config set` target to the file it edits.
|
|
134
|
+
*
|
|
135
|
+
* Accepts `<type>/<key>` for the 13 per-entity types, plus the two root
|
|
136
|
+
* singletons by name: `app` (`app.toml`) and `vars` (`vars.toml`, whose keys
|
|
137
|
+
* are addressed as `vars.<KEY>`).
|
|
138
|
+
*
|
|
139
|
+
* The key is resolved the way `sync push --only` resolves it — by the identity
|
|
140
|
+
* the local files DECLARE, falling back to the conventional file name when no
|
|
141
|
+
* file declares it. `config set` and the push that follows it have to agree about
|
|
142
|
+
* which object `<type>/<key>` is; resolving by file name alone meant a renamed
|
|
143
|
+
* file (`custom.toml` declaring `workflow.key = "greeting"`) could not be
|
|
144
|
+
* edited as `workflow/greeting` at all, while `workflow/custom` edited a file
|
|
145
|
+
* push would apply under a different key (issue #2645, review follow-up).
|
|
146
|
+
*/
|
|
147
|
+
function resolveSetTarget(selector, configDir) {
|
|
148
|
+
if (selector === "app") {
|
|
149
|
+
return {
|
|
150
|
+
descriptor: requireConfigDescriptor("app"),
|
|
151
|
+
filePath: join(configDir, "app.toml"),
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
if (selector === "vars" || selector === "var") {
|
|
155
|
+
return {
|
|
156
|
+
descriptor: requireConfigDescriptor("var"),
|
|
157
|
+
filePath: join(configDir, "vars.toml"),
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
const slash = selector.indexOf("/");
|
|
161
|
+
if (slash === -1) {
|
|
162
|
+
error(`'${selector}' is not a configuration object. Use <type>/<key>, app, or vars. Types: ${configTypeList()}`);
|
|
163
|
+
process.exit(1);
|
|
164
|
+
}
|
|
165
|
+
const type = selector.slice(0, slash);
|
|
166
|
+
const key = selector.slice(slash + 1);
|
|
167
|
+
const descriptor = requireConfigDescriptor(type);
|
|
168
|
+
if (!descriptor.resourceType) {
|
|
169
|
+
error(`'${type}' is a single file — use '${type === "app" ? "app" : "vars"}' with no key`);
|
|
170
|
+
process.exit(1);
|
|
171
|
+
}
|
|
172
|
+
if (!key) {
|
|
173
|
+
error(`'${selector}': name the object, e.g. ${type}/<key>`);
|
|
174
|
+
process.exit(1);
|
|
175
|
+
}
|
|
176
|
+
const platformOwned = platformOwnedAuthoringError(type, key);
|
|
177
|
+
if (platformOwned) {
|
|
178
|
+
error(platformOwned);
|
|
179
|
+
process.exit(1);
|
|
180
|
+
}
|
|
181
|
+
const filename = descriptor.resourceType.fileFromKey(key);
|
|
182
|
+
// The key is a command-line argument, so it must never be able to steer the
|
|
183
|
+
// edit out of the type's directory — `workflow/../app` would otherwise let
|
|
184
|
+
// `config set` rewrite a file the operator did not name. Same guard `config new`
|
|
185
|
+
// applies before a write and prune applies before an unlink. Checked before
|
|
186
|
+
// the directory scan below so a traversing key never reaches the filesystem.
|
|
187
|
+
if (!isSafeSyncFilename(filename)) {
|
|
188
|
+
error(`'${key}' is not a usable key — it would edit outside ${descriptor.resourceType.dir}/.`);
|
|
189
|
+
process.exit(1);
|
|
190
|
+
}
|
|
191
|
+
const declaring = filesDeclaringKey(configDir, descriptor.type, key);
|
|
192
|
+
if (declaring.length > 1) {
|
|
193
|
+
error(`'${selector}' is declared by ${declaring.length} files (${declaring
|
|
194
|
+
.map((p) => basename(p))
|
|
195
|
+
.join(", ")}) — one key, one file. Remove or re-key the duplicates, then retry.`);
|
|
196
|
+
process.exit(1);
|
|
197
|
+
}
|
|
198
|
+
// No local file declares the key: fall back to the conventional path, so the
|
|
199
|
+
// "no local file at …" error names where `sync pull` / `config new` would put it.
|
|
200
|
+
const filePath = declaring[0] ?? join(configDir, descriptor.resourceType.dir, filename);
|
|
201
|
+
// A file may declare a key other than its name, including a platform-owned
|
|
202
|
+
// one. Push skips those (#1660), so editing one is an edit that can never be
|
|
203
|
+
// applied — refuse it by the key the file DECLARES, not only by the one the
|
|
204
|
+
// operator typed.
|
|
205
|
+
const declaredKey = pushSelectorKey(descriptor, filePath);
|
|
206
|
+
const declaredPlatformOwned = declaredKey === key
|
|
207
|
+
? null
|
|
208
|
+
: platformOwnedAuthoringError(descriptor.type, declaredKey);
|
|
209
|
+
if (declaredPlatformOwned) {
|
|
210
|
+
error(declaredPlatformOwned);
|
|
211
|
+
process.exit(1);
|
|
212
|
+
}
|
|
213
|
+
return { descriptor, filePath };
|
|
214
|
+
}
|
|
215
|
+
export function registerConfigCommands(program) {
|
|
216
|
+
const config = program
|
|
217
|
+
.command("config")
|
|
218
|
+
.description("Author configuration files locally (no API call)")
|
|
219
|
+
.addHelpText("after", `
|
|
220
|
+
Configuration is authored in TOML and applied with 'primitive sync push'.
|
|
221
|
+
These commands only read and write local files — nothing here contacts the
|
|
222
|
+
server, so they work before you have an app, and a script can edit a file
|
|
223
|
+
without a login.
|
|
224
|
+
|
|
225
|
+
Examples:
|
|
226
|
+
$ primitive config fields workflow
|
|
227
|
+
$ primitive config new workflow order-intake
|
|
228
|
+
$ primitive config set workflow/order-intake workflow.status=active
|
|
229
|
+
$ primitive sync push --only workflow/order-intake
|
|
230
|
+
`);
|
|
231
|
+
// ── The TOML authoring surface (issue #2645) ─────────────────────────────
|
|
232
|
+
//
|
|
233
|
+
// Server-side configuration is authored in TOML and applied with `sync push`.
|
|
234
|
+
// These three commands are what replaced the config-setting flags: `fields`
|
|
235
|
+
// documents the surface that per-flag `--help` used to, `new` scaffolds an
|
|
236
|
+
// object without an API call, and `set` edits one key from a script. None of
|
|
237
|
+
// them touches the network.
|
|
238
|
+
config
|
|
239
|
+
.command("fields")
|
|
240
|
+
.description("List a configuration type's TOML keys, types, required and default")
|
|
241
|
+
.argument("<type>", `Configuration type (${CONFIG_OBJECT_DESCRIPTORS.length} available)`)
|
|
242
|
+
.option("--json", "Output as JSON")
|
|
243
|
+
.addHelpText("after", `
|
|
244
|
+
Types:
|
|
245
|
+
${CONFIG_OBJECT_DESCRIPTORS.map((d) => `${d.type} — ${d.description}`).join("\n ")}
|
|
246
|
+
|
|
247
|
+
Examples:
|
|
248
|
+
$ primitive config fields workflow
|
|
249
|
+
$ primitive config fields webhook --json
|
|
250
|
+
`)
|
|
251
|
+
.action(async (type, options) => {
|
|
252
|
+
const descriptor = requireConfigDescriptor(type);
|
|
253
|
+
const asJson = (f) => ({
|
|
254
|
+
path: f.path,
|
|
255
|
+
type: f.type,
|
|
256
|
+
required: f.required,
|
|
257
|
+
default: f.default ?? null,
|
|
258
|
+
description: f.description,
|
|
259
|
+
});
|
|
260
|
+
if (options.json) {
|
|
261
|
+
json({
|
|
262
|
+
type: descriptor.type,
|
|
263
|
+
file: descriptor.fileHint,
|
|
264
|
+
description: descriptor.description,
|
|
265
|
+
identity: descriptor.identity ?? null,
|
|
266
|
+
fields: descriptor.fields.map(asJson),
|
|
267
|
+
// A type authored across more than one file reports the other files
|
|
268
|
+
// too — the workflow's named-config sidecars are the whole of what
|
|
269
|
+
// the removed `workflows configs` verbs used to set (issue #2645).
|
|
270
|
+
companionFiles: (descriptor.companionFiles ?? []).map((companion) => ({
|
|
271
|
+
file: companion.fileHint,
|
|
272
|
+
description: companion.description,
|
|
273
|
+
fields: companion.fields.map(asJson),
|
|
274
|
+
})),
|
|
275
|
+
});
|
|
276
|
+
return;
|
|
277
|
+
}
|
|
278
|
+
keyValue("Type", descriptor.type);
|
|
279
|
+
keyValue("File", descriptor.fileHint);
|
|
280
|
+
keyValue("About", descriptor.description);
|
|
281
|
+
divider();
|
|
282
|
+
if (descriptor.freeFormRootKeys) {
|
|
283
|
+
info(`${descriptor.fileHint} is a flat table of your own keys — KEY = "value" at the root, matching ^[A-Z][A-Z0-9_]{0,63}$. There is no fixed field surface.`);
|
|
284
|
+
return;
|
|
285
|
+
}
|
|
286
|
+
if (descriptor.fields.length === 0) {
|
|
287
|
+
info(`${descriptor.fileHint} is a script body, not a table of keys — there is no field surface to list.`);
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
const printField = (field) => {
|
|
291
|
+
const flags = [
|
|
292
|
+
field.required ? "required" : "optional",
|
|
293
|
+
field.default === undefined ? null : `default ${JSON.stringify(field.default)}`,
|
|
294
|
+
]
|
|
295
|
+
.filter(Boolean)
|
|
296
|
+
.join(", ");
|
|
297
|
+
console.log(` ${chalk.cyan(field.path)} ${chalk.dim(field.type)} ${chalk.dim(`(${flags})`)}`);
|
|
298
|
+
console.log(` ${field.description}`);
|
|
299
|
+
};
|
|
300
|
+
for (const field of descriptor.fields) {
|
|
301
|
+
printField(field);
|
|
302
|
+
}
|
|
303
|
+
// The rest of the object's surface, where it spans more than one file.
|
|
304
|
+
// `config set` addresses the main file only, so these are listed rather
|
|
305
|
+
// than folded in — but leaving them out would under-report exactly what
|
|
306
|
+
// the removed `workflows configs` flags used to document (issue #2645).
|
|
307
|
+
for (const companion of descriptor.companionFiles ?? []) {
|
|
308
|
+
divider();
|
|
309
|
+
keyValue("File", companion.fileHint);
|
|
310
|
+
info(companion.description);
|
|
311
|
+
for (const field of companion.fields) {
|
|
312
|
+
printField(field);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
divider();
|
|
316
|
+
info(`Edit ${descriptor.fileHint}, then run 'primitive sync push'.`);
|
|
317
|
+
});
|
|
318
|
+
config
|
|
319
|
+
.command("new")
|
|
320
|
+
.description("Scaffold a configuration file locally (no API call)")
|
|
321
|
+
.argument("<type>", "Configuration type — see 'primitive config fields'")
|
|
322
|
+
.argument("<key>", "The object's key; it becomes the file name")
|
|
323
|
+
.option("--app <app-id>", "App ID")
|
|
324
|
+
.option("--dir <path>", "Config directory (overrides the auto-resolved per-env path)")
|
|
325
|
+
.addHelpText("after", `
|
|
326
|
+
Creates the file from the type's defaults and stops there — nothing is sent to
|
|
327
|
+
the server until you edit the file and run 'primitive sync push'.
|
|
328
|
+
|
|
329
|
+
Examples:
|
|
330
|
+
$ primitive config new workflow order-intake
|
|
331
|
+
$ primitive config new webhook stripe-events
|
|
332
|
+
$ primitive sync push --only workflow/order-intake
|
|
333
|
+
`)
|
|
334
|
+
.action(async (type, key, options) => {
|
|
335
|
+
const descriptor = requireConfigDescriptor(type);
|
|
336
|
+
if (!descriptor.resourceType) {
|
|
337
|
+
error(`${descriptor.type} is a root singleton (${descriptor.fileHint}) — it is not created per key. Run 'primitive sync pull' to write it.`);
|
|
338
|
+
process.exit(1);
|
|
339
|
+
}
|
|
340
|
+
const platformOwned = platformOwnedAuthoringError(descriptor.type, key);
|
|
341
|
+
if (platformOwned) {
|
|
342
|
+
error(platformOwned);
|
|
343
|
+
process.exit(1);
|
|
344
|
+
}
|
|
345
|
+
const configDir = resolveLocalSyncDir(undefined, options);
|
|
346
|
+
const dir = join(configDir, descriptor.resourceType.dir);
|
|
347
|
+
const filename = descriptor.resourceType.fileFromKey(key);
|
|
348
|
+
// The key comes from the command line, so it must never be able to steer
|
|
349
|
+
// a write out of the slot — the same guard the prune path applies before
|
|
350
|
+
// an unlink.
|
|
351
|
+
if (!isSafeSyncFilename(filename)) {
|
|
352
|
+
error(`'${key}' is not a usable key — it would write outside ${dir}.`);
|
|
353
|
+
process.exit(1);
|
|
354
|
+
}
|
|
355
|
+
const filePath = join(dir, filename);
|
|
356
|
+
if (existsSync(filePath)) {
|
|
357
|
+
error(`${descriptor.resourceType.dir}/${descriptor.resourceType.fileFromKey(key)} already exists — edit it, or pick another key.`);
|
|
358
|
+
process.exit(1);
|
|
359
|
+
}
|
|
360
|
+
ensureDir(dir);
|
|
361
|
+
writeFileSync(filePath, descriptor.scaffold(key));
|
|
362
|
+
success(`Created ${filePath}`);
|
|
363
|
+
info(`Next: edit it, then 'primitive sync push --only ${descriptor.type}/${pushSelectorKey(descriptor, filePath)}'.`);
|
|
364
|
+
});
|
|
365
|
+
config
|
|
366
|
+
.command("set")
|
|
367
|
+
.description("Set a field in a configuration file locally (no API call)")
|
|
368
|
+
.argument("<object>", "<type>/<key>, app, or vars")
|
|
369
|
+
.argument("<assignments...>", "One or more <path>=<value>, e.g. workflow.status=active")
|
|
370
|
+
.option("--app <app-id>", "App ID")
|
|
371
|
+
.option("--dir <path>", "Config directory (overrides the auto-resolved per-env path)")
|
|
372
|
+
.addHelpText("after", `
|
|
373
|
+
Edits the file in place, preserving comments and key order, and writes nothing
|
|
374
|
+
to the server. Only scalars are settable — a table or an array is edited in the
|
|
375
|
+
file directly.
|
|
376
|
+
|
|
377
|
+
'true'/'false' and numeric values are written with those types; wrap a value in
|
|
378
|
+
double quotes to force a string.
|
|
379
|
+
|
|
380
|
+
Examples:
|
|
381
|
+
$ primitive config set workflow/order-intake workflow.status=active
|
|
382
|
+
$ primitive sync push --only workflow/order-intake
|
|
383
|
+
`)
|
|
384
|
+
.action(async (object, assignments, options) => {
|
|
385
|
+
const configDir = resolveLocalSyncDir(undefined, options);
|
|
386
|
+
const { descriptor, filePath } = resolveSetTarget(object, configDir);
|
|
387
|
+
if (!existsSync(filePath)) {
|
|
388
|
+
error(`No local file at ${filePath}. Run 'primitive sync pull' to fetch it, or 'primitive config new ${descriptor.type} <key>' to create one.`);
|
|
389
|
+
process.exit(1);
|
|
390
|
+
}
|
|
391
|
+
let text = readFileSync(filePath, "utf-8");
|
|
392
|
+
const applied = [];
|
|
393
|
+
for (const assignment of assignments) {
|
|
394
|
+
const eq = assignment.indexOf("=");
|
|
395
|
+
if (eq <= 0) {
|
|
396
|
+
error(`'${assignment}' is not <path>=<value>, e.g. workflow.status=active`);
|
|
397
|
+
process.exit(1);
|
|
398
|
+
}
|
|
399
|
+
const path = assignment.slice(0, eq).trim();
|
|
400
|
+
const raw = assignment.slice(eq + 1);
|
|
401
|
+
if (!isDeclaredFieldPath(descriptor, path)) {
|
|
402
|
+
error(`'${path}' is not a ${descriptor.type} field. Run 'primitive config fields ${descriptor.type}' to see the surface.`);
|
|
403
|
+
process.exit(1);
|
|
404
|
+
}
|
|
405
|
+
const value = parseScalarLiteral(raw);
|
|
406
|
+
const typeError = fieldTypeMismatch(descriptor, path, value);
|
|
407
|
+
if (typeError) {
|
|
408
|
+
error(typeError);
|
|
409
|
+
process.exit(1);
|
|
410
|
+
}
|
|
411
|
+
try {
|
|
412
|
+
text = setTomlScalar(text, path, value);
|
|
413
|
+
}
|
|
414
|
+
catch (e) {
|
|
415
|
+
if (e instanceof TomlEditError) {
|
|
416
|
+
error(`${filePath}: ${e.message}`);
|
|
417
|
+
process.exit(1);
|
|
418
|
+
}
|
|
419
|
+
throw e;
|
|
420
|
+
}
|
|
421
|
+
applied.push(path);
|
|
422
|
+
}
|
|
423
|
+
writeFileSync(filePath, text);
|
|
424
|
+
success(`Updated ${filePath} (${applied.join(", ")})`);
|
|
425
|
+
// The follow-up has to be a command that actually runs: `--only` takes
|
|
426
|
+
// `app`, `var/<KEY>` per var, or `<type>/<key>` where the key is the one
|
|
427
|
+
// push derives from the file — for a metadata-category config that is the
|
|
428
|
+
// `resourceType#category` pair, not the file name.
|
|
429
|
+
const pushTargets = descriptor.type === "app"
|
|
430
|
+
? ["app"]
|
|
431
|
+
: descriptor.type === "var"
|
|
432
|
+
? applied.map((path) => `var/${path}`)
|
|
433
|
+
: [`${descriptor.type}/${pushSelectorKey(descriptor, filePath)}`];
|
|
434
|
+
info(`Next: 'primitive sync push --only ${pushTargets.join(",")}' to apply it.`);
|
|
435
|
+
});
|
|
436
|
+
}
|
|
437
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/commands/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AACxE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EACL,yBAAyB,EACzB,yBAAyB,GAE1B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,aAAa,GACd,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBA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E;QACvE,yEAAyE;QACzE,0EAA0E;QAC1E,mDAAmD;QACnD,MAAM,WAAW,GACf,UAAU,CAAC,IAAI,KAAK,KAAK;YACvB,CAAC,CAAC,CAAC,KAAK,CAAC;YACT,CAAC,CAAC,UAAU,CAAC,IAAI,KAAK,KAAK;gBACzB,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,IAAI,EAAE,CAAC;gBACtC,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,IAAI,IAAI,eAAe,CAAC,UAAU,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC;QACxE,IAAI,CACF,qCAAqC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAC3E,CAAC;IACJ,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { Option } from "commander";
|
|
2
|
+
import { ApiClient } from "../lib/api-client.js";
|
|
3
|
+
import { resolveAppId } from "../lib/config.js";
|
|
4
|
+
import { error, info, formatTable, formatDate, json, } from "../lib/output.js";
|
|
5
|
+
import { resolveUserSelector } from "../lib/user-selector.js";
|
|
6
|
+
export function registerConnectionsCommands(program) {
|
|
7
|
+
const connections = program
|
|
8
|
+
.command("connections")
|
|
9
|
+
.description("Inspect the live WebSocket connections the server believes exist")
|
|
10
|
+
.addHelpText("after", `
|
|
11
|
+
Freshness: these are the connections the server believes are live — exact when a
|
|
12
|
+
client disconnects gracefully, otherwise bounded by each row's EXPIRES time.
|
|
13
|
+
|
|
14
|
+
Each row is a single connection-to-subscription binding, so the same CONNECTION
|
|
15
|
+
can appear on more than one row (one per document/database subscription plus the
|
|
16
|
+
user notification channel).
|
|
17
|
+
|
|
18
|
+
Examples:
|
|
19
|
+
$ primitive connections list --document 01HXY...
|
|
20
|
+
$ primitive connections list --user-id 01HXY...
|
|
21
|
+
$ primitive connections list --database 01HXY... --limit 50
|
|
22
|
+
$ primitive connections list --user-id 01HXY... --json
|
|
23
|
+
`);
|
|
24
|
+
connections
|
|
25
|
+
.command("list")
|
|
26
|
+
.description("List live connections for exactly one of a document, user, or database")
|
|
27
|
+
.option("--app <app-id>", "App ID (uses current app if not specified)")
|
|
28
|
+
.option("--document <document-id>", "List connections for this document")
|
|
29
|
+
.option("--user-id <user-id>", "List connections for this user")
|
|
30
|
+
// Deprecated alias of --user-id, kept accepted but out of --help (#2357).
|
|
31
|
+
.addOption(new Option("--user <user-id>", "Deprecated alias of --user-id").hideHelp())
|
|
32
|
+
.option("--database <database-id>", "List database subscriptions for this database")
|
|
33
|
+
.option("--limit <n>", "Maximum rows to return (default 25, max 100)")
|
|
34
|
+
.option("--cursor <cursor>", "Pagination cursor from a previous page")
|
|
35
|
+
.option("--json", "Output as JSON")
|
|
36
|
+
.action(async (options) => {
|
|
37
|
+
const userId = resolveUserSelector(options, "connections list");
|
|
38
|
+
const selectors = [
|
|
39
|
+
options.document ? "document" : null,
|
|
40
|
+
userId ? "user" : null,
|
|
41
|
+
options.database ? "database" : null,
|
|
42
|
+
].filter(Boolean);
|
|
43
|
+
if (selectors.length === 0) {
|
|
44
|
+
error("Provide exactly one selector: --document, --user-id, or --database.");
|
|
45
|
+
process.exit(1);
|
|
46
|
+
}
|
|
47
|
+
if (selectors.length > 1) {
|
|
48
|
+
error("Provide only one selector: --document, --user-id, or --database (not more than one).");
|
|
49
|
+
process.exit(1);
|
|
50
|
+
}
|
|
51
|
+
const resolvedAppId = resolveAppId(undefined, options);
|
|
52
|
+
const client = new ApiClient();
|
|
53
|
+
const limit = options.limit ? Number(options.limit) : undefined;
|
|
54
|
+
if (options.limit !== undefined && (!Number.isInteger(limit) || limit <= 0)) {
|
|
55
|
+
error("--limit must be a positive integer.");
|
|
56
|
+
process.exit(1);
|
|
57
|
+
}
|
|
58
|
+
try {
|
|
59
|
+
const { items, nextCursor } = await client.listConnections(resolvedAppId, {
|
|
60
|
+
documentId: options.document,
|
|
61
|
+
userId,
|
|
62
|
+
databaseId: options.database,
|
|
63
|
+
}, { limit, cursor: options.cursor });
|
|
64
|
+
if (options.json) {
|
|
65
|
+
json({ items, nextCursor });
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
if (!items || items.length === 0) {
|
|
69
|
+
info("No live connections found.");
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
// `formatTable`'s per-column `format` receives only the cell value, so
|
|
73
|
+
// derive the composite TARGET column onto each display row up front.
|
|
74
|
+
const rows = items.map((row) => ({
|
|
75
|
+
...row,
|
|
76
|
+
target: row.kind === "document"
|
|
77
|
+
? row.documentId
|
|
78
|
+
: row.kind === "database-subscription"
|
|
79
|
+
? `${row.databaseId} / ${row.subscriptionKey}`
|
|
80
|
+
: "(user channel)",
|
|
81
|
+
}));
|
|
82
|
+
console.log(formatTable(rows, [
|
|
83
|
+
{ header: "CONNECTION", key: "connectionId" },
|
|
84
|
+
{ header: "KIND", key: "kind" },
|
|
85
|
+
{ header: "USER", key: "userId" },
|
|
86
|
+
{ header: "TARGET", key: "target" },
|
|
87
|
+
{ header: "CONNECTED", key: "connectedAt", format: formatDate },
|
|
88
|
+
{ header: "EXPIRES", key: "expiresAt", format: formatDate },
|
|
89
|
+
]));
|
|
90
|
+
if (nextCursor) {
|
|
91
|
+
info(`More results available. Re-run with --cursor ${nextCursor}`);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
catch (err) {
|
|
95
|
+
error(err.message);
|
|
96
|
+
process.exit(1);
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=connections.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connections.js","sourceRoot":"","sources":["../../../src/commands/connections.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,MAAM,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,kB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