@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.
Files changed (65) hide show
  1. package/package.json +17 -0
  2. package/src/index.d.ts +2 -0
  3. package/src/index.d.ts.map +1 -0
  4. package/src/index.js +53 -0
  5. package/src/index.js.map +1 -0
  6. package/src/lib/actions/add-profile-to-list.d.ts +5 -0
  7. package/src/lib/actions/add-profile-to-list.d.ts.map +1 -0
  8. package/src/lib/actions/add-profile-to-list.js +46 -0
  9. package/src/lib/actions/add-profile-to-list.js.map +1 -0
  10. package/src/lib/actions/create-list.d.ts +4 -0
  11. package/src/lib/actions/create-list.d.ts.map +1 -0
  12. package/src/lib/actions/create-list.js +44 -0
  13. package/src/lib/actions/create-list.js.map +1 -0
  14. package/src/lib/actions/create-profile.d.ts +25 -0
  15. package/src/lib/actions/create-profile.d.ts.map +1 -0
  16. package/src/lib/actions/create-profile.js +203 -0
  17. package/src/lib/actions/create-profile.js.map +1 -0
  18. package/src/lib/actions/find-list-by-name.d.ts +5 -0
  19. package/src/lib/actions/find-list-by-name.d.ts.map +1 -0
  20. package/src/lib/actions/find-list-by-name.js +69 -0
  21. package/src/lib/actions/find-list-by-name.js.map +1 -0
  22. package/src/lib/actions/find-profile-by-email-phone.d.ts +5 -0
  23. package/src/lib/actions/find-profile-by-email-phone.d.ts.map +1 -0
  24. package/src/lib/actions/find-profile-by-email-phone.js +91 -0
  25. package/src/lib/actions/find-profile-by-email-phone.js.map +1 -0
  26. package/src/lib/actions/find-tag-by-name.d.ts +4 -0
  27. package/src/lib/actions/find-tag-by-name.d.ts.map +1 -0
  28. package/src/lib/actions/find-tag-by-name.js +60 -0
  29. package/src/lib/actions/find-tag-by-name.js.map +1 -0
  30. package/src/lib/actions/remove-profile-from-list.d.ts +5 -0
  31. package/src/lib/actions/remove-profile-from-list.d.ts.map +1 -0
  32. package/src/lib/actions/remove-profile-from-list.js +46 -0
  33. package/src/lib/actions/remove-profile-from-list.js.map +1 -0
  34. package/src/lib/actions/subscribe-profile.d.ts +10 -0
  35. package/src/lib/actions/subscribe-profile.d.ts.map +1 -0
  36. package/src/lib/actions/subscribe-profile.js +120 -0
  37. package/src/lib/actions/subscribe-profile.js.map +1 -0
  38. package/src/lib/actions/unsubscribe-profile.d.ts +8 -0
  39. package/src/lib/actions/unsubscribe-profile.d.ts.map +1 -0
  40. package/src/lib/actions/unsubscribe-profile.js +104 -0
  41. package/src/lib/actions/unsubscribe-profile.js.map +1 -0
  42. package/src/lib/actions/update-profile.d.ts +27 -0
  43. package/src/lib/actions/update-profile.d.ts.map +1 -0
  44. package/src/lib/actions/update-profile.js +216 -0
  45. package/src/lib/actions/update-profile.js.map +1 -0
  46. package/src/lib/common/auth.d.ts +5 -0
  47. package/src/lib/common/auth.d.ts.map +1 -0
  48. package/src/lib/common/auth.js +76 -0
  49. package/src/lib/common/auth.js.map +1 -0
  50. package/src/lib/common/client.d.ts +6 -0
  51. package/src/lib/common/client.d.ts.map +1 -0
  52. package/src/lib/common/client.js +62 -0
  53. package/src/lib/common/client.js.map +1 -0
  54. package/src/lib/common/props.d.ts +5 -0
  55. package/src/lib/common/props.d.ts.map +1 -0
  56. package/src/lib/common/props.js +100 -0
  57. package/src/lib/common/props.js.map +1 -0
  58. package/src/lib/triggers/new-profile.d.ts +3 -0
  59. package/src/lib/triggers/new-profile.d.ts.map +1 -0
  60. package/src/lib/triggers/new-profile.js +144 -0
  61. package/src/lib/triggers/new-profile.js.map +1 -0
  62. package/src/lib/triggers/profile-added-to-list-segment.d.ts +19 -0
  63. package/src/lib/triggers/profile-added-to-list-segment.d.ts.map +1 -0
  64. package/src/lib/triggers/profile-added-to-list-segment.js +232 -0
  65. package/src/lib/triggers/profile-added-to-list-segment.js.map +1 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find-profile-by-email-phone.js","sourceRoot":"","sources":["../../../../src/lib/actions/find-profile-by-email-phone.ts"],"names":[],"mappings":";;;;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,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"}
