sfdx-deliverability-access 1.0.0 → 1.1.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.
|
@@ -27,6 +27,8 @@ class Access extends command_1.SfdxCommand {
|
|
|
27
27
|
const accessLevelValue = String(accessValuesMap.get(accessLevel?.toLowerCase()));
|
|
28
28
|
if (accessLevelValue !== 'undefined' && Number(accessLevelValue) > -1 && Number(accessLevelValue) < 3) {
|
|
29
29
|
const accessUrl = await this.parseOrgData(String(this.flags.user));
|
|
30
|
+
if (accessUrl === undefined)
|
|
31
|
+
return;
|
|
30
32
|
try {
|
|
31
33
|
void this.toggleDeliverability(accessUrl, accessLevelValue);
|
|
32
34
|
}
|
|
@@ -50,12 +52,13 @@ class Access extends command_1.SfdxCommand {
|
|
|
50
52
|
}
|
|
51
53
|
catch (error) {
|
|
52
54
|
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
|
|
55
|
+
return;
|
|
54
56
|
}
|
|
55
57
|
}
|
|
56
58
|
async toggleDeliverability(accessUrl, accessLevelValue) {
|
|
57
59
|
let browser;
|
|
58
60
|
let error;
|
|
61
|
+
this.ux.setSpinnerStatus('Launching headless browser');
|
|
59
62
|
try {
|
|
60
63
|
browser = await puppeteer.launch({
|
|
61
64
|
headless: true,
|
|
@@ -63,9 +66,11 @@ class Access extends command_1.SfdxCommand {
|
|
|
63
66
|
});
|
|
64
67
|
const page = await browser.newPage();
|
|
65
68
|
await page.goto(accessUrl);
|
|
69
|
+
this.ux.setSpinnerStatus('Waiting for page to load');
|
|
66
70
|
const frame = await page.waitForSelector('#setupComponent > div.setupcontent > div > div > force-aloha-page > div > iframe');
|
|
67
71
|
const contentFrame = await frame?.contentFrame();
|
|
68
72
|
const accessLevelField = await contentFrame?.waitForSelector('#thePage\\:theForm\\:editBlock\\:sendEmailAccessControlSection\\:sendEmailAccessControl\\:sendEmailAccessControlSelect');
|
|
73
|
+
this.ux.setSpinnerStatus('Selecting Deliverability Access Level');
|
|
69
74
|
await accessLevelField?.select(accessLevelValue);
|
|
70
75
|
await contentFrame?.click('#thePage\\:theForm\\:editBlock\\:buttons\\:saveBtn');
|
|
71
76
|
await contentFrame?.waitForSelector('#thePage\\:theForm\\:successText');
|
|
@@ -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,uCAAwC;AACxC,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,gBAAgB,GAAG,MAAM,CAAC,eAAe,C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B,CAAC,YAAoB;QACjD,IAAI,CAAC,EAAE,CAAC,WAAW,CAAC,kCAAkC,CAAC,CAAC;QACxD,MAAM,IAAI,gBAAS,CAAC,YAAY,CAAC,CAAC;IACpC,CAAC;;AA7FH,yBA8FC;AA7Fe,kBAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC;AAExD,eAAQ,GAAG,QAAQ,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;AAEtD,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":"1.
|
|
1
|
+
{"version":"1.1.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,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 Puppeteer and headless browsing to open Setup in the target org and set Email Deliverability Access Level to the desired value.",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.1.0",
|
|
5
5
|
"author": "gfarb @gfarb",
|
|
6
6
|
"bugs": "https://github.com/gfarb/sfdx-deliverability-access/issues",
|
|
7
7
|
"engines": {
|
|
@@ -44,23 +44,23 @@
|
|
|
44
44
|
"version": "oclif-dev readme && git add README.md"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@oclif/command": "^1",
|
|
48
|
-
"@oclif/config": "^1",
|
|
47
|
+
"@oclif/command": "^1.8.18",
|
|
48
|
+
"@oclif/config": "^1.18.5",
|
|
49
49
|
"@oclif/errors": "^1",
|
|
50
50
|
"@salesforce/command": "^4.2.2",
|
|
51
51
|
"@salesforce/core": "^2.37.1",
|
|
52
52
|
"@types/node": "^17.0.21",
|
|
53
|
-
"@types/puppeteer": "^5.4.
|
|
53
|
+
"@types/puppeteer": "^5.4.7",
|
|
54
54
|
"install": "^0.13.0",
|
|
55
55
|
"npm": "^8.18.0",
|
|
56
|
-
"puppeteer": "^18.
|
|
57
|
-
"sfdx-cli": "^7.
|
|
56
|
+
"puppeteer": "^18.2.1",
|
|
57
|
+
"sfdx-cli": "^7.172.0",
|
|
58
58
|
"tslib": "^2"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@oclif/dev-cli": "^1",
|
|
62
|
-
"@oclif/plugin-help": "^5.1.
|
|
63
|
-
"@oclif/test": "^2.
|
|
62
|
+
"@oclif/plugin-help": "^5.1.15",
|
|
63
|
+
"@oclif/test": "^2.2.3",
|
|
64
64
|
"@salesforce/dev-config": "^3.0.1",
|
|
65
65
|
"@salesforce/dev-scripts": "^2.0.1",
|
|
66
66
|
"@salesforce/prettier-config": "^0",
|
|
@@ -68,10 +68,10 @@
|
|
|
68
68
|
"@types/chai": "^4.3.3",
|
|
69
69
|
"@types/jsforce": "^1.9.29",
|
|
70
70
|
"@types/mocha": "^9.1.0",
|
|
71
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
72
|
-
"@typescript-eslint/parser": "^5.
|
|
71
|
+
"@typescript-eslint/eslint-plugin": "^5.40.0",
|
|
72
|
+
"@typescript-eslint/parser": "^5.40.0",
|
|
73
73
|
"chai": "^4",
|
|
74
|
-
"eslint": "^8.
|
|
74
|
+
"eslint": "^8.25.0",
|
|
75
75
|
"eslint-config-oclif": "^4.0.0",
|
|
76
76
|
"eslint-config-prettier": "^8",
|
|
77
77
|
"eslint-config-salesforce": "^0",
|
|
@@ -88,6 +88,6 @@
|
|
|
88
88
|
"pretty-quick": "^3",
|
|
89
89
|
"sinon": "13.0.1",
|
|
90
90
|
"ts-node": "^10",
|
|
91
|
-
"typescript": "4.
|
|
91
|
+
"typescript": "4.7.4"
|
|
92
92
|
}
|
|
93
93
|
}
|