mcdev 8.3.0 → 8.4.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 (82) hide show
  1. package/.github/ISSUE_TEMPLATE/bug.yml +2 -0
  2. package/.github/workflows/close_issues_on_merge.yml +4 -0
  3. package/.github/workflows/coverage-base-update.yml +2 -2
  4. package/.github/workflows/coverage-develop-branch.yml +1 -1
  5. package/.github/workflows/coverage-main-branch.yml +1 -1
  6. package/.github/workflows/coverage.yml +2 -2
  7. package/.github/workflows/npm-publish.yml +0 -2
  8. package/@types/lib/index.d.ts.map +1 -1
  9. package/@types/lib/metadataTypes/DataFilter.d.ts +19 -9
  10. package/@types/lib/metadataTypes/DataFilter.d.ts.map +1 -1
  11. package/@types/lib/metadataTypes/DataFilterHidden.d.ts +1 -0
  12. package/@types/lib/metadataTypes/DataFilterHidden.d.ts.map +1 -1
  13. package/@types/lib/metadataTypes/FileLocation.d.ts +74 -0
  14. package/@types/lib/metadataTypes/FileLocation.d.ts.map +1 -1
  15. package/@types/lib/metadataTypes/Journey.d.ts +6 -0
  16. package/@types/lib/metadataTypes/Journey.d.ts.map +1 -1
  17. package/@types/lib/metadataTypes/MetadataType.d.ts +6 -0
  18. package/@types/lib/metadataTypes/MetadataType.d.ts.map +1 -1
  19. package/@types/lib/metadataTypes/Script.d.ts +14 -0
  20. package/@types/lib/metadataTypes/Script.d.ts.map +1 -1
  21. package/@types/lib/metadataTypes/definitions/DataFilter.definition.d.ts +1 -0
  22. package/@types/lib/metadataTypes/definitions/DataFilterHidden.definition.d.ts +1 -0
  23. package/@types/lib/metadataTypes/definitions/FileLocation.definition.d.ts +62 -4
  24. package/@types/lib/metadataTypes/definitions/Journey.definition.d.ts +6 -0
  25. package/@types/lib/metadataTypes/definitions/Script.definition.d.ts +10 -0
  26. package/lib/cli.js +6 -0
  27. package/lib/index.js +1 -0
  28. package/lib/metadataTypes/DataFilter.js +82 -27
  29. package/lib/metadataTypes/Event.js +2 -2
  30. package/lib/metadataTypes/FileLocation.js +204 -4
  31. package/lib/metadataTypes/Journey.js +72 -45
  32. package/lib/metadataTypes/MetadataType.js +14 -0
  33. package/lib/metadataTypes/Script.js +16 -0
  34. package/lib/metadataTypes/definitions/DataFilter.definition.js +1 -0
  35. package/lib/metadataTypes/definitions/DataFilterHidden.definition.js +1 -0
  36. package/lib/metadataTypes/definitions/FileLocation.definition.js +52 -7
  37. package/lib/metadataTypes/definitions/Journey.definition.js +6 -0
  38. package/lib/metadataTypes/definitions/Script.definition.js +6 -0
  39. package/package.json +11 -11
  40. package/test/general.test.js +11 -11
  41. package/test/mockRoot/.mcdevrc.json +1 -1
  42. package/test/mockRoot/deploy/testInstance/testBU/asset/block/{testExisting_asset_htmlblock-matchName-fail.asset-block-meta.json → testExisting_asset_html-matchNamFail.asset-block-meta.json} +1 -1
  43. package/test/mockRoot/deploy/testInstance/testBU/asset/block/{testExisting_asset_htmlblock-matchName.asset-block-meta.json → testExisting_asset_html-matchName.asset-block-meta.json} +1 -1
  44. package/test/mockRoot/deploy/testInstance/testBU/asset/block/{testExisting_asset_htmlblock-matchName-create.asset-block-meta.json → testExisting_asset_html-matchNameAdd.asset-block-meta.json} +3 -3
  45. package/test/mockRoot/deploy/testInstance/testBU/fileLocation/ExactTarget Enhanced FTP.fileLocation-meta.json +5 -0
  46. package/test/mockRoot/deploy/testInstance/testBU/fileLocation/testExisting_fileLocation_aws.fileLocation-meta.json +14 -0
  47. package/test/mockRoot/deploy/testInstance/testBU/fileLocation/testExisting_fileLocation_exsftp.fileLocation-meta.json +12 -0
  48. package/test/resourceFactory.js +9 -2
  49. package/test/resources/9999999/asset/v1/content/assets/1295064/patch-response.json +1 -1
  50. package/test/resources/9999999/automation/v1/ftplocations/get-response.json +26 -1
  51. package/test/resources/9999999/automation/v1/scripts/39f6a488-20eb-4ba0-b0b9-023725b574e4/get-response.json +10 -0
  52. package/test/resources/9999999/automation/v1/scripts/39f6a488-20eb-4ba0-b0b9-023725b574e4/patch-response.json +2 -2
  53. package/test/resources/9999999/data/v1/filetransferlocation/Salesforce%20Objects%20%26%20Reports/get-response.json +4 -0
  54. package/test/resources/9999999/data/v1/filetransferlocation/testExisting_fileLocation_aws/patch-response.json +18 -0
  55. package/test/resources/9999999/data/v1/filetransferlocation/testExisting_fileLocation_azure/delete-response.json +4 -0
  56. package/test/resources/9999999/data/v1/filetransferlocation/testExisting_fileLocation_azure/get-response.json +18 -0
  57. package/test/resources/9999999/data/v1/filetransferlocation/testExisting_fileLocation_exsftp/patch-response.json +16 -0
  58. package/test/resources/9999999/data/v1/filetransferlocations/get-response.json +59 -0
  59. package/test/resources/9999999/fileLocation/build-expected.json +14 -0
  60. package/test/resources/9999999/fileLocation/get-aws-expected.json +14 -0
  61. package/test/resources/9999999/fileLocation/get-azure-expected.json +14 -0
  62. package/test/resources/9999999/fileLocation/get-eftp-expected.json +5 -0
  63. package/test/resources/9999999/fileLocation/get-exsftp-expected.json +12 -0
  64. package/test/resources/9999999/fileLocation/get-gcp-expected.json +10 -0
  65. package/test/resources/9999999/fileLocation/get-sor-expected.json +5 -0
  66. package/test/resources/9999999/fileLocation/patch-aws-expected.json +14 -0
  67. package/test/resources/9999999/fileLocation/patch-exsftp-expected.json +12 -0
  68. package/test/resources/9999999/fileLocation/template-expected.json +14 -0
  69. package/test/resources/9999999/interaction/v1/interactions/get-response-status=Published.json +40 -0
  70. package/test/type.asset.test.js +7 -7
  71. package/test/type.automation.test.js +14 -14
  72. package/test/type.dataFilter.test.js +10 -2
  73. package/test/type.fileLocation.test.js +279 -0
  74. package/test/type.fileTransfer.test.js +4 -4
  75. package/test/type.filter.test.js +9 -2
  76. package/test/type.importFile.test.js +5 -5
  77. package/test/type.journey.test.js +26 -0
  78. package/test/type.query.test.js +2 -2
  79. package/test/type.script.test.js +1 -1
  80. /package/test/mockRoot/deploy/testInstance/testBU/asset/block/{testExisting_asset_htmlblock-matchName-create.asset-block-meta.html → testExisting_asset_html-matchNamFail.asset-block-meta.html} +0 -0
  81. /package/test/mockRoot/deploy/testInstance/testBU/asset/block/{testExisting_asset_htmlblock-matchName-fail.asset-block-meta.html → testExisting_asset_html-matchName.asset-block-meta.html} +0 -0
  82. /package/test/mockRoot/deploy/testInstance/testBU/asset/block/{testExisting_asset_htmlblock-matchName.asset-block-meta.html → testExisting_asset_html-matchNameAdd.asset-block-meta.html} +0 -0
