sfdx-deliverability-access 0.4.4 → 1.0.0

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/LICENSE.md CHANGED
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
18
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
20
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
21
+ SOFTWARE.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## `sfdx deliverability:access [-l <string>] [-u <string>]`
4
4
 
5
- This SFDX Plugin was created to set Email Deliverability Access Level for an org easily and quickly. 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.
5
+ This SFDX Plugin was created to set Email Deliverability Access Level for an org easily and quickly. This project uses Puppeteer and headless browsing to open Setup in the target org and set Email Deliverability Access Level to the desired value.
6
6
 
7
7
  ```
8
8
  USAGE
@@ -37,10 +37,9 @@ sfdx deliverability:access --help
37
37
 
38
38
  ## Requirements
39
39
 
40
- 1. [Google Chrome](https://www.google.com/chrome)
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)
43
- 4. [Salesforce Lightning](https://www.salesforce.com/products/platform/lightning/)
40
+ 1. [Node.js](https://nodejs.org/en/)
41
+ 1. [Salesforce CLI](https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_install_cli.htm)
42
+ 1. [Salesforce Lightning](https://www.salesforce.com/products/platform/lightning/)
44
43
 
45
44
  ## License
46
45
 
@@ -51,3 +50,4 @@ This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md
51
50
  - [Salesforce CLI](https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_install_cli.htm)
52
51
  - [Salesforce CLI Plug-ins](https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_install_plugin_version.htm)
53
52
  - [Salesforce Email Deliverability](https://help.salesforce.com/s/articleView?id=sf.data_sandbox_email_deliverability.htm&type=5)
53
+ - [Puppeteer](https://pptr.dev/)
@@ -19,4 +19,5 @@ export default class Access extends SfdxCommand {
19
19
  run(): Promise<void>;
20
20
  private parseOrgData;
21
21
  private toggleDeliverability;
22
+ private stopSpinnerAndLogError;
22
23
  }
@@ -5,10 +5,7 @@ const util = require("util");
5
5
  const child_process_1 = require("child_process");
6
6
  const command_1 = require("@salesforce/command");
7
7
  const core_1 = require("@salesforce/core");
8
- const webdriver = require("selenium-webdriver");
9
- const chrome = require("selenium-webdriver/chrome");
10
- const until = require("selenium-webdriver/lib/until");
11
- const chromedriver = require("chromedriver");
8
+ const puppeteer = require("puppeteer");
12
9
  const execPromise = util.promisify(child_process_1.exec);
13
10
  const accessValuesMap = new Map([
14
11
  ['none', '0'],
@@ -27,14 +24,18 @@ class Access extends command_1.SfdxCommand {
27
24
  async run() {
28
25
  this.ux.startSpinner('Attempting to set Email Deliverability Access Level');
29
26
  const accessLevel = this.flags.level;
30
- const childElementIndex = String(accessValuesMap.get(accessLevel?.toLowerCase()));
31
- if (childElementIndex !== 'undefined' && Number(childElementIndex) > -1 && Number(childElementIndex) < 3) {
27
+ const accessLevelValue = String(accessValuesMap.get(accessLevel?.toLowerCase()));
28
+ if (accessLevelValue !== 'undefined' && Number(accessLevelValue) > -1 && Number(accessLevelValue) < 3) {
32
29
  const accessUrl = await this.parseOrgData(String(this.flags.user));
33
- void this.toggleDeliverability(accessUrl, childElementIndex);
30
+ try {
31
+ void this.toggleDeliverability(accessUrl, accessLevelValue);
32
+ }
33
+ catch (error) {
34
+ this.stopSpinnerAndLogError(String(error));
35
+ }
34
36
  }
35
37
  else {
36
- this.ux.stopSpinner('❌ Access Level could not be set.');
37
- throw new core_1.SfdxError(`${accessLevel} is not a valid value for the Level flag.`, 'Invalid value for Level flag');
38
+ this.stopSpinnerAndLogError(String(`${accessLevel} is not a valid value for the Level flag.`));
38
39
  }
39
40
  }
40
41
  async parseOrgData(user) {
@@ -48,52 +49,44 @@ class Access extends command_1.SfdxCommand {
48
49
  '&retURL=/lightning/setup/OrgEmailSettings/home');
49
50
  }
50
51
  catch (error) {
51
- this.ux.stopSpinner('❌ Access Level could not be set.');
52
- 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\n${String(error)}`;
53
- throw new core_1.SfdxError(errorMessage);
52
+ this.stopSpinnerAndLogError("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.");
53
+ return 'undefined';
54
54
  }
55
55
  }
