mcdev 7.10.1 → 8.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 (144) hide show
  1. package/.github/ISSUE_TEMPLATE/bug.yml +1 -0
  2. package/.github/workflows/code-test.yml +8 -100
  3. package/@types/lib/Deployer.d.ts.map +1 -1
  4. package/@types/lib/Retriever.d.ts.map +1 -1
  5. package/@types/lib/index.d.ts +16 -4
  6. package/@types/lib/index.d.ts.map +1 -1
  7. package/@types/lib/metadataTypes/Asset.d.ts +45 -8
  8. package/@types/lib/metadataTypes/Asset.d.ts.map +1 -1
  9. package/@types/lib/metadataTypes/Automation.d.ts +13 -4
  10. package/@types/lib/metadataTypes/Automation.d.ts.map +1 -1
  11. package/@types/lib/metadataTypes/DataExtension.d.ts.map +1 -1
  12. package/@types/lib/metadataTypes/DataExtensionField.d.ts.map +1 -1
  13. package/@types/lib/metadataTypes/Event.d.ts +6 -0
  14. package/@types/lib/metadataTypes/Event.d.ts.map +1 -1
  15. package/@types/lib/metadataTypes/Folder.d.ts +49 -12
  16. package/@types/lib/metadataTypes/Folder.d.ts.map +1 -1
  17. package/@types/lib/metadataTypes/ImportFile.d.ts +14 -0
  18. package/@types/lib/metadataTypes/ImportFile.d.ts.map +1 -1
  19. package/@types/lib/metadataTypes/Journey.d.ts +166 -6
  20. package/@types/lib/metadataTypes/Journey.d.ts.map +1 -1
  21. package/@types/lib/metadataTypes/MetadataType.d.ts +5 -3
  22. package/@types/lib/metadataTypes/MetadataType.d.ts.map +1 -1
  23. package/@types/lib/metadataTypes/definitions/Asset.definition.d.ts +45 -8
  24. package/@types/lib/metadataTypes/definitions/Automation.definition.d.ts +6 -0
  25. package/@types/lib/metadataTypes/definitions/Event.definition.d.ts +6 -0
  26. package/@types/lib/metadataTypes/definitions/Folder.definition.d.ts +49 -12
  27. package/@types/lib/metadataTypes/definitions/ImportFile.definition.d.ts +3 -0
  28. package/@types/lib/metadataTypes/definitions/Journey.definition.d.ts +159 -6
  29. package/@types/lib/util/cache.d.ts +2 -1
  30. package/@types/lib/util/cache.d.ts.map +1 -1
  31. package/@types/lib/util/devops.d.ts.map +1 -1
  32. package/@types/types/mcdev.d.d.ts +16 -0
  33. package/@types/types/mcdev.d.d.ts.map +1 -1
  34. package/boilerplate/files/.vscode/settings.json +5 -0
  35. package/eslint.config.js +2 -2
  36. package/lib/Deployer.js +3 -0
  37. package/lib/Retriever.js +8 -2
  38. package/lib/cli.js +29 -0
  39. package/lib/index.js +25 -28
  40. package/lib/metadataTypes/Asset.js +126 -10
  41. package/lib/metadataTypes/Automation.js +135 -40
  42. package/lib/metadataTypes/DataExtension.js +0 -10
  43. package/lib/metadataTypes/DataExtensionField.js +9 -15
  44. package/lib/metadataTypes/Event.js +42 -19
  45. package/lib/metadataTypes/Folder.js +98 -12
  46. package/lib/metadataTypes/ImportFile.js +90 -29
  47. package/lib/metadataTypes/Journey.js +182 -23
  48. package/lib/metadataTypes/MetadataType.js +38 -12
  49. package/lib/metadataTypes/definitions/Asset.definition.js +196 -142
  50. package/lib/metadataTypes/definitions/Automation.definition.js +6 -0
  51. package/lib/metadataTypes/definitions/DataExtension.definition.js +7 -6
  52. package/lib/metadataTypes/definitions/Event.definition.js +6 -0
  53. package/lib/metadataTypes/definitions/Folder.definition.js +69 -22
  54. package/lib/metadataTypes/definitions/ImportFile.definition.js +3 -0
  55. package/lib/metadataTypes/definitions/Journey.definition.js +165 -11
  56. package/lib/util/cache.js +24 -5
  57. package/lib/util/devops.js +20 -5
  58. package/package.json +16 -17
  59. package/test/general.test.js +8 -8
  60. package/test/mockRoot/.mcdev-validations.js +2 -3
  61. package/test/mockRoot/.mcdevrc.json +1 -1
  62. package/test/mockRoot/deploy/testInstance/testBU/importFile/testExisting_importFile.importFile-meta.json +2 -1
  63. package/test/mockRoot/deploy/testInstance/testBU/importFile/testNew_importFile.importFile-meta.json +2 -1
  64. package/test/resourceFactory.js +31 -5
  65. package/test/resources/1111111/dataExtension/update-expected.json +1 -1
  66. package/test/resources/9999999/asset/test_coderesource_js-retrieve-expected.js +1 -0
  67. package/test/resources/9999999/asset/test_coderesource_js-retrieve-expected.json +47 -0
  68. package/test/resources/9999999/asset/test_coderesource_json-retrieve-expected.json +47 -0
  69. package/test/resources/9999999/asset/test_coderesource_json-retrieve-expected.jsonc +1 -0
  70. package/test/resources/9999999/asset/test_coderesource_xml-retrieve-expected.json +46 -0
  71. package/test/resources/9999999/asset/test_coderesource_xml-retrieve-expected.xml +1 -0
  72. package/test/resources/9999999/asset/test_interactivecontent-retrieve-expected.json +43 -0
  73. package/test/resources/9999999/asset/test_landingpage-retrieve-expected.json +42 -0
  74. package/test/resources/9999999/asset/test_microsite-retrieve-expected.json +43 -0
  75. package/test/resources/9999999/asset/v1/content/assets/9451/get-response.json +61 -0
  76. package/test/resources/9999999/asset/v1/content/assets/9456/get-response.json +56 -0
  77. package/test/resources/9999999/asset/v1/content/assets/9458/get-response.json +56 -0
  78. package/test/resources/9999999/asset/v1/content/assets/9460/get-response.json +59 -0
  79. package/test/resources/9999999/asset/v1/content/assets/9463/get-response.json +61 -0
  80. package/test/resources/9999999/asset/v1/content/assets/9465/get-response.json +54 -0
  81. package/test/resources/9999999/asset/v1/content/assets/query/post-response-assetType.idIN1,3,4,14,15,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,205,206,210,211,212,213,214,215,216,217,218,219,220,221,222.json +94 -1
  82. package/test/resources/9999999/asset/v1/content/assets/query/post-response-assetType.idIN219,220,221,222,223,224,225,226,227,228,230,232,240,241,242,243,244,245.json +168 -0
  83. package/test/resources/9999999/asset/v1/content/assets/query/post-response-assetType.idIN240,241,242,243,244,245.json +144 -0
  84. package/test/resources/9999999/asset/v1/content/assets/query/post-response-assetType.idIN246,247,248,249.json +132 -0
  85. package/test/resources/9999999/dataExtension/update-callout-afterCreatedViaEvent-expected.xml +1 -1
  86. package/test/resources/9999999/dataFolder/{retrieve-ContentTypeINasset,asset-sha,automatio,dataexten,hidden,journey,list,mysubs,publicati,queryacti,salesforc,shared_da,shared_da,shared_sa,ssjsactiv,synchroni,triggered,triggered,useriniti-response.xml → retrieve-ContentTypeINasset,asset-sha,automatio,cloudpage,dataexten,hidden,journey,list,mysubs,publicati,queryacti,salesforc,shared_da,shared_da,shared_sa,ssjsactiv,synchroni,triggered,triggered,useriniti-response.xml} +44 -1
  87. package/test/resources/9999999/dataFolder/{retrieve-ContentTypeINasset,asset-sha,automatio,dataexten,hidden,journey,list,mysubs,publicati,queryacti,salesforc,shared_da,shared_da,shared_sa,ssjsactiv,synchroni,useriniti-response.xml → retrieve-ContentTypeINasset,asset-sha,automatio,cloudpage,dataexten,hidden,journey,list,mysubs,publicati,queryacti,salesforc,shared_da,shared_da,shared_sa,ssjsactiv,synchroni,useriniti-response.xml} +44 -0
  88. package/test/resources/9999999/dataFolder/{retrieve-ContentTypeINasset,asset-shared,dataextension,hidden,salesforcedataextension,shared_data,shared_dataextension,shared_salesforcedataextension,synchronizeddataextension-response.xml → retrieve-ContentTypeINasset,asset-shared,cloudpages,dataextension,hidden,salesforcedataextension,shared_data,shared_dataextension,shared_salesforcedataextension,synchronizeddataextension-response.xml} +44 -0
  89. package/test/resources/9999999/dataFolder/{retrieve-ContentTypeINasset,asset-shared,journey-response.xml → retrieve-ContentTypeINasset,asset-shared,cloudpages,journey-response.xml} +44 -0
  90. package/test/resources/9999999/dataFolder/retrieve-ContentTypeINasset,asset-shared,cloudpages,ssjsactivity-response.xml +136 -0
  91. package/test/resources/9999999/dataFolder/{retrieve-ContentTypeINasset,asset-shared,ssjsactivity-response.xml → retrieve-ContentTypeINasset,asset-shared,cloudpages-response.xml} +29 -7
  92. package/test/resources/9999999/dataFolder/{+retrieve-response.xml → retrieve-response.xml} +23 -0
  93. package/test/resources/9999999/dataFolder/update-response.xml +31 -0
  94. package/test/resources/9999999/event/build-expected.json +0 -1
  95. package/test/resources/9999999/event/get-automation-expected.json +0 -1
  96. package/test/resources/9999999/event/get-expected.json +0 -2
  97. package/test/resources/9999999/event/get-published-expected.json +0 -2
  98. package/test/resources/9999999/event/post_withExistingDE-expected.json +0 -2
  99. package/test/resources/9999999/event/post_withSchema-callout-expected.json +3 -0
  100. package/test/resources/9999999/event/post_withSchema-expected.json +0 -2
  101. package/test/resources/9999999/event/put-callout-expected.json +3 -0
  102. package/test/resources/9999999/event/put-expected.json +0 -2
  103. package/test/resources/9999999/event/template-expected.json +0 -1
  104. package/test/resources/9999999/folder-deploy/Data Extensions/testExisting_folder.folder-meta.json +9 -0
  105. package/test/resources/9999999/importFile/get-dataImport-expected.json +1 -1
  106. package/test/resources/9999999/importFile/get-expected.json +4 -1
  107. package/test/resources/9999999/interaction/v1/interactions/0175b971-71a3-4d8e-98ac-48121f3fbf4f/audit/all/get-response-versionNumber=1.json +86 -0
  108. package/test/resources/9999999/interaction/v1/interactions/0175b971-71a3-4d8e-98ac-48121f3fbf4f/audit/all/get-response-versionNumber=2.json +101 -0
  109. package/test/resources/9999999/interaction/v1/interactions/0175b971-71a3-4d8e-98ac-48121f3fbf4f/audit/all/get-response-versionNumber=3.json +86 -0
  110. package/test/resources/9999999/interaction/v1/interactions/0175b971-71a3-4d8e-98ac-48121f3fbf4f/delete-response-versionNumber=1.txt +1 -0
  111. package/test/resources/9999999/interaction/v1/interactions/0175b971-71a3-4d8e-98ac-48121f3fbf4f/get-response-versionNumber=1.json +461 -0
  112. package/test/resources/9999999/interaction/v1/interactions/0175b971-71a3-4d8e-98ac-48121f3fbf4f/get-response-versionNumber=3.json +461 -0
  113. package/test/resources/9999999/interaction/v1/interactions/dsfdsafdsa-922c-4568-85a5-e5cc77efc3be/audit/all/get-response-versionNumber=1.json +38 -0
  114. package/test/resources/9999999/interaction/v1/interactions/dsfdsafdsa-922c-4568-85a5-e5cc77efc3be/audit/all/get-response-versionNumber=2.json +53 -0
  115. package/test/resources/9999999/interaction/v1/interactions/get-response.json +2 -2
  116. package/test/resources/9999999/interaction/v1/interactions/key_testExisting_journey_Multistep/get-response-versionNumber=1.json +461 -0
  117. package/test/resources/9999999/interaction/v1/interactions/key_testExisting_journey_Quicksend/get-response-versionNumber=1.json +253 -0
  118. package/test/resources/9999999/interaction/v1/interactions/key_testExisting_temail/get-response-versionNumber=1.json +219 -0
  119. package/test/resources/9999999/interaction/v1/interactions/key_testExisting_temail_notPublished/get-response-versionNumber=1.json +226 -0
  120. package/test/resources/9999999/interaction/v1/interactions/publishAsync/0175b971-71a3-4d8e-98ac-48121f3fbf4f/post-response-versionNumber=3.json +4 -0
  121. package/test/resources/9999999/journey/build-expected.json +0 -1
  122. package/test/resources/9999999/journey/create-transactionaEmail-publish-expected.json +0 -1
  123. package/test/resources/9999999/journey/get-multistep-expected.json +0 -4
  124. package/test/resources/9999999/journey/get-published-expected.json +0 -1
  125. package/test/resources/9999999/journey/get-quicksend-expected.json +0 -1
  126. package/test/resources/9999999/journey/get-quicksend-rcb-id-expected.json +0 -1
  127. package/test/resources/9999999/journey/get-quicksend-rcb-key-expected.json +0 -1
  128. package/test/resources/9999999/journey/get-quicksend-rcb-name-expected.json +0 -1
  129. package/test/resources/9999999/journey/get-transactionalEmail-expected.json +0 -1
  130. package/test/resources/9999999/journey/template-expected.json +0 -1
  131. package/test/resources/9999999/query/patch-expected.sql +1 -1
  132. package/test/resources/9999999/query/post-expected.sql +1 -1
  133. package/test/resources/9999999/script/patch-expected.ssjs +1 -0
  134. package/test/type.asset.test.js +123 -13
  135. package/test/type.automation.test.js +3 -1
  136. package/test/type.folder.test.js +12 -2
  137. package/test/type.journey.test.js +130 -1
  138. package/test/type.script.test.js +1 -0
  139. package/test/type.senderProfile.test.js +1 -0
  140. package/test/utils.js +2 -0
  141. package/types/mcdev.d.js +4 -0
  142. package/test/resources/9999999/asset/v1/content/assets/query/post-response-assetType.idIN219,220,221,222,223,224,225,226,227,228,230,232.json +0 -32
  143. /package/test/resources/9999999/dataFolder/{+retrieve-QAA-response.xml → retrieve-QAA-response.xml} +0 -0
  144. /package/test/resources/9999999/interaction/v1/interactions/publishAsync/0175b971-71a3-4d8e-98ac-48121f3fbf4f/{post-response.json → post-response-versionNumber=1.json} +0 -0
