@segment/action-destinations 3.102.1-alpha.3 → 3.102.1-alpha.5

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 (92) hide show
  1. package/dist/destinations/actions-pardot/prospects/index.js.map +1 -1
  2. package/dist/destinations/amplitude/logEvent/generated-types.d.ts +21 -0
  3. package/dist/destinations/amplitude/logEvent/index.js +96 -10
  4. package/dist/destinations/amplitude/logEvent/index.js.map +1 -1
  5. package/dist/destinations/cordial/addProductToCart/index.js +1 -1
  6. package/dist/destinations/cordial/addProductToCart/index.js.map +1 -1
  7. package/dist/destinations/cordial/index.js +1 -1
  8. package/dist/destinations/cordial/index.js.map +1 -1
  9. package/dist/destinations/cordial/removeProductFromCart/index.js.map +1 -1
  10. package/dist/destinations/cordial/upsertOrder/index.js +8 -8
  11. package/dist/destinations/cordial/upsertOrder/index.js.map +1 -1
  12. package/dist/destinations/customerio/trackEvent/index.js.map +1 -1
  13. package/dist/destinations/engage-messaging-sendgrid/generated-types.d.ts +1 -0
  14. package/dist/destinations/engage-messaging-sendgrid/index.js +5 -0
  15. package/dist/destinations/engage-messaging-sendgrid/index.js.map +1 -1
  16. package/dist/destinations/engage-messaging-sendgrid/sendEmail/generated-types.d.ts +4 -0
  17. package/dist/destinations/engage-messaging-sendgrid/sendEmail/index.js +38 -1
  18. package/dist/destinations/engage-messaging-sendgrid/sendEmail/index.js.map +1 -1
  19. package/dist/destinations/engage-messaging-twilio/sendSms/index.js +1 -0
  20. package/dist/destinations/engage-messaging-twilio/sendSms/index.js.map +1 -1
  21. package/dist/destinations/google-enhanced-conversions/constants.d.ts +1 -0
  22. package/dist/destinations/google-enhanced-conversions/constants.js +185 -0
  23. package/dist/destinations/google-enhanced-conversions/constants.js.map +1 -0
  24. package/dist/destinations/google-enhanced-conversions/functions.d.ts +3 -0
  25. package/dist/destinations/google-enhanced-conversions/functions.js +36 -0
  26. package/dist/destinations/google-enhanced-conversions/functions.js.map +1 -0
  27. package/dist/destinations/google-enhanced-conversions/generated-types.d.ts +2 -1
  28. package/dist/destinations/google-enhanced-conversions/index.js +15 -8
  29. package/dist/destinations/google-enhanced-conversions/index.js.map +1 -1
  30. package/dist/destinations/google-enhanced-conversions/postConversion/index.js +7 -1
  31. package/dist/destinations/google-enhanced-conversions/postConversion/index.js.map +1 -1
  32. package/dist/destinations/google-enhanced-conversions/uploadCallConversion/generated-types.d.ts +11 -0
  33. package/dist/destinations/google-enhanced-conversions/uploadCallConversion/generated-types.js +3 -0
  34. package/dist/destinations/google-enhanced-conversions/uploadCallConversion/generated-types.js.map +1 -0
  35. package/dist/destinations/google-enhanced-conversions/uploadCallConversion/index.d.ts +5 -0
  36. package/dist/destinations/google-enhanced-conversions/uploadCallConversion/index.js +99 -0
  37. package/dist/destinations/google-enhanced-conversions/uploadCallConversion/index.js.map +1 -0
  38. package/dist/destinations/google-enhanced-conversions/uploadClickConversion/generated-types.d.ts +25 -0
  39. package/dist/destinations/google-enhanced-conversions/uploadClickConversion/generated-types.js +3 -0
  40. package/dist/destinations/google-enhanced-conversions/uploadClickConversion/generated-types.js.map +1 -0
  41. package/dist/destinations/google-enhanced-conversions/uploadClickConversion/index.d.ts +5 -0
  42. package/dist/destinations/google-enhanced-conversions/uploadClickConversion/index.js +238 -0
  43. package/dist/destinations/google-enhanced-conversions/uploadClickConversion/index.js.map +1 -0
  44. package/dist/destinations/google-enhanced-conversions/uploadClickConversion/types.d.ts +5 -0
  45. package/dist/destinations/google-enhanced-conversions/uploadClickConversion/types.js +3 -0
  46. package/dist/destinations/google-enhanced-conversions/uploadClickConversion/types.js.map +1 -0
  47. package/dist/destinations/google-enhanced-conversions/uploadConversionAdjustment/generated-types.d.ts +20 -0
  48. package/dist/destinations/google-enhanced-conversions/uploadConversionAdjustment/generated-types.js +3 -0
  49. package/dist/destinations/google-enhanced-conversions/uploadConversionAdjustment/generated-types.js.map +1 -0
  50. package/dist/destinations/google-enhanced-conversions/uploadConversionAdjustment/index.d.ts +5 -0
  51. package/dist/destinations/google-enhanced-conversions/uploadConversionAdjustment/index.js +269 -0
  52. package/dist/destinations/google-enhanced-conversions/uploadConversionAdjustment/index.js.map +1 -0
  53. package/dist/destinations/index.js +2 -0
  54. package/dist/destinations/index.js.map +1 -1
  55. package/dist/destinations/linkedin-audiences/index.js +3 -5
  56. package/dist/destinations/linkedin-audiences/index.js.map +1 -1
  57. package/dist/destinations/linkedin-audiences/updateAudience/index.js +10 -18
  58. package/dist/destinations/linkedin-audiences/updateAudience/index.js.map +1 -1
  59. package/dist/destinations/mixpanel/trackEvent/index.js.map +1 -1
  60. package/dist/destinations/salesforce/lead/index.js +2 -1
  61. package/dist/destinations/salesforce/lead/index.js.map +1 -1
  62. package/dist/destinations/salesforce-marketing-cloud/contact/generated-types.d.ts +2 -0
  63. package/dist/destinations/salesforce-marketing-cloud/contact/generated-types.js +3 -0
  64. package/dist/destinations/salesforce-marketing-cloud/contact/generated-types.js.map +1 -0
  65. package/dist/destinations/salesforce-marketing-cloud/contact/index.d.ts +5 -0
  66. package/dist/destinations/salesforce-marketing-cloud/contact/index.js +11 -0
  67. package/dist/destinations/salesforce-marketing-cloud/contact/index.js.map +1 -0
  68. package/dist/destinations/salesforce-marketing-cloud/generated-types.d.ts +2 -0
  69. package/dist/destinations/salesforce-marketing-cloud/generated-types.js +3 -0
  70. package/dist/destinations/salesforce-marketing-cloud/generated-types.js.map +1 -0
  71. package/dist/destinations/salesforce-marketing-cloud/index.d.ts +4 -0
  72. package/dist/destinations/salesforce-marketing-cloud/index.js +27 -0
  73. package/dist/destinations/salesforce-marketing-cloud/index.js.map +1 -0
  74. package/dist/destinations/sendgrid/generated-types.d.ts +3 -0
  75. package/dist/destinations/sendgrid/generated-types.js +3 -0
  76. package/dist/destinations/sendgrid/generated-types.js.map +1 -0
  77. package/dist/destinations/sendgrid/index.d.ts +4 -0
  78. package/dist/destinations/sendgrid/index.js +31 -0
  79. package/dist/destinations/sendgrid/index.js.map +1 -0
  80. package/dist/destinations/sendgrid/sendgrid-properties.d.ts +23 -0
  81. package/dist/destinations/sendgrid/sendgrid-properties.js +23 -0
  82. package/dist/destinations/sendgrid/sendgrid-properties.js.map +1 -0
  83. package/dist/destinations/sendgrid/updateUserProfile/generated-types.d.ts +21 -0
  84. package/dist/destinations/sendgrid/updateUserProfile/generated-types.js +3 -0
  85. package/dist/destinations/sendgrid/updateUserProfile/generated-types.js.map +1 -0
  86. package/dist/destinations/sendgrid/updateUserProfile/index.d.ts +5 -0
  87. package/dist/destinations/sendgrid/updateUserProfile/index.js +239 -0
  88. package/dist/destinations/sendgrid/updateUserProfile/index.js.map +1 -0
  89. package/dist/lib/engage-test-data/create-messaging-test-event.d.ts +15 -1
  90. package/dist/lib/engage-test-data/create-messaging-test-event.js +15 -0
  91. package/dist/lib/engage-test-data/create-messaging-test-event.js.map +1 -1
  92. package/package.json +4 -4
