@activepieces/piece-klaviyo 0.1.1 → 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.
Files changed (65) hide show
  1. package/package.json +7 -13
  2. package/src/index.js +31 -53
  3. package/src/index.d.ts +0 -2
  4. package/src/index.d.ts.map +0 -1
  5. package/src/index.js.map +0 -1
  6. package/src/lib/actions/add-profile-to-list.d.ts +0 -5
  7. package/src/lib/actions/add-profile-to-list.d.ts.map +0 -1
  8. package/src/lib/actions/add-profile-to-list.js +0 -44
  9. package/src/lib/actions/add-profile-to-list.js.map +0 -1
  10. package/src/lib/actions/create-list.d.ts +0 -4
  11. package/src/lib/actions/create-list.d.ts.map +0 -1
  12. package/src/lib/actions/create-list.js +0 -44
  13. package/src/lib/actions/create-list.js.map +0 -1
  14. package/src/lib/actions/create-profile.d.ts +0 -25
  15. package/src/lib/actions/create-profile.d.ts.map +0 -1
  16. package/src/lib/actions/create-profile.js +0 -203
  17. package/src/lib/actions/create-profile.js.map +0 -1
  18. package/src/lib/actions/find-list-by-name.d.ts +0 -5
  19. package/src/lib/actions/find-list-by-name.d.ts.map +0 -1
  20. package/src/lib/actions/find-list-by-name.js +0 -69
  21. package/src/lib/actions/find-list-by-name.js.map +0 -1
  22. package/src/lib/actions/find-profile-by-email-phone.d.ts +0 -5
  23. package/src/lib/actions/find-profile-by-email-phone.d.ts.map +0 -1
  24. package/src/lib/actions/find-profile-by-email-phone.js +0 -91
  25. package/src/lib/actions/find-profile-by-email-phone.js.map +0 -1
  26. package/src/lib/actions/find-tag-by-name.d.ts +0 -4
  27. package/src/lib/actions/find-tag-by-name.d.ts.map +0 -1
  28. package/src/lib/actions/find-tag-by-name.js +0 -60
  29. package/src/lib/actions/find-tag-by-name.js.map +0 -1
  30. package/src/lib/actions/remove-profile-from-list.d.ts +0 -5
  31. package/src/lib/actions/remove-profile-from-list.d.ts.map +0 -1
  32. package/src/lib/actions/remove-profile-from-list.js +0 -47
  33. package/src/lib/actions/remove-profile-from-list.js.map +0 -1
  34. package/src/lib/actions/subscribe-profile.d.ts +0 -10
  35. package/src/lib/actions/subscribe-profile.d.ts.map +0 -1
  36. package/src/lib/actions/subscribe-profile.js +0 -121
  37. package/src/lib/actions/subscribe-profile.js.map +0 -1
  38. package/src/lib/actions/unsubscribe-profile.d.ts +0 -8
  39. package/src/lib/actions/unsubscribe-profile.d.ts.map +0 -1
  40. package/src/lib/actions/unsubscribe-profile.js +0 -105
  41. package/src/lib/actions/unsubscribe-profile.js.map +0 -1
  42. package/src/lib/actions/update-profile.d.ts +0 -27
  43. package/src/lib/actions/update-profile.d.ts.map +0 -1
  44. package/src/lib/actions/update-profile.js +0 -216
  45. package/src/lib/actions/update-profile.js.map +0 -1
  46. package/src/lib/common/auth.d.ts +0 -5
  47. package/src/lib/common/auth.d.ts.map +0 -1
  48. package/src/lib/common/auth.js +0 -76
  49. package/src/lib/common/auth.js.map +0 -1
  50. package/src/lib/common/client.d.ts +0 -7
  51. package/src/lib/common/client.d.ts.map +0 -1
  52. package/src/lib/common/client.js +0 -82
  53. package/src/lib/common/client.js.map +0 -1
  54. package/src/lib/common/props.d.ts +0 -6
  55. package/src/lib/common/props.d.ts.map +0 -1
  56. package/src/lib/common/props.js +0 -129
  57. package/src/lib/common/props.js.map +0 -1
  58. package/src/lib/triggers/new-profile.d.ts +0 -3
  59. package/src/lib/triggers/new-profile.d.ts.map +0 -1
  60. package/src/lib/triggers/new-profile.js +0 -144
  61. package/src/lib/triggers/new-profile.js.map +0 -1
  62. package/src/lib/triggers/profile-added-to-list-segment.d.ts +0 -19
  63. package/src/lib/triggers/profile-added-to-list-segment.d.ts.map +0 -1
  64. package/src/lib/triggers/profile-added-to-list-segment.js +0 -232
  65. package/src/lib/triggers/profile-added-to-list-segment.js.map +0 -1
