mcdev 8.0.2 → 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 +2 -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/DataExtensionField.d.ts +1 -7
- package/@types/lib/metadataTypes/DataExtensionField.d.ts.map +1 -1
- package/@types/lib/metadataTypes/Journey.d.ts +6 -0
- 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/DataExtensionField.definition.d.ts +1 -0
- package/@types/lib/metadataTypes/definitions/Journey.definition.d.ts +6 -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 +29 -8
- package/lib/metadataTypes/Asset.js +30 -7
- package/lib/metadataTypes/Automation.js +1 -1
- package/lib/metadataTypes/DataExtensionField.js +102 -49
- package/lib/metadataTypes/Folder.js +2 -2
- 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/DataExtensionField.definition.js +1 -0
- package/lib/metadataTypes/definitions/Journey.definition.js +6 -0
- package/lib/metadataTypes/definitions/TriggeredSendSummary.definition.js +211 -0
- package/lib/util/devops.js +33 -15
- 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/dataExtensionField/retrieve-Name=FirstName-response.xml +78 -0
- package/test/resources/9999999/dataExtensionField/retrieve-Name=LastName-response.xml +78 -0
- 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 -14
- package/test/type.dataExtensionField.test.js +81 -0
- package/test/type.journey.test.js +37 -2
- package/test/type.triggeredSendSummary.test.js +45 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
|
|
3
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
4
|
+
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
|
5
|
+
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
|
|
6
|
+
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
|
|
7
|
+
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
|
|
8
|
+
<soap:Header>
|
|
9
|
+
<wsa:Action>RetrieveResponse</wsa:Action>
|
|
10
|
+
<wsa:MessageID>urn:uuid:6d2f81c8-80ab-44d5-8664-206753e7ac8d</wsa:MessageID>
|
|
11
|
+
<wsa:RelatesTo>urn:uuid:a7354389-079e-4844-93b5-af6b7bf1d535</wsa:RelatesTo>
|
|
12
|
+
<wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To>
|
|
13
|
+
<wsse:Security>
|
|
14
|
+
<wsu:Timestamp wsu:Id="Timestamp-468a08b7-c8fd-44bf-a2c8-fd6063127ca6">
|
|
15
|
+
<wsu:Created>2022-04-21T19:21:52Z</wsu:Created>
|
|
16
|
+
<wsu:Expires>2022-04-21T19:26:52Z</wsu:Expires>
|
|
17
|
+
</wsu:Timestamp>
|
|
18
|
+
</wsse:Security>
|
|
19
|
+
</soap:Header>
|
|
20
|
+
<soap:Body>
|
|
21
|
+
<RetrieveResponseMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
|
|
22
|
+
<OverallStatus>OK</OverallStatus>
|
|
23
|
+
<RequestID>cfe51e71-6a2b-4cb4-aecd-3777076d63bc</RequestID>
|
|
24
|
+
<Results xsi:type="DataExtensionField">
|
|
25
|
+
<PartnerKey xsi:nil="true" />
|
|
26
|
+
<ObjectID>42760528-a8c5-44dd-8c1d-ff34e5daee54</ObjectID>
|
|
27
|
+
<CustomerKey>[testExisting_dataExtension].[FirstName]</CustomerKey>
|
|
28
|
+
<Name>FirstName</Name>
|
|
29
|
+
<Scale>0</Scale>
|
|
30
|
+
<DefaultValue />
|
|
31
|
+
<MaxLength>50</MaxLength>
|
|
32
|
+
<IsRequired>false</IsRequired>
|
|
33
|
+
<Ordinal>0</Ordinal>
|
|
34
|
+
<IsPrimaryKey>false</IsPrimaryKey>
|
|
35
|
+
<FieldType>Text</FieldType>
|
|
36
|
+
<DataExtension>
|
|
37
|
+
<PartnerKey xsi:nil="true" />
|
|
38
|
+
<ObjectID xsi:nil="true" />
|
|
39
|
+
<CustomerKey>testExisting_dataExtension</CustomerKey>
|
|
40
|
+
</DataExtension>
|
|
41
|
+
</Results>
|
|
42
|
+
<Results xsi:type="DataExtensionField">
|
|
43
|
+
<PartnerKey xsi:nil="true" />
|
|
44
|
+
<ObjectID>5ccee5f6-f282-4741-899d-400b05c57425</ObjectID>
|
|
45
|
+
<CustomerKey>[testExisting_event - 2024-07-05T080154625].[FirstName]</CustomerKey>
|
|
46
|
+
<Name>FirstName</Name>
|
|
47
|
+
<DefaultValue />
|
|
48
|
+
<MaxLength>256</MaxLength>
|
|
49
|
+
<IsRequired>false</IsRequired>
|
|
50
|
+
<Ordinal>4</Ordinal>
|
|
51
|
+
<IsPrimaryKey>false</IsPrimaryKey>
|
|
52
|
+
<FieldType>Text</FieldType>
|
|
53
|
+
<DataExtension>
|
|
54
|
+
<PartnerKey xsi:nil="true" />
|
|
55
|
+
<ObjectID xsi:nil="true" />
|
|
56
|
+
<CustomerKey>testExisting_event - 2024-07-05T080154625</CustomerKey>
|
|
57
|
+
</DataExtension>
|
|
58
|
+
</Results>
|
|
59
|
+
<Results xsi:type="DataExtensionField">
|
|
60
|
+
<PartnerKey xsi:nil="true" />
|
|
61
|
+
<ObjectID>5ccee5f6-f282-4741-899d-400b05c57425</ObjectID>
|
|
62
|
+
<CustomerKey>[testNew_event_withSchema - 2024-07-08T014814443].[FirstName]</CustomerKey>
|
|
63
|
+
<Name>FirstName</Name>
|
|
64
|
+
<DefaultValue />
|
|
65
|
+
<MaxLength>256</MaxLength>
|
|
66
|
+
<IsRequired>false</IsRequired>
|
|
67
|
+
<Ordinal>4</Ordinal>
|
|
68
|
+
<IsPrimaryKey>false</IsPrimaryKey>
|
|
69
|
+
<FieldType>Text</FieldType>
|
|
70
|
+
<DataExtension>
|
|
71
|
+
<PartnerKey xsi:nil="true" />
|
|
72
|
+
<ObjectID xsi:nil="true" />
|
|
73
|
+
<CustomerKey>testNew_event_withSchema - 2024-07-08T014814443</CustomerKey>
|
|
74
|
+
</DataExtension>
|
|
75
|
+
</Results>
|
|
76
|
+
</RetrieveResponseMsg>
|
|
77
|
+
</soap:Body>
|
|
78
|
+
</soap:Envelope>
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
|
|
3
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
4
|
+
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
|
5
|
+
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
|
|
6
|
+
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
|
|
7
|
+
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
|
|
8
|
+
<soap:Header>
|
|
9
|
+
<wsa:Action>RetrieveResponse</wsa:Action>
|
|
10
|
+
<wsa:MessageID>urn:uuid:6d2f81c8-80ab-44d5-8664-206753e7ac8d</wsa:MessageID>
|
|
11
|
+
<wsa:RelatesTo>urn:uuid:a7354389-079e-4844-93b5-af6b7bf1d535</wsa:RelatesTo>
|
|
12
|
+
<wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To>
|
|
13
|
+
<wsse:Security>
|
|
14
|
+
<wsu:Timestamp wsu:Id="Timestamp-468a08b7-c8fd-44bf-a2c8-fd6063127ca6">
|
|
15
|
+
<wsu:Created>2022-04-21T19:21:52Z</wsu:Created>
|
|
16
|
+
<wsu:Expires>2022-04-21T19:26:52Z</wsu:Expires>
|
|
17
|
+
</wsu:Timestamp>
|
|
18
|
+
</wsse:Security>
|
|
19
|
+
</soap:Header>
|
|
20
|
+
<soap:Body>
|
|
21
|
+
<RetrieveResponseMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
|
|
22
|
+
<OverallStatus>OK</OverallStatus>
|
|
23
|
+
<RequestID>cfe51e71-6a2b-4cb4-aecd-3777076d63bc</RequestID>
|
|
24
|
+
<Results xsi:type="DataExtensionField">
|
|
25
|
+
<PartnerKey xsi:nil="true" />
|
|
26
|
+
<ObjectID>bea0e308-5d45-4181-a673-da9972a7c674</ObjectID>
|
|
27
|
+
<CustomerKey>[testExisting_dataExtension].[LastName]</CustomerKey>
|
|
28
|
+
<Name>LastName</Name>
|
|
29
|
+
<Scale>0</Scale>
|
|
30
|
+
<DefaultValue />
|
|
31
|
+
<MaxLength>50</MaxLength>
|
|
32
|
+
<IsRequired>false</IsRequired>
|
|
33
|
+
<Ordinal>1</Ordinal>
|
|
34
|
+
<IsPrimaryKey>false</IsPrimaryKey>
|
|
35
|
+
<FieldType>Text</FieldType>
|
|
36
|
+
<DataExtension>
|
|
37
|
+
<PartnerKey xsi:nil="true" />
|
|
38
|
+
<ObjectID xsi:nil="true" />
|
|
39
|
+
<CustomerKey>testExisting_dataExtension</CustomerKey>
|
|
40
|
+
</DataExtension>
|
|
41
|
+
</Results>
|
|
42
|
+
<Results xsi:type="DataExtensionField">
|
|
43
|
+
<PartnerKey xsi:nil="true" />
|
|
44
|
+
<ObjectID>95948e52-e8d0-4908-98a9-cc34cd84233e</ObjectID>
|
|
45
|
+
<CustomerKey>[testExisting_event - 2024-07-05T080154625].[LastName]</CustomerKey>
|
|
46
|
+
<Name>LastName</Name>
|
|
47
|
+
<DefaultValue />
|
|
48
|
+
<MaxLength>256</MaxLength>
|
|
49
|
+
<IsRequired>false</IsRequired>
|
|
50
|
+
<Ordinal>5</Ordinal>
|
|
51
|
+
<IsPrimaryKey>false</IsPrimaryKey>
|
|
52
|
+
<FieldType>Text</FieldType>
|
|
53
|
+
<DataExtension>
|
|
54
|
+
<PartnerKey xsi:nil="true" />
|
|
55
|
+
<ObjectID xsi:nil="true" />
|
|
56
|
+
<CustomerKey>testExisting_event - 2024-07-05T080154625</CustomerKey>
|
|
57
|
+
</DataExtension>
|
|
58
|
+
</Results>
|
|
59
|
+
<Results xsi:type="DataExtensionField">
|
|
60
|
+
<PartnerKey xsi:nil="true" />
|
|
61
|
+
<ObjectID>95948e52-e8d0-4908-98a9-cc34cd84233e</ObjectID>
|
|
62
|
+
<CustomerKey>[testNew_event_withSchema - 2024-07-08T014814443].[LastName]</CustomerKey>
|
|
63
|
+
<Name>LastName</Name>
|
|
64
|
+
<DefaultValue />
|
|
65
|
+
<MaxLength>256</MaxLength>
|
|
66
|
+
<IsRequired>false</IsRequired>
|
|
67
|
+
<Ordinal>5</Ordinal>
|
|
68
|
+
<IsPrimaryKey>false</IsPrimaryKey>
|
|
69
|
+
<FieldType>Text</FieldType>
|
|
70
|
+
<DataExtension>
|
|
71
|
+
<PartnerKey xsi:nil="true" />
|
|
72
|
+
<ObjectID xsi:nil="true" />
|
|
73
|
+
<CustomerKey>testNew_event_withSchema - 2024-07-08T014814443</CustomerKey>
|
|
74
|
+
</DataExtension>
|
|
75
|
+
</Results>
|
|
76
|
+
</RetrieveResponseMsg>
|
|
77
|
+
</soap:Body>
|
|
78
|
+
</soap:Envelope>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"CustomerKey": "testExisting_triggeredSend",
|
|
3
|
+
"Sent": 10,
|
|
4
|
+
"NotSentDueToOptOut": 0,
|
|
5
|
+
"NotSentDueToUndeliverable": 0,
|
|
6
|
+
"Bounces": 0,
|
|
7
|
+
"Opens": 0,
|
|
8
|
+
"Clicks": 0,
|
|
9
|
+
"UniqueOpens": 0,
|
|
10
|
+
"UniqueClicks": 0,
|
|
11
|
+
"OptOuts": 0,
|
|
12
|
+
"SurveyResponses": 0,
|
|
13
|
+
"FTAFRequests": 0,
|
|
14
|
+
"FTAFEmailsSent": 0,
|
|
15
|
+
"FTAFOptIns": 0,
|
|
16
|
+
"Conversions": 0,
|
|
17
|
+
"UniqueConversions": 0,
|
|
18
|
+
"InProcess": 0,
|
|
19
|
+
"NotSentDueToError": 0,
|
|
20
|
+
"Queued": 0,
|
|
21
|
+
"r__folder_Path": "Triggered Sends",
|
|
22
|
+
"r__triggeredSend_name": "testExisting_triggeredSend",
|
|
23
|
+
"r__triggeredSend_key": "testExisting_triggeredSend"
|
|
24
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
|
|
3
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
4
|
+
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
|
5
|
+
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
|
|
6
|
+
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
|
|
7
|
+
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
|
|
8
|
+
<soap:Header>
|
|
9
|
+
<wsa:Action>RetrieveResponse</wsa:Action>
|
|
10
|
+
<wsa:MessageID>urn:uuid:8fe86c01-56d5-4c56-8ac2-991578c79485</wsa:MessageID>
|
|
11
|
+
<wsa:RelatesTo>urn:uuid:592f71ac-78a0-45a2-8cfe-37a91fc6cfd5</wsa:RelatesTo>
|
|
12
|
+
<wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To>
|
|
13
|
+
<wsse:Security>
|
|
14
|
+
<wsu:Timestamp wsu:Id="Timestamp-675af14a-b6a1-44a5-b7e7-4a76c6d18424">
|
|
15
|
+
<wsu:Created>2023-02-01T10:29:21Z</wsu:Created>
|
|
16
|
+
<wsu:Expires>2023-02-01T10:34:21Z</wsu:Expires>
|
|
17
|
+
</wsu:Timestamp>
|
|
18
|
+
</wsse:Security>
|
|
19
|
+
</soap:Header>
|
|
20
|
+
<soap:Body>
|
|
21
|
+
<RetrieveResponseMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
|
|
22
|
+
<OverallStatus>OK</OverallStatus>
|
|
23
|
+
<RequestID>a90dda5e-aeba-440a-82ce-74fb2abf5eb2</RequestID>
|
|
24
|
+
<Results xsi:type="TriggeredSendSummary">
|
|
25
|
+
<PartnerKey xsi:nil="true" />
|
|
26
|
+
<ObjectID>b3150cf0-6e78-e811-80d4-1402ec721c9d</ObjectID>
|
|
27
|
+
<CustomerKey>testExisting_triggeredSend</CustomerKey>
|
|
28
|
+
<Sent>10</Sent>
|
|
29
|
+
<NotSentDueToOptOut>0</NotSentDueToOptOut>
|
|
30
|
+
<NotSentDueToUndeliverable>0</NotSentDueToUndeliverable>
|
|
31
|
+
<Bounces>0</Bounces>
|
|
32
|
+
<Opens>0</Opens>
|
|
33
|
+
<Clicks>0</Clicks>
|
|
34
|
+
<UniqueOpens>0</UniqueOpens>
|
|
35
|
+
<UniqueClicks>0</UniqueClicks>
|
|
36
|
+
<OptOuts>0</OptOuts>
|
|
37
|
+
<SurveyResponses>0</SurveyResponses>
|
|
38
|
+
<FTAFRequests>0</FTAFRequests>
|
|
39
|
+
<FTAFEmailsSent>0</FTAFEmailsSent>
|
|
40
|
+
<FTAFOptIns>0</FTAFOptIns>
|
|
41
|
+
<Conversions>0</Conversions>
|
|
42
|
+
<UniqueConversions>0</UniqueConversions>
|
|
43
|
+
<InProcess>0</InProcess>
|
|
44
|
+
<NotSentDueToError>0</NotSentDueToError>
|
|
45
|
+
<Queued>0</Queued>
|
|
46
|
+
</Results>
|
|
47
|
+
</RetrieveResponseMsg>
|
|
48
|
+
</soap:Body>
|
|
49
|
+
</soap:Envelope>
|
|
@@ -91,6 +91,47 @@ describe('type: dataExtension', () => {
|
|
|
91
91
|
);
|
|
92
92
|
return;
|
|
93
93
|
});
|
|
94
|
+
|
|
95
|
+
it('Should not fail if shared dataExtension cannot be retrieved', async () => {
|
|
96
|
+
// WHEN
|
|
97
|
+
await handler.retrieve('testInstance/_ParentBU_', ['dataExtension', 'query']);
|
|
98
|
+
// THEN
|
|
99
|
+
assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error');
|
|
100
|
+
// get results from cache
|
|
101
|
+
const result = cache.getCache();
|
|
102
|
+
assert.equal(
|
|
103
|
+
result.dataExtension ? Object.keys(result.dataExtension).length : 0,
|
|
104
|
+
1,
|
|
105
|
+
'only one dataExtension expected'
|
|
106
|
+
);
|
|
107
|
+
assert.deepEqual(
|
|
108
|
+
await testUtils.getActualJson(
|
|
109
|
+
'testExisting_dataExtensionShared',
|
|
110
|
+
'dataExtension',
|
|
111
|
+
'_ParentBU_'
|
|
112
|
+
),
|
|
113
|
+
await testUtils.getExpectedJson('1111111', 'dataExtension', 'retrieve'),
|
|
114
|
+
|
|
115
|
+
'returned metadata was not equal expected'
|
|
116
|
+
);
|
|
117
|
+
// check if MD file was created and equals expectations
|
|
118
|
+
expect(
|
|
119
|
+
await testUtils.getActualDoc(
|
|
120
|
+
'testExisting_dataExtensionShared',
|
|
121
|
+
'dataExtension',
|
|
122
|
+
'_ParentBU_'
|
|
123
|
+
)
|
|
124
|
+
).to.equal(
|
|
125
|
+
await testUtils.getExpectedFile('1111111', 'dataExtension', 'retrieve', 'md')
|
|
126
|
+
);
|
|
127
|
+
|
|
128
|
+
assert.equal(
|
|
129
|
+
testUtils.getAPIHistoryLength(),
|
|
130
|
+
7,
|
|
131
|
+
'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
|
|
132
|
+
);
|
|
133
|
+
return;
|
|
134
|
+
});
|
|
94
135
|
});
|
|
95
136
|
|
|
96
137
|
describe('Deploy ================', () => {
|
|
@@ -348,20 +389,6 @@ describe('type: dataExtension', () => {
|
|
|
348
389
|
assert.equal(isDeleted, true, 'should have deleted the item');
|
|
349
390
|
return;
|
|
350
391
|
});
|
|
351
|
-
|
|
352
|
-
it('Should delete the dataExtensionField', async () => {
|
|
353
|
-
// WHEN
|
|
354
|
-
const isDeleted = await handler.deleteByKey(
|
|
355
|
-
'testInstance/testBU',
|
|
356
|
-
'dataExtensionField',
|
|
357
|
-
'testExisting_dataExtension.LastName'
|
|
358
|
-
);
|
|
359
|
-
// THEN
|
|
360
|
-
assert.equal(process.exitCode, 0, 'delete should not have thrown an error');
|
|
361
|
-
|
|
362
|
-
assert.equal(isDeleted, true, 'should have deleted the item');
|
|
363
|
-
return;
|
|
364
|
-
});
|
|
365
392
|
});
|
|
366
393
|
|
|
367
394
|
describe('CI/CD ================', () => {
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import * as chai from 'chai';
|
|
2
|
+
const assert = chai.assert;
|
|
3
|
+
|
|
4
|
+
import chaiFiles from 'chai-files';
|
|
5
|
+
import * as testUtils from './utils.js';
|
|
6
|
+
import handler from '../lib/index.js';
|
|
7
|
+
chai.use(chaiFiles);
|
|
8
|
+
|
|
9
|
+
describe('type: dataExtensionField', () => {
|
|
10
|
+
beforeEach(() => {
|
|
11
|
+
testUtils.mockSetup();
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
afterEach(() => {
|
|
15
|
+
testUtils.mockReset();
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
describe('Delete ================', () => {
|
|
19
|
+
it('Should delete the dataExtensionField', async () => {
|
|
20
|
+
// WHEN
|
|
21
|
+
const isDeleted = await handler.deleteByKey(
|
|
22
|
+
'testInstance/testBU',
|
|
23
|
+
'dataExtensionField',
|
|
24
|
+
'testExisting_dataExtension.LastName'
|
|
25
|
+
);
|
|
26
|
+
// THEN
|
|
27
|
+
assert.equal(process.exitCode, 0, 'delete should not have thrown an error');
|
|
28
|
+
|
|
29
|
+
assert.equal(isDeleted, true, 'should have deleted the item');
|
|
30
|
+
|
|
31
|
+
assert.equal(
|
|
32
|
+
testUtils.getAPIHistoryLength(),
|
|
33
|
+
2,
|
|
34
|
+
'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
|
|
35
|
+
);
|
|
36
|
+
return;
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it('Should mass-delete the dataExtensionField across all dataExtensions', async () => {
|
|
40
|
+
handler.setOptions({ skipInteraction: true });
|
|
41
|
+
// WHEN
|
|
42
|
+
const isDeleted = await handler.deleteByKey(
|
|
43
|
+
'testInstance/testBU',
|
|
44
|
+
'dataExtensionField',
|
|
45
|
+
'*.LastName'
|
|
46
|
+
);
|
|
47
|
+
// THEN
|
|
48
|
+
assert.equal(process.exitCode, 0, 'delete should not have thrown an error');
|
|
49
|
+
|
|
50
|
+
assert.equal(isDeleted, true, 'should have deleted the item');
|
|
51
|
+
|
|
52
|
+
assert.equal(
|
|
53
|
+
testUtils.getAPIHistoryLength(),
|
|
54
|
+
4,
|
|
55
|
+
'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
|
|
56
|
+
);
|
|
57
|
+
return;
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
it('Should mass-delete multiple dataExtensionFields across all dataExtensions', async () => {
|
|
61
|
+
handler.setOptions({ skipInteraction: true });
|
|
62
|
+
// WHEN
|
|
63
|
+
const isDeleted = await handler.deleteByKey(
|
|
64
|
+
'testInstance/testBU',
|
|
65
|
+
'dataExtensionField',
|
|
66
|
+
['*.FirstName', '*.LastName']
|
|
67
|
+
);
|
|
68
|
+
// THEN
|
|
69
|
+
assert.equal(process.exitCode, 0, 'delete should not have thrown an error');
|
|
70
|
+
|
|
71
|
+
assert.equal(isDeleted, true, 'should have deleted the item');
|
|
72
|
+
|
|
73
|
+
assert.equal(
|
|
74
|
+
testUtils.getAPIHistoryLength(),
|
|
75
|
+
8,
|
|
76
|
+
'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
|
|
77
|
+
);
|
|
78
|
+
return;
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
});
|
|
@@ -1132,13 +1132,19 @@ describe('type: journey', () => {
|
|
|
1132
1132
|
it('Should not validate a transactional journey by key', async () => {
|
|
1133
1133
|
handler.setOptions({ skipStatusCheck: true });
|
|
1134
1134
|
// WHEN
|
|
1135
|
-
await handler.validate(
|
|
1135
|
+
const validate = await handler.validate(
|
|
1136
1136
|
'testInstance/testBU',
|
|
1137
1137
|
['journey'],
|
|
1138
1138
|
['testExisting_temail_notPublished']
|
|
1139
1139
|
);
|
|
1140
1140
|
// THEN
|
|
1141
|
-
assert.equal(process.exitCode,
|
|
1141
|
+
assert.equal(process.exitCode, 0, 'validate should not have thrown an error');
|
|
1142
|
+
// retrieve result
|
|
1143
|
+
assert.deepEqual(
|
|
1144
|
+
validate['testInstance/testBU']?.journey,
|
|
1145
|
+
[],
|
|
1146
|
+
'should not have validated any journey'
|
|
1147
|
+
);
|
|
1142
1148
|
|
|
1143
1149
|
assert.equal(
|
|
1144
1150
|
testUtils.getAPIHistoryLength(),
|
|
@@ -1148,6 +1154,35 @@ describe('type: journey', () => {
|
|
|
1148
1154
|
return;
|
|
1149
1155
|
});
|
|
1150
1156
|
|
|
1157
|
+
it('Should validate a multi-step journey but not the transactional journey by key', async () => {
|
|
1158
|
+
await testUtils.copyFile(
|
|
1159
|
+
'interaction/v1/interactions/validateStatus/45f06c0a-3ed2-48b2-a6a8-b5119253f01c/get-response-success.json',
|
|
1160
|
+
'interaction/v1/interactions/validateStatus/45f06c0a-3ed2-48b2-a6a8-b5119253f01c/get-response.json'
|
|
1161
|
+
);
|
|
1162
|
+
handler.setOptions({ skipStatusCheck: true });
|
|
1163
|
+
// WHEN
|
|
1164
|
+
const validate = await handler.validate(
|
|
1165
|
+
'testInstance/testBU',
|
|
1166
|
+
['journey'],
|
|
1167
|
+
['testExisting_temail_notPublished', 'testExisting_journey_Multistep']
|
|
1168
|
+
);
|
|
1169
|
+
// THEN
|
|
1170
|
+
assert.equal(process.exitCode, 0, 'validate should not have thrown an error');
|
|
1171
|
+
// retrieve result
|
|
1172
|
+
assert.deepEqual(
|
|
1173
|
+
validate['testInstance/testBU']?.journey,
|
|
1174
|
+
['testExisting_journey_Multistep'],
|
|
1175
|
+
'should not have validated any journey'
|
|
1176
|
+
);
|
|
1177
|
+
|
|
1178
|
+
assert.equal(
|
|
1179
|
+
testUtils.getAPIHistoryLength(),
|
|
1180
|
+
3,
|
|
1181
|
+
'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
|
|
1182
|
+
);
|
|
1183
|
+
return;
|
|
1184
|
+
});
|
|
1185
|
+
|
|
1151
1186
|
it('Should validate a journey by id but w/o version (auto-picks latest version)', async () => {
|
|
1152
1187
|
await testUtils.copyFile(
|
|
1153
1188
|
'interaction/v1/interactions/validateStatus/45f06c0a-3ed2-48b2-a6a8-b5119253f01c/get-response-success.json',
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as chai from 'chai';
|
|
2
|
+
const assert = chai.assert;
|
|
3
|
+
|
|
4
|
+
import chaiFiles from 'chai-files';
|
|
5
|
+
import cache from '../lib/util/cache.js';
|
|
6
|
+
import * as testUtils from './utils.js';
|
|
7
|
+
import handler from '../lib/index.js';
|
|
8
|
+
chai.use(chaiFiles);
|
|
9
|
+
|
|
10
|
+
describe('type: triggeredSendSummary', () => {
|
|
11
|
+
beforeEach(() => {
|
|
12
|
+
testUtils.mockSetup();
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
afterEach(() => {
|
|
16
|
+
testUtils.mockReset();
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
describe('Retrieve ================', () => {
|
|
20
|
+
it('Should retrieve a triggeredSendSummary', async () => {
|
|
21
|
+
// WHEN
|
|
22
|
+
await handler.retrieve('testInstance/testBU', ['triggeredSendSummary']);
|
|
23
|
+
// THEN
|
|
24
|
+
assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error');
|
|
25
|
+
// get results from cache
|
|
26
|
+
const result = cache.getCache();
|
|
27
|
+
assert.equal(
|
|
28
|
+
result.triggeredSendSummary ? Object.keys(result.triggeredSendSummary).length : 0,
|
|
29
|
+
1,
|
|
30
|
+
'only 1 triggeredSendSummary expected'
|
|
31
|
+
);
|
|
32
|
+
assert.deepEqual(
|
|
33
|
+
await testUtils.getActualJson('testExisting_triggeredSend', 'triggeredSendSummary'),
|
|
34
|
+
await testUtils.getExpectedJson('9999999', 'triggeredSendSummary', 'get'),
|
|
35
|
+
'returned JSON was not equal expected'
|
|
36
|
+
);
|
|
37
|
+
assert.equal(
|
|
38
|
+
testUtils.getAPIHistoryLength(),
|
|
39
|
+
3,
|
|
40
|
+
'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
|
|
41
|
+
);
|
|
42
|
+
return;
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
});
|