primitive-admin 1.1.0-alpha.7 → 1.1.0-alpha.71
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 +404 -80
- package/assets/skill/skills/primitive-platform/SKILL.md +808 -0
- package/dist/bin/primitive.d.ts +2 -0
- package/dist/bin/primitive.js +294 -21
- 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 +544 -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 +51 -96
- 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 +565 -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 +46 -0
- package/dist/src/commands/config.js +479 -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 +265 -0
- package/dist/src/commands/cron-triggers.js.map +1 -0
- package/dist/src/commands/database-type-configs.d.ts +2 -0
- package/dist/src/commands/database-type-configs.js +171 -0
- package/dist/src/commands/database-type-configs.js.map +1 -0
- package/dist/src/commands/database-types.d.ts +2 -0
- package/dist/src/commands/database-types.js +471 -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 +2140 -112
- package/dist/src/commands/databases.js.map +1 -1
- package/dist/src/commands/documents.d.ts +2 -0
- package/dist/src/commands/documents.js +1357 -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 +23 -0
- package/dist/src/commands/env.js +333 -0
- package/dist/src/commands/env.js.map +1 -0
- package/dist/src/commands/feature-flags.d.ts +14 -0
- package/dist/src/commands/feature-flags.js +116 -0
- package/dist/src/commands/feature-flags.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 +25 -0
- package/dist/src/commands/init.js +1605 -208
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/integrations.d.ts +2 -0
- package/dist/src/commands/integrations.js +380 -178
- package/dist/src/commands/integrations.js.map +1 -1
- package/dist/src/commands/llm.d.ts +2 -0
- package/dist/src/commands/llm.js +4 -2
- 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-category-configs.d.ts +12 -0
- package/dist/src/commands/metadata-category-configs.js +112 -0
- package/dist/src/commands/metadata-category-configs.js.map +1 -0
- package/dist/src/commands/metadata.d.ts +2 -0
- package/dist/src/commands/metadata.js +281 -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 +225 -584
- 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 +272 -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 +554 -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/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 +158 -0
- package/dist/src/commands/sync-app-settings.js +330 -0
- package/dist/src/commands/sync-app-settings.js.map +1 -0
- package/dist/src/commands/sync.d.ts +2323 -0
- package/dist/src/commands/sync.js +15065 -843
- 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 +532 -23
- 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 +562 -0
- package/dist/src/commands/webhooks.js.map +1 -0
- package/dist/src/commands/workflows.d.ts +116 -0
- package/dist/src/commands/workflows.js +1583 -681
- package/dist/src/commands/workflows.js.map +1 -1
- package/dist/src/lib/access-rule-display.d.ts +21 -0
- package/dist/src/lib/access-rule-display.js +34 -0
- package/dist/src/lib/access-rule-display.js.map +1 -0
- package/dist/src/lib/api-client.d.ts +1936 -0
- package/dist/src/lib/api-client.js +1826 -138
- package/dist/src/lib/api-client.js.map +1 -1
- package/dist/src/lib/app-settings-descriptor.d.ts +263 -0
- package/dist/src/lib/app-settings-descriptor.js +575 -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 +101 -0
- package/dist/src/lib/codegen-shared/generatedFiles.js +191 -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 +127 -0
- package/dist/src/lib/config-object-descriptor.js +658 -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 +116 -0
- package/dist/src/lib/config-payload.js.map +1 -0
- package/dist/src/lib/config-surface.d.ts +130 -0
- package/dist/src/lib/config-surface.js +300 -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-core.d.ts +147 -0
- package/dist/src/lib/env-resolver-core.js +265 -0
- package/dist/src/lib/env-resolver-core.js.map +1 -0
- package/dist/src/lib/env-resolver.d.ts +84 -0
- package/dist/src/lib/env-resolver.js +133 -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 +277 -0
- package/dist/src/lib/generated-allowlist.js.map +1 -0
- package/dist/src/lib/generated-config-surfaces.d.ts +682 -0
- package/dist/src/lib/generated-config-surfaces.js +4058 -0
- package/dist/src/lib/generated-config-surfaces.js.map +1 -0
- package/dist/src/lib/generated-template-lint.d.ts +212 -0
- package/dist/src/lib/generated-template-lint.js +624 -0
- package/dist/src/lib/generated-template-lint.js.map +1 -0
- package/dist/src/lib/init-adopt.d.ts +16 -0
- package/dist/src/lib/init-adopt.js +34 -0
- package/dist/src/lib/init-adopt.js.map +1 -0
- package/dist/src/lib/init-assets.d.ts +39 -0
- package/dist/src/lib/init-assets.js +97 -0
- package/dist/src/lib/init-assets.js.map +1 -0
- package/dist/src/lib/init-config.d.ts +98 -0
- package/dist/src/lib/init-config.js +186 -0
- package/dist/src/lib/init-config.js.map +1 -0
- package/dist/src/lib/init-ios-links.d.ts +50 -0
- package/dist/src/lib/init-ios-links.js +153 -0
- package/dist/src/lib/init-ios-links.js.map +1 -0
- package/dist/src/lib/init-plan.d.ts +80 -0
- package/dist/src/lib/init-plan.js +95 -0
- package/dist/src/lib/init-plan.js.map +1 -0
- package/dist/src/lib/init-production-env.d.ts +48 -0
- package/dist/src/lib/init-production-env.js +59 -0
- package/dist/src/lib/init-production-env.js.map +1 -0
- package/dist/src/lib/init-schema.d.ts +74 -0
- package/dist/src/lib/init-schema.js +358 -0
- package/dist/src/lib/init-schema.js.map +1 -0
- package/dist/src/lib/init-xcode.d.ts +33 -0
- package/dist/src/lib/init-xcode.js +114 -0
- package/dist/src/lib/init-xcode.js.map +1 -0
- package/dist/src/lib/integration-request-config.d.ts +30 -0
- package/dist/src/lib/integration-request-config.js +145 -0
- package/dist/src/lib/integration-request-config.js.map +1 -0
- package/dist/src/lib/local-state.d.ts +55 -0
- package/dist/src/lib/local-state.js +167 -0
- package/dist/src/lib/local-state.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/object-status-filter.d.ts +22 -0
- package/dist/src/lib/object-status-filter.js +45 -0
- package/dist/src/lib/object-status-filter.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 +63 -0
- package/dist/src/lib/platform-owned.js +85 -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 +217 -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 +64 -0
- package/dist/src/lib/resolve-init-server.js +77 -0
- package/dist/src/lib/resolve-init-server.js.map +1 -0
- package/dist/src/lib/resolve-platform.d.ts +74 -0
- package/dist/src/lib/resolve-platform.js +105 -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/server-text-normalization.d.ts +51 -0
- package/dist/src/lib/server-text-normalization.js +90 -0
- package/dist/src/lib/server-text-normalization.js.map +1 -0
- package/dist/src/lib/server-url.d.ts +22 -0
- package/dist/src/lib/server-url.js +33 -0
- package/dist/src/lib/server-url.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 +113 -0
- package/dist/src/lib/swift-codegen/dbGenerator.js +914 -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 +94 -0
- package/dist/src/lib/swift-codegen/generator.js +440 -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 +94 -0
- package/dist/src/lib/swift-codegen/siblingSymbols.js +155 -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-dir-selector.d.ts +21 -0
- package/dist/src/lib/sync-dir-selector.js +30 -0
- package/dist/src/lib/sync-dir-selector.js.map +1 -0
- package/dist/src/lib/sync-paths.d.ts +111 -0
- package/dist/src/lib/sync-paths.js +198 -0
- package/dist/src/lib/sync-paths.js.map +1 -0
- package/dist/src/lib/sync-resource-types.d.ts +544 -0
- package/dist/src/lib/sync-resource-types.js +975 -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 +170 -0
- package/dist/src/lib/template.js +484 -68
- package/dist/src/lib/template.js.map +1 -1
- package/dist/src/lib/test-case-keys.d.ts +29 -0
- package/dist/src/lib/test-case-keys.js +55 -0
- package/dist/src/lib/test-case-keys.js.map +1 -0
- package/dist/src/lib/test-case-variables.d.ts +15 -0
- package/dist/src/lib/test-case-variables.js +29 -0
- package/dist/src/lib/test-case-variables.js.map +1 -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 +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 +110 -0
- package/dist/src/lib/workflow-apply.js +164 -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 +94 -0
- package/dist/src/lib/workflow-codegen/invokerIR.js +76 -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-defaults.d.ts +29 -0
- package/dist/src/lib/workflow-defaults.js +41 -0
- package/dist/src/lib/workflow-defaults.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 +76 -0
- package/dist/src/lib/workflow-include-preserve.js +286 -0
- package/dist/src/lib/workflow-include-preserve.js.map +1 -0
- package/dist/src/lib/workflow-payload.d.ts +98 -0
- package/dist/src/lib/workflow-payload.js +178 -0
- package/dist/src/lib/workflow-payload.js.map +1 -0
- package/dist/src/lib/workflow-toml-validator.d.ts +202 -0
- package/dist/src/lib/workflow-toml-validator.js +757 -0
- package/dist/src/lib/workflow-toml-validator.js.map +1 -0
- package/dist/src/types/index.d.ts +581 -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 -8
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared source-directory resolution for the CLI codegen commands
|
|
3
|
+
* (`workflows codegen` #1442 and `databases codegen` #814, issue #1510).
|
|
4
|
+
*
|
|
5
|
+
* Both commands read a set of `*.toml` schemas out of a synced sub-directory
|
|
6
|
+
* (`workflows/` or `database-type-configs/`) and render `*.generated.ts` beside them.
|
|
7
|
+
* Historically each command located that source directory by scanning EVERY
|
|
8
|
+
* `.primitive/sync/<env>/<appId>/<subdir>` slot and either hard-erroring on
|
|
9
|
+
* more than one (`workflows`) or silently merging across environments
|
|
10
|
+
* (`databases`, via a `seenTypes` dedup). Neither did any environment
|
|
11
|
+
* resolution, so `PRIMITIVE_ENV=dev workflows codegen` would happily generate
|
|
12
|
+
* from the `alpha` TOML while `databases codegen` followed a different env —
|
|
13
|
+
* the two generated-type trees could come from different environments in one
|
|
14
|
+
* run.
|
|
15
|
+
*
|
|
16
|
+
* This helper resolves the source directory the same way every other CLI
|
|
17
|
+
* command targets an environment: `--env` → `PRIMITIVE_ENV` →
|
|
18
|
+
* `defaultEnvironment` → single-env → error. `--dir` and `--app` remain
|
|
19
|
+
* explicit overrides. It returns ONLY the resolved source directory; TOML
|
|
20
|
+
* collection, type filtering/dedup, and output-dir defaulting stay in each
|
|
21
|
+
* command.
|
|
22
|
+
*
|
|
23
|
+
* Design notes (binding, from the plan of record for #1510):
|
|
24
|
+
* - Call `getCurrentEnvironment()` DIRECTLY when no `--dir` override is given.
|
|
25
|
+
* `resolveSyncDir()`'s internal `safeEnv()` swallows the resolver's
|
|
26
|
+
* ambiguity error and falls back to `./config`, so genuine ambiguity must
|
|
27
|
+
* be surfaced here, not through `resolveSyncDir()`.
|
|
28
|
+
* - Throw plain `Error`s; the calling commands keep their existing
|
|
29
|
+
* `error(); process.exit(1)` convention (they catch at the boundary).
|
|
30
|
+
* - Do NOT use `resolveAppId()` — it is auth-oriented and exits the process,
|
|
31
|
+
* which is wrong for an offline codegen path.
|
|
32
|
+
* - Preserve the `--app`-alone legacy fallback: when `--app` is given, NO
|
|
33
|
+
* environment was explicitly requested, and env resolution fails (or there
|
|
34
|
+
* is no project config / legacy bare-dir mode), scan
|
|
35
|
+
* `.primitive/sync/<env>/<app>/<subdir>` for that specific app, resolving
|
|
36
|
+
* when it appears under exactly one env and erroring (naming the candidate
|
|
37
|
+
* envs) when it appears under more than one. This keeps the existing
|
|
38
|
+
* integration contract
|
|
39
|
+
* (`cli/tests/integration/workflows-codegen.test.ts`) intact.
|
|
40
|
+
* - Do NOT fall through to that scan when an environment WAS explicitly named
|
|
41
|
+
* (`--env` or `PRIMITIVE_ENV`) but is invalid/unknown: surface the
|
|
42
|
+
* resolver's error instead, so an explicit env selection never silently
|
|
43
|
+
* generates code from a different synced environment.
|
|
44
|
+
*/
|
|
45
|
+
export interface ResolveCodegenSourceDirOptions {
|
|
46
|
+
/** `--app <app-id>` override, if the user passed it. */
|
|
47
|
+
app?: string;
|
|
48
|
+
/** The resolved sync-directory override (`--dir <path>`), if the user passed it. */
|
|
49
|
+
syncDir?: string;
|
|
50
|
+
}
|
|
51
|
+
export interface ResolveCodegenSourceDirArgs {
|
|
52
|
+
/** The synced sub-directory to resolve, e.g. "workflows" or "database-type-configs". */
|
|
53
|
+
subdir: string;
|
|
54
|
+
/** Parsed command options (`--app`, plus the resolved `--dir` override). */
|
|
55
|
+
options: ResolveCodegenSourceDirOptions;
|
|
56
|
+
/**
|
|
57
|
+
* Working directory the legacy scan is rooted at. Defaults to
|
|
58
|
+
* `process.cwd()`; parameterised so unit tests can point it at a tmp tree
|
|
59
|
+
* (vitest workers can't `chdir`).
|
|
60
|
+
*/
|
|
61
|
+
cwd?: string;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Resolves the single source directory a codegen command should read its
|
|
65
|
+
* `*.toml` schemas from. Throws a plain `Error` (with a user-facing message)
|
|
66
|
+
* when the directory can't be resolved unambiguously or doesn't exist.
|
|
67
|
+
*/
|
|
68
|
+
export declare function resolveCodegenSourceDir(args: ResolveCodegenSourceDirArgs): string;
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared source-directory resolution for the CLI codegen commands
|
|
3
|
+
* (`workflows codegen` #1442 and `databases codegen` #814, issue #1510).
|
|
4
|
+
*
|
|
5
|
+
* Both commands read a set of `*.toml` schemas out of a synced sub-directory
|
|
6
|
+
* (`workflows/` or `database-type-configs/`) and render `*.generated.ts` beside them.
|
|
7
|
+
* Historically each command located that source directory by scanning EVERY
|
|
8
|
+
* `.primitive/sync/<env>/<appId>/<subdir>` slot and either hard-erroring on
|
|
9
|
+
* more than one (`workflows`) or silently merging across environments
|
|
10
|
+
* (`databases`, via a `seenTypes` dedup). Neither did any environment
|
|
11
|
+
* resolution, so `PRIMITIVE_ENV=dev workflows codegen` would happily generate
|
|
12
|
+
* from the `alpha` TOML while `databases codegen` followed a different env —
|
|
13
|
+
* the two generated-type trees could come from different environments in one
|
|
14
|
+
* run.
|
|
15
|
+
*
|
|
16
|
+
* This helper resolves the source directory the same way every other CLI
|
|
17
|
+
* command targets an environment: `--env` → `PRIMITIVE_ENV` →
|
|
18
|
+
* `defaultEnvironment` → single-env → error. `--dir` and `--app` remain
|
|
19
|
+
* explicit overrides. It returns ONLY the resolved source directory; TOML
|
|
20
|
+
* collection, type filtering/dedup, and output-dir defaulting stay in each
|
|
21
|
+
* command.
|
|
22
|
+
*
|
|
23
|
+
* Design notes (binding, from the plan of record for #1510):
|
|
24
|
+
* - Call `getCurrentEnvironment()` DIRECTLY when no `--dir` override is given.
|
|
25
|
+
* `resolveSyncDir()`'s internal `safeEnv()` swallows the resolver's
|
|
26
|
+
* ambiguity error and falls back to `./config`, so genuine ambiguity must
|
|
27
|
+
* be surfaced here, not through `resolveSyncDir()`.
|
|
28
|
+
* - Throw plain `Error`s; the calling commands keep their existing
|
|
29
|
+
* `error(); process.exit(1)` convention (they catch at the boundary).
|
|
30
|
+
* - Do NOT use `resolveAppId()` — it is auth-oriented and exits the process,
|
|
31
|
+
* which is wrong for an offline codegen path.
|
|
32
|
+
* - Preserve the `--app`-alone legacy fallback: when `--app` is given, NO
|
|
33
|
+
* environment was explicitly requested, and env resolution fails (or there
|
|
34
|
+
* is no project config / legacy bare-dir mode), scan
|
|
35
|
+
* `.primitive/sync/<env>/<app>/<subdir>` for that specific app, resolving
|
|
36
|
+
* when it appears under exactly one env and erroring (naming the candidate
|
|
37
|
+
* envs) when it appears under more than one. This keeps the existing
|
|
38
|
+
* integration contract
|
|
39
|
+
* (`cli/tests/integration/workflows-codegen.test.ts`) intact.
|
|
40
|
+
* - Do NOT fall through to that scan when an environment WAS explicitly named
|
|
41
|
+
* (`--env` or `PRIMITIVE_ENV`) but is invalid/unknown: surface the
|
|
42
|
+
* resolver's error instead, so an explicit env selection never silently
|
|
43
|
+
* generates code from a different synced environment.
|
|
44
|
+
*/
|
|
45
|
+
import { existsSync, readdirSync } from "fs";
|
|
46
|
+
import { basename, dirname, join } from "path";
|
|
47
|
+
import { getCurrentEnvironment, getExplicitEnvName } from "../env-resolver.js";
|
|
48
|
+
import { getCurrentAppId } from "../config.js";
|
|
49
|
+
import { resolveSyncDir, assertSafePathComponent } from "../sync-paths.js";
|
|
50
|
+
/**
|
|
51
|
+
* Resolves the single source directory a codegen command should read its
|
|
52
|
+
* `*.toml` schemas from. Throws a plain `Error` (with a user-facing message)
|
|
53
|
+
* when the directory can't be resolved unambiguously or doesn't exist.
|
|
54
|
+
*/
|
|
55
|
+
export function resolveCodegenSourceDir(args) {
|
|
56
|
+
const { subdir, options } = args;
|
|
57
|
+
const cwd = args.cwd ?? process.cwd();
|
|
58
|
+
// 1. --dir is an explicit override: use <dir>/<subdir> verbatim.
|
|
59
|
+
if (options.syncDir) {
|
|
60
|
+
return requireExisting(join(options.syncDir, subdir), subdir, undefined);
|
|
61
|
+
}
|
|
62
|
+
// 2. Resolve the active environment. Call getCurrentEnvironment() directly
|
|
63
|
+
// (not via resolveSyncDir/safeEnv) so a genuinely ambiguous project
|
|
64
|
+
// surfaces the resolver's "No environment selected… Available: …" error
|
|
65
|
+
// with a non-zero exit — unless the caller narrowed the target with
|
|
66
|
+
// --app AND did not name an environment, in which case we fall back to the
|
|
67
|
+
// legacy per-app scan.
|
|
68
|
+
//
|
|
69
|
+
// The `--app`-alone fallback only applies when NO environment was
|
|
70
|
+
// explicitly requested (neither `--env` nor `PRIMITIVE_ENV`). When the
|
|
71
|
+
// user DID name an env but it's invalid/unknown, getCurrentEnvironment()
|
|
72
|
+
// throws; we must surface that error (non-zero exit) rather than silently
|
|
73
|
+
// scanning the app under some OTHER synced environment — that would
|
|
74
|
+
// generate code from the wrong env instead of honoring the explicit
|
|
75
|
+
// selection.
|
|
76
|
+
const explicitEnvRequested = getExplicitEnvName() !== null || !!process.env.PRIMITIVE_ENV;
|
|
77
|
+
let env;
|
|
78
|
+
try {
|
|
79
|
+
env = getCurrentEnvironment();
|
|
80
|
+
}
|
|
81
|
+
catch (err) {
|
|
82
|
+
if (options.app && !explicitEnvRequested) {
|
|
83
|
+
return scanSyncTree({ subdir, appId: options.app, cwd });
|
|
84
|
+
}
|
|
85
|
+
throw err;
|
|
86
|
+
}
|
|
87
|
+
// 3. Project mode: resolve the app id and build the env/app-scoped path.
|
|
88
|
+
if (env) {
|
|
89
|
+
const appId = options.app ?? env.config.appId ?? getCurrentAppId();
|
|
90
|
+
if (!appId) {
|
|
91
|
+
throw new Error(`No app configured for environment "${env.name}" in .primitive/config.json ` +
|
|
92
|
+
`and no --app given. Add "appId" to the environment or pass --app <app-id>.`);
|
|
93
|
+
}
|
|
94
|
+
// resolveSyncDir re-reads the (cached) resolved env and guards appId via
|
|
95
|
+
// assertSafePathComponent, so an unsafe --app is rejected here.
|
|
96
|
+
const dir = join(resolveSyncDir({ appId }), subdir);
|
|
97
|
+
return requireExisting(dir, subdir, appId);
|
|
98
|
+
}
|
|
99
|
+
// 4. Legacy / bare-dir mode (no .primitive/config.json): scan the sync tree,
|
|
100
|
+
// filtered to --app when given. This preserves the pre-#1510 behavior.
|
|
101
|
+
return scanSyncTree({ subdir, appId: options.app, cwd });
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Legacy fallback: scan `<cwd>/.primitive/sync/<env>/<app>/<subdir>` for a
|
|
105
|
+
* source directory. When `appId` is given, only that app's slots are
|
|
106
|
+
* considered. Resolves to the single match; errors clearly on zero or on
|
|
107
|
+
* ambiguity (naming the candidate apps or envs).
|
|
108
|
+
*/
|
|
109
|
+
function scanSyncTree(args) {
|
|
110
|
+
const { subdir, appId, cwd } = args;
|
|
111
|
+
// Defence-in-depth: an --app value flows into a file-system path below, so
|
|
112
|
+
// reject separators / `..` before using it.
|
|
113
|
+
if (appId)
|
|
114
|
+
assertSafePathComponent(appId, "appId");
|
|
115
|
+
const root = join(cwd, ".primitive", "sync");
|
|
116
|
+
const found = [];
|
|
117
|
+
if (existsSync(root)) {
|
|
118
|
+
for (const envName of readdirSync(root)) {
|
|
119
|
+
const envDir = join(root, envName);
|
|
120
|
+
try {
|
|
121
|
+
for (const app of readdirSync(envDir)) {
|
|
122
|
+
if (appId && app !== appId)
|
|
123
|
+
continue;
|
|
124
|
+
const candidate = join(envDir, app, subdir);
|
|
125
|
+
if (existsSync(candidate))
|
|
126
|
+
found.push(candidate);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
catch {
|
|
130
|
+
// Not a directory (or unreadable) — skip.
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
if (found.length === 0) {
|
|
135
|
+
throw new Error(notFoundMessage(subdir, appId));
|
|
136
|
+
}
|
|
137
|
+
if (found.length > 1) {
|
|
138
|
+
if (appId) {
|
|
139
|
+
const envs = [
|
|
140
|
+
...new Set(found.map((d) => basename(dirname(dirname(d))))),
|
|
141
|
+
];
|
|
142
|
+
throw new Error(`App "${appId}" has a ${subdir}/ directory under multiple environments: ` +
|
|
143
|
+
`${envs.join(", ")}.\n` +
|
|
144
|
+
found.map((d) => ` ${d}`).join("\n") +
|
|
145
|
+
`\nPass --env <name> or --dir to select one.`);
|
|
146
|
+
}
|
|
147
|
+
const apps = [...new Set(found.map((d) => basename(dirname(d))))];
|
|
148
|
+
throw new Error(`Found ${subdir}/ directories for more than one app/env:\n` +
|
|
149
|
+
found.map((d) => ` ${d}`).join("\n") +
|
|
150
|
+
`\nCodegen writes into one output dir, so it must run against one app. ` +
|
|
151
|
+
`Pass --app <app-id> (found: ${apps.join(", ")}) or --dir to select one.`);
|
|
152
|
+
}
|
|
153
|
+
return found[0];
|
|
154
|
+
}
|
|
155
|
+
/** Verifies `dir` exists, throwing the standard "no source dir" error otherwise. */
|
|
156
|
+
function requireExisting(dir, subdir, appId) {
|
|
157
|
+
if (!existsSync(dir)) {
|
|
158
|
+
throw new Error(notFoundMessage(subdir, appId));
|
|
159
|
+
}
|
|
160
|
+
return dir;
|
|
161
|
+
}
|
|
162
|
+
function notFoundMessage(subdir, appId) {
|
|
163
|
+
return appId
|
|
164
|
+
? `No ${subdir}/ directory found for app "${appId}" under .primitive/sync/. ` +
|
|
165
|
+
`Check the --app id, pass --dir, or run \`primitive config pull\` first.`
|
|
166
|
+
: `No ${subdir}/ directory found. Pass --dir or run \`primitive config pull\` first.`;
|
|
167
|
+
}
|
|
168
|
+
//# sourceMappingURL=resolveCodegenSourceDir.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveCodegenSourceDir.js","sourceRoot":"","sources":["../../../../src/lib/codegen-shared/resolveCodegenSourceDir.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAEH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,IAAI,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAsB3E;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,IAAiC;IACvE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IACjC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;IAEtC,iEAAiE;IACjE,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;QACpB,OAAO,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;IAC3E,CAAC;IAED,2EAA2E;IAC3E,uEAAuE;IACvE,2EAA2E;IAC3E,uEAAuE;IACvE,8EAA8E;IAC9E,0BAA0B;IAC1B,EAAE;IACF,qEAAqE;IACrE,0EAA0E;IAC1E,4EAA4E;IAC5E,6EAA6E;IAC7E,uEAAuE;IACvE,uEAAuE;IACvE,gBAAgB;IAChB,MAAM,oBAAoB,GACxB,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is authored in TOML and applied with `config push`.
|
|
5
|
+
* That makes the TOML field surface the thing an operator has to discover, so
|
|
6
|
+
* it needs a machine-readable definition — the job per-flag `--help` used to do.
|
|
7
|
+
* This registry is that definition, and it drives four commands:
|
|
8
|
+
*
|
|
9
|
+
* - `config fields <type>` lists a type's keys, types, required, default
|
|
10
|
+
* - `config create <type> <key>` scaffolds the type's file from `scaffold()`
|
|
11
|
+
* - `config set <type>/<key>` validates the dotted path being edited
|
|
12
|
+
* - `config push --only <sel>` resolves a selector to a type + key
|
|
13
|
+
*
|
|
14
|
+
* ── Deliberately a descriptor, never reflection ──────────────────────────
|
|
15
|
+
* The field list is declared here, not inferred from the pull serializers in
|
|
16
|
+
* `commands/sync.ts`. Reflection over emitted keys cannot report `required` or
|
|
17
|
+
* `default`, and an implicit field surface is exactly the drift #2644 exists to
|
|
18
|
+
* end. The workflow key set is CONSUMED from #2644's vendored definition
|
|
19
|
+
* (`config-surface.ts` / `generated-config-surfaces.ts`) and the app settings
|
|
20
|
+
* from `app-settings-descriptor.ts`, rather than restated, so there is still
|
|
21
|
+
* one definition per field.
|
|
22
|
+
*
|
|
23
|
+
* ── Drift guard ──────────────────────────────────────────────────────────
|
|
24
|
+
* `cli/tests/unit/config-object-descriptor.test.ts` cross-checks the registry
|
|
25
|
+
* against `SYNC_RESOURCE_TYPES` (every per-entity type has exactly one
|
|
26
|
+
* descriptor) and `PUSH_PRUNE_SPECS` (the declared identity path is a real
|
|
27
|
+
* field), and asserts each scaffold parses and carries every required field. A
|
|
28
|
+
* new sync resource type therefore fails a test rather than silently
|
|
29
|
+
* under-reporting from `config fields`.
|
|
30
|
+
*
|
|
31
|
+
* ── Relationship to #2644 ────────────────────────────────────────────────
|
|
32
|
+
* #2644 defines one shared field definition across the server, the TOML surface
|
|
33
|
+
* and CLI validation. These descriptors are sized to be ABSORBED by it: they
|
|
34
|
+
* carry only what the four commands above need, and no validation behavior.
|
|
35
|
+
*/
|
|
36
|
+
import { type SyncResourceType } from "./sync-resource-types.js";
|
|
37
|
+
/** Value shape of a TOML key, as reported by `config fields`. */
|
|
38
|
+
export type ConfigFieldType = "string" | "number" | "boolean" | "string[]" | "table" | "table[]" | "json";
|
|
39
|
+
export interface ConfigFieldDescriptor {
|
|
40
|
+
/** Dotted TOML path, e.g. `workflow.status`, `verification.jwt`. */
|
|
41
|
+
path: string;
|
|
42
|
+
type: ConfigFieldType;
|
|
43
|
+
/** True when `config push` cannot apply the file without this key. */
|
|
44
|
+
required: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* The value the server assumes when the key is absent. `undefined` means
|
|
47
|
+
* there is no default — an absent key leaves the field unset (or, for the
|
|
48
|
+
* TOML-owned fields, clears it).
|
|
49
|
+
*/
|
|
50
|
+
default?: string | number | boolean;
|
|
51
|
+
/** One line, shown by `config fields`. */
|
|
52
|
+
description: string;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* A second file the same object is authored across (issue #2645).
|
|
56
|
+
*
|
|
57
|
+
* A workflow's named configs are sidecar files (`workflows/<key>.configs/
|
|
58
|
+
* <name>.toml`, spec §Contracts/Named configs), authored by the same person as
|
|
59
|
+
* the workflow and pushed by the same command — but they are not keys of
|
|
60
|
+
* `workflows/<key>.toml`, so they cannot be fields of the descriptor without
|
|
61
|
+
* telling `config set` to write them into the wrong file. They are listed
|
|
62
|
+
* separately instead: `config fields` has to report the whole surface, because
|
|
63
|
+
* it is what replaced per-flag `--help` for the removed `workflows configs`
|
|
64
|
+
* verbs (criterion 7).
|
|
65
|
+
*/
|
|
66
|
+
export interface ConfigObjectCompanionFile {
|
|
67
|
+
/** Where the companion lives, e.g. `workflows/<key>.configs/<name>.toml`. */
|
|
68
|
+
fileHint: string;
|
|
69
|
+
/** One line saying what the file is and what names it. */
|
|
70
|
+
description: string;
|
|
71
|
+
fields: readonly ConfigFieldDescriptor[];
|
|
72
|
+
}
|
|
73
|
+
export interface ConfigObjectDescriptor {
|
|
74
|
+
/** Selector name: `workflow`, `webhook`, `app`, `var`. */
|
|
75
|
+
type: string;
|
|
76
|
+
/**
|
|
77
|
+
* Layout metadata for the 13 per-entity types. Absent for the two root
|
|
78
|
+
* singletons (`app.toml`, `vars.toml`), which `SYNC_RESOURCE_TYPES`
|
|
79
|
+
* deliberately excludes.
|
|
80
|
+
*/
|
|
81
|
+
resourceType?: SyncResourceType;
|
|
82
|
+
/** Where the object is authored, for help text and error messages. */
|
|
83
|
+
fileHint: string;
|
|
84
|
+
/**
|
|
85
|
+
* Dotted path of the key that names the object, when it has one in-file.
|
|
86
|
+
* Types keyed purely by filename (transforms, rule-sets) declare none.
|
|
87
|
+
*/
|
|
88
|
+
identity?: string;
|
|
89
|
+
/** One line describing what the object configures. */
|
|
90
|
+
description: string;
|
|
91
|
+
fields: readonly ConfigFieldDescriptor[];
|
|
92
|
+
/** Further files the object is authored across, listed but not `config set`-able. */
|
|
93
|
+
companionFiles?: readonly ConfigObjectCompanionFile[];
|
|
94
|
+
/**
|
|
95
|
+
* True when the file's root-level keys are the author's own rather than a
|
|
96
|
+
* fixed surface — `vars.toml` is a flat `KEY = "value"` table. There is no
|
|
97
|
+
* field list to declare, so `config set` accepts any single-segment path.
|
|
98
|
+
*/
|
|
99
|
+
freeFormRootKeys?: boolean;
|
|
100
|
+
/** The file body `config create <type> <key>` writes. */
|
|
101
|
+
scaffold(key: string): string;
|
|
102
|
+
}
|
|
103
|
+
/** The identity path a descriptor declares, or `undefined` when keyed by filename. */
|
|
104
|
+
export declare function describedIdentityPath(descriptor: ConfigObjectDescriptor): string | undefined;
|
|
105
|
+
/**
|
|
106
|
+
* What the server assumes when a `[workflow]` key is absent.
|
|
107
|
+
*
|
|
108
|
+
* The vendored `WORKFLOW_TABLE` (#2644) carries key set and value shape but
|
|
109
|
+
* not defaults, so the defaults are stated here, next to the other types'.
|
|
110
|
+
* They are not free text: the `models.yaml` `WorkflowDefinition` defaults are
|
|
111
|
+
* the source of truth, and
|
|
112
|
+
* `cli/tests/unit/config-object-descriptor.test.ts` parses that model and fails
|
|
113
|
+
* when a default here disagrees or a newly-defaulted field is missing. Without
|
|
114
|
+
* them `config fields workflow` reported `default null` for the queueing and
|
|
115
|
+
* dispatch knobs — the command that replaced per-flag `--help` under-reporting
|
|
116
|
+
* exactly what the removed flags used to document (issue #2645).
|
|
117
|
+
*
|
|
118
|
+
* Exported because `config diff`'s workflow comparator needs exactly this table
|
|
119
|
+
* to normalize omitted-vs-defaulted fields, and kept a hand-mirrored second
|
|
120
|
+
* copy of it until #2731. Two tables can disagree; a guarded one cannot go
|
|
121
|
+
* stale unnoticed.
|
|
122
|
+
*/
|
|
123
|
+
export declare const WORKFLOW_FIELD_DEFAULTS: Record<string, string | number | boolean>;
|
|
124
|
+
export declare const CONFIG_OBJECT_DESCRIPTORS: readonly ConfigObjectDescriptor[];
|
|
125
|
+
/** Every selector type name, in registry order. */
|
|
126
|
+
export declare const CONFIG_OBJECT_TYPES: readonly string[];
|
|
127
|
+
export declare function getConfigObjectDescriptor(type: string): ConfigObjectDescriptor | undefined;
|