mcdev 6.0.2 → 7.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 (602) hide show
  1. package/.beautyamp.json +13 -0
  2. package/.eslintrc.json +7 -1
  3. package/.github/ISSUE_TEMPLATE/bug.yml +1 -0
  4. package/.github/PULL_REQUEST_TEMPLATE/pr_template_release.md +10 -3
  5. package/.github/workflows/close_issues_on_merge.yml +1 -1
  6. package/.github/workflows/code-test.yml +51 -3
  7. package/.github/workflows/coverage-base-update.yml +1 -1
  8. package/.github/workflows/coverage-develop-branch.yml +1 -1
  9. package/.github/workflows/coverage-main-branch.yml +1 -1
  10. package/.github/workflows/coverage.yml +2 -2
  11. package/.github/workflows/npm-publish.yml +3 -2
  12. package/.github/workflows/pr-labeler.yml +1 -1
  13. package/.husky/commit-msg +0 -2
  14. package/.husky/post-checkout +0 -3
  15. package/.husky/post-merge +2 -7
  16. package/.husky/pre-commit +5 -5
  17. package/.prettierrc +0 -8
  18. package/.vscode/extensions.json +2 -0
  19. package/.vscode/settings.json +15 -3
  20. package/@types/lib/Builder.d.ts +97 -0
  21. package/@types/lib/Builder.d.ts.map +1 -0
  22. package/@types/lib/Deployer.d.ts +99 -0
  23. package/@types/lib/Deployer.d.ts.map +1 -0
  24. package/@types/lib/MetadataTypeDefinitions.d.ts +80 -0
  25. package/@types/lib/MetadataTypeDefinitions.d.ts.map +1 -0
  26. package/@types/lib/MetadataTypeInfo.d.ts +78 -0
  27. package/@types/lib/MetadataTypeInfo.d.ts.map +1 -0
  28. package/@types/lib/Retriever.d.ts +66 -0
  29. package/@types/lib/Retriever.d.ts.map +1 -0
  30. package/@types/lib/cli.d.ts +3 -0
  31. package/@types/lib/cli.d.ts.map +1 -0
  32. package/@types/lib/index.d.ts +383 -0
  33. package/@types/lib/index.d.ts.map +1 -0
  34. package/@types/lib/metadataTypes/Asset.d.ts +1082 -0
  35. package/@types/lib/metadataTypes/Asset.d.ts.map +1 -0
  36. package/@types/lib/metadataTypes/AttributeGroup.d.ts +290 -0
  37. package/@types/lib/metadataTypes/AttributeGroup.d.ts.map +1 -0
  38. package/@types/lib/metadataTypes/AttributeSet.d.ts +968 -0
  39. package/@types/lib/metadataTypes/AttributeSet.d.ts.map +1 -0
  40. package/@types/lib/metadataTypes/Automation.d.ts +921 -0
  41. package/@types/lib/metadataTypes/Automation.d.ts.map +1 -0
  42. package/@types/lib/metadataTypes/Campaign.d.ts +190 -0
  43. package/@types/lib/metadataTypes/Campaign.d.ts.map +1 -0
  44. package/@types/lib/metadataTypes/ContentArea.d.ts +250 -0
  45. package/@types/lib/metadataTypes/ContentArea.d.ts.map +1 -0
  46. package/@types/lib/metadataTypes/DataExtension.d.ts +571 -0
  47. package/@types/lib/metadataTypes/DataExtension.d.ts.map +1 -0
  48. package/@types/lib/metadataTypes/DataExtensionField.d.ts +236 -0
  49. package/@types/lib/metadataTypes/DataExtensionField.d.ts.map +1 -0
  50. package/@types/lib/metadataTypes/DataExtensionTemplate.d.ts +175 -0
  51. package/@types/lib/metadataTypes/DataExtensionTemplate.d.ts.map +1 -0
  52. package/@types/lib/metadataTypes/DataExtract.d.ts +217 -0
  53. package/@types/lib/metadataTypes/DataExtract.d.ts.map +1 -0
  54. package/@types/lib/metadataTypes/DataExtractType.d.ts +80 -0
  55. package/@types/lib/metadataTypes/DataExtractType.d.ts.map +1 -0
  56. package/@types/lib/metadataTypes/DeliveryProfile.d.ts +102 -0
  57. package/@types/lib/metadataTypes/DeliveryProfile.d.ts.map +1 -0
  58. package/@types/lib/metadataTypes/Discovery.d.ts +189 -0
  59. package/@types/lib/metadataTypes/Discovery.d.ts.map +1 -0
  60. package/@types/lib/metadataTypes/Email.d.ts +384 -0
  61. package/@types/lib/metadataTypes/Email.d.ts.map +1 -0
  62. package/@types/lib/metadataTypes/EmailSend.d.ts +652 -0
  63. package/@types/lib/metadataTypes/EmailSend.d.ts.map +1 -0
  64. package/@types/lib/metadataTypes/Event.d.ts +958 -0
  65. package/@types/lib/metadataTypes/Event.d.ts.map +1 -0
  66. package/@types/lib/metadataTypes/FileLocation.d.ts +101 -0
  67. package/@types/lib/metadataTypes/FileLocation.d.ts.map +1 -0
  68. package/@types/lib/metadataTypes/FileTransfer.d.ts +228 -0
  69. package/@types/lib/metadataTypes/FileTransfer.d.ts.map +1 -0
  70. package/@types/lib/metadataTypes/Filter.d.ts +145 -0
  71. package/@types/lib/metadataTypes/Filter.d.ts.map +1 -0
  72. package/@types/lib/metadataTypes/Folder.d.ts +287 -0
  73. package/@types/lib/metadataTypes/Folder.d.ts.map +1 -0
  74. package/@types/lib/metadataTypes/ImportFile.d.ts +409 -0
  75. package/@types/lib/metadataTypes/ImportFile.d.ts.map +1 -0
  76. package/@types/lib/metadataTypes/Journey.d.ts +541 -0
  77. package/@types/lib/metadataTypes/Journey.d.ts.map +1 -0
  78. package/@types/lib/metadataTypes/List.d.ts +191 -0
  79. package/@types/lib/metadataTypes/List.d.ts.map +1 -0
  80. package/@types/lib/metadataTypes/MetadataType.d.ts +680 -0
  81. package/@types/lib/metadataTypes/MetadataType.d.ts.map +1 -0
  82. package/@types/lib/metadataTypes/MobileCode.d.ts +225 -0
  83. package/@types/lib/metadataTypes/MobileCode.d.ts.map +1 -0
  84. package/@types/lib/metadataTypes/MobileKeyword.d.ts +432 -0
  85. package/@types/lib/metadataTypes/MobileKeyword.d.ts.map +1 -0
  86. package/@types/lib/metadataTypes/MobileMessage.d.ts +931 -0
  87. package/@types/lib/metadataTypes/MobileMessage.d.ts.map +1 -0
  88. package/@types/lib/metadataTypes/Query.d.ts +299 -0
  89. package/@types/lib/metadataTypes/Query.d.ts.map +1 -0
  90. package/@types/lib/metadataTypes/Role.d.ts +164 -0
  91. package/@types/lib/metadataTypes/Role.d.ts.map +1 -0
  92. package/@types/lib/metadataTypes/Script.d.ts +305 -0
  93. package/@types/lib/metadataTypes/Script.d.ts.map +1 -0
  94. package/@types/lib/metadataTypes/SendClassification.d.ts +221 -0
  95. package/@types/lib/metadataTypes/SendClassification.d.ts.map +1 -0
  96. package/@types/lib/metadataTypes/SenderProfile.d.ts +257 -0
  97. package/@types/lib/metadataTypes/SenderProfile.d.ts.map +1 -0
  98. package/@types/lib/metadataTypes/TransactionalEmail.d.ts +230 -0
  99. package/@types/lib/metadataTypes/TransactionalEmail.d.ts.map +1 -0
  100. package/@types/lib/metadataTypes/TransactionalMessage.d.ts +163 -0
  101. package/@types/lib/metadataTypes/TransactionalMessage.d.ts.map +1 -0
  102. package/@types/lib/metadataTypes/TransactionalPush.d.ts +175 -0
  103. package/@types/lib/metadataTypes/TransactionalPush.d.ts.map +1 -0
  104. package/@types/lib/metadataTypes/TransactionalSMS.d.ts +205 -0
  105. package/@types/lib/metadataTypes/TransactionalSMS.d.ts.map +1 -0
  106. package/@types/lib/metadataTypes/TriggeredSend.d.ts +671 -0
  107. package/@types/lib/metadataTypes/TriggeredSend.d.ts.map +1 -0
  108. package/@types/lib/metadataTypes/User.d.ts +677 -0
  109. package/@types/lib/metadataTypes/User.d.ts.map +1 -0
  110. package/@types/lib/metadataTypes/Verification.d.ts +188 -0
  111. package/@types/lib/metadataTypes/Verification.d.ts.map +1 -0
  112. package/@types/lib/metadataTypes/definitions/Asset.definition.d.ts +692 -0
  113. package/@types/lib/metadataTypes/definitions/Asset.definition.d.ts.map +1 -0
  114. package/@types/lib/metadataTypes/definitions/AttributeGroup.definition.d.ts +246 -0
  115. package/@types/lib/metadataTypes/definitions/AttributeGroup.definition.d.ts.map +1 -0
  116. package/@types/lib/metadataTypes/definitions/AttributeSet.definition.d.ts +893 -0
  117. package/@types/lib/metadataTypes/definitions/AttributeSet.definition.d.ts.map +1 -0
  118. package/@types/lib/metadataTypes/definitions/Automation.definition.d.ts +616 -0
  119. package/@types/lib/metadataTypes/definitions/Automation.definition.d.ts.map +1 -0
  120. package/@types/lib/metadataTypes/definitions/Campaign.definition.d.ts +126 -0
  121. package/@types/lib/metadataTypes/definitions/Campaign.definition.d.ts.map +1 -0
  122. package/@types/lib/metadataTypes/definitions/ContentArea.definition.d.ts +182 -0
  123. package/@types/lib/metadataTypes/definitions/ContentArea.definition.d.ts.map +1 -0
  124. package/@types/lib/metadataTypes/definitions/DataExtension.definition.d.ts +237 -0
  125. package/@types/lib/metadataTypes/definitions/DataExtension.definition.d.ts.map +1 -0
  126. package/@types/lib/metadataTypes/definitions/DataExtensionField.definition.d.ts +121 -0
  127. package/@types/lib/metadataTypes/definitions/DataExtensionField.definition.d.ts.map +1 -0
  128. package/@types/lib/metadataTypes/definitions/DataExtensionTemplate.definition.d.ts +133 -0
  129. package/@types/lib/metadataTypes/definitions/DataExtensionTemplate.definition.d.ts.map +1 -0
  130. package/@types/lib/metadataTypes/definitions/DataExtract.definition.d.ts +156 -0
  131. package/@types/lib/metadataTypes/definitions/DataExtract.definition.d.ts.map +1 -0
  132. package/@types/lib/metadataTypes/definitions/DataExtractType.definition.d.ts +34 -0
  133. package/@types/lib/metadataTypes/definitions/DataExtractType.definition.d.ts.map +1 -0
  134. package/@types/lib/metadataTypes/definitions/DeliveryProfile.definition.d.ts +80 -0
  135. package/@types/lib/metadataTypes/definitions/DeliveryProfile.definition.d.ts.map +1 -0
  136. package/@types/lib/metadataTypes/definitions/Discovery.definition.d.ts +146 -0
  137. package/@types/lib/metadataTypes/definitions/Discovery.definition.d.ts.map +1 -0
  138. package/@types/lib/metadataTypes/definitions/Email.definition.d.ts +314 -0
  139. package/@types/lib/metadataTypes/definitions/Email.definition.d.ts.map +1 -0
  140. package/@types/lib/metadataTypes/definitions/EmailSend.definition.d.ts +582 -0
  141. package/@types/lib/metadataTypes/definitions/EmailSend.definition.d.ts.map +1 -0
  142. package/@types/lib/metadataTypes/definitions/Event.definition.d.ts +867 -0
  143. package/@types/lib/metadataTypes/definitions/Event.definition.d.ts.map +1 -0
  144. package/@types/lib/metadataTypes/definitions/FileLocation.definition.d.ts +68 -0
  145. package/@types/lib/metadataTypes/definitions/FileLocation.definition.d.ts.map +1 -0
  146. package/@types/lib/metadataTypes/definitions/FileTransfer.definition.d.ts +191 -0
  147. package/@types/lib/metadataTypes/definitions/FileTransfer.definition.d.ts.map +1 -0
  148. package/@types/lib/metadataTypes/definitions/Filter.definition.d.ts +147 -0
  149. package/@types/lib/metadataTypes/definitions/Filter.definition.d.ts.map +1 -0
  150. package/@types/lib/metadataTypes/definitions/Folder.definition.d.ts +174 -0
  151. package/@types/lib/metadataTypes/definitions/Folder.definition.d.ts.map +1 -0
  152. package/@types/lib/metadataTypes/definitions/ImportFile.definition.d.ts +306 -0
  153. package/@types/lib/metadataTypes/definitions/ImportFile.definition.d.ts.map +1 -0
  154. package/@types/lib/metadataTypes/definitions/Journey.definition.d.ts +426 -0
  155. package/@types/lib/metadataTypes/definitions/Journey.definition.d.ts.map +1 -0
  156. package/@types/lib/metadataTypes/definitions/List.definition.d.ts +118 -0
  157. package/@types/lib/metadataTypes/definitions/List.definition.d.ts.map +1 -0
  158. package/@types/lib/metadataTypes/definitions/MobileCode.definition.d.ts +167 -0
  159. package/@types/lib/metadataTypes/definitions/MobileCode.definition.d.ts.map +1 -0
  160. package/@types/lib/metadataTypes/definitions/MobileKeyword.definition.d.ts +276 -0
  161. package/@types/lib/metadataTypes/definitions/MobileKeyword.definition.d.ts.map +1 -0
  162. package/@types/lib/metadataTypes/definitions/MobileMessage.definition.d.ts +783 -0
  163. package/@types/lib/metadataTypes/definitions/MobileMessage.definition.d.ts.map +1 -0
  164. package/@types/lib/metadataTypes/definitions/Query.definition.d.ts +203 -0
  165. package/@types/lib/metadataTypes/definitions/Query.definition.d.ts.map +1 -0
  166. package/@types/lib/metadataTypes/definitions/Role.definition.d.ts +108 -0
  167. package/@types/lib/metadataTypes/definitions/Role.definition.d.ts.map +1 -0
  168. package/@types/lib/metadataTypes/definitions/Script.definition.d.ts +153 -0
  169. package/@types/lib/metadataTypes/definitions/Script.definition.d.ts.map +1 -0
  170. package/@types/lib/metadataTypes/definitions/SendClassification.definition.d.ts +151 -0
  171. package/@types/lib/metadataTypes/definitions/SendClassification.definition.d.ts.map +1 -0
  172. package/@types/lib/metadataTypes/definitions/SenderProfile.definition.d.ts +180 -0
  173. package/@types/lib/metadataTypes/definitions/SenderProfile.definition.d.ts.map +1 -0
  174. package/@types/lib/metadataTypes/definitions/TransactionalEmail.definition.d.ts +167 -0
  175. package/@types/lib/metadataTypes/definitions/TransactionalEmail.definition.d.ts.map +1 -0
  176. package/@types/lib/metadataTypes/definitions/TransactionalMessage.definition.d.ts +99 -0
  177. package/@types/lib/metadataTypes/definitions/TransactionalMessage.definition.d.ts.map +1 -0
  178. package/@types/lib/metadataTypes/definitions/TransactionalPush.definition.d.ts +119 -0
  179. package/@types/lib/metadataTypes/definitions/TransactionalPush.definition.d.ts.map +1 -0
  180. package/@types/lib/metadataTypes/definitions/TransactionalSMS.definition.d.ts +113 -0
  181. package/@types/lib/metadataTypes/definitions/TransactionalSMS.definition.d.ts.map +1 -0
  182. package/@types/lib/metadataTypes/definitions/TriggeredSend.definition.d.ts +560 -0
  183. package/@types/lib/metadataTypes/definitions/TriggeredSend.definition.d.ts.map +1 -0
  184. package/@types/lib/metadataTypes/definitions/User.definition.d.ts +423 -0
  185. package/@types/lib/metadataTypes/definitions/User.definition.d.ts.map +1 -0
  186. package/@types/lib/metadataTypes/definitions/Verification.definition.d.ts +129 -0
  187. package/@types/lib/metadataTypes/definitions/Verification.definition.d.ts.map +1 -0
  188. package/@types/lib/retrieveChangelog.d.ts +3 -0
  189. package/@types/lib/retrieveChangelog.d.ts.map +1 -0
  190. package/@types/lib/util/auth.d.ts +41 -0
  191. package/@types/lib/util/auth.d.ts.map +1 -0
  192. package/@types/lib/util/businessUnit.d.ts +21 -0
  193. package/@types/lib/util/businessUnit.d.ts.map +1 -0
  194. package/@types/lib/util/cache.d.ts +64 -0
  195. package/@types/lib/util/cache.d.ts.map +1 -0
  196. package/@types/lib/util/cli.d.ts +125 -0
  197. package/@types/lib/util/cli.d.ts.map +1 -0
  198. package/@types/lib/util/config.d.ts +45 -0
  199. package/@types/lib/util/config.d.ts.map +1 -0
  200. package/@types/lib/util/devops.d.ts +62 -0
  201. package/@types/lib/util/devops.d.ts.map +1 -0
  202. package/@types/lib/util/file.d.ts +20 -0
  203. package/@types/lib/util/file.d.ts.map +1 -0
  204. package/@types/lib/util/init.config.d.ts +66 -0
  205. package/@types/lib/util/init.config.d.ts.map +1 -0
  206. package/@types/lib/util/init.d.ts +72 -0
  207. package/@types/lib/util/init.d.ts.map +1 -0
  208. package/@types/lib/util/init.git.d.ts +40 -0
  209. package/@types/lib/util/init.git.d.ts.map +1 -0
  210. package/@types/lib/util/init.npm.d.ts +24 -0
  211. package/@types/lib/util/init.npm.d.ts.map +1 -0
  212. package/@types/lib/util/replaceContentBlockReference.d.ts +105 -0
  213. package/@types/lib/util/replaceContentBlockReference.d.ts.map +1 -0
  214. package/@types/lib/util/util.d.ts +322 -0
  215. package/@types/lib/util/util.d.ts.map +1 -0
  216. package/@types/types/mcdev.d.d.ts +1282 -0
  217. package/@types/types/mcdev.d.d.ts.map +1 -0
  218. package/LICENSE +1 -1
  219. package/README.md +7 -3
  220. package/boilerplate/files/.beautyamp.json +13 -0
  221. package/boilerplate/files/.prettierrc +3 -0
  222. package/boilerplate/files/.vscode/extensions.json +6 -1
  223. package/boilerplate/files/.vscode/settings.json +16 -4
  224. package/boilerplate/forcedUpdates.json +9 -0
  225. package/jsconfig.json +7 -2
  226. package/lib/Builder.js +49 -45
  227. package/lib/Deployer.js +100 -45
  228. package/lib/MetadataTypeDefinitions.js +6 -0
  229. package/lib/MetadataTypeInfo.js +4 -0
  230. package/lib/Retriever.js +33 -27
  231. package/lib/cli.js +363 -28
  232. package/lib/index.js +615 -55
  233. package/lib/metadataTypes/Asset.js +811 -159
  234. package/lib/metadataTypes/AttributeGroup.js +17 -12
  235. package/lib/metadataTypes/AttributeSet.js +20 -15
  236. package/lib/metadataTypes/Automation.js +125 -93
  237. package/lib/metadataTypes/Campaign.js +18 -6
  238. package/lib/metadataTypes/ContentArea.js +21 -18
  239. package/lib/metadataTypes/DataExtension.js +229 -113
  240. package/lib/metadataTypes/DataExtensionField.js +52 -53
  241. package/lib/metadataTypes/DataExtensionTemplate.js +17 -5
  242. package/lib/metadataTypes/DataExtract.js +62 -27
  243. package/lib/metadataTypes/DataExtractType.js +17 -5
  244. package/lib/metadataTypes/DeliveryProfile.js +47 -0
  245. package/lib/metadataTypes/Discovery.js +15 -4
  246. package/lib/metadataTypes/Email.js +22 -19
  247. package/lib/metadataTypes/EmailSend.js +135 -35
  248. package/lib/metadataTypes/Event.js +95 -60
  249. package/lib/metadataTypes/FileLocation.js +17 -5
  250. package/lib/metadataTypes/FileTransfer.js +62 -26
  251. package/lib/metadataTypes/Filter.js +16 -4
  252. package/lib/metadataTypes/Folder.js +67 -39
  253. package/lib/metadataTypes/ImportFile.js +341 -91
  254. package/lib/metadataTypes/Journey.js +681 -324
  255. package/lib/metadataTypes/List.js +26 -14
  256. package/lib/metadataTypes/MetadataType.js +501 -265
  257. package/lib/metadataTypes/MobileCode.js +17 -5
  258. package/lib/metadataTypes/MobileKeyword.js +59 -43
  259. package/lib/metadataTypes/MobileMessage.js +67 -40
  260. package/lib/metadataTypes/Query.js +46 -38
  261. package/lib/metadataTypes/Role.js +34 -23
  262. package/lib/metadataTypes/Script.js +127 -39
  263. package/lib/metadataTypes/SendClassification.js +120 -5
  264. package/lib/metadataTypes/SenderProfile.js +179 -0
  265. package/lib/metadataTypes/TransactionalEmail.js +30 -17
  266. package/lib/metadataTypes/TransactionalMessage.js +25 -11
  267. package/lib/metadataTypes/TransactionalPush.js +24 -9
  268. package/lib/metadataTypes/TransactionalSMS.js +78 -46
  269. package/lib/metadataTypes/TriggeredSend.js +191 -43
  270. package/lib/metadataTypes/User.js +90 -62
  271. package/lib/metadataTypes/Verification.js +39 -21
  272. package/lib/metadataTypes/definitions/Asset.definition.js +3 -3
  273. package/lib/metadataTypes/definitions/AttributeGroup.definition.js +7 -1
  274. package/lib/metadataTypes/definitions/AttributeSet.definition.js +2 -2
  275. package/lib/metadataTypes/definitions/Automation.definition.js +4 -1
  276. package/lib/metadataTypes/definitions/Campaign.definition.js +1 -1
  277. package/lib/metadataTypes/definitions/ContentArea.definition.js +1 -1
  278. package/lib/metadataTypes/definitions/DataExtension.definition.js +17 -1
  279. package/lib/metadataTypes/definitions/DataExtensionTemplate.definition.js +1 -1
  280. package/lib/metadataTypes/definitions/DataExtractType.definition.js +2 -2
  281. package/lib/metadataTypes/definitions/DeliveryProfile.definition.js +59 -0
  282. package/lib/metadataTypes/definitions/Discovery.definition.js +1 -1
  283. package/lib/metadataTypes/definitions/Email.definition.js +1 -1
  284. package/lib/metadataTypes/definitions/EmailSend.definition.js +19 -4
  285. package/lib/metadataTypes/definitions/Event.definition.js +140 -128
  286. package/lib/metadataTypes/definitions/FileLocation.definition.js +1 -1
  287. package/lib/metadataTypes/definitions/Filter.definition.js +1 -1
  288. package/lib/metadataTypes/definitions/Folder.definition.js +25 -2
  289. package/lib/metadataTypes/definitions/ImportFile.definition.js +52 -7
  290. package/lib/metadataTypes/definitions/Journey.definition.js +12 -0
  291. package/lib/metadataTypes/definitions/List.definition.js +1 -1
  292. package/lib/metadataTypes/definitions/MobileCode.definition.js +1 -1
  293. package/lib/metadataTypes/definitions/MobileMessage.definition.js +11 -5
  294. package/lib/metadataTypes/definitions/Query.definition.js +6 -0
  295. package/lib/metadataTypes/definitions/Script.definition.js +14 -14
  296. package/lib/metadataTypes/definitions/SendClassification.definition.js +60 -20
  297. package/lib/metadataTypes/definitions/SenderProfile.definition.js +185 -0
  298. package/lib/metadataTypes/definitions/TransactionalEmail.definition.js +2 -2
  299. package/lib/metadataTypes/definitions/TransactionalMessage.definition.js +69 -0
  300. package/lib/metadataTypes/definitions/TransactionalPush.definition.js +6 -0
  301. package/lib/metadataTypes/definitions/TransactionalSMS.definition.js +6 -0
  302. package/lib/metadataTypes/definitions/TriggeredSend.definition.js +15 -4
  303. package/lib/metadataTypes/definitions/Verification.definition.js +1 -1
  304. package/lib/retrieveChangelog.js +7 -2
  305. package/lib/util/auth.js +56 -21
  306. package/lib/util/businessUnit.js +20 -2
  307. package/lib/util/cache.js +37 -18
  308. package/lib/util/cli.js +72 -29
  309. package/lib/util/config.js +27 -9
  310. package/lib/util/devops.js +45 -24
  311. package/lib/util/file.js +58 -33
  312. package/lib/util/init.config.js +55 -24
  313. package/lib/util/init.git.js +6 -6
  314. package/lib/util/init.js +36 -14
  315. package/lib/util/init.npm.js +2 -2
  316. package/lib/util/replaceContentBlockReference.js +278 -0
  317. package/lib/util/util.js +152 -54
  318. package/package.json +33 -30
  319. package/test/general.test.js +1327 -4
  320. package/test/mockRoot/.mcdevrc.json +26 -4
  321. package/test/mockRoot/deploy/testInstance/_ParentBU_/dataExtension/testExisting_dataExtensionShared.dataExtension-meta.json +3 -4
  322. package/test/mockRoot/deploy/testInstance/_ParentBU_/dataExtension/testNew_dataExtensionShared.dataExtension-meta.json +1 -4
  323. package/test/mockRoot/deploy/testInstance/_ParentBU_/query/testNew_query.query-meta.json +11 -0
  324. package/test/mockRoot/deploy/testInstance/_ParentBU_/query/testNew_query.query-meta.sql +4 -0
  325. package/test/mockRoot/deploy/testInstance/testBU/asset/block/testNew_asset.asset-block-meta.html +12 -0
  326. package/test/mockRoot/deploy/testInstance/testBU/asset/block/testNew_asset.asset-block-meta.json +39 -0
  327. package/test/mockRoot/deploy/testInstance/testBU/automation/testExisting_automation.automation-meta.json +6 -6
  328. package/test/mockRoot/deploy/testInstance/testBU/automation/testNew_automation.automation-meta.json +7 -7
  329. package/test/mockRoot/deploy/testInstance/testBU/dataExtension/testExisting_dataExtension.dataExtension-meta.json +3 -4
  330. package/test/mockRoot/deploy/testInstance/testBU/dataExtension/testNew_dataExtension.dataExtension-meta.json +1 -4
  331. package/test/mockRoot/deploy/testInstance/testBU/emailSend/testExisting_emailSend.emailSend-meta.json +36 -0
  332. package/test/mockRoot/deploy/testInstance/testBU/emailSend/testNew_emailSend.emailSend-meta.json +36 -0
  333. package/test/mockRoot/deploy/testInstance/testBU/importFile/testExisting_importFile.importFile-meta.json +10 -4
  334. package/test/mockRoot/deploy/testInstance/testBU/importFile/testNew_importFile.importFile-meta.json +8 -4
  335. package/test/mockRoot/deploy/testInstance/testBU/journey/testExisting_journey_Quicksend.journey-meta.json +232 -0
  336. package/test/mockRoot/deploy/testInstance/testBU/mobileMessage/NTIzOjc4OjA.mobileMessage-meta.json +2 -4
  337. package/test/mockRoot/deploy/testInstance/testBU/mobileMessage/new.mobileMessage-meta.json +2 -4
  338. package/test/mockRoot/deploy/testInstance/testBU/query/testExisting_query.query-meta.json +1 -1
  339. package/test/mockRoot/deploy/testInstance/testBU/query/testExisting_query_fixKeys.query-meta.json +1 -1
  340. package/test/mockRoot/deploy/testInstance/testBU/query/testNew_query.query-meta.json +1 -1
  341. package/test/mockRoot/deploy/testInstance/testBU/sendClassification/testExisting_sendClassification.sendClassification-meta.json +8 -0
  342. package/test/mockRoot/deploy/testInstance/testBU/sendClassification/testNew_sendClassification.sendClassification-meta.json +8 -0
  343. package/test/mockRoot/deploy/testInstance/testBU/senderProfile/testExisting_senderProfile.senderProfile-meta.json +14 -0
  344. package/test/mockRoot/deploy/testInstance/testBU/senderProfile/testNew_senderProfile.senderProfile-meta.json +14 -0
  345. package/test/mockRoot/deploy/testInstance/testBU/transactionalEmail/testExisting_temail.transactionalEmail-meta.json +1 -1
  346. package/test/mockRoot/deploy/testInstance/testBU/transactionalEmail/testNew_temail.transactionalEmail-meta.json +1 -1
  347. package/test/mockRoot/deploy/testInstance/testBU/transactionalPush/testExisting_tpush.transactionalPush-meta.json +1 -3
  348. package/test/mockRoot/deploy/testInstance/testBU/transactionalPush/testNew_tpush.transactionalPush-meta.json +1 -3
  349. package/test/mockRoot/deploy/testInstance/testBU/transactionalSMS/testExisting_tsms.transactionalSMS-meta.json +1 -2
  350. package/test/mockRoot/deploy/testInstance/testBU/transactionalSMS/testNew_tsms.transactionalSMS-meta.json +1 -2
  351. package/test/mockRoot/deploy/testInstance/testBU/triggeredSend/testExisting_triggeredSend.triggeredSend-meta.json +4 -5
  352. package/test/mockRoot/deploy/testInstance/testBU/triggeredSend/testNew_triggeredSend.triggeredSend-meta.json +4 -5
  353. package/test/mockRoot/deploy/testInstance/testBU/verification/testExisting_39f6a488-20eb-4ba0-b0b9.verification-meta.json +1 -1
  354. package/test/mockRoot/deploy/testInstance/testBU/verification/testNew_39f6a488-20eb-4ba0-b0b9.verification-meta.json +1 -1
  355. package/test/resourceFactory.js +118 -7
  356. package/test/resources/1111111/automation/v1/queries/get-response.json +6 -0
  357. package/test/resources/1111111/automation/v1/queries/post-response.json +18 -0
  358. package/test/resources/1111111/dataExtension/create-expected.json +4 -7
  359. package/test/resources/1111111/dataExtension/retrieve-expected.json +2 -4
  360. package/test/resources/1111111/dataExtension/update-expected.json +7 -7
  361. package/test/resources/1111111/dataExtension/update-response.xml +3 -1
  362. package/test/resources/1111111/dataFolder/retrieve-ContentType=queryactivity-response.xml +48 -0
  363. package/test/resources/1111111/query/patch_keySuffix-expected.json +11 -0
  364. package/test/resources/1111111/query/patch_keySuffix-expected.sql +4 -0
  365. package/test/resources/9999999/asset/block-1157-retrieve-expected.html +4 -3
  366. package/test/resources/9999999/asset/build-templatebasedemail-expected.json +81 -0
  367. package/test/resources/9999999/asset/build-templatebasedemail-html-expected.html +20 -0
  368. package/test/resources/9999999/asset/build-templatebasedemail-preheader-expected.amp +1 -0
  369. package/test/resources/9999999/asset/create-expected.json +18 -0
  370. package/test/resources/9999999/asset/resolveId-1234-notFound-expected.json +1 -0
  371. package/test/resources/9999999/asset/resolveId-1295064-noPath-expected.json +8 -0
  372. package/test/resources/9999999/asset/resolveId-1295064-withPath-expected.json +8 -0
  373. package/test/resources/9999999/asset/retrieve-templatebasedemail-expected.json +84 -0
  374. package/test/resources/9999999/asset/retrieve-templatebasedemail-html-expected.html +20 -0
  375. package/test/resources/9999999/asset/retrieve-templatebasedemail-preheader-expected.amp +1 -0
  376. package/test/resources/9999999/asset/template-templatebasedemail-expected.json +81 -0
  377. package/test/resources/9999999/asset/template-templatebasedemail-html-expected.html +20 -0
  378. package/test/resources/9999999/asset/template-templatebasedemail-preheader-expected.amp +1 -0
  379. package/test/resources/9999999/asset/testExisting_asset_message-html-rcb-id-expected.html +33 -0
  380. package/test/resources/9999999/asset/testExisting_asset_message-html-rcb-key-expected.html +33 -0
  381. package/test/resources/9999999/asset/testExisting_asset_message-html-rcb-name-expected.html +35 -0
  382. package/test/resources/9999999/asset/testExisting_asset_message-preheader-rcb-id-expected.amp +4 -0
  383. package/test/resources/9999999/asset/testExisting_asset_message-preheader-rcb-key-expected.amp +4 -0
  384. package/test/resources/9999999/asset/testExisting_asset_message-preheader-rcb-name-expected.amp +4 -0
  385. package/test/resources/9999999/asset/testExisting_asset_message-text-rcb-id-expected.amp +4 -0
  386. package/test/resources/9999999/asset/testExisting_asset_message-text-rcb-key-expected.amp +4 -0
  387. package/test/resources/9999999/asset/testExisting_asset_message-text-rcb-name-expected.amp +4 -0
  388. package/test/resources/9999999/asset/v1/content/assets/1295064/get-response.json +1 -1
  389. package/test/resources/9999999/asset/v1/content/assets/5286/get-response.json +48 -0
  390. package/test/resources/9999999/asset/v1/content/assets/5289/get-response.json +198 -0
  391. package/test/resources/9999999/asset/v1/content/assets/808714/get-response.json +4 -3
  392. package/test/resources/9999999/asset/v1/content/assets/950143/delete-response.txt +1 -0
  393. package/test/resources/9999999/asset/v1/content/assets/get-response-customerKey=testExisting_asset.json +105 -0
  394. package/test/resources/9999999/asset/v1/content/assets/post-response.json +59 -0
  395. package/test/resources/9999999/asset/v1/content/assets/query/post-response-assetType.idIN174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,14.json +7 -0
  396. package/test/resources/9999999/asset/v1/content/assets/query/post-response-assetType.idIN193,194,15.json +7 -0
  397. package/test/resources/9999999/asset/v1/content/assets/query/post-response-assetType.idIN195,196,197,198,199,200,201,202,203,210,211,212,213,3.json +46 -0
  398. package/test/resources/9999999/asset/v1/content/assets/query/post-response-assetType.idIN205,206,230,232,1.json +32 -0
  399. package/test/resources/9999999/asset/v1/content/assets/query/{post-response.json → post-response-assetType.idIN207,208,209,5.json} +45 -47
  400. package/test/resources/9999999/asset/v1/content/assets/query/post-response-assetType.idIN214,4.json +35 -0
  401. package/test/resources/9999999/asset/v1/content/assets/query/post-response-assetType.idIN215,216,217,218,219,220,221,222,223,224,225,226,227,228.json +7 -0
  402. package/test/resources/9999999/asset/v1/content/assets/query/post-response-customerKey=mcdev-issue-1157.json +46 -0
  403. package/test/resources/9999999/attributeGroup/retrieve-expected.json +1 -1
  404. package/test/resources/9999999/attributeSet/retrieve-expected.json +3 -3
  405. package/test/resources/9999999/automation/build-expected.json +7 -7
  406. package/test/resources/9999999/automation/create-expected.json +7 -7
  407. package/test/resources/9999999/automation/patch_fixKeys-pause-expected.json +6 -6
  408. package/test/resources/9999999/automation/patch_fixKeys-schedule-expected.json +6 -6
  409. package/test/resources/9999999/automation/retrieve-expected.json +7 -7
  410. package/test/resources/9999999/automation/template-expected.json +7 -7
  411. package/test/resources/9999999/automation/update-expected.json +6 -6
  412. package/test/resources/9999999/automation/v1/dataextracts/56c5370a-f988-4f36-b0ee-0f876573f6d7/delete-response.txt +1 -0
  413. package/test/resources/9999999/automation/v1/filetransfers/72c328ac-f5b0-4e37-91d3-a775666f15a6/delete-response.json +1 -0
  414. package/test/resources/9999999/automation/v1/imports/1ebf557b-372e-eb11-b81b-48df37d1dbd7/get-response.json +78 -0
  415. package/test/resources/9999999/automation/v1/imports/9d16f42c-2260-ed11-b849-48df37d1de8b/delete-response.txt +0 -0
  416. package/test/resources/9999999/automation/v1/imports/9d16f42c-2260-ed11-b849-48df37d1de8b/get-response.json +35 -0
  417. package/test/resources/9999999/automation/v1/imports/9d16f42c-2260-ed11-b849-48df37d1de8b/patch-response.json +14 -10
  418. package/test/resources/9999999/automation/v1/imports/get-response.json +78 -1
  419. package/test/resources/9999999/automation/v1/queries/549f0568-607c-4940-afef-437965094dat/get-response.json +1 -1
  420. package/test/resources/9999999/automation/v1/queries/549f0568-607c-4940-afef-437965094dat_fixKeysSuffix/get-response.json +17 -0
  421. package/test/resources/9999999/automation/v1/queries/549f0568-607c-4940-afef-437965094dat_fixKeysSuffix/patch-response.json +18 -0
  422. package/test/resources/9999999/automation/v1/queries/abcde-607c-4940-afef-437965094dat/get-response.json +17 -0
  423. package/test/resources/9999999/automation/v1/queries/get-response.json +20 -3
  424. package/test/resources/9999999/automation/v1/scripts/39f6a488-20eb-4ba0-b0b9-023725b574e4/delete-response.txt +1 -0
  425. package/test/resources/9999999/automation/v1/scripts/get-response.json +3 -3
  426. package/test/resources/9999999/dataExtension/build-expected.json +3 -4
  427. package/test/resources/9999999/dataExtension/create-expected.json +1 -4
  428. package/test/resources/9999999/dataExtension/retrieve-Name=testExisting_dataExtension-response.xml +4 -4
  429. package/test/resources/9999999/dataExtension/retrieve-expected.json +3 -4
  430. package/test/resources/9999999/dataExtension/retrieve-response.xml +96 -1
  431. package/test/resources/9999999/dataExtension/template-expected.json +3 -4
  432. package/test/resources/9999999/dataExtension/update-expected.json +4 -3
  433. package/test/resources/9999999/dataExtension/update-response.xml +5 -3
  434. package/test/resources/9999999/dataExtensionField/retrieve-response.xml +72 -0
  435. package/test/resources/9999999/dataFolder/retrieve-ContentType=userinitiatedsends-response.xml +48 -0
  436. package/test/resources/9999999/deliveryProfile/get-expected.json +7 -0
  437. package/test/resources/9999999/emailSend/build-expected.json +43 -0
  438. package/test/resources/9999999/emailSend/get-expected.json +43 -0
  439. package/test/resources/9999999/emailSend/patch-expected.json +41 -0
  440. package/test/resources/9999999/emailSend/post-expected.json +41 -0
  441. package/test/resources/9999999/emailSend/template-expected.json +43 -0
  442. package/test/resources/9999999/emailSendDefinition/create-response.xml +98 -0
  443. package/test/resources/9999999/emailSendDefinition/delete-response.xml +36 -0
  444. package/test/resources/9999999/emailSendDefinition/retrieve-IsPlatformObject=falseANDDescriptionnotEqualsSFSendDefinition-response.xml +18 -8
  445. package/test/resources/9999999/emailSendDefinition/update-response.xml +97 -0
  446. package/test/resources/9999999/importDefinition/retrieve-CustomerKey=testExisting_importFile-response.xml +30 -0
  447. package/test/resources/9999999/importDefinition/retrieve-Name=testExisting_importFile-response.xml +30 -0
  448. package/test/resources/9999999/importFile/build-expected.json +11 -6
  449. package/test/resources/9999999/importFile/get-expected.json +13 -7
  450. package/test/resources/9999999/importFile/get-sms-expected.json +79 -0
  451. package/test/resources/9999999/importFile/patch-expected.json +12 -7
  452. package/test/resources/9999999/importFile/post-expected.json +8 -5
  453. package/test/resources/9999999/importFile/template-expected.json +10 -5
  454. package/test/resources/9999999/interaction/v1/eventDefinitions/get-response.json +124 -0
  455. package/test/resources/9999999/interaction/v1/interactions/3c3f4112-9b43-43ca-8a89-aa0375b2c1a2/delete-response.txt +1 -0
  456. package/test/resources/9999999/interaction/v1/interactions/3c3f4112-9b43-43ca-8a89-aa0375b2c1a2/get-response.json +253 -0
  457. package/test/resources/9999999/interaction/v1/interactions/get-response.json +83 -779
  458. package/test/resources/9999999/interaction/v1/interactions/key_testExisting_journey_Multistep/get-response.json +457 -0
  459. package/test/resources/9999999/interaction/v1/interactions/key_testExisting_journey_Quicksend/get-response.json +253 -0
  460. package/test/resources/9999999/interaction/v1/interactions/{key_0b76dccf-594c-b6dc-1acf-10c4493dcb84 → key_testExisting_temail}/get-response.json +5 -5
  461. package/test/resources/9999999/journey/build-expected.json +105 -449
  462. package/test/resources/9999999/journey/get-multistep-expected.json +413 -0
  463. package/test/resources/9999999/journey/get-quicksend-expected.json +232 -0
  464. package/test/resources/9999999/journey/get-quicksend-rcb-id-expected.json +232 -0
  465. package/test/resources/9999999/journey/get-quicksend-rcb-key-expected.json +232 -0
  466. package/test/resources/9999999/journey/get-quicksend-rcb-name-expected.json +232 -0
  467. package/test/resources/9999999/journey/get-transactionalEmail-expected.json +211 -0
  468. package/test/resources/9999999/journey/template-expected.json +105 -449
  469. package/test/resources/9999999/legacy/v1/beta/messaging/deliverypolicy/get-response.json +15 -0
  470. package/test/resources/9999999/legacy/v1/beta/mobile/imports/get-response.json +112 -0
  471. package/test/resources/9999999/legacy/v1/beta/mobile/message/NTQ3Ojc4OjA/get-response.json +1 -1
  472. package/test/resources/9999999/legacy/v1/beta/object/NWQwdnhEU3dFZWVBekJRQzdISWl0QTo0NTow/get-response.json +12 -0
  473. package/test/resources/9999999/list/retrieve-response.xml +13 -0
  474. package/test/resources/9999999/messaging/v1/email/definitions/testExisting_temail/get-response.json +1 -1
  475. package/test/resources/9999999/messaging/v1/email/definitions/testExisting_temail/patch-response.json +1 -1
  476. package/test/resources/9999999/mobileMessage/build-expected.json +2 -5
  477. package/test/resources/9999999/mobileMessage/get-expected.json +2 -5
  478. package/test/resources/9999999/mobileMessage/post-create-expected.json +2 -4
  479. package/test/resources/9999999/mobileMessage/post-update-expected.json +2 -5
  480. package/test/resources/9999999/mobileMessage/template-expected.json +2 -5
  481. package/test/resources/9999999/query/build-expected.json +1 -1
  482. package/test/resources/9999999/query/build-expected.sql +2 -1
  483. package/test/resources/9999999/query/get-expected.json +1 -1
  484. package/test/resources/9999999/query/get-expected.sql +2 -1
  485. package/test/resources/9999999/query/get2-expected.json +1 -1
  486. package/test/resources/9999999/query/patch-expected.json +1 -1
  487. package/test/resources/9999999/query/patch_fixKeys-expected.json +1 -1
  488. package/test/resources/9999999/query/patch_fixKeysSuffix-expected.json +11 -0
  489. package/test/resources/9999999/query/patch_fixKeysSuffix-expected.sql +6 -0
  490. package/test/resources/9999999/query/post-expected.json +1 -1
  491. package/test/resources/9999999/query/template-expected.json +1 -1
  492. package/test/resources/9999999/query/template-expected.sql +2 -1
  493. package/test/resources/9999999/queryDefinition/retrieve-CustomerKey=testExisting_query2ANDStatus=Active-response.xml +30 -0
  494. package/test/resources/9999999/queryDefinition/retrieve-CustomerKey=testExisting_query_fixKeysSuffixANDStatus=Active-response.xml +30 -0
  495. package/test/resources/9999999/script/get_ampincluded-expected.html +5 -0
  496. package/test/resources/9999999/script/get_ampincluded-rcb-id-expected.html +5 -0
  497. package/test/resources/9999999/script/get_ampincluded-rcb-key-expected.html +5 -0
  498. package/test/resources/9999999/script/get_ampincluded-rcb-name-expected.html +5 -0
  499. package/test/resources/9999999/script/get_ampscript-expected.html +6 -1
  500. package/test/resources/9999999/script/get_ampscript-rcb-id-expected.html +8 -0
  501. package/test/resources/9999999/script/get_ampscript-rcb-key-expected.html +8 -0
  502. package/test/resources/9999999/script/get_ampscript-rcb-name-expected.html +10 -0
  503. package/test/resources/9999999/script/get_mixed-expected.html +5 -2
  504. package/test/resources/9999999/script/get_mixed-rcb-id-expected.html +12 -0
  505. package/test/resources/9999999/script/get_mixed-rcb-key-expected.html +12 -0
  506. package/test/resources/9999999/script/get_mixed-rcb-name-expected.html +14 -0
  507. package/test/resources/9999999/sendClassification/build-expected.json +8 -0
  508. package/test/resources/9999999/sendClassification/create-response.xml +51 -0
  509. package/test/resources/9999999/sendClassification/delete-response.xml +36 -0
  510. package/test/resources/9999999/sendClassification/get-expected.json +10 -0
  511. package/test/resources/9999999/sendClassification/patch-expected.json +8 -0
  512. package/test/resources/9999999/sendClassification/post-expected.json +8 -0
  513. package/test/resources/9999999/sendClassification/retrieve-response.xml +86 -0
  514. package/test/resources/9999999/sendClassification/template-expected.json +8 -0
  515. package/test/resources/9999999/sendClassification/update-response.xml +49 -0
  516. package/test/resources/9999999/senderProfile/build-expected.json +14 -0
  517. package/test/resources/9999999/senderProfile/create-response.xml +49 -0
  518. package/test/resources/9999999/senderProfile/delete-response.xml +36 -0
  519. package/test/resources/9999999/senderProfile/get-expected.json +16 -0
  520. package/test/resources/9999999/senderProfile/get-rcb-id-expected.json +16 -0
  521. package/test/resources/9999999/senderProfile/get-rcb-key-expected.json +16 -0
  522. package/test/resources/9999999/senderProfile/get-rcb-name-expected.json +16 -0
  523. package/test/resources/9999999/senderProfile/patch-expected.json +14 -0
  524. package/test/resources/9999999/senderProfile/post-expected.json +14 -0
  525. package/test/resources/9999999/senderProfile/retrieve-CustomerKey=Default-response.xml +44 -0
  526. package/test/resources/9999999/senderProfile/retrieve-CustomerKey=wrong-key-response.xml +26 -0
  527. package/test/resources/9999999/senderProfile/retrieve-response.xml +80 -0
  528. package/test/resources/9999999/senderProfile/template-expected.json +14 -0
  529. package/test/resources/9999999/senderProfile/update-response.xml +47 -0
  530. package/test/resources/9999999/transactionalEmail/build-expected.json +3 -3
  531. package/test/resources/9999999/transactionalEmail/get-expected.json +3 -3
  532. package/test/resources/9999999/transactionalEmail/patch-expected.json +3 -3
  533. package/test/resources/9999999/transactionalEmail/post-expected.json +2 -2
  534. package/test/resources/9999999/transactionalEmail/template-expected.json +3 -3
  535. package/test/resources/9999999/transactionalPush/build-expected.json +1 -1
  536. package/test/resources/9999999/transactionalPush/get-expected.json +1 -1
  537. package/test/resources/9999999/transactionalPush/patch-expected.json +1 -3
  538. package/test/resources/9999999/transactionalPush/post-expected.json +1 -3
  539. package/test/resources/9999999/transactionalPush/template-expected.json +1 -1
  540. package/test/resources/9999999/transactionalSMS/build-expected.amp +1 -1
  541. package/test/resources/9999999/transactionalSMS/build-expected.json +1 -2
  542. package/test/resources/9999999/transactionalSMS/get-expected.amp +1 -1
  543. package/test/resources/9999999/transactionalSMS/get-expected.json +1 -2
  544. package/test/resources/9999999/transactionalSMS/patch-expected.amp +1 -1
  545. package/test/resources/9999999/transactionalSMS/patch-expected.json +1 -2
  546. package/test/resources/9999999/transactionalSMS/post-expected.amp +1 -1
  547. package/test/resources/9999999/transactionalSMS/post-expected.json +1 -2
  548. package/test/resources/9999999/transactionalSMS/template-expected.amp +1 -1
  549. package/test/resources/9999999/transactionalSMS/template-expected.json +1 -2
  550. package/test/resources/9999999/triggeredSend/build-expected.json +5 -6
  551. package/test/resources/9999999/triggeredSend/get-expected.json +5 -6
  552. package/test/resources/9999999/triggeredSend/get-rcb-id-expected.json +29 -0
  553. package/test/resources/9999999/triggeredSend/get-rcb-key-expected.json +29 -0
  554. package/test/resources/9999999/triggeredSend/get-rcb-name-expected.json +29 -0
  555. package/test/resources/9999999/triggeredSend/patch-expected.json +5 -6
  556. package/test/resources/9999999/triggeredSend/post-expected.json +5 -6
  557. package/test/resources/9999999/triggeredSend/template-expected.json +5 -6
  558. package/test/resources/9999999/triggeredSendDefinition/create-response.xml +6 -1
  559. package/test/resources/9999999/triggeredSendDefinition/retrieve-TriggeredSendStatusINNew,Active,Inactive,Moved,Canceled-response.xml +53 -1
  560. package/test/resources/9999999/triggeredSendDefinition/update-response.xml +6 -1
  561. package/test/resources/9999999/verification/build-expected.json +1 -1
  562. package/test/resources/9999999/verification/get-expected.json +1 -1
  563. package/test/resources/9999999/verification/patch-expected.json +1 -1
  564. package/test/resources/9999999/verification/post-expected.json +1 -1
  565. package/test/resources/9999999/verification/template-expected.json +1 -1
  566. package/test/type.asset.test.js +733 -17
  567. package/test/type.attributeGroup.test.js +6 -2
  568. package/test/type.attributeSet.test.js +6 -2
  569. package/test/type.automation.test.js +174 -162
  570. package/test/type.dataExtension.test.js +41 -45
  571. package/test/type.dataExtract.test.js +22 -29
  572. package/test/type.deliveryProfile.test.js +45 -0
  573. package/test/type.emailSend.test.js +144 -0
  574. package/test/type.event.test.js +62 -0
  575. package/test/type.fileTransfer.test.js +21 -29
  576. package/test/type.importFile.test.js +61 -35
  577. package/test/type.journey.test.js +251 -45
  578. package/test/type.mobileKeyword.test.js +46 -54
  579. package/test/type.mobileMessage.test.js +28 -27
  580. package/test/type.query.test.js +303 -124
  581. package/test/type.script.test.js +288 -69
  582. package/test/type.sendClassification.test.js +156 -0
  583. package/test/type.senderProfile.test.js +254 -0
  584. package/test/type.transactionalEmail.test.js +15 -11
  585. package/test/type.transactionalPush.test.js +15 -11
  586. package/test/type.transactionalSMS.test.js +30 -23
  587. package/test/type.triggeredSend.test.js +130 -17
  588. package/test/type.user.test.js +22 -14
  589. package/test/type.verification.test.js +13 -10
  590. package/test/utils.js +76 -21
  591. package/tsconfig.json +21 -0
  592. package/types/mcdev.d.js +190 -66
  593. package/docs/dist/documentation.md +0 -8878
  594. package/test/mockRoot/deploy/testInstance/testBU/journey/testExisting_interaction.interaction-meta.json +0 -576
  595. package/test/mockRoot/deploy/testInstance/testBU/journey/testNew_interaction.interaction-meta.json +0 -266
  596. package/test/resources/9999999/interaction/v1/EventDefinitions/get-response.json +0 -43
  597. package/test/resources/9999999/interaction/v1/interactions/233d4413-922c-4568-85a5-e5cc77efc3be/delete-response.json +0 -1
  598. package/test/resources/9999999/interaction/v1/interactions/key_testExisting_interaction/get-response.json +0 -592
  599. package/test/resources/9999999/interaction/v1/interactions/key_testExisting_interaction/put-response.json +0 -592
  600. package/test/resources/9999999/interaction/v1/interactions/post-response.json +0 -280
  601. package/test/resources/9999999/journey/get-expected.json +0 -576
  602. package/test/resources/9999999/script/get_ampincluded-expected.ssjs +0 -5