@@ -0,0 +1,239 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const sendgrid_properties_1 = require("../sendgrid-properties");
4
+ const actions_core_1 = require("@segment/actions-core");
5
+ const action = {
6
+ title: 'Upsert Contact',
7
+ description: 'Add or update a Contact in SendGrid.',
8
+ fields: {
9
+ enable_batching: {
10
+ type: 'boolean',
11
+ label: 'Batch Data to SendGrid Contacts PUT API',
12
+ description: 'When enabled, the action will use the SendGrid Contacts PUT API to perform the batch operation. Batches can contain up to 30k records in a request.',
13
+ default: true
14
+ },
15
+ first_name: {
16
+ label: 'First Name',
17
+ description: `The contact's first name.`,
18
+ type: 'string',
19
+ allowNull: true,
20
+ default: {
21
+ '@if': {
22
+ exists: { '@path': '$.traits.first_name' },
23
+ then: { '@path': '$.traits.first_name' },
24
+ else: { '@path': '$.properties.first_name' }
25
+ }
26
+ }
27
+ },
28
+ last_name: {
29
+ label: 'Last Name',
30
+ description: `The contact's last name.`,
31
+ type: 'string',
32
+ allowNull: true,
33
+ default: {
34
+ '@if': {
35
+ exists: { '@path': '$.traits.last_name' },
36
+ then: { '@path': '$.traits.last_name' },
37
+ else: { '@path': '$.properties.last_name' }
38
+ }
39
+ }
40
+ },
41
+ country: {
42
+ label: 'Country',
43
+ description: `The contact's country.`,
44
+ type: 'string',
45
+ allowNull: true,
46
+ default: {
47
+ '@if': {
48
+ exists: { '@path': '$.traits.address.country' },
49
+ then: { '@path': '$.traits.address.country' },
50
+ else: { '@path': '$.properties.address.country' }
51
+ }
52
+ }
53
+ },
54
+ postal_code: {
55
+ label: 'Postal Code',
56
+ description: `The contact's postal code.`,
57
+ type: 'string',
58
+ allowNull: true,
59
+ default: {
60
+ '@if': {
61
+ exists: { '@path': '$.traits.address.postal_code' },
62
+ then: { '@path': '$.traits.address.postal_code' },
63
+ else: { '@path': '$.properties.address.postal_code' }
64
+ }
65
+ }
66
+ },
67
+ city: {
68
+ label: 'City',
69
+ description: `The contact's city.`,
70
+ type: 'string',
71
+ allowNull: true,
72
+ default: {
73
+ '@if': {
74
+ exists: { '@path': '$.traits.address.city' },
75
+ then: { '@path': '$.traits.address.city' },
76
+ else: { '@path': '$.properties.address.city' }
77
+ }
78
+ }
79
+ },
80
+ state: {
81
+ label: 'State',
82
+ description: `The contact's state.`,
83
+ type: 'string',
84
+ allowNull: true,
85
+ default: {
86
+ '@if': {
87
+ exists: { '@path': '$.traits.address.state' },
88
+ then: { '@path': '$.traits.address.state' },
89
+ else: { '@path': '$.properties.address.state' }
90
+ }
91
+ }
92
+ },
93
+ address_line_1: {
94
+ label: 'Address Line 1',
95
+ description: `The contact's address line 1.`,
96
+ type: 'string',
97
+ allowNull: true,
98
+ default: {
99
+ '@if': {
100
+ exists: { '@path': '$.traits.address.line1' },
101
+ then: { '@path': '$.traits.address.line1' },
102
+ else: { '@path': '$.properties.address.line1' }
103
+ }
104
+ }
105
+ },
106
+ address_line_2: {
107
+ label: 'Address Line 2',
108
+ description: `The contact's address line 2.`,
109
+ type: 'string',
110
+ allowNull: true,
111
+ default: {
112
+ '@if': {
113
+ exists: { '@path': '$.traits.address.line2' },
114
+ then: { '@path': '$.traits.address.line2' },
115
+ else: { '@path': '$.properties.address.line2' }
116
+ }
117
+ }
118
+ },
119
+ phone_number: {
120
+ label: 'Phone Number',
121
+ description: `The contact's phone number.`,
122
+ type: 'string',
123
+ allowNull: true,
124
+ default: {
125
+ '@if': {
126
+ exists: { '@path': '$.traits.phone' },
127
+ then: { '@path': '$.traits.phone' },
128
+ else: { '@path': '$.properties.phone' }
129
+ }
130
+ }
131
+ },
132
+ whatsapp: {
133
+ label: 'WhatsApp',
134
+ description: `The contact's WhatsApp.`,
135
+ type: 'string',
136
+ allowNull: true,
137
+ default: {
138
+ '@if': {
139
+ exists: { '@path': '$.traits.whatsapp' },
140
+ then: { '@path': '$.traits.whatsapp' },
141
+ else: { '@path': '$.properties.whatsapp' }
142
+ }
143
+ }
144
+ },
145
+ line: {
146
+ label: 'LINE ID',
147
+ description: `The contact's LINE ID.`,
148
+ type: 'string',
149
+ allowNull: true,
150
+ default: {
151
+ '@if': {
152
+ exists: { '@path': '$.traits.line' },
153
+ then: { '@path': '$.traits.line' },
154
+ else: { '@path': '$.properties.line' }
155
+ }
156
+ }
157
+ },
158
+ facebook: {
159
+ label: 'Facebook ID',
160
+ description: `The contact's Facebook ID.`,
161
+ type: 'string',
162
+ allowNull: true,
163
+ default: {
164
+ '@if': {
165
+ exists: { '@path': '$.traits.facebook' },
166
+ then: { '@path': '$.traits.facebook' },
167
+ else: { '@path': '$.properties.facebook' }
168
+ }
169
+ }
170
+ },
171
+ unique_name: {
172
+ label: 'Unique Name',
173
+ description: `The contact's unique name.`,
174
+ type: 'string',
175
+ allowNull: true,
176
+ default: {
177
+ '@if': {
178
+ exists: { '@path': '$.traits.unique_name' },
179
+ then: { '@path': '$.traits.unique_name' },
180
+ else: { '@path': '$.properties.unique_name' }
181
+ }
182
+ }
183
+ },
184
+ identity: {
185
+ label: 'Identity',
186
+ description: `The contact's identity.`,
187
+ type: 'string',
188
+ allowNull: true,
189
+ default: {
190
+ '@if': {
191
+ exists: { '@path': '$.traits.identity' },
192
+ then: { '@path': '$.traits.identity' },
193
+ else: { '@path': '$.properties.identity' }
194
+ }
195
+ }
196
+ },
197
+ primary_email: {
198
+ label: 'Email Address',
199
+ description: `The contact's email address.`,
200
+ type: 'string',
201
+ allowNull: false,
202
+ required: true,
203
+ default: {
204
+ '@if': {
205
+ exists: { '@path': '$.traits.email' },
206
+ then: { '@path': '$.traits.email' },
207
+ else: { '@path': '$.properties.email' }
208
+ }
209
+ }
210
+ },
211
+ customFields: sendgrid_properties_1.customFields
212
+ },
213
+ perform: (request, data) => {
214
+ const formattedData = { contacts: [sendgrid_properties_1.convertPayload(data.payload)] };
215
+ return request('https://api.sendgrid.com/v3/marketing/contacts', {
216
+ method: 'put',
217
+ headers: {
218
+ authorization: `Bearer ${data.settings.sendGridApiKey}`
219
+ },
220
+ json: formattedData
221
+ });
222
+ },
223
+ performBatch: (request, data) => {
224
+ const n = data.payload.length;
225
+ if (n < 1) {
226
+ throw new actions_core_1.IntegrationError('No record to send', 'No data', 400);
227
+ }
228
+ const formattedData = { contacts: data.payload.map(sendgrid_properties_1.convertPayload) };
229
+ return request('https://api.sendgrid.com/v3/marketing/contacts', {
230
+ method: 'put',
231
+ headers: {
232
+ authorization: `Bearer ${data.settings.sendGridApiKey}`
233
+ },
234
+ json: formattedData
235
+ });
236
+ }
237
+ };
238
+ exports.default = action;
239
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/sendgrid/updateUserProfile/index.ts"],"names":[],"mappings":";;AAGA,gEAAqE;AACrE,wDAAwD;AAExD,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,gBAAgB;IACvB,WAAW,EAAE,sCAAsC;IACnD,MAAM,EAAE;QACN,eAAe,EAAE;YACf,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,yCAAyC;YAChD,WAAW,EACT,qJAAqJ;YACvJ,OAAO,EAAE,IAAI;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,IAAI,EAAE,EAAE;QAEzB,MAAM,aAAa,GAAG,EAAE,QAAQ,EAAE,CAAC,oCAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,CAAA;QAIlE,OAAO,OAAO,CAAC,gDAAgD,EAAE;YAC/D,MAAM,EAAE,KAAK;YACb,OAAO,EAAE;gBACP,aAAa,EAAE,UAAU,IAAI,CAAC,QAAQ,CAAC,cAAc,EAAE;aACxD;YACD,IAAI,EAAE,aAAa;SACpB,CAAC,CAAA;IACJ,CAAC;IAED,YAAY,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE;QAC9B,MAAM,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAA;QAC7B,IAAI,CAAC,GAAG,CAAC,EAAE;YACT,MAAM,IAAI,+BAAgB,CAAC,mBAAmB,EAAE,SAAS,EAAE,GAAG,CAAC,CAAA;SAChE;QAED,MAAM,aAAa,GAAG,EAAE,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,oCAAc,CAAC,EAAE,CAAA;QACpE,OAAO,OAAO,CAAC,gDAAgD,EAAE;YAC/D,MAAM,EAAE,KAAK;YACb,OAAO,EAAE;gBACP,aAAa,EAAE,UAAU,IAAI,CAAC,QAAQ,CAAC,cAAc,EAAE;aACxD;YACD,IAAI,EAAE,aAAa;SACpB,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
@@ -1,2 +1,16 @@
1
1
  import type { SegmentEvent } from '@segment/actions-core';
