@activepieces/piece-ghostcms 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -0
- package/package.json +17 -0
- package/src/index.d.ts +8 -0
- package/src/index.js +62 -0
- package/src/index.js.map +1 -0
- package/src/lib/actions/create-member.d.ts +9 -0
- package/src/lib/actions/create-member.js +60 -0
- package/src/lib/actions/create-member.js.map +1 -0
- package/src/lib/actions/create-post.d.ts +14 -0
- package/src/lib/actions/create-post.js +84 -0
- package/src/lib/actions/create-post.js.map +1 -0
- package/src/lib/actions/find-member.d.ts +6 -0
- package/src/lib/actions/find-member.js +36 -0
- package/src/lib/actions/find-member.js.map +1 -0
- package/src/lib/actions/find-user.d.ts +6 -0
- package/src/lib/actions/find-user.js +36 -0
- package/src/lib/actions/find-user.js.map +1 -0
- package/src/lib/actions/update-member.d.ts +10 -0
- package/src/lib/actions/update-member.js +65 -0
- package/src/lib/actions/update-member.js.map +1 -0
- package/src/lib/common/index.d.ts +15 -0
- package/src/lib/common/index.js +198 -0
- package/src/lib/common/index.js.map +1 -0
- package/src/lib/triggers/member-added.d.ts +5 -0
- package/src/lib/triggers/member-added.js +101 -0
- package/src/lib/triggers/member-added.js.map +1 -0
- package/src/lib/triggers/member-deleted.d.ts +5 -0
- package/src/lib/triggers/member-deleted.js +101 -0
- package/src/lib/triggers/member-deleted.js.map +1 -0
- package/src/lib/triggers/member-edited.d.ts +5 -0
- package/src/lib/triggers/member-edited.js +106 -0
- package/src/lib/triggers/member-edited.js.map +1 -0
- package/src/lib/triggers/page-published.d.ts +5 -0
- package/src/lib/triggers/page-published.js +208 -0
- package/src/lib/triggers/page-published.js.map +1 -0
- package/src/lib/triggers/post-published.d.ts +5 -0
- package/src/lib/triggers/post-published.js +209 -0
- package/src/lib/triggers/post-published.js.map +1 -0
- package/src/lib/triggers/post-scheduled.d.ts +5 -0
- package/src/lib/triggers/post-scheduled.js +209 -0
- package/src/lib/triggers/post-scheduled.js.map +1 -0
|
@@ -0,0 +1,198 @@
|
|
|
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
|
+
exports.common = {
|
|
9
|
+
properties: {
|
|
10
|
+
newsletters: (required = true) => {
|
|
11
|
+
return pieces_framework_1.Property.MultiSelectDropdown({
|
|
12
|
+
displayName: 'Newsletters',
|
|
13
|
+
required: required,
|
|
14
|
+
refreshers: [],
|
|
15
|
+
options: ({ auth }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
+
if (!auth) {
|
|
17
|
+
return {
|
|
18
|
+
disabled: true,
|
|
19
|
+
placeholder: 'Connect your account',
|
|
20
|
+
options: []
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
const newsletters = (yield exports.common.getNewsletters(auth)).newsletters.map((newsletter) => {
|
|
24
|
+
return {
|
|
25
|
+
label: newsletter.name,
|
|
26
|
+
value: newsletter.id
|
|
27
|
+
};
|
|
28
|
+
});
|
|
29
|
+
return {
|
|
30
|
+
options: newsletters
|
|
31
|
+
};
|
|
32
|
+
})
|
|
33
|
+
});
|
|
34
|
+
},
|
|
35
|
+
member: (required = true) => {
|
|
36
|
+
return pieces_framework_1.Property.Dropdown({
|
|
37
|
+
displayName: 'Member',
|
|
38
|
+
required: required,
|
|
39
|
+
refreshers: [],
|
|
40
|
+
options: ({ auth }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
41
|
+
if (!auth) {
|
|
42
|
+
return {
|
|
43
|
+
disabled: true,
|
|
44
|
+
placeholder: 'Connect your account',
|
|
45
|
+
options: []
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
const members = (yield exports.common.getMembers(auth)).members.map((member) => {
|
|
49
|
+
var _a;
|
|
50
|
+
return {
|
|
51
|
+
label: (_a = member.name) !== null && _a !== void 0 ? _a : member.email,
|
|
52
|
+
value: member.id
|
|
53
|
+
};
|
|
54
|
+
});
|
|
55
|
+
return {
|
|
56
|
+
options: members
|
|
57
|
+
};
|
|
58
|
+
})
|
|
59
|
+
});
|
|
60
|
+
},
|
|
61
|
+
author: pieces_framework_1.Property.Dropdown({
|
|
62
|
+
displayName: 'Author',
|
|
63
|
+
required: true,
|
|
64
|
+
refreshers: [],
|
|
65
|
+
options: ({ auth }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
66
|
+
if (!auth) {
|
|
67
|
+
return {
|
|
68
|
+
disabled: true,
|
|
69
|
+
placeholder: 'Connect your account',
|
|
70
|
+
options: []
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
const authors = (yield exports.common.getUsers(auth)).users.map((user) => {
|
|
74
|
+
var _a;
|
|
75
|
+
return {
|
|
76
|
+
label: (_a = user.name) !== null && _a !== void 0 ? _a : user.email,
|
|
77
|
+
value: user.email
|
|
78
|
+
};
|
|
79
|
+
});
|
|
80
|
+
return {
|
|
81
|
+
options: authors
|
|
82
|
+
};
|
|
83
|
+
})
|
|
84
|
+
}),
|
|
85
|
+
tags: pieces_framework_1.Property.MultiSelectDropdown({
|
|
86
|
+
displayName: 'Tags',
|
|
87
|
+
required: false,
|
|
88
|
+
refreshers: [],
|
|
89
|
+
options: ({ auth }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
90
|
+
if (!auth) {
|
|
91
|
+
return {
|
|
92
|
+
disabled: true,
|
|
93
|
+
placeholder: 'Connect your account',
|
|
94
|
+
options: []
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
const tags = (yield exports.common.getTags(auth)).tags.map((tag) => {
|
|
98
|
+
return {
|
|
99
|
+
label: tag.name,
|
|
100
|
+
value: tag.name
|
|
101
|
+
};
|
|
102
|
+
});
|
|
103
|
+
return {
|
|
104
|
+
options: tags
|
|
105
|
+
};
|
|
106
|
+
})
|
|
107
|
+
})
|
|
108
|
+
},
|
|
109
|
+
jwtFromApiKey: (apiKey) => {
|
|
110
|
+
const [id, secret] = apiKey.split(':');
|
|
111
|
+
return jsonwebtoken_1.default.sign({}, Buffer.from(secret, 'hex'), {
|
|
112
|
+
keyid: id,
|
|
113
|
+
expiresIn: '5m',
|
|
114
|
+
audience: '/admin/'
|
|
115
|
+
});
|
|
116
|
+
},
|
|
117
|
+
subscribeWebhook(auth, webhookType, webhookUrl) {
|
|
118
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
119
|
+
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
120
|
+
url: `${auth.baseUrl}/ghost/api/admin/webhooks`,
|
|
121
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
122
|
+
headers: {
|
|
123
|
+
'Authorization': `Ghost ${exports.common.jwtFromApiKey(auth.apiKey)}`
|
|
124
|
+
},
|
|
125
|
+
body: {
|
|
126
|
+
webhooks: [
|
|
127
|
+
{
|
|
128
|
+
target_url: webhookUrl,
|
|
129
|
+
event: webhookType
|
|
130
|
+
}
|
|
131
|
+
]
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
return response.body;
|
|
135
|
+
});
|
|
136
|
+
},
|
|
137
|
+
unsubscribeWebhook(auth, webhookId) {
|
|
138
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
139
|
+
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
140
|
+
url: `${auth.baseUrl}/ghost/api/admin/webhooks/${webhookId}`,
|
|
141
|
+
method: pieces_common_1.HttpMethod.DELETE,
|
|
142
|
+
headers: {
|
|
143
|
+
'Authorization': `Ghost ${exports.common.jwtFromApiKey(auth.apiKey)}`
|
|
144
|
+
},
|
|
145
|
+
});
|
|
146
|
+
return response.body;
|
|
147
|
+
});
|
|
148
|
+
},
|
|
149
|
+
getNewsletters(auth) {
|
|
150
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
151
|
+
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
152
|
+
url: `${auth.baseUrl}/ghost/api/admin/newsletters`,
|
|
153
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
154
|
+
headers: {
|
|
155
|
+
'Authorization': `Ghost ${exports.common.jwtFromApiKey(auth.apiKey)}`
|
|
156
|
+
},
|
|
157
|
+
});
|
|
158
|
+
return response.body;
|
|
159
|
+
});
|
|
160
|
+
},
|
|
161
|
+
getMembers(auth) {
|
|
162
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
163
|
+
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
164
|
+
url: `${auth.baseUrl}/ghost/api/admin/members`,
|
|
165
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
166
|
+
headers: {
|
|
167
|
+
'Authorization': `Ghost ${exports.common.jwtFromApiKey(auth.apiKey)}`
|
|
168
|
+
},
|
|
169
|
+
});
|
|
170
|
+
return response.body;
|
|
171
|
+
});
|
|
172
|
+
},
|
|
173
|
+
getUsers(auth) {
|
|
174
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
175
|
+
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
176
|
+
url: `${auth.baseUrl}/ghost/api/admin/users`,
|
|
177
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
178
|
+
headers: {
|
|
179
|
+
'Authorization': `Ghost ${exports.common.jwtFromApiKey(auth.apiKey)}`
|
|
180
|
+
},
|
|
181
|
+
});
|
|
182
|
+
return response.body;
|
|
183
|
+
});
|
|
184
|
+
},
|
|
185
|
+
getTags(auth) {
|
|
186
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
187
|
+
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
188
|
+
url: `${auth.baseUrl}/ghost/api/admin/tags`,
|
|
189
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
190
|
+
headers: {
|
|
191
|
+
'Authorization': `Ghost ${exports.common.jwtFromApiKey(auth.apiKey)}`
|
|
192
|
+
},
|
|
193
|
+
});
|
|
194
|
+
return response.body;
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/ghostcms/src/lib/common/index.ts"],"names":[],"mappings":";;;;AAAA,+DAAqE;AACrE,qEAA0D;AAE1D,wEAA+B;AAElB,QAAA,MAAM,GAAG;IAClB,UAAU,EAAE;QACR,WAAW,EAAE,CAAC,QAAQ,GAAG,IAAI,EAAE,EAAE;YAC7B,OAAO,2BAAQ,CAAC,mBAAmB,CAAC;gBAChC,WAAW,EAAE,aAAa;gBAC1B,QAAQ,EAAE,QAAQ;gBAClB,UAAU,EAAE,EAAE;gBACd,OAAO,EAAE,CAAO,EAAE,IAAI,EAAE,EAAE,EAAE;oBACxB,IAAI,CAAC,IAAI,EAAE;wBACP,OAAO;4BACH,QAAQ,EAAE,IAAI;4BACd,WAAW,EAAE,sBAAsB;4BACnC,OAAO,EAAE,EAAE;yBACd,CAAA;qBACJ;oBAED,MAAM,WAAW,GAAG,CAAC,MAAM,cAAM,CAAC,cAAc,CAAC,IAAI,CAA4B,CAAA,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,UAAe,EAAE,EAAE;wBAClH,OAAO;4BACH,KAAK,EAAE,UAAU,CAAC,IAAI;4BACtB,KAAK,EAAE,UAAU,CAAC,EAAE;yBACvB,CAAA;oBACL,CAAC,CAAC,CAAC;oBACH,OAAO;wBACH,OAAO,EAAE,WAAW;qBACvB,CAAA;gBACL,CAAC,CAAA;aACJ,CAAC,CAAA;QACN,CAAC;QACD,MAAM,EAAE,CAAC,QAAQ,GAAG,IAAI,EAAE,EAAE;YACxB,OAAO,2BAAQ,CAAC,QAAQ,CAA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B;gBAC9C,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,OAAO,EAAE;oBACL,eAAe,EAAE,SAAS,cAAM,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;iBAChE;aACJ,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACzB,CAAC;KAAA;IAEK,QAAQ,CAAC,IAAS;;YACpB,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC1C,GAAG,EAAE,GAAG,IAAI,CAAC,OAAO,wBAAwB;gBAC5C,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,OAAO,EAAE;oBACL,eAAe,EAAE,SAAS,cAAM,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;iBAChE;aACJ,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACzB,CAAC;KAAA;IAEK,OAAO,CAAC,IAAS;;YACnB,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC1C,GAAG,EAAE,GAAG,IAAI,CAAC,OAAO,uBAAuB;gBAC3C,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,OAAO,EAAE;oBACL,eAAe,EAAE,SAAS,cAAM,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;iBAChE;aACJ,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACzB,CAAC;KAAA;CACJ,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { TriggerStrategy } from "@activepieces/pieces-framework";
|
|
2
|
+
export declare const memberAdded: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<true, {
|
|
3
|
+
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
5
|
+
}>, {}>;
|
|
@@ -0,0 +1,101 @@
|
|
|
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
|
+
type: pieces_framework_1.TriggerStrategy.WEBHOOK,
|
|
14
|
+
props: {},
|
|
15
|
+
onEnable(context) {
|
|
16
|
+
var _a;
|
|
17
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
18
|
+
const webhookData = yield common_1.common.subscribeWebhook(context.auth, 'member.added', context.webhookUrl);
|
|
19
|
+
yield ((_a = context.store) === null || _a === void 0 ? void 0 : _a.put('_member_added_trigger', {
|
|
20
|
+
webhookId: webhookData.webhooks[0].id,
|
|
21
|
+
}));
|
|
22
|
+
});
|
|
23
|
+
},
|
|
24
|
+
onDisable(context) {
|
|
25
|
+
var _a;
|
|
26
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
const response = yield ((_a = context.store) === null || _a === void 0 ? void 0 : _a.get('_member_added_trigger'));
|
|
28
|
+
if (response !== null && response !== undefined) {
|
|
29
|
+
yield common_1.common.unsubscribeWebhook(context.auth, response.webhookId);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
},
|
|
33
|
+
run(context) {
|
|
34
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
35
|
+
return [context.payload.body];
|
|
36
|
+
});
|
|
37
|
+
},
|
|
38
|
+
sampleData: {
|
|
39
|
+
"member": {
|
|
40
|
+
"current": {
|
|
41
|
+
"id": "64be7cd524cb9a0001f49f04",
|
|
42
|
+
"name": "First Last",
|
|
43
|
+
"note": null,
|
|
44
|
+
"uuid": "b6ef6f63-5bb0-4ace-8abf-f9f7c152659c",
|
|
45
|
+
"email": "my@email.com",
|
|
46
|
+
"tiers": [],
|
|
47
|
+
"comped": false,
|
|
48
|
+
"labels": [],
|
|
49
|
+
"status": "free",
|
|
50
|
+
"created_at": "2023-07-24T13:29:57.000Z",
|
|
51
|
+
"subscribed": true,
|
|
52
|
+
"updated_at": "2023-07-24T13:29:57.000Z",
|
|
53
|
+
"email_count": 0,
|
|
54
|
+
"geolocation": null,
|
|
55
|
+
"newsletters": [
|
|
56
|
+
{
|
|
57
|
+
"id": "64be4f5a03946b00098ef8f6",
|
|
58
|
+
"name": "Test Publication",
|
|
59
|
+
"slug": "default-newsletter",
|
|
60
|
+
"uuid": "8bc1b063-57fa-4f26-8d7c-46a3d8002fad",
|
|
61
|
+
"status": "active",
|
|
62
|
+
"created_at": "2023-07-24T10:15:54.000Z",
|
|
63
|
+
"show_badge": true,
|
|
64
|
+
"sort_order": 0,
|
|
65
|
+
"updated_at": "2023-07-24T10:16:18.000Z",
|
|
66
|
+
"visibility": "members",
|
|
67
|
+
"description": null,
|
|
68
|
+
"sender_name": null,
|
|
69
|
+
"title_color": null,
|
|
70
|
+
"border_color": null,
|
|
71
|
+
"header_image": null,
|
|
72
|
+
"sender_email": null,
|
|
73
|
+
"footer_content": null,
|
|
74
|
+
"sender_reply_to": "newsletter",
|
|
75
|
+
"title_alignment": "center",
|
|
76
|
+
"background_color": "light",
|
|
77
|
+
"feedback_enabled": false,
|
|
78
|
+
"show_comment_cta": true,
|
|
79
|
+
"show_header_icon": true,
|
|
80
|
+
"show_header_name": false,
|
|
81
|
+
"show_header_title": true,
|
|
82
|
+
"show_latest_posts": false,
|
|
83
|
+
"body_font_category": "sans_serif",
|
|
84
|
+
"show_feature_image": true,
|
|
85
|
+
"subscribe_on_signup": true,
|
|
86
|
+
"title_font_category": "sans_serif",
|
|
87
|
+
"show_post_title_section": true,
|
|
88
|
+
"show_subscription_details": false
|
|
89
|
+
}
|
|
90
|
+
],
|
|
91
|
+
"avatar_image": "https://www.gravatar.com/avatar/123123123?s=250&r=g&d=blank",
|
|
92
|
+
"last_seen_at": null,
|
|
93
|
+
"subscriptions": [],
|
|
94
|
+
"email_open_rate": null,
|
|
95
|
+
"email_opened_count": 0
|
|
96
|
+
},
|
|
97
|
+
"previous": {}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
//# sourceMappingURL=member-added.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"member-added.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/ghostcms/src/lib/triggers/member-added.ts"],"names":[],"mappings":";;;;AAAA,qEAAgF;AAEhF,6BAAkC;AAClC,sCAAmC;AAEtB,QAAA,WAAW,GAAG,IAAA,gCAAa,EAAC;IACrC,IAAI,EAAE,aAAS;IACf,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,cAAc;IAC3B,WAAW,EAAE,qCAAqC;IAClD,IAAI,EAAE,kCAAe,CAAC,OAAO;IAC7B,KAAK,EAAE,EAAE;IACH,QAAQ,CAAC,OAAO;;;YAClB,MAAM,WAAW,GAAQ,MAAM,eAAM,CAAC,gBAAgB,CAAC,OAAO,CAAC,IAAI,EAAE,cAAc,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;YAEzG,MAAM,CAAA,MAAA,OAAO,CAAC,KAAK,0CAAE,GAAG,CAAC,uBAAuB,EAAE;gBAC9C,SAAS,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE;aACxC,CAAC,CAAA,CAAC;;KACN;IACK,SAAS,CAAC,OAAO;;;YACnB,MAAM,QAAQ,GAEH,MAAM,CAAA,MAAA,OAAO,CAAC,KAAK,0CAAE,GAAG,CAAC,uBAAuB,CAAC,CAAA,CAAC;YAE7D,IAAI,QAAQ,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wBAC3B,kBAAkB,EAAE,KAAK;wBACzB,kBAAkB,EAAE,IAAI;wBACxB,kBAAkB,EAAE,IAAI;wBACxB,kBAAkB,EAAE,KAAK;wBACzB,mBAAmB,EAAE,IAAI;wBACzB,mBAAmB,EAAE,KAAK;wBAC1B,oBAAoB,EAAE,YAAY;wBAClC,oBAAoB,EAAE,IAAI;wBAC1B,qBAAqB,EAAE,IAAI;wBAC3B,qBAAqB,EAAE,YAAY;wBACnC,yBAAyB,EAAE,IAAI;wBAC/B,2BAA2B,EAAE,KAAK;qBACrC;iBACJ;gBACD,cAAc,EAAE,6DAA6D;gBAC7E,cAAc,EAAE,IAAI;gBACpB,eAAe,EAAE,EAAE;gBACnB,iBAAiB,EAAE,IAAI;gBACvB,oBAAoB,EAAE,CAAC;aAC1B;YACD,UAAU,EAAE,EAAE;SACjB;KACJ;CACJ,CAAC,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { TriggerStrategy } from "@activepieces/pieces-framework";
|
|
2
|
+
export declare const memberDeleted: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<true, {
|
|
3
|
+
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
5
|
+
}>, {}>;
|
|
@@ -0,0 +1,101 @@
|
|
|
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
|
+
type: pieces_framework_1.TriggerStrategy.WEBHOOK,
|
|
14
|
+
props: {},
|
|
15
|
+
onEnable(context) {
|
|
16
|
+
var _a;
|
|
17
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
18
|
+
const webhookData = yield common_1.common.subscribeWebhook(context.auth, 'member.deleted', context.webhookUrl);
|
|
19
|
+
yield ((_a = context.store) === null || _a === void 0 ? void 0 : _a.put('_member_deleted_trigger', {
|
|
20
|
+
webhookId: webhookData.webhooks[0].id,
|
|
21
|
+
}));
|
|
22
|
+
});
|
|
23
|
+
},
|
|
24
|
+
onDisable(context) {
|
|
25
|
+
var _a;
|
|
26
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
const response = yield ((_a = context.store) === null || _a === void 0 ? void 0 : _a.get('_member_deleted_trigger'));
|
|
28
|
+
if (response !== null && response !== undefined) {
|
|
29
|
+
yield common_1.common.unsubscribeWebhook(context.auth, response.webhookId);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
},
|
|
33
|
+
run(context) {
|
|
34
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
35
|
+
return [context.payload.body];
|
|
36
|
+
});
|
|
37
|
+
},
|
|
38
|
+
sampleData: {
|
|
39
|
+
"member": {
|
|
40
|
+
"current": {},
|
|
41
|
+
"previous": {
|
|
42
|
+
"id": "64be7cd524cb9a0001f49f04",
|
|
43
|
+
"name": "Updated Name",
|
|
44
|
+
"note": null,
|
|
45
|
+
"uuid": "b6ef6f63-5bb0-4ace-8abf-f9f7c152659c",
|
|
46
|
+
"email": "my@email.com",
|
|
47
|
+
"tiers": [],
|
|
48
|
+
"comped": false,
|
|
49
|
+
"labels": [],
|
|
50
|
+
"status": "free",
|
|
51
|
+
"created_at": "2023-07-24T13:29:57.000Z",
|
|
52
|
+
"subscribed": true,
|
|
53
|
+
"updated_at": "2023-07-24T13:43:00.000Z",
|
|
54
|
+
"email_count": 0,
|
|
55
|
+
"geolocation": null,
|
|
56
|
+
"newsletters": [
|
|
57
|
+
{
|
|
58
|
+
"id": "64be4f5a03946b00098ef8f6",
|
|
59
|
+
"name": "Test Publication",
|
|
60
|
+
"slug": "default-newsletter",
|
|
61
|
+
"uuid": "8bc1b063-57fa-4f26-8d7c-46a3d8002fad",
|
|
62
|
+
"status": "active",
|
|
63
|
+
"created_at": "2023-07-24T10:15:54.000Z",
|
|
64
|
+
"show_badge": true,
|
|
65
|
+
"sort_order": 0,
|
|
66
|
+
"updated_at": "2023-07-24T10:16:18.000Z",
|
|
67
|
+
"visibility": "members",
|
|
68
|
+
"description": null,
|
|
69
|
+
"sender_name": null,
|
|
70
|
+
"title_color": null,
|
|
71
|
+
"border_color": null,
|
|
72
|
+
"header_image": null,
|
|
73
|
+
"sender_email": null,
|
|
74
|
+
"footer_content": null,
|
|
75
|
+
"sender_reply_to": "newsletter",
|
|
76
|
+
"title_alignment": "center",
|
|
77
|
+
"background_color": "light",
|
|
78
|
+
"feedback_enabled": false,
|
|
79
|
+
"show_comment_cta": true,
|
|
80
|
+
"show_header_icon": true,
|
|
81
|
+
"show_header_name": false,
|
|
82
|
+
"show_header_title": true,
|
|
83
|
+
"show_latest_posts": false,
|
|
84
|
+
"body_font_category": "sans_serif",
|
|
85
|
+
"show_feature_image": true,
|
|
86
|
+
"subscribe_on_signup": true,
|
|
87
|
+
"title_font_category": "sans_serif",
|
|
88
|
+
"show_post_title_section": true,
|
|
89
|
+
"show_subscription_details": false
|
|
90
|
+
}
|
|
91
|
+
],
|
|
92
|
+
"avatar_image": "https://www.gravatar.com/avatar/123123123?s=250&r=g&d=blank",
|
|
93
|
+
"last_seen_at": null,
|
|
94
|
+
"subscriptions": [],
|
|
95
|
+
"email_open_rate": null,
|
|
96
|
+
"email_opened_count": 0
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
//# sourceMappingURL=member-deleted.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"member-deleted.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/ghostcms/src/lib/triggers/member-deleted.ts"],"names":[],"mappings":";;;;AAAA,qEAAgF;AAEhF,6BAAkC;AAClC,sCAAmC;AAEtB,QAAA,aAAa,GAAG,IAAA,gCAAa,EAAC;IACvC,IAAI,EAAE,aAAS;IACf,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE,mCAAmC;IAChD,IAAI,EAAE,kCAAe,CAAC,OAAO;IAC7B,KAAK,EAAE,EAAE;IACH,QAAQ,CAAC,OAAO;;;YAClB,MAAM,WAAW,GAAQ,MAAM,eAAM,CAAC,gBAAgB,CAAC,OAAO,CAAC,IAAI,EAAE,gBAAgB,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;YAE3G,MAAM,CAAA,MAAA,OAAO,CAAC,KAAK,0CAAE,GAAG,CAAC,yBAAyB,EAAE;gBAChD,SAAS,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE;aACxC,CAAC,CAAA,CAAC;;KACN;IACK,SAAS,CAAC,OAAO;;;YACnB,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;gBAC7C,MAAM,eAAM,CAAC,kBAAkB,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC;aACrE;;KACJ;IACK,GAAG,CAAC,OAAO;;YACb,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAClC,CAAC;KAAA;IAED,UAAU,EAAE;QACR,QAAQ,EAAE;YACN,SAAS,EAAE,EAAE;YACb,UAAU,EAAE;gBAER,IAAI,EAAE,0BAA0B;gBACh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;qBACrC;iBACJ;gBACD,cAAc,EAAE,6DAA6D;gBAC7E,cAAc,EAAE,IAAI;gBACpB,eAAe,EAAE,EAAE;gBACnB,iBAAiB,EAAE,IAAI;gBACvB,oBAAoB,EAAE,CAAC;aAC1B;SACJ;KACJ;CACJ,CAAC,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { TriggerStrategy } from "@activepieces/pieces-framework";
|
|
2
|
+
export declare const memberEdited: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<true, {
|
|
3
|
+
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
5
|
+
}>, {}>;
|
|
@@ -0,0 +1,106 @@
|
|
|
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
|
+
type: pieces_framework_1.TriggerStrategy.WEBHOOK,
|
|
14
|
+
props: {},
|
|
15
|
+
onEnable(context) {
|
|
16
|
+
var _a;
|
|
17
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
18
|
+
const webhookData = yield common_1.common.subscribeWebhook(context.auth, 'member.edited', context.webhookUrl);
|
|
19
|
+
yield ((_a = context.store) === null || _a === void 0 ? void 0 : _a.put('_member_edited_trigger', {
|
|
20
|
+
webhookId: webhookData.webhooks[0].id,
|
|
21
|
+
}));
|
|
22
|
+
});
|
|
23
|
+
},
|
|
24
|
+
onDisable(context) {
|
|
25
|
+
var _a;
|
|
26
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
const response = yield ((_a = context.store) === null || _a === void 0 ? void 0 : _a.get('_member_edited_trigger'));
|
|
28
|
+
if (response !== null && response !== undefined) {
|
|
29
|
+
yield common_1.common.unsubscribeWebhook(context.auth, response.webhookId);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
},
|
|
33
|
+
run(context) {
|
|
34
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
35
|
+
return [context.payload.body];
|
|
36
|
+
});
|
|
37
|
+
},
|
|
38
|
+
sampleData: {
|
|
39
|
+
"member": {
|
|
40
|
+
"current": {
|
|
41
|
+
"id": "64be7cd524cb9a0001f49f04",
|
|
42
|
+
"name": "Updated Name",
|
|
43
|
+
"note": null,
|
|
44
|
+
"uuid": "b6ef6f63-5bb0-4ace-8abf-f9f7c152659c",
|
|
45
|
+
"email": "my@email.com",
|
|
46
|
+
"tiers": [],
|
|
47
|
+
"comped": false,
|
|
48
|
+
"labels": [],
|
|
49
|
+
"status": "free",
|
|
50
|
+
"created_at": "2023-07-24T13:29:57.000Z",
|
|
51
|
+
"subscribed": true,
|
|
52
|
+
"updated_at": "2023-07-24T13:43:00.000Z",
|
|
53
|
+
"email_count": 0,
|
|
54
|
+
"geolocation": null,
|
|
55
|
+
"newsletters": [
|
|
56
|
+
{
|
|
57
|
+
"id": "64be4f5a03946b00098ef8f6",
|
|
58
|
+
"name": "Test Publication",
|
|
59
|
+
"slug": "default-newsletter",
|
|
60
|
+
"uuid": "8bc1b063-57fa-4f26-8d7c-46a3d8002fad",
|
|
61
|
+
"status": "active",
|
|
62
|
+
"created_at": "2023-07-24T10:15:54.000Z",
|
|
63
|
+
"show_badge": true,
|
|
64
|
+
"sort_order": 0,
|
|
65
|
+
"updated_at": "2023-07-24T10:16:18.000Z",
|
|
66
|
+
"visibility": "members",
|
|
67
|
+
"description": null,
|
|
68
|
+
"sender_name": null,
|
|
69
|
+
"title_color": null,
|
|
70
|
+
"border_color": null,
|
|
71
|
+
"header_image": null,
|
|
72
|
+
"sender_email": null,
|
|
73
|
+
"footer_content": null,
|
|
74
|
+
"sender_reply_to": "newsletter",
|
|
75
|
+
"title_alignment": "center",
|
|
76
|
+
"background_color": "light",
|
|
77
|
+
"feedback_enabled": false,
|
|
78
|
+
"show_comment_cta": true,
|
|
79
|
+
"show_header_icon": true,
|
|
80
|
+
"show_header_name": false,
|
|
81
|
+
"show_header_title": true,
|
|
82
|
+
"show_latest_posts": false,
|
|
83
|
+
"body_font_category": "sans_serif",
|
|
84
|
+
"show_feature_image": true,
|
|
85
|
+
"subscribe_on_signup": true,
|
|
86
|
+
"title_font_category": "sans_serif",
|
|
87
|
+
"show_post_title_section": true,
|
|
88
|
+
"show_subscription_details": false
|
|
89
|
+
}
|
|
90
|
+
],
|
|
91
|
+
"avatar_image": "https://www.gravatar.com/avatar/123123123?s=250&r=g&d=blank",
|
|
92
|
+
"last_seen_at": null,
|
|
93
|
+
"subscriptions": [],
|
|
94
|
+
"email_open_rate": null,
|
|
95
|
+
"email_opened_count": 0
|
|
96
|
+
},
|
|
97
|
+
"previous": {
|
|
98
|
+
"email": "new@email.com",
|
|
99
|
+
"note": null,
|
|
100
|
+
"updated_at": "2023-07-24T13:38:29.000Z",
|
|
101
|
+
"newsletters": []
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
//# sourceMappingURL=member-edited.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"member-edited.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/ghostcms/src/lib/triggers/member-edited.ts"],"names":[],"mappings":";;;;AAAA,qEAAgF;AAEhF,6BAAkC;AAClC,sCAAmC;AAEtB,QAAA,YAAY,GAAG,IAAA,gCAAa,EAAC;IACtC,IAAI,EAAE,aAAS;IACf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;SACJ;KACJ;CACJ,CAAC,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { TriggerStrategy } from "@activepieces/pieces-framework";
|
|
2
|
+
export declare const pagePublished: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<true, {
|
|
3
|
+
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
5
|
+
}>, {}>;
|