@talosjs/linear 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Talos
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,76 @@
1
+ # @talosjs/linear
2
+
3
+ Linear project management integration for querying and mutating Linear issues, teams, projects, labels, workflow states, priorities, and comments.
4
+
5
+ ![Bun](https://img.shields.io/badge/Bun-Compatible-orange?style=flat-square&logo=bun)
6
+ ![TypeScript](https://img.shields.io/badge/TypeScript-Ready-blue?style=flat-square&logo=typescript)
7
+ ![MIT License](https://img.shields.io/badge/License-MIT-yellow?style=flat-square)
8
+
9
+ ## Installation
10
+
11
+ ```bash
12
+ bun add @talosjs/linear
13
+ ```
14
+
15
+ ## Configuration
16
+
17
+ `LinearService` requires a Linear API key. Provide it through the constructor config or expose it through `AppEnv` as `LINEAR_API_KEY`.
18
+
19
+ ```typescript
20
+ import { AppEnv } from "@talosjs/app-env";
21
+ import { LinearService } from "@talosjs/linear";
22
+
23
+ const linear = new LinearService(new AppEnv(), {
24
+ apiKey: "lin_api_...",
25
+ teamId: "team-id",
26
+ });
27
+ ```
28
+
29
+ When the service is resolved through the Talos container, inject `LinearService` and configure `LINEAR_API_KEY` and optionally `LINEAR_TEAM_ID` in the application environment.
30
+
31
+ ## Usage
32
+
33
+ ```typescript
34
+ const issue = await linear.getIssue("OO-123");
35
+
36
+ const created = await linear.createIssue({
37
+ title: "Document Linear package",
38
+ description: "Add public package usage documentation.",
39
+ team: {
40
+ id: "team-id",
41
+ name: "Engineering",
42
+ key: "ENG",
43
+ },
44
+ });
45
+
46
+ await linear.createComment(created.id, "Documentation added.");
47
+ ```
48
+
49
+ ## API
50
+
51
+ ### Issues
52
+
53
+ - `getIssue(id)` fetches one issue.
54
+ - `getIssues(teamId?, filters?)` fetches issues, optionally scoped to a team and Linear filters.
55
+ - `createIssue(input)` creates an issue. `title` and `team.id` are required.
56
+ - `updateIssue(id, input)` updates issue fields.
57
+ - `deleteIssue(id)` deletes an issue and returns Linear's success flag.
58
+
59
+ ### Teams, Projects, Labels, States, and Priorities
60
+
61
+ - `getTeams()` returns available teams.
62
+ - `getProjects(teamId?)` returns projects, optionally filtered by team.
63
+ - `getLabel(id)`, `getLabels(teamId?)`, `createLabel(input)`, `updateLabel(id, input)`, and `deleteLabel(id)` manage issue labels.
64
+ - `getState(id)`, `getStates(teamId?)`, `createState(input)`, `updateState(id, input)`, and `deleteState(id)` manage workflow states.
65
+ - `getPriorities()`, `getPriority(issueId)`, `setPriority(issueId, priority)`, and `clearPriority(issueId)` manage priorities.
66
+
67
+ ### Checks and Comments
68
+
69
+ - `checkLabelById(id)` and `checkLabelByName(name, teamId?)` test whether labels exist.
70
+ - `checkPriorityById(value)` and `checkPriorityByName(name)` test whether a priority is supported.
71
+ - `checkStateById(id)` and `checkStateByName(name, teamId?)` test whether states exist.
72
+ - `createComment(issueId, body)` creates a comment on an issue.
73
+
74
+ ## Types
75
+
76
+ The package exports `Issue`, `LinearService`, `LinearException`, `ILinearService`, `LinearConfigType`, and supporting payload types from `@talosjs/linear`.
@@ -0,0 +1,135 @@
1
+ type LinearConfigType = {
2
+ apiKey?: string;
3
+ teamId?: string;
4
+ };
5
+ type LinearLabelType = {
6
+ id?: string;
7
+ name?: string;
8
+ color?: string;
9
+ description?: string;
10
+ teamId?: string;
11
+ };
12
+ type LinearTeamType = {
13
+ id: string;
14
+ name: string;
15
+ key: string;
16
+ };
17
+ type LinearProjectType = {
18
+ id: string;
19
+ name: string;
20
+ description?: string;
21
+ url: string;
22
+ };
23
+ type LinearUserType = {
24
+ id: string;
25
+ name: string;
26
+ email: string;
27
+ displayName: string;
28
+ };
29
+ type LinearStateType = {
30
+ id?: string;
31
+ name?: string;
32
+ color?: string;
33
+ type?: string;
34
+ description?: string;
35
+ position?: number;
36
+ teamId?: string;
37
+ };
38
+ type LinearCommentType = {
39
+ id: string;
40
+ body: string;
41
+ createdAt: Date;
42
+ user?: LinearUserType;
43
+ };
44
+ type LinearPriorityType = {
45
+ value: number;
46
+ label: string;
47
+ };
48
+ interface ILinearService {
49
+ getIssue: (id: string) => Promise<Issue>;
50
+ getIssues: (teamId: string, filters?: Record<string, unknown>) => Promise<Issue[]>;
51
+ createIssue: (input: Issue) => Promise<Issue>;
52
+ updateIssue: (id: string, input: Issue) => Promise<Issue>;
53
+ deleteIssue: (id: string) => Promise<boolean>;
54
+ getTeams: () => Promise<LinearTeamType[]>;
55
+ getProjects: (teamId?: string) => Promise<LinearProjectType[]>;
56
+ getViewer: () => Promise<LinearUserType>;
57
+ getLabel: (id: string) => Promise<LinearLabelType>;
58
+ getLabels: (teamId?: string) => Promise<LinearLabelType[]>;
59
+ createLabel: (input: LinearLabelType) => Promise<LinearLabelType>;
60
+ updateLabel: (id: string, input: LinearLabelType) => Promise<LinearLabelType>;
61
+ deleteLabel: (id: string) => Promise<boolean>;
62
+ getPriorities: () => LinearPriorityType[];
63
+ getPriority: (issueId: string) => Promise<LinearPriorityType>;
64
+ setPriority: (issueId: string, priority: number) => Promise<Issue>;
65
+ clearPriority: (issueId: string) => Promise<Issue>;
66
+ getState: (id: string) => Promise<LinearStateType>;
67
+ getStates: (teamId?: string) => Promise<LinearStateType[]>;
68
+ createState: (input: LinearStateType) => Promise<LinearStateType>;
69
+ updateState: (id: string, input: LinearStateType) => Promise<LinearStateType>;
70
+ deleteState: (id: string) => Promise<boolean>;
71
+ checkLabelById: (id: string) => Promise<boolean>;
72
+ checkLabelByName: (name: string, teamId?: string) => Promise<boolean>;
73
+ checkPriorityById: (value: number) => boolean;
74
+ checkPriorityByName: (name: string) => boolean;
75
+ checkStateById: (id: string) => Promise<boolean>;
76
+ checkStateByName: (name: string, teamId?: string) => Promise<boolean>;
77
+ createComment: (issueId: string, body: string) => Promise<LinearCommentType>;
78
+ }
79
+ declare class Issue {
80
+ id?: string;
81
+ title?: string;
82
+ description?: string;
83
+ priority?: number;
84
+ url?: string;
85
+ identifier?: string;
86
+ createdAt?: Date;
87
+ updatedAt?: Date;
88
+ team?: LinearTeamType;
89
+ assignee?: LinearUserType;
90
+ project?: LinearProjectType;
91
+ state?: LinearStateType;
92
+ labels?: LinearLabelType[];
93
+ comments?: LinearCommentType[];
94
+ }
95
+ import { Exception } from "@talosjs/exception";
96
+ declare class LinearException extends Exception {
97
+ constructor(message: string, key: string, data?: Record<string, unknown>);
98
+ }
99
+ import { AppEnv } from "@talosjs/app-env";
100
+ declare class LinearService implements ILinearService {
101
+ private readonly env;
102
+ private readonly client;
103
+ private readonly defaultTeamId;
104
+ constructor(env: AppEnv, config?: LinearConfigType);
105
+ getIssue(id: string): Promise<Issue>;
106
+ getIssues(teamId?: string, filters?: Record<string, unknown>): Promise<Issue[]>;
107
+ createIssue(input: Issue): Promise<Issue>;
108
+ updateIssue(id: string, input: Issue): Promise<Issue>;
109
+ deleteIssue(id: string): Promise<boolean>;
110
+ getTeams(): Promise<LinearTeamType[]>;
111
+ getProjects(teamId?: string): Promise<LinearProjectType[]>;
112
+ getViewer(): Promise<LinearUserType>;
113
+ getLabel(id: string): Promise<LinearLabelType>;
114
+ getLabels(teamId?: string): Promise<LinearLabelType[]>;
115
+ createLabel(input: LinearLabelType): Promise<LinearLabelType>;
116
+ updateLabel(id: string, input: LinearLabelType): Promise<LinearLabelType>;
117
+ deleteLabel(id: string): Promise<boolean>;
118
+ getPriorities(): LinearPriorityType[];
119
+ getPriority(issueId: string): Promise<LinearPriorityType>;
120
+ setPriority(issueId: string, priority: number): Promise<Issue>;
121
+ clearPriority(issueId: string): Promise<Issue>;
122
+ getState(id: string): Promise<LinearStateType>;
123
+ getStates(teamId?: string): Promise<LinearStateType[]>;
124
+ createState(input: LinearStateType): Promise<LinearStateType>;
125
+ updateState(id: string, input: LinearStateType): Promise<LinearStateType>;
126
+ deleteState(id: string): Promise<boolean>;
127
+ checkLabelById(id: string): Promise<boolean>;
128
+ checkLabelByName(name: string, teamId?: string): Promise<boolean>;
129
+ checkPriorityById(value: number): boolean;
130
+ checkPriorityByName(name: string): boolean;
131
+ checkStateById(id: string): Promise<boolean>;
132
+ checkStateByName(name: string, teamId?: string): Promise<boolean>;
133
+ createComment(issueId: string, body: string): Promise<LinearCommentType>;
134
+ }
135
+ export { LinearUserType, LinearTeamType, LinearStateType, LinearService, LinearProjectType, LinearPriorityType, LinearLabelType, LinearException, LinearConfigType, LinearCommentType, Issue, ILinearService };
package/dist/index.js ADDED
@@ -0,0 +1,578 @@
1
+ // @bun
2
+ var __legacyDecorateClassTS = function(decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
5
+ r = Reflect.decorate(decorators, target, key, desc);
6
+ else
7
+ for (var i = decorators.length - 1;i >= 0; i--)
8
+ if (d = decorators[i])
9
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
10
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
11
+ };
12
+ var __legacyDecorateParamTS = (index, decorator) => (target, key) => decorator(target, key, index);
13
+ var __legacyMetadataTS = (k, v) => {
14
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
15
+ return Reflect.metadata(k, v);
16
+ };
17
+
18
+ // src/Issue.ts
19
+ class Issue {
20
+ id;
21
+ title;
22
+ description;
23
+ priority;
24
+ url;
25
+ identifier;
26
+ createdAt;
27
+ updatedAt;
28
+ team;
29
+ assignee;
30
+ project;
31
+ state;
32
+ labels;
33
+ comments;
34
+ }
35
+ var mapIssue = async (raw) => {
36
+ const issue = new Issue;
37
+ issue.id = raw.id;
38
+ issue.title = raw.title;
39
+ if (raw.description != null)
40
+ issue.description = raw.description;
41
+ issue.priority = raw.priority;
42
+ issue.url = raw.url;
43
+ issue.identifier = raw.identifier;
44
+ issue.createdAt = raw.createdAt;
45
+ issue.updatedAt = raw.updatedAt;
46
+ const [team, state, assignee, project, labels, comments] = await Promise.all([
47
+ raw.team ?? Promise.resolve(undefined),
48
+ raw.state ?? Promise.resolve(undefined),
49
+ raw.assignee ?? Promise.resolve(undefined),
50
+ raw.project ?? Promise.resolve(undefined),
51
+ raw.labels(),
52
+ raw.comments()
53
+ ]);
54
+ if (team)
55
+ issue.team = { id: team.id, name: team.name, key: team.key };
56
+ if (state)
57
+ issue.state = { id: state.id, name: state.name, color: state.color, type: state.type };
58
+ if (assignee)
59
+ issue.assignee = { id: assignee.id, name: assignee.name, email: assignee.email, displayName: assignee.displayName };
60
+ if (project)
61
+ issue.project = {
62
+ id: project.id,
63
+ name: project.name,
64
+ description: project.description ?? undefined,
65
+ url: project.url
66
+ };
67
+ issue.labels = labels.nodes.map((l) => ({ id: l.id, name: l.name, color: l.color }));
68
+ issue.comments = await Promise.all(comments.nodes.map(async (c) => {
69
+ const user = await c.user;
70
+ return {
71
+ id: c.id,
72
+ body: c.body,
73
+ createdAt: c.createdAt,
74
+ ...user ? { user: { id: user.id, name: user.name, email: user.email, displayName: user.displayName } } : {}
75
+ };
76
+ }));
77
+ return issue;
78
+ };
79
+ // src/LinearException.ts
80
+ import { Exception } from "@talosjs/exception";
81
+ import { HttpStatus } from "@talosjs/http-status";
82
+
83
+ class LinearException extends Exception {
84
+ constructor(message, key, data = {}) {
85
+ super(message, {
86
+ key,
87
+ status: HttpStatus.Code.InternalServerError,
88
+ data
89
+ });
90
+ this.name = "LinearException";
91
+ }
92
+ }
93
+ // src/LinearService.ts
94
+ import { LinearClient } from "@linear/sdk";
95
+ import { AppEnv } from "@talosjs/app-env";
96
+ import { inject, injectable } from "@talosjs/container";
97
+ var PRIORITIES = [
98
+ { value: 0, label: "No priority" },
99
+ { value: 1, label: "Urgent" },
100
+ { value: 2, label: "High" },
101
+ { value: 3, label: "Normal" },
102
+ { value: 4, label: "Low" }
103
+ ];
104
+
105
+ class LinearService {
106
+ env;
107
+ client;
108
+ defaultTeamId;
109
+ constructor(env, config = {}) {
110
+ this.env = env;
111
+ const apiKey = config.apiKey || this.env.LINEAR_API_KEY;
112
+ if (!apiKey) {
113
+ throw new LinearException("Linear API key is required. Please provide it through the constructor config or set the LINEAR_API_KEY environment variable.", "API_KEY_REQUIRED", {});
114
+ }
115
+ this.client = new LinearClient({ apiKey });
116
+ this.defaultTeamId = config.teamId || this.env.LINEAR_TEAM_ID;
117
+ }
118
+ async getIssue(id) {
119
+ try {
120
+ const issue = await this.client.issue(id);
121
+ return mapIssue(issue);
122
+ } catch (e) {
123
+ throw new LinearException(`Failed to fetch issue: ${id}`, "ISSUE_FETCH_ERROR", { id, cause: String(e) });
124
+ }
125
+ }
126
+ async getIssues(teamId, filters = {}) {
127
+ const resolvedTeamId = teamId ?? this.defaultTeamId;
128
+ try {
129
+ const issues = await this.client.issues(resolvedTeamId ? { filter: { team: { id: { eq: resolvedTeamId } }, ...filters } } : { filter: filters });
130
+ return Promise.all(issues.nodes.map(mapIssue));
131
+ } catch (e) {
132
+ throw new LinearException(`Failed to fetch issues for team: ${resolvedTeamId}`, "ISSUES_FETCH_ERROR", {
133
+ teamId: resolvedTeamId,
134
+ cause: String(e)
135
+ });
136
+ }
137
+ }
138
+ async createIssue(input) {
139
+ try {
140
+ if (!input.title || !input.team) {
141
+ throw new LinearException("title and team are required", "ISSUE_CREATE_ERROR", {});
142
+ }
143
+ const payload = await this.client.createIssue({
144
+ title: input.title,
145
+ teamId: input.team.id,
146
+ ...input.description != null ? { description: input.description } : {},
147
+ ...input.assignee != null ? { assigneeId: input.assignee.id } : {},
148
+ ...input.project != null ? { projectId: input.project.id } : {},
149
+ ...input.priority != null ? { priority: input.priority } : {},
150
+ ...input.state != null ? { stateId: input.state.id } : {},
151
+ ...input.labels != null ? { labelIds: input.labels.flatMap((l) => l.id != null ? [l.id] : []) } : {}
152
+ });
153
+ const issue = await payload.issue;
154
+ if (!issue) {
155
+ throw new LinearException("Issue creation returned no data", "ISSUE_CREATE_ERROR", {
156
+ input: JSON.stringify(input)
157
+ });
158
+ }
159
+ return mapIssue(issue);
160
+ } catch (e) {
161
+ if (e instanceof LinearException)
162
+ throw e;
163
+ throw new LinearException("Failed to create issue", "ISSUE_CREATE_ERROR", {
164
+ input: JSON.stringify(input),
165
+ cause: String(e)
166
+ });
167
+ }
168
+ }
169
+ async updateIssue(id, input) {
170
+ try {
171
+ const payload = await this.client.updateIssue(id, {
172
+ ...input.title != null ? { title: input.title } : {},
173
+ ...input.description != null ? { description: input.description } : {},
174
+ ...input.assignee != null ? { assigneeId: input.assignee.id } : {},
175
+ ...input.project != null ? { projectId: input.project.id } : {},
176
+ ...input.priority != null ? { priority: input.priority } : {},
177
+ ...input.state != null ? { stateId: input.state.id } : {},
178
+ ...input.labels != null ? { labelIds: input.labels.flatMap((l) => l.id != null ? [l.id] : []) } : {}
179
+ });
180
+ const issue = await payload.issue;
181
+ if (!issue) {
182
+ throw new LinearException("Issue update returned no data", "ISSUE_UPDATE_ERROR", { id });
183
+ }
184
+ return mapIssue(issue);
185
+ } catch (e) {
186
+ if (e instanceof LinearException)
187
+ throw e;
188
+ throw new LinearException(`Failed to update issue: ${id}`, "ISSUE_UPDATE_ERROR", { id, cause: String(e) });
189
+ }
190
+ }
191
+ async deleteIssue(id) {
192
+ try {
193
+ const payload = await this.client.deleteIssue(id);
194
+ return payload.success;
195
+ } catch (e) {
196
+ throw new LinearException(`Failed to delete issue: ${id}`, "ISSUE_DELETE_ERROR", { id, cause: String(e) });
197
+ }
198
+ }
199
+ async getTeams() {
200
+ try {
201
+ const teams = await this.client.teams();
202
+ return teams.nodes.map((team) => ({
203
+ id: team.id,
204
+ name: team.name,
205
+ key: team.key
206
+ }));
207
+ } catch (e) {
208
+ throw new LinearException("Failed to fetch teams", "TEAMS_FETCH_ERROR", { cause: String(e) });
209
+ }
210
+ }
211
+ async getProjects(teamId) {
212
+ const resolvedTeamId = teamId ?? this.defaultTeamId;
213
+ try {
214
+ const projects = await this.client.projects(resolvedTeamId ? { filter: { accessibleTeams: { id: { eq: resolvedTeamId } } } } : {});
215
+ return projects.nodes.map((project) => ({
216
+ id: project.id,
217
+ name: project.name,
218
+ ...project.description != null ? { description: project.description } : {},
219
+ url: project.url
220
+ }));
221
+ } catch (e) {
222
+ throw new LinearException("Failed to fetch projects", "PROJECTS_FETCH_ERROR", {
223
+ teamId: resolvedTeamId,
224
+ cause: String(e)
225
+ });
226
+ }
227
+ }
228
+ async getViewer() {
229
+ try {
230
+ const viewer = await this.client.viewer;
231
+ return {
232
+ id: viewer.id,
233
+ name: viewer.name,
234
+ email: viewer.email,
235
+ displayName: viewer.displayName
236
+ };
237
+ } catch (e) {
238
+ throw new LinearException("Failed to fetch viewer", "VIEWER_FETCH_ERROR", { cause: String(e) });
239
+ }
240
+ }
241
+ async getLabel(id) {
242
+ try {
243
+ const label = await this.client.issueLabel(id);
244
+ return {
245
+ id: label.id,
246
+ name: label.name,
247
+ color: label.color,
248
+ ...label.description != null ? { description: label.description } : {},
249
+ ...label.teamId != null ? { teamId: label.teamId } : {}
250
+ };
251
+ } catch (e) {
252
+ throw new LinearException(`Failed to fetch label: ${id}`, "LABEL_FETCH_ERROR", { id, cause: String(e) });
253
+ }
254
+ }
255
+ async getLabels(teamId) {
256
+ const resolvedTeamId = teamId ?? this.defaultTeamId;
257
+ try {
258
+ const labels = await this.client.issueLabels(resolvedTeamId ? { filter: { team: { id: { eq: resolvedTeamId } } } } : {});
259
+ return labels.nodes.map((label) => ({
260
+ id: label.id,
261
+ name: label.name,
262
+ color: label.color,
263
+ ...label.description != null ? { description: label.description } : {},
264
+ ...label.teamId != null ? { teamId: label.teamId } : {}
265
+ }));
266
+ } catch (e) {
267
+ throw new LinearException("Failed to fetch labels", "LABELS_FETCH_ERROR", {
268
+ teamId: resolvedTeamId,
269
+ cause: String(e)
270
+ });
271
+ }
272
+ }
273
+ async createLabel(input) {
274
+ const resolvedTeamId = input.teamId ?? this.defaultTeamId;
275
+ try {
276
+ if (!input.name) {
277
+ throw new LinearException("name is required", "LABEL_CREATE_ERROR", {});
278
+ }
279
+ const payload = await this.client.createIssueLabel({
280
+ name: input.name,
281
+ ...input.color != null ? { color: input.color } : {},
282
+ ...input.description != null ? { description: input.description } : {},
283
+ ...resolvedTeamId != null ? { teamId: resolvedTeamId } : {}
284
+ });
285
+ const label = await payload.issueLabel;
286
+ if (!label) {
287
+ throw new LinearException("Label creation returned no data", "LABEL_CREATE_ERROR", {
288
+ input: JSON.stringify(input)
289
+ });
290
+ }
291
+ return {
292
+ id: label.id,
293
+ name: label.name,
294
+ color: label.color,
295
+ ...label.description != null ? { description: label.description } : {},
296
+ ...label.teamId != null ? { teamId: label.teamId } : {}
297
+ };
298
+ } catch (e) {
299
+ if (e instanceof LinearException)
300
+ throw e;
301
+ throw new LinearException("Failed to create label", "LABEL_CREATE_ERROR", {
302
+ input: JSON.stringify(input),
303
+ cause: String(e)
304
+ });
305
+ }
306
+ }
307
+ async updateLabel(id, input) {
308
+ try {
309
+ const payload = await this.client.updateIssueLabel(id, {
310
+ ...input.name != null ? { name: input.name } : {},
311
+ ...input.color != null ? { color: input.color } : {},
312
+ ...input.description != null ? { description: input.description } : {}
313
+ });
314
+ const label = await payload.issueLabel;
315
+ if (!label) {
316
+ throw new LinearException("Label update returned no data", "LABEL_UPDATE_ERROR", { id });
317
+ }
318
+ return {
319
+ id: label.id,
320
+ name: label.name,
321
+ color: label.color,
322
+ ...label.description != null ? { description: label.description } : {},
323
+ ...label.teamId != null ? { teamId: label.teamId } : {}
324
+ };
325
+ } catch (e) {
326
+ if (e instanceof LinearException)
327
+ throw e;
328
+ throw new LinearException(`Failed to update label: ${id}`, "LABEL_UPDATE_ERROR", { id, cause: String(e) });
329
+ }
330
+ }
331
+ async deleteLabel(id) {
332
+ try {
333
+ const payload = await this.client.deleteIssueLabel(id);
334
+ return payload.success;
335
+ } catch (e) {
336
+ throw new LinearException(`Failed to delete label: ${id}`, "LABEL_DELETE_ERROR", { id, cause: String(e) });
337
+ }
338
+ }
339
+ getPriorities() {
340
+ return PRIORITIES;
341
+ }
342
+ async getPriority(issueId) {
343
+ try {
344
+ const issue = await this.client.issue(issueId);
345
+ const priority = PRIORITIES.find((p) => p.value === issue.priority);
346
+ if (!priority) {
347
+ throw new LinearException(`Unknown priority value: ${issue.priority}`, "PRIORITY_FETCH_ERROR", { issueId });
348
+ }
349
+ return priority;
350
+ } catch (e) {
351
+ if (e instanceof LinearException)
352
+ throw e;
353
+ throw new LinearException(`Failed to fetch priority for issue: ${issueId}`, "PRIORITY_FETCH_ERROR", {
354
+ issueId,
355
+ cause: String(e)
356
+ });
357
+ }
358
+ }
359
+ async setPriority(issueId, priority) {
360
+ try {
361
+ if (!PRIORITIES.some((p) => p.value === priority)) {
362
+ throw new LinearException(`Invalid priority value: ${priority}`, "PRIORITY_SET_ERROR", { issueId, priority });
363
+ }
364
+ const payload = await this.client.updateIssue(issueId, { priority });
365
+ const issue = await payload.issue;
366
+ if (!issue) {
367
+ throw new LinearException("Priority update returned no data", "PRIORITY_SET_ERROR", { issueId });
368
+ }
369
+ return mapIssue(issue);
370
+ } catch (e) {
371
+ if (e instanceof LinearException)
372
+ throw e;
373
+ throw new LinearException(`Failed to set priority for issue: ${issueId}`, "PRIORITY_SET_ERROR", {
374
+ issueId,
375
+ priority,
376
+ cause: String(e)
377
+ });
378
+ }
379
+ }
380
+ async clearPriority(issueId) {
381
+ return this.setPriority(issueId, 0);
382
+ }
383
+ async getState(id) {
384
+ try {
385
+ const state = await this.client.workflowState(id);
386
+ return {
387
+ id: state.id,
388
+ name: state.name,
389
+ color: state.color,
390
+ type: state.type,
391
+ ...state.description != null ? { description: state.description } : {},
392
+ position: state.position,
393
+ ...state.teamId != null ? { teamId: state.teamId } : {}
394
+ };
395
+ } catch (e) {
396
+ throw new LinearException(`Failed to fetch state: ${id}`, "STATE_FETCH_ERROR", { id, cause: String(e) });
397
+ }
398
+ }
399
+ async getStates(teamId) {
400
+ const resolvedTeamId = teamId ?? this.defaultTeamId;
401
+ try {
402
+ const states = await this.client.workflowStates(resolvedTeamId ? { filter: { team: { id: { eq: resolvedTeamId } } } } : {});
403
+ return states.nodes.map((state) => ({
404
+ id: state.id,
405
+ name: state.name,
406
+ color: state.color,
407
+ type: state.type,
408
+ ...state.description != null ? { description: state.description } : {},
409
+ position: state.position,
410
+ ...state.teamId != null ? { teamId: state.teamId } : {}
411
+ }));
412
+ } catch (e) {
413
+ throw new LinearException("Failed to fetch states", "STATES_FETCH_ERROR", {
414
+ teamId: resolvedTeamId,
415
+ cause: String(e)
416
+ });
417
+ }
418
+ }
419
+ async createState(input) {
420
+ const resolvedTeamId = input.teamId ?? this.defaultTeamId;
421
+ try {
422
+ if (!input.name || !input.color || !input.type || !resolvedTeamId) {
423
+ throw new LinearException("name, color, type and teamId are required", "STATE_CREATE_ERROR", {});
424
+ }
425
+ const payload = await this.client.createWorkflowState({
426
+ name: input.name,
427
+ color: input.color,
428
+ type: input.type,
429
+ teamId: resolvedTeamId,
430
+ ...input.description != null ? { description: input.description } : {},
431
+ ...input.position != null ? { position: input.position } : {}
432
+ });
433
+ const state = await payload.workflowState;
434
+ if (!state) {
435
+ throw new LinearException("State creation returned no data", "STATE_CREATE_ERROR", {
436
+ input: JSON.stringify(input)
437
+ });
438
+ }
439
+ return {
440
+ id: state.id,
441
+ name: state.name,
442
+ color: state.color,
443
+ type: state.type,
444
+ ...state.description != null ? { description: state.description } : {},
445
+ position: state.position,
446
+ ...state.teamId != null ? { teamId: state.teamId } : {}
447
+ };
448
+ } catch (e) {
449
+ if (e instanceof LinearException)
450
+ throw e;
451
+ throw new LinearException("Failed to create state", "STATE_CREATE_ERROR", {
452
+ input: JSON.stringify(input),
453
+ cause: String(e)
454
+ });
455
+ }
456
+ }
457
+ async updateState(id, input) {
458
+ try {
459
+ const payload = await this.client.updateWorkflowState(id, {
460
+ ...input.name != null ? { name: input.name } : {},
461
+ ...input.color != null ? { color: input.color } : {},
462
+ ...input.description != null ? { description: input.description } : {},
463
+ ...input.position != null ? { position: input.position } : {}
464
+ });
465
+ const state = await payload.workflowState;
466
+ if (!state) {
467
+ throw new LinearException("State update returned no data", "STATE_UPDATE_ERROR", { id });
468
+ }
469
+ return {
470
+ id: state.id,
471
+ name: state.name,
472
+ color: state.color,
473
+ type: state.type,
474
+ ...state.description != null ? { description: state.description } : {},
475
+ position: state.position,
476
+ ...state.teamId != null ? { teamId: state.teamId } : {}
477
+ };
478
+ } catch (e) {
479
+ if (e instanceof LinearException)
480
+ throw e;
481
+ throw new LinearException(`Failed to update state: ${id}`, "STATE_UPDATE_ERROR", { id, cause: String(e) });
482
+ }
483
+ }
484
+ async deleteState(id) {
485
+ try {
486
+ const payload = await this.client.archiveWorkflowState(id);
487
+ return payload.success;
488
+ } catch (e) {
489
+ throw new LinearException(`Failed to delete state: ${id}`, "STATE_DELETE_ERROR", { id, cause: String(e) });
490
+ }
491
+ }
492
+ async checkLabelById(id) {
493
+ try {
494
+ await this.client.issueLabel(id);
495
+ return true;
496
+ } catch {
497
+ return false;
498
+ }
499
+ }
500
+ async checkLabelByName(name, teamId) {
501
+ const resolvedTeamId = teamId ?? this.defaultTeamId;
502
+ try {
503
+ const labels = await this.client.issueLabels(resolvedTeamId ? { filter: { team: { id: { eq: resolvedTeamId } } } } : {});
504
+ return labels.nodes.some((l) => l.name === name);
505
+ } catch (e) {
506
+ throw new LinearException("Failed to check label by name", "LABEL_CHECK_ERROR", {
507
+ name,
508
+ teamId: resolvedTeamId,
509
+ cause: String(e)
510
+ });
511
+ }
512
+ }
513
+ checkPriorityById(value) {
514
+ return PRIORITIES.some((p) => p.value === value);
515
+ }
516
+ checkPriorityByName(name) {
517
+ return PRIORITIES.some((p) => p.label.toLowerCase() === name.toLowerCase());
518
+ }
519
+ async checkStateById(id) {
520
+ try {
521
+ await this.client.workflowState(id);
522
+ return true;
523
+ } catch {
524
+ return false;
525
+ }
526
+ }
527
+ async checkStateByName(name, teamId) {
528
+ const resolvedTeamId = teamId ?? this.defaultTeamId;
529
+ try {
530
+ const states = await this.client.workflowStates(resolvedTeamId ? { filter: { team: { id: { eq: resolvedTeamId } } } } : {});
531
+ return states.nodes.some((s) => s.name === name);
532
+ } catch (e) {
533
+ throw new LinearException("Failed to check state by name", "STATE_CHECK_ERROR", {
534
+ name,
535
+ teamId: resolvedTeamId,
536
+ cause: String(e)
537
+ });
538
+ }
539
+ }
540
+ async createComment(issueId, body) {
541
+ try {
542
+ const payload = await this.client.createComment({ issueId, body });
543
+ const comment = await payload.comment;
544
+ if (!comment) {
545
+ throw new LinearException("Comment creation returned no data", "COMMENT_CREATE_ERROR", { issueId });
546
+ }
547
+ const user = await comment.user;
548
+ return {
549
+ id: comment.id,
550
+ body: comment.body,
551
+ createdAt: comment.createdAt,
552
+ ...user ? { user: { id: user.id, name: user.name, email: user.email, displayName: user.displayName } } : {}
553
+ };
554
+ } catch (e) {
555
+ if (e instanceof LinearException)
556
+ throw e;
557
+ throw new LinearException(`Failed to create comment for issue: ${issueId}`, "COMMENT_CREATE_ERROR", {
558
+ issueId,
559
+ cause: String(e)
560
+ });
561
+ }
562
+ }
563
+ }
564
+ LinearService = __legacyDecorateClassTS([
565
+ injectable(),
566
+ __legacyDecorateParamTS(0, inject(AppEnv)),
567
+ __legacyMetadataTS("design:paramtypes", [
568
+ typeof AppEnv === "undefined" ? Object : AppEnv,
569
+ typeof LinearConfigType === "undefined" ? Object : LinearConfigType
570
+ ])
571
+ ], LinearService);
572
+ export {
573
+ LinearService,
574
+ LinearException,
575
+ Issue
576
+ };
577
+
578
+ //# debugId=41C077871B0550FF64756E2164756E21
@@ -0,0 +1,12 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["src/Issue.ts", "src/LinearException.ts", "src/LinearService.ts"],
4
+ "sourcesContent": [
5
+ "import type { Issue as LinearSDKIssue } from \"@linear/sdk\";\nimport type {\n LinearCommentType,\n LinearLabelType,\n LinearProjectType,\n LinearStateType,\n LinearTeamType,\n LinearUserType,\n} from \"./types\";\n\nexport class Issue {\n public id?: string;\n public title?: string;\n public description?: string;\n public priority?: number;\n public url?: string;\n public identifier?: string;\n public createdAt?: Date;\n public updatedAt?: Date;\n public team?: LinearTeamType;\n public assignee?: LinearUserType;\n public project?: LinearProjectType;\n public state?: LinearStateType;\n public labels?: LinearLabelType[];\n public comments?: LinearCommentType[];\n}\n\nexport const mapIssue = async (raw: LinearSDKIssue): Promise<Issue> => {\n const issue = new Issue();\n issue.id = raw.id;\n issue.title = raw.title;\n if (raw.description != null) issue.description = raw.description;\n issue.priority = raw.priority;\n issue.url = raw.url;\n issue.identifier = raw.identifier;\n issue.createdAt = raw.createdAt;\n issue.updatedAt = raw.updatedAt;\n\n const [team, state, assignee, project, labels, comments] = await Promise.all([\n raw.team ?? Promise.resolve(undefined),\n raw.state ?? Promise.resolve(undefined),\n raw.assignee ?? Promise.resolve(undefined),\n raw.project ?? Promise.resolve(undefined),\n raw.labels(),\n raw.comments(),\n ]);\n\n if (team) issue.team = { id: team.id, name: team.name, key: team.key };\n if (state) issue.state = { id: state.id, name: state.name, color: state.color, type: state.type };\n if (assignee)\n issue.assignee = { id: assignee.id, name: assignee.name, email: assignee.email, displayName: assignee.displayName };\n if (project)\n issue.project = {\n id: project.id,\n name: project.name,\n description: project.description ?? undefined,\n url: project.url,\n };\n issue.labels = labels.nodes.map((l) => ({ id: l.id, name: l.name, color: l.color }));\n issue.comments = await Promise.all(\n comments.nodes.map(async (c) => {\n const user = await c.user;\n return {\n id: c.id,\n body: c.body,\n createdAt: c.createdAt,\n ...(user ? { user: { id: user.id, name: user.name, email: user.email, displayName: user.displayName } } : {}),\n };\n }),\n );\n\n return issue;\n};\n",
6
+ "import { Exception } from \"@talosjs/exception\";\nimport { HttpStatus } from \"@talosjs/http-status\";\n\nexport class LinearException extends Exception {\n constructor(message: string, key: string, data: Record<string, unknown> = {}) {\n super(message, {\n key,\n status: HttpStatus.Code.InternalServerError,\n data,\n });\n this.name = \"LinearException\";\n }\n}\n",
7
+ "import { LinearClient } from \"@linear/sdk\";\nimport { AppEnv } from \"@talosjs/app-env\";\nimport { inject, injectable } from \"@talosjs/container\";\nimport { type Issue, mapIssue } from \"./Issue\";\nimport { LinearException } from \"./LinearException\";\nimport type {\n ILinearService,\n LinearCommentType,\n LinearConfigType,\n LinearLabelType,\n LinearPriorityType,\n LinearProjectType,\n LinearStateType,\n LinearTeamType,\n LinearUserType,\n} from \"./types\";\n\nconst PRIORITIES: LinearPriorityType[] = [\n { value: 0, label: \"No priority\" },\n { value: 1, label: \"Urgent\" },\n { value: 2, label: \"High\" },\n { value: 3, label: \"Normal\" },\n { value: 4, label: \"Low\" },\n];\n\n@injectable()\nexport class LinearService implements ILinearService {\n private readonly client: LinearClient;\n private readonly defaultTeamId: string | undefined;\n\n public constructor(\n @inject(AppEnv) private readonly env: AppEnv,\n config: LinearConfigType = {},\n ) {\n const apiKey = config.apiKey || this.env.LINEAR_API_KEY;\n\n if (!apiKey) {\n throw new LinearException(\n \"Linear API key is required. Please provide it through the constructor config or set the LINEAR_API_KEY environment variable.\",\n \"API_KEY_REQUIRED\",\n {},\n );\n }\n\n this.client = new LinearClient({ apiKey });\n this.defaultTeamId = config.teamId || this.env.LINEAR_TEAM_ID;\n }\n\n public async getIssue(id: string): Promise<Issue> {\n try {\n const issue = await this.client.issue(id);\n return mapIssue(issue);\n } catch (e) {\n throw new LinearException(`Failed to fetch issue: ${id}`, \"ISSUE_FETCH_ERROR\", { id, cause: String(e) });\n }\n }\n\n public async getIssues(teamId?: string, filters: Record<string, unknown> = {}): Promise<Issue[]> {\n const resolvedTeamId = teamId ?? this.defaultTeamId;\n try {\n const issues = await this.client.issues(\n resolvedTeamId ? { filter: { team: { id: { eq: resolvedTeamId } }, ...filters } } : { filter: filters },\n );\n return Promise.all(issues.nodes.map(mapIssue));\n } catch (e) {\n throw new LinearException(`Failed to fetch issues for team: ${resolvedTeamId}`, \"ISSUES_FETCH_ERROR\", {\n teamId: resolvedTeamId,\n cause: String(e),\n });\n }\n }\n\n public async createIssue(input: Issue): Promise<Issue> {\n try {\n if (!input.title || !input.team) {\n throw new LinearException(\"title and team are required\", \"ISSUE_CREATE_ERROR\", {});\n }\n const payload = await this.client.createIssue({\n title: input.title,\n teamId: input.team.id,\n ...(input.description != null ? { description: input.description } : {}),\n ...(input.assignee != null ? { assigneeId: input.assignee.id } : {}),\n ...(input.project != null ? { projectId: input.project.id } : {}),\n ...(input.priority != null ? { priority: input.priority } : {}),\n ...(input.state != null ? { stateId: input.state.id } : {}),\n ...(input.labels != null ? { labelIds: input.labels.flatMap((l) => (l.id != null ? [l.id] : [])) } : {}),\n });\n\n const issue = await payload.issue;\n if (!issue) {\n throw new LinearException(\"Issue creation returned no data\", \"ISSUE_CREATE_ERROR\", {\n input: JSON.stringify(input),\n });\n }\n return mapIssue(issue);\n } catch (e) {\n if (e instanceof LinearException) throw e;\n throw new LinearException(\"Failed to create issue\", \"ISSUE_CREATE_ERROR\", {\n input: JSON.stringify(input),\n cause: String(e),\n });\n }\n }\n\n public async updateIssue(id: string, input: Issue): Promise<Issue> {\n try {\n const payload = await this.client.updateIssue(id, {\n ...(input.title != null ? { title: input.title } : {}),\n ...(input.description != null ? { description: input.description } : {}),\n ...(input.assignee != null ? { assigneeId: input.assignee.id } : {}),\n ...(input.project != null ? { projectId: input.project.id } : {}),\n ...(input.priority != null ? { priority: input.priority } : {}),\n ...(input.state != null ? { stateId: input.state.id } : {}),\n ...(input.labels != null ? { labelIds: input.labels.flatMap((l) => (l.id != null ? [l.id] : [])) } : {}),\n });\n\n const issue = await payload.issue;\n if (!issue) {\n throw new LinearException(\"Issue update returned no data\", \"ISSUE_UPDATE_ERROR\", { id });\n }\n return mapIssue(issue);\n } catch (e) {\n if (e instanceof LinearException) throw e;\n throw new LinearException(`Failed to update issue: ${id}`, \"ISSUE_UPDATE_ERROR\", { id, cause: String(e) });\n }\n }\n\n public async deleteIssue(id: string): Promise<boolean> {\n try {\n const payload = await this.client.deleteIssue(id);\n return payload.success;\n } catch (e) {\n throw new LinearException(`Failed to delete issue: ${id}`, \"ISSUE_DELETE_ERROR\", { id, cause: String(e) });\n }\n }\n\n public async getTeams(): Promise<LinearTeamType[]> {\n try {\n const teams = await this.client.teams();\n return teams.nodes.map((team) => ({\n id: team.id,\n name: team.name,\n key: team.key,\n }));\n } catch (e) {\n throw new LinearException(\"Failed to fetch teams\", \"TEAMS_FETCH_ERROR\", { cause: String(e) });\n }\n }\n\n public async getProjects(teamId?: string): Promise<LinearProjectType[]> {\n const resolvedTeamId = teamId ?? this.defaultTeamId;\n try {\n const projects = await this.client.projects(\n resolvedTeamId ? { filter: { accessibleTeams: { id: { eq: resolvedTeamId } } } } : {},\n );\n\n return projects.nodes.map((project) => ({\n id: project.id,\n name: project.name,\n ...(project.description != null ? { description: project.description } : {}),\n url: project.url,\n }));\n } catch (e) {\n throw new LinearException(\"Failed to fetch projects\", \"PROJECTS_FETCH_ERROR\", {\n teamId: resolvedTeamId,\n cause: String(e),\n });\n }\n }\n\n public async getViewer(): Promise<LinearUserType> {\n try {\n const viewer = await this.client.viewer;\n return {\n id: viewer.id,\n name: viewer.name,\n email: viewer.email,\n displayName: viewer.displayName,\n };\n } catch (e) {\n throw new LinearException(\"Failed to fetch viewer\", \"VIEWER_FETCH_ERROR\", { cause: String(e) });\n }\n }\n\n public async getLabel(id: string): Promise<LinearLabelType> {\n try {\n const label = await this.client.issueLabel(id);\n return {\n id: label.id,\n name: label.name,\n color: label.color,\n ...(label.description != null ? { description: label.description } : {}),\n ...(label.teamId != null ? { teamId: label.teamId } : {}),\n };\n } catch (e) {\n throw new LinearException(`Failed to fetch label: ${id}`, \"LABEL_FETCH_ERROR\", { id, cause: String(e) });\n }\n }\n\n public async getLabels(teamId?: string): Promise<LinearLabelType[]> {\n const resolvedTeamId = teamId ?? this.defaultTeamId;\n try {\n const labels = await this.client.issueLabels(\n resolvedTeamId ? { filter: { team: { id: { eq: resolvedTeamId } } } } : {},\n );\n return labels.nodes.map((label) => ({\n id: label.id,\n name: label.name,\n color: label.color,\n ...(label.description != null ? { description: label.description } : {}),\n ...(label.teamId != null ? { teamId: label.teamId } : {}),\n }));\n } catch (e) {\n throw new LinearException(\"Failed to fetch labels\", \"LABELS_FETCH_ERROR\", {\n teamId: resolvedTeamId,\n cause: String(e),\n });\n }\n }\n\n public async createLabel(input: LinearLabelType): Promise<LinearLabelType> {\n const resolvedTeamId = input.teamId ?? this.defaultTeamId;\n try {\n if (!input.name) {\n throw new LinearException(\"name is required\", \"LABEL_CREATE_ERROR\", {});\n }\n const payload = await this.client.createIssueLabel({\n name: input.name,\n ...(input.color != null ? { color: input.color } : {}),\n ...(input.description != null ? { description: input.description } : {}),\n ...(resolvedTeamId != null ? { teamId: resolvedTeamId } : {}),\n });\n const label = await payload.issueLabel;\n if (!label) {\n throw new LinearException(\"Label creation returned no data\", \"LABEL_CREATE_ERROR\", {\n input: JSON.stringify(input),\n });\n }\n return {\n id: label.id,\n name: label.name,\n color: label.color,\n ...(label.description != null ? { description: label.description } : {}),\n ...(label.teamId != null ? { teamId: label.teamId } : {}),\n };\n } catch (e) {\n if (e instanceof LinearException) throw e;\n throw new LinearException(\"Failed to create label\", \"LABEL_CREATE_ERROR\", {\n input: JSON.stringify(input),\n cause: String(e),\n });\n }\n }\n\n public async updateLabel(id: string, input: LinearLabelType): Promise<LinearLabelType> {\n try {\n const payload = await this.client.updateIssueLabel(id, {\n ...(input.name != null ? { name: input.name } : {}),\n ...(input.color != null ? { color: input.color } : {}),\n ...(input.description != null ? { description: input.description } : {}),\n });\n const label = await payload.issueLabel;\n if (!label) {\n throw new LinearException(\"Label update returned no data\", \"LABEL_UPDATE_ERROR\", { id });\n }\n return {\n id: label.id,\n name: label.name,\n color: label.color,\n ...(label.description != null ? { description: label.description } : {}),\n ...(label.teamId != null ? { teamId: label.teamId } : {}),\n };\n } catch (e) {\n if (e instanceof LinearException) throw e;\n throw new LinearException(`Failed to update label: ${id}`, \"LABEL_UPDATE_ERROR\", { id, cause: String(e) });\n }\n }\n\n public async deleteLabel(id: string): Promise<boolean> {\n try {\n const payload = await this.client.deleteIssueLabel(id);\n return payload.success;\n } catch (e) {\n throw new LinearException(`Failed to delete label: ${id}`, \"LABEL_DELETE_ERROR\", { id, cause: String(e) });\n }\n }\n\n public getPriorities(): LinearPriorityType[] {\n return PRIORITIES;\n }\n\n public async getPriority(issueId: string): Promise<LinearPriorityType> {\n try {\n const issue = await this.client.issue(issueId);\n const priority = PRIORITIES.find((p) => p.value === issue.priority);\n if (!priority) {\n throw new LinearException(`Unknown priority value: ${issue.priority}`, \"PRIORITY_FETCH_ERROR\", { issueId });\n }\n return priority;\n } catch (e) {\n if (e instanceof LinearException) throw e;\n throw new LinearException(`Failed to fetch priority for issue: ${issueId}`, \"PRIORITY_FETCH_ERROR\", {\n issueId,\n cause: String(e),\n });\n }\n }\n\n public async setPriority(issueId: string, priority: number): Promise<Issue> {\n try {\n if (!PRIORITIES.some((p) => p.value === priority)) {\n throw new LinearException(`Invalid priority value: ${priority}`, \"PRIORITY_SET_ERROR\", { issueId, priority });\n }\n const payload = await this.client.updateIssue(issueId, { priority });\n const issue = await payload.issue;\n if (!issue) {\n throw new LinearException(\"Priority update returned no data\", \"PRIORITY_SET_ERROR\", { issueId });\n }\n return mapIssue(issue);\n } catch (e) {\n if (e instanceof LinearException) throw e;\n throw new LinearException(`Failed to set priority for issue: ${issueId}`, \"PRIORITY_SET_ERROR\", {\n issueId,\n priority,\n cause: String(e),\n });\n }\n }\n\n public async clearPriority(issueId: string): Promise<Issue> {\n return this.setPriority(issueId, 0);\n }\n\n public async getState(id: string): Promise<LinearStateType> {\n try {\n const state = await this.client.workflowState(id);\n return {\n id: state.id,\n name: state.name,\n color: state.color,\n type: state.type,\n ...(state.description != null ? { description: state.description } : {}),\n position: state.position,\n ...(state.teamId != null ? { teamId: state.teamId } : {}),\n };\n } catch (e) {\n throw new LinearException(`Failed to fetch state: ${id}`, \"STATE_FETCH_ERROR\", { id, cause: String(e) });\n }\n }\n\n public async getStates(teamId?: string): Promise<LinearStateType[]> {\n const resolvedTeamId = teamId ?? this.defaultTeamId;\n try {\n const states = await this.client.workflowStates(\n resolvedTeamId ? { filter: { team: { id: { eq: resolvedTeamId } } } } : {},\n );\n return states.nodes.map((state) => ({\n id: state.id,\n name: state.name,\n color: state.color,\n type: state.type,\n ...(state.description != null ? { description: state.description } : {}),\n position: state.position,\n ...(state.teamId != null ? { teamId: state.teamId } : {}),\n }));\n } catch (e) {\n throw new LinearException(\"Failed to fetch states\", \"STATES_FETCH_ERROR\", {\n teamId: resolvedTeamId,\n cause: String(e),\n });\n }\n }\n\n public async createState(input: LinearStateType): Promise<LinearStateType> {\n const resolvedTeamId = input.teamId ?? this.defaultTeamId;\n try {\n if (!input.name || !input.color || !input.type || !resolvedTeamId) {\n throw new LinearException(\"name, color, type and teamId are required\", \"STATE_CREATE_ERROR\", {});\n }\n const payload = await this.client.createWorkflowState({\n name: input.name,\n color: input.color,\n type: input.type,\n teamId: resolvedTeamId,\n ...(input.description != null ? { description: input.description } : {}),\n ...(input.position != null ? { position: input.position } : {}),\n });\n const state = await payload.workflowState;\n if (!state) {\n throw new LinearException(\"State creation returned no data\", \"STATE_CREATE_ERROR\", {\n input: JSON.stringify(input),\n });\n }\n return {\n id: state.id,\n name: state.name,\n color: state.color,\n type: state.type,\n ...(state.description != null ? { description: state.description } : {}),\n position: state.position,\n ...(state.teamId != null ? { teamId: state.teamId } : {}),\n };\n } catch (e) {\n if (e instanceof LinearException) throw e;\n throw new LinearException(\"Failed to create state\", \"STATE_CREATE_ERROR\", {\n input: JSON.stringify(input),\n cause: String(e),\n });\n }\n }\n\n public async updateState(id: string, input: LinearStateType): Promise<LinearStateType> {\n try {\n const payload = await this.client.updateWorkflowState(id, {\n ...(input.name != null ? { name: input.name } : {}),\n ...(input.color != null ? { color: input.color } : {}),\n ...(input.description != null ? { description: input.description } : {}),\n ...(input.position != null ? { position: input.position } : {}),\n });\n const state = await payload.workflowState;\n if (!state) {\n throw new LinearException(\"State update returned no data\", \"STATE_UPDATE_ERROR\", { id });\n }\n return {\n id: state.id,\n name: state.name,\n color: state.color,\n type: state.type,\n ...(state.description != null ? { description: state.description } : {}),\n position: state.position,\n ...(state.teamId != null ? { teamId: state.teamId } : {}),\n };\n } catch (e) {\n if (e instanceof LinearException) throw e;\n throw new LinearException(`Failed to update state: ${id}`, \"STATE_UPDATE_ERROR\", { id, cause: String(e) });\n }\n }\n\n public async deleteState(id: string): Promise<boolean> {\n try {\n const payload = await this.client.archiveWorkflowState(id);\n return payload.success;\n } catch (e) {\n throw new LinearException(`Failed to delete state: ${id}`, \"STATE_DELETE_ERROR\", { id, cause: String(e) });\n }\n }\n\n public async checkLabelById(id: string): Promise<boolean> {\n try {\n await this.client.issueLabel(id);\n return true;\n } catch {\n return false;\n }\n }\n\n public async checkLabelByName(name: string, teamId?: string): Promise<boolean> {\n const resolvedTeamId = teamId ?? this.defaultTeamId;\n try {\n const labels = await this.client.issueLabels(\n resolvedTeamId ? { filter: { team: { id: { eq: resolvedTeamId } } } } : {},\n );\n return labels.nodes.some((l) => l.name === name);\n } catch (e) {\n throw new LinearException(\"Failed to check label by name\", \"LABEL_CHECK_ERROR\", {\n name,\n teamId: resolvedTeamId,\n cause: String(e),\n });\n }\n }\n\n public checkPriorityById(value: number): boolean {\n return PRIORITIES.some((p) => p.value === value);\n }\n\n public checkPriorityByName(name: string): boolean {\n return PRIORITIES.some((p) => p.label.toLowerCase() === name.toLowerCase());\n }\n\n public async checkStateById(id: string): Promise<boolean> {\n try {\n await this.client.workflowState(id);\n return true;\n } catch {\n return false;\n }\n }\n\n public async checkStateByName(name: string, teamId?: string): Promise<boolean> {\n const resolvedTeamId = teamId ?? this.defaultTeamId;\n try {\n const states = await this.client.workflowStates(\n resolvedTeamId ? { filter: { team: { id: { eq: resolvedTeamId } } } } : {},\n );\n return states.nodes.some((s) => s.name === name);\n } catch (e) {\n throw new LinearException(\"Failed to check state by name\", \"STATE_CHECK_ERROR\", {\n name,\n teamId: resolvedTeamId,\n cause: String(e),\n });\n }\n }\n\n public async createComment(issueId: string, body: string): Promise<LinearCommentType> {\n try {\n const payload = await this.client.createComment({ issueId, body });\n const comment = await payload.comment;\n if (!comment) {\n throw new LinearException(\"Comment creation returned no data\", \"COMMENT_CREATE_ERROR\", { issueId });\n }\n const user = await comment.user;\n return {\n id: comment.id,\n body: comment.body,\n createdAt: comment.createdAt,\n ...(user ? { user: { id: user.id, name: user.name, email: user.email, displayName: user.displayName } } : {}),\n };\n } catch (e) {\n if (e instanceof LinearException) throw e;\n throw new LinearException(`Failed to create comment for issue: ${issueId}`, \"COMMENT_CREATE_ERROR\", {\n issueId,\n cause: String(e),\n });\n }\n }\n}\n"
8
+ ],
9
+ "mappings": ";;;;;;;;;;;;;;;;;;AAUO,MAAM,MAAM;AAAA,EACV;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA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BAAgB,qCAAqC,wBAAwB,EAAE,QAAQ,CAAC;AAAA,MACpG;AAAA,MACA,MAAM,OAAO,MAAM,QAAQ;AAAA,MAC3B,OAAO;AAAA,QACL,IAAI,QAAQ;AAAA,QACZ,MAAM,QAAQ;AAAA,QACd,WAAW,QAAQ;AAAA,WACf,OAAO,EAAE,MAAM,EAAE,IAAI,KAAK,IAAI,MAAM,KAAK,MAAM,OAAO,KAAK,OAAO,aAAa,KAAK,YAAY,EAAE,IAAI,CAAC;AAAA,MAC7G;AAAA,MACA,OAAO,GAAG;AAAA,MACV,IAAI,aAAa;AAAA,QAAiB,MAAM;AAAA,MACxC,MAAM,IAAI,gBAAgB,uCAAuC,WAAW,wBAAwB;AAAA,QAClG;AAAA,QACA,OAAO,OAAO,CAAC;AAAA,MACjB,CAAC;AAAA;AAAA;AAGP;AArfa,gBAAN;AAAA,EADN,WAAW;AAAA,EAMP,kCAAO,MAAM;AAAA,EALX;AAAA;AAAA;AAAA;AAAA,GAAM;",
10
+ "debugId": "41C077871B0550FF64756E2164756E21",
11
+ "names": []
12
+ }
package/package.json ADDED
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "@talosjs/linear",
3
+ "description": "Linear project management integration — create, update, and query issues, teams, and projects via the Linear API with dependency injection support",
4
+ "version": "1.0.0",
5
+ "type": "module",
6
+ "files": [
7
+ "dist",
8
+ "LICENSE",
9
+ "README.md",
10
+ "package.json"
11
+ ],
12
+ "module": "./dist/index.js",
13
+ "types": "./dist/index.d.ts",
14
+ "exports": {
15
+ ".": {
16
+ "import": {
17
+ "types": "./dist/index.d.ts",
18
+ "default": "./dist/index.js"
19
+ }
20
+ },
21
+ "./package.json": "./package.json"
22
+ },
23
+ "license": "MIT",
24
+ "scripts": {
25
+ "test": "bun test tests",
26
+ "build": "bunup",
27
+ "lint": "tsgo --noEmit && bunx biome lint",
28
+ "npm:publish": "bun publish --tolerate-republish --force --production --access public"
29
+ },
30
+ "dependencies": {
31
+ "@linear/sdk": "^84.0.0",
32
+ "@talosjs/app-env": "^1.12.0",
33
+ "@talosjs/container": "^1.5.1",
34
+ "@talosjs/exception": "^1.2.10",
35
+ "@talosjs/http-status": "^1.1.11"
36
+ },
37
+ "devDependencies": {},
38
+ "keywords": [
39
+ "bun",
40
+ "issue-tracking",
41
+ "linear",
42
+ "talos",
43
+ "project-management",
44
+ "typescript"
45
+ ]
46
+ }