@copado/agentia-cli 0.122.0-alpha.1 → 1.0.0-beta.1
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/CHANGELOG.md +29 -0
- package/README.md +423 -269
- package/dist/commands/auth/get.js +45 -136
- package/dist/commands/auth/set.js +3 -3
- package/dist/commands/cicd/project/create.js +33 -0
- package/dist/commands/cicd/project/default/set.js +2 -0
- package/dist/commands/cicd/project/delete.js +33 -0
- package/dist/commands/cicd/project/list.js +5 -1
- package/dist/commands/cicd/project/update.js +35 -0
- package/dist/commands/cicd/promotion/job-step/update.js +58 -0
- package/dist/commands/cicd/repository/create.js +1 -1
- package/dist/commands/cicd/repository/update.js +1 -1
- package/dist/commands/cicd/work/submit.js +3 -0
- package/dist/commands/update.js +1 -1
- package/dist/lib/agentia-oauth-error-codes.js +5 -30
- package/dist/lib/ai-chat-session.js +3 -157
- package/dist/lib/ai-config.js +14 -140
- package/dist/lib/ai-flags.js +4 -12
- package/dist/lib/ai-gateway.js +6 -382
- package/dist/lib/ai-operations.js +4 -203
- package/dist/lib/ai-stream-parser.js +4 -59
- package/dist/lib/ai-terminal-renderer.js +7 -83
- package/dist/lib/ai-types.js +31 -162
- package/dist/lib/assert.js +3 -7
- package/dist/lib/auth-config.js +20 -516
- package/dist/lib/auth-profile.js +8 -112
- package/dist/lib/auth-status-format.js +6 -0
- package/dist/lib/cicd-gateway.js +43 -834
- package/dist/lib/cicd-region.js +5 -8
- package/dist/lib/cli-update.js +11 -84
- package/dist/lib/cli-version.js +17 -142
- package/dist/lib/command-output-buffer.js +15 -124
- package/dist/lib/credential-store.js +39 -160
- package/dist/lib/credential-sync.js +12 -256
- package/dist/lib/cursor-mcp-config.js +16 -174
- package/dist/lib/data-flags.js +8 -61
- package/dist/lib/data-types.js +30 -182
- package/dist/lib/debug.js +5 -25
- package/dist/lib/defaults-store.js +34 -587
- package/dist/lib/dependency-from-changes.js +7 -121
- package/dist/lib/deployment-step-config.js +7 -110
- package/dist/lib/deployment-step-types.js +26 -223
- package/dist/lib/deployment-step-wizard.js +5 -155
- package/dist/lib/env-file.js +5 -41
- package/dist/lib/environment-auth-status.js +5 -72
- package/dist/lib/environment-auth.js +6 -147
- package/dist/lib/environment-credential-flags.js +13 -73
- package/dist/lib/environment-credential-operations.js +9 -67
- package/dist/lib/environment-credential-selection.js +4 -60
- package/dist/lib/environment-flags.js +18 -165
- package/dist/lib/environment-types.js +14 -79
- package/dist/lib/format.js +4 -108
- package/dist/lib/function-flags.js +8 -199
- package/dist/lib/function-local-run.js +14 -148
- package/dist/lib/function-types.js +22 -179
- package/dist/lib/git-worktree.js +36 -306
- package/dist/lib/ide-command-events.js +25 -248
- package/dist/lib/job-types.js +26 -211
- package/dist/lib/list-pagination.js +16 -106
- package/dist/lib/local-gateway-config.js +8 -53
- package/dist/lib/local-metadata-paths.js +3 -77
- package/dist/lib/local-quality-gates.js +13 -133
- package/dist/lib/loopback-callback-server.js +9 -169
- package/dist/lib/mcp/command-id.js +1 -0
- package/dist/lib/mcp/tools.js +126 -0
- package/dist/lib/mcp/work-tools.js +12 -2
- package/dist/lib/metadata-common.js +27 -237
- package/dist/lib/metadata-refresh.js +8 -104
- package/dist/lib/navigation-open.js +3 -20
- package/dist/lib/navigation.js +7 -63
- package/dist/lib/nested-metadata-changes.js +9 -260
- package/dist/lib/nested-metadata-registry.js +12 -257
- package/dist/lib/notifications-configure.js +13 -101
- package/dist/lib/open-browser.js +6 -52
- package/dist/lib/pipeline-connection-flags.js +17 -309
- package/dist/lib/pipeline-flags.js +16 -154
- package/dist/lib/pipeline-stage-connection-flags.js +8 -46
- package/dist/lib/pipeline-types.js +18 -118
- package/dist/lib/project-default-flags.js +10 -88
- package/dist/lib/project-default-id.js +4 -29
- package/dist/lib/project-default-validation.js +7 -0
- package/dist/lib/project-defaults.js +8 -54
- package/dist/lib/project-flags.js +10 -22
- package/dist/lib/project-root.js +7 -65
- package/dist/lib/project-setup.js +13 -406
- package/dist/lib/project-types.js +9 -54
- package/dist/lib/promotion-conflicts.js +12 -83
- package/dist/lib/promotion-flags.js +4 -76
- package/dist/lib/promotion-job-steps.js +5 -0
- package/dist/lib/promotion-run.js +27 -481
- package/dist/lib/promotion-types.js +12 -144
- package/dist/lib/repository-flags.js +16 -236
- package/dist/lib/repository-types.js +16 -123
- package/dist/lib/runtime.js +1 -0
- package/dist/lib/salesforce-id.js +5 -42
- package/dist/lib/sdr-metadata-registry.generated.js +7 -6330
- package/dist/lib/sdr-path-resolver.js +4 -116
- package/dist/lib/secret-redaction.js +4 -24
- package/dist/lib/setup-prompts.js +4 -14
- package/dist/lib/setup-skills.js +16 -263
- package/dist/lib/setup-templates.js +12 -215
- package/dist/lib/setup-wizard.js +5 -593
- package/dist/lib/sf-org-context.js +7 -151
- package/dist/lib/stage-flags.js +7 -29
- package/dist/lib/stage-types.js +14 -69
- package/dist/lib/stock-quality-gates.js +5 -67
- package/dist/lib/testing-config.js +17 -175
- package/dist/lib/testing-confirmation.js +5 -17
- package/dist/lib/testing-data-command.js +8 -49
- package/dist/lib/testing-data-core.js +20 -208
- package/dist/lib/testing-data-export.js +6 -2
- package/dist/lib/testing-data-import.js +6 -2
- package/dist/lib/testing-data-io.js +12 -236
- package/dist/lib/testing-data-operations.js +10 -91
- package/dist/lib/testing-data-types.js +4 -3
- package/dist/lib/testing-flags.js +14 -312
- package/dist/lib/testing-gateway.js +15 -363
- package/dist/lib/testing-live-command.js +6 -56
- package/dist/lib/testing-live-endpoints.js +6 -34
- package/dist/lib/testing-live-history.js +7 -96
- package/dist/lib/testing-live-operations.js +19 -676
- package/dist/lib/testing-live-recorder.js +9 -122
- package/dist/lib/testing-live-robot.js +9 -158
- package/dist/lib/testing-live-state.js +5 -90
- package/dist/lib/testing-live-types.js +3 -2
- package/dist/lib/testing-operations.js +60 -1309
- package/dist/lib/testing-run-command.js +3 -94
- package/dist/lib/testing-sanitization.js +9 -135
- package/dist/lib/testing-schedule.js +5 -48
- package/dist/lib/testing-secret-input.js +4 -56
- package/dist/lib/testing-session.js +5 -82
- package/dist/lib/testing-types.js +54 -401
- package/dist/lib/testing-watch.js +4 -45
- package/dist/lib/user-context-types.js +3 -2
- package/dist/lib/user-context.js +3 -34
- package/dist/lib/user-types.js +6 -21
- package/dist/lib/var-replacement.js +14 -153
- package/dist/lib/version-warning.js +2 -1
- package/dist/lib/work-active.js +4 -23
- package/dist/lib/work-apex-test.js +12 -265
- package/dist/lib/work-branch-metadata.js +4 -40
- package/dist/lib/work-commit.js +23 -387
- package/dist/lib/work-defaults.js +5 -50
- package/dist/lib/work-done.js +5 -136
- package/dist/lib/work-flags.js +16 -258
- package/dist/lib/work-local-commit.js +7 -138
- package/dist/lib/work-local-run-tests.js +5 -61
- package/dist/lib/work-publish-command.js +5 -88
- package/dist/lib/work-push.js +25 -627
- package/dist/lib/work-set-none.js +4 -58
- package/dist/lib/work-set-selection.js +5 -46
- package/dist/lib/work-submit-wait.js +11 -0
- package/dist/lib/work-types.js +28 -336
- package/dist/lib/yaml-replacement.js +13 -132
- package/oclif.manifest.json +356 -14
- package/package.json +21 -86
- package/templates/skills/agentia-cicd/references/work.md +35 -28
- package/theme.json +12 -0
- package/bin/dev.cmd +0 -3
- package/bin/dev.js +0 -10
- package/dist/commands/ai/agent/ask.d.ts +0 -21
- package/dist/commands/ai/agent/ask.js.map +0 -1
- package/dist/commands/ai/agent/chat.d.ts +0 -21
- package/dist/commands/ai/agent/chat.js.map +0 -1
- package/dist/commands/ai/quota/get.d.ts +0 -10
- package/dist/commands/ai/quota/get.js.map +0 -1
- package/dist/commands/ai/workspace/create.d.ts +0 -13
- package/dist/commands/ai/workspace/create.js.map +0 -1
- package/dist/commands/ai/workspace/get.d.ts +0 -13
- package/dist/commands/ai/workspace/get.js.map +0 -1
- package/dist/commands/ai/workspace/list.d.ts +0 -12
- package/dist/commands/ai/workspace/list.js.map +0 -1
- package/dist/commands/ai/workspace/member/invite.d.ts +0 -15
- package/dist/commands/ai/workspace/member/invite.js.map +0 -1
- package/dist/commands/ai/workspace/member/list.d.ts +0 -16
- package/dist/commands/ai/workspace/member/list.js.map +0 -1
- package/dist/commands/ai/workspace/update.d.ts +0 -18
- package/dist/commands/ai/workspace/update.js.map +0 -1
- package/dist/commands/auth/get.d.ts +0 -47
- package/dist/commands/auth/get.js.map +0 -1
- package/dist/commands/auth/set.d.ts +0 -22
- package/dist/commands/auth/set.js.map +0 -1
- package/dist/commands/auth/unset.d.ts +0 -18
- package/dist/commands/auth/unset.js.map +0 -1
- package/dist/commands/cicd/credential/create.d.ts +0 -12
- package/dist/commands/cicd/credential/create.js.map +0 -1
- package/dist/commands/cicd/credential/list.d.ts +0 -12
- package/dist/commands/cicd/credential/list.js.map +0 -1
- package/dist/commands/cicd/credential/update.d.ts +0 -15
- package/dist/commands/cicd/credential/update.js.map +0 -1
- package/dist/commands/cicd/data/commit/create.d.ts +0 -11
- package/dist/commands/cicd/data/commit/create.js.map +0 -1
- package/dist/commands/cicd/data/commit/list.d.ts +0 -10
- package/dist/commands/cicd/data/commit/list.js.map +0 -1
- package/dist/commands/cicd/data/dataset-file/content.d.ts +0 -10
- package/dist/commands/cicd/data/dataset-file/content.js.map +0 -1
- package/dist/commands/cicd/data/dataset-file/list.d.ts +0 -10
- package/dist/commands/cicd/data/dataset-file/list.js.map +0 -1
- package/dist/commands/cicd/data/filter/add.d.ts +0 -13
- package/dist/commands/cicd/data/filter/add.js.map +0 -1
- package/dist/commands/cicd/data/filter/delete.d.ts +0 -10
- package/dist/commands/cicd/data/filter/delete.js.map +0 -1
- package/dist/commands/cicd/data/filter/list.d.ts +0 -10
- package/dist/commands/cicd/data/filter/list.js.map +0 -1
- package/dist/commands/cicd/data/filter/update.d.ts +0 -14
- package/dist/commands/cicd/data/filter/update.js.map +0 -1
- package/dist/commands/cicd/data/formula/create.d.ts +0 -16
- package/dist/commands/cicd/data/formula/create.js.map +0 -1
- package/dist/commands/cicd/data/formula/list.d.ts +0 -10
- package/dist/commands/cicd/data/formula/list.js.map +0 -1
- package/dist/commands/cicd/data/formula/update.d.ts +0 -18
- package/dist/commands/cicd/data/formula/update.js.map +0 -1
- package/dist/commands/cicd/data/records/match.d.ts +0 -11
- package/dist/commands/cicd/data/records/match.js.map +0 -1
- package/dist/commands/cicd/data/records/search.d.ts +0 -14
- package/dist/commands/cicd/data/records/search.js.map +0 -1
- package/dist/commands/cicd/data/sobject/fields.d.ts +0 -13
- package/dist/commands/cicd/data/sobject/fields.js.map +0 -1
- package/dist/commands/cicd/data/sobject/relationships.d.ts +0 -13
- package/dist/commands/cicd/data/sobject/relationships.js.map +0 -1
- package/dist/commands/cicd/data/sync/apply.d.ts +0 -11
- package/dist/commands/cicd/data/sync/apply.js.map +0 -1
- package/dist/commands/cicd/data/sync/preview-updates.d.ts +0 -11
- package/dist/commands/cicd/data/sync/preview-updates.js.map +0 -1
- package/dist/commands/cicd/data/template/convert-old.d.ts +0 -9
- package/dist/commands/cicd/data/template/convert-old.js.map +0 -1
- package/dist/commands/cicd/data/template/create.d.ts +0 -13
- package/dist/commands/cicd/data/template/create.js.map +0 -1
- package/dist/commands/cicd/data/template/delete.d.ts +0 -9
- package/dist/commands/cicd/data/template/delete.js.map +0 -1
- package/dist/commands/cicd/data/template/get-detail.d.ts +0 -10
- package/dist/commands/cicd/data/template/get-detail.js.map +0 -1
- package/dist/commands/cicd/data/template/get.d.ts +0 -10
- package/dist/commands/cicd/data/template/get.js.map +0 -1
- package/dist/commands/cicd/data/template/list.d.ts +0 -13
- package/dist/commands/cicd/data/template/list.js.map +0 -1
- package/dist/commands/cicd/data/template/open.d.ts +0 -12
- package/dist/commands/cicd/data/template/open.js.map +0 -1
- package/dist/commands/cicd/data/template/save-detail.d.ts +0 -13
- package/dist/commands/cicd/data/template/save-detail.js.map +0 -1
- package/dist/commands/cicd/environment/auth/status.d.ts +0 -13
- package/dist/commands/cicd/environment/auth/status.js.map +0 -1
- package/dist/commands/cicd/environment/auth/web/login.d.ts +0 -15
- package/dist/commands/cicd/environment/auth/web/login.js.map +0 -1
- package/dist/commands/cicd/environment/create.d.ts +0 -22
- package/dist/commands/cicd/environment/create.js.map +0 -1
- package/dist/commands/cicd/environment/get.d.ts +0 -10
- package/dist/commands/cicd/environment/get.js.map +0 -1
- package/dist/commands/cicd/environment/list.d.ts +0 -27
- package/dist/commands/cicd/environment/list.js.map +0 -1
- package/dist/commands/cicd/environment/open.d.ts +0 -15
- package/dist/commands/cicd/environment/open.js.map +0 -1
- package/dist/commands/cicd/environment/update.d.ts +0 -23
- package/dist/commands/cicd/environment/update.js.map +0 -1
- package/dist/commands/cicd/function/defaults.d.ts +0 -12
- package/dist/commands/cicd/function/defaults.js.map +0 -1
- package/dist/commands/cicd/function/delete.d.ts +0 -11
- package/dist/commands/cicd/function/delete.js.map +0 -1
- package/dist/commands/cicd/function/get.d.ts +0 -10
- package/dist/commands/cicd/function/get.js.map +0 -1
- package/dist/commands/cicd/function/list.d.ts +0 -16
- package/dist/commands/cicd/function/list.js.map +0 -1
- package/dist/commands/cicd/function/open.d.ts +0 -12
- package/dist/commands/cicd/function/open.js.map +0 -1
- package/dist/commands/cicd/function/result/get.d.ts +0 -10
- package/dist/commands/cicd/function/result/get.js.map +0 -1
- package/dist/commands/cicd/function/result/log/get.d.ts +0 -17
- package/dist/commands/cicd/function/result/log/get.js.map +0 -1
- package/dist/commands/cicd/function/run-local.d.ts +0 -17
- package/dist/commands/cicd/function/run-local.js.map +0 -1
- package/dist/commands/cicd/function/run.d.ts +0 -16
- package/dist/commands/cicd/function/run.js.map +0 -1
- package/dist/commands/cicd/function/upsert.d.ts +0 -27
- package/dist/commands/cicd/function/upsert.js.map +0 -1
- package/dist/commands/cicd/job/get.d.ts +0 -10
- package/dist/commands/cicd/job/get.js.map +0 -1
- package/dist/commands/cicd/job/kill.d.ts +0 -10
- package/dist/commands/cicd/job/kill.js.map +0 -1
- package/dist/commands/cicd/job/list.d.ts +0 -19
- package/dist/commands/cicd/job/list.js.map +0 -1
- package/dist/commands/cicd/job/log/get.d.ts +0 -18
- package/dist/commands/cicd/job/log/get.js.map +0 -1
- package/dist/commands/cicd/job/open.d.ts +0 -12
- package/dist/commands/cicd/job/open.js.map +0 -1
- package/dist/commands/cicd/job/pause.d.ts +0 -10
- package/dist/commands/cicd/job/pause.js.map +0 -1
- package/dist/commands/cicd/job/result-file/get.d.ts +0 -14
- package/dist/commands/cicd/job/result-file/get.js.map +0 -1
- package/dist/commands/cicd/job/result-file/list.d.ts +0 -10
- package/dist/commands/cicd/job/result-file/list.js.map +0 -1
- package/dist/commands/cicd/job/resume.d.ts +0 -10
- package/dist/commands/cicd/job/resume.js.map +0 -1
- package/dist/commands/cicd/job/run.d.ts +0 -13
- package/dist/commands/cicd/job/run.js.map +0 -1
- package/dist/commands/cicd/metadata/content/compare.d.ts +0 -40
- package/dist/commands/cicd/metadata/content/compare.js.map +0 -1
- package/dist/commands/cicd/metadata/content/get.d.ts +0 -39
- package/dist/commands/cicd/metadata/content/get.js.map +0 -1
- package/dist/commands/cicd/metadata/dependency/list.d.ts +0 -50
- package/dist/commands/cicd/metadata/dependency/list.js.map +0 -1
- package/dist/commands/cicd/metadata/index/compare.d.ts +0 -34
- package/dist/commands/cicd/metadata/index/compare.js.map +0 -1
- package/dist/commands/cicd/metadata/list.d.ts +0 -62
- package/dist/commands/cicd/metadata/list.js.map +0 -1
- package/dist/commands/cicd/metadata/refresh/deleted.d.ts +0 -13
- package/dist/commands/cicd/metadata/refresh/deleted.js.map +0 -1
- package/dist/commands/cicd/metadata/refresh/run.d.ts +0 -21
- package/dist/commands/cicd/metadata/refresh/run.js.map +0 -1
- package/dist/commands/cicd/metadata/refresh/status.d.ts +0 -12
- package/dist/commands/cicd/metadata/refresh/status.js.map +0 -1
- package/dist/commands/cicd/notification/configure.d.ts +0 -14
- package/dist/commands/cicd/notification/configure.js.map +0 -1
- package/dist/commands/cicd/pipeline/connection/create.d.ts +0 -19
- package/dist/commands/cicd/pipeline/connection/create.js.map +0 -1
- package/dist/commands/cicd/pipeline/connection/delete.d.ts +0 -15
- package/dist/commands/cicd/pipeline/connection/delete.js.map +0 -1
- package/dist/commands/cicd/pipeline/connection/list.d.ts +0 -10
- package/dist/commands/cicd/pipeline/connection/list.js.map +0 -1
- package/dist/commands/cicd/pipeline/connection/open.d.ts +0 -12
- package/dist/commands/cicd/pipeline/connection/open.js.map +0 -1
- package/dist/commands/cicd/pipeline/connection/update.d.ts +0 -19
- package/dist/commands/cicd/pipeline/connection/update.js.map +0 -1
- package/dist/commands/cicd/pipeline/create.d.ts +0 -19
- package/dist/commands/cicd/pipeline/create.js.map +0 -1
- package/dist/commands/cicd/pipeline/get.d.ts +0 -10
- package/dist/commands/cicd/pipeline/get.js.map +0 -1
- package/dist/commands/cicd/pipeline/list.d.ts +0 -15
- package/dist/commands/cicd/pipeline/list.js.map +0 -1
- package/dist/commands/cicd/pipeline/open.d.ts +0 -12
- package/dist/commands/cicd/pipeline/open.js.map +0 -1
- package/dist/commands/cicd/pipeline/stage-connection/create.d.ts +0 -12
- package/dist/commands/cicd/pipeline/stage-connection/create.js.map +0 -1
- package/dist/commands/cicd/pipeline/stage-connection/delete.d.ts +0 -16
- package/dist/commands/cicd/pipeline/stage-connection/delete.js.map +0 -1
- package/dist/commands/cicd/pipeline/stage-connection/list.d.ts +0 -10
- package/dist/commands/cicd/pipeline/stage-connection/list.js.map +0 -1
- package/dist/commands/cicd/pipeline/stage-connection/open.d.ts +0 -12
- package/dist/commands/cicd/pipeline/stage-connection/open.js.map +0 -1
- package/dist/commands/cicd/pipeline/stage-connection/update.d.ts +0 -15
- package/dist/commands/cicd/pipeline/stage-connection/update.js.map +0 -1
- package/dist/commands/cicd/pipeline/update.d.ts +0 -20
- package/dist/commands/cicd/pipeline/update.js.map +0 -1
- package/dist/commands/cicd/project/default/get.d.ts +0 -22
- package/dist/commands/cicd/project/default/get.js.map +0 -1
- package/dist/commands/cicd/project/default/set.d.ts +0 -22
- package/dist/commands/cicd/project/default/set.js.map +0 -1
- package/dist/commands/cicd/project/default/unset.d.ts +0 -22
- package/dist/commands/cicd/project/default/unset.js.map +0 -1
- package/dist/commands/cicd/project/get.d.ts +0 -10
- package/dist/commands/cicd/project/get.js.map +0 -1
- package/dist/commands/cicd/project/list.d.ts +0 -14
- package/dist/commands/cicd/project/list.js.map +0 -1
- package/dist/commands/cicd/project/open.d.ts +0 -12
- package/dist/commands/cicd/project/open.js.map +0 -1
- package/dist/commands/cicd/promotion/conflict/get.d.ts +0 -19
- package/dist/commands/cicd/promotion/conflict/get.js.map +0 -1
- package/dist/commands/cicd/promotion/conflict/list.d.ts +0 -10
- package/dist/commands/cicd/promotion/conflict/list.js.map +0 -1
- package/dist/commands/cicd/promotion/conflict/resolve.d.ts +0 -15
- package/dist/commands/cicd/promotion/conflict/resolve.js.map +0 -1
- package/dist/commands/cicd/promotion/conflict/unresolve.d.ts +0 -13
- package/dist/commands/cicd/promotion/conflict/unresolve.js.map +0 -1
- package/dist/commands/cicd/promotion/get.d.ts +0 -10
- package/dist/commands/cicd/promotion/get.js.map +0 -1
- package/dist/commands/cicd/promotion/list.d.ts +0 -33
- package/dist/commands/cicd/promotion/list.js.map +0 -1
- package/dist/commands/cicd/promotion/open.d.ts +0 -12
- package/dist/commands/cicd/promotion/open.js.map +0 -1
- package/dist/commands/cicd/promotion/run.d.ts +0 -23
- package/dist/commands/cicd/promotion/run.js.map +0 -1
- package/dist/commands/cicd/repository/create.d.ts +0 -25
- package/dist/commands/cicd/repository/create.js.map +0 -1
- package/dist/commands/cicd/repository/delete.d.ts +0 -11
- package/dist/commands/cicd/repository/delete.js.map +0 -1
- package/dist/commands/cicd/repository/get.d.ts +0 -10
- package/dist/commands/cicd/repository/get.js.map +0 -1
- package/dist/commands/cicd/repository/list.d.ts +0 -15
- package/dist/commands/cicd/repository/list.js.map +0 -1
- package/dist/commands/cicd/repository/open.d.ts +0 -12
- package/dist/commands/cicd/repository/open.js.map +0 -1
- package/dist/commands/cicd/repository/reset.d.ts +0 -12
- package/dist/commands/cicd/repository/reset.js.map +0 -1
- package/dist/commands/cicd/repository/update.d.ts +0 -34
- package/dist/commands/cicd/repository/update.js.map +0 -1
- package/dist/commands/cicd/repository/validate.d.ts +0 -10
- package/dist/commands/cicd/repository/validate.js.map +0 -1
- package/dist/commands/cicd/stage/create.d.ts +0 -14
- package/dist/commands/cicd/stage/create.js.map +0 -1
- package/dist/commands/cicd/stage/delete.d.ts +0 -14
- package/dist/commands/cicd/stage/delete.js.map +0 -1
- package/dist/commands/cicd/stage/get.d.ts +0 -10
- package/dist/commands/cicd/stage/get.js.map +0 -1
- package/dist/commands/cicd/stage/list.d.ts +0 -12
- package/dist/commands/cicd/stage/list.js.map +0 -1
- package/dist/commands/cicd/stage/open.d.ts +0 -12
- package/dist/commands/cicd/stage/open.js.map +0 -1
- package/dist/commands/cicd/stage/update.d.ts +0 -14
- package/dist/commands/cicd/stage/update.js.map +0 -1
- package/dist/commands/cicd/user/get.d.ts +0 -10
- package/dist/commands/cicd/user/get.js.map +0 -1
- package/dist/commands/cicd/work/commit.d.ts +0 -32
- package/dist/commands/cicd/work/commit.js.map +0 -1
- package/dist/commands/cicd/work/create.d.ts +0 -35
- package/dist/commands/cicd/work/create.js.map +0 -1
- package/dist/commands/cicd/work/delete.d.ts +0 -11
- package/dist/commands/cicd/work/delete.js.map +0 -1
- package/dist/commands/cicd/work/deployment-step/create.d.ts +0 -34
- package/dist/commands/cicd/work/deployment-step/create.js.map +0 -1
- package/dist/commands/cicd/work/deployment-step/delete.d.ts +0 -15
- package/dist/commands/cicd/work/deployment-step/delete.js.map +0 -1
- package/dist/commands/cicd/work/deployment-step/list.d.ts +0 -10
- package/dist/commands/cicd/work/deployment-step/list.js.map +0 -1
- package/dist/commands/cicd/work/deployment-step/reorder.d.ts +0 -12
- package/dist/commands/cicd/work/deployment-step/reorder.js.map +0 -1
- package/dist/commands/cicd/work/deployment-step/salesforce-flows.d.ts +0 -7
- package/dist/commands/cicd/work/deployment-step/salesforce-flows.js.map +0 -1
- package/dist/commands/cicd/work/deployment-step/types.d.ts +0 -7
- package/dist/commands/cicd/work/deployment-step/types.js.map +0 -1
- package/dist/commands/cicd/work/deployment-step/update.d.ts +0 -20
- package/dist/commands/cicd/work/deployment-step/update.js.map +0 -1
- package/dist/commands/cicd/work/done.d.ts +0 -14
- package/dist/commands/cicd/work/done.js.map +0 -1
- package/dist/commands/cicd/work/get.d.ts +0 -10
- package/dist/commands/cicd/work/get.js.map +0 -1
- package/dist/commands/cicd/work/list.d.ts +0 -23
- package/dist/commands/cicd/work/list.js.map +0 -1
- package/dist/commands/cicd/work/open.d.ts +0 -12
- package/dist/commands/cicd/work/open.js.map +0 -1
- package/dist/commands/cicd/work/promote.d.ts +0 -25
- package/dist/commands/cicd/work/promote.js.map +0 -1
- package/dist/commands/cicd/work/publish.d.ts +0 -12
- package/dist/commands/cicd/work/publish.js.map +0 -1
- package/dist/commands/cicd/work/push.d.ts +0 -16
- package/dist/commands/cicd/work/push.js.map +0 -1
- package/dist/commands/cicd/work/set.d.ts +0 -16
- package/dist/commands/cicd/work/set.js.map +0 -1
- package/dist/commands/cicd/work/status.d.ts +0 -14
- package/dist/commands/cicd/work/status.js.map +0 -1
- package/dist/commands/cicd/work/submit.d.ts +0 -17
- package/dist/commands/cicd/work/submit.js.map +0 -1
- package/dist/commands/cicd/work/test/apex.d.ts +0 -11
- package/dist/commands/cicd/work/test/apex.js.map +0 -1
- package/dist/commands/cicd/work/test.d.ts +0 -15
- package/dist/commands/cicd/work/test.js.map +0 -1
- package/dist/commands/cicd/work/update.d.ts +0 -38
- package/dist/commands/cicd/work/update.js.map +0 -1
- package/dist/commands/mcp/start.d.ts +0 -7
- package/dist/commands/mcp/start.js.map +0 -1
- package/dist/commands/setup/skills/create.d.ts +0 -15
- package/dist/commands/setup/skills/create.js.map +0 -1
- package/dist/commands/setup/skills/update.d.ts +0 -15
- package/dist/commands/setup/skills/update.js.map +0 -1
- package/dist/commands/setup.d.ts +0 -8
- package/dist/commands/setup.js.map +0 -1
- package/dist/commands/testing/build/abort.d.ts +0 -29
- package/dist/commands/testing/build/abort.js.map +0 -1
- package/dist/commands/testing/build/get.d.ts +0 -18
- package/dist/commands/testing/build/get.js.map +0 -1
- package/dist/commands/testing/build/latest.d.ts +0 -12
- package/dist/commands/testing/build/latest.js.map +0 -1
- package/dist/commands/testing/build/list.d.ts +0 -18
- package/dist/commands/testing/build/list.js.map +0 -1
- package/dist/commands/testing/build/logs.d.ts +0 -24
- package/dist/commands/testing/build/logs.js.map +0 -1
- package/dist/commands/testing/build/run.d.ts +0 -47
- package/dist/commands/testing/build/run.js.map +0 -1
- package/dist/commands/testing/build/search.d.ts +0 -21
- package/dist/commands/testing/build/search.js.map +0 -1
- package/dist/commands/testing/create.d.ts +0 -1
- package/dist/commands/testing/create.js.map +0 -1
- package/dist/commands/testing/data-table/create.d.ts +0 -30
- package/dist/commands/testing/data-table/create.js.map +0 -1
- package/dist/commands/testing/data-table/delete.d.ts +0 -25
- package/dist/commands/testing/data-table/delete.js.map +0 -1
- package/dist/commands/testing/data-table/export.d.ts +0 -33
- package/dist/commands/testing/data-table/export.js.map +0 -1
- package/dist/commands/testing/data-table/get.d.ts +0 -21
- package/dist/commands/testing/data-table/get.js.map +0 -1
- package/dist/commands/testing/data-table/list.d.ts +0 -16
- package/dist/commands/testing/data-table/list.js.map +0 -1
- package/dist/commands/testing/data-table/update.d.ts +0 -34
- package/dist/commands/testing/data-table/update.js.map +0 -1
- package/dist/commands/testing/job/create.d.ts +0 -40
- package/dist/commands/testing/job/create.js.map +0 -1
- package/dist/commands/testing/job/delete.d.ts +0 -26
- package/dist/commands/testing/job/delete.js.map +0 -1
- package/dist/commands/testing/job/download.d.ts +0 -19
- package/dist/commands/testing/job/download.js.map +0 -1
- package/dist/commands/testing/job/files.d.ts +0 -16
- package/dist/commands/testing/job/files.js.map +0 -1
- package/dist/commands/testing/job/get.d.ts +0 -13
- package/dist/commands/testing/job/get.js.map +0 -1
- package/dist/commands/testing/job/list.d.ts +0 -11
- package/dist/commands/testing/job/list.js.map +0 -1
- package/dist/commands/testing/job/refs.d.ts +0 -17
- package/dist/commands/testing/job/refs.js.map +0 -1
- package/dist/commands/testing/job/run.d.ts +0 -1
- package/dist/commands/testing/job/run.js.map +0 -1
- package/dist/commands/testing/job/schedule/get.d.ts +0 -23
- package/dist/commands/testing/job/schedule/get.js.map +0 -1
- package/dist/commands/testing/job/schedule/remove.d.ts +0 -24
- package/dist/commands/testing/job/schedule/remove.js.map +0 -1
- package/dist/commands/testing/job/schedule/set.d.ts +0 -23
- package/dist/commands/testing/job/schedule/set.js.map +0 -1
- package/dist/commands/testing/job/update.d.ts +0 -41
- package/dist/commands/testing/job/update.js.map +0 -1
- package/dist/commands/testing/job/upload.d.ts +0 -32
- package/dist/commands/testing/job/upload.js.map +0 -1
- package/dist/commands/testing/live/continue.d.ts +0 -20
- package/dist/commands/testing/live/continue.js.map +0 -1
- package/dist/commands/testing/live/execute.d.ts +0 -30
- package/dist/commands/testing/live/execute.js.map +0 -1
- package/dist/commands/testing/live/history.d.ts +0 -23
- package/dist/commands/testing/live/history.js.map +0 -1
- package/dist/commands/testing/live/inspect.d.ts +0 -18
- package/dist/commands/testing/live/inspect.js.map +0 -1
- package/dist/commands/testing/live/interrupt.d.ts +0 -20
- package/dist/commands/testing/live/interrupt.js.map +0 -1
- package/dist/commands/testing/live/recorder.d.ts +0 -23
- package/dist/commands/testing/live/recorder.js.map +0 -1
- package/dist/commands/testing/live/reports.d.ts +0 -20
- package/dist/commands/testing/live/reports.js.map +0 -1
- package/dist/commands/testing/live/screenshot.d.ts +0 -23
- package/dist/commands/testing/live/screenshot.js.map +0 -1
- package/dist/commands/testing/live/set-options.d.ts +0 -27
- package/dist/commands/testing/live/set-options.js.map +0 -1
- package/dist/commands/testing/live/start.d.ts +0 -29
- package/dist/commands/testing/live/start.js.map +0 -1
- package/dist/commands/testing/live/status.d.ts +0 -19
- package/dist/commands/testing/live/status.js.map +0 -1
- package/dist/commands/testing/live/stop.d.ts +0 -24
- package/dist/commands/testing/live/stop.js.map +0 -1
- package/dist/commands/testing/live/view.d.ts +0 -16
- package/dist/commands/testing/live/view.js.map +0 -1
- package/dist/commands/testing/logs.d.ts +0 -24
- package/dist/commands/testing/logs.js.map +0 -1
- package/dist/commands/testing/project/create.d.ts +0 -14
- package/dist/commands/testing/project/create.js.map +0 -1
- package/dist/commands/testing/project/delete.d.ts +0 -23
- package/dist/commands/testing/project/delete.js.map +0 -1
- package/dist/commands/testing/project/get.d.ts +0 -11
- package/dist/commands/testing/project/get.js.map +0 -1
- package/dist/commands/testing/project/list.d.ts +0 -10
- package/dist/commands/testing/project/list.js.map +0 -1
- package/dist/commands/testing/project/permission/get.d.ts +0 -13
- package/dist/commands/testing/project/permission/get.js.map +0 -1
- package/dist/commands/testing/project/permission/list.d.ts +0 -13
- package/dist/commands/testing/project/permission/list.js.map +0 -1
- package/dist/commands/testing/project/permission/set.d.ts +0 -19
- package/dist/commands/testing/project/permission/set.js.map +0 -1
- package/dist/commands/testing/project/permission/update.d.ts +0 -19
- package/dist/commands/testing/project/permission/update.js.map +0 -1
- package/dist/commands/testing/project/update.d.ts +0 -14
- package/dist/commands/testing/project/update.js.map +0 -1
- package/dist/commands/testing/robot/create.d.ts +0 -19
- package/dist/commands/testing/robot/create.js.map +0 -1
- package/dist/commands/testing/robot/delete.d.ts +0 -23
- package/dist/commands/testing/robot/delete.js.map +0 -1
- package/dist/commands/testing/robot/get.d.ts +0 -13
- package/dist/commands/testing/robot/get.js.map +0 -1
- package/dist/commands/testing/robot/list.d.ts +0 -10
- package/dist/commands/testing/robot/list.js.map +0 -1
- package/dist/commands/testing/robot/update.d.ts +0 -19
- package/dist/commands/testing/robot/update.js.map +0 -1
- package/dist/commands/testing/run.d.ts +0 -47
- package/dist/commands/testing/run.js.map +0 -1
- package/dist/commands/testing/status.d.ts +0 -13
- package/dist/commands/testing/status.js.map +0 -1
- package/dist/commands/testing/test/create.d.ts +0 -1
- package/dist/commands/testing/test/create.js.map +0 -1
- package/dist/commands/testing/test/logs.d.ts +0 -1
- package/dist/commands/testing/test/logs.js.map +0 -1
- package/dist/commands/testing/test/run.d.ts +0 -47
- package/dist/commands/testing/test/run.js.map +0 -1
- package/dist/commands/testing/test/status.d.ts +0 -1
- package/dist/commands/testing/test/status.js.map +0 -1
- package/dist/commands/testing/test/update.d.ts +0 -1
- package/dist/commands/testing/test/update.js.map +0 -1
- package/dist/commands/testing/update.d.ts +0 -32
- package/dist/commands/testing/update.js.map +0 -1
- package/dist/commands/testing/user-parameter/create.d.ts +0 -19
- package/dist/commands/testing/user-parameter/create.js.map +0 -1
- package/dist/commands/testing/user-parameter/delete.d.ts +0 -21
- package/dist/commands/testing/user-parameter/delete.js.map +0 -1
- package/dist/commands/testing/user-parameter/get.d.ts +0 -13
- package/dist/commands/testing/user-parameter/get.js.map +0 -1
- package/dist/commands/testing/user-parameter/list.d.ts +0 -12
- package/dist/commands/testing/user-parameter/list.js.map +0 -1
- package/dist/commands/testing/user-parameter/update.d.ts +0 -23
- package/dist/commands/testing/user-parameter/update.js.map +0 -1
- package/dist/commands/testing/variable/create.d.ts +0 -21
- package/dist/commands/testing/variable/create.js.map +0 -1
- package/dist/commands/testing/variable/delete.d.ts +0 -21
- package/dist/commands/testing/variable/delete.js.map +0 -1
- package/dist/commands/testing/variable/get.d.ts +0 -13
- package/dist/commands/testing/variable/get.js.map +0 -1
- package/dist/commands/testing/variable/list.d.ts +0 -16
- package/dist/commands/testing/variable/list.js.map +0 -1
- package/dist/commands/testing/variable/update.d.ts +0 -22
- package/dist/commands/testing/variable/update.js.map +0 -1
- package/dist/commands/update.d.ts +0 -10
- package/dist/commands/update.js.map +0 -1
- package/dist/hooks/finally/ide-command-event.d.ts +0 -3
- package/dist/hooks/finally/ide-command-event.js.map +0 -1
- package/dist/hooks/init/migrate-user-config.d.ts +0 -3
- package/dist/hooks/init/migrate-user-config.js.map +0 -1
- package/dist/hooks/init/version-warning.d.ts +0 -3
- package/dist/hooks/init/version-warning.js.map +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js.map +0 -1
- package/dist/lib/agentia-command.d.ts +0 -15
- package/dist/lib/agentia-command.js.map +0 -1
- package/dist/lib/agentia-oauth-error-codes.d.ts +0 -17
- package/dist/lib/agentia-oauth-error-codes.js.map +0 -1
- package/dist/lib/ai-chat-session.d.ts +0 -18
- package/dist/lib/ai-chat-session.js.map +0 -1
- package/dist/lib/ai-config.d.ts +0 -29
- package/dist/lib/ai-config.js.map +0 -1
- package/dist/lib/ai-flags.d.ts +0 -8
- package/dist/lib/ai-flags.js.map +0 -1
- package/dist/lib/ai-gateway.d.ts +0 -56
- package/dist/lib/ai-gateway.js.map +0 -1
- package/dist/lib/ai-operations.d.ts +0 -28
- package/dist/lib/ai-operations.js.map +0 -1
- package/dist/lib/ai-stream-parser.d.ts +0 -12
- package/dist/lib/ai-stream-parser.js.map +0 -1
- package/dist/lib/ai-terminal-renderer.d.ts +0 -17
- package/dist/lib/ai-terminal-renderer.js.map +0 -1
- package/dist/lib/ai-types.d.ts +0 -157
- package/dist/lib/ai-types.js.map +0 -1
- package/dist/lib/assert.d.ts +0 -1
- package/dist/lib/assert.js.map +0 -1
- package/dist/lib/auth-config.d.ts +0 -94
- package/dist/lib/auth-config.js.map +0 -1
- package/dist/lib/auth-profile.d.ts +0 -25
- package/dist/lib/auth-profile.js.map +0 -1
- package/dist/lib/cicd-gateway.d.ts +0 -166
- package/dist/lib/cicd-gateway.js.map +0 -1
- package/dist/lib/cicd-region.d.ts +0 -4
- package/dist/lib/cicd-region.js.map +0 -1
- package/dist/lib/cli-update.d.ts +0 -29
- package/dist/lib/cli-update.js.map +0 -1
- package/dist/lib/cli-version.d.ts +0 -30
- package/dist/lib/cli-version.js.map +0 -1
- package/dist/lib/command-output-buffer.d.ts +0 -31
- package/dist/lib/command-output-buffer.js.map +0 -1
- package/dist/lib/credential-store.d.ts +0 -47
- package/dist/lib/credential-store.js.map +0 -1
- package/dist/lib/credential-sync.d.ts +0 -41
- package/dist/lib/credential-sync.js.map +0 -1
- package/dist/lib/cursor-mcp-config.d.ts +0 -66
- package/dist/lib/cursor-mcp-config.js.map +0 -1
- package/dist/lib/data-flags.d.ts +0 -14
- package/dist/lib/data-flags.js.map +0 -1
- package/dist/lib/data-types.d.ts +0 -325
- package/dist/lib/data-types.js.map +0 -1
- package/dist/lib/debug.d.ts +0 -3
- package/dist/lib/debug.js.map +0 -1
- package/dist/lib/defaults-store.d.ts +0 -97
- package/dist/lib/defaults-store.js.map +0 -1
- package/dist/lib/dependency-from-changes.d.ts +0 -12
- package/dist/lib/dependency-from-changes.js.map +0 -1
- package/dist/lib/deployment-step-config.d.ts +0 -27
- package/dist/lib/deployment-step-config.js.map +0 -1
- package/dist/lib/deployment-step-types.d.ts +0 -104
- package/dist/lib/deployment-step-types.js.map +0 -1
- package/dist/lib/deployment-step-wizard.d.ts +0 -28
- package/dist/lib/deployment-step-wizard.js.map +0 -1
- package/dist/lib/env-file.d.ts +0 -5
- package/dist/lib/env-file.js.map +0 -1
- package/dist/lib/environment-auth-status.d.ts +0 -18
- package/dist/lib/environment-auth-status.js.map +0 -1
- package/dist/lib/environment-auth.d.ts +0 -26
- package/dist/lib/environment-auth.js.map +0 -1
- package/dist/lib/environment-credential-flags.d.ts +0 -29
- package/dist/lib/environment-credential-flags.js.map +0 -1
- package/dist/lib/environment-credential-operations.d.ts +0 -19
- package/dist/lib/environment-credential-operations.js.map +0 -1
- package/dist/lib/environment-credential-selection.d.ts +0 -15
- package/dist/lib/environment-credential-selection.js.map +0 -1
- package/dist/lib/environment-flags.d.ts +0 -93
- package/dist/lib/environment-flags.js.map +0 -1
- package/dist/lib/environment-types.d.ts +0 -105
- package/dist/lib/environment-types.js.map +0 -1
- package/dist/lib/format.d.ts +0 -10
- package/dist/lib/format.js.map +0 -1
- package/dist/lib/function-flags.d.ts +0 -69
- package/dist/lib/function-flags.js.map +0 -1
- package/dist/lib/function-local-run.d.ts +0 -64
- package/dist/lib/function-local-run.js.map +0 -1
- package/dist/lib/function-types.d.ts +0 -120
- package/dist/lib/function-types.js.map +0 -1
- package/dist/lib/git-worktree.d.ts +0 -83
- package/dist/lib/git-worktree.js.map +0 -1
- package/dist/lib/ide-command-events.d.ts +0 -72
- package/dist/lib/ide-command-events.js.map +0 -1
- package/dist/lib/job-types.d.ts +0 -125
- package/dist/lib/job-types.js.map +0 -1
- package/dist/lib/list-pagination.d.ts +0 -46
- package/dist/lib/list-pagination.js.map +0 -1
- package/dist/lib/local-gateway-config.d.ts +0 -21
- package/dist/lib/local-gateway-config.js.map +0 -1
- package/dist/lib/local-metadata-paths.d.ts +0 -6
- package/dist/lib/local-metadata-paths.js.map +0 -1
- package/dist/lib/local-quality-gates.d.ts +0 -53
- package/dist/lib/local-quality-gates.js.map +0 -1
- package/dist/lib/loopback-callback-server.d.ts +0 -36
- package/dist/lib/loopback-callback-server.js.map +0 -1
- package/dist/lib/mcp/ai-tools.d.ts +0 -21
- package/dist/lib/mcp/ai-tools.js.map +0 -1
- package/dist/lib/mcp/command-id.d.ts +0 -4
- package/dist/lib/mcp/command-id.js.map +0 -1
- package/dist/lib/mcp/data-tools.d.ts +0 -156
- package/dist/lib/mcp/data-tools.js.map +0 -1
- package/dist/lib/mcp/deployment-step-tools.d.ts +0 -82
- package/dist/lib/mcp/deployment-step-tools.js.map +0 -1
- package/dist/lib/mcp/redaction.d.ts +0 -1
- package/dist/lib/mcp/redaction.js.map +0 -1
- package/dist/lib/mcp/request-context.d.ts +0 -2
- package/dist/lib/mcp/request-context.js.map +0 -1
- package/dist/lib/mcp/result.d.ts +0 -44
- package/dist/lib/mcp/result.js.map +0 -1
- package/dist/lib/mcp/server.d.ts +0 -5
- package/dist/lib/mcp/server.js.map +0 -1
- package/dist/lib/mcp/testing-live-tools.d.ts +0 -126
- package/dist/lib/mcp/testing-live-tools.js.map +0 -1
- package/dist/lib/mcp/testing-tools.d.ts +0 -699
- package/dist/lib/mcp/testing-tools.js.map +0 -1
- package/dist/lib/mcp/tools.d.ts +0 -1964
- package/dist/lib/mcp/tools.js.map +0 -1
- package/dist/lib/mcp/work-tools.d.ts +0 -182
- package/dist/lib/mcp/work-tools.js.map +0 -1
- package/dist/lib/metadata-common.d.ts +0 -175
- package/dist/lib/metadata-common.js.map +0 -1
- package/dist/lib/metadata-refresh.d.ts +0 -68
- package/dist/lib/metadata-refresh.js.map +0 -1
- package/dist/lib/navigation-open.d.ts +0 -7
- package/dist/lib/navigation-open.js.map +0 -1
- package/dist/lib/navigation.d.ts +0 -14
- package/dist/lib/navigation.js.map +0 -1
- package/dist/lib/nested-metadata-changes.d.ts +0 -88
- package/dist/lib/nested-metadata-changes.js.map +0 -1
- package/dist/lib/nested-metadata-registry.d.ts +0 -36
- package/dist/lib/nested-metadata-registry.js.map +0 -1
- package/dist/lib/notifications-configure.d.ts +0 -34
- package/dist/lib/notifications-configure.js.map +0 -1
- package/dist/lib/open-browser.d.ts +0 -11
- package/dist/lib/open-browser.js.map +0 -1
- package/dist/lib/pipeline-connection-flags.d.ts +0 -62
- package/dist/lib/pipeline-connection-flags.js.map +0 -1
- package/dist/lib/pipeline-flags.d.ts +0 -74
- package/dist/lib/pipeline-flags.js.map +0 -1
- package/dist/lib/pipeline-stage-connection-flags.d.ts +0 -25
- package/dist/lib/pipeline-stage-connection-flags.js.map +0 -1
- package/dist/lib/pipeline-types.d.ts +0 -178
- package/dist/lib/pipeline-types.js.map +0 -1
- package/dist/lib/project-default-flags.d.ts +0 -43
- package/dist/lib/project-default-flags.js.map +0 -1
- package/dist/lib/project-default-id.d.ts +0 -4
- package/dist/lib/project-default-id.js.map +0 -1
- package/dist/lib/project-defaults.d.ts +0 -24
- package/dist/lib/project-defaults.js.map +0 -1
- package/dist/lib/project-flags.d.ts +0 -11
- package/dist/lib/project-flags.js.map +0 -1
- package/dist/lib/project-root.d.ts +0 -13
- package/dist/lib/project-root.js.map +0 -1
- package/dist/lib/project-setup.d.ts +0 -90
- package/dist/lib/project-setup.js.map +0 -1
- package/dist/lib/project-types.d.ts +0 -39
- package/dist/lib/project-types.js.map +0 -1
- package/dist/lib/promotion-conflicts.d.ts +0 -40
- package/dist/lib/promotion-conflicts.js.map +0 -1
- package/dist/lib/promotion-flags.d.ts +0 -23
- package/dist/lib/promotion-flags.js.map +0 -1
- package/dist/lib/promotion-run.d.ts +0 -105
- package/dist/lib/promotion-run.js.map +0 -1
- package/dist/lib/promotion-types.d.ts +0 -192
- package/dist/lib/promotion-types.js.map +0 -1
- package/dist/lib/repository-flags.d.ts +0 -131
- package/dist/lib/repository-flags.js.map +0 -1
- package/dist/lib/repository-types.d.ts +0 -99
- package/dist/lib/repository-types.js.map +0 -1
- package/dist/lib/salesforce-id.d.ts +0 -11
- package/dist/lib/salesforce-id.js.map +0 -1
- package/dist/lib/sdr-metadata-registry.generated.d.ts +0 -18
- package/dist/lib/sdr-metadata-registry.generated.js.map +0 -1
- package/dist/lib/sdr-path-resolver.d.ts +0 -7
- package/dist/lib/sdr-path-resolver.js.map +0 -1
- package/dist/lib/secret-redaction.d.ts +0 -2
- package/dist/lib/secret-redaction.js.map +0 -1
- package/dist/lib/setup-prompts.d.ts +0 -38
- package/dist/lib/setup-prompts.js.map +0 -1
- package/dist/lib/setup-skills.d.ts +0 -83
- package/dist/lib/setup-skills.js.map +0 -1
- package/dist/lib/setup-templates.d.ts +0 -12
- package/dist/lib/setup-templates.js.map +0 -1
- package/dist/lib/setup-wizard.d.ts +0 -46
- package/dist/lib/setup-wizard.js.map +0 -1
- package/dist/lib/sf-org-context.d.ts +0 -13
- package/dist/lib/sf-org-context.js.map +0 -1
- package/dist/lib/stage-flags.d.ts +0 -19
- package/dist/lib/stage-flags.js.map +0 -1
- package/dist/lib/stage-types.d.ts +0 -67
- package/dist/lib/stage-types.js.map +0 -1
- package/dist/lib/stock-quality-gates.d.ts +0 -12
- package/dist/lib/stock-quality-gates.js.map +0 -1
- package/dist/lib/testing-config.d.ts +0 -44
- package/dist/lib/testing-config.js.map +0 -1
- package/dist/lib/testing-confirmation.d.ts +0 -14
- package/dist/lib/testing-confirmation.js.map +0 -1
- package/dist/lib/testing-data-command.d.ts +0 -21
- package/dist/lib/testing-data-command.js.map +0 -1
- package/dist/lib/testing-data-core.d.ts +0 -22
- package/dist/lib/testing-data-core.js.map +0 -1
- package/dist/lib/testing-data-export.d.ts +0 -1
- package/dist/lib/testing-data-export.js.map +0 -1
- package/dist/lib/testing-data-import.d.ts +0 -1
- package/dist/lib/testing-data-import.js.map +0 -1
- package/dist/lib/testing-data-io.d.ts +0 -21
- package/dist/lib/testing-data-io.js.map +0 -1
- package/dist/lib/testing-data-operations.d.ts +0 -36
- package/dist/lib/testing-data-operations.js.map +0 -1
- package/dist/lib/testing-data-types.d.ts +0 -41
- package/dist/lib/testing-data-types.js.map +0 -1
- package/dist/lib/testing-flags.d.ts +0 -117
- package/dist/lib/testing-flags.js.map +0 -1
- package/dist/lib/testing-gateway.d.ts +0 -60
- package/dist/lib/testing-gateway.js.map +0 -1
- package/dist/lib/testing-live-command.d.ts +0 -24
- package/dist/lib/testing-live-command.js.map +0 -1
- package/dist/lib/testing-live-endpoints.d.ts +0 -14
- package/dist/lib/testing-live-endpoints.js.map +0 -1
- package/dist/lib/testing-live-history.d.ts +0 -11
- package/dist/lib/testing-live-history.js.map +0 -1
- package/dist/lib/testing-live-operations.d.ts +0 -118
- package/dist/lib/testing-live-operations.js.map +0 -1
- package/dist/lib/testing-live-recorder.d.ts +0 -14
- package/dist/lib/testing-live-recorder.js.map +0 -1
- package/dist/lib/testing-live-robot.d.ts +0 -16
- package/dist/lib/testing-live-robot.js.map +0 -1
- package/dist/lib/testing-live-state.d.ts +0 -4
- package/dist/lib/testing-live-state.js.map +0 -1
- package/dist/lib/testing-live-types.d.ts +0 -92
- package/dist/lib/testing-live-types.js.map +0 -1
- package/dist/lib/testing-operations.d.ts +0 -354
- package/dist/lib/testing-operations.js.map +0 -1
- package/dist/lib/testing-run-command.d.ts +0 -25
- package/dist/lib/testing-run-command.js.map +0 -1
- package/dist/lib/testing-sanitization.d.ts +0 -11
- package/dist/lib/testing-sanitization.js.map +0 -1
- package/dist/lib/testing-schedule.d.ts +0 -23
- package/dist/lib/testing-schedule.js.map +0 -1
- package/dist/lib/testing-secret-input.d.ts +0 -12
- package/dist/lib/testing-secret-input.js.map +0 -1
- package/dist/lib/testing-session.d.ts +0 -8
- package/dist/lib/testing-session.js.map +0 -1
- package/dist/lib/testing-types.d.ts +0 -340
- package/dist/lib/testing-types.js.map +0 -1
- package/dist/lib/testing-watch.d.ts +0 -4
- package/dist/lib/testing-watch.js.map +0 -1
- package/dist/lib/user-context-types.d.ts +0 -12
- package/dist/lib/user-context-types.js.map +0 -1
- package/dist/lib/user-context.d.ts +0 -7
- package/dist/lib/user-context.js.map +0 -1
- package/dist/lib/user-types.d.ts +0 -9
- package/dist/lib/user-types.js.map +0 -1
- package/dist/lib/var-replacement.d.ts +0 -47
- package/dist/lib/var-replacement.js.map +0 -1
- package/dist/lib/version-refresh.d.ts +0 -1
- package/dist/lib/version-refresh.js.map +0 -1
- package/dist/lib/version-warning.d.ts +0 -29
- package/dist/lib/version-warning.js.map +0 -1
- package/dist/lib/work-active.d.ts +0 -4
- package/dist/lib/work-active.js.map +0 -1
- package/dist/lib/work-apex-test.d.ts +0 -56
- package/dist/lib/work-apex-test.js.map +0 -1
- package/dist/lib/work-branch-metadata.d.ts +0 -13
- package/dist/lib/work-branch-metadata.js.map +0 -1
- package/dist/lib/work-commit.d.ts +0 -123
- package/dist/lib/work-commit.js.map +0 -1
- package/dist/lib/work-defaults.d.ts +0 -10
- package/dist/lib/work-defaults.js.map +0 -1
- package/dist/lib/work-done.d.ts +0 -22
- package/dist/lib/work-done.js.map +0 -1
- package/dist/lib/work-flags.d.ts +0 -128
- package/dist/lib/work-flags.js.map +0 -1
- package/dist/lib/work-local-commit.d.ts +0 -42
- package/dist/lib/work-local-commit.js.map +0 -1
- package/dist/lib/work-local-run-tests.d.ts +0 -25
- package/dist/lib/work-local-run-tests.js.map +0 -1
- package/dist/lib/work-publish-command.d.ts +0 -26
- package/dist/lib/work-publish-command.js.map +0 -1
- package/dist/lib/work-push.d.ts +0 -112
- package/dist/lib/work-push.js.map +0 -1
- package/dist/lib/work-set-none.d.ts +0 -14
- package/dist/lib/work-set-none.js.map +0 -1
- package/dist/lib/work-set-selection.d.ts +0 -15
- package/dist/lib/work-set-selection.js.map +0 -1
- package/dist/lib/work-types.d.ts +0 -344
- package/dist/lib/work-types.js.map +0 -1
- package/dist/lib/yaml-replacement.d.ts +0 -42
- package/dist/lib/yaml-replacement.js.map +0 -1
|
@@ -1,1309 +1,60 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
]
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
req.on('error', (error) => reject(error));
|
|
62
|
-
req.on('timeout', () => {
|
|
63
|
-
req.destroy(new Error(`CRT snapshot request timed out after ${Math.ceil(timeoutMs / 1000)} seconds.`));
|
|
64
|
-
});
|
|
65
|
-
req.end();
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
let testingSnapshotFetchFn = defaultTestingSnapshotFetch;
|
|
69
|
-
export async function listTestingProjects(options = {}) {
|
|
70
|
-
const credentials = resolveOptions(options);
|
|
71
|
-
const response = await TestingGateway.call({ endpoint: testingProjectsEndpoint(credentials.orgId), method: 'GET', service: 'platform' }, options);
|
|
72
|
-
const projects = normalizeTestingArray(response);
|
|
73
|
-
return sanitizeTestingOutput(filterByName(projects, options.name, false));
|
|
74
|
-
}
|
|
75
|
-
export async function createTestingProject(options) {
|
|
76
|
-
requireNonBlank(options.name, 'CRT project name');
|
|
77
|
-
const credentials = resolveOptions(options);
|
|
78
|
-
const body = omitUndefined({
|
|
79
|
-
dashboardId: options.dashboardId,
|
|
80
|
-
description: options.description,
|
|
81
|
-
name: options.name,
|
|
82
|
-
projectExecutor: options.projectExecutor,
|
|
83
|
-
projectType: options.projectType ?? 'ta',
|
|
84
|
-
});
|
|
85
|
-
const response = await TestingGateway.call({ body, endpoint: testingProjectsEndpoint(credentials.orgId), method: 'POST', service: 'platform' }, options);
|
|
86
|
-
return sanitizeTestingOutput(normalizeTestingRecord(response));
|
|
87
|
-
}
|
|
88
|
-
export async function getTestingProject(options) {
|
|
89
|
-
const response = await TestingGateway.call({ endpoint: testingProjectEndpoint(options.projectId), method: 'GET', service: 'platform' }, options);
|
|
90
|
-
return sanitizeTestingOutput(normalizeTestingRecord(response));
|
|
91
|
-
}
|
|
92
|
-
export async function updateTestingProject(options) {
|
|
93
|
-
const body = omitUndefined({ description: options.description, name: options.name });
|
|
94
|
-
requireBodyFields(body, 'Provide at least one project field to update.');
|
|
95
|
-
if (options.name !== undefined)
|
|
96
|
-
requireNonBlank(options.name, 'CRT project name');
|
|
97
|
-
const response = await TestingGateway.call({ body, endpoint: testingProjectEndpoint(options.projectId), method: 'PATCH', service: 'platform' }, options);
|
|
98
|
-
return sanitizeTestingOutput(normalizeTestingRecord(response));
|
|
99
|
-
}
|
|
100
|
-
export async function listTestingProjectPermissions(options) {
|
|
101
|
-
const response = await TestingGateway.call({ endpoint: testingProjectPermissionsEndpoint(options.projectId), method: 'GET', service: 'platform' }, options);
|
|
102
|
-
return sanitizeTestingOutput(normalizeTestingArray(response));
|
|
103
|
-
}
|
|
104
|
-
export async function getTestingProjectPermission(options) {
|
|
105
|
-
const response = await TestingGateway.call({ endpoint: testingPermissionsEndpoint(options.projectId), method: 'GET', service: 'platform' }, options);
|
|
106
|
-
return sanitizeTestingOutput(normalizeTestingRecord(response));
|
|
107
|
-
}
|
|
108
|
-
export async function setTestingProjectPermission(options) {
|
|
109
|
-
validateTestingPermissionRequest(options);
|
|
110
|
-
const body = [omitUndefined({
|
|
111
|
-
edit: options.edit,
|
|
112
|
-
groupId: options.groupId,
|
|
113
|
-
userId: options.userId,
|
|
114
|
-
view: options.view,
|
|
115
|
-
})];
|
|
116
|
-
const response = await TestingGateway.call({ body, endpoint: testingPermissionsEndpoint(options.projectId), method: 'POST', service: 'platform' }, options);
|
|
117
|
-
return sanitizeTestingOutput(normalizeTestingArray(response));
|
|
118
|
-
}
|
|
119
|
-
export async function deleteTestingProjectPermission(options) {
|
|
120
|
-
await TestingGateway.call({ endpoint: testingPermissionEndpoint(options.permissionId), method: 'DELETE', service: 'platform' }, options);
|
|
121
|
-
return { deleted: true, permissionId: options.permissionId };
|
|
122
|
-
}
|
|
123
|
-
export async function deleteTestingProject(options) {
|
|
124
|
-
await TestingGateway.call({ endpoint: testingProjectDeleteEndpoint(options.projectId), method: 'DELETE', service: 'platform' }, options);
|
|
125
|
-
return { deleted: true, projectId: options.projectId };
|
|
126
|
-
}
|
|
127
|
-
export async function listTestingRobots(options) {
|
|
128
|
-
const response = await TestingGateway.call({ endpoint: testingRobotsEndpoint(options.projectId), method: 'GET', service: 'pace' }, options);
|
|
129
|
-
return normalizeTestingArray(response);
|
|
130
|
-
}
|
|
131
|
-
export async function createTestingRobot(options) {
|
|
132
|
-
requireNonBlank(options.name, 'CRT robot name');
|
|
133
|
-
const body = omitUndefined({
|
|
134
|
-
description: options.description ?? '',
|
|
135
|
-
fwVersion: options.fwVersion,
|
|
136
|
-
label: options.label,
|
|
137
|
-
name: options.name,
|
|
138
|
-
os: options.os,
|
|
139
|
-
reporting: options.reporting,
|
|
140
|
-
robotType: options.robotType,
|
|
141
|
-
runEnvironment: options.kind === 'QConnect' ? 'paceconnect' : (options.kind ?? 'cloud'),
|
|
142
|
-
});
|
|
143
|
-
const response = await TestingGateway.call({ body, endpoint: testingRobotsEndpoint(options.projectId), method: 'POST', service: 'pace' }, options);
|
|
144
|
-
return sanitizeTestingOutput(normalizeTestingRecord(response));
|
|
145
|
-
}
|
|
146
|
-
export async function getTestingRobot(options) {
|
|
147
|
-
const response = await TestingGateway.call({ endpoint: testingRobotEndpoint(options.projectId, options.robotId), method: 'GET', service: 'pace' }, options);
|
|
148
|
-
return sanitizeTestingOutput(normalizeTestingRecord(response));
|
|
149
|
-
}
|
|
150
|
-
export async function updateTestingRobot(options) {
|
|
151
|
-
const updates = omitUndefined({
|
|
152
|
-
description: options.description,
|
|
153
|
-
fwVersion: options.fwVersion,
|
|
154
|
-
label: options.label,
|
|
155
|
-
name: options.name,
|
|
156
|
-
reporting: options.reporting,
|
|
157
|
-
robotType: options.robotType,
|
|
158
|
-
});
|
|
159
|
-
requireBodyFields(updates, 'Provide at least one robot field to update.');
|
|
160
|
-
if (options.name !== undefined)
|
|
161
|
-
requireNonBlank(options.name, 'CRT robot name');
|
|
162
|
-
const current = await getTestingRobot(options);
|
|
163
|
-
const body = omitUndefined({
|
|
164
|
-
description: options.description ?? stringField(current.description),
|
|
165
|
-
fwVersion: options.fwVersion ?? stringField(current.fwVersion),
|
|
166
|
-
label: options.label ?? stringField(current.label),
|
|
167
|
-
name: options.name ?? stringField(current.name),
|
|
168
|
-
reporting: options.reporting ?? stringField(current.reporting),
|
|
169
|
-
robotType: options.robotType ?? stringField(current.robotType),
|
|
170
|
-
});
|
|
171
|
-
const response = await TestingGateway.call({ body, endpoint: testingRobotEndpoint(options.projectId, options.robotId), method: 'PUT', service: 'pace' }, options);
|
|
172
|
-
return sanitizeTestingOutput(normalizeTestingRecord(response));
|
|
173
|
-
}
|
|
174
|
-
export async function deleteTestingRobot(options) {
|
|
175
|
-
await TestingGateway.call({ endpoint: testingRobotEndpoint(options.projectId, options.robotId), method: 'DELETE', service: 'pace' }, options);
|
|
176
|
-
return { deleted: true, projectId: options.projectId, robotId: options.robotId };
|
|
177
|
-
}
|
|
178
|
-
export async function listTestingJobs(options) {
|
|
179
|
-
const response = await TestingGateway.call({ endpoint: testingJobsEndpoint(options.projectId), method: 'GET', service: 'pace' }, options);
|
|
180
|
-
const jobs = normalizeTestingArray(response);
|
|
181
|
-
return filterByName(jobs, options.name, true);
|
|
182
|
-
}
|
|
183
|
-
export async function getTestingJob(options) {
|
|
184
|
-
return findTestingRecord(await listTestingJobs(options), options.jobId, 'job');
|
|
185
|
-
}
|
|
186
|
-
export async function updateTestingJob(options) {
|
|
187
|
-
const body = omitUndefined({
|
|
188
|
-
analytics: options.analytics,
|
|
189
|
-
description: options.description,
|
|
190
|
-
domainCredentialId: options.domainCredentialId,
|
|
191
|
-
name: options.name,
|
|
192
|
-
parallelExecution: options.parallelExecution,
|
|
193
|
-
robotId: options.robotId,
|
|
194
|
-
screen: options.screen,
|
|
195
|
-
showVideoParams: options.showVideoParams,
|
|
196
|
-
storage: options.storage,
|
|
197
|
-
suiteType: options.suiteType,
|
|
198
|
-
timeout: options.timeout,
|
|
199
|
-
});
|
|
200
|
-
requireBodyFields(body, 'Provide at least one job field to update.');
|
|
201
|
-
const response = await TestingGateway.call({ body, endpoint: testingJobEndpoint(options.projectId, options.jobId), method: 'PUT', service: 'pace' }, options);
|
|
202
|
-
return normalizeTestingRecord(response);
|
|
203
|
-
}
|
|
204
|
-
export async function deleteTestingJob(options) {
|
|
205
|
-
await TestingGateway.call({ endpoint: testingJobEndpoint(options.projectId, options.jobId), method: 'DELETE', service: 'pace' }, options);
|
|
206
|
-
return { deleted: true, jobId: options.jobId, projectId: options.projectId };
|
|
207
|
-
}
|
|
208
|
-
export function buildTestingGitStorageUpdate(options) {
|
|
209
|
-
if (!hasGitStorageOptions(options))
|
|
210
|
-
return undefined;
|
|
211
|
-
validateTestingGitStorageOptions(options, { requireRef: false, requireUrl: false });
|
|
212
|
-
return omitUndefined({
|
|
213
|
-
branchOrTag: branchOrTagFromOptions(options),
|
|
214
|
-
gitPassword: options.gitPassword,
|
|
215
|
-
gitUrl: options.gitUrl,
|
|
216
|
-
gitUsername: options.gitUsername,
|
|
217
|
-
kind: 'git',
|
|
218
|
-
useCallerCredentials: options.gitUseCallerCredentials === true ? true : undefined,
|
|
219
|
-
});
|
|
220
|
-
}
|
|
221
|
-
export async function createTestingJob(options) {
|
|
222
|
-
const storage = buildTestingCreateJobStorage(options);
|
|
223
|
-
const operations = storage.kind === 'git' || options.fileInput === undefined ? [] : buildFileAddOperations(options.fileInput);
|
|
224
|
-
const body = omitUndefined({
|
|
225
|
-
analytics: options.analytics,
|
|
226
|
-
description: options.description ?? '',
|
|
227
|
-
domainCredentialId: storage.kind === 'git' ? options.gitDomainCredentialId : undefined,
|
|
228
|
-
name: options.name,
|
|
229
|
-
parallelExecution: options.parallelExecution,
|
|
230
|
-
screen: options.screen,
|
|
231
|
-
showVideoParams: options.showVideoParams,
|
|
232
|
-
storage,
|
|
233
|
-
suiteType: options.suiteType,
|
|
234
|
-
timeout: options.timeout,
|
|
235
|
-
validation: options.validation,
|
|
236
|
-
});
|
|
237
|
-
if (options.dryRun === true) {
|
|
238
|
-
return {
|
|
239
|
-
dryRun: true,
|
|
240
|
-
filesUploaded: operations.length,
|
|
241
|
-
job: sanitizeTestingOutput({
|
|
242
|
-
...body,
|
|
243
|
-
storage: storage.kind === 'git'
|
|
244
|
-
? omitUndefined({
|
|
245
|
-
branchOrTag: storage.branchOrTag,
|
|
246
|
-
gitUrl: storage.gitUrl,
|
|
247
|
-
gitUsername: storage.gitUsername,
|
|
248
|
-
kind: storage.kind,
|
|
249
|
-
useCallerCredentials: storage.useCallerCredentials,
|
|
250
|
-
})
|
|
251
|
-
: { kind: storage.kind },
|
|
252
|
-
upload: {
|
|
253
|
-
author: options.uploadAuthor ?? DEFAULT_TESTING_AUTHOR,
|
|
254
|
-
commitMessage: options.uploadCommitMessage,
|
|
255
|
-
operations: sanitizeTestingFilePlan(operations),
|
|
256
|
-
parentCommitHash: options.uploadParentCommitHash,
|
|
257
|
-
},
|
|
258
|
-
}),
|
|
259
|
-
projectId: options.projectId,
|
|
260
|
-
};
|
|
261
|
-
}
|
|
262
|
-
const response = await TestingGateway.call({ body, endpoint: testingRobotJobsEndpoint(options.projectId, options.robotId), method: 'POST', service: 'pace' }, options);
|
|
263
|
-
const job = normalizeTestingRecord(response);
|
|
264
|
-
const jobId = normalizeTestingId(response);
|
|
265
|
-
const result = {
|
|
266
|
-
filesUploaded: 0,
|
|
267
|
-
job,
|
|
268
|
-
jobId,
|
|
269
|
-
projectId: options.projectId,
|
|
270
|
-
};
|
|
271
|
-
if (jobId !== undefined && operations.length > 0) {
|
|
272
|
-
const upload = await uploadTestingJobFiles({
|
|
273
|
-
...options,
|
|
274
|
-
author: options.uploadAuthor,
|
|
275
|
-
commitMessage: options.uploadCommitMessage,
|
|
276
|
-
jobId: numericId(jobId, 'job'),
|
|
277
|
-
operations: [{ op: 'remove', path: 'tests.robot' }, ...operations],
|
|
278
|
-
parentCommitHash: options.uploadParentCommitHash,
|
|
279
|
-
projectId: options.projectId,
|
|
280
|
-
});
|
|
281
|
-
result.filesUploaded = upload.operations.length - 1;
|
|
282
|
-
}
|
|
283
|
-
return result;
|
|
284
|
-
}
|
|
285
|
-
function buildTestingCreateJobStorage(options) {
|
|
286
|
-
if (!hasGitStorageOptions(options) && options.gitDomainCredentialId === undefined) {
|
|
287
|
-
return {
|
|
288
|
-
contentsBase64: createDefaultRobotSnapshotBase64(),
|
|
289
|
-
kind: 'snapshot',
|
|
290
|
-
};
|
|
291
|
-
}
|
|
292
|
-
if (hasTestingFileInput(options.fileInput)) {
|
|
293
|
-
throw new Error('Use either Git storage flags or local --file/--dir uploads, not both.');
|
|
294
|
-
}
|
|
295
|
-
validateTestingGitStorageOptions(options, { requireRef: true, requireUrl: true });
|
|
296
|
-
return omitUndefined({
|
|
297
|
-
branchOrTag: branchOrTagFromOptions(options),
|
|
298
|
-
gitPassword: options.gitPassword,
|
|
299
|
-
gitUrl: options.gitUrl,
|
|
300
|
-
gitUsername: options.gitUsername,
|
|
301
|
-
kind: 'git',
|
|
302
|
-
useCallerCredentials: options.gitUseCallerCredentials === true ? true : undefined,
|
|
303
|
-
});
|
|
304
|
-
}
|
|
305
|
-
export async function listTestingJobFiles(options) {
|
|
306
|
-
const response = await TestingGateway.call({ endpoint: testingJobFilesEndpoint(options.projectId, options.jobId), method: 'GET', service: 'pace' }, options);
|
|
307
|
-
const files = normalizeDownloadedFiles(response);
|
|
308
|
-
if (files.length > 0)
|
|
309
|
-
return files;
|
|
310
|
-
const snapshotUrl = snapshotUrlForJob(await getTestingJob(options));
|
|
311
|
-
if (snapshotUrl === undefined)
|
|
312
|
-
return files;
|
|
313
|
-
return listTestingSnapshotFiles(snapshotUrl, options);
|
|
314
|
-
}
|
|
315
|
-
export async function uploadTestingJobFiles(options) {
|
|
316
|
-
if (options.branch !== undefined)
|
|
317
|
-
validateTestingGitRef(options.branch, 'branch');
|
|
318
|
-
const operations = options.operations.map((operation) => ({
|
|
319
|
-
...operation,
|
|
320
|
-
path: normalizeRemotePath(operation.path),
|
|
321
|
-
}));
|
|
322
|
-
for (const operation of operations) {
|
|
323
|
-
if (operation.op === 'remove' && operation.value !== undefined) {
|
|
324
|
-
throw new Error('CRT remove file operations must not include content.');
|
|
325
|
-
}
|
|
326
|
-
if (operation.op !== 'remove' && operation.value === undefined) {
|
|
327
|
-
throw new Error(`CRT ${operation.op} file operations require content.`);
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
const uploadBytes = operations.reduce((total, operation) => total + Buffer.byteLength(operation.value ?? ''), 0);
|
|
331
|
-
if (uploadBytes > TESTING_UPLOAD_VALUE_MAX_BYTES) {
|
|
332
|
-
throw new Error(`CRT file upload exceeds the ${TESTING_UPLOAD_VALUE_MAX_BYTES} byte safety limit.`);
|
|
333
|
-
}
|
|
334
|
-
const body = omitUndefined({
|
|
335
|
-
author: options.author ?? DEFAULT_TESTING_AUTHOR,
|
|
336
|
-
commitMessage: options.commitMessage,
|
|
337
|
-
operations,
|
|
338
|
-
parentCommitHash: options.parentCommitHash,
|
|
339
|
-
});
|
|
340
|
-
if (options.dryRun === true) {
|
|
341
|
-
return {
|
|
342
|
-
dryRun: true,
|
|
343
|
-
operations: sanitizeTestingFilePlan(operations),
|
|
344
|
-
response: sanitizeTestingOutput({
|
|
345
|
-
author: body.author,
|
|
346
|
-
commitMessage: body.commitMessage,
|
|
347
|
-
parentCommitHash: body.parentCommitHash,
|
|
348
|
-
}),
|
|
349
|
-
};
|
|
350
|
-
}
|
|
351
|
-
const response = await TestingGateway.call({
|
|
352
|
-
body,
|
|
353
|
-
endpoint: testingJobFilesUploadEndpoint(options.projectId, options.jobId, options.branch),
|
|
354
|
-
method: 'POST',
|
|
355
|
-
service: 'pace',
|
|
356
|
-
}, options);
|
|
357
|
-
return { operations: sanitizeTestingFilePlan(operations), response: sanitizeTestingOutput(normalizeTestingRecord(response)) };
|
|
358
|
-
}
|
|
359
|
-
export async function getTestingJobRefs(options) {
|
|
360
|
-
const response = await TestingGateway.call({
|
|
361
|
-
endpoint: testingJobRefsEndpoint(options.projectId, options.jobId, options.sharedCredentials),
|
|
362
|
-
method: 'GET',
|
|
363
|
-
service: 'pace',
|
|
364
|
-
}, options);
|
|
365
|
-
return sanitizeTestingOutput(normalizeTestingRecord(response));
|
|
366
|
-
}
|
|
367
|
-
export async function downloadTestingJobFiles(options) {
|
|
368
|
-
const response = await TestingGateway.call({
|
|
369
|
-
body: { files: options.files },
|
|
370
|
-
endpoint: testingJobFilesDownloadEndpoint(options.projectId, options.jobId, options.branch),
|
|
371
|
-
method: 'POST',
|
|
372
|
-
service: 'pace',
|
|
373
|
-
}, options);
|
|
374
|
-
const files = normalizeDownloadedFiles(response);
|
|
375
|
-
if (options.outputDir !== undefined) {
|
|
376
|
-
writeDownloadedFiles(options.outputDir, files);
|
|
377
|
-
}
|
|
378
|
-
return {
|
|
379
|
-
files,
|
|
380
|
-
jobId: options.jobId,
|
|
381
|
-
outputDir: options.outputDir,
|
|
382
|
-
projectId: options.projectId,
|
|
383
|
-
response,
|
|
384
|
-
};
|
|
385
|
-
}
|
|
386
|
-
export async function runTestingBuild(options) {
|
|
387
|
-
const body = buildTestingRunRequest(options);
|
|
388
|
-
const dataTableSelections = parseTestingDataTableRunSpecs(options.dataTables);
|
|
389
|
-
if (dataTableSelections.length > 0) {
|
|
390
|
-
const session = await createTestingDataSession(options);
|
|
391
|
-
const tables = await Promise.all(dataTableSelections.map((selection) => getTestingDataTable({
|
|
392
|
-
...options,
|
|
393
|
-
jobId: undefined,
|
|
394
|
-
projectId: options.projectId,
|
|
395
|
-
session,
|
|
396
|
-
tableId: selection.tableId,
|
|
397
|
-
})));
|
|
398
|
-
const payloads = dataTableSelections[0]?.datasets.map((_, runIndex) => {
|
|
399
|
-
const inputParameters = [...(body.inputParameters ?? [])];
|
|
400
|
-
for (const [selectionIndex, selection] of dataTableSelections.entries()) {
|
|
401
|
-
const table = tables[selectionIndex];
|
|
402
|
-
const datasetIndex = selection.datasets[runIndex];
|
|
403
|
-
const headers = table?.data?.[0];
|
|
404
|
-
const dataset = datasetIndex === undefined ? undefined : table?.data?.[datasetIndex];
|
|
405
|
-
if (table === undefined || headers === undefined || dataset === undefined) {
|
|
406
|
-
throw new Error(`Data table ${selection.tableId} does not contain selected dataset ${datasetIndex ?? '(unknown)'}.`);
|
|
407
|
-
}
|
|
408
|
-
for (const [column, header] of headers.entries()) {
|
|
409
|
-
inputParameters.push({
|
|
410
|
-
key: formatTestingDatasetKey(header, table.name ?? ''),
|
|
411
|
-
type: 'dataset',
|
|
412
|
-
value: dataset[column] ?? '',
|
|
413
|
-
});
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
return {
|
|
417
|
-
...body,
|
|
418
|
-
inputParameters: inputParameters.length > 0 ? inputParameters : undefined,
|
|
419
|
-
jobId: options.jobId,
|
|
420
|
-
};
|
|
421
|
-
}) ?? [];
|
|
422
|
-
const build = await TestingGateway.call({ body: payloads, endpoint: testingProjectBuildsEndpoint(options.projectId), method: 'POST', service: 'pace' }, options);
|
|
423
|
-
return {
|
|
424
|
-
body: sanitizeTestingOutput(payloads),
|
|
425
|
-
build: sanitizeTestingOutput(build),
|
|
426
|
-
dataDriven: true,
|
|
427
|
-
jobId: options.jobId,
|
|
428
|
-
projectId: options.projectId,
|
|
429
|
-
};
|
|
430
|
-
}
|
|
431
|
-
const build = await TestingGateway.call({ body, endpoint: testingJobBuildsEndpoint(options.projectId, options.jobId), method: 'POST', service: 'pace' }, options);
|
|
432
|
-
return {
|
|
433
|
-
body: sanitizeTestingOutput(body),
|
|
434
|
-
build: sanitizeTestingOutput(build),
|
|
435
|
-
jobId: options.jobId,
|
|
436
|
-
projectId: options.projectId,
|
|
437
|
-
};
|
|
438
|
-
}
|
|
439
|
-
export async function listTestingBuilds(options) {
|
|
440
|
-
const endpoint = options.jobId === undefined
|
|
441
|
-
? testingProjectBuildsEndpoint(options.projectId, {
|
|
442
|
-
page: options.page,
|
|
443
|
-
pageSize: options.pageSize,
|
|
444
|
-
resultSize: options.resultSize,
|
|
445
|
-
status: options.status,
|
|
446
|
-
})
|
|
447
|
-
: testingJobBuildsEndpoint(options.projectId, options.jobId, {
|
|
448
|
-
page: options.page,
|
|
449
|
-
pageSize: options.pageSize,
|
|
450
|
-
resultSize: options.resultSize,
|
|
451
|
-
status: options.status,
|
|
452
|
-
});
|
|
453
|
-
const response = await TestingGateway.call({ endpoint, method: 'GET', service: 'pace' }, options);
|
|
454
|
-
return normalizeTestingArray(response);
|
|
455
|
-
}
|
|
456
|
-
export async function countTestingBuilds(options) {
|
|
457
|
-
const result = await searchTestingBuilds({ ...options, count: true });
|
|
458
|
-
return result.count;
|
|
459
|
-
}
|
|
460
|
-
export async function getTestingBuild(options) {
|
|
461
|
-
return sanitizeTestingOutput(await getTestingBuildForArtifacts(options));
|
|
462
|
-
}
|
|
463
|
-
export async function getTestingBuildForArtifacts(options) {
|
|
464
|
-
const response = await TestingGateway.call({
|
|
465
|
-
endpoint: testingBuildEndpoint(options.projectId, options.jobId, options.buildId, { full: options.full }),
|
|
466
|
-
method: 'GET',
|
|
467
|
-
service: 'pace',
|
|
468
|
-
}, options);
|
|
469
|
-
return normalizeTestingEnvelopeRecord(response);
|
|
470
|
-
}
|
|
471
|
-
export async function latestTestingBuilds(options) {
|
|
472
|
-
const response = await TestingGateway.call({
|
|
473
|
-
endpoint: testingProjectBuildsEndpoint(options.projectId, {
|
|
474
|
-
resultSize: options.resultSize,
|
|
475
|
-
status: options.status,
|
|
476
|
-
}),
|
|
477
|
-
method: 'GET',
|
|
478
|
-
service: 'pace',
|
|
479
|
-
}, options);
|
|
480
|
-
return normalizeTestingArray(response);
|
|
481
|
-
}
|
|
482
|
-
export async function searchTestingBuilds(options) {
|
|
483
|
-
const credentials = resolveTestingCredentials(options);
|
|
484
|
-
const body = buildTestingMsearchBody(credentials.orgId, options);
|
|
485
|
-
const response = await TestingGateway.call({
|
|
486
|
-
body,
|
|
487
|
-
endpoint: testingMetricsSearchEndpoint(credentials.orgId),
|
|
488
|
-
headers: { 'Content-Type': 'application/x-ndjson' },
|
|
489
|
-
method: 'POST',
|
|
490
|
-
service: 'metrics',
|
|
491
|
-
}, options);
|
|
492
|
-
return normalizeTestingSearchResponse(response);
|
|
493
|
-
}
|
|
494
|
-
export async function waitForTestingBuildResult(options) {
|
|
495
|
-
const timeoutMs = options.timeoutMs ?? TESTING_WAIT_TIMEOUT_MS;
|
|
496
|
-
const deadline = Date.now() + timeoutMs;
|
|
497
|
-
let attempts = 0;
|
|
498
|
-
let intervalMs = options.intervalMs ?? TESTING_WAIT_INITIAL_INTERVAL_MS;
|
|
499
|
-
let log = '';
|
|
500
|
-
while (Date.now() <= deadline) {
|
|
501
|
-
attempts++;
|
|
502
|
-
let build = options.streamLogs === true && options.buildId !== undefined
|
|
503
|
-
? await getTestingBuild({
|
|
504
|
-
...options,
|
|
505
|
-
buildId: options.buildId,
|
|
506
|
-
jobId: options.jobId,
|
|
507
|
-
projectId: options.projectId,
|
|
508
|
-
})
|
|
509
|
-
: findMatchingBuild(await listTestingBuilds({
|
|
510
|
-
...options,
|
|
511
|
-
jobId: options.jobId,
|
|
512
|
-
projectId: options.projectId,
|
|
513
|
-
resultSize: 'compact',
|
|
514
|
-
}), options.buildId);
|
|
515
|
-
if (build !== undefined) {
|
|
516
|
-
options.onPoll?.(build);
|
|
517
|
-
if (options.streamLogs === true && options.buildId !== undefined && isTestingLogPollable(build)) {
|
|
518
|
-
const logResult = await getTestingBuildLogs({
|
|
519
|
-
...options,
|
|
520
|
-
buildId: numericId(options.buildId, 'build'),
|
|
521
|
-
jobId: options.jobId,
|
|
522
|
-
knownSecrets: options.sensitiveValues,
|
|
523
|
-
projectId: options.projectId,
|
|
524
|
-
});
|
|
525
|
-
if (logResult.log.length > log.length) {
|
|
526
|
-
const chunk = logResult.log.slice(log.length);
|
|
527
|
-
options.onLog?.(chunk);
|
|
528
|
-
log = logResult.log;
|
|
529
|
-
}
|
|
530
|
-
if (logResult.status !== undefined && logResult.status.toLowerCase() !== 'executing') {
|
|
531
|
-
build = { ...build, status: logResult.status };
|
|
532
|
-
}
|
|
533
|
-
}
|
|
534
|
-
if (isTerminalBuild(build)) {
|
|
535
|
-
return { attempts, build, buildId: options.buildId, jobId: options.jobId, log, projectId: options.projectId };
|
|
536
|
-
}
|
|
537
|
-
}
|
|
538
|
-
await delay(Math.min(intervalMs, Math.max(deadline - Date.now(), 0)));
|
|
539
|
-
intervalMs = Math.min(Math.ceil(intervalMs * 1.5), TESTING_WAIT_MAX_INTERVAL_MS);
|
|
540
|
-
}
|
|
541
|
-
throw new Error(`Timed out waiting for CRT build result for job ${options.jobId}.`);
|
|
542
|
-
}
|
|
543
|
-
export async function getTestingBuildLogs(options) {
|
|
544
|
-
const response = await TestingGateway.call({
|
|
545
|
-
endpoint: testingBuildLogsEndpoint(options.projectId, options.jobId, options.buildId, options),
|
|
546
|
-
method: 'GET',
|
|
547
|
-
responseType: 'text',
|
|
548
|
-
service: 'pace',
|
|
549
|
-
}, options);
|
|
550
|
-
const normalized = normalizeTestingLogResponse(response);
|
|
551
|
-
const sanitizedLog = sanitizeTestingText(normalized.log, [
|
|
552
|
-
resolveTestingCredentials(options).pak,
|
|
553
|
-
...(options.knownSecrets ?? []),
|
|
554
|
-
]);
|
|
555
|
-
const log = options.tailLines === undefined ? sanitizedLog : tailTestingLogLines(sanitizedLog, options.tailLines);
|
|
556
|
-
if (options.output !== undefined) {
|
|
557
|
-
const target = validateTestingOutputPath(options.output);
|
|
558
|
-
mkdirSync(dirname(target), { recursive: true });
|
|
559
|
-
writeFileSync(target, log, 'utf8');
|
|
560
|
-
}
|
|
561
|
-
return {
|
|
562
|
-
buildId: options.buildId,
|
|
563
|
-
jobId: options.jobId,
|
|
564
|
-
log,
|
|
565
|
-
output: options.output,
|
|
566
|
-
projectId: options.projectId,
|
|
567
|
-
status: normalized.status,
|
|
568
|
-
};
|
|
569
|
-
}
|
|
570
|
-
export async function saveTestingBuildArtifacts(options) {
|
|
571
|
-
if (options.saveArtifacts === undefined && options.xunit === undefined)
|
|
572
|
-
return {};
|
|
573
|
-
const location = testingOutputArchiveLocation(options.build);
|
|
574
|
-
if (location === undefined)
|
|
575
|
-
throw new Error('No output archive found for this CRT build.');
|
|
576
|
-
const archive = await TestingGateway.downloadArtifact(location, options);
|
|
577
|
-
const result = {};
|
|
578
|
-
if (options.saveArtifacts !== undefined) {
|
|
579
|
-
const target = validateTestingOutputPath(options.saveArtifacts);
|
|
580
|
-
mkdirSync(dirname(target), { recursive: true });
|
|
581
|
-
writeFileSync(target, archive);
|
|
582
|
-
result.archive = options.saveArtifacts;
|
|
583
|
-
}
|
|
584
|
-
if (options.xunit !== undefined) {
|
|
585
|
-
const target = validateTestingOutputPath(options.xunit);
|
|
586
|
-
const xunit = extractStoredOrDeflatedZipEntry(archive, 'xunit_report.xml');
|
|
587
|
-
if (xunit === undefined)
|
|
588
|
-
throw new Error('The CRT artifact archive does not contain xunit_report.xml.');
|
|
589
|
-
mkdirSync(dirname(target), { recursive: true });
|
|
590
|
-
writeFileSync(target, xunit);
|
|
591
|
-
result.xunit = options.xunit;
|
|
592
|
-
}
|
|
593
|
-
return result;
|
|
594
|
-
}
|
|
595
|
-
export async function abortTestingBuild(options) {
|
|
596
|
-
const response = await TestingGateway.call({
|
|
597
|
-
endpoint: testingBuildAbortEndpoint(options.projectId, options.jobId, options.buildId),
|
|
598
|
-
method: 'PUT',
|
|
599
|
-
service: 'pace',
|
|
600
|
-
}, options);
|
|
601
|
-
return {
|
|
602
|
-
build: normalizeTestingRecord(response),
|
|
603
|
-
buildId: options.buildId,
|
|
604
|
-
jobId: options.jobId,
|
|
605
|
-
projectId: options.projectId,
|
|
606
|
-
};
|
|
607
|
-
}
|
|
608
|
-
export async function listTestingVariables(options) {
|
|
609
|
-
const endpoint = appendTestingQuery(testingVariablesEndpoint(options.projectId), {
|
|
610
|
-
jobId: options.jobId,
|
|
611
|
-
robotId: options.robotId,
|
|
612
|
-
sensitive: options.sensitive,
|
|
613
|
-
type: options.type,
|
|
614
|
-
userSpecific: options.userSpecific,
|
|
615
|
-
});
|
|
616
|
-
const response = await TestingGateway.call({ endpoint, method: 'GET', service: 'pace' }, options);
|
|
617
|
-
const variables = normalizeTestingArray(response)
|
|
618
|
-
.filter((variable) => options.jobId === undefined || variable.jobId?.toString() === options.jobId.toString())
|
|
619
|
-
.filter((variable) => options.robotId === undefined || variable.robotId?.toString() === options.robotId.toString())
|
|
620
|
-
.filter((variable) => options.key === undefined || variable.key === options.key)
|
|
621
|
-
.filter((variable) => options.sensitive === undefined || variable.sensitive === options.sensitive)
|
|
622
|
-
.filter((variable) => options.type === undefined || variable.type === options.type)
|
|
623
|
-
.filter((variable) => options.userSpecific === undefined || variable.userSpecific === options.userSpecific);
|
|
624
|
-
return redactTestingVariables(variables);
|
|
625
|
-
}
|
|
626
|
-
export async function getTestingVariable(options) {
|
|
627
|
-
const response = await TestingGateway.call({ endpoint: testingVariableEndpoint(options.projectId, options.variableId), method: 'GET', service: 'pace' }, options);
|
|
628
|
-
return redactTestingVariables(normalizeTestingRecord(response));
|
|
629
|
-
}
|
|
630
|
-
export async function createTestingVariable(options) {
|
|
631
|
-
requireNonBlank(options.key, 'CRT variable key');
|
|
632
|
-
requireBoundedSecretValue(options.value, 'CRT variable value');
|
|
633
|
-
await ensureUniqueTestingVariable(options);
|
|
634
|
-
const body = [omitUndefined({
|
|
635
|
-
description: options.description,
|
|
636
|
-
jobId: options.jobId,
|
|
637
|
-
key: options.key,
|
|
638
|
-
robotId: options.robotId,
|
|
639
|
-
sensitive: options.sensitive,
|
|
640
|
-
type: options.type,
|
|
641
|
-
userSpecific: options.userSpecific,
|
|
642
|
-
value: options.value,
|
|
643
|
-
})];
|
|
644
|
-
const response = await TestingGateway.call({ body, endpoint: testingVariablesEndpoint(options.projectId), method: 'POST', service: 'pace' }, options);
|
|
645
|
-
return redactTestingVariables(response);
|
|
646
|
-
}
|
|
647
|
-
export async function updateTestingVariable(options) {
|
|
648
|
-
const body = omitUndefined({
|
|
649
|
-
description: options.description,
|
|
650
|
-
key: options.key,
|
|
651
|
-
sensitive: options.sensitive,
|
|
652
|
-
type: options.type,
|
|
653
|
-
value: options.value,
|
|
654
|
-
});
|
|
655
|
-
requireBodyFields(body, 'Provide at least one variable field to update.');
|
|
656
|
-
requireBoundedSecretValue(options.value, 'CRT variable value');
|
|
657
|
-
if (options.key !== undefined)
|
|
658
|
-
requireNonBlank(options.key, 'CRT variable key');
|
|
659
|
-
if (options.key !== undefined) {
|
|
660
|
-
const current = await getTestingVariable(options);
|
|
661
|
-
await ensureUniqueTestingVariable({
|
|
662
|
-
jobId: numericField(current.jobId),
|
|
663
|
-
key: options.key,
|
|
664
|
-
projectId: options.projectId,
|
|
665
|
-
robotId: numericField(current.robotId),
|
|
666
|
-
userSpecific: typeof current.userSpecific === 'boolean' ? current.userSpecific : undefined,
|
|
667
|
-
}, options.variableId);
|
|
668
|
-
}
|
|
669
|
-
const response = await TestingGateway.call({ body, endpoint: testingVariableEndpoint(options.projectId, options.variableId), method: 'PUT', service: 'pace' }, options);
|
|
670
|
-
return redactTestingVariables(response);
|
|
671
|
-
}
|
|
672
|
-
export async function deleteTestingVariable(options) {
|
|
673
|
-
await TestingGateway.call({ endpoint: testingVariableEndpoint(options.projectId, options.variableId), method: 'DELETE', service: 'pace' }, options);
|
|
674
|
-
return { projectId: options.projectId, variableId: options.variableId };
|
|
675
|
-
}
|
|
676
|
-
export async function listTestingUserParameters(options = {}) {
|
|
677
|
-
const response = await TestingGateway.call({ endpoint: testingUserParametersEndpoint(), method: 'GET', service: 'pace' }, options);
|
|
678
|
-
const parameters = normalizeTestingArray(response)
|
|
679
|
-
.filter((parameter) => options.key === undefined || parameter.key === options.key)
|
|
680
|
-
.filter((parameter) => options.projectId === undefined || parameter.projectId?.toString() === options.projectId.toString())
|
|
681
|
-
.filter((parameter) => options.jobId === undefined || parameter.jobId?.toString() === options.jobId.toString());
|
|
682
|
-
return redactTestingVariables(parameters);
|
|
683
|
-
}
|
|
684
|
-
export async function getTestingUserParameter(options) {
|
|
685
|
-
const response = await TestingGateway.call({ endpoint: testingUserParameterEndpoint(options.parameterId), method: 'GET', service: 'pace' }, options);
|
|
686
|
-
return redactTestingVariables(normalizeTestingRecord(response));
|
|
687
|
-
}
|
|
688
|
-
export async function createTestingUserParameter(options) {
|
|
689
|
-
requireNonBlank(options.key, 'CRT user-parameter key');
|
|
690
|
-
requireBoundedSecretValue(options.value, 'CRT user-parameter value');
|
|
691
|
-
if (options.unique === true)
|
|
692
|
-
await ensureUniqueTestingUserParameter(options.key, options);
|
|
693
|
-
const body = [omitUndefined({
|
|
694
|
-
description: options.description,
|
|
695
|
-
key: options.key,
|
|
696
|
-
keyIsUnique: options.unique === true ? true : options.keyIsUnique,
|
|
697
|
-
sensitive: options.sensitive ?? false,
|
|
698
|
-
type: options.type ?? 'parameter',
|
|
699
|
-
value: options.value,
|
|
700
|
-
})];
|
|
701
|
-
const response = await TestingGateway.call({ body, endpoint: testingUserParametersEndpoint(), method: 'POST', service: 'pace' }, options);
|
|
702
|
-
return redactTestingVariables(normalizeTestingArray(response)[0] ?? {});
|
|
703
|
-
}
|
|
704
|
-
export async function updateTestingUserParameter(options) {
|
|
705
|
-
const body = omitUndefined({ description: options.description, key: options.key, value: options.value });
|
|
706
|
-
requireBodyFields(body, 'Provide at least one user-parameter field to update.');
|
|
707
|
-
requireBoundedSecretValue(options.value, 'CRT user-parameter value');
|
|
708
|
-
if (options.key !== undefined)
|
|
709
|
-
requireNonBlank(options.key, 'CRT user-parameter key');
|
|
710
|
-
if (options.unique === true && options.key !== undefined) {
|
|
711
|
-
await ensureUniqueTestingUserParameter(options.key, options, options.parameterId);
|
|
712
|
-
}
|
|
713
|
-
const response = await TestingGateway.call({ body, endpoint: testingUserParameterEndpoint(options.parameterId), method: 'PUT', service: 'pace' }, options);
|
|
714
|
-
return redactTestingVariables(normalizeTestingRecord(response));
|
|
715
|
-
}
|
|
716
|
-
export async function deleteTestingUserParameter(options) {
|
|
717
|
-
await TestingGateway.call({ endpoint: testingUserParameterEndpoint(options.parameterId), method: 'DELETE', service: 'pace' }, options);
|
|
718
|
-
return { deleted: true, parameterId: options.parameterId };
|
|
719
|
-
}
|
|
720
|
-
export function buildFileAddOperations(input) {
|
|
721
|
-
const operations = [];
|
|
722
|
-
for (const file of input.files ?? []) {
|
|
723
|
-
const remote = remotePathForLocalFile(file, input.basePath);
|
|
724
|
-
operations.push(fileOperationFromLocalFile(file, joinRemotePrefix(input.remotePrefix, remote), 'add', input.basePath));
|
|
725
|
-
}
|
|
726
|
-
for (const dir of input.dirs ?? []) {
|
|
727
|
-
const root = resolve(dir);
|
|
728
|
-
if (input.basePath !== undefined)
|
|
729
|
-
assertLocalPathWithinBase(root, input.basePath);
|
|
730
|
-
for (const file of collectFiles(root)) {
|
|
731
|
-
const remote = input.basePath === undefined
|
|
732
|
-
? relative(root, file).split(sep).join('/')
|
|
733
|
-
: remotePathForLocalFile(file, input.basePath);
|
|
734
|
-
operations.push(fileOperationFromLocalFile(file, joinRemotePrefix(input.remotePrefix, remote), 'add', input.basePath));
|
|
735
|
-
}
|
|
736
|
-
}
|
|
737
|
-
return operations;
|
|
738
|
-
}
|
|
739
|
-
export function buildFileOperationsFromSpecs(specs) {
|
|
740
|
-
return [
|
|
741
|
-
...(specs.add ?? []).map((spec) => fileOperationFromSpec(spec, 'add', specs)),
|
|
742
|
-
...(specs.replace ?? []).map((spec) => fileOperationFromSpec(spec, 'replace', specs)),
|
|
743
|
-
...(specs.remove ?? []).map((path) => ({
|
|
744
|
-
op: 'remove',
|
|
745
|
-
path: normalizeRemotePath(joinRemotePrefix(specs.remotePrefix, path)),
|
|
746
|
-
})),
|
|
747
|
-
];
|
|
748
|
-
}
|
|
749
|
-
export function buildTestingRunRequest(options) {
|
|
750
|
-
const inputParameters = [
|
|
751
|
-
...(options.parameters ?? []),
|
|
752
|
-
...(options.include ?? []).map((value) => ({ key: 'include', type: 'clp', value })),
|
|
753
|
-
...(options.exclude ?? []).map((value) => ({ key: 'exclude', type: 'clp', value })),
|
|
754
|
-
...testingFlagParameters('--test', options.tests),
|
|
755
|
-
...testingFlagParameters('--suite', options.suites),
|
|
756
|
-
...testingFlagParameters('-v', options.variables),
|
|
757
|
-
...testingFlagParameters('--skip', options.skip),
|
|
758
|
-
...testingFlagParameters('--skiponfailure', options.skipOnFailure),
|
|
759
|
-
...testingFlagParameters('--settag', options.setTags),
|
|
760
|
-
...testingFlagParameters('--metadata', options.metadata),
|
|
761
|
-
...testingBooleanParameter('--dryrun', options.dryRun),
|
|
762
|
-
...testingBooleanParameter('--exitonerror', options.exitOnError),
|
|
763
|
-
...testingBooleanParameter('--exitonfailure', options.exitOnFailure),
|
|
764
|
-
...testingBooleanParameter('--runemptysuite', options.runEmptySuite),
|
|
765
|
-
...testingScalarParameter('--name', options.name),
|
|
766
|
-
...testingScalarParameter('--doc', options.doc),
|
|
767
|
-
...testingScalarParameter('--consolewidth', options.consoleWidth),
|
|
768
|
-
...testingScalarParameter('--consolecolors', normalizeConsoleColors(options.consoleColors)),
|
|
769
|
-
];
|
|
770
|
-
return omitUndefined({
|
|
771
|
-
branch: options.branch,
|
|
772
|
-
inputParameters: inputParameters.length > 0 ? inputParameters : undefined,
|
|
773
|
-
record: options.record,
|
|
774
|
-
rerunFailedFromLatest: options.rerunFailedFromLatest,
|
|
775
|
-
rerunFailedId: options.rerunFailedId,
|
|
776
|
-
runType: options.runType === 'regression' ? 'normal' : options.runType,
|
|
777
|
-
tag: options.tag,
|
|
778
|
-
});
|
|
779
|
-
}
|
|
780
|
-
export function setTestingSnapshotFetchForTests(snapshotFetchFn) {
|
|
781
|
-
testingSnapshotFetchFn = snapshotFetchFn;
|
|
782
|
-
}
|
|
783
|
-
export function resetTestingSnapshotFetchForTests() {
|
|
784
|
-
testingSnapshotFetchFn = defaultTestingSnapshotFetch;
|
|
785
|
-
}
|
|
786
|
-
function fileOperationFromSpec(spec, op, options) {
|
|
787
|
-
const separator = spec.indexOf(':');
|
|
788
|
-
const localPath = separator === -1 ? spec : spec.slice(0, separator);
|
|
789
|
-
const remotePath = separator === -1
|
|
790
|
-
? remotePathForLocalFile(localPath, options.basePath)
|
|
791
|
-
: spec.slice(separator + 1);
|
|
792
|
-
return fileOperationFromLocalFile(localPath, joinRemotePrefix(options.remotePrefix, remotePath), op, options.basePath);
|
|
793
|
-
}
|
|
794
|
-
function fileOperationFromLocalFile(localPath, remotePath, op, basePath) {
|
|
795
|
-
const path = normalizeRemotePath(remotePath);
|
|
796
|
-
if (!existsSync(localPath))
|
|
797
|
-
throw new Error(`Local CRT file does not exist: ${localPath}`);
|
|
798
|
-
if (!statSync(localPath).isFile())
|
|
799
|
-
throw new Error(`Local CRT path is not a file: ${localPath}`);
|
|
800
|
-
if (basePath !== undefined)
|
|
801
|
-
assertLocalPathWithinBase(localPath, basePath);
|
|
802
|
-
return {
|
|
803
|
-
encoding: 'utf-8',
|
|
804
|
-
op,
|
|
805
|
-
path,
|
|
806
|
-
value: readFileSync(localPath, 'utf8'),
|
|
807
|
-
};
|
|
808
|
-
}
|
|
809
|
-
function collectFiles(root) {
|
|
810
|
-
if (!existsSync(root))
|
|
811
|
-
throw new Error(`Directory does not exist: ${root}`);
|
|
812
|
-
const entries = readdirSync(root).sort();
|
|
813
|
-
const files = [];
|
|
814
|
-
for (const entry of entries) {
|
|
815
|
-
const path = join(root, entry);
|
|
816
|
-
const stat = statSync(path);
|
|
817
|
-
if (stat.isDirectory())
|
|
818
|
-
files.push(...collectFiles(path));
|
|
819
|
-
else if (stat.isFile())
|
|
820
|
-
files.push(path);
|
|
821
|
-
}
|
|
822
|
-
return files;
|
|
823
|
-
}
|
|
824
|
-
export function normalizeTestingRemotePath(path) {
|
|
825
|
-
const raw = path.trim().replaceAll('\\', '/');
|
|
826
|
-
if (raw.startsWith('/') || /^[a-z]:\//iu.test(raw)) {
|
|
827
|
-
throw new Error(`Invalid CRT file path: ${path}`);
|
|
828
|
-
}
|
|
829
|
-
const parts = raw.split('/');
|
|
830
|
-
if (raw.length === 0 || parts.some((part) => part.length === 0 || part === '.' || part === '..')) {
|
|
831
|
-
throw new Error(`Invalid CRT file path: ${path}`);
|
|
832
|
-
}
|
|
833
|
-
const normalized = parts.join('/');
|
|
834
|
-
return normalized;
|
|
835
|
-
}
|
|
836
|
-
const normalizeRemotePath = normalizeTestingRemotePath;
|
|
837
|
-
function writeDownloadedFiles(outputDir, files) {
|
|
838
|
-
const root = resolve(outputDir);
|
|
839
|
-
mkdirSync(root, { recursive: true });
|
|
840
|
-
for (const file of files) {
|
|
841
|
-
const remotePath = normalizeRemotePath(file.path ?? '');
|
|
842
|
-
const target = resolve(root, remotePath);
|
|
843
|
-
if (!target.startsWith(`${root}${sep}`) && target !== root) {
|
|
844
|
-
throw new Error(`Refusing to write CRT file outside output directory: ${remotePath}`);
|
|
845
|
-
}
|
|
846
|
-
mkdirSync(dirname(target), { recursive: true });
|
|
847
|
-
const value = file.value ?? '';
|
|
848
|
-
const contents = file.encoding === 'base64' ? Buffer.from(value, 'base64') : Buffer.from(value, 'utf8');
|
|
849
|
-
writeFileSync(target, contents);
|
|
850
|
-
}
|
|
851
|
-
}
|
|
852
|
-
function basenameForPath(path) {
|
|
853
|
-
const segments = path.replaceAll('\\', '/').split('/').filter(Boolean);
|
|
854
|
-
return segments.at(-1) ?? path;
|
|
855
|
-
}
|
|
856
|
-
function remotePathForLocalFile(localPath, basePath) {
|
|
857
|
-
if (basePath === undefined)
|
|
858
|
-
return basenameForPath(localPath);
|
|
859
|
-
if (!existsSync(localPath))
|
|
860
|
-
throw new Error(`Local CRT file does not exist: ${localPath}`);
|
|
861
|
-
assertLocalPathWithinBase(localPath, basePath);
|
|
862
|
-
const root = realpathSync(resolve(basePath));
|
|
863
|
-
const target = realpathSync(resolve(localPath));
|
|
864
|
-
assertPathWithinRoot(target, root, 'Local CRT file escapes --base-path');
|
|
865
|
-
return relative(root, target).split(sep).join('/');
|
|
866
|
-
}
|
|
867
|
-
function joinRemotePrefix(prefix, path) {
|
|
868
|
-
if (prefix === undefined || prefix.trim().length === 0)
|
|
869
|
-
return path;
|
|
870
|
-
return `${normalizeRemotePath(prefix)}/${path}`;
|
|
871
|
-
}
|
|
872
|
-
function assertLocalPathWithinBase(localPath, basePath) {
|
|
873
|
-
const root = resolve(basePath);
|
|
874
|
-
if (!existsSync(root) || !statSync(root).isDirectory()) {
|
|
875
|
-
throw new Error(`CRT upload base path must be an existing directory: ${basePath}`);
|
|
876
|
-
}
|
|
877
|
-
assertPathWithinRoot(realpathSync(resolve(localPath)), realpathSync(root), 'Local CRT file escapes --base-path');
|
|
878
|
-
}
|
|
879
|
-
function assertPathWithinRoot(target, root, message) {
|
|
880
|
-
if (target !== root && !target.startsWith(`${root}${sep}`))
|
|
881
|
-
throw new Error(`${message}: ${target}`);
|
|
882
|
-
}
|
|
883
|
-
function sanitizeTestingFilePlan(operations) {
|
|
884
|
-
return operations.map((operation) => ({
|
|
885
|
-
encoding: operation.encoding,
|
|
886
|
-
op: operation.op,
|
|
887
|
-
path: operation.path,
|
|
888
|
-
...(operation.value === undefined ? {} : { value: `[${Buffer.byteLength(operation.value)} bytes]` }),
|
|
889
|
-
}));
|
|
890
|
-
}
|
|
891
|
-
function filterByName(records, name, insensitive) {
|
|
892
|
-
if (name === undefined || name.trim().length === 0)
|
|
893
|
-
return records;
|
|
894
|
-
const expected = insensitive ? name.toLowerCase() : name;
|
|
895
|
-
return records.filter((record) => {
|
|
896
|
-
const actual = record.name ?? '';
|
|
897
|
-
return insensitive ? actual.toLowerCase() === expected : actual === expected;
|
|
898
|
-
});
|
|
899
|
-
}
|
|
900
|
-
function findMatchingBuild(builds, buildId) {
|
|
901
|
-
if (buildId === undefined)
|
|
902
|
-
return builds[0];
|
|
903
|
-
const expected = buildId.toString();
|
|
904
|
-
return builds.find((build) => build.id?.toString() === expected || build.buildId?.toString() === expected);
|
|
905
|
-
}
|
|
906
|
-
export function testingBuildStatus(build) {
|
|
907
|
-
const direct = build.status;
|
|
908
|
-
const nestedResult = isPlainRecord(build.result) ? build.result.status : undefined;
|
|
909
|
-
const value = direct === 'finished' && typeof nestedResult === 'string'
|
|
910
|
-
? nestedResult
|
|
911
|
-
: direct ?? build.buildStatus ?? build.state ?? nestedResult;
|
|
912
|
-
return typeof value === 'string' ? value.toLowerCase() : undefined;
|
|
913
|
-
}
|
|
914
|
-
export function isTerminalTestingBuild(build) {
|
|
915
|
-
const status = testingBuildStatus(build);
|
|
916
|
-
return status !== undefined && TESTING_TERMINAL_BUILD_STATUSES.has(status);
|
|
917
|
-
}
|
|
918
|
-
export function isSuccessfulTestingBuild(build) {
|
|
919
|
-
return testingBuildStatus(build) === 'succeeded';
|
|
920
|
-
}
|
|
921
|
-
function isTerminalBuild(build) {
|
|
922
|
-
return isTerminalTestingBuild(build);
|
|
923
|
-
}
|
|
924
|
-
function isTestingLogPollable(build) {
|
|
925
|
-
const status = testingBuildStatus(build);
|
|
926
|
-
return status === 'executing' || status === 'finished' || status === 'succeeded';
|
|
927
|
-
}
|
|
928
|
-
async function delay(ms) {
|
|
929
|
-
if (ms <= 0)
|
|
930
|
-
return;
|
|
931
|
-
await new Promise((resolvePromise) => {
|
|
932
|
-
setTimeout(resolvePromise, ms);
|
|
933
|
-
});
|
|
934
|
-
}
|
|
935
|
-
async function listTestingSnapshotFiles(snapshotUrl, options) {
|
|
936
|
-
const credentials = resolveTestingCredentials(options);
|
|
937
|
-
const transactionId = getGatewayTransactionId() ?? createTransactionId();
|
|
938
|
-
const url = new URL(snapshotUrl);
|
|
939
|
-
validateTestingSnapshotUrl(url, credentials.domain);
|
|
940
|
-
scheduleGatewayEventLog({
|
|
941
|
-
eventId: transactionId,
|
|
942
|
-
method: 'GET',
|
|
943
|
-
orgId: credentials.orgId.toString(),
|
|
944
|
-
service: CRT_GATEWAY_EVENT_SERVICE,
|
|
945
|
-
url: sanitizeTestingUrl(url),
|
|
946
|
-
});
|
|
947
|
-
const snapshot = await testingSnapshotFetchFn(url, {
|
|
948
|
-
Accept: 'application/octet-stream',
|
|
949
|
-
...gatewayRefererHeaders(),
|
|
950
|
-
'X-Authorization': credentials.pak,
|
|
951
|
-
}, options.timeoutMs ?? TESTING_DEFAULT_TIMEOUT_MS, TESTING_MAX_RESPONSE_BYTES);
|
|
952
|
-
if (snapshot.length > TESTING_MAX_RESPONSE_BYTES) {
|
|
953
|
-
throw new Error(`CRT snapshot response exceeded the ${TESTING_MAX_RESPONSE_BYTES} byte safety limit.`);
|
|
954
|
-
}
|
|
955
|
-
return listSnapshotZipEntries(snapshot);
|
|
956
|
-
}
|
|
957
|
-
function validateTestingSnapshotUrl(url, domain) {
|
|
958
|
-
const expected = new URL(paceBaseUrl(domain));
|
|
959
|
-
let decodedPath;
|
|
960
|
-
try {
|
|
961
|
-
decodedPath = decodeURIComponent(url.pathname);
|
|
962
|
-
}
|
|
963
|
-
catch {
|
|
964
|
-
throw new Error('CRT snapshot URL has an invalid encoded path.');
|
|
965
|
-
}
|
|
966
|
-
if (url.protocol !== 'https:' ||
|
|
967
|
-
url.origin !== expected.origin ||
|
|
968
|
-
url.username.length > 0 ||
|
|
969
|
-
url.password.length > 0 ||
|
|
970
|
-
decodedPath.split('/').includes('..')) {
|
|
971
|
-
throw new Error('CRT snapshot URL must use the configured HTTPS Pace API host.');
|
|
972
|
-
}
|
|
973
|
-
}
|
|
974
|
-
function snapshotUrlForJob(job) {
|
|
975
|
-
const { storage } = job;
|
|
976
|
-
if (storage === null || typeof storage !== 'object' || Array.isArray(storage))
|
|
977
|
-
return undefined;
|
|
978
|
-
const { snapshotUrl } = storage;
|
|
979
|
-
return typeof snapshotUrl === 'string' && snapshotUrl.trim().length > 0 ? snapshotUrl : undefined;
|
|
980
|
-
}
|
|
981
|
-
function findTestingRecord(records, id, label) {
|
|
982
|
-
const expected = id.toString();
|
|
983
|
-
const record = records.find((candidate) => candidate.id?.toString() === expected);
|
|
984
|
-
if (record === undefined)
|
|
985
|
-
throw new Error(`CRT ${label} not found: ${id}`);
|
|
986
|
-
return record;
|
|
987
|
-
}
|
|
988
|
-
function numericId(value, label) {
|
|
989
|
-
const parsed = typeof value === 'number' ? value : Number.parseInt(value, 10);
|
|
990
|
-
if (!Number.isSafeInteger(parsed))
|
|
991
|
-
throw new Error(`CRT ${label} ID must be numeric: ${value}`);
|
|
992
|
-
return parsed;
|
|
993
|
-
}
|
|
994
|
-
function omitUndefined(record) {
|
|
995
|
-
return Object.fromEntries(Object.entries(record).filter(([, value]) => value !== undefined));
|
|
996
|
-
}
|
|
997
|
-
function requireBodyFields(body, message) {
|
|
998
|
-
if (Object.keys(body).length === 0)
|
|
999
|
-
throw new Error(message);
|
|
1000
|
-
}
|
|
1001
|
-
function requireNonBlank(value, label) {
|
|
1002
|
-
if (value.trim().length === 0 || value.includes('\0'))
|
|
1003
|
-
throw new Error(`${label} must not be blank.`);
|
|
1004
|
-
}
|
|
1005
|
-
function requireBoundedSecretValue(value, label) {
|
|
1006
|
-
if (value !== undefined && Buffer.byteLength(value) > TESTING_SECRET_VALUE_MAX_BYTES) {
|
|
1007
|
-
throw new Error(`${label} exceeds the ${TESTING_SECRET_VALUE_MAX_BYTES} byte safety limit.`);
|
|
1008
|
-
}
|
|
1009
|
-
}
|
|
1010
|
-
function validateTestingPermissionRequest(request) {
|
|
1011
|
-
if ((request.userId === undefined) === (request.groupId === undefined)) {
|
|
1012
|
-
throw new Error('Provide exactly one of userId or groupId for a project permission.');
|
|
1013
|
-
}
|
|
1014
|
-
if (request.view !== true && request.edit !== true) {
|
|
1015
|
-
throw new Error('Set view or edit to true for a project permission.');
|
|
1016
|
-
}
|
|
1017
|
-
}
|
|
1018
|
-
async function ensureUniqueTestingVariable(options, excludedId) {
|
|
1019
|
-
const matches = await listTestingVariables({
|
|
1020
|
-
jobId: options.jobId,
|
|
1021
|
-
key: options.key,
|
|
1022
|
-
projectId: options.projectId,
|
|
1023
|
-
robotId: options.robotId,
|
|
1024
|
-
userSpecific: options.userSpecific,
|
|
1025
|
-
});
|
|
1026
|
-
const duplicate = matches.find((variable) => variable.id?.toString() !== excludedId &&
|
|
1027
|
-
sameOptionalId(variable.jobId, options.jobId) &&
|
|
1028
|
-
sameOptionalId(variable.robotId, options.robotId) &&
|
|
1029
|
-
Boolean(variable.userSpecific) === Boolean(options.userSpecific));
|
|
1030
|
-
if (duplicate !== undefined) {
|
|
1031
|
-
throw new Error(`A CRT variable with key "${options.key}" already exists in this scope.`);
|
|
1032
|
-
}
|
|
1033
|
-
}
|
|
1034
|
-
function sameOptionalId(left, right) {
|
|
1035
|
-
if (left === undefined || left === null)
|
|
1036
|
-
return right === undefined;
|
|
1037
|
-
return right !== undefined && left.toString() === right.toString();
|
|
1038
|
-
}
|
|
1039
|
-
async function ensureUniqueTestingUserParameter(key, options, excludedId) {
|
|
1040
|
-
const matches = await listTestingUserParameters({ ...options, key });
|
|
1041
|
-
const duplicate = matches.find((parameter) => parameter.id?.toString() !== excludedId?.toString());
|
|
1042
|
-
if (duplicate !== undefined) {
|
|
1043
|
-
throw new Error(`A CRT user parameter with key "${key}" already exists.`);
|
|
1044
|
-
}
|
|
1045
|
-
}
|
|
1046
|
-
function numericField(value) {
|
|
1047
|
-
if (typeof value === 'number' && Number.isSafeInteger(value))
|
|
1048
|
-
return value;
|
|
1049
|
-
if (typeof value === 'string' && /^\d+$/u.test(value))
|
|
1050
|
-
return Number.parseInt(value, 10);
|
|
1051
|
-
return undefined;
|
|
1052
|
-
}
|
|
1053
|
-
function stringField(value) {
|
|
1054
|
-
return typeof value === 'string' ? value : undefined;
|
|
1055
|
-
}
|
|
1056
|
-
function branchOrTagFromOptions(options) {
|
|
1057
|
-
if (options.gitBranch !== undefined)
|
|
1058
|
-
return { branch: options.gitBranch };
|
|
1059
|
-
if (options.gitTag !== undefined)
|
|
1060
|
-
return { tag: options.gitTag };
|
|
1061
|
-
return undefined;
|
|
1062
|
-
}
|
|
1063
|
-
function hasGitStorageOptions(options) {
|
|
1064
|
-
return [
|
|
1065
|
-
options.gitBranch,
|
|
1066
|
-
options.gitPassword,
|
|
1067
|
-
options.gitTag,
|
|
1068
|
-
options.gitUrl,
|
|
1069
|
-
options.gitUsername,
|
|
1070
|
-
options.gitUseCallerCredentials,
|
|
1071
|
-
].some((value) => value !== undefined && value !== false);
|
|
1072
|
-
}
|
|
1073
|
-
function hasTestingFileInput(fileInput) {
|
|
1074
|
-
return (fileInput?.dirs?.length ?? 0) > 0 || (fileInput?.files?.length ?? 0) > 0;
|
|
1075
|
-
}
|
|
1076
|
-
function validateTestingGitStorageOptions(options, requirements) {
|
|
1077
|
-
if (options.gitBranch !== undefined && options.gitTag !== undefined) {
|
|
1078
|
-
throw new Error('Use either --git-branch or --git-tag, not both.');
|
|
1079
|
-
}
|
|
1080
|
-
if (requirements.requireUrl && options.gitUrl === undefined) {
|
|
1081
|
-
throw new Error('Provide --git-url when creating a Git-backed testing job.');
|
|
1082
|
-
}
|
|
1083
|
-
if (requirements.requireRef && options.gitBranch === undefined && options.gitTag === undefined) {
|
|
1084
|
-
throw new Error('Provide either --git-branch or --git-tag when creating a Git-backed testing job.');
|
|
1085
|
-
}
|
|
1086
|
-
if (options.gitUseCallerCredentials === true && (options.gitUsername !== undefined || options.gitPassword !== undefined)) {
|
|
1087
|
-
throw new Error('Use either --git-use-caller-credentials or --git-username/--git-password, not both.');
|
|
1088
|
-
}
|
|
1089
|
-
if ((options.gitUsername === undefined) !== (options.gitPassword === undefined)) {
|
|
1090
|
-
throw new Error('Provide --git-username and --git-password together.');
|
|
1091
|
-
}
|
|
1092
|
-
requireBoundedSecretValue(options.gitPassword, 'CRT Git password');
|
|
1093
|
-
if (options.gitBranch !== undefined)
|
|
1094
|
-
validateTestingGitRef(options.gitBranch, 'branch');
|
|
1095
|
-
if (options.gitTag !== undefined)
|
|
1096
|
-
validateTestingGitRef(options.gitTag, 'tag');
|
|
1097
|
-
}
|
|
1098
|
-
function validateTestingGitRef(value, label) {
|
|
1099
|
-
if (value.length > 255 ||
|
|
1100
|
-
value.trim() !== value ||
|
|
1101
|
-
value.length === 0 ||
|
|
1102
|
-
[...value].some((character) => {
|
|
1103
|
-
const code = character.codePointAt(0) ?? 0;
|
|
1104
|
-
return code < 32 || code === 127;
|
|
1105
|
-
}) ||
|
|
1106
|
-
/[ ~^:?*[\]\\]/u.test(value) ||
|
|
1107
|
-
value.includes('..') ||
|
|
1108
|
-
value.includes('@{') ||
|
|
1109
|
-
value.startsWith('-') ||
|
|
1110
|
-
value.endsWith('.') ||
|
|
1111
|
-
value.endsWith('.lock') ||
|
|
1112
|
-
value.split('/').some((part) => part.length === 0 || part.startsWith('.') || part.endsWith('.'))) {
|
|
1113
|
-
throw new Error(`Invalid CRT Git ${label}.`);
|
|
1114
|
-
}
|
|
1115
|
-
}
|
|
1116
|
-
function resolveOptions(options) {
|
|
1117
|
-
return { orgId: resolveTestingCredentials(options).orgId };
|
|
1118
|
-
}
|
|
1119
|
-
function testingFlagParameters(key, values) {
|
|
1120
|
-
return (values ?? []).map((value) => ({ key, type: 'clp', value }));
|
|
1121
|
-
}
|
|
1122
|
-
function testingBooleanParameter(key, enabled) {
|
|
1123
|
-
return enabled === true ? [{ key, type: 'clp', value: '' }] : [];
|
|
1124
|
-
}
|
|
1125
|
-
function testingScalarParameter(key, value) {
|
|
1126
|
-
return value === undefined ? [] : [{ key, type: 'clp', value: value.toString() }];
|
|
1127
|
-
}
|
|
1128
|
-
function normalizeConsoleColors(value) {
|
|
1129
|
-
return value === 'ansi' ? 'auto' : value;
|
|
1130
|
-
}
|
|
1131
|
-
function isPlainRecord(value) {
|
|
1132
|
-
return value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
1133
|
-
}
|
|
1134
|
-
function normalizeTestingLogResponse(response) {
|
|
1135
|
-
try {
|
|
1136
|
-
const parsed = JSON.parse(response);
|
|
1137
|
-
const record = normalizeTestingRecord(parsed);
|
|
1138
|
-
const { log } = record;
|
|
1139
|
-
const { status } = record;
|
|
1140
|
-
if (typeof log === 'string') {
|
|
1141
|
-
return { log, status: typeof status === 'string' ? status : undefined };
|
|
1142
|
-
}
|
|
1143
|
-
}
|
|
1144
|
-
catch {
|
|
1145
|
-
// Plain text is the backward-compatible CRT logs response.
|
|
1146
|
-
}
|
|
1147
|
-
return { log: response };
|
|
1148
|
-
}
|
|
1149
|
-
export function tailTestingLogLines(log, count) {
|
|
1150
|
-
if (count === 0)
|
|
1151
|
-
return '';
|
|
1152
|
-
const lines = log.split('\n');
|
|
1153
|
-
const hasTrailingNewline = lines.at(-1) === '';
|
|
1154
|
-
if (hasTrailingNewline)
|
|
1155
|
-
lines.pop();
|
|
1156
|
-
if (lines.length <= count)
|
|
1157
|
-
return log;
|
|
1158
|
-
const result = lines.slice(-count).join('\n');
|
|
1159
|
-
return hasTrailingNewline ? `${result}\n` : result;
|
|
1160
|
-
}
|
|
1161
|
-
export function validateTestingOutputPath(path) {
|
|
1162
|
-
if (path.trim().length === 0 || path.includes('\0'))
|
|
1163
|
-
throw new Error('CRT output path must not be empty.');
|
|
1164
|
-
const target = resolve(path);
|
|
1165
|
-
if (existsSync(target) && statSync(target).isDirectory()) {
|
|
1166
|
-
throw new Error(`CRT output path must be a file: ${path}`);
|
|
1167
|
-
}
|
|
1168
|
-
return target;
|
|
1169
|
-
}
|
|
1170
|
-
function testingOutputArchiveLocation(build) {
|
|
1171
|
-
const candidates = [
|
|
1172
|
-
build.outputArchive,
|
|
1173
|
-
build.output_archive,
|
|
1174
|
-
build.artifactUrl,
|
|
1175
|
-
build.artifact_url,
|
|
1176
|
-
];
|
|
1177
|
-
for (const candidate of candidates) {
|
|
1178
|
-
if (typeof candidate === 'string' && candidate.trim().length > 0)
|
|
1179
|
-
return candidate;
|
|
1180
|
-
if (isPlainRecord(candidate)) {
|
|
1181
|
-
for (const value of [candidate.location, candidate.url, candidate.href]) {
|
|
1182
|
-
if (typeof value === 'string' && value.trim().length > 0)
|
|
1183
|
-
return value;
|
|
1184
|
-
}
|
|
1185
|
-
}
|
|
1186
|
-
}
|
|
1187
|
-
return undefined;
|
|
1188
|
-
}
|
|
1189
|
-
function extractStoredOrDeflatedZipEntry(archive, expectedName) {
|
|
1190
|
-
const centralOffset = centralDirectoryOffsetForExtraction(archive);
|
|
1191
|
-
if (centralOffset === undefined)
|
|
1192
|
-
throw new Error('CRT artifact is not a valid ZIP archive.');
|
|
1193
|
-
let offset = centralOffset;
|
|
1194
|
-
while (offset + 46 <= archive.length && archive.readUInt32LE(offset) === 0x02_01_4b_50) {
|
|
1195
|
-
const method = archive.readUInt16LE(offset + 10);
|
|
1196
|
-
const compressedSize = archive.readUInt32LE(offset + 20);
|
|
1197
|
-
const nameLength = archive.readUInt16LE(offset + 28);
|
|
1198
|
-
const extraLength = archive.readUInt16LE(offset + 30);
|
|
1199
|
-
const commentLength = archive.readUInt16LE(offset + 32);
|
|
1200
|
-
const localOffset = archive.readUInt32LE(offset + 42);
|
|
1201
|
-
const name = archive.subarray(offset + 46, offset + 46 + nameLength).toString('utf8');
|
|
1202
|
-
if (name === expectedName || name.endsWith(`/${expectedName}`)) {
|
|
1203
|
-
if (localOffset + 30 > archive.length || archive.readUInt32LE(localOffset) !== 0x04_03_4b_50) {
|
|
1204
|
-
throw new Error('CRT artifact contains an invalid ZIP entry.');
|
|
1205
|
-
}
|
|
1206
|
-
const localNameLength = archive.readUInt16LE(localOffset + 26);
|
|
1207
|
-
const localExtraLength = archive.readUInt16LE(localOffset + 28);
|
|
1208
|
-
const dataOffset = localOffset + 30 + localNameLength + localExtraLength;
|
|
1209
|
-
const compressed = archive.subarray(dataOffset, dataOffset + compressedSize);
|
|
1210
|
-
if (compressed.length !== compressedSize)
|
|
1211
|
-
throw new Error('CRT artifact contains a truncated ZIP entry.');
|
|
1212
|
-
if (method === 0)
|
|
1213
|
-
return Buffer.from(compressed);
|
|
1214
|
-
if (method === 8)
|
|
1215
|
-
return inflateRawSync(compressed);
|
|
1216
|
-
throw new Error(`CRT xUnit extraction does not support ZIP compression method ${method}.`);
|
|
1217
|
-
}
|
|
1218
|
-
offset += 46 + nameLength + extraLength + commentLength;
|
|
1219
|
-
}
|
|
1220
|
-
return undefined;
|
|
1221
|
-
}
|
|
1222
|
-
function centralDirectoryOffsetForExtraction(archive) {
|
|
1223
|
-
for (let offset = archive.length - 22; offset >= 0; offset--) {
|
|
1224
|
-
if (archive.readUInt32LE(offset) === 0x06_05_4b_50)
|
|
1225
|
-
return archive.readUInt32LE(offset + 16);
|
|
1226
|
-
}
|
|
1227
|
-
return undefined;
|
|
1228
|
-
}
|
|
1229
|
-
export function buildTestingMsearchBody(orgId, options) {
|
|
1230
|
-
const filters = [
|
|
1231
|
-
{ term: { projectId: options.projectId } },
|
|
1232
|
-
{ term: { jobId: options.jobId } },
|
|
1233
|
-
];
|
|
1234
|
-
if ((options.statuses?.length ?? 0) > 0)
|
|
1235
|
-
filters.push({ terms: { 'categories.state.keyword': options.statuses } });
|
|
1236
|
-
if ((options.runTypes?.length ?? 0) > 0) {
|
|
1237
|
-
filters.push({
|
|
1238
|
-
terms: {
|
|
1239
|
-
'runType.keyword': options.runTypes?.map((runType) => (runType === 'regression' ? 'normal' : 'development')),
|
|
1240
|
-
},
|
|
1241
|
-
});
|
|
1242
|
-
}
|
|
1243
|
-
if ((options.robots?.length ?? 0) > 0)
|
|
1244
|
-
filters.push({ terms: { 'categories.robotId.keyword': options.robots } });
|
|
1245
|
-
if (options.from !== undefined || options.to !== undefined) {
|
|
1246
|
-
filters.push({ range: { date: omitUndefined({ gte: options.from, lte: options.to }) } });
|
|
1247
|
-
}
|
|
1248
|
-
const sortFields = {
|
|
1249
|
-
date: 'date',
|
|
1250
|
-
duration: 'testExecutionTime',
|
|
1251
|
-
id: 'buildNumber',
|
|
1252
|
-
status: 'categories.state.keyword',
|
|
1253
|
-
};
|
|
1254
|
-
const page = Math.max(1, options.page ?? 1);
|
|
1255
|
-
const pageSize = options.pageSize ?? 50;
|
|
1256
|
-
const query = {
|
|
1257
|
-
_source: [
|
|
1258
|
-
'buildNumber',
|
|
1259
|
-
'categories.state',
|
|
1260
|
-
'categories.jobName',
|
|
1261
|
-
'categories.robotId',
|
|
1262
|
-
'runType',
|
|
1263
|
-
'date',
|
|
1264
|
-
'testExecutionTime',
|
|
1265
|
-
],
|
|
1266
|
-
from: (page - 1) * pageSize,
|
|
1267
|
-
query: { bool: { filter: filters } },
|
|
1268
|
-
size: options.count === true ? 0 : pageSize,
|
|
1269
|
-
sort: [{ [sortFields[options.sort ?? 'date']]: { order: options.order ?? 'desc' } }],
|
|
1270
|
-
// Metrics API follows the Elasticsearch wire name.
|
|
1271
|
-
// eslint-disable-next-line camelcase
|
|
1272
|
-
track_total_hits: true,
|
|
1273
|
-
};
|
|
1274
|
-
return `${JSON.stringify({ index: `org_${orgId}_type_testresults` })}\n${JSON.stringify(query)}\n`;
|
|
1275
|
-
}
|
|
1276
|
-
function normalizeTestingSearchResponse(response) {
|
|
1277
|
-
const root = normalizeTestingRecord(response);
|
|
1278
|
-
const responses = Array.isArray(root.responses) ? root.responses : [];
|
|
1279
|
-
const first = isPlainRecord(responses[0]) ? responses[0] : {};
|
|
1280
|
-
const hits = isPlainRecord(first.hits) ? first.hits : {};
|
|
1281
|
-
const totalRecord = isPlainRecord(hits.total) ? hits.total : {};
|
|
1282
|
-
const totalValue = totalRecord.value ?? hits.total;
|
|
1283
|
-
const count = typeof totalValue === 'number'
|
|
1284
|
-
? totalValue
|
|
1285
|
-
: typeof totalValue === 'string' && /^\d+$/u.test(totalValue)
|
|
1286
|
-
? Number.parseInt(totalValue, 10)
|
|
1287
|
-
: 0;
|
|
1288
|
-
const documents = Array.isArray(hits.hits) ? hits.hits : [];
|
|
1289
|
-
const runs = documents
|
|
1290
|
-
.map((document) => (isPlainRecord(document) && isPlainRecord(document._source) ? document._source : document))
|
|
1291
|
-
.filter((document) => isPlainRecord(document))
|
|
1292
|
-
.map((source) => normalizeTestingSearchBuild(source));
|
|
1293
|
-
return { count, runs };
|
|
1294
|
-
}
|
|
1295
|
-
function normalizeTestingSearchBuild(source) {
|
|
1296
|
-
const categories = isPlainRecord(source.categories) ? source.categories : {};
|
|
1297
|
-
const id = source.buildNumber ?? source.id;
|
|
1298
|
-
const jobId = source.jobId ?? categories.jobId;
|
|
1299
|
-
const status = categories.state ?? source.status;
|
|
1300
|
-
const runType = source.runType === 'normal' ? 'regression' : source.runType;
|
|
1301
|
-
return {
|
|
1302
|
-
...source,
|
|
1303
|
-
id: typeof id === 'number' || typeof id === 'string' ? id : undefined,
|
|
1304
|
-
jobId: typeof jobId === 'number' || typeof jobId === 'string' ? jobId : undefined,
|
|
1305
|
-
runType: typeof runType === 'string' ? runType : undefined,
|
|
1306
|
-
status: typeof status === 'string' ? status : undefined,
|
|
1307
|
-
};
|
|
1308
|
-
}
|
|
1309
|
-
//# sourceMappingURL=testing-operations.js.map
|
|
1
|
+
import {modules} from './runtime.js';
|
|
2
|
+
const DEFAULT_TESTING_AUTHOR = modules["testing-operations.js"]["DEFAULT_TESTING_AUTHOR"]
|
|
3
|
+
const abortTestingBuild = modules["testing-operations.js"]["abortTestingBuild"]
|
|
4
|
+
const buildFileAddOperations = modules["testing-operations.js"]["buildFileAddOperations"]
|
|
5
|
+
const buildFileOperationsFromSpecs = modules["testing-operations.js"]["buildFileOperationsFromSpecs"]
|
|
6
|
+
const buildTestingGitStorageUpdate = modules["testing-operations.js"]["buildTestingGitStorageUpdate"]
|
|
7
|
+
const buildTestingMsearchBody = modules["testing-operations.js"]["buildTestingMsearchBody"]
|
|
8
|
+
const buildTestingRunRequest = modules["testing-operations.js"]["buildTestingRunRequest"]
|
|
9
|
+
const countTestingBuilds = modules["testing-operations.js"]["countTestingBuilds"]
|
|
10
|
+
const createTestingJob = modules["testing-operations.js"]["createTestingJob"]
|
|
11
|
+
const createTestingProject = modules["testing-operations.js"]["createTestingProject"]
|
|
12
|
+
const createTestingRobot = modules["testing-operations.js"]["createTestingRobot"]
|
|
13
|
+
const createTestingUserParameter = modules["testing-operations.js"]["createTestingUserParameter"]
|
|
14
|
+
const createTestingVariable = modules["testing-operations.js"]["createTestingVariable"]
|
|
15
|
+
const deleteTestingJob = modules["testing-operations.js"]["deleteTestingJob"]
|
|
16
|
+
const deleteTestingProject = modules["testing-operations.js"]["deleteTestingProject"]
|
|
17
|
+
const deleteTestingProjectPermission = modules["testing-operations.js"]["deleteTestingProjectPermission"]
|
|
18
|
+
const deleteTestingRobot = modules["testing-operations.js"]["deleteTestingRobot"]
|
|
19
|
+
const deleteTestingUserParameter = modules["testing-operations.js"]["deleteTestingUserParameter"]
|
|
20
|
+
const deleteTestingVariable = modules["testing-operations.js"]["deleteTestingVariable"]
|
|
21
|
+
const downloadTestingJobFiles = modules["testing-operations.js"]["downloadTestingJobFiles"]
|
|
22
|
+
const getTestingBuild = modules["testing-operations.js"]["getTestingBuild"]
|
|
23
|
+
const getTestingBuildForArtifacts = modules["testing-operations.js"]["getTestingBuildForArtifacts"]
|
|
24
|
+
const getTestingBuildLogs = modules["testing-operations.js"]["getTestingBuildLogs"]
|
|
25
|
+
const getTestingJob = modules["testing-operations.js"]["getTestingJob"]
|
|
26
|
+
const getTestingJobRefs = modules["testing-operations.js"]["getTestingJobRefs"]
|
|
27
|
+
const getTestingProject = modules["testing-operations.js"]["getTestingProject"]
|
|
28
|
+
const getTestingProjectPermission = modules["testing-operations.js"]["getTestingProjectPermission"]
|
|
29
|
+
const getTestingRobot = modules["testing-operations.js"]["getTestingRobot"]
|
|
30
|
+
const getTestingUserParameter = modules["testing-operations.js"]["getTestingUserParameter"]
|
|
31
|
+
const getTestingVariable = modules["testing-operations.js"]["getTestingVariable"]
|
|
32
|
+
const isSuccessfulTestingBuild = modules["testing-operations.js"]["isSuccessfulTestingBuild"]
|
|
33
|
+
const isTerminalTestingBuild = modules["testing-operations.js"]["isTerminalTestingBuild"]
|
|
34
|
+
const latestTestingBuilds = modules["testing-operations.js"]["latestTestingBuilds"]
|
|
35
|
+
const listTestingBuilds = modules["testing-operations.js"]["listTestingBuilds"]
|
|
36
|
+
const listTestingJobFiles = modules["testing-operations.js"]["listTestingJobFiles"]
|
|
37
|
+
const listTestingJobs = modules["testing-operations.js"]["listTestingJobs"]
|
|
38
|
+
const listTestingProjectPermissions = modules["testing-operations.js"]["listTestingProjectPermissions"]
|
|
39
|
+
const listTestingProjects = modules["testing-operations.js"]["listTestingProjects"]
|
|
40
|
+
const listTestingRobots = modules["testing-operations.js"]["listTestingRobots"]
|
|
41
|
+
const listTestingUserParameters = modules["testing-operations.js"]["listTestingUserParameters"]
|
|
42
|
+
const listTestingVariables = modules["testing-operations.js"]["listTestingVariables"]
|
|
43
|
+
const normalizeTestingRemotePath = modules["testing-operations.js"]["normalizeTestingRemotePath"]
|
|
44
|
+
const resetTestingSnapshotFetchForTests = modules["testing-operations.js"]["resetTestingSnapshotFetchForTests"]
|
|
45
|
+
const runTestingBuild = modules["testing-operations.js"]["runTestingBuild"]
|
|
46
|
+
const saveTestingBuildArtifacts = modules["testing-operations.js"]["saveTestingBuildArtifacts"]
|
|
47
|
+
const searchTestingBuilds = modules["testing-operations.js"]["searchTestingBuilds"]
|
|
48
|
+
const setTestingProjectPermission = modules["testing-operations.js"]["setTestingProjectPermission"]
|
|
49
|
+
const setTestingSnapshotFetchForTests = modules["testing-operations.js"]["setTestingSnapshotFetchForTests"]
|
|
50
|
+
const tailTestingLogLines = modules["testing-operations.js"]["tailTestingLogLines"]
|
|
51
|
+
const testingBuildStatus = modules["testing-operations.js"]["testingBuildStatus"]
|
|
52
|
+
const updateTestingJob = modules["testing-operations.js"]["updateTestingJob"]
|
|
53
|
+
const updateTestingProject = modules["testing-operations.js"]["updateTestingProject"]
|
|
54
|
+
const updateTestingRobot = modules["testing-operations.js"]["updateTestingRobot"]
|
|
55
|
+
const updateTestingUserParameter = modules["testing-operations.js"]["updateTestingUserParameter"]
|
|
56
|
+
const updateTestingVariable = modules["testing-operations.js"]["updateTestingVariable"]
|
|
57
|
+
const uploadTestingJobFiles = modules["testing-operations.js"]["uploadTestingJobFiles"]
|
|
58
|
+
const validateTestingOutputPath = modules["testing-operations.js"]["validateTestingOutputPath"]
|
|
59
|
+
const waitForTestingBuildResult = modules["testing-operations.js"]["waitForTestingBuildResult"]
|
|
60
|
+
export {DEFAULT_TESTING_AUTHOR, abortTestingBuild, buildFileAddOperations, buildFileOperationsFromSpecs, buildTestingGitStorageUpdate, buildTestingMsearchBody, buildTestingRunRequest, countTestingBuilds, createTestingJob, createTestingProject, createTestingRobot, createTestingUserParameter, createTestingVariable, deleteTestingJob, deleteTestingProject, deleteTestingProjectPermission, deleteTestingRobot, deleteTestingUserParameter, deleteTestingVariable, downloadTestingJobFiles, getTestingBuild, getTestingBuildForArtifacts, getTestingBuildLogs, getTestingJob, getTestingJobRefs, getTestingProject, getTestingProjectPermission, getTestingRobot, getTestingUserParameter, getTestingVariable, isSuccessfulTestingBuild, isTerminalTestingBuild, latestTestingBuilds, listTestingBuilds, listTestingJobFiles, listTestingJobs, listTestingProjectPermissions, listTestingProjects, listTestingRobots, listTestingUserParameters, listTestingVariables, normalizeTestingRemotePath, resetTestingSnapshotFetchForTests, runTestingBuild, saveTestingBuildArtifacts, searchTestingBuilds, setTestingProjectPermission, setTestingSnapshotFetchForTests, tailTestingLogLines, testingBuildStatus, updateTestingJob, updateTestingProject, updateTestingRobot, updateTestingUserParameter, updateTestingVariable, uploadTestingJobFiles, validateTestingOutputPath, waitForTestingBuildResult};
|