@vornrun/connector-linear 0.1.0 → 0.1.2
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/CHANGELOG.md +31 -0
- package/README.md +63 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +55 -4
- package/package.json +8 -6
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `@vornrun/connector-linear`.
|
|
4
|
+
|
|
5
|
+
## 0.1.2
|
|
6
|
+
|
|
7
|
+
Read the version from the bundle instead of a package.json the packed connector does not carry.
|
|
8
|
+
|
|
9
|
+
## 0.1.1
|
|
10
|
+
|
|
11
|
+
Declares how it signs in: it asks for an API key, so the app can say so before
|
|
12
|
+
anyone installs it. Ships a conformance receipt.
|
|
13
|
+
|
|
14
|
+
## 0.1.0
|
|
15
|
+
|
|
16
|
+
First release.
|
|
17
|
+
|
|
18
|
+
Trigger a workflow from Linear issues, and let a workflow step write back.
|
|
19
|
+
|
|
20
|
+
- **Trigger:** `issueCreated`.
|
|
21
|
+
- **Actions:** `commentOnIssue`, `createIssue`, `closeIssue`.
|
|
22
|
+
- **Signing in:** a Linear personal API key, created at
|
|
23
|
+
linear.app/settings/api.
|
|
24
|
+
|
|
25
|
+
Status is mapped from Linear's state _type_ rather than its name, so a team can
|
|
26
|
+
rename "In Progress" to whatever it likes without breaking the mapping.
|
|
27
|
+
|
|
28
|
+
Built against Linear's GraphQL API directly rather than on their SDK. The SDK is
|
|
29
|
+
a generated client over the whole schema — megabytes of types for the four
|
|
30
|
+
queries and three mutations this needs — and `npx` pays that download on every
|
|
31
|
+
launch.
|
package/README.md
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# @vornrun/connector-linear
|
|
2
|
+
|
|
3
|
+
Trigger Vorn workflows from Linear issues, and comment on, create or close them
|
|
4
|
+
from a workflow step.
|
|
5
|
+
|
|
6
|
+
## Signing in
|
|
7
|
+
|
|
8
|
+
Create a personal API key at [linear.app/settings/api](https://linear.app/settings/api)
|
|
9
|
+
and paste it into the connection. It is stored encrypted by Vorn, in the OS
|
|
10
|
+
keychain, and never printed.
|
|
11
|
+
|
|
12
|
+
A personal key acts as you and needs nobody's approval to create. There is no
|
|
13
|
+
Linear CLI to borrow a login from, which is why this connector asks for a secret
|
|
14
|
+
where `ado`, `kusto` and `github` do not.
|
|
15
|
+
|
|
16
|
+
## Settings
|
|
17
|
+
|
|
18
|
+
| Field | Required | What it does |
|
|
19
|
+
| --- | --- | --- |
|
|
20
|
+
| `apiKey` | yes | Personal API key from linear.app/settings/api |
|
|
21
|
+
| `teamKey` | no | Upper-case key such as `ENG`. Blank for every team you can see. |
|
|
22
|
+
| `stateType` | no | One of `backlog`, `unstarted`, `started`, `completed`, `canceled`. Blank for all. |
|
|
23
|
+
| `limit` | no | Upper bound on issues read in one poll |
|
|
24
|
+
|
|
25
|
+
## Trigger
|
|
26
|
+
|
|
27
|
+
**An issue is created or changed.** Fires for each issue the query returns that
|
|
28
|
+
Vorn has not already seen at that timestamp.
|
|
29
|
+
|
|
30
|
+
Status is mapped from Linear's state **type**, not its name, so a team can
|
|
31
|
+
rename "In Progress" to anything it likes and the mapping still holds:
|
|
32
|
+
|
|
33
|
+
| Linear state type | Task status |
|
|
34
|
+
| --- | --- |
|
|
35
|
+
| `backlog`, `unstarted` | `todo` |
|
|
36
|
+
| `started` | `in_progress` |
|
|
37
|
+
| `completed` | `done` |
|
|
38
|
+
| `canceled` | `cancelled` |
|
|
39
|
+
|
|
40
|
+
## Actions
|
|
41
|
+
|
|
42
|
+
| Action | What it does |
|
|
43
|
+
| --- | --- |
|
|
44
|
+
| `commentOnIssue` | Post a comment; takes an identifier such as `ENG-123` |
|
|
45
|
+
| `createIssue` | Open an issue; returns its identifier and url |
|
|
46
|
+
| `closeIssue` | Move an issue to the first completed state its team defines |
|
|
47
|
+
|
|
48
|
+
`closeIssue` is idempotent — closing a closed issue leaves it closed. The other
|
|
49
|
+
two are not: calling them twice writes twice.
|
|
50
|
+
|
|
51
|
+
## Built from
|
|
52
|
+
|
|
53
|
+
Linear's [GraphQL API](https://linear.app/developers/graphql), queried directly
|
|
54
|
+
rather than through their SDK.
|
|
55
|
+
|
|
56
|
+
The SDK is a generated client over the whole schema — megabytes of types for the
|
|
57
|
+
four queries and three mutations this needs — and because Vorn launches a
|
|
58
|
+
connector with `npx -y`, that download would be paid on every cold start rather
|
|
59
|
+
than once at install. The house rule is to prefer the vendor's SDK; this is the
|
|
60
|
+
documented exception, and the reason is in `src/client.ts`.
|
|
61
|
+
|
|
62
|
+
The API key is sent as a raw `Authorization` header with **no `Bearer` prefix**,
|
|
63
|
+
which is what Linear expects for personal keys.
|
package/dist/index.d.ts
CHANGED
|
@@ -23,4 +23,4 @@ declare function createLinearConnector(options?: LinearConnectorOptions): _vornr
|
|
|
23
23
|
|
|
24
24
|
declare const linearConnector: _vornrun_connector_sdk.Connector;
|
|
25
25
|
|
|
26
|
-
export { type LinearConnectorOptions, createLinearConnector, linearConnector };
|
|
26
|
+
export { type LinearConnectorOptions, linearConnector as connector, createLinearConnector, linearConnector as default, linearConnector };
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
// src/index.ts
|
|
4
|
-
import { createRequire } from "module";
|
|
5
|
-
|
|
6
3
|
// src/connector.ts
|
|
7
4
|
import { defineConnector } from "@vornrun/connector-sdk";
|
|
8
5
|
|
|
@@ -172,6 +169,7 @@ function createLinearConnector(options = {}) {
|
|
|
172
169
|
"M5.663 5.595c3.518-3.474 9.186-3.46 12.687.04 3.501 3.501 3.515 9.169.041 12.687z"
|
|
173
170
|
]
|
|
174
171
|
},
|
|
172
|
+
auth: { rung: "key", keys: ["apiKey"] },
|
|
175
173
|
config: [
|
|
176
174
|
{
|
|
177
175
|
key: "apiKey",
|
|
@@ -352,11 +350,64 @@ function serveIfEntryPoint(connector, moduleUrl, serve = serveConnector) {
|
|
|
352
350
|
return true;
|
|
353
351
|
}
|
|
354
352
|
|
|
353
|
+
// package.json
|
|
354
|
+
var package_default = {
|
|
355
|
+
name: "@vornrun/connector-linear",
|
|
356
|
+
version: "0.1.2",
|
|
357
|
+
description: "Trigger workflows from Linear issues.",
|
|
358
|
+
type: "module",
|
|
359
|
+
license: "MIT",
|
|
360
|
+
repository: {
|
|
361
|
+
type: "git",
|
|
362
|
+
url: "git+https://github.com/vorn-run/connectors.git",
|
|
363
|
+
directory: "packages/linear"
|
|
364
|
+
},
|
|
365
|
+
bin: {
|
|
366
|
+
"vorn-connector-linear": "dist/index.js"
|
|
367
|
+
},
|
|
368
|
+
main: "./dist/index.js",
|
|
369
|
+
files: [
|
|
370
|
+
"dist",
|
|
371
|
+
"README.md",
|
|
372
|
+
"CHANGELOG.md"
|
|
373
|
+
],
|
|
374
|
+
scripts: {
|
|
375
|
+
build: "tsup src/index.ts --format esm --target node22 --clean",
|
|
376
|
+
typecheck: "tsc --noEmit",
|
|
377
|
+
test: "vitest run"
|
|
378
|
+
},
|
|
379
|
+
dependencies: {
|
|
380
|
+
"@vornrun/connector-sdk": "^0.7.0-beta.10"
|
|
381
|
+
},
|
|
382
|
+
devDependencies: {
|
|
383
|
+
"@types/node": "^22.10.2",
|
|
384
|
+
"@vitest/coverage-v8": "^4.1.10",
|
|
385
|
+
tsup: "^8.5.1",
|
|
386
|
+
typescript: "^6.0.3",
|
|
387
|
+
vitest: "^4.1.10"
|
|
388
|
+
},
|
|
389
|
+
vorn: {
|
|
390
|
+
category: "Development",
|
|
391
|
+
keywords: [
|
|
392
|
+
"linear",
|
|
393
|
+
"issues",
|
|
394
|
+
"tickets",
|
|
395
|
+
"engineering",
|
|
396
|
+
"backlog"
|
|
397
|
+
],
|
|
398
|
+
auth: "Uses a Linear personal API key, created at linear.app/settings/api.",
|
|
399
|
+
packs: true
|
|
400
|
+
}
|
|
401
|
+
};
|
|
402
|
+
|
|
355
403
|
// src/index.ts
|
|
356
|
-
var { version } =
|
|
404
|
+
var { version } = package_default;
|
|
357
405
|
var linearConnector = createLinearConnector({ version });
|
|
406
|
+
var index_default = linearConnector;
|
|
358
407
|
serveIfEntryPoint(linearConnector, import.meta.url);
|
|
359
408
|
export {
|
|
409
|
+
linearConnector as connector,
|
|
360
410
|
createLinearConnector,
|
|
411
|
+
index_default as default,
|
|
361
412
|
linearConnector
|
|
362
413
|
};
|
package/package.json
CHANGED
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vornrun/connector-linear",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Trigger workflows from Linear issues.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
9
|
"url": "git+https://github.com/vorn-run/connectors.git",
|
|
10
|
-
"directory": "packages/
|
|
10
|
+
"directory": "packages/linear"
|
|
11
11
|
},
|
|
12
12
|
"bin": {
|
|
13
13
|
"vorn-connector-linear": "dist/index.js"
|
|
14
14
|
},
|
|
15
15
|
"main": "./dist/index.js",
|
|
16
16
|
"files": [
|
|
17
|
-
"dist"
|
|
17
|
+
"dist",
|
|
18
|
+
"README.md",
|
|
19
|
+
"CHANGELOG.md"
|
|
18
20
|
],
|
|
19
21
|
"scripts": {
|
|
20
22
|
"build": "tsup src/index.ts --format esm --target node22 --clean",
|
|
@@ -22,8 +24,7 @@
|
|
|
22
24
|
"test": "vitest run"
|
|
23
25
|
},
|
|
24
26
|
"dependencies": {
|
|
25
|
-
"@vornrun/connector-sdk": "^0.
|
|
26
|
-
"zod": "^4.4.3"
|
|
27
|
+
"@vornrun/connector-sdk": "^0.7.0-beta.10"
|
|
27
28
|
},
|
|
28
29
|
"devDependencies": {
|
|
29
30
|
"@types/node": "^22.10.2",
|
|
@@ -41,6 +42,7 @@
|
|
|
41
42
|
"engineering",
|
|
42
43
|
"backlog"
|
|
43
44
|
],
|
|
44
|
-
"auth": "Uses a Linear personal API key, created at linear.app/settings/api."
|
|
45
|
+
"auth": "Uses a Linear personal API key, created at linear.app/settings/api.",
|
|
46
|
+
"packs": true
|
|
45
47
|
}
|
|
46
48
|
}
|