@provartesting/provardx-cli 0.0.3 → 0.0.5
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 +5 -0
- package/lib/Utility/errorCode.d.ts +1 -1
- package/lib/Utility/errorCode.js +1 -2
- package/lib/Utility/errorCode.js.map +1 -1
- package/lib/Utility/errorHandler.d.ts +1 -1
- package/lib/Utility/errorHandler.js +2 -7
- package/lib/Utility/errorHandler.js.map +1 -1
- package/lib/Utility/fileSupport.d.ts +1 -0
- package/lib/Utility/fileSupport.js +8 -36
- package/lib/Utility/fileSupport.js.map +1 -1
- package/lib/Utility/jsonSupport.js +4 -11
- package/lib/Utility/jsonSupport.js.map +1 -1
- package/lib/Utility/propertyFileValidator.d.ts +1 -1
- package/lib/Utility/propertyFileValidator.js +26 -44
- package/lib/Utility/propertyFileValidator.js.map +1 -1
- package/lib/Utility/provarConfig.d.ts +1 -1
- package/lib/Utility/provarConfig.js +3 -7
- package/lib/Utility/provarConfig.js.map +1 -1
- package/lib/Utility/provardxExecutor.d.ts +7 -0
- package/lib/Utility/provardxExecutor.js +31 -0
- package/lib/Utility/provardxExecutor.js.map +1 -0
- package/lib/Utility/sfProvarCommandResult.d.ts +1 -1
- package/lib/Utility/sfProvarCommandResult.js +1 -5
- package/lib/Utility/sfProvarCommandResult.js.map +1 -1
- package/lib/Utility/stringSupport.d.ts +2 -0
- package/lib/Utility/stringSupport.js +12 -7
- package/lib/Utility/stringSupport.js.map +1 -1
- package/lib/Utility/userSupport.d.ts +15 -0
- package/lib/Utility/userSupport.js +56 -0
- package/lib/Utility/userSupport.js.map +1 -0
- package/lib/commands/{sf/provar → provar/automation}/config/generate.d.ts +3 -3
- package/lib/commands/provar/automation/config/generate.js +70 -0
- package/lib/commands/provar/automation/config/generate.js.map +1 -0
- package/lib/commands/{sf/provar → provar/automation}/config/get.d.ts +1 -1
- package/lib/commands/provar/automation/config/get.js +74 -0
- package/lib/commands/provar/automation/config/get.js.map +1 -0
- package/lib/commands/{sf/provar → provar/automation}/config/load.d.ts +2 -2
- package/lib/commands/provar/automation/config/load.js +55 -0
- package/lib/commands/provar/automation/config/load.js.map +1 -0
- package/lib/commands/{sf/provar → provar/automation}/config/set.d.ts +1 -1
- package/lib/commands/provar/automation/config/set.js +85 -0
- package/lib/commands/provar/automation/config/set.js.map +1 -0
- package/lib/commands/{sf/provar → provar/automation}/config/validate.d.ts +1 -1
- package/lib/commands/provar/automation/config/validate.js +31 -0
- package/lib/commands/provar/automation/config/validate.js.map +1 -0
- package/lib/commands/provar/automation/metadata/download.d.ts +13 -0
- package/lib/commands/provar/automation/metadata/download.js +94 -0
- package/lib/commands/provar/automation/metadata/download.js.map +1 -0
- package/lib/constants/commandConstants.d.ts +6 -5
- package/lib/constants/commandConstants.js +8 -10
- package/lib/constants/commandConstants.js.map +1 -1
- package/lib/constants/errorMessages.js +2 -5
- package/lib/constants/errorMessages.js.map +1 -1
- package/lib/constants/propertyFileContent.d.ts +24 -0
- package/lib/constants/propertyFileContent.js +25 -0
- package/lib/constants/propertyFileContent.js.map +1 -0
- package/lib/constants/propertyFileSchema.d.ts +7 -0
- package/lib/constants/propertyFileSchema.js +9 -4
- package/lib/constants/propertyFileSchema.js.map +1 -1
- package/lib/constants/sfCommandConstants.d.ts +4 -0
- package/lib/constants/sfCommandConstants.js +6 -0
- package/lib/constants/sfCommandConstants.js.map +1 -0
- package/messages/provar.metadata.download.md +23 -0
- package/messages/sf.provar.config.generate.md +3 -3
- package/messages/sf.provar.config.get.md +3 -3
- package/messages/sf.provar.config.load.md +3 -3
- package/messages/sf.provar.config.set.md +3 -3
- package/messages/sf.provar.config.validate.md +3 -3
- package/oclif.manifest.json +341 -73
- package/package.json +37 -48
- package/lib/commands/sf/provar/config/generate.js +0 -102
- package/lib/commands/sf/provar/config/generate.js.map +0 -1
- package/lib/commands/sf/provar/config/get.js +0 -106
- package/lib/commands/sf/provar/config/get.js.map +0 -1
- package/lib/commands/sf/provar/config/load.js +0 -87
- package/lib/commands/sf/provar/config/load.js.map +0 -1
- package/lib/commands/sf/provar/config/set.js +0 -117
- package/lib/commands/sf/provar/config/set.js.map +0 -1
- package/lib/commands/sf/provar/config/validate.js +0 -40
- package/lib/commands/sf/provar/config/validate.js.map +0 -1
- package/lib/constants/propertyFileContent.json +0 -24
package/README.md
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
Run In dev provardx plugin on your local
|
|
2
|
+
|
|
2
3
|
# Prerequisite:
|
|
4
|
+
|
|
3
5
|
Node, npm , nvm, yarn, Latest sf cli.
|
|
6
|
+
|
|
4
7
|
# Steps to run on local:
|
|
8
|
+
|
|
5
9
|
1. git clone the Repo from the feature branch: https://github.com/ProvarTesting/provardx-cli/
|
|
6
10
|
2. Install the dependencies on your local from package.json: npm i
|
|
7
11
|
3. Build the project using the command: yarn prepack
|
|
@@ -10,6 +14,7 @@ Run In dev provardx plugin on your local
|
|
|
10
14
|
6. To run NUTS on your local: yarn run test:nuts
|
|
11
15
|
|
|
12
16
|
# Naming conventions used in provardx-cli development
|
|
17
|
+
|
|
13
18
|
1. camelCase for fileNames/methodNames/Variables
|
|
14
19
|
2. PascalCase for classNames.
|
|
15
20
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type ErrorCode = 'MISSING_FILE' | 'MALFORMED_FILE' | 'MISSING_PROPERTY' | 'MISSING_PROPERTIES' | 'INVALID_VALUES' | 'INVALID_VALUE' | 'MISSING_VALUE' | 'INVALID_FILE_EXTENSION' | 'GENERATE_OPERATION_DENIED' | 'INVALID_PATH' | 'INSUFFICIENT_PERMISSIONS' | 'INVALID_ARGUMENT' | 'INVALID_PROPERTY' | 'UNKNOWN_PROPERTY';
|
|
1
|
+
export type ErrorCode = 'MISSING_FILE' | 'MALFORMED_FILE' | 'MISSING_PROPERTY' | 'MISSING_PROPERTIES' | 'INVALID_VALUES' | 'INVALID_VALUE' | 'MISSING_VALUE' | 'INVALID_FILE_EXTENSION' | 'GENERATE_OPERATION_DENIED' | 'INVALID_PATH' | 'INSUFFICIENT_PERMISSIONS' | 'INVALID_ARGUMENT' | 'INVALID_PROPERTY' | 'UNKNOWN_PROPERTY' | 'DOWNLOAD_ERROR';
|
package/lib/Utility/errorCode.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/*
|
|
3
2
|
* Copyright (c) 2024 Provar Limited.
|
|
4
3
|
* All rights reserved.
|
|
5
4
|
* Licensed under the BSD 3-Clause license.
|
|
6
5
|
* For full license text, see LICENSE.md file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
6
|
*/
|
|
8
|
-
|
|
7
|
+
export {};
|
|
9
8
|
//# sourceMappingURL=errorCode.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errorCode.js","sourceRoot":"","sources":["../../src/Utility/errorCode.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"errorCode.js","sourceRoot":"","sources":["../../src/Utility/errorCode.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/*
|
|
3
2
|
* Copyright (c) 2024 Provar Limited.
|
|
4
3
|
* All rights reserved.
|
|
5
4
|
* Licensed under the BSD 3-Clause license.
|
|
6
5
|
* For full license text, see LICENSE.md file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
6
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
constructor() {
|
|
11
|
-
this.errors = [];
|
|
12
|
-
}
|
|
7
|
+
export default class ErrorHandler {
|
|
8
|
+
errors = [];
|
|
13
9
|
addErrorsToList(eCode, eMessage) {
|
|
14
10
|
this.errors.push({
|
|
15
11
|
code: eCode,
|
|
@@ -23,5 +19,4 @@ class ErrorHandler {
|
|
|
23
19
|
return this.errors.map((e) => `[${e.code}] ${e.message}`);
|
|
24
20
|
}
|
|
25
21
|
}
|
|
26
|
-
exports.default = ErrorHandler;
|
|
27
22
|
//# sourceMappingURL=errorHandler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errorHandler.js","sourceRoot":"","sources":["../../src/Utility/errorHandler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"errorHandler.js","sourceRoot":"","sources":["../../src/Utility/errorHandler.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAcH,MAAM,CAAC,OAAO,OAAO,YAAY;IACvB,MAAM,GAAY,EAAE,CAAC;IAEtB,eAAe,CAAC,KAAgB,EAAE,QAAgB;QACvD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;YACf,IAAI,EAAE,KAAK;YACX,OAAO,EAAE,QAAQ;SAClB,CAAC,CAAC;IACL,CAAC;IAEM,SAAS;QACd,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAEM,mBAAmB;QACxB,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;IAC5D,CAAC;CACF"}
|
|
@@ -1,51 +1,23 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/*
|
|
3
2
|
* Copyright (c) 2024 Provar Limited.
|
|
4
3
|
* All rights reserved.
|
|
5
4
|
* Licensed under the BSD 3-Clause license.
|
|
6
5
|
* For full license text, see LICENSE.md file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
6
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
-
}
|
|
14
|
-
Object.defineProperty(o, k2, desc);
|
|
15
|
-
}) : (function(o, m, k, k2) {
|
|
16
|
-
if (k2 === undefined) k2 = k;
|
|
17
|
-
o[k2] = m[k];
|
|
18
|
-
}));
|
|
19
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
20
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
21
|
-
}) : function(o, v) {
|
|
22
|
-
o["default"] = v;
|
|
23
|
-
});
|
|
24
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
25
|
-
if (mod && mod.__esModule) return mod;
|
|
26
|
-
var result = {};
|
|
27
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
28
|
-
__setModuleDefault(result, mod);
|
|
29
|
-
return result;
|
|
30
|
-
};
|
|
31
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
32
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
33
|
-
};
|
|
34
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
exports.getExtension = exports.generateFile = void 0;
|
|
36
|
-
const fs = __importStar(require("fs"));
|
|
37
|
-
const propertyFileContent_json_1 = __importDefault(require("../constants/propertyFileContent.json"));
|
|
7
|
+
import * as fs from 'node:fs';
|
|
8
|
+
import { propertyFileContent } from '../constants/propertyFileContent.js';
|
|
38
9
|
/**
|
|
39
10
|
* Contains all the methods that deals with generic file related operations.
|
|
40
11
|
*
|
|
41
12
|
*/
|
|
42
|
-
function generateFile(filePath) {
|
|
43
|
-
fs.writeFileSync(filePath, JSON.stringify(
|
|
13
|
+
export function generateFile(filePath) {
|
|
14
|
+
fs.writeFileSync(filePath, JSON.stringify(propertyFileContent, null, 3));
|
|
44
15
|
}
|
|
45
|
-
|
|
46
|
-
function getExtension(filename) {
|
|
16
|
+
export function getExtension(filename) {
|
|
47
17
|
const i = filename.lastIndexOf('.');
|
|
48
18
|
return i < 0 ? '' : filename.substr(i);
|
|
49
19
|
}
|
|
50
|
-
|
|
20
|
+
export function fileContainsString(fileContent, searchString) {
|
|
21
|
+
return fileContent.includes(searchString);
|
|
22
|
+
}
|
|
51
23
|
//# sourceMappingURL=fileSupport.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fileSupport.js","sourceRoot":"","sources":["../../src/Utility/fileSupport.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fileSupport.js","sourceRoot":"","sources":["../../src/Utility/fileSupport.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAE1E;;;GAGG;AAEH,MAAM,UAAU,YAAY,CAAC,QAAgB;IAC3C,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,mBAAmB,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AAC3E,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,QAAgB;IAC3C,MAAM,CAAC,GAAG,QAAQ,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IACpC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACzC,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,WAAmB,EAAE,YAAoB;IAC1E,OAAO,WAAW,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;AAC5C,CAAC"}
|
|
@@ -1,26 +1,22 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/*
|
|
3
2
|
* Copyright (c) 2024 Provar Limited.
|
|
4
3
|
* All rights reserved.
|
|
5
4
|
* Licensed under the BSD 3-Clause license.
|
|
6
5
|
* For full license text, see LICENSE.md file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
6
|
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.parseJSONString = exports.setNestedProperty = exports.checkNestedProperty = exports.getNestedProperty = void 0;
|
|
10
7
|
/**
|
|
11
8
|
* Custom logics from JSON manipulation.
|
|
12
9
|
*
|
|
13
10
|
*/
|
|
14
11
|
/* eslint-disable */
|
|
15
|
-
function getNestedProperty(jsonData, property) {
|
|
12
|
+
export function getNestedProperty(jsonData, property) {
|
|
16
13
|
const propertyPath = property.split('.');
|
|
17
14
|
for (let i = 0; i < propertyPath.length; i++) {
|
|
18
15
|
jsonData = jsonData[propertyPath[i]];
|
|
19
16
|
}
|
|
20
17
|
return jsonData;
|
|
21
18
|
}
|
|
22
|
-
|
|
23
|
-
function checkNestedProperty(jsonData, property) {
|
|
19
|
+
export function checkNestedProperty(jsonData, property) {
|
|
24
20
|
const propertyPath = property.split('.');
|
|
25
21
|
for (const nestedProperty of propertyPath) {
|
|
26
22
|
if (!jsonData?.hasOwnProperty(nestedProperty)) {
|
|
@@ -30,8 +26,7 @@ function checkNestedProperty(jsonData, property) {
|
|
|
30
26
|
}
|
|
31
27
|
return true;
|
|
32
28
|
}
|
|
33
|
-
|
|
34
|
-
function setNestedProperty(jsonData, property, value) {
|
|
29
|
+
export function setNestedProperty(jsonData, property, value) {
|
|
35
30
|
const propertyPath = property.split('.');
|
|
36
31
|
const propertyPathLength = propertyPath.length;
|
|
37
32
|
for (var i = 0; i < propertyPathLength - 1; i++) {
|
|
@@ -42,8 +37,7 @@ function setNestedProperty(jsonData, property, value) {
|
|
|
42
37
|
}
|
|
43
38
|
jsonData[propertyPath[propertyPathLength - 1]] = value;
|
|
44
39
|
}
|
|
45
|
-
|
|
46
|
-
function parseJSONString(jsonInput) {
|
|
40
|
+
export function parseJSONString(jsonInput) {
|
|
47
41
|
try {
|
|
48
42
|
return JSON.parse(jsonInput);
|
|
49
43
|
}
|
|
@@ -51,5 +45,4 @@ function parseJSONString(jsonInput) {
|
|
|
51
45
|
return jsonInput;
|
|
52
46
|
}
|
|
53
47
|
}
|
|
54
|
-
exports.parseJSONString = parseJSONString;
|
|
55
48
|
//# sourceMappingURL=jsonSupport.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsonSupport.js","sourceRoot":"","sources":["../../src/Utility/jsonSupport.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"jsonSupport.js","sourceRoot":"","sources":["../../src/Utility/jsonSupport.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;GAGG;AAEH,oBAAoB;AACpB,MAAM,UAAU,iBAAiB,CAAC,QAAa,EAAE,QAAgB;IAC/D,MAAM,YAAY,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACzC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAC7C,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;IACvC,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,QAAa,EAAE,QAAgB;IACjE,MAAM,YAAY,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACzC,KAAK,MAAM,cAAc,IAAI,YAAY,EAAE,CAAC;QAC1C,IAAI,CAAC,QAAQ,EAAE,cAAc,CAAC,cAAc,CAAC,EAAE,CAAC;YAC9C,OAAO,KAAK,CAAC;QACf,CAAC;QACD,QAAQ,GAAG,QAAQ,CAAC,cAAc,CAAC,CAAC;IACtC,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,QAAa,EAAE,QAAgB,EAAE,KAAyB;IAC1F,MAAM,YAAY,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACzC,MAAM,kBAAkB,GAAG,YAAY,CAAC,MAAM,CAAC;IAC/C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,kBAAkB,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAChD,IAAI,cAAc,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;QACrC,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC;YAAE,QAAQ,CAAC,cAAc,CAAC,GAAG,EAAE,CAAC;QAC7D,QAAQ,GAAG,QAAQ,CAAC,cAAc,CAAC,CAAC;IACtC,CAAC;IACD,QAAQ,CAAC,YAAY,CAAC,kBAAkB,GAAG,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;AACzD,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,SAAiB;IAC/C,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAC/B,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC"}
|
|
@@ -1,93 +1,76 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/*
|
|
3
2
|
* Copyright (c) 2024 Provar Limited.
|
|
4
3
|
* All rights reserved.
|
|
5
4
|
* Licensed under the BSD 3-Clause license.
|
|
6
5
|
* For full license text, see LICENSE.md file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
6
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
Object.defineProperty(o, k2, desc);
|
|
15
|
-
}) : (function(o, m, k, k2) {
|
|
16
|
-
if (k2 === undefined) k2 = k;
|
|
17
|
-
o[k2] = m[k];
|
|
18
|
-
}));
|
|
19
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
20
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
21
|
-
}) : function(o, v) {
|
|
22
|
-
o["default"] = v;
|
|
23
|
-
});
|
|
24
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
25
|
-
if (mod && mod.__esModule) return mod;
|
|
26
|
-
var result = {};
|
|
27
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
28
|
-
__setModuleDefault(result, mod);
|
|
29
|
-
return result;
|
|
30
|
-
};
|
|
31
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
-
const fileSystem = __importStar(require("fs"));
|
|
33
|
-
const jsonschema_1 = require("jsonschema");
|
|
34
|
-
const errorMessages_1 = require("../constants/errorMessages");
|
|
35
|
-
const propertyFileSchema_1 = require("../constants/propertyFileSchema");
|
|
36
|
-
const stringSupport_1 = require("./stringSupport");
|
|
37
|
-
const provarConfig_1 = require("./provarConfig");
|
|
7
|
+
import * as fileSystem from 'node:fs';
|
|
8
|
+
import { Validator } from 'jsonschema';
|
|
9
|
+
import { errorMessages } from '../constants/errorMessages.js';
|
|
10
|
+
import { propertyFileSchema } from '../constants/propertyFileSchema.js';
|
|
11
|
+
import { substringAfter, addQuotesAround } from './stringSupport.js';
|
|
12
|
+
import { ProvarConfig } from './provarConfig.js';
|
|
38
13
|
/**
|
|
39
14
|
* Contains code to load the config file and validation login for provardx-properties.json
|
|
40
15
|
*
|
|
41
16
|
*/
|
|
42
|
-
class PropertyFileValidator {
|
|
17
|
+
export default class PropertyFileValidator {
|
|
18
|
+
validationResults;
|
|
19
|
+
errorHandler;
|
|
43
20
|
constructor(errorHandler) {
|
|
44
21
|
this.errorHandler = errorHandler;
|
|
45
22
|
}
|
|
46
23
|
async validate() {
|
|
47
|
-
const config = await
|
|
24
|
+
const config = await ProvarConfig.loadConfig(this.errorHandler);
|
|
48
25
|
const filePath = config.get('PROVARDX_PROPERTIES_FILE_PATH')?.toString();
|
|
49
26
|
const missingRequiredProperties = [];
|
|
50
27
|
const invalidPropertiesValue = [];
|
|
51
28
|
if (filePath === undefined || !fileSystem.existsSync(filePath)) {
|
|
52
|
-
this.errorHandler.addErrorsToList('MISSING_FILE',
|
|
29
|
+
this.errorHandler.addErrorsToList('MISSING_FILE', errorMessages.MISSINGFILEERROR);
|
|
53
30
|
}
|
|
54
31
|
else {
|
|
55
32
|
/* eslint-disable */
|
|
56
|
-
const jsonValidator = new
|
|
33
|
+
const jsonValidator = new Validator();
|
|
57
34
|
try {
|
|
58
|
-
this.validationResults = jsonValidator.validate(JSON.parse(fileSystem.readFileSync(filePath).toString()),
|
|
35
|
+
this.validationResults = jsonValidator.validate(JSON.parse(fileSystem.readFileSync(filePath).toString()), propertyFileSchema);
|
|
59
36
|
if (this.validationResults.errors.length > 0) {
|
|
60
37
|
for (const validationError of this.validationResults.errors) {
|
|
61
38
|
if (validationError.name === 'required') {
|
|
62
|
-
let substring =
|
|
39
|
+
let substring = substringAfter(validationError.property, '.');
|
|
63
40
|
if (substring) {
|
|
64
41
|
substring = substring.concat('.');
|
|
65
42
|
}
|
|
66
43
|
missingRequiredProperties.push(substring + validationError.argument);
|
|
67
44
|
}
|
|
45
|
+
else if (validationError.name === 'pattern') {
|
|
46
|
+
let substring = substringAfter(validationError.property, '.');
|
|
47
|
+
if (substring) {
|
|
48
|
+
invalidPropertiesValue.push(substring);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
68
51
|
else if (validationError.name === 'enum' || validationError.name === 'type') {
|
|
69
|
-
invalidPropertiesValue.push(
|
|
52
|
+
invalidPropertiesValue.push(substringAfter(validationError.property, '.'));
|
|
70
53
|
}
|
|
71
54
|
}
|
|
72
55
|
}
|
|
73
56
|
}
|
|
74
57
|
catch (errors) {
|
|
75
|
-
this.errorHandler.addErrorsToList('MALFORMED_FILE',
|
|
58
|
+
this.errorHandler.addErrorsToList('MALFORMED_FILE', errorMessages.MALFORMEDFILEERROR);
|
|
76
59
|
return false;
|
|
77
60
|
}
|
|
78
61
|
const missingPropertiesCount = missingRequiredProperties.length;
|
|
79
62
|
const invalidValuesCount = invalidPropertiesValue.length;
|
|
80
63
|
if (missingPropertiesCount > 1) {
|
|
81
|
-
this.errorHandler.addErrorsToList('MISSING_PROPERTIES', `The properties ${
|
|
64
|
+
this.errorHandler.addErrorsToList('MISSING_PROPERTIES', `The properties ${addQuotesAround(missingRequiredProperties).join(', ')} are missing.`);
|
|
82
65
|
}
|
|
83
66
|
else if (missingPropertiesCount == 1) {
|
|
84
|
-
this.errorHandler.addErrorsToList('MISSING_PROPERTY', `The property ${
|
|
67
|
+
this.errorHandler.addErrorsToList('MISSING_PROPERTY', `The property ${addQuotesAround(missingRequiredProperties)} is missing.`);
|
|
85
68
|
}
|
|
86
69
|
if (invalidValuesCount > 1) {
|
|
87
|
-
this.errorHandler.addErrorsToList('INVALID_VALUES', `The properties ${
|
|
70
|
+
this.errorHandler.addErrorsToList('INVALID_VALUES', `The properties ${addQuotesAround(invalidPropertiesValue).join(', ')} values are not valid.`);
|
|
88
71
|
}
|
|
89
72
|
else if (invalidValuesCount == 1) {
|
|
90
|
-
this.errorHandler.addErrorsToList('INVALID_VALUE', `The property ${
|
|
73
|
+
this.errorHandler.addErrorsToList('INVALID_VALUE', `The property ${addQuotesAround(invalidPropertiesValue)} value is not valid.`);
|
|
91
74
|
}
|
|
92
75
|
}
|
|
93
76
|
if (this.errorHandler.getErrors().length > 0) {
|
|
@@ -99,5 +82,4 @@ class PropertyFileValidator {
|
|
|
99
82
|
return this.errorHandler.getErrors();
|
|
100
83
|
}
|
|
101
84
|
}
|
|
102
|
-
exports.default = PropertyFileValidator;
|
|
103
85
|
//# sourceMappingURL=propertyFileValidator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"propertyFileValidator.js","sourceRoot":"","sources":["../../src/Utility/propertyFileValidator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"propertyFileValidator.js","sourceRoot":"","sources":["../../src/Utility/propertyFileValidator.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Config } from '@salesforce/core';
|
|
2
|
-
import ErrorHandler from './errorHandler';
|
|
2
|
+
import ErrorHandler from './errorHandler.js';
|
|
3
3
|
/**
|
|
4
4
|
* sfdxConfig extended class that deals with any operation over .sf/config.json.
|
|
5
5
|
* ex: what all properties we can add to config.json.
|
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/*
|
|
3
2
|
* Copyright (c) 2024 Provar Limited.
|
|
4
3
|
* All rights reserved.
|
|
5
4
|
* Licensed under the BSD 3-Clause license.
|
|
6
5
|
* For full license text, see LICENSE.md file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
6
|
*/
|
|
8
|
-
|
|
9
|
-
exports.ProvarConfig = void 0;
|
|
10
|
-
const core_1 = require("@salesforce/core");
|
|
7
|
+
import { Config, SfError } from '@salesforce/core';
|
|
11
8
|
/**
|
|
12
9
|
* sfdxConfig extended class that deals with any operation over .sf/config.json.
|
|
13
10
|
* ex: what all properties we can add to config.json.
|
|
14
11
|
*
|
|
15
12
|
*/
|
|
16
|
-
class ProvarConfig extends
|
|
13
|
+
export class ProvarConfig extends Config {
|
|
17
14
|
constructor() {
|
|
18
15
|
const option = { isGlobal: true, isState: true, filename: 'config.json', stateFolder: '.provardx' };
|
|
19
16
|
const allowedProeprties = [];
|
|
@@ -30,7 +27,7 @@ class ProvarConfig extends core_1.Config {
|
|
|
30
27
|
return config;
|
|
31
28
|
}
|
|
32
29
|
catch (error) {
|
|
33
|
-
if (error instanceof
|
|
30
|
+
if (error instanceof SfError) {
|
|
34
31
|
// eslint-disable-next-line
|
|
35
32
|
errorHandler.addErrorsToList(error.code, error.message);
|
|
36
33
|
}
|
|
@@ -38,5 +35,4 @@ class ProvarConfig extends core_1.Config {
|
|
|
38
35
|
}
|
|
39
36
|
}
|
|
40
37
|
}
|
|
41
|
-
exports.ProvarConfig = ProvarConfig;
|
|
42
38
|
//# sourceMappingURL=provarConfig.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provarConfig.js","sourceRoot":"","sources":["../../src/Utility/provarConfig.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"provarConfig.js","sourceRoot":"","sources":["../../src/Utility/provarConfig.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAsB,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAGvE;;;;GAIG;AAEH,MAAM,OAAO,YAAa,SAAQ,MAAM;IACtC;QACE,MAAM,MAAM,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,aAAa,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC;QACpG,MAAM,iBAAiB,GAAyB,EAAE,CAAC;QACnD,iBAAiB,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,+BAA+B,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC;QAClF,YAAY,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;QACrD,KAAK,CACH,MAAM,CAAC,MAAM,CACX;YACE,QAAQ,EAAE,IAAI;SACf,EACD,MAAM,CACP,CACF,CAAC;IACJ,CAAC;IAEM,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,YAA0B;QACvD,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,MAAM,EAAE,CAAC;YAC3C,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;YACpB,OAAO,MAAM,CAAC;QAChB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,KAAK,YAAY,OAAO,EAAE,CAAC;gBAC7B,2BAA2B;gBAC3B,YAAY,CAAC,eAAe,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;YAC1D,CAAC;YACD,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { promisify } from 'node:util';
|
|
2
|
+
import { exec } from 'node:child_process';
|
|
3
|
+
import { cli } from 'cli-ux';
|
|
4
|
+
/**
|
|
5
|
+
* Executes the provided dx command.
|
|
6
|
+
*
|
|
7
|
+
* @param command Command string
|
|
8
|
+
* @param message Message to be displayed while command execution is in progress.
|
|
9
|
+
*/
|
|
10
|
+
/* eslint-disable */
|
|
11
|
+
export async function executeCommand(command, message) {
|
|
12
|
+
if (message) {
|
|
13
|
+
cli.action.start(message);
|
|
14
|
+
}
|
|
15
|
+
let isSucessful = false;
|
|
16
|
+
const execPromise = promisify(exec);
|
|
17
|
+
try {
|
|
18
|
+
const result = await execPromise(command);
|
|
19
|
+
isSucessful = true;
|
|
20
|
+
return result.stdout;
|
|
21
|
+
}
|
|
22
|
+
catch (e) {
|
|
23
|
+
return e.stdout;
|
|
24
|
+
}
|
|
25
|
+
finally {
|
|
26
|
+
if (message) {
|
|
27
|
+
cli.action.stop(isSucessful ? 'successful' : 'failed');
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=provardxExecutor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provardxExecutor.js","sourceRoot":"","sources":["../../src/Utility/provardxExecutor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAC7B;;;;;GAKG;AACH,oBAAoB;AACpB,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,OAAe,EAAE,OAAe;IACnE,IAAI,OAAO,EAAE,CAAC;QACZ,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC5B,CAAC;IACD,IAAI,WAAW,GAAG,KAAK,CAAC;IACxB,MAAM,WAAW,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;IACpC,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,OAAO,CAAC,CAAC;QAC1C,WAAW,GAAG,IAAI,CAAC;QACnB,OAAO,MAAM,CAAC,MAAM,CAAC;IACvB,CAAC;IAAC,OAAO,CAAM,EAAE,CAAC;QAChB,OAAO,CAAC,CAAC,MAAM,CAAC;IAClB,CAAC;YAAS,CAAC;QACT,IAAI,OAAO,EAAE,CAAC;YACZ,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;QACzD,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/*
|
|
3
2
|
* Copyright (c) 2024 Provar Limited.
|
|
4
3
|
* All rights reserved.
|
|
5
4
|
* Licensed under the BSD 3-Clause license.
|
|
6
5
|
* For full license text, see LICENSE.md file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
6
|
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.populateResult = void 0;
|
|
10
7
|
/* eslint-disable */
|
|
11
|
-
function populateResult(flags, errorHandler, messages, log, value) {
|
|
8
|
+
export function populateResult(flags, errorHandler, messages, log, value) {
|
|
12
9
|
let result = { success: true };
|
|
13
10
|
if (errorHandler.getErrors().length > 0) {
|
|
14
11
|
const errorObjects = errorHandler.getErrors();
|
|
@@ -30,5 +27,4 @@ function populateResult(flags, errorHandler, messages, log, value) {
|
|
|
30
27
|
}
|
|
31
28
|
return result;
|
|
32
29
|
}
|
|
33
|
-
exports.populateResult = populateResult;
|
|
34
30
|
//# sourceMappingURL=sfProvarCommandResult.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sfProvarCommandResult.js","sourceRoot":"","sources":["../../src/Utility/sfProvarCommandResult.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sfProvarCommandResult.js","sourceRoot":"","sources":["../../src/Utility/sfProvarCommandResult.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAgBH,oBAAoB;AACpB,MAAM,UAAU,cAAc,CAC5B,KAAU,EACV,YAA0B,EAC1B,QAA0B,EAC1B,GAAa,EACb,KAAc;IAEd,IAAI,MAAM,GAA0B,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAEtD,IAAI,YAAY,CAAC,SAAS,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACxC,MAAM,YAAY,GAAY,YAAY,CAAC,SAAS,EAAE,CAAC;QACvD,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;YACnB,MAAM,QAAQ,CAAC,WAAW,CAAC,uBAAuB,EAAE,YAAY,CAAC,mBAAmB,EAAE,CAAC,CAAC;QAC1F,CAAC;QACD,MAAM,GAAG;YACP,OAAO,EAAE,KAAK;YACd,MAAM,EAAE,YAAY;SACrB,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC5F,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAChC,MAAM,GAAG;YACP,OAAO,EAAE,IAAI;YACb,KAAK,EAAE,KAAK;SACb,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -4,3 +4,5 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export declare function substringAfter(str: string, separator: string): string;
|
|
6
6
|
export declare function addQuotesAround(array: string[]): string[];
|
|
7
|
+
export declare function removeSpaces(str: string): string;
|
|
8
|
+
export declare function getStringAfterSubstring(content: string, searchString: string): string;
|
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/*
|
|
3
2
|
* Copyright (c) 2024 Provar Limited.
|
|
4
3
|
* All rights reserved.
|
|
5
4
|
* Licensed under the BSD 3-Clause license.
|
|
6
5
|
* For full license text, see LICENSE.md file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
6
|
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.addQuotesAround = exports.substringAfter = void 0;
|
|
10
7
|
/**
|
|
11
8
|
* Deals with the custom operations on strings.
|
|
12
9
|
*
|
|
13
10
|
*/
|
|
14
|
-
function substringAfter(str, separator) {
|
|
11
|
+
export function substringAfter(str, separator) {
|
|
15
12
|
if (!str) {
|
|
16
13
|
return str;
|
|
17
14
|
}
|
|
@@ -24,9 +21,17 @@ function substringAfter(str, separator) {
|
|
|
24
21
|
}
|
|
25
22
|
return str.substring(pos + separator.length);
|
|
26
23
|
}
|
|
27
|
-
|
|
28
|
-
function addQuotesAround(array) {
|
|
24
|
+
export function addQuotesAround(array) {
|
|
29
25
|
return array.map((item) => "'" + item + "'");
|
|
30
26
|
}
|
|
31
|
-
|
|
27
|
+
export function removeSpaces(str) {
|
|
28
|
+
return str.replace(/\s/g, '');
|
|
29
|
+
}
|
|
30
|
+
export function getStringAfterSubstring(content, searchString) {
|
|
31
|
+
const index = content.toLowerCase().indexOf(searchString.toLowerCase());
|
|
32
|
+
if (index === -1) {
|
|
33
|
+
return '';
|
|
34
|
+
}
|
|
35
|
+
return content.slice(index);
|
|
36
|
+
}
|
|
32
37
|
//# sourceMappingURL=stringSupport.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stringSupport.js","sourceRoot":"","sources":["../../src/Utility/stringSupport.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stringSupport.js","sourceRoot":"","sources":["../../src/Utility/stringSupport.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;GAGG;AAEH,MAAM,UAAU,cAAc,CAAC,GAAW,EAAE,SAAiB;IAC3D,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,OAAO,GAAG,CAAC;IACb,CAAC;IACD,IAAI,SAAS,IAAI,IAAI,EAAE,CAAC;QACtB,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,MAAM,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACnC,IAAI,GAAG,KAAK,CAAC,CAAC,EAAE,CAAC;QACf,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO,GAAG,CAAC,SAAS,CAAC,GAAG,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,KAAe;IAC7C,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,GAAG,IAAI,GAAG,GAAG,CAAC,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,GAAW;IACtC,OAAO,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,OAAe,EAAE,YAAoB;IAC3E,MAAM,KAAK,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC,CAAC;IACxE,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC;QACjB,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAC9B,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import ErrorHandler from './errorHandler.js';
|
|
2
|
+
export default class UserSupport {
|
|
3
|
+
/**
|
|
4
|
+
* Updates the dx properties json string before it is send to command executer.
|
|
5
|
+
*/
|
|
6
|
+
prepareRawProperties(rawProperties: string): string;
|
|
7
|
+
/**
|
|
8
|
+
* Gets the dx user info and generated the password for dx user if not already created.
|
|
9
|
+
*
|
|
10
|
+
* @param overrides Connection overrides provided in dx property file.
|
|
11
|
+
*/
|
|
12
|
+
getDxUsersInfo(overrides: any, errorHandler: ErrorHandler): Promise<any>;
|
|
13
|
+
private generatePasswordIfNotPresent;
|
|
14
|
+
private handleSpecialCharacters;
|
|
15
|
+
}
|