mcdev 8.1.0 → 8.2.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.
- package/.github/ISSUE_TEMPLATE/bug.yml +1 -0
- package/.github/workflows/code-test.yml +2 -2
- package/.github/workflows/coverage-base-update.yml +3 -3
- package/.github/workflows/coverage-develop-branch.yml +3 -3
- package/.github/workflows/coverage-main-branch.yml +3 -3
- package/.github/workflows/coverage.yml +4 -4
- package/.github/workflows/npm-publish.yml +4 -4
- package/@types/lib/MetadataTypeDefinitions.d.ts +2 -0
- package/@types/lib/MetadataTypeDefinitions.d.ts.map +1 -1
- package/@types/lib/MetadataTypeInfo.d.ts +2 -0
- package/@types/lib/MetadataTypeInfo.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/Journey.d.ts.map +1 -1
- package/@types/lib/metadataTypes/MetadataType.d.ts.map +1 -1
- package/@types/lib/metadataTypes/TriggeredSendSummary.d.ts +257 -0
- package/@types/lib/metadataTypes/TriggeredSendSummary.d.ts.map +1 -0
- package/@types/lib/metadataTypes/definitions/TriggeredSendSummary.definition.d.ts +208 -0
- package/@types/lib/metadataTypes/definitions/TriggeredSendSummary.definition.d.ts.map +1 -0
- package/@types/lib/util/devops.d.ts +2 -1
- package/@types/lib/util/devops.d.ts.map +1 -1
- package/@types/lib/util/util.d.ts +2 -1
- package/@types/lib/util/util.d.ts.map +1 -1
- package/lib/MetadataTypeDefinitions.js +2 -0
- package/lib/MetadataTypeInfo.js +2 -0
- package/lib/cli.js +5 -0
- package/lib/index.js +26 -4
- package/lib/metadataTypes/Asset.js +30 -7
- package/lib/metadataTypes/Automation.js +1 -1
- package/lib/metadataTypes/Folder.js +1 -1
- package/lib/metadataTypes/Journey.js +5 -2
- package/lib/metadataTypes/MetadataType.js +8 -2
- package/lib/metadataTypes/TriggeredSendSummary.js +102 -0
- package/lib/metadataTypes/definitions/TriggeredSendSummary.definition.js +211 -0
- package/lib/util/devops.js +25 -8
- package/lib/util/util.js +13 -4
- package/package.json +10 -10
- package/test/mockRoot/.mcdevrc.json +1 -1
- package/test/resources/1111111/dataFolder/retrieve-ContentTypeINdataextension,hidden,queryactivity,salesforcedataextension,shared_data,shared_dataextension,shared_salesforcedataextension,synchronizeddataextension-response.xml +26 -0
- package/test/resources/9999999/automation/create-testNew_automation-expected.md +1 -1
- package/test/resources/9999999/automation/retrieve-testExisting_automation-expected.md +1 -1
- package/test/resources/9999999/automation/update-testExisting_automation-expected.md +1 -1
- package/test/resources/9999999/triggeredSendSummary/get-expected.json +24 -0
- package/test/resources/9999999/triggeredSendSummary/retrieve-response.xml +49 -0
- package/test/type.dataExtension.test.js +41 -0
- package/test/type.journey.test.js +37 -2
- package/test/type.triggeredSendSummary.test.js +45 -0
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
let bodyIteratorField: string;
|
|
3
|
+
let dependencies: string[];
|
|
4
|
+
namespace dependencyGraph {
|
|
5
|
+
let triggeredSend: string[];
|
|
6
|
+
}
|
|
7
|
+
let filter: {};
|
|
8
|
+
let hasExtended: boolean;
|
|
9
|
+
let idField: string;
|
|
10
|
+
let keepId: boolean;
|
|
11
|
+
let keyIsFixed: boolean;
|
|
12
|
+
let keyField: string;
|
|
13
|
+
let nameField: string;
|
|
14
|
+
let folderIdField: string;
|
|
15
|
+
let createdDateField: any;
|
|
16
|
+
let createdNameField: any;
|
|
17
|
+
let lastmodDateField: any;
|
|
18
|
+
let lastmodNameField: any;
|
|
19
|
+
let restPagination: any;
|
|
20
|
+
let maxKeyLength: number;
|
|
21
|
+
let type: string;
|
|
22
|
+
let soapType: string;
|
|
23
|
+
let typeDescription: string;
|
|
24
|
+
let typeRetrieveByDefault: boolean;
|
|
25
|
+
let typeCdpByDefault: boolean;
|
|
26
|
+
let typeName: string;
|
|
27
|
+
let fields: {
|
|
28
|
+
Bounces: {
|
|
29
|
+
isCreateable: boolean;
|
|
30
|
+
isUpdateable: boolean;
|
|
31
|
+
retrieving: boolean;
|
|
32
|
+
templating: boolean;
|
|
33
|
+
};
|
|
34
|
+
Clicks: {
|
|
35
|
+
isCreateable: boolean;
|
|
36
|
+
isUpdateable: boolean;
|
|
37
|
+
retrieving: boolean;
|
|
38
|
+
templating: boolean;
|
|
39
|
+
};
|
|
40
|
+
'Client.ID': {
|
|
41
|
+
isCreateable: boolean;
|
|
42
|
+
isUpdateable: boolean;
|
|
43
|
+
retrieving: boolean;
|
|
44
|
+
templating: boolean;
|
|
45
|
+
};
|
|
46
|
+
Conversions: {
|
|
47
|
+
isCreateable: boolean;
|
|
48
|
+
isUpdateable: boolean;
|
|
49
|
+
retrieving: boolean;
|
|
50
|
+
templating: boolean;
|
|
51
|
+
};
|
|
52
|
+
CustomerKey: {
|
|
53
|
+
isCreateable: boolean;
|
|
54
|
+
isUpdateable: boolean;
|
|
55
|
+
retrieving: boolean;
|
|
56
|
+
templating: boolean;
|
|
57
|
+
};
|
|
58
|
+
FTAFEmailsSent: {
|
|
59
|
+
isCreateable: boolean;
|
|
60
|
+
isUpdateable: boolean;
|
|
61
|
+
retrieving: boolean;
|
|
62
|
+
templating: boolean;
|
|
63
|
+
};
|
|
64
|
+
FTAFOptIns: {
|
|
65
|
+
isCreateable: boolean;
|
|
66
|
+
isUpdateable: boolean;
|
|
67
|
+
retrieving: boolean;
|
|
68
|
+
templating: boolean;
|
|
69
|
+
};
|
|
70
|
+
FTAFRequests: {
|
|
71
|
+
isCreateable: boolean;
|
|
72
|
+
isUpdateable: boolean;
|
|
73
|
+
retrieving: boolean;
|
|
74
|
+
templating: boolean;
|
|
75
|
+
};
|
|
76
|
+
ID: {
|
|
77
|
+
isCreateable: boolean;
|
|
78
|
+
isUpdateable: boolean;
|
|
79
|
+
retrieving: boolean;
|
|
80
|
+
templating: boolean;
|
|
81
|
+
};
|
|
82
|
+
InProcess: {
|
|
83
|
+
isCreateable: boolean;
|
|
84
|
+
isUpdateable: boolean;
|
|
85
|
+
retrieving: boolean;
|
|
86
|
+
templating: boolean;
|
|
87
|
+
};
|
|
88
|
+
NotSentDueToError: {
|
|
89
|
+
isCreateable: boolean;
|
|
90
|
+
isUpdateable: boolean;
|
|
91
|
+
retrieving: boolean;
|
|
92
|
+
templating: boolean;
|
|
93
|
+
};
|
|
94
|
+
NotSentDueToOptOut: {
|
|
95
|
+
isCreateable: boolean;
|
|
96
|
+
isUpdateable: boolean;
|
|
97
|
+
retrieving: boolean;
|
|
98
|
+
templating: boolean;
|
|
99
|
+
};
|
|
100
|
+
NotSentDueToUndeliverable: {
|
|
101
|
+
isCreateable: boolean;
|
|
102
|
+
isUpdateable: boolean;
|
|
103
|
+
retrieving: boolean;
|
|
104
|
+
templating: boolean;
|
|
105
|
+
};
|
|
106
|
+
ObjectID: {
|
|
107
|
+
isCreateable: boolean;
|
|
108
|
+
isUpdateable: boolean;
|
|
109
|
+
retrieving: boolean;
|
|
110
|
+
templating: boolean;
|
|
111
|
+
};
|
|
112
|
+
Opens: {
|
|
113
|
+
isCreateable: boolean;
|
|
114
|
+
isUpdateable: boolean;
|
|
115
|
+
retrieving: boolean;
|
|
116
|
+
templating: boolean;
|
|
117
|
+
};
|
|
118
|
+
OptOuts: {
|
|
119
|
+
isCreateable: boolean;
|
|
120
|
+
isUpdateable: boolean;
|
|
121
|
+
retrieving: boolean;
|
|
122
|
+
templating: boolean;
|
|
123
|
+
};
|
|
124
|
+
Owner: {
|
|
125
|
+
isCreateable: boolean;
|
|
126
|
+
isUpdateable: boolean;
|
|
127
|
+
retrieving: boolean;
|
|
128
|
+
templating: boolean;
|
|
129
|
+
};
|
|
130
|
+
PartnerKey: {
|
|
131
|
+
isCreateable: boolean;
|
|
132
|
+
isUpdateable: boolean;
|
|
133
|
+
retrieving: boolean;
|
|
134
|
+
templating: boolean;
|
|
135
|
+
};
|
|
136
|
+
PartnerProperties: {
|
|
137
|
+
isCreateable: boolean;
|
|
138
|
+
isUpdateable: boolean;
|
|
139
|
+
retrieving: boolean;
|
|
140
|
+
templating: boolean;
|
|
141
|
+
};
|
|
142
|
+
Queued: {
|
|
143
|
+
isCreateable: boolean;
|
|
144
|
+
isUpdateable: boolean;
|
|
145
|
+
retrieving: boolean;
|
|
146
|
+
templating: boolean;
|
|
147
|
+
};
|
|
148
|
+
Sent: {
|
|
149
|
+
isCreateable: boolean;
|
|
150
|
+
isUpdateable: boolean;
|
|
151
|
+
retrieving: boolean;
|
|
152
|
+
templating: boolean;
|
|
153
|
+
};
|
|
154
|
+
SurveyResponses: {
|
|
155
|
+
isCreateable: boolean;
|
|
156
|
+
isUpdateable: boolean;
|
|
157
|
+
retrieving: boolean;
|
|
158
|
+
templating: boolean;
|
|
159
|
+
};
|
|
160
|
+
UniqueClicks: {
|
|
161
|
+
isCreateable: boolean;
|
|
162
|
+
isUpdateable: boolean;
|
|
163
|
+
retrieving: boolean;
|
|
164
|
+
templating: boolean;
|
|
165
|
+
};
|
|
166
|
+
UniqueConversions: {
|
|
167
|
+
isCreateable: boolean;
|
|
168
|
+
isUpdateable: boolean;
|
|
169
|
+
retrieving: boolean;
|
|
170
|
+
templating: boolean;
|
|
171
|
+
};
|
|
172
|
+
UniqueOpens: {
|
|
173
|
+
isCreateable: boolean;
|
|
174
|
+
isUpdateable: boolean;
|
|
175
|
+
retrieving: boolean;
|
|
176
|
+
templating: boolean;
|
|
177
|
+
};
|
|
178
|
+
CorrelationID: {
|
|
179
|
+
isCreateable: boolean;
|
|
180
|
+
isUpdateable: boolean;
|
|
181
|
+
retrieving: boolean;
|
|
182
|
+
templating: boolean;
|
|
183
|
+
};
|
|
184
|
+
CreatedDate: {
|
|
185
|
+
isCreateable: boolean;
|
|
186
|
+
isUpdateable: boolean;
|
|
187
|
+
retrieving: boolean; /** Listed in the type documentation but not retrievable */
|
|
188
|
+
templating: boolean;
|
|
189
|
+
};
|
|
190
|
+
ModifiedDate: {
|
|
191
|
+
isCreateable: boolean;
|
|
192
|
+
isUpdateable: boolean;
|
|
193
|
+
retrieving: boolean; /** Listed in the type documentation but not retrievable */
|
|
194
|
+
templating: boolean;
|
|
195
|
+
};
|
|
196
|
+
r__triggeredSend_name: {
|
|
197
|
+
skipValidation: boolean;
|
|
198
|
+
};
|
|
199
|
+
r__triggeredSend_key: {
|
|
200
|
+
skipValidation: boolean;
|
|
201
|
+
};
|
|
202
|
+
r__folder_Path: {
|
|
203
|
+
skipValidation: boolean;
|
|
204
|
+
};
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
export default _default;
|
|
208
|
+
//# sourceMappingURL=TriggeredSendSummary.definition.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TriggeredSendSummary.definition.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/definitions/TriggeredSendSummary.definition.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAqM8B,2DAA2D;;;;;;iCAM3D,2DAA2D"}
|
|
@@ -43,10 +43,11 @@ declare namespace DevOps {
|
|
|
43
43
|
* create markdown file for deployment listing
|
|
44
44
|
*
|
|
45
45
|
* @param {string} directory -
|
|
46
|
+
* @param {string} filterPathsCSV -
|
|
46
47
|
* @param {object} jsonReport -
|
|
47
48
|
* @returns {void}
|
|
48
49
|
*/
|
|
49
|
-
function document(directory: string, jsonReport: object): void;
|
|
50
|
+
function document(directory: string, filterPathsCSV: string, jsonReport: object): void;
|
|
50
51
|
/**
|
|
51
52
|
* should return only the json for all but asset, query and script that are saved as multiple files
|
|
52
53
|
* additionally, the documentation for dataExtension and automation should be returned
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devops.d.ts","sourceRoot":"","sources":["../../../lib/util/devops.js"],"names":[],"mappings":";yBAea,OAAO,wBAAwB,EAAE,UAAU;uBAC3C,OAAO,wBAAwB,EAAE,QAAQ;oBACzC,OAAO,wBAAwB,EAAE,KAAK;0BACtC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;2BAChD,OAAO,wBAAwB,EAAE,YAAY;sBAC7C,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;oCACnD,OAAO,wBAAwB,EAAE,qBAAqB;mCACtD,OAAO,wBAAwB,EAAE,oBAAoB;gCACrD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY;;IAOtD;;;;;;;;;;OAUG;IACH,kCAPW,OAAO,UACP,MAAM,oBACN,OAAO,mBACP,MAAM,kBACN,MAAM,GACJ,OAAO,CAAE,YAAY,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"devops.d.ts","sourceRoot":"","sources":["../../../lib/util/devops.js"],"names":[],"mappings":";yBAea,OAAO,wBAAwB,EAAE,UAAU;uBAC3C,OAAO,wBAAwB,EAAE,QAAQ;oBACzC,OAAO,wBAAwB,EAAE,KAAK;0BACtC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;2BAChD,OAAO,wBAAwB,EAAE,YAAY;sBAC7C,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;oCACnD,OAAO,wBAAwB,EAAE,qBAAqB;mCACtD,OAAO,wBAAwB,EAAE,oBAAoB;gCACrD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY;;IAOtD;;;;;;;;;;OAUG;IACH,kCAPW,OAAO,UACP,MAAM,oBACN,OAAO,mBACP,MAAM,kBACN,MAAM,GACJ,OAAO,CAAE,YAAY,EAAE,CAAC,CAmXpC;IAED;;;;;;;;OAQG;IACH,2CANW,OAAO,SACP,MAAM,YACN,YAAY,EAAE,kBACd,MAAM,GACJ,OAAO,CAAE,YAAY,EAAE,CAAC,CAsJpC;IAED;;;;;;;OAOG;IACH,6BALW,MAAM,kBACN,MAAM,cACN,MAAM,GACJ,IAAI,CAmChB;IAED;;;;;;;;;OASG;IACH,sCANW,OAAO,YACP,QAAQ,gBACR,MAAM,UACN,MAAM,EAAE,GACN,OAAO,CAAE,MAAM,EAAE,CAAC,CAM9B;IACD;;;;;;;OAOG;IACH,4CALW,YAAY,EAAE,gBACd,MAAM,cACN,OAAO,gBACP,MAAM,QAgGhB"}
|
|
@@ -328,10 +328,11 @@ export namespace Util {
|
|
|
328
328
|
* returns true if no LIKE filter is defined or if all filters match
|
|
329
329
|
*
|
|
330
330
|
* @param {MetadataTypeItem} metadata a single metadata item
|
|
331
|
+
* @param {object} definition type definition
|
|
331
332
|
* @param {object} [filters] only used in recursive calls
|
|
332
333
|
* @returns {boolean} true if no LIKE filter is defined or if all filters match
|
|
333
334
|
*/
|
|
334
|
-
function fieldsLike(metadata: MetadataTypeItem, filters?: object): boolean;
|
|
335
|
+
function fieldsLike(metadata: MetadataTypeItem, definition: object, filters?: object): boolean;
|
|
335
336
|
/**
|
|
336
337
|
* helper used by SOAP methods to ensure the type always uses an upper-cased first letter
|
|
337
338
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../lib/util/util.js"],"names":[],"mappings":";;;;;;;yBA+Ce,eAAe;;;;;IAO1B;;;;;;OAMG;IACH;;sBAHW,MAAM,EAAE;;MAalB;IAED;;;;;;OAMG;IACH,iCAJW,MAAM,EAAE,UACR,MAAM,GACJ,OAAO,CAInB;IAED;;;;;;OAMG;IACH,sCAJW,MAAM,EAAE,UACR,MAAM,GACJ,MAAM,CAIlB;IAED;;;;;;OAMG;IACH,6BAJW,MAAM,cACN,OAAO,GACL,OAAO,CAcnB;IAED;;;;;;OAMG;IACH,oCAJW,MAAM,EAAE,cACR,OAAO,GACL,OAAO,CAYnB;IAED;;;;;OAKG;IACH,kCAHW,MAAM,cACN,OAAO,QAqCjB;IACD;;;;;;OAMG;IACH,oDALW,MAAM,GAAG,YAAY,WACrB,MAAM,EAAE,gBACR,MAAM,GACJ,YAAY,GAAG,SAAS,CAwBpC;IAED;;;;OAIG;IACH,6BAFa,IAAI,CAKhB;IAED;;;;;;OAMG;IACH,2BAHW,GAAC,GACC,OAAO,CAInB;IAED;;;;;;OAMG;IACH,4BAHW,GAAC,GACC,OAAO,CAInB;IAQQ,wBAJE,MAAM,GAAG,MAAM,GAAG,OAAO,WAAW,MAAM,SAC1C,MAAM,GAAG,MAAM,GAAG,OAAO,WAAW,MAAM,GACxC,OAAO,CAgBnB;IAQc,sDAFF,OAAO,CAQnB;IAQe,+BAJL,MAAM,SACN,MAAM,GACJ,OAAO,CAYnB;IAED;;;;;;OAMG;IACH,oCAJW,MAAM,kBACN,OAAO,GACL,OAAO,CAoBnB;IAED;;;;;;;OAOG;IACH,+BALW,OAAO,gBACP,MAAM,kBACN,OAAO,GACL,OAAO,CAgBnB;IAED;;;;;OAKG;IACH,yCAHW,MAAM,GACJ;QAAC,IAAI,EAAC,MAAM,CAAC;QAAC,OAAO,EAAC,MAAM,CAAA;KAAC,CAWzC;IAED;;;;;OAKG;IACH,+BAHW,uBAAuB,GAAC,kBAAk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GACd,MAAM,CAIlB;IAED;;;;;;OAMG;IACH,oCAJW,GAAG,gBACH,gBAAgB,GACd,MAAM,CAIlB;IAED;;;;;;OAMG;IACH,gCAJW,GAAG,gBACH,gBAAgB,GACd,MAAM,CAOlB;IAED;;;;;;OAMG;IACH,iCAJW,MAAM,EAAE,WACR,MAAM,GACJ,IAAI,CAUhB;IAED;;;;;;OAMG;IACH,+BAJW,MAAM,EAAE,GAAG,MAAM,SACjB,OAAO,GACL,MAAM,CAgBlB;IAED;;;;;OAKG;IACH,mBAHW,MAAM,GACJ,OAAO,CAAE,IAAI,CAAC,CAU1B;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,uBAHW,MAAM,GACJ,MAAM,CAoClB;IAED;;;;;;OAMG;IACH,gCAJW,MAAM,UACN,MAAM,GACJ,OAAO,CAenB;IAED
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../lib/util/util.js"],"names":[],"mappings":";;;;;;;yBA+Ce,eAAe;;;;;IAO1B;;;;;;OAMG;IACH;;sBAHW,MAAM,EAAE;;MAalB;IAED;;;;;;OAMG;IACH,iCAJW,MAAM,EAAE,UACR,MAAM,GACJ,OAAO,CAInB;IAED;;;;;;OAMG;IACH,sCAJW,MAAM,EAAE,UACR,MAAM,GACJ,MAAM,CAIlB;IAED;;;;;;OAMG;IACH,6BAJW,MAAM,cACN,OAAO,GACL,OAAO,CAcnB;IAED;;;;;;OAMG;IACH,oCAJW,MAAM,EAAE,cACR,OAAO,GACL,OAAO,CAYnB;IAED;;;;;OAKG;IACH,kCAHW,MAAM,cACN,OAAO,QAqCjB;IACD;;;;;;OAMG;IACH,oDALW,MAAM,GAAG,YAAY,WACrB,MAAM,EAAE,gBACR,MAAM,GACJ,YAAY,GAAG,SAAS,CAwBpC;IAED;;;;OAIG;IACH,6BAFa,IAAI,CAKhB;IAED;;;;;;OAMG;IACH,2BAHW,GAAC,GACC,OAAO,CAInB;IAED;;;;;;OAMG;IACH,4BAHW,GAA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
|
|
37
37
|
import transactionalPush from './metadataTypes/definitions/TransactionalPush.definition.js';
|
|
38
38
|
import transactionalSMS from './metadataTypes/definitions/TransactionalSMS.definition.js';
|
|
39
39
|
import triggeredSend from './metadataTypes/definitions/TriggeredSend.definition.js';
|
|
40
|
+
import triggeredSendSummary from './metadataTypes/definitions/TriggeredSendSummary.definition.js';
|
|
40
41
|
import user from './metadataTypes/definitions/User.definition.js';
|
|
41
42
|
import verification from './metadataTypes/definitions/Verification.definition.js';
|
|
42
43
|
|
|
@@ -81,6 +82,7 @@ export default {
|
|
|
81
82
|
transactionalPush,
|
|
82
83
|
transactionalSMS,
|
|
83
84
|
triggeredSend,
|
|
85
|
+
triggeredSendSummary,
|
|
84
86
|
user,
|
|
85
87
|
verification,
|
|
86
88
|
};
|
package/lib/MetadataTypeInfo.js
CHANGED
|
@@ -36,6 +36,7 @@ import transactionalEmail from './metadataTypes/TransactionalEmail.js';
|
|
|
36
36
|
import transactionalPush from './metadataTypes/TransactionalPush.js';
|
|
37
37
|
import transactionalSMS from './metadataTypes/TransactionalSMS.js';
|
|
38
38
|
import triggeredSend from './metadataTypes/TriggeredSend.js';
|
|
39
|
+
import triggeredSendSummary from './metadataTypes/TriggeredSendSummary.js';
|
|
39
40
|
import user from './metadataTypes/User.js';
|
|
40
41
|
import verification from './metadataTypes/Verification.js';
|
|
41
42
|
|
|
@@ -79,6 +80,7 @@ export default {
|
|
|
79
80
|
transactionalPush,
|
|
80
81
|
transactionalSMS,
|
|
81
82
|
triggeredSend,
|
|
83
|
+
triggeredSendSummary,
|
|
82
84
|
user,
|
|
83
85
|
verification,
|
|
84
86
|
};
|
package/lib/cli.js
CHANGED
|
@@ -68,6 +68,11 @@ yargs(hideBin(process.argv))
|
|
|
68
68
|
group: 'Options for retrieve:',
|
|
69
69
|
describe:
|
|
70
70
|
'allows overwriting options.formatOnSave from the config file. Disable formatting via --no-format',
|
|
71
|
+
})
|
|
72
|
+
.option('purge', {
|
|
73
|
+
type: 'boolean',
|
|
74
|
+
group: 'Options for retrieve:',
|
|
75
|
+
describe: 'deletes the relevant retrieve folder before retrieving',
|
|
71
76
|
}),
|
|
72
77
|
(argv) => {
|
|
73
78
|
Mcdev.setOptions(argv);
|
package/lib/index.js
CHANGED
|
@@ -436,9 +436,30 @@ class Mcdev {
|
|
|
436
436
|
const areKeySet = Array.isArray(selectedTypesArr)
|
|
437
437
|
? !!keys
|
|
438
438
|
: selectedTypesArr[selectedType] !== null;
|
|
439
|
-
if (!areKeySet) {
|
|
440
|
-
|
|
441
|
-
|
|
439
|
+
if ((!areKeySet && !Util.OPTIONS.like) || Util.OPTIONS.purge) {
|
|
440
|
+
Util.logger.debug(`:: Cleaning output folder for ${selectedType}`);
|
|
441
|
+
// dont delete directories if we are just re-retrieving a single file or if we are re-retrieving only files matching the --like criteria
|
|
442
|
+
let isCleaned = false;
|
|
443
|
+
const MAX_RETRIES = 10;
|
|
444
|
+
let retryCount = 0;
|
|
445
|
+
do {
|
|
446
|
+
try {
|
|
447
|
+
await File.remove(File.normalizePath(removePathArr));
|
|
448
|
+
isCleaned = true;
|
|
449
|
+
} catch (ex) {
|
|
450
|
+
// to avoid EBUSY: resource busy or locked errors on Windows, we retry after a short wait
|
|
451
|
+
retryCount++;
|
|
452
|
+
if (retryCount >= MAX_RETRIES) {
|
|
453
|
+
Util.logger.error(
|
|
454
|
+
`Failed to clean output folder for ${selectedType} after ${MAX_RETRIES} attempts: ${ex && ex.message ? ex.message : ex}`
|
|
455
|
+
);
|
|
456
|
+
break;
|
|
457
|
+
}
|
|
458
|
+
await Util.sleep(100);
|
|
459
|
+
}
|
|
460
|
+
} while (!isCleaned);
|
|
461
|
+
} else {
|
|
462
|
+
Util.logger.debug(`:: NOT cleaning output folder for ${selectedType}`);
|
|
442
463
|
}
|
|
443
464
|
}
|
|
444
465
|
}
|
|
@@ -2097,7 +2118,8 @@ class Mcdev {
|
|
|
2097
2118
|
);
|
|
2098
2119
|
// reactivate logging
|
|
2099
2120
|
Util.setLoggingLevel({});
|
|
2100
|
-
|
|
2121
|
+
|
|
2122
|
+
if (Util.fieldsLike(metadataMap[originalKey], MetadataTypeDefinitions[selectedType])) {
|
|
2101
2123
|
keyArr.push(originalKey);
|
|
2102
2124
|
}
|
|
2103
2125
|
}
|
|
@@ -493,6 +493,7 @@ class Asset extends MetadataType {
|
|
|
493
493
|
|
|
494
494
|
// only when we save results do we need the complete metadata or files. caching can skip these
|
|
495
495
|
if (retrieveDir && !Array.isArray(subType)) {
|
|
496
|
+
let downloadedItemsMap = {};
|
|
496
497
|
if (items.length > 0) {
|
|
497
498
|
for (const item of items) {
|
|
498
499
|
if (item.customerKey.trim() !== item.customerKey) {
|
|
@@ -504,13 +505,21 @@ class Asset extends MetadataType {
|
|
|
504
505
|
}
|
|
505
506
|
}
|
|
506
507
|
// we have to wait on execution or it potentially causes memory reference issues when changing between BUs
|
|
507
|
-
await this.requestAndSaveExtended(
|
|
508
|
+
downloadedItemsMap = await this.requestAndSaveExtended(
|
|
509
|
+
items,
|
|
510
|
+
subType,
|
|
511
|
+
retrieveDir,
|
|
512
|
+
templateVariables
|
|
513
|
+
);
|
|
508
514
|
}
|
|
509
515
|
// always show the summary even if we already had the progress bar in the console
|
|
510
|
-
Util.logger.info(
|
|
516
|
+
Util.logger.info(
|
|
517
|
+
` Downloaded asset${subType ? '-' + subType : ''}: ${Object.keys(downloadedItemsMap).length}`
|
|
518
|
+
);
|
|
519
|
+
return Object.values(downloadedItemsMap);
|
|
520
|
+
} else {
|
|
521
|
+
return items;
|
|
511
522
|
}
|
|
512
|
-
|
|
513
|
-
return items;
|
|
514
523
|
}
|
|
515
524
|
|
|
516
525
|
/**
|
|
@@ -541,6 +550,7 @@ class Asset extends MetadataType {
|
|
|
541
550
|
const completed = [];
|
|
542
551
|
const failed = [];
|
|
543
552
|
const metadataMap = {};
|
|
553
|
+
let filterCounter = 0;
|
|
544
554
|
|
|
545
555
|
// put in do loop to manage issues with connection timeout
|
|
546
556
|
do {
|
|
@@ -550,7 +560,7 @@ class Asset extends MetadataType {
|
|
|
550
560
|
try {
|
|
551
561
|
const rateLimit = pLimit(5);
|
|
552
562
|
|
|
553
|
-
|
|
563
|
+
await Promise.all(
|
|
554
564
|
items.map((item, index) =>
|
|
555
565
|
rateLimit(async () => {
|
|
556
566
|
const metadataMapSaveSingle = {};
|
|
@@ -586,15 +596,23 @@ class Asset extends MetadataType {
|
|
|
586
596
|
}
|
|
587
597
|
completed.push(item.id);
|
|
588
598
|
if (metadataMapSaveSingle[item.customerKey]) {
|
|
589
|
-
await this.saveResults(
|
|
599
|
+
const savedItem = await this.saveResults(
|
|
590
600
|
metadataMapSaveSingle,
|
|
591
601
|
retrieveDir,
|
|
592
602
|
'asset-' + subType,
|
|
593
603
|
templateVariables
|
|
594
604
|
);
|
|
605
|
+
if (!savedItem[item.customerKey]) {
|
|
606
|
+
// filtered by like-option
|
|
607
|
+
delete metadataMap[item.customerKey];
|
|
608
|
+
filterCounter++;
|
|
609
|
+
}
|
|
595
610
|
}
|
|
596
611
|
// update the current value in your application..
|
|
597
612
|
extendedBar.increment();
|
|
613
|
+
if (metadataMap[item.customerKey]) {
|
|
614
|
+
return metadataMap[item.customerKey];
|
|
615
|
+
}
|
|
598
616
|
})
|
|
599
617
|
)
|
|
600
618
|
);
|
|
@@ -602,7 +620,12 @@ class Asset extends MetadataType {
|
|
|
602
620
|
// stop the progress bar
|
|
603
621
|
extendedBar.stop();
|
|
604
622
|
Asset._resetLogLevel(loggerLevelBak, failed);
|
|
605
|
-
|
|
623
|
+
if (filterCounter) {
|
|
624
|
+
Util.logger.info(
|
|
625
|
+
` - Filtered ${this.definition.type}-${subType}: ${filterCounter} (downloaded but not saved to disk)`
|
|
626
|
+
);
|
|
627
|
+
}
|
|
628
|
+
return metadataMap;
|
|
606
629
|
} catch (ex) {
|
|
607
630
|
extendedBar.stop();
|
|
608
631
|
Asset._resetLogLevel(loggerLevelBak, failed);
|
|
@@ -2554,9 +2554,12 @@ class Journey extends MetadataType {
|
|
|
2554
2554
|
break;
|
|
2555
2555
|
}
|
|
2556
2556
|
default: {
|
|
2557
|
-
|
|
2558
|
-
|
|
2557
|
+
Util.logger.info(
|
|
2558
|
+
Util.getGrayMsg(
|
|
2559
|
+
` ☇ skipping ${this.definition.type} ${key}: type ${journey.definitionType} not supported yet by validate method`
|
|
2560
|
+
)
|
|
2559
2561
|
);
|
|
2562
|
+
continue;
|
|
2560
2563
|
}
|
|
2561
2564
|
}
|
|
2562
2565
|
} // for loop
|
|
@@ -2080,6 +2080,12 @@ class MetadataType {
|
|
|
2080
2080
|
subtypeExtension,
|
|
2081
2081
|
templateVariables
|
|
2082
2082
|
);
|
|
2083
|
+
if (!savedResults[originalKey]) {
|
|
2084
|
+
// happens in case like-filter struck
|
|
2085
|
+
delete savedResults[originalKey];
|
|
2086
|
+
filterCounter++;
|
|
2087
|
+
continue;
|
|
2088
|
+
}
|
|
2083
2089
|
} catch (ex) {
|
|
2084
2090
|
Util.logger.debug(JSON.stringify(savedResults[originalKey]));
|
|
2085
2091
|
Util.logger.errorStack(
|
|
@@ -2126,7 +2132,7 @@ class MetadataType {
|
|
|
2126
2132
|
// normalize results[metadataEntry]
|
|
2127
2133
|
results[originalKey] = postRetrieveData.json;
|
|
2128
2134
|
|
|
2129
|
-
if (Util.OPTIONS.like && !Util.fieldsLike(results[originalKey])) {
|
|
2135
|
+
if (Util.OPTIONS.like && !Util.fieldsLike(results[originalKey], this.definition)) {
|
|
2130
2136
|
Util.logger.debug(`Filtered ${originalKey} because of --like option`);
|
|
2131
2137
|
return;
|
|
2132
2138
|
}
|
|
@@ -2161,7 +2167,7 @@ class MetadataType {
|
|
|
2161
2167
|
templateVariables
|
|
2162
2168
|
);
|
|
2163
2169
|
}
|
|
2164
|
-
if (Util.OPTIONS.like && !Util.fieldsLike(results[originalKey])) {
|
|
2170
|
+
if (Util.OPTIONS.like && !Util.fieldsLike(results[originalKey], this.definition)) {
|
|
2165
2171
|
Util.logger.debug(`Filtered ${originalKey} because of --like option`);
|
|
2166
2172
|
return;
|
|
2167
2173
|
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
import MetadataType from './MetadataType.js';
|
|
4
|
+
import cache from '../util/cache.js';
|
|
5
|
+
import { Util } from '../util/util.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @typedef {import('../../types/mcdev.d.js').BuObject} BuObject
|
|
9
|
+
* @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract
|
|
10
|
+
* @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem
|
|
11
|
+
* @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem
|
|
12
|
+
* @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff
|
|
13
|
+
* @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj
|
|
14
|
+
* @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap
|
|
15
|
+
* @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj
|
|
16
|
+
* @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams
|
|
17
|
+
* @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* TriggeredSendSummary MetadataType
|
|
22
|
+
*
|
|
23
|
+
* @augments MetadataType
|
|
24
|
+
*/
|
|
25
|
+
class TriggeredSendSummary extends MetadataType {
|
|
26
|
+
/**
|
|
27
|
+
* Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata
|
|
28
|
+
*
|
|
29
|
+
* @param {string} retrieveDir Directory where retrieved metadata directory will be saved
|
|
30
|
+
* @param {void | string[]} [_] unused parameter
|
|
31
|
+
* @param {void | string[]} [__] unused parameter
|
|
32
|
+
* @param {string} [key] customer key of single item to retrieve
|
|
33
|
+
* @returns {Promise.<MetadataTypeMapObj>} Promise of metadata
|
|
34
|
+
*/
|
|
35
|
+
static retrieve(retrieveDir, _, __, key) {
|
|
36
|
+
/** @type {SoapRequestParams} */
|
|
37
|
+
let requestParams = {};
|
|
38
|
+
if (key) {
|
|
39
|
+
// filter by CustomerKey when a specific key is requested
|
|
40
|
+
requestParams = {
|
|
41
|
+
filter: {
|
|
42
|
+
leftOperand: 'CustomerKey',
|
|
43
|
+
operator: 'equals',
|
|
44
|
+
rightOperand: key,
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return super.retrieveSOAP(retrieveDir, requestParams, key);
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* parses retrieved Metadata before saving
|
|
53
|
+
*
|
|
54
|
+
* @param {MetadataTypeItem} metadata a single item
|
|
55
|
+
* @returns {MetadataTypeItem | void} Array with one metadata object and one sql string
|
|
56
|
+
*/
|
|
57
|
+
static postRetrieveTasks(metadata) {
|
|
58
|
+
// CustomerKey for this type is the same as the CustomerKey of the TriggeredSend it relates to
|
|
59
|
+
const triggeredSend = cache.getByKey('triggeredSend', metadata.CustomerKey);
|
|
60
|
+
if (!triggeredSend) {
|
|
61
|
+
Util.logger.verbose(
|
|
62
|
+
`Could not find related TriggeredSend with CustomerKey '${metadata.CustomerKey}' for the TriggeredSendSummary.`
|
|
63
|
+
);
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
metadata['TriggeredSend.CategoryID'] = triggeredSend.CategoryID;
|
|
67
|
+
// folder path for a TriggeredSendSummary is the same as for the related TriggeredSend. CategoryID is not retrievable for this type, so use the TriggeredSend's field
|
|
68
|
+
this.setFolderPath(metadata);
|
|
69
|
+
delete metadata['TriggeredSend.CategoryID'];
|
|
70
|
+
metadata.r__triggeredSend_name = triggeredSend.Name;
|
|
71
|
+
metadata.r__triggeredSend_key = triggeredSend.CustomerKey;
|
|
72
|
+
return metadata;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* retrieves the folder path from cache and updates the TriggeredSendSummary metadata with it after retrieve
|
|
76
|
+
*
|
|
77
|
+
* @param {MetadataTypeItem} metadata a single item
|
|
78
|
+
*/
|
|
79
|
+
static setFolderPath(metadata) {
|
|
80
|
+
try {
|
|
81
|
+
metadata.r__folder_Path = cache.searchForField(
|
|
82
|
+
'folder',
|
|
83
|
+
metadata[this.definition.folderIdField],
|
|
84
|
+
'ID',
|
|
85
|
+
'Path'
|
|
86
|
+
);
|
|
87
|
+
delete metadata[this.definition.folderIdField];
|
|
88
|
+
} catch {
|
|
89
|
+
Util.logger.verbose(
|
|
90
|
+
` ☇ skipping ${this.definition.typeName} '${metadata.Name}'/'${metadata.CustomerKey}': Could not find folder.`
|
|
91
|
+
);
|
|
92
|
+
// do not save this Triggered Send Summary because it would not be visible in the user interface
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// Assign definition to static attributes
|
|
99
|
+
import MetadataTypeDefinitions from '../MetadataTypeDefinitions.js';
|
|
100
|
+
TriggeredSendSummary.definition = MetadataTypeDefinitions.triggeredSendSummary;
|
|
101
|
+
|
|
102
|
+
export default TriggeredSendSummary;
|