Repository navigation
refactor(automations): one shared trigger tail, verify helpers, one options call — every provider #6635
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
Merged
refactor(automations): one shared trigger tail, verify helpers, one options call — every provider #6635
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
ea3ebac
feat(api): one webhook runner for every trigger provider
saddlepaddle 31bdc6e
refactor(api,trpc,desktop): shared trigger tail, verify helpers, one …
saddlepaddle e05e2dd
refactor(api): circleback + raw webhook on ingestAutomationEvent, ver…
saddlepaddle fdb33ad
refactor(api,trpc): move GitHub and Linear onto ingestAutomationEvent…
saddlepaddle e08047c
refactor(api,trpc,desktop): migrate Teams and Google to ingestAutomat…
saddlepaddle 5bb133c
Merge remote-tracking branch 'origin/migrate/github-linear' into feat…
saddlepaddle a805f39
Merge remote-tracking branch 'origin/migrate/teams-google' into feat/…
saddlepaddle c8b97a7
refactor(api,trpc): migrate Slack and Notion triggers onto ingestAuto…
saddlepaddle 37cc5c3
Merge remote-tracking branch 'origin/migrate/slack-notion' into feat/…
saddlepaddle 22fa22c
refactor(api,trpc): every provider on the shared tail; dispatchInput …
saddlepaddle ca56ad0
refactor(automations): drop per-trigger enabled; tie the kind enum to…
saddlepaddle ef0df77
refactor(automations): schedules are repeating only — no finite rules…
saddlepaddle c1744a2
Merge remote-tracking branch 'origin/main' into feat/provider-webhook…
saddlepaddle 3045731
refactor(microsoft-teams): replace hand-rolled Graph client with offi…
saddlepaddle f65e1c0
refactor(google): replace hand-rolled HTTP client with official Googl…
saddlepaddle b70b19f
Merge remote-tracking branch 'origin/cleanup/google-sdk' into feat/pr…
saddlepaddle 94731f6
refactor(integrations): one roster, full desktop pane, shared Sentenc…
saddlepaddle ccf2818
Merge remote-tracking branch 'origin/cleanup/ui-surfaces' into feat/p…
saddlepaddle 4aecfc3
refactor(integrations): dedupe OAuth connect/callback flows and conne…
saddlepaddle 327cb83
Merge remote-tracking branch 'origin/cleanup/oauth-connections' into …
saddlepaddle 38adb95
refactor(automations): unify actor into scope, drop null scopes and i…
saddlepaddle 0ff3ae1
fix(automations): address review — sweep on quiet ticks, mark zero-ca…
saddlepaddle 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
37 changes: 37 additions & 0 deletions
37
apps/api/src/app/api/automations/webhook/[automationId]/normalizeWebhookDelivery.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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| import { randomUUID } from "node:crypto"; | ||
|
|
||
| import type { NormalizedDelivery } from "@/lib/automations/ingestAutomationEvent"; | ||
|
|
||
| export const EVENT_TYPE = "webhook.received"; | ||
|
|
||
| /** | ||
| * Every authenticated delivery is its own event — there is no dedupe — and | ||
| * fires every enabled webhook trigger on the one automation the URL names. | ||
| */ | ||
| export function normalizeWebhookDelivery(params: { | ||
| organizationId: string; | ||
| automationId: string; | ||
| payload: Record<string, unknown> | unknown[]; | ||
| }): NormalizedDelivery { | ||
| return { | ||
| event: { | ||
| organizationId: params.organizationId, | ||
| integrationConnectionId: null, | ||
| provider: "webhook", | ||
| eventType: EVENT_TYPE, | ||
| externalEventId: randomUUID(), | ||
| title: "Webhook", | ||
| payload: params.payload, | ||
| }, | ||
| dispatch: { | ||
| automationId: params.automationId, | ||
| event: { | ||
| provider: "webhook", | ||
| eventType: EVENT_TYPE, | ||
| actorId: null, | ||
| actorLogin: null, | ||
| body: null, | ||
| }, | ||
| }, | ||
| }; | ||
| } |
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
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.