@@ -1,44 +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
- props: {
15
- name: pieces_framework_1.Property.ShortText({
16
- displayName: 'List Name',
17
- description: 'Name for the new list',
18
- required: true,
19
- }),
20
- },
21
- run(_a) {
22
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
23
- const { name } = propsValue;
24
- if (!name || name.trim().length === 0) {
25
- throw new Error('List name cannot be empty');
26
- }
27
- const data = {
28
- data: {
29
- type: 'list',
30
- attributes: {
31
- name: name.trim(),
32
- },
33
- },
34
- };
35
- const response = yield (0, client_1.makeRequest)(auth, pieces_common_1.HttpMethod.POST, '/lists', data);
36
- return {
37
- success: true,
38
- message: `List "${name}" created successfully`,
39
- list: response.data,
40
- };
41
- });
42
- },
43
- });
44
- //# 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,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;;;;;;;;;;;;;;;;;;;;;;;EA4NxB,CAAC"}
@@ -1,203 +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
- props: {
15
- email: pieces_framework_1.Property.ShortText({
16
- displayName: 'Email',
17
- description: 'Email address (recommended identifier)',
18
- required: false,
19
- }),
20
- phone_number: pieces_framework_1.Property.ShortText({
21
- displayName: 'Phone Number',
22
- description: 'Phone number in E.164 format (e.g., +15005550006)',
23
- required: false,
24
- }),
25
- external_id: pieces_framework_1.Property.ShortText({
26
- displayName: 'External ID',
27
- description: 'Unique identifier from external system',
28
- required: false,
29
- }),
30
- first_name: pieces_framework_1.Property.ShortText({
31
- displayName: 'First Name',
32
- required: false,
33
- }),
34
- last_name: pieces_framework_1.Property.ShortText({
35
- displayName: 'Last Name',
36
- required: false,
37
- }),
38
- organization: pieces_framework_1.Property.ShortText({
39
- displayName: 'Organization',
40
- description: 'Company name',
41
- required: false,
42
- }),
43
- locale: pieces_framework_1.Property.ShortText({
44
- displayName: 'Locale',
45
- description: 'Language tag (e.g., en-US)',
46
- required: false,
47
- }),
48
- title: pieces_framework_1.Property.ShortText({
49
- displayName: 'Job Title',
50
- required: false,
51
- }),
52
- image: pieces_framework_1.Property.ShortText({
53
- displayName: 'Image URL',
54
- description: 'Profile image URL',
55
- required: false,
56
- }),
57
- address1: pieces_framework_1.Property.ShortText({
58
- displayName: 'Address 1',
59
- description: 'Street address line 1',
60
- required: false,
61
- }),
62
- address2: pieces_framework_1.Property.ShortText({
63
- displayName: 'Address 2',
64
- description: 'Street address line 2',
65
- required: false,
66
- }),
67
- city: pieces_framework_1.Property.ShortText({
68
- displayName: 'City',
69
- required: false,
70
- }),
71
- country: pieces_framework_1.Property.ShortText({
72
- displayName: 'Country',
73
- required: false,
74
- }),
75
- region: pieces_framework_1.Property.ShortText({
76
- displayName: 'Region/State',
77
- required: false,
78
- }),
79
- zip: pieces_framework_1.Property.ShortText({
80
- displayName: 'Zip Code',
81
- required: false,
82
- }),
83
- timezone: pieces_framework_1.Property.ShortText({
84
- displayName: 'Timezone',
85
- description: 'IANA timezone (e.g., America/New_York)',
86
- required: false,
87
- }),
88
- ip: pieces_framework_1.Property.ShortText({
89
- displayName: 'IP Address',
90
- required: false,
91
- }),
92
- latitude: pieces_framework_1.Property.Number({
93
- displayName: 'Latitude',
94
- description: 'Latitude coordinate (4 decimal places recommended)',
95
- required: false,
96
- }),
97
- longitude: pieces_framework_1.Property.Number({
98
- displayName: 'Longitude',
99
- description: 'Longitude coordinate (4 decimal places recommended)',
100
- required: false,
101
- }),
102
- custom_properties: pieces_framework_1.Property.Object({
103
- displayName: 'Custom Properties',
104
- description: 'Key-value pairs for segmentation and personalization',
105
- required: false,
106
- }),
107
- include_subscriptions: pieces_framework_1.Property.Checkbox({
108
- displayName: 'Include Subscriptions',
109
- description: 'Return subscription data in response',
110
- required: false,
111
- defaultValue: false,
112
- }),
113
- include_predictive_analytics: pieces_framework_1.Property.Checkbox({
114
- displayName: 'Include Predictive Analytics',
115
- description: 'Return predictive analytics in response',
116
- required: false,
117
- defaultValue: false,
118
- }),
119
- },
120
- run(_a) {
121
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
122
- 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;
123
- if (!email && !phone_number && !external_id) {
124
- throw new Error('At least one identifier is required: email, phone_number, or external_id');
125
- }
126
- const attributes = {};
127
- if (email)
128
- attributes['email'] = email;
129
- if (phone_number)
130
- attributes['phone_number'] = phone_number;
131
- if (external_id)
132
- attributes['external_id'] = external_id;
133
- if (first_name)
134
- attributes['first_name'] = first_name;
135
- if (last_name)
136
- attributes['last_name'] = last_name;
137
- if (organization)
138
- attributes['organization'] = organization;
139
- if (locale)
140
- attributes['locale'] = locale;
141
- if (title)
142
- attributes['title'] = title;
143
- if (image)
144
- attributes['image'] = image;
145
- const hasLocationData = address1 ||
146
- address2 ||
147
- city ||
148
- country ||
149
- region ||
150
- zip ||
151
- timezone ||
152
- ip ||
153
- latitude ||
154
- longitude;
155
- if (hasLocationData) {
156
- attributes['location'] = {};
157
- if (address1)
158
- attributes['location']['address1'] = address1;
159
- if (address2)
160
- attributes['location']['address2'] = address2;
161
- if (city)
162
- attributes['location']['city'] = city;
163
- if (country)
164
- attributes['location']['country'] = country;
165
- if (region)
166
- attributes['location']['region'] = region;
167
- if (zip)
168
- attributes['location']['zip'] = zip;
169
- if (timezone)
170
- attributes['location']['timezone'] = timezone;
171
- if (ip)
172
- attributes['location']['ip'] = ip;
173
- if (latitude)
174
- attributes['location']['latitude'] = latitude;
175
- if (longitude)
176
- attributes['location']['longitude'] = longitude;
177
- }
178
- if (custom_properties) {
179
- attributes['properties'] = custom_properties;
180
- }
181
- const body = {
182
- data: {
183
- type: 'profile',
184
- attributes,
185
- },
186
- };
187
- const queryParams = new URLSearchParams();
188
- const additionalFields = [];
189
- if (include_subscriptions) {
190
- additionalFields.push('subscriptions');
191
- }
192
- if (include_predictive_analytics) {
193
- additionalFields.push('predictive_analytics');
194
- }
195
- if (additionalFields.length > 0) {
196
- queryParams.append('additional-fields[profile]', additionalFields.join(','));
197
- }
198
- const endpoint = `/profiles${queryParams.toString() ? '?' + queryParams.toString() : ''}`;
199
- return yield (0, client_1.makeRequest)(auth, pieces_common_1.HttpMethod.POST, endpoint, body);
200
- });
201
- },
202
- });
203
- //# 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,KAAK,EAAE;QACL,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,OAAO;YACpB,WAAW,EAAE,wCAAwC;YACrD,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,YAAY,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC/B,WAAW,EAAE,cAAc;YAC3B,WAAW,EAAE,mDAAmD;YAChE,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,WAAW,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC9B,WAAW,EAAE,aAAa;YAC1B,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,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;;;EAyEzB,CAAC"}
@@ -1,69 +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
- props: {
15
- search_query: pieces_framework_1.Property.LongText({
16
- displayName: 'List Name(s)',
17
- description: 'Enter list name',
18
- required: true,
19
- }),
20
- include_additional_data: pieces_framework_1.Property.Checkbox({
21
- displayName: 'Include Additional Data',
22
- description: 'Include related flow and tag information',
23
- required: false,
24
- defaultValue: false,
25
- }),
26
- },
27
- run(_a) {
28
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
29
- const { search_query, include_additional_data } = propsValue;
30
- if (!search_query || search_query.trim().length === 0) {
31
- throw new Error('List name is required');
32
- }
33
- const trimmedQuery = search_query.trim();
34
- let filter = '';
35
- filter = `equals(name,"${trimmedQuery}")`;
36
- const queryParams = new URLSearchParams();
37
- queryParams.append('filter', filter);
38
- queryParams.append('page[size]', '10');
39
- queryParams.append('sort', 'name');
40
- if (include_additional_data) {
41
- queryParams.append('include', 'tags');
42
- }
43
- const response = yield (0, client_1.makeRequest)(auth, pieces_common_1.HttpMethod.GET, `/lists?${queryParams.toString()}`);
44
- const lists = response.data || [];
45
- if (lists.length === 0) {
46
- return {
47
- success: false,
48
- message: `No lists found with ${trimmedQuery}`,
49
- lists: [],
50
- count: 0,
51
- };
52
- }
53
- const formattedLists = lists.map((list) => ({
54
- id: list.id,
55
- name: list.attributes.name,
56
- created: list.attributes.created,
57
- updated: list.attributes.updated,
58
- opt_in_process: list.attributes.opt_in_process,
59
- }));
60
- return {
61
- success: true,
62
- message: `Found ${lists.length} list(s) matching your search`,
63
- lists: formattedLists,
64
- rawresponse: response,
65
- };
66
- });
67
- },
68
- });
69
- //# sourceMappingURL=find-list-by-name.js.map
@@ -1 +0,0 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AAE,MAAM,CAAC,CAAC;YAEnC,IAAI,uBAAuB,EAAE,CAAC;gBAC5B,WAAW,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;YACxC,CAAC;YAED,MAAM,QAAQ,GAAG,MAAM,IAAA,oBAAW,EAChC,IAAwB,EACxB,0BAAU,CAAC,GAAG,EACd,UAAU,WAAW,CAAC,QAAQ,EAAE,EAAE,CACnC,CAAC;YAEF,MAAM,KAAK,GAAkB,QAAQ,CAAC,IAAI,IAAI,EAAE,CAAC;YAEjD,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACvB,OAAO;oBACL,OAAO,EAAE,KAAK;oBACd,OAAO,EAAE,uBAAuB,YAAY,EAAE;oBAC9C,KAAK,EAAE,EAAE;oBACT,KAAK,EAAE,CAAC;iBACT,CAAC;YACJ,CAAC;YAED,MAAM,cAAc,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;gBAC1C,EAAE,EAAE,IAAI,CAAC,EAAE;gBACX,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,IAAI;gBAC1B,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC,OAAO;gBAChC,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC,OAAO;gBAChC,cAAc,EAAE,IAAI,CAAC,UAAU,CAAC,cAAc;aAC/C,CAAC,CAAC,CAAC;YAEJ,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,OAAO,EAAE,SAAS,KAAK,CAAC,MAAM,+BAA+B;gBAC7D,KAAK,EAAE,cAAc;gBACrB,WAAW,EAAE,QAAQ;aACtB,CAAC;QACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,5 +0,0 @@
1
- export declare const findProfileByEmailPhone: 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
- 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;;;EAwGlC,CAAC"}
@@ -1,91 +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
- props: {
15
- search_query: pieces_framework_1.Property.ShortText({
16
- displayName: 'Email or Phone Number',
17
- description: 'Enter an email address or phone number (E.164 format recommended)',
18
- required: true,
19
- }),
20
- include_additional_data: pieces_framework_1.Property.Checkbox({
21
- displayName: 'Include Additional Data',
22
- description: 'Include subscriptions and predictive analytics data',
23
- required: false,
24
- defaultValue: false,
25
- }),
26
- },
27
- run(_a) {
28
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
29
- const { search_query, include_additional_data } = propsValue;
30
- if (!search_query || search_query.trim().length === 0) {
31
- throw new Error('Email or phone number is required');
32
- }
33
- const trimmedQuery = search_query.trim();
34
- let filter = '';
35
- const isEmail = trimmedQuery.includes('@');
36
- if (isEmail) {
37
- const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
38
- if (!emailRegex.test(trimmedQuery)) {
39
- throw new Error('Please enter a valid email address');
40
- }
41
- filter = `equals(email,"${trimmedQuery}")`;
42
- }
43
- else {
44
- const phoneRegex = /^[\+]?[1-9][\d\s\-\(\)\.]{7,15}$/;
45
- if (!phoneRegex.test(trimmedQuery)) {
46
- throw new Error('Please enter a valid phone number (E.164 format recommended, e.g., +1234567890)');
47
- }
48
- filter = `equals(phone_number,"${trimmedQuery}")`;
49
- }
50
- // Build query parameters
51
- const queryParams = new URLSearchParams();
52
- queryParams.append('filter', filter);
53
- queryParams.append('page[size]', '50');
54
- if (include_additional_data) {
55
- queryParams.append('additional-fields[profile]', 'subscriptions,predictive_analytics');
56
- }
57
- const response = yield (0, client_1.makeRequest)(auth, pieces_common_1.HttpMethod.GET, `/profiles?${queryParams.toString()}`);
58
- const profiles = response.data || [];
59
- if (profiles.length === 0) {
60
- return {
61
- success: false,
62
- message: `No profile found with ${isEmail ? 'email' : 'phone number'}: ${trimmedQuery}`,
63
- profiles: [],
64
- count: 0,
65
- };
66
- }
67
- const formattedProfiles = profiles.map((profile) => ({
68
- id: profile.id,
69
- email: profile.attributes.email,
70
- phone_number: profile.attributes.phone_number,
71
- first_name: profile.attributes.first_name,
72
- last_name: profile.attributes.last_name,
73
- external_id: profile.attributes.external_id,
74
- full_name: [profile.attributes.first_name, profile.attributes.last_name]
75
- .filter(Boolean)
76
- .join(' ') || null,
77
- created: profile.attributes.created,
78
- updated: profile.attributes.updated,
79
- full_profile: profile.attributes,
80
- }));
81
- return {
82
- success: true,
83
- message: `Found ${profiles.length} profile(s) matching ${isEmail ? 'email' : 'phone number'}: ${trimmedQuery}`,
84
- profiles: formattedProfiles,
85
- count: profiles.length,
86
- raw_response: response,
87
- };
88
- });
89
- },
90
- });
91
- //# 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,6CA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AAS,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;;EAyDxB,CAAC"}
@@ -1,60 +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
- props: {
15
- search_query: pieces_framework_1.Property.ShortText({
16
- displayName: 'Tag Name',
17
- description: 'Search for tags whose name contains this value.',
18
- required: true,
19
- }),
20
- },
21
- run(_a) {
22
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
23
- const { search_query } = propsValue;
24
- if (!search_query || search_query.trim().length === 0) {
25
- throw new Error('Tag name is required');
26
- }
27
- const trimmedQuery = search_query.trim();
28
- const filter = `contains(name,"${trimmedQuery.replace(/"/g, '\\"')}")`;
29
- const queryParams = new URLSearchParams();
30
- queryParams.append('filter', filter);
31
- queryParams.append('page[size]', '50');
32
- queryParams.append('sort', 'name');
33
- const response = yield (0, client_1.makeRequest)(auth, pieces_common_1.HttpMethod.GET, `/tags?${queryParams.toString()}`);
34
- const tags = response.data || [];
35
- if (tags.length === 0) {
36
- return {
37
- success: false,
38
- message: `No tags found containing "${trimmedQuery}"`,
39
- tags: [],
40
- count: 0,
41
- };
42
- }
43
- const formattedTags = tags.map((tag) => {
44
- var _a;
45
- return ({
46
- id: tag.id,
47
- name: (_a = tag.attributes.name) !== null && _a !== void 0 ? _a : '',
48
- });
49
- });
50
- return {
51
- success: true,
52
- message: `Found ${tags.length} tag(s) containing "${trimmedQuery}"`,
53
- tags: formattedTags,
54
- count: tags.length,
55
- search_query: trimmedQuery,
56
- };
57
- });
58
- },
59
- });
60
- //# 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;AACx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C;gBACtB,OAAO;oBACL,OAAO,EAAE,KAAK;oBACd,OAAO,EAAE,6BAA6B,YAAY,GAAG;oBACrD,IAAI,EAAE,EAAE;oBACR,KAAK,EAAE,CAAC;iBACT,CAAC;YACJ,CAAC;YAED,MAAM,aAAa,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;;gBAAC,OAAA,CAAC;oBACvC,EAAE,EAAE,GAAG,CAAC,EAAE;oBACV,IAAI,EAAE,MAAA,GAAG,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;;;EA6ChC,CAAC"}
@@ -1,47 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.removeProfileFromList = 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 props_1 = require("../common/props");
8
- const pieces_common_1 = require("@activepieces/pieces-common");
9
- const client_1 = require("../common/client");
10
- exports.removeProfileFromList = (0, pieces_framework_1.createAction)({
11
- auth: auth_1.klaviyoAuth,
12
- name: 'removeProfileFromList',
13
- displayName: 'Remove Profile from List',
14
- description: 'Remove profiles from a specific list.',
15
- props: {
16
- list_id: props_1.listIdDropdown,
17
- profile_ids: props_1.profileIdsMultiSelectDropdown,
18
- },
19
- run(_a) {
20
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ propsValue, auth }) {
21
- const { list_id, profile_ids: rawProfileIds } = propsValue;
22
- const profile_ids = (0, client_1.normalizeProfileIds)(rawProfileIds);
23
- if (!profile_ids || profile_ids.length === 0) {
24
- throw new Error('At least one profile must be selected');
25
- }
26
- if (profile_ids.length > 1000) {
27
- throw new Error('Maximum of 1000 profiles can be removed at once');
28
- }
29
- const data = {
30
- data: profile_ids.map((id) => ({
31
- type: 'profile',
32
- id,
33
- })),
34
- };
35
- const response = yield (0, client_1.makeRequest)(auth, pieces_common_1.HttpMethod.DELETE, `/lists/${list_id}/relationships/profiles`, data);
36
- if (!response) {
37
- return {
38
- success: true,
39
- message: `Successfully removed ${profile_ids.length} profile(s) from the list`,
40
- profiles_removed: profile_ids.length,
41
- };
42
- }
43
- return response;
44
- });
45
- },
46
- });
47
- //# sourceMappingURL=remove-profile-from-list.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"remove-profile-from-list.js","sourceRoot":"","sources":["../../../../src/lib/actions/remove-profile-from-list.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,yCAA+D;AAC/D,2CAAgF;AAChF,+DAAyD;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