@codiac.io/codiac-cli 1.2.256 → 1.2.257
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 +1 -1
- package/dist/apis/codiac-api/gen/contracts.d.ts +5 -1
- package/dist/apis/codiac-api/gen/contracts.js +3 -0
- package/dist/apis/codiac-api/gen/contracts.js.map +1 -1
- package/dist/apis/codiac-relay/gen/client.d.ts +5 -1
- package/dist/apis/codiac-relay/gen/client.js +28 -0
- package/dist/apis/codiac-relay/gen/client.js.map +1 -1
- package/dist/apis/codiac-relay/gen/contracts.d.ts +19 -6
- package/dist/apis/codiac-relay/gen/contracts.js +1 -0
- package/dist/apis/codiac-relay/gen/contracts.js.map +1 -1
- package/dist/cli-common/argument-manager.d.ts +1 -1
- package/dist/cli-common/built-in-cli-user-input.d.ts +3 -2
- package/dist/cli-common/built-in-cli-user-input.js +3 -1
- package/dist/cli-common/built-in-cli-user-input.js.map +1 -1
- package/dist/cli-common/command-base.d.ts +1 -2
- package/dist/cli-common/command-base.js +13 -11
- package/dist/cli-common/command-base.js.map +1 -1
- package/dist/cli-common/entities/prompt-choice.d.ts +6 -2
- package/dist/cli-common/mock-ui.d.ts +2 -2
- package/dist/cli-common/mock-ui.js.map +1 -1
- package/dist/cli-common/prompt-select-fuzzy.d.ts +4 -5
- package/dist/cli-common/prompt-select-fuzzy.js +11 -9
- package/dist/cli-common/prompt-select-fuzzy.js.map +1 -1
- package/dist/cli-common/test/tenant-contextualizer.spec.js +2 -2
- package/dist/command-base-enterprise.d.ts +3 -3
- package/dist/command-base-enterprise.js +38 -22
- package/dist/command-base-enterprise.js.map +1 -1
- package/dist/command-base-exec.js.map +1 -1
- package/dist/command-base-tenantless.js +2 -2
- package/dist/command-base-tenantless.js.map +1 -1
- package/dist/commands/asset/create.d.ts +16 -1
- package/dist/commands/asset/create.js +239 -85
- package/dist/commands/asset/create.js.map +1 -1
- package/dist/commands/asset/deploy.d.ts +0 -4
- package/dist/commands/asset/deploy.js +3 -15
- package/dist/commands/asset/deploy.js.map +1 -1
- package/dist/commands/asset/destroy.js +3 -3
- package/dist/commands/asset/destroy.js.map +1 -1
- package/dist/commands/asset/recycle.js +5 -5
- package/dist/commands/asset/recycle.js.map +1 -1
- package/dist/commands/asset/view.d.ts +9 -6
- package/dist/commands/asset/view.js +220 -127
- package/dist/commands/asset/view.js.map +1 -1
- package/dist/commands/cabinet/create.js +20 -21
- package/dist/commands/cabinet/create.js.map +1 -1
- package/dist/commands/cabinet/obliterate.js +1 -1
- package/dist/commands/cabinet/obliterate.js.map +1 -1
- package/dist/commands/config/add.js +47 -24
- package/dist/commands/config/add.js.map +1 -1
- package/dist/commands/config/delete.js +8 -7
- package/dist/commands/config/delete.js.map +1 -1
- package/dist/commands/config/deploy.d.ts +2 -2
- package/dist/commands/config/deploy.js +121 -64
- package/dist/commands/config/deploy.js.map +1 -1
- package/dist/commands/config/import.d.ts +19 -5
- package/dist/commands/config/import.js +112 -52
- package/dist/commands/config/import.js.map +1 -1
- package/dist/commands/config/settings/get.js +7 -6
- package/dist/commands/config/settings/get.js.map +1 -1
- package/dist/commands/config/view.js +11 -4
- package/dist/commands/config/view.js.map +1 -1
- package/dist/commands/csp/login.js +3 -3
- package/dist/commands/csp/login.js.map +1 -1
- package/dist/commands/dep/list.js +2 -1
- package/dist/commands/dep/list.js.map +1 -1
- package/dist/commands/deploy.js +2 -2
- package/dist/commands/deploy.js.map +1 -1
- package/dist/commands/env/add.d.ts +1 -1
- package/dist/commands/env/add.js +12 -12
- package/dist/commands/env/add.js.map +1 -1
- package/dist/commands/filestore/capture.js +22 -4
- package/dist/commands/filestore/capture.js.map +1 -1
- package/dist/commands/host/list.d.ts +30 -0
- package/dist/commands/host/list.js +106 -0
- package/dist/commands/host/list.js.map +1 -0
- package/dist/commands/host/map.js +7 -1
- package/dist/commands/host/map.js.map +1 -1
- package/dist/commands/host/view.d.ts +31 -0
- package/dist/commands/host/view.js +111 -0
- package/dist/commands/host/view.js.map +1 -0
- package/dist/commands/init.js +1 -2
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/kit/create.js +1 -1
- package/dist/commands/kit/create.js.map +1 -1
- package/dist/commands/login.js +3 -3
- package/dist/commands/login.js.map +1 -1
- package/dist/commands/noc/cluster/deinit.d.ts +1 -0
- package/dist/commands/noc/cluster/deinit.js +4 -3
- package/dist/commands/noc/cluster/deinit.js.map +1 -1
- package/dist/commands/noc/cluster/destroy.js +3 -3
- package/dist/commands/noc/cluster/destroy.js.map +1 -1
- package/dist/commands/noc/cluster/forget.js +4 -4
- package/dist/commands/noc/cluster/forget.js.map +1 -1
- package/dist/commands/noc/cluster/grant.js +2 -2
- package/dist/commands/noc/cluster/grant.js.map +1 -1
- package/dist/commands/noc/cluster/init.js +3 -3
- package/dist/commands/noc/cluster/init.js.map +1 -1
- package/dist/commands/noc/cluster/recreate.js +2 -2
- package/dist/commands/noc/cluster/recreate.js.map +1 -1
- package/dist/commands/publish.js +3 -2
- package/dist/commands/publish.js.map +1 -1
- package/dist/ops/INTERFACES_CLI.d.ts +7 -1
- package/dist/ops/INTERFACES_CLI.js +7 -0
- package/dist/ops/INTERFACES_CLI.js.map +1 -1
- package/dist/ops/LocalOps.js +29 -28
- package/dist/ops/LocalOps.js.map +1 -1
- package/dist/ops/cli-path-walker.d.ts +18 -0
- package/dist/ops/cli-path-walker.js +58 -53
- package/dist/ops/cli-path-walker.js.map +1 -1
- package/dist/ops/data/cli-context-repo.js +11 -9
- package/dist/ops/data/cli-context-repo.js.map +1 -1
- package/dist/ops/i-entry-validator.d.ts +21 -0
- package/dist/ops/i-entry-validator.js +3 -0
- package/dist/ops/i-entry-validator.js.map +1 -0
- package/dist/ops/i-identity-handler.js +2 -2
- package/dist/ops/i-identity-handler.js.map +1 -1
- package/dist/ops/i-output-styler.d.ts +15 -0
- package/dist/ops/i-output-styler.js +1 -15
- package/dist/ops/i-output-styler.js.map +1 -1
- package/dist/ops/i-user-input-provider.d.ts +56 -0
- package/dist/ops/i-user-input-provider.js +12 -0
- package/dist/ops/i-user-input-provider.js.map +1 -0
- package/dist/ops/index.d.ts +8 -0
- package/dist/ops/index.js +8 -0
- package/dist/ops/index.js.map +1 -1
- package/dist/ops/no-style-output-styler.d.ts +12 -0
- package/dist/ops/no-style-output-styler.js +34 -28
- package/dist/ops/no-style-output-styler.js.map +1 -1
- package/dist/ops/ops-constants.d.ts +7 -0
- package/dist/ops/ops-constants.js +12 -0
- package/dist/ops/ops-constants.js.map +1 -0
- package/dist/ops/test/mock-ui.d.ts +1 -1
- package/dist/ops/test/when-git-branchline-is-attempted.spec.js +5 -4
- package/dist/ops/test/when-git-branchline-is-attempted.spec.js.map +1 -1
- package/dist/ops/test/when-versions-are-parsed.spec.js +3 -2
- package/dist/ops/test/when-versions-are-parsed.spec.js.map +1 -1
- package/dist/ops/throwing-user-input-provider.d.ts +24 -0
- package/dist/ops/throwing-user-input-provider.js +65 -35
- package/dist/ops/throwing-user-input-provider.js.map +1 -1
- package/dist/prettify.js.map +1 -1
- package/dist/relay/contracts/contracts.d.ts +2 -20
- package/dist/relay/contracts/contracts.js +24 -30
- package/dist/relay/contracts/contracts.js.map +1 -1
- package/dist/relay/extended-relay-client.d.ts +0 -27
- package/dist/relay/extended-relay-client.js +36 -26
- package/dist/relay/extended-relay-client.js.map +1 -1
- package/dist/relay/relay-container.d.ts +1 -1
- package/dist/relay/relay-container.js +5 -5
- package/dist/relay/relay-container.js.map +1 -1
- package/dist/uilogic/build-configurator.d.ts +1 -1
- package/dist/uilogic/build-configurator.js +3 -3
- package/dist/uilogic/build-configurator.js.map +1 -1
- package/dist/uilogic/cloud-provider-contextualizer.d.ts +2 -4
- package/dist/uilogic/cloud-provider-contextualizer.js +9 -15
- package/dist/uilogic/cloud-provider-contextualizer.js.map +1 -1
- package/dist/uilogic/cloud-resource-configurator-factory.js +5 -0
- package/dist/uilogic/cloud-resource-configurator-factory.js.map +1 -1
- package/dist/uilogic/cloud-resource-configurators/aws-resource-configurator.d.ts +3 -4
- package/dist/uilogic/cloud-resource-configurators/aws-resource-configurator.js +10 -13
- package/dist/uilogic/cloud-resource-configurators/aws-resource-configurator.js.map +1 -1
- package/dist/uilogic/cloud-resource-configurators/az-interactive-login-configurator.d.ts +2 -1
- package/dist/uilogic/cloud-resource-configurators/az-interactive-login-configurator.js +4 -3
- package/dist/uilogic/cloud-resource-configurators/az-interactive-login-configurator.js.map +1 -1
- package/dist/uilogic/cloud-resource-configurators/azure-resource-configurator.d.ts +3 -4
- package/dist/uilogic/cloud-resource-configurators/azure-resource-configurator.js +27 -24
- package/dist/uilogic/cloud-resource-configurators/azure-resource-configurator.js.map +1 -1
- package/dist/uilogic/cloud-resource-configurators/docker-hub-resource-configurator.d.ts +1 -1
- package/dist/uilogic/cloud-resource-configurators/docker-hub-resource-configurator.js +3 -3
- package/dist/uilogic/cloud-resource-configurators/docker-hub-resource-configurator.js.map +1 -1
- package/dist/uilogic/cloud-resource-configurators/helm-resource-configurator.d.ts +2 -2
- package/dist/uilogic/cloud-resource-configurators/helm-resource-configurator.js +7 -4
- package/dist/uilogic/cloud-resource-configurators/helm-resource-configurator.js.map +1 -1
- package/dist/uilogic/cloud-resource-configurators/unsupported-resource-configurator.d.ts +1 -1
- package/dist/uilogic/cloud-resource-configurators/unsupported-resource-configurator.js +2 -2
- package/dist/uilogic/cloud-resource-configurators/unsupported-resource-configurator.js.map +1 -1
- package/dist/uilogic/config-ui-utils.d.ts +3 -3
- package/dist/uilogic/config-ui-utils.js +24 -13
- package/dist/uilogic/config-ui-utils.js.map +1 -1
- package/dist/uilogic/enterprise-contextualizer.d.ts +1 -1
- package/dist/uilogic/environment-contextualizer.d.ts +1 -1
- package/dist/uilogic/image-configurator.d.ts +2 -2
- package/dist/uilogic/image-configurator.js +1 -1
- package/dist/uilogic/image-configurator.js.map +1 -1
- package/dist/uilogic/image-contextualizer.d.ts +1 -1
- package/dist/uilogic/image-contextualizer.js +11 -6
- package/dist/uilogic/image-contextualizer.js.map +1 -1
- package/dist/uilogic/image-registry-contextualizer.d.ts +7 -1
- package/dist/uilogic/image-registry-contextualizer.js +56 -3
- package/dist/uilogic/image-registry-contextualizer.js.map +1 -1
- package/dist/uilogic/prompt-select-fuzzy.js +3 -3
- package/dist/uilogic/prompt-select-fuzzy.js.map +1 -1
- package/dist/uilogic/render-methods.d.ts +1 -0
- package/dist/uilogic/render-methods.js +2 -1
- package/dist/uilogic/render-methods.js.map +1 -1
- package/dist/uilogic/rootmap-ui-utils.d.ts +28 -8
- package/dist/uilogic/rootmap-ui-utils.js +132 -8
- package/dist/uilogic/rootmap-ui-utils.js.map +1 -1
- package/dist/uilogic/tenant-contextualizer.d.ts +1 -1
- package/dist/user-context-loader.js +4 -3
- package/dist/user-context-loader.js.map +1 -1
- package/oclif.manifest.json +210 -28
- package/package.json +4 -5
- package/dist/cli-common/i-user-input-provider.d.ts +0 -0
- package/dist/cli-common/i-user-input-provider.js +0 -19
- package/dist/cli-common/i-user-input-provider.js.map +0 -1
- package/dist/cli-common/tenant-contextualizer.d.ts +0 -0
- package/dist/cli-common/tenant-contextualizer.js +0 -436
- package/dist/cli-common/tenant-contextualizer.js.map +0 -1
- package/dist/ops/docker-registry-api-client/docker-registry-api-client.d.ts +0 -0
- package/dist/ops/docker-registry-api-client/docker-registry-api-client.js +0 -289
- package/dist/ops/docker-registry-api-client/docker-registry-api-client.js.map +0 -1
- package/dist/uilogic/cloud-resource-configurators/az-acr-cli-authenticator.d.ts +0 -0
- package/dist/uilogic/cloud-resource-configurators/az-acr-cli-authenticator.js +0 -78
- package/dist/uilogic/cloud-resource-configurators/az-acr-cli-authenticator.js.map +0 -1
|
@@ -5,12 +5,14 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const path = require("path");
|
|
6
6
|
const fs = require("fs");
|
|
7
7
|
const Case = require("case");
|
|
8
|
+
const inversify_1 = require("inversify");
|
|
8
9
|
const codiac_common_1 = require("@codiac.io/codiac-common");
|
|
9
10
|
const codiac_relay_contracts_1 = require("@codiac.io/codiac-relay-contracts");
|
|
10
11
|
const codiac_ops_common_1 = require("@codiac.io/codiac-ops-common");
|
|
11
12
|
const entities_1 = require("../entities");
|
|
13
|
+
const cli_path_walker_1 = require("../cli-path-walker");
|
|
14
|
+
const ops_constants_1 = require("../ops-constants");
|
|
12
15
|
const dx_constants_1 = require("../dx-constants");
|
|
13
|
-
const inversify_1 = require("inversify");
|
|
14
16
|
/** Performs cruds on an entity stored on the local hard drive as single json file.
|
|
15
17
|
*/
|
|
16
18
|
let JsonFileRepoFor = class JsonFileRepoFor {
|
|
@@ -172,8 +174,8 @@ let ProjectContextRepo = class ProjectContextRepo {
|
|
|
172
174
|
/** Deserializes the Toyhauler config file in scope for the current working directory.
|
|
173
175
|
* Throws if none is defined up the folder tree. */
|
|
174
176
|
readProjectConfig(folder) {
|
|
175
|
-
let root = folder ?
|
|
176
|
-
let targetFile = path.join(root,
|
|
177
|
+
let root = folder ? cli_path_walker_1.CliPathWalker.getProjectRoot(folder) : this.projRoot;
|
|
178
|
+
let targetFile = path.join(root, ops_constants_1.OpsConstants.PROJECT_CONFIG_FILENAME);
|
|
177
179
|
let contents = fs.readFileSync(targetFile, { encoding: "utf-8" });
|
|
178
180
|
let raw = JSON.parse(contents); // this doesnt run the ctor.
|
|
179
181
|
let config = Object.assign(new codiac_relay_contracts_1.ProjectConfig(raw.name, raw.tenantCode, dx_constants_1.DxConstants.DEFAULT_INIT_CODE_VERSION), raw);
|
|
@@ -201,7 +203,7 @@ let ProjectContextRepo = class ProjectContextRepo {
|
|
|
201
203
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
202
204
|
return new Promise((resolve, reject) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
203
205
|
try {
|
|
204
|
-
let pathName = path.join(this.projRoot,
|
|
206
|
+
let pathName = path.join(this.projRoot, ops_constants_1.OpsConstants.PROJECT_CONFIG_FILENAME);
|
|
205
207
|
codiac_ops_common_1.JsonUtils.serializeJsonFile(config, pathName);
|
|
206
208
|
resolve();
|
|
207
209
|
}
|
|
@@ -218,7 +220,7 @@ let ProjectContextRepo = class ProjectContextRepo {
|
|
|
218
220
|
let folder = process.cwd();
|
|
219
221
|
let projectName = Case.kebab(path.basename(folder));
|
|
220
222
|
let config = seed || new codiac_relay_contracts_1.ProjectConfig(projectName, dx_constants_1.DxConstants.UNREGISTERED_TENANT_CODE, dx_constants_1.DxConstants.DEFAULT_INIT_CODE_VERSION);
|
|
221
|
-
let targetFile = path.join(folder,
|
|
223
|
+
let targetFile = path.join(folder, ops_constants_1.OpsConstants.PROJECT_CONFIG_FILENAME);
|
|
222
224
|
// try {
|
|
223
225
|
fs.writeFileSync(targetFile, JSON.stringify(config, undefined, ' '));
|
|
224
226
|
// } catch (err) {
|
|
@@ -236,8 +238,8 @@ let ProjectContextRepo = class ProjectContextRepo {
|
|
|
236
238
|
*/
|
|
237
239
|
readProjectUserConfig() {
|
|
238
240
|
let projectRoot = this.projRoot; // || CliPathWalker.getProjectRoot();
|
|
239
|
-
let userConfigFolder = path.join(projectRoot,
|
|
240
|
-
let sourceFile = path.join(userConfigFolder,
|
|
241
|
+
let userConfigFolder = path.join(projectRoot, ops_constants_1.OpsConstants.PROJECT_USER_CONFIG_FOLDER_NAME);
|
|
242
|
+
let sourceFile = path.join(userConfigFolder, ops_constants_1.OpsConstants.PROJECT_USER_CONFIG_FILENAME);
|
|
241
243
|
let config = new codiac_relay_contracts_1.ProjectUserConfig();
|
|
242
244
|
if (fs.existsSync(sourceFile)) {
|
|
243
245
|
let contents = fs.readFileSync(sourceFile, { encoding: "utf-8" });
|
|
@@ -249,8 +251,8 @@ let ProjectContextRepo = class ProjectContextRepo {
|
|
|
249
251
|
/** Serializes the given config to a file in the project user folder. */
|
|
250
252
|
writeProjectUserConfig(config) {
|
|
251
253
|
let projectRoot = this.projRoot;
|
|
252
|
-
let userConfigFolder = path.join(projectRoot,
|
|
253
|
-
let targetFile = path.join(userConfigFolder,
|
|
254
|
+
let userConfigFolder = path.join(projectRoot, ops_constants_1.OpsConstants.PROJECT_USER_CONFIG_FOLDER_NAME);
|
|
255
|
+
let targetFile = path.join(userConfigFolder, ops_constants_1.OpsConstants.PROJECT_USER_CONFIG_FILENAME);
|
|
254
256
|
// try {
|
|
255
257
|
if (!fs.existsSync(userConfigFolder)) {
|
|
256
258
|
fs.mkdirSync(userConfigFolder, { recursive: true });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-context-repo.js","sourceRoot":"","sources":["../../../src/ops/data/cli-context-repo.ts"],"names":[],"mappings":";;;;AAAA,6BAA6B;AAC7B,yBAAyB;AACzB,6BAA6B;
|
|
1
|
+
{"version":3,"file":"cli-context-repo.js","sourceRoot":"","sources":["../../../src/ops/data/cli-context-repo.ts"],"names":[],"mappings":";;;;AAAA,6BAA6B;AAC7B,yBAAyB;AACzB,6BAA6B;AAC7B,yCAA0D;AAE1D,4DAAsD;AACtD,8EAAqF;AACrF,oEAAyD;AAEzD,0CAAkE;AAClE,wDAAmD;AACnD,oDAAgD;AAChD,kDAA8C;AAI9C;GACG;AAEI,IAAe,eAAe,GAA9B,MAAe,eAAe;IACnC,YAAmC,QAAyB;QAAzB,aAAQ,GAAR,QAAQ,CAAiB;IAC5D,CAAC;CAEF,CAAA;AAJqB,eAAe;IADpC,IAAA,sBAAU,GAAE;IAEE,mBAAA,IAAA,qBAAS,GAAE,CAAA;;GADJ,eAAe,CAIpC;AAJqB,0CAAe;AAc9B,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,eAA0B;IACjE,YAA+B,SAAoB;QACjD,KAAK,CAAC,EAAE,YAAY,EAAE,SAAS,CAAC,YAAY,EAAE,QAAQ,EAAE,oBAAS,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC9E,IAAI,CAAC,cAAc,GAAG,IAAA,0BAAU,EAAC,oBAAS,CAAC,CAAC;IAC9C,CAAC;IAGD,oFAAoF;IAEpF;;OAEG;IACU,IAAI;;YACf,OAAO,IAAI,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AAC;QAChC,IAAI,gBAAgB,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,4BAAY,CAAC,+BAA+B,CAAC,CAAC;QAC5F,IAAI,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,4BAAY,CAAC,4BAA4B,CAAC,CAAC;QACxF,QAAQ;QACR,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE;YACpC,EAAE,CAAC,SAAS,CAAC,gBAAgB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;SACpD;QACD,EAAE,CAAC,aAAa,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC,CAAA;QACrE,kBAAkB;QAClB,sDAAsD;QACtD,IAAI;IACN,CAAC;CAGF,CAAA;AA/KY,kBAAkB;IAD9B,IAAA,sBAAU,GAAE;IAEE,mBAAA,IAAA,kBAAM,EAAC,wBAAa,CAAC,CAAA;6CAAgB,wBAAa;GADpD,kBAAkB,CA+K9B;AA/KY,gDAAkB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { EntryValue } from "./i-user-input-provider";
|
|
2
|
+
export type ValidationResult = {
|
|
3
|
+
isValid: boolean;
|
|
4
|
+
/** Message for user describing the requirements (*best with syntax starting with "must be..."*)
|
|
5
|
+
*
|
|
6
|
+
* eg: `whyInvalid = "Must be 1-50 alphanumerics starting with a letter"`
|
|
7
|
+
*/
|
|
8
|
+
whyInvalid?: string;
|
|
9
|
+
};
|
|
10
|
+
export interface IEntryValidator<T extends EntryValue> {
|
|
11
|
+
isValid: (candidate: T | undefined) => ValidationResult;
|
|
12
|
+
}
|
|
13
|
+
export interface IStringEntryValidator extends IEntryValidator<string> {
|
|
14
|
+
isValid: (candidate: string | undefined) => ValidationResult;
|
|
15
|
+
}
|
|
16
|
+
export interface INumberEntryValidator extends IEntryValidator<number> {
|
|
17
|
+
isValid: (candidate: number | undefined) => ValidationResult;
|
|
18
|
+
}
|
|
19
|
+
export interface IBooleanEntryValidator extends IEntryValidator<boolean> {
|
|
20
|
+
isValid: (candidate: boolean | undefined) => ValidationResult;
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i-entry-validator.js","sourceRoot":"","sources":["../../src/ops/i-entry-validator.ts"],"names":[],"mappings":""}
|
|
@@ -9,7 +9,7 @@ const npmjs_identity_adapter_1 = require("./extensions/npmjs-identity-adapter");
|
|
|
9
9
|
const azart_identity_adapter_1 = require("./extensions/azart-identity-adapter");
|
|
10
10
|
const npm_config_repo_1 = require("./data/npm-config-repo");
|
|
11
11
|
const dx_constants_1 = require("./dx-constants");
|
|
12
|
-
const
|
|
12
|
+
const ops_constants_1 = require("./ops-constants");
|
|
13
13
|
/** Oversees the work required for all identity types,
|
|
14
14
|
* and ensures that identities are managed by the proper IIdentityHandler.
|
|
15
15
|
* Use this class to perform work on identities.
|
|
@@ -70,7 +70,7 @@ class IdentityAggregator {
|
|
|
70
70
|
// 1) Write the identities to the user npmrc file as before
|
|
71
71
|
// Gather up what was in the existing user config
|
|
72
72
|
// stripped of any auth tokens or scope variables
|
|
73
|
-
let userNpmrcRelPath = path.join(
|
|
73
|
+
let userNpmrcRelPath = path.join(ops_constants_1.OpsConstants.PROJECT_USER_CONFIG_FOLDER_NAME, dx_constants_1.DxConstants.NPM_PROJECT_USER_CONFIG_FILENAME);
|
|
74
74
|
let userNpmrcAbsPath = path.join(this._projectRoot, userNpmrcRelPath);
|
|
75
75
|
let existingTokenSettings = yield npmRepo.loadNpmrc(userNpmrcAbsPath);
|
|
76
76
|
let userNpmrc = npmRepo.scrubRegistriesFrom(existingTokenSettings);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i-identity-handler.js","sourceRoot":"","sources":["../../src/ops/i-identity-handler.ts"],"names":[],"mappings":";;;;AAAA,6BAA6B;AAC7B,4BAA6B;AAG7B,8EA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E;YAChB,KAAK,yCAAgB,CAAC,GAAG;gBACvB,OAAO,IAAI,6CAAoB,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;gBACrD,+CAA+C;gBAC/C,8DAA8D;gBAC9D,8DAA8D;gBAC9D,mBAAmB;gBACnB,MAAM;YAER,KAAK,yCAAgB,CAAC,KAAK;gBACzB,OAAO,IAAI,6CAAoB,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;YAEvD,gCAAgC;YAChC,oDAAoD;YACpD,gEAAgE;YAChE,iFAAiF;YACjF,qBAAqB;YACrB,WAAW;YAEX,KAAK,yCAAgB,CAAC,KAAK;gBACzB,iDAAiD;gBACjD,MAAM;SACT;IACH,CAAC;;AAnCH,0DAoCC;AA3Be,0CAAkB,GAAa,uBAAuB,CAAC,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Abstraction of the UX layer for marking up text output for readability and emphasis. */
|
|
2
|
+
export interface IOutputStyler {
|
|
3
|
+
/** Explicitly makes the content bold to enhance visibility and emphasis of the given content. */
|
|
4
|
+
bold(content: string): string;
|
|
5
|
+
/** Treatment for de-emphasizing the given content (eg: colored grey). */
|
|
6
|
+
dim(content: string): string;
|
|
7
|
+
/** Treatment for drawing quick attention to a bit of info (eg: bold and/or blue) */
|
|
8
|
+
hilite(content: string): string;
|
|
9
|
+
/** Color used for instnctive recognition of successes and other positive results (eg: green). */
|
|
10
|
+
colorGood(content: string): string;
|
|
11
|
+
/** Color used for instnctive recognition of cautions and other potentially bad news (eg: yellow/orange). */
|
|
12
|
+
colorWarning(content: string): string;
|
|
13
|
+
/** Color used for instnctive recognition of failures and other actual bad news (eg: red). */
|
|
14
|
+
colorCritical(content: string): string;
|
|
15
|
+
}
|
|
@@ -1,17 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
// export interface IOutputStyler {
|
|
4
|
-
// /** Explicitly makes the content bold to enhance visibility and emphasis of the given content. */
|
|
5
|
-
// bold(content: string): string;
|
|
6
|
-
// /** Treatment for de-emphasizing the given content (eg: colored grey). */
|
|
7
|
-
// dim(content: string): string;
|
|
8
|
-
// /** Treatment for drawing quick attention to a bit of info (eg: bold and/or blue) */
|
|
9
|
-
// hilite(content: string): string;
|
|
10
|
-
// /** Color used for instnctive recognition of successes and other positive results (eg: green). */
|
|
11
|
-
// colorGood(content: string): string;
|
|
12
|
-
// /** Color used for instnctive recognition of cautions and other potentially bad news (eg: yellow/orange). */
|
|
13
|
-
// colorWarning(content: string): string;
|
|
14
|
-
// /** Color used for instnctive recognition of failures and other actual bad news (eg: red). */
|
|
15
|
-
// colorCritical(content: string): string;
|
|
16
|
-
// }
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
3
|
//# sourceMappingURL=i-output-styler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i-output-styler.js","sourceRoot":"","sources":["../../src/ops/i-output-styler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"i-output-styler.js","sourceRoot":"","sources":["../../src/ops/i-output-styler.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import * as inquirer from "inquirer";
|
|
2
|
+
import { IEntryValidator } from "../ops/i-entry-validator";
|
|
3
|
+
export type EntryValue = string | number | boolean;
|
|
4
|
+
export type choice<T extends EntryValue> = T | {
|
|
5
|
+
name: string;
|
|
6
|
+
value?: T;
|
|
7
|
+
};
|
|
8
|
+
/** User interaction parameters for capturing a reference to a physical folder. */
|
|
9
|
+
export declare class FolderSelectionOptions {
|
|
10
|
+
/** The path under which the user is allowed to navigate (optional: Defaults to the current path).
|
|
11
|
+
* This path is also acts as the parent folder from which any relative path gets derived. */
|
|
12
|
+
root?: string;
|
|
13
|
+
/** The folder to begin the search within (optional: defaults to the current path) */
|
|
14
|
+
startingPath?: string;
|
|
15
|
+
/** Causes the selection to be returned as a path relative to "root" (optional: defaults to false). */
|
|
16
|
+
asRelative?: boolean;
|
|
17
|
+
}
|
|
18
|
+
/** User interaction parameters for capturing a reference to a physical file. */
|
|
19
|
+
export declare class FileSelectionOptions extends FolderSelectionOptions {
|
|
20
|
+
/** List of file extensions (without the period '.') on which to filter the available files. */
|
|
21
|
+
extensions?: string[];
|
|
22
|
+
}
|
|
23
|
+
/** Provides direct interaction with the user. */
|
|
24
|
+
export interface IUserInputProvider {
|
|
25
|
+
/** Renders a message to the user (DOES NOT LOG the message). */
|
|
26
|
+
userMessage(message: string): void;
|
|
27
|
+
/** @param id Identifies the prompt for internal use, esp in mocking. This value never renders to the user. */
|
|
28
|
+
prompt<T extends EntryValue>(id: string, prompt: string, required?: boolean, defaultValue?: T, validator?: IEntryValidator<T>): Promise<T | undefined>;
|
|
29
|
+
/** @param id Identifies the prompt for internal use, esp in mocking. This value never renders to the user. */
|
|
30
|
+
promptPassword(id: string, prompt: string, defaultValue?: string, validator?: IEntryValidator<string>): Promise<string>;
|
|
31
|
+
/**
|
|
32
|
+
* @param id Identifies the prompt for internal use, esp in mocking. This value never renders to the user.
|
|
33
|
+
* @param loop (optional, defaults to true) Setting to false will disable continuous circular scrolling through the available select choices.
|
|
34
|
+
*/
|
|
35
|
+
promptSelect<T extends EntryValue>(id: string, prompt: string, choices: choice<T>[], multiSelect?: boolean, loop?: boolean | undefined): Promise<T | undefined>;
|
|
36
|
+
promptSelect<T extends EntryValue>(id: string, prompt: string, choices: choice<T>[], multiSelect?: boolean, loop?: boolean | undefined, validator?: (input: T, answers?: inquirer.Answers | undefined) => boolean | string): Promise<T | undefined>;
|
|
37
|
+
/** Enables the user to retrieves a reference to a single existing file on the local machine.
|
|
38
|
+
* @param id Identifies the prompt for internal use, esp in mocking. This value never renders to the user. */
|
|
39
|
+
promptSelectFile(id: string, prompt: string, fileOptions: FileSelectionOptions): Promise<string>;
|
|
40
|
+
/** Enables the user to retrieves a reference to a single existing folder on the local machine.
|
|
41
|
+
* @param id Identifies the prompt for internal use, esp in mocking. This value never renders to the user. */
|
|
42
|
+
promptSelectFolder(id: string, prompt: string, folderOptions: FolderSelectionOptions): Promise<string>;
|
|
43
|
+
/**
|
|
44
|
+
* @param id Identifies the prompt for internal use, esp in mocking. This value never renders to the user.
|
|
45
|
+
* @param prompt The message to print for the user.
|
|
46
|
+
* @param defaultValue defaults to TRUE. */
|
|
47
|
+
promptConfirm(id: string, prompt: string, defaultValue?: boolean): Promise<boolean>;
|
|
48
|
+
/** Opens the given url in a new default browser window.
|
|
49
|
+
* @param url fully-qualified web address to open (including protocol, eg: "http://somewhere.com").
|
|
50
|
+
*/
|
|
51
|
+
openUrl(url: string): Promise<void>;
|
|
52
|
+
/** Renders a graphic in the console indicating that an action is processing or waiting. */
|
|
53
|
+
startSpinner(userMessage: string): void;
|
|
54
|
+
/** Removes the pending indicator in the console. */
|
|
55
|
+
stopSpinner(userMessage: string): void;
|
|
56
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FileSelectionOptions = exports.FolderSelectionOptions = void 0;
|
|
4
|
+
/** User interaction parameters for capturing a reference to a physical folder. */
|
|
5
|
+
class FolderSelectionOptions {
|
|
6
|
+
}
|
|
7
|
+
exports.FolderSelectionOptions = FolderSelectionOptions;
|
|
8
|
+
/** User interaction parameters for capturing a reference to a physical file. */
|
|
9
|
+
class FileSelectionOptions extends FolderSelectionOptions {
|
|
10
|
+
}
|
|
11
|
+
exports.FileSelectionOptions = FileSelectionOptions;
|
|
12
|
+
//# sourceMappingURL=i-user-input-provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i-user-input-provider.js","sourceRoot":"","sources":["../../src/ops/i-user-input-provider.ts"],"names":[],"mappings":";;;AAOA,kFAAkF;AAClF,MAAa,sBAAsB;CAQlC;AARD,wDAQC;AAED,gFAAgF;AAChF,MAAa,oBAAqB,SAAQ,sBAAsB;CAG/D;AAHD,oDAGC"}
|
package/dist/ops/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './entities';
|
|
2
2
|
export * from './data';
|
|
3
|
+
export * from "./cli-path-walker";
|
|
3
4
|
export * from './codiac-entities';
|
|
4
5
|
export * from './LocalOps';
|
|
5
6
|
export * from './dx-constants';
|
|
@@ -7,6 +8,13 @@ export * from './project-initializer';
|
|
|
7
8
|
export * from './scaffolding/base-scaffolding';
|
|
8
9
|
export * from './scaffolding/typescript-scaffolding';
|
|
9
10
|
export * from './scaffolding/codiac-api-scaffolding';
|
|
11
|
+
export * from './i-entry-validator';
|
|
10
12
|
export * from './i-identity-handler';
|
|
13
|
+
export * from "./i-output-styler";
|
|
14
|
+
export * from "./i-user-input-provider";
|
|
15
|
+
export * from "./INTERFACES_CLI";
|
|
16
|
+
export * from "./ops-constants";
|
|
17
|
+
export * from "./no-style-output-styler";
|
|
18
|
+
export * from "./throwing-user-input-provider";
|
|
11
19
|
declare const _default: undefined;
|
|
12
20
|
export default _default;
|
package/dist/ops/index.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
tslib_1.__exportStar(require("./entities"), exports);
|
|
5
5
|
tslib_1.__exportStar(require("./data"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./cli-path-walker"), exports);
|
|
6
7
|
tslib_1.__exportStar(require("./codiac-entities"), exports);
|
|
7
8
|
tslib_1.__exportStar(require("./LocalOps"), exports);
|
|
8
9
|
tslib_1.__exportStar(require("./dx-constants"), exports);
|
|
@@ -10,6 +11,13 @@ tslib_1.__exportStar(require("./project-initializer"), exports);
|
|
|
10
11
|
tslib_1.__exportStar(require("./scaffolding/base-scaffolding"), exports);
|
|
11
12
|
tslib_1.__exportStar(require("./scaffolding/typescript-scaffolding"), exports);
|
|
12
13
|
tslib_1.__exportStar(require("./scaffolding/codiac-api-scaffolding"), exports);
|
|
14
|
+
tslib_1.__exportStar(require("./i-entry-validator"), exports);
|
|
13
15
|
tslib_1.__exportStar(require("./i-identity-handler"), exports);
|
|
16
|
+
tslib_1.__exportStar(require("./i-output-styler"), exports);
|
|
17
|
+
tslib_1.__exportStar(require("./i-user-input-provider"), exports);
|
|
18
|
+
tslib_1.__exportStar(require("./INTERFACES_CLI"), exports);
|
|
19
|
+
tslib_1.__exportStar(require("./ops-constants"), exports);
|
|
20
|
+
tslib_1.__exportStar(require("./no-style-output-styler"), exports);
|
|
21
|
+
tslib_1.__exportStar(require("./throwing-user-input-provider"), exports);
|
|
14
22
|
exports.default = this;
|
|
15
23
|
//# sourceMappingURL=index.js.map
|
package/dist/ops/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ops/index.ts"],"names":[],"mappings":";;;AACA,qDAA2B;AAC3B,iDAAuB;AAEvB,4DAAkC;AAClC,qDAA2B;AAC3B,yDAA+B;AAC/B,gEAAsC;AACtC,yEAA+C;AAC/C,+EAAqD;AACrD,+EAAqD;AACrD,+DAAqC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ops/index.ts"],"names":[],"mappings":";;;AACA,qDAA2B;AAC3B,iDAAuB;AAEvB,4DAAkC;AAClC,4DAAkC;AAClC,qDAA2B;AAC3B,yDAA+B;AAC/B,gEAAsC;AACtC,yEAA+C;AAC/C,+EAAqD;AACrD,+EAAqD;AACrD,8DAAoC;AACpC,+DAAqC;AACrC,4DAAkC;AAClC,kEAAwC;AACxC,2DAAiC;AACjC,0DAAgC;AAChC,mEAAyC;AACzC,yEAA+C;AAE/C,kBAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IOutputStyler } from "./";
|
|
2
|
+
/** Pass-thru: Does NOT apply any markup to the content.
|
|
3
|
+
*/
|
|
4
|
+
export declare class NoStyleOutputStyler implements IOutputStyler {
|
|
5
|
+
constructor();
|
|
6
|
+
bold(content: string): string;
|
|
7
|
+
dim(content: string): string;
|
|
8
|
+
hilite(content: string): string;
|
|
9
|
+
colorGood(content: string): string;
|
|
10
|
+
colorWarning(content: string): string;
|
|
11
|
+
colorCritical(content: string): string;
|
|
12
|
+
}
|
|
@@ -1,30 +1,36 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
//
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NoStyleOutputStyler = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const inversify_1 = require("inversify");
|
|
6
|
+
/** Pass-thru: Does NOT apply any markup to the content.
|
|
7
|
+
*/
|
|
8
|
+
let NoStyleOutputStyler = class NoStyleOutputStyler {
|
|
9
|
+
constructor() {
|
|
10
|
+
}
|
|
11
|
+
// IOutputStyler members
|
|
12
|
+
bold(content) {
|
|
13
|
+
return content;
|
|
14
|
+
}
|
|
15
|
+
dim(content) {
|
|
16
|
+
return content;
|
|
17
|
+
}
|
|
18
|
+
hilite(content) {
|
|
19
|
+
return content;
|
|
20
|
+
}
|
|
21
|
+
colorGood(content) {
|
|
22
|
+
return content;
|
|
23
|
+
}
|
|
24
|
+
colorWarning(content) {
|
|
25
|
+
return content;
|
|
26
|
+
}
|
|
27
|
+
colorCritical(content) {
|
|
28
|
+
return content;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
NoStyleOutputStyler = tslib_1.__decorate([
|
|
32
|
+
(0, inversify_1.injectable)(),
|
|
33
|
+
tslib_1.__metadata("design:paramtypes", [])
|
|
34
|
+
], NoStyleOutputStyler);
|
|
35
|
+
exports.NoStyleOutputStyler = NoStyleOutputStyler;
|
|
30
36
|
//# sourceMappingURL=no-style-output-styler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"no-style-output-styler.js","sourceRoot":"","sources":["../../src/ops/no-style-output-styler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"no-style-output-styler.js","sourceRoot":"","sources":["../../src/ops/no-style-output-styler.ts"],"names":[],"mappings":";;;;AACA,yCAAuC;AAGvC;GACG;AAEI,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAC9B;IAEA,CAAC;IAGD,wBAAwB;IAExB,IAAI,CAAC,OAAe;QAClB,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,GAAG,CAAC,OAAe;QACjB,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,MAAM,CAAC,OAAe;QACpB,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,SAAS,CAAC,OAAe;QACvB,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,YAAY,CAAC,OAAe;QAC1B,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,aAAa,CAAC,OAAe;QAC3B,OAAO,OAAO,CAAC;IACjB,CAAC;CACF,CAAA;AA1BY,mBAAmB;IAD/B,IAAA,sBAAU,GAAE;;GACA,mBAAmB,CA0B/B;AA1BY,kDAAmB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare class OpsConstants {
|
|
2
|
+
static readonly CLI_CONFIG_FOLDER_NAME = ".codiac";
|
|
3
|
+
/** The filename used when serializing the ThaulConfig object. */
|
|
4
|
+
static readonly PROJECT_CONFIG_FILENAME = "codiac.json";
|
|
5
|
+
static readonly PROJECT_USER_CONFIG_FOLDER_NAME = ".codiac-user";
|
|
6
|
+
static readonly PROJECT_USER_CONFIG_FILENAME = "user-config.json";
|
|
7
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OpsConstants = void 0;
|
|
4
|
+
class OpsConstants {
|
|
5
|
+
}
|
|
6
|
+
exports.OpsConstants = OpsConstants;
|
|
7
|
+
OpsConstants.CLI_CONFIG_FOLDER_NAME = ".codiac";
|
|
8
|
+
/** The filename used when serializing the ThaulConfig object. */
|
|
9
|
+
OpsConstants.PROJECT_CONFIG_FILENAME = 'codiac.json';
|
|
10
|
+
OpsConstants.PROJECT_USER_CONFIG_FOLDER_NAME = ".codiac-user";
|
|
11
|
+
OpsConstants.PROJECT_USER_CONFIG_FILENAME = "user-config.json";
|
|
12
|
+
//# sourceMappingURL=ops-constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ops-constants.js","sourceRoot":"","sources":["../../src/ops/ops-constants.ts"],"names":[],"mappings":";;;AAAA,MAAa,YAAY;;AAAzB,oCAMC;AALiB,mCAAsB,GAAG,SAAS,CAAC;AACnD,iEAAiE;AAC1C,oCAAuB,GAAG,aAAa,CAAA;AAC9C,4CAA+B,GAAG,cAAc,CAAC;AACjD,yCAA4B,GAAG,kBAAkB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EntryValue, IUserInputProvider, choice, IOutputStyler, FileSelectionOptions, FolderSelectionOptions } from '
|
|
1
|
+
import { EntryValue, IUserInputProvider, choice, IOutputStyler, FileSelectionOptions, FolderSelectionOptions } from '../';
|
|
2
2
|
export declare class MockUi implements IUserInputProvider, IOutputStyler {
|
|
3
3
|
constructor();
|
|
4
4
|
private values;
|
|
@@ -3,10 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
require("mocha");
|
|
5
5
|
require("chai");
|
|
6
|
-
const
|
|
6
|
+
const inversify_1 = require("inversify");
|
|
7
7
|
const codiac_ops_common_1 = require("@codiac.io/codiac-ops-common");
|
|
8
8
|
const codiac_common_1 = require("@codiac.io/codiac-common");
|
|
9
|
-
const
|
|
9
|
+
const LocalOps_1 = require("../LocalOps");
|
|
10
|
+
const ops_1 = require("../../ops");
|
|
10
11
|
describe("when gitBranchLine is attempted", () => {
|
|
11
12
|
let localOps;
|
|
12
13
|
let logger;
|
|
@@ -17,8 +18,8 @@ describe("when gitBranchLine is attempted", () => {
|
|
|
17
18
|
try {
|
|
18
19
|
logger = new codiac_common_1.BetterConsoleLogger();
|
|
19
20
|
cliExec = new codiac_ops_common_1.CliExec(logger);
|
|
20
|
-
let uiPvd = new
|
|
21
|
-
let styler = new
|
|
21
|
+
let uiPvd = new ops_1.ThrowingUserInputProvider(logger);
|
|
22
|
+
let styler = new ops_1.NoStyleOutputStyler();
|
|
22
23
|
let cliRoot = process.cwd(); // we're not using this for this test
|
|
23
24
|
let projRoot = process.cwd();
|
|
24
25
|
console.log(`projRoot: ${projRoot}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"when-git-branchline-is-attempted.spec.js","sourceRoot":"","sources":["../../../src/ops/test/when-git-branchline-is-attempted.spec.ts"],"names":[],"mappings":";;;AAAA,iBAAe;AACf,gBAAc;AAGd,
|
|
1
|
+
{"version":3,"file":"when-git-branchline-is-attempted.spec.js","sourceRoot":"","sources":["../../../src/ops/test/when-git-branchline-is-attempted.spec.ts"],"names":[],"mappings":";;;AAAA,iBAAe;AACf,gBAAc;AAGd,yCAAsC;AAEtC,oEAAuD;AACvD,4DAA8E;AAC9E,0CAAuC;AACvC,mCAA2E;AAG3E,QAAQ,CAAC,iCAAiC,EAAE,GAAG,EAAE;IAG/C,IAAI,QAAkB,CAAC;IACvB,IAAI,MAAqB,CAAC;IAC1B,IAAI,GAAG,GAAc,IAAI,qBAAS,EAAE,CAAC;IACrC,IAAI,OAAgB,CAAC;IAGrB,EAAE,CAAC,kDAAkD,EAAE,GAAS,EAAE;QAChE,OAAO,IAAI,OAAO,CAAO,CAAO,OAAO,EAAE,MAAM,EAAE,EAAE;YACjD,IAAI;gBACF,MAAM,GAAG,IAAI,mCAAmB,EAAE,CAAC;gBACnC,OAAO,GAAG,IAAI,2BAAO,CAAC,MAAM,CAAC,CAAC;gBAC9B,IAAI,KAAK,GAAG,IAAI,+BAAyB,CAAC,MAAM,CAAC,CAAC;gBAClD,IAAI,MAAM,GAAG,IAAI,yBAAmB,EAAE,CAAC;gBACvC,IAAI,OAAO,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAAE,qCAAqC;gBACnE,IAAI,QAAQ,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;gBAC7B,OAAO,CAAC,GAAG,CAAC,aAAa,QAAQ,EAAE,CAAC,CAAC;gBACrC,mEAAmE;gBACnE,QAAQ,GAAG,IAAI,mBAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,oHAAoH;gBAElJ,IAAI,OAAO,GAAG,MAAM,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAA;gBAClD,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;gBAErB,qHAAqH;gBAErH,OAAO,EAAE,CAAC;aACX;YAAC,OAAO,GAAG,EAAE;gBACZ,MAAM,CAAC,GAAG,CAAC,CAAC;aACb;QACH,CAAC,CAAA,CAAC,CAAC;IACL,CAAC,CAAA,CAAC,CAAC;AAGL,CAAC,CAAC,CAAC"}
|
|
@@ -7,6 +7,7 @@ const chai_1 = require("chai");
|
|
|
7
7
|
const LocalOps_1 = require("../LocalOps");
|
|
8
8
|
const codiac_ops_common_1 = require("@codiac.io/codiac-ops-common");
|
|
9
9
|
const codiac_common_1 = require("@codiac.io/codiac-common");
|
|
10
|
+
const ops_1 = require("../../ops");
|
|
10
11
|
const data_1 = require("../data");
|
|
11
12
|
const inversify_1 = require("inversify");
|
|
12
13
|
describe("when versions are parsed", () => {
|
|
@@ -17,8 +18,8 @@ describe("when versions are parsed", () => {
|
|
|
17
18
|
before(() => {
|
|
18
19
|
logger = new codiac_common_1.BetterConsoleLogger();
|
|
19
20
|
cliExec = new codiac_ops_common_1.CliExec(logger);
|
|
20
|
-
let uiPvd = new
|
|
21
|
-
let styler = new
|
|
21
|
+
let uiPvd = new ops_1.ThrowingUserInputProvider(logger);
|
|
22
|
+
let styler = new ops_1.NoStyleOutputStyler();
|
|
22
23
|
let cliRoot = process.cwd(); // we're not using this for this test
|
|
23
24
|
let projRoot = process.cwd();
|
|
24
25
|
console.log(`projRoot: ${projRoot}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"when-versions-are-parsed.spec.js","sourceRoot":"","sources":["../../../src/ops/test/when-versions-are-parsed.spec.ts"],"names":[],"mappings":";;;AAAA,iBAAe;AACf,gBAAc;AACd,+BAA8B;
|
|
1
|
+
{"version":3,"file":"when-versions-are-parsed.spec.js","sourceRoot":"","sources":["../../../src/ops/test/when-versions-are-parsed.spec.ts"],"names":[],"mappings":";;;AAAA,iBAAe;AACf,gBAAc;AACd,+BAA8B;AAC9B,0CAAuC;AACvC,oEAAuD;AACvD,4DAA8E;AAC9E,mCAA2E;AAC3E,kCAA6C;AAC7C,yCAAsC;AAEtC,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IAGxC,IAAI,QAAkB,CAAC;IACvB,IAAI,MAAqB,CAAC;IAC1B,IAAI,GAAG,GAAc,IAAI,qBAAS,EAAE,CAAC;IACrC,IAAI,OAAgB,CAAC;IAGrB,MAAM,CAAC,GAAG,EAAE;QAEV,MAAM,GAAG,IAAI,mCAAmB,EAAE,CAAC;QACnC,OAAO,GAAG,IAAI,2BAAO,CAAC,MAAM,CAAC,CAAC;QAC9B,IAAI,KAAK,GAAG,IAAI,+BAAyB,CAAC,MAAM,CAAC,CAAC;QAClD,IAAI,MAAM,GAAG,IAAI,yBAAmB,EAAE,CAAC;QACvC,IAAI,OAAO,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAAE,qCAAqC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AAA,CAAC,CAAC;IACL,CAAC,CAAA,CAAC,CAAC;AAGL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { IBetterLogger } from "@codiac.io/codiac-common/IBetterLogger";
|
|
2
|
+
import { EntryValue, choice, IUserInputProvider, FileSelectionOptions, FolderSelectionOptions } from "./i-user-input-provider";
|
|
3
|
+
/** For use in a non-TTY scenario: Throws on any request for user interaction.
|
|
4
|
+
*/
|
|
5
|
+
export declare class ThrowingUserInputProvider implements IUserInputProvider {
|
|
6
|
+
private logger;
|
|
7
|
+
private userMessageHandling;
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* @param logger
|
|
11
|
+
* @param userMessageHandling Declares what to do with user messages (optional: defaults to `write`); `write`: write the message to stdout, `suppress`: do nothing, `throw` raise an exception describing that user messages are not permitted.
|
|
12
|
+
*/
|
|
13
|
+
constructor(logger: IBetterLogger, userMessageHandling?: "write" | "suppress" | "throw");
|
|
14
|
+
userMessage(message: string): void;
|
|
15
|
+
prompt<T extends EntryValue>(id: string, prompt: string, required?: boolean, defaultValue?: T): Promise<T | undefined>;
|
|
16
|
+
promptPassword(id: string, prompt: string): Promise<string>;
|
|
17
|
+
promptSelect<T extends EntryValue>(id: string, prompt: string, choices: choice<T>[], multiSelect?: boolean): Promise<T | undefined>;
|
|
18
|
+
promptSelectFile(id: string, prompt: string, fileOptions: FileSelectionOptions): Promise<string>;
|
|
19
|
+
promptSelectFolder(id: string, prompt: string, folderOptions: FolderSelectionOptions): Promise<string>;
|
|
20
|
+
promptConfirm(id: string, prompt: string, defaultValue?: boolean): Promise<boolean>;
|
|
21
|
+
openUrl(url: string): Promise<void>;
|
|
22
|
+
startSpinner(userMessage: string): void;
|
|
23
|
+
stopSpinner(userMessage: string): void;
|
|
24
|
+
}
|