@activepieces/piece-ghostcms 0.1.5 → 0.1.8
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 -16
- package/src/index.js +56 -72
- package/src/index.d.ts +0 -9
- package/src/index.d.ts.map +0 -1
- package/src/index.js.map +0 -1
- package/src/lib/actions/create-member.d.ts +0 -16
- package/src/lib/actions/create-member.d.ts.map +0 -1
- package/src/lib/actions/create-member.js +0 -62
- package/src/lib/actions/create-member.js.map +0 -1
- package/src/lib/actions/create-post.d.ts +0 -21
- package/src/lib/actions/create-post.d.ts.map +0 -1
- package/src/lib/actions/create-post.js +0 -86
- package/src/lib/actions/create-post.js.map +0 -1
- package/src/lib/actions/find-member.d.ts +0 -7
- package/src/lib/actions/find-member.d.ts.map +0 -1
- package/src/lib/actions/find-member.js +0 -38
- package/src/lib/actions/find-member.js.map +0 -1
- package/src/lib/actions/find-user.d.ts +0 -7
- package/src/lib/actions/find-user.d.ts.map +0 -1
- package/src/lib/actions/find-user.js +0 -38
- package/src/lib/actions/find-user.js.map +0 -1
- package/src/lib/actions/update-member.d.ts +0 -23
- package/src/lib/actions/update-member.d.ts.map +0 -1
- package/src/lib/actions/update-member.js +0 -65
- package/src/lib/actions/update-member.js.map +0 -1
- package/src/lib/common/index.d.ts +0 -34
- package/src/lib/common/index.d.ts.map +0 -1
- package/src/lib/common/index.js +0 -203
- package/src/lib/common/index.js.map +0 -1
- package/src/lib/triggers/member-added.d.ts +0 -15
- package/src/lib/triggers/member-added.d.ts.map +0 -1
- package/src/lib/triggers/member-added.js +0 -104
- package/src/lib/triggers/member-added.js.map +0 -1
- package/src/lib/triggers/member-deleted.d.ts +0 -15
- package/src/lib/triggers/member-deleted.d.ts.map +0 -1
- package/src/lib/triggers/member-deleted.js +0 -104
- package/src/lib/triggers/member-deleted.js.map +0 -1
- package/src/lib/triggers/member-edited.d.ts +0 -15
- package/src/lib/triggers/member-edited.d.ts.map +0 -1
- package/src/lib/triggers/member-edited.js +0 -109
- package/src/lib/triggers/member-edited.js.map +0 -1
- package/src/lib/triggers/page-published.d.ts +0 -15
- package/src/lib/triggers/page-published.d.ts.map +0 -1
- package/src/lib/triggers/page-published.js +0 -211
- package/src/lib/triggers/page-published.js.map +0 -1
- package/src/lib/triggers/post-published.d.ts +0 -15
- package/src/lib/triggers/post-published.d.ts.map +0 -1
- package/src/lib/triggers/post-published.js +0 -212
- package/src/lib/triggers/post-published.js.map +0 -1
- package/src/lib/triggers/post-scheduled.d.ts +0 -15
- package/src/lib/triggers/post-scheduled.d.ts.map +0 -1
- package/src/lib/triggers/post-scheduled.js +0 -212
- package/src/lib/triggers/post-scheduled.js.map +0 -1
package/src/lib/common/index.js
DELETED
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.common = 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 jsonwebtoken_1 = tslib_1.__importDefault(require("jsonwebtoken"));
|
|
8
|
-
const __1 = require("../..");
|
|
9
|
-
exports.common = {
|
|
10
|
-
properties: {
|
|
11
|
-
newsletters: (required = true) => {
|
|
12
|
-
return pieces_framework_1.Property.MultiSelectDropdown({
|
|
13
|
-
auth: __1.ghostAuth,
|
|
14
|
-
displayName: 'Newsletters',
|
|
15
|
-
required: required,
|
|
16
|
-
refreshers: [],
|
|
17
|
-
options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
18
|
-
if (!auth) {
|
|
19
|
-
return {
|
|
20
|
-
disabled: true,
|
|
21
|
-
placeholder: 'Connect your account',
|
|
22
|
-
options: [],
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
const newsletters = (yield exports.common.getNewsletters(auth)).newsletters.map((newsletter) => {
|
|
26
|
-
return {
|
|
27
|
-
label: newsletter.name,
|
|
28
|
-
value: newsletter.id,
|
|
29
|
-
};
|
|
30
|
-
});
|
|
31
|
-
return {
|
|
32
|
-
options: newsletters,
|
|
33
|
-
};
|
|
34
|
-
}),
|
|
35
|
-
});
|
|
36
|
-
},
|
|
37
|
-
member: (required = true) => {
|
|
38
|
-
return pieces_framework_1.Property.Dropdown({
|
|
39
|
-
auth: __1.ghostAuth,
|
|
40
|
-
displayName: 'Member',
|
|
41
|
-
required: required,
|
|
42
|
-
refreshers: [],
|
|
43
|
-
options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
44
|
-
if (!auth) {
|
|
45
|
-
return {
|
|
46
|
-
disabled: true,
|
|
47
|
-
placeholder: 'Connect your account',
|
|
48
|
-
options: [],
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
const members = (yield exports.common.getMembers(auth)).members.map((member) => {
|
|
52
|
-
var _a;
|
|
53
|
-
return {
|
|
54
|
-
label: (_a = member.name) !== null && _a !== void 0 ? _a : member.email,
|
|
55
|
-
value: member.id,
|
|
56
|
-
};
|
|
57
|
-
});
|
|
58
|
-
return {
|
|
59
|
-
options: members,
|
|
60
|
-
};
|
|
61
|
-
}),
|
|
62
|
-
});
|
|
63
|
-
},
|
|
64
|
-
author: pieces_framework_1.Property.Dropdown({
|
|
65
|
-
auth: __1.ghostAuth,
|
|
66
|
-
displayName: 'Author',
|
|
67
|
-
required: true,
|
|
68
|
-
refreshers: [],
|
|
69
|
-
options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
70
|
-
if (!auth) {
|
|
71
|
-
return {
|
|
72
|
-
disabled: true,
|
|
73
|
-
placeholder: 'Connect your account',
|
|
74
|
-
options: [],
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
const authors = (yield exports.common.getUsers(auth)).users.map((user) => {
|
|
78
|
-
var _a;
|
|
79
|
-
return {
|
|
80
|
-
label: (_a = user.name) !== null && _a !== void 0 ? _a : user.email,
|
|
81
|
-
value: user.email,
|
|
82
|
-
};
|
|
83
|
-
});
|
|
84
|
-
return {
|
|
85
|
-
options: authors,
|
|
86
|
-
};
|
|
87
|
-
}),
|
|
88
|
-
}),
|
|
89
|
-
tags: pieces_framework_1.Property.MultiSelectDropdown({
|
|
90
|
-
auth: __1.ghostAuth,
|
|
91
|
-
displayName: 'Tags',
|
|
92
|
-
required: false,
|
|
93
|
-
refreshers: [],
|
|
94
|
-
options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
95
|
-
if (!auth) {
|
|
96
|
-
return {
|
|
97
|
-
disabled: true,
|
|
98
|
-
placeholder: 'Connect your account',
|
|
99
|
-
options: [],
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
const tags = (yield exports.common.getTags(auth)).tags.map((tag) => {
|
|
103
|
-
return {
|
|
104
|
-
label: tag.name,
|
|
105
|
-
value: tag.name,
|
|
106
|
-
};
|
|
107
|
-
});
|
|
108
|
-
return {
|
|
109
|
-
options: tags,
|
|
110
|
-
};
|
|
111
|
-
}),
|
|
112
|
-
}),
|
|
113
|
-
},
|
|
114
|
-
jwtFromApiKey: (apiKey) => {
|
|
115
|
-
const [id, secret] = apiKey.split(':');
|
|
116
|
-
return jsonwebtoken_1.default.sign({}, Buffer.from(secret, 'hex'), {
|
|
117
|
-
keyid: id,
|
|
118
|
-
expiresIn: '5m',
|
|
119
|
-
audience: '/admin/',
|
|
120
|
-
});
|
|
121
|
-
},
|
|
122
|
-
subscribeWebhook(auth, webhookType, webhookUrl) {
|
|
123
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
124
|
-
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
125
|
-
url: `${auth.baseUrl}/ghost/api/admin/webhooks`,
|
|
126
|
-
method: pieces_common_1.HttpMethod.POST,
|
|
127
|
-
headers: {
|
|
128
|
-
Authorization: `Ghost ${exports.common.jwtFromApiKey(auth.apiKey)}`,
|
|
129
|
-
},
|
|
130
|
-
body: {
|
|
131
|
-
webhooks: [
|
|
132
|
-
{
|
|
133
|
-
target_url: webhookUrl,
|
|
134
|
-
event: webhookType,
|
|
135
|
-
},
|
|
136
|
-
],
|
|
137
|
-
},
|
|
138
|
-
});
|
|
139
|
-
return response.body;
|
|
140
|
-
});
|
|
141
|
-
},
|
|
142
|
-
unsubscribeWebhook(auth, webhookId) {
|
|
143
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
144
|
-
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
145
|
-
url: `${auth.baseUrl}/ghost/api/admin/webhooks/${webhookId}`,
|
|
146
|
-
method: pieces_common_1.HttpMethod.DELETE,
|
|
147
|
-
headers: {
|
|
148
|
-
Authorization: `Ghost ${exports.common.jwtFromApiKey(auth.apiKey)}`,
|
|
149
|
-
},
|
|
150
|
-
});
|
|
151
|
-
return response.body;
|
|
152
|
-
});
|
|
153
|
-
},
|
|
154
|
-
getNewsletters(auth) {
|
|
155
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
156
|
-
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
157
|
-
url: `${auth.baseUrl}/ghost/api/admin/newsletters`,
|
|
158
|
-
method: pieces_common_1.HttpMethod.GET,
|
|
159
|
-
headers: {
|
|
160
|
-
Authorization: `Ghost ${exports.common.jwtFromApiKey(auth.apiKey)}`,
|
|
161
|
-
},
|
|
162
|
-
});
|
|
163
|
-
return response.body;
|
|
164
|
-
});
|
|
165
|
-
},
|
|
166
|
-
getMembers(auth) {
|
|
167
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
168
|
-
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
169
|
-
url: `${auth.baseUrl}/ghost/api/admin/members`,
|
|
170
|
-
method: pieces_common_1.HttpMethod.GET,
|
|
171
|
-
headers: {
|
|
172
|
-
Authorization: `Ghost ${exports.common.jwtFromApiKey(auth.apiKey)}`,
|
|
173
|
-
},
|
|
174
|
-
});
|
|
175
|
-
return response.body;
|
|
176
|
-
});
|
|
177
|
-
},
|
|
178
|
-
getUsers(auth) {
|
|
179
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
180
|
-
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
181
|
-
url: `${auth.baseUrl}/ghost/api/admin/users`,
|
|
182
|
-
method: pieces_common_1.HttpMethod.GET,
|
|
183
|
-
headers: {
|
|
184
|
-
Authorization: `Ghost ${exports.common.jwtFromApiKey(auth.apiKey)}`,
|
|
185
|
-
},
|
|
186
|
-
});
|
|
187
|
-
return response.body;
|
|
188
|
-
});
|
|
189
|
-
},
|
|
190
|
-
getTags(auth) {
|
|
191
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
192
|
-
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
193
|
-
url: `${auth.baseUrl}/ghost/api/admin/tags`,
|
|
194
|
-
method: pieces_common_1.HttpMethod.GET,
|
|
195
|
-
headers: {
|
|
196
|
-
Authorization: `Ghost ${exports.common.jwtFromApiKey(auth.apiKey)}`,
|
|
197
|
-
},
|
|
198
|
-
});
|
|
199
|
-
return response.body;
|
|
200
|
-
});
|
|
201
|
-
},
|
|
202
|
-
};
|
|
203
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/common/index.ts"],"names":[],"mappings":";;;;AAAA,+DAAqE;AACrE,qEAA0D;AAE1D,wEAA+B;AAC/B,6BAAkC;AAErB,QAAA,MAAM,GAAG;IACpB,UAAU,EAAE;QACV,WAAW,EAAE,CAAC,QAAQ,GAAG,IAAI,EAAE,EAAE;YAC/B,OAAO,2BAAQ,CAAC,mBAAmB,CAAC;gBAClC,IAAI,EAAE,aAAS;gBACf,WAAW,EAAE,aAAa;gBAC1B,QAAQ,EAAE,QAAQ;gBAClB,UAAU,EAAE,EAAE;g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IAAI,CAAC,MAAM,CAAC,EAAE;iBAC5D;aACF,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;IAEK,OAAO,CAAC,IAAS;;YACrB,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC5C,GAAG,EAAE,GAAG,IAAI,CAAC,OAAO,uBAAuB;gBAC3C,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,OAAO,EAAE;oBACP,aAAa,EAAE,SAAS,cAAM,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;iBAC5D;aACF,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
-
export declare const memberAdded: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
3
|
-
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
-
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
5
|
-
}>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
6
|
-
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
7
|
-
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
8
|
-
}>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
9
|
-
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
10
|
-
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
11
|
-
}>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
12
|
-
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
13
|
-
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
14
|
-
}>, {}>;
|
|
15
|
-
//# sourceMappingURL=member-added.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"member-added.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/member-added.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAiB,MAAM,gCAAgC,CAAC;AAKhF,eAAO,MAAM,WAAW;;;;;;;;;;;;OAiGtB,CAAC"}
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.memberAdded = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const __1 = require("../..");
|
|
7
|
-
const common_1 = require("../common");
|
|
8
|
-
exports.memberAdded = (0, pieces_framework_1.createTrigger)({
|
|
9
|
-
auth: __1.ghostAuth,
|
|
10
|
-
name: 'member_added',
|
|
11
|
-
displayName: 'Member Added',
|
|
12
|
-
description: 'Triggers when a new member is added',
|
|
13
|
-
aiMetadata: {
|
|
14
|
-
description: 'Fires when a new member is created in the Ghost publication (member.added), e.g. a new signup or subscriber. Payload carries the new member record.',
|
|
15
|
-
},
|
|
16
|
-
type: pieces_framework_1.TriggerStrategy.WEBHOOK,
|
|
17
|
-
props: {},
|
|
18
|
-
onEnable(context) {
|
|
19
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
20
|
-
var _a;
|
|
21
|
-
const webhookData = yield common_1.common.subscribeWebhook(context.auth, 'member.added', context.webhookUrl);
|
|
22
|
-
yield ((_a = context.store) === null || _a === void 0 ? void 0 : _a.put('_member_added_trigger', {
|
|
23
|
-
webhookId: webhookData.webhooks[0].id,
|
|
24
|
-
}));
|
|
25
|
-
});
|
|
26
|
-
},
|
|
27
|
-
onDisable(context) {
|
|
28
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
29
|
-
var _a;
|
|
30
|
-
const response = yield ((_a = context.store) === null || _a === void 0 ? void 0 : _a.get('_member_added_trigger'));
|
|
31
|
-
if (response !== null && response !== undefined) {
|
|
32
|
-
yield common_1.common.unsubscribeWebhook(context.auth, response.webhookId);
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
},
|
|
36
|
-
run(context) {
|
|
37
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
38
|
-
return [context.payload.body];
|
|
39
|
-
});
|
|
40
|
-
},
|
|
41
|
-
sampleData: {
|
|
42
|
-
member: {
|
|
43
|
-
current: {
|
|
44
|
-
id: '64be7cd524cb9a0001f49f04',
|
|
45
|
-
name: 'First Last',
|
|
46
|
-
note: null,
|
|
47
|
-
uuid: 'b6ef6f63-5bb0-4ace-8abf-f9f7c152659c',
|
|
48
|
-
email: 'my@email.com',
|
|
49
|
-
tiers: [],
|
|
50
|
-
comped: false,
|
|
51
|
-
labels: [],
|
|
52
|
-
status: 'free',
|
|
53
|
-
created_at: '2023-07-24T13:29:57.000Z',
|
|
54
|
-
subscribed: true,
|
|
55
|
-
updated_at: '2023-07-24T13:29:57.000Z',
|
|
56
|
-
email_count: 0,
|
|
57
|
-
geolocation: null,
|
|
58
|
-
newsletters: [
|
|
59
|
-
{
|
|
60
|
-
id: '64be4f5a03946b00098ef8f6',
|
|
61
|
-
name: 'Test Publication',
|
|
62
|
-
slug: 'default-newsletter',
|
|
63
|
-
uuid: '8bc1b063-57fa-4f26-8d7c-46a3d8002fad',
|
|
64
|
-
status: 'active',
|
|
65
|
-
created_at: '2023-07-24T10:15:54.000Z',
|
|
66
|
-
show_badge: true,
|
|
67
|
-
sort_order: 0,
|
|
68
|
-
updated_at: '2023-07-24T10:16:18.000Z',
|
|
69
|
-
visibility: 'members',
|
|
70
|
-
description: null,
|
|
71
|
-
sender_name: null,
|
|
72
|
-
title_color: null,
|
|
73
|
-
border_color: null,
|
|
74
|
-
header_image: null,
|
|
75
|
-
sender_email: null,
|
|
76
|
-
footer_content: null,
|
|
77
|
-
sender_reply_to: 'newsletter',
|
|
78
|
-
title_alignment: 'center',
|
|
79
|
-
background_color: 'light',
|
|
80
|
-
feedback_enabled: false,
|
|
81
|
-
show_comment_cta: true,
|
|
82
|
-
show_header_icon: true,
|
|
83
|
-
show_header_name: false,
|
|
84
|
-
show_header_title: true,
|
|
85
|
-
show_latest_posts: false,
|
|
86
|
-
body_font_category: 'sans_serif',
|
|
87
|
-
show_feature_image: true,
|
|
88
|
-
subscribe_on_signup: true,
|
|
89
|
-
title_font_category: 'sans_serif',
|
|
90
|
-
show_post_title_section: true,
|
|
91
|
-
show_subscription_details: false,
|
|
92
|
-
},
|
|
93
|
-
],
|
|
94
|
-
avatar_image: 'https://www.gravatar.com/avatar/123123123?s=250&r=g&d=blank',
|
|
95
|
-
last_seen_at: null,
|
|
96
|
-
subscriptions: [],
|
|
97
|
-
email_open_rate: null,
|
|
98
|
-
email_opened_count: 0,
|
|
99
|
-
},
|
|
100
|
-
previous: {},
|
|
101
|
-
},
|
|
102
|
-
},
|
|
103
|
-
});
|
|
104
|
-
//# sourceMappingURL=member-added.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"member-added.js","sourceRoot":"","sources":["../../../../src/lib/triggers/member-added.ts"],"names":[],"mappings":";;;;AAAA,qEAAgF;AAEhF,6BAAkC;AAClC,sCAAmC;AAEtB,QAAA,WAAW,GAAG,IAAA,gCAAa,EAAC;IACvC,IAAI,EAAE,aAAS;IACf,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,cAAc;IAC3B,WAAW,EAAE,qCAAqC;IAClD,UAAU,EAAE;QACV,WAAW,EAAE,qJAAqJ;KACnK;IACD,IAAI,EAAE,kCAAe,CAAC,OAAO;IAC7B,KAA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0B;wBAC9B,IAAI,EAAE,kBAAkB;wBACxB,IAAI,EAAE,oBAAoB;wBAC1B,IAAI,EAAE,sCAAsC;wBAC5C,MAAM,EAAE,QAAQ;wBAChB,UAAU,EAAE,0BAA0B;wBACtC,UAAU,EAAE,IAAI;wBAChB,UAAU,EAAE,CAAC;wBACb,UAAU,EAAE,0BAA0B;wBACtC,UAAU,EAAE,SAAS;wBACrB,WAAW,EAAE,IAAI;wBACjB,WAAW,EAAE,IAAI;wBACjB,WAAW,EAAE,IAAI;wBACjB,YAAY,EAAE,IAAI;wBAClB,YAAY,EAAE,IAAI;wBAClB,YAAY,EAAE,IAAI;wBAClB,cAAc,EAAE,IAAI;wBACpB,eAAe,EAAE,YAAY;wBAC7B,eAAe,EAAE,QAAQ;wBACzB,gBAAgB,EAAE,OAAO;wBACzB,gBAAgB,EAAE,KAAK;wBACvB,gBAAgB,EAAE,IAAI;wBACtB,gBAAgB,EAAE,IAAI;wBACtB,gBAAgB,EAAE,KAAK;wBACvB,iBAAiB,EAAE,IAAI;wBACvB,iBAAiB,EAAE,KAAK;wBACxB,kBAAkB,EAAE,YAAY;wBAChC,kBAAkB,EAAE,IAAI;wBACxB,mBAAmB,EAAE,IAAI;wBACzB,mBAAmB,EAAE,YAAY;wBACjC,uBAAuB,EAAE,IAAI;wBAC7B,yBAAyB,EAAE,KAAK;qBACjC;iBACF;gBACD,YAAY,EACV,6DAA6D;gBAC/D,YAAY,EAAE,IAAI;gBAClB,aAAa,EAAE,EAAE;gBACjB,eAAe,EAAE,IAAI;gBACrB,kBAAkB,EAAE,CAAC;aACtB;YACD,QAAQ,EAAE,EAAE;SACb;KACF;CACF,CAAC,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
-
export declare const memberDeleted: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
3
|
-
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
-
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
5
|
-
}>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
6
|
-
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
7
|
-
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
8
|
-
}>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
9
|
-
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
10
|
-
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
11
|
-
}>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
12
|
-
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
13
|
-
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
14
|
-
}>, {}>;
|
|
15
|
-
//# sourceMappingURL=member-deleted.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"member-deleted.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/member-deleted.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAiB,MAAM,gCAAgC,CAAC;AAKhF,eAAO,MAAM,aAAa;;;;;;;;;;;;OAiGxB,CAAC"}
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.memberDeleted = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const __1 = require("../..");
|
|
7
|
-
const common_1 = require("../common");
|
|
8
|
-
exports.memberDeleted = (0, pieces_framework_1.createTrigger)({
|
|
9
|
-
auth: __1.ghostAuth,
|
|
10
|
-
name: 'member_deleted',
|
|
11
|
-
displayName: 'Member Deleted',
|
|
12
|
-
description: 'Triggers when a member is deleted',
|
|
13
|
-
aiMetadata: {
|
|
14
|
-
description: 'Fires when a member is removed from the Ghost publication (member.deleted). Payload carries the deleted member record under the previous values.',
|
|
15
|
-
},
|
|
16
|
-
type: pieces_framework_1.TriggerStrategy.WEBHOOK,
|
|
17
|
-
props: {},
|
|
18
|
-
onEnable(context) {
|
|
19
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
20
|
-
var _a;
|
|
21
|
-
const webhookData = yield common_1.common.subscribeWebhook(context.auth, 'member.deleted', context.webhookUrl);
|
|
22
|
-
yield ((_a = context.store) === null || _a === void 0 ? void 0 : _a.put('_member_deleted_trigger', {
|
|
23
|
-
webhookId: webhookData.webhooks[0].id,
|
|
24
|
-
}));
|
|
25
|
-
});
|
|
26
|
-
},
|
|
27
|
-
onDisable(context) {
|
|
28
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
29
|
-
var _a;
|
|
30
|
-
const response = yield ((_a = context.store) === null || _a === void 0 ? void 0 : _a.get('_member_deleted_trigger'));
|
|
31
|
-
if (response !== null && response !== undefined) {
|
|
32
|
-
yield common_1.common.unsubscribeWebhook(context.auth, response.webhookId);
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
},
|
|
36
|
-
run(context) {
|
|
37
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
38
|
-
return [context.payload.body];
|
|
39
|
-
});
|
|
40
|
-
},
|
|
41
|
-
sampleData: {
|
|
42
|
-
member: {
|
|
43
|
-
current: {},
|
|
44
|
-
previous: {
|
|
45
|
-
id: '64be7cd524cb9a0001f49f04',
|
|
46
|
-
name: 'Updated Name',
|
|
47
|
-
note: null,
|
|
48
|
-
uuid: 'b6ef6f63-5bb0-4ace-8abf-f9f7c152659c',
|
|
49
|
-
email: 'my@email.com',
|
|
50
|
-
tiers: [],
|
|
51
|
-
comped: false,
|
|
52
|
-
labels: [],
|
|
53
|
-
status: 'free',
|
|
54
|
-
created_at: '2023-07-24T13:29:57.000Z',
|
|
55
|
-
subscribed: true,
|
|
56
|
-
updated_at: '2023-07-24T13:43:00.000Z',
|
|
57
|
-
email_count: 0,
|
|
58
|
-
geolocation: null,
|
|
59
|
-
newsletters: [
|
|
60
|
-
{
|
|
61
|
-
id: '64be4f5a03946b00098ef8f6',
|
|
62
|
-
name: 'Test Publication',
|
|
63
|
-
slug: 'default-newsletter',
|
|
64
|
-
uuid: '8bc1b063-57fa-4f26-8d7c-46a3d8002fad',
|
|
65
|
-
status: 'active',
|
|
66
|
-
created_at: '2023-07-24T10:15:54.000Z',
|
|
67
|
-
show_badge: true,
|
|
68
|
-
sort_order: 0,
|
|
69
|
-
updated_at: '2023-07-24T10:16:18.000Z',
|
|
70
|
-
visibility: 'members',
|
|
71
|
-
description: null,
|
|
72
|
-
sender_name: null,
|
|
73
|
-
title_color: null,
|
|
74
|
-
border_color: null,
|
|
75
|
-
header_image: null,
|
|
76
|
-
sender_email: null,
|
|
77
|
-
footer_content: null,
|
|
78
|
-
sender_reply_to: 'newsletter',
|
|
79
|
-
title_alignment: 'center',
|
|
80
|
-
background_color: 'light',
|
|
81
|
-
feedback_enabled: false,
|
|
82
|
-
show_comment_cta: true,
|
|
83
|
-
show_header_icon: true,
|
|
84
|
-
show_header_name: false,
|
|
85
|
-
show_header_title: true,
|
|
86
|
-
show_latest_posts: false,
|
|
87
|
-
body_font_category: 'sans_serif',
|
|
88
|
-
show_feature_image: true,
|
|
89
|
-
subscribe_on_signup: true,
|
|
90
|
-
title_font_category: 'sans_serif',
|
|
91
|
-
show_post_title_section: true,
|
|
92
|
-
show_subscription_details: false,
|
|
93
|
-
},
|
|
94
|
-
],
|
|
95
|
-
avatar_image: 'https://www.gravatar.com/avatar/123123123?s=250&r=g&d=blank',
|
|
96
|
-
last_seen_at: null,
|
|
97
|
-
subscriptions: [],
|
|
98
|
-
email_open_rate: null,
|
|
99
|
-
email_opened_count: 0,
|
|
100
|
-
},
|
|
101
|
-
},
|
|
102
|
-
},
|
|
103
|
-
});
|
|
104
|
-
//# sourceMappingURL=member-deleted.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"member-deleted.js","sourceRoot":"","sources":["../../../../src/lib/triggers/member-deleted.ts"],"names":[],"mappings":";;;;AAAA,qEAAgF;AAEhF,6BAAkC;AAClC,sCAAmC;AAEtB,QAAA,aAAa,GAAG,IAAA,gCAAa,EAAC;IACzC,IAAI,EAAE,aAAS;IACf,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE,mCAAmC;IAChD,UAAU,EAAE;QACV,WAAW,EAAE,kJAAkJ;KAChK;IACD,IAAI,EAAE,kCAAe,CAAC,OAAO;IAC7B,KAAK,EAAE,EAAE;IACH,QAAQ,CAAC,OAAO;;;YACpB,MAAM,WAAW,GAAQ,MAAM,eAAM,CAAC,gBAAgB,CACpD,OAAO,CAAC,IAAI,EACZ,gBAAgB,EAChB,OAAO,CAAC,UAAU,CACnB,CAAC;YAEF,MAAM,CAAA,MAAA,OAAO,CAAC,KAAK,0CAAE,GAAG,CAAC,yBAAyB,EAAE;gBAClD,SAAS,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE;aACtC,CAAC,CAAA,CAAC;QACL,CAAC;KAAA;IACK,SAAS,CAAC,OAAO;;;YACrB,MAAM,QAAQ,GAEH,MAAM,CAAA,MAAA,OAAO,CAAC,KAAK,0CAAE,GAAG,CAAC,yBAAyB,CAAC,CAAA,CAAC;YAE/D,IAAI,QAAQ,KAAK,IAAI,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;gBAChD,MAAM,eAAM,CAAC,kBAAkB,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,SAAS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KAAK;wBACvB,iBAAiB,EAAE,IAAI;wBACvB,iBAAiB,EAAE,KAAK;wBACxB,kBAAkB,EAAE,YAAY;wBAChC,kBAAkB,EAAE,IAAI;wBACxB,mBAAmB,EAAE,IAAI;wBACzB,mBAAmB,EAAE,YAAY;wBACjC,uBAAuB,EAAE,IAAI;wBAC7B,yBAAyB,EAAE,KAAK;qBACjC;iBACF;gBACD,YAAY,EACV,6DAA6D;gBAC/D,YAAY,EAAE,IAAI;gBAClB,aAAa,EAAE,EAAE;gBACjB,eAAe,EAAE,IAAI;gBACrB,kBAAkB,EAAE,CAAC;aACtB;SACF;KACF;CACF,CAAC,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
-
export declare const memberEdited: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
3
|
-
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
-
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
5
|
-
}>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
6
|
-
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
7
|
-
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
8
|
-
}>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
9
|
-
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
10
|
-
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
11
|
-
}>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
12
|
-
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
13
|
-
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
14
|
-
}>, {}>;
|
|
15
|
-
//# sourceMappingURL=member-edited.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"member-edited.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/member-edited.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAiB,MAAM,gCAAgC,CAAC;AAKhF,eAAO,MAAM,YAAY;;;;;;;;;;;;OAsGvB,CAAC"}
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.memberEdited = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const __1 = require("../..");
|
|
7
|
-
const common_1 = require("../common");
|
|
8
|
-
exports.memberEdited = (0, pieces_framework_1.createTrigger)({
|
|
9
|
-
auth: __1.ghostAuth,
|
|
10
|
-
name: 'member_edited',
|
|
11
|
-
displayName: 'Member Edited',
|
|
12
|
-
description: 'Triggers when a member is edited',
|
|
13
|
-
aiMetadata: {
|
|
14
|
-
description: 'Fires when an existing member is updated in the Ghost publication (member.edited), e.g. a changed email, name, note, or newsletter subscription. Payload carries the current and previous member values.',
|
|
15
|
-
},
|
|
16
|
-
type: pieces_framework_1.TriggerStrategy.WEBHOOK,
|
|
17
|
-
props: {},
|
|
18
|
-
onEnable(context) {
|
|
19
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
20
|
-
var _a;
|
|
21
|
-
const webhookData = yield common_1.common.subscribeWebhook(context.auth, 'member.edited', context.webhookUrl);
|
|
22
|
-
yield ((_a = context.store) === null || _a === void 0 ? void 0 : _a.put('_member_edited_trigger', {
|
|
23
|
-
webhookId: webhookData.webhooks[0].id,
|
|
24
|
-
}));
|
|
25
|
-
});
|
|
26
|
-
},
|
|
27
|
-
onDisable(context) {
|
|
28
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
29
|
-
var _a;
|
|
30
|
-
const response = yield ((_a = context.store) === null || _a === void 0 ? void 0 : _a.get('_member_edited_trigger'));
|
|
31
|
-
if (response !== null && response !== undefined) {
|
|
32
|
-
yield common_1.common.unsubscribeWebhook(context.auth, response.webhookId);
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
},
|
|
36
|
-
run(context) {
|
|
37
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
38
|
-
return [context.payload.body];
|
|
39
|
-
});
|
|
40
|
-
},
|
|
41
|
-
sampleData: {
|
|
42
|
-
member: {
|
|
43
|
-
current: {
|
|
44
|
-
id: '64be7cd524cb9a0001f49f04',
|
|
45
|
-
name: 'Updated Name',
|
|
46
|
-
note: null,
|
|
47
|
-
uuid: 'b6ef6f63-5bb0-4ace-8abf-f9f7c152659c',
|
|
48
|
-
email: 'my@email.com',
|
|
49
|
-
tiers: [],
|
|
50
|
-
comped: false,
|
|
51
|
-
labels: [],
|
|
52
|
-
status: 'free',
|
|
53
|
-
created_at: '2023-07-24T13:29:57.000Z',
|
|
54
|
-
subscribed: true,
|
|
55
|
-
updated_at: '2023-07-24T13:43:00.000Z',
|
|
56
|
-
email_count: 0,
|
|
57
|
-
geolocation: null,
|
|
58
|
-
newsletters: [
|
|
59
|
-
{
|
|
60
|
-
id: '64be4f5a03946b00098ef8f6',
|
|
61
|
-
name: 'Test Publication',
|
|
62
|
-
slug: 'default-newsletter',
|
|
63
|
-
uuid: '8bc1b063-57fa-4f26-8d7c-46a3d8002fad',
|
|
64
|
-
status: 'active',
|
|
65
|
-
created_at: '2023-07-24T10:15:54.000Z',
|
|
66
|
-
show_badge: true,
|
|
67
|
-
sort_order: 0,
|
|
68
|
-
updated_at: '2023-07-24T10:16:18.000Z',
|
|
69
|
-
visibility: 'members',
|
|
70
|
-
description: null,
|
|
71
|
-
sender_name: null,
|
|
72
|
-
title_color: null,
|
|
73
|
-
border_color: null,
|
|
74
|
-
header_image: null,
|
|
75
|
-
sender_email: null,
|
|
76
|
-
footer_content: null,
|
|
77
|
-
sender_reply_to: 'newsletter',
|
|
78
|
-
title_alignment: 'center',
|
|
79
|
-
background_color: 'light',
|
|
80
|
-
feedback_enabled: false,
|
|
81
|
-
show_comment_cta: true,
|
|
82
|
-
show_header_icon: true,
|
|
83
|
-
show_header_name: false,
|
|
84
|
-
show_header_title: true,
|
|
85
|
-
show_latest_posts: false,
|
|
86
|
-
body_font_category: 'sans_serif',
|
|
87
|
-
show_feature_image: true,
|
|
88
|
-
subscribe_on_signup: true,
|
|
89
|
-
title_font_category: 'sans_serif',
|
|
90
|
-
show_post_title_section: true,
|
|
91
|
-
show_subscription_details: false,
|
|
92
|
-
},
|
|
93
|
-
],
|
|
94
|
-
avatar_image: 'https://www.gravatar.com/avatar/123123123?s=250&r=g&d=blank',
|
|
95
|
-
last_seen_at: null,
|
|
96
|
-
subscriptions: [],
|
|
97
|
-
email_open_rate: null,
|
|
98
|
-
email_opened_count: 0,
|
|
99
|
-
},
|
|
100
|
-
previous: {
|
|
101
|
-
email: 'new@email.com',
|
|
102
|
-
note: null,
|
|
103
|
-
updated_at: '2023-07-24T13:38:29.000Z',
|
|
104
|
-
newsletters: [],
|
|
105
|
-
},
|
|
106
|
-
},
|
|
107
|
-
},
|
|
108
|
-
});
|
|
109
|
-
//# sourceMappingURL=member-edited.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"member-edited.js","sourceRoot":"","sources":["../../../../src/lib/triggers/member-edited.ts"],"names":[],"mappings":";;;;AAAA,qEAAgF;AAEhF,6BAAkC;AAClC,sCAAmC;AAEtB,QAAA,YAAY,GAAG,IAAA,gCAAa,EAAC;IACxC,IAAI,EAAE,aAAS;IACf,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,eAAe;IAC5B,WAAW,EAAE,kCAAkC;IAC/C,UAAU,EA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1,15 +0,0 @@
|
|
|
1
|
-
import { TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
-
export declare const pagePublished: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
3
|
-
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
-
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
5
|
-
}>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
6
|
-
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
7
|
-
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
8
|
-
}>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
9
|
-
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
10
|
-
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
11
|
-
}>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
12
|
-
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
13
|
-
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
14
|
-
}>, {}>;
|
|
15
|
-
//# sourceMappingURL=page-published.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"page-published.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/page-published.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAiB,MAAM,gCAAgC,CAAC;AAKhF,eAAO,MAAM,aAAa;;;;;;;;;;;;OA8MxB,CAAC"}
|