@activepieces/piece-klaviyo 0.1.2 → 0.1.3
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 +7 -13
- package/src/index.js +31 -53
- package/src/index.d.ts +0 -2
- package/src/index.d.ts.map +0 -1
- package/src/index.js.map +0 -1
- package/src/lib/actions/add-profile-to-list.d.ts +0 -5
- package/src/lib/actions/add-profile-to-list.d.ts.map +0 -1
- package/src/lib/actions/add-profile-to-list.js +0 -49
- package/src/lib/actions/add-profile-to-list.js.map +0 -1
- package/src/lib/actions/create-list.d.ts +0 -4
- package/src/lib/actions/create-list.d.ts.map +0 -1
- package/src/lib/actions/create-list.js +0 -49
- package/src/lib/actions/create-list.js.map +0 -1
- package/src/lib/actions/create-profile.d.ts +0 -25
- package/src/lib/actions/create-profile.d.ts.map +0 -1
- package/src/lib/actions/create-profile.js +0 -208
- package/src/lib/actions/create-profile.js.map +0 -1
- package/src/lib/actions/find-list-by-name.d.ts +0 -5
- package/src/lib/actions/find-list-by-name.d.ts.map +0 -1
- package/src/lib/actions/find-list-by-name.js +0 -74
- package/src/lib/actions/find-list-by-name.js.map +0 -1
- package/src/lib/actions/find-profile-by-email-phone.d.ts +0 -5
- package/src/lib/actions/find-profile-by-email-phone.d.ts.map +0 -1
- package/src/lib/actions/find-profile-by-email-phone.js +0 -96
- package/src/lib/actions/find-profile-by-email-phone.js.map +0 -1
- package/src/lib/actions/find-tag-by-name.d.ts +0 -4
- package/src/lib/actions/find-tag-by-name.d.ts.map +0 -1
- package/src/lib/actions/find-tag-by-name.js +0 -65
- package/src/lib/actions/find-tag-by-name.js.map +0 -1
- package/src/lib/actions/remove-profile-from-list.d.ts +0 -5
- package/src/lib/actions/remove-profile-from-list.d.ts.map +0 -1
- package/src/lib/actions/remove-profile-from-list.js +0 -52
- package/src/lib/actions/remove-profile-from-list.js.map +0 -1
- package/src/lib/actions/subscribe-profile.d.ts +0 -10
- package/src/lib/actions/subscribe-profile.d.ts.map +0 -1
- package/src/lib/actions/subscribe-profile.js +0 -126
- package/src/lib/actions/subscribe-profile.js.map +0 -1
- package/src/lib/actions/unsubscribe-profile.d.ts +0 -8
- package/src/lib/actions/unsubscribe-profile.d.ts.map +0 -1
- package/src/lib/actions/unsubscribe-profile.js +0 -110
- package/src/lib/actions/unsubscribe-profile.js.map +0 -1
- package/src/lib/actions/update-profile.d.ts +0 -27
- package/src/lib/actions/update-profile.d.ts.map +0 -1
- package/src/lib/actions/update-profile.js +0 -221
- package/src/lib/actions/update-profile.js.map +0 -1
- package/src/lib/common/auth.d.ts +0 -5
- package/src/lib/common/auth.d.ts.map +0 -1
- package/src/lib/common/auth.js +0 -76
- package/src/lib/common/auth.js.map +0 -1
- package/src/lib/common/client.d.ts +0 -7
- package/src/lib/common/client.d.ts.map +0 -1
- package/src/lib/common/client.js +0 -82
- package/src/lib/common/client.js.map +0 -1
- package/src/lib/common/props.d.ts +0 -6
- package/src/lib/common/props.d.ts.map +0 -1
- package/src/lib/common/props.js +0 -129
- package/src/lib/common/props.js.map +0 -1
- package/src/lib/triggers/new-profile.d.ts +0 -3
- package/src/lib/triggers/new-profile.d.ts.map +0 -1
- package/src/lib/triggers/new-profile.js +0 -147
- package/src/lib/triggers/new-profile.js.map +0 -1
- package/src/lib/triggers/profile-added-to-list-segment.d.ts +0 -19
- package/src/lib/triggers/profile-added-to-list-segment.d.ts.map +0 -1
- package/src/lib/triggers/profile-added-to-list-segment.js +0 -235
- package/src/lib/triggers/profile-added-to-list-segment.js.map +0 -1
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createList = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const auth_1 = require("../common/auth");
|
|
7
|
-
const client_1 = require("../common/client");
|
|
8
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
9
|
-
exports.createList = (0, pieces_framework_1.createAction)({
|
|
10
|
-
auth: auth_1.klaviyoAuth,
|
|
11
|
-
name: 'createList',
|
|
12
|
-
displayName: 'Create List',
|
|
13
|
-
description: 'Create a new subscriber list.',
|
|
14
|
-
audience: 'both',
|
|
15
|
-
aiMetadata: {
|
|
16
|
-
description: 'Creates a new, empty subscriber list in Klaviyo with the given name. Use when you need a fresh list to group profiles into; to find an existing list use Find List by Name. Requires a non-empty name; not idempotent, so each call creates another list even if the name matches an existing one.',
|
|
17
|
-
idempotent: false,
|
|
18
|
-
},
|
|
19
|
-
props: {
|
|
20
|
-
name: pieces_framework_1.Property.ShortText({
|
|
21
|
-
displayName: 'List Name',
|
|
22
|
-
description: 'Name for the new list',
|
|
23
|
-
required: true,
|
|
24
|
-
}),
|
|
25
|
-
},
|
|
26
|
-
run(_a) {
|
|
27
|
-
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
|
|
28
|
-
const { name } = propsValue;
|
|
29
|
-
if (!name || name.trim().length === 0) {
|
|
30
|
-
throw new Error('List name cannot be empty');
|
|
31
|
-
}
|
|
32
|
-
const data = {
|
|
33
|
-
data: {
|
|
34
|
-
type: 'list',
|
|
35
|
-
attributes: {
|
|
36
|
-
name: name.trim(),
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
};
|
|
40
|
-
const response = yield (0, client_1.makeRequest)(auth, pieces_common_1.HttpMethod.POST, '/lists', data);
|
|
41
|
-
return {
|
|
42
|
-
success: true,
|
|
43
|
-
message: `List "${name}" created successfully`,
|
|
44
|
-
list: response.data,
|
|
45
|
-
};
|
|
46
|
-
});
|
|
47
|
-
},
|
|
48
|
-
});
|
|
49
|
-
//# sourceMappingURL=create-list.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-list.js","sourceRoot":"","sources":["../../../../src/lib/actions/create-list.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,yCAA+D;AAC/D,6CAA+C;AAC/C,+DAAyD;AAE5C,QAAA,UAAU,GAAG,IAAA,+BAAY,EAAC;IACrC,IAAI,EAAE,kBAAW;IACjB,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE,aAAa;IAC1B,WAAW,EAAE,+BAA+B;IAC5C,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EAAE,oSAAoS;QACjT,UAAU,EAAE,KAAK;KAClB;IACD,KAAK,EAAE;QACL,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACvB,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,uBAAuB;YACpC,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;YAC5B,MAAM,EAAE,IAAI,EAAE,GAAG,UAAU,CAAC;YAE5B,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACtC,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;YAC/C,CAAC;YAED,MAAM,IAAI,GAAG;gBACX,IAAI,EAAE;oBACJ,IAAI,EAAE,MAAM;oBACZ,UAAU,EAAE;wBACV,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE;qBAClB;iBACF;aACF,CAAC;YAEF,MAAM,QAAQ,GAAG,MAAM,IAAA,oBAAW,EAChC,IAAwB,EACxB,0BAAU,CAAC,IAAI,EACf,QAAQ,EACR,IAAI,CACL,CAAC;YAEF,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,OAAO,EAAE,SAAS,IAAI,wBAAwB;gBAC9C,IAAI,EAAE,QAAQ,CAAC,IAAI;aACpB,CAAC;QACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export declare const createProfile: import("@activepieces/pieces-framework").IAction<(import("@activepieces/pieces-framework").SecretTextProperty<true> | import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>)[], {
|
|
2
|
-
email: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
3
|
-
phone_number: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
4
|
-
external_id: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
5
|
-
first_name: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
6
|
-
last_name: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
7
|
-
organization: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
8
|
-
locale: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
9
|
-
title: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
10
|
-
image: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
11
|
-
address1: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
12
|
-
address2: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
13
|
-
city: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
14
|
-
country: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
15
|
-
region: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
16
|
-
zip: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
17
|
-
timezone: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
18
|
-
ip: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
19
|
-
latitude: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
20
|
-
longitude: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
21
|
-
custom_properties: import("@activepieces/pieces-framework").ObjectProperty<false>;
|
|
22
|
-
include_subscriptions: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
23
|
-
include_predictive_analytics: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
24
|
-
}>;
|
|
25
|
-
//# sourceMappingURL=create-profile.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-profile.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/create-profile.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;EAiOxB,CAAC"}
|
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createProfile = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const auth_1 = require("../common/auth");
|
|
7
|
-
const client_1 = require("../common/client");
|
|
8
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
9
|
-
exports.createProfile = (0, pieces_framework_1.createAction)({
|
|
10
|
-
auth: auth_1.klaviyoAuth,
|
|
11
|
-
name: 'createProfile',
|
|
12
|
-
displayName: 'Create Profile',
|
|
13
|
-
description: 'Add new user profile with email/SMS subscription options',
|
|
14
|
-
audience: 'both',
|
|
15
|
-
aiMetadata: {
|
|
16
|
-
description: 'Creates a new profile (contact) in Klaviyo with identity, location, and custom-property attributes. Use when adding a person who is not yet in Klaviyo; to modify someone who already exists use Update Profile. Requires at least one identifier (email, phone number, or external ID); not idempotent, so each call creates a profile.',
|
|
17
|
-
idempotent: false,
|
|
18
|
-
},
|
|
19
|
-
props: {
|
|
20
|
-
email: pieces_framework_1.Property.ShortText({
|
|
21
|
-
displayName: 'Email',
|
|
22
|
-
description: 'Email address (recommended identifier)',
|
|
23
|
-
required: false,
|
|
24
|
-
}),
|
|
25
|
-
phone_number: pieces_framework_1.Property.ShortText({
|
|
26
|
-
displayName: 'Phone Number',
|
|
27
|
-
description: 'Phone number in E.164 format (e.g., +15005550006)',
|
|
28
|
-
required: false,
|
|
29
|
-
}),
|
|
30
|
-
external_id: pieces_framework_1.Property.ShortText({
|
|
31
|
-
displayName: 'External ID',
|
|
32
|
-
description: 'Unique identifier from external system',
|
|
33
|
-
required: false,
|
|
34
|
-
}),
|
|
35
|
-
first_name: pieces_framework_1.Property.ShortText({
|
|
36
|
-
displayName: 'First Name',
|
|
37
|
-
required: false,
|
|
38
|
-
}),
|
|
39
|
-
last_name: pieces_framework_1.Property.ShortText({
|
|
40
|
-
displayName: 'Last Name',
|
|
41
|
-
required: false,
|
|
42
|
-
}),
|
|
43
|
-
organization: pieces_framework_1.Property.ShortText({
|
|
44
|
-
displayName: 'Organization',
|
|
45
|
-
description: 'Company name',
|
|
46
|
-
required: false,
|
|
47
|
-
}),
|
|
48
|
-
locale: pieces_framework_1.Property.ShortText({
|
|
49
|
-
displayName: 'Locale',
|
|
50
|
-
description: 'Language tag (e.g., en-US)',
|
|
51
|
-
required: false,
|
|
52
|
-
}),
|
|
53
|
-
title: pieces_framework_1.Property.ShortText({
|
|
54
|
-
displayName: 'Job Title',
|
|
55
|
-
required: false,
|
|
56
|
-
}),
|
|
57
|
-
image: pieces_framework_1.Property.ShortText({
|
|
58
|
-
displayName: 'Image URL',
|
|
59
|
-
description: 'Profile image URL',
|
|
60
|
-
required: false,
|
|
61
|
-
}),
|
|
62
|
-
address1: pieces_framework_1.Property.ShortText({
|
|
63
|
-
displayName: 'Address 1',
|
|
64
|
-
description: 'Street address line 1',
|
|
65
|
-
required: false,
|
|
66
|
-
}),
|
|
67
|
-
address2: pieces_framework_1.Property.ShortText({
|
|
68
|
-
displayName: 'Address 2',
|
|
69
|
-
description: 'Street address line 2',
|
|
70
|
-
required: false,
|
|
71
|
-
}),
|
|
72
|
-
city: pieces_framework_1.Property.ShortText({
|
|
73
|
-
displayName: 'City',
|
|
74
|
-
required: false,
|
|
75
|
-
}),
|
|
76
|
-
country: pieces_framework_1.Property.ShortText({
|
|
77
|
-
displayName: 'Country',
|
|
78
|
-
required: false,
|
|
79
|
-
}),
|
|
80
|
-
region: pieces_framework_1.Property.ShortText({
|
|
81
|
-
displayName: 'Region/State',
|
|
82
|
-
required: false,
|
|
83
|
-
}),
|
|
84
|
-
zip: pieces_framework_1.Property.ShortText({
|
|
85
|
-
displayName: 'Zip Code',
|
|
86
|
-
required: false,
|
|
87
|
-
}),
|
|
88
|
-
timezone: pieces_framework_1.Property.ShortText({
|
|
89
|
-
displayName: 'Timezone',
|
|
90
|
-
description: 'IANA timezone (e.g., America/New_York)',
|
|
91
|
-
required: false,
|
|
92
|
-
}),
|
|
93
|
-
ip: pieces_framework_1.Property.ShortText({
|
|
94
|
-
displayName: 'IP Address',
|
|
95
|
-
required: false,
|
|
96
|
-
}),
|
|
97
|
-
latitude: pieces_framework_1.Property.Number({
|
|
98
|
-
displayName: 'Latitude',
|
|
99
|
-
description: 'Latitude coordinate (4 decimal places recommended)',
|
|
100
|
-
required: false,
|
|
101
|
-
}),
|
|
102
|
-
longitude: pieces_framework_1.Property.Number({
|
|
103
|
-
displayName: 'Longitude',
|
|
104
|
-
description: 'Longitude coordinate (4 decimal places recommended)',
|
|
105
|
-
required: false,
|
|
106
|
-
}),
|
|
107
|
-
custom_properties: pieces_framework_1.Property.Object({
|
|
108
|
-
displayName: 'Custom Properties',
|
|
109
|
-
description: 'Key-value pairs for segmentation and personalization',
|
|
110
|
-
required: false,
|
|
111
|
-
}),
|
|
112
|
-
include_subscriptions: pieces_framework_1.Property.Checkbox({
|
|
113
|
-
displayName: 'Include Subscriptions',
|
|
114
|
-
description: 'Return subscription data in response',
|
|
115
|
-
required: false,
|
|
116
|
-
defaultValue: false,
|
|
117
|
-
}),
|
|
118
|
-
include_predictive_analytics: pieces_framework_1.Property.Checkbox({
|
|
119
|
-
displayName: 'Include Predictive Analytics',
|
|
120
|
-
description: 'Return predictive analytics in response',
|
|
121
|
-
required: false,
|
|
122
|
-
defaultValue: false,
|
|
123
|
-
}),
|
|
124
|
-
},
|
|
125
|
-
run(_a) {
|
|
126
|
-
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
|
|
127
|
-
const { email, phone_number, external_id, first_name, last_name, organization, locale, title, image, address1, address2, city, country, region, zip, timezone, ip, latitude, longitude, custom_properties, include_subscriptions, include_predictive_analytics, } = propsValue;
|
|
128
|
-
if (!email && !phone_number && !external_id) {
|
|
129
|
-
throw new Error('At least one identifier is required: email, phone_number, or external_id');
|
|
130
|
-
}
|
|
131
|
-
const attributes = {};
|
|
132
|
-
if (email)
|
|
133
|
-
attributes['email'] = email;
|
|
134
|
-
if (phone_number)
|
|
135
|
-
attributes['phone_number'] = phone_number;
|
|
136
|
-
if (external_id)
|
|
137
|
-
attributes['external_id'] = external_id;
|
|
138
|
-
if (first_name)
|
|
139
|
-
attributes['first_name'] = first_name;
|
|
140
|
-
if (last_name)
|
|
141
|
-
attributes['last_name'] = last_name;
|
|
142
|
-
if (organization)
|
|
143
|
-
attributes['organization'] = organization;
|
|
144
|
-
if (locale)
|
|
145
|
-
attributes['locale'] = locale;
|
|
146
|
-
if (title)
|
|
147
|
-
attributes['title'] = title;
|
|
148
|
-
if (image)
|
|
149
|
-
attributes['image'] = image;
|
|
150
|
-
const hasLocationData = address1 ||
|
|
151
|
-
address2 ||
|
|
152
|
-
city ||
|
|
153
|
-
country ||
|
|
154
|
-
region ||
|
|
155
|
-
zip ||
|
|
156
|
-
timezone ||
|
|
157
|
-
ip ||
|
|
158
|
-
latitude ||
|
|
159
|
-
longitude;
|
|
160
|
-
if (hasLocationData) {
|
|
161
|
-
attributes['location'] = {};
|
|
162
|
-
if (address1)
|
|
163
|
-
attributes['location']['address1'] = address1;
|
|
164
|
-
if (address2)
|
|
165
|
-
attributes['location']['address2'] = address2;
|
|
166
|
-
if (city)
|
|
167
|
-
attributes['location']['city'] = city;
|
|
168
|
-
if (country)
|
|
169
|
-
attributes['location']['country'] = country;
|
|
170
|
-
if (region)
|
|
171
|
-
attributes['location']['region'] = region;
|
|
172
|
-
if (zip)
|
|
173
|
-
attributes['location']['zip'] = zip;
|
|
174
|
-
if (timezone)
|
|
175
|
-
attributes['location']['timezone'] = timezone;
|
|
176
|
-
if (ip)
|
|
177
|
-
attributes['location']['ip'] = ip;
|
|
178
|
-
if (latitude)
|
|
179
|
-
attributes['location']['latitude'] = latitude;
|
|
180
|
-
if (longitude)
|
|
181
|
-
attributes['location']['longitude'] = longitude;
|
|
182
|
-
}
|
|
183
|
-
if (custom_properties) {
|
|
184
|
-
attributes['properties'] = custom_properties;
|
|
185
|
-
}
|
|
186
|
-
const body = {
|
|
187
|
-
data: {
|
|
188
|
-
type: 'profile',
|
|
189
|
-
attributes,
|
|
190
|
-
},
|
|
191
|
-
};
|
|
192
|
-
const queryParams = new URLSearchParams();
|
|
193
|
-
const additionalFields = [];
|
|
194
|
-
if (include_subscriptions) {
|
|
195
|
-
additionalFields.push('subscriptions');
|
|
196
|
-
}
|
|
197
|
-
if (include_predictive_analytics) {
|
|
198
|
-
additionalFields.push('predictive_analytics');
|
|
199
|
-
}
|
|
200
|
-
if (additionalFields.length > 0) {
|
|
201
|
-
queryParams.append('additional-fields[profile]', additionalFields.join(','));
|
|
202
|
-
}
|
|
203
|
-
const endpoint = `/profiles${queryParams.toString() ? '?' + queryParams.toString() : ''}`;
|
|
204
|
-
return yield (0, client_1.makeRequest)(auth, pieces_common_1.HttpMethod.POST, endpoint, body);
|
|
205
|
-
});
|
|
206
|
-
},
|
|
207
|
-
});
|
|
208
|
-
//# sourceMappingURL=create-profile.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-profile.js","sourceRoot":"","sources":["../../../../src/lib/actions/create-profile.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,yCAA+D;AAC/D,6CAA+C;AAC/C,+DAAyD;AAE5C,QAAA,aAAa,GAAG,IAAA,+BAAY,EAAC;IACxC,IAAI,EAAE,kBAAW;IACjB,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE,0DAA0D;IACvE,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EAAE,0UAA0U;QACvV,UAAU,EAAE,KAAK;KAClB;IACD,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,CAAC;gBAC5D,IAAI,SAAS;oBAAE,UAAU,CAAC,UAAU,CAAC,CAAC,WAAW,CAAC,GAAG,SAAS,CAAC;YACjE,CAAC;YAED,IAAI,iBAAiB,EAAE,CAAC;gBACtB,UAAU,CAAC,YAAY,CAAC,GAAG,iBAAiB,CAAC;YAC/C,CAAC;YAED,MAAM,IAAI,GAAG;gBACX,IAAI,EAAE;oBACJ,IAAI,EAAE,SAAS;oBACf,UAAU;iBACX;aACF,CAAC;YAEF,MAAM,WAAW,GAAG,IAAI,eAAe,EAAE,CAAC;YAC1C,MAAM,gBAAgB,GAAG,EAAE,CAAC;YAE5B,IAAI,qBAAqB,EAAE,CAAC;gBAC1B,gBAAgB,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;YACzC,CAAC;YACD,IAAI,4BAA4B,EAAE,CAAC;gBACjC,gBAAgB,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;YAChD,CAAC;YAED,IAAI,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAChC,WAAW,CAAC,MAAM,CAChB,4BAA4B,EAC5B,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,CAC3B,CAAC;YACJ,CAAC;YAED,MAAM,QAAQ,GAAG,YACf,WAAW,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,WAAW,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAC1D,EAAE,CAAC;YAEH,OAAO,MAAM,IAAA,oBAAW,EACtB,IAAwB,EACxB,0BAAU,CAAC,IAAI,EACf,QAAQ,EACR,IAAI,CACL,CAAC;QACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare const findListByName: import("@activepieces/pieces-framework").IAction<(import("@activepieces/pieces-framework").SecretTextProperty<true> | import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>)[], {
|
|
2
|
-
search_query: import("@activepieces/pieces-framework").LongTextProperty<true>;
|
|
3
|
-
include_additional_data: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
4
|
-
}>;
|
|
5
|
-
//# sourceMappingURL=find-list-by-name.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"find-list-by-name.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/find-list-by-name.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,cAAc;;;EA8EzB,CAAC"}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.findListByName = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const auth_1 = require("../common/auth");
|
|
7
|
-
const client_1 = require("../common/client");
|
|
8
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
9
|
-
exports.findListByName = (0, pieces_framework_1.createAction)({
|
|
10
|
-
auth: auth_1.klaviyoAuth,
|
|
11
|
-
name: 'findListByName',
|
|
12
|
-
displayName: 'Find List by Name',
|
|
13
|
-
description: 'Find lists by name with optional additional data',
|
|
14
|
-
audience: 'both',
|
|
15
|
-
aiMetadata: {
|
|
16
|
-
description: 'Looks up Klaviyo lists by an exact name match and returns the matching lists with their IDs. Use to resolve a list name into a list ID before actions that require one (add/remove/subscribe). Requires a list name; matching is exact, not partial. Read-only and idempotent.',
|
|
17
|
-
idempotent: true,
|
|
18
|
-
},
|
|
19
|
-
props: {
|
|
20
|
-
search_query: pieces_framework_1.Property.LongText({
|
|
21
|
-
displayName: 'List Name(s)',
|
|
22
|
-
description: 'Enter list name',
|
|
23
|
-
required: true,
|
|
24
|
-
}),
|
|
25
|
-
include_additional_data: pieces_framework_1.Property.Checkbox({
|
|
26
|
-
displayName: 'Include Additional Data',
|
|
27
|
-
description: 'Include related flow and tag information',
|
|
28
|
-
required: false,
|
|
29
|
-
defaultValue: false,
|
|
30
|
-
}),
|
|
31
|
-
},
|
|
32
|
-
run(_a) {
|
|
33
|
-
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
|
|
34
|
-
const { search_query, include_additional_data } = propsValue;
|
|
35
|
-
if (!search_query || search_query.trim().length === 0) {
|
|
36
|
-
throw new Error('List name is required');
|
|
37
|
-
}
|
|
38
|
-
const trimmedQuery = search_query.trim();
|
|
39
|
-
let filter = '';
|
|
40
|
-
filter = `equals(name,"${trimmedQuery}")`;
|
|
41
|
-
const queryParams = new URLSearchParams();
|
|
42
|
-
queryParams.append('filter', filter);
|
|
43
|
-
queryParams.append('page[size]', '10');
|
|
44
|
-
queryParams.append('sort', 'name');
|
|
45
|
-
if (include_additional_data) {
|
|
46
|
-
queryParams.append('include', 'tags');
|
|
47
|
-
}
|
|
48
|
-
const response = yield (0, client_1.makeRequest)(auth, pieces_common_1.HttpMethod.GET, `/lists?${queryParams.toString()}`);
|
|
49
|
-
const lists = response.data || [];
|
|
50
|
-
if (lists.length === 0) {
|
|
51
|
-
return {
|
|
52
|
-
success: false,
|
|
53
|
-
message: `No lists found with ${trimmedQuery}`,
|
|
54
|
-
lists: [],
|
|
55
|
-
count: 0,
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
const formattedLists = lists.map((list) => ({
|
|
59
|
-
id: list.id,
|
|
60
|
-
name: list.attributes.name,
|
|
61
|
-
created: list.attributes.created,
|
|
62
|
-
updated: list.attributes.updated,
|
|
63
|
-
opt_in_process: list.attributes.opt_in_process,
|
|
64
|
-
}));
|
|
65
|
-
return {
|
|
66
|
-
success: true,
|
|
67
|
-
message: `Found ${lists.length} list(s) matching your search`,
|
|
68
|
-
lists: formattedLists,
|
|
69
|
-
rawresponse: response,
|
|
70
|
-
};
|
|
71
|
-
});
|
|
72
|
-
},
|
|
73
|
-
});
|
|
74
|
-
//# sourceMappingURL=find-list-by-name.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
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/pieces-framework").IAction<(import("@activepieces/pieces-framework").SecretTextProperty<true> | import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>)[], {
|
|
2
|
-
search_query: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
-
include_additional_data: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
4
|
-
}>;
|
|
5
|
-
//# sourceMappingURL=find-profile-by-email-phone.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"find-profile-by-email-phone.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/find-profile-by-email-phone.ts"],"names":[],"mappings":"AA0BA,eAAO,MAAM,uBAAuB;;;EA6GlC,CAAC"}
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.findProfileByEmailPhone = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const auth_1 = require("../common/auth");
|
|
7
|
-
const client_1 = require("../common/client");
|
|
8
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
9
|
-
exports.findProfileByEmailPhone = (0, pieces_framework_1.createAction)({
|
|
10
|
-
auth: auth_1.klaviyoAuth,
|
|
11
|
-
name: 'findProfileByEmailPhone',
|
|
12
|
-
displayName: 'Find Profile by Email/Phone',
|
|
13
|
-
description: 'Find a profile using email or phone number.',
|
|
14
|
-
audience: 'both',
|
|
15
|
-
aiMetadata: {
|
|
16
|
-
description: 'Looks up a Klaviyo profile by exact email address or phone number and returns matching profiles with their IDs. The search value is auto-detected as an email (must contain "@" and be valid) or a phone number (E.164 recommended). Use to resolve a contact into a profile ID before update/subscribe/list actions. Read-only and idempotent.',
|
|
17
|
-
idempotent: true,
|
|
18
|
-
},
|
|
19
|
-
props: {
|
|
20
|
-
search_query: pieces_framework_1.Property.ShortText({
|
|
21
|
-
displayName: 'Email or Phone Number',
|
|
22
|
-
description: 'Enter an email address or phone number (E.164 format recommended)',
|
|
23
|
-
required: true,
|
|
24
|
-
}),
|
|
25
|
-
include_additional_data: pieces_framework_1.Property.Checkbox({
|
|
26
|
-
displayName: 'Include Additional Data',
|
|
27
|
-
description: 'Include subscriptions and predictive analytics data',
|
|
28
|
-
required: false,
|
|
29
|
-
defaultValue: false,
|
|
30
|
-
}),
|
|
31
|
-
},
|
|
32
|
-
run(_a) {
|
|
33
|
-
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
|
|
34
|
-
const { search_query, include_additional_data } = propsValue;
|
|
35
|
-
if (!search_query || search_query.trim().length === 0) {
|
|
36
|
-
throw new Error('Email or phone number is required');
|
|
37
|
-
}
|
|
38
|
-
const trimmedQuery = search_query.trim();
|
|
39
|
-
let filter = '';
|
|
40
|
-
const isEmail = trimmedQuery.includes('@');
|
|
41
|
-
if (isEmail) {
|
|
42
|
-
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
43
|
-
if (!emailRegex.test(trimmedQuery)) {
|
|
44
|
-
throw new Error('Please enter a valid email address');
|
|
45
|
-
}
|
|
46
|
-
filter = `equals(email,"${trimmedQuery}")`;
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
const phoneRegex = /^[\+]?[1-9][\d\s\-\(\)\.]{7,15}$/;
|
|
50
|
-
if (!phoneRegex.test(trimmedQuery)) {
|
|
51
|
-
throw new Error('Please enter a valid phone number (E.164 format recommended, e.g., +1234567890)');
|
|
52
|
-
}
|
|
53
|
-
filter = `equals(phone_number,"${trimmedQuery}")`;
|
|
54
|
-
}
|
|
55
|
-
// Build query parameters
|
|
56
|
-
const queryParams = new URLSearchParams();
|
|
57
|
-
queryParams.append('filter', filter);
|
|
58
|
-
queryParams.append('page[size]', '50');
|
|
59
|
-
if (include_additional_data) {
|
|
60
|
-
queryParams.append('additional-fields[profile]', 'subscriptions,predictive_analytics');
|
|
61
|
-
}
|
|
62
|
-
const response = yield (0, client_1.makeRequest)(auth, pieces_common_1.HttpMethod.GET, `/profiles?${queryParams.toString()}`);
|
|
63
|
-
const profiles = response.data || [];
|
|
64
|
-
if (profiles.length === 0) {
|
|
65
|
-
return {
|
|
66
|
-
success: false,
|
|
67
|
-
message: `No profile found with ${isEmail ? 'email' : 'phone number'}: ${trimmedQuery}`,
|
|
68
|
-
profiles: [],
|
|
69
|
-
count: 0,
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
const formattedProfiles = profiles.map((profile) => ({
|
|
73
|
-
id: profile.id,
|
|
74
|
-
email: profile.attributes.email,
|
|
75
|
-
phone_number: profile.attributes.phone_number,
|
|
76
|
-
first_name: profile.attributes.first_name,
|
|
77
|
-
last_name: profile.attributes.last_name,
|
|
78
|
-
external_id: profile.attributes.external_id,
|
|
79
|
-
full_name: [profile.attributes.first_name, profile.attributes.last_name]
|
|
80
|
-
.filter(Boolean)
|
|
81
|
-
.join(' ') || null,
|
|
82
|
-
created: profile.attributes.created,
|
|
83
|
-
updated: profile.attributes.updated,
|
|
84
|
-
full_profile: profile.attributes,
|
|
85
|
-
}));
|
|
86
|
-
return {
|
|
87
|
-
success: true,
|
|
88
|
-
message: `Found ${profiles.length} profile(s) matching ${isEmail ? 'email' : 'phone number'}: ${trimmedQuery}`,
|
|
89
|
-
profiles: formattedProfiles,
|
|
90
|
-
count: profiles.length,
|
|
91
|
-
raw_response: response,
|
|
92
|
-
};
|
|
93
|
-
});
|
|
94
|
-
},
|
|
95
|
-
});
|
|
96
|
-
//# sourceMappingURL=find-profile-by-email-phone.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"find-profile-by-email-phone.js","sourceRoot":"","sources":["../../../../src/lib/actions/find-profile-by-email-phone.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,yCAA+D;AAC/D,6CAA+C;AAC/C,+DAAyD;AAuB5C,QAAA,uBAAuB,GAAG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UAAU,EAAE,OAAO,CAAC,UAAU,CAAC,UAAU;gBACzC,SAAS,EAAE,OAAO,CAAC,UAAU,CAAC,SAAS;gBACvC,WAAW,EAAE,OAAO,CAAC,UAAU,CAAC,WAAW;gBAC3C,SAAS,EACP,CAAC,OAAO,CAAC,UAAU,CAAC,UAAU,EAAE,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC;qBAC1D,MAAM,CAAC,OAAO,CAAC;qBACf,IAAI,CAAC,GAAG,CAAC,IAAI,IAAI;gBACtB,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO;gBACnC,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO;gBACnC,YAAY,EAAE,OAAO,CAAC,UAAU;aACjC,CAAC,CAAC,CAAC;YAEJ,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,OAAO,EAAE,SAAS,QAAQ,CAAC,MAAM,wBAC/B,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,cACtB,KAAK,YAAY,EAAE;gBACnB,QAAQ,EAAE,iBAAiB;gBAC3B,KAAK,EAAE,QAAQ,CAAC,MAAM;gBACtB,YAAY,EAAE,QAAQ;aACvB,CAAC;QACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export declare const findTagByName: import("@activepieces/pieces-framework").IAction<(import("@activepieces/pieces-framework").SecretTextProperty<true> | import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>)[], {
|
|
2
|
-
search_query: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
-
}>;
|
|
4
|
-
//# sourceMappingURL=find-tag-by-name.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"find-tag-by-name.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/find-tag-by-name.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,aAAa;;EA8DxB,CAAC"}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.findTagByName = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const auth_1 = require("../common/auth");
|
|
7
|
-
const client_1 = require("../common/client");
|
|
8
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
9
|
-
exports.findTagByName = (0, pieces_framework_1.createAction)({
|
|
10
|
-
auth: auth_1.klaviyoAuth,
|
|
11
|
-
name: 'findTagByName',
|
|
12
|
-
displayName: 'Find Tag by Name',
|
|
13
|
-
description: 'Find tags whose name contains the search query.',
|
|
14
|
-
audience: 'both',
|
|
15
|
-
aiMetadata: {
|
|
16
|
-
description: 'Searches Klaviyo tags by a partial (contains) name match and returns matching tags with their IDs. Use to discover tag IDs by keyword. Requires a search value; matching is substring-based, not exact. Read-only and idempotent.',
|
|
17
|
-
idempotent: true,
|
|
18
|
-
},
|
|
19
|
-
props: {
|
|
20
|
-
search_query: pieces_framework_1.Property.ShortText({
|
|
21
|
-
displayName: 'Tag Name',
|
|
22
|
-
description: 'Search for tags whose name contains this value.',
|
|
23
|
-
required: true,
|
|
24
|
-
}),
|
|
25
|
-
},
|
|
26
|
-
run(_a) {
|
|
27
|
-
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
|
|
28
|
-
const { search_query } = propsValue;
|
|
29
|
-
if (!search_query || search_query.trim().length === 0) {
|
|
30
|
-
throw new Error('Tag name is required');
|
|
31
|
-
}
|
|
32
|
-
const trimmedQuery = search_query.trim();
|
|
33
|
-
const filter = `contains(name,"${trimmedQuery.replace(/"/g, '\\"')}")`;
|
|
34
|
-
const queryParams = new URLSearchParams();
|
|
35
|
-
queryParams.append('filter', filter);
|
|
36
|
-
queryParams.append('page[size]', '50');
|
|
37
|
-
queryParams.append('sort', 'name');
|
|
38
|
-
const response = yield (0, client_1.makeRequest)(auth, pieces_common_1.HttpMethod.GET, `/tags?${queryParams.toString()}`);
|
|
39
|
-
const tags = response.data || [];
|
|
40
|
-
if (tags.length === 0) {
|
|
41
|
-
return {
|
|
42
|
-
success: false,
|
|
43
|
-
message: `No tags found containing "${trimmedQuery}"`,
|
|
44
|
-
tags: [],
|
|
45
|
-
count: 0,
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
const formattedTags = tags.map((tag) => {
|
|
49
|
-
var _a;
|
|
50
|
-
return ({
|
|
51
|
-
id: tag.id,
|
|
52
|
-
name: (_a = tag.attributes.name) !== null && _a !== void 0 ? _a : '',
|
|
53
|
-
});
|
|
54
|
-
});
|
|
55
|
-
return {
|
|
56
|
-
success: true,
|
|
57
|
-
message: `Found ${tags.length} tag(s) containing "${trimmedQuery}"`,
|
|
58
|
-
tags: formattedTags,
|
|
59
|
-
count: tags.length,
|
|
60
|
-
search_query: trimmedQuery,
|
|
61
|
-
};
|
|
62
|
-
});
|
|
63
|
-
},
|
|
64
|
-
});
|
|
65
|
-
//# sourceMappingURL=find-tag-by-name.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"find-tag-by-name.js","sourceRoot":"","sources":["../../../../src/lib/actions/find-tag-by-name.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,yCAA+D;AAC/D,6CAA+C;AAC/C,+DAAyD;AAU5C,QAAA,aAAa,GAAG,IAAA,+BAAY,EAAC;IACxC,IAAI,EAAE,kBAAW;IACjB,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,kBAAkB;IAC/B,WAAW,EAAE,iDAAiD;IAC9D,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EAAE,mOAAmO;QAChP,UAAU,EAAE,IAAI;KACjB;IACD,KAAK,EAAE;QACL,YAAY,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC/B,WAAW,EAAE,UAAU;YACvB,WAAW,EAAE,iDAAiD;Y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AAG,CAAC,UAAU,CAAC,IAAI,mCAAI,EAAE;iBAChC,CAAC,CAAA;aAAA,CAAC,CAAC;YAEJ,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,OAAO,EAAE,SAAS,IAAI,CAAC,MAAM,uBAAuB,YAAY,GAAG;gBACnE,IAAI,EAAE,aAAa;gBACnB,KAAK,EAAE,IAAI,CAAC,MAAM;gBAClB,YAAY,EAAE,YAAY;aAC3B,CAAC;QACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare const removeProfileFromList: import("@activepieces/pieces-framework").IAction<(import("@activepieces/pieces-framework").SecretTextProperty<true> | import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>)[], {
|
|
2
|
-
list_id: import("@activepieces/pieces-framework").DropdownProperty<string, true, (import("@activepieces/pieces-framework").SecretTextProperty<true> | import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>)[]>;
|
|
3
|
-
profile_ids: import("@activepieces/pieces-framework").MultiSelectDropdownProperty<string, true, (import("@activepieces/pieces-framework").SecretTextProperty<true> | import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>)[]>;
|
|
4
|
-
}>;
|
|
5
|
-
//# sourceMappingURL=remove-profile-from-list.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"remove-profile-from-list.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/remove-profile-from-list.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,qBAAqB;;;EAkDhC,CAAC"}
|