sfdx-browserforce-plugin 5.1.1 → 5.1.2

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.
Files changed (263) hide show
  1. package/lib/browserforce-command.d.ts +15 -0
  2. package/lib/browserforce-command.js +61 -0
  3. package/lib/browserforce-command.js.map +1 -0
  4. package/lib/browserforce.d.ts +25 -0
  5. package/lib/browserforce.js +169 -0
  6. package/lib/browserforce.js.map +1 -0
  7. package/lib/commands/browserforce/apply.d.ts +10 -0
  8. package/lib/commands/browserforce/apply.js +54 -0
  9. package/lib/commands/browserforce/apply.js.map +1 -0
  10. package/lib/commands/browserforce/plan.d.ts +10 -0
  11. package/lib/commands/browserforce/plan.js +56 -0
  12. package/lib/commands/browserforce/plan.js.map +1 -0
  13. package/lib/config-parser.d.ts +16 -0
  14. package/lib/config-parser.js +24 -0
  15. package/lib/config-parser.js.map +1 -0
  16. package/lib/index.d.ts +1 -0
  17. package/lib/index.js +2 -0
  18. package/lib/index.js.map +1 -0
  19. package/lib/jsforce-utils.d.ts +5 -0
  20. package/lib/jsforce-utils.js +14 -0
  21. package/lib/jsforce-utils.js.map +1 -0
  22. package/lib/pages/login.d.ts +8 -0
  23. package/lib/pages/login.js +39 -0
  24. package/lib/pages/login.js.map +1 -0
  25. package/lib/plugin.d.ts +17 -0
  26. package/lib/plugin.js +30 -0
  27. package/lib/plugin.js.map +1 -0
  28. package/lib/plugins/activity-settings/index.d.ts +9 -0
  29. package/lib/plugins/activity-settings/index.e2e-spec.d.ts +1 -0
  30. package/lib/plugins/activity-settings/index.e2e-spec.js +36 -0
  31. package/lib/plugins/activity-settings/index.e2e-spec.js.map +1 -0
  32. package/lib/plugins/activity-settings/index.js +31 -0
  33. package/lib/plugins/activity-settings/index.js.map +1 -0
  34. package/lib/plugins/company-information/index.d.ts +8 -0
  35. package/lib/plugins/company-information/index.e2e-spec.d.ts +1 -0
  36. package/lib/plugins/company-information/index.e2e-spec.js +37 -0
  37. package/lib/plugins/company-information/index.e2e-spec.js.map +1 -0
  38. package/lib/plugins/company-information/index.js +50 -0
  39. package/lib/plugins/company-information/index.js.map +1 -0
  40. package/lib/plugins/customer-portal/available-custom-objects/index.d.ts +14 -0
  41. package/lib/plugins/customer-portal/available-custom-objects/index.js +114 -0
  42. package/lib/plugins/customer-portal/available-custom-objects/index.js.map +1 -0
  43. package/lib/plugins/customer-portal/available-custom-objects/index.test.d.ts +1 -0
  44. package/lib/plugins/customer-portal/available-custom-objects/index.test.js +39 -0
  45. package/lib/plugins/customer-portal/available-custom-objects/index.test.js.map +1 -0
  46. package/lib/plugins/customer-portal/enabled/index.d.ts +6 -0
  47. package/lib/plugins/customer-portal/enabled/index.js +27 -0
  48. package/lib/plugins/customer-portal/enabled/index.js.map +1 -0
  49. package/lib/plugins/customer-portal/enabled/index.test.d.ts +1 -0
  50. package/lib/plugins/customer-portal/enabled/index.test.js +34 -0
  51. package/lib/plugins/customer-portal/enabled/index.test.js.map +1 -0
  52. package/lib/plugins/customer-portal/index.d.ts +15 -0
  53. package/lib/plugins/customer-portal/index.e2e-spec.d.ts +1 -0
  54. package/lib/plugins/customer-portal/index.e2e-spec.js +202 -0
  55. package/lib/plugins/customer-portal/index.e2e-spec.js.map +1 -0
  56. package/lib/plugins/customer-portal/index.js +59 -0
  57. package/lib/plugins/customer-portal/index.js.map +1 -0
  58. package/lib/plugins/customer-portal/index.test.d.ts +1 -0
  59. package/lib/plugins/customer-portal/index.test.js +84 -0
  60. package/lib/plugins/customer-portal/index.test.js.map +1 -0
  61. package/lib/plugins/customer-portal/portals/index.d.ts +25 -0
  62. package/lib/plugins/customer-portal/portals/index.js +180 -0
  63. package/lib/plugins/customer-portal/portals/index.js.map +1 -0
  64. package/lib/plugins/customer-portal/portals/index.test.d.ts +1 -0
  65. package/lib/plugins/customer-portal/portals/index.test.js +140 -0
  66. package/lib/plugins/customer-portal/portals/index.test.js.map +1 -0
  67. package/lib/plugins/density-settings/index.d.ts +17 -0
  68. package/lib/plugins/density-settings/index.e2e-spec.d.ts +1 -0
  69. package/lib/plugins/density-settings/index.e2e-spec.js +39 -0
  70. package/lib/plugins/density-settings/index.e2e-spec.js.map +1 -0
  71. package/lib/plugins/density-settings/index.js +46 -0
  72. package/lib/plugins/density-settings/index.js.map +1 -0
  73. package/lib/plugins/deprecated.d.ts +4 -0
  74. package/lib/plugins/deprecated.js +28 -0
  75. package/lib/plugins/deprecated.js.map +1 -0
  76. package/lib/plugins/email-deliverability/index.d.ts +9 -0
  77. package/lib/plugins/email-deliverability/index.e2e-spec.d.ts +1 -0
  78. package/lib/plugins/email-deliverability/index.e2e-spec.js +55 -0
  79. package/lib/plugins/email-deliverability/index.e2e-spec.js.map +1 -0
  80. package/lib/plugins/email-deliverability/index.js +39 -0
  81. package/lib/plugins/email-deliverability/index.js.map +1 -0
  82. package/lib/plugins/high-velocity-sales-settings/index.d.ts +10 -0
  83. package/lib/plugins/high-velocity-sales-settings/index.e2e-spec.d.ts +1 -0
  84. package/lib/plugins/high-velocity-sales-settings/index.e2e-spec.js +29 -0
  85. package/lib/plugins/high-velocity-sales-settings/index.e2e-spec.js.map +1 -0
  86. package/lib/plugins/high-velocity-sales-settings/index.js +42 -0
  87. package/lib/plugins/high-velocity-sales-settings/index.js.map +1 -0
  88. package/lib/plugins/high-velocity-sales-settings/page.d.ts +7 -0
  89. package/lib/plugins/high-velocity-sales-settings/page.js +29 -0
  90. package/lib/plugins/high-velocity-sales-settings/page.js.map +1 -0
  91. package/lib/plugins/history-tracking/index.d.ts +17 -0
  92. package/lib/plugins/history-tracking/index.e2e-spec.d.ts +1 -0
  93. package/lib/plugins/history-tracking/index.e2e-spec.js +106 -0
  94. package/lib/plugins/history-tracking/index.e2e-spec.js.map +1 -0
  95. package/lib/plugins/history-tracking/index.js +169 -0
  96. package/lib/plugins/history-tracking/index.js.map +1 -0
  97. package/lib/plugins/home-page-layouts/index.d.ts +14 -0
  98. package/lib/plugins/home-page-layouts/index.e2e-spec.d.ts +1 -0
  99. package/lib/plugins/home-page-layouts/index.e2e-spec.js +47 -0
  100. package/lib/plugins/home-page-layouts/index.e2e-spec.js.map +1 -0
  101. package/lib/plugins/home-page-layouts/index.js +90 -0
  102. package/lib/plugins/home-page-layouts/index.js.map +1 -0
  103. package/lib/plugins/home-page-layouts/index.test.d.ts +1 -0
  104. package/lib/plugins/home-page-layouts/index.test.js +104 -0
  105. package/lib/plugins/home-page-layouts/index.test.js.map +1 -0
  106. package/lib/plugins/index.d.ts +24 -0
  107. package/lib/plugins/index.js +25 -0
  108. package/lib/plugins/index.js.map +1 -0
  109. package/lib/plugins/lightning-experience-settings/index.d.ts +18 -0
  110. package/lib/plugins/lightning-experience-settings/index.e2e-spec.d.ts +1 -0
  111. package/lib/plugins/lightning-experience-settings/index.e2e-spec.js +40 -0
  112. package/lib/plugins/lightning-experience-settings/index.e2e-spec.js.map +1 -0
  113. package/lib/plugins/lightning-experience-settings/index.js +97 -0
  114. package/lib/plugins/lightning-experience-settings/index.js.map +1 -0
  115. package/lib/plugins/linkedin-sales-navigator-settings/index.d.ts +8 -0
  116. package/lib/plugins/linkedin-sales-navigator-settings/index.e2e-spec.d.ts +1 -0
  117. package/lib/plugins/linkedin-sales-navigator-settings/index.e2e-spec.js +29 -0
  118. package/lib/plugins/linkedin-sales-navigator-settings/index.e2e-spec.js.map +1 -0
  119. package/lib/plugins/linkedin-sales-navigator-settings/index.js +15 -0
  120. package/lib/plugins/linkedin-sales-navigator-settings/index.js.map +1 -0
  121. package/lib/plugins/linkedin-sales-navigator-settings/page.d.ts +8 -0
  122. package/lib/plugins/linkedin-sales-navigator-settings/page.js +32 -0
  123. package/lib/plugins/linkedin-sales-navigator-settings/page.js.map +1 -0
  124. package/lib/plugins/omni-channel-settings/index.d.ts +9 -0
  125. package/lib/plugins/omni-channel-settings/index.e2e-spec.d.ts +1 -0
  126. package/lib/plugins/omni-channel-settings/index.e2e-spec.js +26 -0
  127. package/lib/plugins/omni-channel-settings/index.e2e-spec.js.map +1 -0
  128. package/lib/plugins/omni-channel-settings/index.js +29 -0
  129. package/lib/plugins/omni-channel-settings/index.js.map +1 -0
  130. package/lib/plugins/opportunity-splits/index.d.ts +9 -0
  131. package/lib/plugins/opportunity-splits/index.e2e-spec.d.ts +1 -0
  132. package/lib/plugins/opportunity-splits/index.e2e-spec.js +46 -0
  133. package/lib/plugins/opportunity-splits/index.e2e-spec.js.map +1 -0
  134. package/lib/plugins/opportunity-splits/index.js +32 -0
  135. package/lib/plugins/opportunity-splits/index.js.map +1 -0
  136. package/lib/plugins/opportunity-splits/pages/layout-selection.d.ts +8 -0
  137. package/lib/plugins/opportunity-splits/pages/layout-selection.js +17 -0
  138. package/lib/plugins/opportunity-splits/pages/layout-selection.js.map +1 -0
  139. package/lib/plugins/opportunity-splits/pages/overview.d.ts +10 -0
  140. package/lib/plugins/opportunity-splits/pages/overview.js +38 -0
  141. package/lib/plugins/opportunity-splits/pages/overview.js.map +1 -0
  142. package/lib/plugins/opportunity-splits/pages/setup.d.ts +8 -0
  143. package/lib/plugins/opportunity-splits/pages/setup.js +19 -0
  144. package/lib/plugins/opportunity-splits/pages/setup.js.map +1 -0
  145. package/lib/plugins/permission-sets/index.d.ts +10 -0
  146. package/lib/plugins/permission-sets/index.e2e-spec.d.ts +1 -0
  147. package/lib/plugins/permission-sets/index.e2e-spec.js +36 -0
  148. package/lib/plugins/permission-sets/index.e2e-spec.js.map +1 -0
  149. package/lib/plugins/permission-sets/index.js +22 -0
  150. package/lib/plugins/permission-sets/index.js.map +1 -0
  151. package/lib/plugins/permission-sets/service-presence-status/index.d.ts +10 -0
  152. package/lib/plugins/permission-sets/service-presence-status/index.js +60 -0
  153. package/lib/plugins/permission-sets/service-presence-status/index.js.map +1 -0
  154. package/lib/plugins/picklists/field-dependencies/index.d.ts +11 -0
  155. package/lib/plugins/picklists/field-dependencies/index.js +56 -0
  156. package/lib/plugins/picklists/field-dependencies/index.js.map +1 -0
  157. package/lib/plugins/picklists/field-dependencies/index.test.d.ts +1 -0
  158. package/lib/plugins/picklists/field-dependencies/index.test.js +64 -0
  159. package/lib/plugins/picklists/field-dependencies/index.test.js.map +1 -0
  160. package/lib/plugins/picklists/field-dependencies/pages.d.ts +14 -0
  161. package/lib/plugins/picklists/field-dependencies/pages.js +57 -0
  162. package/lib/plugins/picklists/field-dependencies/pages.js.map +1 -0
  163. package/lib/plugins/picklists/index.d.ts +23 -0
  164. package/lib/plugins/picklists/index.e2e-spec.d.ts +1 -0
  165. package/lib/plugins/picklists/index.e2e-spec.js +100 -0
  166. package/lib/plugins/picklists/index.e2e-spec.js.map +1 -0
  167. package/lib/plugins/picklists/index.js +153 -0
  168. package/lib/plugins/picklists/index.js.map +1 -0
  169. package/lib/plugins/picklists/pages.d.ts +40 -0
  170. package/lib/plugins/picklists/pages.js +194 -0
  171. package/lib/plugins/picklists/pages.js.map +1 -0
  172. package/lib/plugins/picklists/standard-value-set.d.ts +1 -0
  173. package/lib/plugins/picklists/standard-value-set.js +80 -0
  174. package/lib/plugins/picklists/standard-value-set.js.map +1 -0
  175. package/lib/plugins/record-types/index.d.ts +13 -0
  176. package/lib/plugins/record-types/index.e2e-spec.d.ts +1 -0
  177. package/lib/plugins/record-types/index.e2e-spec.js +73 -0
  178. package/lib/plugins/record-types/index.e2e-spec.js.map +1 -0
  179. package/lib/plugins/record-types/index.js +70 -0
  180. package/lib/plugins/record-types/index.js.map +1 -0
  181. package/lib/plugins/record-types/pages.d.ts +15 -0
  182. package/lib/plugins/record-types/pages.js +64 -0
  183. package/lib/plugins/record-types/pages.js.map +1 -0
  184. package/lib/plugins/relate-contact-to-multiple-accounts/index.d.ts +11 -0
  185. package/lib/plugins/relate-contact-to-multiple-accounts/index.e2e-spec.d.ts +1 -0
  186. package/lib/plugins/relate-contact-to-multiple-accounts/index.e2e-spec.js +29 -0
  187. package/lib/plugins/relate-contact-to-multiple-accounts/index.e2e-spec.js.map +1 -0
  188. package/lib/plugins/relate-contact-to-multiple-accounts/index.js +72 -0
  189. package/lib/plugins/relate-contact-to-multiple-accounts/index.js.map +1 -0
  190. package/lib/plugins/reports-and-dashboards/folder-sharing/index.d.ts +8 -0
  191. package/lib/plugins/reports-and-dashboards/folder-sharing/index.e2e-spec.d.ts +1 -0
  192. package/lib/plugins/reports-and-dashboards/folder-sharing/index.e2e-spec.js +3 -0
  193. package/lib/plugins/reports-and-dashboards/folder-sharing/index.e2e-spec.js.map +1 -0
  194. package/lib/plugins/reports-and-dashboards/folder-sharing/index.js +50 -0
  195. package/lib/plugins/reports-and-dashboards/folder-sharing/index.js.map +1 -0
  196. package/lib/plugins/reports-and-dashboards/index.d.ts +11 -0
  197. package/lib/plugins/reports-and-dashboards/index.e2e-spec.d.ts +1 -0
  198. package/lib/plugins/reports-and-dashboards/index.e2e-spec.js +3 -0
  199. package/lib/plugins/reports-and-dashboards/index.e2e-spec.js.map +1 -0
  200. package/lib/plugins/reports-and-dashboards/index.js +29 -0
  201. package/lib/plugins/reports-and-dashboards/index.js.map +1 -0
  202. package/lib/plugins/salesforce-cpq-config/formConfig.d.ts +17 -0
  203. package/lib/plugins/salesforce-cpq-config/formConfig.js +649 -0
  204. package/lib/plugins/salesforce-cpq-config/formConfig.js.map +1 -0
  205. package/lib/plugins/salesforce-cpq-config/index.d.ts +7 -0
  206. package/lib/plugins/salesforce-cpq-config/index.e2e-spec.d.ts +1 -0
  207. package/lib/plugins/salesforce-cpq-config/index.e2e-spec.js +37 -0
  208. package/lib/plugins/salesforce-cpq-config/index.e2e-spec.js.map +1 -0
  209. package/lib/plugins/salesforce-cpq-config/index.js +195 -0
  210. package/lib/plugins/salesforce-cpq-config/index.js.map +1 -0
  211. package/lib/plugins/salesforce-to-salesforce/index.d.ts +9 -0
  212. package/lib/plugins/salesforce-to-salesforce/index.e2e-spec.d.ts +1 -0
  213. package/lib/plugins/salesforce-to-salesforce/index.e2e-spec.js +34 -0
  214. package/lib/plugins/salesforce-to-salesforce/index.e2e-spec.js.map +1 -0
  215. package/lib/plugins/salesforce-to-salesforce/index.js +44 -0
  216. package/lib/plugins/salesforce-to-salesforce/index.js.map +1 -0
  217. package/lib/plugins/security/authentication-configuration/index.d.ts +11 -0
  218. package/lib/plugins/security/authentication-configuration/index.e2e-spec.d.ts +1 -0
  219. package/lib/plugins/security/authentication-configuration/index.e2e-spec.js +101 -0
  220. package/lib/plugins/security/authentication-configuration/index.e2e-spec.js.map +1 -0
  221. package/lib/plugins/security/authentication-configuration/index.js +62 -0
  222. package/lib/plugins/security/authentication-configuration/index.js.map +1 -0
  223. package/lib/plugins/security/certificate-and-key-management/index.d.ts +23 -0
  224. package/lib/plugins/security/certificate-and-key-management/index.e2e-spec.d.ts +1 -0
  225. package/lib/plugins/security/certificate-and-key-management/index.e2e-spec.js +63 -0
  226. package/lib/plugins/security/certificate-and-key-management/index.e2e-spec.js.map +1 -0
  227. package/lib/plugins/security/certificate-and-key-management/index.js +159 -0
  228. package/lib/plugins/security/certificate-and-key-management/index.js.map +1 -0
  229. package/lib/plugins/security/certificate-and-key-management/index.test.d.ts +1 -0
  230. package/lib/plugins/security/certificate-and-key-management/index.test.js +61 -0
  231. package/lib/plugins/security/certificate-and-key-management/index.test.js.map +1 -0
  232. package/lib/plugins/security/index.d.ts +13 -0
  233. package/lib/plugins/security/index.js +42 -0
  234. package/lib/plugins/security/index.js.map +1 -0
  235. package/lib/plugins/service-channels/capacity/index.d.ts +18 -0
  236. package/lib/plugins/service-channels/capacity/index.js +133 -0
  237. package/lib/plugins/service-channels/capacity/index.js.map +1 -0
  238. package/lib/plugins/service-channels/index.d.ts +12 -0
  239. package/lib/plugins/service-channels/index.e2e-spec.d.ts +1 -0
  240. package/lib/plugins/service-channels/index.e2e-spec.js +57 -0
  241. package/lib/plugins/service-channels/index.e2e-spec.js.map +1 -0
  242. package/lib/plugins/service-channels/index.js +38 -0
  243. package/lib/plugins/service-channels/index.js.map +1 -0
  244. package/lib/plugins/slack/index.d.ts +9 -0
  245. package/lib/plugins/slack/index.e2e-spec.d.ts +1 -0
  246. package/lib/plugins/slack/index.e2e-spec.js +47 -0
  247. package/lib/plugins/slack/index.e2e-spec.js.map +1 -0
  248. package/lib/plugins/slack/index.js +47 -0
  249. package/lib/plugins/slack/index.js.map +1 -0
  250. package/lib/plugins/user-access-policies/index.d.ts +19 -0
  251. package/lib/plugins/user-access-policies/index.e2e-spec.d.ts +1 -0
  252. package/lib/plugins/user-access-policies/index.e2e-spec.js +61 -0
  253. package/lib/plugins/user-access-policies/index.e2e-spec.js.map +1 -0
  254. package/lib/plugins/user-access-policies/index.js +105 -0
  255. package/lib/plugins/user-access-policies/index.js.map +1 -0
  256. package/lib/plugins/user-access-policies/page.d.ts +29 -0
  257. package/lib/plugins/user-access-policies/page.js +132 -0
  258. package/lib/plugins/user-access-policies/page.js.map +1 -0
  259. package/lib/plugins/utils.d.ts +3 -0
  260. package/lib/plugins/utils.js +47 -0
  261. package/lib/plugins/utils.js.map +1 -0
  262. package/oclif.manifest.json +163 -0
  263. package/package.json +1 -1
