@agnocon/piece-canny 0.1.6
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 +42 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/actions/create-post.d.ts +14 -0
- package/dist/lib/actions/create-post.d.ts.map +1 -0
- package/dist/lib/actions/create-post.js +96 -0
- package/dist/lib/actions/create-post.js.map +1 -0
- package/dist/lib/actions/create-vote.d.ts +5 -0
- package/dist/lib/actions/create-vote.d.ts.map +1 -0
- package/dist/lib/actions/create-vote.js +45 -0
- package/dist/lib/actions/create-vote.js.map +1 -0
- package/dist/lib/actions/delete-vote.d.ts +5 -0
- package/dist/lib/actions/delete-vote.d.ts.map +1 -0
- package/dist/lib/actions/delete-vote.js +45 -0
- package/dist/lib/actions/delete-vote.js.map +1 -0
- package/dist/lib/actions/list-posts.d.ts +9 -0
- package/dist/lib/actions/list-posts.d.ts.map +1 -0
- package/dist/lib/actions/list-posts.js +102 -0
- package/dist/lib/actions/list-posts.js.map +1 -0
- package/dist/lib/actions/retrieve-post.d.ts +4 -0
- package/dist/lib/actions/retrieve-post.d.ts.map +1 -0
- package/dist/lib/actions/retrieve-post.js +37 -0
- package/dist/lib/actions/retrieve-post.js.map +1 -0
- package/dist/lib/auth.d.ts +2 -0
- package/dist/lib/auth.d.ts.map +1 -0
- package/dist/lib/auth.js +35 -0
- package/dist/lib/auth.js.map +1 -0
- package/dist/lib/common/client.d.ts +15 -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 +2 -0
- package/dist/lib/common/props.d.ts.map +1 -0
- package/dist/lib/common/props.js +38 -0
- package/dist/lib/common/props.js.map +1 -0
- package/dist/lib/triggers/new-comment.d.ts +2 -0
- package/dist/lib/triggers/new-comment.d.ts.map +1 -0
- package/dist/lib/triggers/new-comment.js +52 -0
- package/dist/lib/triggers/new-comment.js.map +1 -0
- package/dist/lib/triggers/new-post.d.ts +2 -0
- package/dist/lib/triggers/new-post.d.ts.map +1 -0
- package/dist/lib/triggers/new-post.js +56 -0
- package/dist/lib/triggers/new-post.js.map +1 -0
- package/dist/lib/triggers/new-vote.d.ts +2 -0
- package/dist/lib/triggers/new-vote.d.ts.map +1 -0
- package/dist/lib/triggers/new-vote.js +64 -0
- package/dist/lib/triggers/new-vote.js.map +1 -0
- package/dist/lib/triggers/post-status-changed.d.ts +2 -0
- package/dist/lib/triggers/post-status-changed.d.ts.map +1 -0
- package/dist/lib/triggers/post-status-changed.js +56 -0
- package/dist/lib/triggers/post-status-changed.js.map +1 -0
- package/dist/lib/triggers/register-trigger.d.ts +13 -0
- package/dist/lib/triggers/register-trigger.d.ts.map +1 -0
- package/dist/lib/triggers/register-trigger.js +42 -0
- package/dist/lib/triggers/register-trigger.js.map +1 -0
- package/package.json +46 -0
- package/src/index.ts +39 -0
- package/src/lib/actions/create-post.ts +90 -0
- package/src/lib/actions/create-vote.ts +39 -0
- package/src/lib/actions/delete-vote.ts +39 -0
- package/src/lib/actions/list-posts.ts +99 -0
- package/src/lib/actions/retrieve-post.ts +31 -0
- package/src/lib/auth.ts +34 -0
- package/src/lib/common/client.ts +44 -0
- package/src/lib/common/props.ts +36 -0
- package/src/lib/triggers/new-comment.ts +48 -0
- package/src/lib/triggers/new-post.ts +52 -0
- package/src/lib/triggers/new-vote.ts +60 -0
- package/src/lib/triggers/post-status-changed.ts +52 -0
- package/src/lib/triggers/register-trigger.ts +50 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.boardIdProp = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
// Vendored from Activepieces packages/pieces/community/canny/src/lib/common/props.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("../auth");
|
|
9
|
+
const client_1 = require("./client");
|
|
10
|
+
exports.boardIdProp = pieces_framework_1.Property.Dropdown({
|
|
11
|
+
auth: auth_1.cannyAuth,
|
|
12
|
+
displayName: 'Board',
|
|
13
|
+
description: 'The board to use.',
|
|
14
|
+
required: true,
|
|
15
|
+
refreshers: [],
|
|
16
|
+
options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
17
|
+
var _b;
|
|
18
|
+
if (!auth) {
|
|
19
|
+
return {
|
|
20
|
+
disabled: true,
|
|
21
|
+
placeholder: 'Connect your Canny account first.',
|
|
22
|
+
options: [],
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
const response = yield (0, client_1.cannyRequest)({
|
|
26
|
+
apiKey: auth.secret_text,
|
|
27
|
+
path: '/boards/list',
|
|
28
|
+
});
|
|
29
|
+
return {
|
|
30
|
+
disabled: false,
|
|
31
|
+
options: ((_b = response.boards) !== null && _b !== void 0 ? _b : []).map((b) => ({
|
|
32
|
+
label: b.name,
|
|
33
|
+
value: b.id,
|
|
34
|
+
})),
|
|
35
|
+
};
|
|
36
|
+
}),
|
|
37
|
+
});
|
|
38
|
+
//# sourceMappingURL=props.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"props.js","sourceRoot":"","sources":["../../../src/lib/common/props.ts"],"names":[],"mappings":";;;;AAAA,4FAA4F;AAC5F,qEAAqE;AACrE,gEAAqD;AAErD,kCAAoC;AACpC,qCAAwC;AAE3B,QAAA,WAAW,GAAG,2BAAQ,CAAC,QAAQ,CAAC;IAC3C,IAAI,EAAE,gBAAS;IACf,WAAW,EAAE,OAAO;IACpB,WAAW,EAAE,mBAAmB;IAChC,QAAQ,EAAE,IAAI;IACd,UAAU,EAAE,EAAE;IACd,OAAO,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;;QACtB,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,OAAO;gBACL,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,mCAAmC;gBAChD,OAAO,EAAE,EAAE;aACZ,CAAC;QACJ,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,IAAA,qBAAY,EAEhC;YACD,MAAM,EAAE,IAAI,CAAC,WAAW;YACxB,IAAI,EAAE,cAAc;SACrB,CAAC,CAAC;QAEH,OAAO;YACL,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE,CAAC,MAAA,QAAQ,CAAC,MAAM,mCAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;gBAC3C,KAAK,EAAE,CAAC,CAAC,IAAI;gBACb,KAAK,EAAE,CAAC,CAAC,EAAE;aACZ,CAAC,CAAC;SACJ,CAAC;IACJ,CAAC,CAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const newCommentTrigger: import("@agnocon/pieces-framework").ITrigger<import("@agnocon/piece-types").TriggerStrategy.WEBHOOK, import("@agnocon/pieces-framework").SecretTextProperty<true>, {}> | import("@agnocon/pieces-framework").ITrigger<import("@agnocon/piece-types").TriggerStrategy.POLLING, import("@agnocon/pieces-framework").SecretTextProperty<true>, {}> | import("@agnocon/pieces-framework").ITrigger<import("@agnocon/piece-types").TriggerStrategy.MANUAL, import("@agnocon/pieces-framework").SecretTextProperty<true>, {}> | import("@agnocon/pieces-framework").ITrigger<import("@agnocon/piece-types").TriggerStrategy.APP_WEBHOOK, import("@agnocon/pieces-framework").SecretTextProperty<true>, {}>;
|
|
2
|
+
//# sourceMappingURL=new-comment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"new-comment.d.ts","sourceRoot":"","sources":["../../../src/lib/triggers/new-comment.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,iBAAiB,sqBA6C5B,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.newCommentTrigger = void 0;
|
|
4
|
+
// Vendored from Activepieces packages/pieces/community/canny/src/lib/triggers/new-comment.ts (MIT).
|
|
5
|
+
// Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
|
|
6
|
+
const register_trigger_1 = require("./register-trigger");
|
|
7
|
+
exports.newCommentTrigger = (0, register_trigger_1.createCannyTrigger)({
|
|
8
|
+
name: 'new_comment',
|
|
9
|
+
displayName: 'New Comment',
|
|
10
|
+
description: 'Triggers when a new comment is created on a post.',
|
|
11
|
+
aiMetadata: {
|
|
12
|
+
description: 'Fires when a new comment is added to any Canny post, delivering the comment along with its author and parent post. Use to react to discussion activity on feedback.',
|
|
13
|
+
},
|
|
14
|
+
eventType: 'comment.created',
|
|
15
|
+
sampleData: {
|
|
16
|
+
created: '2026-04-06T11:05:00.000Z',
|
|
17
|
+
objectType: 'comment',
|
|
18
|
+
type: 'comment.created',
|
|
19
|
+
object: {
|
|
20
|
+
id: 'comment123',
|
|
21
|
+
value: 'This is a great idea! We really need this feature.',
|
|
22
|
+
created: '2026-04-06T11:05:00.000Z',
|
|
23
|
+
by: null,
|
|
24
|
+
author: {
|
|
25
|
+
id: 'author456',
|
|
26
|
+
name: 'John Smith',
|
|
27
|
+
email: 'john@example.com',
|
|
28
|
+
isAdmin: false,
|
|
29
|
+
avatarURL: null,
|
|
30
|
+
created: '2026-01-08T07:26:38.452Z',
|
|
31
|
+
url: 'https://yourcompany.canny.io/admin/users/john-smith',
|
|
32
|
+
userID: null,
|
|
33
|
+
},
|
|
34
|
+
post: {
|
|
35
|
+
id: 'post123',
|
|
36
|
+
title: 'Sample feature request',
|
|
37
|
+
status: 'open',
|
|
38
|
+
score: 5,
|
|
39
|
+
created: '2026-04-06T10:35:58.342Z',
|
|
40
|
+
url: 'https://yourcompany.canny.io/admin/board/feature-requests/p/sample-feature-request',
|
|
41
|
+
board: {
|
|
42
|
+
id: 'board123',
|
|
43
|
+
name: 'Feature Requests',
|
|
44
|
+
postCount: 5,
|
|
45
|
+
created: '2026-04-06T10:35:08.905Z',
|
|
46
|
+
url: 'https://yourcompany.canny.io/admin/board/feature-requests',
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
//# sourceMappingURL=new-comment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"new-comment.js","sourceRoot":"","sources":["../../../src/lib/triggers/new-comment.ts"],"names":[],"mappings":";;;AAAA,oGAAoG;AACpG,qEAAqE;AACrE,yDAAwD;AAE3C,QAAA,iBAAiB,GAAG,IAAA,qCAAkB,EAAC;IAClD,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,aAAa;IAC1B,WAAW,EAAE,mDAAmD;IAChE,UAAU,EAAE;QACV,WAAW,EACT,qKAAqK;KACxK;IACD,SAAS,EAAE,iBAAiB;IAC5B,UAAU,EAAE;QACV,OAAO,EAAE,0BAA0B;QACnC,UAAU,EAAE,SAAS;QACrB,IAAI,EAAE,iBAAiB;QACvB,MAAM,EAAE;YACN,EAAE,EAAE,YAAY;YAChB,KAAK,EAAE,oDAAoD;YAC3D,OAAO,EAAE,0BAA0B;YACnC,EAAE,EAAE,IAAI;YACR,MAAM,EAAE;gBACN,EAAE,EAAE,WAAW;gBACf,IAAI,EAAE,YAAY;gBAClB,KAAK,EAAE,kBAAkB;gBACzB,OAAO,EAAE,KAAK;gBACd,SAAS,EAAE,IAAI;gBACf,OAAO,EAAE,0BAA0B;gBACnC,GAAG,EAAE,qDAAqD;gBAC1D,MAAM,EAAE,IAAI;aACb;YACD,IAAI,EAAE;gBACJ,EAAE,EAAE,SAAS;gBACb,KAAK,EAAE,wBAAwB;gBAC/B,MAAM,EAAE,MAAM;gBACd,KAAK,EAAE,CAAC;gBACR,OAAO,EAAE,0BAA0B;gBACnC,GAAG,EAAE,oFAAoF;gBACzF,KAAK,EAAE;oBACL,EAAE,EAAE,UAAU;oBACd,IAAI,EAAE,kBAAkB;oBACxB,SAAS,EAAE,CAAC;oBACZ,OAAO,EAAE,0BAA0B;oBACnC,GAAG,EAAE,2DAA2D;iBACjE;aACF;SACF;KACF;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const newPostTrigger: import("@agnocon/pieces-framework").ITrigger<import("@agnocon/piece-types").TriggerStrategy.WEBHOOK, import("@agnocon/pieces-framework").SecretTextProperty<true>, {}> | import("@agnocon/pieces-framework").ITrigger<import("@agnocon/piece-types").TriggerStrategy.POLLING, import("@agnocon/pieces-framework").SecretTextProperty<true>, {}> | import("@agnocon/pieces-framework").ITrigger<import("@agnocon/piece-types").TriggerStrategy.MANUAL, import("@agnocon/pieces-framework").SecretTextProperty<true>, {}> | import("@agnocon/pieces-framework").ITrigger<import("@agnocon/piece-types").TriggerStrategy.APP_WEBHOOK, import("@agnocon/pieces-framework").SecretTextProperty<true>, {}>;
|
|
2
|
+
//# sourceMappingURL=new-post.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"new-post.d.ts","sourceRoot":"","sources":["../../../src/lib/triggers/new-post.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,cAAc,sqBAiDzB,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.newPostTrigger = void 0;
|
|
4
|
+
// Vendored from Activepieces packages/pieces/community/canny/src/lib/triggers/new-post.ts (MIT).
|
|
5
|
+
// Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
|
|
6
|
+
const register_trigger_1 = require("./register-trigger");
|
|
7
|
+
exports.newPostTrigger = (0, register_trigger_1.createCannyTrigger)({
|
|
8
|
+
name: 'new_post',
|
|
9
|
+
displayName: 'New Post',
|
|
10
|
+
description: 'Triggers when a new post is created on a Canny board.',
|
|
11
|
+
aiMetadata: {
|
|
12
|
+
description: 'Fires when a new feedback post is created on any Canny board, delivering the post with its board and author. Use to react to incoming feature requests or feedback as they are submitted.',
|
|
13
|
+
},
|
|
14
|
+
eventType: 'post.created',
|
|
15
|
+
sampleData: {
|
|
16
|
+
created: '2026-04-06T10:35:59.055Z',
|
|
17
|
+
objectType: 'post',
|
|
18
|
+
type: 'post.created',
|
|
19
|
+
object: {
|
|
20
|
+
id: 'post123',
|
|
21
|
+
title: 'Sample feature request',
|
|
22
|
+
details: 'It would be great if the app had dark mode.',
|
|
23
|
+
status: 'open',
|
|
24
|
+
score: 1,
|
|
25
|
+
commentCount: 0,
|
|
26
|
+
created: '2026-04-06T10:35:58.342Z',
|
|
27
|
+
statusChangedAt: '2026-04-06T10:35:58.342Z',
|
|
28
|
+
url: 'https://yourcompany.canny.io/admin/board/feature-requests/p/sample-feature-request',
|
|
29
|
+
eta: null,
|
|
30
|
+
by: null,
|
|
31
|
+
category: null,
|
|
32
|
+
owner: null,
|
|
33
|
+
tags: [],
|
|
34
|
+
imageURLs: [],
|
|
35
|
+
customFields: [],
|
|
36
|
+
board: {
|
|
37
|
+
id: 'board123',
|
|
38
|
+
name: 'Feature Requests',
|
|
39
|
+
postCount: 1,
|
|
40
|
+
created: '2026-04-06T10:35:08.905Z',
|
|
41
|
+
url: 'https://yourcompany.canny.io/admin/board/feature-requests',
|
|
42
|
+
},
|
|
43
|
+
author: {
|
|
44
|
+
id: 'author123',
|
|
45
|
+
name: 'Jane Doe',
|
|
46
|
+
email: 'jane@example.com',
|
|
47
|
+
isAdmin: false,
|
|
48
|
+
avatarURL: null,
|
|
49
|
+
created: '2026-01-08T07:26:38.452Z',
|
|
50
|
+
url: 'https://yourcompany.canny.io/admin/users/jane-doe',
|
|
51
|
+
userID: null,
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
//# sourceMappingURL=new-post.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"new-post.js","sourceRoot":"","sources":["../../../src/lib/triggers/new-post.ts"],"names":[],"mappings":";;;AAAA,iGAAiG;AACjG,qEAAqE;AACrE,yDAAwD;AAE3C,QAAA,cAAc,GAAG,IAAA,qCAAkB,EAAC;IAC/C,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE,UAAU;IACvB,WAAW,EAAE,uDAAuD;IACpE,UAAU,EAAE;QACV,WAAW,EACT,2LAA2L;KAC9L;IACD,SAAS,EAAE,cAAc;IACzB,UAAU,EAAE;QACV,OAAO,EAAE,0BAA0B;QACnC,UAAU,EAAE,MAAM;QAClB,IAAI,EAAE,cAAc;QACpB,MAAM,EAAE;YACN,EAAE,EAAE,SAAS;YACb,KAAK,EAAE,wBAAwB;YAC/B,OAAO,EAAE,6CAA6C;YACtD,MAAM,EAAE,MAAM;YACd,KAAK,EAAE,CAAC;YACR,YAAY,EAAE,CAAC;YACf,OAAO,EAAE,0BAA0B;YACnC,eAAe,EAAE,0BAA0B;YAC3C,GAAG,EAAE,oFAAoF;YACzF,GAAG,EAAE,IAAI;YACT,EAAE,EAAE,IAAI;YACR,QAAQ,EAAE,IAAI;YACd,KAAK,EAAE,IAAI;YACX,IAAI,EAAE,EAAE;YACR,SAAS,EAAE,EAAE;YACb,YAAY,EAAE,EAAE;YAChB,KAAK,EAAE;gBACL,EAAE,EAAE,UAAU;gBACd,IAAI,EAAE,kBAAkB;gBACxB,SAAS,EAAE,CAAC;gBACZ,OAAO,EAAE,0BAA0B;gBACnC,GAAG,EAAE,2DAA2D;aACjE;YACD,MAAM,EAAE;gBACN,EAAE,EAAE,WAAW;gBACf,IAAI,EAAE,UAAU;gBAChB,KAAK,EAAE,kBAAkB;gBACzB,OAAO,EAAE,KAAK;gBACd,SAAS,EAAE,IAAI;gBACf,OAAO,EAAE,0BAA0B;gBACnC,GAAG,EAAE,mDAAmD;gBACxD,MAAM,EAAE,IAAI;aACb;SACF;KACF;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const newVoteTrigger: import("@agnocon/pieces-framework").ITrigger<import("@agnocon/piece-types").TriggerStrategy.WEBHOOK, import("@agnocon/pieces-framework").SecretTextProperty<true>, {}> | import("@agnocon/pieces-framework").ITrigger<import("@agnocon/piece-types").TriggerStrategy.POLLING, import("@agnocon/pieces-framework").SecretTextProperty<true>, {}> | import("@agnocon/pieces-framework").ITrigger<import("@agnocon/piece-types").TriggerStrategy.MANUAL, import("@agnocon/pieces-framework").SecretTextProperty<true>, {}> | import("@agnocon/pieces-framework").ITrigger<import("@agnocon/piece-types").TriggerStrategy.APP_WEBHOOK, import("@agnocon/pieces-framework").SecretTextProperty<true>, {}>;
|
|
2
|
+
//# sourceMappingURL=new-vote.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"new-vote.d.ts","sourceRoot":"","sources":["../../../src/lib/triggers/new-vote.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,cAAc,sqBAyDzB,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.newVoteTrigger = void 0;
|
|
4
|
+
// Vendored from Activepieces packages/pieces/community/canny/src/lib/triggers/new-vote.ts (MIT).
|
|
5
|
+
// Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
|
|
6
|
+
const register_trigger_1 = require("./register-trigger");
|
|
7
|
+
exports.newVoteTrigger = (0, register_trigger_1.createCannyTrigger)({
|
|
8
|
+
name: 'new_vote',
|
|
9
|
+
displayName: 'New Vote',
|
|
10
|
+
description: 'Triggers when a user votes on a post.',
|
|
11
|
+
aiMetadata: {
|
|
12
|
+
description: 'Fires when a user casts a vote on a Canny post, delivering the vote with its voter and the parent post. Use to react to changes in demand or support for feedback.',
|
|
13
|
+
},
|
|
14
|
+
eventType: 'vote.created',
|
|
15
|
+
sampleData: {
|
|
16
|
+
created: '2026-04-06T10:47:47.056Z',
|
|
17
|
+
objectType: 'vote',
|
|
18
|
+
type: 'vote.created',
|
|
19
|
+
object: {
|
|
20
|
+
id: 'vote123',
|
|
21
|
+
created: '2026-04-06T10:47:46.858Z',
|
|
22
|
+
score: 1,
|
|
23
|
+
votePriority: 'No priority',
|
|
24
|
+
by: null,
|
|
25
|
+
voter: {
|
|
26
|
+
id: 'user123',
|
|
27
|
+
name: 'Jane Doe',
|
|
28
|
+
email: 'jane@example.com',
|
|
29
|
+
isAdmin: false,
|
|
30
|
+
avatarURL: null,
|
|
31
|
+
created: '2026-01-08T07:26:38.452Z',
|
|
32
|
+
url: 'https://yourcompany.canny.io/admin/users/jane-doe',
|
|
33
|
+
userID: null,
|
|
34
|
+
},
|
|
35
|
+
post: {
|
|
36
|
+
id: 'post123',
|
|
37
|
+
title: 'Sample feature request',
|
|
38
|
+
details: 'It would be great if the app had dark mode.',
|
|
39
|
+
status: 'open',
|
|
40
|
+
score: 1,
|
|
41
|
+
created: '2026-04-06T10:35:58.342Z',
|
|
42
|
+
url: 'https://yourcompany.canny.io/admin/board/feature-requests/p/sample-feature-request',
|
|
43
|
+
board: {
|
|
44
|
+
id: 'board123',
|
|
45
|
+
name: 'Feature Requests',
|
|
46
|
+
postCount: 1,
|
|
47
|
+
created: '2026-04-06T10:35:08.905Z',
|
|
48
|
+
url: 'https://yourcompany.canny.io/admin/board/feature-requests',
|
|
49
|
+
},
|
|
50
|
+
author: {
|
|
51
|
+
id: 'author123',
|
|
52
|
+
name: 'John Smith',
|
|
53
|
+
email: 'john@example.com',
|
|
54
|
+
isAdmin: false,
|
|
55
|
+
avatarURL: null,
|
|
56
|
+
created: '2026-01-08T07:26:38.452Z',
|
|
57
|
+
url: 'https://yourcompany.canny.io/admin/users/john-smith',
|
|
58
|
+
userID: null,
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
//# sourceMappingURL=new-vote.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"new-vote.js","sourceRoot":"","sources":["../../../src/lib/triggers/new-vote.ts"],"names":[],"mappings":";;;AAAA,iGAAiG;AACjG,qEAAqE;AACrE,yDAAwD;AAE3C,QAAA,cAAc,GAAG,IAAA,qCAAkB,EAAC;IAC/C,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE,UAAU;IACvB,WAAW,EAAE,uCAAuC;IACpD,UAAU,EAAE;QACV,WAAW,EACT,oKAAoK;KACvK;IACD,SAAS,EAAE,cAAc;IACzB,UAAU,EAAE;QACV,OAAO,EAAE,0BAA0B;QACnC,UAAU,EAAE,MAAM;QAClB,IAAI,EAAE,cAAc;QACpB,MAAM,EAAE;YACN,EAAE,EAAE,SAAS;YACb,OAAO,EAAE,0BAA0B;YACnC,KAAK,EAAE,CAAC;YACR,YAAY,EAAE,aAAa;YAC3B,EAAE,EAAE,IAAI;YACR,KAAK,EAAE;gBACL,EAAE,EAAE,SAAS;gBACb,IAAI,EAAE,UAAU;gBAChB,KAAK,EAAE,kBAAkB;gBACzB,OAAO,EAAE,KAAK;gBACd,SAAS,EAAE,IAAI;gBACf,OAAO,EAAE,0BAA0B;gBACnC,GAAG,EAAE,mDAAmD;gBACxD,MAAM,EAAE,IAAI;aACb;YACD,IAAI,EAAE;gBACJ,EAAE,EAAE,SAAS;gBACb,KAAK,EAAE,wBAAwB;gBAC/B,OAAO,EAAE,6CAA6C;gBACtD,MAAM,EAAE,MAAM;gBACd,KAAK,EAAE,CAAC;gBACR,OAAO,EAAE,0BAA0B;gBACnC,GAAG,EAAE,oFAAoF;gBACzF,KAAK,EAAE;oBACL,EAAE,EAAE,UAAU;oBACd,IAAI,EAAE,kBAAkB;oBACxB,SAAS,EAAE,CAAC;oBACZ,OAAO,EAAE,0BAA0B;oBACnC,GAAG,EAAE,2DAA2D;iBACjE;gBACD,MAAM,EAAE;oBACN,EAAE,EAAE,WAAW;oBACf,IAAI,EAAE,YAAY;oBAClB,KAAK,EAAE,kBAAkB;oBACzB,OAAO,EAAE,KAAK;oBACd,SAAS,EAAE,IAAI;oBACf,OAAO,EAAE,0BAA0B;oBACnC,GAAG,EAAE,qDAAqD;oBAC1D,MAAM,EAAE,IAAI;iBACb;aACF;SACF;KACF;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const postStatusChangedTrigger: import("@agnocon/pieces-framework").ITrigger<import("@agnocon/piece-types").TriggerStrategy.WEBHOOK, import("@agnocon/pieces-framework").SecretTextProperty<true>, {}> | import("@agnocon/pieces-framework").ITrigger<import("@agnocon/piece-types").TriggerStrategy.POLLING, import("@agnocon/pieces-framework").SecretTextProperty<true>, {}> | import("@agnocon/pieces-framework").ITrigger<import("@agnocon/piece-types").TriggerStrategy.MANUAL, import("@agnocon/pieces-framework").SecretTextProperty<true>, {}> | import("@agnocon/pieces-framework").ITrigger<import("@agnocon/piece-types").TriggerStrategy.APP_WEBHOOK, import("@agnocon/pieces-framework").SecretTextProperty<true>, {}>;
|
|
2
|
+
//# sourceMappingURL=post-status-changed.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"post-status-changed.d.ts","sourceRoot":"","sources":["../../../src/lib/triggers/post-status-changed.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,wBAAwB,sqBAiDnC,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.postStatusChangedTrigger = void 0;
|
|
4
|
+
// Vendored from Activepieces packages/pieces/community/canny/src/lib/triggers/post-status-changed.ts (MIT).
|
|
5
|
+
// Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
|
|
6
|
+
const register_trigger_1 = require("./register-trigger");
|
|
7
|
+
exports.postStatusChangedTrigger = (0, register_trigger_1.createCannyTrigger)({
|
|
8
|
+
name: 'post_status_changed',
|
|
9
|
+
displayName: 'Post Status Changed',
|
|
10
|
+
description: "Triggers when a post's status is changed (e.g. open → in progress → complete).",
|
|
11
|
+
aiMetadata: {
|
|
12
|
+
description: 'Fires when a Canny post moves to a different status (for example open to in progress to complete), delivering the post in its new state. Use to react to changes in how a feature request is progressing.',
|
|
13
|
+
},
|
|
14
|
+
eventType: 'post.status_changed',
|
|
15
|
+
sampleData: {
|
|
16
|
+
created: '2026-04-06T11:00:00.000Z',
|
|
17
|
+
objectType: 'post',
|
|
18
|
+
type: 'post.status_changed',
|
|
19
|
+
object: {
|
|
20
|
+
id: 'post123',
|
|
21
|
+
title: 'Sample feature request',
|
|
22
|
+
details: 'It would be great if the app had dark mode.',
|
|
23
|
+
status: 'in progress',
|
|
24
|
+
score: 5,
|
|
25
|
+
commentCount: 2,
|
|
26
|
+
created: '2026-04-06T10:35:58.342Z',
|
|
27
|
+
statusChangedAt: '2026-04-06T11:00:00.000Z',
|
|
28
|
+
url: 'https://yourcompany.canny.io/admin/board/feature-requests/p/sample-feature-request',
|
|
29
|
+
eta: null,
|
|
30
|
+
by: null,
|
|
31
|
+
category: null,
|
|
32
|
+
owner: null,
|
|
33
|
+
tags: [],
|
|
34
|
+
imageURLs: [],
|
|
35
|
+
customFields: [],
|
|
36
|
+
board: {
|
|
37
|
+
id: 'board123',
|
|
38
|
+
name: 'Feature Requests',
|
|
39
|
+
postCount: 5,
|
|
40
|
+
created: '2026-04-06T10:35:08.905Z',
|
|
41
|
+
url: 'https://yourcompany.canny.io/admin/board/feature-requests',
|
|
42
|
+
},
|
|
43
|
+
author: {
|
|
44
|
+
id: 'author123',
|
|
45
|
+
name: 'Jane Doe',
|
|
46
|
+
email: 'jane@example.com',
|
|
47
|
+
isAdmin: false,
|
|
48
|
+
avatarURL: null,
|
|
49
|
+
created: '2026-01-08T07:26:38.452Z',
|
|
50
|
+
url: 'https://yourcompany.canny.io/admin/users/jane-doe',
|
|
51
|
+
userID: null,
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
//# sourceMappingURL=post-status-changed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"post-status-changed.js","sourceRoot":"","sources":["../../../src/lib/triggers/post-status-changed.ts"],"names":[],"mappings":";;;AAAA,4GAA4G;AAC5G,qEAAqE;AACrE,yDAAwD;AAE3C,QAAA,wBAAwB,GAAG,IAAA,qCAAkB,EAAC;IACzD,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,qBAAqB;IAClC,WAAW,EAAE,gFAAgF;IAC7F,UAAU,EAAE;QACV,WAAW,EACT,2MAA2M;KAC9M;IACD,SAAS,EAAE,qBAAqB;IAChC,UAAU,EAAE;QACV,OAAO,EAAE,0BAA0B;QACnC,UAAU,EAAE,MAAM;QAClB,IAAI,EAAE,qBAAqB;QAC3B,MAAM,EAAE;YACN,EAAE,EAAE,SAAS;YACb,KAAK,EAAE,wBAAwB;YAC/B,OAAO,EAAE,6CAA6C;YACtD,MAAM,EAAE,aAAa;YACrB,KAAK,EAAE,CAAC;YACR,YAAY,EAAE,CAAC;YACf,OAAO,EAAE,0BAA0B;YACnC,eAAe,EAAE,0BAA0B;YAC3C,GAAG,EAAE,oFAAoF;YACzF,GAAG,EAAE,IAAI;YACT,EAAE,EAAE,IAAI;YACR,QAAQ,EAAE,IAAI;YACd,KAAK,EAAE,IAAI;YACX,IAAI,EAAE,EAAE;YACR,SAAS,EAAE,EAAE;YACb,YAAY,EAAE,EAAE;YAChB,KAAK,EAAE;gBACL,EAAE,EAAE,UAAU;gBACd,IAAI,EAAE,kBAAkB;gBACxB,SAAS,EAAE,CAAC;gBACZ,OAAO,EAAE,0BAA0B;gBACnC,GAAG,EAAE,2DAA2D;aACjE;YACD,MAAM,EAAE;gBACN,EAAE,EAAE,WAAW;gBACf,IAAI,EAAE,UAAU;gBAChB,KAAK,EAAE,kBAAkB;gBACzB,OAAO,EAAE,KAAK;gBACd,SAAS,EAAE,IAAI;gBACf,OAAO,EAAE,0BAA0B;gBACnC,GAAG,EAAE,mDAAmD;gBACxD,MAAM,EAAE,IAAI;aACb;SACF;KACF;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TriggerStrategy } from '@agnocon/pieces-framework';
|
|
2
|
+
export type CannyEventType = 'post.created' | 'post.status_changed' | 'comment.created' | 'vote.created';
|
|
3
|
+
export declare function createCannyTrigger({ name, displayName, description, aiMetadata, eventType, sampleData, }: {
|
|
4
|
+
name: string;
|
|
5
|
+
displayName: string;
|
|
6
|
+
description: string;
|
|
7
|
+
aiMetadata: {
|
|
8
|
+
description: string;
|
|
9
|
+
};
|
|
10
|
+
eventType: CannyEventType;
|
|
11
|
+
sampleData: unknown;
|
|
12
|
+
}): import("@agnocon/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@agnocon/pieces-framework").SecretTextProperty<true>, {}> | import("@agnocon/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@agnocon/pieces-framework").SecretTextProperty<true>, {}> | import("@agnocon/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@agnocon/pieces-framework").SecretTextProperty<true>, {}> | import("@agnocon/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@agnocon/pieces-framework").SecretTextProperty<true>, {}>;
|
|
13
|
+
//# sourceMappingURL=register-trigger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-trigger.d.ts","sourceRoot":"","sources":["../../../src/lib/triggers/register-trigger.ts"],"names":[],"mappings":"AAEA,OAAO,EAAiB,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAK3E,MAAM,MAAM,cAAc,GACtB,cAAc,GACd,qBAAqB,GACrB,iBAAiB,GACjB,cAAc,CAAC;AAEnB,wBAAgB,kBAAkB,CAAC,EACjC,IAAI,EACJ,WAAW,EACX,WAAW,EACX,UAAU,EACV,SAAS,EACT,UAAU,GACX,EAAE;IACD,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC;IACpC,SAAS,EAAE,cAAc,CAAC;IAC1B,UAAU,EAAE,OAAO,CAAC;CACrB,4iBAwBA"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createCannyTrigger = createCannyTrigger;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
// Vendored from Activepieces packages/pieces/community/canny/src/lib/triggers/register-trigger.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_framework_2 = require("@agnocon/pieces-framework");
|
|
9
|
+
const auth_1 = require("../auth");
|
|
10
|
+
function createCannyTrigger({ name, displayName, description, aiMetadata, eventType, sampleData, }) {
|
|
11
|
+
return (0, pieces_framework_1.createTrigger)({
|
|
12
|
+
auth: auth_1.cannyAuth,
|
|
13
|
+
name,
|
|
14
|
+
displayName,
|
|
15
|
+
description,
|
|
16
|
+
aiMetadata,
|
|
17
|
+
props: {},
|
|
18
|
+
sampleData,
|
|
19
|
+
type: pieces_framework_1.TriggerStrategy.WEBHOOK,
|
|
20
|
+
handshakeConfiguration: { strategy: pieces_framework_2.WebhookHandshakeStrategy.NONE },
|
|
21
|
+
onEnable(_context) {
|
|
22
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
// Canny webhooks must be configured manually in the Canny dashboard.
|
|
24
|
+
// Point the webhook URL to this trigger's webhook URL.
|
|
25
|
+
});
|
|
26
|
+
},
|
|
27
|
+
onDisable(_context) {
|
|
28
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
29
|
+
// Nothing to clean up — webhooks are managed manually in Canny.
|
|
30
|
+
});
|
|
31
|
+
},
|
|
32
|
+
run(context) {
|
|
33
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
const payload = context.payload.body;
|
|
35
|
+
if ((payload === null || payload === void 0 ? void 0 : payload.type) !== eventType)
|
|
36
|
+
return [];
|
|
37
|
+
return [payload];
|
|
38
|
+
});
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=register-trigger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-trigger.js","sourceRoot":"","sources":["../../../src/lib/triggers/register-trigger.ts"],"names":[],"mappings":";;AAaA,gDAsCC;;AAnDD,yGAAyG;AACzG,qEAAqE;AACrE,gEAA2E;AAC3E,gEAAqE;AAErE,kCAAoC;AAQpC,SAAgB,kBAAkB,CAAC,EACjC,IAAI,EACJ,WAAW,EACX,WAAW,EACX,UAAU,EACV,SAAS,EACT,UAAU,GAQX;IACC,OAAO,IAAA,gCAAa,EAAC;QACnB,IAAI,EAAE,gBAAS;QACf,IAAI;QACJ,WAAW;QACX,WAAW;QACX,UAAU;QACV,KAAK,EAAE,EAAE;QACT,UAAU;QACV,IAAI,EAAE,kCAAe,CAAC,OAAO;QAC7B,sBAAsB,EAAE,EAAE,QAAQ,EAAE,2CAAwB,CAAC,IAAI,EAAE;QAC7D,QAAQ,CAAC,QAAQ;;gBACrB,qEAAqE;gBACrE,uDAAuD;YACzD,CAAC;SAAA;QACK,SAAS,CAAC,QAAQ;;gBACtB,gEAAgE;YAClE,CAAC;SAAA;QACK,GAAG,CAAC,OAAO;;gBACf,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,IAAyB,CAAC;gBAC1D,IAAI,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,MAAK,SAAS;oBAAE,OAAO,EAAE,CAAC;gBAC3C,OAAO,CAAC,OAAO,CAAC,CAAC;YACnB,CAAC;SAAA;KACF,CAAC,CAAC;AACL,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@agnocon/piece-canny",
|
|
3
|
+
"version": "0.1.6",
|
|
4
|
+
"description": "AgnoCon canny connector",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"require": "./dist/index.js",
|
|
11
|
+
"default": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist",
|
|
16
|
+
"src",
|
|
17
|
+
"LICENSE.MIT-AP"
|
|
18
|
+
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "tsc -p tsconfig.json",
|
|
21
|
+
"vendor": "node ../scripts/vendor-ap.mjs piece-canny"
|
|
22
|
+
},
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@agnocon/core-utils": "0.2.0",
|
|
25
|
+
"@agnocon/piece-types": "0.3.1",
|
|
26
|
+
"@agnocon/pieces-common": "0.12.8",
|
|
27
|
+
"@agnocon/pieces-framework": "0.36.0",
|
|
28
|
+
"tslib": "2.6.2"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@types/node": "20.17.6",
|
|
32
|
+
"typescript": "5.5.4"
|
|
33
|
+
},
|
|
34
|
+
"license": "MIT",
|
|
35
|
+
"agnocon": {
|
|
36
|
+
"originVersion": "0.1.6"
|
|
37
|
+
},
|
|
38
|
+
"publishConfig": {
|
|
39
|
+
"access": "restricted",
|
|
40
|
+
"tag": "latest"
|
|
41
|
+
},
|
|
42
|
+
"keywords": [
|
|
43
|
+
"agnocon",
|
|
44
|
+
"connector"
|
|
45
|
+
]
|
|
46
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { createPiece } from '@agnocon/pieces-framework';
|
|
2
|
+
import { PieceCategory } from '@agnocon/pieces-framework';
|
|
3
|
+
|
|
4
|
+
import { cannyAuth } from './lib/auth';
|
|
5
|
+
import { createPostAction } from './lib/actions/create-post';
|
|
6
|
+
import { retrievePostAction } from './lib/actions/retrieve-post';
|
|
7
|
+
import { listPostsAction } from './lib/actions/list-posts';
|
|
8
|
+
import { createVoteAction } from './lib/actions/create-vote';
|
|
9
|
+
import { deleteVoteAction } from './lib/actions/delete-vote';
|
|
10
|
+
import { newPostTrigger } from './lib/triggers/new-post';
|
|
11
|
+
import { postStatusChangedTrigger } from './lib/triggers/post-status-changed';
|
|
12
|
+
import { newCommentTrigger } from './lib/triggers/new-comment';
|
|
13
|
+
import { newVoteTrigger } from './lib/triggers/new-vote';
|
|
14
|
+
|
|
15
|
+
export const canny = createPiece({
|
|
16
|
+
displayName: 'Canny',
|
|
17
|
+
description:
|
|
18
|
+
'Product feedback management platform. Collect, organize, and prioritize feature requests from your users.',
|
|
19
|
+
auth: cannyAuth,
|
|
20
|
+
minimumSupportedRelease: '0.36.1',
|
|
21
|
+
logoUrl: 'https://cdn.activepieces.com/pieces/canny.png',
|
|
22
|
+
authors: ['Harmatta', 'sanket-a11y'],
|
|
23
|
+
categories: [PieceCategory.PRODUCTIVITY],
|
|
24
|
+
actions: [
|
|
25
|
+
createPostAction,
|
|
26
|
+
retrievePostAction,
|
|
27
|
+
listPostsAction,
|
|
28
|
+
createVoteAction,
|
|
29
|
+
deleteVoteAction,
|
|
30
|
+
// createCustomApiCallAction({
|
|
31
|
+
// baseUrl: () => CANNY_API_BASE,
|
|
32
|
+
// auth: cannyAuth,
|
|
33
|
+
// authMapping: async (_auth) => ({
|
|
34
|
+
// 'Content-Type': 'application/json',
|
|
35
|
+
// }),
|
|
36
|
+
// }),
|
|
37
|
+
],
|
|
38
|
+
triggers: [newPostTrigger, postStatusChangedTrigger, newCommentTrigger, newVoteTrigger],
|
|
39
|
+
});
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { createAction, Property } from '@agnocon/pieces-framework';
|
|
2
|
+
|
|
3
|
+
import { cannyAuth } from '../auth';
|
|
4
|
+
import { boardIdProp } from '../common/props';
|
|
5
|
+
import { cannyRequest, cleanBody } from '../common/client';
|
|
6
|
+
|
|
7
|
+
export const createPostAction = createAction({
|
|
8
|
+
auth: cannyAuth,
|
|
9
|
+
name: 'create_post',
|
|
10
|
+
displayName: 'Create Post',
|
|
11
|
+
description: 'Creates a new post on a Canny board.',
|
|
12
|
+
audience: 'both',
|
|
13
|
+
aiMetadata: {
|
|
14
|
+
description:
|
|
15
|
+
'Creates a new feedback post (feature request, bug, etc.) on a Canny board. Use to submit feedback captured elsewhere into Canny. Requires a board ID, an author Canny user ID, a title, and details; creates a distinct post on each call (not idempotent).',
|
|
16
|
+
idempotent: false,
|
|
17
|
+
},
|
|
18
|
+
props: {
|
|
19
|
+
boardID: boardIdProp,
|
|
20
|
+
authorID: Property.ShortText({
|
|
21
|
+
displayName: 'Author ID',
|
|
22
|
+
description: 'The unique identifier of the post author (Canny user ID).',
|
|
23
|
+
required: true,
|
|
24
|
+
}),
|
|
25
|
+
title: Property.ShortText({
|
|
26
|
+
displayName: 'Title',
|
|
27
|
+
description: 'A brief title describing the post.',
|
|
28
|
+
required: true,
|
|
29
|
+
}),
|
|
30
|
+
details: Property.LongText({
|
|
31
|
+
displayName: 'Details',
|
|
32
|
+
description: 'The longer description of the post.',
|
|
33
|
+
required: true,
|
|
34
|
+
}),
|
|
35
|
+
byID: Property.ShortText({
|
|
36
|
+
displayName: 'By ID',
|
|
37
|
+
description: 'The unique identifier of the admin creating the post on behalf of the author.',
|
|
38
|
+
required: false,
|
|
39
|
+
}),
|
|
40
|
+
categoryID: Property.ShortText({
|
|
41
|
+
displayName: 'Category ID',
|
|
42
|
+
description: 'The unique identifier of the category to assign.',
|
|
43
|
+
required: false,
|
|
44
|
+
}),
|
|
45
|
+
ownerID: Property.ShortText({
|
|
46
|
+
displayName: 'Owner ID',
|
|
47
|
+
description: 'The unique identifier of the user responsible for completing the work.',
|
|
48
|
+
required: false,
|
|
49
|
+
}),
|
|
50
|
+
eta: Property.ShortText({
|
|
51
|
+
displayName: 'ETA',
|
|
52
|
+
description: 'The estimated delivery date in MM/YYYY format (e.g. "06/2026").',
|
|
53
|
+
required: false,
|
|
54
|
+
}),
|
|
55
|
+
etaPublic: Property.Checkbox({
|
|
56
|
+
displayName: 'ETA Public',
|
|
57
|
+
description: 'Whether the ETA should be visible to all users.',
|
|
58
|
+
required: false,
|
|
59
|
+
}),
|
|
60
|
+
customFields: Property.Object({
|
|
61
|
+
displayName: 'Custom Fields',
|
|
62
|
+
description: 'Custom fields as key-value pairs (keys max 30 chars, values max 200 chars).',
|
|
63
|
+
required: false,
|
|
64
|
+
}),
|
|
65
|
+
createdAt: Property.ShortText({
|
|
66
|
+
displayName: 'Created At',
|
|
67
|
+
description: 'Original creation date in ISO 8601 format, for migrating posts from another source.',
|
|
68
|
+
required: false,
|
|
69
|
+
}),
|
|
70
|
+
},
|
|
71
|
+
async run({ auth, propsValue }) {
|
|
72
|
+
return await cannyRequest({
|
|
73
|
+
apiKey: auth.secret_text,
|
|
74
|
+
path: '/posts/create',
|
|
75
|
+
body: cleanBody({
|
|
76
|
+
authorID: propsValue.authorID,
|
|
77
|
+
boardID: propsValue.boardID,
|
|
78
|
+
title: propsValue.title,
|
|
79
|
+
details: propsValue.details,
|
|
80
|
+
byID: propsValue.byID,
|
|
81
|
+
categoryID: propsValue.categoryID,
|
|
82
|
+
ownerID: propsValue.ownerID,
|
|
83
|
+
eta: propsValue.eta,
|
|
84
|
+
etaPublic: propsValue.etaPublic,
|
|
85
|
+
customFields: propsValue.customFields,
|
|
86
|
+
createdAt: propsValue.createdAt,
|
|
87
|
+
}),
|
|
88
|
+
});
|
|
89
|
+
},
|
|
90
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { createAction, Property } from '@agnocon/pieces-framework';
|
|
2
|
+
|
|
3
|
+
import { cannyAuth } from '../auth';
|
|
4
|
+
import { cannyRequest } from '../common/client';
|
|
5
|
+
|
|
6
|
+
export const createVoteAction = createAction({
|
|
7
|
+
auth: cannyAuth,
|
|
8
|
+
name: 'create_vote',
|
|
9
|
+
displayName: 'Create Vote',
|
|
10
|
+
description: 'Casts a vote on a post on behalf of a user.',
|
|
11
|
+
audience: 'both',
|
|
12
|
+
aiMetadata: {
|
|
13
|
+
description:
|
|
14
|
+
'Registers a vote on a Canny post on behalf of a specific user. Use to record support for a feature request when acting as that voter. Requires the post ID and the voter Canny user ID. Effectively idempotent: re-voting the same user on the same post does not add duplicate votes.',
|
|
15
|
+
idempotent: true,
|
|
16
|
+
},
|
|
17
|
+
props: {
|
|
18
|
+
postID: Property.ShortText({
|
|
19
|
+
displayName: 'Post ID',
|
|
20
|
+
description: 'The unique identifier of the post to vote on.',
|
|
21
|
+
required: true,
|
|
22
|
+
}),
|
|
23
|
+
voterID: Property.ShortText({
|
|
24
|
+
displayName: 'Voter ID',
|
|
25
|
+
description: 'The unique identifier of the voter (Canny user ID).',
|
|
26
|
+
required: true,
|
|
27
|
+
}),
|
|
28
|
+
},
|
|
29
|
+
async run({ auth, propsValue }) {
|
|
30
|
+
return await cannyRequest({
|
|
31
|
+
apiKey: auth.secret_text,
|
|
32
|
+
path: '/votes/create',
|
|
33
|
+
body: {
|
|
34
|
+
postID: propsValue.postID,
|
|
35
|
+
voterID: propsValue.voterID,
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
},
|
|
39
|
+
});
|