mcdev 7.3.0 → 7.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -39,6 +39,7 @@ body:
39
39
  label: Version
40
40
  description: What version of our software are you running? (mcdev --version)
41
41
  options:
42
+ - 7.3.1
42
43
  - 7.3.0
43
44
  - 7.2.0
44
45
  - 7.1.4
@@ -5,9 +5,8 @@
5
5
  ### Before merge
6
6
 
7
7
  - [ ] Wiki updated with info in ticket listed under **Documentation**
8
- - [ ] ran `npm audit fix`
9
- - [ ] ran `npm run lint-ts`
10
- - [ ] ran `npm run lint:fix`
8
+ - [ ] ran `npm run prepare-release` (which runs `npm audit fix`, `npm run lint-ts`, `npm run lint:fix`, `git add`, `git commit`)
9
+ - [ ] pushed potential changes made by prepare-release
11
10
 
12
11
  ### After merge
13
12
 
@@ -15,6 +14,7 @@
15
14
  - [ ] updated [bug template](/.github/ISSUE_TEMPLATE/bug.yml) to include the new version
16
15
  - [ ] updated [.mcdevrc](/test/mockRoot/.mcdevrc.json) for tests to the new version
17
16
  - [ ] ran `npm run version:major/minor/patch`
17
+ - [ ] pushed version-prep commits
18
18
  - [ ] merged main branch into develop branch
19
19
  - [ ] closed GitHub milestone
