sfdx-deliverability-access 0.1.3 → 0.1.6
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
|
@@ -39,11 +39,12 @@ sfdx deliverability:access --help
|
|
|
39
39
|
|
|
40
40
|
1. [Google Chrome](https://www.google.com/chrome) (not confirmed, this is a presumption)
|
|
41
41
|
2. [Node.js](https://nodejs.org/en/)
|
|
42
|
-
3. [Salesforce CLI](https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_install_cli.htm)
|
|
42
|
+
3. [Salesforce CLI](https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_install_cli.htm)
|
|
43
|
+
4. [Salesforce Lightning](https://www.salesforce.com/products/platform/lightning/)
|
|
43
44
|
|
|
44
45
|
## Version History
|
|
45
46
|
|
|
46
|
-
* Initial Release (0.1.
|
|
47
|
+
* Initial Release (0.1.6)
|
|
47
48
|
|
|
48
49
|
## License
|
|
49
50
|
|
|
@@ -7,7 +7,8 @@ const core_1 = require("@salesforce/core");
|
|
|
7
7
|
const webdriver = require("selenium-webdriver");
|
|
8
8
|
const chrome = require("selenium-webdriver/chrome");
|
|
9
9
|
const until = require("selenium-webdriver/lib/until");
|
|
10
|
-
require(
|
|
10
|
+
const chromderiver = require("chromedriver");
|
|
11
|
+
const path = chromderiver.path;
|
|
11
12
|
const accessValuesMap = new Map([
|
|
12
13
|
['none', '0'],
|
|
13
14
|
['n', '0'],
|
|
@@ -38,8 +39,8 @@ class Access extends command_1.SfdxCommand {
|
|
|
38
39
|
parseOrgData(user) {
|
|
39
40
|
return new Promise((resolve) => {
|
|
40
41
|
const orgDataCommand = user !== 'undefined' && (user === null || user === void 0 ? void 0 : user.length) > 0
|
|
41
|
-
? `sfdx force:org:open -r --json -u ${user}`
|
|
42
|
-
: 'sfdx force:org:open -r --json';
|
|
42
|
+
? `node_modules/sfdx-cli/bin/run force:org:open -r --json -u ${user}`
|
|
43
|
+
: 'node_modules/sfdx-cli/bin/run force:org:open -r --json';
|
|
43
44
|
(0, child_process_1.exec)(orgDataCommand, (error, stdout, stderr) => {
|
|
44
45
|
if (error) {
|
|
45
46
|
this.ux.stopSpinner('Access Level could not be set');
|
|
@@ -62,7 +63,7 @@ class Access extends command_1.SfdxCommand {
|
|
|
62
63
|
.addArguments('--no-sandbox')
|
|
63
64
|
.addArguments('--disable-dev-shm-usage')
|
|
64
65
|
.addArguments('--headless');
|
|
65
|
-
const service = new chrome.ServiceBuilder(
|
|
66
|
+
const service = new chrome.ServiceBuilder(String(path)).build();
|
|
66
67
|
chrome.setDefaultService(service);
|
|
67
68
|
const driver = await new webdriver.Builder().forBrowser('chrome').setChromeOptions(options).build();
|
|
68
69
|
try {
|
|
@@ -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,
|
|
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;AAE/B,MAAM,eAAe,GAAG,IAAI,GAAG,CAAiB;IAC9C,CAAC,MAAM,EAAE,GAAG,CAAC;IACb,CAAC,GAAG,EAAE,GAAG,CAAC;IACV,CAAC,GAAG,EAAE,GAAG,CAAC;IACV,CAAC,QAAQ,EAAE,GAAG,CAAC;IACf,CAAC,GAAG,EAAE,GAAG,CAAC;IACV,CAAC,GAAG,EAAE,GAAG,CAAC;IACV,CAAC,KA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,UAAU,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;AAEzD,WAAI,GAAG,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.6","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,7 +1,7 @@
|
|
|
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.6",
|
|
5
5
|
"author": "gfarb @gfarb",
|
|
6
6
|
"bugs": "https://github.com/gfarb/sfdx-deliverability-access/issues",
|
|
7
7
|
"dependencies": {
|
|
@@ -10,8 +10,12 @@
|
|
|
10
10
|
"@oclif/errors": "^1",
|
|
11
11
|
"@salesforce/command": "^4",
|
|
12
12
|
"@salesforce/core": "^2",
|
|
13
|
+
"@types/chromedriver": "^81.0.1",
|
|
13
14
|
"chromedriver": "^99.0.0",
|
|
15
|
+
"install": "^0.13.0",
|
|
16
|
+
"npm": "^8.5.3",
|
|
14
17
|
"selenium-webdriver": "^4.1.1",
|
|
18
|
+
"sfdx-cli": "^7.141.1",
|
|
15
19
|
"tslib": "^2"
|
|
16
20
|
},
|
|
17
21
|
"devDependencies": {
|
|
@@ -29,6 +33,7 @@
|
|
|
29
33
|
"@typescript-eslint/eslint-plugin": "^4",
|
|
30
34
|
"@typescript-eslint/parser": "^4",
|
|
31
35
|
"chai": "^4",
|
|
36
|
+
"chromedriver": "^99.0.0",
|
|
32
37
|
"eslint": "^7",
|
|
33
38
|
"eslint-config-oclif": "^3.1",
|
|
34
39
|
"eslint-config-prettier": "^8",
|
|
@@ -45,11 +50,10 @@
|
|
|
45
50
|
"nyc": "^15",
|
|
46
51
|
"prettier": "^2",
|
|
47
52
|
"pretty-quick": "^3",
|
|
53
|
+
"selenium-webdriver": "^4.1.1",
|
|
48
54
|
"sinon": "10.0.0",
|
|
49
55
|
"ts-node": "^10",
|
|
50
|
-
"typescript": "4"
|
|
51
|
-
"chromedriver": "^99.0.0",
|
|
52
|
-
"selenium-webdriver": "^4.1.1"
|
|
56
|
+
"typescript": "4"
|
|
53
57
|
},
|
|
54
58
|
"engines": {
|
|
55
59
|
"node": ">=12.0.0"
|