sfdx-deliverability-access 0.1.7 → 0.1.10
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
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const os = require("os");
|
|
4
|
+
const util = require("util");
|
|
4
5
|
const child_process_1 = require("child_process");
|
|
5
6
|
const command_1 = require("@salesforce/command");
|
|
6
7
|
const core_1 = require("@salesforce/core");
|
|
@@ -9,6 +10,7 @@ const chrome = require("selenium-webdriver/chrome");
|
|
|
9
10
|
const until = require("selenium-webdriver/lib/until");
|
|
10
11
|
const chromderiver = require("chromedriver");
|
|
11
12
|
const path = chromderiver.path;
|
|
13
|
+
const execPromise = util.promisify(child_process_1.exec);
|
|
12
14
|
const accessValuesMap = new Map([
|
|
13
15
|
['none', '0'],
|
|
14
16
|
['n', '0'],
|
|
@@ -36,27 +38,21 @@ class Access extends command_1.SfdxCommand {
|
|
|
36
38
|
throw new core_1.SfdxError(`${accessLevel} is not a valid value for the Level flag.`, 'Invalid value for Level flag');
|
|
37
39
|
}
|
|
38
40
|
}
|
|
39
|
-
parseOrgData(user) {
|
|
40
|
-
|
|
41
|
+
async parseOrgData(user) {
|
|
42
|
+
try {
|
|
41
43
|
const orgDataCommand = user !== 'undefined' && (user === null || user === void 0 ? void 0 : user.length) > 0
|
|
42
44
|
? `npx sfdx force:org:open -r --json -u ${user}`
|
|
43
45
|
: 'npx sfdx force:org:open -r --json';
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
const response = JSON.parse(stdout);
|
|
55
|
-
resolve(response.result.url.replace('my.salesforce', 'lightning.force') +
|
|
56
|
-
'&retURL=/lightning/setup/OrgEmailSettings/home');
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
});
|
|
46
|
+
const orgData = await execPromise(orgDataCommand);
|
|
47
|
+
const response = JSON.parse(orgData.stdout);
|
|
48
|
+
return (response.result.url.replace('my.salesforce', 'lightning.force') +
|
|
49
|
+
'&retURL=/lightning/setup/OrgEmailSettings/home');
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
this.ux.stopSpinner('Access Level could not be set');
|
|
53
|
+
const errorMessage = `Unable to parse url from 'sfdx force:org:open' command. Please make sure you have a default org set or you are passing a valid username/alias with the '-u' or '--user' flag.\n\nError message:\n${String(error)}`;
|
|
54
|
+
throw new core_1.SfdxError(errorMessage);
|
|
55
|
+
}
|
|
60
56
|
}
|
|
61
57
|
async toggleDeliverability(accessUrl, childElementIndex) {
|
|
62
58
|
const options = new chrome.Options()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"access.js","sourceRoot":"","sources":["../../../src/commands/deliverability/access.ts"],"names":[],"mappings":";;AAAA,yBAAyB;AACzB,iDAAqC;AACrC,iDAAyD;AACzD,2CAAuD;AACvD,gDAAiD;AACjD,oDAAqD;AACrD,sDAAuD;AACvD,6CAA8C;AAC9C,MAAM,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"access.js","sourceRoot":"","sources":["../../../src/commands/deliverability/access.ts"],"names":[],"mappings":";;AAAA,yBAAyB;AACzB,6BAA6B;AAC7B,iDAAqC;AACrC,iDAAyD;AACzD,2CAAuD;AACvD,gDAAiD;AACjD,oDAAqD;AACrD,sDAAuD;AACvD,6CAA8C;AAC9C,MAAM,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC;AAC/B,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,oBAAI,CAAC,CAAC;AAEzC,MAAM,eAAe,GAAG,IAAI,GAAG,CAAiB;IAC9C,CAAC,MAAM,EAAE,GAAG,CAAC;IACb,CAAC,GAAG,EAAE,GAAG,CAA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G,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;AAEvB,kBAAW,GAAG;IAC7B,KAAK,EAAE,eAAK,CAAC,MAAM,CAAC;QAClB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,sBAAsB,CAAC;KACzD,CAAC;IACF,IAAI,EAAE,eAAK,CAAC,MAAM,CAAC;QACjB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,qBAAqB,CAAC;KACxD,CAAC;CACH,CAAC;AAEe,sBAAe,GAAG,KAAK,CAAC"}
|
package/oclif.manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"0.1.
|
|
1
|
+
{"version":"0.1.10","commands":{"deliverability:access":{"id":"deliverability:access","description":"Set Email Deliverability Access Level for an org.","usage":"<%= command.id %> [-l <string>] [-u <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]","pluginName":"sfdx-deliverability-access","pluginType":"core","aliases":[],"examples":["sfdx deliverability:access --level All","sfdx deliverability:access --level None","sfdx deliverability:access --level System"],"flags":{"json":{"name":"json","type":"boolean","description":"format output as json","allowNo":false},"loglevel":{"name":"loglevel","type":"option","description":"logging level for this command invocation","required":false,"helpValue":"(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)","options":["trace","debug","info","warn","error","fatal","TRACE","DEBUG","INFO","WARN","ERROR","FATAL"],"default":"warn"},"level":{"name":"level","type":"option","char":"l","description":"No access: None, none, n, 0\nSystem email only: System, system, s, 1\nAll email: All, all, a, 2"},"user":{"name":"user","type":"option","char":"u","description":"Username or alias for the target org; overrides default target org"}},"args":[{"name":"file"}]}}}
|
package/package.json
CHANGED
|
@@ -1,59 +1,58 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sfdx-deliverability-access",
|
|
3
3
|
"description": "SFDX Plugin to set Email Deliverability Access Level for an org via command line. This project uses Selenium, Webdriver and headless browsing to open Setup in the target org and set Email Deliverability Access Level to the desired value.",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.10",
|
|
5
5
|
"author": "gfarb @gfarb",
|
|
6
6
|
"bugs": "https://github.com/gfarb/sfdx-deliverability-access/issues",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@oclif/command": "^1",
|
|
9
9
|
"@oclif/config": "^1",
|
|
10
10
|
"@oclif/errors": "^1",
|
|
11
|
-
"@salesforce/command": "^4",
|
|
12
|
-
"@salesforce/core": "^2",
|
|
11
|
+
"@salesforce/command": "^4.2.2",
|
|
12
|
+
"@salesforce/core": "^2.35.3",
|
|
13
13
|
"@types/chromedriver": "^81.0.1",
|
|
14
|
+
"@types/node": "^17.0.21",
|
|
14
15
|
"chromedriver": "^99.0.0",
|
|
15
16
|
"install": "^0.13.0",
|
|
16
|
-
"npm": "^8.5.
|
|
17
|
+
"npm": "^8.5.4",
|
|
17
18
|
"selenium-webdriver": "^4.1.1",
|
|
18
|
-
"sfdx-cli": "^7.141.1",
|
|
19
19
|
"tslib": "^2"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@oclif/dev-cli": "^1",
|
|
23
|
-
"@oclif/plugin-help": "^
|
|
24
|
-
"@oclif/test": "^1",
|
|
25
|
-
"@salesforce/dev-config": "^
|
|
26
|
-
"@salesforce/dev-scripts": "^0",
|
|
23
|
+
"@oclif/plugin-help": "^5.1.12",
|
|
24
|
+
"@oclif/test": "^2.1.0",
|
|
25
|
+
"@salesforce/dev-config": "^3.0.1",
|
|
26
|
+
"@salesforce/dev-scripts": "^2.0.1",
|
|
27
27
|
"@salesforce/prettier-config": "^0",
|
|
28
28
|
"@salesforce/ts-sinon": "^1",
|
|
29
29
|
"@types/chai": "^4",
|
|
30
30
|
"@types/jsforce": "^1.9.29",
|
|
31
|
-
"@types/mocha": "^
|
|
31
|
+
"@types/mocha": "^9.1.0",
|
|
32
32
|
"@types/selenium-webdriver": "^4.0.18",
|
|
33
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
34
|
-
"@typescript-eslint/parser": "^
|
|
33
|
+
"@typescript-eslint/eslint-plugin": "^5.14.0",
|
|
34
|
+
"@typescript-eslint/parser": "^5.14.0",
|
|
35
35
|
"chai": "^4",
|
|
36
36
|
"chromedriver": "^99.0.0",
|
|
37
|
-
"eslint": "^
|
|
38
|
-
"eslint-config-oclif": "^
|
|
37
|
+
"eslint": "^8.10.0",
|
|
38
|
+
"eslint-config-oclif": "^4.0.0",
|
|
39
39
|
"eslint-config-prettier": "^8",
|
|
40
40
|
"eslint-config-salesforce": "^0",
|
|
41
41
|
"eslint-config-salesforce-typescript": "^0",
|
|
42
42
|
"eslint-plugin-header": "^3",
|
|
43
43
|
"eslint-plugin-import": "^2",
|
|
44
|
-
"eslint-plugin-jsdoc": "^
|
|
45
|
-
"eslint-plugin-prettier": "^
|
|
44
|
+
"eslint-plugin-jsdoc": "^37.9.7",
|
|
45
|
+
"eslint-plugin-prettier": "^4.0.0",
|
|
46
46
|
"eslint-plugin-typescript": "^0",
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"mocha": "^8",
|
|
47
|
+
"husky": "^7.0.4",
|
|
48
|
+
"mocha": "^9.2.1",
|
|
50
49
|
"nyc": "^15",
|
|
51
50
|
"prettier": "^2",
|
|
52
51
|
"pretty-quick": "^3",
|
|
53
52
|
"selenium-webdriver": "^4.1.1",
|
|
54
|
-
"sinon": "
|
|
53
|
+
"sinon": "13.0.1",
|
|
55
54
|
"ts-node": "^10",
|
|
56
|
-
"typescript": "4"
|
|
55
|
+
"typescript": "^4.5.5"
|
|
57
56
|
},
|
|
58
57
|
"engines": {
|
|
59
58
|
"node": ">=12.0.0"
|