mcdev 7.6.1 → 7.6.3
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/close_issues_on_merge.yml +1 -1
- package/.github/workflows/coverage-base-update.yml +2 -2
- package/.github/workflows/coverage.yml +1 -1
- package/.vscode/extensions.json +1 -0
- package/.vscode/settings.json +21 -1
- package/@types/lib/index.d.ts +15 -15
- package/@types/lib/index.d.ts.map +1 -1
- package/@types/lib/metadataTypes/Asset.d.ts.map +1 -1
- package/@types/lib/metadataTypes/Automation.d.ts +6 -0
- package/@types/lib/metadataTypes/Automation.d.ts.map +1 -1
- package/@types/lib/metadataTypes/DataExtract.d.ts +7 -0
- package/@types/lib/metadataTypes/DataExtract.d.ts.map +1 -1
- package/@types/lib/metadataTypes/Event.d.ts.map +1 -1
- package/@types/lib/metadataTypes/FileLocation.d.ts +39 -5
- package/@types/lib/metadataTypes/FileLocation.d.ts.map +1 -1
- package/@types/lib/metadataTypes/Journey.d.ts +13 -3
- package/@types/lib/metadataTypes/Journey.d.ts.map +1 -1
- package/@types/lib/metadataTypes/MetadataType.d.ts.map +1 -1
- package/@types/lib/metadataTypes/SendClassification.d.ts +7 -0
- package/@types/lib/metadataTypes/SendClassification.d.ts.map +1 -1
- package/@types/lib/metadataTypes/SenderProfile.d.ts +7 -0
- package/@types/lib/metadataTypes/SenderProfile.d.ts.map +1 -1
- package/@types/lib/metadataTypes/definitions/Automation.definition.d.ts +6 -0
- package/@types/lib/metadataTypes/definitions/FileLocation.definition.d.ts +24 -0
- package/@types/lib/util/cache.d.ts +1 -1
- package/@types/lib/util/cache.d.ts.map +1 -1
- package/@types/lib/util/config.d.ts.map +1 -1
- package/@types/lib/util/file.d.ts.map +1 -1
- package/LICENSE +1 -1
- package/README.md +1 -1
- package/boilerplate/config.json +1 -0
- package/boilerplate/files/.vscode/extensions.json +1 -0
- package/boilerplate/forcedUpdates.json +4 -0
- package/lib/index.js +34 -17
- package/lib/metadataTypes/Asset.js +31 -8
- package/lib/metadataTypes/Automation.js +45 -25
- package/lib/metadataTypes/DataExtension.js +1 -1
- package/lib/metadataTypes/DataExtract.js +20 -0
- package/lib/metadataTypes/Event.js +20 -5
- package/lib/metadataTypes/FileLocation.js +43 -5
- package/lib/metadataTypes/Journey.js +176 -77
- package/lib/metadataTypes/MetadataType.js +22 -9
- package/lib/metadataTypes/SendClassification.js +20 -0
- package/lib/metadataTypes/SenderProfile.js +20 -0
- package/lib/metadataTypes/definitions/Automation.definition.js +6 -0
- package/lib/metadataTypes/definitions/FileLocation.definition.js +22 -2
- package/lib/util/cache.js +8 -3
- package/lib/util/config.js +6 -0
- package/lib/util/file.js +17 -14
- package/package.json +17 -18
- package/prepare-release.js +37 -0
- package/test/general.test.js +69 -6
- package/test/mockRoot/.mcdevrc.json +2 -1
- package/test/mockRoot/deploy/testInstance/testBU/journey/testExisting_journey_Multistep.journey-meta.json +418 -0
- package/test/mockRoot/deploy/testInstance/testBU/journey/testExisting_temail.journey-meta.json +212 -0
- package/test/mockRoot/deploy/testInstance/testBU/journey/testExisting_temail_notPublished.journey-meta.json +217 -0
- package/test/resourceFactory.js +12 -10
- package/test/resources/9999999/asset/build-templatebasedemail-expected.json +0 -1
- package/test/resources/9999999/asset/retrieve-templatebasedemail-expected.json +0 -1
- package/test/resources/9999999/asset/template-templatebasedemail-expected.json +0 -1
- package/test/resources/9999999/asset-deploy/block/testNew_asset_badExtension.bad-type-extension.json +39 -0
- package/test/resources/9999999/asset-deploy/block/testNew_asset_badName_bad.asset-block-meta.json +39 -0
- package/test/resources/9999999/dataExtract/patch-expected.json +3 -1
- package/test/resources/9999999/event/get-published-expected.json +30 -0
- package/test/resources/9999999/event/post_withExistingDE-callout-expected.json +211 -0
- package/test/resources/9999999/event/put-expected.json +12 -11
- package/test/resources/9999999/event-deploy/testNew_event_badExtension.bad-type-extension.json +200 -0
- package/test/resources/9999999/event-deploy/testNew_event_badName_bad.event-meta.json +200 -0
- package/test/resources/9999999/interaction/v1/eventDefinitions/key_DEAudience-2e3c73b6-48cc-2ec0-5522-48636e1a236e/get-response.json +39 -0
- package/test/resources/9999999/interaction/v1/interactions/key_testExisting_journey_Multistep/put-response.json +461 -0
- package/test/resources/9999999/interaction/v1/interactions/key_testExisting_temail/put-response.json +219 -0
- package/test/resources/9999999/interaction/v1/interactions/key_testExisting_temail_notPublished/put-response.json +226 -0
- package/test/resources/9999999/journey/get-published-expected.json +217 -0
- package/test/resources/9999999/sendClassification/patch-expected.json +3 -1
- package/test/resources/9999999/senderProfile/patch-expected.json +12 -8
- package/test/resources/9999999/transactionalEmail/get-published-expected.json +20 -0
- package/test/type.dataExtract.test.js +1 -1
- package/test/type.event.test.js +3 -3
- package/test/type.journey.test.js +222 -13
- package/test/type.sendClassification.test.js +1 -1
- package/test/type.senderProfile.test.js +1 -1
- package/test/utils.js +5 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../lib/util/config.js"],"names":[],"mappings":";yBASa,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;;;IAStD;;;;;;OAMG;IACH,gCAJW,OAAO,WACP,OAAO,GACL,OAAO,CAAE,OAAO,CAAC,CA2D7B;IAED;;;;;;OAMG;IACH,qCAJW,OAAO,WACP,OAAO,GACL,OAAO,CAAE,OAAO,GAAG,MAAM,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../lib/util/config.js"],"names":[],"mappings":";yBASa,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;;;IAStD;;;;;;OAMG;IACH,gCAJW,OAAO,WACP,OAAO,GACL,OAAO,CAAE,OAAO,CAAC,CA2D7B;IAED;;;;;;OAMG;IACH,qCAJW,OAAO,WACP,OAAO,GACL,OAAO,CAAE,OAAO,GAAG,MAAM,EAAE,CAAC,CAmMxC;IAED;;;;;OAKG;IACH,iCAFa,OAAO,CAAE,OAAO,CAAC,CAe7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../../lib/util/file.js"],"names":[],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MAAM,YACN,MAAM,aACN,MAAM,KACJ,OAAO,CAAE,MAAM,CAAC;IAc7B;;;;;;;;;;OAUG;iCALQ,MAAM,SACN,MAAM,gBACN,OAAO,gBACP,MAAM,KACJ,OAAO,CAAE,MAAM,EAAE,CAAC;IA6C/B;;;;;;;;;;;OAWG;qCALQ,MAAM,UACN,MAAM,gBACN,OAAO,gBACP,MAAM,KACJ,MAAM,EAAE,GAAG,IAAI;IA4C5B;;;;;OAKG;+BAFQ,OAAO,GACL,OAAO,CAAE,IAAI,CAAC;IAU3B;;;;;OAKG;4BAFQ,MAAM,GACJ,OAAO,CAAE,OAAO,CAAC;EAgCK;eAzlBxB,UAAU"}
|
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -73,4 +73,4 @@ The people that lead this project:
|
|
|
73
73
|
|
|
74
74
|
## Copyright
|
|
75
75
|
|
|
76
|
-
Copyright (c) 2020-
|
|
76
|
+
Copyright (c) 2020-2025 Accenture. [MIT licensed](https://github.com/Accenture/sfmc-devtools/blob/main/LICENSE).
|
package/boilerplate/config.json
CHANGED
package/lib/index.js
CHANGED
|
@@ -730,7 +730,7 @@ class Mcdev {
|
|
|
730
730
|
* ensures triggered sends are restarted to ensure they pick up on changes of the underlying emails
|
|
731
731
|
*
|
|
732
732
|
* @param {string} businessUnit references credentials from properties.json
|
|
733
|
-
* @param {string[] | TypeKeyCombo}
|
|
733
|
+
* @param {string[] | TypeKeyCombo} selectedTypes limit to given metadata types
|
|
734
734
|
* @param {string[]} [keys] customerkey of the metadata
|
|
735
735
|
* @returns {Promise.<Object.<string, Object.<string, string[]>>>} key: business unit name, key2: type, value: list of affected item keys
|
|
736
736
|
*/
|
|
@@ -1412,19 +1412,6 @@ class Mcdev {
|
|
|
1412
1412
|
}
|
|
1413
1413
|
}
|
|
1414
1414
|
|
|
1415
|
-
/**
|
|
1416
|
-
* Schedule an item (shortcut for execute --schedule)
|
|
1417
|
-
*
|
|
1418
|
-
* @param {string} businessUnit name of BU
|
|
1419
|
-
* @param {string[] | TypeKeyCombo} [selectedTypes] limit to given metadata types
|
|
1420
|
-
* @param {string[]} [keys] customerkey of the metadata
|
|
1421
|
-
* @returns {Promise.<Object.<string, Object.<string, string[]>>>} key: business unit name, key2: type, value: list of affected item keys
|
|
1422
|
-
*/
|
|
1423
|
-
static async schedule(businessUnit, selectedTypes, keys) {
|
|
1424
|
-
this.setOptions({ schedule: true });
|
|
1425
|
-
return this.#runMethod('execute', businessUnit, selectedTypes, keys);
|
|
1426
|
-
}
|
|
1427
|
-
|
|
1428
1415
|
/**
|
|
1429
1416
|
* Publish an item
|
|
1430
1417
|
*
|
|
@@ -1452,7 +1439,7 @@ class Mcdev {
|
|
|
1452
1439
|
* Start/execute an item
|
|
1453
1440
|
*
|
|
1454
1441
|
* @param {string} businessUnit name of BU
|
|
1455
|
-
* @param {string[] | TypeKeyCombo}
|
|
1442
|
+
* @param {string[] | TypeKeyCombo} selectedTypes limit to given metadata types
|
|
1456
1443
|
* @param {string[]} [keys] customerkey of the metadata
|
|
1457
1444
|
* @returns {Promise.<Object.<string, Object.<string, string[]>>>} key: business unit name, key2: type, value: list of affected item keys
|
|
1458
1445
|
*/
|
|
@@ -1460,11 +1447,24 @@ class Mcdev {
|
|
|
1460
1447
|
return this.#runMethod('execute', businessUnit, selectedTypes, keys);
|
|
1461
1448
|
}
|
|
1462
1449
|
|
|
1450
|
+
/**
|
|
1451
|
+
* Schedule an item (shortcut for execute --schedule)
|
|
1452
|
+
*
|
|
1453
|
+
* @param {string} businessUnit name of BU
|
|
1454
|
+
* @param {string[] | TypeKeyCombo} selectedTypes limit to given metadata types
|
|
1455
|
+
* @param {string[]} [keys] customerkey of the metadata
|
|
1456
|
+
* @returns {Promise.<Object.<string, Object.<string, string[]>>>} key: business unit name, key2: type, value: list of affected item keys
|
|
1457
|
+
*/
|
|
1458
|
+
static async schedule(businessUnit, selectedTypes, keys) {
|
|
1459
|
+
this.setOptions({ schedule: true });
|
|
1460
|
+
return this.#runMethod('execute', businessUnit, selectedTypes, keys);
|
|
1461
|
+
}
|
|
1462
|
+
|
|
1463
1463
|
/**
|
|
1464
1464
|
* pause an item
|
|
1465
1465
|
*
|
|
1466
1466
|
* @param {string} businessUnit name of BU
|
|
1467
|
-
* @param {string[] | TypeKeyCombo}
|
|
1467
|
+
* @param {string[] | TypeKeyCombo} selectedTypes limit to given metadata types
|
|
1468
1468
|
* @param {string[]} [keys] customerkey of the metadata
|
|
1469
1469
|
* @returns {Promise.<Object.<string, Object.<string, string[]>>>} key: business unit name, key2: type, value: list of affected item keys
|
|
1470
1470
|
*/
|
|
@@ -1476,7 +1476,7 @@ class Mcdev {
|
|
|
1476
1476
|
* stop an item
|
|
1477
1477
|
*
|
|
1478
1478
|
* @param {string} businessUnit name of BU
|
|
1479
|
-
* @param {string[] | TypeKeyCombo}
|
|
1479
|
+
* @param {string[] | TypeKeyCombo} selectedTypes limit to given metadata types
|
|
1480
1480
|
* @param {string[]} [keys] customerkey of the metadata
|
|
1481
1481
|
* @returns {Promise.<Object.<string, Object.<string, string[]>>>} key: business unit name, key2: type, value: list of affected item keys
|
|
1482
1482
|
*/
|
|
@@ -1671,6 +1671,7 @@ class Mcdev {
|
|
|
1671
1671
|
Util.startLogger();
|
|
1672
1672
|
let lang_past;
|
|
1673
1673
|
let lang_present;
|
|
1674
|
+
let requireType;
|
|
1674
1675
|
let requireKeyOrLike;
|
|
1675
1676
|
let checkMetadataSupport;
|
|
1676
1677
|
/** @type {Object.<string, Object.<string, string[]>>} */
|
|
@@ -1680,6 +1681,7 @@ class Mcdev {
|
|
|
1680
1681
|
case 'execute': {
|
|
1681
1682
|
lang_past = 'executed';
|
|
1682
1683
|
lang_present = 'executing';
|
|
1684
|
+
requireType = true;
|
|
1683
1685
|
requireKeyOrLike = true;
|
|
1684
1686
|
checkMetadataSupport = true;
|
|
1685
1687
|
break;
|
|
@@ -1687,6 +1689,7 @@ class Mcdev {
|
|
|
1687
1689
|
case 'pause': {
|
|
1688
1690
|
lang_past = 'paused';
|
|
1689
1691
|
lang_present = 'pausing';
|
|
1692
|
+
requireType = true;
|
|
1690
1693
|
requireKeyOrLike = true;
|
|
1691
1694
|
checkMetadataSupport = true;
|
|
1692
1695
|
break;
|
|
@@ -1694,6 +1697,7 @@ class Mcdev {
|
|
|
1694
1697
|
case 'stop': {
|
|
1695
1698
|
lang_past = 'stopped';
|
|
1696
1699
|
lang_present = 'stopping';
|
|
1700
|
+
requireType = true;
|
|
1697
1701
|
requireKeyOrLike = true;
|
|
1698
1702
|
checkMetadataSupport = true;
|
|
1699
1703
|
break;
|
|
@@ -1701,6 +1705,7 @@ class Mcdev {
|
|
|
1701
1705
|
case 'publish': {
|
|
1702
1706
|
lang_past = 'published';
|
|
1703
1707
|
lang_present = 'publishing';
|
|
1708
|
+
requireType = true;
|
|
1704
1709
|
requireKeyOrLike = true;
|
|
1705
1710
|
checkMetadataSupport = true;
|
|
1706
1711
|
break;
|
|
@@ -1708,6 +1713,7 @@ class Mcdev {
|
|
|
1708
1713
|
case 'validate': {
|
|
1709
1714
|
lang_past = 'validated';
|
|
1710
1715
|
lang_present = 'validating';
|
|
1716
|
+
requireType = true;
|
|
1711
1717
|
requireKeyOrLike = true;
|
|
1712
1718
|
checkMetadataSupport = true;
|
|
1713
1719
|
break;
|
|
@@ -1715,6 +1721,7 @@ class Mcdev {
|
|
|
1715
1721
|
case 'fixKeys': {
|
|
1716
1722
|
lang_past = 'fixed keys';
|
|
1717
1723
|
lang_present = 'fixing keys';
|
|
1724
|
+
requireType = false;
|
|
1718
1725
|
requireKeyOrLike = false;
|
|
1719
1726
|
checkMetadataSupport = false;
|
|
1720
1727
|
break;
|
|
@@ -1722,6 +1729,7 @@ class Mcdev {
|
|
|
1722
1729
|
case 'replaceCbReference': {
|
|
1723
1730
|
lang_past = 'replaced references';
|
|
1724
1731
|
lang_present = 'replacing references';
|
|
1732
|
+
requireType = false;
|
|
1725
1733
|
requireKeyOrLike = false;
|
|
1726
1734
|
checkMetadataSupport = true;
|
|
1727
1735
|
break;
|
|
@@ -1729,6 +1737,7 @@ class Mcdev {
|
|
|
1729
1737
|
case 'refresh': {
|
|
1730
1738
|
lang_past = 'refreshed';
|
|
1731
1739
|
lang_present = 'refreshing';
|
|
1740
|
+
requireType = true;
|
|
1732
1741
|
requireKeyOrLike = false;
|
|
1733
1742
|
checkMetadataSupport = true;
|
|
1734
1743
|
break;
|
|
@@ -1767,6 +1776,14 @@ class Mcdev {
|
|
|
1767
1776
|
selectedTypesObj = selectedTypes;
|
|
1768
1777
|
}
|
|
1769
1778
|
}
|
|
1779
|
+
if (
|
|
1780
|
+
requireType &&
|
|
1781
|
+
!Array.isArray(selectedTypesArr) &&
|
|
1782
|
+
(!selectedTypesObj || !Object.keys(selectedTypesObj).length)
|
|
1783
|
+
) {
|
|
1784
|
+
Util.logger.error('At least one metadata type needs to be defined.');
|
|
1785
|
+
return resultObj;
|
|
1786
|
+
}
|
|
1770
1787
|
const properties = await config.getProperties();
|
|
1771
1788
|
if (!(await config.checkProperties(properties))) {
|
|
1772
1789
|
// return null here to avoid seeing 2 error messages for the same issue
|
|
@@ -1196,9 +1196,8 @@ class Asset extends MetadataType {
|
|
|
1196
1196
|
};
|
|
1197
1197
|
}
|
|
1198
1198
|
if (asset.r__folder_Path) {
|
|
1199
|
-
//
|
|
1200
|
-
|
|
1201
|
-
this.setFolderId(asset);
|
|
1199
|
+
// if we convert this into a folder path then renamed folders might end up blocking deployments, therefore, we instead omit this detail from now on
|
|
1200
|
+
delete asset.r__folder_Path;
|
|
1202
1201
|
}
|
|
1203
1202
|
await this._preDeployTasksBocks(asset);
|
|
1204
1203
|
}
|
|
@@ -1886,7 +1885,8 @@ class Asset extends MetadataType {
|
|
|
1886
1885
|
}
|
|
1887
1886
|
}
|
|
1888
1887
|
if (asset.category?.id) {
|
|
1889
|
-
this
|
|
1888
|
+
// if we convert this into a folder path then renamed folders might end up blocking deployments, therefore, we instead omit this detail from now on
|
|
1889
|
+
delete asset.category;
|
|
1890
1890
|
}
|
|
1891
1891
|
|
|
1892
1892
|
if (asset.slots) {
|
|
@@ -1954,11 +1954,34 @@ class Asset extends MetadataType {
|
|
|
1954
1954
|
subtype,
|
|
1955
1955
|
fileName2FileContent
|
|
1956
1956
|
);
|
|
1957
|
-
} else if (fileName.endsWith(
|
|
1957
|
+
} else if (fileName.endsWith('.json')) {
|
|
1958
|
+
const errorDir = currentdir.split('\\').join('/');
|
|
1958
1959
|
const fileContent = await File.readJSONFile(currentdir, fileName, false);
|
|
1959
|
-
//
|
|
1960
|
-
const
|
|
1961
|
-
|
|
1960
|
+
// ! convert numbers to string to allow numeric keys to be checked properly
|
|
1961
|
+
const key = Number.isInteger(fileContent[this.definition.keyField])
|
|
1962
|
+
? fileContent[this.definition.keyField].toString()
|
|
1963
|
+
: fileContent[this.definition.keyField];
|
|
1964
|
+
if (fileName.endsWith(fileEnding)) {
|
|
1965
|
+
// subtype will change the metadata suffix length
|
|
1966
|
+
const fileNameWithoutEnding = File.reverseFilterIllegalFilenames(
|
|
1967
|
+
fileName.slice(0, -fileEndingLength)
|
|
1968
|
+
);
|
|
1969
|
+
if (key === fileNameWithoutEnding) {
|
|
1970
|
+
fileName2FileContent[fileNameWithoutEnding] = fileContent;
|
|
1971
|
+
} else {
|
|
1972
|
+
Util.logger.error(
|
|
1973
|
+
` ☇ skipping ${this.definition.type} ${key}: Name of the metadata file and the JSON-key (${this.definition.keyField}) must match. Expected: ${key}${fileEnding}. Actual: ` +
|
|
1974
|
+
Util.getGrayMsg(`${errorDir}/`) +
|
|
1975
|
+
fileName
|
|
1976
|
+
);
|
|
1977
|
+
}
|
|
1978
|
+
} else {
|
|
1979
|
+
Util.logger.error(
|
|
1980
|
+
` ☇ skipping ${this.definition.type} ${key}: Name of the metadata file must end on the extended metadata suffix. Expected: ${key}${fileEnding}. Actual: ` +
|
|
1981
|
+
Util.getGrayMsg(`${errorDir}/`) +
|
|
1982
|
+
fileName
|
|
1983
|
+
);
|
|
1984
|
+
}
|
|
1962
1985
|
}
|
|
1963
1986
|
} catch (ex) {
|
|
1964
1987
|
// by catching this in the loop we gracefully handle the issue and move on to the next file
|
|
@@ -485,20 +485,32 @@ class Automation extends MetadataType {
|
|
|
485
485
|
// folder
|
|
486
486
|
this.setFolderPath(metadata);
|
|
487
487
|
// automations are often skipped due to lack of support.
|
|
488
|
-
if (
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
488
|
+
if (metadata.type == 'automationtriggered' && metadata.automationTrigger) {
|
|
489
|
+
const automationTrigger = metadata.automationTrigger;
|
|
490
|
+
if (automationTrigger.fileTransferLocationId) {
|
|
491
|
+
try {
|
|
492
|
+
automationTrigger.r__fileLocation_name = cache.searchForField(
|
|
493
|
+
'fileLocation',
|
|
494
|
+
automationTrigger.fileTransferLocationId,
|
|
495
|
+
'id',
|
|
496
|
+
'name'
|
|
497
|
+
);
|
|
498
|
+
delete automationTrigger.fileTransferLocationId;
|
|
499
|
+
} catch (ex) {
|
|
500
|
+
Util.logger.warn(` - automation ${metadata.key}: ${ex.message}`);
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
if (automationTrigger.fileNamePatternType) {
|
|
504
|
+
try {
|
|
505
|
+
automationTrigger.fileNamePatternType = Util.inverseGet(
|
|
506
|
+
this.definition.fileNameOperatorMapping,
|
|
507
|
+
automationTrigger.fileNamePatternType
|
|
508
|
+
);
|
|
509
|
+
} catch {
|
|
510
|
+
Util.logger.warn(
|
|
511
|
+
` - Unknown File naming Pattern '${automationTrigger.fileNamePatternType}' in Automation '${metadata.name}'`
|
|
512
|
+
);
|
|
513
|
+
}
|
|
502
514
|
}
|
|
503
515
|
}
|
|
504
516
|
try {
|
|
@@ -921,17 +933,25 @@ class Automation extends MetadataType {
|
|
|
921
933
|
this.notificationUpdates[metadata.key] = [];
|
|
922
934
|
}
|
|
923
935
|
}
|
|
924
|
-
if (
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
936
|
+
if (metadata.type == 'automationtriggered' && metadata.automationTrigger) {
|
|
937
|
+
const automationTrigger = metadata.automationTrigger;
|
|
938
|
+
|
|
939
|
+
if (automationTrigger.r__fileLocation_name) {
|
|
940
|
+
automationTrigger.fileTransferLocationId = cache.searchForField(
|
|
941
|
+
'fileLocation',
|
|
942
|
+
automationTrigger.r__fileLocation_name,
|
|
943
|
+
'name',
|
|
944
|
+
'id'
|
|
945
|
+
);
|
|
946
|
+
delete automationTrigger.r__fileLocation_name;
|
|
947
|
+
}
|
|
948
|
+
if (
|
|
949
|
+
automationTrigger.fileNamePatternType &&
|
|
950
|
+
typeof automationTrigger.fileNamePatternType === 'string'
|
|
951
|
+
) {
|
|
952
|
+
automationTrigger.fileNamePatternType =
|
|
953
|
+
this.definition.fileNameOperatorMapping[automationTrigger.fileNamePatternType];
|
|
954
|
+
}
|
|
935
955
|
}
|
|
936
956
|
if (this.validateDeployMetadata(metadata)) {
|
|
937
957
|
// folder
|
|
@@ -304,7 +304,7 @@ class DataExtension extends MetadataType {
|
|
|
304
304
|
delete Util.changedKeysMap?.[this.definition.type]?.[key];
|
|
305
305
|
|
|
306
306
|
const cachedVersion = createdUpdated.updated
|
|
307
|
-
? cache.getByKey(this.definition.type,
|
|
307
|
+
? cache.getByKey(this.definition.type, key)
|
|
308
308
|
: null;
|
|
309
309
|
if (cachedVersion) {
|
|
310
310
|
// UPDATE
|
|
@@ -139,6 +139,26 @@ class DataExtract extends MetadataType {
|
|
|
139
139
|
return metadata;
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
+
/**
|
|
143
|
+
* Gets executed after deployment of metadata type
|
|
144
|
+
*
|
|
145
|
+
* @param {MetadataTypeMap} upsertResults metadata mapped by their keyField as returned by update/create
|
|
146
|
+
* @returns {Promise.<void>} -
|
|
147
|
+
*/
|
|
148
|
+
static async postDeployTasks(upsertResults) {
|
|
149
|
+
// re-retrieve all upserted items to ensure we have all fields (createdDate and modifiedDate are otherwise not present)
|
|
150
|
+
Util.logger.debug(
|
|
151
|
+
`Caching all ${this.definition.type} post-deploy to ensure we have all fields`
|
|
152
|
+
);
|
|
153
|
+
const typeCache = await this.retrieveForCache();
|
|
154
|
+
// update values in upsertResults with retrieved values before saving to disk
|
|
155
|
+
for (const key of Object.keys(upsertResults)) {
|
|
156
|
+
if (typeCache.metadata[key]) {
|
|
157
|
+
upsertResults[key] = typeCache.metadata[key];
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
142
162
|
/**
|
|
143
163
|
* manages post retrieve steps
|
|
144
164
|
*
|
|
@@ -327,6 +327,7 @@ class Event extends MetadataType {
|
|
|
327
327
|
}
|
|
328
328
|
}
|
|
329
329
|
} else if (createOrUpdateAction === 'create') {
|
|
330
|
+
let deFound;
|
|
330
331
|
try {
|
|
331
332
|
if (metadataItem.r__dataExtension_key) {
|
|
332
333
|
metadataItem.dataExtensionId = cache.searchForField(
|
|
@@ -342,16 +343,18 @@ class Event extends MetadataType {
|
|
|
342
343
|
'Name'
|
|
343
344
|
);
|
|
344
345
|
if (metadataItem.schema) {
|
|
345
|
-
delete metadataItem.schema;
|
|
346
346
|
Util.logger.info(
|
|
347
347
|
` - ${this.definition.type} ${metadataItem[this.definition.keyField]}: dataExtension ${metadataItem.r__dataExtension_key} found, ignoring schema-section in ${this.definition.type} json`
|
|
348
348
|
);
|
|
349
349
|
}
|
|
350
|
+
deFound = true;
|
|
351
|
+
} else {
|
|
352
|
+
deFound = false;
|
|
350
353
|
}
|
|
351
354
|
} catch {
|
|
352
|
-
|
|
355
|
+
deFound = false;
|
|
353
356
|
}
|
|
354
|
-
if (
|
|
357
|
+
if (!deFound) {
|
|
355
358
|
if (metadataItem.r__dataExtension_key) {
|
|
356
359
|
metadataItem.schema.name = metadataItem.r__dataExtension_key;
|
|
357
360
|
}
|
|
@@ -377,7 +380,7 @@ class Event extends MetadataType {
|
|
|
377
380
|
* @returns {Promise.<void>} -
|
|
378
381
|
*/
|
|
379
382
|
static async postDeployTasks(upsertResults, originalMetadata, createdUpdated) {
|
|
380
|
-
// CREATE ONLY - if dataExtensions were auto-
|
|
383
|
+
// CREATE ONLY - if dataExtensions were auto-created
|
|
381
384
|
if (this.reCacheDataExtensions.length && createdUpdated.created > 0) {
|
|
382
385
|
Util.logger.warn(' - Re-caching dependent Metadata: dataExtension');
|
|
383
386
|
const deRetrieve = await DataExtension.retrieveForCache();
|
|
@@ -443,6 +446,18 @@ class Event extends MetadataType {
|
|
|
443
446
|
await retriever.retrieve(['dataExtension'], reDownloadDeKeys);
|
|
444
447
|
}
|
|
445
448
|
}
|
|
449
|
+
|
|
450
|
+
// re-retrieve all upserted items to ensure we have all fields (createdDate and modifiedDate are otherwise not present)
|
|
451
|
+
Util.logger.debug(
|
|
452
|
+
`Caching all ${this.definition.type} post-deploy to ensure we have all fields`
|
|
453
|
+
);
|
|
454
|
+
const typeCache = await this.retrieveForCache();
|
|
455
|
+
// update values in upsertResults with retrieved values before saving to disk
|
|
456
|
+
for (const key of Object.keys(upsertResults)) {
|
|
457
|
+
if (typeCache.metadata[key]) {
|
|
458
|
+
upsertResults[key] = typeCache.metadata[key];
|
|
459
|
+
}
|
|
460
|
+
}
|
|
446
461
|
}
|
|
447
462
|
|
|
448
463
|
/**
|
|
@@ -557,7 +572,7 @@ class Event extends MetadataType {
|
|
|
557
572
|
try {
|
|
558
573
|
await this.compareSalesforceEntryEvents_dataExtension(
|
|
559
574
|
metadata.type,
|
|
560
|
-
metadata.configurationArguments
|
|
575
|
+
metadata.configurationArguments?.eventDataSummary,
|
|
561
576
|
metadata.r__dataExtension_key
|
|
562
577
|
);
|
|
563
578
|
} catch (ex) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
import MetadataType from './MetadataType.js';
|
|
4
|
+
import { Util } from '../util/util.js';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* @typedef {import('../../types/mcdev.d.js').BuObject} BuObject
|
|
@@ -20,10 +21,10 @@ import MetadataType from './MetadataType.js';
|
|
|
20
21
|
*
|
|
21
22
|
* @augments MetadataType
|
|
22
23
|
*/
|
|
23
|
-
class
|
|
24
|
+
class FileLocation extends MetadataType {
|
|
24
25
|
/**
|
|
25
|
-
* Retrieves Metadata of
|
|
26
|
-
* Endpoint /automation/v1/ftplocations/ return all
|
|
26
|
+
* Retrieves Metadata of FileLocation
|
|
27
|
+
* Endpoint /automation/v1/ftplocations/ return all FileLocations
|
|
27
28
|
*
|
|
28
29
|
* @param {string} retrieveDir Directory where retrieved metadata directory will be saved
|
|
29
30
|
* @param {void | string[]} [_] unused parameter
|
|
@@ -43,10 +44,47 @@ class FtpLocation extends MetadataType {
|
|
|
43
44
|
static async retrieveForCache() {
|
|
44
45
|
return super.retrieveREST(null, '/automation/v1/ftplocations/');
|
|
45
46
|
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* prepares a import definition for deployment
|
|
50
|
+
*
|
|
51
|
+
* @param {MetadataTypeItem} metadata a single importDef
|
|
52
|
+
* @returns {Promise.<MetadataTypeItem>} Promise
|
|
53
|
+
*/
|
|
54
|
+
static async preDeployTasks(metadata) {
|
|
55
|
+
if (metadata.c__locationType) {
|
|
56
|
+
metadata.locationTypeId = this.definition.locationTypeMapping[metadata.c__locationType];
|
|
57
|
+
}
|
|
58
|
+
return metadata;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* manages post retrieve steps
|
|
63
|
+
*
|
|
64
|
+
* @param {MetadataTypeItem} metadata a single item
|
|
65
|
+
* @returns {MetadataTypeItem} parsed metadata
|
|
66
|
+
*/
|
|
67
|
+
static postRetrieveTasks(metadata) {
|
|
68
|
+
if (metadata.locationTypeId) {
|
|
69
|
+
try {
|
|
70
|
+
metadata.c__locationType = Util.inverseGet(
|
|
71
|
+
this.definition.locationTypeMapping,
|
|
72
|
+
metadata.locationTypeId
|
|
73
|
+
);
|
|
74
|
+
delete metadata.locationTypeId;
|
|
75
|
+
} catch {
|
|
76
|
+
Util.logger.info(
|
|
77
|
+
'Please report this new & unknown locationTypeId to the mcdev developer team via github: ' +
|
|
78
|
+
metadata.locationTypeId
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return metadata;
|
|
83
|
+
}
|
|
46
84
|
}
|
|
47
85
|
|
|
48
86
|
// Assign definition to static attributes
|
|
49
87
|
import MetadataTypeDefinitions from '../MetadataTypeDefinitions.js';
|
|
50
|
-
|
|
88
|
+
FileLocation.definition = MetadataTypeDefinitions.fileLocation;
|
|
51
89
|
|
|
52
|
-
export default
|
|
90
|
+
export default FileLocation;
|