mcdev 5.2.0 → 6.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 (191) hide show
  1. package/.eslintrc.json +1 -1
  2. package/.fork/custom-commands.json +12 -0
  3. package/.github/ISSUE_TEMPLATE/bug.yml +2 -0
  4. package/.github/PULL_REQUEST_TEMPLATE/pr_template_release.md +19 -0
  5. package/.github/workflows/code-test.yml +1 -1
  6. package/.github/workflows/coverage-base-update.yml +1 -1
  7. package/.github/workflows/coverage-develop-branch.yml +2 -2
  8. package/.github/workflows/coverage-main-branch.yml +2 -2
  9. package/.github/workflows/coverage.yml +2 -2
  10. package/.github/workflows/npm-publish.yml +2 -2
  11. package/.prettierrc +7 -0
  12. package/docs/dist/documentation.md +388 -482
  13. package/jsconfig.json +5 -1
  14. package/lib/Builder.js +8 -8
  15. package/lib/Deployer.js +10 -10
  16. package/lib/MetadataTypeDefinitions.js +73 -38
  17. package/lib/MetadataTypeInfo.js +72 -37
  18. package/lib/Retriever.js +8 -8
  19. package/lib/cli.js +12 -7
  20. package/lib/index.js +28 -18
  21. package/lib/metadataTypes/Asset.js +12 -10
  22. package/lib/metadataTypes/AttributeGroup.js +7 -6
  23. package/lib/metadataTypes/AttributeSet.js +126 -18
  24. package/lib/metadataTypes/Automation.js +107 -78
  25. package/lib/metadataTypes/Campaign.js +7 -6
  26. package/lib/metadataTypes/ContentArea.js +7 -6
  27. package/lib/metadataTypes/DataExtension.js +475 -78
  28. package/lib/metadataTypes/DataExtensionField.js +36 -18
  29. package/lib/metadataTypes/DataExtensionTemplate.js +5 -4
  30. package/lib/metadataTypes/DataExtract.js +8 -7
  31. package/lib/metadataTypes/DataExtractType.js +5 -4
  32. package/lib/metadataTypes/Discovery.js +6 -5
  33. package/lib/metadataTypes/Email.js +6 -5
  34. package/lib/metadataTypes/EmailSend.js +7 -6
  35. package/lib/metadataTypes/Event.js +8 -7
  36. package/lib/metadataTypes/FileLocation.js +5 -4
  37. package/lib/metadataTypes/FileTransfer.js +8 -7
  38. package/lib/metadataTypes/Filter.js +5 -4
  39. package/lib/metadataTypes/Folder.js +9 -8
  40. package/lib/metadataTypes/ImportFile.js +8 -7
  41. package/lib/metadataTypes/Journey.js +17 -9
  42. package/lib/metadataTypes/List.js +9 -8
  43. package/lib/metadataTypes/MetadataType.js +100 -34
  44. package/lib/metadataTypes/MobileCode.js +5 -4
  45. package/lib/metadataTypes/MobileKeyword.js +9 -8
  46. package/lib/metadataTypes/MobileMessage.js +8 -7
  47. package/lib/metadataTypes/Query.js +9 -8
  48. package/lib/metadataTypes/Role.js +8 -7
  49. package/lib/metadataTypes/Script.js +7 -6
  50. package/lib/metadataTypes/SendClassification.js +5 -4
  51. package/lib/metadataTypes/TransactionalEmail.js +101 -23
  52. package/lib/metadataTypes/TransactionalMessage.js +9 -7
  53. package/lib/metadataTypes/TransactionalPush.js +7 -6
  54. package/lib/metadataTypes/TransactionalSMS.js +9 -8
  55. package/lib/metadataTypes/TriggeredSend.js +15 -12
  56. package/lib/metadataTypes/User.js +8 -7
  57. package/lib/metadataTypes/Verification.js +230 -0
  58. package/lib/metadataTypes/definitions/Asset.definition.js +1 -1
  59. package/lib/metadataTypes/definitions/AttributeGroup.definition.js +3 -3
  60. package/lib/metadataTypes/definitions/AttributeSet.definition.js +75 -22
  61. package/lib/metadataTypes/definitions/Automation.definition.js +2 -1
  62. package/lib/metadataTypes/definitions/Campaign.definition.js +1 -1
  63. package/lib/metadataTypes/definitions/ContentArea.definition.js +1 -1
  64. package/lib/metadataTypes/definitions/DataExtension.definition.js +1 -1
  65. package/lib/metadataTypes/definitions/DataExtensionField.definition.js +1 -1
  66. package/lib/metadataTypes/definitions/DataExtensionTemplate.definition.js +1 -1
  67. package/lib/metadataTypes/definitions/DataExtract.definition.js +1 -1
  68. package/lib/metadataTypes/definitions/DataExtractType.definition.js +1 -1
  69. package/lib/metadataTypes/definitions/Discovery.definition.js +1 -1
  70. package/lib/metadataTypes/definitions/Email.definition.js +1 -1
  71. package/lib/metadataTypes/definitions/EmailSend.definition.js +1 -1
  72. package/lib/metadataTypes/definitions/Event.definition.js +1 -1
  73. package/lib/metadataTypes/definitions/FileLocation.definition.js +1 -1
  74. package/lib/metadataTypes/definitions/FileTransfer.definition.js +1 -1
  75. package/lib/metadataTypes/definitions/Filter.definition.js +1 -1
  76. package/lib/metadataTypes/definitions/Folder.definition.js +1 -1
  77. package/lib/metadataTypes/definitions/ImportFile.definition.js +1 -1
  78. package/lib/metadataTypes/definitions/Journey.definition.js +1 -1
  79. package/lib/metadataTypes/definitions/List.definition.js +1 -1
  80. package/lib/metadataTypes/definitions/MobileCode.definition.js +1 -1
  81. package/lib/metadataTypes/definitions/MobileKeyword.definition.js +1 -1
  82. package/lib/metadataTypes/definitions/MobileMessage.definition.js +1 -1
  83. package/lib/metadataTypes/definitions/Query.definition.js +1 -1
  84. package/lib/metadataTypes/definitions/Role.definition.js +1 -1
  85. package/lib/metadataTypes/definitions/Script.definition.js +1 -1
  86. package/lib/metadataTypes/definitions/SendClassification.definition.js +1 -1
  87. package/lib/metadataTypes/definitions/TransactionalEmail.definition.js +20 -2
  88. package/lib/metadataTypes/definitions/TransactionalPush.definition.js +1 -1
  89. package/lib/metadataTypes/definitions/TransactionalSMS.definition.js +1 -1
  90. package/lib/metadataTypes/definitions/TriggeredSend.definition.js +1 -1
  91. package/lib/metadataTypes/definitions/User.definition.js +1 -1
  92. package/lib/metadataTypes/definitions/Verification.definition.js +88 -0
  93. package/lib/retrieveChangelog.js +4 -3
  94. package/lib/util/auth.js +11 -8
  95. package/lib/util/businessUnit.js +5 -5
  96. package/lib/util/cache.js +3 -3
  97. package/lib/util/cli.js +15 -13
  98. package/lib/util/config.js +10 -7
  99. package/lib/util/devops.js +12 -11
  100. package/lib/util/file.js +15 -14
  101. package/lib/util/init.config.js +11 -9
  102. package/lib/util/init.git.js +8 -7
  103. package/lib/util/init.js +12 -12
  104. package/lib/util/init.npm.js +7 -5
  105. package/lib/util/util.js +14 -12
  106. package/package.json +32 -27
  107. package/test/general.test.js +4 -6
  108. package/test/mockRoot/.mcdevrc.json +1 -1
  109. package/test/mockRoot/deploy/testInstance/_ParentBU_/dataExtension/testExisting_dataExtensionShared.dataExtension-meta.json +59 -0
  110. package/test/mockRoot/deploy/testInstance/_ParentBU_/dataExtension/testNew_dataExtensionShared.dataExtension-meta.json +23 -0
  111. package/test/mockRoot/deploy/testInstance/testBU/automation/testNew_automation.automation-meta.json +4 -0
  112. package/test/mockRoot/deploy/testInstance/testBU/dataExtension/testExisting_dataExtension.dataExtension-meta.json +1 -0
  113. package/test/mockRoot/deploy/testInstance/testBU/transactionalEmail/testExisting_temail.transactionalEmail-meta.json +3 -4
  114. package/test/mockRoot/deploy/testInstance/testBU/transactionalEmail/testNew_temail.transactionalEmail-meta.json +1 -6
  115. package/test/mockRoot/deploy/testInstance/testBU/verification/testExisting_39f6a488-20eb-4ba0-b0b9.verification-meta.json +11 -0
  116. package/test/mockRoot/deploy/testInstance/testBU/verification/testNew_39f6a488-20eb-4ba0-b0b9.verification-meta.json +11 -0
  117. package/test/resourceFactory.js +52 -26
  118. package/test/resources/1111111/data/v1/customobjectdata/key/testExisting_dataExtensionShared/rowset/get-response.json +13 -0
  119. package/test/resources/1111111/dataExtension/create-expected.json +23 -0
  120. package/test/resources/1111111/dataExtension/create-response.xml +59 -0
  121. package/test/resources/1111111/dataExtension/retrieve-expected.json +55 -0
  122. package/test/resources/1111111/dataExtension/retrieve-expected.md +18 -0
  123. package/test/resources/1111111/dataExtension/retrieve-response.xml +27 -1
  124. package/test/resources/1111111/dataExtension/update-expected.json +55 -0
  125. package/test/resources/1111111/dataExtension/update-response.xml +57 -0
  126. package/test/resources/1111111/dataExtensionField/retrieve-CustomerKey=[testExisting_dataExtensionShared].[TriggerUpdate_randomNumber_]-response.xml +45 -0
  127. package/test/resources/1111111/dataExtensionField/retrieve-DataExtension.CustomerKey=testExisting_dataExtensionShared-response.xml +98 -0
  128. package/test/resources/1111111/dataExtensionField/retrieve-DataExtension.CustomerKey=testNew_dataExtensionSharedORDataExtension.CustomerKey=testExisting_dataExtensionShared-response.xml +98 -0
  129. package/test/resources/1111111/dataExtensionField/retrieve-response.xml +98 -0
  130. package/test/resources/1111111/dataExtensionTemplate/retrieve-response.xml +303 -0
  131. package/test/resources/1111111/dataFolder/retrieve-ContentType=synchronizeddataextensionORContentType=shared_salesforcedataextensionORContentType=shared_dataextensionORContentType=shared_dataORContentType=salesforcedataextensionORContentType=dataextensionORContentType=hidden-response.xml +387 -0
  132. package/test/resources/1111111/dataFolder/retrieve-response.xml +353 -9
  133. package/test/resources/9999999/attributeSet/retrieve-expected.json +89 -694
  134. package/test/resources/9999999/automation/build-expected.json +4 -0
  135. package/test/resources/9999999/automation/create-expected.json +4 -0
  136. package/test/resources/9999999/automation/create-testNew_automation-expected.md +1 -0
  137. package/test/resources/9999999/automation/retrieve-expected.json +4 -0
  138. package/test/resources/9999999/automation/retrieve-testExisting_automation-expected.md +1 -0
  139. package/test/resources/9999999/automation/template-expected.json +4 -0
  140. package/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-1f7f8788c560/get-response.json +7 -0
  141. package/test/resources/9999999/automation/v1/automations/post-response.json +7 -0
  142. package/test/resources/9999999/automation/v1/dataverifications/post-response.json +12 -0
  143. package/test/resources/9999999/automation/v1/dataverifications/testExisting_39f6a488-20eb-4ba0-b0b9/delete-response.json +0 -0
  144. package/test/resources/9999999/automation/v1/dataverifications/testExisting_39f6a488-20eb-4ba0-b0b9/get-response.json +12 -0
  145. package/test/resources/9999999/automation/v1/dataverifications/testExisting_39f6a488-20eb-4ba0-b0b9/patch-response.json +12 -0
  146. package/test/resources/9999999/dataExtension/build-expected.json +16 -0
  147. package/test/resources/9999999/dataExtension/delete-response.xml +42 -0
  148. package/test/resources/9999999/dataExtension/retrieve-expected.json +16 -0
  149. package/test/resources/9999999/dataExtension/retrieve-expected.md +3 -1
  150. package/test/resources/9999999/dataExtension/template-expected.json +16 -0
  151. package/test/resources/9999999/dataExtension/update-expected.json +17 -1
  152. package/test/resources/9999999/dataExtensionField/retrieve-CustomerKey=[testExisting_dataExtension].[LastName]-response.xml +44 -0
  153. package/test/resources/9999999/dataExtensionField/retrieve-DataExtension.CustomerKey=testExisting_dataExtension-response.xml +36 -1
  154. package/test/resources/9999999/dataExtensionField/retrieve-response.xml +36 -1
  155. package/test/resources/9999999/dataFolder/retrieve-ContentType=synchronizeddataextensionORContentType=shared_salesforcedataextensionORContentType=shared_dataextensionORContentType=shared_dataORContentType=salesforcedataextensionORContentType=dataextensionORContentType=hidden-response.xml +117 -0
  156. package/test/resources/9999999/hub/v1/contacts/schema/attributeGroups/get-response.json +43 -0
  157. package/test/resources/9999999/hub/v1/contacts/schema/setDefinitions/get-response.json +387 -0
  158. package/test/resources/9999999/interaction/v1/interactions/233d4413-922c-4568-85a5-e5cc77efc3be/delete-response.json +1 -0
  159. package/test/resources/9999999/legacy/v1/beta/bulk/automations/automation/definition/get-response.json +1 -1
  160. package/test/resources/9999999/messaging/v1/email/definitions/post-response.json +1 -1
  161. package/test/resources/9999999/messaging/v1/email/definitions/testExisting_temail/delete-response.json +6 -0
  162. package/test/resources/9999999/transactionalEmail/build-expected.json +3 -7
  163. package/test/resources/9999999/transactionalEmail/get-expected.json +3 -7
  164. package/test/resources/9999999/transactionalEmail/patch-expected.json +3 -7
  165. package/test/resources/9999999/transactionalEmail/post-expected.json +3 -7
  166. package/test/resources/9999999/transactionalEmail/template-expected.json +3 -7
  167. package/test/resources/9999999/verification/build-expected.json +11 -0
  168. package/test/resources/9999999/verification/get-expected.json +11 -0
  169. package/test/resources/9999999/verification/patch-expected.json +11 -0
  170. package/test/resources/9999999/verification/post-expected.json +11 -0
  171. package/test/resources/9999999/verification/template-expected.json +11 -0
  172. package/test/type.attributeGroup.test.js +9 -12
  173. package/test/type.attributeSet.test.js +10 -13
  174. package/test/type.automation.test.js +34 -32
  175. package/test/type.dataExtension.test.js +210 -54
  176. package/test/type.dataExtract.test.js +15 -9
  177. package/test/type.fileTransfer.test.js +15 -9
  178. package/test/type.importFile.test.js +15 -9
  179. package/test/type.journey.test.js +43 -17
  180. package/test/type.mobileKeyword.test.js +11 -11
  181. package/test/type.mobileMessage.test.js +11 -11
  182. package/test/type.query.test.js +13 -14
  183. package/test/type.script.test.js +11 -9
  184. package/test/type.transactionalEmail.test.js +17 -17
  185. package/test/type.transactionalPush.test.js +7 -10
  186. package/test/type.transactionalSMS.test.js +7 -11
  187. package/test/type.triggeredSend.test.js +11 -10
  188. package/test/type.user.test.js +6 -8
  189. package/test/type.verification.test.js +172 -0
  190. package/test/utils.js +68 -48
  191. package/types/mcdev.d.js +16 -2
