From e302d74d4b8d20065605add3aed63bf1b9872e0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 14 Aug 2024 16:52:03 +0200 Subject: [PATCH 01/43] #1570: check if triggering SF objects and their fields are existing before deploy and after retrieve --- @types/lib/metadataTypes/Event.d.ts | 35 +- @types/lib/metadataTypes/Event.d.ts.map | 2 +- @types/lib/metadataTypes/Journey.d.ts | 5 +- @types/lib/metadataTypes/Journey.d.ts.map | 2 +- .../lib/metadataTypes/MetadataType.d.ts.map | 2 +- lib/metadataTypes/Event.js | 315 +++++++++++++++++- lib/metadataTypes/Journey.js | 36 +- lib/metadataTypes/MetadataType.js | 3 +- 8 files changed, 379 insertions(+), 21 deletions(-) diff --git a/@types/lib/metadataTypes/Event.d.ts b/@types/lib/metadataTypes/Event.d.ts index 5d4e69f96..f9ae2450c 100644 --- a/@types/lib/metadataTypes/Event.d.ts +++ b/@types/lib/metadataTypes/Event.d.ts @@ -80,9 +80,40 @@ declare class Event extends MetadataType { * parses retrieved Metadata before saving * * @param {MetadataTypeItem} metadata a single event definition - * @returns {MetadataTypeItem} parsed metadata + * @returns {Promise.} parsed metadata */ - static postRetrieveTasks(metadata: MetadataTypeItem): MetadataTypeItem; + static postRetrieveTasks(metadata: MetadataTypeItem): Promise; + static sfObjects: { + workflowObjects: any; + referencedObjects: {}; + objectFields: {}; + }; + /** + * helper for {@link this.checkSalesforceEntryEvents} that retrieves information about SF object fields + * + * @param {string} objectAPIName salesforce object api name + */ + static getSalesforceObjects(objectAPIName: string): Promise; + static defaultSalesforceFields: string[]; + /** + * + * @param {any} ca trigger[0].configurationArguments + */ + static checkSalesforceEntryEvents(ca: any): void; + /** + * + * @param {string} triggerType e.g. SalesforceObjectTriggerV2, APIEvent, ... + * @param {any} ca trigger[0].configurationArguments + * @returns {Promise.} - + */ + static postRetrieveTasks_SalesforceEntryEvents(triggerType: string, ca: any): Promise; + /** + * + * @param {string} triggerType e.g. SalesforceObjectTriggerV2, APIEvent, ... + * @param {any} ca trigger[0].configurationArguments + * @returns {Promise.} - + */ + static preDeployTasks_SalesforceEntryEvents(triggerType: string, ca: any): Promise; } declare namespace Event { let definition: { diff --git a/@types/lib/metadataTypes/Event.d.ts.map b/@types/lib/metadataTypes/Event.d.ts.map index 58336d3d7..341421cd4 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":";uBASa,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;AAVzD;;;;;;;;;;;GAWG;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,gBAAgB,CA+B5B;IAyLD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ArbwB,mBAAmB"} \ No newline at end of file +{"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;AAVzD;;;;;;;;;;;GAWG;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,gBAAgB,CAgC5B;IAyLD;;;;;OAKG;IACH,mCAHW,gBAAgB,GACd,OAAO,CAAE,gBAAgB,CAAC,CA0CtC;IACD;;;;MAIE;IAEF;;;;OAIG;IACH,2CAFW,MAAM,iBA8HhB;IAED,yCAYE;IAEF;;;OAGG;IACH,sCAFW,GAAG,QAiDb;IAED;;;;;OAKG;IACH,4DAJW,MAAM,MACN,GAAG,GACD,OAAO,CAAE,IAAI,CAAC,CA0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;;;;;;;;;;;;;;;;;;;;;;;;;yBA5uBwB,mBAAmB"} \ No newline at end of file diff --git a/@types/lib/metadataTypes/Journey.d.ts b/@types/lib/metadataTypes/Journey.d.ts index dc673af43..092e05092 100644 --- a/@types/lib/metadataTypes/Journey.d.ts +++ b/@types/lib/metadataTypes/Journey.d.ts @@ -63,12 +63,11 @@ declare class Journey extends MetadataType { static _postRetrieveTasksBulk(metadataMap: MetadataTypeMap): Promise; /** * manages post retrieve steps - * ! BETA RELEASE of journey support (v4.3.0); it so far only resolves a limited amount of dependencies and will likely break during cross-BU deployments! * * @param {MetadataTypeItem} metadata a single item - * @returns {MetadataTypeItem} Array with one metadata object + * @returns {Promise.} Array with one metadata object */ - static postRetrieveTasks(metadata: MetadataTypeItem): MetadataTypeItem; + static postRetrieveTasks(metadata: MetadataTypeItem): Promise; /** * helper for {@link Journey.postRetrieveTasks} * diff --git a/@types/lib/metadataTypes/Journey.d.ts.map b/@types/lib/metadataTypes/Journey.d.ts.map index 8867fabc3..5701725cc 100644 --- a/@types/lib/metadataTypes/Journey.d.ts.map +++ b/@types/lib/metadataTypes/Journey.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Journey.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/Journey.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;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;;;;;GAQG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,M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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAlrDwB,mBAAmB"} \ No newline at end of file diff --git a/@types/lib/metadataTypes/MetadataType.d.ts.map b/@types/lib/metadataTypes/MetadataType.d.ts.map index 90e2ff5ad..1446dafb6 100644 --- a/@types/lib/metadataTypes/MetadataType.d.ts.map +++ b/@types/lib/metadataTypes/MetadataType.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"MetadataType.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/MetadataType.js"],"names":[],"mappings":";uBAkBa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;sBAChD,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAA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9B;IAED;;;;;;;OAOG;IACH,iCANW,MAAM,EAAE,qBACR,YAAY,iBACZ,YAAY,gBACZ,OAAO,GACL,OAAO,CAAE,YAAY,CAAC,CAoHlC;IAED;;;;;OAKG;IACH,4CAHW,MAAM,yBACN,YAAY,QAE8C;IAErE;;;;;;;OAOG;IACH,2BALW,gBAAgB,aAChB,MAAM,iBACN,MAAM,GACJ,CAAC,MAAM,CAAC,EAAE,CAUtB;IAED;;;;;;;OAOG;IACH,iCALW,GAAG,kBACH,MAAM,EAAE,iBACR,MAAM,GACJ,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAkBjC;IAED;;;;OAIG;IACH,qCAHW,eAAe,GACb,MAAM,EAAE,CAwDpB;IAED;;;;;;;OAOG;IACH,4BALW,MAAM,gBACN,gBAAgB,gBAChB,MAAM,GACJ,MAAM,CAelB;CACJ;;;;;;;;;;;;gBAaS,GAAG;oBAIH,OAAO;iBAIP,MAAM;kBAIN,QAAQ"} \ No newline at end of file +{"version":3,"file":"MetadataType.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/MetadataType.js"],"names":[],"mappings":";uBAkBa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;sBAChD,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;gCACtD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY;kBAC7C,OAAO,UAAU,EAAE,OAAO;uBAC1B,OAAO,wBAAwB,EAAE,QAAQ;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,CAAC,EAAE,CAUtB;IAED;;;;;;;OAOG;IACH,iCALW,GAAG,kBACH,MAAM,EAAE,iBACR,MAAM,GACJ,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAkBjC;IAED;;;;OAIG;IACH,qCAHW,eAAe,GACb,MAAM,EAAE,CAwDpB;IAED;;;;;;;OAOG;IACH,4BALW,MAAM,gBACN,gBAAgB,gBAChB,MAAM,GACJ,MAAM,CAelB;CACJ;;;;;;;;;;;;gBAaS,GAAG;oBAIH,OAAO;iBAIP,MAAM;kBAIN,QAAQ"} \ No newline at end of file diff --git a/lib/metadataTypes/Event.js b/lib/metadataTypes/Event.js index 0d07c77de..4345612e3 100644 --- a/lib/metadataTypes/Event.js +++ b/lib/metadataTypes/Event.js @@ -5,6 +5,7 @@ import { Util } from '../util/util.js'; import File from '../util/file.js'; import cache from '../util/cache.js'; import deepEqual from 'deep-equal'; +import pLimit from 'p-limit'; /** * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject @@ -214,6 +215,7 @@ class Event extends MetadataType { break; } } + this.preDeployTasks_SalesforceEntryEvents(metadata.type, metadata.configurationArguments); return metadata; } @@ -405,9 +407,9 @@ class Event extends MetadataType { * parses retrieved Metadata before saving * * @param {MetadataTypeItem} metadata a single event definition - * @returns {MetadataTypeItem} parsed metadata + * @returns {Promise.} parsed metadata */ - static postRetrieveTasks(metadata) { + static async postRetrieveTasks(metadata) { try { metadata.r__dataExtension_key = cache.searchForField( 'dataExtension', @@ -435,8 +437,317 @@ class Event extends MetadataType { delete metadata.mode; } + try { + await this.postRetrieveTasks_SalesforceEntryEvents( + metadata.type, + metadata.configurationArguments + ); + } catch (ex) { + Util.logger.warn( + ` - ${this.definition.type} '${metadata[this.definition.nameField]}' (${metadata[this.definition.keyField]}): ${ex.message}` + ); + } + return metadata; } + static sfObjects = { + workflowObjects: null, + referencedObjects: {}, + objectFields: {}, + }; + + /** + * helper for {@link this.checkSalesforceEntryEvents} that retrieves information about SF object fields + * + * @param {string} objectAPIName salesforce object api name + */ + static async getSalesforceObjects(objectAPIName) { + if (!objectAPIName) { + return; + } + + // 1 get all available Salesforce objects + if (!this.sfObjects.workflowObjects) { + Util.logger.info(Util.getGrayMsg(' - Caching Salesforce Objects')); + const workflowObjectsResponse = await this.client.rest.get( + `/data/v1/integration/member/salesforce/workflowobjects` + ); + this.sfObjects.workflowObjects = workflowObjectsResponse + ? workflowObjectsResponse.map((o) => o.apiname) + : []; + Util.logger.debug( + 'sfObjects.workflowObjectApiNames: ' + + JSON.stringify(this.sfObjects.workflowObjects) + ); + } + + // 2 get objects related to the selected object + if (!this.sfObjects.referencedObjects?.[objectAPIName]) { + Util.logger.info( + Util.getGrayMsg(' - Caching Related Salesforce Objects for ' + objectAPIName) + ); + try { + const referenceObjectsResponse = await this.client.rest.get( + `/data/v1/integration/member/salesforce/object/${objectAPIName}/referenceobjects` + ); + // add itself first so that we get the fields for objectAPIName as well + const selfReference = { referenceObjectName: objectAPIName }; + this.sfObjects.referencedObjects[objectAPIName] = referenceObjectsResponse + ? [selfReference, ...referenceObjectsResponse] + : [selfReference]; + Util.logger.debug( + `sfObjects.referencedObjects[${objectAPIName}]: ` + + JSON.stringify(this.sfObjects.referencedObjects[objectAPIName]) + ); + } catch (ex) { + if (ex.code === 'ERR_BAD_RESPONSE') { + throw new Error( + `Could not find Salesforce entry object ${objectAPIName} on connected org.` + ); + } + } + + // 3 get fields + const rateLimit = pLimit(20); + const uniqueSfObjectNames = this.sfObjects.referencedObjects[objectAPIName] + ? [ + ...new Set( + Object.values(this.sfObjects.referencedObjects[objectAPIName]) + .map((el) => el.referenceObjectName) + .sort() + ), + ] + : []; + await Promise.all( + uniqueSfObjectNames.map((objectAPIName) => + rateLimit(async () => { + if (this.sfObjects.objectFields[objectAPIName]) { + return; + } + Util.logger.info( + Util.getGrayMsg( + ' - Caching Fields for Salesforce Object ' + objectAPIName + ) + ); + + const referenceObjectsFieldsResponse = await this.client.rest.get( + `/legacy/v1/beta/integration/member/salesforce/object/${objectAPIName}` + ); + if (referenceObjectsFieldsResponse?.sfobjectfields?.length) { + Util.logger.debug( + `Found ${referenceObjectsFieldsResponse?.sfobjectfields?.length} fields for Salesforce Object ${objectAPIName}` + ); + this.sfObjects.objectFields[objectAPIName] = {}; + for (const field of referenceObjectsFieldsResponse.sfobjectfields) { + this.sfObjects.objectFields[objectAPIName][field.name] = field; + } + } else { + Util.logger.debug( + `Could not find any fields for Salesforce Object ${objectAPIName}` + ); + throw new Error( + `Could not find any fields for Salesforce Object ${objectAPIName}` + ); + } + return; + }) + ) + ); + + // 4 create Common fields + const contactLeadName = 'Contacts and Leads'; + if ( + this.sfObjects.objectFields['Contact'] && + this.sfObjects.objectFields['Lead'] && + !this.sfObjects.workflowObjects.includes(contactLeadName) + ) { + Util.logger.info( + Util.getGrayMsg(' - Constructing Common / Contacts and Leads object') + ); + // add fake entry to workflowObjects to allow testing for this easily + this.sfObjects.workflowObjects.push(contactLeadName); + + // construct fields object for it + this.sfObjects.objectFields[contactLeadName] = {}; + const contactFieldNames = Object.keys(this.sfObjects.objectFields['Contact']); + const leadFieldNames = Object.keys(this.sfObjects.objectFields['Lead']); + for (const fieldName of contactFieldNames.filter((item) => + leadFieldNames.includes(item) + )) { + // copy the value from contact - while thats not perfectly correct it will hopefully be sufficient for what we need to check + this.sfObjects.objectFields[contactLeadName][fieldName] = + this.sfObjects.objectFields['Contact'][fieldName]; + this.sfObjects.objectFields[contactLeadName][fieldName].objectname = 'Common'; + + // delete the field from Contact obj and from Lead obj + delete this.sfObjects.objectFields['Contact'][fieldName]; + delete this.sfObjects.objectFields['Lead'][fieldName]; + } + } + } + } + + static defaultSalesforceFields = [ + 'Id', + 'Name', + 'FirstName', + 'LastName', + 'Phone', + 'CreatedById', + 'CreatedDate', + 'IsDeleted', + 'LastModifiedById', + 'LastModifiedDate', + 'SystemModstamp', + ]; + + /** + * + * @param {any} ca trigger[0].configurationArguments + */ + static checkSalesforceEntryEvents(ca) { + // check eventDataConfig + const objects = ca.eventDataConfig.objects; + const errors = []; + for (const object of objects) { + // if it has no value this is the entry-source object itself + const referencedObject = + object.referenceObject === '' ? ca.objectAPIName : object.referenceObject; + // check if object was cached earlier + if (!this.sfObjects.workflowObjects.includes(referencedObject)) { + errors.push(`Salesforce object ${referencedObject} not found on connected org.`); + } else if ( + !this.sfObjects.objectFields[referencedObject] || + !Object.keys(this.sfObjects.objectFields[referencedObject]).length + ) { + // check if we found fields for the object + errors.push( + `No fields found for Salesforce object ${referencedObject} on connected org.` + ); + } else { + // check if the fields selected in the eventDefinition are actually available + for (const fieldName of object.fields) { + if ( + !this.sfObjects.objectFields[referencedObject][fieldName] && + !this.defaultSalesforceFields.includes(fieldName) + ) { + if ( + (referencedObject === 'Contact' || referencedObject === 'Lead') && + this.sfObjects.objectFields['Contacts and Leads'][fieldName] + ) { + errors.push( + `Salesforce object field ${referencedObject}.${fieldName} needs to be referenced as Common.${fieldName}` + ); + continue; + } + errors.push( + `Salesforce object field ${referencedObject}.${fieldName} not available on connected org.` + ); + } + } + } + } + if (errors?.length) { + // add a line break + errors.unshift(``); + throw new Error(errors.join('\n - ')); // eslint-disable-line unicorn/error-message + } + } + + /** + * + * @param {string} triggerType e.g. SalesforceObjectTriggerV2, APIEvent, ... + * @param {any} ca trigger[0].configurationArguments + * @returns {Promise.} - + */ + static async postRetrieveTasks_SalesforceEntryEvents(triggerType, ca) { + if (triggerType !== 'SalesforceObjectTriggerV2' || !ca) { + return; + } + // normalize payload because these fields are sometimes set as strings and sometimes as objects + ca.contactKey = + 'string' === typeof ca.contactKey ? JSON.parse(ca.contactKey) : ca.contactKey; + ca.eventDataConfig = + 'string' === typeof ca.eventDataConfig + ? JSON.parse(ca.eventDataConfig) + : ca.eventDataConfig; + ca.eventDataSummary = + 'string' === typeof ca.eventDataSummary + ? ca.eventDataSummary.split('; ').filter(Boolean) + : ca.eventDataSummary; + ca.passThroughArgument = + 'string' === typeof ca.passThroughArgument + ? JSON.parse(ca.passThroughArgument) + : ca.passThroughArgument; + ca.primaryObjectFilterCriteria = + 'string' === typeof ca.primaryObjectFilterCriteria + ? JSON.parse(ca.primaryObjectFilterCriteria) + : ca.primaryObjectFilterCriteria; + ca.relatedObjectFilterCriteria = + 'string' === typeof ca.relatedObjectFilterCriteria + ? JSON.parse(ca.relatedObjectFilterCriteria) + : ca.relatedObjectFilterCriteria; + + if (ca.objectApiName) { + // on event only the uppercase version is used. lets make sure we normalize that here. + ca.objectAPIName = ca.objectApiName; + delete ca.objectApiName; + } + + // get info about salesforce objects if not already cached + // * SF product team actually sometimes sets this field with uppercase "API" and sometimes with "Api"... Great job, guys! + await this.getSalesforceObjects(ca.objectAPIName); + + // check if whats on the journey matches what SF Core offers + this.checkSalesforceEntryEvents(ca); + } + + /** + * + * @param {string} triggerType e.g. SalesforceObjectTriggerV2, APIEvent, ... + * @param {any} ca trigger[0].configurationArguments + * @returns {Promise.} - + */ + static async preDeployTasks_SalesforceEntryEvents(triggerType, ca) { + if (triggerType !== 'SalesforceObjectTriggerV2' || !ca) { + return; + } + // normalize payload because these fields are sometimes set as strings and sometimes as objects + ca.contactKey = + 'object' === typeof ca.contactKey ? JSON.stringify(ca.contactKey) : ca.contactKey; + ca.eventDataConfig = + 'object' === typeof ca.eventDataConfig + ? JSON.stringify(ca.eventDataConfig) + : ca.eventDataConfig; + ca.eventDataSummary = + 'object' === typeof ca.eventDataSummary + ? ca.eventDataSummary.join('; ') + '; ' + : ca.eventDataSummary; + ca.passThroughArgument = + 'object' === typeof ca.passThroughArgument + ? JSON.stringify(ca.passThroughArgument) + : ca.passThroughArgument; + ca.primaryObjectFilterCriteria = + 'object' === typeof ca.primaryObjectFilterCriteria + ? JSON.stringify(ca.primaryObjectFilterCriteria) + : ca.primaryObjectFilterCriteria; + ca.relatedObjectFilterCriteria = + 'object' === typeof ca.relatedObjectFilterCriteria + ? JSON.stringify(ca.relatedObjectFilterCriteria) + : ca.relatedObjectFilterCriteria; + + if (ca.objectApiName) { + // on event only the uppercase version is used. lets make sure we normalize that here. + ca.objectAPIName = ca.objectApiName; + delete ca.objectApiName; + } + + // get info about salesforce objects if not already cached + await this.getSalesforceObjects(ca.objectAPIName); + + // check if whats on the journey matches what SF Core offers + this.checkSalesforceEntryEvents(ca); + } } // Assign definition to static attributes diff --git a/lib/metadataTypes/Journey.js b/lib/metadataTypes/Journey.js index c5acd93a9..55d9f88c6 100644 --- a/lib/metadataTypes/Journey.js +++ b/lib/metadataTypes/Journey.js @@ -2,6 +2,7 @@ import MetadataType from './MetadataType.js'; import TransactionalEmail from './TransactionalEmail.js'; +import Event from './Event.js'; import { Util } from '../util/util.js'; import cache from '../util/cache.js'; import File from '../util/file.js'; @@ -341,12 +342,11 @@ class Journey extends MetadataType { /** * manages post retrieve steps - * ! BETA RELEASE of journey support (v4.3.0); it so far only resolves a limited amount of dependencies and will likely break during cross-BU deployments! * * @param {MetadataTypeItem} metadata a single item - * @returns {MetadataTypeItem} Array with one metadata object + * @returns {Promise.} Array with one metadata object */ - static postRetrieveTasks(metadata) { + static async postRetrieveTasks(metadata) { // folder super.setFolderPath(metadata); @@ -407,6 +407,16 @@ class Journey extends MetadataType { } } } + try { + await Event.postRetrieveTasks_SalesforceEntryEvents( + metadata.triggers[0].type, + metadata.triggers[0].configurationArguments + ); + } catch (ex) { + Util.logger.error( + ` - ${this.definition.type} '${metadata[this.definition.nameField]}' (${metadata[this.definition.keyField]}): ${ex.message}` + ); + } } // ~~~ ACTIVITIES ~~~~ @@ -577,6 +587,15 @@ class Journey extends MetadataType { ); } } + if ( + configurationArguments?.triggeredSend && + 'string' === typeof configurationArguments?.triggeredSend + ) { + // sometimes, the API returns this object as a string for unknown reasons. Good job, product team! + configurationArguments.triggeredSend = JSON.parse( + configurationArguments?.triggeredSend + ); + } const triggeredSend = configurationArguments?.triggeredSend; if (triggeredSend) { // this section is likely only relevant for QuickSends and not for Multi-Step Journeys @@ -999,6 +1018,10 @@ class Journey extends MetadataType { delete config.r__dataExtension_key; } } + Event.preDeployTasks_SalesforceEntryEvents( + metadata.triggers[0].type, + metadata.triggers[0].configurationArguments + ); } // transactionalEmail / definitionType==='Transactional' && channel==='email' && triggers[].type === 'transactional-api' @@ -1007,13 +1030,6 @@ class Journey extends MetadataType { this._preDeployTasks_activities(metadata); - // TODO: Filters / activities[].type === 'MULTICRITERIADECISION' - // - activities[].arguments.filterResult - // - activities[].arguments.configurationArguments.criteria - - // TODO: wait activity / activities[].type === 'WAIT' - - // TODO: journey template id? / metaData.templateId break; } case 'Transactional': { diff --git a/lib/metadataTypes/MetadataType.js b/lib/metadataTypes/MetadataType.js index 8e29c33ca..9660706c1 100644 --- a/lib/metadataTypes/MetadataType.js +++ b/lib/metadataTypes/MetadataType.js @@ -1899,9 +1899,10 @@ class MetadataType { templateVariables ); } catch (ex) { + Util.logger.debug(JSON.stringify(savedResults[originalKey])); Util.logger.errorStack( ex, - ` - Saving ${this.definition.type} ${originalKey} failed` + ` - Saving ${this.definition.type} ${originalKey} / ${results[originalKey][this.definition.nameField]} failed` ); } } From 4bccdf443f4d3ed274f07d142e0c4e9c537cf59d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 14 Aug 2024 18:25:18 +0200 Subject: [PATCH 02/43] #1570: cleanup & jsdocs --- eslint.config.js | 2 +- lib/metadataTypes/Journey.js | 2 +- types/mcdev.d.js | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 2 deletions(-) diff --git a/eslint.config.js b/eslint.config.js index 8ef11a049..953858109 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -108,7 +108,7 @@ export default [ }, ], - 'jsdoc/no-undefined-types': 'error', + 'jsdoc/no-undefined-types': 'off', 'jsdoc/valid-types': 'off', 'spaced-comment': [ diff --git a/lib/metadataTypes/Journey.js b/lib/metadataTypes/Journey.js index 55d9f88c6..83aed7d6e 100644 --- a/lib/metadataTypes/Journey.js +++ b/lib/metadataTypes/Journey.js @@ -413,7 +413,7 @@ class Journey extends MetadataType { metadata.triggers[0].configurationArguments ); } catch (ex) { - Util.logger.error( + Util.logger.warn( ` - ${this.definition.type} '${metadata[this.definition.nameField]}' (${metadata[this.definition.keyField]}): ${ex.message}` ); } diff --git a/types/mcdev.d.js b/types/mcdev.d.js index 4ba301b98..0448f673e 100644 --- a/types/mcdev.d.js +++ b/types/mcdev.d.js @@ -523,4 +523,39 @@ complex * @typedef {Object.} ListIdMap key=id * @typedef {Object.} ListMap key=customer key */ + +/** + * @typedef {object} ReferenceObject returned by /data/v1/integration/member/salesforce/object//referenceobjects + * @property {string} displayname label + * @property {string} referenceObjectName api name of salesforce object + * @property {string} relationshipName name of lookup/MD field on related object ending on __r (way to return fields from other object) + * @property {string} relationshipIdName name of lookup/MD field on related object ending on __c (returning id) + * @property {boolean} isPolymorphic if this lookup can point to multiple objects or not + * + * @typedef {object} SfObjectPicklist returned by /legacy/v1/beta/integration/member/salesforce/object/ + * @property {boolean} active - + * @property {boolean} defaultValue - + * @property {string} label what you see in the GUI + * @property {string} value whats stored in the DB + * + * @typedef {object} SfObjectField returned by /legacy/v1/beta/integration/member/salesforce/object/ + * @property {string} label "Annual Revenue" + * @property {string} name "AnnualRevenue" + * @property {'currency'|'string'|'int'|'picklist'|'textarea'|'boolean'|'date'|'datetime'|'email'} datatype type + * @property {number} length 0-4000 + * @property {boolean} nillable == not required + * @property {boolean} custom is it a custom field + * @property {boolean} updateable always true? + * @property {boolean} createable always true? + * @property {boolean} defaultedoncreate - + * @property {boolean} externalid - + * @property {boolean} idlookup - + * @property {number} precision - + * @property {number} scale - + * @property {'Currency'|'Text'|'Number'|'Picklist'|'Text Area (long)'|'Checkbox'|'Date'|'Date/Time'|'Email'} displaydatatype "Currency" + * @property {string} objectname "Lead", + * @property {string} relationname "", + * @property {boolean} isnamefield - + * @property {SfObjectPicklist[]} [picklist] list of values + */ export default {}; From fbd4f3810c06780fea6281b6cf4c77bb3ff2950e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 14 Aug 2024 18:26:26 +0200 Subject: [PATCH 03/43] #1570: checks for eventDataSummary and passThroughArgument --- lib/metadataTypes/Event.js | 88 +++++++++++++++++++++++++++++++++++--- 1 file changed, 82 insertions(+), 6 deletions(-) diff --git a/lib/metadataTypes/Event.js b/lib/metadataTypes/Event.js index 4345612e3..46a8d1aa4 100644 --- a/lib/metadataTypes/Event.js +++ b/lib/metadataTypes/Event.js @@ -18,6 +18,9 @@ import pLimit from 'p-limit'; * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + * + * @typedef {import('../../types/mcdev.d.js').ReferenceObject} ReferenceObject + * @typedef {import('../../types/mcdev.d.js').SfObjectField} SfObjectField */ /** @@ -451,13 +454,16 @@ class Event extends MetadataType { return metadata; } static sfObjects = { + /** @type {string[]} */ workflowObjects: null, + /** @type {Object.} object-name > object data */ referencedObjects: {}, + /** @type {Object.>} object-name > field-name > field data */ objectFields: {}, }; /** - * helper for {@link this.checkSalesforceEntryEvents} that retrieves information about SF object fields + * helper for {@link checkSalesforceEntryEvents} that retrieves information about SF object fields * * @param {string} objectAPIName salesforce object api name */ @@ -583,6 +589,9 @@ class Event extends MetadataType { delete this.sfObjects.objectFields['Contact'][fieldName]; delete this.sfObjects.objectFields['Lead'][fieldName]; } + // create duplicate to also reference this via "Common" + this.sfObjects.objectFields['Common'] = + this.sfObjects.objectFields[contactLeadName]; } } } @@ -606,10 +615,18 @@ class Event extends MetadataType { * @param {any} ca trigger[0].configurationArguments */ static checkSalesforceEntryEvents(ca) { - // check eventDataConfig - const objects = ca.eventDataConfig.objects; + // 1 check eventDataConfig + const edcObjects = ca.eventDataConfig.objects; const errors = []; - for (const object of objects) { + const dePrefixFields = {}; + const dePrefixRelationshipMap = {}; + const dePrefixCommon = ca.objectAPIName + ':Common'; + for (const object of edcObjects) { + // create secondary object to quickly check eventDataSummary against + dePrefixFields[object.dePrefix] = object.fields; + dePrefixRelationshipMap[object.dePrefix] = object.relationshipName; + + // 1.1 check if fields in eventDataConfig exist in Salesforce // if it has no value this is the entry-source object itself const referencedObject = object.referenceObject === '' ? ca.objectAPIName : object.referenceObject; @@ -638,15 +655,74 @@ class Event extends MetadataType { errors.push( `Salesforce object field ${referencedObject}.${fieldName} needs to be referenced as Common.${fieldName}` ); - continue; + } else { + errors.push( + `Salesforce object field ${referencedObject}.${fieldName} not available on connected org.` + ); } + } + // 1.2 check if all fields in eventDataConfig are listed in the eventDataSummary + if (!ca.eventDataSummary.includes(object.dePrefix + fieldName)) { errors.push( - `Salesforce object field ${referencedObject}.${fieldName} not available on connected org.` + `Field ${object.dePrefix + fieldName} is listed under eventDataConfig for referenceObject ${object.referenceObject} but not in eventDataSummary` ); } } } } + + // 2 compare eventDataConfig with eventDataSummary + // check if all fields in eventDataSummary are listed in the eventDataConfig + + for (let fieldName of ca.eventDataSummary) { + const fieldPath = fieldName.split(':'); + fieldName = fieldPath.pop(); + const dePrefix = fieldPath.join(':') + ':'; + if (!dePrefixFields[dePrefix].includes(fieldName)) { + errors.push( + `Field ${dePrefix + fieldName} is listed under eventDataSummary but not in eventDataConfig` + ); + } + } + + // 3 check contactKey + // TODO + + // 4 check passThroughArgument + for (const key of Object.keys(ca.passThroughArgument.fields)) { + const fieldPath = ca.passThroughArgument.fields[key].split(':'); + const fieldName = fieldPath.pop(); + const dePrefix = fieldPath.join(':') + ':'; + // it seems these fields do NOT need to be in the eventDataConfig + const relationshipName = dePrefixRelationshipMap[dePrefix]; + if ( + !this.sfObjects.objectFields[relationshipName][fieldName] && + !this.defaultSalesforceFields.includes(fieldName) + ) { + if ( + (relationshipName === 'Contact' || relationshipName === 'Lead') && + this.sfObjects.objectFields['Contacts and Leads'][fieldName] + ) { + errors.push( + `Field ${dePrefix + fieldName} is listed under passThroughArgument.fields.${key} but needs to be referenced as ${dePrefixCommon}.${fieldName}` + ); + } else { + errors.push( + `Field ${dePrefix + fieldName} is listed under passThroughArgument.fields.${key} but is not available on connected org.` + ); + } + } + } + + // 5 check primaryObjectFilterCriteria + // TODO + + // 6 compare primaryObjectFilterSummary to primaryObjectFilterCriteria + // TODO + + // 7 + + // throw error if problems were found if (errors?.length) { // add a line break errors.unshift(``); From 5d53aa62a18d7e601823d6e73b7413824ff73121 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 14 Aug 2024 18:27:34 +0200 Subject: [PATCH 04/43] #1570: jsdocs --- types/mcdev.d.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/types/mcdev.d.js b/types/mcdev.d.js index 0448f673e..c4fcc493d 100644 --- a/types/mcdev.d.js +++ b/types/mcdev.d.js @@ -537,7 +537,9 @@ complex * @property {boolean} defaultValue - * @property {string} label what you see in the GUI * @property {string} value whats stored in the DB - * + */ + +/** * @typedef {object} SfObjectField returned by /legacy/v1/beta/integration/member/salesforce/object/ * @property {string} label "Annual Revenue" * @property {string} name "AnnualRevenue" From e6ace4e8071c2f4d1b8a8823cf4b44c30adddd5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Mon, 19 Aug 2024 15:47:16 +0200 Subject: [PATCH 05/43] #1570: check contactKey and improve how passThroughArgument is tested --- @types/lib/metadataTypes/Event.d.ts | 22 ++++- @types/lib/metadataTypes/Event.d.ts.map | 2 +- @types/types/mcdev.d.d.ts | 123 ++++++++++++++++++++++++ @types/types/mcdev.d.d.ts.map | 2 +- lib/metadataTypes/Event.js | 54 +++++++++-- 5 files changed, 191 insertions(+), 12 deletions(-) diff --git a/@types/lib/metadataTypes/Event.d.ts b/@types/lib/metadataTypes/Event.d.ts index f9ae2450c..8519f3f98 100644 --- a/@types/lib/metadataTypes/Event.d.ts +++ b/@types/lib/metadataTypes/Event.d.ts @@ -9,6 +9,8 @@ export type MetadataTypeMap = import("../../types/mcdev.d.js").MetadataTypeMap; export type MetadataTypeMapObj = import("../../types/mcdev.d.js").MetadataTypeMapObj; export type SoapRequestParams = import("../../types/mcdev.d.js").SoapRequestParams; export type TemplateMap = import("../../types/mcdev.d.js").TemplateMap; +export type ReferenceObject = import("../../types/mcdev.d.js").ReferenceObject; +export type SfObjectField = import("../../types/mcdev.d.js").SfObjectField; /** * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract @@ -20,6 +22,9 @@ export type TemplateMap = import("../../types/mcdev.d.js").TemplateMap; * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + * + * @typedef {import('../../types/mcdev.d.js').ReferenceObject} ReferenceObject + * @typedef {import('../../types/mcdev.d.js').SfObjectField} SfObjectField */ /** * Event MetadataType @@ -84,12 +89,21 @@ declare class Event extends MetadataType { */ static postRetrieveTasks(metadata: MetadataTypeItem): Promise; static sfObjects: { - workflowObjects: any; - referencedObjects: {}; - objectFields: {}; + /** @type {string[]} */ + workflowObjects: string[]; + /** @type {Object.} object-name > object data */ + referencedObjects: { + [x: string]: ReferenceObject[]; + }; + /** @type {Object.>} object-name > field-name > field data */ + objectFields: { + [x: string]: { + [x: string]: SfObjectField; + }; + }; }; /** - * helper for {@link this.checkSalesforceEntryEvents} that retrieves information about SF object fields + * helper for {@link checkSalesforceEntryEvents} that retrieves information about SF object fields * * @param {string} objectAPIName salesforce object api name */ diff --git a/@types/lib/metadataTypes/Event.d.ts.map b/@types/lib/metadataTypes/Event.d.ts.map index 341421cd4..d4d1dd0a8 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":["../../../l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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAl2BwB,mBAAmB"} \ No newline at end of file diff --git a/@types/types/mcdev.d.d.ts b/@types/types/mcdev.d.d.ts index eb4af78ab..cf16c8e0d 100644 --- a/@types/types/mcdev.d.d.ts +++ b/@types/types/mcdev.d.d.ts @@ -1387,4 +1387,127 @@ export type ListIdMap = { export type ListMap = { [x: string]: ListItem; }; +/** + * returned by /data/v1/integration/member/salesforce/object//referenceobjects + */ +export type ReferenceObject = { + /** + * label + */ + displayname: string; + /** + * api name of salesforce object + */ + referenceObjectName: string; + /** + * name of lookup/MD field on related object ending on __r (way to return fields from other object) + */ + relationshipName: string; + /** + * name of lookup/MD field on related object ending on __c (returning id) + */ + relationshipIdName: string; + /** + * if this lookup can point to multiple objects or not + */ + isPolymorphic: boolean; +}; +/** + * returned by /legacy/v1/beta/integration/member/salesforce/object/ + */ +export type SfObjectPicklist = { + /** + * - + */ + active: boolean; + /** + * - + */ + defaultValue: boolean; + /** + * what you see in the GUI + */ + label: string; + /** + * whats stored in the DB + */ + value: string; +}; +/** + * returned by /legacy/v1/beta/integration/member/salesforce/object/ + */ +export type SfObjectField = { + /** + * "Annual Revenue" + */ + label: string; + /** + * "AnnualRevenue" + */ + name: string; + /** + * type + */ + datatype: "currency" | "string" | "int" | "picklist" | "textarea" | "boolean" | "date" | "datetime" | "email"; + /** + * 0-4000 + */ + length: number; + /** + * == not required + */ + nillable: boolean; + /** + * is it a custom field + */ + custom: boolean; + /** + * always true? + */ + updateable: boolean; + /** + * always true? + */ + createable: boolean; + /** + * - + */ + defaultedoncreate: boolean; + /** + * - + */ + externalid: boolean; + /** + * - + */ + idlookup: boolean; + /** + * - + */ + precision: number; + /** + * - + */ + scale: number; + /** + * "Currency" + */ + displaydatatype: "Currency" | "Text" | "Number" | "Picklist" | "Text Area (long)" | "Checkbox" | "Date" | "Date/Time" | "Email"; + /** + * "Lead", + */ + objectname: string; + /** + * "", + */ + relationname: string; + /** + * - + */ + isnamefield: boolean; + /** + * list of values + */ + picklist?: SfObjectPicklist[]; +}; //# sourceMappingURL=mcdev.d.d.ts.map \ No newline at end of file diff --git a/@types/types/mcdev.d.d.ts.map b/@types/types/mcdev.d.d.ts.map index 1db745f34..b8ab84c08 100644 --- a/@types/types/mcdev.d.d.ts.map +++ b/@types/types/mcdev.d.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"mcdev.d.d.ts","sourceRoot":"","sources":["../../types/mcdev.d.js"],"names":[],"mappings":";;;;;;eAEc,MAAM;;;;mBACN,MAAM;;;;aACN,MAAM;;;;UACN,MAAM;;;;UACN,MAAM;;;;mBACN,MAAM;;;;iBACN,MAAM;;0BAIP;QAAQ,MAAM,GAAE,MAAM;CAAC;qCACvB,OAAO,GAAC,eAAe,GAAC,aAAa,GAAC,aAAa,GAAC,aAAa,GAAC,YAAY,GAAC,gBAAgB,GAAC,aAAa,GAAC,eAAe,GAAC,aAAa,GAAC,gBAAgB,GAAC,gBAAgB,GAAC,gBAAgB,GAAC,aAAa,GAAC,gBAAgB,GAAC,cAAc,GAAC,YAAY,GAAC,UAAU,GAAC,aAAa,GAAC,eAAe,GAAC,oBAAoB,GAAC,uBAAuB,GAAC,aAAa,GAAC,iBAAiB,GAAC,WAAW,GAAC,iBAAiB,GAAC,OAAO,GAAC,WAAW,GAAC,OAAO,GAAC,cAAc,GAAC,cAAc,GAAC,QAAQ,GAAC,QAAQ,GAAC,YAAY,GAAC,SAAS,GAAC,MAAM,GAAC,YAAY,GAAC,eAAe,GAAC,eAAe,GAAC,OAAO,GAAC,MAAM,GAAC,QAAQ,GAAC,oBAAoB,GAAC,eAAe,GAAC,oBAAoB,G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AAU,GAAC,UAAU,GAAC,SAAS,GAAC,MAAM,GAAC,UAAU,GAAC,OAAO;;;;YACnF,MAAM;;;;cACN,OAAO;;;;YACP,OAAO;;;;gBACP,OAAO;;;;gBACP,OAAO;;;;uBACP,OAAO;;;;gBACP,OAAO;;;;cACP,OAAO;;;;eACP,MAAM;;;;WACN,MAAM;;;;qBACN,UAAU,GAAC,MAAM,GAAC,QAAQ,GAAC,UAAU,GAAC,kBAAkB,GAAC,UAAU,GAAC,MAAM,GAAC,WAAW,GAAC,OAAO;;;;gBAC9F,MAAM;;;;kBACN,MAAM;;;;iBACN,OAAO;;;;eACP,gBAAgB,EAAE"} \ No newline at end of file diff --git a/lib/metadataTypes/Event.js b/lib/metadataTypes/Event.js index 46a8d1aa4..956ad4234 100644 --- a/lib/metadataTypes/Event.js +++ b/lib/metadataTypes/Event.js @@ -620,11 +620,13 @@ class Event extends MetadataType { const errors = []; const dePrefixFields = {}; const dePrefixRelationshipMap = {}; + const dePrefixReferenceObjectMap = {}; const dePrefixCommon = ca.objectAPIName + ':Common'; for (const object of edcObjects) { // create secondary object to quickly check eventDataSummary against dePrefixFields[object.dePrefix] = object.fields; dePrefixRelationshipMap[object.dePrefix] = object.relationshipName; + dePrefixReferenceObjectMap[object.dePrefix] = object.referenceObject; // 1.1 check if fields in eventDataConfig exist in Salesforce // if it has no value this is the entry-source object itself @@ -686,7 +688,35 @@ class Event extends MetadataType { } // 3 check contactKey - // TODO + // check against referencedObjects + const referencedContactObj = this.sfObjects.referencedObjects[ca.objectAPIName].find( + (el) => el.relationshipName === ca.contactKey.relationshipName + ); + if (referencedContactObj) { + if (referencedContactObj.isPolymorphic !== ca.contactKey.isPolymorphic) { + errors.push( + `configurationArguments.contactKey states an incorrect isPolimorphic value. Should be ${referencedContactObj.isPolymorphic}` + ); + } + if (referencedContactObj.referenceObjectName !== ca.contactKey.referenceObjectName) { + errors.push( + `configurationArguments.contactKey states an incorrect referenceObjectName value. Should be ${referencedContactObj.referenceObjectName}` + ); + } + if ( + !this.sfObjects.objectFields[ca.contactKey.referenceObjectName][ + ca.contactKey.fieldName + ] + ) { + errors.push( + `configurationArguments.contactKey states the invalid fieldName '${ca.contactKey.fieldName}' value that does not exist on ${ca.contactKey.referenceObjectName}` + ); + } + } else { + errors.push( + `configurationArguments.contactKey references ${ca.contactKey.relationshipName} which is not found in related salesforce objects` + ); + } // 4 check passThroughArgument for (const key of Object.keys(ca.passThroughArgument.fields)) { @@ -695,20 +725,32 @@ class Event extends MetadataType { const dePrefix = fieldPath.join(':') + ':'; // it seems these fields do NOT need to be in the eventDataConfig const relationshipName = dePrefixRelationshipMap[dePrefix]; + let referenceObject = dePrefixReferenceObjectMap[dePrefix]; + if ( + relationshipName !== 'Contact' && + referenceObject === 'Contact' && + !this.sfObjects.objectFields[referenceObject][fieldName] + ) { + // basically, when we link to Contact indirectly through other fields then the whole "common" thing does not apply but we still moved the fields to common + referenceObject = 'Common'; + } if ( - !this.sfObjects.objectFields[relationshipName][fieldName] && - !this.defaultSalesforceFields.includes(fieldName) + !this.sfObjects.objectFields[referenceObject][fieldName] && + !this.defaultSalesforceFields.includes(fieldName) && + relationshipName !== 'Contact' && + referenceObject === 'Contact' && + !this.sfObjects.objectFields['Common'][fieldName] ) { if ( (relationshipName === 'Contact' || relationshipName === 'Lead') && - this.sfObjects.objectFields['Contacts and Leads'][fieldName] + this.sfObjects.objectFields['Common'][fieldName] ) { errors.push( - `Field ${dePrefix + fieldName} is listed under passThroughArgument.fields.${key} but needs to be referenced as ${dePrefixCommon}.${fieldName}` + `(${referenceObject})(${relationshipName}) Field ${dePrefix + fieldName} is listed under passThroughArgument.fields.${key} but needs to be referenced as ${dePrefixCommon}.${fieldName}` ); } else { errors.push( - `Field ${dePrefix + fieldName} is listed under passThroughArgument.fields.${key} but is not available on connected org.` + `(${referenceObject})(${relationshipName}) Field ${dePrefix + fieldName} is listed under passThroughArgument.fields.${key} but is not available on connected org.` ); } } From d15972e6e6bf9752667d91c8d93ffbac65c92ecd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Mon, 19 Aug 2024 19:20:36 +0200 Subject: [PATCH 06/43] #1570: code comments --- lib/metadataTypes/Event.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/metadataTypes/Event.js b/lib/metadataTypes/Event.js index 956ad4234..982fcdbf5 100644 --- a/lib/metadataTypes/Event.js +++ b/lib/metadataTypes/Event.js @@ -473,6 +473,7 @@ class Event extends MetadataType { } // 1 get all available Salesforce objects + // similar response to /jbint/getWorkflowObjects if (!this.sfObjects.workflowObjects) { Util.logger.info(Util.getGrayMsg(' - Caching Salesforce Objects')); const workflowObjectsResponse = await this.client.rest.get( @@ -488,6 +489,7 @@ class Event extends MetadataType { } // 2 get objects related to the selected object + // same response as /jbint/getRelatedObjects?type= if (!this.sfObjects.referencedObjects?.[objectAPIName]) { Util.logger.info( Util.getGrayMsg(' - Caching Related Salesforce Objects for ' + objectAPIName) From b4027753d2f982aee68bd39d4fd73e7a63beda6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 23 Aug 2024 12:48:24 +0200 Subject: [PATCH 07/43] npm audit fix --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index f23c13d57..c755e627b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1399,9 +1399,9 @@ } }, "node_modules/axios": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.2.tgz", - "integrity": "sha512-2A8QhOMrbomlDuiLeK9XibIBzuHeRcqqNOHp0Cyp5EoJ1IFDh+XZH3A6BkXtv0K4gFGCI0Y4BM7B1wOEi0Rmgw==", + "version": "1.7.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.4.tgz", + "integrity": "sha512-DukmaFRnY6AzAALSH4J2M3k6PkaC+MfaAGdEERRWcC9q3/TWQwLpHR8ZRLKTdQ3aBDL64EdluRDjJqKw+BPZEw==", "dependencies": { "follow-redirects": "^1.15.6", "form-data": "^4.0.0", From 35b27d2a5821ba2e5c2a8642c016732a98c3b9d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 23 Aug 2024 17:58:35 +0200 Subject: [PATCH 08/43] #1599: ensure required fields are send to API --- .../definitions/Event.definition.js | 184 +++++++++--------- .../definitions/Journey.definition.js | 1 + 2 files changed, 93 insertions(+), 92 deletions(-) diff --git a/lib/metadataTypes/definitions/Event.definition.js b/lib/metadataTypes/definitions/Event.definition.js index b5fde2bfb..e505e07db 100644 --- a/lib/metadataTypes/definitions/Event.definition.js +++ b/lib/metadataTypes/definitions/Event.definition.js @@ -275,8 +275,8 @@ export default { template: true, }, 'configurationArguments.salesforceTriggerCriteria': { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, template: true, }, @@ -389,33 +389,33 @@ export default { template: true, }, 'metaData.automationData.automationType': { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, - template: false, + template: true, }, 'metaData.automationData.categoryId': { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, - template: false, + template: true, }, 'metaData.automationData.createdBy.email': { isCreateable: false, isUpdateable: false, - retrieving: true, + retrieving: false, template: false, }, 'metaData.automationData.createdBy.id': { isCreateable: false, isUpdateable: false, - retrieving: true, + retrieving: false, template: false, }, 'metaData.automationData.createdBy.name': { isCreateable: false, isUpdateable: false, - retrieving: true, + retrieving: false, template: false, }, 'metaData.automationData.createdDate': { @@ -425,34 +425,34 @@ export default { template: false, }, 'metaData.automationData.description': { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, - template: false, + template: true, }, 'metaData.automationData.folderPath': { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, - template: false, + template: true, }, 'metaData.automationData.guidId': { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, - template: false, + template: true, }, 'metaData.automationData.id': { isCreateable: true, isUpdateable: true, - retrieving: false, + retrieving: true, template: true, }, 'metaData.automationData.isPlatformObject': { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, - template: false, + template: true, }, 'metaData.automationData.key': { isCreateable: true, @@ -481,13 +481,13 @@ export default { 'metaData.automationData.lastSavedBy.email': { isCreateable: false, isUpdateable: false, - retrieving: true, + retrieving: false, template: false, }, 'metaData.automationData.lastSavedBy.id': { isCreateable: false, isUpdateable: false, - retrieving: true, + retrieving: false, template: false, }, 'metaData.automationData.lastSavedBy.name': { @@ -497,8 +497,8 @@ export default { template: false, }, 'metaData.automationData.memberId': { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, template: false, }, @@ -509,28 +509,28 @@ export default { template: false, }, 'metaData.automationData.name': { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, - template: false, + template: true, }, 'metaData.automationData.notifications': { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, - template: false, + template: true, }, 'metaData.automationData.processes': { - isCreateable: false, - isUpdateable: false, - retrieving: false, - template: false, + isCreateable: true, + isUpdateable: true, + retrieving: true, + template: true, }, 'metaData.automationData.schedule': { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, - template: false, + template: true, }, 'metaData.automationData.scheduleObject.createdBy': { isCreateable: false, @@ -545,16 +545,16 @@ export default { template: false, }, 'metaData.automationData.scheduleObject.description': { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, - template: false, + template: true, }, 'metaData.automationData.scheduleObject.iCalRecur': { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, - template: false, + template: true, }, 'metaData.automationData.scheduleObject.id': { isCreateable: false, @@ -581,46 +581,46 @@ export default { template: false, }, 'metaData.automationData.scheduleObject.name': { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, - template: false, + template: true, }, 'metaData.automationData.scheduleObject.scheduleState': { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, - template: false, + template: true, }, 'metaData.automationData.scheduleObject.scheduleStatus': { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, - template: false, + template: true, }, 'metaData.automationData.scheduleObject.startDate': { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, - template: false, + template: true, }, 'metaData.automationData.scheduleObject.timeZone': { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, - template: false, + template: true, }, 'metaData.automationData.scheduleObject.timeZoneId': { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, - template: false, + template: true, }, 'metaData.automationData.scheduledTime': { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, - template: false, + template: true, }, 'metaData.automationData.selectedCategoryId': { isCreateable: false, @@ -635,10 +635,10 @@ export default { template: false, }, 'metaData.automationData.status': { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, - template: false, + template: true, }, 'metaData.automationData.updateInProgress': { isCreateable: false, @@ -833,46 +833,46 @@ export default { template: true, }, 'schedule.monday': { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, - template: false, + template: true, }, 'schedule.tuesday': { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, - template: false, + template: true, }, 'schedule.wednesday': { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, - template: false, + template: true, }, 'schedule.thursday': { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, - template: false, + template: true, }, 'schedule.friday': { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, - template: false, + template: true, }, 'schedule.saturday': { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, - template: false, + template: true, }, 'schedule.sunday': { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, - template: false, + template: true, }, 'schema.fields': { isCreateable: true, diff --git a/lib/metadataTypes/definitions/Journey.definition.js b/lib/metadataTypes/definitions/Journey.definition.js index da9563223..9be461455 100644 --- a/lib/metadataTypes/definitions/Journey.definition.js +++ b/lib/metadataTypes/definitions/Journey.definition.js @@ -294,6 +294,7 @@ export default { isCreateable: false, isUpdateable: false, retrieving: true, + /* dont include in templates, we rather want this to be re-created from the journey */ template: false, }, 'activities[].configurationArguments.triggeredSend.senderProfileId': { From 3cabe0c57a2b3c48bd46a514b16e24a654ce8f82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Mon, 26 Aug 2024 09:38:27 +0200 Subject: [PATCH 09/43] #1570: disable SF fields check until we have documentation for using the the proper API --- @types/lib/metadataTypes/Event.d.ts | 4 +- @types/lib/metadataTypes/Event.d.ts.map | 2 +- @types/lib/metadataTypes/Journey.d.ts.map | 2 +- lib/metadataTypes/Event.js | 210 +++++++++++----------- 4 files changed, 110 insertions(+), 108 deletions(-) diff --git a/@types/lib/metadataTypes/Event.d.ts b/@types/lib/metadataTypes/Event.d.ts index 8519f3f98..6c98dbd5f 100644 --- a/@types/lib/metadataTypes/Event.d.ts +++ b/@types/lib/metadataTypes/Event.d.ts @@ -114,13 +114,15 @@ declare class Event extends MetadataType { * @param {any} ca trigger[0].configurationArguments */ static checkSalesforceEntryEvents(ca: any): void; + static requiredConfigurationArguments: string[]; /** * * @param {string} triggerType e.g. SalesforceObjectTriggerV2, APIEvent, ... * @param {any} ca trigger[0].configurationArguments + * @param {string} key of event / journey * @returns {Promise.} - */ - static postRetrieveTasks_SalesforceEntryEvents(triggerType: string, ca: any): Promise; + static postRetrieveTasks_SalesforceEntryEvents(triggerType: string, ca: any, key: string): Promise; /** * * @param {string} triggerType e.g. SalesforceObjectTriggerV2, APIEvent, ... diff --git a/@types/lib/metadataTypes/Event.d.ts.map b/@types/lib/metadataTypes/Event.d.ts.map index c79cda03b..b2b352479 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;AAb3D;;;;;;;;;;;;;;GAcG;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;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA73BwB,mBAAmB"} \ No newline at end of file diff --git a/@types/lib/metadataTypes/Journey.d.ts.map b/@types/lib/metadataTypes/Journey.d.ts.map index e31d4bf10..2d6f190d9 100644 --- a/@types/lib/metadataTypes/Journey.d.ts.map +++ b/@types/lib/metadataTypes/Journey.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Journey.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/Journey.js"],"names":[],"mappings":";uBAYa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA9zDwB,mBAAmB"} \ No newline at end of file diff --git a/lib/metadataTypes/Event.js b/lib/metadataTypes/Event.js index 982fcdbf5..c50acd696 100644 --- a/lib/metadataTypes/Event.js +++ b/lib/metadataTypes/Event.js @@ -5,7 +5,7 @@ import { Util } from '../util/util.js'; import File from '../util/file.js'; import cache from '../util/cache.js'; import deepEqual from 'deep-equal'; -import pLimit from 'p-limit'; +// import pLimit from 'p-limit'; /** * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject @@ -516,85 +516,85 @@ class Event extends MetadataType { } // 3 get fields - const rateLimit = pLimit(20); - const uniqueSfObjectNames = this.sfObjects.referencedObjects[objectAPIName] - ? [ - ...new Set( - Object.values(this.sfObjects.referencedObjects[objectAPIName]) - .map((el) => el.referenceObjectName) - .sort() - ), - ] - : []; - await Promise.all( - uniqueSfObjectNames.map((objectAPIName) => - rateLimit(async () => { - if (this.sfObjects.objectFields[objectAPIName]) { - return; - } - Util.logger.info( - Util.getGrayMsg( - ' - Caching Fields for Salesforce Object ' + objectAPIName - ) - ); - - const referenceObjectsFieldsResponse = await this.client.rest.get( - `/legacy/v1/beta/integration/member/salesforce/object/${objectAPIName}` - ); - if (referenceObjectsFieldsResponse?.sfobjectfields?.length) { - Util.logger.debug( - `Found ${referenceObjectsFieldsResponse?.sfobjectfields?.length} fields for Salesforce Object ${objectAPIName}` - ); - this.sfObjects.objectFields[objectAPIName] = {}; - for (const field of referenceObjectsFieldsResponse.sfobjectfields) { - this.sfObjects.objectFields[objectAPIName][field.name] = field; - } - } else { - Util.logger.debug( - `Could not find any fields for Salesforce Object ${objectAPIName}` - ); - throw new Error( - `Could not find any fields for Salesforce Object ${objectAPIName}` - ); - } - return; - }) - ) - ); - - // 4 create Common fields - const contactLeadName = 'Contacts and Leads'; - if ( - this.sfObjects.objectFields['Contact'] && - this.sfObjects.objectFields['Lead'] && - !this.sfObjects.workflowObjects.includes(contactLeadName) - ) { - Util.logger.info( - Util.getGrayMsg(' - Constructing Common / Contacts and Leads object') - ); - // add fake entry to workflowObjects to allow testing for this easily - this.sfObjects.workflowObjects.push(contactLeadName); - - // construct fields object for it - this.sfObjects.objectFields[contactLeadName] = {}; - const contactFieldNames = Object.keys(this.sfObjects.objectFields['Contact']); - const leadFieldNames = Object.keys(this.sfObjects.objectFields['Lead']); - for (const fieldName of contactFieldNames.filter((item) => - leadFieldNames.includes(item) - )) { - // copy the value from contact - while thats not perfectly correct it will hopefully be sufficient for what we need to check - this.sfObjects.objectFields[contactLeadName][fieldName] = - this.sfObjects.objectFields['Contact'][fieldName]; - this.sfObjects.objectFields[contactLeadName][fieldName].objectname = 'Common'; - - // delete the field from Contact obj and from Lead obj - delete this.sfObjects.objectFields['Contact'][fieldName]; - delete this.sfObjects.objectFields['Lead'][fieldName]; - } - // create duplicate to also reference this via "Common" - this.sfObjects.objectFields['Common'] = - this.sfObjects.objectFields[contactLeadName]; - } + // const rateLimit = pLimit(20); + // const uniqueSfObjectNames = this.sfObjects.referencedObjects[objectAPIName] + // ? [ + // ...new Set( + // Object.values(this.sfObjects.referencedObjects[objectAPIName]) + // .map((el) => el.referenceObjectName) + // .sort() + // ), + // ] + // : []; + // await Promise.all( + // uniqueSfObjectNames.map((objectAPIName) => + // rateLimit(async () => { + // if (this.sfObjects.objectFields[objectAPIName]) { + // return; + // } + // Util.logger.info( + // Util.getGrayMsg( + // ' - Caching Fields for Salesforce Object ' + objectAPIName + // ) + // ); + + // const referenceObjectsFieldsResponse = await this.client.rest.get( + // `/legacy/v1/beta/integration/member/salesforce/object/${objectAPIName}` + // ); + // if (referenceObjectsFieldsResponse?.sfobjectfields?.length) { + // Util.logger.debug( + // `Found ${referenceObjectsFieldsResponse?.sfobjectfields?.length} fields for Salesforce Object ${objectAPIName}` + // ); + // this.sfObjects.objectFields[objectAPIName] = {}; + // for (const field of referenceObjectsFieldsResponse.sfobjectfields) { + // this.sfObjects.objectFields[objectAPIName][field.name] = field; + // } + // } else { + // Util.logger.debug( + // `Could not find any fields for Salesforce Object ${objectAPIName}` + // ); + // throw new Error( + // `Could not find any fields for Salesforce Object ${objectAPIName}` + // ); + // } + // return; + // }) + // ) + // ); + + // // 4 create Common fields + // const contactLeadName = 'Contacts and Leads'; + // if ( + // this.sfObjects.objectFields['Contact'] && + // this.sfObjects.objectFields['Lead'] && + // !this.sfObjects.workflowObjects.includes(contactLeadName) + // ) { + // Util.logger.info( + // Util.getGrayMsg(' - Constructing Common / Contacts and Leads object') + // ); + // // add fake entry to workflowObjects to allow testing for this easily + // this.sfObjects.workflowObjects.push(contactLeadName); + + // // construct fields object for it + // this.sfObjects.objectFields[contactLeadName] = {}; + // const contactFieldNames = Object.keys(this.sfObjects.objectFields['Contact']); + // const leadFieldNames = Object.keys(this.sfObjects.objectFields['Lead']); + // for (const fieldName of contactFieldNames.filter((item) => + // leadFieldNames.includes(item) + // )) { + // // copy the value from contact - while thats not perfectly correct it will hopefully be sufficient for what we need to check + // this.sfObjects.objectFields[contactLeadName][fieldName] = + // this.sfObjects.objectFields['Contact'][fieldName]; + // this.sfObjects.objectFields[contactLeadName][fieldName].objectname = 'Common'; + + // // delete the field from Contact obj and from Lead obj + // delete this.sfObjects.objectFields['Contact'][fieldName]; + // delete this.sfObjects.objectFields['Lead'][fieldName]; + // } + // // create duplicate to also reference this via "Common" + // this.sfObjects.objectFields['Common'] = + // this.sfObjects.objectFields[contactLeadName]; + // } } } @@ -647,31 +647,31 @@ class Event extends MetadataType { ); } else { // check if the fields selected in the eventDefinition are actually available - for (const fieldName of object.fields) { - if ( - !this.sfObjects.objectFields[referencedObject][fieldName] && - !this.defaultSalesforceFields.includes(fieldName) - ) { - if ( - (referencedObject === 'Contact' || referencedObject === 'Lead') && - this.sfObjects.objectFields['Contacts and Leads'][fieldName] - ) { - errors.push( - `Salesforce object field ${referencedObject}.${fieldName} needs to be referenced as Common.${fieldName}` - ); - } else { - errors.push( - `Salesforce object field ${referencedObject}.${fieldName} not available on connected org.` - ); - } - } - // 1.2 check if all fields in eventDataConfig are listed in the eventDataSummary - if (!ca.eventDataSummary.includes(object.dePrefix + fieldName)) { - errors.push( - `Field ${object.dePrefix + fieldName} is listed under eventDataConfig for referenceObject ${object.referenceObject} but not in eventDataSummary` - ); - } - } + // for (const fieldName of object.fields) { + // if ( + // !this.sfObjects.objectFields[referencedObject][fieldName] && + // !this.defaultSalesforceFields.includes(fieldName) + // ) { + // if ( + // (referencedObject === 'Contact' || referencedObject === 'Lead') && + // this.sfObjects.objectFields['Contacts and Leads'][fieldName] + // ) { + // errors.push( + // `Salesforce object field ${referencedObject}.${fieldName} needs to be referenced as Common.${fieldName}` + // ); + // } else { + // errors.push( + // `Salesforce object field ${referencedObject}.${fieldName} not available on connected org.` + // ); + // } + // } + // // 1.2 check if all fields in eventDataConfig are listed in the eventDataSummary + // if (!ca.eventDataSummary.includes(object.dePrefix + fieldName)) { + // errors.push( + // `Field ${object.dePrefix + fieldName} is listed under eventDataConfig for referenceObject ${object.referenceObject} but not in eventDataSummary` + // ); + // } + // } } } From 46f8d07731e6b0d7a651a8dfec5c70c76e6f99df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Mon, 26 Aug 2024 09:44:56 +0200 Subject: [PATCH 10/43] #1570: add test for required eventDefinition configuration arguments to event + journey --- lib/metadataTypes/Event.js | 41 +++++++++++++++++++++++++++++------- lib/metadataTypes/Journey.js | 3 ++- 2 files changed, 35 insertions(+), 9 deletions(-) diff --git a/lib/metadataTypes/Event.js b/lib/metadataTypes/Event.js index c50acd696..5b94a7946 100644 --- a/lib/metadataTypes/Event.js +++ b/lib/metadataTypes/Event.js @@ -443,7 +443,8 @@ class Event extends MetadataType { try { await this.postRetrieveTasks_SalesforceEntryEvents( metadata.type, - metadata.configurationArguments + metadata.configurationArguments, + metadata.eventDefinitionKey ); } catch (ex) { Util.logger.warn( @@ -774,16 +775,46 @@ class Event extends MetadataType { } } + static requiredConfigurationArguments = [ + 'applicationExtensionKey', + 'contactKey', + 'contactPersonType', + 'eventDataConfig', + 'objectAPIName', + 'passThroughArgument', + 'primaryObjectFilterCriteria', + 'relatedObjectFilterCriteria', + 'salesforceTriggerCriteria', + 'version', + 'whoToInject', + ]; /** * * @param {string} triggerType e.g. SalesforceObjectTriggerV2, APIEvent, ... * @param {any} ca trigger[0].configurationArguments + * @param {string} key of event / journey * @returns {Promise.} - */ - static async postRetrieveTasks_SalesforceEntryEvents(triggerType, ca) { + static async postRetrieveTasks_SalesforceEntryEvents(triggerType, ca, key) { if (triggerType !== 'SalesforceObjectTriggerV2' || !ca) { return; } + // normalize payload because these fields are sometimes set as strings and sometimes as objects + if (ca.objectApiName) { + // on event only the uppercase version is used. lets make sure we normalize that here. + ca.objectAPIName = ca.objectApiName; + delete ca.objectApiName; + } + + // check if everything important is there or else MC Connect cannot publish this AND other journeys + for (const attribute of this.requiredConfigurationArguments) { + if (!ca[attribute]) { + Util.logger.error( + ` - ${this.definition.type} ${key}: required field configurationArguments.${attribute} not set` + ); + } + } + // normalize payload because these fields are sometimes set as strings and sometimes as objects ca.contactKey = 'string' === typeof ca.contactKey ? JSON.parse(ca.contactKey) : ca.contactKey; @@ -808,12 +839,6 @@ class Event extends MetadataType { ? JSON.parse(ca.relatedObjectFilterCriteria) : ca.relatedObjectFilterCriteria; - if (ca.objectApiName) { - // on event only the uppercase version is used. lets make sure we normalize that here. - ca.objectAPIName = ca.objectApiName; - delete ca.objectApiName; - } - // get info about salesforce objects if not already cached // * SF product team actually sometimes sets this field with uppercase "API" and sometimes with "Api"... Great job, guys! await this.getSalesforceObjects(ca.objectAPIName); diff --git a/lib/metadataTypes/Journey.js b/lib/metadataTypes/Journey.js index b4b88342d..b125f21ff 100644 --- a/lib/metadataTypes/Journey.js +++ b/lib/metadataTypes/Journey.js @@ -411,7 +411,8 @@ class Journey extends MetadataType { try { await Event.postRetrieveTasks_SalesforceEntryEvents( metadata.triggers[0].type, - metadata.triggers[0].configurationArguments + metadata.triggers[0].configurationArguments, + metadata.key ); } catch (ex) { Util.logger.warn( From 78e7a75f71206f0e8c5821a6b732b0bbb45a2035 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Mon, 26 Aug 2024 09:54:16 +0200 Subject: [PATCH 11/43] Revert "#1570: disable SF fields check until we have documentation for using the the proper API" This reverts commit 3cabe0c57a2b3c48bd46a514b16e24a654ce8f82. --- lib/metadataTypes/Event.js | 210 ++++++++++++++++++------------------- 1 file changed, 105 insertions(+), 105 deletions(-) diff --git a/lib/metadataTypes/Event.js b/lib/metadataTypes/Event.js index 5b94a7946..437d9a5a3 100644 --- a/lib/metadataTypes/Event.js +++ b/lib/metadataTypes/Event.js @@ -5,7 +5,7 @@ import { Util } from '../util/util.js'; import File from '../util/file.js'; import cache from '../util/cache.js'; import deepEqual from 'deep-equal'; -// import pLimit from 'p-limit'; +import pLimit from 'p-limit'; /** * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject @@ -517,85 +517,85 @@ class Event extends MetadataType { } // 3 get fields - // const rateLimit = pLimit(20); - // const uniqueSfObjectNames = this.sfObjects.referencedObjects[objectAPIName] - // ? [ - // ...new Set( - // Object.values(this.sfObjects.referencedObjects[objectAPIName]) - // .map((el) => el.referenceObjectName) - // .sort() - // ), - // ] - // : []; - // await Promise.all( - // uniqueSfObjectNames.map((objectAPIName) => - // rateLimit(async () => { - // if (this.sfObjects.objectFields[objectAPIName]) { - // return; - // } - // Util.logger.info( - // Util.getGrayMsg( - // ' - Caching Fields for Salesforce Object ' + objectAPIName - // ) - // ); - - // const referenceObjectsFieldsResponse = await this.client.rest.get( - // `/legacy/v1/beta/integration/member/salesforce/object/${objectAPIName}` - // ); - // if (referenceObjectsFieldsResponse?.sfobjectfields?.length) { - // Util.logger.debug( - // `Found ${referenceObjectsFieldsResponse?.sfobjectfields?.length} fields for Salesforce Object ${objectAPIName}` - // ); - // this.sfObjects.objectFields[objectAPIName] = {}; - // for (const field of referenceObjectsFieldsResponse.sfobjectfields) { - // this.sfObjects.objectFields[objectAPIName][field.name] = field; - // } - // } else { - // Util.logger.debug( - // `Could not find any fields for Salesforce Object ${objectAPIName}` - // ); - // throw new Error( - // `Could not find any fields for Salesforce Object ${objectAPIName}` - // ); - // } - // return; - // }) - // ) - // ); - - // // 4 create Common fields - // const contactLeadName = 'Contacts and Leads'; - // if ( - // this.sfObjects.objectFields['Contact'] && - // this.sfObjects.objectFields['Lead'] && - // !this.sfObjects.workflowObjects.includes(contactLeadName) - // ) { - // Util.logger.info( - // Util.getGrayMsg(' - Constructing Common / Contacts and Leads object') - // ); - // // add fake entry to workflowObjects to allow testing for this easily - // this.sfObjects.workflowObjects.push(contactLeadName); - - // // construct fields object for it - // this.sfObjects.objectFields[contactLeadName] = {}; - // const contactFieldNames = Object.keys(this.sfObjects.objectFields['Contact']); - // const leadFieldNames = Object.keys(this.sfObjects.objectFields['Lead']); - // for (const fieldName of contactFieldNames.filter((item) => - // leadFieldNames.includes(item) - // )) { - // // copy the value from contact - while thats not perfectly correct it will hopefully be sufficient for what we need to check - // this.sfObjects.objectFields[contactLeadName][fieldName] = - // this.sfObjects.objectFields['Contact'][fieldName]; - // this.sfObjects.objectFields[contactLeadName][fieldName].objectname = 'Common'; - - // // delete the field from Contact obj and from Lead obj - // delete this.sfObjects.objectFields['Contact'][fieldName]; - // delete this.sfObjects.objectFields['Lead'][fieldName]; - // } - // // create duplicate to also reference this via "Common" - // this.sfObjects.objectFields['Common'] = - // this.sfObjects.objectFields[contactLeadName]; - // } + const rateLimit = pLimit(20); + const uniqueSfObjectNames = this.sfObjects.referencedObjects[objectAPIName] + ? [ + ...new Set( + Object.values(this.sfObjects.referencedObjects[objectAPIName]) + .map((el) => el.referenceObjectName) + .sort() + ), + ] + : []; + await Promise.all( + uniqueSfObjectNames.map((objectAPIName) => + rateLimit(async () => { + if (this.sfObjects.objectFields[objectAPIName]) { + return; + } + Util.logger.info( + Util.getGrayMsg( + ' - Caching Fields for Salesforce Object ' + objectAPIName + ) + ); + + const referenceObjectsFieldsResponse = await this.client.rest.get( + `/legacy/v1/beta/integration/member/salesforce/object/${objectAPIName}` + ); + if (referenceObjectsFieldsResponse?.sfobjectfields?.length) { + Util.logger.debug( + `Found ${referenceObjectsFieldsResponse?.sfobjectfields?.length} fields for Salesforce Object ${objectAPIName}` + ); + this.sfObjects.objectFields[objectAPIName] = {}; + for (const field of referenceObjectsFieldsResponse.sfobjectfields) { + this.sfObjects.objectFields[objectAPIName][field.name] = field; + } + } else { + Util.logger.debug( + `Could not find any fields for Salesforce Object ${objectAPIName}` + ); + throw new Error( + `Could not find any fields for Salesforce Object ${objectAPIName}` + ); + } + return; + }) + ) + ); + + // 4 create Common fields + const contactLeadName = 'Contacts and Leads'; + if ( + this.sfObjects.objectFields['Contact'] && + this.sfObjects.objectFields['Lead'] && + !this.sfObjects.workflowObjects.includes(contactLeadName) + ) { + Util.logger.info( + Util.getGrayMsg(' - Constructing Common / Contacts and Leads object') + ); + // add fake entry to workflowObjects to allow testing for this easily + this.sfObjects.workflowObjects.push(contactLeadName); + + // construct fields object for it + this.sfObjects.objectFields[contactLeadName] = {}; + const contactFieldNames = Object.keys(this.sfObjects.objectFields['Contact']); + const leadFieldNames = Object.keys(this.sfObjects.objectFields['Lead']); + for (const fieldName of contactFieldNames.filter((item) => + leadFieldNames.includes(item) + )) { + // copy the value from contact - while thats not perfectly correct it will hopefully be sufficient for what we need to check + this.sfObjects.objectFields[contactLeadName][fieldName] = + this.sfObjects.objectFields['Contact'][fieldName]; + this.sfObjects.objectFields[contactLeadName][fieldName].objectname = 'Common'; + + // delete the field from Contact obj and from Lead obj + delete this.sfObjects.objectFields['Contact'][fieldName]; + delete this.sfObjects.objectFields['Lead'][fieldName]; + } + // create duplicate to also reference this via "Common" + this.sfObjects.objectFields['Common'] = + this.sfObjects.objectFields[contactLeadName]; + } } } @@ -648,31 +648,31 @@ class Event extends MetadataType { ); } else { // check if the fields selected in the eventDefinition are actually available - // for (const fieldName of object.fields) { - // if ( - // !this.sfObjects.objectFields[referencedObject][fieldName] && - // !this.defaultSalesforceFields.includes(fieldName) - // ) { - // if ( - // (referencedObject === 'Contact' || referencedObject === 'Lead') && - // this.sfObjects.objectFields['Contacts and Leads'][fieldName] - // ) { - // errors.push( - // `Salesforce object field ${referencedObject}.${fieldName} needs to be referenced as Common.${fieldName}` - // ); - // } else { - // errors.push( - // `Salesforce object field ${referencedObject}.${fieldName} not available on connected org.` - // ); - // } - // } - // // 1.2 check if all fields in eventDataConfig are listed in the eventDataSummary - // if (!ca.eventDataSummary.includes(object.dePrefix + fieldName)) { - // errors.push( - // `Field ${object.dePrefix + fieldName} is listed under eventDataConfig for referenceObject ${object.referenceObject} but not in eventDataSummary` - // ); - // } - // } + for (const fieldName of object.fields) { + if ( + !this.sfObjects.objectFields[referencedObject][fieldName] && + !this.defaultSalesforceFields.includes(fieldName) + ) { + if ( + (referencedObject === 'Contact' || referencedObject === 'Lead') && + this.sfObjects.objectFields['Contacts and Leads'][fieldName] + ) { + errors.push( + `Salesforce object field ${referencedObject}.${fieldName} needs to be referenced as Common.${fieldName}` + ); + } else { + errors.push( + `Salesforce object field ${referencedObject}.${fieldName} not available on connected org.` + ); + } + } + // 1.2 check if all fields in eventDataConfig are listed in the eventDataSummary + if (!ca.eventDataSummary.includes(object.dePrefix + fieldName)) { + errors.push( + `Field ${object.dePrefix + fieldName} is listed under eventDataConfig for referenceObject ${object.referenceObject} but not in eventDataSummary` + ); + } + } } } From d4296cd60f6cc204dd93a84258192e604958479c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Mon, 26 Aug 2024 10:08:32 +0200 Subject: [PATCH 12/43] #1570: improve how missing default fields are checked for --- @types/lib/metadataTypes/Event.d.ts.map | 2 +- lib/metadataTypes/Event.js | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/@types/lib/metadataTypes/Event.d.ts.map b/@types/lib/metadataTypes/Event.d.ts.map index b2b352479..748f1ccde 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,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA73BwB,mBAAmB"} \ No newline at end of file +{"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;AAb3D;;;;;;;;;;;;;;GAcG;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,gBAAgB,CAgC5B;IAyLD;;;;;OAKG;IACH,mCAHW,gBA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAn4BwB,mBAAmB"} \ No newline at end of file diff --git a/lib/metadataTypes/Event.js b/lib/metadataTypes/Event.js index 437d9a5a3..d2577c346 100644 --- a/lib/metadataTypes/Event.js +++ b/lib/metadataTypes/Event.js @@ -547,6 +547,15 @@ class Event extends MetadataType { `Found ${referenceObjectsFieldsResponse?.sfobjectfields?.length} fields for Salesforce Object ${objectAPIName}` ); this.sfObjects.objectFields[objectAPIName] = {}; + // !add default fields that are somehow not always returned by this legacy beta API + for (const field of this.defaultSalesforceFields) { + // @ts-expect-error hack to work around shortcomings of legacy beta API + this.sfObjects.objectFields[objectAPIName][field] = { + label: field, + name: field, + }; + } + // add fields returned by API for (const field of referenceObjectsFieldsResponse.sfobjectfields) { this.sfObjects.objectFields[objectAPIName][field.name] = field; } @@ -649,10 +658,7 @@ class Event extends MetadataType { } else { // check if the fields selected in the eventDefinition are actually available for (const fieldName of object.fields) { - if ( - !this.sfObjects.objectFields[referencedObject][fieldName] && - !this.defaultSalesforceFields.includes(fieldName) - ) { + if (!this.sfObjects.objectFields[referencedObject][fieldName]) { if ( (referencedObject === 'Contact' || referencedObject === 'Lead') && this.sfObjects.objectFields['Contacts and Leads'][fieldName] @@ -732,14 +738,14 @@ class Event extends MetadataType { if ( relationshipName !== 'Contact' && referenceObject === 'Contact' && - !this.sfObjects.objectFields[referenceObject][fieldName] + !this.sfObjects.objectFields[referenceObject][fieldName] && + this.sfObjects.objectFields['Common'] ) { // basically, when we link to Contact indirectly through other fields then the whole "common" thing does not apply but we still moved the fields to common referenceObject = 'Common'; } if ( !this.sfObjects.objectFields[referenceObject][fieldName] && - !this.defaultSalesforceFields.includes(fieldName) && relationshipName !== 'Contact' && referenceObject === 'Contact' && !this.sfObjects.objectFields['Common'][fieldName] From 1c5266c960ec83c2cbf77e671d30f90d24a08ce4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Mon, 26 Aug 2024 10:36:22 +0200 Subject: [PATCH 13/43] #1570: handle fake "Common" object more efficiently --- @types/lib/metadataTypes/Event.d.ts.map | 2 +- lib/metadataTypes/Event.js | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/@types/lib/metadataTypes/Event.d.ts.map b/@types/lib/metadataTypes/Event.d.ts.map index 748f1ccde..075372f71 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,aA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAr5BwB,mBAAmB"} \ No newline at end of file diff --git a/lib/metadataTypes/Event.js b/lib/metadataTypes/Event.js index d2577c346..89ccd61d1 100644 --- a/lib/metadataTypes/Event.js +++ b/lib/metadataTypes/Event.js @@ -504,6 +504,19 @@ class Event extends MetadataType { this.sfObjects.referencedObjects[objectAPIName] = referenceObjectsResponse ? [selfReference, ...referenceObjectsResponse] : [selfReference]; + if ( + referenceObjectsResponse.some((el) => el.referenceObjectName === 'Lead') && + referenceObjectsResponse.some((el) => el.referenceObjectName === 'Contact') + ) { + // add fake object "Common" to referenced objects for testing + this.sfObjects.referencedObjects[objectAPIName].push({ + displayname: 'Common', + relationshipIdName: 'Id', + relationshipName: 'Common', + isPolymorphic: false, + referenceObjectName: 'Common', + }); + } Util.logger.debug( `sfObjects.referencedObjects[${objectAPIName}]: ` + JSON.stringify(this.sfObjects.referencedObjects[objectAPIName]) @@ -530,7 +543,10 @@ class Event extends MetadataType { await Promise.all( uniqueSfObjectNames.map((objectAPIName) => rateLimit(async () => { - if (this.sfObjects.objectFields[objectAPIName]) { + if ( + this.sfObjects.objectFields[objectAPIName] || + objectAPIName === 'Common' + ) { return; } Util.logger.info( From d4aff4d5f6af3e155c5efd2aadc798ed4cb77f63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Mon, 26 Aug 2024 10:38:28 +0200 Subject: [PATCH 14/43] #1570: fix test for contactKey --- lib/metadataTypes/Event.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/metadataTypes/Event.js b/lib/metadataTypes/Event.js index 89ccd61d1..be86ee2b3 100644 --- a/lib/metadataTypes/Event.js +++ b/lib/metadataTypes/Event.js @@ -730,11 +730,11 @@ class Event extends MetadataType { } if ( !this.sfObjects.objectFields[ca.contactKey.referenceObjectName][ - ca.contactKey.fieldName + ca.contactKey.relationshipIdName ] ) { errors.push( - `configurationArguments.contactKey states the invalid fieldName '${ca.contactKey.fieldName}' value that does not exist on ${ca.contactKey.referenceObjectName}` + `configurationArguments.contactKey states the invalid fieldName '${ca.contactKey.relationshipIdName}' value that does not exist on ${ca.contactKey.referenceObjectName}` ); } } else { From 331d307942336321c2328cdca92060431ca3a8db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Mon, 26 Aug 2024 10:39:54 +0200 Subject: [PATCH 15/43] #1570: disable warnings for missing tests as they are not currently reliable due to the bad API --- lib/metadataTypes/Event.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/metadataTypes/Event.js b/lib/metadataTypes/Event.js index be86ee2b3..4e1414c87 100644 --- a/lib/metadataTypes/Event.js +++ b/lib/metadataTypes/Event.js @@ -683,9 +683,10 @@ class Event extends MetadataType { `Salesforce object field ${referencedObject}.${fieldName} needs to be referenced as Common.${fieldName}` ); } else { - errors.push( - `Salesforce object field ${referencedObject}.${fieldName} not available on connected org.` - ); + // TODO reactivate after switch to new API + // errors.push( + // `Salesforce object field ${referencedObject}.${fieldName} not available on connected org.` + // ); } } // 1.2 check if all fields in eventDataConfig are listed in the eventDataSummary From 0fd8b405bd0505a5a0008d2e88d480b4916ec19c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Mon, 26 Aug 2024 10:41:05 +0200 Subject: [PATCH 16/43] #1570: mark next steps --- lib/metadataTypes/Event.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/metadataTypes/Event.js b/lib/metadataTypes/Event.js index 4e1414c87..e489833a0 100644 --- a/lib/metadataTypes/Event.js +++ b/lib/metadataTypes/Event.js @@ -785,10 +785,11 @@ class Event extends MetadataType { // 5 check primaryObjectFilterCriteria // TODO - // 6 compare primaryObjectFilterSummary to primaryObjectFilterCriteria + // 6 remove primaryObjectFilterSummary (and auto-generate it again in preDeploy from primaryObjectFilterCriteria) // TODO - // 7 + // 7 remove eventDataSummary (and auto-generate it again in preDeploy from eventDataConfig) + // TODO // throw error if problems were found if (errors?.length) { From 5bb443d89537e9dac08cb08aa8343390a4689569 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Mon, 26 Aug 2024 10:59:15 +0200 Subject: [PATCH 17/43] #1570: fix test for contactKey --- @types/lib/metadataTypes/Event.d.ts.map | 2 +- lib/metadataTypes/Event.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/@types/lib/metadataTypes/Event.d.ts.map b/@types/lib/metadataTypes/Event.d.ts.map index 075372f71..96abfcdab 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;AAb3D;;;;;;;;;;;;;;GAcG;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,kBAAk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ib/metadataTypes/Event.js +++ b/lib/metadataTypes/Event.js @@ -731,11 +731,12 @@ class Event extends MetadataType { } if ( !this.sfObjects.objectFields[ca.contactKey.referenceObjectName][ - ca.contactKey.relationshipIdName + ca.contactKey.fieldName || ca.contactKey.relationshipIdName ] ) { + // * if contactKey uses "Common" then there is no fieldName attribute but instead relationshipIdName needs to be checked errors.push( - `configurationArguments.contactKey states the invalid fieldName '${ca.contactKey.relationshipIdName}' value that does not exist on ${ca.contactKey.referenceObjectName}` + `configurationArguments.contactKey states the invalid fieldName '${ca.contactKey.fieldName || ca.contactKey.relationshipIdName}' value that does not exist on ${ca.contactKey.referenceObjectName}` ); } } else { From 6b7ea8c0981d1649ba1fb66737ede86378c750b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Mon, 26 Aug 2024 11:03:36 +0200 Subject: [PATCH 18/43] #1570: improve contactKey error message for Common vs Contact --- @types/lib/metadataTypes/Event.d.ts.map | 2 +- lib/metadataTypes/Event.js | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/@types/lib/metadataTypes/Event.d.ts.map b/@types/lib/metadataTypes/Event.d.ts.map index 96abfcdab..309294e0e 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,iBAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAj6BwB,mBAAmB"} \ No newline at end of file diff --git a/lib/metadataTypes/Event.js b/lib/metadataTypes/Event.js index 0b5ccee47..87dc50e9b 100644 --- a/lib/metadataTypes/Event.js +++ b/lib/metadataTypes/Event.js @@ -735,9 +735,20 @@ class Event extends MetadataType { ] ) { // * if contactKey uses "Common" then there is no fieldName attribute but instead relationshipIdName needs to be checked - errors.push( - `configurationArguments.contactKey states the invalid fieldName '${ca.contactKey.fieldName || ca.contactKey.relationshipIdName}' value that does not exist on ${ca.contactKey.referenceObjectName}` - ); + if ( + ca.contactKey.referenceObjectName === 'Contact' && + this.sfObjects.objectFields['Common'][ + ca.contactKey.fieldName || ca.contactKey.relationshipIdName + ] + ) { + errors.push( + `configurationArguments.contactKey should be referencing Common instead of Contact` + ); + } else { + errors.push( + `configurationArguments.contactKey states the invalid fieldName '${ca.contactKey.fieldName || ca.contactKey.relationshipIdName}' value that does not exist on ${ca.contactKey.referenceObjectName}` + ); + } } } else { errors.push( From adfbd3b5e886af76e2b40fb391691d0c603d1cb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Mon, 26 Aug 2024 13:27:04 +0200 Subject: [PATCH 19/43] #1570: cleanup --- @types/lib/metadataTypes/Event.d.ts.map | 2 +- lib/metadataTypes/Event.js | 110 +++++++++++++----------- 2 files changed, 59 insertions(+), 53 deletions(-) diff --git a/@types/lib/metadataTypes/Event.d.ts.map b/@types/lib/metadataTypes/Event.d.ts.map index 309294e0e..8f4ffa82e 100644 --- a/@types/lib/metadataTypes/Event.d.ts.map +++ b/@types/lib/metadataTypes/Event.d.ts.map @@ -1 +1 @@ -{"version":3,"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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAj6BwB,mBAAmB"} \ No newline at end of file +{"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;AAb3D;;;;;;;;;;;;;;GAcG;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,6B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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAv6BwB,mBAAmB"} \ No newline at end of file diff --git a/lib/metadataTypes/Event.js b/lib/metadataTypes/Event.js index 87dc50e9b..97429af8d 100644 --- a/lib/metadataTypes/Event.js +++ b/lib/metadataTypes/Event.js @@ -483,10 +483,6 @@ class Event extends MetadataType { this.sfObjects.workflowObjects = workflowObjectsResponse ? workflowObjectsResponse.map((o) => o.apiname) : []; - Util.logger.debug( - 'sfObjects.workflowObjectApiNames: ' + - JSON.stringify(this.sfObjects.workflowObjects) - ); } // 2 get objects related to the selected object @@ -500,7 +496,10 @@ class Event extends MetadataType { `/data/v1/integration/member/salesforce/object/${objectAPIName}/referenceobjects` ); // add itself first so that we get the fields for objectAPIName as well - const selfReference = { referenceObjectName: objectAPIName }; + const selfReference = { + referenceObjectName: objectAPIName, + relationshipName: objectAPIName, + }; this.sfObjects.referencedObjects[objectAPIName] = referenceObjectsResponse ? [selfReference, ...referenceObjectsResponse] : [selfReference]; @@ -517,10 +516,6 @@ class Event extends MetadataType { referenceObjectName: 'Common', }); } - Util.logger.debug( - `sfObjects.referencedObjects[${objectAPIName}]: ` + - JSON.stringify(this.sfObjects.referencedObjects[objectAPIName]) - ); } catch (ex) { if (ex.code === 'ERR_BAD_RESPONSE') { throw new Error( @@ -715,46 +710,57 @@ class Event extends MetadataType { // 3 check contactKey // check against referencedObjects - const referencedContactObj = this.sfObjects.referencedObjects[ca.objectAPIName].find( - (el) => el.relationshipName === ca.contactKey.relationshipName - ); - if (referencedContactObj) { - if (referencedContactObj.isPolymorphic !== ca.contactKey.isPolymorphic) { - errors.push( - `configurationArguments.contactKey states an incorrect isPolimorphic value. Should be ${referencedContactObj.isPolymorphic}` - ); - } - if (referencedContactObj.referenceObjectName !== ca.contactKey.referenceObjectName) { - errors.push( - `configurationArguments.contactKey states an incorrect referenceObjectName value. Should be ${referencedContactObj.referenceObjectName}` - ); - } - if ( - !this.sfObjects.objectFields[ca.contactKey.referenceObjectName][ - ca.contactKey.fieldName || ca.contactKey.relationshipIdName - ] - ) { - // * if contactKey uses "Common" then there is no fieldName attribute but instead relationshipIdName needs to be checked - if ( - ca.contactKey.referenceObjectName === 'Contact' && - this.sfObjects.objectFields['Common'][ - ca.contactKey.fieldName || ca.contactKey.relationshipIdName - ] - ) { - errors.push( - `configurationArguments.contactKey should be referencing Common instead of Contact` - ); - } else { - errors.push( - `configurationArguments.contactKey states the invalid fieldName '${ca.contactKey.fieldName || ca.contactKey.relationshipIdName}' value that does not exist on ${ca.contactKey.referenceObjectName}` - ); - } - } - } else { - errors.push( - `configurationArguments.contactKey references ${ca.contactKey.relationshipName} which is not found in related salesforce objects` - ); - } + // const referencedContactObj = this.sfObjects.referencedObjects[ca.objectAPIName].find( + // (el) => + // el.relationshipName === + // (ca.contactKey.relationshipName == '' + // ? ca.contactKey.referenceObjectName + // : ca.contactKey.relationshipName) + // ); + // if (referencedContactObj) { + // if ( + // ca.contactKey.isPolymorphic && + // referencedContactObj.isPolymorphic !== ca.contactKey.isPolymorphic + // ) { + // errors.push( + // `configurationArguments.contactKey states an incorrect isPolimorphic value. Should be ${referencedContactObj.isPolymorphic}` + // ); + // } + // if (referencedContactObj.referenceObjectName !== ca.contactKey.referenceObjectName) { + // errors.push( + // `configurationArguments.contactKey states an incorrect referenceObjectName value. Should be ${referencedContactObj.referenceObjectName}` + // ); + // } + // if ( + // !this.sfObjects.objectFields[ca.contactKey.referenceObjectName]?.[ + // ca.contactKey.fieldName || ca.contactKey.relationshipIdName + // ] + // ) { + // // * if contactKey uses "Common" then there is no fieldName attribute but instead relationshipIdName needs to be checked + // if ( + // ca.contactKey.referenceObjectName === 'Contact' && + // this.sfObjects.objectFields['Common'][ + // ca.contactKey.fieldName || ca.contactKey.relationshipIdName + // ] + // ) { + // errors.push( + // `configurationArguments.contactKey should be referencing Common instead of Contact` + // ); + // } else { + // errors.push( + // `configurationArguments.contactKey states the invalid fieldName '${ca.contactKey.fieldName || ca.contactKey.relationshipIdName}' value that does not exist on ${ca.contactKey.referenceObjectName}` + // ); + // } + // } + // } else { + // errors.push( + // `configurationArguments.contactKey references ${ + // ca.contactKey.relationshipName == '' + // ? ca.contactKey.referenceObjectName + // : ca.contactKey.relationshipName + // } which is not found in related salesforce objects` + // ); + // } // 4 check passThroughArgument for (const key of Object.keys(ca.passThroughArgument.fields)) { @@ -774,14 +780,14 @@ class Event extends MetadataType { referenceObject = 'Common'; } if ( - !this.sfObjects.objectFields[referenceObject][fieldName] && + !this.sfObjects.objectFields[referenceObject]?.[fieldName] && relationshipName !== 'Contact' && referenceObject === 'Contact' && - !this.sfObjects.objectFields['Common'][fieldName] + !this.sfObjects.objectFields['Common']?.[fieldName] ) { if ( (relationshipName === 'Contact' || relationshipName === 'Lead') && - this.sfObjects.objectFields['Common'][fieldName] + this.sfObjects.objectFields['Common']?.[fieldName] ) { errors.push( `(${referenceObject})(${relationshipName}) Field ${dePrefix + fieldName} is listed under passThroughArgument.fields.${key} but needs to be referenced as ${dePrefixCommon}.${fieldName}` From 0e7a251e283d762bc0ed096cdf752ddceb4cb00d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Mon, 26 Aug 2024 13:29:20 +0200 Subject: [PATCH 20/43] #1570: disable beautyAmp for *.html files again --- .vscode/settings.json | 2 +- boilerplate/files/.vscode/settings.json | 5 ++--- boilerplate/forcedUpdates.json | 4 ++++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 28bc58f4a..ded56bd88 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -20,7 +20,7 @@ "sql-formatter.indent": " ", "sql-formatter.uppercase": true, "[html]": { - "editor.defaultFormatter": "FiB.beautyAmp" + "editor.defaultFormatter": "esbenp.prettier-vscode" }, "[javascript]": { "editor.defaultFormatter": "esbenp.prettier-vscode" diff --git a/boilerplate/files/.vscode/settings.json b/boilerplate/files/.vscode/settings.json index 78687da09..0426edcfa 100644 --- a/boilerplate/files/.vscode/settings.json +++ b/boilerplate/files/.vscode/settings.json @@ -37,8 +37,7 @@ }, "editor.formatOnSave": true, "files.associations": { - "*.ssjs": "javascript", - "*.html": "ampscript" + "*.ssjs": "javascript" }, "files.eol": "\n", "files.exclude": { @@ -49,7 +48,7 @@ "editor.defaultFormatter": "esbenp.prettier-vscode" }, "[html]": { - "editor.defaultFormatter": "FiB.beautyAmp" + "editor.defaultFormatter": "esbenp.prettier-vscode" }, "[javascript]": { "editor.defaultFormatter": "esbenp.prettier-vscode" diff --git a/boilerplate/forcedUpdates.json b/boilerplate/forcedUpdates.json index 6090d9fb4..e3376f60d 100644 --- a/boilerplate/forcedUpdates.json +++ b/boilerplate/forcedUpdates.json @@ -1,4 +1,8 @@ [ + { + "version": "7.2.1", + "files": [".vscode/settings.json"] + }, { "version": "7.1.0", "files": [".vscode/settings.json", ".gitignore"] From 67898772a30ee9445946ab6fdadbbd822089f658 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Mon, 26 Aug 2024 14:48:21 +0200 Subject: [PATCH 21/43] #1570: fix sf-event pre-deploy checks --- @types/lib/metadataTypes/Event.d.ts | 4 ++-- @types/lib/metadataTypes/Event.d.ts.map | 2 +- lib/metadataTypes/Event.js | 21 ++++++++++++--------- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/@types/lib/metadataTypes/Event.d.ts b/@types/lib/metadataTypes/Event.d.ts index 6c98dbd5f..f5f3e8f57 100644 --- a/@types/lib/metadataTypes/Event.d.ts +++ b/@types/lib/metadataTypes/Event.d.ts @@ -78,9 +78,9 @@ declare class Event extends MetadataType { * prepares an event definition for deployment * * @param {MetadataTypeItem} metadata a single eventDefinition - * @returns {MetadataTypeItem} parsed version + * @returns {Promise.} parsed version */ - static preDeployTasks(metadata: MetadataTypeItem): MetadataTypeItem; + static preDeployTasks(metadata: MetadataTypeItem): Promise; /** * parses retrieved Metadata before saving * diff --git a/@types/lib/metadataTypes/Event.d.ts.map b/@types/lib/metadataTypes/Event.d.ts.map index 8f4ffa82e..cce01e2ad 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;AAb3D;;;;;;;;;;;;;;GAcG;AAEH;;;;GAIG;AACH;IAC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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA16BwB,mBAAmB"} \ No newline at end of file diff --git a/lib/metadataTypes/Event.js b/lib/metadataTypes/Event.js index 97429af8d..4be2c4b7d 100644 --- a/lib/metadataTypes/Event.js +++ b/lib/metadataTypes/Event.js @@ -189,9 +189,9 @@ class Event extends MetadataType { * prepares an event definition for deployment * * @param {MetadataTypeItem} metadata a single eventDefinition - * @returns {MetadataTypeItem} parsed version + * @returns {Promise.} parsed version */ - static preDeployTasks(metadata) { + static async preDeployTasks(metadata) { // Note: lots has to be done in createOrUpdate based on what action is required metadata.arguments ||= {}; metadata.arguments.eventDefinitionKey = metadata.eventDefinitionKey; @@ -218,7 +218,10 @@ class Event extends MetadataType { break; } } - this.preDeployTasks_SalesforceEntryEvents(metadata.type, metadata.configurationArguments); + await this.preDeployTasks_SalesforceEntryEvents( + metadata.type, + metadata.configurationArguments + ); return metadata; } @@ -899,6 +902,12 @@ class Event extends MetadataType { if (triggerType !== 'SalesforceObjectTriggerV2' || !ca) { return; } + // get info about salesforce objects if not already cached + await this.getSalesforceObjects(ca.objectAPIName); + + // check if whats on the journey matches what SF Core offers + this.checkSalesforceEntryEvents(ca); + // normalize payload because these fields are sometimes set as strings and sometimes as objects ca.contactKey = 'object' === typeof ca.contactKey ? JSON.stringify(ca.contactKey) : ca.contactKey; @@ -928,12 +937,6 @@ class Event extends MetadataType { ca.objectAPIName = ca.objectApiName; delete ca.objectApiName; } - - // get info about salesforce objects if not already cached - await this.getSalesforceObjects(ca.objectAPIName); - - // check if whats on the journey matches what SF Core offers - this.checkSalesforceEntryEvents(ca); } } From 453dcb2f2f8751ece889d9e90ba932e5a372d290 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Mon, 26 Aug 2024 15:17:44 +0200 Subject: [PATCH 22/43] #1570: deactivate passThroughArgument checks until Common vs Contact recognition is more stable --- lib/metadataTypes/Event.js | 75 +++++++++++++++++++------------------- 1 file changed, 38 insertions(+), 37 deletions(-) diff --git a/lib/metadataTypes/Event.js b/lib/metadataTypes/Event.js index 4be2c4b7d..4142c489d 100644 --- a/lib/metadataTypes/Event.js +++ b/lib/metadataTypes/Event.js @@ -647,7 +647,6 @@ class Event extends MetadataType { const dePrefixFields = {}; const dePrefixRelationshipMap = {}; const dePrefixReferenceObjectMap = {}; - const dePrefixCommon = ca.objectAPIName + ':Common'; for (const object of edcObjects) { // create secondary object to quickly check eventDataSummary against dePrefixFields[object.dePrefix] = object.fields; @@ -766,42 +765,44 @@ class Event extends MetadataType { // } // 4 check passThroughArgument - for (const key of Object.keys(ca.passThroughArgument.fields)) { - const fieldPath = ca.passThroughArgument.fields[key].split(':'); - const fieldName = fieldPath.pop(); - const dePrefix = fieldPath.join(':') + ':'; - // it seems these fields do NOT need to be in the eventDataConfig - const relationshipName = dePrefixRelationshipMap[dePrefix]; - let referenceObject = dePrefixReferenceObjectMap[dePrefix]; - if ( - relationshipName !== 'Contact' && - referenceObject === 'Contact' && - !this.sfObjects.objectFields[referenceObject][fieldName] && - this.sfObjects.objectFields['Common'] - ) { - // basically, when we link to Contact indirectly through other fields then the whole "common" thing does not apply but we still moved the fields to common - referenceObject = 'Common'; - } - if ( - !this.sfObjects.objectFields[referenceObject]?.[fieldName] && - relationshipName !== 'Contact' && - referenceObject === 'Contact' && - !this.sfObjects.objectFields['Common']?.[fieldName] - ) { - if ( - (relationshipName === 'Contact' || relationshipName === 'Lead') && - this.sfObjects.objectFields['Common']?.[fieldName] - ) { - errors.push( - `(${referenceObject})(${relationshipName}) Field ${dePrefix + fieldName} is listed under passThroughArgument.fields.${key} but needs to be referenced as ${dePrefixCommon}.${fieldName}` - ); - } else { - errors.push( - `(${referenceObject})(${relationshipName}) Field ${dePrefix + fieldName} is listed under passThroughArgument.fields.${key} but is not available on connected org.` - ); - } - } - } + // TODO check where Common vs Contact is really required + // const dePrefixCommon = ca.objectAPIName + ':Common'; + // for (const key of Object.keys(ca.passThroughArgument.fields)) { + // const fieldPath = ca.passThroughArgument.fields[key].split(':'); + // const fieldName = fieldPath.pop(); + // const dePrefix = fieldPath.join(':') + ':'; + // // it seems these fields do NOT need to be in the eventDataConfig + // const relationshipName = dePrefixRelationshipMap[dePrefix]; + // let referenceObject = dePrefixReferenceObjectMap[dePrefix]; + // if ( + // relationshipName !== 'Contact' && + // referenceObject === 'Contact' && + // !this.sfObjects.objectFields[referenceObject][fieldName] && + // this.sfObjects.objectFields['Common'] + // ) { + // // basically, when we link to Contact indirectly through other fields then the whole "common" thing does not apply but we still moved the fields to common + // referenceObject = 'Common'; + // } + // if ( + // !this.sfObjects.objectFields[referenceObject]?.[fieldName] && + // relationshipName !== 'Contact' && + // referenceObject === 'Contact' && + // !this.sfObjects.objectFields['Common']?.[fieldName] + // ) { + // if ( + // (relationshipName === 'Contact' || relationshipName === 'Lead') && + // this.sfObjects.objectFields['Common']?.[fieldName] + // ) { + // errors.push( + // `(${referenceObject})(${relationshipName}) Field ${dePrefix + fieldName} is listed under passThroughArgument.fields.${key} but needs to be referenced as ${dePrefixCommon}.${fieldName}` + // ); + // } else { + // errors.push( + // `(${referenceObject})(${relationshipName}) Field ${dePrefix + fieldName} is listed under passThroughArgument.fields.${key} but is not available on connected org.` + // ); + // } + // } + // } // 5 check primaryObjectFilterCriteria // TODO From af7dffd18f23acc13e43f21d3ccb1a725c609e41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Mon, 26 Aug 2024 15:18:19 +0200 Subject: [PATCH 23/43] #1570: ensure deploy checks for missing fields and fails if any are identified --- @types/lib/metadataTypes/Event.d.ts.map | 2 +- lib/metadataTypes/Event.js | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/@types/lib/metadataTypes/Event.d.ts.map b/@types/lib/metadataTypes/Event.d.ts.map index cce01e2ad..36380a335 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;AAb3D;;;;;;;;;;;;;;GAcG;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,CAmCtC;IAyLD;;;;;OAKG;IACH,mCAHW,gBAAgB,GACd,OAAO,CAAE,gBAAgB,CAAC,CA2CtC;IACD;QACI,uBAAuB;yBAAZ,MAAM,EAAE;QAEnB,2EAA2E;2BAAhE;gBAAQ,MAAM,GAAE,eAAe,EA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA16BwB,mBAAmB"} \ No newline at end of file +{"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;AAb3D;;;;;;;;;;;;;;GAcG;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;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA57BwB,mBAAmB"} \ No newline at end of file diff --git a/lib/metadataTypes/Event.js b/lib/metadataTypes/Event.js index 4142c489d..50d32d9ec 100644 --- a/lib/metadataTypes/Event.js +++ b/lib/metadataTypes/Event.js @@ -903,6 +903,23 @@ class Event extends MetadataType { if (triggerType !== 'SalesforceObjectTriggerV2' || !ca) { return; } + + // check if everything important is there or else MC Connect cannot publish this AND other journeys + const missingFields = []; + for (const attribute of this.requiredConfigurationArguments) { + if (!ca[attribute]) { + missingFields.push(attribute); + } + } + if (missingFields.length) { + throw new Error( + `required field not set: \n -` + + missingFields + .map((attribute) => `configurationArguments.${attribute}`) + .join('\n - ') + ); + } + // get info about salesforce objects if not already cached await this.getSalesforceObjects(ca.objectAPIName); From 010714d0f700dd562b80cf82a84f7d44b616f04f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 27 Aug 2024 12:57:27 +0200 Subject: [PATCH 24/43] #1570: ensure sf entry tests show 'journey' and not 'event' when run for journeys --- lib/metadataTypes/Event.js | 5 +++-- lib/metadataTypes/Journey.js | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/metadataTypes/Event.js b/lib/metadataTypes/Event.js index 50d32d9ec..1099052aa 100644 --- a/lib/metadataTypes/Event.js +++ b/lib/metadataTypes/Event.js @@ -839,9 +839,10 @@ class Event extends MetadataType { * @param {string} triggerType e.g. SalesforceObjectTriggerV2, APIEvent, ... * @param {any} ca trigger[0].configurationArguments * @param {string} key of event / journey + * @param {string} [type] optionally provide type for error on missing configurationArguments attributes * @returns {Promise.} - */ - static async postRetrieveTasks_SalesforceEntryEvents(triggerType, ca, key) { + static async postRetrieveTasks_SalesforceEntryEvents(triggerType, ca, key, type) { if (triggerType !== 'SalesforceObjectTriggerV2' || !ca) { return; } @@ -856,7 +857,7 @@ class Event extends MetadataType { for (const attribute of this.requiredConfigurationArguments) { if (!ca[attribute]) { Util.logger.error( - ` - ${this.definition.type} ${key}: required field configurationArguments.${attribute} not set` + ` - ${type || this.definition.type} ${key}: required field configurationArguments.${attribute} not set` ); } } diff --git a/lib/metadataTypes/Journey.js b/lib/metadataTypes/Journey.js index b125f21ff..750e87ff4 100644 --- a/lib/metadataTypes/Journey.js +++ b/lib/metadataTypes/Journey.js @@ -412,7 +412,8 @@ class Journey extends MetadataType { await Event.postRetrieveTasks_SalesforceEntryEvents( metadata.triggers[0].type, metadata.triggers[0].configurationArguments, - metadata.key + metadata.key, + this.definition.type ); } catch (ex) { Util.logger.warn( From 03998bbe95503b7df7e499ca99628fc165edb466 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 27 Aug 2024 13:03:13 +0200 Subject: [PATCH 25/43] #1608: find related sendClassification and senderProfile by ID, not by key --- @types/lib/metadataTypes/Journey.d.ts.map | 2 +- lib/metadataTypes/Journey.js | 22 ++++++++--------- lib/metadataTypes/TriggeredSend.js | 24 +++++++++---------- .../definitions/TriggeredSend.definition.js | 6 ++--- 4 files changed, 26 insertions(+), 28 deletions(-) diff --git a/@types/lib/metadataTypes/Journey.d.ts.map b/@types/lib/metadataTypes/Journey.d.ts.map index b90ca92f8..50049185a 100644 --- a/@types/lib/metadataTypes/Journey.d.ts.map +++ b/@types/lib/metadataTypes/Journey.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Journey.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/Journey.js"],"names":[],"mappings":";uBAWa,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;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;;;;;GAQG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,OAAO,CAAE,kBAAkB,CAAC,CA8JxC;IA+ED;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAS1B;IAED;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAK1B;IAmBD;;;;OAIG;IACH,2CAFW,eAAe,iBAmBzB;IAED;;;;;;OAMG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,CA0L5B;IAED;;;;;OAKG;IACH,6CAoaC;IAED;;;;;;OAMG;IACH,gCAHW,gBAAgB,GACd,OAAO,CAAE,gBAAgB,CAAC,CAkJtC;IAED;;;;;OAKG;IACH,0CA6MC;IA4LD;;;;OAIG;IACH,sC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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA7yDwB,mBAAmB"} \ No newline at end of file +{"version":3,"file":"Journey.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/Journey.js"],"names":[],"mappings":";uBAWa,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;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;;;;;GAQG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,OAAO,CAAE,kBAAkB,CAAC,CA8JxC;IA+ED;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAS1B;IAED;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAK1B;IAmBD;;;;OAIG;IACH,2CAFW,eAAe,iBAmBzB;IAED;;;;;;OAMG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,CA0L5B;IAED;;;;;OAKG;IACH,6CAkaC;IAED;;;;;;OAMG;IACH,gCAHW,gBAAgB,GACd,OAAO,CAAE,gBAAgB,CAAC,CAkJtC;IAED;;;;;OAKG;IACH,0CA6MC;IA4LD;;;;OAIG;IACH,sCAFW,eAAe,iBAWzB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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA3yDwB,mBAAmB"} \ No newline at end of file diff --git a/lib/metadataTypes/Journey.js b/lib/metadataTypes/Journey.js index bba36320a..b310abed6 100644 --- a/lib/metadataTypes/Journey.js +++ b/lib/metadataTypes/Journey.js @@ -617,36 +617,34 @@ class Journey extends MetadataType { if (linkedTS.SenderProfile?.CustomerKey) { try { - cache.searchForField( + const spKey = cache.searchForField( 'senderProfile', - linkedTS.SenderProfile.CustomerKey, - 'CustomerKey', + linkedTS.SenderProfile.ObjectID, + 'ObjectID', 'CustomerKey' ); - triggeredSend.r__senderProfile_key = - linkedTS.SenderProfile.CustomerKey; + triggeredSend.r__senderProfile_key = spKey; delete triggeredSend.senderProfileId; } catch (ex) { Util.logger.warn( - ` - ${this.definition.type} ${linkedTS.CustomerKey}: ${ex.message}` + ` - triggeredSend ${linkedTS.CustomerKey}: ${ex.message} (senderProfile key ${linkedTS.SenderProfile.CustomerKey})` ); } } // send classification if (linkedTS.SendClassification?.CustomerKey) { try { - cache.searchForField( + const scKey = cache.searchForField( 'sendClassification', - linkedTS.SendClassification.CustomerKey, - 'CustomerKey', + linkedTS.SendClassification.ObjectID, + 'ObjectID', 'CustomerKey' ); - triggeredSend.r__sendClassification_key = - linkedTS.SendClassification.CustomerKey; + triggeredSend.r__sendClassification_key = scKey; delete triggeredSend.sendClassificationId; } catch (ex) { Util.logger.warn( - ` - ${this.definition.type} ${linkedTS.CustomerKey}: ${ex.message}` + ` - triggeredSend ${linkedTS.CustomerKey}: ${ex.message} (sendClassification key ${linkedTS.SendClassification.CustomerKey})` ); } } diff --git a/lib/metadataTypes/TriggeredSend.js b/lib/metadataTypes/TriggeredSend.js index 7c94236e0..014fd8ca6 100644 --- a/lib/metadataTypes/TriggeredSend.js +++ b/lib/metadataTypes/TriggeredSend.js @@ -168,36 +168,36 @@ class TriggeredSend extends MetadataType { } // sender profile - if (metadata.SenderProfile?.CustomerKey) { + if (metadata.SenderProfile?.ObjectID) { try { - cache.searchForField( + const spKey = cache.searchForField( 'senderProfile', - metadata.SenderProfile.CustomerKey, - 'CustomerKey', + metadata.SenderProfile.ObjectID, + 'ObjectID', 'CustomerKey' ); - metadata.r__senderProfile_key = metadata.SenderProfile.CustomerKey; + metadata.r__senderProfile_key = spKey; delete metadata.SenderProfile; } catch (ex) { Util.logger.warn( - ` - ${this.definition.type} ${metadata.CustomerKey}: ${ex.message}` + ` - ${this.definition.type} ${metadata.CustomerKey}: ${ex.message} (senderProfile key ${metadata.SenderProfile.CustomerKey})` ); } } // send classification - if (metadata.SendClassification?.CustomerKey) { + if (metadata.SendClassification?.ObjectID) { try { - cache.searchForField( + const scKey = cache.searchForField( 'sendClassification', - metadata.SendClassification.CustomerKey, - 'CustomerKey', + metadata.SendClassification.ObjectID, + 'ObjectID', 'CustomerKey' ); - metadata.r__sendClassification_key = metadata.SendClassification.CustomerKey; + metadata.r__sendClassification_key = scKey; delete metadata.SendClassification; } catch (ex) { Util.logger.warn( - ` - ${this.definition.type} ${metadata.CustomerKey}: ${ex.message}` + ` - ${this.definition.type} ${metadata.CustomerKey}: ${ex.message} (sendClassification key ${metadata.SendClassification.CustomerKey})` ); } } diff --git a/lib/metadataTypes/definitions/TriggeredSend.definition.js b/lib/metadataTypes/definitions/TriggeredSend.definition.js index bd40e05b5..a3e1c533a 100644 --- a/lib/metadataTypes/definitions/TriggeredSend.definition.js +++ b/lib/metadataTypes/definitions/TriggeredSend.definition.js @@ -129,7 +129,7 @@ export default { 'DeliveryProfile.ObjectID': { isCreateable: true, isUpdateable: true, - retrieving: false, + retrieving: true, templating: false, }, Description: { @@ -436,7 +436,7 @@ export default { 'SendClassification.ObjectID': { isCreateable: false, isUpdateable: false, - retrieving: false, + retrieving: true, templating: false, }, 'SendClassification.PartnerKey': { @@ -454,7 +454,7 @@ export default { 'SenderProfile.ObjectID': { isCreateable: false, isUpdateable: false, - retrieving: false, + retrieving: true, templating: false, }, 'SenderProfile.PartnerKey': { From cdf862c576737cf0d0f5e896d79de1373c498183 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 27 Aug 2024 13:21:39 +0200 Subject: [PATCH 26/43] #1608: ensure we send ObjectID during update/create; update test cases --- @types/lib/metadataTypes/TriggeredSend.d.ts.map | 2 +- lib/metadataTypes/TriggeredSend.js | 10 ++++++---- .../definitions/TriggeredSend.definition.js | 8 ++++---- .../triggeredSendDefinition/create-response.xml | 4 ++-- ...usINNew,Active,Inactive,Moved,Canceled-response.xml | 8 ++++---- .../triggeredSendDefinition/update-response.xml | 4 ++-- 6 files changed, 19 insertions(+), 17 deletions(-) diff --git a/@types/lib/metadataTypes/TriggeredSend.d.ts.map b/@types/lib/metadataTypes/TriggeredSend.d.ts.map index 1c1e67ee8..98e0b7671 100644 --- a/@types/lib/metadataTypes/TriggeredSend.d.ts.map +++ b/@types/lib/metadataTypes/TriggeredSend.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"TriggeredSend.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/TriggeredSend.js"],"names":[],"mappings":";uBAWa,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;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA7jBwB,mBAAmB"} \ No newline at end of file +{"version":3,"file":"TriggeredSend.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/TriggeredSend.js"],"names":[],"mappings":";uBAWa,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;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,OAAO,CAAE,kBAAkB,CAAC,CA2BxC;IAED;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAK1B;IAED;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAO1B;IAYD;;;;;OAKG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,GAAG,IAAI,CAwGnC;IAED;;;;;OAKG;IACH,gCAHW,gBAAgB,GACd,OAAO,CAAE,gBAAgB,CAAC,CAuFtC;IAED;;;;;;OAMG;IACH,wBAJW,MAAM,EAAE,aACR,OAAO,GACL,OAAO,CAAE,IAAI,CAAC,CAkB1B;IAED;;;;;OAKG;IACH,qCAHW,eAAe,GACb,OAAO,CAAE,MAAM,EAAE,CAAC,CAS9B;IAED;;;;;OAKG;IACH,0CAHW,OAAO,GACL,OAAO,CAAE,kBAAkB,CAAC,CAqDxC;IAED;;;;;;OAMG;IACH,yBAJW,MAAM,YACN,OAAO,GACL,OAAO,CAAE,OAAO,CAAC,CA8F7B;CA+EJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA/jBwB,mBAAmB"} \ No newline at end of file diff --git a/lib/metadataTypes/TriggeredSend.js b/lib/metadataTypes/TriggeredSend.js index 014fd8ca6..a84ed8d22 100644 --- a/lib/metadataTypes/TriggeredSend.js +++ b/lib/metadataTypes/TriggeredSend.js @@ -268,26 +268,28 @@ class TriggeredSend extends MetadataType { } // sender profile if (metadata.r__senderProfile_key) { - cache.searchForField( + const spId = cache.searchForField( 'senderProfile', metadata.r__senderProfile_key, 'CustomerKey', - 'CustomerKey' + 'ObjectID' ); metadata.SenderProfile = { + ObjectID: spId, CustomerKey: metadata.r__senderProfile_key, }; delete metadata.r__senderProfile_key; } // send classification if (metadata.r__sendClassification_key) { - cache.searchForField( + const scId = cache.searchForField( 'sendClassification', metadata.r__sendClassification_key, 'CustomerKey', - 'CustomerKey' + 'ObjectID' ); metadata.SendClassification = { + ObjectID: scId, CustomerKey: metadata.r__sendClassification_key, }; delete metadata.r__sendClassification_key; diff --git a/lib/metadataTypes/definitions/TriggeredSend.definition.js b/lib/metadataTypes/definitions/TriggeredSend.definition.js index a3e1c533a..d94318ca3 100644 --- a/lib/metadataTypes/definitions/TriggeredSend.definition.js +++ b/lib/metadataTypes/definitions/TriggeredSend.definition.js @@ -434,8 +434,8 @@ export default { templating: true, }, 'SendClassification.ObjectID': { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, templating: false, }, @@ -452,8 +452,8 @@ export default { templating: true, }, 'SenderProfile.ObjectID': { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, templating: false, }, diff --git a/test/resources/9999999/triggeredSendDefinition/create-response.xml b/test/resources/9999999/triggeredSendDefinition/create-response.xml index b4ba29764..165f3ba75 100644 --- a/test/resources/9999999/triggeredSendDefinition/create-response.xml +++ b/test/resources/9999999/triggeredSendDefinition/create-response.xml @@ -42,12 +42,12 @@ 89348 - + 95da425b-a06f-e611-96fe-38eaa7142c61 testExisting_sendClassification - + a75d452b-7ef4-eb11-b82d-48df37d1da95 testExisting_senderProfile unsubscribe diff --git a/test/resources/9999999/triggeredSendDefinition/retrieve-TriggeredSendStatusINNew,Active,Inactive,Moved,Canceled-response.xml b/test/resources/9999999/triggeredSendDefinition/retrieve-TriggeredSendStatusINNew,Active,Inactive,Moved,Canceled-response.xml index 32a1f7bca..5c7a10aaa 100644 --- a/test/resources/9999999/triggeredSendDefinition/retrieve-TriggeredSendStatusINNew,Active,Inactive,Moved,Canceled-response.xml +++ b/test/resources/9999999/triggeredSendDefinition/retrieve-TriggeredSendStatusINNew,Active,Inactive,Moved,Canceled-response.xml @@ -38,12 +38,12 @@ 89348 - + 95da425b-a06f-e611-96fe-38eaa7142c61 testExisting_sendClassification - + a75d452b-7ef4-eb11-b82d-48df37d1da95 testExisting_senderProfile unsubscribe @@ -85,12 +85,12 @@ 89348 - + 95da425b-a06f-e611-96fe-38eaa7142c61 testExisting_sendClassification - + a75d452b-7ef4-eb11-b82d-48df37d1da99 testExisting_senderProfile_rcb %%= ContentBlockByName("Content Builder\dont strip non ssjs content") =%% diff --git a/test/resources/9999999/triggeredSendDefinition/update-response.xml b/test/resources/9999999/triggeredSendDefinition/update-response.xml index f30cf9c50..6d5869954 100644 --- a/test/resources/9999999/triggeredSendDefinition/update-response.xml +++ b/test/resources/9999999/triggeredSendDefinition/update-response.xml @@ -41,12 +41,12 @@ 89348 - + 95da425b-a06f-e611-96fe-38eaa7142c61 testExisting_sendClassification - + a75d452b-7ef4-eb11-b82d-48df37d1da95 testExisting_senderProfile unsubscribe From 6fa11604e2eb559145709a96fc6216b9e38610ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 27 Aug 2024 13:29:45 +0200 Subject: [PATCH 27/43] #1608: get senderProfile by ID instead of by key --- .../metadataTypes/SendClassification.d.ts.map | 2 +- lib/metadataTypes/SendClassification.js | 18 ++++++++++-------- .../SendClassification.definition.js | 6 +++--- .../sendClassification/create-response.xml | 2 +- .../sendClassification/retrieve-response.xml | 4 ++-- .../sendClassification/update-response.xml | 2 +- 6 files changed, 18 insertions(+), 16 deletions(-) diff --git a/@types/lib/metadataTypes/SendClassification.d.ts.map b/@types/lib/metadataTypes/SendClassification.d.ts.map index 7781bd6e8..e068f3b06 100644 --- a/@types/lib/metadataTypes/SendClassification.d.ts.map +++ b/@types/lib/metadataTypes/SendClassification.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"SendClassification.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/SendClassification.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;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,OAAO,CAAE,kBAAkB,CAAC,CAexC;IAED;;;;;OAKG;IACH,4BAHW,gBAAgB,gBAK1B;IAED;;;;;OAKG;IACH,4BAHW,gBAAgB,gBAK1B;IAYD;;;;;OAKG;IACH,gCAHW,gBAAgB,GACd,OAAO,CAAE,gBAAgB,CAAC,CA4BtC;IAED;;;;;OAKG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,CAiC5B;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBArJwB,mBAAmB"} \ No newline at end of file +{"version":3,"file":"SendClassification.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/SendClassification.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;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,OAAO,CAAE,kBAAkB,CAAC,CAexC;IAED;;;;;OAKG;IACH,4BAHW,gBAAgB,gBAK1B;IAED;;;;;OAKG;IACH,4BAHW,gBAAgB,gBAK1B;IAYD;;;;;OAKG;IACH,gCAHW,gBAAgB,GACd,OAAO,CAAE,gBAAgB,CAAC,CA8BtC;IAED;;;;;OAKG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,CAiC5B;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAvJwB,mBAAmB"} \ No newline at end of file diff --git a/lib/metadataTypes/SendClassification.js b/lib/metadataTypes/SendClassification.js index 028f7a592..2f08a566f 100644 --- a/lib/metadataTypes/SendClassification.js +++ b/lib/metadataTypes/SendClassification.js @@ -88,13 +88,15 @@ class SendClassification extends MetadataType { this.definition.sendClassificationTypeMapping[metadata.c__classification]; delete metadata.c__classification; + const spId = cache.searchForField( + 'senderProfile', + metadata.r__senderProfile_key, + 'CustomerKey', + 'ObjectID' + ); metadata.SenderProfile = { - CustomerKey: cache.searchForField( - 'senderProfile', - metadata.r__senderProfile_key, - 'CustomerKey', - 'CustomerKey' - ), + ObjectID: spId, + CustomerKey: metadata.r__senderProfile_key, }; delete metadata.r__senderProfile_key; @@ -127,8 +129,8 @@ class SendClassification extends MetadataType { try { metadata.r__senderProfile_key = cache.searchForField( 'senderProfile', - metadata.SenderProfile.CustomerKey, - 'CustomerKey', + metadata.SenderProfile.ObjectID, + 'ObjectID', 'CustomerKey' ); delete metadata.SenderProfile; diff --git a/lib/metadataTypes/definitions/SendClassification.definition.js b/lib/metadataTypes/definitions/SendClassification.definition.js index 5d0bc486f..b9ba645ea 100644 --- a/lib/metadataTypes/definitions/SendClassification.definition.js +++ b/lib/metadataTypes/definitions/SendClassification.definition.js @@ -133,9 +133,9 @@ export default { template: false, }, 'SenderProfile.ObjectID': { - isCreateable: false, - isUpdateable: false, - retrieving: false, + isCreateable: true, + isUpdateable: true, + retrieving: true, template: false, }, SendPriority: { diff --git a/test/resources/9999999/sendClassification/create-response.xml b/test/resources/9999999/sendClassification/create-response.xml index 6f79d6be5..a6789e5c3 100644 --- a/test/resources/9999999/sendClassification/create-response.xml +++ b/test/resources/9999999/sendClassification/create-response.xml @@ -34,7 +34,7 @@ created on deploy - + a75d452b-7ef4-eb11-b82d-48df37d1da95 testExisting_senderProfile diff --git a/test/resources/9999999/sendClassification/retrieve-response.xml b/test/resources/9999999/sendClassification/retrieve-response.xml index 11e892a2c..198615370 100644 --- a/test/resources/9999999/sendClassification/retrieve-response.xml +++ b/test/resources/9999999/sendClassification/retrieve-response.xml @@ -52,7 +52,7 @@ Default Transactional Send Classification - + 7acfb80f-3550-e611-96fe-38eaa7142c61 Default @@ -72,7 +72,7 @@ - + a75d452b-7ef4-eb11-b82d-48df37d1da95 testExisting_senderProfile diff --git a/test/resources/9999999/sendClassification/update-response.xml b/test/resources/9999999/sendClassification/update-response.xml index 2a8ce0c09..4259753b6 100644 --- a/test/resources/9999999/sendClassification/update-response.xml +++ b/test/resources/9999999/sendClassification/update-response.xml @@ -32,7 +32,7 @@ updated on deploy - + a75d452b-7ef4-eb11-b82d-48df37d1da95 testExisting_senderProfile From 7d718da02ca3d2992fe3cf974226e10d07b48e79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 27 Aug 2024 15:05:45 +0200 Subject: [PATCH 28/43] #0: have CreatedDate and ModifiedDate in deploy response despite those fields not being updatable --- lib/metadataTypes/definitions/DataExtension.definition.js | 8 ++++---- lib/metadataTypes/definitions/EmailSend.definition.js | 8 ++++---- lib/metadataTypes/definitions/Role.definition.js | 8 ++++---- .../definitions/SendClassification.definition.js | 8 ++++---- lib/metadataTypes/definitions/SenderProfile.definition.js | 8 ++++---- lib/metadataTypes/definitions/TriggeredSend.definition.js | 8 ++++---- 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/lib/metadataTypes/definitions/DataExtension.definition.js b/lib/metadataTypes/definitions/DataExtension.definition.js index 314056343..66d56772a 100644 --- a/lib/metadataTypes/definitions/DataExtension.definition.js +++ b/lib/metadataTypes/definitions/DataExtension.definition.js @@ -123,8 +123,8 @@ export default { template: false, }, CreatedDate: { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, template: false, }, @@ -189,8 +189,8 @@ export default { template: true, }, ModifiedDate: { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, template: false, }, diff --git a/lib/metadataTypes/definitions/EmailSend.definition.js b/lib/metadataTypes/definitions/EmailSend.definition.js index 319d587a1..91784d14a 100644 --- a/lib/metadataTypes/definitions/EmailSend.definition.js +++ b/lib/metadataTypes/definitions/EmailSend.definition.js @@ -81,8 +81,8 @@ export default { templating: false, }, CreatedDate: { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, templating: false, }, @@ -333,8 +333,8 @@ export default { templating: false, }, ModifiedDate: { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, templating: false, }, diff --git a/lib/metadataTypes/definitions/Role.definition.js b/lib/metadataTypes/definitions/Role.definition.js index c7bf9de00..070c78152 100644 --- a/lib/metadataTypes/definitions/Role.definition.js +++ b/lib/metadataTypes/definitions/Role.definition.js @@ -32,8 +32,8 @@ export default { typeName: 'Role', fields: { CreatedDate: { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, template: false, }, @@ -50,8 +50,8 @@ export default { template: false, }, ModifiedDate: { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, template: false, }, diff --git a/lib/metadataTypes/definitions/SendClassification.definition.js b/lib/metadataTypes/definitions/SendClassification.definition.js index b9ba645ea..f6564df12 100644 --- a/lib/metadataTypes/definitions/SendClassification.definition.js +++ b/lib/metadataTypes/definitions/SendClassification.definition.js @@ -35,14 +35,14 @@ export default { template: false, }, CreatedDate: { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, template: false, }, ModifiedDate: { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, template: false, }, diff --git a/lib/metadataTypes/definitions/SenderProfile.definition.js b/lib/metadataTypes/definitions/SenderProfile.definition.js index dac7140f6..fc49a1bf2 100644 --- a/lib/metadataTypes/definitions/SenderProfile.definition.js +++ b/lib/metadataTypes/definitions/SenderProfile.definition.js @@ -26,14 +26,14 @@ export default { template: false, }, CreatedDate: { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, template: false, }, ModifiedDate: { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, template: false, }, diff --git a/lib/metadataTypes/definitions/TriggeredSend.definition.js b/lib/metadataTypes/definitions/TriggeredSend.definition.js index d94318ca3..e9367b51f 100644 --- a/lib/metadataTypes/definitions/TriggeredSend.definition.js +++ b/lib/metadataTypes/definitions/TriggeredSend.definition.js @@ -103,8 +103,8 @@ export default { templating: false, }, CreatedDate: { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, templating: false, }, @@ -301,8 +301,8 @@ export default { templating: false, }, ModifiedDate: { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, templating: false, }, From 75b74051617950f0e98b4bef2af0b32595ef5767 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 27 Aug 2024 17:04:57 +0200 Subject: [PATCH 29/43] #1570: fix retrieveAsTemplate event & event test --- lib/metadataTypes/Event.js | 2 +- .../update-callout-afterCreatedViaEvent-expected.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/metadataTypes/Event.js b/lib/metadataTypes/Event.js index 1099052aa..97260bd49 100644 --- a/lib/metadataTypes/Event.js +++ b/lib/metadataTypes/Event.js @@ -100,7 +100,7 @@ class Event extends MetadataType { } else if (event?.length === 1) { const originalKey = event[0][this.definition.keyField]; const metadataItemTemplated = Util.replaceByObject( - this.postRetrieveTasks(event[0]), + await this.postRetrieveTasks(event[0]), templateVariables ); diff --git a/test/resources/9999999/dataExtension/update-callout-afterCreatedViaEvent-expected.xml b/test/resources/9999999/dataExtension/update-callout-afterCreatedViaEvent-expected.xml index b9ba22225..30c4438af 100644 --- a/test/resources/9999999/dataExtension/update-callout-afterCreatedViaEvent-expected.xml +++ b/test/resources/9999999/dataExtension/update-callout-afterCreatedViaEvent-expected.xml @@ -1 +1 @@ -4342972c-a43c-ef11-a5c8-5cba2c702db8testNew_event_withSchematestNew_event_withSchematruefalseContactId_SubscriberKey2
9999999
\ No newline at end of file +2024-07-05T08:01:54.8032024-07-05T08:01:58.9234342972c-a43c-ef11-a5c8-5cba2c702db8testNew_event_withSchematestNew_event_withSchematruefalseContactId_SubscriberKey2
9999999
\ No newline at end of file From 5d6f0b703782e2686a9e4b6a62da9b0148e2c4f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 28 Aug 2024 10:00:18 +0200 Subject: [PATCH 30/43] #1611: allow deleting entire journey by specifying the version with /* --- @types/lib/metadataTypes/Journey.d.ts.map | 2 +- lib/metadataTypes/Journey.js | 26 +++++++++++++---------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/@types/lib/metadataTypes/Journey.d.ts.map b/@types/lib/metadataTypes/Journey.d.ts.map index 50049185a..8a4c82493 100644 --- a/@types/lib/metadataTypes/Journey.d.ts.map +++ b/@types/lib/metadataTypes/Journey.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Journey.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/Journey.js"],"names":[],"mappings":";uBAWa,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;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;;;;;GAQG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,OAAO,CAAE,kBAAkB,CAAC,CA8JxC;IA+ED;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAS1B;IAED;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAK1B;IAmBD;;;;OAIG;IACH,2CAFW,eAAe,iBAmBzB;IAED;;;;;;OAMG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,CA0L5B;IAED;;;;;OAKG;IACH,6CAkaC;IAED;;;;;;OAMG;IACH,gCAHW,gBAAgB,GACd,OAAO,CAAE,gBAAgB,CAAC,CAkJtC;IAED;;;;;OAKG;IACH,0CA6MC;IA4LD;;;;OAIG;IACH,sCAFW,eAAe,iBAWzB;IAED;;;;;OAKG;IACH,uBAHW,MAAM,EAAE,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA3yDwB,mBAAmB"} \ No newline at end of file +{"version":3,"file":"Journey.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/Journey.js"],"names":[],"mappings":";uBAWa,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;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;;;;;GAQG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,OAAO,CAAE,kBAAkB,CAAC,CA8JxC;IAmFD;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAS1B;IAED;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAK1B;IAmBD;;;;OAIG;IACH,2CAFW,eAAe,iBAmBzB;IAED;;;;;;OAMG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,CA0L5B;IAED;;;;;OAKG;IACH,6CAkaC;IAED;;;;;;OAMG;IACH,gCAHW,gBAAgB,GACd,OAAO,CAAE,gBAAgB,CAAC,CAkJtC;IAED;;;;;OAKG;IACH,0CA6MC;IA4LD;;;;OAIG;IACH,sCAFW,eAAe,iBAWzB;IAED;;;;;OAKG;IACH,uBAHW,MAAM,EAAE,GACN,OAAO,CAAE,M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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA/yDwB,mBAAmB"} \ No newline at end of file diff --git a/lib/metadataTypes/Journey.js b/lib/metadataTypes/Journey.js index b310abed6..47d0161c5 100644 --- a/lib/metadataTypes/Journey.js +++ b/lib/metadataTypes/Journey.js @@ -235,7 +235,7 @@ class Journey extends MetadataType { ); const results = this.parseResponseBody(response, key); singleKey = results[key].id; - if (version && version > results[key].version) { + if (version && version !== '*' && version > results[key].version) { Util.logger.error( `The chosen version (${version}) is higher than the latest known version (${results[key].version}). Please choose a lower version.` ); @@ -243,20 +243,24 @@ class Journey extends MetadataType { } Util.logger.debug(`Deleting interaction ${key} via its ID ${singleKey}`); } - if (!/^\d+$/.test(version)) { - Util.logger.error( - 'Version is required for deleting interactions to avoid accidental deletion of the wrong item. Please append it at the end of the key or id, separated by forward-slash. Example for deleting version 4: ' + - key + - '/4' + if (version !== '*') { + if (!/^\d+$/.test(version)) { + Util.logger.error( + 'Version is required for deleting interactions to avoid accidental deletion of the wrong item. Please append it at the end of the key or id, separated by forward-slash. Example for deleting version 4: ' + + key + + '/4' + ); + return false; + } + Util.logger.warn( + `Deleting Journeys via this command breaks following retrieve-by-key/id requests until you've deployed/created a new draft version! You can get still get the latest available version of your journey by retrieving all interactions on this BU.` ); - return false; } - Util.logger.warn( - `Deleting Journeys via this command breaks following retrieve-by-key/id requests until you've deployed/created a new draft version! You can get still get the latest available version of your journey by retrieving all interactions on this BU.` - ); return super.deleteByKeyREST( - '/interaction/v1/interactions/' + singleKey + `?versionNumber=${version}`, + '/interaction/v1/interactions/' + + singleKey + + (version === '*' ? '' : `?versionNumber=${version}`), key, false ); From d2651f1bce52f266098803f57bd75407ef827034 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 28 Aug 2024 10:03:09 +0200 Subject: [PATCH 31/43] #1611: improve test loading logs --- test/resourceFactory.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/resourceFactory.js b/test/resourceFactory.js index fa51a7c7b..6f394a017 100644 --- a/test/resourceFactory.js +++ b/test/resourceFactory.js @@ -334,6 +334,7 @@ export const handleRESTRequest = async (config) => { ); response.items = response.items.filter((def) => def.name == filterName); response.count = response.items.length; + console.log('loading ' + projectRoot + testPathFilter + '.json'); // eslint-disable-line no-console return [200, JSON.stringify(response)]; } else { console.log('loading ' + projectRoot + testPathFilter + '.json'); // eslint-disable-line no-console @@ -345,6 +346,7 @@ export const handleRESTRequest = async (config) => { ]; } } else if (testPathFilter && (await fs.pathExists(testPathFilter + '.txt'))) { + console.log('loading ' + projectRoot + testPathFilter + '.txt'); // eslint-disable-line no-console return [ 200, await fs.readFile(testPathFilter + '.txt', { @@ -360,6 +362,7 @@ export const handleRESTRequest = async (config) => { }), ]; } else if (testPathFilterBody && (await fs.pathExists(testPathFilterBody + '.txt'))) { + console.log('loading ' + projectRoot + testPathFilterBody + '.txt'); // eslint-disable-line no-console return [ 200, await fs.readFile(testPathFilterBody + '.txt', { @@ -400,6 +403,7 @@ export const handleRESTRequest = async (config) => { ); response.items = response.items.filter((def) => def.name == filterName); response.count = response.items.length; + console.log('loading ' + projectRoot + testPath + '.json'); // eslint-disable-line no-console return [200, JSON.stringify(response)]; } else { console.log('loading ' + projectRoot + testPath + '.json'); // eslint-disable-line no-console @@ -434,7 +438,7 @@ export const handleRESTRequest = async (config) => { ); /* eslint-enable no-console */ } - + console.log('loading ' + projectRoot + testPath + '.txt'); // eslint-disable-line no-console return [ 200, await fs.readFile(testPath + '.txt', { From e2f2a7a15c8dca41f9579593de76269c053a1b03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 28 Aug 2024 10:04:49 +0200 Subject: [PATCH 32/43] #1611: add journey test for deleting entire journey --- test/type.journey.test.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/test/type.journey.test.js b/test/type.journey.test.js index 95e4b39b2..3eafc1663 100644 --- a/test/type.journey.test.js +++ b/test/type.journey.test.js @@ -373,7 +373,7 @@ describe('type: journey', () => { return; }); - it('Should delete the item with version', async () => { + it('Should delete the item with exact version', async () => { // WHEN const isDeleted = await handler.deleteByKey( 'testInstance/testBU', @@ -387,7 +387,21 @@ describe('type: journey', () => { return; }); - it('Should delete 2 items with version', async () => { + it('Should delete the item with all versions', async () => { + // WHEN + const isDeleted = await handler.deleteByKey( + 'testInstance/testBU', + 'journey', + 'testExisting_journey_Quicksend/*' + ); + // THEN + assert.equal(process.exitCode, 0, 'delete should not have thrown an error'); + + assert.equal(isDeleted, true, 'should have deleted the item'); + return; + }); + + it('Should delete 2 items with exact version', async () => { // WHEN const isDeleted = await handler.deleteByKey('testInstance/testBU', 'journey', [ 'testExisting_journey_Quicksend/1', From 80e348b755693aa1dd6cdec6f347a585c9a46780 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 20 Aug 2024 10:30:55 +0200 Subject: [PATCH 33/43] #1614: speed up multi-key deletes & equalize delete-errors --- @types/lib/index.d.ts | 4 +-- @types/lib/index.d.ts.map | 2 +- lib/index.js | 51 ++++++++++++++++++------------ lib/metadataTypes/Asset.js | 2 +- lib/metadataTypes/Automation.js | 10 +++--- lib/metadataTypes/DataExtract.js | 2 +- lib/metadataTypes/FileTransfer.js | 2 +- lib/metadataTypes/ImportFile.js | 2 +- lib/metadataTypes/MetadataType.js | 2 +- lib/metadataTypes/MobileKeyword.js | 2 +- lib/metadataTypes/Query.js | 2 +- lib/metadataTypes/Script.js | 2 +- 12 files changed, 47 insertions(+), 36 deletions(-) diff --git a/@types/lib/index.d.ts b/@types/lib/index.d.ts index 496705241..0826b4a74 100644 --- a/@types/lib/index.d.ts +++ b/@types/lib/index.d.ts @@ -171,10 +171,10 @@ declare class Mcdev { * * @param {string} businessUnit references credentials from properties.json * @param {string | TypeKeyCombo} selectedTypes supported metadata type (single) or complex object - * @param {string[] | string} [keyArr] Identifier of metadata + * @param {string[] | string} [keys] Identifier of metadata * @returns {Promise.} true if successful, false otherwise */ - static deleteByKey(businessUnit: string, selectedTypes: string | TypeKeyCombo, keyArr?: string[] | string): Promise; + static deleteByKey(businessUnit: string, selectedTypes: string | TypeKeyCombo, keys?: string[] | string): Promise; /** * get name & key for provided id * diff --git a/@types/lib/index.d.ts.map b/@types/lib/index.d.ts.map index 4adf7cc99..45c0de454 100644 --- a/@types/lib/index.d.ts.map +++ b/@types/lib/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.js"],"names":[],"mappings":";uBAsBa,OAAO,qBAAqB,EAAE,QAAQ;0BACtC,OAAO,qBAAqB,EAAE,WAAW;8BACzC,OAAO,qBAAqB,EAAE,eAAe;2BAC7C,OAAO,qBAAqB,EAAE,YAAY;sBAC1C,OAAO,qBAAqB,EAAE,OAAO;+BACrC,OAAO,qBAAqB,EAAE,gBAAgB;mCAC9C,OAAO,qBAAqB,EAAE,oBAAoB;kCAClD,OAAO,qBAAqB,EAAE,mBAAmB;8BACjD,OAAO,qBAAqB,EAAE,eAAe;iCAC7C,OAAO,qBAAqB,EAAE,kBAAkB;oCAChD,OAAO,qBAAqB,EAAE,qBAAqB;mCACnD,OAAO,qBAAqB,EAAE,oBAAoB;8BAClD,OAAO,qBAAqB,EAAE,eAAe;gCAC7C,OAAO,qBAAqB,EAAE,iBAAiB;0BAC/C,OAAO,qBAAqB,EAAE,WAAW;2BACzC,OAAO,qBAAqB,EAAE,YAAY;0BAC1C,OAAO,qBAAqB,EAAE,WAAW;0CACzC,OAAO,qBAAqB,EAAE,2BAA2B;AAlBtE;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;;GAEG;AACH;IACI;;OAEG;IACH,kBAFa,MAAM,CAKlB;IAED;;;;;OAKG;IACH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AE,MAAM;KAAC,CAAC,CAiF7C;IAED;;;;;;;OAOG;IACH,6BALW,MAAM,iBACN,MAAM,EAAE,GAAG,YAAY,SACvB,MAAM,EAAE,GACN,OAAO,CAAE;YAAQ,MAAM,GAAE,MAAM;KAAC,CAAC,CA0E7C;IAED;;;;;;;;OAQG;IACH,qCANW,SAAS,GAAC,OAAO,GAAC,SAAS,GAAC,SAAS,GAAC,oBAAoB,gBAC1D,MAAM,kBACN,MAAM,EAAE,GAAG,YAAY,SACvB,MAAM,EAAE,GACN,OAAO,CAAE;YAAQ,MAAM,GAAE;gBAAQ,MAAM,GAAE,MAAM,EAAE;SAAC;KAAC,CAAC,CAmMhE;IAED;;;;;;;;;OASG;IACH,mCAPW,SAAS,GAAC,OAAO,GAAC,SAAS,GAAC,SAAS,GAAC,oBAAoB,QAC1D,MAAM,MACN,MAAM,SACN,MAAM,WACN,MAAM,EAAE,GACN,OAAO,CAAE,MAAM,EAAE,CAAC,CAuD9B;IAED;;;;;;OAMG;IACH,kDAJW,MAAM,YACN,QAAQ,GACN,OAAO,CAAE,MAAM,EAAE,CAAC,CA0D9B;IAED;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,OAAO,CAAE,MAAM,EAAE,CAAC,CA0E9B;IAED;;;;;;;;OAQG;IACH,wCANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,OAAO,CAAE,MAAM,EAAE,CAAC,CAyE9B;IAED;;;;;;;OAOG;IACH,yCALW,MAAM,GAAC,MAAM,EAAE,GAAC,SAAS,uBACzB,MAAM,EAAE,cACR,OAAO,GACL,YAAY,CA2ExB;CACJ"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.js"],"names":[],"mappings":";uBAuBa,OAAO,qBAAqB,EAAE,QAAQ;0BACtC,OAAO,qBAAqB,EAAE,WAAW;8BACzC,OAAO,qBAAqB,EAAE,eAAe;2BAC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C,CAuD9B;IAED;;;;;;OAMG;IACH,kDAJW,MAAM,YACN,QAAQ,GACN,OAAO,CAAE,MAAM,EAAE,CAAC,CA0D9B;IAED;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,OAAO,CAAE,MAAM,EAAE,CAAC,CA0E9B;IAED;;;;;;;;OAQG;IACH,wCANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,OAAO,CAAE,MAAM,EAAE,CAAC,CAyE9B;IAED;;;;;;;OAOG;IACH,yCALW,MAAM,GAAC,MAAM,EAAE,GAAC,SAAS,uBACzB,MAAM,EAAE,cACR,OAAO,GACL,YAAY,CA2ExB;CACJ"} \ No newline at end of file diff --git a/lib/index.js b/lib/index.js index 48605dfea..149967da7 100644 --- a/lib/index.js +++ b/lib/index.js @@ -16,6 +16,7 @@ import MetadataTypeDefinitions from './MetadataTypeDefinitions.js'; import Retriever from './Retriever.js'; import cache from './util/cache.js'; import ReplaceContentBlockReference from './util/replaceContentBlockReference.js'; +import pLimit from 'p-limit'; import { confirm } from '@inquirer/prompts'; @@ -597,10 +598,10 @@ class Mcdev { * * @param {string} businessUnit references credentials from properties.json * @param {string | TypeKeyCombo} selectedTypes supported metadata type (single) or complex object - * @param {string[] | string} [keyArr] Identifier of metadata + * @param {string[] | string} [keys] Identifier of metadata * @returns {Promise.} true if successful, false otherwise */ - static async deleteByKey(businessUnit, selectedTypes, keyArr) { + static async deleteByKey(businessUnit, selectedTypes, keys) { Util.startLogger(); Util.logger.info('mcdev:: delete'); @@ -609,8 +610,9 @@ class Mcdev { /** @typedef {TypeKeyCombo} */ let selectedTypesObj; - if ('string' === typeof keyArr) { - keyArr = [keyArr]; + let keyArr; + if ('string' === typeof keys) { + keyArr = [keys]; } if ('string' === typeof selectedTypes) { selectedTypesArr = [selectedTypes]; @@ -647,22 +649,31 @@ class Mcdev { Util.logger.error(`No keys set for ${type}`); return; } - for (const key of keyArr) { - MetadataTypeInfo[type].client = client; - - Util.logger.info( - Util.getGrayMsg(` - Deleting ${type} ${key} on BU ${businessUnit}`) - ); - try { - MetadataTypeInfo[type].properties = properties; - MetadataTypeInfo[type].buObject = buObject; - const result = await MetadataTypeInfo[type].deleteByKey(key); - status &&= result; - } catch (ex) { - Util.logger.errorStack(ex, ` - Deleting ${type} failed`); - status = false; - } - } + MetadataTypeInfo[type].client = client; + MetadataTypeInfo[type].properties = properties; + MetadataTypeInfo[type].buObject = buObject; + const deleteLimit = pLimit(20); + + await Promise.allSettled( + keyArr.map((key) => + deleteLimit(async () => { + // Util.logger.info( + // Util.getGrayMsg(` - Deleting ${type} ${key} on BU ${businessUnit}`) + // ); + try { + const result = await MetadataTypeInfo[type].deleteByKey(key); + status &&= result; + } catch (ex) { + Util.logger.errorStack( + ex, + ` - Deleting ${type} ${key} on BU ${businessUnit} failed` + ); + status = false; + } + return status; + }) + ) + ); } return status; diff --git a/lib/metadataTypes/Asset.js b/lib/metadataTypes/Asset.js index 03d9148dd..283ec4e7b 100644 --- a/lib/metadataTypes/Asset.js +++ b/lib/metadataTypes/Asset.js @@ -2089,7 +2089,7 @@ class Asset extends MetadataType { id = key ? await this._getIdForSingleRetrieve(key) : null; } if (!id) { - Util.logger.error(` - ${this.definition.type} not found`); + Util.logger.error(` - ${this.definition.type} ${key} not found`); return false; } return super.deleteByKeyREST('/asset/v1/content/assets/' + id, key); diff --git a/lib/metadataTypes/Automation.js b/lib/metadataTypes/Automation.js index cde680095..d9cf750b5 100644 --- a/lib/metadataTypes/Automation.js +++ b/lib/metadataTypes/Automation.js @@ -1612,17 +1612,17 @@ class Automation extends MetadataType { /** * Delete a metadata item from the specified business unit * - * @param {string} customerKey Identifier of data extension + * @param {string} key Identifier of data extension * @returns {Promise.} deletion success status */ - static async deleteByKey(customerKey) { + static async deleteByKey(key) { // the delete endpoint returns a general exception if the automation does not exist; handle it gracefully instead by adding a retrieve first - const objectId = customerKey ? await this.#getObjectIdForSingleRetrieve(customerKey) : null; + const objectId = key ? await this.#getObjectIdForSingleRetrieve(key) : null; if (!objectId) { - Util.logger.error(` - automation not found`); + Util.logger.error(` - automation ${key} not found`); return false; } - return super.deleteByKeySOAP(customerKey, 'CustomerKey'); + return super.deleteByKeySOAP(key, 'CustomerKey'); } /** diff --git a/lib/metadataTypes/DataExtract.js b/lib/metadataTypes/DataExtract.js index 898de662a..460187546 100644 --- a/lib/metadataTypes/DataExtract.js +++ b/lib/metadataTypes/DataExtract.js @@ -190,7 +190,7 @@ class DataExtract extends MetadataType { // delete only works with the query's object id const objectId = customerKey ? await this._getObjectIdForSingleRetrieve(customerKey) : null; if (!objectId) { - Util.logger.error(` - dataExtract not found`); + Util.logger.error(` - dataExtract ${customerKey} not found`); return false; } return super.deleteByKeyREST('/automation/v1/dataextracts/' + objectId, customerKey); diff --git a/lib/metadataTypes/FileTransfer.js b/lib/metadataTypes/FileTransfer.js index 8ee9fae5f..00db272c1 100644 --- a/lib/metadataTypes/FileTransfer.js +++ b/lib/metadataTypes/FileTransfer.js @@ -194,7 +194,7 @@ class FileTransfer extends MetadataType { // delete only works with the query's object id const objectId = customerKey ? await this._getObjectIdForSingleRetrieve(customerKey) : null; if (!objectId) { - Util.logger.error(` - fileTransfer not found`); + Util.logger.error(` - fileTransfer ${customerKey} not found`); return false; } return super.deleteByKeyREST('/automation/v1/filetransfers/' + objectId, customerKey); diff --git a/lib/metadataTypes/ImportFile.js b/lib/metadataTypes/ImportFile.js index 508d64dc1..3f6d052e5 100644 --- a/lib/metadataTypes/ImportFile.js +++ b/lib/metadataTypes/ImportFile.js @@ -518,7 +518,7 @@ class ImportFile extends MetadataType { // delete only works with the query's object id const objectId = customerKey ? await this._getObjectIdForSingleRetrieve(customerKey) : null; if (!objectId) { - Util.logger.error(` - import not found`); + Util.logger.error(` - importFile ${customerKey} not found`); return false; } return super.deleteByKeyREST('/automation/v1/imports/' + objectId, customerKey); diff --git a/lib/metadataTypes/MetadataType.js b/lib/metadataTypes/MetadataType.js index 8e29c33ca..5cd01ddad 100644 --- a/lib/metadataTypes/MetadataType.js +++ b/lib/metadataTypes/MetadataType.js @@ -2349,7 +2349,7 @@ class MetadataType { ? `${ex.results[0].StatusMessage} (Code ${ex.results[0].ErrorCode})` : ex.message; Util.logger.error( - `- error deleting ${this.definition.type} '${customerKey}': ${errorMsg}` + ` - Deleting ${this.definition.type} '${customerKey}' failed: ${errorMsg}` ); } diff --git a/lib/metadataTypes/MobileKeyword.js b/lib/metadataTypes/MobileKeyword.js index d9c3e67c0..0445c6266 100644 --- a/lib/metadataTypes/MobileKeyword.js +++ b/lib/metadataTypes/MobileKeyword.js @@ -537,7 +537,7 @@ class MobileKeyword extends MetadataType { // get id from cache const { metadata } = await this.retrieveForCache(undefined, undefined, key); if (!metadata[key]) { - Util.logger.error(`Could not find ${this.definition.type} with key ${key}.`); + Util.logger.error(` - mobileKeyword ${key} not found`); return false; } const id = metadata[key][this.definition.idField]; diff --git a/lib/metadataTypes/Query.js b/lib/metadataTypes/Query.js index 45a2b1f1e..fb60919c7 100644 --- a/lib/metadataTypes/Query.js +++ b/lib/metadataTypes/Query.js @@ -456,7 +456,7 @@ class Query extends MetadataType { // delete only works with the query's object id const objectId = customerKey ? await this._getObjectIdForSingleRetrieve(customerKey) : null; if (!objectId) { - Util.logger.error(` - query not found`); + Util.logger.error(` - query ${customerKey} not found`); return false; } return super.deleteByKeyREST('/automation/v1/queries/' + objectId, customerKey); diff --git a/lib/metadataTypes/Script.js b/lib/metadataTypes/Script.js index b42486779..1db464dfe 100644 --- a/lib/metadataTypes/Script.js +++ b/lib/metadataTypes/Script.js @@ -379,7 +379,7 @@ class Script extends MetadataType { // delete only works with the query's object id const objectId = customerKey ? await this._getObjectIdForSingleRetrieve(customerKey) : null; if (!objectId) { - Util.logger.error(` - ${this.definition.type} not found`); + Util.logger.error(` - ${this.definition.type} ${customerKey} not found`); return false; } return super.deleteByKeyREST('/automation/v1/scripts/' + objectId, customerKey); From ea2b0562603f1f643dfb64b3ab2c741c9b3c3612 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 28 Aug 2024 10:29:45 +0200 Subject: [PATCH 34/43] #1614: fix multi-key deletion using the old command format --- @types/lib/index.d.ts.map | 2 +- lib/index.js | 4 +--- test/general.test.js | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/@types/lib/index.d.ts.map b/@types/lib/index.d.ts.map index 45c0de454..fe777c68e 100644 --- a/@types/lib/index.d.ts.map +++ b/@types/lib/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.js"],"names":[],"mappings":";uBAuBa,OAAO,qBAAqB,EAAE,QAAQ;0BACtC,OAAO,qBAAqB,EAAE,WAAW;8BACzC,OAAO,qBAAqB,EAAE,eAAe;2BAC7C,OAAO,qBAAqB,EAAE,YAAY;sBAC1C,OAAO,qBAAqB,EAAE,OAAO;+BACrC,OAAO,qBAAqB,EAAE,gBAAgB;mCAC9C,OAAO,qBAAqB,EAAE,oBAAoB;kCAClD,OAAO,qBAAqB,EAAE,mBAAmB;8BACjD,OAAO,qBAAqB,EAAE,eAAe;iCAC7C,OAAO,qBAAqB,EAAE,kBAAkB;oCAChD,OAAO,qBAAqB,EAAE,qBAAqB;mCACnD,OAAO,qBAAqB,EAAE,oBAAoB;8BAClD,OAAO,qBAAqB,EAAE,eAAe;gCAC7C,OAAO,qBAAqB,EAAE,iBAAiB;0BAC/C,OAAO,qBAAqB,EAAE,WAAW;2BACzC,OAAO,qBAAqB,EAAE,YAAY;0BAC1C,OAAO,qBAAqB,EAAE,WAAW;0CACzC,OAAO,qBAAqB,EAAE,2BAA2B;AAlBtE;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;;GAEG;AACH;IACI;;OAEG;IACH,kBAFa,MAAM,CAKlB;IAED;;;;;OAKG;IACH,4CAHW,eAAe,GACb,IAAI,CAIhB;IAED;;;;;;;;OAQG;IACH,6B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MAAM,iBACN,MAAM,EAAE,GAAG,YAAY,SACvB,MAAM,EAAE,GACN,OAAO,CAAE;YAAQ,MAAM,GAAE,MAAM;KAAC,CAAC,CA0E7C;IAED;;;;;;;;OAQG;IACH,qCANW,SAAS,GAAC,OAAO,GAAC,SAAS,GAAC,SAAS,GAAC,oBAAoB,gBAC1D,MAAM,kBACN,MAAM,EAAE,GAAG,YAAY,SACvB,MAAM,EAAE,GACN,OAAO,CAAE;YAAQ,MAAM,GAAE;gBAAQ,MAAM,GAAE,MAAM,EAAE;SAAC;KAAC,CAAC,CAmMhE;IAED;;;;;;;;;OASG;IACH,mCAPW,SAAS,GAAC,OAAO,GAAC,SAAS,GAAC,SAAS,GAAC,oBAAoB,QAC1D,MAAM,MACN,MAAM,SACN,MAAM,WACN,MAAM,EAAE,GACN,OAAO,CAAE,MAAM,EAAE,CAAC,CAuD9B;IAED;;;;;;OAMG;IACH,kDAJW,MAAM,YACN,QAAQ,GACN,OAAO,CAAE,MAAM,EAAE,CAAC,CA0D9B;IAED;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,OAAO,CAAE,MAAM,EAAE,CAAC,CA0E9B;IAED;;;;;;;;OAQG;IACH,wCANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,OAAO,CAAE,MAAM,EAAE,CAAC,CAyE9B;IAED;;;;;;;OAOG;IACH,yCALW,MAAM,GAAC,MAAM,EAAE,GAAC,SAAS,uBACzB,MAAM,EAAE,cACR,OAAO,GACL,YAAY,CA2ExB;CACJ"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.js"],"names":[],"mappings":";uBAuBa,OAAO,qBAAqB,EAAE,QAAQ;0BACtC,OAAO,qBAAqB,EAAE,WAAW;8BACzC,OAAO,qBAAqB,EAAE,eAAe;2BAC7C,OAAO,qBAAqB,EAAE,YAAY;sBAC1C,OAAO,qBAAqB,EAAE,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ACN,OAAO,CAAE,MAAM,EAAE,CAAC,CA0D9B;IAED;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,OAAO,CAAE,MAAM,EAAE,CAAC,CA0E9B;IAED;;;;;;;;OAQG;IACH,wCANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,OAAO,CAAE,MAAM,EAAE,CAAC,CAyE9B;IAED;;;;;;;OAOG;IACH,yCALW,MAAM,GAAC,MAAM,EAAE,GAAC,SAAS,uBACzB,MAAM,EAAE,cACR,OAAO,GACL,YAAY,CA2ExB;CACJ"} \ No newline at end of file diff --git a/lib/index.js b/lib/index.js index 149967da7..e44d95e3e 100644 --- a/lib/index.js +++ b/lib/index.js @@ -611,9 +611,7 @@ class Mcdev { /** @typedef {TypeKeyCombo} */ let selectedTypesObj; let keyArr; - if ('string' === typeof keys) { - keyArr = [keys]; - } + keyArr = 'string' === typeof keys ? [keys] : keys; if ('string' === typeof selectedTypes) { selectedTypesArr = [selectedTypes]; } else { diff --git a/test/general.test.js b/test/general.test.js index c6ebe7cdf..8e197bdd2 100644 --- a/test/general.test.js +++ b/test/general.test.js @@ -2047,7 +2047,7 @@ describe('GENERAL', () => { }); describe('Delete --metadata ~~~', () => { - it('Should delete the item', async () => { + it('Should delete the items', async () => { const argvMetadata = [ 'asset:testExisting_asset', 'automation:testExisting_automation', From 9d895c4b614aa18bbc9c4d91148f50142e36c186 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 27 Aug 2024 15:05:45 +0200 Subject: [PATCH 35/43] #1616: have CreatedDate and ModifiedDate in deploy response despite those fields not being updatable --- lib/metadataTypes/definitions/DataExtension.definition.js | 8 ++++---- lib/metadataTypes/definitions/EmailSend.definition.js | 8 ++++---- lib/metadataTypes/definitions/Role.definition.js | 8 ++++---- .../definitions/SendClassification.definition.js | 8 ++++---- lib/metadataTypes/definitions/SenderProfile.definition.js | 8 ++++---- lib/metadataTypes/definitions/TriggeredSend.definition.js | 8 ++++---- 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/lib/metadataTypes/definitions/DataExtension.definition.js b/lib/metadataTypes/definitions/DataExtension.definition.js index 314056343..66d56772a 100644 --- a/lib/metadataTypes/definitions/DataExtension.definition.js +++ b/lib/metadataTypes/definitions/DataExtension.definition.js @@ -123,8 +123,8 @@ export default { template: false, }, CreatedDate: { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, template: false, }, @@ -189,8 +189,8 @@ export default { template: true, }, ModifiedDate: { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, template: false, }, diff --git a/lib/metadataTypes/definitions/EmailSend.definition.js b/lib/metadataTypes/definitions/EmailSend.definition.js index 319d587a1..91784d14a 100644 --- a/lib/metadataTypes/definitions/EmailSend.definition.js +++ b/lib/metadataTypes/definitions/EmailSend.definition.js @@ -81,8 +81,8 @@ export default { templating: false, }, CreatedDate: { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, templating: false, }, @@ -333,8 +333,8 @@ export default { templating: false, }, ModifiedDate: { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, templating: false, }, diff --git a/lib/metadataTypes/definitions/Role.definition.js b/lib/metadataTypes/definitions/Role.definition.js index c7bf9de00..070c78152 100644 --- a/lib/metadataTypes/definitions/Role.definition.js +++ b/lib/metadataTypes/definitions/Role.definition.js @@ -32,8 +32,8 @@ export default { typeName: 'Role', fields: { CreatedDate: { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, template: false, }, @@ -50,8 +50,8 @@ export default { template: false, }, ModifiedDate: { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, template: false, }, diff --git a/lib/metadataTypes/definitions/SendClassification.definition.js b/lib/metadataTypes/definitions/SendClassification.definition.js index b9ba645ea..f6564df12 100644 --- a/lib/metadataTypes/definitions/SendClassification.definition.js +++ b/lib/metadataTypes/definitions/SendClassification.definition.js @@ -35,14 +35,14 @@ export default { template: false, }, CreatedDate: { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, template: false, }, ModifiedDate: { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, template: false, }, diff --git a/lib/metadataTypes/definitions/SenderProfile.definition.js b/lib/metadataTypes/definitions/SenderProfile.definition.js index dac7140f6..fc49a1bf2 100644 --- a/lib/metadataTypes/definitions/SenderProfile.definition.js +++ b/lib/metadataTypes/definitions/SenderProfile.definition.js @@ -26,14 +26,14 @@ export default { template: false, }, CreatedDate: { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, template: false, }, ModifiedDate: { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, template: false, }, diff --git a/lib/metadataTypes/definitions/TriggeredSend.definition.js b/lib/metadataTypes/definitions/TriggeredSend.definition.js index d94318ca3..e9367b51f 100644 --- a/lib/metadataTypes/definitions/TriggeredSend.definition.js +++ b/lib/metadataTypes/definitions/TriggeredSend.definition.js @@ -103,8 +103,8 @@ export default { templating: false, }, CreatedDate: { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, templating: false, }, @@ -301,8 +301,8 @@ export default { templating: false, }, ModifiedDate: { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, templating: false, }, From ff53b0f32f1a6df50a0aa553c534a309cdf1948b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 28 Aug 2024 10:48:10 +0200 Subject: [PATCH 36/43] #1616: fix event test --- .../update-callout-afterCreatedViaEvent-expected.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/resources/9999999/dataExtension/update-callout-afterCreatedViaEvent-expected.xml b/test/resources/9999999/dataExtension/update-callout-afterCreatedViaEvent-expected.xml index b9ba22225..30c4438af 100644 --- a/test/resources/9999999/dataExtension/update-callout-afterCreatedViaEvent-expected.xml +++ b/test/resources/9999999/dataExtension/update-callout-afterCreatedViaEvent-expected.xml @@ -1 +1 @@ -4342972c-a43c-ef11-a5c8-5cba2c702db8testNew_event_withSchematestNew_event_withSchematruefalseContactId_SubscriberKey2
9999999
\ No newline at end of file +2024-07-05T08:01:54.8032024-07-05T08:01:58.9234342972c-a43c-ef11-a5c8-5cba2c702db8testNew_event_withSchematestNew_event_withSchematruefalseContactId_SubscriberKey2
9999999
\ No newline at end of file From 9571fca8f120ed6b0fa0e80d02deca98f105337e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 28 Aug 2024 16:08:48 +0200 Subject: [PATCH 37/43] #1020: pause journey and stop journey features added --- @types/lib/index.d.ts | 21 ++++- @types/lib/index.d.ts.map | 2 +- @types/lib/metadataTypes/Journey.d.ts.map | 2 +- @types/lib/metadataTypes/MetadataType.d.ts | 7 ++ .../lib/metadataTypes/MetadataType.d.ts.map | 2 +- lib/cli.js | 48 ++++++++++ lib/index.js | 23 ++++- lib/metadataTypes/Journey.js | 91 +++++++++++++++++++ lib/metadataTypes/MetadataType.js | 13 +++ 9 files changed, 200 insertions(+), 9 deletions(-) diff --git a/@types/lib/index.d.ts b/@types/lib/index.d.ts index 0826b4a74..a5af89e72 100644 --- a/@types/lib/index.d.ts +++ b/@types/lib/index.d.ts @@ -345,6 +345,19 @@ declare class Mcdev { [x: string]: string[]; }; }>; + /** + * stop an item + * + * @param {string} businessUnit name of BU + * @param {string[] | TypeKeyCombo} [selectedTypes] limit to given metadata types + * @param {string[]} [keys] customerkey of the metadata + * @returns {Promise.>>} key: business unit name, key2: type, value: list of affected item keys + */ + static stop(businessUnit: string, selectedTypes?: string[] | TypeKeyCombo, keys?: string[]): Promise<{ + [x: string]: { + [x: string]: string[]; + }; + }>; /** * Updates the key to match the name field * @@ -371,13 +384,13 @@ declare class Mcdev { /** * run a method across BUs * - * @param {'execute'|'pause'|'publish'|'fixKeys'|'replaceCbReference'} methodName what to run + * @param {'execute'|'pause'|'stop'|'publish'|'fixKeys'|'replaceCbReference'} methodName what to run * @param {string} businessUnit name of BU * @param {string[] | TypeKeyCombo} [selectedTypes] limit to given metadata types * @param {string[]} [keys] customerkey of the metadata * @returns {Promise.>>} key: business unit name, key2: type, value: list of affected item keys */ - static "__#8@#runMethod"(methodName: "execute" | "pause" | "publish" | "fixKeys" | "replaceCbReference", businessUnit: string, selectedTypes?: string[] | TypeKeyCombo, keys?: string[]): Promise<{ + static "__#8@#runMethod"(methodName: "execute" | "pause" | "stop" | "publish" | "fixKeys" | "replaceCbReference", businessUnit: string, selectedTypes?: string[] | TypeKeyCombo, keys?: string[]): Promise<{ [x: string]: { [x: string]: string[]; }; @@ -385,14 +398,14 @@ declare class Mcdev { /** * helper for Mcdev.#runMethod * - * @param {'execute'|'pause'|'publish'|'fixKeys'|'replaceCbReference'} methodName what to run + * @param {'execute'|'pause'|'stop'|'publish'|'fixKeys'|'replaceCbReference'} methodName what to run * @param {string} cred name of Credential * @param {string} bu name of BU * @param {string} [type] limit execution to given metadata type * @param {string[]} [keyArr] customerkey of the metadata * @returns {Promise.} list of keys that were affected */ - static "__#8@#runOnBU"(methodName: "execute" | "pause" | "publish" | "fixKeys" | "replaceCbReference", cred: string, bu: string, type?: string, keyArr?: string[]): Promise; + static "__#8@#runOnBU"(methodName: "execute" | "pause" | "stop" | "publish" | "fixKeys" | "replaceCbReference", cred: string, bu: string, type?: string, keyArr?: string[]): Promise; /** * helper for Mcdev.#runOnBU * diff --git a/@types/lib/index.d.ts.map b/@types/lib/index.d.ts.map index fe777c68e..de3d790b9 100644 --- a/@types/lib/index.d.ts.map +++ b/@types/lib/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../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C,OAAO,GAAC,SAAS,GAAC,SAAS,GAAC,oBAAoB,QAC1D,MAAM,MACN,MAAM,SACN,MAAM,WACN,MAAM,EAAE,GACN,OAAO,CAAE,MAAM,EAAE,CAAC,CAuD9B;IAED;;;;;;OAMG;IACH,kDAJW,MAAM,YACN,QAAQ,GACN,OAAO,CAAE,MAAM,EAAE,CAAC,CA0D9B;IAED;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,OAAO,CAAE,MAAM,EAAE,CAAC,CA0E9B;IAED;;;;;;;;OAQG;IACH,wCANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,OAAO,CAAE,MAAM,EAAE,CAAC,CAyE9B;IAED;;;;;;;OAOG;IACH,yCALW,MAAM,GAAC,MAAM,EAAE,GAAC,SAAS,uBACzB,MAAM,EAAE,cACR,OAAO,GACL,YAAY,CA2ExB;CACJ"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.js"],"names":[],"mappings":";uBAuBa,OAAO,qBAAqB,EAAE,QAAQ;0BACtC,OAAO,qBAAqB,EAAE,WAAW;8BACzC,OAAO,qBAAqB,EAAE,eAAe;2BAC7C,OAAO,qBAAqB,EAAE,YAAY;sBAC1C,OAAO,qBAAqB,EAAE,OAAO;+BACrC,OAAO,qBAAqB,EAAE,gBAAgB;mCAC9C,OAAO,qBAAqB,EAAE,oBAAoB;kCAClD,OAAO,qBAAqB,EAAE,mBAAmB;8BACjD,OAAO,qBAAqB,EAAE,eAAe;iCAC7C,OAAO,qBAAqB,EAAE,kBAAkB;oCAChD,OAAO,qBAAqB,EAAE,qBAAqB;mCACnD,OAAO,qBAAqB,EAAE,oBAAoB;8BAClD,OAAO,qBAAqB,EAAE,eAAe;gCAC7C,OAAO,qBAAqB,EAAE,iBAAiB;0BAC/C,OAAO,qBAAqB,EAAE,WAAW;2BACzC,OAAO,qBAAqB,EAAE,YAAY;0BA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AM,QACN,MAAM,WACN,MAAM,EAAE,GACN,OAAO,CAAE,MAAM,EAAE,CAAC,CAyE9B;IAED;;;;;;;OAOG;IACH,yCALW,MAAM,GAAC,MAAM,EAAE,GAAC,SAAS,uBACzB,MAAM,EAAE,cACR,OAAO,GACL,YAAY,CA2ExB;CACJ"} \ No newline at end of file diff --git a/@types/lib/metadataTypes/Journey.d.ts.map b/@types/lib/metadataTypes/Journey.d.ts.map index 8a4c82493..c123d03ec 100644 --- a/@types/lib/metadataTypes/Journey.d.ts.map +++ b/@types/lib/metadataTypes/Journey.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Journey.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/Journey.js"],"names":[],"mappings":";uBAWa,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;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;;;;;GAQG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,OAAO,CAAE,kBAAkB,CAAC,CA8JxC;IAmFD;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAS1B;IAED;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAK1B;IAmBD;;;;OAIG;IACH,2CAFW,eAAe,iBAmBzB;IAED;;;;;;OAMG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,CA0L5B;IAED;;;;;OAKG;IACH,6CAkaC;IAED;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA/yDwB,mBAAmB"} \ No newline at end of file +{"version":3,"file":"Journey.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/Journey.js"],"names":[],"mappings":";uBAYa,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;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;;;;;GAQG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,OAAO,CAAE,kBAAkB,CAAC,CA8JxC;IAmFD;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAS1B;IAED;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAK1B;IAmBD;;;;OAIG;IACH,2CAFW,eAAe,iBAmBzB;IAED;;;;;;OAMG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,CA0L5B;IAED;;;;;OAKG;IACH,6CAkaC;IAED;;;;;;OAMG;IACH,gCAH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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA14DwB,mBAAmB"} \ No newline at end of file diff --git a/@types/lib/metadataTypes/MetadataType.d.ts b/@types/lib/metadataTypes/MetadataType.d.ts index e3e33bd6e..d73640f5c 100644 --- a/@types/lib/metadataTypes/MetadataType.d.ts +++ b/@types/lib/metadataTypes/MetadataType.d.ts @@ -237,6 +237,13 @@ declare class MetadataType { * @returns {Promise.} Returns list of keys that were paused */ static pause(keyArr: string[]): Promise; + /** + * Abstract stop method that needs to be implemented in child metadata type + * + * @param {string[]} keyArr customerkey of the metadata + * @returns {Promise.} Returns list of keys that were stopped + */ + static stop(keyArr: string[]): Promise; /** * test if metadata was actually changed or not to potentially skip it during deployment * diff --git a/@types/lib/metadataTypes/MetadataType.d.ts.map b/@types/lib/metadataTypes/MetadataType.d.ts.map index 90e2ff5ad..e9e533534 100644 --- a/@types/lib/metadataTypes/MetadataType.d.ts.map +++ b/@types/lib/metadataTypes/MetadataType.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"MetadataType.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/MetadataType.js"],"names":[],"mappings":";uBAkBa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;sBAChD,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACp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AAM,EAAE,CAAC,CAa9B;IAED;;;;;;;OAOG;IACH,iCANW,MAAM,EAAE,qBACR,YAAY,iBACZ,YAAY,gBACZ,OAAO,GACL,OAAO,CAAE,YAAY,CAAC,CAoHlC;IAED;;;;;OAKG;IACH,4CAHW,MAAM,yBACN,YAAY,QAE8C;IAErE;;;;;;;OAOG;IACH,2BALW,gBAAgB,aAChB,MAAM,iBACN,MAAM,GACJ,CAAC,MAAM,CAAC,EAAE,CAUtB;IAED;;;;;;;OAOG;IACH,iCALW,GAAG,kBACH,MAAM,EAAE,iBACR,MAAM,GACJ,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAkBjC;IAED;;;;OAIG;IACH,qCAHW,eAAe,GACb,MAAM,EAAE,CAwDpB;IAED;;;;;;;OAOG;IACH,4BALW,MAAM,gBACN,gBAAgB,gBAChB,MAAM,GACJ,MAAM,CAelB;CACJ;;;;;;;;;;;;gBAaS,GAAG;oBAIH,OAAO;iBAIP,MAAM;kBAIN,QAAQ"} \ No newline at end of file +{"version":3,"file":"MetadataType.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/MetadataType.js"],"names":[],"mappings":";uBAkBa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;sBAChD,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;gCACtD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY;kBAC7C,OAAO,UAAU,EAAE,OAAO;uBAC1B,OAAO,w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M,yBACN,YAAY,QAE8C;IAErE;;;;;;;OAOG;IACH,2BALW,gBAAgB,aAChB,MAAM,iBACN,MAAM,GACJ,CAAC,MAAM,CAAC,EAAE,CAUtB;IAED;;;;;;;OAOG;IACH,iCALW,GAAG,kBACH,MAAM,EAAE,iBACR,MAAM,GACJ,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAkBjC;IAED;;;;OAIG;IACH,qCAHW,eAAe,GACb,MAAM,EAAE,CAwDpB;IAED;;;;;;;OAOG;IACH,4BALW,MAAM,gBACN,gBAAgB,gBAChB,MAAM,GACJ,MAAM,CAelB;CACJ;;;;;;;;;;;;gBAaS,GAAG;oBAIH,OAAO;iBAIP,MAAM;kBAIN,QAAQ"} \ No newline at end of file diff --git a/lib/cli.js b/lib/cli.js index f4d35b420..1206fbd2c 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -860,6 +860,54 @@ yargs(hideBin(process.argv)) } } ) + .command( + ['stop [TYPE] [KEY]', 'p'], + 'stops the entity (journey etc.)', + (yargs) => + yargs + .positional('BU', { + type: 'string', + describe: 'the business unit where to start an item', + }) + .positional('TYPE', { + type: 'string', + describe: 'metadata type', + }) + .positional('KEY', { + type: 'string', + describe: 'key(s) of the metadata component(s)', + }) + .option('metadata', { + type: 'string', + array: true, + alias: 'm', + group: 'Options for pause:', + describe: 'type or type:key or type:i:id or type:n:name to fix', + }) + .option('like', { + type: 'string', + group: 'Options for pause:', + describe: + 'filter metadata components (can include % as wildcard or _ for a single character)', + }) + .check((argv) => { + if (!argv.TYPE && !argv.metadata) { + throw new Error( + 'Error: Either specify the metadata type after the BU or use --metadata' + ); + } + return true; + }), + (argv) => { + Mcdev.setOptions(argv); + const typeKeyCombo = Mcdev.metadataToTypeKey(argv.metadata); + if ('undefined' === typeof typeKeyCombo) { + Mcdev.stop(argv.BU, csvToArray(argv.TYPE), csvToArray(argv.KEY)); + } else { + Mcdev.stop(argv.BU, typeKeyCombo); + } + } + ) .command( ['fixKeys [TYPE] [KEY]', 'fx'], 'changes the key of the items to match the name', diff --git a/lib/index.js b/lib/index.js index e44d95e3e..b74e3e363 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1398,6 +1398,18 @@ class Mcdev { return this.#runMethod('pause', businessUnit, selectedTypes, keys); } + /** + * stop an item + * + * @param {string} businessUnit name of BU + * @param {string[] | TypeKeyCombo} [selectedTypes] limit to given metadata types + * @param {string[]} [keys] customerkey of the metadata + * @returns {Promise.>>} key: business unit name, key2: type, value: list of affected item keys + */ + static async stop(businessUnit, selectedTypes, keys) { + return this.#runMethod('stop', businessUnit, selectedTypes, keys); + } + /** * Updates the key to match the name field * @@ -1573,7 +1585,7 @@ class Mcdev { /** * run a method across BUs * - * @param {'execute'|'pause'|'publish'|'fixKeys'|'replaceCbReference'} methodName what to run + * @param {'execute'|'pause'|'stop'|'publish'|'fixKeys'|'replaceCbReference'} methodName what to run * @param {string} businessUnit name of BU * @param {string[] | TypeKeyCombo} [selectedTypes] limit to given metadata types * @param {string[]} [keys] customerkey of the metadata @@ -1603,6 +1615,13 @@ class Mcdev { checkMetadataSupport = true; break; } + case 'stop': { + lang_past = 'stopped'; + lang_present = 'stopping'; + requireKeyOrLike = true; + checkMetadataSupport = true; + break; + } case 'publish': { lang_past = 'published'; lang_present = 'publishing'; @@ -1777,7 +1796,7 @@ class Mcdev { /** * helper for Mcdev.#runMethod * - * @param {'execute'|'pause'|'publish'|'fixKeys'|'replaceCbReference'} methodName what to run + * @param {'execute'|'pause'|'stop'|'publish'|'fixKeys'|'replaceCbReference'} methodName what to run * @param {string} cred name of Credential * @param {string} bu name of BU * @param {string} [type] limit execution to given metadata type diff --git a/lib/metadataTypes/Journey.js b/lib/metadataTypes/Journey.js index 47d0161c5..c957551c4 100644 --- a/lib/metadataTypes/Journey.js +++ b/lib/metadataTypes/Journey.js @@ -7,6 +7,7 @@ import cache from '../util/cache.js'; import File from '../util/file.js'; import ReplaceCbReference from '../util/replaceContentBlockReference.js'; import Retriever from '../Retriever.js'; +import pLimit from 'p-limit'; /** * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject @@ -1839,6 +1840,96 @@ class Journey extends MetadataType { Util.logger.warn(' ' + msg); } } + /** + * stops latest journey version + * + * @param {string[]} keyArr customerkey of the metadata + * @returns {Promise.} Returns list of keys that were paused + */ + static async stop(keyArr) { + let version; + const endpoint = '/interaction/v1/interactions/stop/'; + const stoppedKeyArr = []; + const apiLimit = pLimit(20); + const journeyCache = await this.retrieveForCache(); + + await Promise.allSettled( + keyArr.map((key) => + apiLimit(async () => { + [key, version] = key.split('/'); + if (journeyCache.metadata[key]) { + version ||= journeyCache.metadata[key].version; + if (version === '*') { + Util.logger.warn( + ` ☇ skipping ${this.definition.type} ${key}: Cannot stop all versions at once. The highest version is ${journeyCache.metadata[key].version}` + ); + return; + } + try { + await this.client.rest.post( + endpoint + + journeyCache.metadata[key].id + + `?versionNumber=${version}`, + {} + ); + Util.logger.info( + ` - Stopped ${this.definition.type} ${key}/${version}` + ); + stoppedKeyArr.push(key); + } catch (ex) { + Util.logger.error( + ` - Stopping ${this.definition.type} ${key} failed: ${ex.message}` + ); + } + } + }) + ) + ); + + return stoppedKeyArr; + } + /** + * pauses all journey versions + * + * @param {string[]} keyArr customerkey of the metadata + * @returns {Promise.} Returns list of keys that were paused + */ + static async pause(keyArr) { + let version; + const endpoint = '/interaction/v1/interactions/pause/'; + const stoppedKeyArr = []; + const apiLimit = pLimit(20); + const journeyCache = await this.retrieveForCache(); + + await Promise.allSettled( + keyArr.map((key) => + apiLimit(async () => { + [key, version] = key.split('/'); + if (journeyCache.metadata[key]) { + version ||= journeyCache.metadata[key].version; + try { + await this.client.rest.post( + endpoint + + journeyCache.metadata[key].id + + (version === '*' + ? '?allVersions=true' + : `?versionNumber=${version}`), + {} + ); + Util.logger.info(` - Paused ${this.definition.type} ${key}/${version}`); + stoppedKeyArr.push(key); + } catch (ex) { + Util.logger.error( + ` - Pausing ${this.definition.type} ${key} failed: ${ex.message}` + ); + } + } + }) + ) + ); + + return stoppedKeyArr; + } } // Assign definition to static attributes diff --git a/lib/metadataTypes/MetadataType.js b/lib/metadataTypes/MetadataType.js index 5cd01ddad..6e9b75fe9 100644 --- a/lib/metadataTypes/MetadataType.js +++ b/lib/metadataTypes/MetadataType.js @@ -622,6 +622,19 @@ class MetadataType { return []; } + /** + * Abstract stop method that needs to be implemented in child metadata type + * + * @param {string[]} keyArr customerkey of the metadata + * @returns {Promise.} Returns list of keys that were stopped + */ + static async stop(keyArr) { + Util.logger.error( + ` ☇ skipping ${this.definition.type}: stop is not supported yet for ${this.definition.type}` + ); + return []; + } + /** * test if metadata was actually changed or not to potentially skip it during deployment * From d6be62bbdf96f20da8fffd78311569a5a334510e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 28 Aug 2024 23:21:42 +0200 Subject: [PATCH 38/43] #1619: allow using "name:" for buildTemplate and build --- @types/lib/index.d.ts.map | 2 +- lib/index.js | 50 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) diff --git a/@types/lib/index.d.ts.map b/@types/lib/index.d.ts.map index de3d790b9..779755ef8 100644 --- a/@types/lib/index.d.ts.map +++ b/@types/lib/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.js"],"names":[],"mappings":";uBAuBa,OAAO,qBAAqB,EAAE,QAAQ;0BACtC,OAAO,qBAAqB,EAAE,WAAW;8BACzC,OAAO,qBAAqB,EAAE,eAAe;2BAC7C,OAAO,qBAAqB,EAAE,YAAY;sBAC1C,OAAO,qBAAqB,EAAE,OAAO;+BACrC,OAAO,qBAAqB,EAAE,gBAAgB;mCAC9C,OAAO,qBAAqB,EAAE,oBAAoB;kCAClD,OAAO,qBAAqB,EAAE,mBAAmB;8BACjD,OAAO,qBAAqB,EAAE,eAAe;iCAC7C,OAAO,qBAAqB,EAAE,kBAAkB;oCAChD,OAAO,qBA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AAO,CAAE,MAAM,EAAE,CAAC,CA0D9B;IAED;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,OAAO,CAAE,MAAM,EAAE,CAAC,CA0E9B;IAED;;;;;;;;OAQG;IACH,wCANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,OAAO,CAAE,MAAM,EAAE,CAAC,CAyE9B;IAED;;;;;;;OAOG;IACH,yCALW,MAAM,GAAC,MAAM,EAAE,GAAC,SAAS,uBACzB,MAAM,EAAE,cACR,OAAO,GACL,YAAY,CA2ExB;CACJ"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.js"],"names":[],"mappings":";uBAwBa,OAAO,qBAAqB,EAAE,QAAQ;0BACtC,OAAO,qBAAqB,EAAE,WAAW;8BACzC,OAAO,qBAAqB,EAAE,eAAe;2BAC7C,OAAO,qBAAqB,EAAE,YAAY;sBAC1C,OAAO,qBAAqB,EAAE,OAAO;+BACrC,OAAO,qBAAqB,EAAE,gBAAgB;mCAC9C,OAAO,qBAAqB,EAAE,oBAAoB;kCAClD,OAAO,qBAAqB,EAAE,mBAAmB;8BACjD,OAAO,qBAAqB,EAAE,eAAe;iCAC7C,OAAO,qBAAqB,EAAE,kBAAkB;oCAChD,OAAO,qBAAqB,EAAE,qBAAqB;mCACnD,OAAO,qBAAqB,EAAE,oBAAoB;8BAClD,OAAO,qBAAqB,EAAE,eAAe;gCAC7C,OAAO,qBAAqB,EAAE,iBAAiB;0BAC/C,OAAO,qBAAqB,EAAE,WAAW;2BACzC,OAAO,qBAAqB,EAAE,YAAY;0BAC1C,OAAO,qBAAqB,EAAE,WAAW;0CACzC,OAAO,qBAAqB,EAAE,2BAA2B;AAlBtE;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;;GAEG;AACH;IACI;;OAEG;IACH,kBAFa,MAAM,CAKlB;IAED;;;;;OAKG;IACH,4CAHW,eAAe,G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} \ No newline at end of file diff --git a/lib/index.js b/lib/index.js index b74e3e363..203c4b559 100644 --- a/lib/index.js +++ b/lib/index.js @@ -17,6 +17,7 @@ import Retriever from './Retriever.js'; import cache from './util/cache.js'; import ReplaceContentBlockReference from './util/replaceContentBlockReference.js'; import pLimit from 'p-limit'; +import path from 'node:path'; import { confirm } from '@inquirer/prompts'; @@ -1151,6 +1152,7 @@ class Mcdev { Util.startLogger(); Util.logger.info('mcdev:: Build Template from retrieved files'); const properties = await config.getProperties(); + const buObject = await Cli.getCredentialObject(properties, businessUnit); if (!Util.checkMarket(market, properties)) { return; } @@ -1172,6 +1174,54 @@ class Mcdev { if (!Util.OPTIONS.dependencies) { await this._reRetrieve(businessUnit, false, selectedTypes); } + // convert names to keys + const retrieveDir = File.normalizePath([ + properties.directories.retrieve, + buObject.credential, + buObject.businessUnit, + ]); + for (const type of Object.keys(selectedTypes)) { + const keyArr = selectedTypes[type]; + if (keyArr.some((key) => key.startsWith('name:'))) { + // at least one key was provided as a name -> load all files from disk to try and find that key + const builTemplateCache = Object.values( + await MetadataTypeInfo[type].getJsonFromFS(retrieveDir + path.sep + type) + ); + selectedTypes[type] = keyArr + .map((key) => { + if (key.startsWith('name:')) { + // key was defined by name. try and find matching item on disk + const name = key.slice(5); + const foundKeysByName = builTemplateCache + .filter( + (item) => + name == item[MetadataTypeInfo[type].definition.nameField] + ) + .map((item) => item[MetadataTypeInfo[type].definition.keyField]); + if (foundKeysByName.length === 1) { + key = foundKeysByName[0]; + Util.logger.debug( + `- found ${type} key '${key}' for name '${name}'` + ); + return key; + } else if (foundKeysByName.length > 1) { + Util.logger.error( + `Found multiple keys (${foundKeysByName.join(', ')}) for given name ${key}` + ); + return; + } else { + Util.logger.error( + `Could not find any keys for given name: ${name}` + ); + return; + } + } else { + return key; + } + }) + .filter(Boolean); + } + } // if dependencies are enabled, we need to search for them and add them to our await this.addDependencies(businessUnit, selectedTypes); From 6e181535db43717781a10a075a94e873dac386b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 28 Aug 2024 23:52:13 +0200 Subject: [PATCH 39/43] #1619: improved logs --- @types/lib/index.d.ts.map | 2 +- lib/index.js | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/@types/lib/index.d.ts.map b/@types/lib/index.d.ts.map index 779755ef8..2da907b82 100644 --- a/@types/lib/index.d.ts.map +++ b/@types/lib/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.js"],"names":[],"mappings":";uBAwBa,OAAO,qBAAqB,EAAE,QAAQ;0BACtC,OAAO,qBAAqB,EAAE,WAAW;8BACzC,OAAO,qBAAqB,EAAE,eAAe;2BAC7C,OAAO,qBAAqB,EAAE,YAAY;sBAC1C,OAAO,qBAAqB,EAAE,OAAO;+BACrC,OAAO,qBAAqB,EAAE,gBAAgB;mCAC9C,OAAO,qBAAqB,EAAE,oBAAoB;kCAClD,OAAO,qBAAqB,EAAE,mBAAmB;8BACjD,OAAO,qBAAqB,EAAE,eAAe;iCAC7C,OAAO,qBAAqB,EAAE,kBAAkB;oCAChD,OAAO,qBAAqB,EAAE,qBAAqB;mCACnD,OAAO,qBAAqB,EAAE,oBAAoB;8BAClD,OAAO,qBAAqB,EAAE,eAAe;gCAC7C,OAAO,qBAAqB,EAAE,iBAAiB;0BAC/C,OAAO,qBAAqB,EAAE,WAAW;2BACzC,OAAO,qBAAqB,EAAE,YAAY;0BAC1C,OAAO,qBAAqB,EAAE,WAAW;0CACzC,OAAO,qBAAqB,EAAE,2BAA2B;AAlBtE;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;;GAEG;AACH;IACI;;OAEG;IACH,kBAFa,MAAM,CAKlB;IAED;;;;;OAKG;IACH,4CAHW,eAAe,GACb,IAAI,CAIhB;IAED;;;;;;;;OAQG;IACH,6BALG;QAAuB,MAAM,GAArB,OAAO;QACQ,OAAO,GAAtB,OAAO;QACQ,KAA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AAM,aACN,MAAM,EAAE,GACN,OAAO,CAAE;YAAQ,MAAM,GAAE,MAAM;KAAC,CAAC,CAiF7C;IAED;;;;;;;OAOG;IACH,6BALW,MAAM,iBACN,MAAM,EAAE,GAAG,YAAY,SACvB,MAAM,EAAE,GACN,OAAO,CAAE;YAAQ,MAAM,GAAE,MAAM;KAAC,CAAC,CA0E7C;IAED;;;;;;;;OAQG;IACH,qCANW,SAAS,GAAC,OAAO,GAAC,MAAM,GAAC,SAAS,GAAC,SAAS,GAAC,oBAAoB,gBACjE,MAAM,kBACN,MAAM,EAAE,GAAG,YAAY,SACvB,MAAM,EAAE,GACN,OAAO,CAAE;YAAQ,MAAM,GAAE;gBAAQ,MAAM,GAAE,MAAM,EAAE;SAAC;KAAC,CAAC,CA0MhE;IAED;;;;;;;;;OASG;IACH,mCAPW,SAAS,GAAC,OAAO,GAAC,MAAM,GAAC,SAAS,GAAC,SAAS,GAAC,oBAAoB,QACjE,MAAM,MACN,MAAM,SACN,MAAM,WACN,MAAM,EAAE,GACN,OAAO,CAAE,MAAM,EAAE,CAAC,CAuD9B;IAED;;;;;;OAMG;IACH,kDAJW,MAAM,YACN,QAAQ,GACN,OAAO,CAAE,MAAM,EAAE,CAAC,CA0D9B;IAED;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,OAAO,CAAE,MAAM,EAAE,CAAC,CA0E9B;IAED;;;;;;;;OAQG;IACH,wCANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,OAAO,CAAE,MAAM,EAAE,CAAC,CAyE9B;IAED;;;;;;;OAOG;IACH,yCALW,MAAM,GAAC,MAAM,EAAE,GAAC,SAAS,uBACzB,MAAM,EAAE,cACR,OAAO,GACL,YAAY,CA2ExB;CACJ"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.js"],"names":[],"mappings":";uBAwBa,OAAO,qBAAqB,EAAE,QAA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,OAAO,CAAE;YAAQ,MAAM,GAAE;gBAAQ,MAAM,GAAE,MAAM,EAAE;SAAC;KAAC,CAAC,CA0MhE;IAED;;;;;;;;;OASG;IACH,mCAPW,SAAS,GAAC,OAAO,GAAC,MAAM,GAAC,SAAS,GAAC,SAAS,GAAC,oBAAoB,QACjE,MAAM,MACN,MAAM,SACN,MAAM,WACN,MAAM,EAAE,GACN,OAAO,CAAE,MAAM,EAAE,CAAC,CAuD9B;IAED;;;;;;OAMG;IACH,kDAJW,MAAM,YACN,QAAQ,GACN,OAAO,CAAE,MAAM,EAAE,CAAC,CA0D9B;IAED;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,OAAO,CAAE,MAAM,EAAE,CAAC,CA0E9B;IAED;;;;;;;;OAQG;IACH,wCANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,OAAO,CAAE,MAAM,EAAE,CAAC,CAyE9B;IAED;;;;;;;OAOG;IACH,yCALW,MAAM,GAAC,MAAM,EAAE,GAAC,SAAS,uBACzB,MAAM,EAAE,cACR,OAAO,GACL,YAAY,CA2ExB;CACJ"} \ No newline at end of file diff --git a/lib/index.js b/lib/index.js index 203c4b559..330fa04cc 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1206,13 +1206,11 @@ class Mcdev { return key; } else if (foundKeysByName.length > 1) { Util.logger.error( - `Found multiple keys (${foundKeysByName.join(', ')}) for given name ${key}` + `Found multiple keys (${foundKeysByName.join(', ')}) for name: ${key}` ); return; } else { - Util.logger.error( - `Could not find any keys for given name: ${name}` - ); + Util.logger.error(`Could not find any keys for name: ${name}`); return; } } else { From 0591d1771e01e42f7abe184dc2565b4d9ed100db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 28 Aug 2024 23:54:22 +0200 Subject: [PATCH 40/43] #0: npm audit fix --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2445a5c59..6af5d69d9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5029,9 +5029,9 @@ } }, "node_modules/micromatch": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", - "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, "dependencies": { "braces": "^3.0.3", From 66091a1533d2d2137a2d1184782a1ce346d0f8a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Thu, 29 Aug 2024 00:31:46 +0200 Subject: [PATCH 41/43] #1522: allow specifying multiple markets at once in buildTemplate, buildDefinition and build --- @types/lib/Builder.d.ts | 8 +++---- @types/lib/Builder.d.ts.map | 2 +- @types/lib/index.d.ts | 14 ++++++------ @types/lib/index.d.ts.map | 2 +- lib/Builder.js | 36 ++++++++++++++++++++++--------- lib/cli.js | 22 +++++++++++++++---- lib/index.js | 43 ++++++++++++++++--------------------- 7 files changed, 75 insertions(+), 52 deletions(-) diff --git a/@types/lib/Builder.d.ts b/@types/lib/Builder.d.ts index 594294536..cbff71ba7 100644 --- a/@types/lib/Builder.d.ts +++ b/@types/lib/Builder.d.ts @@ -35,20 +35,20 @@ declare class Builder { * @param {string} businessUnit references credentials from properties.json * @param {string} selectedType supported metadata type * @param {string[]} keyArr customerkey of the metadata - * @param {string} market market localizations + * @param {string[]} marketArr market localizations * @returns {Promise.} - */ - static buildTemplate(businessUnit: string, selectedType: string, keyArr: string[], market: string): Promise; + static buildTemplate(businessUnit: string, selectedType: string, keyArr: string[], marketArr: string[]): Promise; /** * Build a specific metadata file based on a template. * * @param {string} businessUnit references credentials from properties.json * @param {string} selectedType supported metadata type * @param {string[]} nameArr name of the metadata - * @param {string} market market localizations + * @param {string[]} marketArr market localizations * @returns {Promise.} - */ - static buildDefinition(businessUnit: string, selectedType: string, nameArr: string[], market: string): Promise; + static buildDefinition(businessUnit: string, selectedType: string, nameArr: string[], marketArr: string[]): Promise; /** * Build a specific metadata file based on a template using a list of bu-market combos * diff --git a/@types/lib/Builder.d.ts.map b/@types/lib/Builder.d.ts.map index dd9d884ee..4926d9727 100644 --- a/@types/lib/Builder.d.ts.map +++ b/@types/lib/Builder.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Builder.d.ts","sourceRoot":"","sources":["../../lib/Builder.js"],"names":[],"mappings":";uBAUa,OAAO,qBAAqB,EAAE,QAAQ;0BACtC,OAAO,qBAAqB,EAAE,WAAW;8BACzC,OAAO,qBAAqB,EAAE,eAAe;sBAC7C,OAAO,qBAAqB,EAAE,OAAO;+BACrC,OAAO,qBAAqB,EAAE,gBAAgB;mCAC9C,OAAO,qBAAqB,EAAE,oBAAoB;kCAClD,OAAO,qBAAqB,EAAE,mBAAmB;8BACjD,OAAO,qBAAqB,EAAE,eAAe;iCAC7C,OAAO,qBAAqB,EAAE,kBAAkB;oCAChD,OAAO,qBAAqB,EAAE,qBAAqB;gCACnD,OAAO,qBAAqB,EAAE,iBAAiB;0BAC/C,OAAO,qBAAqB,EAAE,WAAW;AAZtD;;;;;;;;;;;;;GAaG;AAEH;;GAEG;AACH;IAuEI;;;;;;;;OAQG;IACH,mCANW,MAAM,gBACN,MAAM,UACN,MAAM,EAAE,UACR,MAAM,GACJ,OAAO,CAAE,qBAAqB,CAAC,CAuB3C;IA2CD;;;;;;;;OAQG;IACH,qCANW,MAAM,gBACN,MAAM,WACN,MAAM,EAAE,UACR,MAAM,GACJ,OAAO,CAAE,qBAAqB,CAAC,CAuB3C;IAED;;;;;;;OAOG;IACH,qCALW,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,OAAO,CAAE,MAAM,CAAC,CAoD5B;IAzOD;;;;;;OAMG;IACH,wBAJW,OAAO,YAEP,QAAQ,EAyBlB;IAtBG,kDAA4B;IAC5B,oBAAkD;IAClD,oBAIE;IACF,iDAAwB;IAMxB,oBAGC;IAED;;OAEG;IACH,UAFU,qBAAqB,CAEb;IAGtB;;;;;;;OAOG;IACH,+BALW,MAAM,WACN,MAAM,EAAE,qBACR,WAAW,GACT,OAAO,CAAE,qBAAqB,CAAC,CA8B3C;IAkCD;;;;;;;OAOG;IACH,6BALW,MAAM,UACN,MAAM,EAAE,qBACR,WAAW,GACT,OAAO,CAAE,qBAAqB,CAAC,CAiC3C;CA6FJ"} \ No newline at end of file +{"version":3,"file":"Builder.d.ts","sourceRoot":"","sources":["../../lib/Builder.js"],"names":[],"mappings":";uBAUa,OAAO,qBAAqB,EAAE,QAAQ;0BACtC,OAAO,qBAAqB,EAAE,WAAW;8BACzC,OAAO,qBAAqB,EAAE,eAAe;sBAC7C,OAAO,qBAAqB,EAAE,OAAO;+BACrC,OAAO,qBAAqB,EAAE,gBAAgB;mCAC9C,OAAO,qBAAqB,EAAE,oBAAoB;kCAClD,OAAO,qBAAqB,EAAE,mBAAmB;8BACjD,OAAO,qBAAqB,EAAE,eAAe;iCAC7C,OAAO,qBAAqB,EAAE,kBAAkB;oCAChD,OAAO,qBAAqB,EAAE,qBAAqB;gCACnD,OAAO,qBAAqB,EAAE,iBAAiB;0BAC/C,OAAO,qBAAqB,EAAE,WAAW;AAZtD;;;;;;;;;;;;;GAaG;AAEH;;GAEG;AACH;IAuEI;;;;;;;;OAQG;IACH,mCANW,MAAM,gBACN,MAAM,UACN,MAAM,EAAE,aACR,MAAM,EAAE,GACN,OAAO,CAAE,qBAAqB,CAAC,CA+B3C;IA2CD;;;;;;;;OAQG;IACH,qCANW,MAAM,gBACN,MAAM,WACN,MAAM,EAAE,aACR,MAAM,EAAE,GACN,OAAO,CAAE,qBAAqB,CAAC,CA+B3C;IAED;;;;;;;OAOG;IACH,qCALW,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,OAAO,CAAE,MAAM,CAAC,CAoD5B;IAzPD;;;;;;OAMG;IACH,wBAJW,OAAO,YAEP,QAAQ,EAyBlB;IAtBG,kDAA4B;IAC5B,oBAAkD;IAClD,oBAIE;IACF,iDAAwB;IAMxB,oBAGC;IAED;;OAEG;IACH,UAFU,qBAAqB,CAEb;IAGtB;;;;;;;OAOG;IACH,+BALW,MAAM,WACN,MAAM,EAAE,qBACR,WAAW,GACT,OAAO,CAAE,qBAAqB,CAAC,CA8B3C;IA0CD;;;;;;;OAOG;IACH,6BALW,MAAM,UACN,MAAM,EAAE,qBACR,WAAW,GACT,OAAO,CAAE,qBAAqB,CAAC,CAiC3C;CAqGJ"} \ No newline at end of file diff --git a/@types/lib/index.d.ts b/@types/lib/index.d.ts index a5af89e72..6588c09c4 100644 --- a/@types/lib/index.d.ts +++ b/@types/lib/index.d.ts @@ -241,22 +241,22 @@ declare class Mcdev { * @param {string} businessUnitTemplate references credentials from properties.json * @param {string} businessUnitDefinition references credentials from properties.json * @param {TypeKeyCombo} typeKeyCombo limit retrieval to given metadata type - * @param {string} marketTemplate market localizations - * @param {string} marketDefinition market localizations + * @param {string[]} marketTemplate market localizations + * @param {string[]} marketDefinition market localizations * @param {boolean} [bulk] runs buildDefinitionBulk instead of buildDefinition; requires marketList to be defined and given via marketDefinition * @returns {Promise.} response from buildDefinition */ - static build(businessUnitTemplate: string, businessUnitDefinition: string, typeKeyCombo: TypeKeyCombo, marketTemplate: string, marketDefinition: string, bulk?: boolean): Promise; + static build(businessUnitTemplate: string, businessUnitDefinition: string, typeKeyCombo: TypeKeyCombo, marketTemplate: string[], marketDefinition: string[], bulk?: boolean): Promise; /** * Build a template based on a list of metadata files in the retrieve folder. * * @param {string} businessUnit references credentials from properties.json * @param {string | TypeKeyCombo} selectedTypes limit retrieval to given metadata type * @param {string[] | undefined} keyArr customerkey of the metadata - * @param {string} market market localizations + * @param {string[]} marketArr market localizations * @returns {Promise.} - */ - static buildTemplate(businessUnit: string, selectedTypes: string | TypeKeyCombo, keyArr: string[] | undefined, market: string): Promise; + static buildTemplate(businessUnit: string, selectedTypes: string | TypeKeyCombo, keyArr: string[] | undefined, marketArr: string[]): Promise; /** * Build a specific metadata file based on a template. * @@ -272,10 +272,10 @@ declare class Mcdev { * @param {string} businessUnit references credentials from properties.json * @param {string | TypeKeyCombo} selectedTypes limit retrieval to given metadata type * @param {string[] | undefined} nameArr name of the metadata - * @param {string} market market localizations + * @param {string[]} marketArr market localizations * @returns {Promise.} - */ - static buildDefinition(businessUnit: string, selectedTypes: string | TypeKeyCombo, nameArr: string[] | undefined, market: string): Promise; + static buildDefinition(businessUnit: string, selectedTypes: string | TypeKeyCombo, nameArr: string[] | undefined, marketArr: string[]): Promise; /** * Build a specific metadata file based on a template using a list of bu-market combos * diff --git a/@types/lib/index.d.ts.map b/@types/lib/index.d.ts.map index 2da907b82..1658f8c35 100644 --- a/@types/lib/index.d.ts.map +++ b/@types/lib/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.js"],"names":[],"mappings":";uBAwBa,OAAO,qBAAqB,EAAE,QAAQ;0BACtC,OAAO,qBAAqB,EAAE,WAAW;8BACzC,OAAO,qBAAqB,EAAE,eAAe;2BAC7C,OAAO,qBAAqB,EAAE,YAAY;sBAC1C,OAAO,qBAAqB,EAAE,OAAO;+BACrC,OAAO,qBAAqB,EAAE,gBAAgB;mCAC9C,OAAO,qBAAqB,EAAE,oBAAoB;kCAClD,OAAO,qBAAqB,EAAE,mBAAmB;8BACjD,OAAO,qBAAqB,EAAE,eAAe;iCAC7C,OAAO,qBAAqB,EAAE,kBAAkB;oCAChD,OAAO,qBAAqB,EAAE,qBAAqB;mCACnD,OAAO,qBAAqB,EAAE,oBAAoB;8BAClD,OAAO,qBA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,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,OAAO,CAAE,MAAM,EAAE,CAAC,CA0E9B;IAED;;;;;;;;OAQG;IACH,wCANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,OAAO,CAAE,MAAM,EAAE,CAAC,CAyE9B;IAED;;;;;;;OAOG;IACH,yCALW,MAAM,GAAC,MAAM,EAAE,GAAC,SAAS,uBACzB,MAAM,EAAE,cACR,OAAO,GACL,YAAY,CA2ExB;CACJ"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.js"],"names":[],"mappings":";uBAwBa,OAAO,qBAAqB,EAAE,QAAQ;0BACtC,OAAO,qBAAqB,EAAE,WAAW;8BACzC,OAAO,qBAAqB,EAAE,eAAe;2BAC7C,OAAO,qBAAqB,EAAE,YAAY;sBAC1C,OAAO,qBAAqB,EAAE,OAAO;+BACrC,OAAO,qBAAqB,EAAE,gBAAgB;mCAC9C,OAAO,qBAAqB,EAAE,oBAAoB;kCAClD,OAAO,qBAAqB,EAAE,mBAAmB;8BACjD,OAAO,qBAAqB,EAAE,eAAe;iCAC7C,OAAO,qBAAqB,EAAE,kBAAkB;oCAChD,OAAO,qBAAqB,EAAE,qBAAqB;mCACnD,OAAO,qBAAqB,EAAE,oBAAoB;8BAClD,OAAO,qBAAqB,EAAE,eAAe;gCAC7C,OAAO,qBAAqB,EAAE,iBAAiB;0BAC/C,OAAO,qBAAqB,EAAE,WAAW;2BACzC,OAAO,qBAAqB,EAAE,YAAY;0BAC1C,OAAO,qBAAqB,EAAE,WAAW;0CACzC,OAAO,qBAAqB,EAAE,2BAA2B;AAlBtE;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;;GAEG;AACH;IACI;;OAEG;IACH,kBAFa,MAAM,CAKlB;IAED;;;;;OAKG;IACH,4CAHW,eAAe,GACb,IAAI,CAIhB;IAED;;;;;;;;OAQG;IACH,6BALG;QAAuB,MAAM,GAArB,OAAO;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1..fb8497561 100644 --- a/lib/Builder.js +++ b/lib/Builder.js @@ -102,10 +102,10 @@ saved * @param {string} businessUnit references credentials from properties.json * @param {string} selectedType supported metadata type * @param {string[]} keyArr customerkey of the metadata - * @param {string} market market localizations + * @param {string[]} marketArr market localizations * @returns {Promise.} - */ - static async buildTemplate(businessUnit, selectedType, keyArr, market) { + static async buildTemplate(businessUnit, selectedType, keyArr, marketArr) { const properties = await config.getProperties(); if (!(await config.checkProperties(properties))) { return null; @@ -119,12 +119,20 @@ saved ); return; } + /** @type {TemplateMap} */ + const templateVariables = {}; + for (const market of marketArr) { + if (Util.checkMarket(market, properties)) { + Object.assign(templateVariables, properties.markets[market]); + } else { + // do not execute the rest of this method if a market was invalid + return; + } + } const buObject = await Cli.getCredentialObject(properties, businessUnit); if (buObject !== null) { const builder = new Builder(properties, buObject); - if (Util.checkMarket(market, properties)) { - return builder._buildTemplate(selectedType, keyArr, properties.markets[market]); - } + return builder._buildTemplate(selectedType, keyArr, templateVariables); } } @@ -175,10 +183,10 @@ saved * @param {string} businessUnit references credentials from properties.json * @param {string} selectedType supported metadata type * @param {string[]} nameArr name of the metadata - * @param {string} market market localizations + * @param {string[]} marketArr market localizations * @returns {Promise.} - */ - static async buildDefinition(businessUnit, selectedType, nameArr, market) { + static async buildDefinition(businessUnit, selectedType, nameArr, marketArr) { const properties = await config.getProperties(); if (!(await config.checkProperties(properties))) { return null; @@ -192,12 +200,20 @@ saved ); return; } + /** @type {TemplateMap} */ + const templateVariables = {}; + for (const market of marketArr) { + if (Util.checkMarket(market, properties)) { + Object.assign(templateVariables, properties.markets[market]); + } else { + // do not execute the rest of this method if a market was invalid + return; + } + } const buObject = await Cli.getCredentialObject(properties, businessUnit); if (buObject !== null) { const builder = new Builder(properties, buObject); - if (Util.checkMarket(market, properties)) { - return builder._buildDefinition(selectedType, nameArr, properties.markets[market]); - } + return builder._buildDefinition(selectedType, nameArr, templateVariables); } } diff --git a/lib/cli.js b/lib/cli.js index 43326b57c..4dc54671c 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -363,6 +363,7 @@ yargs(hideBin(process.argv)) }) .option('marketFrom', { type: 'string', + array: true, alias: 'mf', group: 'Required parameters for build:', describe: 'market used for reverse building template', @@ -370,6 +371,7 @@ yargs(hideBin(process.argv)) }) .option('marketTo', { type: 'string', + array: true, alias: 'mt', group: 'Required parameters for build:', describe: 'market used for building deployable definition', @@ -440,6 +442,7 @@ yargs(hideBin(process.argv)) }) .option('market', { type: 'string', + array: true, group: 'Options for buildTemplate:', describe: 'market used for reverse building template', }) @@ -472,10 +475,15 @@ yargs(hideBin(process.argv)) argv.BU, argv.TYPE, csvToArray(argv.KEY), - argv.MARKET || argv.market + argv.MARKET ? [argv.MARKET] : argv.market ); } else { - Mcdev.buildTemplate(argv.BU, typeKeyCombo, null, argv.MARKET || argv.market); + Mcdev.buildTemplate( + argv.BU, + typeKeyCombo, + null, + argv.MARKET ? [argv.MARKET] : argv.market + ); } } ) @@ -509,6 +517,7 @@ yargs(hideBin(process.argv)) }) .option('market', { type: 'string', + array: true, group: 'Options for buildDefinition:', describe: 'market used for building deployable definition', }) @@ -528,10 +537,15 @@ yargs(hideBin(process.argv)) argv.BU, argv.TYPE, csvToArray(argv.FILENAME), - argv.MARKET || argv.market + argv.MARKET ? [argv.MARKET] : argv.market ); } else { - Mcdev.buildDefinition(argv.BU, typeKeyCombo, null, argv.MARKET || argv.market); + Mcdev.buildDefinition( + argv.BU, + typeKeyCombo, + null, + argv.MARKET ? [argv.MARKET] : argv.market + ); } } ) diff --git a/lib/index.js b/lib/index.js index 330fa04cc..7e843a50f 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1096,8 +1096,8 @@ class Mcdev { * @param {string} businessUnitTemplate references credentials from properties.json * @param {string} businessUnitDefinition references credentials from properties.json * @param {TypeKeyCombo} typeKeyCombo limit retrieval to given metadata type - * @param {string} marketTemplate market localizations - * @param {string} marketDefinition market localizations + * @param {string[]} marketTemplate market localizations + * @param {string[]} marketDefinition market localizations * @param {boolean} [bulk] runs buildDefinitionBulk instead of buildDefinition; requires marketList to be defined and given via marketDefinition * @returns {Promise.} response from buildDefinition */ @@ -1115,10 +1115,7 @@ class Mcdev { ); return; } - const properties = await config.getProperties(); - if (!Util.checkMarket(marketTemplate, properties)) { - return; - } + // check if types are valid for (const type of Object.keys(typeKeyCombo)) { if (!Util._isValidType(type)) { @@ -1133,7 +1130,7 @@ class Mcdev { Util.logger.info('mcdev:: Build Template & Build Definition'); await this.buildTemplate(businessUnitTemplate, typeKeyCombo, null, marketTemplate); return bulk - ? this.buildDefinitionBulk(marketDefinition, typeKeyCombo, null) + ? this.buildDefinitionBulk(marketDefinition[0], typeKeyCombo, null) : this.buildDefinition(businessUnitDefinition, typeKeyCombo, null, marketDefinition); } @@ -1143,18 +1140,20 @@ class Mcdev { * @param {string} businessUnit references credentials from properties.json * @param {string | TypeKeyCombo} selectedTypes limit retrieval to given metadata type * @param {string[] | undefined} keyArr customerkey of the metadata - * @param {string} market market localizations + * @param {string[]} marketArr market localizations * @returns {Promise.} - */ - static async buildTemplate(businessUnit, selectedTypes, keyArr, market) { + static async buildTemplate(businessUnit, selectedTypes, keyArr, marketArr) { this.#welcomeMessage(); Util.startLogger(); Util.logger.info('mcdev:: Build Template from retrieved files'); const properties = await config.getProperties(); const buObject = await Cli.getCredentialObject(properties, businessUnit); - if (!Util.checkMarket(market, properties)) { - return; + for (const market of marketArr) { + if (!Util.checkMarket(market, properties)) { + return; + } } if ('string' === typeof selectedTypes) { // ensure we have TypeKeyCombo here @@ -1232,19 +1231,11 @@ class Mcdev { businessUnit, type, selectedTypes[type], - market + marketArr ); returnObj[type] = result[type]; } Util.logger.info(`Templated ${Util.getTypeKeyCount(returnObj)} items`); - if (Util.OPTIONS.dependencies) { - Util.logger.info( - `You can now run buildDefinition to create the deployment package. Don't forget to adjust the BU and market!` - ); - Util.logger.info( - ` mcdev bd ${businessUnit} ${Util.convertTypeKeyToCli(selectedTypes)} --market ${market}` - ); - } return returnObj; } @@ -1280,17 +1271,19 @@ class Mcdev { * @param {string} businessUnit references credentials from properties.json * @param {string | TypeKeyCombo} selectedTypes limit retrieval to given metadata type * @param {string[] | undefined} nameArr name of the metadata - * @param {string} market market localizations + * @param {string[]} marketArr market localizations * @returns {Promise.} - */ - static async buildDefinition(businessUnit, selectedTypes, nameArr, market) { + static async buildDefinition(businessUnit, selectedTypes, nameArr, marketArr) { this.#welcomeMessage(); Util.startLogger(); Util.logger.info('mcdev:: Build Definition from Template'); const properties = await config.getProperties(); - if (!Util.checkMarket(market, properties)) { - return; + for (const market of marketArr) { + if (!Util.checkMarket(market, properties)) { + return; + } } if ('string' === typeof selectedTypes) { // ensure we have TypeKeyCombo here @@ -1314,7 +1307,7 @@ class Mcdev { businessUnit, type, selectedTypes[type], - market + marketArr ); returnObj[type] = result[type]; } From acc06b96f2ff90b3470d809b08c582410a04aea8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Thu, 29 Aug 2024 00:51:54 +0200 Subject: [PATCH 42/43] #1522: fix tests to use market-arrays for build/bt/bd --- test/general.test.js | 38 ++++++++++++++-------------- test/type.asset.test.js | 6 ++--- test/type.automation.test.js | 8 +++--- test/type.dataExtension.test.js | 6 ++--- test/type.dataExtract.test.js | 6 ++--- test/type.emailSend.test.js | 4 +-- test/type.event.test.js | 6 ++--- test/type.fileTransfer.test.js | 6 ++--- test/type.importFile.test.js | 6 ++--- test/type.journey.test.js | 6 ++--- test/type.mobileKeyword.test.js | 4 +-- test/type.mobileMessage.test.js | 4 +-- test/type.query.test.js | 6 ++--- test/type.script.test.js | 8 +++--- test/type.sendClassification.test.js | 4 +-- test/type.senderProfile.test.js | 6 ++--- test/type.transactionalEmail.test.js | 4 +-- test/type.transactionalPush.test.js | 4 +-- test/type.transactionalSMS.test.js | 4 +-- test/type.triggeredSend.test.js | 6 ++--- test/type.user.test.js | 4 +-- test/type.verification.test.js | 4 +-- 22 files changed, 75 insertions(+), 75 deletions(-) diff --git a/test/general.test.js b/test/general.test.js index 8e197bdd2..225673d2d 100644 --- a/test/general.test.js +++ b/test/general.test.js @@ -734,7 +734,7 @@ describe('GENERAL', () => { buName, typeKeyCombo, undefined, - 'testSourceMarket' + ['testSourceMarket'] ); assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); // check automation @@ -768,7 +768,7 @@ describe('GENERAL', () => { buName, typeKeyCombo, undefined, - 'testTargetMarket' + ['testTargetMarket'] ); assert.equal( process.exitCode, @@ -836,7 +836,7 @@ describe('GENERAL', () => { buName, typeKeyCombo, undefined, - 'testSourceMarket' + ['testSourceMarket'] ); assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); // check automation @@ -870,7 +870,7 @@ describe('GENERAL', () => { buName, typeKeyCombo, undefined, - 'testTargetMarket' + ['testTargetMarket'] ); assert.equal( process.exitCode, @@ -947,7 +947,7 @@ describe('GENERAL', () => { buName, typeKeyCombo, undefined, - 'testSourceMarket' + ['testSourceMarket'] ); assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); @@ -1001,7 +1001,7 @@ describe('GENERAL', () => { buName, typeKeyCombo, undefined, - 'testTargetMarket' + ['testTargetMarket'] ); assert.equal( process.exitCode, @@ -1069,7 +1069,7 @@ describe('GENERAL', () => { buName, typeKeyCombo, undefined, - 'testSourceMarket' + ['testSourceMarket'] ); assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); @@ -1123,7 +1123,7 @@ describe('GENERAL', () => { buName, typeKeyCombo, undefined, - 'testTargetMarket' + ['testTargetMarket'] ); assert.equal( process.exitCode, @@ -1197,7 +1197,7 @@ describe('GENERAL', () => { buName, typeKeyCombo, undefined, - 'testSourceMarket' + ['testSourceMarket'] ); assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); // check automation @@ -1389,8 +1389,8 @@ describe('GENERAL', () => { buName, buName, typeKeyCombo, - 'testSourceMarket', - 'testTargetMarket' + ['testSourceMarket'], + ['testTargetMarket'] ); assert.equal(process.exitCode, 0, 'build should not have thrown an error'); @@ -1483,8 +1483,8 @@ describe('GENERAL', () => { buName, buName, typeKeyCombo, - 'testSourceMarket', - 'testTargetMarket' + ['testSourceMarket'], + ['testTargetMarket'] ); assert.equal(process.exitCode, 0, 'build should not have thrown an error'); @@ -1587,8 +1587,8 @@ describe('GENERAL', () => { buName, buName, typeKeyCombo, - 'testSourceMarket', - 'testTargetMarket' + ['testSourceMarket'], + ['testTargetMarket'] ); assert.equal(process.exitCode, 0, 'build should not have thrown an error'); @@ -1697,8 +1697,8 @@ describe('GENERAL', () => { buName, 'ignored', typeKeyCombo, - 'testSourceMarket', - 'deployment-target', + ['testSourceMarket'], + ['deployment-target'], true ); assert.equal(process.exitCode, 0, 'build should not have thrown an error'); @@ -1878,8 +1878,8 @@ describe('GENERAL', () => { buName, 'ignored', typeKeyCombo, - 'testSourceMarket', - 'deployment-target', + ['testSourceMarket'], + ['deployment-target'], true ); assert.equal(process.exitCode, 0, 'build should not have thrown an error'); diff --git a/test/type.asset.test.js b/test/type.asset.test.js index ce18e8128..0aee2b723 100644 --- a/test/type.asset.test.js +++ b/test/type.asset.test.js @@ -527,7 +527,7 @@ describe('type: asset', () => { 'testInstance/testBU', 'asset', ['testExisting_asset_templatebasedemail', 'testExisting_asset_htmlblock'], - 'testSourceMarket' + ['testSourceMarket'] ); // WHEN assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); @@ -584,7 +584,7 @@ describe('type: asset', () => { 'testInstance/testBU', 'asset', ['testExisting_asset_templatebasedemail', 'testExisting_asset_htmlblock'], - 'testTargetMarket' + ['testTargetMarket'] ); assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); assert.equal( @@ -673,7 +673,7 @@ describe('type: asset', () => { 'testInstance/testBU', 'asset', ['testExisting_asset_templatebasedemail'], - 'testSourceMarket' + ['testSourceMarket'] ); // WHEN assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); diff --git a/test/type.automation.test.js b/test/type.automation.test.js index 3386a8ece..6685f06f3 100644 --- a/test/type.automation.test.js +++ b/test/type.automation.test.js @@ -605,7 +605,7 @@ describe('type: automation', () => { 'testInstance/testBU', 'automation', ['testExisting_automation'], - 'testTargetMarket' + ['testTargetMarket'] ); assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); assert.deepEqual( @@ -629,7 +629,7 @@ describe('type: automation', () => { 'testInstance/testBU', 'automation', ['testExisting_automation'], - 'testSourceMarket' + ['testSourceMarket'] ); assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); // WHEN @@ -648,7 +648,7 @@ describe('type: automation', () => { 'testInstance/testBU', 'automation', ['testExisting_automation'], - 'testTargetMarket' + ['testTargetMarket'] ); assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); @@ -684,7 +684,7 @@ describe('type: automation', () => { 'testInstance/testBU', 'automation', ['testExisting_automation'], - 'testSourceMarket' + ['testSourceMarket'] ); assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); // WHEN diff --git a/test/type.dataExtension.test.js b/test/type.dataExtension.test.js index 63920bd23..d8549daeb 100644 --- a/test/type.dataExtension.test.js +++ b/test/type.dataExtension.test.js @@ -270,7 +270,7 @@ describe('type: dataExtension', () => { 'testInstance/testBU', 'dataExtension', ['testExisting_dataExtension'], - 'testTargetMarket' + ['testTargetMarket'] ); assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); assert.deepEqual( @@ -294,7 +294,7 @@ describe('type: dataExtension', () => { 'testInstance/testBU', 'dataExtension', ['testExisting_dataExtension'], - 'testSourceMarket' + ['testSourceMarket'] ); assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); // WHEN @@ -316,7 +316,7 @@ describe('type: dataExtension', () => { 'testInstance/testBU', 'dataExtension', ['testExisting_dataExtension'], - 'testTargetMarket' + ['testTargetMarket'] ); assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); diff --git a/test/type.dataExtract.test.js b/test/type.dataExtract.test.js index 922571ede..bd465c239 100644 --- a/test/type.dataExtract.test.js +++ b/test/type.dataExtract.test.js @@ -110,7 +110,7 @@ describe('type: dataExtract', () => { 'testInstance/testBU', 'dataExtract', ['testExisting_dataExtract'], - 'testTargetMarket' + ['testTargetMarket'] ); assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); assert.deepEqual( @@ -134,7 +134,7 @@ describe('type: dataExtract', () => { 'testInstance/testBU', 'dataExtract', ['testExisting_dataExtract'], - 'testSourceMarket' + ['testSourceMarket'] ); assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); assert.equal( @@ -152,7 +152,7 @@ describe('type: dataExtract', () => { 'testInstance/testBU', 'dataExtract', ['testExisting_dataExtract'], - 'testTargetMarket' + ['testTargetMarket'] ); assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); assert.deepEqual( diff --git a/test/type.emailSend.test.js b/test/type.emailSend.test.js index 03a93c15d..64fc7f209 100644 --- a/test/type.emailSend.test.js +++ b/test/type.emailSend.test.js @@ -92,7 +92,7 @@ describe('type: emailSend', () => { 'testInstance/testBU', 'emailSend', ['testExisting_emailSend'], - 'testSourceMarket' + ['testSourceMarket'] ); assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); assert.equal( @@ -110,7 +110,7 @@ describe('type: emailSend', () => { 'testInstance/testBU', 'emailSend', ['testExisting_emailSend'], - 'testTargetMarket' + ['testTargetMarket'] ); assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); assert.deepEqual( diff --git a/test/type.event.test.js b/test/type.event.test.js index f8720c6b6..a9b3af529 100644 --- a/test/type.event.test.js +++ b/test/type.event.test.js @@ -259,7 +259,7 @@ describe('type: event', () => { 'testInstance/testBU', 'event', ['testExisting_event'], - 'testTargetMarket' + ['testTargetMarket'] ); assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); @@ -285,7 +285,7 @@ describe('type: event', () => { 'testInstance/testBU', 'event', ['testExisting_event'], - 'testSourceMarket' + ['testSourceMarket'] ); // WHEN assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); @@ -305,7 +305,7 @@ describe('type: event', () => { 'testInstance/testBU', 'event', ['testExisting_event'], - 'testTargetMarket' + ['testTargetMarket'] ); assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); diff --git a/test/type.fileTransfer.test.js b/test/type.fileTransfer.test.js index c93dc40dd..12ded432d 100644 --- a/test/type.fileTransfer.test.js +++ b/test/type.fileTransfer.test.js @@ -107,7 +107,7 @@ describe('type: fileTransfer', () => { 'testInstance/testBU', 'fileTransfer', ['testExisting_fileTransfer'], - 'testTargetMarket' + ['testTargetMarket'] ); assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); assert.deepEqual( @@ -131,7 +131,7 @@ describe('type: fileTransfer', () => { 'testInstance/testBU', 'fileTransfer', ['testExisting_fileTransfer'], - 'testSourceMarket' + ['testSourceMarket'] ); assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); assert.equal( @@ -149,7 +149,7 @@ describe('type: fileTransfer', () => { 'testInstance/testBU', 'fileTransfer', ['testExisting_fileTransfer'], - 'testTargetMarket' + ['testTargetMarket'] ); assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); assert.deepEqual( diff --git a/test/type.importFile.test.js b/test/type.importFile.test.js index acb2075b9..8ea2a8ba8 100644 --- a/test/type.importFile.test.js +++ b/test/type.importFile.test.js @@ -147,7 +147,7 @@ describe('type: importFile', () => { 'testInstance/testBU', 'importFile', ['testExisting_importFile'], - 'testTargetMarket' + ['testTargetMarket'] ); assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); assert.deepEqual( @@ -171,7 +171,7 @@ describe('type: importFile', () => { 'testInstance/testBU', 'importFile', ['testExisting_importFile'], - 'testSourceMarket' + ['testSourceMarket'] ); assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); assert.equal( @@ -189,7 +189,7 @@ describe('type: importFile', () => { 'testInstance/testBU', 'importFile', ['testExisting_importFile'], - 'testTargetMarket' + ['testTargetMarket'] ); assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); assert.deepEqual( diff --git a/test/type.journey.test.js b/test/type.journey.test.js index 3eafc1663..899076b70 100644 --- a/test/type.journey.test.js +++ b/test/type.journey.test.js @@ -228,7 +228,7 @@ describe('type: journey', () => { 'testInstance/testBU', 'journey', ['testExisting_journey_Quicksend'], - 'testSourceMarket' + ['testSourceMarket'] ); assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); assert.equal( @@ -247,7 +247,7 @@ describe('type: journey', () => { 'testInstance/testBU', 'journey', ['testExisting_journey_Quicksend'], - 'testTargetMarket' + ['testTargetMarket'] ); assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); assert.deepEqual( @@ -275,7 +275,7 @@ describe('type: journey', () => { 'testInstance/testBU', 'journey', ['testExisting_journey_Quicksend', 'testExisting_journey_Multistep'], - 'testSourceMarket' + ['testSourceMarket'] ); // WHEN assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); diff --git a/test/type.mobileKeyword.test.js b/test/type.mobileKeyword.test.js index b179a6338..5c66f978b 100644 --- a/test/type.mobileKeyword.test.js +++ b/test/type.mobileKeyword.test.js @@ -175,7 +175,7 @@ describe('type: mobileKeyword', () => { 'testInstance/testBU', 'mobileKeyword', ['4912312345678.TESTEXISTING_KEYWORD'], - 'testSourceMarket' + ['testSourceMarket'] ); assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); @@ -207,7 +207,7 @@ describe('type: mobileKeyword', () => { 'testInstance/testBU', 'mobileKeyword', ['4912312345678.TESTEXISTING_KEYWORD'], - 'testTargetMarket' + ['testTargetMarket'] ); assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); assert.deepEqual( diff --git a/test/type.mobileMessage.test.js b/test/type.mobileMessage.test.js index 37ff4b040..d8a2ff86b 100644 --- a/test/type.mobileMessage.test.js +++ b/test/type.mobileMessage.test.js @@ -116,7 +116,7 @@ describe('type: mobileMessage', () => { 'testInstance/testBU', 'mobileMessage', ['NTIzOjc4OjA'], - 'testSourceMarket' + ['testSourceMarket'] ); assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); @@ -141,7 +141,7 @@ describe('type: mobileMessage', () => { 'testInstance/testBU', 'mobileMessage', ['NTIzOjc4OjA'], - 'testTargetMarket' + ['testTargetMarket'] ); assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); assert.deepEqual( diff --git a/test/type.query.test.js b/test/type.query.test.js index 1358d91fa..107492bf4 100644 --- a/test/type.query.test.js +++ b/test/type.query.test.js @@ -755,7 +755,7 @@ describe('type: query', () => { 'testInstance/testBU', 'query', ['testExisting_query'], - 'testTargetMarket' + ['testTargetMarket'] ); assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); @@ -784,7 +784,7 @@ describe('type: query', () => { 'testInstance/testBU', 'query', ['testExisting_query'], - 'testSourceMarket' + ['testSourceMarket'] ); // WHEN assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); @@ -807,7 +807,7 @@ describe('type: query', () => { 'testInstance/testBU', 'query', ['testExisting_query'], - 'testTargetMarket' + ['testTargetMarket'] ); assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); diff --git a/test/type.script.test.js b/test/type.script.test.js index 42629b5eb..d5720da39 100644 --- a/test/type.script.test.js +++ b/test/type.script.test.js @@ -297,7 +297,7 @@ describe('type: script', () => { 'testInstance/testBU', 'script', ['testExisting_script'], - 'testTargetMarket' + ['testTargetMarket'] ); assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); @@ -326,7 +326,7 @@ describe('type: script', () => { 'testInstance/testBU', 'script', ['testExisting_script'], - 'testSourceMarket' + ['testSourceMarket'] ); // WHEN assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); @@ -349,7 +349,7 @@ describe('type: script', () => { 'testInstance/testBU', 'script', ['testExisting_script'], - 'testTargetMarket' + ['testTargetMarket'] ); assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); @@ -381,7 +381,7 @@ describe('type: script', () => { 'testInstance/testBU', 'script', ['testExisting_script_ampscript'], - 'testSourceMarket' + ['testSourceMarket'] ); // WHEN assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); diff --git a/test/type.sendClassification.test.js b/test/type.sendClassification.test.js index d269cf4d0..5a1776b81 100644 --- a/test/type.sendClassification.test.js +++ b/test/type.sendClassification.test.js @@ -98,7 +98,7 @@ describe('type: sendClassification', () => { 'testInstance/testBU', 'sendClassification', ['testExisting_sendClassification'], - 'testSourceMarket' + ['testSourceMarket'] ); assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); assert.equal( @@ -119,7 +119,7 @@ describe('type: sendClassification', () => { 'testInstance/testBU', 'sendClassification', ['testExisting_sendClassification'], - 'testTargetMarket' + ['testTargetMarket'] ); assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); assert.deepEqual( diff --git a/test/type.senderProfile.test.js b/test/type.senderProfile.test.js index cf7a190d8..04a18733d 100644 --- a/test/type.senderProfile.test.js +++ b/test/type.senderProfile.test.js @@ -92,7 +92,7 @@ describe('type: senderProfile', () => { 'testInstance/testBU', 'senderProfile', ['testExisting_senderProfile'], - 'testSourceMarket' + ['testSourceMarket'] ); assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); assert.equal( @@ -113,7 +113,7 @@ describe('type: senderProfile', () => { 'testInstance/testBU', 'senderProfile', ['testExisting_senderProfile'], - 'testTargetMarket' + ['testTargetMarket'] ); assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); assert.deepEqual( @@ -138,7 +138,7 @@ describe('type: senderProfile', () => { 'testInstance/testBU', 'senderProfile', ['testExisting_senderProfile'], - 'testSourceMarket' + ['testSourceMarket'] ); // WHEN assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); diff --git a/test/type.transactionalEmail.test.js b/test/type.transactionalEmail.test.js index 3ad59d66d..739931276 100644 --- a/test/type.transactionalEmail.test.js +++ b/test/type.transactionalEmail.test.js @@ -109,7 +109,7 @@ describe('type: transactionalEmail', () => { 'testInstance/testBU', 'transactionalEmail', ['testExisting_temail'], - 'testSourceMarket' + ['testSourceMarket'] ); assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); assert.equal( @@ -127,7 +127,7 @@ describe('type: transactionalEmail', () => { 'testInstance/testBU', 'transactionalEmail', ['testExisting_temail'], - 'testTargetMarket' + ['testTargetMarket'] ); assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); assert.deepEqual( diff --git a/test/type.transactionalPush.test.js b/test/type.transactionalPush.test.js index 5a0221b4b..ef85b9420 100644 --- a/test/type.transactionalPush.test.js +++ b/test/type.transactionalPush.test.js @@ -109,7 +109,7 @@ describe('type: transactionalPush', () => { 'testInstance/testBU', 'transactionalPush', ['testExisting_tpush'], - 'testSourceMarket' + ['testSourceMarket'] ); assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); assert.equal( @@ -127,7 +127,7 @@ describe('type: transactionalPush', () => { 'testInstance/testBU', 'transactionalPush', ['testExisting_tpush'], - 'testTargetMarket' + ['testTargetMarket'] ); assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); diff --git a/test/type.transactionalSMS.test.js b/test/type.transactionalSMS.test.js index 4c531d275..d57abfe3b 100644 --- a/test/type.transactionalSMS.test.js +++ b/test/type.transactionalSMS.test.js @@ -125,7 +125,7 @@ describe('type: transactionalSMS', () => { 'testInstance/testBU', 'transactionalSMS', ['testExisting_tsms'], - 'testSourceMarket' + ['testSourceMarket'] ); assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); @@ -153,7 +153,7 @@ describe('type: transactionalSMS', () => { 'testInstance/testBU', 'transactionalSMS', ['testExisting_tsms'], - 'testTargetMarket' + ['testTargetMarket'] ); assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); diff --git a/test/type.triggeredSend.test.js b/test/type.triggeredSend.test.js index d0e8cafc3..847097ce3 100644 --- a/test/type.triggeredSend.test.js +++ b/test/type.triggeredSend.test.js @@ -91,7 +91,7 @@ describe('type: triggeredSend', () => { 'testInstance/testBU', 'triggeredSend', ['testExisting_triggeredSend'], - 'testSourceMarket' + ['testSourceMarket'] ); assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); assert.equal( @@ -112,7 +112,7 @@ describe('type: triggeredSend', () => { 'testInstance/testBU', 'triggeredSend', ['testExisting_triggeredSend'], - 'testTargetMarket' + ['testTargetMarket'] ); assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); assert.deepEqual( @@ -138,7 +138,7 @@ describe('type: triggeredSend', () => { 'testInstance/testBU', 'triggeredSend', ['testExisting_triggeredSend', 'testExisting_triggeredSend_rcb'], - 'testSourceMarket' + ['testSourceMarket'] ); // WHEN assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); diff --git a/test/type.user.test.js b/test/type.user.test.js index f88042ca8..f22424b5f 100644 --- a/test/type.user.test.js +++ b/test/type.user.test.js @@ -182,7 +182,7 @@ describe('type: user', () => { 'testInstance/_ParentBU_', 'user', ['testExisting_user'], - 'testSourceMarket' + ['testSourceMarket'] ); assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); // WHEN @@ -201,7 +201,7 @@ describe('type: user', () => { 'testInstance/_ParentBU_', 'user', ['testExisting_user'], - 'testTargetMarket' + ['testTargetMarket'] ); assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); diff --git a/test/type.verification.test.js b/test/type.verification.test.js index 34a17cc16..936f56651 100644 --- a/test/type.verification.test.js +++ b/test/type.verification.test.js @@ -113,7 +113,7 @@ describe('type: verification', () => { 'testInstance/testBU', 'verification', ['testExisting_39f6a488-20eb-4ba0-b0b9'], - 'testSourceMarket' + ['testSourceMarket'] ); assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); assert.equal( @@ -134,7 +134,7 @@ describe('type: verification', () => { 'testInstance/testBU', 'verification', ['testExisting_39f6a488-20eb-4ba0-b0b9'], - 'testTargetMarket' + ['testTargetMarket'] ); assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); assert.deepEqual( From 978daefec828a56c5943cc5538e29fd73159b982 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Thu, 29 Aug 2024 01:08:14 +0200 Subject: [PATCH 43/43] #1522: support double-array of markets in marketLists / buildDefinitionBulk --- @types/lib/Builder.d.ts.map | 2 +- lib/Builder.js | 35 +++++++++++++++++++---------------- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/@types/lib/Builder.d.ts.map b/@types/lib/Builder.d.ts.map index 4926d9727..2057fca31 100644 --- a/@types/lib/Builder.d.ts.map +++ b/@types/lib/Builder.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Builder.d.ts","sourceRoot":"","sources":["../../lib/Builder.js"],"names":[],"mappings":";uBAUa,OAAO,qBAAqB,EAAE,QAAQ;0BACtC,OAAO,qBAAqB,EAAE,WAAW;8BACzC,OAAO,qBAAqB,EAAE,eAAe;sBAC7C,OAAO,qBAAqB,EAAE,OAAO;+BACrC,OAAO,qBAAqB,EAAE,gBAAgB;mCAC9C,OAAO,qBAAqB,EAAE,oBAAoB;kCAClD,OAAO,qBAAqB,EAAE,mBAAmB;8BACjD,OAAO,qBAAqB,EAAE,eAAe;iCAC7C,OAAO,qBAAqB,EAAE,kBAAkB;oCAChD,OAAO,qBAAqB,EAAE,qBAAqB;gCACnD,OAAO,qBAAqB,EAAE,iBAAiB;0BAC/C,OAAO,qBAAqB,EAAE,WAAW;AAZtD;;;;;;;;;;;;;GAaG;AAEH;;GAEG;AACH;IAuEI;;;;;;;;OAQG;IACH,mCANW,MAAM,gBACN,MAAM,UACN,MAAM,EAAE,aACR,MAAM,EAAE,GACN,OAAO,CAAE,qBAAqB,CAAC,CA+B3C;IA2CD;;;;;;;;OAQG;IACH,qCANW,MAAM,gBACN,MAAM,WACN,MAAM,EAAE,aACR,MAAM,EAAE,GACN,OAAO,CAAE,qBAAqB,CAAC,CA+B3C;IAED;;;;;;;OAOG;IACH,qCALW,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,OAAO,CAAE,MAAM,CAAC,CAoD5B;IAzPD;;;;;;OAMG;IACH,wBAJW,OAAO,YAEP,QAAQ,EAyBlB;IAtBG,kDAA4B;IAC5B,oBAAkD;IAClD,oBAIE;IACF,iDAAwB;IAMxB,oBAGC;IAED;;OAEG;IACH,UAFU,qBAAqB,CAEb;IAGtB;;;;;;;OAOG;IACH,+BALW,MAAM,WACN,MAAM,EAAE,qBACR,WAAW,GACT,OAAO,CAAE,qBAAqB,CAAC,CA8B3C;IA0CD;;;;;;;OAOG;IACH,6BALW,MAAM,UACN,MAAM,EAAE,qBACR,WAAW,GACT,OAAO,CAAE,qBAAqB,CAAC,CAiC3C;CAqGJ"} \ No newline at end of file +{"version":3,"file":"Builder.d.ts","sourceRoot":"","sources":["../../lib/Builder.js"],"names":[],"mappings":";uBAUa,OAAO,qBAAqB,EAAE,QAAQ;0BACtC,OAAO,qBAAqB,EAAE,WAAW;8BACzC,OAAO,qBAAqB,EAAE,eAAe;sBAC7C,OAAO,qBAAqB,EAAE,OAAO;+BACrC,OAAO,qBAAqB,EAAE,gBAAgB;mCAC9C,OAAO,qBAAqB,EAAE,oBAAoB;kCAClD,OAAO,qBAAqB,EAAE,mBAAmB;8BACjD,OAAO,qBAAqB,EAAE,eAAe;iCAC7C,OAAO,qBAAqB,EAAE,kBAAkB;oCAChD,OAAO,qBAAqB,EAAE,qBAAqB;gCACnD,OAAO,qBAAqB,EAAE,iBAAiB;0BAC/C,OAAO,qBAAqB,EAAE,WAAW;AAZtD;;;;;;;;;;;;;GAaG;AAEH;;GAEG;AACH;IAuEI;;;;;;;;OAQG;IACH,mCANW,MAAM,gBACN,MAAM,UACN,MAAM,EAAE,aACR,MAAM,EAAE,GACN,OAAO,CAAE,qBAAqB,CAAC,CA+B3C;IA2CD;;;;;;;;OAQG;IACH,qCANW,MAAM,gBACN,MAAM,WACN,MAAM,EAAE,aACR,MAAM,EAAE,GACN,OAAO,CAAE,qBAAqB,CAAC,CA+B3C;IAED;;;;;;;OAOG;IACH,qCALW,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,OAAO,CAAE,MAAM,CAAC,CAuD5B;IA5PD;;;;;;OAMG;IACH,wBAJW,OAAO,YAEP,QAAQ,EAyBlB;IAtBG,kDAA4B;IAC5B,oBAAkD;IAClD,oBAIE;IACF,iDAAwB;IAMxB,oBAGC;IAED;;OAEG;IACH,UAFU,qBAAqB,CAEb;IAGtB;;;;;;;OAOG;IACH,+BALW,MAAM,WACN,MAAM,EAAE,qBACR,WAAW,GACT,OAAO,CAAE,qBAAqB,CAAC,CA8B3C;IA0CD;;;;;;;OAOG;IACH,6BALW,MAAM,UACN,MAAM,EAAE,qBACR,WAAW,GACT,OAAO,CAAE,qBAAqB,CAAC,CAiC3C;CAwGJ"} \ No newline at end of file diff --git a/lib/Builder.js b/lib/Builder.js index fb8497561..4637e4230 100644 --- a/lib/Builder.js +++ b/lib/Builder.js @@ -249,25 +249,28 @@ saved continue; } i++; + /** @type {string | string[] | string[][]} */ const market = properties.marketList[listName][businessUnit]; - let marketList = []; - if ('string' === typeof market) { - marketList.push(market); - } else { - marketList = market; - } + const marketList = 'string' === typeof market ? [market] : market; + for (const market of marketList) { - if (Util.checkMarket(market, properties)) { - Util.logger.info(`Executing for '${businessUnit}': '${market}'`); - // omitting "await" to speed up creation - responseObj[businessUnit] ||= {}; - responseObj[businessUnit][market] = await this.buildDefinition( - businessUnit, - type, - nameArr, - market - ); + // one can now send multiple markets to buildTemplate/buildDefinition and hence that also needs to work for marketLists + const marketArr = 'string' === typeof market ? [market] : market; + for (const market of marketArr) { + if (!Util.checkMarket(market, properties)) { + return; + } } + + Util.logger.info(`Executing for '${businessUnit}': '${marketArr.join('-')}'`); + // omitting "await" to speed up creation + responseObj[businessUnit] ||= {}; + responseObj[businessUnit][marketArr.join('-')] = await this.buildDefinition( + businessUnit, + type, + nameArr, + marketArr + ); } }