mcdev 9.0.2 → 9.0.4

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.
Files changed (82) hide show
  1. package/.github/ISSUE_TEMPLATE/bug.yml +1 -0
  2. package/.github/copilot-instructions.md +85 -0
  3. package/.github/pr-labeler.yml +3 -3
  4. package/.github/workflows/code-test.yml +3 -3
  5. package/.github/workflows/coverage-base-update.yml +2 -2
  6. package/.github/workflows/coverage.yml +1 -1
  7. package/.github/workflows/npm-publish.yml +71 -3
  8. package/.github/workflows/sync-milestone.yml +55 -0
  9. package/.husky/post-checkout +1 -1
  10. package/@types/lib/Retriever.d.ts.map +1 -1
  11. package/@types/lib/metadataTypes/Asset.d.ts +0 -21
  12. package/@types/lib/metadataTypes/Asset.d.ts.map +1 -1
  13. package/@types/lib/metadataTypes/Automation.d.ts +11 -2
  14. package/@types/lib/metadataTypes/Automation.d.ts.map +1 -1
  15. package/@types/lib/metadataTypes/DataExtension.d.ts +4 -2
  16. package/@types/lib/metadataTypes/DataExtension.d.ts.map +1 -1
  17. package/@types/lib/metadataTypes/DataExtensionField.d.ts +25 -0
  18. package/@types/lib/metadataTypes/DataExtensionField.d.ts.map +1 -1
  19. package/@types/lib/metadataTypes/Event.d.ts +6 -6
  20. package/@types/lib/metadataTypes/Event.d.ts.map +1 -1
  21. package/@types/lib/metadataTypes/Filter.d.ts +1 -1
  22. package/@types/lib/metadataTypes/Folder.d.ts +12 -4
  23. package/@types/lib/metadataTypes/Folder.d.ts.map +1 -1
  24. package/@types/lib/metadataTypes/ImportFile.d.ts +2 -2
  25. package/@types/lib/metadataTypes/ImportFile.d.ts.map +1 -1
  26. package/@types/lib/metadataTypes/Journey.d.ts.map +1 -1
  27. package/@types/lib/metadataTypes/MetadataType.d.ts +16 -6
  28. package/@types/lib/metadataTypes/MetadataType.d.ts.map +1 -1
  29. package/@types/lib/metadataTypes/SenderProfile.d.ts +7 -2
  30. package/@types/lib/metadataTypes/SenderProfile.d.ts.map +1 -1
  31. package/@types/lib/metadataTypes/definitions/Filter.definition.d.ts +1 -1
  32. package/@types/lib/util/cache.d.ts.map +1 -1
  33. package/@types/lib/util/cli.d.ts.map +1 -1
  34. package/@types/lib/util/util.d.ts +44 -26
  35. package/@types/lib/util/util.d.ts.map +1 -1
  36. package/@types/lib/util/validations.d.ts +6 -3
  37. package/@types/lib/util/validations.d.ts.map +1 -1
  38. package/@types/types/mcdev.d.d.ts +12 -12
  39. package/@types/types/mcdev.d.d.ts.map +1 -1
  40. package/README.md +6 -2
  41. package/lib/Retriever.js +2 -1
  42. package/lib/index.js +2 -2
  43. package/lib/metadataTypes/Automation.js +2 -2
  44. package/lib/metadataTypes/DataExtension.js +60 -1
  45. package/lib/metadataTypes/DataExtensionField.js +114 -0
  46. package/lib/metadataTypes/Event.js +3 -3
  47. package/lib/metadataTypes/Folder.js +2 -2
  48. package/lib/metadataTypes/ImportFile.js +1 -1
  49. package/lib/metadataTypes/Journey.js +82 -39
  50. package/lib/metadataTypes/MetadataType.js +27 -11
  51. package/lib/metadataTypes/SenderProfile.js +1 -1
  52. package/lib/metadataTypes/definitions/Filter.definition.js +2 -3
  53. package/lib/util/auth.js +7 -2
  54. package/lib/util/cache.js +5 -3
  55. package/lib/util/cli.js +3 -0
  56. package/lib/util/util.js +17 -15
  57. package/lib/util/validations.js +2 -2
  58. package/package.json +12 -12
  59. package/test/general.test.js +11 -11
  60. package/test/mock-fs-windows.test.js +54 -0
  61. package/test/mockRoot/.mcdev-validations.js +3 -3
  62. package/test/mockRoot/.mcdevrc.json +1 -1
  63. package/test/mockRoot/deploy/testInstance/testBU/journey/testExisting_journey_updatecontact_sharedDE.journey-meta.json +108 -0
  64. package/test/release-hotfix.test.js +97 -0
  65. package/test/resources/1111111/dataExtension/template_sharedDE-expected.json +53 -0
  66. package/test/resources/9999999/automation/v1/queries/get-response.json +17 -0
  67. package/test/resources/9999999/interaction/v1/interactions/get-response.json +40 -2
  68. package/test/resources/9999999/interaction/v1/interactions/key_testExisting_journey_updatecontact/get-response.json +4 -4
  69. package/test/resources/9999999/interaction/v1/interactions/key_testExisting_journey_updatecontact_sharedDE/get-response.json +119 -0
  70. package/test/resources/9999999/interaction/v1/interactions/key_testExisting_journey_updatecontact_sharedDE/put-response.json +110 -0
  71. package/test/resources/9999999/journey/get-updatecontact-sharedDE-expected.json +108 -0
  72. package/test/resources/9999999/journey/put-updatecontact-sharedDE-expected.json +108 -0
  73. package/test/resources/9999999/query/get_sharedDE-expected.json +11 -0
  74. package/test/resources/9999999/query/get_sharedDE-expected.sql +7 -0
  75. package/test/resources/9999999/query/template_sharedDE-expected.json +8 -0
  76. package/test/resources/9999999/query/template_sharedDE-expected.sql +7 -0
  77. package/test/type.attributeSet.test.js +41 -0
  78. package/test/type.automation.test.js +1 -1
  79. package/test/type.journey.test.js +108 -6
  80. package/test/type.query.test.js +105 -8
  81. package/test/utils.js +4 -1
  82. package/types/mcdev.d.js +13 -7