@@ -0,0 +1,36 @@
1
+ import assert from 'assert';
2
+ import { ActivitySettings } from './index.js';
3
+ describe(ActivitySettings.name, function () {
4
+ let plugin;
5
+ before(() => {
6
+ plugin = new ActivitySettings(global.bf);
7
+ });
8
+ describe('allowUsersToRelateMultipleContactsToTasksAndEvents', () => {
9
+ const configEnabled = {
10
+ allowUsersToRelateMultipleContactsToTasksAndEvents: true,
11
+ };
12
+ const configDisabled = {
13
+ allowUsersToRelateMultipleContactsToTasksAndEvents: false,
14
+ };
15
+ it('should enable', async () => {
16
+ await plugin.run(configEnabled);
17
+ });
18
+ it('should be enabled', async () => {
19
+ const res = await plugin.retrieve();
20
+ assert.deepStrictEqual(res, configEnabled);
21
+ });
22
+ it('should fail to disable', async () => {
23
+ let err;
24
+ try {
25
+ await plugin.apply(configDisabled);
26
+ }
27
+ catch (e) {
28
+ err = e;
29
+ }
30
+ assert.throws(() => {
31
+ throw err;
32
+ }, /can only be disabled/);
33
+ });
34
+ });
35
+ });
36
+ //# sourceMappingUR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C,CAAC;QAC7B,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,31 @@
1
+ import { BrowserforcePlugin } from '../../plugin.js';
2
+ const BASE_PATH = 'setup/activitiesSetupPage.apexp';
3
+ const MANY_WHO_PREF_INPUT_SELECTOR = 'input[id="thePage:theForm:theBlock:manyWhoPref"]';
4
+ const SUBMIT_BUTTON_SELECTOR = 'input[id="thePage:theForm:theBlock:buttons:submit"]';
5
+ export class ActivitySettings extends BrowserforcePlugin {
6
+ async retrieve() {
7
+ const page = await this.browserforce.openPage(BASE_PATH);
8
+ await page.waitForSelector(MANY_WHO_PREF_INPUT_SELECTOR);
9
+ const response = {
10
+ allowUsersToRelateMultipleContactsToTasksAndEvents: await page.$eval(MANY_WHO_PREF_INPUT_SELECTOR, (el) => el.checked),
11
+ };
12
+ await page.close();
13
+ return response;
14
+ }
15
+ async apply(config) {
16
+ if (config.allowUsersToRelateMultipleContactsToTasksAndEvents === false) {
17
+ throw new Error('`allowUsersToRelateMultipleContactsToTasksAndEvents` can only be disabled with help of the salesforce.com Support team');
18
+ }
19
+ const page = await this.browserforce.openPage(BASE_PATH);
20
+ await page.waitForSelector(MANY_WHO_PREF_INPUT_SELECTOR);
21
+ await page.$eval(MANY_WHO_PREF_INPUT_SELECTOR, (e, v) => {
22
+ e.checked = v;
23
+ }, config.allowUsersToRelateMultipleContactsToTasksAndEvents);
24
+ await Promise.all([
25
+ page.waitForNavigation(),
26
+ page.click(SUBMIT_BUTTON_SELECTOR),
27
+ ]);
28
+ await page.close();
29
+ }
30
+ }
31
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/plugins/activity-settings/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAErD,MAAM,SAAS,GAAG,iCAAiC,CAAC;AAEpD,MAAM,4BAA4B,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 export type Config = {
3
+ defaultCurrencyIsoCode: string;
4
+ };
5
+ export declare class CompanyInformation extends BrowserforcePlugin {
6
+ retrieve(): Promise<Config>;
7
+ apply(config: Config): Promise<void>;
8
+ }
@@ -0,0 +1,37 @@
1
+ import assert from 'assert';
2
+ import { CompanyInformation } from './index.js';
3
+ describe(CompanyInformation.name, function () {
4
+ let plugin;
5
+ before(() => {
6
+ plugin = new CompanyInformation(global.bf);
7
+ });
8
+ const configZAR = {
9
+ defaultCurrencyIsoCode: 'English (South Africa) - ZAR',
10
+ };
11
+ const configIRE = {
12
+ defaultCurrencyIsoCode: 'English (Ireland) - EUR',
13
+ };
14
+ it('should set the currency to "English (South Africa) - ZAR" for next steps', async () => {
15
+ await plugin.run(configZAR);
16
+ });
17
+ it('should change currency to "English (Ireland) - EUR"', async () => {
18
+ await plugin.run(configIRE);
19
+ });
20
+ it('should respond to no action necessary for currency change', async () => {
21
+ const res = await plugin.run(configIRE);
22
+ assert.deepStrictEqual(res, { message: 'no action necessary' });
23
+ });
24
+ it('should error on invalid input for invalid currency', async () => {
25
+ let err;
26
+ try {
27
+ await plugin.apply({ defaultCurrencyIsoCode: 'Invalid Currency' });
28
+ }
29
+ catch (e) {
30
+ err = e;
31
+ }
32
+ assert.throws(() => {
33
+ throw err;
34
+ }, /Invalid currency provided/);
35
+ });
36
+ });
37
+ //# sourceMappingURL=index.e2e-spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.e2e-spec.js","sourceRoot":"","sources":["../../../src/plugins/company-information/index.e2e-spec.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,kBAAkB,EAAU,MAAM,YAAY,CAAC;AAExD,QAAQ,CAAC,kBAAkB,CAAC,IAAI,EAAE;IAChC,IAAI,MAA0B,CAAC;IAC/B,MAAM,CAAC,GAAG,EAAE;QACV,MAAM,GAAG,IAAI,kBAAkB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;IAEH,MAAM,SAAS,GAAW;QACxB,sBAAsB,EAAE,8BAA8B;KACvD,CAAC;IACF,MAAM,SAAS,GAAW;QACxB,sBAAsB,EAAE,yBAAyB;KAClD,CAAC;IAEF,EAAE,CAAC,0EAA0E,EAAE,KAAK,IAAI,EAAE;QACxF,MAAM,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,qDAAqD,EAAE,KAAK,IAAI,EAAE;QACnE,MAAM,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,2DAA2D,EAAE,KAAK,IAAI,EAAE;QACzE,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACxC,MAAM,CAAC,eAAe,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,qBAAqB,EAAE,CAAC,CAAC;IAClE,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,oDAAoD,EAAE,KAAK,IAAI,EAAE;QAClE,IAAI,GAAG,CAAC;QACR,IAAI,CAAC;YACH,MAAM,MAAM,CAAC,KAAK,CAAC,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,CAAC,CAAC;QACrE,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,2BAA2B,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,50 @@
1
+ import { BrowserforcePlugin } from '../../plugin.js';
2
+ const getUrl = (orgId) => `/${orgId}/e`;
3
+ const CURRENCY_DROPDOWN_SELECTOR = '#DefaultCurrencyIsoCode';
4
+ const SAVE_BUTTON_SELECTOR = 'input[class="btn"][type="submit"][name="save"]';
5
+ export class CompanyInformation extends BrowserforcePlugin {
6
+ async retrieve() {
7
+ const page = await this.browserforce.openPage(getUrl(this.org.getOrgId()));
8
+ await page.waitForSelector(CURRENCY_DROPDOWN_SELECTOR);
9
+ const response = {
10
+ defaultCurrencyIsoCode: '',
11
+ };
12
+ const selectedOptions = await page.$$eval(`${CURRENCY_DROPDOWN_SELECTOR} > option[selected]`, (options) => options.map((option) => option.textContent));
13
+ if (selectedOptions?.length) {
14
+ response.defaultCurrencyIsoCode = selectedOptions[0] ?? '';
15
+ }
16
+ await page.close();
17
+ return response;
18
+ }
19
+ async apply(config) {
20
+ if (config.defaultCurrencyIsoCode !== undefined) {
21
+ const page = await this.browserforce.openPage(getUrl(this.org.getOrgId()));
22
+ // wait for selectors
23
+ await page.waitForSelector(CURRENCY_DROPDOWN_SELECTOR);
24
+ const selectElem = await page.$(CURRENCY_DROPDOWN_SELECTOR);
25
+ await page.waitForSelector(SAVE_BUTTON_SELECTOR);
26
+ // apply changes
27
+ // await page.click(CURRENCY_DROPDOWN_SELECTOR);
28
+ const optionList = await page.$$eval(`${CURRENCY_DROPDOWN_SELECTOR} > option`, (options) => options.map((option) => ({
29
+ value: option.value,
30
+ textContent: option.textContent,
31
+ })));
32
+ const toBeSelectedOption = optionList.find((option) => option.textContent == config.defaultCurrencyIsoCode);
33
+ if (!toBeSelectedOption) {
34
+ throw new Error(`Invalid currency provided. '${config.defaultCurrencyIsoCode}' is not a valid option available for currencies. Please use the exact name as it appears in the list.`);
35
+ }
36
+ await selectElem.select(toBeSelectedOption.value);
37
+ // auto accept the dialog when it appears
38
+ page.on('dialog', (dialog) => {
39
+ dialog.accept();
40
+ });
41
+ // save
42
+ await Promise.all([
43
+ page.waitForNavigation(),
44
+ page.click(SAVE_BUTTON_SELECTOR),
45
+ ]);
46
+ await page.close();
47
+ }
48
+ }
49
+ }
50
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot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ePlugin } from '../../../plugin.js';
2
+ export type Config = AvailableCustomObjectConfig[];
3
+ type AvailableCustomObjectConfig = {
4
+ name: string;
5
+ namespacePrefix?: string;
6
+ available: boolean;
7
+ _id?: string;
8
+ };
9
+ export declare class CustomerPortalAvailableCustomObjects extends BrowserforcePlugin {
10
+ retrieve(definition: Config): Promise<Config>;
11
+ diff(state?: Config, definition?: Config): Config | undefined;
12
+ apply(plan: Config): Promise<void>;
13
+ }
14
+ export {};
@@ -0,0 +1,114 @@
1
+ import { BrowserforcePlugin } from '../../../plugin.js';
2
+ import { semanticallyCleanObject } from '../../utils.js';
3
+ const SAVE_BUTTON_SELECTOR = 'input[name="save"]';
4
+ const CUSTOM_OBJECT_AVAILABLE_FOR_CUSTOMER_PORTAL_SELECTOR = '#options_9';
5
+ export class CustomerPortalAvailableCustomObjects extends BrowserforcePlugin {
6
+ async retrieve(definition) {
7
+ const response = [];
8
+ if (definition) {
9
+ const availableCustomObjectList = definition
10
+ .map((customObject) => {
11
+ return `'${customObject.name}'`;
12
+ })
13
+ .join(',');
14
+ const customObjects = await this.org
15
+ .getConnection()
16
+ .tooling.query(`SELECT Id, DeveloperName, NamespacePrefix FROM CustomObject WHERE DeveloperName IN (${availableCustomObjectList}) ORDER BY CreatedDate DESC`, { scanAll: false });
17
+ // Note: Unfortunately scanAll=false has no impact and returns deleted CustomObjects.
18
+ // Workaround: Order by CreatedDate DESC to get the latest CustomObject first.
19
+ for (const record of customObjects?.records) {
20
+ if (record.NamespacePrefix === null) {
21
+ record.NamespacePrefix = undefined;
22
+ }
23
+ }
24
+ const page = await this.browserforce.openPage('');
25
+ // new URLs for LEX: https://help.salesforce.com/articleView?id=FAQ-for-the-New-URL-Format-for-Lightning-Experience-and-the-Salesforce-Mobile-App&type=1
26
+ const isLEX = page.url().includes('/one/one.app') ||
27
+ page.url().includes('/lightning/');
28
+ const getObjectPageUrl = function (customObject, isLexUi = true) {
29
+ const classicUiPath = `${customObject._id}/e`;
30
+ if (isLexUi) {
31
+ return `lightning/setup/ObjectManager/${customObject._id}/edit?nodeId=ObjectManager&address=${encodeURIComponent(`/${classicUiPath}`)}`;
32
+ }
33
+ else {
34
+ return classicUiPath;
35
+ }
36
+ };
37
+ for (const availableCustomObject of definition) {
38
+ const customObject = customObjects.records.find((co) => {
39
+ return (co.DeveloperName === availableCustomObject.name &&
40
+ co.NamespacePrefix === availableCustomObject.namespacePrefix);
41
+ });
42
+ if (!customObject) {
43
+ throw new Error(`Could not find CustomObject: {DeveloperName: ${availableCustomObject.name}, NamespacePrefix: ${availableCustomObject.namespacePrefix}`);
44
+ }
45
+ const result = {
46
+ _id: customObject.Id,
47
+ name: customObject.DeveloperName,
48
+ namespacePrefix: customObject.NamespacePrefix,
49
+ };
50
+ const pageUrl = getObjectPageUrl(result, isLEX);
51
+ const editPage = await this.browserforce.openPage(pageUrl);
52
+ const frameOrPage = await this.browserforce.waitForSelectorInFrameOrPage(editPage, CUSTOM_OBJECT_AVAILABLE_FOR_CUSTOMER_PORTAL_SELECTOR);
53
+ response.push({
54
+ ...result,
55
+ available: await frameOrPage.$eval(CUSTOM_OBJECT_AVAILABLE_FOR_CUSTOMER_PORTAL_SELECTOR, (el) => el.checked),
56
+ });
57
+ await editPage.close();
58
+ }
59
+ await page.close();
60
+ }
61
+ return response;
62
+ }
63
+ diff(state, definition) {
64
+ const response = [];
65
+ if (state && definition) {
66
+ for (const availableCustomObject of definition) {
67
+ const oldCustomObject = state.find((customObject) => {
68
+ return (customObject.name === availableCustomObject.name &&
69
+ customObject.namespacePrefix ===
70
+ availableCustomObject.namespacePrefix);
71
+ });
72
+ if (!oldCustomObject) {
73
+ throw new Error(`Could not find CustomObject "${availableCustomObject.name}"`);
74
+ }
75
+ // copy id of existing object to new object to be retained and used
76
+ availableCustomObject._id = oldCustomObject._id;
77
+ const diff = semanticallyCleanObject(super.diff(oldCustomObject, availableCustomObject), '_id');
78
+ if (diff?.available !== undefined) {
79
+ response.push(diff);
80
+ }
81
+ }
82
+ }
83
+ return response.length ? response : undefined;
84
+ }
85
+ async apply(plan) {
86
+ if (plan && plan.length) {
87
+ const page = await this.browserforce.openPage('');
88
+ // new URLs for LEX: https://help.salesforce.com/articleView?id=FAQ-for-the-New-URL-Format-for-Lightning-Experience-and-the-Salesforce-Mobile-App&type=1
89
+ const isLEX = page.url().includes('/one/one.app') ||
90
+ page.url().includes('/lightning/');
91
+ const getObjectPageUrl = function (customObject, isLexUi = true) {
92
+ const classicUiPath = `${customObject._id}/e?options_9=${customObject.available ? 1 : 0}&retURL=/${customObject._id}`;
93
+ if (isLexUi) {
94
+ return `lightning/setup/ObjectManager/${customObject._id}/edit?nodeId=ObjectManager&address=${encodeURIComponent(`/${classicUiPath}`)}`;
95
+ }
96
+ else {
97
+ return classicUiPath;
98
+ }
99
+ };
100
+ for (const customObject of plan) {
101
+ const pageUrl = getObjectPageUrl(customObject, isLEX);
102
+ const editPage = await this.browserforce.openPage(pageUrl);
103
+ const frameOrPage = await this.browserforce.waitForSelectorInFrameOrPage(editPage, SAVE_BUTTON_SELECTOR);
104
+ await Promise.all([
105
+ editPage.waitForNavigation(),
106
+ frameOrPage.click(SAVE_BUTTON_SELECTOR),
107
+ ]);
108
+ await editPage.close();
109
+ }
110
+ await page.close();
111
+ }
112
+ }
113
+ }
114
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/plugins/customer-portal/available-custom-objects/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAEzD,MAAM,oBAAoB,GAAG,oBAAoB,CAAC;AAClD,MAAM,oDAAoD,GAAG,YAAY,CAAC;AAgB1E,MAAM,OAAO,oCAAqC,SAAQ,kBAAkB;IACnE,KAAK,CAAC,QAAQ,CAAC,UAAkB;QACtC,MAAM,QAAQ,GAAW,EAAE,CAAC;QAC5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O,GAAG,IAAI;gBAC7D,MAAM,aAAa,GAAG,GAAG,YAAY,CAAC,GAAG,gBACvC,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAC/B,YAAY,YAAY,CAAC,GAAG,EAAE,CAAC;gBAC/B,IAAI,OAAO,EAAE,CAAC;oBACZ,OAAO,iCACL,YAAY,CAAC,GACf,sCAAsC,kBAAkB,CACtD,IAAI,aAAa,EAAE,CACpB,EAAE,CAAC;gBACN,CAAC;qBAAM,CAAC;oBACN,OAAO,aAAa,CAAC;gBACvB,CAAC;YACH,CAAC,CAAC;YAEF,KAAK,MAAM,YAAY,IAAI,IAAI,EAAE,CAAC;gBAChC,MAAM,OAAO,GAAG,gBAAgB,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;gBACtD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;gBAC3D,MAAM,WAAW,GACf,MAAM,IAAI,CAAC,YAAY,CAAC,4BAA4B,CAClD,QAAQ,EACR,oBAAoB,CACrB,CAAC;gBACJ,MAAM,OAAO,CAAC,GAAG,CAAC;oBAChB,QAAQ,CAAC,iBAAiB,EAAE;oBAC5B,WAAW,CAAC,KAAK,CAAC,oBAAoB,CAAC;iBACxC,CAAC,CAAC;gBACH,MAAM,QAAQ,CAAC,KAAK,EAAE,CAAC;YACzB,CAAC;YACD,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;QACrB,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,39 @@
1
+ import assert from 'assert';
2
+ import { CustomerPortalAvailableCustomObjects } from './index.js';
3
+ const tests = [
4
+ {
5
+ description: 'should only return necessary fields',
6
+ source: [
7
+ {
8
+ _id: 'p1',
9
+ name: 'Dummy',
10
+ available: false,
11
+ },
12
+ ],
13
+ target: [
14
+ {
15
+ name: 'Dummy',
16
+ available: true,
17
+ },
18
+ ],
19
+ expected: [
20
+ {
21
+ _id: 'p1',
22
+ name: 'Dummy',
23
+ available: true,
24
+ },
25
+ ],
26
+ },
27
+ ];
28
+ describe('CustomerPortalAvailableCustomObjects', () => {
29
+ describe('diff()', () => {
30
+ const p = new CustomerPortalAvailableCustomObjects(global.bf);
31
+ for (const t of tests) {
32
+ it(t.description, () => {
33
+ const actual = p.diff(t.source, t.target);
34
+ assert.deepStrictEqual(actual, t.expected);
35
+ });
36
+ }
37
+ });
38
+ });
39
+ //# sourceMappingURL=index.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.test.js","sourceRoot":"","sources":["../../../../src/plugins/customer-portal/available-custom-objects/index.test.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAe,oCAAoC,EAAE,MAAM,YAAY,CAAC;AAQ/E,MAAM,KAAK,GAAQ;IACjB;QACE,WAAW,EAAE,qCAAqC;QAClD,MAAM,EAAE;YACN;gBACE,GAAG,EAAE,IAAI;gBACT,IAAI,EAAE,OAAO;gBACb,SAAS,EAAE,KAAK;aACjB;SACF;QACD,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,OAAO;gBACb,SAAS,EAAE,IAAI;aAChB;SACF;QACD,QAAQ,EAAE;YACR;gBACE,GAAG,EAAE,IAAI;gBACT,IAAI,EAAE,OAAO;gBACb,SAAS,EAAE,IAAI;aAChB;SACQ;KACZ;CACF,CAAC;AAEF,QAAQ,CAAC,sCAAsC,EAAE,GAAG,EAAE;IACpD,QAAQ,CAAC,QAAQ,EAAE,GAAG,EAAE;QACtB,MAAM,CAAC,GAAG,IAAI,oCAAoC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAC9D,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;YACtB,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,EAAE;gBACrB,MAAM,MAAM,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC;gBAC1C,MAAM,CAAC,eAAe,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC;YAC7C,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { BrowserforcePlugin } from '../../../plugin.js';
2
+ export type Config = boolean | undefined;
3
+ export declare class CustomerPortalEnable extends BrowserforcePlugin {
4
+ retrieve(): Promise<Config>;
5
+ apply(plan: Config): Promise<void>;
6
+ }
@@ -0,0 +1,27 @@
1
+ import { BrowserforcePlugin } from '../../../plugin.js';
2
+ const BASE_PATH = '_ui/core/portal/CustomerSuccessPortalSetup/e';
3
+ const SAVE_BUTTON = 'input[name="save"]';
4
+ const ENABLE_CHECKBOX = 'input[type="checkbox"][id="penabled"]';
5
+ export class CustomerPortalEnable extends BrowserforcePlugin {
6
+ async retrieve() {
7
+ const conn = await this.browserforce.org.getConnection();
8
+ const orgSettings = await conn.metadata.read('OrgSettings', 'Org');
9
+ return orgSettings.enableCustomerSuccessPortal ?? false;
10
+ }
11
+ async apply(plan) {
12
+ if (plan === false) {
13
+ throw new Error('`enabled` cannot be disabled once enabled');
14
+ }
15
+ const page = await this.browserforce.openPage(BASE_PATH);
16
+ await page
17
+ .locator(ENABLE_CHECKBOX)
18
+ .map((checkbox) => (checkbox.checked = true))
19
+ .wait();
20
+ await Promise.all([
21
+ page.waitForNavigation(),
22
+ page.locator(SAVE_BUTTON).click(),
23
+ ]);
24
+ await page.close();
25
+ }
26
+ }
27
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/plugins/customer-portal/enabled/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,MAAM,SAAS,GAAG,8CAA8C,CAAC;AAEjE,MAAM,WAAW,GAAG,oBAAoB,CAAC;AACzC,MAAM,eAAe,GAAG,uCAAuC,CAAC;AAIhE,MAAM,OAAO,oBAAqB,SAAQ,kBAAkB;IACnD,KAAK,CAAC,QAAQ;QACnB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC;QACzD,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;QACnE,OAAO,WAAW,CAAC,2BAA2B,IAAI,KAAK,CAAC;IAC1D,CAAC;IAEM,KAAK,CAAC,KAAK,CAAC,IAAY;QAC7B,IAAI,IAAI,KAAK,KAAK,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;QAC/D,CAAC;QACD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;QACzD,MAAM,IAAI;aACP,OAAO,CAAC,eAAe,CAAC;aACxB,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC;aAC5C,IAAI,EAAE,CAAC;QACV,MAAM,OAAO,CAAC,GAAG,CAAC;YAChB,IAAI,CAAC,iBAAiB,EAAE;YACxB,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,KAAK,EAAE;SAClC,CAAC,CAAC;QACH,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;IACrB,CAAC;CACF"}
@@ -0,0 +1,34 @@
1
+ import assert from 'assert';
2
+ import { CustomerPortalEnable as CustomerPortalEnabled } from './index.js';
3
+ const tests = [
4
+ {
5
+ description: 'should ignore a non-existent target flag',
6
+ source: true,
7
+ target: undefined,
8
+ expected: undefined,
9
+ },
10
+ {
11
+ description: 'should ignore a matching target flag',
12
+ source: true,
13
+ target: true,
14
+ expected: undefined,
15
+ },
16
+ {
17
+ description: 'should detect a changed flag',
18
+ source: false,
19
+ target: true,
20
+ expected: true,
21
+ },
22
+ ];
23
+ describe('CustomerPortalEnabled', () => {
24
+ describe('diff()', () => {
25
+ const p = new CustomerPortalEnabled(global.bf);
26
+ for (const t of tests) {
27
+ it(t.description, () => {
28
+ const actual = p.diff(t.source, t.target);
29
+ assert.deepStrictEqual(actual, t.expected);
30
+ });
31
+ }
32
+ });
33
+ });
34
+ //# sourceMappingURL=index.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.test.js","sourceRoot":"","sources":["../../../../src/plugins/customer-portal/enabled/index.test.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,oBAAoB,IAAI,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAS3E,MAAM,KAAK,GAAQ;IACjB;QACE,WAAW,EAAE,0CAA0C;QACvD,MAAM,EAAE,IAAI;QACZ,MAAM,EAAE,SAAS;QACjB,QAAQ,EAAE,SAAS;KACpB;IACD;QACE,WAAW,EAAE,sCAAsC;QACnD,MAAM,EAAE,IAAI;QACZ,MAAM,EAAE,IAAI;QACZ,QAAQ,EAAE,SAAS;KACpB;IACD;QACE,WAAW,EAAE,8BAA8B;QAC3C,MAAM,EAAE,KAAK;QACb,MAAM,EAAE,IAAI;QACZ,QAAQ,EAAE,IAAI;KACf;CACF,CAAC;AAEF,QAAQ,CAAC,uBAAuB,EAAE,GAAG,EAAE;IACrC,QAAQ,CAAC,QAAQ,EAAE,GAAG,EAAE;QACtB,MAAM,CAAC,GAAG,IAAI,qBAAqB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAC/C,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;YACtB,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,EAAE;gBACrB,MAAM,MAAM,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC;gBAC1C,MAAM,CAAC,eAAe,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC;YAC7C,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { BrowserforcePlugin } from '../../plugin.js';
2
+ import { Config as CustomerPortalAvailableCustomObjectsConfig } from './available-custom-objects/index.js';
3
+ import { Config as CustomerPortalEnableConfig } from './enabled/index.js';
4
+ import { Config as CustomerPortalSetupConfig } from './portals/index.js';
5
+ type Config = {
6
+ enabled?: CustomerPortalEnableConfig;
7
+ portals?: CustomerPortalSetupConfig;
8
+ availableCustomObjects?: CustomerPortalAvailableCustomObjectsConfig;
9
+ };
10
+ export declare class CustomerPortal extends BrowserforcePlugin {
11
+ retrieve(definition: Config): Promise<Config>;
12
+ diff(state: Config, definition: Config): Config | undefined;
13
+ apply(config: Config): Promise<void>;
14
+ }
15
+ export {};
@@ -0,0 +1 @@
1
+ export {};