diff --git a/@types/lib/metadataTypes/DataExtension.d.ts b/@types/lib/metadataTypes/DataExtension.d.ts index e7be46d84..7b213f645 100644 --- a/@types/lib/metadataTypes/DataExtension.d.ts +++ b/@types/lib/metadataTypes/DataExtension.d.ts @@ -193,7 +193,7 @@ declare class DataExtension extends MetadataType { * @param {string[]} [additionalFields] Returns specified fields even if their retrieve definition is not set to true * @returns {Promise.} - */ - static "__#5@#attachFields"(metadata: DataExtensionMap, fieldOptions?: SoapRequestParams, additionalFields?: string[]): Promise; + static attachFields(metadata: DataExtensionMap, fieldOptions?: SoapRequestParams, additionalFields?: string[]): Promise; /** * Retrieves dataExtension metadata. Afterwards starts retrieval of dataExtensionColumn metadata retrieval * diff --git a/@types/lib/metadataTypes/DataExtension.d.ts.map b/@types/lib/metadataTypes/DataExtension.d.ts.map index 159643777..17491193c 100644 --- a/@types/lib/metadataTypes/DataExtension.d.ts.map +++ b/@types/lib/metadataTypes/DataExtension.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"DataExtension.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/DataExtension.js"],"names":[],"mappings":";uBAea,OAAO,wBAAwB,EAAE,QAAQ;+BACzC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;8BACrD,OAAO,wBAAwB,EAAE,eAAe;gCAChD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;qCAI5C,OAAO,wBAAwB,EAAE,sBAAsB;oCACvD,OAAO,wBAAwB,EAAE,qBAAqB;gCACtD,OAAO,wBAAwB,EAAE,iBAAiB;+BAClD,OAAO,wBAAwB,EAAE,gBAAgB;AAb9D;;;;;;;GAOG;AAEH;;;;;GAKG;AAEH;;;;GAIG;AACH;IACI,mFAAmF;IACnF,kBADW;YAAQ,MAAM,GAAE,qBAAqB;KAAC,CAChC;IAEjB;;;;;;;OAOG;IACH,2BAJW,gBAAgB,aAChB,MAAM,GACJ,OAA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qBACN,WAAW,GACT,OAAO,CAAE;QAAC,QAAQ,EAAE,iBAAiB,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,CAAC,CAgDjE;IA6DD;;;;;;;OAOG;IACH,4BAWC;CA6FJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAppDwB,mBAAmB"} \ No newline at end of file +{"version":3,"file":"DataExtension.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/DataExtension.js"],"names":[],"mappings":";uBAea,OAAO,wBAAwB,EAAE,QAAQ;+BACzC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;8BACrD,OAAO,wBAAwB,EAAE,eAAe;gCAChD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;qCAI5C,OAAO,wBAAwB,EAAE,sBAAsB;oCACvD,OAAO,wBAAwB,EAAE,qBAAqB;gCACtD,OAAO,wBAAwB,EAAE,iBAAiB;+BAClD,OAAO,wBAAwB,EAAE,gBAAgB;AAb9D;;;;;;;GAOG;AAEH;;;;;GAKG;AAEH;;;;GAIG;AACH;IACI,mFAAmF;IACnF,kBADW;YAAQ,MAAM,GAAE,qBAAqB;KAAC,CAChC;IAEjB;;;;;;;OAOG;IACH,2BAJW,gBAAgB,aAChB,MAAM,GACJ,OAAO,CAAE,eAAe,CAAC,CAiGrC;IAyED;;;;;OAKG;IACH,wCAHW,MAAM,GACJ,OAAO,CA0BnB;IAED;;;;;OAKG;IACH,wBAHW,iBAAiB,gBAK3B;IAED;;;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H,4BAWC;CA6FJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAppDwB,mBAAmB"} \ No newline at end of file diff --git a/@types/lib/metadataTypes/DataExtensionField.d.ts b/@types/lib/metadataTypes/DataExtensionField.d.ts index 828fe9f83..decb21b59 100644 --- a/@types/lib/metadataTypes/DataExtensionField.d.ts +++ b/@types/lib/metadataTypes/DataExtensionField.d.ts @@ -45,6 +45,12 @@ declare class DataExtensionField extends MetadataType { metadata: DataExtensionFieldMap; type: string; }>; + /** + * Retrieves all records and saves it to disk + * + * @returns {Promise.} Promise of items + */ + static retrieveForCache(): Promise; /** * Retrieves all records for caching * @@ -106,7 +112,7 @@ declare class DataExtensionField extends MetadataType { declare namespace DataExtensionField { let definition: { bodyIteratorField: string; - dependencies: any[]; + dependencies: string[]; dependencyGraph: any; filter: {}; hasExtended: boolean; diff --git a/@types/lib/metadataTypes/DataExtensionField.d.ts.map b/@types/lib/metadataTypes/DataExtensionField.d.ts.map index bfe6d8852..5b41eb4b9 100644 --- a/@types/lib/metadataTypes/DataExtensionField.d.ts.map +++ b/@types/lib/metadataTypes/DataExtensionField.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"DataExtensionField.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/DataExtensionField.js"],"names":[],"mappings":";uBAMa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAA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;yBAzWwB,mBAAmB"} \ No newline at end of file +{"version":3,"file":"DataExtensionField.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/DataExtensionField.js"],"names":[],"mappings":";uBAOa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;oCAI5C,OAAO,wBAAwB,EAAE,qBAAqB;qCACtD,OAAO,wBAAwB,EAAE,sBAAsB;AAfpE;;;;;;;;;;;GAWG;AAEH;;;GAGG;AAEH;;;;GAIG;AACH;IACI,6BAAwB;IAExB;;;;;;OAMG;IACH,6BAJW,MAAM,qBACN,MAAM,EAAE,GACN,OAAO,CAAE;QAAC,QAAQ,EAAE,qBAAqB,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,CAAC,CAIrE;IACD;;;;OAIG;IACH,2BAFa,OAAO,CAAE,kBAAkB,CAAC,CAQxC;IAED;;;;;;OAMG;IACH,0CAJW,iBAAiB,qBACjB,MAAM,EAAE,GACN,OAAO,CAAE;QAAC,QAAQ,EAAE,qBAAqB,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,CAAC,CAUrE;IAED;;;;;OAKG;IACH,uCAHW,qBAAqB,GACnB,sBAAsB,EAAE,CASpC;IAED;;;;;;OAMG;IACH,uBAJW,sBAAsB,KACtB,sBAAsB,GACpB,MAAM,CAIlB;IAED;;;;;OAKG;IACH,qCAHW,sBAAsB,GACpB,sBAAsB,CAelC;IAED;;;;;;;OAOG;IACH,mDAJW,sBAAsB,EAAE,SACxB,MAAM,GACJ,OAAO,CAAE,qBAAqB,CAAC,CAsK3C;IAYD;;;;;;OAMG;IACH,oCAJW,MAAM,YACN,MAAM,GACJ,OAAO,CAAE,OAAO,CAAC,CAsD7B;IAED;;;;;OAKG;IACH,oCAHW,MAAM,GACJ,OAAO,CAAE,IAAI,CAAC,CAO1B;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAtXwB,mBAAmB"} \ No newline at end of file diff --git a/@types/lib/metadataTypes/Event.d.ts b/@types/lib/metadataTypes/Event.d.ts index e334b04d9..e24e58a50 100644 --- a/@types/lib/metadataTypes/Event.d.ts +++ b/@types/lib/metadataTypes/Event.d.ts @@ -13,6 +13,7 @@ export type ReferenceObject = import("../../types/mcdev.d.js").ReferenceObject; export type SfObjectField = import("../../types/mcdev.d.js").SfObjectField; export type configurationArguments = import("../../types/mcdev.d.js").configurationArguments; export type Conditions = import("../../types/mcdev.d.js").Conditions; +export type DataExtensionItem = import("../../types/mcdev.d.js").DataExtensionItem; /** * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract @@ -29,6 +30,7 @@ export type Conditions = import("../../types/mcdev.d.js").Conditions; * @typedef {import('../../types/mcdev.d.js').SfObjectField} SfObjectField * @typedef {import('../../types/mcdev.d.js').configurationArguments} configurationArguments * @typedef {import('../../types/mcdev.d.js').Conditions} Conditions + * @typedef {import('../../types/mcdev.d.js').DataExtensionItem} DataExtensionItem */ /** * Event MetadataType @@ -163,6 +165,14 @@ declare class Event extends MetadataType { * @returns {Promise.} - */ static postRetrieveTasks_SalesforceEntryEvents(triggerType: string, ca: configurationArguments, key: string, isPublished: boolean, type?: string): Promise; + /** + * + * @param {string} triggerType e.g. SalesforceObjectTriggerV2, APIEvent, ... + * @param {string[]} eventDataSummary eventDataConfig in simplified string-form + * @param {string} deKey key of associated dataExtension + * @returns {Promise.} - + */ + static compareSalesforceEntryEvents_dataExtension(triggerType: string, eventDataSummary: string[], deKey: string): Promise; /** * * @param {string} triggerType e.g. SalesforceObjectTriggerV2, APIEvent, ... @@ -379,6 +389,30 @@ declare namespace Event { retrieving: boolean; template: boolean; }; + 'configurationArguments.contactKey.relationshipIdName': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'configurationArguments.contactKey.relationshipName': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'configurationArguments.contactKey.isPolymorphic': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'configurationArguments.contactKey.referenceObjectName': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; 'configurationArguments.contactPersonType': { isCreateable: boolean; isUpdateable: boolean; @@ -403,6 +437,9 @@ declare namespace Event { retrieving: boolean; template: boolean; }; + 'configurationArguments.eventDataConfig.objects': { + skipValidation: boolean; + }; 'configurationArguments.eventDataSummary': { isCreateable: boolean; isUpdateable: boolean; @@ -421,12 +458,27 @@ declare namespace Event { retrieving: boolean; template: boolean; }; - 'configurationArguments.primaryObjectFilterCriteria': { + 'configurationArguments.passThroughArgument.fields': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'configurationArguments.passThroughArgument.fields.ContactKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'configurationArguments.passThroughArgument.fields.Email': { isCreateable: boolean; isUpdateable: boolean; retrieving: boolean; template: boolean; }; + 'configurationArguments.primaryObjectFilterCriteria': { + skipValidation: boolean; + }; 'configurationArguments.primaryObjectFilterSummary': { isCreateable: boolean; isUpdateable: boolean; diff --git a/@types/lib/metadataTypes/Event.d.ts.map b/@types/lib/metadataTypes/Event.d.ts.map index b820bdc0b..3946155ea 100644 --- a/@types/lib/metadataTypes/Event.d.ts.map +++ b/@types/lib/metadataTypes/Event.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Event.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/Event.js"],"names":[],"mappings":";uBAUa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;8BAE5C,OAAO,wBAAwB,EAAE,eAAe;4BAChD,OAAO,wBAAwB,EAAE,aAAa;qCAC9C,OAAO,wBAAwB,EAAE,sBAAsB;yBACvD,OAAO,wBAAwB,EAAE,UAAU;AAfxD;;;;;;;;;;;;;;;;GAgBG;AAEH;;;;GAIG;AACH;IACI,oCAAkC;IAElC;;;;;;;;;;OAUG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,OAAO,CAAE,kBAAkB,CAAC,CAwBxC;IAED;;;;OAIG;IACH,2BAFa,OAAO,CAAE,kBAAkB,CAAC,CAIxC;IAED;;;;;;;OAOG;IACH,uCALW,MAAM,QACN,MAAM,qBACN,WAAW,GACT,OAAO,CAAE,mBAAmB,CAAC,CAiDzC;IA8BD;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAK1B;IAED;;;;;OAKG;IACH,6BAHW,gBAAgB,gBAU1B;IAED;;;;;OAKG;IACH,gCAHW,gBAAgB,GACd,OAAO,CAAE,gBAAgB,CAAC,CAyDtC;IAyLD;;;;;OAKG;IACH,mCAHW,gBAAgB,GACd,OAAO,CAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBArqCwB,mBAAmB"} \ No newline at end of file diff --git a/@types/lib/metadataTypes/definitions/DataExtensionField.definition.d.ts b/@types/lib/metadataTypes/definitions/DataExtensionField.definition.d.ts index 038075a93..b75df5d67 100644 --- a/@types/lib/metadataTypes/definitions/DataExtensionField.definition.d.ts +++ b/@types/lib/metadataTypes/definitions/DataExtensionField.definition.d.ts @@ -1,6 +1,6 @@ declare namespace _default { let bodyIteratorField: string; - let dependencies: any[]; + let dependencies: string[]; let dependencyGraph: any; let filter: {}; let hasExtended: boolean; diff --git a/@types/lib/metadataTypes/definitions/Event.definition.d.ts b/@types/lib/metadataTypes/definitions/Event.definition.d.ts index 15cdab983..c00e13274 100644 --- a/@types/lib/metadataTypes/definitions/Event.definition.d.ts +++ b/@types/lib/metadataTypes/definitions/Event.definition.d.ts @@ -205,6 +205,30 @@ declare namespace _default { retrieving: boolean; template: boolean; }; + 'configurationArguments.contactKey.relationshipIdName': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'configurationArguments.contactKey.relationshipName': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'configurationArguments.contactKey.isPolymorphic': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'configurationArguments.contactKey.referenceObjectName': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; 'configurationArguments.contactPersonType': { isCreateable: boolean; isUpdateable: boolean; @@ -229,6 +253,9 @@ declare namespace _default { retrieving: boolean; template: boolean; }; + 'configurationArguments.eventDataConfig.objects': { + skipValidation: boolean; + }; 'configurationArguments.eventDataSummary': { isCreateable: boolean; isUpdateable: boolean; @@ -247,12 +274,27 @@ declare namespace _default { retrieving: boolean; template: boolean; }; - 'configurationArguments.primaryObjectFilterCriteria': { + 'configurationArguments.passThroughArgument.fields': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'configurationArguments.passThroughArgument.fields.ContactKey': { isCreateable: boolean; isUpdateable: boolean; retrieving: boolean; template: boolean; }; + 'configurationArguments.passThroughArgument.fields.Email': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'configurationArguments.primaryObjectFilterCriteria': { + skipValidation: boolean; + }; 'configurationArguments.primaryObjectFilterSummary': { isCreateable: boolean; isUpdateable: boolean; diff --git a/lib/metadataTypes/DataExtension.js b/lib/metadataTypes/DataExtension.js index f14fa9c29..dcb14e0ac 100644 --- a/lib/metadataTypes/DataExtension.js +++ b/lib/metadataTypes/DataExtension.js @@ -765,27 +765,27 @@ class DataExtension extends MetadataType { }, }; } - let metadata = await this._retrieveAll(additionalFields, requestParams); + let metadataMap = await this._retrieveAll(additionalFields, requestParams); // in case of cache dont get fields - if (metadata && retrieveDir) { + if (metadataMap && retrieveDir) { // get fields from API - await this.#attachFields(metadata, fieldOptions, additionalFields); + await this.attachFields(metadataMap, fieldOptions, additionalFields); } if (!retrieveDir && this.buObject.eid !== this.buObject.mid) { const metadataParentBu = await this.retrieveSharedForCache(additionalFields); // make sure to overwrite parent bu DEs with local ones - metadata = { ...metadataParentBu, ...metadata }; + metadataMap = { ...metadataParentBu, ...metadataMap }; } if (retrieveDir) { - const savedMetadata = await super.saveResults(metadata, retrieveDir, null); + const savedMetadata = await super.saveResults(metadataMap, retrieveDir, null); Util.logger.info( `Downloaded: ${this.definition.type} (${Object.keys(savedMetadata).length})` + Util.getKeysString(key) ); await this.runDocumentOnRetrieve(key, savedMetadata); } - return { metadata: metadata, type: 'dataExtension' }; + return { metadata: metadataMap, type: 'dataExtension' }; } /** @@ -872,7 +872,7 @@ class DataExtension extends MetadataType { * @param {string[]} [additionalFields] Returns specified fields even if their retrieve definition is not set to true * @returns {Promise.} - */ - static async #attachFields(metadata, fieldOptions, additionalFields) { + static async attachFields(metadata, fieldOptions, additionalFields) { const fieldsObj = await this._retrieveFields(fieldOptions, additionalFields); const fieldKeys = Object.keys(fieldsObj); diff --git a/lib/metadataTypes/DataExtensionField.js b/lib/metadataTypes/DataExtensionField.js index 5ac36fe0e..c1cca98c4 100644 --- a/lib/metadataTypes/DataExtensionField.js +++ b/lib/metadataTypes/DataExtensionField.js @@ -2,6 +2,7 @@ import MetadataType from './MetadataType.js'; import { Util } from '../util/util.js'; +import DataExtension from './DataExtension.js'; /** * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject @@ -39,6 +40,18 @@ class DataExtensionField extends MetadataType { static async retrieve(retrieveDir, additionalFields) { return super.retrieveSOAP(retrieveDir, null, null, additionalFields); } + /** + * Retrieves all records and saves it to disk + * + * @returns {Promise.} Promise of items + */ + static async retrieveForCache() { + const cachedDEs = cache.getCache().dataExtension; + if (cachedDEs) { + await DataExtension.attachFields(cachedDEs); + } + return; + } /** * Retrieves all records for caching @@ -365,6 +378,7 @@ class DataExtensionField extends MetadataType { // Assign definition to static attributes import MetadataTypeDefinitions from '../MetadataTypeDefinitions.js'; +import cache from '../util/cache.js'; DataExtensionField.definition = MetadataTypeDefinitions.dataExtensionField; export default DataExtensionField; diff --git a/lib/metadataTypes/Event.js b/lib/metadataTypes/Event.js index ecc3a09be..e446dc07d 100644 --- a/lib/metadataTypes/Event.js +++ b/lib/metadataTypes/Event.js @@ -23,6 +23,7 @@ import pLimit from 'p-limit'; * @typedef {import('../../types/mcdev.d.js').SfObjectField} SfObjectField * @typedef {import('../../types/mcdev.d.js').configurationArguments} configurationArguments * @typedef {import('../../types/mcdev.d.js').Conditions} Conditions + * @typedef {import('../../types/mcdev.d.js').DataExtensionItem} DataExtensionItem */ /** @@ -246,6 +247,11 @@ class Event extends MetadataType { metadata.type, metadata.configurationArguments ); + await this.compareSalesforceEntryEvents_dataExtension( + metadata.type, + metadata.configurationArguments.eventDataSummary, + metadata.r__dataExtension_key + ); return metadata; } @@ -519,6 +525,17 @@ class Event extends MetadataType { if (metadata.mode === 'Production') { delete metadata.mode; } + if (metadata.interactionCount === 0 && metadata.publishedInteractionCount === 0) { + Util.logger.warn( + ` - ${this.definition.type} '${metadata[this.definition.nameField]}' (${metadata[this.definition.keyField]}): is no longer used and could therefore be deleted. Associated Journeys: ${metadata.interactionCount}. Active Journeys: ${metadata.publishedInteractionCount}.` + ); + } else if (metadata.publishedInteractionCount === 0) { + Util.logger.info( + Util.getGrayMsg( + ` - ${this.definition.type} '${metadata[this.definition.nameField]}' (${metadata[this.definition.keyField]}): is currently inactive. Associated Journeys: ${metadata.interactionCount}. Active Journeys: ${metadata.publishedInteractionCount}.` + ) + ); + } try { await this.postRetrieveTasks_SalesforceEntryEvents( @@ -529,7 +546,18 @@ class Event extends MetadataType { ); } catch (ex) { Util.logger.warn( - ` - ${this.definition.type} '${metadata[this.definition.nameField]}' (${metadata[this.definition.keyField]}): ${ex.message}` + ` - ${this.definition.type} '${metadata[this.definition.nameField]}' (${metadata[this.definition.keyField]}) with ${metadata.publishedInteractionCount} active journeys: ${ex.message}` + ); + } + try { + await this.compareSalesforceEntryEvents_dataExtension( + metadata.type, + metadata.configurationArguments.eventDataSummary, + metadata.r__dataExtension_key + ); + } catch (ex) { + Util.logger.warn( + ` - ${this.definition.type} '${metadata[this.definition.nameField]}' (${metadata[this.definition.keyField]}) with ${metadata.publishedInteractionCount} active journeys: ${ex.message}` ); } @@ -811,7 +839,7 @@ class Event extends MetadataType { } // 1.2 check if all fields in eventDataConfig are listed in the eventDataSummary if (!ca.eventDataSummary.includes(object.dePrefix + fieldName)) { - // TODO instead, remove in postRetrieve and re-add in preDeploy + // we could auto-create eventDataSummary but frankly this is good for code reviews and for searching for fields errors.push( `Field ${object.dePrefix + fieldName} is listed under eventDataConfig${object.referenceObject ? ` for referenceObject ` + object.referenceObject : ''} but not in eventDataSummary` ); @@ -824,7 +852,7 @@ class Event extends MetadataType { // check if all fields in eventDataSummary are listed in the eventDataConfig for (let fieldName of ca.eventDataSummary) { - // TODO instead, remove in postRetrieve and re-add in preDeploy + // we could auto-create eventDataSummary but frankly this is good for code reviews and for searching for fields const fieldPath = fieldName.split(':'); fieldName = fieldPath.pop(); const dePrefix = fieldPath.join(':') + ':'; @@ -1050,6 +1078,45 @@ class Event extends MetadataType { // check if whats on the journey matches what SF Core offers this.checkSalesforceEntryEvents(ca, isPublished); } + /** + * + * @param {string} triggerType e.g. SalesforceObjectTriggerV2, APIEvent, ... + * @param {string[]} eventDataSummary eventDataConfig in simplified string-form + * @param {string} deKey key of associated dataExtension + * @returns {Promise.} - + */ + static async compareSalesforceEntryEvents_dataExtension( + triggerType, + eventDataSummary, + + deKey + ) { + if (triggerType !== 'SalesforceObjectTriggerV2' || !eventDataSummary) { + return; + } + + /** @type {DataExtensionItem} */ + const deItem = deKey ? cache.getByKey('dataExtension', deKey) : null; + if (!deItem) { + return; + } + + const errors = []; + for (const fieldName of eventDataSummary) { + if (!deItem.Fields.find((field) => field.Name === fieldName)) { + errors.push( + `Field ${fieldName} is was not found in associated dataExtension ${deKey}` + ); + } + } + if (errors?.length) { + // add a line break + if (errors.length > 1) { + errors.unshift(``); + } + throw new Error(errors.join('\n ยท ')); // eslint-disable-line unicorn/error-message + } + } /** * diff --git a/lib/metadataTypes/definitions/DataExtensionField.definition.js b/lib/metadataTypes/definitions/DataExtensionField.definition.js index 4dc29b2d5..3cdc76678 100644 --- a/lib/metadataTypes/definitions/DataExtensionField.definition.js +++ b/lib/metadataTypes/definitions/DataExtensionField.definition.js @@ -1,6 +1,6 @@ export default { bodyIteratorField: 'Results', - dependencies: [], + dependencies: ['dataExtension'], dependencyGraph: null, filter: {}, hasExtended: false, diff --git a/lib/metadataTypes/definitions/Event.definition.js b/lib/metadataTypes/definitions/Event.definition.js index d488a9a8c..e49ecc0b4 100644 --- a/lib/metadataTypes/definitions/Event.definition.js +++ b/lib/metadataTypes/definitions/Event.definition.js @@ -1,6 +1,6 @@ export default { bodyIteratorField: 'items', - dependencies: ['automation', 'dataExtension', 'user'], + dependencies: ['automation', 'dataExtension', 'dataExtensionField', 'user'], dependencyGraph: { automation: ['r__automation_key'], dataExtension: ['r__dataExtension_key'] }, hasExtended: false, idField: 'id', @@ -208,6 +208,30 @@ export default { retrieving: true, template: true, }, + 'configurationArguments.contactKey.relationshipIdName': { + isCreateable: true, + isUpdateable: true, + retrieving: true, + template: true, + }, + 'configurationArguments.contactKey.relationshipName': { + isCreateable: true, + isUpdateable: true, + retrieving: true, + template: true, + }, + 'configurationArguments.contactKey.isPolymorphic': { + isCreateable: true, + isUpdateable: true, + retrieving: true, + template: true, + }, + 'configurationArguments.contactKey.referenceObjectName': { + isCreateable: true, + isUpdateable: true, + retrieving: true, + template: true, + }, 'configurationArguments.contactPersonType': { isCreateable: true, isUpdateable: true, @@ -232,6 +256,9 @@ export default { retrieving: true, template: true, }, + 'configurationArguments.eventDataConfig.objects': { + skipValidation: true, + }, 'configurationArguments.eventDataSummary': { isCreateable: true, isUpdateable: true, @@ -250,12 +277,27 @@ export default { retrieving: true, template: true, }, - 'configurationArguments.primaryObjectFilterCriteria': { + 'configurationArguments.passThroughArgument.fields': { + isCreateable: true, + isUpdateable: true, + retrieving: true, + template: true, + }, + 'configurationArguments.passThroughArgument.fields.ContactKey': { isCreateable: true, isUpdateable: true, retrieving: true, template: true, }, + 'configurationArguments.passThroughArgument.fields.Email': { + isCreateable: true, + isUpdateable: true, + retrieving: true, + template: true, + }, + 'configurationArguments.primaryObjectFilterCriteria': { + skipValidation: true, + }, 'configurationArguments.primaryObjectFilterSummary': { isCreateable: true, isUpdateable: true,