@credibledata/cred-cli 0.0.103 → 0.0.105
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +106 -1
- package/dist/agent-contract.spec.js +548 -0
- package/dist/agent-contract.spec.js.map +1 -0
- package/dist/browser.js +72 -0
- package/dist/browser.js.map +1 -0
- package/dist/browser.spec.js +125 -0
- package/dist/browser.spec.js.map +1 -0
- package/dist/client/api.js +4137 -1159
- package/dist/client/api.js.map +1 -1
- package/dist/client-codeassist/api.js +476 -0
- package/dist/client-codeassist/api.js.map +1 -0
- package/dist/client-codeassist/base.js +69 -0
- package/dist/client-codeassist/base.js.map +1 -0
- package/dist/client-codeassist/common.js +162 -0
- package/dist/client-codeassist/common.js.map +1 -0
- package/dist/client-codeassist/configuration.js +44 -0
- package/dist/client-codeassist/configuration.js.map +1 -0
- package/dist/client-codeassist/index.js +32 -0
- package/dist/client-codeassist/index.js.map +1 -0
- package/dist/clientconfiguration.js +17 -289
- package/dist/clientconfiguration.js.map +1 -1
- package/dist/clientconfiguration.spec.js +35 -96
- package/dist/clientconfiguration.spec.js.map +1 -1
- package/dist/commands/add.js +103 -3
- package/dist/commands/add.js.map +1 -1
- package/dist/commands/add.spec.js +113 -0
- package/dist/commands/add.spec.js.map +1 -0
- package/dist/commands/connection/createconnections.js +104 -7
- package/dist/commands/connection/createconnections.js.map +1 -1
- package/dist/commands/connection/createconnections.spec.js +35 -1
- package/dist/commands/connection/createconnections.spec.js.map +1 -1
- package/dist/commands/connection/deleteconnection.js +4 -2
- package/dist/commands/connection/deleteconnection.js.map +1 -1
- package/dist/commands/connection/deleteconnection.spec.js +6 -1
- package/dist/commands/connection/deleteconnection.spec.js.map +1 -1
- package/dist/commands/connection/listconnections.js +2 -0
- package/dist/commands/connection/listconnections.js.map +1 -1
- package/dist/commands/connection/updateconnection.js +365 -0
- package/dist/commands/connection/updateconnection.js.map +1 -0
- package/dist/commands/connection/updateconnection.spec.js +625 -0
- package/dist/commands/connection/updateconnection.spec.js.map +1 -0
- package/dist/commands/database/createdatabase.js +52 -0
- package/dist/commands/database/createdatabase.js.map +1 -0
- package/dist/commands/database/database.spec.js +267 -0
- package/dist/commands/database/database.spec.js.map +1 -0
- package/dist/commands/database/deletedatabase.js +91 -0
- package/dist/commands/database/deletedatabase.js.map +1 -0
- package/dist/commands/database/getdatabase.js +97 -0
- package/dist/commands/database/getdatabase.js.map +1 -0
- package/dist/commands/database/listdatabases.js +36 -0
- package/dist/commands/database/listdatabases.js.map +1 -0
- package/dist/commands/database/shared.js +125 -0
- package/dist/commands/database/shared.js.map +1 -0
- package/dist/commands/database/shared.spec.js +109 -0
- package/dist/commands/database/shared.spec.js.map +1 -0
- package/dist/commands/database/updatedatabase.js +39 -0
- package/dist/commands/database/updatedatabase.js.map +1 -0
- package/dist/commands/environment/createenvironment.js +59 -28
- package/dist/commands/environment/createenvironment.js.map +1 -1
- package/dist/commands/environment/createenvironment.spec.js +29 -0
- package/dist/commands/environment/createenvironment.spec.js.map +1 -1
- package/dist/commands/environment/deleteenvironment.js +3 -2
- package/dist/commands/environment/deleteenvironment.js.map +1 -1
- package/dist/commands/environment/deleteenvironment.spec.js +5 -1
- package/dist/commands/environment/deleteenvironment.spec.js.map +1 -1
- package/dist/commands/environment/getenvironment.js +1 -0
- package/dist/commands/environment/getenvironment.js.map +1 -1
- package/dist/commands/environment/listenvironments.js +40 -8
- package/dist/commands/environment/listenvironments.js.map +1 -1
- package/dist/commands/environment/listenvironments.spec.js +41 -2
- package/dist/commands/environment/listenvironments.spec.js.map +1 -1
- package/dist/commands/environment/setenvironment.js +145 -6
- package/dist/commands/environment/setenvironment.js.map +1 -1
- package/dist/commands/environment/setenvironment.spec.js +256 -8
- package/dist/commands/environment/setenvironment.spec.js.map +1 -1
- package/dist/commands/environment/updateenvironment.js +12 -8
- package/dist/commands/environment/updateenvironment.js.map +1 -1
- package/dist/commands/environment/updateenvironment.spec.js +36 -2
- package/dist/commands/environment/updateenvironment.spec.js.map +1 -1
- package/dist/commands/get.js +64 -1
- package/dist/commands/get.js.map +1 -1
- package/dist/commands/group/addmember.js +3 -1
- package/dist/commands/group/addmember.js.map +1 -1
- package/dist/commands/group/addmember.spec.js +7 -2
- package/dist/commands/group/addmember.spec.js.map +1 -1
- package/dist/commands/group/creategroup.js +2 -0
- package/dist/commands/group/creategroup.js.map +1 -1
- package/dist/commands/group/deletegroup.js +3 -1
- package/dist/commands/group/deletegroup.js.map +1 -1
- package/dist/commands/group/deletegroup.spec.js +7 -1
- package/dist/commands/group/deletegroup.spec.js.map +1 -1
- package/dist/commands/group/getgroup.js +2 -0
- package/dist/commands/group/getgroup.js.map +1 -1
- package/dist/commands/group/listgroups.js +2 -0
- package/dist/commands/group/listgroups.js.map +1 -1
- package/dist/commands/group/removemember.js +3 -1
- package/dist/commands/group/removemember.js.map +1 -1
- package/dist/commands/group/removemember.spec.js +7 -2
- package/dist/commands/group/removemember.spec.js.map +1 -1
- package/dist/commands/groupaccesstoken/deleteToken.js +2 -1
- package/dist/commands/groupaccesstoken/deleteToken.js.map +1 -1
- package/dist/commands/groupaccesstoken/groupContainer.js +2 -0
- package/dist/commands/groupaccesstoken/groupContainer.js.map +1 -1
- package/dist/commands/list.js +24 -4
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/materialization/cancelrun.js +3 -1
- package/dist/commands/materialization/cancelrun.js.map +1 -1
- package/dist/commands/materialization/getindex.js +2 -0
- package/dist/commands/materialization/getindex.js.map +1 -1
- package/dist/commands/materialization/getmaterialization.js +2 -0
- package/dist/commands/materialization/getmaterialization.js.map +1 -1
- package/dist/commands/materialization/getpreaggregate.js +2 -0
- package/dist/commands/materialization/getpreaggregate.js.map +1 -1
- package/dist/commands/materialization/getrun.js +2 -0
- package/dist/commands/materialization/getrun.js.map +1 -1
- package/dist/commands/materialization/listindexes.js +2 -0
- package/dist/commands/materialization/listindexes.js.map +1 -1
- package/dist/commands/materialization/listmaterializations.js +2 -0
- package/dist/commands/materialization/listmaterializations.js.map +1 -1
- package/dist/commands/materialization/listpreaggregates.js +2 -0
- package/dist/commands/materialization/listpreaggregates.js.map +1 -1
- package/dist/commands/materialization/listruns.js +3 -1
- package/dist/commands/materialization/listruns.js.map +1 -1
- package/dist/commands/materialization/rerun.js +3 -1
- package/dist/commands/materialization/rerun.js.map +1 -1
- package/dist/commands/misc/inquirerHost.js +87 -0
- package/dist/commands/misc/inquirerHost.js.map +1 -0
- package/dist/commands/misc/inquirerHost.spec.js +91 -0
- package/dist/commands/misc/inquirerHost.spec.js.map +1 -0
- package/dist/commands/misc/login.js +348 -58
- package/dist/commands/misc/login.js.map +1 -1
- package/dist/commands/misc/login.spec.js +525 -7
- package/dist/commands/misc/login.spec.js.map +1 -1
- package/dist/commands/misc/logout.js +26 -3
- package/dist/commands/misc/logout.js.map +1 -1
- package/dist/commands/misc/logout.spec.js +52 -12
- package/dist/commands/misc/logout.spec.js.map +1 -1
- package/dist/commands/misc/resolveLoginTarget.spec.js +90 -0
- package/dist/commands/misc/resolveLoginTarget.spec.js.map +1 -0
- package/dist/commands/misc/scope.spec.js +108 -0
- package/dist/commands/misc/scope.spec.js.map +1 -0
- package/dist/commands/misc/set-access-token.js +1 -1
- package/dist/commands/misc/set-access-token.js.map +1 -1
- package/dist/commands/misc/set-access-token.spec.js +13 -2
- package/dist/commands/misc/set-access-token.spec.js.map +1 -1
- package/dist/commands/misc/setup.js +819 -0
- package/dist/commands/misc/setup.js.map +1 -0
- package/dist/commands/misc/setup.spec.js +783 -0
- package/dist/commands/misc/setup.spec.js.map +1 -0
- package/dist/commands/misc/status.js +168 -0
- package/dist/commands/misc/status.js.map +1 -0
- package/dist/commands/misc/status.spec.js +301 -0
- package/dist/commands/misc/status.spec.js.map +1 -0
- package/dist/commands/misc/token.js +57 -0
- package/dist/commands/misc/token.js.map +1 -0
- package/dist/commands/misc/token.spec.js +92 -0
- package/dist/commands/misc/token.spec.js.map +1 -0
- package/dist/commands/package/deletepackage.js +4 -2
- package/dist/commands/package/deletepackage.js.map +1 -1
- package/dist/commands/package/deletepackage.spec.js +7 -1
- package/dist/commands/package/deletepackage.spec.js.map +1 -1
- package/dist/commands/package/getpackage.js +142 -0
- package/dist/commands/package/getpackage.js.map +1 -0
- package/dist/commands/package/getpackage.spec.js +246 -0
- package/dist/commands/package/getpackage.spec.js.map +1 -0
- package/dist/commands/package/listpackages.js +2 -0
- package/dist/commands/package/listpackages.js.map +1 -1
- package/dist/commands/package/publish.archive.spec.js +570 -0
- package/dist/commands/package/publish.archive.spec.js.map +1 -0
- package/dist/commands/package/publish.js +780 -49
- package/dist/commands/package/publish.js.map +1 -1
- package/dist/commands/package/publish.spec.js +451 -8
- package/dist/commands/package/publish.spec.js.map +1 -1
- package/dist/commands/package/updatepackage.js +22 -19
- package/dist/commands/package/updatepackage.js.map +1 -1
- package/dist/commands/package/updatepackage.spec.js +36 -1
- package/dist/commands/package/updatepackage.spec.js.map +1 -1
- package/dist/commands/permission/createpermission.js +3 -1
- package/dist/commands/permission/createpermission.js.map +1 -1
- package/dist/commands/permission/deletepermission.js +6 -3
- package/dist/commands/permission/deletepermission.js.map +1 -1
- package/dist/commands/permission/getpermission.js +2 -0
- package/dist/commands/permission/getpermission.js.map +1 -1
- package/dist/commands/permission/listpermissions.js +2 -0
- package/dist/commands/permission/listpermissions.js.map +1 -1
- package/dist/commands/rm.js +21 -0
- package/dist/commands/rm.js.map +1 -1
- package/dist/commands/set.js +40 -6
- package/dist/commands/set.js.map +1 -1
- package/dist/commands/set.spec.js +123 -0
- package/dist/commands/set.spec.js.map +1 -0
- package/dist/commands/table/addtable.js +155 -0
- package/dist/commands/table/addtable.js.map +1 -0
- package/dist/commands/table/deletetable.js +45 -0
- package/dist/commands/table/deletetable.js.map +1 -0
- package/dist/commands/table/gettable.js +32 -0
- package/dist/commands/table/gettable.js.map +1 -0
- package/dist/commands/table/listtables.js +36 -0
- package/dist/commands/table/listtables.js.map +1 -0
- package/dist/commands/table/table.spec.js +304 -0
- package/dist/commands/table/table.spec.js.map +1 -0
- package/dist/commands/table/tablefile.js +195 -0
- package/dist/commands/table/tablefile.js.map +1 -0
- package/dist/commands/table/tablefile.spec.js +158 -0
- package/dist/commands/table/tablefile.spec.js.map +1 -0
- package/dist/commands/update.js +21 -0
- package/dist/commands/update.js.map +1 -1
- package/dist/commands/version/archive-unarchive-version.js +4 -2
- package/dist/commands/version/archive-unarchive-version.js.map +1 -1
- package/dist/commands/version/archive-unarchive-version.spec.js +6 -1
- package/dist/commands/version/archive-unarchive-version.spec.js.map +1 -1
- package/dist/commands/version/listversions.js +2 -0
- package/dist/commands/version/listversions.js.map +1 -1
- package/dist/common/UserGroupId.js +9 -4
- package/dist/common/UserGroupId.js.map +1 -1
- package/dist/common/UserGroupId.spec.js +5 -0
- package/dist/common/UserGroupId.spec.js.map +1 -1
- package/dist/constants.js +37 -143
- package/dist/constants.js.map +1 -1
- package/dist/index.js +487 -90
- package/dist/index.js.map +1 -1
- package/dist/logger.js +42 -9
- package/dist/logger.js.map +1 -1
- package/dist/session.js +56 -0
- package/dist/session.js.map +1 -0
- package/dist/session.spec.js +103 -0
- package/dist/session.spec.js.map +1 -0
- package/dist/setup-core/briefing.js +176 -0
- package/dist/setup-core/briefing.js.map +1 -0
- package/dist/setup-core/credstore.js +415 -0
- package/dist/setup-core/credstore.js.map +1 -0
- package/dist/setup-core/credstore.spec.js +238 -0
- package/dist/setup-core/credstore.spec.js.map +1 -0
- package/dist/setup-core/environments.js +267 -0
- package/dist/setup-core/environments.js.map +1 -0
- package/dist/setup-core/flow.e2e.js +165 -0
- package/dist/setup-core/flow.e2e.js.map +1 -0
- package/dist/setup-core/flow.js +765 -0
- package/dist/setup-core/flow.js.map +1 -0
- package/dist/setup-core/flow.spec.js +1348 -0
- package/dist/setup-core/flow.spec.js.map +1 -0
- package/dist/setup-core/folderconfig.js +283 -0
- package/dist/setup-core/folderconfig.js.map +1 -0
- package/dist/setup-core/git.js +97 -0
- package/dist/setup-core/git.js.map +1 -0
- package/dist/setup-core/host.js +77 -0
- package/dist/setup-core/host.js.map +1 -0
- package/dist/setup-core/importconnections.js +470 -0
- package/dist/setup-core/importconnections.js.map +1 -0
- package/dist/setup-core/importconnections.spec.js +594 -0
- package/dist/setup-core/importconnections.spec.js.map +1 -0
- package/dist/setup-core/liveness.js +94 -0
- package/dist/setup-core/liveness.js.map +1 -0
- package/dist/setup-core/liveness.spec.js +59 -0
- package/dist/setup-core/liveness.spec.js.map +1 -0
- package/dist/setup-core/localpublisherconfig.js +26 -0
- package/dist/setup-core/localpublisherconfig.js.map +1 -0
- package/dist/setup-core/localpublisherconfig.spec.js +29 -0
- package/dist/setup-core/localpublisherconfig.spec.js.map +1 -0
- package/dist/setup-core/mcpconfig.js +198 -0
- package/dist/setup-core/mcpconfig.js.map +1 -0
- package/dist/setup-core/mcpconfig.spec.js +205 -0
- package/dist/setup-core/mcpconfig.spec.js.map +1 -0
- package/dist/setup-core/packagemanifest.js +55 -0
- package/dist/setup-core/packagemanifest.js.map +1 -0
- package/dist/setup-core/ports.js +182 -0
- package/dist/setup-core/ports.js.map +1 -0
- package/dist/setup-core/ports.spec.js +173 -0
- package/dist/setup-core/ports.spec.js.map +1 -0
- package/dist/setup-core/publisherconfig.js +268 -0
- package/dist/setup-core/publisherconfig.js.map +1 -0
- package/dist/setup-core/publisherconfig.oracle.js +166 -0
- package/dist/setup-core/publisherconfig.oracle.js.map +1 -0
- package/dist/setup-core/publisherconfig.spec.js +277 -0
- package/dist/setup-core/publisherconfig.spec.js.map +1 -0
- package/dist/setup-core/publisherversion.js +26 -0
- package/dist/setup-core/publisherversion.js.map +1 -0
- package/dist/setup-core/readiness.spec.js +161 -0
- package/dist/setup-core/readiness.spec.js.map +1 -0
- package/dist/setup-core/readylines.js +169 -0
- package/dist/setup-core/readylines.js.map +1 -0
- package/dist/setup-core/readylines.spec.js +70 -0
- package/dist/setup-core/readylines.spec.js.map +1 -0
- package/dist/setup-core/refresh.js +348 -0
- package/dist/setup-core/refresh.js.map +1 -0
- package/dist/setup-core/refresh.spec.js +501 -0
- package/dist/setup-core/refresh.spec.js.map +1 -0
- package/dist/setup-core/skills.js +279 -0
- package/dist/setup-core/skills.js.map +1 -0
- package/dist/setup-core/skills.spec.js +334 -0
- package/dist/setup-core/skills.spec.js.map +1 -0
- package/dist/setup-core/supervisor.js +879 -0
- package/dist/setup-core/supervisor.js.map +1 -0
- package/dist/setup-core/supervisor.spec.js +833 -0
- package/dist/setup-core/supervisor.spec.js.map +1 -0
- package/dist/setup-core/writefile.js +61 -0
- package/dist/setup-core/writefile.js.map +1 -0
- package/dist/setup-core/writefile.spec.js +68 -0
- package/dist/setup-core/writefile.spec.js.map +1 -0
- package/dist/utils.js +409 -3
- package/dist/utils.js.map +1 -1
- package/dist/utils.spec.js +373 -2
- package/dist/utils.spec.js.map +1 -1
- package/dist/versioncheck-refresh.js +18 -0
- package/dist/versioncheck-refresh.js.map +1 -0
- package/dist/versioncheck.js +324 -0
- package/dist/versioncheck.js.map +1 -0
- package/dist/versioncheck.spec.js +587 -0
- package/dist/versioncheck.spec.js.map +1 -0
- package/node_modules/@credibledata/cli-auth/dist/index.d.ts +86 -0
- package/node_modules/@credibledata/cli-auth/dist/index.js +102 -0
- package/node_modules/@credibledata/cli-auth/package.json +19 -0
- package/package.json +18 -6
- package/.github/workflows/build.yml +0 -23
- package/.mocharc.json +0 -10
- package/.prettierignore +0 -2
- package/.prettierrc +0 -4
- package/README-DEV.md +0 -40
- package/coverage/coverage-summary.json +0 -40
- package/coverage/tmp/coverage-2152-1789496974457-0.json +0 -1
- package/coverage/tmp/coverage-2153-1789496954404-0.json +0 -1
- package/docker/Dockerfile.ci +0 -18
- package/docker-compose.yml +0 -18
- package/eslint.config.mjs +0 -45
- package/generate-client.sh +0 -27
- package/mocha.setup.ts +0 -4
- package/openapitools.json +0 -10
- package/src/client/.openapi-generator/FILES +0 -9
- package/src/client/.openapi-generator/VERSION +0 -1
- package/src/client/.openapi-generator-ignore +0 -23
- package/src/client/api.ts +0 -15999
- package/src/client/base.ts +0 -86
- package/src/client/common.ts +0 -150
- package/src/client/configuration.ts +0 -110
- package/src/client/git_push.sh +0 -57
- package/src/client/index.ts +0 -18
- package/src/clientconfiguration.spec.ts +0 -615
- package/src/clientconfiguration.ts +0 -364
- package/src/commands/add.ts +0 -191
- package/src/commands/connection/createconnections.spec.ts +0 -413
- package/src/commands/connection/createconnections.ts +0 -109
- package/src/commands/connection/deleteconnection.spec.ts +0 -189
- package/src/commands/connection/deleteconnection.ts +0 -57
- package/src/commands/connection/listconnections.spec.ts +0 -132
- package/src/commands/connection/listconnections.ts +0 -58
- package/src/commands/environment/createenvironment.spec.ts +0 -249
- package/src/commands/environment/createenvironment.ts +0 -73
- package/src/commands/environment/deleteenvironment.spec.ts +0 -152
- package/src/commands/environment/deleteenvironment.ts +0 -48
- package/src/commands/environment/getenvironment.spec.ts +0 -110
- package/src/commands/environment/getenvironment.ts +0 -43
- package/src/commands/environment/listenvironments.spec.ts +0 -123
- package/src/commands/environment/listenvironments.ts +0 -67
- package/src/commands/environment/setenvironment.spec.ts +0 -63
- package/src/commands/environment/setenvironment.ts +0 -14
- package/src/commands/environment/updateenvironment.spec.ts +0 -386
- package/src/commands/environment/updateenvironment.ts +0 -168
- package/src/commands/get.ts +0 -153
- package/src/commands/group/addmember.spec.ts +0 -257
- package/src/commands/group/addmember.ts +0 -85
- package/src/commands/group/creategroup.spec.ts +0 -146
- package/src/commands/group/creategroup.ts +0 -54
- package/src/commands/group/deletegroup.spec.ts +0 -120
- package/src/commands/group/deletegroup.ts +0 -45
- package/src/commands/group/getgroup.spec.ts +0 -129
- package/src/commands/group/getgroup.ts +0 -47
- package/src/commands/group/listgroups.spec.ts +0 -137
- package/src/commands/group/listgroups.ts +0 -45
- package/src/commands/group/removemember.spec.ts +0 -224
- package/src/commands/group/removemember.ts +0 -75
- package/src/commands/groupaccesstoken/createToken.spec.ts +0 -211
- package/src/commands/groupaccesstoken/createToken.ts +0 -72
- package/src/commands/groupaccesstoken/deleteToken.spec.ts +0 -147
- package/src/commands/groupaccesstoken/deleteToken.ts +0 -29
- package/src/commands/groupaccesstoken/groupContainer.ts +0 -83
- package/src/commands/groupaccesstoken/listTokens.spec.ts +0 -147
- package/src/commands/groupaccesstoken/listTokens.ts +0 -29
- package/src/commands/legacy.ts +0 -5
- package/src/commands/list.ts +0 -326
- package/src/commands/materialization/cancelrun.ts +0 -70
- package/src/commands/materialization/getindex.ts +0 -55
- package/src/commands/materialization/getmaterialization.ts +0 -57
- package/src/commands/materialization/getpreaggregate.ts +0 -58
- package/src/commands/materialization/getrun.ts +0 -55
- package/src/commands/materialization/listindexes.ts +0 -69
- package/src/commands/materialization/listmaterializations.ts +0 -53
- package/src/commands/materialization/listpreaggregates.ts +0 -74
- package/src/commands/materialization/listruns.ts +0 -77
- package/src/commands/materialization/rerun.ts +0 -123
- package/src/commands/misc/login.spec.ts +0 -371
- package/src/commands/misc/login.ts +0 -343
- package/src/commands/misc/logout.spec.ts +0 -32
- package/src/commands/misc/logout.ts +0 -9
- package/src/commands/misc/loopbackOAuth.ts +0 -127
- package/src/commands/misc/set-access-token.spec.ts +0 -95
- package/src/commands/misc/set-access-token.ts +0 -32
- package/src/commands/package/deletepackage.spec.ts +0 -164
- package/src/commands/package/deletepackage.ts +0 -58
- package/src/commands/package/listpackages.spec.ts +0 -163
- package/src/commands/package/listpackages.ts +0 -74
- package/src/commands/package/publish.spec.ts +0 -642
- package/src/commands/package/publish.ts +0 -236
- package/src/commands/package/updatepackage.spec.ts +0 -319
- package/src/commands/package/updatepackage.ts +0 -95
- package/src/commands/permission/createpermission.spec.ts +0 -507
- package/src/commands/permission/createpermission.ts +0 -181
- package/src/commands/permission/deletepermission.ts +0 -117
- package/src/commands/permission/getpermission.ts +0 -115
- package/src/commands/permission/listpermissions.ts +0 -101
- package/src/commands/permission/scope.ts +0 -180
- package/src/commands/rm.ts +0 -146
- package/src/commands/set.ts +0 -25
- package/src/commands/update.ts +0 -107
- package/src/commands/version/archive-unarchive-version.spec.ts +0 -456
- package/src/commands/version/archive-unarchive-version.ts +0 -108
- package/src/commands/version/listversions.spec.ts +0 -138
- package/src/commands/version/listversions.ts +0 -45
- package/src/common/UserGroupId.spec.ts +0 -115
- package/src/common/UserGroupId.ts +0 -137
- package/src/constants.spec.ts +0 -111
- package/src/constants.ts +0 -228
- package/src/index.ts +0 -378
- package/src/logger.spec.ts +0 -158
- package/src/logger.ts +0 -90
- package/src/polyfills/file.polyfill.ts +0 -6
- package/src/utils.spec.ts +0 -135
- package/src/utils.ts +0 -115
- package/src/validator.spec.ts +0 -51
- package/src/validator.ts +0 -44
- package/tsconfig.json +0 -17
package/src/constants.ts
DELETED
|
@@ -1,228 +0,0 @@
|
|
|
1
|
-
export type Environment =
|
|
2
|
-
| "production"
|
|
3
|
-
| "staging"
|
|
4
|
-
| "dev"
|
|
5
|
-
| "localhost"
|
|
6
|
-
| "e2e-test"
|
|
7
|
-
| "videoamp"
|
|
8
|
-
| "aws-dev";
|
|
9
|
-
|
|
10
|
-
export const controlPlanesByEnv: Record<Environment, string> = {
|
|
11
|
-
production: "https://admin.credibledata.com/api/v0",
|
|
12
|
-
dev: "https://dev-admin.credibledata.com/api/v0",
|
|
13
|
-
staging: "https://staging-admin.credibledata.com/api/v0",
|
|
14
|
-
localhost: "http://admin.ms2.localhost/api/v0",
|
|
15
|
-
"e2e-test": "http://admin.ms2.localhost/api/v0",
|
|
16
|
-
videoamp: "https://admin.videoamp-aws-us-east-1.credibledata.com/api/v0",
|
|
17
|
-
// The AWS development cell (credible/dev on EKS). Its public hostnames compose onto the shared
|
|
18
|
-
// apex as aws-dev-<service>.credibledata.com, unlike videoamp's, which live under its own zone.
|
|
19
|
-
"aws-dev": "https://aws-dev-admin.credibledata.com/api/v0",
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
/** Environments that must have an object in `~/.cred` `configPerEnvironment` (avoids undefined on write). */
|
|
23
|
-
export const ALL_ENVIRONMENTS = Object.keys(
|
|
24
|
-
controlPlanesByEnv,
|
|
25
|
-
) as Environment[];
|
|
26
|
-
|
|
27
|
-
export const auth0ConfigsByEnv: Record<
|
|
28
|
-
Environment,
|
|
29
|
-
{
|
|
30
|
-
domain: string;
|
|
31
|
-
clientId: string;
|
|
32
|
-
clientSecret?: string;
|
|
33
|
-
audience: string;
|
|
34
|
-
}
|
|
35
|
-
> = {
|
|
36
|
-
production: {
|
|
37
|
-
domain: "https://auth.credibledata.com",
|
|
38
|
-
clientId: "ge8JL5TJNwqy7bygAaJkD92KdluqEZgO",
|
|
39
|
-
audience: "https://ms2data.us.auth0.com/api/v2/",
|
|
40
|
-
},
|
|
41
|
-
dev: {
|
|
42
|
-
domain: "https://dev-auth.credibledata.com",
|
|
43
|
-
clientId: "rr6mzJNj9b104MjCc9xWKPPehq1MJx0L",
|
|
44
|
-
audience: "https://dev-ohaafogw5p8uyx1m.us.auth0.com/api/v2/",
|
|
45
|
-
},
|
|
46
|
-
staging: {
|
|
47
|
-
domain: "https://dev-auth.credibledata.com",
|
|
48
|
-
clientId: "rr6mzJNj9b104MjCc9xWKPPehq1MJx0L",
|
|
49
|
-
audience: "https://dev-ohaafogw5p8uyx1m.us.auth0.com/api/v2/",
|
|
50
|
-
},
|
|
51
|
-
localhost: {
|
|
52
|
-
domain: "https://dev-auth.credibledata.com",
|
|
53
|
-
clientId: "rr6mzJNj9b104MjCc9xWKPPehq1MJx0L",
|
|
54
|
-
audience: "https://dev-ohaafogw5p8uyx1m.us.auth0.com/api/v2/",
|
|
55
|
-
},
|
|
56
|
-
"e2e-test": {
|
|
57
|
-
domain: "https://dev-auth.credibledata.com",
|
|
58
|
-
clientId: "atd8n8dEiGUiNRM7Geuvg41fi5s8ZKqY",
|
|
59
|
-
clientSecret:
|
|
60
|
-
"ZrEvs86WLqKO9EPp4y_cOvUn3NQT1qc3XC8111f6DBt9oyaclV5sWHz6Nkyo_bEF",
|
|
61
|
-
audience: "https://dev-ohaafogw5p8uyx1m.us.auth0.com/api/v2/",
|
|
62
|
-
},
|
|
63
|
-
videoamp: {
|
|
64
|
-
domain: "https://auth.credibledata.com",
|
|
65
|
-
clientId: "ge8JL5TJNwqy7bygAaJkD92KdluqEZgO",
|
|
66
|
-
audience: "https://ms2data.us.auth0.com/api/v2/",
|
|
67
|
-
},
|
|
68
|
-
// The DEV Auth0 tenant, not production: this cell takes its per-tier secrets from gcp/credible/dev,
|
|
69
|
-
// so it authenticates against the same tenant that dev, staging and localhost do. videoamp is the
|
|
70
|
-
// exception here, being a production cell.
|
|
71
|
-
"aws-dev": {
|
|
72
|
-
domain: "https://dev-auth.credibledata.com",
|
|
73
|
-
clientId: "rr6mzJNj9b104MjCc9xWKPPehq1MJx0L",
|
|
74
|
-
audience: "https://dev-ohaafogw5p8uyx1m.us.auth0.com/api/v2/",
|
|
75
|
-
},
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
/** Clusters a CLI org can target via `cred login <org> -c <cluster>`. */
|
|
79
|
-
export type Cluster = "gcp" | "aws";
|
|
80
|
-
|
|
81
|
-
/** Which cluster each {@link Environment} lives on. */
|
|
82
|
-
export const CLUSTER_BY_ENVIRONMENT: Record<Environment, Cluster> = {
|
|
83
|
-
production: "gcp",
|
|
84
|
-
staging: "gcp",
|
|
85
|
-
dev: "gcp",
|
|
86
|
-
localhost: "gcp",
|
|
87
|
-
"e2e-test": "gcp",
|
|
88
|
-
videoamp: "aws",
|
|
89
|
-
"aws-dev": "aws",
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Default {@link Environment} to switch to when logging into a cluster and the
|
|
94
|
-
* current active env is on a different cluster. Picked per cluster so that
|
|
95
|
-
* `cred login <org> -c aws` flips to videoamp and `-c gcp` flips to production.
|
|
96
|
-
*/
|
|
97
|
-
export const DEFAULT_ENVIRONMENT_BY_CLUSTER: Record<Cluster, Environment> = {
|
|
98
|
-
gcp: "production",
|
|
99
|
-
aws: "videoamp",
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* Per-org CLI login config. One row per org that needs non-default behavior
|
|
104
|
-
* (multi-cluster support, Auth0 Organizations PKCE, etc.). Orgs not listed here
|
|
105
|
-
* fall back to: gcp cluster only, Device Authorization Flow, no Auth0 org id.
|
|
106
|
-
*
|
|
107
|
-
* Auth0 docs: `organization` is supported on `/authorize` for Organizations
|
|
108
|
-
* (https://auth0.com/docs/manage-users/organizations/configure-organizations/use-org-name-authentication-api)
|
|
109
|
-
* but NOT on `POST /oauth/device/code`
|
|
110
|
-
* (https://auth0.com/docs/get-started/authentication-and-authorization-flow/device-authorization-flow/call-your-api-using-the-device-authorization-flow#device-code-parameters),
|
|
111
|
-
* so orgs with an `auth0OrganizationIds` entry for the active cluster use Auth Code + PKCE via
|
|
112
|
-
* {@link AUTH_CLI_LOOPBACK_REDIRECT_URI}. Keep aligned with the app's
|
|
113
|
-
* `ORGANIZATION_HOST_ORG_ID_MAP` / `getAuth0OrganizationAuthorizationParams`.
|
|
114
|
-
*/
|
|
115
|
-
export interface CliOrgConfig {
|
|
116
|
-
/** Lowercase CLI org name (what the user types after `cred login`). */
|
|
117
|
-
cliOrgName: string;
|
|
118
|
-
/** Clusters this org can be logged into. */
|
|
119
|
-
supportedClusters: Cluster[];
|
|
120
|
-
/** Cluster used when `-c/--cluster` is omitted. Must be in `supportedClusters`. */
|
|
121
|
-
defaultCluster: Cluster;
|
|
122
|
-
/**
|
|
123
|
-
* Auth0 Organization ID per cluster. Presence triggers the PKCE + `organization=<id>`
|
|
124
|
-
* `/authorize` flow on that cluster; absence falls back to Device Authorization Flow.
|
|
125
|
-
*/
|
|
126
|
-
auth0OrganizationIds?: Partial<Record<Cluster, string>>;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
const CLI_ORG_CONFIGS: CliOrgConfig[] = [
|
|
130
|
-
{
|
|
131
|
-
cliOrgName: "videoamp",
|
|
132
|
-
supportedClusters: ["gcp", "aws"],
|
|
133
|
-
defaultCluster: "gcp",
|
|
134
|
-
auth0OrganizationIds: {
|
|
135
|
-
aws: "org_nMRKafeSuxOiuJeG",
|
|
136
|
-
},
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
// Exists on both clouds -- gcp dev and the aws development cell both have a `demo` org -- so
|
|
140
|
-
// both are listed. Registered at all only because an UNREGISTERED org is assumed gcp-only
|
|
141
|
-
// (`supportedClusters ?? ["gcp"]`), which is why `cred login demo` on an aws cell reports the
|
|
142
|
-
// org as unavailable rather than anything about the cell.
|
|
143
|
-
//
|
|
144
|
-
// defaultCluster stays gcp so a bare `cred login demo` behaves exactly as it did before this
|
|
145
|
-
// entry existed; reach the aws cell with `-c aws`.
|
|
146
|
-
//
|
|
147
|
-
// No auth0OrganizationIds: their presence selects the PKCE + loopback flow, whose redirect
|
|
148
|
-
// (127.0.0.1:18240/callback) is registered on the production Auth0 tenant only. Omitting them
|
|
149
|
-
// selects the Device Authorization Flow, which needs no callback URL and therefore works on a
|
|
150
|
-
// cell authenticating against the dev tenant.
|
|
151
|
-
cliOrgName: "demo",
|
|
152
|
-
supportedClusters: ["gcp", "aws"],
|
|
153
|
-
defaultCluster: "gcp",
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
// The tenant the PROBES measure, on every cell in both clouds -- probe_organization in
|
|
157
|
-
// stacks/{aws,gcp}/services. Distinct from `demo` above, which is a cell's own first
|
|
158
|
-
// organization; a cell has both, and they were seeded by different bootstrap steps.
|
|
159
|
-
//
|
|
160
|
-
// Needed for the same reason the `demo` entry is, and missed for a reason worth naming: the
|
|
161
|
-
// gcp-only fallback (`supportedClusters ?? ["gcp"]`) makes an unregistered org work perfectly
|
|
162
|
-
// on gcp, so nothing surfaced until an operator tried to reach the fixture on an AWS cell and
|
|
163
|
-
// got "Organization 'k6-experiments' is not available on the aws cluster" -- a message about
|
|
164
|
-
// the org, for a fact about this list. Asserted against the recipe by
|
|
165
|
-
// test_probe_organization_is_reachable_on_its_cells_clusters.
|
|
166
|
-
//
|
|
167
|
-
// defaultCluster gcp and no auth0OrganizationIds, both for the reasons given on `demo`: a bare
|
|
168
|
-
// `cred login k6-experiments` keeps behaving exactly as it did before this entry existed, and
|
|
169
|
-
// the Device Authorization Flow is the one that works against a cell on the dev Auth0 tenant.
|
|
170
|
-
cliOrgName: "k6-experiments",
|
|
171
|
-
supportedClusters: ["gcp", "aws"],
|
|
172
|
-
defaultCluster: "gcp",
|
|
173
|
-
},
|
|
174
|
-
];
|
|
175
|
-
|
|
176
|
-
const CLI_ORG_CONFIGS_BY_NAME: Record<string, CliOrgConfig> =
|
|
177
|
-
Object.fromEntries(
|
|
178
|
-
CLI_ORG_CONFIGS.map((c) => [c.cliOrgName.toLowerCase(), c]),
|
|
179
|
-
);
|
|
180
|
-
|
|
181
|
-
/** Returns the registry entry for an org, or `undefined` if it uses defaults (gcp + device flow). */
|
|
182
|
-
export function getCliOrgConfig(
|
|
183
|
-
organizationName: string,
|
|
184
|
-
): CliOrgConfig | undefined {
|
|
185
|
-
return CLI_ORG_CONFIGS_BY_NAME[organizationName.toLowerCase()];
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
/**
|
|
189
|
-
* Allowlisted on the Auth0 Native application (CLI) as an Allowed Callback URL for PKCE logins
|
|
190
|
-
* that pass `organization` on `/authorize` (see Auth0 Organizations + Authentication API docs above).
|
|
191
|
-
*/
|
|
192
|
-
export const AUTH_CLI_LOOPBACK_REDIRECT_URI = "http://127.0.0.1:18240/callback";
|
|
193
|
-
|
|
194
|
-
/**
|
|
195
|
-
* Auth0 Organization ID for the given CLI org on the cluster it is logging into.
|
|
196
|
-
* Returning a value selects the Auth Code + PKCE branch in `login()`; `undefined`
|
|
197
|
-
* falls back to Device Authorization Flow.
|
|
198
|
-
*
|
|
199
|
-
* `cluster` defaults to the org's `defaultCluster` (or `gcp` for unregistered orgs)
|
|
200
|
-
* so callers that don't yet know the active cluster keep working.
|
|
201
|
-
*/
|
|
202
|
-
export function getAuth0OrganizationIdForCliLogin(
|
|
203
|
-
organizationName: string,
|
|
204
|
-
cluster?: Cluster,
|
|
205
|
-
): string | undefined {
|
|
206
|
-
const cfg = getCliOrgConfig(organizationName);
|
|
207
|
-
if (!cfg) return undefined;
|
|
208
|
-
const targetCluster = cluster ?? cfg.defaultCluster;
|
|
209
|
-
return cfg.auth0OrganizationIds?.[targetCluster];
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
// Time constants in ms
|
|
213
|
-
export const SECOND = 1000;
|
|
214
|
-
export const MINUTE = SECOND * 60;
|
|
215
|
-
export const HOUR = MINUTE * 60;
|
|
216
|
-
export const DAY = HOUR * 24;
|
|
217
|
-
|
|
218
|
-
// Login related
|
|
219
|
-
export const LOGIN_TIMEOUT_MS = MINUTE * 5;
|
|
220
|
-
|
|
221
|
-
export const ASCII_TITLE = `
|
|
222
|
-
_____ _ _ _ _ _____ _ _____
|
|
223
|
-
/ ____| | (_) | | | / ____| | |_ _|
|
|
224
|
-
| | _ __ ___ __| |_| |__ | | ___ | | | | | |
|
|
225
|
-
| | | '__/ _ \\/ _\` | | '_ \\| |/ _ \\ | | | | | |
|
|
226
|
-
| |____| | | __/ (_| | | |_) | | __/ | |____| |____ _| |_
|
|
227
|
-
\\_____|_| \\___|\\__,_|_|_.__/|_|\\___| \\_____|______|_____|
|
|
228
|
-
`;
|
package/src/index.ts
DELETED
|
@@ -1,378 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import axios from "axios";
|
|
3
|
-
import { program } from "commander";
|
|
4
|
-
import kleur from "kleur";
|
|
5
|
-
import omelette from "omelette";
|
|
6
|
-
import cliPackage from "../package.json";
|
|
7
|
-
import { ClientConfiguration } from "./clientconfiguration";
|
|
8
|
-
import { registerAddCommands } from "./commands/add";
|
|
9
|
-
import { registerGetCommands } from "./commands/get";
|
|
10
|
-
import { registerListCommands } from "./commands/list";
|
|
11
|
-
import { isLoginInvocation, login } from "./commands/misc/login";
|
|
12
|
-
import { logout } from "./commands/misc/logout";
|
|
13
|
-
import { setAccessToken } from "./commands/misc/set-access-token";
|
|
14
|
-
import { listPackages } from "./commands/package/listpackages";
|
|
15
|
-
import { publish } from "./commands/package/publish";
|
|
16
|
-
import { listEnvironments } from "./commands/environment/listenvironments";
|
|
17
|
-
import { registerRmCommands } from "./commands/rm";
|
|
18
|
-
import { registerSetCommands } from "./commands/set";
|
|
19
|
-
import { registerUpdateCommands } from "./commands/update";
|
|
20
|
-
import {
|
|
21
|
-
archiveVersion,
|
|
22
|
-
unarchiveVersion,
|
|
23
|
-
} from "./commands/version/archive-unarchive-version";
|
|
24
|
-
import { rerun } from "./commands/materialization/rerun";
|
|
25
|
-
import { cancelRun } from "./commands/materialization/cancelrun";
|
|
26
|
-
import {
|
|
27
|
-
ASCII_TITLE,
|
|
28
|
-
Cluster,
|
|
29
|
-
CLUSTER_BY_ENVIRONMENT,
|
|
30
|
-
controlPlanesByEnv,
|
|
31
|
-
DEFAULT_ENVIRONMENT_BY_CLUSTER,
|
|
32
|
-
getCliOrgConfig,
|
|
33
|
-
} from "./constants";
|
|
34
|
-
|
|
35
|
-
const clientConfig = new ClientConfiguration();
|
|
36
|
-
|
|
37
|
-
// `cred login` is the documented recovery path for a corrupt `~/.cred`, and the
|
|
38
|
-
// one command whose job is to (re)establish config. The startup reads below —
|
|
39
|
-
// the axios baseURL and every getActiveEnvironment() call during command
|
|
40
|
-
// registration — invoke loadConfig() eagerly at module load, so a corrupt
|
|
41
|
-
// config throws here, before the login action ever runs, dead-ending the very
|
|
42
|
-
// command meant to fix it. Recover up front, but ONLY for login: every other
|
|
43
|
-
// command stays fail-loud (the thrown error still names `cred login` as the
|
|
44
|
-
// fix) so a stray read never silently resets a user's tokens.
|
|
45
|
-
if (isLoginInvocation(process.argv)) {
|
|
46
|
-
clientConfig.recoverIfCorrupt();
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
const getActiveEnvironment = () => {
|
|
50
|
-
return clientConfig.getEnvironment();
|
|
51
|
-
};
|
|
52
|
-
axios.defaults.baseURL = controlPlanesByEnv[getActiveEnvironment()];
|
|
53
|
-
|
|
54
|
-
const cli = program
|
|
55
|
-
.version(
|
|
56
|
-
cliPackage.version,
|
|
57
|
-
"-V, --cli-version",
|
|
58
|
-
"Output the CLI version number",
|
|
59
|
-
)
|
|
60
|
-
.description(kleur.green(ASCII_TITLE));
|
|
61
|
-
|
|
62
|
-
// Nested CRUD commands for resource management
|
|
63
|
-
registerGetCommands(cli, getActiveEnvironment());
|
|
64
|
-
registerListCommands(cli, getActiveEnvironment());
|
|
65
|
-
registerUpdateCommands(cli, getActiveEnvironment());
|
|
66
|
-
registerRmCommands(cli, getActiveEnvironment());
|
|
67
|
-
registerAddCommands(cli, getActiveEnvironment());
|
|
68
|
-
registerSetCommands(cli);
|
|
69
|
-
|
|
70
|
-
// Root commands
|
|
71
|
-
cli.command("publish")
|
|
72
|
-
.description("Publish a new version of the package.")
|
|
73
|
-
.option("--debug")
|
|
74
|
-
.option("-y, --yes", "Skip confirmation.")
|
|
75
|
-
.option(
|
|
76
|
-
"--replication <replication_count>",
|
|
77
|
-
"The number of replicas to create.",
|
|
78
|
-
(v) => (v === undefined ? undefined : parseInt(v)),
|
|
79
|
-
undefined,
|
|
80
|
-
)
|
|
81
|
-
.option(
|
|
82
|
-
"--set-latest",
|
|
83
|
-
"Set this version as the latest version of the package.",
|
|
84
|
-
false,
|
|
85
|
-
)
|
|
86
|
-
.action((options) => {
|
|
87
|
-
publish(
|
|
88
|
-
controlPlanesByEnv[getActiveEnvironment()],
|
|
89
|
-
options.replicationCount,
|
|
90
|
-
options.debug,
|
|
91
|
-
options.yes,
|
|
92
|
-
options.setLatest,
|
|
93
|
-
);
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
cli.command("archive")
|
|
97
|
-
.description("Archive a version of a package.")
|
|
98
|
-
.argument(
|
|
99
|
-
"<packageName>",
|
|
100
|
-
"The name of the package to archive the version of.",
|
|
101
|
-
)
|
|
102
|
-
.argument("<versionId>", "The id of the version to archive.")
|
|
103
|
-
.option("--debug")
|
|
104
|
-
.option("-y, --yes", "Skip confirmation.")
|
|
105
|
-
.action((packageName, versionId, options) => {
|
|
106
|
-
archiveVersion(
|
|
107
|
-
controlPlanesByEnv[getActiveEnvironment()],
|
|
108
|
-
packageName,
|
|
109
|
-
versionId,
|
|
110
|
-
options.debug,
|
|
111
|
-
options.yes,
|
|
112
|
-
);
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
cli.command("unarchive")
|
|
116
|
-
.description("Unarchive a version of a package.")
|
|
117
|
-
.argument(
|
|
118
|
-
"<packageName>",
|
|
119
|
-
"The name of the package to unarchive the version of.",
|
|
120
|
-
)
|
|
121
|
-
.argument("<versionId>", "The id of the version to unarchive.")
|
|
122
|
-
.option("--debug")
|
|
123
|
-
.option("-y, --yes", "Skip confirmation.")
|
|
124
|
-
.action((packageName, versionId, options) => {
|
|
125
|
-
unarchiveVersion(
|
|
126
|
-
controlPlanesByEnv[getActiveEnvironment()],
|
|
127
|
-
packageName,
|
|
128
|
-
versionId,
|
|
129
|
-
options.debug,
|
|
130
|
-
options.yes,
|
|
131
|
-
);
|
|
132
|
-
});
|
|
133
|
-
|
|
134
|
-
cli.command("rerun")
|
|
135
|
-
.description(
|
|
136
|
-
"Trigger an on-demand run (rebuild/refresh) for a package version. Defaults to a full run (all sources, indexes and pre-aggregations); use --source/--dimension/--measure/--model-file to scope it to a single unit.",
|
|
137
|
-
)
|
|
138
|
-
.argument("<packageName>", "The name of the package to run.")
|
|
139
|
-
.argument("<versionId>", "The version to (re)build (e.g. 0.1.21).")
|
|
140
|
-
.option("--debug")
|
|
141
|
-
.option("-y, --yes", "Skip confirmation.")
|
|
142
|
-
.option("--source <sourceName>", "Scope the run to a single persist source.")
|
|
143
|
-
.option(
|
|
144
|
-
"--dimension <dimension>",
|
|
145
|
-
"Scope the run to a single indexed dimension.",
|
|
146
|
-
)
|
|
147
|
-
.option(
|
|
148
|
-
"--measure <measure>",
|
|
149
|
-
"Scope the run to a single pre-aggregated measure. Rebuilds the rollup serving it; add --source when the measure is declared at more than one grain.",
|
|
150
|
-
)
|
|
151
|
-
.option(
|
|
152
|
-
"--model-file <modelFilePath>",
|
|
153
|
-
"Disambiguate a dimension/source defined in more than one model file.",
|
|
154
|
-
)
|
|
155
|
-
.option(
|
|
156
|
-
"--include-upstream",
|
|
157
|
-
"Also force-rebuild the target's upstream persisted closure (only meaningful with --source/--dimension/--measure).",
|
|
158
|
-
false,
|
|
159
|
-
)
|
|
160
|
-
.action((packageName, versionId, options) => {
|
|
161
|
-
rerun(
|
|
162
|
-
controlPlanesByEnv[getActiveEnvironment()],
|
|
163
|
-
packageName,
|
|
164
|
-
versionId,
|
|
165
|
-
{
|
|
166
|
-
source: options.source,
|
|
167
|
-
dimension: options.dimension,
|
|
168
|
-
measure: options.measure,
|
|
169
|
-
modelFile: options.modelFile,
|
|
170
|
-
includeUpstream: options.includeUpstream,
|
|
171
|
-
},
|
|
172
|
-
options.debug,
|
|
173
|
-
options.yes,
|
|
174
|
-
);
|
|
175
|
-
});
|
|
176
|
-
|
|
177
|
-
cli.command("cancel-run")
|
|
178
|
-
.description("Cancel an in-flight (non-terminal) run.")
|
|
179
|
-
.argument("<packageName>", "The name of the package that owns the run.")
|
|
180
|
-
.argument("<runId>", "The id of the run to cancel.")
|
|
181
|
-
.option("--debug")
|
|
182
|
-
.option("-y, --yes", "Skip confirmation.")
|
|
183
|
-
.action((packageName, runId, options) => {
|
|
184
|
-
cancelRun(
|
|
185
|
-
controlPlanesByEnv[getActiveEnvironment()],
|
|
186
|
-
packageName,
|
|
187
|
-
runId,
|
|
188
|
-
options.debug,
|
|
189
|
-
options.yes,
|
|
190
|
-
);
|
|
191
|
-
});
|
|
192
|
-
|
|
193
|
-
cli.command("login")
|
|
194
|
-
.description("Login into Credible service.")
|
|
195
|
-
.argument("<organizationName>", "The organization to login to.")
|
|
196
|
-
.option(
|
|
197
|
-
"-c, --cluster <cluster>",
|
|
198
|
-
"Target cluster: 'gcp' or 'aws'. Defaults to the org's default cluster (gcp for most orgs).",
|
|
199
|
-
)
|
|
200
|
-
.action((organizationName, options) => {
|
|
201
|
-
const orgConfig = getCliOrgConfig(organizationName);
|
|
202
|
-
const currentEnv = clientConfig.getEnvironment();
|
|
203
|
-
|
|
204
|
-
// Determine the target cluster. Precedence:
|
|
205
|
-
// 1. Explicit -c/--cluster flag.
|
|
206
|
-
// 2. The org's defaultCluster (from CliOrgConfig), if registered.
|
|
207
|
-
// 3. The cluster of the current activeEnvironment — i.e. don't touch
|
|
208
|
-
// anything. Unregistered orgs with no flag stay wherever the user
|
|
209
|
-
// already set themselves via ms2ad set-env.
|
|
210
|
-
let cluster: Cluster;
|
|
211
|
-
if (options.cluster !== undefined) {
|
|
212
|
-
const requested = String(options.cluster).toLowerCase();
|
|
213
|
-
if (requested !== "gcp" && requested !== "aws") {
|
|
214
|
-
console.error(
|
|
215
|
-
`Invalid --cluster value '${options.cluster}'. Must be 'gcp' or 'aws'.`,
|
|
216
|
-
);
|
|
217
|
-
process.exit(1);
|
|
218
|
-
}
|
|
219
|
-
cluster = requested;
|
|
220
|
-
} else if (orgConfig) {
|
|
221
|
-
cluster = orgConfig.defaultCluster;
|
|
222
|
-
} else {
|
|
223
|
-
cluster = CLUSTER_BY_ENVIRONMENT[currentEnv];
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
// Unregistered orgs implicitly support only gcp; registered orgs declare
|
|
227
|
-
// their cluster list. Reject anything else.
|
|
228
|
-
const supportedClusters: Cluster[] = orgConfig?.supportedClusters ?? [
|
|
229
|
-
"gcp",
|
|
230
|
-
];
|
|
231
|
-
if (!supportedClusters.includes(cluster)) {
|
|
232
|
-
console.error(
|
|
233
|
-
`Organization '${organizationName}' is not available on the ${cluster} cluster.`,
|
|
234
|
-
);
|
|
235
|
-
process.exit(1);
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
// Respect a previously-set activeEnvironment if it's already on the chosen
|
|
239
|
-
// cluster (e.g. `ms2ad set-env staging && cred login demo` stays on staging).
|
|
240
|
-
// Only flip envs when the current one is on a different cluster.
|
|
241
|
-
const targetEnv =
|
|
242
|
-
CLUSTER_BY_ENVIRONMENT[currentEnv] === cluster
|
|
243
|
-
? currentEnv
|
|
244
|
-
: DEFAULT_ENVIRONMENT_BY_CLUSTER[cluster];
|
|
245
|
-
if (targetEnv !== currentEnv) {
|
|
246
|
-
clientConfig.setEnvironment(targetEnv);
|
|
247
|
-
}
|
|
248
|
-
login(
|
|
249
|
-
organizationName,
|
|
250
|
-
controlPlanesByEnv[targetEnv],
|
|
251
|
-
undefined,
|
|
252
|
-
cluster,
|
|
253
|
-
);
|
|
254
|
-
});
|
|
255
|
-
|
|
256
|
-
cli.command("logout")
|
|
257
|
-
.description("Resets Credible service credentials")
|
|
258
|
-
.action(logout);
|
|
259
|
-
|
|
260
|
-
cli.command("set-access-token")
|
|
261
|
-
.description("Set a service account JWT token for CLI authentication")
|
|
262
|
-
.argument("<jwtToken>", "The JWT token to use for authentication")
|
|
263
|
-
.option("-o, --organization <organizationName>", "Organization name to set")
|
|
264
|
-
.action((jwtToken, options) => {
|
|
265
|
-
setAccessToken(jwtToken, options.organization);
|
|
266
|
-
});
|
|
267
|
-
|
|
268
|
-
cli.command("status")
|
|
269
|
-
.description(
|
|
270
|
-
"Shows the cell this CLI targets, and the active organization and environment.",
|
|
271
|
-
)
|
|
272
|
-
.action(() => {
|
|
273
|
-
const config = new ClientConfiguration();
|
|
274
|
-
config.printStatus();
|
|
275
|
-
});
|
|
276
|
-
|
|
277
|
-
const complete = omelette("credible").tree({
|
|
278
|
-
// CRUD commands
|
|
279
|
-
get: [
|
|
280
|
-
"environment",
|
|
281
|
-
"project",
|
|
282
|
-
"group",
|
|
283
|
-
"permission",
|
|
284
|
-
"materialization",
|
|
285
|
-
"index",
|
|
286
|
-
"run",
|
|
287
|
-
],
|
|
288
|
-
ls: [
|
|
289
|
-
"environment",
|
|
290
|
-
"project",
|
|
291
|
-
"connection",
|
|
292
|
-
"package",
|
|
293
|
-
"version",
|
|
294
|
-
"materialization",
|
|
295
|
-
"index",
|
|
296
|
-
"run",
|
|
297
|
-
"group",
|
|
298
|
-
"group-access-token",
|
|
299
|
-
"permission",
|
|
300
|
-
],
|
|
301
|
-
update: ["environment", "project", "package"],
|
|
302
|
-
rm: [
|
|
303
|
-
"environment",
|
|
304
|
-
"project",
|
|
305
|
-
"connection",
|
|
306
|
-
"package",
|
|
307
|
-
"group",
|
|
308
|
-
"member",
|
|
309
|
-
"group-access-token",
|
|
310
|
-
"permission",
|
|
311
|
-
],
|
|
312
|
-
add: [
|
|
313
|
-
"environment",
|
|
314
|
-
"project",
|
|
315
|
-
"connection",
|
|
316
|
-
"group",
|
|
317
|
-
"member",
|
|
318
|
-
"group-access-token",
|
|
319
|
-
"permission",
|
|
320
|
-
],
|
|
321
|
-
// Misc commands
|
|
322
|
-
set: ["environment", "project"],
|
|
323
|
-
login: [],
|
|
324
|
-
logout: [],
|
|
325
|
-
"set-access-token": [],
|
|
326
|
-
status: [],
|
|
327
|
-
publish: [],
|
|
328
|
-
archive: [],
|
|
329
|
-
unarchive: [],
|
|
330
|
-
rerun: [],
|
|
331
|
-
"cancel-run": [],
|
|
332
|
-
});
|
|
333
|
-
|
|
334
|
-
complete.onAsync("$3", async ({ reply, line }) => {
|
|
335
|
-
const environmentRelatedCommands = [
|
|
336
|
-
"set environment",
|
|
337
|
-
"get environment",
|
|
338
|
-
"rm environment",
|
|
339
|
-
"set project",
|
|
340
|
-
"get project",
|
|
341
|
-
"rm project",
|
|
342
|
-
];
|
|
343
|
-
if (environmentRelatedCommands.some((cmd) => line.includes(cmd))) {
|
|
344
|
-
reply(
|
|
345
|
-
listEnvironments(
|
|
346
|
-
controlPlanesByEnv[getActiveEnvironment()],
|
|
347
|
-
false,
|
|
348
|
-
).then((result) =>
|
|
349
|
-
result.projects.map((environment) => environment.name),
|
|
350
|
-
),
|
|
351
|
-
);
|
|
352
|
-
}
|
|
353
|
-
const packageRelatedCommands = ["rm package", "ls version"];
|
|
354
|
-
if (packageRelatedCommands.some((cmd) => line.includes(cmd))) {
|
|
355
|
-
reply(
|
|
356
|
-
listPackages(controlPlanesByEnv[getActiveEnvironment()], false).then(
|
|
357
|
-
(result) => result.packages.map((_package) => _package.name),
|
|
358
|
-
),
|
|
359
|
-
);
|
|
360
|
-
}
|
|
361
|
-
});
|
|
362
|
-
|
|
363
|
-
complete.next(() => {
|
|
364
|
-
program.parse(process.argv);
|
|
365
|
-
});
|
|
366
|
-
|
|
367
|
-
if (~process.argv.indexOf("--cleanup")) {
|
|
368
|
-
complete.cleanupShellInitFile();
|
|
369
|
-
process.exit(0);
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
if (~process.argv.indexOf("--install")) {
|
|
373
|
-
complete.setupShellInitFile();
|
|
374
|
-
console.log("CLI installed successfully!");
|
|
375
|
-
process.exit(0);
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
complete.init();
|