sf-browserforce 1.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/LICENSE +21 -0
- package/README.md +266 -0
- package/bin/run +9 -0
- package/bin/run.cmd +3 -0
- package/lib/browserforce-command.d.ts +27 -0
- package/lib/browserforce-command.js +162 -0
- package/lib/browserforce-command.js.map +1 -0
- package/lib/browserforce.d.ts +27 -0
- package/lib/browserforce.js +163 -0
- package/lib/browserforce.js.map +1 -0
- package/lib/commands/browserforce/apply.d.ts +10 -0
- package/lib/commands/browserforce/apply.js +83 -0
- package/lib/commands/browserforce/apply.js.map +1 -0
- package/lib/commands/browserforce/playwright.d.ts +9 -0
- package/lib/commands/browserforce/playwright.js +53 -0
- package/lib/commands/browserforce/playwright.js.map +1 -0
- package/lib/config-parser.d.ts +16 -0
- package/lib/config-parser.js +24 -0
- package/lib/config-parser.js.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -0
- package/lib/jsforce-utils.d.ts +5 -0
- package/lib/jsforce-utils.js +14 -0
- package/lib/jsforce-utils.js.map +1 -0
- package/lib/pages/login.d.ts +7 -0
- package/lib/pages/login.js +17 -0
- package/lib/pages/login.js.map +1 -0
- package/lib/plugin.d.ts +15 -0
- package/lib/plugin.js +28 -0
- package/lib/plugin.js.map +1 -0
- package/lib/plugins/activity-settings/index.d.ts +9 -0
- package/lib/plugins/activity-settings/index.e2e-spec.d.ts +1 -0
- package/lib/plugins/activity-settings/index.e2e-spec.js +36 -0
- package/lib/plugins/activity-settings/index.e2e-spec.js.map +1 -0
- package/lib/plugins/activity-settings/index.js +102 -0
- package/lib/plugins/activity-settings/index.js.map +1 -0
- package/lib/plugins/auth-providers/index.d.ts +13 -0
- package/lib/plugins/auth-providers/index.e2e-spec.d.ts +1 -0
- package/lib/plugins/auth-providers/index.e2e-spec.js +78 -0
- package/lib/plugins/auth-providers/index.e2e-spec.js.map +1 -0
- package/lib/plugins/auth-providers/index.js +135 -0
- package/lib/plugins/auth-providers/index.js.map +1 -0
- package/lib/plugins/company-information/index.d.ts +8 -0
- package/lib/plugins/company-information/index.e2e-spec.d.ts +1 -0
- package/lib/plugins/company-information/index.e2e-spec.js +37 -0
- package/lib/plugins/company-information/index.e2e-spec.js.map +1 -0
- package/lib/plugins/company-information/index.js +114 -0
- package/lib/plugins/company-information/index.js.map +1 -0
- package/lib/plugins/customer-portal/available-custom-objects/index.d.ts +14 -0
- package/lib/plugins/customer-portal/available-custom-objects/index.js +203 -0
- package/lib/plugins/customer-portal/available-custom-objects/index.js.map +1 -0
- package/lib/plugins/customer-portal/available-custom-objects/index.test.d.ts +1 -0
- package/lib/plugins/customer-portal/available-custom-objects/index.test.js +39 -0
- package/lib/plugins/customer-portal/available-custom-objects/index.test.js.map +1 -0
- package/lib/plugins/customer-portal/enabled/index.d.ts +6 -0
- package/lib/plugins/customer-portal/enabled/index.js +89 -0
- package/lib/plugins/customer-portal/enabled/index.js.map +1 -0
- package/lib/plugins/customer-portal/enabled/index.test.d.ts +1 -0
- package/lib/plugins/customer-portal/enabled/index.test.js +34 -0
- package/lib/plugins/customer-portal/enabled/index.test.js.map +1 -0
- package/lib/plugins/customer-portal/index.d.ts +15 -0
- package/lib/plugins/customer-portal/index.e2e-spec.d.ts +1 -0
- package/lib/plugins/customer-portal/index.e2e-spec.js +188 -0
- package/lib/plugins/customer-portal/index.e2e-spec.js.map +1 -0
- package/lib/plugins/customer-portal/index.js +58 -0
- package/lib/plugins/customer-portal/index.js.map +1 -0
- package/lib/plugins/customer-portal/index.test.d.ts +1 -0
- package/lib/plugins/customer-portal/index.test.js +84 -0
- package/lib/plugins/customer-portal/index.test.js.map +1 -0
- package/lib/plugins/customer-portal/portals/index.d.ts +25 -0
- package/lib/plugins/customer-portal/portals/index.js +254 -0
- package/lib/plugins/customer-portal/portals/index.js.map +1 -0
- package/lib/plugins/customer-portal/portals/index.test.d.ts +1 -0
- package/lib/plugins/customer-portal/portals/index.test.js +140 -0
- package/lib/plugins/customer-portal/portals/index.test.js.map +1 -0
- package/lib/plugins/density-settings/index.d.ts +10 -0
- package/lib/plugins/density-settings/index.e2e-spec.d.ts +1 -0
- package/lib/plugins/density-settings/index.e2e-spec.js +39 -0
- package/lib/plugins/density-settings/index.e2e-spec.js.map +1 -0
- package/lib/plugins/density-settings/index.js +101 -0
- package/lib/plugins/density-settings/index.js.map +1 -0
- package/lib/plugins/deprecated.d.ts +4 -0
- package/lib/plugins/deprecated.js +28 -0
- package/lib/plugins/deprecated.js.map +1 -0
- package/lib/plugins/email-deliverability/index.d.ts +9 -0
- package/lib/plugins/email-deliverability/index.e2e-spec.d.ts +1 -0
- package/lib/plugins/email-deliverability/index.e2e-spec.js +55 -0
- package/lib/plugins/email-deliverability/index.e2e-spec.js.map +1 -0
- package/lib/plugins/email-deliverability/index.js +109 -0
- package/lib/plugins/email-deliverability/index.js.map +1 -0
- package/lib/plugins/high-velocity-sales-settings/index.d.ts +10 -0
- package/lib/plugins/high-velocity-sales-settings/index.e2e-spec.d.ts +1 -0
- package/lib/plugins/high-velocity-sales-settings/index.e2e-spec.js +29 -0
- package/lib/plugins/high-velocity-sales-settings/index.e2e-spec.js.map +1 -0
- package/lib/plugins/high-velocity-sales-settings/index.js +105 -0
- package/lib/plugins/high-velocity-sales-settings/index.js.map +1 -0
- package/lib/plugins/high-velocity-sales-settings/page.d.ts +8 -0
- package/lib/plugins/high-velocity-sales-settings/page.js +27 -0
- package/lib/plugins/high-velocity-sales-settings/page.js.map +1 -0
- package/lib/plugins/history-tracking/index.d.ts +19 -0
- package/lib/plugins/history-tracking/index.e2e-spec.d.ts +1 -0
- package/lib/plugins/history-tracking/index.e2e-spec.js +128 -0
- package/lib/plugins/history-tracking/index.e2e-spec.js.map +1 -0
- package/lib/plugins/history-tracking/index.js +272 -0
- package/lib/plugins/history-tracking/index.js.map +1 -0
- package/lib/plugins/home-page-layouts/index.d.ts +14 -0
- package/lib/plugins/home-page-layouts/index.e2e-spec.d.ts +1 -0
- package/lib/plugins/home-page-layouts/index.e2e-spec.js +47 -0
- package/lib/plugins/home-page-layouts/index.e2e-spec.js.map +1 -0
- package/lib/plugins/home-page-layouts/index.js +145 -0
- package/lib/plugins/home-page-layouts/index.js.map +1 -0
- package/lib/plugins/home-page-layouts/index.test.d.ts +1 -0
- package/lib/plugins/home-page-layouts/index.test.js +104 -0
- package/lib/plugins/home-page-layouts/index.test.js.map +1 -0
- package/lib/plugins/index.d.ts +28 -0
- package/lib/plugins/index.js +29 -0
- package/lib/plugins/index.js.map +1 -0
- package/lib/plugins/lightning-experience-settings/index.d.ts +17 -0
- package/lib/plugins/lightning-experience-settings/index.e2e-spec.d.ts +1 -0
- package/lib/plugins/lightning-experience-settings/index.e2e-spec.js +48 -0
- package/lib/plugins/lightning-experience-settings/index.e2e-spec.js.map +1 -0
- package/lib/plugins/lightning-experience-settings/index.js +149 -0
- package/lib/plugins/lightning-experience-settings/index.js.map +1 -0
- package/lib/plugins/linkedin-sales-navigator-settings/index.d.ts +8 -0
- package/lib/plugins/linkedin-sales-navigator-settings/index.e2e-spec.d.ts +1 -0
- package/lib/plugins/linkedin-sales-navigator-settings/index.e2e-spec.js +29 -0
- package/lib/plugins/linkedin-sales-navigator-settings/index.e2e-spec.js.map +1 -0
- package/lib/plugins/linkedin-sales-navigator-settings/index.js +93 -0
- package/lib/plugins/linkedin-sales-navigator-settings/index.js.map +1 -0
- package/lib/plugins/linkedin-sales-navigator-settings/page.d.ts +9 -0
- package/lib/plugins/linkedin-sales-navigator-settings/page.js +35 -0
- package/lib/plugins/linkedin-sales-navigator-settings/page.js.map +1 -0
- package/lib/plugins/login-as-user/index.d.ts +9 -0
- package/lib/plugins/login-as-user/index.js +104 -0
- package/lib/plugins/login-as-user/index.js.map +1 -0
- package/lib/plugins/logout-login-as-user/index.d.ts +6 -0
- package/lib/plugins/logout-login-as-user/index.js +76 -0
- package/lib/plugins/logout-login-as-user/index.js.map +1 -0
- package/lib/plugins/omni-channel-settings/index.d.ts +9 -0
- package/lib/plugins/omni-channel-settings/index.e2e-spec.d.ts +1 -0
- package/lib/plugins/omni-channel-settings/index.e2e-spec.js +30 -0
- package/lib/plugins/omni-channel-settings/index.e2e-spec.js.map +1 -0
- package/lib/plugins/omni-channel-settings/index.js +97 -0
- package/lib/plugins/omni-channel-settings/index.js.map +1 -0
- package/lib/plugins/opportunity-splits/index.d.ts +9 -0
- package/lib/plugins/opportunity-splits/index.e2e-spec.d.ts +1 -0
- package/lib/plugins/opportunity-splits/index.e2e-spec.js +46 -0
- package/lib/plugins/opportunity-splits/index.e2e-spec.js.map +1 -0
- package/lib/plugins/opportunity-splits/index.js +117 -0
- package/lib/plugins/opportunity-splits/index.js.map +1 -0
- package/lib/plugins/opportunity-splits/pages/layout-selection.d.ts +8 -0
- package/lib/plugins/opportunity-splits/pages/layout-selection.js +15 -0
- package/lib/plugins/opportunity-splits/pages/layout-selection.js.map +1 -0
- package/lib/plugins/opportunity-splits/pages/overview.d.ts +11 -0
- package/lib/plugins/opportunity-splits/pages/overview.js +32 -0
- package/lib/plugins/opportunity-splits/pages/overview.js.map +1 -0
- package/lib/plugins/opportunity-splits/pages/setup.d.ts +9 -0
- package/lib/plugins/opportunity-splits/pages/setup.js +17 -0
- package/lib/plugins/opportunity-splits/pages/setup.js.map +1 -0
- package/lib/plugins/permission-sets/index.d.ts +10 -0
- package/lib/plugins/permission-sets/index.e2e-spec.d.ts +1 -0
- package/lib/plugins/permission-sets/index.e2e-spec.js +47 -0
- package/lib/plugins/permission-sets/index.e2e-spec.js.map +1 -0
- package/lib/plugins/permission-sets/index.js +22 -0
- package/lib/plugins/permission-sets/index.js.map +1 -0
- package/lib/plugins/permission-sets/service-presence-status/index.d.ts +10 -0
- package/lib/plugins/permission-sets/service-presence-status/index.js +124 -0
- package/lib/plugins/permission-sets/service-presence-status/index.js.map +1 -0
- package/lib/plugins/picklists/field-dependencies/index.d.ts +11 -0
- package/lib/plugins/picklists/field-dependencies/index.js +133 -0
- package/lib/plugins/picklists/field-dependencies/index.js.map +1 -0
- package/lib/plugins/picklists/field-dependencies/index.test.d.ts +1 -0
- package/lib/plugins/picklists/field-dependencies/index.test.js +64 -0
- package/lib/plugins/picklists/field-dependencies/index.test.js.map +1 -0
- package/lib/plugins/picklists/field-dependencies/pages.d.ts +15 -0
- package/lib/plugins/picklists/field-dependencies/pages.js +50 -0
- package/lib/plugins/picklists/field-dependencies/pages.js.map +1 -0
- package/lib/plugins/picklists/index.d.ts +23 -0
- package/lib/plugins/picklists/index.e2e-spec.d.ts +1 -0
- package/lib/plugins/picklists/index.e2e-spec.js +128 -0
- package/lib/plugins/picklists/index.e2e-spec.js.map +1 -0
- package/lib/plugins/picklists/index.js +229 -0
- package/lib/plugins/picklists/index.js.map +1 -0
- package/lib/plugins/picklists/pages.d.ts +45 -0
- package/lib/plugins/picklists/pages.js +185 -0
- package/lib/plugins/picklists/pages.js.map +1 -0
- package/lib/plugins/picklists/standard-value-set.d.ts +1 -0
- package/lib/plugins/picklists/standard-value-set.js +80 -0
- package/lib/plugins/picklists/standard-value-set.js.map +1 -0
- package/lib/plugins/record-types/index.d.ts +14 -0
- package/lib/plugins/record-types/index.e2e-spec.d.ts +1 -0
- package/lib/plugins/record-types/index.e2e-spec.js +76 -0
- package/lib/plugins/record-types/index.e2e-spec.js.map +1 -0
- package/lib/plugins/record-types/index.js +133 -0
- package/lib/plugins/record-types/index.js.map +1 -0
- package/lib/plugins/record-types/pages.d.ts +14 -0
- package/lib/plugins/record-types/pages.js +50 -0
- package/lib/plugins/record-types/pages.js.map +1 -0
- package/lib/plugins/relate-contact-to-multiple-accounts/index.d.ts +11 -0
- package/lib/plugins/relate-contact-to-multiple-accounts/index.e2e-spec.d.ts +1 -0
- package/lib/plugins/relate-contact-to-multiple-accounts/index.e2e-spec.js +30 -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 +120 -0
- package/lib/plugins/relate-contact-to-multiple-accounts/index.js.map +1 -0
- package/lib/plugins/reports-and-dashboards/folder-sharing/index.d.ts +8 -0
- package/lib/plugins/reports-and-dashboards/folder-sharing/index.e2e-spec.d.ts +1 -0
- 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 +116 -0
- package/lib/plugins/reports-and-dashboards/folder-sharing/index.js.map +1 -0
- package/lib/plugins/reports-and-dashboards/index.d.ts +11 -0
- package/lib/plugins/reports-and-dashboards/index.e2e-spec.d.ts +1 -0
- 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 +29 -0
- package/lib/plugins/reports-and-dashboards/index.js.map +1 -0
- package/lib/plugins/salesforce-cpq-config/formConfig.d.ts +17 -0
- package/lib/plugins/salesforce-cpq-config/formConfig.js +649 -0
- package/lib/plugins/salesforce-cpq-config/formConfig.js.map +1 -0
- package/lib/plugins/salesforce-cpq-config/index.d.ts +7 -0
- package/lib/plugins/salesforce-cpq-config/index.e2e-spec.d.ts +1 -0
- package/lib/plugins/salesforce-cpq-config/index.e2e-spec.js +37 -0
- package/lib/plugins/salesforce-cpq-config/index.e2e-spec.js.map +1 -0
- package/lib/plugins/salesforce-cpq-config/index.js +261 -0
- package/lib/plugins/salesforce-cpq-config/index.js.map +1 -0
- package/lib/plugins/salesforce-to-salesforce/index.d.ts +9 -0
- package/lib/plugins/salesforce-to-salesforce/index.e2e-spec.d.ts +1 -0
- package/lib/plugins/salesforce-to-salesforce/index.e2e-spec.js +34 -0
- package/lib/plugins/salesforce-to-salesforce/index.e2e-spec.js.map +1 -0
- package/lib/plugins/salesforce-to-salesforce/index.js +107 -0
- package/lib/plugins/salesforce-to-salesforce/index.js.map +1 -0
- package/lib/plugins/scheduled-batches/index.d.ts +10 -0
- package/lib/plugins/scheduled-batches/index.js +145 -0
- package/lib/plugins/scheduled-batches/index.js.map +1 -0
- package/lib/plugins/scheduled-batches/page.d.ts +19 -0
- package/lib/plugins/scheduled-batches/page.js +39 -0
- package/lib/plugins/scheduled-batches/page.js.map +1 -0
- package/lib/plugins/security/authentication-configuration/index.d.ts +15 -0
- package/lib/plugins/security/authentication-configuration/index.e2e-spec.d.ts +1 -0
- package/lib/plugins/security/authentication-configuration/index.e2e-spec.js +129 -0
- package/lib/plugins/security/authentication-configuration/index.e2e-spec.js.map +1 -0
- package/lib/plugins/security/authentication-configuration/index.js +200 -0
- package/lib/plugins/security/authentication-configuration/index.js.map +1 -0
- package/lib/plugins/security/certificate-and-key-management/index.d.ts +23 -0
- package/lib/plugins/security/certificate-and-key-management/index.e2e-spec.d.ts +1 -0
- package/lib/plugins/security/certificate-and-key-management/index.e2e-spec.js +59 -0
- package/lib/plugins/security/certificate-and-key-management/index.e2e-spec.js.map +1 -0
- package/lib/plugins/security/certificate-and-key-management/index.js +233 -0
- package/lib/plugins/security/certificate-and-key-management/index.js.map +1 -0
- package/lib/plugins/security/certificate-and-key-management/index.test.d.ts +1 -0
- package/lib/plugins/security/certificate-and-key-management/index.test.js +61 -0
- package/lib/plugins/security/certificate-and-key-management/index.test.js.map +1 -0
- package/lib/plugins/security/index.d.ts +13 -0
- package/lib/plugins/security/index.js +41 -0
- package/lib/plugins/security/index.js.map +1 -0
- package/lib/plugins/service-channels/capacity/index.d.ts +18 -0
- package/lib/plugins/service-channels/capacity/index.js +194 -0
- package/lib/plugins/service-channels/capacity/index.js.map +1 -0
- package/lib/plugins/service-channels/index.d.ts +12 -0
- package/lib/plugins/service-channels/index.e2e-spec.d.ts +1 -0
- package/lib/plugins/service-channels/index.e2e-spec.js +67 -0
- package/lib/plugins/service-channels/index.e2e-spec.js.map +1 -0
- package/lib/plugins/service-channels/index.js +37 -0
- package/lib/plugins/service-channels/index.js.map +1 -0
- package/lib/plugins/slack/index.d.ts +9 -0
- package/lib/plugins/slack/index.e2e-spec.d.ts +1 -0
- package/lib/plugins/slack/index.e2e-spec.js +47 -0
- package/lib/plugins/slack/index.e2e-spec.js.map +1 -0
- package/lib/plugins/slack/index.js +111 -0
- package/lib/plugins/slack/index.js.map +1 -0
- package/lib/plugins/user-access-policies/index.d.ts +19 -0
- package/lib/plugins/user-access-policies/index.e2e-spec.d.ts +1 -0
- package/lib/plugins/user-access-policies/index.e2e-spec.js +61 -0
- package/lib/plugins/user-access-policies/index.e2e-spec.js.map +1 -0
- package/lib/plugins/user-access-policies/index.js +176 -0
- package/lib/plugins/user-access-policies/index.js.map +1 -0
- package/lib/plugins/user-access-policies/page.d.ts +30 -0
- package/lib/plugins/user-access-policies/page.js +114 -0
- package/lib/plugins/user-access-policies/page.js.map +1 -0
- package/lib/plugins/utils.d.ts +13 -0
- package/lib/plugins/utils.js +159 -0
- package/lib/plugins/utils.js.map +1 -0
- package/oclif.manifest.json +177 -0
- package/package.json +65 -0
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
export class UserAccessPoliciesPage {
|
|
2
|
+
page;
|
|
3
|
+
constructor(page) {
|
|
4
|
+
this.page = page;
|
|
5
|
+
}
|
|
6
|
+
static getPolicyUrl(policyId) {
|
|
7
|
+
return `/lightning/setup/UserAccessPolicies/${policyId}/view`;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Activate a policy from its detail page
|
|
11
|
+
* @param triggerOn - When to trigger the policy: 'Create', 'Update', or 'CreateAndUpdate' (default)
|
|
12
|
+
*/
|
|
13
|
+
async activatePolicy(triggerOn = 'CreateAndUpdate') {
|
|
14
|
+
try {
|
|
15
|
+
const automateButton = this.page.getByRole('button', {
|
|
16
|
+
name: 'Automate Policy',
|
|
17
|
+
});
|
|
18
|
+
await automateButton.waitFor({ timeout: 5000 });
|
|
19
|
+
await this.waitForButtonEnabled(automateButton);
|
|
20
|
+
await automateButton.click();
|
|
21
|
+
await this.handleActivationModal(triggerOn);
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
throw new Error(`Failed to activate policy: ${error.message}`);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Deactivate a policy from its detail page
|
|
29
|
+
*/
|
|
30
|
+
async deactivatePolicy() {
|
|
31
|
+
try {
|
|
32
|
+
const deactivateButton = this.page.getByRole('button', {
|
|
33
|
+
name: 'Deactivate',
|
|
34
|
+
});
|
|
35
|
+
await deactivateButton.waitFor({ timeout: 5000 });
|
|
36
|
+
await deactivateButton.click();
|
|
37
|
+
await this.handleConfirmationModal();
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
throw new Error(`Failed to deactivate policy: ${error.message}`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Handle the activation modal (select trigger option and click Activate)
|
|
45
|
+
*/
|
|
46
|
+
async handleActivationModal(triggerOn) {
|
|
47
|
+
const modalHeader = this.page.locator('lightning-modal-header.automate_policy_modal');
|
|
48
|
+
await modalHeader.waitFor({ timeout: 10000 });
|
|
49
|
+
await this.page.waitForTimeout(500);
|
|
50
|
+
const radioButtons = this.page.locator('input[type="radio"]');
|
|
51
|
+
const radioCount = await radioButtons.count();
|
|
52
|
+
if (radioCount < 3) {
|
|
53
|
+
throw new Error('Modal did not load - radio buttons not found');
|
|
54
|
+
}
|
|
55
|
+
let radioButton = null;
|
|
56
|
+
for (let i = 0; i < radioCount; i++) {
|
|
57
|
+
const button = radioButtons.nth(i);
|
|
58
|
+
const value = await button.getAttribute('value');
|
|
59
|
+
if (value === triggerOn) {
|
|
60
|
+
radioButton = button;
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
if (!radioButton) {
|
|
65
|
+
throw new Error(`Radio button with value "${triggerOn}" not found`);
|
|
66
|
+
}
|
|
67
|
+
const radioId = await radioButton.getAttribute('id');
|
|
68
|
+
if (radioId) {
|
|
69
|
+
const label = this.page.locator(`label[for="${radioId}"]`);
|
|
70
|
+
await label.click();
|
|
71
|
+
}
|
|
72
|
+
const activateButton = this.page.getByRole('button', {
|
|
73
|
+
name: 'Activate',
|
|
74
|
+
exact: true,
|
|
75
|
+
});
|
|
76
|
+
await activateButton.waitFor({ timeout: 5000 });
|
|
77
|
+
await activateButton.click();
|
|
78
|
+
// TODO: use a better indicator
|
|
79
|
+
await this.page.waitForTimeout(1000);
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Handle confirmation modal that may appear after deactivation
|
|
83
|
+
*/
|
|
84
|
+
async handleConfirmationModal() {
|
|
85
|
+
try {
|
|
86
|
+
await this.page.waitForTimeout(500);
|
|
87
|
+
const deactivateButton = this.page.locator('lightning-modal-footer button:has-text("Deactivate")');
|
|
88
|
+
await deactivateButton.waitFor({ timeout: 5000 });
|
|
89
|
+
await deactivateButton.click();
|
|
90
|
+
// TODO: use a better indicator
|
|
91
|
+
await this.page.waitForTimeout(1000);
|
|
92
|
+
}
|
|
93
|
+
catch (e) {
|
|
94
|
+
throw new Error(`Failed to handle deactivation confirmation modal: ${e.message}`);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Wait for a button to become enabled
|
|
99
|
+
* @param button - The button locator to wait for
|
|
100
|
+
* @param timeout - Maximum time to wait in milliseconds (default: 10000)
|
|
101
|
+
*/
|
|
102
|
+
async waitForButtonEnabled(button, timeout = 10000) {
|
|
103
|
+
const startTime = Date.now();
|
|
104
|
+
while (Date.now() - startTime < timeout) {
|
|
105
|
+
const isDisabled = await button.isDisabled();
|
|
106
|
+
if (!isDisabled) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
await this.page.waitForTimeout(500);
|
|
110
|
+
}
|
|
111
|
+
throw new Error(`Button did not become enabled within ${timeout}ms`);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=page.js.map
|
|
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AG,OAAO,EAAE,CAAC;YACxC,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,UAAU,EAAE,CAAC;YAE7C,IAAI,CAAC,UAAU,EAAE,CAAC;gBAChB,OAAO;YACT,CAAC;YAED,MAAM,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;QACtC,CAAC;QAED,MAAM,IAAI,KAAK,CAAC,wCAAwC,OAAO,IAAI,CAAC,CAAC;IACvE,CAAC;CACF"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare function semanticallyCleanObject<T extends unknown>(obj: T, id?: string): T | undefined;
|
|
2
|
+
export declare function isEmptyObjectOrArray(arg: unknown): boolean;
|
|
3
|
+
export declare function deepDiff<T extends unknown>(source: T | undefined, target: T | undefined): T | undefined;
|
|
4
|
+
/**
|
|
5
|
+
* Masks sensitive values in an object for safe logging
|
|
6
|
+
* Fields matching patterns like "secret", "password", "key", "token", etc. will be masked
|
|
7
|
+
* Additionally, fields marked as type "password" in the schema will be masked
|
|
8
|
+
* @param value The value to mask (can be object, array, or primitive)
|
|
9
|
+
* @param keyPath The current key path (for nested objects)
|
|
10
|
+
* @param schema Optional JSON schema to check for password type fields
|
|
11
|
+
* @returns Masked value safe for logging
|
|
12
|
+
*/
|
|
13
|
+
export declare function maskSensitiveValues(value: unknown, keyPath?: string, schema?: unknown): unknown;
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { isDeepStrictEqual } from 'util';
|
|
2
|
+
// an object only containing an id is semantically empty
|
|
3
|
+
export function semanticallyCleanObject(obj, id = 'id') {
|
|
4
|
+
if (typeof obj === 'object' && obj !== null) {
|
|
5
|
+
if (Object.keys(obj).length === 1 && Object.keys(obj)[0] === id) {
|
|
6
|
+
return undefined;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
return obj;
|
|
10
|
+
}
|
|
11
|
+
export function isEmptyObjectOrArray(arg) {
|
|
12
|
+
if (typeof arg === 'object' && arg !== null) {
|
|
13
|
+
return Object.keys(arg).length === 0;
|
|
14
|
+
}
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
export function deepDiff(source, target) {
|
|
18
|
+
if (isDeepStrictEqual(source, target)) {
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
if (typeof target === 'object' && target !== null && typeof source === 'object' && source !== null) {
|
|
22
|
+
let objectOrArray;
|
|
23
|
+
if (Array.isArray(target)) {
|
|
24
|
+
objectOrArray = target.map((item, i) => deepDiff(source?.[i], item)).filter((x) => x !== undefined);
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
const targetKeys = Object.keys(target);
|
|
28
|
+
const minSource = Object.fromEntries(Object.entries(source).filter(([key, value]) => targetKeys.includes(key)));
|
|
29
|
+
if (!isDeepStrictEqual(minSource, source)) {
|
|
30
|
+
return deepDiff(minSource, target);
|
|
31
|
+
}
|
|
32
|
+
objectOrArray = target;
|
|
33
|
+
}
|
|
34
|
+
if (isEmptyObjectOrArray(objectOrArray)) {
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
37
|
+
return objectOrArray;
|
|
38
|
+
}
|
|
39
|
+
// simple value
|
|
40
|
+
return target;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Extracts password field names from a JSON schema
|
|
44
|
+
* @param schema The JSON schema object
|
|
45
|
+
* @param prefix The current path prefix (for nested schemas)
|
|
46
|
+
* @returns Set of field paths that are marked as password type
|
|
47
|
+
*/
|
|
48
|
+
function extractPasswordFields(schema, prefix = '') {
|
|
49
|
+
const passwordFields = new Set();
|
|
50
|
+
if (typeof schema !== 'object' || schema === null) {
|
|
51
|
+
return passwordFields;
|
|
52
|
+
}
|
|
53
|
+
const schemaObj = schema;
|
|
54
|
+
// Check if this schema object is marked as password using x-password property
|
|
55
|
+
if (schemaObj['x-password'] === true) {
|
|
56
|
+
if (prefix) {
|
|
57
|
+
passwordFields.add(prefix);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
// Handle patternProperties (for dynamic keys like auth-providers)
|
|
61
|
+
if (schemaObj.patternProperties && typeof schemaObj.patternProperties === 'object') {
|
|
62
|
+
const patternProps = schemaObj.patternProperties;
|
|
63
|
+
for (const subSchema of Object.values(patternProps)) {
|
|
64
|
+
const subPasswordFields = extractPasswordFields(subSchema, prefix);
|
|
65
|
+
subPasswordFields.forEach((field) => passwordFields.add(field));
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
// Handle properties (for fixed keys)
|
|
69
|
+
if (schemaObj.properties && typeof schemaObj.properties === 'object') {
|
|
70
|
+
const properties = schemaObj.properties;
|
|
71
|
+
for (const [key, propSchema] of Object.entries(properties)) {
|
|
72
|
+
const currentPath = prefix ? `${prefix}.${key}` : key;
|
|
73
|
+
const propPasswordFields = extractPasswordFields(propSchema, currentPath);
|
|
74
|
+
propPasswordFields.forEach((field) => passwordFields.add(field));
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return passwordFields;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Checks if a field path matches any password field from the schema
|
|
81
|
+
* @param fieldPath The field path to check (e.g., "consumerSecret" or "test.consumerSecret")
|
|
82
|
+
* @param passwordFields Set of password field paths from schema
|
|
83
|
+
* @returns True if the field should be masked
|
|
84
|
+
*/
|
|
85
|
+
function isPasswordField(fieldPath, passwordFields) {
|
|
86
|
+
// Check exact match
|
|
87
|
+
if (passwordFields.has(fieldPath)) {
|
|
88
|
+
return true;
|
|
89
|
+
}
|
|
90
|
+
// Check if any password field is a suffix of the current path
|
|
91
|
+
// e.g., if schema has "consumerSecret" and path is "test.consumerSecret"
|
|
92
|
+
const passwordFieldsArray = Array.from(passwordFields);
|
|
93
|
+
for (const passwordField of passwordFieldsArray) {
|
|
94
|
+
if (fieldPath.endsWith(`.${passwordField}`) || fieldPath === passwordField) {
|
|
95
|
+
return true;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Masks sensitive values in an object for safe logging
|
|
102
|
+
* Fields matching patterns like "secret", "password", "key", "token", etc. will be masked
|
|
103
|
+
* Additionally, fields marked as type "password" in the schema will be masked
|
|
104
|
+
* @param value The value to mask (can be object, array, or primitive)
|
|
105
|
+
* @param keyPath The current key path (for nested objects)
|
|
106
|
+
* @param schema Optional JSON schema to check for password type fields
|
|
107
|
+
* @returns Masked value safe for logging
|
|
108
|
+
*/
|
|
109
|
+
export function maskSensitiveValues(value, keyPath = '', schema) {
|
|
110
|
+
// Extract password fields from schema if provided
|
|
111
|
+
const passwordFields = schema ? extractPasswordFields(schema) : new Set();
|
|
112
|
+
// List of patterns that indicate sensitive fields (fallback for when schema is not available)
|
|
113
|
+
const sensitivePatterns = [
|
|
114
|
+
/secret/i,
|
|
115
|
+
/password/i,
|
|
116
|
+
/token/i,
|
|
117
|
+
/key/i,
|
|
118
|
+
/credential/i,
|
|
119
|
+
/auth/i,
|
|
120
|
+
/api[_-]?key/i,
|
|
121
|
+
/access[_-]?token/i,
|
|
122
|
+
];
|
|
123
|
+
const isSensitiveField = (key) => {
|
|
124
|
+
// First check schema-based password fields
|
|
125
|
+
if (passwordFields.size > 0 && isPasswordField(key, passwordFields)) {
|
|
126
|
+
return true;
|
|
127
|
+
}
|
|
128
|
+
// Fallback to pattern matching
|
|
129
|
+
return sensitivePatterns.some((pattern) => pattern.test(key));
|
|
130
|
+
};
|
|
131
|
+
if (value === null || value === undefined) {
|
|
132
|
+
return {};
|
|
133
|
+
}
|
|
134
|
+
// If it's a string and we're in a sensitive field context, mask it
|
|
135
|
+
if (typeof value === 'string' && keyPath && isSensitiveField(keyPath)) {
|
|
136
|
+
return '****';
|
|
137
|
+
}
|
|
138
|
+
// If it's an object, recursively mask nested values
|
|
139
|
+
if (typeof value === 'object') {
|
|
140
|
+
if (Array.isArray(value)) {
|
|
141
|
+
return value.map((item, index) => maskSensitiveValues(item, `${keyPath}[${index}]`, schema));
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
const masked = {};
|
|
145
|
+
for (const [key, val] of Object.entries(value)) {
|
|
146
|
+
const currentPath = keyPath ? `${keyPath}.${key}` : key;
|
|
147
|
+
if (isSensitiveField(key) && typeof val === 'string' && val.length > 0) {
|
|
148
|
+
masked[key] = '****';
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
masked[key] = maskSensitiveValues(val, currentPath, schema);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return masked;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
return value;
|
|
158
|
+
}
|
|
159
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/plugins/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAEzC,wDAAwD;AACxD,MAAM,UAAU,uBAAuB,CAAoB,GAAM,EAAE,EAAE,GAAG,IAAI;IAC1E,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;QAC5C,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,KAAK,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC;YAChE,OAAO,SAAS,CAAC;QACnB,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,GAAY;IAC/C,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;QAC5C,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC;IACvC,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,QAAQ,CAAoB,MAAqB,EA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C,GAAG,mBAAmB,CAAC,GAAG,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;gBAC9D,CAAC;YACH,CAAC;YACD,OAAO,MAAM,CAAC;QAChB,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
{
|
|
2
|
+
"commands": {
|
|
3
|
+
"browserforce:apply": {
|
|
4
|
+
"aliases": [],
|
|
5
|
+
"args": {},
|
|
6
|
+
"description": "apply a plan from a config file",
|
|
7
|
+
"examples": [
|
|
8
|
+
"$ <%= config.bin %> <%= command.id %> -f ./config/currency.json --target-org myOrg@example.com\n logging in... done\n Applying config file ./config/currency.json to org myOrg@example.com\n [CompanyInformation] retrieving state... done\n [CompanyInformation] changing 'defaultCurrencyIsoCode' to '\"English (South Africa) - ZAR\"'... done\n logging out... done\n "
|
|
9
|
+
],
|
|
10
|
+
"flags": {
|
|
11
|
+
"json": {
|
|
12
|
+
"description": "Format output as json.",
|
|
13
|
+
"helpGroup": "GLOBAL",
|
|
14
|
+
"name": "json",
|
|
15
|
+
"allowNo": false,
|
|
16
|
+
"type": "boolean"
|
|
17
|
+
},
|
|
18
|
+
"flags-dir": {
|
|
19
|
+
"helpGroup": "GLOBAL",
|
|
20
|
+
"name": "flags-dir",
|
|
21
|
+
"summary": "Import flag values from a directory.",
|
|
22
|
+
"hasDynamicHelp": false,
|
|
23
|
+
"multiple": false,
|
|
24
|
+
"type": "option"
|
|
25
|
+
},
|
|
26
|
+
"target-org": {
|
|
27
|
+
"char": "o",
|
|
28
|
+
"name": "target-org",
|
|
29
|
+
"noCacheDefault": true,
|
|
30
|
+
"required": true,
|
|
31
|
+
"summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
|
|
32
|
+
"hasDynamicHelp": true,
|
|
33
|
+
"multiple": false,
|
|
34
|
+
"type": "option"
|
|
35
|
+
},
|
|
36
|
+
"definitionfile": {
|
|
37
|
+
"char": "f",
|
|
38
|
+
"name": "definitionfile",
|
|
39
|
+
"summary": "path to a browserforce config file",
|
|
40
|
+
"hasDynamicHelp": false,
|
|
41
|
+
"multiple": false,
|
|
42
|
+
"type": "option"
|
|
43
|
+
},
|
|
44
|
+
"dry-run": {
|
|
45
|
+
"char": "d",
|
|
46
|
+
"description": "Retrieve the config and show the diff, but don't apply it.",
|
|
47
|
+
"env": "BROWSERFORCE_DRY_RUN",
|
|
48
|
+
"name": "dry-run",
|
|
49
|
+
"summary": "dry run",
|
|
50
|
+
"allowNo": false,
|
|
51
|
+
"type": "boolean"
|
|
52
|
+
},
|
|
53
|
+
"headless": {
|
|
54
|
+
"env": "BROWSERFORCE_HEADLESS",
|
|
55
|
+
"helpGroup": "Browser Configuration",
|
|
56
|
+
"name": "headless",
|
|
57
|
+
"summary": "run in headless mode (default: true)",
|
|
58
|
+
"allowNo": true,
|
|
59
|
+
"type": "boolean"
|
|
60
|
+
},
|
|
61
|
+
"slow-mo": {
|
|
62
|
+
"env": "BROWSERFORCE_SLOWMO",
|
|
63
|
+
"helpGroup": "Browser Configuration",
|
|
64
|
+
"name": "slow-mo",
|
|
65
|
+
"summary": "slow motion in milliseconds (default: 0)",
|
|
66
|
+
"default": 0,
|
|
67
|
+
"hasDynamicHelp": false,
|
|
68
|
+
"multiple": false,
|
|
69
|
+
"type": "option"
|
|
70
|
+
},
|
|
71
|
+
"timeout": {
|
|
72
|
+
"env": "BROWSERFORCE_NAVIGATION_TIMEOUT_MS",
|
|
73
|
+
"helpGroup": "Browser Configuration",
|
|
74
|
+
"name": "timeout",
|
|
75
|
+
"summary": "the default navigation timeout in milliseconds",
|
|
76
|
+
"default": 90000,
|
|
77
|
+
"hasDynamicHelp": false,
|
|
78
|
+
"multiple": false,
|
|
79
|
+
"type": "option"
|
|
80
|
+
},
|
|
81
|
+
"trace": {
|
|
82
|
+
"description": "The trace file can be viewed with \"sf browserforce playwright -- show-trace trace-<date>.zip\".",
|
|
83
|
+
"env": "BROWSERFORCE_TRACE",
|
|
84
|
+
"helpGroup": "Browser Configuration",
|
|
85
|
+
"name": "trace",
|
|
86
|
+
"summary": "create a Playwright trace file",
|
|
87
|
+
"allowNo": false,
|
|
88
|
+
"type": "boolean"
|
|
89
|
+
},
|
|
90
|
+
"browser-executable-path": {
|
|
91
|
+
"description": "Note: The environment variable CHROME_BIN can also be used. On GitHub Actions with ubuntu-latest, CHROME_BIN is set to /usr/bin/google-chrome.",
|
|
92
|
+
"env": "BROWSERFORCE_BROWSER_EXECUTABLE_PATH",
|
|
93
|
+
"helpGroup": "Browser Configuration",
|
|
94
|
+
"name": "browser-executable-path",
|
|
95
|
+
"summary": "the path to a browser executable",
|
|
96
|
+
"default": "/usr/bin/google-chrome",
|
|
97
|
+
"hasDynamicHelp": false,
|
|
98
|
+
"multiple": false,
|
|
99
|
+
"type": "option"
|
|
100
|
+
},
|
|
101
|
+
"browser-channel": {
|
|
102
|
+
"description": "Playwright will try to figure out the path to the browser executable automatically.",
|
|
103
|
+
"env": "BROWSERFORCE_BROWSER_CHANNEL",
|
|
104
|
+
"helpGroup": "Browser Configuration",
|
|
105
|
+
"name": "browser-channel",
|
|
106
|
+
"summary": "the channel (e.g. chromium or chrome) to use",
|
|
107
|
+
"hasDynamicHelp": false,
|
|
108
|
+
"multiple": false,
|
|
109
|
+
"type": "option"
|
|
110
|
+
},
|
|
111
|
+
"max-retries": {
|
|
112
|
+
"env": "BROWSERFORCE_RETRY_MAX_RETRIES",
|
|
113
|
+
"helpGroup": "Retry Configuration",
|
|
114
|
+
"name": "max-retries",
|
|
115
|
+
"summary": "the maximum number of retries for retryable actions",
|
|
116
|
+
"default": 6,
|
|
117
|
+
"hasDynamicHelp": false,
|
|
118
|
+
"multiple": false,
|
|
119
|
+
"type": "option"
|
|
120
|
+
},
|
|
121
|
+
"retry-timeout": {
|
|
122
|
+
"env": "BROWSERFORCE_RETRY_TIMEOUT_MS",
|
|
123
|
+
"helpGroup": "Retry Configuration",
|
|
124
|
+
"name": "retry-timeout",
|
|
125
|
+
"summary": "the inital timeout in milliseconds for retryable actions (exponentially increased)",
|
|
126
|
+
"default": 4000,
|
|
127
|
+
"hasDynamicHelp": false,
|
|
128
|
+
"multiple": false,
|
|
129
|
+
"type": "option"
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
"hasDynamicHelp": true,
|
|
133
|
+
"hiddenAliases": [],
|
|
134
|
+
"id": "browserforce:apply",
|
|
135
|
+
"pluginAlias": "sf-browserforce",
|
|
136
|
+
"pluginName": "sf-browserforce",
|
|
137
|
+
"pluginType": "core",
|
|
138
|
+
"strict": true,
|
|
139
|
+
"enableJsonFlag": true,
|
|
140
|
+
"isESM": true,
|
|
141
|
+
"relativePath": [
|
|
142
|
+
"lib",
|
|
143
|
+
"commands",
|
|
144
|
+
"browserforce",
|
|
145
|
+
"apply.js"
|
|
146
|
+
]
|
|
147
|
+
},
|
|
148
|
+
"browserforce:playwright": {
|
|
149
|
+
"aliases": [],
|
|
150
|
+
"args": {},
|
|
151
|
+
"description": "access the Playwright CLI",
|
|
152
|
+
"examples": [
|
|
153
|
+
"$ <%= config.bin %> <%= command.id %> -- --help",
|
|
154
|
+
"$ <%= config.bin %> <%= command.id %> -- --version",
|
|
155
|
+
"$ <%= config.bin %> <%= command.id %> -- install --list",
|
|
156
|
+
"$ <%= config.bin %> <%= command.id %> -- install chromium"
|
|
157
|
+
],
|
|
158
|
+
"flags": {},
|
|
159
|
+
"hasDynamicHelp": false,
|
|
160
|
+
"hiddenAliases": [],
|
|
161
|
+
"id": "browserforce:playwright",
|
|
162
|
+
"pluginAlias": "sf-browserforce",
|
|
163
|
+
"pluginName": "sf-browserforce",
|
|
164
|
+
"pluginType": "core",
|
|
165
|
+
"strict": false,
|
|
166
|
+
"enableJsonFlag": false,
|
|
167
|
+
"isESM": true,
|
|
168
|
+
"relativePath": [
|
|
169
|
+
"lib",
|
|
170
|
+
"commands",
|
|
171
|
+
"browserforce",
|
|
172
|
+
"playwright.js"
|
|
173
|
+
]
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
"version": "1.0.0"
|
|
177
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "sf-browserforce",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "sfdx plugin for browser automation",
|
|
5
|
+
"author": "Rupesh J <j.rupesh@gmail.com>",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"dependencies": {
|
|
8
|
+
"@mdapi-issues/listmetadata-standardvalueset": "3.1.0",
|
|
9
|
+
"@salesforce/sf-plugins-core": "12.2.6",
|
|
10
|
+
"p-retry": "7.1.1",
|
|
11
|
+
"playwright": "1.58.0"
|
|
12
|
+
},
|
|
13
|
+
"devDependencies": {
|
|
14
|
+
"@salesforce/dev-scripts": "11.0.4",
|
|
15
|
+
"oclif": "4.22.70",
|
|
16
|
+
"prettier": "3.8.1",
|
|
17
|
+
"typescript": "*"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"/bin",
|
|
21
|
+
"/lib",
|
|
22
|
+
"/oclif.manifest.json"
|
|
23
|
+
],
|
|
24
|
+
"keywords": [
|
|
25
|
+
"salesforce",
|
|
26
|
+
"sfdx",
|
|
27
|
+
"sfdx-plugin",
|
|
28
|
+
"sf",
|
|
29
|
+
"sf-plugin"
|
|
30
|
+
],
|
|
31
|
+
"license": "MIT",
|
|
32
|
+
"oclif": {
|
|
33
|
+
"bin": "sf",
|
|
34
|
+
"topicSeparator": " ",
|
|
35
|
+
"commands": "./lib/commands",
|
|
36
|
+
"topics": {
|
|
37
|
+
"browserforce": {
|
|
38
|
+
"description": "browser automation for Salesforce setup pages"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"additionalHelpFlags": [
|
|
42
|
+
"-h"
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
"mocha": {
|
|
46
|
+
"loader": "ts-node/esm",
|
|
47
|
+
"no-warnings": "ExperimentalWarning",
|
|
48
|
+
"enable-source-maps": true
|
|
49
|
+
},
|
|
50
|
+
"repository": {
|
|
51
|
+
"type": "git",
|
|
52
|
+
"url": "git+https://github.com/jrupesh/sfdx-browserforce-plugin.git"
|
|
53
|
+
},
|
|
54
|
+
"scripts": {
|
|
55
|
+
"build": "rm -rf lib && tsc -p . && oclif manifest && oclif readme",
|
|
56
|
+
"develop": "bash scripts/develop.sh",
|
|
57
|
+
"format": "npx prettier --write \"+(src|test)/**/*.+(ts|js|json)\"",
|
|
58
|
+
"generate:plugin": "npx --yes hygen plugin new",
|
|
59
|
+
"prepack": "npm run build",
|
|
60
|
+
"prepare": "npm run build",
|
|
61
|
+
"test": "tsc -p test && nyc --reporter=lcov --reporter=text mocha \"test/**/*.test.ts\" \"src/**/*.test.ts\"",
|
|
62
|
+
"test:e2e": "tsc -p test && mocha --slow 30s --timeout 2m --file test/e2e-setup.ts \"test/**/*.e2e-spec.ts\" \"src/**/*.e2e-spec.ts\"",
|
|
63
|
+
"test:format": "npx prettier --check \"+(src|test)/**/*.+(ts|js|json)\""
|
|
64
|
+
}
|
|
65
|
+
}
|