sfdx-browserforce-plugin 2.8.2 → 2.9.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.
@@ -0,0 +1,9 @@
1
+ import { BrowserforcePlugin } from '../../plugin';
2
+ declare type Config = {
3
+ accessLevel: string;
4
+ };
5
+ export declare class EmailDeliverability extends BrowserforcePlugin {
6
+ retrieve(definition?: Config): Promise<Config>;
7
+ apply(config: Config): Promise<void>;
8
+ }
9
+ export {};
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EmailDeliverability = void 0;
4
+ const plugin_1 = require("../../plugin");
5
+ const PATHS = {
6
+ BASE: 'email-admin/editOrgEmailSettings.apexp'
7
+ };
8
+ const SELECTORS = {
9
+ ACCESS_LEVEL: 'select[id$=":sendEmailAccessControlSelect"]',
10
+ CONFIRM_MESSAGE: 'span[id$=":successText"]',
11
+ SAVE_BUTTON: 'input[id$=":saveBtn"]'
12
+ };
13
+ const ACCESS_LEVEL_VALUES = new Map([
14
+ ['No access', '0',],
15
+ ['System email only', '1',],
16
+ ['All email', '2']
17
+ ]);
18
+ class EmailDeliverability extends plugin_1.BrowserforcePlugin {
19
+ async retrieve(definition) {
20
+ if (!ACCESS_LEVEL_VALUES.has(definition.accessLevel)) {
21
+ throw new Error(`Invalid email access level ${definition.accessLevel}`);
22
+ }
23
+ const page = await this.browserforce.openPage(PATHS.BASE);
24
+ await page.waitForSelector(SELECTORS.ACCESS_LEVEL);
25
+ const selectedOptions = await page.$$eval(`${SELECTORS.ACCESS_LEVEL} > option[selected]`, options => options.map(option => option.textContent));
26
+ if (!selectedOptions) {
27
+ throw new Error('Selected access level not found...');
28
+ }
29
+ return {
30
+ accessLevel: selectedOptions[0]
31
+ };
32
+ ;
33
+ }
34
+ async apply(config) {
35
+ const page = await this.browserforce.openPage(PATHS.BASE);
36
+ await page.waitForSelector(SELECTORS.ACCESS_LEVEL);
37
+ await page.select(SELECTORS.ACCESS_LEVEL, ACCESS_LEVEL_VALUES.get(config.accessLevel));
38
+ await Promise.all([
39
+ page.waitForSelector(SELECTORS.CONFIRM_MESSAGE),
40
+ page.click(SELECTORS.SAVE_BUTTON)
41
+ ]);
42
+ }
43
+ }
44
+ exports.EmailDeliverability = EmailDeliverability;
45
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/plugins/email-deliverability/index.ts"],"names":[],"mappings":";;;AAAA,yCAAkD;AAElD,MAAM,KAAK,GAAG;IACZ,IAAI,EAAE,wCAAwC;CAC/C,CAAC;AACF,MAAM,SAAS,GAAG;IAChB,YAAY,EAAE,6CAA6C;IAC3D,eAAe,EAAE,0BAA0B;IAC3C,WAAW,EAAE,uBAAuB;CACrC,CAAC;AACF,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAAC;IAClC,CAAC,WAAW,EAAE,GAAG,EAAE;IACnB,CAAC,mBAAmB,EAAE,GAAG,EAAE;IAC3B,CAAC,WAAW,EAAE,GAAG,CAAC;CACnB,CAAC,CAAC;AAMH,MAAa,mBAAoB,SAAQ,2BAAkB;IAClD,KAAK,CAAC,QAAQ,CAAC,UAAmB;QACvC,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE;YACpD,MAAM,IAAI,KAAK,CAAC,8BAA8B,UAAU,CAAC,WAAW,EAAE,CAAC,CAAC;SACzE;QACD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC1D,MAAM,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;QACnD,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,MAAM,CACvC,GAAG,SAAS,CAAC,YAAY,qBAAqB,EAC9C,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,CACrD,CAAC;QACF,IAAI,CAAC,eAAe,EAAE;YACpB,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAA;SACtD;QACD,OAAO;YACL,WAAW,EAAE,eAAe,CAAC,CAAC,CAAC;SAChC,CAAC;QAAA,CAAC;IACL,CAAC;IAEM,KAAK,CAAC,KAAK,CAAC,MAAc;QAC/B,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC1D,MAAM,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;QACnD,MAAM,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,YAAY,EAAE,mBAAmB,CAAC,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC;QACvF,MAAM,OAAO,CAAC,GAAG,CAAC;YAChB,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,eAAe,CAAC;YAC/C,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC;SAClC,CAAC,CAAC;IACL,CAAC;CACF;AA5BD,kDA4BC"}
@@ -3,6 +3,7 @@ import { Communities as communities } from './communities';
3
3
  import { CustomerPortal as customerPortal } from './customer-portal';
