@segment/action-destinations 3.225.0 → 3.227.0

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 (196) hide show
  1. package/dist/destinations/apolloio/generated-types.d.ts +3 -0
  2. package/dist/destinations/apolloio/generated-types.js +3 -0
  3. package/dist/destinations/apolloio/generated-types.js.map +1 -0
  4. package/dist/destinations/apolloio/index.d.ts +7 -0
  5. package/dist/destinations/apolloio/index.js +58 -0
  6. package/dist/destinations/apolloio/index.js.map +1 -0
  7. package/dist/destinations/apolloio/track/generated-types.d.ts +25 -0
  8. package/dist/destinations/apolloio/track/generated-types.js +3 -0
  9. package/dist/destinations/apolloio/track/generated-types.js.map +1 -0
  10. package/dist/destinations/apolloio/track/index.d.ts +5 -0
  11. package/dist/destinations/apolloio/track/index.js +162 -0
  12. package/dist/destinations/apolloio/track/index.js.map +1 -0
  13. package/dist/destinations/braze/identifyUser/generated-types.d.ts +1 -0
  14. package/dist/destinations/braze/identifyUser/index.js +11 -1
  15. package/dist/destinations/braze/identifyUser/index.js.map +1 -1
  16. package/dist/destinations/braze-cohorts/index.js +1 -0
  17. package/dist/destinations/braze-cohorts/index.js.map +1 -1
  18. package/dist/destinations/display-video-360/addToAudience/generated-types.d.ts +2 -0
  19. package/dist/destinations/display-video-360/addToAudience/generated-types.js +3 -0
  20. package/dist/destinations/display-video-360/addToAudience/generated-types.js.map +1 -0
  21. package/dist/destinations/display-video-360/addToAudience/index.d.ts +5 -0
  22. package/dist/destinations/display-video-360/addToAudience/index.js +12 -0
  23. package/dist/destinations/display-video-360/addToAudience/index.js.map +1 -0
  24. package/dist/destinations/display-video-360/constants.d.ts +4 -0
  25. package/dist/destinations/display-video-360/constants.js +8 -0
  26. package/dist/destinations/display-video-360/constants.js.map +1 -0
  27. package/dist/destinations/display-video-360/generated-types.d.ts +5 -0
  28. package/dist/destinations/display-video-360/generated-types.js +3 -0
  29. package/dist/destinations/display-video-360/generated-types.js.map +1 -0
  30. package/dist/destinations/display-video-360/index.d.ts +4 -0
  31. package/dist/destinations/display-video-360/index.js +115 -0
  32. package/dist/destinations/display-video-360/index.js.map +1 -0
  33. package/dist/destinations/display-video-360/removeFromAudience/generated-types.d.ts +2 -0
  34. package/dist/destinations/display-video-360/removeFromAudience/generated-types.js +3 -0
  35. package/dist/destinations/display-video-360/removeFromAudience/generated-types.js.map +1 -0
  36. package/dist/destinations/display-video-360/removeFromAudience/index.d.ts +5 -0
  37. package/dist/destinations/display-video-360/removeFromAudience/index.js +12 -0
  38. package/dist/destinations/display-video-360/removeFromAudience/index.js.map +1 -0
  39. package/dist/destinations/engage/sendgrid/sendEmail/SendEmailPerformer.js +1 -1
  40. package/dist/destinations/engage/sendgrid/sendEmail/SendEmailPerformer.js.map +1 -1
  41. package/dist/destinations/google-enhanced-conversions/functions.d.ts +3 -1
  42. package/dist/destinations/google-enhanced-conversions/functions.js +37 -1
  43. package/dist/destinations/google-enhanced-conversions/functions.js.map +1 -1
  44. package/dist/destinations/google-enhanced-conversions/types.d.ts +12 -0
  45. package/dist/destinations/google-enhanced-conversions/uploadCallConversion/index.js +8 -2
  46. package/dist/destinations/google-enhanced-conversions/uploadCallConversion/index.js.map +1 -1
  47. package/dist/destinations/google-enhanced-conversions/uploadClickConversion/index.js +8 -2
  48. package/dist/destinations/google-enhanced-conversions/uploadClickConversion/index.js.map +1 -1
  49. package/dist/destinations/google-enhanced-conversions/uploadConversionAdjustment/index.js +10 -2
  50. package/dist/destinations/google-enhanced-conversions/uploadConversionAdjustment/index.js.map +1 -1
  51. package/dist/destinations/index.js +6 -0
  52. package/dist/destinations/index.js.map +1 -1
  53. package/dist/destinations/insider/cartViewedEvent/index.js +6 -0
  54. package/dist/destinations/insider/cartViewedEvent/index.js.map +1 -1
  55. package/dist/destinations/insider/checkoutEvent/index.js +6 -0
  56. package/dist/destinations/insider/checkoutEvent/index.js.map +1 -1
  57. package/dist/destinations/insider/insider-helpers.d.ts +32 -0
  58. package/dist/destinations/insider/insider-helpers.js +162 -1
  59. package/dist/destinations/insider/insider-helpers.js.map +1 -1
  60. package/dist/destinations/insider/orderCompletedEvent/index.js +6 -0
  61. package/dist/destinations/insider/orderCompletedEvent/index.js.map +1 -1
  62. package/dist/destinations/insider/productAddedEvent/index.js +6 -0
  63. package/dist/destinations/insider/productAddedEvent/index.js.map +1 -1
  64. package/dist/destinations/insider/productListViewedEvent/index.js +6 -0
  65. package/dist/destinations/insider/productListViewedEvent/index.js.map +1 -1
  66. package/dist/destinations/insider/productRemovedEvent/index.js +6 -0
  67. package/dist/destinations/insider/productRemovedEvent/index.js.map +1 -1
  68. package/dist/destinations/insider/productViewedEvent/index.js +6 -0
  69. package/dist/destinations/insider/productViewedEvent/index.js.map +1 -1
  70. package/dist/destinations/insider/trackEvent/index.js +6 -0
  71. package/dist/destinations/insider/trackEvent/index.js.map +1 -1
  72. package/dist/destinations/insider/updateUserProfile/index.js +6 -0
  73. package/dist/destinations/insider/updateUserProfile/index.js.map +1 -1
  74. package/dist/destinations/insider/userRegisteredEvent/index.js +6 -0
  75. package/dist/destinations/insider/userRegisteredEvent/index.js.map +1 -1
  76. package/dist/destinations/insider-audiences/insider-helpers.js +1 -2
  77. package/dist/destinations/insider-audiences/insider-helpers.js.map +1 -1
  78. package/dist/destinations/marketo-static-lists/addToList/generated-types.d.ts +2 -0
  79. package/dist/destinations/marketo-static-lists/addToList/generated-types.js +3 -0
  80. package/dist/destinations/marketo-static-lists/addToList/generated-types.js.map +1 -0
  81. package/dist/destinations/marketo-static-lists/addToList/index.d.ts +5 -0
  82. package/dist/destinations/marketo-static-lists/addToList/index.js +12 -0
  83. package/dist/destinations/marketo-static-lists/addToList/index.js.map +1 -0
  84. package/dist/destinations/marketo-static-lists/generated-types.d.ts +2 -0
  85. package/dist/destinations/marketo-static-lists/generated-types.js +3 -0
  86. package/dist/destinations/marketo-static-lists/generated-types.js.map +1 -0
  87. package/dist/destinations/marketo-static-lists/index.d.ts +4 -0
  88. package/dist/destinations/marketo-static-lists/index.js +29 -0
  89. package/dist/destinations/marketo-static-lists/index.js.map +1 -0
  90. package/dist/destinations/marketo-static-lists/removeFromList/generated-types.d.ts +2 -0
  91. package/dist/destinations/marketo-static-lists/removeFromList/generated-types.js +3 -0
  92. package/dist/destinations/marketo-static-lists/removeFromList/generated-types.js.map +1 -0
  93. package/dist/destinations/marketo-static-lists/removeFromList/index.d.ts +5 -0
  94. package/dist/destinations/marketo-static-lists/removeFromList/index.js +12 -0
  95. package/dist/destinations/marketo-static-lists/removeFromList/index.js.map +1 -0
  96. package/dist/destinations/movable-ink/categoryView/generated-types.d.ts +22 -0
  97. package/dist/destinations/movable-ink/categoryView/generated-types.js +3 -0
  98. package/dist/destinations/movable-ink/categoryView/generated-types.js.map +1 -0
  99. package/dist/destinations/movable-ink/categoryView/index.d.ts +5 -0
  100. package/dist/destinations/movable-ink/categoryView/index.js +43 -0
  101. package/dist/destinations/movable-ink/categoryView/index.js.map +1 -0
  102. package/dist/destinations/movable-ink/conversion/generated-types.d.ts +20 -0
  103. package/dist/destinations/movable-ink/conversion/generated-types.js +3 -0
  104. package/dist/destinations/movable-ink/conversion/generated-types.js.map +1 -0
  105. package/dist/destinations/movable-ink/conversion/index.d.ts +5 -0
  106. package/dist/destinations/movable-ink/conversion/index.js +45 -0
  107. package/dist/destinations/movable-ink/conversion/index.js.map +1 -0
  108. package/dist/destinations/movable-ink/fields.d.ts +21 -0
  109. package/dist/destinations/movable-ink/fields.js +236 -0
  110. package/dist/destinations/movable-ink/fields.js.map +1 -0
  111. package/dist/destinations/movable-ink/generated-types.d.ts +5 -0
  112. package/dist/destinations/movable-ink/generated-types.js +3 -0
  113. package/dist/destinations/movable-ink/generated-types.js.map +1 -0
  114. package/dist/destinations/movable-ink/identify/generated-types.d.ts +7 -0
  115. package/dist/destinations/movable-ink/identify/generated-types.js +3 -0
  116. package/dist/destinations/movable-ink/identify/generated-types.js.map +1 -0
  117. package/dist/destinations/movable-ink/identify/index.d.ts +5 -0
  118. package/dist/destinations/movable-ink/identify/index.js +32 -0
  119. package/dist/destinations/movable-ink/identify/index.js.map +1 -0
  120. package/dist/destinations/movable-ink/index.d.ts +4 -0
  121. package/dist/destinations/movable-ink/index.js +70 -0
  122. package/dist/destinations/movable-ink/index.js.map +1 -0
  123. package/dist/destinations/movable-ink/productAdded/generated-types.d.ts +22 -0
  124. package/dist/destinations/movable-ink/productAdded/generated-types.js +3 -0
  125. package/dist/destinations/movable-ink/productAdded/generated-types.js.map +1 -0
  126. package/dist/destinations/movable-ink/productAdded/index.d.ts +5 -0
  127. package/dist/destinations/movable-ink/productAdded/index.js +43 -0
  128. package/dist/destinations/movable-ink/productAdded/index.js.map +1 -0
  129. package/dist/destinations/movable-ink/productViewed/generated-types.d.ts +21 -0
  130. package/dist/destinations/movable-ink/productViewed/generated-types.js +3 -0
  131. package/dist/destinations/movable-ink/productViewed/generated-types.js.map +1 -0
  132. package/dist/destinations/movable-ink/productViewed/index.d.ts +5 -0
  133. package/dist/destinations/movable-ink/productViewed/index.js +43 -0
  134. package/dist/destinations/movable-ink/productViewed/index.js.map +1 -0
  135. package/dist/destinations/movable-ink/search/generated-types.d.ts +12 -0
  136. package/dist/destinations/movable-ink/search/generated-types.js +3 -0
  137. package/dist/destinations/movable-ink/search/generated-types.js.map +1 -0
  138. package/dist/destinations/movable-ink/search/index.d.ts +5 -0
  139. package/dist/destinations/movable-ink/search/index.js +43 -0
  140. package/dist/destinations/movable-ink/search/index.js.map +1 -0
  141. package/dist/destinations/movable-ink/sendCustomEvent/generated-types.d.ts +25 -0
  142. package/dist/destinations/movable-ink/sendCustomEvent/generated-types.js +3 -0
  143. package/dist/destinations/movable-ink/sendCustomEvent/generated-types.js.map +1 -0
  144. package/dist/destinations/movable-ink/sendCustomEvent/index.d.ts +5 -0
  145. package/dist/destinations/movable-ink/sendCustomEvent/index.js +48 -0
  146. package/dist/destinations/movable-ink/sendCustomEvent/index.js.map +1 -0
  147. package/dist/destinations/movable-ink/sendEntireEvent/generated-types.d.ts +11 -0
  148. package/dist/destinations/movable-ink/sendEntireEvent/generated-types.js +3 -0
  149. package/dist/destinations/movable-ink/sendEntireEvent/generated-types.js.map +1 -0
  150. package/dist/destinations/movable-ink/sendEntireEvent/index.d.ts +5 -0
  151. package/dist/destinations/movable-ink/sendEntireEvent/index.js +79 -0
  152. package/dist/destinations/movable-ink/sendEntireEvent/index.js.map +1 -0
  153. package/dist/destinations/salesforce-marketing-cloud/sfmc-properties.js +1 -1
  154. package/dist/destinations/salesforce-marketing-cloud/sfmc-properties.js.map +1 -1
  155. package/dist/destinations/the-trade-desk-crm/functions.js +16 -4
  156. package/dist/destinations/the-trade-desk-crm/functions.js.map +1 -1
  157. package/dist/destinations/tiktok-audiences/addUser/index.js +2 -2
  158. package/dist/destinations/tiktok-audiences/addUser/index.js.map +1 -1
  159. package/dist/destinations/tiktok-audiences/removeUser/index.js +2 -2
  160. package/dist/destinations/tiktok-audiences/removeUser/index.js.map +1 -1
  161. package/dist/destinations/usermotion/generated-types.d.ts +3 -0
  162. package/dist/destinations/usermotion/generated-types.js +3 -0
  163. package/dist/destinations/usermotion/generated-types.js.map +1 -0
  164. package/dist/destinations/usermotion/group/generated-types.d.ts +7 -0
  165. package/dist/destinations/usermotion/group/generated-types.js +3 -0
  166. package/dist/destinations/usermotion/group/generated-types.js.map +1 -0
  167. package/dist/destinations/usermotion/group/index.d.ts +5 -0
  168. package/dist/destinations/usermotion/group/index.js +48 -0
  169. package/dist/destinations/usermotion/group/index.js.map +1 -0
  170. package/dist/destinations/usermotion/identify/generated-types.d.ts +8 -0
  171. package/dist/destinations/usermotion/identify/generated-types.js +3 -0
  172. package/dist/destinations/usermotion/identify/generated-types.js.map +1 -0
  173. package/dist/destinations/usermotion/identify/index.d.ts +5 -0
  174. package/dist/destinations/usermotion/identify/index.js +57 -0
  175. package/dist/destinations/usermotion/identify/index.js.map +1 -0
  176. package/dist/destinations/usermotion/index.d.ts +4 -0
  177. package/dist/destinations/usermotion/index.js +65 -0
  178. package/dist/destinations/usermotion/index.js.map +1 -0
  179. package/dist/destinations/usermotion/track/generated-types.d.ts +9 -0
  180. package/dist/destinations/usermotion/track/generated-types.js +3 -0
  181. package/dist/destinations/usermotion/track/generated-types.js.map +1 -0
  182. package/dist/destinations/usermotion/track/index.d.ts +5 -0
  183. package/dist/destinations/usermotion/track/index.js +72 -0
  184. package/dist/destinations/usermotion/track/index.js.map +1 -0
  185. package/dist/destinations/yahoo-audiences/index.js +25 -11
  186. package/dist/destinations/yahoo-audiences/index.js.map +1 -1
  187. package/dist/destinations/yahoo-audiences/updateSegment/generated-types.d.ts +1 -2
  188. package/dist/destinations/yahoo-audiences/updateSegment/index.js +48 -44
  189. package/dist/destinations/yahoo-audiences/updateSegment/index.js.map +1 -1
  190. package/dist/destinations/yahoo-audiences/utils-rt.d.ts +2 -0
  191. package/dist/destinations/yahoo-audiences/utils-rt.js +72 -17
  192. package/dist/destinations/yahoo-audiences/utils-rt.js.map +1 -1
  193. package/dist/destinations/yahoo-audiences/utils-tax.d.ts +2 -1
  194. package/dist/destinations/yahoo-audiences/utils-tax.js +7 -1
  195. package/dist/destinations/yahoo-audiences/utils-tax.js.map +1 -1
  196. package/package.json +2 -2