@@ -1,4 +1,4 @@
1
- module.exports = {
1
+ export default {
2
2
  bodyIteratorField: null,
3
3
  dependencies: [],
4
4
  endPointMapping: {
@@ -1,4 +1,4 @@
1
- module.exports = {
1
+ export default {
2
2
  bodyIteratorField: 'Results',
3
3
  dependencies: ['folder-hidden', 'folder-email', 'folder-shared_email_default'],
4
4
  hasExtended: false,
@@ -1,4 +1,4 @@
1
- module.exports = {
1
+ export default {
2
2
  bodyIteratorField: 'Results',
3
3
  dependencies: ['folder-userinitiatedsends', 'email', 'asset-message', 'dataExtension', 'list'], // filter(+), sendClassification(+), SenderProfile(n/a), DeliveryProfile(n/a)
4
4
  folderType: 'userinitiatedsends',
@@ -1,4 +1,4 @@
1
- module.exports = {
1
+ export default {
2
2
  bodyIteratorField: 'items',
3
3
  dependencies: ['dataExtension'],
4
4
  hasExtended: false,
@@ -1,4 +1,4 @@
1
- module.exports = {
1
+ export default {
2
2
  bodyIteratorField: 'items',
3
3
  dependencies: [],
4
4
  hasExtended: false,
@@ -1,4 +1,4 @@
1
- module.exports = {
1
+ export default {
2
2
  bodyIteratorField: 'items',
3
3
  dependencies: ['fileLocation'],
4
4
  hasExtended: true,
@@ -1,4 +1,4 @@
1
- module.exports = {
1
+ export default {
2
2
  bodyIteratorField: 'items',
3
3
  dependencies: [],
4
4
  hasExtended: false,
@@ -1,4 +1,4 @@
1
- module.exports = {
1
+ export default {
2
2
  bodyIteratorField: 'Results',
3
3
  dependencies: [],
4
4
  subTypes: [
@@ -1,4 +1,4 @@
1
- module.exports = {
1
+ export default {
2
2
  bodyIteratorField: 'items',
3
3
  dependencies: ['fileLocation', 'dataExtension', 'list'],
4
4
  destinationObjectTypeMapping: {
@@ -2,7 +2,7 @@
2
2
  // obj definition: https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/getting-started-spec.html
3
3
  // insert: https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/postCreateInteraction.html
4
4
  // update: https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/putUpdateInteraction.html
5
- module.exports = {
5
+ export default {
6
6
  bodyIteratorField: 'items',
7
7
  dependencies: [
8
8
  'folder-journey',
@@ -1,4 +1,4 @@
1
- module.exports = {
1
+ export default {
2
2
  bodyIteratorField: 'Results',
3
3
  dependencies: ['folder-mysubs', 'folder-list', 'folder-publication'],
4
4
  folderType: 'list',
@@ -1,4 +1,4 @@
1
- module.exports = {
1
+ export default {
2
2
  bodyIteratorField: 'entry',
3
3
  dependencies: [],
4
4
  hasExtended: false,
@@ -1,4 +1,4 @@
1
- module.exports = {
1
+ export default {
2
2
  bodyIteratorField: 'entry',
3
3
  dependencies: ['mobileCode'],
4
4
  hasExtended: false,
@@ -1,4 +1,4 @@
1
- module.exports = {
1
+ export default {
2
2
  bodyIteratorField: 'entry',
3
3
  dependencies: ['mobileCode', 'mobileKeyword', 'campaign'],
4
4
  hasExtended: false,
@@ -1,4 +1,4 @@
1
- module.exports = {
1
+ export default {
2
2
  bodyIteratorField: 'items',
3
3
  dependencies: ['folder-queryactivity', 'dataExtension'],
4
4
  folderType: 'queryactivity',
@@ -1,4 +1,4 @@
1
- module.exports = {
1
+ export default {
2
2
  bodyIteratorField: 'Results',
3
3
  dependencies: [],
4
4
  deployBlacklist: [
@@ -1,4 +1,4 @@
1
- module.exports = {
1
+ export default {
2
2
  bodyIteratorField: 'items',
3
3
  dependencies: ['folder-ssjsactivity'],
4
4
  folderType: 'ssjsactivity',
@@ -1,5 +1,5 @@
1
1
  // https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/sendclassification.html
2
- module.exports = {
2
+ export default {
3
3
  bodyIteratorField: 'Results',
4
4
  dependencies: [],
5
5
  filter: {},
@@ -1,4 +1,4 @@
1
- module.exports = {
1
+ export default {
2
2
  bodyIteratorField: 'definitions',
3
3
  dependencies: ['asset-message', 'dataExtension', 'list', 'journey'],
4
4
  hasExtended: false,
@@ -83,6 +83,12 @@ module.exports = {
83
83
  retrieving: true,
84
84
  template: true,
85
85
  },
86
+ 'subscriptions.r__dataExtension_CustomerKey': {
87
+ isCreateable: false,
88
+ isUpdateable: false,
89
+ retrieving: true,
90
+ template: true,
91
+ },
86
92
  'subscriptions.list': {
87
93
  isCreateable: true,
88
94
  isUpdateable: true,
@@ -127,7 +133,7 @@ module.exports = {
127
133
  },
128
134
  'options.createJourney': {
129
135
  isCreateable: true,
130
- isUpdateable: true,
136
+ isUpdateable: false,
131
137
  retrieving: false,
132
138
  template: false,
133
139
  },
@@ -143,5 +149,17 @@ module.exports = {
143
149
  retrieving: true,
144
150
  template: true,
145
151
  },
152
+ r__asset_customerKey: {
153
+ isCreateable: false,
154
+ isUpdateable: false,
155
+ retrieving: true,
156
+ template: true,
157
+ },
158
+ r__journey_key: {
159
+ isCreateable: false,
160
+ isUpdateable: false,
161
+ retrieving: true,
162
+ template: true,
163
+ },
146
164
  },
147
165
  };
@@ -1,4 +1,4 @@
1
- module.exports = {
1
+ export default {
2
2
  bodyIteratorField: 'definitions',
3
3
  dependencies: ['asset-asset'],
4
4
  hasExtended: false,
@@ -1,4 +1,4 @@
1
- module.exports = {
1
+ export default {
2
2
  bodyIteratorField: 'definitions',
3
3
  dependencies: ['mobileCode', 'mobileKeyword'],
4
4
  hasExtended: false,
@@ -1,4 +1,4 @@
1
- module.exports = {
1
+ export default {
2
2
  bodyIteratorField: 'Results',
3
3
  dependencies: [
4
4
  'folder-hidden',
@@ -1,4 +1,4 @@
1
- module.exports = {
1
+ export default {
2
2
  bodyIteratorField: 'Results',
3
3
  dependencies: ['role'],
4
4
  folderType: null,
@@ -0,0 +1,88 @@
1
+ export default {
2
+ bodyIteratorField: 'items',
3
+ dependencies: ['dataExtension'],
4
+ hasExtended: false,
5
+ idField: 'dataVerificationDefinitionId',
6
+ keyIsFixed: true,
7
+ keyField: 'dataVerificationDefinitionId',
8
+ createdDateField: null,
9
+ createdNameField: 'createdBy',
10
+ lastmodDateField: null,
11
+ lastmodNameField: null,
12
+ nameField: 'dataVerificationDefinitionId',
13
+ restPagination: false,
14
+ maxKeyLength: 36, // confirmed max length
15
+ type: 'verification',
16
+ typeDescription: 'Check DataExtension for a row count',
17
+ typeRetrieveByDefault: true,
18
+ typeName: 'Automation: Verification Activity',
19
+ fields: {
20
+ createdBy: {
21
+ // User ID
22
+ isCreateable: false,
23
+ isUpdateable: false,
24
+ retrieving: false,
25
+ template: false,
26
+ },
27
+ dataVerificationDefinitionId: {
28
+ isCreateable: false, // auto-assigned during creation by SFMC
29
+ isUpdateable: true,
30
+ retrieving: true,
31
+ template: true,
32
+ },
33
+ notificationEmailAddress: {
34
+ isCreateable: true,
35
+ isUpdateable: true,
36
+ retrieving: true,
37
+ template: true,
38
+ },
39
+ notificationEmailMessage: {
40
+ isCreateable: true,
41
+ isUpdateable: true,
42
+ retrieving: true,
43
+ template: true,
44
+ },
45
+ shouldEmailOnFailure: {
46
+ isCreateable: true,
47
+ isUpdateable: true,
48
+ retrieving: true,
49
+ template: true,
50
+ },
51
+ shouldStopOnFailure: {
52
+ isCreateable: true,
53
+ isUpdateable: true,
54
+ retrieving: true,
55
+ template: true,
56
+ },
57
+ targetObjectId: {
58
+ isCreateable: true,
59
+ isUpdateable: true,
60
+ retrieving: true,
61
+ template: true,
62
+ },
63
+ value1: {
64
+ isCreateable: true,
65
+ isUpdateable: true,
66
+ retrieving: true,
67
+ template: true,
68
+ },
69
+ value2: {
70
+ isCreateable: true,
71
+ isUpdateable: true,
72
+ retrieving: true,
73
+ template: true,
74
+ },
75
+ verificationType: {
76
+ isCreateable: true,
77
+ isUpdateable: true,
78
+ retrieving: true,
79
+ template: true,
80
+ },
81
+ r__dataExtension_CustomerKey: {
82
+ isCreateable: false,
83
+ isUpdateable: false,
84
+ retrieving: true,
85
+ template: true,
86
+ },
87
+ },
88
+ };
@@ -16,9 +16,10 @@
16
16
  }]
17
17
  */
18
18
 
19
- const mcdev = require('./index');
20
- const Definition = require('./MetadataTypeDefinitions');
21
- const MetadataType = require('./MetadataTypeInfo');
19
+ import mcdev from './index.js';
20
+
21
+ import Definition from './MetadataTypeDefinitions.js';
22
+ import MetadataType from './MetadataTypeInfo.js';
22
23
 
23
24
  // disable cli logs
24
25
  // mcdev._setLoggingLevel({ silent: true });
package/lib/util/auth.js CHANGED
@@ -1,10 +1,13 @@
1
- const TYPE = require('../../types/mcdev.d');
2
- const Util = require('./util');
3
- const File = require('./file');
4
- const SDK = require('sfmc-sdk');
5
- const Conf = require('conf');
6
- const credentialStore = new Conf({ configName: 'sessions', clearInvalidConfig: true });
7
- // const currentMID = null;
1
+ import TYPE from '../../types/mcdev.d.js';
2
+ import { Util } from './util.js';
3
+ import File from './file.js';
4
+ import SDK from 'sfmc-sdk';
5
+ import Conf from 'conf';
6
+ const credentialStore = new Conf({
7
+ projectName: 'mcdev',
8
+ configName: 'sessions',
9
+ clearInvalidConfig: true,
10
+ });
8
11
  const initializedSDKs = {};
9
12
  let authfile;
10
13
 
@@ -159,4 +162,4 @@ function setupSDK(sessionKey, authObject) {
159
162
  });
160
163
  }
161
164
 
162
- module.exports = Auth;
165
+ export default Auth;
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- const TYPE = require('../../types/mcdev.d');
4
- const Util = require('./util');
5
- const File = require('./file');
6
- const auth = require('./auth');
3
+ import TYPE from '../../types/mcdev.d.js';
4
+ import { Util } from './util.js';
5
+ import File from './file.js';
6
+ import auth from './auth.js';
7
7
 
8
8
  /**
9
9
  * Helper that handles retrieval of BU info
@@ -104,4 +104,4 @@ const BusinessUnit = {
104
104
  },
105
105
  };
106
106
 
107
- module.exports = BusinessUnit;
107
+ export default BusinessUnit;
package/lib/util/cache.js CHANGED
@@ -1,11 +1,11 @@
1
- const TYPE = require('../../types/mcdev.d');
2
- const Util = require('./util');
1
+ import TYPE from '../../types/mcdev.d.js';
2
+ import { Util } from './util.js';
3
3
 
4
4
  /** @type {TYPE.Cache} */
5
5
  const dataStore = {};
6
6
  let currentMID = null;
7
7
 
8
- module.exports = {
8
+ export default {
9
9
  /**
10
10
  * Method to setup buObject
11
11
  * NOTE: in future this may need to restore, rather than wipe the cache
package/lib/util/cli.js CHANGED
@@ -1,14 +1,16 @@
1
1
  'use strict';
2
2
 
3
- const TYPE = require('../../types/mcdev.d');
4
- const BuHelper = require('./businessUnit');
5
- const File = require('./file');
6
- const config = require('./config');
7
- const inquirer = require('inquirer');
8
- const MetadataDefinitions = require('./../MetadataTypeDefinitions');
9
- const Util = require('./util');
10
- const auth = require('./auth');
11
- require('console.table');
3
+ import TYPE from '../../types/mcdev.d.js';
4
+ import BuHelper from './businessUnit.js';
5
+ import File from './file.js';
6
+ import config from './config.js';
7
+ import inquirer from 'inquirer';
8
+ import MetadataDefinitions from './../MetadataTypeDefinitions.js';
9
+ import { Util } from './util.js';
10
+ import auth from './auth.js';
11
+ import 'console.table';
12
+ import MetadataTypeInfo from './../MetadataTypeInfo.js';
13
+ import TransactionalMessage from './../metadataTypes/TransactionalMessage.js';
12
14
 
13
15
  /**
14
16
  * CLI helper class
@@ -321,7 +323,9 @@ const Cli = {
321
323
  businessUnits: {},
322
324
  };
323
325
  } catch (ex) {
324
- Util.logger.error(ex.message);
326
+ Util.logger.error(
327
+ `We could not verify your credential due to a problem (${ex.message}). Please try again.`
328
+ );
325
329
  credentialsGood = false;
326
330
  if (skipInteraction) {
327
331
  // break the otherwise infinite loop
@@ -570,8 +574,6 @@ const Cli = {
570
574
  * @returns {object[]} list of supported types with their apiNames
571
575
  */
572
576
  explainTypes() {
573
- const MetadataTypeInfo = require('./../MetadataTypeInfo');
574
- const TransactionalMessage = require('./../metadataTypes/TransactionalMessage');
575
577
  const json = [];
576
578
  const apiNameArr = Object.keys(MetadataDefinitions);
577
579
 
@@ -669,4 +671,4 @@ const Cli = {
669
671
  },
670
672
  };
671
673
 
672
- module.exports = Cli;
674
+ export default Cli;
@@ -1,9 +1,12 @@
1
- const TYPE = require('../../types/mcdev.d');
2
- const Util = require('./util');
3
- const File = require('./file');
4
- const inquirer = require('inquirer');
5
- const semver = require('semver');
6
- const path = require('node:path');
1
+ import TYPE from '../../types/mcdev.d.js';
2
+ import { Util } from './util.js';
3
+ import File from './file.js';
4
+ import inquirer from 'inquirer';
5
+ import semver from 'semver';
6
+ import path from 'node:path';
7
+ import { fileURLToPath } from 'node:url';
8
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
9
+
7
10
  /**
8
11
  * Central class for loading and validating properties from config and auth
9
12
  */
@@ -300,4 +303,4 @@ const config = {
300
303
  return defaultProperties;
301
304
  },
302
305
  };
303
- module.exports = config;
306
+ export default config;
@@ -1,13 +1,14 @@
1
- const TYPE = require('../../types/mcdev.d');
2
- const File = require('./file');
3
- const path = require('node:path');
4
- const inquirer = require('inquirer');
5
- const Util = require('./util');
6
- const Cli = require('./cli');
7
- const git = require('simple-git')();
8
- const Builder = require('../Builder');
9
- const MetadataType = require('../MetadataTypeInfo');
10
- const jsonToTable = require('json-to-table');
1
+ import TYPE from '../../types/mcdev.d.js';
2
+ import File from './file.js';
3
+ import path from 'node:path';
4
+ import inquirer from 'inquirer';
5
+ import { Util } from './util.js';
6
+ import Cli from './cli.js';
7
+ import gitFactory from 'simple-git';
8
+ const git = gitFactory();
9
+ import Builder from '../Builder.js';
10
+ import MetadataType from '../MetadataTypeInfo.js';
11
+ import jsonToTable from 'json-to-table';
11
12
  /**
12
13
  * DevOps helper class
13
14
  */
@@ -570,4 +571,4 @@ const DevOps = {
570
571
  },
571
572
  };
572
573
 
573
- module.exports = DevOps;
574
+ export default DevOps;
package/lib/util/file.js CHANGED
@@ -1,18 +1,18 @@
1
1
  /* eslint-disable no-control-regex */
2
2
  'use strict';
3
3
 
4
- const TYPE = require('../../types/mcdev.d');
5
- const fs = require('fs-extra');
6
- const packageJson = require('../../package.json');
7
- const path = require('node:path');
8
- const prettier = require('prettier');
9
- const beautyAmp = require('beauty-amp-core');
10
- const Util = require('./util');
11
- const updateNotifier = require('update-notifier');
4
+ import TYPE from '../../types/mcdev.d.js';
5
+ import fs from 'fs-extra';
6
+
7
+ import path from 'node:path';
8
+ import prettier from 'prettier';
9
+ import beautyAmp from 'beauty-amp-core';
10
+ import { Util } from './util.js';
11
+ import updateNotifier from 'update-notifier';
12
12
 
13
13
  // inform user when there is an update
14
14
  const notifier = updateNotifier({
15
- pkg: packageJson,
15
+ pkg: Util.packageJsonMcdev,
16
16
  updateCheckInterval: 1000 * 3600 * 24, // once per day
17
17
  });
18
18
  // Notify using the built-in convenience method
@@ -218,9 +218,9 @@ const File = {
218
218
  * @param {string} filename name of the file without suffix
219
219
  * @param {string} filetype filetype ie. JSON or SSJS
220
220
  * @param {string} content filecontent
221
- * @returns {string} original string on error; formatted string on success
221
+ * @returns {Promise.<string>} original string on error; formatted string on success
222
222
  */
223
- _beautify_prettier: function (directory, filename, filetype, content) {
223
+ _beautify_prettier: async function (directory, filename, filetype, content) {
224
224
  let formatted = '';
225
225
  try {
226
226
  if (!FileFs.prettierConfig) {
@@ -275,13 +275,14 @@ const File = {
275
275
  }
276
276
  case 'sql': {
277
277
  FileFs.prettierConfig.parser = 'sql';
278
+ FileFs.prettierConfig.plugins = ['prettier-plugin-sql'];
278
279
  break;
279
280
  }
280
281
  default: {
281
282
  FileFs.prettierConfig.parser = 'babel';
282
283
  }
283
284
  }
284
- formatted = prettier.format(content, FileFs.prettierConfig);
285
+ formatted = await prettier.format(content, FileFs.prettierConfig);
285
286
  } catch (ex) {
286
287
  const warnMsg = `Potential Code issue found in ${this.normalizePath([
287
288
  ...directory,
@@ -506,7 +507,7 @@ const File = {
506
507
  */
507
508
  async saveConfigFile(properties) {
508
509
  // we want to save to save the full version here to allow us to upgrade configs properly in the future
509
- properties.version = packageJson.version;
510
+ properties.version = Util.packageJsonMcdev.version;
510
511
 
511
512
  await this.writeJSONToFile('', Util.configFileName.split('.json')[0], properties);
512
513
  Util.logger.info(`✔️ ${Util.configFileName} and ${Util.authFileName} saved successfully`);
@@ -550,4 +551,4 @@ const FileFs = { ...fs, ...File };
550
551
  FileFs.prettierConfig = null;
551
552
  FileFs.prettierConfigFileType = null;
552
553
 
553
- module.exports = FileFs;
554
+ export default FileFs;
@@ -1,13 +1,15 @@
1
1
  'use strict';
2
2
 
3
- const TYPE = require('../../types/mcdev.d');
4
- const Cli = require('./cli');
5
- const File = require('./file');
6
- const config = require('./config');
7
- const Util = require('./util');
8
- const inquirer = require('inquirer');
9
- const path = require('node:path');
10
- const semver = require('semver');
3
+ import TYPE from '../../types/mcdev.d.js';
4
+ import Cli from './cli.js';
5
+ import File from './file.js';
6
+ import config from './config.js';
7
+ import { Util } from './util.js';
8
+ import inquirer from 'inquirer';
9
+ import path from 'node:path';
10
+ import semver from 'semver';
11
+ import { fileURLToPath } from 'node:url';
12
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
11
13
 
12
14
  /**
13
15
  * CLI helper class
@@ -425,4 +427,4 @@ const Init = {
425
427
  },
426
428
  };
427
429
 
428
- module.exports = Init;
430
+ export default Init;
@@ -1,10 +1,11 @@
1
1
  'use strict';
2
- // const TYPE = require('../../types/mcdev.d');
3
- const File = require('./file');
4
- const inquirer = require('inquirer');
5
- const Util = require('./util');
6
- const commandExists = require('command-exists');
7
- const git = require('simple-git')();
2
+ import File from './file.js';
3
+
4
+ import inquirer from 'inquirer';
5
+ import { Util } from './util.js';
6
+ import commandExists from 'command-exists';
7
+ import gitFactory from 'simple-git';
8
+ const git = gitFactory();
8
9
 
9
10
  /**
10
11
  * CLI helper class
@@ -259,4 +260,4 @@ const Init = {
259
260
  },
260
261
  };
261
262
 
262
- module.exports = Init;
263
+ export default Init;
package/lib/util/init.js CHANGED
@@ -1,15 +1,15 @@
1
1
  'use strict';
2
- const TYPE = require('../../types/mcdev.d');
3
- const Cli = require('./cli');
4
- const File = require('./file');
5
- const config = require('./config');
6
- const InitGit = require('./init.git');
7
- const InitNpm = require('./init.npm');
8
- const InitConfig = require('./init.config');
9
- const inquirer = require('inquirer');
10
- const Util = require('./util');
11
- const fs = require('node:fs');
12
- const path = require('node:path');
2
+ import TYPE from '../../types/mcdev.d.js';
3
+ import Cli from './cli.js';
4
+ import File from './file.js';
5
+ import config from './config.js';
6
+ import InitGit from './init.git.js';
7
+ import InitNpm from './init.npm.js';
8
+ import InitConfig from './init.config.js';
9
+ import inquirer from 'inquirer';
10
+ import { Util } from './util.js';
11
+ import fs from 'node:fs';
12
+ import path from 'node:path';
13
13
 
14
14
  /**
15
15
  * CLI helper class
@@ -506,4 +506,4 @@ const Init = {
506
506
  },
507
507
  };
508
508
 
509
- module.exports = Init;
509
+ export default Init;