sfdx-browserforce-plugin 2.11.3 → 3.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/README.md +6 -6
- package/lib/browserforce-command.js +25 -19
- package/lib/browserforce-command.js.map +1 -1
- package/lib/browserforce.js +11 -28
- package/lib/browserforce.js.map +1 -1
- package/lib/commands/browserforce/apply.js +14 -14
- package/lib/commands/browserforce/apply.js.map +1 -1
- package/lib/commands/browserforce/plan.js +16 -15
- package/lib/commands/browserforce/plan.js.map +1 -1
- package/lib/config-parser.js +1 -1
- package/lib/config-parser.js.map +1 -1
- package/lib/jsforce-utils.js.map +1 -1
- package/lib/plugin.js +11 -30
- package/lib/plugin.js.map +1 -1
- package/lib/plugins/activity-settings/index.e2e-spec.js +41 -0
- package/lib/plugins/activity-settings/index.e2e-spec.js.map +1 -0
- package/lib/plugins/activity-settings/index.js +1 -4
- package/lib/plugins/activity-settings/index.js.map +1 -1
- package/lib/plugins/communities/index.e2e-spec.js +39 -0
- package/lib/plugins/communities/index.e2e-spec.js.map +1 -0
- package/lib/plugins/communities/index.js +2 -7
- package/lib/plugins/communities/index.js.map +1 -1
- package/lib/plugins/company-information/index.e2e-spec.js +42 -0
- package/lib/plugins/company-information/index.e2e-spec.js.map +1 -0
- package/lib/plugins/company-information/index.js +8 -12
- package/lib/plugins/company-information/index.js.map +1 -1
- package/lib/plugins/customer-portal/available-custom-objects/index.js +20 -48
- package/lib/plugins/customer-portal/available-custom-objects/index.js.map +1 -1
- package/lib/plugins/customer-portal/available-custom-objects/index.test.js +44 -0
- package/lib/plugins/customer-portal/available-custom-objects/index.test.js.map +1 -0
- package/lib/plugins/customer-portal/enabled/index.js +3 -11
- package/lib/plugins/customer-portal/enabled/index.js.map +1 -1
- package/lib/plugins/customer-portal/enabled/index.test.js +39 -0
- package/lib/plugins/customer-portal/enabled/index.test.js.map +1 -0
- package/lib/plugins/customer-portal/index.e2e-spec.js +222 -0
- package/lib/plugins/customer-portal/index.e2e-spec.js.map +1 -0
- package/lib/plugins/customer-portal/index.js +17 -13
- package/lib/plugins/customer-portal/index.js.map +1 -1
- package/lib/plugins/customer-portal/index.test.js +89 -0
- package/lib/plugins/customer-portal/index.test.js.map +1 -0
- package/lib/plugins/customer-portal/portals/index.js +17 -25
- package/lib/plugins/customer-portal/portals/index.js.map +1 -1
- package/lib/plugins/customer-portal/portals/index.test.js +145 -0
- package/lib/plugins/customer-portal/portals/index.test.js.map +1 -0
- package/lib/plugins/defer-sharing-calculation/index.e2e-spec.js +96 -0
- package/lib/plugins/defer-sharing-calculation/index.e2e-spec.js.map +1 -0
- package/lib/plugins/defer-sharing-calculation/index.js +2 -7
- package/lib/plugins/defer-sharing-calculation/index.js.map +1 -1
- package/lib/plugins/density-settings/index.e2e-spec.js +44 -0
- package/lib/plugins/density-settings/index.e2e-spec.js.map +1 -0
- package/lib/plugins/density-settings/index.js +8 -6
- package/lib/plugins/density-settings/index.js.map +1 -1
- package/lib/plugins/email-deliverability/index.e2e-spec.js +60 -0
- package/lib/plugins/email-deliverability/index.e2e-spec.js.map +1 -0
- package/lib/plugins/email-deliverability/index.js +7 -10
- package/lib/plugins/email-deliverability/index.js.map +1 -1
- package/lib/plugins/high-velocity-sales-settings/index.e2e-spec.js +34 -0
- package/lib/plugins/high-velocity-sales-settings/index.e2e-spec.js.map +1 -0
- package/lib/plugins/high-velocity-sales-settings/index.js +1 -2
- package/lib/plugins/high-velocity-sales-settings/index.js.map +1 -1
- package/lib/plugins/high-velocity-sales-settings/page.js +3 -1
- package/lib/plugins/high-velocity-sales-settings/page.js.map +1 -1
- package/lib/plugins/home-page-layouts/index.e2e-spec.js +52 -0
- package/lib/plugins/home-page-layouts/index.e2e-spec.js.map +1 -0
- package/lib/plugins/home-page-layouts/index.js +14 -32
- package/lib/plugins/home-page-layouts/index.js.map +1 -1
- package/lib/plugins/home-page-layouts/index.test.js +109 -0
- package/lib/plugins/home-page-layouts/index.test.js.map +1 -0
- package/lib/plugins/lightning-experience-settings/index.e2e-spec.js +44 -0
- package/lib/plugins/lightning-experience-settings/index.e2e-spec.js.map +1 -0
- package/lib/plugins/lightning-experience-settings/index.js +11 -9
- package/lib/plugins/lightning-experience-settings/index.js.map +1 -1
- package/lib/plugins/opportunity-splits/index.e2e-spec.js +70 -0
- package/lib/plugins/opportunity-splits/index.e2e-spec.js.map +1 -0
- package/lib/plugins/opportunity-splits/pages/layout-selection.js +1 -4
- package/lib/plugins/opportunity-splits/pages/layout-selection.js.map +1 -1
- package/lib/plugins/opportunity-splits/pages/overview.js +1 -4
- package/lib/plugins/opportunity-splits/pages/overview.js.map +1 -1
- package/lib/plugins/opportunity-splits/pages/setup.js +1 -4
- package/lib/plugins/opportunity-splits/pages/setup.js.map +1 -1
- package/lib/plugins/picklists/field-dependencies/index.js +15 -10
- package/lib/plugins/picklists/field-dependencies/index.js.map +1 -1
- package/lib/plugins/picklists/field-dependencies/index.test.js +69 -0
- package/lib/plugins/picklists/field-dependencies/index.test.js.map +1 -0
- package/lib/plugins/picklists/field-dependencies/pages.js +3 -12
- package/lib/plugins/picklists/field-dependencies/pages.js.map +1 -1
- package/lib/plugins/picklists/index.e2e-spec.js +118 -0
- package/lib/plugins/picklists/index.e2e-spec.js.map +1 -0
- package/lib/plugins/picklists/index.js +36 -27
- package/lib/plugins/picklists/index.js.map +1 -1
- package/lib/plugins/picklists/pages.js +7 -28
- package/lib/plugins/picklists/pages.js.map +1 -1
- package/lib/plugins/picklists/standard-value-set.js +1 -1
- package/lib/plugins/picklists/standard-value-set.js.map +1 -1
- package/lib/plugins/record-types/index.e2e-spec.js +99 -0
- package/lib/plugins/record-types/index.e2e-spec.js.map +1 -0
- package/lib/plugins/record-types/index.js +1 -2
- package/lib/plugins/record-types/index.js.map +1 -1
- package/lib/plugins/record-types/pages.js +4 -10
- package/lib/plugins/record-types/pages.js.map +1 -1
- package/lib/plugins/relate-contact-to-multiple-accounts/index.e2e-spec.js +34 -0
- package/lib/plugins/relate-contact-to-multiple-accounts/index.e2e-spec.js.map +1 -0
- package/lib/plugins/relate-contact-to-multiple-accounts/index.js +3 -12
- package/lib/plugins/relate-contact-to-multiple-accounts/index.js.map +1 -1
- package/lib/plugins/reports-and-dashboards/folder-sharing/index.e2e-spec.js +3 -0
- package/lib/plugins/reports-and-dashboards/folder-sharing/index.e2e-spec.js.map +1 -0
- package/lib/plugins/reports-and-dashboards/folder-sharing/index.js +1 -4
- package/lib/plugins/reports-and-dashboards/folder-sharing/index.js.map +1 -1
- package/lib/plugins/reports-and-dashboards/index.e2e-spec.js +3 -0
- package/lib/plugins/reports-and-dashboards/index.e2e-spec.js.map +1 -0
- package/lib/plugins/reports-and-dashboards/index.js +6 -6
- package/lib/plugins/reports-and-dashboards/index.js.map +1 -1
- package/lib/plugins/salesforce-to-salesforce/index.e2e-spec.js +39 -0
- package/lib/plugins/salesforce-to-salesforce/index.e2e-spec.js.map +1 -0
- package/lib/plugins/salesforce-to-salesforce/index.js +1 -4
- package/lib/plugins/salesforce-to-salesforce/index.js.map +1 -1
- package/lib/plugins/security/certificate-and-key-management/index.js +25 -36
- package/lib/plugins/security/certificate-and-key-management/index.js.map +1 -1
- package/lib/plugins/security/certificate-and-key-management/index.test.js +66 -0
- package/lib/plugins/security/certificate-and-key-management/index.test.js.map +1 -0
- package/lib/plugins/security/identity-provider/index.js +13 -24
- package/lib/plugins/security/identity-provider/index.js.map +1 -1
- package/lib/plugins/security/index.e2e-spec.js +86 -0
- package/lib/plugins/security/index.e2e-spec.js.map +1 -0
- package/lib/plugins/security/index.js +24 -15
- package/lib/plugins/security/index.js.map +1 -1
- package/lib/plugins/security/login-access-policies/index.e2e-spec.js +32 -0
- package/lib/plugins/security/login-access-policies/index.e2e-spec.js.map +1 -0
- package/lib/plugins/security/login-access-policies/index.js +2 -5
- package/lib/plugins/security/login-access-policies/index.js.map +1 -1
- package/lib/plugins/security/sharing/index.e2e-spec.js +34 -0
- package/lib/plugins/security/sharing/index.e2e-spec.js.map +1 -0
- package/lib/plugins/security/sharing/index.js +5 -11
- package/lib/plugins/security/sharing/index.js.map +1 -1
- package/lib/plugins/utils.js +38 -41
- package/lib/plugins/utils.js.map +1 -1
- package/oclif.manifest.json +85 -53
- package/package.json +12 -10
- package/lib/browserforce-command.d.ts +0 -15
- package/lib/browserforce.d.ts +0 -26
- package/lib/commands/browserforce/apply.d.ts +0 -6
- package/lib/commands/browserforce/plan.d.ts +0 -6
- package/lib/config-parser.d.ts +0 -16
- package/lib/index.d.ts +0 -1
- package/lib/jsforce-utils.d.ts +0 -5
- package/lib/plugin.d.ts +0 -11
- package/lib/plugins/activity-settings/index.d.ts +0 -9
- package/lib/plugins/communities/index.d.ts +0 -10
- package/lib/plugins/company-information/index.d.ts +0 -8
- package/lib/plugins/customer-portal/available-custom-objects/index.d.ts +0 -14
- package/lib/plugins/customer-portal/enabled/index.d.ts +0 -7
- package/lib/plugins/customer-portal/index.d.ts +0 -15
- package/lib/plugins/customer-portal/portals/index.d.ts +0 -25
- package/lib/plugins/defer-sharing-calculation/index.d.ts +0 -9
- package/lib/plugins/density-settings/index.d.ts +0 -17
- package/lib/plugins/email-deliverability/index.d.ts +0 -9
- package/lib/plugins/high-velocity-sales-settings/index.d.ts +0 -10
- package/lib/plugins/high-velocity-sales-settings/page.d.ts +0 -7
- package/lib/plugins/home-page-layouts/index.d.ts +0 -14
- package/lib/plugins/index.d.ts +0 -18
- package/lib/plugins/lightning-experience-settings/index.d.ts +0 -17
- package/lib/plugins/opportunity-splits/index.d.ts +0 -9
- package/lib/plugins/opportunity-splits/pages/layout-selection.d.ts +0 -8
- package/lib/plugins/opportunity-splits/pages/overview.d.ts +0 -10
- package/lib/plugins/opportunity-splits/pages/setup.d.ts +0 -8
- package/lib/plugins/picklists/field-dependencies/index.d.ts +0 -11
- package/lib/plugins/picklists/field-dependencies/pages.d.ts +0 -14
- package/lib/plugins/picklists/index.d.ts +0 -23
- package/lib/plugins/picklists/pages.d.ts +0 -40
- package/lib/plugins/picklists/standard-value-set.d.ts +0 -1
- package/lib/plugins/record-types/index.d.ts +0 -13
- package/lib/plugins/record-types/pages.d.ts +0 -15
- package/lib/plugins/relate-contact-to-multiple-accounts/index.d.ts +0 -9
- package/lib/plugins/reports-and-dashboards/folder-sharing/index.d.ts +0 -8
- package/lib/plugins/reports-and-dashboards/index.d.ts +0 -11
- package/lib/plugins/salesforce-to-salesforce/index.d.ts +0 -9
- package/lib/plugins/security/certificate-and-key-management/index.d.ts +0 -23
- package/lib/plugins/security/identity-provider/index.d.ts +0 -10
- package/lib/plugins/security/index.d.ts +0 -17
- package/lib/plugins/security/login-access-policies/index.d.ts +0 -8
- package/lib/plugins/security/sharing/index.d.ts +0 -8
- package/lib/plugins/utils.d.ts +0 -4
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
const assert_1 = __importDefault(require("assert"));
|
|
30
|
+
const child = __importStar(require("child_process"));
|
|
31
|
+
const path = __importStar(require("path"));
|
|
32
|
+
const available_custom_objects_1 = require("./available-custom-objects");
|
|
33
|
+
const enabled_1 = require("./enabled");
|
|
34
|
+
const portals_1 = require("./portals");
|
|
35
|
+
describe('CustomerPortal', () => {
|
|
36
|
+
describe(enabled_1.CustomerPortalEnable.name, function () {
|
|
37
|
+
let plugin;
|
|
38
|
+
before(() => {
|
|
39
|
+
plugin = new enabled_1.CustomerPortalEnable(global.bf);
|
|
40
|
+
});
|
|
41
|
+
it('should enable', async () => {
|
|
42
|
+
await plugin.run(true);
|
|
43
|
+
});
|
|
44
|
+
it('should be enabled', async () => {
|
|
45
|
+
const res = await plugin.retrieve();
|
|
46
|
+
assert_1.default.deepStrictEqual(res, true);
|
|
47
|
+
});
|
|
48
|
+
it('should fail to disable', async () => {
|
|
49
|
+
let err;
|
|
50
|
+
try {
|
|
51
|
+
await plugin.run(false);
|
|
52
|
+
}
|
|
53
|
+
catch (e) {
|
|
54
|
+
err = e;
|
|
55
|
+
}
|
|
56
|
+
assert_1.default.throws(() => {
|
|
57
|
+
throw err;
|
|
58
|
+
}, /cannot be disabled/);
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
describe(portals_1.CustomerPortalSetup.name, function () {
|
|
62
|
+
let plugin;
|
|
63
|
+
before(() => {
|
|
64
|
+
plugin = new portals_1.CustomerPortalSetup(global.bf);
|
|
65
|
+
});
|
|
66
|
+
const configSetPortalAdmin = [
|
|
67
|
+
{
|
|
68
|
+
name: 'Customer Portal',
|
|
69
|
+
adminUser: 'User User',
|
|
70
|
+
isSelfRegistrationActivated: true
|
|
71
|
+
}
|
|
72
|
+
];
|
|
73
|
+
const configSetupPortal = [
|
|
74
|
+
{
|
|
75
|
+
name: 'Foo Portal',
|
|
76
|
+
oldName: 'Customer Portal',
|
|
77
|
+
description: 'Foo Portal',
|
|
78
|
+
adminUser: 'User User',
|
|
79
|
+
isSelfRegistrationActivated: true,
|
|
80
|
+
selfRegUserDefaultLicense: 'Customer Portal Manager Custom',
|
|
81
|
+
selfRegUserDefaultRole: 'User',
|
|
82
|
+
selfRegUserDefaultProfile: 'Customer Portal Manager Custom',
|
|
83
|
+
portalProfileMemberships: [
|
|
84
|
+
{
|
|
85
|
+
name: 'Customer Portal Manager Standard',
|
|
86
|
+
active: false
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
name: 'Dummy',
|
|
90
|
+
active: true
|
|
91
|
+
}
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
];
|
|
95
|
+
const configRevertPortal = [
|
|
96
|
+
{
|
|
97
|
+
name: 'Customer Portal',
|
|
98
|
+
oldName: 'Foo Portal',
|
|
99
|
+
description: 'Customer Portal',
|
|
100
|
+
isSelfRegistrationActivated: false
|
|
101
|
+
}
|
|
102
|
+
];
|
|
103
|
+
const dir = path.resolve(path.join(__dirname, 'portals'));
|
|
104
|
+
it('should fail to set portal admin user without permset', async () => {
|
|
105
|
+
let err;
|
|
106
|
+
try {
|
|
107
|
+
await plugin.run(configSetPortalAdmin);
|
|
108
|
+
}
|
|
109
|
+
catch (e) {
|
|
110
|
+
err = e;
|
|
111
|
+
}
|
|
112
|
+
assert_1.default.throws(() => {
|
|
113
|
+
throw err;
|
|
114
|
+
}, /This user has insufficient permissions to be a portal administrator/);
|
|
115
|
+
});
|
|
116
|
+
it('should set up user for portal', async () => {
|
|
117
|
+
const sourceDeployCmd = child.spawnSync('sf', [
|
|
118
|
+
'project',
|
|
119
|
+
'deploy',
|
|
120
|
+
'start',
|
|
121
|
+
'-d',
|
|
122
|
+
path.join(dir, 'sfdx-source'),
|
|
123
|
+
'--json'
|
|
124
|
+
]);
|
|
125
|
+
assert_1.default.deepStrictEqual(sourceDeployCmd.status, 0, sourceDeployCmd.output.toString());
|
|
126
|
+
const permSetAssignCmd = child.spawnSync('sf', ['org', 'assign', 'permset', '-n', 'Customer_Portal_Admin']);
|
|
127
|
+
assert_1.default.deepStrictEqual(permSetAssignCmd.status, 0, permSetAssignCmd.output.toString());
|
|
128
|
+
});
|
|
129
|
+
it('should set up portal', async () => {
|
|
130
|
+
await plugin.run(configSetupPortal);
|
|
131
|
+
});
|
|
132
|
+
it('portal should be set up', async () => {
|
|
133
|
+
const res = await plugin.run(configSetupPortal);
|
|
134
|
+
assert_1.default.deepStrictEqual(res, { message: 'no action necessary' });
|
|
135
|
+
});
|
|
136
|
+
it('should revert back', async () => {
|
|
137
|
+
await plugin.run(configRevertPortal);
|
|
138
|
+
});
|
|
139
|
+
it('should be reverted back', async () => {
|
|
140
|
+
const res = await plugin.run(configRevertPortal);
|
|
141
|
+
assert_1.default.deepStrictEqual(res, { message: 'no action necessary' });
|
|
142
|
+
});
|
|
143
|
+
it('should cleanup', async () => {
|
|
144
|
+
const conn = global.bf.org.getConnection();
|
|
145
|
+
await conn.metadata.delete('Profile', ['Dummy']);
|
|
146
|
+
const permSetUnassignCmd = child.spawnSync('sf', [
|
|
147
|
+
'data',
|
|
148
|
+
'delete',
|
|
149
|
+
'record',
|
|
150
|
+
'-s',
|
|
151
|
+
'PermissionSetAssignment',
|
|
152
|
+
'-w',
|
|
153
|
+
'PermissionSet.Name=Customer_Portal_Admin'
|
|
154
|
+
]);
|
|
155
|
+
assert_1.default.deepStrictEqual(permSetUnassignCmd.status, 0, permSetUnassignCmd.output.toString());
|
|
156
|
+
await conn.metadata.delete('PermissionSet', ['Customer_Portal_Admin']);
|
|
157
|
+
});
|
|
158
|
+
});
|
|
159
|
+
describe(available_custom_objects_1.CustomerPortalAvailableCustomObjects.name, function () {
|
|
160
|
+
let plugin;
|
|
161
|
+
before(() => {
|
|
162
|
+
plugin = new available_custom_objects_1.CustomerPortalAvailableCustomObjects(global.bf);
|
|
163
|
+
});
|
|
164
|
+
const configAvailableCustomObjects = [
|
|
165
|
+
{
|
|
166
|
+
name: 'Dummy',
|
|
167
|
+
available: true
|
|
168
|
+
}
|
|
169
|
+
];
|
|
170
|
+
const configNonAvailableCustomObjects = [
|
|
171
|
+
{
|
|
172
|
+
name: 'DummyXYZ',
|
|
173
|
+
available: true
|
|
174
|
+
}
|
|
175
|
+
];
|
|
176
|
+
const configUnavailableCustomObjects = [
|
|
177
|
+
{
|
|
178
|
+
name: 'Dummy',
|
|
179
|
+
available: false
|
|
180
|
+
}
|
|
181
|
+
];
|
|
182
|
+
const dir = path.resolve(path.join(__dirname, 'available-custom-objects'));
|
|
183
|
+
it('should fail to make non-existent custom objects available for customer portal', async () => {
|
|
184
|
+
let err;
|
|
185
|
+
try {
|
|
186
|
+
await plugin.run(configNonAvailableCustomObjects);
|
|
187
|
+
}
|
|
188
|
+
catch (e) {
|
|
189
|
+
err = e;
|
|
190
|
+
}
|
|
191
|
+
assert_1.default.throws(() => {
|
|
192
|
+
throw err;
|
|
193
|
+
}, /Could not find CustomObject/);
|
|
194
|
+
});
|
|
195
|
+
it('should deploy custom object', () => {
|
|
196
|
+
const sourceDeployCmd = child.spawnSync('sf', [
|
|
197
|
+
'project',
|
|
198
|
+
'deploy',
|
|
199
|
+
'start',
|
|
200
|
+
'-d',
|
|
201
|
+
path.join(dir, 'sfdx-source'),
|
|
202
|
+
'--json'
|
|
203
|
+
]);
|
|
204
|
+
assert_1.default.deepStrictEqual(sourceDeployCmd.status, 0, sourceDeployCmd.output.toString());
|
|
205
|
+
});
|
|
206
|
+
it('should make custom objects available for customer portal', async () => {
|
|
207
|
+
await plugin.run(configAvailableCustomObjects);
|
|
208
|
+
});
|
|
209
|
+
it('should have applied checkbox available for customer portal', async () => {
|
|
210
|
+
const res = await plugin.run(configAvailableCustomObjects);
|
|
211
|
+
assert_1.default.deepStrictEqual(res, { message: 'no action necessary' });
|
|
212
|
+
});
|
|
213
|
+
it('should make custom objects unavailable for customer portal', async () => {
|
|
214
|
+
await plugin.run(configUnavailableCustomObjects);
|
|
215
|
+
});
|
|
216
|
+
it('should remove the CustomObject', async () => {
|
|
217
|
+
const conn = global.bf.org.getConnection();
|
|
218
|
+
await conn.metadata.delete('CustomObject', ['Dummy__c']);
|
|
219
|
+
});
|
|
220
|
+
});
|
|
221
|
+
});
|
|
222
|
+
//# sourceMappingURL=index.e2e-spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.e2e-spec.js","sourceRoot":"","sources":["../../../src/plugins/customer-portal/index.e2e-spec.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAA4B;AAC5B,qDAAuC;AACvC,2CAA6B;AAC7B,yEAAkF;AAClF,uCAAiD;AACjD,uCAAgD;AAEhD,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,QAAQ,CAAC,8BAAoB,CAAC,IAAI,EAAE;QAClC,IAAI,MAAM,CAAC;QACX,MAAM,CAAC,GAAG,EAAE;YACV,MAAM,GAAG,IAAI,8BAAoB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAC/C,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,eAAe,EAAE,KAAK,IAAI,EAAE;YAC7B,MAAM,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACzB,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,mBAAmB,EAAE,KAAK,IAAI,EAAE;YACjC,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,QAAQ,EAAE,CAAC;YACpC,gBAAM,CAAC,eAAe,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACpC,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,wBAAwB,EAAE,KAAK,IAAI,EAAE;YACtC,IAAI,GA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AAE,eAAe,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;QACvF,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,0DAA0D,EAAE,KAAK,IAAI,EAAE;YACxE,MAAM,MAAM,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;QACjD,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,4DAA4D,EAAE,KAAK,IAAI,EAAE;YAC1E,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;YAC3D,gBAAM,CAAC,eAAe,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,qBAAqB,EAAE,CAAC,CAAC;QAClE,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,4DAA4D,EAAE,KAAK,IAAI,EAAE;YAC1E,MAAM,MAAM,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC;QACnD,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,gCAAgC,EAAE,KAAK,IAAI,EAAE;YAC9C,MAAM,IAAI,GAAG,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC;YAC3C,MAAM,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;QAC3D,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CustomerPortal = void 0;
|
|
4
4
|
const plugin_1 = require("../../plugin");
|
|
5
|
-
const utils_1 = require("../utils");
|
|
6
5
|
const available_custom_objects_1 = require("./available-custom-objects");
|
|
7
6
|
const enabled_1 = require("./enabled");
|
|
8
7
|
const portals_1 = require("./portals");
|
|
@@ -14,37 +13,42 @@ class CustomerPortal extends plugin_1.BrowserforcePlugin {
|
|
|
14
13
|
portals: [],
|
|
15
14
|
availableCustomObjects: []
|
|
16
15
|
};
|
|
17
|
-
response.enabled = await pluginEnable.retrieve(
|
|
16
|
+
response.enabled = await pluginEnable.retrieve();
|
|
18
17
|
if (response.enabled) {
|
|
19
18
|
if (definition.portals) {
|
|
20
19
|
const pluginSetup = new portals_1.CustomerPortalSetup(this.browserforce);
|
|
21
|
-
response.portals = await pluginSetup.retrieve(
|
|
20
|
+
response.portals = await pluginSetup.retrieve();
|
|
22
21
|
}
|
|
23
22
|
if (definition.availableCustomObjects) {
|
|
24
23
|
const pluginAvailableCustomObjects = new available_custom_objects_1.CustomerPortalAvailableCustomObjects(this.browserforce);
|
|
25
|
-
response.availableCustomObjects =
|
|
26
|
-
await pluginAvailableCustomObjects.retrieve(definition.availableCustomObjects);
|
|
24
|
+
response.availableCustomObjects = await pluginAvailableCustomObjects.retrieve(definition.availableCustomObjects);
|
|
27
25
|
}
|
|
28
26
|
}
|
|
29
27
|
return response;
|
|
30
28
|
}
|
|
31
29
|
diff(state, definition) {
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
const
|
|
30
|
+
const enabled = new enabled_1.CustomerPortalEnable(this.browserforce).diff(state.enabled, definition.enabled);
|
|
31
|
+
const portals = new portals_1.CustomerPortalSetup(this.browserforce).diff(state.portals, definition.portals);
|
|
32
|
+
const availableCustomObjects = new available_custom_objects_1.CustomerPortalAvailableCustomObjects(this.browserforce).diff(state.availableCustomObjects, definition.availableCustomObjects);
|
|
35
33
|
const response = {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
...(enabled !== undefined && {
|
|
35
|
+
enabled
|
|
36
|
+
}),
|
|
37
|
+
...(portals !== undefined && {
|
|
38
|
+
portals
|
|
39
|
+
}),
|
|
40
|
+
...(availableCustomObjects !== undefined && {
|
|
41
|
+
availableCustomObjects
|
|
42
|
+
})
|
|
39
43
|
};
|
|
40
|
-
return
|
|
44
|
+
return Object.keys(response).length ? response : undefined;
|
|
41
45
|
}
|
|
42
46
|
async apply(config) {
|
|
43
47
|
if (config.enabled !== undefined) {
|
|
44
48
|
const pluginEnable = new enabled_1.CustomerPortalEnable(this.browserforce);
|
|
45
49
|
await pluginEnable.apply(config.enabled);
|
|
46
50
|
}
|
|
47
|
-
if (config.portals
|
|
51
|
+
if (config.portals?.length) {
|
|
48
52
|
const pluginSetup = new portals_1.CustomerPortalSetup(this.browserforce);
|
|
49
53
|
await pluginSetup.apply(config.portals);
|
|
50
54
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/plugins/customer-portal/index.ts"],"names":[],"mappings":";;;AAAA,yCAAkD;AAClD,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/plugins/customer-portal/index.ts"],"names":[],"mappings":";;;AAAA,yCAAkD;AAClD,yEAGoC;AACpC,uCAAuF;AACvF,uCAAqF;AAQrF,MAAa,cAAe,SAAQ,2BAAkB;IAC7C,KAAK,CAAC,QAAQ,CAAC,UAAkB;QACtC,MAAM,YAAY,GAAG,IAAI,8BAAoB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACjE,MAAM,QAAQ,GAAW;YACvB,OAAO,EAAE,KAAK;YACd,OAAO,EAAE,EAAE;YACX,sBAAsB,EAAE,EAAE;SAC3B,CAAC;QACF,QAAQ,CAAC,OAAO,GAAG,MAAM,YAAY,CAAC,QAAQ,EAAE,CAAC;QACjD,IAAI,QAAQ,CAAC,OAAO,EAAE;YACpB,IAAI,UAAU,CAAC,OAAO,EAAE;gBACtB,MAAM,WAAW,GAAG,IAAI,6BAAmB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;gBAC/D,QAAQ,CAAC,OAAO,GAAG,MAAM,WAAW,CAAC,QAAQ,EAAE,CAAC;aACjD;YACD,IAAI,UAAU,CAAC,sBAAsB,EAAE;gBACrC,MAAM,4BAA4B,GAAG,IAAI,+DAAoC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;gBACjG,QAAQ,CAA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AAE,MAAM,EAAE;YAC1B,MAAM,WAAW,GAAG,IAAI,6BAAmB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;YAC/D,MAAM,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;SACzC;QACD,IAAI,MAAM,CAAC,sBAAsB,EAAE;YACjC,MAAM,4BAA4B,GAAG,IAAI,+DAAoC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;YACjG,MAAM,4BAA4B,CAAC,KAAK,CAAC,MAAM,CAAC,sBAAsB,CAAC,CAAC;SACzE;IACH,CAAC;CACF;AA7DD,wCA6DC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const assert_1 = __importDefault(require("assert"));
|
|
7
|
+
const _1 = require(".");
|
|
8
|
+
const tests = [
|
|
9
|
+
{
|
|
10
|
+
description: 'should ignore a non-existent target flag',
|
|
11
|
+
source: {
|
|
12
|
+
enabled: true
|
|
13
|
+
},
|
|
14
|
+
target: {},
|
|
15
|
+
expected: undefined
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
description: 'should ignore a matching target flag',
|
|
19
|
+
source: {
|
|
20
|
+
enabled: true
|
|
21
|
+
},
|
|
22
|
+
target: {
|
|
23
|
+
enabled: true
|
|
24
|
+
},
|
|
25
|
+
expected: undefined
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
description: 'should detect a changed flag',
|
|
29
|
+
source: {
|
|
30
|
+
enabled: false
|
|
31
|
+
},
|
|
32
|
+
target: {
|
|
33
|
+
enabled: true
|
|
34
|
+
},
|
|
35
|
+
expected: {
|
|
36
|
+
enabled: true
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
description: 'should only return necessary fields',
|
|
41
|
+
source: {
|
|
42
|
+
enabled: true,
|
|
43
|
+
portals: [
|
|
44
|
+
{
|
|
45
|
+
name: 'Customer Portal',
|
|
46
|
+
description: 'Customer Portal',
|
|
47
|
+
adminUser: 'User User',
|
|
48
|
+
portalProfileMemberships: [
|
|
49
|
+
{
|
|
50
|
+
name: 'Customer Portal Manager Standard',
|
|
51
|
+
active: true,
|
|
52
|
+
_id: 'a1'
|
|
53
|
+
}
|
|
54
|
+
],
|
|
55
|
+
_id: 'p1'
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
target: {
|
|
60
|
+
portals: [
|
|
61
|
+
{
|
|
62
|
+
name: 'Customer Portal',
|
|
63
|
+
description: 'new description'
|
|
64
|
+
}
|
|
65
|
+
]
|
|
66
|
+
},
|
|
67
|
+
expected: {
|
|
68
|
+
portals: [
|
|
69
|
+
{
|
|
70
|
+
name: 'Customer Portal',
|
|
71
|
+
description: 'new description',
|
|
72
|
+
_id: 'p1'
|
|
73
|
+
}
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
];
|
|
78
|
+
describe('CustomerPortal', () => {
|
|
79
|
+
describe('diff()', () => {
|
|
80
|
+
const p = new _1.CustomerPortal(global.bf);
|
|
81
|
+
for (const t of tests) {
|
|
82
|
+
it(t.description, () => {
|
|
83
|
+
const actual = p.diff(t.source, t.target);
|
|
84
|
+
assert_1.default.deepStrictEqual(actual, t.expected);
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
//# sourceMappingURL=index.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.test.js","sourceRoot":"","sources":["../../../src/plugins/customer-portal/index.test.ts"],"names":[],"mappings":";;;;;AAAA,oDAA4B;AAC5B,wBAAmC;AAEnC,MAAM,KAAK,GAAG;IACZ;QACE,WAAW,EAAE,0CAA0C;QACvD,MAAM,E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AC,CAAC,WAAW,EAAE,GAAG,EAAE;gBACrB,MAAM,MAAM,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC;gBAC1C,gBAAM,CAAC,eAAe,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC;YAC7C,CAAC,CAAC,CAAC;SACJ;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -24,7 +24,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.CustomerPortalSetup = void 0;
|
|
27
|
-
const jsonMergePatch = __importStar(require("json-merge-patch"));
|
|
28
27
|
const queryString = __importStar(require("querystring"));
|
|
29
28
|
const plugin_1 = require("../../../plugin");
|
|
30
29
|
const utils_1 = require("../../utils");
|
|
@@ -46,7 +45,7 @@ const SELECTORS = {
|
|
|
46
45
|
PORTAL_PROFILE_MEMBERSHIP_CHECKBOXES: 'td.dataCell input'
|
|
47
46
|
};
|
|
48
47
|
class CustomerPortalSetup extends plugin_1.BrowserforcePlugin {
|
|
49
|
-
async retrieve(
|
|
48
|
+
async retrieve() {
|
|
50
49
|
const page = await this.browserforce.openPage(PATHS.LIST_VIEW);
|
|
51
50
|
await page.waitForXPath(SELECTORS.LIST_VIEW_PORTAL_LINKS_XPATH);
|
|
52
51
|
const customerPortalLinks = await page.$x(SELECTORS.LIST_VIEW_PORTAL_LINKS_XPATH);
|
|
@@ -73,10 +72,10 @@ class CustomerPortalSetup extends plugin_1.BrowserforcePlugin {
|
|
|
73
72
|
const portalProfilePage = await this.browserforce.openPage(`${PATHS.PORTAL_PROFILE_MEMBERSHIP}?portalId=${portal._id}&setupid=CustomerSuccessPortalSettings`);
|
|
74
73
|
await portalProfilePage.waitForSelector(SELECTORS.PORTAL_ID);
|
|
75
74
|
const profiles = await portalProfilePage.$$eval(SELECTORS.PORTAL_PROFILE_MEMBERSHIP_PROFILES, (ths) => {
|
|
76
|
-
return ths.map(th => th.innerText.trim());
|
|
75
|
+
return ths.map((th) => th.innerText.trim());
|
|
77
76
|
});
|
|
78
77
|
const checkboxes = await portalProfilePage.$$eval(SELECTORS.PORTAL_PROFILE_MEMBERSHIP_CHECKBOXES, (inputs) => {
|
|
79
|
-
return inputs.map(input => {
|
|
78
|
+
return inputs.map((input) => {
|
|
80
79
|
return {
|
|
81
80
|
active: input.checked,
|
|
82
81
|
_id: input.id
|
|
@@ -105,31 +104,28 @@ class CustomerPortalSetup extends plugin_1.BrowserforcePlugin {
|
|
|
105
104
|
let sourcePortal = source.find((p) => p.name === portal.name);
|
|
106
105
|
if (portal.oldName && !sourcePortal) {
|
|
107
106
|
// fallback to old name of portal
|
|
108
|
-
sourcePortal = source.find(p => p.name === portal.oldName);
|
|
107
|
+
sourcePortal = source.find((p) => p.name === portal.oldName);
|
|
109
108
|
}
|
|
110
109
|
if (!sourcePortal) {
|
|
111
110
|
throw new Error(`Portal with name '${portal.name} (oldName: ${portal.oldName})' not found. Setting up new Portals is not yet supported.`);
|
|
112
111
|
}
|
|
113
112
|
delete portal.oldName;
|
|
114
113
|
if (sourcePortal) {
|
|
115
|
-
//
|
|
114
|
+
// copy id of existing portal to new portal to be retained and used
|
|
116
115
|
portal._id = sourcePortal._id;
|
|
117
|
-
delete sourcePortal._id;
|
|
118
116
|
}
|
|
119
|
-
if (sourcePortal.portalProfileMemberships &&
|
|
120
|
-
portal.portalProfileMemberships) {
|
|
117
|
+
if (sourcePortal.portalProfileMemberships && portal.portalProfileMemberships) {
|
|
121
118
|
const membershipResponse = [];
|
|
122
119
|
for (const member of portal.portalProfileMemberships) {
|
|
123
|
-
//
|
|
124
|
-
const sourceMember = sourcePortal.portalProfileMemberships.find(m => m.name === member.name);
|
|
120
|
+
// copy id of existing member to new member to be retained and used
|
|
121
|
+
const sourceMember = sourcePortal.portalProfileMemberships.find((m) => m.name === member.name);
|
|
125
122
|
if (sourceMember) {
|
|
126
123
|
member._id = sourceMember._id;
|
|
127
|
-
delete sourceMember._id;
|
|
128
124
|
}
|
|
129
125
|
else {
|
|
130
126
|
throw new Error(`Could not find portal profile membership for '${member.name}'`);
|
|
131
127
|
}
|
|
132
|
-
const membershipDiff = (0, utils_1.semanticallyCleanObject)(
|
|
128
|
+
const membershipDiff = (0, utils_1.semanticallyCleanObject)(super.diff(sourceMember, member), '_id');
|
|
133
129
|
if (membershipDiff) {
|
|
134
130
|
membershipResponse.push(membershipDiff);
|
|
135
131
|
}
|
|
@@ -140,13 +136,13 @@ class CustomerPortalSetup extends plugin_1.BrowserforcePlugin {
|
|
|
140
136
|
portal.portalProfileMemberships = membershipResponse;
|
|
141
137
|
}
|
|
142
138
|
}
|
|
143
|
-
const diff = (0, utils_1.semanticallyCleanObject)(
|
|
144
|
-
if (diff) {
|
|
139
|
+
const diff = (0, utils_1.semanticallyCleanObject)(super.diff(sourcePortal, portal), '_id');
|
|
140
|
+
if (diff !== undefined) {
|
|
145
141
|
response.push(diff);
|
|
146
142
|
}
|
|
147
143
|
}
|
|
148
144
|
}
|
|
149
|
-
return response;
|
|
145
|
+
return response.length ? response : undefined;
|
|
150
146
|
}
|
|
151
147
|
async apply(config) {
|
|
152
148
|
for (const portal of config) {
|
|
@@ -163,7 +159,9 @@ class CustomerPortalSetup extends plugin_1.BrowserforcePlugin {
|
|
|
163
159
|
urlAttributes[SELECTORS.PORTAL_ADMIN_ID] = portal.adminUser;
|
|
164
160
|
}
|
|
165
161
|
if (portal.isSelfRegistrationActivated !== undefined) {
|
|
166
|
-
urlAttributes[SELECTORS.PORTAL_IS_SELF_REGISTRATION_ACTIVATED_ID] = portal.isSelfRegistrationActivated
|
|
162
|
+
urlAttributes[SELECTORS.PORTAL_IS_SELF_REGISTRATION_ACTIVATED_ID] = portal.isSelfRegistrationActivated
|
|
163
|
+
? 1
|
|
164
|
+
: 0;
|
|
167
165
|
}
|
|
168
166
|
const page = await this.browserforce.openPage(`${portal._id}/e?${queryString.stringify(urlAttributes)}`);
|
|
169
167
|
await page.waitForSelector(SELECTORS.PORTAL_DESCRIPTION);
|
|
@@ -180,10 +178,7 @@ class CustomerPortalSetup extends plugin_1.BrowserforcePlugin {
|
|
|
180
178
|
await page.select(`#${SELECTORS.PORTAL_SELF_REG_USER_DEFAULT_PROFILE_ID}`, profileValue);
|
|
181
179
|
}
|
|
182
180
|
await page.waitForSelector(SELECTORS.SAVE_BUTTON);
|
|
183
|
-
await Promise.all([
|
|
184
|
-
page.waitForNavigation(),
|
|
185
|
-
page.click(SELECTORS.SAVE_BUTTON)
|
|
186
|
-
]);
|
|
181
|
+
await Promise.all([page.waitForNavigation(), page.click(SELECTORS.SAVE_BUTTON)]);
|
|
187
182
|
if ((await page.url()).includes(portal._id)) {
|
|
188
183
|
// error handling
|
|
189
184
|
await page.waitForSelector(SELECTORS.PORTAL_DESCRIPTION);
|
|
@@ -198,10 +193,7 @@ class CustomerPortalSetup extends plugin_1.BrowserforcePlugin {
|
|
|
198
193
|
}
|
|
199
194
|
const portalProfilePage = await this.browserforce.openPage(`${PATHS.PORTAL_PROFILE_MEMBERSHIP}?portalId=${portal._id}&setupid=CustomerSuccessPortalSettings&${queryString.stringify(membershipUrlAttributes)}`);
|
|
200
195
|
await portalProfilePage.waitForSelector(SELECTORS.SAVE_BUTTON);
|
|
201
|
-
await Promise.all([
|
|
202
|
-
portalProfilePage.waitForNavigation(),
|
|
203
|
-
portalProfilePage.click(SELECTORS.SAVE_BUTTON)
|
|
204
|
-
]);
|
|
196
|
+
await Promise.all([portalProfilePage.waitForNavigation(), portalProfilePage.click(SELECTORS.SAVE_BUTTON)]);
|
|
205
197
|
await portalProfilePage.close();
|
|
206
198
|
}
|
|
207
199
|
await page.close();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/plugins/customer-portal/portals/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;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