2
- export declare function createMessagingTestEvent(event?: Partial<SegmentEvent>): SegmentEvent;
2
+ declare type SegmentEventWithExternalIds = SegmentEvent & {
3
+ external_ids?: {
4
+ id: string;
5
+ type: 'email' | 'phone';
6
+ isSubscribed: boolean | null;
7
+ collection: 'users';
8
+ encoding: 'none';
9
+ groups?: {
10
+ id: string;
11
+ isSubscribed: boolean | null;
12
+ }[];
13
+ }[];
14
+ };
15
+ export declare function createMessagingTestEvent(event?: Partial<SegmentEventWithExternalIds>): SegmentEventWithExternalIds;
16
+ export {};
@@ -41,6 +41,21 @@ function createMessagingTestEvent(event = {}) {
41
41
  traits: {},
42
42
  type: 'track',
43
43
  userId: 'user1234',
44
+ external_ids: [
45
+ {
46
+ collection: 'users',
47
+ encoding: 'none',
48
+ groups: [
49
+ {
50
+ id: uuid_1.v4(),
51
+ isSubscribed: true
52
+ }
53
+ ] || undefined,
54
+ id: uuid_1.v4() + '@unittest.com',
55
+ isSubscribed: true,
56
+ type: 'email'
57
+ }
58
+ ],
44
59
  ...event
45
60
  };
