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.
Files changed (285) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +266 -0
  3. package/bin/run +9 -0
  4. package/bin/run.cmd +3 -0
  5. package/lib/browserforce-command.d.ts +27 -0
  6. package/lib/browserforce-command.js +162 -0
  7. package/lib/browserforce-command.js.map +1 -0
  8. package/lib/browserforce.d.ts +27 -0
  9. package/lib/browserforce.js +163 -0
  10. package/lib/browserforce.js.map +1 -0
  11. package/lib/commands/browserforce/apply.d.ts +10 -0
  12. package/lib/commands/browserforce/apply.js +83 -0
  13. package/lib/commands/browserforce/apply.js.map +1 -0
  14. package/lib/commands/browserforce/playwright.d.ts +9 -0
  15. package/lib/commands/browserforce/playwright.js +53 -0
  16. package/lib/commands/browserforce/playwright.js.map +1 -0
  17. package/lib/config-parser.d.ts +16 -0
  18. package/lib/config-parser.js +24 -0
  19. package/lib/config-parser.js.map +1 -0
  20. package/lib/index.d.ts +1 -0
  21. package/lib/index.js +2 -0
  22. package/lib/index.js.map +1 -0
  23. package/lib/jsforce-utils.d.ts +5 -0
  24. package/lib/jsforce-utils.js +14 -0
  25. package/lib/jsforce-utils.js.map +1 -0
  26. package/lib/pages/login.d.ts +7 -0
  27. package/lib/pages/login.js +17 -0
  28. package/lib/pages/login.js.map +1 -0
  29. package/lib/plugin.d.ts +15 -0
  30. package/lib/plugin.js +28 -0
  31. package/lib/plugin.js.map +1 -0
  32. package/lib/plugins/activity-settings/index.d.ts +9 -0
  33. package/lib/plugins/activity-settings/index.e2e-spec.d.ts +1 -0
  34. package/lib/plugins/activity-settings/index.e2e-spec.js +36 -0
  35. package/lib/plugins/activity-settings/index.e2e-spec.js.map +1 -0
  36. package/lib/plugins/activity-settings/index.js +102 -0
  37. package/lib/plugins/activity-settings/index.js.map +1 -0
  38. package/lib/plugins/auth-providers/index.d.ts +13 -0
  39. package/lib/plugins/auth-providers/index.e2e-spec.d.ts +1 -0
  40. package/lib/plugins/auth-providers/index.e2e-spec.js +78 -0
  41. package/lib/plugins/auth-providers/index.e2e-spec.js.map +1 -0
  42. package/lib/plugins/auth-providers/index.js +135 -0
  43. package/lib/plugins/auth-providers/index.js.map +1 -0
  44. package/lib/plugins/company-information/index.d.ts +8 -0
  45. package/lib/plugins/company-information/index.e2e-spec.d.ts +1 -0
  46. package/lib/plugins/company-information/index.e2e-spec.js +37 -0
  47. package/lib/plugins/company-information/index.e2e-spec.js.map +1 -0
  48. package/lib/plugins/company-information/index.js +114 -0
  49. package/lib/plugins/company-information/index.js.map +1 -0
  50. package/lib/plugins/customer-portal/available-custom-objects/index.d.ts +14 -0
  51. package/lib/plugins/customer-portal/available-custom-objects/index.js +203 -0
  52. package/lib/plugins/customer-portal/available-custom-objects/index.js.map +1 -0
  53. package/lib/plugins/customer-portal/available-custom-objects/index.test.d.ts +1 -0
  54. package/lib/plugins/customer-portal/available-custom-objects/index.test.js +39 -0
  55. package/lib/plugins/customer-portal/available-custom-objects/index.test.js.map +1 -0
  56. package/lib/plugins/customer-portal/enabled/index.d.ts +6 -0
  57. package/lib/plugins/customer-portal/enabled/index.js +89 -0
  58. package/lib/plugins/customer-portal/enabled/index.js.map +1 -0
  59. package/lib/plugins/customer-portal/enabled/index.test.d.ts +1 -0
  60. package/lib/plugins/customer-portal/enabled/index.test.js +34 -0
  61. package/lib/plugins/customer-portal/enabled/index.test.js.map +1 -0
  62. package/lib/plugins/customer-portal/index.d.ts +15 -0
  63. package/lib/plugins/customer-portal/index.e2e-spec.d.ts +1 -0
  64. package/lib/plugins/customer-portal/index.e2e-spec.js +188 -0
  65. package/lib/plugins/customer-portal/index.e2e-spec.js.map +1 -0
  66. package/lib/plugins/customer-portal/index.js +58 -0
  67. package/lib/plugins/customer-portal/index.js.map +1 -0
  68. package/lib/plugins/customer-portal/index.test.d.ts +1 -0
  69. package/lib/plugins/customer-portal/index.test.js +84 -0
  70. package/lib/plugins/customer-portal/index.test.js.map +1 -0
  71. package/lib/plugins/customer-portal/portals/index.d.ts +25 -0
  72. package/lib/plugins/customer-portal/portals/index.js +254 -0
  73. package/lib/plugins/customer-portal/portals/index.js.map +1 -0
  74. package/lib/plugins/customer-portal/portals/index.test.d.ts +1 -0
  75. package/lib/plugins/customer-portal/portals/index.test.js +140 -0
  76. package/lib/plugins/customer-portal/portals/index.test.js.map +1 -0
  77. package/lib/plugins/density-settings/index.d.ts +10 -0
  78. package/lib/plugins/density-settings/index.e2e-spec.d.ts +1 -0
  79. package/lib/plugins/density-settings/index.e2e-spec.js +39 -0
  80. package/lib/plugins/density-settings/index.e2e-spec.js.map +1 -0
  81. package/lib/plugins/density-settings/index.js +101 -0
  82. package/lib/plugins/density-settings/index.js.map +1 -0
  83. package/lib/plugins/deprecated.d.ts +4 -0
  84. package/lib/plugins/deprecated.js +28 -0
  85. package/lib/plugins/deprecated.js.map +1 -0
  86. package/lib/plugins/email-deliverability/index.d.ts +9 -0
  87. package/lib/plugins/email-deliverability/index.e2e-spec.d.ts +1 -0
  88. package/lib/plugins/email-deliverability/index.e2e-spec.js +55 -0
  89. package/lib/plugins/email-deliverability/index.e2e-spec.js.map +1 -0
  90. package/lib/plugins/email-deliverability/index.js +109 -0
  91. package/lib/plugins/email-deliverability/index.js.map +1 -0
  92. package/lib/plugins/high-velocity-sales-settings/index.d.ts +10 -0
  93. package/lib/plugins/high-velocity-sales-settings/index.e2e-spec.d.ts +1 -0
  94. package/lib/plugins/high-velocity-sales-settings/index.e2e-spec.js +29 -0
  95. package/lib/plugins/high-velocity-sales-settings/index.e2e-spec.js.map +1 -0
  96. package/lib/plugins/high-velocity-sales-settings/index.js +105 -0
  97. package/lib/plugins/high-velocity-sales-settings/index.js.map +1 -0
  98. package/lib/plugins/high-velocity-sales-settings/page.d.ts +8 -0
  99. package/lib/plugins/high-velocity-sales-settings/page.js +27 -0
  100. package/lib/plugins/high-velocity-sales-settings/page.js.map +1 -0
  101. package/lib/plugins/history-tracking/index.d.ts +19 -0
  102. package/lib/plugins/history-tracking/index.e2e-spec.d.ts +1 -0
  103. package/lib/plugins/history-tracking/index.e2e-spec.js +128 -0
  104. package/lib/plugins/history-tracking/index.e2e-spec.js.map +1 -0
  105. package/lib/plugins/history-tracking/index.js +272 -0
  106. package/lib/plugins/history-tracking/index.js.map +1 -0
  107. package/lib/plugins/home-page-layouts/index.d.ts +14 -0
  108. package/lib/plugins/home-page-layouts/index.e2e-spec.d.ts +1 -0
  109. package/lib/plugins/home-page-layouts/index.e2e-spec.js +47 -0
  110. package/lib/plugins/home-page-layouts/index.e2e-spec.js.map +1 -0
  111. package/lib/plugins/home-page-layouts/index.js +145 -0
  112. package/lib/plugins/home-page-layouts/index.js.map +1 -0
  113. package/lib/plugins/home-page-layouts/index.test.d.ts +1 -0
  114. package/lib/plugins/home-page-layouts/index.test.js +104 -0
  115. package/lib/plugins/home-page-layouts/index.test.js.map +1 -0
  116. package/lib/plugins/index.d.ts +28 -0
  117. package/lib/plugins/index.js +29 -0
  118. package/lib/plugins/index.js.map +1 -0
  119. package/lib/plugins/lightning-experience-settings/index.d.ts +17 -0
  120. package/lib/plugins/lightning-experience-settings/index.e2e-spec.d.ts +1 -0
  121. package/lib/plugins/lightning-experience-settings/index.e2e-spec.js +48 -0
  122. package/lib/plugins/lightning-experience-settings/index.e2e-spec.js.map +1 -0
  123. package/lib/plugins/lightning-experience-settings/index.js +149 -0
  124. package/lib/plugins/lightning-experience-settings/index.js.map +1 -0
  125. package/lib/plugins/linkedin-sales-navigator-settings/index.d.ts +8 -0
  126. package/lib/plugins/linkedin-sales-navigator-settings/index.e2e-spec.d.ts +1 -0
  127. package/lib/plugins/linkedin-sales-navigator-settings/index.e2e-spec.js +29 -0
  128. package/lib/plugins/linkedin-sales-navigator-settings/index.e2e-spec.js.map +1 -0
  129. package/lib/plugins/linkedin-sales-navigator-settings/index.js +93 -0
  130. package/lib/plugins/linkedin-sales-navigator-settings/index.js.map +1 -0
  131. package/lib/plugins/linkedin-sales-navigator-settings/page.d.ts +9 -0
  132. package/lib/plugins/linkedin-sales-navigator-settings/page.js +35 -0
  133. package/lib/plugins/linkedin-sales-navigator-settings/page.js.map +1 -0
  134. package/lib/plugins/login-as-user/index.d.ts +9 -0
  135. package/lib/plugins/login-as-user/index.js +104 -0
  136. package/lib/plugins/login-as-user/index.js.map +1 -0
  137. package/lib/plugins/logout-login-as-user/index.d.ts +6 -0
  138. package/lib/plugins/logout-login-as-user/index.js +76 -0
  139. package/lib/plugins/logout-login-as-user/index.js.map +1 -0
  140. package/lib/plugins/omni-channel-settings/index.d.ts +9 -0
  141. package/lib/plugins/omni-channel-settings/index.e2e-spec.d.ts +1 -0
  142. package/lib/plugins/omni-channel-settings/index.e2e-spec.js +30 -0
  143. package/lib/plugins/omni-channel-settings/index.e2e-spec.js.map +1 -0
  144. package/lib/plugins/omni-channel-settings/index.js +97 -0
  145. package/lib/plugins/omni-channel-settings/index.js.map +1 -0
  146. package/lib/plugins/opportunity-splits/index.d.ts +9 -0
  147. package/lib/plugins/opportunity-splits/index.e2e-spec.d.ts +1 -0
  148. package/lib/plugins/opportunity-splits/index.e2e-spec.js +46 -0
  149. package/lib/plugins/opportunity-splits/index.e2e-spec.js.map +1 -0
  150. package/lib/plugins/opportunity-splits/index.js +117 -0
  151. package/lib/plugins/opportunity-splits/index.js.map +1 -0
  152. package/lib/plugins/opportunity-splits/pages/layout-selection.d.ts +8 -0
  153. package/lib/plugins/opportunity-splits/pages/layout-selection.js +15 -0
  154. package/lib/plugins/opportunity-splits/pages/layout-selection.js.map +1 -0
  155. package/lib/plugins/opportunity-splits/pages/overview.d.ts +11 -0
  156. package/lib/plugins/opportunity-splits/pages/overview.js +32 -0
  157. package/lib/plugins/opportunity-splits/pages/overview.js.map +1 -0
  158. package/lib/plugins/opportunity-splits/pages/setup.d.ts +9 -0
  159. package/lib/plugins/opportunity-splits/pages/setup.js +17 -0
  160. package/lib/plugins/opportunity-splits/pages/setup.js.map +1 -0
  161. package/lib/plugins/permission-sets/index.d.ts +10 -0
  162. package/lib/plugins/permission-sets/index.e2e-spec.d.ts +1 -0
  163. package/lib/plugins/permission-sets/index.e2e-spec.js +47 -0
  164. package/lib/plugins/permission-sets/index.e2e-spec.js.map +1 -0
  165. package/lib/plugins/permission-sets/index.js +22 -0
  166. package/lib/plugins/permission-sets/index.js.map +1 -0
  167. package/lib/plugins/permission-sets/service-presence-status/index.d.ts +10 -0
  168. package/lib/plugins/permission-sets/service-presence-status/index.js +124 -0
  169. package/lib/plugins/permission-sets/service-presence-status/index.js.map +1 -0
  170. package/lib/plugins/picklists/field-dependencies/index.d.ts +11 -0
  171. package/lib/plugins/picklists/field-dependencies/index.js +133 -0
  172. package/lib/plugins/picklists/field-dependencies/index.js.map +1 -0
  173. package/lib/plugins/picklists/field-dependencies/index.test.d.ts +1 -0
  174. package/lib/plugins/picklists/field-dependencies/index.test.js +64 -0
  175. package/lib/plugins/picklists/field-dependencies/index.test.js.map +1 -0
  176. package/lib/plugins/picklists/field-dependencies/pages.d.ts +15 -0
  177. package/lib/plugins/picklists/field-dependencies/pages.js +50 -0
  178. package/lib/plugins/picklists/field-dependencies/pages.js.map +1 -0
  179. package/lib/plugins/picklists/index.d.ts +23 -0
  180. package/lib/plugins/picklists/index.e2e-spec.d.ts +1 -0
  181. package/lib/plugins/picklists/index.e2e-spec.js +128 -0
  182. package/lib/plugins/picklists/index.e2e-spec.js.map +1 -0
  183. package/lib/plugins/picklists/index.js +229 -0
  184. package/lib/plugins/picklists/index.js.map +1 -0
  185. package/lib/plugins/picklists/pages.d.ts +45 -0
  186. package/lib/plugins/picklists/pages.js +185 -0
  187. package/lib/plugins/picklists/pages.js.map +1 -0
  188. package/lib/plugins/picklists/standard-value-set.d.ts +1 -0
  189. package/lib/plugins/picklists/standard-value-set.js +80 -0
  190. package/lib/plugins/picklists/standard-value-set.js.map +1 -0
  191. package/lib/plugins/record-types/index.d.ts +14 -0
  192. package/lib/plugins/record-types/index.e2e-spec.d.ts +1 -0
  193. package/lib/plugins/record-types/index.e2e-spec.js +76 -0
  194. package/lib/plugins/record-types/index.e2e-spec.js.map +1 -0
  195. package/lib/plugins/record-types/index.js +133 -0
  196. package/lib/plugins/record-types/index.js.map +1 -0
  197. package/lib/plugins/record-types/pages.d.ts +14 -0
  198. package/lib/plugins/record-types/pages.js +50 -0
  199. package/lib/plugins/record-types/pages.js.map +1 -0
  200. package/lib/plugins/relate-contact-to-multiple-accounts/index.d.ts +11 -0
  201. package/lib/plugins/relate-contact-to-multiple-accounts/index.e2e-spec.d.ts +1 -0
  202. package/lib/plugins/relate-contact-to-multiple-accounts/index.e2e-spec.js +30 -0
  203. package/lib/plugins/relate-contact-to-multiple-accounts/index.e2e-spec.js.map +1 -0
  204. package/lib/plugins/relate-contact-to-multiple-accounts/index.js +120 -0
  205. package/lib/plugins/relate-contact-to-multiple-accounts/index.js.map +1 -0
  206. package/lib/plugins/reports-and-dashboards/folder-sharing/index.d.ts +8 -0
  207. package/lib/plugins/reports-and-dashboards/folder-sharing/index.e2e-spec.d.ts +1 -0
  208. package/lib/plugins/reports-and-dashboards/folder-sharing/index.e2e-spec.js +3 -0
  209. package/lib/plugins/reports-and-dashboards/folder-sharing/index.e2e-spec.js.map +1 -0
  210. package/lib/plugins/reports-and-dashboards/folder-sharing/index.js +116 -0
  211. package/lib/plugins/reports-and-dashboards/folder-sharing/index.js.map +1 -0
  212. package/lib/plugins/reports-and-dashboards/index.d.ts +11 -0
  213. package/lib/plugins/reports-and-dashboards/index.e2e-spec.d.ts +1 -0
  214. package/lib/plugins/reports-and-dashboards/index.e2e-spec.js +3 -0
  215. package/lib/plugins/reports-and-dashboards/index.e2e-spec.js.map +1 -0
  216. package/lib/plugins/reports-and-dashboards/index.js +29 -0
  217. package/lib/plugins/reports-and-dashboards/index.js.map +1 -0
  218. package/lib/plugins/salesforce-cpq-config/formConfig.d.ts +17 -0
  219. package/lib/plugins/salesforce-cpq-config/formConfig.js +649 -0
  220. package/lib/plugins/salesforce-cpq-config/formConfig.js.map +1 -0
  221. package/lib/plugins/salesforce-cpq-config/index.d.ts +7 -0
  222. package/lib/plugins/salesforce-cpq-config/index.e2e-spec.d.ts +1 -0
  223. package/lib/plugins/salesforce-cpq-config/index.e2e-spec.js +37 -0
  224. package/lib/plugins/salesforce-cpq-config/index.e2e-spec.js.map +1 -0
  225. package/lib/plugins/salesforce-cpq-config/index.js +261 -0
  226. package/lib/plugins/salesforce-cpq-config/index.js.map +1 -0
  227. package/lib/plugins/salesforce-to-salesforce/index.d.ts +9 -0
  228. package/lib/plugins/salesforce-to-salesforce/index.e2e-spec.d.ts +1 -0
  229. package/lib/plugins/salesforce-to-salesforce/index.e2e-spec.js +34 -0
  230. package/lib/plugins/salesforce-to-salesforce/index.e2e-spec.js.map +1 -0
  231. package/lib/plugins/salesforce-to-salesforce/index.js +107 -0
  232. package/lib/plugins/salesforce-to-salesforce/index.js.map +1 -0
  233. package/lib/plugins/scheduled-batches/index.d.ts +10 -0
  234. package/lib/plugins/scheduled-batches/index.js +145 -0
  235. package/lib/plugins/scheduled-batches/index.js.map +1 -0
  236. package/lib/plugins/scheduled-batches/page.d.ts +19 -0
  237. package/lib/plugins/scheduled-batches/page.js +39 -0
  238. package/lib/plugins/scheduled-batches/page.js.map +1 -0
  239. package/lib/plugins/security/authentication-configuration/index.d.ts +15 -0
  240. package/lib/plugins/security/authentication-configuration/index.e2e-spec.d.ts +1 -0
  241. package/lib/plugins/security/authentication-configuration/index.e2e-spec.js +129 -0
  242. package/lib/plugins/security/authentication-configuration/index.e2e-spec.js.map +1 -0
  243. package/lib/plugins/security/authentication-configuration/index.js +200 -0
  244. package/lib/plugins/security/authentication-configuration/index.js.map +1 -0
  245. package/lib/plugins/security/certificate-and-key-management/index.d.ts +23 -0
  246. package/lib/plugins/security/certificate-and-key-management/index.e2e-spec.d.ts +1 -0
  247. package/lib/plugins/security/certificate-and-key-management/index.e2e-spec.js +59 -0
  248. package/lib/plugins/security/certificate-and-key-management/index.e2e-spec.js.map +1 -0
  249. package/lib/plugins/security/certificate-and-key-management/index.js +233 -0
  250. package/lib/plugins/security/certificate-and-key-management/index.js.map +1 -0
  251. package/lib/plugins/security/certificate-and-key-management/index.test.d.ts +1 -0
  252. package/lib/plugins/security/certificate-and-key-management/index.test.js +61 -0
  253. package/lib/plugins/security/certificate-and-key-management/index.test.js.map +1 -0
  254. package/lib/plugins/security/index.d.ts +13 -0
  255. package/lib/plugins/security/index.js +41 -0
  256. package/lib/plugins/security/index.js.map +1 -0
  257. package/lib/plugins/service-channels/capacity/index.d.ts +18 -0
  258. package/lib/plugins/service-channels/capacity/index.js +194 -0
  259. package/lib/plugins/service-channels/capacity/index.js.map +1 -0
  260. package/lib/plugins/service-channels/index.d.ts +12 -0
  261. package/lib/plugins/service-channels/index.e2e-spec.d.ts +1 -0
  262. package/lib/plugins/service-channels/index.e2e-spec.js +67 -0
  263. package/lib/plugins/service-channels/index.e2e-spec.js.map +1 -0
  264. package/lib/plugins/service-channels/index.js +37 -0
  265. package/lib/plugins/service-channels/index.js.map +1 -0
  266. package/lib/plugins/slack/index.d.ts +9 -0
  267. package/lib/plugins/slack/index.e2e-spec.d.ts +1 -0
  268. package/lib/plugins/slack/index.e2e-spec.js +47 -0
  269. package/lib/plugins/slack/index.e2e-spec.js.map +1 -0
  270. package/lib/plugins/slack/index.js +111 -0
  271. package/lib/plugins/slack/index.js.map +1 -0
  272. package/lib/plugins/user-access-policies/index.d.ts +19 -0
  273. package/lib/plugins/user-access-policies/index.e2e-spec.d.ts +1 -0
  274. package/lib/plugins/user-access-policies/index.e2e-spec.js +61 -0
  275. package/lib/plugins/user-access-policies/index.e2e-spec.js.map +1 -0
  276. package/lib/plugins/user-access-policies/index.js +176 -0
  277. package/lib/plugins/user-access-policies/index.js.map +1 -0
  278. package/lib/plugins/user-access-policies/page.d.ts +30 -0
  279. package/lib/plugins/user-access-policies/page.js +114 -0
  280. package/lib/plugins/user-access-policies/page.js.map +1 -0
  281. package/lib/plugins/utils.d.ts +13 -0
  282. package/lib/plugins/utils.js +159 -0
  283. package/lib/plugins/utils.js.map +1 -0
  284. package/oclif.manifest.json +177 -0
  285. package/package.json +65 -0
