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.
- package/.github/ISSUE_TEMPLATE/bug.yml +1 -0
- package/@types/lib/Builder.d.ts.map +1 -1
- package/@types/lib/Deployer.d.ts.map +1 -1
- package/@types/lib/cli.d.ts.map +1 -1
- package/@types/lib/index.d.ts.map +1 -1
- package/@types/lib/metadataTypes/Asset.d.ts.map +1 -1
- package/@types/lib/metadataTypes/AttributeGroup.d.ts.map +1 -1
- package/@types/lib/metadataTypes/AttributeSet.d.ts.map +1 -1
- package/@types/lib/metadataTypes/Automation.d.ts.map +1 -1
- package/@types/lib/metadataTypes/Campaign.d.ts.map +1 -1
- package/@types/lib/metadataTypes/ContentArea.d.ts.map +1 -1
- package/@types/lib/metadataTypes/DataExtension.d.ts.map +1 -1
- package/@types/lib/metadataTypes/DataExtensionField.d.ts.map +1 -1
- package/@types/lib/metadataTypes/DataExtract.d.ts.map +1 -1
- package/@types/lib/metadataTypes/DataExtractType.d.ts.map +1 -1
- package/@types/lib/metadataTypes/Discovery.d.ts.map +1 -1
- package/@types/lib/metadataTypes/Email.d.ts.map +1 -1
- package/@types/lib/metadataTypes/Event.d.ts.map +1 -1
- package/@types/lib/metadataTypes/FileTransfer.d.ts.map +1 -1
- package/@types/lib/metadataTypes/Folder.d.ts.map +1 -1
- package/@types/lib/metadataTypes/ImportFile.d.ts.map +1 -1
- package/@types/lib/metadataTypes/Journey.d.ts.map +1 -1
- package/@types/lib/metadataTypes/List.d.ts.map +1 -1
- package/@types/lib/metadataTypes/MetadataType.d.ts.map +1 -1
- package/@types/lib/metadataTypes/MobileKeyword.d.ts.map +1 -1
- package/@types/lib/metadataTypes/MobileMessage.d.ts.map +1 -1
- package/@types/lib/metadataTypes/Query.d.ts.map +1 -1
- package/@types/lib/metadataTypes/Role.d.ts.map +1 -1
- package/@types/lib/metadataTypes/Script.d.ts.map +1 -1
- package/@types/lib/metadataTypes/SendClassification.d.ts.map +1 -1
- package/@types/lib/metadataTypes/SenderProfile.d.ts.map +1 -1
- package/@types/lib/metadataTypes/TransactionalEmail.d.ts.map +1 -1
- package/@types/lib/metadataTypes/TransactionalMessage.d.ts.map +1 -1
- package/@types/lib/metadataTypes/TransactionalPush.d.ts.map +1 -1
- package/@types/lib/metadataTypes/TransactionalSMS.d.ts.map +1 -1
- package/@types/lib/metadataTypes/TriggeredSend.d.ts.map +1 -1
- package/@types/lib/metadataTypes/User.d.ts.map +1 -1
- package/@types/lib/metadataTypes/Verification.d.ts.map +1 -1
- package/@types/lib/util/auth.d.ts.map +1 -1
- package/@types/lib/util/cache.d.ts.map +1 -1
- package/@types/lib/util/cli.d.ts.map +1 -1
- package/@types/lib/util/config.d.ts.map +1 -1
- package/@types/lib/util/devops.d.ts.map +1 -1
- package/@types/lib/util/file.d.ts.map +1 -1
- package/@types/lib/util/init.config.d.ts.map +1 -1
- package/@types/lib/util/init.d.ts.map +1 -1
- package/@types/lib/util/init.git.d.ts.map +1 -1
- package/@types/lib/util/init.npm.d.ts.map +1 -1
- package/@types/lib/util/replaceContentBlockReference.d.ts.map +1 -1
- package/@types/lib/util/util.d.ts.map +1 -1
- package/@types/types/mcdev.d.d.ts.map +1 -1
- package/lib/Builder.js +4 -0
- package/lib/Deployer.js +2 -0
- package/lib/cli.js +1 -0
- package/lib/index.js +31 -0
- package/lib/metadataTypes/Asset.js +30 -0
- package/lib/metadataTypes/AttributeGroup.js +2 -0
- package/lib/metadataTypes/AttributeSet.js +3 -0
- package/lib/metadataTypes/Automation.js +15 -0
- package/lib/metadataTypes/Campaign.js +1 -0
- package/lib/metadataTypes/ContentArea.js +2 -0
- package/lib/metadataTypes/DataExtension.js +12 -0
- package/lib/metadataTypes/DataExtensionField.js +8 -0
- package/lib/metadataTypes/DataExtract.js +3 -0
- package/lib/metadataTypes/DataExtractType.js +1 -0
- package/lib/metadataTypes/Discovery.js +1 -0
- package/lib/metadataTypes/Email.js +2 -0
- package/lib/metadataTypes/Event.js +4 -0
- package/lib/metadataTypes/FileTransfer.js +1 -0
- package/lib/metadataTypes/Folder.js +14 -2
- package/lib/metadataTypes/ImportFile.js +2 -0
- package/lib/metadataTypes/Journey.js +8 -0
- package/lib/metadataTypes/List.js +2 -0
- package/lib/metadataTypes/MetadataType.js +34 -0
- package/lib/metadataTypes/MobileKeyword.js +8 -0
- package/lib/metadataTypes/MobileMessage.js +7 -0
- package/lib/metadataTypes/Query.js +9 -0
- package/lib/metadataTypes/Role.js +1 -0
- package/lib/metadataTypes/Script.js +7 -0
- package/lib/metadataTypes/SendClassification.js +2 -0
- package/lib/metadataTypes/SenderProfile.js +2 -0
- package/lib/metadataTypes/TransactionalEmail.js +3 -0
- package/lib/metadataTypes/TransactionalMessage.js +3 -0
- package/lib/metadataTypes/TransactionalPush.js +1 -0
- package/lib/metadataTypes/TransactionalSMS.js +8 -0
- package/lib/metadataTypes/TriggeredSend.js +4 -0
- package/lib/metadataTypes/User.js +10 -0
- package/lib/metadataTypes/Verification.js +3 -0
- package/lib/retrieveChangelog.js +1 -0
- package/lib/util/auth.js +3 -0
- package/lib/util/cache.js +8 -0
- package/lib/util/cli.js +8 -0
- package/lib/util/config.js +2 -0
- package/lib/util/devops.js +2 -0
- package/lib/util/file.js +12 -0
- package/lib/util/init.config.js +5 -0
- package/lib/util/init.git.js +4 -0
- package/lib/util/init.js +4 -0
- package/lib/util/init.npm.js +1 -0
- package/lib/util/replaceContentBlockReference.js +1 -0
- package/lib/util/util.js +29 -0
- package/package.json +6 -6
- package/test/mockRoot/.mcdevrc.json +1 -1
- package/test/resourceFactory.js +15 -1
- package/test/resources/9999999/dataFolder/+retrieve-QAA-response.xml +387 -0
- package/test/resources/9999999/dataFolder/create-ContentType=dataextension,Name=my,ParentFolderID=2-response.xml +33 -0
- package/test/resources/9999999/dataFolder/create-ContentType=dataextension,Name=path,ParentFolderID=862002-response.xml +33 -0
- package/test/resources/9999999/dataFolder/create-ContentType=dataextension,Name=sub,ParentFolderID=862001-response.xml +33 -0
- package/test/resources/9999999/dataFolder/create-ContentType=dataextension,Name=subpath,ParentFolderID=862003-response.xml +33 -0
- package/test/resources/9999999/email/v1/category/post-response-parentCatId=290937,name=my,catType=automations.json +7 -0
- package/test/resources/9999999/email/v1/category/post-response-parentCatId=862100,name=sub,catType=automations.json +7 -0
- package/test/resources/9999999/email/v1/category/post-response-parentCatId=862101,name=path,catType=automations.json +7 -0
- package/test/resources/9999999/email/v1/category/post-response-parentCatId=862102,name=subpath,catType=automations.json +7 -0
- package/test/resources/9999999/folder-deploy/Data Extensions/my/sub/path/subpath.folder-meta.json +9 -0
- package/test/resources/9999999/folder-deploy/Data Extensions/my/sub/path.folder-meta.json +9 -0
- package/test/resources/9999999/folder-deploy/Data Extensions/my/sub.folder-meta.json +9 -0
- package/test/resources/9999999/folder-deploy/Data Extensions/my.folder-meta.json +9 -0
- package/test/resources/9999999/folder-deploy/my automations/my/sub/path/subpath.folder-meta.json +9 -0
- package/test/resources/9999999/folder-deploy/my automations/my/sub/path.folder-meta.json +9 -0
- package/test/resources/9999999/folder-deploy/my automations/my/sub.folder-meta.json +9 -0
- package/test/resources/9999999/folder-deploy/my automations/my.folder-meta.json +9 -0
- package/test/type.asset.test.js +4 -0
- package/test/type.folder.test.js +97 -0
- package/test/utils.js +44 -5
- package/types/mcdev.d.js +27 -0
- /package/test/resources/9999999/dataFolder/{retrieve-response-.xml → +retrieve-response.xml} +0 -0
package/lib/util/util.js
CHANGED
|
@@ -53,6 +53,7 @@ export const Util = {
|
|
|
53
53
|
packageJsonMcdev: readJsonSync(path.join(__dirname, '../../package.json')),
|
|
54
54
|
OPTIONS: {},
|
|
55
55
|
changedKeysMap: {},
|
|
56
|
+
|
|
56
57
|
/**
|
|
57
58
|
* helper that allows filtering an object by its keys
|
|
58
59
|
*
|
|
@@ -71,6 +72,7 @@ export const Util = {
|
|
|
71
72
|
return obj;
|
|
72
73
|
}, {});
|
|
73
74
|
},
|
|
75
|
+
|
|
74
76
|
/**
|
|
75
77
|
* extended Array.includes method that allows check if an array-element starts with a certain string
|
|
76
78
|
*
|
|
@@ -81,6 +83,7 @@ export const Util = {
|
|
|
81
83
|
includesStartsWith(arr, search) {
|
|
82
84
|
return this.includesStartsWithIndex(arr, search) >= 0;
|
|
83
85
|
},
|
|
86
|
+
|
|
84
87
|
/**
|
|
85
88
|
* extended Array.includes method that allows check if an array-element starts with a certain string
|
|
86
89
|
*
|
|
@@ -91,6 +94,7 @@ export const Util = {
|
|
|
91
94
|
includesStartsWithIndex(arr, search) {
|
|
92
95
|
return Array.isArray(arr) ? arr.findIndex((el) => el.startsWith(search)) : -1;
|
|
93
96
|
},
|
|
97
|
+
|
|
94
98
|
/**
|
|
95
99
|
* check if a market name exists in current mcdev config
|
|
96
100
|
*
|
|
@@ -156,6 +160,7 @@ export const Util = {
|
|
|
156
160
|
throw new Error(`Market List ${mlName} is not defined`);
|
|
157
161
|
}
|
|
158
162
|
},
|
|
163
|
+
|
|
159
164
|
/**
|
|
160
165
|
* used to ensure the program tells surrounding software that an unrecoverable error occured
|
|
161
166
|
*
|
|
@@ -165,6 +170,7 @@ export const Util = {
|
|
|
165
170
|
// Util.logger.debug('Util.signalFataError() sets process.exitCode = 1 unless already set');
|
|
166
171
|
process.exitCode ||= 1;
|
|
167
172
|
},
|
|
173
|
+
|
|
168
174
|
/**
|
|
169
175
|
* SFMC accepts multiple true values for Boolean attributes for which we are checking here.
|
|
170
176
|
* The same problem occurs when evaluating boolean CLI flags
|
|
@@ -175,6 +181,7 @@ export const Util = {
|
|
|
175
181
|
isTrue(attrValue) {
|
|
176
182
|
return ['true', 'TRUE', 'True', '1', 1, 'Y', 'y', true].includes(attrValue);
|
|
177
183
|
},
|
|
184
|
+
|
|
178
185
|
/**
|
|
179
186
|
* SFMC accepts multiple false values for Boolean attributes for which we are checking here.
|
|
180
187
|
* The same problem occurs when evaluating boolean CLI flags
|
|
@@ -285,6 +292,7 @@ export const Util = {
|
|
|
285
292
|
|
|
286
293
|
return typeChoices;
|
|
287
294
|
},
|
|
295
|
+
|
|
288
296
|
/**
|
|
289
297
|
* wrapper around our standard winston logging to console and logfile
|
|
290
298
|
*
|
|
@@ -367,6 +375,7 @@ export const Util = {
|
|
|
367
375
|
* @type {Logger}
|
|
368
376
|
*/
|
|
369
377
|
logger: null,
|
|
378
|
+
|
|
370
379
|
/**
|
|
371
380
|
* initiate winston logger
|
|
372
381
|
*
|
|
@@ -439,6 +448,7 @@ export const Util = {
|
|
|
439
448
|
/* eslint-enable unicorn/prefer-ternary */
|
|
440
449
|
myWinston.debug(stack);
|
|
441
450
|
},
|
|
451
|
+
|
|
442
452
|
/**
|
|
443
453
|
* errors should cause surrounding applications to take notice
|
|
444
454
|
* hence we overwrite the default error function here
|
|
@@ -458,6 +468,7 @@ export const Util = {
|
|
|
458
468
|
`:: mcdev ${Util.packageJsonMcdev.version} :: ⚡ mcdev ${processArgv.join(' ')}`
|
|
459
469
|
);
|
|
460
470
|
},
|
|
471
|
+
|
|
461
472
|
/**
|
|
462
473
|
* Logger helper for Metadata functions
|
|
463
474
|
*
|
|
@@ -484,6 +495,7 @@ export const Util = {
|
|
|
484
495
|
Util.logger[level](`${type}.${method}: ${prependSource}${JSON.stringify(payload)}`);
|
|
485
496
|
}
|
|
486
497
|
},
|
|
498
|
+
|
|
487
499
|
/**
|
|
488
500
|
* replaces values in a JSON object string, based on a series of
|
|
489
501
|
* key-value pairs (obj)
|
|
@@ -663,6 +675,7 @@ export const Util = {
|
|
|
663
675
|
resolveObjPath(path, obj) {
|
|
664
676
|
return path.split('.').reduce((prev, curr) => (prev ? prev[curr] : null), obj);
|
|
665
677
|
},
|
|
678
|
+
|
|
666
679
|
/**
|
|
667
680
|
* helper to run other commands as if run manually by user
|
|
668
681
|
*
|
|
@@ -693,6 +706,7 @@ export const Util = {
|
|
|
693
706
|
return null;
|
|
694
707
|
}
|
|
695
708
|
},
|
|
709
|
+
|
|
696
710
|
/**
|
|
697
711
|
* standardize check to ensure only one result is returned from template search
|
|
698
712
|
*
|
|
@@ -714,6 +728,7 @@ export const Util = {
|
|
|
714
728
|
return matching[0];
|
|
715
729
|
}
|
|
716
730
|
},
|
|
731
|
+
|
|
717
732
|
/**
|
|
718
733
|
* configures what is displayed in the console
|
|
719
734
|
*
|
|
@@ -749,6 +764,7 @@ export const Util = {
|
|
|
749
764
|
Util.logger.level = Util.OPTIONS.loggerLevel;
|
|
750
765
|
}
|
|
751
766
|
},
|
|
767
|
+
|
|
752
768
|
/**
|
|
753
769
|
* outputs a warning that the given type is still in beta
|
|
754
770
|
*
|
|
@@ -789,6 +805,7 @@ export const Util = {
|
|
|
789
805
|
bgWhite: '\x1B[47m',
|
|
790
806
|
bgGray: '\x1B[100m',
|
|
791
807
|
},
|
|
808
|
+
|
|
792
809
|
/**
|
|
793
810
|
* helper that wraps a message in the correct color codes to have them printed gray
|
|
794
811
|
*
|
|
@@ -798,6 +815,7 @@ export const Util = {
|
|
|
798
815
|
getGrayMsg(msg) {
|
|
799
816
|
return `${Util.color.dim}${msg}${Util.color.reset}`;
|
|
800
817
|
},
|
|
818
|
+
|
|
801
819
|
/**
|
|
802
820
|
* helper to print the subtypes we filtered by
|
|
803
821
|
*
|
|
@@ -814,6 +832,7 @@ export const Util = {
|
|
|
814
832
|
);
|
|
815
833
|
}
|
|
816
834
|
},
|
|
835
|
+
|
|
817
836
|
/**
|
|
818
837
|
* helper to print the subtypes we filtered by
|
|
819
838
|
*
|
|
@@ -836,6 +855,7 @@ export const Util = {
|
|
|
836
855
|
}
|
|
837
856
|
return '';
|
|
838
857
|
},
|
|
858
|
+
|
|
839
859
|
/**
|
|
840
860
|
* pause execution of code; useful when multiple server calls are dependent on each other and might not be executed right away
|
|
841
861
|
*
|
|
@@ -851,6 +871,7 @@ export const Util = {
|
|
|
851
871
|
setTimeout(resolve, ms);
|
|
852
872
|
});
|
|
853
873
|
},
|
|
874
|
+
|
|
854
875
|
/**
|
|
855
876
|
* helper for Asset.extractCode and Script.prepExtractedCode to determine if a code block is a valid SSJS block
|
|
856
877
|
*
|
|
@@ -904,6 +925,7 @@ export const Util = {
|
|
|
904
925
|
// no script found
|
|
905
926
|
return null;
|
|
906
927
|
},
|
|
928
|
+
|
|
907
929
|
/**
|
|
908
930
|
* allows us to filter just like with SQL's LIKE operator
|
|
909
931
|
*
|
|
@@ -925,6 +947,7 @@ export const Util = {
|
|
|
925
947
|
// Check matches
|
|
926
948
|
return new RegExp('^' + search + '$', 'gi').test(testString);
|
|
927
949
|
},
|
|
950
|
+
|
|
928
951
|
/**
|
|
929
952
|
* returns true if no LIKE filter is defined or if all filters match
|
|
930
953
|
*
|
|
@@ -962,6 +985,7 @@ export const Util = {
|
|
|
962
985
|
return false;
|
|
963
986
|
});
|
|
964
987
|
},
|
|
988
|
+
|
|
965
989
|
/**
|
|
966
990
|
* helper used by SOAP methods to ensure the type always uses an upper-cased first letter
|
|
967
991
|
*
|
|
@@ -971,6 +995,7 @@ export const Util = {
|
|
|
971
995
|
capitalizeFirstLetter(str) {
|
|
972
996
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
973
997
|
},
|
|
998
|
+
|
|
974
999
|
/**
|
|
975
1000
|
* helper for Retriever and Deployer class
|
|
976
1001
|
*
|
|
@@ -996,6 +1021,7 @@ export const Util = {
|
|
|
996
1021
|
}
|
|
997
1022
|
return typeKeyMap;
|
|
998
1023
|
},
|
|
1024
|
+
|
|
999
1025
|
/**
|
|
1000
1026
|
* helper that converts TypeKeyCombo objects into a string with all relevant -m parameters
|
|
1001
1027
|
*
|
|
@@ -1016,6 +1042,7 @@ export const Util = {
|
|
|
1016
1042
|
.join(' ')
|
|
1017
1043
|
: '';
|
|
1018
1044
|
},
|
|
1045
|
+
|
|
1019
1046
|
/**
|
|
1020
1047
|
* helper that converts TypeKeyCombo objects into a string with all relevant -m parameters
|
|
1021
1048
|
*
|
|
@@ -1049,6 +1076,7 @@ export const Util = {
|
|
|
1049
1076
|
.join(', ')
|
|
1050
1077
|
: '';
|
|
1051
1078
|
},
|
|
1079
|
+
|
|
1052
1080
|
/**
|
|
1053
1081
|
* helper that checks how many keys are defined in TypeKeyCombo object
|
|
1054
1082
|
*
|
|
@@ -1078,6 +1106,7 @@ export const Util = {
|
|
|
1078
1106
|
}
|
|
1079
1107
|
}
|
|
1080
1108
|
},
|
|
1109
|
+
|
|
1081
1110
|
/**
|
|
1082
1111
|
*
|
|
1083
1112
|
* @param {Array} array array to be chunked
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcdev",
|
|
3
|
-
"version": "7.1.
|
|
3
|
+
"version": "7.1.4",
|
|
4
4
|
"description": "Accenture Salesforce Marketing Cloud DevTools",
|
|
5
5
|
"author": "Accenture: joern.berkefeld, douglas.midgley, robert.zimmermann, maciej.barnas",
|
|
6
6
|
"license": "MIT",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"console.table": "0.10.0",
|
|
72
72
|
"deep-equal": "2.2.3",
|
|
73
73
|
"fs-extra": "11.2.0",
|
|
74
|
-
"inquirer": "10.
|
|
74
|
+
"inquirer": "10.1.8",
|
|
75
75
|
"json-to-table": "4.2.1",
|
|
76
76
|
"mustache": "4.2.0",
|
|
77
77
|
"p-limit": "6.1.0",
|
|
@@ -86,26 +86,26 @@
|
|
|
86
86
|
"yargs": "17.7.2"
|
|
87
87
|
},
|
|
88
88
|
"devDependencies": {
|
|
89
|
-
"@eslint/js": "9.
|
|
89
|
+
"@eslint/js": "9.8.0",
|
|
90
90
|
"@types/fs-extra": "11.0.4",
|
|
91
91
|
"@types/inquirer": "9.0.7",
|
|
92
92
|
"@types/mocha": "10.0.7",
|
|
93
93
|
"@types/node": "22.0.2",
|
|
94
94
|
"@types/yargs": "17.0.32",
|
|
95
95
|
"assert": "2.1.0",
|
|
96
|
-
"axios-mock-adapter": "
|
|
96
|
+
"axios-mock-adapter": "2.0.0",
|
|
97
97
|
"c8": "10.0.0",
|
|
98
98
|
"chai": "5.1.1",
|
|
99
99
|
"chai-files": "1.4.0",
|
|
100
100
|
"eslint": "9.8.0",
|
|
101
101
|
"eslint-config-prettier": "9.1.0",
|
|
102
102
|
"eslint-config-ssjs": "2.0.0",
|
|
103
|
-
"eslint-plugin-jsdoc": "
|
|
103
|
+
"eslint-plugin-jsdoc": "49.0.0",
|
|
104
104
|
"eslint-plugin-mocha": "10.5.0",
|
|
105
105
|
"eslint-plugin-prettier": "5.2.1",
|
|
106
106
|
"eslint-plugin-unicorn": "55.0.0",
|
|
107
107
|
"fast-xml-parser": "4.4.1",
|
|
108
|
-
"globals": "15.
|
|
108
|
+
"globals": "15.9.0",
|
|
109
109
|
"husky": "9.1.4",
|
|
110
110
|
"lint-staged": "15.2.7",
|
|
111
111
|
"mocha": "10.7.0",
|
package/test/resourceFactory.js
CHANGED
|
@@ -32,6 +32,7 @@ if (Util.isRunViaVSCodeExtension) {
|
|
|
32
32
|
|
|
33
33
|
export const tWarn = `${color.bgYellow}${color.fgBlack}TEST-WARNING${color.reset}`;
|
|
34
34
|
export const tError = `${color.bgRed}${color.fgBlack}TEST-ERROR${color.reset}`;
|
|
35
|
+
|
|
35
36
|
/**
|
|
36
37
|
* gets mock SOAP metadata for responding
|
|
37
38
|
*
|
|
@@ -80,6 +81,7 @@ async function loadSOAPRecords(mcdevAction, type, mid, filter, QueryAllAccounts)
|
|
|
80
81
|
encoding: 'utf8',
|
|
81
82
|
});
|
|
82
83
|
}
|
|
84
|
+
|
|
83
85
|
/**
|
|
84
86
|
* helper for {@link loadSOAPRecords} to get the filter path
|
|
85
87
|
*
|
|
@@ -119,6 +121,7 @@ export function filterToPath(filter, shorten) {
|
|
|
119
121
|
}
|
|
120
122
|
return '';
|
|
121
123
|
}
|
|
124
|
+
|
|
122
125
|
/**
|
|
123
126
|
* helper for filterToPath
|
|
124
127
|
*
|
|
@@ -155,6 +158,7 @@ function _filterToPath(filter, shorten) {
|
|
|
155
158
|
throw new Error('unknown filter type');
|
|
156
159
|
}
|
|
157
160
|
}
|
|
161
|
+
|
|
158
162
|
/**
|
|
159
163
|
* based on request, respond with different soap data
|
|
160
164
|
*
|
|
@@ -179,11 +183,15 @@ export const handleSOAPRequest = async (config) => {
|
|
|
179
183
|
break;
|
|
180
184
|
}
|
|
181
185
|
case 'Create': {
|
|
186
|
+
let filter = null;
|
|
187
|
+
if (fullObj.Envelope.Body.CreateRequest.Objects['@_xsi:type'] === 'DataFolder') {
|
|
188
|
+
filter = `ContentType=${fullObj.Envelope.Body.CreateRequest.Objects.ContentType},Name=${fullObj.Envelope.Body.CreateRequest.Objects.Name},ParentFolderID=${fullObj.Envelope.Body.CreateRequest.Objects.ParentFolder.ID}`;
|
|
189
|
+
}
|
|
182
190
|
responseXML = await loadSOAPRecords(
|
|
183
191
|
config.headers.SOAPAction.toLocaleLowerCase(),
|
|
184
192
|
fullObj.Envelope.Body.CreateRequest.Objects['@_xsi:type'],
|
|
185
193
|
jObj.Envelope.Header.fueloauth,
|
|
186
|
-
|
|
194
|
+
filter
|
|
187
195
|
);
|
|
188
196
|
|
|
189
197
|
break;
|
|
@@ -297,6 +305,12 @@ export const handleRESTRequest = async (config) => {
|
|
|
297
305
|
if (myObj) {
|
|
298
306
|
const op = simpleOperators[myObj.simpleOperator];
|
|
299
307
|
filterBody = `${myObj.property}${op}${op === 'IN' ? myObj.value.join(',') : myObj.value}`;
|
|
308
|
+
} else if (config.url === '/email/v1/category') {
|
|
309
|
+
const data = JSON.parse(config.data);
|
|
310
|
+
|
|
311
|
+
filterBody = Object.keys(data)
|
|
312
|
+
.map((key) => `${key}=${data[key]}`)
|
|
313
|
+
.join(',');
|
|
300
314
|
}
|
|
301
315
|
}
|
|
302
316
|
const testPathFilterBody = filterBody ? testPath + '-' + filterBody : null;
|