mcdev 7.1.3 → 7.1.4

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 (126) hide show
  1. package/.github/ISSUE_TEMPLATE/bug.yml +1 -0
  2. package/@types/lib/Builder.d.ts.map +1 -1
  3. package/@types/lib/Deployer.d.ts.map +1 -1
  4. package/@types/lib/cli.d.ts.map +1 -1
  5. package/@types/lib/index.d.ts.map +1 -1
  6. package/@types/lib/metadataTypes/Asset.d.ts.map +1 -1
  7. package/@types/lib/metadataTypes/AttributeGroup.d.ts.map +1 -1
  8. package/@types/lib/metadataTypes/AttributeSet.d.ts.map +1 -1
  9. package/@types/lib/metadataTypes/Automation.d.ts.map +1 -1
  10. package/@types/lib/metadataTypes/Campaign.d.ts.map +1 -1
  11. package/@types/lib/metadataTypes/ContentArea.d.ts.map +1 -1
  12. package/@types/lib/metadataTypes/DataExtension.d.ts.map +1 -1
  13. package/@types/lib/metadataTypes/DataExtensionField.d.ts.map +1 -1
  14. package/@types/lib/metadataTypes/DataExtract.d.ts.map +1 -1
  15. package/@types/lib/metadataTypes/DataExtractType.d.ts.map +1 -1
  16. package/@types/lib/metadataTypes/Discovery.d.ts.map +1 -1
  17. package/@types/lib/metadataTypes/Email.d.ts.map +1 -1
  18. package/@types/lib/metadataTypes/Event.d.ts.map +1 -1
  19. package/@types/lib/metadataTypes/FileTransfer.d.ts.map +1 -1
  20. package/@types/lib/metadataTypes/Folder.d.ts.map +1 -1
  21. package/@types/lib/metadataTypes/ImportFile.d.ts.map +1 -1
  22. package/@types/lib/metadataTypes/Journey.d.ts.map +1 -1
  23. package/@types/lib/metadataTypes/List.d.ts.map +1 -1
  24. package/@types/lib/metadataTypes/MetadataType.d.ts.map +1 -1
  25. package/@types/lib/metadataTypes/MobileKeyword.d.ts.map +1 -1
  26. package/@types/lib/metadataTypes/MobileMessage.d.ts.map +1 -1
  27. package/@types/lib/metadataTypes/Query.d.ts.map +1 -1
  28. package/@types/lib/metadataTypes/Role.d.ts.map +1 -1
  29. package/@types/lib/metadataTypes/Script.d.ts.map +1 -1
  30. package/@types/lib/metadataTypes/SendClassification.d.ts.map +1 -1
  31. package/@types/lib/metadataTypes/SenderProfile.d.ts.map +1 -1
  32. package/@types/lib/metadataTypes/TransactionalEmail.d.ts.map +1 -1
  33. package/@types/lib/metadataTypes/TransactionalMessage.d.ts.map +1 -1
  34. package/@types/lib/metadataTypes/TransactionalPush.d.ts.map +1 -1
  35. package/@types/lib/metadataTypes/TransactionalSMS.d.ts.map +1 -1
  36. package/@types/lib/metadataTypes/TriggeredSend.d.ts.map +1 -1
  37. package/@types/lib/metadataTypes/User.d.ts.map +1 -1
  38. package/@types/lib/metadataTypes/Verification.d.ts.map +1 -1
  39. package/@types/lib/util/auth.d.ts.map +1 -1
  40. package/@types/lib/util/cache.d.ts.map +1 -1
  41. package/@types/lib/util/cli.d.ts.map +1 -1
  42. package/@types/lib/util/config.d.ts.map +1 -1
  43. package/@types/lib/util/devops.d.ts.map +1 -1
  44. package/@types/lib/util/file.d.ts.map +1 -1
  45. package/@types/lib/util/init.config.d.ts.map +1 -1
  46. package/@types/lib/util/init.d.ts.map +1 -1
  47. package/@types/lib/util/init.git.d.ts.map +1 -1
  48. package/@types/lib/util/init.npm.d.ts.map +1 -1
  49. package/@types/lib/util/replaceContentBlockReference.d.ts.map +1 -1
  50. package/@types/lib/util/util.d.ts.map +1 -1
  51. package/@types/types/mcdev.d.d.ts.map +1 -1
  52. package/lib/Builder.js +4 -0
  53. package/lib/Deployer.js +2 -0
  54. package/lib/cli.js +1 -0
  55. package/lib/index.js +31 -0
  56. package/lib/metadataTypes/Asset.js +30 -0
  57. package/lib/metadataTypes/AttributeGroup.js +2 -0
  58. package/lib/metadataTypes/AttributeSet.js +3 -0
  59. package/lib/metadataTypes/Automation.js +15 -0
  60. package/lib/metadataTypes/Campaign.js +1 -0
  61. package/lib/metadataTypes/ContentArea.js +2 -0
  62. package/lib/metadataTypes/DataExtension.js +12 -0
  63. package/lib/metadataTypes/DataExtensionField.js +8 -0
  64. package/lib/metadataTypes/DataExtract.js +3 -0
  65. package/lib/metadataTypes/DataExtractType.js +1 -0
  66. package/lib/metadataTypes/Discovery.js +1 -0
  67. package/lib/metadataTypes/Email.js +2 -0
  68. package/lib/metadataTypes/Event.js +4 -0
  69. package/lib/metadataTypes/FileTransfer.js +1 -0
  70. package/lib/metadataTypes/Folder.js +14 -2
  71. package/lib/metadataTypes/ImportFile.js +2 -0
  72. package/lib/metadataTypes/Journey.js +8 -0
  73. package/lib/metadataTypes/List.js +2 -0
  74. package/lib/metadataTypes/MetadataType.js +34 -0
  75. package/lib/metadataTypes/MobileKeyword.js +8 -0
  76. package/lib/metadataTypes/MobileMessage.js +7 -0
  77. package/lib/metadataTypes/Query.js +9 -0
  78. package/lib/metadataTypes/Role.js +1 -0
  79. package/lib/metadataTypes/Script.js +7 -0
  80. package/lib/metadataTypes/SendClassification.js +2 -0
  81. package/lib/metadataTypes/SenderProfile.js +2 -0
  82. package/lib/metadataTypes/TransactionalEmail.js +3 -0
  83. package/lib/metadataTypes/TransactionalMessage.js +3 -0
  84. package/lib/metadataTypes/TransactionalPush.js +1 -0
  85. package/lib/metadataTypes/TransactionalSMS.js +8 -0
  86. package/lib/metadataTypes/TriggeredSend.js +4 -0
  87. package/lib/metadataTypes/User.js +10 -0
  88. package/lib/metadataTypes/Verification.js +3 -0
  89. package/lib/retrieveChangelog.js +1 -0
  90. package/lib/util/auth.js +3 -0
  91. package/lib/util/cache.js +8 -0
  92. package/lib/util/cli.js +8 -0
  93. package/lib/util/config.js +2 -0
  94. package/lib/util/devops.js +2 -0
  95. package/lib/util/file.js +12 -0
  96. package/lib/util/init.config.js +5 -0
  97. package/lib/util/init.git.js +4 -0
  98. package/lib/util/init.js +4 -0
  99. package/lib/util/init.npm.js +1 -0
  100. package/lib/util/replaceContentBlockReference.js +1 -0
  101. package/lib/util/util.js +29 -0
  102. package/package.json +6 -6
  103. package/test/mockRoot/.mcdevrc.json +1 -1
  104. package/test/resourceFactory.js +15 -1
  105. package/test/resources/9999999/dataFolder/+retrieve-QAA-response.xml +387 -0
  106. package/test/resources/9999999/dataFolder/create-ContentType=dataextension,Name=my,ParentFolderID=2-response.xml +33 -0
  107. package/test/resources/9999999/dataFolder/create-ContentType=dataextension,Name=path,ParentFolderID=862002-response.xml +33 -0
  108. package/test/resources/9999999/dataFolder/create-ContentType=dataextension,Name=sub,ParentFolderID=862001-response.xml +33 -0
  109. package/test/resources/9999999/dataFolder/create-ContentType=dataextension,Name=subpath,ParentFolderID=862003-response.xml +33 -0
  110. package/test/resources/9999999/email/v1/category/post-response-parentCatId=290937,name=my,catType=automations.json +7 -0
  111. package/test/resources/9999999/email/v1/category/post-response-parentCatId=862100,name=sub,catType=automations.json +7 -0
  112. package/test/resources/9999999/email/v1/category/post-response-parentCatId=862101,name=path,catType=automations.json +7 -0
  113. package/test/resources/9999999/email/v1/category/post-response-parentCatId=862102,name=subpath,catType=automations.json +7 -0
  114. package/test/resources/9999999/folder-deploy/Data Extensions/my/sub/path/subpath.folder-meta.json +9 -0
  115. package/test/resources/9999999/folder-deploy/Data Extensions/my/sub/path.folder-meta.json +9 -0
  116. package/test/resources/9999999/folder-deploy/Data Extensions/my/sub.folder-meta.json +9 -0
  117. package/test/resources/9999999/folder-deploy/Data Extensions/my.folder-meta.json +9 -0
  118. package/test/resources/9999999/folder-deploy/my automations/my/sub/path/subpath.folder-meta.json +9 -0
  119. package/test/resources/9999999/folder-deploy/my automations/my/sub/path.folder-meta.json +9 -0
  120. package/test/resources/9999999/folder-deploy/my automations/my/sub.folder-meta.json +9 -0
  121. package/test/resources/9999999/folder-deploy/my automations/my.folder-meta.json +9 -0
  122. package/test/type.asset.test.js +4 -0
  123. package/test/type.folder.test.js +97 -0
  124. package/test/utils.js +44 -5
  125. package/types/mcdev.d.js +27 -0
  126. /package/test/resources/9999999/dataFolder/{retrieve-response-.xml → +retrieve-response.xml} +0 -0
