leash-integration-linear 0.1.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.
- checksums.yaml +7 -0
- data/lib/leash/integration/linear.rb +374 -0
- metadata +57 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 6a15a91ba25480d9a7b0931216addde0a7669709f245e2fe7c5b678fd3fa3093
|
|
4
|
+
data.tar.gz: f08912c35c01844be7f997f9274f82cc5de79d044c7678a6f1f0c100c25ca508
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 547eb65be2bd118bd97c2e9e680c994616c92ee19e1b32c064d23dd599a5b5ab4b57be4fcb848ba085537038ac3c2e8421d2094ce4051913fddcdb67a3974e97
|
|
7
|
+
data.tar.gz: fa7387405659e589dd2fb9fc806b7f2114eeab9bf4d6be85c4aa03f22a49f9c676f9f4ee4a1ba918a464dc1a047bbd710b0d28973de6af0a59abe0b450598461
|
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Auto-generated by leash-codegen — do not edit manually
|
|
4
|
+
|
|
5
|
+
module Leash
|
|
6
|
+
module Integration
|
|
7
|
+
class LinearClient
|
|
8
|
+
# Create a new Linear integration client.
|
|
9
|
+
#
|
|
10
|
+
# @param leash [Leash::Client] the Leash SDK client
|
|
11
|
+
def initialize(leash)
|
|
12
|
+
@leash = leash
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# Handle OAuth callback
|
|
16
|
+
#
|
|
17
|
+
# @param code [String] OAuth authorization code
|
|
18
|
+
# @return [Object]
|
|
19
|
+
def linear_auth_callback(code)
|
|
20
|
+
params = {
|
|
21
|
+
'code' => code
|
|
22
|
+
}.compact
|
|
23
|
+
@leash.call('linear', 'linear_auth_callback', params)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# Create a new issue in Linear
|
|
27
|
+
#
|
|
28
|
+
# @param title [String] Issue title
|
|
29
|
+
# @param description [String] Issue description
|
|
30
|
+
# @param teamid [String] Team ID (UUID)
|
|
31
|
+
# @param parentid [String, nil] Parent issue ID (UUID, not issue identifier)
|
|
32
|
+
# @param labelids [Array, nil] Label UUIDs to apply, eg ['a1eb5aed-7425-4ea5-98ec-dfab52381e0e']
|
|
33
|
+
# @param assigneeid [String, nil] Assignee user ID (UUID)
|
|
34
|
+
# @param priority [Float, nil] Issue priority (0-4)
|
|
35
|
+
# @param createasuser [String, nil] Name to display for the created issue
|
|
36
|
+
# @param displayiconurl [String, nil] URL of the avatar to display
|
|
37
|
+
# @return [Object]
|
|
38
|
+
def linear_create_issue(title, description, teamid, parentid: nil, labelids: nil, assigneeid: nil, priority: nil, createasuser: nil, displayiconurl: nil)
|
|
39
|
+
params = {
|
|
40
|
+
'title' => title,
|
|
41
|
+
'description' => description,
|
|
42
|
+
'teamId' => teamid,
|
|
43
|
+
'parentId' => parentid,
|
|
44
|
+
'labelIds' => labelids,
|
|
45
|
+
'assigneeId' => assigneeid,
|
|
46
|
+
'priority' => priority,
|
|
47
|
+
'createAsUser' => createasuser,
|
|
48
|
+
'displayIconUrl' => displayiconurl
|
|
49
|
+
}.compact
|
|
50
|
+
@leash.call('linear', 'linear_create_issue', params)
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Create a new project with associated issues. Note: Project requires teamIds (array) not teamId (single value).
|
|
54
|
+
#
|
|
55
|
+
# @param project [Hash]
|
|
56
|
+
# @param issues [Array] List of issues to create with this project
|
|
57
|
+
# @return [Object]
|
|
58
|
+
def linear_create_project_with_issues(project, issues)
|
|
59
|
+
params = {
|
|
60
|
+
'project' => project,
|
|
61
|
+
'issues' => issues
|
|
62
|
+
}.compact
|
|
63
|
+
@leash.call('linear', 'linear_create_project_with_issues', params)
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Update multiple issues at once
|
|
67
|
+
#
|
|
68
|
+
# @param issueids [Array] List of issue UUIDs to update (not issue identifiers like 'ENG-123')
|
|
69
|
+
# @param update [Hash]
|
|
70
|
+
# @return [Object]
|
|
71
|
+
def linear_bulk_update_issues(issueids, update)
|
|
72
|
+
params = {
|
|
73
|
+
'issueIds' => issueids,
|
|
74
|
+
'update' => update
|
|
75
|
+
}.compact
|
|
76
|
+
@leash.call('linear', 'linear_bulk_update_issues', params)
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# Edit an existing issue, updating any of its fields. Note: When setting projectMilestoneId, you must also set projectId.
|
|
80
|
+
#
|
|
81
|
+
# @param issueid [String] Required: The UUID of the issue to update
|
|
82
|
+
# @param title [String, nil] The issue title
|
|
83
|
+
# @param description [String, nil] The issue description in markdown format
|
|
84
|
+
# @param stateid [String, nil] UUID of the target state
|
|
85
|
+
# @param priority [Float, nil] Issue priority (0=No priority, 1=Urgent, 2=High, 3=Normal, 4=Low)
|
|
86
|
+
# @param assigneeid [String, nil] UUID of the user to assign the issue to
|
|
87
|
+
# @param labelids [Array, nil] Array of label UUIDs (replaces existing labels)
|
|
88
|
+
# @param projectid [String, nil] UUID of the project to associate with the issue
|
|
89
|
+
# @param projectmilestoneid [String, nil] UUID of the project milestone to associate with the issue. Note: Requires projectId to be set when using this field
|
|
90
|
+
# @param estimate [Float, nil] The estimated complexity points for the issue
|
|
91
|
+
# @param duedate [String, nil] The due date in YYYY-MM-DD format
|
|
92
|
+
# @param parentid [String, nil] UUID of the parent issue
|
|
93
|
+
# @param sortorder [Float, nil] Position of the issue relative to other issues
|
|
94
|
+
# @return [Object]
|
|
95
|
+
def linear_edit_issue(issueid, title: nil, description: nil, stateid: nil, priority: nil, assigneeid: nil, labelids: nil, projectid: nil, projectmilestoneid: nil, estimate: nil, duedate: nil, parentid: nil, sortorder: nil)
|
|
96
|
+
params = {
|
|
97
|
+
'issueId' => issueid,
|
|
98
|
+
'title' => title,
|
|
99
|
+
'description' => description,
|
|
100
|
+
'stateId' => stateid,
|
|
101
|
+
'priority' => priority,
|
|
102
|
+
'assigneeId' => assigneeid,
|
|
103
|
+
'labelIds' => labelids,
|
|
104
|
+
'projectId' => projectid,
|
|
105
|
+
'projectMilestoneId' => projectmilestoneid,
|
|
106
|
+
'estimate' => estimate,
|
|
107
|
+
'dueDate' => duedate,
|
|
108
|
+
'parentId' => parentid,
|
|
109
|
+
'sortOrder' => sortorder
|
|
110
|
+
}.compact
|
|
111
|
+
@leash.call('linear', 'linear_edit_issue', params)
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
# Search for issues with filtering and pagination
|
|
115
|
+
#
|
|
116
|
+
# @param query [String, nil] Search query string
|
|
117
|
+
# @param teamids [Array, nil] Filter by team IDs
|
|
118
|
+
# @param assigneeids [Array, nil] Filter by assignee IDs
|
|
119
|
+
# @param states [Array, nil] Filter by state names
|
|
120
|
+
# @param priority [Float, nil] Filter by priority (0-4)
|
|
121
|
+
# @param first [Float, nil] Number of issues to return (default: 50)
|
|
122
|
+
# @param after [String, nil] Cursor for pagination
|
|
123
|
+
# @param orderby [String, nil] Field to order by (default: updatedAt)
|
|
124
|
+
# @return [Object]
|
|
125
|
+
def linear_search_issues(query: nil, teamids: nil, assigneeids: nil, states: nil, priority: nil, first: nil, after: nil, orderby: nil)
|
|
126
|
+
params = {
|
|
127
|
+
'query' => query,
|
|
128
|
+
'teamIds' => teamids,
|
|
129
|
+
'assigneeIds' => assigneeids,
|
|
130
|
+
'states' => states,
|
|
131
|
+
'priority' => priority,
|
|
132
|
+
'first' => first,
|
|
133
|
+
'after' => after,
|
|
134
|
+
'orderBy' => orderby
|
|
135
|
+
}.compact
|
|
136
|
+
@leash.call('linear', 'linear_search_issues', params)
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
# Search for issues by their identifiers (e.g., ["ENG-78", "ENG-79"])
|
|
140
|
+
#
|
|
141
|
+
# @param identifiers [Array] Array of issue identifiers to search for
|
|
142
|
+
# @return [Object]
|
|
143
|
+
def linear_search_issues_by_identifier(identifiers)
|
|
144
|
+
params = {
|
|
145
|
+
'identifiers' => identifiers
|
|
146
|
+
}.compact
|
|
147
|
+
@leash.call('linear', 'linear_search_issues_by_identifier', params)
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
# Get a single issue by identifier, including all comments
|
|
151
|
+
#
|
|
152
|
+
# @param identifier [String] Issue identifier (e.g., 'ENG-123')
|
|
153
|
+
# @return [Object]
|
|
154
|
+
def linear_get_issue(identifier)
|
|
155
|
+
params = {
|
|
156
|
+
'identifier' => identifier
|
|
157
|
+
}.compact
|
|
158
|
+
@leash.call('linear', 'linear_get_issue', params)
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
# Get all teams with their states and labels
|
|
162
|
+
#
|
|
163
|
+
# @return [Object]
|
|
164
|
+
def linear_get_teams
|
|
165
|
+
params = {}
|
|
166
|
+
@leash.call('linear', 'linear_get_teams', params)
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
# Get current user information
|
|
170
|
+
#
|
|
171
|
+
# @return [Object]
|
|
172
|
+
def linear_get_user
|
|
173
|
+
params = {}
|
|
174
|
+
@leash.call('linear', 'linear_get_user', params)
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
# Delete an issue
|
|
178
|
+
#
|
|
179
|
+
# @param id [String] Issue UUID (not issue identifier like 'ENG-123')
|
|
180
|
+
# @return [Object]
|
|
181
|
+
def linear_delete_issue(id)
|
|
182
|
+
params = {
|
|
183
|
+
'id' => id
|
|
184
|
+
}.compact
|
|
185
|
+
@leash.call('linear', 'linear_delete_issue', params)
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
# Get project information
|
|
189
|
+
#
|
|
190
|
+
# @param id [String] Project identifier
|
|
191
|
+
# @return [Object]
|
|
192
|
+
def linear_get_project(id)
|
|
193
|
+
params = {
|
|
194
|
+
'id' => id
|
|
195
|
+
}.compact
|
|
196
|
+
@leash.call('linear', 'linear_get_project', params)
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
# List all projects or filter them by criteria
|
|
200
|
+
#
|
|
201
|
+
# @param filter [Hash, nil] Optional filter criteria for projects
|
|
202
|
+
# @return [Object]
|
|
203
|
+
def linear_list_projects(filter: nil)
|
|
204
|
+
params = {
|
|
205
|
+
'filter' => filter
|
|
206
|
+
}.compact
|
|
207
|
+
@leash.call('linear', 'linear_list_projects', params)
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
# Create multiple issues at once
|
|
211
|
+
#
|
|
212
|
+
# @param issues [Array] List of issues to create
|
|
213
|
+
# @return [Object]
|
|
214
|
+
def linear_create_issues(issues)
|
|
215
|
+
params = {
|
|
216
|
+
'issues' => issues
|
|
217
|
+
}.compact
|
|
218
|
+
@leash.call('linear', 'linear_create_issues', params)
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
# Creates a new comment on an issue
|
|
222
|
+
#
|
|
223
|
+
# @param body [String] Comment text content
|
|
224
|
+
# @param issueid [String] ID of the issue to comment on
|
|
225
|
+
# @return [Object]
|
|
226
|
+
def linear_create_comment(body, issueid)
|
|
227
|
+
params = {
|
|
228
|
+
'body' => body,
|
|
229
|
+
'issueId' => issueid
|
|
230
|
+
}.compact
|
|
231
|
+
@leash.call('linear', 'linear_create_comment', params)
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
# Updates an existing comment
|
|
235
|
+
#
|
|
236
|
+
# @param id [String] Comment ID
|
|
237
|
+
# @param input [Hash]
|
|
238
|
+
# @return [Object]
|
|
239
|
+
def linear_update_comment(id, input)
|
|
240
|
+
params = {
|
|
241
|
+
'id' => id,
|
|
242
|
+
'input' => input
|
|
243
|
+
}.compact
|
|
244
|
+
@leash.call('linear', 'linear_update_comment', params)
|
|
245
|
+
end
|
|
246
|
+
|
|
247
|
+
# Deletes a comment
|
|
248
|
+
#
|
|
249
|
+
# @param id [String] Comment ID to delete
|
|
250
|
+
# @return [Object]
|
|
251
|
+
def linear_delete_comment(id)
|
|
252
|
+
params = {
|
|
253
|
+
'id' => id
|
|
254
|
+
}.compact
|
|
255
|
+
@leash.call('linear', 'linear_delete_comment', params)
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
# Resolves a comment
|
|
259
|
+
#
|
|
260
|
+
# @param id [String] Comment ID to resolve
|
|
261
|
+
# @param resolvingcommentid [String, nil] Optional ID of a resolving comment
|
|
262
|
+
# @return [Object]
|
|
263
|
+
def linear_resolve_comment(id, resolvingcommentid: nil)
|
|
264
|
+
params = {
|
|
265
|
+
'id' => id,
|
|
266
|
+
'resolvingCommentId' => resolvingcommentid
|
|
267
|
+
}.compact
|
|
268
|
+
@leash.call('linear', 'linear_resolve_comment', params)
|
|
269
|
+
end
|
|
270
|
+
|
|
271
|
+
# Unresolves a comment
|
|
272
|
+
#
|
|
273
|
+
# @param id [String] Comment ID to unresolve
|
|
274
|
+
# @return [Object]
|
|
275
|
+
def linear_unresolve_comment(id)
|
|
276
|
+
params = {
|
|
277
|
+
'id' => id
|
|
278
|
+
}.compact
|
|
279
|
+
@leash.call('linear', 'linear_unresolve_comment', params)
|
|
280
|
+
end
|
|
281
|
+
|
|
282
|
+
# Creates a new customer need from an attachment
|
|
283
|
+
#
|
|
284
|
+
# @param attachmentid [String] ID of the attachment
|
|
285
|
+
# @param title [String, nil] Title for the customer need
|
|
286
|
+
# @param description [String, nil] Description for the customer need
|
|
287
|
+
# @param teamid [String, nil] Team ID for the customer need
|
|
288
|
+
# @return [Object]
|
|
289
|
+
def linear_create_customer_need_from_attachment(attachmentid, title: nil, description: nil, teamid: nil)
|
|
290
|
+
params = {
|
|
291
|
+
'attachmentId' => attachmentid,
|
|
292
|
+
'title' => title,
|
|
293
|
+
'description' => description,
|
|
294
|
+
'teamId' => teamid
|
|
295
|
+
}.compact
|
|
296
|
+
@leash.call('linear', 'linear_create_customer_need_from_attachment', params)
|
|
297
|
+
end
|
|
298
|
+
|
|
299
|
+
# Get milestones for a project with filtering and pagination
|
|
300
|
+
#
|
|
301
|
+
# @param projectid [String] Project ID to get milestones for
|
|
302
|
+
# @param filter [Hash, nil] Optional filter criteria
|
|
303
|
+
# @param first [Float, nil] Number of items to return (used with after)
|
|
304
|
+
# @param after [String, nil] Cursor for forward pagination
|
|
305
|
+
# @param last [Float, nil] Number of items to return (used with before)
|
|
306
|
+
# @param before [String, nil] Cursor for backward pagination
|
|
307
|
+
# @param includearchived [Boolean, nil] Include archived milestones
|
|
308
|
+
# @param orderby [String, nil] Field to order by (createdAt or updatedAt)
|
|
309
|
+
# @return [Object]
|
|
310
|
+
def linear_get_project_milestones(projectid, filter: nil, first: nil, after: nil, last: nil, before: nil, includearchived: nil, orderby: nil)
|
|
311
|
+
params = {
|
|
312
|
+
'projectId' => projectid,
|
|
313
|
+
'filter' => filter,
|
|
314
|
+
'first' => first,
|
|
315
|
+
'after' => after,
|
|
316
|
+
'last' => last,
|
|
317
|
+
'before' => before,
|
|
318
|
+
'includeArchived' => includearchived,
|
|
319
|
+
'orderBy' => orderby
|
|
320
|
+
}.compact
|
|
321
|
+
@leash.call('linear', 'linear_get_project_milestones', params)
|
|
322
|
+
end
|
|
323
|
+
|
|
324
|
+
# Create a new project milestone
|
|
325
|
+
#
|
|
326
|
+
# @param projectid [String] Project ID to create milestone for
|
|
327
|
+
# @param name [String] Milestone name
|
|
328
|
+
# @param description [String, nil] Milestone description
|
|
329
|
+
# @param targetdate [String, nil] Target completion date (ISO format)
|
|
330
|
+
# @param sortorder [Float, nil] Sort order for the milestone
|
|
331
|
+
# @return [Object]
|
|
332
|
+
def linear_create_project_milestone(projectid, name, description: nil, targetdate: nil, sortorder: nil)
|
|
333
|
+
params = {
|
|
334
|
+
'projectId' => projectid,
|
|
335
|
+
'name' => name,
|
|
336
|
+
'description' => description,
|
|
337
|
+
'targetDate' => targetdate,
|
|
338
|
+
'sortOrder' => sortorder
|
|
339
|
+
}.compact
|
|
340
|
+
@leash.call('linear', 'linear_create_project_milestone', params)
|
|
341
|
+
end
|
|
342
|
+
|
|
343
|
+
# Update a project milestone
|
|
344
|
+
#
|
|
345
|
+
# @param id [String] Milestone ID to update
|
|
346
|
+
# @param name [String, nil] New milestone name
|
|
347
|
+
# @param description [String, nil] New milestone description
|
|
348
|
+
# @param targetdate [String, nil] New target completion date (ISO format)
|
|
349
|
+
# @param sortorder [Float, nil] New sort order
|
|
350
|
+
# @return [Object]
|
|
351
|
+
def linear_update_project_milestone(id, name: nil, description: nil, targetdate: nil, sortorder: nil)
|
|
352
|
+
params = {
|
|
353
|
+
'id' => id,
|
|
354
|
+
'name' => name,
|
|
355
|
+
'description' => description,
|
|
356
|
+
'targetDate' => targetdate,
|
|
357
|
+
'sortOrder' => sortorder
|
|
358
|
+
}.compact
|
|
359
|
+
@leash.call('linear', 'linear_update_project_milestone', params)
|
|
360
|
+
end
|
|
361
|
+
|
|
362
|
+
# Delete a project milestone
|
|
363
|
+
#
|
|
364
|
+
# @param id [String] Milestone ID to delete
|
|
365
|
+
# @return [Object]
|
|
366
|
+
def linear_delete_project_milestone(id)
|
|
367
|
+
params = {
|
|
368
|
+
'id' => id
|
|
369
|
+
}.compact
|
|
370
|
+
@leash.call('linear', 'linear_delete_project_milestone', params)
|
|
371
|
+
end
|
|
372
|
+
end
|
|
373
|
+
end
|
|
374
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: leash-integration-linear
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Leash
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2026-04-14 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: leash-sdk
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - ">="
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: 0.2.0
|
|
20
|
+
type: :runtime
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - ">="
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: 0.2.0
|
|
27
|
+
description: Auto-generated typed client for the Linear integration on Leash.
|
|
28
|
+
email:
|
|
29
|
+
executables: []
|
|
30
|
+
extensions: []
|
|
31
|
+
extra_rdoc_files: []
|
|
32
|
+
files:
|
|
33
|
+
- lib/leash/integration/linear.rb
|
|
34
|
+
homepage: https://github.com/leash-build/leash-codegen
|
|
35
|
+
licenses:
|
|
36
|
+
- Apache-2.0
|
|
37
|
+
metadata: {}
|
|
38
|
+
post_install_message:
|
|
39
|
+
rdoc_options: []
|
|
40
|
+
require_paths:
|
|
41
|
+
- lib
|
|
42
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
43
|
+
requirements:
|
|
44
|
+
- - ">="
|
|
45
|
+
- !ruby/object:Gem::Version
|
|
46
|
+
version: 2.7.0
|
|
47
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
48
|
+
requirements:
|
|
49
|
+
- - ">="
|
|
50
|
+
- !ruby/object:Gem::Version
|
|
51
|
+
version: '0'
|
|
52
|
+
requirements: []
|
|
53
|
+
rubygems_version: 3.0.3.1
|
|
54
|
+
signing_key:
|
|
55
|
+
specification_version: 4
|
|
56
|
+
summary: Typed Linear integration for Leash
|
|
57
|
+
test_files: []
|