@@ -0,0 +1,102 @@
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 = '/setup/activitiesSetupPage.apexp';
55
+ const MANY_WHO_PREF_INPUT_SELECTOR = 'input[id="thePage:theForm:theBlock:manyWhoPref"]';
56
+ const SUBMIT_BUTTON_SELECTOR = 'input[id="thePage:theForm:theBlock:buttons:submit"]';
57
+ export class ActivitySettings extends BrowserforcePlugin {
58
+ async retrieve() {
59
+ const env_1 = { stack: [], error: void 0, hasError: false };
60
+ try {
61
+ const page = __addDisposableResource(env_1, await this.browserforce.openPage(BASE_PATH), true);
62
+ const response = {
63
+ allowUsersToRelateMultipleContactsToTasksAndEvents: await page.locator(MANY_WHO_PREF_INPUT_SELECTOR).isChecked(),
64
+ };
65
+ return response;
66
+ }
67
+ catch (e_1) {
68
+ env_1.error = e_1;
69
+ env_1.hasError = true;
70
+ }
71
+ finally {
72
+ const result_1 = __disposeResources(env_1);
73
+ if (result_1)
74
+ await result_1;
75
+ }
76
+ }
77
+ async apply(config) {
78
+ const env_2 = { stack: [], error: void 0, hasError: false };
79
+ try {
80
+ if (config.allowUsersToRelateMultipleContactsToTasksAndEvents === false) {
81
+ throw new Error('`allowUsersToRelateMultipleContactsToTasksAndEvents` can only be disabled with help of the salesforce.com Support team');
82
+ }
83
+ const page = __addDisposableResource(env_2, await this.browserforce.openPage(BASE_PATH), true);
84
+ await page.locator(MANY_WHO_PREF_INPUT_SELECTOR).waitFor();
85
+ await page
86
+ .locator(MANY_WHO_PREF_INPUT_SELECTOR)
87
+ .setChecked(config.allowUsersToRelateMultipleContactsToTasksAndEvents);
88
+ await page.locator(SUBMIT_BUTTON_SELECTOR).click();
89
+ await page.waitForURL((url) => url.pathname === '/ui/setup/Setup');
90
+ }
91
+ catch (e_2) {
92
+ env_2.error = e_2;
93
+ env_2.hasError = true;
94
+ }
95
+ finally {
96
+ const result_2 = __disposeResources(env_2);
97
+ if (result_2)
98
+ await result_2;
99
+ }
100
+ }
101
+ }
102
+ //# 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,kCAAkC,CAAC;AAErD,MAAM,4BAA4B,GAAG,kDAAkD,CAAC;AACxF,MAAM,sBAAsB,GAAG,qDAAqD,CAAC;AAMrF,MAAM,OAAO,gBAAiB,SAAQ,kBAAkB;IAC/C,KAAK,CAAC,QAAQ;;;YACnB,MAAY,IAAI,kCAAG,MAAM,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,SAAS,CAAC,OAAA,CAAC;YAC/D,MAAM,QAAQ,GAAG;gBACf,kDAAkD,EAAE,MAAM,IAAI,CAAC,OAAO,CAAC,4BAA4B,CAAC,CAAC,SAAS,EAAE;aACjH,CAAC;YACF,OAAO,QAAQ,CAAC;;;;;;;;;;;KACjB;IAEM,KAAK,CAAC,KAAK,CAAC,MAAc;;;YAC/B,IAAI,MAAM,CAAC,kDAAkD,KAAK,KAAK,EAAE,CAAC;gBACxE,MAAM,IAAI,KAAK,CACb,wHAAwH,CACzH,CAAC;YACJ,CAAC;YACD,MAAY,IAAI,kCAAG,MAAM,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,SAAS,CAAC,OAAA,CAAC;YAC/D,MAAM,IAAI,CAAC,OAAO,CAAC,4BAA4B,CAAC,CAAC,OAAO,EAAE,CAAC;YAE3D,MAAM,IAAI;iBACP,OAAO,CAAC,4BAA4B,CAAC;iBACrC,UAAU,CAAC,MAAM,CAAC,kDAAkD,CAAC,CAAC;YAEzE,MAAM,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC,KAAK,EAAE,CAAC;YACnD,MAAM,IAAI,CAAC,UAAU,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,KAAK,iBAAiB,CAAC,CAAC;;;;;;;;;;;KACpE;CACF"}
@@ -0,0 +1,13 @@
1
+ import { BrowserforcePlugin } from '../../plugin.js';
2
+ type AuthProviderConfig = {
3
+ consumerSecret?: string;
4
+ consumerKey?: string;
5
+ };
6
+ export type Config = {
7
+ [developerName: string]: AuthProviderConfig;
8
+ };
9
+ export declare class AuthProviders extends BrowserforcePlugin {
10
+ retrieve(): Promise<Config>;
11
+ apply(config: Config): Promise<void>;
12
+ }
13
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,78 @@
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 { AuthProviders } from './index.js';
6
+ const __dirname = fileURLToPath(new URL('.', import.meta.url));
7
+ describe(AuthProviders.name, function () {
8
+ this.timeout('10m');
9
+ let plugin;
10
+ before(() => {
11
+ plugin = new AuthProviders(global.browserforce);
12
+ });
13
+ const configWithSecretAndKey = {
14
+ TestAuthProvider: {
15
+ consumerSecret: 'test-secret-12345',
16
+ consumerKey: 'test-key-67890',
17
+ },
18
+ };
19
+ const configWithSecretOnly = {
20
+ TestAuthProvider: {
21
+ consumerSecret: 'updated-secret-abcde',
22
+ },
23
+ };
24
+ const configWithKeyOnly = {
25
+ TestAuthProvider: {
26
+ consumerKey: 'updated-key-fghij',
27
+ },
28
+ };
29
+ const configEmpty = {
30
+ TestAuthProvider: {},
31
+ };
32
+ it('should deploy an AuthProvider for testing', () => {
33
+ const sourceDeployCmd = child.spawnSync('sf', [
34
+ 'project',
35
+ 'deploy',
36
+ 'start',
37
+ '-d',
38
+ path.join(__dirname, 'sfdx-source'),
39
+ '--json',
40
+ ]);
41
+ assert.deepStrictEqual(sourceDeployCmd.status, 0, sourceDeployCmd.output.toString());
42
+ });
43
+ it('should update consumerSecret and consumerKey', async () => {
44
+ await plugin.apply(configWithSecretAndKey);
45
+ // Note: retrieve() returns empty config, so we can only verify apply completes without errors
46
+ });
47
+ it('should update consumerSecret only', async () => {
48
+ await plugin.apply(configWithSecretOnly);
49
+ });
50
+ it('should update consumerKey only', async () => {
51
+ await plugin.apply(configWithKeyOnly);
52
+ });
53
+ it('should handle empty config without errors', async () => {
54
+ await plugin.apply(configEmpty);
55
+ });
56
+ it('should throw an error when AuthProvider does not exist', async () => {
57
+ const configInvalid = {
58
+ NonExistentAuthProvider: {
59
+ consumerSecret: 'test-secret',
60
+ consumerKey: 'test-key',
61
+ },
62
+ };
63
+ let err;
64
+ try {
65
+ await plugin.apply(configInvalid);
66
+ }
67
+ catch (e) {
68
+ err = e;
69
+ }
70
+ assert.throws(() => {
71
+ throw err;
72
+ }, /No AuthProviders found with DeveloperNames/);
73
+ });
74
+ it('should remove the testing AuthProvider', async () => {
75
+ await global.browserforce.connection.metadata.delete('AuthProvider', ['TestAuthProvider']);
76
+ });
77
+ });
78
+ //# sourceMappingURL=index.e2e-spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.e2e-spec.js","sourceRoot":"","sources":["../../../src/plugins/auth-providers/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,aAAa,EAAE,MAAM,YAAY,CAAC;AAExD,MAAM,SAAS,GAAG,aAAa,CAAC,IAAI,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAE/D,QAAQ,CAAC,aAAa,CAAC,IAAI,EAAE;IAC3B,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACpB,IAA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K,CAAC,iBAAiB,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,2CAA2C,EAAE,KAAK,IAAI,EAAE;QACzD,MAAM,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,wDAAwD,EAAE,KAAK,IAAI,EAAE;QACtE,MAAM,aAAa,GAAW;YAC5B,uBAAuB,EAAE;gBACvB,cAAc,EAAE,aAAa;gBAC7B,WAAW,EAAE,UAAU;aACxB;SACF,CAAC;QACF,IAAI,GAAG,CAAC;QACR,IAAI,CAAC;YACH,MAAM,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;QACpC,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,4CAA4C,CAAC,CAAC;IACnD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,wCAAwC,EAAE,KAAK,IAAI,EAAE;QACtD,MAAM,MAAM,CAAC,YAAY,CAAC,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC,kBAAkB,CAAC,CAAC,CAAC;IAC7F,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,135 @@
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 { waitForPageErrors } from '../../browserforce.js';
54
+ import { BrowserforcePlugin } from '../../plugin.js';
55
+ const CONSUMER_SECRET_SELECTOR = '#ConsumerSecret';
56
+ const CONSUMER_KEY_SELECTOR = '#ConsumerKey';
57
+ const SAVE_BUTTON_SELECTOR = 'input[id$=":saveBtn"], #topButtonRow > input[name="save"], button[title="Save"]';
58
+ const getUrl = (orgId) => `/${orgId}/e?retURL=/${orgId}`;
59
+ export class AuthProviders extends BrowserforcePlugin {
60
+ async retrieve() {
61
+ // Skip retrieve as requested - return empty config
62
+ return {};
63
+ }
64
+ async apply(config) {
65
+ if (!config || Object.keys(config).length === 0) {
66
+ return;
67
+ }
68
+ const developerNames = Object.keys(config);
69
+ const developerNamesList = developerNames.map((name) => `'${name}'`).join(',');
70
+ // Query AuthProviders using standard REST API (not Tooling API)
71
+ const authProviders = await this.browserforce.connection.query(`SELECT Id, DeveloperName FROM AuthProvider WHERE DeveloperName IN (${developerNamesList})`);
72
+ if (authProviders.records.length === 0) {
73
+ throw new Error(`No AuthProviders found with DeveloperNames: ${developerNames.join(', ')}`);
74
+ }
75
+ // Create a map for quick lookup
76
+ const authProviderMap = new Map();
77
+ for (const authProvider of authProviders.records) {
78
+ authProviderMap.set(authProvider.DeveloperName, authProvider.Id);
79
+ }
80
+ // Verify we found all required AuthProviders
81
+ const missingProviders = developerNames.filter((name) => !authProviderMap.has(name));
82
+ if (missingProviders.length > 0) {
83
+ throw new Error(`AuthProvider with DeveloperName(s) not found: ${missingProviders.join(', ')}. ` +
84
+ `Please verify the DeveloperNames are correct and the AuthProviders exist in your org.`);
85
+ }
86
+ // Process each auth provider configuration
87
+ for (const [developerName, authProviderConfig] of Object.entries(config)) {
88
+ const authProviderId = authProviderMap.get(developerName);
89
+ if (!authProviderId) {
90
+ throw new Error(`AuthProvider with DeveloperName '${developerName}' not found`);
91
+ }
92
+ try {
93
+ // Check if there are updates to consumerSecret or consumerKey
94
+ const hasConsumerUpdates = authProviderConfig.consumerSecret !== undefined || authProviderConfig.consumerKey !== undefined;
95
+ if (hasConsumerUpdates) {
96
+ const env_1 = { stack: [], error: void 0, hasError: false };
97
+ try {
98
+ // Navigate to the edit page
99
+ const editPageUrl = getUrl(authProviderId);
100
+ this.browserforce.logger?.log(`Navigating to edit page for ${developerName}: ${editPageUrl}`);
101
+ const page = __addDisposableResource(env_1, await this.browserforce.openPage(editPageUrl), true);
102
+ // Update ConsumerSecret if provided
103
+ if (authProviderConfig.consumerSecret !== undefined) {
104
+ await page.locator(CONSUMER_SECRET_SELECTOR).fill(authProviderConfig.consumerSecret);
105
+ }
106
+ // Update ConsumerKey if provided
107
+ if (authProviderConfig.consumerKey !== undefined) {
108
+ await page.locator(CONSUMER_KEY_SELECTOR).fill(authProviderConfig.consumerKey);
109
+ }
110
+ // Save the changes
111
+ const saveButtonLocator = page.locator(SAVE_BUTTON_SELECTOR);
112
+ await saveButtonLocator.first().click();
113
+ await Promise.race([
114
+ page.waitForURL((url) => url.pathname === `/${authProviderId}`),
115
+ waitForPageErrors(page),
116
+ ]);
117
+ }
118
+ catch (e_1) {
119
+ env_1.error = e_1;
120
+ env_1.hasError = true;
121
+ }
122
+ finally {
123
+ const result_1 = __disposeResources(env_1);
124
+ if (result_1)
125
+ await result_1;
126
+ }
127
+ }
128
+ }
129
+ catch (error) {
130
+ throw new Error(`Failed to update AuthProvider '${developerName}': ${error.message}`);
131
+ }
132
+ }
133
+ }
134
+ }
135
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/plugins/auth-providers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAA0B,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAErD,MAAM,wBAAwB,GAAG,iBAAiB,CAAC;AACnD,MAAM,qBAAqB,GAAG,cAAc,CAAC;AAC7C,MAAM,oBAAoB,GAAG,iFAAiF,CAAC;AAE/G,MAAM,MAAM,GAAG,CAAC,KAAa,EAAqB,EAAE,CAAC,IAAI,KAAK,cAAc,KAAK,EAAuB,CAAC;AAgBzG,MAAM,OAAO,aAAc,SAAQ,kBAAkB;IAC5C,KAAK,CAAC,QAAQ;QACnB,mDAAmD;QACnD,OAAO,EAAE,CAAC;IACZ,CAAC;IAEM,KAAK,CAAC,KAAK,CAAC,MAAc;QAC/B,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,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AE,EAAE,CAAC,GAAG,CAAC,QAAQ,KAAK,IAAI,cAAc,EAAE,CAAC;4BAC/D,iBAAiB,CAAC,IAAI,CAAC;yBACxB,CAAC,CAAC;;;;;;;;;;;iBACJ;YACH,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,IAAI,KAAK,CAAC,kCAAkC,aAAa,MAAM,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;YACxF,CAAC;QACH,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,8 @@
1
+ import { BrowserforcePlugin } from '../../plugin.js';
2
+ 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.browserforce);
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
@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,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,114 @@
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 getUrl = (orgId) => `/${orgId}/e`;
55
+ const CURRENCY_DROPDOWN_SELECTOR = '#DefaultCurrencyIsoCode';
56
+ const SAVE_BUTTON_SELECTOR = 'input[class="btn"][type="submit"][name="save"]';
57
+ export class CompanyInformation extends BrowserforcePlugin {
58
+ async retrieve() {
59
+ const env_1 = { stack: [], error: void 0, hasError: false };
60
+ try {
61
+ const orgId = this.browserforce.connection.getAuthInfoFields().orgId;
62
+ const page = __addDisposableResource(env_1, await this.browserforce.openPage(getUrl(orgId)), true);
63
+ const response = {
64
+ defaultCurrencyIsoCode: '',
65
+ };
66
+ const selectedOption = await page.locator(`${CURRENCY_DROPDOWN_SELECTOR} > option[selected]`).textContent();
67
+ if (selectedOption) {
68
+ response.defaultCurrencyIsoCode = selectedOption;
69
+ }
70
+ return response;
71
+ }
72
+ catch (e_1) {
73
+ env_1.error = e_1;
74
+ env_1.hasError = true;
75
+ }
76
+ finally {
77
+ const result_1 = __disposeResources(env_1);
78
+ if (result_1)
79
+ await result_1;
80
+ }
81
+ }
82
+ async apply(config) {
83
+ if (config.defaultCurrencyIsoCode !== undefined) {
84
+ const env_2 = { stack: [], error: void 0, hasError: false };
85
+ try {
86
+ const orgId = this.browserforce.connection.getAuthInfoFields().orgId;
87
+ const page = __addDisposableResource(env_2, await this.browserforce.openPage(getUrl(orgId)), true);
88
+ await page.locator(CURRENCY_DROPDOWN_SELECTOR).waitFor();
89
+ const availableCurrencies = await page.locator(`${CURRENCY_DROPDOWN_SELECTOR} > option`).allTextContents();
90
+ if (!availableCurrencies.includes(config.defaultCurrencyIsoCode)) {
91
+ 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.`);
92
+ }
93
+ await page.locator(CURRENCY_DROPDOWN_SELECTOR).selectOption({ label: config.defaultCurrencyIsoCode });
94
+ // auto accept the dialog when it appears
95
+ page.on('dialog', (dialog) => {
96
+ dialog.accept();
97
+ });
98
+ // save
99
+ await page.locator(SAVE_BUTTON_SELECTOR).click();
100
+ await page.waitForURL((url) => !url.pathname.endsWith('/e'));
101
+ }
102
+ catch (e_2) {
103
+ env_2.error = e_2;
104
+ env_2.hasError = true;
105
+ }
106
+ finally {
107
+ const result_2 = __disposeResources(env_2);
108
+ if (result_2)
109
+ await result_2;
110
+ }
111
+ }
112
+ }
113
+ }
114
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/plugins/company-information/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAErD,MAAM,MAAM,GAAG,CAAC,KAAa,EAAqB,EAAE,CAAC,IAAI,KAAK,IAAI,CAAC;AAEnE,MAAM,0BAA0B,GAAG,yBAAyB,CAAC;AAC7D,MAAM,oBAAoB,GAAG,gDAAgD,CAAC;AAM9E,MAAM,OAAO,kBAAmB,SAAQ,kBAAkB;IACjD,KAAK,CAAC,QAAQ;;;YACnB,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,iBAAiB,EAAE,CAAC,KAAK,CAAC;YACrE,MAAY,IAAI,kCAAG,MAAM,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,OAAA,CAAC;YAEnE,MAAM,QAAQ,GAAW;gBACvB,sBAAsB,EAAE,EAAE;aAC3B,CAAC;YACF,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,0BAA0B,qBAAqB,CAAC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AG,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;;;;;;;;;;;SAC9D;IACH,CAAC;CACF"}
@@ -0,0 +1,14 @@
1
+ import { BrowserforcePlugin } 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 {};