4
4
  import { DeferSharingCalculation as deferSharingCalculation } from './defer-sharing-calculation';
5
5
  import { DensitySettings as densitySettings } from './density-settings';
6
+ import { EmailDeliverability as emailDeliverability } from './email-deliverability';
6
7
  import { HighVelocitySalesSettings as highVelocitySalesSettings } from './high-velocity-sales-settings';
7
8
  import { HomePageLayouts as homePageLayouts } from './home-page-layouts';
8
9
  import { LightningExperienceSettings as lightningExperienceSettings } from './lightning-experience-settings';
@@ -12,4 +13,4 @@ import { ReportsAndDashboards as reportsAndDashboards } from './reports-and-dash
12
13
  import { SalesforceToSalesforce as salesforceToSalesforce } from './salesforce-to-salesforce';
13
14
  import { Security as security } from './security';
14
15
  import { RelateContactToMultipleAccounts as relateContactToMultipleAccounts } from './relate-contact-to-multiple-accounts';
15
- export { relateContactToMultipleAccounts, activitySettings, communities, customerPortal, deferSharingCalculation, densitySettings, highVelocitySalesSettings, homePageLayouts, lightningExperienceSettings, picklists, recordTypes, reportsAndDashboards, salesforceToSalesforce, security };
16
+ export { relateContactToMultipleAccounts, activitySettings, communities, customerPortal, deferSharingCalculation, densitySettings, emailDeliverability, highVelocitySalesSettings, homePageLayouts, lightningExperienceSettings, picklists, recordTypes, reportsAndDashboards, salesforceToSalesforce, security };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.security = exports.salesforceToSalesforce = exports.reportsAndDashboards = exports.recordTypes = exports.picklists = exports.lightningExperienceSettings = exports.homePageLayouts = exports.highVelocitySalesSettings = exports.densitySettings = exports.deferSharingCalculation = exports.customerPortal = exports.communities = exports.activitySettings = exports.relateContactToMultipleAccounts = void 0;
3
+ exports.security = exports.salesforceToSalesforce = exports.reportsAndDashboards = exports.recordTypes = exports.picklists = exports.lightningExperienceSettings = exports.homePageLayouts = exports.highVelocitySalesSettings = exports.emailDeliverability = exports.densitySettings = exports.deferSharingCalculation = exports.customerPortal = exports.communities = exports.activitySettings = exports.relateContactToMultipleAccounts = void 0;
4
4
  const activity_settings_1 = require("./activity-settings");
5
5
  Object.defineProperty(exports, "activitySettings", { enumerable: true, get: function () { return activity_settings_1.ActivitySettings; } });
6
6
  const communities_1 = require("./communities");
@@ -11,6 +11,8 @@ const defer_sharing_calculation_1 = require("./defer-sharing-calculation");
11
11
  Object.defineProperty(exports, "deferSharingCalculation", { enumerable: true, get: function () { return defer_sharing_calculation_1.DeferSharingCalculation; } });
12
12
  const density_settings_1 = require("./density-settings");
13
13
  Object.defineProperty(exports, "densitySettings", { enumerable: true, get: function () { return density_settings_1.DensitySettings; } });
14
+ const email_deliverability_1 = require("./email-deliverability");
15
+ Object.defineProperty(exports, "emailDeliverability", { enumerable: true, get: function () { return email_deliverability_1.EmailDeliverability; } });
14
16
  const high_velocity_sales_settings_1 = require("./high-velocity-sales-settings");
15
17
  Object.defineProperty(exports, "highVelocitySalesSettings", { enumerable: true, get: function () { return high_velocity_sales_settings_1.HighVelocitySalesSettings; } });
