@provartesting/provardx-cli 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -0
- package/lib/Utility/errorCode.d.ts +1 -0
- package/lib/Utility/errorCode.js +9 -0
- package/lib/Utility/errorCode.js.map +1 -0
- package/lib/Utility/errorHandler.d.ts +15 -0
- package/lib/Utility/errorHandler.js +27 -0
- package/lib/Utility/errorHandler.js.map +1 -0
- package/lib/Utility/fileSupport.d.ts +6 -0
- package/lib/Utility/fileSupport.js +51 -0
- package/lib/Utility/fileSupport.js.map +1 -0
- package/lib/Utility/jsonSupport.d.ts +8 -0
- package/lib/Utility/jsonSupport.js +55 -0
- package/lib/Utility/jsonSupport.js.map +1 -0
- package/lib/Utility/propertyFileValidator.d.ts +13 -0
- package/lib/Utility/propertyFileValidator.js +103 -0
- package/lib/Utility/propertyFileValidator.js.map +1 -0
- package/lib/Utility/provarConfig.d.ts +11 -0
- package/lib/Utility/provarConfig.js +42 -0
- package/lib/Utility/provarConfig.js.map +1 -0
- package/lib/Utility/sfProvarCommandResult.d.ts +12 -0
- package/lib/Utility/sfProvarCommandResult.js +34 -0
- package/lib/Utility/sfProvarCommandResult.js.map +1 -0
- package/lib/Utility/stringSupport.d.ts +6 -0
- package/lib/Utility/stringSupport.js +32 -0
- package/lib/Utility/stringSupport.js.map +1 -0
- package/lib/commands/sf/provar/config/generate.d.ts +14 -0
- package/lib/commands/sf/provar/config/generate.js +102 -0
- package/lib/commands/sf/provar/config/generate.js.map +1 -0
- package/lib/commands/sf/provar/config/get.d.ts +10 -0
- package/lib/commands/sf/provar/config/get.js +106 -0
- package/lib/commands/sf/provar/config/get.js.map +1 -0
- package/lib/commands/sf/provar/config/load.d.ts +12 -0
- package/lib/commands/sf/provar/config/load.js +87 -0
- package/lib/commands/sf/provar/config/load.js.map +1 -0
- package/lib/commands/sf/provar/config/set.d.ts +10 -0
- package/lib/commands/sf/provar/config/set.js +117 -0
- package/lib/commands/sf/provar/config/set.js.map +1 -0
- package/lib/commands/sf/provar/config/validate.d.ts +9 -0
- package/lib/commands/sf/provar/config/validate.js +40 -0
- package/lib/commands/sf/provar/config/validate.js.map +1 -0
- package/lib/constants/commandConstants.d.ts +7 -0
- package/lib/constants/commandConstants.js +12 -0
- package/lib/constants/commandConstants.js.map +1 -0
- package/lib/constants/errorMessages.d.ts +13 -0
- package/lib/constants/errorMessages.js +24 -0
- package/lib/constants/errorMessages.js.map +1 -0
- package/lib/constants/propertyFileContent.json +24 -0
- package/lib/constants/propertyFileSchema.d.ts +247 -0
- package/lib/constants/propertyFileSchema.js +243 -0
- package/lib/constants/propertyFileSchema.js.map +1 -0
- package/messages/sf.provar.config.generate.md +33 -0
- package/messages/sf.provar.config.get.md +17 -0
- package/messages/sf.provar.config.load.md +29 -0
- package/messages/sf.provar.config.set.md +17 -0
- package/messages/sf.provar.config.validate.md +21 -0
- package/oclif.manifest.json +143 -0
- package/package.json +214 -0
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2024 Provar Limited.
|
|
4
|
+
* All rights reserved.
|
|
5
|
+
* Licensed under the BSD 3-Clause license.
|
|
6
|
+
* For full license text, see LICENSE.md file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
|
+
*/
|
|
8
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
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
|
+
const fileSystem = __importStar(require("fs"));
|
|
36
|
+
const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
37
|
+
const core_1 = require("@salesforce/core");
|
|
38
|
+
const sfProvarCommandResult_1 = require("../../../../Utility/sfProvarCommandResult");
|
|
39
|
+
const errorHandler_1 = __importDefault(require("../../../../Utility/errorHandler"));
|
|
40
|
+
const provarConfig_1 = require("../../../../Utility/provarConfig");
|
|
41
|
+
const errorMessages_1 = require("../../../../constants/errorMessages");
|
|
42
|
+
const jsonSupport_1 = require("../../../../Utility/jsonSupport");
|
|
43
|
+
/**
|
|
44
|
+
* Gets the value for specified propertykey under arguments from provardx-properties.json
|
|
45
|
+
* laoded under config.json
|
|
46
|
+
*
|
|
47
|
+
*/
|
|
48
|
+
core_1.Messages.importMessagesDirectory(__dirname);
|
|
49
|
+
const messages = core_1.Messages.loadMessages('@provartesting/provardx-cli', 'sf.provar.config.get');
|
|
50
|
+
class SfProvarConfigGet extends sf_plugins_core_1.SfCommand {
|
|
51
|
+
constructor() {
|
|
52
|
+
super(...arguments);
|
|
53
|
+
this.errorHandler = new errorHandler_1.default();
|
|
54
|
+
}
|
|
55
|
+
async run() {
|
|
56
|
+
const { argv, flags } = await this.parse(SfProvarConfigGet);
|
|
57
|
+
const config = await provarConfig_1.ProvarConfig.loadConfig(this.errorHandler);
|
|
58
|
+
const propertiesFilePath = config.get('PROVARDX_PROPERTIES_FILE_PATH')?.toString();
|
|
59
|
+
let attributeValue = null;
|
|
60
|
+
if (propertiesFilePath === undefined || !fileSystem.existsSync(propertiesFilePath)) {
|
|
61
|
+
this.errorHandler.addErrorsToList('MISSING_FILE', errorMessages_1.errorMessages.MISSINGFILEERROR);
|
|
62
|
+
return (0, sfProvarCommandResult_1.populateResult)(flags, this.errorHandler, messages, this.log.bind(this));
|
|
63
|
+
}
|
|
64
|
+
try {
|
|
65
|
+
/* eslint-disable */
|
|
66
|
+
if (!argv.length) {
|
|
67
|
+
this.errorHandler.addErrorsToList('MISSING_PROPERTY', errorMessages_1.errorMessages.MISSING_PROPERTY_GET);
|
|
68
|
+
return (0, sfProvarCommandResult_1.populateResult)(flags, this.errorHandler, messages, this.log.bind(this));
|
|
69
|
+
}
|
|
70
|
+
const data = fileSystem.readFileSync(propertiesFilePath, { encoding: 'utf8' });
|
|
71
|
+
const propertyFileContent = JSON.parse(data);
|
|
72
|
+
const propertyName = argv[0];
|
|
73
|
+
if (propertyName.includes('.')) {
|
|
74
|
+
if (!(0, jsonSupport_1.checkNestedProperty)(propertyFileContent, propertyName)) {
|
|
75
|
+
this.errorHandler.addErrorsToList('UNKNOWN_PROPERTY', errorMessages_1.errorMessages.UNKNOWN_PROPERTY);
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
attributeValue = (0, jsonSupport_1.getNestedProperty)(propertyFileContent, propertyName);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
if (!propertyFileContent.hasOwnProperty(propertyName)) {
|
|
83
|
+
this.errorHandler.addErrorsToList('UNKNOWN_PROPERTY', errorMessages_1.errorMessages.UNKNOWN_PROPERTY);
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
attributeValue = propertyFileContent[propertyName];
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
catch (err) {
|
|
91
|
+
if (err.name === 'SyntaxError') {
|
|
92
|
+
this.errorHandler.addErrorsToList('MALFORMED_FILE', errorMessages_1.errorMessages.MALFORMEDFILEERROR);
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
throw err;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return (0, sfProvarCommandResult_1.populateResult)(flags, this.errorHandler, messages, this.log.bind(this), attributeValue);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
SfProvarConfigGet.summary = messages.getMessage('summary');
|
|
102
|
+
SfProvarConfigGet.description = messages.getMessage('description');
|
|
103
|
+
SfProvarConfigGet.examples = messages.getMessages('examples');
|
|
104
|
+
SfProvarConfigGet.strict = false;
|
|
105
|
+
exports.default = SfProvarConfigGet;
|
|
106
|
+
//# sourceMappingURL=get.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get.js","sourceRoot":"","sources":["../../../../../src/commands/sf/provar/config/get.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,+CAAiC;AACjC,iEAAwD;AACxD,2CAA4C;AAC5C,qFAAkG;AAClG,oFAA4D;AAC5D,mEAAgE;AAChE,uEAAoE;AACpE,iEAAyF;AAEzF;;;;GAIG;AAEH,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,6BAA6B,EAAE,sBAAsB,CAAC,CAAC;AAE9F,MAAqB,iBAAkB,SAAQ,2BAAgC;IAA/E;;QAMU,iBAAY,GAAG,IAAI,sBAAY,EAAE,CAAC;IA8C5C,CAAC;IA5CQ,KAAK,CAAC,GAA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
2
|
+
import { SfProvarCommandResult } from '../../../../Utility/sfProvarCommandResult';
|
|
3
|
+
export default class SfProvarConfigLoad extends SfCommand<SfProvarCommandResult> {
|
|
4
|
+
static readonly summary: string;
|
|
5
|
+
static readonly description: string;
|
|
6
|
+
static readonly examples: string[];
|
|
7
|
+
static readonly flags: {
|
|
8
|
+
'properties-file': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
9
|
+
};
|
|
10
|
+
private errorHandler;
|
|
11
|
+
run(): Promise<SfProvarCommandResult>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2024 Provar Limited.
|
|
4
|
+
* All rights reserved.
|
|
5
|
+
* Licensed under the BSD 3-Clause license.
|
|
6
|
+
* For full license text, see LICENSE.md file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
|
+
*/
|
|
8
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
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
|
+
const fileSystem = __importStar(require("fs"));
|
|
36
|
+
const path_1 = require("path");
|
|
37
|
+
const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
38
|
+
const core_1 = require("@salesforce/core");
|
|
39
|
+
const sfProvarCommandResult_1 = require("../../../../Utility/sfProvarCommandResult");
|
|
40
|
+
const errorHandler_1 = __importDefault(require("../../../../Utility/errorHandler"));
|
|
41
|
+
const provarConfig_1 = require("../../../../Utility/provarConfig");
|
|
42
|
+
const propertyFileValidator_1 = __importDefault(require("../../../../Utility/propertyFileValidator"));
|
|
43
|
+
const errorMessages_1 = require("../../../../constants/errorMessages");
|
|
44
|
+
/**
|
|
45
|
+
* Loads the path to provardx-properties.json to the user directory ${user}/.sf/config.json
|
|
46
|
+
* So, that further any command can be run at any location by picking up the properties.json file
|
|
47
|
+
* from config.json file.
|
|
48
|
+
*
|
|
49
|
+
*/
|
|
50
|
+
core_1.Messages.importMessagesDirectory(__dirname);
|
|
51
|
+
const messages = core_1.Messages.loadMessages('@provartesting/provardx-cli', 'sf.provar.config.load');
|
|
52
|
+
class SfProvarConfigLoad extends sf_plugins_core_1.SfCommand {
|
|
53
|
+
constructor() {
|
|
54
|
+
super(...arguments);
|
|
55
|
+
this.errorHandler = new errorHandler_1.default();
|
|
56
|
+
}
|
|
57
|
+
async run() {
|
|
58
|
+
const { flags } = await this.parse(SfProvarConfigLoad);
|
|
59
|
+
/* eslint-disable */
|
|
60
|
+
const propertiesFileName = (0, path_1.resolve)(flags['properties-file']);
|
|
61
|
+
const propertyFileValidator = new propertyFileValidator_1.default(this.errorHandler);
|
|
62
|
+
const config = await provarConfig_1.ProvarConfig.loadConfig(this.errorHandler);
|
|
63
|
+
if (!fileSystem.existsSync(propertiesFileName)) {
|
|
64
|
+
this.errorHandler.addErrorsToList('INVALID_PATH', errorMessages_1.errorMessages.INVALID_PATH);
|
|
65
|
+
return (0, sfProvarCommandResult_1.populateResult)(flags, this.errorHandler, messages, this.log.bind(this));
|
|
66
|
+
}
|
|
67
|
+
config.set('PROVARDX_PROPERTIES_FILE_PATH', propertiesFileName);
|
|
68
|
+
await config.write();
|
|
69
|
+
if (!(await propertyFileValidator.validate())) {
|
|
70
|
+
config.unset('PROVARDX_PROPERTIES_FILE_PATH');
|
|
71
|
+
await config.write();
|
|
72
|
+
}
|
|
73
|
+
return (0, sfProvarCommandResult_1.populateResult)(flags, this.errorHandler, messages, this.log.bind(this));
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
SfProvarConfigLoad.summary = messages.getMessage('summary');
|
|
77
|
+
SfProvarConfigLoad.description = messages.getMessage('description');
|
|
78
|
+
SfProvarConfigLoad.examples = messages.getMessages('examples');
|
|
79
|
+
SfProvarConfigLoad.flags = {
|
|
80
|
+
'properties-file': sf_plugins_core_1.Flags.string({
|
|
81
|
+
summary: messages.getMessage('flags.properties-file.summary'),
|
|
82
|
+
char: 'p',
|
|
83
|
+
required: true,
|
|
84
|
+
}),
|
|
85
|
+
};
|
|
86
|
+
exports.default = SfProvarConfigLoad;
|
|
87
|
+
//# sourceMappingURL=load.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load.js","sourceRoot":"","sources":["../../../../../src/commands/sf/provar/config/load.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,+CAAiC;AACjC,+BAA+B;AAC/B,iEAA+D;AAC/D,2CAA4C;AAC5C,qFAAkG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MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;SACtB;QAED,OAAO,IAAA,sCAAc,EAAC,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,QAAQ,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACjF,CAAC;;AA/BsB,0BAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,AAAjC,CAAkC;AACzC,8BAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,AAArC,CAAsC;AACjD,2BAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,AAAnC,CAAoC;AAC5C,wBAAK,GAAG;IAC7B,iBAAiB,EAAE,uBAAK,CAAC,MAAM,CAAC;QAC9B,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,+BAA+B,CAAC;QAC7D,IAAI,EAAE,GAAG;QACT,QAAQ,EAAE,IAAI;KACf,CAAC;CACH,AAN2B,CAM1B;kBAViB,kBAAkB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
import { SfProvarCommandResult } from '../../../../Utility/sfProvarCommandResult';
|
|
3
|
+
export default class SfProvarConfigSet extends SfCommand<SfProvarCommandResult> {
|
|
4
|
+
static readonly summary: string;
|
|
5
|
+
static readonly description: string;
|
|
6
|
+
static readonly examples: string[];
|
|
7
|
+
static readonly strict = false;
|
|
8
|
+
private errorHandler;
|
|
9
|
+
run(): Promise<SfProvarCommandResult>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2024 Provar Limited.
|
|
4
|
+
* All rights reserved.
|
|
5
|
+
* Licensed under the BSD 3-Clause license.
|
|
6
|
+
* For full license text, see LICENSE.md file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
|
+
*/
|
|
8
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
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
|
+
const fileSystem = __importStar(require("fs"));
|
|
36
|
+
const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
37
|
+
const core_1 = require("@salesforce/core");
|
|
38
|
+
const sfProvarCommandResult_1 = require("../../../../Utility/sfProvarCommandResult");
|
|
39
|
+
const errorHandler_1 = __importDefault(require("../../../../Utility/errorHandler"));
|
|
40
|
+
const errorMessages_1 = require("../../../../constants/errorMessages");
|
|
41
|
+
const provarConfig_1 = require("../../../../Utility/provarConfig");
|
|
42
|
+
const jsonSupport_1 = require("../../../../Utility/jsonSupport");
|
|
43
|
+
/**
|
|
44
|
+
* Sets the specified property key and value inside provardx-properties.json
|
|
45
|
+
* loaded under config file
|
|
46
|
+
*
|
|
47
|
+
*/
|
|
48
|
+
core_1.Messages.importMessagesDirectory(__dirname);
|
|
49
|
+
const messages = core_1.Messages.loadMessages('@provartesting/provardx-cli', 'sf.provar.config.set');
|
|
50
|
+
class SfProvarConfigSet extends sf_plugins_core_1.SfCommand {
|
|
51
|
+
constructor() {
|
|
52
|
+
super(...arguments);
|
|
53
|
+
this.errorHandler = new errorHandler_1.default();
|
|
54
|
+
}
|
|
55
|
+
async run() {
|
|
56
|
+
const { argv, flags } = await this.parse(SfProvarConfigSet);
|
|
57
|
+
// eslint-disable-next-line
|
|
58
|
+
const config = await provarConfig_1.ProvarConfig.loadConfig(this.errorHandler);
|
|
59
|
+
const propertiesFilePath = config.get('PROVARDX_PROPERTIES_FILE_PATH')?.toString();
|
|
60
|
+
if (propertiesFilePath === undefined || !fileSystem.existsSync(propertiesFilePath)) {
|
|
61
|
+
this.errorHandler.addErrorsToList('MISSING_FILE', errorMessages_1.errorMessages.MISSINGFILEERROR);
|
|
62
|
+
return (0, sfProvarCommandResult_1.populateResult)(flags, this.errorHandler, messages, this.log.bind(this));
|
|
63
|
+
}
|
|
64
|
+
try {
|
|
65
|
+
/* eslint-disable */
|
|
66
|
+
const parsed = (0, sf_plugins_core_1.parseVarArgs)({}, argv);
|
|
67
|
+
if (Object.keys(parsed).length === 0) {
|
|
68
|
+
this.errorHandler.addErrorsToList('MISSING_PROPERTY', errorMessages_1.errorMessages.MISSING_PROPERTY);
|
|
69
|
+
return (0, sfProvarCommandResult_1.populateResult)(flags, this.errorHandler, messages, this.log.bind(this));
|
|
70
|
+
}
|
|
71
|
+
const data = fileSystem.readFileSync(propertiesFilePath, { encoding: 'utf8' });
|
|
72
|
+
const propertyFileContent = JSON.parse(data);
|
|
73
|
+
for (let [propertyName, propertyValue] of Object.entries(parsed)) {
|
|
74
|
+
if (!propertyValue) {
|
|
75
|
+
this.errorHandler.addErrorsToList('MISSING_VALUE', errorMessages_1.errorMessages.MISSING_VALUE);
|
|
76
|
+
}
|
|
77
|
+
if (propertyName.length < 1) {
|
|
78
|
+
this.errorHandler.addErrorsToList('MISSING_PROPERTY', errorMessages_1.errorMessages.MISSING_PROPERTY);
|
|
79
|
+
}
|
|
80
|
+
try {
|
|
81
|
+
propertyValue = (0, jsonSupport_1.parseJSONString)(propertyValue);
|
|
82
|
+
}
|
|
83
|
+
catch (err) {
|
|
84
|
+
this.errorHandler.addErrorsToList('INVALID_VALUE', errorMessages_1.errorMessages.INVALID_VALUE);
|
|
85
|
+
return (0, sfProvarCommandResult_1.populateResult)(flags, this.errorHandler, messages, this.log.bind(this));
|
|
86
|
+
}
|
|
87
|
+
if (propertyName.includes('.')) {
|
|
88
|
+
(0, jsonSupport_1.setNestedProperty)(propertyFileContent, propertyName, propertyValue);
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
propertyFileContent[propertyName] = propertyValue;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
if (this.errorHandler.getErrors().length == 0) {
|
|
95
|
+
fileSystem.writeFileSync(propertiesFilePath, JSON.stringify(propertyFileContent, null, 3));
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
catch (err) {
|
|
99
|
+
if (err.name === 'InvalidArgumentFormatError') {
|
|
100
|
+
this.errorHandler.addErrorsToList('INVALID_ARGUMENT', errorMessages_1.errorMessages.INVALID_ARGUMENT);
|
|
101
|
+
}
|
|
102
|
+
else if (err.name === 'SyntaxError') {
|
|
103
|
+
this.errorHandler.addErrorsToList('MALFORMED_FILE', errorMessages_1.errorMessages.MALFORMEDFILEERROR);
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
throw err;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return (0, sfProvarCommandResult_1.populateResult)(flags, this.errorHandler, messages, this.log.bind(this));
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
SfProvarConfigSet.summary = messages.getMessage('summary');
|
|
113
|
+
SfProvarConfigSet.description = messages.getMessage('description');
|
|
114
|
+
SfProvarConfigSet.examples = messages.getMessages('examples');
|
|
115
|
+
SfProvarConfigSet.strict = false;
|
|
116
|
+
exports.default = SfProvarConfigSet;
|
|
117
|
+
//# sourceMappingURL=set.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set.js","sourceRoot":"","sources":["../../../../../src/commands/sf/provar/config/set.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,+CAAiC;AACjC,iEAAsE;AACtE,2CAA4C;AAC5C,qFAAkG;AAClG,oFAA4D;AAC5D,uEAAoE;AACpE,mEAAgE;AAChE,iEAAqF;AAErF;;;;GAIG;AAEH,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,6BAA6B,EAAE,sBAAsB,CAAC,CAAC;AAE9F,MAAqB,iBAAkB,SAAQ,2BAAgC;IAA/E;;QAMU,iBAAY,GAAG,IAAI,sBAAY,EAAE,CAAC;IAwD5C,CAAC;IAtDQ,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;QAC5D,2BAA2B;QAC3B,MAAM,MAAM,GAAiB,MAAM,2BAAY,CAAC,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAC9E,MAAM,kBAAkB,GAAG,MAAM,CAAC,GAAG,CAAC,+BAA+B,CAAC,EAAE,QAAQ,EAAE,CAAC;QAEnF,IAAI,kBAAkB,KAAK,SAAS,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,kBAAkB,CAAC,EAAE;YAClF,IAAI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BAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,AAAjC,CAAkC;AACzC,6BAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,AAArC,CAAsC;AACjD,0BAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,AAAnC,CAAoC;AAC5C,wBAAM,GAAG,KAAK,AAAR,CAAS;kBAJnB,iBAAiB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
import { SfProvarCommandResult } from '../../../../Utility/sfProvarCommandResult';
|
|
3
|
+
export default class SfProvarConfigValidate extends SfCommand<SfProvarCommandResult> {
|
|
4
|
+
static readonly summary: string;
|
|
5
|
+
static readonly description: string;
|
|
6
|
+
static readonly examples: string[];
|
|
7
|
+
private errorHandler;
|
|
8
|
+
run(): Promise<SfProvarCommandResult>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2024 Provar Limited.
|
|
4
|
+
* All rights reserved.
|
|
5
|
+
* Licensed under the BSD 3-Clause license.
|
|
6
|
+
* For full license text, see LICENSE.md file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
|
+
*/
|
|
8
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
13
|
+
const core_1 = require("@salesforce/core");
|
|
14
|
+
const errorHandler_1 = __importDefault(require("../../../../Utility/errorHandler"));
|
|
15
|
+
const sfProvarCommandResult_1 = require("../../../../Utility/sfProvarCommandResult");
|
|
16
|
+
const propertyFileValidator_1 = __importDefault(require("../../../../Utility/propertyFileValidator"));
|
|
17
|
+
/**
|
|
18
|
+
* Validates the provardx-properties.json against JSON standards and provardx schema
|
|
19
|
+
* mentioned under PropertyFileSchema.ts
|
|
20
|
+
*
|
|
21
|
+
*/
|
|
22
|
+
core_1.Messages.importMessagesDirectory(__dirname);
|
|
23
|
+
const messages = core_1.Messages.loadMessages('@provartesting/provardx-cli', 'sf.provar.config.validate');
|
|
24
|
+
class SfProvarConfigValidate extends sf_plugins_core_1.SfCommand {
|
|
25
|
+
constructor() {
|
|
26
|
+
super(...arguments);
|
|
27
|
+
this.errorHandler = new errorHandler_1.default();
|
|
28
|
+
}
|
|
29
|
+
async run() {
|
|
30
|
+
const { flags } = await this.parse(SfProvarConfigValidate);
|
|
31
|
+
const propertyFileValidator = new propertyFileValidator_1.default(this.errorHandler);
|
|
32
|
+
await propertyFileValidator.validate();
|
|
33
|
+
return (0, sfProvarCommandResult_1.populateResult)(flags, this.errorHandler, messages, this.log.bind(this));
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
SfProvarConfigValidate.summary = messages.getMessage('summary');
|
|
37
|
+
SfProvarConfigValidate.description = messages.getMessage('description');
|
|
38
|
+
SfProvarConfigValidate.examples = messages.getMessages('examples');
|
|
39
|
+
exports.default = SfProvarConfigValidate;
|
|
40
|
+
//# sourceMappingURL=validate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../../../../../src/commands/sf/provar/config/validate.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;AAEH,iEAAwD;AACxD,2CAA4C;AAC5C,oFAA4D;AAC5D,qFAAkG;AAClG,sGAA8E;AAE9E;;;;GAIG;AAEH,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,6BAA6B,EAAE,2BAA2B,CAAC,CAAC;AAEnG,MAAqB,sBAAuB,SAAQ,2BAAgC;IAApF;;QAIU,iBAAY,GAAiB,IAAI,sBAAY,EAAE,CAAC;IAS1D,CAAC;IAPQ,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC;QAC3D,MAAM,qBAAqB,GAAG,IAAI,+BAAqB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAC3E,MAAM,qBAAqB,CAAC,QAAQ,EAAE,CAAC;QAEvC,OAAO,IAAA,sCAAc,EAAC,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,QAAQ,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACjF,CAAC;;AAXsB,8BAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,AAAjC,CAAkC;AACzC,kCAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,AAArC,CAAsC;AACjD,+BAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,AAAnC,CAAoC;kBAHhD,sBAAsB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare enum commandConstants {
|
|
2
|
+
SF_PROVAR_CONFIG_GENERATE_COMMAND = "sf provar config generate",
|
|
3
|
+
SF_PROVAR_CONFIG_LOAD_COMMAND = "sf provar config load",
|
|
4
|
+
SF_PROVAR_CONFIG_VALIDATE_COMMAND = "sf provar config validate",
|
|
5
|
+
SF_PROVAR_CONFIG_SET_COMMAND = "sf provar config set",
|
|
6
|
+
SF_PROVAR_CONFIG_GET_COMMAND = "sf provar config get"
|
|
7
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.commandConstants = void 0;
|
|
4
|
+
var commandConstants;
|
|
5
|
+
(function (commandConstants) {
|
|
6
|
+
commandConstants["SF_PROVAR_CONFIG_GENERATE_COMMAND"] = "sf provar config generate";
|
|
7
|
+
commandConstants["SF_PROVAR_CONFIG_LOAD_COMMAND"] = "sf provar config load";
|
|
8
|
+
commandConstants["SF_PROVAR_CONFIG_VALIDATE_COMMAND"] = "sf provar config validate";
|
|
9
|
+
commandConstants["SF_PROVAR_CONFIG_SET_COMMAND"] = "sf provar config set";
|
|
10
|
+
commandConstants["SF_PROVAR_CONFIG_GET_COMMAND"] = "sf provar config get";
|
|
11
|
+
})(commandConstants || (exports.commandConstants = commandConstants = {}));
|
|
12
|
+
//# sourceMappingURL=commandConstants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commandConstants.js","sourceRoot":"","sources":["../../src/constants/commandConstants.ts"],"names":[],"mappings":";;;AAAA,IAAY,gBAMX;AAND,WAAY,gBAAgB;IAC1B,mFAA+D,CAAA;IAC/D,2EAAuD,CAAA;IACvD,mFAA+D,CAAA;IAC/D,yEAAqD,CAAA;IACrD,yEAAqD,CAAA;AACvD,CAAC,EANW,gBAAgB,gCAAhB,gBAAgB,QAM3B"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare enum errorMessages {
|
|
2
|
+
INVALID_PATH = "The provided path does not exist or is invalid.",
|
|
3
|
+
GENERATE_OPERATION_DENIED = "The operation was cancelled.",
|
|
4
|
+
MISSINGFILEERROR = "The properties file has not been loaded or cannot be accessed.",
|
|
5
|
+
MALFORMEDFILEERROR = "The properties file is not a valid JSON.",
|
|
6
|
+
MISSING_VALUE = "The value is missing.",
|
|
7
|
+
MISSING_PROPERTY = "The property is missing.",
|
|
8
|
+
INVALID_ARGUMENT = "The property/value cannot be parsed.",
|
|
9
|
+
INVALID_VALUE = "The value cannot be parsed.",
|
|
10
|
+
INVALID_PROPERTY = "The property cannot be parsed.",
|
|
11
|
+
MISSING_PROPERTY_GET = "Please, specify a property to get from the properties file.",
|
|
12
|
+
UNKNOWN_PROPERTY = "The property is not present in the file."
|
|
13
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.errorMessages = void 0;
|
|
4
|
+
/*
|
|
5
|
+
* Copyright (c) 2024 Provar Limited.
|
|
6
|
+
* All rights reserved.
|
|
7
|
+
* Licensed under the BSD 3-Clause license.
|
|
8
|
+
* For full license text, see LICENSE.md file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
9
|
+
*/
|
|
10
|
+
var errorMessages;
|
|
11
|
+
(function (errorMessages) {
|
|
12
|
+
errorMessages["INVALID_PATH"] = "The provided path does not exist or is invalid.";
|
|
13
|
+
errorMessages["GENERATE_OPERATION_DENIED"] = "The operation was cancelled.";
|
|
14
|
+
errorMessages["MISSINGFILEERROR"] = "The properties file has not been loaded or cannot be accessed.";
|
|
15
|
+
errorMessages["MALFORMEDFILEERROR"] = "The properties file is not a valid JSON.";
|
|
16
|
+
errorMessages["MISSING_VALUE"] = "The value is missing.";
|
|
17
|
+
errorMessages["MISSING_PROPERTY"] = "The property is missing.";
|
|
18
|
+
errorMessages["INVALID_ARGUMENT"] = "The property/value cannot be parsed.";
|
|
19
|
+
errorMessages["INVALID_VALUE"] = "The value cannot be parsed.";
|
|
20
|
+
errorMessages["INVALID_PROPERTY"] = "The property cannot be parsed.";
|
|
21
|
+
errorMessages["MISSING_PROPERTY_GET"] = "Please, specify a property to get from the properties file.";
|
|
22
|
+
errorMessages["UNKNOWN_PROPERTY"] = "The property is not present in the file.";
|
|
23
|
+
})(errorMessages || (exports.errorMessages = errorMessages = {}));
|
|
24
|
+
//# sourceMappingURL=errorMessages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errorMessages.js","sourceRoot":"","sources":["../../src/constants/errorMessages.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,IAAY,aAYX;AAZD,WAAY,aAAa;IACvB,iFAAgE,CAAA;IAChE,2EAA0D,CAAA;IAC1D,oGAAmF,CAAA;IACnF,gFAA+D,CAAA;IAC/D,wDAAuC,CAAA;IACvC,8DAA6C,CAAA;IAC7C,0EAAyD,CAAA;IACzD,8DAA6C,CAAA;IAC7C,oEAAmD,CAAA;IACnD,qGAAoF,CAAA;IACpF,8EAA6D,CAAA;AAC/D,CAAC,EAZW,aAAa,6BAAb,aAAa,QAYxB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"provarHome": "${PROVAR_HOME}",
|
|
3
|
+
"projectPath": "${PROVAR_PROJECT_PATH}",
|
|
4
|
+
"resultsPath": "${PROVAR_RESULTS_PATH}",
|
|
5
|
+
"smtpPath": "",
|
|
6
|
+
"resultsPathDisposition": "Increment",
|
|
7
|
+
"testOutputLevel": "BASIC",
|
|
8
|
+
"pluginOutputlevel": "WARNING",
|
|
9
|
+
"stopOnError": false,
|
|
10
|
+
"lightningMode": true,
|
|
11
|
+
"connectionRefreshType": "Reload",
|
|
12
|
+
"metadata": {
|
|
13
|
+
"metadataLevel": "Reuse",
|
|
14
|
+
"cachePath": "../.provarCaches"
|
|
15
|
+
},
|
|
16
|
+
"environment": {
|
|
17
|
+
"testEnvironment": "${PROVAR_TEST_ENVIRONMENT}",
|
|
18
|
+
"webBrowser": "Chrome",
|
|
19
|
+
"webBrowserConfig": "Full Screen",
|
|
20
|
+
"webBrowserProviderName": "Desktop",
|
|
21
|
+
"webBrowserDeviceName": "Full Screen"
|
|
22
|
+
},
|
|
23
|
+
"testprojectSecrets": "${PROVAR_TEST_PROJECT_SECRETS}"
|
|
24
|
+
}
|