46
61
  }
@@ -1 +1 @@
1
- {"version":3,"file":"create-messaging-test-event.js","sourceRoot":"","sources":["../../../src/lib/engage-test-data/create-messaging-test-event.ts"],"names":[],"mappings":";;;AAAA,uCAA2C;AAG3C,SAAgB,wBAAwB,CAAC,QAA+B,EAAE;IACxE,OAAO;QACL,WAAW,EAAE,SAAM,EAAE;QACrB,OAAO,EAAE;YACP,EAAE,EAAE,SAAS;YACb,OAAO,EAAE;gBACP,IAAI,EAAE,cAAc;gBACpB,OAAO,EAAE,QAAQ;aAClB;YACD,MAAM,EAAE,OAAO;YACf,QAAQ,EAAE;gBACR,IAAI,EAAE,eAAe;gBACrB,OAAO,EAAE,eAAe;gBACxB,QAAQ,EAAE,UAAU;gBACpB,SAAS,EAAE,CAAC,UAAU;gBACtB,KAAK,EAAE,CAAC;aACT;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,WAAW;gBACjB,QAAQ,EAAE,EAAE;gBACZ,MAAM,EAAE,EAAE;gBACV,KAAK,EAAE,mBAAmB;gBAC1B,GAAG,EAAE,8BAA8B;aACpC;YACD,QAAQ,EAAE,kBAAkB;YAC5B,SAAS,EACP,uIAAuI;SAC1I;QACD,KAAK,EAAE,YAAY;QACnB,SAAS,EAAE,SAAM,EAAE;QACnB,UAAU,EAAE;YACV,SAAS,EAAE,YAAY;YACvB,QAAQ,EAAE,UAAU;SACrB;QACD,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QACpC,MAAM,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QAChC,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QACnC,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,OAAO;QACb,MAAM,EAAE,UAAU;QAClB,GAAG,KAAK;KACT,CAAA;AACH,CAAC;AA1CD,4DA0CC"}
1
+ {"version":3,"file":"create-messaging-test-event.js","sourceRoot":"","sources":["../../../src/lib/engage-test-data/create-messaging-test-event.ts"],"names":[],"mappings":";;;AAAA,uCAA2C;AAiB3C,SAAgB,wBAAwB,CACtC,QAA8C,EAAE;IAEhD,OAAO;QACL,WAAW,EAAE,SAAM,EAAE;QACrB,OAAO,EAAE;YACP,EAAE,EAAE,SAAS;YACb,OAAO,EAAE;gBACP,IAAI,EAAE,cAAc;gBACpB,OAAO,EAAE,QAAQ;aAClB;YACD,MAAM,EAAE,OAAO;YACf,QAAQ,EAAE;gBACR,IAAI,EAAE,eAAe;gBACrB,OAAO,EAAE,eAAe;gBACxB,QAAQ,EAAE,UAAU;gBACpB,SAAS,EAAE,CAAC,UAAU;gBACtB,KAAK,EAAE,CAAC;aACT;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,WAAW;gBACjB,QAAQ,EAAE,EAAE;gBACZ,MAAM,EAAE,EAAE;gBACV,KAAK,EAAE,mBAAmB;gBAC1B,GAAG,EAAE,8BAA8B;aACpC;YACD,QAAQ,EAAE,kBAAkB;YAC5B,SAAS,EACP,uIAAuI;SAC1I;QACD,KAAK,EAAE,YAAY;QACnB,SAAS,EAAE,SAAM,EAAE;QACnB,UAAU,EAAE;YACV,SAAS,EAAE,YAAY;YACvB,QAAQ,EAAE,UAAU;SACrB;QACD,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QACpC,MAAM,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QAChC,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QACnC,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,OAAO;QACb,MAAM,EAAE,UAAU;QAClB,YAAY,EAAE;YACZ;gBACE,UAAU,EAAE,OAAO;gBACnB,QAAQ,EAAE,MAAM;gBAChB,MAAM,EACJ;oBACE;wBACE,EAAE,EAAE,SAAM,EAAE;wBACZ,YAAY,EAAE,IAAI;qBACnB;iBACF,IAAI,SAAS;gBAChB,EAAE,EAAE,SAAM,EAAE,GAAG,eAAe;gBAC9B,YAAY,EAAE,IAAI;gBAClB,IAAI,EAAE,OAAO;aACd;SACF;QACD,GAAG,KAAK;KACT,CAAA;AACH,CAAC;AA5DD,4DA4DC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@segment/action-destinations",
3
3
  "description": "Destination Actions engine and definitions.",
4
- "version": "3.102.1-alpha.3",
4
+ "version": "3.102.1-alpha.5",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/segmentio/action-destinations",
@@ -38,8 +38,8 @@
38
38
  "dependencies": {
39
39
  "@amplitude/ua-parser-js": "^0.7.25",
40
40
  "@segment/a1-notation": "^2.1.4",
41
- "@segment/actions-core": "^3.33.1-alpha.3",
42
- "@segment/actions-shared": "^1.16.1-alpha.3",
41
+ "@segment/actions-core": "^3.33.1-alpha.5",
42
+ "@segment/actions-shared": "^1.16.1-alpha.5",
43
43
  "cheerio": "^1.0.0-rc.10",
44
44
  "dayjs": "^1.10.7",
45
45
  "escape-goat": "^3",
@@ -65,5 +65,5 @@
65
65
  "lcov"
66
66
  ]
67
67
  },
68
- "gitHead": "1c069f887ed24a802e33affec2b3a821a92b529d"
68
+ "gitHead": "3d34e1b4a771e6701849f950b6f09a9f5f58cfd8"
69
69
  }