@@ -1,5 +1,5 @@
1
1
  {
2
- "count": 3,
2
+ "count": 6,
3
3
  "page": 1,
4
4
  "pageSize": 500,
5
5
  "links": {},
@@ -206,6 +206,44 @@
206
206
  "status": "Draft",
207
207
  "scheduledStatus": "Draft",
208
208
  "r__folder_Path": "my journeys"
209
+ },
210
+ {
211
+ "key": "testExisting_journey_updatecontact_sharedDE",
212
+ "name": "testExisting_journey_updatecontact_sharedDE",
213
+ "lastPublishedDate": "0001-01-01T00:00:00",
214
+ "description": "",
215
+ "version": 1,
216
+ "workflowApiVersion": 1,
217
+ "createdDate": "2024-05-04T05:54:48.027",
218
+ "modifiedDate": "2024-05-04T17:25:57.9",
219
+ "goals": [],
220
+ "exits": [],
221
+ "notifiers": [],
222
+ "entryMode": "NotSet",
223
+ "definitionType": "Multistep",
224
+ "channel": "",
225
+ "defaults": {
226
+ "email": [
227
+ "{{Event.DEAudience-2e3c73b6-48cc-2ec0-5522-48636e1a236e.\"Email\"}}"
228
+ ],
229
+ "properties": {
230
+ "analyticsTracking": {
231
+ "enabled": true,
232
+ "analyticsType": "google",
233
+ "urlDomainsToTrack": []
234
+ }
235
+ }
236
+ },
237
+ "metaData": {
238
+ "dataSource": "ContactsModel",
239
+ "highThroughputSending": {
240
+ "email": false
241
+ }
242
+ },
243
+ "executionMode": "Production",
244
+ "status": "Draft",
245
+ "scheduledStatus": "Draft",
246
+ "r__folder_Path": "my journeys"
209
247
  }
210
248
  ]