@@ -0,0 +1,226 @@
1
+ {
2
+ "id": "d4a900fe-3a8f-4cc5-9a49-81286e3e2cd2",
3
+ "key": "testExisting_temail_notPublished",
4
+ "name": "testExisting_temail_notPublished",
5
+ "lastPublishedDate": "0001-01-01T00:00:00",
6
+ "description": "",
7
+ "version": 1,
8
+ "workflowApiVersion": 1,
9
+ "createdDate": "2024-08-23T01:29:33.233",
10
+ "modifiedDate": "2024-08-23T02:00:44.57",
11
+ "activities": [
12
+ {
13
+ "id": "4ae63473-ea1e-4963-a257-6fea45a9038a",
14
+ "key": "EMAILV2-3",
15
+ "name": "my email activity",
16
+ "description": "",
17
+ "type": "EMAILV2",
18
+ "outcomes": [
19
+ {
20
+ "key": "067f20ba-af36-4401-99d8-934100e1935d",
21
+ "arguments": {},
22
+ "metaData": {
23
+ "invalid": false
24
+ }
25
+ }
26
+ ],
27
+ "arguments": {},
28
+ "configurationArguments": {
29
+ "applicationExtensionKey": "jb-email-activity",
30
+ "isModified": true,
31
+ "triggeredSend": {
32
+ "autoAddSubscribers": true,
33
+ "autoUpdateSubscribers": true,
34
+ "bccEmail": "",
35
+ "ccEmail": "",
36
+ "created": {},
37
+ "domainExclusions": [],
38
+ "dynamicEmailSubject": "%%=treatascontent(@subject)=%%",
39
+ "emailId": 531213,
40
+ "emailSubject": "%%=treatascontent(@subject)=%%",
41
+ "exclusionFilter": "",
42
+ "isSalesforceTracking": true,
43
+ "isMultipart": true,
44
+ "isSendLogging": false,
45
+ "isStoppedOnJobError": false,
46
+ "modified": {},
47
+ "preHeader": "%%=treatascontent(@preheader)=%%\n",
48
+ "priority": 4,
49
+ "sendClassificationId": "95da425b-a06f-e611-96fe-38eaa7142c61",
50
+ "throttleOpens": "1/1/0001 12:00:00 AM",
51
+ "throttleCloses": "1/1/0001 12:00:00 AM",
52
+ "deliveryProfileId": "163f8417-13f7-e911-a2d8-1402ec938a35",
53
+ "senderProfileId": "a75d452b-7ef4-eb11-b82d-48df37d1da95",
54
+ "isTrackingClicks": true,
55
+ "publicationListId": 15
56
+ },
57
+ "triggeredSendId": "6a2f70c5-2561-ef11-b876-f40343c95928",
58
+ "triggeredSendKey": "testExisting_temail_notPublished"
59
+ },
60
+ "metaData": {
61
+ "highThroughput": {
62
+ "definitionKey": "testExisting_temail_notPublished",
63
+ "dataExtensionId": "3c3a54a5-d55f-ef11-b876-f40343c95928"
64
+ },
65
+ "isConfigured": true,
66
+ "sections": {}
67
+ },
68
+ "schema": {
69
+ "arguments": {
70
+ "requestID": {
71
+ "dataType": "Text",
72
+ "isNullable": true,
73
+ "direction": "Out",
74
+ "readOnly": false,
75
+ "access": "Hidden"
76
+ },
77
+ "messageKey": {
78
+ "dataType": "Text",
79
+ "isNullable": true,
80
+ "direction": "Out",
81
+ "readOnly": false,
82
+ "access": "Hidden"
83
+ },
84
+ "activityId": {
85
+ "dataType": "Text",
86
+ "isNullable": true,
87
+ "direction": "In",
88
+ "readOnly": false,
89
+ "access": "Hidden"
90
+ },
91
+ "definitionId": {
92
+ "dataType": "Text",
93
+ "isNullable": true,
94
+ "direction": "In",
95
+ "readOnly": true,
96
+ "access": "Hidden"
97
+ },
98
+ "emailSubjectDataBound": {
99
+ "dataType": "Text",
100
+ "isNullable": true,
101
+ "direction": "In",
102
+ "readOnly": true,
103
+ "access": "Hidden"
104
+ },
105
+ "contactId": {
106
+ "dataType": "Number",
107
+ "isNullable": true,
108
+ "direction": "In",
109
+ "readOnly": false,
110
+ "access": "Hidden"
111
+ },
112
+ "contactKey": {
113
+ "dataType": "Text",
114
+ "isNullable": false,
115
+ "direction": "In",
116
+ "readOnly": false,
117
+ "access": "Hidden"
118
+ },
119
+ "emailAddress": {
120
+ "dataType": "Text",
121
+ "isNullable": false,
122
+ "direction": "In",
123
+ "readOnly": false,
124
+ "access": "Hidden"
125
+ },
126
+ "sourceCustomObjectId": {
127
+ "dataType": "Text",
128
+ "isNullable": true,
129
+ "direction": "In",
130
+ "readOnly": false,
131
+ "access": "Hidden"
132
+ },
133
+ "sourceCustomObjectKey": {
134
+ "dataType": "LongNumber",
135
+ "isNullable": true,
136
+ "direction": "In",
137
+ "readOnly": false,
138
+ "access": "Hidden"
139
+ },
140
+ "fieldType": {
141
+ "dataType": "Text",
142
+ "isNullable": true,
143
+ "direction": "In",
144
+ "readOnly": false,
145
+ "access": "Hidden"
146
+ },
147
+ "eventData": {
148
+ "dataType": "Text",
149
+ "isNullable": true,
150
+ "direction": "In",
151
+ "readOnly": false,
152
+ "access": "Hidden"
153
+ },
154
+ "obfuscationProperties": {
155
+ "dataType": "Text",
156
+ "isNullable": true,
157
+ "direction": "In",
158
+ "readOnly": false,
159
+ "access": "Hidden"
160
+ },
161
+ "customObjectKey": {
162
+ "dataType": "LongNumber",
163
+ "isNullable": true,
164
+ "direction": "In",
165
+ "readOnly": true,
166
+ "access": "Hidden"
167
+ },
168
+ "definitionInstanceId": {
169
+ "dataType": "Text",
170
+ "isNullable": false,
171
+ "direction": "In",
172
+ "readOnly": false,
173
+ "access": "Hidden"
174
+ }
175
+ }
176
+ }
177
+ }
178
+ ],
179
+ "triggers": [
180
+ {
181
+ "id": "64a93832-fd23-487e-b585-8f3af3b5b6eb",
182
+ "key": "TRIGGER",
183
+ "name": "TRIGGER",
184
+ "description": "",
185
+ "type": "transactional-api",
186
+ "outcomes": [],
187
+ "arguments": {},
188
+ "configurationArguments": {},
189
+ "metaData": {
190
+ "chainType": "none",
191
+ "configurationRequired": false,
192
+ "iconUrl": "/images/icon_journeyBuilder-event-transactional-blue.svg",
193
+ "title": "Transactional API Event",
194
+ "category": "Transactional",
195
+ "entrySourceGroupConfigUrl": "null"
196
+ }
197
+ }
198
+ ],
199
+ "goals": [],
200
+ "exits": [],
201
+ "notifiers": [],
202
+ "stats": {
203
+ "currentPopulation": 0,
204
+ "cumulativePopulation": 0,
205
+ "metGoal": 0,
206
+ "metExitCriteria": 0,
207
+ "goalPerformance": 0
208
+ },
209
+ "entryMode": "MultipleEntries",
210
+ "definitionType": "Transactional",
211
+ "channel": "email",
212
+ "defaults": {
213
+ "properties": {}
214
+ },
215
+ "metaData": {
216
+ "dataSource": "ContactsModel",
217
+ "highThroughputSending": {
218
+ "email": false
219
+ }
220
+ },
221
+ "executionMode": "Production",
222
+ "categoryId": 6298,
223
+ "status": "Published",
224
+ "definitionId": "d4a900fe-3a8f-4cc5-9a49-81286e3e2cd2",
225
+ "scheduledStatus": "Draft"
226
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "statusUrl": "/interaction/v1/interactions/publishStatus/45f06c0a-3ed2-48b2-a6a8-b5119253f01c",
3
+ "statusId": "45f06c0a-3ed2-48b2-a6a8-b5119253f01c"
4
+ }
@@ -6,7 +6,6 @@
6
6
  "modifiedDate": "2024-04-24T12:19:12.803",
