@trigger.dev/linear 3.3.12 → 4.8.0-webhooks.20261020092920

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js DELETED
@@ -1,3618 +0,0 @@
1
- 'use strict';
2
-
3
- var sdk$1 = require('@trigger.dev/sdk');
4
- var sdk = require('@linear/sdk');
5
- var zod = require('zod');
6
- var node_buffer = require('node:buffer');
7
-
8
- var __defProp = Object.defineProperty;
9
- var __export = (target, all) => {
10
- for (var name in all)
11
- __defProp(target, name, { get: all[name], enumerable: true });
12
- };
13
- var __accessCheck = (obj, member, msg) => {
14
- if (!member.has(obj))
15
- throw TypeError("Cannot " + msg);
16
- };
17
- var __privateGet = (obj, member, getter) => {
18
- __accessCheck(obj, member, "read from private field");
19
- return getter ? getter.call(obj) : member.get(obj);
20
- };
21
- var __privateAdd = (obj, member, value) => {
22
- if (member.has(obj))
23
- throw TypeError("Cannot add the same private member more than once");
24
- member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
25
- };
26
-
27
- // src/events.ts
28
- var events_exports = {};
29
- __export(events_exports, {
30
- onAttachment: () => onAttachment,
31
- onAttachmentCreated: () => onAttachmentCreated,
32
- onAttachmentRemoved: () => onAttachmentRemoved,
33
- onAttachmentUpdated: () => onAttachmentUpdated,
34
- onComment: () => onComment,
35
- onCommentCreated: () => onCommentCreated,
36
- onCommentRemoved: () => onCommentRemoved,
37
- onCommentUpdated: () => onCommentUpdated,
38
- onCycle: () => onCycle,
39
- onCycleCreated: () => onCycleCreated,
40
- onCycleRemoved: () => onCycleRemoved,
41
- onCycleUpdated: () => onCycleUpdated,
42
- onIssue: () => onIssue,
43
- onIssueCreated: () => onIssueCreated,
44
- onIssueLabel: () => onIssueLabel,
45
- onIssueLabelCreated: () => onIssueLabelCreated,
46
- onIssueLabelRemoved: () => onIssueLabelRemoved,
47
- onIssueLabelUpdated: () => onIssueLabelUpdated,
48
- onIssueRemoved: () => onIssueRemoved,
49
- onIssueSLA: () => onIssueSLA,
50
- onIssueSLABreached: () => onIssueSLABreached,
51
- onIssueSLAHighRisk: () => onIssueSLAHighRisk,
52
- onIssueSLASet: () => onIssueSLASet,
53
- onIssueUpdated: () => onIssueUpdated,
54
- onProject: () => onProject,
55
- onProjectCreated: () => onProjectCreated,
56
- onProjectRemoved: () => onProjectRemoved,
57
- onProjectUpdate: () => onProjectUpdate,
58
- onProjectUpdateCreated: () => onProjectUpdateCreated,
59
- onProjectUpdateRemoved: () => onProjectUpdateRemoved,
60
- onProjectUpdateUpdated: () => onProjectUpdateUpdated,
61
- onProjectUpdated: () => onProjectUpdated,
62
- onReaction: () => onReaction,
63
- onReactionCreated: () => onReactionCreated,
64
- onReactionRemoved: () => onReactionRemoved,
65
- onReactionUpdated: () => onReactionUpdated
66
- });
67
-
68
- // src/payload-examples/AttachmentCreated.json
69
- var AttachmentCreated_default = {
70
- data: {
71
- id: "8a4c109b-3288-4bef-8a80-8c1618e0f4ad",
72
- url: "https://www.rickastley.co.uk/",
73
- title: "My Personal Website",
74
- source: {
75
- type: "api",
76
- imageUrl: "https://uploads.linear.app/attachment-icons/6fca65e5bca9d4ac8eb9d9442c5e3170081f0aa3eb820eebd58766b53fe7236c"
77
- },
78
- issueId: "ee4d5612-0752-441a-95cd-2a0de56689d3",
79
- metadata: {},
80
- subtitle: "Rick Astley Official Site",
81
- createdAt: "2023-09-17T10:51:34.932Z",
82
- creatorId: "b552c442-62c9-40da-9932-ed8cb6e15a3f",
83
- updatedAt: "2023-09-17T10:51:34.932Z",
84
- sourceType: "api",
85
- groupBySource: false
86
- },
87
- type: "Attachment",
88
- action: "create",
89
- createdAt: "2023-09-17T10:51:34.932Z",
90
- webhookId: "d617c08b-47b6-4b09-a611-2e2f6d8fb99f",
91
- organizationId: "7c0221e0-76d2-45eb-b803-6163c046c534",
92
- webhookTimestamp: "2023-09-17T10:51:37.795Z"
93
- };
94
-
95
- // src/payload-examples/AttachmentRemoved.json
96
- var AttachmentRemoved_default = {
97
- data: {
98
- id: "8a4c109b-3288-4bef-8a80-8c1618e0f4ad",
99
- url: "https://www.rickastley.co.uk/",
100
- title: "Will Never Give You Up",
101
- source: {
102
- type: "api",
103
- imageUrl: "https://uploads.linear.app/attachment-icons/6fca65e5bca9d4ac8eb9d9442c5e3170081f0aa3eb820eebd58766b53fe7236c"
104
- },
105
- issueId: "ee4d5612-0752-441a-95cd-2a0de56689d3",
106
- metadata: {},
107
- subtitle: "Rick Astley Official Site",
108
- createdAt: "2023-09-17T10:51:34.932Z",
109
- creatorId: "b552c442-62c9-40da-9932-ed8cb6e15a3f",
110
- updatedAt: "2023-09-17T10:51:55.751Z",
111
- sourceType: "api",
112
- groupBySource: false
113
- },
114
- type: "Attachment",
115
- action: "remove",
116
- createdAt: "2023-09-17T10:52:15.457Z",
117
- webhookId: "d617c08b-47b6-4b09-a611-2e2f6d8fb99f",
118
- organizationId: "7c0221e0-76d2-45eb-b803-6163c046c534",
119
- webhookTimestamp: "2023-09-17T10:52:15.938Z"
120
- };
121
-
122
- // src/payload-examples/AttachmentUpdated.json
123
- var AttachmentUpdated_default = {
124
- data: {
125
- id: "8a4c109b-3288-4bef-8a80-8c1618e0f4ad",
126
- url: "https://www.rickastley.co.uk/",
127
- title: "Will Never Give You Up",
128
- source: {
129
- type: "api",
130
- imageUrl: "https://uploads.linear.app/attachment-icons/6fca65e5bca9d4ac8eb9d9442c5e3170081f0aa3eb820eebd58766b53fe7236c"
131
- },
132
- issueId: "ee4d5612-0752-441a-95cd-2a0de56689d3",
133
- metadata: {},
134
- subtitle: "Rick Astley Official Site",
135
- createdAt: "2023-09-17T10:51:34.932Z",
136
- creatorId: "b552c442-62c9-40da-9932-ed8cb6e15a3f",
137
- updatedAt: "2023-09-17T10:51:55.751Z",
138
- sourceType: "api",
139
- groupBySource: false
140
- },
141
- type: "Attachment",
142
- action: "update",
143
- createdAt: "2023-09-17T10:51:55.751Z",
144
- webhookId: "d617c08b-47b6-4b09-a611-2e2f6d8fb99f",
145
- updatedFrom: {
146
- title: "My Personal Website",
147
- updatedAt: "2023-09-17T10:51:34.932Z"
148
- },
149
- organizationId: "7c0221e0-76d2-45eb-b803-6163c046c534",
150
- webhookTimestamp: "2023-09-17T10:51:55.809Z"
151
- };
152
-
153
- // src/payload-examples/CommentCreated.json
154
- var CommentCreated_default = {
155
- url: "https://linear.app/triggerdotdev/issue/TRI-1/welcome-to-linear-\u{1F44B}#comment-a4083fcd",
156
- data: {
157
- id: "a4083fcd-2513-4a9b-9a73-bab21cd56a95",
158
- body: "I just wanna tell you how I'm feeling",
159
- issue: {
160
- id: "ee4d5612-0752-441a-95cd-2a0de56689d3",
161
- title: "Welcome to Rick's World \u2764\uFE0F\u200D\u{1F525}"
162
- },
163
- userId: "b552c442-62c9-40da-9932-ed8cb6e15a3f",
164
- issueId: "ee4d5612-0752-441a-95cd-2a0de56689d3",
165
- createdAt: "2023-09-17T10:57:11.751Z",
166
- updatedAt: "2023-09-17T10:57:11.751Z",
167
- reactionData: []
168
- },
169
- type: "Comment",
170
- action: "create",
171
- createdAt: "2023-09-17T10:57:11.751Z",
172
- webhookId: "d617c08b-47b6-4b09-a611-2e2f6d8fb99f",
173
- organizationId: "7c0221e0-76d2-45eb-b803-6163c046c534",
174
- webhookTimestamp: "2023-09-17T10:57:11.842Z"
175
- };
176
-
177
- // src/payload-examples/CommentRemoved.json
178
- var CommentRemoved_default = {
179
- data: {
180
- id: "a4083fcd-2513-4a9b-9a73-bab21cd56a95",
181
- body: "Gotta make you understand",
182
- issue: {
183
- id: "ee4d5612-0752-441a-95cd-2a0de56689d3",
184
- title: "Welcome to Rick's World \u2764\uFE0F\u200D\u{1F525}"
185
- },
186
- userId: "b552c442-62c9-40da-9932-ed8cb6e15a3f",
187
- issueId: "ee4d5612-0752-441a-95cd-2a0de56689d3",
188
- editedAt: "2023-09-17T10:57:24.386Z",
189
- createdAt: "2023-09-17T10:57:11.751Z",
190
- updatedAt: "2023-09-17T10:57:24.387Z",
191
- reactionData: []
192
- },
193
- type: "Comment",
194
- action: "remove",
195
- createdAt: "2023-09-17T10:57:37.324Z",
196
- webhookId: "d617c08b-47b6-4b09-a611-2e2f6d8fb99f",
197
- organizationId: "7c0221e0-76d2-45eb-b803-6163c046c534",
198
- webhookTimestamp: "2023-09-17T10:57:37.376Z"
199
- };
200
-
201
- // src/payload-examples/CommentUpdated.json
202
- var CommentUpdated_default = {
203
- url: "https://linear.app/triggerdotdev/issue/TRI-1/welcome-to-linear-\u{1F44B}#comment-a4083fcd",
204
- data: {
205
- id: "a4083fcd-2513-4a9b-9a73-bab21cd56a95",
206
- body: "Gotta make you understand",
207
- issue: {
208
- id: "ee4d5612-0752-441a-95cd-2a0de56689d3",
209
- title: "Welcome to Rick's World \u2764\uFE0F\u200D\u{1F525}"
210
- },
211
- userId: "b552c442-62c9-40da-9932-ed8cb6e15a3f",
212
- issueId: "ee4d5612-0752-441a-95cd-2a0de56689d3",
213
- editedAt: "2023-09-17T10:57:24.386Z",
214
- createdAt: "2023-09-17T10:57:11.751Z",
215
- updatedAt: "2023-09-17T10:57:24.387Z",
216
- reactionData: []
217
- },
218
- type: "Comment",
219
- action: "update",
220
- createdAt: "2023-09-17T10:57:24.387Z",
221
- webhookId: "d617c08b-47b6-4b09-a611-2e2f6d8fb99f",
222
- updatedFrom: {
223
- body: "I just wanna tell you how I'm feeling",
224
- editedAt: null,
225
- updatedAt: "2023-09-17T10:57:11.751Z"
226
- },
227
- organizationId: "7c0221e0-76d2-45eb-b803-6163c046c534",
228
- webhookTimestamp: "2023-09-17T10:57:24.446Z"
229
- };
230
-
231
- // src/payload-examples/CycleCreated.json
232
- var CycleCreated_default = {
233
- data: {
234
- id: "cf1f0ba0-a769-402c-a5a4-308bca3ff53c",
235
- endsAt: "2023-10-08T23:00:00.000Z",
236
- number: 1,
237
- teamId: "0d9e46fb-bf4a-4d7b-9bb0-d5928d8b1c9f",
238
- startsAt: "2023-09-24T23:00:00.000Z",
239
- createdAt: "2023-09-17T11:00:19.616Z",
240
- updatedAt: "2023-09-17T11:00:19.616Z",
241
- scopeHistory: [],
242
- issueCountHistory: [],
243
- completedScopeHistory: [],
244
- inProgressScopeHistory: [],
245
- completedIssueCountHistory: [],
246
- uncompletedIssuesUponCloseIds: []
247
- },
248
- type: "Cycle",
249
- action: "create",
250
- createdAt: "2023-09-17T11:00:19.616Z",
251
- webhookId: "d617c08b-47b6-4b09-a611-2e2f6d8fb99f",
252
- organizationId: "7c0221e0-76d2-45eb-b803-6163c046c534",
253
- webhookTimestamp: "2023-09-17T11:00:19.696Z"
254
- };
255
-
256
- // src/payload-examples/CycleRemoved.json
257
- var CycleRemoved_default = {
258
- data: {
259
- id: "fe7092dd-8a68-4a07-9477-b7c0a6f2136d",
260
- endsAt: "2023-11-13T00:00:00.000Z",
261
- number: 2,
262
- teamId: "0d9e46fb-bf4a-4d7b-9bb0-d5928d8b1c9f",
263
- startsAt: "2023-10-15T23:00:00.000Z",
264
- createdAt: "2023-09-17T11:00:19.616Z",
265
- updatedAt: "2023-09-17T11:00:47.427Z",
266
- scopeHistory: [],
267
- issueCountHistory: [],
268
- completedScopeHistory: [],
269
- inProgressScopeHistory: [],
270
- completedIssueCountHistory: [],
271
- uncompletedIssuesUponCloseIds: []
272
- },
273
- type: "Cycle",
274
- action: "remove",
275
- createdAt: "2023-09-17T11:01:08.772Z",
276
- webhookId: "d617c08b-47b6-4b09-a611-2e2f6d8fb99f",
277
- organizationId: "7c0221e0-76d2-45eb-b803-6163c046c534",
278
- webhookTimestamp: "2023-09-17T11:01:08.807Z"
279
- };
280
-
281
- // src/payload-examples/CycleUpdated.json
282
- var CycleUpdated_default = {
283
- data: {
284
- id: "fe7092dd-8a68-4a07-9477-b7c0a6f2136d",
285
- endsAt: "2023-11-13T00:00:00.000Z",
286
- number: 2,
287
- teamId: "0d9e46fb-bf4a-4d7b-9bb0-d5928d8b1c9f",
288
- startsAt: "2023-10-15T23:00:00.000Z",
289
- createdAt: "2023-09-17T11:00:19.616Z",
290
- updatedAt: "2023-09-17T11:00:47.427Z",
291
- scopeHistory: [],
292
- issueCountHistory: [],
293
- completedScopeHistory: [],
294
- inProgressScopeHistory: [],
295
- completedIssueCountHistory: [],
296
- uncompletedIssuesUponCloseIds: []
297
- },
298
- type: "Cycle",
299
- action: "update",
300
- createdAt: "2023-09-17T11:00:47.427Z",
301
- webhookId: "d617c08b-47b6-4b09-a611-2e2f6d8fb99f",
302
- updatedFrom: {
303
- endsAt: "2023-11-12T23:00:00.000Z",
304
- updatedAt: "2023-09-17T11:00:47.414Z"
305
- },
306
- organizationId: "7c0221e0-76d2-45eb-b803-6163c046c534",
307
- webhookTimestamp: "2023-09-17T11:00:47.463Z"
308
- };
309
-
310
- // src/payload-examples/IssueCreated.json
311
- var IssueCreated_default = {
312
- url: "https://linear.app/triggerdotdev/issue/TRI-10/you-know-the-rules",
313
- data: {
314
- id: "4ceeeecb-3442-4972-b27a-4ac7198d4eac",
315
- team: {
316
- id: "0d9e46fb-bf4a-4d7b-9bb0-d5928d8b1c9f",
317
- key: "TRI",
318
- name: "Trigger.dev"
319
- },
320
- state: {
321
- id: "6b6fd762-cc10-4da8-9775-dfc0784d2a3b",
322
- name: "Backlog",
323
- type: "backlog",
324
- color: "#bec2c8"
325
- },
326
- title: "You know the rules",
327
- labels: [],
328
- number: 10,
329
- teamId: "0d9e46fb-bf4a-4d7b-9bb0-d5928d8b1c9f",
330
- stateId: "6b6fd762-cc10-4da8-9775-dfc0784d2a3b",
331
- labelIds: [],
332
- priority: 0,
333
- createdAt: "2023-09-17T11:02:48.688Z",
334
- creatorId: "b552c442-62c9-40da-9932-ed8cb6e15a3f",
335
- sortOrder: -81,
336
- updatedAt: "2023-09-17T11:02:48.688Z",
337
- boardOrder: 0,
338
- description: "And so do I",
339
- priorityLabel: "No priority",
340
- subscriberIds: [
341
- "b552c442-62c9-40da-9932-ed8cb6e15a3f"
342
- ],
343
- previousIdentifiers: []
344
- },
345
- type: "Issue",
346
- action: "create",
347
- createdAt: "2023-09-17T11:02:48.688Z",
348
- webhookId: "d617c08b-47b6-4b09-a611-2e2f6d8fb99f",
349
- organizationId: "7c0221e0-76d2-45eb-b803-6163c046c534",
350
- webhookTimestamp: "2023-09-17T11:02:48.800Z"
351
- };
352
-
353
- // src/payload-examples/IssueRemoved.json
354
- var IssueRemoved_default = {
355
- data: {
356
- id: "4ceeeecb-3442-4972-b27a-4ac7198d4eac",
357
- team: {
358
- id: "0d9e46fb-bf4a-4d7b-9bb0-d5928d8b1c9f",
359
- key: "TRI",
360
- name: "Trigger.dev"
361
- },
362
- state: {
363
- id: "6b6fd762-cc10-4da8-9775-dfc0784d2a3b",
364
- name: "Backlog",
365
- type: "backlog",
366
- color: "#bec2c8"
367
- },
368
- title: "You know the rules",
369
- labels: [],
370
- number: 10,
371
- teamId: "0d9e46fb-bf4a-4d7b-9bb0-d5928d8b1c9f",
372
- stateId: "6b6fd762-cc10-4da8-9775-dfc0784d2a3b",
373
- trashed: true,
374
- labelIds: [],
375
- priority: 0,
376
- createdAt: "2023-09-17T11:02:48.688Z",
377
- creatorId: "b552c442-62c9-40da-9932-ed8cb6e15a3f",
378
- sortOrder: -81,
379
- updatedAt: "2023-09-17T11:02:48.689Z",
380
- archivedAt: "2023-09-17T11:02:58.487Z",
381
- boardOrder: 0,
382
- description: "And so do I",
383
- priorityLabel: "No priority",
384
- subscriberIds: [
385
- "b552c442-62c9-40da-9932-ed8cb6e15a3f"
386
- ],
387
- previousIdentifiers: []
388
- },
389
- type: "Issue",
390
- action: "remove",
391
- createdAt: "2023-09-17T11:02:58.487Z",
392
- webhookId: "d617c08b-47b6-4b09-a611-2e2f6d8fb99f",
393
- organizationId: "7c0221e0-76d2-45eb-b803-6163c046c534",
394
- webhookTimestamp: "2023-09-17T11:02:58.564Z"
395
- };
396
-
397
- // src/payload-examples/IssueUpdated.json
398
- var IssueUpdated_default = {
399
- url: "https://linear.app/triggerdotdev/issue/TRI-1/welcome-to-ricks-world-\u{1F44B}",
400
- data: {
401
- id: "ee4d5612-0752-441a-95cd-2a0de56689d3",
402
- team: {
403
- id: "0d9e46fb-bf4a-4d7b-9bb0-d5928d8b1c9f",
404
- key: "TRI",
405
- name: "Trigger.dev"
406
- },
407
- state: {
408
- id: "8b77cd9c-f0cc-4be0-bd9b-52326d5c62a2",
409
- name: "Todo",
410
- type: "unstarted",
411
- color: "#e2e2e2"
412
- },
413
- title: "Welcome to Rick's World \u2764\uFE0F\u200D\u{1F525}",
414
- labels: [],
415
- number: 1,
416
- teamId: "0d9e46fb-bf4a-4d7b-9bb0-d5928d8b1c9f",
417
- stateId: "8b77cd9c-f0cc-4be0-bd9b-52326d5c62a2",
418
- labelIds: [],
419
- priority: 2,
420
- createdAt: "2023-09-17T10:43:20.862Z",
421
- sortOrder: -13701.52,
422
- updatedAt: "2023-09-17T10:52:49.321Z",
423
- boardOrder: 0,
424
- description: "Hi there. Complete these issues to learn how to use Linear and discover \u2728**ProTips.** When you're done, delete them or move them to another team for others to view.\n\n### **To start, type** `C` to **create your first issue.**\n\nCreate issues from any view using `C` or by clicking the `New issue` button.\n\n \n\n[1189b618-97f2-4e2c-ae25-4f25467679e7](https://uploads.linear.app/fe63b3e2-bf87-46c0-8784-cd7d639287c8/532d146d-bcd6-4602-bf1f-83f674b70fff/1189b618-97f2-4e2c-ae25-4f25467679e7)\n\nOur issue editor and comments support Markdown. You can also: \n\n* @mention a teammate\n* Drag & drop images or video (Loom & Youtube embed automatically)\n* Use emoji \u2705",
425
- priorityLabel: "High",
426
- subscriberIds: [],
427
- previousIdentifiers: []
428
- },
429
- type: "Issue",
430
- action: "update",
431
- createdAt: "2023-09-17T10:52:49.321Z",
432
- webhookId: "d617c08b-47b6-4b09-a611-2e2f6d8fb99f",
433
- updatedFrom: {
434
- title: "Welcome to Linear \u{1F44B}",
435
- updatedAt: "2023-09-17T10:52:16.952Z"
436
- },
437
- organizationId: "7c0221e0-76d2-45eb-b803-6163c046c534",
438
- webhookTimestamp: "2023-09-17T10:52:49.762Z"
439
- };
440
-
441
- // src/payload-examples/IssueLabelCreated.json
442
- var IssueLabelCreated_default = {
443
- data: {
444
- id: "ef8d9e0d-7286-460f-b398-7aaf7d182c16",
445
- name: "Give You Up",
446
- color: "#26b5ce",
447
- createdAt: "2023-09-17T11:08:22.426Z",
448
- creatorId: "b552c442-62c9-40da-9932-ed8cb6e15a3f",
449
- updatedAt: "2023-09-17T11:08:22.426Z",
450
- organizationId: "7c0221e0-76d2-45eb-b803-6163c046c534"
451
- },
452
- type: "IssueLabel",
453
- action: "create",
454
- createdAt: "2023-09-17T11:08:22.426Z",
455
- webhookId: "d617c08b-47b6-4b09-a611-2e2f6d8fb99f",
456
- organizationId: "7c0221e0-76d2-45eb-b803-6163c046c534",
457
- webhookTimestamp: "2023-09-17T11:08:22.463Z"
458
- };
459
-
460
- // src/payload-examples/IssueLabelRemoved.json
461
- var IssueLabelRemoved_default = {
462
- data: {
463
- id: "ef8d9e0d-7286-460f-b398-7aaf7d182c16",
464
- name: "Let You Down",
465
- color: "#f2994a",
466
- createdAt: "2023-09-17T11:08:22.426Z",
467
- creatorId: "b552c442-62c9-40da-9932-ed8cb6e15a3f",
468
- updatedAt: "2023-09-17T11:08:31.484Z",
469
- organizationId: "7c0221e0-76d2-45eb-b803-6163c046c534"
470
- },
471
- type: "IssueLabel",
472
- action: "remove",
473
- createdAt: "2023-09-17T11:08:35.517Z",
474
- webhookId: "d617c08b-47b6-4b09-a611-2e2f6d8fb99f",
475
- organizationId: "7c0221e0-76d2-45eb-b803-6163c046c534",
476
- webhookTimestamp: "2023-09-17T11:08:35.556Z"
477
- };
478
-
479
- // src/payload-examples/IssueLabelUpdated.json
480
- var IssueLabelUpdated_default = {
481
- data: {
482
- id: "ef8d9e0d-7286-460f-b398-7aaf7d182c16",
483
- name: "Let You Down",
484
- color: "#f2994a",
485
- createdAt: "2023-09-17T11:08:22.426Z",
486
- creatorId: "b552c442-62c9-40da-9932-ed8cb6e15a3f",
487
- updatedAt: "2023-09-17T11:08:31.484Z",
488
- organizationId: "7c0221e0-76d2-45eb-b803-6163c046c534"
489
- },
490
- type: "IssueLabel",
491
- action: "update",
492
- createdAt: "2023-09-17T11:08:31.484Z",
493
- webhookId: "d617c08b-47b6-4b09-a611-2e2f6d8fb99f",
494
- updatedFrom: {
495
- name: "Give You Up",
496
- color: "#26b5ce",
497
- updatedAt: "2023-09-17T11:08:22.426Z"
498
- },
499
- organizationId: "7c0221e0-76d2-45eb-b803-6163c046c534",
500
- webhookTimestamp: "2023-09-17T11:08:31.527Z"
501
- };
502
-
503
- // src/payload-examples/ProjectCreated.json
504
- var ProjectCreated_default = {
505
- url: "https://linear.app/triggerdotdev/project/ricks-world-1e55e5e64512",
506
- data: {
507
- id: "708440e6-648c-40f9-be87-9e00bbd8d1ec",
508
- name: "Rick's World",
509
- color: "#bec2c8",
510
- state: "backlog",
511
- leadId: "b552c442-62c9-40da-9932-ed8cb6e15a3f",
512
- slugId: "1e55e5e64512",
513
- teamIds: [
514
- "0d9e46fb-bf4a-4d7b-9bb0-d5928d8b1c9f"
515
- ],
516
- roadmaps: [],
517
- createdAt: "2023-09-17T11:24:43.171Z",
518
- creatorId: "b552c442-62c9-40da-9932-ed8cb6e15a3f",
519
- memberIds: [
520
- "b552c442-62c9-40da-9932-ed8cb6e15a3f"
521
- ],
522
- sortOrder: 8161.55,
523
- updatedAt: "2023-09-17T11:24:43.171Z",
524
- milestones: [],
525
- description: "We know the game and we're gonna play it",
526
- scopeHistory: [],
527
- slackNewIssue: true,
528
- issueCountHistory: [],
529
- slackIssueComments: true,
530
- slackIssueStatuses: true,
531
- completedScopeHistory: [],
532
- inProgressScopeHistory: [],
533
- completedIssueCountHistory: []
534
- },
535
- type: "Project",
536
- action: "create",
537
- createdAt: "2023-09-17T11:24:43.171Z",
538
- webhookId: "d617c08b-47b6-4b09-a611-2e2f6d8fb99f",
539
- organizationId: "7c0221e0-76d2-45eb-b803-6163c046c534",
540
- webhookTimestamp: "2023-09-17T11:24:43.228Z"
541
- };
542
-
543
- // src/payload-examples/ProjectRemoved.json
544
- var ProjectRemoved_default = {
545
- data: {
546
- id: "708440e6-648c-40f9-be87-9e00bbd8d1ec",
547
- name: "Rick's World",
548
- color: "#bec2c8",
549
- state: "backlog",
550
- leadId: "b552c442-62c9-40da-9932-ed8cb6e15a3f",
551
- slugId: "1e55e5e64512",
552
- teamIds: [
553
- "0d9e46fb-bf4a-4d7b-9bb0-d5928d8b1c9f"
554
- ],
555
- trashed: true,
556
- roadmaps: [],
557
- createdAt: "2023-09-17T11:24:43.171Z",
558
- creatorId: "b552c442-62c9-40da-9932-ed8cb6e15a3f",
559
- memberIds: [
560
- "b552c442-62c9-40da-9932-ed8cb6e15a3f"
561
- ],
562
- sortOrder: 8161.55,
563
- updatedAt: "2023-09-17T11:25:09.384Z",
564
- archivedAt: "2023-09-17T11:25:16.188Z",
565
- milestones: [],
566
- targetDate: "2024-02-14T00:00:00.000Z",
567
- description: "We know the game and we're gonna play it",
568
- scopeHistory: [],
569
- slackNewIssue: true,
570
- issueCountHistory: [],
571
- slackIssueComments: true,
572
- slackIssueStatuses: true,
573
- completedScopeHistory: [],
574
- inProgressScopeHistory: [],
575
- completedIssueCountHistory: []
576
- },
577
- type: "Project",
578
- action: "remove",
579
- createdAt: "2023-09-17T11:25:16.188Z",
580
- webhookId: "d617c08b-47b6-4b09-a611-2e2f6d8fb99f",
581
- organizationId: "7c0221e0-76d2-45eb-b803-6163c046c534",
582
- webhookTimestamp: "2023-09-17T11:25:16.358Z"
583
- };
584
-
585
- // src/payload-examples/ProjectUpdated.json
586
- var ProjectUpdated_default = {
587
- url: "https://linear.app/triggerdotdev/project/ricks-world-1e55e5e64512",
588
- data: {
589
- id: "708440e6-648c-40f9-be87-9e00bbd8d1ec",
590
- name: "Rick's World",
591
- color: "#bec2c8",
592
- state: "backlog",
593
- leadId: "b552c442-62c9-40da-9932-ed8cb6e15a3f",
594
- slugId: "1e55e5e64512",
595
- teamIds: [
596
- "0d9e46fb-bf4a-4d7b-9bb0-d5928d8b1c9f"
597
- ],
598
- roadmaps: [],
599
- createdAt: "2023-09-17T11:24:43.171Z",
600
- creatorId: "b552c442-62c9-40da-9932-ed8cb6e15a3f",
601
- memberIds: [
602
- "b552c442-62c9-40da-9932-ed8cb6e15a3f"
603
- ],
604
- sortOrder: 8161.55,
605
- updatedAt: "2023-09-17T11:25:09.383Z",
606
- milestones: [],
607
- targetDate: "2024-02-14T00:00:00.000Z",
608
- description: "We know the game and we're gonna play it",
609
- scopeHistory: [],
610
- slackNewIssue: true,
611
- issueCountHistory: [],
612
- slackIssueComments: true,
613
- slackIssueStatuses: true,
614
- completedScopeHistory: [],
615
- inProgressScopeHistory: [],
616
- completedIssueCountHistory: []
617
- },
618
- type: "Project",
619
- action: "update",
620
- createdAt: "2023-09-17T11:25:09.383Z",
621
- webhookId: "d617c08b-47b6-4b09-a611-2e2f6d8fb99f",
622
- updatedFrom: {
623
- updatedAt: "2023-09-17T11:24:43.171Z",
624
- targetDate: null
625
- },
626
- organizationId: "7c0221e0-76d2-45eb-b803-6163c046c534",
627
- webhookTimestamp: "2023-09-17T11:25:09.419Z"
628
- };
629
-
630
- // src/payload-examples/ProjectUpdateCreated.json
631
- var ProjectUpdateCreated_default = {
632
- data: {
633
- id: "e5b2ae4e-acb5-4c6c-a22a-56c883e353b4",
634
- body: "We're no strangers to love",
635
- user: {
636
- id: "b552c442-62c9-40da-9932-ed8cb6e15a3f",
637
- name: "Rick Astley"
638
- },
639
- health: "onTrack",
640
- userId: "b552c442-62c9-40da-9932-ed8cb6e15a3f",
641
- project: {
642
- id: "54dac280-389f-4339-8d5d-de347a56eb79",
643
- name: "Rick's World"
644
- },
645
- roadmaps: [],
646
- createdAt: "2023-09-17T11:28:23.406Z",
647
- projectId: "54dac280-389f-4339-8d5d-de347a56eb79",
648
- updatedAt: "2023-09-17T11:28:23.406Z",
649
- infoSnapshot: {
650
- state: "backlog",
651
- leadId: "b552c442-62c9-40da-9932-ed8cb6e15a3f",
652
- memberIds: [
653
- "b552c442-62c9-40da-9932-ed8cb6e15a3f"
654
- ],
655
- teamsInfo: [
656
- {
657
- id: "0d9e46fb-bf4a-4d7b-9bb0-d5928d8b1c9f",
658
- issueInfo: {
659
- triageCount: 0,
660
- backlogCount: 0,
661
- startedCount: 0,
662
- canceledCount: 0,
663
- completedCount: 0,
664
- unstartedCount: 0
665
- }
666
- }
667
- ],
668
- milestonesInfo: []
669
- }
670
- },
671
- type: "ProjectUpdate",
672
- action: "create",
673
- createdAt: "2023-09-17T11:28:23.406Z",
674
- webhookId: "d617c08b-47b6-4b09-a611-2e2f6d8fb99f",
675
- organizationId: "7c0221e0-76d2-45eb-b803-6163c046c534",
676
- webhookTimestamp: "2023-09-17T11:28:23.479Z"
677
- };
678
-
679
- // src/payload-examples/ProjectUpdateRemoved.json
680
- var ProjectUpdateRemoved_default = {
681
- data: {
682
- id: "e5b2ae4e-acb5-4c6c-a22a-56c883e353b4",
683
- body: "You know the rules and so do I",
684
- user: {
685
- id: "b552c442-62c9-40da-9932-ed8cb6e15a3f",
686
- name: "Rick Astley"
687
- },
688
- health: "onTrack",
689
- userId: "b552c442-62c9-40da-9932-ed8cb6e15a3f",
690
- project: {
691
- id: "54dac280-389f-4339-8d5d-de347a56eb79",
692
- name: "Rick's World"
693
- },
694
- editedAt: "2023-09-17T11:28:39.142Z",
695
- roadmaps: [],
696
- createdAt: "2023-09-17T11:28:23.406Z",
697
- projectId: "54dac280-389f-4339-8d5d-de347a56eb79",
698
- updatedAt: "2023-09-17T11:28:39.142Z",
699
- infoSnapshot: {
700
- state: "backlog",
701
- leadId: "b552c442-62c9-40da-9932-ed8cb6e15a3f",
702
- memberIds: [
703
- "b552c442-62c9-40da-9932-ed8cb6e15a3f"
704
- ],
705
- teamsInfo: [
706
- {
707
- id: "0d9e46fb-bf4a-4d7b-9bb0-d5928d8b1c9f",
708
- issueInfo: {
709
- triageCount: 0,
710
- backlogCount: 0,
711
- startedCount: 0,
712
- canceledCount: 0,
713
- completedCount: 0,
714
- unstartedCount: 0
715
- }
716
- }
717
- ],
718
- milestonesInfo: []
719
- }
720
- },
721
- type: "ProjectUpdate",
722
- action: "remove",
723
- createdAt: "2023-09-17T11:28:45.146Z",
724
- webhookId: "d617c08b-47b6-4b09-a611-2e2f6d8fb99f",
725
- organizationId: "7c0221e0-76d2-45eb-b803-6163c046c534",
726
- webhookTimestamp: "2023-09-17T11:28:45.213Z"
727
- };
728
-
729
- // src/payload-examples/ProjectUpdateUpdated.json
730
- var ProjectUpdateUpdated_default = {
731
- data: {
732
- id: "e5b2ae4e-acb5-4c6c-a22a-56c883e353b4",
733
- body: "You know the rules and so do I",
734
- user: {
735
- id: "b552c442-62c9-40da-9932-ed8cb6e15a3f",
736
- name: "Rick Astley"
737
- },
738
- health: "onTrack",
739
- userId: "b552c442-62c9-40da-9932-ed8cb6e15a3f",
740
- project: {
741
- id: "54dac280-389f-4339-8d5d-de347a56eb79",
742
- name: "Rick's World"
743
- },
744
- editedAt: "2023-09-17T11:28:39.142Z",
745
- roadmaps: [],
746
- createdAt: "2023-09-17T11:28:23.406Z",
747
- projectId: "54dac280-389f-4339-8d5d-de347a56eb79",
748
- updatedAt: "2023-09-17T11:28:39.142Z",
749
- infoSnapshot: {
750
- state: "backlog",
751
- leadId: "b552c442-62c9-40da-9932-ed8cb6e15a3f",
752
- memberIds: [
753
- "b552c442-62c9-40da-9932-ed8cb6e15a3f"
754
- ],
755
- teamsInfo: [
756
- {
757
- id: "0d9e46fb-bf4a-4d7b-9bb0-d5928d8b1c9f",
758
- issueInfo: {
759
- triageCount: 0,
760
- backlogCount: 0,
761
- startedCount: 0,
762
- canceledCount: 0,
763
- completedCount: 0,
764
- unstartedCount: 0
765
- }
766
- }
767
- ],
768
- milestonesInfo: []
769
- }
770
- },
771
- type: "ProjectUpdate",
772
- action: "update",
773
- createdAt: "2023-09-17T11:28:39.142Z",
774
- webhookId: "d617c08b-47b6-4b09-a611-2e2f6d8fb99f",
775
- updatedFrom: {
776
- body: "We're no strangers to love",
777
- editedAt: null,
778
- updatedAt: "2023-09-17T11:28:23.406Z"
779
- },
780
- organizationId: "7c0221e0-76d2-45eb-b803-6163c046c534",
781
- webhookTimestamp: "2023-09-17T11:28:39.181Z"
782
- };
783
-
784
- // src/payload-examples/ReactionCreated.json
785
- var ReactionCreated_default = {
786
- data: {
787
- id: "a22b3a1f-109f-427f-aa59-78b4ab1d2944",
788
- user: {
789
- id: "b552c442-62c9-40da-9932-ed8cb6e15a3f",
790
- name: "Rick Astley"
791
- },
792
- emoji: "heart",
793
- userId: "b552c442-62c9-40da-9932-ed8cb6e15a3f",
794
- comment: {
795
- id: "3f44c353-a3a1-45a4-b5da-259818ae21dd",
796
- body: "Never gonna!",
797
- userId: "b552c442-62c9-40da-9932-ed8cb6e15a3f"
798
- },
799
- createdAt: "2023-09-17T11:31:27.394Z",
800
- updatedAt: "2023-09-17T11:31:27.394Z"
801
- },
802
- type: "Reaction",
803
- action: "create",
804
- createdAt: "2023-09-17T11:31:27.394Z",
805
- webhookId: "d617c08b-47b6-4b09-a611-2e2f6d8fb99f",
806
- organizationId: "7c0221e0-76d2-45eb-b803-6163c046c534",
807
- webhookTimestamp: "2023-09-17T11:31:27.477Z"
808
- };
809
-
810
- // src/payload-examples/ReactionRemoved.json
811
- var ReactionRemoved_default = {
812
- data: {
813
- id: "a22b3a1f-109f-427f-aa59-78b4ab1d2944",
814
- user: {
815
- id: "b552c442-62c9-40da-9932-ed8cb6e15a3f",
816
- name: "Rick Astley"
817
- },
818
- emoji: "heart",
819
- userId: "b552c442-62c9-40da-9932-ed8cb6e15a3f",
820
- comment: {
821
- id: "3f44c353-a3a1-45a4-b5da-259818ae21dd",
822
- body: "Never gonna!",
823
- userId: "b552c442-62c9-40da-9932-ed8cb6e15a3f"
824
- },
825
- createdAt: "2023-09-17T11:31:27.394Z",
826
- updatedAt: "2023-09-17T11:31:27.394Z"
827
- },
828
- type: "Reaction",
829
- action: "remove",
830
- createdAt: "2023-09-17T11:32:07.003Z",
831
- webhookId: "d617c08b-47b6-4b09-a611-2e2f6d8fb99f",
832
- organizationId: "7c0221e0-76d2-45eb-b803-6163c046c534",
833
- webhookTimestamp: "2023-09-17T11:32:07.088Z"
834
- };
835
-
836
- // src/payload-examples/ReactionUpdated.json
837
- var ReactionUpdated_default = {
838
- data: {
839
- id: "a22b3a1f-109f-427f-aa59-78b4ab1d2944",
840
- user: {
841
- id: "b552c442-62c9-40da-9932-ed8cb6e15a3f",
842
- name: "Rick Astley"
843
- },
844
- emoji: "heart_on_fire",
845
- userId: "b552c442-62c9-40da-9932-ed8cb6e15a3f",
846
- comment: {
847
- id: "3f44c353-a3a1-45a4-b5da-259818ae21dd",
848
- body: "Never gonna!",
849
- userId: "b552c442-62c9-40da-9932-ed8cb6e15a3f"
850
- },
851
- createdAt: "2023-09-17T12:31:27.394Z",
852
- updatedAt: "2023-09-17T12:32:14.394Z"
853
- },
854
- type: "Reaction",
855
- action: "update",
856
- createdAt: "2023-09-17T12:31:27.394Z",
857
- webhookId: "d617c08b-47b6-4b09-a611-2e2f6d8fb99f",
858
- updatedFrom: {
859
- emoji: "heart",
860
- updatedAt: "2023-09-17T12:31:27.394Z"
861
- },
862
- organizationId: "7c0221e0-76d2-45eb-b803-6163c046c534",
863
- webhookTimestamp: "2023-09-17T12:31:27.477Z"
864
- };
865
-
866
- // src/payload-examples/index.ts
867
- var attachmentCreated = {
868
- id: "AttachmentCreated",
869
- name: "Attachment created",
870
- payload: AttachmentCreated_default
871
- };
872
- var attachmentRemoved = {
873
- id: "AttachmentRemoved",
874
- name: "Attachment removed",
875
- payload: AttachmentRemoved_default
876
- };
877
- var attachmentUpdated = {
878
- id: "AttachmentUpdated",
879
- name: "Attachment updated",
880
- payload: AttachmentUpdated_default
881
- };
882
- var commentCreated = {
883
- id: "CommentCreated",
884
- name: "Comment created",
885
- payload: CommentCreated_default
886
- };
887
- var commentRemoved = {
888
- id: "CommentRemoved",
889
- name: "Comment removed",
890
- payload: CommentRemoved_default
891
- };
892
- var commentUpdated = {
893
- id: "CommentUpdated",
894
- name: "Comment updated",
895
- payload: CommentUpdated_default
896
- };
897
- var cycleCreated = {
898
- id: "CycleCreated",
899
- name: "Cycle created",
900
- payload: CycleCreated_default
901
- };
902
- var cycleRemoved = {
903
- id: "CycleRemoved",
904
- name: "Cycle removed",
905
- payload: CycleRemoved_default
906
- };
907
- var cycleUpdated = {
908
- id: "CycleUpdated",
909
- name: "Cycle updated",
910
- payload: CycleUpdated_default
911
- };
912
- var issueCreated = {
913
- id: "IssueCreated",
914
- name: "Issue created",
915
- payload: IssueCreated_default
916
- };
917
- var issueRemoved = {
918
- id: "IssueRemoved",
919
- name: "Issue removed",
920
- payload: IssueRemoved_default
921
- };
922
- var issueUpdated = {
923
- id: "IssueUpdated",
924
- name: "Issue updated",
925
- payload: IssueUpdated_default
926
- };
927
- var issueLabelCreated = {
928
- id: "IssueLabelCreated",
929
- name: "IssueLabel created",
930
- payload: IssueLabelCreated_default
931
- };
932
- var issueLabelRemoved = {
933
- id: "IssueLabelRemoved",
934
- name: "IssueLabel removed",
935
- payload: IssueLabelRemoved_default
936
- };
937
- var issueLabelUpdated = {
938
- id: "IssueLabelUpdated",
939
- name: "IssueLabel updated",
940
- payload: IssueLabelUpdated_default
941
- };
942
- var projectCreated = {
943
- id: "ProjectCreated",
944
- name: "Project created",
945
- payload: ProjectCreated_default
946
- };
947
- var projectRemoved = {
948
- id: "ProjectRemoved",
949
- name: "Project removed",
950
- payload: ProjectRemoved_default
951
- };
952
- var projectUpdated = {
953
- id: "ProjectUpdated",
954
- name: "Project updated",
955
- payload: ProjectUpdated_default
956
- };
957
- var projectUpdateCreated = {
958
- id: "ProjectUpdateCreated",
959
- name: "ProjectUpdate created",
960
- payload: ProjectUpdateCreated_default
961
- };
962
- var projectUpdateRemoved = {
963
- id: "ProjectUpdateRemoved",
964
- name: "ProjectUpdate removed",
965
- payload: ProjectUpdateRemoved_default
966
- };
967
- var projectUpdateUpdated = {
968
- id: "ProjectUpdateUpdated",
969
- name: "ProjectUpdate updated",
970
- payload: ProjectUpdateUpdated_default
971
- };
972
- var reactionCreated = {
973
- id: "ReactionCreated",
974
- name: "Reaction created",
975
- payload: ReactionCreated_default
976
- };
977
- var reactionRemoved = {
978
- id: "ReactionRemoved",
979
- name: "Reaction removed",
980
- payload: ReactionRemoved_default
981
- };
982
- var reactionUpdated = {
983
- id: "ReactionUpdated",
984
- name: "Reaction updated",
985
- payload: ReactionUpdated_default
986
- };
987
-
988
- // src/utils.ts
989
- var onCommentProperties = (payload) => {
990
- return [
991
- { label: "Comment ID", text: payload.data.id },
992
- { label: "Issue ID", text: payload.data.issueId },
993
- { label: "Issue Title", text: payload.data.issue.title, url: payload.url ?? void 0 }
994
- ];
995
- };
996
- var onIssueProperties = (payload) => {
997
- return [
998
- { label: "Issue ID", text: payload.data.id },
999
- {
1000
- label: "Issue",
1001
- text: `[${payload.data.team.key}-${payload.data.number}] ${payload.data.title}`,
1002
- url: payload.url ?? void 0
1003
- }
1004
- ];
1005
- };
1006
- var queryProperties = (query) => {
1007
- return [
1008
- ...query.after ? [{ label: "After", text: query.after }] : [],
1009
- ...query.before ? [{ label: "Before", text: query.before }] : [],
1010
- ...query.first ? [{ label: "First", text: String(query.first) }] : [],
1011
- ...query.last ? [{ label: "Last", text: String(query.last) }] : [],
1012
- ...query.orderBy ? [{ label: "Order by", text: query.orderBy }] : [],
1013
- ...query.includeArchived ? [{ label: "Include archived", text: String(query.includeArchived) }] : []
1014
- ];
1015
- };
1016
- var updatedFromProperties = (payload) => {
1017
- if (payload.action !== "update")
1018
- return [];
1019
- return [
1020
- {
1021
- label: "Updated Keys",
1022
- text: Object.keys(payload.updatedFrom).filter((key) => !["editedAt", "updatedAt"].includes(key)).join(", ")
1023
- }
1024
- ];
1025
- };
1026
-
1027
- // src/events.ts
1028
- var onAttachment = {
1029
- name: "Attachment",
1030
- title: "On Attachment",
1031
- source: "linear.app",
1032
- icon: "linear",
1033
- examples: [attachmentCreated, attachmentRemoved, attachmentUpdated],
1034
- parsePayload: (payload) => payload,
1035
- runProperties: (payload) => [
1036
- { label: "Event action", text: payload.action },
1037
- { label: "Attachment ID", text: payload.data.id }
1038
- ]
1039
- };
1040
- var onAttachmentCreated = {
1041
- name: "Attachment",
1042
- title: "On Attachment Created",
1043
- source: "linear.app",
1044
- icon: "linear",
1045
- filter: {
1046
- action: ["create"]
1047
- },
1048
- examples: [attachmentCreated],
1049
- parsePayload: (payload) => payload,
1050
- runProperties: (payload) => [{ label: "Attachment ID", text: payload.data.id }]
1051
- };
1052
- var onAttachmentRemoved = {
1053
- name: "Attachment",
1054
- title: "On Attachment Removed",
1055
- source: "linear.app",
1056
- icon: "linear",
1057
- filter: {
1058
- action: ["remove"]
1059
- },
1060
- examples: [attachmentRemoved],
1061
- parsePayload: (payload) => payload,
1062
- runProperties: (payload) => [{ label: "Attachment ID", text: payload.data.id }]
1063
- };
1064
- var onAttachmentUpdated = {
1065
- name: "Attachment",
1066
- title: "On Attachment Updated",
1067
- source: "linear.app",
1068
- icon: "linear",
1069
- filter: {
1070
- action: ["update"]
1071
- },
1072
- examples: [attachmentUpdated],
1073
- parsePayload: (payload) => payload,
1074
- runProperties: (payload) => [{ label: "Attachment ID", text: payload.data.id }]
1075
- };
1076
- var onComment = {
1077
- name: "Comment",
1078
- title: "On Comment",
1079
- source: "linear.app",
1080
- icon: "linear",
1081
- examples: [commentCreated, commentRemoved, commentUpdated],
1082
- parsePayload: (payload) => payload,
1083
- runProperties: (payload) => [
1084
- { label: "Event action", text: payload.action },
1085
- ...onCommentProperties(payload),
1086
- ...updatedFromProperties(payload)
1087
- ]
1088
- };
1089
- var onCommentCreated = {
1090
- name: "Comment",
1091
- title: "On Comment Created",
1092
- source: "linear.app",
1093
- icon: "linear",
1094
- filter: {
1095
- action: ["create"]
1096
- },
1097
- examples: [commentCreated],
1098
- parsePayload: (payload) => payload,
1099
- runProperties: (payload) => onCommentProperties(payload)
1100
- };
1101
- var onCommentRemoved = {
1102
- name: "Comment",
1103
- title: "On Comment Removed",
1104
- source: "linear.app",
1105
- icon: "linear",
1106
- filter: {
1107
- action: ["remove"]
1108
- },
1109
- examples: [commentRemoved],
1110
- parsePayload: (payload) => payload,
1111
- runProperties: (payload) => onCommentProperties(payload)
1112
- };
1113
- var onCommentUpdated = {
1114
- name: "Comment",
1115
- title: "On Comment Updated",
1116
- source: "linear.app",
1117
- icon: "linear",
1118
- filter: {
1119
- action: ["update"]
1120
- },
1121
- examples: [commentUpdated],
1122
- parsePayload: (payload) => payload,
1123
- runProperties: (payload) => [...onCommentProperties(payload), ...updatedFromProperties(payload)]
1124
- };
1125
- var onCycle = {
1126
- name: "Cycle",
1127
- title: "On Cycle",
1128
- source: "linear.app",
1129
- icon: "linear",
1130
- examples: [cycleCreated, cycleRemoved, cycleUpdated],
1131
- parsePayload: (payload) => payload,
1132
- runProperties: (payload) => [
1133
- { label: "Event action", text: payload.action },
1134
- { label: "Cycle ID", text: payload.data.id }
1135
- ]
1136
- };
1137
- var onCycleCreated = {
1138
- name: "Cycle",
1139
- title: "On Cycle Created",
1140
- source: "linear.app",
1141
- icon: "linear",
1142
- filter: {
1143
- action: ["create"]
1144
- },
1145
- examples: [cycleCreated],
1146
- parsePayload: (payload) => payload,
1147
- runProperties: (payload) => [{ label: "Cycle ID", text: payload.data.id }]
1148
- };
1149
- var onCycleRemoved = {
1150
- name: "Cycle",
1151
- title: "On Cycle Removed",
1152
- source: "linear.app",
1153
- icon: "linear",
1154
- filter: {
1155
- action: ["remove"]
1156
- },
1157
- examples: [cycleRemoved],
1158
- parsePayload: (payload) => payload,
1159
- runProperties: (payload) => [{ label: "Cycle ID", text: payload.data.id }]
1160
- };
1161
- var onCycleUpdated = {
1162
- name: "Cycle",
1163
- title: "On Cycle Updated",
1164
- source: "linear.app",
1165
- icon: "linear",
1166
- filter: {
1167
- action: ["update"]
1168
- },
1169
- examples: [cycleUpdated],
1170
- parsePayload: (payload) => payload,
1171
- runProperties: (payload) => [{ label: "Cycle ID", text: payload.data.id }]
1172
- };
1173
- var onIssue = {
1174
- name: "Issue",
1175
- title: "On Issue",
1176
- source: "linear.app",
1177
- icon: "linear",
1178
- examples: [issueCreated, issueRemoved, issueUpdated],
1179
- parsePayload: (payload) => payload,
1180
- runProperties: (payload) => [
1181
- { label: "Event action", text: payload.action },
1182
- ...onIssueProperties(payload),
1183
- ...updatedFromProperties(payload)
1184
- ]
1185
- };
1186
- var onIssueCreated = {
1187
- name: "Issue",
1188
- title: "On Issue Created",
1189
- source: "linear.app",
1190
- icon: "linear",
1191
- filter: {
1192
- action: ["create"]
1193
- },
1194
- examples: [issueCreated],
1195
- parsePayload: (payload) => payload,
1196
- runProperties: (payload) => onIssueProperties(payload)
1197
- };
1198
- var onIssueRemoved = {
1199
- name: "Issue",
1200
- title: "On Issue Removed",
1201
- source: "linear.app",
1202
- icon: "linear",
1203
- filter: {
1204
- action: ["remove"]
1205
- },
1206
- examples: [issueRemoved],
1207
- parsePayload: (payload) => payload,
1208
- runProperties: (payload) => onIssueProperties(payload)
1209
- };
1210
- var onIssueUpdated = {
1211
- name: "Issue",
1212
- title: "On Issue Updated",
1213
- source: "linear.app",
1214
- icon: "linear",
1215
- filter: {
1216
- action: ["update"]
1217
- },
1218
- examples: [issueUpdated],
1219
- parsePayload: (payload) => payload,
1220
- runProperties: (payload) => [...onIssueProperties(payload), ...updatedFromProperties(payload)]
1221
- };
1222
- var onIssueLabel = {
1223
- name: "IssueLabel",
1224
- title: "On IssueLabel",
1225
- source: "linear.app",
1226
- icon: "linear",
1227
- examples: [issueLabelCreated, issueLabelRemoved, issueLabelUpdated],
1228
- parsePayload: (payload) => payload,
1229
- runProperties: (payload) => [
1230
- { label: "Event action", text: payload.action },
1231
- { label: "IssueLabel ID", text: payload.data.id }
1232
- ]
1233
- };
1234
- var onIssueLabelCreated = {
1235
- name: "IssueLabel",
1236
- title: "On IssueLabel Created",
1237
- source: "linear.app",
1238
- icon: "linear",
1239
- filter: {
1240
- action: ["create"]
1241
- },
1242
- examples: [issueLabelCreated],
1243
- parsePayload: (payload) => payload,
1244
- runProperties: (payload) => [{ label: "IssueLabel ID", text: payload.data.id }]
1245
- };
1246
- var onIssueLabelRemoved = {
1247
- name: "IssueLabel",
1248
- title: "On IssueLabel Removed",
1249
- source: "linear.app",
1250
- icon: "linear",
1251
- filter: {
1252
- action: ["remove"]
1253
- },
1254
- examples: [issueLabelRemoved],
1255
- parsePayload: (payload) => payload,
1256
- runProperties: (payload) => [{ label: "IssueLabel ID", text: payload.data.id }]
1257
- };
1258
- var onIssueLabelUpdated = {
1259
- name: "IssueLabel",
1260
- title: "On IssueLabel Updated",
1261
- source: "linear.app",
1262
- icon: "linear",
1263
- filter: {
1264
- action: ["update"]
1265
- },
1266
- examples: [issueLabelUpdated],
1267
- parsePayload: (payload) => payload,
1268
- runProperties: (payload) => [{ label: "IssueLabel ID", text: payload.data.id }]
1269
- };
1270
- var onIssueSLA = {
1271
- name: "IssueSLA",
1272
- title: "On Issue SLA",
1273
- source: "linear.app",
1274
- icon: "linear",
1275
- parsePayload: (payload) => payload,
1276
- runProperties: (payload) => [
1277
- { label: "SLA action", text: payload.action },
1278
- { label: "Issue ID", text: payload.issueData.id }
1279
- ]
1280
- };
1281
- var onIssueSLASet = {
1282
- name: "IssueSLA",
1283
- title: "On Issue SLA Set",
1284
- source: "linear.app",
1285
- icon: "linear",
1286
- filter: {
1287
- action: ["set"]
1288
- },
1289
- parsePayload: (payload) => payload,
1290
- runProperties: (payload) => [{ label: "Issue ID", text: payload.issueData.id }]
1291
- };
1292
- var onIssueSLABreached = {
1293
- name: "IssueSLA",
1294
- title: "On Issue SLA Breached",
1295
- source: "linear.app",
1296
- icon: "linear",
1297
- filter: {
1298
- action: ["breached"]
1299
- },
1300
- parsePayload: (payload) => payload,
1301
- runProperties: (payload) => [{ label: "Issue ID", text: payload.issueData.id }]
1302
- };
1303
- var onIssueSLAHighRisk = {
1304
- name: "IssueSLA",
1305
- title: "On Issue SLA High Risk",
1306
- source: "linear.app",
1307
- icon: "linear",
1308
- filter: {
1309
- action: ["highRisk"]
1310
- },
1311
- parsePayload: (payload) => payload,
1312
- runProperties: (payload) => [{ label: "Issue ID", text: payload.issueData.id }]
1313
- };
1314
- var onProject = {
1315
- name: "Project",
1316
- title: "On Project",
1317
- source: "linear.app",
1318
- icon: "linear",
1319
- examples: [projectCreated, projectRemoved, projectUpdated],
1320
- parsePayload: (payload) => payload,
1321
- runProperties: (payload) => [
1322
- { label: "Event action", text: payload.action },
1323
- { label: "Project ID", text: payload.data.id },
1324
- { label: "Project Name", text: payload.data.name, url: payload.url ?? void 0 },
1325
- ...updatedFromProperties(payload)
1326
- ]
1327
- };
1328
- var onProjectCreated = {
1329
- name: "Project",
1330
- title: "On Project Created",
1331
- source: "linear.app",
1332
- icon: "linear",
1333
- filter: {
1334
- action: ["create"]
1335
- },
1336
- examples: [projectCreated],
1337
- parsePayload: (payload) => payload,
1338
- runProperties: (payload) => [
1339
- { label: "Project ID", text: payload.data.id },
1340
- { label: "Project Name", text: payload.data.name, url: payload.url ?? void 0 }
1341
- ]
1342
- };
1343
- var onProjectRemoved = {
1344
- name: "Project",
1345
- title: "On Project Removed",
1346
- source: "linear.app",
1347
- icon: "linear",
1348
- filter: {
1349
- action: ["remove"]
1350
- },
1351
- examples: [projectRemoved],
1352
- parsePayload: (payload) => payload,
1353
- runProperties: (payload) => [
1354
- { label: "Project ID", text: payload.data.id },
1355
- { label: "Project Name", text: payload.data.name, url: payload.url ?? void 0 }
1356
- ]
1357
- };
1358
- var onProjectUpdated = {
1359
- name: "Project",
1360
- title: "On Project Updated",
1361
- source: "linear.app",
1362
- icon: "linear",
1363
- filter: {
1364
- action: ["update"]
1365
- },
1366
- examples: [projectUpdated],
1367
- parsePayload: (payload) => payload,
1368
- runProperties: (payload) => [
1369
- { label: "Project ID", text: payload.data.id },
1370
- { label: "Project Name", text: payload.data.name, url: payload.url ?? void 0 },
1371
- ...updatedFromProperties(payload)
1372
- ]
1373
- };
1374
- var onProjectUpdate = {
1375
- name: "ProjectUpdate",
1376
- title: "On ProjectUpdate",
1377
- source: "linear.app",
1378
- icon: "linear",
1379
- examples: [projectUpdateCreated, projectUpdateRemoved, projectUpdateUpdated],
1380
- parsePayload: (payload) => payload,
1381
- runProperties: (payload) => [
1382
- { label: "Event action", text: payload.action },
1383
- { label: "ProjectUpdate ID", text: payload.data.id }
1384
- ]
1385
- };
1386
- var onProjectUpdateCreated = {
1387
- name: "ProjectUpdate",
1388
- title: "On ProjectUpdate Created",
1389
- source: "linear.app",
1390
- icon: "linear",
1391
- filter: {
1392
- action: ["create"]
1393
- },
1394
- examples: [projectUpdateCreated],
1395
- parsePayload: (payload) => payload,
1396
- runProperties: (payload) => [{ label: "ProjectUpdate ID", text: payload.data.id }]
1397
- };
1398
- var onProjectUpdateRemoved = {
1399
- name: "ProjectUpdate",
1400
- title: "On ProjectUpdate Removed",
1401
- source: "linear.app",
1402
- icon: "linear",
1403
- filter: {
1404
- action: ["remove"]
1405
- },
1406
- examples: [projectUpdateRemoved],
1407
- parsePayload: (payload) => payload,
1408
- runProperties: (payload) => [{ label: "ProjectUpdate ID", text: payload.data.id }]
1409
- };
1410
- var onProjectUpdateUpdated = {
1411
- name: "ProjectUpdate",
1412
- title: "On ProjectUpdate Updated",
1413
- source: "linear.app",
1414
- icon: "linear",
1415
- filter: {
1416
- action: ["update"]
1417
- },
1418
- examples: [projectUpdateUpdated],
1419
- parsePayload: (payload) => payload,
1420
- runProperties: (payload) => [{ label: "ProjectUpdate ID", text: payload.data.id }]
1421
- };
1422
- var onReaction = {
1423
- name: "Reaction",
1424
- title: "On Reaction",
1425
- source: "linear.app",
1426
- icon: "linear",
1427
- examples: [reactionCreated, reactionRemoved, reactionUpdated],
1428
- parsePayload: (payload) => payload,
1429
- runProperties: (payload) => [
1430
- { label: "Event action", text: payload.action },
1431
- { label: "Reaction ID", text: payload.data.id }
1432
- ]
1433
- };
1434
- var onReactionCreated = {
1435
- name: "Reaction",
1436
- title: "On Reaction Created",
1437
- source: "linear.app",
1438
- icon: "linear",
1439
- filter: {
1440
- action: ["create"]
1441
- },
1442
- examples: [reactionCreated],
1443
- parsePayload: (payload) => payload,
1444
- runProperties: (payload) => [{ label: "Reaction ID", text: payload.data.id }]
1445
- };
1446
- var onReactionRemoved = {
1447
- name: "Reaction",
1448
- title: "On Reaction Removed",
1449
- source: "linear.app",
1450
- icon: "linear",
1451
- filter: {
1452
- action: ["remove"]
1453
- },
1454
- examples: [reactionRemoved],
1455
- parsePayload: (payload) => payload,
1456
- runProperties: (payload) => [{ label: "Reaction ID", text: payload.data.id }]
1457
- };
1458
- var onReactionUpdated = {
1459
- name: "Reaction",
1460
- title: "On Reaction Updated",
1461
- source: "linear.app",
1462
- icon: "linear",
1463
- filter: {
1464
- action: ["update"]
1465
- },
1466
- examples: [reactionUpdated],
1467
- parsePayload: (payload) => payload,
1468
- runProperties: (payload) => [{ label: "Reaction ID", text: payload.data.id }]
1469
- };
1470
- zod.z.union([
1471
- zod.z.literal("Attachment"),
1472
- zod.z.literal("Comment"),
1473
- zod.z.literal("Cycle"),
1474
- zod.z.literal("Issue"),
1475
- zod.z.literal("IssueLabel"),
1476
- zod.z.literal("IssueSLA"),
1477
- zod.z.literal("Project"),
1478
- zod.z.literal("ProjectUpdate"),
1479
- zod.z.literal("Reaction")
1480
- ]);
1481
- var WebhookChangeActionTypeSchema = zod.z.union([
1482
- zod.z.literal("create"),
1483
- zod.z.literal("remove"),
1484
- zod.z.literal("update")
1485
- ]);
1486
- var WebhookSLAActionTypeSchema = zod.z.union([
1487
- zod.z.literal("set"),
1488
- zod.z.literal("breached"),
1489
- zod.z.literal("highRisk")
1490
- ]);
1491
- WebhookChangeActionTypeSchema.or(WebhookSLAActionTypeSchema);
1492
- var IssueLabelDataSchema = zod.z.object({
1493
- archivedAt: zod.z.coerce.date().optional().nullable(),
1494
- color: zod.z.string(),
1495
- createdAt: zod.z.coerce.date(),
1496
- creatorId: zod.z.string().optional().nullable(),
1497
- description: zod.z.string().optional().nullable(),
1498
- id: zod.z.string(),
1499
- // isGroup: z.boolean(), // missing
1500
- name: zod.z.string(),
1501
- organizationId: zod.z.string(),
1502
- parentId: zod.z.string().optional().nullable(),
1503
- teamId: zod.z.string().optional().nullable(),
1504
- updatedAt: zod.z.coerce.date()
1505
- });
1506
- var IssueDataSchema = zod.z.object({
1507
- archivedAt: zod.z.coerce.date().optional().nullable(),
1508
- assignee: zod.z.object({ id: zod.z.string(), name: zod.z.string() }).optional().nullable(),
1509
- assigneeId: zod.z.string().optional().nullable(),
1510
- autoArchivedAt: zod.z.coerce.date().optional().nullable(),
1511
- autoClosedAt: zod.z.coerce.date().optional().nullable(),
1512
- boardOrder: zod.z.number(),
1513
- canceledAt: zod.z.coerce.date().optional().nullable(),
1514
- completedAt: zod.z.coerce.date().optional().nullable(),
1515
- createdAt: zod.z.coerce.date(),
1516
- creatorId: zod.z.string().optional().nullable(),
1517
- cycleId: zod.z.string().optional().nullable(),
1518
- description: zod.z.string().optional().nullable(),
1519
- dueDate: zod.z.coerce.date().optional().nullable(),
1520
- // timeless
1521
- estimate: zod.z.number().optional().nullable(),
1522
- favoriteId: zod.z.string().optional().nullable(),
1523
- id: zod.z.string(),
1524
- labelIds: zod.z.array(zod.z.string()),
1525
- labels: zod.z.array(IssueLabelDataSchema.pick({ id: true, color: true, name: true })),
1526
- number: zod.z.number(),
1527
- parentId: zod.z.string().optional().nullable(),
1528
- previousIdentifiers: zod.z.array(zod.z.string()),
1529
- priority: zod.z.number(),
1530
- priorityLabel: zod.z.string(),
1531
- projectId: zod.z.string().optional().nullable(),
1532
- sortOrder: zod.z.number(),
1533
- state: zod.z.object({ id: zod.z.string(), color: zod.z.string(), name: zod.z.string(), type: zod.z.string() }),
1534
- startedAt: zod.z.coerce.date().optional().nullable(),
1535
- stateId: zod.z.string(),
1536
- subIssueSortOrder: zod.z.number().optional().nullable(),
1537
- subscriberIds: zod.z.array(zod.z.string()),
1538
- team: zod.z.object({ id: zod.z.string(), key: zod.z.string(), name: zod.z.string() }),
1539
- teamId: zod.z.string(),
1540
- title: zod.z.string(),
1541
- trashed: zod.z.boolean().optional().nullable(),
1542
- triagedAt: zod.z.coerce.date().optional().nullable(),
1543
- updatedAt: zod.z.coerce.date()
1544
- });
1545
- var AttachmentDataSchema = zod.z.object({
1546
- archivedAt: zod.z.coerce.date().optional().nullable(),
1547
- createdAt: zod.z.coerce.date(),
1548
- creatorId: zod.z.string().optional().nullable(),
1549
- groupBySource: zod.z.boolean(),
1550
- id: zod.z.string(),
1551
- issueId: zod.z.string(),
1552
- metadata: zod.z.object({}).passthrough(),
1553
- // JSONObject
1554
- source: zod.z.object({
1555
- type: zod.z.string().nullable(),
1556
- imageUrl: zod.z.string().url().nullable()
1557
- }).passthrough().partial().nullable(),
1558
- // JSONObject
1559
- sourceType: zod.z.string().optional().nullable(),
1560
- subtitle: zod.z.string().optional().nullable(),
1561
- title: zod.z.string(),
1562
- updatedAt: zod.z.coerce.date(),
1563
- url: zod.z.string().url()
1564
- });
1565
- var CommentDataSchema = zod.z.object({
1566
- archivedAt: zod.z.coerce.date().optional().nullable(),
1567
- body: zod.z.string(),
1568
- botActorId: zod.z.string().optional().nullable(),
1569
- createdAt: zod.z.coerce.date(),
1570
- editedAt: zod.z.string().optional().nullable(),
1571
- id: zod.z.string(),
1572
- issue: IssueDataSchema.pick({ id: true, title: true }),
1573
- issueId: zod.z.string(),
1574
- parentId: zod.z.string().optional().nullable(),
1575
- reactionData: zod.z.array(zod.z.object({}).passthrough()),
1576
- // JSONObject
1577
- updatedAt: zod.z.coerce.date(),
1578
- userId: zod.z.string().optional().nullable()
1579
- });
1580
- var ReactionDataSchema = zod.z.object({
1581
- archivedAt: zod.z.coerce.date().optional().nullable(),
1582
- comment: CommentDataSchema.pick({
1583
- id: true,
1584
- body: true,
1585
- userId: true
1586
- }).optional().nullable(),
1587
- // missing from official schema
1588
- createdAt: zod.z.coerce.date(),
1589
- emoji: zod.z.string(),
1590
- id: zod.z.string(),
1591
- updatedAt: zod.z.coerce.date(),
1592
- user: zod.z.object({ id: zod.z.string(), name: zod.z.string() }).optional().nullable(),
1593
- userId: zod.z.string().optional().nullable()
1594
- });
1595
- var MilestoneDataSchema = zod.z.object({
1596
- archivedAt: zod.z.coerce.date().optional().nullable(),
1597
- createdAt: zod.z.coerce.date(),
1598
- description: zod.z.string().optional().nullable(),
1599
- id: zod.z.string(),
1600
- name: zod.z.string(),
1601
- projectId: zod.z.string().optional().nullable(),
1602
- sortOrder: zod.z.number(),
1603
- targetDate: zod.z.coerce.date().optional().nullable(),
1604
- // timeless
1605
- updatedAt: zod.z.coerce.date()
1606
- });
1607
- var RoadmapDataSchema = zod.z.object({
1608
- archivedAt: zod.z.coerce.date().optional().nullable(),
1609
- color: zod.z.string().optional().nullable(),
1610
- createdAt: zod.z.coerce.date(),
1611
- creatorId: zod.z.string(),
1612
- description: zod.z.string().optional().nullable(),
1613
- id: zod.z.string(),
1614
- name: zod.z.string(),
1615
- organizationId: zod.z.string(),
1616
- ownerId: zod.z.string(),
1617
- slugId: zod.z.string(),
1618
- sortOrder: zod.z.number(),
1619
- updatedAt: zod.z.coerce.date()
1620
- });
1621
- var ProjectDataSchema = zod.z.object({
1622
- archivedAt: zod.z.coerce.date().optional().nullable(),
1623
- autoArchivedAt: zod.z.coerce.date().optional().nullable(),
1624
- canceledAt: zod.z.coerce.date().optional().nullable(),
1625
- color: zod.z.string(),
1626
- completedAt: zod.z.coerce.date().optional().nullable(),
1627
- completedIssueCountHistory: zod.z.array(zod.z.number()),
1628
- completedScopeHistory: zod.z.array(zod.z.number()),
1629
- content: zod.z.string().optional().nullable(),
1630
- convertedFromIssueId: zod.z.string().optional().nullable(),
1631
- createdAt: zod.z.coerce.date(),
1632
- creatorId: zod.z.string(),
1633
- description: zod.z.string(),
1634
- icon: zod.z.string().optional().nullable(),
1635
- id: zod.z.string(),
1636
- inProgressScopeHistory: zod.z.array(zod.z.number()),
1637
- integrationsSettingsId: zod.z.string().optional().nullable(),
1638
- issueCountHistory: zod.z.array(zod.z.number()),
1639
- leadId: zod.z.string(),
1640
- memberIds: zod.z.array(zod.z.string()),
1641
- milestones: zod.z.array(MilestoneDataSchema.pick({ id: true, name: true })),
1642
- // at projectMilestones key in official schema
1643
- name: zod.z.string(),
1644
- progress: zod.z.number().optional().nullable(),
1645
- // missing, should be NonNullable
1646
- projectUpdateRemindersPausedUntilAt: zod.z.coerce.date().optional().nullable(),
1647
- roadmaps: zod.z.array(RoadmapDataSchema.pick({ id: true, name: true })).optional().nullable(),
1648
- // missing from official schema
1649
- scope: zod.z.number().optional().nullable(),
1650
- // missing, should be NonNullable
1651
- scopeHistory: zod.z.array(zod.z.number()),
1652
- slackIssueComments: zod.z.boolean(),
1653
- slackIssueStatuses: zod.z.boolean(),
1654
- slackNewIssue: zod.z.boolean(),
1655
- slugId: zod.z.string(),
1656
- sortOrder: zod.z.number(),
1657
- startDate: zod.z.coerce.date().optional().nullable(),
1658
- // timeless
1659
- startedAt: zod.z.coerce.date().optional().nullable(),
1660
- state: zod.z.string(),
1661
- targetDate: zod.z.coerce.date().optional().nullable(),
1662
- // timeless
1663
- teamIds: zod.z.array(zod.z.string()),
1664
- trashed: zod.z.boolean().optional().nullable(),
1665
- updatedAt: zod.z.coerce.date()
1666
- });
1667
- var ProjectUpdateDataSchema = zod.z.object({
1668
- archivedAt: zod.z.coerce.date().optional().nullable(),
1669
- body: zod.z.string(),
1670
- createdAt: zod.z.coerce.date(),
1671
- // diff: z.any().optional().nullable(), // missing, "stringified" JSON but typed as Record
1672
- editedAt: zod.z.coerce.date().optional().nullable(),
1673
- health: zod.z.string(),
1674
- id: zod.z.string(),
1675
- infoSnapshot: zod.z.object({}).passthrough().optional().nullable(),
1676
- // JSONObject, marked as "internal"
1677
- project: ProjectDataSchema.pick({ id: true, name: true }),
1678
- projectId: zod.z.string(),
1679
- roadmaps: zod.z.array(RoadmapDataSchema.pick({ id: true, name: true })).optional().nullable(),
1680
- // missing from official schema
1681
- updatedAt: zod.z.coerce.date(),
1682
- user: zod.z.object({ id: zod.z.string(), name: zod.z.string() }),
1683
- userId: zod.z.string()
1684
- });
1685
- var CycleDataSchema = zod.z.object({
1686
- archivedAt: zod.z.coerce.date().optional().nullable(),
1687
- autoArchivedAt: zod.z.coerce.date().optional().nullable(),
1688
- completedAt: zod.z.coerce.date().optional().nullable(),
1689
- completedIssueCountHistory: zod.z.array(zod.z.number()),
1690
- completedScopeHistory: zod.z.array(zod.z.number()),
1691
- createdAt: zod.z.coerce.date(),
1692
- description: zod.z.string().optional().nullable(),
1693
- endsAt: zod.z.coerce.date(),
1694
- id: zod.z.string(),
1695
- inProgressScopeHistory: zod.z.array(zod.z.number()),
1696
- issueCountHistory: zod.z.array(zod.z.number()),
1697
- name: zod.z.string().optional().nullable(),
1698
- number: zod.z.number(),
1699
- progress: zod.z.number().optional().nullable(),
1700
- // missing, should be NonNullable
1701
- scopeHistory: zod.z.array(zod.z.number()),
1702
- startsAt: zod.z.coerce.date(),
1703
- teamId: zod.z.string(),
1704
- uncompletedIssuesUponCloseIds: zod.z.array(zod.z.string()),
1705
- updatedAt: zod.z.coerce.date()
1706
- });
1707
- var WebhookPayloadBaseSchema = zod.z.object({
1708
- createdAt: zod.z.coerce.date(),
1709
- organizationId: zod.z.string().optional().nullable(),
1710
- // missing from official schema - workspace id?
1711
- url: zod.z.string().url().optional().nullable(),
1712
- webhookId: zod.z.string(),
1713
- webhookTimestamp: zod.z.coerce.date()
1714
- });
1715
- var CREATE = zod.z.literal("create");
1716
- var REMOVE = zod.z.literal("remove");
1717
- var UPDATE = zod.z.literal("update");
1718
- var AttachmentEventBaseSchema = WebhookPayloadBaseSchema.extend({
1719
- type: zod.z.literal("Attachment"),
1720
- data: AttachmentDataSchema
1721
- });
1722
- var AttachmentEventSchema = zod.z.discriminatedUnion("action", [
1723
- AttachmentEventBaseSchema.extend({
1724
- action: CREATE
1725
- }),
1726
- AttachmentEventBaseSchema.extend({
1727
- action: REMOVE
1728
- }),
1729
- AttachmentEventBaseSchema.extend({
1730
- action: UPDATE,
1731
- updatedFrom: AttachmentDataSchema.partial()
1732
- })
1733
- ]);
1734
- var CommentEventBaseSchema = WebhookPayloadBaseSchema.extend({
1735
- type: zod.z.literal("Comment"),
1736
- data: CommentDataSchema
1737
- });
1738
- var CommentEventSchema = zod.z.discriminatedUnion("action", [
1739
- CommentEventBaseSchema.extend({
1740
- action: CREATE
1741
- }),
1742
- CommentEventBaseSchema.extend({
1743
- action: REMOVE
1744
- }),
1745
- CommentEventBaseSchema.extend({
1746
- action: UPDATE,
1747
- updatedFrom: CommentDataSchema.partial()
1748
- })
1749
- ]);
1750
- var CycleEventBaseSchema = WebhookPayloadBaseSchema.extend({
1751
- type: zod.z.literal("Cycle"),
1752
- data: CycleDataSchema
1753
- });
1754
- var CycleEventSchema = zod.z.discriminatedUnion("action", [
1755
- CycleEventBaseSchema.extend({
1756
- action: CREATE
1757
- }),
1758
- CycleEventBaseSchema.extend({
1759
- action: REMOVE
1760
- }),
1761
- CycleEventBaseSchema.extend({
1762
- action: UPDATE,
1763
- updatedFrom: CycleDataSchema.partial()
1764
- })
1765
- ]);
1766
- var IssueEventBaseSchema = WebhookPayloadBaseSchema.extend({
1767
- type: zod.z.literal("Issue"),
1768
- data: IssueDataSchema
1769
- });
1770
- var IssueEventSchema = zod.z.discriminatedUnion("action", [
1771
- IssueEventBaseSchema.extend({
1772
- action: CREATE
1773
- }),
1774
- IssueEventBaseSchema.extend({
1775
- action: REMOVE
1776
- }),
1777
- IssueEventBaseSchema.extend({
1778
- action: UPDATE,
1779
- updatedFrom: IssueDataSchema.partial()
1780
- })
1781
- ]);
1782
- var IssueLabelEventBaseSchema = WebhookPayloadBaseSchema.extend({
1783
- type: zod.z.literal("IssueLabel"),
1784
- data: IssueLabelDataSchema
1785
- });
1786
- var IssueLabelEventSchema = zod.z.discriminatedUnion("action", [
1787
- IssueLabelEventBaseSchema.extend({
1788
- action: CREATE
1789
- }),
1790
- IssueLabelEventBaseSchema.extend({
1791
- action: REMOVE
1792
- }),
1793
- IssueLabelEventBaseSchema.extend({
1794
- action: UPDATE,
1795
- updatedFrom: IssueLabelDataSchema.partial()
1796
- })
1797
- ]);
1798
- var IssueSLAEventBaseSchema = WebhookPayloadBaseSchema.extend({
1799
- type: zod.z.literal("IssueSLA"),
1800
- issueData: IssueDataSchema
1801
- });
1802
- var IssueSLAEventSchema = zod.z.discriminatedUnion("action", [
1803
- IssueSLAEventBaseSchema.extend({
1804
- action: zod.z.literal("set")
1805
- }),
1806
- IssueSLAEventBaseSchema.extend({
1807
- action: zod.z.literal("highRisk")
1808
- }),
1809
- IssueSLAEventBaseSchema.extend({
1810
- action: zod.z.literal("breached")
1811
- })
1812
- ]);
1813
- var ProjectEventBaseSchema = WebhookPayloadBaseSchema.extend({
1814
- type: zod.z.literal("Project"),
1815
- data: ProjectDataSchema
1816
- });
1817
- var ProjectEventSchema = zod.z.discriminatedUnion("action", [
1818
- ProjectEventBaseSchema.extend({
1819
- action: CREATE
1820
- }),
1821
- ProjectEventBaseSchema.extend({
1822
- action: REMOVE
1823
- }),
1824
- ProjectEventBaseSchema.extend({
1825
- action: UPDATE,
1826
- updatedFrom: ProjectDataSchema.partial()
1827
- })
1828
- ]);
1829
- var ProjectUpdateEventBaseSchema = WebhookPayloadBaseSchema.extend({
1830
- type: zod.z.literal("ProjectUpdate"),
1831
- data: ProjectUpdateDataSchema
1832
- });
1833
- var ProjectUpdateEventSchema = zod.z.discriminatedUnion("action", [
1834
- ProjectUpdateEventBaseSchema.extend({
1835
- action: CREATE
1836
- }),
1837
- ProjectUpdateEventBaseSchema.extend({
1838
- action: REMOVE
1839
- }),
1840
- ProjectUpdateEventBaseSchema.extend({
1841
- action: UPDATE,
1842
- updatedFrom: ProjectUpdateDataSchema.partial()
1843
- })
1844
- ]);
1845
- var ReactionEventBaseSchema = WebhookPayloadBaseSchema.extend({
1846
- type: zod.z.literal("Reaction"),
1847
- data: ReactionDataSchema
1848
- });
1849
- var ReactionEventSchema = zod.z.discriminatedUnion("action", [
1850
- ReactionEventBaseSchema.extend({
1851
- action: CREATE
1852
- }),
1853
- ReactionEventBaseSchema.extend({
1854
- action: REMOVE
1855
- }),
1856
- ReactionEventBaseSchema.extend({
1857
- action: UPDATE,
1858
- updatedFrom: ReactionDataSchema.partial()
1859
- })
1860
- ]);
1861
- var WebhookPayloadSchema = zod.z.union([
1862
- AttachmentEventSchema,
1863
- CommentEventSchema,
1864
- CycleEventSchema,
1865
- IssueEventSchema,
1866
- IssueLabelEventSchema,
1867
- IssueSLAEventSchema,
1868
- ProjectEventSchema,
1869
- ProjectUpdateEventSchema,
1870
- ReactionEventSchema
1871
- ]);
1872
- var Webhooks = class {
1873
- constructor(runTask) {
1874
- this.runTask = runTask;
1875
- }
1876
- webhook(key, params) {
1877
- return this.runTask(
1878
- key,
1879
- async (client, task, io) => {
1880
- return serializeLinearOutput(await client.webhook(params.id));
1881
- },
1882
- {
1883
- name: "Get Webhook",
1884
- params,
1885
- properties: [{ label: "Webhook ID", text: params.id }]
1886
- }
1887
- );
1888
- }
1889
- webhooks(key, params) {
1890
- return this.runTask(
1891
- key,
1892
- async (client, task, io) => {
1893
- let connections = await client.webhooks(params);
1894
- const hooks = connections.nodes;
1895
- while (connections.pageInfo.hasNextPage) {
1896
- connections = await connections.fetchNext();
1897
- hooks.push(...connections.nodes);
1898
- }
1899
- return serializeLinearOutput(hooks);
1900
- },
1901
- {
1902
- name: "List Webhooks",
1903
- params,
1904
- properties: queryProperties(params ?? {})
1905
- }
1906
- );
1907
- }
1908
- createWebhook(key, params) {
1909
- return this.runTask(
1910
- key,
1911
- async (client, task, io) => {
1912
- const payload = await client.createWebhook({ ...params, allPublicTeams: !params.teamId });
1913
- return serializeLinearOutput({
1914
- ...payload,
1915
- webhook: await payload.webhook
1916
- });
1917
- },
1918
- {
1919
- name: "Create Webhook",
1920
- params,
1921
- properties: [
1922
- { label: "Webhook URL", text: params.url },
1923
- { label: "Resource Types", text: params.resourceTypes.join(", ") }
1924
- ]
1925
- }
1926
- );
1927
- }
1928
- deleteWebhook(key, params) {
1929
- return this.runTask(
1930
- key,
1931
- async (client, task, io) => {
1932
- return serializeLinearOutput(await client.deleteWebhook(params.id));
1933
- },
1934
- {
1935
- name: "Delete Webhook",
1936
- params,
1937
- properties: [{ label: "Webhook ID", text: params.id }]
1938
- }
1939
- );
1940
- }
1941
- updateWebhook(key, params) {
1942
- return this.runTask(
1943
- key,
1944
- async (client, task) => {
1945
- const payload = await client.updateWebhook(params.id, params.input);
1946
- return serializeLinearOutput({
1947
- ...payload,
1948
- webhook: await payload.webhook
1949
- });
1950
- },
1951
- {
1952
- name: "Update Webhook",
1953
- params,
1954
- properties: [
1955
- { label: "Webhook ID", text: params.id },
1956
- ...params.input.url ? [{ label: "Webhook URL", text: params.input.url }] : [],
1957
- ...params.input.resourceTypes ? [{ label: "Resource Types", text: params.input.resourceTypes.join(", ") }] : []
1958
- ]
1959
- }
1960
- );
1961
- }
1962
- };
1963
- function createTrigger(source, event, params) {
1964
- return new sdk$1.ExternalSourceTrigger({
1965
- event,
1966
- params,
1967
- source,
1968
- options: {}
1969
- });
1970
- }
1971
- var WebhookRegistrationDataSchema = zod.z.object({
1972
- success: zod.z.literal(true),
1973
- webhook: zod.z.object({
1974
- id: zod.z.string(),
1975
- enabled: zod.z.boolean()
1976
- })
1977
- });
1978
- function createWebhookEventSource(integration) {
1979
- return new sdk$1.ExternalSource("HTTP", {
1980
- id: "linear.webhook",
1981
- schema: zod.z.object({
1982
- teamId: zod.z.string().optional()
1983
- }),
1984
- version: "0.1.0",
1985
- integration,
1986
- key: (params) => `${params.teamId ? params.teamId : "all"}`,
1987
- handler: webhookHandler,
1988
- register: async (event, io, ctx) => {
1989
- const { params, source: httpSource, options } = event;
1990
- const webhookData = WebhookRegistrationDataSchema.safeParse(httpSource.data);
1991
- const allEvents = Array.from(/* @__PURE__ */ new Set([...options.event.desired, ...options.event.missing]));
1992
- const registeredOptions = {
1993
- event: allEvents
1994
- };
1995
- const label = `trigger.${params.teamId ? params.teamId : "all"}`;
1996
- if (httpSource.active && webhookData.success) {
1997
- const hasMissingOptions = Object.values(options).some(
1998
- (option) => option.missing.length > 0
1999
- );
2000
- if (!hasMissingOptions)
2001
- return;
2002
- const updatedWebhook = await io.integration.updateWebhook("update-webhook", {
2003
- id: webhookData.data.webhook.id,
2004
- input: {
2005
- label,
2006
- resourceTypes: allEvents,
2007
- secret: httpSource.secret,
2008
- url: httpSource.url
2009
- }
2010
- });
2011
- return {
2012
- data: WebhookRegistrationDataSchema.parse(updatedWebhook),
2013
- options: registeredOptions
2014
- };
2015
- }
2016
- const listResponse = await io.integration.webhooks("list-webhooks");
2017
- const existingWebhook = listResponse.find((w) => w.url === httpSource.url);
2018
- if (existingWebhook) {
2019
- const updatedWebhook = await io.integration.updateWebhook("update-webhook", {
2020
- id: existingWebhook.id,
2021
- input: {
2022
- label,
2023
- resourceTypes: allEvents,
2024
- secret: httpSource.secret,
2025
- url: httpSource.url
2026
- }
2027
- });
2028
- return {
2029
- data: WebhookRegistrationDataSchema.parse(updatedWebhook),
2030
- options: registeredOptions
2031
- };
2032
- }
2033
- const createPayload = await io.integration.createWebhook("create-webhook", {
2034
- label,
2035
- resourceTypes: allEvents,
2036
- secret: httpSource.secret,
2037
- teamId: params.teamId,
2038
- url: httpSource.url
2039
- });
2040
- return {
2041
- data: WebhookRegistrationDataSchema.parse(createPayload),
2042
- secret: (await createPayload.webhook)?.secret,
2043
- options: registeredOptions
2044
- };
2045
- }
2046
- });
2047
- }
2048
- async function webhookHandler(event, logger, integration) {
2049
- logger.debug("[@trigger.dev/linear] Handling webhook payload");
2050
- const { rawEvent: request, source } = event;
2051
- const LINEAR_IPS = ["35.231.147.226", "35.243.134.228"];
2052
- const clientIp = request.headers.get("cf-connecting-ip") ?? (request.headers.get("x-real-ip") ?? request.headers.get("x-forwarded-for") ?? // default to allowing request if expected headers missing
2053
- LINEAR_IPS[0]).split(",")[0];
2054
- if (!LINEAR_IPS.includes(clientIp)) {
2055
- logger.error("[@trigger.dev/linear] Error validating webhook source, IP invalid.");
2056
- throw Error("[@trigger.dev/linear] Invalid source IP.");
2057
- }
2058
- const payloadUuid = request.headers.get("Linear-Delivery");
2059
- const payloadEvent = request.headers.get("Linear-Event");
2060
- if (!payloadUuid || !payloadEvent) {
2061
- logger.debug("[@trigger.dev/linear] Missing required Linear headers");
2062
- return { events: [] };
2063
- }
2064
- if (!request.body) {
2065
- logger.debug("[@trigger.dev/linear] No body found");
2066
- return { events: [] };
2067
- }
2068
- const signature = request.headers.get(sdk.LINEAR_WEBHOOK_SIGNATURE_HEADER);
2069
- if (!signature) {
2070
- logger.error("[@trigger.dev/linear] Error validating webhook signature, no signature found");
2071
- throw Error("[@trigger.dev/linear] No signature found");
2072
- }
2073
- const rawBody = await request.text();
2074
- const body = JSON.parse(rawBody);
2075
- const webhookHelper = new sdk.LinearWebhooks(source.secret);
2076
- if (!webhookHelper.verify(node_buffer.Buffer.from(rawBody), signature, body[sdk.LINEAR_WEBHOOK_TS_FIELD])) {
2077
- logger.error("[@trigger.dev/linear] Error validating webhook signature, they don't match");
2078
- throw Error("[@trigger.dev/linear] Invalid signature");
2079
- }
2080
- const webhookPayload = WebhookPayloadSchema.parse(body);
2081
- return {
2082
- events: [
2083
- {
2084
- id: payloadUuid,
2085
- name: payloadEvent,
2086
- source: "linear.app",
2087
- payload: webhookPayload,
2088
- context: {}
2089
- }
2090
- ]
2091
- };
2092
- }
2093
-
2094
- // src/index.ts
2095
- var _webhooks, webhooks_get;
2096
- var _Linear = class _Linear {
2097
- constructor(options) {
2098
- this.options = options;
2099
- __privateAdd(this, _webhooks);
2100
- this.webhook = __privateGet(this, _webhooks, webhooks_get).webhook;
2101
- this.webhooks = __privateGet(this, _webhooks, webhooks_get).webhooks;
2102
- this.createWebhook = __privateGet(this, _webhooks, webhooks_get).createWebhook;
2103
- this.deleteWebhook = __privateGet(this, _webhooks, webhooks_get).deleteWebhook;
2104
- this.updateWebhook = __privateGet(this, _webhooks, webhooks_get).updateWebhook;
2105
- if (Object.keys(options).includes("apiKey") && !options.apiKey) {
2106
- throw `Can't create Linear integration (${options.id}) as apiKey was undefined`;
2107
- }
2108
- this._options = options;
2109
- }
2110
- get authSource() {
2111
- return this._options.apiKey ? "LOCAL" : "HOSTED";
2112
- }
2113
- get id() {
2114
- return this._options.id;
2115
- }
2116
- get metadata() {
2117
- return { id: "linear", name: "Linear" };
2118
- }
2119
- get source() {
2120
- return createWebhookEventSource(this);
2121
- }
2122
- cloneForRun(io, connectionKey, auth) {
2123
- const linear = new _Linear(this._options);
2124
- linear._io = io;
2125
- linear._connectionKey = connectionKey;
2126
- linear._client = this.createClient(auth);
2127
- return linear;
2128
- }
2129
- createClient(auth) {
2130
- if (auth) {
2131
- return new sdk.LinearClient({
2132
- accessToken: auth.accessToken
2133
- });
2134
- }
2135
- if (this._options.apiKey) {
2136
- return new sdk.LinearClient({
2137
- apiKey: this._options.apiKey
2138
- });
2139
- }
2140
- throw new Error("No auth");
2141
- }
2142
- runTask(key, callback, options, errorCallback) {
2143
- if (!this._io)
2144
- throw new Error("No IO");
2145
- if (!this._connectionKey)
2146
- throw new Error("No connection key");
2147
- return this._io.runTask(
2148
- key,
2149
- (task, io) => {
2150
- if (!this._client)
2151
- throw new Error("No client");
2152
- return callback(this._client, task, io);
2153
- },
2154
- {
2155
- icon: "linear",
2156
- retry: sdk$1.retry.standardBackoff,
2157
- ...options ?? {},
2158
- connectionKey: this._connectionKey
2159
- },
2160
- errorCallback ?? onError
2161
- );
2162
- }
2163
- async getAll(task, key, params = {}) {
2164
- const boundTask = task.bind(this);
2165
- let edges = await boundTask(`${key}-0`, params);
2166
- let nodes = edges.nodes;
2167
- for (let i = 1; edges.pageInfo.hasNextPage; i++) {
2168
- edges = await boundTask(`${key}-${i}`, { ...params, after: edges.pageInfo.endCursor });
2169
- nodes = nodes.concat(edges.nodes);
2170
- }
2171
- return nodes;
2172
- }
2173
- attachment(key, params) {
2174
- return this.runTask(
2175
- key,
2176
- async (client) => {
2177
- const entity = await client.attachment(params.id);
2178
- return serializeLinearOutput(entity);
2179
- },
2180
- {
2181
- name: "Get Attachment",
2182
- params,
2183
- properties: [{ label: "Attachment ID", text: params.id }]
2184
- }
2185
- );
2186
- }
2187
- attachments(key, params = {}) {
2188
- return this.runTask(
2189
- key,
2190
- async (client) => {
2191
- const edges = await client.attachments(params);
2192
- return serializeLinearOutput(edges);
2193
- },
2194
- {
2195
- name: "Get Attachments",
2196
- params,
2197
- properties: queryProperties(params)
2198
- }
2199
- );
2200
- }
2201
- createAttachment(key, params) {
2202
- return this.runTask(
2203
- key,
2204
- async (client) => {
2205
- const payload = await client.createAttachment(params);
2206
- return serializeLinearOutput(await payload.attachment);
2207
- },
2208
- {
2209
- name: "Create Attachment",
2210
- params,
2211
- properties: [
2212
- { label: "Issue ID", text: params.issueId },
2213
- { label: "Title", text: params.title },
2214
- { label: "URL", text: params.url }
2215
- ]
2216
- }
2217
- );
2218
- }
2219
- deleteAttachment(key, params) {
2220
- return this.runTask(key, (client) => client.deleteAttachment(params.id), {
2221
- name: "Delete Attachment",
2222
- params,
2223
- properties: [{ label: "Attachment ID", text: params.id }]
2224
- });
2225
- }
2226
- updateAttachment(key, params) {
2227
- return this.runTask(
2228
- key,
2229
- async (client) => {
2230
- const payload = await client.updateAttachment(params.id, params.input);
2231
- return serializeLinearOutput(await payload.attachment);
2232
- },
2233
- {
2234
- name: "Update Attachment",
2235
- params,
2236
- properties: [{ label: "Attachment ID", text: params.id }]
2237
- }
2238
- );
2239
- }
2240
- attachmentLinkDiscord(key, params) {
2241
- return this.runTask(
2242
- key,
2243
- async (client) => {
2244
- const payload = await client.attachmentLinkDiscord(
2245
- params.channelId,
2246
- params.issueId,
2247
- params.messageId,
2248
- params.url,
2249
- params.variables
2250
- );
2251
- return serializeLinearOutput(await payload.attachment);
2252
- },
2253
- {
2254
- name: "Link Discord Message",
2255
- params,
2256
- properties: [
2257
- { label: "Issue ID", text: params.issueId },
2258
- { label: "Channel ID", text: params.channelId },
2259
- { label: "Message ID", text: params.messageId },
2260
- { label: "URL", text: params.url }
2261
- ]
2262
- }
2263
- );
2264
- }
2265
- attachmentLinkFront(key, params) {
2266
- return this.runTask(
2267
- key,
2268
- async (client) => {
2269
- const payload = await client.attachmentLinkFront(
2270
- params.conversationId,
2271
- params.issueId,
2272
- params.variables
2273
- );
2274
- return serializeLinearOutput(payload);
2275
- },
2276
- {
2277
- name: "Link Front Conversation",
2278
- params,
2279
- properties: [
2280
- { label: "Issue ID", text: params.issueId },
2281
- { label: "Conversation ID", text: params.conversationId }
2282
- ]
2283
- }
2284
- );
2285
- }
2286
- attachmentLinkIntercom(key, params) {
2287
- return this.runTask(
2288
- key,
2289
- async (client) => {
2290
- const payload = await client.attachmentLinkIntercom(
2291
- params.conversationId,
2292
- params.issueId,
2293
- params.variables
2294
- );
2295
- return serializeLinearOutput(await payload.attachment);
2296
- },
2297
- {
2298
- name: "Link Intercom Conversation",
2299
- params,
2300
- properties: [
2301
- { label: "Issue ID", text: params.issueId },
2302
- { label: "Conversation ID", text: params.conversationId }
2303
- ]
2304
- }
2305
- );
2306
- }
2307
- attachmentLinkJiraIssue(key, params) {
2308
- return this.runTask(
2309
- key,
2310
- async (client) => {
2311
- const payload = await client.attachmentLinkJiraIssue(params.issueId, params.jiraIssueId);
2312
- return serializeLinearOutput(await payload.attachment);
2313
- },
2314
- {
2315
- name: "Link Jira Issue",
2316
- params,
2317
- properties: [
2318
- { label: "Issue ID", text: params.issueId },
2319
- { label: "Jira Issue ID", text: params.jiraIssueId }
2320
- ]
2321
- }
2322
- );
2323
- }
2324
- attachmentLinkSlack(key, params) {
2325
- return this.runTask(
2326
- key,
2327
- async (client) => {
2328
- const payload = await client.attachmentLinkSlack(
2329
- params.channel,
2330
- params.issueId,
2331
- params.latest,
2332
- params.url,
2333
- params.variables
2334
- );
2335
- return serializeLinearOutput(await payload.attachment);
2336
- },
2337
- {
2338
- name: "Link Slack Message",
2339
- params,
2340
- properties: [
2341
- { label: "Issue ID", text: params.issueId },
2342
- { label: "Channel", text: params.channel },
2343
- { label: "Latest", text: params.latest },
2344
- { label: "URL", text: params.url }
2345
- ]
2346
- }
2347
- );
2348
- }
2349
- attachmentLinkURL(key, params) {
2350
- return this.runTask(
2351
- key,
2352
- async (client) => {
2353
- const payload = await client.attachmentLinkURL(
2354
- params.issueId,
2355
- params.url,
2356
- params.variables
2357
- );
2358
- return serializeLinearOutput(await payload.attachment);
2359
- },
2360
- {
2361
- name: "Link URL",
2362
- params,
2363
- properties: [
2364
- { label: "Issue ID", text: params.issueId },
2365
- { label: "URL", text: params.url }
2366
- ]
2367
- }
2368
- );
2369
- }
2370
- attachmentLinkZendesk(key, params) {
2371
- return this.runTask(
2372
- key,
2373
- async (client) => {
2374
- const payload = await client.attachmentLinkZendesk(
2375
- params.issueId,
2376
- params.ticketId,
2377
- params.variables
2378
- );
2379
- return serializeLinearOutput(await payload.attachment);
2380
- },
2381
- {
2382
- name: "Link Zendesk Ticket",
2383
- params,
2384
- properties: [
2385
- { label: "Issue ID", text: params.issueId },
2386
- { label: "Ticket ID", text: params.ticketId }
2387
- ]
2388
- }
2389
- );
2390
- }
2391
- comment(key, params) {
2392
- return this.runTask(
2393
- key,
2394
- async (client) => {
2395
- const entity = await client.comment(params.id);
2396
- return serializeLinearOutput(entity);
2397
- },
2398
- {
2399
- name: "Get Comment",
2400
- params,
2401
- properties: [{ label: "Comment ID", text: params.id }]
2402
- }
2403
- );
2404
- }
2405
- comments(key, params = {}) {
2406
- return this.runTask(
2407
- key,
2408
- async (client) => {
2409
- const edges = await client.comments(params);
2410
- return serializeLinearOutput(edges);
2411
- },
2412
- {
2413
- name: "Get Comments",
2414
- params,
2415
- properties: queryProperties(params)
2416
- }
2417
- );
2418
- }
2419
- createComment(key, params) {
2420
- return this.runTask(
2421
- key,
2422
- async (client) => {
2423
- const payload = await client.createComment(params);
2424
- return serializeLinearOutput(await payload.comment);
2425
- },
2426
- {
2427
- name: "Create Comment",
2428
- params,
2429
- properties: [
2430
- { label: "Issue ID", text: params.issueId },
2431
- { label: "Body", text: params.body ?? "" }
2432
- ]
2433
- }
2434
- );
2435
- }
2436
- deleteComment(key, params) {
2437
- return this.runTask(key, (client) => client.deleteComment(params.id), {
2438
- name: "Delete Comment",
2439
- params,
2440
- properties: [{ label: "Comment ID", text: params.id }]
2441
- });
2442
- }
2443
- updateComment(key, params) {
2444
- return this.runTask(
2445
- key,
2446
- async (client) => {
2447
- const payload = await client.updateComment(params.id, params.input);
2448
- return serializeLinearOutput(await payload.comment);
2449
- },
2450
- {
2451
- name: "Update Comment",
2452
- params,
2453
- properties: [{ label: "Comment ID", text: params.id }]
2454
- }
2455
- );
2456
- }
2457
- archiveCycle(key, params) {
2458
- return this.runTask(
2459
- key,
2460
- async (client) => {
2461
- const payload = await client.archiveCycle(params.id);
2462
- return serializeLinearOutput({
2463
- ...payload,
2464
- entity: await payload.entity
2465
- });
2466
- },
2467
- {
2468
- name: "Archive Cycle",
2469
- params,
2470
- properties: [{ label: "Cycle ID", text: params.id }]
2471
- }
2472
- );
2473
- }
2474
- createCycle(key, params) {
2475
- return this.runTask(
2476
- key,
2477
- async (client) => {
2478
- const payload = await client.createCycle(params);
2479
- return serializeLinearOutput(await payload.cycle);
2480
- },
2481
- {
2482
- name: "Create Cycle",
2483
- params,
2484
- properties: [
2485
- { label: "Team ID", text: params.teamId },
2486
- { label: "Start at", text: params.startsAt.toISOString() },
2487
- { label: "Ends at", text: params.endsAt.toISOString() }
2488
- ]
2489
- }
2490
- );
2491
- }
2492
- // deleteCycle() does not exist
2493
- updateCycle(key, params) {
2494
- return this.runTask(
2495
- key,
2496
- async (client) => {
2497
- const payload = await client.updateCycle(params.id, params.input);
2498
- return serializeLinearOutput(await payload.cycle);
2499
- },
2500
- {
2501
- name: "Update Cycle",
2502
- params,
2503
- properties: [{ label: "Cycle ID", text: params.id }]
2504
- }
2505
- );
2506
- }
2507
- document(key, params) {
2508
- return this.runTask(
2509
- key,
2510
- async (client) => {
2511
- const entity = await client.document(params.id);
2512
- return serializeLinearOutput(entity);
2513
- },
2514
- {
2515
- name: "Get Document",
2516
- params,
2517
- properties: [{ label: "Document ID", text: params.id }]
2518
- }
2519
- );
2520
- }
2521
- documents(key, params) {
2522
- return this.runTask(
2523
- key,
2524
- async (client) => {
2525
- const edges = await client.documents(params);
2526
- return serializeLinearOutput(edges);
2527
- },
2528
- {
2529
- name: "Get Documents",
2530
- params,
2531
- properties: queryProperties(params)
2532
- }
2533
- );
2534
- }
2535
- createDocument(key, params) {
2536
- return this.runTask(
2537
- key,
2538
- async (client) => {
2539
- const payload = await client.createDocument(params);
2540
- return serializeLinearOutput(await payload.document);
2541
- },
2542
- {
2543
- name: "Create Document",
2544
- params,
2545
- properties: [
2546
- { label: "Project ID", text: params.projectId },
2547
- { label: "Title", text: params.title }
2548
- ]
2549
- }
2550
- );
2551
- }
2552
- searchDocuments(key, params) {
2553
- return this.runTask(
2554
- key,
2555
- async (client) => {
2556
- const payload = await client.searchDocuments(params.term, params.variables);
2557
- return serializeLinearOutput(payload);
2558
- },
2559
- {
2560
- name: "Search Documents",
2561
- params,
2562
- properties: [{ label: "Search Term", text: params.term }]
2563
- }
2564
- );
2565
- }
2566
- favorite(key, params) {
2567
- return this.runTask(
2568
- key,
2569
- async (client) => {
2570
- const entity = await client.favorite(params.id);
2571
- return serializeLinearOutput(entity);
2572
- },
2573
- {
2574
- name: "Get Favorite",
2575
- params,
2576
- properties: [{ label: "Favorite ID", text: params.id }]
2577
- }
2578
- );
2579
- }
2580
- favorites(key, params = {}) {
2581
- return this.runTask(
2582
- key,
2583
- async (client) => {
2584
- const edges = await client.favorites(params);
2585
- return serializeLinearOutput(edges);
2586
- },
2587
- {
2588
- name: "Get Favorites",
2589
- params,
2590
- properties: queryProperties(params)
2591
- }
2592
- );
2593
- }
2594
- createFavorite(key, params) {
2595
- return this.runTask(
2596
- key,
2597
- async (client) => {
2598
- const payload = await client.createFavorite(params);
2599
- return serializeLinearOutput(await payload.favorite);
2600
- },
2601
- {
2602
- name: "Create Favorite",
2603
- params
2604
- }
2605
- );
2606
- }
2607
- issue(key, params) {
2608
- return this.runTask(
2609
- key,
2610
- async (client) => {
2611
- const entity = await client.issue(params.id);
2612
- return serializeLinearOutput(entity);
2613
- },
2614
- {
2615
- name: "Get Issue",
2616
- params,
2617
- properties: [{ label: "Issue ID", text: params.id }]
2618
- }
2619
- );
2620
- }
2621
- issues(key, params = {}) {
2622
- return this.runTask(
2623
- key,
2624
- async (client) => {
2625
- const edges = await client.issues(params);
2626
- return serializeLinearOutput(edges);
2627
- },
2628
- {
2629
- name: "Get Issues",
2630
- params,
2631
- properties: queryProperties(params)
2632
- }
2633
- );
2634
- }
2635
- archiveIssue(key, params) {
2636
- return this.runTask(
2637
- key,
2638
- async (client) => {
2639
- const payload = await client.archiveIssue(params.id, params.variables);
2640
- return serializeLinearOutput({
2641
- ...payload,
2642
- entity: await payload.entity
2643
- });
2644
- },
2645
- {
2646
- name: "Archive Issue",
2647
- params,
2648
- properties: [{ label: "Issue ID", text: params.id }]
2649
- }
2650
- );
2651
- }
2652
- createIssue(key, params) {
2653
- return this.runTask(
2654
- key,
2655
- async (client) => {
2656
- const payload = await client.createIssue(params);
2657
- return serializeLinearOutput(await payload.issue);
2658
- },
2659
- {
2660
- name: "Create Issue",
2661
- params,
2662
- properties: [
2663
- { label: "Team ID", text: params.teamId },
2664
- { label: "Title", text: params.title }
2665
- ]
2666
- }
2667
- );
2668
- }
2669
- deleteIssue(key, params) {
2670
- return this.runTask(
2671
- key,
2672
- async (client) => {
2673
- const payload = await client.deleteIssue(params.id);
2674
- return serializeLinearOutput(await payload.entity);
2675
- },
2676
- {
2677
- name: "Delete Issue",
2678
- params,
2679
- properties: [{ label: "Issue ID", text: params.id }]
2680
- }
2681
- );
2682
- }
2683
- searchIssues(key, params) {
2684
- return this.runTask(
2685
- key,
2686
- async (client) => {
2687
- const payload = await client.searchIssues(params.term, params.variables);
2688
- return serializeLinearOutput(payload);
2689
- },
2690
- {
2691
- name: "Search Issues",
2692
- params,
2693
- properties: [{ label: "Search Term", text: params.term }]
2694
- }
2695
- );
2696
- }
2697
- updateIssue(key, params) {
2698
- return this.runTask(
2699
- key,
2700
- async (client) => {
2701
- const payload = await client.updateIssue(params.id, params.input);
2702
- return serializeLinearOutput(await payload.issue);
2703
- },
2704
- {
2705
- name: "Update Issue",
2706
- params,
2707
- properties: [{ label: "Issue ID", text: params.id }]
2708
- }
2709
- );
2710
- }
2711
- issueLabel(key, params) {
2712
- return this.runTask(
2713
- key,
2714
- async (client) => {
2715
- const entity = await client.issueLabel(params.id);
2716
- return serializeLinearOutput(entity);
2717
- },
2718
- {
2719
- name: "Get IssueLabel",
2720
- params,
2721
- properties: [{ label: "IssueLabel ID", text: params.id }]
2722
- }
2723
- );
2724
- }
2725
- issueLabels(key, params = {}) {
2726
- return this.runTask(
2727
- key,
2728
- async (client) => {
2729
- const edges = await client.issueLabels(params);
2730
- return serializeLinearOutput(edges);
2731
- },
2732
- {
2733
- name: "Get IssueLabels",
2734
- params,
2735
- properties: queryProperties(params)
2736
- }
2737
- );
2738
- }
2739
- createIssueLabel(key, params) {
2740
- return this.runTask(
2741
- key,
2742
- async (client) => {
2743
- const payload = await client.createIssueLabel(params);
2744
- return serializeLinearOutput(await payload.issueLabel);
2745
- },
2746
- {
2747
- name: "Create IssueLabel",
2748
- params,
2749
- properties: [{ label: "Label name", text: params.name }]
2750
- }
2751
- );
2752
- }
2753
- deleteIssueLabel(key, params) {
2754
- return this.runTask(key, (client) => client.deleteIssueLabel(params.id), {
2755
- name: "Delete IssueLabel",
2756
- params,
2757
- properties: [{ label: "Label ID", text: params.id }]
2758
- });
2759
- }
2760
- updateIssueLabel(key, params) {
2761
- return this.runTask(
2762
- key,
2763
- async (client) => {
2764
- const payload = await client.updateIssueLabel(params.id, params.input);
2765
- return serializeLinearOutput(await payload.issueLabel);
2766
- },
2767
- {
2768
- name: "Update IssueLabel",
2769
- params,
2770
- properties: [{ label: "Label ID", text: params.id }]
2771
- }
2772
- );
2773
- }
2774
- issuePriorityValues(key) {
2775
- return this.runTask(
2776
- key,
2777
- async (client) => {
2778
- const entity = await client.issuePriorityValues;
2779
- return serializeLinearOutput(entity);
2780
- },
2781
- {
2782
- name: "Get Issue Priority Values"
2783
- }
2784
- );
2785
- }
2786
- issueRelation(key, params) {
2787
- return this.runTask(
2788
- key,
2789
- async (client) => {
2790
- const entity = await client.issueRelation(params.id);
2791
- return serializeLinearOutput(entity);
2792
- },
2793
- {
2794
- name: "Get IssueRelation",
2795
- params,
2796
- properties: [{ label: "IssueRelation ID", text: params.id }]
2797
- }
2798
- );
2799
- }
2800
- issueRelations(key, params = {}) {
2801
- return this.runTask(
2802
- key,
2803
- async (client) => {
2804
- const edges = await client.issueRelations(params);
2805
- return serializeLinearOutput(edges);
2806
- },
2807
- {
2808
- name: "Get IssueRelations",
2809
- params,
2810
- properties: queryProperties(params)
2811
- }
2812
- );
2813
- }
2814
- createIssueRelation(key, params) {
2815
- return this.runTask(
2816
- key,
2817
- async (client) => {
2818
- const payload = await client.createIssueRelation(params);
2819
- return serializeLinearOutput(await payload.issueRelation);
2820
- },
2821
- {
2822
- name: "Create IssueRelation",
2823
- params,
2824
- properties: [
2825
- { label: "Issue ID", text: params.issueId },
2826
- { label: "Related Issue ID", text: params.relatedIssueId },
2827
- { label: "Relation Type", text: params.type }
2828
- ]
2829
- }
2830
- );
2831
- }
2832
- notification(key, params) {
2833
- return this.runTask(
2834
- key,
2835
- async (client) => {
2836
- const entity = await client.notification(params.id);
2837
- return serializeLinearOutput(entity);
2838
- },
2839
- {
2840
- name: "Get Notification",
2841
- params,
2842
- properties: [{ label: "Notification ID", text: params.id }]
2843
- }
2844
- );
2845
- }
2846
- notifications(key, params = {}) {
2847
- return this.runTask(
2848
- key,
2849
- async (client) => {
2850
- const edges = await client.notifications(params);
2851
- return serializeLinearOutput(edges);
2852
- },
2853
- {
2854
- name: "Get Notifications",
2855
- params,
2856
- properties: queryProperties(params)
2857
- }
2858
- );
2859
- }
2860
- archiveNotification(key, params) {
2861
- return this.runTask(
2862
- key,
2863
- async (client) => {
2864
- const payload = await client.archiveNotification(params.id);
2865
- return serializeLinearOutput(payload);
2866
- },
2867
- {
2868
- name: "Archive Notification",
2869
- params,
2870
- properties: [{ label: "Notification ID", text: params.id }]
2871
- }
2872
- );
2873
- }
2874
- createNotificationSubscription(key, params) {
2875
- return this.runTask(
2876
- key,
2877
- async (client) => {
2878
- const payload = await client.createNotificationSubscription(params.input);
2879
- return serializeLinearOutput(payload);
2880
- },
2881
- {
2882
- name: "Create Notification Subscription",
2883
- params
2884
- }
2885
- );
2886
- }
2887
- organization(key) {
2888
- return this.runTask(
2889
- key,
2890
- async (client) => {
2891
- const entity = await client.organization;
2892
- return serializeLinearOutput(entity);
2893
- },
2894
- {
2895
- name: "Get Viewer's Organization"
2896
- }
2897
- );
2898
- }
2899
- createOrganizationFromOnboarding(key, params) {
2900
- return this.runTask(
2901
- key,
2902
- async (client) => {
2903
- const payload = await client.createOrganizationFromOnboarding(
2904
- params.input,
2905
- params.variables
2906
- );
2907
- return serializeLinearOutput(await payload.organization);
2908
- },
2909
- {
2910
- name: "Create Organization",
2911
- params,
2912
- properties: [
2913
- { label: "Name", text: params.input.name },
2914
- { label: "URL Key", text: params.input.urlKey }
2915
- ]
2916
- }
2917
- );
2918
- }
2919
- /** WARNING: Causes internal server errors on Linear's side, regardless of input. */
2920
- createOrganizationInvite(key, params) {
2921
- return this.runTask(
2922
- key,
2923
- async (client) => {
2924
- const payload = await client.createOrganizationInvite(params.input);
2925
- return serializeLinearOutput(await payload.organizationInvite);
2926
- },
2927
- {
2928
- name: "Create Organization Invite",
2929
- params,
2930
- properties: [{ label: "Invitee Email", text: params.input.email }]
2931
- }
2932
- );
2933
- }
2934
- project(key, params) {
2935
- return this.runTask(
2936
- key,
2937
- async (client) => {
2938
- const entity = await client.project(params.id);
2939
- return serializeLinearOutput(entity);
2940
- },
2941
- {
2942
- name: "Get Project",
2943
- params,
2944
- properties: [{ label: "Project ID", text: params.id }]
2945
- }
2946
- );
2947
- }
2948
- projects(key, params = {}) {
2949
- return this.runTask(
2950
- key,
2951
- async (client) => {
2952
- const edges = await client.projects(params);
2953
- return serializeLinearOutput(edges);
2954
- },
2955
- {
2956
- name: "Get Projects",
2957
- params,
2958
- properties: queryProperties(params)
2959
- }
2960
- );
2961
- }
2962
- archiveProject(key, params) {
2963
- return this.runTask(
2964
- key,
2965
- async (client) => {
2966
- const payload = await client.archiveProject(params.id, params.variables);
2967
- return serializeLinearOutput({
2968
- ...payload,
2969
- entity: await payload.entity
2970
- });
2971
- },
2972
- {
2973
- name: "Archive Project",
2974
- params,
2975
- properties: [{ label: "Project ID", text: params.id }]
2976
- }
2977
- );
2978
- }
2979
- createProject(key, params) {
2980
- return this.runTask(
2981
- key,
2982
- async (client) => {
2983
- const payload = await client.createProject(params);
2984
- return serializeLinearOutput(await payload.project);
2985
- },
2986
- {
2987
- name: "Create Project",
2988
- params,
2989
- properties: [
2990
- { label: "Team IDs", text: params.teamIds.join(", ") },
2991
- { label: "Project name", text: params.name }
2992
- ]
2993
- }
2994
- );
2995
- }
2996
- deleteProject(key, params) {
2997
- return this.runTask(
2998
- key,
2999
- async (client) => {
3000
- const payload = await client.deleteProject(params.id);
3001
- return serializeLinearOutput(await payload.entity);
3002
- },
3003
- {
3004
- name: "Delete Project",
3005
- params,
3006
- properties: [{ label: "Project ID", text: params.id }]
3007
- }
3008
- );
3009
- }
3010
- searchProjects(key, params) {
3011
- return this.runTask(
3012
- key,
3013
- async (client) => {
3014
- const payload = await client.searchProjects(params.term, params.variables);
3015
- return serializeLinearOutput(payload);
3016
- },
3017
- {
3018
- name: "Search Projects",
3019
- params,
3020
- properties: [{ label: "Search Term", text: params.term }]
3021
- }
3022
- );
3023
- }
3024
- updateProject(key, params) {
3025
- return this.runTask(
3026
- key,
3027
- async (client) => {
3028
- const payload = await client.updateProject(params.id, params.input);
3029
- return serializeLinearOutput(await payload.project);
3030
- },
3031
- {
3032
- name: "Update Project",
3033
- params,
3034
- properties: [{ label: "Project ID", text: params.id }]
3035
- }
3036
- );
3037
- }
3038
- projectLink(key, params) {
3039
- return this.runTask(
3040
- key,
3041
- async (client) => {
3042
- const entity = await client.projectLink(params.id);
3043
- return serializeLinearOutput(entity);
3044
- },
3045
- {
3046
- name: "Get ProjectLink",
3047
- params,
3048
- properties: [{ label: "ProjectLink ID", text: params.id }]
3049
- }
3050
- );
3051
- }
3052
- projectLinks(key, params = {}) {
3053
- return this.runTask(
3054
- key,
3055
- async (client) => {
3056
- const edges = await client.projectLinks(params);
3057
- return serializeLinearOutput(edges);
3058
- },
3059
- {
3060
- name: "Get ProjectLinks",
3061
- params,
3062
- properties: queryProperties(params)
3063
- }
3064
- );
3065
- }
3066
- createProjectLink(key, params) {
3067
- return this.runTask(
3068
- key,
3069
- async (client) => {
3070
- const payload = await client.createProjectLink(params);
3071
- return serializeLinearOutput(await payload.projectLink);
3072
- },
3073
- {
3074
- name: "Create ProjectLink",
3075
- params,
3076
- properties: [
3077
- { label: "Project ID", text: params.projectId },
3078
- { label: "Link Label", text: params.label },
3079
- { label: "Link URL", text: params.url }
3080
- ]
3081
- }
3082
- );
3083
- }
3084
- createProjectMilestone(key, params) {
3085
- return this.runTask(
3086
- key,
3087
- async (client) => {
3088
- const payload = await client.createProjectMilestone(params);
3089
- return serializeLinearOutput(await payload.projectMilestone);
3090
- },
3091
- {
3092
- name: "Create ProjectMilestone",
3093
- params,
3094
- properties: [
3095
- { label: "Project ID", text: params.projectId },
3096
- { label: "Milestone Name", text: params.name }
3097
- ]
3098
- }
3099
- );
3100
- }
3101
- projectUpdate(key, params) {
3102
- return this.runTask(
3103
- key,
3104
- async (client) => {
3105
- const entity = await client.projectUpdate(params.id);
3106
- return serializeLinearOutput(entity);
3107
- },
3108
- {
3109
- name: "Get ProjectUpdate",
3110
- params,
3111
- properties: [{ label: "ProjectUpdate ID", text: params.id }]
3112
- }
3113
- );
3114
- }
3115
- projectUpdates(key, params = {}) {
3116
- return this.runTask(
3117
- key,
3118
- async (client) => {
3119
- const edges = await client.projectUpdates(params);
3120
- return serializeLinearOutput(edges);
3121
- },
3122
- {
3123
- name: "Get ProjectUpdates",
3124
- params,
3125
- properties: queryProperties(params)
3126
- }
3127
- );
3128
- }
3129
- createProjectUpdate(key, params) {
3130
- return this.runTask(
3131
- key,
3132
- async (client) => {
3133
- const payload = await client.createProjectUpdate(params);
3134
- return serializeLinearOutput(await payload.projectUpdate);
3135
- },
3136
- {
3137
- name: "Create ProjectUpdate",
3138
- params,
3139
- properties: [{ label: "Project ID", text: params.projectId }]
3140
- }
3141
- );
3142
- }
3143
- deleteProjectUpdate(key, params) {
3144
- return this.runTask(key, (client) => client.deleteProjectUpdate(params.id), {
3145
- name: "Delete ProjectUpdate",
3146
- params,
3147
- properties: [{ label: "ProjectUpdate ID", text: params.id }]
3148
- });
3149
- }
3150
- updateProjectUpdate(key, params) {
3151
- return this.runTask(
3152
- key,
3153
- async (client) => {
3154
- const payload = await client.updateProjectUpdate(params.id, params.input);
3155
- return serializeLinearOutput(await payload.projectUpdate);
3156
- },
3157
- {
3158
- name: "Update ProjectUpdate",
3159
- params,
3160
- properties: [{ label: "ProjectUpdate ID", text: params.id }]
3161
- }
3162
- );
3163
- }
3164
- createReaction(key, params) {
3165
- return this.runTask(
3166
- key,
3167
- async (client) => {
3168
- const payload = await client.createReaction(params);
3169
- return serializeLinearOutput(await payload.reaction);
3170
- },
3171
- {
3172
- name: "Create Reaction",
3173
- params,
3174
- properties: [
3175
- ...params.commentId ? [{ label: "Comment ID", text: params.commentId }] : [],
3176
- ...params.issueId ? [{ label: "Issue ID", text: params.issueId }] : [],
3177
- ...params.projectUpdateId ? [{ label: "ProjectUpdate ID", text: params.projectUpdateId }] : [],
3178
- { label: "Emoji", text: params.emoji }
3179
- ]
3180
- }
3181
- );
3182
- }
3183
- deleteReaction(key, params) {
3184
- return this.runTask(key, (client) => client.deleteReaction(params.id), {
3185
- name: "Delete Reaction",
3186
- params,
3187
- properties: [{ label: "Reaction ID", text: params.id }]
3188
- });
3189
- }
3190
- archiveRoadmap(key, params) {
3191
- return this.runTask(
3192
- key,
3193
- async (client) => {
3194
- const payload = await client.archiveRoadmap(params.id);
3195
- return serializeLinearOutput({
3196
- ...payload,
3197
- entity: await payload.entity
3198
- });
3199
- },
3200
- {
3201
- name: "Archive Roadmap",
3202
- params,
3203
- properties: [{ label: "Roadmap ID", text: params.id }]
3204
- }
3205
- );
3206
- }
3207
- createRoadmap(key, params) {
3208
- return this.runTask(
3209
- key,
3210
- async (client) => {
3211
- const payload = await client.createRoadmap(params);
3212
- return serializeLinearOutput(await payload.roadmap);
3213
- },
3214
- {
3215
- name: "Create Roadmap",
3216
- params,
3217
- properties: [{ label: "Roadmap Name", text: params.name }]
3218
- }
3219
- );
3220
- }
3221
- team(key, params) {
3222
- return this.runTask(
3223
- key,
3224
- async (client) => {
3225
- const entity = await client.team(params.id);
3226
- return serializeLinearOutput(entity);
3227
- },
3228
- {
3229
- name: "Get Team",
3230
- params,
3231
- properties: [{ label: "Team ID", text: params.id }]
3232
- }
3233
- );
3234
- }
3235
- teams(key, params = {}) {
3236
- return this.runTask(
3237
- key,
3238
- async (client) => {
3239
- const edges = await client.teams(params);
3240
- return serializeLinearOutput(edges);
3241
- },
3242
- {
3243
- name: "Get Teams",
3244
- params,
3245
- properties: queryProperties(params)
3246
- }
3247
- );
3248
- }
3249
- createTeam(key, params) {
3250
- return this.runTask(
3251
- key,
3252
- async (client) => {
3253
- const payload = await client.createTeam(params);
3254
- return serializeLinearOutput(await payload.team);
3255
- },
3256
- {
3257
- name: "Create Team",
3258
- params,
3259
- properties: [{ label: "Team Name", text: params.name }]
3260
- }
3261
- );
3262
- }
3263
- teamMembership(key, params) {
3264
- return this.runTask(
3265
- key,
3266
- async (client) => {
3267
- const entity = await client.teamMembership(params.id);
3268
- return serializeLinearOutput(entity);
3269
- },
3270
- {
3271
- name: "Get TeamMembership",
3272
- params,
3273
- properties: [{ label: "TeamMembership ID", text: params.id }]
3274
- }
3275
- );
3276
- }
3277
- teamMemberships(key, params = {}) {
3278
- return this.runTask(
3279
- key,
3280
- async (client) => {
3281
- const edges = await client.teamMemberships(params);
3282
- return serializeLinearOutput(edges);
3283
- },
3284
- {
3285
- name: "Get TeamMemberships",
3286
- params,
3287
- properties: queryProperties(params)
3288
- }
3289
- );
3290
- }
3291
- createTeamMembership(key, params) {
3292
- return this.runTask(
3293
- key,
3294
- async (client) => {
3295
- const payload = await client.createTeamMembership(params);
3296
- return serializeLinearOutput(await payload.teamMembership);
3297
- },
3298
- {
3299
- name: "Create TeamMembership",
3300
- params,
3301
- properties: [
3302
- { label: "Team ID", text: params.teamId },
3303
- { label: "User ID", text: params.userId }
3304
- ]
3305
- }
3306
- );
3307
- }
3308
- template(key, params) {
3309
- return this.runTask(
3310
- key,
3311
- async (client) => {
3312
- const entity = await client.template(params.id);
3313
- return serializeLinearOutput(entity);
3314
- },
3315
- {
3316
- name: "Get Template",
3317
- properties: [{ label: "Template ID", text: params.id }]
3318
- }
3319
- );
3320
- }
3321
- templates(key) {
3322
- return this.runTask(
3323
- key,
3324
- async (client) => {
3325
- const entity = await client.templates;
3326
- return serializeLinearOutput(entity);
3327
- },
3328
- {
3329
- name: "Get Templates"
3330
- }
3331
- );
3332
- }
3333
- user(key, params) {
3334
- return this.runTask(
3335
- key,
3336
- async (client) => {
3337
- const entity = await client.user(params.id);
3338
- return serializeLinearOutput(entity);
3339
- },
3340
- {
3341
- name: "Get User",
3342
- params,
3343
- properties: [{ label: "User ID", text: params.id }]
3344
- }
3345
- );
3346
- }
3347
- users(key, params = {}) {
3348
- return this.runTask(
3349
- key,
3350
- async (client) => {
3351
- const edges = await client.users(params);
3352
- return serializeLinearOutput(edges);
3353
- },
3354
- {
3355
- name: "Get Users",
3356
- params,
3357
- properties: queryProperties(params)
3358
- }
3359
- );
3360
- }
3361
- updateUser(key, params) {
3362
- return this.runTask(
3363
- key,
3364
- async (client) => {
3365
- const payload = await client.updateUser(params.id, params.input);
3366
- return serializeLinearOutput(await payload.user);
3367
- },
3368
- {
3369
- name: "Update User",
3370
- params,
3371
- properties: [{ label: "User ID", text: params.id }]
3372
- }
3373
- );
3374
- }
3375
- viewer(key) {
3376
- return this.runTask(
3377
- key,
3378
- async (client) => {
3379
- const entity = await client.viewer;
3380
- return serializeLinearOutput(entity);
3381
- },
3382
- {
3383
- name: "Get Viewer"
3384
- }
3385
- );
3386
- }
3387
- workflowState(key, params) {
3388
- return this.runTask(
3389
- key,
3390
- async (client) => {
3391
- const entity = await client.workflowState(params.id);
3392
- return serializeLinearOutput(entity);
3393
- },
3394
- {
3395
- name: "Get WorkflowState",
3396
- params,
3397
- properties: [{ label: "WorkflowState ID", text: params.id }]
3398
- }
3399
- );
3400
- }
3401
- workflowStates(key, params = {}) {
3402
- return this.runTask(
3403
- key,
3404
- async (client) => {
3405
- const edges = await client.workflowStates(params);
3406
- return serializeLinearOutput(edges);
3407
- },
3408
- {
3409
- name: "Get WorkflowStates",
3410
- params,
3411
- properties: queryProperties(params)
3412
- }
3413
- );
3414
- }
3415
- archiveWorkflowState(key, params) {
3416
- return this.runTask(
3417
- key,
3418
- async (client) => {
3419
- const payload = await client.archiveWorkflowState(params.id);
3420
- return serializeLinearOutput({
3421
- ...payload,
3422
- entity: await payload.entity
3423
- });
3424
- },
3425
- {
3426
- name: "Archive WorkflowState",
3427
- params,
3428
- properties: [{ label: "WorkflowState ID", text: params.id }]
3429
- }
3430
- );
3431
- }
3432
- createWorkflowState(key, params) {
3433
- return this.runTask(
3434
- key,
3435
- async (client) => {
3436
- const payload = await client.createWorkflowState(params);
3437
- return serializeLinearOutput(await payload.workflowState);
3438
- },
3439
- {
3440
- name: "Create WorkflowState",
3441
- params,
3442
- properties: [
3443
- { label: "Team ID", text: params.teamId },
3444
- { label: "Workflow Type", text: params.type },
3445
- { label: "State Name", text: params.name },
3446
- { label: "State Color", text: params.color }
3447
- ]
3448
- }
3449
- );
3450
- }
3451
- // updateReaction() does not exist
3452
- /** **WARNING:** Still in alpha - use with caution! */
3453
- onAttachment(params = {}) {
3454
- return createTrigger(this.source, onAttachment, params);
3455
- }
3456
- /** **WARNING:** Still in alpha - use with caution! */
3457
- onAttachmentCreated(params = {}) {
3458
- return createTrigger(this.source, onAttachmentCreated, params);
3459
- }
3460
- /** **WARNING:** Still in alpha - use with caution! */
3461
- onAttachmentRemoved(params = {}) {
3462
- return createTrigger(this.source, onAttachmentRemoved, params);
3463
- }
3464
- /** **WARNING:** Still in alpha - use with caution! */
3465
- onAttachmentUpdated(params = {}) {
3466
- return createTrigger(this.source, onAttachmentUpdated, params);
3467
- }
3468
- onComment(params = {}) {
3469
- return createTrigger(this.source, onComment, params);
3470
- }
3471
- onCommentCreated(params = {}) {
3472
- return createTrigger(this.source, onCommentCreated, params);
3473
- }
3474
- onCommentRemoved(params = {}) {
3475
- return createTrigger(this.source, onCommentRemoved, params);
3476
- }
3477
- onCommentUpdated(params = {}) {
3478
- return createTrigger(this.source, onCommentUpdated, params);
3479
- }
3480
- onCycle(params = {}) {
3481
- return createTrigger(this.source, onCycle, params);
3482
- }
3483
- onCycleCreated(params = {}) {
3484
- return createTrigger(this.source, onCycleCreated, params);
3485
- }
3486
- onCycleRemoved(params = {}) {
3487
- return createTrigger(this.source, onCycleRemoved, params);
3488
- }
3489
- onCycleUpdated(params = {}) {
3490
- return createTrigger(this.source, onCycleUpdated, params);
3491
- }
3492
- onIssue(params = {}) {
3493
- return createTrigger(this.source, onIssue, params);
3494
- }
3495
- onIssueCreated(params = {}) {
3496
- return createTrigger(this.source, onIssueCreated, params);
3497
- }
3498
- onIssueRemoved(params = {}) {
3499
- return createTrigger(this.source, onIssueRemoved, params);
3500
- }
3501
- onIssueUpdated(params = {}) {
3502
- return createTrigger(this.source, onIssueUpdated, params);
3503
- }
3504
- onIssueLabel(params = {}) {
3505
- return createTrigger(this.source, onIssueLabel, params);
3506
- }
3507
- onIssueLabelCreated(params = {}) {
3508
- return createTrigger(this.source, onIssueLabelCreated, params);
3509
- }
3510
- onIssueLabelRemoved(params = {}) {
3511
- return createTrigger(this.source, onIssueLabelRemoved, params);
3512
- }
3513
- onIssueLabelUpdated(params = {}) {
3514
- return createTrigger(this.source, onIssueLabelUpdated, params);
3515
- }
3516
- onIssueSLA(params = {}) {
3517
- return createTrigger(this.source, onIssueSLA, params);
3518
- }
3519
- onIssueSLASet(params = {}) {
3520
- return createTrigger(this.source, onIssueSLASet, params);
3521
- }
3522
- onIssueSLABreached(params = {}) {
3523
- return createTrigger(this.source, onIssueSLABreached, params);
3524
- }
3525
- onIssueSLAHighRisk(params = {}) {
3526
- return createTrigger(this.source, onIssueSLAHighRisk, params);
3527
- }
3528
- onProject(params = {}) {
3529
- return createTrigger(this.source, onProject, params);
3530
- }
3531
- onProjectCreated(params = {}) {
3532
- return createTrigger(this.source, onProjectCreated, params);
3533
- }
3534
- onProjectRemoved(params = {}) {
3535
- return createTrigger(this.source, onProjectRemoved, params);
3536
- }
3537
- onProjectUpdated(params = {}) {
3538
- return createTrigger(this.source, onProjectUpdated, params);
3539
- }
3540
- onProjectUpdate(params = {}) {
3541
- return createTrigger(this.source, onProjectUpdate, params);
3542
- }
3543
- onProjectUpdateCreated(params = {}) {
3544
- return createTrigger(this.source, onProjectUpdateCreated, params);
3545
- }
3546
- onProjectUpdateRemoved(params = {}) {
3547
- return createTrigger(this.source, onProjectUpdateRemoved, params);
3548
- }
3549
- onProjectUpdateUpdated(params = {}) {
3550
- return createTrigger(this.source, onProjectUpdateUpdated, params);
3551
- }
3552
- onReaction(params = {}) {
3553
- return createTrigger(this.source, onReaction, params);
3554
- }
3555
- onReactionCreated(params = {}) {
3556
- return createTrigger(this.source, onReactionCreated, params);
3557
- }
3558
- onReactionRemoved(params = {}) {
3559
- return createTrigger(this.source, onReactionRemoved, params);
3560
- }
3561
- /** Good luck ever triggering this! */
3562
- onReactionUpdated(params = {}) {
3563
- return createTrigger(this.source, onReactionUpdated, params);
3564
- }
3565
- };
3566
- _webhooks = new WeakSet();
3567
- webhooks_get = function() {
3568
- return new Webhooks(this.runTask.bind(this));
3569
- };
3570
- var Linear2 = _Linear;
3571
- function onError(error) {
3572
- if (error instanceof sdk.LinearError) {
3573
- if (error.errors?.some((e) => e.userError)) {
3574
- return {
3575
- skipRetrying: true
3576
- };
3577
- }
3578
- }
3579
- if (!(error instanceof sdk.RatelimitedLinearError)) {
3580
- return;
3581
- }
3582
- const rateLimitRemaining = error.raw?.response?.headers?.get("X-RateLimit-Requests-Remaining");
3583
- const rateLimitReset = error.raw?.response?.headers?.get("X-RateLimit-Requests-Reset");
3584
- if (rateLimitRemaining === "0" && rateLimitReset) {
3585
- const resetDate = new Date(Number(rateLimitReset) * 1e3);
3586
- return {
3587
- retryAt: resetDate,
3588
- error
3589
- };
3590
- }
3591
- const queryComplexity = error.raw?.response?.headers?.get("X-Complexity");
3592
- const complexityRemaining = error.raw?.response?.headers?.get("X-RateLimit-Complexity-Remaining");
3593
- const complexityReset = error.raw?.response?.headers?.get("X-RateLimit-Complexity-Reset");
3594
- if ((complexityRemaining === "0" || Number(complexityRemaining) < Number(queryComplexity)) && complexityReset) {
3595
- const resetDate = new Date(Number(complexityReset) * 1e3);
3596
- return {
3597
- retryAt: resetDate,
3598
- error
3599
- };
3600
- }
3601
- }
3602
- var serializeLinearOutput = (obj) => {
3603
- return JSON.parse(JSON.stringify(obj), (key, value) => {
3604
- if (typeof value === "function" || key.startsWith("_")) {
3605
- return void 0;
3606
- }
3607
- return value;
3608
- });
3609
- };
3610
- var PaginationOrderBy = sdk.LinearDocument.PaginationOrderBy;
3611
-
3612
- exports.Linear = Linear2;
3613
- exports.PaginationOrderBy = PaginationOrderBy;
3614
- exports.events = events_exports;
3615
- exports.onError = onError;
3616
- exports.serializeLinearOutput = serializeLinearOutput;
3617
- //# sourceMappingURL=out.js.map
3618
- //# sourceMappingURL=index.js.map