16
18
  const home_page_layouts_1 = require("./home-page-layouts");
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/plugins/index.ts"],"names":[],"mappings":";;;AAAA,2DAA2E;AAkBzE,iGAlB2B,oCAAgB,OAkB3B;AAjBlB,+CAA2D;AAkBzD,4FAlBsB,yBAAW,OAkBtB;AAjBb,uDAAqE;AAkBnE,+FAlByB,gCAAc,OAkBzB;AAjBhB,2EAAiG;AAkB/F,wGAlBkC,mDAAuB,OAkBlC;AAjBzB,yDAAwE;AAkBtE,gGAlB0B,kCAAe,OAkB1B;AAjBjB,iFAAwG;AAkBtG,0GAlBoC,wDAAyB,OAkBpC;AAjB3B,2DAAyE;AAkBvE,gGAlB0B,mCAAe,OAkB1B;AAjBjB,mFAA6G;AAkB3G,4GAlBsC,2DAA2B,OAkBtC;AAjB7B,2CAAqD;AAkBnD,0FAlBoB,qBAAS,OAkBpB;AAjBX,iDAA4D;AAkB1D,4FAlBsB,0BAAW,OAkBtB;AAjBb,qEAAwF;AAkBtF,qGAlB+B,6CAAoB,OAkB/B;AAjBtB,yEAA8F;AAkB5F,uGAlBiC,iDAAsB,OAkBjC;AAjBxB,yCAAkD;AAkBhD,yFAlBmB,mBAAQ,OAkBnB;AAhBV,+FAA2H;AAGzH,gHAH0C,qEAA+B,OAG1C"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/plugins/index.ts"],"names":[],"mappings":";;;AAAA,2DAA2E;AAmBzE,iGAnB2B,oCAAgB,OAmB3B;AAlBlB,+CAA2D;AAmBzD,4FAnBsB,yBAAW,OAmBtB;AAlBb,uDAAqE;AAmBnE,+FAnByB,gCAAc,OAmBzB;AAlBhB,2EAAiG;AAmB/F,wGAnBkC,mDAAuB,OAmBlC;AAlBzB,yDAAwE;AAmBtE,gGAnB0B,kCAAe,OAmB1B;AAlBjB,iEAAoF;AAmBlF,oGAnB8B,0CAAmB,OAmB9B;AAlBrB,iFAAwG;AAmBtG,0GAnBoC,wDAAyB,OAmBpC;AAlB3B,2DAAyE;AAmBvE,gGAnB0B,mCAAe,OAmB1B;AAlBjB,mFAA6G;AAmB3G,4GAnBsC,2DAA2B,OAmBtC;AAlB7B,2CAAqD;AAmBnD,0FAnBoB,qBAAS,OAmBpB;AAlBX,iDAA4D;AAmB1D,4FAnBsB,0BAAW,OAmBtB;AAlBb,qEAAwF;AAmBtF,qGAnB+B,6CAAoB,OAmB/B;AAlBtB,yEAA8F;AAmB5F,uGAnBiC,iDAAsB,OAmBjC;AAlBxB,yCAAkD;AAmBhD,yFAnBmB,mBAAQ,OAmBnB;AAjBV,+FAA2H;AAGzH,gHAH0C,qEAA+B,OAG1C"}
@@ -1 +1 @@
1
- {"version":"2.8.2","commands":{"browserforce:apply":{"id":"browserforce:apply","description":"apply a plan from a definition file","usage":"<%= command.id %> [-f <string>] [-p <string>] [-s <string>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]","pluginName":"sfdx-browserforce-plugin","pluginType":"core","aliases":[],"examples":["$ sfdx browserforce:apply -f ./config/setup-admin-login-as-any.json --targetusername myOrg@example.com\n logging in... done\n Applying definition file ./config/setup-admin-login-as-any.json to org myOrg@example.com\n [Security] retrieving state... done\n [Security] changing 'loginAccessPolicies' to '{\"administratorsCanLogInAsAnyUser\":true}'... done\n logging out... done\n "],"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"},"targetusername":{"name":"targetusername","type":"option","char":"u","description":"username or alias for the target org; overrides default target org"},"apiversion":{"name":"apiversion","type":"option","description":"override the api version used for api requests made by this command"},"definitionfile":{"name":"definitionfile","type":"option","char":"f","description":"path to a browserforce definition file\nThe schema is similar to the scratch org definition file.\nSee https://github.com/amtrack/sfdx-browserforce-plugin#supported-org-preferences for supported values."},"planfile":{"name":"planfile","type":"option","char":"p","description":"path to a browserforce plan file"},"statefile":{"name":"statefile","type":"option","char":"s","description":"path to a browserforce state file"}},"args":[]},"browserforce:plan":{"id":"browserforce:plan","description":"retrieve state and generate plan file","usage":"<%= command.id %> [-f <string>] [-p <string>] [-s <string>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]","pluginName":"sfdx-browserforce-plugin","pluginType":"core","aliases":[],"examples":["$ sfdx browserforce:plan -f ./config/setup-admin-login-as-any.json --targetusername myOrg@example.com\n logging in... done\n Generating plan with definition file ./config/setup-admin-login-as-any.json from org myOrg@example.com\n [Security] retrieving state... done\n [Security] generating plan... done\n logging out... done\n "],"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"},"targetusername":{"name":"targetusername","type":"option","char":"u","description":"username or alias for the target org; overrides default target org"},"apiversion":{"name":"apiversion","type":"option","description":"override the api version used for api requests made by this command"},"definitionfile":{"name":"definitionfile","type":"option","char":"f","description":"path to a browserforce definition file\nThe schema is similar to the scratch org definition file.\nSee https://github.com/amtrack/sfdx-browserforce-plugin#supported-org-preferences for supported values."},"planfile":{"name":"planfile","type":"option","char":"p","description":"path to a browserforce plan file"},"statefile":{"name":"statefile","type":"option","char":"s","description":"path to a browserforce state file"}},"args":[]}}}
1
+ {"version":"2.9.0","commands":{"browserforce:apply":{"id":"browserforce:apply","description":"apply a plan from a definition file","usage":"<%= command.id %> [-f <string>] [-p <string>] [-s <string>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]","pluginName":"sfdx-browserforce-plugin","pluginType":"core","aliases":[],"examples":["$ sfdx browserforce:apply -f ./config/setup-admin-login-as-any.json --targetusername myOrg@example.com\n logging in... done\n Applying definition file ./config/setup-admin-login-as-any.json to org myOrg@example.com\n [Security] retrieving state... done\n [Security] changing 'loginAccessPolicies' to '{\"administratorsCanLogInAsAnyUser\":true}'... done\n logging out... done\n "],"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"},"targetusername":{"name":"targetusername","type":"option","char":"u","description":"username or alias for the target org; overrides default target org"},"apiversion":{"name":"apiversion","type":"option","description":"override the api version used for api requests made by this command"},"definitionfile":{"name":"definitionfile","type":"option","char":"f","description":"path to a browserforce definition file\nThe schema is similar to the scratch org definition file.\nSee https://github.com/amtrack/sfdx-browserforce-plugin#supported-org-preferences for supported values."},"planfile":{"name":"planfile","type":"option","char":"p","description":"path to a browserforce plan file"},"statefile":{"name":"statefile","type":"option","char":"s","description":"path to a browserforce state file"}},"args":[]},"browserforce:plan":{"id":"browserforce:plan","description":"retrieve state and generate plan file","usage":"<%= command.id %> [-f <string>] [-p <string>] [-s <string>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]","pluginName":"sfdx-browserforce-plugin","pluginType":"core","aliases":[],"examples":["$ sfdx browserforce:plan -f ./config/setup-admin-login-as-any.json --targetusername myOrg@example.com\n logging in... done\n Generating plan with definition file ./config/setup-admin-login-as-any.json from org myOrg@example.com\n [Security] retrieving state... done\n [Security] generating plan... done\n logging out... done\n "],"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"},"targetusername":{"name":"targetusername","type":"option","char":"u","description":"username or alias for the target org; overrides default target org"},"apiversion":{"name":"apiversion","type":"option","description":"override the api version used for api requests made by this command"},"definitionfile":{"name":"definitionfile","type":"option","char":"f","description":"path to a browserforce definition file\nThe schema is similar to the scratch org definition file.\nSee https://github.com/amtrack/sfdx-browserforce-plugin#supported-org-preferences for supported values."},"planfile":{"name":"planfile","type":"option","char":"p","description":"path to a browserforce plan file"},"statefile":{"name":"statefile","type":"option","char":"s","description":"path to a browserforce state file"}},"args":[]}}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sfdx-browserforce-plugin",
3
- "version": "2.8.2",
3
+ "version": "2.9.0",
4
4
  "description": "sfdx plugin for browser automation",
5
5
  "author": "Matthias Rolke <mr.amtrack@gmail.com>",
6
6
  "bin": {