@prismatic-io/components-canny 0.0.0-stage → 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.
@@ -0,0 +1,3904 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
10
+ key = keys[i];
11
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
12
+ get: ((k) => from[k]).bind(null, key),
13
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
14
+ });
15
+ }
16
+ return to;
17
+ };
18
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
19
+ value: mod,
20
+ enumerable: true
21
+ }) : target, mod));
22
+ //#endregion
23
+ let _prismatic_io_spectral = require("@prismatic-io/spectral");
24
+ let _prismatic_io_spectral_http = require("@prismatic-io/spectral/http");
25
+ let node_crypto = require("node:crypto");
26
+ node_crypto = __toESM(node_crypto);
27
+ //#region src/util/clean.ts
28
+ const toOptionalString = (value) => value ? _prismatic_io_spectral.util.types.toString(value) : void 0;
29
+ const toOptionalNumber = (value) => value ? _prismatic_io_spectral.util.types.toNumber(value) : void 0;
30
+ const toOptionalObject = (value) => value ? _prismatic_io_spectral.util.types.toObject(value) : void 0;
31
+ const toObjectOrEmpty = (value) => value ? _prismatic_io_spectral.util.types.toObject(value) : {};
32
+ const LOOK_BACK_DATE_PATTERN = /^(\d{4})-(\d{2})-(\d{2})$/;
33
+ const lookBackDateClean = (value) => {
34
+ if (value === void 0 || value === null) return "";
35
+ const raw = typeof value === "string" ? value.trim() : String(value);
36
+ if (raw === "") return "";
37
+ const match = typeof value === "string" ? raw.match(LOOK_BACK_DATE_PATTERN) : null;
38
+ if (!match) throw new Error(`Look-back Date must be a date in YYYY-MM-DD format. Received: ${raw}`);
39
+ const [, yearStr, monthStr, dayStr] = match;
40
+ const year = Number(yearStr);
41
+ const month = Number(monthStr);
42
+ const day = Number(dayStr);
43
+ const parsed = new Date(Date.UTC(year, month - 1, day));
44
+ if (parsed.getUTCFullYear() !== year || parsed.getUTCMonth() !== month - 1 || parsed.getUTCDate() !== day) throw new Error(`Look-back Date must be a date in YYYY-MM-DD format. Received: ${raw}`);
45
+ if (parsed.getTime() > Date.now()) throw new Error(`Look-back Date cannot be a future date. Received: ${raw}`);
46
+ return parsed.toISOString();
47
+ };
48
+ //#endregion
49
+ //#region src/connections/index.ts
50
+ var connections_default = [(0, _prismatic_io_spectral.connection)({
51
+ key: "cannyApiKey",
52
+ display: {
53
+ label: "API Key",
54
+ description: "Authenticate using a Canny API key."
55
+ },
56
+ inputs: { apiKey: {
57
+ label: "API Key",
58
+ type: "password",
59
+ required: true,
60
+ shown: true,
61
+ comments: "The Canny API key. Generate one at Settings > API in the Canny admin panel."
62
+ } }
63
+ })];
64
+ //#endregion
65
+ //#region src/util/connection.ts
66
+ const validateConnection = (connection) => {
67
+ if (!connections_default.map((c) => c.key).includes(connection.key)) throw new _prismatic_io_spectral.ConnectionError(connection, `Unsupported connection ${connection.key}.`);
68
+ return _prismatic_io_spectral.util.types.toString(connection.fields.apiKey);
69
+ };
70
+ //#endregion
71
+ //#region src/util/pagination.ts
72
+ const paginateOffset = async (post, path, resourceKey, params, fetchAll) => {
73
+ if (!fetchAll) return post(path, params);
74
+ const allItems = [];
75
+ let hasMore = true;
76
+ let skipCount = 0;
77
+ while (hasMore) {
78
+ const page = await post(path, {
79
+ ...params,
80
+ skip: skipCount,
81
+ limit: 100
82
+ });
83
+ const items = page[resourceKey];
84
+ allItems.push(...items);
85
+ hasMore = page.hasMore;
86
+ skipCount += items.length;
87
+ }
88
+ return {
89
+ [resourceKey]: allItems,
90
+ hasMore: false
91
+ };
92
+ };
93
+ const paginateCursor = async (postV2, path, resourceKey, params, fetchAll) => {
94
+ if (!fetchAll) return postV2(path, params);
95
+ const allItems = [];
96
+ let hasNextPage = true;
97
+ let currentCursor;
98
+ while (hasNextPage) {
99
+ const page = await postV2(path, {
100
+ ...params,
101
+ cursor: currentCursor,
102
+ limit: 100
103
+ });
104
+ const items = page[resourceKey];
105
+ allItems.push(...items);
106
+ hasNextPage = page.hasNextPage;
107
+ currentCursor = page.cursor;
108
+ }
109
+ return {
110
+ [resourceKey]: allItems,
111
+ hasNextPage: false,
112
+ cursor: currentCursor ?? ""
113
+ };
114
+ };
115
+ //#endregion
116
+ //#region src/util/polling.ts
117
+ const collectPostChanges = (posts, since, options) => {
118
+ const { isInitialSync, showNewRecords, showUpdatedRecords } = options;
119
+ const { created, updated } = classifyPostsByPollDate(posts, since, isInitialSync);
120
+ return {
121
+ created: isInitialSync || showNewRecords ? created : [],
122
+ updated: isInitialSync || showUpdatedRecords ? updated : []
123
+ };
124
+ };
125
+ const resolvePostChanges = (data) => {
126
+ const changesObject = data ?? {
127
+ created: [],
128
+ updated: []
129
+ };
130
+ return [...(changesObject.created ?? []).map((record) => ({
131
+ changeType: "created",
132
+ record
133
+ })), ...(changesObject.updated ?? []).map((record) => ({
134
+ changeType: "updated",
135
+ record
136
+ }))];
137
+ };
138
+ const classifyPostsByPollDate = (posts, since, inclusive = false) => {
139
+ const sinceMs = new Date(since).getTime();
140
+ const isAfter = (ms) => !Number.isNaN(ms) && (inclusive ? ms >= sinceMs : ms > sinceMs);
141
+ const created = [];
142
+ const updated = [];
143
+ for (const post of posts) {
144
+ const createdMs = post.created ? new Date(post.created).getTime() : NaN;
145
+ const statusChangedMs = post.statusChangedAt ? new Date(post.statusChangedAt).getTime() : NaN;
146
+ const isNew = isAfter(createdMs);
147
+ const isUpdated = !isNew && isAfter(statusChangedMs);
148
+ if (isNew) created.push(post);
149
+ else if (isUpdated) updated.push(post);
150
+ }
151
+ return {
152
+ created,
153
+ updated
154
+ };
155
+ };
156
+ //#endregion
157
+ //#region src/util/sort.ts
158
+ const sortByLabel = (a, b) => (a.label ?? "") < (b.label ?? "") ? -1 : 1;
159
+ const toSortedPicklist = (items, getLabel, getKey) => items.map((item) => ({
160
+ label: getLabel(item),
161
+ key: getKey(item)
162
+ })).sort(sortByLabel);
163
+ //#endregion
164
+ //#region src/client.ts
165
+ const createClient = (connection, debug = false) => {
166
+ const apiKey = validateConnection(connection);
167
+ const httpClientV1 = (0, _prismatic_io_spectral_http.createClient)({
168
+ baseUrl: "https://canny.io/api/v1",
169
+ headers: { "Content-Type": "application/json" },
170
+ debug
171
+ });
172
+ const httpClientV2 = (0, _prismatic_io_spectral_http.createClient)({
173
+ baseUrl: "https://canny.io/api/v2",
174
+ headers: { "Content-Type": "application/json" },
175
+ debug
176
+ });
177
+ const post = async (path, body = {}) => {
178
+ const { data } = await httpClientV1.post(path, {
179
+ apiKey,
180
+ ...body
181
+ });
182
+ return data;
183
+ };
184
+ const postV2 = async (path, body = {}) => {
185
+ const { data } = await httpClientV2.post(path, {
186
+ apiKey,
187
+ ...body
188
+ });
189
+ return data;
190
+ };
191
+ return {
192
+ post,
193
+ postV2,
194
+ apiKey,
195
+ httpClient: httpClientV1
196
+ };
197
+ };
198
+ //#endregion
199
+ //#region src/examplePayloads/boards.ts
200
+ const retrieveBoardExamplePayload = { data: {
201
+ id: "553c3ef8b8cdcd1501ba1234",
202
+ created: "2017-07-15T22:11:00.000Z",
203
+ isPrivate: true,
204
+ name: "Feature Requests",
205
+ postCount: 123,
206
+ privateComments: false,
207
+ url: "https://your-company.canny.io/admin/board/feature-requests"
208
+ } };
209
+ const listBoardsExamplePayload = { data: { boards: [{
210
+ id: "553c3ef8b8cdcd1501ba1234",
211
+ created: "2026-04-15T22:51:00.517Z",
212
+ isPrivate: true,
213
+ name: "Feature Requests",
214
+ postCount: 123,
215
+ privateComments: false,
216
+ token: "11111111-2222-3333-4444-555555555555",
217
+ url: "https://your-company.canny.io/admin/board/feature-requests"
218
+ }, {
219
+ id: "553c3ef8b8cdcd1501ba1238",
220
+ created: "2026-04-15T22:51:00.517Z",
221
+ isPrivate: false,
222
+ name: "Bug Reports",
223
+ postCount: 42,
224
+ privateComments: true,
225
+ token: "66666666-7777-8888-9999-aaaaaaaaaaaa",
226
+ url: "https://your-company.canny.io/admin/board/bug-reports"
227
+ }] } };
228
+ //#endregion
229
+ //#region src/examplePayloads/categories.ts
230
+ const retrieveCategoryExamplePayload = { data: {
231
+ id: "553c3ef8b8cdcd1501ba12bb",
232
+ board: {
233
+ created: "2026-04-15T22:51:00.517Z",
234
+ id: "553c3ef8b8cdcd1501ba4400",
235
+ name: "Feature Requests",
236
+ postCount: 99,
237
+ url: "https://your-company.canny.io/admin/board/feature-requests"
238
+ },
239
+ created: "2026-04-15T22:51:00.517Z",
240
+ name: "Example Category Name",
241
+ parentID: "552c3ef8b8cdcd1501ba12bb",
242
+ postCount: 12,
243
+ url: "https://your-company.canny.io/admin/board/feature-requests?category=example-category-name"
244
+ } };
245
+ const listCategoriesExamplePayload = { data: {
246
+ categories: [{
247
+ id: "553c3ef8b8cdcd1501ba12bb",
248
+ board: {
249
+ created: "2026-04-15T22:51:00.517Z",
250
+ id: "553c3ef8b8cdcd1501ba4400",
251
+ name: "Feature Requests",
252
+ postCount: 99,
253
+ url: "https://your-company.canny.io/admin/board/feature-requests"
254
+ },
255
+ created: "2026-04-15T22:51:00.517Z",
256
+ name: "Example Category Name",
257
+ parentID: "552c3ef8b8cdcd1501ba12bb",
258
+ postCount: 12,
259
+ url: "https://your-company.canny.io/admin/board/feature-requests?category=example-category-name"
260
+ }],
261
+ hasMore: false
262
+ } };
263
+ const createCategoryExamplePayload = { data: { id: "553c3ef8b8cdcd1501baabcd" } };
264
+ const deleteCategoryExamplePayload = { data: "success" };
265
+ //#endregion
266
+ //#region src/examplePayloads/comments.ts
267
+ const retrieveCommentExamplePayload = { data: {
268
+ id: "553c3ef8b8cdcd1501ba1238",
269
+ author: {
270
+ id: "553c3ef8b8cdcd1501ba123a",
271
+ created: "2026-04-15T22:51:00.519Z",
272
+ email: "sally.doe@example.com",
273
+ isAdmin: false,
274
+ name: "Sally Doe",
275
+ url: "https://your-company.canny.io/admin/users/sally-doe",
276
+ userID: "1234"
277
+ },
278
+ board: {
279
+ created: "2026-04-15T22:51:00.519Z",
280
+ id: "553c3ef8b8cdcd1501ba1234",
281
+ name: "Feature Requests",
282
+ postCount: 123,
283
+ url: "https://your-company.canny.io/admin/board/feature-requests"
284
+ },
285
+ created: "2026-04-15T22:51:00.519Z",
286
+ imageURLs: ["https://canny.io/images/93fc5808937760b82c3dc00aa5cd86b8.png", "https://canny.io/images/316e5600645b81e4be287a52d506dbfd.jpg"],
287
+ internal: false,
288
+ likeCount: 2,
289
+ mentions: [],
290
+ parentID: "553c3ef8b8cdcd1501ba3333",
291
+ post: {
292
+ category: {
293
+ id: "553c3ef8b8cdcd1501ba2234",
294
+ name: "Dashboard",
295
+ postCount: 42,
296
+ url: "https://your-company.canny.io/admin/board/feature-requests?category=dashboard"
297
+ },
298
+ commentCount: 2,
299
+ eta: "February 2026",
300
+ id: "553c3ef8b8cdcd1501ba4444",
301
+ imageURLs: [],
302
+ jira: { linkedIssues: [{
303
+ id: "123",
304
+ key: "ID-123",
305
+ url: "https://your-company.atlassian.net/browse/ID-123"
306
+ }] },
307
+ linear: { linkedIssueIDs: ["ID-123", "ID-345"] },
308
+ score: 13,
309
+ status: "planned",
310
+ tags: [{
311
+ id: "553c3ef8b8cdcd1501ba3234",
312
+ name: "iOS",
313
+ postCount: 15,
314
+ url: "https://your-company.canny.io/admin/board/feature-requests?tags=ios"
315
+ }],
316
+ title: "post-title",
317
+ url: "https://your-company.canny.io/admin/board/feature-requests/p/post-title"
318
+ },
319
+ private: false,
320
+ reactions: { like: 2 },
321
+ status: null,
322
+ value: "Some cool comment"
323
+ } };
324
+ const listCommentsExamplePayload = { data: {
325
+ cursor: "eyJhZnRlciI6eyJfaWQiOiI1NTNjM2VmOGI4Y2RjZD...",
326
+ hasNextPage: true,
327
+ items: [{
328
+ id: "553c3ef8b8cdcd1501ba1238",
329
+ author: {
330
+ id: "553c3ef8b8cdcd1501ba123a",
331
+ created: "2026-04-15T22:51:00.520Z",
332
+ email: "sally.doe@example.com",
333
+ isAdmin: false,
334
+ name: "Sally Doe",
335
+ url: "https://your-company.canny.io/admin/users/sally-doe",
336
+ userID: "1234"
337
+ },
338
+ board: {
339
+ created: "2026-04-15T22:51:00.520Z",
340
+ id: "553c3ef8b8cdcd1501ba1234",
341
+ name: "Feature Requests",
342
+ postCount: 123,
343
+ url: "https://your-company.canny.io/admin/board/feature-requests"
344
+ },
345
+ created: "2026-04-15T22:51:00.520Z",
346
+ imageURLs: ["https://canny.io/images/93fc5808937760b82c3dc00aa5cd86b8.png", "https://canny.io/images/316e5600645b81e4be287a52d506dbfd.jpg"],
347
+ internal: false,
348
+ likeCount: 2,
349
+ mentions: [],
350
+ parentID: "553c3ef8b8cdcd1501ba3333",
351
+ post: {
352
+ category: {
353
+ id: "553c3ef8b8cdcd1501ba2234",
354
+ name: "Dashboard",
355
+ postCount: 42,
356
+ url: "https://your-company.canny.io/admin/board/feature-requests?category=dashboard"
357
+ },
358
+ commentCount: 2,
359
+ id: "553c3ef8b8cdcd1501ba4444",
360
+ imageURLs: [],
361
+ jira: { linkedIssues: [{
362
+ id: "123",
363
+ key: "ID-123",
364
+ url: "https://your-company.atlassian.net/browse/ID-123"
365
+ }] },
366
+ linear: { linkedIssueIDs: ["ID-123", "ID-345"] },
367
+ score: 13,
368
+ status: "planned",
369
+ tags: [{
370
+ id: "553c3ef8b8cdcd1501ba3234",
371
+ name: "iOS",
372
+ postCount: 15,
373
+ url: "https://your-company.canny.io/admin/board/feature-requests?tags=ios"
374
+ }],
375
+ title: "post-title",
376
+ url: "https://your-company.canny.io/admin/board/feature-requests/p/post-title"
377
+ },
378
+ private: false,
379
+ reactions: { like: 2 },
380
+ status: null,
381
+ value: "Some cool comment"
382
+ }]
383
+ } };
384
+ const createCommentExamplePayload = { data: { id: "553c3ef8b8cdcd1501ba2222" } };
385
+ const deleteCommentExamplePayload = { data: "success" };
386
+ //#endregion
387
+ //#region src/examplePayloads/companies.ts
388
+ const listCompaniesExamplePayload = { data: {
389
+ hasNextPage: true,
390
+ cursor: "NTUzYzNlZjhiOGNkY2QxNTAxYmExMjNhXzIwMjUtMDItMDRUMTY6NDA6MDcuNTQxWl8x",
391
+ companies: [{
392
+ id: "company1",
393
+ created: "2022-06-17T12:44:38.797Z",
394
+ customFields: {
395
+ number: 1,
396
+ bool: true,
397
+ string: "Enterprise"
398
+ },
399
+ domain: "example.com",
400
+ memberCount: 5,
401
+ monthlySpend: 100.23,
402
+ name: "company 1"
403
+ }]
404
+ } };
405
+ const updateCompanyExamplePayload = { data: { id: "553c3ef8b8cdcd1501ba1111" } };
406
+ const deleteCompanyExamplePayload = { data: "success" };
407
+ //#endregion
408
+ //#region src/examplePayloads/dataSources.ts
409
+ const selectBoardExamplePayload = { result: [{
410
+ key: "553c3ef8b8cdcd1501ba1234",
411
+ label: "Feature Requests"
412
+ }, {
413
+ key: "553c3ef8b8cdcd1501ba5678",
414
+ label: "Bug Reports"
415
+ }] };
416
+ const selectCategoryExamplePayload = { result: [{
417
+ key: "553c3ef8b8cdcd1501baabcd",
418
+ label: "UI Improvements"
419
+ }, {
420
+ key: "553c3ef8b8cdcd1501ba0000",
421
+ label: "Performance"
422
+ }] };
423
+ const selectTagExamplePayload = { result: [{
424
+ key: "553c3ef8b8cdcd1501ba4444",
425
+ label: "bug"
426
+ }, {
427
+ key: "553c3ef8b8cdcd1501ba5555",
428
+ label: "enhancement"
429
+ }] };
430
+ const selectCompanyExamplePayload = { result: [{
431
+ key: "553c3ef8b8cdcd1501ba1111",
432
+ label: "Acme Corp"
433
+ }, {
434
+ key: "553c3ef8b8cdcd1501ba2222",
435
+ label: "Globex Inc"
436
+ }] };
437
+ const selectUserExamplePayload = { result: [{
438
+ key: "553c3ef8b8cdcd1501ba9999",
439
+ label: "Jane Smith (jane@example.com)"
440
+ }, {
441
+ key: "553c3ef8b8cdcd1501ba8888",
442
+ label: "John Doe (john@example.com)"
443
+ }] };
444
+ const selectPostExamplePayload = { result: [{
445
+ key: "553c3ef8b8cdcd1501ba5678",
446
+ label: "Add dark mode support"
447
+ }, {
448
+ key: "553c3ef8b8cdcd1501ba6789",
449
+ label: "Improve search performance"
450
+ }] };
451
+ //#endregion
452
+ //#region src/examplePayloads/entries.ts
453
+ const listEntriesExamplePayload = { data: {
454
+ hasMore: false,
455
+ entries: [{
456
+ id: "553c3ef8b8cdcd1501ba123b",
457
+ created: "2026-04-15T22:51:00.518Z",
458
+ labels: [{
459
+ id: "553c3ef8b8cdcd1501ba8761",
460
+ created: "2026-04-15T22:51:00.518Z",
461
+ entryCount: 4,
462
+ name: "Feature",
463
+ url: "https://your-company.canny.io/admin/changelog?labels=feature"
464
+ }],
465
+ lastSaved: "2026-04-15T22:51:00.518Z",
466
+ markdownDetails: "# heading\n**bold**\n[link](https://canny.io)",
467
+ plaintextDetails: "heading\nbold\nlink",
468
+ posts: [{
469
+ category: {
470
+ id: "553c3ef8b8cdcd1501ba2234",
471
+ name: "Dashboard",
472
+ postCount: 42,
473
+ url: "https://your-company.canny.io/admin/board/feature-requests?category=dashboard"
474
+ },
475
+ commentCount: 2,
476
+ eta: "February 2026",
477
+ id: "553c3ef8b8cdcd1501ba4444",
478
+ imageURLs: [],
479
+ jira: { linkedIssues: [{
480
+ id: "123",
481
+ key: "ID-123",
482
+ url: "https://your-company.atlassian.net/browse/ID-123"
483
+ }] },
484
+ linear: { linkedIssueIDs: ["ID-123", "ID-345"] },
485
+ score: 13,
486
+ status: "planned",
487
+ tags: [{
488
+ id: "553c3ef8b8cdcd1501ba3234",
489
+ name: "iOS",
490
+ postCount: 15,
491
+ url: "https://your-company.canny.io/admin/board/feature-requests?tags=ios"
492
+ }],
493
+ title: "post-title",
494
+ url: "https://your-company.canny.io/admin/board/feature-requests/p/post-title"
495
+ }],
496
+ publishedAt: "2026-04-15T22:51:00.518Z",
497
+ reactions: { like: 2 },
498
+ scheduledFor: null,
499
+ status: "published",
500
+ title: "Entry title",
501
+ types: ["new", "improved"],
502
+ url: "https://your-company.canny.io/changelog/entry-title"
503
+ }]
504
+ } };
505
+ const createEntryExamplePayload = { data: { id: "553c3ef8b8cdcd1501ba8888" } };
506
+ //#endregion
507
+ //#region src/examplePayloads/posts.ts
508
+ const retrievePostExamplePayload = { data: {
509
+ id: "553c3ef8b8cdcd1501ba1238",
510
+ author: {
511
+ id: "553c3ef8b8cdcd1501ba123a",
512
+ created: "2026-04-16T01:07:22.189Z",
513
+ email: "sally.doe@example.com",
514
+ isAdmin: true,
515
+ name: "Sally Doe",
516
+ url: "https://your-company.canny.io/admin/users/sally-doe",
517
+ userID: "1234"
518
+ },
519
+ board: {
520
+ created: "2026-04-16T01:07:22.189Z",
521
+ id: "553c3ef8b8cdcd1501ba1234",
522
+ name: "Feature Requests",
523
+ postCount: 123,
524
+ url: "https://your-company.canny.io/admin/board/feature-requests"
525
+ },
526
+ by: {
527
+ id: "524c3ef8b8cdcd1501ba246b",
528
+ created: "2026-04-16T01:07:22.189Z",
529
+ email: "john.doe@example.com",
530
+ isAdmin: true,
531
+ name: "John Doe",
532
+ url: "https://your-company.canny.io/admin/users/john-doe",
533
+ userID: "5678"
534
+ },
535
+ category: {
536
+ id: "553c3ef8b8cdcd1501ba2234",
537
+ name: "Dashboard",
538
+ parentID: null,
539
+ postCount: 42,
540
+ url: "https://your-company.canny.io/admin/board/feature-requests?category=dashboard"
541
+ },
542
+ changeComment: {
543
+ value: "The status has changed!",
544
+ imageURLs: ["https://canny.io/images/93fc5808937760b82c3dc00aa5cd86b2.png"]
545
+ },
546
+ clickup: { linkedTasks: [{
547
+ id: "123",
548
+ linkID: "2334jdsai23234io22",
549
+ name: "Clickup issue",
550
+ postID: "553c3ef8b8cdcd1501ba1238",
551
+ status: "to do",
552
+ url: "https://app.clickup.com/t/123456"
553
+ }] },
554
+ commentCount: 10,
555
+ created: "2026-04-16T01:07:22.189Z",
556
+ customFields: [{
557
+ id: "553c3ef8b8cdcd1501ba2238",
558
+ name: "priority",
559
+ value: "high"
560
+ }],
561
+ details: "We'd love the ability to customize the color scheme to match our brand.",
562
+ eta: "February 2020",
563
+ imageURLs: ["https://canny.io/images/93fc5808937760b82c3dc00aa5cd86b8.png", "https://canny.io/images/316e5600645b81e4be287a52d506dbfd.jpg"],
564
+ jira: { linkedIssues: [{
565
+ id: "123",
566
+ key: "ID-123",
567
+ url: "https://your-company.atlassian.net/browse/ID-123"
568
+ }] },
569
+ linear: { linkedIssueIDs: ["ID-123", "ID-345"] },
570
+ mergeHistory: [{
571
+ created: "2026-04-16T01:07:22.189Z",
572
+ post: {
573
+ created: "2026-04-16T01:07:22.189Z",
574
+ details: "Awesome feature post details",
575
+ id: "553c3ef8b8cdcd1501ba6789",
576
+ imageURLs: [],
577
+ title: "Another awesome feature request"
578
+ }
579
+ }],
580
+ owner: {
581
+ id: "553c3ef8b8cdcd1501ba123a",
582
+ created: "2026-04-16T01:07:22.189Z",
583
+ email: "sally.doe@example.com",
584
+ isAdmin: true,
585
+ name: "Sally Doe",
586
+ url: "https://your-company.canny.io/admin/users/sally-doe",
587
+ userID: "1234"
588
+ },
589
+ roadmaps: [],
590
+ score: 72,
591
+ status: "in progress",
592
+ statusChangedAt: "2026-04-16T01:07:22.189Z",
593
+ tags: [{
594
+ id: "553c3ef8b8cdcd1501ba3234",
595
+ name: "iOS",
596
+ postCount: 15,
597
+ url: "https://your-company.canny.io/admin/board/feature-requests?tags=ios"
598
+ }],
599
+ title: "An awesome feature request",
600
+ url: "https://your-company.canny.io/admin/board/feature-requests/p/an-awesome-feature-request"
601
+ } };
602
+ const listPostsExamplePayload = { data: {
603
+ hasMore: true,
604
+ posts: [{
605
+ id: "553c3ef8b8cdcd1501ba1238",
606
+ author: {
607
+ id: "553c3ef8b8cdcd1501ba123a",
608
+ created: "2026-04-16T01:07:22.189Z",
609
+ email: "sally.doe@example.com",
610
+ isAdmin: false,
611
+ name: "Sally Doe",
612
+ url: "https://your-company.canny.io/admin/users/sally-doe",
613
+ userID: "1234"
614
+ },
615
+ board: {
616
+ created: "2026-04-16T01:07:22.189Z",
617
+ id: "553c3ef8b8cdcd1501ba1234",
618
+ name: "Feature Requests",
619
+ postCount: 123,
620
+ url: "https://your-company.canny.io/admin/board/feature-requests"
621
+ },
622
+ by: {
623
+ id: "524c3ef8b8cdcd1501ba246b",
624
+ created: "2026-04-16T01:07:22.189Z",
625
+ email: "john.doe@example.com",
626
+ isAdmin: true,
627
+ name: "John Doe",
628
+ url: "https://your-company.canny.io/admin/users/john-doe",
629
+ userID: "5678"
630
+ },
631
+ category: {
632
+ id: "553c3ef8b8cdcd1501ba2234",
633
+ name: "Dashboard",
634
+ parentID: null,
635
+ postCount: 42,
636
+ url: "https://your-company.canny.io/admin/board/feature-requests?category=dashboard"
637
+ },
638
+ clickup: { linkedTasks: [{
639
+ id: "123",
640
+ linkID: "2334jdsai23234io22",
641
+ name: "Clickup issue",
642
+ postID: "553c3ef8b8cdcd1501ba1238",
643
+ status: "to do",
644
+ url: "https://app.clickup.com/t/123456"
645
+ }] },
646
+ commentCount: 10,
647
+ created: "2026-04-16T01:07:22.189Z",
648
+ customFields: [{
649
+ id: "553c3ef8b8cdcd1501ba2238",
650
+ name: "priority",
651
+ value: "high"
652
+ }],
653
+ details: "We'd love the ability to customize the color scheme to match our brand.",
654
+ eta: "February 2020",
655
+ imageURLs: ["https://canny.io/images/93fc5808937760b82c3dc00aa5cd86b8.png", "https://canny.io/images/316e5600645b81e4be287a52d506dbfd.jpg"],
656
+ jira: { linkedIssues: [{
657
+ id: "123",
658
+ key: "ID-123",
659
+ url: "https://your-company.atlassian.net/browse/ID-123"
660
+ }] },
661
+ linear: { linkedIssueIDs: ["ID-123", "ID-345"] },
662
+ mergeHistory: [{
663
+ created: "2026-04-16T01:07:22.189Z",
664
+ post: {
665
+ created: "2026-04-16T01:07:22.189Z",
666
+ details: "Awesome feature post details",
667
+ id: "553c3ef8b8cdcd1501ba6789",
668
+ imageURLs: [],
669
+ title: "Another awesome feature request"
670
+ }
671
+ }],
672
+ owner: {
673
+ id: "553c3ef8b8cdcd1501ba123a",
674
+ created: "2026-04-16T01:07:22.189Z",
675
+ email: "sally.doe@example.com",
676
+ isAdmin: true,
677
+ name: "Sally Doe",
678
+ url: "https://your-company.canny.io/admin/users/sally-doe",
679
+ userID: "1234"
680
+ },
681
+ roadmaps: [],
682
+ score: 72,
683
+ status: "in progress",
684
+ statusChangedAt: "2026-04-16T01:07:22.189Z",
685
+ tags: [{
686
+ id: "553c3ef8b8cdcd1501ba3234",
687
+ name: "iOS",
688
+ postCount: 15,
689
+ url: "https://your-company.canny.io/admin/board/feature-requests?tags=ios"
690
+ }],
691
+ title: "An awesome feature request",
692
+ url: "https://your-company.canny.io/admin/board/feature-requests/p/post-title"
693
+ }]
694
+ } };
695
+ const createPostExamplePayload = { data: { id: "553c3ef8b8cdcd1501ba5678" } };
696
+ const updatePostExamplePayload = { data: "success" };
697
+ const deletePostExamplePayload = { data: "success" };
698
+ const changePostStatusExamplePayload = { data: {
699
+ id: "553c3ef8b8cdcd1501ba1238",
700
+ author: {
701
+ id: "553c3ef8b8cdcd1501ba123a",
702
+ created: "2017-07-15T22:11:00.000Z",
703
+ email: "sally.doe@example.com",
704
+ isAdmin: false,
705
+ name: "Sally Doe",
706
+ url: "https://your-company.canny.io/admin/users/sally-doe",
707
+ userID: "1234"
708
+ },
709
+ board: {
710
+ created: "2017-07-10T11:22:00.000Z",
711
+ id: "553c3ef8b8cdcd1501ba1234",
712
+ name: "Feature Requests",
713
+ postCount: 123,
714
+ url: "https://your-company.canny.io/admin/board/feature-requests"
715
+ },
716
+ by: {
717
+ id: "524c3ef8b8cdcd1501ba246b",
718
+ created: "2017-07-15T22:11:00.000Z",
719
+ email: "john.doe@example.com",
720
+ isAdmin: true,
721
+ name: "John Doe",
722
+ url: "https://your-company.canny.io/admin/users/john-doe",
723
+ userID: "5678"
724
+ },
725
+ category: {
726
+ id: "553c3ef8b8cdcd1501ba2234",
727
+ name: "Dashboard",
728
+ postCount: 42,
729
+ parentID: null,
730
+ url: "https://your-company.canny.io/admin/board/feature-requests?category=dashboard"
731
+ },
732
+ changeComment: {
733
+ value: "The status has changed!",
734
+ imageURLs: ["https://canny.io/images/93fc5808937760b82c3dc00aa5cd86b2.png"]
735
+ },
736
+ commentCount: 10,
737
+ created: "2017-08-22T13:32:00.000Z",
738
+ customFields: [{
739
+ id: "553c3ef8b8cdcd1501ba2238",
740
+ name: "priority",
741
+ value: "high"
742
+ }],
743
+ details: "We'd love the ability to customize the color scheme to match our brand.",
744
+ eta: "February 2020",
745
+ imageURLs: ["https://canny.io/images/93fc5808937760b82c3dc00aa5cd86b8.png", "https://canny.io/images/316e5600645b81e4be287a52d506dbfd.jpg"],
746
+ jira: { linkedIssues: [{
747
+ id: "123",
748
+ key: "ID-123",
749
+ url: "https://your-company.atlassian.net/browse/ID-123"
750
+ }] },
751
+ linear: { linkedIssueIDs: ["ID-123", "ID-345"] },
752
+ mergeHistory: [{
753
+ created: "2018-06-17T22:42:37.167Z",
754
+ post: {
755
+ created: "2018-06-17T22:42:00.797Z",
756
+ details: "Awesome feature post details",
757
+ id: "553c3ef8b8cdcd1501ba6789",
758
+ imageURLs: [],
759
+ title: "Another awesome feature request"
760
+ }
761
+ }],
762
+ owner: {
763
+ id: "553c3ef8b8cdcd1501ba123a",
764
+ created: "2017-07-15T22:11:00.000Z",
765
+ email: "sally.doe@example.com",
766
+ isAdmin: true,
767
+ name: "Sally Doe",
768
+ url: "https://your-company.canny.io/admin/users/sally-doe",
769
+ userID: "1234"
770
+ },
771
+ roadmaps: [],
772
+ score: 72,
773
+ status: "in progress",
774
+ statusChangedAt: "2017-08-24T23:22:00.000Z",
775
+ tags: [{
776
+ id: "553c3ef8b8cdcd1501ba3234",
777
+ name: "iOS",
778
+ postCount: 15,
779
+ url: "https://your-company.canny.io/admin/board/feature-requests?tags=ios"
780
+ }],
781
+ title: "An awesome feature request",
782
+ url: "https://your-company.canny.io/admin/board/feature-requests/p/an-awesome-feature-request"
783
+ } };
784
+ //#endregion
785
+ //#region src/examplePayloads/statusChanges.ts
786
+ const listStatusChangesExamplePayload = { data: {
787
+ cursor: "eyJhZnRlciI6eyJfaWQiOiI1NTNjM2VmOGI4Y2RjZD...",
788
+ hasNextPage: false,
789
+ items: [{
790
+ changeComment: {
791
+ imageURLs: ["https://canny.io/images/93fc5808937760b82c3dc00aa5cd86b8.png", "https://canny.io/images/316e5600645b81e4be287a52d506dbfd.jpg"],
792
+ value: "The status has changed!"
793
+ },
794
+ changer: {
795
+ id: "553c3ef8b8cdcd1501ba123a",
796
+ created: "2026-04-16T01:07:22.191Z",
797
+ email: "sally.doe@example.com",
798
+ isAdmin: false,
799
+ name: "Sally Doe",
800
+ url: "https://your-company.canny.io/admin/users/sally-doe",
801
+ userID: "1234"
802
+ },
803
+ created: "2026-04-16T01:07:22.191Z",
804
+ id: "553c3ef8b8cdcd1501ba12bb",
805
+ post: {
806
+ category: {
807
+ created: "2026-04-16T01:07:22.191Z",
808
+ id: "553c3ef8b8cdcd1501ba2234",
809
+ name: "Dashboard",
810
+ parentID: null,
811
+ postCount: 42,
812
+ url: "https://your-company.canny.io/admin/board/feature-requests?category=dashboard"
813
+ },
814
+ commentCount: 10,
815
+ details: "We'd love the ability to customize the color scheme to match our brand.",
816
+ id: "553c3ef8b8cdcd1501ba1238",
817
+ imageURLs: ["https://canny.io/images/93fc5808937760b82c3dc00aa5cd86b8.png", "https://canny.io/images/316e5600645b81e4be287a52d506dbfd.jpg"],
818
+ jira: { linkedIssues: [{
819
+ id: "123",
820
+ key: "ID-123",
821
+ url: "https://your-company.atlassian.net/browse/ID-123"
822
+ }] },
823
+ linear: { linkedIssueIDs: ["ID-123", "ID-345"] },
824
+ score: 72,
825
+ status: "in progress",
826
+ tags: [{
827
+ id: "553c3ef8b8cdcd1501ba3234",
828
+ name: "iOS",
829
+ postCount: 15,
830
+ url: "https://your-company.canny.io/admin/board/feature-requests?tags=ios"
831
+ }],
832
+ title: "An awesome feature request",
833
+ url: "https://your-company.canny.io/admin/board/feature-requests/p/an-awesome-feature-request"
834
+ },
835
+ status: "in progress"
836
+ }]
837
+ } };
838
+ //#endregion
839
+ //#region src/examplePayloads/tags.ts
840
+ const retrieveTagExamplePayload = { data: {
841
+ id: "553c3ef8b8cdcd1501ba12bb",
842
+ board: {
843
+ created: "2017-08-30T13:32:01.000Z",
844
+ id: "553c3ef8b8cdcd1501ba4400",
845
+ name: "Feature Requests",
846
+ postCount: 99,
847
+ url: "https://your-company.canny.io/admin/board/feature-requests"
848
+ },
849
+ created: "2017-08-30T13:32:01.000Z",
850
+ name: "Example Tag Name",
851
+ postCount: 12,
852
+ url: "https://your-company.canny.io/admin/board/feature-requests?tag=example-tag-name"
853
+ } };
854
+ const listTagsExamplePayload = { data: {
855
+ hasMore: false,
856
+ tags: [{
857
+ id: "553c3ef8b8cdcd1501ba12bb",
858
+ board: {
859
+ created: "2017-08-30T13:32:01.000Z",
860
+ id: "553c3ef8b8cdcd1501ba4400",
861
+ name: "Feature Requests",
862
+ postCount: 99,
863
+ url: "https://your-company.canny.io/admin/board/feature-requests"
864
+ },
865
+ created: "2017-08-30T13:32:01.000Z",
866
+ name: "Example Tag Name",
867
+ postCount: 12,
868
+ url: "https://your-company.canny.io/admin/board/feature-requests?tag=example-tag-name"
869
+ }]
870
+ } };
871
+ const createTagExamplePayload = { data: {
872
+ id: "553c3ef8b8cdcd1501ba12bb",
873
+ board: {
874
+ created: "2017-08-30T13:32:01.000Z",
875
+ id: "553c3ef8b8cdcd1501ba4400",
876
+ name: "Feature Requests",
877
+ postCount: 99,
878
+ url: "https://your-company.canny.io/admin/board/feature-requests"
879
+ },
880
+ created: "2017-08-30T13:32:01.000Z",
881
+ name: "Example Tag Name",
882
+ postCount: 12,
883
+ url: "https://your-company.canny.io/admin/board/feature-requests?tag=example-tag-name"
884
+ } };
885
+ //#endregion
886
+ //#region src/examplePayloads/triggers.ts
887
+ const exampleBoard = {
888
+ id: "553c3ef8b8cdcd1501ba1234",
889
+ created: "2026-04-16T01:07:22.189Z",
890
+ isPrivate: false,
891
+ name: "Feature Requests",
892
+ postCount: 123,
893
+ privateComments: false,
894
+ token: "b2b4d0d4-2b8e-4a1b-9c1d-6f0b3a5e7c21",
895
+ url: "https://your-company.canny.io/admin/board/feature-requests"
896
+ };
897
+ const exampleAuthor = {
898
+ id: "553c3ef8b8cdcd1501ba123a",
899
+ created: "2026-04-16T01:07:22.189Z",
900
+ email: "sally.doe@example.com",
901
+ isAdmin: false,
902
+ name: "Sally Doe",
903
+ url: "https://your-company.canny.io/admin/users/sally-doe",
904
+ userID: "1234"
905
+ };
906
+ const exampleAdmin = {
907
+ id: "524c3ef8b8cdcd1501ba246b",
908
+ created: "2026-04-16T01:07:22.189Z",
909
+ email: "john.doe@example.com",
910
+ isAdmin: true,
911
+ name: "John Doe",
912
+ url: "https://your-company.canny.io/admin/users/john-doe",
913
+ userID: "5678"
914
+ };
915
+ const exampleTriggerAttributes = {
916
+ headers: {},
917
+ queryParameters: {},
918
+ rawBody: { data: null },
919
+ pathFragment: "",
920
+ webhookUrls: {},
921
+ webhookApiKeys: {},
922
+ invokeUrl: "",
923
+ executionId: "RXhhbXBsZUV4ZWN1dGlvblJlc3VsdElk",
924
+ customer: {
925
+ id: "testCustomerId",
926
+ name: "Test Customer",
927
+ externalId: "testExternalId"
928
+ },
929
+ instance: {
930
+ id: "testInstanceId",
931
+ name: "Test Instance"
932
+ },
933
+ user: {
934
+ id: "testUserId",
935
+ email: "user@example.com",
936
+ name: "Test User",
937
+ externalId: "testUserExternalId"
938
+ },
939
+ integration: {
940
+ id: "testIntegrationId",
941
+ name: "Test Integration",
942
+ versionSequenceId: "1",
943
+ externalVersion: ""
944
+ },
945
+ flow: {
946
+ id: "testFlowId",
947
+ name: "Test Flow",
948
+ stableId: "testFlowStableId"
949
+ },
950
+ startedAt: "2026-04-16T00:00:00.000Z",
951
+ globalDebug: false
952
+ };
953
+ const pollChangesTriggerExamplePayload = {
954
+ payload: {
955
+ ...exampleTriggerAttributes,
956
+ body: { data: {
957
+ created: [{
958
+ id: "553c3ef8b8cdcd1501ba1238",
959
+ author: exampleAuthor,
960
+ board: exampleBoard,
961
+ by: null,
962
+ category: null,
963
+ commentCount: 0,
964
+ created: "2026-04-16T01:07:22.189Z",
965
+ customFields: { priority: "high" },
966
+ details: "We'd love the ability to customize the color scheme to match our brand.",
967
+ eta: "",
968
+ etaPublic: false,
969
+ imageURLs: ["https://canny.io/images/93fc5808937760b82c3dc00aa5cd86b8.png"],
970
+ jira: { linkedIssues: [] },
971
+ mergeHistory: [],
972
+ owner: null,
973
+ score: 3,
974
+ status: "open",
975
+ statusChangedAt: "2026-04-16T01:07:22.189Z",
976
+ tags: [],
977
+ title: "Support custom color schemes",
978
+ url: "https://your-company.canny.io/admin/board/feature-requests/p/support-custom-color-schemes"
979
+ }],
980
+ updated: [{
981
+ id: "553c3ef8b8cdcd1501ba6789",
982
+ author: exampleAuthor,
983
+ board: exampleBoard,
984
+ by: exampleAdmin,
985
+ category: null,
986
+ commentCount: 10,
987
+ created: "2026-02-02T18:41:05.412Z",
988
+ customFields: { priority: "medium" },
989
+ details: "Let admins export a board's posts as a CSV file.",
990
+ eta: "May 2026",
991
+ etaPublic: true,
992
+ imageURLs: [],
993
+ jira: { linkedIssues: [] },
994
+ mergeHistory: [],
995
+ owner: exampleAdmin,
996
+ score: 72,
997
+ status: "in progress",
998
+ statusChangedAt: "2026-04-16T01:04:11.007Z",
999
+ tags: [],
1000
+ title: "Export posts to CSV",
1001
+ url: "https://your-company.canny.io/admin/board/feature-requests/p/export-posts-to-csv"
1002
+ }]
1003
+ } }
1004
+ },
1005
+ polledNoChanges: false
1006
+ };
1007
+ const webhookExamplePayload = { payload: {
1008
+ ...exampleTriggerAttributes,
1009
+ headers: {
1010
+ "content-type": "application/json",
1011
+ "canny-timestamp": "1776301642189",
1012
+ "canny-nonce": "e4f1c0a8b7d24f3e9a5c6b8d0e2f4a19",
1013
+ "canny-signature": "j5Rr8gYb2mQ9xK1sV0dTn7WcZaHpLfEuIoNbXyMkQvA="
1014
+ },
1015
+ rawBody: {
1016
+ data: "{\"created\":\"2026-04-16T01:07:22.189Z\",\"object\":{\"id\":\"553c3ef8b8cdcd1501ba1238\",\"title\":\"Support custom color schemes\"},\"objectType\":\"post\",\"type\":\"post.created\"}",
1017
+ contentType: "application/json"
1018
+ },
1019
+ body: {
1020
+ data: {
1021
+ created: "2026-04-16T01:07:22.189Z",
1022
+ object: {
1023
+ id: "553c3ef8b8cdcd1501ba1238",
1024
+ author: exampleAuthor,
1025
+ board: exampleBoard,
1026
+ by: null,
1027
+ category: null,
1028
+ commentCount: 0,
1029
+ created: "2026-04-16T01:07:22.189Z",
1030
+ details: "We'd love the ability to customize the color scheme to match our brand.",
1031
+ eta: null,
1032
+ imageURLs: [],
1033
+ score: 1,
1034
+ status: "open",
1035
+ tags: [],
1036
+ title: "Support custom color schemes",
1037
+ url: "https://your-company.canny.io/admin/board/feature-requests/p/support-custom-color-schemes"
1038
+ },
1039
+ objectType: "post",
1040
+ type: "post.created"
1041
+ },
1042
+ contentType: "application/json"
1043
+ }
1044
+ } };
1045
+ //#endregion
1046
+ //#region src/examplePayloads/users.ts
1047
+ const retrieveUserExamplePayload = { data: {
1048
+ id: "553c3ef8b8cdcd1501ba123a",
1049
+ alias: "Green Fish",
1050
+ avatarURL: "https://canny.io/images/a3db0133d1e7d9122832b67b2c4caaaa.jpg",
1051
+ companies: [],
1052
+ created: "2026-04-16T01:07:22.192Z",
1053
+ customFields: {
1054
+ field1: "value1",
1055
+ field2: "value2"
1056
+ },
1057
+ email: "sally.doe@example.com",
1058
+ isAdmin: false,
1059
+ lastActivity: "2026-04-16T01:07:22.192Z",
1060
+ name: "Sally Doe",
1061
+ url: "https://your-company.canny.io/admin/users/sally-doe",
1062
+ userID: "1234"
1063
+ } };
1064
+ const listUsersExamplePayload = { data: {
1065
+ hasNextPage: true,
1066
+ cursor: "NTUzYzNlZjhiOGNkY2QxNTAxYmExMjNhXzIwMjUtMDItMDRUMTY6NDA6MDcuNTQxWl8x",
1067
+ users: [{
1068
+ id: "553c3ef8b8cdcd1501ba123a",
1069
+ alias: "Green Fish",
1070
+ avatarURL: "https://canny.io/images/a3db0133d1e7d9122832b67b2c4caaaa.jpg",
1071
+ companies: [],
1072
+ created: "2026-04-16T01:07:21.973Z",
1073
+ customFields: {
1074
+ field1: "value1",
1075
+ field2: "value2"
1076
+ },
1077
+ email: "sally.doe@example.com",
1078
+ isAdmin: false,
1079
+ lastActivity: "2026-04-16T01:07:21.973Z",
1080
+ name: "Sally Doe",
1081
+ url: "https://your-company.canny.io/admin/users/sally-doe",
1082
+ userID: "1234"
1083
+ }]
1084
+ } };
1085
+ const createOrUpdateUserExamplePayload = { data: { id: "553c3ef8b8cdcd1501ba9999" } };
1086
+ const deleteUserExamplePayload = { data: "success" };
1087
+ //#endregion
1088
+ //#region src/examplePayloads/votes.ts
1089
+ const retrieveVoteExamplePayload = { data: {
1090
+ id: "553c3ef8b8cdcd1501ba123b",
1091
+ board: {
1092
+ created: "2017-08-30T13:32:01.000Z",
1093
+ id: "553c3ef8b8cdcd1501ba4400",
1094
+ name: "Feature Requests",
1095
+ postCount: 99,
1096
+ url: "https://your-company.canny.io/admin/board/feature-requests"
1097
+ },
1098
+ by: null,
1099
+ created: "2017-08-30T13:32:01.000Z",
1100
+ post: {
1101
+ category: {
1102
+ id: "553c3ef8b8cdcd1501ba2234",
1103
+ name: "Dashboard",
1104
+ postCount: 42,
1105
+ url: "https://your-company.canny.io/admin/board/feature-requests?category=dashboard"
1106
+ },
1107
+ commentCount: 2,
1108
+ eta: "February 2020",
1109
+ id: "553c3ef8b8cdcd1501ba4444",
1110
+ imageURLs: [],
1111
+ jira: { linkedIssues: [{
1112
+ id: "123",
1113
+ key: "ID-123",
1114
+ url: "https://your-company.atlassian.net/browse/ID-123"
1115
+ }] },
1116
+ linear: { linkedIssueIDs: ["ID-123", "ID-345"] },
1117
+ score: 13,
1118
+ status: "planned",
1119
+ tags: [{
1120
+ id: "553c3ef8b8cdcd1501ba3234",
1121
+ name: "iOS",
1122
+ postCount: 15,
1123
+ url: "https://your-company.canny.io/admin/board/feature-requests?tags=ios"
1124
+ }],
1125
+ title: "post-title",
1126
+ url: "https://your-company.canny.io/admin/board/feature-requests/p/post-title"
1127
+ },
1128
+ voter: {
1129
+ id: "553c3ef8b8cdcd1501ba123a",
1130
+ created: "2017-08-30T13:32:00.000Z",
1131
+ email: "sally.doe@example.com",
1132
+ isAdmin: false,
1133
+ name: "Sally Doe",
1134
+ url: "https://your-company.canny.io/admin/users/sally-doe",
1135
+ userID: "1234"
1136
+ },
1137
+ votePriority: "Important",
1138
+ zendeskTicket: null
1139
+ } };
1140
+ const listVotesExamplePayload = { data: {
1141
+ cursor: "eyJhZnRlciI6eyJfaWQiOiI1NTNjM2VmOGI4Y2RjZD...",
1142
+ hasNextPage: true,
1143
+ items: [{
1144
+ id: "553c3ef8b8cdcd1501ba123b",
1145
+ board: {
1146
+ created: "2026-04-16T01:07:22.193Z",
1147
+ id: "553c3ef8b8cdcd1501ba1234",
1148
+ name: "Feature Requests",
1149
+ postCount: 123,
1150
+ url: "https://your-company.canny.io/admin/board/feature-requests"
1151
+ },
1152
+ by: null,
1153
+ created: "2026-04-16T01:07:22.193Z",
1154
+ post: {
1155
+ category: {
1156
+ id: "553c3ef8b8cdcd1501ba2234",
1157
+ name: "Dashboard",
1158
+ postCount: 42,
1159
+ url: "https://your-company.canny.io/admin/board/feature-requests?category=dashboard"
1160
+ },
1161
+ commentCount: 2,
1162
+ id: "553c3ef8b8cdcd1501ba4444",
1163
+ imageURLs: [],
1164
+ jira: { linkedIssues: [{
1165
+ id: "123",
1166
+ key: "ID-123",
1167
+ url: "https://your-company.atlassian.net/browse/ID-123"
1168
+ }] },
1169
+ linear: { linkedIssueIDs: ["ID-123", "ID-345"] },
1170
+ score: 13,
1171
+ status: "planned",
1172
+ tags: [{
1173
+ id: "553c3ef8b8cdcd1501ba3234",
1174
+ name: "iOS",
1175
+ postCount: 15,
1176
+ url: "https://your-company.canny.io/admin/board/feature-requests?tags=ios"
1177
+ }],
1178
+ title: "post-title",
1179
+ url: "https://your-company.canny.io/admin/board/feature-requests/p/post-title"
1180
+ },
1181
+ voter: {
1182
+ id: "553c3ef8b8cdcd1501ba123a",
1183
+ created: "2026-04-16T01:07:22.193Z",
1184
+ email: "sally.doe@example.com",
1185
+ isAdmin: false,
1186
+ name: "Sally Doe",
1187
+ url: "https://your-company.canny.io/admin/users/sally-doe",
1188
+ userID: "1234"
1189
+ },
1190
+ votePriority: "No priority",
1191
+ zendeskTicket: {
1192
+ id: "2",
1193
+ created: "2018-12-14T19:20:25Z",
1194
+ subject: "Ticket subject",
1195
+ description: "Ticket description",
1196
+ url: "https://your-company.zendesk.com/api/v2/tickets/2.json"
1197
+ }
1198
+ }]
1199
+ } };
1200
+ const createVoteExamplePayload = { data: "success" };
1201
+ const deleteVoteExamplePayload = { data: "success" };
1202
+ //#endregion
1203
+ //#region src/inputs/common.ts
1204
+ const fetchAll = (0, _prismatic_io_spectral.input)({
1205
+ label: "Fetch All",
1206
+ type: "boolean",
1207
+ required: false,
1208
+ default: "false",
1209
+ comments: "When true, automatically fetches all pages of results using pagination.",
1210
+ clean: _prismatic_io_spectral.util.types.toBool
1211
+ });
1212
+ const connection = (0, _prismatic_io_spectral.input)({
1213
+ label: "Connection",
1214
+ type: "connection",
1215
+ required: true,
1216
+ comments: "The Canny connection to use."
1217
+ });
1218
+ const limit = (0, _prismatic_io_spectral.input)({
1219
+ label: "Limit",
1220
+ type: "string",
1221
+ required: false,
1222
+ comments: "Number of results to return per page.",
1223
+ clean: toOptionalNumber,
1224
+ placeholder: "Enter limit",
1225
+ example: "10"
1226
+ });
1227
+ const skip = (0, _prismatic_io_spectral.input)({
1228
+ label: "Skip",
1229
+ type: "string",
1230
+ required: false,
1231
+ comments: "The number of results to skip before returning data (0-based).",
1232
+ clean: toOptionalNumber,
1233
+ placeholder: "Enter skip count",
1234
+ example: "0"
1235
+ });
1236
+ const cursor = (0, _prismatic_io_spectral.input)({
1237
+ label: "Cursor",
1238
+ type: "string",
1239
+ required: false,
1240
+ comments: "Pagination cursor from a previous response.",
1241
+ clean: toOptionalString,
1242
+ placeholder: "Enter cursor token",
1243
+ example: "next_abc123def456"
1244
+ });
1245
+ const offsetPagination = (0, _prismatic_io_spectral.structuredObjectInput)({
1246
+ label: "Pagination",
1247
+ required: false,
1248
+ comments: "Page and page-size controls.",
1249
+ inputs: {
1250
+ limit,
1251
+ skip
1252
+ }
1253
+ });
1254
+ const cursorPagination = (0, _prismatic_io_spectral.structuredObjectInput)({
1255
+ label: "Pagination",
1256
+ required: false,
1257
+ comments: "Cursor and page-size controls for paging through results.",
1258
+ inputs: {
1259
+ cursor,
1260
+ limit
1261
+ }
1262
+ });
1263
+ const boardId = (0, _prismatic_io_spectral.input)({
1264
+ label: "Board ID",
1265
+ type: "string",
1266
+ required: false,
1267
+ comments: "Filter results by board.",
1268
+ clean: toOptionalString,
1269
+ dataSource: "selectBoard",
1270
+ placeholder: "Enter board ID",
1271
+ example: "553c3ef8b8cdcd1501ba1234"
1272
+ });
1273
+ const boardIdRequired = (0, _prismatic_io_spectral.input)({
1274
+ label: "Board ID",
1275
+ type: "string",
1276
+ required: true,
1277
+ comments: "The unique identifier of the board.",
1278
+ clean: _prismatic_io_spectral.util.types.toString,
1279
+ dataSource: "selectBoard",
1280
+ placeholder: "Enter board ID",
1281
+ example: "553c3ef8b8cdcd1501ba1234"
1282
+ });
1283
+ const postId = (0, _prismatic_io_spectral.input)({
1284
+ label: "Post ID",
1285
+ type: "string",
1286
+ required: true,
1287
+ comments: "The unique identifier of the post.",
1288
+ clean: _prismatic_io_spectral.util.types.toString,
1289
+ dataSource: "selectPost",
1290
+ placeholder: "Enter post ID",
1291
+ example: "553c3ef8b8cdcd1501ba5678"
1292
+ });
1293
+ const postIdOptional = (0, _prismatic_io_spectral.input)({
1294
+ label: "Post ID",
1295
+ type: "string",
1296
+ required: false,
1297
+ comments: "Filter results by post.",
1298
+ clean: toOptionalString,
1299
+ dataSource: "selectPost",
1300
+ placeholder: "Enter post ID",
1301
+ example: "553c3ef8b8cdcd1501ba5678"
1302
+ });
1303
+ const userIdOptional = (0, _prismatic_io_spectral.input)({
1304
+ label: "User ID",
1305
+ type: "string",
1306
+ required: false,
1307
+ comments: "Filter results by user.",
1308
+ clean: toOptionalString,
1309
+ dataSource: "selectUser",
1310
+ placeholder: "Enter user ID",
1311
+ example: "553c3ef8b8cdcd1501ba9999"
1312
+ });
1313
+ const authorId = (0, _prismatic_io_spectral.input)({
1314
+ label: "Author ID",
1315
+ type: "string",
1316
+ required: false,
1317
+ comments: "Filter by or specify the post author.",
1318
+ clean: toOptionalString,
1319
+ dataSource: "selectUser",
1320
+ placeholder: "Enter author ID",
1321
+ example: "553c3ef8b8cdcd1501ba9999"
1322
+ });
1323
+ const companyId = (0, _prismatic_io_spectral.input)({
1324
+ label: "Company ID",
1325
+ type: "string",
1326
+ required: false,
1327
+ comments: "Filter results by company.",
1328
+ clean: toOptionalString,
1329
+ dataSource: "selectCompany",
1330
+ placeholder: "Enter company ID",
1331
+ example: "553c3ef8b8cdcd1501ba1111"
1332
+ });
1333
+ const customFields = (0, _prismatic_io_spectral.input)({
1334
+ label: "Custom Fields",
1335
+ type: "code",
1336
+ language: "json",
1337
+ required: false,
1338
+ comments: "Custom field key-value pairs as JSON.",
1339
+ clean: toOptionalObject,
1340
+ placeholder: "Enter custom fields",
1341
+ example: JSON.stringify({ key: "value" }, null, 2)
1342
+ });
1343
+ const imageURLs = (0, _prismatic_io_spectral.input)({
1344
+ label: "Image URLs",
1345
+ type: "code",
1346
+ language: "json",
1347
+ required: false,
1348
+ comments: "JSON array of image URLs to attach.",
1349
+ clean: toOptionalObject,
1350
+ placeholder: "Enter image URLs",
1351
+ example: JSON.stringify(["https://example.com/image.png"], null, 2)
1352
+ });
1353
+ const additionalFields = (0, _prismatic_io_spectral.input)({
1354
+ label: "Additional Fields",
1355
+ type: "code",
1356
+ language: "json",
1357
+ comments: "Additional fields that might not be covered by the standard inputs.",
1358
+ required: false,
1359
+ placeholder: "Enter additional fields",
1360
+ example: JSON.stringify({ email: "sally@netflix.com" }, null, 2),
1361
+ clean: toObjectOrEmpty
1362
+ });
1363
+ //#endregion
1364
+ //#region src/inputs/boards.ts
1365
+ const id = (0, _prismatic_io_spectral.input)({
1366
+ label: "Board ID",
1367
+ type: "string",
1368
+ required: true,
1369
+ comments: "The unique identifier of the board.",
1370
+ clean: _prismatic_io_spectral.util.types.toString,
1371
+ placeholder: "Enter board ID",
1372
+ dataSource: "selectBoard",
1373
+ example: "553c3ef8b8cdcd1501ba1234"
1374
+ });
1375
+ const listBoardsInputs = { connection };
1376
+ const retrieveBoardInputs = {
1377
+ connection,
1378
+ id
1379
+ };
1380
+ const selectBoardInputs = { connection };
1381
+ //#endregion
1382
+ //#region src/inputs/categories.ts
1383
+ const categoryIdRequired = (0, _prismatic_io_spectral.input)({
1384
+ label: "Category ID",
1385
+ type: "string",
1386
+ required: true,
1387
+ comments: "The unique identifier of the category.",
1388
+ clean: _prismatic_io_spectral.util.types.toString,
1389
+ placeholder: "Enter category ID",
1390
+ example: "553c3ef8b8cdcd1501baabcd",
1391
+ dataSource: "selectCategory"
1392
+ });
1393
+ const categoryName = (0, _prismatic_io_spectral.input)({
1394
+ label: "Name",
1395
+ type: "string",
1396
+ required: true,
1397
+ comments: "The display name shown when grouping posts on the board.",
1398
+ clean: _prismatic_io_spectral.util.types.toString,
1399
+ placeholder: "Enter category name",
1400
+ example: "UI Improvements"
1401
+ });
1402
+ const subscribeAdmins = (0, _prismatic_io_spectral.input)({
1403
+ label: "Subscribe Admins",
1404
+ type: "boolean",
1405
+ required: true,
1406
+ comments: "When true, subscribes admins to the category.",
1407
+ clean: _prismatic_io_spectral.util.types.toBool
1408
+ });
1409
+ const parentCategoryId = (0, _prismatic_io_spectral.input)({
1410
+ label: "Parent Category ID",
1411
+ type: "string",
1412
+ required: false,
1413
+ comments: "Parent category ID for subcategories.",
1414
+ clean: toOptionalString,
1415
+ placeholder: "Enter parent category ID",
1416
+ example: "553c3ef8b8cdcd1501baabcd",
1417
+ dataSource: "selectCategory"
1418
+ });
1419
+ const listCategoriesInputs = {
1420
+ connection,
1421
+ boardId,
1422
+ fetchAll,
1423
+ pagination: offsetPagination
1424
+ };
1425
+ const retrieveCategoryInputs = {
1426
+ connection,
1427
+ categoryIdRequired
1428
+ };
1429
+ const createCategoryInputs = {
1430
+ connection,
1431
+ boardIdRequired,
1432
+ categoryName,
1433
+ subscribeAdmins,
1434
+ parentCategoryId
1435
+ };
1436
+ const deleteCategoryInputs = {
1437
+ connection,
1438
+ categoryIdRequired
1439
+ };
1440
+ const selectCategoryInputs = {
1441
+ connection,
1442
+ boardId: {
1443
+ ...boardId,
1444
+ dataSource: void 0
1445
+ }
1446
+ };
1447
+ //#endregion
1448
+ //#region src/inputs/comments.ts
1449
+ const commentId = (0, _prismatic_io_spectral.input)({
1450
+ label: "Comment ID",
1451
+ type: "string",
1452
+ required: true,
1453
+ comments: "The unique identifier of the comment.",
1454
+ clean: _prismatic_io_spectral.util.types.toString,
1455
+ placeholder: "Enter comment ID",
1456
+ example: "553c3ef8b8cdcd1501ba2222"
1457
+ });
1458
+ const commentAuthorId = (0, _prismatic_io_spectral.input)({
1459
+ label: "Author ID",
1460
+ type: "string",
1461
+ required: true,
1462
+ comments: "The unique identifier of the comment author.",
1463
+ clean: _prismatic_io_spectral.util.types.toString,
1464
+ dataSource: "selectUser",
1465
+ placeholder: "Enter author ID",
1466
+ example: "553c3ef8b8cdcd1501ba9999"
1467
+ });
1468
+ const commentValue = (0, _prismatic_io_spectral.input)({
1469
+ label: "Comment Text",
1470
+ type: "text",
1471
+ required: true,
1472
+ comments: "The body of the comment as it appears on the post. Plain text.",
1473
+ clean: _prismatic_io_spectral.util.types.toString,
1474
+ placeholder: "Enter comment text",
1475
+ example: "Great idea! We should prioritize this."
1476
+ });
1477
+ const internal = (0, _prismatic_io_spectral.input)({
1478
+ label: "Internal",
1479
+ type: "boolean",
1480
+ required: false,
1481
+ comments: "When true, the comment is internal-only and not visible to end users.",
1482
+ clean: _prismatic_io_spectral.util.types.toBool
1483
+ });
1484
+ const parentId = (0, _prismatic_io_spectral.input)({
1485
+ label: "Parent Comment ID",
1486
+ type: "string",
1487
+ required: false,
1488
+ comments: "Parent comment ID for threaded replies.",
1489
+ clean: toOptionalString,
1490
+ placeholder: "Enter parent comment ID",
1491
+ example: "553c3ef8b8cdcd1501ba2222"
1492
+ });
1493
+ const listCommentsInputs = {
1494
+ connection,
1495
+ boardId,
1496
+ postIdOptional,
1497
+ authorId,
1498
+ companyId,
1499
+ fetchAll,
1500
+ pagination: cursorPagination
1501
+ };
1502
+ const retrieveCommentInputs = {
1503
+ connection,
1504
+ commentId
1505
+ };
1506
+ const createCommentInputs = {
1507
+ connection,
1508
+ postId,
1509
+ commentAuthorId,
1510
+ commentValue,
1511
+ parentId,
1512
+ additionalFields: (0, _prismatic_io_spectral.structuredObjectInput)({
1513
+ label: "Additional Fields",
1514
+ required: false,
1515
+ comments: "Additional optional fields: includes Internal, Image URLs, and Additional Fields.",
1516
+ inputs: {
1517
+ internal,
1518
+ imageURLs,
1519
+ additionalFields
1520
+ }
1521
+ })
1522
+ };
1523
+ const deleteCommentInputs = {
1524
+ connection,
1525
+ commentId
1526
+ };
1527
+ //#endregion
1528
+ //#region src/inputs/companies.ts
1529
+ const companyIdRequired = (0, _prismatic_io_spectral.input)({
1530
+ label: "Company ID",
1531
+ type: "string",
1532
+ required: true,
1533
+ comments: "The unique identifier of the company.",
1534
+ clean: _prismatic_io_spectral.util.types.toString,
1535
+ dataSource: "selectCompany",
1536
+ placeholder: "Enter company ID",
1537
+ example: "553c3ef8b8cdcd1501ba1111"
1538
+ });
1539
+ const companyName = (0, _prismatic_io_spectral.input)({
1540
+ label: "Name",
1541
+ type: "string",
1542
+ required: false,
1543
+ comments: "The company name (0-100 characters).",
1544
+ clean: toOptionalString,
1545
+ placeholder: "Enter company name",
1546
+ example: "Acme Corp"
1547
+ });
1548
+ const monthlySpend = (0, _prismatic_io_spectral.input)({
1549
+ label: "Monthly Spend",
1550
+ type: "string",
1551
+ required: false,
1552
+ comments: "Monthly recurring revenue in dollars.",
1553
+ clean: toOptionalNumber,
1554
+ placeholder: "Enter monthly spend",
1555
+ example: "5000"
1556
+ });
1557
+ const listCompaniesInputs = {
1558
+ connection,
1559
+ companySearch: (0, _prismatic_io_spectral.input)({
1560
+ label: "Search",
1561
+ type: "string",
1562
+ required: false,
1563
+ comments: "Search term to filter companies.",
1564
+ clean: toOptionalString,
1565
+ placeholder: "Enter search term",
1566
+ example: "Acme"
1567
+ }),
1568
+ segment: (0, _prismatic_io_spectral.input)({
1569
+ label: "Segment",
1570
+ type: "string",
1571
+ required: false,
1572
+ comments: "Restricts results to companies in a single segment, matched exactly against the segment name.",
1573
+ clean: toOptionalString,
1574
+ placeholder: "Enter segment",
1575
+ example: "enterprise"
1576
+ }),
1577
+ fetchAll,
1578
+ pagination: cursorPagination
1579
+ };
1580
+ const updateCompanyInputs = {
1581
+ connection,
1582
+ companyIdRequired,
1583
+ companyName,
1584
+ additionalFields: (0, _prismatic_io_spectral.structuredObjectInput)({
1585
+ label: "Additional Fields",
1586
+ required: false,
1587
+ comments: "Additional optional fields: includes Monthly Spend, Custom Fields, and Additional Fields.",
1588
+ inputs: {
1589
+ monthlySpend,
1590
+ customFields,
1591
+ additionalFields
1592
+ }
1593
+ })
1594
+ };
1595
+ const deleteCompanyInputs = {
1596
+ connection,
1597
+ companyIdRequired
1598
+ };
1599
+ const selectCompanyInputs = { connection };
1600
+ //#endregion
1601
+ //#region src/inputs/entries.ts
1602
+ const entryTitle = (0, _prismatic_io_spectral.input)({
1603
+ label: "Title",
1604
+ type: "string",
1605
+ required: true,
1606
+ comments: "The headline shown at the top of the changelog entry.",
1607
+ clean: _prismatic_io_spectral.util.types.toString,
1608
+ placeholder: "Enter entry title",
1609
+ example: "New Dashboard Features"
1610
+ });
1611
+ const entryDetails = (0, _prismatic_io_spectral.input)({
1612
+ label: "Details",
1613
+ type: "text",
1614
+ required: true,
1615
+ comments: "The entry content (markdown supported).",
1616
+ clean: _prismatic_io_spectral.util.types.toString,
1617
+ placeholder: "Enter entry details",
1618
+ example: "We've added several new features to the dashboard..."
1619
+ });
1620
+ const entryType = (0, _prismatic_io_spectral.input)({
1621
+ label: "Type",
1622
+ type: "string",
1623
+ required: false,
1624
+ comments: "Entry type: new, improved, or fixed.",
1625
+ clean: toOptionalString,
1626
+ model: [
1627
+ {
1628
+ label: "New",
1629
+ value: "new"
1630
+ },
1631
+ {
1632
+ label: "Improved",
1633
+ value: "improved"
1634
+ },
1635
+ {
1636
+ label: "Fixed",
1637
+ value: "fixed"
1638
+ }
1639
+ ],
1640
+ placeholder: "Enter entry type",
1641
+ example: "new"
1642
+ });
1643
+ const notify = (0, _prismatic_io_spectral.input)({
1644
+ label: "Notify",
1645
+ type: "boolean",
1646
+ required: false,
1647
+ comments: "When true, sends an email notification for the changelog entry.",
1648
+ clean: _prismatic_io_spectral.util.types.toBool
1649
+ });
1650
+ const published = (0, _prismatic_io_spectral.input)({
1651
+ label: "Published",
1652
+ type: "boolean",
1653
+ required: false,
1654
+ comments: "When true, publishes the changelog entry immediately.",
1655
+ clean: _prismatic_io_spectral.util.types.toBool
1656
+ });
1657
+ const listEntriesInputs = {
1658
+ connection,
1659
+ entryType,
1660
+ entrySort: (0, _prismatic_io_spectral.input)({
1661
+ label: "Sort",
1662
+ type: "string",
1663
+ required: false,
1664
+ comments: "Sort order for changelog entries.",
1665
+ clean: toOptionalString,
1666
+ model: [
1667
+ {
1668
+ label: "Created",
1669
+ value: "created"
1670
+ },
1671
+ {
1672
+ label: "Last Saved",
1673
+ value: "lastSaved"
1674
+ },
1675
+ {
1676
+ label: "Non-Published First",
1677
+ value: "nonPublishedFirst"
1678
+ },
1679
+ {
1680
+ label: "Published At",
1681
+ value: "publishedAt"
1682
+ }
1683
+ ],
1684
+ placeholder: "Enter sort order",
1685
+ example: "nonPublishedFirst"
1686
+ }),
1687
+ fetchAll,
1688
+ pagination: offsetPagination
1689
+ };
1690
+ const createEntryInputs = {
1691
+ connection,
1692
+ entryTitle,
1693
+ entryDetails,
1694
+ entryType,
1695
+ additionalFields: (0, _prismatic_io_spectral.structuredObjectInput)({
1696
+ label: "Additional Fields",
1697
+ required: false,
1698
+ comments: "Additional optional fields: includes Notify, Published, and Additional Fields.",
1699
+ inputs: {
1700
+ notify,
1701
+ published,
1702
+ additionalFields
1703
+ }
1704
+ })
1705
+ };
1706
+ //#endregion
1707
+ //#region src/inputs/misc.ts
1708
+ const { debugRequest: _, ...httpInputs } = _prismatic_io_spectral_http.inputs;
1709
+ const rawRequestInputs = {
1710
+ connection,
1711
+ ...httpInputs,
1712
+ url: {
1713
+ ...httpInputs.url,
1714
+ comments: `Input the path only (e.g., /v1/posts/list). The base URL is already included (https://canny.io/api). For example, to connect to https://canny.io/api/v1/posts/list, only /v1/posts/list is entered in this field.`,
1715
+ example: "/v1/posts/list"
1716
+ }
1717
+ };
1718
+ //#endregion
1719
+ //#region src/inputs/posts.ts
1720
+ const authorIdRequired = (0, _prismatic_io_spectral.input)({
1721
+ label: "Author ID",
1722
+ type: "string",
1723
+ required: true,
1724
+ comments: "The unique identifier of the post author.",
1725
+ clean: _prismatic_io_spectral.util.types.toString,
1726
+ dataSource: "selectUser",
1727
+ placeholder: "Enter author ID",
1728
+ example: "553c3ef8b8cdcd1501ba9999"
1729
+ });
1730
+ const title = (0, _prismatic_io_spectral.input)({
1731
+ label: "Title",
1732
+ type: "string",
1733
+ required: true,
1734
+ comments: "The headline shown in the board list and used for search matching.",
1735
+ clean: _prismatic_io_spectral.util.types.toString,
1736
+ placeholder: "Enter post title",
1737
+ example: "Add dark mode support"
1738
+ });
1739
+ const titleOptional = (0, _prismatic_io_spectral.input)({
1740
+ label: "Title",
1741
+ type: "string",
1742
+ required: false,
1743
+ comments: "Replaces the post headline. Leave blank to keep the current title.",
1744
+ clean: toOptionalString,
1745
+ placeholder: "Enter post title",
1746
+ example: "Add dark mode support"
1747
+ });
1748
+ const details = (0, _prismatic_io_spectral.input)({
1749
+ label: "Details",
1750
+ type: "text",
1751
+ required: true,
1752
+ comments: "The content or description of the post.",
1753
+ clean: _prismatic_io_spectral.util.types.toString,
1754
+ placeholder: "Enter post details",
1755
+ example: "It would be great to have a dark mode option for the dashboard."
1756
+ });
1757
+ const detailsOptional = (0, _prismatic_io_spectral.input)({
1758
+ label: "Details",
1759
+ type: "text",
1760
+ required: false,
1761
+ comments: "Replaces the post body. Leave blank to keep the current details.",
1762
+ clean: toOptionalString,
1763
+ placeholder: "Enter post details",
1764
+ example: "Updated description for the feature request."
1765
+ });
1766
+ const search = (0, _prismatic_io_spectral.input)({
1767
+ label: "Search",
1768
+ type: "string",
1769
+ required: false,
1770
+ comments: "Search term to filter posts.",
1771
+ clean: toOptionalString,
1772
+ placeholder: "Enter search term",
1773
+ example: "dark mode"
1774
+ });
1775
+ const sort = (0, _prismatic_io_spectral.input)({
1776
+ label: "Sort",
1777
+ type: "string",
1778
+ required: false,
1779
+ comments: "Sort order for post results.",
1780
+ clean: toOptionalString,
1781
+ model: [
1782
+ {
1783
+ label: "Newest",
1784
+ value: "newest"
1785
+ },
1786
+ {
1787
+ label: "Oldest",
1788
+ value: "oldest"
1789
+ },
1790
+ {
1791
+ label: "Relevance",
1792
+ value: "relevance"
1793
+ },
1794
+ {
1795
+ label: "Score",
1796
+ value: "score"
1797
+ },
1798
+ {
1799
+ label: "Status Changed",
1800
+ value: "statusChanged"
1801
+ },
1802
+ {
1803
+ label: "Trending",
1804
+ value: "trending"
1805
+ }
1806
+ ],
1807
+ placeholder: "Enter sort order",
1808
+ example: "newest"
1809
+ });
1810
+ const status = (0, _prismatic_io_spectral.input)({
1811
+ label: "Status",
1812
+ type: "string",
1813
+ required: false,
1814
+ comments: "Comma-separated list of statuses to filter by.",
1815
+ clean: toOptionalString,
1816
+ placeholder: "Enter status filter",
1817
+ example: "open,planned"
1818
+ });
1819
+ const statusRequired = (0, _prismatic_io_spectral.input)({
1820
+ label: "Status",
1821
+ type: "string",
1822
+ required: true,
1823
+ comments: "The new status value (e.g., open, under review, planned, in progress, complete, closed).",
1824
+ clean: _prismatic_io_spectral.util.types.toString,
1825
+ placeholder: "Enter status",
1826
+ example: "planned"
1827
+ });
1828
+ const changerId = (0, _prismatic_io_spectral.input)({
1829
+ label: "Changer ID",
1830
+ type: "string",
1831
+ required: true,
1832
+ comments: "The admin performing the status change.",
1833
+ clean: _prismatic_io_spectral.util.types.toString,
1834
+ dataSource: "selectUser",
1835
+ placeholder: "Enter admin user ID",
1836
+ example: "553c3ef8b8cdcd1501ba9999"
1837
+ });
1838
+ const shouldNotifyVoters = (0, _prismatic_io_spectral.input)({
1839
+ label: "Notify Voters",
1840
+ type: "boolean",
1841
+ required: true,
1842
+ comments: "When true, notifies voters of the status change.",
1843
+ clean: _prismatic_io_spectral.util.types.toBool
1844
+ });
1845
+ const postCommentValue = (0, _prismatic_io_spectral.input)({
1846
+ label: "Comment",
1847
+ type: "text",
1848
+ required: false,
1849
+ comments: "Optional comment to attach to the status change.",
1850
+ clean: toOptionalString,
1851
+ placeholder: "Enter comment",
1852
+ example: "We've moved this to our roadmap."
1853
+ });
1854
+ const categoryId = (0, _prismatic_io_spectral.input)({
1855
+ label: "Category ID",
1856
+ type: "string",
1857
+ required: false,
1858
+ comments: "Category to assign to the post.",
1859
+ clean: toOptionalString,
1860
+ dataSource: "selectCategory",
1861
+ placeholder: "Enter category ID",
1862
+ example: "553c3ef8b8cdcd1501baabcd"
1863
+ });
1864
+ const eta = (0, _prismatic_io_spectral.input)({
1865
+ label: "ETA",
1866
+ type: "string",
1867
+ required: false,
1868
+ comments: "Estimated delivery date in MM/YYYY format.",
1869
+ clean: toOptionalString,
1870
+ placeholder: "Enter ETA",
1871
+ example: "06/2025"
1872
+ });
1873
+ const etaPublic = (0, _prismatic_io_spectral.input)({
1874
+ label: "ETA Public",
1875
+ type: "boolean",
1876
+ required: false,
1877
+ comments: "When true, the ETA is visible to all users.",
1878
+ clean: _prismatic_io_spectral.util.types.toBool
1879
+ });
1880
+ const tagIDs = (0, _prismatic_io_spectral.input)({
1881
+ label: "Tag IDs",
1882
+ type: "code",
1883
+ language: "json",
1884
+ required: false,
1885
+ comments: "JSON array of tag IDs to filter by.",
1886
+ clean: toOptionalObject,
1887
+ placeholder: "Enter tag IDs",
1888
+ example: JSON.stringify(["553c3ef8b8cdcd1501ba4444"], null, 2)
1889
+ });
1890
+ const listControls = (0, _prismatic_io_spectral.structuredObjectInput)({
1891
+ label: "List Controls",
1892
+ required: false,
1893
+ comments: "Search, sort, and status filter controls.",
1894
+ inputs: {
1895
+ search,
1896
+ sort,
1897
+ status
1898
+ }
1899
+ });
1900
+ const createPostAdditionalFields = (0, _prismatic_io_spectral.structuredObjectInput)({
1901
+ label: "Additional Fields",
1902
+ required: false,
1903
+ comments: "Additional optional fields: includes Custom Fields, ETA, ETA Public, Image URLs, and Additional Fields.",
1904
+ inputs: {
1905
+ customFields,
1906
+ eta,
1907
+ etaPublic,
1908
+ imageURLs,
1909
+ additionalFields
1910
+ }
1911
+ });
1912
+ const updatePostAdditionalFields = (0, _prismatic_io_spectral.structuredObjectInput)({
1913
+ label: "Additional Fields",
1914
+ required: false,
1915
+ comments: "Additional optional fields: includes Custom Fields, ETA, Image URLs, and Additional Fields.",
1916
+ inputs: {
1917
+ customFields,
1918
+ eta,
1919
+ imageURLs,
1920
+ additionalFields
1921
+ }
1922
+ });
1923
+ const listPostsInputs = {
1924
+ connection,
1925
+ boardId,
1926
+ authorId,
1927
+ companyId,
1928
+ tagIDs,
1929
+ fetchAll,
1930
+ pagination: offsetPagination,
1931
+ listControls
1932
+ };
1933
+ const retrievePostInputs = {
1934
+ connection,
1935
+ postId
1936
+ };
1937
+ const createPostInputs = {
1938
+ connection,
1939
+ boardIdRequired,
1940
+ authorIdRequired,
1941
+ title,
1942
+ details,
1943
+ categoryId,
1944
+ additionalFields: createPostAdditionalFields
1945
+ };
1946
+ const updatePostInputs = {
1947
+ connection,
1948
+ postId,
1949
+ titleOptional,
1950
+ detailsOptional,
1951
+ additionalFields: updatePostAdditionalFields
1952
+ };
1953
+ const deletePostInputs = {
1954
+ connection,
1955
+ postId
1956
+ };
1957
+ const changePostStatusInputs = {
1958
+ connection,
1959
+ postId,
1960
+ statusRequired,
1961
+ changerId,
1962
+ shouldNotifyVoters,
1963
+ postCommentValue,
1964
+ additionalFields
1965
+ };
1966
+ const selectPostInputs = {
1967
+ connection,
1968
+ boardId: {
1969
+ ...boardId,
1970
+ dataSource: void 0
1971
+ }
1972
+ };
1973
+ //#endregion
1974
+ //#region src/inputs/statusChanges.ts
1975
+ const listStatusChangesInputs = {
1976
+ connection,
1977
+ boardId,
1978
+ fetchAll,
1979
+ pagination: cursorPagination
1980
+ };
1981
+ //#endregion
1982
+ //#region src/inputs/tags.ts
1983
+ const tagId = (0, _prismatic_io_spectral.input)({
1984
+ label: "Tag ID",
1985
+ type: "string",
1986
+ required: true,
1987
+ comments: "The unique identifier of the tag.",
1988
+ clean: _prismatic_io_spectral.util.types.toString,
1989
+ placeholder: "Enter tag ID",
1990
+ example: "553c3ef8b8cdcd1501ba4444",
1991
+ dataSource: "selectTag"
1992
+ });
1993
+ const tagName = (0, _prismatic_io_spectral.input)({
1994
+ label: "Name",
1995
+ type: "string",
1996
+ required: true,
1997
+ comments: "The label applied to posts for filtering, such as bug or feature-request.",
1998
+ clean: _prismatic_io_spectral.util.types.toString,
1999
+ placeholder: "Enter tag name",
2000
+ example: "bug"
2001
+ });
2002
+ const listTagsInputs = {
2003
+ connection,
2004
+ boardId,
2005
+ fetchAll,
2006
+ pagination: offsetPagination
2007
+ };
2008
+ const retrieveTagInputs = {
2009
+ connection,
2010
+ tagId
2011
+ };
2012
+ const createTagInputs = {
2013
+ connection,
2014
+ boardIdRequired,
2015
+ tagName
2016
+ };
2017
+ const selectTagInputs = {
2018
+ connection,
2019
+ boardId: {
2020
+ ...boardId,
2021
+ dataSource: void 0
2022
+ }
2023
+ };
2024
+ //#endregion
2025
+ //#region src/inputs/triggers.ts
2026
+ const webhookInputs = { connection };
2027
+ const pollPostsInputs = {
2028
+ connection,
2029
+ showNewRecords: (0, _prismatic_io_spectral.input)({
2030
+ label: "Show New Records",
2031
+ type: "boolean",
2032
+ required: false,
2033
+ default: "true",
2034
+ comments: "When true, posts created since the last poll are included in the trigger output.",
2035
+ clean: _prismatic_io_spectral.util.types.toBool
2036
+ }),
2037
+ showUpdatedRecords: (0, _prismatic_io_spectral.input)({
2038
+ label: "Show Updated Records",
2039
+ type: "boolean",
2040
+ required: false,
2041
+ default: "true",
2042
+ comments: "When true, posts whose status changed since the last poll are included in the trigger output.",
2043
+ clean: _prismatic_io_spectral.util.types.toBool
2044
+ }),
2045
+ lookBackDate: (0, _prismatic_io_spectral.input)({
2046
+ label: "Look-back Date",
2047
+ placeholder: "Enter look-back date (YYYY-MM-DD)",
2048
+ type: "string",
2049
+ required: false,
2050
+ comments: "The date the initial sync starts from, in YYYY-MM-DD format. Cannot be a future date. Leave empty to start from the first recurrence with no backfill. When set, the initial sync seeds each post created or status-changed on or after this date once, ignoring the field and visibility filters.",
2051
+ example: "2026-01-01",
2052
+ clean: lookBackDateClean
2053
+ })
2054
+ };
2055
+ //#endregion
2056
+ //#region src/inputs/users.ts
2057
+ const userId = (0, _prismatic_io_spectral.input)({
2058
+ label: "User ID",
2059
+ type: "string",
2060
+ required: true,
2061
+ comments: "The unique identifier of the user.",
2062
+ clean: _prismatic_io_spectral.util.types.toString,
2063
+ dataSource: "selectUser",
2064
+ placeholder: "Enter user ID",
2065
+ example: "553c3ef8b8cdcd1501ba9999"
2066
+ });
2067
+ const userEmail = (0, _prismatic_io_spectral.input)({
2068
+ label: "Email",
2069
+ type: "string",
2070
+ required: true,
2071
+ comments: "The user's email address.",
2072
+ clean: _prismatic_io_spectral.util.types.toString,
2073
+ placeholder: "Enter email",
2074
+ example: "jane@example.com"
2075
+ });
2076
+ const userName = (0, _prismatic_io_spectral.input)({
2077
+ label: "Name",
2078
+ type: "string",
2079
+ required: false,
2080
+ comments: "The user's display name.",
2081
+ clean: toOptionalString,
2082
+ placeholder: "Enter name",
2083
+ example: "Jane Smith"
2084
+ });
2085
+ const listUsersInputs = {
2086
+ connection,
2087
+ fetchAll,
2088
+ pagination: cursorPagination
2089
+ };
2090
+ const retrieveUserInputs = {
2091
+ connection,
2092
+ userId
2093
+ };
2094
+ const createOrUpdateUserAdditionalFields = (0, _prismatic_io_spectral.structuredObjectInput)({
2095
+ label: "Additional Fields",
2096
+ required: false,
2097
+ comments: "Additional optional fields: includes Companies, Custom Fields, and Additional Fields.",
2098
+ inputs: {
2099
+ companies: (0, _prismatic_io_spectral.input)({
2100
+ label: "Companies",
2101
+ type: "code",
2102
+ language: "json",
2103
+ required: false,
2104
+ comments: "JSON array of company objects to associate with the user.",
2105
+ clean: toOptionalObject,
2106
+ placeholder: "Enter companies",
2107
+ example: JSON.stringify([{
2108
+ created: "2026-04-15T22:51:00.528Z",
2109
+ customFields: {
2110
+ field1: "value1",
2111
+ field2: "value2"
2112
+ },
2113
+ id: "company123",
2114
+ monthlySpend: 500,
2115
+ name: "company name"
2116
+ }], null, 2)
2117
+ }),
2118
+ customFields,
2119
+ additionalFields
2120
+ }
2121
+ });
2122
+ const createOrUpdateUserInputs = {
2123
+ connection,
2124
+ userEmail,
2125
+ userName,
2126
+ userId: {
2127
+ ...userId,
2128
+ required: false,
2129
+ clean: toOptionalString
2130
+ },
2131
+ additionalFields: createOrUpdateUserAdditionalFields
2132
+ };
2133
+ const deleteUserInputs = {
2134
+ connection,
2135
+ userId
2136
+ };
2137
+ const selectUserInputs = { connection };
2138
+ //#endregion
2139
+ //#region src/inputs/votes.ts
2140
+ const voteId = (0, _prismatic_io_spectral.input)({
2141
+ label: "Vote ID",
2142
+ type: "string",
2143
+ required: true,
2144
+ comments: "The unique identifier of the vote.",
2145
+ clean: _prismatic_io_spectral.util.types.toString,
2146
+ placeholder: "Enter vote ID",
2147
+ example: "553c3ef8b8cdcd1501ba3333"
2148
+ });
2149
+ const voterId = (0, _prismatic_io_spectral.input)({
2150
+ label: "Voter ID",
2151
+ type: "string",
2152
+ required: true,
2153
+ comments: "The unique identifier of the user casting the vote.",
2154
+ clean: _prismatic_io_spectral.util.types.toString,
2155
+ dataSource: "selectUser",
2156
+ placeholder: "Enter voter ID",
2157
+ example: "553c3ef8b8cdcd1501ba9999"
2158
+ });
2159
+ const listVotesInputs = {
2160
+ connection,
2161
+ boardId,
2162
+ postIdOptional,
2163
+ companyId,
2164
+ userIdOptional,
2165
+ fetchAll,
2166
+ pagination: cursorPagination
2167
+ };
2168
+ const retrieveVoteInputs = {
2169
+ connection,
2170
+ voteId
2171
+ };
2172
+ const createVoteInputs = {
2173
+ connection,
2174
+ postId,
2175
+ voterId,
2176
+ additionalFields
2177
+ };
2178
+ const deleteVoteInputs = {
2179
+ connection,
2180
+ voteId
2181
+ };
2182
+ //#endregion
2183
+ //#region src/outputSchemas/shared.ts
2184
+ const idOnlySchema = {
2185
+ type: "object",
2186
+ properties: { id: { type: "string" } },
2187
+ required: ["id"]
2188
+ };
2189
+ const successStringSchema = { type: "string" };
2190
+ const boardSchema = {
2191
+ type: "object",
2192
+ properties: {
2193
+ id: { type: "string" },
2194
+ created: {
2195
+ type: "string",
2196
+ format: "date-time"
2197
+ },
2198
+ isPrivate: { type: "boolean" },
2199
+ name: { type: "string" },
2200
+ postCount: { type: "number" },
2201
+ privateComments: { type: "boolean" },
2202
+ url: { type: "string" }
2203
+ },
2204
+ required: [
2205
+ "id",
2206
+ "created",
2207
+ "isPrivate",
2208
+ "name",
2209
+ "postCount",
2210
+ "privateComments",
2211
+ "url"
2212
+ ]
2213
+ };
2214
+ const boardListItemSchema = {
2215
+ type: "object",
2216
+ properties: {
2217
+ ...boardSchema.properties,
2218
+ token: {
2219
+ type: "string",
2220
+ format: "uuid"
2221
+ }
2222
+ },
2223
+ required: boardSchema.required
2224
+ };
2225
+ const nestedBoardSchema = {
2226
+ type: "object",
2227
+ properties: boardSchema.properties,
2228
+ required: ["id"]
2229
+ };
2230
+ const categorySchema = {
2231
+ type: "object",
2232
+ properties: {
2233
+ id: { type: "string" },
2234
+ board: {
2235
+ type: "object",
2236
+ properties: {
2237
+ id: { type: "string" },
2238
+ created: {
2239
+ type: "string",
2240
+ format: "date-time"
2241
+ },
2242
+ name: { type: "string" },
2243
+ postCount: { type: "number" },
2244
+ url: { type: "string" }
2245
+ },
2246
+ required: ["id"]
2247
+ },
2248
+ created: {
2249
+ type: "string",
2250
+ format: "date-time"
2251
+ },
2252
+ name: { type: "string" },
2253
+ parentID: { type: ["string", "null"] },
2254
+ postCount: { type: "number" },
2255
+ url: { type: "string" }
2256
+ },
2257
+ required: [
2258
+ "id",
2259
+ "board",
2260
+ "created",
2261
+ "name",
2262
+ "parentID",
2263
+ "postCount",
2264
+ "url"
2265
+ ]
2266
+ };
2267
+ const reducedCategorySchema = {
2268
+ type: "object",
2269
+ properties: {
2270
+ id: { type: "string" },
2271
+ name: { type: "string" },
2272
+ parentID: { type: ["string", "null"] },
2273
+ postCount: { type: "number" },
2274
+ url: { type: "string" }
2275
+ },
2276
+ required: ["id"]
2277
+ };
2278
+ const nullableReducedCategorySchema = {
2279
+ type: ["object", "null"],
2280
+ properties: reducedCategorySchema.properties,
2281
+ required: reducedCategorySchema.required
2282
+ };
2283
+ const tagSchema = {
2284
+ type: "object",
2285
+ properties: {
2286
+ id: { type: "string" },
2287
+ board: nestedBoardSchema,
2288
+ created: {
2289
+ type: "string",
2290
+ format: "date-time"
2291
+ },
2292
+ name: { type: "string" },
2293
+ postCount: { type: "number" },
2294
+ url: { type: "string" }
2295
+ },
2296
+ required: [
2297
+ "id",
2298
+ "board",
2299
+ "created",
2300
+ "name",
2301
+ "postCount",
2302
+ "url"
2303
+ ]
2304
+ };
2305
+ const reducedTagSchema = {
2306
+ type: "object",
2307
+ properties: {
2308
+ id: { type: "string" },
2309
+ name: { type: "string" },
2310
+ postCount: { type: "number" },
2311
+ url: { type: "string" }
2312
+ },
2313
+ required: ["id"]
2314
+ };
2315
+ const userSchema = {
2316
+ type: "object",
2317
+ properties: {
2318
+ id: { type: "string" },
2319
+ alias: { type: ["string", "null"] },
2320
+ avatarURL: { type: ["string", "null"] },
2321
+ companies: {
2322
+ type: "array",
2323
+ items: { type: "object" }
2324
+ },
2325
+ created: {
2326
+ type: "string",
2327
+ format: "date-time"
2328
+ },
2329
+ customFields: {
2330
+ type: ["object", "null"],
2331
+ additionalProperties: true
2332
+ },
2333
+ email: {
2334
+ type: ["string", "null"],
2335
+ format: "email"
2336
+ },
2337
+ isAdmin: { type: "boolean" },
2338
+ lastActivity: { type: ["string", "null"] },
2339
+ name: { type: "string" },
2340
+ url: { type: "string" },
2341
+ userID: { type: ["string", "null"] }
2342
+ },
2343
+ required: [
2344
+ "id",
2345
+ "alias",
2346
+ "avatarURL",
2347
+ "companies",
2348
+ "created",
2349
+ "customFields",
2350
+ "email",
2351
+ "isAdmin",
2352
+ "lastActivity",
2353
+ "name",
2354
+ "url",
2355
+ "userID"
2356
+ ]
2357
+ };
2358
+ const nestedUserSchema = {
2359
+ type: "object",
2360
+ properties: userSchema.properties,
2361
+ required: ["id"]
2362
+ };
2363
+ const nullableNestedUserSchema = {
2364
+ type: ["object", "null"],
2365
+ properties: userSchema.properties,
2366
+ required: ["id"]
2367
+ };
2368
+ const companySchema = {
2369
+ type: "object",
2370
+ properties: {
2371
+ id: { type: "string" },
2372
+ created: {
2373
+ type: "string",
2374
+ format: "date-time"
2375
+ },
2376
+ customFields: {
2377
+ type: "object",
2378
+ additionalProperties: true
2379
+ },
2380
+ domain: { type: ["string", "null"] },
2381
+ memberCount: { type: "number" },
2382
+ monthlySpend: { type: ["number", "null"] },
2383
+ name: { type: "string" }
2384
+ },
2385
+ required: [
2386
+ "id",
2387
+ "created",
2388
+ "customFields",
2389
+ "domain",
2390
+ "memberCount",
2391
+ "monthlySpend",
2392
+ "name"
2393
+ ]
2394
+ };
2395
+ const changeCommentSchema = {
2396
+ type: ["object", "null"],
2397
+ properties: {
2398
+ imageURLs: {
2399
+ type: "array",
2400
+ items: { type: "string" }
2401
+ },
2402
+ value: { type: "string" }
2403
+ }
2404
+ };
2405
+ const postSchema = {
2406
+ type: "object",
2407
+ properties: {
2408
+ id: { type: "string" },
2409
+ author: nullableNestedUserSchema,
2410
+ board: nestedBoardSchema,
2411
+ by: nullableNestedUserSchema,
2412
+ category: nullableReducedCategorySchema,
2413
+ changeComment: changeCommentSchema,
2414
+ clickup: {
2415
+ type: "object",
2416
+ properties: { linkedTasks: {
2417
+ type: "array",
2418
+ items: { type: "object" }
2419
+ } }
2420
+ },
2421
+ commentCount: { type: "number" },
2422
+ created: {
2423
+ type: "string",
2424
+ format: "date-time"
2425
+ },
2426
+ customFields: {
2427
+ type: "array",
2428
+ items: {
2429
+ type: "object",
2430
+ properties: {
2431
+ id: { type: "string" },
2432
+ name: { type: "string" },
2433
+ value: {}
2434
+ },
2435
+ required: [
2436
+ "id",
2437
+ "name",
2438
+ "value"
2439
+ ]
2440
+ }
2441
+ },
2442
+ details: { type: "string" },
2443
+ eta: { type: ["string", "null"] },
2444
+ imageURLs: {
2445
+ type: "array",
2446
+ items: { type: "string" }
2447
+ },
2448
+ jira: {
2449
+ type: "object",
2450
+ properties: { linkedIssues: {
2451
+ type: "array",
2452
+ items: {
2453
+ type: "object",
2454
+ properties: {
2455
+ id: { type: "string" },
2456
+ key: { type: "string" },
2457
+ url: { type: "string" }
2458
+ },
2459
+ required: [
2460
+ "id",
2461
+ "key",
2462
+ "url"
2463
+ ]
2464
+ }
2465
+ } }
2466
+ },
2467
+ linear: {
2468
+ type: "object",
2469
+ properties: { linkedIssueIDs: {
2470
+ type: "array",
2471
+ items: { type: "string" }
2472
+ } }
2473
+ },
2474
+ mergeHistory: {
2475
+ type: "array",
2476
+ items: {
2477
+ type: "object",
2478
+ properties: {
2479
+ created: {
2480
+ type: "string",
2481
+ format: "date-time"
2482
+ },
2483
+ post: {
2484
+ type: "object",
2485
+ properties: {
2486
+ created: {
2487
+ type: "string",
2488
+ format: "date-time"
2489
+ },
2490
+ details: { type: "string" },
2491
+ id: { type: "string" },
2492
+ imageURLs: {
2493
+ type: "array",
2494
+ items: { type: "string" }
2495
+ },
2496
+ title: { type: "string" }
2497
+ },
2498
+ required: ["id"]
2499
+ }
2500
+ },
2501
+ required: ["created", "post"]
2502
+ }
2503
+ },
2504
+ owner: nullableNestedUserSchema,
2505
+ roadmaps: {
2506
+ type: "array",
2507
+ items: { type: "object" }
2508
+ },
2509
+ score: { type: "number" },
2510
+ status: { type: "string" },
2511
+ statusChangedAt: { type: "string" },
2512
+ tags: {
2513
+ type: "array",
2514
+ items: reducedTagSchema
2515
+ },
2516
+ title: { type: "string" },
2517
+ url: { type: "string" }
2518
+ },
2519
+ required: [
2520
+ "id",
2521
+ "author",
2522
+ "board",
2523
+ "by",
2524
+ "category",
2525
+ "commentCount",
2526
+ "created",
2527
+ "customFields",
2528
+ "details",
2529
+ "eta",
2530
+ "imageURLs",
2531
+ "owner",
2532
+ "roadmaps",
2533
+ "score",
2534
+ "status",
2535
+ "statusChangedAt",
2536
+ "tags",
2537
+ "title",
2538
+ "url"
2539
+ ]
2540
+ };
2541
+ const reducedPostSchema = {
2542
+ type: "object",
2543
+ properties: {
2544
+ id: postSchema.properties.id,
2545
+ category: postSchema.properties.category,
2546
+ commentCount: postSchema.properties.commentCount,
2547
+ eta: postSchema.properties.eta,
2548
+ imageURLs: postSchema.properties.imageURLs,
2549
+ jira: postSchema.properties.jira,
2550
+ linear: postSchema.properties.linear,
2551
+ score: postSchema.properties.score,
2552
+ status: postSchema.properties.status,
2553
+ tags: postSchema.properties.tags,
2554
+ title: postSchema.properties.title,
2555
+ url: postSchema.properties.url
2556
+ },
2557
+ required: ["id"]
2558
+ };
2559
+ const commentSchema = {
2560
+ type: "object",
2561
+ properties: {
2562
+ id: { type: "string" },
2563
+ author: nestedUserSchema,
2564
+ board: nestedBoardSchema,
2565
+ created: {
2566
+ type: "string",
2567
+ format: "date-time"
2568
+ },
2569
+ imageURLs: {
2570
+ type: "array",
2571
+ items: { type: "string" }
2572
+ },
2573
+ internal: { type: "boolean" },
2574
+ likeCount: { type: "number" },
2575
+ mentions: {
2576
+ type: "array",
2577
+ items: nestedUserSchema
2578
+ },
2579
+ parentID: { type: ["string", "null"] },
2580
+ post: reducedPostSchema,
2581
+ private: { type: "boolean" },
2582
+ reactions: {
2583
+ type: ["object", "null"],
2584
+ additionalProperties: true
2585
+ },
2586
+ status: { type: ["string", "null"] },
2587
+ value: { type: "string" }
2588
+ },
2589
+ required: [
2590
+ "id",
2591
+ "author",
2592
+ "board",
2593
+ "created",
2594
+ "imageURLs",
2595
+ "internal",
2596
+ "likeCount",
2597
+ "mentions",
2598
+ "parentID",
2599
+ "post",
2600
+ "private",
2601
+ "reactions",
2602
+ "status",
2603
+ "value"
2604
+ ]
2605
+ };
2606
+ const voteSchema = {
2607
+ type: "object",
2608
+ properties: {
2609
+ id: { type: "string" },
2610
+ board: nestedBoardSchema,
2611
+ by: nullableNestedUserSchema,
2612
+ created: {
2613
+ type: "string",
2614
+ format: "date-time"
2615
+ },
2616
+ post: reducedPostSchema,
2617
+ voter: nestedUserSchema,
2618
+ votePriority: {
2619
+ type: "string",
2620
+ enum: [
2621
+ "Nice to have",
2622
+ "Important",
2623
+ "Must have",
2624
+ "No priority"
2625
+ ]
2626
+ },
2627
+ zendeskTicket: {
2628
+ type: ["object", "null"],
2629
+ properties: {
2630
+ id: { type: "string" },
2631
+ created: {
2632
+ type: "string",
2633
+ format: "date-time"
2634
+ },
2635
+ subject: { type: "string" },
2636
+ description: { type: "string" },
2637
+ url: { type: "string" }
2638
+ }
2639
+ }
2640
+ },
2641
+ required: [
2642
+ "id",
2643
+ "board",
2644
+ "by",
2645
+ "created",
2646
+ "post",
2647
+ "voter",
2648
+ "votePriority",
2649
+ "zendeskTicket"
2650
+ ]
2651
+ };
2652
+ const statusChangeSchema = {
2653
+ type: "object",
2654
+ properties: {
2655
+ id: { type: "string" },
2656
+ changeComment: changeCommentSchema,
2657
+ changer: nullableNestedUserSchema,
2658
+ created: {
2659
+ type: "string",
2660
+ format: "date-time"
2661
+ },
2662
+ post: reducedPostSchema,
2663
+ status: { type: "string" }
2664
+ },
2665
+ required: [
2666
+ "id",
2667
+ "changeComment",
2668
+ "changer",
2669
+ "created",
2670
+ "post",
2671
+ "status"
2672
+ ]
2673
+ };
2674
+ const entrySchema = {
2675
+ type: "object",
2676
+ properties: {
2677
+ id: { type: "string" },
2678
+ created: {
2679
+ type: "string",
2680
+ format: "date-time"
2681
+ },
2682
+ labels: {
2683
+ type: "array",
2684
+ items: {
2685
+ type: "object",
2686
+ properties: {
2687
+ id: { type: "string" },
2688
+ created: {
2689
+ type: "string",
2690
+ format: "date-time"
2691
+ },
2692
+ entryCount: { type: "number" },
2693
+ name: { type: "string" },
2694
+ url: { type: "string" }
2695
+ },
2696
+ required: ["id"]
2697
+ }
2698
+ },
2699
+ lastSaved: {
2700
+ type: "string",
2701
+ format: "date-time"
2702
+ },
2703
+ markdownDetails: { type: "string" },
2704
+ plaintextDetails: { type: "string" },
2705
+ posts: {
2706
+ type: "array",
2707
+ items: reducedPostSchema
2708
+ },
2709
+ publishedAt: { type: ["string", "null"] },
2710
+ scheduledFor: { type: ["string", "null"] },
2711
+ reactions: {
2712
+ type: ["object", "null"],
2713
+ additionalProperties: true
2714
+ },
2715
+ status: {
2716
+ type: "string",
2717
+ enum: [
2718
+ "draft",
2719
+ "scheduled",
2720
+ "published"
2721
+ ]
2722
+ },
2723
+ title: { type: "string" },
2724
+ types: {
2725
+ type: "array",
2726
+ items: {
2727
+ type: "string",
2728
+ enum: [
2729
+ "new",
2730
+ "improved",
2731
+ "fixed"
2732
+ ]
2733
+ }
2734
+ },
2735
+ url: { type: "string" }
2736
+ },
2737
+ required: [
2738
+ "id",
2739
+ "created",
2740
+ "labels",
2741
+ "lastSaved",
2742
+ "markdownDetails",
2743
+ "plaintextDetails",
2744
+ "posts",
2745
+ "publishedAt",
2746
+ "scheduledFor",
2747
+ "reactions",
2748
+ "status",
2749
+ "title",
2750
+ "types",
2751
+ "url"
2752
+ ]
2753
+ };
2754
+ //#endregion
2755
+ //#region src/outputSchemas/boards.ts
2756
+ const listBoardsOutputSchema = {
2757
+ type: "object",
2758
+ properties: { boards: {
2759
+ type: "array",
2760
+ items: boardListItemSchema
2761
+ } },
2762
+ required: ["boards"]
2763
+ };
2764
+ const retrieveBoardOutputSchema = boardSchema;
2765
+ //#endregion
2766
+ //#region src/outputSchemas/categories.ts
2767
+ const listCategoriesOutputSchema = {
2768
+ type: "object",
2769
+ properties: {
2770
+ categories: {
2771
+ type: "array",
2772
+ items: categorySchema
2773
+ },
2774
+ hasMore: { type: "boolean" }
2775
+ },
2776
+ required: ["categories", "hasMore"],
2777
+ additionalProperties: true
2778
+ };
2779
+ const retrieveCategoryOutputSchema = categorySchema;
2780
+ const createCategoryOutputSchema = idOnlySchema;
2781
+ const deleteCategoryOutputSchema = successStringSchema;
2782
+ //#endregion
2783
+ //#region src/outputSchemas/comments.ts
2784
+ const listCommentsOutputSchema = {
2785
+ type: "object",
2786
+ properties: {
2787
+ items: {
2788
+ type: "array",
2789
+ items: commentSchema
2790
+ },
2791
+ hasNextPage: { type: "boolean" },
2792
+ cursor: { type: "string" }
2793
+ },
2794
+ required: [
2795
+ "items",
2796
+ "hasNextPage",
2797
+ "cursor"
2798
+ ],
2799
+ additionalProperties: true
2800
+ };
2801
+ const retrieveCommentOutputSchema = commentSchema;
2802
+ const createCommentOutputSchema = idOnlySchema;
2803
+ const deleteCommentOutputSchema = successStringSchema;
2804
+ //#endregion
2805
+ //#region src/outputSchemas/companies.ts
2806
+ const listCompaniesOutputSchema = {
2807
+ type: "object",
2808
+ properties: {
2809
+ companies: {
2810
+ type: "array",
2811
+ items: companySchema
2812
+ },
2813
+ hasNextPage: { type: "boolean" },
2814
+ cursor: { type: "string" }
2815
+ },
2816
+ required: [
2817
+ "companies",
2818
+ "hasNextPage",
2819
+ "cursor"
2820
+ ],
2821
+ additionalProperties: true
2822
+ };
2823
+ const updateCompanyOutputSchema = idOnlySchema;
2824
+ const deleteCompanyOutputSchema = successStringSchema;
2825
+ //#endregion
2826
+ //#region src/outputSchemas/entries.ts
2827
+ const listEntriesOutputSchema = {
2828
+ type: "object",
2829
+ properties: {
2830
+ entries: {
2831
+ type: "array",
2832
+ items: entrySchema
2833
+ },
2834
+ hasMore: { type: "boolean" }
2835
+ },
2836
+ required: ["entries", "hasMore"],
2837
+ additionalProperties: true
2838
+ };
2839
+ const createEntryOutputSchema = idOnlySchema;
2840
+ //#endregion
2841
+ //#region src/outputSchemas/posts.ts
2842
+ const listPostsOutputSchema = {
2843
+ type: "object",
2844
+ properties: {
2845
+ posts: {
2846
+ type: "array",
2847
+ items: postSchema
2848
+ },
2849
+ hasMore: { type: "boolean" }
2850
+ },
2851
+ required: ["posts", "hasMore"],
2852
+ additionalProperties: true
2853
+ };
2854
+ const retrievePostOutputSchema = postSchema;
2855
+ const createPostOutputSchema = idOnlySchema;
2856
+ const updatePostOutputSchema = successStringSchema;
2857
+ const deletePostOutputSchema = successStringSchema;
2858
+ const changePostStatusOutputSchema = postSchema;
2859
+ //#endregion
2860
+ //#region src/outputSchemas/statusChanges.ts
2861
+ const listStatusChangesOutputSchema = {
2862
+ type: "object",
2863
+ properties: {
2864
+ items: {
2865
+ type: "array",
2866
+ items: statusChangeSchema
2867
+ },
2868
+ hasNextPage: { type: "boolean" },
2869
+ cursor: { type: "string" }
2870
+ },
2871
+ required: [
2872
+ "items",
2873
+ "hasNextPage",
2874
+ "cursor"
2875
+ ],
2876
+ additionalProperties: true
2877
+ };
2878
+ //#endregion
2879
+ //#region src/outputSchemas/tags.ts
2880
+ const listTagsOutputSchema = {
2881
+ type: "object",
2882
+ properties: {
2883
+ tags: {
2884
+ type: "array",
2885
+ items: tagSchema
2886
+ },
2887
+ hasMore: { type: "boolean" }
2888
+ },
2889
+ required: ["tags", "hasMore"],
2890
+ additionalProperties: true
2891
+ };
2892
+ const retrieveTagOutputSchema = tagSchema;
2893
+ const createTagOutputSchema = tagSchema;
2894
+ //#endregion
2895
+ //#region src/outputSchemas/users.ts
2896
+ const listUsersOutputSchema = {
2897
+ type: "object",
2898
+ properties: {
2899
+ users: {
2900
+ type: "array",
2901
+ items: userSchema
2902
+ },
2903
+ hasNextPage: { type: "boolean" },
2904
+ cursor: { type: "string" }
2905
+ },
2906
+ required: [
2907
+ "users",
2908
+ "hasNextPage",
2909
+ "cursor"
2910
+ ],
2911
+ additionalProperties: true
2912
+ };
2913
+ const retrieveUserOutputSchema = userSchema;
2914
+ const createOrUpdateUserOutputSchema = idOnlySchema;
2915
+ const deleteUserOutputSchema = successStringSchema;
2916
+ //#endregion
2917
+ //#region src/outputSchemas/votes.ts
2918
+ const listVotesOutputSchema = {
2919
+ type: "object",
2920
+ properties: {
2921
+ items: {
2922
+ type: "array",
2923
+ items: voteSchema
2924
+ },
2925
+ hasNextPage: { type: "boolean" },
2926
+ cursor: { type: "string" }
2927
+ },
2928
+ required: [
2929
+ "items",
2930
+ "hasNextPage",
2931
+ "cursor"
2932
+ ],
2933
+ additionalProperties: true
2934
+ };
2935
+ const retrieveVoteOutputSchema = voteSchema;
2936
+ const createVoteOutputSchema = successStringSchema;
2937
+ const deleteVoteOutputSchema = successStringSchema;
2938
+ //#endregion
2939
+ //#region src/actions/boards/index.ts
2940
+ var boards_default = {
2941
+ listBoards: (0, _prismatic_io_spectral.action)({
2942
+ display: {
2943
+ label: "List Boards",
2944
+ description: "Lists all boards."
2945
+ },
2946
+ inputs: listBoardsInputs,
2947
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
2948
+ type: "actionOutput",
2949
+ schema: listBoardsOutputSchema
2950
+ }),
2951
+ perform: async (context, { connection }) => {
2952
+ return { data: await createClient(connection, context.debug.enabled).post("/boards/list") };
2953
+ },
2954
+ examplePayload: listBoardsExamplePayload
2955
+ }),
2956
+ retrieveBoard: (0, _prismatic_io_spectral.action)({
2957
+ display: {
2958
+ label: "Retrieve Board",
2959
+ description: "Retrieves a single board by ID."
2960
+ },
2961
+ inputs: retrieveBoardInputs,
2962
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
2963
+ type: "actionOutput",
2964
+ schema: retrieveBoardOutputSchema
2965
+ }),
2966
+ perform: async (context, { connection, id }) => {
2967
+ return { data: await createClient(connection, context.debug.enabled).post("/boards/retrieve", { id }) };
2968
+ },
2969
+ examplePayload: retrieveBoardExamplePayload
2970
+ })
2971
+ };
2972
+ //#endregion
2973
+ //#region src/actions/categories/createCategory.ts
2974
+ const createCategory = (0, _prismatic_io_spectral.action)({
2975
+ display: {
2976
+ label: "Create Category",
2977
+ description: "Creates a new category in a board."
2978
+ },
2979
+ inputs: createCategoryInputs,
2980
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
2981
+ type: "actionOutput",
2982
+ schema: createCategoryOutputSchema
2983
+ }),
2984
+ performSafety: "notAllowed",
2985
+ perform: async (context, { connection, boardIdRequired, categoryName, subscribeAdmins, parentCategoryId }) => {
2986
+ return { data: await createClient(connection, context.debug.enabled).post("/categories/create", {
2987
+ boardID: boardIdRequired,
2988
+ name: categoryName,
2989
+ subscribeAdmins,
2990
+ parentID: parentCategoryId
2991
+ }) };
2992
+ },
2993
+ examplePerform: async () => createCategoryExamplePayload,
2994
+ examplePayload: createCategoryExamplePayload
2995
+ });
2996
+ //#endregion
2997
+ //#region src/actions/categories/deleteCategory.ts
2998
+ const deleteCategory = (0, _prismatic_io_spectral.action)({
2999
+ display: {
3000
+ label: "Delete Category",
3001
+ description: "Deletes a category."
3002
+ },
3003
+ inputs: deleteCategoryInputs,
3004
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3005
+ type: "actionOutput",
3006
+ schema: deleteCategoryOutputSchema
3007
+ }),
3008
+ performSafety: "notAllowed",
3009
+ perform: async (context, { connection, categoryIdRequired }) => {
3010
+ return { data: await createClient(connection, context.debug.enabled).post("/categories/delete", { categoryID: categoryIdRequired }) };
3011
+ },
3012
+ examplePerform: async () => deleteCategoryExamplePayload,
3013
+ examplePayload: deleteCategoryExamplePayload
3014
+ });
3015
+ //#endregion
3016
+ //#region src/actions/categories/index.ts
3017
+ var categories_default = {
3018
+ listCategories: (0, _prismatic_io_spectral.action)({
3019
+ display: {
3020
+ label: "List Categories",
3021
+ description: "Lists categories with optional board filter and pagination."
3022
+ },
3023
+ inputs: listCategoriesInputs,
3024
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3025
+ type: "actionOutput",
3026
+ schema: listCategoriesOutputSchema
3027
+ }),
3028
+ performSafety: "notAllowed",
3029
+ perform: async (context, { connection, boardId, fetchAll, pagination }) => {
3030
+ return { data: await paginateOffset(createClient(connection, context.debug.enabled).post, "/categories/list", "categories", {
3031
+ boardID: boardId,
3032
+ limit: pagination.limit,
3033
+ skip: pagination.skip
3034
+ }, fetchAll) };
3035
+ },
3036
+ examplePerform: async () => listCategoriesExamplePayload,
3037
+ examplePayload: listCategoriesExamplePayload
3038
+ }),
3039
+ retrieveCategory: (0, _prismatic_io_spectral.action)({
3040
+ display: {
3041
+ label: "Retrieve Category",
3042
+ description: "Retrieves a single category by ID."
3043
+ },
3044
+ inputs: retrieveCategoryInputs,
3045
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3046
+ type: "actionOutput",
3047
+ schema: retrieveCategoryOutputSchema
3048
+ }),
3049
+ perform: async (context, { connection, categoryIdRequired }) => {
3050
+ return { data: await createClient(connection, context.debug.enabled).post("/categories/retrieve", { id: categoryIdRequired }) };
3051
+ },
3052
+ examplePayload: retrieveCategoryExamplePayload
3053
+ }),
3054
+ createCategory,
3055
+ deleteCategory
3056
+ };
3057
+ //#endregion
3058
+ //#region src/actions/comments/createComment.ts
3059
+ const createComment = (0, _prismatic_io_spectral.action)({
3060
+ display: {
3061
+ label: "Create Comment",
3062
+ description: "Creates a new comment on a post."
3063
+ },
3064
+ inputs: createCommentInputs,
3065
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3066
+ type: "actionOutput",
3067
+ schema: createCommentOutputSchema
3068
+ }),
3069
+ performSafety: "notAllowed",
3070
+ perform: async (context, { connection, postId, commentAuthorId, commentValue, parentId, additionalFields }) => {
3071
+ return { data: await createClient(connection, context.debug.enabled).post("/comments/create", {
3072
+ postID: postId,
3073
+ authorID: commentAuthorId,
3074
+ value: commentValue,
3075
+ internal: additionalFields.internal,
3076
+ parentID: parentId,
3077
+ imageURLs: additionalFields.imageURLs,
3078
+ ...additionalFields.additionalFields
3079
+ }) };
3080
+ },
3081
+ examplePerform: async () => createCommentExamplePayload,
3082
+ examplePayload: createCommentExamplePayload
3083
+ });
3084
+ //#endregion
3085
+ //#region src/actions/comments/deleteComment.ts
3086
+ const deleteComment = (0, _prismatic_io_spectral.action)({
3087
+ display: {
3088
+ label: "Delete Comment",
3089
+ description: "Deletes a comment."
3090
+ },
3091
+ inputs: deleteCommentInputs,
3092
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3093
+ type: "actionOutput",
3094
+ schema: deleteCommentOutputSchema
3095
+ }),
3096
+ performSafety: "notAllowed",
3097
+ perform: async (context, { connection, commentId }) => {
3098
+ return { data: await createClient(connection, context.debug.enabled).post("/comments/delete", { commentID: commentId }) };
3099
+ },
3100
+ examplePerform: async () => deleteCommentExamplePayload,
3101
+ examplePayload: deleteCommentExamplePayload
3102
+ });
3103
+ //#endregion
3104
+ //#region src/actions/comments/index.ts
3105
+ var comments_default = {
3106
+ listComments: (0, _prismatic_io_spectral.action)({
3107
+ display: {
3108
+ label: "List Comments",
3109
+ description: "Lists comments with optional filtering and cursor-based pagination."
3110
+ },
3111
+ inputs: listCommentsInputs,
3112
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3113
+ type: "actionOutput",
3114
+ schema: listCommentsOutputSchema
3115
+ }),
3116
+ performSafety: "notAllowed",
3117
+ perform: async (context, { connection, boardId, postIdOptional, authorId, companyId, fetchAll, pagination }) => {
3118
+ return { data: await paginateCursor(createClient(connection, context.debug.enabled).postV2, "/comments/list", "items", {
3119
+ boardID: boardId,
3120
+ postID: postIdOptional,
3121
+ authorID: authorId,
3122
+ companyID: companyId,
3123
+ cursor: pagination.cursor,
3124
+ limit: pagination.limit
3125
+ }, fetchAll) };
3126
+ },
3127
+ examplePerform: async () => listCommentsExamplePayload,
3128
+ examplePayload: listCommentsExamplePayload
3129
+ }),
3130
+ retrieveComment: (0, _prismatic_io_spectral.action)({
3131
+ display: {
3132
+ label: "Retrieve Comment",
3133
+ description: "Retrieves a single comment by ID."
3134
+ },
3135
+ inputs: retrieveCommentInputs,
3136
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3137
+ type: "actionOutput",
3138
+ schema: retrieveCommentOutputSchema
3139
+ }),
3140
+ perform: async (context, { connection, commentId }) => {
3141
+ return { data: await createClient(connection, context.debug.enabled).post("/comments/retrieve", { id: commentId }) };
3142
+ },
3143
+ examplePayload: retrieveCommentExamplePayload
3144
+ }),
3145
+ createComment,
3146
+ deleteComment
3147
+ };
3148
+ //#endregion
3149
+ //#region src/actions/companies/deleteCompany.ts
3150
+ const deleteCompany = (0, _prismatic_io_spectral.action)({
3151
+ display: {
3152
+ label: "Delete Company",
3153
+ description: "Deletes a company."
3154
+ },
3155
+ inputs: deleteCompanyInputs,
3156
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3157
+ type: "actionOutput",
3158
+ schema: deleteCompanyOutputSchema
3159
+ }),
3160
+ performSafety: "notAllowed",
3161
+ perform: async (context, { connection, companyIdRequired }) => {
3162
+ return { data: await createClient(connection, context.debug.enabled).post("/companies/delete", { companyID: companyIdRequired }) };
3163
+ },
3164
+ examplePerform: async () => deleteCompanyExamplePayload,
3165
+ examplePayload: deleteCompanyExamplePayload
3166
+ });
3167
+ //#endregion
3168
+ //#region src/actions/companies/index.ts
3169
+ var companies_default = {
3170
+ listCompanies: (0, _prismatic_io_spectral.action)({
3171
+ display: {
3172
+ label: "List Companies",
3173
+ description: "Lists companies with cursor-based pagination."
3174
+ },
3175
+ inputs: listCompaniesInputs,
3176
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3177
+ type: "actionOutput",
3178
+ schema: listCompaniesOutputSchema
3179
+ }),
3180
+ performSafety: "notAllowed",
3181
+ perform: async (context, { connection, companySearch, segment, fetchAll, pagination }) => {
3182
+ return { data: await paginateCursor(createClient(connection, context.debug.enabled).postV2, "/companies/list", "companies", {
3183
+ search: companySearch,
3184
+ segment,
3185
+ cursor: pagination.cursor,
3186
+ limit: pagination.limit
3187
+ }, fetchAll) };
3188
+ },
3189
+ examplePerform: async () => listCompaniesExamplePayload,
3190
+ examplePayload: listCompaniesExamplePayload
3191
+ }),
3192
+ updateCompany: (0, _prismatic_io_spectral.action)({
3193
+ display: {
3194
+ label: "Update Company",
3195
+ description: "Updates an existing company."
3196
+ },
3197
+ inputs: updateCompanyInputs,
3198
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3199
+ type: "actionOutput",
3200
+ schema: updateCompanyOutputSchema
3201
+ }),
3202
+ performSafety: "notAllowed",
3203
+ perform: async (context, { connection, companyIdRequired, companyName, additionalFields }) => {
3204
+ return { data: await createClient(connection, context.debug.enabled).post("/companies/update", {
3205
+ id: companyIdRequired,
3206
+ name: companyName,
3207
+ monthlySpend: additionalFields.monthlySpend,
3208
+ customFields: additionalFields.customFields,
3209
+ ...additionalFields.additionalFields
3210
+ }) };
3211
+ },
3212
+ examplePerform: async () => updateCompanyExamplePayload,
3213
+ examplePayload: updateCompanyExamplePayload
3214
+ }),
3215
+ deleteCompany
3216
+ };
3217
+ //#endregion
3218
+ //#region src/actions/entries/createEntry.ts
3219
+ const createEntry = (0, _prismatic_io_spectral.action)({
3220
+ display: {
3221
+ label: "Create Changelog Entry",
3222
+ description: "Creates a new changelog entry."
3223
+ },
3224
+ inputs: createEntryInputs,
3225
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3226
+ type: "actionOutput",
3227
+ schema: createEntryOutputSchema
3228
+ }),
3229
+ performSafety: "notAllowed",
3230
+ perform: async (context, { connection, entryTitle, entryDetails, entryType, additionalFields }) => {
3231
+ return { data: await createClient(connection, context.debug.enabled).post("/entries/create", {
3232
+ title: entryTitle,
3233
+ details: entryDetails,
3234
+ type: entryType,
3235
+ notify: additionalFields.notify,
3236
+ published: additionalFields.published,
3237
+ ...additionalFields.additionalFields
3238
+ }) };
3239
+ },
3240
+ examplePerform: async () => createEntryExamplePayload,
3241
+ examplePayload: createEntryExamplePayload
3242
+ });
3243
+ //#endregion
3244
+ //#region src/actions/entries/index.ts
3245
+ var entries_default = {
3246
+ listEntries: (0, _prismatic_io_spectral.action)({
3247
+ display: {
3248
+ label: "List Changelog Entries",
3249
+ description: "Lists changelog entries with optional filtering."
3250
+ },
3251
+ inputs: listEntriesInputs,
3252
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3253
+ type: "actionOutput",
3254
+ schema: listEntriesOutputSchema
3255
+ }),
3256
+ performSafety: "notAllowed",
3257
+ perform: async (context, { connection, entryType, entrySort, fetchAll, pagination }) => {
3258
+ return { data: await paginateOffset(createClient(connection, context.debug.enabled).post, "/entries/list", "entries", {
3259
+ type: entryType,
3260
+ sort: entrySort,
3261
+ limit: pagination.limit,
3262
+ skip: pagination.skip
3263
+ }, fetchAll) };
3264
+ },
3265
+ examplePerform: async () => listEntriesExamplePayload,
3266
+ examplePayload: listEntriesExamplePayload
3267
+ }),
3268
+ createEntry
3269
+ };
3270
+ //#endregion
3271
+ //#region src/actions/misc/index.ts
3272
+ var misc_default = { rawRequest: (0, _prismatic_io_spectral.action)({
3273
+ display: {
3274
+ label: "Raw Request",
3275
+ description: "Sends a raw HTTP request to the Canny API. The API key is injected automatically into the request body."
3276
+ },
3277
+ inputs: rawRequestInputs,
3278
+ performSafety: "notAllowed",
3279
+ perform: async (context, { connection, ...httpInputs }) => {
3280
+ const apiKey = validateConnection(connection);
3281
+ const existingBody = httpInputs.data ? JSON.parse(httpInputs.data) : {};
3282
+ const dataWithApiKey = JSON.stringify({
3283
+ apiKey,
3284
+ ...existingBody
3285
+ });
3286
+ const { data } = await (0, _prismatic_io_spectral_http.sendRawRequest)("https://canny.io/api", {
3287
+ ...httpInputs,
3288
+ data: dataWithApiKey,
3289
+ debugRequest: context.debug.enabled
3290
+ }, { "Content-Type": "application/json" });
3291
+ return { data };
3292
+ }
3293
+ }) };
3294
+ //#endregion
3295
+ //#region src/actions/posts/changePostStatus.ts
3296
+ const changePostStatus = (0, _prismatic_io_spectral.action)({
3297
+ display: {
3298
+ label: "Change Post Status",
3299
+ description: "Changes the status of a post."
3300
+ },
3301
+ inputs: changePostStatusInputs,
3302
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3303
+ type: "actionOutput",
3304
+ schema: changePostStatusOutputSchema
3305
+ }),
3306
+ performSafety: "notAllowed",
3307
+ perform: async (context, { connection, postId, statusRequired, changerId, shouldNotifyVoters, postCommentValue, additionalFields }) => {
3308
+ return { data: await createClient(connection, context.debug.enabled).post("/posts/change_status", {
3309
+ postID: postId,
3310
+ status: statusRequired,
3311
+ changerID: changerId,
3312
+ shouldNotifyVoters,
3313
+ commentValue: postCommentValue,
3314
+ ...additionalFields
3315
+ }) };
3316
+ },
3317
+ examplePerform: async (_context, { postId, statusRequired, postCommentValue }) => ({ data: {
3318
+ ...changePostStatusExamplePayload.data,
3319
+ id: postId,
3320
+ status: statusRequired,
3321
+ changeComment: postCommentValue ? {
3322
+ ...changePostStatusExamplePayload.data.changeComment,
3323
+ value: postCommentValue
3324
+ } : changePostStatusExamplePayload.data.changeComment
3325
+ } }),
3326
+ examplePayload: changePostStatusExamplePayload
3327
+ });
3328
+ //#endregion
3329
+ //#region src/actions/posts/createPost.ts
3330
+ const createPost = (0, _prismatic_io_spectral.action)({
3331
+ display: {
3332
+ label: "Create Post",
3333
+ description: "Creates a new feedback post."
3334
+ },
3335
+ inputs: createPostInputs,
3336
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3337
+ type: "actionOutput",
3338
+ schema: createPostOutputSchema
3339
+ }),
3340
+ performSafety: "notAllowed",
3341
+ perform: async (context, { connection, boardIdRequired, authorIdRequired, title, details, categoryId, additionalFields }) => {
3342
+ return { data: await createClient(connection, context.debug.enabled).post("/posts/create", {
3343
+ authorID: authorIdRequired,
3344
+ boardID: boardIdRequired,
3345
+ title,
3346
+ details,
3347
+ categoryID: categoryId,
3348
+ customFields: additionalFields.customFields,
3349
+ eta: additionalFields.eta,
3350
+ etaPublic: additionalFields.etaPublic,
3351
+ imageURLs: additionalFields.imageURLs,
3352
+ ...additionalFields.additionalFields
3353
+ }) };
3354
+ },
3355
+ examplePerform: async () => createPostExamplePayload,
3356
+ examplePayload: createPostExamplePayload
3357
+ });
3358
+ //#endregion
3359
+ //#region src/actions/posts/deletePost.ts
3360
+ const deletePost = (0, _prismatic_io_spectral.action)({
3361
+ display: {
3362
+ label: "Delete Post",
3363
+ description: "Deletes a post."
3364
+ },
3365
+ inputs: deletePostInputs,
3366
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3367
+ type: "actionOutput",
3368
+ schema: deletePostOutputSchema
3369
+ }),
3370
+ performSafety: "notAllowed",
3371
+ perform: async (context, { connection, postId }) => {
3372
+ return { data: await createClient(connection, context.debug.enabled).post("/posts/delete", { postID: postId }) };
3373
+ },
3374
+ examplePerform: async () => deletePostExamplePayload,
3375
+ examplePayload: deletePostExamplePayload
3376
+ });
3377
+ //#endregion
3378
+ //#region src/actions/posts/index.ts
3379
+ var posts_default = {
3380
+ listPosts: (0, _prismatic_io_spectral.action)({
3381
+ display: {
3382
+ label: "List Posts",
3383
+ description: "Lists posts with optional filtering and pagination."
3384
+ },
3385
+ inputs: listPostsInputs,
3386
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3387
+ type: "actionOutput",
3388
+ schema: listPostsOutputSchema
3389
+ }),
3390
+ performSafety: "notAllowed",
3391
+ perform: async (context, { connection, boardId, authorId, companyId, tagIDs, fetchAll, pagination, listControls }) => {
3392
+ return { data: await paginateOffset(createClient(connection, context.debug.enabled).post, "/posts/list", "posts", {
3393
+ boardID: boardId,
3394
+ authorID: authorId,
3395
+ companyID: companyId,
3396
+ tagIDs,
3397
+ limit: pagination.limit,
3398
+ skip: pagination.skip,
3399
+ search: listControls.search,
3400
+ sort: listControls.sort,
3401
+ status: listControls.status
3402
+ }, fetchAll) };
3403
+ },
3404
+ examplePerform: async () => listPostsExamplePayload,
3405
+ examplePayload: listPostsExamplePayload
3406
+ }),
3407
+ retrievePost: (0, _prismatic_io_spectral.action)({
3408
+ display: {
3409
+ label: "Retrieve Post",
3410
+ description: "Retrieves a single post by ID."
3411
+ },
3412
+ inputs: retrievePostInputs,
3413
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3414
+ type: "actionOutput",
3415
+ schema: retrievePostOutputSchema
3416
+ }),
3417
+ perform: async (context, { connection, postId }) => {
3418
+ return { data: await createClient(connection, context.debug.enabled).post("/posts/retrieve", { id: postId }) };
3419
+ },
3420
+ examplePayload: retrievePostExamplePayload
3421
+ }),
3422
+ createPost,
3423
+ updatePost: (0, _prismatic_io_spectral.action)({
3424
+ display: {
3425
+ label: "Update Post",
3426
+ description: "Updates an existing post."
3427
+ },
3428
+ inputs: updatePostInputs,
3429
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3430
+ type: "actionOutput",
3431
+ schema: updatePostOutputSchema
3432
+ }),
3433
+ performSafety: "notAllowed",
3434
+ perform: async (context, { connection, postId, titleOptional, detailsOptional, additionalFields }) => {
3435
+ return { data: await createClient(connection, context.debug.enabled).post("/posts/update", {
3436
+ postID: postId,
3437
+ title: titleOptional,
3438
+ details: detailsOptional,
3439
+ customFields: additionalFields.customFields,
3440
+ eta: additionalFields.eta,
3441
+ imageURLs: additionalFields.imageURLs,
3442
+ ...additionalFields.additionalFields
3443
+ }) };
3444
+ },
3445
+ examplePerform: async () => updatePostExamplePayload,
3446
+ examplePayload: updatePostExamplePayload
3447
+ }),
3448
+ deletePost,
3449
+ changePostStatus
3450
+ };
3451
+ //#endregion
3452
+ //#region src/actions/statusChanges/index.ts
3453
+ var statusChanges_default = { listStatusChanges: (0, _prismatic_io_spectral.action)({
3454
+ display: {
3455
+ label: "List Status Changes",
3456
+ description: "Lists post status changes with optional filtering and cursor-based pagination."
3457
+ },
3458
+ inputs: listStatusChangesInputs,
3459
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3460
+ type: "actionOutput",
3461
+ schema: listStatusChangesOutputSchema
3462
+ }),
3463
+ performSafety: "notAllowed",
3464
+ perform: async (context, { connection, boardId, fetchAll, pagination }) => {
3465
+ return { data: await paginateCursor(createClient(connection, context.debug.enabled).postV2, "/status_changes/list", "items", {
3466
+ boardID: boardId,
3467
+ cursor: pagination.cursor,
3468
+ limit: pagination.limit
3469
+ }, fetchAll) };
3470
+ },
3471
+ examplePerform: async () => listStatusChangesExamplePayload,
3472
+ examplePayload: listStatusChangesExamplePayload
3473
+ }) };
3474
+ //#endregion
3475
+ //#region src/actions/tags/createTag.ts
3476
+ const createTag = (0, _prismatic_io_spectral.action)({
3477
+ display: {
3478
+ label: "Create Tag",
3479
+ description: "Creates a new tag in a board."
3480
+ },
3481
+ inputs: createTagInputs,
3482
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3483
+ type: "actionOutput",
3484
+ schema: createTagOutputSchema
3485
+ }),
3486
+ performSafety: "notAllowed",
3487
+ perform: async (context, { connection, boardIdRequired, tagName }) => {
3488
+ return { data: await createClient(connection, context.debug.enabled).post("/tags/create", {
3489
+ boardID: boardIdRequired,
3490
+ name: tagName
3491
+ }) };
3492
+ },
3493
+ examplePerform: async (_context, { tagName }) => {
3494
+ const slug = tagName.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
3495
+ const [boardUrl] = createTagExamplePayload.data.url.split("?");
3496
+ return { data: {
3497
+ ...createTagExamplePayload.data,
3498
+ name: tagName,
3499
+ url: `${boardUrl}?tag=${slug}`
3500
+ } };
3501
+ },
3502
+ examplePayload: createTagExamplePayload
3503
+ });
3504
+ //#endregion
3505
+ //#region src/actions/tags/index.ts
3506
+ var tags_default = {
3507
+ listTags: (0, _prismatic_io_spectral.action)({
3508
+ display: {
3509
+ label: "List Tags",
3510
+ description: "Lists tags with optional board filter and pagination."
3511
+ },
3512
+ inputs: listTagsInputs,
3513
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3514
+ type: "actionOutput",
3515
+ schema: listTagsOutputSchema
3516
+ }),
3517
+ performSafety: "notAllowed",
3518
+ perform: async (context, { connection, boardId, fetchAll, pagination }) => {
3519
+ return { data: await paginateOffset(createClient(connection, context.debug.enabled).post, "/tags/list", "tags", {
3520
+ boardID: boardId,
3521
+ limit: pagination.limit,
3522
+ skip: pagination.skip
3523
+ }, fetchAll) };
3524
+ },
3525
+ examplePerform: async () => listTagsExamplePayload,
3526
+ examplePayload: listTagsExamplePayload
3527
+ }),
3528
+ retrieveTag: (0, _prismatic_io_spectral.action)({
3529
+ display: {
3530
+ label: "Retrieve Tag",
3531
+ description: "Retrieves a single tag by ID."
3532
+ },
3533
+ inputs: retrieveTagInputs,
3534
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3535
+ type: "actionOutput",
3536
+ schema: retrieveTagOutputSchema
3537
+ }),
3538
+ perform: async (context, { connection, tagId }) => {
3539
+ return { data: await createClient(connection, context.debug.enabled).post("/tags/retrieve", { id: tagId }) };
3540
+ },
3541
+ examplePayload: retrieveTagExamplePayload
3542
+ }),
3543
+ createTag
3544
+ };
3545
+ //#endregion
3546
+ //#region src/actions/users/createOrUpdateUser.ts
3547
+ const createOrUpdateUser = (0, _prismatic_io_spectral.action)({
3548
+ display: {
3549
+ label: "Create or Update User",
3550
+ description: "Creates a new user or updates an existing one by email."
3551
+ },
3552
+ inputs: createOrUpdateUserInputs,
3553
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3554
+ type: "actionOutput",
3555
+ schema: createOrUpdateUserOutputSchema
3556
+ }),
3557
+ performSafety: "notAllowed",
3558
+ perform: async (context, { connection, userEmail, userName, userId, additionalFields }) => {
3559
+ return { data: await createClient(connection, context.debug.enabled).post("/users/create_or_update", {
3560
+ email: userEmail,
3561
+ name: userName,
3562
+ userID: userId,
3563
+ companies: additionalFields.companies,
3564
+ customFields: additionalFields.customFields,
3565
+ ...additionalFields.additionalFields
3566
+ }) };
3567
+ },
3568
+ examplePerform: async () => createOrUpdateUserExamplePayload,
3569
+ examplePayload: createOrUpdateUserExamplePayload
3570
+ });
3571
+ //#endregion
3572
+ //#region src/actions/users/deleteUser.ts
3573
+ const deleteUser = (0, _prismatic_io_spectral.action)({
3574
+ display: {
3575
+ label: "Delete User",
3576
+ description: "Deletes a user."
3577
+ },
3578
+ inputs: deleteUserInputs,
3579
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3580
+ type: "actionOutput",
3581
+ schema: deleteUserOutputSchema
3582
+ }),
3583
+ performSafety: "notAllowed",
3584
+ perform: async (context, { connection, userId }) => {
3585
+ return { data: await createClient(connection, context.debug.enabled).post("/users/delete", { userID: userId }) };
3586
+ },
3587
+ examplePerform: async () => deleteUserExamplePayload,
3588
+ examplePayload: deleteUserExamplePayload
3589
+ });
3590
+ //#endregion
3591
+ //#region src/actions/users/index.ts
3592
+ var users_default = {
3593
+ listUsers: (0, _prismatic_io_spectral.action)({
3594
+ display: {
3595
+ label: "List Users",
3596
+ description: "Lists users with cursor-based pagination."
3597
+ },
3598
+ inputs: listUsersInputs,
3599
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3600
+ type: "actionOutput",
3601
+ schema: listUsersOutputSchema
3602
+ }),
3603
+ performSafety: "notAllowed",
3604
+ perform: async (context, { connection, fetchAll, pagination }) => {
3605
+ return { data: await paginateCursor(createClient(connection, context.debug.enabled).postV2, "/users/list", "users", {
3606
+ cursor: pagination.cursor,
3607
+ limit: pagination.limit
3608
+ }, fetchAll) };
3609
+ },
3610
+ examplePerform: async () => listUsersExamplePayload,
3611
+ examplePayload: listUsersExamplePayload
3612
+ }),
3613
+ retrieveUser: (0, _prismatic_io_spectral.action)({
3614
+ display: {
3615
+ label: "Retrieve User",
3616
+ description: "Retrieves a single user by ID."
3617
+ },
3618
+ inputs: retrieveUserInputs,
3619
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3620
+ type: "actionOutput",
3621
+ schema: retrieveUserOutputSchema
3622
+ }),
3623
+ perform: async (context, { connection, userId }) => {
3624
+ return { data: await createClient(connection, context.debug.enabled).post("/users/retrieve", { id: userId }) };
3625
+ },
3626
+ examplePayload: retrieveUserExamplePayload
3627
+ }),
3628
+ createOrUpdateUser,
3629
+ deleteUser
3630
+ };
3631
+ //#endregion
3632
+ //#region src/actions/votes/createVote.ts
3633
+ const createVote = (0, _prismatic_io_spectral.action)({
3634
+ display: {
3635
+ label: "Create Vote",
3636
+ description: "Creates a vote on a post."
3637
+ },
3638
+ inputs: createVoteInputs,
3639
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3640
+ type: "actionOutput",
3641
+ schema: createVoteOutputSchema
3642
+ }),
3643
+ performSafety: "notAllowed",
3644
+ perform: async (context, { connection, postId, voterId, additionalFields }) => {
3645
+ return { data: await createClient(connection, context.debug.enabled).post("/votes/create", {
3646
+ postID: postId,
3647
+ voterID: voterId,
3648
+ ...additionalFields
3649
+ }) };
3650
+ },
3651
+ examplePerform: async () => createVoteExamplePayload,
3652
+ examplePayload: createVoteExamplePayload
3653
+ });
3654
+ //#endregion
3655
+ //#region src/actions/votes/deleteVote.ts
3656
+ const deleteVote = (0, _prismatic_io_spectral.action)({
3657
+ display: {
3658
+ label: "Delete Vote",
3659
+ description: "Deletes a vote."
3660
+ },
3661
+ inputs: deleteVoteInputs,
3662
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3663
+ type: "actionOutput",
3664
+ schema: deleteVoteOutputSchema
3665
+ }),
3666
+ performSafety: "notAllowed",
3667
+ perform: async (context, { connection, voteId }) => {
3668
+ return { data: await createClient(connection, context.debug.enabled).post("/votes/delete", { voteID: voteId }) };
3669
+ },
3670
+ examplePerform: async () => deleteVoteExamplePayload,
3671
+ examplePayload: deleteVoteExamplePayload
3672
+ });
3673
+ //#endregion
3674
+ //#region src/actions/votes/index.ts
3675
+ var votes_default = {
3676
+ listVotes: (0, _prismatic_io_spectral.action)({
3677
+ display: {
3678
+ label: "List Votes",
3679
+ description: "Lists votes with optional filtering and cursor-based pagination (v2)."
3680
+ },
3681
+ inputs: listVotesInputs,
3682
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3683
+ type: "actionOutput",
3684
+ schema: listVotesOutputSchema
3685
+ }),
3686
+ performSafety: "notAllowed",
3687
+ perform: async (context, { connection, boardId, postIdOptional, companyId, userIdOptional, fetchAll, pagination }) => {
3688
+ return { data: await paginateCursor(createClient(connection, context.debug.enabled).postV2, "/votes/list", "items", {
3689
+ boardID: boardId,
3690
+ postID: postIdOptional,
3691
+ companyID: companyId,
3692
+ userID: userIdOptional,
3693
+ cursor: pagination.cursor,
3694
+ limit: pagination.limit
3695
+ }, fetchAll) };
3696
+ },
3697
+ examplePerform: async () => listVotesExamplePayload,
3698
+ examplePayload: listVotesExamplePayload
3699
+ }),
3700
+ retrieveVote: (0, _prismatic_io_spectral.action)({
3701
+ display: {
3702
+ label: "Retrieve Vote",
3703
+ description: "Retrieves a single vote by ID."
3704
+ },
3705
+ inputs: retrieveVoteInputs,
3706
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3707
+ type: "actionOutput",
3708
+ schema: retrieveVoteOutputSchema
3709
+ }),
3710
+ perform: async (context, { connection, voteId }) => {
3711
+ return { data: await createClient(connection, context.debug.enabled).post("/votes/retrieve", { id: voteId }) };
3712
+ },
3713
+ examplePayload: retrieveVoteExamplePayload
3714
+ }),
3715
+ createVote,
3716
+ deleteVote
3717
+ };
3718
+ //#endregion
3719
+ //#region src/actions/index.ts
3720
+ var actions_default = {
3721
+ ...boards_default,
3722
+ ...posts_default,
3723
+ ...comments_default,
3724
+ ...votes_default,
3725
+ ...categories_default,
3726
+ ...tags_default,
3727
+ ...users_default,
3728
+ ...companies_default,
3729
+ ...statusChanges_default,
3730
+ ...entries_default,
3731
+ ...misc_default
3732
+ };
3733
+ //#endregion
3734
+ //#region src/dataSources/index.ts
3735
+ var dataSources_default = {
3736
+ selectBoard: (0, _prismatic_io_spectral.dataSource)({
3737
+ display: {
3738
+ label: "Select Board",
3739
+ description: "Selects a board from the Canny account."
3740
+ },
3741
+ dataSourceType: "picklist",
3742
+ inputs: selectBoardInputs,
3743
+ perform: async (_context, { connection }) => {
3744
+ return { result: toSortedPicklist((await createClient(connection, false).post("/boards/list")).boards, (b) => b.name, (b) => b.id) };
3745
+ },
3746
+ examplePayload: selectBoardExamplePayload
3747
+ }),
3748
+ selectCategory: (0, _prismatic_io_spectral.dataSource)({
3749
+ display: {
3750
+ label: "Select Category",
3751
+ description: "Selects a category from the Canny account."
3752
+ },
3753
+ dataSourceType: "picklist",
3754
+ inputs: selectCategoryInputs,
3755
+ perform: async (_context, { connection, boardId }) => {
3756
+ return { result: toSortedPicklist((await paginateOffset(createClient(connection, false).post, "/categories/list", "categories", { boardID: boardId }, true)).categories, (c) => c.name, (c) => c.id) };
3757
+ },
3758
+ examplePayload: selectCategoryExamplePayload
3759
+ }),
3760
+ selectCompany: (0, _prismatic_io_spectral.dataSource)({
3761
+ display: {
3762
+ label: "Select Company",
3763
+ description: "Selects a company from the Canny account."
3764
+ },
3765
+ dataSourceType: "picklist",
3766
+ inputs: selectCompanyInputs,
3767
+ perform: async (_context, { connection }) => {
3768
+ return { result: toSortedPicklist((await paginateCursor(createClient(connection, false).postV2, "/companies/list", "companies", {}, true)).companies, (c) => c.name, (c) => c.id) };
3769
+ },
3770
+ examplePayload: selectCompanyExamplePayload
3771
+ }),
3772
+ selectPost: (0, _prismatic_io_spectral.dataSource)({
3773
+ display: {
3774
+ label: "Select Post",
3775
+ description: "Selects a post from the Canny account."
3776
+ },
3777
+ dataSourceType: "picklist",
3778
+ inputs: selectPostInputs,
3779
+ perform: async (_context, { connection, boardId }) => {
3780
+ return { result: toSortedPicklist((await paginateOffset(createClient(connection, false).post, "/posts/list", "posts", { boardID: boardId }, true)).posts, (p) => p.title, (p) => p.id) };
3781
+ },
3782
+ examplePayload: selectPostExamplePayload
3783
+ }),
3784
+ selectTag: (0, _prismatic_io_spectral.dataSource)({
3785
+ display: {
3786
+ label: "Select Tag",
3787
+ description: "Selects a tag from the Canny account."
3788
+ },
3789
+ dataSourceType: "picklist",
3790
+ inputs: selectTagInputs,
3791
+ perform: async (_context, { connection, boardId }) => {
3792
+ return { result: toSortedPicklist((await paginateOffset(createClient(connection, false).post, "/tags/list", "tags", { boardID: boardId }, true)).tags, (t) => t.name, (t) => t.id) };
3793
+ },
3794
+ examplePayload: selectTagExamplePayload
3795
+ }),
3796
+ selectUser: (0, _prismatic_io_spectral.dataSource)({
3797
+ display: {
3798
+ label: "Select User",
3799
+ description: "Selects a user from the Canny account."
3800
+ },
3801
+ dataSourceType: "picklist",
3802
+ inputs: selectUserInputs,
3803
+ perform: async (_context, { connection }) => {
3804
+ return { result: toSortedPicklist((await paginateCursor(createClient(connection, false).postV2, "/users/list", "users", {}, true)).users, (u) => `${u.name} (${u.email})`, (u) => u.id) };
3805
+ },
3806
+ examplePayload: selectUserExamplePayload
3807
+ })
3808
+ };
3809
+ //#endregion
3810
+ //#region src/triggers/pollChangesTrigger.ts
3811
+ const pollChangesTrigger = (0, _prismatic_io_spectral.pollingTrigger)({
3812
+ display: {
3813
+ label: "New and Updated Posts",
3814
+ description: "Retrieves existing and ongoing posts from Canny. Load history once, check for changes on a schedule, or both."
3815
+ },
3816
+ inputs: pollPostsInputs,
3817
+ triggerResolverSupport: "valid",
3818
+ batchConfig: { batchSize: 50 },
3819
+ triggerResolver: { resolveItems: (_context, { payload }) => resolvePostChanges(payload.body.data) },
3820
+ perform: async (context, payload, params) => {
3821
+ const pollState = context.polling.getState();
3822
+ const now = (/* @__PURE__ */ new Date()).toISOString();
3823
+ const isInitialSync = !pollState?.lastPolledAt;
3824
+ if (isInitialSync && !params.lookBackDate) {
3825
+ context.polling.setState({ lastPolledAt: now });
3826
+ return {
3827
+ payload: {
3828
+ ...payload,
3829
+ body: { data: {
3830
+ created: [],
3831
+ updated: []
3832
+ } }
3833
+ },
3834
+ polledNoChanges: true
3835
+ };
3836
+ }
3837
+ const since = pollState?.lastPolledAt ?? params.lookBackDate;
3838
+ const { posts } = await paginateOffset(createClient(params.connection, context.debug.enabled).post, "/posts/list", "posts", {}, true);
3839
+ const { created, updated } = collectPostChanges(posts, since, {
3840
+ isInitialSync,
3841
+ showNewRecords: params.showNewRecords,
3842
+ showUpdatedRecords: params.showUpdatedRecords
3843
+ });
3844
+ context.polling.setState({ lastPolledAt: now });
3845
+ if (context.debug.enabled) context.logger.debug(`Polled Canny posts: ${posts.length} fetched, ${created.length} created, ${updated.length} updated`);
3846
+ return {
3847
+ payload: {
3848
+ ...payload,
3849
+ body: { data: {
3850
+ created,
3851
+ updated
3852
+ } }
3853
+ },
3854
+ polledNoChanges: created.length + updated.length === 0
3855
+ };
3856
+ },
3857
+ examplePayload: pollChangesTriggerExamplePayload
3858
+ });
3859
+ //#endregion
3860
+ //#region src/triggers/index.ts
3861
+ var triggers_default = {
3862
+ webhook: (0, _prismatic_io_spectral.trigger)({
3863
+ display: {
3864
+ label: "Webhook",
3865
+ description: "Receives webhook events from Canny when configured events occur."
3866
+ },
3867
+ inputs: webhookInputs,
3868
+ perform: async (context, payload, { connection }) => {
3869
+ if (context.isSimulatedTestExecution) return { payload };
3870
+ const apiKey = validateConnection(connection);
3871
+ const headers = _prismatic_io_spectral.util.types.lowerCaseHeaders(payload.headers);
3872
+ const nonce = _prismatic_io_spectral.util.types.toString(headers["canny-nonce"]);
3873
+ if (_prismatic_io_spectral.util.types.toString(headers["canny-signature"]) !== node_crypto.default.createHmac("sha256", apiKey).update(nonce).digest("base64")) throw new Error("Invalid Canny webhook signature");
3874
+ return { payload };
3875
+ },
3876
+ synchronousResponseSupport: "invalid",
3877
+ scheduleSupport: "invalid",
3878
+ examplePayload: webhookExamplePayload
3879
+ }),
3880
+ pollChangesTrigger
3881
+ };
3882
+ //#endregion
3883
+ //#region src/index.ts
3884
+ var src_default = (0, _prismatic_io_spectral.component)({
3885
+ key: "canny",
3886
+ public: true,
3887
+ documentationUrl: "https://prismatic.io/docs/components/canny/",
3888
+ display: {
3889
+ label: "Canny",
3890
+ description: "Interact with the Canny API to manage feedback boards, posts, votes, comments, and users.",
3891
+ iconPath: "icon.png",
3892
+ category: "Application Connectors"
3893
+ },
3894
+ hooks: { error: _prismatic_io_spectral_http.handleErrors },
3895
+ actions: actions_default,
3896
+ connections: connections_default,
3897
+ triggers: triggers_default,
3898
+ dataSources: dataSources_default
3899
+ });
3900
+ //#endregion
3901
+ //#region npm-dist/.entry.ts
3902
+ var _entry_default = (0, _prismatic_io_spectral.callableComponent)(src_default);
3903
+ //#endregion
3904
+ module.exports = _entry_default;