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,80 @@
|
|
|
1
|
+
import { MAPPING as STANDARDVALUESET_MAPPING } from '@mdapi-issues/listmetadata-standardvalueset';
|
|
2
|
+
const editUrl = (id, type) => `/_ui/common/config/field/StandardFieldAttributes/d?id=${id}&type=${type}`;
|
|
3
|
+
const editUrlMasterDetail = (tid, pt) => `/setup/ui/picklist_masterdetail.jsp?tid=${tid}&pt=${pt}`;
|
|
4
|
+
const mapping = {
|
|
5
|
+
AccountContactMultiRoles: editUrl('Roles', 'AccountContactRelation'),
|
|
6
|
+
AccountContactRole: editUrlMasterDetail('02Z', '38'),
|
|
7
|
+
AccountOwnership: editUrl('Ownership', 'Account'),
|
|
8
|
+
AccountRating: editUrl('Rating', 'Account'),
|
|
9
|
+
AccountType: editUrl('Type', 'Account'),
|
|
10
|
+
AssetStatus: editUrl('Status', 'Asset'),
|
|
11
|
+
CampaignMemberStatus: editUrl('Status', 'CampaignMember'),
|
|
12
|
+
CampaignStatus: editUrl('Status', 'Campaign'),
|
|
13
|
+
CampaignType: editUrl('Type', 'Campaign'),
|
|
14
|
+
CareItemStatus2: '',
|
|
15
|
+
CaseContactRole: editUrlMasterDetail('03j', '45'),
|
|
16
|
+
CaseOrigin: editUrl('Origin', 'Case'),
|
|
17
|
+
CasePriority: editUrl('Priority', 'Case'),
|
|
18
|
+
CaseReason: editUrl('Reason', 'Case'),
|
|
19
|
+
CaseStatus: editUrl('Status', 'Case'),
|
|
20
|
+
CaseType: editUrl('Type', 'Case'),
|
|
21
|
+
ContactRole: editUrlMasterDetail('00K', '11'),
|
|
22
|
+
ContractContactRole: editUrlMasterDetail('021', '39'),
|
|
23
|
+
ContractStatus: editUrl('Status', 'Contract'),
|
|
24
|
+
EntitlementType: editUrl('Type', 'Entitlement'),
|
|
25
|
+
EventSubject: editUrl('Subject', 'Event'),
|
|
26
|
+
EventType: editUrl('Type', 'Event'),
|
|
27
|
+
FiscalYearPeriodName: '',
|
|
28
|
+
FiscalYearPeriodPrefix: '',
|
|
29
|
+
FiscalYearQuarterName: '',
|
|
30
|
+
FiscalYearQuarterPrefix: '',
|
|
31
|
+
ForecastCategoryName: editUrl('ForecastCategoryName', 'Opportunity'),
|
|
32
|
+
IdeaMultiCategory: editUrl('Categories', 'Idea'),
|
|
33
|
+
IdeaStatus: editUrl('Status', 'Idea'),
|
|
34
|
+
IdeaThemeStatus: editUrl('Status', 'IdeaTheme'),
|
|
35
|
+
Industry: editUrl('Industry', 'Lead'),
|
|
36
|
+
LeadSource: editUrl('LeadSource', 'Lead'),
|
|
37
|
+
LeadStatus: editUrl('Status', 'Lead'),
|
|
38
|
+
OpportunityCompetitor: editUrlMasterDetail('00J', '35'),
|
|
39
|
+
OpportunityStage: editUrl('StageName', 'Opportunity'),
|
|
40
|
+
OpportunityType: editUrl('Type', 'Opportunity'),
|
|
41
|
+
OrderType: editUrl('Type', 'Order'),
|
|
42
|
+
PartnerRole: editUrlMasterDetail('00I', '17'),
|
|
43
|
+
Product2Family: editUrl('Family', 'Product2'),
|
|
44
|
+
QuickTextCategory: editUrl('Category', 'QuickText'),
|
|
45
|
+
QuickTextChannel: editUrl('Channel', 'QuickText'),
|
|
46
|
+
QuoteStatus: editUrl('Status', 'Quote'),
|
|
47
|
+
RoleInTerritory2: '',
|
|
48
|
+
ResourceAbsenceType: editUrl('Type', 'ResourceAbsence'),
|
|
49
|
+
SalesTeamRole: editUrl('TeamMemberRole', 'OpportunityTeamMember'),
|
|
50
|
+
Salutation: editUrlMasterDetail('003', '8'),
|
|
51
|
+
ServiceAppointmentStatus: editUrl('Status', 'ServiceAppointment'),
|
|
52
|
+
ServiceContractApprovalStatus: editUrl('ApprovalStatus', 'ServiceContract'),
|
|
53
|
+
ServTerrMemRoleType: '',
|
|
54
|
+
SocialPostClassification: '',
|
|
55
|
+
SocialPostEngagementLevel: '',
|
|
56
|
+
SocialPostReviewedStatus: '',
|
|
57
|
+
SolutionStatus: editUrl('Status', 'Solution'),
|
|
58
|
+
TaskPriority: editUrl('Priority', 'Task'),
|
|
59
|
+
TaskStatus: editUrl('Status', 'Task'),
|
|
60
|
+
TaskSubject: editUrl('Subject', 'Task'),
|
|
61
|
+
TaskType: editUrl('Type', 'Task'),
|
|
62
|
+
WorkOrderLineItemStatus: editUrl('Status', 'WorkOrderLineItem'),
|
|
63
|
+
WorkOrderPriority: editUrl('Priority', 'WorkOrder'),
|
|
64
|
+
WorkOrderStatus: editUrl('Status', 'WorkOrder'),
|
|
65
|
+
WorkTypeDefApptType: '',
|
|
66
|
+
WorkTypeGroupAddInfo: '',
|
|
67
|
+
};
|
|
68
|
+
export function determineStandardValueSetEditUrl(standardValueSet) {
|
|
69
|
+
if (mapping[standardValueSet] !== '') {
|
|
70
|
+
return mapping[standardValueSet];
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
const standardField = Object.keys(STANDARDVALUESET_MAPPING).find((key) => STANDARDVALUESET_MAPPING[key] === standardValueSet);
|
|
74
|
+
if (!standardField) {
|
|
75
|
+
throw new Error(`Could not determine Edit URL for StandardValueSet:${standardValueSet}`);
|
|
76
|
+
}
|
|
77
|
+
return editUrl(standardValueSet, standardField.split('.')[0]);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=standard-value-set.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"standard-value-set.js","sourceRoot":"","sources":["../../../src/plugins/picklists/standard-value-set.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,6CAA6C,CAAC;AAElG,MAAM,OAAO,GAAG,CAAC,EAAU,EAAE,IAAY,EAAE,EAAE,CAC3C,yDAAyD,EAAE,SAAS,IAAI,EAAE,CAAC;AAC7E,MAAM,mBAAmB,GAAG,CAAC,GAAW,EAAE,EAAU,EAAE,EAAE,CAAC,2CAA2C,GAAG,OAAO,EAAE,EAAE,CAAC;AAEnH,MAAM,OAAO,GAAG;IACd,wBAAwB,EAAE,OAAO,CAAC,OAAO,EAAE,wBAAwB,CAAC;IACpE,kBAAkB,EAAE,mBAAmB,CAAC,KAAK,EAAE,IAAI,CAAC;IACpD,gBAAgB,EAAE,OAAO,CAAC,WAAW,EAAE,SAAS,CAAC;IACjD,aAAa,EAAE,OAAO,CAAC,QAAQ,EAAE,SAAS,CAAC;IAC3C,WAAW,EAAE,OAAO,CAAC,MAAM,EAAE,SAAS,CAAC;IACvC,WAAW,EAAE,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC;IACvC,oBAAoB,EAAE,OAAO,CAAC,QAAQ,EAAE,gBAAgB,CAAC;IACzD,cAAc,EAAE,OAAO,CAAC,QAAQ,EAAE,UAAU,CAAC;IAC7C,YAAY,EAAE,OAAO,CAAC,MAAM,EAAE,UAAU,CAAC;IACzC,eAAe,EAAE,EAAE;IACnB,eAAe,EAAE,mBAAmB,CAAC,KAAK,EAAE,IAAI,CAAC;IACjD,UAAU,EAAE,OAAO,CAAC,QAAQ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AC;IAC/C,mBAAmB,EAAE,EAAE;IACvB,oBAAoB,EAAE,EAAE;CACzB,CAAC;AAEF,MAAM,UAAU,gCAAgC,CAAC,gBAAwB;IACvE,IAAI,OAAO,CAAC,gBAAgB,CAAC,KAAK,EAAE,EAAE,CAAC;QACrC,OAAO,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACnC,CAAC;SAAM,CAAC;QACN,MAAM,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC,IAAI,CAC9D,CAAC,GAAG,EAAE,EAAE,CAAC,wBAAwB,CAAC,GAAG,CAAC,KAAK,gBAAgB,CAC5D,CAAC;QACF,IAAI,CAAC,aAAa,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CAAC,qDAAqD,gBAAgB,EAAE,CAAC,CAAC;QAC3F,CAAC;QACD,OAAO,OAAO,CAAC,gBAAgB,EAAE,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAChE,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BrowserforcePlugin } from '../../plugin.js';
|
|
2
|
+
type Config = {
|
|
3
|
+
deletions: RecordTypeConfig[];
|
|
4
|
+
};
|
|
5
|
+
type RecordTypeConfig = {
|
|
6
|
+
fullName: string;
|
|
7
|
+
replacement?: string;
|
|
8
|
+
};
|
|
9
|
+
export declare class RecordTypes extends BrowserforcePlugin {
|
|
10
|
+
retrieve(definition: Config): Promise<Config>;
|
|
11
|
+
diff(source: Config, target: Config): Partial<Config> | undefined;
|
|
12
|
+
apply(config: Config): Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,76 @@
|
|
|
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 { RecordTypes } from './index.js';
|
|
6
|
+
const __dirname = fileURLToPath(new URL('.', import.meta.url));
|
|
7
|
+
describe(RecordTypes.name, function () {
|
|
8
|
+
this.timeout('10m');
|
|
9
|
+
let plugin;
|
|
10
|
+
before(() => {
|
|
11
|
+
plugin = new RecordTypes(global.browserforce);
|
|
12
|
+
});
|
|
13
|
+
const configDelete = {
|
|
14
|
+
deletions: [
|
|
15
|
+
{
|
|
16
|
+
fullName: 'Vehicle__c.SUV',
|
|
17
|
+
},
|
|
18
|
+
],
|
|
19
|
+
};
|
|
20
|
+
const configDeleteActive = {
|
|
21
|
+
deletions: [
|
|
22
|
+
{
|
|
23
|
+
fullName: 'Vehicle__c.CUV',
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
};
|
|
27
|
+
const configDeleteAndReplace = {
|
|
28
|
+
deletions: [
|
|
29
|
+
{
|
|
30
|
+
fullName: 'Vehicle__c.SportsCar',
|
|
31
|
+
replacement: 'Vehicle__c.Bicycle',
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
};
|
|
35
|
+
it('should deploy a CustomObject for testing', () => {
|
|
36
|
+
const sourceDeployCmd = child.spawnSync('sf', [
|
|
37
|
+
'project',
|
|
38
|
+
'deploy',
|
|
39
|
+
'start',
|
|
40
|
+
'-d',
|
|
41
|
+
path.join(__dirname, 'sfdx-source'),
|
|
42
|
+
'--json',
|
|
43
|
+
]);
|
|
44
|
+
assert.deepStrictEqual(sourceDeployCmd.status, 0, sourceDeployCmd.output.toString());
|
|
45
|
+
});
|
|
46
|
+
it('should delete a record type', async () => {
|
|
47
|
+
await plugin.run(configDelete);
|
|
48
|
+
});
|
|
49
|
+
it('should not do anything when the record type does not exist', async () => {
|
|
50
|
+
const res = await plugin.run(configDelete);
|
|
51
|
+
assert.deepStrictEqual(res, { message: 'no action necessary' });
|
|
52
|
+
});
|
|
53
|
+
it('should fail deleting an active record type', async () => {
|
|
54
|
+
let err;
|
|
55
|
+
try {
|
|
56
|
+
await plugin.run(configDeleteActive);
|
|
57
|
+
}
|
|
58
|
+
catch (e) {
|
|
59
|
+
err = e;
|
|
60
|
+
}
|
|
61
|
+
assert.throws(() => {
|
|
62
|
+
throw err;
|
|
63
|
+
}, /Cannot delete active RecordType/);
|
|
64
|
+
});
|
|
65
|
+
it('should delete and replace a record type', async () => {
|
|
66
|
+
await plugin.run(configDeleteAndReplace);
|
|
67
|
+
});
|
|
68
|
+
it('should not need to do anything for non-existent picklists', async () => {
|
|
69
|
+
const res = await plugin.run(configDeleteAndReplace);
|
|
70
|
+
assert.deepStrictEqual(res, { message: 'no action necessary' });
|
|
71
|
+
});
|
|
72
|
+
it('should remove the CustomObject', async () => {
|
|
73
|
+
await global.browserforce.connection.metadata.delete('CustomObject', ['Vehicle__c']);
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
//# sourceMappingURL=index.e2e-spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.e2e-spec.js","sourceRoot":"","sources":["../../../src/plugins/record-types/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,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,MAAM,SAAS,GAAG,aAAa,CAAC,IAAI,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAE/D,QAAQ,CAAC,WAAW,CAAC,IAAI,EAAE;IACzB,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACpB,IAAI,MAAmB,CAAC;IACxB,MAAM,CAAC,GAAG,EAAE;QACV,MAAM,GAAG,IAAI,WAAW,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IAChD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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,iCAAiC,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,yCAAyC,EAAE,KAAK,IAAI,EAAE;QACvD,MAAM,MAAM,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;IAC3C,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,2DAA2D,EAAE,KAAK,IAAI,EAAE;QACzE,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;QACrD,MAAM,CAAC,eAAe,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,qBAAqB,EAAE,CAAC,CAAC;IAClE,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,gCAAgC,EAAE,KAAK,IAAI,EAAE;QAC9C,MAAM,MAAM,CAAC,YAAY,CAAC,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IACvF,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
|
2
|
+
if (value !== null && value !== void 0) {
|
|
3
|
+
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
|
4
|
+
var dispose, inner;
|
|
5
|
+
if (async) {
|
|
6
|
+
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
|
7
|
+
dispose = value[Symbol.asyncDispose];
|
|
8
|
+
}
|
|
9
|
+
if (dispose === void 0) {
|
|
10
|
+
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
|
11
|
+
dispose = value[Symbol.dispose];
|
|
12
|
+
if (async) inner = dispose;
|
|
13
|
+
}
|
|
14
|
+
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
|
15
|
+
if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
|
|
16
|
+
env.stack.push({ value: value, dispose: dispose, async: async });
|
|
17
|
+
}
|
|
18
|
+
else if (async) {
|
|
19
|
+
env.stack.push({ async: true });
|
|
20
|
+
}
|
|
21
|
+
return value;
|
|
22
|
+
};
|
|
23
|
+
var __disposeResources = (this && this.__disposeResources) || (function (SuppressedError) {
|
|
24
|
+
return function (env) {
|
|
25
|
+
function fail(e) {
|
|
26
|
+
env.error = env.hasError ? new SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
|
27
|
+
env.hasError = true;
|
|
28
|
+
}
|
|
29
|
+
var r, s = 0;
|
|
30
|
+
function next() {
|
|
31
|
+
while (r = env.stack.pop()) {
|
|
32
|
+
try {
|
|
33
|
+
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
|
|
34
|
+
if (r.dispose) {
|
|
35
|
+
var result = r.dispose.call(r.value);
|
|
36
|
+
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
|
|
37
|
+
}
|
|
38
|
+
else s |= 1;
|
|
39
|
+
}
|
|
40
|
+
catch (e) {
|
|
41
|
+
fail(e);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
|
|
45
|
+
if (env.hasError) throw env.error;
|
|
46
|
+
}
|
|
47
|
+
return next();
|
|
48
|
+
};
|
|
49
|
+
})(typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
50
|
+
var e = new Error(message);
|
|
51
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
52
|
+
});
|
|
53
|
+
import { BrowserforcePlugin } from '../../plugin.js';
|
|
54
|
+
import { RecordTypePage } from './pages.js';
|
|
55
|
+
export class RecordTypes extends BrowserforcePlugin {
|
|
56
|
+
async retrieve(definition) {
|
|
57
|
+
const response = {
|
|
58
|
+
deletions: [],
|
|
59
|
+
};
|
|
60
|
+
const recordTypeFileProperties = await listRecordTypes(this.browserforce.connection);
|
|
61
|
+
const recordTypes = await queryRecordTypes(this.browserforce.connection);
|
|
62
|
+
for (const deletion of definition.deletions) {
|
|
63
|
+
const recordType = getRecordType(deletion.fullName, recordTypeFileProperties, recordTypes);
|
|
64
|
+
if (recordType) {
|
|
65
|
+
if (recordType.IsActive) {
|
|
66
|
+
throw new Error(`Cannot delete active RecordType: ${deletion.fullName}`);
|
|
67
|
+
}
|
|
68
|
+
if (deletion.replacement) {
|
|
69
|
+
const replacementRecordType = getRecordType(deletion.replacement, recordTypeFileProperties, recordTypes);
|
|
70
|
+
if (!replacementRecordType) {
|
|
71
|
+
throw new Error(`Could not find replacement RecordType: ${deletion.replacement}`);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
response.deletions.push(deletion);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return response;
|
|
78
|
+
}
|
|
79
|
+
diff(source, target) {
|
|
80
|
+
const changes = {};
|
|
81
|
+
if (target.deletions?.length && source.deletions?.length) {
|
|
82
|
+
changes.deletions = source.deletions;
|
|
83
|
+
}
|
|
84
|
+
return Object.keys(changes).length ? changes : undefined;
|
|
85
|
+
}
|
|
86
|
+
async apply(config) {
|
|
87
|
+
const recordTypeFileProperties = await listRecordTypes(this.browserforce.connection);
|
|
88
|
+
const recordTypes = await queryRecordTypes(this.browserforce.connection);
|
|
89
|
+
for (const deletion of config.deletions) {
|
|
90
|
+
const env_1 = { stack: [], error: void 0, hasError: false };
|
|
91
|
+
try {
|
|
92
|
+
const recordType = getRecordType(deletion.fullName, recordTypeFileProperties, recordTypes);
|
|
93
|
+
const page = __addDisposableResource(env_1, await this.browserforce.openPage(`/ui/setup/rectype/RecordTypes?type=${recordType.EntityDefinitionId}`), true);
|
|
94
|
+
const recordTypePage = new RecordTypePage(page);
|
|
95
|
+
const deletePage = await recordTypePage.clickDeleteAction(recordType.Id);
|
|
96
|
+
let newRecordTypeId;
|
|
97
|
+
if (deletion.replacement) {
|
|
98
|
+
const replacementRecordType = getRecordType(deletion.replacement, recordTypeFileProperties, recordTypes);
|
|
99
|
+
newRecordTypeId = replacementRecordType.Id;
|
|
100
|
+
}
|
|
101
|
+
await deletePage.replace(newRecordTypeId);
|
|
102
|
+
}
|
|
103
|
+
catch (e_1) {
|
|
104
|
+
env_1.error = e_1;
|
|
105
|
+
env_1.hasError = true;
|
|
106
|
+
}
|
|
107
|
+
finally {
|
|
108
|
+
const result_1 = __disposeResources(env_1);
|
|
109
|
+
if (result_1)
|
|
110
|
+
await result_1;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
async function listRecordTypes(connection) {
|
|
116
|
+
const recordTypes = await connection.metadata.list({
|
|
117
|
+
type: 'RecordType',
|
|
118
|
+
});
|
|
119
|
+
return recordTypes;
|
|
120
|
+
}
|
|
121
|
+
async function queryRecordTypes(connection) {
|
|
122
|
+
const recordTypesResult = await connection.tooling.query(`SELECT Id, EntityDefinitionId, IsActive FROM RecordType`);
|
|
123
|
+
const recordTypes = recordTypesResult.records;
|
|
124
|
+
return recordTypes;
|
|
125
|
+
}
|
|
126
|
+
function getRecordType(fullName, fileProperties, recordTypes) {
|
|
127
|
+
const recordTypeFileProperty = fileProperties.find((fp) => fp.fullName === fullName);
|
|
128
|
+
if (recordTypeFileProperty) {
|
|
129
|
+
return recordTypes.find((x) => x.Id === recordTypeFileProperty.id);
|
|
130
|
+
}
|
|
131
|
+
return undefined;
|
|
132
|
+
}
|
|
133
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/plugins/record-types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AC3C;IACH,CAAC;CACF;AAED,KAAK,UAAU,eAAe,CAAC,UAAU;IACvC,MAAM,WAAW,GAAG,MAAM,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC;QACjD,IAAI,EAAE,YAAY;KACnB,CAAC,CAAC;IACH,OAAO,WAAW,CAAC;AACrB,CAAC;AAQD,KAAK,UAAU,gBAAgB,CAAC,UAAsB;IACpD,MAAM,iBAAiB,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,KAAK,CACtD,yDAAyD,CAC1D,CAAC;IACF,MAAM,WAAW,GAAG,iBAAiB,CAAC,OAAO,CAAC;IAC9C,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,SAAS,aAAa,CAAC,QAAgB,EAAE,cAAc,EAAE,WAAW;IAClE,MAAM,sBAAsB,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC;IACrF,IAAI,sBAAsB,EAAE,CAAC;QAC3B,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,sBAAsB,CAAC,EAAE,CAAC,CAAC;IACrE,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Page } from 'playwright';
|
|
2
|
+
export declare class RecordTypePage {
|
|
3
|
+
private page;
|
|
4
|
+
constructor(page: Page);
|
|
5
|
+
clickDeleteAction(recordTypeId: string): Promise<RecordTypeDeletePage>;
|
|
6
|
+
}
|
|
7
|
+
export declare class RecordTypeDeletePage {
|
|
8
|
+
protected page: Page;
|
|
9
|
+
protected saveButton: string;
|
|
10
|
+
constructor(page: Page);
|
|
11
|
+
replace(newRecordTypeId?: string): Promise<void>;
|
|
12
|
+
save(): Promise<void>;
|
|
13
|
+
throwOnMissingSaveButton(): Promise<void>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { waitForPageErrors } from '../../browserforce.js';
|
|
2
|
+
export class RecordTypePage {
|
|
3
|
+
page;
|
|
4
|
+
constructor(page) {
|
|
5
|
+
this.page = page;
|
|
6
|
+
}
|
|
7
|
+
async clickDeleteAction(recordTypeId) {
|
|
8
|
+
const xpath = `//a[contains(@href, "setup/ui/recordtypedelete.jsp?id=${recordTypeId.slice(0, 15)}")]`;
|
|
9
|
+
await this.page.locator(`xpath=${xpath}`).first().click();
|
|
10
|
+
await Promise.race([
|
|
11
|
+
this.page.waitForURL((url) => url.pathname === '/setup/ui/recordtypedelete.jsp'),
|
|
12
|
+
waitForPageErrors(this.page),
|
|
13
|
+
]);
|
|
14
|
+
return new RecordTypeDeletePage(this.page);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export class RecordTypeDeletePage {
|
|
18
|
+
page;
|
|
19
|
+
saveButton = 'input[name="save"]';
|
|
20
|
+
constructor(page) {
|
|
21
|
+
this.page = page;
|
|
22
|
+
}
|
|
23
|
+
async replace(newRecordTypeId) {
|
|
24
|
+
await this.throwOnMissingSaveButton();
|
|
25
|
+
if (newRecordTypeId) {
|
|
26
|
+
await this.page.locator('select#p2').describe('new value').selectOption(newRecordTypeId.slice(0, 15));
|
|
27
|
+
}
|
|
28
|
+
await this.save();
|
|
29
|
+
}
|
|
30
|
+
async save() {
|
|
31
|
+
await this.page.locator(this.saveButton).click();
|
|
32
|
+
await Promise.race([
|
|
33
|
+
this.page.waitForURL((url) => url.pathname === '/ui/setup/rectype/RecordTypes'),
|
|
34
|
+
waitForPageErrors(this.page),
|
|
35
|
+
]);
|
|
36
|
+
}
|
|
37
|
+
async throwOnMissingSaveButton() {
|
|
38
|
+
const saveButtonCount = await this.page.locator(this.saveButton).count();
|
|
39
|
+
if (saveButtonCount === 0) {
|
|
40
|
+
const bodyElement = this.page.locator('div.pbBody');
|
|
41
|
+
if ((await bodyElement.count()) > 0) {
|
|
42
|
+
const errorMsg = await bodyElement.textContent();
|
|
43
|
+
if (errorMsg?.trim()) {
|
|
44
|
+
throw new Error(errorMsg.trim());
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=pages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pages.js","sourceRoot":"","sources":["../../../src/plugins/record-types/pages.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,MAAM,OAAO,cAAc;IACjB,IAAI,CAAO;IAEnB,YAAY,IAAU;QACpB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAEM,KAAK,CAAC,iBAAiB,CAAC,YAAoB;QACjD,MAAM,KAAK,GAAG,yDAAyD,YAAY,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC;QACtG,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,CAAC;QAC1D,MAAM,OAAO,CAAC,IAAI,CAAC;YACjB,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,KAAK,gCAAgC,CAAC;YAChF,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC;SAC7B,CAAC,CAAC;QACH,OAAO,IAAI,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC;CACF;AAED,MAAM,OAAO,oBAAoB;IACrB,IAAI,CAAO;IACX,UAAU,GAAG,oBAAoB,CAAC;IAE5C,YAAY,IAAU;QACpB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,eAAwB;QACpC,MAAM,IAAI,CAAC,wBAAwB,EAAE,CAAC;QACtC,IAAI,eA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+
import { BrowserforcePlugin } from '../../plugin.js';
|
|
3
|
+
type Config = {
|
|
4
|
+
enabled: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare class RelateContactToMultipleAccounts extends BrowserforcePlugin {
|
|
7
|
+
retrieve(definition?: Config): Promise<Config>;
|
|
8
|
+
apply(config: Config): Promise<void>;
|
|
9
|
+
waitForProcessFinished(page: Page): Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import assert from 'assert';
|
|
2
|
+
import { RelateContactToMultipleAccounts } from './index.js';
|
|
3
|
+
describe(RelateContactToMultipleAccounts.name, function () {
|
|
4
|
+
this.timeout('5m');
|
|
5
|
+
let plugin;
|
|
6
|
+
before(() => {
|
|
7
|
+
plugin = new RelateContactToMultipleAccounts(global.browserforce);
|
|
8
|
+
});
|
|
9
|
+
const configEnabled = {
|
|
10
|
+
enabled: true,
|
|
11
|
+
};
|
|
12
|
+
const configDisabled = {
|
|
13
|
+
enabled: false,
|
|
14
|
+
};
|
|
15
|
+
it('should enable', async () => {
|
|
16
|
+
await plugin.run(configEnabled);
|
|
17
|
+
});
|
|
18
|
+
it('should be enabled', async () => {
|
|
19
|
+
const res = await plugin.run(configEnabled);
|
|
20
|
+
assert.deepStrictEqual(res, { message: 'no action necessary' });
|
|
21
|
+
});
|
|
22
|
+
it('should disable', async () => {
|
|
23
|
+
await plugin.run(configDisabled);
|
|
24
|
+
});
|
|
25
|
+
it('should be disabled', async () => {
|
|
26
|
+
const res = await plugin.run(configDisabled);
|
|
27
|
+
assert.deepStrictEqual(res, { message: 'no action necessary' });
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
//# sourceMappingURL=index.e2e-spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.e2e-spec.js","sourceRoot":"","sources":["../../../src/plugins/relate-contact-to-multiple-accounts/index.e2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0,0 +1,120 @@
|
|
|
1
|
+
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
|
2
|
+
if (value !== null && value !== void 0) {
|
|
3
|
+
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
|
4
|
+
var dispose, inner;
|
|
5
|
+
if (async) {
|
|
6
|
+
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
|
7
|
+
dispose = value[Symbol.asyncDispose];
|
|
8
|
+
}
|
|
9
|
+
if (dispose === void 0) {
|
|
10
|
+
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
|
11
|
+
dispose = value[Symbol.dispose];
|
|
12
|
+
if (async) inner = dispose;
|
|
13
|
+
}
|
|
14
|
+
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
|
15
|
+
if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
|
|
16
|
+
env.stack.push({ value: value, dispose: dispose, async: async });
|
|
17
|
+
}
|
|
18
|
+
else if (async) {
|
|
19
|
+
env.stack.push({ async: true });
|
|
20
|
+
}
|
|
21
|
+
return value;
|
|
22
|
+
};
|
|
23
|
+
var __disposeResources = (this && this.__disposeResources) || (function (SuppressedError) {
|
|
24
|
+
return function (env) {
|
|
25
|
+
function fail(e) {
|
|
26
|
+
env.error = env.hasError ? new SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
|
27
|
+
env.hasError = true;
|
|
28
|
+
}
|
|
29
|
+
var r, s = 0;
|
|
30
|
+
function next() {
|
|
31
|
+
while (r = env.stack.pop()) {
|
|
32
|
+
try {
|
|
33
|
+
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
|
|
34
|
+
if (r.dispose) {
|
|
35
|
+
var result = r.dispose.call(r.value);
|
|
36
|
+
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
|
|
37
|
+
}
|
|
38
|
+
else s |= 1;
|
|
39
|
+
}
|
|
40
|
+
catch (e) {
|
|
41
|
+
fail(e);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
|
|
45
|
+
if (env.hasError) throw env.error;
|
|
46
|
+
}
|
|
47
|
+
return next();
|
|
48
|
+
};
|
|
49
|
+
})(typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
50
|
+
var e = new Error(message);
|
|
51
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
52
|
+
});
|
|
53
|
+
import { BrowserforcePlugin } from '../../plugin.js';
|
|
54
|
+
const BASE_PATH = '/accounts/accountSetup.apexp';
|
|
55
|
+
export class RelateContactToMultipleAccounts extends BrowserforcePlugin {
|
|
56
|
+
async retrieve(definition) {
|
|
57
|
+
const env_1 = { stack: [], error: void 0, hasError: false };
|
|
58
|
+
try {
|
|
59
|
+
const page = __addDisposableResource(env_1, await this.browserforce.openPage(BASE_PATH), true);
|
|
60
|
+
const response = {
|
|
61
|
+
enabled: await page.locator('input[id$=":sharedContactsCheckBox"]').isChecked(),
|
|
62
|
+
};
|
|
63
|
+
return response;
|
|
64
|
+
}
|
|
65
|
+
catch (e_1) {
|
|
66
|
+
env_1.error = e_1;
|
|
67
|
+
env_1.hasError = true;
|
|
68
|
+
}
|
|
69
|
+
finally {
|
|
70
|
+
const result_1 = __disposeResources(env_1);
|
|
71
|
+
if (result_1)
|
|
72
|
+
await result_1;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
async apply(config) {
|
|
76
|
+
const env_2 = { stack: [], error: void 0, hasError: false };
|
|
77
|
+
try {
|
|
78
|
+
const page = __addDisposableResource(env_2, await this.browserforce.openPage(BASE_PATH), true);
|
|
79
|
+
await this.waitForProcessFinished(page);
|
|
80
|
+
// First we have to click the 'Edit' button, to make the checkbox editable
|
|
81
|
+
await Promise.all([page.waitForEvent('load'), page.locator('input[id$=":edit"]').first().click()]);
|
|
82
|
+
// Change the value of the checkbox
|
|
83
|
+
await page.locator('input[id$=":sharedContactsCheckBox"]').setChecked(config.enabled);
|
|
84
|
+
const saveButton = page.locator('input[id$=":save"]').first();
|
|
85
|
+
if (config.enabled) {
|
|
86
|
+
await Promise.all([page.waitForEvent('load'), saveButton.click()]);
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
await saveButton.click();
|
|
90
|
+
await page.locator('input#disable_confirm').click();
|
|
91
|
+
await Promise.all([page.waitForEvent('load'), page.locator('input#sharedContactsDisableConfirmButton').click()]);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
catch (e_2) {
|
|
95
|
+
env_2.error = e_2;
|
|
96
|
+
env_2.hasError = true;
|
|
97
|
+
}
|
|
98
|
+
finally {
|
|
99
|
+
const result_2 = __disposeResources(env_2);
|
|
100
|
+
if (result_2)
|
|
101
|
+
await result_2;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
async waitForProcessFinished(page) {
|
|
105
|
+
await this.browserforce.retry(async () => {
|
|
106
|
+
const enabling = page.locator('#enablingInProgress');
|
|
107
|
+
if ((await enabling.count()) > 0) {
|
|
108
|
+
// Error: In progress: We're enabling Contacts to Multiple Accounts for your organization. This process can take several hours. We'll send you an email when it's done.
|
|
109
|
+
const message = await enabling.innerText();
|
|
110
|
+
throw new Error(message);
|
|
111
|
+
}
|
|
112
|
+
const disabling = page.locator('#disablingInProgress');
|
|
113
|
+
if ((await disabling.count()) > 0) {
|
|
114
|
+
const message = await disabling.innerText();
|
|
115
|
+
throw new Error(message);
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/plugins/relate-contact-to-multiple-accounts/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AU,CAAC,KAAK,EAAE,CAAC;gBACzB,MAAM,IAAI,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAAC,KAAK,EAAE,CAAC;gBACpD,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,0CAA0C,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;YACnH,CAAC;;;;;;;;;;;KACF;IAED,KAAK,CAAC,sBAAsB,CAAC,IAAU;QACrC,MAAM,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE;YACvC,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC;YACrD,IAAI,CAAC,MAAM,QAAQ,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC;gBACjC,uKAAuK;gBACvK,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,SAAS,EAAE,CAAC;gBAC3C,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;YAC3B,CAAC;YACD,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC;YACvD,IAAI,CAAC,MAAM,SAAS,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC;gBAClC,MAAM,OAAO,GAAG,MAAM,SAAS,CAAC,SAAS,EAAE,CAAC;gBAC5C,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;YAC3B,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BrowserforcePlugin } from '../../../plugin.js';
|
|
2
|
+
export type Config = {
|
|
3
|
+
enableEnhancedFolderSharing: boolean;
|
|
4
|
+
};
|
|
5
|
+
export declare class FolderSharing extends BrowserforcePlugin {
|
|
6
|
+
retrieve(definition?: Config): Promise<Config>;
|
|
7
|
+
apply(config: Config): Promise<void>;
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.e2e-spec.js","sourceRoot":"","sources":["../../../../src/plugins/reports-and-dashboards/folder-sharing/index.e2e-spec.ts"],"names":[],"mappings":";AAAA,8DAA8D"}
|