@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.
Files changed (53) hide show
  1. package/package.json +7 -16
  2. package/src/index.js +56 -72
  3. package/src/index.d.ts +0 -9
  4. package/src/index.d.ts.map +0 -1
  5. package/src/index.js.map +0 -1
  6. package/src/lib/actions/create-member.d.ts +0 -16
  7. package/src/lib/actions/create-member.d.ts.map +0 -1
  8. package/src/lib/actions/create-member.js +0 -62
  9. package/src/lib/actions/create-member.js.map +0 -1
  10. package/src/lib/actions/create-post.d.ts +0 -21
  11. package/src/lib/actions/create-post.d.ts.map +0 -1
  12. package/src/lib/actions/create-post.js +0 -86
  13. package/src/lib/actions/create-post.js.map +0 -1
  14. package/src/lib/actions/find-member.d.ts +0 -7
  15. package/src/lib/actions/find-member.d.ts.map +0 -1
  16. package/src/lib/actions/find-member.js +0 -38
  17. package/src/lib/actions/find-member.js.map +0 -1
  18. package/src/lib/actions/find-user.d.ts +0 -7
  19. package/src/lib/actions/find-user.d.ts.map +0 -1
  20. package/src/lib/actions/find-user.js +0 -38
  21. package/src/lib/actions/find-user.js.map +0 -1
  22. package/src/lib/actions/update-member.d.ts +0 -23
  23. package/src/lib/actions/update-member.d.ts.map +0 -1
  24. package/src/lib/actions/update-member.js +0 -65
  25. package/src/lib/actions/update-member.js.map +0 -1
  26. package/src/lib/common/index.d.ts +0 -34
  27. package/src/lib/common/index.d.ts.map +0 -1
  28. package/src/lib/common/index.js +0 -203
  29. package/src/lib/common/index.js.map +0 -1
  30. package/src/lib/triggers/member-added.d.ts +0 -15
  31. package/src/lib/triggers/member-added.d.ts.map +0 -1
  32. package/src/lib/triggers/member-added.js +0 -104
  33. package/src/lib/triggers/member-added.js.map +0 -1
  34. package/src/lib/triggers/member-deleted.d.ts +0 -15
  35. package/src/lib/triggers/member-deleted.d.ts.map +0 -1
  36. package/src/lib/triggers/member-deleted.js +0 -104
  37. package/src/lib/triggers/member-deleted.js.map +0 -1
  38. package/src/lib/triggers/member-edited.d.ts +0 -15
  39. package/src/lib/triggers/member-edited.d.ts.map +0 -1
  40. package/src/lib/triggers/member-edited.js +0 -109
  41. package/src/lib/triggers/member-edited.js.map +0 -1
  42. package/src/lib/triggers/page-published.d.ts +0 -15
  43. package/src/lib/triggers/page-published.d.ts.map +0 -1
  44. package/src/lib/triggers/page-published.js +0 -211
  45. package/src/lib/triggers/page-published.js.map +0 -1
  46. package/src/lib/triggers/post-published.d.ts +0 -15
  47. package/src/lib/triggers/post-published.d.ts.map +0 -1
  48. package/src/lib/triggers/post-published.js +0 -212
  49. package/src/lib/triggers/post-published.js.map +0 -1
  50. package/src/lib/triggers/post-scheduled.d.ts +0 -15
  51. package/src/lib/triggers/post-scheduled.d.ts.map +0 -1
  52. package/src/lib/triggers/post-scheduled.js +0 -212
  53. package/src/lib/triggers/post-scheduled.js.map +0 -1
