mcdev 7.6.3 → 7.7.1

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 (147) hide show
  1. package/.github/ISSUE_TEMPLATE/bug.yml +2 -0
  2. package/.github/ISSUE_TEMPLATE/task.md +1 -1
  3. package/.github/workflows/coverage-base-update.yml +2 -2
  4. package/.github/workflows/coverage-develop-branch.yml +3 -1
  5. package/.github/workflows/coverage-main-branch.yml +3 -1
  6. package/.github/workflows/coverage.yml +5 -3
  7. package/.mcdev-validations.js +0 -0
  8. package/@types/lib/Builder.d.ts +14 -0
  9. package/@types/lib/Builder.d.ts.map +1 -1
  10. package/@types/lib/MetadataTypeDefinitions.d.ts +2 -0
  11. package/@types/lib/MetadataTypeDefinitions.d.ts.map +1 -1
  12. package/@types/lib/MetadataTypeInfo.d.ts +2 -0
  13. package/@types/lib/MetadataTypeInfo.d.ts.map +1 -1
  14. package/@types/lib/index.d.ts +17 -8
  15. package/@types/lib/index.d.ts.map +1 -1
  16. package/@types/lib/metadataTypes/Asset.d.ts +11 -3
  17. package/@types/lib/metadataTypes/Asset.d.ts.map +1 -1
  18. package/@types/lib/metadataTypes/DataExtension.d.ts.map +1 -1
  19. package/@types/lib/metadataTypes/DomainVerification.d.ts +180 -0
  20. package/@types/lib/metadataTypes/DomainVerification.d.ts.map +1 -0
  21. package/@types/lib/metadataTypes/Event.d.ts.map +1 -1
  22. package/@types/lib/metadataTypes/Journey.d.ts +7 -4
  23. package/@types/lib/metadataTypes/Journey.d.ts.map +1 -1
  24. package/@types/lib/metadataTypes/MetadataType.d.ts +15 -7
  25. package/@types/lib/metadataTypes/MetadataType.d.ts.map +1 -1
  26. package/@types/lib/metadataTypes/MobileKeyword.d.ts +2 -10
  27. package/@types/lib/metadataTypes/MobileKeyword.d.ts.map +1 -1
  28. package/@types/lib/metadataTypes/MobileMessage.d.ts +2 -10
  29. package/@types/lib/metadataTypes/MobileMessage.d.ts.map +1 -1
  30. package/@types/lib/metadataTypes/SendClassification.d.ts.map +1 -1
  31. package/@types/lib/metadataTypes/SenderProfile.d.ts +7 -0
  32. package/@types/lib/metadataTypes/SenderProfile.d.ts.map +1 -1
  33. package/@types/lib/metadataTypes/TransactionalEmail.d.ts +2 -2
  34. package/@types/lib/metadataTypes/TransactionalEmail.d.ts.map +1 -1
  35. package/@types/lib/metadataTypes/TriggeredSend.d.ts +8 -0
  36. package/@types/lib/metadataTypes/TriggeredSend.d.ts.map +1 -1
  37. package/@types/lib/metadataTypes/Verification.d.ts +0 -9
  38. package/@types/lib/metadataTypes/Verification.d.ts.map +1 -1
  39. package/@types/lib/metadataTypes/definitions/DomainVerification.definition.d.ts +100 -0
  40. package/@types/lib/metadataTypes/definitions/DomainVerification.definition.d.ts.map +1 -0
  41. package/@types/lib/metadataTypes/definitions/Journey.definition.d.ts +1 -1
  42. package/@types/lib/util/devops.d.ts.map +1 -1
  43. package/@types/lib/util/replaceContentBlockReference.d.ts +2 -1
  44. package/@types/lib/util/replaceContentBlockReference.d.ts.map +1 -1
  45. package/@types/lib/util/util.d.ts +42 -1
  46. package/@types/lib/util/util.d.ts.map +1 -1
  47. package/@types/lib/util/validations.d.ts.map +1 -1
  48. package/@types/types/mcdev.d.d.ts +34 -0
  49. package/@types/types/mcdev.d.d.ts.map +1 -1
  50. package/boilerplate/config.json +11 -0
  51. package/boilerplate/files/eslint.config.js +98 -3
  52. package/boilerplate/forcedUpdates.json +4 -0
  53. package/boilerplate/gitignore-template +1 -1
  54. package/boilerplate/npm-dependencies.json +1 -0
  55. package/eslint.config.js +4 -3
  56. package/lib/Builder.js +114 -54
  57. package/lib/Deployer.js +2 -2
  58. package/lib/MetadataTypeDefinitions.js +2 -0
  59. package/lib/MetadataTypeInfo.js +2 -0
  60. package/lib/cli.js +127 -3
  61. package/lib/index.js +217 -164
  62. package/lib/metadataTypes/Asset.js +76 -22
  63. package/lib/metadataTypes/DataExtension.js +10 -2
  64. package/lib/metadataTypes/DomainVerification.js +246 -0
  65. package/lib/metadataTypes/Event.js +21 -9
  66. package/lib/metadataTypes/Journey.js +339 -223
  67. package/lib/metadataTypes/MetadataType.js +153 -106
  68. package/lib/metadataTypes/MobileKeyword.js +5 -2
  69. package/lib/metadataTypes/MobileMessage.js +5 -2
  70. package/lib/metadataTypes/SendClassification.js +5 -0
  71. package/lib/metadataTypes/SenderProfile.js +102 -3
  72. package/lib/metadataTypes/TransactionalEmail.js +3 -1
  73. package/lib/metadataTypes/Verification.js +3 -1
  74. package/lib/metadataTypes/definitions/DomainVerification.definition.js +71 -0
  75. package/lib/metadataTypes/definitions/Journey.definition.js +7 -1
  76. package/lib/metadataTypes/definitions/SendClassification.definition.js +2 -2
  77. package/lib/metadataTypes/definitions/SenderProfile.definition.js +1 -1
  78. package/lib/util/config.js +6 -0
  79. package/lib/util/devops.js +130 -154
  80. package/lib/util/file.js +3 -3
  81. package/lib/util/replaceContentBlockReference.js +10 -3
  82. package/lib/util/util.js +96 -14
  83. package/lib/util/validations.js +34 -14
  84. package/package.json +10 -10
  85. package/test/general.test.js +339 -96
  86. package/test/mockRoot/.mcdev-validations.js +66 -0
  87. package/test/mockRoot/.mcdevrc.json +30 -2
  88. package/test/mockRoot/deploy/testInstance/testBU/asset/block/testNew_asset_htmlblock.asset-block-meta.html +1 -0
  89. package/test/mockRoot/deploy/testInstance/testBU/asset/block/testNew_asset_htmlblock.asset-block-meta.json +39 -0
  90. package/test/mockRoot/deploy/testInstance/testBU/asset/block/testNew_asset_withCBBK_notexisting.asset-block-meta.html +4 -0
  91. package/test/mockRoot/deploy/testInstance/testBU/asset/block/testNew_asset_withCBBK_notexisting.asset-block-meta.json +39 -0
  92. package/test/mockRoot/deploy/testInstance/testBU/asset/block/testNew_asset_withCBBK_preexisting.asset-block-meta.html +4 -0
  93. package/test/mockRoot/deploy/testInstance/testBU/asset/block/testNew_asset_withCBBK_preexisting.asset-block-meta.json +39 -0
  94. package/test/mockRoot/deploy/testInstance/testBU/asset/message/testNew_assetMessage/testNew_assetMessage.asset-message-meta.json +435 -0
  95. package/test/mockRoot/deploy/testInstance/testBU/asset/message/testNew_assetMessage/views.html.content.asset-message-meta.html +150 -0
  96. package/test/mockRoot/deploy/testInstance/testBU/asset/message/testNew_asset_templatebasedemail/testNew_asset_templatebasedemail.asset-message-meta.json +305 -0
  97. package/test/mockRoot/deploy/testInstance/testBU/asset/message/testNew_asset_templatebasedemail/views.html.content.asset-message-meta.html +150 -0
  98. package/test/mockRoot/deploy/testInstance/testBU/asset/template/testNew_asset_template/content.asset-template-meta.html +150 -0
  99. package/test/mockRoot/deploy/testInstance/testBU/asset/template/testNew_asset_template/testNew_asset_template.asset-template-meta.json +116 -0
  100. package/test/mockRoot/deploy/testInstance/testBU/domainVerification/joern.berkefeld.New@accenture.com.domainVerification-meta.json +6 -0
  101. package/test/mockRoot/deploy/testInstance/testBU/domainVerification/joern.berkefeld@accenture.com.domainVerification-meta.json +6 -0
  102. package/test/mockRoot/deploy/testInstance/testBU/domainVerification/mcdev.accenture.com.domainVerification-meta.json +6 -0
  103. package/test/mockRoot/deploy/testInstance/testBU/journey/testNew_temail_notPublished.journey-meta.json +213 -0
  104. package/test/mockRoot/deploy/testInstance/testBU/senderProfile/testExisting_senderProfile.senderProfile-meta.json +1 -0
  105. package/test/mockRoot/deploy/testInstance/testBU/senderProfile/testNew_senderProfile.senderProfile-meta.json +1 -0
  106. package/test/resourceFactory.js +7 -24
  107. package/test/resources/9999999/asset/v1/content/assets/post-response-key=testNew_assetMessage.json +441 -0
  108. package/test/resources/9999999/asset/v1/content/assets/post-response-key=testNew_asset_htmlblock.json +59 -0
  109. package/test/resources/9999999/asset/v1/content/assets/post-response-key=testNew_asset_template.json +147 -0
  110. package/test/resources/9999999/asset/v1/content/assets/post-response-key=testNew_asset_templatebasedemail.json +322 -0
  111. package/test/resources/9999999/asset/v1/content/assets/post-response-key=testNew_asset_withCBBK_notexisting.json +59 -0
  112. package/test/resources/9999999/asset/v1/content/assets/post-response-key=testNew_asset_withCBBK_preexisting.json +59 -0
  113. package/test/resources/9999999/asset-deploy2/block/testBlacklist_asset_htmlblock.asset-block-meta.html +1 -0
  114. package/test/resources/9999999/asset-deploy2/block/testBlacklist_asset_htmlblock.asset-block-meta.json +39 -0
  115. package/test/resources/9999999/automation/clone-expected.json +61 -0
  116. package/test/resources/9999999/dataExtension/retrieve-CustomerKey=testExisting_dataExtension-response.xml +52 -0
  117. package/test/resources/9999999/dataExtension-deploy/testBlacklist_dataExtension.dataExtension-meta.json +20 -0
  118. package/test/resources/9999999/dataFolder/retrieve-ContentTypeINasset,asset-shared,dataextension,hidden,salesforcedataextension,shared_data,shared_dataextension,shared_salesforcedataextension,synchronizeddataextension-response.xml +137 -0
  119. package/test/resources/9999999/domainVerification/create-expected.json +3 -0
  120. package/test/resources/9999999/domainVerification/get-sap-expected.json +6 -0
  121. package/test/resources/9999999/domainVerification/update-expected.json +6 -0
  122. package/test/resources/9999999/interaction/v1/interactions/key_testExisting_temail/put-response-paused.json +219 -0
  123. package/test/resources/9999999/interaction/v1/interactions/key_testNew_temail_notPublished/get-response.json +218 -0
  124. package/test/resources/9999999/interaction/v1/interactions/post-response.json +216 -0
  125. package/test/resources/9999999/journey/create-transactionaEmail-publish-expected.json +217 -0
  126. package/test/resources/9999999/messaging/v1/domainverification/delete/post-response.txt +1 -0
  127. package/test/resources/9999999/messaging/v1/domainverification/get-response.json +43 -0
  128. package/test/resources/9999999/messaging/v1/domainverification/post-response.txt +1 -0
  129. package/test/resources/9999999/messaging/v1/domainverification/update/post-response.txt +1 -0
  130. package/test/resources/9999999/messaging/v1/email/definitions/get-response.json +7 -0
  131. package/test/resources/9999999/messaging/v1/email/definitions/testNew_temail_notPublished/get-response.json +26 -0
  132. package/test/resources/9999999/query/clone-expected.json +8 -0
  133. package/test/resources/9999999/query/clone-expected.sql +7 -0
  134. package/test/resources/9999999/senderProfile/create-response.xml +1 -1
  135. package/test/resources/9999999/senderProfile/post-expected.json +1 -1
  136. package/test/resources/9999999/transactionalEmail/create-publish-expected.json +20 -0
  137. package/test/type.asset.test.js +216 -9
  138. package/test/type.automation.test.js +1 -1
  139. package/test/type.domainVerification.test.js +169 -0
  140. package/test/type.journey.test.js +107 -21
  141. package/test/type.script.test.js +1 -1
  142. package/test/type.sendClassification.test.js +3 -3
  143. package/test/type.senderProfile.test.js +26 -6
  144. package/test/type.transactionalEmail.test.js +5 -5
  145. package/test/type.triggeredSend.test.js +1 -1
  146. package/test/utils.js +8 -0
  147. package/types/mcdev.d.js +12 -0
