-
Couldn't load subscription status.
- Fork 5.5k
Linear - New ProjectUpdates #15332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+179
−18
Merged
Linear - New ProjectUpdates #15332
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
371583b
linear_app-new-projectupdate-created
michelle0927 d8712d3
linear-new-projectupdate-created
michelle0927 9e7cc6e
remove linear-new-projectupdate-created
michelle0927 58eb468
pnpm-lock.yaml
michelle0927 cdacd95
revert linear package version
michelle0927 61d9ad2
remove duplicate body field
michelle0927 3bd47ac
update description
michelle0927 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
86 changes: 86 additions & 0 deletions
86
components/linear_app/sources/new-projectupdate-created/new-projectupdate-created.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| import common from "../common/webhook.mjs"; | ||
| import constants from "../../common/constants.mjs"; | ||
| import linearApp from "../../linear_app.app.mjs"; | ||
|
|
||
| export default { | ||
| ...common, | ||
| key: "linear_app-new-projectupdate-created", | ||
| name: "New Project Update (Instant)", | ||
| description: "Emit new event when a new Project Update is created. [See the documentation](https://developers.linear.app/docs/graphql/webhooks)", | ||
| type: "source", | ||
| version: "0.0.1", | ||
| dedupe: "unique", | ||
| props: { | ||
| linearApp, | ||
| db: "$.service.db", | ||
| teamId: { | ||
| label: "Team ID", | ||
| type: "string", | ||
| propDefinition: [ | ||
| common.props.linearApp, | ||
| "teamId", | ||
| ], | ||
| description: "The identifier or key of the team associated with the project", | ||
| reloadProps: true, | ||
| }, | ||
| projectId: { | ||
| propDefinition: [ | ||
| common.props.linearApp, | ||
| "projectId", | ||
| (c) => ({ | ||
| teamId: c.teamId, | ||
| }), | ||
| ], | ||
| description: "Filter results by project", | ||
| }, | ||
| }, | ||
| methods: { | ||
| ...common.methods, | ||
| getResourceTypes() { | ||
| return [ | ||
| constants.RESOURCE_TYPE.PROJECT_UPDATE, | ||
| ]; | ||
| }, | ||
| getWebhookLabel() { | ||
| return "Project Update created"; | ||
| }, | ||
| getResourcesFn() { | ||
| return this.linearApp.listProjectUpdates; | ||
| }, | ||
| getResourcesFnArgs() { | ||
| return { | ||
| orderBy: "createdAt", | ||
| filter: { | ||
| createdAt: { | ||
| gte: "-P1W", // within the last week | ||
| }, | ||
| }, | ||
| }; | ||
| }, | ||
| getResource(projectUpdate) { | ||
| return this.linearApp.getProjectUpdate(projectUpdate.id); | ||
| }, | ||
| isRelevant(body) { | ||
| const teamIds = body.data.infoSnapshot.teamsInfo.map(({ id }) => id); | ||
| return body?.action === "create" && teamIds.includes(this.teamId); | ||
| }, | ||
| isRelevantPolling(resource) { | ||
| const teamIds = resource.infoSnapshot.teamsInfo.map(({ id }) => id); | ||
| const projectId = resource.project.id; | ||
| return (teamIds.includes(this.teamId)) && (!this.projectId || projectId === this.projectId); | ||
| }, | ||
| getMetadata(resource) { | ||
| const { | ||
| data, | ||
| createdAt, | ||
| } = resource; | ||
| const ts = Date.parse(data?.createdAt || createdAt); | ||
| const id = data?.id || resource.id; | ||
| return { | ||
| id, | ||
| summary: `New Project Update: ${id}`, | ||
| ts, | ||
| }; | ||
| }, | ||
| }, | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.