@@ -0,0 +1,4 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,60 @@
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
@@ -0,0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AC;YAEF,MAAM,IAAI,GAAiB,QAAQ,CAAC,IAAI,IAAI,EAAE,CAAC;YAE/C,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;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"}
@@ -0,0 +1,5 @@
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
@@ -0,0 +1 @@
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;;;EA4ChC,CAAC"}
@@ -0,0 +1,46 @@
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 } = propsValue;
22
+ if (!profile_ids || profile_ids.length === 0) {
23
+ throw new Error('At least one profile must be selected');
24
+ }
25
+ if (profile_ids.length > 1000) {
26
+ throw new Error('Maximum of 1000 profiles can be removed at once');
27
+ }
28
+ const data = {
29
+ data: profile_ids.map((id) => ({
30
+ type: 'profile',
31
+ id,
32
+ })),
33
+ };
34
+ const response = yield (0, client_1.makeRequest)(auth, pieces_common_1.HttpMethod.DELETE, `/lists/${list_id}/relationships/profiles`, data);
35
+ if (!response) {
36
+ return {
37
+ success: true,
38
+ message: `Successfully removed ${profile_ids.length} profile(s) from the list`,
39
+ profiles_removed: profile_ids.length,
40
+ };
41
+ }
42
+ return response;
43
+ });
44
+ },
45
+ });
46
+ //# sourceMappingURL=remove-profile-from-list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remove-profile-from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YAED,OAAO,QAAQ,CAAC;QAClB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ export declare const subscribeProfile: 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
+ subscribe_email: import("@activepieces/pieces-framework").CheckboxProperty<false>;
5
+ subscribe_sms: import("@activepieces/pieces-framework").CheckboxProperty<false>;
6
+ historical_import: import("@activepieces/pieces-framework").CheckboxProperty<false>;
7
+ consented_at: import("@activepieces/pieces-framework").ShortTextProperty<false>;
8
+ custom_source: import("@activepieces/pieces-framework").ShortTextProperty<false>;
9
+ }>;
10
+ //# sourceMappingURL=subscribe-profile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subscribe-profile.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/subscribe-profile.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,gBAAgB;;;;;;;;EAoI3B,CAAC"}
@@ -0,0 +1,120 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.subscribeProfile = 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 client_1 = require("../common/client");
9
+ const pieces_common_1 = require("@activepieces/pieces-common");
10
+ exports.subscribeProfile = (0, pieces_framework_1.createAction)({
11
+ auth: auth_1.klaviyoAuth,
12
+ name: 'subscribeProfile',
13
+ displayName: 'Subscribe Profile',
14
+ description: 'Subscribe profiles to email or SMS marketing on a list.',
15
+ props: {
16
+ list_id: props_1.listIdDropdown,
17
+ profile_ids: props_1.profileIdsMultiSelectDropdown,
18
+ subscribe_email: pieces_framework_1.Property.Checkbox({
19
+ displayName: 'Subscribe to Email',
20
+ description: 'Subscribe selected profiles to email marketing.',
21
+ required: false,
22
+ defaultValue: true,
23
+ }),
24
+ subscribe_sms: pieces_framework_1.Property.Checkbox({
25
+ displayName: 'Subscribe to SMS',
26
+ description: 'Subscribe selected profiles to SMS marketing.',
27
+ required: false,
28
+ defaultValue: false,
29
+ }),
30
+ historical_import: pieces_framework_1.Property.Checkbox({
31
+ displayName: 'Historical Import',
32
+ description: 'Bypass double opt-in and mark as a historical import.',
33
+ required: false,
34
+ defaultValue: false,
35
+ }),
36
+ consented_at: pieces_framework_1.Property.ShortText({
37
+ displayName: 'Consent Date',
38
+ description: 'ISO 8601 datetime when consent was given (required for historical import, e.g. 2024-01-15T10:00:00Z).',
39
+ required: false,
40
+ }),
41
+ custom_source: pieces_framework_1.Property.ShortText({
42
+ displayName: 'Custom Source',
43
+ description: 'Label for the subscription source (e.g. "Website Form").',
44
+ required: false,
45
+ }),
46
+ },
47
+ run(_a) {
48
+ return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
49
+ var _b;
50
+ const { list_id, profile_ids, subscribe_email, subscribe_sms, historical_import, consented_at, custom_source, } = propsValue;
51
+ if (!profile_ids || profile_ids.length === 0) {
52
+ throw new Error('At least one profile must be selected.');
53
+ }
54
+ if (profile_ids.length > 1000) {
55
+ throw new Error('Maximum of 1000 profiles can be subscribed at once.');
56
+ }
57
+ if (!subscribe_email && !subscribe_sms) {
58
+ throw new Error('At least one subscription channel must be selected (Email or SMS).');
59
+ }
60
+ if (historical_import && !consented_at) {
61
+ throw new Error('Consent Date is required when Historical Import is enabled.');
62
+ }
63
+ // Batch-fetch profile details to include email/phone_number (required by Klaviyo)
64
+ const profileMap = yield (0, client_1.fetchProfilesByIds)(auth, profile_ids);
65
+ const profileData = profile_ids.map((profileId) => {
66
+ var _a;
67
+ const attrs = (_a = profileMap.get(profileId)) !== null && _a !== void 0 ? _a : {};
68
+ const subscriptions = {};
69
+ if (subscribe_email) {
70
+ subscriptions.email = { marketing: { consent: 'SUBSCRIBED' } };
71
+ if (historical_import && consented_at) {
72
+ subscriptions.email.marketing.consented_at = consented_at;
73
+ }
74
+ }
75
+ if (subscribe_sms) {
76
+ subscriptions.sms = { marketing: { consent: 'SUBSCRIBED' } };
77
+ if (historical_import && consented_at) {
78
+ subscriptions.sms.marketing.consented_at = consented_at;
79
+ }
80
+ }
81
+ const profileAttrs = { subscriptions };
82
+ if (subscribe_email && attrs.email)
83
+ profileAttrs.email = attrs.email;
84
+ if (subscribe_sms && attrs.phone_number)
85
+ profileAttrs.phone_number = attrs.phone_number;
86
+ return { type: 'profile', id: profileId, attributes: profileAttrs };
87
+ });
88
+ const requestBody = {
89
+ data: {
90
+ type: 'profile-subscription-bulk-create-job',
91
+ attributes: {
92
+ profiles: { data: profileData },
93
+ },
94
+ },
95
+ };
96
+ if (list_id) {
97
+ requestBody.data.relationships = {
98
+ list: { data: { type: 'list', id: list_id } },
99
+ };
100
+ }
101
+ if (custom_source) {
102
+ requestBody.data.attributes.custom_source = custom_source;
103
+ }
104
+ if (historical_import) {
105
+ requestBody.data.attributes.historical_import = true;
106
+ }
107
+ const response = yield (0, client_1.makeRequest)(auth, pieces_common_1.HttpMethod.POST, '/profile-subscription-bulk-create-jobs', requestBody);
108
+ return {
109
+ success: true,
110
+ job_id: (_b = response === null || response === void 0 ? void 0 : response.data) === null || _b === void 0 ? void 0 : _b.id,
111
+ profiles_count: profileData.length,
112
+ list_id: list_id || null,
113
+ subscribed_email: subscribe_email !== null && subscribe_email !== void 0 ? subscribe_email : false,
114
+ subscribed_sms: subscribe_sms !== null && subscribe_sms !== void 0 ? subscribe_sms : false,
115
+ historical_import: historical_import !== null && historical_import !== void 0 ? historical_import : false,
116
+ };
117
+ });
118
+ },
119
+ });
120
+ //# sourceMappingURL=subscribe-profile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subscribe-profile.js","sourceRoot":"","sources":["../../../../src/lib/actions/subscribe-profile.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,yCAA+D;AAC/D,2CAAgF;AAChF,6CAAmE;AACnE,+DAAyD;AAE5C,QAAA,gBAAgB,GAAG,IAAA,+BAAY,EAAC;IAC3C,IAAI,EAAE,kBAAW;IACjB,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,mBAAmB;IAChC,WAAW,EAAE,yDAAyD;IACtE,KAAK,EAAE;QACL,OAAO,EAAE,sBAAc;QACvB,WAAW,EAAE,qCAA6B;QAC1C,eAAe,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACjC,WAAW,EAAE,oBAAoB;YACjC,WAAW,EAAE,iDAAiD;YAC9D,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,IAAI;SACnB,CAAC;QACF,aAAa,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC/B,WAAW,EAAE,kBAAkB;YAC/B,WAAW,EAAE,+CAA+C;YAC5D,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,KAAK;SACpB,CAAC;QACF,iBAAiB,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACnC,WAAW,EAAE,mBAAmB;YAChC,WAAW,EAAE,uDAAuD;YACpE,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,KAAK;SACpB,CAAC;QACF,YAAY,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC/B,WAAW,EAAE,cAAc;YAC3B,WAAW,EACT,uGAAuG;YACzG,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,aAAa,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAChC,WAAW,EAAE,eAAe;YAC5B,WAAW,EAAE,0DAA0D;YAC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YACvD,CAAC;YAED,MAAM,QAAQ,GAAG,MAAM,IAAA,oBAAW,EAChC,IAAmC,EACnC,0BAAU,CAAC,IAAI,EACf,wCAAwC,EACxC,WAAW,CACZ,CAAC;YAEF,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,MAAM,EAAE,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI,0CAAE,EAAE;gBAC1B,cAAc,EAAE,WAAW,CAAC,MAAM;gBAClC,OAAO,EAAE,OAAO,IAAI,IAAI;gBACxB,gBAAgB,EAAE,eAAe,aAAf,eAAe,cAAf,eAAe,GAAI,KAAK;gBAC1C,cAAc,EAAE,aAAa,aAAb,aAAa,cAAb,aAAa,GAAI,KAAK;gBACtC,iBAAiB,EAAE,iBAAiB,aAAjB,iBAAiB,cAAjB,iBAAiB,GAAI,KAAK;aAC9C,CAAC;QACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ export declare const unsubscribeProfile: 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
+ unsubscribe_email: import("@activepieces/pieces-framework").CheckboxProperty<false>;
5
+ unsubscribe_sms: import("@activepieces/pieces-framework").CheckboxProperty<false>;
6
+ unsubscribe_sms_transactional: import("@activepieces/pieces-framework").CheckboxProperty<false>;
7
+ }>;
8
+ //# sourceMappingURL=unsubscribe-profile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unsubscribe-profile.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/unsubscribe-profile.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,kBAAkB;;;;;;EA2H7B,CAAC"}
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.unsubscribeProfile = 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 client_1 = require("../common/client");
9
+ const pieces_common_1 = require("@activepieces/pieces-common");
10
+ exports.unsubscribeProfile = (0, pieces_framework_1.createAction)({
11
+ auth: auth_1.klaviyoAuth,
12
+ name: 'unsubscribeProfile',
13
+ displayName: 'Unsubscribe Profile',
14
+ description: 'Unsubscribe profiles from email or SMS marketing on a list.',
15
+ props: {
16
+ list_id: props_1.listIdDropdown,
17
+ profile_ids: props_1.profileIdsMultiSelectDropdown,
18
+ unsubscribe_email: pieces_framework_1.Property.Checkbox({
19
+ displayName: 'Unsubscribe from Email',
20
+ description: 'Unsubscribe selected profiles from email marketing.',
21
+ required: false,
22
+ defaultValue: true,
23
+ }),
24
+ unsubscribe_sms: pieces_framework_1.Property.Checkbox({
25
+ displayName: 'Unsubscribe from SMS',
26
+ description: 'Unsubscribe selected profiles from SMS marketing.',
27
+ required: false,
28
+ defaultValue: false,
29
+ }),
30
+ unsubscribe_sms_transactional: pieces_framework_1.Property.Checkbox({
31
+ displayName: 'Unsubscribe from SMS Transactional',
32
+ description: 'Unsubscribe selected profiles from SMS transactional messages.',
33
+ required: false,
34
+ defaultValue: false,
35
+ }),
36
+ },
37
+ run(_a) {
38
+ return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
39
+ var _b;
40
+ const { list_id, profile_ids, unsubscribe_email, unsubscribe_sms, unsubscribe_sms_transactional, } = propsValue;
41
+ if (!profile_ids || profile_ids.length === 0) {
42
+ throw new Error('At least one profile must be selected.');
43
+ }
44
+ if (profile_ids.length > 100) {
45
+ throw new Error('Maximum of 100 profiles can be unsubscribed at once.');
46
+ }
47
+ if (!unsubscribe_email &&
48
+ !unsubscribe_sms &&
49
+ !unsubscribe_sms_transactional) {
50
+ throw new Error('At least one unsubscribe channel must be selected.');
51
+ }
52
+ // Fetch profile details to include email/phone_number
53
+ const profileDetails = yield Promise.all(profile_ids.map((id) => (0, client_1.makeRequest)(auth, pieces_common_1.HttpMethod.GET, `/profiles/${id}`, {})));
54
+ const profileData = profile_ids.map((profileId, index) => {
55
+ var _a, _b, _c;
56
+ const attrs = (_c = (_b = (_a = profileDetails[index]) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.attributes) !== null && _c !== void 0 ? _c : {};
57
+ const subscriptions = {};
58
+ if (unsubscribe_email) {
59
+ subscriptions.email = { marketing: { consent: 'UNSUBSCRIBED' } };
60
+ }
61
+ if (unsubscribe_sms) {
62
+ subscriptions.sms = subscriptions.sms || {};
63
+ subscriptions.sms.marketing = { consent: 'UNSUBSCRIBED' };
64
+ }
65
+ if (unsubscribe_sms_transactional) {
66
+ subscriptions.sms = subscriptions.sms || {};
67
+ subscriptions.sms.transactional = { consent: 'UNSUBSCRIBED' };
68
+ }
69
+ const profileAttrs = { subscriptions };
70
+ if (unsubscribe_email && attrs.email)
71
+ profileAttrs.email = attrs.email;
72
+ if ((unsubscribe_sms || unsubscribe_sms_transactional) &&
73
+ attrs.phone_number) {
74
+ profileAttrs.phone_number = attrs.phone_number;
75
+ }
76
+ return { type: 'profile', id: profileId, attributes: profileAttrs };
77
+ });
78
+ const requestBody = {
79
+ data: {
80
+ type: 'profile-subscription-bulk-delete-job',
81
+ attributes: {
82
+ profiles: { data: profileData },
83
+ },
84
+ },
85
+ };
86
+ if (list_id) {
87
+ requestBody.data.relationships = {
88
+ list: { data: { type: 'list', id: list_id } },
89
+ };
90
+ }
91
+ const response = yield (0, client_1.makeRequest)(auth, pieces_common_1.HttpMethod.POST, '/profile-subscription-bulk-delete-jobs', requestBody);
92
+ return {
93
+ success: true,
94
+ job_id: (_b = response === null || response === void 0 ? void 0 : response.data) === null || _b === void 0 ? void 0 : _b.id,
95
+ profiles_count: profileData.length,
96
+ list_id: list_id || null,
97
+ unsubscribed_email: unsubscribe_email !== null && unsubscribe_email !== void 0 ? unsubscribe_email : false,
98
+ unsubscribed_sms: unsubscribe_sms !== null && unsubscribe_sms !== void 0 ? unsubscribe_sms : false,
99
+ unsubscribed_sms_transactional: unsubscribe_sms_transactional !== null && unsubscribe_sms_transactional !== void 0 ? unsubscribe_sms_transactional : false,
100
+ };
101
+ });
102
+ },
103
+ });
104
+ //# sourceMappingURL=unsubscribe-profile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unsubscribe-profile.js","sourceRoot":"","sources":["../../../../src/lib/actions/unsubscribe-profile.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,yCAA+D;AAC/D,2CAAgF;AAChF,6CAA+C;AAC/C,+DAAyD;AAE5C,QAAA,kBAAkB,GAAG,IAAA,+BAAY,EAAC;IAC7C,IAAI,EAAE,kBAAW;IACjB,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,qBAAqB;IAClC,WAAW,EAAE,6DAA6D;IAC1E,KAAK,EAAE;QACL,OAAO,EAAE,sBAAc;QACvB,WAAW,EAAE,qCAA6B;QAC1C,iBAAiB,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACnC,WAAW,EAAE,wBAAwB;YACrC,WAAW,EAAE,qDAAqD;YAClE,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,IAAI;SACnB,CAAC;QACF,eAAe,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACjC,WAAW,EAAE,sBAAsB;YACnC,WAAW,EAAE,mDAAmD;YAChE,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,KAAK;SACpB,CAAC;QACF,6BAA6B,EAAE,2BAAQ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C;YAED,MAAM,QAAQ,GAAG,MAAM,IAAA,oBAAW,EAChC,IAAmC,EACnC,0BAAU,CAAC,IAAI,EACf,wCAAwC,EACxC,WAAW,CACZ,CAAC;YAEF,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,MAAM,EAAE,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI,0CAAE,EAAE;gBAC1B,cAAc,EAAE,WAAW,CAAC,MAAM;gBAClC,OAAO,EAAE,OAAO,IAAI,IAAI;gBACxB,kBAAkB,EAAE,iBAAiB,aAAjB,iBAAiB,cAAjB,iBAAiB,GAAI,KAAK;gBAC9C,gBAAgB,EAAE,eAAe,aAAf,eAAe,cAAf,eAAe,GAAI,KAAK;gBAC1C,8BAA8B,EAAE,6BAA6B,aAA7B,6BAA6B,cAA7B,6BAA6B,GAAI,KAAK;aACvE,CAAC;QACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,27 @@
1
+ export declare const updateProfile: import("@activepieces/pieces-framework").IAction<(import("@activepieces/pieces-framework").SecretTextProperty<true> | import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>)[], {
2
+ profile_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
+ email: import("@activepieces/pieces-framework").ShortTextProperty<false>;
4
+ phone_number: import("@activepieces/pieces-framework").ShortTextProperty<false>;
5
+ external_id: import("@activepieces/pieces-framework").ShortTextProperty<false>;
6
+ anonymous_id: import("@activepieces/pieces-framework").ShortTextProperty<false>;
7
+ first_name: import("@activepieces/pieces-framework").ShortTextProperty<false>;
8
+ last_name: import("@activepieces/pieces-framework").ShortTextProperty<false>;
9
+ organization: import("@activepieces/pieces-framework").ShortTextProperty<false>;
10
+ locale: import("@activepieces/pieces-framework").ShortTextProperty<false>;
11
+ title: import("@activepieces/pieces-framework").ShortTextProperty<false>;
12
+ image: import("@activepieces/pieces-framework").ShortTextProperty<false>;
13
+ address1: import("@activepieces/pieces-framework").ShortTextProperty<false>;
14
+ address2: import("@activepieces/pieces-framework").ShortTextProperty<false>;
15
+ city: import("@activepieces/pieces-framework").ShortTextProperty<false>;
16
+ country: import("@activepieces/pieces-framework").ShortTextProperty<false>;
17
+ region: import("@activepieces/pieces-framework").ShortTextProperty<false>;
18
+ zip: import("@activepieces/pieces-framework").ShortTextProperty<false>;
19
+ timezone: import("@activepieces/pieces-framework").ShortTextProperty<false>;
20
+ ip: import("@activepieces/pieces-framework").ShortTextProperty<false>;
21
+ latitude: import("@activepieces/pieces-framework").NumberProperty<false>;
22
+ longitude: import("@activepieces/pieces-framework").NumberProperty<false>;
23
+ custom_properties: import("@activepieces/pieces-framework").ObjectProperty<false>;
24
+ include_subscriptions: import("@activepieces/pieces-framework").CheckboxProperty<false>;
25
+ include_predictive_analytics: import("@activepieces/pieces-framework").CheckboxProperty<false>;
26
+ }>;
27
+ //# sourceMappingURL=update-profile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-profile.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/update-profile.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;EAqOxB,CAAC"}