@@ -30,6 +30,7 @@ async function getActualJson(customerKey, type, subtype, buName = 'testBU') {
30
30
  );
31
31
  }
32
32
  }
33
+
33
34
  /**
34
35
  * gets file from Retrieve folder
35
36
  *
@@ -52,6 +53,7 @@ async function getActualFile(customerKey, type, subtype, ext, filename, buName =
52
53
  return null;
53
54
  }
54
55
  }
56
+
55
57
  /**
56
58
  * gets file from Template folder
57
59
  *
@@ -71,6 +73,7 @@ async function getActualTemplateJson(customerKey, type, subtype) {
71
73
  );
72
74
  }
73
75
  }
76
+
74
77
  /**
75
78
  * gets file from Template folder
76
79
  *
@@ -113,6 +116,7 @@ async function getActualDeployJson(customerKey, type, subtype, buName = 'testBU'
113
116
  );
114
117
  }
115
118
  }
119
+
116
120
  /**
117
121
  * gets file from Deploy folder
118
122
  *
@@ -0,0 +1,97 @@
1
+ import * as chai from 'chai';
2
+ const assert = chai.assert;
3
+ // const expect = chai.expect;
4
+
5
+ import chaiFiles from 'chai-files';
6
+ import cache from '../lib/util/cache.js';
7
+ import * as testUtils from './utils.js';
8
+ import handler from '../lib/index.js';
9
+ chai.use(chaiFiles);
10
+
11
+ describe('type: folder', () => {
12
+ beforeEach(() => {
13
+ testUtils.mockSetup();
14
+ });
15
+
16
+ afterEach(() => {
17
+ testUtils.mockReset();
18
+ });
19
+
20
+ describe('Deploy ================', () => {
21
+ it('Should create automation & dataExtension folders', async () => {
22
+ // prepare
23
+ testUtils.copyToDeploy('folder-deploy', 'folder');
24
+ await testUtils.copyFile(
25
+ 'dataFolder/+retrieve-response.xml',
26
+ 'dataFolder/retrieve-response.xml'
27
+ );
28
+ await testUtils.copyFile(
29
+ 'dataFolder/+retrieve-QAA-response.xml',
30
+ 'dataFolder/retrieve-QAA-response.xml'
31
+ );
32
+
33
+ const deployed = await handler.deploy('testInstance/testBU', ['folder']);
34
+ // THEN
35
+ assert.equal(process.exitCode, 0, 'deploy should not have thrown an error');
36
+ // get results from cache
37
+ const cached = cache.getCache();
38
+ assert.equal(
39
+ cached.folder ? Object.keys(cached.folder).length : 0,
40
+ 38,
41
+ 'unexpected number of folders in cache'
42
+ );
43
+
44
+ // check what was deployed
45
+ assert.deepEqual(
46
+ deployed['testInstance/testBU']?.folder
47
+ ? Object.values(deployed['testInstance/testBU']?.folder).map((f) => f.Path)
48
+ : null,
49
+ [
50
+ 'Data Extensions/my',
51
+ 'Data Extensions/my/sub',
52
+ 'Data Extensions/my/sub/path',
53
+ 'Data Extensions/my/sub/path/subpath',
54
+ 'my automations/my',
55
+ 'my automations/my/sub',
56
+ 'my automations/my/sub/path',
57
+ 'my automations/my/sub/path/subpath',
58
+ ],
59
+ 'unexpected deployed folders'
60
+ );
61
+ // get callouts
62
+ const createRestCallouts = testUtils.getRestCallout('post', '/email/v1/category', true);
63
+ // confirm created item
64
+ assert.deepEqual(
65
+ createRestCallouts,
66
+ [
67
+ { parentCatId: 290937, name: 'my', catType: 'automations' },
68
+ { parentCatId: 862100, name: 'sub', catType: 'automations' },
69
+ { parentCatId: 862101, name: 'path', catType: 'automations' },
70
+ { parentCatId: 862102, name: 'subpath', catType: 'automations' },
71
+ ],
72
+ 'create-payload JSON was not equal expected'
73
+ );
74
+
75
+ const createSoapCallouts = testUtils.getSoapCallouts('Create', 'DataFolder');
76
+ // confirm created item
77
+ assert.deepEqual(
78
+ createSoapCallouts,
79
+ [
80
+ '<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><Body><CreateRequest xmlns="http://exacttarget.com/wsdl/partnerAPI"><Objects xsi:type="DataFolder"><Name>my</Name><Description></Description><ContentType>dataextension</ContentType><IsActive>true</IsActive><IsEditable>true</IsEditable><AllowChildren>true</AllowChildren><ParentFolder><ID>2</ID></ParentFolder></Objects></CreateRequest></Body><Header><fueloauth xmlns="http://exacttarget.com">9999999</fueloauth></Header></Envelope>',
81
+ '<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><Body><CreateRequest xmlns="http://exacttarget.com/wsdl/partnerAPI"><Objects xsi:type="DataFolder"><Name>sub</Name><Description></Description><ContentType>dataextension</ContentType><IsActive>true</IsActive><IsEditable>true</IsEditable><AllowChildren>true</AllowChildren><ParentFolder><ID>862001</ID></ParentFolder></Objects></CreateRequest></Body><Header><fueloauth xmlns="http://exacttarget.com">9999999</fueloauth></Header></Envelope>',
82
+ '<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><Body><CreateRequest xmlns="http://exacttarget.com/wsdl/partnerAPI"><Objects xsi:type="DataFolder"><Name>path</Name><Description></Description><ContentType>dataextension</ContentType><IsActive>true</IsActive><IsEditable>true</IsEditable><AllowChildren>true</AllowChildren><ParentFolder><ID>862002</ID></ParentFolder></Objects></CreateRequest></Body><Header><fueloauth xmlns="http://exacttarget.com">9999999</fueloauth></Header></Envelope>',
83
+ '<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><Body><CreateRequest xmlns="http://exacttarget.com/wsdl/partnerAPI"><Objects xsi:type="DataFolder"><Name>subpath</Name><Description></Description><ContentType>dataextension</ContentType><IsActive>true</IsActive><IsEditable>true</IsEditable><AllowChildren>true</AllowChildren><ParentFolder><ID>862003</ID></ParentFolder></Objects></CreateRequest></Body><Header><fueloauth xmlns="http://exacttarget.com">9999999</fueloauth></Header></Envelope>',
84
+ ],
85
+ 'create-payload XL was not equal expected'
86
+ );
87
+
88
+ // check number of API calls
89
+ assert.equal(
90
+ testUtils.getAPIHistoryLength(),
91
+ 10,
92
+ 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
93
+ );
94
+ return;
95
+ });
96
+ });
97
+ });
package/test/utils.js CHANGED
@@ -33,6 +33,21 @@ const authResources = File.readJsonSync(path.join(__dirname, './resources/auth.j
33
33
  export async function copyFile(from, to, mid = '9999999') {
34
34
  return File.copyFileSimple(`./test/resources/${mid}/${from}`, `./test/resources/${mid}/${to}`);
35
35
  }
36
+
37
+ /**
38
+ * gets file from Retrieve folder
39
+ *
40
+ * @param {string} from source path (starting in bu folder)
41
+ * @param {string} to target path (starting in bu folder)
42
+ * @param {string} [mid] used when we need to test on ParentBU
43
+ * @param {string} [buName] used when we need to test on ParentBU
44
+ * @returns {void} -
45
+ */
46
+ export function copyToDeploy(from, to, mid = '9999999', buName = 'testBU') {
47
+ console.log(`Copying ${from} to deploy folder`); // eslint-disable-line no-console
48
+ File.copySync(`./test/resources/${mid}/${from}`, `./deploy/testInstance/${buName}/${to}`);
49
+ }
50
+
36
51
  /**
37
52
  * gets file from Retrieve folder
38
53
  *
@@ -61,6 +76,7 @@ export function getActualDoc(customerKey, type, buName = 'testBU') {
61
76
  'utf8'
62
77
  );
63
78
  }
79
+
64
80
  /**
65
81
  * gets file from Retrieve folder
66
82
  *
@@ -79,6 +95,7 @@ export async function getActualFile(customerKey, type, ext, buName = 'testBU') {
79
95
  return null;
80
96
  }
81
97
  }
98
+
82
99
  /**
83
100
  * gets file from Deploy folder
84
101
  *
@@ -92,6 +109,7 @@ export function getActualDeployJson(customerKey, type, buName = 'testBU') {
92
109
  `./deploy/testInstance/${buName}/${type}/${customerKey}.${type}-meta.json`
93
110
  );
94
111
  }
112
+
95
113
  /**
96
114
  * gets file from Deploy folder
97
115
  *
@@ -107,6 +125,7 @@ export function getActualDeployFile(customerKey, type, ext, buName = 'testBU') {
107
125
  'utf8'
108
126
  );
109
127
  }
128
+
110
129
  /**
111
130
  * gets file from Template folder
112
131
  *
@@ -117,6 +136,7 @@ export function getActualDeployFile(customerKey, type, ext, buName = 'testBU') {
117
136
  export function getActualTemplateJson(customerKey, type) {
118
137
  return File.readJSON(`./template/${type}/${customerKey}.${type}-meta.json`);
119
138
  }
139
+
120
140
  /**
121
141
  * gets file from Template folder
122
142
  *
@@ -128,6 +148,7 @@ export function getActualTemplateJson(customerKey, type) {
128
148
  export function getActualTemplateFile(customerKey, type, ext) {
129
149
  return File.readFile(`./template/${type}/${customerKey}.${type}-meta.${ext}`, 'utf8');
130
150
  }
151
+
131
152
  /**
132
153
  * gets file from resources folder which should be used for comparison
133
154
  *
@@ -139,6 +160,7 @@ export function getActualTemplateFile(customerKey, type, ext) {
139
160
  export function getExpectedJson(mid, type, action) {
140
161
  return File.readJSON(`./test/resources/${mid}/${type}/${action}-expected.json`);
141
162
  }
163
+
142
164
  /**
143
165
  * gets file from resources folder which should be used for comparison
144
166
  *
@@ -151,6 +173,7 @@ export function getExpectedJson(mid, type, action) {
151
173
  export function getExpectedFile(mid, type, action, ext) {
152
174
  return File.readFile(`./test/resources/${mid}/${type}/${action}-expected.${ext}`, 'utf8');
153
175
  }
176
+
154
177
  /**
155
178
  * setup mocks for API and FS
156
179
  *
@@ -267,6 +290,7 @@ export function mockReset() {
267
290
  fsmock.restore();
268
291
  apimock.restore();
269
292
  }
293
+
270
294
  /**
271
295
  * helper to return amount of api callouts
272
296
  *
@@ -280,6 +304,7 @@ export function getAPIHistoryLength(includeToken) {
280
304
  }
281
305
  return historyArr.filter((item) => item.url !== '/v2/token').length;
282
306
  }
307
+
283
308
  /**
284
309
  * helper to return api history
285
310
  *
@@ -288,13 +313,15 @@ export function getAPIHistoryLength(includeToken) {
288
313
  export function getAPIHistory() {
289
314
  return apimock.history;
290
315
  }
316
+
291
317
  /**
292
318
  *
293
319
  * @param {'patch'|'delete'|'post'|'get'|'put'} method http method
294
320
  * @param {string} url url without domain, end on % if you want to search with startsWith()
321
+ * @param {boolean} returnAll useful for post requests that often have multiple callouts with the same url
295
322
  * @returns {object} json payload of the request
296
323
  */
