@activepieces/piece-feedhive 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/package.json +16 -0
- package/src/index.d.ts +4 -0
- package/src/index.d.ts.map +1 -0
- package/src/index.js +47 -0
- package/src/index.js.map +1 -0
- package/src/lib/actions/create-label.d.ts +4 -0
- package/src/lib/actions/create-label.d.ts.map +1 -0
- package/src/lib/actions/create-label.js +37 -0
- package/src/lib/actions/create-label.js.map +1 -0
- package/src/lib/actions/create-post.d.ts +10 -0
- package/src/lib/actions/create-post.d.ts.map +1 -0
- package/src/lib/actions/create-post.js +78 -0
- package/src/lib/actions/create-post.js.map +1 -0
- package/src/lib/actions/delete-post.d.ts +4 -0
- package/src/lib/actions/delete-post.d.ts.map +1 -0
- package/src/lib/actions/delete-post.js +28 -0
- package/src/lib/actions/delete-post.js.map +1 -0
- package/src/lib/actions/fire-workflow-trigger.d.ts +12 -0
- package/src/lib/actions/fire-workflow-trigger.d.ts.map +1 -0
- package/src/lib/actions/fire-workflow-trigger.js +93 -0
- package/src/lib/actions/fire-workflow-trigger.js.map +1 -0
- package/src/lib/actions/get-post.d.ts +4 -0
- package/src/lib/actions/get-post.d.ts.map +1 -0
- package/src/lib/actions/get-post.js +28 -0
- package/src/lib/actions/get-post.js.map +1 -0
- package/src/lib/actions/list-posts.d.ts +6 -0
- package/src/lib/actions/list-posts.d.ts.map +1 -0
- package/src/lib/actions/list-posts.js +58 -0
- package/src/lib/actions/list-posts.js.map +1 -0
- package/src/lib/actions/update-post.d.ts +11 -0
- package/src/lib/actions/update-post.d.ts.map +1 -0
- package/src/lib/actions/update-post.js +78 -0
- package/src/lib/actions/update-post.js.map +1 -0
- package/src/lib/common/auth.d.ts +2 -0
- package/src/lib/common/auth.d.ts.map +1 -0
- package/src/lib/common/auth.js +33 -0
- package/src/lib/common/auth.js.map +1 -0
- package/src/lib/common/index.d.ts +18 -0
- package/src/lib/common/index.d.ts.map +1 -0
- package/src/lib/common/index.js +144 -0
- package/src/lib/common/index.js.map +1 -0
- package/src/lib/triggers/comment-notification.d.ts +11 -0
- package/src/lib/triggers/comment-notification.d.ts.map +1 -0
- package/src/lib/triggers/comment-notification.js +93 -0
- package/src/lib/triggers/comment-notification.js.map +1 -0
- package/src/lib/triggers/post-notification.d.ts +15 -0
- package/src/lib/triggers/post-notification.d.ts.map +1 -0
- package/src/lib/triggers/post-notification.js +116 -0
- package/src/lib/triggers/post-notification.js.map +1 -0
package/package.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@activepieces/piece-feedhive",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"main": "./src/index.js",
|
|
5
|
+
"types": "./src/index.d.ts",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "tsc -p tsconfig.lib.json && cp package.json dist/",
|
|
8
|
+
"lint": "eslint 'src/**/*.ts'"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"@activepieces/pieces-common": "0.12.3",
|
|
12
|
+
"@activepieces/pieces-framework": "0.29.0",
|
|
13
|
+
"@activepieces/shared": "0.81.1",
|
|
14
|
+
"tslib": "2.6.2"
|
|
15
|
+
}
|
|
16
|
+
}
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAWjD,OAAO,EAAE,YAAY,EAAE,CAAC;AAExB,eAAO,MAAM,QAAQ,mHAyBnB,CAAC"}
|
package/src/index.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.feedhive = exports.feedhiveAuth = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
+
const shared_1 = require("@activepieces/shared");
|
|
8
|
+
const auth_1 = require("./lib/common/auth");
|
|
9
|
+
Object.defineProperty(exports, "feedhiveAuth", { enumerable: true, get: function () { return auth_1.feedhiveAuth; } });
|
|
10
|
+
const post_notification_1 = require("./lib/triggers/post-notification");
|
|
11
|
+
const comment_notification_1 = require("./lib/triggers/comment-notification");
|
|
12
|
+
const create_post_1 = require("./lib/actions/create-post");
|
|
13
|
+
const update_post_1 = require("./lib/actions/update-post");
|
|
14
|
+
const get_post_1 = require("./lib/actions/get-post");
|
|
15
|
+
const delete_post_1 = require("./lib/actions/delete-post");
|
|
16
|
+
const list_posts_1 = require("./lib/actions/list-posts");
|
|
17
|
+
const create_label_1 = require("./lib/actions/create-label");
|
|
18
|
+
const fire_workflow_trigger_1 = require("./lib/actions/fire-workflow-trigger");
|
|
19
|
+
exports.feedhive = (0, pieces_framework_1.createPiece)({
|
|
20
|
+
displayName: 'FeedHive',
|
|
21
|
+
description: 'Schedule, manage and publish social media content with FeedHive.',
|
|
22
|
+
minimumSupportedRelease: '0.36.1',
|
|
23
|
+
logoUrl: 'https://cdn.activepieces.com/pieces/feedhive.png',
|
|
24
|
+
categories: [shared_1.PieceCategory.MARKETING],
|
|
25
|
+
auth: auth_1.feedhiveAuth,
|
|
26
|
+
authors: ['bst1n'],
|
|
27
|
+
actions: [
|
|
28
|
+
create_post_1.createPostAction,
|
|
29
|
+
update_post_1.updatePostAction,
|
|
30
|
+
get_post_1.getPostAction,
|
|
31
|
+
delete_post_1.deletePostAction,
|
|
32
|
+
list_posts_1.listPostsAction,
|
|
33
|
+
create_label_1.createLabelAction,
|
|
34
|
+
fire_workflow_trigger_1.fireWorkflowTriggerAction,
|
|
35
|
+
(0, pieces_common_1.createCustomApiCallAction)({
|
|
36
|
+
baseUrl: () => 'https://api.feedhive.com',
|
|
37
|
+
auth: auth_1.feedhiveAuth,
|
|
38
|
+
authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
39
|
+
return ({
|
|
40
|
+
Authorization: `Bearer ${auth.secret_text}`,
|
|
41
|
+
});
|
|
42
|
+
}),
|
|
43
|
+
}),
|
|
44
|
+
],
|
|
45
|
+
triggers: [post_notification_1.postNotificationTrigger, comment_notification_1.commentNotificationTrigger],
|
|
46
|
+
});
|
|
47
|
+
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,qEAA6D;AAC7D,+DAAwE;AACxE,iDAAqD;AACrD,4CAAiD;AAWxC,6FAXA,mBAAY,OAWA;AAVrB,wEAA2E;AAC3E,8EAAiF;AACjF,2DAA6D;AAC7D,2DAA6D;AAC7D,qDAAuD;AACvD,2DAA6D;AAC7D,yDAA2D;AAC3D,6DAA+D;AAC/D,+EAAgF;AAInE,QAAA,QAAQ,GAAG,IAAA,8BAAW,EAAC;IAClC,WAAW,EAAE,UAAU;IACvB,WAAW,EAAE,kEAAkE;IAC/E,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,kDAAkD;IAC3D,UAAU,EAAE,CAAC,sBAAa,CAAC,SAAS,CAAC;IACrC,IAAI,EAAE,mBAAY;IAClB,OAAO,EAAE,CAAC,OAAO,CAAC;IAClB,OAAO,EAAE;QACP,8BAAgB;QAChB,8BAAgB;QAChB,wBAAa;QACb,8BAAgB;QAChB,4BAAe;QACf,gCAAiB;QACjB,iDAAyB;QACzB,IAAA,yCAAyB,EAAC;YACxB,OAAO,EAAE,GAAG,EAAE,CAAC,0BAA0B;YACzC,IAAI,EAAE,mBAAY;YAClB,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAAC,OAAA,CAAC;oBAC5B,aAAa,EAAE,UAAU,IAAI,CAAC,WAAW,EAAE;iBAC5C,CAAC,CAAA;cAAA;SACH,CAAC;KACH;IACD,QAAQ,EAAE,CAAC,2CAAuB,EAAE,iDAA0B,CAAC;CAChE,CAAC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const createLabelAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
+
title: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
+
}>;
|
|
4
|
+
//# sourceMappingURL=create-label.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-label.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/create-label.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,iBAAiB;;EA2B5B,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createLabelAction = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
+
const auth_1 = require("../common/auth");
|
|
8
|
+
const common_1 = require("../common");
|
|
9
|
+
exports.createLabelAction = (0, pieces_framework_1.createAction)({
|
|
10
|
+
auth: auth_1.feedhiveAuth,
|
|
11
|
+
name: 'create_label',
|
|
12
|
+
displayName: 'Create Label',
|
|
13
|
+
description: 'Creates a new label in FeedHive for organising posts.',
|
|
14
|
+
props: {
|
|
15
|
+
title: pieces_framework_1.Property.ShortText({
|
|
16
|
+
displayName: 'Label Name',
|
|
17
|
+
description: 'The name of the label (e.g. "Campaign Q1", "Evergreen Content").',
|
|
18
|
+
required: true,
|
|
19
|
+
}),
|
|
20
|
+
},
|
|
21
|
+
run(context) {
|
|
22
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
var _a, _b, _c, _d;
|
|
24
|
+
const response = yield common_1.feedhiveCommon.apiCall({
|
|
25
|
+
token: context.auth.secret_text,
|
|
26
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
27
|
+
path: '/labels',
|
|
28
|
+
body: { title: context.propsValue.title },
|
|
29
|
+
});
|
|
30
|
+
return {
|
|
31
|
+
id: (_b = (_a = response.body.data) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : null,
|
|
32
|
+
title: (_d = (_c = response.body.data) === null || _c === void 0 ? void 0 : _c.title) !== null && _d !== void 0 ? _d : null,
|
|
33
|
+
};
|
|
34
|
+
});
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
//# sourceMappingURL=create-label.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-label.js","sourceRoot":"","sources":["../../../../src/lib/actions/create-label.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,yCAA8C;AAC9C,sCAA2C;AAE9B,QAAA,iBAAiB,GAAG,IAAA,+BAAY,EAAC;IAC5C,IAAI,EAAE,mBAAY;IAClB,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,cAAc;IAC3B,WAAW,EAAE,uDAAuD;IACpE,KAAK,EAAE;QACL,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,YAAY;YACzB,WAAW,EAAE,kEAAkE;YAC/E,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;;YACf,MAAM,QAAQ,GAAG,MAAM,uBAAc,CAAC,OAAO,CAE1C;gBACD,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,WAAW;gBAC/B,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK,EAAE;aAC1C,CAAC,CAAC;YAEH,OAAO;gBACL,EAAE,EAAE,MAAA,MAAA,QAAQ,CAAC,IAAI,CAAC,IAAI,0CAAE,EAAE,mCAAI,IAAI;gBAClC,KAAK,EAAE,MAAA,MAAA,QAAQ,CAAC,IAAI,CAAC,IAAI,0CAAE,KAAK,mCAAI,IAAI;aACzC,CAAC;QACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const createPostAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
+
text: import("@activepieces/pieces-framework").LongTextProperty<true>;
|
|
3
|
+
status: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
4
|
+
scheduled_at: import("@activepieces/pieces-framework").DateTimeProperty<false>;
|
|
5
|
+
accounts: import("@activepieces/pieces-framework").MultiSelectDropdownProperty<string, false, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
6
|
+
labels: import("@activepieces/pieces-framework").MultiSelectDropdownProperty<string, false, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
7
|
+
notes: import("@activepieces/pieces-framework").LongTextProperty<false>;
|
|
8
|
+
short_link_enabled: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
9
|
+
}>;
|
|
10
|
+
//# sourceMappingURL=create-post.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-post.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/create-post.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,gBAAgB;;;;;;;;EAkE3B,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createPostAction = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
+
const auth_1 = require("../common/auth");
|
|
8
|
+
const common_1 = require("../common");
|
|
9
|
+
exports.createPostAction = (0, pieces_framework_1.createAction)({
|
|
10
|
+
auth: auth_1.feedhiveAuth,
|
|
11
|
+
name: 'create_post',
|
|
12
|
+
displayName: 'Create Post',
|
|
13
|
+
description: 'Creates a new post in FeedHive (draft or scheduled).',
|
|
14
|
+
props: {
|
|
15
|
+
text: pieces_framework_1.Property.LongText({
|
|
16
|
+
displayName: 'Post Text',
|
|
17
|
+
description: 'The main content of your post.',
|
|
18
|
+
required: true,
|
|
19
|
+
}),
|
|
20
|
+
status: pieces_framework_1.Property.StaticDropdown({
|
|
21
|
+
displayName: 'Status',
|
|
22
|
+
description: 'Choose "Draft" to save without scheduling, or "Scheduled" to set a publish date.',
|
|
23
|
+
required: true,
|
|
24
|
+
defaultValue: 'draft',
|
|
25
|
+
options: {
|
|
26
|
+
options: [
|
|
27
|
+
{ label: 'Draft', value: 'draft' },
|
|
28
|
+
{ label: 'Scheduled', value: 'scheduled' },
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
}),
|
|
32
|
+
scheduled_at: pieces_framework_1.Property.DateTime({
|
|
33
|
+
displayName: 'Scheduled Date & Time',
|
|
34
|
+
description: 'Required when Status is "Scheduled". The exact date and time the post should be published.',
|
|
35
|
+
required: false,
|
|
36
|
+
}),
|
|
37
|
+
accounts: common_1.feedhiveCommon.socialsMultiDropdown,
|
|
38
|
+
labels: common_1.feedhiveCommon.labelsMultiDropdown,
|
|
39
|
+
notes: pieces_framework_1.Property.LongText({
|
|
40
|
+
displayName: 'Internal Notes',
|
|
41
|
+
description: 'Private notes visible only to your team in FeedHive. Not published.',
|
|
42
|
+
required: false,
|
|
43
|
+
}),
|
|
44
|
+
short_link_enabled: pieces_framework_1.Property.Checkbox({
|
|
45
|
+
displayName: 'Enable Short Links',
|
|
46
|
+
description: 'Automatically shorten URLs in your post text.',
|
|
47
|
+
required: false,
|
|
48
|
+
defaultValue: false,
|
|
49
|
+
}),
|
|
50
|
+
},
|
|
51
|
+
run(context) {
|
|
52
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
53
|
+
const { text, status, scheduled_at, accounts, labels, notes, short_link_enabled } = context.propsValue;
|
|
54
|
+
if (status === 'scheduled' && !scheduled_at) {
|
|
55
|
+
throw new Error('Scheduled Date & Time is required when Status is set to "Scheduled".');
|
|
56
|
+
}
|
|
57
|
+
const body = { text, status };
|
|
58
|
+
if (accounts && accounts.length > 0)
|
|
59
|
+
body['accounts'] = accounts;
|
|
60
|
+
if (labels && labels.length > 0)
|
|
61
|
+
body['labels'] = labels;
|
|
62
|
+
if (scheduled_at)
|
|
63
|
+
body['scheduled_at'] = scheduled_at;
|
|
64
|
+
if (notes)
|
|
65
|
+
body['notes'] = notes;
|
|
66
|
+
if (short_link_enabled !== undefined)
|
|
67
|
+
body['short_link_enabled'] = short_link_enabled;
|
|
68
|
+
const response = yield common_1.feedhiveCommon.apiCall({
|
|
69
|
+
token: context.auth.secret_text,
|
|
70
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
71
|
+
path: '/posts',
|
|
72
|
+
body,
|
|
73
|
+
});
|
|
74
|
+
return common_1.feedhiveCommon.flattenPost(response.body.data);
|
|
75
|
+
});
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
//# sourceMappingURL=create-post.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-post.js","sourceRoot":"","sources":["../../../../src/lib/actions/create-post.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,yCAA8C;AAC9C,sCAA2C;AAE9B,QAAA,gBAAgB,GAAG,IAAA,+BAAY,EAAC;IAC3C,IAAI,EAAE,mBAAY;IAClB,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,aAAa;IAC1B,WAAW,EAAE,sDAAsD;IACnE,KAAK,EAAE;QACL,IAAI,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACtB,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,gCAAgC;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YACvD,IAAI,QAAQ,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC;gBAAE,IAAI,CAAC,UAAU,CAAC,GAAG,QAAQ,CAAC;YACjE,IAAI,MAAM,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC;gBAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC;YACzD,IAAI,YAAY;gBAAE,IAAI,CAAC,cAAc,CAAC,GAAG,YAAY,CAAC;YACtD,IAAI,KAAK;gBAAE,IAAI,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC;YACjC,IAAI,kBAAkB,KAAK,SAAS;gBAAE,IAAI,CAAC,oBAAoB,CAAC,GAAG,kBAAkB,CAAC;YAEtF,MAAM,QAAQ,GAAG,MAAM,uBAAc,CAAC,OAAO,CAAoC;gBAC/E,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,WAAW;gBAC/B,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,IAAI,EAAE,QAAQ;gBACd,IAAI;aACL,CAAC,CAAC;YAEH,OAAO,uBAAc,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACxD,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const deletePostAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
+
post_id: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
3
|
+
}>;
|
|
4
|
+
//# sourceMappingURL=delete-post.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-post.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/delete-post.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,gBAAgB;;EAiB3B,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deletePostAction = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
+
const auth_1 = require("../common/auth");
|
|
8
|
+
const common_1 = require("../common");
|
|
9
|
+
exports.deletePostAction = (0, pieces_framework_1.createAction)({
|
|
10
|
+
auth: auth_1.feedhiveAuth,
|
|
11
|
+
name: 'delete_post',
|
|
12
|
+
displayName: 'Delete Post',
|
|
13
|
+
description: 'Deletes a post from FeedHive. This action cannot be undone.',
|
|
14
|
+
props: {
|
|
15
|
+
post_id: common_1.feedhiveCommon.postDropdown,
|
|
16
|
+
},
|
|
17
|
+
run(context) {
|
|
18
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
yield common_1.feedhiveCommon.apiCall({
|
|
20
|
+
token: context.auth.secret_text,
|
|
21
|
+
method: pieces_common_1.HttpMethod.DELETE,
|
|
22
|
+
path: `/posts/${context.propsValue.post_id}`,
|
|
23
|
+
});
|
|
24
|
+
return { success: true, deleted_post_id: context.propsValue.post_id };
|
|
25
|
+
});
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
//# sourceMappingURL=delete-post.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-post.js","sourceRoot":"","sources":["../../../../src/lib/actions/delete-post.ts"],"names":[],"mappings":";;;;AAAA,qEAA8D;AAC9D,+DAAyD;AACzD,yCAA8C;AAC9C,sCAA2C;AAE9B,QAAA,gBAAgB,GAAG,IAAA,+BAAY,EAAC;IAC3C,IAAI,EAAE,mBAAY;IAClB,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,aAAa;IAC1B,WAAW,EAAE,6DAA6D;IAC1E,KAAK,EAAE;QACL,OAAO,EAAE,uBAAc,CAAC,YAAY;KACrC;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,uBAAc,CAAC,OAAO,CAAC;gBAC3B,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,WAAW;gBAC/B,MAAM,EAAE,0BAAU,CAAC,MAAM;gBACzB,IAAI,EAAE,UAAU,OAAO,CAAC,UAAU,CAAC,OAAO,EAAE;aAC7C,CAAC,CAAC;YAEH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;QACxE,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const fireWorkflowTriggerAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
+
setup_instructions: import("@activepieces/pieces-framework/dist/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
3
|
+
trigger_id: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
text: import("@activepieces/pieces-framework").LongTextProperty<false>;
|
|
5
|
+
prompt: import("@activepieces/pieces-framework").LongTextProperty<false>;
|
|
6
|
+
scheduled: import("@activepieces/pieces-framework").DateTimeProperty<false>;
|
|
7
|
+
media_urls: import("@activepieces/pieces-framework").ArrayProperty<false>;
|
|
8
|
+
title: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
9
|
+
link: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
10
|
+
template_variables: import("@activepieces/pieces-framework").ObjectProperty<false>;
|
|
11
|
+
}>;
|
|
12
|
+
//# sourceMappingURL=fire-workflow-trigger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fire-workflow-trigger.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/fire-workflow-trigger.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,yBAAyB;;;;;;;;;;EA8EpC,CAAC"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fireWorkflowTriggerAction = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
+
const auth_1 = require("../common/auth");
|
|
8
|
+
const common_1 = require("../common");
|
|
9
|
+
exports.fireWorkflowTriggerAction = (0, pieces_framework_1.createAction)({
|
|
10
|
+
auth: auth_1.feedhiveAuth,
|
|
11
|
+
name: 'fire_workflow_trigger',
|
|
12
|
+
displayName: 'Create Post via Trigger',
|
|
13
|
+
description: 'Fires a FeedHive Workflow Trigger to create a post. The workflow defines which accounts to post to, the AI model to use, and any default content.',
|
|
14
|
+
props: {
|
|
15
|
+
setup_instructions: pieces_framework_1.Property.MarkDown({
|
|
16
|
+
value: `### How to find your Trigger ID
|
|
17
|
+
|
|
18
|
+
1. In FeedHive, open the **Workflows** section in the sidebar.
|
|
19
|
+
2. Open the workflow you want to fire.
|
|
20
|
+
3. In the workflow settings, copy the **Trigger ID** (a short alphanumeric code).
|
|
21
|
+
|
|
22
|
+
**Note:** You can also pass custom template variables — if your workflow content contains placeholders like \`[[first_name]]\`, add them in the **Template Variables** field below.`,
|
|
23
|
+
}),
|
|
24
|
+
trigger_id: pieces_framework_1.Property.ShortText({
|
|
25
|
+
displayName: 'Trigger ID',
|
|
26
|
+
description: 'The ID of your FeedHive workflow trigger. Found in FeedHive → Workflows → your workflow settings.',
|
|
27
|
+
required: true,
|
|
28
|
+
}),
|
|
29
|
+
text: pieces_framework_1.Property.LongText({
|
|
30
|
+
displayName: 'Post Text',
|
|
31
|
+
description: 'The content of the post. Leave empty to let your workflow generate or use a template.',
|
|
32
|
+
required: false,
|
|
33
|
+
}),
|
|
34
|
+
prompt: pieces_framework_1.Property.LongText({
|
|
35
|
+
displayName: 'AI Prompt',
|
|
36
|
+
description: 'Ask FeedHive AI to generate the post content. Only used if your workflow is configured for AI generation.',
|
|
37
|
+
required: false,
|
|
38
|
+
}),
|
|
39
|
+
scheduled: pieces_framework_1.Property.DateTime({
|
|
40
|
+
displayName: 'Scheduled Date & Time',
|
|
41
|
+
description: 'When to publish the post. Leave empty to use the schedule defined in the workflow.',
|
|
42
|
+
required: false,
|
|
43
|
+
}),
|
|
44
|
+
media_urls: pieces_framework_1.Property.Array({
|
|
45
|
+
displayName: 'Media URLs',
|
|
46
|
+
description: 'Public URLs of images or videos to include in the post (e.g. https://example.com/photo.jpg).',
|
|
47
|
+
required: false,
|
|
48
|
+
}),
|
|
49
|
+
title: pieces_framework_1.Property.ShortText({
|
|
50
|
+
displayName: 'Title',
|
|
51
|
+
description: 'Post title — only applicable for YouTube, Google My Business, and Pinterest posts.',
|
|
52
|
+
required: false,
|
|
53
|
+
}),
|
|
54
|
+
link: pieces_framework_1.Property.ShortText({
|
|
55
|
+
displayName: 'Link URL',
|
|
56
|
+
description: 'A URL to attach to the post — only applicable for YouTube, Google My Business, and Pinterest posts.',
|
|
57
|
+
required: false,
|
|
58
|
+
}),
|
|
59
|
+
template_variables: pieces_framework_1.Property.Object({
|
|
60
|
+
displayName: 'Template Variables',
|
|
61
|
+
description: 'If your workflow template uses placeholders like [[first_name]], provide them here as key-value pairs (e.g. first_name → John). Each key maps directly to a [[placeholder]] in your template.',
|
|
62
|
+
required: false,
|
|
63
|
+
}),
|
|
64
|
+
},
|
|
65
|
+
run(context) {
|
|
66
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
67
|
+
var _a;
|
|
68
|
+
const { trigger_id, text, prompt, scheduled, media_urls, title, link, template_variables } = context.propsValue;
|
|
69
|
+
// Template variables are applied first so explicit fields always take precedence
|
|
70
|
+
const body = Object.assign({}, (template_variables !== null && template_variables !== void 0 ? template_variables : {}));
|
|
71
|
+
if (text)
|
|
72
|
+
body['text'] = text;
|
|
73
|
+
if (prompt)
|
|
74
|
+
body['prompt'] = prompt;
|
|
75
|
+
if (scheduled)
|
|
76
|
+
body['scheduled'] = scheduled;
|
|
77
|
+
if (media_urls && media_urls.length > 0)
|
|
78
|
+
body['media_urls'] = media_urls;
|
|
79
|
+
if (title)
|
|
80
|
+
body['title'] = title;
|
|
81
|
+
if (link)
|
|
82
|
+
body['link'] = link;
|
|
83
|
+
const response = yield common_1.feedhiveCommon.apiCall({
|
|
84
|
+
token: context.auth.secret_text,
|
|
85
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
86
|
+
path: `/triggers/${trigger_id}`,
|
|
87
|
+
body,
|
|
88
|
+
});
|
|
89
|
+
return { success: (_a = response.body.success) !== null && _a !== void 0 ? _a : true };
|
|
90
|
+
});
|
|
91
|
+
},
|
|
92
|
+
});
|
|
93
|
+
//# sourceMappingURL=fire-workflow-trigger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fire-workflow-trigger.js","sourceRoot":"","sources":["../../../../src/lib/actions/fire-workflow-trigger.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,yCAA8C;AAC9C,sCAA2C;AAE9B,QAAA,yBAAyB,GAAG,IAAA,+BAAY,EAAC;IACpD,IAAI,EAAE,mBAAY;IAClB,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EAAE,yBAAyB;IACtC,WAAW,EAAE,mJAAmJ;IAChK,KAAK,EAAE;QACL,kBAAkB,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACpC,KAAK,EAAE;;;;;;oLAMuK;SAC/K,CAAC;QACF,UAAU,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC7B,WAAW,EAAE,YAAY;YACzB,WAAW,EAAE,mGAAmG;YAChH,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,IAAI,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACtB,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,uFAAuF;YACpG,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,MAAM,EAAE,2BAAQ,CAAC,QAAQ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AAW,CAAC,GAAG,SAAS,CAAC;YAC7C,IAAI,UAAU,IAAK,UAAuB,CAAC,MAAM,GAAG,CAAC;gBAAE,IAAI,CAAC,YAAY,CAAC,GAAG,UAAU,CAAC;YACvF,IAAI,KAAK;gBAAE,IAAI,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC;YACjC,IAAI,IAAI;gBAAE,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;YAE9B,MAAM,QAAQ,GAAG,MAAM,uBAAc,CAAC,OAAO,CAAuB;gBAClE,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,WAAW;gBAC/B,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,IAAI,EAAE,aAAa,UAAU,EAAE;gBAC/B,IAAI;aACL,CAAC,CAAC;YAEH,OAAO,EAAE,OAAO,EAAE,MAAA,QAAQ,CAAC,IAAI,CAAC,OAAO,mCAAI,IAAI,EAAE,CAAC;QACpD,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const getPostAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
+
post_id: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
3
|
+
}>;
|
|
4
|
+
//# sourceMappingURL=get-post.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-post.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/get-post.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,aAAa;;EAiBxB,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getPostAction = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
+
const auth_1 = require("../common/auth");
|
|
8
|
+
const common_1 = require("../common");
|
|
9
|
+
exports.getPostAction = (0, pieces_framework_1.createAction)({
|
|
10
|
+
auth: auth_1.feedhiveAuth,
|
|
11
|
+
name: 'get_post',
|
|
12
|
+
displayName: 'Get Post',
|
|
13
|
+
description: 'Retrieves the details of a specific post.',
|
|
14
|
+
props: {
|
|
15
|
+
post_id: common_1.feedhiveCommon.postDropdown,
|
|
16
|
+
},
|
|
17
|
+
run(context) {
|
|
18
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
const response = yield common_1.feedhiveCommon.apiCall({
|
|
20
|
+
token: context.auth.secret_text,
|
|
21
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
22
|
+
path: `/posts/${context.propsValue.post_id}`,
|
|
23
|
+
});
|
|
24
|
+
return common_1.feedhiveCommon.flattenPost(response.body.data);
|
|
25
|
+
});
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
//# sourceMappingURL=get-post.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-post.js","sourceRoot":"","sources":["../../../../src/lib/actions/get-post.ts"],"names":[],"mappings":";;;;AAAA,qEAA8D;AAC9D,+DAAyD;AACzD,yCAA8C;AAC9C,sCAA2C;AAE9B,QAAA,aAAa,GAAG,IAAA,+BAAY,EAAC;IACxC,IAAI,EAAE,mBAAY;IAClB,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE,UAAU;IACvB,WAAW,EAAE,2CAA2C;IACxD,KAAK,EAAE;QACL,OAAO,EAAE,uBAAc,CAAC,YAAY;KACrC;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,QAAQ,GAAG,MAAM,uBAAc,CAAC,OAAO,CAAoC;gBAC/E,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,WAAW;gBAC/B,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,IAAI,EAAE,UAAU,OAAO,CAAC,UAAU,CAAC,OAAO,EAAE;aAC7C,CAAC,CAAC;YAEH,OAAO,uBAAc,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACxD,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const listPostsAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
+
status: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
|
|
3
|
+
labels: import("@activepieces/pieces-framework").MultiSelectDropdownProperty<string, false, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
4
|
+
limit: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
5
|
+
}>;
|
|
6
|
+
//# sourceMappingURL=list-posts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-posts.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/list-posts.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,eAAe;;;;EAgD1B,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.listPostsAction = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
+
const auth_1 = require("../common/auth");
|
|
8
|
+
const common_1 = require("../common");
|
|
9
|
+
exports.listPostsAction = (0, pieces_framework_1.createAction)({
|
|
10
|
+
auth: auth_1.feedhiveAuth,
|
|
11
|
+
name: 'list_posts',
|
|
12
|
+
displayName: 'List Posts',
|
|
13
|
+
description: 'Returns a list of posts, optionally filtered by status or labels.',
|
|
14
|
+
props: {
|
|
15
|
+
status: pieces_framework_1.Property.StaticDropdown({
|
|
16
|
+
displayName: 'Filter by Status',
|
|
17
|
+
description: 'Only return posts with this status. Leave empty to return all posts.',
|
|
18
|
+
required: false,
|
|
19
|
+
options: {
|
|
20
|
+
options: [
|
|
21
|
+
{ label: 'Draft', value: 'draft' },
|
|
22
|
+
{ label: 'Scheduled', value: 'scheduled' },
|
|
23
|
+
{ label: 'Publishing', value: 'publishing' },
|
|
24
|
+
{ label: 'Published', value: 'published' },
|
|
25
|
+
{ label: 'Failed', value: 'failed' },
|
|
26
|
+
],
|
|
27
|
+
},
|
|
28
|
+
}),
|
|
29
|
+
labels: common_1.feedhiveCommon.labelsMultiDropdown,
|
|
30
|
+
limit: pieces_framework_1.Property.Number({
|
|
31
|
+
displayName: 'Maximum Results',
|
|
32
|
+
description: 'Maximum number of posts to return. Between 1 and 100.',
|
|
33
|
+
required: false,
|
|
34
|
+
defaultValue: 20,
|
|
35
|
+
}),
|
|
36
|
+
},
|
|
37
|
+
run(context) {
|
|
38
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
var _a, _b;
|
|
40
|
+
const { status, labels, limit } = context.propsValue;
|
|
41
|
+
const queryParams = {
|
|
42
|
+
limit: String(Math.min(limit !== null && limit !== void 0 ? limit : 20, 100)),
|
|
43
|
+
};
|
|
44
|
+
if (status)
|
|
45
|
+
queryParams['status'] = status;
|
|
46
|
+
if (labels && labels.length > 0)
|
|
47
|
+
queryParams['labels'] = labels.join(',');
|
|
48
|
+
const response = yield common_1.feedhiveCommon.apiCall({
|
|
49
|
+
token: context.auth.secret_text,
|
|
50
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
51
|
+
path: '/posts',
|
|
52
|
+
queryParams,
|
|
53
|
+
});
|
|
54
|
+
return ((_b = (_a = response.body.data) === null || _a === void 0 ? void 0 : _a.items) !== null && _b !== void 0 ? _b : []).map((p) => common_1.feedhiveCommon.flattenPost(p));
|
|
55
|
+
});
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
//# sourceMappingURL=list-posts.js.map
|
|
@@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,cAAL,KAAK,GAAI,EAAE,EAAE,GAAG,CAAC,CAAC;aAC1C,CAAC;YACF,IAAI,MAAM;gBAAE,WAAW,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC;YAC3C,IAAI,MAAM,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC;gBAAE,WAAW,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAE1E,MAAM,QAAQ,GAAG,MAAM,uBAAc,CAAC,OAAO,CAE1C;gBACD,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,WAAW;gBAC/B,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,IAAI,EAAE,QAAQ;gBACd,WAAW;aACZ,CAAC,CAAC;YAEH,OAAO,CAAC,MAAA,MAAA,QAAQ,CAAC,IAAI,CAAC,IAAI,0CAAE,KAAK,mCAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,uBAAc,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;QACrF,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const updatePostAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
+
post_id: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
3
|
+
text: import("@activepieces/pieces-framework").LongTextProperty<false>;
|
|
4
|
+
status: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
|
|
5
|
+
scheduled_at: import("@activepieces/pieces-framework").DateTimeProperty<false>;
|
|
6
|
+
accounts: import("@activepieces/pieces-framework").MultiSelectDropdownProperty<string, false, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
7
|
+
labels: import("@activepieces/pieces-framework").MultiSelectDropdownProperty<string, false, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
8
|
+
notes: import("@activepieces/pieces-framework").LongTextProperty<false>;
|
|
9
|
+
short_link_enabled: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
10
|
+
}>;
|
|
11
|
+
//# sourceMappingURL=update-post.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-post.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/update-post.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,gBAAgB;;;;;;;;;EAgE3B,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updatePostAction = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
+
const auth_1 = require("../common/auth");
|
|
8
|
+
const common_1 = require("../common");
|
|
9
|
+
exports.updatePostAction = (0, pieces_framework_1.createAction)({
|
|
10
|
+
auth: auth_1.feedhiveAuth,
|
|
11
|
+
name: 'update_post',
|
|
12
|
+
displayName: 'Update Post',
|
|
13
|
+
description: 'Updates an existing post in FeedHive. Only the fields you fill in will be changed.',
|
|
14
|
+
props: {
|
|
15
|
+
post_id: common_1.feedhiveCommon.postDropdown,
|
|
16
|
+
text: pieces_framework_1.Property.LongText({
|
|
17
|
+
displayName: 'Post Text',
|
|
18
|
+
description: 'The new content of the post. Leave empty to keep the current text.',
|
|
19
|
+
required: false,
|
|
20
|
+
}),
|
|
21
|
+
status: pieces_framework_1.Property.StaticDropdown({
|
|
22
|
+
displayName: 'Status',
|
|
23
|
+
description: 'Change the post status. Leave empty to keep the current status.',
|
|
24
|
+
required: false,
|
|
25
|
+
options: {
|
|
26
|
+
options: [
|
|
27
|
+
{ label: 'Draft', value: 'draft' },
|
|
28
|
+
{ label: 'Scheduled', value: 'scheduled' },
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
}),
|
|
32
|
+
scheduled_at: pieces_framework_1.Property.DateTime({
|
|
33
|
+
displayName: 'Scheduled Date & Time',
|
|
34
|
+
description: 'Update the scheduled publish date and time.',
|
|
35
|
+
required: false,
|
|
36
|
+
}),
|
|
37
|
+
accounts: common_1.feedhiveCommon.socialsMultiDropdown,
|
|
38
|
+
labels: common_1.feedhiveCommon.labelsMultiDropdown,
|
|
39
|
+
notes: pieces_framework_1.Property.LongText({
|
|
40
|
+
displayName: 'Internal Notes',
|
|
41
|
+
description: 'Update the private notes for this post.',
|
|
42
|
+
required: false,
|
|
43
|
+
}),
|
|
44
|
+
short_link_enabled: pieces_framework_1.Property.Checkbox({
|
|
45
|
+
displayName: 'Enable Short Links',
|
|
46
|
+
description: 'Automatically shorten URLs in the post text.',
|
|
47
|
+
required: false,
|
|
48
|
+
}),
|
|
49
|
+
},
|
|
50
|
+
run(context) {
|
|
51
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
52
|
+
const { post_id, text, status, scheduled_at, accounts, labels, notes, short_link_enabled } = context.propsValue;
|
|
53
|
+
const body = {};
|
|
54
|
+
if (text)
|
|
55
|
+
body['text'] = text;
|
|
56
|
+
if (status)
|
|
57
|
+
body['status'] = status;
|
|
58
|
+
if (scheduled_at)
|
|
59
|
+
body['scheduled_at'] = scheduled_at;
|
|
60
|
+
if (accounts && accounts.length > 0)
|
|
61
|
+
body['accounts'] = accounts;
|
|
62
|
+
if (labels !== undefined)
|
|
63
|
+
body['labels'] = labels !== null && labels !== void 0 ? labels : [];
|
|
64
|
+
if (notes)
|
|
65
|
+
body['notes'] = notes;
|
|
66
|
+
if (short_link_enabled !== undefined && short_link_enabled !== null)
|
|
67
|
+
body['short_link_enabled'] = short_link_enabled;
|
|
68
|
+
const response = yield common_1.feedhiveCommon.apiCall({
|
|
69
|
+
token: context.auth.secret_text,
|
|
70
|
+
method: pieces_common_1.HttpMethod.PATCH,
|
|
71
|
+
path: `/posts/${post_id}`,
|
|
72
|
+
body,
|
|
73
|
+
});
|
|
74
|
+
return common_1.feedhiveCommon.flattenPost(response.body.data);
|
|
75
|
+
});
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
//# sourceMappingURL=update-post.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-post.js","sourceRoot":"","sources":["../../../../src/lib/actions/update-post.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,yCAA8C;AAC9C,sCAA2C;AAE9B,QAAA,gBAAgB,GAAG,IAAA,+BAAY,EAAC;IAC3C,IAAI,EAAE,mBAAY;IAClB,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,aAAa;IAC1B,WAAW,EAAE,oFAAoF;IACjG,KAAK,EAAE;QACL,OAAO,EAAE,uBAAc,CAAC,YAAY;QACpC,IAAI,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACtB,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,oEAAoE;YACjF,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,MAAM,EAAE,2BAAQ,CAAC,cAAc,CAAC;YAC9B,WAAW,EAAE,QAAQ;YACrB,WAAW,EAAE,iEAAiE;YAC9E,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE;gBACP,OAAO,EAAE;oBACP,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;oBAClC,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE;iBAC3C;aACF;SACF,CAAC;QACF,YAAY,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC9B,WAAW,EAAE,uBAAuB;YACpC,WAAW,EAAE,6CAA6C;YAC1D,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,QAAQ,EAAE,uBAAc,CAAC,oBAAoB;QAC7C,MAAM,EAAE,uBAAc,CAAC,mBAAmB;QAC1C,KAAK,EAAE,2BAAQ,CAAC,QAAQ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OAAO,EAAE;gBACzB,IAAI;aACL,CAAC,CAAC;YAEH,OAAO,uBAAc,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACxD,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../../src/lib/common/auth.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,YAAY,mEAwBvB,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.feedhiveAuth = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
+
exports.feedhiveAuth = pieces_framework_1.PieceAuth.SecretText({
|
|
8
|
+
displayName: 'API Key',
|
|
9
|
+
description: `To get your FeedHive API key:
|
|
10
|
+
1. Log in to your FeedHive account.
|
|
11
|
+
2. Go to **Settings** → **Account** (or **Workspace**).
|
|
12
|
+
3. Find the **API Key** section and copy your key.
|
|
13
|
+
|
|
14
|
+
Your key starts with \`fh_\`.`,
|
|
15
|
+
required: true,
|
|
16
|
+
validate: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
17
|
+
try {
|
|
18
|
+
yield pieces_common_1.httpClient.sendRequest({
|
|
19
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
20
|
+
url: 'https://api.feedhive.com/status',
|
|
21
|
+
authentication: { type: pieces_common_1.AuthenticationType.BEARER_TOKEN, token: auth },
|
|
22
|
+
});
|
|
23
|
+
return { valid: true };
|
|
24
|
+
}
|
|
25
|
+
catch (_b) {
|
|
26
|
+
return {
|
|
27
|
+
valid: false,
|
|
28
|
+
error: 'Invalid API key. Make sure you copied it correctly from FeedHive Settings.',
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
}),
|
|
32
|
+
});
|
|
33
|
+
//# sourceMappingURL=auth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../../src/lib/common/auth.ts"],"names":[],"mappings":";;;;AAAA,qEAA2D;AAC3D,+DAAyF;AAE5E,QAAA,YAAY,GAAG,4BAAS,CAAC,UAAU,CAAC;IAC/C,WAAW,EAAE,SAAS;IACtB,WAAW,EAAE;;;;;8BAKe;IAC5B,QAAQ,EAAE,IAAI;IACd,QAAQ,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;QACvB,IAAI,CAAC;YACH,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC3B,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,GAAG,EAAE,iCAAiC;gBACtC,cAAc,EAAE,EAAE,IAAI,EAAE,kCAAkB,CAAC,YAAY,EAAE,KAAK,EAAE,IAAI,EAAE;aACvE,CAAC,CAAC;YACH,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;QACzB,CAAC;QAAC,WAAM,CAAC;YACP,OAAO;gBACL,KAAK,EAAE,KAAK;gBACZ,KAAK,EAAE,4EAA4E;aACpF,CAAC;QACJ,CAAC;IACH,CAAC,CAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HttpMessageBody, HttpMethod, HttpResponse } from '@activepieces/pieces-common';
|
|
2
|
+
export declare const feedhiveCommon: {
|
|
3
|
+
socialsMultiDropdown: import("@activepieces/pieces-framework").MultiSelectDropdownProperty<string, false, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
4
|
+
labelsMultiDropdown: import("@activepieces/pieces-framework").MultiSelectDropdownProperty<string, false, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
5
|
+
postDropdown: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
6
|
+
apiCall: typeof apiCall;
|
|
7
|
+
flattenPost: typeof flattenPost;
|
|
8
|
+
};
|
|
9
|
+
declare function apiCall<T extends HttpMessageBody>({ token, method, path, body, queryParams, }: {
|
|
10
|
+
token: string;
|
|
11
|
+
method: HttpMethod;
|
|
12
|
+
path: string;
|
|
13
|
+
body?: unknown;
|
|
14
|
+
queryParams?: Record<string, string>;
|
|
15
|
+
}): Promise<HttpResponse<T>>;
|
|
16
|
+
declare function flattenPost(post: Record<string, unknown>): Record<string, unknown>;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/common/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,eAAe,EACf,UAAU,EACV,YAAY,EACb,MAAM,6BAA6B,CAAC;AAkGrC,eAAO,MAAM,cAAc;;;;;;CAM1B,CAAC;AAEF,iBAAe,OAAO,CAAC,CAAC,SAAS,eAAe,EAAE,EAChD,KAAK,EACL,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,WAAW,GACZ,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,UAAU,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACtC,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAQ3B;AAED,iBAAS,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA4B3E"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.feedhiveCommon = 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("./auth");
|
|
8
|
+
const BASE_URL = 'https://api.feedhive.com';
|
|
9
|
+
const socialsMultiDropdown = pieces_framework_1.Property.MultiSelectDropdown({
|
|
10
|
+
displayName: 'Social Accounts',
|
|
11
|
+
description: 'Select the social media accounts to publish this post to.',
|
|
12
|
+
refreshers: [],
|
|
13
|
+
required: false,
|
|
14
|
+
auth: auth_1.feedhiveAuth,
|
|
15
|
+
options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
16
|
+
var _b;
|
|
17
|
+
if (!auth) {
|
|
18
|
+
return { disabled: true, options: [], placeholder: 'Please connect your account first' };
|
|
19
|
+
}
|
|
20
|
+
try {
|
|
21
|
+
const response = yield apiCall({ token: auth.secret_text, method: pieces_common_1.HttpMethod.GET, path: '/socials' });
|
|
22
|
+
return {
|
|
23
|
+
disabled: false,
|
|
24
|
+
options: ((_b = response.body.data) !== null && _b !== void 0 ? _b : [])
|
|
25
|
+
.filter((a) => a.status === 'active')
|
|
26
|
+
.map((a) => ({
|
|
27
|
+
label: `${a.display_name} (@${a.handle}) — ${a.platform}`,
|
|
28
|
+
value: a.id,
|
|
29
|
+
})),
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
catch (_c) {
|
|
33
|
+
return {
|
|
34
|
+
disabled: true,
|
|
35
|
+
options: [],
|
|
36
|
+
placeholder: 'Failed to load social accounts. Check your connection.',
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
}),
|
|
40
|
+
});
|
|
41
|
+
const labelsMultiDropdown = pieces_framework_1.Property.MultiSelectDropdown({
|
|
42
|
+
displayName: 'Labels',
|
|
43
|
+
description: 'Optionally assign labels to organise this post in FeedHive.',
|
|
44
|
+
refreshers: [],
|
|
45
|
+
required: false,
|
|
46
|
+
auth: auth_1.feedhiveAuth,
|
|
47
|
+
options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
48
|
+
var _b, _c;
|
|
49
|
+
if (!auth) {
|
|
50
|
+
return { disabled: true, options: [], placeholder: 'Please connect your account first' };
|
|
51
|
+
}
|
|
52
|
+
try {
|
|
53
|
+
const response = yield apiCall({ token: auth.secret_text, method: pieces_common_1.HttpMethod.GET, path: '/labels' });
|
|
54
|
+
return {
|
|
55
|
+
disabled: false,
|
|
56
|
+
options: ((_c = (_b = response.body.data) === null || _b === void 0 ? void 0 : _b.items) !== null && _c !== void 0 ? _c : []).map((l) => ({
|
|
57
|
+
label: l.title,
|
|
58
|
+
value: l.id,
|
|
59
|
+
})),
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
catch (_d) {
|
|
63
|
+
return { disabled: true, options: [], placeholder: 'Failed to load labels. Check your connection.' };
|
|
64
|
+
}
|
|
65
|
+
}),
|
|
66
|
+
});
|
|
67
|
+
const postDropdown = pieces_framework_1.Property.Dropdown({
|
|
68
|
+
displayName: 'Post',
|
|
69
|
+
description: 'Select the post you want to act on.',
|
|
70
|
+
refreshers: [],
|
|
71
|
+
required: true,
|
|
72
|
+
auth: auth_1.feedhiveAuth,
|
|
73
|
+
options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
74
|
+
var _b, _c;
|
|
75
|
+
if (!auth) {
|
|
76
|
+
return { disabled: true, options: [], placeholder: 'Please connect your account first' };
|
|
77
|
+
}
|
|
78
|
+
try {
|
|
79
|
+
const response = yield apiCall({
|
|
80
|
+
token: auth.secret_text,
|
|
81
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
82
|
+
path: '/posts',
|
|
83
|
+
queryParams: { limit: '100' },
|
|
84
|
+
});
|
|
85
|
+
return {
|
|
86
|
+
disabled: false,
|
|
87
|
+
options: ((_c = (_b = response.body.data) === null || _b === void 0 ? void 0 : _b.items) !== null && _c !== void 0 ? _c : []).map((p) => {
|
|
88
|
+
const preview = p.text ? p.text.slice(0, 60) + (p.text.length > 60 ? '…' : '') : '(no text)';
|
|
89
|
+
return { label: `${preview} [${p.status}]`, value: p.id };
|
|
90
|
+
}),
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
catch (_d) {
|
|
94
|
+
return { disabled: true, options: [], placeholder: 'Failed to load posts. Check your connection.' };
|
|
95
|
+
}
|
|
96
|
+
}),
|
|
97
|
+
});
|
|
98
|
+
exports.feedhiveCommon = {
|
|
99
|
+
socialsMultiDropdown,
|
|
100
|
+
labelsMultiDropdown,
|
|
101
|
+
postDropdown,
|
|
102
|
+
apiCall,
|
|
103
|
+
flattenPost,
|
|
104
|
+
};
|
|
105
|
+
function apiCall(_a) {
|
|
106
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* ({ token, method, path, body, queryParams, }) {
|
|
107
|
+
return pieces_common_1.httpClient.sendRequest({
|
|
108
|
+
method,
|
|
109
|
+
url: `${BASE_URL}${path}`,
|
|
110
|
+
authentication: { type: pieces_common_1.AuthenticationType.BEARER_TOKEN, token },
|
|
111
|
+
queryParams,
|
|
112
|
+
body,
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
function flattenPost(post) {
|
|
117
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
118
|
+
const approval = post['approval'];
|
|
119
|
+
return {
|
|
120
|
+
id: (_a = post['id']) !== null && _a !== void 0 ? _a : null,
|
|
121
|
+
status: (_b = post['status']) !== null && _b !== void 0 ? _b : null,
|
|
122
|
+
text: (_c = post['text']) !== null && _c !== void 0 ? _c : null,
|
|
123
|
+
accounts: Array.isArray(post['accounts']) && post['accounts'].length > 0
|
|
124
|
+
? post['accounts'].join(', ')
|
|
125
|
+
: null,
|
|
126
|
+
labels: Array.isArray(post['labels']) && post['labels'].length > 0
|
|
127
|
+
? post['labels'].join(', ')
|
|
128
|
+
: null,
|
|
129
|
+
media: Array.isArray(post['media']) && post['media'].length > 0
|
|
130
|
+
? post['media'].join(', ')
|
|
131
|
+
: null,
|
|
132
|
+
notes: (_d = post['notes']) !== null && _d !== void 0 ? _d : null,
|
|
133
|
+
short_link_enabled: (_e = post['short_link_enabled']) !== null && _e !== void 0 ? _e : null,
|
|
134
|
+
scheduled_at: (_f = post['scheduled_at']) !== null && _f !== void 0 ? _f : null,
|
|
135
|
+
published_at: (_g = post['published_at']) !== null && _g !== void 0 ? _g : null,
|
|
136
|
+
slot_id: (_h = post['slot_id']) !== null && _h !== void 0 ? _h : null,
|
|
137
|
+
approval_status: (_j = approval === null || approval === void 0 ? void 0 : approval.status) !== null && _j !== void 0 ? _j : null,
|
|
138
|
+
approval_is_approved: (_k = approval === null || approval === void 0 ? void 0 : approval.is_approved) !== null && _k !== void 0 ? _k : null,
|
|
139
|
+
approval_approved_at: (_l = approval === null || approval === void 0 ? void 0 : approval.approved_at) !== null && _l !== void 0 ? _l : null,
|
|
140
|
+
created_at: (_m = post['created_at']) !== null && _m !== void 0 ? _m : null,
|
|
141
|
+
updated_at: (_o = post['updated_at']) !== null && _o !== void 0 ? _o : null,
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/common/index.ts"],"names":[],"mappings":";;;;AAAA,+DAMqC;AACrC,qEAA0D;AAC1D,iCAAsC;AAEtC,MAAM,QAAQ,GAAG,0BAA0B,CAAC;AAE5C,MAAM,oBAAoB,GAAG,2BAAQ,CAAC,mBAAmB,CAAC;IACxD,WAAW,EAAE,iBAAiB;IAC9B,WAAW,EAAE,2DAA2D;IACxE,UAAU,EAAE,EAAE;IACd,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE,mBAAY;IAClB,OAAO,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;;QACtB,IAAI,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cAAc,CAAC,mCAAI,IAAI;QAC1C,OAAO,EAAE,MAAA,IAAI,CAAC,SAAS,CAAC,mCAAI,IAAI;QAChC,eAAe,EAAE,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,MAAM,mCAAI,IAAI;QACzC,oBAAoB,EAAE,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,WAAW,mCAAI,IAAI;QACnD,oBAAoB,EAAE,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,WAAW,mCAAI,IAAI;QACnD,UAAU,EAAE,MAAA,IAAI,CAAC,YAAY,CAAC,mCAAI,IAAI;QACtC,UAAU,EAAE,MAAA,IAAI,CAAC,YAAY,CAAC,mCAAI,IAAI;KACvC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
+
export declare const commentNotificationTrigger: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
3
|
+
instructions: import("@activepieces/pieces-framework/dist/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
4
|
+
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
5
|
+
instructions: import("@activepieces/pieces-framework/dist/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
6
|
+
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
7
|
+
instructions: import("@activepieces/pieces-framework/dist/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
8
|
+
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
9
|
+
instructions: import("@activepieces/pieces-framework/dist/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
10
|
+
}>;
|
|
11
|
+
//# sourceMappingURL=comment-notification.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comment-notification.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/comment-notification.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,eAAe,EAAY,MAAM,gCAAgC,CAAC;AAK1F,eAAO,MAAM,0BAA0B;;;;;;;;EAmFrC,CAAC"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.commentNotificationTrigger = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
+
const auth_1 = require("../common/auth");
|
|
8
|
+
const common_1 = require("../common");
|
|
9
|
+
exports.commentNotificationTrigger = (0, pieces_framework_1.createTrigger)({
|
|
10
|
+
auth: auth_1.feedhiveAuth,
|
|
11
|
+
name: 'comment_notification',
|
|
12
|
+
displayName: 'Comment Notification',
|
|
13
|
+
description: 'Triggers when a comment is added to one of your posts.',
|
|
14
|
+
props: {
|
|
15
|
+
instructions: pieces_framework_1.Property.MarkDown({
|
|
16
|
+
value: `### Setup Instructions
|
|
17
|
+
|
|
18
|
+
1. Enable this flow and copy the **Webhook URL** shown below.
|
|
19
|
+
\`\`\`text
|
|
20
|
+
{{webhookUrl}}
|
|
21
|
+
\`\`\`
|
|
22
|
+
2. In FeedHive, go to **Settings → Automation → Notifications**.
|
|
23
|
+
3. Click **Create New Notification**.
|
|
24
|
+
4. Choose **Comment Added** and paste the Webhook URL, then click **Save**.`,
|
|
25
|
+
}),
|
|
26
|
+
},
|
|
27
|
+
sampleData: {
|
|
28
|
+
post_id: 'xxxx-abcd-1234',
|
|
29
|
+
comment_id: 'yyyy-zxyw-4321',
|
|
30
|
+
commented_at: '2024-08-01T12:00:00.000Z',
|
|
31
|
+
commented_by: 'zzzz-efgh-5678',
|
|
32
|
+
commented_by_name: 'John Doe',
|
|
33
|
+
commented_by_email: 'johndoe@gmail.com',
|
|
34
|
+
comment_text: 'Great post. Perhaps add another image?',
|
|
35
|
+
post_excerpt: 'This is the first part of the post caption...',
|
|
36
|
+
post: {
|
|
37
|
+
content: [{ text: 'Full post caption.', media: [] }],
|
|
38
|
+
labels: ['Marketing'],
|
|
39
|
+
postNotes: 'Internal notes',
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
type: pieces_framework_1.TriggerStrategy.WEBHOOK,
|
|
43
|
+
onEnable(_context) {
|
|
44
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
45
|
+
// Webhook URL must be configured manually in FeedHive: Settings → Automation → Notifications
|
|
46
|
+
});
|
|
47
|
+
},
|
|
48
|
+
onDisable(_context) {
|
|
49
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
50
|
+
// Nothing to unregister
|
|
51
|
+
});
|
|
52
|
+
},
|
|
53
|
+
run(context) {
|
|
54
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
55
|
+
return [context.payload.body];
|
|
56
|
+
});
|
|
57
|
+
},
|
|
58
|
+
test(context) {
|
|
59
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
60
|
+
var _a, _b;
|
|
61
|
+
// No dedicated comments endpoint — fetch recent published posts and approximate the payload shape
|
|
62
|
+
const response = yield common_1.feedhiveCommon.apiCall({
|
|
63
|
+
token: context.auth.secret_text,
|
|
64
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
65
|
+
path: '/posts',
|
|
66
|
+
queryParams: { limit: '5', status: 'published' },
|
|
67
|
+
});
|
|
68
|
+
const posts = (_b = (_a = response.body.data) === null || _a === void 0 ? void 0 : _a.items) !== null && _b !== void 0 ? _b : [];
|
|
69
|
+
return posts.map((post) => {
|
|
70
|
+
var _a, _b, _c, _d, _e;
|
|
71
|
+
const postExcerpt = typeof post['text'] === 'string'
|
|
72
|
+
? post['text'].slice(0, 100) + (post['text'].length > 100 ? '...' : '')
|
|
73
|
+
: '(no text)';
|
|
74
|
+
return {
|
|
75
|
+
post_id: (_a = post['id']) !== null && _a !== void 0 ? _a : null,
|
|
76
|
+
comment_id: null,
|
|
77
|
+
commented_at: null,
|
|
78
|
+
commented_by: null,
|
|
79
|
+
commented_by_name: '(see FeedHive notification)',
|
|
80
|
+
commented_by_email: '(see FeedHive notification)',
|
|
81
|
+
comment_text: '(see FeedHive notification)',
|
|
82
|
+
post_excerpt: postExcerpt,
|
|
83
|
+
post: {
|
|
84
|
+
content: [{ text: (_b = post['text']) !== null && _b !== void 0 ? _b : '', media: (_c = post['media']) !== null && _c !== void 0 ? _c : [] }],
|
|
85
|
+
labels: (_d = post['labels']) !== null && _d !== void 0 ? _d : [],
|
|
86
|
+
postNotes: (_e = post['notes']) !== null && _e !== void 0 ? _e : '',
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
},
|
|
92
|
+
});
|
|
93
|
+
//# sourceMappingURL=comment-notification.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comment-notification.js","sourceRoot":"","sources":["../../../../src/lib/triggers/comment-notification.ts"],"names":[],"mappings":";;;;AAAA,qEAA0F;AAC1F,+DAAyD;AACzD,yCAA8C;AAC9C,sCAA2C;AAE9B,QAAA,0BAA0B,GAAG,IAAA,gCAAa,EAAC;IACtD,IAAI,EAAE,mBAAY;IAClB,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,sBAAsB;IACnC,WAAW,EAAE,wDAAwD;IACrE,KAAK,EAAE;QACL,YAAY,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC9B,KAAK,EAAE;;;;;;;;4EAQ+D;SACvE,CAAC;KACH;IACD,UAAU,EAAE;QACV,OAAO,EAAE,gBAAgB;QACzB,UAAU,E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,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;oBACvE,CAAC,CAAC,WAAW,CAAC;gBAElB,OAAO;oBACL,OAAO,EAAE,MAAA,IAAI,CAAC,IAAI,CAAC,mCAAI,IAAI;oBAC3B,UAAU,EAAE,IAAI;oBAChB,YAAY,EAAE,IAAI;oBAClB,YAAY,EAAE,IAAI;oBAClB,iBAAiB,EAAE,6BAA6B;oBAChD,kBAAkB,EAAE,6BAA6B;oBACjD,YAAY,EAAE,6BAA6B;oBAC3C,YAAY,EAAE,WAAW;oBACzB,IAAI,EAAE;wBACJ,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAA,IAAI,CAAC,MAAM,CAAC,mCAAI,EAAE,EAAE,KAAK,EAAE,MAAA,IAAI,CAAC,OAAO,CAAC,mCAAI,EAAE,EAAE,CAAC;wBACnE,MAAM,EAAE,MAAA,IAAI,CAAC,QAAQ,CAAC,mCAAI,EAAE;wBAC5B,SAAS,EAAE,MAAA,IAAI,CAAC,OAAO,CAAC,mCAAI,EAAE;qBAC/B;iBACF,CAAC;YACJ,CAAC,CAAC,CAAC;QACL,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
+
export declare const postNotificationTrigger: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
3
|
+
event_type: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
4
|
+
instructions: import("@activepieces/pieces-framework/dist/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
5
|
+
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
6
|
+
event_type: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
7
|
+
instructions: import("@activepieces/pieces-framework/dist/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
8
|
+
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
9
|
+
event_type: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
10
|
+
instructions: import("@activepieces/pieces-framework/dist/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
11
|
+
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
12
|
+
event_type: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
13
|
+
instructions: import("@activepieces/pieces-framework/dist/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
14
|
+
}>;
|
|
15
|
+
//# sourceMappingURL=post-notification.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"post-notification.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/post-notification.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,eAAe,EAAY,MAAM,gCAAgC,CAAC;AAW1F,eAAO,MAAM,uBAAuB;;;;;;;;;;;;EA4ElC,CAAC"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.postNotificationTrigger = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
+
const auth_1 = require("../common/auth");
|
|
8
|
+
const common_1 = require("../common");
|
|
9
|
+
const EVENT_TYPE_STATUS_MAP = {
|
|
10
|
+
post_published: 'published',
|
|
11
|
+
post_scheduled: 'scheduled',
|
|
12
|
+
post_failed: 'failed',
|
|
13
|
+
};
|
|
14
|
+
exports.postNotificationTrigger = (0, pieces_framework_1.createTrigger)({
|
|
15
|
+
auth: auth_1.feedhiveAuth,
|
|
16
|
+
name: 'post_notification',
|
|
17
|
+
displayName: 'Post Notification',
|
|
18
|
+
description: 'Triggers when a post is published, scheduled, or fails.',
|
|
19
|
+
props: {
|
|
20
|
+
event_type: pieces_framework_1.Property.StaticDropdown({
|
|
21
|
+
displayName: 'Event Type',
|
|
22
|
+
description: 'Choose the event type you will configure in FeedHive. This is used to load sample data when testing the trigger — it does not filter incoming webhooks.',
|
|
23
|
+
required: true,
|
|
24
|
+
defaultValue: 'post_published',
|
|
25
|
+
options: {
|
|
26
|
+
options: [
|
|
27
|
+
{ label: 'Post Published', value: 'post_published' },
|
|
28
|
+
{ label: 'Post Scheduled', value: 'post_scheduled' },
|
|
29
|
+
{ label: 'Post Failed', value: 'post_failed' },
|
|
30
|
+
],
|
|
31
|
+
},
|
|
32
|
+
}),
|
|
33
|
+
instructions: pieces_framework_1.Property.MarkDown({
|
|
34
|
+
value: `### Setup Instructions
|
|
35
|
+
|
|
36
|
+
1. Enable this flow and copy the **Webhook URL** shown below.
|
|
37
|
+
\`\`\`text
|
|
38
|
+
{{webhookUrl}}
|
|
39
|
+
\`\`\`
|
|
40
|
+
2. In FeedHive, go to **Settings → Automation → Notifications**.
|
|
41
|
+
3. Click **Create New Notification**.
|
|
42
|
+
4. Choose the matching event type and paste the Webhook URL, then click **Save**.`,
|
|
43
|
+
}),
|
|
44
|
+
},
|
|
45
|
+
sampleData: {
|
|
46
|
+
post_id: 'xxxx-abcd-1234',
|
|
47
|
+
post_excerpt: 'This is the first part of the post caption...',
|
|
48
|
+
social_type: 'Facebook',
|
|
49
|
+
social_name: 'My Facebook Page',
|
|
50
|
+
public_id: '123456789101112_1314151617181920',
|
|
51
|
+
public_url: 'https://www.facebook.com/xxxx/posts/yyyy',
|
|
52
|
+
post: {
|
|
53
|
+
content: [{ text: 'Full post caption.', media: [] }],
|
|
54
|
+
labels: ['Marketing'],
|
|
55
|
+
postNotes: 'Internal notes',
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
type: pieces_framework_1.TriggerStrategy.WEBHOOK,
|
|
59
|
+
onEnable(_context) {
|
|
60
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
61
|
+
// Webhook URL must be configured manually in FeedHive: Settings → Automation → Notifications
|
|
62
|
+
});
|
|
63
|
+
},
|
|
64
|
+
onDisable(_context) {
|
|
65
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
66
|
+
// Nothing to unregister
|
|
67
|
+
});
|
|
68
|
+
},
|
|
69
|
+
run(context) {
|
|
70
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
71
|
+
return [context.payload.body];
|
|
72
|
+
});
|
|
73
|
+
},
|
|
74
|
+
test(context) {
|
|
75
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
76
|
+
var _a, _b, _c, _d;
|
|
77
|
+
const eventType = (_a = context.propsValue.event_type) !== null && _a !== void 0 ? _a : 'post_published';
|
|
78
|
+
const status = (_b = EVENT_TYPE_STATUS_MAP[eventType]) !== null && _b !== void 0 ? _b : 'published';
|
|
79
|
+
const response = yield common_1.feedhiveCommon.apiCall({
|
|
80
|
+
token: context.auth.secret_text,
|
|
81
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
82
|
+
path: '/posts',
|
|
83
|
+
queryParams: { limit: '5', status },
|
|
84
|
+
});
|
|
85
|
+
const posts = (_d = (_c = response.body.data) === null || _c === void 0 ? void 0 : _c.items) !== null && _d !== void 0 ? _d : [];
|
|
86
|
+
return posts.map((post) => buildSamplePayload(eventType, post));
|
|
87
|
+
});
|
|
88
|
+
},
|
|
89
|
+
});
|
|
90
|
+
function buildSamplePayload(eventType, post) {
|
|
91
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
92
|
+
const postExcerpt = typeof post['text'] === 'string'
|
|
93
|
+
? post['text'].slice(0, 100) + (post['text'].length > 100 ? '...' : '')
|
|
94
|
+
: '(no text)';
|
|
95
|
+
const notificationPost = {
|
|
96
|
+
content: [{ text: (_a = post['text']) !== null && _a !== void 0 ? _a : '', media: (_b = post['media']) !== null && _b !== void 0 ? _b : [] }],
|
|
97
|
+
labels: (_c = post['labels']) !== null && _c !== void 0 ? _c : [],
|
|
98
|
+
postNotes: (_d = post['notes']) !== null && _d !== void 0 ? _d : '',
|
|
99
|
+
};
|
|
100
|
+
const base = {
|
|
101
|
+
post_id: (_e = post['id']) !== null && _e !== void 0 ? _e : null,
|
|
102
|
+
post_excerpt: postExcerpt,
|
|
103
|
+
post: notificationPost,
|
|
104
|
+
};
|
|
105
|
+
switch (eventType) {
|
|
106
|
+
case 'post_published':
|
|
107
|
+
return Object.assign(Object.assign({}, base), { social_type: '(see FeedHive notification)', social_name: '(see FeedHive notification)', public_id: null, public_url: null });
|
|
108
|
+
case 'post_scheduled':
|
|
109
|
+
return Object.assign(Object.assign({}, base), { schedule_at: (_f = post['scheduled_at']) !== null && _f !== void 0 ? _f : null, pending_approval: false, social_types: '(see FeedHive notification)' });
|
|
110
|
+
case 'post_failed':
|
|
111
|
+
return Object.assign(Object.assign({}, base), { failed_at: (_g = post['updated_at']) !== null && _g !== void 0 ? _g : null, message: '(see FeedHive notification)', social_type: '(see FeedHive notification)', social_name: '(see FeedHive notification)' });
|
|
112
|
+
default:
|
|
113
|
+
return base;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=post-notification.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"post-notification.js","sourceRoot":"","sources":["../../../../src/lib/triggers/post-notification.ts"],"names":[],"mappings":";;;;AAAA,qEAA0F;AAC1F,+DAAyD;AACzD,yCAA8C;AAC9C,sCAA2C;AAE3C,MAAM,qBAAqB,GAA2B;IACpD,cAAc,EAAE,WAAW;IAC3B,cAAc,EAAE,WAAW;IAC3B,WAAW,EAAE,QAAQ;CACt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