primitive-admin 1.1.0-alpha.9 → 1.1.0
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 +523 -109
- package/assets/skill/skills/primitive-platform/SKILL.md +289 -0
- package/dist/bin/primitive.d.ts +2 -0
- package/dist/bin/primitive.js +372 -21
- package/dist/bin/primitive.js.map +1 -1
- package/dist/src/commands/admins.d.ts +2 -0
- package/dist/src/commands/admins.js +136 -30
- package/dist/src/commands/admins.js.map +1 -1
- package/dist/src/commands/analytics.d.ts +2 -0
- package/dist/src/commands/analytics.js +713 -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 +65 -100
- package/dist/src/commands/apps.js.map +1 -1
- package/dist/src/commands/auth-sessions.d.ts +7 -0
- package/dist/src/commands/auth-sessions.js +144 -0
- package/dist/src/commands/auth-sessions.js.map +1 -0
- package/dist/src/commands/auth.d.ts +2 -0
- package/dist/src/commands/auth.js +238 -108
- 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 +331 -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 +63 -48
- 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 +85 -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 +1282 -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 +465 -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 +99 -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 +266 -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 +164 -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 +1887 -243
- package/dist/src/commands/databases.js.map +1 -1
- package/dist/src/commands/documents.d.ts +60 -0
- package/dist/src/commands/documents.js +2888 -22
- 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 +175 -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 +395 -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 +117 -0
- package/dist/src/commands/feature-flags.js.map +1 -0
- package/dist/src/commands/functions.d.ts +20 -0
- package/dist/src/commands/functions.js +1630 -0
- package/dist/src/commands/functions.js.map +1 -0
- package/dist/src/commands/group-type-configs.d.ts +2 -0
- package/dist/src/commands/group-type-configs.js +87 -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 +65 -113
- package/dist/src/commands/groups.js.map +1 -1
- package/dist/src/commands/guides.d.ts +223 -0
- package/dist/src/commands/guides.js +627 -69
- package/dist/src/commands/guides.js.map +1 -1
- package/dist/src/commands/init.d.ts +37 -0
- package/dist/src/commands/init.js +1693 -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 +428 -187
- 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 +175 -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 +113 -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 +288 -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 +322 -634
- 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 +139 -148
- package/dist/src/commands/rule-sets.js.map +1 -1
- package/dist/src/commands/scripts.d.ts +30 -0
- package/dist/src/commands/scripts.js +688 -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 +109 -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 +76 -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 +328 -0
- package/dist/src/commands/sync-app-settings.js.map +1 -0
- package/dist/src/commands/sync.d.ts +2670 -0
- package/dist/src/commands/sync.js +17144 -834
- package/dist/src/commands/sync.js.map +1 -1
- package/dist/src/commands/tokens.d.ts +2 -0
- package/dist/src/commands/tokens.js +132 -22
- package/dist/src/commands/tokens.js.map +1 -1
- package/dist/src/commands/users.d.ts +2 -0
- package/dist/src/commands/users.js +542 -24
- package/dist/src/commands/users.js.map +1 -1
- package/dist/src/commands/vars.d.ts +8 -0
- package/dist/src/commands/vars.js +97 -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 +12 -11
- package/dist/src/commands/waitlist.js.map +1 -1
- package/dist/src/commands/webhooks.d.ts +31 -0
- package/dist/src/commands/webhooks.js +633 -0
- package/dist/src/commands/webhooks.js.map +1 -0
- package/dist/src/commands/workflows.d.ts +88 -0
- package/dist/src/commands/workflows.js +1568 -742
- 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 +2550 -0
- package/dist/src/lib/api-client.js +2503 -160
- 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 +583 -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/block-selector.d.ts +58 -0
- package/dist/src/lib/block-selector.js +92 -0
- package/dist/src/lib/block-selector.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 +38 -0
- package/dist/src/lib/codegen-shared/resolveCodegenSourceDir.js +46 -0
- package/dist/src/lib/codegen-shared/resolveCodegenSourceDir.js.map +1 -0
- package/dist/src/lib/collection-export.d.ts +184 -0
- package/dist/src/lib/collection-export.js +252 -0
- package/dist/src/lib/collection-export.js.map +1 -0
- package/dist/src/lib/config-json-field.d.ts +28 -0
- package/dist/src/lib/config-json-field.js +56 -0
- package/dist/src/lib/config-json-field.js.map +1 -0
- package/dist/src/lib/config-object-descriptor.d.ts +127 -0
- package/dist/src/lib/config-object-descriptor.js +740 -0
- package/dist/src/lib/config-object-descriptor.js.map +1 -0
- package/dist/src/lib/config-payload.d.ts +92 -0
- package/dist/src/lib/config-payload.js +161 -0
- package/dist/src/lib/config-payload.js.map +1 -0
- package/dist/src/lib/config-surface.d.ts +141 -0
- package/dist/src/lib/config-surface.js +368 -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 +71 -0
- package/dist/src/lib/config.js +71 -68
- 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 +104 -0
- package/dist/src/lib/credentials-store.js +336 -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 +525 -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/deprecation.d.ts +22 -0
- package/dist/src/lib/deprecation.js +43 -0
- package/dist/src/lib/deprecation.js.map +1 -0
- package/dist/src/lib/document-export-permissions.d.ts +30 -0
- package/dist/src/lib/document-export-permissions.js +54 -0
- package/dist/src/lib/document-export-permissions.js.map +1 -0
- package/dist/src/lib/document-ingest-artifact.d.ts +120 -0
- package/dist/src/lib/document-ingest-artifact.js +505 -0
- package/dist/src/lib/document-ingest-artifact.js.map +1 -0
- package/dist/src/lib/document-ingest-input.d.ts +51 -0
- package/dist/src/lib/document-ingest-input.js +132 -0
- package/dist/src/lib/document-ingest-input.js.map +1 -0
- package/dist/src/lib/document-ingest-rows.d.ts +137 -0
- package/dist/src/lib/document-ingest-rows.js +181 -0
- package/dist/src/lib/document-ingest-rows.js.map +1 -0
- package/dist/src/lib/document-ingest.d.ts +101 -0
- package/dist/src/lib/document-ingest.js +384 -0
- package/dist/src/lib/document-ingest.js.map +1 -0
- package/dist/src/lib/env-resolver-core.d.ts +258 -0
- package/dist/src/lib/env-resolver-core.js +447 -0
- package/dist/src/lib/env-resolver-core.js.map +1 -0
- package/dist/src/lib/env-resolver.d.ts +99 -0
- package/dist/src/lib/env-resolver.js +153 -0
- package/dist/src/lib/env-resolver.js.map +1 -0
- package/dist/src/lib/fetch.d.ts +5 -0
- package/dist/src/lib/function-bundle.d.ts +147 -0
- package/dist/src/lib/function-bundle.js +341 -0
- package/dist/src/lib/function-bundle.js.map +1 -0
- package/dist/src/lib/function-collect.d.ts +123 -0
- package/dist/src/lib/function-collect.js +610 -0
- package/dist/src/lib/function-collect.js.map +1 -0
- package/dist/src/lib/function-db-types.d.ts +202 -0
- package/dist/src/lib/function-db-types.js +870 -0
- package/dist/src/lib/function-db-types.js.map +1 -0
- package/dist/src/lib/function-document-types.d.ts +144 -0
- package/dist/src/lib/function-document-types.js +370 -0
- package/dist/src/lib/function-document-types.js.map +1 -0
- package/dist/src/lib/function-grants-preflight.d.ts +64 -0
- package/dist/src/lib/function-grants-preflight.js +105 -0
- package/dist/src/lib/function-grants-preflight.js.map +1 -0
- package/dist/src/lib/function-log-lines.d.ts +76 -0
- package/dist/src/lib/function-log-lines.js +160 -0
- package/dist/src/lib/function-log-lines.js.map +1 -0
- package/dist/src/lib/function-log-row.d.ts +29 -0
- package/dist/src/lib/function-log-row.js +73 -0
- package/dist/src/lib/function-log-row.js.map +1 -0
- package/dist/src/lib/function-log-tail.d.ts +132 -0
- package/dist/src/lib/function-log-tail.js +262 -0
- package/dist/src/lib/function-log-tail.js.map +1 -0
- package/dist/src/lib/function-run.d.ts +289 -0
- package/dist/src/lib/function-run.js +389 -0
- package/dist/src/lib/function-run.js.map +1 -0
- package/dist/src/lib/function-schema-codegen.d.ts +143 -0
- package/dist/src/lib/function-schema-codegen.js +420 -0
- package/dist/src/lib/function-schema-codegen.js.map +1 -0
- package/dist/src/lib/function-sync.d.ts +459 -0
- package/dist/src/lib/function-sync.js +1258 -0
- package/dist/src/lib/function-sync.js.map +1 -0
- package/dist/src/lib/function-trigger-listing.d.ts +27 -0
- package/dist/src/lib/function-trigger-listing.js +70 -0
- package/dist/src/lib/function-trigger-listing.js.map +1 -0
- package/dist/src/lib/function-typecheck.d.ts +86 -0
- package/dist/src/lib/function-typecheck.js +370 -0
- package/dist/src/lib/function-typecheck.js.map +1 -0
- package/dist/src/lib/function-versions.d.ts +122 -0
- package/dist/src/lib/function-versions.js +182 -0
- package/dist/src/lib/function-versions.js.map +1 -0
- package/dist/src/lib/generated-allowlist.d.ts +28 -0
- package/dist/src/lib/generated-allowlist.js +281 -0
- package/dist/src/lib/generated-allowlist.js.map +1 -0
- package/dist/src/lib/generated-config-surfaces.d.ts +2936 -0
- package/dist/src/lib/generated-config-surfaces.js +10569 -0
- package/dist/src/lib/generated-config-surfaces.js.map +1 -0
- package/dist/src/lib/generated-sdk-types.d.ts +12 -0
- package/dist/src/lib/generated-sdk-types.js +13 -0
- package/dist/src/lib/generated-sdk-types.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-client-platforms.d.ts +14 -0
- package/dist/src/lib/init-client-platforms.js +71 -0
- package/dist/src/lib/init-client-platforms.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-email-redirect-uris.d.ts +37 -0
- package/dist/src/lib/init-email-redirect-uris.js +46 -0
- package/dist/src/lib/init-email-redirect-uris.js.map +1 -0
- package/dist/src/lib/init-ios-links.d.ts +91 -0
- package/dist/src/lib/init-ios-links.js +219 -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 +34 -0
- package/dist/src/lib/init-xcode.js +138 -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/integration-selector.d.ts +42 -0
- package/dist/src/lib/integration-selector.js +46 -0
- package/dist/src/lib/integration-selector.js.map +1 -0
- package/dist/src/lib/ios-app-id.d.ts +34 -0
- package/dist/src/lib/ios-app-id.js +69 -0
- package/dist/src/lib/ios-app-id.js.map +1 -0
- package/dist/src/lib/list-options.d.ts +68 -0
- package/dist/src/lib/list-options.js +89 -0
- package/dist/src/lib/list-options.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/local-test-cases.d.ts +63 -0
- package/dist/src/lib/local-test-cases.js +136 -0
- package/dist/src/lib/local-test-cases.js.map +1 -0
- package/dist/src/lib/log-inspection.d.ts +715 -0
- package/dist/src/lib/log-inspection.js +816 -0
- package/dist/src/lib/log-inspection.js.map +1 -0
- package/dist/src/lib/logout-admin-session.d.ts +33 -0
- package/dist/src/lib/logout-admin-session.js +70 -0
- package/dist/src/lib/logout-admin-session.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 +124 -0
- package/dist/src/lib/output.js +219 -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 +98 -0
- package/dist/src/lib/paginate.js +112 -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 +122 -0
- package/dist/src/lib/project-config.js +244 -0
- package/dist/src/lib/project-config.js.map +1 -0
- package/dist/src/lib/prompt-cost-format.d.ts +11 -0
- package/dist/src/lib/prompt-cost-format.js +41 -0
- package/dist/src/lib/prompt-cost-format.js.map +1 -0
- package/dist/src/lib/prompt-schema-codegen.d.ts +147 -0
- package/dist/src/lib/prompt-schema-codegen.js +462 -0
- package/dist/src/lib/prompt-schema-codegen.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 +73 -0
- package/dist/src/lib/refresh-admin-credentials.js +123 -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-owner.d.ts +19 -0
- package/dist/src/lib/resolve-owner.js +20 -0
- package/dist/src/lib/resolve-owner.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 +71 -0
- package/dist/src/lib/skill-installer.js +441 -0
- package/dist/src/lib/skill-installer.js.map +1 -0
- package/dist/src/lib/snapshot-audit-source.d.ts +45 -0
- package/dist/src/lib/snapshot-audit-source.js +58 -0
- package/dist/src/lib/snapshot-audit-source.js.map +1 -0
- package/dist/src/lib/snapshot-audit-store.d.ts +52 -0
- package/dist/src/lib/snapshot-audit-store.js +196 -0
- package/dist/src/lib/snapshot-audit-store.js.map +1 -0
- package/dist/src/lib/snapshot-audit.d.ts +207 -0
- package/dist/src/lib/snapshot-audit.js +431 -0
- package/dist/src/lib/snapshot-audit.js.map +1 -0
- package/dist/src/lib/snapshot-build-rows.d.ts +60 -0
- package/dist/src/lib/snapshot-build-rows.js +87 -0
- package/dist/src/lib/snapshot-build-rows.js.map +1 -0
- package/dist/src/lib/snapshot-build.d.ts +50 -0
- package/dist/src/lib/snapshot-build.js +111 -0
- package/dist/src/lib/snapshot-build.js.map +1 -0
- package/dist/src/lib/snapshot-manifest-layout.d.ts +61 -0
- package/dist/src/lib/snapshot-manifest-layout.js +70 -0
- package/dist/src/lib/snapshot-manifest-layout.js.map +1 -0
- package/dist/src/lib/snapshots.d.ts +98 -0
- package/dist/src/lib/snapshots.js +294 -0
- package/dist/src/lib/snapshots.js.map +1 -0
- package/dist/src/lib/step-run-table.d.ts +43 -0
- package/dist/src/lib/step-run-table.js +129 -0
- package/dist/src/lib/step-run-table.js.map +1 -0
- package/dist/src/lib/storage-pending-retry.d.ts +26 -0
- package/dist/src/lib/storage-pending-retry.js +42 -0
- package/dist/src/lib/storage-pending-retry.js.map +1 -0
- package/dist/src/lib/swift-codegen/agentGenerator.d.ts +42 -0
- package/dist/src/lib/swift-codegen/agentGenerator.js +118 -0
- package/dist/src/lib/swift-codegen/agentGenerator.js.map +1 -0
- package/dist/src/lib/swift-codegen/banners.d.ts +24 -0
- package/dist/src/lib/swift-codegen/banners.js +25 -0
- package/dist/src/lib/swift-codegen/banners.js.map +1 -0
- package/dist/src/lib/swift-codegen/dbGenerator.d.ts +113 -0
- package/dist/src/lib/swift-codegen/dbGenerator.js +926 -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/functionGenerator.d.ts +139 -0
- package/dist/src/lib/swift-codegen/functionGenerator.js +462 -0
- package/dist/src/lib/swift-codegen/functionGenerator.js.map +1 -0
- package/dist/src/lib/swift-codegen/generator.d.ts +100 -0
- package/dist/src/lib/swift-codegen/generator.js +457 -0
- package/dist/src/lib/swift-codegen/generator.js.map +1 -0
- package/dist/src/lib/swift-codegen/schemaToSwift.d.ts +87 -0
- package/dist/src/lib/swift-codegen/schemaToSwift.js +661 -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 +128 -0
- package/dist/src/lib/sync-paths.js +195 -0
- package/dist/src/lib/sync-paths.js.map +1 -0
- package/dist/src/lib/sync-resource-types.d.ts +563 -0
- package/dist/src/lib/sync-resource-types.js +1073 -0
- package/dist/src/lib/sync-resource-types.js.map +1 -0
- package/dist/src/lib/sync-selectors.d.ts +138 -0
- package/dist/src/lib/sync-selectors.js +289 -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-file-names.d.ts +40 -0
- package/dist/src/lib/test-case-file-names.js +91 -0
- package/dist/src/lib/test-case-file-names.js.map +1 -0
- 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 +29 -0
- package/dist/src/lib/test-case-variables.js +71 -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 +544 -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/web-url.d.ts +40 -0
- package/dist/src/lib/web-url.js +76 -0
- package/dist/src/lib/web-url.js.map +1 -0
- package/dist/src/lib/webhook-deliver.d.ts +209 -0
- package/dist/src/lib/webhook-deliver.js +519 -0
- package/dist/src/lib/webhook-deliver.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 +211 -0
- package/dist/src/lib/workflow-toml-validator.js +770 -0
- package/dist/src/lib/workflow-toml-validator.js.map +1 -0
- package/dist/src/lib/workflow-usage.d.ts +196 -0
- package/dist/src/lib/workflow-usage.js +310 -0
- package/dist/src/lib/workflow-usage.js.map +1 -0
- package/dist/src/types/index.d.ts +591 -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 +34 -9
|
@@ -0,0 +1,688 @@
|
|
|
1
|
+
import { join } from "path";
|
|
2
|
+
import { ApiClient } from "../lib/api-client.js";
|
|
3
|
+
import { getCurrentAppId, resolveAppId } from "../lib/config.js";
|
|
4
|
+
import chalk from "chalk";
|
|
5
|
+
import { success, error, info, warn, dim, keyValue, result as printResult, formatTable, formatId, formatDate, formatDuration, json, divider, } from "../lib/output.js";
|
|
6
|
+
import { requireTestCaseInputVariables } from "../lib/test-case-variables.js";
|
|
7
|
+
import { resolveSyncDir } from "../lib/sync-paths.js";
|
|
8
|
+
import { listLocalTestCaseFiles, readManagedTestCases, scanLocalTestCases, } from "../lib/local-test-cases.js";
|
|
9
|
+
import { normalizeCliListEnvelope, wholeListEnvelope, } from "../lib/paginate.js";
|
|
10
|
+
import { pageCursorOption, pageLimitOption, parsePageLimit, printEmptyPage, printPageHint, } from "../lib/list-options.js";
|
|
11
|
+
/**
|
|
12
|
+
* Resolve a user-supplied script reference (either a `scriptId` or the
|
|
13
|
+
* script's `name`) to its `scriptId`. Scripts are named handles, so the CLI
|
|
14
|
+
* accepts a name for convenience the way `sync` refers to them by name; the
|
|
15
|
+
* block-testing API keys on `scriptId` (the block id). If a raw id matches an
|
|
16
|
+
* existing script it is used directly; otherwise we list the app's scripts and
|
|
17
|
+
* match on name (case-sensitive, then case-insensitive as a fallback).
|
|
18
|
+
*
|
|
19
|
+
* The server enforces name uniqueness by EXACT match, so `foo` and `FOO` can
|
|
20
|
+
* both exist. Input `Foo` then matches neither exactly and falls through to the
|
|
21
|
+
* case-insensitive step with two candidates — where picking one is arbitrary.
|
|
22
|
+
* That is a silent wrong-target write for `update`/`configs activate` and an
|
|
23
|
+
* unrecoverable one for `delete`, so an ambiguous fallback is an error naming
|
|
24
|
+
* the candidates. A single case-insensitive match still resolves, keeping the
|
|
25
|
+
* convenience behavior every command already relies on.
|
|
26
|
+
*/
|
|
27
|
+
export async function resolveScriptId(client, appId, ref) {
|
|
28
|
+
return (await resolveScript(client, appId, ref)).scriptId;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The same resolution, keeping the script's NAME as well as its id. The name is
|
|
32
|
+
* what the local tree is keyed by (`transforms/<name>.rhai` and its
|
|
33
|
+
* `transforms/<name>.tests/` sidecar), so a verb that has to look at the
|
|
34
|
+
* authored files cannot work from the block id alone (#3061).
|
|
35
|
+
*/
|
|
36
|
+
export async function resolveScript(client, appId, ref) {
|
|
37
|
+
const { items } = await client.listScripts(appId);
|
|
38
|
+
const found = (s) => ({ scriptId: s.scriptId, name: String(s.name) });
|
|
39
|
+
const byId = items.find((s) => s.scriptId === ref);
|
|
40
|
+
if (byId)
|
|
41
|
+
return found(byId);
|
|
42
|
+
const byName = items.find((s) => s.name === ref);
|
|
43
|
+
if (byName)
|
|
44
|
+
return found(byName);
|
|
45
|
+
const byNameCi = items.filter((s) => String(s.name).toLowerCase() === ref.toLowerCase());
|
|
46
|
+
if (byNameCi.length === 1)
|
|
47
|
+
return found(byNameCi[0]);
|
|
48
|
+
if (byNameCi.length > 1) {
|
|
49
|
+
const candidates = byNameCi
|
|
50
|
+
.map((s) => String(s.name))
|
|
51
|
+
.sort()
|
|
52
|
+
.join(", ");
|
|
53
|
+
throw new Error(`Script name is ambiguous: ${ref}. Did you mean: ${candidates}? ` +
|
|
54
|
+
`Names differing only in case must be given exactly, or by scriptId.`);
|
|
55
|
+
}
|
|
56
|
+
throw new Error(`Script not found: ${ref}`);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Every registered test case of a script, draining the cursor (#3061).
|
|
60
|
+
*
|
|
61
|
+
* The listing endpoint returns 50 per page. Classifying local files against
|
|
62
|
+
* page one alone would call every case that happens to live on page two
|
|
63
|
+
* unregistered — a push the user does not need, and a count that contradicts
|
|
64
|
+
* the tree. `firstPage` is the page a caller already fetched for its own
|
|
65
|
+
* output, so accounting for the rest costs a call only when there IS a rest.
|
|
66
|
+
*/
|
|
67
|
+
async function drainTestCases(params) {
|
|
68
|
+
const items = [];
|
|
69
|
+
let cursor;
|
|
70
|
+
let page = params.firstPage;
|
|
71
|
+
const seenCursors = new Set();
|
|
72
|
+
for (;;) {
|
|
73
|
+
if (!page) {
|
|
74
|
+
page = await params.client.listTestCases(params.appId, "script", params.scriptId, cursor ? { cursor } : {});
|
|
75
|
+
}
|
|
76
|
+
items.push(...(page.items || []));
|
|
77
|
+
const next = page.nextCursor;
|
|
78
|
+
// A server that keeps handing back the same cursor must not spin forever.
|
|
79
|
+
if (!next || seenCursors.has(next))
|
|
80
|
+
break;
|
|
81
|
+
seenCursors.add(next);
|
|
82
|
+
cursor = next;
|
|
83
|
+
page = undefined;
|
|
84
|
+
}
|
|
85
|
+
return items;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Name the case files under `transforms/<name>.tests/` that the server has
|
|
89
|
+
* never been told about (#3061).
|
|
90
|
+
*
|
|
91
|
+
* The test verbs run the REGISTERED set, so an authored-but-unpushed case
|
|
92
|
+
* contributes nothing to `Total Tests` — and, before this, nothing to the
|
|
93
|
+
* output either: `Total Tests: 3 / Failed: 0` beside four case files reads as
|
|
94
|
+
* a pass for a case that never executed. Printing the file count next to the
|
|
95
|
+
* registered total is what makes the two numbers disagree out loud, and the
|
|
96
|
+
* files are named individually so the remedy is one `config push` away rather
|
|
97
|
+
* than a bisect.
|
|
98
|
+
*
|
|
99
|
+
* Everything it prints goes to stderr, including under `--json`: stderr cannot
|
|
100
|
+
* corrupt a payload, and a scripted caller is exactly who cannot see a case
|
|
101
|
+
* silently not running. The payload carries the same list.
|
|
102
|
+
*
|
|
103
|
+
* The tree it scans is the one `config push` would push from — since #3154
|
|
104
|
+
* that is the environment's, and there is no longer any way to ask for a
|
|
105
|
+
* different one.
|
|
106
|
+
*
|
|
107
|
+
* Returns the paths named, for that payload. A local tree it cannot read is
|
|
108
|
+
* reported as such rather than swallowed — this whole issue is about silence.
|
|
109
|
+
*/
|
|
110
|
+
async function reportUnregisteredLocalTestCases(params) {
|
|
111
|
+
const relativeDir = `transforms/${params.scriptName}.tests`;
|
|
112
|
+
try {
|
|
113
|
+
// The tree belongs to the environment, and the environment names exactly
|
|
114
|
+
// one app (#3152/#3153/#3154) — so the local half of this comparison is
|
|
115
|
+
// always the same app's case files as the server half, and the scan runs
|
|
116
|
+
// unconditionally. The `--app`-shaped skip this used to need went with the
|
|
117
|
+
// flag (adjudicated finding F2).
|
|
118
|
+
const configDir = resolveSyncDir();
|
|
119
|
+
const testsDir = join(configDir, "transforms", `${params.scriptName}.tests`);
|
|
120
|
+
// No sidecar directory, no question to answer — and no listing call for a
|
|
121
|
+
// suite whose cases are only ever server-side.
|
|
122
|
+
if (listLocalTestCaseFiles(testsDir).length === 0)
|
|
123
|
+
return [];
|
|
124
|
+
const registered = await drainTestCases({
|
|
125
|
+
client: params.client,
|
|
126
|
+
appId: params.appId,
|
|
127
|
+
scriptId: params.scriptId,
|
|
128
|
+
firstPage: params.registered,
|
|
129
|
+
});
|
|
130
|
+
const scan = scanLocalTestCases({
|
|
131
|
+
testsDir,
|
|
132
|
+
registered,
|
|
133
|
+
managed: readManagedTestCases(configDir),
|
|
134
|
+
managedPrefix: `script/${params.scriptName}`,
|
|
135
|
+
});
|
|
136
|
+
if (scan.unregistered.length === 0)
|
|
137
|
+
return [];
|
|
138
|
+
keyValue("Local Case Files", `${scan.localFiles.length} (${scan.unregistered.length} not registered)`);
|
|
139
|
+
warn(`${scan.unregistered.length} local case file(s) in ${relativeDir}/ did not run — not registered:`);
|
|
140
|
+
for (const file of scan.unregistered) {
|
|
141
|
+
dim(` ${relativeDir}/${file}`);
|
|
142
|
+
}
|
|
143
|
+
warn("'primitive config push' registers local case files; run it, then run the tests again.");
|
|
144
|
+
return scan.unregistered.map((file) => `${relativeDir}/${file}`);
|
|
145
|
+
}
|
|
146
|
+
catch (err) {
|
|
147
|
+
warn(`Could not check ${relativeDir}/ for unregistered case files: ${err.message}`);
|
|
148
|
+
return [];
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
export function registerScriptsCommands(program) {
|
|
152
|
+
const scripts = program
|
|
153
|
+
.command("scripts")
|
|
154
|
+
.description("Inspect Rhai scripts (transforms), their versions, and tests")
|
|
155
|
+
.addHelpText("after", `
|
|
156
|
+
Examples:
|
|
157
|
+
$ primitive scripts list
|
|
158
|
+
$ primitive scripts get my-transform
|
|
159
|
+
# Deleting: remove transforms/my-transform.rhai and run 'primitive config push --prune'.
|
|
160
|
+
$ primitive scripts configs list my-transform
|
|
161
|
+
$ primitive scripts tests list my-transform
|
|
162
|
+
$ primitive scripts tests run my-transform <test-case-id>
|
|
163
|
+
$ primitive scripts tests run-all my-transform
|
|
164
|
+
|
|
165
|
+
Scripts (transforms) are authored as transforms/<name>.rhai files and applied
|
|
166
|
+
with 'config push'. Test cases live under transforms/<name>.tests/*.toml and
|
|
167
|
+
round-trip through 'config pull' / 'config push'. Both the script reference and
|
|
168
|
+
the test commands accept either a script id or a script name.
|
|
169
|
+
`);
|
|
170
|
+
// Server-side configuration is authored in TOML and applied with `config push`
|
|
171
|
+
// (issue #2645) — this group no longer carries config-setting flags.
|
|
172
|
+
scripts.addHelpText("after", `
|
|
173
|
+
Configuration lives in transforms/<name>.rhai:
|
|
174
|
+
$ primitive config fields transform # the file's keys, types and defaults
|
|
175
|
+
$ primitive config create transform <key> # scaffold one locally
|
|
176
|
+
$ primitive config set transform/<key> <path>=<value>
|
|
177
|
+
$ primitive config push --only transform/<key>
|
|
178
|
+
`);
|
|
179
|
+
// List scripts
|
|
180
|
+
scripts
|
|
181
|
+
.command("list")
|
|
182
|
+
.description("List scripts (transforms) for an app")
|
|
183
|
+
.argument("[app-id]", "App ID (uses current app if not specified)")
|
|
184
|
+
.option("--app <app-id>", "App ID (uses current app if not specified)")
|
|
185
|
+
.option("--json", "Output as JSON")
|
|
186
|
+
.action(async (appId, options) => {
|
|
187
|
+
const resolvedAppId = resolveAppId(appId, options);
|
|
188
|
+
const client = new ApiClient();
|
|
189
|
+
try {
|
|
190
|
+
const { items } = await client.listScripts(resolvedAppId);
|
|
191
|
+
if (options.json) {
|
|
192
|
+
json(wholeListEnvelope(items));
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
if (!items || items.length === 0) {
|
|
196
|
+
info("No scripts found.");
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
console.log(formatTable(items, [
|
|
200
|
+
{ header: "ID", key: "scriptId", format: formatId },
|
|
201
|
+
{ header: "NAME", key: "name" },
|
|
202
|
+
{
|
|
203
|
+
header: "ACTIVE CONFIG",
|
|
204
|
+
key: "activeConfigId",
|
|
205
|
+
format: (v) => (v ? formatId(v) : "-"),
|
|
206
|
+
},
|
|
207
|
+
{ header: "MODIFIED", key: "modifiedAt", format: formatDate },
|
|
208
|
+
]));
|
|
209
|
+
}
|
|
210
|
+
catch (err) {
|
|
211
|
+
error(err.message);
|
|
212
|
+
process.exit(1);
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
// Get a script
|
|
216
|
+
scripts
|
|
217
|
+
.command("get")
|
|
218
|
+
.description("Get a script's details and versions")
|
|
219
|
+
.argument("<script>", "Script ID or name")
|
|
220
|
+
.option("--app <app-id>", "App ID (uses current app if not specified)")
|
|
221
|
+
.option("--json", "Output as JSON")
|
|
222
|
+
.action(async (script, options) => {
|
|
223
|
+
const resolvedAppId = resolveAppId(undefined, options);
|
|
224
|
+
const client = new ApiClient();
|
|
225
|
+
try {
|
|
226
|
+
const scriptId = await resolveScriptId(client, resolvedAppId, script);
|
|
227
|
+
const result = await client.getScript(resolvedAppId, scriptId);
|
|
228
|
+
if (options.json) {
|
|
229
|
+
json(result);
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
printResult("Script ID", result.scriptId);
|
|
233
|
+
printResult("Name", result.name);
|
|
234
|
+
printResult("Description", result.description || "-");
|
|
235
|
+
printResult("Active Config", result.activeConfigId || "-");
|
|
236
|
+
printResult("Created", formatDate(result.createdAt));
|
|
237
|
+
const configs = Array.isArray(result.configs) ? result.configs : [];
|
|
238
|
+
if (configs.length > 0) {
|
|
239
|
+
divider();
|
|
240
|
+
info("Versions:");
|
|
241
|
+
console.log(formatTable(configs, [
|
|
242
|
+
{ header: "CONFIG ID", key: "configId", format: formatId },
|
|
243
|
+
{ header: "NAME", key: "configName" },
|
|
244
|
+
{ header: "STATUS", key: "status" },
|
|
245
|
+
{
|
|
246
|
+
header: "ACTIVE",
|
|
247
|
+
key: "configId",
|
|
248
|
+
format: (v) => v === result.activeConfigId ? chalk.green("Yes") : "-",
|
|
249
|
+
},
|
|
250
|
+
{ header: "CONTENT HASH", key: "contentHash", format: formatId },
|
|
251
|
+
]));
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
catch (err) {
|
|
255
|
+
error(err.message);
|
|
256
|
+
process.exit(1);
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
// ============================================
|
|
260
|
+
// CONFIGS (VERSIONS) SUBCOMMAND
|
|
261
|
+
// ============================================
|
|
262
|
+
const configs = scripts
|
|
263
|
+
.command("configs")
|
|
264
|
+
.description("Inspect a script's versioned configs");
|
|
265
|
+
configs
|
|
266
|
+
.command("list")
|
|
267
|
+
.description("List a script's versions (configs)")
|
|
268
|
+
.argument("<script>", "Script ID or name")
|
|
269
|
+
.option("--app <app-id>", "App ID (uses current app if not specified)")
|
|
270
|
+
.option("--json", "Output as JSON")
|
|
271
|
+
.action(async (script, options) => {
|
|
272
|
+
const resolvedAppId = resolveAppId(undefined, options);
|
|
273
|
+
const client = new ApiClient();
|
|
274
|
+
try {
|
|
275
|
+
const scriptId = await resolveScriptId(client, resolvedAppId, script);
|
|
276
|
+
const header = await client.getScript(resolvedAppId, scriptId);
|
|
277
|
+
const { items } = await client.listScriptConfigs(resolvedAppId, scriptId);
|
|
278
|
+
if (options.json) {
|
|
279
|
+
json(wholeListEnvelope(items));
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
if (!items || items.length === 0) {
|
|
283
|
+
info("No versions found.");
|
|
284
|
+
return;
|
|
285
|
+
}
|
|
286
|
+
console.log(formatTable(items, [
|
|
287
|
+
{ header: "CONFIG ID", key: "configId", format: formatId },
|
|
288
|
+
{ header: "NAME", key: "configName" },
|
|
289
|
+
{ header: "STATUS", key: "status" },
|
|
290
|
+
{
|
|
291
|
+
header: "ACTIVE",
|
|
292
|
+
key: "configId",
|
|
293
|
+
format: (v) => v === header.activeConfigId ? chalk.green("Yes") : "-",
|
|
294
|
+
},
|
|
295
|
+
{ header: "CONTENT HASH", key: "contentHash", format: formatId },
|
|
296
|
+
{ header: "CREATED", key: "createdAt", format: formatDate },
|
|
297
|
+
]));
|
|
298
|
+
}
|
|
299
|
+
catch (err) {
|
|
300
|
+
error(err.message);
|
|
301
|
+
process.exit(1);
|
|
302
|
+
}
|
|
303
|
+
});
|
|
304
|
+
// Get one version. `list` says which versions exist; this says what one of
|
|
305
|
+
// them holds — the body the server would run. A transform is authored as
|
|
306
|
+
// `transforms/<name>.rhai` and applied by `config push`, so this is the read
|
|
307
|
+
// that answers "is what is running what I committed?" for a single version.
|
|
308
|
+
configs
|
|
309
|
+
.command("get")
|
|
310
|
+
.description("Show one version (config) of a script as the server has it")
|
|
311
|
+
.argument("<script>", "Script ID or name")
|
|
312
|
+
.argument("<config>", "Config ID or name")
|
|
313
|
+
.option("--app <app-id>", "App ID (uses current app if not specified)")
|
|
314
|
+
.option("--json", "Output as JSON")
|
|
315
|
+
.action(async (script, config, options) => {
|
|
316
|
+
const resolvedAppId = resolveAppId(undefined, options);
|
|
317
|
+
const client = new ApiClient();
|
|
318
|
+
try {
|
|
319
|
+
const scriptId = await resolveScriptId(client, resolvedAppId, script);
|
|
320
|
+
const header = await client.getScript(resolvedAppId, scriptId);
|
|
321
|
+
const { items } = await client.listScriptConfigs(resolvedAppId, scriptId);
|
|
322
|
+
const found = (items ?? []).find((c) => c.configId === config || c.configName === config);
|
|
323
|
+
if (!found) {
|
|
324
|
+
error(`Script '${script}' has no version '${config}'. Run 'primitive scripts configs list ${script}' to see them.`);
|
|
325
|
+
process.exit(1);
|
|
326
|
+
}
|
|
327
|
+
if (options.json) {
|
|
328
|
+
json(found);
|
|
329
|
+
return;
|
|
330
|
+
}
|
|
331
|
+
keyValue("Config ID", found.configId);
|
|
332
|
+
keyValue("Name", found.configName);
|
|
333
|
+
keyValue("Status", found.status);
|
|
334
|
+
keyValue("Active", found.configId === header.activeConfigId ? "Yes" : "No");
|
|
335
|
+
if (found.contentHash)
|
|
336
|
+
keyValue("Content Hash", found.contentHash);
|
|
337
|
+
if (found.createdAt)
|
|
338
|
+
keyValue("Created", formatDate(found.createdAt));
|
|
339
|
+
if (typeof found.body === "string") {
|
|
340
|
+
divider();
|
|
341
|
+
info("Body:");
|
|
342
|
+
console.log(found.body);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
catch (err) {
|
|
346
|
+
error(err.message);
|
|
347
|
+
process.exit(1);
|
|
348
|
+
}
|
|
349
|
+
});
|
|
350
|
+
// ============================================
|
|
351
|
+
// TESTS SUBCOMMAND — script block testing (blockType "script")
|
|
352
|
+
// ============================================
|
|
353
|
+
const tests = scripts
|
|
354
|
+
.command("tests")
|
|
355
|
+
.description("Run and inspect script test cases")
|
|
356
|
+
.addHelpText("after", `
|
|
357
|
+
Test cases are authored in TOML at transforms/<name>.tests/<case>.toml and
|
|
358
|
+
applied with \`primitive config push\` (issue #2769); \`config fields transform\`
|
|
359
|
+
lists the fields. Deleting a case is removing its file and running
|
|
360
|
+
\`config push --prune\`.
|
|
361
|
+
|
|
362
|
+
Test modes:
|
|
363
|
+
Active version — omit --config; runs against the script's active config.
|
|
364
|
+
Pinned version — pass --config <config-id> to run a specific version.
|
|
365
|
+
|
|
366
|
+
Examples:
|
|
367
|
+
$ primitive scripts tests list my-transform
|
|
368
|
+
$ primitive scripts tests run my-transform <test-case-id>
|
|
369
|
+
$ primitive scripts tests run my-transform <test-case-id> --config <config-id>
|
|
370
|
+
$ primitive scripts tests run-all my-transform
|
|
371
|
+
$ primitive scripts tests runs my-transform
|
|
372
|
+
`);
|
|
373
|
+
// List test cases
|
|
374
|
+
tests
|
|
375
|
+
.command("list")
|
|
376
|
+
.description("List test cases for a script")
|
|
377
|
+
.argument("<script>", "Script ID or name")
|
|
378
|
+
.addOption(pageLimitOption())
|
|
379
|
+
.addOption(pageCursorOption())
|
|
380
|
+
.option("--json", "Output as JSON")
|
|
381
|
+
.action(async (script, options) => {
|
|
382
|
+
const limit = parsePageLimit(options.limit);
|
|
383
|
+
const resolvedAppId = getCurrentAppId();
|
|
384
|
+
const client = new ApiClient();
|
|
385
|
+
try {
|
|
386
|
+
const { scriptId, name } = await resolveScript(client, resolvedAppId, script);
|
|
387
|
+
const page = normalizeCliListEnvelope(await client.listTestCases(resolvedAppId, "script", scriptId, {
|
|
388
|
+
limit,
|
|
389
|
+
cursor: options.cursor,
|
|
390
|
+
}));
|
|
391
|
+
const items = page.items;
|
|
392
|
+
// The listing shows the REGISTERED set; the local directory can hold
|
|
393
|
+
// more (#3061). Reported before the early returns below, so "no test
|
|
394
|
+
// cases" and a `--json` array both carry the discrepancy on stderr.
|
|
395
|
+
await reportUnregisteredLocalTestCases({
|
|
396
|
+
client,
|
|
397
|
+
appId: resolvedAppId,
|
|
398
|
+
scriptId,
|
|
399
|
+
scriptName: name,
|
|
400
|
+
registered: { items: items ?? [], nextCursor: page.nextCursor },
|
|
401
|
+
});
|
|
402
|
+
if (options.json) {
|
|
403
|
+
json(page);
|
|
404
|
+
return;
|
|
405
|
+
}
|
|
406
|
+
if (items.length === 0) {
|
|
407
|
+
printEmptyPage(page, "test cases");
|
|
408
|
+
return;
|
|
409
|
+
}
|
|
410
|
+
console.log(formatTable(items, [
|
|
411
|
+
{ header: "ID", key: "testCaseId", format: formatId },
|
|
412
|
+
{ header: "NAME", key: "name" },
|
|
413
|
+
{
|
|
414
|
+
header: "CONFIG",
|
|
415
|
+
key: "configId",
|
|
416
|
+
format: (v) => (v ? formatId(v) : "-"),
|
|
417
|
+
},
|
|
418
|
+
{ header: "CREATED", key: "createdAt", format: formatDate },
|
|
419
|
+
]));
|
|
420
|
+
printPageHint(page);
|
|
421
|
+
}
|
|
422
|
+
catch (err) {
|
|
423
|
+
error(err.message);
|
|
424
|
+
process.exit(1);
|
|
425
|
+
}
|
|
426
|
+
});
|
|
427
|
+
// Get test case
|
|
428
|
+
tests
|
|
429
|
+
.command("get")
|
|
430
|
+
.description("Get test case details")
|
|
431
|
+
.argument("<script>", "Script ID or name")
|
|
432
|
+
.argument("<test-case-id>", "Test Case ID")
|
|
433
|
+
.option("--app <app-id>", "App ID (uses current app if not specified)")
|
|
434
|
+
.option("--json", "Output as JSON")
|
|
435
|
+
.action(async (script, testCaseId, options) => {
|
|
436
|
+
const resolvedAppId = resolveAppId(undefined, options);
|
|
437
|
+
const client = new ApiClient();
|
|
438
|
+
try {
|
|
439
|
+
const scriptId = await resolveScriptId(client, resolvedAppId, script);
|
|
440
|
+
const result = await client.getTestCase(resolvedAppId, "script", scriptId, testCaseId);
|
|
441
|
+
if (options.json) {
|
|
442
|
+
json(result);
|
|
443
|
+
return;
|
|
444
|
+
}
|
|
445
|
+
printResult("Test Case ID", result.testCaseId);
|
|
446
|
+
printResult("Name", result.name);
|
|
447
|
+
printResult("Config ID", result.configId || "-");
|
|
448
|
+
printResult("Created", formatDate(result.createdAt));
|
|
449
|
+
divider();
|
|
450
|
+
info("Input Variables:");
|
|
451
|
+
try {
|
|
452
|
+
console.log(JSON.stringify(JSON.parse(result.inputVariables || "{}"), null, 2));
|
|
453
|
+
}
|
|
454
|
+
catch {
|
|
455
|
+
console.log(result.inputVariables || "{}");
|
|
456
|
+
}
|
|
457
|
+
if (result.expectedOutputPattern) {
|
|
458
|
+
divider();
|
|
459
|
+
printResult("Expected Pattern", result.expectedOutputPattern);
|
|
460
|
+
}
|
|
461
|
+
if (result.expectedOutputContains) {
|
|
462
|
+
divider();
|
|
463
|
+
info("Expected Contains:");
|
|
464
|
+
try {
|
|
465
|
+
console.log(JSON.stringify(JSON.parse(result.expectedOutputContains), null, 2));
|
|
466
|
+
}
|
|
467
|
+
catch {
|
|
468
|
+
console.log(result.expectedOutputContains);
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
if (result.expectedJsonSubset) {
|
|
472
|
+
divider();
|
|
473
|
+
info("Expected JSON Subset:");
|
|
474
|
+
try {
|
|
475
|
+
console.log(JSON.stringify(JSON.parse(result.expectedJsonSubset), null, 2));
|
|
476
|
+
}
|
|
477
|
+
catch {
|
|
478
|
+
console.log(result.expectedJsonSubset);
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
catch (err) {
|
|
483
|
+
error(err.message);
|
|
484
|
+
process.exit(1);
|
|
485
|
+
}
|
|
486
|
+
});
|
|
487
|
+
// Run a single test case
|
|
488
|
+
tests
|
|
489
|
+
.command("run")
|
|
490
|
+
.description("Run a single test case")
|
|
491
|
+
.argument("<script>", "Script ID or name")
|
|
492
|
+
.argument("<test-case-id>", "Test Case ID")
|
|
493
|
+
.option("--app <app-id>", "App ID (uses current app if not specified)")
|
|
494
|
+
.option("--config <config-id>", "Pin to a specific version (defaults to the test case's config, else the active version)")
|
|
495
|
+
.option("--json", "Output as JSON")
|
|
496
|
+
.action(async (script, testCaseId, options) => {
|
|
497
|
+
const resolvedAppId = resolveAppId(undefined, options);
|
|
498
|
+
const client = new ApiClient();
|
|
499
|
+
try {
|
|
500
|
+
const scriptId = await resolveScriptId(client, resolvedAppId, script);
|
|
501
|
+
const testCase = await client.getTestCase(resolvedAppId, "script", scriptId, testCaseId);
|
|
502
|
+
// #3158 — whatever this sends IS the input the case runs against, and
|
|
503
|
+
// the server hands the case back with its JSON fields already parsed.
|
|
504
|
+
// `JSON.parse` on that object threw and the run went ahead with `{}`,
|
|
505
|
+
// so this verb disagreed with `run-all` over the same stored case.
|
|
506
|
+
const variables = requireTestCaseInputVariables(testCase.inputVariables, testCaseId);
|
|
507
|
+
const result = await client.executeBlockTest(resolvedAppId, "script", scriptId, {
|
|
508
|
+
variables,
|
|
509
|
+
testCaseId,
|
|
510
|
+
configId: options.config || testCase.configId,
|
|
511
|
+
});
|
|
512
|
+
if (options.json) {
|
|
513
|
+
json(result);
|
|
514
|
+
return;
|
|
515
|
+
}
|
|
516
|
+
const passed = result.verification?.passed;
|
|
517
|
+
if (passed) {
|
|
518
|
+
success("Test PASSED");
|
|
519
|
+
}
|
|
520
|
+
else {
|
|
521
|
+
error("Test FAILED");
|
|
522
|
+
}
|
|
523
|
+
keyValue("Duration", formatDuration(result.metrics?.durationMs));
|
|
524
|
+
if (result.verification) {
|
|
525
|
+
divider();
|
|
526
|
+
info("Verification:");
|
|
527
|
+
const v = result.verification;
|
|
528
|
+
keyValue(" Passed", v.passed ? chalk.green("Yes") : chalk.red("No"));
|
|
529
|
+
if (v.summary) {
|
|
530
|
+
keyValue(" Checks", `${v.summary?.passed || 0}/${v.summary?.total || 0} passed`);
|
|
531
|
+
}
|
|
532
|
+
if (v.checks && v.checks.length > 0) {
|
|
533
|
+
console.log();
|
|
534
|
+
for (const check of v.checks) {
|
|
535
|
+
const icon = check.passed ? chalk.green("✓") : chalk.red("✗");
|
|
536
|
+
console.log(` ${icon} ${check.name}`);
|
|
537
|
+
if (!check.passed && check.message) {
|
|
538
|
+
console.log(` ${chalk.dim(check.message)}`);
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
if (result.output) {
|
|
544
|
+
divider();
|
|
545
|
+
info("Output:");
|
|
546
|
+
console.log(result.output);
|
|
547
|
+
}
|
|
548
|
+
if (result.error) {
|
|
549
|
+
divider();
|
|
550
|
+
error(`Error: ${result.error}`);
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
catch (err) {
|
|
554
|
+
error(err.message);
|
|
555
|
+
process.exit(1);
|
|
556
|
+
}
|
|
557
|
+
});
|
|
558
|
+
// Run all test cases
|
|
559
|
+
tests
|
|
560
|
+
.command("run-all")
|
|
561
|
+
.description("Run all test cases for a script, or a specific subset")
|
|
562
|
+
.argument("<script>", "Script ID or name")
|
|
563
|
+
.option("--config <config-id>", "Override config ID for all tests (pin to a version)")
|
|
564
|
+
.option("--test-cases <ids>", "Comma-separated list of test case IDs to run (runs only these)")
|
|
565
|
+
.option("--json", "Output as JSON")
|
|
566
|
+
.action(async (script, options) => {
|
|
567
|
+
const resolvedAppId = getCurrentAppId();
|
|
568
|
+
const client = new ApiClient();
|
|
569
|
+
try {
|
|
570
|
+
let testCaseIds;
|
|
571
|
+
if (options.testCases) {
|
|
572
|
+
testCaseIds = options.testCases
|
|
573
|
+
.split(",")
|
|
574
|
+
.map((id) => id.trim())
|
|
575
|
+
.filter(Boolean);
|
|
576
|
+
if (testCaseIds.length === 0) {
|
|
577
|
+
error("No valid test case IDs provided in --test-cases");
|
|
578
|
+
process.exit(1);
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
const { scriptId, name } = await resolveScript(client, resolvedAppId, script);
|
|
582
|
+
if (!options.json) {
|
|
583
|
+
if (testCaseIds) {
|
|
584
|
+
info(`Running ${testCaseIds.length} selected test case(s)...`);
|
|
585
|
+
}
|
|
586
|
+
else {
|
|
587
|
+
info("Running all test cases...");
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
const result = await client.runAllTestCases(resolvedAppId, "script", scriptId, {
|
|
591
|
+
overrideConfigId: options.config,
|
|
592
|
+
testCaseIds,
|
|
593
|
+
});
|
|
594
|
+
// A run that only ever sees the registered set cannot report a clean
|
|
595
|
+
// pass over a case file nobody pushed (#3061). Reported last in human
|
|
596
|
+
// output — the end of the run is where the verdict is read.
|
|
597
|
+
const reportUnrunFiles = () => reportUnregisteredLocalTestCases({
|
|
598
|
+
client,
|
|
599
|
+
appId: resolvedAppId,
|
|
600
|
+
scriptId,
|
|
601
|
+
scriptName: name,
|
|
602
|
+
});
|
|
603
|
+
if (options.json) {
|
|
604
|
+
const unregisteredLocalTestCaseFiles = await reportUnrunFiles();
|
|
605
|
+
json({ ...result, unregisteredLocalTestCaseFiles });
|
|
606
|
+
return;
|
|
607
|
+
}
|
|
608
|
+
const { summary, runs, comparisonGroup } = result;
|
|
609
|
+
divider();
|
|
610
|
+
keyValue("Comparison Group", comparisonGroup);
|
|
611
|
+
keyValue("Total Tests", summary.total);
|
|
612
|
+
keyValue("Passed", chalk.green(summary.passed));
|
|
613
|
+
keyValue("Failed", summary.failed > 0 ? chalk.red(summary.failed) : "0");
|
|
614
|
+
divider();
|
|
615
|
+
if (runs && runs.length > 0) {
|
|
616
|
+
for (const r of runs) {
|
|
617
|
+
const passed = r.verification?.passed;
|
|
618
|
+
const icon = passed ? chalk.green("✓") : chalk.red("✗");
|
|
619
|
+
const status = passed ? "PASSED" : "FAILED";
|
|
620
|
+
console.log(`${icon} ${r.testCaseName} - ${status}`);
|
|
621
|
+
if (!passed && r.verification?.details?.reason) {
|
|
622
|
+
console.log(` ${chalk.dim(r.verification.details.reason)}`);
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
await reportUnrunFiles();
|
|
627
|
+
if (summary.failed > 0) {
|
|
628
|
+
process.exit(1);
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
catch (err) {
|
|
632
|
+
error(err.message);
|
|
633
|
+
process.exit(1);
|
|
634
|
+
}
|
|
635
|
+
});
|
|
636
|
+
// List test runs
|
|
637
|
+
tests
|
|
638
|
+
.command("runs")
|
|
639
|
+
.description("List recent test runs for a script")
|
|
640
|
+
.argument("<script>", "Script ID or name")
|
|
641
|
+
.option("--app <app-id>", "App ID (uses current app if not specified)")
|
|
642
|
+
.option("--limit <n>", "Maximum number of runs to show", "20")
|
|
643
|
+
.option("--group <group>", "Filter by comparison group")
|
|
644
|
+
.option("--json", "Output as JSON")
|
|
645
|
+
.action(async (script, options) => {
|
|
646
|
+
const resolvedAppId = resolveAppId(undefined, options);
|
|
647
|
+
const client = new ApiClient();
|
|
648
|
+
try {
|
|
649
|
+
const scriptId = await resolveScriptId(client, resolvedAppId, script);
|
|
650
|
+
const { items } = await client.listTestRuns(resolvedAppId, "script", scriptId, {
|
|
651
|
+
limit: parseInt(options.limit),
|
|
652
|
+
comparisonGroup: options.group,
|
|
653
|
+
});
|
|
654
|
+
if (options.json) {
|
|
655
|
+
json(items);
|
|
656
|
+
return;
|
|
657
|
+
}
|
|
658
|
+
if (!items || items.length === 0) {
|
|
659
|
+
info("No test runs found.");
|
|
660
|
+
return;
|
|
661
|
+
}
|
|
662
|
+
console.log(formatTable(items, [
|
|
663
|
+
{ header: "RUN ID", key: "runId", format: formatId },
|
|
664
|
+
{
|
|
665
|
+
header: "TEST CASE ID",
|
|
666
|
+
key: "testCaseId",
|
|
667
|
+
format: (v) => (v ? formatId(v) : "-"),
|
|
668
|
+
},
|
|
669
|
+
{
|
|
670
|
+
header: "PASSED",
|
|
671
|
+
key: "verificationPassed",
|
|
672
|
+
format: (v) => v === true
|
|
673
|
+
? chalk.green("Yes")
|
|
674
|
+
: v === false
|
|
675
|
+
? chalk.red("No")
|
|
676
|
+
: "-",
|
|
677
|
+
},
|
|
678
|
+
{ header: "DURATION", key: "durationMs", format: formatDuration },
|
|
679
|
+
{ header: "STARTED", key: "startedAt", format: formatDate },
|
|
680
|
+
]));
|
|
681
|
+
}
|
|
682
|
+
catch (err) {
|
|
683
|
+
error(err.message);
|
|
684
|
+
process.exit(1);
|
|
685
|
+
}
|
|
686
|
+
});
|
|
687
|
+
}
|
|
688
|
+
//# sourceMappingURL=scripts.js.map
|