56
- async toggleDeliverability(accessUrl, childElementIndex) {
57
- let driver;
56
+ async toggleDeliverability(accessUrl, accessLevelValue) {
57
+ let browser;
58
+ let error;
58
59
  try {
59
- this.ux.setSpinnerStatus('Opening headless browser session to toggle deliverability access level.');
60
- const service = new chrome.ServiceBuilder(String(chromedriver.path)).build();
61
- chrome.setDefaultService(service);
62
- const options = new chrome.Options()
63
- .addArguments('--no-sandbox')
64
- .addArguments('--disable-dev-shm-usage')
65
- .addArguments('--headless');
66
- driver = await new webdriver.Builder().forBrowser('chrome').setChromeOptions(options).build();
67
- }
68
- catch (error) {
69
- if (String(error).includes('version of ChromeDriver only supports Chrome version')) {
70
- this.ux.stopSpinner('❌ Access Level could not be set.');
71
- this.ux.log(`Chromedriver path: ${chromedriver.path}`);
72
- throw new core_1.SfdxError(String(error), ' Please make sure you have the correct Chromedriver version installed');
73
- }
60
+ browser = await puppeteer.launch({
61
+ headless: true,
62
+ args: ['--disable-web-security', '--no-sandbox'],
63
+ });
64
+ const page = await browser.newPage();
65
+ await page.goto(accessUrl);
66
+ const frame = await page.waitForSelector('#setupComponent > div.setupcontent > div > div > force-aloha-page > div > iframe');
67
+ const contentFrame = await frame?.contentFrame();
68
+ const accessLevelField = await contentFrame?.waitForSelector('#thePage\\:theForm\\:editBlock\\:sendEmailAccessControlSection\\:sendEmailAccessControl\\:sendEmailAccessControlSelect');
69
+ await accessLevelField?.select(accessLevelValue);
70
+ await contentFrame?.click('#thePage\\:theForm\\:editBlock\\:buttons\\:saveBtn');
71
+ await contentFrame?.waitForSelector('#thePage\\:theForm\\:successText');
74
72
  }
75
- if (driver === undefined)
76
- return;
77
- try {
78
- await driver.manage().setTimeouts({ implicit: 30000, pageLoad: 30000, script: 30000 });
79
- await driver.get(accessUrl);
80
- this.ux.setSpinnerStatus('Setting deliverability access level.');
81
- await driver.wait(until.titleIs('Deliverability | Salesforce'), 30000);
82
- await driver.sleep(3000);
83
- await driver.switchTo().frame(0);
84
- await driver.executeScript(`document.getElementsByClassName('pbSubsection')[0].children[0].children[0].children[0].children[0].children[0].children[${childElementIndex}].selected=true`);
85
- await driver.findElement(webdriver.By.id('thePage:theForm:editBlock:buttons:saveBtn')).click();
86
- await driver.sleep(1000);
87
- this.ux.stopSpinner('🎉 Email Deliverability Access Level has been set!');
88
- }
89
- catch (error) {
90
- this.ux.stopSpinner('❌ Access Level could not be set.');
91
- this.ux.log(`The following error occurred:\n${String(error)}`);
73
+ catch (err) {
74
+ error = String(err);
92
75
  }
93
76
  finally {
94
- await driver.quit();
77
+ await browser?.close();
78
+ if (error !== undefined) {
79
+ this.stopSpinnerAndLogError(error);
80
+ }
81
+ else {
82
+ this.ux.stopSpinner('🎉 Email Deliverability Access Level has been set!');
83
+ }
95
84
  }
96
85
  }
86
+ stopSpinnerAndLogError(errorMessage) {
87
+ this.ux.stopSpinner('❌ Access Level could not be set.');
88
+ throw new core_1.SfdxError(errorMessage);
89
+ }
97
90
  }
98
91
  exports.default = Access;
99
92
  Access.description = messages.getMessage('commandDescription');
@@ -1 +1 @@
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,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,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,KAAK,EAAE,GAAG,CAAC;IACZ,CAAC,GAAG,EAAE,GAAG,CAAC;IACV,CAAC,GAAG,EAAE,GAAG,CAAC;CACX,CAAC,CAAC;AAEH,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAE5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,4BAA4B,EAAE,KAAK,CAAC,CAAC;AAY5E,MAAqB,MAAO,SAAQ,qBAAW;IAkBtC,KAAK,CAAC,GAAG;QACd,IAAI,CAAC,EAAE,CAAC,YAAY,CAAC,qDAAqD,CAAC,CAAC;QAC5E,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,KAAe,CAAC;QAC/C,MAAM,iBAAiB,GAAG,MAAM,CAAC,eAAe,CAAC,GAAG,CAAC,WAAW,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC;QAClF,IAAI,iBAAiB,KAAK,WAAW,IAAI,MAAM,CAAC,iBAAiB,CAAC,GAAG,CA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AW,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/messages/org.json CHANGED
@@ -7,4 +7,4 @@
7
7
  "sfdx deliverability:access --level None",
8
8
  "sfdx deliverability:access --level System"
9
9
  ]
