@corsair-dev/linear 0.1.8 → 0.1.9
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/README.md +4 -4
- package/dist/endpoints/types.d.ts +148 -0
- package/dist/endpoints/types.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -22
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -14,17 +14,17 @@ pnpm add @corsair-dev/linear
|
|
|
14
14
|
|-----------|--------------|------|-------------|
|
|
15
15
|
| `comments.create` | `linear.api.comments.create` | `write` | Post a comment on an issue |
|
|
16
16
|
| `comments.delete` | `linear.api.comments.delete` | `destructive` | Delete a comment [DESTRUCTIVE] |
|
|
17
|
-
| `comments.list` | `linear.api.comments.list` | `read` |
|
|
17
|
+
| `comments.list` | `linear.api.comments.list` | `read` | Comments on one issue; issueId is the UUID or an identifier such as "ENG-123". |
|
|
18
18
|
| `comments.update` | `linear.api.comments.update` | `write` | Update a comment |
|
|
19
19
|
| `issues.create` | `linear.api.issues.create` | `write` | Create a new issue |
|
|
20
20
|
| `issues.delete` | `linear.api.issues.delete` | `destructive` | Permanently delete an issue [DESTRUCTIVE · IRREVERSIBLE] |
|
|
21
|
-
| `issues.get` | `linear.api.issues.get` | `read` |
|
|
22
|
-
| `issues.list` | `linear.api.issues.list` | `read` |
|
|
21
|
+
| `issues.get` | `linear.api.issues.get` | `read` | Reads one issue; id is the UUID or an identifier such as "ENG-123". |
|
|
22
|
+
| `issues.list` | `linear.api.issues.list` | `read` | Lists issues, newest created first, across the workspace or one team; filter by assignee, state, labels or project. |
|
|
23
23
|
| `issues.update` | `linear.api.issues.update` | `write` | Update an existing issue |
|
|
24
24
|
| `projects.create` | `linear.api.projects.create` | `write` | Create a new project |
|
|
25
25
|
| `projects.delete` | `linear.api.projects.delete` | `destructive` | Permanently delete a project [DESTRUCTIVE · IRREVERSIBLE] |
|
|
26
26
|
| `projects.get` | `linear.api.projects.get` | `read` | Get a specific project |
|
|
27
|
-
| `projects.list` | `linear.api.projects.list` | `read` |
|
|
27
|
+
| `projects.list` | `linear.api.projects.list` | `read` | Lists every project in the workspace; there is no team filter, so check each project's teams. Page with after. |
|
|
28
28
|
| `projects.update` | `linear.api.projects.update` | `write` | Update an existing project |
|
|
29
29
|
| `teams.get` | `linear.api.teams.get` | `read` | Get a specific team |
|
|
30
30
|
| `teams.list` | `linear.api.teams.list` | `read` | List teams in the workspace |
|
|
@@ -26,6 +26,150 @@ declare const IdComparatorSchema: z.ZodObject<{
|
|
|
26
26
|
in: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
27
27
|
nin: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
28
28
|
}, z.core.$strict>;
|
|
29
|
+
declare const AssigneeFilterSchema: z.ZodObject<{
|
|
30
|
+
id: z.ZodOptional<z.ZodObject<{
|
|
31
|
+
eq: z.ZodOptional<z.ZodString>;
|
|
32
|
+
neq: z.ZodOptional<z.ZodString>;
|
|
33
|
+
in: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
34
|
+
nin: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
35
|
+
}, z.core.$strict>>;
|
|
36
|
+
isMe: z.ZodOptional<z.ZodObject<{
|
|
37
|
+
eq: z.ZodOptional<z.ZodBoolean>;
|
|
38
|
+
neq: z.ZodOptional<z.ZodBoolean>;
|
|
39
|
+
}, z.core.$strict>>;
|
|
40
|
+
name: z.ZodOptional<z.ZodObject<{
|
|
41
|
+
eq: z.ZodOptional<z.ZodString>;
|
|
42
|
+
neq: z.ZodOptional<z.ZodString>;
|
|
43
|
+
in: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
44
|
+
nin: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
45
|
+
contains: z.ZodOptional<z.ZodString>;
|
|
46
|
+
containsIgnoreCase: z.ZodOptional<z.ZodString>;
|
|
47
|
+
notContains: z.ZodOptional<z.ZodString>;
|
|
48
|
+
notContainsIgnoreCase: z.ZodOptional<z.ZodString>;
|
|
49
|
+
startsWith: z.ZodOptional<z.ZodString>;
|
|
50
|
+
endsWith: z.ZodOptional<z.ZodString>;
|
|
51
|
+
}, z.core.$strict>>;
|
|
52
|
+
displayName: z.ZodOptional<z.ZodObject<{
|
|
53
|
+
eq: z.ZodOptional<z.ZodString>;
|
|
54
|
+
neq: z.ZodOptional<z.ZodString>;
|
|
55
|
+
in: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
56
|
+
nin: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
57
|
+
contains: z.ZodOptional<z.ZodString>;
|
|
58
|
+
containsIgnoreCase: z.ZodOptional<z.ZodString>;
|
|
59
|
+
notContains: z.ZodOptional<z.ZodString>;
|
|
60
|
+
notContainsIgnoreCase: z.ZodOptional<z.ZodString>;
|
|
61
|
+
startsWith: z.ZodOptional<z.ZodString>;
|
|
62
|
+
endsWith: z.ZodOptional<z.ZodString>;
|
|
63
|
+
}, z.core.$strict>>;
|
|
64
|
+
email: z.ZodOptional<z.ZodObject<{
|
|
65
|
+
eq: z.ZodOptional<z.ZodString>;
|
|
66
|
+
neq: z.ZodOptional<z.ZodString>;
|
|
67
|
+
in: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
68
|
+
nin: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
69
|
+
contains: z.ZodOptional<z.ZodString>;
|
|
70
|
+
containsIgnoreCase: z.ZodOptional<z.ZodString>;
|
|
71
|
+
notContains: z.ZodOptional<z.ZodString>;
|
|
72
|
+
notContainsIgnoreCase: z.ZodOptional<z.ZodString>;
|
|
73
|
+
startsWith: z.ZodOptional<z.ZodString>;
|
|
74
|
+
endsWith: z.ZodOptional<z.ZodString>;
|
|
75
|
+
}, z.core.$strict>>;
|
|
76
|
+
null: z.ZodOptional<z.ZodBoolean>;
|
|
77
|
+
}, z.core.$strict>;
|
|
78
|
+
declare const StateFilterSchema: z.ZodObject<{
|
|
79
|
+
id: z.ZodOptional<z.ZodObject<{
|
|
80
|
+
eq: z.ZodOptional<z.ZodString>;
|
|
81
|
+
neq: z.ZodOptional<z.ZodString>;
|
|
82
|
+
in: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
83
|
+
nin: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
84
|
+
}, z.core.$strict>>;
|
|
85
|
+
name: z.ZodOptional<z.ZodObject<{
|
|
86
|
+
eq: z.ZodOptional<z.ZodString>;
|
|
87
|
+
neq: z.ZodOptional<z.ZodString>;
|
|
88
|
+
in: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
89
|
+
nin: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
90
|
+
contains: z.ZodOptional<z.ZodString>;
|
|
91
|
+
containsIgnoreCase: z.ZodOptional<z.ZodString>;
|
|
92
|
+
notContains: z.ZodOptional<z.ZodString>;
|
|
93
|
+
notContainsIgnoreCase: z.ZodOptional<z.ZodString>;
|
|
94
|
+
startsWith: z.ZodOptional<z.ZodString>;
|
|
95
|
+
endsWith: z.ZodOptional<z.ZodString>;
|
|
96
|
+
}, z.core.$strict>>;
|
|
97
|
+
type: z.ZodOptional<z.ZodObject<{
|
|
98
|
+
eq: z.ZodOptional<z.ZodString>;
|
|
99
|
+
neq: z.ZodOptional<z.ZodString>;
|
|
100
|
+
in: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
101
|
+
nin: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
102
|
+
contains: z.ZodOptional<z.ZodString>;
|
|
103
|
+
containsIgnoreCase: z.ZodOptional<z.ZodString>;
|
|
104
|
+
notContains: z.ZodOptional<z.ZodString>;
|
|
105
|
+
notContainsIgnoreCase: z.ZodOptional<z.ZodString>;
|
|
106
|
+
startsWith: z.ZodOptional<z.ZodString>;
|
|
107
|
+
endsWith: z.ZodOptional<z.ZodString>;
|
|
108
|
+
}, z.core.$strict>>;
|
|
109
|
+
}, z.core.$strict>;
|
|
110
|
+
declare const LabelsFilterSchema: z.ZodObject<{
|
|
111
|
+
some: z.ZodOptional<z.ZodObject<{
|
|
112
|
+
id: z.ZodOptional<z.ZodObject<{
|
|
113
|
+
eq: z.ZodOptional<z.ZodString>;
|
|
114
|
+
neq: z.ZodOptional<z.ZodString>;
|
|
115
|
+
in: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
116
|
+
nin: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
117
|
+
}, z.core.$strict>>;
|
|
118
|
+
name: z.ZodOptional<z.ZodObject<{
|
|
119
|
+
eq: z.ZodOptional<z.ZodString>;
|
|
120
|
+
neq: z.ZodOptional<z.ZodString>;
|
|
121
|
+
in: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
122
|
+
nin: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
123
|
+
contains: z.ZodOptional<z.ZodString>;
|
|
124
|
+
containsIgnoreCase: z.ZodOptional<z.ZodString>;
|
|
125
|
+
notContains: z.ZodOptional<z.ZodString>;
|
|
126
|
+
notContainsIgnoreCase: z.ZodOptional<z.ZodString>;
|
|
127
|
+
startsWith: z.ZodOptional<z.ZodString>;
|
|
128
|
+
endsWith: z.ZodOptional<z.ZodString>;
|
|
129
|
+
}, z.core.$strict>>;
|
|
130
|
+
}, z.core.$strict>>;
|
|
131
|
+
every: z.ZodOptional<z.ZodObject<{
|
|
132
|
+
id: z.ZodOptional<z.ZodObject<{
|
|
133
|
+
eq: z.ZodOptional<z.ZodString>;
|
|
134
|
+
neq: z.ZodOptional<z.ZodString>;
|
|
135
|
+
in: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
136
|
+
nin: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
137
|
+
}, z.core.$strict>>;
|
|
138
|
+
name: z.ZodOptional<z.ZodObject<{
|
|
139
|
+
eq: z.ZodOptional<z.ZodString>;
|
|
140
|
+
neq: z.ZodOptional<z.ZodString>;
|
|
141
|
+
in: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
142
|
+
nin: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
143
|
+
contains: z.ZodOptional<z.ZodString>;
|
|
144
|
+
containsIgnoreCase: z.ZodOptional<z.ZodString>;
|
|
145
|
+
notContains: z.ZodOptional<z.ZodString>;
|
|
146
|
+
notContainsIgnoreCase: z.ZodOptional<z.ZodString>;
|
|
147
|
+
startsWith: z.ZodOptional<z.ZodString>;
|
|
148
|
+
endsWith: z.ZodOptional<z.ZodString>;
|
|
149
|
+
}, z.core.$strict>>;
|
|
150
|
+
}, z.core.$strict>>;
|
|
151
|
+
}, z.core.$strict>;
|
|
152
|
+
declare const ProjectFilterSchema: z.ZodObject<{
|
|
153
|
+
id: z.ZodOptional<z.ZodObject<{
|
|
154
|
+
eq: z.ZodOptional<z.ZodString>;
|
|
155
|
+
neq: z.ZodOptional<z.ZodString>;
|
|
156
|
+
in: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
157
|
+
nin: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
158
|
+
}, z.core.$strict>>;
|
|
159
|
+
name: z.ZodOptional<z.ZodObject<{
|
|
160
|
+
eq: z.ZodOptional<z.ZodString>;
|
|
161
|
+
neq: z.ZodOptional<z.ZodString>;
|
|
162
|
+
in: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
163
|
+
nin: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
164
|
+
contains: z.ZodOptional<z.ZodString>;
|
|
165
|
+
containsIgnoreCase: z.ZodOptional<z.ZodString>;
|
|
166
|
+
notContains: z.ZodOptional<z.ZodString>;
|
|
167
|
+
notContainsIgnoreCase: z.ZodOptional<z.ZodString>;
|
|
168
|
+
startsWith: z.ZodOptional<z.ZodString>;
|
|
169
|
+
endsWith: z.ZodOptional<z.ZodString>;
|
|
170
|
+
}, z.core.$strict>>;
|
|
171
|
+
null: z.ZodOptional<z.ZodBoolean>;
|
|
172
|
+
}, z.core.$strict>;
|
|
29
173
|
export type IssueFilter = {
|
|
30
174
|
createdAt?: z.infer<typeof DateComparatorSchema>;
|
|
31
175
|
updatedAt?: z.infer<typeof DateComparatorSchema>;
|
|
@@ -34,6 +178,10 @@ export type IssueFilter = {
|
|
|
34
178
|
team?: {
|
|
35
179
|
id?: z.infer<typeof IdComparatorSchema>;
|
|
36
180
|
};
|
|
181
|
+
assignee?: z.infer<typeof AssigneeFilterSchema>;
|
|
182
|
+
state?: z.infer<typeof StateFilterSchema>;
|
|
183
|
+
labels?: z.infer<typeof LabelsFilterSchema>;
|
|
184
|
+
project?: z.infer<typeof ProjectFilterSchema>;
|
|
37
185
|
and?: IssueFilter[];
|
|
38
186
|
or?: IssueFilter[];
|
|
39
187
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../endpoints/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,mBAAmB,4GAM9B,CAAC;AAEH,QAAA,MAAM,oBAAoB;;;;;;;kBAUhB,CAAC;AAEX,QAAA,MAAM,sBAAsB;;;;;;;;;;;kBAclB,CAAC;AAEX,QAAA,MAAM,kBAAkB;;;;;kBAQd,CAAC;AAGX,MAAM,MAAM,WAAW,GAAG;IACzB,SAAS,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;IACjD,SAAS,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;IACjD,KAAK,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;IAC/C,WAAW,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;IACrD,IAAI,CAAC,EAAE;QAAE,EAAE,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA;KAAE,CAAC;IACnD,GAAG,CAAC,EAAE,W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B,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,KAAK,EACL,oBAAoB,EACpB,qBAAqB,EACrB,QAAQ,EACR,OAAO,EACP,iBAAiB,EACjB,qBAAqB,EACrB,qBAAqB,EACrB,kBAAkB,EAClB,YAAY,EACZ,oBAAoB,EACpB,qBAAqB,EACrB,IAAI,EACJ,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,IAAI,EACJ,aAAa,EACb,iBAAiB,GACjB,MAAM,mBAAmB,CAAC;AAC3B,cAAc,kBAAkB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{AuthMissingError as
|
|
1
|
+
import{AuthMissingError as ct,getOAuthAccessToken as go}from"corsair/core";import{attachManagedRefreshAuth as yo,getManagedAccessToken as fo}from"corsair/hub";import{logEventFromContext as x}from"corsair/core";import{ApiError as dt,BaseWebhookHandler as So,request as pt,verifyHmacSignature as wo}from"corsair/http";var C=class extends Error{constructor(r,s){super(r);this.code=s;this.name="LinearAPIError"}},lt="https://api.linear.app/graphql";async function p(t,n,r){let s={BASE:lt,VERSION:"1.0.0",WITH_CREDENTIALS:!1,CREDENTIALS:"omit",HEADERS:{"Content-Type":"application/json",Authorization:n}},o={method:"POST",url:"",body:{query:t,variables:r||{}},mediaType:"application/json"};try{let d=await pt(s,o);if(d.errors&&d.errors.length>0){let i=d.errors.map(y=>y.message).join(", ");throw new C(i)}if(!d.data)throw new C("No data returned from Linear API");return d.data}catch(d){if(d instanceof C)throw d;if(d instanceof dt){let i=typeof d.body=="object"?JSON.stringify(d.body):String(d.body??"");throw new C(`${d.message} (status=${d.status}, body=${i})`)}throw new C(d instanceof Error?d.message:"Unknown error")}}var ut=`
|
|
2
2
|
query Comments($issueId: String!, $first: Int!, $after: String) {
|
|
3
3
|
issue(id: $issueId) {
|
|
4
4
|
comments(first: $first, after: $after) {
|
|
@@ -30,7 +30,7 @@ import{AuthMissingError as st,getOAuthAccessToken as co}from"corsair/core";impor
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
`,
|
|
33
|
+
`,mt=`
|
|
34
34
|
mutation CreateComment($input: CommentCreateInput!) {
|
|
35
35
|
commentCreate(input: $input) {
|
|
36
36
|
success
|
|
@@ -54,7 +54,7 @@ import{AuthMissingError as st,getOAuthAccessToken as co}from"corsair/core";impor
|
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
`,
|
|
57
|
+
`,bt=`
|
|
58
58
|
mutation UpdateComment($id: String!, $input: CommentUpdateInput!) {
|
|
59
59
|
commentUpdate(id: $id, input: $input) {
|
|
60
60
|
success
|
|
@@ -79,13 +79,13 @@ import{AuthMissingError as st,getOAuthAccessToken as co}from"corsair/core";impor
|
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
|
-
`,
|
|
82
|
+
`,gt=`
|
|
83
83
|
mutation DeleteComment($id: String!) {
|
|
84
84
|
commentDelete(id: $id) {
|
|
85
85
|
success
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
`,ae=async(t,n)=>{let r=t.key,o=(await p(pt,r,{issueId:n.issueId,first:n.first||50,after:n.after})).issue.comments;if(o.nodes&&t.db.comments)try{for(let c of o.nodes)await t.db.comments.upsertByEntityId(c.id,{...c,issueId:c.issue.id,userId:c.user.id,parentId:c.parent?.id,createdAt:new Date(c.createdAt??""),updatedAt:new Date(c.updatedAt??"")})}catch(c){console.warn("Failed to save comments to database:",c)}return await P(t,"linear.comments.list",{...n},"completed"),o},re=async(t,n)=>{let r=t.key,o=(await p(lt,r,{input:n})).commentCreate.comment;if(o&&t.db.comments)try{await t.db.comments.upsertByEntityId(o.id,{...o,issueId:o.issue.id,userId:o.user.id,parentId:o.parent?.id,createdAt:new Date(o.createdAt??""),updatedAt:new Date(o.updatedAt??"")})}catch(c){console.warn("Failed to save comment to database:",c)}return await P(t,"linear.comments.create",{...n},"completed"),o},se=async(t,n)=>{let r=t.key,o=(await p(ut,r,{id:n.id,input:n.input})).commentUpdate.comment;if(o&&t.db.comments)try{await t.db.comments.upsertByEntityId(o.id,{...o,issueId:o.issue.id,userId:o.user.id,parentId:o.parent?.id,createdAt:new Date(o.createdAt??""),updatedAt:new Date(o.updatedAt??"")})}catch(c){console.warn("Failed to update comment in database:",c)}return await P(t,"linear.comments.update",{...n},"completed"),o},ie=async(t,n)=>{let r=t.key,o=(await p(mt,r,{id:n.id})).commentDelete.success;if(o&&t.db.comments)try{await t.db.comments.deleteByEntityId(n.id)}catch(c){console.warn("Failed to delete comment from database:",c)}return await P(t,"linear.comments.delete",{...n},"completed"),o};import{logEventFromContext as k}from"corsair/core";import{z as e}from"zod";var C=e.union([e.literal(0),e.literal(1),e.literal(2),e.literal(3),e.literal(4)]),de=e.object({eq:e.string(),neq:e.string(),lt:e.string(),lte:e.string(),gt:e.string(),gte:e.string()}).partial().strict(),ce=e.object({eq:e.string(),neq:e.string(),in:e.array(e.string()),nin:e.array(e.string()),contains:e.string(),containsIgnoreCase:e.string(),notContains:e.string(),notContainsIgnoreCase:e.string(),startsWith:e.string(),endsWith:e.string()}).partial().strict(),gt=e.object({eq:e.string(),neq:e.string(),in:e.array(e.string()),nin:e.array(e.string())}).partial().strict(),J=e.lazy(()=>e.object({createdAt:de,updatedAt:de,title:ce,description:ce,team:e.object({id:gt}).partial().strict(),and:e.array(J),or:e.array(J)}).partial().strict()),yt=e.object({teamId:e.string().optional(),first:e.number().optional(),after:e.string().optional(),filter:J.optional(),orderBy:e.enum(["createdAt","updatedAt"]).optional()}),bt=e.object({id:e.string()}),ft=e.object({title:e.string(),description:e.string().optional(),teamId:e.string(),assigneeId:e.string().optional(),priority:C.optional(),estimate:e.number().optional(),stateId:e.string().optional(),projectId:e.string().optional(),cycleId:e.string().optional(),parentId:e.string().optional(),labelIds:e.array(e.string()).optional(),subscriberIds:e.array(e.string()).optional(),dueDate:e.string().optional()}),ht=e.object({id:e.string(),input:e.object({title:e.string().optional(),description:e.string().optional(),assigneeId:e.string().optional(),priority:C.optional(),estimate:e.number().optional(),stateId:e.string().optional(),projectId:e.string().optional(),cycleId:e.string().optional(),parentId:e.string().optional(),labelIds:e.array(e.string()).optional(),subscriberIds:e.array(e.string()).optional(),dueDate:e.string().optional()})}),It=e.object({id:e.string()}),jt=e.object({first:e.number().optional(),after:e.string().optional()}),Ct=e.object({id:e.string()}),Lt=e.object({first:e.number().optional(),after:e.string().optional()}),Et=e.object({id:e.string()}),At=e.object({first:e.number().optional(),after:e.string().optional()}),vt=e.object({id:e.string()}),St=e.object({name:e.string(),description:e.string().optional(),icon:e.string().optional(),color:e.string().optional(),teamIds:e.array(e.string()),leadId:e.string().optional(),state:e.enum(["planned","started","paused","completed","canceled"]).optional(),priority:e.number().optional(),startDate:e.string().optional(),targetDate:e.string().optional()}),wt=e.object({id:e.string(),input:e.object({name:e.string().optional(),description:e.string().optional(),icon:e.string().optional(),color:e.string().optional(),teamIds:e.array(e.string()).optional(),leadId:e.string().optional(),state:e.enum(["planned","started","paused","completed","canceled"]).optional(),priority:e.number().optional(),startDate:e.string().optional(),targetDate:e.string().optional()})}),kt=e.object({id:e.string()}),Rt=e.object({issueId:e.string(),first:e.number().optional(),after:e.string().optional()}),Dt=e.object({issueId:e.string(),body:e.string(),parentId:e.string().optional()}),Pt=e.object({id:e.string(),input:e.object({body:e.string().optional()})}),Ut=e.object({id:e.string()}),l={issuesList:yt,issuesGet:bt,issuesCreate:ft,issuesUpdate:ht,issuesDelete:It,teamsList:jt,teamsGet:Ct,usersList:Lt,usersGet:Et,projectsList:At,projectsGet:vt,projectsCreate:St,projectsUpdate:wt,projectsDelete:kt,commentsList:Rt,commentsCreate:Dt,commentsUpdate:Pt,commentsDelete:Ut},h=e.object({id:e.string(),name:e.string(),email:e.string().optional().nullable(),displayName:e.string(),avatarUrl:e.string().optional().nullable(),active:e.boolean(),admin:e.boolean(),createdAt:e.coerce.date().nullable().optional(),updatedAt:e.coerce.date().nullable().optional()}),I=e.object({id:e.string(),name:e.string(),key:e.string(),description:e.string().optional().nullable(),icon:e.string().optional().nullable(),color:e.string().optional().nullable(),private:e.boolean(),createdAt:e.coerce.date().nullable().optional(),updatedAt:e.coerce.date().nullable().optional(),archivedAt:e.coerce.date().nullable().optional()}),ue=e.enum(["backlog","unstarted","started","completed","canceled"]),xt=e.object({id:e.string(),name:e.string(),type:ue,color:e.string(),position:e.number(),description:e.string().optional().nullable(),team:I,createdAt:e.coerce.date().nullable().optional(),updatedAt:e.coerce.date().nullable().optional()}),Tt=e.object({id:e.string(),name:e.string(),description:e.string().optional().nullable(),color:e.string(),team:I.optional().nullable(),createdAt:e.coerce.date().nullable().optional(),updatedAt:e.coerce.date().nullable().optional()}),me=Tt.extend({parent:e.lazy(()=>me.optional().nullable())}),L=e.enum(["backlog","planned","started","paused","completed","canceled"]),ge=e.object({id:e.string(),name:e.string(),description:e.string().optional().nullable(),icon:e.string().optional().nullable(),color:e.string().optional().nullable(),state:L,priority:e.number(),sortOrder:e.number(),startDate:e.coerce.date().nullable().optional(),targetDate:e.coerce.date().nullable().optional(),completedAt:e.coerce.date().nullable().optional(),canceledAt:e.coerce.date().nullable().optional(),lead:h.optional().nullable(),teams:e.array(I),createdAt:e.coerce.date().nullable().optional(),updatedAt:e.coerce.date().nullable().optional(),archivedAt:e.coerce.date().nullable().optional()}),zt=e.object({id:e.string(),number:e.number(),name:e.string().optional().nullable(),description:e.string().optional().nullable(),startsAt:e.coerce.date().nullable().optional(),endsAt:e.coerce.date().nullable().optional(),completedAt:e.coerce.date().nullable().optional(),team:I,createdAt:e.coerce.date().nullable().optional(),updatedAt:e.coerce.date().nullable().optional(),archivedAt:e.coerce.date().nullable().optional()}),Wt=e.object({id:e.string(),title:e.string(),description:e.string().optional().nullable(),priority:C,estimate:e.number().optional().nullable(),sortOrder:e.number(),number:e.number(),identifier:e.string(),url:e.string(),state:xt,team:I,assignee:h.optional().nullable(),creator:h,project:ge.optional().nullable(),cycle:zt.optional().nullable(),labels:e.array(me),subscribers:e.array(h),dueDate:e.coerce.date().nullable().optional(),startedAt:e.coerce.date().nullable().optional(),completedAt:e.coerce.date().nullable().optional(),canceledAt:e.coerce.date().nullable().optional(),triagedAt:e.coerce.date().nullable().optional(),snoozedUntilAt:e.coerce.date().nullable().optional(),createdAt:e.coerce.date().nullable().optional(),updatedAt:e.coerce.date().nullable().optional(),archivedAt:e.coerce.date().nullable().optional()}),w=Wt.extend({parent:e.lazy(()=>w.optional().nullable())}),Ot=e.object({id:e.string(),body:e.string(),issue:w,user:h,editedAt:e.coerce.date().nullable().optional(),createdAt:e.coerce.date().nullable().optional(),updatedAt:e.coerce.date().nullable().optional(),archivedAt:e.coerce.date().nullable().optional()}),U=Ot.extend({parent:e.lazy(()=>U.optional().nullable())}),E=e.object({hasNextPage:e.boolean(),hasPreviousPage:e.boolean(),startCursor:e.string().optional().nullable(),endCursor:e.string().optional().nullable()}),f=e.object({id:e.string(),name:e.string(),displayName:e.string(),email:e.string().optional().nullable()}),Q=e.object({id:e.string(),name:e.string(),key:e.string()}),ye=e.object({id:e.string(),name:e.string(),type:ue,color:e.string().optional(),position:e.number().optional()}),Nt=e.object({id:e.string(),name:e.string(),color:e.string()}),$t=e.object({nodes:e.array(Nt)}),Gt=e.object({nodes:e.array(f)}),Bt=e.object({id:e.string()}),Y=e.object({nodes:e.array(Q)}),_t=e.object({id:e.string(),title:e.string(),description:e.string().optional().nullable(),priority:C,estimate:e.number().optional().nullable(),sortOrder:e.number(),number:e.number(),identifier:e.string(),url:e.string(),state:ye,team:Q,assignee:f.optional().nullable(),creator:f,project:e.object({id:e.string(),name:e.string(),state:L}).optional().nullable(),cycle:e.object({id:e.string(),number:e.number(),name:e.string().optional().nullable()}).optional().nullable(),labels:$t.optional().nullable(),subscribers:Gt.nullish(),dueDate:e.coerce.date().nullable().optional(),startedAt:e.coerce.date().nullable().optional(),completedAt:e.coerce.date().nullable().optional(),canceledAt:e.coerce.date().nullable().optional(),triagedAt:e.coerce.date().nullable().optional(),snoozedUntilAt:e.coerce.date().nullable().optional(),createdAt:e.coerce.date().nullable().optional(),updatedAt:e.coerce.date().nullable().optional(),archivedAt:e.coerce.date().nullable().optional()}),x=_t.extend({parent:e.lazy(()=>x.optional().nullable())}),be=e.object({nodes:e.array(x),pageInfo:E}),wo=e.object({nodes:e.array(w),pageInfo:E}),fe=e.object({nodes:e.array(I),pageInfo:E}),he=e.object({nodes:e.array(h),pageInfo:E}),ko=e.object({nodes:e.array(ge),pageInfo:E}),Ie=e.object({nodes:e.array(U),pageInfo:E}),Ro=e.object({title:e.string(),description:e.string().optional(),teamId:e.string(),assigneeId:e.string().optional(),priority:C.optional(),estimate:e.number().optional(),stateId:e.string().optional(),projectId:e.string().optional(),cycleId:e.string().optional(),parentId:e.string().optional(),labelIds:e.array(e.string()).optional(),subscriberIds:e.array(e.string()).optional(),dueDate:e.coerce.date().nullable().optional()}),Do=e.object({title:e.string().optional(),description:e.string().optional(),assigneeId:e.string().optional(),priority:C.optional(),estimate:e.number().optional(),stateId:e.string().optional(),projectId:e.string().optional(),cycleId:e.string().optional(),parentId:e.string().optional(),labelIds:e.array(e.string()).optional(),subscriberIds:e.array(e.string()).optional(),dueDate:e.coerce.date().nullable().optional()}),Po=e.object({name:e.string(),description:e.string().optional(),icon:e.string().optional(),color:e.string().optional(),teamIds:e.array(e.string()),leadId:e.string().optional(),state:L.optional(),priority:e.number().optional(),startDate:e.coerce.date().nullable().optional(),targetDate:e.coerce.date().nullable().optional()}),Uo=e.object({name:e.string().optional(),description:e.string().optional(),icon:e.string().optional(),color:e.string().optional(),teamIds:e.array(e.string()).optional(),leadId:e.string().optional(),state:L.optional(),priority:e.number().optional(),startDate:e.coerce.date().nullable().optional(),targetDate:e.coerce.date().nullable().optional()}),xo=e.object({issueId:e.string(),body:e.string(),parentId:e.string().optional()}),To=e.object({body:e.string().optional()}),je=e.object({id:e.string(),name:e.string(),description:e.string().optional().nullable(),icon:e.string().optional().nullable(),color:e.string().optional().nullable(),state:L,priority:e.number(),sortOrder:e.number().optional(),startDate:e.coerce.date().nullable().optional(),targetDate:e.coerce.date().nullable().optional(),completedAt:e.coerce.date().nullable().optional(),canceledAt:e.coerce.date().nullable().optional(),lead:f.optional().nullable(),teams:Y,createdAt:e.coerce.date().nullable().optional(),updatedAt:e.coerce.date().nullable().optional(),archivedAt:e.coerce.date().nullable().optional()}),Ce=e.object({id:e.string(),name:e.string(),description:e.string().optional().nullable(),icon:e.string().optional().nullable(),color:e.string().optional().nullable(),state:L,priority:e.number(),sortOrder:e.number().optional(),startDate:e.coerce.date().nullable().optional(),targetDate:e.coerce.date().nullable().optional(),completedAt:e.coerce.date().nullable().optional(),canceledAt:e.coerce.date().nullable().optional(),lead:f.optional().nullable(),teams:Y.optional(),createdAt:e.coerce.date().nullable().optional(),updatedAt:e.coerce.date().nullable().optional(),archivedAt:e.coerce.date().nullable().optional()}),Z=e.object({id:e.string(),name:e.string(),description:e.string().optional().nullable(),icon:e.string().optional().nullable(),color:e.string().optional().nullable(),state:L,priority:e.number(),sortOrder:e.number(),startDate:e.coerce.date().nullable().optional(),targetDate:e.coerce.date().nullable().optional(),completedAt:e.coerce.date().nullable().optional(),canceledAt:e.coerce.date().nullable().optional(),lead:f.optional().nullable(),teams:Y,createdAt:e.coerce.date().nullable().optional(),updatedAt:e.coerce.date().nullable().optional()}),Le=e.object({nodes:e.array(Z),pageInfo:E}),zo=e.object({issues:be}),Wo=e.object({issue:x}),Oo=e.object({issueCreate:e.object({success:e.boolean(),issue:w})}),No=e.object({issueUpdate:e.object({success:e.boolean(),issue:w})}),$o=e.object({issueDelete:e.object({success:e.boolean()})}),Go=e.object({teams:fe}),Bo=e.object({team:I}),_o=e.object({users:he}),Mo=e.object({user:h}),Fo=e.object({projects:Le}),Ho=e.object({project:Z}),qo=e.object({projectCreate:e.object({success:e.boolean(),project:je})}),Ko=e.object({projectUpdate:e.object({success:e.boolean(),project:Ce})}),Vo=e.object({projectDelete:e.object({success:e.boolean()})}),Jo=e.object({issue:e.object({comments:Ie})}),Qo=e.object({commentCreate:e.object({success:e.boolean(),comment:U})}),Yo=e.object({commentUpdate:e.object({success:e.boolean(),comment:U})}),Zo=e.object({commentDelete:e.object({success:e.boolean()})}),pe=e.object({id:e.string(),title:e.string().optional(),description:e.string().optional().nullable(),priority:C.optional(),estimate:e.number().optional().nullable(),sortOrder:e.number().optional(),number:e.number().optional(),identifier:e.string().optional(),url:e.string().optional(),state:ye.optional(),team:Q.optional(),assignee:f.optional().nullable(),creator:f.optional(),createdAt:e.coerce.date().nullable().optional(),updatedAt:e.coerce.date().nullable().optional()}),le=e.object({id:e.string(),body:e.string(),issue:Bt,user:f,parent:e.object({id:e.string()}).optional().nullable(),editedAt:e.coerce.date().nullable().optional(),createdAt:e.coerce.date().nullable().optional(),updatedAt:e.coerce.date().nullable().optional(),archivedAt:e.coerce.date().nullable().optional()}),u={issuesList:be,issuesGet:x,issuesCreate:pe,issuesUpdate:pe,issuesDelete:e.boolean(),teamsList:fe,teamsGet:I,usersList:he,usersGet:h,projectsList:Le,projectsGet:Z,projectsCreate:je,projectsUpdate:Ce,projectsDelete:e.boolean(),commentsList:Ie,commentsCreate:le,commentsUpdate:le,commentsDelete:e.boolean()};var Ee=`
|
|
88
|
+
`,se=async(t,n)=>{let r=t.key,o=(await p(ut,r,{issueId:n.issueId,first:n.first||50,after:n.after})).issue.comments;if(o.nodes&&t.db.comments)try{for(let d of o.nodes)await t.db.comments.upsertByEntityId(d.id,{...d,issueId:d.issue.id,userId:d.user.id,parentId:d.parent?.id,createdAt:new Date(d.createdAt??""),updatedAt:new Date(d.updatedAt??"")})}catch(d){console.warn("Failed to save comments to database:",d)}return await x(t,"linear.comments.list",{...n},"completed"),o},ie=async(t,n)=>{let r=t.key,o=(await p(mt,r,{input:n})).commentCreate.comment;if(o&&t.db.comments)try{await t.db.comments.upsertByEntityId(o.id,{...o,issueId:o.issue.id,userId:o.user.id,parentId:o.parent?.id,createdAt:new Date(o.createdAt??""),updatedAt:new Date(o.updatedAt??"")})}catch(d){console.warn("Failed to save comment to database:",d)}return await x(t,"linear.comments.create",{...n},"completed"),o},ce=async(t,n)=>{let r=t.key,o=(await p(bt,r,{id:n.id,input:n.input})).commentUpdate.comment;if(o&&t.db.comments)try{await t.db.comments.upsertByEntityId(o.id,{...o,issueId:o.issue.id,userId:o.user.id,parentId:o.parent?.id,createdAt:new Date(o.createdAt??""),updatedAt:new Date(o.updatedAt??"")})}catch(d){console.warn("Failed to update comment in database:",d)}return await x(t,"linear.comments.update",{...n},"completed"),o},de=async(t,n)=>{let r=t.key,o=(await p(gt,r,{id:n.id})).commentDelete.success;if(o&&t.db.comments)try{await t.db.comments.deleteByEntityId(n.id)}catch(d){console.warn("Failed to delete comment from database:",d)}return await x(t,"linear.comments.delete",{...n},"completed"),o};import{logEventFromContext as D}from"corsair/core";import{z as e}from"zod";var L=e.union([e.literal(0),e.literal(1),e.literal(2),e.literal(3),e.literal(4)]),pe=e.object({eq:e.string(),neq:e.string(),lt:e.string(),lte:e.string(),gt:e.string(),gte:e.string()}).partial().strict(),f=e.object({eq:e.string(),neq:e.string(),in:e.array(e.string()),nin:e.array(e.string()),contains:e.string(),containsIgnoreCase:e.string(),notContains:e.string(),notContainsIgnoreCase:e.string(),startsWith:e.string(),endsWith:e.string()}).partial().strict(),k=e.object({eq:e.string(),neq:e.string(),in:e.array(e.string()),nin:e.array(e.string())}).partial().strict(),yt=e.object({eq:e.boolean(),neq:e.boolean()}).partial().strict(),ft=e.object({id:k,isMe:yt,name:f,displayName:f,email:f,null:e.boolean()}).partial().strict(),ht=e.object({id:k,name:f,type:f}).partial().strict(),le=e.object({id:k,name:f}).partial().strict(),It=e.object({some:le,every:le}).partial().strict(),jt=e.object({id:k,name:f,null:e.boolean()}).partial().strict(),Y=e.lazy(()=>e.object({createdAt:pe,updatedAt:pe,title:f,description:f,team:e.object({id:k}).partial().strict(),assignee:ft,state:ht,labels:It,project:jt,and:e.array(Y),or:e.array(Y)}).partial().strict()),Ct=e.object({teamId:e.string().optional().describe('Team UUID from teams.list, not the short key like "ENG".'),first:e.number().optional(),after:e.string().optional().describe("pageInfo.endCursor from the previous page."),filter:Y.optional().describe("Server-side filter on assignee (isMe or id), state (type or name), labels.some (name), project (id), plus createdAt, updatedAt, title, description, team, and/or."),orderBy:e.enum(["createdAt","updatedAt"]).optional()}),Lt=e.object({id:e.string()}),Et=e.object({title:e.string(),description:e.string().optional(),teamId:e.string(),assigneeId:e.string().optional(),priority:L.optional(),estimate:e.number().optional(),stateId:e.string().optional(),projectId:e.string().optional(),cycleId:e.string().optional(),parentId:e.string().optional(),labelIds:e.array(e.string()).optional(),subscriberIds:e.array(e.string()).optional(),dueDate:e.string().optional()}),At=e.object({id:e.string(),input:e.object({title:e.string().optional(),description:e.string().optional(),assigneeId:e.string().optional(),priority:L.optional(),estimate:e.number().optional(),stateId:e.string().optional(),projectId:e.string().optional(),cycleId:e.string().optional(),parentId:e.string().optional(),labelIds:e.array(e.string()).optional(),subscriberIds:e.array(e.string()).optional(),dueDate:e.string().optional()})}),vt=e.object({id:e.string()}),St=e.object({first:e.number().optional(),after:e.string().optional()}),wt=e.object({id:e.string()}),kt=e.object({first:e.number().optional(),after:e.string().optional()}),Rt=e.object({id:e.string()}),Dt=e.object({first:e.number().optional(),after:e.string().optional()}),Ut=e.object({id:e.string()}),Pt=e.object({name:e.string(),description:e.string().optional(),icon:e.string().optional(),color:e.string().optional(),teamIds:e.array(e.string()),leadId:e.string().optional(),state:e.enum(["planned","started","paused","completed","canceled"]).optional(),priority:e.number().optional(),startDate:e.string().optional(),targetDate:e.string().optional()}),xt=e.object({id:e.string(),input:e.object({name:e.string().optional(),description:e.string().optional(),icon:e.string().optional(),color:e.string().optional(),teamIds:e.array(e.string()).optional(),leadId:e.string().optional(),state:e.enum(["planned","started","paused","completed","canceled"]).optional(),priority:e.number().optional(),startDate:e.string().optional(),targetDate:e.string().optional()})}),Tt=e.object({id:e.string()}),zt=e.object({issueId:e.string().describe('Issue UUID or identifier such as "ENG-123".'),first:e.number().optional(),after:e.string().optional()}),Wt=e.object({issueId:e.string(),body:e.string(),parentId:e.string().optional()}),Ot=e.object({id:e.string(),input:e.object({body:e.string().optional()})}),Nt=e.object({id:e.string()}),l={issuesList:Ct,issuesGet:Lt,issuesCreate:Et,issuesUpdate:At,issuesDelete:vt,teamsList:St,teamsGet:wt,usersList:kt,usersGet:Rt,projectsList:Dt,projectsGet:Ut,projectsCreate:Pt,projectsUpdate:xt,projectsDelete:Tt,commentsList:zt,commentsCreate:Wt,commentsUpdate:Ot,commentsDelete:Nt},I=e.object({id:e.string(),name:e.string(),email:e.string().optional().nullable(),displayName:e.string(),avatarUrl:e.string().optional().nullable(),active:e.boolean(),admin:e.boolean(),createdAt:e.coerce.date().nullable().optional(),updatedAt:e.coerce.date().nullable().optional()}),j=e.object({id:e.string(),name:e.string(),key:e.string(),description:e.string().optional().nullable(),icon:e.string().optional().nullable(),color:e.string().optional().nullable(),private:e.boolean(),createdAt:e.coerce.date().nullable().optional(),updatedAt:e.coerce.date().nullable().optional(),archivedAt:e.coerce.date().nullable().optional()}),be=e.enum(["backlog","unstarted","started","completed","canceled"]),Gt=e.object({id:e.string(),name:e.string(),type:be,color:e.string(),position:e.number(),description:e.string().optional().nullable(),team:j,createdAt:e.coerce.date().nullable().optional(),updatedAt:e.coerce.date().nullable().optional()}),$t=e.object({id:e.string(),name:e.string(),description:e.string().optional().nullable(),color:e.string(),team:j.optional().nullable(),createdAt:e.coerce.date().nullable().optional(),updatedAt:e.coerce.date().nullable().optional()}),ge=$t.extend({parent:e.lazy(()=>ge.optional().nullable())}),E=e.enum(["backlog","planned","started","paused","completed","canceled"]),ye=e.object({id:e.string(),name:e.string(),description:e.string().optional().nullable(),icon:e.string().optional().nullable(),color:e.string().optional().nullable(),state:E,priority:e.number(),sortOrder:e.number(),startDate:e.coerce.date().nullable().optional(),targetDate:e.coerce.date().nullable().optional(),completedAt:e.coerce.date().nullable().optional(),canceledAt:e.coerce.date().nullable().optional(),lead:I.optional().nullable(),teams:e.array(j),createdAt:e.coerce.date().nullable().optional(),updatedAt:e.coerce.date().nullable().optional(),archivedAt:e.coerce.date().nullable().optional()}),Bt=e.object({id:e.string(),number:e.number(),name:e.string().optional().nullable(),description:e.string().optional().nullable(),startsAt:e.coerce.date().nullable().optional(),endsAt:e.coerce.date().nullable().optional(),completedAt:e.coerce.date().nullable().optional(),team:j,createdAt:e.coerce.date().nullable().optional(),updatedAt:e.coerce.date().nullable().optional(),archivedAt:e.coerce.date().nullable().optional()}),Mt=e.object({id:e.string(),title:e.string(),description:e.string().optional().nullable(),priority:L,estimate:e.number().optional().nullable(),sortOrder:e.number(),number:e.number(),identifier:e.string(),url:e.string(),state:Gt,team:j,assignee:I.optional().nullable(),creator:I,project:ye.optional().nullable(),cycle:Bt.optional().nullable(),labels:e.array(ge),subscribers:e.array(I),dueDate:e.coerce.date().nullable().optional(),startedAt:e.coerce.date().nullable().optional(),completedAt:e.coerce.date().nullable().optional(),canceledAt:e.coerce.date().nullable().optional(),triagedAt:e.coerce.date().nullable().optional(),snoozedUntilAt:e.coerce.date().nullable().optional(),createdAt:e.coerce.date().nullable().optional(),updatedAt:e.coerce.date().nullable().optional(),archivedAt:e.coerce.date().nullable().optional()}),R=Mt.extend({parent:e.lazy(()=>R.optional().nullable())}),_t=e.object({id:e.string(),body:e.string(),issue:R,user:I,editedAt:e.coerce.date().nullable().optional(),createdAt:e.coerce.date().nullable().optional(),updatedAt:e.coerce.date().nullable().optional(),archivedAt:e.coerce.date().nullable().optional()}),T=_t.extend({parent:e.lazy(()=>T.optional().nullable())}),A=e.object({hasNextPage:e.boolean(),hasPreviousPage:e.boolean(),startCursor:e.string().optional().nullable(),endCursor:e.string().optional().nullable()}),h=e.object({id:e.string(),name:e.string(),displayName:e.string(),email:e.string().optional().nullable()}),Z=e.object({id:e.string(),name:e.string(),key:e.string()}),fe=e.object({id:e.string(),name:e.string(),type:be,color:e.string().optional(),position:e.number().optional()}),Ft=e.object({id:e.string(),name:e.string(),color:e.string()}),Ht=e.object({nodes:e.array(Ft)}),qt=e.object({nodes:e.array(h)}),Kt=e.object({id:e.string()}),X=e.object({nodes:e.array(Z)}),Vt=e.object({id:e.string(),title:e.string(),description:e.string().optional().nullable(),priority:L,estimate:e.number().optional().nullable(),sortOrder:e.number(),number:e.number(),identifier:e.string(),url:e.string(),state:fe,team:Z,assignee:h.optional().nullable(),creator:h,project:e.object({id:e.string(),name:e.string(),state:E}).optional().nullable(),cycle:e.object({id:e.string(),number:e.number(),name:e.string().optional().nullable()}).optional().nullable(),labels:Ht.optional().nullable(),subscribers:qt.nullish(),dueDate:e.coerce.date().nullable().optional(),startedAt:e.coerce.date().nullable().optional(),completedAt:e.coerce.date().nullable().optional(),canceledAt:e.coerce.date().nullable().optional(),triagedAt:e.coerce.date().nullable().optional(),snoozedUntilAt:e.coerce.date().nullable().optional(),createdAt:e.coerce.date().nullable().optional(),updatedAt:e.coerce.date().nullable().optional(),archivedAt:e.coerce.date().nullable().optional()}),z=Vt.extend({parent:e.lazy(()=>z.optional().nullable())}),he=e.object({nodes:e.array(z),pageInfo:A}),xo=e.object({nodes:e.array(R),pageInfo:A}),Ie=e.object({nodes:e.array(j),pageInfo:A}),je=e.object({nodes:e.array(I),pageInfo:A}),To=e.object({nodes:e.array(ye),pageInfo:A}),Ce=e.object({nodes:e.array(T),pageInfo:A}),zo=e.object({title:e.string(),description:e.string().optional(),teamId:e.string(),assigneeId:e.string().optional(),priority:L.optional(),estimate:e.number().optional(),stateId:e.string().optional(),projectId:e.string().optional(),cycleId:e.string().optional(),parentId:e.string().optional(),labelIds:e.array(e.string()).optional(),subscriberIds:e.array(e.string()).optional(),dueDate:e.coerce.date().nullable().optional()}),Wo=e.object({title:e.string().optional(),description:e.string().optional(),assigneeId:e.string().optional(),priority:L.optional(),estimate:e.number().optional(),stateId:e.string().optional(),projectId:e.string().optional(),cycleId:e.string().optional(),parentId:e.string().optional(),labelIds:e.array(e.string()).optional(),subscriberIds:e.array(e.string()).optional(),dueDate:e.coerce.date().nullable().optional()}),Oo=e.object({name:e.string(),description:e.string().optional(),icon:e.string().optional(),color:e.string().optional(),teamIds:e.array(e.string()),leadId:e.string().optional(),state:E.optional(),priority:e.number().optional(),startDate:e.coerce.date().nullable().optional(),targetDate:e.coerce.date().nullable().optional()}),No=e.object({name:e.string().optional(),description:e.string().optional(),icon:e.string().optional(),color:e.string().optional(),teamIds:e.array(e.string()).optional(),leadId:e.string().optional(),state:E.optional(),priority:e.number().optional(),startDate:e.coerce.date().nullable().optional(),targetDate:e.coerce.date().nullable().optional()}),Go=e.object({issueId:e.string(),body:e.string(),parentId:e.string().optional()}),$o=e.object({body:e.string().optional()}),Le=e.object({id:e.string(),name:e.string(),description:e.string().optional().nullable(),icon:e.string().optional().nullable(),color:e.string().optional().nullable(),state:E,priority:e.number(),sortOrder:e.number().optional(),startDate:e.coerce.date().nullable().optional(),targetDate:e.coerce.date().nullable().optional(),completedAt:e.coerce.date().nullable().optional(),canceledAt:e.coerce.date().nullable().optional(),lead:h.optional().nullable(),teams:X,createdAt:e.coerce.date().nullable().optional(),updatedAt:e.coerce.date().nullable().optional(),archivedAt:e.coerce.date().nullable().optional()}),Ee=e.object({id:e.string(),name:e.string(),description:e.string().optional().nullable(),icon:e.string().optional().nullable(),color:e.string().optional().nullable(),state:E,priority:e.number(),sortOrder:e.number().optional(),startDate:e.coerce.date().nullable().optional(),targetDate:e.coerce.date().nullable().optional(),completedAt:e.coerce.date().nullable().optional(),canceledAt:e.coerce.date().nullable().optional(),lead:h.optional().nullable(),teams:X.optional(),createdAt:e.coerce.date().nullable().optional(),updatedAt:e.coerce.date().nullable().optional(),archivedAt:e.coerce.date().nullable().optional()}),ee=e.object({id:e.string(),name:e.string(),description:e.string().optional().nullable(),icon:e.string().optional().nullable(),color:e.string().optional().nullable(),state:E,priority:e.number(),sortOrder:e.number(),startDate:e.coerce.date().nullable().optional(),targetDate:e.coerce.date().nullable().optional(),completedAt:e.coerce.date().nullable().optional(),canceledAt:e.coerce.date().nullable().optional(),lead:h.optional().nullable(),teams:X,createdAt:e.coerce.date().nullable().optional(),updatedAt:e.coerce.date().nullable().optional()}),Ae=e.object({nodes:e.array(ee),pageInfo:A}),Bo=e.object({issues:he}),Mo=e.object({issue:z}),_o=e.object({issueCreate:e.object({success:e.boolean(),issue:R})}),Fo=e.object({issueUpdate:e.object({success:e.boolean(),issue:R})}),Ho=e.object({issueDelete:e.object({success:e.boolean()})}),qo=e.object({teams:Ie}),Ko=e.object({team:j}),Vo=e.object({users:je}),Jo=e.object({user:I}),Qo=e.object({projects:Ae}),Yo=e.object({project:ee}),Zo=e.object({projectCreate:e.object({success:e.boolean(),project:Le})}),Xo=e.object({projectUpdate:e.object({success:e.boolean(),project:Ee})}),en=e.object({projectDelete:e.object({success:e.boolean()})}),tn=e.object({issue:e.object({comments:Ce})}),on=e.object({commentCreate:e.object({success:e.boolean(),comment:T})}),nn=e.object({commentUpdate:e.object({success:e.boolean(),comment:T})}),an=e.object({commentDelete:e.object({success:e.boolean()})}),ue=e.object({id:e.string(),title:e.string().optional(),description:e.string().optional().nullable(),priority:L.optional(),estimate:e.number().optional().nullable(),sortOrder:e.number().optional(),number:e.number().optional(),identifier:e.string().optional(),url:e.string().optional(),state:fe.optional(),team:Z.optional(),assignee:h.optional().nullable(),creator:h.optional(),createdAt:e.coerce.date().nullable().optional(),updatedAt:e.coerce.date().nullable().optional()}),me=e.object({id:e.string(),body:e.string(),issue:Kt,user:h,parent:e.object({id:e.string()}).optional().nullable(),editedAt:e.coerce.date().nullable().optional(),createdAt:e.coerce.date().nullable().optional(),updatedAt:e.coerce.date().nullable().optional(),archivedAt:e.coerce.date().nullable().optional()}),u={issuesList:he,issuesGet:z,issuesCreate:ue,issuesUpdate:ue,issuesDelete:e.boolean(),teamsList:Ie,teamsGet:j,usersList:je,usersGet:I,projectsList:Ae,projectsGet:ee,projectsCreate:Le,projectsUpdate:Ee,projectsDelete:e.boolean(),commentsList:Ce,commentsCreate:me,commentsUpdate:me,commentsDelete:e.boolean()};var ve=`
|
|
89
89
|
id
|
|
90
90
|
title
|
|
91
91
|
description
|
|
@@ -144,11 +144,11 @@ import{AuthMissingError as st,getOAuthAccessToken as co}from"corsair/core";impor
|
|
|
144
144
|
canceledAt
|
|
145
145
|
createdAt
|
|
146
146
|
updatedAt
|
|
147
|
-
`,
|
|
147
|
+
`,Jt=`
|
|
148
148
|
query Issues($filter: IssueFilter, $orderBy: PaginationOrderBy, $first: Int!, $after: String) {
|
|
149
149
|
issues(filter: $filter, orderBy: $orderBy, first: $first, after: $after) {
|
|
150
150
|
nodes {
|
|
151
|
-
${
|
|
151
|
+
${ve}
|
|
152
152
|
}
|
|
153
153
|
pageInfo {
|
|
154
154
|
hasNextPage
|
|
@@ -158,10 +158,10 @@ import{AuthMissingError as st,getOAuthAccessToken as co}from"corsair/core";impor
|
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
|
-
`,
|
|
161
|
+
`,Qt=`
|
|
162
162
|
query Issue($id: String!) {
|
|
163
163
|
issue(id: $id) {
|
|
164
|
-
${
|
|
164
|
+
${ve}
|
|
165
165
|
subscribers {
|
|
166
166
|
nodes {
|
|
167
167
|
id
|
|
@@ -171,7 +171,7 @@ import{AuthMissingError as st,getOAuthAccessToken as co}from"corsair/core";impor
|
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
|
-
`,
|
|
174
|
+
`,Yt=`
|
|
175
175
|
mutation CreateIssue($input: IssueCreateInput!) {
|
|
176
176
|
issueCreate(input: $input) {
|
|
177
177
|
success
|
|
@@ -210,7 +210,7 @@ import{AuthMissingError as st,getOAuthAccessToken as co}from"corsair/core";impor
|
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
|
-
`,
|
|
213
|
+
`,Zt=`
|
|
214
214
|
mutation UpdateIssue($id: String!, $input: IssueUpdateInput!) {
|
|
215
215
|
issueUpdate(id: $id, input: $input) {
|
|
216
216
|
success
|
|
@@ -243,13 +243,13 @@ import{AuthMissingError as st,getOAuthAccessToken as co}from"corsair/core";impor
|
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
|
-
`,
|
|
246
|
+
`,Xt=`
|
|
247
247
|
mutation DeleteIssue($id: String!) {
|
|
248
248
|
issueDelete(id: $id) {
|
|
249
249
|
success
|
|
250
250
|
}
|
|
251
251
|
}
|
|
252
|
-
`,
|
|
252
|
+
`,Se=async(t,n)=>{let r=l.issuesList.parse(n),s=r.teamId?{team:{id:{eq:r.teamId}}}:void 0,o=s&&r.filter?{and:[s,r.filter]}:s??r.filter,d={first:r.first||50};o&&(d.filter=o),r.orderBy&&(d.orderBy=r.orderBy),r.after&&(d.after=r.after);let y=(await p(Jt,t.key,d)).issues;if(y.nodes&&t.db.issues)try{for(let b of y.nodes)await t.db.issues.upsertByEntityId(b.id,{...b,stateId:b.state?.id,teamId:b.team?.id,assigneeId:b.assignee?.id,creatorId:b.creator?.id,projectId:b.project?.id,cycleId:b.cycle?.id,createdAt:new Date(b.createdAt??""),updatedAt:new Date(b.updatedAt??"")})}catch(b){console.warn("Failed to save issues to database:",b)}return await D(t,"linear.issues.list",{...r},"completed"),y},we=async(t,n)=>{let s=(await p(Qt,t.key,{id:n.id})).issue;if(s&&t.db.issues)try{await t.db.issues.upsertByEntityId(s.id,{...s,stateId:s.state?.id,teamId:s.team?.id,assigneeId:s.assignee?.id,creatorId:s.creator?.id,projectId:s.project?.id,cycleId:s.cycle?.id,createdAt:new Date(s.createdAt??""),updatedAt:new Date(s.updatedAt??"")})}catch(o){console.warn("Failed to save issue to database:",o)}return await D(t,"linear.issues.get",{...n},"completed"),s},ke=async(t,n)=>{let s=(await p(Yt,t.key,{input:n})).issueCreate.issue;return s&&await t.endpoints.issues.get({id:s.id}),await D(t,"linear.issues.create",{...n},"completed"),s},Re=async(t,n)=>{let s=(await p(Zt,t.key,{id:n.id,input:n.input})).issueUpdate.issue;return s&&await t.endpoints.issues.get({id:s.id}),await D(t,"linear.issues.update",{...n},"completed"),s},De=async(t,n)=>{let s=(await p(Xt,t.key,{id:n.id})).issueDelete.success;if(s&&t.db.issues)try{await t.db.issues.deleteByEntityId(n.id)}catch(o){console.warn("Failed to delete issue from database:",o)}return await D(t,"linear.issues.delete",{...n},"completed"),s};import{logEventFromContext as U}from"corsair/core";var eo=`
|
|
253
253
|
query Projects($first: Int!, $after: String) {
|
|
254
254
|
projects(first: $first, after: $after) {
|
|
255
255
|
nodes {
|
|
@@ -288,7 +288,7 @@ import{AuthMissingError as st,getOAuthAccessToken as co}from"corsair/core";impor
|
|
|
288
288
|
}
|
|
289
289
|
}
|
|
290
290
|
}
|
|
291
|
-
`,
|
|
291
|
+
`,to=`
|
|
292
292
|
query Project($id: String!) {
|
|
293
293
|
project(id: $id) {
|
|
294
294
|
id
|
|
@@ -320,7 +320,7 @@ import{AuthMissingError as st,getOAuthAccessToken as co}from"corsair/core";impor
|
|
|
320
320
|
updatedAt
|
|
321
321
|
}
|
|
322
322
|
}
|
|
323
|
-
`,
|
|
323
|
+
`,oo=`
|
|
324
324
|
mutation CreateProject($input: ProjectCreateInput!) {
|
|
325
325
|
projectCreate(input: $input) {
|
|
326
326
|
success
|
|
@@ -351,7 +351,7 @@ import{AuthMissingError as st,getOAuthAccessToken as co}from"corsair/core";impor
|
|
|
351
351
|
}
|
|
352
352
|
}
|
|
353
353
|
}
|
|
354
|
-
`,
|
|
354
|
+
`,no=`
|
|
355
355
|
mutation UpdateProject($id: String!, $input: ProjectUpdateInput!) {
|
|
356
356
|
projectUpdate(id: $id, input: $input) {
|
|
357
357
|
success
|
|
@@ -369,13 +369,13 @@ import{AuthMissingError as st,getOAuthAccessToken as co}from"corsair/core";impor
|
|
|
369
369
|
}
|
|
370
370
|
}
|
|
371
371
|
}
|
|
372
|
-
`,
|
|
372
|
+
`,ao=`
|
|
373
373
|
mutation DeleteProject($id: String!) {
|
|
374
374
|
projectDelete(id: $id) {
|
|
375
375
|
success
|
|
376
376
|
}
|
|
377
377
|
}
|
|
378
|
-
`,
|
|
378
|
+
`,Ue=async(t,n)=>{let s=(await p(eo,t.key,{first:n.first||50,after:n.after})).projects;if(s.nodes&&t.db.projects)try{for(let o of s.nodes)await t.db.projects.upsertByEntityId(o.id,{...o,leadId:o.lead?.id,createdAt:new Date(o.createdAt??""),updatedAt:new Date(o.updatedAt??"")})}catch(o){console.warn("Failed to save projects to database:",o)}return await U(t,"linear.projects.list",{...n},"completed"),s},Pe=async(t,n)=>{let s=(await p(to,t.key,{id:n.id})).project;if(s&&t.db.projects)try{await t.db.projects.upsertByEntityId(s.id,{...s,leadId:s.lead?.id,createdAt:new Date(s.createdAt??""),updatedAt:new Date(s.updatedAt??"")})}catch(o){console.warn("Failed to save project to database:",o)}return await U(t,"linear.projects.get",{...n},"completed"),s},xe=async(t,n)=>{let s=(await p(oo,t.key,{input:n})).projectCreate.project;return s&&await t.endpoints.projects.get({id:s.id}),await U(t,"linear.projects.create",{...n},"completed"),s},Te=async(t,n)=>{let s=(await p(no,t.key,{id:n.id,input:n.input})).projectUpdate.project;return s&&await t.endpoints.projects.get({id:s.id}),await U(t,"linear.projects.update",{...n},"completed"),s},ze=async(t,n)=>{let s=(await p(ao,t.key,{id:n.id})).projectDelete.success;if(s&&t.db.projects)try{await t.db.projects.deleteByEntityId(n.id)}catch(o){console.warn("Failed to delete project from database:",o)}return await U(t,"linear.projects.delete",{...n},"completed"),s};import{logEventFromContext as We}from"corsair/core";var ro=`
|
|
379
379
|
query Teams($first: Int!, $after: String) {
|
|
380
380
|
teams(first: $first, after: $after) {
|
|
381
381
|
nodes {
|
|
@@ -397,7 +397,7 @@ import{AuthMissingError as st,getOAuthAccessToken as co}from"corsair/core";impor
|
|
|
397
397
|
}
|
|
398
398
|
}
|
|
399
399
|
}
|
|
400
|
-
`,
|
|
400
|
+
`,so=`
|
|
401
401
|
query Team($id: String!) {
|
|
402
402
|
team(id: $id) {
|
|
403
403
|
id
|
|
@@ -411,7 +411,7 @@ import{AuthMissingError as st,getOAuthAccessToken as co}from"corsair/core";impor
|
|
|
411
411
|
updatedAt
|
|
412
412
|
}
|
|
413
413
|
}
|
|
414
|
-
`,
|
|
414
|
+
`,Oe=async(t,n)=>{let s=(await p(ro,t.key,{first:n.first||50,after:n.after})).teams;if(s.nodes&&t.db.teams)try{for(let o of s.nodes)await t.db.teams.upsertByEntityId(o.id,{...o,createdAt:new Date(o.createdAt??""),updatedAt:new Date(o.updatedAt??"")})}catch(o){console.warn("Failed to save teams to database:",o)}return await We(t,"linear.teams.list",{...n},"completed"),s},Ne=async(t,n)=>{let s=(await p(so,t.key,{id:n.id})).team;if(s&&t.db.teams)try{await t.db.teams.upsertByEntityId(s.id,{...s,createdAt:new Date(s.createdAt??""),updatedAt:new Date(s.updatedAt??"")})}catch(o){console.warn("Failed to save team to database:",o)}return await We(t,"linear.teams.get",{...n},"completed"),s};import{logEventFromContext as Ge}from"corsair/core";var io=`
|
|
415
415
|
query Users($first: Int!, $after: String) {
|
|
416
416
|
users(first: $first, after: $after) {
|
|
417
417
|
nodes {
|
|
@@ -433,7 +433,7 @@ import{AuthMissingError as st,getOAuthAccessToken as co}from"corsair/core";impor
|
|
|
433
433
|
}
|
|
434
434
|
}
|
|
435
435
|
}
|
|
436
|
-
`,
|
|
436
|
+
`,co=`
|
|
437
437
|
query User($id: String!) {
|
|
438
438
|
user(id: $id) {
|
|
439
439
|
id
|
|
@@ -447,4 +447,4 @@ import{AuthMissingError as st,getOAuthAccessToken as co}from"corsair/core";impor
|
|
|
447
447
|
updatedAt
|
|
448
448
|
}
|
|
449
449
|
}
|
|
450
|
-
`,Ne=async(t,n)=>{let s=(await p(to,t.key,{first:n.first||50,after:n.after})).users;if(s.nodes&&t.db.users)try{for(let o of s.nodes)await t.db.users.upsertByEntityId(o.id,{...o,createdAt:new Date(o.createdAt??""),updatedAt:new Date(o.updatedAt??"")})}catch(o){console.warn("Failed to save users to database:",o)}return await Oe(t,"linear.users.list",{...n},"completed"),s},$e=async(t,n)=>{let s=(await p(oo,t.key,{id:n.id})).user;if(s&&t.db.users)try{await t.db.users.upsertByEntityId(s.id,{...s,createdAt:new Date(s.createdAt??""),updatedAt:new Date(s.updatedAt??"")})}catch(o){console.warn("Failed to save user to database:",o)}return await Oe(t,"linear.users.get",{...n},"completed"),s};var D={list:ae,create:re,update:se,delete:ie},A={list:Ae,get:ve,create:Se,update:we,delete:ke},v={list:Re,get:De,create:Pe,update:Ue,delete:xe},X={list:ze,get:We},ee={list:Ne,get:$e};import{ApiError as S}from"corsair/http";var Ge={RATE_LIMIT_ERROR:{match:(t,n)=>{if(t instanceof S&&t.status===429)return!0;let r=t.message.toLowerCase();return r.includes("rate_limited")||r.includes("ratelimited")||r.includes("rate limit")||r.includes("too many requests")||t.message.includes("429")},handler:async(t,n)=>{console.log(`[LINEAR:${n.operation}] Rate limit exceeded`);let r;return t instanceof S&&t.retryAfter&&(r=t.retryAfter),{maxRetries:5,headersRetryAfterMs:r}}},AUTH_ERROR:{match:(t,n)=>{if(t instanceof S&&t.status===401)return!0;let r=t.message.toLowerCase();return r.includes("unauthorized")||r.includes("authentication")||r.includes("invalid token")||r.includes("token expired")||r.includes("token revoked")||r.includes("invalid api key")||r.includes("forbidden")||r.includes("access denied")},handler:async(t,n)=>(console.log(`[LINEAR:${n.operation}] Authentication failed - check your API key`),{maxRetries:0})},NOT_FOUND_ERROR:{match:(t,n)=>{if(t instanceof S&&t.status===404)return!0;let r=t.message.toLowerCase();return r.includes("not found")||r.includes("does not exist")||r.includes("could not find")||r.includes("issue not found")||r.includes("team not found")||r.includes("project not found")||r.includes("comment not found")||r.includes("user not found")},handler:async(t,n)=>(console.warn(`[LINEAR:${n.operation}] Resource not found: ${t.message}`),{maxRetries:0})},PERMISSION_ERROR:{match:(t,n)=>{if(t instanceof S&&t.status===403)return!0;let r=t.message.toLowerCase();return r.includes("permission denied")||r.includes("forbidden")||r.includes("access denied")||r.includes("insufficient permissions")||r.includes("unauthorized access")||r.includes("not authorized")},handler:async(t,n)=>(console.warn(`[LINEAR:${n.operation}] Permission denied: ${t.message}`),{maxRetries:0})},NETWORK_ERROR:{match:(t,n)=>{let r=t.message.toLowerCase();return r.includes("network")||r.includes("connection")||r.includes("econnrefused")||r.includes("enotfound")||r.includes("etimedout")||r.includes("fetch failed")||r.includes("network error")},handler:async(t,n)=>(console.warn(`[LINEAR:${n.operation}] Network error: ${t.message}`),{maxRetries:3})},VALIDATION_ERROR:{match:(t,n)=>{if(t instanceof S&&t.status===400)return!0;let r=t.message.toLowerCase();return r.includes("validation")||r.includes("invalid input")||r.includes("bad request")||r.includes("malformed")||r.includes("required field")||r.includes("graphql validation")},handler:async(t,n)=>(console.warn(`[LINEAR:${n.operation}] Validation error: ${t.message}`),{maxRetries:0})},DEFAULT:{match:(t,n)=>!0,handler:async(t,n)=>(console.error(`[LINEAR:${n.operation}] Unhandled error: ${t.message}`),{maxRetries:0})}};import{z as d}from"zod";var Be=d.object({id:d.string(),title:d.string(),description:d.string().nullable().optional(),priority:d.union([d.literal(0),d.literal(1),d.literal(2),d.literal(3),d.literal(4)]),estimate:d.number().nullable().optional(),sortOrder:d.number().optional(),number:d.number(),identifier:d.string(),url:d.string(),stateId:d.string(),teamId:d.string(),assigneeId:d.string().nullable().optional(),creatorId:d.string(),assignee:d.object({id:d.string(),name:d.string().nullable().optional(),email:d.string().nullable().optional()}).nullable().optional(),state:d.object({id:d.string(),name:d.string(),type:d.string()}).nullable().optional(),projectId:d.string().nullable().optional(),cycleId:d.string().nullable().optional(),parentId:d.string().nullable().optional(),dueDate:d.coerce.date().nullable().optional(),startedAt:d.coerce.date().nullable().optional(),completedAt:d.coerce.date().nullable().optional(),canceledAt:d.coerce.date().nullable().optional(),triagedAt:d.coerce.date().nullable().optional(),snoozedUntilAt:d.coerce.date().nullable().optional(),createdAt:d.coerce.date().nullable().optional(),updatedAt:d.coerce.date().nullable().optional(),archivedAt:d.coerce.date().nullable().optional()}),_e=d.object({id:d.string(),name:d.string(),key:d.string(),description:d.string().nullable().optional(),icon:d.string().nullable().optional(),color:d.string().nullable().optional(),private:d.boolean(),createdAt:d.coerce.date().nullable().optional(),updatedAt:d.coerce.date().nullable().optional(),archivedAt:d.coerce.date().nullable().optional()}),Me=d.object({id:d.string(),name:d.string(),description:d.string().nullable().optional(),icon:d.string().nullable().optional(),color:d.string().nullable().optional(),state:d.enum(["planned","started","paused","completed","canceled","backlog"]),priority:d.number(),sortOrder:d.number().optional(),startDate:d.coerce.date().nullable().optional(),targetDate:d.coerce.date().nullable().optional(),completedAt:d.coerce.date().nullable().optional(),canceledAt:d.coerce.date().nullable().optional(),leadId:d.string().nullable().optional(),createdAt:d.coerce.date().nullable().optional(),updatedAt:d.coerce.date().nullable().optional(),archivedAt:d.coerce.date().nullable().optional()}),Fe=d.object({id:d.string(),body:d.string(),issueId:d.string(),userId:d.string(),parentId:d.string().nullable().optional(),editedAt:d.coerce.date().nullable().optional(),createdAt:d.coerce.date().nullable().optional(),updatedAt:d.coerce.date().nullable().optional(),archivedAt:d.coerce.date().nullable().optional()}),He=d.object({id:d.string(),name:d.string(),email:d.string().optional().nullable(),displayName:d.string(),avatarUrl:d.string().optional().nullable(),active:d.boolean(),admin:d.boolean(),createdAt:d.coerce.date().nullable().optional(),updatedAt:d.coerce.date().nullable().optional()});var qe={version:"1.0.0",entities:{issues:Be,teams:_e,projects:Me,comments:Fe,users:He}};import{logEventFromContext as te}from"corsair/core";import{verifyHmacSignature as no}from"corsair/http";import{z as a}from"zod";var Rn=a.object({id:a.string(),createdAt:a.string(),updatedAt:a.string(),archivedAt:a.string().optional()}).catchall(a.any()),T=a.object({id:a.string(),identifier:a.string(),title:a.string(),description:a.string().optional(),priority:a.union([a.literal(0),a.literal(1),a.literal(2),a.literal(3),a.literal(4)]),estimate:a.number().optional(),sortOrder:a.number(),startedAt:a.string().optional(),completedAt:a.string().optional(),canceledAt:a.string().optional(),autoArchivedAt:a.string().optional(),autoClosedAt:a.string().optional(),dueDate:a.string().optional(),trashed:a.boolean().optional(),snoozedUntilAt:a.string().optional(),previousIdentifiers:a.array(a.string()),createdAt:a.string(),updatedAt:a.string(),branchName:a.string(),customerTicketCount:a.number(),stateId:a.string(),teamId:a.string(),creatorId:a.string()}).catchall(a.any()),z=a.object({id:a.string(),body:a.string(),editedAt:a.string().optional(),createdAt:a.string(),updatedAt:a.string(),issueId:a.string(),userId:a.string()}).catchall(a.any()),W=a.object({id:a.string(),name:a.string(),description:a.string().optional(),icon:a.string().optional(),color:a.string().optional(),priority:a.union([a.literal(0),a.literal(1),a.literal(2),a.literal(3),a.literal(4)]),sortOrder:a.number(),state:a.enum(["planned","started","paused","completed","canceled"]),progress:a.number(),url:a.string(),startDate:a.string().optional(),targetDate:a.string().optional(),completedAt:a.string().optional(),canceledAt:a.string().optional(),startedAt:a.string().optional(),completedScopeHistory:a.array(a.number()),inProgressScopeHistory:a.array(a.number()),scope:a.number(),createdAt:a.string(),updatedAt:a.string()}).catchall(a.any()),O=a.object({action:a.literal("create"),type:a.literal("Issue"),data:T,url:a.string(),createdAt:a.string(),organizationId:a.string(),webhookId:a.string()}),N=a.object({action:a.literal("update"),type:a.literal("Issue"),data:T,updatedFrom:T.partial().optional(),url:a.string(),createdAt:a.string(),organizationId:a.string(),webhookId:a.string()}),$=a.object({action:a.literal("remove"),type:a.literal("Issue"),data:T,url:a.string(),createdAt:a.string(),organizationId:a.string(),webhookId:a.string()}),G=a.object({action:a.literal("create"),type:a.literal("Comment"),data:z,url:a.string(),createdAt:a.string(),organizationId:a.string(),webhookId:a.string()}),B=a.object({action:a.literal("update"),type:a.literal("Comment"),data:z,updatedFrom:z.partial().optional(),url:a.string(),createdAt:a.string(),organizationId:a.string(),webhookId:a.string()}),_=a.object({action:a.literal("remove"),type:a.literal("Comment"),data:z,url:a.string(),createdAt:a.string(),organizationId:a.string(),webhookId:a.string()}),M=a.object({action:a.literal("create"),type:a.literal("Project"),data:W,url:a.string(),createdAt:a.string(),organizationId:a.string(),webhookId:a.string()}),F=a.object({action:a.literal("update"),type:a.literal("Project"),data:W,updatedFrom:W.partial().optional(),url:a.string(),createdAt:a.string(),organizationId:a.string(),webhookId:a.string()}),H=a.object({action:a.literal("remove"),type:a.literal("Project"),data:W,url:a.string(),createdAt:a.string(),organizationId:a.string(),webhookId:a.string()}),Dn=a.union([O,N,$,G,B,_,M,F,H]);function ao(t){return typeof t=="string"?JSON.parse(t):t}function m(t,n){if(!n)return{valid:!1,error:"Missing webhook secret"};let r=t.rawBody;if(!r)return{valid:!1,error:"Missing raw body for signature verification"};let s=t.headers,o=Array.isArray(s["linear-signature"])?s["linear-signature"][0]:s["linear-signature"];return o?no(r,n,o)?{valid:!0}:{valid:!1,error:"Invalid signature"}:{valid:!1,error:"Missing linear-signature header"}}function Ke(t,n){return r=>{let s=ao(r.body);return typeof s.type=="string"&&s.type===t&&typeof s.action=="string"&&s.action===n}}var y=Ke;var Ve={match:y("Comment","create"),handler:async(t,n)=>{let r=t.key,s=m(n,r);if(!s.valid)return{success:!1,statusCode:401,error:s.error||"Signature verification failed"};let o=n.payload;if(o.type!=="Comment"||o.action!=="create")return{success:!0,data:void 0};console.log("\u{1F4AC} Linear Comment Created Event:",{id:o.data.id,body:o.data.body?.substring(0,100)});let c="";if(t.db.comments&&o.data.id)try{let i=o.data;c=(await t.db.comments.upsertByEntityId(i.id,{...i,editedAt:i.editedAt?new Date(i.editedAt??""):null,createdAt:new Date(i.createdAt??""),updatedAt:new Date(i.updatedAt??"")}))?.id||""}catch(i){console.warn("Failed to save comment to database:",i)}return await te(t,"linear.webhook.commentCreate",{...o},"completed"),{success:!0,corsairEntityId:c,data:o}}},Je={match:y("Comment","update"),handler:async(t,n)=>{let r=t.key,s=m(n,r);if(!s.valid)return{success:!1,statusCode:401,error:s.error||"Signature verification failed"};let o=n.payload;if(o.type!=="Comment"||o.action!=="update")return{success:!0,data:void 0};console.log("\u270F\uFE0F Linear Comment Updated Event:",{id:o.data.id,updatedFields:o.updatedFrom?Object.keys(o.updatedFrom):[]});let c="";if(t.db.comments&&o.data.id)try{let i=o.data;c=(await t.db.comments.upsertByEntityId(i.id,{...i,editedAt:i.editedAt?new Date(i.editedAt??""):null,createdAt:new Date(i.createdAt??""),updatedAt:new Date(i.updatedAt??"")}))?.id||""}catch(i){console.warn("Failed to update comment in database:",i)}return await te(t,"linear.webhook.commentUpdate",{...o},"completed"),{success:!0,corsairEntityId:c,data:o}}},Qe={match:y("Comment","remove"),handler:async(t,n)=>{let r=t.key,s=m(n,r);if(!s.valid)return{success:!1,statusCode:401,error:s.error||"Signature verification failed"};let o=n.payload;if(o.type!=="Comment"||o.action!=="remove")return{success:!0,data:void 0};console.log("\u{1F5D1}\uFE0F Linear Comment Deleted Event:",{id:o.data.id});let c="";if(t.db.comments&&o.data.id)try{let i=await t.db.comments.findByEntityId(o.data.id);i&&(c=i.id),await t.db.comments.deleteByEntityId(o.data.id)}catch(i){console.warn("Failed to delete comment from database:",i)}return await te(t,"linear.webhook.commentRemove",{...o},"completed"),{success:!0,corsairEntityId:c,data:o}}};import{logEventFromContext as oe}from"corsair/core";async function Ye(t,n){if(n.assignee!==void 0)return n.assignee;if(!n.assigneeId)return null;let r=await t.db.issues?.findByEntityId(n.id);return r?.data.assignee?.id===n.assigneeId?r.data.assignee:null}var Ze={match:y("Issue","create"),handler:async(t,n)=>{let r=t.key,s=m(n,r);if(!s.valid)return{success:!1,statusCode:401,error:s.error||"Signature verification failed"};let o=n.payload;if(o.type!=="Issue"||o.action!=="create")return{success:!0,data:void 0};console.log("\u{1F4CB} Linear Issue Created Event:",{id:o.data.id,identifier:o.data.identifier,title:o.data.title});let c="";if(t.db.issues&&o.data.id)try{let i=o.data;c=(await t.db.issues.upsertByEntityId(i.id,{...i,assignee:await Ye(t,i),number:parseInt(i.identifier.split("-")[1]||"0",10),url:o.url,dueDate:i.dueDate?new Date(i.dueDate??""):null,startedAt:i.startedAt?new Date(i.startedAt??""):null,completedAt:i.completedAt?new Date(i.completedAt??""):null,canceledAt:i.canceledAt?new Date(i.canceledAt??""):null,triagedAt:i.triagedAt?new Date(i.triagedAt??""):null,snoozedUntilAt:i.snoozedUntilAt?new Date(i.snoozedUntilAt??""):null,archivedAt:i.archivedAt?new Date(i.archivedAt??""):null,createdAt:new Date(i.createdAt??""),updatedAt:new Date(i.updatedAt??"")}))?.id||""}catch(i){console.warn("Failed to save issue to database:",i)}return await oe(t,"linear.webhook.issueCreate",{...o},"completed"),{success:!0,corsairEntityId:c,data:o}}},Xe={match:y("Issue","update"),handler:async(t,n)=>{let r=t.key,s=m(n,r);if(!s.valid)return{success:!1,statusCode:401,error:s.error||"Signature verification failed"};let o=n.payload;if(o.type!=="Issue"||o.action!=="update")return{success:!0,data:void 0};console.log("\u{1F4DD} Linear Issue Updated Event:",{id:o.data.id,identifier:o.data.identifier,title:o.data.title,updatedFields:o.updatedFrom?Object.keys(o.updatedFrom):[]});let c="";if(t.db.issues&&o.data.id)try{let i=o.data;c=(await t.db.issues.upsertByEntityId(i.id,{...i,assignee:await Ye(t,i),number:parseInt(i.identifier.split("-")[1]||"0",10),url:o.url,dueDate:i.dueDate?new Date(i.dueDate??""):null,startedAt:i.startedAt?new Date(i.startedAt??""):null,completedAt:i.completedAt?new Date(i.completedAt??""):null,canceledAt:i.canceledAt?new Date(i.canceledAt??""):null,triagedAt:i.triagedAt?new Date(i.triagedAt??""):null,snoozedUntilAt:i.snoozedUntilAt?new Date(i.snoozedUntilAt??""):null,archivedAt:i.archivedAt?new Date(i.archivedAt??""):null,createdAt:new Date(i.createdAt??""),updatedAt:new Date(i.updatedAt??"")}))?.id||""}catch(i){console.warn("Failed to update issue in database:",i)}return await oe(t,"linear.webhook.issueUpdate",{...o},"completed"),{success:!0,corsairEntityId:c,data:o}}},et={match:y("Issue","remove"),handler:async(t,n)=>{let r=t.key,s=m(n,r);if(!s.valid)return{success:!1,statusCode:401,error:s.error||"Signature verification failed"};let o=n.payload;if(o.type!=="Issue"||o.action!=="remove")return{success:!0,data:void 0};console.log("\u{1F5D1}\uFE0F Linear Issue Deleted Event:",{id:o.data.id,identifier:o.data.identifier});let c="";if(t.db.issues&&o.data.id)try{let i=await t.db.issues.findByEntityId(o.data.id);i&&(c=i.id),await t.db.issues.deleteByEntityId(o.data.id)}catch(i){console.warn("Failed to delete issue from database:",i)}return await oe(t,"linear.webhook.issueRemove",{...o},"completed"),{success:!0,corsairEntityId:c,data:o}}};import{logEventFromContext as ne}from"corsair/core";var tt={match:y("Project","create"),handler:async(t,n)=>{let r=t.key,s=m(n,r);if(!s.valid)return{success:!1,statusCode:401,error:s.error||"Signature verification failed"};let o=n.payload;if(o.type!=="Project"||o.action!=="create")return{success:!0,data:void 0};console.log("\u{1F4CA} Linear Project Created Event:",{id:o.data.id,name:o.data.name,state:o.data.state});let c="";if(t.db.projects&&o.data.id)try{let i=o.data;c=(await t.db.projects.upsertByEntityId(i.id,{...i,completedAt:i.completedAt?new Date(i.completedAt):null,canceledAt:i.canceledAt?new Date(i.canceledAt):null,createdAt:new Date(i.createdAt??""),updatedAt:new Date(i.updatedAt??""),startDate:i.startDate?new Date(i.startDate):null,targetDate:i.targetDate?new Date(i.targetDate):null}))?.id||""}catch(i){console.warn("Failed to save project to database:",i)}return await ne(t,"linear.webhook.projectCreate",{...o},"completed"),{success:!0,corsairEntityId:c,data:o}}},ot={match:y("Project","update"),handler:async(t,n)=>{let r=t.key,s=m(n,r);if(!s.valid)return{success:!1,statusCode:401,error:s.error||"Signature verification failed"};let o=n.payload;if(o.type!=="Project"||o.action!=="update")return{success:!0,data:void 0};console.log("\u{1F4DD} Linear Project Updated Event:",{id:o.data.id,name:o.data.name,updatedFields:o.updatedFrom?Object.keys(o.updatedFrom):[]});let c="";if(t.db.projects&&o.data.id)try{let i=o.data;c=(await t.db.projects.upsertByEntityId(i.id,{...i,completedAt:i.completedAt?new Date(i.completedAt):null,canceledAt:i.canceledAt?new Date(i.canceledAt):null,createdAt:new Date(i.createdAt??""),startDate:i.startDate?new Date(i.startDate):null,targetDate:i.targetDate?new Date(i.targetDate):null,updatedAt:new Date(i.updatedAt??"")}))?.id||""}catch(i){console.warn("Failed to update project in database:",i)}return await ne(t,"linear.webhook.projectUpdate",{...o},"completed"),{success:!0,corsairEntityId:c,data:o}}},nt={match:y("Project","remove"),handler:async(t,n)=>{let r=t.key,s=m(n,r);if(!s.valid)return{success:!1,statusCode:401,error:s.error||"Signature verification failed"};let o=n.payload;if(o.type!=="Project"||o.action!=="remove")return{success:!0,data:void 0};console.log("\u{1F5D1}\uFE0F Linear Project Deleted Event:",{id:o.data.id,name:o.data.name});let c="";if(t.db.projects&&o.data.id)try{let i=await t.db.projects.findByEntityId(o.data.id);i&&(c=i.id),await t.db.projects.deleteByEntityId(o.data.id)}catch(i){console.warn("Failed to delete project from database:",i)}return await ne(t,"linear.webhook.projectRemove",{...o},"completed"),{success:!0,corsairEntityId:c,data:o}}};var q={create:Ve,update:Je,remove:Qe},K={create:Ze,update:Xe,remove:et},V={create:tt,update:ot,remove:nt};import{toExternalId as ro}from"corsair/core";async function at(t){let n=t.access_token;if(!n)return null;let r=await fetch("https://api.linear.app/graphql",{method:"POST",headers:{Authorization:n,"Content-Type":"application/json"},body:JSON.stringify({query:"query { viewer { organization { id } } }"})});if(!r.ok)return null;let s=await r.json(),o=ro(s.data?.viewer?.organization?.id);return o?{linkType:"organization_id",externalId:o}:null}import{firstString as so,readBodyRecord as io}from"corsair/core";function rt(t){let n=io(t);if(!n)return null;let r=so([n.organizationId]);return r?{linkType:"organization_id",externalId:r}:null}var uo={issues:{create:K.create,update:K.update,remove:K.remove},comments:{create:q.create,update:q.update,remove:q.remove},projects:{create:V.create,update:V.update,remove:V.remove}},mo={issues:{list:A.list,get:A.get,create:A.create,update:A.update,delete:A.delete},comments:{list:D.list,create:D.create,update:D.update,delete:D.delete},projects:{list:v.list,get:v.get,create:v.create,update:v.update,delete:v.delete},teams:{list:X.list,get:X.get},users:{list:ee.list,get:ee.get}},go={"issues.list":{input:l.issuesList,output:u.issuesList},"issues.get":{input:l.issuesGet,output:u.issuesGet},"issues.create":{input:l.issuesCreate,output:u.issuesCreate},"issues.update":{input:l.issuesUpdate,output:u.issuesUpdate},"issues.delete":{input:l.issuesDelete,output:u.issuesDelete},"comments.list":{input:l.commentsList,output:u.commentsList},"comments.create":{input:l.commentsCreate,output:u.commentsCreate},"comments.update":{input:l.commentsUpdate,output:u.commentsUpdate},"comments.delete":{input:l.commentsDelete,output:u.commentsDelete},"projects.list":{input:l.projectsList,output:u.projectsList},"projects.get":{input:l.projectsGet,output:u.projectsGet},"projects.create":{input:l.projectsCreate,output:u.projectsCreate},"projects.update":{input:l.projectsUpdate,output:u.projectsUpdate},"projects.delete":{input:l.projectsDelete,output:u.projectsDelete},"teams.list":{input:l.teamsList,output:u.teamsList},"teams.get":{input:l.teamsGet,output:u.teamsGet},"users.list":{input:l.usersList,output:u.usersList},"users.get":{input:l.usersGet,output:u.usersGet}},yo={"issues.create":{description:"A new issue was created",payload:O,response:O},"issues.update":{description:"An issue was updated",payload:N,response:N},"issues.remove":{description:"An issue was deleted",payload:$,response:$},"comments.create":{description:"A comment was added to an issue",payload:G,response:G},"comments.update":{description:"A comment was updated",payload:B,response:B},"comments.remove":{description:"A comment was deleted",payload:_,response:_},"projects.create":{description:"A new project was created",payload:M,response:M},"projects.update":{description:"A project was updated",payload:F,response:F},"projects.remove":{description:"A project was deleted",payload:H,response:H}},bo="api_key",fo={api_key:{account:["organization_id"]},oauth_2:{account:["organization_id"]},managed:{account:["organization_id"]}},ho={"issues.list":{riskLevel:"read",description:"List issues in a team"},"issues.get":{riskLevel:"read",description:"Get a specific issue"},"issues.create":{riskLevel:"write",description:"Create a new issue"},"issues.update":{riskLevel:"write",description:"Update an existing issue"},"issues.delete":{riskLevel:"destructive",irreversible:!0,description:"Permanently delete an issue [DESTRUCTIVE \xB7 IRREVERSIBLE]"},"comments.list":{riskLevel:"read",description:"List comments on an issue"},"comments.create":{riskLevel:"write",description:"Post a comment on an issue"},"comments.update":{riskLevel:"write",description:"Update a comment"},"comments.delete":{riskLevel:"destructive",irreversible:!0,description:"Delete a comment"},"projects.list":{riskLevel:"read",description:"List projects in a team"},"projects.get":{riskLevel:"read",description:"Get a specific project"},"projects.create":{riskLevel:"write",description:"Create a new project"},"projects.update":{riskLevel:"write",description:"Update an existing project"},"projects.delete":{riskLevel:"destructive",irreversible:!0,description:"Permanently delete a project [DESTRUCTIVE \xB7 IRREVERSIBLE]"},"teams.list":{riskLevel:"read",description:"List teams in the workspace"},"teams.get":{riskLevel:"read",description:"Get a specific team"},"users.list":{riskLevel:"read",description:"List users in the workspace"},"users.get":{riskLevel:"read",description:"Get a specific user"}};function sa(t={}){let n={...t,authType:t.authType??bo};return{id:"linear",authConfig:fo,oauthConfig:{providerName:"Linear",authUrl:"https://linear.app/oauth/authorize",tokenUrl:"https://api.linear.app/oauth/token",scopes:["read","write"],authParams:{prompt:"consent"}},schema:qe,options:n,hooks:n.hooks,webhookHooks:n.webhookHooks,endpoints:mo,webhooks:uo,endpointMeta:ho,endpointSchemas:go,webhookSchemas:yo,pluginWebhookMatcher:r=>"linear-signature"in r.headers,pluginTenantWebhookMatcher:rt,oauthWebhookTenantLinkResolver:at,errorHandlers:{...Ge,...n.errorHandlers},keyBuilder:async(r,s)=>{let o=r.authType;if(s==="webhook"&&n.webhookSecret)return n.webhookSecret;if(s==="webhook"){let c=await r.keys.get_webhook_signature();if(!c)throw new Error("[auth-missing:linear:webhook_signature]: Linear webhook signature is missing");return c}if(s==="endpoint"&&n.key)return n.key;if(s==="endpoint"&&r.authType==="api_key"){let c=await r.keys.get_api_key();if(!c)throw new st("linear","api_key");return c}if(s==="endpoint"&&r.authType==="oauth_2")return`Bearer ${await co(r,{plugin:"linear",tokenUrl:"https://api.linear.app/oauth/token"})}`;if(r.authType==="managed"){if(!r.hub)throw new Error("[auth-missing:linear:managed]: Hub config is required for managed auth. Pass hub: { ... } to createCorsair().");let c={keys:r.keys,hub:r.hub,plugin:"linear",tenantId:r.tenantId},i=await lo(c);return await po(r,c),`Bearer ${i.accessToken}`}throw new st("linear","oauth_2")}}}export{Ke as createLinearEventMatch,Ge as errorHandlers,sa as linear,fo as linearAuthConfig,go as linearEndpointSchemas,m as verifyLinearWebhookSignature};
|
|
450
|
+
`,$e=async(t,n)=>{let s=(await p(io,t.key,{first:n.first||50,after:n.after})).users;if(s.nodes&&t.db.users)try{for(let o of s.nodes)await t.db.users.upsertByEntityId(o.id,{...o,createdAt:new Date(o.createdAt??""),updatedAt:new Date(o.updatedAt??"")})}catch(o){console.warn("Failed to save users to database:",o)}return await Ge(t,"linear.users.list",{...n},"completed"),s},Be=async(t,n)=>{let s=(await p(co,t.key,{id:n.id})).user;if(s&&t.db.users)try{await t.db.users.upsertByEntityId(s.id,{...s,createdAt:new Date(s.createdAt??""),updatedAt:new Date(s.updatedAt??"")})}catch(o){console.warn("Failed to save user to database:",o)}return await Ge(t,"linear.users.get",{...n},"completed"),s};var P={list:se,create:ie,update:ce,delete:de},v={list:Se,get:we,create:ke,update:Re,delete:De},S={list:Ue,get:Pe,create:xe,update:Te,delete:ze},te={list:Oe,get:Ne},oe={list:$e,get:Be};import{ApiError as w}from"corsair/http";var Me={RATE_LIMIT_ERROR:{match:(t,n)=>{if(t instanceof w&&t.status===429)return!0;let r=t.message.toLowerCase();return r.includes("rate_limited")||r.includes("ratelimited")||r.includes("rate limit")||r.includes("too many requests")||t.message.includes("429")},handler:async(t,n)=>{console.log(`[LINEAR:${n.operation}] Rate limit exceeded`);let r;return t instanceof w&&t.retryAfter&&(r=t.retryAfter),{maxRetries:5,headersRetryAfterMs:r}}},AUTH_ERROR:{match:(t,n)=>{if(t instanceof w&&t.status===401)return!0;let r=t.message.toLowerCase();return r.includes("unauthorized")||r.includes("authentication")||r.includes("invalid token")||r.includes("token expired")||r.includes("token revoked")||r.includes("invalid api key")||r.includes("forbidden")||r.includes("access denied")},handler:async(t,n)=>(console.log(`[LINEAR:${n.operation}] Authentication failed - check your API key`),{maxRetries:0})},NOT_FOUND_ERROR:{match:(t,n)=>{if(t instanceof w&&t.status===404)return!0;let r=t.message.toLowerCase();return r.includes("not found")||r.includes("does not exist")||r.includes("could not find")||r.includes("issue not found")||r.includes("team not found")||r.includes("project not found")||r.includes("comment not found")||r.includes("user not found")},handler:async(t,n)=>(console.warn(`[LINEAR:${n.operation}] Resource not found: ${t.message}`),{maxRetries:0})},PERMISSION_ERROR:{match:(t,n)=>{if(t instanceof w&&t.status===403)return!0;let r=t.message.toLowerCase();return r.includes("permission denied")||r.includes("forbidden")||r.includes("access denied")||r.includes("insufficient permissions")||r.includes("unauthorized access")||r.includes("not authorized")},handler:async(t,n)=>(console.warn(`[LINEAR:${n.operation}] Permission denied: ${t.message}`),{maxRetries:0})},NETWORK_ERROR:{match:(t,n)=>{let r=t.message.toLowerCase();return r.includes("network")||r.includes("connection")||r.includes("econnrefused")||r.includes("enotfound")||r.includes("etimedout")||r.includes("fetch failed")||r.includes("network error")},handler:async(t,n)=>(console.warn(`[LINEAR:${n.operation}] Network error: ${t.message}`),{maxRetries:3})},VALIDATION_ERROR:{match:(t,n)=>{if(t instanceof w&&t.status===400)return!0;let r=t.message.toLowerCase();return r.includes("validation")||r.includes("invalid input")||r.includes("bad request")||r.includes("malformed")||r.includes("required field")||r.includes("graphql validation")},handler:async(t,n)=>(console.warn(`[LINEAR:${n.operation}] Validation error: ${t.message}`),{maxRetries:0})},DEFAULT:{match:(t,n)=>!0,handler:async(t,n)=>(console.error(`[LINEAR:${n.operation}] Unhandled error: ${t.message}`),{maxRetries:0})}};import{z as c}from"zod";var _e=c.object({id:c.string(),title:c.string(),description:c.string().nullable().optional(),priority:c.union([c.literal(0),c.literal(1),c.literal(2),c.literal(3),c.literal(4)]),estimate:c.number().nullable().optional(),sortOrder:c.number().optional(),number:c.number(),identifier:c.string(),url:c.string(),stateId:c.string(),teamId:c.string(),assigneeId:c.string().nullable().optional(),creatorId:c.string(),assignee:c.object({id:c.string(),name:c.string().nullable().optional(),email:c.string().nullable().optional()}).nullable().optional(),state:c.object({id:c.string(),name:c.string(),type:c.string()}).nullable().optional(),projectId:c.string().nullable().optional(),cycleId:c.string().nullable().optional(),parentId:c.string().nullable().optional(),dueDate:c.coerce.date().nullable().optional(),startedAt:c.coerce.date().nullable().optional(),completedAt:c.coerce.date().nullable().optional(),canceledAt:c.coerce.date().nullable().optional(),triagedAt:c.coerce.date().nullable().optional(),snoozedUntilAt:c.coerce.date().nullable().optional(),createdAt:c.coerce.date().nullable().optional(),updatedAt:c.coerce.date().nullable().optional(),archivedAt:c.coerce.date().nullable().optional()}),Fe=c.object({id:c.string(),name:c.string(),key:c.string(),description:c.string().nullable().optional(),icon:c.string().nullable().optional(),color:c.string().nullable().optional(),private:c.boolean(),createdAt:c.coerce.date().nullable().optional(),updatedAt:c.coerce.date().nullable().optional(),archivedAt:c.coerce.date().nullable().optional()}),He=c.object({id:c.string(),name:c.string(),description:c.string().nullable().optional(),icon:c.string().nullable().optional(),color:c.string().nullable().optional(),state:c.enum(["planned","started","paused","completed","canceled","backlog"]),priority:c.number(),sortOrder:c.number().optional(),startDate:c.coerce.date().nullable().optional(),targetDate:c.coerce.date().nullable().optional(),completedAt:c.coerce.date().nullable().optional(),canceledAt:c.coerce.date().nullable().optional(),leadId:c.string().nullable().optional(),createdAt:c.coerce.date().nullable().optional(),updatedAt:c.coerce.date().nullable().optional(),archivedAt:c.coerce.date().nullable().optional()}),qe=c.object({id:c.string(),body:c.string(),issueId:c.string(),userId:c.string(),parentId:c.string().nullable().optional(),editedAt:c.coerce.date().nullable().optional(),createdAt:c.coerce.date().nullable().optional(),updatedAt:c.coerce.date().nullable().optional(),archivedAt:c.coerce.date().nullable().optional()}),Ke=c.object({id:c.string(),name:c.string(),email:c.string().optional().nullable(),displayName:c.string(),avatarUrl:c.string().optional().nullable(),active:c.boolean(),admin:c.boolean(),createdAt:c.coerce.date().nullable().optional(),updatedAt:c.coerce.date().nullable().optional()});var Ve={version:"1.0.0",entities:{issues:_e,teams:Fe,projects:He,comments:qe,users:Ke}};import{logEventFromContext as ne}from"corsair/core";import{verifyHmacSignature as po}from"corsair/http";import{z as a}from"zod";var zn=a.object({id:a.string(),createdAt:a.string(),updatedAt:a.string(),archivedAt:a.string().optional()}).catchall(a.any()),W=a.object({id:a.string(),identifier:a.string(),title:a.string(),description:a.string().optional(),priority:a.union([a.literal(0),a.literal(1),a.literal(2),a.literal(3),a.literal(4)]),estimate:a.number().optional(),sortOrder:a.number(),startedAt:a.string().optional(),completedAt:a.string().optional(),canceledAt:a.string().optional(),autoArchivedAt:a.string().optional(),autoClosedAt:a.string().optional(),dueDate:a.string().optional(),trashed:a.boolean().optional(),snoozedUntilAt:a.string().optional(),previousIdentifiers:a.array(a.string()),createdAt:a.string(),updatedAt:a.string(),branchName:a.string(),customerTicketCount:a.number(),stateId:a.string(),teamId:a.string(),creatorId:a.string()}).catchall(a.any()),O=a.object({id:a.string(),body:a.string(),editedAt:a.string().optional(),createdAt:a.string(),updatedAt:a.string(),issueId:a.string(),userId:a.string()}).catchall(a.any()),N=a.object({id:a.string(),name:a.string(),description:a.string().optional(),icon:a.string().optional(),color:a.string().optional(),priority:a.union([a.literal(0),a.literal(1),a.literal(2),a.literal(3),a.literal(4)]),sortOrder:a.number(),state:a.enum(["planned","started","paused","completed","canceled"]),progress:a.number(),url:a.string(),startDate:a.string().optional(),targetDate:a.string().optional(),completedAt:a.string().optional(),canceledAt:a.string().optional(),startedAt:a.string().optional(),completedScopeHistory:a.array(a.number()),inProgressScopeHistory:a.array(a.number()),scope:a.number(),createdAt:a.string(),updatedAt:a.string()}).catchall(a.any()),G=a.object({action:a.literal("create"),type:a.literal("Issue"),data:W,url:a.string(),createdAt:a.string(),organizationId:a.string(),webhookId:a.string()}),$=a.object({action:a.literal("update"),type:a.literal("Issue"),data:W,updatedFrom:W.partial().optional(),url:a.string(),createdAt:a.string(),organizationId:a.string(),webhookId:a.string()}),B=a.object({action:a.literal("remove"),type:a.literal("Issue"),data:W,url:a.string(),createdAt:a.string(),organizationId:a.string(),webhookId:a.string()}),M=a.object({action:a.literal("create"),type:a.literal("Comment"),data:O,url:a.string(),createdAt:a.string(),organizationId:a.string(),webhookId:a.string()}),_=a.object({action:a.literal("update"),type:a.literal("Comment"),data:O,updatedFrom:O.partial().optional(),url:a.string(),createdAt:a.string(),organizationId:a.string(),webhookId:a.string()}),F=a.object({action:a.literal("remove"),type:a.literal("Comment"),data:O,url:a.string(),createdAt:a.string(),organizationId:a.string(),webhookId:a.string()}),H=a.object({action:a.literal("create"),type:a.literal("Project"),data:N,url:a.string(),createdAt:a.string(),organizationId:a.string(),webhookId:a.string()}),q=a.object({action:a.literal("update"),type:a.literal("Project"),data:N,updatedFrom:N.partial().optional(),url:a.string(),createdAt:a.string(),organizationId:a.string(),webhookId:a.string()}),K=a.object({action:a.literal("remove"),type:a.literal("Project"),data:N,url:a.string(),createdAt:a.string(),organizationId:a.string(),webhookId:a.string()}),Wn=a.union([G,$,B,M,_,F,H,q,K]);function lo(t){return typeof t=="string"?JSON.parse(t):t}function m(t,n){if(!n)return{valid:!1,error:"Missing webhook secret"};let r=t.rawBody;if(!r)return{valid:!1,error:"Missing raw body for signature verification"};let s=t.headers,o=Array.isArray(s["linear-signature"])?s["linear-signature"][0]:s["linear-signature"];return o?po(r,n,o)?{valid:!0}:{valid:!1,error:"Invalid signature"}:{valid:!1,error:"Missing linear-signature header"}}function Je(t,n){return r=>{let s=lo(r.body);return typeof s.type=="string"&&s.type===t&&typeof s.action=="string"&&s.action===n}}var g=Je;var Qe={match:g("Comment","create"),handler:async(t,n)=>{let r=t.key,s=m(n,r);if(!s.valid)return{success:!1,statusCode:401,error:s.error||"Signature verification failed"};let o=n.payload;if(o.type!=="Comment"||o.action!=="create")return{success:!0,data:void 0};console.log("\u{1F4AC} Linear Comment Created Event:",{id:o.data.id,body:o.data.body?.substring(0,100)});let d="";if(t.db.comments&&o.data.id)try{let i=o.data;d=(await t.db.comments.upsertByEntityId(i.id,{...i,editedAt:i.editedAt?new Date(i.editedAt??""):null,createdAt:new Date(i.createdAt??""),updatedAt:new Date(i.updatedAt??"")}))?.id||""}catch(i){console.warn("Failed to save comment to database:",i)}return await ne(t,"linear.webhook.commentCreate",{...o},"completed"),{success:!0,corsairEntityId:d,data:o}}},Ye={match:g("Comment","update"),handler:async(t,n)=>{let r=t.key,s=m(n,r);if(!s.valid)return{success:!1,statusCode:401,error:s.error||"Signature verification failed"};let o=n.payload;if(o.type!=="Comment"||o.action!=="update")return{success:!0,data:void 0};console.log("\u270F\uFE0F Linear Comment Updated Event:",{id:o.data.id,updatedFields:o.updatedFrom?Object.keys(o.updatedFrom):[]});let d="";if(t.db.comments&&o.data.id)try{let i=o.data;d=(await t.db.comments.upsertByEntityId(i.id,{...i,editedAt:i.editedAt?new Date(i.editedAt??""):null,createdAt:new Date(i.createdAt??""),updatedAt:new Date(i.updatedAt??"")}))?.id||""}catch(i){console.warn("Failed to update comment in database:",i)}return await ne(t,"linear.webhook.commentUpdate",{...o},"completed"),{success:!0,corsairEntityId:d,data:o}}},Ze={match:g("Comment","remove"),handler:async(t,n)=>{let r=t.key,s=m(n,r);if(!s.valid)return{success:!1,statusCode:401,error:s.error||"Signature verification failed"};let o=n.payload;if(o.type!=="Comment"||o.action!=="remove")return{success:!0,data:void 0};console.log("\u{1F5D1}\uFE0F Linear Comment Deleted Event:",{id:o.data.id});let d="";if(t.db.comments&&o.data.id)try{let i=await t.db.comments.findByEntityId(o.data.id);i&&(d=i.id),await t.db.comments.deleteByEntityId(o.data.id)}catch(i){console.warn("Failed to delete comment from database:",i)}return await ne(t,"linear.webhook.commentRemove",{...o},"completed"),{success:!0,corsairEntityId:d,data:o}}};import{logEventFromContext as ae}from"corsair/core";async function Xe(t,n){if(n.assignee!==void 0)return n.assignee;if(!n.assigneeId)return null;let r=await t.db.issues?.findByEntityId(n.id);return r?.data.assignee?.id===n.assigneeId?r.data.assignee:null}var et={match:g("Issue","create"),handler:async(t,n)=>{let r=t.key,s=m(n,r);if(!s.valid)return{success:!1,statusCode:401,error:s.error||"Signature verification failed"};let o=n.payload;if(o.type!=="Issue"||o.action!=="create")return{success:!0,data:void 0};console.log("\u{1F4CB} Linear Issue Created Event:",{id:o.data.id,identifier:o.data.identifier,title:o.data.title});let d="";if(t.db.issues&&o.data.id)try{let i=o.data;d=(await t.db.issues.upsertByEntityId(i.id,{...i,assignee:await Xe(t,i),number:parseInt(i.identifier.split("-")[1]||"0",10),url:o.url,dueDate:i.dueDate?new Date(i.dueDate??""):null,startedAt:i.startedAt?new Date(i.startedAt??""):null,completedAt:i.completedAt?new Date(i.completedAt??""):null,canceledAt:i.canceledAt?new Date(i.canceledAt??""):null,triagedAt:i.triagedAt?new Date(i.triagedAt??""):null,snoozedUntilAt:i.snoozedUntilAt?new Date(i.snoozedUntilAt??""):null,archivedAt:i.archivedAt?new Date(i.archivedAt??""):null,createdAt:new Date(i.createdAt??""),updatedAt:new Date(i.updatedAt??"")}))?.id||""}catch(i){console.warn("Failed to save issue to database:",i)}return await ae(t,"linear.webhook.issueCreate",{...o},"completed"),{success:!0,corsairEntityId:d,data:o}}},tt={match:g("Issue","update"),handler:async(t,n)=>{let r=t.key,s=m(n,r);if(!s.valid)return{success:!1,statusCode:401,error:s.error||"Signature verification failed"};let o=n.payload;if(o.type!=="Issue"||o.action!=="update")return{success:!0,data:void 0};console.log("\u{1F4DD} Linear Issue Updated Event:",{id:o.data.id,identifier:o.data.identifier,title:o.data.title,updatedFields:o.updatedFrom?Object.keys(o.updatedFrom):[]});let d="";if(t.db.issues&&o.data.id)try{let i=o.data;d=(await t.db.issues.upsertByEntityId(i.id,{...i,assignee:await Xe(t,i),number:parseInt(i.identifier.split("-")[1]||"0",10),url:o.url,dueDate:i.dueDate?new Date(i.dueDate??""):null,startedAt:i.startedAt?new Date(i.startedAt??""):null,completedAt:i.completedAt?new Date(i.completedAt??""):null,canceledAt:i.canceledAt?new Date(i.canceledAt??""):null,triagedAt:i.triagedAt?new Date(i.triagedAt??""):null,snoozedUntilAt:i.snoozedUntilAt?new Date(i.snoozedUntilAt??""):null,archivedAt:i.archivedAt?new Date(i.archivedAt??""):null,createdAt:new Date(i.createdAt??""),updatedAt:new Date(i.updatedAt??"")}))?.id||""}catch(i){console.warn("Failed to update issue in database:",i)}return await ae(t,"linear.webhook.issueUpdate",{...o},"completed"),{success:!0,corsairEntityId:d,data:o}}},ot={match:g("Issue","remove"),handler:async(t,n)=>{let r=t.key,s=m(n,r);if(!s.valid)return{success:!1,statusCode:401,error:s.error||"Signature verification failed"};let o=n.payload;if(o.type!=="Issue"||o.action!=="remove")return{success:!0,data:void 0};console.log("\u{1F5D1}\uFE0F Linear Issue Deleted Event:",{id:o.data.id,identifier:o.data.identifier});let d="";if(t.db.issues&&o.data.id)try{let i=await t.db.issues.findByEntityId(o.data.id);i&&(d=i.id),await t.db.issues.deleteByEntityId(o.data.id)}catch(i){console.warn("Failed to delete issue from database:",i)}return await ae(t,"linear.webhook.issueRemove",{...o},"completed"),{success:!0,corsairEntityId:d,data:o}}};import{logEventFromContext as re}from"corsair/core";var nt={match:g("Project","create"),handler:async(t,n)=>{let r=t.key,s=m(n,r);if(!s.valid)return{success:!1,statusCode:401,error:s.error||"Signature verification failed"};let o=n.payload;if(o.type!=="Project"||o.action!=="create")return{success:!0,data:void 0};console.log("\u{1F4CA} Linear Project Created Event:",{id:o.data.id,name:o.data.name,state:o.data.state});let d="";if(t.db.projects&&o.data.id)try{let i=o.data;d=(await t.db.projects.upsertByEntityId(i.id,{...i,completedAt:i.completedAt?new Date(i.completedAt):null,canceledAt:i.canceledAt?new Date(i.canceledAt):null,createdAt:new Date(i.createdAt??""),updatedAt:new Date(i.updatedAt??""),startDate:i.startDate?new Date(i.startDate):null,targetDate:i.targetDate?new Date(i.targetDate):null}))?.id||""}catch(i){console.warn("Failed to save project to database:",i)}return await re(t,"linear.webhook.projectCreate",{...o},"completed"),{success:!0,corsairEntityId:d,data:o}}},at={match:g("Project","update"),handler:async(t,n)=>{let r=t.key,s=m(n,r);if(!s.valid)return{success:!1,statusCode:401,error:s.error||"Signature verification failed"};let o=n.payload;if(o.type!=="Project"||o.action!=="update")return{success:!0,data:void 0};console.log("\u{1F4DD} Linear Project Updated Event:",{id:o.data.id,name:o.data.name,updatedFields:o.updatedFrom?Object.keys(o.updatedFrom):[]});let d="";if(t.db.projects&&o.data.id)try{let i=o.data;d=(await t.db.projects.upsertByEntityId(i.id,{...i,completedAt:i.completedAt?new Date(i.completedAt):null,canceledAt:i.canceledAt?new Date(i.canceledAt):null,createdAt:new Date(i.createdAt??""),startDate:i.startDate?new Date(i.startDate):null,targetDate:i.targetDate?new Date(i.targetDate):null,updatedAt:new Date(i.updatedAt??"")}))?.id||""}catch(i){console.warn("Failed to update project in database:",i)}return await re(t,"linear.webhook.projectUpdate",{...o},"completed"),{success:!0,corsairEntityId:d,data:o}}},rt={match:g("Project","remove"),handler:async(t,n)=>{let r=t.key,s=m(n,r);if(!s.valid)return{success:!1,statusCode:401,error:s.error||"Signature verification failed"};let o=n.payload;if(o.type!=="Project"||o.action!=="remove")return{success:!0,data:void 0};console.log("\u{1F5D1}\uFE0F Linear Project Deleted Event:",{id:o.data.id,name:o.data.name});let d="";if(t.db.projects&&o.data.id)try{let i=await t.db.projects.findByEntityId(o.data.id);i&&(d=i.id),await t.db.projects.deleteByEntityId(o.data.id)}catch(i){console.warn("Failed to delete project from database:",i)}return await re(t,"linear.webhook.projectRemove",{...o},"completed"),{success:!0,corsairEntityId:d,data:o}}};var V={create:Qe,update:Ye,remove:Ze},J={create:et,update:tt,remove:ot},Q={create:nt,update:at,remove:rt};import{toExternalId as uo}from"corsair/core";async function st(t){let n=t.access_token;if(!n)return null;let r=await fetch("https://api.linear.app/graphql",{method:"POST",headers:{Authorization:n,"Content-Type":"application/json"},body:JSON.stringify({query:"query { viewer { organization { id } } }"})});if(!r.ok)return null;let s=await r.json(),o=uo(s.data?.viewer?.organization?.id);return o?{linkType:"organization_id",externalId:o}:null}import{firstString as mo,readBodyRecord as bo}from"corsair/core";function it(t){let n=bo(t);if(!n)return null;let r=mo([n.organizationId]);return r?{linkType:"organization_id",externalId:r}:null}var ho={issues:{create:J.create,update:J.update,remove:J.remove},comments:{create:V.create,update:V.update,remove:V.remove},projects:{create:Q.create,update:Q.update,remove:Q.remove}},Io={issues:{list:v.list,get:v.get,create:v.create,update:v.update,delete:v.delete},comments:{list:P.list,create:P.create,update:P.update,delete:P.delete},projects:{list:S.list,get:S.get,create:S.create,update:S.update,delete:S.delete},teams:{list:te.list,get:te.get},users:{list:oe.list,get:oe.get}},jo={"issues.list":{input:l.issuesList,output:u.issuesList},"issues.get":{input:l.issuesGet,output:u.issuesGet},"issues.create":{input:l.issuesCreate,output:u.issuesCreate},"issues.update":{input:l.issuesUpdate,output:u.issuesUpdate},"issues.delete":{input:l.issuesDelete,output:u.issuesDelete},"comments.list":{input:l.commentsList,output:u.commentsList},"comments.create":{input:l.commentsCreate,output:u.commentsCreate},"comments.update":{input:l.commentsUpdate,output:u.commentsUpdate},"comments.delete":{input:l.commentsDelete,output:u.commentsDelete},"projects.list":{input:l.projectsList,output:u.projectsList},"projects.get":{input:l.projectsGet,output:u.projectsGet},"projects.create":{input:l.projectsCreate,output:u.projectsCreate},"projects.update":{input:l.projectsUpdate,output:u.projectsUpdate},"projects.delete":{input:l.projectsDelete,output:u.projectsDelete},"teams.list":{input:l.teamsList,output:u.teamsList},"teams.get":{input:l.teamsGet,output:u.teamsGet},"users.list":{input:l.usersList,output:u.usersList},"users.get":{input:l.usersGet,output:u.usersGet}},Co={"issues.create":{description:"A new issue was created",payload:G,response:G},"issues.update":{description:"An issue was updated",payload:$,response:$},"issues.remove":{description:"An issue was deleted",payload:B,response:B},"comments.create":{description:"A comment was added to an issue",payload:M,response:M},"comments.update":{description:"A comment was updated",payload:_,response:_},"comments.remove":{description:"A comment was deleted",payload:F,response:F},"projects.create":{description:"A new project was created",payload:H,response:H},"projects.update":{description:"A project was updated",payload:q,response:q},"projects.remove":{description:"A project was deleted",payload:K,response:K}},Lo="api_key",Eo={api_key:{account:["organization_id"]},oauth_2:{account:["organization_id"]},managed:{account:["organization_id"]}},Ao={"issues.list":{riskLevel:"read",description:"Lists issues, newest created first, across the workspace or one team; filter by assignee, state, labels or project."},"issues.get":{riskLevel:"read",description:'Reads one issue; id is the UUID or an identifier such as "ENG-123".'},"issues.create":{riskLevel:"write",description:"Create a new issue"},"issues.update":{riskLevel:"write",description:"Update an existing issue"},"issues.delete":{riskLevel:"destructive",irreversible:!0,description:"Permanently delete an issue [DESTRUCTIVE \xB7 IRREVERSIBLE]"},"comments.list":{riskLevel:"read",description:'Comments on one issue; issueId is the UUID or an identifier such as "ENG-123".'},"comments.create":{riskLevel:"write",description:"Post a comment on an issue"},"comments.update":{riskLevel:"write",description:"Update a comment"},"comments.delete":{riskLevel:"destructive",irreversible:!0,description:"Delete a comment"},"projects.list":{riskLevel:"read",description:"Lists every project in the workspace; there is no team filter, so check each project's teams. Page with after."},"projects.get":{riskLevel:"read",description:"Get a specific project"},"projects.create":{riskLevel:"write",description:"Create a new project"},"projects.update":{riskLevel:"write",description:"Update an existing project"},"projects.delete":{riskLevel:"destructive",irreversible:!0,description:"Permanently delete a project [DESTRUCTIVE \xB7 IRREVERSIBLE]"},"teams.list":{riskLevel:"read",description:"List teams in the workspace"},"teams.get":{riskLevel:"read",description:"Get a specific team"},"users.list":{riskLevel:"read",description:"List users in the workspace"},"users.get":{riskLevel:"read",description:"Get a specific user"}};function ua(t={}){let n={...t,authType:t.authType??Lo};return{id:"linear",authConfig:Eo,oauthConfig:{providerName:"Linear",authUrl:"https://linear.app/oauth/authorize",tokenUrl:"https://api.linear.app/oauth/token",scopes:["read","write"],authParams:{prompt:"consent"}},schema:Ve,options:n,hooks:n.hooks,webhookHooks:n.webhookHooks,endpoints:Io,webhooks:ho,endpointMeta:Ao,endpointSchemas:jo,webhookSchemas:Co,pluginWebhookMatcher:r=>"linear-signature"in r.headers,pluginTenantWebhookMatcher:it,oauthWebhookTenantLinkResolver:st,errorHandlers:{...Me,...n.errorHandlers},keyBuilder:async(r,s)=>{let o=r.authType;if(s==="webhook"&&n.webhookSecret)return n.webhookSecret;if(s==="webhook"){let d=await r.keys.get_webhook_signature();if(!d)throw new Error("[auth-missing:linear:webhook_signature]: Linear webhook signature is missing");return d}if(s==="endpoint"&&n.key)return n.key;if(s==="endpoint"&&r.authType==="api_key"){let d=await r.keys.get_api_key();if(!d)throw new ct("linear","api_key");return d}if(s==="endpoint"&&r.authType==="oauth_2")return`Bearer ${await go(r,{plugin:"linear",tokenUrl:"https://api.linear.app/oauth/token"})}`;if(r.authType==="managed"){if(!r.hub)throw new Error("[auth-missing:linear:managed]: Hub config is required for managed auth. Pass hub: { ... } to createCorsair().");let d={keys:r.keys,hub:r.hub,plugin:"linear",tenantId:r.tenantId},i=await fo(d);return await yo(r,d),`Bearer ${i.accessToken}`}throw new ct("linear","oauth_2")}}}export{Je as createLinearEventMatch,Me as errorHandlers,ua as linear,Eo as linearAuthConfig,jo as linearEndpointSchemas,m as verifyLinearWebhookSignature};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@corsair-dev/linear",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"description": "Linear plugin for Corsair",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"typescript": "^5.9.3",
|
|
25
25
|
"zod": "^4.1.13",
|
|
26
26
|
"jest": "^29.7.0",
|
|
27
|
-
"corsair": "0.
|
|
27
|
+
"corsair": "0.2.31"
|
|
28
28
|
},
|
|
29
29
|
"keywords": [
|
|
30
30
|
"corsair",
|