@activepieces/piece-klaviyo 0.0.1
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/package.json +17 -0
- package/src/index.d.ts +2 -0
- package/src/index.d.ts.map +1 -0
- package/src/index.js +53 -0
- package/src/index.js.map +1 -0
- package/src/lib/actions/add-profile-to-list.d.ts +5 -0
- package/src/lib/actions/add-profile-to-list.d.ts.map +1 -0
- package/src/lib/actions/add-profile-to-list.js +46 -0
- package/src/lib/actions/add-profile-to-list.js.map +1 -0
- package/src/lib/actions/create-list.d.ts +4 -0
- package/src/lib/actions/create-list.d.ts.map +1 -0
- package/src/lib/actions/create-list.js +44 -0
- package/src/lib/actions/create-list.js.map +1 -0
- package/src/lib/actions/create-profile.d.ts +25 -0
- package/src/lib/actions/create-profile.d.ts.map +1 -0
- package/src/lib/actions/create-profile.js +203 -0
- package/src/lib/actions/create-profile.js.map +1 -0
- package/src/lib/actions/find-list-by-name.d.ts +5 -0
- package/src/lib/actions/find-list-by-name.d.ts.map +1 -0
- package/src/lib/actions/find-list-by-name.js +69 -0
- package/src/lib/actions/find-list-by-name.js.map +1 -0
- package/src/lib/actions/find-profile-by-email-phone.d.ts +5 -0
- package/src/lib/actions/find-profile-by-email-phone.d.ts.map +1 -0
- package/src/lib/actions/find-profile-by-email-phone.js +91 -0
- package/src/lib/actions/find-profile-by-email-phone.js.map +1 -0
- package/src/lib/actions/find-tag-by-name.d.ts +4 -0
- package/src/lib/actions/find-tag-by-name.d.ts.map +1 -0
- package/src/lib/actions/find-tag-by-name.js +60 -0
- package/src/lib/actions/find-tag-by-name.js.map +1 -0
- package/src/lib/actions/remove-profile-from-list.d.ts +5 -0
- package/src/lib/actions/remove-profile-from-list.d.ts.map +1 -0
- package/src/lib/actions/remove-profile-from-list.js +46 -0
- package/src/lib/actions/remove-profile-from-list.js.map +1 -0
- package/src/lib/actions/subscribe-profile.d.ts +10 -0
- package/src/lib/actions/subscribe-profile.d.ts.map +1 -0
- package/src/lib/actions/subscribe-profile.js +120 -0
- package/src/lib/actions/subscribe-profile.js.map +1 -0
- package/src/lib/actions/unsubscribe-profile.d.ts +8 -0
- package/src/lib/actions/unsubscribe-profile.d.ts.map +1 -0
- package/src/lib/actions/unsubscribe-profile.js +104 -0
- package/src/lib/actions/unsubscribe-profile.js.map +1 -0
- package/src/lib/actions/update-profile.d.ts +27 -0
- package/src/lib/actions/update-profile.d.ts.map +1 -0
- package/src/lib/actions/update-profile.js +216 -0
- package/src/lib/actions/update-profile.js.map +1 -0
- package/src/lib/common/auth.d.ts +5 -0
- package/src/lib/common/auth.d.ts.map +1 -0
- package/src/lib/common/auth.js +76 -0
- package/src/lib/common/auth.js.map +1 -0
- package/src/lib/common/client.d.ts +6 -0
- package/src/lib/common/client.d.ts.map +1 -0
- package/src/lib/common/client.js +62 -0
- package/src/lib/common/client.js.map +1 -0
- package/src/lib/common/props.d.ts +5 -0
- package/src/lib/common/props.d.ts.map +1 -0
- package/src/lib/common/props.js +100 -0
- package/src/lib/common/props.js.map +1 -0
- package/src/lib/triggers/new-profile.d.ts +3 -0
- package/src/lib/triggers/new-profile.d.ts.map +1 -0
- package/src/lib/triggers/new-profile.js +144 -0
- package/src/lib/triggers/new-profile.js.map +1 -0
- package/src/lib/triggers/profile-added-to-list-segment.d.ts +19 -0
- package/src/lib/triggers/profile-added-to-list-segment.d.ts.map +1 -0
- package/src/lib/triggers/profile-added-to-list-segment.js +232 -0
- package/src/lib/triggers/profile-added-to-list-segment.js.map +1 -0
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.newProfileTrigger = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
+
const dayjs_1 = tslib_1.__importDefault(require("dayjs"));
|
|
8
|
+
const auth_1 = require("../common/auth");
|
|
9
|
+
const client_1 = require("../common/client");
|
|
10
|
+
const polling = {
|
|
11
|
+
strategy: pieces_common_1.DedupeStrategy.TIMEBASED,
|
|
12
|
+
items: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, lastFetchEpochMS }) {
|
|
13
|
+
var _b;
|
|
14
|
+
const since = lastFetchEpochMS
|
|
15
|
+
? new Date(lastFetchEpochMS).toISOString()
|
|
16
|
+
: (0, dayjs_1.default)().subtract(24, 'hours').toISOString();
|
|
17
|
+
const allProfiles = [];
|
|
18
|
+
const queryParams = new URLSearchParams();
|
|
19
|
+
queryParams.append('filter', `greater-than(created,${since})`);
|
|
20
|
+
queryParams.append('page[size]', '100');
|
|
21
|
+
queryParams.append('sort', 'created');
|
|
22
|
+
let response = yield (0, client_1.makeRequest)(auth, pieces_common_1.HttpMethod.GET, `/profiles?${queryParams.toString()}`);
|
|
23
|
+
allProfiles.push(...(response.data || []));
|
|
24
|
+
while (((_b = response.links) === null || _b === void 0 ? void 0 : _b.next) && allProfiles.length < 500) {
|
|
25
|
+
const cursorMatch = response.links.next.match(/page%5Bcursor%5D=([^&]+)/);
|
|
26
|
+
if (!cursorMatch)
|
|
27
|
+
break;
|
|
28
|
+
const cursor = decodeURIComponent(cursorMatch[1]);
|
|
29
|
+
const pageParams = new URLSearchParams();
|
|
30
|
+
pageParams.append('filter', `greater-than(created,${since})`);
|
|
31
|
+
pageParams.append('page[size]', '100');
|
|
32
|
+
pageParams.append('page[cursor]', cursor);
|
|
33
|
+
pageParams.append('sort', 'created');
|
|
34
|
+
response = yield (0, client_1.makeRequest)(auth, pieces_common_1.HttpMethod.GET, `/profiles?${pageParams.toString()}`);
|
|
35
|
+
allProfiles.push(...(response.data || []));
|
|
36
|
+
}
|
|
37
|
+
return allProfiles.map((profile) => {
|
|
38
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
|
39
|
+
const loc = (_a = profile.attributes.location) !== null && _a !== void 0 ? _a : {};
|
|
40
|
+
return {
|
|
41
|
+
epochMilliSeconds: (0, dayjs_1.default)(profile.attributes.created).valueOf(),
|
|
42
|
+
data: {
|
|
43
|
+
id: profile.id,
|
|
44
|
+
email: (_b = profile.attributes.email) !== null && _b !== void 0 ? _b : null,
|
|
45
|
+
phone_number: (_c = profile.attributes.phone_number) !== null && _c !== void 0 ? _c : null,
|
|
46
|
+
external_id: (_d = profile.attributes.external_id) !== null && _d !== void 0 ? _d : null,
|
|
47
|
+
first_name: (_e = profile.attributes.first_name) !== null && _e !== void 0 ? _e : null,
|
|
48
|
+
last_name: (_f = profile.attributes.last_name) !== null && _f !== void 0 ? _f : null,
|
|
49
|
+
full_name: [profile.attributes.first_name, profile.attributes.last_name].filter(Boolean).join(' ') || null,
|
|
50
|
+
organization: (_g = profile.attributes.organization) !== null && _g !== void 0 ? _g : null,
|
|
51
|
+
locale: (_h = profile.attributes.locale) !== null && _h !== void 0 ? _h : null,
|
|
52
|
+
title: (_j = profile.attributes.title) !== null && _j !== void 0 ? _j : null,
|
|
53
|
+
image: (_k = profile.attributes.image) !== null && _k !== void 0 ? _k : null,
|
|
54
|
+
created: profile.attributes.created,
|
|
55
|
+
updated: profile.attributes.updated,
|
|
56
|
+
last_event_date: (_l = profile.attributes.last_event_date) !== null && _l !== void 0 ? _l : null,
|
|
57
|
+
address1: (_m = loc.address1) !== null && _m !== void 0 ? _m : null,
|
|
58
|
+
address2: (_o = loc.address2) !== null && _o !== void 0 ? _o : null,
|
|
59
|
+
city: (_p = loc.city) !== null && _p !== void 0 ? _p : null,
|
|
60
|
+
country: (_q = loc.country) !== null && _q !== void 0 ? _q : null,
|
|
61
|
+
region: (_r = loc.region) !== null && _r !== void 0 ? _r : null,
|
|
62
|
+
zip: (_s = loc.zip) !== null && _s !== void 0 ? _s : null,
|
|
63
|
+
timezone: (_t = loc.timezone) !== null && _t !== void 0 ? _t : null,
|
|
64
|
+
ip: (_u = loc.ip) !== null && _u !== void 0 ? _u : null,
|
|
65
|
+
latitude: (_v = loc.latitude) !== null && _v !== void 0 ? _v : null,
|
|
66
|
+
longitude: (_w = loc.longitude) !== null && _w !== void 0 ? _w : null,
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
});
|
|
70
|
+
}),
|
|
71
|
+
};
|
|
72
|
+
exports.newProfileTrigger = (0, pieces_framework_1.createTrigger)({
|
|
73
|
+
auth: auth_1.klaviyoAuth,
|
|
74
|
+
name: 'newProfile',
|
|
75
|
+
displayName: 'New Profile',
|
|
76
|
+
description: 'Triggers when a new profile is created in Klaviyo.',
|
|
77
|
+
props: {},
|
|
78
|
+
sampleData: {
|
|
79
|
+
id: '01JZTTZ2NNC8ZCP45SM4J84RG2',
|
|
80
|
+
email: 'sarah.mason@klaviyo-demo.com',
|
|
81
|
+
phone_number: '+15005550006',
|
|
82
|
+
external_id: null,
|
|
83
|
+
first_name: 'Sarah',
|
|
84
|
+
last_name: 'Mason',
|
|
85
|
+
full_name: 'Sarah Mason',
|
|
86
|
+
organization: null,
|
|
87
|
+
locale: null,
|
|
88
|
+
title: 'Regional Manager',
|
|
89
|
+
image: null,
|
|
90
|
+
created: '2025-07-10T18:53:32+00:00',
|
|
91
|
+
updated: '2025-07-10T18:53:32+00:00',
|
|
92
|
+
last_event_date: null,
|
|
93
|
+
address1: null,
|
|
94
|
+
address2: null,
|
|
95
|
+
city: null,
|
|
96
|
+
country: null,
|
|
97
|
+
region: null,
|
|
98
|
+
zip: null,
|
|
99
|
+
timezone: null,
|
|
100
|
+
ip: null,
|
|
101
|
+
latitude: null,
|
|
102
|
+
longitude: null,
|
|
103
|
+
},
|
|
104
|
+
type: pieces_framework_1.TriggerStrategy.POLLING,
|
|
105
|
+
test(context) {
|
|
106
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
107
|
+
return yield pieces_common_1.pollingHelper.test(polling, {
|
|
108
|
+
store: context.store,
|
|
109
|
+
auth: context.auth,
|
|
110
|
+
propsValue: context.propsValue,
|
|
111
|
+
files: context.files,
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
},
|
|
115
|
+
onEnable(context) {
|
|
116
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
117
|
+
yield pieces_common_1.pollingHelper.onEnable(polling, {
|
|
118
|
+
store: context.store,
|
|
119
|
+
auth: context.auth,
|
|
120
|
+
propsValue: context.propsValue,
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
},
|
|
124
|
+
onDisable(context) {
|
|
125
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
126
|
+
yield pieces_common_1.pollingHelper.onDisable(polling, {
|
|
127
|
+
store: context.store,
|
|
128
|
+
auth: context.auth,
|
|
129
|
+
propsValue: context.propsValue,
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
},
|
|
133
|
+
run(context) {
|
|
134
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
135
|
+
return yield pieces_common_1.pollingHelper.poll(polling, {
|
|
136
|
+
store: context.store,
|
|
137
|
+
auth: context.auth,
|
|
138
|
+
propsValue: context.propsValue,
|
|
139
|
+
files: context.files,
|
|
140
|
+
});
|
|
141
|
+
});
|
|
142
|
+
},
|
|
143
|
+
});
|
|
144
|
+
//# sourceMappingURL=new-profile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"new-profile.js","sourceRoot":"","sources":["../../../../src/lib/triggers/new-profile.ts"],"names":[],"mappings":";;;;AAAA,qEAGwC;AACxC,+DAKqC;AACrC,0DAA0B;AAC1B,yCAA+D;AAC/D,6CAA+C;AAkC/C,MAAM,OAAO,GAAuD;IAClE,QAAQ,EAAE,8BAAc,CAAC,SAAS;IAClC,KAAK,EAAE,KAAmC,EAAE,oDAA9B,EAAE,IAAI,EAAE,gBAAgB,EAAE;;QACtC,MAAM,KAAK,GAAG,gBAAgB;YAC5B,CAAC,CAAC,I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U;aAC/B,CAAC,CAAC;QACL,CAAC;KAAA;IACK,GAAG,CAAC,OAAO;;YACf,OAAO,MAAM,6BAAa,CAAC,IAAI,CAAC,OAAO,EAAE;gBACvC,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,IAAI,EAAE,OAAO,CAAC,IAAwB;gBACtC,UAAU,EAAE,OAAO,CAAC,UAAU;gBAC9B,KAAK,EAAE,OAAO,CAAC,KAAK;aACrB,CAAC,CAAC;QACL,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
+
export declare const profileAddedToListOrSegmentTrigger: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, (import("@activepieces/pieces-framework").SecretTextProperty<true> | import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>)[], {
|
|
3
|
+
targetType: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
4
|
+
listId: import("@activepieces/pieces-framework").DropdownProperty<unknown, false, (import("@activepieces/pieces-framework").SecretTextProperty<true> | import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>)[]>;
|
|
5
|
+
segmentId: import("@activepieces/pieces-framework").DropdownProperty<unknown, false, (import("@activepieces/pieces-framework").SecretTextProperty<true> | import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>)[]>;
|
|
6
|
+
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, (import("@activepieces/pieces-framework").SecretTextProperty<true> | import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>)[], {
|
|
7
|
+
targetType: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
8
|
+
listId: import("@activepieces/pieces-framework").DropdownProperty<unknown, false, (import("@activepieces/pieces-framework").SecretTextProperty<true> | import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>)[]>;
|
|
9
|
+
segmentId: import("@activepieces/pieces-framework").DropdownProperty<unknown, false, (import("@activepieces/pieces-framework").SecretTextProperty<true> | import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>)[]>;
|
|
10
|
+
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, (import("@activepieces/pieces-framework").SecretTextProperty<true> | import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>)[], {
|
|
11
|
+
targetType: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
12
|
+
listId: import("@activepieces/pieces-framework").DropdownProperty<unknown, false, (import("@activepieces/pieces-framework").SecretTextProperty<true> | import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>)[]>;
|
|
13
|
+
segmentId: import("@activepieces/pieces-framework").DropdownProperty<unknown, false, (import("@activepieces/pieces-framework").SecretTextProperty<true> | import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>)[]>;
|
|
14
|
+
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, (import("@activepieces/pieces-framework").SecretTextProperty<true> | import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>)[], {
|
|
15
|
+
targetType: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
16
|
+
listId: import("@activepieces/pieces-framework").DropdownProperty<unknown, false, (import("@activepieces/pieces-framework").SecretTextProperty<true> | import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>)[]>;
|
|
17
|
+
segmentId: import("@activepieces/pieces-framework").DropdownProperty<unknown, false, (import("@activepieces/pieces-framework").SecretTextProperty<true> | import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>)[]>;
|
|
18
|
+
}>;
|
|
19
|
+
//# sourceMappingURL=profile-added-to-list-segment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile-added-to-list-segment.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/profile-added-to-list-segment.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAGhB,MAAM,gCAAgC,CAAC;AA2MxC,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;EAkE7C,CAAC"}
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.profileAddedToListOrSegmentTrigger = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
+
const dayjs_1 = tslib_1.__importDefault(require("dayjs"));
|
|
8
|
+
const auth_1 = require("../common/auth");
|
|
9
|
+
const client_1 = require("../common/client");
|
|
10
|
+
const props = {
|
|
11
|
+
targetType: pieces_framework_1.Property.StaticDropdown({
|
|
12
|
+
displayName: 'Target Type',
|
|
13
|
+
description: 'Monitor a list or segment for new profile additions.',
|
|
14
|
+
required: true,
|
|
15
|
+
options: {
|
|
16
|
+
options: [
|
|
17
|
+
{ label: 'List', value: 'list' },
|
|
18
|
+
{ label: 'Segment', value: 'segment' },
|
|
19
|
+
],
|
|
20
|
+
},
|
|
21
|
+
}),
|
|
22
|
+
listId: pieces_framework_1.Property.Dropdown({
|
|
23
|
+
displayName: 'List',
|
|
24
|
+
description: 'Select the list to monitor for new profile additions.',
|
|
25
|
+
required: false,
|
|
26
|
+
auth: auth_1.klaviyoAuth,
|
|
27
|
+
refreshers: ['auth', 'targetType'],
|
|
28
|
+
options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, targetType }) {
|
|
29
|
+
if (targetType !== 'list') {
|
|
30
|
+
return { disabled: true, options: [] };
|
|
31
|
+
}
|
|
32
|
+
if (!auth) {
|
|
33
|
+
return { disabled: true, placeholder: 'Connect your account', options: [] };
|
|
34
|
+
}
|
|
35
|
+
try {
|
|
36
|
+
const lists = yield (0, client_1.makeRequest)(auth, pieces_common_1.HttpMethod.GET, '/lists', {});
|
|
37
|
+
return {
|
|
38
|
+
disabled: false,
|
|
39
|
+
options: (lists.data || []).map((list) => ({
|
|
40
|
+
label: list.attributes.name || list.id,
|
|
41
|
+
value: list.id,
|
|
42
|
+
})),
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
catch (_b) {
|
|
46
|
+
return { disabled: true, placeholder: 'Error loading lists', options: [] };
|
|
47
|
+
}
|
|
48
|
+
}),
|
|
49
|
+
}),
|
|
50
|
+
segmentId: pieces_framework_1.Property.Dropdown({
|
|
51
|
+
displayName: 'Segment',
|
|
52
|
+
description: 'Select the segment to monitor for new profile additions.',
|
|
53
|
+
required: false,
|
|
54
|
+
auth: auth_1.klaviyoAuth,
|
|
55
|
+
refreshers: ['auth', 'targetType'],
|
|
56
|
+
options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, targetType }) {
|
|
57
|
+
if (targetType !== 'segment') {
|
|
58
|
+
return { disabled: true, options: [] };
|
|
59
|
+
}
|
|
60
|
+
if (!auth) {
|
|
61
|
+
return { disabled: true, placeholder: 'Connect your account', options: [] };
|
|
62
|
+
}
|
|
63
|
+
try {
|
|
64
|
+
const segments = yield (0, client_1.makeRequest)(auth, pieces_common_1.HttpMethod.GET, '/segments', {});
|
|
65
|
+
return {
|
|
66
|
+
disabled: false,
|
|
67
|
+
options: (segments.data || []).map((segment) => ({
|
|
68
|
+
label: segment.attributes.name || segment.id,
|
|
69
|
+
value: segment.id,
|
|
70
|
+
})),
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
catch (_b) {
|
|
74
|
+
return { disabled: true, placeholder: 'Error loading segments', options: [] };
|
|
75
|
+
}
|
|
76
|
+
}),
|
|
77
|
+
}),
|
|
78
|
+
};
|
|
79
|
+
const polling = {
|
|
80
|
+
strategy: pieces_common_1.DedupeStrategy.TIMEBASED,
|
|
81
|
+
items: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, propsValue, lastFetchEpochMS }) {
|
|
82
|
+
var _b;
|
|
83
|
+
const { targetType, listId, segmentId } = propsValue;
|
|
84
|
+
if (targetType === 'list' && !listId) {
|
|
85
|
+
throw new Error('Please select a list to monitor.');
|
|
86
|
+
}
|
|
87
|
+
if (targetType === 'segment' && !segmentId) {
|
|
88
|
+
throw new Error('Please select a segment to monitor.');
|
|
89
|
+
}
|
|
90
|
+
const targetId = targetType === 'list' ? listId : segmentId;
|
|
91
|
+
const basePath = targetType === 'list'
|
|
92
|
+
? `/lists/${targetId}/profiles`
|
|
93
|
+
: `/segments/${targetId}/profiles`;
|
|
94
|
+
// Use joined_group_at to only fetch profiles added since the last poll
|
|
95
|
+
const since = lastFetchEpochMS
|
|
96
|
+
? new Date(lastFetchEpochMS).toISOString()
|
|
97
|
+
: (0, dayjs_1.default)().subtract(24, 'hours').toISOString();
|
|
98
|
+
const queryParams = new URLSearchParams();
|
|
99
|
+
queryParams.append('filter', `greater-than(joined_group_at,${since})`);
|
|
100
|
+
queryParams.append('page[size]', '100');
|
|
101
|
+
queryParams.append('sort', 'joined_group_at');
|
|
102
|
+
const allProfiles = [];
|
|
103
|
+
let response = yield (0, client_1.makeRequest)(auth, pieces_common_1.HttpMethod.GET, `${basePath}?${queryParams.toString()}`);
|
|
104
|
+
allProfiles.push(...(response.data || []));
|
|
105
|
+
// Paginate through remaining results
|
|
106
|
+
while (((_b = response.links) === null || _b === void 0 ? void 0 : _b.next) && allProfiles.length < 1000) {
|
|
107
|
+
const cursorMatch = response.links.next.match(/page%5Bcursor%5D=([^&]+)/);
|
|
108
|
+
if (!cursorMatch)
|
|
109
|
+
break;
|
|
110
|
+
const cursor = decodeURIComponent(cursorMatch[1]);
|
|
111
|
+
const pageParams = new URLSearchParams();
|
|
112
|
+
pageParams.append('filter', `greater-than(joined_group_at,${since})`);
|
|
113
|
+
pageParams.append('page[size]', '100');
|
|
114
|
+
pageParams.append('page[cursor]', cursor);
|
|
115
|
+
pageParams.append('sort', 'joined_group_at');
|
|
116
|
+
response = yield (0, client_1.makeRequest)(auth, pieces_common_1.HttpMethod.GET, `${basePath}?${pageParams.toString()}`);
|
|
117
|
+
allProfiles.push(...(response.data || []));
|
|
118
|
+
}
|
|
119
|
+
return allProfiles.map((profile) => {
|
|
120
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
|
121
|
+
const loc = (_a = profile.attributes.location) !== null && _a !== void 0 ? _a : {};
|
|
122
|
+
return {
|
|
123
|
+
epochMilliSeconds: (0, dayjs_1.default)((_b = profile.attributes.joined_group_at) !== null && _b !== void 0 ? _b : profile.attributes.created).valueOf(),
|
|
124
|
+
data: {
|
|
125
|
+
id: profile.id,
|
|
126
|
+
email: (_c = profile.attributes.email) !== null && _c !== void 0 ? _c : null,
|
|
127
|
+
phone_number: (_d = profile.attributes.phone_number) !== null && _d !== void 0 ? _d : null,
|
|
128
|
+
external_id: (_e = profile.attributes.external_id) !== null && _e !== void 0 ? _e : null,
|
|
129
|
+
first_name: (_f = profile.attributes.first_name) !== null && _f !== void 0 ? _f : null,
|
|
130
|
+
last_name: (_g = profile.attributes.last_name) !== null && _g !== void 0 ? _g : null,
|
|
131
|
+
full_name: [profile.attributes.first_name, profile.attributes.last_name].filter(Boolean).join(' ') || null,
|
|
132
|
+
organization: (_h = profile.attributes.organization) !== null && _h !== void 0 ? _h : null,
|
|
133
|
+
locale: (_j = profile.attributes.locale) !== null && _j !== void 0 ? _j : null,
|
|
134
|
+
title: (_k = profile.attributes.title) !== null && _k !== void 0 ? _k : null,
|
|
135
|
+
image: (_l = profile.attributes.image) !== null && _l !== void 0 ? _l : null,
|
|
136
|
+
created: profile.attributes.created,
|
|
137
|
+
updated: profile.attributes.updated,
|
|
138
|
+
joined_group_at: (_m = profile.attributes.joined_group_at) !== null && _m !== void 0 ? _m : null,
|
|
139
|
+
last_event_date: (_o = profile.attributes.last_event_date) !== null && _o !== void 0 ? _o : null,
|
|
140
|
+
address1: (_p = loc.address1) !== null && _p !== void 0 ? _p : null,
|
|
141
|
+
address2: (_q = loc.address2) !== null && _q !== void 0 ? _q : null,
|
|
142
|
+
city: (_r = loc.city) !== null && _r !== void 0 ? _r : null,
|
|
143
|
+
country: (_s = loc.country) !== null && _s !== void 0 ? _s : null,
|
|
144
|
+
region: (_t = loc.region) !== null && _t !== void 0 ? _t : null,
|
|
145
|
+
zip: (_u = loc.zip) !== null && _u !== void 0 ? _u : null,
|
|
146
|
+
timezone: (_v = loc.timezone) !== null && _v !== void 0 ? _v : null,
|
|
147
|
+
ip: (_w = loc.ip) !== null && _w !== void 0 ? _w : null,
|
|
148
|
+
latitude: (_x = loc.latitude) !== null && _x !== void 0 ? _x : null,
|
|
149
|
+
longitude: (_y = loc.longitude) !== null && _y !== void 0 ? _y : null,
|
|
150
|
+
target_type: targetType,
|
|
151
|
+
target_id: targetId,
|
|
152
|
+
},
|
|
153
|
+
};
|
|
154
|
+
});
|
|
155
|
+
}),
|
|
156
|
+
};
|
|
157
|
+
exports.profileAddedToListOrSegmentTrigger = (0, pieces_framework_1.createTrigger)({
|
|
158
|
+
auth: auth_1.klaviyoAuth,
|
|
159
|
+
name: 'profile_added_to_list_or_segment',
|
|
160
|
+
displayName: 'Profile Added to List/Segment',
|
|
161
|
+
description: 'Triggers when a profile is added to a specific list or segment.',
|
|
162
|
+
props,
|
|
163
|
+
sampleData: {
|
|
164
|
+
id: '01JZTTZ2NNC8ZCP45SM4J84RG2',
|
|
165
|
+
email: 'sarah.mason@klaviyo-demo.com',
|
|
166
|
+
phone_number: '+15005550006',
|
|
167
|
+
external_id: null,
|
|
168
|
+
first_name: 'Sarah',
|
|
169
|
+
last_name: 'Mason',
|
|
170
|
+
full_name: 'Sarah Mason',
|
|
171
|
+
organization: null,
|
|
172
|
+
locale: null,
|
|
173
|
+
title: 'Regional Manager',
|
|
174
|
+
image: null,
|
|
175
|
+
created: '2025-07-10T18:53:32+00:00',
|
|
176
|
+
updated: '2025-07-10T18:53:32+00:00',
|
|
177
|
+
joined_group_at: '2025-07-16T10:00:00+00:00',
|
|
178
|
+
last_event_date: null,
|
|
179
|
+
address1: null,
|
|
180
|
+
address2: null,
|
|
181
|
+
city: null,
|
|
182
|
+
country: null,
|
|
183
|
+
region: null,
|
|
184
|
+
zip: null,
|
|
185
|
+
timezone: null,
|
|
186
|
+
ip: null,
|
|
187
|
+
latitude: null,
|
|
188
|
+
longitude: null,
|
|
189
|
+
target_type: 'list',
|
|
190
|
+
target_id: 'RB89mt',
|
|
191
|
+
},
|
|
192
|
+
type: pieces_framework_1.TriggerStrategy.POLLING,
|
|
193
|
+
test(context) {
|
|
194
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
195
|
+
return yield pieces_common_1.pollingHelper.test(polling, {
|
|
196
|
+
store: context.store,
|
|
197
|
+
auth: context.auth,
|
|
198
|
+
propsValue: context.propsValue,
|
|
199
|
+
files: context.files,
|
|
200
|
+
});
|
|
201
|
+
});
|
|
202
|
+
},
|
|
203
|
+
onEnable(context) {
|
|
204
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
205
|
+
yield pieces_common_1.pollingHelper.onEnable(polling, {
|
|
206
|
+
store: context.store,
|
|
207
|
+
auth: context.auth,
|
|
208
|
+
propsValue: context.propsValue,
|
|
209
|
+
});
|
|
210
|
+
});
|
|
211
|
+
},
|
|
212
|
+
onDisable(context) {
|
|
213
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
214
|
+
yield pieces_common_1.pollingHelper.onDisable(polling, {
|
|
215
|
+
store: context.store,
|
|
216
|
+
auth: context.auth,
|
|
217
|
+
propsValue: context.propsValue,
|
|
218
|
+
});
|
|
219
|
+
});
|
|
220
|
+
},
|
|
221
|
+
run(context) {
|
|
222
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
223
|
+
return yield pieces_common_1.pollingHelper.poll(polling, {
|
|
224
|
+
store: context.store,
|
|
225
|
+
auth: context.auth,
|
|
226
|
+
propsValue: context.propsValue,
|
|
227
|
+
files: context.files,
|
|
228
|
+
});
|
|
229
|
+
});
|
|
230
|
+
},
|
|
231
|
+
});
|
|
232
|
+
//# sourceMappingURL=profile-added-to-list-segment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile-added-to-list-segment.js","sourceRoot":"","sources":["../../../../src/lib/triggers/profile-added-to-list-segment.ts"],"names":[],"mappings":";;;;AAAA,qEAKwC;AACxC,+DAKqC;AACrC,0DAA0B;AAC1B,yCAA+D;AAC/D,6CAA+C;AAmC/C,MAAM,KAAK,GAAG;IACZ,UAAU,EAAE,2BAAQ,CAAC,cAAc,CAAC;QAClC,WAAW,EAAE,aAAa;QAC1B,WAAW,EAAE,sDAAsD;QACnE,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE;YACP,OAAO,EAAE;gBACP,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;gBAChC,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;aACvC;SACF;KACF,CAAC;IACF,MAAM,EAAE,2BAAQ,CAAC,QAAQ,CAAC;QACxB,WAAW,EAAE,MAAM;QACnB,WAAW,EAAE,uDAAuD;QACpE,QAAQ,EAAE,KAAK;QACf,IAAI,EAAE,kBAAW;QACjB,UAAU,EAAE,CAAC,MAAM,EAAE,YAAY,CAAC;QAClC,OAAO,EAAE,KAA6B,EAAE,oDAAxB,EAAE,IAAI,EAAE,UAAU,EAAE;YAClC,IAAK,UAAgC,KAAK,MAAM,EAAE,CAAC;gBACjD,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,C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