@segment/action-destinations 3.255.0-staging-733d17a → 3.255.0-staging-ce20e588e
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/blackbaud-raisers-edge-nxt/utils/index.d.ts +1 -1
- package/dist/destinations/engage/utils/track.d.ts +17 -17
- package/dist/destinations/klaviyo/functions.d.ts +7 -4
- package/dist/destinations/klaviyo/functions.js +80 -1
- package/dist/destinations/klaviyo/functions.js.map +1 -1
- package/dist/destinations/klaviyo/types.d.ts +97 -0
- package/dist/destinations/klaviyo/upsertProfile/index.js +29 -19
- package/dist/destinations/klaviyo/upsertProfile/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/destinations/braze/updateUserProfile/__snapshots__/snapshot.test.d.ts +0 -1
- package/dist/destinations/braze/updateUserProfile/__snapshots__/snapshot.test.js +0 -184
- package/dist/destinations/braze/updateUserProfile/__snapshots__/snapshot.test.js.map +0 -1
- package/dist/destinations/engage/sendgrid/Profile.d.ts +0 -6
- package/dist/destinations/engage/sendgrid/Profile.js +0 -3
- package/dist/destinations/engage/sendgrid/Profile.js.map +0 -1
- package/dist/destinations/engage/sendgrid/previewApiLookup/api-lookups.d.ts +0 -21
- package/dist/destinations/engage/sendgrid/previewApiLookup/api-lookups.js +0 -174
- package/dist/destinations/engage/sendgrid/previewApiLookup/api-lookups.js.map +0 -1
- package/dist/destinations/klaviyo/removeProfileToList/generated-types.d.ts +0 -4
- package/dist/destinations/klaviyo/removeProfileToList/generated-types.js +0 -3
- package/dist/destinations/klaviyo/removeProfileToList/generated-types.js.map +0 -1
- package/dist/destinations/klaviyo/removeProfileToList/index.d.ts +0 -5
- package/dist/destinations/klaviyo/removeProfileToList/index.js +0 -43
- package/dist/destinations/klaviyo/removeProfileToList/index.js.map +0 -1
- package/dist/destinations/mixpanel/utils.d.ts +0 -13
- package/dist/destinations/mixpanel/utils.js +0 -117
- package/dist/destinations/mixpanel/utils.js.map +0 -1
- package/dist/destinations/movable-ink/categoryView/generated-types.d.ts +0 -22
- package/dist/destinations/movable-ink/categoryView/generated-types.js +0 -3
- package/dist/destinations/movable-ink/categoryView/generated-types.js.map +0 -1
- package/dist/destinations/movable-ink/categoryView/index.d.ts +0 -5
- package/dist/destinations/movable-ink/categoryView/index.js +0 -43
- package/dist/destinations/movable-ink/categoryView/index.js.map +0 -1
- package/dist/destinations/movable-ink/conversion/generated-types.d.ts +0 -20
- package/dist/destinations/movable-ink/conversion/generated-types.js +0 -3
- package/dist/destinations/movable-ink/conversion/generated-types.js.map +0 -1
- package/dist/destinations/movable-ink/conversion/index.d.ts +0 -5
- package/dist/destinations/movable-ink/conversion/index.js +0 -45
- package/dist/destinations/movable-ink/conversion/index.js.map +0 -1
- package/dist/destinations/movable-ink/fields.d.ts +0 -21
- package/dist/destinations/movable-ink/fields.js +0 -236
- package/dist/destinations/movable-ink/fields.js.map +0 -1
- package/dist/destinations/movable-ink/identify/generated-types.d.ts +0 -7
- package/dist/destinations/movable-ink/identify/generated-types.js +0 -3
- package/dist/destinations/movable-ink/identify/generated-types.js.map +0 -1
- package/dist/destinations/movable-ink/identify/index.d.ts +0 -5
- package/dist/destinations/movable-ink/identify/index.js +0 -32
- package/dist/destinations/movable-ink/identify/index.js.map +0 -1
- package/dist/destinations/movable-ink/productAdded/generated-types.d.ts +0 -22
- package/dist/destinations/movable-ink/productAdded/generated-types.js +0 -3
- package/dist/destinations/movable-ink/productAdded/generated-types.js.map +0 -1
- package/dist/destinations/movable-ink/productAdded/index.d.ts +0 -5
- package/dist/destinations/movable-ink/productAdded/index.js +0 -43
- package/dist/destinations/movable-ink/productAdded/index.js.map +0 -1
- package/dist/destinations/movable-ink/productViewed/generated-types.d.ts +0 -21
- package/dist/destinations/movable-ink/productViewed/generated-types.js +0 -3
- package/dist/destinations/movable-ink/productViewed/generated-types.js.map +0 -1
- package/dist/destinations/movable-ink/productViewed/index.d.ts +0 -5
- package/dist/destinations/movable-ink/productViewed/index.js +0 -43
- package/dist/destinations/movable-ink/productViewed/index.js.map +0 -1
- package/dist/destinations/movable-ink/search/generated-types.d.ts +0 -12
- package/dist/destinations/movable-ink/search/generated-types.js +0 -3
- package/dist/destinations/movable-ink/search/generated-types.js.map +0 -1
- package/dist/destinations/movable-ink/search/index.d.ts +0 -5
- package/dist/destinations/movable-ink/search/index.js +0 -43
- package/dist/destinations/movable-ink/search/index.js.map +0 -1
- package/dist/destinations/movable-ink/sendCustomEvent/generated-types.d.ts +0 -25
- package/dist/destinations/movable-ink/sendCustomEvent/generated-types.js +0 -3
- package/dist/destinations/movable-ink/sendCustomEvent/generated-types.js.map +0 -1
- package/dist/destinations/movable-ink/sendCustomEvent/index.d.ts +0 -5
- package/dist/destinations/movable-ink/sendCustomEvent/index.js +0 -48
- package/dist/destinations/movable-ink/sendCustomEvent/index.js.map +0 -1
- package/dist/destinations/trackey/group.types.d.ts +0 -11
- package/dist/destinations/trackey/group.types.js +0 -3
- package/dist/destinations/trackey/group.types.js.map +0 -1
- package/dist/destinations/trackey/identify.types.d.ts +0 -11
- package/dist/destinations/trackey/identify.types.js +0 -3
- package/dist/destinations/trackey/identify.types.js.map +0 -1
- package/dist/destinations/trackey/track.types.d.ts +0 -12
- package/dist/destinations/trackey/track.types.js +0 -3
- package/dist/destinations/trackey/track.types.js.map +0 -1
- package/dist/destinations/yahoo-audiences/createCustomerNode/generated-types.d.ts +0 -4
- package/dist/destinations/yahoo-audiences/createCustomerNode/generated-types.js +0 -3
- package/dist/destinations/yahoo-audiences/createCustomerNode/generated-types.js.map +0 -1
- package/dist/destinations/yahoo-audiences/createCustomerNode/index.d.ts +0 -5
- package/dist/destinations/yahoo-audiences/createCustomerNode/index.js +0 -33
- package/dist/destinations/yahoo-audiences/createCustomerNode/index.js.map +0 -1
- package/dist/destinations/yahoo-audiences/createSegment/generated-types.d.ts +0 -6
- package/dist/destinations/yahoo-audiences/createSegment/generated-types.js +0 -3
- package/dist/destinations/yahoo-audiences/createSegment/generated-types.js.map +0 -1
- package/dist/destinations/yahoo-audiences/createSegment/index.d.ts +0 -5
- package/dist/destinations/yahoo-audiences/createSegment/index.js +0 -45
- package/dist/destinations/yahoo-audiences/createSegment/index.js.map +0 -1
- package/dist/destinations/yahoo-audiences/utils.d.ts +0 -4
- package/dist/destinations/yahoo-audiences/utils.js +0 -30
- package/dist/destinations/yahoo-audiences/utils.js.map +0 -1
|
@@ -9,7 +9,7 @@ export declare const dateStringToFuzzyDate: (dateString: string | number) => fal
|
|
|
9
9
|
y: string;
|
|
10
10
|
};
|
|
11
11
|
export declare const augmentFieldsWithConstituentFields: (fields: Record<string, InputField>) => Record<string, InputField>;
|
|
12
|
-
export declare const splitConstituentPayload: (payload: CreateOrUpdateIndividualConstituentPayload) => (Partial<
|
|
12
|
+
export declare const splitConstituentPayload: (payload: CreateOrUpdateIndividualConstituentPayload) => (Partial<Phone> | Partial<Constituent> | Partial<Address> | Partial<OnlinePresence>)[];
|
|
13
13
|
export declare const buildConstituentPayloadFromPayload: (payload: StringIndexedObject) => Partial<CreateOrUpdateIndividualConstituentPayload>;
|
|
14
14
|
export declare const buildGiftDataFromPayload: (constituentId: string, payload: CreateGiftPayload) => Partial<Gift>;
|
|
15
15
|
export declare const buildConstituentActionDataFromPayload: (constituentId: string, payload: CreateConstituentAction) => Partial<ConstituentAction>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ContextFromDecorator } from './operationTracking';
|
|
2
2
|
export declare const track: ((decoratorArgs?: ({
|
|
3
|
+
shouldStats?: ((args: import("./operationTracking").OperationStatsEventArgs) => boolean | void) | undefined;
|
|
4
|
+
} & {
|
|
3
5
|
onError?: ((ctx: import("./operationTracking").OperationErrorHandlerContext<import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>>) => void) | undefined;
|
|
4
|
-
} &
|
|
6
|
+
} & {
|
|
5
7
|
onTry?: ((ctx: import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>) => void) | undefined;
|
|
6
8
|
onFinally?: ((ctx: import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>) => void) | undefined;
|
|
7
|
-
} & {
|
|
8
|
-
shouldStats?: ((args: import("./operationTracking").OperationStatsEventArgs) => boolean | void) | undefined;
|
|
9
|
-
} & {
|
|
9
|
+
} & import("./operationTracking").OperationLoggerDecoratorArgs & {
|
|
10
10
|
wrapIntegrationError?: ((ctx: import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>) => import("@segment/actions-core/*").IntegrationError | [message: string, code: string, status: number]) | undefined;
|
|
11
11
|
}) | undefined) => import("./operationTracking").GenericMethodDecorator<(this: any, ...args: any[]) => any>) & {
|
|
12
12
|
getCurrentOperation(classInstance: any): (import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any> & {
|
|
@@ -15,8 +15,13 @@ export declare const track: ((decoratorArgs?: ({
|
|
|
15
15
|
}) | undefined;
|
|
16
16
|
} & {
|
|
17
17
|
_contextType: import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any> & {
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
tags: string[];
|
|
19
|
+
sharedContext: {
|
|
20
|
+
tags: string[];
|
|
21
|
+
};
|
|
22
|
+
decoratorArgs?: {
|
|
23
|
+
shouldStats?: ((args: import("./operationTracking").OperationStatsEventArgs) => boolean | void) | undefined;
|
|
24
|
+
} | undefined;
|
|
20
25
|
} & {
|
|
21
26
|
decoratorArgs?: {
|
|
22
27
|
onError?: ((ctx: import("./operationTracking").OperationErrorHandlerContext<import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>>) => void) | undefined;
|
|
@@ -25,10 +30,8 @@ export declare const track: ((decoratorArgs?: ({
|
|
|
25
30
|
parent?: (import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any> & any) | undefined;
|
|
26
31
|
sharedContext: {};
|
|
27
32
|
} & {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
decoratorArgs?: import("./operationTracking").OperationLoggerDecoratorArgs | undefined;
|
|
31
|
-
sharedContext: import("./operationTracking").OperationLoggerSharedContext;
|
|
33
|
+
start?: number | undefined;
|
|
34
|
+
duration?: number | undefined;
|
|
32
35
|
} & {
|
|
33
36
|
onFinally: (() => void)[];
|
|
34
37
|
decoratorArgs?: {
|
|
@@ -36,13 +39,10 @@ export declare const track: ((decoratorArgs?: ({
|
|
|
36
39
|
onFinally?: ((ctx: import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>) => void) | undefined;
|
|
37
40
|
} | undefined;
|
|
38
41
|
} & {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
decoratorArgs?: {
|
|
44
|
-
shouldStats?: ((args: import("./operationTracking").OperationStatsEventArgs) => boolean | void) | undefined;
|
|
45
|
-
} | undefined;
|
|
42
|
+
logs: string[];
|
|
43
|
+
logMetadata?: Record<string, unknown> | undefined;
|
|
44
|
+
decoratorArgs?: import("./operationTracking").OperationLoggerDecoratorArgs | undefined;
|
|
45
|
+
sharedContext: import("./operationTracking").OperationLoggerSharedContext;
|
|
46
46
|
} & {
|
|
47
47
|
decoratorArgs?: {
|
|
48
48
|
wrapIntegrationError?: ((ctx: import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>) => import("@segment/actions-core/*").IntegrationError | [message: string, code: string, status: number]) | undefined;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { RequestClient, DynamicFieldResponse } from '@segment/actions-core';
|
|
2
|
-
import { ImportJobPayload } from './types';
|
|
2
|
+
import { ImportJobPayload, SubProfile, KlaviyoJobStatusResponse, KlaviyoImportJobData } from './types';
|
|
3
3
|
import { Payload } from './upsertProfile/generated-types';
|
|
4
|
+
import { ModifiedResponse } from '@segment/actions-core/*';
|
|
4
5
|
export declare function getListIdDynamicData(request: RequestClient): Promise<DynamicFieldResponse>;
|
|
5
|
-
export declare function addProfileToList(request: RequestClient, id: string, list_id: string | undefined): Promise<
|
|
6
|
-
export declare function removeProfileFromList(request: RequestClient, ids: string[], list_id: string): Promise<
|
|
6
|
+
export declare function addProfileToList(request: RequestClient, id: string, list_id: string | undefined): Promise<ModifiedResponse<unknown>>;
|
|
7
|
+
export declare function removeProfileFromList(request: RequestClient, ids: string[], list_id: string): Promise<ModifiedResponse<unknown>>;
|
|
7
8
|
export declare function createProfile(request: RequestClient, email: string | undefined, external_id: string | undefined): Promise<any>;
|
|
8
9
|
export declare function buildHeaders(authKey: string): {
|
|
9
10
|
Authorization: string;
|
|
@@ -16,5 +17,7 @@ export declare const createImportJobPayload: (profiles: Payload[], listId?: stri
|
|
|
16
17
|
};
|
|
17
18
|
export declare const sendImportJobRequest: (request: RequestClient, importJobPayload: {
|
|
18
19
|
data: ImportJobPayload;
|
|
19
|
-
}) => Promise<
|
|
20
|
+
}) => Promise<ModifiedResponse<KlaviyoImportJobData>>;
|
|
20
21
|
export declare function getProfiles(request: RequestClient, emails: string[] | undefined, external_ids: string[] | undefined): Promise<string[]>;
|
|
22
|
+
export declare function pollKlaviyoJobStatus(request: RequestClient, jobId: string, interval?: number, timeout?: number): Promise<KlaviyoJobStatusResponse>;
|
|
23
|
+
export declare function subscribeProfiles(request: RequestClient, profiles: SubProfile | SubProfile[], customSource?: string): Promise<void>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getProfiles = exports.sendImportJobRequest = exports.createImportJobPayload = exports.buildHeaders = exports.createProfile = exports.removeProfileFromList = exports.addProfileToList = exports.getListIdDynamicData = void 0;
|
|
3
|
+
exports.subscribeProfiles = exports.pollKlaviyoJobStatus = exports.getProfiles = exports.sendImportJobRequest = exports.createImportJobPayload = exports.buildHeaders = exports.createProfile = exports.removeProfileFromList = exports.addProfileToList = exports.getListIdDynamicData = void 0;
|
|
4
4
|
const config_1 = require("./config");
|
|
5
5
|
async function getListIdDynamicData(request) {
|
|
6
6
|
try {
|
|
@@ -143,4 +143,83 @@ async function getProfiles(request, emails, external_ids) {
|
|
|
143
143
|
return Array.from(new Set(profileIds));
|
|
144
144
|
}
|
|
145
145
|
exports.getProfiles = getProfiles;
|
|
146
|
+
async function pollKlaviyoJobStatus(request, jobId, interval = 10000, timeout = 300000) {
|
|
147
|
+
const startTime = Date.now();
|
|
148
|
+
return new Promise((resolve, reject) => {
|
|
149
|
+
const checkStatus = async () => {
|
|
150
|
+
try {
|
|
151
|
+
const response = await request(`${config_1.API_URL}/profile-bulk-import-jobs/${jobId}/`, {
|
|
152
|
+
method: 'GET',
|
|
153
|
+
headers: {
|
|
154
|
+
revision: '2023-10-15.pre'
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
const parsedData = JSON.parse(response.data);
|
|
158
|
+
const jobStatus = parsedData.data.attributes.status;
|
|
159
|
+
if (jobStatus === 'complete') {
|
|
160
|
+
resolve(parsedData);
|
|
161
|
+
}
|
|
162
|
+
else if (Date.now() - startTime > timeout) {
|
|
163
|
+
reject(new Error('Polling timed out'));
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
setTimeout(checkStatusWrapper, interval);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
catch (error) {
|
|
170
|
+
reject(error);
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
const checkStatusWrapper = () => {
|
|
174
|
+
checkStatus().catch(reject);
|
|
175
|
+
};
|
|
176
|
+
checkStatusWrapper();
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
exports.pollKlaviyoJobStatus = pollKlaviyoJobStatus;
|
|
180
|
+
async function subscribeProfiles(request, profiles, customSource = 'Marketing Event') {
|
|
181
|
+
if (!Array.isArray(profiles)) {
|
|
182
|
+
profiles = [profiles];
|
|
183
|
+
}
|
|
184
|
+
const profileSubscriptions = profiles.map((profile) => {
|
|
185
|
+
const profileData = {
|
|
186
|
+
type: 'profile',
|
|
187
|
+
attributes: {}
|
|
188
|
+
};
|
|
189
|
+
if (profile.email) {
|
|
190
|
+
profileData.attributes.email = profile?.email;
|
|
191
|
+
}
|
|
192
|
+
if (profile.phone_number) {
|
|
193
|
+
profileData.attributes.phone_number = profile?.phone_number;
|
|
194
|
+
}
|
|
195
|
+
return profileData;
|
|
196
|
+
});
|
|
197
|
+
const subData = {
|
|
198
|
+
data: {
|
|
199
|
+
type: 'profile-subscription-bulk-create-job',
|
|
200
|
+
attributes: {
|
|
201
|
+
custom_source: customSource,
|
|
202
|
+
profiles: {
|
|
203
|
+
data: profileSubscriptions
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
const listId = profiles[0].list_id;
|
|
209
|
+
if (listId) {
|
|
210
|
+
subData.data.relationships = {
|
|
211
|
+
list: {
|
|
212
|
+
data: {
|
|
213
|
+
type: 'list',
|
|
214
|
+
id: listId
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
await request(`${config_1.API_URL}/profile-subscription-bulk-create-jobs/`, {
|
|
220
|
+
method: 'POST',
|
|
221
|
+
json: subData
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
exports.subscribeProfiles = subscribeProfiles;
|
|
146
225
|
//# sourceMappingURL=functions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"functions.js","sourceRoot":"","sources":["../../../src/destinations/klaviyo/functions.ts"],"names":[],"mappings":";;;AACA,qCAAiD;
|
|
1
|
+
{"version":3,"file":"functions.js","sourceRoot":"","sources":["../../../src/destinations/klaviyo/functions.ts"],"names":[],"mappings":";;;AACA,qCAAiD;AAkB1C,KAAK,UAAU,oBAAoB,CAAC,OAAsB;IAC/D,IAAI;QACF,MAAM,MAAM,GAAmB,MAAM,OAAO,CAAC,GAAG,gBAAO,SAAS,EAAE;YAChE,MAAM,EAAE,KAAK;SACd,CAAC,CAAA;QACF,MAAM,OAAO,GAAG,IAAI,CAAC,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E,sCAAsC;YAC5C,UAAU,EAAE;gBACV,aAAa,EAAE,YAAY;gBAC3B,QAAQ,EAAE;oBACR,IAAI,EAAE,oBAAoB;iBAC3B;aACF;SACF;KACF,CAAA;IAED,MAAM,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,OAAO,CAAA;IAClC,IAAI,MAAM,EAAE;QACV,OAAO,CAAC,IAAI,CAAC,aAAa,GAAG;YAC3B,IAAI,EAAE;gBACJ,IAAI,EAAE;oBACJ,IAAI,EAAE,MAAM;oBACZ,EAAE,EAAE,MAAM;iBACX;aACF;SACF,CAAA;KACF;IAED,MAAM,OAAO,CAAC,GAAG,gBAAO,yCAAyC,EAAE;QACjE,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,OAAO;KACd,CAAC,CAAA;AACJ,CAAC;AAtDD,8CAsDC"}
|
|
@@ -99,6 +99,7 @@ export interface ProfileAttributes {
|
|
|
99
99
|
location?: Location | null;
|
|
100
100
|
properties?: Record<string, any>;
|
|
101
101
|
list_id?: string;
|
|
102
|
+
subscriptions?: Record<string, any>;
|
|
102
103
|
}
|
|
103
104
|
export interface ImportJobPayload {
|
|
104
105
|
type: string;
|
|
@@ -126,3 +127,99 @@ export interface Profile {
|
|
|
126
127
|
export interface GetProfileResponse {
|
|
127
128
|
data: Profile[];
|
|
128
129
|
}
|
|
130
|
+
export interface SubProfilePayload {
|
|
131
|
+
type: string;
|
|
132
|
+
attributes: {
|
|
133
|
+
email?: string;
|
|
134
|
+
phone_number?: string;
|
|
135
|
+
subscriptions?: {
|
|
136
|
+
email?: {};
|
|
137
|
+
sms?: {};
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
export interface SubscriptionData {
|
|
142
|
+
data: {
|
|
143
|
+
type: string;
|
|
144
|
+
attributes: {
|
|
145
|
+
custom_source: string;
|
|
146
|
+
profiles: {
|
|
147
|
+
data: Array<SubProfilePayload>;
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
relationships?: {
|
|
151
|
+
list: {
|
|
152
|
+
data: {
|
|
153
|
+
type: 'list';
|
|
154
|
+
id: string;
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
};
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
export interface SubProfile {
|
|
161
|
+
email?: string;
|
|
162
|
+
phone_number?: string;
|
|
163
|
+
list_id: string;
|
|
164
|
+
}
|
|
165
|
+
export interface KlaviyoJobStatusResponse {
|
|
166
|
+
data: {
|
|
167
|
+
type: string;
|
|
168
|
+
id: string;
|
|
169
|
+
attributes: {
|
|
170
|
+
status: string;
|
|
171
|
+
created_at: string;
|
|
172
|
+
total_count: number;
|
|
173
|
+
completed_count: number;
|
|
174
|
+
failed_count: number;
|
|
175
|
+
completed_at: string | null;
|
|
176
|
+
started_at: string | null;
|
|
177
|
+
};
|
|
178
|
+
relationships: {};
|
|
179
|
+
links: {
|
|
180
|
+
self: string;
|
|
181
|
+
};
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
export interface KlaviyoImportJobData {
|
|
185
|
+
data: {
|
|
186
|
+
type: string;
|
|
187
|
+
id: string;
|
|
188
|
+
attributes: {
|
|
189
|
+
status: string;
|
|
190
|
+
created_at: string;
|
|
191
|
+
total_count: number;
|
|
192
|
+
completed_count: number;
|
|
193
|
+
failed_count: number;
|
|
194
|
+
completed_at: string | null;
|
|
195
|
+
expires_at: string;
|
|
196
|
+
started_at: string | null;
|
|
197
|
+
};
|
|
198
|
+
relationships: {
|
|
199
|
+
lists: {
|
|
200
|
+
data: Array<{
|
|
201
|
+
type: string;
|
|
202
|
+
id: string;
|
|
203
|
+
}>;
|
|
204
|
+
links: {
|
|
205
|
+
self: string;
|
|
206
|
+
related: string;
|
|
207
|
+
};
|
|
208
|
+
};
|
|
209
|
+
profiles: {
|
|
210
|
+
links: {
|
|
211
|
+
self: string;
|
|
212
|
+
related: string;
|
|
213
|
+
};
|
|
214
|
+
};
|
|
215
|
+
import_errors: {
|
|
216
|
+
links: {
|
|
217
|
+
related: string;
|
|
218
|
+
};
|
|
219
|
+
};
|
|
220
|
+
};
|
|
221
|
+
links: {
|
|
222
|
+
self: string;
|
|
223
|
+
};
|
|
224
|
+
};
|
|
225
|
+
}
|
|
@@ -159,9 +159,12 @@ const action = {
|
|
|
159
159
|
json: profileData
|
|
160
160
|
});
|
|
161
161
|
if (list_id) {
|
|
162
|
-
const
|
|
163
|
-
|
|
164
|
-
|
|
162
|
+
const subscriptionProfile = {
|
|
163
|
+
email: profileData.data.attributes.email,
|
|
164
|
+
phone_number: profileData.data.attributes.phone_number,
|
|
165
|
+
list_id
|
|
166
|
+
};
|
|
167
|
+
await functions_1.subscribeProfiles(request, subscriptionProfile);
|
|
165
168
|
}
|
|
166
169
|
return profile;
|
|
167
170
|
}
|
|
@@ -177,7 +180,12 @@ const action = {
|
|
|
177
180
|
json: profileData
|
|
178
181
|
});
|
|
179
182
|
if (list_id) {
|
|
180
|
-
|
|
183
|
+
const subscriptionProfile = {
|
|
184
|
+
email: profileData.data.attributes.email,
|
|
185
|
+
phone_number: profileData.data.attributes.phone_number,
|
|
186
|
+
list_id
|
|
187
|
+
};
|
|
188
|
+
await functions_1.subscribeProfiles(request, subscriptionProfile);
|
|
181
189
|
}
|
|
182
190
|
return profile;
|
|
183
191
|
}
|
|
@@ -187,23 +195,25 @@ const action = {
|
|
|
187
195
|
},
|
|
188
196
|
performBatch: async (request, { payload }) => {
|
|
189
197
|
payload = payload.filter((profile) => profile.email || profile.external_id || profile.phone_number);
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
let importResponseWithList;
|
|
193
|
-
let importResponseWithoutList;
|
|
194
|
-
if (profilesWithList.length > 0) {
|
|
195
|
-
const listId = profilesWithList[0].list_id;
|
|
196
|
-
const importJobPayload = functions_1.createImportJobPayload(profilesWithList, listId);
|
|
197
|
-
importResponseWithList = await functions_1.sendImportJobRequest(request, importJobPayload);
|
|
198
|
+
if (payload.length === 0) {
|
|
199
|
+
throw new actions_core_1.PayloadValidationError('One of External ID, Phone Number and Email is required.');
|
|
198
200
|
}
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
201
|
+
const profilesForImport = payload.map(({ list_id, ...profile }) => profile);
|
|
202
|
+
const importJobResponse = await functions_1.sendImportJobRequest(request, functions_1.createImportJobPayload(profilesForImport));
|
|
203
|
+
const parsedData = JSON.parse(importJobResponse.data);
|
|
204
|
+
const jobId = parsedData.data.id;
|
|
205
|
+
if (jobId) {
|
|
206
|
+
const jobStatusResponse = await functions_1.pollKlaviyoJobStatus(request, jobId);
|
|
207
|
+
if (jobStatusResponse.data.attributes.status !== 'complete') {
|
|
208
|
+
throw new actions_core_1.APIError('Import job did not complete successfully.', 401);
|
|
209
|
+
}
|
|
210
|
+
const profilesWithListId = payload.filter((profile) => !!profile.list_id);
|
|
211
|
+
for (let i = 0; i < profilesWithListId.length; i += 100) {
|
|
212
|
+
const batch = profilesWithListId.slice(i, i + 100);
|
|
213
|
+
await functions_1.subscribeProfiles(request, batch);
|
|
214
|
+
}
|
|
202
215
|
}
|
|
203
|
-
return
|
|
204
|
-
withList: importResponseWithList,
|
|
205
|
-
withoutList: importResponseWithoutList
|
|
206
|
-
};
|
|
216
|
+
return importJobResponse;
|
|
207
217
|
}
|
|
208
218
|
};
|
|
209
219
|
exports.default = action;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/klaviyo/upsertProfile/index.ts"],"names":[],"mappings":";;AAIA,sCAAmC;AACnC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/klaviyo/upsertProfile/index.ts"],"names":[],"mappings":";;AAIA,sCAAmC;AACnC,wDAAwE;AAExE,4CAMqB;AACrB,8CAA0C;AAE1C,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,gBAAgB;IACvB,WAAW,EAAE,sBAAsB;IACnC,mBAAmB,EAAE,mBAAmB;IACxC,MAAM,EA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
|
1
1
|
{
|
|
2
2
|
"name": "@segment/action-destinations",
|
|
3
3
|
"description": "Destination Actions engine and definitions.",
|
|
4
|
-
"version": "3.255.0-staging-
|
|
4
|
+
"version": "3.255.0-staging-ce20e588e",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/segmentio/action-destinations",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@bufbuild/protobuf": "^1.4.2",
|
|
44
44
|
"@bufbuild/protoc-gen-es": "^1.4.2",
|
|
45
45
|
"@segment/a1-notation": "^2.1.4",
|
|
46
|
-
"@segment/actions-core": "
|
|
46
|
+
"@segment/actions-core": "3.103.0-staging-adaa12794",
|
|
47
47
|
"@segment/actions-shared": "^1.84.0",
|
|
48
48
|
"@types/node": "^18.11.15",
|
|
49
49
|
"ajv-formats": "^2.1.1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,184 +0,0 @@
|
|
|
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 test_data_1 = require("../../../../lib/test-data");
|
|
8
|
-
const index_1 = __importDefault(require("../../index"));
|
|
9
|
-
const nock_1 = __importDefault(require("nock"));
|
|
10
|
-
const testDestination = actions_core_1.createTestIntegration(index_1.default);
|
|
11
|
-
const actionSlug = 'updateUserProfile';
|
|
12
|
-
const destinationSlug = 'Braze';
|
|
13
|
-
const seedName = `${destinationSlug}#${actionSlug}`;
|
|
14
|
-
const receivedAt = '2021-08-03T17:40:04.055Z';
|
|
15
|
-
const settings = {
|
|
16
|
-
app_id: 'my-app-id',
|
|
17
|
-
api_key: 'my-api-key',
|
|
18
|
-
endpoint: 'https://rest.iad-01.braze.com'
|
|
19
|
-
};
|
|
20
|
-
describe(`Testing snapshot for ${destinationSlug}'s ${actionSlug} destination action:`, () => {
|
|
21
|
-
it('required fields', async () => {
|
|
22
|
-
const action = index_1.default.actions[actionSlug];
|
|
23
|
-
const [eventData, settingsData] = test_data_1.generateTestData(seedName, index_1.default, action, true);
|
|
24
|
-
nock_1.default(/.*/).persist().get(/.*/).reply(200);
|
|
25
|
-
nock_1.default(/.*/).persist().post(/.*/).reply(200);
|
|
26
|
-
nock_1.default(/.*/).persist().put(/.*/).reply(200);
|
|
27
|
-
const event = actions_core_1.createTestEvent({
|
|
28
|
-
properties: eventData
|
|
29
|
-
});
|
|
30
|
-
const responses = await testDestination.testAction(actionSlug, {
|
|
31
|
-
event: event,
|
|
32
|
-
mapping: event.properties,
|
|
33
|
-
settings: settingsData,
|
|
34
|
-
auth: undefined
|
|
35
|
-
});
|
|
36
|
-
const request = responses[0].request;
|
|
37
|
-
const rawBody = await request.text();
|
|
38
|
-
try {
|
|
39
|
-
const json = JSON.parse(rawBody);
|
|
40
|
-
expect(json).toMatchSnapshot();
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
catch (err) {
|
|
44
|
-
expect(rawBody).toMatchSnapshot();
|
|
45
|
-
}
|
|
46
|
-
expect(request.headers).toMatchSnapshot();
|
|
47
|
-
});
|
|
48
|
-
it('all fields', async () => {
|
|
49
|
-
const action = index_1.default.actions[actionSlug];
|
|
50
|
-
const [eventData, settingsData] = test_data_1.generateTestData(seedName, index_1.default, action, false);
|
|
51
|
-
nock_1.default(/.*/).persist().get(/.*/).reply(200);
|
|
52
|
-
nock_1.default(/.*/).persist().post(/.*/).reply(200);
|
|
53
|
-
nock_1.default(/.*/).persist().put(/.*/).reply(200);
|
|
54
|
-
const event = actions_core_1.createTestEvent({
|
|
55
|
-
properties: eventData
|
|
56
|
-
});
|
|
57
|
-
const responses = await testDestination.testAction(actionSlug, {
|
|
58
|
-
event: event,
|
|
59
|
-
mapping: event.properties,
|
|
60
|
-
settings: settingsData,
|
|
61
|
-
auth: undefined
|
|
62
|
-
});
|
|
63
|
-
const request = responses[0].request;
|
|
64
|
-
const rawBody = await request.text();
|
|
65
|
-
try {
|
|
66
|
-
const json = JSON.parse(rawBody);
|
|
67
|
-
expect(json).toMatchSnapshot();
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
catch (err) {
|
|
71
|
-
expect(rawBody).toMatchSnapshot();
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
it('it should work with batched events', async () => {
|
|
75
|
-
nock_1.default('https://rest.iad-01.braze.com').post('/users/track').reply(200, {});
|
|
76
|
-
const events = [
|
|
77
|
-
actions_core_1.createTestEvent({
|
|
78
|
-
event: 'Test Event 1',
|
|
79
|
-
type: 'track',
|
|
80
|
-
receivedAt,
|
|
81
|
-
properties: {}
|
|
82
|
-
}),
|
|
83
|
-
actions_core_1.createTestEvent({
|
|
84
|
-
event: 'Test Event 2',
|
|
85
|
-
type: 'track',
|
|
86
|
-
receivedAt,
|
|
87
|
-
properties: {}
|
|
88
|
-
})
|
|
89
|
-
];
|
|
90
|
-
const responses = await testDestination.testBatchAction(actionSlug, {
|
|
91
|
-
events,
|
|
92
|
-
useDefaultMappings: true,
|
|
93
|
-
mapping: {
|
|
94
|
-
external_id: {
|
|
95
|
-
'@path': '$.userId'
|
|
96
|
-
},
|
|
97
|
-
user_alias: {},
|
|
98
|
-
braze_id: {
|
|
99
|
-
'@path': '$.properties.braze_id'
|
|
100
|
-
},
|
|
101
|
-
name: {
|
|
102
|
-
'@path': '$.event'
|
|
103
|
-
},
|
|
104
|
-
time: {
|
|
105
|
-
'@path': '$.receivedAt'
|
|
106
|
-
},
|
|
107
|
-
properties: {
|
|
108
|
-
'@path': '$.properties'
|
|
109
|
-
},
|
|
110
|
-
products: {
|
|
111
|
-
'@path': '$.properties.products'
|
|
112
|
-
},
|
|
113
|
-
enable_batching: true,
|
|
114
|
-
_update_existing_only: true
|
|
115
|
-
},
|
|
116
|
-
settings: {
|
|
117
|
-
...settings
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
expect(responses.length).toBe(1);
|
|
121
|
-
expect(responses[0].status).toBe(200);
|
|
122
|
-
expect(responses[0].options.headers).toMatchSnapshot();
|
|
123
|
-
expect(responses[0].options.json).toMatchSnapshot();
|
|
124
|
-
});
|
|
125
|
-
it('it should work with a single batched events', async () => {
|
|
126
|
-
nock_1.default('https://rest.iad-01.braze.com').post('/users/track').reply(200, {});
|
|
127
|
-
const events = [
|
|
128
|
-
actions_core_1.createTestEvent({
|
|
129
|
-
event: 'Test Event 1',
|
|
130
|
-
type: 'track',
|
|
131
|
-
receivedAt,
|
|
132
|
-
properties: {
|
|
133
|
-
products: [
|
|
134
|
-
{
|
|
135
|
-
quantity: 1,
|
|
136
|
-
product_id: 'Bowflex Treadmill 10',
|
|
137
|
-
price: 100
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
quantity: 2,
|
|
141
|
-
product_id: 'Bowflex Treadmill 20',
|
|
142
|
-
price: 200
|
|
143
|
-
}
|
|
144
|
-
]
|
|
145
|
-
}
|
|
146
|
-
})
|
|
147
|
-
];
|
|
148
|
-
const responses = await testDestination.testBatchAction(actionSlug, {
|
|
149
|
-
events,
|
|
150
|
-
useDefaultMappings: true,
|
|
151
|
-
mapping: {
|
|
152
|
-
external_id: {
|
|
153
|
-
'@path': '$.userId'
|
|
154
|
-
},
|
|
155
|
-
user_alias: {},
|
|
156
|
-
braze_id: {
|
|
157
|
-
'@path': '$.properties.braze_id'
|
|
158
|
-
},
|
|
159
|
-
name: {
|
|
160
|
-
'@path': '$.event'
|
|
161
|
-
},
|
|
162
|
-
time: {
|
|
163
|
-
'@path': '$.receivedAt'
|
|
164
|
-
},
|
|
165
|
-
properties: {
|
|
166
|
-
'@path': '$.properties'
|
|
167
|
-
},
|
|
168
|
-
products: {
|
|
169
|
-
'@path': '$.properties.products'
|
|
170
|
-
},
|
|
171
|
-
enable_batching: true,
|
|
172
|
-
_update_existing_only: true
|
|
173
|
-
},
|
|
174
|
-
settings: {
|
|
175
|
-
...settings
|
|
176
|
-
}
|
|
177
|
-
});
|
|
178
|
-
expect(responses.length).toBe(1);
|
|
179
|
-
expect(responses[0].status).toBe(200);
|
|
180
|
-
expect(responses[0].options.headers).toMatchSnapshot();
|
|
181
|
-
expect(responses[0].options.json).toMatchSnapshot();
|
|
182
|
-
});
|
|
183
|
-
});
|
|
184
|
-
//# sourceMappingURL=snapshot.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"snapshot.test.js","sourceRoot":"","sources":["../../../../../src/destinations/braze/updateUserProfile/__snapshots__/snapshot.test.ts"],"names":[],"mappings":";;;;;AAAA,wDAA4F;AAC5F,yDAA4D;AAC5D,wDAAqC;AACrC,gDAAuB;AAEvB,MAAM,eAAe,GAAG,oCAAqB,CAAC,eAAW,CAAC,CAAA;AAC1D,MAAM,UAAU,GAAG,mBAAmB,CAAA;AACtC,MAAM,eAAe,GAAG,OAAO,CAAA;AAC/B,MAAM,QAAQ,GAAG,GAAG,eAAe,IAAI,UAAU,EAAE,CAAA;AACnD,MAAM,UAAU,GAAG,0BAA0B,CAAA;AAC7C,MAAM,QAAQ,GAAG;IACf,MAAM,EAAE,WAAW;IACnB,OAAO,EAAE,YAAY;IACrB,QAAQ,EAAE,+BAAwC;CACnD,CAAA;AAED,QAAQ,CAAC,wBAAwB,eAAe,MAAM,UAAU,sBAAsB,EAAE,GAAG,EAAE;IAC3F,EAAE,CAAC,iBAAiB,EAAE,KAAK,IAAI,EAAE;QAC/B,MAAM,MAAM,GAAG,eAAW,CAAC,OAAO,CAAC,UAAU,CAAC,CAAA;QAC9C,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,4BAAgB,CAAC,QAAQ,EAAE,eAAW,EAAE,MAAM,EAAE,IAAI,CAAC,CAAA;QAEvF,cAAI,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CA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