7
7
  "activities": [
8
8
  {
9
- "id": "e20dcaa3-a750-44cf-9ce8-42d00378b8b4",
10
9
  "key": "EMAILV2-1",
11
10
  "name": "testTemplated_asset_mail",
12
11
  "description": "",
@@ -9,7 +9,6 @@
9
9
  "createdDate": "2025-01-31T03:46:39.267",
10
10
  "activities": [
11
11
  {
12
- "id": "1ce8a9e3-bee4-43e3-88a5-a1b3d21f1813",
13
12
  "key": "EMAILV2-1",
14
13
  "name": "testNew_temail_notPublished_24Q3",
15
14
  "description": "",
@@ -9,7 +9,6 @@
9
9
  "modifiedDate": "2024-05-04T17:25:57.9",
10
10
  "activities": [
11
11
  {
12
- "id": "7ba1e59a-6be4-46c7-b76f-4c06feb1268a",
13
12
  "key": "EMAILV2-1",
14
13
  "name": "my custom activity name",
15
14
  "description": "",
@@ -182,7 +181,6 @@
182
181
  }
183
182
  },
184
183
  {
185
- "id": "342dd0aa-a6be-401e-8614-3538800bfd7c",
186
184
  "key": "MULTICRITERIADECISIONV2-1",
187
185
  "name": "",
188
186
  "description": "",
@@ -234,7 +232,6 @@
234
232
  }
235
233
  },
236
234
  {
237
- "id": "e2a486cf-c85f-4543-88a2-d579cac1e0de",
238
235
  "key": "WAITBYDURATION-1",
239
236
  "name": "1 day",
240
237
  "description": "",
@@ -304,7 +301,6 @@
304
301
  }
305
302
  },
306
303
  {
307
- "id": "70572b1a-e274-4f09-a3fa-6fc0732ec52b",
308
304
  "key": "WAITBYDURATION-2",
309
305
  "name": "",
310
306
  "description": "",
@@ -37,7 +37,6 @@
37
37
  }
38
38
  },
39
39
  "description": "",
40
- "id": "4ae63473-ea1e-4963-a257-6fea45a9038a",
41
40
  "key": "EMAILV2-3",
42
41
  "metaData": {
43
42
  "highThroughput": {
@@ -9,7 +9,6 @@
9
9
  "modifiedDate": "2024-04-24T12:19:12.803",
10
10
  "activities": [
11
11
  {
12
- "id": "e20dcaa3-a750-44cf-9ce8-42d00378b8b4",
13
12
  "key": "EMAILV2-1",
14
13
  "name": "testExisting_asset_mail",
15
14
  "description": "",
@@ -9,7 +9,6 @@
9
9
  "modifiedDate": "2024-04-24T12:19:12.803",
10
10
  "activities": [
11
11
  {
12
- "id": "e20dcaa3-a750-44cf-9ce8-42d00378b8b4",
13
12
  "key": "EMAILV2-1",
14
13
  "name": "testExisting_asset_mail",
15
14
  "description": "",
@@ -9,7 +9,6 @@
9
9
  "modifiedDate": "2024-04-24T12:19:12.803",
10
10
  "activities": [
11
11
  {
12
- "id": "e20dcaa3-a750-44cf-9ce8-42d00378b8b4",
13
12
  "key": "EMAILV2-1",
14
13
  "name": "testExisting_asset_mail",
15
14
  "description": "",
@@ -9,7 +9,6 @@
9
9
  "modifiedDate": "2024-04-24T12:19:12.803",
10
10
  "activities": [
11
11
  {
12
- "id": "e20dcaa3-a750-44cf-9ce8-42d00378b8b4",
13
12
  "key": "EMAILV2-1",
14
13
  "name": "testExisting_asset_mail",
15
14
  "description": "",
@@ -9,7 +9,6 @@
9
9
  "modifiedDate": "2022-03-24T02:20:40.45",
10
10
  "activities": [
11
11
  {
12
- "id": "9606bcb0-9246-4610-9800-963bc77fc20a",
13
12
  "key": "EMAILV2-4",
14
13
  "name": "testExisting_temail",
15
14
  "description": "",
@@ -6,7 +6,6 @@
6
6
  "modifiedDate": "2024-04-24T12:19:12.803",
7
7
  "activities": [
8
8
  {
9
- "id": "e20dcaa3-a750-44cf-9ce8-42d00378b8b4",
10
9
  "key": "EMAILV2-1",
11
10
  "name": "{{{prefix}}}asset_mail",
12
11
  "description": "",
@@ -1,5 +1,5 @@
1
1
  SELECT
2
- SubscriberKey AS testField
2
+ SubscriberKey as testField
3
3
  FROM
4
4
  _Subscribers
5
5
  WHERE
@@ -1,4 +1,4 @@
1
1
  SELECT
2
- SubscriberKey AS testField
2
+ SubscriberKey as testField
3
3
  FROM
4
4
  _Subscribers
@@ -1 +1,2 @@
1
+
1
2
  // dummy updated
@@ -153,21 +153,20 @@ describe('type: asset', () => {
153
153
  it('Should retrieve a asset & ensure non-ssjs code is not removed', async () => {
154
154
  // WHEN
155
155
  const retrieve = await handler.retrieve('testInstance/testBU', ['asset']);
156
-
157
156
  // THEN
158
157
  assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error');
159
158
  assert.equal(
160
159
  retrieve['testInstance/testBU'].asset
161
160
  ? Object.keys(retrieve['testInstance/testBU'].asset).length
162
161
  : 0,
163
- 9,
162
+ 12,
164
163
  'Unexpected number of assets in retrieve response'
165
164
  );
166
165
  // get results from cache
167
166
  const result = cache.getCache();
168
167
  assert.equal(
169
168
  result.asset ? Object.keys(result.asset).length : 0,
170
- 9,
169
+ 15,
171
170
  'Unexpected number of assets in cache'
172
171
  );
173
172
 
@@ -229,9 +228,120 @@ describe('type: asset', () => {
229
228
  )
230
229
  );
231
230
 
231
+ assert.deepEqual(
232
+ await getActualJson('test_coderesource_js', 'asset', 'coderesource'),
233
+ await testUtils.getExpectedJson(
234
+ '9999999',
235
+ 'asset',
236
+ 'test_coderesource_js-retrieve'
237
+ ),
238
+ 'returned metadata was not equal expected'
239
+ );
240
+ expect(
241
+ await getActualFile('test_coderesource_js', 'asset', 'coderesource', 'js')
242
+ ).to.equal(
243
+ await testUtils.getExpectedFile(
244
+ '9999999',
245
+ 'asset',
246
+ 'test_coderesource_js-retrieve',
247
+ 'js'
248
+ )
249
+ );
250
+
251
+ assert.deepEqual(
252
+ await getActualJson('test_coderesource_json', 'asset', 'coderesource'),
253
+ await testUtils.getExpectedJson(
254
+ '9999999',
255
+ 'asset',
256
+ 'test_coderesource_json-retrieve'
257
+ ),
258
+ 'returned metadata was not equal expected'
259
+ );
260
+ expect(
261
+ await getActualFile('test_coderesource_json', 'asset', 'coderesource', 'jsonc')
262
+ ).to.equal(
263
+ await testUtils.getExpectedFile(
264
+ '9999999',
265
+ 'asset',
266
+ 'test_coderesource_json-retrieve',
267
+ 'jsonc'
268
+ )
269
+ );
270
+
271
+ assert.deepEqual(
272
+ await getActualJson('test_coderesource_xml', 'asset', 'coderesource'),
273
+ await testUtils.getExpectedJson(
274
+ '9999999',
275
+ 'asset',
276
+ 'test_coderesource_xml-retrieve'
277
+ ),
278
+ 'returned metadata was not equal expected'
279
+ );
280
+ expect(
281
+ await getActualFile('test_coderesource_xml', 'asset', 'coderesource', 'xml')
282
+ ).to.equal(
283
+ await testUtils.getExpectedFile(
284
+ '9999999',
285
+ 'asset',
286
+ 'test_coderesource_xml-retrieve',
287
+ 'xml'
288
+ )
289
+ );
290
+
291
+ assert.equal(
292
+ testUtils.getAPIHistoryLength(),
293
+ 26,
294
+ 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
295
+ );
296
+ return;
297
+ });
298
+
299
+ it('Should retrieve asset-cloudpage', async () => {
300
+ // WHEN
301
+ const retrieve = await handler.retrieve('testInstance/testBU', ['asset-cloudpage']);
302
+
303
+ // THEN
304
+ assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error');
305
+ assert.equal(
306
+ retrieve['testInstance/testBU'].asset
307
+ ? Object.keys(retrieve['testInstance/testBU'].asset).length
308
+ : 0,
309
+ 3,
310
+ 'Unexpected number of assets in retrieve response'
311
+ );
312
+ // get results from cache
313
+ const result = cache.getCache();
314
+ assert.equal(
315
+ result.asset ? Object.keys(result.asset).length : 0,
316
+ 13,
317
+ 'Unexpected number of assets in cache'
318
+ );
319
+
320
+ assert.deepEqual(
321
+ await getActualJson('test_landingpage', 'asset', 'cloudpage'),
322
+ await testUtils.getExpectedJson('9999999', 'asset', 'test_landingpage-retrieve'),
323
+ 'returned metadata was not equal expected'
324
+ );
325
+
326
+ assert.deepEqual(
327
+ await getActualJson('test_microsite', 'asset', 'cloudpage'),
328
+ await testUtils.getExpectedJson('9999999', 'asset', 'test_microsite-retrieve'),
329
+ 'returned metadata was not equal expected'
330
+ );
331
+
332
+ assert.deepEqual(
333
+ await getActualJson('test_interactivecontent', 'asset', 'cloudpage'),
334
+ await testUtils.getExpectedJson(
335
+ '9999999',
336
+ 'asset',
337
+ 'test_interactivecontent-retrieve'
338
+ ),
339
+ 'returned metadata was not equal expected'
340
+ );
341
+
232
342
  assert.equal(
233
343
  testUtils.getAPIHistoryLength(),
234
- 22,
344
+ 10,
235
345
  'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
236
346
  );
237
347
  return;
@@ -258,7 +368,7 @@ describe('type: asset', () => {
258
368
  const result = cache.getCache();
259
369
  assert.equal(
260
370
  result.asset ? Object.keys(result.asset).length : 0,
261
- 7,
371
+ 10,
262
372
  'Unexpected number of assets in cache'
263
373
  );
264
374
 
@@ -722,7 +832,7 @@ describe('type: asset', () => {
722
832
  // download first before we test buildTemplate
723
833
  await handler.retrieve('testInstance/testBU', ['asset']);
724
834
 
725
- const expectedApiCallsRetrieve = 22;
835
+ const expectedApiCallsRetrieve = 26;
726
836
  assert.equal(
727
837
  testUtils.getAPIHistoryLength(),
728
838
  expectedApiCallsRetrieve,
@@ -867,7 +977,7 @@ describe('type: asset', () => {
867
977
  // download first before we test buildTemplate
868
978
  await handler.retrieve('testInstance/testBU', ['asset']);
869
979
 
870
- const expectedApiCallsRetrieve = 22;
980
+ const expectedApiCallsRetrieve = 26;
871
981
  assert.equal(
872
982
  testUtils.getAPIHistoryLength(),
873
983
  expectedApiCallsRetrieve,
@@ -1082,7 +1192,7 @@ describe('type: asset', () => {
1082
1192
  const result = cache.getCache();
1083
1193
  assert.equal(
1084
1194
  result.asset ? Object.keys(result.asset).length : 0,
1085
- 9,
1195
+ 12,
1086
1196
  'Unexpected number of assets in cache'
1087
1197
  );
1088
1198
  // check if conversions happened
@@ -1137,7 +1247,7 @@ describe('type: asset', () => {
1137
1247
 
1138
1248
  assert.equal(
1139
1249
  testUtils.getAPIHistoryLength(),
1140
- 24,
1250
+ 28,
1141
1251
  'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
1142
1252
  );
1143
1253
  return;
@@ -1170,7 +1280,7 @@ describe('type: asset', () => {
1170
1280
  const result = cache.getCache();
1171
1281
  assert.equal(
1172
1282
  result.asset ? Object.keys(result.asset).length : 0,
1173
- 9,
1283
+ 12,
1174
1284
  'Unexpected number of assets in cache'
1175
1285
  );
1176
1286
  // check if conversions happened
@@ -1225,7 +1335,7 @@ describe('type: asset', () => {
1225
1335
 
1226
1336
  assert.equal(
1227
1337
  testUtils.getAPIHistoryLength(),
1228
- 24,
1338
+ 28,
1229
1339
  'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
1230
1340
  );
1231
1341
  return;
@@ -1258,7 +1368,7 @@ describe('type: asset', () => {
1258
1368
  const result = cache.getCache();
1259
1369
  assert.equal(
1260
1370
  result.asset ? Object.keys(result.asset).length : 0,
1261
- 9,
1371
+ 12,
1262
1372
  'Unexpected number of assets in cache'
1263
1373
  );
1264
1374
  // check if conversions happened
@@ -1313,7 +1423,7 @@ describe('type: asset', () => {
1313
1423
 
1314
1424
  assert.equal(
1315
1425
  testUtils.getAPIHistoryLength(),
1316
- 24,
1426
+ 28,
1317
1427
  'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
1318
1428
  );
1319
1429
  return;
@@ -679,7 +679,9 @@ describe('type: automation', () => {
679
679
  it('Should create a automation template via buildTemplate with --dependencies', async () => {
680
680
  // download first before we test buildTemplate
681
681
  await handler.retrieve('testInstance/testBU');
682
- const expectedApiCallsRetrieve = 97;
682
+ assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error');
683
+
684
+ const expectedApiCallsRetrieve = 101;
683
685
  assert.equal(
684
686
  testUtils.getAPIHistoryLength(),
685
687
  expectedApiCallsRetrieve,
@@ -37,7 +37,7 @@ describe('type: folder', () => {
37
37
  const cached = cache.getCache();
38
38
  assert.equal(
39
39
  cached.folder ? Object.keys(cached.folder).length : 0,
40
- 38,
40
+ 40,
41
41
  'unexpected number of folders in cache'
42
42
  );
43
43
 
@@ -48,6 +48,7 @@ describe('type: folder', () => {
48
48
  : null,
49
49
  [
50
50
  'Data Extensions/my',
51
+ 'Data Extensions/testExisting_folder',
51
52
  'Data Extensions/my/sub',
52
53
  'Data Extensions/my/sub/path',
53
54
  'Data Extensions/my/sub/path/subpath',
@@ -73,6 +74,7 @@ describe('type: folder', () => {
73
74
  );
74
75
 
75
76
  const createSoapCallouts = testUtils.getSoapCallouts('Create', 'DataFolder');
77
+ const updateSoapCallouts = testUtils.getSoapCallouts('Update', 'DataFolder');
76
78
  // confirm created item
77
79
  assert.deepEqual(
78
80
  createSoapCallouts,
@@ -84,11 +86,19 @@ describe('type: folder', () => {
84
86
  ],
85
87
  'create-payload XL was not equal expected'
86
88
  );
89
+ // confirm updated item - this should have updated despite the folder name being different (changed case). The server compares folders case insensitively
90
+ assert.deepEqual(
91
+ updateSoapCallouts,
92
+ [
93
+ '<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><Body><UpdateRequest xmlns="http://exacttarget.com/wsdl/partnerAPI"><Objects xsi:type="DataFolder"><Name>testExisting_folder</Name><IsActive>true</IsActive><IsEditable>true</IsEditable><AllowChildren>true</AllowChildren><ParentFolder><ID>2</ID></ParentFolder><ID>66666</ID></Objects></UpdateRequest></Body><Header><fueloauth xmlns="http://exacttarget.com">9999999</fueloauth></Header></Envelope>',
94
+ ],
95
+ 'update-payload XL was not equal expected'
96
+ );
87
97
 
88
98
  // check number of API calls
89
99
  assert.equal(
90
100
  testUtils.getAPIHistoryLength(),
91
- 10,
101
+ 11,
92
102
  'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
93
103
  );
94
104
  return;