@agnocon/piece-buffer 0.0.5
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/LICENSE.MIT-AP +24 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +40 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/actions/create-idea.d.ts +8 -0
- package/dist/lib/actions/create-idea.d.ts.map +1 -0
- package/dist/lib/actions/create-idea.js +102 -0
- package/dist/lib/actions/create-idea.js.map +1 -0
- package/dist/lib/actions/create-post.d.ts +12 -0
- package/dist/lib/actions/create-post.d.ts.map +1 -0
- package/dist/lib/actions/create-post.js +141 -0
- package/dist/lib/actions/create-post.js.map +1 -0
- package/dist/lib/common/auth.d.ts +2 -0
- package/dist/lib/common/auth.d.ts.map +1 -0
- package/dist/lib/common/auth.js +37 -0
- package/dist/lib/common/auth.js.map +1 -0
- package/dist/lib/common/client.d.ts +11 -0
- package/dist/lib/common/client.d.ts.map +1 -0
- package/dist/lib/common/client.js +34 -0
- package/dist/lib/common/client.js.map +1 -0
- package/dist/lib/common/props.d.ts +52 -0
- package/dist/lib/common/props.d.ts.map +1 -0
- package/dist/lib/common/props.js +181 -0
- package/dist/lib/common/props.js.map +1 -0
- package/dist/lib/triggers/new-channel.d.ts +11 -0
- package/dist/lib/triggers/new-channel.d.ts.map +1 -0
- package/dist/lib/triggers/new-channel.js +73 -0
- package/dist/lib/triggers/new-channel.js.map +1 -0
- package/dist/lib/triggers/new-queue-item.d.ts +15 -0
- package/dist/lib/triggers/new-queue-item.d.ts.map +1 -0
- package/dist/lib/triggers/new-queue-item.js +118 -0
- package/dist/lib/triggers/new-queue-item.js.map +1 -0
- package/dist/lib/triggers/new-sent-item.d.ts +15 -0
- package/dist/lib/triggers/new-sent-item.d.ts.map +1 -0
- package/dist/lib/triggers/new-sent-item.js +117 -0
- package/dist/lib/triggers/new-sent-item.js.map +1 -0
- package/package.json +46 -0
- package/src/index.ts +33 -0
- package/src/lib/actions/create-idea.ts +123 -0
- package/src/lib/actions/create-post.ts +173 -0
- package/src/lib/common/auth.ts +31 -0
- package/src/lib/common/client.ts +44 -0
- package/src/lib/common/props.ts +224 -0
- package/src/lib/triggers/new-channel.ts +73 -0
- package/src/lib/triggers/new-queue-item.ts +122 -0
- package/src/lib/triggers/new-sent-item.ts +121 -0
package/LICENSE.MIT-AP
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Activepieces AB
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
Derived helpers in this folder are adapted from Activepieces (MIT) for use
|
|
24
|
+
inside CX without depending on @activepieces/* packages at runtime.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,MAAM,yGAqBjB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buffer = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
// Vendored from Activepieces packages/pieces/community/buffer/src/index.ts (MIT).
|
|
6
|
+
// Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
|
|
7
|
+
const pieces_framework_1 = require("@agnocon/pieces-framework");
|
|
8
|
+
const pieces_common_1 = require("@agnocon/pieces-common");
|
|
9
|
+
const pieces_framework_2 = require("@agnocon/pieces-framework");
|
|
10
|
+
const auth_1 = require("./lib/common/auth");
|
|
11
|
+
const client_1 = require("./lib/common/client");
|
|
12
|
+
const create_post_1 = require("./lib/actions/create-post");
|
|
13
|
+
const create_idea_1 = require("./lib/actions/create-idea");
|
|
14
|
+
const new_channel_1 = require("./lib/triggers/new-channel");
|
|
15
|
+
const new_queue_item_1 = require("./lib/triggers/new-queue-item");
|
|
16
|
+
const new_sent_item_1 = require("./lib/triggers/new-sent-item");
|
|
17
|
+
exports.buffer = (0, pieces_framework_1.createPiece)({
|
|
18
|
+
displayName: 'Buffer',
|
|
19
|
+
description: 'Schedule, publish and analyze social media posts across multiple channels with Buffer.',
|
|
20
|
+
auth: auth_1.bufferAuth,
|
|
21
|
+
minimumSupportedRelease: '0.36.1',
|
|
22
|
+
logoUrl: 'https://cdn.activepieces.com/pieces/buffer.png',
|
|
23
|
+
categories: [pieces_framework_2.PieceCategory.MARKETING],
|
|
24
|
+
authors: ['sanket-a11y'],
|
|
25
|
+
actions: [
|
|
26
|
+
create_post_1.createPost,
|
|
27
|
+
create_idea_1.createIdea,
|
|
28
|
+
(0, pieces_common_1.createCustomApiCallAction)({
|
|
29
|
+
baseUrl: () => client_1.bufferClient.apiUrl,
|
|
30
|
+
auth: auth_1.bufferAuth,
|
|
31
|
+
authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
32
|
+
return ({
|
|
33
|
+
Authorization: `Bearer ${auth.secret_text}`,
|
|
34
|
+
});
|
|
35
|
+
}),
|
|
36
|
+
}),
|
|
37
|
+
],
|
|
38
|
+
triggers: [new_channel_1.newChannel, new_queue_item_1.newQueueItem, new_sent_item_1.newSentItem],
|
|
39
|
+
});
|
|
40
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,kFAAkF;AAClF,qEAAqE;AACrE,gEAAwD;AACxD,0DAAmE;AACnE,gEAA0D;AAC1D,4CAA+C;AAC/C,gDAAmD;AACnD,2DAAuD;AACvD,2DAAuD;AACvD,4DAAwD;AACxD,kEAA6D;AAC7D,gEAA2D;AAE9C,QAAA,MAAM,GAAG,IAAA,8BAAW,EAAC;IAChC,WAAW,EAAE,QAAQ;IACrB,WAAW,EACT,wFAAwF;IAC1F,IAAI,EAAE,iBAAU;IAChB,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,gDAAgD;IACzD,UAAU,EAAE,CAAC,gCAAa,CAAC,SAAS,CAAC;IACrC,OAAO,EAAE,CAAC,aAAa,CAAC;IACxB,OAAO,EAAE;QACP,wBAAU;QACV,wBAAU;QACV,IAAA,yCAAyB,EAAC;YACxB,OAAO,EAAE,GAAG,EAAE,CAAC,qBAAY,CAAC,MAAM;YAClC,IAAI,EAAE,iBAAU;YAChB,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,wBAAU,EAAE,6BAAY,EAAE,2BAAW,CAAC;CAClD,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const createIdea: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
+
organizationId: import("@agnocon/pieces-framework").DropdownProperty<string, true, import("@agnocon/pieces-framework").SecretTextProperty<true>>;
|
|
3
|
+
title: import("@agnocon/pieces-framework").ShortTextProperty<false>;
|
|
4
|
+
text: import("@agnocon/pieces-framework").LongTextProperty<false>;
|
|
5
|
+
imageUrls: import("@agnocon/pieces-framework").ArrayProperty<false>;
|
|
6
|
+
aiAssisted: import("@agnocon/pieces-framework").CheckboxProperty<false>;
|
|
7
|
+
}>;
|
|
8
|
+
//# sourceMappingURL=create-idea.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-idea.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/create-idea.ts"],"names":[],"mappings":"AAuDA,eAAO,MAAM,UAAU;;;;;;EAqErB,CAAC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createIdea = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
// Vendored from Activepieces packages/pieces/community/buffer/src/lib/actions/create-idea.ts (MIT).
|
|
6
|
+
// Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
|
|
7
|
+
const pieces_framework_1 = require("@agnocon/pieces-framework");
|
|
8
|
+
const auth_1 = require("../common/auth");
|
|
9
|
+
const client_1 = require("../common/client");
|
|
10
|
+
const props_1 = require("../common/props");
|
|
11
|
+
const CREATE_IDEA_MUTATION = `
|
|
12
|
+
mutation CreateIdea($input: CreateIdeaInput!) {
|
|
13
|
+
createIdea(input: $input) {
|
|
14
|
+
__typename
|
|
15
|
+
... on IdeaResponse {
|
|
16
|
+
idea {
|
|
17
|
+
id
|
|
18
|
+
organizationId
|
|
19
|
+
groupId
|
|
20
|
+
createdAt
|
|
21
|
+
updatedAt
|
|
22
|
+
content {
|
|
23
|
+
title
|
|
24
|
+
text
|
|
25
|
+
media { url type alt }
|
|
26
|
+
tags { id name color }
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
refreshIdeas
|
|
30
|
+
}
|
|
31
|
+
... on MutationError {
|
|
32
|
+
message
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
`;
|
|
37
|
+
exports.createIdea = (0, pieces_framework_1.createAction)({
|
|
38
|
+
auth: auth_1.bufferAuth,
|
|
39
|
+
name: 'create_idea',
|
|
40
|
+
displayName: 'Create Idea',
|
|
41
|
+
description: "Save a new idea to your Buffer Idea Bank.",
|
|
42
|
+
audience: 'both',
|
|
43
|
+
aiMetadata: {
|
|
44
|
+
description: 'Saves a new draft idea (title, body text, and/or attached images) to a Buffer organization\'s Idea Bank for later use. Choose it to stash content concepts without scheduling them to a channel. The idea must include at least a title, text, or one image. Not idempotent — each call creates a new idea.',
|
|
45
|
+
idempotent: false,
|
|
46
|
+
},
|
|
47
|
+
props: {
|
|
48
|
+
organizationId: props_1.bufferProps.organizationId(),
|
|
49
|
+
title: pieces_framework_1.Property.ShortText({
|
|
50
|
+
displayName: 'Title',
|
|
51
|
+
description: 'A short title or headline for the idea.',
|
|
52
|
+
required: false,
|
|
53
|
+
}),
|
|
54
|
+
text: pieces_framework_1.Property.LongText({
|
|
55
|
+
displayName: 'Text',
|
|
56
|
+
description: 'The main body of the idea.',
|
|
57
|
+
required: false,
|
|
58
|
+
}),
|
|
59
|
+
imageUrls: pieces_framework_1.Property.Array({
|
|
60
|
+
displayName: 'Image URLs',
|
|
61
|
+
description: 'Public URLs of images to attach to the idea.',
|
|
62
|
+
required: false,
|
|
63
|
+
}),
|
|
64
|
+
aiAssisted: pieces_framework_1.Property.Checkbox({
|
|
65
|
+
displayName: 'AI Assisted',
|
|
66
|
+
description: 'Mark this idea as created with AI assistance.',
|
|
67
|
+
required: false,
|
|
68
|
+
defaultValue: false,
|
|
69
|
+
}),
|
|
70
|
+
},
|
|
71
|
+
run(context) {
|
|
72
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
73
|
+
const { organizationId, title, text, imageUrls, aiAssisted } = context.propsValue;
|
|
74
|
+
if (!title && !text && (!imageUrls || imageUrls.length === 0)) {
|
|
75
|
+
throw new Error('An idea must include at least a title, text, or one image.');
|
|
76
|
+
}
|
|
77
|
+
const media = (imageUrls !== null && imageUrls !== void 0 ? imageUrls : []).map((url) => ({
|
|
78
|
+
url: url,
|
|
79
|
+
type: 'image',
|
|
80
|
+
}));
|
|
81
|
+
const content = {};
|
|
82
|
+
if (title)
|
|
83
|
+
content['title'] = title;
|
|
84
|
+
if (text)
|
|
85
|
+
content['text'] = text;
|
|
86
|
+
if (media.length > 0)
|
|
87
|
+
content['media'] = media;
|
|
88
|
+
if (aiAssisted)
|
|
89
|
+
content['aiAssisted'] = true;
|
|
90
|
+
const data = yield client_1.bufferClient.graphql({
|
|
91
|
+
accessToken: context.auth.secret_text,
|
|
92
|
+
query: CREATE_IDEA_MUTATION,
|
|
93
|
+
variables: { input: { organizationId, content } },
|
|
94
|
+
});
|
|
95
|
+
if (data.createIdea.message) {
|
|
96
|
+
throw new Error(`Buffer rejected the idea: ${data.createIdea.message}`);
|
|
97
|
+
}
|
|
98
|
+
return data;
|
|
99
|
+
});
|
|
100
|
+
},
|
|
101
|
+
});
|
|
102
|
+
//# sourceMappingURL=create-idea.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-idea.js","sourceRoot":"","sources":["../../../src/lib/actions/create-idea.ts"],"names":[],"mappings":";;;;AAAA,oGAAoG;AACpG,qEAAqE;AACrE,gEAAmE;AACnE,yCAA4C;AAC5C,6CAAgD;AAChD,2CAA8C;AAuB9C,MAAM,oBA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AC;YAED,MAAM,KAAK,GAAG,CAAC,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;gBAC5C,GAAG,EAAE,GAAa;gBAClB,IAAI,EAAE,OAAO;aACd,CAAC,CAAC,CAAC;YAEJ,MAAM,OAAO,GAA4B,EAAE,CAAC;YAC5C,IAAI,KAAK;gBAAE,OAAO,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC;YACpC,IAAI,IAAI;gBAAE,OAAO,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;YACjC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;gBAAE,OAAO,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC;YAC/C,IAAI,UAAU;gBAAE,OAAO,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC;YAE7C,MAAM,IAAI,GAAG,MAAM,qBAAY,CAAC,OAAO,CAAqB;gBAC1D,WAAW,EAAE,OAAO,CAAC,IAAI,CAAC,WAAW;gBACrC,KAAK,EAAE,oBAAoB;gBAC3B,SAAS,EAAE,EAAE,KAAK,EAAE,EAAE,cAAc,EAAE,OAAO,EAAE,EAAE;aAClD,CAAC,CAAC;YAEH,IAAI,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;gBAC5B,MAAM,IAAI,KAAK,CACb,6BAA6B,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,CACvD,CAAC;YACJ,CAAC;YACD,OAAO,IAAI,CAAC;QACd,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const createPost: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
+
organizationId: import("@agnocon/pieces-framework").DropdownProperty<string, true, import("@agnocon/pieces-framework").SecretTextProperty<true>>;
|
|
3
|
+
channelIds: import("@agnocon/pieces-framework").MultiSelectDropdownProperty<string, false, import("@agnocon/pieces-framework").SecretTextProperty<true>> | import("@agnocon/pieces-framework").MultiSelectDropdownProperty<string, true, import("@agnocon/pieces-framework").SecretTextProperty<true>>;
|
|
4
|
+
text: import("@agnocon/pieces-framework").LongTextProperty<true>;
|
|
5
|
+
mode: import("@agnocon/pieces-framework").StaticDropdownProperty<string, true>;
|
|
6
|
+
dueAt: import("@agnocon/pieces-framework").DateTimeProperty<false>;
|
|
7
|
+
schedulingType: import("@agnocon/pieces-framework").StaticDropdownProperty<string, true>;
|
|
8
|
+
saveToDraft: import("@agnocon/pieces-framework").CheckboxProperty<false>;
|
|
9
|
+
imageUrls: import("@agnocon/pieces-framework").ArrayProperty<false>;
|
|
10
|
+
linkUrl: import("@agnocon/pieces-framework").ShortTextProperty<false>;
|
|
11
|
+
}>;
|
|
12
|
+
//# 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":"AA2CA,eAAO,MAAM,UAAU;;;;;;;;;;EAmIrB,CAAC"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createPost = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
// Vendored from Activepieces packages/pieces/community/buffer/src/lib/actions/create-post.ts (MIT).
|
|
6
|
+
// Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
|
|
7
|
+
const pieces_framework_1 = require("@agnocon/pieces-framework");
|
|
8
|
+
const auth_1 = require("../common/auth");
|
|
9
|
+
const client_1 = require("../common/client");
|
|
10
|
+
const props_1 = require("../common/props");
|
|
11
|
+
const CREATE_POST_MUTATION = `
|
|
12
|
+
mutation CreatePost($input: CreatePostInput!) {
|
|
13
|
+
createPost(input: $input) {
|
|
14
|
+
__typename
|
|
15
|
+
... on PostActionSuccess {
|
|
16
|
+
post {
|
|
17
|
+
id
|
|
18
|
+
text
|
|
19
|
+
status
|
|
20
|
+
dueAt
|
|
21
|
+
sentAt
|
|
22
|
+
channelId
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
... on MutationError {
|
|
26
|
+
message
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
`;
|
|
31
|
+
exports.createPost = (0, pieces_framework_1.createAction)({
|
|
32
|
+
auth: auth_1.bufferAuth,
|
|
33
|
+
name: 'create_post',
|
|
34
|
+
displayName: 'Create Post',
|
|
35
|
+
description: 'Create a post in Buffer and add it to the queue, share it next, share it now, or schedule it for a custom time.',
|
|
36
|
+
audience: 'both',
|
|
37
|
+
aiMetadata: {
|
|
38
|
+
description: 'Creates a social media post in Buffer for one or more channels, where the share mode controls timing: add to the channel queue, share next (skip the queue), share now, or schedule for a custom time. Choose it to draft or publish content to connected social accounts. A custom-scheduled post requires the scheduled time; posting to multiple channels creates a separate post per channel. Not idempotent — each call creates new posts.',
|
|
39
|
+
idempotent: false,
|
|
40
|
+
},
|
|
41
|
+
props: {
|
|
42
|
+
organizationId: props_1.bufferProps.organizationId(),
|
|
43
|
+
channelIds: props_1.bufferProps.channelIds(true),
|
|
44
|
+
text: pieces_framework_1.Property.LongText({
|
|
45
|
+
displayName: 'Text',
|
|
46
|
+
description: 'The text content of the post.',
|
|
47
|
+
required: true,
|
|
48
|
+
}),
|
|
49
|
+
mode: pieces_framework_1.Property.StaticDropdown({
|
|
50
|
+
displayName: 'Share Mode',
|
|
51
|
+
description: 'When and how the post should be published.',
|
|
52
|
+
required: true,
|
|
53
|
+
defaultValue: 'addToQueue',
|
|
54
|
+
options: {
|
|
55
|
+
disabled: false,
|
|
56
|
+
options: [
|
|
57
|
+
{ label: 'Add to Queue', value: 'addToQueue' },
|
|
58
|
+
{ label: 'Share Next (skip the queue)', value: 'shareNext' },
|
|
59
|
+
{ label: 'Share Now', value: 'shareNow' },
|
|
60
|
+
{ label: 'Schedule for Custom Time', value: 'customScheduled' },
|
|
61
|
+
],
|
|
62
|
+
},
|
|
63
|
+
}),
|
|
64
|
+
dueAt: pieces_framework_1.Property.DateTime({
|
|
65
|
+
displayName: 'Scheduled Time',
|
|
66
|
+
description: 'When to publish the post. Required when Share Mode is "Schedule for Custom Time". ISO 8601 (UTC).',
|
|
67
|
+
required: false,
|
|
68
|
+
}),
|
|
69
|
+
schedulingType: pieces_framework_1.Property.StaticDropdown({
|
|
70
|
+
displayName: 'Scheduling Type',
|
|
71
|
+
description: 'Use "Automatic" for channels Buffer can publish to directly. Use "Notification" for channels that require manual publishing via the Buffer mobile app (e.g. Instagram personal accounts).',
|
|
72
|
+
required: true,
|
|
73
|
+
defaultValue: 'automatic',
|
|
74
|
+
options: {
|
|
75
|
+
disabled: false,
|
|
76
|
+
options: [
|
|
77
|
+
{ label: 'Automatic', value: 'automatic' },
|
|
78
|
+
{ label: 'Notification (manual publish)', value: 'notification' },
|
|
79
|
+
],
|
|
80
|
+
},
|
|
81
|
+
}),
|
|
82
|
+
saveToDraft: pieces_framework_1.Property.Checkbox({
|
|
83
|
+
displayName: 'Save as Draft',
|
|
84
|
+
description: 'Save the post as a draft instead of scheduling it. Drafts are not published until explicitly scheduled.',
|
|
85
|
+
required: false,
|
|
86
|
+
defaultValue: false,
|
|
87
|
+
}),
|
|
88
|
+
imageUrls: pieces_framework_1.Property.Array({
|
|
89
|
+
displayName: 'Image URLs',
|
|
90
|
+
description: 'Public URLs of images to attach to the post.',
|
|
91
|
+
required: false,
|
|
92
|
+
}),
|
|
93
|
+
linkUrl: pieces_framework_1.Property.ShortText({
|
|
94
|
+
displayName: 'Link URL',
|
|
95
|
+
description: 'A link to attach to the post (used as a link preview).',
|
|
96
|
+
required: false,
|
|
97
|
+
}),
|
|
98
|
+
},
|
|
99
|
+
run(context) {
|
|
100
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
101
|
+
const { channelIds, text, mode, dueAt, schedulingType, saveToDraft, imageUrls, linkUrl, } = context.propsValue;
|
|
102
|
+
if (mode === 'customScheduled' && !dueAt) {
|
|
103
|
+
throw new Error('Scheduled Time is required when Share Mode is "Schedule for Custom Time".');
|
|
104
|
+
}
|
|
105
|
+
const assets = [];
|
|
106
|
+
for (const url of imageUrls !== null && imageUrls !== void 0 ? imageUrls : []) {
|
|
107
|
+
assets.push({ image: { url: url } });
|
|
108
|
+
}
|
|
109
|
+
if (linkUrl) {
|
|
110
|
+
assets.push({ link: { url: linkUrl } });
|
|
111
|
+
}
|
|
112
|
+
const results = [];
|
|
113
|
+
for (const channelId of channelIds !== null && channelIds !== void 0 ? channelIds : []) {
|
|
114
|
+
const input = {
|
|
115
|
+
channelId,
|
|
116
|
+
text,
|
|
117
|
+
mode,
|
|
118
|
+
schedulingType,
|
|
119
|
+
assets,
|
|
120
|
+
};
|
|
121
|
+
if (mode === 'customScheduled' && dueAt) {
|
|
122
|
+
input['dueAt'] = dueAt;
|
|
123
|
+
}
|
|
124
|
+
if (saveToDraft) {
|
|
125
|
+
input['saveToDraft'] = true;
|
|
126
|
+
}
|
|
127
|
+
const data = yield client_1.bufferClient.graphql({
|
|
128
|
+
accessToken: context.auth.secret_text,
|
|
129
|
+
query: CREATE_POST_MUTATION,
|
|
130
|
+
variables: { input },
|
|
131
|
+
});
|
|
132
|
+
if (data.createPost.message) {
|
|
133
|
+
throw new Error(`Buffer rejected the post for channel ${channelId}: ${data.createPost.message}`);
|
|
134
|
+
}
|
|
135
|
+
results.push(data.createPost);
|
|
136
|
+
}
|
|
137
|
+
return { posts: results };
|
|
138
|
+
});
|
|
139
|
+
},
|
|
140
|
+
});
|
|
141
|
+
//# 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,oGAAoG;AACpG,qEAAqE;AACrE,gEAAmE;AACnE,yCAA4C;AAC5C,6CA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eAAO,MAAM,UAAU,8DA2BrB,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.bufferAuth = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
// Vendored from Activepieces packages/pieces/community/buffer/src/lib/common/auth.ts (MIT).
|
|
6
|
+
// Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
|
|
7
|
+
const pieces_framework_1 = require("@agnocon/pieces-framework");
|
|
8
|
+
const client_1 = require("./client");
|
|
9
|
+
exports.bufferAuth = pieces_framework_1.PieceAuth.SecretText({
|
|
10
|
+
displayName: 'Access Token',
|
|
11
|
+
description: `
|
|
12
|
+
**How to get your Buffer access token:**
|
|
13
|
+
|
|
14
|
+
1. Sign in to Buffer at https://buffer.com and open the [Developer Apps](https://publish.buffer.com/developers/apps) page.
|
|
15
|
+
2. Click **Create New App** and fill in the basic details (callback URL can be any placeholder).
|
|
16
|
+
3. After the app is created, copy the **Access Token** shown on the app's page.
|
|
17
|
+
4. Paste it below.
|
|
18
|
+
|
|
19
|
+
The token is sent as a Bearer token to the Buffer GraphQL API (https://api.buffer.com).`,
|
|
20
|
+
required: true,
|
|
21
|
+
validate: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
22
|
+
try {
|
|
23
|
+
yield client_1.bufferClient.graphql({
|
|
24
|
+
accessToken: auth,
|
|
25
|
+
query: `query { account { id } }`,
|
|
26
|
+
});
|
|
27
|
+
return { valid: true };
|
|
28
|
+
}
|
|
29
|
+
catch (e) {
|
|
30
|
+
return {
|
|
31
|
+
valid: false,
|
|
32
|
+
error: 'Invalid Buffer access token. Make sure the token has the required scopes and try again.',
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
}),
|
|
36
|
+
});
|
|
37
|
+
//# sourceMappingURL=auth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/lib/common/auth.ts"],"names":[],"mappings":";;;;AAAA,4FAA4F;AAC5F,qEAAqE;AACrE,gEAAsD;AACtD,qCAAwC;AAE3B,QAAA,UAAU,GAAG,4BAAS,CAAC,UAAU,CAAC;IAC7C,WAAW,EAAE,cAAc;IAC3B,WAAW,EAAE;;;;;;;;wFAQyE;IACtF,QAAQ,EAAE,IAAI;IACd,QAAQ,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;QACvB,IAAI,CAAC;YACH,MAAM,qBAAY,CAAC,OAAO,CAA8B;gBACtD,WAAW,EAAE,IAAI;gBACjB,KAAK,EAAE,0BAA0B;aAClC,CAAC,CAAC;YACH,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;QACzB,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO;gBACL,KAAK,EAAE,KAAK;gBACZ,KAAK,EACH,yFAAyF;aAC5F,CAAC;QACJ,CAAC;IACH,CAAC,CAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare function graphqlRequest<T>({ accessToken, query, variables, }: {
|
|
2
|
+
accessToken: string;
|
|
3
|
+
query: string;
|
|
4
|
+
variables?: Record<string, unknown>;
|
|
5
|
+
}): Promise<T>;
|
|
6
|
+
export declare const bufferClient: {
|
|
7
|
+
graphql: typeof graphqlRequest;
|
|
8
|
+
apiUrl: string;
|
|
9
|
+
};
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/lib/common/client.ts"],"names":[],"mappings":"AAWA,iBAAe,cAAc,CAAC,CAAC,EAAE,EAC/B,WAAW,EACX,KAAK,EACL,SAAS,GACV,EAAE;IACD,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACrC,GAAG,OAAO,CAAC,CAAC,CAAC,CAqBb;AAED,eAAO,MAAM,YAAY;;;CAGxB,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.bufferClient = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
// Vendored from Activepieces packages/pieces/community/buffer/src/lib/common/client.ts (MIT).
|
|
6
|
+
// Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
|
|
7
|
+
const pieces_common_1 = require("@agnocon/pieces-common");
|
|
8
|
+
const BUFFER_API_URL = 'https://api.buffer.com';
|
|
9
|
+
function graphqlRequest(_a) {
|
|
10
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* ({ accessToken, query, variables, }) {
|
|
11
|
+
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
12
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
13
|
+
url: BUFFER_API_URL,
|
|
14
|
+
headers: {
|
|
15
|
+
Authorization: `Bearer ${accessToken}`,
|
|
16
|
+
'Content-Type': 'application/json',
|
|
17
|
+
},
|
|
18
|
+
body: { query, variables: variables !== null && variables !== void 0 ? variables : {} },
|
|
19
|
+
});
|
|
20
|
+
const body = response.body;
|
|
21
|
+
if (body.errors && body.errors.length > 0) {
|
|
22
|
+
throw new Error(`Buffer API error: ${body.errors.map((e) => e.message).join('; ')}`);
|
|
23
|
+
}
|
|
24
|
+
if (!body.data) {
|
|
25
|
+
throw new Error('Buffer API returned no data');
|
|
26
|
+
}
|
|
27
|
+
return body.data;
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
exports.bufferClient = {
|
|
31
|
+
graphql: graphqlRequest,
|
|
32
|
+
apiUrl: BUFFER_API_URL,
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/lib/common/client.ts"],"names":[],"mappings":";;;;AAAA,8FAA8F;AAC9F,qEAAqE;AACrE,0DAAgE;AAEhE,MAAM,cAAc,GAAG,wBAAwB,CAAC;AAOhD,SAAe,cAAc;iEAAI,EAC/B,WAAW,EACX,KAAK,EACL,SAAS,GAKV;QACC,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAqB;YAChE,MAAM,EAAE,0BAAU,CAAC,IAAI;YACvB,GAAG,EAAE,cAAc;YACnB,OAAO,EAAE;gBACP,aAAa,EAAE,UAAU,WAAW,EAAE;gBACtC,cAAc,EAAE,kBAAkB;aACnC;YACD,IAAI,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,EAAE,EAAE;SAC5C,CAAC,CAAC;QAEH,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC;QAC3B,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC1C,MAAM,IAAI,KAAK,CACb,qBAAqB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACpE,CAAC;QACJ,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;QACjD,CAAC;QACD,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;CAAA;AAEY,QAAA,YAAY,GAAG;IAC1B,OAAO,EAAE,cAAc;IACvB,MAAM,EAAE,cAAc;CACvB,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
declare function fetchOrganizations(accessToken: string): Promise<Organization[]>;
|
|
2
|
+
declare function fetchChannels(accessToken: string, organizationId: string): Promise<Channel[]>;
|
|
3
|
+
declare function fetchPosts({ accessToken, organizationId, channelIds, statusFilter, first, }: {
|
|
4
|
+
accessToken: string;
|
|
5
|
+
organizationId: string;
|
|
6
|
+
channelIds?: string[];
|
|
7
|
+
statusFilter?: (status: string | undefined) => boolean;
|
|
8
|
+
first?: number;
|
|
9
|
+
}): Promise<BufferPost[]>;
|
|
10
|
+
export declare const bufferProps: {
|
|
11
|
+
organizationId: () => import("@agnocon/pieces-framework").DropdownProperty<string, true, import("@agnocon/pieces-framework").SecretTextProperty<true>>;
|
|
12
|
+
channelIds: (required?: boolean) => import("@agnocon/pieces-framework").MultiSelectDropdownProperty<string, false, import("@agnocon/pieces-framework").SecretTextProperty<true>> | import("@agnocon/pieces-framework").MultiSelectDropdownProperty<string, true, import("@agnocon/pieces-framework").SecretTextProperty<true>>;
|
|
13
|
+
channelId: () => import("@agnocon/pieces-framework").DropdownProperty<string, true, import("@agnocon/pieces-framework").SecretTextProperty<true>>;
|
|
14
|
+
};
|
|
15
|
+
export declare const bufferQueries: {
|
|
16
|
+
fetchOrganizations: typeof fetchOrganizations;
|
|
17
|
+
fetchChannels: typeof fetchChannels;
|
|
18
|
+
fetchPosts: typeof fetchPosts;
|
|
19
|
+
};
|
|
20
|
+
export type Organization = {
|
|
21
|
+
id: string;
|
|
22
|
+
name: string;
|
|
23
|
+
};
|
|
24
|
+
export type Channel = {
|
|
25
|
+
id: string;
|
|
26
|
+
name: string;
|
|
27
|
+
service: string;
|
|
28
|
+
organizationId: string;
|
|
29
|
+
createdAt?: string;
|
|
30
|
+
};
|
|
31
|
+
export type BufferPost = {
|
|
32
|
+
id: string;
|
|
33
|
+
text?: string;
|
|
34
|
+
status?: string;
|
|
35
|
+
createdAt?: string;
|
|
36
|
+
updatedAt?: string;
|
|
37
|
+
dueAt?: string;
|
|
38
|
+
sentAt?: string;
|
|
39
|
+
channelId?: string;
|
|
40
|
+
channelService?: string;
|
|
41
|
+
channel?: {
|
|
42
|
+
id: string;
|
|
43
|
+
name: string;
|
|
44
|
+
service: string;
|
|
45
|
+
};
|
|
46
|
+
tags?: Array<{
|
|
47
|
+
id: string;
|
|
48
|
+
name: string;
|
|
49
|
+
}>;
|
|
50
|
+
};
|
|
51
|
+
export {};
|
|
52
|
+
//# sourceMappingURL=props.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/lib/common/props.ts"],"names":[],"mappings":"AAMA,iBAAe,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAQ9E;AAED,iBAAe,aAAa,CAC1B,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,OAAO,EAAE,CAAC,CAepB;AAED,iBAAe,UAAU,CAAC,EACxB,WAAW,EACX,cAAc,EACd,UAAU,EACV,YAAY,EACZ,KAAU,GACX,EAAE;IACD,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,KAAK,OAAO,CAAC;IACvD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAqCxB;AAED,eAAO,MAAM,WAAW;;;;CA4GvB,CAAC;AAEF,eAAO,MAAM,aAAa;;;;CAIzB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAExD,MAAM,MAAM,OAAO,GAAG;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,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