@activepieces/piece-buttondown 0.0.3 → 0.0.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 -12
- package/src/index.js +13 -29
- package/src/index.d.ts +0 -1
- package/src/index.js.map +0 -1
- package/src/lib/actions/create-subscriber.d.ts +0 -16
- package/src/lib/actions/create-subscriber.js +0 -153
- package/src/lib/actions/create-subscriber.js.map +0 -1
- package/src/lib/actions/custom-api-call.d.ts +0 -12
- package/src/lib/actions/custom-api-call.js +0 -17
- package/src/lib/actions/custom-api-call.js.map +0 -1
- package/src/lib/actions/list-subscribers.d.ts +0 -10
- package/src/lib/actions/list-subscribers.js +0 -113
- package/src/lib/actions/list-subscribers.js.map +0 -1
- package/src/lib/actions/send-email.d.ts +0 -15
- package/src/lib/actions/send-email.js +0 -145
- package/src/lib/actions/send-email.js.map +0 -1
- package/src/lib/common/auth.d.ts +0 -1
- package/src/lib/common/auth.js +0 -44
- package/src/lib/common/auth.js.map +0 -1
- package/src/lib/common/client.d.ts +0 -19
- package/src/lib/common/client.js +0 -39
- package/src/lib/common/client.js.map +0 -1
- package/src/lib/common/options.d.ts +0 -21
- package/src/lib/common/options.js +0 -58
- package/src/lib/common/options.js.map +0 -1
- package/src/lib/common/types.d.ts +0 -80
- package/src/lib/common/types.js +0 -3
- package/src/lib/common/types.js.map +0 -1
- package/src/lib/common/webhook.d.ts +0 -35
- package/src/lib/common/webhook.js +0 -78
- package/src/lib/common/webhook.js.map +0 -1
- package/src/lib/triggers/email-sent.d.ts +0 -13
- package/src/lib/triggers/email-sent.js +0 -41
- package/src/lib/triggers/email-sent.js.map +0 -1
- package/src/lib/triggers/new-subscriber.d.ts +0 -13
- package/src/lib/triggers/new-subscriber.js +0 -41
- package/src/lib/triggers/new-subscriber.js.map +0 -1
- package/src/lib/triggers/subscriber-confirmed.d.ts +0 -13
- package/src/lib/triggers/subscriber-confirmed.js +0 -41
- package/src/lib/triggers/subscriber-confirmed.js.map +0 -1
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare const listSubscribers: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
-
limit: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
3
|
-
cursor: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
4
|
-
type: import("@activepieces/pieces-framework").StaticDropdownProperty<import("../common/types").ButtondownSubscriberType, false>;
|
|
5
|
-
source: import("@activepieces/pieces-framework").StaticDropdownProperty<import("../common/types").ButtondownSubscriberSource, false>;
|
|
6
|
-
tags: import("@activepieces/pieces-framework").ArrayProperty<true> | import("@activepieces/pieces-framework").ArrayProperty<false>;
|
|
7
|
-
emailAddress: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
8
|
-
referrerUrl: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
9
|
-
ordering: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
|
|
10
|
-
}>;
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.listSubscribers = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
6
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
|
-
const auth_1 = require("../common/auth");
|
|
8
|
-
const client_1 = require("../common/client");
|
|
9
|
-
const options_1 = require("../common/options");
|
|
10
|
-
exports.listSubscribers = (0, pieces_framework_1.createAction)({
|
|
11
|
-
auth: auth_1.buttondownAuth,
|
|
12
|
-
name: 'listSubscribers',
|
|
13
|
-
displayName: 'List Subscribers',
|
|
14
|
-
description: 'Retrieve subscribers from Buttondown.',
|
|
15
|
-
audience: 'both',
|
|
16
|
-
aiMetadata: {
|
|
17
|
-
description: 'Lists subscribers from a Buttondown newsletter, optionally filtered by type, source, tags, email substring, or referrer URL; with no filters it returns all subscribers. Use to look up or enumerate subscribers. Read-only and idempotent. Returns one page (default 100); pass the returned cursor to page through results.',
|
|
18
|
-
idempotent: true,
|
|
19
|
-
},
|
|
20
|
-
props: {
|
|
21
|
-
limit: pieces_framework_1.Property.Number({
|
|
22
|
-
displayName: 'Page Size',
|
|
23
|
-
description: 'Maximum number of subscribers to return (1-1000).',
|
|
24
|
-
required: false,
|
|
25
|
-
defaultValue: 100,
|
|
26
|
-
}),
|
|
27
|
-
cursor: pieces_framework_1.Property.ShortText({
|
|
28
|
-
displayName: 'Cursor',
|
|
29
|
-
description: 'Provide the cursor value from a previous response to fetch the next page.',
|
|
30
|
-
required: false,
|
|
31
|
-
}),
|
|
32
|
-
type: pieces_framework_1.Property.StaticDropdown({
|
|
33
|
-
displayName: 'Subscriber Type',
|
|
34
|
-
required: false,
|
|
35
|
-
options: {
|
|
36
|
-
options: options_1.subscriberTypeOptions,
|
|
37
|
-
},
|
|
38
|
-
}),
|
|
39
|
-
source: pieces_framework_1.Property.StaticDropdown({
|
|
40
|
-
displayName: 'Source',
|
|
41
|
-
required: false,
|
|
42
|
-
options: {
|
|
43
|
-
options: options_1.subscriberSourceOptions,
|
|
44
|
-
},
|
|
45
|
-
}),
|
|
46
|
-
tags: pieces_framework_1.Property.Array({
|
|
47
|
-
displayName: 'Tags',
|
|
48
|
-
description: 'Filter by subscribers who have at least one of these tags.',
|
|
49
|
-
required: false,
|
|
50
|
-
properties: {
|
|
51
|
-
tag: pieces_framework_1.Property.ShortText({
|
|
52
|
-
displayName: 'Tag',
|
|
53
|
-
required: true,
|
|
54
|
-
}),
|
|
55
|
-
},
|
|
56
|
-
}),
|
|
57
|
-
emailAddress: pieces_framework_1.Property.ShortText({
|
|
58
|
-
displayName: 'Email Contains',
|
|
59
|
-
description: 'Return subscribers whose email address contains this value.',
|
|
60
|
-
required: false,
|
|
61
|
-
}),
|
|
62
|
-
referrerUrl: pieces_framework_1.Property.ShortText({
|
|
63
|
-
displayName: 'Referrer URL Contains',
|
|
64
|
-
required: false,
|
|
65
|
-
}),
|
|
66
|
-
ordering: pieces_framework_1.Property.StaticDropdown({
|
|
67
|
-
displayName: 'Ordering',
|
|
68
|
-
required: false,
|
|
69
|
-
options: {
|
|
70
|
-
options: options_1.subscriberOrderingOptions,
|
|
71
|
-
},
|
|
72
|
-
}),
|
|
73
|
-
},
|
|
74
|
-
run(_a) {
|
|
75
|
-
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
|
|
76
|
-
var _b;
|
|
77
|
-
const query = {};
|
|
78
|
-
if (propsValue.limit) {
|
|
79
|
-
query['page_size'] = propsValue.limit;
|
|
80
|
-
}
|
|
81
|
-
if (propsValue.cursor) {
|
|
82
|
-
query['cursor'] = propsValue.cursor;
|
|
83
|
-
}
|
|
84
|
-
if (propsValue.type) {
|
|
85
|
-
query['type'] = [propsValue.type];
|
|
86
|
-
}
|
|
87
|
-
if (propsValue.source) {
|
|
88
|
-
query['source'] = [propsValue.source];
|
|
89
|
-
}
|
|
90
|
-
const tags = (_b = propsValue.tags) === null || _b === void 0 ? void 0 : _b.map((entry) => { var _a; return (_a = entry.tag) === null || _a === void 0 ? void 0 : _a.trim(); }).filter((tag) => !!tag);
|
|
91
|
-
if (tags && tags.length > 0) {
|
|
92
|
-
query['tag'] = tags;
|
|
93
|
-
}
|
|
94
|
-
if (propsValue.emailAddress) {
|
|
95
|
-
query['email_address'] = propsValue.emailAddress;
|
|
96
|
-
}
|
|
97
|
-
if (propsValue.referrerUrl) {
|
|
98
|
-
query['referrer_url'] = propsValue.referrerUrl;
|
|
99
|
-
}
|
|
100
|
-
if (propsValue.ordering) {
|
|
101
|
-
query['ordering'] = propsValue.ordering;
|
|
102
|
-
}
|
|
103
|
-
const response = yield (0, client_1.buttondownRequest)({
|
|
104
|
-
auth: auth.secret_text,
|
|
105
|
-
method: pieces_common_1.HttpMethod.GET,
|
|
106
|
-
path: '/subscribers',
|
|
107
|
-
query,
|
|
108
|
-
});
|
|
109
|
-
return response;
|
|
110
|
-
});
|
|
111
|
-
},
|
|
112
|
-
});
|
|
113
|
-
//# sourceMappingURL=list-subscribers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"list-subscribers.js","sourceRoot":"","sources":["../../../../src/lib/actions/list-subscribers.ts"],"names":[],"mappings":";;;;AAAA,+DAAyD;AACzD,qEAAwE;AACxE,yCAAgD;AAChD,6CAA8E;AAC9E,+CAI2B;AAGd,QAAA,eAAe,GAAG,IAAA,+BAAY,EAAC;IAC1C,IAAI,EAAE,qBAAc;IACpB,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,kBAAkB;IAC/B,WAAW,EAAE,uCAAuC;IACpD,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EACT,+TAA+T;QACjU,UAAU,EAAE,IAAI;KACjB;IACD,KAAK,EAAE;QACL,KAAK,EAAE,2BAAQ,CAAC,MAAM,CAAC;YACrB,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,mDAAmD;YAChE,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,GAAG;SAClB,CAAC;QACF,MAAM,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACzB,WAAW,EAAE,QAAQ;YACrB,WAAW,EACT,2EAA2E;YAC7E,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,IAAI,EAAE,2BAAQ,CAAC,cAAc,CAAC;YAC5B,WAAW,EAAE,iBAAiB;YAC9B,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE;gBACP,OAAO,EAAE,+BAAqB;aAC/B;SACF,CAAC;QACF,MAAM,EAAE,2BAAQ,CAAC,cAAc,CAAC;YAC9B,WAAW,EAAE,QAAQ;YACrB,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE;gBACP,OAAO,EAAE,iCAAuB;aACjC;SACF,CAAC;QACF,IAAI,EAAE,2BAAQ,CAAC,KAAK,CAAC;YACnB,WAAW,EAAE,MAAM;YACnB,WA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C,KAAK,EAAE,EAAE,WAAC,OAAA,MAAA,KAAK,CAAC,GAAG,0CAAE,IAAI,EAAE,CAAA,EAAA,EACjC,MAAM,CAAC,CAAC,GAAG,EAAiB,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;YACzC,IAAI,IAAI,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC5B,KAAK,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;YACtB,CAAC;YAED,IAAI,UAAU,CAAC,YAAY,EAAE,CAAC;gBAC5B,KAAK,CAAC,eAAe,CAAC,GAAG,UAAU,CAAC,YAAY,CAAC;YACnD,CAAC;YAED,IAAI,UAAU,CAAC,WAAW,EAAE,CAAC;gBAC3B,KAAK,CAAC,cAAc,CAAC,GAAG,UAAU,CAAC,WAAW,CAAC;YACjD,CAAC;YAED,IAAI,UAAU,CAAC,QAAQ,EAAE,CAAC;gBACxB,KAAK,CAAC,UAAU,CAAC,GAAG,UAAU,CAAC,QAAQ,CAAC;YAC1C,CAAC;YAED,MAAM,QAAQ,GAAG,MAAM,IAAA,0BAAiB,EAAgD;gBACtF,IAAI,EAAE,IAAI,CAAC,WAAW;gBACtB,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,IAAI,EAAE,cAAc;gBACpB,KAAK;aACN,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC;QAClB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { ButtondownEmailStatus, ButtondownEmailType } from '../common/types';
|
|
2
|
-
export declare const sendEmail: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
3
|
-
subject: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
-
body: import("@activepieces/pieces-framework").LongTextProperty<true>;
|
|
5
|
-
status: import("@activepieces/pieces-framework").StaticDropdownProperty<ButtondownEmailStatus, false>;
|
|
6
|
-
publishDate: import("@activepieces/pieces-framework").DateTimeProperty<false>;
|
|
7
|
-
emailType: import("@activepieces/pieces-framework").StaticDropdownProperty<ButtondownEmailType, false>;
|
|
8
|
-
description: import("@activepieces/pieces-framework").LongTextProperty<false>;
|
|
9
|
-
canonicalUrl: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
10
|
-
image: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
11
|
-
slug: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
12
|
-
metadata: import("@activepieces/pieces-framework").JsonProperty<false>;
|
|
13
|
-
attachments: import("@activepieces/pieces-framework").ArrayProperty<true> | import("@activepieces/pieces-framework").ArrayProperty<false>;
|
|
14
|
-
triggerBilling: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
15
|
-
}>;
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.sendEmail = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
6
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
|
-
const auth_1 = require("../common/auth");
|
|
8
|
-
const client_1 = require("../common/client");
|
|
9
|
-
const options_1 = require("../common/options");
|
|
10
|
-
exports.sendEmail = (0, pieces_framework_1.createAction)({
|
|
11
|
-
auth: auth_1.buttondownAuth,
|
|
12
|
-
name: 'sendEmail',
|
|
13
|
-
displayName: 'Send Email',
|
|
14
|
-
description: 'Send an email to your Buttondown subscribers.',
|
|
15
|
-
audience: 'both',
|
|
16
|
-
aiMetadata: {
|
|
17
|
-
description: 'Creates an email in Buttondown from a subject and Markdown/HTML body, then handles it per the chosen delivery status (e.g. send now vs. schedule for a future publish date, or save as draft). Use to broadcast a newsletter or queue one for later. A publish date is required when status is scheduled. Not idempotent: each call creates and may dispatch a new email.',
|
|
18
|
-
idempotent: false,
|
|
19
|
-
},
|
|
20
|
-
props: {
|
|
21
|
-
subject: pieces_framework_1.Property.ShortText({
|
|
22
|
-
displayName: 'Subject',
|
|
23
|
-
required: true,
|
|
24
|
-
}),
|
|
25
|
-
body: pieces_framework_1.Property.LongText({
|
|
26
|
-
displayName: 'Body',
|
|
27
|
-
description: 'Write your email content in Markdown or HTML. Buttondown will detect the format automatically.',
|
|
28
|
-
required: true,
|
|
29
|
-
}),
|
|
30
|
-
status: pieces_framework_1.Property.StaticDropdown({
|
|
31
|
-
displayName: 'Delivery Status',
|
|
32
|
-
description: 'Choose how Buttondown should treat this email after creation.',
|
|
33
|
-
required: false,
|
|
34
|
-
defaultValue: 'about_to_send',
|
|
35
|
-
options: {
|
|
36
|
-
options: options_1.emailStatusOptions,
|
|
37
|
-
},
|
|
38
|
-
}),
|
|
39
|
-
publishDate: pieces_framework_1.Property.DateTime({
|
|
40
|
-
displayName: 'Publish Date',
|
|
41
|
-
description: 'Required when scheduling an email. Use ISO 8601 format.',
|
|
42
|
-
required: false,
|
|
43
|
-
}),
|
|
44
|
-
emailType: pieces_framework_1.Property.StaticDropdown({
|
|
45
|
-
displayName: 'Email Type',
|
|
46
|
-
required: false,
|
|
47
|
-
defaultValue: 'public',
|
|
48
|
-
options: {
|
|
49
|
-
options: options_1.emailTypeOptions,
|
|
50
|
-
},
|
|
51
|
-
}),
|
|
52
|
-
description: pieces_framework_1.Property.LongText({
|
|
53
|
-
displayName: 'Description',
|
|
54
|
-
required: false,
|
|
55
|
-
}),
|
|
56
|
-
canonicalUrl: pieces_framework_1.Property.ShortText({
|
|
57
|
-
displayName: 'Canonical URL',
|
|
58
|
-
required: false,
|
|
59
|
-
}),
|
|
60
|
-
image: pieces_framework_1.Property.ShortText({
|
|
61
|
-
displayName: 'Primary Image URL',
|
|
62
|
-
required: false,
|
|
63
|
-
}),
|
|
64
|
-
slug: pieces_framework_1.Property.ShortText({
|
|
65
|
-
displayName: 'Slug',
|
|
66
|
-
description: 'Override the automatic slug used for the archive URL.',
|
|
67
|
-
required: false,
|
|
68
|
-
}),
|
|
69
|
-
metadata: pieces_framework_1.Property.Json({
|
|
70
|
-
displayName: 'Metadata',
|
|
71
|
-
description: 'Custom metadata to attach to the email (JSON object).',
|
|
72
|
-
required: false,
|
|
73
|
-
}),
|
|
74
|
-
attachments: pieces_framework_1.Property.Array({
|
|
75
|
-
displayName: 'Attachment IDs',
|
|
76
|
-
description: 'IDs of attachments uploaded via the Buttondown API.',
|
|
77
|
-
required: false,
|
|
78
|
-
properties: {
|
|
79
|
-
id: pieces_framework_1.Property.ShortText({
|
|
80
|
-
displayName: 'Attachment ID',
|
|
81
|
-
required: true,
|
|
82
|
-
}),
|
|
83
|
-
},
|
|
84
|
-
}),
|
|
85
|
-
triggerBilling: pieces_framework_1.Property.Checkbox({
|
|
86
|
-
displayName: 'Trigger Pay-per-email Billing',
|
|
87
|
-
description: 'Enable when this email should count against pay-per-email billing for paid subscribers.',
|
|
88
|
-
required: false,
|
|
89
|
-
defaultValue: false,
|
|
90
|
-
}),
|
|
91
|
-
},
|
|
92
|
-
run(_a) {
|
|
93
|
-
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
|
|
94
|
-
var _b, _c;
|
|
95
|
-
const status = (_b = propsValue.status) !== null && _b !== void 0 ? _b : 'about_to_send';
|
|
96
|
-
if (status === 'scheduled' && !propsValue.publishDate) {
|
|
97
|
-
throw new Error('Publish date is required when scheduling an email.');
|
|
98
|
-
}
|
|
99
|
-
const payload = {
|
|
100
|
-
subject: propsValue.subject,
|
|
101
|
-
body: propsValue.body,
|
|
102
|
-
status,
|
|
103
|
-
};
|
|
104
|
-
if (propsValue.publishDate) {
|
|
105
|
-
payload.publish_date = propsValue.publishDate;
|
|
106
|
-
}
|
|
107
|
-
if (propsValue.emailType) {
|
|
108
|
-
payload.email_type = propsValue.emailType;
|
|
109
|
-
}
|
|
110
|
-
if (propsValue.description) {
|
|
111
|
-
payload.description = propsValue.description;
|
|
112
|
-
}
|
|
113
|
-
if (propsValue.canonicalUrl) {
|
|
114
|
-
payload.canonical_url = propsValue.canonicalUrl;
|
|
115
|
-
}
|
|
116
|
-
if (propsValue.image) {
|
|
117
|
-
payload.image = propsValue.image;
|
|
118
|
-
}
|
|
119
|
-
if (propsValue.slug) {
|
|
120
|
-
payload.slug = propsValue.slug;
|
|
121
|
-
}
|
|
122
|
-
if (propsValue.metadata) {
|
|
123
|
-
if (typeof propsValue.metadata !== 'object' || Array.isArray(propsValue.metadata)) {
|
|
124
|
-
throw new Error('Metadata must be provided as a JSON object.');
|
|
125
|
-
}
|
|
126
|
-
payload.metadata = propsValue.metadata;
|
|
127
|
-
}
|
|
128
|
-
const attachments = (_c = propsValue.attachments) === null || _c === void 0 ? void 0 : _c.map((entry) => { var _a; return (_a = entry.id) === null || _a === void 0 ? void 0 : _a.trim(); }).filter((id) => !!id);
|
|
129
|
-
if (attachments && attachments.length > 0) {
|
|
130
|
-
payload.attachments = attachments;
|
|
131
|
-
}
|
|
132
|
-
if (propsValue.triggerBilling) {
|
|
133
|
-
payload.should_trigger_pay_per_email_billing = true;
|
|
134
|
-
}
|
|
135
|
-
const email = yield (0, client_1.buttondownRequest)({
|
|
136
|
-
auth: auth.secret_text,
|
|
137
|
-
method: pieces_common_1.HttpMethod.POST,
|
|
138
|
-
path: '/emails',
|
|
139
|
-
body: payload,
|
|
140
|
-
});
|
|
141
|
-
return email;
|
|
142
|
-
});
|
|
143
|
-
},
|
|
144
|
-
});
|
|
145
|
-
//# sourceMappingURL=send-email.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"send-email.js","sourceRoot":"","sources":["../../../../src/lib/actions/send-email.ts"],"names":[],"mappings":";;;;AAAA,+DAAyD;AACzD,qEAAwE;AACxE,yCAAgD;AAChD,6CAAqD;AACrD,+CAAyE;AAQ5D,QAAA,SAAS,GAAG,IAAA,+BAAY,EAAC;IACpC,IAAI,EAAE,qBAAc;IACpB,IAAI,EAAE,WAAW;IACjB,WAAW,EAAE,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AAI,CAAC;YACtD,CAAC;YAED,MAAM,KAAK,GAAG,MAAM,IAAA,0BAAiB,EAAkB;gBACrD,IAAI,EAAE,IAAI,CAAC,WAAW;gBACtB,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,OAAO;aACd,CAAC,CAAC;YAEH,OAAO,KAAK,CAAC;QACf,CAAC;KAAA;CACF,CAAC,CAAC"}
|
package/src/lib/common/auth.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const buttondownAuth: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
package/src/lib/common/auth.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.buttondownAuth = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
6
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
|
-
const client_1 = require("./client");
|
|
8
|
-
exports.buttondownAuth = pieces_framework_1.PieceAuth.SecretText({
|
|
9
|
-
displayName: 'API Key',
|
|
10
|
-
description: 'Create an API key from https://buttondown.com/keys and paste it here.',
|
|
11
|
-
required: true,
|
|
12
|
-
validate: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
13
|
-
var _b, _c, _d, _e, _f, _g;
|
|
14
|
-
if (!auth) {
|
|
15
|
-
return {
|
|
16
|
-
valid: false,
|
|
17
|
-
error: 'API key is required.',
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
try {
|
|
21
|
-
yield pieces_common_1.httpClient.sendRequest({
|
|
22
|
-
method: pieces_common_1.HttpMethod.GET,
|
|
23
|
-
url: `${client_1.BUTTONDOWN_BASE_URL}/newsletters`,
|
|
24
|
-
headers: {
|
|
25
|
-
Authorization: `Token ${auth}`,
|
|
26
|
-
},
|
|
27
|
-
});
|
|
28
|
-
return {
|
|
29
|
-
valid: true,
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
catch (unknownError) {
|
|
33
|
-
const error = unknownError;
|
|
34
|
-
const status = (_b = error.response) === null || _b === void 0 ? void 0 : _b.status;
|
|
35
|
-
const body = (_d = (_c = error.response) === null || _c === void 0 ? void 0 : _c.body) !== null && _d !== void 0 ? _d : {};
|
|
36
|
-
const message = (_g = (_f = (_e = body.detail) !== null && _e !== void 0 ? _e : body.error) !== null && _f !== void 0 ? _f : body.message) !== null && _g !== void 0 ? _g : (status === 401 ? 'Invalid API key.' : 'Failed to verify the API key.');
|
|
37
|
-
return {
|
|
38
|
-
valid: false,
|
|
39
|
-
error: message,
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
}),
|
|
43
|
-
});
|
|
44
|
-
//# sourceMappingURL=auth.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../../src/lib/common/auth.ts"],"names":[],"mappings":";;;;AAAA,+DAAqE;AACrE,qEAA2D;AAC3D,qCAA+C;AAYlC,QAAA,cAAc,GAAG,4BAAS,CAAC,UAAU,CAAC;IACjD,WAAW,EAAE,SAAS;IACtB,WAAW,EACT,uEAAuE;IACzE,QAAQ,EAAE,IAAI;IACd,QAAQ,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;;QACvB,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,OAAO;gBACL,KAAK,EAAE,KAAK;gBACZ,KAAK,EAAE,sBAAsB;aAC9B,CAAC;QACJ,CAAC;QAED,IAAI,CAAC;YACH,MAAM,0BAAU,CAAC,WAAW,CAAyB;gBACnD,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,GAAG,EAAE,GAAG,4BAAmB,cAAc;gBACzC,OAAO,EAAE;oBACP,aAAa,EAAE,SAAS,IAAI,EAAE;iBAC/B;aACF,CAAC,CAAC;YACH,OAAO;gBACL,KAAK,EAAE,IAAI;aACZ,CAAC;QACJ,CAAC;QAAC,OAAO,YAAqB,EAAE,CAAC;YAC/B,MAAM,KAAK,GAAG,YAGb,CAAC;YACF,MAAM,MAAM,GAAG,MAAA,KAAK,CAAC,QAAQ,0CAAE,MAAM,CAAC;YACtC,MAAM,IAAI,GAAG,MAAA,MAAA,KAAK,CAAC,QAAQ,0CAAE,IAAI,mCAAI,EAAE,CAAC;YACxC,MAAM,OAAO,GACX,MAAA,MAAA,MAAA,IAAI,CAAC,MAAM,mCACX,IAAI,CAAC,KAAK,mCACV,IAAI,CAAC,OAAO,mCACZ,CAAC,MAAM,KAAK,GAAG,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,+BAA+B,CAAC,CAAC;YAE1E,OAAO;gBACL,KAAK,EAAE,KAAK;gBACZ,KAAK,EAAE,OAAO;aACf,CAAC;QACJ,CAAC;IACH,CAAC,CAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { HttpMethod } from '@activepieces/pieces-common';
|
|
2
|
-
export declare const BUTTONDOWN_BASE_URL = "https://api.buttondown.com/v1";
|
|
3
|
-
type QueryValue = string | number | boolean | Array<string | number | boolean> | undefined;
|
|
4
|
-
export interface ButtondownRequest {
|
|
5
|
-
auth: string;
|
|
6
|
-
method: HttpMethod;
|
|
7
|
-
path: string;
|
|
8
|
-
query?: Record<string, QueryValue>;
|
|
9
|
-
body?: unknown;
|
|
10
|
-
headers?: Record<string, string | undefined>;
|
|
11
|
-
}
|
|
12
|
-
export interface ButtondownPagedResponse<T> {
|
|
13
|
-
results: T[];
|
|
14
|
-
count: number;
|
|
15
|
-
next?: string | null;
|
|
16
|
-
previous?: string | null;
|
|
17
|
-
}
|
|
18
|
-
export declare const buttondownRequest: <TResponse>({ auth, method, path, query, body, headers, }: ButtondownRequest) => Promise<TResponse>;
|
|
19
|
-
export {};
|
package/src/lib/common/client.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.buttondownRequest = exports.BUTTONDOWN_BASE_URL = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
6
|
-
exports.BUTTONDOWN_BASE_URL = 'https://api.buttondown.com/v1';
|
|
7
|
-
const sanitizeHeaders = (headers = {}) => Object.fromEntries(Object.entries(headers).filter(([, value]) => value !== undefined));
|
|
8
|
-
const serializeQueryParams = (query) => {
|
|
9
|
-
if (!query) {
|
|
10
|
-
return undefined;
|
|
11
|
-
}
|
|
12
|
-
const result = {};
|
|
13
|
-
for (const [key, value] of Object.entries(query)) {
|
|
14
|
-
if (value === undefined) {
|
|
15
|
-
continue;
|
|
16
|
-
}
|
|
17
|
-
if (Array.isArray(value)) {
|
|
18
|
-
if (value.length === 0) {
|
|
19
|
-
continue;
|
|
20
|
-
}
|
|
21
|
-
result[key] = value.map((item) => String(item)).join(',');
|
|
22
|
-
continue;
|
|
23
|
-
}
|
|
24
|
-
result[key] = String(value);
|
|
25
|
-
}
|
|
26
|
-
return Object.keys(result).length > 0 ? result : undefined;
|
|
27
|
-
};
|
|
28
|
-
const buttondownRequest = (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, method, path, query, body, headers, }) {
|
|
29
|
-
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
30
|
-
method,
|
|
31
|
-
url: `${exports.BUTTONDOWN_BASE_URL}${path}`,
|
|
32
|
-
headers: Object.assign({ Authorization: `Token ${auth}`, Accept: 'application/json', 'Content-Type': 'application/json' }, sanitizeHeaders(headers)),
|
|
33
|
-
queryParams: serializeQueryParams(query),
|
|
34
|
-
body,
|
|
35
|
-
});
|
|
36
|
-
return response.body;
|
|
37
|
-
});
|
|
38
|
-
exports.buttondownRequest = buttondownRequest;
|
|
39
|
-
//# sourceMappingURL=client.js.map
|
|
@@ -1 +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AAC,CAAC;AAEK,MAAM,iBAAiB,GAAG,KAOS,EAAE,oDAPO,EACjD,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,OAAO,GACW;IAClB,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAY;QACvD,MAAM;QACN,GAAG,EAAE,GAAG,2BAAmB,GAAG,IAAI,EAAE;QACpC,OAAO,kBACL,aAAa,EAAE,SAAS,IAAI,EAAE,EAC9B,MAAM,EAAE,kBAAkB,EAC1B,cAAc,EAAE,kBAAkB,IAC/B,eAAe,CAAC,OAAO,CAAC,CAC5B;QACD,WAAW,EAAE,oBAAoB,CAAC,KAAK,CAAC;QACxC,IAAI;KACL,CAAC,CAAC;IAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;AACvB,CAAC,CAAA,CAAC;AAtBW,QAAA,iBAAiB,qBAsB5B"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ButtondownSubscriberType, ButtondownSubscriberSource, ButtondownEmailStatus, ButtondownEmailType } from './types';
|
|
2
|
-
export declare const subscriberTypeOptions: {
|
|
3
|
-
label: string;
|
|
4
|
-
value: ButtondownSubscriberType;
|
|
5
|
-
}[];
|
|
6
|
-
export declare const subscriberSourceOptions: {
|
|
7
|
-
label: string;
|
|
8
|
-
value: ButtondownSubscriberSource;
|
|
9
|
-
}[];
|
|
10
|
-
export declare const subscriberOrderingOptions: {
|
|
11
|
-
label: string;
|
|
12
|
-
value: string;
|
|
13
|
-
}[];
|
|
14
|
-
export declare const emailStatusOptions: {
|
|
15
|
-
label: string;
|
|
16
|
-
value: ButtondownEmailStatus;
|
|
17
|
-
}[];
|
|
18
|
-
export declare const emailTypeOptions: {
|
|
19
|
-
label: string;
|
|
20
|
-
value: ButtondownEmailType;
|
|
21
|
-
}[];
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.emailTypeOptions = exports.emailStatusOptions = exports.subscriberOrderingOptions = exports.subscriberSourceOptions = exports.subscriberTypeOptions = void 0;
|
|
4
|
-
exports.subscriberTypeOptions = [
|
|
5
|
-
{ label: 'Regular', value: 'regular' },
|
|
6
|
-
{ label: 'Premium', value: 'premium' },
|
|
7
|
-
{ label: 'Unactivated', value: 'unactivated' },
|
|
8
|
-
{ label: 'Paused', value: 'paused' },
|
|
9
|
-
{ label: 'Trialed', value: 'trialed' },
|
|
10
|
-
{ label: 'Upcoming', value: 'upcoming' },
|
|
11
|
-
{ label: 'Churning', value: 'churning' },
|
|
12
|
-
{ label: 'Churned', value: 'churned' },
|
|
13
|
-
{ label: 'Unsubscribed', value: 'unsubscribed' },
|
|
14
|
-
{ label: 'Undeliverable', value: 'undeliverable' },
|
|
15
|
-
{ label: 'Blocked', value: 'blocked' },
|
|
16
|
-
{ label: 'Complained', value: 'complained' },
|
|
17
|
-
{ label: 'Gifted', value: 'gifted' },
|
|
18
|
-
{ label: 'Past Due', value: 'past_due' },
|
|
19
|
-
{ label: 'Removed', value: 'removed' },
|
|
20
|
-
{ label: 'Unpaid', value: 'unpaid' },
|
|
21
|
-
];
|
|
22
|
-
exports.subscriberSourceOptions = [
|
|
23
|
-
{ label: 'Admin', value: 'admin' },
|
|
24
|
-
{ label: 'API', value: 'api' },
|
|
25
|
-
{ label: 'Carrd', value: 'carrd' },
|
|
26
|
-
{ label: 'Comment', value: 'comment' },
|
|
27
|
-
{ label: 'Embedded form', value: 'embedded_form' },
|
|
28
|
-
{ label: 'Hosted form', value: 'form' },
|
|
29
|
-
{ label: 'Import', value: 'import' },
|
|
30
|
-
{ label: 'Memberful', value: 'memberful' },
|
|
31
|
-
{ label: 'Organic', value: 'organic' },
|
|
32
|
-
{ label: 'Patreon', value: 'patreon' },
|
|
33
|
-
{ label: 'Stripe', value: 'stripe' },
|
|
34
|
-
{ label: 'User portal', value: 'user' },
|
|
35
|
-
{ label: 'Zapier', value: 'zapier' },
|
|
36
|
-
];
|
|
37
|
-
exports.subscriberOrderingOptions = [
|
|
38
|
-
{ label: 'Newest first', value: '-creation_date' },
|
|
39
|
-
{ label: 'Oldest first', value: 'creation_date' },
|
|
40
|
-
{ label: 'Email address (A-Z)', value: 'email_address' },
|
|
41
|
-
{ label: 'Email address (Z-A)', value: '-email_address' },
|
|
42
|
-
{ label: 'Last opened (recent first)', value: '-last_open_date' },
|
|
43
|
-
{ label: 'Last opened (oldest first)', value: 'last_open_date' },
|
|
44
|
-
];
|
|
45
|
-
exports.emailStatusOptions = [
|
|
46
|
-
{ label: 'Send immediately (about_to_send)', value: 'about_to_send' },
|
|
47
|
-
{ label: 'Draft', value: 'draft' },
|
|
48
|
-
{ label: 'Scheduled', value: 'scheduled' },
|
|
49
|
-
];
|
|
50
|
-
exports.emailTypeOptions = [
|
|
51
|
-
{ label: 'Public', value: 'public' },
|
|
52
|
-
{ label: 'Private', value: 'private' },
|
|
53
|
-
{ label: 'Premium', value: 'premium' },
|
|
54
|
-
{ label: 'Free', value: 'free' },
|
|
55
|
-
{ label: 'Churned', value: 'churned' },
|
|
56
|
-
{ label: 'Archival', value: 'archival' },
|
|
57
|
-
];
|
|
58
|
-
//# sourceMappingURL=options.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"options.js","sourceRoot":"","sources":["../../../../src/lib/common/options.ts"],"names":[],"mappings":";;;AAOa,QAAA,qBAAqB,GAAyD;IACzF,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;IACtC,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;IACtC,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,EAAE;IAC9C,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE;IACpC,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;IACtC,EAAE,KAAK,EAAE,UAAU,EAAE,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AAK,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE;CACzC,CAAC"}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
export type ButtondownSubscriberType = 'blocked' | 'complained' | 'churning' | 'churned' | 'gifted' | 'unactivated' | 'unpaid' | 'undeliverable' | 'premium' | 'past_due' | 'paused' | 'regular' | 'removed' | 'trialed' | 'unsubscribed' | 'upcoming';
|
|
2
|
-
export type ButtondownSubscriberSource = 'admin' | 'api' | 'carrd' | 'comment' | 'embedded_form' | 'form' | 'import' | 'memberful' | 'organic' | 'patreon' | 'stripe' | 'user' | 'zapier';
|
|
3
|
-
export interface ButtondownSubscriber {
|
|
4
|
-
id: string;
|
|
5
|
-
creation_date: string;
|
|
6
|
-
email_address: string;
|
|
7
|
-
type: ButtondownSubscriberType;
|
|
8
|
-
tags: string[];
|
|
9
|
-
metadata: Record<string, unknown>;
|
|
10
|
-
notes?: string;
|
|
11
|
-
referrer_url?: string;
|
|
12
|
-
utm_campaign?: string;
|
|
13
|
-
utm_medium?: string;
|
|
14
|
-
utm_source?: string;
|
|
15
|
-
ip_address?: string;
|
|
16
|
-
source: ButtondownSubscriberSource;
|
|
17
|
-
last_open_date?: string | null;
|
|
18
|
-
last_click_date?: string | null;
|
|
19
|
-
click_rate?: number | null;
|
|
20
|
-
open_rate?: number | null;
|
|
21
|
-
churn_date?: string | null;
|
|
22
|
-
unsubscription_date?: string | null;
|
|
23
|
-
undeliverability_date?: string | null;
|
|
24
|
-
[key: string]: unknown;
|
|
25
|
-
}
|
|
26
|
-
export interface ButtondownSubscriberInput {
|
|
27
|
-
email_address: string;
|
|
28
|
-
notes?: string;
|
|
29
|
-
metadata?: Record<string, unknown>;
|
|
30
|
-
tags?: string[];
|
|
31
|
-
referrer_url?: string;
|
|
32
|
-
utm_campaign?: string;
|
|
33
|
-
utm_medium?: string;
|
|
34
|
-
utm_source?: string;
|
|
35
|
-
referring_subscriber_id?: string;
|
|
36
|
-
type?: ButtondownSubscriberType;
|
|
37
|
-
ip_address?: string;
|
|
38
|
-
}
|
|
39
|
-
export type ButtondownEmailType = 'public' | 'private' | 'premium' | 'free' | 'churned' | 'archival';
|
|
40
|
-
export type ButtondownEmailStatus = 'draft' | 'managed_by_rss' | 'about_to_send' | 'scheduled' | 'in_flight' | 'paused' | 'deleted' | 'errored' | 'sent' | 'imported' | 'throttled' | 'resending' | 'transactional' | 'suppressed';
|
|
41
|
-
export interface ButtondownEmail {
|
|
42
|
-
id: string;
|
|
43
|
-
creation_date: string;
|
|
44
|
-
modification_date: string;
|
|
45
|
-
subject: string;
|
|
46
|
-
body: string;
|
|
47
|
-
status: ButtondownEmailStatus;
|
|
48
|
-
email_type: ButtondownEmailType;
|
|
49
|
-
publish_date?: string | null;
|
|
50
|
-
description?: string;
|
|
51
|
-
canonical_url?: string;
|
|
52
|
-
image?: string;
|
|
53
|
-
metadata?: Record<string, unknown>;
|
|
54
|
-
attachments?: string[];
|
|
55
|
-
[key: string]: unknown;
|
|
56
|
-
}
|
|
57
|
-
export interface ButtondownEmailInput {
|
|
58
|
-
subject: string;
|
|
59
|
-
body?: string;
|
|
60
|
-
status?: ButtondownEmailStatus;
|
|
61
|
-
email_type?: ButtondownEmailType;
|
|
62
|
-
publish_date?: string;
|
|
63
|
-
description?: string;
|
|
64
|
-
canonical_url?: string;
|
|
65
|
-
image?: string;
|
|
66
|
-
metadata?: Record<string, unknown>;
|
|
67
|
-
slug?: string;
|
|
68
|
-
attachments?: string[];
|
|
69
|
-
should_trigger_pay_per_email_billing?: boolean;
|
|
70
|
-
}
|
|
71
|
-
export type ButtondownWebhookEvent = 'subscriber.created' | 'subscriber.confirmed' | 'email.sent';
|
|
72
|
-
export interface ButtondownWebhook {
|
|
73
|
-
id: string;
|
|
74
|
-
creation_date: string;
|
|
75
|
-
url: string;
|
|
76
|
-
event_types: ButtondownWebhookEvent[];
|
|
77
|
-
status?: 'enabled' | 'disabled';
|
|
78
|
-
description?: string;
|
|
79
|
-
signing_key?: string;
|
|
80
|
-
}
|
package/src/lib/common/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/lib/common/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
-
import { ButtondownWebhookEvent } from './types';
|
|
3
|
-
export interface ButtondownWebhookPayload {
|
|
4
|
-
event_type?: string;
|
|
5
|
-
data?: Record<string, unknown>;
|
|
6
|
-
[key: string]: unknown;
|
|
7
|
-
}
|
|
8
|
-
interface CreateButtondownWebhookTriggerParams {
|
|
9
|
-
name: string;
|
|
10
|
-
displayName: string;
|
|
11
|
-
description: string;
|
|
12
|
-
aiMetadata: {
|
|
13
|
-
description: string;
|
|
14
|
-
};
|
|
15
|
-
eventType: ButtondownWebhookEvent;
|
|
16
|
-
sampleData: unknown;
|
|
17
|
-
enrich?: (params: {
|
|
18
|
-
apiKey: string;
|
|
19
|
-
payload: ButtondownWebhookPayload;
|
|
20
|
-
}) => Promise<Record<string, unknown>>;
|
|
21
|
-
}
|
|
22
|
-
export declare const createButtondownWebhookTrigger: ({ name, displayName, description, aiMetadata, eventType, sampleData, enrich, }: CreateButtondownWebhookTriggerParams) => import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
23
|
-
webhookDescription: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
24
|
-
signingKey: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
25
|
-
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
26
|
-
webhookDescription: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
27
|
-
signingKey: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
28
|
-
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
29
|
-
webhookDescription: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
30
|
-
signingKey: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
31
|
-
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
32
|
-
webhookDescription: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
33
|
-
signingKey: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
34
|
-
}>;
|
|
35
|
-
export {};
|