From ed13296e52cd71ba3abc3ea8f361ce3f3fa257e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Thu, 29 Aug 2024 23:31:31 +0200 Subject: [PATCH 1/5] #1631: ensure Common fields are tracked but originals are kept on Contact/Lead --- lib/metadataTypes/Event.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/metadataTypes/Event.js b/lib/metadataTypes/Event.js index 97260bd49..eca47d7f5 100644 --- a/lib/metadataTypes/Event.js +++ b/lib/metadataTypes/Event.js @@ -607,13 +607,12 @@ class Event extends MetadataType { 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] = structuredClone( + 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]; + // do not delete fields from Contact or Lead because it depends on the environment where we have to look for those } // create duplicate to also reference this via "Common" this.sfObjects.objectFields['Common'] = From 94f62a69c301c9b7f6bcf4fb3c117d6067c63064 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 30 Aug 2024 00:04:56 +0200 Subject: [PATCH 2/5] #1631: correct common-vs-contact logic and fix check of ca.contactKey logic --- @types/lib/metadataTypes/Event.d.ts.map | 2 +- @types/lib/metadataTypes/Journey.d.ts.map | 2 +- lib/metadataTypes/Event.js | 133 +++++++++++----------- 3 files changed, 69 insertions(+), 68 deletions(-) diff --git a/@types/lib/metadataTypes/Event.d.ts.map b/@types/lib/metadataTypes/Event.d.ts.map index 44fe4f61b..28ac17a6c 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,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA77BwB,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,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA77BwB,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 892627aa2..c45080e38 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":";uBAca,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,kBA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAj7DwB,mBAAmB"} \ No newline at end of file diff --git a/lib/metadataTypes/Event.js b/lib/metadataTypes/Event.js index eca47d7f5..73b787fef 100644 --- a/lib/metadataTypes/Event.js +++ b/lib/metadataTypes/Event.js @@ -646,6 +646,8 @@ class Event extends MetadataType { const dePrefixFields = {}; const dePrefixRelationshipMap = {}; const dePrefixReferenceObjectMap = {}; + const checkCommon = ca.whoToInject === 'Contact ID/Lead ID (Contacts and Leads)'; + Util.logger.info(Util.getGrayMsg(' - Checking eventDataConfig')); for (const object of edcObjects) { // create secondary object to quickly check eventDataSummary against dePrefixFields[object.dePrefix] = object.fields; @@ -670,23 +672,23 @@ 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]) { - 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 { - // TODO reactivate after switch to new API - // errors.push( - // `Salesforce object field ${referencedObject}.${fieldName} not available on connected org.` - // ); - } + if ( + checkCommon && + (referencedObject === 'Contact' || referencedObject === 'Lead') && + this.sfObjects.objectFields['Common'][fieldName] + ) { + errors.push( + `Salesforce object field ${referencedObject}.${fieldName} needs to be referenced as Common.${fieldName}` + ); + } else if (!this.sfObjects.objectFields[referencedObject][fieldName]) { + // 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 if (!ca.eventDataSummary.includes(object.dePrefix + fieldName)) { + // TODO instead, remove in postRetrieve and re-add in preDeploy errors.push( `Field ${object.dePrefix + fieldName} is listed under eventDataConfig for referenceObject ${object.referenceObject} but not in eventDataSummary` ); @@ -699,6 +701,7 @@ class Event extends MetadataType { // check if all fields in eventDataSummary are listed in the eventDataConfig for (let fieldName of ca.eventDataSummary) { + // TODO instead, remove in postRetrieve and re-add in preDeploy const fieldPath = fieldName.split(':'); fieldName = fieldPath.pop(); const dePrefix = fieldPath.join(':') + ':'; @@ -711,60 +714,58 @@ class Event extends MetadataType { // 3 check contactKey // check against referencedObjects - // 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` - // ); - // } + 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 contactKey uses "Common" then there is no fieldName attribute but instead relationshipIdName needs to be checked + if ( + checkCommon && + 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 if ( + !this.sfObjects.objectFields[ca.contactKey.referenceObjectName]?.[ + ca.contactKey.fieldName || ca.contactKey.relationshipIdName + ] + ) { + 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 - // 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(':'); From 7c631424acdfec43338ad6419463f85ebda5aee5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 30 Aug 2024 00:33:24 +0200 Subject: [PATCH 3/5] #1631: checks on passThroughArgument, primaryObjectFilterCriteria, relatedObjectFilterCriteria --- @types/lib/metadataTypes/Event.d.ts | 7 ++ @types/lib/metadataTypes/Event.d.ts.map | 2 +- lib/metadataTypes/Event.js | 106 ++++++++++++++---------- 3 files changed, 72 insertions(+), 43 deletions(-) diff --git a/@types/lib/metadataTypes/Event.d.ts b/@types/lib/metadataTypes/Event.d.ts index a90790c9b..8fd9a904c 100644 --- a/@types/lib/metadataTypes/Event.d.ts +++ b/@types/lib/metadataTypes/Event.d.ts @@ -114,6 +114,13 @@ declare class Event extends MetadataType { * @param {any} ca trigger[0].configurationArguments */ static checkSalesforceEntryEvents(ca: any): void; + /** + * + * @param {object[]} conditions - + * @param {string[]} errors list of errors + * @param {'primaryObjectFilterCriteria'|'relatedObjectFilterCriteria'} context used to improve error logs + */ + static checkSfFilterFieldsExist(conditions: object[], errors: string[], context: "primaryObjectFilterCriteria" | "relatedObjectFilterCriteria"): void; static requiredConfigurationArguments: string[]; /** * diff --git a/@types/lib/metadataTypes/Event.d.ts.map b/@types/lib/metadataTypes/Event.d.ts.map index 28ac17a6c..a1c4c5cb0 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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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAn9BwB,mBAAmB"} \ No newline at end of file diff --git a/lib/metadataTypes/Event.js b/lib/metadataTypes/Event.js index 73b787fef..45c00b65c 100644 --- a/lib/metadataTypes/Event.js +++ b/lib/metadataTypes/Event.js @@ -647,7 +647,6 @@ class Event extends MetadataType { const dePrefixRelationshipMap = {}; const dePrefixReferenceObjectMap = {}; const checkCommon = ca.whoToInject === 'Contact ID/Lead ID (Contacts and Leads)'; - Util.logger.info(Util.getGrayMsg(' - Checking eventDataConfig')); for (const object of edcObjects) { // create secondary object to quickly check eventDataSummary against dePrefixFields[object.dePrefix] = object.fields; @@ -766,53 +765,55 @@ class Event extends MetadataType { } // 4 check passThroughArgument - // 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 + 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]; + const referenceObject = dePrefixReferenceObjectMap[dePrefix]; + + if (!this.sfObjects.objectFields[referenceObject]?.[fieldName]) { + errors.push( + `Field ${dePrefix + fieldName} is listed under passThroughArgument.fields.${key} but is not available on connected org.` + ); + } else if ( + checkCommon && + (relationshipName === 'Contact' || relationshipName === 'Lead') && + this.sfObjects.objectFields['Common']?.[fieldName] + ) { + errors.push( + `Field ${dePrefix + fieldName} is listed under passThroughArgument.fields.${key} but needs to be referenced as ${dePrefixCommon}.${fieldName}` + ); + } + } + + // 5.a check primaryObjectFilterCriteria + this.checkSfFilterFieldsExist( + ca.primaryObjectFilterCriteria.conditions, + errors, + 'primaryObjectFilterCriteria' + ); + + // 5.b check relatedObjectFilterCriteria + this.checkSfFilterFieldsExist( + ca.relatedObjectFilterCriteria.conditions, + errors, + 'relatedObjectFilterCriteria' + ); - // 6 remove primaryObjectFilterSummary (and auto-generate it again in preDeploy from primaryObjectFilterCriteria) + // 6.a remove primaryObjectFilterSummary (and auto-generate it again in preDeploy from primaryObjectFilterCriteria) + // TODO + // 6.b remove relatedObjectFilterSummary (and auto-generate it again in preDeploy from relatedObjectFilterCriteria) // TODO // 7 remove eventDataSummary (and auto-generate it again in preDeploy from eventDataConfig) // TODO + // 8 remove evaluationCriteriaSummary (and auto-generate it again in preDeploy from salesforceTriggerCriteria) + // TODO + // throw error if problems were found if (errors?.length) { // add a line break @@ -821,6 +822,27 @@ class Event extends MetadataType { } } + /** + * + * @param {object[]} conditions - + * @param {string[]} errors list of errors + * @param {'primaryObjectFilterCriteria'|'relatedObjectFilterCriteria'} context used to improve error logs + */ + static checkSfFilterFieldsExist(conditions, errors, context) { + for (const condition of conditions) { + if ( + condition.fieldName & condition.referenceObjectName && + !this.sfObjects.objectFields[condition.referenceObjectName]?.[condition.fieldName] + ) { + errors.push( + `Field ${condition.referenceObjectName}.${condition.fieldName} is listed under ${context} but is not available on connected org.` + ); + } else if (condition.conditions) { + this.checkSfFilterFieldsExist(condition.conditions, errors, context); + } + } + } + static requiredConfigurationArguments = [ 'applicationExtensionKey', 'contactKey', From ec7cacfc478f37bc2911e6a911e808f272b0c065 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 30 Aug 2024 11:23:15 +0200 Subject: [PATCH 4/5] Revert "#1570: disable beautyAmp for *.html files again" This reverts commit 0e7a251e283d762bc0ed096cdf752ddceb4cb00d. html formatting totally ruined ampscript after this change --- .vscode/settings.json | 2 +- boilerplate/files/.vscode/settings.json | 5 +++-- boilerplate/forcedUpdates.json | 4 ++++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index ded56bd88..28bc58f4a 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -20,7 +20,7 @@ "sql-formatter.indent": " ", "sql-formatter.uppercase": true, "[html]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" + "editor.defaultFormatter": "FiB.beautyAmp" }, "[javascript]": { "editor.defaultFormatter": "esbenp.prettier-vscode" diff --git a/boilerplate/files/.vscode/settings.json b/boilerplate/files/.vscode/settings.json index 0426edcfa..78687da09 100644 --- a/boilerplate/files/.vscode/settings.json +++ b/boilerplate/files/.vscode/settings.json @@ -37,7 +37,8 @@ }, "editor.formatOnSave": true, "files.associations": { - "*.ssjs": "javascript" + "*.ssjs": "javascript", + "*.html": "ampscript" }, "files.eol": "\n", "files.exclude": { @@ -48,7 +49,7 @@ "editor.defaultFormatter": "esbenp.prettier-vscode" }, "[html]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" + "editor.defaultFormatter": "FiB.beautyAmp" }, "[javascript]": { "editor.defaultFormatter": "esbenp.prettier-vscode" diff --git a/boilerplate/forcedUpdates.json b/boilerplate/forcedUpdates.json index ec8df521e..ca781e5f5 100644 --- a/boilerplate/forcedUpdates.json +++ b/boilerplate/forcedUpdates.json @@ -1,4 +1,8 @@ [ + { + "version": "7.3.1", + "files": [".vscode/settings.json"] + }, { "version": "7.3.0", "files": [".vscode/settings.json"] From fef681d3f96fa8f90404d00477bdb9b79c8a84c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 30 Aug 2024 11:26:08 +0200 Subject: [PATCH 5/5] #0: fix predeploy check of sf entry events in journeys --- lib/metadataTypes/Journey.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/metadataTypes/Journey.js b/lib/metadataTypes/Journey.js index e7b5ed7c8..1a0480ced 100644 --- a/lib/metadataTypes/Journey.js +++ b/lib/metadataTypes/Journey.js @@ -1035,7 +1035,7 @@ class Journey extends MetadataType { delete config.r__dataExtension_key; } } - Event.preDeployTasks_SalesforceEntryEvents( + await Event.preDeployTasks_SalesforceEntryEvents( metadata.triggers[0].type, metadata.triggers[0].configurationArguments );