@segment/action-destinations 3.435.0 → 3.437.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.
- package/dist/destinations/amazon-amc/index.js +14 -0
- package/dist/destinations/amazon-amc/index.js.map +1 -1
- package/dist/destinations/amplitude/groupIdentifyUser/index.js +23 -21
- package/dist/destinations/amplitude/groupIdentifyUser/index.js.map +1 -1
- package/dist/destinations/aws-s3/index.js +14 -0
- package/dist/destinations/aws-s3/index.js.map +1 -1
- package/dist/destinations/delivrai-activate/index.js +14 -0
- package/dist/destinations/delivrai-activate/index.js.map +1 -1
- package/dist/destinations/display-video-360/index.js +14 -0
- package/dist/destinations/display-video-360/index.js.map +1 -1
- package/dist/destinations/dynamic-yield-audiences/index.js +14 -0
- package/dist/destinations/dynamic-yield-audiences/index.js.map +1 -1
- package/dist/destinations/facebook-custom-audiences/index.js +14 -0
- package/dist/destinations/facebook-custom-audiences/index.js.map +1 -1
- package/dist/destinations/first-party-dv360/index.js +14 -0
- package/dist/destinations/first-party-dv360/index.js.map +1 -1
- package/dist/destinations/google-enhanced-conversions/index.js +14 -0
- package/dist/destinations/google-enhanced-conversions/index.js.map +1 -1
- package/dist/destinations/hubspot/errors.d.ts +1 -0
- package/dist/destinations/hubspot/errors.js.map +1 -1
- package/dist/destinations/hubspot/upsertObject/client.d.ts +5 -1
- package/dist/destinations/hubspot/upsertObject/client.js +27 -0
- package/dist/destinations/hubspot/upsertObject/client.js.map +1 -1
- package/dist/destinations/hubspot/upsertObject/common-fields.js +133 -2
- package/dist/destinations/hubspot/upsertObject/common-fields.js.map +1 -1
- package/dist/destinations/hubspot/upsertObject/constants.d.ts +1 -0
- package/dist/destinations/hubspot/upsertObject/constants.js +2 -1
- package/dist/destinations/hubspot/upsertObject/constants.js.map +1 -1
- package/dist/destinations/hubspot/upsertObject/functions/cache-functions.d.ts +5 -2
- package/dist/destinations/hubspot/upsertObject/functions/cache-functions.js +30 -5
- package/dist/destinations/hubspot/upsertObject/functions/cache-functions.js.map +1 -1
- package/dist/destinations/hubspot/upsertObject/functions/dynamic-field-functions.d.ts +29 -0
- package/dist/destinations/hubspot/upsertObject/functions/dynamic-field-functions.js +103 -1
- package/dist/destinations/hubspot/upsertObject/functions/dynamic-field-functions.js.map +1 -1
- package/dist/destinations/hubspot/upsertObject/functions/hubspot-association-functions.d.ts +4 -3
- package/dist/destinations/hubspot/upsertObject/functions/hubspot-association-functions.js +11 -5
- package/dist/destinations/hubspot/upsertObject/functions/hubspot-association-functions.js.map +1 -1
- package/dist/destinations/hubspot/upsertObject/functions/hubspot-list-functions.d.ts +9 -0
- package/dist/destinations/hubspot/upsertObject/functions/hubspot-list-functions.js +152 -0
- package/dist/destinations/hubspot/upsertObject/functions/hubspot-list-functions.js.map +1 -0
- package/dist/destinations/hubspot/upsertObject/functions/hubspot-record-functions.js +5 -0
- package/dist/destinations/hubspot/upsertObject/functions/hubspot-record-functions.js.map +1 -1
- package/dist/destinations/hubspot/upsertObject/functions/validation-functions.d.ts +1 -1
- package/dist/destinations/hubspot/upsertObject/functions/validation-functions.js +22 -1
- package/dist/destinations/hubspot/upsertObject/functions/validation-functions.js.map +1 -1
- package/dist/destinations/hubspot/upsertObject/generated-types.d.ts +18 -0
- package/dist/destinations/hubspot/upsertObject/index.js +46 -36
- package/dist/destinations/hubspot/upsertObject/index.js.map +1 -1
- package/dist/destinations/hubspot/upsertObject/types.d.ts +53 -11
- package/dist/destinations/hubspot/upsertObject/types.js.map +1 -1
- package/dist/destinations/iterable-lists/index.js +14 -0
- package/dist/destinations/iterable-lists/index.js.map +1 -1
- package/dist/destinations/kafka/send/index.js +4 -4
- package/dist/destinations/kafka/send/index.js.map +1 -1
- package/dist/destinations/kafka/utils.d.ts +2 -2
- package/dist/destinations/kafka/utils.js +4 -1
- package/dist/destinations/kafka/utils.js.map +1 -1
- package/dist/destinations/klaviyo/index.js +14 -0
- package/dist/destinations/klaviyo/index.js.map +1 -1
- package/dist/destinations/marketo-static-lists/index.js +14 -0
- package/dist/destinations/marketo-static-lists/index.js.map +1 -1
- package/dist/destinations/ms-bing-ads-audiences/generated-types.d.ts +0 -1
- package/dist/destinations/ms-bing-ads-audiences/index.js +1 -7
- package/dist/destinations/ms-bing-ads-audiences/index.js.map +1 -1
- package/dist/destinations/ms-bing-capi/index.js +2 -2
- package/dist/destinations/ms-bing-capi/index.js.map +1 -1
- package/dist/destinations/ms-bing-capi/sendEvent/fields.js +1 -1
- package/dist/destinations/ms-bing-capi/sendEvent/fields.js.map +1 -1
- package/dist/destinations/ortto/common-fields.js +0 -21
- package/dist/destinations/ortto/common-fields.js.map +1 -1
- package/dist/destinations/ortto/trackActivity/generated-types.d.ts +2 -2
- package/dist/destinations/ortto/trackActivity/index.js +21 -2
- package/dist/destinations/ortto/trackActivity/index.js.map +1 -1
- package/dist/destinations/ortto/upsertContactProfile/generated-types.d.ts +2 -2
- package/dist/destinations/ortto/upsertContactProfile/index.js +23 -2
- package/dist/destinations/ortto/upsertContactProfile/index.js.map +1 -1
- package/dist/destinations/ortto-audiences/syncAudience/index.js +2 -0
- package/dist/destinations/ortto-audiences/syncAudience/index.js.map +1 -1
- package/dist/destinations/reddit-audiences/index.js +14 -0
- package/dist/destinations/reddit-audiences/index.js.map +1 -1
- package/dist/destinations/sendgrid-audiences/index.js +14 -0
- package/dist/destinations/sendgrid-audiences/index.js.map +1 -1
- package/dist/destinations/snap-audiences/index.js +14 -0
- package/dist/destinations/snap-audiences/index.js.map +1 -1
- package/dist/destinations/stackadapt-audiences/common-fields.d.ts +2 -0
- package/dist/destinations/stackadapt-audiences/common-fields.js +215 -0
- package/dist/destinations/stackadapt-audiences/common-fields.js.map +1 -0
- package/dist/destinations/stackadapt-audiences/common-functions.d.ts +8 -0
- package/dist/destinations/stackadapt-audiences/common-functions.js +212 -0
- package/dist/destinations/stackadapt-audiences/common-functions.js.map +1 -0
- package/dist/destinations/stackadapt-audiences/constants.d.ts +15 -0
- package/dist/destinations/stackadapt-audiences/constants.js +133 -0
- package/dist/destinations/stackadapt-audiences/constants.js.map +1 -0
- package/dist/destinations/stackadapt-audiences/forwardAudienceEvent/fields.d.ts +2 -0
- package/dist/destinations/stackadapt-audiences/forwardAudienceEvent/fields.js +63 -0
- package/dist/destinations/stackadapt-audiences/forwardAudienceEvent/fields.js.map +1 -0
- package/dist/destinations/stackadapt-audiences/forwardAudienceEvent/generated-types.d.ts +24 -5
- package/dist/destinations/stackadapt-audiences/forwardAudienceEvent/index.js +19 -83
- package/dist/destinations/stackadapt-audiences/forwardAudienceEvent/index.js.map +1 -1
- package/dist/destinations/stackadapt-audiences/forwardProfile/generated-types.d.ts +15 -9
- package/dist/destinations/stackadapt-audiences/forwardProfile/index.js +78 -124
- package/dist/destinations/stackadapt-audiences/forwardProfile/index.js.map +1 -1
- package/dist/destinations/stackadapt-audiences/generated-types.d.ts +1 -0
- package/dist/destinations/stackadapt-audiences/index.js +20 -8
- package/dist/destinations/stackadapt-audiences/index.js.map +1 -1
- package/dist/destinations/stackadapt-audiences/types.d.ts +37 -0
- package/dist/destinations/taboola-actions/index.js +14 -0
- package/dist/destinations/taboola-actions/index.js.map +1 -1
- package/dist/destinations/tiktok-audiences/index.js +14 -0
- package/dist/destinations/tiktok-audiences/index.js.map +1 -1
- package/dist/destinations/webhook-audiences/index.js +14 -0
- package/dist/destinations/webhook-audiences/index.js.map +1 -1
- package/dist/destinations/yahoo-audiences/index.js +14 -0
- package/dist/destinations/yahoo-audiences/index.js.map +1 -1
- package/package.json +4 -4
- package/dist/destinations/stackadapt-audiences/forwardAudienceEvent/functions.d.ts +0 -3
- package/dist/destinations/stackadapt-audiences/forwardAudienceEvent/functions.js +0 -83
- package/dist/destinations/stackadapt-audiences/forwardAudienceEvent/functions.js.map +0 -1
- package/dist/destinations/stackadapt-audiences/forwardProfile/functions.d.ts +0 -3
- package/dist/destinations/stackadapt-audiences/forwardProfile/functions.js +0 -131
- package/dist/destinations/stackadapt-audiences/forwardProfile/functions.js.map +0 -1
- package/dist/destinations/stackadapt-audiences/functions.d.ts +0 -7
- package/dist/destinations/stackadapt-audiences/functions.js +0 -62
- package/dist/destinations/stackadapt-audiences/functions.js.map +0 -1
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.common_fields = void 0;
|
|
4
|
+
exports.common_fields = {
|
|
5
|
+
standard_traits: {
|
|
6
|
+
label: 'Standard User Properties',
|
|
7
|
+
type: 'object',
|
|
8
|
+
description: 'Standard properties for the user.',
|
|
9
|
+
defaultObjectUI: 'keyvalue',
|
|
10
|
+
additionalProperties: false,
|
|
11
|
+
required: false,
|
|
12
|
+
properties: {
|
|
13
|
+
first_name: {
|
|
14
|
+
label: 'First Name',
|
|
15
|
+
type: 'string',
|
|
16
|
+
description: "The user's first name."
|
|
17
|
+
},
|
|
18
|
+
last_name: {
|
|
19
|
+
label: 'Last Name',
|
|
20
|
+
type: 'string',
|
|
21
|
+
description: "The user's last name."
|
|
22
|
+
},
|
|
23
|
+
phone: {
|
|
24
|
+
label: 'Phone',
|
|
25
|
+
type: 'string',
|
|
26
|
+
description: 'The phone number of the user.'
|
|
27
|
+
},
|
|
28
|
+
address: {
|
|
29
|
+
label: 'Address',
|
|
30
|
+
type: 'string',
|
|
31
|
+
description: 'The address of the user.'
|
|
32
|
+
},
|
|
33
|
+
city: {
|
|
34
|
+
label: 'City',
|
|
35
|
+
type: 'string',
|
|
36
|
+
description: 'The city of the user.'
|
|
37
|
+
},
|
|
38
|
+
country: {
|
|
39
|
+
label: 'Country',
|
|
40
|
+
type: 'string',
|
|
41
|
+
description: 'The country of the user.'
|
|
42
|
+
},
|
|
43
|
+
state: {
|
|
44
|
+
label: 'State',
|
|
45
|
+
type: 'string',
|
|
46
|
+
description: 'The state of the user.'
|
|
47
|
+
},
|
|
48
|
+
timezone: {
|
|
49
|
+
label: 'Time Zone',
|
|
50
|
+
type: 'string',
|
|
51
|
+
description: 'The timezone of the user.'
|
|
52
|
+
},
|
|
53
|
+
postal_code: {
|
|
54
|
+
label: 'Postal Code',
|
|
55
|
+
type: 'string',
|
|
56
|
+
description: 'The postal code of the user.'
|
|
57
|
+
},
|
|
58
|
+
birth_day: {
|
|
59
|
+
label: 'Birth Day',
|
|
60
|
+
type: 'number',
|
|
61
|
+
description: 'The numeric birth day of the user. e.g 15 for the 15th of the month.',
|
|
62
|
+
maximum: 31,
|
|
63
|
+
minimum: 1
|
|
64
|
+
},
|
|
65
|
+
birth_month: {
|
|
66
|
+
label: 'Birth Month',
|
|
67
|
+
type: 'number',
|
|
68
|
+
description: 'The numeric birth month of the user. e.g 6 for June.',
|
|
69
|
+
maximum: 12,
|
|
70
|
+
minimum: 1
|
|
71
|
+
},
|
|
72
|
+
birth_year: {
|
|
73
|
+
label: 'Birth Year',
|
|
74
|
+
type: 'number',
|
|
75
|
+
description: 'The numeric birth year of the user. e.g 1990.'
|
|
76
|
+
},
|
|
77
|
+
birth_date: {
|
|
78
|
+
label: 'Birth Date',
|
|
79
|
+
type: 'string',
|
|
80
|
+
format: 'date',
|
|
81
|
+
description: "The birth date of the user in YYYY-MM-DD format. If set, overrides 'Birth Day', 'Birth Month' and 'Birth Year' fields."
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
default: {
|
|
85
|
+
first_name: {
|
|
86
|
+
'@if': {
|
|
87
|
+
exists: { '@path': '$.traits.first_name' },
|
|
88
|
+
then: { '@path': '$.traits.first_name' },
|
|
89
|
+
else: { '@path': '$.properties.first_name' }
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
last_name: {
|
|
93
|
+
'@if': {
|
|
94
|
+
exists: { '@path': '$.traits.last_name' },
|
|
95
|
+
then: { '@path': '$.traits.last_name' },
|
|
96
|
+
else: { '@path': '$.properties.last_name' }
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
phone: {
|
|
100
|
+
'@if': {
|
|
101
|
+
exists: { '@path': '$.traits.phone' },
|
|
102
|
+
then: { '@path': '$.traits.phone' },
|
|
103
|
+
else: { '@path': '$.properties.phone' }
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
address: {
|
|
107
|
+
'@if': {
|
|
108
|
+
exists: { '@path': '$.traits.street' },
|
|
109
|
+
then: { '@path': '$.traits.street' },
|
|
110
|
+
else: { '@path': '$.properties.street' }
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
city: {
|
|
114
|
+
'@if': {
|
|
115
|
+
exists: { '@path': '$.traits.city' },
|
|
116
|
+
then: { '@path': '$.traits.city' },
|
|
117
|
+
else: { '@path': '$.properties.city' }
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
country: {
|
|
121
|
+
'@if': {
|
|
122
|
+
exists: { '@path': '$.traits.country' },
|
|
123
|
+
then: { '@path': '$.traits.country' },
|
|
124
|
+
else: { '@path': '$.properties.country' }
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
state: {
|
|
128
|
+
'@if': {
|
|
129
|
+
exists: { '@path': '$.traits.state' },
|
|
130
|
+
then: { '@path': '$.traits.state' },
|
|
131
|
+
else: { '@path': '$.properties.state' }
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
postal_code: {
|
|
135
|
+
'@if': {
|
|
136
|
+
exists: { '@path': '$.traits.postal_code' },
|
|
137
|
+
then: { '@path': '$.traits.postal_code' },
|
|
138
|
+
else: { '@path': '$.properties.postal_code' }
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
timezone: {
|
|
142
|
+
'@if': {
|
|
143
|
+
exists: { '@path': '$.traits.timezone' },
|
|
144
|
+
then: { '@path': '$.traits.timezone' },
|
|
145
|
+
else: { '@path': '$.properties.timezone' }
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
birth_day: {
|
|
149
|
+
'@if': {
|
|
150
|
+
exists: { '@path': '$.traits.birth_day' },
|
|
151
|
+
then: { '@path': '$.traits.birth_day' },
|
|
152
|
+
else: { '@path': '$.properties.birth_day' }
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
birth_month: {
|
|
156
|
+
'@if': {
|
|
157
|
+
exists: { '@path': '$.traits.birth_month' },
|
|
158
|
+
then: { '@path': '$.traits.birth_month' },
|
|
159
|
+
else: { '@path': '$.properties.birth_month' }
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
birth_year: {
|
|
163
|
+
'@if': {
|
|
164
|
+
exists: { '@path': '$.traits.birth_year' },
|
|
165
|
+
then: { '@path': '$.traits.birth_year' },
|
|
166
|
+
else: { '@path': '$.properties.birth_year' }
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
birth_date: {
|
|
170
|
+
'@if': {
|
|
171
|
+
exists: { '@path': '$.traits.birth_date' },
|
|
172
|
+
then: { '@path': '$.traits.birth_date' },
|
|
173
|
+
else: { '@path': '$.properties.birth_date' }
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
custom_traits: {
|
|
179
|
+
label: 'Custom User Properties',
|
|
180
|
+
type: 'object',
|
|
181
|
+
description: 'Custom properties for the user.',
|
|
182
|
+
defaultObjectUI: 'keyvalue',
|
|
183
|
+
required: false
|
|
184
|
+
},
|
|
185
|
+
user_id: {
|
|
186
|
+
label: 'Segment User ID',
|
|
187
|
+
description: 'The ID of the user in Segment',
|
|
188
|
+
type: 'string',
|
|
189
|
+
default: {
|
|
190
|
+
'@if': {
|
|
191
|
+
exists: { '@path': '$.userId' },
|
|
192
|
+
then: { '@path': '$.userId' },
|
|
193
|
+
else: { '@path': '$.anonymousId' }
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
event_type: {
|
|
198
|
+
label: 'Event Type',
|
|
199
|
+
description: 'The Segment event type - track or identify',
|
|
200
|
+
type: 'string',
|
|
201
|
+
required: true,
|
|
202
|
+
default: {
|
|
203
|
+
'@path': '$.type'
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
enable_batching: {
|
|
207
|
+
type: 'boolean',
|
|
208
|
+
label: 'Batch Profiles',
|
|
209
|
+
unsafe_hidden: true,
|
|
210
|
+
description: 'When enabled, Segment will batch profiles together and send them to StackAdapt in a single request.',
|
|
211
|
+
required: true,
|
|
212
|
+
default: true
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
//# sourceMappingURL=common-fields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common-fields.js","sourceRoot":"","sources":["../../../src/destinations/stackadapt-audiences/common-fields.ts"],"names":[],"mappings":";;;AAEa,QAAA,aAAa,GAA+B;IACrD,eAAe,EAAE;QACf,KAAK,EAAE,0BAA0B;QACjC,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,mCAAmC;QAChD,eAAe,EAAE,UAAU;QAC3B,oBAAoB,EAAE,KAAK;QAC3B,QAAQ,EAAE,KAAK;QACf,UAAU,EAAE;YACV,UAAU,EAAE;gBACV,KAAK,EAAE,YAAY;gBACnB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,wBAAwB;aACtC;YACD,SAAS,EAAE;gBACT,KAAK,EAAE,WAAW;gBAClB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,uBAAuB;aACrC;YACD,KAAK,EAAE;gBACL,KAAK,EAAE,OAAO;gBACd,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,+BAA+B;aAC7C;YACD,OAAO,EAAE;gBACP,KAAK,EAAE,SAAS;gBAChB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,0BAA0B;aACxC;YACD,IAAI,EAAE;gBACJ,KAAK,EAAE,MAAM;gBACb,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,uBAAuB;aACrC;YACD,OAAO,EAAE;gBACP,KAAK,EAAE,SAAS;gBAChB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,0BAA0B;aACxC;YACD,KAAK,EAAE;gBACL,KAAK,EAAE,OAAO;gBACd,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YAGP,KAAK,EAAE;gBACL,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;gBAC/B,IAAI,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;gBAC7B,IAAI,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE;aACnC;SACF;KACF;IACD,UAAU,EAAE;QACV,KAAK,EAAE,YAAY;QACnB,WAAW,EAAE,4CAA4C;QACzD,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE;YACP,OAAO,EAAE,QAAQ;SAClB;KACF;IACD,eAAe,EAAE;QACf,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,gBAAgB;QACvB,aAAa,EAAE,IAAI;QACnB,WAAW,EACT,qGAAqG;QACvG,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI;KACd;CACJ,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { RequestClient } from '@segment/actions-core';
|
|
2
|
+
import { Settings } from './generated-types';
|
|
3
|
+
import type { Payload as AudiencePayload } from './forwardAudienceEvent/generated-types';
|
|
4
|
+
import type { Payload as RegularPayload } from './forwardProfile/generated-types';
|
|
5
|
+
export declare function send(request: RequestClient, payloads: RegularPayload[] | AudiencePayload[], settings: Settings, isAudience: boolean): Promise<import("@segment/actions-core").ModifiedResponse<unknown>>;
|
|
6
|
+
export declare function sha256hash(data: string): string;
|
|
7
|
+
export declare function stringifyJsonWithEscapedQuotes(value: unknown): string;
|
|
8
|
+
export declare function stringifyMappingSchemaForGraphQL(value: unknown): string;
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.send = send;
|
|
4
|
+
exports.sha256hash = sha256hash;
|
|
5
|
+
exports.stringifyJsonWithEscapedQuotes = stringifyJsonWithEscapedQuotes;
|
|
6
|
+
exports.stringifyMappingSchemaForGraphQL = stringifyMappingSchemaForGraphQL;
|
|
7
|
+
const constants_1 = require("./constants");
|
|
8
|
+
const crypto_1 = require("crypto");
|
|
9
|
+
async function send(request, payloads, settings, isAudience) {
|
|
10
|
+
const fieldTypes = getDefaultFieldTypes();
|
|
11
|
+
const fieldsToMap = getDefaultFieldsToMap();
|
|
12
|
+
const advertiserId = settings.advertiser_id;
|
|
13
|
+
const marketingStatus = isAudience ? payloads[0].marketing_status : undefined;
|
|
14
|
+
const profileUpdates = payloads.map((p) => {
|
|
15
|
+
const { user_id, standard_traits: { birth_date, birth_day, birth_month, birth_year, ...restStandardTraits } = {}, custom_traits, email } = p;
|
|
16
|
+
const segment_computation_key = isAudience ? p.segment_computation_key : undefined;
|
|
17
|
+
const segment_computation_id = isAudience ? p.segment_computation_id : undefined;
|
|
18
|
+
const traits_or_props = isAudience ? p.traits_or_props : undefined;
|
|
19
|
+
if (isAudience && custom_traits) {
|
|
20
|
+
delete custom_traits[segment_computation_key];
|
|
21
|
+
delete custom_traits[segment_computation_id];
|
|
22
|
+
}
|
|
23
|
+
let date;
|
|
24
|
+
if (birth_date) {
|
|
25
|
+
date = new Date(birth_date);
|
|
26
|
+
}
|
|
27
|
+
const profile = {
|
|
28
|
+
userId: user_id,
|
|
29
|
+
email,
|
|
30
|
+
...restStandardTraits,
|
|
31
|
+
birth_day: (date ? date.getDate() : birth_day) ?? undefined,
|
|
32
|
+
birth_month: (date ? date.getMonth() + 1 : birth_month) ?? undefined,
|
|
33
|
+
birth_year: (date ? date.getFullYear() : birth_year) ?? undefined,
|
|
34
|
+
...custom_traits
|
|
35
|
+
};
|
|
36
|
+
if (isAudience && traits_or_props && segment_computation_key && segment_computation_id) {
|
|
37
|
+
profile.audienceId = segment_computation_id;
|
|
38
|
+
profile.audienceName = segment_computation_key;
|
|
39
|
+
profile.action = traits_or_props[segment_computation_key] ? 'enter' : 'exit';
|
|
40
|
+
}
|
|
41
|
+
if (!isAudience && p.previous_id) {
|
|
42
|
+
profile.previous_id = p.previous_id;
|
|
43
|
+
}
|
|
44
|
+
updateFieldsToMapAndFieldTypes(fieldsToMap, fieldTypes, custom_traits);
|
|
45
|
+
return profile;
|
|
46
|
+
});
|
|
47
|
+
const mappings = getProfileMappings(Array.from(fieldsToMap), fieldTypes, marketingStatus);
|
|
48
|
+
const profiles = stringifyJsonWithEscapedQuotes(profileUpdates);
|
|
49
|
+
const mutation = `mutation {
|
|
50
|
+
upsertProfiles(
|
|
51
|
+
input: {
|
|
52
|
+
advertiserId: ${advertiserId},
|
|
53
|
+
externalProvider: "${constants_1.EXTERNAL_PROVIDER}",
|
|
54
|
+
syncId: "${sha256hash(profiles)}",
|
|
55
|
+
profiles: "${profiles}"
|
|
56
|
+
}
|
|
57
|
+
) {
|
|
58
|
+
userErrors {
|
|
59
|
+
message
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
upsertProfileMapping(
|
|
63
|
+
input: {
|
|
64
|
+
advertiserId: ${advertiserId},
|
|
65
|
+
mappingSchemaV2: ${mappings},
|
|
66
|
+
mappableType: "${constants_1.EXTERNAL_PROVIDER}"
|
|
67
|
+
}
|
|
68
|
+
) {
|
|
69
|
+
userErrors {
|
|
70
|
+
message
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
${isAudience ? audienceMutation(advertiserId, stringifyMappingSchemaForGraphQL(constants_1.MAPPING_SCHEMA)) : ""}
|
|
74
|
+
}`;
|
|
75
|
+
return await request(constants_1.GQL_ENDPOINT, {
|
|
76
|
+
body: JSON.stringify({ query: mutation })
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
function sha256hash(data) {
|
|
80
|
+
const hash = (0, crypto_1.createHash)('sha256');
|
|
81
|
+
hash.update(data);
|
|
82
|
+
return hash.digest('hex');
|
|
83
|
+
}
|
|
84
|
+
function audienceMutation(advertiserId, audienceMapping) {
|
|
85
|
+
return `upsertExternalAudienceMapping(
|
|
86
|
+
input: {
|
|
87
|
+
advertiserId: ${advertiserId},
|
|
88
|
+
mappingSchema: ${audienceMapping},
|
|
89
|
+
mappableType: "${constants_1.EXTERNAL_PROVIDER}"
|
|
90
|
+
}
|
|
91
|
+
) {
|
|
92
|
+
userErrors {
|
|
93
|
+
message
|
|
94
|
+
}
|
|
95
|
+
}`;
|
|
96
|
+
}
|
|
97
|
+
function updateFieldsToMapAndFieldTypes(fieldsToMap, fieldTypes, customTraits = {}) {
|
|
98
|
+
return Object.keys(customTraits).reduce((acc, key) => {
|
|
99
|
+
const value = customTraits[key];
|
|
100
|
+
if (key === '' || value === '') {
|
|
101
|
+
return acc;
|
|
102
|
+
}
|
|
103
|
+
acc[key] = value;
|
|
104
|
+
const standardFields = getDefaultFieldsToMap();
|
|
105
|
+
if (!standardFields.has(key)) {
|
|
106
|
+
fieldsToMap.add(key);
|
|
107
|
+
if (value || value === 0) {
|
|
108
|
+
const type = getType(value);
|
|
109
|
+
if (fieldTypes[key] && fieldTypes[key] !== type) {
|
|
110
|
+
fieldTypes[key] = 'STRING';
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
fieldTypes[key] = type;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return acc;
|
|
118
|
+
}, {});
|
|
119
|
+
}
|
|
120
|
+
function getProfileMappings(customFields, fieldTypes, marketingStatus) {
|
|
121
|
+
const mappingSchema = [];
|
|
122
|
+
for (const field of customFields) {
|
|
123
|
+
const fieldConfig = constants_1.PROFILE_DEFAULT_FIELDS.find((f) => f.key === field);
|
|
124
|
+
if (fieldConfig) {
|
|
125
|
+
let destinationKey;
|
|
126
|
+
switch (fieldConfig.key) {
|
|
127
|
+
case 'user_id':
|
|
128
|
+
destinationKey = 'external_id';
|
|
129
|
+
break;
|
|
130
|
+
default:
|
|
131
|
+
destinationKey = fieldConfig.key;
|
|
132
|
+
}
|
|
133
|
+
mappingSchema.push({
|
|
134
|
+
incomingKey: field,
|
|
135
|
+
destinationKey,
|
|
136
|
+
label: fieldConfig.label,
|
|
137
|
+
type: fieldConfig.type.toUpperCase(),
|
|
138
|
+
isPii: fieldConfig.isPii || false
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
mappingSchema.push({
|
|
143
|
+
incomingKey: field,
|
|
144
|
+
destinationKey: field,
|
|
145
|
+
label: generateLabel(field),
|
|
146
|
+
type: fieldTypes[field] ?? 'STRING',
|
|
147
|
+
isPii: false
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
if (typeof marketingStatus === 'string') {
|
|
152
|
+
mappingSchema.push({
|
|
153
|
+
incomingKey: 'marketing_status',
|
|
154
|
+
destinationKey: 'marketing_status',
|
|
155
|
+
label: 'Marketing Status',
|
|
156
|
+
type: 'STRING',
|
|
157
|
+
isPii: false,
|
|
158
|
+
value: marketingStatus,
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
return stringifyMappingSchemaForGraphQL(mappingSchema);
|
|
162
|
+
}
|
|
163
|
+
function generateLabel(field) {
|
|
164
|
+
let label = field
|
|
165
|
+
.replace(/_/g, ' ')
|
|
166
|
+
.trim()
|
|
167
|
+
.replace(/\b\w/g, (str) => str.toUpperCase());
|
|
168
|
+
if (field.startsWith('audience')) {
|
|
169
|
+
label = `External ${label}`;
|
|
170
|
+
}
|
|
171
|
+
return label;
|
|
172
|
+
}
|
|
173
|
+
function getType(value) {
|
|
174
|
+
if (isDateStr(value))
|
|
175
|
+
return 'DATE';
|
|
176
|
+
return (typeof value).toUpperCase();
|
|
177
|
+
}
|
|
178
|
+
function isDateStr(value) {
|
|
179
|
+
if (typeof value !== 'string')
|
|
180
|
+
return false;
|
|
181
|
+
const datePatterns = [
|
|
182
|
+
/^\d{4}-\d{2}-\d{2}/,
|
|
183
|
+
/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/,
|
|
184
|
+
/^\d{1,2}\/\d{1,2}\/\d{4}/,
|
|
185
|
+
/^\d{1,2}-\d{1,2}-\d{4}/
|
|
186
|
+
];
|
|
187
|
+
const hasDatePattern = datePatterns.some(pattern => pattern.test(value));
|
|
188
|
+
if (!hasDatePattern)
|
|
189
|
+
return false;
|
|
190
|
+
const parsed = Date.parse(value);
|
|
191
|
+
return !isNaN(parsed);
|
|
192
|
+
}
|
|
193
|
+
function stringifyJsonWithEscapedQuotes(value) {
|
|
194
|
+
const jsonString = JSON.stringify(value);
|
|
195
|
+
return jsonString.replace(/"/g, '\\"');
|
|
196
|
+
}
|
|
197
|
+
function stringifyMappingSchemaForGraphQL(value) {
|
|
198
|
+
let jsonString = JSON.stringify(value);
|
|
199
|
+
jsonString = jsonString.replace(/"type":"([^"]+)"/g, (_, typeValue) => `type:${typeValue.toUpperCase()}`);
|
|
200
|
+
jsonString = jsonString.replace(/"([a-zA-Z_][a-zA-Z0-9_]*)"\s*:/g, '$1:');
|
|
201
|
+
return jsonString;
|
|
202
|
+
}
|
|
203
|
+
const getDefaultFieldsToMap = () => {
|
|
204
|
+
return new Set(constants_1.PROFILE_DEFAULT_FIELDS.map(field => field.key));
|
|
205
|
+
};
|
|
206
|
+
const getDefaultFieldTypes = () => {
|
|
207
|
+
return constants_1.PROFILE_DEFAULT_FIELDS.reduce((acc, field) => {
|
|
208
|
+
acc[field.key] = field.type.toUpperCase();
|
|
209
|
+
return acc;
|
|
210
|
+
}, {});
|
|
211
|
+
};
|
|
212
|
+
//# sourceMappingURL=common-functions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common-functions.js","sourceRoot":"","sources":["../../../src/destinations/stackadapt-audiences/common-functions.ts"],"names":[],"mappings":";;AASA,oBA8FC;AAED,gCAIC;AAuID,wEAKC;AAGD,4EAWC;AArQD,2CAAoG;AAKpG,mCAAmC;AAE5B,KAAK,UAAU,IAAI,CAAC,OAAsB,EAAE,QAA8C,EAAE,QAAkB,EAAE,UAAmB;IAExI,MAAM,UAAU,GAAG,oBAAoB,EAAE,CAAA;IACzC,MAAM,WAAW,GAAG,qBAAqB,EAAE,CAAA;IAC3C,MAAM,YAAY,GAAG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MAAM,CAAC,CAAA;AACvB,CAAC;AAGD,SAAgB,8BAA8B,CAAC,KAAc;IAC3D,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAGzC,OAAO,UAAU,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AACzC,CAAC;AAGD,SAAgB,gCAAgC,CAAC,KAAc;IAC7D,IAAI,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;IAGtC,UAAU,GAAG,UAAU,CAAC,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAAC,EAAE,SAAiB,EAAE,EAAE,CAC5E,QAAQ,SAAS,CAAC,WAAW,EAAE,EAAE,CAAC,CAAA;IAGpC,UAAU,GAAG,UAAU,CAAC,OAAO,CAAC,iCAAiC,EAAE,KAAK,CAAC,CAAC;IAE1E,OAAO,UAAU,CAAA;AACnB,CAAC;AAED,MAAM,qBAAqB,GAAG,GAAgB,EAAE;IAC9C,OAAO,IAAI,GAAG,CAAC,kCAAsB,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAA;AAChE,CAAC,CAAA;AAED,MAAM,oBAAoB,GAAG,GAA2B,EAAE;IACxD,OAAO,kCAAsB,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;QAClD,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,CAAA;QACzC,OAAO,GAAG,CAAA;IACZ,CAAC,EAAE,EAA4B,CAAC,CAAA;AAClC,CAAC,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ProfileFieldConfig } from './types';
|
|
2
|
+
export declare const EXTERNAL_PROVIDER = "segment_io";
|
|
3
|
+
export declare const GQL_ENDPOINT = "https://api.stackadapt.com/graphql";
|
|
4
|
+
export declare const PROFILE_DEFAULT_FIELDS: ProfileFieldConfig[];
|
|
5
|
+
export declare const MAPPING_SCHEMA: {
|
|
6
|
+
incomingKey: string;
|
|
7
|
+
destinationKey: string;
|
|
8
|
+
type: string;
|
|
9
|
+
label: string;
|
|
10
|
+
isPii: boolean;
|
|
11
|
+
}[];
|
|
12
|
+
export declare const MarketingStatus: {
|
|
13
|
+
readonly OPT_IN: "Opted-in";
|
|
14
|
+
readonly Indeterminate: "Indeterminate";
|
|
15
|
+
};
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MarketingStatus = exports.MAPPING_SCHEMA = exports.PROFILE_DEFAULT_FIELDS = exports.GQL_ENDPOINT = exports.EXTERNAL_PROVIDER = void 0;
|
|
4
|
+
exports.EXTERNAL_PROVIDER = 'segment_io';
|
|
5
|
+
exports.GQL_ENDPOINT = 'https://api.stackadapt.com/graphql';
|
|
6
|
+
exports.PROFILE_DEFAULT_FIELDS = [
|
|
7
|
+
{
|
|
8
|
+
key: 'user_id',
|
|
9
|
+
label: 'User ID',
|
|
10
|
+
type: 'string',
|
|
11
|
+
description: 'The unique identifier for the user',
|
|
12
|
+
isPii: false
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
key: 'email',
|
|
16
|
+
label: 'Email',
|
|
17
|
+
type: 'string',
|
|
18
|
+
description: 'The email address of the user',
|
|
19
|
+
isPii: true,
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
key: 'first_name',
|
|
23
|
+
label: 'First Name',
|
|
24
|
+
type: 'string',
|
|
25
|
+
description: "The user's first name",
|
|
26
|
+
isPii: true,
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
key: 'last_name',
|
|
30
|
+
label: 'Last Name',
|
|
31
|
+
type: 'string',
|
|
32
|
+
description: "The user's last name",
|
|
33
|
+
isPii: true,
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
key: 'phone',
|
|
37
|
+
label: 'Phone',
|
|
38
|
+
type: 'string',
|
|
39
|
+
description: 'The phone number of the user',
|
|
40
|
+
isPii: true,
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
key: 'address',
|
|
44
|
+
label: 'Address',
|
|
45
|
+
type: 'string',
|
|
46
|
+
description: 'The address of the user',
|
|
47
|
+
isPii: true,
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
key: 'city',
|
|
51
|
+
label: 'City',
|
|
52
|
+
type: 'string',
|
|
53
|
+
description: 'The city of the user',
|
|
54
|
+
isPii: false,
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
key: 'state',
|
|
58
|
+
label: 'State',
|
|
59
|
+
type: 'string',
|
|
60
|
+
description: 'The state of the user',
|
|
61
|
+
isPii: false,
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
key: 'country',
|
|
65
|
+
label: 'Country',
|
|
66
|
+
type: 'string',
|
|
67
|
+
description: 'The country of the user',
|
|
68
|
+
isPii: false,
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
key: 'postal_code',
|
|
72
|
+
label: 'Postal Code',
|
|
73
|
+
type: 'string',
|
|
74
|
+
description: 'The postal code of the user',
|
|
75
|
+
isPii: false,
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
key: 'timezone',
|
|
79
|
+
label: 'Timezone',
|
|
80
|
+
type: 'string',
|
|
81
|
+
description: 'The timezone of the user',
|
|
82
|
+
isPii: false,
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
key: 'birth_day',
|
|
86
|
+
label: 'Birth Day',
|
|
87
|
+
type: 'number',
|
|
88
|
+
description: 'The birth day of the user (1-31)',
|
|
89
|
+
isPii: false,
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
key: 'birth_month',
|
|
93
|
+
label: 'Birth Month',
|
|
94
|
+
type: 'number',
|
|
95
|
+
description: 'The birth month of the user (1-12)',
|
|
96
|
+
isPii: false,
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
key: 'birth_year',
|
|
100
|
+
label: 'Birth Year',
|
|
101
|
+
type: 'number',
|
|
102
|
+
description: 'The birth year of the user (YYYY)',
|
|
103
|
+
isPii: false,
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
key: 'birth_date',
|
|
107
|
+
label: 'Birth Date',
|
|
108
|
+
type: 'string',
|
|
109
|
+
description: 'The birth date of the user',
|
|
110
|
+
isPii: true,
|
|
111
|
+
}
|
|
112
|
+
];
|
|
113
|
+
exports.MAPPING_SCHEMA = [
|
|
114
|
+
{
|
|
115
|
+
incomingKey: 'audienceId',
|
|
116
|
+
destinationKey: 'external_id',
|
|
117
|
+
type: 'string',
|
|
118
|
+
label: 'External Audience ID',
|
|
119
|
+
isPii: false
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
incomingKey: 'audienceName',
|
|
123
|
+
destinationKey: 'name',
|
|
124
|
+
type: 'string',
|
|
125
|
+
label: 'External Audience Name',
|
|
126
|
+
isPii: false
|
|
127
|
+
}
|
|
128
|
+
];
|
|
129
|
+
exports.MarketingStatus = {
|
|
130
|
+
OPT_IN: 'Opted-in',
|
|
131
|
+
Indeterminate: 'Indeterminate'
|
|
132
|
+
};
|
|
133
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/destinations/stackadapt-audiences/constants.ts"],"names":[],"mappings":";;;AAEa,QAAA,iBAAiB,GAAG,YAAY,CAAA;AAEhC,QAAA,YAAY,GAAG,oCAAoC,CAAA;AAInD,QAAA,sBAAsB,GAAyB;IAC1D;QACE,GAAG,EAAE,SAAS;QACd,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,oCAAoC;QACjD,KAAK,EAAE,KAAK;KACb;IACD;QACE,GAAG,EAAE,OAAO;QACZ,KAAK,EAAE,OAAO;QACd,IAAI,EA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