@@ -1,24 +1,28 @@
1
- import chai, { assert, expect } from 'chai';
1
+ import * as chai from 'chai';
2
+ const assert = chai.assert;
3
+ const expect = chai.expect;
4
+
2
5
  import chaiFiles from 'chai-files';
3
6
  import cache from '../lib/util/cache.js';
4
7
  import * as testUtils from './utils.js';
5
8
  import handler from '../lib/index.js';
6
9
  chai.use(chaiFiles);
7
- const file = chaiFiles.file;
8
10
 
9
11
  describe('type: automation', () => {
10
12
  beforeEach(() => {
11
13
  testUtils.mockSetup();
12
14
  });
15
+
13
16
  afterEach(() => {
14
17
  testUtils.mockReset();
15
18
  });
19
+
16
20
  describe('Retrieve ================', () => {
17
21
  it('Should retrieve a automation', async () => {
18
22
  // WHEN
19
23
  await handler.retrieve('testInstance/testBU', ['automation']);
20
24
  // THEN
21
- assert.equal(process.exitCode, false, 'retrieve should not have thrown an error');
25
+ assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error');
22
26
  // get results from cache
23
27
  const result = cache.getCache();
24
28
  assert.equal(
@@ -33,28 +37,28 @@ describe('type: automation', () => {
33
37
  'returned metadata was not equal expected'
34
38
  );
35
39
  // check if MD file was created and equals expectations
36
- expect(file(testUtils.getActualDoc('testExisting_automation', 'automation'))).to.equal(
37
- file(
38
- testUtils.getExpectedFile(
39
- '9999999',
40
- 'automation',
41
- 'retrieve-testExisting_automation',
42
- 'md'
43
- )
40
+ expect(await testUtils.getActualDoc('testExisting_automation', 'automation')).to.equal(
41
+ await testUtils.getExpectedFile(
42
+ '9999999',
43
+ 'automation',
44
+ 'retrieve-testExisting_automation',
45
+ 'md'
44
46
  )
45
47
  );
46
48
  assert.equal(
47
49
  testUtils.getAPIHistoryLength(),
48
- 18,
50
+ 22,
49
51
  'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
50
52
  );
51
53
  return;
52
54
  });
53
55
  });
56
+
54
57
  describe('Deploy ================', () => {
55
58
  beforeEach(() => {
56
59
  testUtils.mockSetup(true);
57
60
  });
61
+
58
62
  it('Should create & update a automation', async () => {
59
63
  // WHEN
60
64
  const deployResult = await handler.deploy(
@@ -63,7 +67,7 @@ describe('type: automation', () => {
63
67
  ['testExisting_automation', 'testNew_automation', 'testNew_39f6a488-20eb-4ba0-b0b9']
64
68
  );
65
69
  // THEN
66
- assert.equal(process.exitCode, false, 'deploy should not have thrown an error');
70
+ assert.equal(process.exitCode, 0, 'deploy should not have thrown an error');
67
71
 
68
72
  // check how many items were deployed
69
73
  assert.equal(
@@ -94,36 +98,33 @@ describe('type: automation', () => {
94
98
  'returned metadata was not equal expected for update'
95
99
  );
96
100
  // check if MD file was created and equals expectations
97
- expect(file(testUtils.getActualDoc('testExisting_automation', 'automation'))).to.equal(
98
- file(
99
- testUtils.getExpectedFile(
100
- '9999999',
101
- 'automation',
102
- 'update-testExisting_automation',
103
- 'md'
104
- )
101
+ expect(await testUtils.getActualDoc('testExisting_automation', 'automation')).to.equal(
102
+ await testUtils.getExpectedFile(
103
+ '9999999',
104
+ 'automation',
105
+ 'update-testExisting_automation',
106
+ 'md'
105
107
  )
106
108
  );
107
109
 
108
110
  // check if MD file was created and equals expectations
109
- expect(file(testUtils.getActualDoc('testNew_automation', 'automation'))).to.equal(
110
- file(
111
- testUtils.getExpectedFile(
112
- '9999999',
113
- 'automation',
114
- 'create-testNew_automation',
115
- 'md'
116
- )
111
+ expect(await testUtils.getActualDoc('testNew_automation', 'automation')).to.equal(
112
+ await testUtils.getExpectedFile(
113
+ '9999999',
114
+ 'automation',
115
+ 'create-testNew_automation',
116
+ 'md'
117
117
  )
118
118
  );
119
119
 
120
120
  assert.equal(
121
121
  testUtils.getAPIHistoryLength(),
122
- 25,
122
+ 29,
123
123
  'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
124
124
  );
125
125
  return;
126
126
  });
127
+
127
128
  it('Should update & schedule an automation with --schedule option', async () => {
128
129
  // WHEN
129
130
  handler.setOptions({ schedule: true });
@@ -135,7 +136,7 @@ describe('type: automation', () => {
135
136
  // THEN
136
137
  assert.equal(
137
138
  process.exitCode,
138
- false,
139
+ 0,
139
140
  'deploy with --execute should not have thrown an error'
140
141
  );
141
142
 
@@ -175,24 +176,23 @@ describe('type: automation', () => {
175
176
  'returned metadata was not equal expected for update'
176
177
  );
177
178
  // check if MD file was created and equals expectations
178
- expect(file(testUtils.getActualDoc('testExisting_automation', 'automation'))).to.equal(
179
- file(
180
- testUtils.getExpectedFile(
181
- '9999999',
182
- 'automation',
183
- 'update-testExisting_automation',
184
- 'md'
185
- )
179
+ expect(await testUtils.getActualDoc('testExisting_automation', 'automation')).to.equal(
180
+ await testUtils.getExpectedFile(
181
+ '9999999',
182
+ 'automation',
183
+ 'update-testExisting_automation',
184
+ 'md'
186
185
  )
187
186
  );
188
187
 
189
188
  assert.equal(
190
189
  testUtils.getAPIHistoryLength(),
191
- 33,
190
+ 37,
192
191
  'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
193
192
  );
194
193
  return;
195
194
  });
195
+
196
196
  it('Should update & runOnce an automation with --execute option', async () => {
197
197
  // WHEN
198
198
  handler.setOptions({ execute: true });
@@ -204,7 +204,7 @@ describe('type: automation', () => {
204
204
  // THEN
205
205
  assert.equal(
206
206
  process.exitCode,
207
- false,
207
+ 0,
208
208
  'deploy with --execute should not have thrown an error'
209
209
  );
210
210
 
@@ -243,40 +243,42 @@ describe('type: automation', () => {
243
243
  'returned metadata was not equal expected for update'
244
244
  );
245
245
  // check if MD file was created and equals expectations
246
- expect(file(testUtils.getActualDoc('testExisting_automation', 'automation'))).to.equal(
247
- file(
248
- testUtils.getExpectedFile(
249
- '9999999',
250
- 'automation',
251
- 'update-testExisting_automation',
252
- 'md'
253
- )
246
+ expect(await testUtils.getActualDoc('testExisting_automation', 'automation')).to.equal(
247
+ await testUtils.getExpectedFile(
248
+ '9999999',
249
+ 'automation',
250
+ 'update-testExisting_automation',
251
+ 'md'
254
252
  )
255
253
  );
256
254
 
257
255
  assert.equal(
258
256
  testUtils.getAPIHistoryLength(),
259
- 29,
257
+ 33,
260
258
  'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
261
259
  );
262
260
  return;
263
261
  });
264
262
  });
263
+
265
264
  describe('FixKeys ================', () => {
266
265
  beforeEach(() => {
267
266
  testUtils.mockSetup(true);
268
267
  });
268
+
269
269
  it('Should run fixKeys but not find fixable keys and hence stop', async () => {
270
270
  // WHEN
271
271
  handler.setOptions({ skipInteraction: { fixKeysReretrieve: false } });
272
- const resultFixKeys = await handler.fixKeys('testInstance/testBU', 'automation', [
273
- 'testExisting_automation',
274
- ]);
272
+ const resultFixKeys = await handler.fixKeys(
273
+ 'testInstance/testBU',
274
+ ['automation'],
275
+ ['testExisting_automation']
276
+ );
275
277
  // THEN
276
- assert.equal(process.exitCode, false, 'fixKeys should not have thrown an error');
278
+ assert.equal(process.exitCode, 0, 'fixKeys should not have thrown an error');
277
279
  // check which keys were fixed
278
280
  assert.equal(
279
- resultFixKeys['testInstance/testBU'].length,
281
+ resultFixKeys['testInstance/testBU']['automation'].length,
280
282
  0,
281
283
  'expected to find no keys to be fixed'
282
284
  );
@@ -291,30 +293,32 @@ describe('type: automation', () => {
291
293
  // check number of API calls
292
294
  assert.equal(
293
295
  testUtils.getAPIHistoryLength(),
294
- 18,
296
+ 22,
295
297
  'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
296
298
  );
297
299
  return;
298
300
  });
301
+
299
302
  it('Should fixKeys by key w/o re-retrieving, auto-schedule', async () => {
300
303
  // WHEN
301
304
  handler.setOptions({ skipInteraction: { fixKeysReretrieve: false } });
302
- const resultFixKeys = await handler.fixKeys('testInstance/testBU', 'automation', [
303
- 'testExisting_automation_fixKey_schedule',
304
- 'testExisting_automation',
305
- ]);
305
+ const resultFixKeys = await handler.fixKeys(
306
+ 'testInstance/testBU',
307
+ ['automation'],
308
+ ['testExisting_automation_fixKey_schedule', 'testExisting_automation']
309
+ );
306
310
  assert.equal(
307
- resultFixKeys['testInstance/testBU'].length,
311
+ resultFixKeys['testInstance/testBU']['automation'].length,
308
312
  1,
309
313
  'returned number of keys does not correspond to number of expected fixed keys'
310
314
  );
311
315
  assert.equal(
312
- resultFixKeys['testInstance/testBU'][0],
316
+ resultFixKeys['testInstance/testBU']['automation'][0],
313
317
  'testExisting_automation_fixedKey_scheduled',
314
318
  'returned keys do not correspond to expected fixed keys'
315
319
  );
316
320
  // THEN
317
- assert.equal(process.exitCode, false, 'fixKeys should not have thrown an error');
321
+ assert.equal(process.exitCode, 0, 'fixKeys should not have thrown an error');
318
322
  // confirm updated item
319
323
  assert.deepEqual(
320
324
  await testUtils.getActualJson(
@@ -325,40 +329,40 @@ describe('type: automation', () => {
325
329
  'returned metadata was not equal expected for update automation'
326
330
  );
327
331
  expect(
328
- file(
329
- testUtils.getActualDoc(
330
- 'testExisting_automation_fixedKey_scheduled',
331
- 'automation'
332
- )
332
+ await testUtils.getActualDoc(
333
+ 'testExisting_automation_fixedKey_scheduled',
334
+ 'automation'
333
335
  )
334
336
  ).to.exist;
335
337
  // check number of API calls
336
338
  assert.equal(
337
339
  testUtils.getAPIHistoryLength(),
338
- 40,
340
+ 48,
339
341
  'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
340
342
  );
341
343
  return;
342
344
  });
345
+
343
346
  it('Should fixKeys by key w/o re-retrieving, auto-schedule and then --execute', async () => {
344
347
  // WHEN
345
348
  handler.setOptions({ skipInteraction: { fixKeysReretrieve: false }, execute: true });
346
- const resultFixKeys = await handler.fixKeys('testInstance/testBU', 'automation', [
347
- 'testExisting_automation_fixKey_schedule',
348
- 'testExisting_automation',
349
- ]);
349
+ const resultFixKeys = await handler.fixKeys(
350
+ 'testInstance/testBU',
351
+ ['automation'],
352
+ ['testExisting_automation_fixKey_schedule', 'testExisting_automation']
353
+ );
350
354
  assert.equal(
351
- resultFixKeys['testInstance/testBU'].length,
355
+ resultFixKeys['testInstance/testBU']['automation'].length,
352
356
  1,
353
357
  'returned number of keys does not correspond to number of expected fixed keys'
354
358
  );
355
359
  assert.equal(
356
- resultFixKeys['testInstance/testBU'][0],
360
+ resultFixKeys['testInstance/testBU']['automation'][0],
357
361
  'testExisting_automation_fixedKey_scheduled',
358
362
  'returned keys do not correspond to expected fixed keys'
359
363
  );
360
364
  // THEN
361
- assert.equal(process.exitCode, false, 'fixKeys should not have thrown an error');
365
+ assert.equal(process.exitCode, 0, 'fixKeys should not have thrown an error');
362
366
  // confirm updated item
363
367
  assert.deepEqual(
364
368
  await testUtils.getActualJson(
@@ -369,40 +373,40 @@ describe('type: automation', () => {
369
373
  'returned metadata was not equal expected for update automation'
370
374
  );
371
375
  expect(
372
- file(
373
- testUtils.getActualDoc(
374
- 'testExisting_automation_fixedKey_scheduled',
375
- 'automation'
376
- )
376
+ await testUtils.getActualDoc(
377
+ 'testExisting_automation_fixedKey_scheduled',
378
+ 'automation'
377
379
  )
378
380
  ).to.exist;
379
381
  // check number of API calls
380
382
  assert.equal(
381
383
  testUtils.getAPIHistoryLength(),
382
- 42,
384
+ 50,
383
385
  'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
384
386
  );
385
387
  return;
386
388
  });
389
+
387
390
  it('Should fixKeys by key w/o re-retrieving, auto-schedule and then --schedule', async () => {
388
391
  // WHEN
389
392
  handler.setOptions({ skipInteraction: { fixKeysReretrieve: false }, schedule: true });
390
- const resultFixKeys = await handler.fixKeys('testInstance/testBU', 'automation', [
391
- 'testExisting_automation_fixKey_schedule',
392
- 'testExisting_automation',
393
- ]);
393
+ const resultFixKeys = await handler.fixKeys(
394
+ 'testInstance/testBU',
395
+ ['automation'],
396
+ ['testExisting_automation_fixKey_schedule', 'testExisting_automation']
397
+ );
394
398
  assert.equal(
395
- resultFixKeys['testInstance/testBU'].length,
399
+ resultFixKeys['testInstance/testBU']['automation'].length,
396
400
  1,
397
401
  'returned number of keys does not correspond to number of expected fixed keys'
398
402
  );
399
403
  assert.equal(
400
- resultFixKeys['testInstance/testBU'][0],
404
+ resultFixKeys['testInstance/testBU']['automation'][0],
401
405
  'testExisting_automation_fixedKey_scheduled',
402
406
  'returned keys do not correspond to expected fixed keys'
403
407
  );
404
408
  // THEN
405
- assert.equal(process.exitCode, false, 'fixKeys should not have thrown an error');
409
+ assert.equal(process.exitCode, 0, 'fixKeys should not have thrown an error');
406
410
  // confirm updated item
407
411
  assert.deepEqual(
408
412
  await testUtils.getActualJson(
@@ -413,39 +417,40 @@ describe('type: automation', () => {
413
417
  'returned metadata was not equal expected for update automation'
414
418
  );
415
419
  expect(
416
- file(
417
- testUtils.getActualDoc(
418
- 'testExisting_automation_fixedKey_scheduled',
419
- 'automation'
420
- )
420
+ await testUtils.getActualDoc(
421
+ 'testExisting_automation_fixedKey_scheduled',
422
+ 'automation'
421
423
  )
422
424
  ).to.exist;
423
425
  // check number of API calls
424
426
  assert.equal(
425
427
  testUtils.getAPIHistoryLength(),
426
- 43,
428
+ 51,
427
429
  'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
428
430
  );
429
431
  return;
430
432
  });
433
+
431
434
  it('Should fixKeys by key w/o re-retrieving, deploy paused', async () => {
432
435
  // WHEN
433
436
  handler.setOptions({ skipInteraction: { fixKeysReretrieve: false } });
434
- const resultFixKeys = await handler.fixKeys('testInstance/testBU', 'automation', [
435
- 'testExisting_automation_fixKey_pause',
436
- ]);
437
+ const resultFixKeys = await handler.fixKeys(
438
+ 'testInstance/testBU',
439
+ ['automation'],
440
+ ['testExisting_automation_fixKey_pause']
441
+ );
437
442
  assert.equal(
438
- resultFixKeys['testInstance/testBU'].length,
443
+ resultFixKeys['testInstance/testBU']['automation'].length,
439
444
  1,
440
445
  'returned number of keys does not correspond to number of expected fixed keys'
441
446
  );
442
447
  assert.equal(
443
- resultFixKeys['testInstance/testBU'][0],
448
+ resultFixKeys['testInstance/testBU']['automation'][0],
444
449
  'testExisting_automation_fixedKey_paused',
445
450
  'returned keys do not correspond to expected fixed keys'
446
451
  );
447
452
  // THEN
448
- assert.equal(process.exitCode, false, 'fixKeys should not have thrown an error');
453
+ assert.equal(process.exitCode, 0, 'fixKeys should not have thrown an error');
449
454
  // confirm updated item
450
455
  assert.deepEqual(
451
456
  await testUtils.getActualJson(
@@ -456,37 +461,40 @@ describe('type: automation', () => {
456
461
  'returned metadata was not equal expected for update automation'
457
462
  );
458
463
  expect(
459
- file(
460
- testUtils.getActualDoc('testExisting_automation_fixedKey_paused', 'automation')
464
+ await testUtils.getActualDoc(
465
+ 'testExisting_automation_fixedKey_paused',
466
+ 'automation'
461
467
  )
462
468
  ).to.exist;
463
469
  // check number of API calls
464
470
  assert.equal(
465
471
  testUtils.getAPIHistoryLength(),
466
- 35,
472
+ 43,
467
473
  'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
468
474
  );
469
475
  return;
470
476
  });
477
+
471
478
  it('Should fixKeys by key w/o re-retrieving, deploy paused and then --execute', async () => {
472
479
  // WHEN
473
480
  handler.setOptions({ skipInteraction: { fixKeysReretrieve: false }, execute: true });
474
- const resultFixKeys = await handler.fixKeys('testInstance/testBU', 'automation', [
475
- 'testExisting_automation_fixKey_pause',
476
- 'testExisting_automation',
477
- ]);
481
+ const resultFixKeys = await handler.fixKeys(
482
+ 'testInstance/testBU',
483
+ ['automation'],
484
+ ['testExisting_automation_fixKey_pause', 'testExisting_automation']
485
+ );
478
486
  assert.equal(
479
- resultFixKeys['testInstance/testBU'].length,
487
+ resultFixKeys['testInstance/testBU']['automation'].length,
480
488
  1,
481
489
  'returned number of keys does not correspond to number of expected fixed keys'
482
490
  );
483
491
  assert.equal(
484
- resultFixKeys['testInstance/testBU'][0],
492
+ resultFixKeys['testInstance/testBU']['automation'][0],
485
493
  'testExisting_automation_fixedKey_paused',
486
494
  'returned keys do not correspond to expected fixed keys'
487
495
  );
488
496
  // THEN
489
- assert.equal(process.exitCode, false, 'fixKeys should not have thrown an error');
497
+ assert.equal(process.exitCode, 0, 'fixKeys should not have thrown an error');
490
498
  // confirm updated item
491
499
  assert.deepEqual(
492
500
  await testUtils.getActualJson(
@@ -497,37 +505,40 @@ describe('type: automation', () => {
497
505
  'returned metadata was not equal expected for update automation'
498
506
  );
499
507
  expect(
500
- file(
501
- testUtils.getActualDoc('testExisting_automation_fixedKey_paused', 'automation')
508
+ await testUtils.getActualDoc(
509
+ 'testExisting_automation_fixedKey_paused',
510
+ 'automation'
502
511
  )
503
512
  ).to.exist;
504
513
  // check number of API calls
505
514
  assert.equal(
506
515
  testUtils.getAPIHistoryLength(),
507
- 41,
516
+ 49,
508
517
  'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
509
518
  );
510
519
  return;
511
520
  });
521
+
512
522
  it('Should fixKeys by key w/o re-retrieving, deploy paused and then --schedule', async () => {
513
523
  // WHEN
514
524
  handler.setOptions({ skipInteraction: { fixKeysReretrieve: false }, schedule: true });
515
- const resultFixKeys = await handler.fixKeys('testInstance/testBU', 'automation', [
516
- 'testExisting_automation_fixKey_pause',
517
- 'testExisting_automation',
518
- ]);
525
+ const resultFixKeys = await handler.fixKeys(
526
+ 'testInstance/testBU',
527
+ ['automation'],
528
+ ['testExisting_automation_fixKey_pause', 'testExisting_automation']
529
+ );
519
530
  assert.equal(
520
- resultFixKeys['testInstance/testBU'].length,
531
+ resultFixKeys['testInstance/testBU']['automation'].length,
521
532
  1,
522
533
  'returned number of keys does not correspond to number of expected fixed keys'
523
534
  );
524
535
  assert.equal(
525
- resultFixKeys['testInstance/testBU'][0],
536
+ resultFixKeys['testInstance/testBU']['automation'][0],
526
537
  'testExisting_automation_fixedKey_paused',
527
538
  'returned keys do not correspond to expected fixed keys'
528
539
  );
529
540
  // THEN
530
- assert.equal(process.exitCode, false, 'fixKeys should not have thrown an error');
541
+ assert.equal(process.exitCode, 0, 'fixKeys should not have thrown an error');
531
542
  // confirm updated item
532
543
  assert.deepEqual(
533
544
  await testUtils.getActualJson(
@@ -538,19 +549,21 @@ describe('type: automation', () => {
538
549
  'returned metadata was not equal expected for update automation'
539
550
  );
540
551
  expect(
541
- file(
542
- testUtils.getActualDoc('testExisting_automation_fixedKey_paused', 'automation')
552
+ await testUtils.getActualDoc(
553
+ 'testExisting_automation_fixedKey_paused',
554
+ 'automation'
543
555
  )
544
556
  ).to.exist;
545
557
  // check number of API calls
546
558
  assert.equal(
547
559
  testUtils.getAPIHistoryLength(),
548
- 43,
560
+ 51,
549
561
  'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
550
562
  );
551
563
  return;
552
564
  });
553
565
  });
566
+
554
567
  describe('Templating ================', () => {
555
568
  it('Should create a automation template via retrieveAsTemplate and build it', async () => {
556
569
  // GIVEN there is a template
@@ -560,11 +573,7 @@ describe('type: automation', () => {
560
573
  ['testExisting_automation'],
561
574
  'testSourceMarket'
562
575
  );
563
- assert.equal(
564
- process.exitCode,
565
- false,
566
- 'retrieveAsTemplate should not have thrown an error'
567
- );
576
+ assert.equal(process.exitCode, 0, 'retrieveAsTemplate should not have thrown an error');
568
577
 
569
578
  // WHEN
570
579
  assert.equal(
@@ -581,14 +590,10 @@ describe('type: automation', () => {
581
590
  await handler.buildDefinition(
582
591
  'testInstance/testBU',
583
592
  'automation',
584
- 'testExisting_automation',
593
+ ['testExisting_automation'],
585
594
  'testTargetMarket'
586
595
  );
587
- assert.equal(
588
- process.exitCode,
589
- false,
590
- 'buildDefinition should not have thrown an error'
591
- );
596
+ assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error');
592
597
  assert.deepEqual(
593
598
  await testUtils.getActualDeployJson('testTemplated_automation', 'automation'),
594
599
  await testUtils.getExpectedJson('9999999', 'automation', 'build'),
@@ -596,11 +601,12 @@ describe('type: automation', () => {
596
601
  );
597
602
  assert.equal(
598
603
  testUtils.getAPIHistoryLength(),
599
- 20,
604
+ 24,
600
605
  'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
601
606
  );
602
607
  return;
603
608
  });
609
+
604
610
  it('Should create a automation template via buildTemplate and build it', async () => {
605
611
  // download first before we test buildTemplate
606
612
  await handler.retrieve('testInstance/testBU', ['automation']);
@@ -611,7 +617,7 @@ describe('type: automation', () => {
611
617
  ['testExisting_automation'],
612
618
  'testSourceMarket'
613
619
  );
614
- assert.equal(process.exitCode, false, 'buildTemplate should not have thrown an error');
620
+ assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error');
615
621
  // WHEN
616
622
  assert.equal(
617
623
  result.automation ? Object.keys(result.automation).length : 0,
@@ -627,14 +633,10 @@ describe('type: automation', () => {
627
633
  await handler.buildDefinition(
628
634
  'testInstance/testBU',
629
635
  'automation',
630
- 'testExisting_automation',
636
+ ['testExisting_automation'],
631
637
  'testTargetMarket'
632
638
  );
633
- assert.equal(
634
- process.exitCode,
635
- false,
636
- 'buildDefinition should not have thrown an error'
637
- );
639
+ assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error');
638
640
 
639
641
  assert.deepEqual(
640
642
  await testUtils.getActualDeployJson('testTemplated_automation', 'automation'),
@@ -643,12 +645,13 @@ describe('type: automation', () => {
643
645
  );
644
646
  assert.equal(
645
647
  testUtils.getAPIHistoryLength(),
646
- 18,
648
+ 22,
647
649
  'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
648
650
  );
649
651
  return;
650
652
  });
651
653
  });
654
+
652
655
  describe('Delete ================', () => {
653
656
  it('Should delete the item', async () => {
654
657
  // WHEN
@@ -658,12 +661,13 @@ describe('type: automation', () => {
658
661
  'testExisting_automation'
659
662
  );
660
663
  // THEN
661
- assert.equal(process.exitCode, false, 'delete should not have thrown an error');
664
+ assert.equal(process.exitCode, 0, 'delete should not have thrown an error');
662
665
 
663
666
  assert.equal(isDeleted, true, 'should have deleted the item');
664
667
  return;
665
668
  });
666
669
  });
670
+
667
671
  describe('CI/CD ================', () => {
668
672
  it('Should return a list of files based on their type and key', async () => {
669
673
  // WHEN
@@ -671,11 +675,7 @@ describe('type: automation', () => {
671
675
  'testExisting_automation',
672
676
  ]);
673
677
  // THEN
674
- assert.equal(
675
- process.exitCode,
676
- false,
677
- 'getFilesToCommit should not have thrown an error'
678
- );
678
+ assert.equal(process.exitCode, 0, 'getFilesToCommit should not have thrown an error');
679
679
  assert.equal(fileList.length, 2, 'expected only 2 file paths');
680
680
 
681
681
  assert.equal(
@@ -691,12 +691,13 @@ describe('type: automation', () => {
691
691
  return;
692
692
  });
693
693
  });
694
+
694
695
  describe('Schedule ================', () => {
695
696
  it('Should schedule an automation by key', async () => {
696
697
  const executedKeys = await handler.schedule('testInstance/testBU', 'automation', [
697
698
  'testExisting_automation',
698
699
  ]);
699
- assert.equal(process.exitCode, false, 'execute should not have thrown an error');
700
+ assert.equal(process.exitCode, 0, 'execute should not have thrown an error');
700
701
  assert.equal(
701
702
  executedKeys['testInstance/testBU']?.length,
702
703
  1,
@@ -709,10 +710,11 @@ describe('type: automation', () => {
709
710
  );
710
711
  return;
711
712
  });
713
+
712
714
  it('Should schedule an automation selected via --like', async () => {
713
715
  handler.setOptions({ like: { key: 'testExist%automation' } });
714
716
  const executedKeys = await handler.schedule('testInstance/testBU', 'automation');
715
- assert.equal(process.exitCode, false, 'execute should not have thrown an error');
717
+ assert.equal(process.exitCode, 0, 'execute should not have thrown an error');
716
718
  assert.equal(
717
719
  executedKeys['testInstance/testBU']?.length,
718
720
  1,
@@ -725,12 +727,13 @@ describe('type: automation', () => {
725
727
  );
726
728
  return;
727
729
  });
730
+
728
731
  it('Should not schedule executing an automation because key and --like was specified', async () => {
729
732
  handler.setOptions({ like: { key: 'testExisting%' } });
730
733
  const executedKeys = await handler.schedule('testInstance/testBU', 'automation', [
731
734
  'testExisting_automation',
732
735
  ]);
733
- assert.equal(process.exitCode, true, 'execute should have thrown an error');
736
+ assert.equal(process.exitCode, 1, 'execute should have thrown an error');
734
737
  assert.equal(
735
738
  Object.keys(executedKeys).length,
736
739
  0,
@@ -739,13 +742,14 @@ describe('type: automation', () => {
739
742
  return;
740
743
  });
741
744
  });
745
+
742
746
  describe('Execute ================', () => {
743
747
  it('Should execute --schedule an automation by key', async () => {
744
748
  handler.setOptions({ schedule: true });
745
749
  const executedKeys = await handler.execute('testInstance/testBU', 'automation', [
746
750
  'testExisting_automation',
747
751
  ]);
748
- assert.equal(process.exitCode, false, 'execute should not have thrown an error');
752
+ assert.equal(process.exitCode, 0, 'execute should not have thrown an error');
749
753
  assert.equal(
750
754
  executedKeys['testInstance/testBU']?.length,
751
755
  1,
@@ -758,10 +762,11 @@ describe('type: automation', () => {
758
762
  );
759
763
  return;
760
764
  });
765
+
761
766
  it('Should execute --schedule an automation selected via --like', async () => {
762
767
  handler.setOptions({ like: { key: 'testExist%automation' }, schedule: true });
763
768
  const executedKeys = await handler.execute('testInstance/testBU', 'automation');
764
- assert.equal(process.exitCode, false, 'execute should not have thrown an error');
769
+ assert.equal(process.exitCode, 0, 'execute should not have thrown an error');
765
770
  assert.equal(
766
771
  executedKeys['testInstance/testBU']?.length,
767
772
  1,
@@ -774,12 +779,13 @@ describe('type: automation', () => {
774
779
  );
775
780
  return;
776
781
  });
782
+
777
783
  it('Should not execute --schedule executing an automation because key and --like was specified', async () => {
778
784
  handler.setOptions({ like: { key: 'testExisting%' }, schedule: true });
779
785
  const executedKeys = await handler.execute('testInstance/testBU', 'automation', [
780
786
  'testExisting_automation',
781
787
  ]);
782
- assert.equal(process.exitCode, true, 'execute should have thrown an error');
788
+ assert.equal(process.exitCode, 1, 'execute should have thrown an error');
783
789
  assert.equal(
784
790
  Object.keys(executedKeys).length,
785
791
  0,
@@ -787,11 +793,12 @@ describe('type: automation', () => {
787
793
  );
788
794
  return;
789
795
  });
796
+
790
797
  it('Should runOnce an automation by key', async () => {
791
798
  const executedKeys = await handler.execute('testInstance/testBU', 'automation', [
792
799
  'testExisting_automation',
793
800
  ]);
794
- assert.equal(process.exitCode, false, 'execute should not have thrown an error');
801
+ assert.equal(process.exitCode, 0, 'execute should not have thrown an error');
795
802
  assert.equal(
796
803
  executedKeys['testInstance/testBU']?.length,
797
804
  1,
@@ -804,10 +811,11 @@ describe('type: automation', () => {
804
811
  );
805
812
  return;
806
813
  });
814
+
807
815
  it('Should runOnce an automation selected via --like', async () => {
808
816
  handler.setOptions({ like: { key: 'testExist%automation' } });
809
817
  const executedKeys = await handler.execute('testInstance/testBU', 'automation');
810
- assert.equal(process.exitCode, false, 'execute should not have thrown an error');
818
+ assert.equal(process.exitCode, 0, 'execute should not have thrown an error');
811
819
  assert.equal(
812
820
  executedKeys['testInstance/testBU']?.length,
813
821
  1,
@@ -821,12 +829,13 @@ describe('type: automation', () => {
821
829
 
822
830
  return;
823
831
  });
832
+
824
833
  it('Should not runOnce executing an automation because key and --like was specified', async () => {
825
834
  handler.setOptions({ like: { key: 'testExisting%' } });
826
835
  const executedKeys = await handler.execute('testInstance/testBU', 'automation', [
827
836
  'testExisting_automation',
828
837
  ]);
829
- assert.equal(process.exitCode, true, 'execute should have thrown an error');
838
+ assert.equal(process.exitCode, 1, 'execute should have thrown an error');
830
839
  assert.equal(
831
840
  Object.keys(executedKeys).length,
832
841
  0,
@@ -836,12 +845,13 @@ describe('type: automation', () => {
836
845
  return;
837
846
  });
838
847
  });
848
+
839
849
  describe('Pause ================', () => {
840
850
  it('Should pause a automation by key', async () => {
841
851
  const pausedKeys = await handler.pause('testInstance/testBU', 'automation', [
842
852
  'testExisting_automation_pause',
843
853
  ]);
844
- assert.equal(process.exitCode, false, 'pause should not have thrown an error');
854
+ assert.equal(process.exitCode, 0, 'pause should not have thrown an error');
845
855
  assert.equal(
846
856
  pausedKeys['testInstance/testBU']?.length,
847
857
  1,
@@ -854,10 +864,11 @@ describe('type: automation', () => {
854
864
  );
855
865
  return;
856
866
  });
867
+
857
868
  it('Should pause a automation selected via --like', async () => {
858
869
  handler.setOptions({ like: { key: 'testExisting_a%n_pause' } });
859
870
  const pausedKeys = await handler.pause('testInstance/testBU', 'automation');
860
- assert.equal(process.exitCode, false, 'pause should not have thrown an error');
871
+ assert.equal(process.exitCode, 0, 'pause should not have thrown an error');
861
872
  assert.equal(
862
873
  pausedKeys['testInstance/testBU']?.length,
863
874
  1,
@@ -870,12 +881,13 @@ describe('type: automation', () => {
870
881
  );
871
882
  return;
872
883
  });
884
+
873
885
  it('Should not pause automation because key and --like was specified', async () => {
874
886
  handler.setOptions({ like: { key: 'testExisting_a%n_pause' } });
875
887
  const pausedKeys = await handler.pause('testInstance/testBU', 'automation', [
876
888
  'testExisting_automation_pause',
877
889
  ]);
878
- assert.equal(process.exitCode, true, 'pause should have thrown an error');
890
+ assert.equal(process.exitCode, 1, 'pause should have thrown an error');
879
891
  assert.equal(
880
892
  Object.keys(pausedKeys).length,
881
893
  0,