sfdx-browserforce-plugin 5.0.2 → 5.1.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/package.json +1 -4
- package/lib/browserforce-command.d.ts +0 -15
- package/lib/browserforce-command.js +0 -61
- package/lib/browserforce-command.js.map +0 -1
- package/lib/browserforce.d.ts +0 -25
- package/lib/browserforce.js +0 -169
- package/lib/browserforce.js.map +0 -1
- package/lib/commands/browserforce/apply.d.ts +0 -10
- package/lib/commands/browserforce/apply.js +0 -54
- package/lib/commands/browserforce/apply.js.map +0 -1
- package/lib/commands/browserforce/plan.d.ts +0 -10
- package/lib/commands/browserforce/plan.js +0 -56
- package/lib/commands/browserforce/plan.js.map +0 -1
- package/lib/config-parser.d.ts +0 -16
- package/lib/config-parser.js +0 -24
- package/lib/config-parser.js.map +0 -1
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -2
- package/lib/index.js.map +0 -1
- package/lib/jsforce-utils.d.ts +0 -5
- package/lib/jsforce-utils.js +0 -14
- package/lib/jsforce-utils.js.map +0 -1
- package/lib/pages/login.d.ts +0 -8
- package/lib/pages/login.js +0 -39
- package/lib/pages/login.js.map +0 -1
- package/lib/plugin.d.ts +0 -17
- package/lib/plugin.js +0 -30
- package/lib/plugin.js.map +0 -1
- package/lib/plugins/activity-settings/index.d.ts +0 -9
- package/lib/plugins/activity-settings/index.e2e-spec.d.ts +0 -1
- package/lib/plugins/activity-settings/index.e2e-spec.js +0 -36
- package/lib/plugins/activity-settings/index.e2e-spec.js.map +0 -1
- package/lib/plugins/activity-settings/index.js +0 -31
- package/lib/plugins/activity-settings/index.js.map +0 -1
- package/lib/plugins/company-information/index.d.ts +0 -8
- package/lib/plugins/company-information/index.e2e-spec.d.ts +0 -1
- package/lib/plugins/company-information/index.e2e-spec.js +0 -37
- package/lib/plugins/company-information/index.e2e-spec.js.map +0 -1
- package/lib/plugins/company-information/index.js +0 -50
- package/lib/plugins/company-information/index.js.map +0 -1
- package/lib/plugins/customer-portal/available-custom-objects/index.d.ts +0 -14
- package/lib/plugins/customer-portal/available-custom-objects/index.js +0 -114
- package/lib/plugins/customer-portal/available-custom-objects/index.js.map +0 -1
- package/lib/plugins/customer-portal/available-custom-objects/index.test.d.ts +0 -1
- package/lib/plugins/customer-portal/available-custom-objects/index.test.js +0 -39
- package/lib/plugins/customer-portal/available-custom-objects/index.test.js.map +0 -1
- package/lib/plugins/customer-portal/enabled/index.d.ts +0 -6
- package/lib/plugins/customer-portal/enabled/index.js +0 -27
- package/lib/plugins/customer-portal/enabled/index.js.map +0 -1
- package/lib/plugins/customer-portal/enabled/index.test.d.ts +0 -1
- package/lib/plugins/customer-portal/enabled/index.test.js +0 -34
- package/lib/plugins/customer-portal/enabled/index.test.js.map +0 -1
- package/lib/plugins/customer-portal/index.d.ts +0 -15
- package/lib/plugins/customer-portal/index.e2e-spec.d.ts +0 -1
- package/lib/plugins/customer-portal/index.e2e-spec.js +0 -202
- package/lib/plugins/customer-portal/index.e2e-spec.js.map +0 -1
- package/lib/plugins/customer-portal/index.js +0 -59
- package/lib/plugins/customer-portal/index.js.map +0 -1
- package/lib/plugins/customer-portal/index.test.d.ts +0 -1
- package/lib/plugins/customer-portal/index.test.js +0 -84
- package/lib/plugins/customer-portal/index.test.js.map +0 -1
- package/lib/plugins/customer-portal/portals/index.d.ts +0 -25
- package/lib/plugins/customer-portal/portals/index.js +0 -180
- package/lib/plugins/customer-portal/portals/index.js.map +0 -1
- package/lib/plugins/customer-portal/portals/index.test.d.ts +0 -1
- package/lib/plugins/customer-portal/portals/index.test.js +0 -140
- package/lib/plugins/customer-portal/portals/index.test.js.map +0 -1
- package/lib/plugins/density-settings/index.d.ts +0 -17
- package/lib/plugins/density-settings/index.e2e-spec.d.ts +0 -1
- package/lib/plugins/density-settings/index.e2e-spec.js +0 -39
- package/lib/plugins/density-settings/index.e2e-spec.js.map +0 -1
- package/lib/plugins/density-settings/index.js +0 -46
- package/lib/plugins/density-settings/index.js.map +0 -1
- package/lib/plugins/deprecated.d.ts +0 -4
- package/lib/plugins/deprecated.js +0 -28
- package/lib/plugins/deprecated.js.map +0 -1
- package/lib/plugins/email-deliverability/index.d.ts +0 -9
- package/lib/plugins/email-deliverability/index.e2e-spec.d.ts +0 -1
- package/lib/plugins/email-deliverability/index.e2e-spec.js +0 -55
- package/lib/plugins/email-deliverability/index.e2e-spec.js.map +0 -1
- package/lib/plugins/email-deliverability/index.js +0 -39
- package/lib/plugins/email-deliverability/index.js.map +0 -1
- package/lib/plugins/high-velocity-sales-settings/index.d.ts +0 -10
- package/lib/plugins/high-velocity-sales-settings/index.e2e-spec.d.ts +0 -1
- package/lib/plugins/high-velocity-sales-settings/index.e2e-spec.js +0 -29
- package/lib/plugins/high-velocity-sales-settings/index.e2e-spec.js.map +0 -1
- package/lib/plugins/high-velocity-sales-settings/index.js +0 -42
- package/lib/plugins/high-velocity-sales-settings/index.js.map +0 -1
- package/lib/plugins/high-velocity-sales-settings/page.d.ts +0 -7
- package/lib/plugins/high-velocity-sales-settings/page.js +0 -29
- package/lib/plugins/high-velocity-sales-settings/page.js.map +0 -1
- package/lib/plugins/history-tracking/index.d.ts +0 -17
- package/lib/plugins/history-tracking/index.e2e-spec.d.ts +0 -1
- package/lib/plugins/history-tracking/index.e2e-spec.js +0 -106
- package/lib/plugins/history-tracking/index.e2e-spec.js.map +0 -1
- package/lib/plugins/history-tracking/index.js +0 -169
- package/lib/plugins/history-tracking/index.js.map +0 -1
- package/lib/plugins/home-page-layouts/index.d.ts +0 -14
- package/lib/plugins/home-page-layouts/index.e2e-spec.d.ts +0 -1
- package/lib/plugins/home-page-layouts/index.e2e-spec.js +0 -47
- package/lib/plugins/home-page-layouts/index.e2e-spec.js.map +0 -1
- package/lib/plugins/home-page-layouts/index.js +0 -90
- package/lib/plugins/home-page-layouts/index.js.map +0 -1
- package/lib/plugins/home-page-layouts/index.test.d.ts +0 -1
- package/lib/plugins/home-page-layouts/index.test.js +0 -104
- package/lib/plugins/home-page-layouts/index.test.js.map +0 -1
- package/lib/plugins/index.d.ts +0 -23
- package/lib/plugins/index.js +0 -24
- package/lib/plugins/index.js.map +0 -1
- package/lib/plugins/lightning-experience-settings/index.d.ts +0 -18
- package/lib/plugins/lightning-experience-settings/index.e2e-spec.d.ts +0 -1
- package/lib/plugins/lightning-experience-settings/index.e2e-spec.js +0 -40
- package/lib/plugins/lightning-experience-settings/index.e2e-spec.js.map +0 -1
- package/lib/plugins/lightning-experience-settings/index.js +0 -97
- package/lib/plugins/lightning-experience-settings/index.js.map +0 -1
- package/lib/plugins/linkedin-sales-navigator-settings/index.d.ts +0 -8
- package/lib/plugins/linkedin-sales-navigator-settings/index.e2e-spec.d.ts +0 -1
- package/lib/plugins/linkedin-sales-navigator-settings/index.e2e-spec.js +0 -29
- package/lib/plugins/linkedin-sales-navigator-settings/index.e2e-spec.js.map +0 -1
- package/lib/plugins/linkedin-sales-navigator-settings/index.js +0 -15
- package/lib/plugins/linkedin-sales-navigator-settings/index.js.map +0 -1
- package/lib/plugins/linkedin-sales-navigator-settings/page.d.ts +0 -8
- package/lib/plugins/linkedin-sales-navigator-settings/page.js +0 -32
- package/lib/plugins/linkedin-sales-navigator-settings/page.js.map +0 -1
- package/lib/plugins/omni-channel-settings/index.d.ts +0 -9
- package/lib/plugins/omni-channel-settings/index.e2e-spec.d.ts +0 -1
- package/lib/plugins/omni-channel-settings/index.e2e-spec.js +0 -26
- package/lib/plugins/omni-channel-settings/index.e2e-spec.js.map +0 -1
- package/lib/plugins/omni-channel-settings/index.js +0 -29
- package/lib/plugins/omni-channel-settings/index.js.map +0 -1
- package/lib/plugins/opportunity-splits/index.d.ts +0 -9
- package/lib/plugins/opportunity-splits/index.e2e-spec.d.ts +0 -1
- package/lib/plugins/opportunity-splits/index.e2e-spec.js +0 -46
- package/lib/plugins/opportunity-splits/index.e2e-spec.js.map +0 -1
- package/lib/plugins/opportunity-splits/index.js +0 -32
- package/lib/plugins/opportunity-splits/index.js.map +0 -1
- package/lib/plugins/opportunity-splits/pages/layout-selection.d.ts +0 -8
- package/lib/plugins/opportunity-splits/pages/layout-selection.js +0 -17
- package/lib/plugins/opportunity-splits/pages/layout-selection.js.map +0 -1
- package/lib/plugins/opportunity-splits/pages/overview.d.ts +0 -10
- package/lib/plugins/opportunity-splits/pages/overview.js +0 -38
- package/lib/plugins/opportunity-splits/pages/overview.js.map +0 -1
- package/lib/plugins/opportunity-splits/pages/setup.d.ts +0 -8
- package/lib/plugins/opportunity-splits/pages/setup.js +0 -19
- package/lib/plugins/opportunity-splits/pages/setup.js.map +0 -1
- package/lib/plugins/permission-sets/index.d.ts +0 -10
- package/lib/plugins/permission-sets/index.e2e-spec.d.ts +0 -1
- package/lib/plugins/permission-sets/index.e2e-spec.js +0 -36
- package/lib/plugins/permission-sets/index.e2e-spec.js.map +0 -1
- package/lib/plugins/permission-sets/index.js +0 -22
- package/lib/plugins/permission-sets/index.js.map +0 -1
- package/lib/plugins/permission-sets/service-presence-status/index.d.ts +0 -10
- package/lib/plugins/permission-sets/service-presence-status/index.js +0 -60
- package/lib/plugins/permission-sets/service-presence-status/index.js.map +0 -1
- package/lib/plugins/picklists/field-dependencies/index.d.ts +0 -11
- package/lib/plugins/picklists/field-dependencies/index.js +0 -56
- package/lib/plugins/picklists/field-dependencies/index.js.map +0 -1
- package/lib/plugins/picklists/field-dependencies/index.test.d.ts +0 -1
- package/lib/plugins/picklists/field-dependencies/index.test.js +0 -64
- package/lib/plugins/picklists/field-dependencies/index.test.js.map +0 -1
- package/lib/plugins/picklists/field-dependencies/pages.d.ts +0 -14
- package/lib/plugins/picklists/field-dependencies/pages.js +0 -57
- package/lib/plugins/picklists/field-dependencies/pages.js.map +0 -1
- package/lib/plugins/picklists/index.d.ts +0 -23
- package/lib/plugins/picklists/index.e2e-spec.d.ts +0 -1
- package/lib/plugins/picklists/index.e2e-spec.js +0 -100
- package/lib/plugins/picklists/index.e2e-spec.js.map +0 -1
- package/lib/plugins/picklists/index.js +0 -153
- package/lib/plugins/picklists/index.js.map +0 -1
- package/lib/plugins/picklists/pages.d.ts +0 -40
- package/lib/plugins/picklists/pages.js +0 -194
- package/lib/plugins/picklists/pages.js.map +0 -1
- package/lib/plugins/picklists/standard-value-set.d.ts +0 -1
- package/lib/plugins/picklists/standard-value-set.js +0 -80
- package/lib/plugins/picklists/standard-value-set.js.map +0 -1
- package/lib/plugins/record-types/index.d.ts +0 -13
- package/lib/plugins/record-types/index.e2e-spec.d.ts +0 -1
- package/lib/plugins/record-types/index.e2e-spec.js +0 -73
- package/lib/plugins/record-types/index.e2e-spec.js.map +0 -1
- package/lib/plugins/record-types/index.js +0 -70
- package/lib/plugins/record-types/index.js.map +0 -1
- package/lib/plugins/record-types/pages.d.ts +0 -15
- package/lib/plugins/record-types/pages.js +0 -64
- package/lib/plugins/record-types/pages.js.map +0 -1
- package/lib/plugins/relate-contact-to-multiple-accounts/index.d.ts +0 -11
- package/lib/plugins/relate-contact-to-multiple-accounts/index.e2e-spec.d.ts +0 -1
- package/lib/plugins/relate-contact-to-multiple-accounts/index.e2e-spec.js +0 -29
- package/lib/plugins/relate-contact-to-multiple-accounts/index.e2e-spec.js.map +0 -1
- package/lib/plugins/relate-contact-to-multiple-accounts/index.js +0 -72
- package/lib/plugins/relate-contact-to-multiple-accounts/index.js.map +0 -1
- package/lib/plugins/reports-and-dashboards/folder-sharing/index.d.ts +0 -8
- package/lib/plugins/reports-and-dashboards/folder-sharing/index.e2e-spec.d.ts +0 -1
- package/lib/plugins/reports-and-dashboards/folder-sharing/index.e2e-spec.js +0 -3
- package/lib/plugins/reports-and-dashboards/folder-sharing/index.e2e-spec.js.map +0 -1
- package/lib/plugins/reports-and-dashboards/folder-sharing/index.js +0 -50
- package/lib/plugins/reports-and-dashboards/folder-sharing/index.js.map +0 -1
- package/lib/plugins/reports-and-dashboards/index.d.ts +0 -11
- package/lib/plugins/reports-and-dashboards/index.e2e-spec.d.ts +0 -1
- package/lib/plugins/reports-and-dashboards/index.e2e-spec.js +0 -3
- package/lib/plugins/reports-and-dashboards/index.e2e-spec.js.map +0 -1
- package/lib/plugins/reports-and-dashboards/index.js +0 -29
- package/lib/plugins/reports-and-dashboards/index.js.map +0 -1
- package/lib/plugins/salesforce-cpq-config/formConfig.d.ts +0 -17
- package/lib/plugins/salesforce-cpq-config/formConfig.js +0 -649
- package/lib/plugins/salesforce-cpq-config/formConfig.js.map +0 -1
- package/lib/plugins/salesforce-cpq-config/index.d.ts +0 -7
- package/lib/plugins/salesforce-cpq-config/index.e2e-spec.d.ts +0 -1
- package/lib/plugins/salesforce-cpq-config/index.e2e-spec.js +0 -37
- package/lib/plugins/salesforce-cpq-config/index.e2e-spec.js.map +0 -1
- package/lib/plugins/salesforce-cpq-config/index.js +0 -195
- package/lib/plugins/salesforce-cpq-config/index.js.map +0 -1
- package/lib/plugins/salesforce-to-salesforce/index.d.ts +0 -9
- package/lib/plugins/salesforce-to-salesforce/index.e2e-spec.d.ts +0 -1
- package/lib/plugins/salesforce-to-salesforce/index.e2e-spec.js +0 -34
- package/lib/plugins/salesforce-to-salesforce/index.e2e-spec.js.map +0 -1
- package/lib/plugins/salesforce-to-salesforce/index.js +0 -44
- package/lib/plugins/salesforce-to-salesforce/index.js.map +0 -1
- package/lib/plugins/security/authentication-configuration/index.d.ts +0 -11
- package/lib/plugins/security/authentication-configuration/index.e2e-spec.d.ts +0 -1
- package/lib/plugins/security/authentication-configuration/index.e2e-spec.js +0 -101
- package/lib/plugins/security/authentication-configuration/index.e2e-spec.js.map +0 -1
- package/lib/plugins/security/authentication-configuration/index.js +0 -62
- package/lib/plugins/security/authentication-configuration/index.js.map +0 -1
- package/lib/plugins/security/certificate-and-key-management/index.d.ts +0 -23
- package/lib/plugins/security/certificate-and-key-management/index.e2e-spec.d.ts +0 -1
- package/lib/plugins/security/certificate-and-key-management/index.e2e-spec.js +0 -63
- package/lib/plugins/security/certificate-and-key-management/index.e2e-spec.js.map +0 -1
- package/lib/plugins/security/certificate-and-key-management/index.js +0 -159
- package/lib/plugins/security/certificate-and-key-management/index.js.map +0 -1
- package/lib/plugins/security/certificate-and-key-management/index.test.d.ts +0 -1
- package/lib/plugins/security/certificate-and-key-management/index.test.js +0 -61
- package/lib/plugins/security/certificate-and-key-management/index.test.js.map +0 -1
- package/lib/plugins/security/index.d.ts +0 -13
- package/lib/plugins/security/index.js +0 -42
- package/lib/plugins/security/index.js.map +0 -1
- package/lib/plugins/service-channels/capacity/index.d.ts +0 -18
- package/lib/plugins/service-channels/capacity/index.js +0 -133
- package/lib/plugins/service-channels/capacity/index.js.map +0 -1
- package/lib/plugins/service-channels/index.d.ts +0 -12
- package/lib/plugins/service-channels/index.e2e-spec.d.ts +0 -1
- package/lib/plugins/service-channels/index.e2e-spec.js +0 -57
- package/lib/plugins/service-channels/index.e2e-spec.js.map +0 -1
- package/lib/plugins/service-channels/index.js +0 -38
- package/lib/plugins/service-channels/index.js.map +0 -1
- package/lib/plugins/slack/index.d.ts +0 -9
- package/lib/plugins/slack/index.e2e-spec.d.ts +0 -1
- package/lib/plugins/slack/index.e2e-spec.js +0 -47
- package/lib/plugins/slack/index.e2e-spec.js.map +0 -1
- package/lib/plugins/slack/index.js +0 -47
- package/lib/plugins/slack/index.js.map +0 -1
- package/lib/plugins/utils.d.ts +0 -3
- package/lib/plugins/utils.js +0 -47
- package/lib/plugins/utils.js.map +0 -1
- package/oclif.manifest.json +0 -163
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import assert from 'assert';
|
|
2
|
-
import { readFileSync } from 'node:fs';
|
|
3
|
-
import { SalesforceCpqConfig } from './index.js';
|
|
4
|
-
const defaultConfig = JSON.parse(readFileSync(new URL('./default.json', import.meta.url), 'utf8'));
|
|
5
|
-
const describeOrSkip = process.env['CPQ'] === 'true' ? describe : describe.skip;
|
|
6
|
-
describeOrSkip(SalesforceCpqConfig.name, function () {
|
|
7
|
-
let plugin;
|
|
8
|
-
before(() => {
|
|
9
|
-
plugin = new SalesforceCpqConfig(global.bf);
|
|
10
|
-
});
|
|
11
|
-
const configDefault = defaultConfig.settings.salesforceCpqConfig;
|
|
12
|
-
const configCustom = {
|
|
13
|
-
documents: {
|
|
14
|
-
documentFolder: 'Quotes',
|
|
15
|
-
hideDocumentName: true,
|
|
16
|
-
},
|
|
17
|
-
quote: {
|
|
18
|
-
disableInitialQuoteSync: true,
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
it('should apply default config', async () => {
|
|
22
|
-
await plugin.run(configDefault);
|
|
23
|
-
});
|
|
24
|
-
it('should already be configured', async () => {
|
|
25
|
-
const res = await plugin.run(configDefault);
|
|
26
|
-
assert.deepStrictEqual(res, { message: 'no action necessary' });
|
|
27
|
-
});
|
|
28
|
-
it('should apply custom config', async () => {
|
|
29
|
-
const res = await plugin.run(configCustom);
|
|
30
|
-
assert.notDeepStrictEqual(res, { message: 'no action necessary' });
|
|
31
|
-
});
|
|
32
|
-
it('should already be configured', async () => {
|
|
33
|
-
const res = await plugin.run(configCustom);
|
|
34
|
-
assert.deepStrictEqual(res, { message: 'no action necessary' });
|
|
35
|
-
});
|
|
36
|
-
});
|
|
37
|
-
//# sourceMappingURL=index.e2e-spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.e2e-spec.js","sourceRoot":"","sources":["../../../src/plugins/salesforce-cpq-config/index.e2e-spec.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEjD,MAAM,aAAa,GAAG,IAAI,CAAC,KAAK,CAC9B,YAAY,CAAC,IAAI,GAAG,CAAC,gBAAgB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,CACjE,CAAC;AAEF,MAAM,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,MAAM,CAAC,CA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AC,GAAG,EAAE,EAAE,OAAO,EAAE,qBAAqB,EAAE,CAAC,CAAC;IAClE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
import { BrowserforcePlugin } from '../../plugin.js';
|
|
2
|
-
import { formConfig } from './formConfig.js';
|
|
3
|
-
const BASE_PATH = '0A3?setupid=ImportedPackage&retURL=%2Fui%2Fsetup%2FSetup%3Fsetupid%3DStudio';
|
|
4
|
-
const AUTH_PATH = 'setup/secur/RemoteAccessAuthorizationPage.apexp';
|
|
5
|
-
const CONFIGURE_SELECTOR = '.actionLink[title*="Configure"][title*="Salesforce CPQ"]';
|
|
6
|
-
const GENERATE_INTEGRATION_USER_PERMISSIONS_SELECTOR = 'input[name="page:form:pb:j_id185:j_id197:setupIntegrationUserPermissions"]';
|
|
7
|
-
const SAVE_SELECTOR = 'input[name="page:form:j_id2:j_id3:j_id11"]';
|
|
8
|
-
const AUTHORIZE_NEW_CALCULATION_SERVICE_SELECTOR = 'span#page\\:form\\:pb\\:calculatorOptions\\:j_id201\\:j_id203 a';
|
|
9
|
-
const ALLOW_SELECTOR = 'input[name="save"]';
|
|
10
|
-
export class SalesforceCpqConfig extends BrowserforcePlugin {
|
|
11
|
-
logger = this.browserforce.logger;
|
|
12
|
-
async retrieve(definition) {
|
|
13
|
-
const page = await this.browserforce.openPage(BASE_PATH);
|
|
14
|
-
await page.waitForSelector(CONFIGURE_SELECTOR);
|
|
15
|
-
await Promise.all([
|
|
16
|
-
page.waitForNavigation(),
|
|
17
|
-
page.click(CONFIGURE_SELECTOR),
|
|
18
|
-
]);
|
|
19
|
-
const response = {};
|
|
20
|
-
if (definition) {
|
|
21
|
-
for (const [keyTab, valueTab] of Object.entries(formConfig)) {
|
|
22
|
-
if (definition[keyTab]) {
|
|
23
|
-
await page.waitForSelector(`td[id="${valueTab.id}"]`);
|
|
24
|
-
await page.click(`td[id="${valueTab.id}"]`);
|
|
25
|
-
for (const [keyItem, valueItem] of Object.entries(valueTab.properties)) {
|
|
26
|
-
if (!(definition[keyTab][keyItem] === undefined)) {
|
|
27
|
-
const item = valueItem;
|
|
28
|
-
response[keyTab] = response[keyTab] || {};
|
|
29
|
-
try {
|
|
30
|
-
if (item.component === 'input' && item.type === 'boolean') {
|
|
31
|
-
response[keyTab][keyItem] = await page.$eval(`${item.component}[name="${item.name}"]`, (el) => el.checked);
|
|
32
|
-
}
|
|
33
|
-
else if (item.component === 'input' &&
|
|
34
|
-
item.type === 'string') {
|
|
35
|
-
response[keyTab][keyItem] = await page.$eval(`${item.component}[name="${item.name}"]`, (el) => el.value);
|
|
36
|
-
}
|
|
37
|
-
else if (item.component === 'select') {
|
|
38
|
-
response[keyTab][keyItem] = await page.$eval(`${item.component}[name="${item.name}"]`, (el) => el.selectedOptions[0].text);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
catch (e) {
|
|
42
|
-
if (e.message ===
|
|
43
|
-
`Error: failed to find element matching selector "${item.component}[name="${item.name}"]"`) {
|
|
44
|
-
this.logger?.warn(`Label '${item.label}' '${keyTab}.${keyItem}' with component '${item.component}[name="${item.name}"]' is not found`);
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
throw e;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
await page.close();
|
|
56
|
-
return response;
|
|
57
|
-
}
|
|
58
|
-
async apply(config) {
|
|
59
|
-
const page = await this.browserforce.openPage(BASE_PATH);
|
|
60
|
-
await Promise.all([
|
|
61
|
-
page.waitForNavigation(),
|
|
62
|
-
page.click(CONFIGURE_SELECTOR),
|
|
63
|
-
]);
|
|
64
|
-
/*
|
|
65
|
-
This to click on the 'Generate Integration User Permissions button' for first time setup.
|
|
66
|
-
Once the button is clicked, it will not be available for the next time.
|
|
67
|
-
*/
|
|
68
|
-
try {
|
|
69
|
-
this.logger?.log(`Clicking on 'Generate Integration User Permissions' button`);
|
|
70
|
-
await page.waitForSelector(`td[id="${formConfig.pricingAndCalculation.id}"]`);
|
|
71
|
-
await page.click(`td[id="${formConfig.pricingAndCalculation.id}"]`);
|
|
72
|
-
await page.click(GENERATE_INTEGRATION_USER_PERMISSIONS_SELECTOR);
|
|
73
|
-
}
|
|
74
|
-
catch (e) {
|
|
75
|
-
if (e.message ===
|
|
76
|
-
`No element found for selector: ${GENERATE_INTEGRATION_USER_PERMISSIONS_SELECTOR}`) {
|
|
77
|
-
this.logger?.log(`The button 'Generate Integration User Permissions' is not found. It might be already clicked before.`);
|
|
78
|
-
}
|
|
79
|
-
else {
|
|
80
|
-
this.logger?.warn(`Error clicking 'Generate Integration User Permissions' button with message: ${e.message}`);
|
|
81
|
-
throw e;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
/*
|
|
85
|
-
This to loop through the formConfig and set the value based on the config provided.
|
|
86
|
-
*/
|
|
87
|
-
for (const [keyTab, valueTab] of Object.entries(formConfig)) {
|
|
88
|
-
if (config[keyTab]) {
|
|
89
|
-
await page.waitForSelector(`td[id="${valueTab.id}"]`);
|
|
90
|
-
await page.click(`td[id="${valueTab.id}"]`);
|
|
91
|
-
for (const [keyItem, valueItem] of Object.entries(valueTab.properties)) {
|
|
92
|
-
if (!(config[keyTab][keyItem] === undefined)) {
|
|
93
|
-
const item = valueItem;
|
|
94
|
-
try {
|
|
95
|
-
this.logger?.log(`Updating: '${keyTab}.${keyItem}' (${item.label}) with component '${item.component}[name="${item.name}"]' with value: '${config[keyTab][keyItem]}'`);
|
|
96
|
-
if (item.component === 'input' && item.type === 'boolean') {
|
|
97
|
-
await page.$eval(`input[name="${item.name}"]`, (e, v) => {
|
|
98
|
-
e.checked = v;
|
|
99
|
-
}, config[keyTab][keyItem]);
|
|
100
|
-
}
|
|
101
|
-
else if (item.component === 'input' && item.type === 'string') {
|
|
102
|
-
await page.$eval(`input[name="${item.name}"]`, (e, v) => {
|
|
103
|
-
e.value = v;
|
|
104
|
-
}, config[keyTab][keyItem]);
|
|
105
|
-
}
|
|
106
|
-
else if (item.component === 'select') {
|
|
107
|
-
const selectFieldOptions = await page.$$eval(`select[name="${item.name}"] option`, (options) => {
|
|
108
|
-
return options.map((option) => {
|
|
109
|
-
return {
|
|
110
|
-
text: option.text,
|
|
111
|
-
value: option.value,
|
|
112
|
-
};
|
|
113
|
-
});
|
|
114
|
-
});
|
|
115
|
-
const chooseFieldOption = selectFieldOptions.find((x) => x.text === config[keyTab][keyItem]);
|
|
116
|
-
if (!chooseFieldOption) {
|
|
117
|
-
const availableOption = selectFieldOptions.map((option) => option.text);
|
|
118
|
-
throw new Error(`Fail to set '${item.label}' with value '${config[keyTab][keyItem]}'. \nPlease make sure to select one of this available options: ${JSON.stringify(availableOption)}\n`);
|
|
119
|
-
}
|
|
120
|
-
await page.select(`select[name="${item.name}"]`, chooseFieldOption.value);
|
|
121
|
-
}
|
|
122
|
-
if (item.immediatelySave) {
|
|
123
|
-
await Promise.all([
|
|
124
|
-
page.waitForNavigation(),
|
|
125
|
-
page.click(SAVE_SELECTOR),
|
|
126
|
-
]);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
catch (e) {
|
|
130
|
-
if (e.message ===
|
|
131
|
-
`Error: failed to find element matching selector "${item.component}[name="${item.name}"]"`) {
|
|
132
|
-
this.logger?.warn(`Label '${item.label}' '${keyTab}.${keyItem}' with component '${item.component}[name="${item.name}"]' is not found`);
|
|
133
|
-
}
|
|
134
|
-
else {
|
|
135
|
-
this.logger?.warn(`Error: at Label '${item.label}' '${keyTab}.${keyItem}' with component '${item.component}[name="${item.name}"]' with message: ${e.message}`);
|
|
136
|
-
throw e;
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
await Promise.all([page.waitForNavigation(), page.click(SAVE_SELECTOR)]);
|
|
143
|
-
}
|
|
144
|
-
/*
|
|
145
|
-
This to click on the 'Authorize New Calculation Service' link under Pricing and Calculation tab.
|
|
146
|
-
Once authorized, it will not appear the next time.
|
|
147
|
-
*/
|
|
148
|
-
try {
|
|
149
|
-
this.logger?.log(`'Authorize New Calculation Service' link`);
|
|
150
|
-
await page.waitForSelector(`td[id="${formConfig.pricingAndCalculation.id}"]`);
|
|
151
|
-
await page.click(`td[id="${formConfig.pricingAndCalculation.id}"]`);
|
|
152
|
-
const authorizeLink = await page.$(AUTHORIZE_NEW_CALCULATION_SERVICE_SELECTOR);
|
|
153
|
-
if (authorizeLink) {
|
|
154
|
-
// Click on 'Authorize New Calculation Service' link
|
|
155
|
-
await page.waitForSelector(AUTHORIZE_NEW_CALCULATION_SERVICE_SELECTOR);
|
|
156
|
-
await page.click(AUTHORIZE_NEW_CALCULATION_SERVICE_SELECTOR);
|
|
157
|
-
// Wait for popup window with the expected URL
|
|
158
|
-
const newWindowTarget = await page
|
|
159
|
-
.browser()
|
|
160
|
-
.waitForTarget((target) => target.url().includes(AUTH_PATH));
|
|
161
|
-
const newPage = await newWindowTarget.page();
|
|
162
|
-
if (newPage) {
|
|
163
|
-
// Click on'Allow' button
|
|
164
|
-
await newPage.waitForSelector(ALLOW_SELECTOR, { visible: true });
|
|
165
|
-
await newPage.click(ALLOW_SELECTOR);
|
|
166
|
-
await page.waitForNavigation(); // Wait for the main page to refresh
|
|
167
|
-
this.logger?.log('The main page has refreshed after allowing.');
|
|
168
|
-
}
|
|
169
|
-
else {
|
|
170
|
-
this.logger?.warn('Failed to retrieve the new page from the popup.');
|
|
171
|
-
}
|
|
172
|
-
this.logger?.log('The authorization process has been completed.');
|
|
173
|
-
}
|
|
174
|
-
else {
|
|
175
|
-
this.logger?.log(`The link 'Authorize New Calculation Service' was not found. It might be already clicked before.`);
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
catch (e) {
|
|
179
|
-
if (e.message ===
|
|
180
|
-
`No element found for selector: ${AUTHORIZE_NEW_CALCULATION_SERVICE_SELECTOR}`) {
|
|
181
|
-
this.logger?.log(`The link Authorize New Calculation Service' is not found. It might be already clicked before.`);
|
|
182
|
-
}
|
|
183
|
-
else if (e.message ===
|
|
184
|
-
`Waiting for selector \`input[name="save"]\` failed: waitForFunction failed: frame got detached.`) {
|
|
185
|
-
this.logger?.log(`ALLOW button is not found. It might be already clicked before.`);
|
|
186
|
-
}
|
|
187
|
-
else {
|
|
188
|
-
this.logger?.warn(`Error clicking Authorize New Calculation Service' button with message: ${e.message}`);
|
|
189
|
-
throw e;
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
await page.close();
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/plugins/salesforce-cpq-config/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,MAAM,SAAS,GACb,6EAA6E,CAAC;AAChF,MAAM,SAAS,GAAG,iDAAiD,CAAC;AAEpE,MAAM,kBAAkB,GACtB,0DAA0D,CAAC;AAC7D,MAAM,8CAA8C,GAClD,4EAA4E,CAAC;AAC/E,MAAM,aAAa,GAAG,4CAA4C,CAAC;AACnE,MAAM,0CAA0C,GAC9C,iEAAiE,CAAC;AACpE,MAAM,cAAc,GAAG,oBAAoB,CAAC;AAI5C,MAAM,OAAO,mBAAoB,SAAQ,kBAAkB;IACjD,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC;IACnC,KAAK,CAAC,QAAQ,CAAC,UAAmB;QACvC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;QACzD,MAAM,IAAI,CAAC,eAAe,CAAC,kBAAkB,CAAC,CAAC;QAC/C,MAAM,OAAO,CAAC,GA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js';
|
|
3
|
-
describe(SalesforceToSalesforce.name, function () {
|
|
4
|
-
let plugin;
|
|
5
|
-
before(() => {
|
|
6
|
-
plugin = new SalesforceToSalesforce(global.bf);
|
|
7
|
-
});
|
|
8
|
-
const configEnabled = {
|
|
9
|
-
enabled: true,
|
|
10
|
-
};
|
|
11
|
-
const configDisabled = {
|
|
12
|
-
enabled: false,
|
|
13
|
-
};
|
|
14
|
-
it('should enable', async () => {
|
|
15
|
-
await plugin.run(configEnabled);
|
|
16
|
-
});
|
|
17
|
-
it('should be enabled', async () => {
|
|
18
|
-
const state = await plugin.retrieve();
|
|
19
|
-
assert.deepStrictEqual(state, configEnabled);
|
|
20
|
-
});
|
|
21
|
-
it('should fail to disable', async () => {
|
|
22
|
-
let err;
|
|
23
|
-
try {
|
|
24
|
-
await plugin.apply(configDisabled);
|
|
25
|
-
}
|
|
26
|
-
catch (e) {
|
|
27
|
-
err = e;
|
|
28
|
-
}
|
|
29
|
-
assert.throws(() => {
|
|
30
|
-
throw err;
|
|
31
|
-
}, /cannot be disabled/);
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
//# sourceMappingURL=index.e2e-spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.e2e-spec.js","sourceRoot":"","sources":["../../../src/plugins/salesforce-to-salesforce/index.e2e-spec.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAEpD,QAAQ,CAAC,sBAAsB,CAAC,IAAI,EAAE;IACpC,IAAI,MAA8B,CAAC;IACnC,MAAM,CAAC,GAAG,EAAE;QACV,MAAM,GAAG,IAAI,sBAAsB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACjD,CAAC,CAAC,CAAC;IAEH,MAAM,aAAa,GAAG;QACpB,OAAO,EAAE,IAAI;KACd,CAAC;IACF,MAAM,cAAc,GAAG;QACrB,OAAO,EAAE,KAAK;KACf,CAAC;IAEF,EAAE,CAAC,eAAe,EAAE,KAAK,IAAI,EAAE;QAC7B,MAAM,MAAM,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,mBAAmB,EAAE,KAAK,IAAI,EAAE;QACjC,MAAM,KAAK,GAAG,MAAM,MAAM,CAAC,QAAQ,EAAE,CAAC;QACtC,MAAM,CAAC,eAAe,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,wBAAwB,EAAE,KAAK,IAAI,EAAE;QACtC,IAAI,GAAG,CAAC;QACR,IAAI,CAAC;YACH,MAAM,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;QACrC,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,GAAG,GAAG,CAAC,CAAC;QACV,CAAC;QACD,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE;YACjB,MAAM,GAAG,CAAC;QACZ,CAAC,EAAE,oBAAoB,CAAC,CAAC;IAC3B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import pRetry from 'p-retry';
|
|
2
|
-
import { BrowserforcePlugin } from '../../plugin.js';
|
|
3
|
-
const BASE_PATH = '_ui/s2s/ui/PartnerNetworkEnable/e';
|
|
4
|
-
const ENABLED_SELECTOR = '#penabled';
|
|
5
|
-
const BASE_SELECTOR = 'table.detailList';
|
|
6
|
-
const SAVE_BUTTON_SELECTOR = 'input[name="save"]';
|
|
7
|
-
export class SalesforceToSalesforce extends BrowserforcePlugin {
|
|
8
|
-
async retrieve() {
|
|
9
|
-
const page = await this.browserforce.openPage(BASE_PATH);
|
|
10
|
-
await page.waitForSelector(BASE_SELECTOR);
|
|
11
|
-
const response = {
|
|
12
|
-
enabled: true,
|
|
13
|
-
};
|
|
14
|
-
const inputEnable = await page.$(ENABLED_SELECTOR);
|
|
15
|
-
if (inputEnable) {
|
|
16
|
-
response.enabled = await page.$eval(ENABLED_SELECTOR, (el) => el.checked);
|
|
17
|
-
}
|
|
18
|
-
await page.close();
|
|
19
|
-
return response;
|
|
20
|
-
}
|
|
21
|
-
async apply(config) {
|
|
22
|
-
if (config.enabled === false) {
|
|
23
|
-
throw new Error('`enabled` cannot be disabled once enabled');
|
|
24
|
-
}
|
|
25
|
-
// sometimes the setting is not being applied although no error is being displayed
|
|
26
|
-
await pRetry(async () => {
|
|
27
|
-
const page = await this.browserforce.openPage(BASE_PATH);
|
|
28
|
-
await page.waitForSelector(ENABLED_SELECTOR);
|
|
29
|
-
await page.$eval(ENABLED_SELECTOR, (e, v) => {
|
|
30
|
-
e.checked = v;
|
|
31
|
-
}, config.enabled);
|
|
32
|
-
await Promise.all([
|
|
33
|
-
page.waitForNavigation(),
|
|
34
|
-
page.click(SAVE_BUTTON_SELECTOR),
|
|
35
|
-
]);
|
|
36
|
-
const result = await this.retrieve();
|
|
37
|
-
await page.close();
|
|
38
|
-
if (result.enabled !== config.enabled) {
|
|
39
|
-
throw new Error('setting was not applied as expected');
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/plugins/salesforce-to-salesforce/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,SAAS,CAAC;AAC7B,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAErD,MAAM,SAAS,GAAG,mCAAmC,CAAC;AAEtD,MAAM,gBAAgB,GAAG,WAAW,CAAC;AACrC,MAAM,aAAa,GAAG,kBAAkB,CAAC;AACzC,MAAM,oBAAoB,GAAG,oBAAoB,CAAC;AAMlD,MAAM,OAAO,sBAAuB,SAAQ,kBAAkB;IACrD,KAAK,CAAC,QAAQ;QACn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AAQ,EAAE,CAAC;YACrC,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;YACnB,IAAI,MAAM,CAAC,OAAO,KAAK,MAAM,CAAC,OAAO,EAAE,CAAC;gBACtC,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;YACzD,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { BrowserforcePlugin } from '../../../plugin.js';
|
|
2
|
-
export type Config = {
|
|
3
|
-
services: Array<{
|
|
4
|
-
label: string;
|
|
5
|
-
enabled: boolean;
|
|
6
|
-
}>;
|
|
7
|
-
};
|
|
8
|
-
export declare class AuthenticationConfiguration extends BrowserforcePlugin {
|
|
9
|
-
retrieve(definition: Config): Promise<Config>;
|
|
10
|
-
apply(plan: Config): Promise<void>;
|
|
11
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import assert from 'assert';
|
|
2
|
-
import * as child from 'child_process';
|
|
3
|
-
import { fileURLToPath } from 'node:url';
|
|
4
|
-
import * as path from 'path';
|
|
5
|
-
import { AuthenticationConfiguration } from './index.js';
|
|
6
|
-
const __dirname = fileURLToPath(new URL('.', import.meta.url));
|
|
7
|
-
describe(AuthenticationConfiguration.name, function () {
|
|
8
|
-
let plugin;
|
|
9
|
-
before(() => {
|
|
10
|
-
plugin = new AuthenticationConfiguration(global.bf);
|
|
11
|
-
});
|
|
12
|
-
describe('authentication configuration', () => {
|
|
13
|
-
const configRetrieveSingle = {
|
|
14
|
-
services: [{ label: 'Login Form', enabled: true }],
|
|
15
|
-
};
|
|
16
|
-
const configRmoveSingle = {
|
|
17
|
-
services: [{ label: 'Login Form', enabled: false }],
|
|
18
|
-
};
|
|
19
|
-
const configApplyMultiple = {
|
|
20
|
-
services: [
|
|
21
|
-
{ label: 'Login Form', enabled: false },
|
|
22
|
-
{ label: 'TestAuthMethod', enabled: true },
|
|
23
|
-
],
|
|
24
|
-
};
|
|
25
|
-
const configApplyMissing = {
|
|
26
|
-
services: [{ label: 'FakeAuthMethod', enabled: true }],
|
|
27
|
-
};
|
|
28
|
-
const resetTestState = {
|
|
29
|
-
services: [
|
|
30
|
-
{ label: 'Login Form', enabled: true },
|
|
31
|
-
{ label: 'TestAuthMethod', enabled: false },
|
|
32
|
-
],
|
|
33
|
-
};
|
|
34
|
-
it('should retrieve the single enabled Login Form auth', async () => {
|
|
35
|
-
const res = await plugin.retrieve(configRetrieveSingle);
|
|
36
|
-
assert.deepStrictEqual(res, configRetrieveSingle);
|
|
37
|
-
});
|
|
38
|
-
it('should not do anything when the configuration is already set', async () => {
|
|
39
|
-
const res = await plugin.run(configRetrieveSingle);
|
|
40
|
-
assert.deepStrictEqual(res, { message: 'no action necessary' });
|
|
41
|
-
});
|
|
42
|
-
it('should throw an error when trying to remove the only enabled service', async () => {
|
|
43
|
-
let err;
|
|
44
|
-
try {
|
|
45
|
-
await plugin.apply(configRmoveSingle);
|
|
46
|
-
}
|
|
47
|
-
catch (e) {
|
|
48
|
-
err = e;
|
|
49
|
-
}
|
|
50
|
-
assert.throws(() => {
|
|
51
|
-
throw err;
|
|
52
|
-
}, /You must select at least one authentication service/);
|
|
53
|
-
});
|
|
54
|
-
it('should deploy an AuthProvider for testing', () => {
|
|
55
|
-
const sourceDeployCmd = child.spawnSync('sf', [
|
|
56
|
-
'project',
|
|
57
|
-
'deploy',
|
|
58
|
-
'start',
|
|
59
|
-
'-d',
|
|
60
|
-
path.join(__dirname, 'sfdx-source'),
|
|
61
|
-
'--json',
|
|
62
|
-
]);
|
|
63
|
-
assert.deepStrictEqual(sourceDeployCmd.status, 0, sourceDeployCmd.output.toString());
|
|
64
|
-
});
|
|
65
|
-
it('should update multiple auth services', async () => {
|
|
66
|
-
await plugin.apply(configApplyMultiple);
|
|
67
|
-
const res = await plugin.retrieve(configApplyMultiple);
|
|
68
|
-
assert.deepStrictEqual(res, configApplyMultiple);
|
|
69
|
-
});
|
|
70
|
-
it('should throw an error when trying to apply a missing service', async () => {
|
|
71
|
-
let err;
|
|
72
|
-
try {
|
|
73
|
-
await plugin.apply(configApplyMissing);
|
|
74
|
-
}
|
|
75
|
-
catch (e) {
|
|
76
|
-
err = e;
|
|
77
|
-
}
|
|
78
|
-
assert.throws(() => {
|
|
79
|
-
throw err;
|
|
80
|
-
}, /not found/);
|
|
81
|
-
});
|
|
82
|
-
it('should reset auth services back to default', async () => {
|
|
83
|
-
await plugin.apply(resetTestState);
|
|
84
|
-
const res = await plugin.retrieve(resetTestState);
|
|
85
|
-
assert.deepStrictEqual(res, resetTestState);
|
|
86
|
-
});
|
|
87
|
-
it('should remove the testing AuthProvider', () => {
|
|
88
|
-
const sourceDeployCmd = child.spawnSync('sf', [
|
|
89
|
-
'project',
|
|
90
|
-
'delete',
|
|
91
|
-
'source',
|
|
92
|
-
'--metadata',
|
|
93
|
-
'AuthProvider:TestAuthMethod',
|
|
94
|
-
'--no-prompt',
|
|
95
|
-
'--json',
|
|
96
|
-
]);
|
|
97
|
-
assert.deepStrictEqual(sourceDeployCmd.status, 0, sourceDeployCmd.output.toString());
|
|
98
|
-
});
|
|
99
|
-
});
|
|
100
|
-
});
|
|
101
|
-
//# sourceMappingURL=index.e2e-spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.e2e-spec.js","sourceRoot":"","sources":["../../../../src/plugins/security/authentication-configuration/index.e2e-spec.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,KAAK,KAAK,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAe,2BAA2B,EAAE,MAAM,YAAY,CAAC;AAEtE,MAAM,SAAS,GAAG,aAAa,CAAC,IAAI,GAAG,CAAC,GAAG,EAAE,MAAM,C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form[id="BrandSetup:brandSetupForm"]';
|
|
4
|
-
const SERVICE_CHECKBOX_SELECTOR = 'input.authOption[type="checkbox"]';
|
|
5
|
-
const SAVE_BUTTON_SELECTOR = 'input[id$=":Save"]';
|
|
6
|
-
export class AuthenticationConfiguration extends BrowserforcePlugin {
|
|
7
|
-
async retrieve(definition) {
|
|
8
|
-
const page = await this.browserforce.openPage(EDIT_VIEW_PATH);
|
|
9
|
-
const frameOrPage = await this.browserforce.waitForSelectorInFrameOrPage(page, SETUP_FORM_SELECTOR);
|
|
10
|
-
await frameOrPage.waitForSelector(SERVICE_CHECKBOX_SELECTOR);
|
|
11
|
-
const services = await frameOrPage.$$eval(SERVICE_CHECKBOX_SELECTOR, (inputs, definedServices) => inputs
|
|
12
|
-
.map((cb) => {
|
|
13
|
-
const labelElement = document.querySelector(`label[for="${cb.id}"]`);
|
|
14
|
-
const label = labelElement
|
|
15
|
-
? labelElement.textContent.trim()
|
|
16
|
-
: cb.id;
|
|
17
|
-
return {
|
|
18
|
-
label,
|
|
19
|
-
enabled: cb.checked,
|
|
20
|
-
};
|
|
21
|
-
})
|
|
22
|
-
.filter((service) => definedServices.some((definedService) => definedService.label === service.label)), definition.services);
|
|
23
|
-
await page.close();
|
|
24
|
-
return { services };
|
|
25
|
-
}
|
|
26
|
-
async apply(plan) {
|
|
27
|
-
const page = await this.browserforce.openPage(EDIT_VIEW_PATH);
|
|
28
|
-
const frameOrPage = await this.browserforce.waitForSelectorInFrameOrPage(page, SETUP_FORM_SELECTOR);
|
|
29
|
-
await frameOrPage.waitForSelector(SERVICE_CHECKBOX_SELECTOR);
|
|
30
|
-
for (const svc of plan.services) {
|
|
31
|
-
const checkboxId = (await frameOrPage.$$eval(SERVICE_CHECKBOX_SELECTOR, (inputs, serviceName) => {
|
|
32
|
-
for (const inp of inputs) {
|
|
33
|
-
const labelElement = document.querySelector(`label[for="${inp.id}"]`);
|
|
34
|
-
if (labelElement &&
|
|
35
|
-
labelElement.textContent.trim() === serviceName) {
|
|
36
|
-
return inp.id;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
return null;
|
|
40
|
-
}, svc.label));
|
|
41
|
-
if (!checkboxId) {
|
|
42
|
-
throw new Error(`Authentication service "${svc.label}" not found`);
|
|
43
|
-
}
|
|
44
|
-
const selector = `[id="${checkboxId}"]`;
|
|
45
|
-
const isChecked = await frameOrPage.$eval(selector, (el) => el.checked);
|
|
46
|
-
if (svc.enabled !== isChecked) {
|
|
47
|
-
await frameOrPage.click(selector);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
const anyChecked = await frameOrPage.$$eval(SERVICE_CHECKBOX_SELECTOR, (inputs) => inputs.some((cb) => cb.checked));
|
|
51
|
-
if (!anyChecked) {
|
|
52
|
-
throw new Error('Change failed: “You must select at least one authentication service.”');
|
|
53
|
-
}
|
|
54
|
-
await frameOrPage.waitForSelector(SAVE_BUTTON_SELECTOR);
|
|
55
|
-
await Promise.all([
|
|
56
|
-
frameOrPage.waitForNavigation({ waitUntil: 'networkidle0' }),
|
|
57
|
-
frameOrPage.click(SAVE_BUTTON_SELECTOR),
|
|
58
|
-
]);
|
|
59
|
-
await page.close();
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/plugins/security/authentication-configuration/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AASxD,MAAM,cAAc,GAClB,wEAAwE,CAAC;AAE3E,MAAM,mBAAmB,GAAG,sCAAsC,CAAC;AACnE,MAAM,yBAAyB,GAAG,mCAAmC,CAAC;AACtE,MAAM,oBAAoB,GAAG,oBAAoB,CAAC;AAElD,MAAM,OAAO,2BAA4B,SAAQ,kBAAkB;IAC1D,KAAK,CAAC,QAAQ,CAAC,UAAkB;QACtC,MAAM,IAAI,GAAG,MAAM,IAAI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K,CACb,uEAAuE,CACxE,CAAC;QACJ,CAAC;QACD,MAAM,WAAW,CAAC,eAAe,CAAC,oBAAoB,CAAC,CAAC;QACxD,MAAM,OAAO,CAAC,GAAG,CAAC;YAChB,WAAW,CAAC,iBAAiB,CAAC,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;YAC5D,WAAW,CAAC,KAAK,CAAC,oBAAoB,CAAC;SACxC,CAAC,CAAC;QACH,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;IACrB,CAAC;CACF"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { BrowserforcePlugin } from '../../../plugin.js';
|
|
2
|
-
export type Config = {
|
|
3
|
-
certificates?: Certificate[];
|
|
4
|
-
importFromKeystore?: KeyStore[];
|
|
5
|
-
};
|
|
6
|
-
type Certificate = {
|
|
7
|
-
name: string;
|
|
8
|
-
label: string;
|
|
9
|
-
exportable?: boolean;
|
|
10
|
-
keySize?: number;
|
|
11
|
-
_id?: string;
|
|
12
|
-
};
|
|
13
|
-
type KeyStore = {
|
|
14
|
-
name: string;
|
|
15
|
-
filePath?: string;
|
|
16
|
-
password?: string;
|
|
17
|
-
};
|
|
18
|
-
export declare class CertificateAndKeyManagement extends BrowserforcePlugin {
|
|
19
|
-
retrieve(definition: Config): Promise<Config>;
|
|
20
|
-
diff(state?: Config, definition?: Config): Config | undefined;
|
|
21
|
-
apply(plan: Config): Promise<void>;
|
|
22
|
-
}
|
|
23
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|