@@ -46,7 +46,7 @@ describe('type: journey', () => {
46
46
  );
47
47
  assert.equal(
48
48
  testUtils.getAPIHistoryLength(),
49
- 26,
49
+ 27,
50
50
  'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
51
51
  );
52
52
  return;
@@ -131,7 +131,7 @@ describe('type: journey', () => {
131
131
  );
132
132
  assert.equal(
133
133
  testUtils.getAPIHistoryLength(),
134
- 22,
134
+ 23,
135
135
  'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
136
136
  );
137
137
  return;
@@ -218,7 +218,11 @@ describe('type: journey', () => {
218
218
  return;
219
219
  });
220
220
 
221
- it('Should not deploy --publish an already published transactional journey', async () => {
221
+ it('Should deploy --publish an already published transactional journey by first pausing it', async () => {
222
+ await testUtils.copyFile(
223
+ 'interaction/v1/interactions/key_testExisting_temail/put-response-paused.json',
224
+ 'interaction/v1/interactions/key_testExisting_temail/put-response.json'
225
+ );
222
226
  // WHEN
223
227
  handler.setOptions({ skipStatusCheck: true, publish: true });
224
228
  const deploy = await handler.deploy(
@@ -228,23 +232,48 @@ describe('type: journey', () => {
228
232
  );
229
233
 
230
234
  // THEN
231
- assert.equal(process.exitCode, 1, 'deploy --publish should have thrown an error');
235
+ assert.equal(process.exitCode, 0, 'deploy --publish should not have thrown an error');
232
236
  // retrieve result
233
237
  assert.deepEqual(
234
238
  Object.keys(deploy['testInstance/testBU']?.journey),
235
- [],
239
+ ['testExisting_temail'],
236
240
  'should have published the right journey'
237
241
  );
238
242
 
243
+ const pauseCallout = testUtils.getRestCallout(
244
+ 'post',
245
+ '/interaction/v1/interactions/transactional/pause'
246
+ );
247
+ const resumeCallout = testUtils.getRestCallout(
248
+ 'post',
249
+ '/interaction/v1/interactions/transactional/resume'
250
+ );
251
+
252
+ // confirm callouts
253
+ assert.deepEqual(
254
+ pauseCallout,
255
+ {
256
+ definitionId: 'dsfdsafdsa-922c-4568-85a5-e5cc77efc3be',
257
+ },
258
+ 'pauseCallout-payload JSON was not equal expected'
259
+ );
260
+ assert.deepEqual(
261
+ resumeCallout,
262
+ {
263
+ definitionId: 'dsfdsafdsa-922c-4568-85a5-e5cc77efc3be',
264
+ },
265
+ 'resumeCallout-payload JSON was not equal expected'
266
+ );
267
+
239
268
  assert.equal(
240
269
  testUtils.getAPIHistoryLength(),
241
- 22,
270
+ 60,
242
271
  'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
243
272
  );
244
273
  return;
245
274
  });
246
275
 
247
- it('Should deploy --publish a transactional journey', async () => {
276
+ it('Should update and publish a transactional journey', async () => {
248
277
  // WHEN
249
278
  handler.setOptions({ skipStatusCheck: true, publish: true });
250
279
  const deploy = await handler.deploy(
@@ -288,13 +317,70 @@ describe('type: journey', () => {
288
317
 
289
318
  assert.equal(
290
319
  testUtils.getAPIHistoryLength(),
291
- 57,
320
+ 59,
292
321
  'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
293
322
  );
294
323
  return;
295
324
  });
296
325
 
297
- it('Should deploy --publish a journey by key (auto-picks latest version)', async () => {
326
+ it('Should create and publish a transactional journey', async () => {
327
+ // WHEN
328
+ handler.setOptions({ skipStatusCheck: true, publish: true });
329
+ const deploy = await handler.deploy(
330
+ 'testInstance/testBU',
331
+ ['journey'],
332
+ ['testNew_temail_notPublished']
333
+ );
334
+
335
+ // THEN
336
+ assert.equal(process.exitCode, 0, 'deploy --publish should not have thrown an error');
337
+ // retrieve result
338
+ assert.deepEqual(
339
+ Object.keys(deploy['testInstance/testBU']?.journey),
340
+ ['testNew_temail_notPublished'],
341
+ 'should have published the right journey'
342
+ );
343
+
344
+ // get callouts
345
+ const publishCallout = testUtils.getRestCallout(
346
+ 'post',
347
+ '/interaction/v1/interactions/transactional/create'
348
+ );
349
+ // confirm callouts
350
+ assert.deepEqual(
351
+ publishCallout,
352
+ {
353
+ definitionId: '4c39662b-7c47-4df4-8bd6-65f01c313e8c',
354
+ },
355
+ 'publish-payload JSON was not equal expected'
356
+ );
357
+
358
+ // confirm transactionalEmail was downloaded
359
+ assert.deepEqual(
360
+ await testUtils.getActualJson('testNew_temail_notPublished', 'transactionalEmail'),
361
+ await testUtils.getExpectedJson('9999999', 'transactionalEmail', 'create-publish'),
362
+ 'returned JSON was not equal expected'
363
+ );
364
+ // confirm journey was downloaded
365
+ assert.deepEqual(
366
+ await testUtils.getActualJson('testNew_temail_notPublished', 'journey'),
367
+ await testUtils.getExpectedJson(
368
+ '9999999',
369
+ 'journey',
370
+ 'create-transactionaEmail-publish'
371
+ ),
372
+ 'returned JSON was not equal expected'
373
+ );
374
+
375
+ assert.equal(
376
+ testUtils.getAPIHistoryLength(),
377
+ 59,
378
+ 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
379
+ );
380
+ return;
381
+ });
382
+
383
+ it('Should update & publish a multi-step journey by key (auto-picks latest version)', async () => {
298
384
  handler.setOptions({ skipStatusCheck: true, publish: true });
299
385
  // WHEN
300
386
  const deploy = await handler.deploy(
@@ -380,7 +466,7 @@ describe('type: journey', () => {
380
466
 
381
467
  assert.equal(
382
468
  testUtils.getAPIHistoryLength(),
383
- 26,
469
+ 27,
384
470
  'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
385
471
  );
386
472
  return;
@@ -418,7 +504,7 @@ describe('type: journey', () => {
418
504
  // journey
419
505
  assert.deepEqual(
420
506
  templatedItems.journey.map((item) => item.key),
421
- ['{{{prefix}}}journey_Quicksend', '{{{prefix}}}journey_Multistep'],
507
+ ['{{{prefix}}}journey_Multistep', '{{{prefix}}}journey_Quicksend'],
422
508
  'expected specific journeys to be templated'
423
509
  );
424
510
  // event
@@ -434,9 +520,9 @@ describe('type: journey', () => {
434
520
  assert.deepEqual(
435
521
  templatedItems.dataExtension.map((item) => item.CustomerKey),
436
522
  [
437
- '{{{prefix}}}journey_Quicksend',
438
- '{{{prefix}}}journey_Multistep',
439
523
  '{{{prefix}}}DomainExclusion',
524
+ '{{{prefix}}}journey_Multistep',
525
+ '{{{prefix}}}journey_Quicksend',
440
526
  ],
441
527
  'expected specific dataExtensions to be templated'
442
528
  );
@@ -457,8 +543,8 @@ describe('type: journey', () => {
457
543
  templatedItems.asset.map((item) => item.customerKey),
458
544
  [
459
545
  '{{{prefix}}}asset_htmlblock',
460
- '{{{prefix}}}htmlblock1',
461
546
  '{{{prefix}}}htmlblock 3 spaces',
547
+ '{{{prefix}}}htmlblock1',
462
548
  '{{{prefix}}}htmlblock2',
463
549
  ],
464
550
  'expected specific assets to be templated'
@@ -568,7 +654,7 @@ describe('type: journey', () => {
568
654
 
569
655
  assert.equal(
570
656
  testUtils.getAPIHistoryLength(),
571
- 32,
657
+ 33,
572
658
  'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
573
659
  );
574
660
  return;
@@ -603,7 +689,7 @@ describe('type: journey', () => {
603
689
 
604
690
  assert.equal(
605
691
  testUtils.getAPIHistoryLength(),
606
- 32,
692
+ 33,
607
693
  'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
608
694
  );
609
695
  return;
@@ -638,7 +724,7 @@ describe('type: journey', () => {
638
724
 
639
725
  assert.equal(
640
726
  testUtils.getAPIHistoryLength(),
641
- 32,
727
+ 33,
642
728
  'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
643
729
  );
644
730
  return;
@@ -701,7 +787,7 @@ describe('type: journey', () => {
701
787
 
702
788
  assert.equal(
703
789
  testUtils.getAPIHistoryLength(),
704
- 37,
790
+ 38,
705
791
  'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
706
792
  );
707
793
  return;
@@ -755,7 +841,7 @@ describe('type: journey', () => {
755
841
 
756
842
  assert.equal(
757
843
  testUtils.getAPIHistoryLength(),
758
- 35,
844
+ 36,
759
845
  'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
760
846
  );
761
847
  return;
@@ -1180,7 +1266,7 @@ describe('type: journey', () => {
1180
1266
 
1181
1267
  assert.equal(
1182
1268
  testUtils.getAPIHistoryLength(),
1183
- 36,
1269
+ 37,
1184
1270
  'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
1185
1271
  );
1186
1272
  return;
@@ -1203,7 +1289,7 @@ describe('type: journey', () => {
1203
1289
 
1204
1290
  assert.equal(
1205
1291
  testUtils.getAPIHistoryLength(),
1206
- 41,
1292
+ 42,
1207
1293
  'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
1208
1294
  );
1209
1295
  return;
@@ -402,9 +402,9 @@ describe('type: script', () => {
402
402
  assert.deepEqual(
403
403
  templatedItems.asset.map((item) => item.customerKey),
404
404
  [
405
- '{{{prefix}}}htmlblock1',
406
405
  '{{{prefix}}}asset_htmlblock',
407
406
  '{{{prefix}}}htmlblock 3 spaces',
407
+ '{{{prefix}}}htmlblock1',
408
408
  '{{{prefix}}}htmlblock2',
409
409
  ],
410
410
  'expected specific assets to be templated'
@@ -39,7 +39,7 @@ describe('type: sendClassification', () => {
39
39
  );
40
40
  assert.equal(
41
41
  testUtils.getAPIHistoryLength(),
42
- 3,
42
+ 4,
43
43
  'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
44
44
  );
45
45
  return;
@@ -82,7 +82,7 @@ describe('type: sendClassification', () => {
82
82
  // check number of API calls
83
83
  assert.equal(
84
84
  testUtils.getAPIHistoryLength(),
85
- 6,
85
+ 7,
86
86
  'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
87
87
  );
88
88
  return;
@@ -132,7 +132,7 @@ describe('type: sendClassification', () => {
132
132
  );
133
133
  assert.equal(
134
134
  testUtils.getAPIHistoryLength(),
135
- 3,
135
+ 4,
136
136
  'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
137
137
  );
138
138
  return;
@@ -36,7 +36,7 @@ describe('type: senderProfile', () => {
36
36
  );
37
37
  assert.equal(
38
38
  testUtils.getAPIHistoryLength(),
39
- 4,
39
+ 5,
40
40
  'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
41
41
  );
42
42
  return;
@@ -61,6 +61,26 @@ describe('type: senderProfile', () => {
61
61
  4,
62
62
  '4 senderProfiles expected'
63
63
  );
64
+ // check callouts
65
+ const createCallout = testUtils.getRestCallout(
66
+ 'post',
67
+ '/messaging/v1/domainverification/'
68
+ );
69
+ assert.deepEqual(
70
+ createCallout,
71
+ { domain: 'joern.berkefeld.New@accenture.com' },
72
+ 'unexecpted payload for create callout'
73
+ );
74
+ // confirm created domainVerification item
75
+ assert.deepEqual(
76
+ await testUtils.getActualJson(
77
+ 'joern.berkefeld.New@accenture.com',
78
+ 'domainVerification'
79
+ ),
80
+ await testUtils.getExpectedJson('9999999', 'domainVerification', 'create'),
81
+ 'returned new-JSON was not equal expected for insert domainVerification'
82
+ );
83
+
64
84
  // confirm created item
65
85
  assert.deepEqual(
66
86
  await testUtils.getActualJson('testNew_senderProfile', 'senderProfile'),
@@ -76,7 +96,7 @@ describe('type: senderProfile', () => {
76
96
  // check number of API calls
77
97
  assert.equal(
78
98
  testUtils.getAPIHistoryLength(),
79
- 7,
99
+ 10,
80
100
  'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
81
101
  );
82
102
  return;
@@ -123,7 +143,7 @@ describe('type: senderProfile', () => {
123
143
  );
124
144
  assert.equal(
125
145
  testUtils.getAPIHistoryLength(),
126
- 4,
146
+ 5,
127
147
  'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
128
148
  );
129
149
  return;
@@ -203,7 +223,7 @@ describe('type: senderProfile', () => {
203
223
 
204
224
  assert.equal(
205
225
  testUtils.getAPIHistoryLength(),
206
- 10,
226
+ 11,
207
227
  'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
208
228
  );
209
229
  return;
@@ -238,7 +258,7 @@ describe('type: senderProfile', () => {
238
258
 
239
259
  assert.equal(
240
260
  testUtils.getAPIHistoryLength(),
241
- 10,
261
+ 11,
242
262
  'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
243
263
  );
244
264
  return;
@@ -273,7 +293,7 @@ describe('type: senderProfile', () => {
273
293
 
274
294
  assert.equal(
275
295
  testUtils.getAPIHistoryLength(),
276
- 10,
296
+ 11,
277
297
  'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
278
298
  );
279
299
  return;
@@ -26,7 +26,7 @@ describe('type: transactionalEmail', () => {
26
26
  const result = cache.getCache();
27
27
  assert.equal(
28
28
  result.transactionalEmail ? Object.keys(result.transactionalEmail).length : 0,
29
- 2,
29
+ 3,
30
30
  'unexpected number of transactionalEmail'
31
31
  );
32
32
  assert.deepEqual(
@@ -36,7 +36,7 @@ describe('type: transactionalEmail', () => {
36
36
  );
37
37
  assert.equal(
38
38
  testUtils.getAPIHistoryLength(),
39
- 13,
39
+ 14,
40
40
  'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
41
41
  );
42
42
  return;
@@ -57,7 +57,7 @@ describe('type: transactionalEmail', () => {
57
57
  const result = cache.getCache();
58
58
  assert.equal(
59
59
  result.transactionalEmail ? Object.keys(result.transactionalEmail).length : 0,
60
- 3,
60
+ 4,
61
61
  'unexpected number of transactionalEmails'
62
62
  );
63
63
  // confirm created item
@@ -75,7 +75,7 @@ describe('type: transactionalEmail', () => {
75
75
  // check number of API calls
76
76
  assert.equal(
77
77
  testUtils.getAPIHistoryLength(),
78
- 15,
78
+ 16,
79
79
  'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
80
80
  );
81
81
  return;
@@ -137,7 +137,7 @@ describe('type: transactionalEmail', () => {
137
137
  );
138
138
  assert.equal(
139
139
  testUtils.getAPIHistoryLength(),
140
- 13,
140
+ 14,
141
141
  'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
142
142
  );
143
143
  return;
@@ -172,8 +172,8 @@ describe('type: triggeredSend', () => {
172
172
  templatedItems.asset.map((item) => item.customerKey),
173
173
  [
174
174
  '{{{prefix}}}asset_htmlblock',
175
- '{{{prefix}}}htmlblock1',
176
175
  '{{{prefix}}}htmlblock 3 spaces',
176
+ '{{{prefix}}}htmlblock1',
177
177
  '{{{prefix}}}htmlblock2',
178
178
  ],
179
179
  'expected specific assets to be templated'
package/test/utils.js CHANGED
@@ -5,6 +5,7 @@ import { axiosInstance } from '../node_modules/sfmc-sdk/lib/util.js';
5
5
  import handler from '../lib/index.js';
6
6
  import auth from '../lib/util/auth.js';
7
7
  import { Util } from '../lib/util/util.js';
8
+ import cache from '../lib/util/cache.js';
8
9
  import ReplaceContentBlockReference from '../lib/util/replaceContentBlockReference.js';
9
10
 
10
11
  import { fileURLToPath } from 'node:url';
@@ -187,6 +188,7 @@ export function getExpectedFile(mid, type, action, ext) {
187
188
  * @returns {void}
188
189
  */
189
190
  export function mockSetup(isDeploy) {
191
+ cache.clearCache();
190
192
  // no need to execute this again if we ran it a 2nd time for deploy - already done in standard setup
191
193
  if (!isDeploy) {
192
194
  // reset all options to default
@@ -204,6 +206,7 @@ export function mockSetup(isDeploy) {
204
206
  errorLog: undefined,
205
207
  execute: undefined,
206
208
  filter: undefined,
209
+ fix: undefined,
207
210
  fixShared: undefined,
208
211
  fromRetrieve: undefined,
209
212
  json: undefined,
@@ -212,6 +215,8 @@ export function mockSetup(isDeploy) {
212
215
  matchName: undefined,
213
216
  noUpdate: undefined,
214
217
  publish: undefined,
218
+ purge: undefined,
219
+ range: undefined,
215
220
  referenceFrom: undefined,
216
221
  referenceTo: undefined,
217
222
  refresh: undefined,
@@ -246,6 +251,9 @@ export function mockSetup(isDeploy) {
246
251
  ),
247
252
  '.mcdevrc.json': fsmock.load(path.resolve(__dirname, 'mockRoot/.mcdevrc.json')),
248
253
  '.mcdev-auth.json': fsmock.load(path.resolve(__dirname, 'mockRoot/.mcdev-auth.json')),
254
+ '.mcdev-validations.js': fsmock.load(
255
+ path.resolve(__dirname, 'mockRoot/.mcdev-validations.js')
256
+ ),
249
257
  'boilerplate/config.json': fsmock.load(
250
258
  path.resolve(__dirname, '../boilerplate/config.json')
251
259
  ),
package/types/mcdev.d.js CHANGED
@@ -641,4 +641,16 @@ complex
641
641
  * @typedef {Object.<string, validationRule>} validationRuleList key=rule name
642
642
  */
643
643
 
644
+ /**
645
+ * @typedef {object} DomainVerificationItem
646
+ * @property {number} [enterpriseId] EID
647
+ * @property {number} [memberId] MID
648
+ * @property {string} [domain] domain or email address used in retrieve and create
649
+ * @property {string} [emailAddress] email address used in update call for isSendable field
650
+ * @property {'Verified'|'Pending'} [status] returned by retrieve
651
+ * @property {'SAP'|'UserDomain'|'PrivateDomain'|'RegisteredDomain'} [domainType] returned by retrieve and required for update call
652
+ * @property {boolean} isSendable automatically true upon creation. can be changed to false via update
653
+ * @property {string} [emailSendTime] e.g. ""2023-06-19T11:11:17.32""
654
+ */
655
+
644
656
  export default {};