@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
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { sfCommandConstants } from '../constants/sfCommandConstants.js';
|
|
2
|
+
import { executeCommand } from './provardxExecutor.js';
|
|
3
|
+
export default class UserSupport {
|
|
4
|
+
/**
|
|
5
|
+
* Updates the dx properties json string before it is send to command executer.
|
|
6
|
+
*/
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
prepareRawProperties(rawProperties) {
|
|
9
|
+
return '"' + rawProperties.replace(/"/g, '\\"') + '"';
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Gets the dx user info and generated the password for dx user if not already created.
|
|
13
|
+
*
|
|
14
|
+
* @param overrides Connection overrides provided in dx property file.
|
|
15
|
+
*/
|
|
16
|
+
async getDxUsersInfo(overrides, errorHandler) {
|
|
17
|
+
const dxUsers = [];
|
|
18
|
+
if (overrides === undefined || overrides.length === 0) {
|
|
19
|
+
return dxUsers;
|
|
20
|
+
}
|
|
21
|
+
for (const override of overrides) {
|
|
22
|
+
const username = override.username;
|
|
23
|
+
const message = 'Validating and retrieving dx user info: ' + username;
|
|
24
|
+
let dxUserInfo = await executeCommand(sfCommandConstants.DISPLAY_USER_INFO + username, message);
|
|
25
|
+
let jsonDxUser = JSON.parse(dxUserInfo);
|
|
26
|
+
if (jsonDxUser.status !== 0) {
|
|
27
|
+
errorHandler.addErrorsToList('DOWNLOAD_ERROR', `The following connectionOverride username is not valid: ${username}`);
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
({ jsonDxUser, dxUserInfo } = await this.generatePasswordIfNotPresent(jsonDxUser, username, dxUserInfo));
|
|
31
|
+
jsonDxUser.result.connection = override['connection'];
|
|
32
|
+
jsonDxUser.result.password = this.handleSpecialCharacters(jsonDxUser.result.password);
|
|
33
|
+
dxUsers.push(jsonDxUser);
|
|
34
|
+
}
|
|
35
|
+
if (dxUsers.length === 0) {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
return dxUsers;
|
|
39
|
+
}
|
|
40
|
+
async generatePasswordIfNotPresent(jsonDxUser, username, dxUserInfo) {
|
|
41
|
+
if (jsonDxUser.result.password == null) {
|
|
42
|
+
const generatePasswordCommand = sfCommandConstants.GENERATE_PASSWORD + username;
|
|
43
|
+
await executeCommand(generatePasswordCommand, 'Generating password for user: ' + username);
|
|
44
|
+
dxUserInfo = await executeCommand(sfCommandConstants.DISPLAY_USER_INFO + username, 'Getting generated password for user: ' + username);
|
|
45
|
+
jsonDxUser = JSON.parse(dxUserInfo.toString());
|
|
46
|
+
}
|
|
47
|
+
return { jsonDxUser, dxUserInfo };
|
|
48
|
+
}
|
|
49
|
+
handleSpecialCharacters(password) {
|
|
50
|
+
if (password) {
|
|
51
|
+
password = encodeURIComponent(password);
|
|
52
|
+
}
|
|
53
|
+
return password;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=userSupport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"userSupport.js","sourceRoot":"","sources":["../../src/Utility/userSupport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAExE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,MAAM,CAAC,OAAO,OAAO,WAAW;IAC9B;;OAEG;IACH,oBAAoB;IACb,oBAAoB,CAAC,aAAqB;QAC/C,OAAO,GAAG,GAAG,aAAa,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,GAAG,CAAC;IACxD,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,cAAc,CAAC,SAAc,EAAE,YAA0B;QACpE,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AI,IAAI,EAAE,CAAC;YACvC,MAAM,uBAAuB,GAAG,kBAAkB,CAAC,iBAAiB,GAAG,QAAQ,CAAC;YAChF,MAAM,cAAc,CAAC,uBAAuB,EAAE,gCAAgC,GAAG,QAAQ,CAAC,CAAC;YAC3F,UAAU,GAAG,MAAM,cAAc,CAC/B,kBAAkB,CAAC,iBAAiB,GAAG,QAAQ,EAC/C,uCAAuC,GAAG,QAAQ,CACnD,CAAC;YACF,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAC;QACjD,CAAC;QACD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC;IACpC,CAAC;IAEO,uBAAuB,CAAC,QAAgB;QAC9C,IAAI,QAAQ,EAAE,CAAC;YACb,QAAQ,GAAG,kBAAkB,CAAC,QAAQ,CAAC,CAAC;QAC1C,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
-
import { SfProvarCommandResult } from '../../../../Utility/sfProvarCommandResult';
|
|
2
|
+
import { SfProvarCommandResult } from '../../../../Utility/sfProvarCommandResult.js';
|
|
3
3
|
export default class SfProvarConfigGenerate extends SfCommand<SfProvarCommandResult> {
|
|
4
4
|
static readonly summary: string;
|
|
5
5
|
static readonly description: string;
|
|
6
6
|
static readonly examples: string[];
|
|
7
7
|
static readonly flags: {
|
|
8
|
-
'properties-file': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
9
|
-
'no-prompt': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
'properties-file': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
9
|
+
'no-prompt': import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
10
10
|
};
|
|
11
11
|
private errorHandler;
|
|
12
12
|
run(): Promise<SfProvarCommandResult>;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2024 Provar Limited.
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* Licensed under the BSD 3-Clause license.
|
|
5
|
+
* For full license text, see LICENSE.md file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
6
|
+
*/
|
|
7
|
+
import fs from 'node:fs';
|
|
8
|
+
import { Messages } from '@salesforce/core';
|
|
9
|
+
import { Flags, SfCommand } from '@salesforce/sf-plugins-core';
|
|
10
|
+
import { populateResult } from '../../../../Utility/sfProvarCommandResult.js';
|
|
11
|
+
import { generateFile, getExtension } from '../../../../Utility/fileSupport.js';
|
|
12
|
+
import ErrorHandler from '../../../../Utility/errorHandler.js';
|
|
13
|
+
import { errorMessages } from '../../../../constants/errorMessages.js';
|
|
14
|
+
/**
|
|
15
|
+
* Generates the boiler plate provardx-properties.json
|
|
16
|
+
*
|
|
17
|
+
*/
|
|
18
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
19
|
+
const messages = Messages.loadMessages('@provartesting/provardx-cli', 'sf.provar.config.generate');
|
|
20
|
+
export default class SfProvarConfigGenerate extends SfCommand {
|
|
21
|
+
static summary = messages.getMessage('summary');
|
|
22
|
+
static description = messages.getMessage('description');
|
|
23
|
+
static examples = messages.getMessages('examples');
|
|
24
|
+
static flags = {
|
|
25
|
+
'properties-file': Flags.string({
|
|
26
|
+
summary: messages.getMessage('flags.properties-file.summary'),
|
|
27
|
+
char: 'p',
|
|
28
|
+
required: true,
|
|
29
|
+
}),
|
|
30
|
+
'no-prompt': Flags.boolean({
|
|
31
|
+
summary: messages.getMessage('flags.no-prompt.summary'),
|
|
32
|
+
char: 'n',
|
|
33
|
+
}),
|
|
34
|
+
};
|
|
35
|
+
errorHandler = new ErrorHandler();
|
|
36
|
+
async run() {
|
|
37
|
+
const { flags } = await this.parse(SfProvarConfigGenerate);
|
|
38
|
+
const PropertiesFileName = flags['properties-file'];
|
|
39
|
+
if (getExtension(PropertiesFileName) !== '.json') {
|
|
40
|
+
this.errorHandler.addErrorsToList('INVALID_FILE_EXTENSION', 'Only the .json file extension is supported.');
|
|
41
|
+
}
|
|
42
|
+
else if (fs.existsSync(PropertiesFileName) && !flags['no-prompt']) {
|
|
43
|
+
if (!(await this.confirm({ message: messages.getMessage('PropertiesFileOverwritePromptConfirm') }))) {
|
|
44
|
+
this.errorHandler.addErrorsToList('GENERATE_OPERATION_DENIED', errorMessages.GENERATE_OPERATION_DENIED);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
this.generatePropertiesFile(PropertiesFileName);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
this.generatePropertiesFile(PropertiesFileName);
|
|
52
|
+
}
|
|
53
|
+
return populateResult(flags, this.errorHandler, messages, this.log.bind(this));
|
|
54
|
+
}
|
|
55
|
+
generatePropertiesFile(PropertiesFileName) {
|
|
56
|
+
try {
|
|
57
|
+
generateFile(PropertiesFileName);
|
|
58
|
+
/* eslint-disable */
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
if (error.code === 'ENOENT') {
|
|
62
|
+
this.errorHandler.addErrorsToList('INVALID_PATH', errorMessages.INVALID_PATH);
|
|
63
|
+
}
|
|
64
|
+
else if (error.code === 'EPERM' || error.code === 'EACCES') {
|
|
65
|
+
this.errorHandler.addErrorsToList('INSUFFICIENT_PERMISSIONS', 'The user does not have permissions to create the file.');
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=generate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../../../src/commands/provar/automation/config/generate.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,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CAAC,IAAI,KAAK,OAAO,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;gBAC7D,IAAI,CAAC,YAAY,CAAC,eAAe,CAC/B,0BAA0B,EAC1B,wDAAwD,CACzD,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
-
import { SfProvarCommandResult } from '../../../../Utility/sfProvarCommandResult';
|
|
2
|
+
import { SfProvarCommandResult } from '../../../../Utility/sfProvarCommandResult.js';
|
|
3
3
|
export default class SfProvarConfigGet extends SfCommand<SfProvarCommandResult> {
|
|
4
4
|
static readonly summary: string;
|
|
5
5
|
static readonly description: string;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2024 Provar Limited.
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* Licensed under the BSD 3-Clause license.
|
|
5
|
+
* For full license text, see LICENSE.md file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
6
|
+
*/
|
|
7
|
+
import * as fileSystem from 'node:fs';
|
|
8
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
9
|
+
import { Messages } from '@salesforce/core';
|
|
10
|
+
import { populateResult } from '../../../../Utility/sfProvarCommandResult.js';
|
|
11
|
+
import ErrorHandler from '../../../../Utility/errorHandler.js';
|
|
12
|
+
import { ProvarConfig } from '../../../../Utility/provarConfig.js';
|
|
13
|
+
import { errorMessages } from '../../../../constants/errorMessages.js';
|
|
14
|
+
import { checkNestedProperty, getNestedProperty } from '../../../../Utility/jsonSupport.js';
|
|
15
|
+
/**
|
|
16
|
+
* Gets the value for specified propertykey under arguments from provardx-properties.json
|
|
17
|
+
* laoded under config.json
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
21
|
+
const messages = Messages.loadMessages('@provartesting/provardx-cli', 'sf.provar.config.get');
|
|
22
|
+
export default class SfProvarConfigGet extends SfCommand {
|
|
23
|
+
static summary = messages.getMessage('summary');
|
|
24
|
+
static description = messages.getMessage('description');
|
|
25
|
+
static examples = messages.getMessages('examples');
|
|
26
|
+
static strict = false;
|
|
27
|
+
errorHandler = new ErrorHandler();
|
|
28
|
+
async run() {
|
|
29
|
+
const { argv, flags } = await this.parse(SfProvarConfigGet);
|
|
30
|
+
const config = await ProvarConfig.loadConfig(this.errorHandler);
|
|
31
|
+
const propertiesFilePath = config.get('PROVARDX_PROPERTIES_FILE_PATH')?.toString();
|
|
32
|
+
let attributeValue = null;
|
|
33
|
+
if (propertiesFilePath === undefined || !fileSystem.existsSync(propertiesFilePath)) {
|
|
34
|
+
this.errorHandler.addErrorsToList('MISSING_FILE', errorMessages.MISSINGFILEERROR);
|
|
35
|
+
return populateResult(flags, this.errorHandler, messages, this.log.bind(this));
|
|
36
|
+
}
|
|
37
|
+
try {
|
|
38
|
+
/* eslint-disable */
|
|
39
|
+
if (!argv.length) {
|
|
40
|
+
this.errorHandler.addErrorsToList('MISSING_PROPERTY', errorMessages.MISSING_PROPERTY_GET);
|
|
41
|
+
return populateResult(flags, this.errorHandler, messages, this.log.bind(this));
|
|
42
|
+
}
|
|
43
|
+
const data = fileSystem.readFileSync(propertiesFilePath, { encoding: 'utf8' });
|
|
44
|
+
const propertyFileContent = JSON.parse(data);
|
|
45
|
+
const propertyName = argv[0];
|
|
46
|
+
if (propertyName.includes('.')) {
|
|
47
|
+
if (!checkNestedProperty(propertyFileContent, propertyName)) {
|
|
48
|
+
this.errorHandler.addErrorsToList('UNKNOWN_PROPERTY', errorMessages.UNKNOWN_PROPERTY);
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
attributeValue = getNestedProperty(propertyFileContent, propertyName);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
if (!propertyFileContent.hasOwnProperty(propertyName)) {
|
|
56
|
+
this.errorHandler.addErrorsToList('UNKNOWN_PROPERTY', errorMessages.UNKNOWN_PROPERTY);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
attributeValue = propertyFileContent[propertyName];
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
catch (err) {
|
|
64
|
+
if (err.name === 'SyntaxError') {
|
|
65
|
+
this.errorHandler.addErrorsToList('MALFORMED_FILE', errorMessages.MALFORMEDFILEERROR);
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
throw err;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return populateResult(flags, this.errorHandler, messages, this.log.bind(this), attributeValue);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=get.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get.js","sourceRoot":"","sources":["../../../../../src/commands/provar/automation/config/get.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,UAAU,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAyB,cAAc,EAAE,MAAM,8CAA8C,CAAC;AACrG,OAAO,YAAY,MAAM,qCAAqC,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAE5F;;;;GAIG;AAEH,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,6BAA6B,EAAE,sBAAsB,CAAC,CAAC;AAE9F,MAAM,CAAC,OAAO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I,CAAC,YAAY,EAAE,QAAQ,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,cAAc,CAAC,CAAC;IACjG,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
-
import { SfProvarCommandResult } from '../../../../Utility/sfProvarCommandResult';
|
|
2
|
+
import { SfProvarCommandResult } from '../../../../Utility/sfProvarCommandResult.js';
|
|
3
3
|
export default class SfProvarConfigLoad extends SfCommand<SfProvarCommandResult> {
|
|
4
4
|
static readonly summary: string;
|
|
5
5
|
static readonly description: string;
|
|
6
6
|
static readonly examples: string[];
|
|
7
7
|
static readonly flags: {
|
|
8
|
-
'properties-file': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
8
|
+
'properties-file': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
9
9
|
};
|
|
10
10
|
private errorHandler;
|
|
11
11
|
run(): Promise<SfProvarCommandResult>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2024 Provar Limited.
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* Licensed under the BSD 3-Clause license.
|
|
5
|
+
* For full license text, see LICENSE.md file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
6
|
+
*/
|
|
7
|
+
import * as fileSystem from 'node:fs';
|
|
8
|
+
import { resolve } from 'node:path';
|
|
9
|
+
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
|
|
10
|
+
import { Messages } from '@salesforce/core';
|
|
11
|
+
import { populateResult } from '../../../../Utility/sfProvarCommandResult.js';
|
|
12
|
+
import ErrorHandler from '../../../../Utility/errorHandler.js';
|
|
13
|
+
import { ProvarConfig } from '../../../../Utility/provarConfig.js';
|
|
14
|
+
import PropertyFileValidator from '../../../../Utility/propertyFileValidator.js';
|
|
15
|
+
import { errorMessages } from '../../../../constants/errorMessages.js';
|
|
16
|
+
/**
|
|
17
|
+
* Loads the path to provardx-properties.json to the user directory ${user}/.sf/config.json
|
|
18
|
+
* So, that further any command can be run at any location by picking up the properties.json file
|
|
19
|
+
* from config.json file.
|
|
20
|
+
*
|
|
21
|
+
*/
|
|
22
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
23
|
+
const messages = Messages.loadMessages('@provartesting/provardx-cli', 'sf.provar.config.load');
|
|
24
|
+
export default class SfProvarConfigLoad extends SfCommand {
|
|
25
|
+
static summary = messages.getMessage('summary');
|
|
26
|
+
static description = messages.getMessage('description');
|
|
27
|
+
static examples = messages.getMessages('examples');
|
|
28
|
+
static flags = {
|
|
29
|
+
'properties-file': Flags.string({
|
|
30
|
+
summary: messages.getMessage('flags.properties-file.summary'),
|
|
31
|
+
char: 'p',
|
|
32
|
+
required: true,
|
|
33
|
+
}),
|
|
34
|
+
};
|
|
35
|
+
errorHandler = new ErrorHandler();
|
|
36
|
+
async run() {
|
|
37
|
+
const { flags } = await this.parse(SfProvarConfigLoad);
|
|
38
|
+
/* eslint-disable */
|
|
39
|
+
const propertiesFileName = resolve(flags['properties-file']);
|
|
40
|
+
const propertyFileValidator = new PropertyFileValidator(this.errorHandler);
|
|
41
|
+
const config = await ProvarConfig.loadConfig(this.errorHandler);
|
|
42
|
+
if (!fileSystem.existsSync(propertiesFileName)) {
|
|
43
|
+
this.errorHandler.addErrorsToList('INVALID_PATH', errorMessages.INVALID_PATH);
|
|
44
|
+
return populateResult(flags, this.errorHandler, messages, this.log.bind(this));
|
|
45
|
+
}
|
|
46
|
+
config.set('PROVARDX_PROPERTIES_FILE_PATH', propertiesFileName);
|
|
47
|
+
await config.write();
|
|
48
|
+
if (!(await propertyFileValidator.validate())) {
|
|
49
|
+
config.unset('PROVARDX_PROPERTIES_FILE_PATH');
|
|
50
|
+
await config.write();
|
|
51
|
+
}
|
|
52
|
+
return populateResult(flags, this.errorHandler, messages, this.log.bind(this));
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=load.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load.js","sourceRoot":"","sources":["../../../../../src/commands/provar/automation/config/load.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,UAAU,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAyB,cAAc,EAAE,MAAM,8CAA8C,CAAC;AACrG,OAAO,YAAY,MAAM,qCAAqC,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,qBAAqB,MAAM,8CAA8C,CAAC;AACjF,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAEvE;;;;;GAKG;AAEH,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,6BAA6B,EAAE,uBAAuB,CAAC,CAAC;AAE/F,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,SAAgC;IACvE,MAAM,CAAU,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IACzD,MAAM,CAAU,WAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IACjE,MAAM,CAAU,QAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAC5D,MAAM,CAAU,KAAK,GAAG;QAC7B,iBAAiB,EAAE,KAAK,CAAC,MAAM,CAAC;YAC9B,OAAO,EAAE,QAAQ,CAA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IACjF,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
-
import { SfProvarCommandResult } from '../../../../Utility/sfProvarCommandResult';
|
|
2
|
+
import { SfProvarCommandResult } from '../../../../Utility/sfProvarCommandResult.js';
|
|
3
3
|
export default class SfProvarConfigSet extends SfCommand<SfProvarCommandResult> {
|
|
4
4
|
static readonly summary: string;
|
|
5
5
|
static readonly description: string;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2024 Provar Limited.
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* Licensed under the BSD 3-Clause license.
|
|
5
|
+
* For full license text, see LICENSE.md file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
6
|
+
*/
|
|
7
|
+
import * as fileSystem from 'node:fs';
|
|
8
|
+
import { SfCommand, parseVarArgs } from '@salesforce/sf-plugins-core';
|
|
9
|
+
import { Messages } from '@salesforce/core';
|
|
10
|
+
import { populateResult } from '../../../../Utility/sfProvarCommandResult.js';
|
|
11
|
+
import ErrorHandler from '../../../../Utility/errorHandler.js';
|
|
12
|
+
import { errorMessages } from '../../../../constants/errorMessages.js';
|
|
13
|
+
import { ProvarConfig } from '../../../../Utility/provarConfig.js';
|
|
14
|
+
import { parseJSONString, setNestedProperty } from '../../../../Utility/jsonSupport.js';
|
|
15
|
+
/**
|
|
16
|
+
* Sets the specified property key and value inside provardx-properties.json
|
|
17
|
+
* loaded under config file
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
21
|
+
const messages = Messages.loadMessages('@provartesting/provardx-cli', 'sf.provar.config.set');
|
|
22
|
+
export default class SfProvarConfigSet extends SfCommand {
|
|
23
|
+
static summary = messages.getMessage('summary');
|
|
24
|
+
static description = messages.getMessage('description');
|
|
25
|
+
static examples = messages.getMessages('examples');
|
|
26
|
+
static strict = false;
|
|
27
|
+
errorHandler = new ErrorHandler();
|
|
28
|
+
async run() {
|
|
29
|
+
const { argv, flags } = await this.parse(SfProvarConfigSet);
|
|
30
|
+
// eslint-disable-next-line
|
|
31
|
+
const config = await ProvarConfig.loadConfig(this.errorHandler);
|
|
32
|
+
const propertiesFilePath = config.get('PROVARDX_PROPERTIES_FILE_PATH')?.toString();
|
|
33
|
+
if (propertiesFilePath === undefined || !fileSystem.existsSync(propertiesFilePath)) {
|
|
34
|
+
this.errorHandler.addErrorsToList('MISSING_FILE', errorMessages.MISSINGFILEERROR);
|
|
35
|
+
return populateResult(flags, this.errorHandler, messages, this.log.bind(this));
|
|
36
|
+
}
|
|
37
|
+
try {
|
|
38
|
+
/* eslint-disable */
|
|
39
|
+
const parsed = parseVarArgs({}, argv);
|
|
40
|
+
if (Object.keys(parsed).length === 0) {
|
|
41
|
+
this.errorHandler.addErrorsToList('MISSING_PROPERTY', errorMessages.MISSING_PROPERTY);
|
|
42
|
+
return populateResult(flags, this.errorHandler, messages, this.log.bind(this));
|
|
43
|
+
}
|
|
44
|
+
const data = fileSystem.readFileSync(propertiesFilePath, { encoding: 'utf8' });
|
|
45
|
+
const propertyFileContent = JSON.parse(data);
|
|
46
|
+
for (let [propertyName, propertyValue] of Object.entries(parsed)) {
|
|
47
|
+
if (!propertyValue) {
|
|
48
|
+
this.errorHandler.addErrorsToList('MISSING_VALUE', errorMessages.MISSING_VALUE);
|
|
49
|
+
}
|
|
50
|
+
if (propertyName.length < 1) {
|
|
51
|
+
this.errorHandler.addErrorsToList('MISSING_PROPERTY', errorMessages.MISSING_PROPERTY);
|
|
52
|
+
}
|
|
53
|
+
try {
|
|
54
|
+
propertyValue = parseJSONString(propertyValue);
|
|
55
|
+
}
|
|
56
|
+
catch (err) {
|
|
57
|
+
this.errorHandler.addErrorsToList('INVALID_VALUE', errorMessages.INVALID_VALUE);
|
|
58
|
+
return populateResult(flags, this.errorHandler, messages, this.log.bind(this));
|
|
59
|
+
}
|
|
60
|
+
if (propertyName.includes('.')) {
|
|
61
|
+
setNestedProperty(propertyFileContent, propertyName, propertyValue);
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
propertyFileContent[propertyName] = propertyValue;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
if (this.errorHandler.getErrors().length == 0) {
|
|
68
|
+
fileSystem.writeFileSync(propertiesFilePath, JSON.stringify(propertyFileContent, null, 3));
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
catch (err) {
|
|
72
|
+
if (err.name === 'InvalidArgumentFormatError') {
|
|
73
|
+
this.errorHandler.addErrorsToList('INVALID_ARGUMENT', errorMessages.INVALID_ARGUMENT);
|
|
74
|
+
}
|
|
75
|
+
else if (err.name === 'SyntaxError') {
|
|
76
|
+
this.errorHandler.addErrorsToList('MALFORMED_FILE', errorMessages.MALFORMEDFILEERROR);
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
throw err;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return populateResult(flags, this.errorHandler, messages, this.log.bind(this));
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=set.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set.js","sourceRoot":"","sources":["../../../../../src/commands/provar/automation/config/set.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,UAAU,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAyB,cAAc,EAAE,MAAM,8CAA8C,CAAC;AACrG,OAAO,YAAY,MAAM,qCAAqC,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAE,eAA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CommandResult';
|
|
2
|
+
import { SfProvarCommandResult } from '../../../../Utility/sfProvarCommandResult.js';
|
|
3
3
|
export default class SfProvarConfigValidate extends SfCommand<SfProvarCommandResult> {
|
|
4
4
|
static readonly summary: string;
|
|
5
5
|
static readonly description: string;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2024 Provar Limited.
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* Licensed under the BSD 3-Clause license.
|
|
5
|
+
* For full license text, see LICENSE.md file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
6
|
+
*/
|
|
7
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
8
|
+
import { Messages } from '@salesforce/core';
|
|
9
|
+
import ErrorHandler from '../../../../Utility/errorHandler.js';
|
|
10
|
+
import { populateResult } from '../../../../Utility/sfProvarCommandResult.js';
|
|
11
|
+
import PropertyFileValidator from '../../../../Utility/propertyFileValidator.js';
|
|
12
|
+
/**
|
|
13
|
+
* Validates the provardx-properties.json against JSON standards and provardx schema
|
|
14
|
+
* mentioned under PropertyFileSchema.ts
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
18
|
+
const messages = Messages.loadMessages('@provartesting/provardx-cli', 'sf.provar.config.validate');
|
|
19
|
+
export default class SfProvarConfigValidate extends SfCommand {
|
|
20
|
+
static summary = messages.getMessage('summary');
|
|
21
|
+
static description = messages.getMessage('description');
|
|
22
|
+
static examples = messages.getMessages('examples');
|
|
23
|
+
errorHandler = new ErrorHandler();
|
|
24
|
+
async run() {
|
|
25
|
+
const { flags } = await this.parse(SfProvarConfigValidate);
|
|
26
|
+
const propertyFileValidator = new PropertyFileValidator(this.errorHandler);
|
|
27
|
+
await propertyFileValidator.validate();
|
|
28
|
+
return populateResult(flags, this.errorHandler, messages, this.log.bind(this));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceM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,CAAC,CAAC,CAAC;IACjF,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
import { SfProvarCommandResult } from '../../../../Utility/sfProvarCommandResult.js';
|
|
3
|
+
export default class ProvarMetadataDownload extends SfCommand<SfProvarCommandResult> {
|
|
4
|
+
static readonly summary: string;
|
|
5
|
+
static readonly description: string;
|
|
6
|
+
static readonly examples: string[];
|
|
7
|
+
static readonly flags: {
|
|
8
|
+
connections: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
9
|
+
};
|
|
10
|
+
private errorHandler;
|
|
11
|
+
run(): Promise<SfProvarCommandResult>;
|
|
12
|
+
private doConnectionOverrides;
|
|
13
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import fileSystem from 'node:fs';
|
|
2
|
+
import { spawnSync } from 'node:child_process';
|
|
3
|
+
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
|
|
4
|
+
import { Messages } from '@salesforce/core';
|
|
5
|
+
import ErrorHandler from '../../../../Utility/errorHandler.js';
|
|
6
|
+
import { ProvarConfig } from '../../../../Utility/provarConfig.js';
|
|
7
|
+
import { errorMessages } from '../../../../constants/errorMessages.js';
|
|
8
|
+
import { populateResult } from '../../../../Utility/sfProvarCommandResult.js';
|
|
9
|
+
import UserSupport from '../../../../Utility/userSupport.js';
|
|
10
|
+
import { fileContainsString } from '../../../../Utility/fileSupport.js';
|
|
11
|
+
import { removeSpaces, getStringAfterSubstring } from '../../../../Utility/stringSupport.js';
|
|
12
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
13
|
+
const messages = Messages.loadMessages('@provartesting/provardx-cli', 'provar.metadata.download');
|
|
14
|
+
export default class ProvarMetadataDownload extends SfCommand {
|
|
15
|
+
static summary = messages.getMessage('summary');
|
|
16
|
+
static description = messages.getMessage('description');
|
|
17
|
+
static examples = messages.getMessages('examples');
|
|
18
|
+
static flags = {
|
|
19
|
+
connections: Flags.string({
|
|
20
|
+
summary: messages.getMessage('flags.connections.summary'),
|
|
21
|
+
char: 'c',
|
|
22
|
+
required: true,
|
|
23
|
+
}),
|
|
24
|
+
};
|
|
25
|
+
errorHandler = new ErrorHandler();
|
|
26
|
+
async run() {
|
|
27
|
+
const { flags } = await this.parse(ProvarMetadataDownload);
|
|
28
|
+
const config = await ProvarConfig.loadConfig(this.errorHandler);
|
|
29
|
+
const propertiesFilePath = config.get('PROVARDX_PROPERTIES_FILE_PATH')?.toString();
|
|
30
|
+
if (propertiesFilePath === undefined || !fileSystem.existsSync(propertiesFilePath)) {
|
|
31
|
+
this.errorHandler.addErrorsToList('MISSING_FILE', errorMessages.MISSINGFILEERROR);
|
|
32
|
+
return populateResult(flags, this.errorHandler, messages, this.log.bind(this));
|
|
33
|
+
}
|
|
34
|
+
try {
|
|
35
|
+
const propertiesdata = fileSystem.readFileSync(propertiesFilePath, { encoding: 'utf8' });
|
|
36
|
+
/* eslint-disable */
|
|
37
|
+
const propertiesInstance = JSON.parse(propertiesdata);
|
|
38
|
+
if (flags.connections) {
|
|
39
|
+
propertiesInstance.connectionName = removeSpaces(flags.connections);
|
|
40
|
+
}
|
|
41
|
+
this.doConnectionOverrides(propertiesInstance);
|
|
42
|
+
const rawProperties = JSON.stringify(propertiesInstance);
|
|
43
|
+
const userSupport = new UserSupport();
|
|
44
|
+
const updateProperties = userSupport.prepareRawProperties(rawProperties);
|
|
45
|
+
const userInfo = await userSupport.getDxUsersInfo(propertiesInstance.connectionOverride, this.errorHandler);
|
|
46
|
+
if (userInfo === null) {
|
|
47
|
+
return populateResult(flags, this.errorHandler, messages, this.log.bind(this));
|
|
48
|
+
}
|
|
49
|
+
const userInfoString = userSupport.prepareRawProperties(JSON.stringify({ dxUsers: userInfo }));
|
|
50
|
+
const provarDxJarPath = propertiesInstance.provarHome + '/provardx/provardx.jar';
|
|
51
|
+
const downloadMetadatacommand = 'java -cp "' +
|
|
52
|
+
provarDxJarPath +
|
|
53
|
+
'" com.provar.provardx.DxCommandExecuter ' +
|
|
54
|
+
updateProperties +
|
|
55
|
+
' ' +
|
|
56
|
+
userInfoString +
|
|
57
|
+
' Metadata';
|
|
58
|
+
const javaProcessOutput = spawnSync(downloadMetadatacommand, { shell: true });
|
|
59
|
+
const downloadSuccessMessage = 'Download completed successfully';
|
|
60
|
+
if (!fileContainsString(javaProcessOutput.stderr.toString(), downloadSuccessMessage)) {
|
|
61
|
+
const errorMessage = getStringAfterSubstring(javaProcessOutput.stderr.toString(), 'ERROR');
|
|
62
|
+
this.errorHandler.addErrorsToList('DOWNLOAD_ERROR', `${errorMessage}`);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
catch (error) {
|
|
66
|
+
if (error.name === 'SyntaxError') {
|
|
67
|
+
this.errorHandler.addErrorsToList('MALFORMED_FILE', errorMessages.MALFORMEDFILEERROR);
|
|
68
|
+
}
|
|
69
|
+
else if (error.name === 'MULTIPLE_ERRORSError') {
|
|
70
|
+
return populateResult(flags, this.errorHandler, messages, this.log.bind(this));
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
this.errorHandler.addErrorsToList('DOWNLOAD_ERROR', `${error.errorMessage}`);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return populateResult(flags, this.errorHandler, messages, this.log.bind(this));
|
|
77
|
+
}
|
|
78
|
+
doConnectionOverrides(properties) {
|
|
79
|
+
if (!properties.connectionOverride && !properties.connectionName) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
if (properties.connectionName && properties.connectionOverride) {
|
|
83
|
+
const connections = properties.connectionName.split(',');
|
|
84
|
+
const connectionOverride = [];
|
|
85
|
+
for (const override of properties.connectionOverride) {
|
|
86
|
+
if (connections.indexOf(override.connection) !== -1) {
|
|
87
|
+
connectionOverride.push(override);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
properties.connectionOverride = connectionOverride;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=download.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"download.js","sourceRoot":"","sources":["../../../../../src/commands/provar/automation/metadata/download.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,YAAY,MAAM,qCAAqC,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AACvE,OAAO,EAAyB,cAAc,EAAE,MAAM,8CAA8C,CAAC;AACrG,OAAO,WAAW,MAAM,oCAAoC,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAE7F,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,6BAA6B,EAAE,0BAA0B,CAAC,CAAC;AAElG,MAAM,CAAC,OAAO,OAAO,sBAAuB,SAAQ,SAAgC;IAC3E,MAAM,CAAU,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IACzD,MAAM,CAAU,WAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IACjE,MAAM,CAAU,QAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAE5D,MAAM,CAAU,KAAK,GAAG;QAC7B,W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D,UAAU,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;QACrD,CAAC;IACH,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export declare enum commandConstants {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
SF_PROVAR_AUTOMATION_CONFIG_GENERATE_COMMAND = "provar automation config generate",
|
|
3
|
+
SF_PROVAR_AUTOMATION_CONFIG_LOAD_COMMAND = "provar automation config load",
|
|
4
|
+
SF_PROVAR_AUTOMATION_CONFIG_VALIDATE_COMMAND = "provar automation config validate",
|
|
5
|
+
SF_PROVAR_AUTOMATION_CONFIG_SET_COMMAND = "provar automation config set",
|
|
6
|
+
SF_PROVAR_AUTOMATION_CONFIG_GET_COMMAND = "provar automation config get",
|
|
7
|
+
SF_PROVAR_AUTOMATION_METADATA_DOWNLOAD_COMMAND = "provar automation metadata download"
|
|
7
8
|
}
|