@@ -1,211 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.pagePublished = 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.pagePublished = (0, pieces_framework_1.createTrigger)({
9
- auth: __1.ghostAuth,
10
- name: 'page_published',
11
- displayName: 'Page Published',
12
- description: 'Triggers when a page is published',
13
- aiMetadata: {
14
- description: 'Fires when a page is published in the Ghost publication (page.published), i.e. a page transitions to published status. Payload carries the published page 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, 'page.published', context.webhookUrl);
22
- yield ((_a = context.store) === null || _a === void 0 ? void 0 : _a.put('_page_published_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('_page_published_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
- page: {
43
- current: {
44
- id: '64be860724cb9a0001f49f37',
45
- url: 'https://test-publication.ghost.io/my-page/',
46
- html: '<p>Page content</p>',
47
- slug: 'my-page',
48
- tags: [],
49
- uuid: 'c2d16c98-f967-4aaa-ba10-ff4fedbb351e',
50
- count: {
51
- signups: 0,
52
- paid_conversions: 0,
53
- negative_feedback: 0,
54
- positive_feedback: 0,
55
- },
56
- tiers: [
57
- {
58
- id: '64be4f5a03946b00098ef8f4',
59
- name: 'Free',
60
- slug: 'free',
61
- type: 'free',
62
- active: true,
63
- currency: null,
64
- created_at: '2023-07-24T10:15:54.000Z',
65
- trial_days: 0,
66
- updated_at: '2023-07-24T10:15:54.000Z',
67
- visibility: 'public',
68
- description: null,
69
- yearly_price: null,
70
- monthly_price: null,
71
- yearly_price_id: null,
72
- monthly_price_id: null,
73
- welcome_page_url: null,
74
- },
75
- {
76
- id: '64be4f5a03946b00098ef8f5',
77
- name: 'Test Publication',
78
- slug: 'default-product',
79
- type: 'paid',
80
- active: true,
81
- currency: 'usd',
82
- created_at: '2023-07-24T10:15:54.000Z',
83
- trial_days: 0,
84
- updated_at: '2023-07-24T10:15:54.000Z',
85
- visibility: 'public',
86
- description: null,
87
- yearly_price: 5000,
88
- monthly_price: 500,
89
- yearly_price_id: null,
90
- monthly_price_id: null,
91
- welcome_page_url: null,
92
- },
93
- ],
94
- title: 'My Page',
95
- status: 'published',
96
- authors: [
97
- {
98
- id: '1',
99
- bio: null,
100
- url: 'https://test-publication.ghost.io/author/slug/',
101
- name: 'First Last',
102
- slug: 'slug',
103
- tour: null,
104
- email: 'my@email.com',
105
- roles: [
106
- {
107
- id: '64be4f5903946b00098ef8eb',
108
- name: 'Owner',
109
- created_at: '2023-07-24T10:15:53.000Z',
110
- updated_at: '2023-07-24T10:15:53.000Z',
111
- description: 'Blog Owner',
112
- },
113
- ],
114
- status: 'active',
115
- twitter: null,
116
- website: null,
117
- facebook: null,
118
- location: null,
119
- last_seen: '2023-07-24T14:05:21.000Z',
120
- created_at: '2023-07-24T10:15:53.000Z',
121
- meta_title: null,
122
- updated_at: '2023-07-24T14:05:21.000Z',
123
- cover_image: null,
124
- accessibility: '{"nightShift":true}',
125
- profile_image: 'https://www.gravatar.com/avatar/123123123?s=250&r=x&d=mp',
126
- meta_description: null,
127
- comment_notifications: true,
128
- mention_notifications: true,
129
- milestone_notifications: true,
130
- free_member_signup_notification: true,
131
- paid_subscription_started_notification: true,
132
- paid_subscription_canceled_notification: false,
133
- },
134
- ],
135
- excerpt: 'Page content',
136
- featured: false,
137
- og_image: null,
138
- og_title: null,
139
- mobiledoc: '{"version":"0.3.1","atoms":[],"cards":[],"markups":[],"sections":[[1,"p",[[0,[],0,"Page content"]]]],"ghostVersion":"4.0"}',
140
- plaintext: 'Page content',
141
- comment_id: '64be860724cb9a0001f49f37',
142
- created_at: '2023-07-24T14:09:11.000Z',
143
- meta_title: null,
144
- updated_at: '2023-07-24T14:09:19.000Z',
145
- visibility: 'public',
146
- frontmatter: null,
147
- primary_tag: null,
148
- published_at: '2023-07-24T14:09:19.000Z',
149
- reading_time: 0,
150
- canonical_url: null,
151
- feature_image: null,
152
- twitter_image: null,
153
- twitter_title: null,
154
- custom_excerpt: null,
155
- og_description: null,
156
- post_revisions: [],
157
- primary_author: {
158
- id: '1',
159
- bio: null,
160
- url: 'https://test-publication.ghost.io/author/slug/',
161
- name: 'First Last',
162
- slug: 'slug',
163
- tour: null,
164
- email: 'my@email.com',
165
- roles: [
166
- {
167
- id: '64be4f5903946b00098ef8eb',
168
- name: 'Owner',
169
- created_at: '2023-07-24T10:15:53.000Z',
170
- updated_at: '2023-07-24T10:15:53.000Z',
171
- description: 'Blog Owner',
172
- },
173
- ],
174
- status: 'active',
175
- twitter: null,
176
- website: null,
177
- facebook: null,
178
- location: null,
179
- last_seen: '2023-07-24T14:05:21.000Z',
180
- created_at: '2023-07-24T10:15:53.000Z',
181
- meta_title: null,
182
- updated_at: '2023-07-24T14:05:21.000Z',
183
- cover_image: null,
184
- accessibility: '{"nightShift":true}',
185
- profile_image: 'https://www.gravatar.com/avatar/123123123?s=250&r=x&d=mp',
186
- meta_description: null,
187
- comment_notifications: true,
188
- mention_notifications: true,
189
- milestone_notifications: true,
190
- free_member_signup_notification: true,
191
- paid_subscription_started_notification: true,
192
- paid_subscription_canceled_notification: false,
193
- },
194
- custom_template: null,
195
- meta_description: null,
196
- feature_image_alt: null,
197
- codeinjection_foot: null,
198
- codeinjection_head: null,
199
- twitter_description: null,
200
- feature_image_caption: null,
201
- show_title_and_feature_image: true,
202
- },
203
- previous: {
204
- status: 'draft',
205
- updated_at: '2023-07-24T14:09:16.000Z',
206
- published_at: null,
207
- },
208
- },
209
- },
210
- });
211
- //# sourceMappingURL=page-published.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"page-published.js","sourceRoot":"","sources":["../../../../src/lib/triggers/page-published.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,mKAAmK;KACjL;IACD,IAAI,EAAE,kCAAe,CAAC,OAAO;IAC7B,KAAK,EAAE,EAAE;IACH,QAAQ,CAAC,OAAO;;;YACpB,MAAM,WAAW,GAAQ,MAAM,eAAM,CAAC,gBAAgB,CACpD,OAAO,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ACb,UAAU,EAAE,0BAA0B;4BACtC,UAAU,EAAE,0BAA0B;4BACtC,WAAW,EAAE,YAAY;yBAC1B;qBACF;oBACD,MAAM,EAAE,QAAQ;oBAChB,OAAO,EAAE,IAAI;oBACb,OAAO,EAAE,IAAI;oBACb,QAAQ,EAAE,IAAI;oBACd,QAAQ,EAAE,IAAI;oBACd,SAAS,EAAE,0BAA0B;oBACrC,UAAU,EAAE,0BAA0B;oBACtC,UAAU,EAAE,IAAI;oBAChB,UAAU,EAAE,0BAA0B;oBACtC,WAAW,EAAE,IAAI;oBACjB,aAAa,EAAE,qBAAqB;oBACpC,aAAa,EACX,0DAA0D;oBAC5D,gBAAgB,EAAE,IAAI;oBACtB,qBAAqB,EAAE,IAAI;oBAC3B,qBAAqB,EAAE,IAAI;oBAC3B,uBAAuB,EAAE,IAAI;oBAC7B,+BAA+B,EAAE,IAAI;oBACrC,sCAAsC,EAAE,IAAI;oBAC5C,uCAAuC,EAAE,KAAK;iBAC/C;gBACD,eAAe,EAAE,IAAI;gBACrB,gBAAgB,EAAE,IAAI;gBACtB,iBAAiB,EAAE,IAAI;gBACvB,kBAAkB,EAAE,IAAI;gBACxB,kBAAkB,EAAE,IAAI;gBACxB,mBAAmB,EAAE,IAAI;gBACzB,qBAAqB,EAAE,IAAI;gBAC3B,4BAA4B,EAAE,IAAI;aACnC;YACD,QAAQ,EAAE;gBACR,MAAM,EAAE,OAAO;gBACf,UAAU,EAAE,0BAA0B;gBACtC,YAAY,EAAE,IAAI;aACnB;SACF;KACF;CACF,CAAC,CAAC"}
@@ -1,15 +0,0 @@
1
- import { TriggerStrategy } from '@activepieces/pieces-framework';
2
- export declare const postPublished: 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=post-published.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"post-published.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/post-published.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAiB,MAAM,gCAAgC,CAAC;AAKhF,eAAO,MAAM,aAAa;;;;;;;;;;;;OA+MxB,CAAC"}
@@ -1,212 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.postPublished = 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.postPublished = (0, pieces_framework_1.createTrigger)({
9
- auth: __1.ghostAuth,
10
- name: 'post_published',
11
- displayName: 'Post Published',
12
- description: 'Triggers when a post is published',
13
- aiMetadata: {
14
- description: 'Fires when a post is published in the Ghost publication (post.published), i.e. a post transitions to published status and goes live. Payload carries the published post 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, 'post.published', context.webhookUrl);
22
- yield ((_a = context.store) === null || _a === void 0 ? void 0 : _a.put('_post_published_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('_post_published_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
- post: {
43
- current: {
44
- id: '64be83c424cb9a0001f49f1d',
45
- url: 'https://test-publication.ghost.io/test-post/',
46
- html: '<p>Hello my friends</p><p></p><p>this is testing</p>',
47
- slug: 'test-post',
48
- tags: [],
49
- uuid: '77afb2c2-af1a-4a7f-bebc-fa1e314579d0',
50
- count: {
51
- clicks: 0,
52
- negative_feedback: 0,
53
- positive_feedback: 0,
54
- },
55
- tiers: [
56
- {
57
- id: '64be4f5a03946b00098ef8f4',
58
- name: 'Free',
59
- slug: 'free',
60
- type: 'free',
61
- active: true,
62
- currency: null,
63
- created_at: '2023-07-24T10:15:54.000Z',
64
- trial_days: 0,
65
- updated_at: '2023-07-24T10:15:54.000Z',
66
- visibility: 'public',
67
- description: null,
68
- yearly_price: null,
69
- monthly_price: null,
70
- yearly_price_id: null,
71
- monthly_price_id: null,
72
- welcome_page_url: null,
73
- },
74
- {
75
- id: '64be4f5a03946b00098ef8f5',
76
- name: 'Test Publication',
77
- slug: 'default-product',
78
- type: 'paid',
79
- active: true,
80
- currency: 'usd',
81
- created_at: '2023-07-24T10:15:54.000Z',
82
- trial_days: 0,
83
- updated_at: '2023-07-24T10:15:54.000Z',
84
- visibility: 'public',
85
- description: null,
86
- yearly_price: 5000,
87
- monthly_price: 500,
88
- yearly_price_id: null,
89
- monthly_price_id: null,
90
- welcome_page_url: null,
91
- },
92
- ],
93
- title: 'Test Post',
94
- status: 'published',
95
- authors: [
96
- {
97
- id: '1',
98
- bio: null,
99
- url: 'https://test-publication.ghost.io/author/slug/',
100
- name: 'First Last',
101
- slug: 'slug',
102
- tour: null,
103
- email: 'my@email.com',
104
- roles: [
105
- {
106
- id: '64be4f5903946b00098ef8eb',
107
- name: 'Owner',
108
- created_at: '2023-07-24T10:15:53.000Z',
109
- updated_at: '2023-07-24T10:15:53.000Z',
110
- description: 'Blog Owner',
111
- },
112
- ],
113
- status: 'active',
114
- twitter: null,
115
- website: null,
116
- facebook: null,
117
- location: null,
118
- last_seen: '2023-07-24T13:05:18.000Z',
119
- created_at: '2023-07-24T10:15:53.000Z',
120
- meta_title: null,
121
- updated_at: '2023-07-24T13:05:18.000Z',
122
- cover_image: null,
123
- accessibility: '{"nightShift":true}',
124
- profile_image: 'https://www.gravatar.com/avatar/123123123?s=250&r=x&d=mp',
125
- meta_description: null,
126
- comment_notifications: true,
127
- mention_notifications: true,
128
- milestone_notifications: true,
129
- free_member_signup_notification: true,
130
- paid_subscription_started_notification: true,
131
- paid_subscription_canceled_notification: false,
132
- },
133
- ],
134
- excerpt: 'Hello my friends\n\n\n\nthis is testing',
135
- featured: false,
136
- og_image: null,
137
- og_title: null,
138
- mobiledoc: '{"version":"0.3.1","atoms":[],"cards":[],"markups":[],"sections":[[1,"p",[[0,[],0,"Hello my friends"]]],[1,"p",[]],[1,"p",[[0,[],0,"this is testing"]]]],"ghostVersion":"4.0"}',
139
- plaintext: 'Hello my friends\n\n\n\nthis is testing',
140
- comment_id: '64be83c424cb9a0001f49f1d',
141
- created_at: '2023-07-24T13:59:32.000Z',
142
- email_only: false,
143
- meta_title: null,
144
- updated_at: '2023-07-24T13:59:43.000Z',
145
- visibility: 'public',
146
- frontmatter: null,
147
- primary_tag: null,
148
- published_at: '2023-07-24T13:59:43.000Z',
149
- reading_time: 0,
150
- canonical_url: null,
151
- email_segment: 'all',
152
- email_subject: null,
153
- feature_image: null,
154
- twitter_image: null,
155
- twitter_title: null,
156
- custom_excerpt: null,
157
- og_description: null,
158
- post_revisions: [],
159
- primary_author: {
160
- id: '1',
161
- bio: null,
162
- url: 'https://test-publication.ghost.io/author/slug/',
163
- name: 'First Last',
164
- slug: 'slug',
165
- tour: null,
166
- email: 'my@email.com',
167
- roles: [
168
- {
169
- id: '64be4f5903946b00098ef8eb',
170
- name: 'Owner',
171
- created_at: '2023-07-24T10:15:53.000Z',
172
- updated_at: '2023-07-24T10:15:53.000Z',
173
- description: 'Blog Owner',
174
- },
175
- ],
176
- status: 'active',
177
- twitter: null,
178
- website: null,
179
- facebook: null,
180
- location: null,
181
- last_seen: '2023-07-24T13:05:18.000Z',
182
- created_at: '2023-07-24T10:15:53.000Z',
183
- meta_title: null,
184
- updated_at: '2023-07-24T13:05:18.000Z',
185
- cover_image: null,
186
- accessibility: '{"nightShift":true}',
187
- profile_image: 'https://www.gravatar.com/avatar/123123123?s=250&r=x&d=mp',
188
- meta_description: null,
189
- comment_notifications: true,
190
- mention_notifications: true,
191
- milestone_notifications: true,
192
- free_member_signup_notification: true,
193
- paid_subscription_started_notification: true,
194
- paid_subscription_canceled_notification: false,
195
- },
196
- custom_template: null,
197
- meta_description: null,
198
- feature_image_alt: null,
199
- codeinjection_foot: null,
200
- codeinjection_head: null,
201
- twitter_description: null,
202
- feature_image_caption: null,
203
- },
204
- previous: {
205
- status: 'draft',
206
- updated_at: '2023-07-24T13:59:39.000Z',
207
- published_at: null,
208
- },
209
- },
210
- },
211
- });
212
- //# sourceMappingURL=post-published.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"post-published.js","sourceRoot":"","sources":["../../../../src/lib/triggers/post-published.ts"],"names":[],"mappings":";;;;AAAA,qEAAgF;AAEhF,6BAAkC;AAClC,sCAAmC;AAEtB,QAAA,aAAa,GAAG,IAAA,gCAAa,EAAC;IACzC,IAAI,EAAE,aAAS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IAAI;aACnB;SACF;KACF;CACF,CAAC,CAAC"}
@@ -1,15 +0,0 @@
1
- import { TriggerStrategy } from '@activepieces/pieces-framework';
2
- export declare const postScheduled: 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=post-scheduled.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"post-scheduled.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/post-scheduled.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAiB,MAAM,gCAAgC,CAAC;AAKhF,eAAO,MAAM,aAAa;;;;;;;;;;;;OA+MxB,CAAC"}