Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
b55a68e
Unleash GPT magic
nicktrn Sep 13, 2023
664fd30
Clean up after GPT
nicktrn Sep 13, 2023
78a88c6
All the hooks
nicktrn Sep 15, 2023
bf68099
Provisional integration catalog entry
nicktrn Sep 15, 2023
cf32d5e
Sample webhook jobs
nicktrn Sep 15, 2023
52cd3f9
Attachments with alpha warnings
nicktrn Sep 15, 2023
ccf355c
Remove some verbose logs
nicktrn Sep 15, 2023
d8d20d9
Fix IP restrictions
nicktrn Sep 15, 2023
c5b69ce
Remove tunnel
nicktrn Sep 15, 2023
714adde
Revert "Remove tunnel"
nicktrn Sep 15, 2023
3777682
Resolve event name clashes
nicktrn Sep 15, 2023
a46f237
Remove circular dependency
nicktrn Sep 15, 2023
a064268
Use correct payload uuid
nicktrn Sep 15, 2023
ed3d659
Schema fixes
nicktrn Sep 15, 2023
b20eca7
Fix webhook event name
nicktrn Sep 15, 2023
7aea120
Start to Linearify catalog entry
nicktrn Sep 15, 2023
558cec7
Remove todo
nicktrn Sep 15, 2023
7a4d282
More catalog updates
nicktrn Sep 15, 2023
39625e9
Make OAuth work
nicktrn Sep 18, 2023
107bf4a
Rename webhook helper
nicktrn Sep 18, 2023
ec6723d
Schema juggling
nicktrn Sep 18, 2023
5cb272d
More discrimination
nicktrn Sep 18, 2023
5dc788f
Add Issue SLA event
nicktrn Sep 18, 2023
40cc3d9
Simplify triggers
nicktrn Sep 18, 2023
272598a
Handle rate limits
nicktrn Sep 18, 2023
01ba311
Fix Project schema
nicktrn Sep 18, 2023
08e0176
Payload examples
nicktrn Sep 18, 2023
5b85660
Improve event props
nicktrn Sep 18, 2023
8115771
Remove redundant source metadata
nicktrn Sep 18, 2023
b55309f
Merge branch 'main' into integrations/linear
nicktrn Sep 18, 2023
3a00e22
One type to rule them all
nicktrn Sep 18, 2023
39dfc4f
Recursive WithoutFunctions type
nicktrn Sep 18, 2023
cb1251d
Linear output serializer
nicktrn Sep 18, 2023
944697b
Some tasks
nicktrn Sep 18, 2023
b3fec82
Update catalog entry
nicktrn Sep 18, 2023
01546ef
Merge branch 'main' into integrations/linear
nicktrn Sep 19, 2023
4f34d1f
Dynamic usage sample
nicktrn Sep 19, 2023
1b37324
Bump version
nicktrn Sep 19, 2023
eb94750
Remove tunnel
nicktrn Sep 19, 2023
34c7baa
More tasks
nicktrn Sep 19, 2023
cb6e260
Add optional skipRetrying on runTask errors
nicktrn Sep 19, 2023
8ea1821
Fail fast on user errors
nicktrn Sep 19, 2023
52bd966
Entity getter tasks
nicktrn Sep 19, 2023
435b533
Another couple of tasks
nicktrn Sep 19, 2023
5c4aa2d
Token to apiKey
nicktrn Sep 20, 2023
bc4296b
Sort tasks
nicktrn Sep 20, 2023
1e95079
Add filtered issue SLA triggers
nicktrn Sep 20, 2023
1671f95
Add docs
nicktrn Sep 20, 2023
513f36c
Type fixes
nicktrn Sep 20, 2023
5543f67
Job catalog examples
nicktrn Sep 20, 2023
41710f1
Serialization helper docs
nicktrn Sep 20, 2023
be6e4cc
Add changeset
nicktrn Sep 20, 2023
b1e6930
Refactor webhooks
nicktrn Sep 21, 2023
b72a8da
Enhance properties
nicktrn Sep 21, 2023
87031aa
Pagination helper and docs
nicktrn Sep 21, 2023
cefd1b4
Clean up imports
nicktrn Sep 21, 2023
d564b89
Change misc catalog job
nicktrn Sep 21, 2023
0d55490
Merge branch 'main' into integrations/linear
matt-aitken Sep 21, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/strange-gorillas-kick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@trigger.dev/sdk": patch
"@trigger.dev/linear": patch
---

