sfdx-browserforce-plugin 5.1.0 → 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,70 @@
1
+ import { BrowserforcePlugin } from '../../plugin.js';
2
+ import { RecordTypePage } from './pages.js';
3
+ export class RecordTypes extends BrowserforcePlugin {
4
+ async retrieve(definition) {
5
+ const conn = this.org.getConnection();
6
+ const response = {
7
+ deletions: [],
8
+ };
9
+ const recordTypeFileProperties = await listRecordTypes(conn);
10
+ const recordTypes = await queryRecordTypes(conn);
11
+ for (const deletion of definition.deletions) {
12
+ const recordType = getRecordType(deletion.fullName, recordTypeFileProperties, recordTypes);
13
+ if (recordType) {
14
+ if (recordType.IsActive) {
15
+ throw new Error(`Cannot delete active RecordType: ${deletion.fullName}`);
16
+ }
17
+ if (deletion.replacement) {
18
+ const replacementRecordType = getRecordType(deletion.replacement, recordTypeFileProperties, recordTypes);
19
+ if (!replacementRecordType) {
20
+ throw new Error(`Could not find replacement RecordType: ${deletion.replacement}`);
21
+ }
22
+ }
23
+ response.deletions.push({
24
+ ...deletion,
25
+ });
26
+ }
27
+ else {
28
+ response.deletions.push(deletion);
29
+ }
30
+ }
31
+ return response;
32
+ }
33
+ async apply(config) {
34
+ const conn = this.org.getConnection();
35
+ const recordTypeFileProperties = await listRecordTypes(conn);
36
+ const recordTypes = await queryRecordTypes(conn);
37
+ for (const deletion of config.deletions) {
38
+ const recordType = getRecordType(deletion.fullName, recordTypeFileProperties, recordTypes);
39
+ const page = await this.browserforce.openPage(`ui/setup/rectype/RecordTypes?type=${recordType.EntityDefinitionId}`);
40
+ const recordTypePage = new RecordTypePage(page);
41
+ const deletePage = await recordTypePage.clickDeleteAction(recordType.Id);
42
+ let newRecordTypeId;
43
+ if (deletion.replacement) {
44
+ const replacementRecordType = getRecordType(deletion.replacement, recordTypeFileProperties, recordTypes);
45
+ newRecordTypeId = replacementRecordType.Id;
46
+ }
47
+ await deletePage.replace(newRecordTypeId);
48
+ await page.close();
49
+ }
50
+ }
51
+ }
52
+ async function listRecordTypes(conn) {
53
+ const recordTypes = await conn.metadata.list({
54
+ type: 'RecordType',
55
+ });
56
+ return recordTypes;
57
+ }
58
+ async function queryRecordTypes(conn) {
59
+ const recordTypesResult = await conn.tooling.query(`SELECT Id, EntityDefinitionId, IsActive FROM RecordType`);
60
+ const recordTypes = recordTypesResult.records;
61
+ return recordTypes;
62
+ }
63
+ function getRecordType(fullName, fileProperties, recordTypes) {
64
+ const recordTypeFileProperty = fileProperties.find((fp) => fp.fullName === fullName);
65
+ if (recordTypeFileProperty) {
66
+ return recordTypes.find((x) => x.Id === recordTypeFileProperty.id);
67
+ }
68
+ return undefined;
69
+ }
70
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/plugins/record-types/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAW5C,MAAM,OAAO,WAAY,SAAQ,kBAAkB;IAC1C,KAAK,CAAC,QAAQ,CAAC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W,CAAC;AACrB,CAAC;AAED,SAAS,aAAa,CAAC,QAAgB,EAAE,cAAc,EAAE,WAAW;IAClE,MAAM,sBAAsB,GAAG,cAAc,CAAC,IAAI,CAChD,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,QAAQ,KAAK,QAAQ,CACjC,CAAC;IACF,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,15 @@
1
+ import { Page } from 'puppeteer';
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: any;
9
+ protected saveButton: string;
10
+ constructor(page: Page);
11
+ replace(newRecordTypeId?: string): Promise<void>;
12
+ save(): Promise<void>;
13
+ throwOnMissingSaveButton(): Promise<void>;
14
+ throwPageErrors(): Promise<void>;
15
+ }
@@ -0,0 +1,64 @@
1
+ export class RecordTypePage {
2
+ page;
3
+ constructor(page) {
4
+ this.page = page;
5
+ }
6
+ async clickDeleteAction(recordTypeId) {
7
+ const xpath = `//a[contains(@href, "setup/ui/recordtypedelete.jsp?id=${recordTypeId.slice(0, 15)}")]`;
8
+ await this.page.waitForSelector(`::-p-xpath(${xpath})`);
9
+ const deleteLink = (await this.page.$$(`xpath/.${xpath}`))[0];
10
+ await Promise.all([
11
+ this.page.waitForNavigation(),
12
+ this.page.evaluate((e) => e.click(), deleteLink),
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
+ const NEW_VALUE_SELECTOR = 'select#p2';
26
+ if (newRecordTypeId) {
27
+ await this.page.waitForSelector(NEW_VALUE_SELECTOR);
28
+ await this.page.select(NEW_VALUE_SELECTOR, newRecordTypeId.slice(0, 15));
29
+ }
30
+ await this.save();
31
+ }
32
+ async save() {
33
+ await this.page.waitForSelector(this.saveButton);
34
+ await Promise.all([
35
+ this.page.waitForNavigation(),
36
+ this.page.click(this.saveButton),
37
+ ]);
38
+ await this.throwPageErrors();
39
+ }
40
+ async throwOnMissingSaveButton() {
41
+ const saveButton = await this.page.$(this.saveButton);
42
+ if (!saveButton) {
43
+ const bodyHandle = await this.page.$('div.pbBody');
44
+ if (bodyHandle) {
45
+ const errorMsg = await this.page.evaluate((div) => div.textContent, bodyHandle);
46
+ await bodyHandle.dispose();
47
+ if (errorMsg?.trim()) {
48
+ throw new Error(errorMsg.trim());
49
+ }
50
+ }
51
+ }
52
+ }
53
+ async throwPageErrors() {
54
+ const errorHandle = await this.page.$('div#validationError div.messageText');
55
+ if (errorHandle) {
56
+ const errorMsg = await this.page.evaluate((div) => div.innerText, errorHandle);
57
+ await errorHandle.dispose();
58
+ if (errorMsg?.trim()) {
59
+ throw new Error(errorMsg.trim());
60
+ }
61
+ }
62
+ }
63
+ }
64
+ //# sourceMappingURL=pages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pages.js","sourceRoot":"","sources":["../../../src/plugins/record-types/pages.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,cAAc;IACjB,IAAI,CAAO;IAEnB,YAAY,IAAU;QACpB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAEM,KAAK,CAAC,iBAAiB,CAC5B,YAAoB;QAEpB,MAAM,KAAK,GAAG,yDAAyD,YAAY,CAAC,KAAK,CACvF,CAAC,EACD,EAAE,CACH,KAAK,CAAC;QACP,MAAM,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,cAAc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teer';
2
+ 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,29 @@
1
+ import assert from 'assert';
2
+ import { RelateContactToMultipleAccounts } from './index.js';
3
+ describe(RelateContactToMultipleAccounts.name, function () {
4
+ let plugin;
5
+ before(() => {
6
+ plugin = new RelateContactToMultipleAccounts(global.bf);
7
+ });
8
+ const configEnabled = {
9
+ enabled: true,
10
+ };
11
+ const configDisabled = {
12
+ enabled: false,
13
+ };
14
+ it('should enable', async () => {
15
+ await plugin.run(configEnabled);
16
+ });
17
+ it('should be enabled', async () => {
18
+ const res = await plugin.run(configEnabled);
19
+ assert.deepStrictEqual(res, { message: 'no action necessary' });
20
+ });
21
+ it('should disable', async () => {
22
+ await plugin.run(configDisabled);
23
+ });
24
+ it('should be disabled', async () => {
25
+ const res = await plugin.run(configDisabled);
26
+ assert.deepStrictEqual(res, { message: 'no action necessary' });
27
+ });
28
+ });
29
+ //# 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.e2e-spec.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,+BAA+B,EAAE,MAAM,YAAY,CAAC;AAE7D,QAAQ,CAAC,+BAA+B,CAAC,IAAI,EAAE;IAC7C,IAAI,MAAuC,CAAC;IAC5C,MAAM,CAAC,GAAG,EAAE;QACV,MAAM,GAAG,IAAI,+BAA+B,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAC1D,CAAC,CAAC,CAAC;IAEH,MAAM,aAAa,GAAG;QACpB,OAAO,EAAE,IAAI;KACd,CAAC;IACF,MAAM,cAAc,GAAG;QACrB,OAAO,EAAE,KAAK;KACf,CAAC;IAEF,EAAE,CAAC,eAAe,EAAE,KAAK,IAAI,EAAE;QAC7B,MAAM,MAAM,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,mBAAmB,EAAE,KAAK,IAAI,EAAE;QACjC,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QAC5C,MAAM,CAAC,eAAe,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,qBAAqB,EAAE,CAAC,CAAC;IAClE,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,gBAAgB,EAAE,KAAK,IAAI,EAAE;QAC9B,MAAM,MAAM,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,oBAAoB,EAAE,KAAK,IAAI,EAAE;QAClC,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QAC7C,MAAM,CAAC,eAAe,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,qBAAqB,EAAE,CAAC,CAAC;IAClE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,72 @@
1
+ import { retry, throwPageErrors } from '../../browserforce.js';
2
+ import { BrowserforcePlugin } from '../../plugin.js';
3
+ const BASE_PATH = 'accounts/accountSetup.apexp';
4
+ const ENABLED_SELECTOR = 'input[id$=":sharedContactsCheckBox"]';
5
+ const EDIT_BUTTON_SELECTOR = 'input[id$=":edit"]';
6
+ const SAVE_BUTTON_SELECTOR = 'input[id$=":save"]';
7
+ const DISABLE_CONFIRM_CHECKBOX_SELECTOR = 'input#disable_confirm';
8
+ const DISABLE_CONFIRM_BUTTON_SELECTOR = 'input#sharedContactsDisableConfirmButton';
9
+ const ENABLING_IN_PROGRESS_SELECTOR = '#enablingInProgress';
10
+ const DISABLING_IN_PROGRESS_SELECTOR = '#disablingInProgress';
11
+ export class RelateContactToMultipleAccounts extends BrowserforcePlugin {
12
+ async retrieve(definition) {
13
+ const page = await this.browserforce.openPage(BASE_PATH);
14
+ await page.waitForSelector(ENABLED_SELECTOR, { visible: true });
15
+ const response = {
16
+ enabled: await page.$eval(ENABLED_SELECTOR, (el) => el.checked),
17
+ };
18
+ await page.close();
19
+ return response;
20
+ }
21
+ async apply(config) {
22
+ const page = await this.browserforce.openPage(BASE_PATH);
23
+ await this.waitForProcessFinished(page);
24
+ // First we have to click the 'Edit' button, to make the checkbox editable
25
+ await page.waitForSelector(EDIT_BUTTON_SELECTOR);
26
+ await Promise.all([
27
+ page.waitForNavigation(),
28
+ page.click(EDIT_BUTTON_SELECTOR),
29
+ ]);
30
+ // Change the value of the checkbox
31
+ await page.waitForSelector(ENABLED_SELECTOR, { visible: true });
32
+ await page.click(ENABLED_SELECTOR);
33
+ // Save
34
+ if (config.enabled) {
35
+ await page.waitForSelector(SAVE_BUTTON_SELECTOR);
36
+ await Promise.all([
37
+ page.waitForNavigation(),
38
+ page.click(SAVE_BUTTON_SELECTOR),
39
+ ]);
40
+ }
41
+ else {
42
+ await page.waitForSelector(SAVE_BUTTON_SELECTOR);
43
+ await page.click(SAVE_BUTTON_SELECTOR);
44
+ await page.waitForSelector(DISABLE_CONFIRM_CHECKBOX_SELECTOR, {
45
+ visible: true,
46
+ });
47
+ await page.click(DISABLE_CONFIRM_CHECKBOX_SELECTOR);
48
+ await page.waitForSelector(DISABLE_CONFIRM_BUTTON_SELECTOR);
49
+ await Promise.all([
50
+ page.waitForNavigation(),
51
+ page.click(DISABLE_CONFIRM_BUTTON_SELECTOR),
52
+ ]);
53
+ }
54
+ await throwPageErrors(page);
55
+ await page.close();
56
+ }
57
+ async waitForProcessFinished(page) {
58
+ await retry(async () => {
59
+ const enabling = await page.$(ENABLING_IN_PROGRESS_SELECTOR);
60
+ if (enabling) {
61
+ const message = await enabling.evaluate((div) => div.innerText);
62
+ throw new Error(message);
63
+ }
64
+ const disabling = await page.$(DISABLING_IN_PROGRESS_SELECTOR);
65
+ if (disabling) {
66
+ const message = await disabling.evaluate((div) => div.innerText);
67
+ throw new Error(message);
68
+ }
69
+ });
70
+ }
71
+ }
72
+ //# 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":"AACA,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAErD,MAAM,SAAS,GAAG,6BAA6B,CAAC;AAEhD,MAAM,gBAAgB,GAAG,sCAAsC,CAAC;AAChE,MAAM,oBAAoB,GAAG,oBAAoB,CAAC;AAClD,MAAM,oBAAoB,GAAG,oBAAoB,CAAC;AAClD,MAAM,iCAAiC,GAAG,uBAAuB,CAAC;AAClE,MAAM,+BAA+B,GACnC,0CAA0C,CAAC;AAC7C,MAAM,6BAA6B,GAAG,qBAAqB,CAAC;AAC5D,MAAM,8BAA8B,GAAG,sBAAsB,CAAC;AAM9D,MAAM,OAAO,+BAAgC,SAAQ,kBAAkB;IAC9D,KAAK,CAAC,QAAQ,CAAC,UAAmB;QACvC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;QACzD,MAAM,IAAI,CAAC,eAAe,CAAC,gBAAgB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;QAChE,MAAM,QAAQ,GAAG;YACf,OAAO,EAAE,MAAM,IAAI,CAAC,KAAK,CACvB,gBAAgB,EAChB,CAAC,EAAoB,EAAE,EAAE,CAAC,EAAE,CAAC,OAAO,CACrC;SACF,CAAC;QACF,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;QACnB,OAAO,QAAQ,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AAC,KAAK,CAAC,+BAA+B,CAAC;aAC5C,CAAC,CAAC;QACL,CAAC;QACD,MAAM,eAAe,CAAC,IAAI,CAAC,CAAC;QAC5B,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;IACrB,CAAC;IAED,KAAK,CAAC,sBAAsB,CAAC,IAAU;QACrC,MAAM,KAAK,CAAC,KAAK,IAAI,EAAE;YACrB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,CAAC,CAAC,6BAA6B,CAAC,CAAC;YAC7D,IAAI,QAAQ,EAAE,CAAC;gBACb,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,QAAQ,CACrC,CAAC,GAAmB,EAAE,EAAE,CAAC,GAAG,CAAC,SAAS,CACvC,CAAC;gBACF,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;YAC3B,CAAC;YACD,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,CAAC,CAAC,8BAA8B,CAAC,CAAC;YAC/D,IAAI,SAAS,EAAE,CAAC;gBACd,MAAM,OAAO,GAAG,MAAM,SAAS,CAAC,QAAQ,CACtC,CAAC,GAAmB,EAAE,EAAE,CAAC,GAAG,CAAC,SAAS,CACvC,CAAC;gBACF,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,3 @@
1
+ export {};
2
+ // no tests because this setting is only available in old orgs
3
+ //# sourceMappingURL=index.e2e-spec.js.map
@@ -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"}
@@ -0,0 +1,50 @@
1
+ import { BrowserforcePlugin } from '../../../plugin.js';
2
+ const BASE_PATH = 'ui/rpt/AnalyticsSharingSettingsPage/e';
3
+ const BASE_SELECTOR = 'div.pbBody';
4
+ const ENABLE_CHECKBOX_SELECTOR = 'input[id="0"]';
5
+ const SAVE_BUTTON_SELECTOR = 'input[id="saveButton"]';
6
+ export class FolderSharing extends BrowserforcePlugin {
7
+ async retrieve(definition) {
8
+ const response = {
9
+ enableEnhancedFolderSharing: true,
10
+ };
11
+ let page;
12
+ try {
13
+ page = await this.browserforce.openPage(BASE_PATH);
14
+ const frameOrPage = await this.browserforce.waitForSelectorInFrameOrPage(page, BASE_SELECTOR);
15
+ const inputEnable = await frameOrPage.$(ENABLE_CHECKBOX_SELECTOR);
16
+ if (inputEnable) {
17
+ response.enableEnhancedFolderSharing = await frameOrPage.$eval(ENABLE_CHECKBOX_SELECTOR, (el) => el.checked);
18
+ }
19
+ else {
20
+ // already enabled
21
+ response.enableEnhancedFolderSharing = true;
22
+ }
23
+ }
24
+ catch (e) {
25
+ if (e.message.match('Insufficient Privileges')) {
26
+ return response;
27
+ }
28
+ throw e;
29
+ }
30
+ await page.close();
31
+ return response;
32
+ }
33
+ async apply(config) {
34
+ if (config.enableEnhancedFolderSharing === false) {
35
+ throw new Error('`enableEnhancedFolderSharing` cannot be disabled once enabled');
36
+ }
37
+ const page = await this.browserforce.openPage(BASE_PATH);
38
+ await page.waitForSelector(ENABLE_CHECKBOX_SELECTOR);
39
+ await page.$eval(ENABLE_CHECKBOX_SELECTOR, (e, v) => {
40
+ e.checked = v;
41
+ }, config.enableEnhancedFolderSharing);
42
+ await page.waitForSelector(SAVE_BUTTON_SELECTOR);
43
+ await Promise.all([
44
+ page.waitForNavigation(),
45
+ page.click(SAVE_BUTTON_SELECTOR),
46
+ ]);
47
+ await page.close();
48
+ }
49
+ }
50
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/plugins/reports-and-dashboards/folder-sharing/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,MAAM,SAAS,GAAG,uCAAuC,CAAC;AAE1D,MAAM,aAAa,GAAG,YAAY,CAAC;AACnC,MAAM,wBAAwB,GAAG,eAAe,CAAC;AACjD,MAAM,oBAAoB,GAAG,wBAAwB,CAAC;AAMtD,MAAM,OAAO,aAAc,SAAQ,kBAAkB;IAC5C,KAAK,CAAC,QAAQ,CAAC,UAAmB;QACvC,MAAM,QAAQ,GAAG;YACf,2BAA2B,EAAE,IAAI;SAClC,CAAC;QACF,IAAI,IAAU,CAAC;QACf,IAAI,CAAC;YACH,IAAI,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;YACnD,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,4BAA4B,CACtE,IAAI,EACJ,aAAa,CACd,CAAC;YACF,MAAM,WAAW,GAAG,MAAM,WAAW,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAC;YAClE,IAAI,WAAW,EAAE,CAAC;gBAChB,QAAQ,CAAC,2BAA2B,GAAG,MAAM,WAAW,CAAC,KAAK,CAC5D,wBAAwB,EACxB,CAAC,EAAoB,EAAE,EAAE,CAAC,EAAE,CAAC,OAAO,CACrC,CAAC;YACJ,CAAC;iBAAM,CAAC;gBACN,kBAAkB;gBAClB,QAAQ,CAAC,2BAA2B,GAAG,IAAI,CAAC;YAC9C,CAAC;QACH,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,IAAI,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,yBAAyB,CAAC,EAAE,CAAC;gBAC/C,OAAO,QAAQ,CAAC;YAClB,CAAC;YACD,MAAM,CAAC,CAAC;QACV,CAAC;QACD,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;QACnB,OAAO,QAAQ,CAAC;IAClB,CAAC;IAEM,KAAK,CAAC,KAAK,CAAC,MAAc;QAC/B,IAAI,MAAM,CAAC,2BAA2B,KAAK,KAAK,EAAE,CAAC;YACjD,MAAM,IAAI,KAAK,CACb,+DAA+D,CAChE,CAAC;QACJ,CAAC;QACD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;QACzD,MAAM,IAAI,CAAC,eAAe,CAAC,wBAAwB,CAAC,CAAC;QACrD,MAAM,IAAI,CAAC,KAAK,CACd,wBAAwB,EACxB,CAAC,CAAmB,EAAE,CAAU,EAAE,EAAE;YAClC,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC;QAChB,CAAC,EACD,MAAM,CAAC,2BAA2B,CACnC,CAAC;QACF,MAAM,IAAI,CAAC,eAAe,CAAC,oBAAoB,CAAC,CAAC;QACjD,MAAM,OAAO,CAAC,GAAG,CAAC;YAChB,IAAI,CAAC,iBAAiB,EAAE;YACxB,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC;SACjC,CAAC,CAAC;QACH,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;IACrB,CAAC;CACF"}
@@ -0,0 +1,11 @@
1
+ import { BrowserforcePlugin } from '../../plugin.js';
2
+ import { Config as FolderSharingConfig } from './folder-sharing/index.js';
3
+ type Config = {
4
+ folderSharing?: FolderSharingConfig;
5
+ };
6
+ export declare class ReportsAndDashboards extends BrowserforcePlugin {
7
+ retrieve(definition?: Config): Promise<Config>;
8
+ diff(state: Config, definition: Config): Config | undefined;
9
+ apply(plan: Config): Promise<void>;
10
+ }
11
+ export {};
@@ -0,0 +1,3 @@
1
+ export {};
2
+ // no tests because the folder sharing setting is only available in old orgs
3
+ //# sourceMappingURL=index.e2e-spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.e2e-spec.js","sourceRoot":"","sources":["../../../src/plugins/reports-and-dashboards/index.e2e-spec.ts"],"names":[],"mappings":";AAAA,4EAA4E"}
@@ -0,0 +1,29 @@
1
+ import { BrowserforcePlugin } from '../../plugin.js';
2
+ import { FolderSharing, } from './folder-sharing/index.js';
3
+ export class ReportsAndDashboards extends BrowserforcePlugin {
4
+ async retrieve(definition) {
5
+ const response = {};
6
+ if (definition) {
7
+ if (definition.folderSharing) {
8
+ const pluginFolderSharing = new FolderSharing(this.browserforce);
9
+ response.folderSharing = await pluginFolderSharing.retrieve(definition.folderSharing);
10
+ }
11
+ }
12
+ return response;
13
+ }
14
+ diff(state, definition) {
15
+ const response = {};
16
+ const folderSharing = new FolderSharing(this.browserforce).diff(state.folderSharing, definition.folderSharing);
17
+ if (folderSharing !== undefined) {
18
+ response.folderSharing = folderSharing;
19
+ }
20
+ return Object.keys(response).length ? response : undefined;
21
+ }
22
+ async apply(plan) {
23
+ if (plan.folderSharing) {
24
+ const pluginFolderSharing = new FolderSharing(this.browserforce);
25
+ await pluginFolderSharing.apply(plan.folderSharing);
26
+ }
27
+ }
28
+ }
29
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/plugins/reports-and-dashboards/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EACL,aAAa,GAEd,MAAM,2BAA2B,CAAC;AAMnC,MAAM,OAAO,oBAAqB,SAAQ,kBAAkB;IACnD,KAAK,CAAC,QAAQ,CAAC,UAAmB;QACvC,MAAM,QAAQ,GAAW,EAAE,CAAC;QAC5B,IAAI,UAAU,EAAE,CAAC;YACf,IAAI,UAAU,CAAC,aAAa,EAAE,CAAC;gBAC7B,MAAM,mBAAmB,GAAG,IAAI,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;gBACjE,QAAQ,CAAC,aAAa,GAAG,MAAM,mBAAmB,CAAC,QAAQ,CACzD,UAAU,CAAC,aAAa,CACzB,CAAC;YACJ,CAAC;QACH,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;IAEM,IAAI,CAAC,KAAa,EAAE,UAAkB;QAC3C,MAAM,QAAQ,GAAW,EAAE,CAAC;QAC5B,MAAM,aAAa,GAAG,IAAI,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,IAAI,CAC7D,KAAK,CAAC,aAAa,EACnB,UAAU,CAAC,aAAa,CACU,CAAC;QACrC,IAAI,aAAa,KAAK,SAAS,EAAE,CAAC;YAChC,QAAQ,CAAC,aAAa,GAAG,aAAa,CAAC;QACzC,CAAC;QACD,OAAO,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC;IAC7D,CAAC;IAEM,KAAK,CAAC,KAAK,CAAC,IAAY;QAC7B,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;YACvB,MAAM,mBAAmB,GAAG,IAAI,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;YACjE,MAAM,mBAAmB,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACtD,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,17 @@
1
+ export type FormConfig = {
2
+ [key: string]: {
3
+ label: string;
4
+ component: string;
5
+ id: string;
6
+ properties: {
7
+ [key: string]: {
8
+ label: string;
9
+ component: string;
10
+ type: string;
11
+ name: string;
12
+ immediatelySave?: boolean;
13
+ };
14
+ };
15
+ };
16
+ };
17
+ export declare const formConfig: FormConfig;