@@ -0,0 +1,3 @@
1
+ export interface Settings {
2
+ apiToken: string;
3
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=generated-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../src/destinations/apolloio/generated-types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ import type { DestinationDefinition } from '@segment/actions-core';
2
+ import type { Settings } from './generated-types';
3
+ export declare const baseURL: string;
4
+ export declare const authURL: string;
5
+ export declare const headerSecret: string;
6
+ declare const destination: DestinationDefinition<Settings>;
7
+ export default destination;
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.headerSecret = exports.authURL = exports.baseURL = void 0;
7
+ const actions_core_1 = require("@segment/actions-core");
8
+ const track_1 = __importDefault(require("./track"));
9
+ exports.baseURL = process?.env?.ACTIONS_APOLLOIO_BASE_URL_SECRET ?? 'https://apollo.io/';
10
+ exports.authURL = process?.env?.ACTIONS_APOLLOIO_AUTH_URL_SECRET ?? 'https://apollo.io/';
11
+ exports.headerSecret = `${process.env.ACTIONS_APOLLOIO_HEADER_SECRET}`;
12
+ const destination = {
13
+ name: 'Apollo.io',
14
+ slug: 'actions-apolloio',
15
+ mode: 'cloud',
16
+ description: 'Send Segment analytics events to Apollo.io',
17
+ authentication: {
18
+ scheme: 'custom',
19
+ fields: {
20
+ apiToken: {
21
+ label: 'API Token',
22
+ description: 'API Token for authorization.',
23
+ type: 'password',
24
+ required: true
25
+ }
26
+ },
27
+ testAuthentication: (request, { settings }) => {
28
+ return request(exports.authURL + settings.apiToken).then(async (response) => {
29
+ const { is_logged_in } = await response.json();
30
+ if (is_logged_in === false) {
31
+ throw new actions_core_1.IntegrationError(`Invalid API Token`, 'INVALID_API_TOKEN', 401);
32
+ }
33
+ });
34
+ }
35
+ },
36
+ extendRequest({ settings }) {
37
+ return {
38
+ headers: {
39
+ api_key: settings.apiToken,
40
+ secret: exports.headerSecret
41
+ }
42
+ };
43
+ },
44
+ actions: {
45
+ track: track_1.default
46
+ },
47
+ presets: [
48
+ {
49
+ name: 'Track',
50
+ subscribe: 'type = "track"',
51
+ partnerAction: 'track',
52
+ mapping: actions_core_1.defaultValues(track_1.default.fields),
53
+ type: 'automatic'
54
+ }
55
+ ]
56
+ };
57
+ exports.default = destination;
58
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/apolloio/index.ts"],"names":[],"mappings":";;;;;;A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AAI,EAAE,OAAO;YACb,SAAS,EAAE,gBAAgB;YAC3B,aAAa,EAAE,OAAO;YACtB,OAAO,EAAE,4BAAa,CAAC,eAAK,CAAC,MAAM,CAAC;YACpC,IAAI,EAAE,WAAW;SAClB;KACF;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
@@ -0,0 +1,25 @@
1
+ export interface Payload {
2
+ anonymousId?: string;
3
+ event: string;
4
+ properties?: {
5
+ [k: string]: unknown;
6
+ };
7
+ timestamp: string;
8
+ ipAddress: string;
9
+ timezone?: string;
10
+ userId?: string;
11
+ campaign?: {
12
+ name?: string;
13
+ source?: string;
14
+ medium?: string;
15
+ term?: string;
16
+ content?: string;
17
+ };
18
+ page: {
19
+ url?: string;
20
+ title?: string;
21
+ referrer?: string;
22
+ path?: string;
23
+ search?: string;
24
+ };
25
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=generated-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/apolloio/track/generated-types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ import type { ActionDefinition } from '@segment/actions-core';
2
+ import type { Settings } from '../generated-types';
3
+ import type { Payload } from './generated-types';
4
+ declare const action: ActionDefinition<Settings, Payload>;
5
+ export default action;
@@ -0,0 +1,162 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const __1 = require("..");
4
+ const action = {
5
+ title: 'Track',
6
+ description: 'Send user analytics events to Apollo.io',
7
+ defaultSubscription: 'type = "track"',
8
+ fields: {
9
+ anonymousId: {
10
+ type: 'string',
11
+ description: 'An anonymous identifier',
12
+ label: 'Anonymous ID',
13
+ default: { '@path': '$.anonymousId' }
14
+ },
15
+ event: {
16
+ type: 'string',
17
+ label: 'Name',
18
+ description: 'Event name',
19
+ required: true,
20
+ default: { '@path': '$.event' }
21
+ },
22
+ properties: {
23
+ type: 'object',
24
+ label: 'Properties',
25
+ description: 'Properties to associate with the event',
26
+ default: { '@path': '$.properties' }
27
+ },
28
+ timestamp: {
29
+ type: 'string',
30
+ format: 'date-time',
31
+ required: true,
32
+ description: 'The timestamp of the event',
33
+ label: 'Timestamp',
34
+ default: { '@path': '$.timestamp' }
35
+ },
36
+ ipAddress: {
37
+ label: 'IP Address',
38
+ description: "The users's IP address.",
39
+ type: 'string',
40
+ required: true,
41
+ default: { '@path': '$.context.ip' }
42
+ },
43
+ timezone: {
44
+ label: 'Timezone',
45
+ description: 'Timezone',
46
+ type: 'string',
47
+ default: {
48
+ '@path': '$.context.timezone'
49
+ }
50
+ },
51
+ userId: {
52
+ type: 'string',
53
+ description: 'The ID associated with the user',
54
+ label: 'User ID',
55
+ default: { '@path': '$.userId' }
56
+ },
57
+ campaign: {
58
+ type: 'object',
59
+ required: false,
60
+ description: 'UTM campaign information.',
61
+ label: 'Campaign',
62
+ default: {
63
+ name: { '@path': '$.context.campaign.name' },
64
+ source: { '@path': '$.context.campaign.source' },
65
+ medium: { '@path': '$.context.campaign.medium' },
66
+ term: { '@path': '$.context.campaign.term' },
67
+ content: { '@path': '$.context.campaign.content' }
68
+ },
69
+ properties: {
70
+ name: {
71
+ type: 'string',
72
+ required: false,
73
+ description: 'The name of the campaign.',
74
+ label: 'Name'
75
+ },
76
+ source: {
77
+ type: 'string',
78
+ required: false,
79
+ description: 'The source of the campaign.',
80
+ label: 'Source'
81
+ },
82
+ medium: {
83
+ type: 'string',
84
+ required: false,
85
+ description: 'The medium of the campaign.',
86
+ label: 'Medium'
87
+ },
88
+ term: {
89
+ type: 'string',
90
+ required: false,
91
+ description: 'The term of the campaign.',
92
+ label: 'Term'
93
+ },
94
+ content: {
95
+ type: 'string',
96
+ required: false,
97
+ description: 'The content of the campaign.',
98
+ label: 'Content'
99
+ }
100
+ }
101
+ },
102
+ page: {
103
+ type: 'object',
104
+ required: true,
105
+ description: 'Information about the page where the event occurred.',
106
+ label: 'Page',
107
+ default: {
108
+ url: { '@path': '$.context.page.url' },
109
+ title: { '@path': '$.context.page.title' },
110
+ referrer: { '@path': '$.context.page.referrer' },
111
+ path: { '@path': '$.context.page.path' },
112
+ search: { '@path': '$.context.page.search' }
113
+ },
114
+ properties: {
115
+ url: {
116
+ type: 'string',
117
+ required: false,
118
+ description: 'The URL of the page where the event occurred.',
119
+ label: 'URL'
120
+ },
121
+ title: {
122
+ type: 'string',
123
+ required: false,
124
+ description: 'The title of the page where the event occurred.',
125
+ label: 'Title'
126
+ },
127
+ referrer: {
128
+ type: 'string',
129
+ required: false,
130
+ description: 'The referrer of the page where the event occurred.',
131
+ label: 'Referrer'
132
+ },
133
+ path: {
134
+ type: 'string',
135
+ required: false,
136
+ description: 'The path of the page where the event occurred.',
137
+ label: 'Path'
138
+ },
139
+ search: {
140
+ type: 'string',
141
+ required: false,
142
+ description: 'The search query of the page where the event occurred.',
143
+ label: 'Search'
144
+ }
145
+ }
146
+ }
147
+ },
148
+ perform: (request, data) => {
149
+ return request(__1.baseURL, {
150
+ method: 'post',
151
+ json: [data.payload]
152
+ });
153
+ },
154
+ performBatch: (request, data) => {
155
+ return request(__1.baseURL, {
156
+ method: 'post',
157
+ json: data.payload
158
+ });
159
+ }
160
+ };
161
+ exports.default = action;
162
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/apolloio/track/index.ts"],"names":[],"mappings":";;AAGA,0BAA4B;AAE5B,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,OAAO;IACd,WAAW,EAAE,yCAAyC;IACtD,mBAAmB,EAAE,gBAAgB;IACrC,MAAM,EAAE;QACN,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,yBAAyB;YACtC,KAAK,EAAE,cAAc;YACrB,OAAO,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE;SACtC;QACD,KAAK,EAAE;YACL,IAAI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oBACd,QAAQ,EAAE,KAAK;oBACf,WAAW,EAAE,+CAA+C;oBAC5D,KAAK,EAAE,KAAK;iBACb;gBACD,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;oBACd,QAAQ,EAAE,KAAK;oBACf,WAAW,EAAE,iDAAiD;oBAC9D,KAAK,EAAE,OAAO;iBACf;gBACD,QAAQ,EAAE;oBACR,IAAI,EAAE,QAAQ;oBACd,QAAQ,EAAE,KAAK;oBACf,WAAW,EAAE,oDAAoD;oBACjE,KAAK,EAAE,UAAU;iBAClB;gBACD,IAAI,EAAE;oBACJ,IAAI,EAAE,QAAQ;oBACd,QAAQ,EAAE,KAAK;oBACf,WAAW,EAAE,gDAAgD;oBAC7D,KAAK,EAAE,MAAM;iBACd;gBACD,MAAM,EAAE;oBACN,IAAI,EAAE,QAAQ;oBACd,QAAQ,EAAE,KAAK;oBACf,WAAW,EAAE,wDAAwD;oBACrE,KAAK,EAAE,QAAQ;iBAChB;aACF;SACF;KACF;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE;QACzB,OAAO,OAAO,CAAC,WAAO,EAAE;YACtB,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC;SACrB,CAAC,CAAA;IACJ,CAAC;IACD,YAAY,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE;QAC9B,OAAO,OAAO,CAAC,WAAO,EAAE;YACtB,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,IAAI,CAAC,OAAO;SACnB,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
@@ -4,4 +4,5 @@ export interface Payload {
4
4
  alias_name: string;
5
5
  alias_label: string;
6
6
  };
7
+ merge_behavior?: string;
7
8
  }
@@ -27,6 +27,15 @@ const action = {
27
27
  required: true
28
28
  }
29
29
  }