@@ -50,6 +50,11 @@ class Journey extends MetadataType {
50
50
 
51
51
  let singleKey = '';
52
52
  let mode = 'all';
53
+ const additionalParams = new URLSearchParams();
54
+ if (Util.OPTIONS.onlyPublished) {
55
+ Util.logger.info(' - Retrieving only published versions of journeys');
56
+ additionalParams.set('status', 'Published');
57
+ }
53
58
  if (key) {
54
59
  if (key.startsWith('%23')) {
55
60
  // correct the format
@@ -74,7 +79,7 @@ class Journey extends MetadataType {
74
79
  }
75
80
  mode = 'id';
76
81
  } else if (key.startsWith('name:')) {
77
- singleKey = '?nameOrDescription=' + encodeURIComponent(key.slice(5));
82
+ additionalParams.set('nameOrDescription', key.slice(5));
78
83
  mode = 'name';
79
84
  } else {
80
85
  // assume actual key was provided
@@ -85,7 +90,10 @@ class Journey extends MetadataType {
85
90
 
86
91
  try {
87
92
  const uri = `/interaction/v1/interactions/`;
88
- if ((singleKey && (mode === 'key' || mode === 'id')) || !retrieveDir) {
93
+ if (
94
+ (!Util.OPTIONS.onlyPublished && singleKey && (mode === 'key' || mode === 'id')) ||
95
+ !retrieveDir
96
+ ) {
89
97
  // full details for retrieve, only base data for caching; reduces caching time from minutes to seconds
90
98
  const extras = retrieveDir && singleKey ? extrasDefault : '';
91
99
 
@@ -97,13 +105,12 @@ class Journey extends MetadataType {
97
105
  key
98
106
  );
99
107
  } else {
108
+ const url =
109
+ uri + (additionalParams.size > 0 ? '?' + additionalParams.toString() : '');
100
110
  // retrieve all
101
111
  const results = this.definition.restPagination
102
- ? await this.client.rest.getBulk(
103
- uri + (mode === 'name' ? singleKey : ''),
104
- this.definition.restPageSize || 500
105
- )
106
- : await this.client.rest.get(uri + (mode === 'name' ? singleKey : ''));
112
+ ? await this.client.rest.getBulk(url, this.definition.restPageSize || 500)
113
+ : await this.client.rest.get(url);
107
114
 
108
115
  if (results.items?.length) {
109
116
  // empty results will come back without "items" defined
@@ -115,51 +122,71 @@ class Journey extends MetadataType {
115
122
  }
116
123
  // full details for retrieve
117
124
  const extras = extrasDefault;
125
+ let details = [];
118
126
  let parsed;
119
127
  if (retrieveDir) {
120
128
  const searchName = mode === 'name' ? key.slice(5) : null;
121
129
  const foundKey = [];
130
+ let journey;
122
131
  // get extra details for saving this
123
- const details = results.items
124
- ? await Promise.all(
125
- results.items.map(async (a) => {
126
- if (mode === 'name') {
127
- // when filtering by name, the API in fact does a LIKE search with placeholders left and right of the search term - and also searches the description field.
128
- if (searchName === a[this.definition.nameField]) {
129
- foundKey.push(a[this.definition.keyField]);
130
- } else {
131
- // skip because the name does not match
132
+ if (Util.OPTIONS.onlyPublished && mode === 'key') {
133
+ journey = results.items.find(
134
+ (a) => a[this.definition.keyField] === singleKey.slice(4)
135
+ );
136
+ } else if (Util.OPTIONS.onlyPublished && mode === 'id') {
137
+ journey = results.items.find(
138
+ (a) => a[this.definition.idField] === singleKey
139
+ );
140
+ } else {
141
+ details = results.items
142
+ ? await Promise.all(
143
+ results.items.map(async (a) => {
144
+ if (mode === 'name') {
145
+ // when filtering by name, the API in fact does a LIKE search with placeholders left and right of the search term - and also searches the description field.
146
+ if (searchName === a[this.definition.nameField]) {
147
+ foundKey.push(a[this.definition.keyField]);
148
+ } else {
149
+ // skip because the name does not match
150
+ return null;
151
+ }
152
+ }
153
+ try {
154
+ return await this.client.rest.get(
155
+ `${uri}key:${a[this.definition.keyField]}?extras=${extras}` +
156
+ `&versionNumber=${a.version}`
157
+ );
158
+ } catch (ex) {
159
+ // if we do get here, we should log the error and continue instead of failing to download all automations
160
+ Util.logger.warn(
161
+ ` ☇ skipping ${this.definition.type} ${
162
+ a[this.definition.nameField]
163
+ } (${a[this.definition.keyField]}): ${ex.message} (${
164
+ ex.code
165
+ })${
166
+ ex.endpoint
167
+ ? Util.getGrayMsg(
168
+ ' - ' +
169
+ ex.endpoint.split(
170
+ 'rest.marketingcloudapis.com'
171
+ )[1]
172
+ )
173
+ : ''
174
+ }`
175
+ );
132
176
  return null;
133
177
  }
134
- }
135
- try {
136
- return await this.client.rest.get(
137
- `${uri}key:${a[this.definition.keyField]}?extras=${extras}` +
138
- `&versionNumber=${a.version}`
139
- );
140
- } catch (ex) {
141
- // if we do get here, we should log the error and continue instead of failing to download all automations
142
- Util.logger.warn(
143
- ` ☇ skipping ${this.definition.type} ${
144
- a[this.definition.nameField]
145
- } (${a[this.definition.keyField]}): ${ex.message} (${
146
- ex.code
147
- })${
148
- ex.endpoint
149
- ? Util.getGrayMsg(
150
- ' - ' +
151
- ex.endpoint.split(
152
- 'rest.marketingcloudapis.com'
153
- )[1]
154
- )
155
- : ''
156
- }`
157
- );
158
- return null;
159
- }
160
- })
161
- )
162
- : [];
178
+ })
179
+ )
180
+ : [];
181
+ }
182
+ if (Util.OPTIONS.onlyPublished && journey) {
183
+ details.push(
184
+ await this.client.rest.get(
185
+ `${uri}${singleKey}?extras=${extras}` +
186
+ `&versionNumber=${journey.version}`
187
+ )
188
+ );
189
+ }
163
190
  parsed = this.parseResponseBody({ items: details.filter(Boolean) });
164
191
  // * retrieveDir is mandatory in this method as it is not used for caching (there is a seperate method for that)
165
192
  const savedMetadata = await this.saveResults(parsed, retrieveDir, null, null);
@@ -753,6 +753,19 @@ class MetadataType {
753
753
  return false;
754
754
  }
755
755
 
756
+ /**
757
+ * helper for {@link MetadataType.upsert} to enforce max key length
758
+ *
759
+ * @param {string} metadataKey key of metadata
760
+ */
761
+ static enforceMaxKeyLength(metadataKey) {
762
+ if (this.definition.maxKeyLength && metadataKey.length > this.definition.maxKeyLength) {
763
+ throw new Error(
764
+ `key exceeds maximum length of ${this.definition.maxKeyLength} characters for this type`
765
+ );
766
+ }
767
+ }
768
+
756
769
  /**
757
770
  * MetadataType upsert, after retrieving from target and comparing to check if create or update operation is needed.
758
771
  *
@@ -774,6 +787,7 @@ class MetadataType {
774
787
  // preDeployTasks parsing
775
788
  let deployableMetadata;
776
789
  try {
790
+ this.enforceMaxKeyLength(metadataKey);
777
791
  metadataMap[metadataKey] = await this.validation(
778
792
  'deploy',
779
793
  metadataMap[metadataKey],
@@ -83,6 +83,22 @@ class Script extends MetadataType {
83
83
  return super.updateREST(script, '/automation/v1/scripts/' + script.ssjsActivityId);
84
84
  }
85
85
 
86
+ /**
87
+ * helper for {@link MetadataType.updateREST} and {@link MetadataType.updateSOAP}
88
+ *
89
+ * @param {MetadataTypeItem} metadataEntry a single metadata Entry
90
+ * @param {object} apiResponse varies depending on the API call
91
+ * @returns {Promise.<object>} apiResponse, potentially modified
92
+ */
93
+ static async postUpdateTasks(metadataEntry, apiResponse) {
94
+ // script update endpoint returns wrong values for createdDate and modifiedDate - need to re-retrieve to get correct values
95
+ const ssjsActivityId = apiResponse?.ssjsActivityId;
96
+ if (ssjsActivityId) {
97
+ apiResponse = await this.client.rest.get('/automation/v1/scripts/' + ssjsActivityId);
98
+ }
99
+ return apiResponse;
100
+ }
101
+
86
102
  /**
87
103
  * Creates a single Script
88
104
  *
@@ -23,6 +23,7 @@ export default {
23
23
  soapType: 'FilterDefinition',
24
24
  typeDescription: 'Defines an audience based on specified rules. Used by Filter Activities.',
25
25
  typeRetrieveByDefault: true,
26
+ typeCdpByDefault: true,
26
27
  typeName: 'Data Filter',
27
28
  fields: {
28
29
  // the GUI seems to ONLY send fields during update that are actually changed. It has yet to be tested if that also works with sending other fiedls as well
@@ -24,6 +24,7 @@ export default {
24
24
  typeDescription:
25
25
  'Defines an audience based on specified rules. Auto-generated by filtered DEs and filtered Lists.',
26
26
  typeRetrieveByDefault: false,
27
+ typeCdpByDefault: false,
27
28
  typeName: 'Data Filter (auto-generated)',
28
29
  fields: {
29
30
  // the GUI seems to ONLY send fields during update that are actually changed. It has yet to be tested if that also works with sending other fiedls as well
@@ -5,13 +5,14 @@ export default {
5
5
  hasExtended: false,
6
6
  idField: 'id',
7
7
  keyIsFixed: true,
8
- keyField: 'name',
8
+ keyField: 'customerKey',
9
9
  nameField: 'name',
10
10
  createdDateField: null,
11
11
  createdNameField: null,
12
12
  lastmodDateField: null,
13
13
  lastmodNameField: null,
14
14
  restPagination: false,
15
+ maxKeyLength: 36, // confirmed max length
15
16
  type: 'fileLocation',
16
17
  typeDescription:
17
18
  'Used for export or import of files to/from Marketing Cloud. Previously this was labeled ftpLocation.',
@@ -32,37 +33,81 @@ export default {
32
33
  'Azure Blob Storage': 15,
33
34
  'Google Cloud Storage': 16,
34
35
  },
36
+ locationTypeMappingDeployable: {
37
+ 'External SFTP Site': 'ExternalSftp',
38
+ 'Amazon Simple Storage Service': 'AmazonSimpleStorage',
39
+ 'Azure Blob Storage': 'AzureBlobStorage',
40
+ 'Google Cloud Storage': 'GcpBlobStorage',
41
+ },
42
+ locationTypeIdMappingDeployable: {
43
+ 2: 'ExternalSftp',
44
+ 13: 'AmazonSimpleStorage',
45
+ 15: 'AzureBlobStorage',
46
+ 16: 'GcpBlobStorage',
47
+ },
35
48
  fields: {
36
49
  id: {
37
50
  isCreateable: false,
38
51
  isUpdateable: false,
39
- retrieving: true,
52
+ retrieving: false,
40
53
  template: false,
41
54
  },
42
55
  locationTypeId: {
56
+ // automation endpoint
43
57
  isCreateable: false,
44
58
  isUpdateable: false,
45
- retrieving: true,
59
+ retrieving: false,
60
+ template: false,
61
+ },
62
+ locationType: {
63
+ // data endpoint
64
+ isCreateable: true,
65
+ isUpdateable: true,
66
+ retrieving: false,
46
67
  template: false,
47
68
  },
48
69
  locationUrl: {
49
70
  isCreateable: false,
50
71
  isUpdateable: false,
72
+ retrieving: false,
73
+ template: false,
74
+ },
75
+ name: {
76
+ isCreateable: true,
77
+ isUpdateable: true,
51
78
  retrieving: true,
52
79
  template: true,
53
80
  },
54
- name: {
55
- isCreateable: false,
56
- isUpdateable: false,
81
+ customerKey: {
82
+ isCreateable: true,
83
+ isUpdateable: true,
57
84
  retrieving: true,
58
85
  template: true,
59
86
  },
60
- relPath: {
87
+ description: {
61
88
  isCreateable: true,
62
89
  isUpdateable: true,
63
90
  retrieving: true,
64
91
  template: true,
65
92
  },
93
+ relPath: {
94
+ isCreateable: false,
95
+ isUpdateable: false,
96
+ retrieving: false,
97
+ template: false,
98
+ },
99
+ awsFileTransferLocation: {
100
+ skipValidation: true,
101
+ },
102
+ azureFileTransferLocation: {
103
+ skipValidation: true,
104
+ },
105
+ gcpFileTransferLocation: {
106
+ skipValidation: true,
107
+ },
108
+ sFtpFileTransferLocation: {
109
+ skipValidation: true,
110
+ },
66
111
  c__locationType: {
67
112
  isCreateable: false,
68
113
  isUpdateable: false,
@@ -1188,6 +1188,12 @@ export default {
1188
1188
  retrieving: true,
1189
1189
  template: true,
1190
1190
  },
1191
+ campaigns: {
1192
+ isCreateable: true,
1193
+ isUpdateable: true,
1194
+ retrieving: true,
1195
+ template: true,
1196
+ },
1191
1197
  metaData: {
1192
1198
  skipValidation: true,
1193
1199
  },
@@ -100,6 +100,12 @@ export default {
100
100
  retrieving: false,
101
101
  template: false,
102
102
  },
103
+ parentCategoryId: {
104
+ isCreateable: false,
105
+ isUpdateable: false,
106
+ retrieving: false,
107
+ template: false,
108
+ },
103
109
  r__folder_Path: { skipValidation: true },
104
110
  },
105
111
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcdev",
3
- "version": "8.3.0",
3
+ "version": "8.4.0",
4
4
  "description": "Accenture Salesforce Marketing Cloud DevTools",
5
5
  "author": "Accenture: joern.berkefeld, douglas.midgley, robert.zimmermann, maciej.barnas",
6
6
  "license": "MIT",
@@ -78,40 +78,40 @@
78
78
  "json-to-table": "4.2.1",
79
79
  "mustache": "4.2.0",
80
80
  "p-limit": "6.2.0",
81
- "prettier": "3.5.3",
81
+ "prettier": "3.8.1",
82
82
  "prettier-plugin-sql": "0.19.2",
83
- "semver": "7.7.3",
84
- "sfmc-sdk": "2.1.2",
83
+ "semver": "7.7.4",
84
+ "sfmc-sdk": "2.1.4",
85
85
  "simple-git": "3.30.0",
86
86
  "toposort": "2.0.2",
87
87
  "update-notifier": "7.3.1",
88
88
  "winston": "3.19.0",
89
89
  "yargs": "17.7.2",
90
- "yocto-spinner": "1.0.0"
90
+ "yocto-spinner": "1.1.0"
91
91
  },
92
92
  "devDependencies": {
93
- "@eslint/js": "9.28.0",
93
+ "@eslint/js": "9.39.2",
94
94
  "@types/fs-extra": "11.0.4",
95
95
  "@types/inquirer": "9.0.7",
96
96
  "@types/mocha": "10.0.8",
97
- "@types/node": "24.9.1",
97
+ "@types/node": "25.2.3",
98
98
  "@types/yargs": "17.0.33",
99
99
  "assert": "2.1.0",
100
100
  "axios-mock-adapter": "2.0.0",
101
101
  "c8": "10.1.3",
102
102
  "chai": "6.2.2",
103
103
  "chai-files": "1.4.0",
104
- "eslint": "9.28.0",
104
+ "eslint": "9.39.2",
105
105
  "eslint-config-ssjs": "2.0.0",
106
106
  "eslint-plugin-jsdoc": "50.7.1",
107
107
  "eslint-plugin-mocha": "11.2.0",
108
108
  "eslint-plugin-prettier": "5.5.5",
109
109
  "eslint-plugin-unicorn": "59.0.1",
110
- "fast-xml-parser": "5.3.4",
110
+ "fast-xml-parser": "5.3.5",
111
111
  "globals": "17.3.0",
112
112
  "husky": "9.1.7",
113
- "lint-staged": "16.2.6",
114
- "mocha": "11.7.4",
113
+ "lint-staged": "16.2.7",
114
+ "mocha": "11.7.5",
115
115
  "mock-fs": "5.3.0",
116
116
  "npm-run-all": "4.1.5",
117
117
  "prettier-eslint": "16.4.2",
@@ -775,7 +775,7 @@ describe('GENERAL', () => {
775
775
  // download first before we test buildTemplate
776
776
  await handler.retrieve('testInstance/testBU', ['automation', 'query']);
777
777
 
778
- const expectedApiCallsRetrieve = 36;
778
+ const expectedApiCallsRetrieve = 37;
779
779
  assert.equal(
780
780
  testUtils.getAPIHistoryLength(),
781
781
  expectedApiCallsRetrieve,
@@ -880,7 +880,7 @@ describe('GENERAL', () => {
880
880
  });
881
881
 
882
882
  it('buildTemplate + buildDefinition for multiple types with keys and --retrieve', async () => {
883
- const expectedApiCallsRetrieve = 33;
883
+ const expectedApiCallsRetrieve = 34;
884
884
 
885
885
  // preparation
886
886
  const argvMetadata = [
@@ -985,7 +985,7 @@ describe('GENERAL', () => {
985
985
  // download first before we test buildTemplate
986
986
  await handler.retrieve('testInstance/testBU');
987
987
 
988
- const expectedApiCallsRetrieve = 108;
988
+ const expectedApiCallsRetrieve = 109;
989
989
  assert.equal(
990
990
  testUtils.getAPIHistoryLength(),
991
991
  expectedApiCallsRetrieve,
@@ -1227,7 +1227,7 @@ describe('GENERAL', () => {
1227
1227
  await testUtils.getActualDeployFile('testTemplated_query', 'query', 'sql')
1228
1228
  ).to.equal(await testUtils.getExpectedFile('9999999', 'query', 'build', 'sql'));
1229
1229
 
1230
- const expectedApiCallsRetrieve = 112;
1230
+ const expectedApiCallsRetrieve = 113;
1231
1231
  assert.equal(
1232
1232
  testUtils.getAPIHistoryLength(),
1233
1233
  expectedApiCallsRetrieve,
@@ -1239,7 +1239,7 @@ describe('GENERAL', () => {
1239
1239
  // download first before we test buildTemplate
1240
1240
  await handler.retrieve('testInstance/testBU', ['automation', 'query']);
1241
1241
 
1242
- const expectedApiCallsRetrieve = 36;
1242
+ const expectedApiCallsRetrieve = 37;
1243
1243
  assert.equal(
1244
1244
  testUtils.getAPIHistoryLength(),
1245
1245
  expectedApiCallsRetrieve,
@@ -1431,7 +1431,7 @@ describe('GENERAL', () => {
1431
1431
  // download first before we test buildTemplate
1432
1432
  await handler.retrieve('testInstance/testBU', ['automation', 'query']);
1433
1433
 
1434
- const expectedApiCallsRetrieve = 36;
1434
+ const expectedApiCallsRetrieve = 37;
1435
1435
  assert.equal(
1436
1436
  testUtils.getAPIHistoryLength(),
1437
1437
  expectedApiCallsRetrieve,
@@ -1502,7 +1502,7 @@ describe('GENERAL', () => {
1502
1502
  // download first before we test buildTemplate
1503
1503
  await handler.retrieve('testInstance/testBU', ['automation', 'query']);
1504
1504
 
1505
- const expectedApiCallsRetrieve = 36;
1505
+ const expectedApiCallsRetrieve = 37;
1506
1506
  assert.equal(
1507
1507
  testUtils.getAPIHistoryLength(),
1508
1508
  expectedApiCallsRetrieve,
@@ -1601,7 +1601,7 @@ describe('GENERAL', () => {
1601
1601
  // download everything before we test buildTemplate
1602
1602
  await handler.retrieve('testInstance/testBU');
1603
1603
 
1604
- const expectedApiCallsRetrieve = 108;
1604
+ const expectedApiCallsRetrieve = 109;
1605
1605
  assert.equal(
1606
1606
  testUtils.getAPIHistoryLength(),
1607
1607
  expectedApiCallsRetrieve,
@@ -1812,7 +1812,7 @@ describe('GENERAL', () => {
1812
1812
  await testUtils.getActualDeployFile('testTemplated_query', 'query', 'sql')
1813
1813
  ).to.equal(await testUtils.getExpectedFile('9999999', 'query', 'build', 'sql'));
1814
1814
 
1815
- const expectedApiCallsRetrieve = 112;
1815
+ const expectedApiCallsRetrieve = 113;
1816
1816
  assert.equal(
1817
1817
  testUtils.getAPIHistoryLength(),
1818
1818
  expectedApiCallsRetrieve,
@@ -1824,7 +1824,7 @@ describe('GENERAL', () => {
1824
1824
  // download first before we test buildTemplate
1825
1825
  await handler.retrieve('testInstance/testBU', ['automation', 'query']);
1826
1826
 
1827
- const expectedApiCallsRetrieve = 36;
1827
+ const expectedApiCallsRetrieve = 37;
1828
1828
  assert.equal(
1829
1829
  testUtils.getAPIHistoryLength(),
1830
1830
  expectedApiCallsRetrieve,
@@ -2003,7 +2003,7 @@ describe('GENERAL', () => {
2003
2003
  // download first before we test buildTemplate
2004
2004
  await handler.retrieve('testInstance/testBU');
2005
2005
 
2006
- const expectedApiCallsRetrieve = 108;
2006
+ const expectedApiCallsRetrieve = 109;
2007
2007
  assert.equal(
2008
2008
  testUtils.getAPIHistoryLength(),
2009
2009
  expectedApiCallsRetrieve,
@@ -178,5 +178,5 @@
178
178
  "verification"
179
179
  ]
180
180
  },
181
- "version": "8.3.0"
181
+ "version": "8.4.0"
182
182
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "customerKey": "testExisting_asset_htmlblock-matchName-fail",
2
+ "customerKey": "testExisting_asset_html-matchNamFail",
3
3
  "assetType": {
4
4
  "name": "htmlblock",
5
5
  "displayName": "HTML Block"
@@ -1,5 +1,5 @@
1
1
  {
2
- "customerKey": "testExisting_asset_htmlblock-matchName",
2
+ "customerKey": "testExisting_asset_html-matchName",
3
3
  "assetType": {
4
4
  "name": "htmlblock",
5
5
  "displayName": "HTML Block"
@@ -1,13 +1,13 @@
1
1
  {
2
- "customerKey": "testExisting_asset_htmlblock-matchName-create",
2
+ "customerKey": "testExisting_asset_html-matchNameAdd",
3
3
  "assetType": {
4
4
  "name": "htmlblock",
5
5
  "displayName": "HTML Block"
6
6
  },
7
7
  "fileProperties": {
8
- "fileName": "testExisting_htmlblock_matchName-create"
8
+ "fileName": "testExisting_asset_html-matchNameAdd"
9
9
  },
10
- "name": "testExisting_htmlblock_matchName-create",
10
+ "name": "testExisting_asset_html-matchNameAdd",
11
11
  "owner": {
12
12
  "email": "joern.berkefeld@accenture.com",
13
13
  "name": "Jörn Berkefeld (ASGR)"
@@ -0,0 +1,5 @@
1
+ {
2
+ "name": "ExactTarget Enhanced FTP",
3
+ "customerKey": "ExactTarget Enhanced FTP",
4
+ "c__locationType": "Enhanced FTP Site Import Directory"
5
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "testExisting_fileLocation_aws_name",
3
+ "customerKey": "testExisting_fileLocation_aws",
4
+ "description": "updated via deploy",
5
+ "awsFileTransferLocation": {
6
+ "regionName": "eucentral1",
7
+ "transferAccelerationEnabled": false,
8
+ "accessKeyId": "key-id",
9
+ "relativePath": "my/path",
10
+ "bucketName": "bucket-name",
11
+ "authType": "AccessKey"
12
+ },
13
+ "c__locationType": "Amazon Simple Storage Service"
14
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "testExisting_fileLocation_exsftp_name",
3
+ "customerKey": "testExisting_fileLocation_exsftp",
4
+ "description": "updated via deploy",
5
+ "sFtpFileTransferLocation": {
6
+ "portNumber": 22,
7
+ "userName": "abc",
8
+ "url": "sftp://test.com",
9
+ "authType": "Password"
10
+ },
11
+ "c__locationType": "External SFTP Site"
12
+ }
@@ -276,6 +276,8 @@ export const handleRESTRequest = async (config) => {
276
276
  filterName = 'mostRecentVersionOnly';
277
277
  } else if (urlObj.searchParams.get('versionNumber')) {
278
278
  filterName = 'versionNumber';
279
+ } else if (urlObj.searchParams.get('status')) {
280
+ filterName = 'status';
279
281
  } else if (urlObj.searchParams.get('id')) {
280
282
  filterName = 'id';
281
283
  }
@@ -301,6 +303,9 @@ export const handleRESTRequest = async (config) => {
301
303
  : '') +
302
304
  (urlObj.searchParams.get('mostRecentVersionOnly')
303
305
  ? 'mostRecentVersionOnly=' + urlObj.searchParams.get('mostRecentVersionOnly')
306
+ : '') +
307
+ (urlObj.searchParams.get('status')
308
+ ? 'status=' + urlObj.searchParams.get('status')
304
309
  : '')
305
310
  : null;
306
311
 
@@ -338,7 +343,8 @@ export const handleRESTRequest = async (config) => {
338
343
  response.items &&
339
344
  filterName !== 'mostRecentVersionOnly' &&
340
345
  filterName !== 'versionNumber' &&
341
- filterName !== 'id'
346
+ filterName !== 'id' &&
347
+ filterName !== 'status'
342
348
  ) {
343
349
  response.items = response.items.filter((def) => def.name == filterName);
344
350
  }
@@ -407,7 +413,8 @@ export const handleRESTRequest = async (config) => {
407
413
  filterName &&
408
414
  filterName !== 'mostRecentVersionOnly' &&
409
415
  filterName !== 'versionNumber' &&
410
- filterName !== 'id'
416
+ filterName !== 'id' &&
417
+ filterName !== 'status'
411
418
  ) {
412
419
  const response = JSON.parse(
413
420
  await fs.readFile(testPath + '.json', {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "id": 1295064,
3
- "customerKey": "testExisting_asset_htmlblock-matchName",
3
+ "customerKey": "testExisting_asset_html-matchName",
4
4
  "objectID": "26fdf503-eeed-49eb-b428-cb3b4bc2ba48",
5
5
  "assetType": {
6
6
  "id": 196,