First release of `@trigger.dev/linear` integration. `io.runTask()` error handlers can now prevent further retries.
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ CLOUD_AIRTABLE_CLIENT_ID=
CLOUD_AIRTABLE_CLIENT_SECRET=
CLOUD_GITHUB_CLIENT_ID=
CLOUD_GITHUB_CLIENT_SECRET=
CLOUD_LINEAR_CLIENT_ID=
CLOUD_LINEAR_CLIENT_SECRET=
CLOUD_SLACK_APP_HOST=
CLOUD_SLACK_CLIENT_ID=
CLOUD_SLACK_CLIENT_SECRET=
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { airtable } from "./integrations/airtable";
import { github } from "./integrations/github";
import { linear } from "./integrations/linear";
import { openai } from "./integrations/openai";
import { plain } from "./integrations/plain";
import { resend } from "./integrations/resend";
Expand Down Expand Up @@ -33,6 +34,7 @@ export class IntegrationCatalog {
export const integrationCatalog = new IntegrationCatalog({
airtable,
github,
linear,
openai,
plain,
resend,
Expand Down
104 changes: 104 additions & 0 deletions apps/webapp/app/services/externalApis/integrations/linear.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
import type { HelpSample, Integration } from "../types";

function usageSample(hasApiKey: boolean): HelpSample {
return {
title: "Using the client",
code: `
import { Linear } from "@trigger.dev/linear";

const linear = new Linear({
id: "__SLUG__",${hasApiKey ? ",\n apiKey: process.env.LINEAR_API_KEY!" : ""}
});

client.defineJob({
id: "linear-react-to-new-issue",
name: "Linear - React To New Issue",
version: "0.1.0",
integrations: { linear },
trigger: linear.onIssueCreated(),
run: async (payload, io, ctx) => {
await io.linear.createComment("create-comment", {
issueId: payload.data.id,
body: "Thank's for opening this issue!"
});

await io.linear.createReaction("create-reaction", {
issueId: payload.data.id,
emoji: "+1"
});

return { payload, ctx };
},
});
`,
};
}

export const linear: Integration = {
identifier: "linear",
name: "Linear",
packageName: "@trigger.dev/linear@latest",
authenticationMethods: {
oauth2: {
name: "OAuth",
type: "oauth2",
client: {
id: {
envName: "CLOUD_LINEAR_CLIENT_ID",
},
secret: {
envName: "CLOUD_LINEAR_CLIENT_SECRET",
},
},
config: {
authorization: {
url: "https://linear.app/oauth/authorize",
scopeSeparator: ",",
},
token: {
url: "https://api.linear.app/oauth/token",
metadata: {},
},
refresh: {
url: "https://linear.app/oauth/authorize",
},
pkce: false,
},
scopes: [
{
name: "write",
description:
"Grants global write access to the user's account. Use a more targeted scope if you don't need full access.",
defaultChecked: true,
},

{
name: "issue:create",
description: "Grants access to create issues and attachments only.",
annotations: [{ label: "Issues" }],
},

{
name: "comments:create",
description: "Grants access to create new issue comments.",
annotations: [{ label: "Comments" }],
},

{
name: "admin",
description:
"Grants full access to admin-level endpoints. Don't use this unless you really need it.",
},
],
help: {
samples: [usageSample(false)],
},
},
apikey: {
type: "apikey",
help: {
samples: [usageSample(true)],
},
},
},
};
Loading