mcdev 7.1.1 → 7.1.2
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/.gitattributes +2 -0
- package/.github/ISSUE_TEMPLATE/bug.yml +1 -0
- package/.github/PULL_REQUEST_TEMPLATE/pr_template_release.md +5 -5
- package/@types/lib/index.d.ts.map +1 -1
- package/@types/lib/metadataTypes/Asset.d.ts +2 -0
- package/@types/lib/metadataTypes/Asset.d.ts.map +1 -1
- package/@types/lib/metadataTypes/Folder.d.ts.map +1 -1
- package/@types/lib/metadataTypes/Journey.d.ts +433 -17
- package/@types/lib/metadataTypes/Journey.d.ts.map +1 -1
- package/@types/lib/metadataTypes/MetadataType.d.ts +9 -2
- package/@types/lib/metadataTypes/MetadataType.d.ts.map +1 -1
- package/@types/lib/metadataTypes/definitions/Asset.definition.d.ts +2 -0
- package/@types/lib/metadataTypes/definitions/Journey.definition.d.ts +433 -17
- package/@types/lib/util/cache.d.ts +2 -1
- package/@types/lib/util/cache.d.ts.map +1 -1
- package/@types/lib/util/util.d.ts.map +1 -1
- package/@types/types/mcdev.d.d.ts +4 -4
- package/@types/types/mcdev.d.d.ts.map +1 -1
- package/eslint.config.js +1 -0
- package/lib/cli.js +5 -0
- package/lib/index.js +2 -1
- package/lib/metadataTypes/Asset.js +86 -20
- package/lib/metadataTypes/Folder.js +15 -7
- package/lib/metadataTypes/Journey.js +3 -8
- package/lib/metadataTypes/MetadataType.js +37 -16
- package/lib/metadataTypes/definitions/Asset.definition.js +2 -0
- package/lib/metadataTypes/definitions/Event.definition.js +4 -4
- package/lib/metadataTypes/definitions/Journey.definition.js +438 -22
- package/lib/util/cache.js +4 -3
- package/lib/util/util.js +7 -2
- package/package.json +2 -2
- package/test/mockRoot/.mcdevrc.json +1 -1
- package/test/mockRoot/deploy/testInstance/testBU/asset/block/testExisting_asset_htmlblock-matchName-create.asset-block-meta.html +23 -0
- package/test/mockRoot/deploy/testInstance/testBU/asset/block/testExisting_asset_htmlblock-matchName-create.asset-block-meta.json +41 -0
- package/test/mockRoot/deploy/testInstance/testBU/asset/block/testExisting_asset_htmlblock-matchName-fail.asset-block-meta.html +23 -0
- package/test/mockRoot/deploy/testInstance/testBU/asset/block/testExisting_asset_htmlblock-matchName-fail.asset-block-meta.json +41 -0
- package/test/mockRoot/deploy/testInstance/testBU/asset/block/testExisting_asset_htmlblock-matchName.asset-block-meta.html +23 -0
- package/test/mockRoot/deploy/testInstance/testBU/asset/block/testExisting_asset_htmlblock-matchName.asset-block-meta.json +41 -0
- package/test/resourceFactory.js +13 -17
- package/test/resources/9999999/asset/v1/content/assets/1295064/patch-response.json +59 -0
- package/test/resources/9999999/asset/v1/content/assets/query/post-response-assetType.idIN1,3,14,15,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,205,206,210,211,212,213,215,216,217,218,219,220,221,222,223,224.json +219 -0
- package/test/resources/9999999/asset/v1/content/assets/query/{post-response-assetType.idIN205,206,230,232,1,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,14,193,194,15,195,196,197,198,199,200,201,202,203,210,211,212,213,3,215,216,217,218,219,220,221,222.json → post-response-assetType.idIN1,3,4,14,15,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,205,206,210,211,212,213,214,215,216,217,218,219,220,221,222.json} +19 -16
- package/test/resources/9999999/asset/v1/content/assets/query/{post-response-assetType.idIN205,206,230,232,1,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,14,193,194,15,195,196,197,198,199,200,201,202,203,210,211,212,213,3,207,208,209,5,214,4,215,216.json → post-response-assetType.idIN1,3,4,5,14,15,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,205,206,207,208,209,210,211,212,213,214,215,216,217,218.json} +77 -25
- package/test/resources/9999999/asset/v1/content/assets/query/post-response-assetType.idIN219,220,221,222,223,224,225,226,227,228,230,232.json +32 -0
- package/test/resources/9999999/asset/v1/content/assets/query/post-response-assetType.idIN223,224,225,226,227,228,230,232.json +32 -0
- package/test/resources/9999999/interaction/v1/interactions/get-response.json +1 -1
- package/test/resources/9999999/interaction/v1/interactions/key_testExisting_journey_Multistep/get-response.json +5 -1
- package/test/resources/9999999/journey/build-expected.json +0 -1
- package/test/resources/9999999/journey/get-multistep-expected.json +8 -6
- package/test/resources/9999999/journey/template-expected.json +0 -1
- package/test/resources/9999999/triggeredSend/build-expected.json +2 -1
- package/test/resources/9999999/triggeredSend/get-expected.json +2 -1
- package/test/resources/9999999/triggeredSend/template-expected.json +2 -1
- package/test/resources/9999999/triggeredSendDefinition/retrieve-TriggeredSendStatusINNew,Active,Inactive,Moved,Canceled-response.xml +1 -1
- package/test/type.asset.test.js +117 -2
- package/test/utils.js +30 -1
- package/types/mcdev.d.js +2 -2
- package/test/resources/9999999/asset/v1/content/assets/query/post-response-assetType.idIN223,224,225,226,227,228,214,4.json +0 -35
- package/test/resources/9999999/asset/v1/content/assets/query/post-response-assetType.idIN223,224,225,226,227,228.json +0 -7
- /package/test/resources/9999999/asset/v1/content/assets/query/{post-response-assetType.idIN205,206,230,232,1.json → post-response-assetType.idIN1,205,206,230,232.json} +0 -0
- /package/test/resources/9999999/asset/v1/content/assets/query/{post-response-assetType.idIN205,206,230,232,1,207,208,209,5.json → post-response-assetType.idIN1,5,205,206,207,208,209,230,232.json} +0 -0
- /package/test/resources/9999999/asset/v1/content/assets/query/{post-response-assetType.idIN174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,14.json → post-response-assetType.idIN14,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192.json} +0 -0
- /package/test/resources/9999999/asset/v1/content/assets/query/{post-response-assetType.idIN193,194,15.json → post-response-assetType.idIN15,193,194.json} +0 -0
- /package/test/resources/9999999/asset/v1/content/assets/query/{post-response-assetType.idIN217,218,219,220,221,222,223,224,225,226,227,228.json → post-response-assetType.idIN225,226,227,228,230,232.json} +0 -0
- /package/test/resources/9999999/asset/v1/content/assets/query/{post-response-assetType.idIN195,196,197,198,199,200,201,202,203,210,211,212,213,3.json → post-response-assetType.idIN3,195,196,197,198,199,200,201,202,203,210,211,212,213.json} +0 -0
- /package/test/resources/9999999/asset/v1/content/assets/query/{post-response-assetType.idIN214,4.json → post-response-assetType.idIN4,214.json} +0 -0
- /package/test/resources/9999999/asset/v1/content/assets/query/{post-response-assetType.idIN207,208,209,5.json → post-response-assetType.idIN5,207,208,209.json} +0 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"count": 1,
|
|
3
|
+
"page": 1,
|
|
4
|
+
"pageSize": 50,
|
|
5
|
+
"links": {},
|
|
6
|
+
"items": [
|
|
7
|
+
{
|
|
8
|
+
"id": 1209971,
|
|
9
|
+
"customerKey": "mobileMessage_test",
|
|
10
|
+
"assetType": { "id": 230, "name": "jsonmessage", "displayName": "JSON Message" },
|
|
11
|
+
"name": "mobileMessage_test",
|
|
12
|
+
"createdDate": "2022-12-07T02:49:36.857-06:00",
|
|
13
|
+
"createdBy": {
|
|
14
|
+
"id": 700301950,
|
|
15
|
+
"email": "joern.berkefeld@accenture.com",
|
|
16
|
+
"name": "J├Ârn Berkefeld (ASGR)",
|
|
17
|
+
"userId": "700301950"
|
|
18
|
+
},
|
|
19
|
+
"modifiedDate": "2022-12-07T02:49:57.44-06:00",
|
|
20
|
+
"modifiedBy": {
|
|
21
|
+
"id": 700301950,
|
|
22
|
+
"email": "joern.berkefeld@accenture.com",
|
|
23
|
+
"name": "J├Ârn Berkefeld (ASGR)",
|
|
24
|
+
"userId": "700301950"
|
|
25
|
+
},
|
|
26
|
+
"status": { "id": 1, "name": "Draft" },
|
|
27
|
+
"category": { "id": 89397, "name": "Content Builder", "parentId": 0 },
|
|
28
|
+
"availableViews": ["push"],
|
|
29
|
+
"modelVersion": 2
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"count": 1,
|
|
3
|
+
"page": 1,
|
|
4
|
+
"pageSize": 50,
|
|
5
|
+
"links": {},
|
|
6
|
+
"items": [
|
|
7
|
+
{
|
|
8
|
+
"id": 1209971,
|
|
9
|
+
"customerKey": "mobileMessage_test",
|
|
10
|
+
"assetType": { "id": 230, "name": "jsonmessage", "displayName": "JSON Message" },
|
|
11
|
+
"name": "mobileMessage_test",
|
|
12
|
+
"createdDate": "2022-12-07T02:49:36.857-06:00",
|
|
13
|
+
"createdBy": {
|
|
14
|
+
"id": 700301950,
|
|
15
|
+
"email": "joern.berkefeld@accenture.com",
|
|
16
|
+
"name": "J├Ârn Berkefeld (ASGR)",
|
|
17
|
+
"userId": "700301950"
|
|
18
|
+
},
|
|
19
|
+
"modifiedDate": "2022-12-07T02:49:57.44-06:00",
|
|
20
|
+
"modifiedBy": {
|
|
21
|
+
"id": 700301950,
|
|
22
|
+
"email": "joern.berkefeld@accenture.com",
|
|
23
|
+
"name": "J├Ârn Berkefeld (ASGR)",
|
|
24
|
+
"userId": "700301950"
|
|
25
|
+
},
|
|
26
|
+
"status": { "id": 1, "name": "Draft" },
|
|
27
|
+
"category": { "id": 89397, "name": "Content Builder", "parentId": 0 },
|
|
28
|
+
"availableViews": ["push"],
|
|
29
|
+
"modelVersion": 2
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
@@ -86,7 +86,11 @@
|
|
|
86
86
|
"applicationExtensionKey": "jb-email-activity",
|
|
87
87
|
"isModified": true,
|
|
88
88
|
"googleAnalyticsCampaignName": "",
|
|
89
|
+
"triggeredSendId": "b3150cf0-6e78-e811-80d4-1402ec721c9d",
|
|
90
|
+
"triggeredSendKey": "wrong key",
|
|
89
91
|
"triggeredSend": {
|
|
92
|
+
"id": "outdated id",
|
|
93
|
+
"key": "outdated key",
|
|
90
94
|
"autoAddSubscribers": true,
|
|
91
95
|
"autoUpdateSubscribers": true,
|
|
92
96
|
"bccEmail": "",
|
|
@@ -98,7 +102,7 @@
|
|
|
98
102
|
"description": "my custom description",
|
|
99
103
|
"domainExclusions": [],
|
|
100
104
|
"dynamicEmailSubject": "testExisting_ email subject",
|
|
101
|
-
"emailId":
|
|
105
|
+
"emailId": 808714,
|
|
102
106
|
"emailSubject": "testExisting_ email subject",
|
|
103
107
|
"exclusionFilter": "",
|
|
104
108
|
"isSalesforceTracking": false,
|
|
@@ -54,7 +54,6 @@
|
|
|
54
54
|
"r__senderProfile_key": "testTemplated_senderProfile",
|
|
55
55
|
"r__sendClassification_key": "testTemplated_sendClassification",
|
|
56
56
|
"c__priority": "High",
|
|
57
|
-
"r__asset_name_readOnly": "testTemplated_asset_message",
|
|
58
57
|
"r__asset_key": "testTemplated_asset_message"
|
|
59
58
|
},
|
|
60
59
|
"applicationExtensionKey": "jb-email-activity"
|
|
@@ -79,19 +79,20 @@
|
|
|
79
79
|
"applicationExtensionKey": "jb-email-activity",
|
|
80
80
|
"isModified": true,
|
|
81
81
|
"googleAnalyticsCampaignName": "",
|
|
82
|
+
"r__triggeredSend_key": "testExisting_triggeredSend",
|
|
82
83
|
"triggeredSend": {
|
|
83
|
-
"autoAddSubscribers":
|
|
84
|
-
"autoUpdateSubscribers":
|
|
84
|
+
"autoAddSubscribers": false,
|
|
85
|
+
"autoUpdateSubscribers": false,
|
|
85
86
|
"bccEmail": "",
|
|
86
87
|
"ccEmail": "",
|
|
87
88
|
"created": { "name": "", "date": "" },
|
|
88
89
|
"description": "my custom description",
|
|
89
90
|
"domainExclusions": [],
|
|
90
|
-
"dynamicEmailSubject": "
|
|
91
|
-
"emailSubject": "
|
|
91
|
+
"dynamicEmailSubject": "You are successfully unsubscribed",
|
|
92
|
+
"emailSubject": "You are successfully unsubscribed",
|
|
92
93
|
"exclusionFilter": "",
|
|
93
94
|
"isSalesforceTracking": false,
|
|
94
|
-
"isMultipart":
|
|
95
|
+
"isMultipart": false,
|
|
95
96
|
"isSendLogging": true,
|
|
96
97
|
"isStoppedOnJobError": false,
|
|
97
98
|
"modified": { "name": "", "date": "" },
|
|
@@ -104,7 +105,8 @@
|
|
|
104
105
|
"r__sendClassification_key": "testExisting_sendClassification",
|
|
105
106
|
"c__priority": "Medium",
|
|
106
107
|
"r__asset_name_readOnly": "testExisting_asset_message",
|
|
107
|
-
"r__asset_key": "testExisting_asset_message"
|
|
108
|
+
"r__asset_key": "testExisting_asset_message",
|
|
109
|
+
"r__triggeredSend_key": "testExisting_triggeredSend"
|
|
108
110
|
}
|
|
109
111
|
},
|
|
110
112
|
"metaData": {
|
|
@@ -54,7 +54,6 @@
|
|
|
54
54
|
"r__senderProfile_key": "{{{prefix}}}senderProfile",
|
|
55
55
|
"r__sendClassification_key": "{{{prefix}}}sendClassification",
|
|
56
56
|
"c__priority": "High",
|
|
57
|
-
"r__asset_name_readOnly": "{{{prefix}}}asset_message",
|
|
58
57
|
"r__asset_key": "{{{prefix}}}asset_message"
|
|
59
58
|
},
|
|
60
59
|
"applicationExtensionKey": "jb-email-activity"
|
|
@@ -21,7 +21,8 @@
|
|
|
21
21
|
"SuppressTracking": false,
|
|
22
22
|
"TriggeredSendStatus": "New",
|
|
23
23
|
"TriggeredSendType": "Continuous",
|
|
24
|
-
"
|
|
24
|
+
"r__asset_key": "testTemplated_asset_message",
|
|
25
|
+
"r__asset_name_readOnly": "testTemplated_asset_message",
|
|
25
26
|
"r__folder_Path": "Triggered Sends",
|
|
26
27
|
"r__sendClassification_key": "testTemplated_sendClassification",
|
|
27
28
|
"r__senderProfile_key": "testTemplated_senderProfile"
|
|
@@ -21,7 +21,8 @@
|
|
|
21
21
|
"SuppressTracking": false,
|
|
22
22
|
"TriggeredSendStatus": "New",
|
|
23
23
|
"TriggeredSendType": "Continuous",
|
|
24
|
-
"
|
|
24
|
+
"r__asset_key": "testExisting_asset_message",
|
|
25
|
+
"r__asset_name_readOnly": "testExisting_asset_message",
|
|
25
26
|
"r__folder_Path": "Triggered Sends",
|
|
26
27
|
"r__sendClassification_key": "testExisting_sendClassification",
|
|
27
28
|
"r__senderProfile_key": "testExisting_senderProfile"
|
|
@@ -21,7 +21,8 @@
|
|
|
21
21
|
"SuppressTracking": false,
|
|
22
22
|
"TriggeredSendStatus": "New",
|
|
23
23
|
"TriggeredSendType": "Continuous",
|
|
24
|
-
"
|
|
24
|
+
"r__asset_key": "{{{prefix}}}asset_message",
|
|
25
|
+
"r__asset_name_readOnly": "{{{prefix}}}asset_message",
|
|
25
26
|
"r__folder_Path": "Triggered Sends",
|
|
26
27
|
"r__sendClassification_key": "{{{prefix}}}sendClassification",
|
|
27
28
|
"r__senderProfile_key": "{{{prefix}}}senderProfile"
|
package/test/type.asset.test.js
CHANGED
|
@@ -323,7 +323,122 @@ describe('type: asset', () => {
|
|
|
323
323
|
return;
|
|
324
324
|
});
|
|
325
325
|
|
|
326
|
-
it('Should
|
|
326
|
+
it('Should update an asset with --matchName', async () => {
|
|
327
|
+
handler.setOptions({ matchName: true });
|
|
328
|
+
// WHEN
|
|
329
|
+
const deployResult = await handler.deploy(
|
|
330
|
+
'testInstance/testBU',
|
|
331
|
+
['asset'],
|
|
332
|
+
['testExisting_asset_htmlblock-matchName']
|
|
333
|
+
);
|
|
334
|
+
// THEN
|
|
335
|
+
assert.equal(process.exitCode, 0, 'deploy should not have thrown an error');
|
|
336
|
+
|
|
337
|
+
// check how many items were deployed
|
|
338
|
+
assert.equal(
|
|
339
|
+
deployResult['testInstance/testBU']?.asset
|
|
340
|
+
? Object.keys(deployResult['testInstance/testBU']?.asset).length
|
|
341
|
+
: 0,
|
|
342
|
+
1,
|
|
343
|
+
'1 assets to be deployed'
|
|
344
|
+
);
|
|
345
|
+
const currentCache = cache.getCache();
|
|
346
|
+
|
|
347
|
+
const upsertCallout = testUtils.getRestCallout(
|
|
348
|
+
'patch',
|
|
349
|
+
'/asset/v1/content/assets/1295064'
|
|
350
|
+
);
|
|
351
|
+
assert.equal(
|
|
352
|
+
upsertCallout?.customerKey,
|
|
353
|
+
'testExisting_asset_htmlblock-matchName',
|
|
354
|
+
'customerKey should be testExisting_asset_htmlblock-matchName'
|
|
355
|
+
);
|
|
356
|
+
assert.equal(
|
|
357
|
+
upsertCallout?.id,
|
|
358
|
+
currentCache.asset['testExisting_asset_htmlblock'].id,
|
|
359
|
+
'id should be that of the existing testExisting_asset_htmlblock'
|
|
360
|
+
);
|
|
361
|
+
|
|
362
|
+
assert.equal(
|
|
363
|
+
testUtils.getAPIHistoryLength(),
|
|
364
|
+
5,
|
|
365
|
+
'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
|
|
366
|
+
);
|
|
367
|
+
return;
|
|
368
|
+
});
|
|
369
|
+
|
|
370
|
+
it('Should not update an asset with --matchName due to multiple potential matches', async () => {
|
|
371
|
+
handler.setOptions({ matchName: true });
|
|
372
|
+
// WHEN
|
|
373
|
+
const deployResult = await handler.deploy(
|
|
374
|
+
'testInstance/testBU',
|
|
375
|
+
['asset'],
|
|
376
|
+
['testExisting_asset_htmlblock-matchName-fail']
|
|
377
|
+
);
|
|
378
|
+
// THEN
|
|
379
|
+
assert.equal(process.exitCode, 1, 'deploy should have thrown an error');
|
|
380
|
+
|
|
381
|
+
// check how many items were deployed
|
|
382
|
+
assert.equal(
|
|
383
|
+
deployResult['testInstance/testBU']?.asset
|
|
384
|
+
? Object.keys(deployResult['testInstance/testBU']?.asset).length
|
|
385
|
+
: 0,
|
|
386
|
+
0,
|
|
387
|
+
'0 assets to be deployed'
|
|
388
|
+
);
|
|
389
|
+
|
|
390
|
+
const upsertCallout = testUtils.getRestCallout('patch', '/asset/v1/content/assets/%');
|
|
391
|
+
assert.equal(upsertCallout, null, 'there should have been no patch');
|
|
392
|
+
|
|
393
|
+
assert.equal(
|
|
394
|
+
testUtils.getAPIHistoryLength(),
|
|
395
|
+
4,
|
|
396
|
+
'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
|
|
397
|
+
);
|
|
398
|
+
return;
|
|
399
|
+
});
|
|
400
|
+
|
|
401
|
+
it('Should create an asset with --matchName because it found no match', async () => {
|
|
402
|
+
handler.setOptions({ matchName: true });
|
|
403
|
+
// WHEN
|
|
404
|
+
const deployResult = await handler.deploy(
|
|
405
|
+
'testInstance/testBU',
|
|
406
|
+
['asset'],
|
|
407
|
+
['testExisting_asset_htmlblock-matchName-create']
|
|
408
|
+
);
|
|
409
|
+
// THEN
|
|
410
|
+
assert.equal(process.exitCode, 0, 'deploy should not have thrown an error');
|
|
411
|
+
|
|
412
|
+
// check how many items were deployed
|
|
413
|
+
assert.equal(
|
|
414
|
+
deployResult['testInstance/testBU']?.asset
|
|
415
|
+
? Object.keys(deployResult['testInstance/testBU']?.asset).length
|
|
416
|
+
: 0,
|
|
417
|
+
1,
|
|
418
|
+
'1 assets to be deployed'
|
|
419
|
+
);
|
|
420
|
+
|
|
421
|
+
const upsertCallout = testUtils.getRestCallout('post', '/asset/v1/content/assets/');
|
|
422
|
+
assert.equal(
|
|
423
|
+
upsertCallout?.customerKey,
|
|
424
|
+
'testExisting_asset_htmlblock-matchName-create',
|
|
425
|
+
'asset.customerKey should be testExisting_asset_htmlblock-matchName-create'
|
|
426
|
+
);
|
|
427
|
+
assert.equal(
|
|
428
|
+
upsertCallout?.id,
|
|
429
|
+
undefined,
|
|
430
|
+
'asset.id should not be set as we are in a create call'
|
|
431
|
+
);
|
|
432
|
+
|
|
433
|
+
assert.equal(
|
|
434
|
+
testUtils.getAPIHistoryLength(),
|
|
435
|
+
5,
|
|
436
|
+
'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
|
|
437
|
+
);
|
|
438
|
+
return;
|
|
439
|
+
});
|
|
440
|
+
|
|
441
|
+
it('Should create an asset with mis-matching memberId and --keySuffix', async () => {
|
|
327
442
|
handler.setOptions({ keySuffix: '_DEV' });
|
|
328
443
|
// WHEN
|
|
329
444
|
const deployResult = await handler.deploy(
|
|
@@ -357,7 +472,7 @@ describe('type: asset', () => {
|
|
|
357
472
|
return;
|
|
358
473
|
});
|
|
359
474
|
|
|
360
|
-
it('Should create an
|
|
475
|
+
it('Should create an asset with mis-matching memberId', async () => {
|
|
361
476
|
// WHEN
|
|
362
477
|
const deployResult = await handler.deploy(
|
|
363
478
|
'testInstance/testBU',
|
package/test/utils.js
CHANGED
|
@@ -13,7 +13,13 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
|
13
13
|
import fsmock from 'mock-fs';
|
|
14
14
|
|
|
15
15
|
let apimock;
|
|
16
|
-
import {
|
|
16
|
+
import {
|
|
17
|
+
handleSOAPRequest,
|
|
18
|
+
handleRESTRequest,
|
|
19
|
+
soapUrl,
|
|
20
|
+
restUrl,
|
|
21
|
+
tWarn,
|
|
22
|
+
} from './resourceFactory.js';
|
|
17
23
|
const authResources = File.readJsonSync(path.join(__dirname, './resources/auth.json'));
|
|
18
24
|
|
|
19
25
|
/**
|
|
@@ -174,6 +180,7 @@ export function mockSetup(isDeploy) {
|
|
|
174
180
|
json: undefined,
|
|
175
181
|
keySuffix: undefined,
|
|
176
182
|
like: undefined,
|
|
183
|
+
matchName: undefined,
|
|
177
184
|
noUpdate: undefined,
|
|
178
185
|
publish: undefined,
|
|
179
186
|
referenceFrom: undefined,
|
|
@@ -288,10 +295,28 @@ export function getAPIHistory() {
|
|
|
288
295
|
* @returns {object} json payload of the request
|
|
289
296
|
*/
|
|
290
297
|
export function getRestCallout(method, url) {
|
|
298
|
+
if (!apimock.history[method]?.length) {
|
|
299
|
+
console.log(`${tWarn} No history for method ${method}.`); // eslint-disable-line no-console
|
|
300
|
+
const methods = Object.keys(apimock.history)
|
|
301
|
+
.filter((el) => apimock.history[el]?.length)
|
|
302
|
+
.join(', ');
|
|
303
|
+
console.error(`Available methods: ${methods}`); // eslint-disable-line no-console
|
|
304
|
+
return null;
|
|
305
|
+
}
|
|
291
306
|
const subset = apimock.history[method];
|
|
292
307
|
const myCallout = subset.find((item) =>
|
|
293
308
|
url.endsWith('%') ? item.url.startsWith(url.slice(0, -1)) : item.url === url
|
|
294
309
|
);
|
|
310
|
+
if (!myCallout) {
|
|
311
|
+
console.error(`${tWarn} No callout found for ${method} ${url}`); // eslint-disable-line no-console
|
|
312
|
+
const urls = [...new Set(subset.map((el) => el.url))].join('\n- ');
|
|
313
|
+
const methods = Object.keys(apimock.history)
|
|
314
|
+
.filter((el) => apimock.history[el]?.length)
|
|
315
|
+
.join(', ');
|
|
316
|
+
console.error(`Available methods: ${methods}`); // eslint-disable-line no-console
|
|
317
|
+
console.error(`Available unique urls in method ${method}:\n- ${urls}`); // eslint-disable-line no-console
|
|
318
|
+
return null;
|
|
319
|
+
}
|
|
295
320
|
return JSON.parse(myCallout.data);
|
|
296
321
|
}
|
|
297
322
|
/**
|
|
@@ -318,6 +343,10 @@ export function getSoapCallouts(requestAction, objectType) {
|
|
|
318
343
|
: false
|
|
319
344
|
)
|
|
320
345
|
.map((item) => item.data);
|
|
346
|
+
if (!myCallout) {
|
|
347
|
+
console.error(`${tWarn} No callout found for ${requestAction} ${objectType || ''}`); // eslint-disable-line no-console
|
|
348
|
+
return null;
|
|
349
|
+
}
|
|
321
350
|
return myCallout;
|
|
322
351
|
}
|
|
323
352
|
/**
|
package/types/mcdev.d.js
CHANGED
|
@@ -444,8 +444,8 @@ complex
|
|
|
444
444
|
* @typedef {'error'|'verbose'|'info'|'debug'} LoggerLevel
|
|
445
445
|
* @typedef {object} McdevLogger
|
|
446
446
|
* @property {LoggerLevel} [level] (msg) print info message
|
|
447
|
-
* @property {
|
|
448
|
-
* @property {
|
|
447
|
+
* @property {(msg:string)=>void} error (msg) print error message; wrapper around winstonLogger.error that also sets error code to 1
|
|
448
|
+
* @property {(ex:SDKError,message?:string)=>void} errorStack print error with trace message
|
|
449
449
|
* @typedef {import('winston').Logger & McdevLogger} Logger
|
|
450
450
|
*/
|
|
451
451
|
/**
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"count": 1,
|
|
3
|
-
"page": 1,
|
|
4
|
-
"pageSize": 50,
|
|
5
|
-
"links": {},
|
|
6
|
-
"items": [
|
|
7
|
-
{
|
|
8
|
-
"id": 5286,
|
|
9
|
-
"customerKey": "testExisting_asset_template",
|
|
10
|
-
"assetType": {
|
|
11
|
-
"id": 4,
|
|
12
|
-
"name": "template",
|
|
13
|
-
"displayName": "Template"
|
|
14
|
-
},
|
|
15
|
-
"name": " testExisting_asset_template",
|
|
16
|
-
"createdDate": "2024-04-22T03:33:08.253-06:00",
|
|
17
|
-
"createdBy": {
|
|
18
|
-
"id": 710411605,
|
|
19
|
-
"email": "joern.berkefeld@accenture.com",
|
|
20
|
-
"name": "Jörn Berkefeld",
|
|
21
|
-
"userId": "710411605"
|
|
22
|
-
},
|
|
23
|
-
"modifiedDate": "2024-05-13T07:12:13.117-06:00",
|
|
24
|
-
"modifiedBy": {
|
|
25
|
-
"id": 710420432,
|
|
26
|
-
"name": "joern.berkefeld app user",
|
|
27
|
-
"userId": "710420432"
|
|
28
|
-
},
|
|
29
|
-
"category": {
|
|
30
|
-
"id": 89397
|
|
31
|
-
},
|
|
32
|
-
"modelVersion": 2
|
|
33
|
-
}
|
|
34
|
-
]
|
|
35
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|