297
- export function getRestCallout(method, url) {
324
+ export function getRestCallout(method, url, returnAll = false) {
298
325
  if (!apimock.history[method]?.length) {
299
326
  console.log(`${tWarn} No history for method ${method}.`); // eslint-disable-line no-console
300
327
  const methods = Object.keys(apimock.history)
@@ -304,9 +331,18 @@ export function getRestCallout(method, url) {
304
331
  return null;
305
332
  }
306
333
  const subset = apimock.history[method];
307
- const myCallout = subset.find((item) =>
308
- url.endsWith('%') ? item.url.startsWith(url.slice(0, -1)) : item.url === url
309
- );
334
+
335
+ /**
336
+ * helper for filter/find
337
+ *
338
+ * @param {any} item history item
339
+ * @returns {boolean} if item matches
340
+ */
341
+ function findCallout(item) {
342
+ return url.endsWith('%') ? item.url.startsWith(url.slice(0, -1)) : item.url === url;
343
+ }
344
+
345
+ const myCallout = returnAll ? subset.filter(findCallout) : subset.find(findCallout);
310
346
  if (!myCallout) {
311
347
  console.error(`${tWarn} No callout found for ${method} ${url}`); // eslint-disable-line no-console
312
348
  const urls = [...new Set(subset.map((el) => el.url))].join('\n- ');
@@ -317,8 +353,9 @@ export function getRestCallout(method, url) {
317
353
  console.error(`Available unique urls in method ${method}:\n- ${urls}`); // eslint-disable-line no-console
318
354
  return null;
319
355
  }
320
- return JSON.parse(myCallout.data);
356
+ return returnAll ? myCallout.map((el) => JSON.parse(el.data)) : JSON.parse(myCallout.data);
321
357
  }
358
+
322
359
  /**
323
360
  *
324
361
  * @param {'Schedule'|'Retrieve'|'Create'|'Update'|'Delete'|'Describe'|'Execute'} requestAction soap request types
@@ -349,6 +386,7 @@ export function getSoapCallouts(requestAction, objectType) {
349
386
  }
350
387
  return myCallout;
351
388
  }
389
+
352
390
  /**
353
391
  * helper to return most important fields for each api call
354
392
  *
@@ -366,6 +404,7 @@ export function getAPIHistoryDebug() {
366
404
  });
367
405
  return historyArr;
368
406
  }
407
+
369
408
  /**
370
409
  * helper to return most important fields for each api call
371
410
  *
package/types/mcdev.d.js CHANGED
@@ -8,6 +8,7 @@
8
8
  * @property {string} [businessUnit] name of the BU to interact with
9
9
  * @property {string} [credential] name of the credential to interact with
10
10
  */
11
+
11
12
  /**
12
13
  * @typedef {Object.<string, string>} TemplateMap
13
14
  * @typedef {'asset'|'asset-archive'|'asset-asset'|'asset-audio'|'asset-block'|'asset-code'|'asset-document'|'asset-image'|'asset-message'|'asset-other'|'asset-rawimage'|'asset-template'|'asset-textfile'|'asset-video'|'attributeGroup'|'attributeSet'|'automation'|'campaign'|'contentArea'|'dataExtension'|'dataExtensionField'|'dataExtensionTemplate'|'dataExtract'|'dataExtractType'|'discovery'|'deliveryProfile'|'email'|'emailSend'|'event'|'fileLocation'|'fileTransfer'|'filter'|'folder'|'importFile'|'journey'|'list'|'mobileCode'|'mobileKeyword'|'mobileMessage'|'query'|'role'|'script'|'sendClassification'|'senderProfile'|'transactionalEmail'|'transactionalPush'|'transactionalSMS'|'triggeredSend'|'user'|'verification'} SupportedMetadataTypes
@@ -31,6 +32,7 @@
31
32
  * @property {CodeExtract[]} codeArr list of code snippets in this item
32
33
  * @property {string[]} subFolder mostly set to null, otherwise list of subfolders
33
34
  */
35
+
34
36
  /**
35
37
  * @typedef {object} CodeExtract
36
38
  * @property {string[]} subFolder mostly set to null, otherwise subfolders path split into elements
@@ -39,6 +41,7 @@
39
41
  * @property {string} content file content
40
42
  * @property {'base64'} [encoding] optional for binary files
41
43
  */
44
+
42
45
  /**
43
46
  * @typedef {object} QueryItem
44
47
  * @property {string} name name
@@ -59,6 +62,7 @@
59
62
  * @property {string} [queryDefinitionId] Object ID of query
60
63
  * @typedef {Object.<string, QueryItem>} QueryMap
61
64
  */
65
+
62
66
  /**
63
67
  * @typedef {object} ScriptItem
64
68
  * @property {string} name name
@@ -71,11 +75,13 @@
71
75
  * @property {string} r__folder_Path folder path in which this DE is saved
72
76
  * @typedef {Object.<string, ScriptItem>} ScriptMap
73
77
  */
78
+
74
79
  /**
75
80
  * @typedef {Object.<string, any>} AssetItem
76
81
  * @typedef {Object.<string, AssetItem>} AssetMap
77
82
  * @typedef {'archive'|'asset'|'audio'|'block'|'code'|'document'|'image'|'message'|'other'|'rawimage'|'template'|'textfile'|'video'} AssetSubType
78
83
  */
84
+
79
85
  /**
80
86
  * @typedef {object} DataExtensionFieldItem
81
87
  * @property {string} [ObjectID] id
@@ -93,9 +99,11 @@
93
99
  * @property {number|string} MaxLength field length
94
100
  * @property {string} Scale the number of places after the decimal that the field can hold; example: "0","1", ...
95
101
  */
102
+
96
103
  /**
97
104
  * @typedef {Object.<string, DataExtensionFieldItem>} DataExtensionFieldMap key: name of field, value: DataExtensionFieldItem
98
105
  */
106
+
99
107
  /**
100
108
  * @typedef {object} DataExtensionItem
101
109
  * @property {string} CustomerKey key
@@ -126,9 +134,11 @@
126
134
  * @property {boolean} ResetRetentionPeriodOnImport ?
127
135
  * @property {boolean} [DeleteAtEndOfRetentionPeriod] true for retention policy allRecords
128
136
  */
137
+
129
138
  /**
130
139
  * @typedef {Object.<string, DataExtensionItem>} DataExtensionMap
131
140
  */
141
+
132
142
  /**
133
143
  * @typedef {object} UserDocument
134
144
  * @property {'User'|'Installed Package'|'Inactivated User'} TYPE -
@@ -170,10 +180,12 @@
170
180
  * @property {object} [SsoIdentity] -
171
181
  * @property {Array|object} [SsoIdentities] -
172
182
  */
183
+
173
184
  /**
174
185
  * @typedef {{before:UserDocument,after:UserDocument}} UserDocumentDiff
175
186
  * @typedef {Object.<string, UserDocument>} UserDocumentMap key=customer key
176
187
  */
188
+
177
189
  /**
178
190
  * @typedef {object} UserDocumentDocumentHelper
179
191
  * @property {string} ActiveFlagDocs docs: user.ActiveFlag === true ? '✓' : '-'
@@ -187,6 +199,7 @@
187
199
  * @property {string} IsLockedDocs docs: if the user cannot login
188
200
  * @typedef {UserDocument & UserDocumentDocumentHelper} UserDocumentDocument
189
201
  */
202
+
190
203
  /**
191
204
  * @typedef {object} AccountUserConfiguration
192
205
  * @property {object} Client wrapper
@@ -211,6 +224,7 @@
211
224
  * @property {number} [displayOrder] order within step; starts with 1 or higher number
212
225
  * @property {string} r__type see this.definition.activityTypeMapping
213
226
  */
227
+
214
228
  /**
215
229
  * @typedef {object} AutomationStep
216
230
  * @property {string} name description
@@ -219,6 +233,7 @@
219
233
  * @property {number} [stepNumber] step iterator, automatically set during deployment
220
234
  * @property {AutomationActivity[]} activities -
221
235
  */
236
+
222
237
  /**
223
238
  * @typedef {object} AutomationSchedule REST format
224
239
  * @property {number} typeId equals schedule.scheduleTypeId; upsert endpoint requires scheduleTypeId. retrieve endpoint returns typeId
@@ -233,6 +248,7 @@
233
248
  * @property {any} [scheduledTime] ?
234
249
  * @property {string} [scheduledStatus] ?
235
250
  */
251
+
236
252
  /**
237
253
  * @typedef {object} AutomationScheduleSoap SOAP format
238
254
  * @property {string} [RecurrenceType] 'Minutely'|'Hourly'|'Daily'|'Weekly'|'Monthly'|'Yearly'
@@ -261,6 +277,7 @@
261
277
  * @property {'EndOn'|'EndAfter'} RecurrenceRangeType set to 'EndOn' if AutomationSchedule.icalRecur contains 'UNTIL'; otherwise to 'EndAfter'
262
278
  * @property {number} [Occurrences] only exists if RecurrenceRangeType=='EndAfter'
263
279
  */
280
+
264
281
  /**
265
282
  * @typedef {object} AutomationItem
266
283
  * @property {string} id Object Id
@@ -296,6 +313,7 @@
296
313
  * @property {string} [r__folder_Path] folder path
297
314
  * @property {string} [categoryId] holds folder ID, replaced with r__folder_Path during retrieve
298
315
  */
316
+
299
317
  /**
300
318
  * @typedef {object} VerificationItem
301
319
  * @property {string} dataVerificationDefinitionId ID / Key
@@ -331,6 +349,7 @@
331
349
  * @property {string} _businessUnit mcdev business unit name inside of _credential
332
350
  * @typedef {import('simple-git').DiffResultTextFile & McdevDeltaPkgItem} DeltaPkgItem
333
351
  */
352
+
334
353
  /**
335
354
  * @typedef {import('sfmc-sdk/util').RestError} RestError
336
355
  * @typedef {import('sfmc-sdk/util').SOAPError} SOAPError
@@ -368,30 +387,35 @@
368
387
  complex
369
388
  * @property {boolean} [QueryAllAccounts] all BUs or just one
370
389
  */
390
+
371
391
  /**
372
392
  * @typedef {object} SoapFilterSimple
373
393
  * @property {string} property field
374
394
  * @property {'equals'|'notEquals'|'isNull'|'isNotNull'|'greaterThan'|'lessThan'|'greaterThanOrEqual'|'lessThanOrEqual'|'between'|'IN'|'in'|'like'} simpleOperator various options
375
395
  * @property {string | number | boolean | string[] | number[]} [value] field value
376
396
  */
397
+
377
398
  /**
378
399
  * @typedef {object} SoapFilterComplex
379
400
  * @property {SoapSDKFilter} leftOperand string for simple or a new filter-object for complex
380
401
  * @property {'AND'|'OR'} logicalOperator various options
381
402
  * @property {SoapSDKFilter} rightOperand string for simple or a new filter-object for complex; omit for isNull and isNotNull
382
403
  */
404
+
383
405
  /**
384
406
  * @typedef {object} SoapSDKFilterSimple
385
407
  * @property {SoapFilterSimple["property"]} leftOperand string for simple or a new filter-object for complex
386
408
  * @property {SoapFilterSimple["simpleOperator"]} operator various options
387
409
  * @property {SoapFilterSimple["value"]} [rightOperand] string for simple or a new filter-object for complex; omit for isNull and isNotNull
388
410
  */
411
+
389
412
  /**
390
413
  * @typedef {object} SoapSDKFilterComplex
391
414
  * @property {SoapFilterComplex["leftOperand"]} leftOperand string for simple or a new filter-object for complex
392
415
  * @property {SoapFilterComplex["logicalOperator"]} operator various options
393
416
  * @property {SoapFilterComplex["rightOperand"]} rightOperand string for simple or a new filter-object for complex; omit for isNull and isNotNull
394
417
  */
418
+
395
419
  /**
396
420
  * @typedef {SoapSDKFilterSimple | SoapSDKFilterComplex} SoapSDKFilter
397
421
  */
@@ -414,6 +438,7 @@ complex
414
438
  * @property {'AND'|'OR'} logicalOperator various options
415
439
  * @property {SoapSDKFilter | AssetFilterSimple} [rightOperand] string for simple or a new filter-object for complex; omit for isNull and isNotNull
416
440
  */
441
+
417
442
  /**
418
443
  * @typedef {object} AssetFilterSimple
419
444
  * @property {string} property field
@@ -448,12 +473,14 @@ complex
448
473
  * @property {(ex:SDKError,message?:string)=>void} errorStack print error with trace message
449
474
  * @typedef {import('winston').Logger & McdevLogger} Logger
450
475
  */
476
+
451
477
  /**
452
478
  * @typedef {{id: number, key: string, name: string}} AssetItemSimple
453
479
  * @typedef {Object.<string, AssetItemSimple>} AssetItemSimpleMap
454
480
  * @typedef {Object.<number, AssetItemSimple>} AssetItemIdSimpleMap
455
481
  * @typedef {'id'|'key'|'name'} ContentBlockConversionTypes
456
482
  */
483
+
457
484
  /**
458
485
  * @typedef {object} ExplainType
459
486
  * @property {string} name readable name of type