10
- }
10
+ }
@@ -1 +1 @@
1
- {"version":"0.4.4","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":[]}}}
1
+ {"version":"1.0.0","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":[]}}}
package/package.json CHANGED
@@ -1,21 +1,59 @@
1
1
  {
2
2
  "name": "sfdx-deliverability-access",
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.4.4",
3
+ "description": "SFDX Plugin to set Email Deliverability Access Level for an org via command line. This project uses Puppeteer and headless browsing to open Setup in the target org and set Email Deliverability Access Level to the desired value.",
4
+ "version": "1.0.0",
5
5
  "author": "gfarb @gfarb",
6
6
  "bugs": "https://github.com/gfarb/sfdx-deliverability-access/issues",
7
+ "engines": {
8
+ "node": ">=12.0.0"
9
+ },
10
+ "files": [
11
+ "/lib",
12
+ "/messages",
13
+ "/npm-shrinkwrap.json",
14
+ "/oclif.manifest.json"
15
+ ],
16
+ "homepage": "https://github.com/gfarb/sfdx-deliverability-access",
17
+ "keywords": [
18
+ "sfdx-plugin",
19
+ "sfdx-cli",
20
+ "sfdx",
21
+ "salesforce"
22
+ ],
23
+ "license": "MIT",
24
+ "oclif": {
25
+ "commands": "./lib/commands",
26
+ "bin": "sfdx",
27
+ "topics": {
28
+ "deliverability": {
29
+ "description": "Commands to set Email Deliverability Access Level via command line."
30
+ }
31
+ },
32
+ "devPlugins": [
33
+ "@oclif/plugin-help"
34
+ ]
35
+ },
36
+ "repository": "gfarb/sfdx-deliverability-access",
37
+ "scripts": {
38
+ "build": "tsc -p .",
39
+ "lint": "eslint src/**/*.ts test/**/*.ts",
40
+ "postpack": "rm -f oclif.manifest.json",
41
+ "posttest": "eslint src/**/*.ts test/**/*.ts",
42
+ "prepack": "rm -rf lib && tsc -b && oclif-dev manifest && oclif-dev readme",
43
+ "test": "nyc --extension .ts --require ts-node/register mocha --forbid-only \"test/**/*.test.ts\"",
44
+ "version": "oclif-dev readme && git add README.md"
45
+ },
7
46
  "dependencies": {
8
47
  "@oclif/command": "^1",
9
48
  "@oclif/config": "^1",
10
49
  "@oclif/errors": "^1",
11
50
  "@salesforce/command": "^4.2.2",
12
51
  "@salesforce/core": "^2.37.1",
13
- "@types/chromedriver": "^81.0.1",
14
52
  "@types/node": "^17.0.21",
15
- "chromedriver": "^103.0.0",
53
+ "@types/puppeteer": "^5.4.6",
16
54
  "install": "^0.13.0",
17
55
  "npm": "^8.18.0",
18
- "selenium-webdriver": "4.3.0",
56
+ "puppeteer": "^18.0.5",
19
57
  "sfdx-cli": "^7.165.0",
20
58
  "tslib": "^2"
21
59
  },
@@ -30,7 +68,6 @@
30
68
  "@types/chai": "^4.3.3",
31
69
  "@types/jsforce": "^1.9.29",
32
70
  "@types/mocha": "^9.1.0",
33
- "@types/selenium-webdriver": "^4.1.3",
34
71
  "@typescript-eslint/eslint-plugin": "^5.36.1",
35
72
  "@typescript-eslint/parser": "^5.36.1",
36
73
  "chai": "^4",
@@ -49,48 +86,8 @@
49
86
  "nyc": "^15",
50
87
  "prettier": "^2",
51
88
  "pretty-quick": "^3",
52
- "selenium-webdriver": "4.3.0",
53
89
  "sinon": "13.0.1",
54
90
  "ts-node": "^10",
55
91
  "typescript": "4.5.5"
56
- },
57
- "engines": {
58
- "node": ">=12.0.0"
59
- },
60
- "files": [
61
- "/lib",
62
- "/messages",
63
- "/npm-shrinkwrap.json",
64
- "/oclif.manifest.json"
65
- ],
66
- "homepage": "https://github.com/gfarb/sfdx-deliverability-access",
67
- "keywords": [
68
- "sfdx-plugin",
69
- "sfdx-cli",
70
- "sfdx",
71
- "salesforce"
72
- ],
73
- "license": "MIT",
74
- "oclif": {
75
- "commands": "./lib/commands",
76
- "bin": "sfdx",
77
- "topics": {
78
- "deliverability": {
79
- "description": "Commands to set Email Deliverability Access Level for an org via command line."
80
- }
81
- },
82
- "devPlugins": [
83
- "@oclif/plugin-help"
84
- ]
85
- },
86
- "repository": "gfarb/sfdx-deliverability-access",
87
- "scripts": {
88
- "build": "tsc -p .",
89
- "lint": "eslint src/**/*.ts test/**/*.ts",
90
- "postpack": "rm -f oclif.manifest.json",
91
- "posttest": "eslint src/**/*.ts test/**/*.ts",
92
- "prepack": "rm -rf lib && tsc -b && oclif-dev manifest && oclif-dev readme",
93
- "test": "nyc --extension .ts --require ts-node/register mocha --forbid-only \"test/**/*.test.ts\"",
94
- "version": "oclif-dev readme && git add README.md"
95
92
  }
96
93
  }