primitive-admin 1.1.0-alpha.6 → 1.1.0-alpha.61
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,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED FILE — DO NOT EDIT BY HAND.
|
|
3
|
+
*
|
|
4
|
+
* Source of truth: the `WorkflowDefinition` model in the repo-root
|
|
5
|
+
* `models.yaml` — the one statically-parseable server anchor for the
|
|
6
|
+
* `[workflow]`-level config surface (issue #2326, Phase 1 of #1976).
|
|
7
|
+
*
|
|
8
|
+
* Regenerate with:
|
|
9
|
+
* node cli/scripts/gen-workflow-fields.mjs (runs automatically at CLI prebuild)
|
|
10
|
+
*
|
|
11
|
+
* A CI freshness guard (`cli/scripts/gen-workflow-fields.mjs --check`, also
|
|
12
|
+
* asserted by `cli/tests/unit/workflow-field-descriptor-drift-guard.test.ts`)
|
|
13
|
+
* fails if this committed artifact does not match a fresh parse of
|
|
14
|
+
* `models.yaml`. The same test asserts every field below is classified in
|
|
15
|
+
* `cli/src/lib/workflow-field-descriptor.ts` as synced, structural, or
|
|
16
|
+
* internal — so a new server-side workflow field cannot be silently ignored by
|
|
17
|
+
* the CLI.
|
|
18
|
+
*/
|
|
19
|
+
/** Every `WorkflowDefinition` field, in `models.yaml` declaration order (#2326). */
|
|
20
|
+
export const GENERATED_WORKFLOW_MODEL_FIELDS = [
|
|
21
|
+
"workflowId",
|
|
22
|
+
"appId",
|
|
23
|
+
"workflowKey",
|
|
24
|
+
"name",
|
|
25
|
+
"status",
|
|
26
|
+
"latestRevision",
|
|
27
|
+
"description",
|
|
28
|
+
"stepsR2Key",
|
|
29
|
+
"draftStepsR2Key",
|
|
30
|
+
"draftInputSchema",
|
|
31
|
+
"draftOutputSchema",
|
|
32
|
+
"draftModifiedAt",
|
|
33
|
+
"activeConfigId",
|
|
34
|
+
"inputSchema",
|
|
35
|
+
"outputSchema",
|
|
36
|
+
"perUserMaxRunning",
|
|
37
|
+
"perUserMaxQueued",
|
|
38
|
+
"perAppMaxRunning",
|
|
39
|
+
"perAppMaxQueued",
|
|
40
|
+
"queueTtlSeconds",
|
|
41
|
+
"dequeueOrder",
|
|
42
|
+
"requiresClientApply",
|
|
43
|
+
"syncCallable",
|
|
44
|
+
"accessRule",
|
|
45
|
+
"metadataManifest",
|
|
46
|
+
"runAs",
|
|
47
|
+
"lock",
|
|
48
|
+
"capabilities",
|
|
49
|
+
"createdBy",
|
|
50
|
+
"createdAt",
|
|
51
|
+
"modifiedAt",
|
|
52
|
+
];
|
|
53
|
+
//# sourceMappingURL=generated-workflow-model-fields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-workflow-model-fields.js","sourceRoot":"","sources":["../../../src/lib/generated-workflow-model-fields.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,oFAAoF;AACpF,MAAM,CAAC,MAAM,+BAA+B,GAAsB;IAChE,YAAY;IACZ,OAAO;IACP,aAAa;IACb,MAAM;IACN,QAAQ;IACR,gBAAgB;IAChB,aAAa;IACb,YAAY;IACZ,iBAAiB;IACjB,kBAAkB;IAClB,mBAAmB;IACnB,iBAAiB;IACjB,gBAAgB;IAChB,aAAa;IACb,cAAc;IACd,mBAAmB;IACnB,kBAAkB;IAClB,kBAAkB;IAClB,iBAAiB;IACjB,iBAAiB;IACjB,cAAc;IACd,qBAAqB;IACrB,cAAc;IACd,YAAY;IACZ,kBAAkB;IAClB,OAAO;IACP,MAAM;IACN,cAAc;IACd,WAAW;IACX,WAAW;IACX,YAAY;CACb,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The operator-facing warning for an app whose stored `googleClientSecret` is
|
|
3
|
+
* not a `{{secrets.KEY}}` reference (#2256, #2307).
|
|
4
|
+
*
|
|
5
|
+
* The server never sends such a value back: `GET /settings` omits the key and
|
|
6
|
+
* reports `googleClientSecretStatus` in its place, so the only way an operator
|
|
7
|
+
* learns the field is still unmigrated is a command that reads the status and
|
|
8
|
+
* says so. Two do — `settings get` and `sync pull` — and
|
|
9
|
+
* each has two statuses to describe, so the wording lives here once and the
|
|
10
|
+
* call sites supply only what genuinely differs: how the field is named in that
|
|
11
|
+
* context, where the value is missing from, and what the un-migrated value
|
|
12
|
+
* blocks.
|
|
13
|
+
*
|
|
14
|
+
* Modelled on `signingSecretStatusWarning` (the same problem for
|
|
15
|
+
* `webhook.signingSecret`), deliberately kept as a separate function: the
|
|
16
|
+
* remediation names a different TOML key, and a `legacy-literal` blocks
|
|
17
|
+
* different things on the two fields.
|
|
18
|
+
*
|
|
19
|
+
* Returns `null` for a status that needs no warning (`reference`, `unset`, or
|
|
20
|
+
* anything a newer server adds), so a call site is one `if` rather than two.
|
|
21
|
+
*/
|
|
22
|
+
export declare function googleClientSecretStatusWarning(status: string | null | undefined, context: {
|
|
23
|
+
/** How to name the field, e.g. `"googleClientSecret"`. Starts the sentence. */
|
|
24
|
+
subject: string;
|
|
25
|
+
/** Where the value is missing from, e.g. `"this output"`. */
|
|
26
|
+
withheldFrom: string;
|
|
27
|
+
/**
|
|
28
|
+
* What an un-migrated value blocks, e.g. `"the next settings write will be
|
|
29
|
+
* rejected"`. Every settings write on such an app fails unless it carries a
|
|
30
|
+
* `googleClientSecret` that migrates the field
|
|
31
|
+
* (`validateGoogleClientSecretMigration`), and a pulled `app.toml` never
|
|
32
|
+
* carries one — so for the pull paths this is the concrete consequence.
|
|
33
|
+
*/
|
|
34
|
+
blocks: string;
|
|
35
|
+
}): string | null;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The operator-facing warning for an app whose stored `googleClientSecret` is
|
|
3
|
+
* not a `{{secrets.KEY}}` reference (#2256, #2307).
|
|
4
|
+
*
|
|
5
|
+
* The server never sends such a value back: `GET /settings` omits the key and
|
|
6
|
+
* reports `googleClientSecretStatus` in its place, so the only way an operator
|
|
7
|
+
* learns the field is still unmigrated is a command that reads the status and
|
|
8
|
+
* says so. Two do — `settings get` and `sync pull` — and
|
|
9
|
+
* each has two statuses to describe, so the wording lives here once and the
|
|
10
|
+
* call sites supply only what genuinely differs: how the field is named in that
|
|
11
|
+
* context, where the value is missing from, and what the un-migrated value
|
|
12
|
+
* blocks.
|
|
13
|
+
*
|
|
14
|
+
* Modelled on `signingSecretStatusWarning` (the same problem for
|
|
15
|
+
* `webhook.signingSecret`), deliberately kept as a separate function: the
|
|
16
|
+
* remediation names a different TOML key, and a `legacy-literal` blocks
|
|
17
|
+
* different things on the two fields.
|
|
18
|
+
*
|
|
19
|
+
* Returns `null` for a status that needs no warning (`reference`, `unset`, or
|
|
20
|
+
* anything a newer server adds), so a call site is one `if` rather than two.
|
|
21
|
+
*/
|
|
22
|
+
export function googleClientSecretStatusWarning(status, context) {
|
|
23
|
+
const remediation = "Store the value with `primitive secrets set KEY --value <value>` and set " +
|
|
24
|
+
'googleClientSecret = "{{secrets.KEY}}".';
|
|
25
|
+
if (status === "legacy-literal") {
|
|
26
|
+
return (`${context.subject} still holds a raw value rather than a {{secrets.KEY}} reference, ` +
|
|
27
|
+
`so it is withheld from ${context.withheldFrom}. Google sign-in keeps working, but the ` +
|
|
28
|
+
`value is deprecated and ${context.blocks} until it is migrated. ${remediation}`);
|
|
29
|
+
}
|
|
30
|
+
// Not a working legacy literal: the stored value carries reference syntax
|
|
31
|
+
// that resolves to nothing, so Google sign-in is already failing (#2332).
|
|
32
|
+
//
|
|
33
|
+
// Two deliberate differences from the branch above, both to keep `settings
|
|
34
|
+
// show`'s output byte-identical to what PR #2293 shipped:
|
|
35
|
+
//
|
|
36
|
+
// - `context.blocks` is unused. A push of the pulled file is rejected for
|
|
37
|
+
// this status too (`validateGoogleClientSecretMigration` gates on
|
|
38
|
+
// `isWithheldSecretStatus`, which covers both), but the sign-in outage is
|
|
39
|
+
// the louder problem and the remediation below already fixes both. The
|
|
40
|
+
// sibling `signingSecretStatusWarning` drops `blocks` in its malformed
|
|
41
|
+
// branch the same way.
|
|
42
|
+
// - The remediation sentence is written out rather than interpolating the
|
|
43
|
+
// `remediation` constant above: this one says "the real client secret",
|
|
44
|
+
// which the shared sentence does not.
|
|
45
|
+
//
|
|
46
|
+
// Both are worth revisiting together if `settings get`'s wording is ever
|
|
47
|
+
// allowed to change.
|
|
48
|
+
if (status === "malformed-reference") {
|
|
49
|
+
return (`${context.subject} is neither a {{secrets.KEY}} reference nor a plain stored value — it ` +
|
|
50
|
+
`carries reference syntax that does not resolve, so it is withheld from ${context.withheldFrom} ` +
|
|
51
|
+
"and Google sign-in is already FAILING. Store the real client secret with " +
|
|
52
|
+
'`primitive secrets set KEY --value <value>` and set googleClientSecret = "{{secrets.KEY}}".');
|
|
53
|
+
}
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=google-client-secret-status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"google-client-secret-status.js","sourceRoot":"","sources":["../../../src/lib/google-client-secret-status.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,+BAA+B,CAC7C,MAAiC,EACjC,OAaC;IAED,MAAM,WAAW,GACf,2EAA2E;QAC3E,yCAAyC,CAAC;IAC5C,IAAI,MAAM,KAAK,gBAAgB,EAAE,CAAC;QAChC,OAAO,CACL,GAAG,OAAO,CAAC,OAAO,oEAAoE;YACtF,0BAA0B,OAAO,CAAC,YAAY,0CAA0C;YACxF,2BAA2B,OAAO,CAAC,MAAM,0BAA0B,WAAW,EAAE,CACjF,CAAC;IACJ,CAAC;IACD,0EAA0E;IAC1E,0EAA0E;IAC1E,EAAE;IACF,2EAA2E;IAC3E,0DAA0D;IAC1D,EAAE;IACF,4EAA4E;IAC5E,sEAAsE;IACtE,8EAA8E;IAC9E,2EAA2E;IAC3E,2EAA2E;IAC3E,2BAA2B;IAC3B,4EAA4E;IAC5E,4EAA4E;IAC5E,0CAA0C;IAC1C,EAAE;IACF,yEAAyE;IACzE,qBAAqB;IACrB,IAAI,MAAM,KAAK,qBAAqB,EAAE,CAAC;QACrC,OAAO,CACL,GAAG,OAAO,CAAC,OAAO,wEAAwE;YAC1F,0EAA0E,OAAO,CAAC,YAAY,GAAG;YACjG,2EAA2E;YAC3E,6FAA6F,CAC9F,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
export declare const INIT_CONFIG_FILENAME = ".primitive-init.toml";
|
|
2
|
+
export interface InitConfig {
|
|
3
|
+
/** Whether to create a new app or use an existing one */
|
|
4
|
+
action: "create" | "use-existing";
|
|
5
|
+
/** App name (required for action = "create") */
|
|
6
|
+
app_name?: string;
|
|
7
|
+
/** Existing app ID (required for action = "use-existing") */
|
|
8
|
+
app_id?: string;
|
|
9
|
+
/** Project directory name */
|
|
10
|
+
dir?: string;
|
|
11
|
+
/** Access mode for the app */
|
|
12
|
+
access_mode?: "public" | "domain" | "invite-only";
|
|
13
|
+
/** Port for local dev server */
|
|
14
|
+
dev_port?: number;
|
|
15
|
+
/** Whether to skip npm install */
|
|
16
|
+
skip_install?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Custom server URL. Behaves like the `-s/--server` flag: the app is created
|
|
19
|
+
* on this server and the scaffolded project config records it. The flag wins
|
|
20
|
+
* when both are given. (#2376)
|
|
21
|
+
*/
|
|
22
|
+
server?: string;
|
|
23
|
+
/** Email addresses to invite (for invite-only mode) */
|
|
24
|
+
invite_emails?: string[];
|
|
25
|
+
/** Allowed email domains (for domain mode) */
|
|
26
|
+
allowed_domains?: string[];
|
|
27
|
+
/** Whether to overwrite a non-empty target directory (default: false) */
|
|
28
|
+
overwrite?: boolean;
|
|
29
|
+
/** Target platform for the scaffolded app */
|
|
30
|
+
platform?: "web" | "ios";
|
|
31
|
+
}
|
|
32
|
+
export interface ValidationResult {
|
|
33
|
+
valid: boolean;
|
|
34
|
+
errors: string[];
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Resolves the "use an existing app" app id from the two places it can be
|
|
38
|
+
* specified: the `--use-existing-app-id` CLI flag (highest precedence) or an
|
|
39
|
+
* init-config TOML with `action = "use-existing"` + `app_id`.
|
|
40
|
+
*
|
|
41
|
+
* Before this existed, `init` only read the flag, so a `use-existing` TOML fell
|
|
42
|
+
* through to the create-app branch and interactively prompted for an app name —
|
|
43
|
+
* hanging non-interactive (`--config`) runs. (See js-bao-wss #1217.)
|
|
44
|
+
*
|
|
45
|
+
* Returns `undefined` when neither source selects an existing app (i.e. the run
|
|
46
|
+
* should create a new app).
|
|
47
|
+
*/
|
|
48
|
+
export declare function resolveUseExistingAppId(flag: string | undefined, initConfig: InitConfig | null): string | undefined;
|
|
49
|
+
/** Where the resolved "skip dependency install" decision came from. */
|
|
50
|
+
export type SkipInstallSource = "flag" | "config" | "default";
|
|
51
|
+
export interface ResolvedSkipInstall {
|
|
52
|
+
skipInstall: boolean;
|
|
53
|
+
source: SkipInstallSource;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Resolves whether `primitive init` skips the dependency install, from the two
|
|
57
|
+
* places it can be requested: the `--skip-install` flag (highest precedence)
|
|
58
|
+
* or `skip_install = true` in the init-config TOML.
|
|
59
|
+
*
|
|
60
|
+
* `init` used to read only the flag, so a config's `skip_install` was silently
|
|
61
|
+
* ignored and CI runs installed anyway (#2720). Precedence matches #2376's
|
|
62
|
+
* `server` fix: the flag wins. Because `--skip-install` is a boolean flag it
|
|
63
|
+
* can only ever request a skip, so an explicit `skip_install = false` in the
|
|
64
|
+
* config cannot un-skip a run that passed the flag.
|
|
65
|
+
*/
|
|
66
|
+
export declare function resolveSkipInstall(flag: boolean | undefined, initConfig: InitConfig | null): ResolvedSkipInstall;
|
|
67
|
+
/**
|
|
68
|
+
* Parses a TOML string into an InitConfig object.
|
|
69
|
+
* Throws if the string contains invalid TOML.
|
|
70
|
+
*/
|
|
71
|
+
export declare function parseInitConfigToml(content: string): InitConfig;
|
|
72
|
+
/**
|
|
73
|
+
* Loads and parses a .primitive-init.toml file from the given directory.
|
|
74
|
+
* Returns null if the file does not exist.
|
|
75
|
+
* Throws if the file exists but contains invalid TOML.
|
|
76
|
+
*/
|
|
77
|
+
export declare function loadInitConfig(dir: string): InitConfig | null;
|
|
78
|
+
/**
|
|
79
|
+
* Validates an InitConfig object. Returns a ValidationResult with any errors.
|
|
80
|
+
*/
|
|
81
|
+
export declare function validateInitConfig(config: InitConfig): ValidationResult;
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from "fs";
|
|
2
|
+
import { join } from "path";
|
|
3
|
+
import { parseConfigToml } from "./config-toml.js";
|
|
4
|
+
import { validateServerUrl } from "./resolve-init-server.js";
|
|
5
|
+
export const INIT_CONFIG_FILENAME = ".primitive-init.toml";
|
|
6
|
+
/**
|
|
7
|
+
* Resolves the "use an existing app" app id from the two places it can be
|
|
8
|
+
* specified: the `--use-existing-app-id` CLI flag (highest precedence) or an
|
|
9
|
+
* init-config TOML with `action = "use-existing"` + `app_id`.
|
|
10
|
+
*
|
|
11
|
+
* Before this existed, `init` only read the flag, so a `use-existing` TOML fell
|
|
12
|
+
* through to the create-app branch and interactively prompted for an app name —
|
|
13
|
+
* hanging non-interactive (`--config`) runs. (See js-bao-wss #1217.)
|
|
14
|
+
*
|
|
15
|
+
* Returns `undefined` when neither source selects an existing app (i.e. the run
|
|
16
|
+
* should create a new app).
|
|
17
|
+
*/
|
|
18
|
+
export function resolveUseExistingAppId(flag, initConfig) {
|
|
19
|
+
if (flag)
|
|
20
|
+
return flag;
|
|
21
|
+
if (initConfig?.action === "use-existing")
|
|
22
|
+
return initConfig.app_id;
|
|
23
|
+
return undefined;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Resolves whether `primitive init` skips the dependency install, from the two
|
|
27
|
+
* places it can be requested: the `--skip-install` flag (highest precedence)
|
|
28
|
+
* or `skip_install = true` in the init-config TOML.
|
|
29
|
+
*
|
|
30
|
+
* `init` used to read only the flag, so a config's `skip_install` was silently
|
|
31
|
+
* ignored and CI runs installed anyway (#2720). Precedence matches #2376's
|
|
32
|
+
* `server` fix: the flag wins. Because `--skip-install` is a boolean flag it
|
|
33
|
+
* can only ever request a skip, so an explicit `skip_install = false` in the
|
|
34
|
+
* config cannot un-skip a run that passed the flag.
|
|
35
|
+
*/
|
|
36
|
+
export function resolveSkipInstall(flag, initConfig) {
|
|
37
|
+
if (flag)
|
|
38
|
+
return { skipInstall: true, source: "flag" };
|
|
39
|
+
// Strict `=== true`: a non-boolean that slipped past validation must not
|
|
40
|
+
// skip the install by truthiness (`skip_install = "false"` reads as a skip).
|
|
41
|
+
if (initConfig?.skip_install === true) {
|
|
42
|
+
return { skipInstall: true, source: "config" };
|
|
43
|
+
}
|
|
44
|
+
return { skipInstall: false, source: "default" };
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Parses a TOML string into an InitConfig object.
|
|
48
|
+
* Throws if the string contains invalid TOML.
|
|
49
|
+
*/
|
|
50
|
+
export function parseInitConfigToml(content) {
|
|
51
|
+
const parsed = parseConfigToml(content);
|
|
52
|
+
// The cast is safe because validateInitConfig() is always called after parsing
|
|
53
|
+
return parsed;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Loads and parses a .primitive-init.toml file from the given directory.
|
|
57
|
+
* Returns null if the file does not exist.
|
|
58
|
+
* Throws if the file exists but contains invalid TOML.
|
|
59
|
+
*/
|
|
60
|
+
export function loadInitConfig(dir) {
|
|
61
|
+
const configPath = join(dir, INIT_CONFIG_FILENAME);
|
|
62
|
+
if (!existsSync(configPath)) {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
const content = readFileSync(configPath, "utf-8");
|
|
66
|
+
return parseInitConfigToml(content);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Validates an InitConfig object. Returns a ValidationResult with any errors.
|
|
70
|
+
*/
|
|
71
|
+
export function validateInitConfig(config) {
|
|
72
|
+
const errors = [];
|
|
73
|
+
// action is required
|
|
74
|
+
if (!config.action) {
|
|
75
|
+
errors.push('Missing required field: "action" (must be "create" or "use-existing")');
|
|
76
|
+
}
|
|
77
|
+
else if (config.action !== "create" && config.action !== "use-existing") {
|
|
78
|
+
errors.push('"action" must be "create" or "use-existing"');
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
// Validate action-specific required fields
|
|
82
|
+
if (config.action === "create" && !config.app_name) {
|
|
83
|
+
errors.push('"app_name" is required when action is "create"');
|
|
84
|
+
}
|
|
85
|
+
if (config.action === "use-existing" && !config.app_id) {
|
|
86
|
+
errors.push('"app_id" is required when action is "use-existing"');
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
// Validate access_mode if provided
|
|
90
|
+
if (config.access_mode) {
|
|
91
|
+
const validModes = ["public", "domain", "invite-only"];
|
|
92
|
+
if (!validModes.includes(config.access_mode)) {
|
|
93
|
+
errors.push('"access_mode" must be "public", "domain", or "invite-only"');
|
|
94
|
+
}
|
|
95
|
+
else if (config.access_mode === "domain" && (!config.allowed_domains || config.allowed_domains.length === 0)) {
|
|
96
|
+
errors.push('"allowed_domains" is required when access_mode is "domain"');
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
// Validate platform if provided. Only "web" and "ios" are supported
|
|
100
|
+
// (`macos` is intentionally rejected until the macOS template is ready).
|
|
101
|
+
if (config.platform !== undefined) {
|
|
102
|
+
if (config.platform !== "web" && config.platform !== "ios") {
|
|
103
|
+
errors.push('"platform" must be "web" or "ios"');
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
// Validate server if provided. An unusable value must fail here rather than
|
|
107
|
+
// fall through to the current server, which is how #2376 went unnoticed.
|
|
108
|
+
if (config.server !== undefined) {
|
|
109
|
+
const serverValidation = validateServerUrl(config.server);
|
|
110
|
+
if (serverValidation !== true) {
|
|
111
|
+
errors.push(`"server" must be a valid URL (e.g., https://primitiveapi.com): ${serverValidation}`);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
// Validate skip_install if provided. The TOML is cast to InitConfig without
|
|
115
|
+
// runtime narrowing, so a non-boolean has to be rejected here rather than
|
|
116
|
+
// reach the resolver, where anything truthy would skip the install.
|
|
117
|
+
if (config.skip_install !== undefined && typeof config.skip_install !== "boolean") {
|
|
118
|
+
errors.push('"skip_install" must be a boolean (true or false)');
|
|
119
|
+
}
|
|
120
|
+
// Validate dev_port if provided
|
|
121
|
+
if (config.dev_port !== undefined) {
|
|
122
|
+
if (typeof config.dev_port !== "number" || !Number.isInteger(config.dev_port) || config.dev_port < 1 || config.dev_port > 65535) {
|
|
123
|
+
errors.push('"dev_port" must be an integer between 1 and 65535');
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
// Validate invite_emails format if provided
|
|
127
|
+
if (config.invite_emails && Array.isArray(config.invite_emails)) {
|
|
128
|
+
for (const email of config.invite_emails) {
|
|
129
|
+
if (!email.includes("@")) {
|
|
130
|
+
errors.push(`Invalid email in invite_emails: "${email}"`);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
// Warn about fields ignored for use-existing action
|
|
135
|
+
if (config.action === "use-existing") {
|
|
136
|
+
const ignoredFields = [];
|
|
137
|
+
if (config.access_mode)
|
|
138
|
+
ignoredFields.push("access_mode");
|
|
139
|
+
if (config.invite_emails && config.invite_emails.length > 0)
|
|
140
|
+
ignoredFields.push("invite_emails");
|
|
141
|
+
if (config.allowed_domains && config.allowed_domains.length > 0)
|
|
142
|
+
ignoredFields.push("allowed_domains");
|
|
143
|
+
if (ignoredFields.length > 0) {
|
|
144
|
+
errors.push(`The following fields are ignored when action is "use-existing": ${ignoredFields.join(", ")}. Remove them to avoid confusion.`);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
return { valid: errors.length === 0, errors };
|
|
148
|
+
}
|
|
149
|
+
//# sourceMappingURL=init-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init-config.js","sourceRoot":"","sources":["../../../src/lib/init-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,MAAM,CAAC,MAAM,oBAAoB,GAAG,sBAAsB,CAAC;AAsC3D;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,uBAAuB,CACrC,IAAwB,EACxB,UAA6B;IAE7B,IAAI,IAAI;QAAE,OAAO,IAAI,CAAC;IACtB,IAAI,UAAU,EAAE,MAAM,KAAK,cAAc;QAAE,OAAO,UAAU,CAAC,MAAM,CAAC;IACpE,OAAO,SAAS,CAAC;AACnB,CAAC;AAUD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,kBAAkB,CAChC,IAAyB,EACzB,UAA6B;IAE7B,IAAI,IAAI;QAAE,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IACvD,yEAAyE;IACzE,6EAA6E;IAC7E,IAAI,UAAU,EAAE,YAAY,KAAK,IAAI,EAAE,CAAC;QACtC,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;IACjD,CAAC;IACD,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;AACnD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAAe;IACjD,MAAM,MAAM,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;IACxC,+EAA+E;IAC/E,OAAO,MAA+B,CAAC;AACzC,CAAC;AAED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