@activepieces/piece-klaviyo 0.1.2 → 0.1.4
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,52 +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
|
-
audience: 'both',
|
|
16
|
-
aiMetadata: {
|
|
17
|
-
description: 'Removes one or more profiles (by profile ID) from a Klaviyo list, ending their membership without changing subscription consent. Use to take profiles off a list; requires a list ID and at least one profile ID (max 1000 per call). Idempotent, since removing a profile that is not a member is a no-op.',
|
|
18
|
-
idempotent: true,
|
|
19
|
-
},
|
|
20
|
-
props: {
|
|
21
|
-
list_id: props_1.listIdDropdown,
|
|
22
|
-
profile_ids: props_1.profileIdsMultiSelectDropdown,
|
|
23
|
-
},
|
|
24
|
-
run(_a) {
|
|
25
|
-
return tslib_1.__awaiter(this, arguments, void 0, function* ({ propsValue, auth }) {
|
|
26
|
-
const { list_id, profile_ids: rawProfileIds } = propsValue;
|
|
27
|
-
const profile_ids = (0, client_1.normalizeProfileIds)(rawProfileIds);
|
|
28
|
-
if (!profile_ids || profile_ids.length === 0) {
|
|
29
|
-
throw new Error('At least one profile must be selected');
|
|
30
|
-
}
|
|
31
|
-
if (profile_ids.length > 1000) {
|
|
32
|
-
throw new Error('Maximum of 1000 profiles can be removed at once');
|
|
33
|
-
}
|
|
34
|
-
const data = {
|
|
35
|
-
data: profile_ids.map((id) => ({
|
|
36
|
-
type: 'profile',
|
|
37
|
-
id,
|
|
38
|
-
})),
|
|
39
|
-
};
|
|
40
|
-
const response = yield (0, client_1.makeRequest)(auth, pieces_common_1.HttpMethod.DELETE, `/lists/${list_id}/relationships/profiles`, data);
|
|
41
|
-
if (!response) {
|
|
42
|
-
return {
|
|
43
|
-
success: true,
|
|
44
|
-
message: `Successfully removed ${profile_ids.length} profile(s) from the list`,
|
|
45
|
-
profiles_removed: profile_ids.length,
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
return response;
|
|
49
|
-
});
|
|
50
|
-
},
|
|
51
|
-
});
|
|
52
|
-
//# 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;AACzD,6CAAoE;AAEvD,QAAA,qBAAqB,GAAG,IAAA,+BAAY,EAAC;IAChD,IAAI,EAAE,kBAAW;IACjB,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EAAE,0BAA0B;IACvC,WAAW,EAAE,uCAAuC;IACpD,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EAAE,6SAA6S;QAC1T,UAAU,EAAE,IAAI;KACjB;IACD,KAAK,EAAE;QACL,OAAO,EAAE,sBAAc;QACvB,WAAW,EAAE,qCAA6B;KAC3C;IACK,GAAG;qEAAC,EAAE,UAAU,EAAE,IAAI,EAAE;YAC5B,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,GAAG,UAAU,CAAC;YAC3D,MAAM,WAAW,GAAG,IAAA,4BAAmB,EAAC,aAAa,CAAC,CAAC;YAEvD,IAAI,CAAC,WAAW,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC7C,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;YAC3D,CAAC;YAED,IAAI,WAAW,CAAC,MAAM,GAAG,IAAI,EAAE,CAAC;gBAC9B,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;YACrE,CAAC;YAED,MAAM,IAAI,GAAG;gBACX,IAAI,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,EAAU,EAAE,EAAE,CAAC,CAAC;oBACrC,IAAI,EAAE,SAAS;oBACf,EAAE;iBACH,CAAC,CAAC;aACJ,CAAC;YAEF,MAAM,QAAQ,GAAG,MAAM,IAAA,oBAAW,EAChC,IAAwB,EACxB,0BAAU,CAAC,MAAM,EACjB,UAAU,OAAO,yBAAyB,EAC1C,IAAI,CACL,CAAC;YAEF,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACd,OAAO;oBACL,OAAO,EAAE,IAAI;oBACb,OAAO,EAAE,wBAAwB,WAAW,CAAC,MAAM,2BAA2B;oBAC9E,gBAAgB,EAAE,WAAW,CAAC,MAAM;iBACrC,CAAC;YACJ,CAAC;YAED,OAAO,QAAQ,CAAC;QAClB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"subscribe-profile.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/subscribe-profile.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,gBAAgB;;;;;;;;EA0I3B,CAAC"}
|
|
@@ -1,126 +0,0 @@
|
|
|
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
|
-
audience: 'both',
|
|
16
|
-
aiMetadata: {
|
|
17
|
-
description: 'Opts profiles in to email and/or SMS marketing consent via a bulk subscription job, optionally scoped to a list. At least one channel must be selected; enabling historical import bypasses double opt-in and requires a consent date. Use this for consent changes rather than Add Profile to List (which only sets membership). Not idempotent: each call queues a new subscription job (max 1000 profiles).',
|
|
18
|
-
idempotent: false,
|
|
19
|
-
},
|
|
20
|
-
props: {
|
|
21
|
-
list_id: props_1.listIdDropdown,
|
|
22
|
-
profile_ids: props_1.profileIdsMultiSelectDropdown,
|
|
23
|
-
subscribe_email: pieces_framework_1.Property.Checkbox({
|
|
24
|
-
displayName: 'Subscribe to Email',
|
|
25
|
-
description: 'Subscribe selected profiles to email marketing.',
|
|
26
|
-
required: false,
|
|
27
|
-
defaultValue: true,
|
|
28
|
-
}),
|
|
29
|
-
subscribe_sms: pieces_framework_1.Property.Checkbox({
|
|
30
|
-
displayName: 'Subscribe to SMS',
|
|
31
|
-
description: 'Subscribe selected profiles to SMS marketing.',
|
|
32
|
-
required: false,
|
|
33
|
-
defaultValue: false,
|
|
34
|
-
}),
|
|
35
|
-
historical_import: pieces_framework_1.Property.Checkbox({
|
|
36
|
-
displayName: 'Historical Import',
|
|
37
|
-
description: 'Bypass double opt-in and mark as a historical import.',
|
|
38
|
-
required: false,
|
|
39
|
-
defaultValue: false,
|
|
40
|
-
}),
|
|
41
|
-
consented_at: pieces_framework_1.Property.ShortText({
|
|
42
|
-
displayName: 'Consent Date',
|
|
43
|
-
description: 'ISO 8601 datetime when consent was given (required for historical import, e.g. 2024-01-15T10:00:00Z).',
|
|
44
|
-
required: false,
|
|
45
|
-
}),
|
|
46
|
-
custom_source: pieces_framework_1.Property.ShortText({
|
|
47
|
-
displayName: 'Custom Source',
|
|
48
|
-
description: 'Label for the subscription source (e.g. "Website Form").',
|
|
49
|
-
required: false,
|
|
50
|
-
}),
|
|
51
|
-
},
|
|
52
|
-
run(_a) {
|
|
53
|
-
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
|
|
54
|
-
var _b;
|
|
55
|
-
const { list_id, profile_ids: rawProfileIds, subscribe_email, subscribe_sms, historical_import, consented_at, custom_source, } = propsValue;
|
|
56
|
-
const profile_ids = (0, client_1.normalizeProfileIds)(rawProfileIds);
|
|
57
|
-
if (!profile_ids || profile_ids.length === 0) {
|
|
58
|
-
throw new Error('At least one profile must be selected.');
|
|
59
|
-
}
|
|
60
|
-
if (profile_ids.length > 1000) {
|
|
61
|
-
throw new Error('Maximum of 1000 profiles can be subscribed at once.');
|
|
62
|
-
}
|
|
63
|
-
if (!subscribe_email && !subscribe_sms) {
|
|
64
|
-
throw new Error('At least one subscription channel must be selected (Email or SMS).');
|
|
65
|
-
}
|
|
66
|
-
if (historical_import && !consented_at) {
|
|
67
|
-
throw new Error('Consent Date is required when Historical Import is enabled.');
|
|
68
|
-
}
|
|
69
|
-
// Batch-fetch profile details to include email/phone_number (required by Klaviyo)
|
|
70
|
-
const profileMap = yield (0, client_1.fetchProfilesByIds)(auth, profile_ids);
|
|
71
|
-
const profileData = profile_ids.map((profileId) => {
|
|
72
|
-
var _a;
|
|
73
|
-
const attrs = (_a = profileMap.get(profileId)) !== null && _a !== void 0 ? _a : {};
|
|
74
|
-
const subscriptions = {};
|
|
75
|
-
if (subscribe_email) {
|
|
76
|
-
subscriptions.email = { marketing: { consent: 'SUBSCRIBED' } };
|
|
77
|
-
if (historical_import && consented_at) {
|
|
78
|
-
subscriptions.email.marketing.consented_at = consented_at;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
if (subscribe_sms) {
|
|
82
|
-
subscriptions.sms = { marketing: { consent: 'SUBSCRIBED' } };
|
|
83
|
-
if (historical_import && consented_at) {
|
|
84
|
-
subscriptions.sms.marketing.consented_at = consented_at;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
const profileAttrs = { subscriptions };
|
|
88
|
-
if (subscribe_email && attrs.email)
|
|
89
|
-
profileAttrs.email = attrs.email;
|
|
90
|
-
if (subscribe_sms && attrs.phone_number)
|
|
91
|
-
profileAttrs.phone_number = attrs.phone_number;
|
|
92
|
-
return { type: 'profile', id: profileId, attributes: profileAttrs };
|
|
93
|
-
});
|
|
94
|
-
const requestBody = {
|
|
95
|
-
data: {
|
|
96
|
-
type: 'profile-subscription-bulk-create-job',
|
|
97
|
-
attributes: {
|
|
98
|
-
profiles: { data: profileData },
|
|
99
|
-
},
|
|
100
|
-
},
|
|
101
|
-
};
|
|
102
|
-
if (list_id) {
|
|
103
|
-
requestBody.data.relationships = {
|
|
104
|
-
list: { data: { type: 'list', id: list_id } },
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
if (custom_source) {
|
|
108
|
-
requestBody.data.attributes.custom_source = custom_source;
|
|
109
|
-
}
|
|
110
|
-
if (historical_import) {
|
|
111
|
-
requestBody.data.attributes.historical_import = true;
|
|
112
|
-
}
|
|
113
|
-
const response = yield (0, client_1.makeRequest)(auth, pieces_common_1.HttpMethod.POST, '/profile-subscription-bulk-create-jobs', requestBody);
|
|
114
|
-
return {
|
|
115
|
-
success: true,
|
|
116
|
-
job_id: (_b = response === null || response === void 0 ? void 0 : response.data) === null || _b === void 0 ? void 0 : _b.id,
|
|
117
|
-
profiles_count: profileData.length,
|
|
118
|
-
list_id: list_id || null,
|
|
119
|
-
subscribed_email: subscribe_email !== null && subscribe_email !== void 0 ? subscribe_email : false,
|
|
120
|
-
subscribed_sms: subscribe_sms !== null && subscribe_sms !== void 0 ? subscribe_sms : false,
|
|
121
|
-
historical_import: historical_import !== null && historical_import !== void 0 ? historical_import : false,
|
|
122
|
-
};
|
|
123
|
-
});
|
|
124
|
-
},
|
|
125
|
-
});
|
|
126
|
-
//# sourceMappingURL=subscribe-profile.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,6CAAwF;AACxF,+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,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EAAE,gZAAgZ;QAC7Z,UAAU,EAAE,KAAK;KAClB;IACD,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,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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
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"unsubscribe-profile.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/unsubscribe-profile.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,kBAAkB;;;;;;EAiI7B,CAAC"}
|
|
@@ -1,110 +0,0 @@
|
|
|
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
|
-
audience: 'both',
|
|
16
|
-
aiMetadata: {
|
|
17
|
-
description: 'Opts profiles out of email, SMS, and/or SMS transactional consent via a bulk unsubscribe job, optionally scoped to a list. At least one channel must be selected. Use to revoke marketing consent; not idempotent, since each call queues a new unsubscribe job (max 100 profiles).',
|
|
18
|
-
idempotent: false,
|
|
19
|
-
},
|
|
20
|
-
props: {
|
|
21
|
-
list_id: props_1.listIdDropdown,
|
|
22
|
-
profile_ids: props_1.profileIdsMultiSelectDropdown,
|
|
23
|
-
unsubscribe_email: pieces_framework_1.Property.Checkbox({
|
|
24
|
-
displayName: 'Unsubscribe from Email',
|
|
25
|
-
description: 'Unsubscribe selected profiles from email marketing.',
|
|
26
|
-
required: false,
|
|
27
|
-
defaultValue: true,
|
|
28
|
-
}),
|
|
29
|
-
unsubscribe_sms: pieces_framework_1.Property.Checkbox({
|
|
30
|
-
displayName: 'Unsubscribe from SMS',
|
|
31
|
-
description: 'Unsubscribe selected profiles from SMS marketing.',
|
|
32
|
-
required: false,
|
|
33
|
-
defaultValue: false,
|
|
34
|
-
}),
|
|
35
|
-
unsubscribe_sms_transactional: pieces_framework_1.Property.Checkbox({
|
|
36
|
-
displayName: 'Unsubscribe from SMS Transactional',
|
|
37
|
-
description: 'Unsubscribe selected profiles from SMS transactional messages.',
|
|
38
|
-
required: false,
|
|
39
|
-
defaultValue: false,
|
|
40
|
-
}),
|
|
41
|
-
},
|
|
42
|
-
run(_a) {
|
|
43
|
-
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
|
|
44
|
-
var _b;
|
|
45
|
-
const { list_id, profile_ids: rawProfileIds, unsubscribe_email, unsubscribe_sms, unsubscribe_sms_transactional, } = propsValue;
|
|
46
|
-
const profile_ids = (0, client_1.normalizeProfileIds)(rawProfileIds);
|
|
47
|
-
if (!profile_ids || profile_ids.length === 0) {
|
|
48
|
-
throw new Error('At least one profile must be selected.');
|
|
49
|
-
}
|
|
50
|
-
if (profile_ids.length > 100) {
|
|
51
|
-
throw new Error('Maximum of 100 profiles can be unsubscribed at once.');
|
|
52
|
-
}
|
|
53
|
-
if (!unsubscribe_email &&
|
|
54
|
-
!unsubscribe_sms &&
|
|
55
|
-
!unsubscribe_sms_transactional) {
|
|
56
|
-
throw new Error('At least one unsubscribe channel must be selected.');
|
|
57
|
-
}
|
|
58
|
-
// Fetch profile details to include email/phone_number
|
|
59
|
-
const profileDetails = yield Promise.all(profile_ids.map((id) => (0, client_1.makeRequest)(auth, pieces_common_1.HttpMethod.GET, `/profiles/${id}`, {})));
|
|
60
|
-
const profileData = profile_ids.map((profileId, index) => {
|
|
61
|
-
var _a, _b, _c;
|
|
62
|
-
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 : {};
|
|
63
|
-
const subscriptions = {};
|
|
64
|
-
if (unsubscribe_email) {
|
|
65
|
-
subscriptions.email = { marketing: { consent: 'UNSUBSCRIBED' } };
|
|
66
|
-
}
|
|
67
|
-
if (unsubscribe_sms) {
|
|
68
|
-
subscriptions.sms = subscriptions.sms || {};
|
|
69
|
-
subscriptions.sms.marketing = { consent: 'UNSUBSCRIBED' };
|
|
70
|
-
}
|
|
71
|
-
if (unsubscribe_sms_transactional) {
|
|
72
|
-
subscriptions.sms = subscriptions.sms || {};
|
|
73
|
-
subscriptions.sms.transactional = { consent: 'UNSUBSCRIBED' };
|
|
74
|
-
}
|
|
75
|
-
const profileAttrs = { subscriptions };
|
|
76
|
-
if (unsubscribe_email && attrs.email)
|
|
77
|
-
profileAttrs.email = attrs.email;
|
|
78
|
-
if ((unsubscribe_sms || unsubscribe_sms_transactional) &&
|
|
79
|
-
attrs.phone_number) {
|
|
80
|
-
profileAttrs.phone_number = attrs.phone_number;
|
|
81
|
-
}
|
|
82
|
-
return { type: 'profile', id: profileId, attributes: profileAttrs };
|
|
83
|
-
});
|
|
84
|
-
const requestBody = {
|
|
85
|
-
data: {
|
|
86
|
-
type: 'profile-subscription-bulk-delete-job',
|
|
87
|
-
attributes: {
|
|
88
|
-
profiles: { data: profileData },
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
};
|
|
92
|
-
if (list_id) {
|
|
93
|
-
requestBody.data.relationships = {
|
|
94
|
-
list: { data: { type: 'list', id: list_id } },
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
const response = yield (0, client_1.makeRequest)(auth, pieces_common_1.HttpMethod.POST, '/profile-subscription-bulk-delete-jobs', requestBody);
|
|
98
|
-
return {
|
|
99
|
-
success: true,
|
|
100
|
-
job_id: (_b = response === null || response === void 0 ? void 0 : response.data) === null || _b === void 0 ? void 0 : _b.id,
|
|
101
|
-
profiles_count: profileData.length,
|
|
102
|
-
list_id: list_id || null,
|
|
103
|
-
unsubscribed_email: unsubscribe_email !== null && unsubscribe_email !== void 0 ? unsubscribe_email : false,
|
|
104
|
-
unsubscribed_sms: unsubscribe_sms !== null && unsubscribe_sms !== void 0 ? unsubscribe_sms : false,
|
|
105
|
-
unsubscribed_sms_transactional: unsubscribe_sms_transactional !== null && unsubscribe_sms_transactional !== void 0 ? unsubscribe_sms_transactional : false,
|
|
106
|
-
};
|
|
107
|
-
});
|
|
108
|
-
},
|
|
109
|
-
});
|
|
110
|
-
//# sourceMappingURL=unsubscribe-profile.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,6CAAoE;AACpE,+DAAyD;AAE5C,QAAA,kBAAkB,GAAG,IAAA,+BAAY,EAAC;IAC7C,IAA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,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,27 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update-profile.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/update-profile.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;EA0OxB,CAAC"}
|
|
@@ -1,221 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateProfile = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const props_1 = require("../common/props");
|
|
7
|
-
const auth_1 = require("../common/auth");
|
|
8
|
-
const client_1 = require("../common/client");
|
|
9
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
10
|
-
exports.updateProfile = (0, pieces_framework_1.createAction)({
|
|
11
|
-
auth: auth_1.klaviyoAuth,
|
|
12
|
-
name: 'updateProfile',
|
|
13
|
-
displayName: 'Update Profile',
|
|
14
|
-
description: 'Update existing profile data and preferences.',
|
|
15
|
-
audience: 'both',
|
|
16
|
-
aiMetadata: {
|
|
17
|
-
description: 'Updates an existing Klaviyo profile by its profile ID, overwriting only the supplied identity, location, and custom-property fields. Use when modifying a known profile; the profile ID is required, so resolve it first (e.g. via Find Profile by Email/Phone). Idempotent: re-running with the same input leaves the profile in the same state.',
|
|
18
|
-
idempotent: true,
|
|
19
|
-
},
|
|
20
|
-
props: {
|
|
21
|
-
profile_id: props_1.profileIdDropdown,
|
|
22
|
-
email: pieces_framework_1.Property.ShortText({
|
|
23
|
-
displayName: 'Email',
|
|
24
|
-
description: "Individual's email address",
|
|
25
|
-
required: false,
|
|
26
|
-
}),
|
|
27
|
-
phone_number: pieces_framework_1.Property.ShortText({
|
|
28
|
-
displayName: 'Phone Number',
|
|
29
|
-
description: 'Phone number in E.164 format (e.g., +15005550006)',
|
|
30
|
-
required: false,
|
|
31
|
-
}),
|
|
32
|
-
external_id: pieces_framework_1.Property.ShortText({
|
|
33
|
-
displayName: 'External ID',
|
|
34
|
-
description: 'Unique identifier from external system (e.g., POS system)',
|
|
35
|
-
required: false,
|
|
36
|
-
}),
|
|
37
|
-
anonymous_id: pieces_framework_1.Property.ShortText({
|
|
38
|
-
displayName: 'Anonymous ID',
|
|
39
|
-
description: 'Anonymous identifier for the profile',
|
|
40
|
-
required: false,
|
|
41
|
-
}),
|
|
42
|
-
first_name: pieces_framework_1.Property.ShortText({
|
|
43
|
-
displayName: 'First Name',
|
|
44
|
-
description: "Individual's first name",
|
|
45
|
-
required: false,
|
|
46
|
-
}),
|
|
47
|
-
last_name: pieces_framework_1.Property.ShortText({
|
|
48
|
-
displayName: 'Last Name',
|
|
49
|
-
description: "Individual's last name",
|
|
50
|
-
required: false,
|
|
51
|
-
}),
|
|
52
|
-
organization: pieces_framework_1.Property.ShortText({
|
|
53
|
-
displayName: 'Organization',
|
|
54
|
-
description: 'Company or organization name',
|
|
55
|
-
required: false,
|
|
56
|
-
}),
|
|
57
|
-
locale: pieces_framework_1.Property.ShortText({
|
|
58
|
-
displayName: 'Locale',
|
|
59
|
-
description: 'Locale in IETF BCP 47 format (e.g., en-US)',
|
|
60
|
-
required: false,
|
|
61
|
-
}),
|
|
62
|
-
title: pieces_framework_1.Property.ShortText({
|
|
63
|
-
displayName: 'Title',
|
|
64
|
-
description: "Individual's job title",
|
|
65
|
-
required: false,
|
|
66
|
-
}),
|
|
67
|
-
image: pieces_framework_1.Property.ShortText({
|
|
68
|
-
displayName: 'Image URL',
|
|
69
|
-
description: 'URL pointing to profile image location',
|
|
70
|
-
required: false,
|
|
71
|
-
}),
|
|
72
|
-
// Location fields
|
|
73
|
-
address1: pieces_framework_1.Property.ShortText({
|
|
74
|
-
displayName: 'Address 1',
|
|
75
|
-
description: 'First line of street address',
|
|
76
|
-
required: false,
|
|
77
|
-
}),
|
|
78
|
-
address2: pieces_framework_1.Property.ShortText({
|
|
79
|
-
displayName: 'Address 2',
|
|
80
|
-
description: 'Second line of street address',
|
|
81
|
-
required: false,
|
|
82
|
-
}),
|
|
83
|
-
city: pieces_framework_1.Property.ShortText({
|
|
84
|
-
displayName: 'City',
|
|
85
|
-
description: 'City name',
|
|
86
|
-
required: false,
|
|
87
|
-
}),
|
|
88
|
-
country: props_1.countryCode,
|
|
89
|
-
region: pieces_framework_1.Property.ShortText({
|
|
90
|
-
displayName: 'Region',
|
|
91
|
-
description: 'Region within country (state/province)',
|
|
92
|
-
required: false,
|
|
93
|
-
}),
|
|
94
|
-
zip: pieces_framework_1.Property.ShortText({
|
|
95
|
-
displayName: 'Zip Code',
|
|
96
|
-
description: 'Postal/zip code',
|
|
97
|
-
required: false,
|
|
98
|
-
}),
|
|
99
|
-
timezone: pieces_framework_1.Property.ShortText({
|
|
100
|
-
displayName: 'Timezone',
|
|
101
|
-
description: 'IANA timezone (e.g., America/New_York)',
|
|
102
|
-
required: false,
|
|
103
|
-
}),
|
|
104
|
-
ip: pieces_framework_1.Property.ShortText({
|
|
105
|
-
displayName: 'IP Address',
|
|
106
|
-
description: 'IP address of the profile',
|
|
107
|
-
required: false,
|
|
108
|
-
}),
|
|
109
|
-
latitude: pieces_framework_1.Property.Number({
|
|
110
|
-
displayName: 'Latitude',
|
|
111
|
-
description: 'Latitude coordinate (4 decimal places recommended)',
|
|
112
|
-
required: false,
|
|
113
|
-
}),
|
|
114
|
-
longitude: pieces_framework_1.Property.Number({
|
|
115
|
-
displayName: 'Longitude',
|
|
116
|
-
description: 'Longitude coordinate (4 decimal places recommended)',
|
|
117
|
-
required: false,
|
|
118
|
-
}),
|
|
119
|
-
custom_properties: pieces_framework_1.Property.Object({
|
|
120
|
-
displayName: 'Custom Properties',
|
|
121
|
-
description: 'Key/value pairs for custom profile properties',
|
|
122
|
-
required: false,
|
|
123
|
-
}),
|
|
124
|
-
include_subscriptions: pieces_framework_1.Property.Checkbox({
|
|
125
|
-
displayName: 'Include Subscriptions',
|
|
126
|
-
description: 'Include subscription data in response',
|
|
127
|
-
required: false,
|
|
128
|
-
defaultValue: false,
|
|
129
|
-
}),
|
|
130
|
-
include_predictive_analytics: pieces_framework_1.Property.Checkbox({
|
|
131
|
-
displayName: 'Include Predictive Analytics',
|
|
132
|
-
description: 'Include predictive analytics data in response',
|
|
133
|
-
required: false,
|
|
134
|
-
defaultValue: false,
|
|
135
|
-
}),
|
|
136
|
-
},
|
|
137
|
-
run(_a) {
|
|
138
|
-
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
|
|
139
|
-
const { profile_id, email, phone_number, external_id, anonymous_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;
|
|
140
|
-
const attributes = {};
|
|
141
|
-
if (email !== undefined)
|
|
142
|
-
attributes['email'] = email;
|
|
143
|
-
if (phone_number !== undefined)
|
|
144
|
-
attributes['phone_number'] = phone_number;
|
|
145
|
-
if (external_id !== undefined)
|
|
146
|
-
attributes['external_id'] = external_id;
|
|
147
|
-
if (anonymous_id !== undefined)
|
|
148
|
-
attributes['anonymous_id'] = anonymous_id;
|
|
149
|
-
if (first_name !== undefined)
|
|
150
|
-
attributes['first_name'] = first_name;
|
|
151
|
-
if (last_name !== undefined)
|
|
152
|
-
attributes['last_name'] = last_name;
|
|
153
|
-
if (organization !== undefined)
|
|
154
|
-
attributes['organization'] = organization;
|
|
155
|
-
if (locale !== undefined)
|
|
156
|
-
attributes['locale'] = locale;
|
|
157
|
-
if (title !== undefined)
|
|
158
|
-
attributes['title'] = title;
|
|
159
|
-
if (image !== undefined)
|
|
160
|
-
attributes['image'] = image;
|
|
161
|
-
const hasLocationData = address1 !== undefined ||
|
|
162
|
-
address2 !== undefined ||
|
|
163
|
-
city !== undefined ||
|
|
164
|
-
country !== undefined ||
|
|
165
|
-
region !== undefined ||
|
|
166
|
-
zip !== undefined ||
|
|
167
|
-
timezone !== undefined ||
|
|
168
|
-
ip !== undefined ||
|
|
169
|
-
latitude !== undefined ||
|
|
170
|
-
longitude !== undefined;
|
|
171
|
-
if (hasLocationData) {
|
|
172
|
-
const location = {};
|
|
173
|
-
if (address1 !== undefined)
|
|
174
|
-
location['address1'] = address1;
|
|
175
|
-
if (address2 !== undefined)
|
|
176
|
-
location['address2'] = address2;
|
|
177
|
-
if (city !== undefined)
|
|
178
|
-
location['city'] = city;
|
|
179
|
-
if (country !== undefined)
|
|
180
|
-
location['country'] = country;
|
|
181
|
-
if (region !== undefined)
|
|
182
|
-
location['region'] = region;
|
|
183
|
-
if (zip !== undefined)
|
|
184
|
-
location['zip'] = zip;
|
|
185
|
-
if (timezone !== undefined)
|
|
186
|
-
location['timezone'] = timezone;
|
|
187
|
-
if (ip !== undefined)
|
|
188
|
-
location['ip'] = ip;
|
|
189
|
-
if (latitude !== undefined)
|
|
190
|
-
location['latitude'] = latitude;
|
|
191
|
-
if (longitude !== undefined)
|
|
192
|
-
location['longitude'] = longitude;
|
|
193
|
-
attributes['location'] = location;
|
|
194
|
-
}
|
|
195
|
-
if (custom_properties !== undefined) {
|
|
196
|
-
attributes['properties'] = custom_properties;
|
|
197
|
-
}
|
|
198
|
-
const body = {
|
|
199
|
-
data: {
|
|
200
|
-
type: 'profile',
|
|
201
|
-
id: profile_id,
|
|
202
|
-
attributes,
|
|
203
|
-
},
|
|
204
|
-
};
|
|
205
|
-
const queryParams = [];
|
|
206
|
-
const additionalFields = [];
|
|
207
|
-
if (include_subscriptions) {
|
|
208
|
-
additionalFields.push('subscriptions');
|
|
209
|
-
}
|
|
210
|
-
if (include_predictive_analytics) {
|
|
211
|
-
additionalFields.push('predictive_analytics');
|
|
212
|
-
}
|
|
213
|
-
if (additionalFields.length > 0) {
|
|
214
|
-
queryParams.push(`additional-fields[profile]=${additionalFields.join(',')}`);
|
|
215
|
-
}
|
|
216
|
-
const queryString = queryParams.length > 0 ? `?${queryParams.join('&')}` : '';
|
|
217
|
-
return yield (0, client_1.makeRequest)(auth, pieces_common_1.HttpMethod.PATCH, `/profiles/${profile_id}${queryString}`, body);
|
|
218
|
-
});
|
|
219
|
-
},
|
|
220
|
-
});
|
|
221
|
-
//# sourceMappingURL=update-profile.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update-profile.js","sourceRoot":"","sources":["../../../../src/lib/actions/update-profile.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,2CAAiE;AACjE,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,+CAA+C;IAC5D,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EAAE,mVAAmV;QAChW,UAAU,EAAE,IAAI;KACjB;IACD,KAAK,EAAE;QACL,UAAU,EAAE,yBAAiB;QAC7B,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,OAAO;YACpB,WAAW,EAAE,4BAA4B;YACzC,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,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lib/common/auth.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { AppConnectionValueForAuthProperty } from '@activepieces/pieces-framework';
|
|
2
|
-
export declare const klaviyoAuth: (import("@activepieces/pieces-framework").SecretTextProperty<true> | import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>)[];
|
|
3
|
-
export type KlaviyoAuthValue = AppConnectionValueForAuthProperty<typeof klaviyoAuth>;
|
|
4
|
-
export declare function getAuthorizationHeader(auth: KlaviyoAuthValue): string;
|
|
5
|
-
//# sourceMappingURL=auth.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../../src/lib/common/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iCAAiC,EAGlC,MAAM,gCAAgC,CAAC;AAIxC,eAAO,MAAM,WAAW,uLA4DvB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,iCAAiC,CAC9D,OAAO,WAAW,CACnB,CAAC;AAEF,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,gBAAgB,GAAG,MAAM,CAKrE"}
|