211
- }
249
+ }
@@ -27,9 +27,9 @@
27
27
  "activityData": {
28
28
  "updateContactFields": [
29
29
  {
30
- "r__dataExtensionField_name": "LastName",
31
- "value": "TEST",
32
- "r__dataExtension_key": "testExisting_dataExtension"
30
+ "dataExtensionId": "21711373-72c1-ec11-b83b-48df37d1deb7",
31
+ "field": "bea0e308-5d45-4181-a673-da9972a7c674",
32
+ "value": "TEST"
33
33
  }
34
34
  ]
35
35
  }
@@ -116,4 +116,4 @@
116
116
  "status": "Draft",
117
117
  "definitionId": "0175b971-71a3-4d8e-98ac-48121f3fbf4f",
118
118
  "scheduledStatus": "Draft"
119
- }
119
+ }
@@ -0,0 +1,119 @@
1
+ {
2
+ "id": "shared-journey-id-1234",
3
+ "key": "testExisting_journey_updatecontact_sharedDE",
4
+ "name": "testExisting_journey_updatecontact_sharedDE",
5
+ "lastPublishedDate": "0001-01-01T00:00:00",
6
+ "description": "",
7
+ "version": 1,
8
+ "workflowApiVersion": 1,
9
+ "createdDate": "2024-05-04T05:54:48.027",
10
+ "modifiedDate": "2024-05-04T17:25:57.9",
11
+ "activities": [
12
+ {
13
+ "key": "UPDATECONTACTDATAV2-1",
14
+ "name": "Update Contact - TEST",
15
+ "description": "",
16
+ "type": "UPDATECONTACTDATA",
17
+ "outcomes": [
18
+ {
19
+ "key": "9f21d42b-4679-4561-911a-4bccf84672ba",
20
+ "arguments": {},
21
+ "metaData": {
22
+ "invalid": false
23
+ }
24
+ }
25
+ ],
26
+ "arguments": {
27
+ "activityData": {
28
+ "updateContactFields": [
29
+ {
30
+ "dataExtensionId": "21711373-72c1-ec11-b83b-shared",
31
+ "field": "shared-bea0e308-5d45-4181-a673-da9972a7c674",
32
+ "value": "TEST"
33
+ }
34
+ ]
35
+ }
36
+ },
37
+ "configurationArguments": {},
38
+ "metaData": {
39
+ "isConfigured": true
40
+ },
41
+ "schema": {
42
+ "arguments": {
43
+ "activityData": {
44
+ "dataType": "Text",
45
+ "isNullable": false,
46
+ "direction": "In",
47
+ "readOnly": false,
48
+ "access": "Hidden"
49
+ },
50
+ "contactKey": {
51
+ "dataType": "Text",
52
+ "isNullable": false,
53
+ "direction": "In",
54
+ "readOnly": false,
55
+ "access": "Hidden"
56
+ }
57
+ }
58
+ }
59
+ }
60
+ ],
61
+ "triggers": [
62
+ {
63
+ "id": "92753481-1258-49bd-8a84-921ed63bcc2e",
64
+ "key": "TRIGGER",
65
+ "name": "TRIGGER",
66
+ "description": "",
67
+ "type": "EmailAudience",
68
+ "outcomes": [],
69
+ "arguments": {},
70
+ "configurationArguments": {},
71
+ "metaData": {
72
+ "eventDefinitionId": "649d512b-4d08-4eca-a14e-fc7b64b4ada8",
73
+ "eventDefinitionKey": "DEAudience-2e3c73b6-48cc-2ec0-5522-48636e1a236e",
74
+ "chainType": "None",
75
+ "configurationRequired": false,
76
+ "iconUrl": "/images/icon-data-extension.svg",
77
+ "title": "Data Extension",
78
+ "entrySourceGroupConfigUrl": "jb:///data/entry/audience/entrysourcegroupconfig.json",
79
+ "sourceInteractionId": "00000000-0000-0000-0000-000000000000"
80
+ }
81
+ }
82
+ ],
83
+ "goals": [],
84
+ "exits": [],
85
+ "notifiers": [],
86
+ "stats": {
87
+ "currentPopulation": 0,
88
+ "cumulativePopulation": 0,
89
+ "metGoal": 0,
90
+ "metExitCriteria": 0,
91
+ "goalPerformance": 0
92
+ },
93
+ "entryMode": "NotSet",
94
+ "definitionType": "Multistep",
95
+ "channel": "",
96
+ "defaults": {
97
+ "email": [
98
+ "{{Event.DEAudience-2e3c73b6-48cc-2ec0-5522-48636e1a236e.\"Email\"}}"
99
+ ],
100
+ "properties": {
101
+ "analyticsTracking": {
102
+ "enabled": true,
103
+ "analyticsType": "google",
104
+ "urlDomainsToTrack": []
105
+ }
106
+ }
107
+ },
108
+ "metaData": {
109
+ "dataSource": "ContactsModel",
110
+ "highThroughputSending": {
111
+ "email": false
112
+ }
113
+ },
114
+ "executionMode": "Production",
115
+ "categoryId": 6298,
116
+ "status": "Draft",
117
+ "definitionId": "shared-journey-id-1234",
118
+ "scheduledStatus": "Draft"
119
+ }
@@ -0,0 +1,110 @@
1
+ {
2
+ "key": "testExisting_journey_updatecontact_sharedDE",
3
+ "name": "testExisting_journey_updatecontact_sharedDE",
4
+ "lastPublishedDate": "0001-01-01T00:00:00",
5
+ "description": "",
6
+ "version": 1,
7
+ "workflowApiVersion": 1,
8
+ "createdDate": "0001-01-01T00:00:00",
9
+ "modifiedDate": "2024-05-04T17:25:57.9",
10
+ "activities": [
11
+ {
12
+ "key": "UPDATECONTACTDATAV2-1",
13
+ "name": "Update Contact - TEST",
14
+ "description": "",
15
+ "type": "UPDATECONTACTDATA",
16
+ "outcomes": [
17
+ {
18
+ "key": "9f21d42b-4679-4561-911a-4bccf84672ba",
19
+ "arguments": {},
20
+ "metaData": {
21
+ "invalid": false
22
+ }
23
+ }
24
+ ],
25
+ "arguments": {
26
+ "activityData": {
27
+ "updateContactFields": [
28
+ {
29
+ "field": "shared-bea0e308-5d45-4181-a673-da9972a7c674",
30
+ "value": "TEST",
31
+ "dataExtensionId": "21711373-72c1-ec11-b83b-shared"
32
+ }
33
+ ]
34
+ }
35
+ },
36
+ "configurationArguments": {},
37
+ "metaData": {
38
+ "isConfigured": true
39
+ },
40
+ "schema": {
41
+ "arguments": {
42
+ "activityData": {
43
+ "dataType": "Text",
44
+ "isNullable": false,
45
+ "direction": "In",
46
+ "readOnly": false,
47
+ "access": "Hidden"
48
+ },
49
+ "contactKey": {
50
+ "dataType": "Text",
51
+ "isNullable": false,
52
+ "direction": "In",
53
+ "readOnly": false,
54
+ "access": "Hidden"
55
+ }
56
+ }
57
+ }
58
+ }
59
+ ],
60
+ "triggers": [
61
+ {
62
+ "key": "TRIGGER",
63
+ "name": "TRIGGER",
64
+ "description": "",
65
+ "type": "EmailAudience",
66
+ "outcomes": [],
67
+ "arguments": {},
68
+ "configurationArguments": {},
69
+ "metaData": {
70
+ "r__event_key": "DEAudience-2e3c73b6-48cc-2ec0-5522-48636e1a236e",
71
+ "chainType": "None",
72
+ "configurationRequired": false,
73
+ "iconUrl": "/images/icon-data-extension.svg",
74
+ "title": "Data Extension",
75
+ "entrySourceGroupConfigUrl": "jb:///data/entry/audience/entrysourcegroupconfig.json",
76
+ "sourceInteractionId": "00000000-0000-0000-0000-000000000000"
77
+ }
78
+ }
79
+ ],
80
+ "goals": [],
81
+ "exits": [],
82
+ "notifiers": [],
83
+ "entryMode": "NotSet",
84
+ "definitionType": "Multistep",
85
+ "channel": "",
86
+ "defaults": {
87
+ "email": [
88
+ "{{Event.DEAudience-2e3c73b6-48cc-2ec0-5522-48636e1a236e.\"Email\"}}"
89
+ ],
90
+ "properties": {
91
+ "analyticsTracking": {
92
+ "enabled": true,
93
+ "analyticsType": "google",
94
+ "urlDomainsToTrack": []
95
+ }
96
+ }
97
+ },
98
+ "metaData": {
99
+ "dataSource": "ContactsModel",
100
+ "highThroughputSending": {
101
+ "email": false
102
+ }
103
+ },
104
+ "executionMode": "Production",
105
+ "status": "Draft",
106
+ "scheduledStatus": "Draft",
107
+ "r__folder_Path": "my journeys",
108
+ "id": "shared-journey-id-1234",
109
+ "definitionId": "shared-journey-id-1234"
110
+ }
@@ -0,0 +1,108 @@
1
+ {
2
+ "key": "testExisting_journey_updatecontact_sharedDE",
3
+ "name": "testExisting_journey_updatecontact_sharedDE",
4
+ "lastPublishedDate": "0001-01-01T00:00:00",
5
+ "description": "",
6
+ "version": 1,
7
+ "workflowApiVersion": 1,
8
+ "createdDate": "2024-05-04T05:54:48.027",
9
+ "modifiedDate": "2024-05-04T17:25:57.9",
10
+ "activities": [
11
+ {
12
+ "key": "UPDATECONTACTDATAV2-1",
13
+ "name": "Update Contact - TEST",
14
+ "description": "",
15
+ "type": "UPDATECONTACTDATA",
16
+ "outcomes": [
17
+ {
18
+ "key": "9f21d42b-4679-4561-911a-4bccf84672ba",
19
+ "arguments": {},
20
+ "metaData": {
21
+ "invalid": false
22
+ }
23
+ }
24
+ ],
25
+ "arguments": {
26
+ "activityData": {
27
+ "updateContactFields": [
28
+ {
29
+ "r__dataExtensionField_name": "LastName",
30
+ "value": "TEST",
31
+ "r__dataExtension_key": "testExisting_dataExtensionShared"
32
+ }
33
+ ]
34
+ }
35
+ },
36
+ "configurationArguments": {},
37
+ "metaData": {
38
+ "isConfigured": true
39
+ },
40
+ "schema": {
41
+ "arguments": {
42
+ "activityData": {
43
+ "dataType": "Text",
44
+ "isNullable": false,
45
+ "direction": "In",
46
+ "readOnly": false,
47
+ "access": "Hidden"
48
+ },
49
+ "contactKey": {
50
+ "dataType": "Text",
51
+ "isNullable": false,
52
+ "direction": "In",
53
+ "readOnly": false,
54
+ "access": "Hidden"
55
+ }
56
+ }
57
+ }
58
+ }
59
+ ],
60
+ "triggers": [
61
+ {
62
+ "key": "TRIGGER",
63
+ "name": "TRIGGER",
64
+ "description": "",
65
+ "type": "EmailAudience",
66
+ "outcomes": [],
67
+ "arguments": {},
68
+ "configurationArguments": {},
69
+ "metaData": {
70
+ "r__event_key": "DEAudience-2e3c73b6-48cc-2ec0-5522-48636e1a236e",
71
+ "chainType": "None",
72
+ "configurationRequired": false,
73
+ "iconUrl": "/images/icon-data-extension.svg",
74
+ "title": "Data Extension",
75
+ "entrySourceGroupConfigUrl": "jb:///data/entry/audience/entrysourcegroupconfig.json",
76
+ "sourceInteractionId": "00000000-0000-0000-0000-000000000000"
77
+ }
78
+ }
79
+ ],
80
+ "goals": [],
81
+ "exits": [],
82
+ "notifiers": [],
83
+ "entryMode": "NotSet",
84
+ "definitionType": "Multistep",
85
+ "channel": "",
86
+ "defaults": {
87
+ "email": [
88
+ "{{Event.DEAudience-2e3c73b6-48cc-2ec0-5522-48636e1a236e.\"Email\"}}"
89
+ ],
90
+ "properties": {
91
+ "analyticsTracking": {
92
+ "enabled": true,
93
+ "analyticsType": "google",
94
+ "urlDomainsToTrack": []
95
+ }
96
+ }
97
+ },
98
+ "metaData": {
99
+ "dataSource": "ContactsModel",
100
+ "highThroughputSending": {
101
+ "email": false
102
+ }
103
+ },
104
+ "executionMode": "Production",
105
+ "status": "Draft",
106
+ "scheduledStatus": "Draft",
107
+ "r__folder_Path": "my journeys"
108
+ }
@@ -0,0 +1,108 @@
1
+ {
2
+ "key": "testExisting_journey_updatecontact_sharedDE",
3
+ "name": "testExisting_journey_updatecontact_sharedDE",
4
+ "lastPublishedDate": "0001-01-01T00:00:00",
5
+ "description": "",
6
+ "version": 1,
7
+ "workflowApiVersion": 1,
8
+ "createdDate": "2024-05-04T05:54:48.027",
9
+ "modifiedDate": "2024-05-04T17:25:57.9",
10
+ "activities": [
11
+ {
12
+ "key": "UPDATECONTACTDATAV2-1",
13
+ "name": "Update Contact - TEST",
14
+ "description": "",
15
+ "type": "UPDATECONTACTDATA",
16
+ "outcomes": [
17
+ {
18
+ "key": "9f21d42b-4679-4561-911a-4bccf84672ba",
19
+ "arguments": {},
20
+ "metaData": {
21
+ "invalid": false
22
+ }
23
+ }
24
+ ],
25
+ "arguments": {
26
+ "activityData": {
27
+ "updateContactFields": [
28
+ {
29
+ "r__dataExtensionField_name": "LastName",
30
+ "value": "TEST",
31
+ "r__dataExtension_key": "testExisting_dataExtensionShared"
32
+ }
33
+ ]
34
+ }
35
+ },
36
+ "configurationArguments": {},
37
+ "metaData": {
38
+ "isConfigured": true
39
+ },
40
+ "schema": {
41
+ "arguments": {
42
+ "activityData": {
43
+ "dataType": "Text",
44
+ "isNullable": false,
45
+ "direction": "In",
46
+ "readOnly": false,
47
+ "access": "Hidden"
48
+ },
49
+ "contactKey": {
50
+ "dataType": "Text",
51
+ "isNullable": false,
52
+ "direction": "In",
53
+ "readOnly": false,
54
+ "access": "Hidden"
55
+ }
56
+ }
57
+ }
58
+ }
59
+ ],
60
+ "triggers": [
61
+ {
62
+ "key": "TRIGGER",
63
+ "name": "TRIGGER",
64
+ "description": "",
65
+ "type": "EmailAudience",
66
+ "outcomes": [],
67
+ "arguments": {},
68
+ "configurationArguments": {},
69
+ "metaData": {
70
+ "r__event_key": "DEAudience-2e3c73b6-48cc-2ec0-5522-48636e1a236e",
71
+ "chainType": "None",
72
+ "configurationRequired": false,
73
+ "iconUrl": "/images/icon-data-extension.svg",
74
+ "title": "Data Extension",
75
+ "entrySourceGroupConfigUrl": "jb:///data/entry/audience/entrysourcegroupconfig.json",
76
+ "sourceInteractionId": "00000000-0000-0000-0000-000000000000"
77
+ }
78
+ }
79
+ ],
80
+ "goals": [],
81
+ "exits": [],
82
+ "notifiers": [],
83
+ "entryMode": "NotSet",
84
+ "definitionType": "Multistep",
85
+ "channel": "",
86
+ "defaults": {
87
+ "email": [
88
+ "{{Event.DEAudience-2e3c73b6-48cc-2ec0-5522-48636e1a236e.\"Email\"}}"
89
+ ],
90
+ "properties": {
91
+ "analyticsTracking": {
92
+ "enabled": true,
93
+ "analyticsType": "google",
94
+ "urlDomainsToTrack": []
95
+ }
96
+ }
97
+ },
98
+ "metaData": {
99
+ "dataSource": "ContactsModel",
100
+ "highThroughputSending": {
101
+ "email": false
102
+ }
103
+ },
104
+ "executionMode": "Production",
105
+ "status": "Draft",
106
+ "scheduledStatus": "Draft",
107
+ "r__folder_Path": "my journeys"
108
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "testExisting_query_SharedDE",
3
+ "key": "testExisting_query_SharedDE",
4
+ "description": "bla bla",
5
+ "r__dataExtension_key": "testExisting_dataExtensionShared",
6
+ "createdDate": "2022-04-26T15:21:16.453",
7
+ "modifiedDate": "2022-04-26T16:02:44.01",
8
+ "targetUpdateTypeName": "Overwrite",
9
+ "r__folder_Path": "Query",
10
+ "isFrozen": false
11
+ }
@@ -0,0 +1,7 @@
1
+ SELECT
2
+ SubscriberKey AS testField,
3
+ TRIM(last_name) AS name
4
+ FROM
5
+ testExisting_dataExtensionShared
6
+ WHERE
7
+ country IN ('test')
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "{{{prefix}}}query_SharedDE",
3
+ "key": "{{{prefix}}}query_SharedDE",
4
+ "description": "{{{description}}}",
5
+ "r__dataExtension_key": "{{{prefix}}}dataExtensionShared",
6
+ "targetUpdateTypeName": "Overwrite",
7
+ "r__folder_Path": "Query"
8
+ }
@@ -0,0 +1,7 @@
1
+ SELECT
2
+ SubscriberKey AS testField,
3
+ TRIM(last_name) AS name
4
+ FROM
5
+ {{{prefix}}}dataExtensionShared
6
+ WHERE
7
+ country IN ({{{countryCodeIn}}})
@@ -52,5 +52,46 @@ describe('type: attributeSet', () => {
52
52
  );
53
53
  return;
54
54
  });
