@useairfoil/producer-linear 0.0.1 → 0.0.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/README.md +71 -0
- package/dist/index.d.mts +4027 -0
- package/dist/index.mjs +3 -0
- package/dist/main.d.mts +1 -0
- package/dist/main.mjs +1303 -0
- package/dist/main.mjs.map +1 -0
- package/dist/manifest.d.mts +114 -0
- package/dist/manifest.mjs +161 -0
- package/dist/manifest.mjs.map +1 -0
- package/dist/rolldown-runtime-D7D4PA-g.mjs +13 -0
- package/dist/src-Ci3_ltan.mjs +1691 -0
- package/dist/src-Ci3_ltan.mjs.map +1 -0
- package/package.json +45 -7
- package/src/client/client.ts +200 -0
- package/src/connector.ts +151 -0
- package/src/create-table.ts +5 -0
- package/src/demo/index.ts +137 -0
- package/src/demo/initiatives.ts +116 -0
- package/src/demo/issues.ts +320 -0
- package/src/demo/projects.ts +215 -0
- package/src/demo/setup.ts +151 -0
- package/src/demo/shared.ts +122 -0
- package/src/demo/teams.ts +173 -0
- package/src/index.ts +83 -0
- package/src/main.ts +22 -0
- package/src/manifest.ts +58 -0
- package/src/resources/comments.ts +32 -0
- package/src/resources/customers.ts +105 -0
- package/src/resources/documents.ts +31 -0
- package/src/resources/initiatives.ts +136 -0
- package/src/resources/issue-history.ts +119 -0
- package/src/resources/issues.ts +131 -0
- package/src/resources/pages.ts +264 -0
- package/src/resources/projects.ts +161 -0
- package/src/resources/releases.ts +114 -0
- package/src/resources/teams.ts +140 -0
- package/src/sandbox.ts +35 -0
- package/src/schemas/comments.ts +32 -0
- package/src/schemas/customers.ts +80 -0
- package/src/schemas/documents.ts +32 -0
- package/src/schemas/initiatives.ts +119 -0
- package/src/schemas/issues.ts +180 -0
- package/src/schemas/projects.ts +154 -0
- package/src/schemas/releases.ts +119 -0
- package/src/schemas/shared.ts +66 -0
- package/src/schemas/teams.ts +144 -0
- package/src/start.ts +47 -0
- package/src/tables.ts +83 -0
- package/src/webhook/route.ts +50 -0
- package/src/webhook/signature.ts +28 -0
package/README.md
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Linear producer
|
|
2
|
+
|
|
3
|
+
Syncs issues and their history, comments, projects, initiatives, cycles,
|
|
4
|
+
documents, customers, releases, release notes, and the lists that name their IDs
|
|
5
|
+
from one Linear workspace. It backfills each resource, polls for changes, and
|
|
6
|
+
uses a webhook for archives, deletes, and restores.
|
|
7
|
+
|
|
8
|
+
## Config
|
|
9
|
+
|
|
10
|
+
| Variable | Required | Default |
|
|
11
|
+
| ----------------------- | -------- | ------- |
|
|
12
|
+
| `LINEAR_API_KEY` | yes | none |
|
|
13
|
+
| `LINEAR_WEBHOOK_SECRET` | yes | none |
|
|
14
|
+
|
|
15
|
+
## Setup
|
|
16
|
+
|
|
17
|
+
1. Create a personal API key in Linear under Settings > Account > Security &
|
|
18
|
+
access. Choose "Only select permissions" and tick **Read**. Use a
|
|
19
|
+
dedicated user, because the key sees what that user sees, including their
|
|
20
|
+
private teams.
|
|
21
|
+
2. As a workspace admin, add a webhook in Settings > Administration > API. Point
|
|
22
|
+
it at `https://<host>/webhooks/linear`, pick all public teams, and tick
|
|
23
|
+
every data change type. Use its signing secret as `LINEAR_WEBHOOK_SECRET`.
|
|
24
|
+
For each private team the key can read, add a webhook for that team too.
|
|
25
|
+
Use the same URL and set the same `secret` through the GraphQL API.
|
|
26
|
+
|
|
27
|
+
## Data
|
|
28
|
+
|
|
29
|
+
- Archived and trashed items stay as rows, with `archived_at` and `trashed`.
|
|
30
|
+
Deleted items get `_deleted` on the tables Linear has webhooks for: issues,
|
|
31
|
+
comments, attachments, issue labels, users, cycles, projects, project
|
|
32
|
+
updates, project labels, initiatives, initiative updates, documents,
|
|
33
|
+
customers, and customer needs.
|
|
34
|
+
- Deletes on the other tables aren't seen, such as a removed relation or team
|
|
35
|
+
member.
|
|
36
|
+
- `issue_history` has one row per change, with the before and after values.
|
|
37
|
+
- `projects.team_ids` reads up to 50 teams, and `member_ids` up to 100
|
|
38
|
+
members.
|
|
39
|
+
- Customers need customer requests turned on. Releases need the Business plan.
|
|
40
|
+
- Tables hold names, emails, and issue and comment text. Treat them as
|
|
41
|
+
confidential.
|
|
42
|
+
|
|
43
|
+
## Limits
|
|
44
|
+
|
|
45
|
+
- An API key gets 2,500 requests and 3,000,000 complexity points an hour. A
|
|
46
|
+
used-up limit waits and tries again.
|
|
47
|
+
- Large resources are polled every 5 minutes, and the lists that name IDs every
|
|
48
|
+
hour.
|
|
49
|
+
- Archive, trash, and restore don't change `updatedAt`, so only the webhook
|
|
50
|
+
sees them. Linear retries a webhook 3 times over about 7 hours.
|
|
51
|
+
|
|
52
|
+
## Demo data
|
|
53
|
+
|
|
54
|
+
`pnpm demo --size 128MiB` writes made-up Linear data without Linear credentials.
|
|
55
|
+
See the Connector Kit README for the flags and the variables it needs.
|
|
56
|
+
|
|
57
|
+
Each issue has its history, comments, and sometimes a relation, a GitHub pull
|
|
58
|
+
request, a customer request, and a release. The workspace is written once and
|
|
59
|
+
doesn't grow with the size: 4 teams with their workflow states, 16 users,
|
|
60
|
+
two-week cycles, 8 projects with milestones, updates, and specs, 3 initiatives,
|
|
61
|
+
12 customers, and a year of monthly releases.
|
|
62
|
+
|
|
63
|
+
## Local development
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
cd connectors/producer-linear
|
|
67
|
+
pnpm sandbox
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
`pnpm start` runs the hosted connector. It needs the Wings and PostgreSQL
|
|
71
|
+
variables from the [Connector Kit README](../../packages/connector-kit/README.md).
|