sfdx-browserforce-plugin 5.2.0-next.5 → 6.0.0-next.1
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/lib/browserforce.js +88 -22
- package/lib/browserforce.js.map +1 -1
- package/lib/plugins/activity-settings/index.js +93 -20
- package/lib/plugins/activity-settings/index.js.map +1 -1
- package/lib/plugins/company-information/index.js +104 -31
- package/lib/plugins/company-information/index.js.map +1 -1
- package/lib/plugins/customer-portal/available-custom-objects/index.js +166 -71
- package/lib/plugins/customer-portal/available-custom-objects/index.js.map +1 -1
- package/lib/plugins/customer-portal/enabled/index.js +73 -10
- package/lib/plugins/customer-portal/enabled/index.js.map +1 -1
- package/lib/plugins/customer-portal/portals/index.js +196 -101
- package/lib/plugins/customer-portal/portals/index.js.map +1 -1
- package/lib/plugins/density-settings/index.js +95 -21
- package/lib/plugins/density-settings/index.js.map +1 -1
- package/lib/plugins/email-deliverability/index.js +94 -21
- package/lib/plugins/email-deliverability/index.js.map +1 -1
- package/lib/plugins/high-velocity-sales-settings/index.js +67 -2
- package/lib/plugins/high-velocity-sales-settings/index.js.map +1 -1
- package/lib/plugins/high-velocity-sales-settings/page.js +0 -1
- package/lib/plugins/high-velocity-sales-settings/page.js.map +1 -1
- package/lib/plugins/history-tracking/index.js +162 -83
- package/lib/plugins/history-tracking/index.js.map +1 -1
- package/lib/plugins/home-page-layouts/index.js +129 -57
- package/lib/plugins/home-page-layouts/index.js.map +1 -1
- package/lib/plugins/lightning-experience-settings/index.js +85 -12
- package/lib/plugins/lightning-experience-settings/index.js.map +1 -1
- package/lib/plugins/linkedin-sales-navigator-settings/index.js +84 -6
- package/lib/plugins/linkedin-sales-navigator-settings/index.js.map +1 -1
- package/lib/plugins/linkedin-sales-navigator-settings/page.js +0 -2
- package/lib/plugins/linkedin-sales-navigator-settings/page.js.map +1 -1
- package/lib/plugins/omni-channel-settings/index.js +88 -13
- package/lib/plugins/omni-channel-settings/index.js.map +1 -1
- package/lib/plugins/opportunity-splits/index.js +103 -18
- package/lib/plugins/opportunity-splits/index.js.map +1 -1
- package/lib/plugins/permission-sets/service-presence-status/index.js +124 -51
- package/lib/plugins/permission-sets/service-presence-status/index.js.map +1 -1
- package/lib/plugins/picklists/field-dependencies/index.js +86 -4
- package/lib/plugins/picklists/field-dependencies/index.js.map +1 -1
- package/lib/plugins/picklists/field-dependencies/pages.js +0 -1
- package/lib/plugins/picklists/field-dependencies/pages.js.map +1 -1
- package/lib/plugins/picklists/index.js +128 -55
- package/lib/plugins/picklists/index.js.map +1 -1
- package/lib/plugins/record-types/index.js +73 -10
- package/lib/plugins/record-types/index.js.map +1 -1
- package/lib/plugins/record-types/pages.js +0 -1
- package/lib/plugins/record-types/pages.js.map +1 -1
- package/lib/plugins/relate-contact-to-multiple-accounts/index.js +102 -28
- package/lib/plugins/relate-contact-to-multiple-accounts/index.js.map +1 -1
- package/lib/plugins/reports-and-dashboards/folder-sharing/index.js +107 -35
- package/lib/plugins/reports-and-dashboards/folder-sharing/index.js.map +1 -1
- package/lib/plugins/salesforce-cpq-config/index.js +249 -165
- package/lib/plugins/salesforce-cpq-config/index.js.map +1 -1
- package/lib/plugins/salesforce-to-salesforce/index.js +93 -20
- package/lib/plugins/salesforce-to-salesforce/index.js.map +1 -1
- package/lib/plugins/security/authentication-configuration/index.js +121 -49
- package/lib/plugins/security/authentication-configuration/index.js.map +1 -1
- package/lib/plugins/security/certificate-and-key-management/index.js +142 -57
- package/lib/plugins/security/certificate-and-key-management/index.js.map +1 -1
- package/lib/plugins/service-channels/capacity/index.js +173 -102
- package/lib/plugins/service-channels/capacity/index.js.map +1 -1
- package/lib/plugins/slack/index.js +101 -27
- package/lib/plugins/slack/index.js.map +1 -1
- package/lib/plugins/user-access-policies/index.js +96 -24
- package/lib/plugins/user-access-policies/index.js.map +1 -1
- package/lib/plugins/user-access-policies/page.js +0 -6
- package/lib/plugins/user-access-policies/page.js.map +1 -1
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
|
@@ -1,3 +1,55 @@
|
|
|
1
|
+
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
|
2
|
+
if (value !== null && value !== void 0) {
|
|
3
|
+
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
|
4
|
+
var dispose, inner;
|
|
5
|
+
if (async) {
|
|
6
|
+
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
|
7
|
+
dispose = value[Symbol.asyncDispose];
|
|
8
|
+
}
|
|
9
|
+
if (dispose === void 0) {
|
|
10
|
+
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
|
11
|
+
dispose = value[Symbol.dispose];
|
|
12
|
+
if (async) inner = dispose;
|
|
13
|
+
}
|
|
14
|
+
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
|
15
|
+
if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
|
|
16
|
+
env.stack.push({ value: value, dispose: dispose, async: async });
|
|
17
|
+
}
|
|
18
|
+
else if (async) {
|
|
19
|
+
env.stack.push({ async: true });
|
|
20
|
+
}
|
|
21
|
+
return value;
|
|
22
|
+
};
|
|
23
|
+
var __disposeResources = (this && this.__disposeResources) || (function (SuppressedError) {
|
|
24
|
+
return function (env) {
|
|
25
|
+
function fail(e) {
|
|
26
|
+
env.error = env.hasError ? new SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
|
27
|
+
env.hasError = true;
|
|
28
|
+
}
|
|
29
|
+
var r, s = 0;
|
|
30
|
+
function next() {
|
|
31
|
+
while (r = env.stack.pop()) {
|
|
32
|
+
try {
|
|
33
|
+
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
|
|
34
|
+
if (r.dispose) {
|
|
35
|
+
var result = r.dispose.call(r.value);
|
|
36
|
+
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
|
|
37
|
+
}
|
|
38
|
+
else s |= 1;
|
|
39
|
+
}
|
|
40
|
+
catch (e) {
|
|
41
|
+
fail(e);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
|
|
45
|
+
if (env.hasError) throw env.error;
|
|
46
|
+
}
|
|
47
|
+
return next();
|
|
48
|
+
};
|
|
49
|
+
})(typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
50
|
+
var e = new Error(message);
|
|
51
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
52
|
+
});
|
|
1
53
|
import * as queryString from 'querystring';
|
|
2
54
|
import { waitForPageErrors } from '../../../browserforce.js';
|
|
3
55
|
import { BrowserforcePlugin } from '../../../plugin.js';
|
|
@@ -7,65 +59,86 @@ const PORTAL_PROFILE_MEMBERSHIP_PATH = '_ui/core/portal/PortalProfileMembershipP
|
|
|
7
59
|
const SAVE_BUTTON_SELECTOR = 'input[name="save"]';
|
|
8
60
|
export class CustomerPortalSetup extends BrowserforcePlugin {
|
|
9
61
|
async retrieve() {
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
name: a.text,
|
|
18
|
-
portalProfileMemberships: [],
|
|
19
|
-
};
|
|
20
|
-
});
|
|
21
|
-
});
|
|
22
|
-
for (const portal of response) {
|
|
23
|
-
const portalPage = await this.browserforce.openPage(`${portal._id}/e`);
|
|
24
|
-
portal.description = await portalPage
|
|
25
|
-
.locator('input#Description')
|
|
26
|
-
.inputValue();
|
|
27
|
-
portal.adminUser = await portalPage.locator('input#Admin').inputValue();
|
|
28
|
-
portal.isSelfRegistrationActivated = await portalPage
|
|
29
|
-
.locator('input#IsSelfRegistrationActivated')
|
|
30
|
-
.isChecked();
|
|
31
|
-
portal.selfRegUserDefaultLicense = await portalPage
|
|
32
|
-
.locator('select#SelfRegUserDefaultLicense option:checked')
|
|
33
|
-
.textContent();
|
|
34
|
-
portal.selfRegUserDefaultRole = await portalPage
|
|
35
|
-
.locator('select#SelfRegUserDefaultRole option:checked')
|
|
36
|
-
.textContent();
|
|
37
|
-
portal.selfRegUserDefaultProfile = await portalPage
|
|
38
|
-
.locator('select#SelfRegUserDefaultProfile option:checked')
|
|
39
|
-
.textContent();
|
|
40
|
-
await portalPage.close();
|
|
41
|
-
// portalProfileMemberships
|
|
42
|
-
const portalProfilePage = await this.browserforce.openPage(`${PORTAL_PROFILE_MEMBERSHIP_PATH}?portalId=${portal._id}&setupid=CustomerSuccessPortalSettings`);
|
|
43
|
-
const profilesLocator = portalProfilePage.locator('th.dataCell');
|
|
44
|
-
await profilesLocator.first().waitFor();
|
|
45
|
-
const profiles = await profilesLocator.allTextContents();
|
|
46
|
-
const checkboxes = await portalProfilePage
|
|
47
|
-
.locator('td.dataCell input')
|
|
48
|
-
.evaluateAll((inputs) => {
|
|
49
|
-
return inputs.map((input) => {
|
|
62
|
+
const env_1 = { stack: [], error: void 0, hasError: false };
|
|
63
|
+
try {
|
|
64
|
+
const page = __addDisposableResource(env_1, await this.browserforce.openPage(LIST_VIEW_PATH), true);
|
|
65
|
+
const portalLinksLocator = page.locator('xpath=//div[contains(@class,"pbBody")]//th[contains(@class,"dataCell")]//a[starts-with(@href, "/060")]');
|
|
66
|
+
await portalLinksLocator.first().waitFor();
|
|
67
|
+
const response = await portalLinksLocator.evaluateAll((links) => {
|
|
68
|
+
return links.map((a) => {
|
|
50
69
|
return {
|
|
51
|
-
|
|
52
|
-
|
|
70
|
+
_id: a.pathname.split('/')[1],
|
|
71
|
+
name: a.text,
|
|
72
|
+
portalProfileMemberships: [],
|
|
53
73
|
};
|
|
54
74
|
});
|
|
55
75
|
});
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
76
|
+
for (const portal of response) {
|
|
77
|
+
const env_2 = { stack: [], error: void 0, hasError: false };
|
|
78
|
+
try {
|
|
79
|
+
const portalPage = __addDisposableResource(env_2, await this.browserforce.openPage(`${portal._id}/e`), true);
|
|
80
|
+
portal.description = await portalPage
|
|
81
|
+
.locator('input#Description')
|
|
82
|
+
.inputValue();
|
|
83
|
+
portal.adminUser = await portalPage.locator('input#Admin').inputValue();
|
|
84
|
+
portal.isSelfRegistrationActivated = await portalPage
|
|
85
|
+
.locator('input#IsSelfRegistrationActivated')
|
|
86
|
+
.isChecked();
|
|
87
|
+
portal.selfRegUserDefaultLicense = await portalPage
|
|
88
|
+
.locator('select#SelfRegUserDefaultLicense option:checked')
|
|
89
|
+
.textContent();
|
|
90
|
+
portal.selfRegUserDefaultRole = await portalPage
|
|
91
|
+
.locator('select#SelfRegUserDefaultRole option:checked')
|
|
92
|
+
.textContent();
|
|
93
|
+
portal.selfRegUserDefaultProfile = await portalPage
|
|
94
|
+
.locator('select#SelfRegUserDefaultProfile option:checked')
|
|
95
|
+
.textContent();
|
|
96
|
+
// portalProfileMemberships
|
|
97
|
+
const portalProfilePage = __addDisposableResource(env_2, await this.browserforce.openPage(`${PORTAL_PROFILE_MEMBERSHIP_PATH}?portalId=${portal._id}&setupid=CustomerSuccessPortalSettings`), true);
|
|
98
|
+
const profilesLocator = portalProfilePage.locator('th.dataCell');
|
|
99
|
+
await profilesLocator.first().waitFor();
|
|
100
|
+
const profiles = await profilesLocator.allTextContents();
|
|
101
|
+
const checkboxes = await portalProfilePage
|
|
102
|
+
.locator('td.dataCell input')
|
|
103
|
+
.evaluateAll((inputs) => {
|
|
104
|
+
return inputs.map((input) => {
|
|
105
|
+
return {
|
|
106
|
+
active: input.checked,
|
|
107
|
+
_id: input.id,
|
|
108
|
+
};
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
const portalProfileMemberships = [];
|
|
112
|
+
for (let i = 0; i < profiles.length; i++) {
|
|
113
|
+
portalProfileMemberships.push({
|
|
114
|
+
name: profiles[i],
|
|
115
|
+
active: checkboxes[i].active,
|
|
116
|
+
_id: checkboxes[i]._id,
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
portal.portalProfileMemberships = portalProfileMemberships;
|
|
120
|
+
}
|
|
121
|
+
catch (e_1) {
|
|
122
|
+
env_2.error = e_1;
|
|
123
|
+
env_2.hasError = true;
|
|
124
|
+
}
|
|
125
|
+
finally {
|
|
126
|
+
const result_1 = __disposeResources(env_2);
|
|
127
|
+
if (result_1)
|
|
128
|
+
await result_1;
|
|
129
|
+
}
|
|
63
130
|
}
|
|
64
|
-
|
|
65
|
-
|
|
131
|
+
return response;
|
|
132
|
+
}
|
|
133
|
+
catch (e_2) {
|
|
134
|
+
env_1.error = e_2;
|
|
135
|
+
env_1.hasError = true;
|
|
136
|
+
}
|
|
137
|
+
finally {
|
|
138
|
+
const result_2 = __disposeResources(env_1);
|
|
139
|
+
if (result_2)
|
|
140
|
+
await result_2;
|
|
66
141
|
}
|
|
67
|
-
await page.close();
|
|
68
|
-
return response;
|
|
69
142
|
}
|
|
70
143
|
diff(source, target) {
|
|
71
144
|
const response = [];
|
|
@@ -119,58 +192,80 @@ export class CustomerPortalSetup extends BrowserforcePlugin {
|
|
|
119
192
|
async apply(config) {
|
|
120
193
|
for (const portal of config) {
|
|
121
194
|
if (portal._id) {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
urlAttributes
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
await page.locator('input#Description').waitFor();
|
|
139
|
-
if (portal.selfRegUserDefaultLicense) {
|
|
140
|
-
await page
|
|
141
|
-
.locator('select#SelfRegUserDefaultLicense')
|
|
142
|
-
.selectOption({ label: portal.selfRegUserDefaultLicense });
|
|
143
|
-
}
|
|
144
|
-
if (portal.selfRegUserDefaultRole) {
|
|
145
|
-
await page
|
|
146
|
-
.locator('select#SelfRegUserDefaultRole')
|
|
147
|
-
.selectOption({ label: portal.selfRegUserDefaultRole });
|
|
148
|
-
}
|
|
149
|
-
if (portal.selfRegUserDefaultProfile) {
|
|
150
|
-
await page
|
|
151
|
-
.locator('select#SelfRegUserDefaultProfile')
|
|
152
|
-
.selectOption({ label: portal.selfRegUserDefaultProfile });
|
|
153
|
-
}
|
|
154
|
-
await page.locator(SAVE_BUTTON_SELECTOR).first().click();
|
|
155
|
-
await Promise.race([
|
|
156
|
-
page.waitForURL((url) => !url.pathname.includes(portal._id)),
|
|
157
|
-
waitForPageErrors(page),
|
|
158
|
-
]);
|
|
159
|
-
// portalProfileMemberships
|
|
160
|
-
if (portal.portalProfileMemberships) {
|
|
161
|
-
const membershipUrlAttributes = {};
|
|
162
|
-
for (const member of portal.portalProfileMemberships) {
|
|
163
|
-
membershipUrlAttributes[member._id] = member.active ? 1 : 0;
|
|
195
|
+
const env_3 = { stack: [], error: void 0, hasError: false };
|
|
196
|
+
try {
|
|
197
|
+
// everything that can be changed using the url
|
|
198
|
+
const urlAttributes = {};
|
|
199
|
+
if (portal.name) {
|
|
200
|
+
urlAttributes['Name'] = portal.name;
|
|
201
|
+
}
|
|
202
|
+
if (portal.description) {
|
|
203
|
+
urlAttributes['Description'] = portal.description;
|
|
204
|
+
}
|
|
205
|
+
if (portal.adminUser) {
|
|
206
|
+
urlAttributes['Admin'] = portal.adminUser;
|
|
207
|
+
}
|
|
208
|
+
if (portal.isSelfRegistrationActivated !== undefined) {
|
|
209
|
+
urlAttributes['IsSelfRegistrationActivated'] =
|
|
210
|
+
portal.isSelfRegistrationActivated ? 1 : 0;
|
|
164
211
|
}
|
|
165
|
-
const
|
|
166
|
-
await
|
|
212
|
+
const page = __addDisposableResource(env_3, await this.browserforce.openPage(`${portal._id}/e?${queryString.stringify(urlAttributes)}`), true);
|
|
213
|
+
await page.locator('input#Description').waitFor();
|
|
214
|
+
if (portal.selfRegUserDefaultLicense) {
|
|
215
|
+
await page
|
|
216
|
+
.locator('select#SelfRegUserDefaultLicense')
|
|
217
|
+
.selectOption({ label: portal.selfRegUserDefaultLicense });
|
|
218
|
+
}
|
|
219
|
+
if (portal.selfRegUserDefaultRole) {
|
|
220
|
+
await page
|
|
221
|
+
.locator('select#SelfRegUserDefaultRole')
|
|
222
|
+
.selectOption({ label: portal.selfRegUserDefaultRole });
|
|
223
|
+
}
|
|
224
|
+
if (portal.selfRegUserDefaultProfile) {
|
|
225
|
+
await page
|
|
226
|
+
.locator('select#SelfRegUserDefaultProfile')
|
|
227
|
+
.selectOption({ label: portal.selfRegUserDefaultProfile });
|
|
228
|
+
}
|
|
229
|
+
await page.locator(SAVE_BUTTON_SELECTOR).first().click();
|
|
167
230
|
await Promise.race([
|
|
168
|
-
|
|
169
|
-
waitForPageErrors(
|
|
231
|
+
page.waitForURL((url) => !url.pathname.includes(portal._id)),
|
|
232
|
+
waitForPageErrors(page),
|
|
170
233
|
]);
|
|
171
|
-
|
|
234
|
+
// portalProfileMemberships
|
|
235
|
+
if (portal.portalProfileMemberships) {
|
|
236
|
+
const env_4 = { stack: [], error: void 0, hasError: false };
|
|
237
|
+
try {
|
|
238
|
+
const membershipUrlAttributes = {};
|
|
239
|
+
for (const member of portal.portalProfileMemberships) {
|
|
240
|
+
membershipUrlAttributes[member._id] = member.active ? 1 : 0;
|
|
241
|
+
}
|
|
242
|
+
const portalProfilePage = __addDisposableResource(env_4, await this.browserforce.openPage(`${PORTAL_PROFILE_MEMBERSHIP_PATH}?portalId=${portal._id}&setupid=CustomerSuccessPortalSettings&${queryString.stringify(membershipUrlAttributes)}&retURL=${encodeURIComponent('/setup/forcecomHomepage.apexp')}`), true);
|
|
243
|
+
await portalProfilePage.locator(SAVE_BUTTON_SELECTOR).first().click();
|
|
244
|
+
await Promise.race([
|
|
245
|
+
portalProfilePage.waitForURL((url) => url.pathname === '/setup/forcecomHomepage.apexp'),
|
|
246
|
+
waitForPageErrors(portalProfilePage),
|
|
247
|
+
]);
|
|
248
|
+
}
|
|
249
|
+
catch (e_3) {
|
|
250
|
+
env_4.error = e_3;
|
|
251
|
+
env_4.hasError = true;
|
|
252
|
+
}
|
|
253
|
+
finally {
|
|
254
|
+
const result_3 = __disposeResources(env_4);
|
|
255
|
+
if (result_3)
|
|
256
|
+
await result_3;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
catch (e_4) {
|
|
261
|
+
env_3.error = e_4;
|
|
262
|
+
env_3.hasError = true;
|
|
263
|
+
}
|
|
264
|
+
finally {
|
|
265
|
+
const result_4 = __disposeResources(env_3);
|
|
266
|
+
if (result_4)
|
|
267
|
+
await result_4;
|
|
172
268
|
}
|
|
173
|
-
await page.close();
|
|
174
269
|
}
|
|
175
270
|
}
|
|
176
271
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/plugins/customer-portal/portals/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,WAAW,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAEzD,MAAM,cAAc,GAAG,8CAA8C,CAAC;AACtE,MAAM,8BAA8B,GAClC,+CAA+C,CAAC;AAElD,MAAM,oBAAoB,GAAG,oBAAoB,CAAC;AAuBlD,MAAM,OAAO,mBAAoB,SAAQ,kBAAkB;IAClD,KAAK,CAAC,QAAQ
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/plugins/customer-portal/portals/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,WAAW,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CA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AAkB,CAAC,+BAA+B,CAAC,EAAE,CAClE,OAAA,CAAC;4BACF,MAAM,iBAAiB,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,CAAC;4BACtE,MAAM,OAAO,CAAC,IAAI,CAAC;gCACjB,iBAAiB,CAAC,UAAU,CAC1B,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,KAAK,+BAA+B,CAC1D;gCACD,iBAAiB,CAAC,iBAAiB,CAAC;6BACrC,CAAC,CAAC;;;;;;;;;;;qBACJ;;;;;;;;;;;aACF;QACH,CAAC;IACH,CAAC;CACF"}
|
|
@@ -1,32 +1,106 @@
|
|
|
1
|
+
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
|
2
|
+
if (value !== null && value !== void 0) {
|
|
3
|
+
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
|
4
|
+
var dispose, inner;
|
|
5
|
+
if (async) {
|
|
6
|
+
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
|
7
|
+
dispose = value[Symbol.asyncDispose];
|
|
8
|
+
}
|
|
9
|
+
if (dispose === void 0) {
|
|
10
|
+
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
|
11
|
+
dispose = value[Symbol.dispose];
|
|
12
|
+
if (async) inner = dispose;
|
|
13
|
+
}
|
|
14
|
+
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
|
15
|
+
if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
|
|
16
|
+
env.stack.push({ value: value, dispose: dispose, async: async });
|
|
17
|
+
}
|
|
18
|
+
else if (async) {
|
|
19
|
+
env.stack.push({ async: true });
|
|
20
|
+
}
|
|
21
|
+
return value;
|
|
22
|
+
};
|
|
23
|
+
var __disposeResources = (this && this.__disposeResources) || (function (SuppressedError) {
|
|
24
|
+
return function (env) {
|
|
25
|
+
function fail(e) {
|
|
26
|
+
env.error = env.hasError ? new SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
|
27
|
+
env.hasError = true;
|
|
28
|
+
}
|
|
29
|
+
var r, s = 0;
|
|
30
|
+
function next() {
|
|
31
|
+
while (r = env.stack.pop()) {
|
|
32
|
+
try {
|
|
33
|
+
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
|
|
34
|
+
if (r.dispose) {
|
|
35
|
+
var result = r.dispose.call(r.value);
|
|
36
|
+
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
|
|
37
|
+
}
|
|
38
|
+
else s |= 1;
|
|
39
|
+
}
|
|
40
|
+
catch (e) {
|
|
41
|
+
fail(e);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
|
|
45
|
+
if (env.hasError) throw env.error;
|
|
46
|
+
}
|
|
47
|
+
return next();
|
|
48
|
+
};
|
|
49
|
+
})(typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
50
|
+
var e = new Error(message);
|
|
51
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
52
|
+
});
|
|
1
53
|
import { waitForPageErrors } from '../../browserforce.js';
|
|
2
54
|
import { BrowserforcePlugin } from '../../plugin.js';
|
|
3
55
|
const BASE_PATH = 'lightning/setup/DensitySetup/home';
|
|
4
56
|
const availableOptions = ['Comfy', 'Compact'];
|
|
5
57
|
export class DensitySettings extends BrowserforcePlugin {
|
|
6
58
|
async retrieve() {
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
.
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
59
|
+
const env_1 = { stack: [], error: void 0, hasError: false };
|
|
60
|
+
try {
|
|
61
|
+
const page = __addDisposableResource(env_1, await this.browserforce.openPage(BASE_PATH), true);
|
|
62
|
+
const density = (await page
|
|
63
|
+
.locator('input[name="options"]:checked')
|
|
64
|
+
.getAttribute('value'));
|
|
65
|
+
return {
|
|
66
|
+
density,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
catch (e_1) {
|
|
70
|
+
env_1.error = e_1;
|
|
71
|
+
env_1.hasError = true;
|
|
72
|
+
}
|
|
73
|
+
finally {
|
|
74
|
+
const result_1 = __disposeResources(env_1);
|
|
75
|
+
if (result_1)
|
|
76
|
+
await result_1;
|
|
77
|
+
}
|
|
15
78
|
}
|
|
16
79
|
async apply(config) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
80
|
+
const env_2 = { stack: [], error: void 0, hasError: false };
|
|
81
|
+
try {
|
|
82
|
+
if (!availableOptions.includes(config.density)) {
|
|
83
|
+
throw new Error(`Could not find density "${config.density}". Available options: ${availableOptions.join(', ')}`);
|
|
84
|
+
}
|
|
85
|
+
const page = __addDisposableResource(env_2, await this.browserforce.openPage(BASE_PATH), true);
|
|
86
|
+
const densityPickerItem = page.locator(`one-density-visual-picker-item:has(input[name="options"][value="${config.density}"])`);
|
|
87
|
+
await Promise.all([
|
|
88
|
+
Promise.race([
|
|
89
|
+
page.waitForResponse(/DensityUserSettings\.setDefaultDensitySetting=1/),
|
|
90
|
+
waitForPageErrors(page),
|
|
91
|
+
]),
|
|
92
|
+
densityPickerItem.click(),
|
|
93
|
+
]);
|
|
94
|
+
}
|
|
95
|
+
catch (e_2) {
|
|
96
|
+
env_2.error = e_2;
|
|
97
|
+
env_2.hasError = true;
|
|
98
|
+
}
|
|
99
|
+
finally {
|
|
100
|
+
const result_2 = __disposeResources(env_2);
|
|
101
|
+
if (result_2)
|
|
102
|
+
await result_2;
|
|
103
|
+
}
|
|
30
104
|
}
|
|
31
105
|
}
|
|
32
106
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/plugins/density-settings/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAErD,MAAM,SAAS,GAAG,mCAAmC,CAAC;AAOtD,MAAM,gBAAgB,GAAG,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;AAE9C,MAAM,OAAO,eAAgB,SAAQ,kBAAkB;IAC9C,KAAK,CAAC,QAAQ
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/plugins/density-settings/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAErD,MAAM,SAAS,GAAG,mCAAmC,CAAC;AAOtD,MAAM,gBAAgB,GAAG,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;AAE9C,MAAM,OAAO,eAAgB,SAAQ,kBAAkB;IAC9C,KAAK,CAAC,QAAQ;;;YACnB,MAAY,IAAI,kCAAG,MAAM,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,SAAS,CAAC,OAAA,CAAC;YAC/D,MAAM,OAAO,GAAG,CAAC,MAAM,IAAI;iBACxB,OAAO,CAAC,+BAA+B,CAAC;iBACxC,YAAY,CAAC,OAAO,CAAC,CAAY,CAAC;YACrC,OAAO;gBACL,OAAO;aACR,CAAC;;;;;;;;;;;KACH;IAEM,KAAK,CAAC,KAAK,CAAC,MAAc;;;YAC/B,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;gBAC/C,MAAM,IAAI,KAAK,CACb,2BACE,MAAM,CAAC,OACT,yBAAyB,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACvD,CAAC;YACJ,CAAC;YACD,MAAY,IAAI,kCAAG,MAAM,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,SAAS,CAAC,OAAA,CAAC;YAC/D,MAAM,iBAAiB,GAAG,IAAI,CAAC,OAAO,CACpC,mEAAmE,MAAM,CAAC,OAAO,KAAK,CACvF,CAAC;YACF,MAAM,OAAO,CAAC,GAAG,CAAC;gBAChB,OAAO,CAAC,IAAI,CAAC;oBACX,IAAI,CAAC,eAAe,CAAC,iDAAiD,CAAC;oBACvE,iBAAiB,CAAC,IAAI,CAAC;iBACxB,CAAC;gBACF,iBAAiB,CAAC,KAAK,EAAE;aAC1B,CAAC,CAAC;;;;;;;;;;;KACJ;CACF"}
|
|
@@ -1,3 +1,55 @@
|
|
|
1
|
+
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
|
2
|
+
if (value !== null && value !== void 0) {
|
|
3
|
+
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
|
4
|
+
var dispose, inner;
|
|
5
|
+
if (async) {
|
|
6
|
+
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
|
7
|
+
dispose = value[Symbol.asyncDispose];
|
|
8
|
+
}
|
|
9
|
+
if (dispose === void 0) {
|
|
10
|
+
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
|
11
|
+
dispose = value[Symbol.dispose];
|
|
12
|
+
if (async) inner = dispose;
|
|
13
|
+
}
|
|
14
|
+
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
|
15
|
+
if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
|
|
16
|
+
env.stack.push({ value: value, dispose: dispose, async: async });
|
|
17
|
+
}
|
|
18
|
+
else if (async) {
|
|
19
|
+
env.stack.push({ async: true });
|
|
20
|
+
}
|
|
21
|
+
return value;
|
|
22
|
+
};
|
|
23
|
+
var __disposeResources = (this && this.__disposeResources) || (function (SuppressedError) {
|
|
24
|
+
return function (env) {
|
|
25
|
+
function fail(e) {
|
|
26
|
+
env.error = env.hasError ? new SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
|
27
|
+
env.hasError = true;
|
|
28
|
+
}
|
|
29
|
+
var r, s = 0;
|
|
30
|
+
function next() {
|
|
31
|
+
while (r = env.stack.pop()) {
|
|
32
|
+
try {
|
|
33
|
+
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
|
|
34
|
+
if (r.dispose) {
|
|
35
|
+
var result = r.dispose.call(r.value);
|
|
36
|
+
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
|
|
37
|
+
}
|
|
38
|
+
else s |= 1;
|
|
39
|
+
}
|
|
40
|
+
catch (e) {
|
|
41
|
+
fail(e);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
|
|
45
|
+
if (env.hasError) throw env.error;
|
|
46
|
+
}
|
|
47
|
+
return next();
|
|
48
|
+
};
|
|
49
|
+
})(typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
50
|
+
var e = new Error(message);
|
|
51
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
52
|
+
});
|
|
1
53
|
import { BrowserforcePlugin } from '../../plugin.js';
|
|
2
54
|
const BASE_PATH = 'email-admin/editOrgEmailSettings.apexp';
|
|
3
55
|
const ACCESS_LEVEL_SELECTOR = 'select[id$=":sendEmailAccessControlSelect"]';
|
|
@@ -10,29 +62,50 @@ const ACCESS_LEVEL_VALUES = new Map([
|
|
|
10
62
|
]);
|
|
11
63
|
export class EmailDeliverability extends BrowserforcePlugin {
|
|
12
64
|
async retrieve(definition) {
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
65
|
+
const env_1 = { stack: [], error: void 0, hasError: false };
|
|
66
|
+
try {
|
|
67
|
+
const page = __addDisposableResource(env_1, await this.browserforce.openPage(BASE_PATH), true);
|
|
68
|
+
const selectedOption = await page
|
|
69
|
+
.locator(`${ACCESS_LEVEL_SELECTOR} > option[selected]`)
|
|
70
|
+
.textContent();
|
|
71
|
+
if (!selectedOption) {
|
|
72
|
+
throw new Error('Selected access level not found...');
|
|
73
|
+
}
|
|
74
|
+
return {
|
|
75
|
+
accessLevel: selectedOption,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
catch (e_1) {
|
|
79
|
+
env_1.error = e_1;
|
|
80
|
+
env_1.hasError = true;
|
|
81
|
+
}
|
|
82
|
+
finally {
|
|
83
|
+
const result_1 = __disposeResources(env_1);
|
|
84
|
+
if (result_1)
|
|
85
|
+
await result_1;
|
|
86
|
+
}
|
|
25
87
|
}
|
|
26
88
|
async apply(config) {
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
89
|
+
const env_2 = { stack: [], error: void 0, hasError: false };
|
|
90
|
+
try {
|
|
91
|
+
const accessLevelNumber = ACCESS_LEVEL_VALUES.get(config.accessLevel);
|
|
92
|
+
if (accessLevelNumber === undefined) {
|
|
93
|
+
throw new Error(`Invalid email access level ${config.accessLevel}`);
|
|
94
|
+
}
|
|
95
|
+
const page = __addDisposableResource(env_2, await this.browserforce.openPage(BASE_PATH), true);
|
|
96
|
+
await page.locator(ACCESS_LEVEL_SELECTOR).selectOption(accessLevelNumber);
|
|
97
|
+
await page.locator(SAVE_BUTTON_SELECTOR).click();
|
|
98
|
+
await page.locator(CONFIRM_MESSAGE_SELECTOR).waitFor();
|
|
99
|
+
}
|
|
100
|
+
catch (e_2) {
|
|
101
|
+
env_2.error = e_2;
|
|
102
|
+
env_2.hasError = true;
|
|
103
|
+
}
|
|
104
|
+
finally {
|
|
105
|
+
const result_2 = __disposeResources(env_2);
|
|
106
|
+
if (result_2)
|
|
107
|
+
await result_2;
|
|
108
|
+
}
|
|
36
109
|
}
|
|
37
110
|
}
|
|
38
111
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/plugins/email-deliverability/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAErD,MAAM,SAAS,GAAG,wCAAwC,CAAC;AAE3D,MAAM,qBAAqB,GAAG,6CAA6C,CAAC;AAC5E,MAAM,wBAAwB,GAAG,0BAA0B,CAAC;AAC5D,MAAM,oBAAoB,GAAG,uBAAuB,CAAC;AAErD,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAAC;IAClC,CAAC,WAAW,EAAE,GAAG,CAAC;IAClB,CAAC,mBAAmB,EAAE,GAAG,CAAC;IAC1B,CAAC,WAAW,EAAE,GAAG,CAAC;CACnB,CAAC,CAAC;AAMH,MAAM,OAAO,mBAAoB,SAAQ,kBAAkB;IAClD,KAAK,CAAC,QAAQ,CAAC,UAAmB
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/plugins/email-deliverability/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAErD,MAAM,SAAS,GAAG,wCAAwC,CAAC;AAE3D,MAAM,qBAAqB,GAAG,6CAA6C,CAAC;AAC5E,MAAM,wBAAwB,GAAG,0BAA0B,CAAC;AAC5D,MAAM,oBAAoB,GAAG,uBAAuB,CAAC;AAErD,MAAM,mBAAmB,GAAG,IAAI,GAAG,CA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