55
+
56
+ it('Should resolve shared dataExtensions in attributeSet when retrieved together with dataExtension', async () => {
57
+ // WHEN
58
+ // this test verifies the fix for: shared DEs not resolved if attributeSet+dataExtension is retrieved together
59
+ const retrieve = await handler.retrieve('testInstance/testBU', [
60
+ 'dataExtension',
61
+ 'attributeSet',
62
+ ]);
63
+
64
+ // THEN
65
+ assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error');
66
+ assert.equal(
67
+ retrieve['testInstance/testBU'].attributeSet
68
+ ? Object.keys(retrieve['testInstance/testBU'].attributeSet).length
69
+ : 0,
70
+ 28,
71
+ 'only 28 attributeSets expected in retrieve response'
72
+ );
73
+ // get results from cache
74
+ const result = cache.getCache();
75
+ assert.equal(
76
+ result.attributeSet ? Object.keys(result.attributeSet).length : 0,
77
+ 28,
78
+ 'only 28 attributeSets expected in cache'
79
+ );
80
+
81
+ // verify that shared DE was resolved correctly in attributeSet (this is the key bug fix check)
82
+ assert.deepEqual(
83
+ await testUtils.getActualJson('testExisting_dataExtensionShared', 'attributeSet'),
84
+ await testUtils.getExpectedJson('9999999', 'attributeSet', 'retrieve'),
85
+
86
+ 'returned metadata was not equal expected - shared DE should be resolved even when dataExtension is retrieved together with attributeSet'
87
+ );
88
+
89
+ assert.equal(
90
+ testUtils.getAPIHistoryLength(),
91
+ 9,
92
+ 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
93
+ );
94
+ return;
95
+ });
55
96
  });
56
97
  });
@@ -681,7 +681,7 @@ describe('type: automation', () => {
681
681
  await handler.retrieve('testInstance/testBU');
682
682
  assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error');
683
683
 
684
- const expectedApiCallsRetrieve = 109;
684
+ const expectedApiCallsRetrieve = 111;
685
685
  assert.equal(
686
686
  testUtils.getAPIHistoryLength(),
687
687
  expectedApiCallsRetrieve,