30
+ },
31
+ merge_behavior: {
32
+ label: 'Merge Behavior',
33
+ description: 'Sets the endpoint to merge some fields found exclusively on the anonymous user to the identified user. See [the docs](https://www.braze.com/docs/api/endpoints/user_data/post_user_identify/#request-parameters).',
34
+ type: 'string',
35
+ choices: [
36
+ { value: 'none', label: 'None' },
37
+ { value: 'merge', label: 'Merge' }
38
+ ]
30
39
  }
31
40
  },
32
41
  perform: (request, { settings, payload }) => {
@@ -38,7 +47,8 @@ const action = {
38
47
  external_id: payload.external_id,
39
48
  user_alias: payload.user_alias
40
49
  }
41
- ]
50
+ ],
51
+ ...(payload.merge_behavior !== undefined && { merge_behavior: payload.merge_behavior })
42
52
  }
43
53
  });
44
54
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/braze/identifyUser/index.ts"],"names":[],"mappings":";;AAIA,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,eAAe;IACtB,WAAW,EACT,qIAAqI;IACvI,MAAM,EAAE;QACN,WAAW,EAAE;YACX,KAAK,EAAE,aAAa;YACpB,WAAW,EAAE,0CAA0C;YACvD,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;SACf;QACD,UAAU,EAAE;YACV,KAAK,EAAE,mBAAmB;YAC1B,WAAW,EACT,yGAAyG;YAC3G,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE;gBACV,UAAU,EAAE;oBACV,KAAK,EAAE,YAAY;oBACnB,IAAI,EAAE,QAAQ;oBACd,QAAQ,EAAE,IAAI;iBACf;gBACD,WAAW,EAAE;oBACX,KAAK,EAAE,aAAa;oBACpB,IAAI,EAAE,QAAQ;oBACd,QAAQ,EAAE,IAAI;iBACf;aACF;SACF;KACF;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;QAC1C,OAAO,OAAO,CAAC,GAAG,QAAQ,CAAC,QAAQ,iBAAiB,EAAE;YACpD,MAAM,EAAE,MAAM;YACd,IAAI,EAAE;gBACJ,mBAAmB,EAAE;oBACnB;wBACE,WAAW,EAAE,OAAO,CAAC,WAAW;wBAChC,UAAU,EAAE,OAAO,CAAC,UAAU;qBAC/B;iBACF;aACF;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/braze/identifyUser/index.ts"],"names":[],"mappings":";;AAIA,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,eAAe;IACtB,WAAW,EACT,qIAAqI;IACvI,MAAM,EAAE;QACN,WAAW,EAAE;YACX,KAAK,EAAE,aAAa;YACpB,WAAW,EAAE,0CAA0C;YACvD,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;SACf;QACD,UAAU,EAAE;YACV,KAAK,EAAE,mBAAmB;YAC1B,WAAW,EACT,yGAAyG;YAC3G,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE;gBACV,UAAU,EAAE;oBACV,KAAK,EAAE,YAAY;oBACnB,IAAI,EAAE,QAAQ;oBACd,QAAQ,EAAE,IAAI;iBACf;gBACD,WAAW,EAAE;oBACX,KAAK,EAAE,aAAa;oBACpB,IAAI,EAAE,QAAQ;oBACd,QAAQ,EAAE,IAAI;iBACf;aACF;SACF;QACD,cAAc,EAAE;YACd,KAAK,EAAE,gBAAgB;YACvB,WAAW,EACT,mNAAmN;YACrN,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;gBAChC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;aACnC;SACF;KACF;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;QAC1C,OAAO,OAAO,CAAC,GAAG,QAAQ,CAAC,QAAQ,iBAAiB,EAAE;YACpD,MAAM,EAAE,MAAM;YACd,IAAI,EAAE;gBACJ,mBAAmB,EAAE;oBACnB;wBACE,WAAW,EAAE,OAAO,CAAC,WAAW;wBAChC,UAAU,EAAE,OAAO,CAAC,UAAU;qBAC/B;iBACF;gBACD,GAAG,CAAC,OAAO,CAAC,cAAc,KAAK,SAAS,IAAI,EAAE,cAAc,EAAE,OAAO,CAAC,cAAc,EAAE,CAAC;aACxF;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
@@ -30,6 +30,7 @@ const destination = {
30
30
  { label: 'US-04 (https://dashboard-04.braze.com)', value: 'https://rest.iad-04.braze.com' },
31
31
  { label: 'US-05 (https://dashboard-05.braze.com)', value: 'https://rest.iad-05.braze.com' },
32
32
  { label: 'US-06 (https://dashboard-06.braze.com)', value: 'https://rest.iad-06.braze.com' },
33
+ { label: 'US-07 (https://dashboard-07.braze.com)', value: 'https://rest.iad-07.braze.com' },
33
34
  { label: 'US-08 (https://dashboard-08.braze.com)', value: 'https://rest.iad-08.braze.com' },
34
35
  { label: 'EU-01 (https://dashboard-01.braze.eu)', value: 'https://rest.fra-01.braze.eu' },
35
36
  { label: 'EU-02 (https://dashboard-02.braze.eu)', value: 'https://rest.fra-02.braze.eu' }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/braze-cohorts/index.ts"],"names":[],"mappings":";;;;;AAGA,uCAA2C;AAC3C,oEAA2C;AAE3C,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,eAAe;IACrB,IAAI,EAAE,uBAAuB;IAC7B,IAAI,EAAE,OAAO;IACb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,aAAa,EAAE;gBACb,KAAK,EAAE,mBAAmB;gBAC1B,WAAW,EAAE,0FAA0F;gBACvG,IAAI,EAAE,UAAU;gBAChB,QAAQ,EAAE,IAAI;aACf;YACD,QAAQ,EAAE;gBACR,KAAK,EAAE,eAAe;gBACtB,WA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ACD,kBAAkB,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;YAClD,MAAM,sBAAsB,GAAkB,IAAI,qBAAa,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;YAClF,MAAM,SAAS,GAAG,sBAAsB,CAAA;YACxC,MAAM,aAAa,GAAyB,EAAE,CAAA;YAC9C,OAAO,MAAM,sBAAsB,CAAC,WAAW,CAAC,QAAQ,EAAE,SAAS,EAAE,aAAa,CAAC,CAAA;QACrF,CAAC;KACF;IACD,OAAO,EAAE;QACP,aAAa,EAAb,uBAAa;KACd;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
@@ -0,0 +1,2 @@
1
+ export interface Payload {
2
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=generated-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/display-video-360/addToAudience/generated-types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ import type { ActionDefinition } from '@segment/actions-core';
2
+ import type { Settings } from '../generated-types';
3
+ import type { Payload } from './generated-types';
4
+ declare const action: ActionDefinition<Settings, Payload>;
5
+ export default action;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const action = {
4
+ title: 'Add to Audience',
5
+ description: 'Add users into an audience',
6
+ fields: {},
7
+ perform: () => {
8
+ return;
9
+ }
10
+ };
11
+ exports.default = action;
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/display-video-360/addToAudience/index.ts"],"names":[],"mappings":";;AAIA,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,iBAAiB;IACxB,WAAW,EAAE,4BAA4B;IACzC,MAAM,EAAE,EAAE;IACV,OAAO,EAAE,GAAG,EAAE;QACZ,OAAM;IACR,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
@@ -0,0 +1,4 @@
1
+ export declare const GOOGLE_API_VERSION = "v2";
2
+ export declare const BASE_URL: string;
3
+ export declare const CREATE_AUDIENCE_URL: string;
4
+ export declare const GET_AUDIENCE_URL: string;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GET_AUDIENCE_URL = exports.CREATE_AUDIENCE_URL = exports.BASE_URL = exports.GOOGLE_API_VERSION = void 0;
4
+ exports.GOOGLE_API_VERSION = 'v2';
5
+ exports.BASE_URL = `https://audiencepartner.googleapis.com/${exports.GOOGLE_API_VERSION}/products/DISPLAY_VIDEO_ADVERTISER/customers/advertiserID/`;
6
+ exports.CREATE_AUDIENCE_URL = `${exports.BASE_URL}userLists:mutate`;
7
+ exports.GET_AUDIENCE_URL = `${exports.BASE_URL}audiencePartner:searchStream`;
8
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/destinations/display-video-360/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,kBAAkB,GAAG,IAAI,CAAA;AACzB,QAAA,QAAQ,GAAG,0CAA0C,0BAAkB,4DAA4D,CAAA;AACnI,QAAA,mBAAmB,GAAG,GAAG,gBAAQ,kBAAkB,CAAA;AACnD,QAAA,gBAAgB,GAAG,GAAG,gBAAQ,8BAA8B,CAAA"}
@@ -0,0 +1,5 @@
1
+ export interface Settings {
2
+ }
3
+ export interface AudienceSettings {
4
+ advertiserId?: string;
5
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=generated-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../src/destinations/display-video-360/generated-types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import { AudienceDestinationDefinition } from '@segment/actions-core';
2
+ import type { Settings, AudienceSettings } from './generated-types';
3
+ declare const destination: AudienceDestinationDefinition<Settings, AudienceSettings>;
4
+ export default destination;
@@ -0,0 +1,115 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const actions_core_1 = require("@segment/actions-core");
7
+ const addToAudience_1 = __importDefault(require("./addToAudience"));
8
+ const removeFromAudience_1 = __importDefault(require("./removeFromAudience"));
9
+ const constants_1 = require("./constants");
10
+ const destination = {
11
+ name: 'Display and Video 360 (Actions)',
12
+ slug: 'actions-display-video-360',
13
+ mode: 'cloud',
14
+ extendRequest() {
15
+ return {};
16
+ },
17
+ audienceFields: {
18
+ advertiserId: {
19
+ type: 'string',
20
+ label: 'Advertiser ID',
21
+ description: 'The ID of your advertiser, used throughout Display & Video 360. Use this ID when you contact Display & Video 360 support to help our teams locate your specific account.'
22
+ }
23
+ },
24
+ audienceConfig: {
25
+ mode: {
26
+ type: 'synced',
27
+ full_audience_sync: true
28
+ },
29
+ async createAudience(request, createAudienceInput) {
30
+ const audienceName = createAudienceInput.audienceName;
31
+ const advertiserId = createAudienceInput.audienceSettings?.advertiserId;
32
+ const statsClient = createAudienceInput?.statsContext?.statsClient;
33
+ const statsTags = createAudienceInput?.statsContext?.tags;
34
+ if (!audienceName) {
35
+ throw new actions_core_1.IntegrationError('Missing audience name value', 'MISSING_REQUIRED_FIELD', 400);
36
+ }
37
+ if (!advertiserId) {
38
+ throw new actions_core_1.IntegrationError('Missing advertiser ID value', 'MISSING_REQUIRED_FIELD', 400);
39
+ }
40
+ const partnerCreateAudienceUrl = constants_1.CREATE_AUDIENCE_URL.replace('advertiserID', advertiserId);
41
+ let response;
42
+ try {
43
+ response = await request(partnerCreateAudienceUrl, {
44
+ method: 'POST',
45
+ headers: {
46
+ 'Content-Type': 'application/json',
47
+ 'Login-Customer-Id': `products/DISPLAY_VIDEO_ADVERTISER/customers/${advertiserId}`
48
+ },
49
+ json: {
50
+ operations: [
51
+ {
52
+ create: {
53
+ basicUserList: {},
54
+ name: audienceName,
55
+ description: 'Created by Segment',
56
+ membershipStatus: 'OPEN',
57
+ type: 'REMARKETING',
58
+ membershipLifeSpan: '540'
59
+ }
60
+ }
61
+ ]
62
+ }
63
+ });
64
+ }
65
+ catch (error) {
66
+ const errorMessage = await JSON.parse(error.response.content).error.details[0].errors[0].message;
67
+ statsClient?.incr('createAudience.error', 1, statsTags);
68
+ throw new actions_core_1.IntegrationError(errorMessage, 'INVALID_RESPONSE', 400);
69
+ }
70
+ const r = await response.json();
71
+ statsClient?.incr('createAudience.success', 1, statsTags);
72
+ return {
73
+ externalId: r['results'][0]['resourceName']
74
+ };
75
+ },
76
+ async getAudience(request, getAudienceInput) {
77
+ const statsClient = getAudienceInput?.statsContext?.statsClient;
78
+ const statsTags = getAudienceInput?.statsContext?.tags;
79
+ const advertiserId = getAudienceInput.audienceSettings?.advertiserId;
80
+ if (!advertiserId) {
81
+ throw new actions_core_1.IntegrationError('Missing required advertiser ID value', 'MISSING_REQUIRED_FIELD', 400);
82
+ }
83
+ const advertiserGetAudienceUrl = constants_1.GET_AUDIENCE_URL.replace('advertiserID', advertiserId);
84
+ const response = await request(advertiserGetAudienceUrl, {
85
+ headers: {
86
+ 'Content-Type': 'application/json',
87
+ 'Login-Customer-Id': `products/DISPLAY_VIDEO_ADVERTISER/customers/${advertiserId}`
88
+ },
89
+ method: 'POST',
90
+ json: {
91
+ query: `SELECT user_list.name, user_list.description, user_list.membership_status, user_list.match_rate_percentage FROM user_list WHERE user_list.resource_name = "${getAudienceInput.externalId}"`
92
+ }
93
+ });
94
+ const r = await response.json();
95
+ if (response.status !== 200) {
96
+ statsClient?.incr('getAudience.error', 1, statsTags);
97
+ throw new actions_core_1.IntegrationError('Invalid response from get audience request', 'INVALID_RESPONSE', 400);
98
+ }
99
+ const externalId = r[0]?.results[0]?.userList?.resourceName;
100
+ if (externalId !== getAudienceInput.externalId) {
101
+ throw new actions_core_1.IntegrationError("Unable to verify ownership over audience. Segment Audience ID doesn't match Googles Audience ID.", 'INVALID_REQUEST_DATA', 400);
102
+ }
103
+ statsClient?.incr('getAudience.success', 1, statsTags);
104
+ return {
105
+ externalId: externalId
106
+ };
107
+ }
108
+ },
109
+ actions: {
110
+ addToAudience: addToAudience_1.default,
111
+ removeFromAudience: removeFromAudience_1.default
112
+ }
113
+ };
114
+ exports.default = destination;
115
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/display-video-360/index.ts"],"names":[],"mappings":";;;;;AAAA,wDAAuF;AAGvF,oEAA2C;AAC3C,8EAAqD;AAErD,2CAAmE;AAEnE,MAAM,WAAW,GAA8D;IAC7E,IAAI,EAAE,iCAAiC;IACvC,IAAI,EAAE,2BAA2B;IACjC,IAAI,EAAE,OAAO;IACb,aAAa;QAEX,OAAO,EAAE,CAAA;IACX,CAAC;IACD,cAAc,EAAE;QACd,YAAY,EAAE;YACZ,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,eAAe;YACtB,WAAW,EACT,0KAA0K;SAC7K;KACF;IACD,cAAc,EAAE;QACd,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,kBAAkB,EAAE,IAAI;SACzB;QACD,KAAK,CAAC,cAAc,CAAC,OAAO,EAAE,mBAAmB;YAC/C,MAAM,YAAY,GAAG,mBAAmB,CAAC,YAAY,CAAA;YACrD,MAAM,YAAY,GAAG,mBAAmB,CAAC,gBAAgB,EAAE,YAAY,CAAA;YACvE,MAAM,WAAW,GAAG,mBAAmB,EAAE,YAAY,EAAE,WAAW,CAAA;YAClE,MAAM,SAAS,GAAG,mBAAmB,EAAE,YAAY,EAAE,IAAI,CAAA;YAEzD,IAAI,CAAC,YAAY,EAAE;gBACjB,MAAM,IAAI,+BA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AAI,UAAU,KAAK,gBAAgB,CAAC,UAAU,EAAE;gBAC9C,MAAM,IAAI,+BAAgB,CACxB,kGAAkG,EAClG,sBAAsB,EACtB,GAAG,CACJ,CAAA;aACF;YAED,WAAW,EAAE,IAAI,CAAC,qBAAqB,EAAE,CAAC,EAAE,SAAS,CAAC,CAAA;YACtD,OAAO;gBACL,UAAU,EAAE,UAAU;aACvB,CAAA;QACH,CAAC;KACF;IACD,OAAO,EAAE;QACP,aAAa,EAAb,uBAAa;QACb,kBAAkB,EAAlB,4BAAkB;KACnB;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
@@ -0,0 +1,2 @@
1
+ export interface Payload {
2
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=generated-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/display-video-360/removeFromAudience/generated-types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ import type { ActionDefinition } from '@segment/actions-core';
2
+ import type { Settings } from '../generated-types';
3
+ import type { Payload } from './generated-types';
4
+ declare const action: ActionDefinition<Settings, Payload>;
5
+ export default action;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const action = {
4
+ title: 'Remove from Audience',
5
+ description: 'Remove users from an audience',
6
+ fields: {},
7
+ perform: () => {
8
+ return;
9
+ }
10
+ };
11
+ exports.default = action;
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/display-video-360/removeFromAudience/index.ts"],"names":[],"mappings":";;AAIA,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,sBAAsB;IAC7B,WAAW,EAAE,+BAA+B;IAC5C,MAAM,EAAE,EAAE;IACV,OAAO,EAAE,GAAG,EAAE;QACZ,OAAM;IACR,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
@@ -293,7 +293,7 @@ class SendEmailPerformer extends utils_1.MessageSendPerformer {
293
293
  return $.html();
294
294
  }
295
295
  onResponse(args) {
296
- const headers = args.response?.headers || args.error?.response.headers;
296
+ const headers = args.response?.headers || args.error?.response?.headers;
297
297
  const sgMsgId = headers?.get('X-Message-ID');
298
298
  if (sgMsgId)
299
299
  args.operation.logs.push('[sendgrid]X-Message-ID: ' + sgMsgId);