20
20
  - [ ] created [new GitHub Release](https://github.com/Accenture/sfmc-devtools/releases/new)
@@ -20,7 +20,7 @@
20
20
  "sql-formatter.indent": " ",
21
21
  "sql-formatter.uppercase": true,
22
22
  "[html]": {
23
- "editor.defaultFormatter": "esbenp.prettier-vscode"
23
+ "editor.defaultFormatter": "FiB.beautyAmp"
24
24
  },
25
25
  "[javascript]": {
26
26
  "editor.defaultFormatter": "esbenp.prettier-vscode"
@@ -114,6 +114,13 @@ declare class Event extends MetadataType {
114
114
  * @param {any} ca trigger[0].configurationArguments
115
115
  */
116
116
  static checkSalesforceEntryEvents(ca: any): void;
117
+ /**
118
+ *
119
+ * @param {object[]} conditions -
120
+ * @param {string[]} errors list of errors
121
+ * @param {'primaryObjectFilterCriteria'|'relatedObjectFilterCriteria'} context used to improve error logs
122
+ */
123
+ static checkSfFilterFieldsExist(conditions: object[], errors: string[], context: "primaryObjectFilterCriteria" | "relatedObjectFilterCriteria"): void;
117
124
  static requiredConfigurationArguments: string[];
118
125
  /**
119
126
  *
@@ -1 +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;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAn9BwB,mBAAmB"}
@@ -108,10 +108,11 @@ declare class Journey extends MetadataType {
108
108
  *
109
109
  * @param {string} statusUrl URL to check the status of the publish request
110
110
  * @param {string} key key or id for log messages
111
+ * @param {any} spinner key or id for log messages
111
112
  * @param {number} [tries] number of tries used to check the status
112
113
  * @returns {Promise.<string>} key of the item that was published successfully
113
114
  */
114
- static _checkPublishStatus(statusUrl: string, key: string, tries?: number): Promise<string>;
115
+ static _checkPublishStatus(statusUrl: string, key: string, spinner: any, tries?: number): Promise<string>;
115
116
  /**
116
117
  * helper for {@link Journey._checkPublishStatus}
117
118
  *
@@ -1 +1 @@
1
- {"version":3,"file":"Journey.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/Journey.js"],"names":[],"mappings":";uBAaa,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;;;;;OAKG;IACH,mCAHW,gBAAgB,GACd,OAAO,CAAE,gBAAgB,CAAC,CAsMtC;IAED;;;;;OAKG;IACH,6CA2aC;IAED;;;;;;OAMG;IACH,gCAHW,gBAAgB,GACd,OAAO,CAAE,gBAAgB,CAAC,CA+ItC;IAED;;;;;OAKG;IACH,0CA6MC;IA4LD;;;;OAIG;IACH,sCAFW,eAAe,iBAWzB;IAED;;;;;OAKG;IACH,uBAHW,MAAM,EAAE,GACN,OAAO,CAAE,MAAM,EAAE,CAAC,CAkO9B;IAED;;;;;;;OAOG;IACH,sCALW,MAAM,OACN,MAAM,UACN,MA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA55DwB,mBAAmB"}
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,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;;;;;OAKG;IACH,mCAHW,gBAAgB,GACd,OAAO,CAAE,gBAAgB,CAAC,CAsMtC;IAED;;;;;OAKG;IACH,6CA2aC;IAED;;;;;;OAMG;IACH,gCAHW,gBAAgB,GACd,OAAO,CAAE,gBAAgB,CAAC,CA+ItC;IAED;;;;;OAKG;IACH,0CA6MC;IA4LD;;;;OAIG;IACH,sCAFW,eAAe,iBAWzB;IAED;;;;;OAKG;IACH,uBAHW,MAAM,EAAE,GACN,OAAO,CAAE,MAAM,EAAE,CAAC,CAmP9B;IAED;;;;;;;;OAQG;IACH,sCANW,MAAM,OACN,MAAM,WACN,GAAG,UAC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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAj7DwB,mBAAmB"}
@@ -39,6 +39,13 @@ declare class Role extends MetadataType {
39
39
  * @returns {Promise.<MetadataTypeMapObj>} Metadata store object
40
40
  */
41
41
  static retrieve(retrieveDir: string, _?: void | string[], ___?: void | string[], key?: string): Promise<MetadataTypeMapObj>;
42
+ /**
43
+ * adds default roles to the list of retrieved roles for proper caching (but not storing)
44
+ * also caches available timezones for retrieve-user
45
+ *
46
+ * @param {MetadataTypeMap} parsed list or previously retrieved items as reference
47
+ */
48
+ static cacheDefaultRolesAndTimezones(parsed: MetadataTypeMap): Promise<void>;
42
49
  /**
43
50
  * Gets executed before deploying metadata
44
51
  *
@@ -1 +1 @@
1
- {"version":3,"file":"Role.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/Role.js"],"names":[],"mappings":";uBAQa,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;kCAClD,OAAO,wBAAwB,EAAE,mBAAmB;0BACpD,OAAO,wBAAwB,EAAE,WAAW;AAXzD;;;;;;;;;;;;GAYG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,QACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,OAAO,CAAE,kBAAkB,CAAC,CAsFxC;IAED;;;;;OAKG;IACH,gCAHW,gBAAgB,GACd,gBAAgB,CAS5B;IAED;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAK1B;IA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I,CAAC,CA4G1B;IAED;;;;;;;;;;OAUG;IACH,4BAPW,MAAM,WACN,MAAM,eACN,MAAM,cACN,MAAM,GAEJ,IAAI,CAyDhB;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA5VwB,mBAAmB"}
@@ -37,7 +37,8 @@
37
37
  },
38
38
  "editor.formatOnSave": true,
39
39
  "files.associations": {
40
- "*.ssjs": "javascript"
40
+ "*.ssjs": "javascript",
41
+ "*.html": "ampscript"
41
42
  },
42
43
  "files.eol": "\n",
43
44
  "files.exclude": {
@@ -48,7 +49,7 @@
48
49
  "editor.defaultFormatter": "esbenp.prettier-vscode"
49
50
  },
50
51
  "[html]": {
51
- "editor.defaultFormatter": "esbenp.prettier-vscode"
52
+ "editor.defaultFormatter": "FiB.beautyAmp"
52
53
  },
53
54
  "[javascript]": {
54
55
  "editor.defaultFormatter": "esbenp.prettier-vscode"
@@ -1,4 +1,8 @@
1
1
  [
2
+ {
3
+ "version": "7.3.1",
4
+ "files": [".vscode/settings.json"]
5
+ },
2
6
  {
3
7
  "version": "7.3.0",
4
8
  "files": [".vscode/settings.json"]
@@ -607,13 +607,12 @@ class Event extends MetadataType {
607
607
  leadFieldNames.includes(item)
608
608
  )) {
609
609
  // copy the value from contact - while thats not perfectly correct it will hopefully be sufficient for what we need to check
610
- this.sfObjects.objectFields[contactLeadName][fieldName] =
611
- this.sfObjects.objectFields['Contact'][fieldName];
610
+ this.sfObjects.objectFields[contactLeadName][fieldName] = structuredClone(
611
+ this.sfObjects.objectFields['Contact'][fieldName]
612
+ );
612
613
  this.sfObjects.objectFields[contactLeadName][fieldName].objectname = 'Common';
613
614
 
614
- // delete the field from Contact obj and from Lead obj
615
- delete this.sfObjects.objectFields['Contact'][fieldName];
616
- delete this.sfObjects.objectFields['Lead'][fieldName];
615
+ // do not delete fields from Contact or Lead because it depends on the environment where we have to look for those
617
616
  }
618
617
  // create duplicate to also reference this via "Common"
619
618
  this.sfObjects.objectFields['Common'] =
@@ -647,6 +646,7 @@ class Event extends MetadataType {
647
646
  const dePrefixFields = {};
648
647
  const dePrefixRelationshipMap = {};
649
648
  const dePrefixReferenceObjectMap = {};
649
+ const checkCommon = ca.whoToInject === 'Contact ID/Lead ID (Contacts and Leads)';
650
650
  for (const object of edcObjects) {
651
651
  // create secondary object to quickly check eventDataSummary against
652
652
  dePrefixFields[object.dePrefix] = object.fields;
@@ -671,23 +671,23 @@ class Event extends MetadataType {
671
671
  } else {
672
672
  // check if the fields selected in the eventDefinition are actually available
673
673
  for (const fieldName of object.fields) {
674
- if (!this.sfObjects.objectFields[referencedObject][fieldName]) {
675
- if (
676
- (referencedObject === 'Contact' || referencedObject === 'Lead') &&
677
- this.sfObjects.objectFields['Contacts and Leads'][fieldName]
678
- ) {
679
- errors.push(
680
- `Salesforce object field ${referencedObject}.${fieldName} needs to be referenced as Common.${fieldName}`
681
- );
682
- } else {
683
- // TODO reactivate after switch to new API
684
- // errors.push(
685
- // `Salesforce object field ${referencedObject}.${fieldName} not available on connected org.`
686
- // );
687
- }
674
+ if (
675
+ checkCommon &&
676
+ (referencedObject === 'Contact' || referencedObject === 'Lead') &&
677
+ this.sfObjects.objectFields['Common'][fieldName]
678
+ ) {
679
+ errors.push(
680
+ `Salesforce object field ${referencedObject}.${fieldName} needs to be referenced as Common.${fieldName}`
681
+ );
682
+ } else if (!this.sfObjects.objectFields[referencedObject][fieldName]) {
683
+ // TODO reactivate after switch to new API
684
+ // errors.push(
685
+ // `Salesforce object field ${referencedObject}.${fieldName} not available on connected org.`
686
+ // );
688
687
  }
689
688
  // 1.2 check if all fields in eventDataConfig are listed in the eventDataSummary
690
689
  if (!ca.eventDataSummary.includes(object.dePrefix + fieldName)) {
690
+ // TODO instead, remove in postRetrieve and re-add in preDeploy
691
691
  errors.push(
692
692
  `Field ${object.dePrefix + fieldName} is listed under eventDataConfig for referenceObject ${object.referenceObject} but not in eventDataSummary`
693
693
  );
@@ -700,6 +700,7 @@ class Event extends MetadataType {
700
700
  // check if all fields in eventDataSummary are listed in the eventDataConfig
701
701
 
702
702
  for (let fieldName of ca.eventDataSummary) {
703
+ // TODO instead, remove in postRetrieve and re-add in preDeploy
703
704
  const fieldPath = fieldName.split(':');
704
705
  fieldName = fieldPath.pop();
705
706
  const dePrefix = fieldPath.join(':') + ':';
@@ -712,107 +713,107 @@ class Event extends MetadataType {
712
713
 
713
714
  // 3 check contactKey
714
715
  // check against referencedObjects
715
- // const referencedContactObj = this.sfObjects.referencedObjects[ca.objectAPIName].find(
716
- // (el) =>
717
- // el.relationshipName ===
718
- // (ca.contactKey.relationshipName == ''
719
- // ? ca.contactKey.referenceObjectName
720
- // : ca.contactKey.relationshipName)
721
- // );
722
- // if (referencedContactObj) {
723
- // if (
724
- // ca.contactKey.isPolymorphic &&
725
- // referencedContactObj.isPolymorphic !== ca.contactKey.isPolymorphic
726
- // ) {
727
- // errors.push(
728
- // `configurationArguments.contactKey states an incorrect isPolimorphic value. Should be ${referencedContactObj.isPolymorphic}`
729
- // );
730
- // }
731
- // if (referencedContactObj.referenceObjectName !== ca.contactKey.referenceObjectName) {
732
- // errors.push(
733
- // `configurationArguments.contactKey states an incorrect referenceObjectName value. Should be ${referencedContactObj.referenceObjectName}`
734
- // );
735
- // }
736
- // if (
737
- // !this.sfObjects.objectFields[ca.contactKey.referenceObjectName]?.[
738
- // ca.contactKey.fieldName || ca.contactKey.relationshipIdName
739
- // ]
740
- // ) {
741
- // // * if contactKey uses "Common" then there is no fieldName attribute but instead relationshipIdName needs to be checked
742
- // if (
743
- // ca.contactKey.referenceObjectName === 'Contact' &&
744
- // this.sfObjects.objectFields['Common'][
745
- // ca.contactKey.fieldName || ca.contactKey.relationshipIdName
746
- // ]
747
- // ) {
748
- // errors.push(
749
- // `configurationArguments.contactKey should be referencing Common instead of Contact`
750
- // );
751
- // } else {
752
- // errors.push(
753
- // `configurationArguments.contactKey states the invalid fieldName '${ca.contactKey.fieldName || ca.contactKey.relationshipIdName}' value that does not exist on ${ca.contactKey.referenceObjectName}`
754
- // );
755
- // }
756
- // }
757
- // } else {
758
- // errors.push(
759
- // `configurationArguments.contactKey references ${
760
- // ca.contactKey.relationshipName == ''
761
- // ? ca.contactKey.referenceObjectName
762
- // : ca.contactKey.relationshipName
763
- // } which is not found in related salesforce objects`
764
- // );
765
- // }
716
+ const referencedContactObj = this.sfObjects.referencedObjects[ca.objectAPIName].find(
717
+ (el) =>
718
+ el.relationshipName ===
719
+ (ca.contactKey.relationshipName == ''
720
+ ? ca.contactKey.referenceObjectName
721
+ : ca.contactKey.relationshipName)
722
+ );
723
+ if (referencedContactObj) {
724
+ if (
725
+ ca.contactKey.isPolymorphic &&
726
+ referencedContactObj.isPolymorphic !== ca.contactKey.isPolymorphic
727
+ ) {
728
+ errors.push(
729
+ `configurationArguments.contactKey states an incorrect isPolimorphic value. Should be ${referencedContactObj.isPolymorphic}`
730
+ );
731
+ }
732
+ if (referencedContactObj.referenceObjectName !== ca.contactKey.referenceObjectName) {
733
+ errors.push(
734
+ `configurationArguments.contactKey states an incorrect referenceObjectName value. Should be ${referencedContactObj.referenceObjectName}`
735
+ );
736
+ }
737
+ // * if contactKey uses "Common" then there is no fieldName attribute but instead relationshipIdName needs to be checked
738
+ if (
739
+ checkCommon &&
740
+ ca.contactKey.referenceObjectName === 'Contact' &&
741
+ this.sfObjects.objectFields['Common'][
742
+ ca.contactKey.fieldName || ca.contactKey.relationshipIdName
743
+ ]
744
+ ) {
745
+ errors.push(
746
+ `configurationArguments.contactKey should be referencing Common instead of Contact`
747
+ );
748
+ } else if (
749
+ !this.sfObjects.objectFields[ca.contactKey.referenceObjectName]?.[
750
+ ca.contactKey.fieldName || ca.contactKey.relationshipIdName
751
+ ]
752
+ ) {
753
+ errors.push(
754
+ `configurationArguments.contactKey states the invalid fieldName '${ca.contactKey.fieldName || ca.contactKey.relationshipIdName}' value that does not exist on ${ca.contactKey.referenceObjectName}`
755
+ );
756
+ }
757
+ } else {
758
+ errors.push(
759
+ `configurationArguments.contactKey references ${
760
+ ca.contactKey.relationshipName == ''
761
+ ? ca.contactKey.referenceObjectName
762
+ : ca.contactKey.relationshipName
763
+ } which is not found in related salesforce objects`
764
+ );
765
+ }
766
766
 
767
767
  // 4 check passThroughArgument
768
- // TODO check where Common vs Contact is really required
769
- // const dePrefixCommon = ca.objectAPIName + ':Common';
770
- // for (const key of Object.keys(ca.passThroughArgument.fields)) {
771
- // const fieldPath = ca.passThroughArgument.fields[key].split(':');
772
- // const fieldName = fieldPath.pop();
773
- // const dePrefix = fieldPath.join(':') + ':';
774
- // // it seems these fields do NOT need to be in the eventDataConfig
775
- // const relationshipName = dePrefixRelationshipMap[dePrefix];
776
- // let referenceObject = dePrefixReferenceObjectMap[dePrefix];
777
- // if (
778
- // relationshipName !== 'Contact' &&
779
- // referenceObject === 'Contact' &&
780
- // !this.sfObjects.objectFields[referenceObject][fieldName] &&
781
- // this.sfObjects.objectFields['Common']
782
- // ) {
783
- // // 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
784
- // referenceObject = 'Common';
785
- // }
786
- // if (
787
- // !this.sfObjects.objectFields[referenceObject]?.[fieldName] &&
788
- // relationshipName !== 'Contact' &&
789
- // referenceObject === 'Contact' &&
790
- // !this.sfObjects.objectFields['Common']?.[fieldName]
791
- // ) {
792
- // if (
793
- // (relationshipName === 'Contact' || relationshipName === 'Lead') &&
794
- // this.sfObjects.objectFields['Common']?.[fieldName]
795
- // ) {
796
- // errors.push(
797
- // `(${referenceObject})(${relationshipName}) Field ${dePrefix + fieldName} is listed under passThroughArgument.fields.${key} but needs to be referenced as ${dePrefixCommon}.${fieldName}`
798
- // );
799
- // } else {
800
- // errors.push(
801
- // `(${referenceObject})(${relationshipName}) Field ${dePrefix + fieldName} is listed under passThroughArgument.fields.${key} but is not available on connected org.`
802
- // );
803
- // }
804
- // }
805
- // }
806
-
807
- // 5 check primaryObjectFilterCriteria
808
- // TODO
768
+ const dePrefixCommon = ca.objectAPIName + ':Common';
769
+ for (const key of Object.keys(ca.passThroughArgument.fields)) {
770
+ const fieldPath = ca.passThroughArgument.fields[key].split(':');
771
+ const fieldName = fieldPath.pop();
772
+ const dePrefix = fieldPath.join(':') + ':';
773
+ // it seems these fields do NOT need to be in the eventDataConfig
774
+ const relationshipName = dePrefixRelationshipMap[dePrefix];
775
+ const referenceObject = dePrefixReferenceObjectMap[dePrefix];
776
+
777
+ if (!this.sfObjects.objectFields[referenceObject]?.[fieldName]) {
778
+ errors.push(
779
+ `Field ${dePrefix + fieldName} is listed under passThroughArgument.fields.${key} but is not available on connected org.`
780
+ );
781
+ } else if (
782
+ checkCommon &&
783
+ (relationshipName === 'Contact' || relationshipName === 'Lead') &&
784
+ this.sfObjects.objectFields['Common']?.[fieldName]
785
+ ) {
786
+ errors.push(
787
+ `Field ${dePrefix + fieldName} is listed under passThroughArgument.fields.${key} but needs to be referenced as ${dePrefixCommon}.${fieldName}`
788
+ );
789
+ }
790
+ }
791
+
792
+ // 5.a check primaryObjectFilterCriteria
793
+ this.checkSfFilterFieldsExist(
794
+ ca.primaryObjectFilterCriteria.conditions,
795
+ errors,
796
+ 'primaryObjectFilterCriteria'
797
+ );
798
+
799
+ // 5.b check relatedObjectFilterCriteria
800
+ this.checkSfFilterFieldsExist(
801
+ ca.relatedObjectFilterCriteria.conditions,
802
+ errors,
803
+ 'relatedObjectFilterCriteria'
804
+ );
809
805
 
810
- // 6 remove primaryObjectFilterSummary (and auto-generate it again in preDeploy from primaryObjectFilterCriteria)
806
+ // 6.a remove primaryObjectFilterSummary (and auto-generate it again in preDeploy from primaryObjectFilterCriteria)
807
+ // TODO
808
+ // 6.b remove relatedObjectFilterSummary (and auto-generate it again in preDeploy from relatedObjectFilterCriteria)
811
809
  // TODO
812
810
 
813
811
  // 7 remove eventDataSummary (and auto-generate it again in preDeploy from eventDataConfig)
814
812
  // TODO
815
813
 
814
+ // 8 remove evaluationCriteriaSummary (and auto-generate it again in preDeploy from salesforceTriggerCriteria)
815
+ // TODO
816
+
816
817
  // throw error if problems were found
817
818
  if (errors?.length) {
818
819
  // add a line break
@@ -821,6 +822,27 @@ class Event extends MetadataType {
821
822
  }
822
823
  }
823
824
 
825
+ /**
826
+ *
827
+ * @param {object[]} conditions -
828
+ * @param {string[]} errors list of errors
829
+ * @param {'primaryObjectFilterCriteria'|'relatedObjectFilterCriteria'} context used to improve error logs
830
+ */
831
+ static checkSfFilterFieldsExist(conditions, errors, context) {
832
+ for (const condition of conditions) {
833
+ if (
834
+ condition.fieldName & condition.referenceObjectName &&
835
+ !this.sfObjects.objectFields[condition.referenceObjectName]?.[condition.fieldName]
836
+ ) {
837
+ errors.push(
838
+ `Field ${condition.referenceObjectName}.${condition.fieldName} is listed under ${context} but is not available on connected org.`
839
+ );
840
+ } else if (condition.conditions) {
841
+ this.checkSfFilterFieldsExist(condition.conditions, errors, context);
842
+ }
843
+ }
844
+ }
845
+
824
846
  static requiredConfigurationArguments = [
825
847
  'applicationExtensionKey',
826
848
  'contactKey',
@@ -9,6 +9,7 @@ import File from '../util/file.js';
9
9
  import ReplaceCbReference from '../util/replaceContentBlockReference.js';
10
10
  import Retriever from '../Retriever.js';
11
11
  import pLimit from 'p-limit';
12
+ import yoctoSpinner from 'yocto-spinner';
12
13
 
13
14
  /**
14
15
  * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject
@@ -1034,7 +1035,7 @@ class Journey extends MetadataType {
1034
1035
  delete config.r__dataExtension_key;
1035
1036
  }
1036
1037
  }
1037
- Event.preDeployTasks_SalesforceEntryEvents(
1038
+ await Event.preDeployTasks_SalesforceEntryEvents(
1038
1039
  metadata.triggers[0].type,
1039
1040
  metadata.triggers[0].configurationArguments
1040
1041
  );
@@ -1557,7 +1558,6 @@ class Journey extends MetadataType {
1557
1558
  * @returns {Promise.<string[]>} Returns list of updated keys/ids that were published. Success could only be seen with a delay in the UI because the publish-endpoint is async
1558
1559
  */
1559
1560
  static async publish(keyArr) {
1560
- const resultsJourney = [];
1561
1561
  const resultsTransactional = [];
1562
1562
  // works only with objectId
1563
1563
  const statusUrls = [];
@@ -1646,7 +1646,7 @@ class Journey extends MetadataType {
1646
1646
  Util.logger.info(
1647
1647
  ` - published ${this.definition.type}: ${
1648
1648
  journey[this.definition.nameField]
1649
- } (${journey[this.definition.keyField]} by creating the matching transactionalEmail`
1649
+ } (${journey[this.definition.keyField]}) by creating the matching transactionalEmail`
1650
1650
  );
1651
1651
  statusUrls.push({ key, statusUrl: response.statusUrl });
1652
1652
  }
@@ -1679,66 +1679,84 @@ class Journey extends MetadataType {
1679
1679
  );
1680
1680
  break;
1681
1681
  }
1682
- case 'Multistep':
1683
- case 'Quicksend': {
1684
- resultsJourney.push(
1685
- (async () => {
1686
- try {
1687
- const response = await this.client.rest.post(
1688
- `/interaction/v1/interactions/publishAsync/${journey.id}?versionNumber=${version}`,
1689
- {}
1690
- ); // payload is empty for this request
1691
- if (response.statusUrl && response.statusId) {
1692
- Util.logger.info(
1693
- ` - queued for publishing ${this.definition.type}: ${key}`
1694
- );
1695
- statusUrls.push({ key, statusUrl: response.statusUrl });
1696
- } else {
1697
- throw new Error(response);
1698
- }
1699
- return journey.key;
1700
- } catch (ex) {
1701
- if (
1702
- ex.message === 'Cannot publish interaction in Published status.'
1703
- ) {
1704
- Util.logger.info(
1705
- ` - ${this.definition.type} ${key} is already published`
1706
- );
1707
- } else if (
1708
- ex.message === 'Cannot publish interaction in Stopped status.'
1709
- ) {
1710
- Util.logger.warn(
1711
- ` - ${this.definition.type} ${key} is already published but stopped. Please resume it manually.`
1712
- );
1713
- } else {
1714
- Util.logger.error(
1715
- `Failed to publish ${this.definition.type} ${key}: ${ex.message}`
1716
- );
1717
- }
1682
+ case 'Multistep': {
1683
+ // SF Event, Api Event Journeys
1684
+ // ! for SF-triggered journeys this cannot be asynchronous or it will cause a race-condition (see #1627 for details); the requests are accepted but then processed sequentually anyways, eliminating potential speed gains.
1685
+ // It is unknown if the same would happen for API-event journeys but given that it's the same endpoint, lets not risk it and run this sequentially
1686
+ let statusUrl;
1687
+ try {
1688
+ const response = await this.client.rest.post(
1689
+ `/interaction/v1/interactions/publishAsync/${journey.id}?versionNumber=${version}`,
1690
+ {}
1691
+ ); // payload is empty for this request
1692
+ if (response.statusUrl && response.statusId) {
1693
+ Util.logger.info(
1694
+ ` - ${this.definition.type} queued for publishing : ${key}/${version}`
1695
+ );
1696
+ statusUrl = response.statusUrl;
1697
+ } else {
1698
+ throw new Error(response);
1699
+ }
1700
+ if (!Util.OPTIONS.skipStatusCheck && statusUrl) {
1701
+ const spinner = yoctoSpinner({
1702
+ text: `Publishing journey…`,
1703
+ }).start();
1704
+
1705
+ await Util.sleep(1000);
1706
+ executedKeyArr.push(
1707
+ await this._checkPublishStatus(statusUrl, key, spinner)
1708
+ );
1709
+ } else {
1710
+ // no guarantees if the journey was actually published
1711
+ executedKeyArr.push(key);
1712
+ }
1713
+ } catch (ex) {
1714
+ switch (ex.message) {
1715
+ case 'Cannot publish interaction in Published status.': {
1716
+ Util.logger.info(
1717
+ ` - ${this.definition.type} ${key}/${version} is already published.`
1718
+ );
1719
+
1720
+ break;
1718
1721
  }
1719
- })()
1722
+ case 'Cannot publish interaction in Stopped status.': {
1723
+ Util.logger.warn(
1724
+ ` - ${this.definition.type} ${key}/${version} is stopped. Please create a new version and publish that.`
1725
+ );
1726
+
1727
+ break;
1728
+ }
1729
+ case 'Cannot publish interaction in Paused status.': {
1730
+ Util.logger.warn(
1731
+ ` - ${this.definition.type} ${key}/${version} is already published but currently paused. Run 'mcdev resume' instead.`
1732
+ );
1733
+
1734
+ break;
1735
+ }
1736
+ default: {
1737
+ Util.logger.error(
1738
+ `Failed to publish ${this.definition.type} ${key}: ${ex.message}`
1739
+ );
1740
+ }
1741
+ }
1742
+ }
1743
+ break;
1744
+ }
1745
+ default: {
1746
+ throw new Error(
1747
+ `${this.definition.type} type ${journey.definitionType} not supported yet by publish method`
1720
1748
  );
1721
1749
  }
1722
1750
  }
1723
1751
  } // for loop
1724
- if (resultsJourney.length) {
1725
- Util.logger.info(`Found ${resultsJourney.length} journey results`);
1726
- executedKeyArr.push(...(await Promise.all(resultsJourney)).filter(Boolean));
1727
1752
 
1728
- if (!Util.OPTIONS.skipStatusCheck && statusUrls.length) {
1729
- Util.logger.info(
1730
- `Checking status of ${statusUrls.length} published item${statusUrls.length === 1 ? '' : 's'}`
1731
- );
1732
- executedKeyArr.length = 0;
1733
- await Util.sleep(5000);
1734
- for (const item of statusUrls) {
1735
- executedKeyArr.push(await this._checkPublishStatus(item.statusUrl, item.key));
1736
- }
1737
- }
1738
- }
1753
+ // Transactional Send Journeys
1739
1754
  if (resultsTransactional.length) {
1740
- Util.logger.info(`Found ${resultsTransactional.length} journey results`);
1755
+ const spinner = yoctoSpinner({
1756
+ text: `Publishing ${resultsTransactional.length} transactional journey${resultsTransactional.length === 1 ? '' : 's'}…`,
1757
+ }).start();
1741
1758
  const transactionalKeyArr = (await Promise.all(resultsTransactional)).filter(Boolean);
1759
+ spinner.success('done.');
1742
1760
  executedKeyArr.push(...transactionalKeyArr);
1743
1761
 
1744
1762
  Util.logger.info('Retrieving relevant journeys');
@@ -1787,30 +1805,33 @@ class Journey extends MetadataType {
1787
1805
  *
1788
1806
  * @param {string} statusUrl URL to check the status of the publish request
1789
1807
  * @param {string} key key or id for log messages
1808
+ * @param {any} spinner key or id for log messages
1790
1809
  * @param {number} [tries] number of tries used to check the status
1791
1810
  * @returns {Promise.<string>} key of the item that was published successfully
1792
1811
  */
1793
- static async _checkPublishStatus(statusUrl, key, tries = 1) {
1812
+ static async _checkPublishStatus(statusUrl, key, spinner, tries = 1) {
1794
1813
  try {
1795
1814
  const response = await this.client.rest.get(statusUrl);
1796
1815
  switch (response.status) {
1797
1816
  case 'PublishCompleted': {
1817
+ spinner.success('done.');
1798
1818
  Util.logger.info(` - ${this.definition.type} ${key}: publishing succeeded`);
1799
1819
  this._showPublishStatusDetails(response);
1800
1820
  return key;
1801
1821
  }
1802
1822
  case 'PublishInProcess': {
1803
- Util.logger.info(
1823
+ Util.logger.debug(
1804
1824
  ` - ${this.definition.type} ${key}: publishing still in progress`
1805
1825
  );
1806
1826
  if (tries < 50) {
1807
1827
  await (tries < 10 ? Util.sleep(2000) : Util.sleep(5000));
1808
- return await this._checkPublishStatus(statusUrl, key, tries + 1);
1828
+ return await this._checkPublishStatus(statusUrl, key, spinner, tries + 1);
1809
1829
  } else {
1810
1830
  return;
1811
1831
  }
1812
1832
  }
1813
1833
  case 'Error': {
1834
+ spinner.success('failed.');
1814
1835
  Util.logger.error(` - ${this.definition.type} ${key}: publishing failed.`);
1815
1836
  this._showPublishStatusDetails(response);
1816
1837
  return;
@@ -1907,7 +1928,7 @@ class Journey extends MetadataType {
1907
1928
  return stoppedKeyArr;
1908
1929
  }
1909
1930
  /**
1910
- * pauses all journey versions
1931
+ * pauses selected journey versions
1911
1932
  *
1912
1933
  * @param {string[]} keyArr customerkey of the metadata
1913
1934
  * @returns {Promise.<string[]>} Returns list of keys that were paused
@@ -73,41 +73,6 @@ class Role extends MetadataType {
73
73
  const results = await this.client.soap.retrieve('Role', fields, requestParams);
74
74
 
75
75
  const parsed = this.parseResponseBody(results);
76
- if (!retrieveDir) {
77
- // retrieve "Marketing Cloud%" roles not returned by SOAP API
78
- const { roles, timeZones } = await this.client.rest.get(
79
- '/platform/v1/setup/quickflow/data'
80
- );
81
- // this endpoint does not provide keys
82
- const roleNameKeyMap = {
83
- 'Marketing Cloud Administrator': 'SYS_DEF_IMHADMIN',
84
- 'Marketing Cloud Channel Manager': 'SYS_DEF_CHANNELMANAGER',
85
- 'Marketing Cloud Content Editor/Publisher': 'SYS_DEF_CONTENTEDIT',
86
- 'Marketing Cloud Security Administrator': 'SYS_DEF_SECURITYADMIN',
87
- 'Marketing Cloud Viewer': 'SYS_DEF_VIEWER',
88
- };
89
- for (const role of roles) {
90
- if (roleNameKeyMap[role.roleName]) {
91
- parsed[roleNameKeyMap[role.roleName]] = {
92
- CustomerKey: roleNameKeyMap[role.roleName],
93
- Name: role.roleName,
94
- ObjectID: role.roleID,
95
- Desscription: role.description,
96
- CreatedDate: '2012-02-21T02:09:19.983',
97
- IsSystemDefined: true,
98
- c__notAssignable: true,
99
- };
100
- }
101
- }
102
- // the languages object is incomplete. the actual list is much longer --> ignoring it here
103
- // convert timeZones to object
104
- const timeZonesObj = {};
105
- for (const timeZone of timeZones) {
106
- timeZonesObj[timeZone.id] = timeZone;
107
- }
108
- // cache timeZones to share it with other type-classes
109
- cache.setMetadata('_timezone', timeZonesObj);
110
- }
111
76
  if (retrieveDir) {
112
77
  const savedMetadata = await super.saveResults(parsed, retrieveDir, null);
113
78
  Util.logger.info(
@@ -117,9 +82,56 @@ class Role extends MetadataType {
117
82
 
118
83
  await this.runDocumentOnRetrieve(key, savedMetadata);
119
84
  }
85
+
86
+ await this.cacheDefaultRolesAndTimezones(parsed);
87
+
120
88
  return { metadata: parsed, type: this.definition.type };
121
89
  }
122
90
 
91
+ /**
92
+ * adds default roles to the list of retrieved roles for proper caching (but not storing)
93
+ * also caches available timezones for retrieve-user
94
+ *
95
+ * @param {MetadataTypeMap} parsed list or previously retrieved items as reference
96
+ */
97
+ static async cacheDefaultRolesAndTimezones(parsed) {
98
+ // retrieve "Marketing Cloud%" roles not returned by SOAP API for cache (required by retrieve-user)
99
+ // also cache available timezones for retrieve-user
100
+ Util.logger.info(Util.getGrayMsg(' - Caching default roles and timezones'));
101
+ const { roles, timeZones } = await this.client.rest.get(
102
+ '/platform/v1/setup/quickflow/data'
103
+ );
104
+ // this endpoint does not provide keys
105
+ const roleNameKeyMap = {
106
+ 'Marketing Cloud Administrator': 'SYS_DEF_IMHADMIN',
107
+ 'Marketing Cloud Channel Manager': 'SYS_DEF_CHANNELMANAGER',
108
+ 'Marketing Cloud Content Editor/Publisher': 'SYS_DEF_CONTENTEDIT',
109
+ 'Marketing Cloud Security Administrator': 'SYS_DEF_SECURITYADMIN',
110
+ 'Marketing Cloud Viewer': 'SYS_DEF_VIEWER',
111
+ };
112
+ for (const role of roles) {
113
+ if (roleNameKeyMap[role.roleName]) {
114
+ parsed[roleNameKeyMap[role.roleName]] = {
115
+ CustomerKey: roleNameKeyMap[role.roleName],
116
+ Name: role.roleName,
117
+ ObjectID: role.roleID,
118
+ Desscription: role.description,
119
+ CreatedDate: '2012-02-21T02:09:19.983',
120
+ IsSystemDefined: true,
121
+ c__notAssignable: true,
122
+ };
123
+ }
124
+ }
125
+ // the languages object is incomplete. the actual list is much longer --> ignoring it here
126
+ // convert timeZones to object
127
+ const timeZonesObj = {};
128
+ for (const timeZone of timeZones) {
129
+ timeZonesObj[timeZone.id] = timeZone;
130
+ }
131
+ // cache timeZones to share it with other type-classes
132
+ cache.setMetadata('_timezone', timeZonesObj);
133
+ }
134
+
123
135
  /**
124
136
  * Gets executed before deploying metadata
125
137
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcdev",
3
- "version": "7.3.0",
3
+ "version": "7.3.1",
4
4
  "description": "Accenture Salesforce Marketing Cloud DevTools",
5
5
  "author": "Accenture: joern.berkefeld, douglas.midgley, robert.zimmermann, maciej.barnas",
6
6
  "license": "MIT",
@@ -59,6 +59,10 @@
59
59
  "lint-and-test": "run-s lint test",
60
60
  "test": "mocha --reporter-option maxDiffSize=25000",
61
61
  "coverage": "c8 npm run test",
62
+ "prepare-release:audit-fix": "npm audit fix",
63
+ "prepare-release:git-stage": "git add .",
64
+ "prepare-release:git-commit": "git commit -n -m \"prepare-release changes\"",
65
+ "prepare-release": "run-s prepare-release:audit-fix lint-ts lint:fix prepare-release:git-stage prepare-release:git-commit",
62
66
  "version:major": "npm version --no-commit-hooks major",
63
67
  "version:minor": "npm version --no-commit-hooks minor",
64
68
  "version:patch": "npm version --no-commit-hooks patch"
@@ -83,7 +87,8 @@
83
87
  "toposort": "2.0.2",
84
88
  "update-notifier": "7.2.0",
85
89
  "winston": "3.14.2",
86
- "yargs": "17.7.2"
90
+ "yargs": "17.7.2",
91
+ "yocto-spinner": "0.1.0"
87
92
  },
88
93
  "devDependencies": {
89
94
  "@eslint/js": "9.9.0",
@@ -2067,7 +2067,10 @@ describe('GENERAL', () => {
2067
2067
  describe('Publish --metadata ~~~', () => {
2068
2068
  it('Should publish the journey', async () => {
2069
2069
  handler.setOptions({ skipStatusCheck: true });
2070
- const argvMetadata = ['journey:id:3c3f4112-9b43-43ca-8a89-aa0375b2c1a2/1'];
2070
+ const argvMetadata = [
2071
+ 'journey:testExisting_journey_Multistep',
2072
+ 'journey:testExisting_temail_notPublished',
2073
+ ];
2071
2074
  const typeKeyCombo = handler.metadataToTypeKey(argvMetadata);
2072
2075
  // WHEN
2073
2076
  const publish = await handler.publish('testInstance/testBU', typeKeyCombo);
@@ -2075,7 +2078,7 @@ describe('GENERAL', () => {
2075
2078
  assert.equal(process.exitCode, 0, 'publish should not have thrown an error');
2076
2079
  assert.deepEqual(
2077
2080
  publish['testInstance/testBU']?.journey,
2078
- ['testExisting_journey_Quicksend'],
2081
+ ['testExisting_journey_Multistep', 'testExisting_temail_notPublished'],
2079
2082
  'should have published the right journey'
2080
2083
  );
2081
2084
  return;
@@ -100,5 +100,5 @@
100
100
  "verification"
101
101
  ]
102
102
  },
103
- "version": "7.3.0"
103
+ "version": "7.3.1"
104
104
  }
@@ -593,14 +593,14 @@ describe('type: journey', () => {
593
593
  const publish = await handler.publish(
594
594
  'testInstance/testBU',
595
595
  ['journey'],
596
- ['testExisting_journey_Quicksend']
596
+ ['testExisting_journey_Multistep']
597
597
  );
598
598
  // THEN
599
599
  assert.equal(process.exitCode, 0, 'publish should not have thrown an error');
600
600
  // retrieve result
601
601
  assert.deepEqual(
602
602
  publish['testInstance/testBU']?.journey,
603
- ['testExisting_journey_Quicksend'],
603
+ ['testExisting_journey_Multistep'],
604
604
  'should have published the right journey'
605
605
  );
606
606
 
@@ -630,14 +630,14 @@ describe('type: journey', () => {
630
630
  const publish = await handler.publish(
631
631
  'testInstance/testBU',
632
632
  ['journey'],
633
- ['id:3c3f4112-9b43-43ca-8a89-aa0375b2c1a2/1']
633
+ ['id:0175b971-71a3-4d8e-98ac-48121f3fbf4f/1']
634
634
  );
635
635
  // THEN
636
636
  assert.equal(process.exitCode, 0, 'publish should not have thrown an error');
637
637
  // retrieve result
638
638
  assert.deepEqual(
639
639
  publish['testInstance/testBU']?.journey,
640
- ['testExisting_journey_Quicksend'],
640
+ ['id:0175b971-71a3-4d8e-98ac-48121f3fbf4f/1'],
641
641
  'should have published the right journey'
642
642
  );
643
643
 
@@ -666,14 +666,14 @@ describe('type: journey', () => {
666
666
  const publish = await handler.publish(
667
667
  'testInstance/testBU',
668
668
  ['journey'],
669
- ['id:3c3f4112-9b43-43ca-8a89-aa0375b2c1a2']
669
+ ['id:0175b971-71a3-4d8e-98ac-48121f3fbf4f']
670
670
  );
671
671
  // THEN
672
672
  assert.equal(process.exitCode, 0, 'publish should not have thrown an error');
673
673
  // retrieve result
674
674
  assert.deepEqual(
675
675
  publish['testInstance/testBU']?.journey,
676
- ['testExisting_journey_Quicksend'],
676
+ ['id:0175b971-71a3-4d8e-98ac-48121f3fbf4f'],
677
677
  'should have published the right journey'
678
678
  );
679
679
 
@@ -708,7 +708,7 @@ describe('type: journey', () => {
708
708
  const publish = await handler.publish(
709
709
  'testInstance/testBU',
710
710
  ['journey'],
711
- ['id:3c3f4112-9b43-43ca-8a89-aa0375b2c1a2/1']
711
+ ['id:0175b971-71a3-4d8e-98ac-48121f3fbf4f/1']
712
712
  );
713
713
  // THEN
714
714
  assert.equal(process.exitCode, 1, 'publish should have thrown an error');
@@ -750,14 +750,14 @@ describe('type: journey', () => {
750
750
  const publish = await handler.publish(
751
751
  'testInstance/testBU',
752
752
  ['journey'],
753
- ['id:3c3f4112-9b43-43ca-8a89-aa0375b2c1a2/1']
753
+ ['id:0175b971-71a3-4d8e-98ac-48121f3fbf4f/1']
754
754
  );
755
755
  // THEN
756
756
  assert.equal(process.exitCode, 0, 'publish should not have thrown an error');
757
757
  // retrieve result
758
758
  assert.deepEqual(
759
759
  publish['testInstance/testBU']?.journey,
760
- ['id:3c3f4112-9b43-43ca-8a89-aa0375b2c1a2/1'],
760
+ ['id:0175b971-71a3-4d8e-98ac-48121f3fbf4f/1'],
761
761
  'should have published the journey'
762
762
  );
763
763
 
@@ -792,14 +792,14 @@ describe('type: journey', () => {
792
792
  const publish = await handler.publish(
793
793
  'testInstance/testBU',
794
794
  ['journey'],
795
- ['id:3c3f4112-9b43-43ca-8a89-aa0375b2c1a2/1']
795
+ ['id:0175b971-71a3-4d8e-98ac-48121f3fbf4f/1']
796
796
  );
797
797
  // THEN
798
798
  assert.equal(process.exitCode, 0, 'publish should not have thrown an error');
799
799
  // retrieve result
800
800
  assert.deepEqual(
801
801
  publish['testInstance/testBU']?.journey,
802
- ['id:3c3f4112-9b43-43ca-8a89-aa0375b2c1a2/1'],
802
+ ['id:0175b971-71a3-4d8e-98ac-48121f3fbf4f/1'],
803
803
  'should have published the journey'
804
804
  );
805
805