diff --git a/.infisical.json b/.infisical.json index 8005d473e..7668c8c4c 100755 --- a/.infisical.json +++ b/.infisical.json @@ -1 +1 @@ -{"workspaceId":"63e5e42daf9a537ba8d9503c"} \ No newline at end of file +{ "workspaceId": "63e5e42daf9a537ba8d9503c" } diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 000000000..7c73a4c74 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,11 @@ +node_modules +.env +.env.local +pnpm-lock.yaml +tailwind.css +.babelrc.json +**/.react-email/ +**/storybook-static/ +**/.changeset/ +**/build/ +**/dist/ \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json index c205800be..e14f2c5d1 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -5,19 +5,12 @@ "version": "0.2.0", "configurations": [ { - "command": "pnpm run idev --filter webapp", + "command": "pnpm run dev --filter webapp", "name": "Run webapp", "request": "launch", "type": "node-terminal", "cwd": "${workspaceFolder}" }, - { - "command": "pnpm run dev --filter integrations", - "name": "Run integrations", - "request": "launch", - "type": "node-terminal", - "cwd": "${workspaceFolder}" - }, { "type": "chrome", "request": "launch", diff --git a/.vscode/trigger.code-workspace b/.vscode/trigger.code-workspace deleted file mode 100644 index 89f839cf1..000000000 --- a/.vscode/trigger.code-workspace +++ /dev/null @@ -1,19 +0,0 @@ -{ - "folders": [ - { - "name": "trigger.dev", - "path": "../" - }, - { - "name": "Webapp", - "path": "../apps/webapp" - }, - { - "name": "Integrations", - "path": "../apps/integrations" - } - ], - "settings": { - "vitest.commandLine": "pnpm exec vitest" - } -} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 25fc75df8..69bec7b2b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -81,15 +81,20 @@ branch are tagged into a release monthly. 2. Once the app is running click the magic link button and enter your email. 3. Check your terminal, the magic link email should have printed out as following: - `webapp:dev: Log in to Trigger.dev -webapp:dev: -webapp:dev: Click here to log in with this magic link -webapp:dev: [http://localhost:3030/magic?token=U2FsdGVkX18OvB0JxgaswTLCSbaRz%2FY82TN0EZWhSzFyZYwgG%2BIzKVTkeiaOtWfotPw7F8RwFzCHh53aBpMEu%2B%2B%2FItb%2FcJYh89MSjc3Pz92bevoEjqxSQ%2Ff%2BZbks09JOpqlBbYC3FzGWC8vuSVFBlxqLXxteSDLthZSUaC%2BS2LaA%2BJgp%2BLO7hgjAaC2lXbCHrM7MTgTdXOFt7i0Dvvuwz6%2BWY25RnfomZOPqDsyH0xz8Q2rzPTz0Xu53WSXrZ1hd] -webapp:dev: -webapp:dev: If you didn't try to log in, you can safely ignore this email.` -4. Paste the magic link shown in your terminal into your browser to login. + + ```sh + webapp:dev: Log in to Trigger.dev + webapp:dev: + webapp:dev: Click here to log in with this magic link + webapp:dev: [http://localhost:3030/magic?token=U2FsdGVkX18OvB0JxgaswTLCSbaRz%2FY82TN0EZWhSzFyZYwgG%2BIzKVTkeiaOtWfotPw7F8RwFzCHh53aBpMEu%2B%2B%2FItb%2FcJYh89MSjc3Pz92bevoEjqxSQ%2Ff%2BZbks09JOpqlBbYC3FzGWC8vuSVFBlxqLXxteSDLthZSUaC%2BS2LaA%2BJgp%2BLO7hgjAaC2lXbCHrM7MTgTdXOFt7i0Dvvuwz6%2BWY25RnfomZOPqDsyH0xz8Q2rzPTz0Xu53WSXrZ1hd] + webapp:dev: + webapp:dev: If you didn't try to log in, you can safely ignore this email. + ``` + + Paste the magic link shown in your terminal into your browser to login. ## Adding and running migrations + 1. Modify packages/database/prisma/schema.prisma file 2. Change directory to the packages/database folder ```sh @@ -100,6 +105,7 @@ webapp:dev: If you didn't try to log in, you can safely ignore this email.` ```sh pnpm run generate ``` + The above updates the prisma client generated into node_modules/.prisma/client folder. This helps with typing of relevant prisma models. It ensures typescript recognizes fields added or removed from a model and type-checks appropriately. @@ -108,6 +114,7 @@ webapp:dev: If you didn't try to log in, you can safely ignore this email.` ``` pnpm run db:migrate:dev ``` + This creates a migration file and executes the migrations against your database and applies changes to the database schema(s) 5. Commit generated migrations as well as changes to the schema.prisma file @@ -119,44 +126,44 @@ To test CLI changes, follow the steps below: 1. Build the CLI and watch for changes - ``` - cd packages/cli - pnpm run dev - ``` +```sh +cd packages/cli +pnpm run dev +``` 2. Open a new Terminal window and run the webapp locally and then create a new project in the dashboard. Copy out the dev API key. 3. Create a new temporary Next.js app in examples directory - ``` - pnpm create next-app@latest - ``` +```sh +pnpm create next-app@latest +``` - Follow the prompts to create a TypeScript project using the App Directory. +Follow the prompts to create a TypeScript project using the App Directory. 4. Then once that's finished, add the `@trigger.dev/cli` to the `devDependencies` of the newly created Next.js app's `package.json` file, like so: - ``` - { - "devDependencies": { "@trigger.dev/cli": "workspace:*" } - } - ``` +```json +{ + "devDependencies": { "@trigger.dev/cli": "workspace:*" } +} +``` 5. Open a new terminal window, navigate into the example, and initialize the CLI: - ``` - cd examples/your-newly-created-nextjs-project - pnpm i - pnpm exec trigger-cli init - ``` +```sh +cd examples/your-newly-created-nextjs-project +pnpm i +pnpm exec trigger-cli init +``` 6. When prompted, select `self-hosted` and enter `localhost:3030` for your local version of the webapp. When asked for an API key, use the key you copied earlier. 7. Run the CLI - ``` - pnpm exec trigger-cli dev - ``` +```sh +pnpm exec trigger-cli dev +``` 8. After running the CLI, start your newly created Next.js project. You should now be able to see the changes. @@ -170,19 +177,19 @@ The [examples/jobs-starter](./examples/jobs-starter/) project defines simple job 2. Create a `.env.local` file with the following content, replacing `[TRIGGER_DEV_API_KEY]` with an actual key: - ``` - TRIGGER_API_KEY=[TRIGGER_DEV_API_KEY] - TRIGGER_API_URL=http://localhost:3030 - ``` +```env +TRIGGER_API_KEY=[TRIGGER_DEV_API_KEY] +TRIGGER_API_URL=http://localhost:3030 +``` - `TRIGGER_API_URL` is used to configure the URL for your Trigger.dev instance, - where the jobs will be registered. +`TRIGGER_API_URL` is used to configure the URL for your Trigger.dev instance, +where the jobs will be registered. 3. Run the `jobs-starter` app: - ``` - pnpm dev - ``` +```sh +pnpm dev +``` 4. Navigate to your trigger.dev instance ([http://localhost:3030](http://localhost:3030/)), to see the jobs. You can use the test feature to trigger them. @@ -204,7 +211,7 @@ If you are contributing a change to any packages in this monorepo (anything in e To add a changeset, run the following command in the root of the repo -```shell +```sh pnpm run changeset:add ``` @@ -221,15 +228,18 @@ Most of the time the changes you'll make are likely to be categorized as patch r ### EADDRINUSE: address already in use :::3030 When receiving the following error message: -`webapp:dev: Error: listen EADDRINUSE: address already in use :::3030` + +```sh +webapp:dev: Error: listen EADDRINUSE: address already in use :::3030 +``` The process running on port `3030` should be destroyed. 1. Get the `PID` of the process running on PORT `3030` - ``` + ```sh lsof -i :3030 ``` 2. Kill the process - ``` + ```sh sudo kill -9 ``` diff --git a/README.md b/README.md index 03aae17a9..f24d1911c 100644 --- a/README.md +++ b/README.md @@ -11,9 +11,11 @@ [![Twitter](https://img.shields.io/twitter/url/https/twitter.com/triggerdotdev.svg?style=social&label=Follow%20%40trigger.dev)](https://twitter.com/triggerdotdev) [![GitHub Repo stars](https://img.shields.io/github/stars/triggerdotdev/trigger.dev?style=social)](https://github.com/triggerdotdev/trigger.dev) + # About Trigger.dev + Create long-running jobs directly in your codebase with features like API integrations, webhooks, scheduling and delays. ### Long running Jobs on serverless @@ -60,5 +62,4 @@ We provide an official trigger.dev docker image you can use to easily self-host ## Development -To setup and develop locally or contribute to the open source project, follow our [developement guide](./CONTRIBUTING.md). - +To setup and develop locally or contribute to the open source project, follow our [developement guide](./CONTRIBUTING.md). diff --git a/apps/webapp/.eslintrc b/apps/webapp/.eslintrc index f4e9c8f94..dc7ad7e2a 100644 --- a/apps/webapp/.eslintrc +++ b/apps/webapp/.eslintrc @@ -1,9 +1,5 @@ { - "extends": [ - "@remix-run/eslint-config", - "@remix-run/eslint-config/node", - "prettier" - ], + "extends": ["@remix-run/eslint-config", "@remix-run/eslint-config/node", "prettier"], "rules": { "@typescript-eslint/strict-boolean-expressions": [ "error", diff --git a/apps/webapp/.storybook/main.ts b/apps/webapp/.storybook/main.ts index f35bfd920..1fea1efde 100644 --- a/apps/webapp/.storybook/main.ts +++ b/apps/webapp/.storybook/main.ts @@ -20,10 +20,7 @@ const config: StorybookConfig = { }, }; }, - stories: [ - "../app/**/stories/*.mdx", - "../app/**/stories/*.stories.@(js|jsx|ts|tsx)", - ], + stories: ["../app/**/stories/*.mdx", "../app/**/stories/*.stories.@(js|jsx|ts|tsx)"], addons: [ "@storybook/addon-links", "@storybook/addon-essentials", diff --git a/apps/webapp/.storybook/preview.tsx b/apps/webapp/.storybook/preview.tsx index 4b86a0ef7..bdf5e3ab6 100644 --- a/apps/webapp/.storybook/preview.tsx +++ b/apps/webapp/.storybook/preview.tsx @@ -35,9 +35,7 @@ const preview: Preview = { return ( - + diff --git a/apps/webapp/app/assets/icons/DynamicTriggerIcon.tsx b/apps/webapp/app/assets/icons/DynamicTriggerIcon.tsx index 28c36445d..961586c45 100644 --- a/apps/webapp/app/assets/icons/DynamicTriggerIcon.tsx +++ b/apps/webapp/app/assets/icons/DynamicTriggerIcon.tsx @@ -1,11 +1,6 @@ export function DynamicTriggerIcon({ className }: { className?: string }) { return ( - + + +
{typeof icon === "string" ? ( - + ) : ( icon )} diff --git a/apps/webapp/app/components/ErrorDisplay.tsx b/apps/webapp/app/components/ErrorDisplay.tsx index f02315166..c40360a27 100644 --- a/apps/webapp/app/components/ErrorDisplay.tsx +++ b/apps/webapp/app/components/ErrorDisplay.tsx @@ -19,19 +19,14 @@ export function RouteErrorDisplay(options?: ErrorDisplayOptions) { ) : error instanceof Error ? ( ) : ( - + )} ); @@ -47,11 +42,7 @@ export function ErrorDisplay({ title, message, button }: DisplayOptionsProps) {
{title} {message && {message}} - + {button ? button.title : "Home"}
diff --git a/apps/webapp/app/components/Feedback.tsx b/apps/webapp/app/components/Feedback.tsx index 68d8eda93..8f2496414 100644 --- a/apps/webapp/app/components/Feedback.tsx +++ b/apps/webapp/app/components/Feedback.tsx @@ -1,17 +1,8 @@ import { conform, useForm } from "@conform-to/react"; import { parse } from "@conform-to/zod"; -import { - Form, - useActionData, - useLocation, - useNavigation, -} from "@remix-run/react"; +import { Form, useActionData, useLocation, useNavigation } from "@remix-run/react"; import { ReactNode, useState } from "react"; -import { - FeedbackType, - feedbackTypeLabel, - schema, -} from "~/routes/resources.feedback"; +import { FeedbackType, feedbackTypeLabel, schema } from "~/routes/resources.feedback"; import { Button } from "./primitives/Buttons"; import { Fieldset } from "./primitives/Fieldset"; import { FormButtons } from "./primitives/FormButtons"; @@ -27,13 +18,7 @@ import { SelectTrigger, SelectValue, } from "./primitives/Select"; -import { - Sheet, - SheetBody, - SheetContent, - SheetHeader, - SheetTrigger, -} from "./primitives/Sheet"; +import { Sheet, SheetBody, SheetContent, SheetHeader, SheetTrigger } from "./primitives/Sheet"; import { TextArea } from "./primitives/TextArea"; type FeedbackProps = { @@ -71,22 +56,16 @@ export function Feedback({ button, defaultValue = "bug" }: FeedbackProps) { Help & feedback - Use this form to ask for help or give us feedback. We read every - message and will get back to you as soon as we can. + Use this form to ask for help or give us feedback. We read every message and will get + back to you as soon as we can.
- + - @@ -99,9 +78,7 @@ export function Feedback({ button, defaultValue = "bug" }: FeedbackProps) { - - {feedbackType.error} - + {feedbackType.error} diff --git a/apps/webapp/app/components/ImpersonationBanner.tsx b/apps/webapp/app/components/ImpersonationBanner.tsx index 88493dac2..d665d344b 100644 --- a/apps/webapp/app/components/ImpersonationBanner.tsx +++ b/apps/webapp/app/components/ImpersonationBanner.tsx @@ -2,17 +2,12 @@ import { Form } from "@remix-run/react"; import { Paragraph } from "./primitives/Paragraph"; import { Button } from "./primitives/Buttons"; -export function ImpersonationBanner({ - impersonationId, -}: { - impersonationId: string; -}) { +export function ImpersonationBanner({ impersonationId }: { impersonationId: string }) { return (
- You are impersonating{" "} - {impersonationId} + You are impersonating {impersonationId} - - Trigger.dev is currently only available on desktop. - + Trigger.dev is currently only available on desktop. Back Home diff --git a/apps/webapp/app/components/UserProfilePhoto.tsx b/apps/webapp/app/components/UserProfilePhoto.tsx index b0a44d956..a59e0a653 100644 --- a/apps/webapp/app/components/UserProfilePhoto.tsx +++ b/apps/webapp/app/components/UserProfilePhoto.tsx @@ -4,13 +4,7 @@ import { cn } from "~/utils/cn"; export function UserProfilePhoto({ className }: { className?: string }) { const user = useOptionalUser(); - return ( - - ); + return ; } export function UserAvatar({ diff --git a/apps/webapp/app/components/code/CodeBlock.tsx b/apps/webapp/app/components/code/CodeBlock.tsx index 95090a065..c447bc646 100644 --- a/apps/webapp/app/components/code/CodeBlock.tsx +++ b/apps/webapp/app/components/code/CodeBlock.tsx @@ -2,16 +2,8 @@ import type { Language, PrismTheme } from "prism-react-renderer"; import Highlight, { defaultProps } from "prism-react-renderer"; import { forwardRef, useCallback, useState } from "react"; import { cn } from "~/utils/cn"; -import { - Tooltip, - TooltipContent, - TooltipProvider, - TooltipTrigger, -} from "../primitives/Tooltip"; -import { - ClipboardDocumentCheckIcon, - ClipboardIcon, -} from "@heroicons/react/24/solid"; +import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "../primitives/Tooltip"; +import { ClipboardDocumentCheckIcon, ClipboardIcon } from "@heroicons/react/24/solid"; import { Clipboard, ClipboardCheck, ClipboardCheckIcon } from "lucide-react"; //This is a fork of https://github.com/mantinedev/mantine/blob/master/src/mantine-prism/src/Prism/Prism.tsx @@ -193,9 +185,7 @@ export const CodeBlock = forwardRef( const maxLineWidth = lineCount.toString().length; let maxHeight: string | undefined = undefined; if (maxLines && lineCount > maxLines) { - maxHeight = `calc(${ - (maxLines + extraLinesWhenClipping) * 0.75 * 1.625 - }rem + 1.5rem )`; + maxHeight = `calc(${(maxLines + extraLinesWhenClipping) * 0.75 * 1.625}rem + 1.5rem )`; } const highlightLines = highlightedRanges?.flatMap(([start, end]) => @@ -204,10 +194,7 @@ export const CodeBlock = forwardRef( return (
( className={cn( "absolute right-3 z-50 transition-colors duration-100 hover:cursor-pointer", showChrome ? "top-10" : "top-3", - copied - ? "text-emerald-500" - : "text-slate-500 hover:text-slate-300" + copied ? "text-emerald-500" : "text-slate-500 hover:text-slate-300" )} > {copied ? ( @@ -244,12 +229,7 @@ export const CodeBlock = forwardRef( )} - + {({ className: inheritedClassName, style: inheritedStyle, @@ -285,15 +265,10 @@ export const CodeBlock = forwardRef( const lineNumber = index + 1; const lineProps = getLineProps({ line, key: index }); - let hasAnyHighlights = highlightLines - ? highlightLines.length > 0 - : false; + let hasAnyHighlights = highlightLines ? highlightLines.length > 0 : false; let shouldDim = hasAnyHighlights; - if ( - hasAnyHighlights && - highlightLines?.includes(lineNumber) - ) { + if (hasAnyHighlights && highlightLines?.includes(lineNumber)) { shouldDim = false; } diff --git a/apps/webapp/app/components/code/JSONEditor.tsx b/apps/webapp/app/components/code/JSONEditor.tsx index 326ab6065..4b635904a 100644 --- a/apps/webapp/app/components/code/JSONEditor.tsx +++ b/apps/webapp/app/components/code/JSONEditor.tsx @@ -1,9 +1,6 @@ import { json as jsonLang } from "@codemirror/lang-json"; import type { ViewUpdate } from "@codemirror/view"; -import type { - ReactCodeMirrorProps, - UseCodeMirror, -} from "@uiw/react-codemirror"; +import type { ReactCodeMirrorProps, UseCodeMirror } from "@uiw/react-codemirror"; import { useCodeMirror } from "@uiw/react-codemirror"; import { useRef, useEffect } from "react"; import { getEditorSetup } from "./codeMirrorSetup"; diff --git a/apps/webapp/app/components/code/codeMirrorSetup.ts b/apps/webapp/app/components/code/codeMirrorSetup.ts index 5955973df..9e7ff711d 100644 --- a/apps/webapp/app/components/code/codeMirrorSetup.ts +++ b/apps/webapp/app/components/code/codeMirrorSetup.ts @@ -30,10 +30,7 @@ export function getViewerSetup(): Array { return [drawSelection(), dropCursor(), bracketMatching(), lineNumbers()]; } -export function getEditorSetup( - showLineNumbers = true, - showHighlights = true -): Array { +export function getEditorSetup(showLineNumbers = true, showHighlights = true): Array { const options = [ drawSelection(), dropCursor(), diff --git a/apps/webapp/app/components/code/codeMirrorTheme.ts b/apps/webapp/app/components/code/codeMirrorTheme.ts index a7c07793b..0492b80b9 100644 --- a/apps/webapp/app/components/code/codeMirrorTheme.ts +++ b/apps/webapp/app/components/code/codeMirrorTheme.ts @@ -36,8 +36,9 @@ export function darkTheme(): Extension { }, ".cm-cursor, .cm-dropCursor": { borderLeftColor: cursor }, - "&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": - { backgroundColor: selection }, + "&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { + backgroundColor: selection, + }, ".cm-panels": { backgroundColor: darkBackground, color: ivory }, ".cm-panels.cm-panels-top": { borderBottom: "2px solid black" }, @@ -101,13 +102,7 @@ export function darkTheme(): Extension { const jsonHeroHighlightStyle = HighlightStyle.define([ { tag: tags.keyword, color: violet }, { - tag: [ - tags.name, - tags.deleted, - tags.character, - tags.propertyName, - tags.macroName, - ], + tag: [tags.name, tags.deleted, tags.character, tags.propertyName, tags.macroName], color: coral, }, { tag: [tags.function(tags.variableName), tags.labelName], color: malibu }, @@ -194,8 +189,9 @@ export function lightTheme(): Extension[] { }, ".cm-cursor, .cm-dropCursor": { borderLeftColor: cursor }, - "&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": - { backgroundColor: selection }, + "&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { + backgroundColor: selection, + }, ".cm-panels": { backgroundColor: darkBackground, color: ivory }, ".cm-panels.cm-panels-top": { borderBottom: "2px solid black" }, @@ -259,13 +255,7 @@ export function lightTheme(): Extension[] { const jsonHeroHighlightStyle = tagHighlighter([ { tag: tags.keyword, class: violet }, { - tag: [ - tags.name, - tags.deleted, - tags.character, - tags.propertyName, - tags.macroName, - ], + tag: [tags.name, tags.deleted, tags.character, tags.propertyName, tags.macroName], class: variableColor, }, { diff --git a/apps/webapp/app/components/helpContent/HelpContentText.tsx b/apps/webapp/app/components/helpContent/HelpContentText.tsx index b070c2980..899523138 100644 --- a/apps/webapp/app/components/helpContent/HelpContentText.tsx +++ b/apps/webapp/app/components/helpContent/HelpContentText.tsx @@ -34,10 +34,7 @@ export function HowToSetupYourProject() { const appOrigin = useAppOrigin(); return ( <> - + @@ -72,9 +69,8 @@ export function HowToSetupYourProject() { - You’ll notice a new folder in your project called 'jobs'. We’ve added - a very simple example Job in examples.ts to - help you get started. + You’ll notice a new folder in your project called 'jobs'. We’ve added a very simple + example Job in examples.ts to help you get started. @@ -87,36 +83,20 @@ export function HowToSetupYourProject() { yarn - + - + - + - In a{" "} - - separate terminal window or tab - {" "} - run: + In a separate terminal window or tab run: @@ -151,15 +131,13 @@ export function HowToSetupYourProject() { --port 3001 to the end. - You should leave the dev command running when - you're developing. + You should leave the dev command running when you're developing. - Once you've run the CLI command, click Refresh to view your example - Job in the list. + Once you've run the CLI command, click Refresh to view your example Job in the list. )} - We don’t have an Integration for the {api.name} API yet but you can - request one by clicking the button above. In the meantime, connect - to {api.name} using one of the methods below. + We don’t have an Integration for the {api.name} API yet but you can request one by + clicking the button above. In the meantime, connect to {api.name} using one of the + methods below. diff --git a/apps/webapp/app/components/integrations/SelectOAuthMethod.tsx b/apps/webapp/app/components/integrations/SelectOAuthMethod.tsx index cce5d4d52..c939b6498 100644 --- a/apps/webapp/app/components/integrations/SelectOAuthMethod.tsx +++ b/apps/webapp/app/components/integrations/SelectOAuthMethod.tsx @@ -1,8 +1,5 @@ import { useState } from "react"; -import { - ApiAuthenticationMethodOAuth2, - Integration, -} from "~/services/externalApis/types"; +import { ApiAuthenticationMethodOAuth2, Integration } from "~/services/externalApis/types"; import { RadioGroup, RadioGroupItem } from "../primitives/RadioButton"; import type { ConnectionType } from "@trigger.dev/database"; import { Header2 } from "../primitives/Headers"; @@ -29,14 +26,10 @@ export function SelectOAuthMethod({ const [oAuthKey, setOAuthKey] = useState( oAuthMethods.length === 1 ? oAuthMethods[0][0] : undefined ); - const [connectionType, setConnectionType] = useState< - ConnectionType | undefined - >(); + const [connectionType, setConnectionType] = useState(); const selectedOAuthMethod = oAuthKey - ? (integration.authenticationMethods[ - oAuthKey - ] as ApiAuthenticationMethodOAuth2) + ? (integration.authenticationMethods[oAuthKey] as ApiAuthenticationMethodOAuth2) : undefined; return ( @@ -65,9 +58,7 @@ export function SelectOAuthMethod({ )} {selectedOAuthMethod && ( <> - - Who is connecting to {integration.name} - + Who is connecting to {integration.name} User OAuth coming soon - End-user OAuth is going to be released soon. If you are interested - in being an early beta tester then please{" "} - + End-user OAuth is going to be released soon. If you are interested in being an early + beta tester then please{" "} + message us . diff --git a/apps/webapp/app/components/integrations/UpdateOAuthForm.tsx b/apps/webapp/app/components/integrations/UpdateOAuthForm.tsx index 63b843ccc..85db2c6de 100644 --- a/apps/webapp/app/components/integrations/UpdateOAuthForm.tsx +++ b/apps/webapp/app/components/integrations/UpdateOAuthForm.tsx @@ -6,11 +6,7 @@ import { useState } from "react"; import simplur from "simplur"; import { useFeatures } from "~/hooks/useFeatures"; import { useTextFilter } from "~/hooks/useTextFilter"; -import { - ApiAuthenticationMethodOAuth2, - Integration, - Scope, -} from "~/services/externalApis/types"; +import { ApiAuthenticationMethodOAuth2, Integration, Scope } from "~/services/externalApis/types"; import { cn } from "~/utils/cn"; import { CodeBlock } from "../code/CodeBlock"; import { Button } from "../primitives/Buttons"; @@ -48,10 +44,7 @@ export function UpdateOAuthForm({ const fetcher = useFetcher(); const { isManagedCloud } = useFeatures(); - const [ - form, - { title, scopes, hasCustomClient, customClientId, customClientSecret }, - ] = useForm({ + const [form, { title, scopes, hasCustomClient, customClientId, customClientSecret }] = useForm({ lastSubmission: fetcher.data, onValidate({ formData }) { return parse(formData, { @@ -63,9 +56,7 @@ export function UpdateOAuthForm({ const location = useLocation(); const [selectedScopes, setSelectedScopes] = useState>( - new Set( - authMethod.scopes.filter((s) => s.defaultChecked).map((s) => s.name) - ) + new Set(authMethod.scopes.filter((s) => s.defaultChecked).map((s) => s.name)) ); const requiresCustomOAuthApp = clientType === "EXTERNAL" || !isManagedCloud; @@ -76,10 +67,7 @@ export function UpdateOAuthForm({ items: authMethod.scopes, filter: (scope, text) => { if (scope.name.toLowerCase().includes(text.toLowerCase())) return true; - if ( - scope.description && - scope.description.toLowerCase().includes(text.toLowerCase()) - ) + if (scope.description && scope.description.toLowerCase().includes(text.toLowerCase())) return true; return false; @@ -95,16 +83,8 @@ export function UpdateOAuthForm({ >
- - + + {form.error} @@ -130,8 +110,7 @@ export function UpdateOAuthForm({
Use my OAuth App - To use your own OAuth app, check the option below and insert the - details. + To use your own OAuth app, check the option below and insert the details. - Set the callback url to{" "} - + Set the callback url to
- + @@ -176,10 +151,9 @@ export function UpdateOAuthForm({
Scopes - Select the scopes you want to grant to {integration.name} in order - for it to access your data. Note: If you try and perform an action - in a Job that requires a scope you haven’t granted, that task will - fail. + Select the scopes you want to grant to {integration.name} in order for it to access + your data. Note: If you try and perform an action in a Job that requires a scope you + haven’t granted, that task will fail. {/* Select from popular scope collections @@ -224,11 +198,7 @@ export function UpdateOAuthForm({ badges={s.annotations?.map((a) => a.label)} description={s.description} variant="description" - className={cn( - filteredItems.find((f) => f.name === s.name) - ? "" - : "hidden" - )} + className={cn(filteredItems.find((f) => f.name === s.name) ? "" : "hidden")} onChange={(isChecked) => { if (isChecked) { setSelectedScopes((selected) => { diff --git a/apps/webapp/app/components/jobs/JobsTable.tsx b/apps/webapp/app/components/jobs/JobsTable.tsx index 7e2eb0612..30d724b39 100644 --- a/apps/webapp/app/components/jobs/JobsTable.tsx +++ b/apps/webapp/app/components/jobs/JobsTable.tsx @@ -21,13 +21,7 @@ import { useOrganization } from "~/hooks/useOrganizations"; import { JobRunStatus } from "~/models/job.server"; import { cn } from "~/utils/cn"; -export function JobsTable({ - jobs, - noResultsText, -}: { - jobs: ProjectJob[]; - noResultsText: string; -}) { +export function JobsTable({ jobs, noResultsText }: { jobs: ProjectJob[]; noResultsText: string }) { const organization = useOrganization(); const project = useProject(); @@ -50,9 +44,7 @@ export function JobsTable({ return ( @@ -63,8 +55,7 @@ export function JobsTable({ job.dynamic ? ( {" "} - Dynamic:{" "} - {job.event.title} + Dynamic: {job.event.title} ) : ( job.event.title @@ -75,11 +66,7 @@ export function JobsTable({ - + {job.integrations.map((integration) => ( @@ -87,15 +74,9 @@ export function JobsTable({ key={integration.key} button={
- + {integration.setupStatus === "MISSING_FIELDS" && ( - + )}
} @@ -166,10 +147,7 @@ export function JobsTable({ }) ) : ( - + {noResultsText} diff --git a/apps/webapp/app/components/layout/AppLayout.tsx b/apps/webapp/app/components/layout/AppLayout.tsx index b0612874b..000f62bff 100644 --- a/apps/webapp/app/components/layout/AppLayout.tsx +++ b/apps/webapp/app/components/layout/AppLayout.tsx @@ -11,9 +11,7 @@ export function AppContainer({ }) { return ( -
- {children} -
+
{children}
); } @@ -43,9 +41,7 @@ export function BackgroundGradient({ /** This container should be placed around the content on a page */ export function PageContainer({ children }: { children: React.ReactNode }) { - return ( -
{children}
- ); + return
{children}
; } export function PageBody({ @@ -56,11 +52,7 @@ export function PageBody({ scrollable?: boolean; }) { return ( -
- {children} -
+
{children}
); } @@ -68,11 +60,7 @@ export function PageBodyPadding({ children }: { children: React.ReactNode }) { return
{children}
; } -export function MainCenteredContainer({ - children, -}: { - children: React.ReactNode; -}) { +export function MainCenteredContainer({ children }: { children: React.ReactNode }) { return (
{children}
diff --git a/apps/webapp/app/components/navigation/Breadcrumb.tsx b/apps/webapp/app/components/navigation/Breadcrumb.tsx index efedc5250..64980c9e9 100644 --- a/apps/webapp/app/components/navigation/Breadcrumb.tsx +++ b/apps/webapp/app/components/navigation/Breadcrumb.tsx @@ -2,10 +2,7 @@ import { RouteMatch, useMatches } from "@remix-run/react"; import { Fragment, ReactNode } from "react"; import { BreadcrumbIcon } from "../primitives/BreadcrumbIcon"; -export type BreadcrumbItem = ( - match: RouteMatch, - allMatches: RouteMatch[] -) => ReactNode; +export type BreadcrumbItem = (match: RouteMatch, allMatches: RouteMatch[]) => ReactNode; export function Breadcrumb() { const matches = useMatches(); diff --git a/apps/webapp/app/components/navigation/JobsMenu.tsx b/apps/webapp/app/components/navigation/JobsMenu.tsx index 48c56d811..351f62bb2 100644 --- a/apps/webapp/app/components/navigation/JobsMenu.tsx +++ b/apps/webapp/app/components/navigation/JobsMenu.tsx @@ -53,9 +53,7 @@ export function JobsMenu({ matches }: { matches: RouteMatch[] }) { variant="primary" className="w-full" /> - {isSelected && ( - - )} + {isSelected && } ); })} diff --git a/apps/webapp/app/components/navigation/NavBar.tsx b/apps/webapp/app/components/navigation/NavBar.tsx index 38669723c..2ddc5a07a 100644 --- a/apps/webapp/app/components/navigation/NavBar.tsx +++ b/apps/webapp/app/components/navigation/NavBar.tsx @@ -1,8 +1,5 @@ import { Popover, Transition } from "@headlessui/react"; -import { - BookOpenIcon, - ChatBubbleLeftRightIcon, -} from "@heroicons/react/20/solid"; +import { BookOpenIcon, ChatBubbleLeftRightIcon } from "@heroicons/react/20/solid"; import { Link } from "@remix-run/react"; import { Fragment } from "react"; import { cn } from "~/utils/cn"; @@ -23,11 +20,7 @@ export function NavBar() {
- + Documentation ); diff --git a/apps/webapp/app/components/navigation/ProjectSideMenu.tsx b/apps/webapp/app/components/navigation/ProjectSideMenu.tsx index e46fa3e7b..1b1a6f8e1 100644 --- a/apps/webapp/app/components/navigation/ProjectSideMenu.tsx +++ b/apps/webapp/app/components/navigation/ProjectSideMenu.tsx @@ -20,11 +20,7 @@ import { NamedIcon, type IconNames } from "../primitives/NamedIcon"; import { SimpleTooltip } from "../primitives/Tooltip"; export function SideMenuContainer({ children }: { children: React.ReactNode }) { - return ( -
- {children} -
- ); + return
{children}
; } const expandedWith = "14rem"; @@ -54,8 +50,7 @@ export function ProjectSideMenu() { const job = useOptionalJob(); const jobsActive = job !== undefined || - deepestMatch?.id === - "routes/_app.orgs.$organizationSlug.projects.$projectParam._index"; + deepestMatch?.id === "routes/_app.orgs.$organizationSlug.projects.$projectParam._index"; return ( {name} - {hasWarning && ( - - )} + {hasWarning && } } content={name} diff --git a/apps/webapp/app/components/navigation/ProjectsMenu.tsx b/apps/webapp/app/components/navigation/ProjectsMenu.tsx index 43b1d8e48..bd9d98850 100644 --- a/apps/webapp/app/components/navigation/ProjectsMenu.tsx +++ b/apps/webapp/app/components/navigation/ProjectsMenu.tsx @@ -2,16 +2,9 @@ import { RouteMatch } from "@remix-run/react"; import { Fragment, useState } from "react"; import simplur from "simplur"; import { Badge } from "~/components/primitives/Badge"; -import { - useIsNewOrganizationPage, - useOrganizations, -} from "~/hooks/useOrganizations"; +import { useIsNewOrganizationPage, useOrganizations } from "~/hooks/useOrganizations"; import { useOptionalProject } from "~/hooks/useProject"; -import { - newOrganizationPath, - newProjectPath, - projectPath, -} from "~/utils/pathBuilder"; +import { newOrganizationPath, newProjectPath, projectPath } from "~/utils/pathBuilder"; import { Popover, PopoverArrowTrigger, @@ -53,9 +46,7 @@ export function ProjectsMenu({ matches }: { matches: RouteMatch[] }) { to={projectPath(organization, project)} title={
- - {project.name} - + {project.name} {simplur`${project._count.jobs} job[|s]`}
} diff --git a/apps/webapp/app/components/primitives/Alert.tsx b/apps/webapp/app/components/primitives/Alert.tsx index db5de484b..15b922fac 100644 --- a/apps/webapp/app/components/primitives/Alert.tsx +++ b/apps/webapp/app/components/primitives/Alert.tsx @@ -54,29 +54,14 @@ const AlertContent = React.forwardRef< )); AlertContent.displayName = AlertDialogPrimitive.Content.displayName; -const AlertHeader = ({ - className, - ...props -}: React.HTMLAttributes) => ( -
+const AlertHeader = ({ className, ...props }: React.HTMLAttributes) => ( +
); AlertHeader.displayName = "AlertDialogHeader"; -const AlertFooter = ({ - className, - ...props -}: React.HTMLAttributes) => ( +const AlertFooter = ({ className, ...props }: React.HTMLAttributes) => (
); @@ -118,11 +103,7 @@ const AlertCancel = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( - + )); AlertCancel.displayName = AlertDialogPrimitive.Cancel.displayName; diff --git a/apps/webapp/app/components/primitives/Badge.tsx b/apps/webapp/app/components/primitives/Badge.tsx index 2a514d9fb..2a692247a 100644 --- a/apps/webapp/app/components/primitives/Badge.tsx +++ b/apps/webapp/app/components/primitives/Badge.tsx @@ -12,10 +12,6 @@ type BadgeProps = React.HTMLAttributes & { variant?: keyof typeof variants; }; -export function Badge({ - className, - variant = "default", - ...props -}: BadgeProps) { +export function Badge({ className, variant = "default", ...props }: BadgeProps) { return
; } diff --git a/apps/webapp/app/components/primitives/Buttons.tsx b/apps/webapp/app/components/primitives/Buttons.tsx index 2f0ea0eac..7bbe51829 100644 --- a/apps/webapp/app/components/primitives/Buttons.tsx +++ b/apps/webapp/app/components/primitives/Buttons.tsx @@ -1,10 +1,5 @@ import { Link, LinkProps, NavLink, NavLinkProps } from "@remix-run/react"; -import React, { - ReactComponentElement, - forwardRef, - useImperativeHandle, - useRef, -} from "react"; +import React, { ReactComponentElement, forwardRef, useImperativeHandle, useRef } from "react"; import { ShortcutDefinition, useShortcutKeys } from "~/hooks/useShortcutKeys"; import { cn } from "~/utils/cn"; import { IconNamesOrString, NamedIcon } from "./NamedIcon"; @@ -12,8 +7,7 @@ import { ShortcutKey } from "./ShortcutKey"; const variant = { "primary/small": { - textColor: - "text-bright group-hover:text-white transition group-disabled:text-bright/80", + textColor: "text-bright group-hover:text-white transition group-disabled:text-bright/80", button: "h-6 px-[5px] text-xs bg-indigo-600 group-hover:bg-indigo-500/90 group-disabled:opacity-50 group-disabled:pointer-events-none", icon: "h-3.5", @@ -22,8 +16,7 @@ const variant = { "ml-1 -mr-0.5 border-bright/40 text-bright group-hover:border-bright/60 justify-self-center", }, "secondary/small": { - textColor: - "text-dimmed group-hover:text-bright transition group-disabled:text-dimmed/80", + textColor: "text-dimmed group-hover:text-bright transition group-disabled:text-dimmed/80", button: "h-6 px-[5px] text-xs bg-slate-800 group-hover:bg-slate-700/70 disabled:opacity-50 group-disabled:pointer-events-none", icon: "h-3.5", @@ -32,8 +25,7 @@ const variant = { "ml-1 -mr-0.5 border-dimmed/40 text-dimmed group-hover:text-bright/80 group-hover:border-dimmed/60", }, "tertiary/small": { - textColor: - "text-dimmed group-hover:text-bright transition group-disabled:text-dimmed/80", + textColor: "text-dimmed group-hover:text-bright transition group-disabled:text-dimmed/80", button: "h-6 px-[5px] text-xs bg-transparent group-hover:bg-slate-850 disabled:opacity-50 group-disabled:pointer-events-none", icon: "h-3.5", @@ -42,58 +34,45 @@ const variant = { "ml-1 -mr-0.5 border-dimmed/40 text-dimmed group-hover:text-bright/80 group-hover:border-dimmed/60", }, "danger/small": { - textColor: - "text-bright group-hover:text-white transition group-disabled:text-bright/80", + textColor: "text-bright group-hover:text-white transition group-disabled:text-bright/80", button: "h-6 px-[5px] text-xs bg-rose-600 group-hover:bg-rose-500 disabled:opacity-50 group-disabled:pointer-events-none", icon: "h-3.5", shortcutVariant: "small" as const, - shortcut: - "ml-1 -mr-0.5 border-bright/40 text-bright group-hover:border-bright/60", + shortcut: "ml-1 -mr-0.5 border-bright/40 text-bright group-hover:border-bright/60", }, "primary/medium": { - textColor: - "text-bright group-hover:text-white transition group-disabled:text-bright/80", - button: - "h-8 px-2 text-sm bg-indigo-600 group-hover:bg-indigo-500/90 disabled:opacity-50", + textColor: "text-bright group-hover:text-white transition group-disabled:text-bright/80", + button: "h-8 px-2 text-sm bg-indigo-600 group-hover:bg-indigo-500/90 disabled:opacity-50", icon: "h-4", shortcutVariant: "medium" as const, - shortcut: - "ml-1.5 -mr-0.5 border-bright/40 text-bright group-hover:border-bright/60", + shortcut: "ml-1.5 -mr-0.5 border-bright/40 text-bright group-hover:border-bright/60", }, "secondary/medium": { - textColor: - "text-dimmed group-hover:text-bright transition group-disabled:text-dimmed/80", - button: - "h-8 px-2 text-sm bg-slate-800 group-hover:bg-slate-700/70 disabled:opacity-50", + textColor: "text-dimmed group-hover:text-bright transition group-disabled:text-dimmed/80", + button: "h-8 px-2 text-sm bg-slate-800 group-hover:bg-slate-700/70 disabled:opacity-50", icon: "h-4", shortcutVariant: "medium" as const, shortcut: "ml-1.5 -mr-0.5 border-dimmed/40 text-dimmed group-hover:border-dimmed group-hover:text-bright", }, "tertiary/medium": { - textColor: - "text-dimmed group-hover:text-bright transition group-disabled:text-dimmed/80", - button: - "h-8 px-2 text-sm bg-transparent group-hover:bg-slate-850 disabled:opacity-50", + textColor: "text-dimmed group-hover:text-bright transition group-disabled:text-dimmed/80", + button: "h-8 px-2 text-sm bg-transparent group-hover:bg-slate-850 disabled:opacity-50", icon: "h-4", shortcutVariant: "medium" as const, shortcut: "ml-1.5 -mr-0.5 border-bright/40 text-dimmed group-hover:border-bright/60 group-hover:text-bright", }, "danger/medium": { - textColor: - "text-bright group-hover:text-white transition group-disabled:text-bright/80", - button: - "h-8 px-2 text-sm bg-rose-600 group-hover:bg-rose-500 disabled:opacity-50", + textColor: "text-bright group-hover:text-white transition group-disabled:text-bright/80", + button: "h-8 px-2 text-sm bg-rose-600 group-hover:bg-rose-500 disabled:opacity-50", icon: "h-4", shortcutVariant: "medium" as const, - shortcut: - "ml-1.5 -mr-0.5 border-bright/40 text-bright group-hover:border-bright/60", + shortcut: "ml-1.5 -mr-0.5 border-bright/40 text-bright group-hover:border-bright/60", }, "primary/large": { - textColor: - "text-bright group-hover:text-white transition group-disabled:text-dimmed/80", + textColor: "text-bright group-hover:text-white transition group-disabled:text-dimmed/80", button: "h-10 px-2 text-sm font-medium bg-indigo-600 group-hover:bg-indigo-500/90 disabled:opacity-50", icon: "h-5", @@ -157,13 +136,7 @@ export function ButtonContent(props: ButtonContentPropsType) { const textColorClassName = variation.textColor; return ( -
+
) : ( + {text} ) : ( @@ -209,11 +173,7 @@ export function ButtonContent(props: ButtonContentPropsType) { (typeof TrailingIcon === "string" ? ( ) : ( ( } ); -type LinkPropsType = Pick & - React.ComponentProps; +type LinkPropsType = Pick & React.ComponentProps; export const LinkButton = ({ to, ...props }: LinkPropsType) => { const innerRef = useRef(null); if (props.shortcut) { @@ -317,26 +276,13 @@ export const LinkButton = ({ to, ...props }: LinkPropsType) => { type NavLinkPropsType = Pick & Omit, "className"> & { - className?: (props: { - isActive: boolean; - isPending: boolean; - }) => string | undefined; + className?: (props: { isActive: boolean; isPending: boolean }) => string | undefined; }; -export const NavLinkButton = ({ - to, - className, - ...props -}: NavLinkPropsType) => { +export const NavLinkButton = ({ to, className, ...props }: NavLinkPropsType) => { return ( - + {({ isActive, isPending }) => ( - + )} ); diff --git a/apps/webapp/app/components/primitives/Callout.tsx b/apps/webapp/app/components/primitives/Callout.tsx index 73716bdf7..16534e15c 100644 --- a/apps/webapp/app/components/primitives/Callout.tsx +++ b/apps/webapp/app/components/primitives/Callout.tsx @@ -23,9 +23,7 @@ export const variantClasses = { }, warning: { className: "border-yellow-400/20 bg-yellow-400/30", - icon: ( - - ), + icon: , textColor: "text-yellow-200", linkClassName: "transition hover:bg-yellow-400/40", }, @@ -87,19 +85,14 @@ export function Callout({ {icon ? icon : variantDefinition.icon} {typeof children === "string" ? ( - + {children} ) : ( children )}
- + ); } else { @@ -117,19 +110,14 @@ export function Callout({ {icon ? icon : variantDefinition.icon} {typeof children === "string" ? ( - + {children} ) : ( children )}
- + ); } diff --git a/apps/webapp/app/components/primitives/Checkbox.tsx b/apps/webapp/app/components/primitives/Checkbox.tsx index 6e057cf54..af1b38707 100644 --- a/apps/webapp/app/components/primitives/Checkbox.tsx +++ b/apps/webapp/app/components/primitives/Checkbox.tsx @@ -82,9 +82,7 @@ export const Checkbox = React.forwardRef( }, ref ) => { - const [isChecked, setIsChecked] = useState( - defaultChecked ?? false - ); + const [isChecked, setIsChecked] = useState(defaultChecked ?? false); const [isDisabled, setIsDisabled] = useState(disabled ?? false); const buttonClassName = variants[variant].button; @@ -157,10 +155,7 @@ export const Checkbox = React.forwardRef( )}
{variant === "description" && ( - + {description} )} diff --git a/apps/webapp/app/components/primitives/ClientTabs.tsx b/apps/webapp/app/components/primitives/ClientTabs.tsx index db58179f7..bb5074c9b 100644 --- a/apps/webapp/app/components/primitives/ClientTabs.tsx +++ b/apps/webapp/app/components/primitives/ClientTabs.tsx @@ -12,10 +12,7 @@ const ClientTabsList = React.forwardRef< >(({ className, ...props }, ref) => ( )); diff --git a/apps/webapp/app/components/primitives/ClipboardField.tsx b/apps/webapp/app/components/primitives/ClipboardField.tsx index 98e8713d7..a97c3f092 100644 --- a/apps/webapp/app/components/primitives/ClipboardField.tsx +++ b/apps/webapp/app/components/primitives/ClipboardField.tsx @@ -106,31 +106,19 @@ export function ClipboardField({ const inputIcon = useRef(null); return ( - + {icon && ( inputIcon.current && inputIcon.current.focus()} className={cn(iconPosition, "flex items-center")} > - {typeof icon === "string" ? ( - - ) : ( - icon - )} + {typeof icon === "string" ? : icon} )} - diff --git a/apps/webapp/app/components/primitives/DateTime.tsx b/apps/webapp/app/components/primitives/DateTime.tsx index 04823c066..fcc9478cb 100644 --- a/apps/webapp/app/components/primitives/DateTime.tsx +++ b/apps/webapp/app/components/primitives/DateTime.tsx @@ -7,44 +7,24 @@ type DateTimeProps = { includeSeconds?: boolean; }; -export const DateTime = ({ - date, - timeZone = "UTC", - includeSeconds = true, -}: DateTimeProps) => { +export const DateTime = ({ date, timeZone = "UTC", includeSeconds = true }: DateTimeProps) => { const locales = useLocales(); const realDate = typeof date === "string" ? new Date(date) : date; - const initialFormattedDateTime = formatDateTime( - realDate, - timeZone, - locales, - includeSeconds - ); + const initialFormattedDateTime = formatDateTime(realDate, timeZone, locales, includeSeconds); - const [formattedDateTime, setFormattedDateTime] = useState( - initialFormattedDateTime - ); + const [formattedDateTime, setFormattedDateTime] = useState(initialFormattedDateTime); useEffect(() => { const resolvedOptions = Intl.DateTimeFormat().resolvedOptions(); setFormattedDateTime( - formatDateTime( - realDate, - resolvedOptions.timeZone, - locales, - includeSeconds - ) + formatDateTime(realDate, resolvedOptions.timeZone, locales, includeSeconds) ); }, [locales, includeSeconds, realDate]); - return ( - - {formattedDateTime.replace(/\s/g, String.fromCharCode(32))} - - ); + return {formattedDateTime.replace(/\s/g, String.fromCharCode(32))}; }; function formatDateTime( @@ -69,36 +49,20 @@ export const DateTimeAccurate = ({ date, timeZone = "UTC" }: DateTimeProps) => { const realDate = typeof date === "string" ? new Date(date) : date; - const initialFormattedDateTime = formatDateTimeAccurate( - realDate, - timeZone, - locales - ); + const initialFormattedDateTime = formatDateTimeAccurate(realDate, timeZone, locales); - const [formattedDateTime, setFormattedDateTime] = useState( - initialFormattedDateTime - ); + const [formattedDateTime, setFormattedDateTime] = useState(initialFormattedDateTime); useEffect(() => { const resolvedOptions = Intl.DateTimeFormat().resolvedOptions(); - setFormattedDateTime( - formatDateTimeAccurate(realDate, resolvedOptions.timeZone, locales) - ); + setFormattedDateTime(formatDateTimeAccurate(realDate, resolvedOptions.timeZone, locales)); }, [locales, realDate]); - return ( - - {formattedDateTime.replace(/\s/g, String.fromCharCode(32))} - - ); + return {formattedDateTime.replace(/\s/g, String.fromCharCode(32))}; }; -function formatDateTimeAccurate( - date: Date, - timeZone: string, - locales: string[] -): string { +function formatDateTimeAccurate(date: Date, timeZone: string, locales: string[]): string { const milliseconds = `00${date.getMilliseconds()}`.slice(-3); const formattedDateTime = new Intl.DateTimeFormat(locales, { diff --git a/apps/webapp/app/components/primitives/Dialog.tsx b/apps/webapp/app/components/primitives/Dialog.tsx index d174ac0e5..c553a977f 100644 --- a/apps/webapp/app/components/primitives/Dialog.tsx +++ b/apps/webapp/app/components/primitives/Dialog.tsx @@ -9,11 +9,7 @@ const Dialog = DialogPrimitive.Root; const DialogTrigger = DialogPrimitive.Trigger; -const DialogPortal = ({ - className, - children, - ...props -}: DialogPrimitive.DialogPortalProps) => ( +const DialogPortal = ({ className, children, ...props }: DialogPrimitive.DialogPortalProps) => (
{children} @@ -61,29 +57,14 @@ const DialogContent = React.forwardRef< )); DialogContent.displayName = DialogPrimitive.Content.displayName; -const DialogHeader = ({ - className, - ...props -}: React.HTMLAttributes) => ( -
+const DialogHeader = ({ className, ...props }: React.HTMLAttributes) => ( +
); DialogHeader.displayName = "DialogHeader"; -const DialogFooter = ({ - className, - ...props -}: React.HTMLAttributes) => ( +const DialogFooter = ({ className, ...props }: React.HTMLAttributes) => (
); @@ -95,10 +76,7 @@ const DialogTitle = React.forwardRef< >(({ className, ...props }, ref) => ( )); diff --git a/apps/webapp/app/components/primitives/Fieldset.tsx b/apps/webapp/app/components/primitives/Fieldset.tsx index 803394222..6266bd5da 100644 --- a/apps/webapp/app/components/primitives/Fieldset.tsx +++ b/apps/webapp/app/components/primitives/Fieldset.tsx @@ -7,7 +7,5 @@ export function Fieldset({ children: React.ReactNode; className?: string; }) { - return ( -
{children}
- ); + return
{children}
; } diff --git a/apps/webapp/app/components/primitives/FormError.tsx b/apps/webapp/app/components/primitives/FormError.tsx index df370e26d..79d537d74 100644 --- a/apps/webapp/app/components/primitives/FormError.tsx +++ b/apps/webapp/app/components/primitives/FormError.tsx @@ -3,13 +3,7 @@ import { Paragraph } from "./Paragraph"; import { NamedIcon } from "./NamedIcon"; import { motion } from "framer-motion"; -export function FormError({ - children, - id, -}: { - children: React.ReactNode; - id?: string; -}) { +export function FormError({ children, id }: { children: React.ReactNode; id?: string }) { return ( <> {children && ( @@ -29,13 +23,7 @@ export function FormError({ ); } -export function ZodFormErrors({ - errors, - path, -}: { - errors: z.ZodIssue[]; - path: string[]; -}) { +export function ZodFormErrors({ errors, path }: { errors: z.ZodIssue[]; path: string[] }) { if (errors.length === 0) { return null; } diff --git a/apps/webapp/app/components/primitives/FormSegmentedControl.tsx b/apps/webapp/app/components/primitives/FormSegmentedControl.tsx index eabba496d..68929bc73 100644 --- a/apps/webapp/app/components/primitives/FormSegmentedControl.tsx +++ b/apps/webapp/app/components/primitives/FormSegmentedControl.tsx @@ -54,10 +54,7 @@ export default function FormSegmentedControl({
{option.label} diff --git a/apps/webapp/app/components/primitives/Headers.tsx b/apps/webapp/app/components/primitives/Headers.tsx index aea090a2f..b1d5187a8 100644 --- a/apps/webapp/app/components/primitives/Headers.tsx +++ b/apps/webapp/app/components/primitives/Headers.tsx @@ -40,9 +40,7 @@ export function Header1({ className={cn( headerVariants.header1.text, spacing === true && headerVariants.header1.spacing, - textColor === "bright" - ? textColorVariants.bright - : textColorVariants.dimmed, + textColor === "bright" ? textColorVariants.bright : textColorVariants.dimmed, className )} > @@ -62,9 +60,7 @@ export function Header2({ className={cn( headerVariants.header2.text, spacing === true && headerVariants.header2.spacing, - textColor === "bright" - ? textColorVariants.bright - : textColorVariants.dimmed, + textColor === "bright" ? textColorVariants.bright : textColorVariants.dimmed, className )} > @@ -84,9 +80,7 @@ export function Header3({ className={cn( headerVariants.header3.text, spacing === true && headerVariants.header3.spacing, - textColor === "bright" - ? textColorVariants.bright - : textColorVariants.dimmed, + textColor === "bright" ? textColorVariants.bright : textColorVariants.dimmed, className )} > diff --git a/apps/webapp/app/components/primitives/Help.tsx b/apps/webapp/app/components/primitives/Help.tsx index 4025c808c..da126acba 100644 --- a/apps/webapp/app/components/primitives/Help.tsx +++ b/apps/webapp/app/components/primitives/Help.tsx @@ -29,11 +29,7 @@ function useHelp() { return React.useContext(HelpContext); } -export function Help({ - defaultOpen, - allowDismissing = true, - children, -}: HelpProps) { +export function Help({ defaultOpen, allowDismissing = true, children }: HelpProps) { const [open, setOpen] = React.useState(defaultOpen || false); return ( diff --git a/apps/webapp/app/components/primitives/Input.tsx b/apps/webapp/app/components/primitives/Input.tsx index ea90b65bc..39fe60b68 100644 --- a/apps/webapp/app/components/primitives/Input.tsx +++ b/apps/webapp/app/components/primitives/Input.tsx @@ -50,18 +50,7 @@ export type InputProps = React.InputHTMLAttributes & { }; const Input = React.forwardRef( - ( - { - className, - type, - shortcut, - fullWidth = true, - variant = "medium", - icon, - ...props - }, - ref - ) => { + ({ className, type, shortcut, fullWidth = true, variant = "medium", icon, ...props }, ref) => { const inputClassName = variants[variant].input; const iconClassName = variants[variant].iconSize; const iconOffsetClassName = variants[variant].iconOffset; @@ -70,25 +59,16 @@ const Input = React.forwardRef(
{icon && (
- +
)} - {shortcut && ( -
{shortcut}
- )} + {shortcut &&
{shortcut}
}
); } diff --git a/apps/webapp/app/components/primitives/InputGroup.tsx b/apps/webapp/app/components/primitives/InputGroup.tsx index d8623ab26..0d18f2115 100644 --- a/apps/webapp/app/components/primitives/InputGroup.tsx +++ b/apps/webapp/app/components/primitives/InputGroup.tsx @@ -6,11 +6,7 @@ type InputGroupProps = { fullWidth?: boolean; }; -export function InputGroup({ - children, - className, - fullWidth, -}: InputGroupProps) { +export function InputGroup({ children, className, fullWidth }: InputGroupProps) { return (
& { variant?: keyof typeof labelVariants; }; -export function Label({ - className, - children, - variant = "medium", - ...props -}: LabelProps) { +export function Label({ className, children, variant = "medium", ...props }: LabelProps) { const variation = labelVariants[variant]; return (
); } diff --git a/apps/webapp/app/components/primitives/OperatingSystemProvider.tsx b/apps/webapp/app/components/primitives/OperatingSystemProvider.tsx index 251c7e8dc..c59be8b16 100644 --- a/apps/webapp/app/components/primitives/OperatingSystemProvider.tsx +++ b/apps/webapp/app/components/primitives/OperatingSystemProvider.tsx @@ -23,9 +23,7 @@ export const OperatingSystemContextProvider = ({ }; const throwIfNoProvider = () => { - throw new Error( - "Please wrap your application in an OperatingSystemContextProvider." - ); + throw new Error("Please wrap your application in an OperatingSystemContextProvider."); }; export const useOperatingSystem = () => { diff --git a/apps/webapp/app/components/primitives/PageHeader.tsx b/apps/webapp/app/components/primitives/PageHeader.tsx index f165dbc19..4a0842ebd 100644 --- a/apps/webapp/app/components/primitives/PageHeader.tsx +++ b/apps/webapp/app/components/primitives/PageHeader.tsx @@ -11,17 +11,9 @@ type WithChildren = { children: React.ReactNode; }; -export function PageHeader({ - children, - hideBorder, -}: WithChildren & { hideBorder?: boolean }) { +export function PageHeader({ children, hideBorder }: WithChildren & { hideBorder?: boolean }) { return ( -
+
{children}
); @@ -49,10 +41,7 @@ export function PageTitle({ title, backButton }: PageTitleProps) { className="flex items-center gap-1 text-slate-400 transition group-hover:text-white" > - + {backButton.text} @@ -107,16 +96,9 @@ export function PageInfoProperty({ }) { return (
- {icon && typeof icon === "string" ? ( - - ) : ( - icon - )} + {icon && typeof icon === "string" ? : icon} {label && ( - + {label}: )} diff --git a/apps/webapp/app/components/primitives/Pagination.tsx b/apps/webapp/app/components/primitives/Pagination.tsx index 356d12cb0..5367c0229 100644 --- a/apps/webapp/app/components/primitives/Pagination.tsx +++ b/apps/webapp/app/components/primitives/Pagination.tsx @@ -43,11 +43,8 @@ export function PaginationControls({

- Showing{" "} - - {(currentPage - 1) * pageSize + 1} - {" "} - to {currentPage * pageSize} of{" "} + Showing {(currentPage - 1) * pageSize + 1} to{" "} + {currentPage * pageSize} of{" "} {totalResults} results

@@ -86,10 +83,7 @@ export function PaginationControls({ ); } -function pageUrl( - location: ReturnType, - page: number -): string { +function pageUrl(location: ReturnType, page: number): string { const search = new URLSearchParams(location.search); search.set("page", String(page)); @@ -101,8 +95,7 @@ const baseClass = "relative inline-flex items-center border px-3.5 py-2 text-xs font-medium focus:z-20 transition"; const unselectedClass = "bg-slate-700/20 border-slate-500 text-slate-400 hover:bg-slate-400 hover:text-slate-900"; -const selectedClass = - "z-10 bg-slate-500 border-slate-500 hover:bg-slate-400 text-slate-900"; +const selectedClass = "z-10 bg-slate-500 border-slate-500 hover:bg-slate-400 text-slate-900"; function PageLinkComponent({ page, @@ -114,19 +107,13 @@ function PageLinkComponent({ if (page.type === "specific") { if (page.isCurrent) { return ( - + {page.page} ); } else { return ( - + {page.page} ); @@ -154,10 +141,7 @@ type SpecificPageLink = { // If there are less than or equal to 6 pages, just show all the pages. // If there are more than 5 pages, show the first 3, the current page, and the last 3. -function calculatePageLinks( - currentPage: number, - totalPages: number -): Array { +function calculatePageLinks(currentPage: number, totalPages: number): Array { const pageLinks: Array = []; if (totalPages <= 10) { diff --git a/apps/webapp/app/components/primitives/Popover.tsx b/apps/webapp/app/components/primitives/Popover.tsx index 217490571..05707cf8b 100644 --- a/apps/webapp/app/components/primitives/Popover.tsx +++ b/apps/webapp/app/components/primitives/Popover.tsx @@ -35,10 +35,7 @@ PopoverContent.displayName = PopoverPrimitive.Content.displayName; function PopoverSectionHeader({ title }: { title: string }) { return ( - + {title} ); @@ -63,9 +60,7 @@ function PopoverMenuItem({ fullWidth textAlignLeft TrailingIcon={isSelected ? "check" : undefined} - className={ - isSelected ? "bg-slate-750 group-hover:bg-slate-750" : undefined - } + className={isSelected ? "bg-slate-750 group-hover:bg-slate-750" : undefined} > {title} @@ -77,9 +72,7 @@ function PopoverArrowTrigger({ children, className, ...props -}: { isOpen?: boolean } & React.ComponentPropsWithoutRef< - typeof PopoverTrigger ->) { +}: { isOpen?: boolean } & React.ComponentPropsWithoutRef) { return ( - + {children} ); diff --git a/apps/webapp/app/components/primitives/RadioButton.tsx b/apps/webapp/app/components/primitives/RadioButton.tsx index 809bc314e..b9a0effb3 100644 --- a/apps/webapp/app/components/primitives/RadioButton.tsx +++ b/apps/webapp/app/components/primitives/RadioButton.tsx @@ -45,9 +45,7 @@ export const RadioGroup = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => { - return ( - - ); + return ; }); type RadioGroupItemProps = Omit< @@ -64,67 +62,48 @@ type RadioGroupItemProps = Omit< export const RadioGroupItem = React.forwardRef< React.ElementRef, RadioGroupItemProps ->( - ( - { - className, - children, - variant = "simple", - label, - description, - badges, - ...props - }, - ref - ) => { - const variation = variants[variant]; +>(({ className, children, variant = "simple", label, description, badges, ...props }, ref) => { + const variation = variants[variant]; - return ( - +
-
- - - -
-
-
- - {badges && ( - - {badges.map((badge) => ( - {badge} - ))} - - )} -
- {variant === "description" && ( - - {description} - + + + +
+
+
+ + {badges && ( + + {badges.map((badge) => ( + {badge} + ))} + )}
- - ); - } -); + {variant === "description" && ( + + {description} + + )} +
+ + ); +}); diff --git a/apps/webapp/app/components/primitives/Select.tsx b/apps/webapp/app/components/primitives/Select.tsx index f06f4dc71..a307b38a3 100644 --- a/apps/webapp/app/components/primitives/Select.tsx +++ b/apps/webapp/app/components/primitives/Select.tsx @@ -6,8 +6,7 @@ import { Check, ChevronDown } from "lucide-react"; import { cn } from "~/utils/cn"; const sizes = { - "secondary/small": - "text-xs h-6 bg-tertiary hover:bg-tertiary-foreground pr-2 pl-1 bg-slate-800", + "secondary/small": "text-xs h-6 bg-tertiary hover:bg-tertiary-foreground pr-2 pl-1 bg-slate-800", medium: "text-sm h-8 bg-slate-850 border border-slate-800 hover:bg-slate-800 hover:border-slate-750 px-2.5", }; @@ -23,41 +22,30 @@ const SelectValue = SelectPrimitive.Value; const SelectTrigger = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef & SelectProps ->( - ( - { - className, - children, - width = "content", - size = "secondary/small", - ...props - }, - ref - ) => { - const sizeClassName = sizes[size]; - return ( - - {children} - - - - - ); - } -); +>(({ className, children, width = "content", size = "secondary/small", ...props }, ref) => { + const sizeClassName = sizes[size]; + return ( + + {children} + + + + + ); +}); SelectTrigger.displayName = SelectPrimitive.Trigger.displayName; const SelectContent = React.forwardRef< diff --git a/apps/webapp/app/components/primitives/Sheet.tsx b/apps/webapp/app/components/primitives/Sheet.tsx index e92893ed5..f0b9ecf33 100644 --- a/apps/webapp/app/components/primitives/Sheet.tsx +++ b/apps/webapp/app/components/primitives/Sheet.tsx @@ -28,12 +28,7 @@ interface SheetPortalProps extends SheetPrimitive.DialogPortalProps, VariantProps {} -const SheetPortal = ({ - position, - className, - children, - ...props -}: SheetPortalProps) => ( +const SheetPortal = ({ position, className, children, ...props }: SheetPortalProps) => (
{children}
@@ -166,19 +161,14 @@ const SheetContent = React.forwardRef<
-
- {children} -
+
{children}
)); SheetContent.displayName = SheetPrimitive.Content.displayName; -export const SheetBody = ({ - className, - ...props -}: React.HTMLAttributes) => ( +export const SheetBody = ({ className, ...props }: React.HTMLAttributes) => (
); -export const SheetHeader = ({ - className, - ...props -}: React.HTMLAttributes) => ( +export const SheetHeader = ({ className, ...props }: React.HTMLAttributes) => (
- + & { +type SwitchProps = React.ComponentPropsWithoutRef & { label?: React.ReactNode; variant: keyof typeof variations; }; -export const Switch = React.forwardRef< - React.ElementRef, - SwitchProps ->(({ className, variant, label, ...props }, ref) => { - const { container, root, thumb, text } = variations[variant]; +export const Switch = React.forwardRef, SwitchProps>( + ({ className, variant, label, ...props }, ref) => { + const { container, root, thumb, text } = variations[variant]; - return ( - - {label ? ( - - ) : null} -
- + {label ? ( + + ) : null} +
-
- - ); -}); + > + +
+
+ ); + } +); diff --git a/apps/webapp/app/components/primitives/Table.tsx b/apps/webapp/app/components/primitives/Table.tsx index 3ed8da071..1e9293562 100644 --- a/apps/webapp/app/components/primitives/Table.tsx +++ b/apps/webapp/app/components/primitives/Table.tsx @@ -18,10 +18,7 @@ export const Table = forwardRef( containerClassName )} > - +
{children}
@@ -34,23 +31,18 @@ type TableHeaderProps = { children: ReactNode; }; -export const TableHeader = forwardRef< - HTMLTableSectionElement, - TableHeaderProps ->(({ className, children }, ref) => { - return ( - - {children} - - ); -}); +export const TableHeader = forwardRef( + ({ className, children }, ref) => { + return ( + + {children} + + ); + } +); type TableBodyProps = { className?: string; @@ -60,10 +52,7 @@ type TableBodyProps = { export const TableBody = forwardRef( ({ className, children }, ref) => { return ( - + {children} ); @@ -96,14 +85,8 @@ type TableHeaderCellProps = TableCellBasicProps & { hiddenLabel?: boolean; }; -export const TableHeaderCell = forwardRef< - HTMLTableCellElement, - TableHeaderCellProps ->( - ( - { className, alignment = "left", children, colSpan, hiddenLabel = false }, - ref - ) => { +export const TableHeaderCell = forwardRef( + ({ className, alignment = "left", children, colSpan, hiddenLabel = false }, ref) => { let alignmentClassName = "text-left"; switch (alignment) { case "center": @@ -193,13 +176,7 @@ export const TableCellChevron = forwardRef< } >(({ className, to, onClick }, ref) => { return ( - + ); @@ -211,18 +188,14 @@ type TableBlankRowProps = { children: ReactNode; }; -export const TableBlankRow = forwardRef< - HTMLTableRowElement, - TableBlankRowProps ->(({ children, colSpan, className }, ref) => { - return ( - - - {children} - - - ); -}); +export const TableBlankRow = forwardRef( + ({ children, colSpan, className }, ref) => { + return ( + + + {children} + + + ); + } +); diff --git a/apps/webapp/app/components/primitives/Tabs.tsx b/apps/webapp/app/components/primitives/Tabs.tsx index 8ac6d8d9f..e5a79af21 100644 --- a/apps/webapp/app/components/primitives/Tabs.tsx +++ b/apps/webapp/app/components/primitives/Tabs.tsx @@ -12,19 +12,9 @@ export type TabsProps = { export function Tabs({ tabs, className }: TabsProps) { return ( -
+
{tabs.map((tab, index) => ( - + {({ isActive, isPending }) => ( <> {isActive || isPending ? ( - + ) : (
)} diff --git a/apps/webapp/app/components/primitives/TextLink.tsx b/apps/webapp/app/components/primitives/TextLink.tsx index e0b128f4b..5762d9f05 100644 --- a/apps/webapp/app/components/primitives/TextLink.tsx +++ b/apps/webapp/app/components/primitives/TextLink.tsx @@ -34,20 +34,14 @@ export function TextLink({ {children}{" "} {trailingIcon && ( - + )} ) : href ? ( {children}{" "} {trailingIcon && ( - + )} ) : ( diff --git a/apps/webapp/app/components/primitives/Toast.tsx b/apps/webapp/app/components/primitives/Toast.tsx index 629b1276d..133bf6507 100644 --- a/apps/webapp/app/components/primitives/Toast.tsx +++ b/apps/webapp/app/components/primitives/Toast.tsx @@ -21,16 +21,12 @@ export function Toast() { switch (type) { case "success": toast.success(message, { - duration: options.ephemeral - ? defaultToastDuration - : permanentToastDuration, + duration: options.ephemeral ? defaultToastDuration : permanentToastDuration, }); break; case "error": toast.error(message, { - duration: options.ephemeral - ? defaultToastDuration - : permanentToastDuration, + duration: options.ephemeral ? defaultToastDuration : permanentToastDuration, }); break; default: diff --git a/apps/webapp/app/components/primitives/Tooltip.tsx b/apps/webapp/app/components/primitives/Tooltip.tsx index e726dc398..6031caa63 100644 --- a/apps/webapp/app/components/primitives/Tooltip.tsx +++ b/apps/webapp/app/components/primitives/Tooltip.tsx @@ -9,9 +9,7 @@ const TooltipProvider = TooltipPrimitive.Provider; const TooltipArrow = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef ->(({ ...props }, ref) => ( - -)); +>(({ ...props }, ref) => ); TooltipArrow.displayName = TooltipPrimitive.Arrow.displayName; const Tooltip = React.forwardRef< @@ -63,11 +61,4 @@ function SimpleTooltip({ ); } -export { - Tooltip, - TooltipTrigger, - TooltipContent, - TooltipProvider, - TooltipArrow, - SimpleTooltip, -}; +export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider, TooltipArrow, SimpleTooltip }; diff --git a/apps/webapp/app/components/run/RunCard.tsx b/apps/webapp/app/components/run/RunCard.tsx index 148b38aab..1731622c2 100644 --- a/apps/webapp/app/components/run/RunCard.tsx +++ b/apps/webapp/app/components/run/RunCard.tsx @@ -63,22 +63,12 @@ export function RunPanelHeader({
- {typeof icon === "string" ? ( - - ) : ( - icon - )} - {typeof title === "string" ? ( - {title} - ) : ( - title - )} + {typeof icon === "string" ? : icon} + {typeof title === "string" ? {title} : title}
{accessory}
@@ -111,18 +101,9 @@ const variantClasses: Record = { debug: "", }; -export function RunPanelDescription({ - text, - variant, -}: { - text: string; - variant?: string; -}) { +export function RunPanelDescription({ text, variant }: { text: string; variant?: string }) { return ( - + {text} ); @@ -155,11 +136,7 @@ export function RunPanelIconSection({ children: React.ReactNode; className?: string; }) { - return ( -
- {children} -
- ); + return
{children}
; } export function RunPanelDivider() { @@ -178,11 +155,7 @@ export function RunPanelIconProperty({ return (
- {typeof icon === "string" ? ( - - ) : ( - icon - )} + {typeof icon === "string" ? : icon}
{label} @@ -205,9 +178,7 @@ export function RunPanelProperties({
@@ -220,10 +191,7 @@ export function RunPanelProperties({ export function TaskSeparator({ depth }: { depth: number }) { return ( -
+
); } diff --git a/apps/webapp/app/components/run/RunCompletedDetail.tsx b/apps/webapp/app/components/run/RunCompletedDetail.tsx index ed85bb515..447dc6698 100644 --- a/apps/webapp/app/components/run/RunCompletedDetail.tsx +++ b/apps/webapp/app/components/run/RunCompletedDetail.tsx @@ -52,18 +52,11 @@ export function RunCompletedDetail({ run }: { run: MatchedRun }) { )} - {run.error && ( - - )} + {run.error && } {run.output ? ( ) : ( - run.output === null && ( - This run returned nothing - ) + run.output === null && This run returned nothing )} diff --git a/apps/webapp/app/components/run/RunOverview.tsx b/apps/webapp/app/components/run/RunOverview.tsx index c753370c4..7e9689580 100644 --- a/apps/webapp/app/components/run/RunOverview.tsx +++ b/apps/webapp/app/components/run/RunOverview.tsx @@ -17,11 +17,7 @@ import { cancelSchema } from "~/routes/resources.runs.$runId.cancel"; import { schema } from "~/routes/resources.runs.$runId.rerun"; import { formatDuration } from "~/utils"; import { cn } from "~/utils/cn"; -import { - runCompletedPath, - runTaskPath, - runTriggerPath, -} from "~/utils/pathBuilder"; +import { runCompletedPath, runTaskPath, runTriggerPath } from "~/utils/pathBuilder"; import { CodeBlock } from "../code/CodeBlock"; import { EnvironmentLabel } from "../environments/EnvironmentLabel"; import { PageBody, PageContainer } from "../layout/AppLayout"; @@ -78,12 +74,7 @@ type RunOverviewProps = { const taskPattern = /\/tasks\/(.*)/; -export function RunOverview({ - run, - trigger, - showRerun, - paths, -}: RunOverviewProps) { +export function RunOverview({ run, trigger, showRerun, paths }: RunOverviewProps) { const navigate = useNavigate(); const pathName = usePathName(); @@ -144,19 +135,9 @@ export function RunOverview({ - ) : ( - "Not started yet" - ) - } - /> - : "Not started yet"} /> + } @@ -186,10 +167,7 @@ export function RunOverview({ @@ -226,12 +204,7 @@ export function RunOverview({ onClick={() => navigate(runCompletedPath(paths.run))} > - } + icon={} title={ @@ -258,34 +231,21 @@ export function RunOverview({ )} {run.error && ( - + )} {run.output ? ( - + ) : ( run.output === null && ( - - This Run returned nothing. - + This Run returned nothing. ) )} @@ -297,11 +257,7 @@ export function RunOverview({ {/* Detail view */}
Detail - {selectedId ? ( - - ) : ( - Select a task or trigger - )} + {selectedId ? : Select a task or trigger}
@@ -318,9 +274,7 @@ function BlankTasks({ }) { switch (basicStatus) { case "COMPLETED": - return ( - There were no tasks for this run. - ); + return There were no tasks for this run.; case "FAILED": return No tasks were run.; case "WAITING": @@ -335,9 +289,7 @@ function BlankTasks({
); default: - return ( - There were no tasks for this run. - ); + return There were no tasks for this run.; } } @@ -370,15 +322,8 @@ function RerunPopover({ - - + + {environmentType === "PRODUCTION" && ( This will rerun this Job in your Production environment. @@ -399,8 +344,8 @@ function RerunPopover({ - Start a brand new job run with the same Trigger data as this - one. This will re-do every task. + Start a brand new job run with the same Trigger data as this one. This will re-do + every task.
{status === "FAILED" && ( @@ -417,8 +362,8 @@ function RerunPopover({ - Continue running this job run from where it left off. This - will skip any task that has already been completed. + Continue running this job run from where it left off. This will skip any task that + has already been completed.
)} @@ -442,19 +387,11 @@ export function CancelRun({ runId }: { runId: string }) { }, }); - const isLoading = - navigation.state === "submitting" && navigation.formData !== undefined; + const isLoading = navigation.state === "submitting" && navigation.formData !== undefined; return ( - - + + )}
- {(!isLast || expanded) && ( - - )} + {(!isLast || expanded) && } {subtasks && subtasks.length > 0 && diff --git a/apps/webapp/app/components/run/TaskCardSkeleton.tsx b/apps/webapp/app/components/run/TaskCardSkeleton.tsx index f682fdbeb..47db3abec 100644 --- a/apps/webapp/app/components/run/TaskCardSkeleton.tsx +++ b/apps/webapp/app/components/run/TaskCardSkeleton.tsx @@ -5,9 +5,7 @@ export function TaskCardSkeleton() { - } + title={
} />
diff --git a/apps/webapp/app/components/run/TaskDetail.tsx b/apps/webapp/app/components/run/TaskDetail.tsx index 50678503b..efa68214d 100644 --- a/apps/webapp/app/components/run/TaskDetail.tsx +++ b/apps/webapp/app/components/run/TaskDetail.tsx @@ -49,20 +49,11 @@ export function TaskDetail({ task }: { task: DetailedTask }) { return ( - } + icon={} title={} accessory={ - + } /> @@ -104,9 +95,7 @@ export function TaskDetail({ task }: { task: DetailedTask }) { )} - {description && ( - - )} + {description && } {properties.length > 0 && (
Properties @@ -153,10 +142,7 @@ export function TaskDetail({ task }: { task: DetailedTask }) {
Input {params ? ( - + ) : ( No input )} diff --git a/apps/webapp/app/components/run/TaskStatus.tsx b/apps/webapp/app/components/run/TaskStatus.tsx index 389a25039..6a861516f 100644 --- a/apps/webapp/app/components/run/TaskStatus.tsx +++ b/apps/webapp/app/components/run/TaskStatus.tsx @@ -15,48 +15,24 @@ type TaskStatusIconProps = { minimal?: boolean; }; -export function TaskStatusIcon({ - status, - className, - minimal = false, -}: TaskStatusIconProps) { +export function TaskStatusIcon({ status, className, minimal = false }: TaskStatusIconProps) { switch (status) { case "COMPLETED": return minimal ? ( - + ) : ( - + ); case "PENDING": - return ( - - ); + return ; case "WAITING": - return ( - - ); + return ; case "RUNNING": - return ( - - ); + return ; case "ERRORED": - return ( - - ); + return ; case "CANCELED": - return ( - - ); + return ; } } diff --git a/apps/webapp/app/components/runs/RunStatuses.tsx b/apps/webapp/app/components/runs/RunStatuses.tsx index 944cc99bd..0a2e16827 100644 --- a/apps/webapp/app/components/runs/RunStatuses.tsx +++ b/apps/webapp/app/components/runs/RunStatuses.tsx @@ -31,82 +31,35 @@ export function RunStatus({ status }: { status: JobRunStatus }) { } export function RunStatusLabel({ status }: { status: JobRunStatus }) { - return ( - - {runStatusTitle(status)} - - ); + return {runStatusTitle(status)}; } -export function RunStatusIcon({ - status, - className, -}: { - status: JobRunStatus; - className: string; -}) { +export function RunStatusIcon({ status, className }: { status: JobRunStatus; className: string }) { switch (status) { case "SUCCESS": - return ( - - ); + return ; case "PENDING": - return ( - - ); + return ; case "QUEUED": - return ( - - ); + return ; case "STARTED": - return ( - - ); + return ; case "FAILURE": - return ( - - ); + return ; case "TIMED_OUT": - return ( - - ); + return ; case "WAITING_ON_CONNECTIONS": - return ( - - ); + return ; case "ABORTED": - return ( - - ); + return ; case "PREPROCESSING": - return ( - - ); + return ; case "CANCELED": - return ( - - ); + return ; } } -export type RunBasicStatus = - | "WAITING" - | "PENDING" - | "RUNNING" - | "COMPLETED" - | "FAILED"; +export type RunBasicStatus = "WAITING" | "PENDING" | "RUNNING" | "COMPLETED" | "FAILED"; export function runBasicStatus(status: JobRunStatus): RunBasicStatus { switch (status) { diff --git a/apps/webapp/app/components/runs/RunsTable.tsx b/apps/webapp/app/components/runs/RunsTable.tsx index 0ef899b0a..87d060e1a 100644 --- a/apps/webapp/app/components/runs/RunsTable.tsx +++ b/apps/webapp/app/components/runs/RunsTable.tsx @@ -5,12 +5,7 @@ import { useOrganization } from "~/hooks/useOrganizations"; import { useProject } from "~/hooks/useProject"; import { RunList } from "~/presenters/RunListPresenter.server"; import { formatDuration } from "~/utils"; -import { - JobForPath, - OrgForPath, - ProjectForPath, - jobRunDashboardPath, -} from "~/utils/pathBuilder"; +import { JobForPath, OrgForPath, ProjectForPath, jobRunDashboardPath } from "~/utils/pathBuilder"; import { EnvironmentLabel } from "../environments/EnvironmentLabel"; import { Callout } from "../primitives/Callout"; import { DateTime } from "../primitives/DateTime"; diff --git a/apps/webapp/app/components/stories/Button.stories.tsx b/apps/webapp/app/components/stories/Button.stories.tsx index e9dfd5f6d..3cf689332 100644 --- a/apps/webapp/app/components/stories/Button.stories.tsx +++ b/apps/webapp/app/components/stories/Button.stories.tsx @@ -1,13 +1,5 @@ -import { - ArrowLeftIcon, - ArrowRightIcon, - ExclamationTriangleIcon, -} from "@heroicons/react/20/solid"; -import { - ArrowUturnLeftIcon, - LightBulbIcon, - NoSymbolIcon, -} from "@heroicons/react/24/solid"; +import { ArrowLeftIcon, ArrowRightIcon, ExclamationTriangleIcon } from "@heroicons/react/20/solid"; +import { ArrowUturnLeftIcon, LightBulbIcon, NoSymbolIcon } from "@heroicons/react/24/solid"; import type { Meta, StoryObj } from "@storybook/react"; import { withDesign } from "storybook-addon-designs"; import { Button } from "../primitives/Buttons"; @@ -85,10 +77,7 @@ function ButtonList({ primary }: { primary: string }) {
Shortcut - -
@@ -154,10 +140,7 @@ function ButtonList({ primary }: { primary: string }) {
Medium buttons @@ -201,28 +184,16 @@ function ButtonList({ primary }: { primary: string }) {
Shortcut - - - -
@@ -276,10 +247,7 @@ function ButtonList({ primary }: { primary: string }) {
Large buttons @@ -305,20 +273,10 @@ function ButtonList({ primary }: { primary: string }) { Menu items
- - - -
@@ -50,11 +47,7 @@ function CalloutsSet() { This is a docs callout - } - > + }> This has a custom icon
diff --git a/apps/webapp/app/components/stories/ClipboardField.stories.tsx b/apps/webapp/app/components/stories/ClipboardField.stories.tsx index 038d0353a..bde21f635 100644 --- a/apps/webapp/app/components/stories/ClipboardField.stories.tsx +++ b/apps/webapp/app/components/stories/ClipboardField.stories.tsx @@ -28,11 +28,7 @@ function ClipboardFieldExample() { variant="tertiary/small" icon={} /> - + @@ -41,28 +37,12 @@ function ClipboardFieldExample() { variant="tertiary/medium" icon={} /> - +
- - - + + + - - - + + +
- - - + + + - - - + + + @@ -176,9 +174,7 @@ function AnimatedHighlight() { }} onMouseLeave={() => { setShouldAnimate(true); - setHighlighted( - highlightedRegions.findIndex((region) => region.range) - ); + setHighlighted(highlightedRegions.findIndex((region) => region.range)); }} > diff --git a/apps/webapp/app/components/stories/Dialog.stories.tsx b/apps/webapp/app/components/stories/Dialog.stories.tsx index cfbbe6440..a1806503b 100644 --- a/apps/webapp/app/components/stories/Dialog.stories.tsx +++ b/apps/webapp/app/components/stories/Dialog.stories.tsx @@ -34,8 +34,8 @@ export const Basic: Story = { Are you sure absolutely sure? - This action cannot be undone. This will permanently delete your - account and remove your data from our servers. + This action cannot be undone. This will permanently delete your account and remove your + data from our servers. diff --git a/apps/webapp/app/components/stories/Forms.stories.tsx b/apps/webapp/app/components/stories/Forms.stories.tsx index bab786d68..e806408cf 100644 --- a/apps/webapp/app/components/stories/Forms.stories.tsx +++ b/apps/webapp/app/components/stories/Forms.stories.tsx @@ -81,22 +81,14 @@ function Forms() { - + You must enter a project name Your Jobs will live inside this Project. + } @@ -129,8 +121,7 @@ function LoginForm() { Continue with Email - By creating an account you agree to our{" "} - terms and{" "} + By creating an account you agree to our terms and{" "} privacy policies.
@@ -148,12 +139,7 @@ function SearchForm() {
- + @@ -178,30 +164,15 @@ function SearchForm() { - + - + - +
diff --git a/apps/webapp/app/components/stories/Menus.stories.tsx b/apps/webapp/app/components/stories/Menus.stories.tsx index 319347ee9..b79f296a0 100644 --- a/apps/webapp/app/components/stories/Menus.stories.tsx +++ b/apps/webapp/app/components/stories/Menus.stories.tsx @@ -132,21 +132,11 @@ function PopoverMenu() {
- +
- +
diff --git a/apps/webapp/app/components/stories/PageHeader.stories.tsx b/apps/webapp/app/components/stories/PageHeader.stories.tsx index 1544c4ac8..eaed15a69 100644 --- a/apps/webapp/app/components/stories/PageHeader.stories.tsx +++ b/apps/webapp/app/components/stories/PageHeader.stories.tsx @@ -42,34 +42,22 @@ function PageHeaders() { - + Create a new Organization - Create new Organizations and new Projects to help organize your - Jobs. + Create new Organizations and new Projects to help organize your Jobs.
- + - + Create a new Organization diff --git a/apps/webapp/app/components/stories/RadioGroup.stories.tsx b/apps/webapp/app/components/stories/RadioGroup.stories.tsx index 173b11102..94fecc833 100644 --- a/apps/webapp/app/components/stories/RadioGroup.stories.tsx +++ b/apps/webapp/app/components/stories/RadioGroup.stories.tsx @@ -31,19 +31,9 @@ function RadioGroupExample() {
- + - +
Simple Tooltip: - } - content="Copy" - /> + } content="Copy" />
); diff --git a/apps/webapp/app/components/stories/Typography.stories.tsx b/apps/webapp/app/components/stories/Typography.stories.tsx index fceed8673..6e0a92f8d 100644 --- a/apps/webapp/app/components/stories/Typography.stories.tsx +++ b/apps/webapp/app/components/stories/Typography.stories.tsx @@ -60,52 +60,48 @@ function Typography({ header1, header2, header3, paragraph }: TypographyProps) { {paragraph} {paragraph} {paragraph} - - {paragraph} - + {paragraph}
Text Link - This is an anchor tag component called - TextLink. It takes an href and children. + This is an anchor tag component called TextLink. It takes an + href and children. Learn how to get{" "} started quickly {" "} - using the included some example Jobs which are great as a quick start - project. You can check them out in your project here in - triggerdotdev/jobs/examples. You can also see the examples in more - detail in the docs. + using the included some example Jobs which are great as a quick start project. You can + check them out in your project here in triggerdotdev/jobs/examples. You can also see the + examples in more detail in the docs.
Custom event JSON payload - Write your Job code. Jobs can be triggered on a schedule, via a - webhook, custom event and have delays of up to 1 year. Learn how to - create your first Job in code using the docs here. + Write your Job code. Jobs can be triggered on a schedule, via a webhook, custom event and + have delays of up to 1 year. Learn how to create your first Job in code using the docs + here. - Learn how to get started quickly using the included some example Jobs - which are great as a quick start project. You can check them out in - your project here in triggerdotdev/jobs/examples. You can also see the - examples in more detail in the docs. + Learn how to get started quickly using the included some example Jobs which are great as a + quick start project. You can check them out in your project here in + triggerdotdev/jobs/examples. You can also see the examples in more detail in the docs.
Scopes - Select the scopes you want to grant to Slack in order for it to access - your data. If you try and perform an action in a Job that requires a - scope you haven’t granted, that task will fail. + Select the scopes you want to grant to Slack in order for it to access your data. If you + try and perform an action in a Job that requires a scope you haven’t granted, that task + will fail. - Select the scopes you want to grant to Slack in order for it to access - your data. If you try and perform an action in a Job that requires a - scope you haven’t granted, that task will fail. + Select the scopes you want to grant to Slack in order for it to access your data. If you + try and perform an action in a Job that requires a scope you haven’t granted, that task + will fail.
diff --git a/apps/webapp/app/db.server.ts b/apps/webapp/app/db.server.ts index c92e706dc..9361447d5 100644 --- a/apps/webapp/app/db.server.ts +++ b/apps/webapp/app/db.server.ts @@ -10,20 +10,13 @@ export type PrismaTransactionClient = Omit< export type PrismaClientOrTransaction = PrismaClient | PrismaTransactionClient; -function isTransactionClient( - prisma: PrismaClientOrTransaction -): prisma is PrismaTransactionClient { +function isTransactionClient(prisma: PrismaClientOrTransaction): prisma is PrismaTransactionClient { return !("$transaction" in prisma); } -function isPrismaKnownError( - error: unknown -): error is Prisma.PrismaClientKnownRequestError { +function isPrismaKnownError(error: unknown): error is Prisma.PrismaClientKnownRequestError { return ( - typeof error === "object" && - error !== null && - "code" in error && - typeof error.code === "string" + typeof error === "object" && error !== null && "code" in error && typeof error.code === "string" ); } @@ -95,9 +88,7 @@ function getClient() { const urlWithoutCredentials = new URL(DATABASE_URL); urlWithoutCredentials.password = ""; - console.log( - `🔌 setting up prisma client to ${urlWithoutCredentials.toString()}` - ); + console.log(`🔌 setting up prisma client to ${urlWithoutCredentials.toString()}`); const client = new PrismaClient({ datasources: { diff --git a/apps/webapp/app/entry.server.tsx b/apps/webapp/app/entry.server.tsx index c416d183b..361aa9164 100644 --- a/apps/webapp/app/entry.server.tsx +++ b/apps/webapp/app/entry.server.tsx @@ -28,9 +28,7 @@ export default function handleRequest( }); //get whether it's a mac or pc from the headers - const platform: OperatingSystemPlatform = request.headers - .get("user-agent") - ?.includes("Mac") + const platform: OperatingSystemPlatform = request.headers.get("user-agent")?.includes("Mac") ? "mac" : "windows"; @@ -70,11 +68,7 @@ function serveTheBots( const { pipe, abort } = renderToPipeableStream( - + , { @@ -113,11 +107,7 @@ function serveBrowsers( const { pipe, abort } = renderToPipeableStream( - + , { @@ -153,10 +143,7 @@ if (env.HIGHLIGHT_PROJECT_ID) { H.init({ projectID: env.HIGHLIGHT_PROJECT_ID }); } -export function handleError( - error: unknown, - { request, params, context }: DataFunctionArgs -) { +export function handleError(error: unknown, { request, params, context }: DataFunctionArgs) { logError(error, request); } @@ -166,9 +153,7 @@ Worker.init().catch((error) => { function logError(error: unknown, request?: Request) { if (env.HIGHLIGHT_PROJECT_ID) { - const parsed = request - ? H.parseHeaders(Object.fromEntries(request.headers)) - : undefined; + const parsed = request ? H.parseHeaders(Object.fromEntries(request.headers)) : undefined; if (error instanceof Error) { H.consumeError(error, parsed?.secureSessionId, parsed?.requestId); } else { diff --git a/apps/webapp/app/env.server.ts b/apps/webapp/app/env.server.ts index 062db56c4..2ca7b4c6a 100644 --- a/apps/webapp/app/env.server.ts +++ b/apps/webapp/app/env.server.ts @@ -2,11 +2,7 @@ import { z } from "zod"; import { SecretStoreOptionsSchema } from "./services/secrets/secretStore.server"; const EnvironmentSchema = z.object({ - NODE_ENV: z.union([ - z.literal("development"), - z.literal("production"), - z.literal("test"), - ]), + NODE_ENV: z.union([z.literal("development"), z.literal("production"), z.literal("test")]), DATABASE_URL: z.string(), SESSION_SECRET: z.string(), MAGIC_LINK_SECRET: z.string(), diff --git a/apps/webapp/app/hooks/useFilterJobs.ts b/apps/webapp/app/hooks/useFilterJobs.ts index ae4deffd7..5cad14da3 100644 --- a/apps/webapp/app/hooks/useFilterJobs.ts +++ b/apps/webapp/app/hooks/useFilterJobs.ts @@ -2,31 +2,27 @@ import { ProjectJob } from "./useJobs"; import { useTextFilter } from "./useTextFilter"; export function useFilterJobs(jobs: ProjectJob[]) { - const { filterText, setFilterText, filteredItems } = - useTextFilter({ - items: jobs, - filter: (job, text) => { - if (job.slug.toLowerCase().includes(text.toLowerCase())) return true; - if (job.title.toLowerCase().includes(text.toLowerCase())) return true; - if (job.event.title.toLowerCase().includes(text.toLowerCase())) - return true; - if ( - job.integrations.some((integration) => - integration.title.toLowerCase().includes(text.toLowerCase()) - ) + const { filterText, setFilterText, filteredItems } = useTextFilter({ + items: jobs, + filter: (job, text) => { + if (job.slug.toLowerCase().includes(text.toLowerCase())) return true; + if (job.title.toLowerCase().includes(text.toLowerCase())) return true; + if (job.event.title.toLowerCase().includes(text.toLowerCase())) return true; + if ( + job.integrations.some((integration) => + integration.title.toLowerCase().includes(text.toLowerCase()) ) - return true; - if ( - job.properties && - job.properties.some((property) => - property.text.toLowerCase().includes(text.toLowerCase()) - ) - ) - return true; + ) + return true; + if ( + job.properties && + job.properties.some((property) => property.text.toLowerCase().includes(text.toLowerCase())) + ) + return true; - return false; - }, - }); + return false; + }, + }); return { filterText, setFilterText, filteredItems }; } diff --git a/apps/webapp/app/hooks/useIsProjectChildPage.ts b/apps/webapp/app/hooks/useIsProjectChildPage.ts index 9fb4ac859..a21692a28 100644 --- a/apps/webapp/app/hooks/useIsProjectChildPage.ts +++ b/apps/webapp/app/hooks/useIsProjectChildPage.ts @@ -6,8 +6,6 @@ export function useIsProjectChildPage(matches?: RouteMatch[]) { } return matches.some((matchData) => { - return matchData.id.startsWith( - "routes/_app.orgs.$organizationSlug.projects.$projectParam" - ); + return matchData.id.startsWith("routes/_app.orgs.$organizationSlug.projects.$projectParam"); }); } diff --git a/apps/webapp/app/hooks/useJob.tsx b/apps/webapp/app/hooks/useJob.tsx index 2bb9077ca..e381d1535 100644 --- a/apps/webapp/app/hooks/useJob.tsx +++ b/apps/webapp/app/hooks/useJob.tsx @@ -28,8 +28,6 @@ export function useJob(matches?: RouteMatch[]) { return job; } -export const useJobChanged = ( - action: (org: MatchedJob | undefined) => void -) => { +export const useJobChanged = (action: (org: MatchedJob | undefined) => void) => { useChanged(useOptionalJob, action); }; diff --git a/apps/webapp/app/hooks/useJobs.tsx b/apps/webapp/app/hooks/useJobs.tsx index 103f423c5..f3feff4a1 100644 --- a/apps/webapp/app/hooks/useJobs.tsx +++ b/apps/webapp/app/hooks/useJobs.tsx @@ -4,9 +4,7 @@ import type { loader } from "~/routes/_app.orgs.$organizationSlug.projects.$proj import { RouteMatch } from "@remix-run/react"; import { useTypedMatchesData } from "./useTypedMatchData"; -export type ProjectJob = UseDataFunctionReturn< - typeof loader ->["projectJobs"][number]; +export type ProjectJob = UseDataFunctionReturn["projectJobs"][number]; export const jobsMatchId = "routes/_app.orgs.$organizationSlug.projects.$projectParam.jobs.$jobParam"; diff --git a/apps/webapp/app/hooks/useOrganizations.ts b/apps/webapp/app/hooks/useOrganizations.ts index 699be1fc4..6a42d60e3 100644 --- a/apps/webapp/app/hooks/useOrganizations.ts +++ b/apps/webapp/app/hooks/useOrganizations.ts @@ -1,7 +1,4 @@ -import { - UseDataFunctionReturn, - useTypedRouteLoaderData, -} from "remix-typedjson"; +import { UseDataFunctionReturn, useTypedRouteLoaderData } from "remix-typedjson"; import invariant from "tiny-invariant"; import type { loader as orgLoader } from "~/routes/_app.orgs.$organizationSlug/route"; import type { loader as appLoader } from "~/routes/_app/route"; @@ -10,9 +7,7 @@ import { useChanged } from "./useChanged"; import { RouteMatch } from "@remix-run/react"; import { useTypedMatchesData } from "./useTypedMatchData"; -export type MatchedOrganization = UseDataFunctionReturn< - typeof appLoader ->["organizations"][number]; +export type MatchedOrganization = UseDataFunctionReturn["organizations"][number]; export function useOptionalOrganizations(matches?: RouteMatch[]) { const data = useTypedMatchesData({ @@ -56,8 +51,6 @@ export function useIsNewOrganizationPage(matches?: RouteMatch[]): boolean { return !!data; } -export const useOrganizationChanged = ( - action: (org: MatchedOrganization | undefined) => void -) => { +export const useOrganizationChanged = (action: (org: MatchedOrganization | undefined) => void) => { useChanged(useOptionalOrganization, action); }; diff --git a/apps/webapp/app/hooks/usePostHog.ts b/apps/webapp/app/hooks/usePostHog.ts index a21e12fe4..589a15069 100644 --- a/apps/webapp/app/hooks/usePostHog.ts +++ b/apps/webapp/app/hooks/usePostHog.ts @@ -6,11 +6,7 @@ import { useOptionalUser, useUserChanged } from "./useUser"; import { useProjectChanged } from "./useProject"; import { useJobChanged } from "./useJob"; -export const usePostHog = ( - apiKey?: string, - logging = false, - debug = false -): void => { +export const usePostHog = (apiKey?: string, logging = false, debug = false): void => { const postHogInitialized = useRef(false); const location = useLocation(); const user = useOptionalUser(); diff --git a/apps/webapp/app/hooks/useProject.tsx b/apps/webapp/app/hooks/useProject.tsx index 79551311f..58125ee1d 100644 --- a/apps/webapp/app/hooks/useProject.tsx +++ b/apps/webapp/app/hooks/useProject.tsx @@ -7,8 +7,7 @@ import { useTypedMatchesData } from "./useTypedMatchData"; export type MatchedProject = UseDataFunctionReturn["project"]; -export const projectMatchId = - "routes/_app.orgs.$organizationSlug.projects.$projectParam"; +export const projectMatchId = "routes/_app.orgs.$organizationSlug.projects.$projectParam"; export function useOptionalProject(matches?: RouteMatch[]) { const routeMatch = useTypedMatchesData({ @@ -25,8 +24,6 @@ export function useProject(matches?: RouteMatch[]) { return project; } -export const useProjectChanged = ( - action: (org: MatchedProject | undefined) => void -) => { +export const useProjectChanged = (action: (org: MatchedProject | undefined) => void) => { useChanged(useOptionalProject, action); }; diff --git a/apps/webapp/app/hooks/useShortcutKeys.tsx b/apps/webapp/app/hooks/useShortcutKeys.tsx index 35b13b654..ccbebf618 100644 --- a/apps/webapp/app/hooks/useShortcutKeys.tsx +++ b/apps/webapp/app/hooks/useShortcutKeys.tsx @@ -22,11 +22,7 @@ type useShortcutKeysProps = { disabled?: boolean; }; -export function useShortcutKeys({ - shortcut, - action, - disabled = false, -}: useShortcutKeysProps) { +export function useShortcutKeys({ shortcut, action, disabled = false }: useShortcutKeysProps) { const keys = createKeysFromShortcut(shortcut); useHotkeys(keys, action, { enabled: !disabled }); } @@ -34,8 +30,7 @@ export function useShortcutKeys({ function createKeysFromShortcut(shortcut: ShortcutDefinition) { const { platform } = useOperatingSystem(); const isMac = platform === "mac"; - let relevantShortcut = - "mac" in shortcut ? (isMac ? shortcut.mac : shortcut.windows) : shortcut; + let relevantShortcut = "mac" in shortcut ? (isMac ? shortcut.mac : shortcut.windows) : shortcut; const modifiers = relevantShortcut.modifiers; const character = relevantShortcut.key; diff --git a/apps/webapp/app/hooks/useTextFilter.ts b/apps/webapp/app/hooks/useTextFilter.ts index e4bcdca2e..b28019bd2 100644 --- a/apps/webapp/app/hooks/useTextFilter.ts +++ b/apps/webapp/app/hooks/useTextFilter.ts @@ -6,11 +6,7 @@ type TextFilterProps = { filter: (item: T, filterText: string) => boolean; }; -export function useTextFilter({ - defaultValue = "", - items, - filter, -}: TextFilterProps) { +export function useTextFilter({ defaultValue = "", items, filter }: TextFilterProps) { const [filterText, setFilterText] = useState(defaultValue); const filteredItems = useMemo(() => { diff --git a/apps/webapp/app/hooks/useTypedMatchData.ts b/apps/webapp/app/hooks/useTypedMatchData.ts index 7b2271f0e..f0c3e6b14 100644 --- a/apps/webapp/app/hooks/useTypedMatchData.ts +++ b/apps/webapp/app/hooks/useTypedMatchData.ts @@ -1,9 +1,5 @@ import { RouteMatch, useMatches } from "@remix-run/react"; -import { - RemixSerializedType, - UseDataFunctionReturn, - deserializeRemix, -} from "remix-typedjson"; +import { RemixSerializedType, UseDataFunctionReturn, deserializeRemix } from "remix-typedjson"; type AppData = any; diff --git a/apps/webapp/app/lib.es5.d.ts b/apps/webapp/app/lib.es5.d.ts index d2bdf923a..cc9c8599f 100644 --- a/apps/webapp/app/lib.es5.d.ts +++ b/apps/webapp/app/lib.es5.d.ts @@ -6,10 +6,7 @@ interface Array { * @param predicate A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array. * @param thisArg An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value. */ - filter( - predicate: BooleanConstructor, - thisArg?: any - ): Exclude[]; + filter(predicate: BooleanConstructor, thisArg?: any): Exclude[]; } // See this for more: https://twitter.com/mattpocockuk/status/1653403198885904387?s=20 diff --git a/apps/webapp/app/models/endpoint.server.ts b/apps/webapp/app/models/endpoint.server.ts index dc1dda2ed..0581d87ca 100644 --- a/apps/webapp/app/models/endpoint.server.ts +++ b/apps/webapp/app/models/endpoint.server.ts @@ -1,9 +1,7 @@ import { prisma } from "~/db.server"; import { Prettify } from "~/lib.es5"; -export type ExtendedEndpoint = Prettify< - Awaited> ->; +export type ExtendedEndpoint = Prettify>>; export async function findEndpoint(id: string) { return await prisma.endpoint.findUniqueOrThrow({ diff --git a/apps/webapp/app/models/member.server.ts b/apps/webapp/app/models/member.server.ts index 174d18cfb..5cb07f1a6 100644 --- a/apps/webapp/app/models/member.server.ts +++ b/apps/webapp/app/models/member.server.ts @@ -1,13 +1,7 @@ import { prisma } from "~/db.server"; import { createEnvironment } from "./organization.server"; -export async function getTeamMembersAndInvites({ - userId, - slug, -}: { - userId: string; - slug: string; -}) { +export async function getTeamMembersAndInvites({ userId, slug }: { userId: string; slug: string }) { const org = await prisma.organization.findFirst({ where: { slug, members: { some: { userId } } }, select: { @@ -144,13 +138,7 @@ export async function getUsersInvites({ email }: { email: string }) { }); } -export async function acceptInvite({ - userId, - inviteId, -}: { - userId: string; - inviteId: string; -}) { +export async function acceptInvite({ userId, inviteId }: { userId: string; inviteId: string }) { return await prisma.$transaction(async (tx) => { // 1. Delete the invite and get the invite details const invite = await tx.orgMemberInvite.delete({ @@ -177,13 +165,7 @@ export async function acceptInvite({ // 3. Create an environment for each project for (const project of invite.organization.projects) { - await createEnvironment( - invite.organization, - project, - "DEVELOPMENT", - member, - tx - ); + await createEnvironment(invite.organization, project, "DEVELOPMENT", member, tx); } // 4. Check for other invites @@ -197,13 +179,7 @@ export async function acceptInvite({ }); } -export async function declineInvite({ - userId, - inviteId, -}: { - userId: string; - inviteId: string; -}) { +export async function declineInvite({ userId, inviteId }: { userId: string; inviteId: string }) { return await prisma.$transaction(async (tx) => { //1. delete invite const declinedInvite = await prisma.orgMemberInvite.delete({ diff --git a/apps/webapp/app/models/message.server.ts b/apps/webapp/app/models/message.server.ts index 9206c92e8..01bd1edd3 100644 --- a/apps/webapp/app/models/message.server.ts +++ b/apps/webapp/app/models/message.server.ts @@ -41,11 +41,7 @@ export function setSuccessMessage( } as ToastMessage); } -export function setErrorMessage( - session: Session, - message: string, - options?: ToastMessageOptions -) { +export function setErrorMessage(session: Session, message: string, options?: ToastMessageOptions) { session.flash("toastMessage", { message, type: "error", diff --git a/apps/webapp/app/models/organization.server.ts b/apps/webapp/app/models/organization.server.ts index 5975995d7..891f4c57c 100644 --- a/apps/webapp/app/models/organization.server.ts +++ b/apps/webapp/app/models/organization.server.ts @@ -82,9 +82,7 @@ export async function createOrganization( }); if (attemptCount > 100) { - throw new Error( - `Unable to create organization with slug ${uniqueOrgSlug} after 100 attempts` - ); + throw new Error(`Unable to create organization with slug ${uniqueOrgSlug} after 100 attempts`); } if (orgWithSameSlug) { diff --git a/apps/webapp/app/models/project.server.ts b/apps/webapp/app/models/project.server.ts index c4dd65304..f4fe0e4d7 100644 --- a/apps/webapp/app/models/project.server.ts +++ b/apps/webapp/app/models/project.server.ts @@ -6,11 +6,7 @@ import { Organization, createEnvironment } from "./organization.server"; export type { Project } from "@trigger.dev/database"; export async function createProject( - { - organizationSlug, - name, - userId, - }: { organizationSlug: string; name: string; userId: string }, + { organizationSlug, name, userId }: { organizationSlug: string; name: string; userId: string }, attemptCount = 0 ): Promise { //check the user has permissions to do this @@ -34,9 +30,7 @@ export async function createProject( }); if (attemptCount > 100) { - throw new Error( - `Unable to create project with slug ${uniqueProjectSlug} after 100 attempts` - ); + throw new Error(`Unable to create project with slug ${uniqueProjectSlug} after 100 attempts`); } if (projectWithSameSlug) { diff --git a/apps/webapp/app/models/runConnection.server.ts b/apps/webapp/app/models/runConnection.server.ts index d5a7b94a6..2ddd2bef5 100644 --- a/apps/webapp/app/models/runConnection.server.ts +++ b/apps/webapp/app/models/runConnection.server.ts @@ -40,9 +40,7 @@ export async function resolveRunConnection( return; } - const response = await integrationAuthRepository.getCredentials( - connection.connection - ); + const response = await integrationAuthRepository.getCredentials(connection.connection); if (!response) { return; diff --git a/apps/webapp/app/models/runtimeEnvironment.server.ts b/apps/webapp/app/models/runtimeEnvironment.server.ts index dcf14d6d6..344716fa8 100644 --- a/apps/webapp/app/models/runtimeEnvironment.server.ts +++ b/apps/webapp/app/models/runtimeEnvironment.server.ts @@ -31,10 +31,7 @@ export async function findEnvironmentByPublicApiKey(apiKey: string) { return environment; } -export async function getEnvironmentForOrganization( - organizationSlug: string, - slug: string -) { +export async function getEnvironmentForOrganization(organizationSlug: string, slug: string) { const organization = await prisma.organization.findUnique({ where: { slug: organizationSlug, @@ -48,9 +45,7 @@ export async function getEnvironmentForOrganization( return; } - const environment = organization.environments.find( - (environment) => environment.slug === slug - ); + const environment = organization.environments.find((environment) => environment.slug === slug); return environment; } diff --git a/apps/webapp/app/models/task.server.ts b/apps/webapp/app/models/task.server.ts index 20bce8959..19951eb6f 100644 --- a/apps/webapp/app/models/task.server.ts +++ b/apps/webapp/app/models/task.server.ts @@ -3,9 +3,7 @@ import { ServerTask } from "@trigger.dev/core"; export type TaskWithAttempts = Task & { attempts: TaskAttempt[] }; -export function taskWithAttemptsToServerTask( - task: TaskWithAttempts -): ServerTask { +export function taskWithAttemptsToServerTask(task: TaskWithAttempts): ServerTask { return { id: task.id, name: task.name, diff --git a/apps/webapp/app/models/user.server.ts b/apps/webapp/app/models/user.server.ts index 96b565e42..31e8621ed 100644 --- a/apps/webapp/app/models/user.server.ts +++ b/apps/webapp/app/models/user.server.ts @@ -22,9 +22,7 @@ type LoggedInUser = { isNewUser: boolean; }; -export async function findOrCreateUser( - input: FindOrCreateUser -): Promise { +export async function findOrCreateUser(input: FindOrCreateUser): Promise { switch (input.authenticationMethod) { case "GITHUB": { return findOrCreateGithubUser(input); @@ -168,13 +166,7 @@ export function updateUser({ }); } -export async function grantUserCloudAccess({ - id, - inviteCode, -}: { - id: string; - inviteCode: string; -}) { +export async function grantUserCloudAccess({ id, inviteCode }: { id: string; inviteCode: string }) { return prisma.user.update({ where: { id }, data: { diff --git a/apps/webapp/app/platform/zodWorker.server.ts b/apps/webapp/app/platform/zodWorker.server.ts index 343c28daa..592184965 100644 --- a/apps/webapp/app/platform/zodWorker.server.ts +++ b/apps/webapp/app/platform/zodWorker.server.ts @@ -46,10 +46,7 @@ export type ZodTasks = { maxAttempts?: number; jobKeyMode?: "replace" | "preserve_run_at" | "unsafe_dedupe"; flags?: string[]; - handler: ( - payload: z.infer, - job: GraphileJob - ) => Promise; + handler: (payload: z.infer, job: GraphileJob) => Promise; }; }; @@ -175,9 +172,7 @@ export class ZodWorker { if (!rows.success) { throw new Error( - `Failed to add job to queue, zod parsing error: ${JSON.stringify( - rows.error - )}` + `Failed to add job to queue, zod parsing error: ${JSON.stringify(rows.error)}` ); } @@ -208,8 +203,7 @@ export class ZodWorker { const subscriberSchema = this.#schema; type TypeKeys = keyof typeof subscriberSchema; - const messageSchema: TMessageCatalog[TypeKeys] | undefined = - subscriberSchema[typeName]; + const messageSchema: TMessageCatalog[TypeKeys] | undefined = subscriberSchema[typeName]; if (!messageSchema) { throw new Error(`Unknown message type: ${String(typeName)}`); diff --git a/apps/webapp/app/presenters/EnvironmentsPresenter.server.ts b/apps/webapp/app/presenters/EnvironmentsPresenter.server.ts index 3bdbf467d..bcb0629a7 100644 --- a/apps/webapp/app/presenters/EnvironmentsPresenter.server.ts +++ b/apps/webapp/app/presenters/EnvironmentsPresenter.server.ts @@ -1,8 +1,5 @@ import { PrismaClient, prisma } from "~/db.server"; -import { - IndexEndpointStats, - parseEndpointIndexStats, -} from "~/models/indexEndpoint.server"; +import { IndexEndpointStats, parseEndpointIndexStats } from "~/models/indexEndpoint.server"; import { Project } from "~/models/project.server"; import { User } from "~/models/user.server"; import { @@ -133,18 +130,14 @@ export class EnvironmentsPresenter { (environment) => environment.type === "DEVELOPMENT" ); if (!developmentEnvironment) { - throw new Error( - "Development environment not found, this should not happen" - ); + throw new Error("Development environment not found, this should not happen"); } const productionEnvironment = filtered.find( (environment) => environment.type === "PRODUCTION" ); if (!productionEnvironment) { - throw new Error( - "Production environment not found, this should not happen" - ); + throw new Error("Production environment not found, this should not happen"); } const client: Client = { @@ -165,22 +158,14 @@ export class EnvironmentsPresenter { (endpoint) => endpoint.slug === slug ); if (devEndpoint) { - client.endpoints.DEVELOPMENT = endpointClient( - devEndpoint, - developmentEnvironment, - baseUrl - ); + client.endpoints.DEVELOPMENT = endpointClient(devEndpoint, developmentEnvironment, baseUrl); } const prodEndpoint = productionEnvironment.endpoints.find( (endpoint) => endpoint.slug === slug ); if (prodEndpoint) { - client.endpoints.PRODUCTION = endpointClient( - prodEndpoint, - productionEnvironment, - baseUrl - ); + client.endpoints.PRODUCTION = endpointClient(prodEndpoint, productionEnvironment, baseUrl); } clients.push(client); diff --git a/apps/webapp/app/presenters/EnvironmentsStreamPresenter.server.ts b/apps/webapp/app/presenters/EnvironmentsStreamPresenter.server.ts index 7e4bb4f23..b1f4c659c 100644 --- a/apps/webapp/app/presenters/EnvironmentsStreamPresenter.server.ts +++ b/apps/webapp/app/presenters/EnvironmentsStreamPresenter.server.ts @@ -109,34 +109,28 @@ export class EnvironmentsStreamPresenter { if (!environments) return null; - const environmentSignalsMap = environments.reduce( - (acc, environment) => { - const lastUpdatedAt = environment.updatedAt.getTime(); - const lastTotalEndpointUpdatedTime = environment.endpoints.reduce( - (prev, endpoint) => prev + endpoint.updatedAt.getTime(), - 0 - ); - const lastTotalIndexingUpdatedTime = environment.endpoints.reduce( - (prev, endpoint) => - prev + - endpoint.indexings.reduce( - (prev, indexing) => prev + indexing.updatedAt.getTime(), - 0 - ), - 0 - ); + const environmentSignalsMap = environments.reduce((acc, environment) => { + const lastUpdatedAt = environment.updatedAt.getTime(); + const lastTotalEndpointUpdatedTime = environment.endpoints.reduce( + (prev, endpoint) => prev + endpoint.updatedAt.getTime(), + 0 + ); + const lastTotalIndexingUpdatedTime = environment.endpoints.reduce( + (prev, endpoint) => + prev + + endpoint.indexings.reduce((prev, indexing) => prev + indexing.updatedAt.getTime(), 0), + 0 + ); - return { - ...acc, - [environment.id]: { - lastUpdatedAt, - lastTotalEndpointUpdatedTime, - lastTotalIndexingUpdatedTime, - }, - }; - }, - {} - ); + return { + ...acc, + [environment.id]: { + lastUpdatedAt, + lastTotalEndpointUpdatedTime, + lastTotalIndexingUpdatedTime, + }, + }; + }, {}); return environmentSignalsMap; } diff --git a/apps/webapp/app/presenters/IntegrationClientConnectionsPresenter.server.ts b/apps/webapp/app/presenters/IntegrationClientConnectionsPresenter.server.ts index f9cc5a3f7..f1438ea3f 100644 --- a/apps/webapp/app/presenters/IntegrationClientConnectionsPresenter.server.ts +++ b/apps/webapp/app/presenters/IntegrationClientConnectionsPresenter.server.ts @@ -22,48 +22,43 @@ export class IntegrationClientConnectionsPresenter { projectSlug: Project["slug"]; clientSlug: string; }) { - const connections = await this.#prismaClient.integrationConnection.findMany( - { - select: { - id: true, - expiresAt: true, - metadata: true, - connectionType: true, - createdAt: true, - updatedAt: true, - _count: { - select: { - runConnections: true, + const connections = await this.#prismaClient.integrationConnection.findMany({ + select: { + id: true, + expiresAt: true, + metadata: true, + connectionType: true, + createdAt: true, + updatedAt: true, + _count: { + select: { + runConnections: true, + }, + }, + }, + where: { + organization: { + slug: organizationSlug, + members: { + some: { + userId, }, }, }, - where: { - organization: { - slug: organizationSlug, - members: { - some: { - userId, - }, - }, - }, - integration: { - slug: clientSlug, - }, + integration: { + slug: clientSlug, }, - orderBy: { - createdAt: "desc", - }, - } - ); + }, + orderBy: { + createdAt: "desc", + }, + }); return { connections: connections.map((c) => ({ id: c.id, expiresAt: c.expiresAt, - metadata: - c.metadata != null - ? ConnectionMetadataSchema.parse(c.metadata) - : null, + metadata: c.metadata != null ? ConnectionMetadataSchema.parse(c.metadata) : null, type: c.connectionType, createdAt: c.createdAt, updatedAt: c.updatedAt, diff --git a/apps/webapp/app/presenters/IntegrationClientPresenter.server.ts b/apps/webapp/app/presenters/IntegrationClientPresenter.server.ts index e1b76aa23..fa3c453d3 100644 --- a/apps/webapp/app/presenters/IntegrationClientPresenter.server.ts +++ b/apps/webapp/app/presenters/IntegrationClientPresenter.server.ts @@ -4,11 +4,7 @@ import { env } from "~/env.server"; import { Organization } from "~/models/organization.server"; import { Project } from "~/models/project.server"; import { integrationCatalog } from "~/services/externalApis/integrationCatalog.server"; -import { - Help, - HelpSchema, - OAuthClientSchema, -} from "~/services/externalApis/types"; +import { Help, HelpSchema, OAuthClientSchema } from "~/services/externalApis/types"; import { getSecretStore } from "~/services/secrets/secretStore.server"; export class IntegrationClientPresenter { diff --git a/apps/webapp/app/presenters/IntegrationClientScopesPresenter.server.ts b/apps/webapp/app/presenters/IntegrationClientScopesPresenter.server.ts index 0a0bd4fd5..4687ee0f9 100644 --- a/apps/webapp/app/presenters/IntegrationClientScopesPresenter.server.ts +++ b/apps/webapp/app/presenters/IntegrationClientScopesPresenter.server.ts @@ -49,9 +49,7 @@ export class IntegrationClientScopesPresenter { return { scopes: integration.scopes.map((s) => { - const matchingScope = authMethodScopes.find( - (scope) => scope.name === s - ); + const matchingScope = authMethodScopes.find((scope) => scope.name === s); return { name: s, diff --git a/apps/webapp/app/presenters/IntegrationsPresenter.server.ts b/apps/webapp/app/presenters/IntegrationsPresenter.server.ts index bc57e53da..09c6cd927 100644 --- a/apps/webapp/app/presenters/IntegrationsPresenter.server.ts +++ b/apps/webapp/app/presenters/IntegrationsPresenter.server.ts @@ -14,9 +14,7 @@ export type IntegrationOrApi = } & Integration) | ({ type: "api" } & Api & { voted: boolean }); -export type Client = Awaited< - ReturnType ->["clients"][number]; +export type Client = Awaited>["clients"][number]; export class IntegrationsPresenter { #prismaClient: PrismaClient; @@ -135,16 +133,13 @@ export class IntegrationsPresenter { }) ); - const setupClients = enrichedClients.filter( - (c) => c.setupStatus === "COMPLETE" - ); - const clientMissingFields = enrichedClients.filter( - (c) => c.setupStatus === "MISSING_FIELDS" - ); + const setupClients = enrichedClients.filter((c) => c.setupStatus === "COMPLETE"); + const clientMissingFields = enrichedClients.filter((c) => c.setupStatus === "MISSING_FIELDS"); - const integrations = Object.values( - integrationCatalog.getIntegrations() - ).map((i) => ({ type: "integration" as const, ...i })); + const integrations = Object.values(integrationCatalog.getIntegrations()).map((i) => ({ + type: "integration" as const, + ...i, + })); //get all apis, some don't have integrations yet. //get whether the user has voted for them or not @@ -165,9 +160,7 @@ export class IntegrationsPresenter { voted: votes.some((v) => v.apiIdentifier === a.identifier), })); - const options = [...integrations, ...apis].sort((a, b) => - a.name.localeCompare(b.name) - ); + const options = [...integrations, ...apis].sort((a, b) => a.name.localeCompare(b.name)); return { clients: setupClients, diff --git a/apps/webapp/app/presenters/JobListPresenter.server.ts b/apps/webapp/app/presenters/JobListPresenter.server.ts index f03d86284..0c3917d93 100644 --- a/apps/webapp/app/presenters/JobListPresenter.server.ts +++ b/apps/webapp/app/presenters/JobListPresenter.server.ts @@ -31,10 +31,9 @@ export class JobListPresenter { ? { slug: organizationSlug, members: { some: { userId } } } : { members: { some: { userId } } }; - const integrationsWhere: Prisma.JobWhereInput["integrations"] = - integrationSlug - ? { some: { integration: { slug: integrationSlug } } } - : {}; + const integrationsWhere: Prisma.JobWhereInput["integrations"] = integrationSlug + ? { some: { integration: { slug: integrationSlug } } } + : {}; const jobs = await this.#prismaClient.job.findMany({ select: { @@ -109,17 +108,11 @@ export class JobListPresenter { // 2. Prod // 3. Any other user's dev const sortedAliases = job.aliases.sort((a, b) => { - if ( - a.environment.type === "DEVELOPMENT" && - a.environment.orgMember?.userId === userId - ) { + if (a.environment.type === "DEVELOPMENT" && a.environment.orgMember?.userId === userId) { return -1; } - if ( - b.environment.type === "DEVELOPMENT" && - b.environment.orgMember?.userId === userId - ) { + if (b.environment.type === "DEVELOPMENT" && b.environment.orgMember?.userId === userId) { return 1; } @@ -137,14 +130,10 @@ export class JobListPresenter { const alias = sortedAliases.at(0); if (!alias) { - throw new Error( - `No aliases found for job ${job.id}, this should never happen.` - ); + throw new Error(`No aliases found for job ${job.id}, this should never happen.`); } - const eventSpecification = EventSpecificationSchema.parse( - alias.version.eventSpecification - ); + const eventSpecification = EventSpecificationSchema.parse(alias.version.eventSpecification); const lastRuns = job.aliases .map((alias) => alias.version.runs.at(0)) @@ -158,9 +147,7 @@ export class JobListPresenter { const integrations = alias.version.integrations.map((integration) => ({ key: integration.key, title: integration.integration.slug, - icon: - integration.integration.definition.icon ?? - integration.integration.definition.id, + icon: integration.integration.definition.icon ?? integration.integration.definition.id, setupStatus: integration.integration.setupStatus, })); @@ -171,9 +158,7 @@ export class JobListPresenter { } if (alias.version.properties) { - const versionProperties = z - .array(DisplayPropertySchema) - .parse(alias.version.properties); + const versionProperties = z.array(DisplayPropertySchema).parse(alias.version.properties); properties = [...properties, ...versionProperties]; } diff --git a/apps/webapp/app/presenters/RunPresenter.server.ts b/apps/webapp/app/presenters/RunPresenter.server.ts index 739511ff8..a3e380aa1 100644 --- a/apps/webapp/app/presenters/RunPresenter.server.ts +++ b/apps/webapp/app/presenters/RunPresenter.server.ts @@ -14,16 +14,10 @@ type RunOptions = { }; export type Run = NonNullable>>; -export type Task = NonNullable< - Awaited> ->["tasks"][number]; -export type Event = NonNullable< - Awaited> ->["event"]; +export type Task = NonNullable>>["tasks"][number]; +export type Event = NonNullable>>["event"]; -type QueryTask = NonNullable< - Awaited> ->["tasks"][number]; +type QueryTask = NonNullable>>["tasks"][number]; export class RunPresenter { #prismaClient: PrismaClient; @@ -39,9 +33,7 @@ export class RunPresenter { return undefined; } - const eventSpecification = EventSpecificationSchema.parse( - run.version.eventSpecification - ); + const eventSpecification = EventSpecificationSchema.parse(run.version.eventSpecification); const runProperties = mergeProperties( run.version.properties, diff --git a/apps/webapp/app/presenters/RunStreamPresenter.server.ts b/apps/webapp/app/presenters/RunStreamPresenter.server.ts index 5dd56c6f1..d53ec3518 100644 --- a/apps/webapp/app/presenters/RunStreamPresenter.server.ts +++ b/apps/webapp/app/presenters/RunStreamPresenter.server.ts @@ -9,13 +9,7 @@ export class RunStreamPresenter { this.#prismaClient = prismaClient; } - public async call({ - request, - runId, - }: { - request: Request; - runId: JobRun["id"]; - }) { + public async call({ request, runId }: { request: Request; runId: JobRun["id"] }) { const run = await this.#runForUpdates(runId); if (!run) { diff --git a/apps/webapp/app/presenters/TaskDetailsPresenter.server.ts b/apps/webapp/app/presenters/TaskDetailsPresenter.server.ts index d08362dc3..9061a090c 100644 --- a/apps/webapp/app/presenters/TaskDetailsPresenter.server.ts +++ b/apps/webapp/app/presenters/TaskDetailsPresenter.server.ts @@ -7,9 +7,7 @@ type DetailsProps = { userId: string; }; -export type DetailedTask = NonNullable< - Awaited> ->; +export type DetailedTask = NonNullable>>; export class TaskDetailsPresenter { #prismaClient: PrismaClient; diff --git a/apps/webapp/app/presenters/TriggerDetailsPresenter.server.ts b/apps/webapp/app/presenters/TriggerDetailsPresenter.server.ts index b46377068..127f73439 100644 --- a/apps/webapp/app/presenters/TriggerDetailsPresenter.server.ts +++ b/apps/webapp/app/presenters/TriggerDetailsPresenter.server.ts @@ -1,8 +1,6 @@ import { PrismaClient, prisma } from "~/db.server"; -export type DetailedEvent = NonNullable< - Awaited> ->; +export type DetailedEvent = NonNullable>>; export class TriggerDetailsPresenter { #prismaClient: PrismaClient; diff --git a/apps/webapp/app/presenters/TriggerSourcePresenter.server.ts b/apps/webapp/app/presenters/TriggerSourcePresenter.server.ts index d54cf2038..b4e597ab0 100644 --- a/apps/webapp/app/presenters/TriggerSourcePresenter.server.ts +++ b/apps/webapp/app/presenters/TriggerSourcePresenter.server.ts @@ -2,11 +2,7 @@ import { TriggerSource, User } from "@trigger.dev/database"; import { PrismaClient, prisma } from "~/db.server"; import { Organization } from "~/models/organization.server"; import { Project } from "~/models/project.server"; -import { - Direction, - RunList, - RunListPresenter, -} from "./RunListPresenter.server"; +import { Direction, RunList, RunListPresenter } from "./RunListPresenter.server"; export class TriggerSourcePresenter { #prismaClient: PrismaClient; diff --git a/apps/webapp/app/root.tsx b/apps/webapp/app/root.tsx index 8bfacd201..90b021f87 100644 --- a/apps/webapp/app/root.tsx +++ b/apps/webapp/app/root.tsx @@ -1,27 +1,13 @@ import type { LinksFunction, LoaderArgs } from "@remix-run/node"; import type { ShouldRevalidateFunction } from "@remix-run/react"; -import { - Links, - LiveReload, - Meta, - Outlet, - Scripts, - ScrollRestoration, -} from "@remix-run/react"; -import { - TypedMetaFunction, - typedjson, - useTypedLoaderData, -} from "remix-typedjson"; +import { Links, LiveReload, Meta, Outlet, Scripts, ScrollRestoration } from "@remix-run/react"; +import { TypedMetaFunction, typedjson, useTypedLoaderData } from "remix-typedjson"; import type { ToastMessage } from "~/models/message.server"; import { commitSession, getSession } from "~/models/message.server"; import tailwindStylesheetUrl from "~/tailwind.css"; import { RouteErrorDisplay } from "./components/ErrorDisplay"; import { HighlightInit } from "./components/HighlightInit"; -import { - AppContainer, - MainCenteredContainer, -} from "./components/layout/AppLayout"; +import { AppContainer, MainCenteredContainer } from "./components/layout/AppLayout"; import { Toast } from "./components/primitives/Toast"; import { env } from "./env.server"; import { featuresForRequest } from "./features.server"; @@ -94,8 +80,7 @@ export function ErrorBoundary() { } function App() { - const { posthogProjectKey, highlightProjectId } = - useTypedLoaderData(); + const { posthogProjectKey, highlightProjectId } = useTypedLoaderData(); usePostHog(posthogProjectKey); useHighlight(); diff --git a/apps/webapp/app/routes/_app._orgaccount._index/OrganizationGrid.tsx b/apps/webapp/app/routes/_app._orgaccount._index/OrganizationGrid.tsx index 40abf12ba..5a7b004ac 100644 --- a/apps/webapp/app/routes/_app._orgaccount._index/OrganizationGrid.tsx +++ b/apps/webapp/app/routes/_app._orgaccount._index/OrganizationGrid.tsx @@ -8,17 +8,9 @@ import { NamedIcon } from "~/components/primitives/NamedIcon"; import { Paragraph } from "~/components/primitives/Paragraph"; import type { MatchedOrganization } from "~/hooks/useOrganizations"; import { cn } from "~/utils/cn"; -import { - newProjectPath, - organizationPath, - projectPath, -} from "~/utils/pathBuilder"; +import { newProjectPath, organizationPath, projectPath } from "~/utils/pathBuilder"; -export function OrganizationGridItem({ - organization, -}: { - organization: MatchedOrganization; -}) { +export function OrganizationGridItem({ organization }: { organization: MatchedOrganization }) { return (
  • -
  • @@ -54,10 +51,7 @@ export default function Page() { className="h-10 w-10 text-dimmed transition duration-300 group-hover:text-green-500" aria-hidden="true" /> - + New Organization diff --git a/apps/webapp/app/routes/_app._orgaccount.account/route.tsx b/apps/webapp/app/routes/_app._orgaccount.account/route.tsx index 71cf2231e..76e704d34 100644 --- a/apps/webapp/app/routes/_app._orgaccount.account/route.tsx +++ b/apps/webapp/app/routes/_app._orgaccount.account/route.tsx @@ -156,9 +156,7 @@ export default function Page() { variant="simple/small" defaultChecked={user.marketingEmails} /> - - {marketingEmails.error} - + {marketingEmails.error} - - Create new Organizations and manage your account. - + Create new Organizations and manage your account. - + Create a Project
  • diff --git a/apps/webapp/app/routes/_app.orgs.$organizationSlug.invite/route.tsx b/apps/webapp/app/routes/_app.orgs.$organizationSlug.invite/route.tsx index e76c6680d..d89daaea7 100644 --- a/apps/webapp/app/routes/_app.orgs.$organizationSlug.invite/route.tsx +++ b/apps/webapp/app/routes/_app.orgs.$organizationSlug.invite/route.tsx @@ -1,10 +1,4 @@ -import { - conform, - useFieldList, - useForm, - list, - requestIntent, -} from "@conform-to/react"; +import { conform, useFieldList, useForm, list, requestIntent } from "@conform-to/react"; import { parse } from "@conform-to/zod"; import type { ActionFunction } from "@remix-run/node"; import { json } from "@remix-run/node"; @@ -122,11 +116,7 @@ export default function Page() { { fieldValues.current[index] = e.target.value; @@ -134,10 +124,7 @@ export default function Page() { emailFields.length === fieldValues.current.length && fieldValues.current.every((v) => v !== "") ) { - requestIntent( - form.ref.current ?? undefined, - list.append(emails.name) - ); + requestIntent(form.ref.current ?? undefined, list.append(emails.name)); } }} /> @@ -152,10 +139,7 @@ export default function Page() { } cancelButton={ - + Cancel } diff --git a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam._index/route.tsx b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam._index/route.tsx index 3ba9d218d..5eecc78e0 100644 --- a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam._index/route.tsx +++ b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam._index/route.tsx @@ -33,11 +33,7 @@ import { BreadcrumbLink } from "~/components/navigation/NavBar"; import { requireUserId } from "~/services/session.server"; import { JobListPresenter } from "~/presenters/JobListPresenter.server"; import { TextLink } from "~/components/primitives/TextLink"; -import { - GitHubLightIcon, - OpenAILightIcon, - ResendIcon, -} from "@trigger.dev/companyicons"; +import { GitHubLightIcon, OpenAILightIcon, ResendIcon } from "@trigger.dev/companyicons"; import { ClockIcon, CalendarDaysIcon, SlackIcon } from "lucide-react"; export const loader = async ({ request, params }: LoaderArgs) => { @@ -55,16 +51,13 @@ export const loader = async ({ request, params }: LoaderArgs) => { console.error(error); throw new Response(undefined, { status: 400, - statusText: - "Something went wrong, if this problem persists please contact support.", + statusText: "Something went wrong, if this problem persists please contact support.", }); } }; export const handle: Handle = { - breadcrumb: (match) => ( - - ), + breadcrumb: (match) => , expandSidebar: true, }; @@ -85,11 +78,7 @@ export default function Page() { - + @@ -114,24 +103,17 @@ export default function Page() { /> */} {(open) => ( -
    +
    - {jobs.length > 0 && - jobs.some((j) => j.hasIntegrationsRequiringAction) && ( - - Some of your Jobs have Integrations that have not been - configured. - - )} + {jobs.length > 0 && jobs.some((j) => j.hasIntegrationsRequiringAction) && ( + + Some of your Jobs have Integrations that have not been configured. + + )}
    {jobs.length === 0 ? ( Jobs @@ -154,9 +136,7 @@ export default function Page() { "flex w-full flex-col justify-center gap-x-4 rounded-md border border-dashed border-indigo-800 px-5 py-8" } > - - Your Jobs will appear here. - + Your Jobs will appear here.
    ) : ( @@ -205,12 +185,8 @@ function ExampleJobs() {
    Example Jobs - If you want more inspiration or just want to dig into the code of a Job, - check out our{" "} - - examples repo - - . + If you want more inspiration or just want to dig into the code of a Job, check out our{" "} + examples repo.
    diff --git a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.environments/ConfigureEndpointSheet.tsx b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.environments/ConfigureEndpointSheet.tsx index 9fc86f0e1..5db9273da 100644 --- a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.environments/ConfigureEndpointSheet.tsx +++ b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.environments/ConfigureEndpointSheet.tsx @@ -15,12 +15,7 @@ import { Hint } from "~/components/primitives/Hint"; import { Input } from "~/components/primitives/Input"; import { InputGroup } from "~/components/primitives/InputGroup"; import { Paragraph } from "~/components/primitives/Paragraph"; -import { - Sheet, - SheetBody, - SheetContent, - SheetHeader, -} from "~/components/primitives/Sheet"; +import { Sheet, SheetBody, SheetContent, SheetHeader } from "~/components/primitives/Sheet"; import { ClientEndpoint } from "~/presenters/EnvironmentsPresenter.server"; import { endpointStreamingPath } from "~/utils/pathBuilder"; import { RuntimeEnvironmentType } from "../../../../../packages/database/src"; @@ -33,11 +28,7 @@ type ConfigureEndpointSheetProps = { onClose: () => void; }; -export function ConfigureEndpointSheet({ - slug, - endpoint, - onClose, -}: ConfigureEndpointSheetProps) { +export function ConfigureEndpointSheet({ slug, endpoint, onClose }: ConfigureEndpointSheetProps) { const setEndpointUrlFetcher = useFetcher(); const [form, { url, clientSlug }] = useForm({ @@ -53,12 +44,9 @@ export function ConfigureEndpointSheet({ const refreshingEndpoint = refreshEndpointFetcher.state !== "idle"; const revalidator = useRevalidator(); - const events = useEventSource( - endpointStreamingPath({ id: endpoint.environment.id }), - { - event: "message", - } - ); + const events = useEventSource(endpointStreamingPath({ id: endpoint.environment.id }), { + event: "message", + }); useEffect(() => { if (events !== null) { @@ -80,9 +68,7 @@ export function ConfigureEndpointSheet({
    - + Configure endpoint
    @@ -96,10 +82,7 @@ export function ConfigureEndpointSheet({ Endpoint URL
    - + {url.error} {form.error} - This is the URL of your Trigger API route, Typically this would - be:{" "} - - https://yourdomain.com/api/trigger - - . + This is the URL of your Trigger API route, Typically this would be:{" "} + https://yourdomain.com/api/trigger. @@ -140,10 +119,7 @@ export function ConfigureEndpointSheet({ method="post" action={`/resources/environments/${endpoint.environment.id}/endpoint/${endpoint.id}`} > - + Endpoint configured. Last refreshed:{" "} {endpoint.latestIndex ? ( @@ -157,9 +133,7 @@ export function ConfigureEndpointSheet({ type="submit" className="bg-green-700 group-hover:bg-green-600/90" disabled={refreshingEndpoint} - LeadingIcon={ - refreshingEndpoint ? "spinner-white" : undefined - } + LeadingIcon={refreshingEndpoint ? "spinner-white" : undefined} > {refreshingEndpoint ? "Refreshing" : "Refresh now"} @@ -169,14 +143,10 @@ export function ConfigureEndpointSheet({
    Automatic refreshing - Use this webhook URL so your Jobs get automatically refreshed - when you deploy. You just need to hit this URL (POST) and we - will refresh your Jobs. + Use this webhook URL so your Jobs get automatically refreshed when you deploy. You + just need to hit this URL (POST) and we will refresh your Jobs. - +
    )} diff --git a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.environments/route.tsx b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.environments/route.tsx index 6a73e8f8e..f2caa3b81 100644 --- a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.environments/route.tsx +++ b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.environments/route.tsx @@ -3,10 +3,7 @@ import { LoaderArgs } from "@remix-run/server-runtime"; import { useEffect, useMemo, useState } from "react"; import { typedjson, useTypedLoaderData } from "remix-typedjson"; import { useEventSource } from "remix-utils"; -import { - EnvironmentLabel, - environmentTitle, -} from "~/components/environments/EnvironmentLabel"; +import { EnvironmentLabel, environmentTitle } from "~/components/environments/EnvironmentLabel"; import { HowToUseApiKeysAndEndpoints } from "~/components/helpContent/HelpContentText"; import { PageBody, PageContainer } from "~/components/layout/AppLayout"; import { BreadcrumbLink } from "~/components/navigation/NavBar"; @@ -33,17 +30,11 @@ import { } from "~/components/primitives/Table"; import { useOrganization } from "~/hooks/useOrganizations"; import { useProject } from "~/hooks/useProject"; -import { - ClientEndpoint, - EnvironmentsPresenter, -} from "~/presenters/EnvironmentsPresenter.server"; +import { ClientEndpoint, EnvironmentsPresenter } from "~/presenters/EnvironmentsPresenter.server"; import { requireUserId } from "~/services/session.server"; import { cn } from "~/utils/cn"; import { Handle } from "~/utils/handle"; -import { - ProjectParamSchema, - projectEnvironmentsStreamingPath, -} from "~/utils/pathBuilder"; +import { ProjectParamSchema, projectEnvironmentsStreamingPath } from "~/utils/pathBuilder"; import { requestUrl } from "~/utils/requestUrl.server"; import { RuntimeEnvironmentType } from "../../../../../packages/database/src"; import { ConfigureEndpointSheet } from "./ConfigureEndpointSheet"; @@ -71,16 +62,13 @@ export const loader = async ({ request, params }: LoaderArgs) => { console.error(error); throw new Response(undefined, { status: 400, - statusText: - "Something went wrong, if this problem persists please contact support.", + statusText: "Something went wrong, if this problem persists please contact support.", }); } }; export const handle: Handle = { - breadcrumb: (match) => ( - - ), + breadcrumb: (match) => , expandSidebar: true, }; @@ -111,10 +99,9 @@ export default function Page() { const project = useProject(); const revalidator = useRevalidator(); - const events = useEventSource( - projectEnvironmentsStreamingPath(organization, project), - { event: "message" } - ); + const events = useEventSource(projectEnvironmentsStreamingPath(organization, project), { + event: "message", + }); useEffect(() => { if (events !== null) { @@ -129,19 +116,12 @@ export default function Page() { - - API Keys and endpoints for your environments. - + API Keys and endpoints for your environments. {(open) => ( -
    +
    API Keys @@ -149,17 +129,16 @@ export default function Page() {
    - Server API keys should be used on your server – they give - full API access.
    - Public API keys should be used in your frontend – they have - limited read-only access. + Server API keys should be used on your server – they give full API access.{" "} +
    + Public API keys should be used in your frontend – they have limited read-only + access.
    {environments.map((environment) => (
    - {" "} - Environment + Environment
    Url Last refreshed Jobs - - Go to page - + Go to page @@ -286,15 +263,9 @@ function EndpointRow({ {endpoint.url} - {endpoint.latestIndex ? ( - - ) : ( - "–" - )} - - - {endpoint.latestIndex?.stats.jobs ?? "–"} + {endpoint.latestIndex ? : "–"} + {endpoint.latestIndex?.stats.jobs ?? "–"} ); diff --git a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.integrations/route.tsx b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.integrations/route.tsx index 4647cf2f1..23bcac69f 100644 --- a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.integrations/route.tsx +++ b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.integrations/route.tsx @@ -70,9 +70,7 @@ export const loader = async ({ request, params }: LoaderArgs) => { }; export const handle: Handle = { - breadcrumb: (match) => ( - - ), + breadcrumb: (match) => , expandSidebar: true, }; @@ -88,18 +86,13 @@ export default function Integrations() { - + Create your own Integration - Easily use an Integration, an existing Node.js SDK or make HTTP calls - from a Job. + Easily use an Integration, an existing Node.js SDK or make HTTP calls from a Job. @@ -144,12 +137,10 @@ function PossibleIntegrationsList({ const optionsToShow = onlyShowIntegrations ? options.filter((o) => o.type === "integration") : options; - const { filterText, setFilterText, filteredItems } = - useTextFilter({ - items: optionsToShow, - filter: (integration, text) => - integration.name.toLowerCase().includes(text.toLowerCase()), - }); + const { filterText, setFilterText, filteredItems } = useTextFilter({ + items: optionsToShow, + filter: (integration, text) => integration.name.toLowerCase().includes(text.toLowerCase()), + }); return (
    @@ -322,11 +313,7 @@ function ConnectedIntegrationsList({ ) : ( <> {filteredItems.map((client) => { - const path = integrationClientPath( - organization, - project, - client - ); + const path = integrationClientPath(organization, project, client); return ( {client.title} @@ -337,14 +324,10 @@ function ConnectedIntegrationsList({ {client.slug} - - {client.authMethod.name} - + {client.authMethod.name} {client.jobCount} - {client.authSource === "LOCAL" - ? "–" - : client.scopesCount} + {client.authSource === "LOCAL" ? "–" : client.scopesCount} {client.authSource === "LOCAL" ? ( @@ -367,15 +350,10 @@ function ConnectedIntegrationsList({ )} - {client.authSource === "LOCAL" - ? "–" - : client.connectionsCount} + {client.authSource === "LOCAL" ? "–" : client.connectionsCount} - + @@ -402,9 +380,7 @@ function IntegrationsWithMissingFields({ callbackUrl: string; options: IntegrationOrApi[]; }) { - const integrationsList = options.flatMap((o) => - o.type === "integration" ? [o] : [] - ); + const integrationsList = options.flatMap((o) => (o.type === "integration" ? [o] : [])); return (
    @@ -440,8 +416,7 @@ function IntegrationsWithMissingFields({ organizationId={organizationId} button={ - {" "} - {client.title} + {client.title} } callbackUrl={callbackUrl} @@ -455,10 +430,7 @@ function IntegrationsWithMissingFields({ organizationId={organizationId} button={ - + {client.integration.name} } @@ -548,10 +520,7 @@ function ExternalIntegrationLink({ className="h-9 w-9 flex-none text-dimmed transition group-hover:border-slate-750" iconClassName="text-dimmed" /> - + {label}
    @@ -575,10 +544,7 @@ function InfoLink({ text }: { text: string }) { name="integration" className="h-9 w-9 flex-none transition group-hover:border-slate-750" /> - + {text}
    diff --git a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.integrations_.$clientParam._index/route.tsx b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.integrations_.$clientParam._index/route.tsx index a6c81e5e5..2193f90a8 100644 --- a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.integrations_.$clientParam._index/route.tsx +++ b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.integrations_.$clientParam._index/route.tsx @@ -38,9 +38,7 @@ export const loader = async ({ request, params }: LoaderArgs) => { }; export const handle: Handle = { - breadcrumb: (match) => ( - - ), + breadcrumb: (match) => , }; export default function Page() { @@ -52,12 +50,7 @@ export default function Page() { return ( {(open) => ( -
    +
    {jobs.length === 0 ? ( @@ -99,12 +92,8 @@ export default function Page() { integrationClient={client} help={client.help} /> - - View the docs to learn more about using the{" "} - {client.integration.name} Integration. + + View the docs to learn more about using the {client.integration.name} Integration.
    diff --git a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.integrations_.$clientParam.connections/route.tsx b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.integrations_.$clientParam.connections/route.tsx index f7a58f6df..7498ae1af 100644 --- a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.integrations_.$clientParam.connections/route.tsx +++ b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.integrations_.$clientParam.connections/route.tsx @@ -16,10 +16,7 @@ import { import { IntegrationClientConnectionsPresenter } from "~/presenters/IntegrationClientConnectionsPresenter.server"; import { requireUserId } from "~/services/session.server"; import { Handle } from "~/utils/handle"; -import { - IntegrationClientParamSchema, - trimTrailingSlash, -} from "~/utils/pathBuilder"; +import { IntegrationClientParamSchema, trimTrailingSlash } from "~/utils/pathBuilder"; export const loader = async ({ request, params }: LoaderArgs) => { const userId = await requireUserId(request); @@ -39,10 +36,7 @@ export const loader = async ({ request, params }: LoaderArgs) => { export const handle: Handle = { breadcrumb: (match) => ( - + ), }; @@ -74,21 +68,14 @@ export default function Page() { - - {} - - - {} - + {} + {} ); }) ) : ( - + No connections diff --git a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.integrations_.$clientParam.scopes/route.tsx b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.integrations_.$clientParam.scopes/route.tsx index 23ccb4e08..58d64fcdc 100644 --- a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.integrations_.$clientParam.scopes/route.tsx +++ b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.integrations_.$clientParam.scopes/route.tsx @@ -5,10 +5,7 @@ import { Paragraph } from "~/components/primitives/Paragraph"; import { IntegrationClientScopesPresenter } from "~/presenters/IntegrationClientScopesPresenter.server"; import { requireUserId } from "~/services/session.server"; import { Handle } from "~/utils/handle"; -import { - IntegrationClientParamSchema, - trimTrailingSlash, -} from "~/utils/pathBuilder"; +import { IntegrationClientParamSchema, trimTrailingSlash } from "~/utils/pathBuilder"; export const loader = async ({ request, params }: LoaderArgs) => { const userId = await requireUserId(request); @@ -27,9 +24,7 @@ export const loader = async ({ request, params }: LoaderArgs) => { }; export const handle: Handle = { - breadcrumb: (match) => ( - - ), + breadcrumb: (match) => , }; export default function Page() { diff --git a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.integrations_.$clientParam/route.tsx b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.integrations_.$clientParam/route.tsx index c1e2c1ce4..d38c3b48a 100644 --- a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.integrations_.$clientParam/route.tsx +++ b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.integrations_.$clientParam/route.tsx @@ -52,12 +52,7 @@ export const loader = async ({ request, params }: LoaderArgs) => { export const handle: Handle = { breadcrumb: (match) => { const data = useTypedMatchData(match); - return ( - - ); + return ; }, }; @@ -100,9 +95,7 @@ export default function Integrations() { - } + value={} /> - + diff --git a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.jobs.$jobParam._index/route.tsx b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.jobs.$jobParam._index/route.tsx index f4f0df500..d41446388 100644 --- a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.jobs.$jobParam._index/route.tsx +++ b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.jobs.$jobParam._index/route.tsx @@ -23,10 +23,7 @@ import { useJob } from "~/hooks/useJob"; import simplur from "simplur"; import { BreadcrumbLink } from "~/components/navigation/NavBar"; -export const DirectionSchema = z.union([ - z.literal("forward"), - z.literal("backward"), -]); +export const DirectionSchema = z.union([z.literal("forward"), z.literal("backward")]); export const RunListSearchSchema = z.object({ cursor: z.string().optional(), @@ -35,8 +32,7 @@ export const RunListSearchSchema = z.object({ export const loader = async ({ request, params }: LoaderArgs) => { const userId = await requireUserId(request); - const { jobParam, projectParam, organizationSlug } = - JobParamsSchema.parse(params); + const { jobParam, projectParam, organizationSlug } = JobParamsSchema.parse(params); const url = new URL(request.url); const s = Object.fromEntries(url.searchParams.entries()); @@ -58,9 +54,7 @@ export const loader = async ({ request, params }: LoaderArgs) => { }; export const handle: Handle = { - breadcrumb: (match) => ( - - ), + breadcrumb: (match) => , }; export default function Page() { @@ -80,19 +74,13 @@ export default function Page() { className="mb-2" > {simplur`This Job has ${ - job.integrations.filter((j) => j.setupStatus === "MISSING_FIELDS") - .length + job.integrations.filter((j) => j.setupStatus === "MISSING_FIELDS").length } Integration[|s] that [has|have] not been configured.`} )} {(open) => ( -
    +
    diff --git a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.jobs.$jobParam.runs.$runParam.trigger/route.tsx b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.jobs.$jobParam.runs.$runParam.trigger/route.tsx index 043effc4d..dcdd2b7e6 100644 --- a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.jobs.$jobParam.runs.$runParam.trigger/route.tsx +++ b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.jobs.$jobParam.runs.$runParam.trigger/route.tsx @@ -28,11 +28,5 @@ export default function Page() { const job = useJob(); const run = useRun(); - return ( - - ); + return ; } diff --git a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.jobs.$jobParam.runs.$runParam/route.tsx b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.jobs.$jobParam.runs.$runParam/route.tsx index 46fccf631..230a3b857 100644 --- a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.jobs.$jobParam.runs.$runParam/route.tsx +++ b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.jobs.$jobParam.runs.$runParam/route.tsx @@ -50,16 +50,10 @@ export const handle: Handle = { return ( - + {runData && runData.run && ( - + )} ); @@ -73,12 +67,9 @@ export default function Page() { const job = useJob(); const revalidator = useRevalidator(); - const events = useEventSource( - runStreamingPath(organization, project, job, run), - { - event: "message", - } - ); + const events = useEventSource(runStreamingPath(organization, project, job, run), { + event: "message", + }); useEffect(() => { if (events !== null) { revalidator.revalidate(); diff --git a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.jobs.$jobParam.test/route.tsx b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.jobs.$jobParam.test/route.tsx index f22d25d62..37cca5fa2 100644 --- a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.jobs.$jobParam.test/route.tsx +++ b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.jobs.$jobParam.test/route.tsx @@ -23,25 +23,17 @@ import { SelectTrigger, SelectValue, } from "~/components/primitives/Select"; -import { - redirectBackWithErrorMessage, - redirectWithSuccessMessage, -} from "~/models/message.server"; +import { redirectBackWithErrorMessage, redirectWithSuccessMessage } from "~/models/message.server"; import { TestJobPresenter } from "~/presenters/TestJobPresenter.server"; import { TestJobService } from "~/services/jobs/testJob.server"; import { requireUserId } from "~/services/session.server"; import { cn } from "~/utils/cn"; import { Handle } from "~/utils/handle"; -import { - JobParamsSchema, - jobRunDashboardPath, - trimTrailingSlash, -} from "~/utils/pathBuilder"; +import { JobParamsSchema, jobRunDashboardPath, trimTrailingSlash } from "~/utils/pathBuilder"; export const loader = async ({ request, params }: LoaderArgs) => { const userId = await requireUserId(request); - const { organizationSlug, projectParam, jobParam } = - JobParamsSchema.parse(params); + const { organizationSlug, projectParam, jobParam } = JobParamsSchema.parse(params); const presenter = new TestJobPresenter(); const { environments, hasTestRuns } = await presenter.call({ @@ -81,8 +73,7 @@ const schema = z.object({ //todo save the chosen environment to a cookie (for that user), use it to default the env dropdown export const action: ActionFunction = async ({ request, params }) => { - const { organizationSlug, projectParam, jobParam } = - JobParamsSchema.parse(params); + const { organizationSlug, projectParam, jobParam } = JobParamsSchema.parse(params); const formData = await request.formData(); @@ -119,9 +110,7 @@ export const action: ActionFunction = async ({ request, params }) => { }; export const handle: Handle = { - breadcrumb: (match) => ( - - ), + breadcrumb: (match) => , }; const startingJson = "{\n\n}"; @@ -134,13 +123,9 @@ export default function Page() { const [defaultJson, setDefaultJson] = useState(startingJson); const currentJson = useRef(defaultJson); - const [selectedEnvironmentId, setSelectedEnvironmentId] = useState( - environments[0].id - ); + const [selectedEnvironmentId, setSelectedEnvironmentId] = useState(environments[0].id); - const selectedEnvironment = environments.find( - (e) => e.id === selectedEnvironmentId - ); + const selectedEnvironment = environments.find((e) => e.id === selectedEnvironmentId); const insertCode = useCallback((code: string) => { setDefaultJson(code); @@ -176,8 +161,8 @@ export default function Page() { if (environments.length === 0) { return ( - Can't run a test when there are no environments. This shouldn't happen, - please contact support. + Can't run a test when there are no environments. This shouldn't happen, please contact + support. ); } @@ -185,12 +170,7 @@ export default function Page() { return ( {(open) => ( -
    +
    - {" "} + {" "} Environment {environments.map((environment) => ( - + ))} @@ -226,38 +200,37 @@ export default function Page() { - {selectedEnvironment && - selectedEnvironment.examples.length > 0 && ( - setIsExamplePopoverOpen(open)} - > - - - Insert an example - - + {selectedEnvironment && selectedEnvironment.examples.length > 0 && ( + setIsExamplePopoverOpen(open)} + > + + + Insert an example + + - - {selectedEnvironment?.examples.map((example) => ( - - ))} - - - )} + + {selectedEnvironment?.examples.map((example) => ( + + ))} + + + )}
    diff --git a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.jobs.$jobParam/route.tsx b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.jobs.$jobParam/route.tsx index 88b16bcb7..d2c563f73 100644 --- a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.jobs.$jobParam/route.tsx +++ b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.jobs.$jobParam/route.tsx @@ -38,8 +38,7 @@ import { export const loader = async ({ request, params }: LoaderArgs) => { const userId = await requireUserId(request); - const { jobParam, projectParam, organizationSlug } = - JobParamsSchema.parse(params); + const { jobParam, projectParam, organizationSlug } = JobParamsSchema.parse(params); const jobsPresenter = new JobListPresenter(); @@ -74,10 +73,7 @@ export const handle: Handle = { const projectMatch = matches.find((m) => m.id === projectMatchId); return ( - + @@ -114,14 +110,8 @@ export default function Job() { - - {job.dynamic && ( - - )} + + {job.dynamic && } {job.properties && job.properties.map((property, index) => ( @@ -138,11 +128,7 @@ export default function Job() { value={ {job.integrations.map((integration, index) => ( - + ))} } diff --git a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.triggers._index/route.tsx b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.triggers._index/route.tsx index d7073c457..bf8fd8670 100644 --- a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.triggers._index/route.tsx +++ b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.triggers._index/route.tsx @@ -23,11 +23,7 @@ import { TriggersPresenter } from "~/presenters/TriggersPresenter.server"; import { requireUser } from "~/services/session.server"; import { cn } from "~/utils/cn"; import { Handle } from "~/utils/handle"; -import { - ProjectParamSchema, - externalTriggerPath, - trimTrailingSlash, -} from "~/utils/pathBuilder"; +import { ProjectParamSchema, externalTriggerPath, trimTrailingSlash } from "~/utils/pathBuilder"; export const loader = async ({ request, params }: LoaderArgs) => { const user = await requireUser(request); @@ -45,10 +41,7 @@ export const loader = async ({ request, params }: LoaderArgs) => { export const handle: Handle = { breadcrumb: (match) => ( - + ), expandSidebar: true, }; @@ -61,8 +54,7 @@ export default function Integrations() { return ( <> - External Triggers get registered with external APIs, for example a - webhook. + External Triggers get registered with external APIs, for example a webhook. @@ -80,17 +72,11 @@ export default function Integrations() { triggers.map((t) => { const path = externalTriggerPath(organization, project, t); return ( - +
    - {Object.entries(t.params).map( - ([label, value], index) => ( - - ) - )} + {Object.entries(t.params).map(([label, value], index) => ( + + ))}
    } content={
    - {Object.entries(t.params).map( - ([label, value], index) => ( - - ) - )} + {Object.entries(t.params).map(([label, value], index) => ( + + ))}
    } /> diff --git a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.triggers.scheduled/route.tsx b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.triggers.scheduled/route.tsx index 90f9b12f1..fe1199439 100644 --- a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.triggers.scheduled/route.tsx +++ b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.triggers.scheduled/route.tsx @@ -23,11 +23,7 @@ import { useProject } from "~/hooks/useProject"; import { ScheduledTriggersPresenter } from "~/presenters/ScheduledTriggersPresenter.server"; import { requireUser } from "~/services/session.server"; import { Handle } from "~/utils/handle"; -import { - ProjectParamSchema, - docsPath, - trimTrailingSlash, -} from "~/utils/pathBuilder"; +import { ProjectParamSchema, docsPath, trimTrailingSlash } from "~/utils/pathBuilder"; export const loader = async ({ request, params }: LoaderArgs) => { const user = await requireUser(request); @@ -45,10 +41,7 @@ export const loader = async ({ request, params }: LoaderArgs) => { export const handle: Handle = { breadcrumb: (match) => ( - + ), expandSidebar: true, }; @@ -61,8 +54,8 @@ export default function Integrations() { return ( <> - A Scheduled Trigger runs a Job on a repeated schedule. The schedule can - use a CRON expression or an interval. + A Scheduled Trigger runs a Job on a repeated schedule. The schedule can use a CRON + expression or an interval.
    @@ -96,10 +89,7 @@ export default function Integrations() { ) : ( <> - + Won't run in DEV @@ -146,18 +134,10 @@ export default function Integrations() { )} - {t.lastEventTimestamp ? ( - - ) : ( - "–" - )} + {t.lastEventTimestamp ? : "–"} - {t.nextEventTimestamp ? ( - - ) : ( - "–" - )} + {t.nextEventTimestamp ? : "–"} ); diff --git a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.triggers/route.tsx b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.triggers/route.tsx index c1b2bcc87..c340d77c6 100644 --- a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.triggers/route.tsx +++ b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.triggers/route.tsx @@ -21,9 +21,7 @@ import { } from "~/utils/pathBuilder"; export const handle: Handle = { - breadcrumb: (match) => ( - - ), + breadcrumb: (match) => , }; export default function Page() { diff --git a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.triggers_.external.$triggerParam/route.tsx b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.triggers_.external.$triggerParam/route.tsx index 04d1bd06e..d55a80a24 100644 --- a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.triggers_.external.$triggerParam/route.tsx +++ b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.triggers_.external.$triggerParam/route.tsx @@ -46,8 +46,7 @@ import { redirectWithSuccessMessage } from "~/models/message.server"; export const loader = async ({ request, params }: LoaderArgs) => { const user = await requireUser(request); - const { organizationSlug, projectParam, triggerParam } = - TriggerSourceParamSchema.parse(params); + const { organizationSlug, projectParam, triggerParam } = TriggerSourceParamSchema.parse(params); const url = new URL(request.url); const s = Object.fromEntries(url.searchParams.entries()); @@ -79,8 +78,7 @@ const schema = z.object({ export const action: ActionFunction = async ({ request, params }) => { const userId = await requireUserId(request); - const { organizationSlug, projectParam, triggerParam } = - TriggerSourceParamSchema.parse(params); + const { organizationSlug, projectParam, triggerParam } = TriggerSourceParamSchema.parse(params); const formData = await request.formData(); const submission = parse(formData, { schema }); @@ -95,11 +93,7 @@ export const action: ActionFunction = async ({ request, params }) => { const result = await service.call(triggerParam, submission.value.jobId); return redirectWithSuccessMessage( - externalTriggerPath( - { slug: organizationSlug }, - { slug: projectParam }, - { id: triggerParam } - ), + externalTriggerPath({ slug: organizationSlug }, { slug: projectParam }, { id: triggerParam }), request, `Retrying registration now` ); @@ -118,15 +112,9 @@ export const handle: Handle = { return ( - + - + @@ -170,20 +157,14 @@ export default function Page() { + } /> External Trigger registration runs - External Triggers need to be registered with the external service. - You can see the list of attempted registrations below. + External Triggers need to be registered with the external service. You can see the list + of attempted registrations below. {!trigger.active && (trigger.registrationJob ? ( - - + + Registration hasn't succeeded yet, check the runs below. ) : ( - - This External Trigger hasn't registered successfully. Contact - support for help: {trigger.id} + + This External Trigger hasn't registered successfully. Contact support for help:{" "} + {trigger.id} ))} {trigger.runList ? ( <> - + - + ) : ( No registration runs found diff --git a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.triggers_.external.$triggerParam_.runs.$runParam/route.tsx b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.triggers_.external.$triggerParam_.runs.$runParam/route.tsx index d37fc0c50..557b674c9 100644 --- a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.triggers_.external.$triggerParam_.runs.$runParam/route.tsx +++ b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.triggers_.external.$triggerParam_.runs.$runParam/route.tsx @@ -73,15 +73,9 @@ export const handle: Handle = { return ( - + - + { console.error(error); throw new Response(undefined, { status: 400, - statusText: - "Something went wrong, if this problem persists please contact support.", + statusText: "Something went wrong, if this problem persists please contact support.", }); } }; @@ -75,9 +71,5 @@ export default function Project() { export function ErrorBoundary() { const org = useOrganization(); const project = useProject(); - return ( - - ); + return ; } diff --git a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.new/route.tsx b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.new/route.tsx index 2baf07826..199d16b2c 100644 --- a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.new/route.tsx +++ b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.new/route.tsx @@ -22,10 +22,7 @@ import { requireUserId } from "~/services/session.server"; import { organizationPath, projectPath } from "~/utils/pathBuilder"; const schema = z.object({ - projectName: z - .string() - .min(3, "Project name must have at least 3 characters") - .max(50), + projectName: z.string().min(3, "Project name must have at least 3 characters").max(50), }); export const action: ActionFunction = async ({ request, params }) => { @@ -86,25 +83,16 @@ export default function NewOrganizationPage() { placeholder="Your project name" icon="folder" /> - - {projectName.error} - + {projectName.error} + } cancelButton={ - + Cancel } diff --git a/apps/webapp/app/routes/_app.orgs.$organizationSlug.team/route.tsx b/apps/webapp/app/routes/_app.orgs.$organizationSlug.team/route.tsx index 927badb3a..c1aeacfad 100644 --- a/apps/webapp/app/routes/_app.orgs.$organizationSlug.team/route.tsx +++ b/apps/webapp/app/routes/_app.orgs.$organizationSlug.team/route.tsx @@ -4,11 +4,7 @@ import { UserPlusIcon } from "@heroicons/react/20/solid"; import { Form, useActionData } from "@remix-run/react"; import { ActionFunction, LoaderArgs, json } from "@remix-run/server-runtime"; import { useState } from "react"; -import { - UseDataFunctionReturn, - typedjson, - useTypedLoaderData, -} from "remix-typedjson"; +import { UseDataFunctionReturn, typedjson, useTypedLoaderData } from "remix-typedjson"; import invariant from "tiny-invariant"; import { z } from "zod"; import { UserAvatar } from "~/components/UserProfilePhoto"; @@ -23,28 +19,17 @@ import { AlertTitle, AlertTrigger, } from "~/components/primitives/Alert"; -import { - Button, - ButtonContent, - LinkButton, -} from "~/components/primitives/Buttons"; +import { Button, ButtonContent, LinkButton } from "~/components/primitives/Buttons"; import { Header2, Header3 } from "~/components/primitives/Headers"; import { NamedIcon } from "~/components/primitives/NamedIcon"; import { Paragraph } from "~/components/primitives/Paragraph"; import { SimpleTooltip } from "~/components/primitives/Tooltip"; import { useOrganization } from "~/hooks/useOrganizations"; import { useUser } from "~/hooks/useUser"; -import { - getTeamMembersAndInvites, - removeTeamMember, -} from "~/models/member.server"; +import { getTeamMembersAndInvites, removeTeamMember } from "~/models/member.server"; import { redirectWithSuccessMessage } from "~/models/message.server"; import { requireUserId } from "~/services/session.server"; -import { - inviteTeamMemberPath, - organizationTeamPath, - resendInvitePath, -} from "~/utils/pathBuilder"; +import { inviteTeamMemberPath, organizationTeamPath, resendInvitePath } from "~/utils/pathBuilder"; import { OrgAdminHeader } from "../_app.orgs.$organizationSlug._index/OrgAdminHeader"; import { DateTime } from "~/components/primitives/DateTime"; @@ -92,11 +77,7 @@ export const action: ActionFunction = async ({ request, params }) => { }); if (deletedMember.userId === userId) { - return redirectWithSuccessMessage( - "/", - request, - `You left the organization` - ); + return redirectWithSuccessMessage("/", request, `You left the organization`); } return redirectWithSuccessMessage( @@ -133,9 +114,7 @@ export default function Page() {
    {member.user.name}{" "} - {member.user.id === user.id && ( - (You) - )} + {member.user.id === user.id && (You)} {member.user.email}
    @@ -145,11 +124,7 @@ export default function Page() { {titleCase(member.role.toLocaleLowerCase())} */} - + ))} @@ -209,10 +184,7 @@ function LeaveRemoveButton({ return ( + Leave team } @@ -238,9 +210,7 @@ function LeaveRemoveButton({ diff --git a/apps/webapp/app/routes/_app.orgs.$organizationSlug/route.tsx b/apps/webapp/app/routes/_app.orgs.$organizationSlug/route.tsx index e9b3ca38b..2cd410cda 100644 --- a/apps/webapp/app/routes/_app.orgs.$organizationSlug/route.tsx +++ b/apps/webapp/app/routes/_app.orgs.$organizationSlug/route.tsx @@ -7,10 +7,7 @@ import { RouteErrorDisplay } from "~/components/ErrorDisplay"; import { useOrganization } from "~/hooks/useOrganizations"; import { getOrganizationFromSlug } from "~/models/organization.server"; import { analytics } from "~/services/analytics.server"; -import { - commitCurrentOrgSession, - setCurrentOrg, -} from "~/services/currentOrganization.server"; +import { commitCurrentOrgSession, setCurrentOrg } from "~/services/currentOrganization.server"; import { requireUserId } from "~/services/session.server"; import { organizationPath } from "~/utils/pathBuilder"; @@ -54,11 +51,7 @@ export default function Organization() { export function ErrorBoundary() { const org = useOrganization(); - return ( - - ); + return ; } export const shouldRevalidate: ShouldRevalidateFunction = (options) => { diff --git a/apps/webapp/app/routes/_app.orgs.new/route.tsx b/apps/webapp/app/routes/_app.orgs.new/route.tsx index 360af53aa..9442bacdc 100644 --- a/apps/webapp/app/routes/_app.orgs.new/route.tsx +++ b/apps/webapp/app/routes/_app.orgs.new/route.tsx @@ -65,10 +65,7 @@ export default function NewOrganizationPage() { return (
    - +
    @@ -89,18 +86,12 @@ export default function NewOrganizationPage() { icon="folder" /> Your Jobs will live inside this Project. - - {projectName.error} - + {projectName.error} + } diff --git a/apps/webapp/app/routes/_app/route.tsx b/apps/webapp/app/routes/_app/route.tsx index 1cc54fbfd..4377f3af1 100644 --- a/apps/webapp/app/routes/_app/route.tsx +++ b/apps/webapp/app/routes/_app/route.tsx @@ -4,10 +4,7 @@ import { redirect, typedjson, useTypedLoaderData } from "remix-typedjson"; import { RouteErrorDisplay } from "~/components/ErrorDisplay"; import { ImpersonationBanner } from "~/components/ImpersonationBanner"; import { NoMobileOverlay } from "~/components/NoMobileOverlay"; -import { - AppContainer, - MainCenteredContainer, -} from "~/components/layout/AppLayout"; +import { AppContainer, MainCenteredContainer } from "~/components/layout/AppLayout"; import { NavBar } from "~/components/navigation/NavBar"; import { featuresForRequest } from "~/features.server"; import { useIsProjectChildPage } from "~/hooks/useIsProjectChildPage"; @@ -16,10 +13,7 @@ import { getOrganizations } from "~/models/organization.server"; import { getImpersonationId } from "~/services/impersonation.server"; import { clearRedirectTo, commitSession } from "~/services/redirectTo.server"; import { requireUser } from "~/services/session.server"; -import { - confirmBasicDetailsPath, - invitationCodePath, -} from "~/utils/pathBuilder"; +import { confirmBasicDetailsPath, invitationCodePath } from "~/utils/pathBuilder"; export const loader = async ({ request }: LoaderArgs) => { const user = await requireUser(request); @@ -29,11 +23,7 @@ export const loader = async ({ request }: LoaderArgs) => { const url = new URL(request.url); - if ( - features.isManagedCloud && - !user.invitationCodeId && - url.pathname !== invitationCodePath() - ) { + if (features.isManagedCloud && !user.invitationCodeId && url.pathname !== invitationCodePath()) { throw redirect(invitationCodePath()); } @@ -48,9 +38,7 @@ export const loader = async ({ request }: LoaderArgs) => { impersonationId, }, { - headers: [ - ["Set-Cookie", await commitSession(await clearRedirectTo(request))], - ], + headers: [["Set-Cookie", await commitSession(await clearRedirectTo(request))]], } ); }; @@ -60,18 +48,12 @@ export const shouldRevalidate: ShouldRevalidateFunction = (options) => { if (options.formAction === "/orgs/new") return true; //added a project - if ( - options.formAction && - /^\/orgs\/[^\/]+\/projects\/new$/i.test(options.formAction) - ) { + if (options.formAction && /^\/orgs\/[^\/]+\/projects\/new$/i.test(options.formAction)) { return true; } //left a team - if ( - options.formAction && - /^\/orgs\/[^\/]+\/team$/i.test(options.formAction) - ) { + if (options.formAction && /^\/orgs\/[^\/]+\/team$/i.test(options.formAction)) { return true; } @@ -86,9 +68,7 @@ export default function App() { return ( <> - {impersonationId && ( - - )} + {impersonationId && } diff --git a/apps/webapp/app/routes/admin._index.tsx b/apps/webapp/app/routes/admin._index.tsx index 18f92ea2d..77f30bbe4 100644 --- a/apps/webapp/app/routes/admin._index.tsx +++ b/apps/webapp/app/routes/admin._index.tsx @@ -5,10 +5,7 @@ import { typedjson, useTypedLoaderData } from "remix-typedjson"; import { z } from "zod"; import { Button } from "~/components/primitives/Buttons"; import { adminGetUsers } from "~/models/admin.server"; -import { - commitImpersonationSession, - setImpersonationId, -} from "~/services/impersonation.server"; +import { commitImpersonationSession, setImpersonationId } from "~/services/impersonation.server"; export async function loader() { const users = await adminGetUsers(); @@ -75,10 +72,7 @@ export default function AdminDashboardRoute() {
    {users.map((user) => { return ( - + - +
    {user.email} {user.id} - {user.createdAt.toISOString()} - {user.createdAt.toISOString()} {user.admin ? "✅" : ""} diff --git a/apps/webapp/app/routes/admin.tsx b/apps/webapp/app/routes/admin.tsx index 73bb44796..9b83ce228 100644 --- a/apps/webapp/app/routes/admin.tsx +++ b/apps/webapp/app/routes/admin.tsx @@ -33,11 +33,7 @@ export default function Page() { <>
    - + setMobileMenuOpen(false)} > Close sidebar -
    @@ -114,10 +107,7 @@ export default function Page() { } diff --git a/apps/webapp/app/routes/healthcheck.tsx b/apps/webapp/app/routes/healthcheck.tsx index df0656b00..a42c70710 100644 --- a/apps/webapp/app/routes/healthcheck.tsx +++ b/apps/webapp/app/routes/healthcheck.tsx @@ -3,8 +3,7 @@ import { prisma } from "~/db.server"; import type { LoaderFunction } from "@remix-run/node"; export const loader: LoaderFunction = async ({ request }) => { - const host = - request.headers.get("X-Forwarded-Host") ?? request.headers.get("host"); + const host = request.headers.get("X-Forwarded-Host") ?? request.headers.get("host"); try { const url = new URL("/", `http://${host}`); diff --git a/apps/webapp/app/routes/invitation-code.tsx b/apps/webapp/app/routes/invitation-code.tsx index e4fa437a3..710a5a693 100644 --- a/apps/webapp/app/routes/invitation-code.tsx +++ b/apps/webapp/app/routes/invitation-code.tsx @@ -3,10 +3,7 @@ import { parse } from "@conform-to/zod"; import { Form, useActionData } from "@remix-run/react"; import { ActionArgs, json } from "@remix-run/server-runtime"; import { z } from "zod"; -import { - AppContainer, - MainCenteredContainer, -} from "~/components/layout/AppLayout"; +import { AppContainer, MainCenteredContainer } from "~/components/layout/AppLayout"; import { NavBar } from "~/components/navigation/NavBar"; import { Button } from "~/components/primitives/Buttons"; import { Fieldset } from "~/components/primitives/Fieldset"; @@ -150,11 +147,7 @@ export default function Page() { + } diff --git a/apps/webapp/app/routes/invite-accept.tsx b/apps/webapp/app/routes/invite-accept.tsx index 3868e262a..69851316a 100644 --- a/apps/webapp/app/routes/invite-accept.tsx +++ b/apps/webapp/app/routes/invite-accept.tsx @@ -1,9 +1,6 @@ import type { LoaderArgs } from "@remix-run/server-runtime"; import { getInviteFromToken } from "~/models/member.server"; -import { - redirectWithErrorMessage, - redirectWithSuccessMessage, -} from "~/models/message.server"; +import { redirectWithErrorMessage, redirectWithSuccessMessage } from "~/models/message.server"; import { getUser } from "~/services/session.server"; export async function loader({ request }: LoaderArgs) { @@ -32,12 +29,9 @@ export async function loader({ request }: LoaderArgs) { } if (!user) { - return redirectWithSuccessMessage( - "/", - request, - "Please log in to accept the invite.", - { ephemeral: false } - ); + return redirectWithSuccessMessage("/", request, "Please log in to accept the invite.", { + ephemeral: false, + }); } if (invite.email !== user.email) { diff --git a/apps/webapp/app/routes/invites.tsx b/apps/webapp/app/routes/invites.tsx index d3af5bc30..43006e992 100644 --- a/apps/webapp/app/routes/invites.tsx +++ b/apps/webapp/app/routes/invites.tsx @@ -5,10 +5,7 @@ import { Form, useActionData } from "@remix-run/react"; import { typedjson, useTypedLoaderData } from "remix-typedjson"; import { z } from "zod"; import simplur from "simplur"; -import { - AppContainer, - MainCenteredContainer, -} from "~/components/layout/AppLayout"; +import { AppContainer, MainCenteredContainer } from "~/components/layout/AppLayout"; import { NavBar } from "~/components/navigation/NavBar"; import { Button } from "~/components/primitives/Buttons"; import { Fieldset } from "~/components/primitives/Fieldset"; @@ -16,11 +13,7 @@ import { FormTitle } from "~/components/primitives/FormTitle"; import { Header2, Header3 } from "~/components/primitives/Headers"; import { InputGroup } from "~/components/primitives/InputGroup"; import { Paragraph } from "~/components/primitives/Paragraph"; -import { - acceptInvite, - declineInvite, - getUsersInvites, -} from "~/models/member.server"; +import { acceptInvite, declineInvite, getUsersInvites } from "~/models/member.server"; import { redirectWithSuccessMessage } from "~/models/message.server"; import { requireUser, requireUserId } from "~/services/session.server"; import { invitesPath, organizationsPath } from "~/utils/pathBuilder"; @@ -123,12 +116,9 @@ export default function Page() {
    - - {invite.organization.title} - + {invite.organization.title} - Invited by{" "} - {invite.inviter.displayName ?? invite.inviter.email} + Invited by {invite.inviter.displayName ?? invite.inviter.email}
    diff --git a/apps/webapp/app/routes/login._index/route.tsx b/apps/webapp/app/routes/login._index/route.tsx index cea8ddd5c..20bab4c24 100644 --- a/apps/webapp/app/routes/login._index/route.tsx +++ b/apps/webapp/app/routes/login._index/route.tsx @@ -1,16 +1,8 @@ import type { LoaderArgs } from "@remix-run/node"; import { Form } from "@remix-run/react"; -import { - TypedMetaFunction, - redirect, - typedjson, - useTypedLoaderData, -} from "remix-typedjson"; +import { TypedMetaFunction, redirect, typedjson, useTypedLoaderData } from "remix-typedjson"; import { LogoIcon } from "~/components/LogoIcon"; -import { - AppContainer, - MainCenteredContainer, -} from "~/components/layout/AppLayout"; +import { AppContainer, MainCenteredContainer } from "~/components/layout/AppLayout"; import { Button, LinkButton } from "~/components/primitives/Buttons"; import { Fieldset } from "~/components/primitives/Fieldset"; import { FormTitle } from "~/components/primitives/FormTitle"; @@ -24,9 +16,7 @@ import { getUserId } from "~/services/session.server"; import { appEnvTitleTag } from "~/utils"; import { requestUrl } from "~/utils/requestUrl.server"; -export const meta: TypedMetaFunction = ({ - parentsData, -}) => ({ +export const meta: TypedMetaFunction = ({ parentsData }) => ({ title: `Login to Trigger.dev${appEnvTitleTag(parentsData?.root.appEnv)}`, }); @@ -63,9 +53,7 @@ export default function LoginPage() {
    @@ -81,16 +69,10 @@ export default function LoginPage() { Continue with GitHub )} - + Continue with Email @@ -101,10 +83,7 @@ export default function LoginPage() { terms {" "}and{" "} - + privacy {" "}policy. diff --git a/apps/webapp/app/routes/login.magic/route.tsx b/apps/webapp/app/routes/login.magic/route.tsx index 5fde82f0b..34bd5462b 100644 --- a/apps/webapp/app/routes/login.magic/route.tsx +++ b/apps/webapp/app/routes/login.magic/route.tsx @@ -1,17 +1,10 @@ import type { ActionArgs, LoaderArgs } from "@remix-run/node"; import { redirect } from "@remix-run/node"; import { Form, useTransition } from "@remix-run/react"; -import { - TypedMetaFunction, - typedjson, - useTypedLoaderData, -} from "remix-typedjson"; +import { TypedMetaFunction, typedjson, useTypedLoaderData } from "remix-typedjson"; import { z } from "zod"; import { LogoIcon } from "~/components/LogoIcon"; -import { - AppContainer, - MainCenteredContainer, -} from "~/components/layout/AppLayout"; +import { AppContainer, MainCenteredContainer } from "~/components/layout/AppLayout"; import { Button, LinkButton } from "~/components/primitives/Buttons"; import { Fieldset } from "~/components/primitives/Fieldset"; import { FormButtons } from "~/components/primitives/FormButtons"; @@ -22,19 +15,14 @@ import { Label } from "~/components/primitives/Label"; import { NamedIcon } from "~/components/primitives/NamedIcon"; import { Paragraph } from "~/components/primitives/Paragraph"; import { authenticator } from "~/services/auth.server"; -import { - commitSession, - getUserSession, -} from "~/services/sessionStorage.server"; +import { commitSession, getUserSession } from "~/services/sessionStorage.server"; import magicLinkIcon from "./login.magic.svg"; import type { LoaderType as RootLoader } from "~/root"; import { appEnvTitleTag } from "~/utils"; import { TextLink } from "~/components/primitives/TextLink"; -export const meta: TypedMetaFunction = ({ - parentsData, -}) => ({ +export const meta: TypedMetaFunction = ({ parentsData }) => ({ title: `Login to Trigger.dev${appEnvTitleTag(parentsData?.root.appEnv)}`, }); @@ -98,15 +86,12 @@ export default function LoginMagicLinkPage() { {magicLinkSent ? ( <> - +
    - We sent you an email which contains a magic link that will - log you in to your account. + We sent you an email which contains a magic link that will log you in to your + account. {isLoading ? "Sending…" : "Send a magic link"} @@ -168,10 +151,7 @@ export default function LoginMagicLinkPage() { terms {" "} and{" "} - + privacy {" "} policy. diff --git a/apps/webapp/app/routes/oauth2.callback.ts b/apps/webapp/app/routes/oauth2.callback.ts index 334eb5b95..5245501c2 100644 --- a/apps/webapp/app/routes/oauth2.callback.ts +++ b/apps/webapp/app/routes/oauth2.callback.ts @@ -24,9 +24,7 @@ export async function loader({ request }: LoaderArgs) { const url = requestUrl(request); - const parsedParams = ParamsSchema.safeParse( - Object.fromEntries(url.searchParams) - ); + const parsedParams = ParamsSchema.safeParse(Object.fromEntries(url.searchParams)); if (!parsedParams.success) { // TODO: this should redirect to the integrations page (need to lookup orgid in cookie) diff --git a/apps/webapp/app/routes/resources.connection.$organizationId.oauth2.$integrationId.ts b/apps/webapp/app/routes/resources.connection.$organizationId.oauth2.$integrationId.ts index 9105cfc87..179460218 100644 --- a/apps/webapp/app/routes/resources.connection.$organizationId.oauth2.$integrationId.ts +++ b/apps/webapp/app/routes/resources.connection.$organizationId.oauth2.$integrationId.ts @@ -12,9 +12,7 @@ export const schema = z .object({ integrationIdentifier: z.string(), integrationAuthMethod: z.string(), - title: z - .string() - .min(2, "The title must be unique and at least 2 characters long"), + title: z.string().min(2, "The title must be unique and at least 2 characters long"), description: z.string().optional(), hasCustomClient: z.preprocess((value) => value === "on", z.boolean()), customClientId: z.string().optional(), @@ -101,22 +99,21 @@ export async function action({ request, params }: ActionArgs) { const url = requestUrl(request); - const redirectUrl = - await integrationAuthRepository.populateMissingConnectionClientFields({ - id: integrationId, - customClient: hasCustomClient - ? { id: customClientId!, secret: customClientSecret! } - : undefined, - clientType, - organizationId: organization.id, - integrationIdentifier, - integrationAuthMethod, - scopes, - title, - description, - redirectTo, - url, - }); + const redirectUrl = await integrationAuthRepository.populateMissingConnectionClientFields({ + id: integrationId, + customClient: hasCustomClient + ? { id: customClientId!, secret: customClientSecret! } + : undefined, + clientType, + organizationId: organization.id, + integrationIdentifier, + integrationAuthMethod, + scopes, + title, + description, + redirectTo, + url, + }); return redirect(redirectUrl); } diff --git a/apps/webapp/app/routes/resources.environments.$environmentParam.endpoint.stream.ts b/apps/webapp/app/routes/resources.environments.$environmentParam.endpoint.stream.ts index fb960487b..24033db09 100644 --- a/apps/webapp/app/routes/resources.environments.$environmentParam.endpoint.stream.ts +++ b/apps/webapp/app/routes/resources.environments.$environmentParam.endpoint.stream.ts @@ -7,9 +7,7 @@ import { sse } from "~/utils/sse"; export async function loader({ request, params }: LoaderArgs) { await requireUserId(request); - const { environmentParam } = z - .object({ environmentParam: z.string() }) - .parse(params); + const { environmentParam } = z.object({ environmentParam: z.string() }).parse(params); const environment = await environmentForUpdates(environmentParam); @@ -32,13 +30,11 @@ export async function loader({ request, params }: LoaderArgs) { if (lastSignals.lastUpdatedAt !== result.updatedAt.getTime()) { send({ data: result.updatedAt.toISOString() }); } else if ( - lastSignals.lastTotalEndpointUpdatedTime !== - newSignals.lastTotalEndpointUpdatedTime + lastSignals.lastTotalEndpointUpdatedTime !== newSignals.lastTotalEndpointUpdatedTime ) { send({ data: new Date().toISOString() }); } else if ( - lastSignals.lastTotalIndexingUpdatedTime !== - newSignals.lastTotalIndexingUpdatedTime + lastSignals.lastTotalIndexingUpdatedTime !== newSignals.lastTotalIndexingUpdatedTime ) { send({ data: new Date().toISOString() }); } @@ -79,11 +75,7 @@ function calculateChangeSignals( ); let lastTotalIndexingUpdatedTime = environment.endpoints.reduce( (prev, endpoint) => - prev + - endpoint.indexings.reduce( - (prev, indexing) => prev + indexing.updatedAt.getTime(), - 0 - ), + prev + endpoint.indexings.reduce((prev, indexing) => prev + indexing.updatedAt.getTime(), 0), 0 ); diff --git a/apps/webapp/app/routes/resources.feedback.ts b/apps/webapp/app/routes/resources.feedback.ts index 2e48511c4..7ac567436 100644 --- a/apps/webapp/app/routes/resources.feedback.ts +++ b/apps/webapp/app/routes/resources.feedback.ts @@ -24,16 +24,10 @@ export const feedbackTypeLabel = { export type FeedbackType = keyof typeof feedbackTypeLabel; -const feedbackTypeLiterals = Object.keys(feedbackTypeLabel).map((key) => - z.literal(key) -); +const feedbackTypeLiterals = Object.keys(feedbackTypeLabel).map((key) => z.literal(key)); const feedbackType = z.union( - [ - feedbackTypeLiterals[0], - feedbackTypeLiterals[1], - ...feedbackTypeLiterals.slice(2), - ], + [feedbackTypeLiterals[0], feedbackTypeLiterals[1], ...feedbackTypeLiterals.slice(2)], { required_error: "Must be either 'bug' or 'feature'", invalid_type_error: "Must be either 'bug' or 'feature'", @@ -101,8 +95,7 @@ export async function action({ request }: ActionArgs) { return json(submission); } - const title = - feedbackTypeLabel[submission.value.feedbackType as FeedbackType]; + const title = feedbackTypeLabel[submission.value.feedbackType as FeedbackType]; const upsertTimelineEntryRes = await client.upsertCustomTimelineEntry({ customerId: upsertCustomerRes.data.customer.id, title, diff --git a/apps/webapp/app/routes/resources.impersonation.ts b/apps/webapp/app/routes/resources.impersonation.ts index ba737b1c0..57f032bf4 100644 --- a/apps/webapp/app/routes/resources.impersonation.ts +++ b/apps/webapp/app/routes/resources.impersonation.ts @@ -1,9 +1,6 @@ import type { ActionArgs } from "@remix-run/server-runtime"; import { redirect } from "remix-typedjson"; -import { - clearImpersonationId, - commitImpersonationSession, -} from "~/services/impersonation.server"; +import { clearImpersonationId, commitImpersonationSession } from "~/services/impersonation.server"; export async function action({ request }: ActionArgs) { const session = await clearImpersonationId(request); diff --git a/apps/webapp/app/routes/resources.runs.$runId.rerun.ts b/apps/webapp/app/routes/resources.runs.$runId.rerun.ts index 51743ad25..3e232617b 100644 --- a/apps/webapp/app/routes/resources.runs.$runId.rerun.ts +++ b/apps/webapp/app/routes/resources.runs.$runId.rerun.ts @@ -1,10 +1,7 @@ import { parse } from "@conform-to/zod"; import { ActionFunction, json } from "@remix-run/node"; import { z } from "zod"; -import { - redirectBackWithErrorMessage, - redirectWithSuccessMessage, -} from "~/models/message.server"; +import { redirectBackWithErrorMessage, redirectWithSuccessMessage } from "~/models/message.server"; import { ContinueRunService } from "~/services/runs/continueRun.server"; import { ReRunService } from "~/services/runs/reRun.server"; diff --git a/apps/webapp/app/services/apiAuth.server.ts b/apps/webapp/app/services/apiAuth.server.ts index 721a66835..ee1f46762 100644 --- a/apps/webapp/app/services/apiAuth.server.ts +++ b/apps/webapp/app/services/apiAuth.server.ts @@ -69,8 +69,6 @@ export function getApiKeyFromRequest(request: Request) { } const apiKey = authorization.data.replace(/^Bearer /, ""); - const type = isPublicApiKey(apiKey) - ? ("PUBLIC" as const) - : ("PRIVATE" as const); + const type = isPublicApiKey(apiKey) ? ("PUBLIC" as const) : ("PRIVATE" as const); return { apiKey, type }; } diff --git a/apps/webapp/app/services/apiVote.server.ts b/apps/webapp/app/services/apiVote.server.ts index a7764f7c1..e841a31d6 100644 --- a/apps/webapp/app/services/apiVote.server.ts +++ b/apps/webapp/app/services/apiVote.server.ts @@ -7,13 +7,7 @@ export class ApiVoteService { this.#prismaClient = prismaClient; } - public async call({ - userId, - identifier, - }: { - userId: string; - identifier: string; - }) { + public async call({ userId, identifier }: { userId: string; identifier: string }) { return this.#prismaClient.apiIntegrationVote.create({ data: { user: { diff --git a/apps/webapp/app/services/auth.server.ts b/apps/webapp/app/services/auth.server.ts index 67a312d59..8266537b8 100644 --- a/apps/webapp/app/services/auth.server.ts +++ b/apps/webapp/app/services/auth.server.ts @@ -14,11 +14,7 @@ const isGithubAuthSupported = typeof env.AUTH_GITHUB_CLIENT_SECRET === "string"; if (env.AUTH_GITHUB_CLIENT_ID && env.AUTH_GITHUB_CLIENT_SECRET) { - addGitHubStrategy( - authenticator, - env.AUTH_GITHUB_CLIENT_ID, - env.AUTH_GITHUB_CLIENT_SECRET - ); + addGitHubStrategy(authenticator, env.AUTH_GITHUB_CLIENT_ID, env.AUTH_GITHUB_CLIENT_SECRET); } addEmailLinkStrategy(authenticator); diff --git a/apps/webapp/app/services/currentOrganization.server.ts b/apps/webapp/app/services/currentOrganization.server.ts index ecb5b4d8a..7e6c427f5 100644 --- a/apps/webapp/app/services/currentOrganization.server.ts +++ b/apps/webapp/app/services/currentOrganization.server.ts @@ -21,9 +21,7 @@ export function commitCurrentOrgSession(session: Session) { return currentOrgSessionStorage.commitSession(session); } -export async function getCurrentOrg( - request: Request -): Promise { +export async function getCurrentOrg(request: Request): Promise { const session = await getCurrentOrgSession(request); return session.get("currentOrg"); diff --git a/apps/webapp/app/services/email.server.ts b/apps/webapp/app/services/email.server.ts index 00de0dc55..bcfa4bb03 100644 --- a/apps/webapp/app/services/email.server.ts +++ b/apps/webapp/app/services/email.server.ts @@ -13,9 +13,7 @@ const client = new EmailClient({ replyTo: env.REPLY_TO_EMAIL ?? "help@email.trigger.dev", }); -export async function sendMagicLinkEmail( - options: SendEmailOptions -): Promise { +export async function sendMagicLinkEmail(options: SendEmailOptions): Promise { return client.send({ email: "magic_link", to: options.emailAddress, @@ -25,8 +23,7 @@ export async function sendMagicLinkEmail( export async function scheduleWelcomeEmail(user: User) { //delay for one minute in development, longer in production - const delay = - process.env.NODE_ENV === "development" ? 1000 * 60 : 1000 * 60 * 22; + const delay = process.env.NODE_ENV === "development" ? 1000 * 60 : 1000 * 60 * 22; await workerQueue.enqueue( "scheduleEmail", @@ -39,10 +36,7 @@ export async function scheduleWelcomeEmail(user: User) { ); } -export async function scheduleEmail( - data: DeliverEmail, - delay?: { seconds: number } -) { +export async function scheduleEmail(data: DeliverEmail, delay?: { seconds: number }) { const runAt = delay ? new Date(Date.now() + delay.seconds * 1000) : undefined; await workerQueue.enqueue("scheduleEmail", data, { runAt }); } diff --git a/apps/webapp/app/services/endpointApi.server.ts b/apps/webapp/app/services/endpointApi.server.ts index 03481ea9a..f0af6bf68 100644 --- a/apps/webapp/app/services/endpointApi.server.ts +++ b/apps/webapp/app/services/endpointApi.server.ts @@ -113,9 +113,7 @@ export class EndpointApi { } if (!response.ok) { - throw new Error( - `Could not connect to endpoint ${this.url}. Status code: ${response.status}` - ); + throw new Error(`Could not connect to endpoint ${this.url}. Status code: ${response.status}`); } const anyBody = await response.json(); @@ -144,9 +142,7 @@ export class EndpointApi { } if (!response.ok) { - throw new Error( - `Could not connect to endpoint ${this.url}. Status code: ${response.status}` - ); + throw new Error(`Could not connect to endpoint ${this.url}. Status code: ${response.status}`); } const anyBody = await response.json(); @@ -190,10 +186,7 @@ export class EndpointApi { return { response, parser: PreprocessRunResponseSchema }; } - async initializeTrigger( - id: string, - params: any - ): Promise { + async initializeTrigger(id: string, params: any): Promise { const response = await safeFetch(this.url, { method: "POST", headers: { @@ -218,9 +211,7 @@ export class EndpointApi { throw new EndpointApiError(error.data.message, error.data.stack); } - throw new Error( - `Could not connect to endpoint ${this.url}. Status code: ${response.status}` - ); + throw new Error(`Could not connect to endpoint ${this.url}. Status code: ${response.status}`); } const anyBody = await response.json(); @@ -263,9 +254,7 @@ export class EndpointApi { } if (!response.ok) { - throw new Error( - `Could not connect to endpoint ${this.url}. Status code: ${response.status}` - ); + throw new Error(`Could not connect to endpoint ${this.url}. Status code: ${response.status}`); } const anyBody = await response.json(); diff --git a/apps/webapp/app/services/endpoints/createEndpoint.server.ts b/apps/webapp/app/services/endpoints/createEndpoint.server.ts index 83ad7e26d..936272dd7 100644 --- a/apps/webapp/app/services/endpoints/createEndpoint.server.ts +++ b/apps/webapp/app/services/endpoints/createEndpoint.server.ts @@ -5,10 +5,7 @@ import { EndpointApi } from "../endpointApi.server"; import { workerQueue } from "../worker.server"; import { env } from "~/env.server"; -const indexingHookIdentifier = customAlphabet( - "0123456789abcdefghijklmnopqrstuvxyz", - 10 -); +const indexingHookIdentifier = customAlphabet("0123456789abcdefghijklmnopqrstuvxyz", 10); export class CreateEndpointError extends Error { code: "FAILED_PING" | "FAILED_UPSERT"; diff --git a/apps/webapp/app/services/endpoints/indexEndpoint.server.ts b/apps/webapp/app/services/endpoints/indexEndpoint.server.ts index c6038ed00..d58773c93 100644 --- a/apps/webapp/app/services/endpoints/indexEndpoint.server.ts +++ b/apps/webapp/app/services/endpoints/indexEndpoint.server.ts @@ -28,11 +28,7 @@ export class IndexEndpointService { const endpoint = await findEndpoint(id); // Make a request to the endpoint to fetch a list of jobs - const client = new EndpointApi( - endpoint.environment.apiKey, - endpoint.url, - endpoint.slug - ); + const client = new EndpointApi(endpoint.environment.apiKey, endpoint.url, endpoint.slug); const indexResponse = await client.indexEndpoint(); @@ -40,8 +36,7 @@ export class IndexEndpointService { throw new Error(indexResponse.error); } - const { jobs, sources, dynamicTriggers, dynamicSchedules } = - indexResponse.data; + const { jobs, sources, dynamicTriggers, dynamicSchedules } = indexResponse.data; logger.debug("Indexing endpoint", { endpointId: endpoint.id, @@ -98,10 +93,7 @@ export class IndexEndpointService { for (const dynamicTrigger of dynamicTriggers) { try { - await this.#registerDynamicTriggerService.call( - endpoint, - dynamicTrigger - ); + await this.#registerDynamicTriggerService.call(endpoint, dynamicTrigger); indexStats.dynamicTriggers++; } catch (error) { @@ -115,10 +107,7 @@ export class IndexEndpointService { for (const dynamicSchedule of dynamicSchedules) { try { - await this.#registerDynamicScheduleService.call( - endpoint, - dynamicSchedule - ); + await this.#registerDynamicScheduleService.call(endpoint, dynamicSchedule); indexStats.dynamicSchedules++; } catch (error) { diff --git a/apps/webapp/app/services/events/deliverEvent.server.ts b/apps/webapp/app/services/events/deliverEvent.server.ts index 9d6e2044d..c51fdc077 100644 --- a/apps/webapp/app/services/events/deliverEvent.server.ts +++ b/apps/webapp/app/services/events/deliverEvent.server.ts @@ -47,9 +47,8 @@ export class DeliverEventService { eventRecord: eventRecord.id, }); - const matchingEventDispatchers = possibleEventDispatchers.filter( - (eventDispatcher) => - this.#evaluateEventRule(eventDispatcher, eventRecord) + const matchingEventDispatchers = possibleEventDispatchers.filter((eventDispatcher) => + this.#evaluateEventRule(eventDispatcher, eventRecord) ); if (matchingEventDispatchers.length === 0) { @@ -91,21 +90,14 @@ export class DeliverEventService { ); } - #evaluateEventRule( - dispatcher: EventDispatcher, - eventRecord: EventRecord - ): boolean { + #evaluateEventRule(dispatcher: EventDispatcher, eventRecord: EventRecord): boolean { if (!dispatcher.payloadFilter && !dispatcher.contextFilter) { return true; } - const payloadFilter = EventFilterSchema.safeParse( - dispatcher.payloadFilter ?? {} - ); + const payloadFilter = EventFilterSchema.safeParse(dispatcher.payloadFilter ?? {}); - const contextFilter = EventFilterSchema.safeParse( - dispatcher.contextFilter ?? {} - ); + const contextFilter = EventFilterSchema.safeParse(dispatcher.contextFilter ?? {}); if (!payloadFilter.success || !contextFilter.success) { logger.error("Invalid event filter", { diff --git a/apps/webapp/app/services/events/ingestSendEvent.server.ts b/apps/webapp/app/services/events/ingestSendEvent.server.ts index 9583dfb2d..e32576cb5 100644 --- a/apps/webapp/app/services/events/ingestSendEvent.server.ts +++ b/apps/webapp/app/services/events/ingestSendEvent.server.ts @@ -1,10 +1,5 @@ import type { RawEvent, SendEventOptions } from "@trigger.dev/core"; -import { - $transaction, - PrismaClientOrTransaction, - PrismaErrorSchema, - prisma, -} from "~/db.server"; +import { $transaction, PrismaClientOrTransaction, PrismaErrorSchema, prisma } from "~/db.server"; import type { AuthenticatedEnvironment } from "~/services/apiAuth.server"; import { workerQueue } from "~/services/worker.server"; diff --git a/apps/webapp/app/services/events/invokeDispatcher.server.ts b/apps/webapp/app/services/events/invokeDispatcher.server.ts index b53f30b1f..f43412d19 100644 --- a/apps/webapp/app/services/events/invokeDispatcher.server.ts +++ b/apps/webapp/app/services/events/invokeDispatcher.server.ts @@ -27,20 +27,19 @@ export class InvokeDispatcherService { } public async call(id: string, eventRecordId: string) { - const eventDispatcher = - await this.#prismaClient.eventDispatcher.findUniqueOrThrow({ - where: { - id, - }, - include: { - environment: { - include: { - project: true, - organization: true, - }, + const eventDispatcher = await this.#prismaClient.eventDispatcher.findUniqueOrThrow({ + where: { + id, + }, + include: { + environment: { + include: { + project: true, + organization: true, }, }, - }); + }, + }); if (!eventDispatcher.enabled) { logger.debug("Event dispatcher is disabled", { @@ -61,9 +60,7 @@ export class InvokeDispatcherService { eventRecord: eventRecord.id, }); - const dispatchable = DispatchableSchema.safeParse( - eventDispatcher.dispatchable - ); + const dispatchable = DispatchableSchema.safeParse(eventDispatcher.dispatchable); if (!dispatchable.success) { logger.debug("Invalid dispatchable", { @@ -76,15 +73,14 @@ export class InvokeDispatcherService { switch (dispatchable.data.type) { case "JOB_VERSION": { - const jobVersion = - await this.#prismaClient.jobVersion.findUniqueOrThrow({ - where: { - id: dispatchable.data.id, - }, - include: { - job: true, - }, - }); + const jobVersion = await this.#prismaClient.jobVersion.findUniqueOrThrow({ + where: { + id: dispatchable.data.id, + }, + include: { + job: true, + }, + }); const createRunService = new CreateRunService(this.#prismaClient); @@ -98,41 +94,39 @@ export class InvokeDispatcherService { break; } case "DYNAMIC_TRIGGER": { - const dynamicTrigger = - await this.#prismaClient.dynamicTrigger.findUniqueOrThrow({ - where: { - id: dispatchable.data.id, - }, - include: { - endpoint: { - include: { - environment: { - include: { - project: true, - organization: true, - }, + const dynamicTrigger = await this.#prismaClient.dynamicTrigger.findUniqueOrThrow({ + where: { + id: dispatchable.data.id, + }, + include: { + endpoint: { + include: { + environment: { + include: { + project: true, + organization: true, }, }, }, - jobs: true, }, - }); + jobs: true, + }, + }); for (const job of dynamicTrigger.jobs) { - const latestJobVersion = - await this.#prismaClient.jobVersion.findFirst({ - where: { - jobId: job.id, - aliases: { - some: { - name: "latest", - }, + const latestJobVersion = await this.#prismaClient.jobVersion.findFirst({ + where: { + jobId: job.id, + aliases: { + some: { + name: "latest", }, - environmentId: dynamicTrigger.endpoint.environmentId, }, - orderBy: { createdAt: "desc" }, - take: 1, - }); + environmentId: dynamicTrigger.endpoint.environmentId, + }, + orderBy: { createdAt: "desc" }, + take: 1, + }); if (!latestJobVersion) { continue; diff --git a/apps/webapp/app/services/externalApis/integrationAuthRepository.server.ts b/apps/webapp/app/services/externalApis/integrationAuthRepository.server.ts index f24dc972e..c36413376 100644 --- a/apps/webapp/app/services/externalApis/integrationAuthRepository.server.ts +++ b/apps/webapp/app/services/externalApis/integrationAuthRepository.server.ts @@ -11,11 +11,7 @@ import type { import jsonpointer from "jsonpointer"; import { customAlphabet } from "nanoid"; import * as crypto from "node:crypto"; -import type { - PrismaClient, - PrismaClientOrTransaction, - PrismaTransactionClient, -} from "~/db.server"; +import type { PrismaClient, PrismaClientOrTransaction, PrismaTransactionClient } from "~/db.server"; import { prisma } from "~/db.server"; import { env } from "~/env.server"; import { workerQueue } from "~/services/worker.server"; @@ -72,9 +68,7 @@ export class IntegrationAuthRepository { }, }); - return clients.map((c) => - this.#enrichIntegration(c, c.definition, c.authMethod) - ); + return clients.map((c) => this.#enrichIntegration(c, c.definition, c.authMethod)); } async createConnectionClient({ @@ -326,13 +320,11 @@ export class IntegrationAuthRepository { clientSecret: clientConfig.secret, key: connectionAttempt.id, callbackUrl, - scopeParamName: - authMethod.config.authorization.scopeParamName ?? "scope", + scopeParamName: authMethod.config.authorization.scopeParamName ?? "scope", scopes: integration.scopes, scopeSeparator: authMethod.config.authorization.scopeSeparator, pkceCode, - authorizationLocation: - authMethod.config.authorization.authorizationLocation ?? "body", + authorizationLocation: authMethod.config.authorization.authorizationLocation ?? "body", extraParameters: authMethod.config.authorization.extraParameters, }; @@ -344,9 +336,7 @@ export class IntegrationAuthRepository { return authorizationUrl; } default: { - throw new Error( - `Authentication method type ${authMethod.type} not supported` - ); + throw new Error(`Authentication method type ${authMethod.type} not supported`); } } } @@ -362,9 +352,7 @@ export class IntegrationAuthRepository { url: URL; customOAuthClient?: OAuthClient; }) { - const { definition, authMethod } = await this.#getDefinitionAndAuthMethod( - attempt.integration - ); + const { definition, authMethod } = await this.#getDefinitionAndAuthMethod(attempt.integration); switch (authMethod.type) { case "oauth2": { @@ -391,21 +379,15 @@ export class IntegrationAuthRepository { requestedScopes: attempt.integration.scopes, scopeSeparator: authMethod.config.authorization.scopeSeparator, pkceCode: attempt.securityCode ?? undefined, - accessTokenPointer: - authMethod.config.token.accessTokenPointer ?? "/access_token", - refreshTokenPointer: - authMethod.config.token.refreshTokenPointer ?? "/refresh_token", - expiresInPointer: - authMethod.config.token.expiresInPointer ?? "/expires_in", + accessTokenPointer: authMethod.config.token.accessTokenPointer ?? "/access_token", + refreshTokenPointer: authMethod.config.token.refreshTokenPointer ?? "/refresh_token", + expiresInPointer: authMethod.config.token.expiresInPointer ?? "/expires_in", scopePointer: authMethod.config.token.scopePointer ?? "/scope", authorizationMethod: authMethod.config.token.authorizationMethod, bodyFormat: authMethod.config.token.bodyFormat, }; - const token = await grantOAuth2Token( - params, - authMethod.config.token.grantTokenStrategy - ); + const token = await grantOAuth2Token(params, authMethod.config.token.grantTokenStrategy); //this key is used to store in the relevant SecretStore const hashedAccessToken = crypto @@ -413,10 +395,7 @@ export class IntegrationAuthRepository { .update(token.accessToken) .digest("base64"); - const key = secretStoreKeyForToken( - definition.identifier, - hashedAccessToken - ); + const key = secretStoreKeyForToken(definition.identifier, hashedAccessToken); const metadata = this.#getMetadataFromToken({ token, @@ -496,9 +475,7 @@ export class IntegrationAuthRepository { integration: Integration; externalAccount?: ExternalAccount; }) { - const { definition, authMethod } = await this.#getDefinitionAndAuthMethod( - integration - ); + const { definition, authMethod } = await this.#getDefinitionAndAuthMethod(integration); switch (authMethod.type) { case "oauth2": { @@ -508,10 +485,7 @@ export class IntegrationAuthRepository { .update(token.accessToken) .digest("base64"); - const key = secretStoreKeyForToken( - definition.identifier, - hashedAccessToken - ); + const key = secretStoreKeyForToken(definition.identifier, hashedAccessToken); const metadata = this.#getMetadataFromToken({ token, @@ -585,20 +559,19 @@ export class IntegrationAuthRepository { } async refreshConnection({ connectionId }: { connectionId: string }) { - const connection = - await this.#prismaClient.integrationConnection.findUnique({ - where: { - id: connectionId, - }, - include: { - dataReference: true, - integration: { - include: { - customClientReference: true, - }, + const connection = await this.#prismaClient.integrationConnection.findUnique({ + where: { + id: connectionId, + }, + include: { + dataReference: true, + integration: { + include: { + customClientReference: true, }, }, - }); + }, + }); if (!connection) { throw new Error(`Connection ${connectionId} not found`); @@ -613,9 +586,7 @@ export class IntegrationAuthRepository { ); } - const { authMethod } = await this.#getDefinitionAndAuthMethod( - connection.integration - ); + const { authMethod } = await this.#getDefinitionAndAuthMethod(connection.integration); switch (authMethod.type) { case "oauth2": { @@ -660,16 +631,11 @@ export class IntegrationAuthRepository { token: { accessToken: accessToken.accessToken, refreshToken: accessToken.refreshToken, - expiresAt: new Date( - connection.updatedAt.getTime() + accessToken.expiresIn * 1000 - ), + expiresAt: new Date(connection.updatedAt.getTime() + accessToken.expiresIn * 1000), }, - accessTokenPointer: - authMethod.config.token.accessTokenPointer ?? "/access_token", - refreshTokenPointer: - authMethod.config.token.refreshTokenPointer ?? "/refresh_token", - expiresInPointer: - authMethod.config.token.expiresInPointer ?? "/expires_in", + accessTokenPointer: authMethod.config.token.accessTokenPointer ?? "/access_token", + refreshTokenPointer: authMethod.config.token.refreshTokenPointer ?? "/refresh_token", + expiresInPointer: authMethod.config.token.expiresInPointer ?? "/expires_in", scopePointer: authMethod.config.token.scopePointer ?? "/scope", authorizationMethod: authMethod.config.token.authorizationMethod, bodyFormat: authMethod.config.token.bodyFormat, @@ -692,28 +658,25 @@ export class IntegrationAuthRepository { }); const expiresAt = this.#getExpiresAtFromToken({ token }); - const newConnection = - await this.#prismaClient.integrationConnection.update({ - where: { - id: connectionId, - }, - data: { - metadata, - scopes: token.scopes, - expiresAt, - }, - include: { - dataReference: true, - }, - }); + const newConnection = await this.#prismaClient.integrationConnection.update({ + where: { + id: connectionId, + }, + data: { + metadata, + scopes: token.scopes, + expiresAt, + }, + include: { + dataReference: true, + }, + }); await this.#scheduleRefresh(expiresAt, connection); return newConnection; } default: { - throw new Error( - `Authentication method type ${authMethod.type} not supported` - ); + throw new Error(`Authentication method type ${authMethod.type} not supported`); } } } @@ -722,9 +685,7 @@ export class IntegrationAuthRepository { async getCredentials(connection: ConnectionWithSecretReference) { //refresh the token if the expiry is in the past (or about to be) if (connection.expiresAt) { - const refreshBy = new Date( - connection.expiresAt.getTime() - tokenRefreshThreshold * 1000 - ); + const refreshBy = new Date(connection.expiresAt.getTime() - tokenRefreshThreshold * 1000); if (refreshBy < new Date()) { connection = await this.refreshConnection({ connectionId: connection.id, @@ -733,10 +694,7 @@ export class IntegrationAuthRepository { } const secretStore = getSecretStore(connection.dataReference.provider); - return secretStore.getSecret( - AccessTokenSchema, - connection.dataReference.key - ); + return secretStore.getSecret(AccessTokenSchema, connection.dataReference.key); } #enrichIntegration( @@ -751,9 +709,7 @@ export class IntegrationAuthRepository { } if (authMethod.type !== "oauth2") { - throw new Error( - `Authentication method type ${authMethod.type} not supported` - ); + throw new Error(`Authentication method type ${authMethod.type} not supported`); } return { @@ -771,12 +727,11 @@ export class IntegrationAuthRepository { } async #getDefinitionAndAuthMethod(integration: Integration) { - const definition = - await this.#prismaClient.integrationDefinition.findUniqueOrThrow({ - where: { - id: integration.definitionId, - }, - }); + const definition = await this.#prismaClient.integrationDefinition.findUniqueOrThrow({ + where: { + id: integration.definitionId, + }, + }); const authMethod = integration.authMethodId ? await this.#prismaClient.integrationAuthMethod.findUniqueOrThrow({ @@ -877,10 +832,7 @@ export class IntegrationAuthRepository { } } -function secretStoreKeyForToken( - integrationIdentifier: string, - hashedAccessToken: string -) { +function secretStoreKeyForToken(integrationIdentifier: string, hashedAccessToken: string) { return `connection/token/${integrationIdentifier}-${hashedAccessToken}`; } diff --git a/apps/webapp/app/services/externalApis/integrationConnectionCreated.server.ts b/apps/webapp/app/services/externalApis/integrationConnectionCreated.server.ts index fe9a7911b..eb5984549 100644 --- a/apps/webapp/app/services/externalApis/integrationConnectionCreated.server.ts +++ b/apps/webapp/app/services/externalApis/integrationConnectionCreated.server.ts @@ -15,47 +15,45 @@ export class IntegrationConnectionCreatedService { logger.debug("IntegrationConnectionCreatedService.call", { id }); // first, deliver the event through the dispatcher - const connection = - await this.#prismaClient.integrationConnection.findUniqueOrThrow({ - where: { - id, - }, - include: { - externalAccount: true, - integration: true, - }, - }); + const connection = await this.#prismaClient.integrationConnection.findUniqueOrThrow({ + where: { + id, + }, + include: { + externalAccount: true, + integration: true, + }, + }); - const missingConnection = - await this.#prismaClient.missingConnection.findUnique({ - where: { - integrationId_connectionType_accountIdentifier: { - integrationId: connection.integrationId, - connectionType: connection.connectionType, - accountIdentifier: connection.externalAccount - ? connection.externalAccount.id - : "DEVELOPER", - }, + const missingConnection = await this.#prismaClient.missingConnection.findUnique({ + where: { + integrationId_connectionType_accountIdentifier: { + integrationId: connection.integrationId, + connectionType: connection.connectionType, + accountIdentifier: connection.externalAccount + ? connection.externalAccount.id + : "DEVELOPER", }, - include: { - runs: { - include: { - queue: true, - environment: { - include: { - project: true, - organization: true, - }, + }, + include: { + runs: { + include: { + queue: true, + environment: { + include: { + project: true, + organization: true, }, }, - orderBy: { - createdAt: "asc", - }, }, - integration: true, - externalAccount: true, + orderBy: { + createdAt: "asc", + }, }, - }); + integration: true, + externalAccount: true, + }, + }); if (!missingConnection) { return; diff --git a/apps/webapp/app/services/externalApis/integrations/airtable.ts b/apps/webapp/app/services/externalApis/integrations/airtable.ts index 184c58faa..a3c1dc3fc 100644 --- a/apps/webapp/app/services/externalApis/integrations/airtable.ts +++ b/apps/webapp/app/services/externalApis/integrations/airtable.ts @@ -56,13 +56,11 @@ export const airtable: Integration = { }, { name: "schema.bases:read", - description: - "See the structure of a base, like table names or field types", + description: "See the structure of a base, like table names or field types", }, { name: "schema.bases:write", - description: - "Edit the structure of a base, like adding new fields or tables", + description: "Edit the structure of a base, like adding new fields or tables", }, { name: "webhook:manage", diff --git a/apps/webapp/app/services/externalApis/integrations/github.ts b/apps/webapp/app/services/externalApis/integrations/github.ts index 4ad8d12b0..93912643a 100644 --- a/apps/webapp/app/services/externalApis/integrations/github.ts +++ b/apps/webapp/app/services/externalApis/integrations/github.ts @@ -155,15 +155,13 @@ export const github: Integration = { }, { name: "read:repo_hook", - description: - "Grants read and ping access to hooks in public or private repositories.", + description: "Grants read and ping access to hooks in public or private repositories.", annotations: [webhookAnnotation], }, { name: "admin:org", - description: - "Fully manage the organization and its teams, projects, and memberships.", + description: "Fully manage the organization and its teams, projects, and memberships.", annotations: [orgAnnotation], }, { @@ -237,14 +235,12 @@ export const github: Integration = { }, { name: "project", - description: - "Grants read/write access to user and organization projects.", + description: "Grants read/write access to user and organization projects.", }, { name: "read:project", - description: - "Grants read only access to user and organization projects.", + description: "Grants read only access to user and organization projects.", }, { @@ -259,14 +255,12 @@ export const github: Integration = { { name: "write:packages", - description: - "Grants access to upload or publish a package in GitHub Packages.", + description: "Grants access to upload or publish a package in GitHub Packages.", }, { name: "read:packages", - description: - "Grants access to download or install packages from GitHub Packages.", + description: "Grants access to download or install packages from GitHub Packages.", }, { diff --git a/apps/webapp/app/services/externalApis/integrations/slack.ts b/apps/webapp/app/services/externalApis/integrations/slack.ts index dac694f19..31118eac6 100644 --- a/apps/webapp/app/services/externalApis/integrations/slack.ts +++ b/apps/webapp/app/services/externalApis/integrations/slack.ts @@ -120,14 +120,12 @@ export const slack: Integration = { }, { name: "channels:read", - description: - "View basic information about public channels in a workspace", + description: "View basic information about public channels in a workspace", }, { name: "channels:write", - description: - "Manage a user’s public channels and create new ones on a user’s behalf", + description: "Manage a user’s public channels and create new ones on a user’s behalf", }, { name: "channels:write.invites", @@ -147,21 +145,18 @@ export const slack: Integration = { { name: "chat:write.customize", - description: - "Send messages as @your_slack_app with a customized username and avatar", + description: "Send messages as @your_slack_app with a customized username and avatar", defaultChecked: true, }, { name: "chat:write.public", - description: - "Send messages to channels @your_slack_app isn't a member of", + description: "Send messages to channels @your_slack_app isn't a member of", defaultChecked: true, }, { name: "commands", - description: - "Add shortcuts and/or slash commands that people can use", + description: "Add shortcuts and/or slash commands that people can use", }, { @@ -246,8 +241,7 @@ export const slack: Integration = { { name: "incoming-webhook", - description: - "Create one-way webhooks to post messages to a specific channel", + description: "Create one-way webhooks to post messages to a specific channel", }, { @@ -480,23 +474,19 @@ export const slack: Integration = { }, { name: "admin.conversations:read", - description: - "View the channel’s member list, topic, purpose and channel name", + description: "View the channel’s member list, topic, purpose and channel name", }, { name: "admin.conversations:write", - description: - "Start a new conversation, modify a conversation and modify channel details", + description: "Start a new conversation, modify a conversation and modify channel details", }, { name: "admin.invites:read", - description: - "Gain information about invite requests in a Grid organization.", + description: "Gain information about invite requests in a Grid organization.", }, { name: "admin.invites:write", - description: - "Approve or deny invite requests in a Grid organization.", + description: "Approve or deny invite requests in a Grid organization.", }, { name: "admin.roles:read", @@ -541,8 +531,7 @@ export const slack: Integration = { { name: "auditlogs:read", - description: - "View events from all workspaces, channels and users (Enterprise Grid only)", + description: "View events from all workspaces, channels and users (Enterprise Grid only)", }, { @@ -573,8 +562,7 @@ export const slack: Integration = { { name: "channels:read", - description: - "View basic information about public channels in a workspace", + description: "View basic information about public channels in a workspace", }, { @@ -605,8 +593,7 @@ export const slack: Integration = { { name: "commands", - description: - "Add shortcuts and/or slash commands that people can use", + description: "Add shortcuts and/or slash commands that people can use", }, { @@ -703,8 +690,7 @@ export const slack: Integration = { { name: "incoming-webhook", - description: - "Create one-way webhooks to post messages to a specific channel", + description: "Create one-way webhooks to post messages to a specific channel", }, { @@ -766,8 +752,7 @@ export const slack: Integration = { }, { name: "profile", - description: - "View a user’s Slack avatar and Slack workspace's basic information", + description: "View a user’s Slack avatar and Slack workspace's basic information", }, { @@ -808,8 +793,7 @@ export const slack: Integration = { { name: "stars:read", - description: - "View messages and files that your slack app has starred", + description: "View messages and files that your slack app has starred", }, { name: "stars:write", diff --git a/apps/webapp/app/services/externalApis/oauth2.server.ts b/apps/webapp/app/services/externalApis/oauth2.server.ts index 09e07e7f7..9f5c210ca 100644 --- a/apps/webapp/app/services/externalApis/oauth2.server.ts +++ b/apps/webapp/app/services/externalApis/oauth2.server.ts @@ -28,9 +28,7 @@ export function getClientConfig({ const secret = process.env[env.secretName]; if (!secret) { - throw new Error( - `Client secret environment variable not found: ${env.secretName}` - ); + throw new Error(`Client secret environment variable not found: ${env.secretName}`); } return { diff --git a/apps/webapp/app/services/externalApis/types.ts b/apps/webapp/app/services/externalApis/types.ts index 888d95a02..5762afa77 100644 --- a/apps/webapp/app/services/externalApis/types.ts +++ b/apps/webapp/app/services/externalApis/types.ts @@ -16,9 +16,7 @@ export type Integration = { }; /** An authentication method that can be used */ -export type ApiAuthenticationMethod = - | ApiAuthenticationMethodOAuth2 - | ApiAuthenticationMethodApiKey; +export type ApiAuthenticationMethod = ApiAuthenticationMethodOAuth2 | ApiAuthenticationMethodApiKey; const HelpSampleSchema = z.object({ title: z.string(), diff --git a/apps/webapp/app/services/jobs/registerJob.server.ts b/apps/webapp/app/services/jobs/registerJob.server.ts index 812d1efa9..5d45d9278 100644 --- a/apps/webapp/app/services/jobs/registerJob.server.ts +++ b/apps/webapp/app/services/jobs/registerJob.server.ts @@ -1,10 +1,4 @@ -import type { - Endpoint, - Integration, - Job, - JobIntegration, - JobVersion, -} from "@trigger.dev/database"; +import type { Endpoint, Integration, Job, JobIntegration, JobVersion } from "@trigger.dev/database"; import { IntegrationConfig, JobMetadata, @@ -27,10 +21,7 @@ export class RegisterJobService { this.#prismaClient = prismaClient; } - public async call( - endpointIdOrEndpoint: string | ExtendedEndpoint, - metadata: JobMetadata - ) { + public async call(endpointIdOrEndpoint: string | ExtendedEndpoint, metadata: JobMetadata) { const endpoint = typeof endpointIdOrEndpoint === "string" ? await findEndpoint(endpointIdOrEndpoint) @@ -254,12 +245,10 @@ export class RegisterJobService { version: metadata.version, eventSpecification, preprocessRuns: metadata.preprocessRuns, - startPosition: - metadata.startPosition === "initial" ? "INITIAL" : "LATEST", + startPosition: metadata.startPosition === "initial" ? "INITIAL" : "LATEST", }, update: { - startPosition: - metadata.startPosition === "initial" ? "INITIAL" : "LATEST", + startPosition: metadata.startPosition === "initial" ? "INITIAL" : "LATEST", eventSpecification, preprocessRuns: metadata.preprocessRuns, queue: { @@ -378,12 +367,7 @@ export class RegisterJobService { }, }); - await this.#upsertEventDispatcher( - metadata.trigger, - job, - jobVersion, - environment - ); + await this.#upsertEventDispatcher(metadata.trigger, job, jobVersion, environment); return jobVersion; } @@ -405,9 +389,7 @@ export class RegisterJobService { }, create: { event: - typeof trigger.rule.event === "string" - ? [trigger.rule.event] - : trigger.rule.event, + typeof trigger.rule.event === "string" ? [trigger.rule.event] : trigger.rule.event, source: trigger.rule.source, payloadFilter: trigger.rule.payload, contextFilter: trigger.rule.context, @@ -421,9 +403,7 @@ export class RegisterJobService { }, update: { event: - typeof trigger.rule.event === "string" - ? [trigger.rule.event] - : trigger.rule.event, + typeof trigger.rule.event === "string" ? [trigger.rule.event] : trigger.rule.event, source: trigger.rule.source, payloadFilter: trigger.rule.payload, contextFilter: trigger.rule.context, @@ -448,36 +428,34 @@ export class RegisterJobService { break; } case "scheduled": { - const eventDispatcher = await this.#prismaClient.eventDispatcher.upsert( - { - where: { - dispatchableId_environmentId: { - dispatchableId: job.id, - environmentId: environment.id, - }, - }, - create: { - event: SCHEDULED_EVENT, - source: "trigger.dev", - payloadFilter: {}, - contextFilter: {}, - environmentId: environment.id, - enabled: true, - dispatchable: { - type: "JOB_VERSION", - id: jobVersion.id, - }, + const eventDispatcher = await this.#prismaClient.eventDispatcher.upsert({ + where: { + dispatchableId_environmentId: { dispatchableId: job.id, - manual: true, + environmentId: environment.id, }, - update: { - dispatchable: { - type: "JOB_VERSION", - id: jobVersion.id, - }, + }, + create: { + event: SCHEDULED_EVENT, + source: "trigger.dev", + payloadFilter: {}, + contextFilter: {}, + environmentId: environment.id, + enabled: true, + dispatchable: { + type: "JOB_VERSION", + id: jobVersion.id, }, - } - ); + dispatchableId: job.id, + manual: true, + }, + update: { + dispatchable: { + type: "JOB_VERSION", + id: jobVersion.id, + }, + }, + }); const service = new RegisterScheduleSourceService(); @@ -506,9 +484,7 @@ export class RegisterJobService { const integration = integrations.get(config.id); if (!integration) { - throw new Error( - `Could not find integration with id ${config.id} for job ${job.id}` - ); + throw new Error(`Could not find integration with id ${config.id} for job ${job.id}`); } // Find existing integration in the job instance @@ -528,9 +504,7 @@ export class RegisterJobService { } // Find existing connection in the job - const existingJobIntegration = job.integrations.find( - (integration) => integration.key === key - ); + const existingJobIntegration = job.integrations.find((integration) => integration.key === key); if (existingJobIntegration) { logger.debug("Creating new job integration from existing", { diff --git a/apps/webapp/app/services/jobs/testJob.server.ts b/apps/webapp/app/services/jobs/testJob.server.ts index fb42a3b3d..2b154cc0e 100644 --- a/apps/webapp/app/services/jobs/testJob.server.ts +++ b/apps/webapp/app/services/jobs/testJob.server.ts @@ -41,12 +41,8 @@ export class TestJobService { }, }); - const event = EventSpecificationSchema.parse( - version.eventSpecification - ); - const eventName = Array.isArray(event.name) - ? event.name[0] - : event.name; + const event = EventSpecificationSchema.parse(version.eventSpecification); + const eventName = Array.isArray(event.name) ? event.name[0] : event.name; const eventLog = await this.#prismaClient.eventRecord.create({ data: { diff --git a/apps/webapp/app/services/redirectTo.server.ts b/apps/webapp/app/services/redirectTo.server.ts index b1e98c53d..0b41e24e1 100644 --- a/apps/webapp/app/services/redirectTo.server.ts +++ b/apps/webapp/app/services/redirectTo.server.ts @@ -40,9 +40,7 @@ export async function clearRedirectTo(request: Request) { return session; } -export async function getRedirectTo( - request: Request -): Promise { +export async function getRedirectTo(request: Request): Promise { const session = await getRedirectSession(request); if (session) { diff --git a/apps/webapp/app/services/runs/cancelRun.server.ts b/apps/webapp/app/services/runs/cancelRun.server.ts index 546b14df4..c73fcdb61 100644 --- a/apps/webapp/app/services/runs/cancelRun.server.ts +++ b/apps/webapp/app/services/runs/cancelRun.server.ts @@ -17,8 +17,7 @@ export class CancelRunService { }, }); - const shouldDecrementQueue = - run.status === "STARTED" || run.status === "PREPROCESSING"; + const shouldDecrementQueue = run.status === "STARTED" || run.status === "PREPROCESSING"; await tx.jobRun.update({ where: { id: runId }, data: { diff --git a/apps/webapp/app/services/runs/performRunExecution.server.ts b/apps/webapp/app/services/runs/performRunExecution.server.ts index 43edeaaa0..a5013e8e9 100644 --- a/apps/webapp/app/services/runs/performRunExecution.server.ts +++ b/apps/webapp/app/services/runs/performRunExecution.server.ts @@ -11,12 +11,7 @@ import { } from "@trigger.dev/core"; import { generateErrorMessage } from "zod-error"; import { EXECUTE_JOB_RETRY_LIMIT } from "~/consts"; -import { - $transaction, - PrismaClient, - PrismaClientOrTransaction, - prisma, -} from "~/db.server"; +import { $transaction, PrismaClient, PrismaClientOrTransaction, prisma } from "~/db.server"; import { resolveRunConnections } from "~/models/runConnection.server"; import { safeJsonZodParse } from "~/utils/json"; import { EndpointApi } from "../endpointApi.server"; @@ -24,9 +19,7 @@ import { workerQueue } from "../worker.server"; import { formatError } from "~/utils/formatErrors.server"; import { logger } from "../logger.server"; -type FoundRunExecution = NonNullable< - Awaited> ->; +type FoundRunExecution = NonNullable>>; export class PerformRunExecutionService { #prismaClient: PrismaClient; @@ -61,11 +54,7 @@ export class PerformRunExecutionService { async #executePreprocessing(execution: FoundRunExecution) { const { run } = execution; - const client = new EndpointApi( - run.environment.apiKey, - run.endpoint.url, - run.endpoint.slug - ); + const client = new EndpointApi(run.environment.apiKey, run.endpoint.url, run.endpoint.slug); const event = ApiEventLogSchema.parse({ ...run.event, id: run.eventId }); const startedAt = new Date(); @@ -200,11 +189,7 @@ export class PerformRunExecutionService { return; } - const client = new EndpointApi( - run.environment.apiKey, - run.endpoint.url, - run.endpoint.slug - ); + const client = new EndpointApi(run.environment.apiKey, run.endpoint.url, run.endpoint.slug); const event = ApiEventLogSchema.parse({ ...run.event, id: run.eventId }); const startedAt = new Date(); @@ -250,9 +235,7 @@ export class PerformRunExecutionService { } } - const sourceContext = RunSourceContextSchema.safeParse( - run.event.sourceContext - ); + const sourceContext = RunSourceContextSchema.safeParse(run.event.sourceContext); const { response, parser, errorParser } = await client.executeJobRequest({ event, @@ -310,16 +293,9 @@ export class PerformRunExecutionService { if (errorBody && errorBody.success) { // Only retry if the error isn't a 4xx if (response.status >= 400 && response.status <= 499) { - return await this.#failRunExecution( - this.#prismaClient, - execution, - errorBody.data - ); + return await this.#failRunExecution(this.#prismaClient, execution, errorBody.data); } else { - return await this.#failRunExecutionWithRetry( - execution, - errorBody.data - ); + return await this.#failRunExecutionWithRetry(execution, errorBody.data); } } @@ -383,10 +359,7 @@ export class PerformRunExecutionService { } } - async #completeRunWithSuccess( - execution: FoundRunExecution, - data: RunJobSuccess - ) { + async #completeRunWithSuccess(execution: FoundRunExecution, data: RunJobSuccess) { const { run } = execution; return await $transaction(this.#prismaClient, async (tx) => { @@ -426,10 +399,7 @@ export class PerformRunExecutionService { }); } - async #resumeRunWithTask( - execution: FoundRunExecution, - data: RunJobResumeWithTask - ) { + async #resumeRunWithTask(execution: FoundRunExecution, data: RunJobResumeWithTask) { const { run } = execution; return await $transaction(this.#prismaClient, async (tx) => { @@ -495,10 +465,7 @@ export class PerformRunExecutionService { }); } - async #retryRunWithTask( - execution: FoundRunExecution, - data: RunJobRetryWithTask - ) { + async #retryRunWithTask(execution: FoundRunExecution, data: RunJobRetryWithTask) { const { run } = execution; return await $transaction(this.#prismaClient, async (tx) => { diff --git a/apps/webapp/app/services/runs/reRun.server.ts b/apps/webapp/app/services/runs/reRun.server.ts index 4521ae641..8c1b8449e 100644 --- a/apps/webapp/app/services/runs/reRun.server.ts +++ b/apps/webapp/app/services/runs/reRun.server.ts @@ -43,9 +43,7 @@ export class ReRunService { id: existingRun.environment.id, }, }, - eventId: `${ - existingRun.event.eventId - }:retry:${new Date().getTime()}`, + eventId: `${existingRun.event.eventId}:retry:${new Date().getTime()}`, name: existingRun.event.name, timestamp: new Date(), payload: existingRun.event.payload ?? {}, diff --git a/apps/webapp/app/services/runs/runFinished.server.ts b/apps/webapp/app/services/runs/runFinished.server.ts index 820e32e3d..6a09d3e51 100644 --- a/apps/webapp/app/services/runs/runFinished.server.ts +++ b/apps/webapp/app/services/runs/runFinished.server.ts @@ -48,11 +48,7 @@ export class RunFinishedService { if (parsedOutput.success) { for (const newEvent of parsedOutput.data.events) { - await this.#ingestEventService.call( - run.environment, - newEvent, - parsedOutput.data.options - ); + await this.#ingestEventService.call(run.environment, newEvent, parsedOutput.data.options); } } } diff --git a/apps/webapp/app/services/runs/startRun.server.ts b/apps/webapp/app/services/runs/startRun.server.ts index 1c64a130e..f050dc5c7 100644 --- a/apps/webapp/app/services/runs/startRun.server.ts +++ b/apps/webapp/app/services/runs/startRun.server.ts @@ -1,8 +1,4 @@ -import type { - ConnectionType, - Integration, - IntegrationConnection, -} from "@trigger.dev/database"; +import type { ConnectionType, Integration, IntegrationConnection } from "@trigger.dev/database"; import { EXECUTE_JOB_RETRY_LIMIT, PREPROCESS_RETRY_LIMIT } from "~/consts"; import type { PrismaClient, PrismaClientOrTransaction } from "~/db.server"; import { prisma } from "~/db.server"; @@ -39,11 +35,7 @@ export class StartRunService { } #runIsStartable(run: FoundRun) { - const startableStatuses = [ - "PENDING", - "QUEUED", - "WAITING_ON_CONNECTIONS", - ] as const; + const startableStatuses = ["PENDING", "QUEUED", "WAITING_ON_CONNECTIONS"] as const; return startableStatuses.includes(run.status); } @@ -57,11 +49,7 @@ export class StartRunService { }); } - async #startRun( - id: string, - run: FoundRun, - runConnectionsByKey: RunConnectionsByKey - ) { + async #startRun(id: string, run: FoundRun, runConnectionsByKey: RunConnectionsByKey) { const createRunConnections = Object.entries(runConnectionsByKey) .map(([key, runConnection]) => runConnection.result === "resolvedHosted" @@ -150,12 +138,9 @@ export class StartRunService { const execution = await updateRunAndCreateExecution(); - const job = await workerQueue.enqueue( - "performRunExecution", - { - id: execution.id, - }, - ); + const job = await workerQueue.enqueue("performRunExecution", { + id: execution.id, + }); await this.#prismaClient.jobRunExecution.update({ where: { id: execution.id }, @@ -164,22 +149,14 @@ export class StartRunService { }, }); - await workerQueue.enqueue( - "startQueuedRuns", - { - id: run.queueId, - }, - ); + await workerQueue.enqueue("startQueuedRuns", { + id: run.queueId, + }); } - async #handleMissingConnections( - id: string, - runConnectionsByKey: RunConnectionsByKey - ) { + async #handleMissingConnections(id: string, runConnectionsByKey: RunConnectionsByKey) { const missingConnections = Object.values(runConnectionsByKey) - .map((runConnection) => - runConnection.result === "missing" ? runConnection : undefined - ) + .map((runConnection) => (runConnection.result === "missing" ? runConnection : undefined)) .filter(Boolean); const updatedRun = await this.#prismaClient.jobRun.update({ @@ -218,12 +195,9 @@ export class StartRunService { for (const missingConnection of updatedRun.missingConnections) { if (missingConnection._count.runs === 1) { - workerQueue.enqueue( - "missingConnectionCreated", - { - id: missingConnection.id, - }, - ); + workerQueue.enqueue("missingConnectionCreated", { + id: missingConnection.id, + }); } } } @@ -247,10 +221,7 @@ async function findRun(tx: PrismaClientOrTransaction, id: string) { }); } -async function createRunConnections( - tx: PrismaClientOrTransaction, - run: FoundRun -) { +async function createRunConnections(tx: PrismaClientOrTransaction, run: FoundRun) { return await run.version.integrations.reduce( async ( accP: Promise< @@ -318,7 +289,5 @@ async function createRunConnections( } function hasMissingConnections(runConnectionsByKey: RunConnectionsByKey) { - return Object.values(runConnectionsByKey).some( - (connection) => connection.result === "missing" - ); + return Object.values(runConnectionsByKey).some((connection) => connection.result === "missing"); } diff --git a/apps/webapp/app/services/schedules/deliverScheduledEvent.server.ts b/apps/webapp/app/services/schedules/deliverScheduledEvent.server.ts index 8a06b27df..3dff3a9d9 100644 --- a/apps/webapp/app/services/schedules/deliverScheduledEvent.server.ts +++ b/apps/webapp/app/services/schedules/deliverScheduledEvent.server.ts @@ -65,10 +65,7 @@ export class DeliverScheduledEventService { const invokeDispatcherService = new InvokeDispatcherService(tx); - await invokeDispatcherService.call( - scheduleSource.dispatcher.id, - eventRecord.id - ); + await invokeDispatcherService.call(scheduleSource.dispatcher.id, eventRecord.id); logger.debug("updating lastEventTimestamp", { id, diff --git a/apps/webapp/app/services/schedules/nextScheduledEvent.server.ts b/apps/webapp/app/services/schedules/nextScheduledEvent.server.ts index b16687f96..09adfb42c 100644 --- a/apps/webapp/app/services/schedules/nextScheduledEvent.server.ts +++ b/apps/webapp/app/services/schedules/nextScheduledEvent.server.ts @@ -18,20 +18,17 @@ export class NextScheduledEventService { public async call(id: string) { return await $transaction(this.#prismaClient, async (tx) => { - const scheduleSource = - await this.#prismaClient.scheduleSource.findUniqueOrThrow({ - where: { - id, - }, - }); + const scheduleSource = await this.#prismaClient.scheduleSource.findUniqueOrThrow({ + where: { + id, + }, + }); if (!scheduleSource.active) { return; } - const schedule = ScheduleMetadataSchema.safeParse( - scheduleSource.schedule - ); + const schedule = ScheduleMetadataSchema.safeParse(scheduleSource.schedule); if (!schedule.success) { return; @@ -94,10 +91,7 @@ export function calculateNextScheduledEvent( return nextStep; } -function calculateNextStep( - schedule: ScheduleMetadata, - previousTimestamp?: Date | null -): Date { +function calculateNextStep(schedule: ScheduleMetadata, previousTimestamp?: Date | null): Date { switch (schedule.type) { case "interval": { return calculateNextIntervalOfEvent(schedule, previousTimestamp); @@ -112,9 +106,7 @@ function calculateNextIntervalOfEvent( interval: IntervalMetadata, previousTimestamp?: Date | null ): Date { - const now = previousTimestamp - ? previousTimestamp.getTime() - : new Date().getTime(); + const now = previousTimestamp ? previousTimestamp.getTime() : new Date().getTime(); return new Date(now + calculateDurationInMs(interval)); } @@ -123,10 +115,7 @@ function calculateDurationInMs(schedule: IntervalMetadata): number { return schedule.options.seconds * 1000; } -function calculateNextCronEvent( - schedule: CronMetadata, - previousTimestamp?: Date | null -): Date { +function calculateNextCronEvent(schedule: CronMetadata, previousTimestamp?: Date | null): Date { return parseExpression(schedule.options.cron, { currentDate: previousTimestamp ? previousTimestamp : new Date(), }) diff --git a/apps/webapp/app/services/schedules/registerSchedule.server.ts b/apps/webapp/app/services/schedules/registerSchedule.server.ts index 50802a359..bda3daf89 100644 --- a/apps/webapp/app/services/schedules/registerSchedule.server.ts +++ b/apps/webapp/app/services/schedules/registerSchedule.server.ts @@ -31,26 +31,24 @@ export class RegisterScheduleService { }, }); - const dynamicTrigger = - await this.#prismaClient.dynamicTrigger.findUniqueOrThrow({ - where: { - endpointId_slug_type: { - endpointId: endpoint.id, - slug: id, - type: "SCHEDULE", - }, + const dynamicTrigger = await this.#prismaClient.dynamicTrigger.findUniqueOrThrow({ + where: { + endpointId_slug_type: { + endpointId: endpoint.id, + slug: id, + type: "SCHEDULE", }, - }); + }, + }); - const eventDispatcher = - await this.#prismaClient.eventDispatcher.findUniqueOrThrow({ - where: { - dispatchableId_environmentId: { - dispatchableId: dynamicTrigger.id, - environmentId: environment.id, - }, + const eventDispatcher = await this.#prismaClient.eventDispatcher.findUniqueOrThrow({ + where: { + dispatchableId_environmentId: { + dispatchableId: dynamicTrigger.id, + environmentId: environment.id, }, - }); + }, + }); return await $transaction(this.#prismaClient, async (tx) => { const registerScheduleSource = new RegisterScheduleSourceService(tx); diff --git a/apps/webapp/app/services/schedules/registerScheduleSource.server.ts b/apps/webapp/app/services/schedules/registerScheduleSource.server.ts index fe13dc18d..bc2306611 100644 --- a/apps/webapp/app/services/schedules/registerScheduleSource.server.ts +++ b/apps/webapp/app/services/schedules/registerScheduleSource.server.ts @@ -1,9 +1,5 @@ import type { DynamicTrigger, EventDispatcher } from "@trigger.dev/database"; -import { - CronMetadata, - IntervalMetadata, - ScheduleMetadata, -} from "@trigger.dev/core"; +import { CronMetadata, IntervalMetadata, ScheduleMetadata } from "@trigger.dev/core"; import { $transaction, PrismaClientOrTransaction, prisma } from "~/db.server"; import { NextScheduledEventService } from "./nextScheduledEvent.server"; diff --git a/apps/webapp/app/services/schedules/unregisterSchedule.server.ts b/apps/webapp/app/services/schedules/unregisterSchedule.server.ts index d18f2c68e..d1c52266e 100644 --- a/apps/webapp/app/services/schedules/unregisterSchedule.server.ts +++ b/apps/webapp/app/services/schedules/unregisterSchedule.server.ts @@ -31,16 +31,15 @@ export class UnregisterScheduleService { }, }); - const dynamicTrigger = - await this.#prismaClient.dynamicTrigger.findUniqueOrThrow({ - where: { - endpointId_slug_type: { - endpointId: endpoint.id, - slug: id, - type: "SCHEDULE", - }, + const dynamicTrigger = await this.#prismaClient.dynamicTrigger.findUniqueOrThrow({ + where: { + endpointId_slug_type: { + endpointId: endpoint.id, + slug: id, + type: "SCHEDULE", }, - }); + }, + }); await this.#prismaClient.scheduleSource.update({ where: { diff --git a/apps/webapp/app/services/secrets/secretStore.server.ts b/apps/webapp/app/services/secrets/secretStore.server.ts index b34ea7830..864e3a48d 100644 --- a/apps/webapp/app/services/secrets/secretStore.server.ts +++ b/apps/webapp/app/services/secrets/secretStore.server.ts @@ -79,9 +79,7 @@ class PrismaSecretStore implements SecretStoreProvider { const encryptedData = EncryptedSecretValueSchema.safeParse(secret.value); if (!encryptedData.success) { - throw new Error( - `Unable to parse encrypted secret ${key}: ${encryptedData.error.message}` - ); + throw new Error(`Unable to parse encrypted secret ${key}: ${encryptedData.error.message}`); } const decrypted = await this.#decrypt( @@ -118,11 +116,7 @@ class PrismaSecretStore implements SecretStoreProvider { }); } - async #decrypt( - nonce: string, - ciphertext: string, - tag: string - ): Promise { + async #decrypt(nonce: string, ciphertext: string, tag: string): Promise { const decipher = nodeCrypto.createDecipheriv( "aes-256-gcm", this.encryptionKey, @@ -143,11 +137,7 @@ class PrismaSecretStore implements SecretStoreProvider { tag: string; }> { const nonce = nodeCrypto.randomBytes(12); - const cipher = nodeCrypto.createCipheriv( - "aes-256-gcm", - this.encryptionKey, - nonce - ); + const cipher = nodeCrypto.createCipheriv("aes-256-gcm", this.encryptionKey, nonce); let encrypted = cipher.update(value, "utf8", "hex"); encrypted += cipher.final("hex"); @@ -164,7 +154,7 @@ class PrismaSecretStore implements SecretStoreProvider { export function getSecretStore< K extends SecretStoreOptions, - TOptions extends ProviderInitializationOptions[K] + TOptions extends ProviderInitializationOptions[K], >(provider: K, options?: TOptions): SecretStore { switch (provider) { case "DATABASE": { diff --git a/apps/webapp/app/services/sensitiveDataReplacer.ts b/apps/webapp/app/services/sensitiveDataReplacer.ts index 79d4de062..47e64e552 100644 --- a/apps/webapp/app/services/sensitiveDataReplacer.ts +++ b/apps/webapp/app/services/sensitiveDataReplacer.ts @@ -4,11 +4,7 @@ import type { RedactString } from "@trigger.dev/core"; // For example, this object: {"Authorization":{"__redactedString":true,"strings":["Bearer ",""],"interpolations":["sk-1234"]}} // Would get stringified like so: {"Authorization": "Bearer ******"} export function sensitiveDataReplacer(key: string, value: any): any { - if ( - typeof value === "object" && - value !== null && - value.__redactedString === true - ) { + if (typeof value === "object" && value !== null && value.__redactedString === true) { return redactString(value); } diff --git a/apps/webapp/app/services/sources/activateSource.server.ts b/apps/webapp/app/services/sources/activateSource.server.ts index d15e08df6..60afa32ae 100644 --- a/apps/webapp/app/services/sources/activateSource.server.ts +++ b/apps/webapp/app/services/sources/activateSource.server.ts @@ -1,20 +1,10 @@ import type { PrismaClient } from "~/db.server"; import { prisma } from "~/db.server"; -import type { - TriggerSource, - SecretReference, - TriggerSourceEvent, -} from "@trigger.dev/database"; +import type { TriggerSource, SecretReference, TriggerSourceEvent } from "@trigger.dev/database"; import type { AuthenticatedEnvironment } from "../apiAuth.server"; import { env } from "~/env.server"; -import { - REGISTER_SOURCE_EVENT, - RegisterTriggerSource, -} from "@trigger.dev/core"; -import { - SecretStoreProvider, - getSecretStore, -} from "../secrets/secretStore.server"; +import { REGISTER_SOURCE_EVENT, RegisterTriggerSource } from "@trigger.dev/core"; +import { SecretStoreProvider, getSecretStore } from "../secrets/secretStore.server"; import { SecretStore } from "../secrets/secretStore.server"; import { z } from "zod"; import { IngestSendEvent } from "../events/ingestSendEvent.server"; @@ -27,23 +17,22 @@ export class ActivateSourceService { } public async call(id: string, jobId: string, orphanedEvents?: Array) { - const triggerSource = - await this.#prismaClient.triggerSource.findUniqueOrThrow({ - where: { - id, - }, - include: { - endpoint: true, - environment: { - include: { - organization: true, - project: true, - }, + const triggerSource = await this.#prismaClient.triggerSource.findUniqueOrThrow({ + where: { + id, + }, + include: { + endpoint: true, + environment: { + include: { + organization: true, + project: true, }, - events: true, - secretReference: true, }, - }); + events: true, + secretReference: true, + }, + }); const eventId = `${id}:${jobId}`; diff --git a/apps/webapp/app/services/sources/deliverHttpSourceRequest.server.ts b/apps/webapp/app/services/sources/deliverHttpSourceRequest.server.ts index fb7409b50..2b6042a22 100644 --- a/apps/webapp/app/services/sources/deliverHttpSourceRequest.server.ts +++ b/apps/webapp/app/services/sources/deliverHttpSourceRequest.server.ts @@ -13,35 +13,32 @@ export class DeliverHttpSourceRequestService { } public async call(id: string) { - const httpSourceRequest = - await this.#prismaClient.httpSourceRequestDelivery.findUniqueOrThrow({ - where: { id }, - include: { - endpoint: true, - environment: { - include: { - organization: true, - project: true, - }, - }, - source: { - include: { - secretReference: true, - dynamicTrigger: true, - externalAccount: true, - integration: true, - }, + const httpSourceRequest = await this.#prismaClient.httpSourceRequestDelivery.findUniqueOrThrow({ + where: { id }, + include: { + endpoint: true, + environment: { + include: { + organization: true, + project: true, }, }, - }); + source: { + include: { + secretReference: true, + dynamicTrigger: true, + externalAccount: true, + integration: true, + }, + }, + }, + }); if (!httpSourceRequest.source.active) { return; } - const secretStore = getSecretStore( - httpSourceRequest.source.secretReference.provider - ); + const secretStore = getSecretStore(httpSourceRequest.source.secretReference.provider); const secret = await secretStore.getSecret( z.object({ diff --git a/apps/webapp/app/services/sources/registerSource.server.ts b/apps/webapp/app/services/sources/registerSource.server.ts index ccc0ecea6..11741989a 100644 --- a/apps/webapp/app/services/sources/registerSource.server.ts +++ b/apps/webapp/app/services/sources/registerSource.server.ts @@ -44,9 +44,7 @@ export class RegisterSourceService { accountId?: string, dynamicSource?: { id: string; metadata: any } ) { - const key = [dynamicTriggerId, dynamicSource?.id, metadata.key] - .filter(Boolean) - .join(":"); + const key = [dynamicTriggerId, dynamicSource?.id, metadata.key].filter(Boolean).join(":"); const registrationJob = metadata.registerSourceJob ? await this.#prismaClient.job.findUnique({ @@ -122,9 +120,7 @@ export class RegisterSourceService { }, } : undefined, - externalAccount: externalAccount - ? { connect: { id: externalAccount.id } } - : undefined, + externalAccount: externalAccount ? { connect: { id: externalAccount.id } } : undefined, events: { create: metadata.events.map((event) => ({ name: event, @@ -248,17 +244,16 @@ export class RegisterSourceService { // 1. It's not active // 2. There are orphaned events // 3. There are trigger events that are not registered - const triggerSource = - await this.#prismaClient.triggerSource.findUniqueOrThrow({ - where: { - id: id, - }, - include: { - events: true, - secretReference: true, - integration: true, - }, - }); + const triggerSource = await this.#prismaClient.triggerSource.findUniqueOrThrow({ + where: { + id: id, + }, + include: { + events: true, + secretReference: true, + integration: true, + }, + }); if (dynamicTriggerId) { return triggerSource; @@ -266,15 +261,9 @@ export class RegisterSourceService { const triggerIsActive = triggerSource.active; const triggerHasOrphanedEvents = orphanedEvents.length > 0; - const triggerHasUnregisteredEvents = triggerSource.events.some( - (event) => !event.registered - ); + const triggerHasUnregisteredEvents = triggerSource.events.some((event) => !event.registered); - if ( - !triggerIsActive || - triggerHasOrphanedEvents || - triggerHasUnregisteredEvents - ) { + if (!triggerIsActive || triggerHasOrphanedEvents || triggerHasUnregisteredEvents) { // We need to re-activate the source, and there could be orphaned events await workerQueue.enqueue("activateSource", { id: triggerSource.id, diff --git a/apps/webapp/app/services/sources/updateSource.server.ts b/apps/webapp/app/services/sources/updateSource.server.ts index 1b382a59a..9c4a75005 100644 --- a/apps/webapp/app/services/sources/updateSource.server.ts +++ b/apps/webapp/app/services/sources/updateSource.server.ts @@ -31,18 +31,17 @@ export class UpdateSourceService { }, }); - const triggerSource = - await this.#prismaClient.triggerSource.findUniqueOrThrow({ - where: { - key_environmentId: { - environmentId: environment.id, - key: id, - }, + const triggerSource = await this.#prismaClient.triggerSource.findUniqueOrThrow({ + where: { + key_environmentId: { + environmentId: environment.id, + key: id, }, - include: { - secretReference: true, - }, - }); + }, + include: { + secretReference: true, + }, + }); await this.#prismaClient.triggerSource.update({ where: { @@ -71,16 +70,11 @@ export class UpdateSourceService { if (payload.secret) { // We need to update the secret reference in the store - const secretStore = getSecretStore( - triggerSource.secretReference.provider - ); + const secretStore = getSecretStore(triggerSource.secretReference.provider); - await secretStore.setSecret<{ secret: string }>( - triggerSource.secretReference.key, - { - secret: payload.secret, - } - ); + await secretStore.setSecret<{ secret: string }>(triggerSource.secretReference.key, { + secret: payload.secret, + }); } return { diff --git a/apps/webapp/app/services/tasks/performTaskOperation.server.ts b/apps/webapp/app/services/tasks/performTaskOperation.server.ts index ce407858b..eeddc7f76 100644 --- a/apps/webapp/app/services/tasks/performTaskOperation.server.ts +++ b/apps/webapp/app/services/tasks/performTaskOperation.server.ts @@ -1,11 +1,6 @@ import type { Task } from "@trigger.dev/database"; import { EXECUTE_JOB_RETRY_LIMIT } from "~/consts"; -import { - $transaction, - PrismaClient, - PrismaClientOrTransaction, - prisma, -} from "~/db.server"; +import { $transaction, PrismaClient, PrismaClientOrTransaction, prisma } from "~/db.server"; import { workerQueue } from "../worker.server"; import { FetchOperationSchema, @@ -76,11 +71,7 @@ export class PerformTaskOperationService { }); if (!response.ok) { - const retryAt = this.#calculateRetryForResponse( - task, - retry, - response - ); + const retryAt = this.#calculateRetryForResponse(task, retry, response); if (retryAt) { return await this.#retryTaskWithError( @@ -119,10 +110,7 @@ export class PerformTaskOperationService { return; } - const strategy = this.#getRetryStrategyForStatusCode( - response.status, - retry - ); + const strategy = this.#getRetryStrategyForStatusCode(response.status, retry); if (!strategy) { return; @@ -140,11 +128,7 @@ export class PerformTaskOperationService { const remaining = response.headers.get(strategy.remainingHeader); const resetAt = response.headers.get(strategy.resetHeader); - if ( - typeof remaining === "string" && - typeof resetAt === "string" && - remaining === "0" - ) { + if (typeof remaining === "string" && typeof resetAt === "string" && remaining === "0") { return new Date(Number(resetAt) * 1000 + addJitterInMs()); } } @@ -290,9 +274,7 @@ export class PerformTaskOperationService { } } -function normalizeHeaders( - headers: FetchRequestInit["headers"] -): Record { +function normalizeHeaders(headers: FetchRequestInit["headers"]): Record { if (!headers) { return {}; } diff --git a/apps/webapp/app/services/triggers/initializeTrigger.server.ts b/apps/webapp/app/services/triggers/initializeTrigger.server.ts index aee17c30f..ef443aefc 100644 --- a/apps/webapp/app/services/triggers/initializeTrigger.server.ts +++ b/apps/webapp/app/services/triggers/initializeTrigger.server.ts @@ -1,7 +1,4 @@ -import { - InitializeTriggerBody, - REGISTER_SOURCE_EVENT, -} from "@trigger.dev/core"; +import { InitializeTriggerBody, REGISTER_SOURCE_EVENT } from "@trigger.dev/core"; import type { PrismaClient } from "~/db.server"; import { prisma } from "~/db.server"; import { AuthenticatedEnvironment } from "../apiAuth.server"; @@ -38,27 +35,19 @@ export class InitializeTriggerService { }, }); - const dynamicTrigger = - await this.#prismaClient.dynamicTrigger.findUniqueOrThrow({ - where: { - endpointId_slug_type: { - endpointId: endpoint.id, - slug: id, - type: "EVENT", - }, + const dynamicTrigger = await this.#prismaClient.dynamicTrigger.findUniqueOrThrow({ + where: { + endpointId_slug_type: { + endpointId: endpoint.id, + slug: id, + type: "EVENT", }, - }); + }, + }); - const clientApi = new EndpointApi( - environment.apiKey, - endpoint.url, - endpoint.slug - ); + const clientApi = new EndpointApi(environment.apiKey, endpoint.url, endpoint.slug); - const registerMetadata = await clientApi.initializeTrigger( - dynamicTrigger.slug, - payload.params - ); + const registerMetadata = await clientApi.initializeTrigger(dynamicTrigger.slug, payload.params); if (!registerMetadata) { throw new Error("Could not initialize trigger"); diff --git a/apps/webapp/app/services/triggers/registerDynamicSchedule.server.ts b/apps/webapp/app/services/triggers/registerDynamicSchedule.server.ts index 861dd5316..f5f54cfe1 100644 --- a/apps/webapp/app/services/triggers/registerDynamicSchedule.server.ts +++ b/apps/webapp/app/services/triggers/registerDynamicSchedule.server.ts @@ -1,7 +1,4 @@ -import { - RegisterDynamicSchedulePayload, - SCHEDULED_EVENT, -} from "@trigger.dev/core"; +import { RegisterDynamicSchedulePayload, SCHEDULED_EVENT } from "@trigger.dev/core"; import { PrismaClientOrTransaction, prisma } from "~/db.server"; import { ExtendedEndpoint, findEndpoint } from "~/models/endpoint.server"; @@ -69,9 +66,7 @@ export class RegisterDynamicScheduleService { connect: jobs.map((job) => ({ id: job.id, })), - disconnect: dynamicTrigger.jobs.filter( - (job) => !jobs.find((j) => j.id === job.id) - ), + disconnect: dynamicTrigger.jobs.filter((job) => !jobs.find((j) => j.id === job.id)), }, }, }); diff --git a/apps/webapp/app/services/triggers/registerDynamicTrigger.server.ts b/apps/webapp/app/services/triggers/registerDynamicTrigger.server.ts index 359ef9459..918c82727 100644 --- a/apps/webapp/app/services/triggers/registerDynamicTrigger.server.ts +++ b/apps/webapp/app/services/triggers/registerDynamicTrigger.server.ts @@ -102,9 +102,7 @@ export class RegisterDynamicTriggerService { connect: jobs.map((job) => ({ id: job.id, })), - disconnect: dynamicTrigger.jobs.filter( - (job) => !jobs.find((j) => j.id === job.id) - ), + disconnect: dynamicTrigger.jobs.filter((job) => !jobs.find((j) => j.id === job.id)), }, }, }); diff --git a/apps/webapp/app/services/triggers/registerTriggerSource.server.ts b/apps/webapp/app/services/triggers/registerTriggerSource.server.ts index ccfe76313..5b2ab4c77 100644 --- a/apps/webapp/app/services/triggers/registerTriggerSource.server.ts +++ b/apps/webapp/app/services/triggers/registerTriggerSource.server.ts @@ -39,16 +39,15 @@ export class RegisterTriggerSourceService { }, }); - const dynamicTrigger = - await this.#prismaClient.dynamicTrigger.findUniqueOrThrow({ - where: { - endpointId_slug_type: { - endpointId: endpoint.id, - slug: id, - type: "EVENT", - }, + const dynamicTrigger = await this.#prismaClient.dynamicTrigger.findUniqueOrThrow({ + where: { + endpointId_slug_type: { + endpointId: endpoint.id, + slug: id, + type: "EVENT", }, - }); + }, + }); return await $transaction( this.#prismaClient, @@ -117,10 +116,9 @@ export class RegisterTriggerSourceService { }, }); - const secretStore = getSecretStore( - triggerSource.secretReference.provider, - { prismaClient: tx } - ); + const secretStore = getSecretStore(triggerSource.secretReference.provider, { + prismaClient: tx, + }); const { secret } = await secretStore.getSecretOrThrow( z.object({ diff --git a/apps/webapp/app/services/worker.server.ts b/apps/webapp/app/services/worker.server.ts index dde2465b4..2e8e9826d 100644 --- a/apps/webapp/app/services/worker.server.ts +++ b/apps/webapp/app/services/worker.server.ts @@ -199,12 +199,7 @@ function getWorkerQueue() { handler: async (payload, job) => { const service = new IndexEndpointService(); - await service.call( - payload.id, - payload.source, - payload.reason, - payload.sourceData - ); + await service.call(payload.id, payload.source, payload.reason, payload.sourceData); }, }, deliverEvent: { diff --git a/apps/webapp/app/utils.ts b/apps/webapp/app/utils.ts index 54c7580a9..dbb7aa718 100644 --- a/apps/webapp/app/utils.ts +++ b/apps/webapp/app/utils.ts @@ -45,10 +45,13 @@ export function useMatchesData( const paths = Array.isArray(id) ? id : [id]; // Get the first matching route - const route = paths.reduce((acc, path) => { - if (acc) return acc; - return matchingRoutes.find((route) => route.id === path); - }, undefined as RouteMatch | undefined); + const route = paths.reduce( + (acc, path) => { + if (acc) return acc; + return matchingRoutes.find((route) => route.id === path); + }, + undefined as RouteMatch | undefined + ); return route; } @@ -161,9 +164,7 @@ export const obfuscateApiKey = (apiKey: string) => { return `${prefix}_${slug}_${"*".repeat(secretPart.length)}`; }; -export function appEnvTitleTag( - appEnv?: "test" | "production" | "development" | "staging" -): string { +export function appEnvTitleTag(appEnv?: "test" | "production" | "development" | "staging"): string { if (!appEnv) { return ""; } diff --git a/apps/webapp/app/utils/formatErrors.server.ts b/apps/webapp/app/utils/formatErrors.server.ts index 6bf96936d..791155f41 100644 --- a/apps/webapp/app/utils/formatErrors.server.ts +++ b/apps/webapp/app/utils/formatErrors.server.ts @@ -1,9 +1,6 @@ import { ErrorWithStack, ErrorWithStackSchema } from "@trigger.dev/core"; -export function formatError( - error: ErrorWithStack, - style: "short" | "long" = "short" -): string { +export function formatError(error: ErrorWithStack, style: "short" | "long" = "short"): string { if (style === "short") { return error.name ? `${error.name}: ${error.message}` : error.message; } @@ -11,10 +8,7 @@ export function formatError( return formatError(error, "short") + "\n" + error.stack; } -export function formatUnknownError( - error: unknown, - style: "short" | "long" = "short" -): string { +export function formatUnknownError(error: unknown, style: "short" | "long" = "short"): string { const parsedError = ErrorWithStackSchema.safeParse(error); if (parsedError.success) { diff --git a/apps/webapp/app/utils/httpErrors.ts b/apps/webapp/app/utils/httpErrors.ts index 0568e1099..637b6bf4b 100644 --- a/apps/webapp/app/utils/httpErrors.ts +++ b/apps/webapp/app/utils/httpErrors.ts @@ -13,9 +13,7 @@ export function friendlyErrorDisplay(statusCode: number, statusText?: string) { case 500: return { title: "500: Server error", - message: - statusText ?? - "Something went wrong on our end. Please try again later.", + message: statusText ?? "Something went wrong on our end. Please try again later.", }; default: return { diff --git a/apps/webapp/app/utils/mergeProperties.server.ts b/apps/webapp/app/utils/mergeProperties.server.ts index db099d7c0..c2c579e2c 100644 --- a/apps/webapp/app/utils/mergeProperties.server.ts +++ b/apps/webapp/app/utils/mergeProperties.server.ts @@ -14,9 +14,7 @@ import { DisplayProperty, DisplayPropertiesSchema } from "@trigger.dev/core"; // ] // // We will use the DisplayPropertiesSchema zod schema to safely parse the properties and if they aren't valid then we'll just ignore them -export function mergeProperties( - ...propertyLists: Array -): Array { +export function mergeProperties(...propertyLists: Array): Array { const mergedProperties = new Map(); for (const propertyList of propertyLists) { diff --git a/apps/webapp/app/utils/pathBuilder.ts b/apps/webapp/app/utils/pathBuilder.ts index 72069f102..e3affdca6 100644 --- a/apps/webapp/app/utils/pathBuilder.ts +++ b/apps/webapp/app/utils/pathBuilder.ts @@ -43,10 +43,9 @@ export const TriggerSourceRunParamsSchema = TriggerSourceParamSchema.extend({ runParam: z.string(), }); -export const TriggerSourceRunTaskParamsSchema = - TriggerSourceRunParamsSchema.extend({ - taskParam: z.string(), - }); +export const TriggerSourceRunTaskParamsSchema = TriggerSourceRunParamsSchema.extend({ + taskParam: z.string(), +}); export function trimTrailingSlash(path: string) { return path.replace(/\/$/, ""); @@ -117,29 +116,18 @@ function organizationParam(organization: OrgForPath) { // Project export function projectPath(organization: OrgForPath, project: ProjectForPath) { - return `/orgs/${organizationParam(organization)}/projects/${projectParam( - project - )}`; + return `/orgs/${organizationParam(organization)}/projects/${projectParam(project)}`; } -export function projectIntegrationsPath( - organization: OrgForPath, - project: ProjectForPath -) { +export function projectIntegrationsPath(organization: OrgForPath, project: ProjectForPath) { return `${projectPath(organization, project)}/integrations`; } -export function projectTriggersPath( - organization: OrgForPath, - project: ProjectForPath -) { +export function projectTriggersPath(organization: OrgForPath, project: ProjectForPath) { return `${projectPath(organization, project)}/triggers`; } -export function projectEnvironmentsPath( - organization: OrgForPath, - project: ProjectForPath -) { +export function projectEnvironmentsPath(organization: OrgForPath, project: ProjectForPath) { return `${projectPath(organization, project)}/environments`; } @@ -168,9 +156,7 @@ export function integrationClientPath( project: ProjectForPath, client: IntegrationForPath ) { - return `${projectIntegrationsPath(organization, project)}/${clientParam( - client - )}`; + return `${projectIntegrationsPath(organization, project)}/${clientParam(client)}`; } export function integrationClientConnectionsPath( @@ -194,10 +180,7 @@ function clientParam(integration: IntegrationForPath) { } // Triggers -export function projectScheduledTriggersPath( - organization: OrgForPath, - project: ProjectForPath -) { +export function projectScheduledTriggersPath(organization: OrgForPath, project: ProjectForPath) { return `${projectTriggersPath(organization, project)}/scheduled`; } @@ -206,10 +189,7 @@ export function externalTriggerPath( project: ProjectForPath, trigger: TriggerForPath ) { - return `${projectTriggersPath( - organization, - project - )}/external/${triggerSourceParam(trigger)}`; + return `${projectTriggersPath(organization, project)}/external/${triggerSourceParam(trigger)}`; } export function externalTriggerRunsParentPath( @@ -226,9 +206,7 @@ export function externalTriggerRunPath( trigger: TriggerForPath, run: RunForPath ) { - return `${externalTriggerRunsParentPath(organization, project, trigger)}/${ - run.id - }`; + return `${externalTriggerRunsParentPath(organization, project, trigger)}/${run.id}`; } export function externalTriggerRunStreamingPath( @@ -237,12 +215,7 @@ export function externalTriggerRunStreamingPath( trigger: TriggerForPath, run: RunForPath ) { - return `${externalTriggerRunPath( - organization, - project, - trigger, - run - )}/stream`; + return `${externalTriggerRunPath(organization, project, trigger, run)}/stream`; } function triggerSourceParam(trigger: TriggerForPath) { @@ -250,27 +223,15 @@ function triggerSourceParam(trigger: TriggerForPath) { } // Job -export function jobPath( - organization: OrgForPath, - project: ProjectForPath, - job: JobForPath -) { +export function jobPath(organization: OrgForPath, project: ProjectForPath, job: JobForPath) { return `${projectPath(organization, project)}/jobs/${jobParam(job)}`; } -export function jobTestPath( - organization: OrgForPath, - project: ProjectForPath, - job: JobForPath -) { +export function jobTestPath(organization: OrgForPath, project: ProjectForPath, job: JobForPath) { return `${jobPath(organization, project, job)}/test`; } -export function jobTriggerPath( - organization: OrgForPath, - project: ProjectForPath, - job: JobForPath -) { +export function jobTriggerPath(organization: OrgForPath, project: ProjectForPath, job: JobForPath) { return `${jobPath(organization, project, job)}/trigger`; } diff --git a/apps/webapp/app/utils/randomWords.ts b/apps/webapp/app/utils/randomWords.ts index 6fa909d56..600065457 100644 --- a/apps/webapp/app/utils/randomWords.ts +++ b/apps/webapp/app/utils/randomWords.ts @@ -2,13 +2,7 @@ export function generateTwoRandomWords() { return randomWords({ exactly: 2, join: "-" }); } -function randomWords({ - exactly, - join, -}: { - exactly: number; - join: string; -}): string { +function randomWords({ exactly, join }: { exactly: number; join: string }): string { const words: string[] = []; for (let i = 0; i < exactly; i++) { diff --git a/apps/webapp/app/utils/sse.ts b/apps/webapp/app/utils/sse.ts index 865f52ddb..66c23154c 100644 --- a/apps/webapp/app/utils/sse.ts +++ b/apps/webapp/app/utils/sse.ts @@ -15,12 +15,7 @@ type Event = { data: string; }; -export function sse({ - request, - pingInterval = 1000, - updateInterval = 348, - run, -}: SseProps) { +export function sse({ request, pingInterval = 1000, updateInterval = 348, run }: SseProps) { let pinger: NodeJS.Timer | undefined = undefined; let updater: NodeJS.Timer | undefined = undefined; diff --git a/apps/webapp/postcss.config.js b/apps/webapp/postcss.config.js index e0c9cbbf9..cb8b23063 100644 --- a/apps/webapp/postcss.config.js +++ b/apps/webapp/postcss.config.js @@ -1,7 +1,3 @@ module.exports = { - plugins: [ - require("postcss-import"), - require("tailwindcss"), - require("autoprefixer"), - ], + plugins: [require("postcss-import"), require("tailwindcss"), require("autoprefixer")], }; diff --git a/apps/webapp/prettier.config.js b/apps/webapp/prettier.config.js index d83c9951c..f652d8bf7 100644 --- a/apps/webapp/prettier.config.js +++ b/apps/webapp/prettier.config.js @@ -1,3 +1,4 @@ module.exports = { - plugins: [require('prettier-plugin-tailwindcss')], -} \ No newline at end of file + ...require("../../prettier.config.js"), + plugins: [require("prettier-plugin-tailwindcss")], +}; diff --git a/apps/webapp/prisma/seed.ts b/apps/webapp/prisma/seed.ts index 02e24d178..298c6c4f8 100644 --- a/apps/webapp/prisma/seed.ts +++ b/apps/webapp/prisma/seed.ts @@ -5,9 +5,7 @@ import { seedCloud } from "./seedCloud"; import { prisma } from "../app/db.server"; async function seedIntegrationAuthMethods() { - for (const [_, integration] of Object.entries( - integrationCatalog.getIntegrations() - )) { + for (const [_, integration] of Object.entries(integrationCatalog.getIntegrations())) { await prisma.integrationDefinition.upsert({ where: { id: integration.identifier, @@ -28,9 +26,7 @@ async function seedIntegrationAuthMethods() { }, }); - for (const [key, authMethod] of Object.entries( - integration.authenticationMethods - )) { + for (const [key, authMethod] of Object.entries(integration.authenticationMethods)) { if (authMethod.type === "oauth2") { console.log(`Upserting auth method ${integration.identifier}.${key}`); @@ -74,10 +70,7 @@ async function seedIntegrationAuthMethods() { async function seed() { await seedIntegrationAuthMethods(); - if ( - process.env.NODE_ENV === "development" && - process.env.SEED_CLOUD === "enabled" - ) { + if (process.env.NODE_ENV === "development" && process.env.SEED_CLOUD === "enabled") { await seedCloud(prisma); } } diff --git a/apps/webapp/remix.config.js b/apps/webapp/remix.config.js index 299bc9056..a95ce2d1a 100644 --- a/apps/webapp/remix.config.js +++ b/apps/webapp/remix.config.js @@ -12,13 +12,7 @@ module.exports = { ignoredRouteFiles: ["**/.*"], devServerPort: 8002, serverModuleFormat: "cjs", - serverDependenciesToBundle: [ - "marked", - "axios", - "@trigger.dev/core", - "emails", - "highlight.run", - ], + serverDependenciesToBundle: ["marked", "axios", "@trigger.dev/core", "emails", "highlight.run"], watchPaths: async () => { return ["../../packages/core/src/**/*", "../../packages/emails/src/**/*"]; }, diff --git a/apps/webapp/server.ts b/apps/webapp/server.ts index ade30ed42..9b2fbbee9 100644 --- a/apps/webapp/server.ts +++ b/apps/webapp/server.ts @@ -27,10 +27,7 @@ app.use(compression()); app.disable("x-powered-by"); // Remix fingerprints its assets so we can cache forever. -app.use( - "/build", - express.static("public/build", { immutable: true, maxAge: "1y" }) -); +app.use("/build", express.static("public/build", { immutable: true, maxAge: "1y" })); // Everything else (like favicon.ico) is cached for an hour. You may want to be // more aggressive with this caching. diff --git a/apps/webapp/tailwind.config.js b/apps/webapp/tailwind.config.js index 53cb3a8a2..dde5b641b 100644 --- a/apps/webapp/tailwind.config.js +++ b/apps/webapp/tailwind.config.js @@ -174,8 +174,7 @@ module.exports = { "accordion-up": "accordion-up 0.2s ease-out", }, backgroundImage: { - "gradient-radial": - "radial-gradient(closest-side, var(--tw-gradient-stops))", + "gradient-radial": "radial-gradient(closest-side, var(--tw-gradient-stops))", "gradient-primary": `linear-gradient(90deg, acid-500 0%, toxic-500 100%)`, "gradient-primary-hover": `linear-gradient(80deg, acid-600 0%, toxic-600 100%)`, "gradient-secondary": `linear-gradient(90deg, hsl(271 91 65) 0%, hsl(221 83 53) 100%)`, diff --git a/config-packages/tailwind-config/package.json b/config-packages/tailwind-config/package.json index e9b83df03..086a1f6a0 100644 --- a/config-packages/tailwind-config/package.json +++ b/config-packages/tailwind-config/package.json @@ -6,4 +6,4 @@ "publishConfig": { "access": "public" } -} \ No newline at end of file +} diff --git a/config-packages/tailwind-config/tailwind.config.js b/config-packages/tailwind-config/tailwind.config.js index a2ebdcb0b..899ffb72f 100644 --- a/config-packages/tailwind-config/tailwind.config.js +++ b/config-packages/tailwind-config/tailwind.config.js @@ -17,7 +17,6 @@ module.exports = { colors: { brandblue: colors.blue[500], brandred: colors.red[500], - }, }, }, diff --git a/config-packages/tsconfig/examples.json b/config-packages/tsconfig/examples.json index 375ae52bd..c6de5a931 100644 --- a/config-packages/tsconfig/examples.json +++ b/config-packages/tsconfig/examples.json @@ -11,25 +11,14 @@ "forceConsistentCasingInFileNames": true, "experimentalDecorators": true, "emitDecoratorMetadata": true, - "lib": [ - "esnext", - "dom" - ], + "lib": ["esnext", "dom"], "outDir": "lib", "moduleResolution": "node", "paths": { - "@trigger.dev/sdk": [ - "../../packages/trigger-sdk/src/index" - ], - "@trigger.dev/sdk/*": [ - "../../packages/trigger-sdk/src/*" - ], - "@trigger.dev/github": [ - "../../integrations/github/src/index" - ], - "@trigger.dev/github/*": [ - "../../integrations/github/src/*" - ] + "@trigger.dev/sdk": ["../../packages/trigger-sdk/src/index"], + "@trigger.dev/sdk/*": ["../../packages/trigger-sdk/src/*"], + "@trigger.dev/github": ["../../integrations/github/src/index"], + "@trigger.dev/github/*": ["../../integrations/github/src/*"] } } -} \ No newline at end of file +} diff --git a/config-packages/tsconfig/node18.json b/config-packages/tsconfig/node18.json index 19174e674..04423c7a1 100644 --- a/config-packages/tsconfig/node18.json +++ b/config-packages/tsconfig/node18.json @@ -3,9 +3,7 @@ "display": "Node 18", "extends": "./base.json", "compilerOptions": { - "lib": [ - "ES2021" - ], + "lib": ["ES2021"], "module": "commonjs", "target": "ES2021", "strict": true, @@ -13,4 +11,4 @@ "skipLibCheck": true, "forceConsistentCasingInFileNames": true } -} \ No newline at end of file +} diff --git a/config-packages/tsconfig/package.json b/config-packages/tsconfig/package.json index dde64db1d..1ede492fc 100644 --- a/config-packages/tsconfig/package.json +++ b/config-packages/tsconfig/package.json @@ -6,4 +6,4 @@ "publishConfig": { "access": "public" } -} \ No newline at end of file +} diff --git a/examples/jobs-starter/app/api/trigger/route.ts b/examples/jobs-starter/app/api/trigger/route.ts index 2d013e541..f66dc0fbe 100644 --- a/examples/jobs-starter/app/api/trigger/route.ts +++ b/examples/jobs-starter/app/api/trigger/route.ts @@ -1,4 +1,3 @@ - import { createAppRoute } from "@trigger.dev/nextjs"; import { client } from "@/trigger"; diff --git a/examples/jobs-starter/app/globals.css b/examples/jobs-starter/app/globals.css index fd81e8858..e0936eda7 100644 --- a/examples/jobs-starter/app/globals.css +++ b/examples/jobs-starter/app/globals.css @@ -18,10 +18,6 @@ body { color: rgb(var(--foreground-rgb)); - background: linear-gradient( - to bottom, - transparent, - rgb(var(--background-end-rgb)) - ) + background: linear-gradient(to bottom, transparent, rgb(var(--background-end-rgb))) rgb(var(--background-start-rgb)); } diff --git a/examples/jobs-starter/app/layout.tsx b/examples/jobs-starter/app/layout.tsx index ae8456212..cce852fd7 100644 --- a/examples/jobs-starter/app/layout.tsx +++ b/examples/jobs-starter/app/layout.tsx @@ -1,22 +1,18 @@ -import './globals.css' -import type { Metadata } from 'next' -import { Inter } from 'next/font/google' +import "./globals.css"; +import type { Metadata } from "next"; +import { Inter } from "next/font/google"; -const inter = Inter({ subsets: ['latin'] }) +const inter = Inter({ subsets: ["latin"] }); export const metadata: Metadata = { - title: 'Create Next App', - description: 'Generated by create next app', -} + title: "Create Next App", + description: "Generated by create next app", +}; -export default function RootLayout({ - children, -}: { - children: React.ReactNode -}) { +export default function RootLayout({ children }: { children: React.ReactNode }) { return ( {children} - ) + ); } diff --git a/examples/jobs-starter/app/page.tsx b/examples/jobs-starter/app/page.tsx index f3a3b8e1a..75ceab209 100644 --- a/examples/jobs-starter/app/page.tsx +++ b/examples/jobs-starter/app/page.tsx @@ -1,4 +1,4 @@ -import Image from 'next/image' +import Image from "next/image"; export default function Home() { return ( @@ -15,7 +15,7 @@ export default function Home() { target="_blank" rel="noopener noreferrer" > - By{' '} + By{" "} Vercel Logo

    - Docs{' '} + Docs{" "} -> @@ -64,7 +64,7 @@ export default function Home() { rel="noopener noreferrer" >

    - Learn{' '} + Learn{" "} -> @@ -81,7 +81,7 @@ export default function Home() { rel="noopener noreferrer" >

    - Templates{' '} + Templates{" "} -> @@ -98,7 +98,7 @@ export default function Home() { rel="noopener noreferrer" >

    - Deploy{' '} + Deploy{" "} -> @@ -109,5 +109,5 @@ export default function Home() {

    - ) + ); } diff --git a/examples/jobs-starter/jobs/starter.ts b/examples/jobs-starter/jobs/starter.ts index 6f3a791aa..fd8d1dd4b 100644 --- a/examples/jobs-starter/jobs/starter.ts +++ b/examples/jobs-starter/jobs/starter.ts @@ -74,9 +74,7 @@ client.defineJob({ { name: "Get Trigger.dev stars count" }, async () => { try { - const response = await fetch( - "https://api.github.com/repos/triggerdotdev/trigger.dev" - ); + const response = await fetch("https://api.github.com/repos/triggerdotdev/trigger.dev"); const { stargazers_count } = await response.json(); return { success: true, stargazers_count }; diff --git a/examples/jobs-starter/next.config.js b/examples/jobs-starter/next.config.js index 767719fc4..658404ac6 100644 --- a/examples/jobs-starter/next.config.js +++ b/examples/jobs-starter/next.config.js @@ -1,4 +1,4 @@ /** @type {import('next').NextConfig} */ -const nextConfig = {} +const nextConfig = {}; -module.exports = nextConfig +module.exports = nextConfig; diff --git a/examples/jobs-starter/postcss.config.js b/examples/jobs-starter/postcss.config.js index 33ad091d2..12a703d90 100644 --- a/examples/jobs-starter/postcss.config.js +++ b/examples/jobs-starter/postcss.config.js @@ -3,4 +3,4 @@ module.exports = { tailwindcss: {}, autoprefixer: {}, }, -} +}; diff --git a/examples/jobs-starter/tailwind.config.js b/examples/jobs-starter/tailwind.config.js index 8c4d1b21f..bb0a4e29f 100644 --- a/examples/jobs-starter/tailwind.config.js +++ b/examples/jobs-starter/tailwind.config.js @@ -1,18 +1,17 @@ /** @type {import('tailwindcss').Config} */ module.exports = { content: [ - './pages/**/*.{js,ts,jsx,tsx,mdx}', - './components/**/*.{js,ts,jsx,tsx,mdx}', - './app/**/*.{js,ts,jsx,tsx,mdx}', + "./pages/**/*.{js,ts,jsx,tsx,mdx}", + "./components/**/*.{js,ts,jsx,tsx,mdx}", + "./app/**/*.{js,ts,jsx,tsx,mdx}", ], theme: { extend: { backgroundImage: { - 'gradient-radial': 'radial-gradient(var(--tw-gradient-stops))', - 'gradient-conic': - 'conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))', + "gradient-radial": "radial-gradient(var(--tw-gradient-stops))", + "gradient-conic": "conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))", }, }, }, plugins: [], -} +}; diff --git a/examples/jobs-starter/trigger.ts b/examples/jobs-starter/trigger.ts index 383db13a2..4d031c8a3 100644 --- a/examples/jobs-starter/trigger.ts +++ b/examples/jobs-starter/trigger.ts @@ -1,4 +1,3 @@ - import { TriggerClient } from "@trigger.dev/sdk"; export const client = new TriggerClient({ @@ -6,4 +5,3 @@ export const client = new TriggerClient({ apiKey: process.env.TRIGGER_API_KEY, apiUrl: process.env.TRIGGER_API_URL, }); - \ No newline at end of file diff --git a/examples/jobs-starter/tsconfig.json b/examples/jobs-starter/tsconfig.json index 143637697..52c2f4f28 100644 --- a/examples/jobs-starter/tsconfig.json +++ b/examples/jobs-starter/tsconfig.json @@ -1,11 +1,7 @@ { "compilerOptions": { "target": "ES2015", - "lib": [ - "dom", - "dom.iterable", - "ES2015" - ], + "lib": ["dom", "dom.iterable", "ES2015"], "allowJs": true, "skipLibCheck": true, "strict": true, @@ -19,21 +15,11 @@ "jsx": "preserve", "incremental": true, "paths": { - "@/*": [ - "./*" - ], - "@trigger.dev/sdk": [ - "../../packages/trigger-sdk/src/index" - ], - "@trigger.dev/sdk/*": [ - "../../packages/trigger-sdk/src/*" - ], - "@trigger.dev/nextjs": [ - "../../packages/nextjs/src/index" - ], - "@trigger.dev/nextjs/*": [ - "../../packages/nextjs/src/*" - ] + "@/*": ["./*"], + "@trigger.dev/sdk": ["../../packages/trigger-sdk/src/index"], + "@trigger.dev/sdk/*": ["../../packages/trigger-sdk/src/*"], + "@trigger.dev/nextjs": ["../../packages/nextjs/src/index"], + "@trigger.dev/nextjs/*": ["../../packages/nextjs/src/*"] }, "plugins": [ { @@ -41,13 +27,6 @@ } ] }, - "include": [ - "next-env.d.ts", - "**/*.ts", - "**/*.tsx", - ".next/types/**/*.ts" - ], - "exclude": [ - "node_modules" - ] + "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], + "exclude": ["node_modules"] } diff --git a/examples/nextjs-12/next.config.js b/examples/nextjs-12/next.config.js index ae887958d..3d3bc9990 100644 --- a/examples/nextjs-12/next.config.js +++ b/examples/nextjs-12/next.config.js @@ -2,6 +2,6 @@ const nextConfig = { reactStrictMode: true, swcMinify: true, -} +}; -module.exports = nextConfig +module.exports = nextConfig; diff --git a/examples/nextjs-12/package.json b/examples/nextjs-12/package.json index 2a124252d..22bd1decf 100644 --- a/examples/nextjs-12/package.json +++ b/examples/nextjs-12/package.json @@ -22,4 +22,4 @@ "trigger.dev": { "endpointId": "nextjs-12" } -} \ No newline at end of file +} diff --git a/examples/nextjs-12/pages/_app.js b/examples/nextjs-12/pages/_app.js index 1e1cec924..2fc3e0700 100644 --- a/examples/nextjs-12/pages/_app.js +++ b/examples/nextjs-12/pages/_app.js @@ -1,7 +1,7 @@ -import '../styles/globals.css' +import "../styles/globals.css"; function MyApp({ Component, pageProps }) { - return + return ; } -export default MyApp +export default MyApp; diff --git a/examples/nextjs-12/pages/api/hello.js b/examples/nextjs-12/pages/api/hello.js index df63de88f..aee21e9af 100644 --- a/examples/nextjs-12/pages/api/hello.js +++ b/examples/nextjs-12/pages/api/hello.js @@ -1,5 +1,5 @@ // Next.js API route support: https://nextjs.org/docs/api-routes/introduction export default function handler(req, res) { - res.status(200).json({ name: 'John Doe' }) + res.status(200).json({ name: "John Doe" }); } diff --git a/examples/nextjs-12/pages/index.js b/examples/nextjs-12/pages/index.js index dc4b64035..32694edba 100644 --- a/examples/nextjs-12/pages/index.js +++ b/examples/nextjs-12/pages/index.js @@ -1,6 +1,6 @@ -import Head from 'next/head' -import Image from 'next/image' -import styles from '../styles/Home.module.css' +import Head from "next/head"; +import Image from "next/image"; +import styles from "../styles/Home.module.css"; export default function Home() { return ( @@ -17,8 +17,7 @@ export default function Home() {

    - Get started by editing{' '} - pages/index.js + Get started by editing pages/index.js

    @@ -32,10 +31,7 @@ export default function Home() {

    Learn about Next.js in an interactive course with quizzes!

    - +

    Examples →

    Discover and deploy boilerplate example Next.js projects.

    @@ -45,9 +41,7 @@ export default function Home() { className={styles.card} >

    Deploy →

    -

    - Instantly deploy your Next.js site to a public URL with Vercel. -

    +

    Instantly deploy your Next.js site to a public URL with Vercel.

    @@ -58,12 +52,12 @@ export default function Home() { target="_blank" rel="noopener noreferrer" > - Powered by{' '} + Powered by{" "} Vercel Logo - ) + ); } diff --git a/examples/nextjs-12/styles/Home.module.css b/examples/nextjs-12/styles/Home.module.css index bd50f42ff..90817bd39 100644 --- a/examples/nextjs-12/styles/Home.module.css +++ b/examples/nextjs-12/styles/Home.module.css @@ -61,8 +61,15 @@ border-radius: 5px; padding: 0.75rem; font-size: 1.1rem; - font-family: Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, - Bitstream Vera Sans Mono, Courier New, monospace; + font-family: + Menlo, + Monaco, + Lucida Console, + Liberation Mono, + DejaVu Sans Mono, + Bitstream Vera Sans Mono, + Courier New, + monospace; } .grid { @@ -81,7 +88,9 @@ text-decoration: none; border: 1px solid #eaeaea; border-radius: 10px; - transition: color 0.15s ease, border-color 0.15s ease; + transition: + color 0.15s ease, + border-color 0.15s ease; max-width: 300px; } diff --git a/examples/nextjs-12/styles/globals.css b/examples/nextjs-12/styles/globals.css index 4f1842163..f7efe20c3 100644 --- a/examples/nextjs-12/styles/globals.css +++ b/examples/nextjs-12/styles/globals.css @@ -2,8 +2,18 @@ html, body { padding: 0; margin: 0; - font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, - Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif; + font-family: + -apple-system, + BlinkMacSystemFont, + Segoe UI, + Roboto, + Oxygen, + Ubuntu, + Cantarell, + Fira Sans, + Droid Sans, + Helvetica Neue, + sans-serif; } a { diff --git a/examples/nextjs-example/.vscode/settings.json b/examples/nextjs-example/.vscode/settings.json index 41db95369..2ba294b7d 100644 --- a/examples/nextjs-example/.vscode/settings.json +++ b/examples/nextjs-example/.vscode/settings.json @@ -1,4 +1,4 @@ { "typescript.tsdk": "../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib", "typescript.enablePromptUseWorkspaceTsdk": true -} \ No newline at end of file +} diff --git a/examples/nextjs-example/next.config.js b/examples/nextjs-example/next.config.js index 60768aae4..701035010 100644 --- a/examples/nextjs-example/next.config.js +++ b/examples/nextjs-example/next.config.js @@ -2,11 +2,7 @@ module.exports = { reactStrictMode: true, - transpilePackages: [ - "@trigger.dev/sdk", - "@trigger.dev/github", - "@trigger.dev/core", - ], + transpilePackages: ["@trigger.dev/sdk", "@trigger.dev/github", "@trigger.dev/core"], experimental: { appDir: true, }, diff --git a/examples/nextjs-example/src/app/events/[eventId]/page.tsx b/examples/nextjs-example/src/app/events/[eventId]/page.tsx index aa6b20b38..dac6eff7a 100644 --- a/examples/nextjs-example/src/app/events/[eventId]/page.tsx +++ b/examples/nextjs-example/src/app/events/[eventId]/page.tsx @@ -1,10 +1,6 @@ import { EventRunData } from "@/components/RunDetails"; -export default function Page({ - params: { eventId }, -}: { - params: { eventId: string }; -}) { +export default function Page({ params: { eventId } }: { params: { eventId: string } }) { return (
    diff --git a/examples/nextjs-example/src/components/ReactQuery.tsx b/examples/nextjs-example/src/components/ReactQuery.tsx index 30a6141f0..663e054e9 100644 --- a/examples/nextjs-example/src/components/ReactQuery.tsx +++ b/examples/nextjs-example/src/components/ReactQuery.tsx @@ -6,7 +6,5 @@ import { QueryClient, QueryClientProvider } from "react-query"; export function ReactQuery({ children }: { children: React.ReactNode }) { const [queryClient] = useState(() => new QueryClient()); - return ( - {children} - ); + return {children}; } diff --git a/examples/nextjs-example/src/components/RunDetails.tsx b/examples/nextjs-example/src/components/RunDetails.tsx index 98044d21f..d6a83dbf1 100644 --- a/examples/nextjs-example/src/components/RunDetails.tsx +++ b/examples/nextjs-example/src/components/RunDetails.tsx @@ -1,11 +1,7 @@ "use client"; import styles from "@/styles/Home.module.css"; -import { - useEventDetails, - useEventRunDetails, - useRunDetails, -} from "@trigger.dev/react"; +import { useEventDetails, useEventRunDetails, useRunDetails } from "@trigger.dev/react"; export function EventData({ id }: { id: string }) { const { isLoading, data, error } = useEventDetails(id); @@ -78,10 +74,7 @@ export function EventRunData({ id }: { id: string }) {
    Run status: {data.status}
    {data.tasks?.map((task) => ( -
    +

    {task.displayKey ?? task.name}

    {task.icon}

    Status: {task.status}

    diff --git a/examples/nextjs-example/src/jobs/edgeCases.ts b/examples/nextjs-example/src/jobs/edgeCases.ts index 51376bf0d..cd7c60b23 100644 --- a/examples/nextjs-example/src/jobs/edgeCases.ts +++ b/examples/nextjs-example/src/jobs/edgeCases.ts @@ -17,9 +17,7 @@ client.defineJob({ console.log(`Running run ${ctx.run.id} at ${new Date().toISOString()}`); for (let i = 0; i < payload.iterations ?? 1; i++) { - await new Promise((resolve) => - setTimeout(resolve, payload.sleepDuration ?? 1000) - ); + await new Promise((resolve) => setTimeout(resolve, payload.sleepDuration ?? 1000)); } console.log(`Finishing run ${ctx.run.id} at ${new Date().toISOString()}`); diff --git a/examples/nextjs-example/src/jobs/general.ts b/examples/nextjs-example/src/jobs/general.ts index 5068c0adb..49f1f3bb7 100644 --- a/examples/nextjs-example/src/jobs/general.ts +++ b/examples/nextjs-example/src/jobs/general.ts @@ -90,18 +90,15 @@ client.defineJob({ run: async (payload, io, ctx) => { if (CHAT_MODELS.includes(payload.model)) { if (payload.background) { - const completion = await io.openai.backgroundCreateChatCompletion( - "✨", - { - model: payload.model, - messages: [ - { - role: "user", - content: payload.prompt, - }, - ], - } - ); + const completion = await io.openai.backgroundCreateChatCompletion("✨", { + model: payload.model, + messages: [ + { + role: "user", + content: payload.prompt, + }, + ], + }); return completion; } @@ -154,13 +151,11 @@ client.defineJob({ messages: [ { role: "system", - content: - "You are an AI assistant that is helpful, creative, clever, and very friendly.", + content: "You are an AI assistant that is helpful, creative, clever, and very friendly.", }, { role: "user", - content: - "Call the supplied function that will tweet a really funny joke", + content: "Call the supplied function that will tweet a really funny joke", }, ], function_call: { name: "tweetFunnyJoke" }, @@ -223,17 +218,13 @@ client.defineJob({ switch (payload.type) { case "DEVELOPER": { return await io.slack.postMessage("message", { - text: `Missing developer connection resolved: ${JSON.stringify( - payload - )}`, + text: `Missing developer connection resolved: ${JSON.stringify(payload)}`, channel: "C04GWUTDC3W", }); } case "EXTERNAL": { return await io.slack.postMessage("message", { - text: `Missing external connection resolved: ${JSON.stringify( - payload - )}`, + text: `Missing external connection resolved: ${JSON.stringify(payload)}`, channel: "C04GWUTDC3W", }); } @@ -373,19 +364,15 @@ client.defineJob({ run: async (payload, io, ctx) => { await io.try( async () => { - return await io.runTask( - "task-1", - { name: "task-1", retry: { limit: 3 } }, - async (task) => { - if (task.attempts > 2) { - return { - bar: "foo", - }; - } - - throw new Error(`Task failed on ${task.attempts} attempt(s)`); + return await io.runTask("task-1", { name: "task-1", retry: { limit: 3 } }, async (task) => { + if (task.attempts > 2) { + return { + bar: "foo", + }; } - ); + + throw new Error(`Task failed on ${task.attempts} attempt(s)`); + }); }, async (error) => { // These should never be reached @@ -403,13 +390,9 @@ client.defineJob({ ); try { - await io.runTask( - "task-2", - { name: "task-2", retry: { limit: 5 } }, - async (task) => { - throw new Error(`Task failed on ${task.attempts} attempt(s)`); - } - ); + await io.runTask("task-2", { name: "task-2", retry: { limit: 5 } }, async (task) => { + throw new Error(`Task failed on ${task.attempts} attempt(s)`); + }); } catch (error) { if (isTriggerError(error)) { throw error; @@ -556,15 +539,10 @@ client.defineJob({ schema: z.object({ owner: z.string(), repo: z.string() }), }), run: async (payload, io, ctx) => { - return await io.registerTrigger( - "register-repo", - dynamicOnIssueOpenedTrigger, - payload.repo, - { - owner: payload.owner, - repo: payload.repo, - } - ); + return await io.registerTrigger("register-repo", dynamicOnIssueOpenedTrigger, payload.repo, { + owner: payload.owner, + repo: payload.repo, + }); }, }); diff --git a/examples/nextjs-example/src/jobs/github.ts b/examples/nextjs-example/src/jobs/github.ts index bd043e9ba..c4aa833b4 100644 --- a/examples/nextjs-example/src/jobs/github.ts +++ b/examples/nextjs-example/src/jobs/github.ts @@ -64,8 +64,7 @@ client.defineJob({ }), run: async (payload, io, ctx) => { //delay for 24 hours (or 60 seconds in development) - const delayDuration = - ctx.environment.type === "DEVELOPMENT" ? 60 : 60 * 60 * 24; + const delayDuration = ctx.environment.type === "DEVELOPMENT" ? 60 : 60 * 60 * 24; await io.wait("wait 24 hours", delayDuration); const issue = await io.github.getIssue("get issue", { @@ -335,14 +334,11 @@ client.defineJob({ run: async (payload, io, ctx) => { await io.logger.info("This is a simple log info message"); - const ref = await io.github.listMatchingReferences( - "List Matching References", - { - owner: payload.repository.owner.login, - repo: payload.repository.name, - ref: payload.ref, - } - ); + const ref = await io.github.listMatchingReferences("List Matching References", { + owner: payload.repository.owner.login, + repo: payload.repository.name, + ref: payload.ref, + }); await io.logger.info("Reference ", ref); diff --git a/examples/nextjs-example/src/jobs/openai.ts b/examples/nextjs-example/src/jobs/openai.ts index 9fc921adf..cd3219fa5 100644 --- a/examples/nextjs-example/src/jobs/openai.ts +++ b/examples/nextjs-example/src/jobs/openai.ts @@ -28,18 +28,15 @@ client.defineJob({ }); } - await io.openai.backgroundCreateChatCompletion( - "background-chat-completion", - { - model: "gpt-3.5-turbo", - messages: [ - { - role: "user", - content: "Create a good programming joke about background jobs", - }, - ], - } - ); + await io.openai.backgroundCreateChatCompletion("background-chat-completion", { + model: "gpt-3.5-turbo", + messages: [ + { + role: "user", + content: "Create a good programming joke about background jobs", + }, + ], + }); await io.openai.createChatCompletion("chat-completion", { model: "gpt-3.5-turbo", @@ -124,8 +121,7 @@ client.defineJob({ }, { prompt: "Tell me another joke", - completion: - "Why did the chicken cross the road? To get to the other side", + completion: "Why did the chicken cross the road? To get to the other side", }, ], }); @@ -153,9 +149,7 @@ client.defineJob({ await io.logger.info("files", files); //this will fail because the fine tune didn't complete - await io.logger.info( - "This next task will fail because the model never completed" - ); + await io.logger.info("This next task will fail because the model never completed"); const deleteFineTune = await io.openai.deleteFineTune("delete-fine-tune", { fineTunedModelId: model.id, }); diff --git a/examples/nextjs-example/src/jobs/plain.ts b/examples/nextjs-example/src/jobs/plain.ts index a2cf5647c..23c8f08d8 100644 --- a/examples/nextjs-example/src/jobs/plain.ts +++ b/examples/nextjs-example/src/jobs/plain.ts @@ -49,36 +49,33 @@ client.defineJob({ customerId: customer.id, }); - const timelineEntry = await io.plain.upsertCustomTimelineEntry( - "upsert-timeline-entry", - { - customerId: customer.id, - title: "My timeline entry", - components: [ - { - componentText: { - text: `This is a nice title`, - }, + const timelineEntry = await io.plain.upsertCustomTimelineEntry("upsert-timeline-entry", { + customerId: customer.id, + title: "My timeline entry", + components: [ + { + componentText: { + text: `This is a nice title`, }, - { - componentDivider: { - dividerSpacingSize: ComponentDividerSpacingSize.M, - }, + }, + { + componentDivider: { + dividerSpacingSize: ComponentDividerSpacingSize.M, }, - { - componentText: { - textSize: ComponentTextSize.S, - textColor: ComponentTextColor.Muted, - text: "External id", - }, + }, + { + componentText: { + textSize: ComponentTextSize.S, + textColor: ComponentTextColor.Muted, + text: "External id", }, - { - componentText: { - text: foundCustomer?.externalId ?? "", - }, + }, + { + componentText: { + text: foundCustomer?.externalId ?? "", }, - ], - } - ); + }, + ], + }); }, }); diff --git a/examples/nextjs-example/src/jobs/supabase.ts b/examples/nextjs-example/src/jobs/supabase.ts index c29041224..0b93b3c37 100644 --- a/examples/nextjs-example/src/jobs/supabase.ts +++ b/examples/nextjs-example/src/jobs/supabase.ts @@ -33,10 +33,7 @@ const supabaseDB = new Supabase({ supabaseKey: process.env["SUPABASE_KEY"]!, }); -async function doPlaygroundStuff( - io: IntegrationIO, - ref: string -) { +async function doPlaygroundStuff(io: IntegrationIO, ref: string) { await io.getPGConfig("get-pg-config", { ref, }); diff --git a/examples/nextjs-example/src/jobs/typeform.ts b/examples/nextjs-example/src/jobs/typeform.ts index 5236bcd4f..9e285acb5 100644 --- a/examples/nextjs-example/src/jobs/typeform.ts +++ b/examples/nextjs-example/src/jobs/typeform.ts @@ -35,12 +35,9 @@ client.defineJob({ pageSize: 50, }); - const allResponses = await io.typeform.getAllResponses( - "get-all-responses", - { - uid: payload.formId, - } - ); + const allResponses = await io.typeform.getAllResponses("get-all-responses", { + uid: payload.formId, + }); } }, }); diff --git a/examples/nextjs-example/src/mocks/handlers.ts b/examples/nextjs-example/src/mocks/handlers.ts index 8a06f03c0..b8aa0cc57 100644 --- a/examples/nextjs-example/src/mocks/handlers.ts +++ b/examples/nextjs-example/src/mocks/handlers.ts @@ -3,38 +3,35 @@ import { rest } from "msw"; import { z } from "zod"; export const handlers = [ - rest.get( - "https://api.github.com/repos/ericallam/triggerdotdev-test-repo", - (req, res, ctx) => { - const { "x-trigger-attempt": attempts } = z - .object({ - "x-trigger-attempt": z.coerce.number().optional(), - }) - .parse(Object.fromEntries(req.headers.entries())); + rest.get("https://api.github.com/repos/ericallam/triggerdotdev-test-repo", (req, res, ctx) => { + const { "x-trigger-attempt": attempts } = z + .object({ + "x-trigger-attempt": z.coerce.number().optional(), + }) + .parse(Object.fromEntries(req.headers.entries())); - if (typeof attempts === "number" && attempts > 2) { - return req.passthrough(); - } - - // Return a rate-limited error - const nowInSeconds = Math.floor(Date.now() / 1000); - const rateLimitResetTime = nowInSeconds + 10; - - return res( - // Respond with a 200 status code - ctx.status(403), - // And a response body of an error - ctx.json({ - message: "API rate limit exceeded", - documentation_url: - "https://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting", - }), - ctx.set({ - "x-ratelimit-limit": "60", - "x-ratelimit-remaining": "0", - "x-ratelimit-reset": rateLimitResetTime.toString(), - }) - ); + if (typeof attempts === "number" && attempts > 2) { + return req.passthrough(); } - ), + + // Return a rate-limited error + const nowInSeconds = Math.floor(Date.now() / 1000); + const rateLimitResetTime = nowInSeconds + 10; + + return res( + // Respond with a 200 status code + ctx.status(403), + // And a response body of an error + ctx.json({ + message: "API rate limit exceeded", + documentation_url: + "https://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting", + }), + ctx.set({ + "x-ratelimit-limit": "60", + "x-ratelimit-remaining": "0", + "x-ratelimit-reset": rateLimitResetTime.toString(), + }) + ); + }), ]; diff --git a/examples/nextjs-example/src/styles/Home.module.css b/examples/nextjs-example/src/styles/Home.module.css index 9411a5e6f..c224ff1d9 100644 --- a/examples/nextjs-example/src/styles/Home.module.css +++ b/examples/nextjs-example/src/styles/Home.module.css @@ -51,7 +51,9 @@ border-radius: var(--border-radius); background: rgba(var(--card-rgb), 0); border: 1px solid rgba(var(--card-border-rgb), 0); - transition: background 200ms, border 200ms; + transition: + background 200ms, + border 200ms; } .card span { @@ -97,7 +99,7 @@ .center::before, .center::after { - content: ''; + content: ""; left: 50%; position: absolute; filter: blur(45px); @@ -193,11 +195,7 @@ inset: auto 0 0; padding: 2rem; height: 200px; - background: linear-gradient( - to bottom, - transparent 0%, - rgb(var(--background-end-rgb)) 40% - ); + background: linear-gradient(to bottom, transparent 0%, rgb(var(--background-end-rgb)) 40%); z-index: 1; } } diff --git a/examples/nextjs-example/src/styles/globals.css b/examples/nextjs-example/src/styles/globals.css index d4f491e15..185bdf8c2 100644 --- a/examples/nextjs-example/src/styles/globals.css +++ b/examples/nextjs-example/src/styles/globals.css @@ -1,9 +1,9 @@ :root { --max-width: 1100px; --border-radius: 12px; - --font-mono: ui-monospace, Menlo, Monaco, 'Cascadia Mono', 'Segoe UI Mono', - 'Roboto Mono', 'Oxygen Mono', 'Ubuntu Monospace', 'Source Code Pro', - 'Fira Mono', 'Droid Sans Mono', 'Courier New', monospace; + --font-mono: ui-monospace, Menlo, Monaco, "Cascadia Mono", "Segoe UI Mono", "Roboto Mono", + "Oxygen Mono", "Ubuntu Monospace", "Source Code Pro", "Fira Mono", "Droid Sans Mono", + "Courier New", monospace; --foreground-rgb: 0, 0, 0; --background-start-rgb: 214, 219, 220; @@ -17,10 +17,7 @@ #0071ff33 160deg, transparent 360deg ); - --secondary-glow: radial-gradient( - rgba(255, 255, 255, 1), - rgba(255, 255, 255, 0) - ); + --secondary-glow: radial-gradient(rgba(255, 255, 255, 1), rgba(255, 255, 255, 0)); --tile-start-rgb: 239, 245, 249; --tile-end-rgb: 228, 232, 233; @@ -87,11 +84,7 @@ body { body { color: rgb(var(--foreground-rgb)); - background: linear-gradient( - to bottom, - transparent, - rgb(var(--background-end-rgb)) - ) + background: linear-gradient(to bottom, transparent, rgb(var(--background-end-rgb))) rgb(var(--background-start-rgb)); } diff --git a/examples/nextjs-example/src/supabase.types.ts b/examples/nextjs-example/src/supabase.types.ts index 64bc4ef2e..8b70f36cf 100644 --- a/examples/nextjs-example/src/supabase.types.ts +++ b/examples/nextjs-example/src/supabase.types.ts @@ -1,118 +1,112 @@ -export type Json = - | string - | number - | boolean - | null - | { [key: string]: Json | undefined } - | Json[] +export type Json = string | number | boolean | null | { [key: string]: Json | undefined } | Json[]; export interface Database { public: { Tables: { todos: { Row: { - contents: string | null - created_at: string | null - id: number - is_complete: boolean | null - user_id: number | null - } + contents: string | null; + created_at: string | null; + id: number; + is_complete: boolean | null; + user_id: number | null; + }; Insert: { - contents?: string | null - created_at?: string | null - id?: number - is_complete?: boolean | null - user_id?: number | null - } + contents?: string | null; + created_at?: string | null; + id?: number; + is_complete?: boolean | null; + user_id?: number | null; + }; Update: { - contents?: string | null - created_at?: string | null - id?: number - is_complete?: boolean | null - user_id?: number | null - } + contents?: string | null; + created_at?: string | null; + id?: number; + is_complete?: boolean | null; + user_id?: number | null; + }; Relationships: [ { - foreignKeyName: "todos_user_id_fkey" - columns: ["user_id"] - referencedRelation: "users" - referencedColumns: ["id"] - } - ] - } + foreignKeyName: "todos_user_id_fkey"; + columns: ["user_id"]; + referencedRelation: "users"; + referencedColumns: ["id"]; + }, + ]; + }; users: { Row: { - created_at: string | null - email_address: string | null - first_name: string | null - id: number - last_name: string | null - } + created_at: string | null; + email_address: string | null; + first_name: string | null; + id: number; + last_name: string | null; + }; Insert: { - created_at?: string | null - email_address?: string | null - first_name?: string | null - id?: number - last_name?: string | null - } + created_at?: string | null; + email_address?: string | null; + first_name?: string | null; + id?: number; + last_name?: string | null; + }; Update: { - created_at?: string | null - email_address?: string | null - first_name?: string | null - id?: number - last_name?: string | null - } - Relationships: [] - } - } + created_at?: string | null; + email_address?: string | null; + first_name?: string | null; + id?: number; + last_name?: string | null; + }; + Relationships: []; + }; + }; Views: { - [_ in never]: never - } + [_ in never]: never; + }; Functions: { - [_ in never]: never - } + [_ in never]: never; + }; Enums: { - [_ in never]: never - } + [_ in never]: never; + }; CompositeTypes: { - [_ in never]: never - } - } + [_ in never]: never; + }; + }; public_2: { Tables: { tweets: { Row: { - content: string - created_at: string | null - id: number - tweet_id: string - } + content: string; + created_at: string | null; + id: number; + tweet_id: string; + }; Insert: { - content: string - created_at?: string | null - id?: number - tweet_id: string - } + content: string; + created_at?: string | null; + id?: number; + tweet_id: string; + }; Update: { - content?: string - created_at?: string | null - id?: number - tweet_id?: string - } - Relationships: [] - } - } + content?: string; + created_at?: string | null; + id?: number; + tweet_id?: string; + }; + Relationships: []; + }; + }; Views: { - [_ in never]: never - } + [_ in never]: never; + }; Functions: { - [_ in never]: never - } + [_ in never]: never; + }; Enums: { - [_ in never]: never - } + [_ in never]: never; + }; CompositeTypes: { - [_ in never]: never - } - } + [_ in never]: never; + }; + }; } diff --git a/examples/nextjs-example/tsconfig.json b/examples/nextjs-example/tsconfig.json index 54f432639..5b03f730d 100644 --- a/examples/nextjs-example/tsconfig.json +++ b/examples/nextjs-example/tsconfig.json @@ -1,11 +1,7 @@ { "compilerOptions": { "target": "ES2015", - "lib": [ - "dom", - "dom.iterable", - "ES2015" - ], + "lib": ["dom", "dom.iterable", "ES2015"], "allowJs": true, "skipLibCheck": true, "strict": true, @@ -19,81 +15,31 @@ "jsx": "preserve", "incremental": true, "paths": { - "@/*": [ - "./src/*" - ], - "@trigger.dev/sdk": [ - "../../packages/trigger-sdk/src/index" - ], - "@trigger.dev/sdk/*": [ - "../../packages/trigger-sdk/src/*" - ], - "@trigger.dev/nextjs": [ - "../../packages/nextjs/src/index" - ], - "@trigger.dev/nextjs/*": [ - "../../packages/nextjs/src/*" - ], - "@trigger.dev/core": [ - "../../packages/core/src/index" - ], - "@trigger.dev/core/*": [ - "../../packages/core/src/*" - ], - "@trigger.dev/integration-kit": [ - "../../packages/integration-kit/src/index" - ], - "@trigger.dev/integration-kit/*": [ - "../../packages/integration-kit/src/*" - ], - "@trigger.dev/github": [ - "../../integrations/github/src/index" - ], - "@trigger.dev/github/*": [ - "../../integrations/github/src/*" - ], - "@trigger.dev/slack": [ - "../../integrations/slack/src/index" - ], - "@trigger.dev/slack/*": [ - "../../integrations/slack/src/*" - ], - "@trigger.dev/openai": [ - "../../integrations/openai/src/index" - ], - "@trigger.dev/openai/*": [ - "../../integrations/openai/src/*" - ], - "@trigger.dev/resend": [ - "../../integrations/resend/src/index" - ], - "@trigger.dev/resend/*": [ - "../../integrations/resend/src/*" - ], - "@trigger.dev/typeform": [ - "../../integrations/typeform/src/index" - ], - "@trigger.dev/typeform/*": [ - "../../integrations/typeform/src/*" - ], - "@trigger.dev/plain": [ - "../../integrations/plain/src/index" - ], - "@trigger.dev/plain/*": [ - "../../integrations/plain/src/*" - ], - "@trigger.dev/supabase": [ - "../../integrations/supabase/src/index" - ], - "@trigger.dev/supabase/*": [ - "../../integrations/supabase/src/*" - ], - "@trigger.dev/stripe": [ - "../../integrations/stripe/src/index" - ], - "@trigger.dev/stripe/*": [ - "../../integrations/stripe/src/*" - ] + "@/*": ["./src/*"], + "@trigger.dev/sdk": ["../../packages/trigger-sdk/src/index"], + "@trigger.dev/sdk/*": ["../../packages/trigger-sdk/src/*"], + "@trigger.dev/nextjs": ["../../packages/nextjs/src/index"], + "@trigger.dev/nextjs/*": ["../../packages/nextjs/src/*"], + "@trigger.dev/core": ["../../packages/core/src/index"], + "@trigger.dev/core/*": ["../../packages/core/src/*"], + "@trigger.dev/integration-kit": ["../../packages/integration-kit/src/index"], + "@trigger.dev/integration-kit/*": ["../../packages/integration-kit/src/*"], + "@trigger.dev/github": ["../../integrations/github/src/index"], + "@trigger.dev/github/*": ["../../integrations/github/src/*"], + "@trigger.dev/slack": ["../../integrations/slack/src/index"], + "@trigger.dev/slack/*": ["../../integrations/slack/src/*"], + "@trigger.dev/openai": ["../../integrations/openai/src/index"], + "@trigger.dev/openai/*": ["../../integrations/openai/src/*"], + "@trigger.dev/resend": ["../../integrations/resend/src/index"], + "@trigger.dev/resend/*": ["../../integrations/resend/src/*"], + "@trigger.dev/typeform": ["../../integrations/typeform/src/index"], + "@trigger.dev/typeform/*": ["../../integrations/typeform/src/*"], + "@trigger.dev/plain": ["../../integrations/plain/src/index"], + "@trigger.dev/plain/*": ["../../integrations/plain/src/*"], + "@trigger.dev/supabase": ["../../integrations/supabase/src/index"], + "@trigger.dev/supabase/*": ["../../integrations/supabase/src/*"], + "@trigger.dev/stripe": ["../../integrations/stripe/src/index"], + "@trigger.dev/stripe/*": ["../../integrations/stripe/src/*"] }, "plugins": [ { @@ -101,13 +47,6 @@ } ] }, - "include": [ - "next-env.d.ts", - "**/*.ts", - "**/*.tsx", - ".next/types/**/*.ts" - ], - "exclude": [ - "node_modules" - ] + "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], + "exclude": ["node_modules"] } diff --git a/examples/package-tester/app/components/ReactHooks.tsx b/examples/package-tester/app/components/ReactHooks.tsx index 6d763b401..32e1848d7 100644 --- a/examples/package-tester/app/components/ReactHooks.tsx +++ b/examples/package-tester/app/components/ReactHooks.tsx @@ -10,8 +10,7 @@ import Link from "next/link"; export function ReactHooks({ eventId }: { eventId: string }) { const providerData = useTriggerProvider(); - const { isSuccess, isLoading, isError, data, error } = - useEventRunDetails(eventId); + const { isSuccess, isLoading, isError, data, error } = useEventRunDetails(eventId); const event = useEventDetails(eventId); console.log("event.data", event.data); @@ -28,9 +27,7 @@ export function ReactHooks({ eventId }: { eventId: string }) {

    useTriggerProvider()

    -          {providerData !== undefined &&
    -            providerData.publicApiKey !== null &&
    -            "✅ Working"}
    +          {providerData !== undefined && providerData.publicApiKey !== null && "✅ Working"}
             
    @@ -41,9 +38,7 @@ export function ReactHooks({ eventId }: { eventId: string }) { <> diff --git a/examples/package-tester/app/components/SendReactHookEventForm.tsx b/examples/package-tester/app/components/SendReactHookEventForm.tsx index 42b8f85b3..1c2b23197 100644 --- a/examples/package-tester/app/components/SendReactHookEventForm.tsx +++ b/examples/package-tester/app/components/SendReactHookEventForm.tsx @@ -5,9 +5,7 @@ import { sendReactHookEvent } from "../_actions"; export default function SendReactHookEventForm() { return ( - + ); } diff --git a/examples/package-tester/app/events/[eventId]/page.tsx b/examples/package-tester/app/events/[eventId]/page.tsx index 19e957529..72134246d 100644 --- a/examples/package-tester/app/events/[eventId]/page.tsx +++ b/examples/package-tester/app/events/[eventId]/page.tsx @@ -1,10 +1,6 @@ import { ReactHooks } from "@/app/components/ReactHooks"; -export default function Page({ - params: { eventId }, -}: { - params: { eventId: string }; -}) { +export default function Page({ params: { eventId } }: { params: { eventId: string } }) { return (
    diff --git a/examples/package-tester/app/globals.css b/examples/package-tester/app/globals.css index fd81e8858..e0936eda7 100644 --- a/examples/package-tester/app/globals.css +++ b/examples/package-tester/app/globals.css @@ -18,10 +18,6 @@ body { color: rgb(var(--foreground-rgb)); - background: linear-gradient( - to bottom, - transparent, - rgb(var(--background-end-rgb)) - ) + background: linear-gradient(to bottom, transparent, rgb(var(--background-end-rgb))) rgb(var(--background-start-rgb)); } diff --git a/examples/package-tester/app/jobs/react-hook.ts b/examples/package-tester/app/jobs/react-hook.ts index 1647a5153..f3317728c 100644 --- a/examples/package-tester/app/jobs/react-hook.ts +++ b/examples/package-tester/app/jobs/react-hook.ts @@ -22,18 +22,15 @@ client.defineJob({ await io.wait("Wait 2 seconds", 2); await io.wait("Wait 1 second", 1); - const result = await io.openai.backgroundCreateChatCompletion( - "Tell me a joke", - { - model: "gpt-3.5-turbo-16k", - messages: [ - { - role: "user", - content: `Tell me a joke please`, - }, - ], - } - ); + const result = await io.openai.backgroundCreateChatCompletion("Tell me a joke", { + model: "gpt-3.5-turbo-16k", + messages: [ + { + role: "user", + content: `Tell me a joke please`, + }, + ], + }); return { summary: result?.choices[0]?.message?.content, diff --git a/examples/package-tester/app/layout.tsx b/examples/package-tester/app/layout.tsx index 107334e10..14de92d23 100644 --- a/examples/package-tester/app/layout.tsx +++ b/examples/package-tester/app/layout.tsx @@ -1,11 +1,7 @@ import "./globals.css"; import { TriggerProvider } from "@trigger.dev/react"; -export default function RootLayout({ - children, -}: { - children: React.ReactNode; -}) { +export default function RootLayout({ children }: { children: React.ReactNode }) { return ( diff --git a/examples/package-tester/postcss.config.js b/examples/package-tester/postcss.config.js index 33ad091d2..12a703d90 100644 --- a/examples/package-tester/postcss.config.js +++ b/examples/package-tester/postcss.config.js @@ -3,4 +3,4 @@ module.exports = { tailwindcss: {}, autoprefixer: {}, }, -} +}; diff --git a/examples/package-tester/tailwind.config.js b/examples/package-tester/tailwind.config.js index 8c4d1b21f..bb0a4e29f 100644 --- a/examples/package-tester/tailwind.config.js +++ b/examples/package-tester/tailwind.config.js @@ -1,18 +1,17 @@ /** @type {import('tailwindcss').Config} */ module.exports = { content: [ - './pages/**/*.{js,ts,jsx,tsx,mdx}', - './components/**/*.{js,ts,jsx,tsx,mdx}', - './app/**/*.{js,ts,jsx,tsx,mdx}', + "./pages/**/*.{js,ts,jsx,tsx,mdx}", + "./components/**/*.{js,ts,jsx,tsx,mdx}", + "./app/**/*.{js,ts,jsx,tsx,mdx}", ], theme: { extend: { backgroundImage: { - 'gradient-radial': 'radial-gradient(var(--tw-gradient-stops))', - 'gradient-conic': - 'conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))', + "gradient-radial": "radial-gradient(var(--tw-gradient-stops))", + "gradient-conic": "conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))", }, }, }, plugins: [], -} +}; diff --git a/integrations/github/package.json b/integrations/github/package.json index 6e2e511c8..9cc0d310e 100644 --- a/integrations/github/package.json +++ b/integrations/github/package.json @@ -37,4 +37,4 @@ "engines": { "node": ">=16.8.0" } -} \ No newline at end of file +} diff --git a/integrations/github/src/index.ts b/integrations/github/src/index.ts index 51e133c22..1fe283552 100644 --- a/integrations/github/src/index.ts +++ b/integrations/github/src/index.ts @@ -49,9 +49,7 @@ type GithubTriggers = { org: ReturnType; }; -export class Github - implements TriggerIntegration> -{ +export class Github implements TriggerIntegration> { client: IntegrationClient; _repoSource: ReturnType; _orgSource: ReturnType; @@ -441,16 +439,11 @@ export const events = { // params.event has to be a union of all the values of the exports events object type GitHubEvents = (typeof events)[keyof typeof events]; -type CreateRepoTriggerReturnType = < - TEventSpecification extends GitHubEvents ->(args: { +type CreateRepoTriggerReturnType = (args: { event: TEventSpecification; owner: string; repo: string; -}) => ExternalSourceTrigger< - TEventSpecification, - ReturnType ->; +}) => ExternalSourceTrigger>; function createRepoTrigger( source: ReturnType @@ -472,15 +465,10 @@ function createRepoTrigger( }; } -type CreateOrgTriggerReturnType = < - TEventSpecification extends GitHubEvents ->(args: { +type CreateOrgTriggerReturnType = (args: { event: TEventSpecification; org: string; -}) => ExternalSourceTrigger< - TEventSpecification, - ReturnType ->; +}) => ExternalSourceTrigger>; function createOrgTrigger( source: ReturnType diff --git a/integrations/github/src/sources.ts b/integrations/github/src/sources.ts index b4e2a9b93..797bafc16 100644 --- a/integrations/github/src/sources.ts +++ b/integrations/github/src/sources.ts @@ -66,17 +66,14 @@ export function createRepoEventSource( if (httpSource.active && webhookData(httpSource.data)) { if (missingEvents.length > 0) { // We need to update the webhook to add the new events and then return - const newWebhookData = await io.integration.updateWebhook( - "update-webhook", - { - owner: params.owner, - repo: params.repo, - hookId: httpSource.data.id, - url: httpSource.url, - secret: httpSource.secret, - addEvents: missingEvents, - } - ); + const newWebhookData = await io.integration.updateWebhook("update-webhook", { + owner: params.owner, + repo: params.repo, + hookId: httpSource.data.id, + url: httpSource.url, + secret: httpSource.secret, + addEvents: missingEvents, + }); return { data: newWebhookData, @@ -92,23 +89,18 @@ export function createRepoEventSource( repo: params.repo, }); - const existingWebhook = webhooks.find( - (w) => w.config.url === httpSource.url - ); + const existingWebhook = webhooks.find((w) => w.config.url === httpSource.url); // There is an existing webhook, but it's not synced with Trigger.dev, so we need to update it with the secret if (existingWebhook && existingWebhook.active) { - const updatedWebhook = await io.integration.updateWebhook( - "update-webhook", - { - owner: params.owner, - repo: params.repo, - hookId: existingWebhook.id, - url: httpSource.url, - secret: httpSource.secret, - addEvents: missingEvents, - } - ); + const updatedWebhook = await io.integration.updateWebhook("update-webhook", { + owner: params.owner, + repo: params.repo, + hookId: existingWebhook.id, + url: httpSource.url, + secret: httpSource.secret, + addEvents: missingEvents, + }); return { data: updatedWebhook, @@ -167,16 +159,13 @@ export function createOrgEventSource( const existingData = httpSource.data; // We need to update the webhook to add the new events and then return - const newWebhookData = await io.integration.updateOrgWebhook( - "update-webhook", - { - org: params.org, - hookId: existingData.id, - url: httpSource.url, - secret: httpSource.secret, - addEvents: missingEvents, - } - ); + const newWebhookData = await io.integration.updateOrgWebhook("update-webhook", { + org: params.org, + hookId: existingData.id, + url: httpSource.url, + secret: httpSource.secret, + addEvents: missingEvents, + }); return { secret: httpSource.secret, @@ -189,22 +178,17 @@ export function createOrgEventSource( org: params.org, }); - const existingWebhook = webhooks.find( - (w) => w.config.url === httpSource.url - ); + const existingWebhook = webhooks.find((w) => w.config.url === httpSource.url); const secret = Math.random().toString(36).slice(2); if (existingWebhook && existingWebhook.active) { - const updatedWebhook = await io.integration.updateOrgWebhook( - "update-webhook", - { - org: params.org, - hookId: existingWebhook.id, - url: httpSource.url, - secret, - } - ); + const updatedWebhook = await io.integration.updateOrgWebhook("update-webhook", { + org: params.org, + hookId: existingWebhook.id, + url: httpSource.url, + secret, + }); return { secret, @@ -262,13 +246,10 @@ async function webhookHandler(event: HandlerEvent<"HTTP">, logger: Logger) { }); if (!githubWebhooks.verify(rawBody, signature)) { - logger.debug( - "[inside github integration] Unable to verify the signature of the rawBody", - { - signature, - secret: source.secret, - } - ); + logger.debug("[inside github integration] Unable to verify the signature of the rawBody", { + signature, + secret: source.secret, + }); return; } @@ -297,14 +278,11 @@ async function webhookHandler(event: HandlerEvent<"HTTP">, logger: Logger) { return; } - logger.debug( - "[inside github integration] Returning an event for the webhook!", - { - name, - payload, - context, - } - ); + logger.debug("[inside github integration] Returning an event for the webhook!", { + name, + payload, + context, + }); return { events: [ diff --git a/integrations/github/src/tasks.ts b/integrations/github/src/tasks.ts index a22f150a5..c5ac1a4c6 100644 --- a/integrations/github/src/tasks.ts +++ b/integrations/github/src/tasks.ts @@ -8,12 +8,8 @@ type OctokitClient = InstanceType; type GithubAuthenticatedTask< TParams extends Record, - TFunction extends (...args: any[]) => any -> = AuthenticatedTask< - OctokitClient, - TParams, - GetResponseDataTypeFromEndpointMethod ->; + TFunction extends (...args: any[]) => any, +> = AuthenticatedTask>; function isRequestError(error: unknown): error is RequestError { return typeof error === "object" && error !== null && "status" in error; @@ -219,15 +215,7 @@ const getRepo: GithubAuthenticatedTask< }, }; -type ReactionContent = - | "+1" - | "-1" - | "laugh" - | "confused" - | "heart" - | "hooray" - | "rocket" - | "eyes"; +type ReactionContent = "+1" | "-1" | "laugh" | "confused" | "heart" | "hooray" | "rocket" | "eyes"; const addIssueCommentReaction: GithubAuthenticatedTask< { diff --git a/integrations/github/src/webhook-examples.ts b/integrations/github/src/webhook-examples.ts index 68847ecab..caec3776e 100644 --- a/integrations/github/src/webhook-examples.ts +++ b/integrations/github/src/webhook-examples.ts @@ -21,16 +21,12 @@ export const issueAssigned: EventSpecificationExample = { events_url: "https://api.github.com/users/matt-aitken/events{/privacy}", site_admin: false, gravatar_id: "", - starred_url: - "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", + starred_url: "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", followers_url: "https://api.github.com/users/matt-aitken/followers", - following_url: - "https://api.github.com/users/matt-aitken/following{/other_user}", + following_url: "https://api.github.com/users/matt-aitken/following{/other_user}", organizations_url: "https://api.github.com/users/matt-aitken/orgs", - subscriptions_url: - "https://api.github.com/users/matt-aitken/subscriptions", - received_events_url: - "https://api.github.com/users/matt-aitken/received_events", + subscriptions_url: "https://api.github.com/users/matt-aitken/subscriptions", + received_events_url: "https://api.github.com/users/matt-aitken/received_events", }, state: "open", title: "Fourth time lucky?", @@ -51,16 +47,12 @@ export const issueAssigned: EventSpecificationExample = { events_url: "https://api.github.com/users/matt-aitken/events{/privacy}", site_admin: false, gravatar_id: "", - starred_url: - "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", + starred_url: "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", followers_url: "https://api.github.com/users/matt-aitken/followers", - following_url: - "https://api.github.com/users/matt-aitken/following{/other_user}", + following_url: "https://api.github.com/users/matt-aitken/following{/other_user}", organizations_url: "https://api.github.com/users/matt-aitken/orgs", - subscriptions_url: - "https://api.github.com/users/matt-aitken/subscriptions", - received_events_url: - "https://api.github.com/users/matt-aitken/received_events", + subscriptions_url: "https://api.github.com/users/matt-aitken/subscriptions", + received_events_url: "https://api.github.com/users/matt-aitken/received_events", }, comments: 1, html_url: "https://github.com/triggerdotdev/empty/issues/4", @@ -75,20 +67,15 @@ export const issueAssigned: EventSpecificationExample = { gists_url: "https://api.github.com/users/matt-aitken/gists{/gist_id}", repos_url: "https://api.github.com/users/matt-aitken/repos", avatar_url: "https://avatars.githubusercontent.com/u/10635986?v=4", - events_url: - "https://api.github.com/users/matt-aitken/events{/privacy}", + events_url: "https://api.github.com/users/matt-aitken/events{/privacy}", site_admin: false, gravatar_id: "", - starred_url: - "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", + starred_url: "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", followers_url: "https://api.github.com/users/matt-aitken/followers", - following_url: - "https://api.github.com/users/matt-aitken/following{/other_user}", + following_url: "https://api.github.com/users/matt-aitken/following{/other_user}", organizations_url: "https://api.github.com/users/matt-aitken/orgs", - subscriptions_url: - "https://api.github.com/users/matt-aitken/subscriptions", - received_events_url: - "https://api.github.com/users/matt-aitken/received_events", + subscriptions_url: "https://api.github.com/users/matt-aitken/subscriptions", + received_events_url: "https://api.github.com/users/matt-aitken/received_events", }, ], closed_at: null, @@ -106,16 +93,12 @@ export const issueAssigned: EventSpecificationExample = { total_count: 0, }, created_at: "2023-06-21T15:24:20Z", - events_url: - "https://api.github.com/repos/triggerdotdev/empty/issues/4/events", - labels_url: - "https://api.github.com/repos/triggerdotdev/empty/issues/4/labels{/name}", + events_url: "https://api.github.com/repos/triggerdotdev/empty/issues/4/events", + labels_url: "https://api.github.com/repos/triggerdotdev/empty/issues/4/labels{/name}", updated_at: "2023-06-21T15:36:53Z", - comments_url: - "https://api.github.com/repos/triggerdotdev/empty/issues/4/comments", + comments_url: "https://api.github.com/repos/triggerdotdev/empty/issues/4/comments", state_reason: null, - timeline_url: - "https://api.github.com/repos/triggerdotdev/empty/issues/4/timeline", + timeline_url: "https://api.github.com/repos/triggerdotdev/empty/issues/4/timeline", repository_url: "https://api.github.com/repos/triggerdotdev/empty", active_lock_reason: null, author_association: "MEMBER", @@ -135,16 +118,12 @@ export const issueAssigned: EventSpecificationExample = { events_url: "https://api.github.com/users/matt-aitken/events{/privacy}", site_admin: false, gravatar_id: "", - starred_url: - "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", + starred_url: "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", followers_url: "https://api.github.com/users/matt-aitken/followers", - following_url: - "https://api.github.com/users/matt-aitken/following{/other_user}", + following_url: "https://api.github.com/users/matt-aitken/following{/other_user}", organizations_url: "https://api.github.com/users/matt-aitken/orgs", - subscriptions_url: - "https://api.github.com/users/matt-aitken/subscriptions", - received_events_url: - "https://api.github.com/users/matt-aitken/received_events", + subscriptions_url: "https://api.github.com/users/matt-aitken/subscriptions", + received_events_url: "https://api.github.com/users/matt-aitken/received_events", }, assignee: { id: 10635986, @@ -159,16 +138,12 @@ export const issueAssigned: EventSpecificationExample = { events_url: "https://api.github.com/users/matt-aitken/events{/privacy}", site_admin: false, gravatar_id: "", - starred_url: - "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", + starred_url: "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", followers_url: "https://api.github.com/users/matt-aitken/followers", - following_url: - "https://api.github.com/users/matt-aitken/following{/other_user}", + following_url: "https://api.github.com/users/matt-aitken/following{/other_user}", organizations_url: "https://api.github.com/users/matt-aitken/orgs", - subscriptions_url: - "https://api.github.com/users/matt-aitken/subscriptions", - received_events_url: - "https://api.github.com/users/matt-aitken/received_events", + subscriptions_url: "https://api.github.com/users/matt-aitken/subscriptions", + received_events_url: "https://api.github.com/users/matt-aitken/received_events", }, repository: { id: 656732269, @@ -187,20 +162,15 @@ export const issueAssigned: EventSpecificationExample = { gists_url: "https://api.github.com/users/triggerdotdev/gists{/gist_id}", repos_url: "https://api.github.com/users/triggerdotdev/repos", avatar_url: "https://avatars.githubusercontent.com/u/95297378?v=4", - events_url: - "https://api.github.com/users/triggerdotdev/events{/privacy}", + events_url: "https://api.github.com/users/triggerdotdev/events{/privacy}", site_admin: false, gravatar_id: "", - starred_url: - "https://api.github.com/users/triggerdotdev/starred{/owner}{/repo}", + starred_url: "https://api.github.com/users/triggerdotdev/starred{/owner}{/repo}", followers_url: "https://api.github.com/users/triggerdotdev/followers", - following_url: - "https://api.github.com/users/triggerdotdev/following{/other_user}", + following_url: "https://api.github.com/users/triggerdotdev/following{/other_user}", organizations_url: "https://api.github.com/users/triggerdotdev/orgs", - subscriptions_url: - "https://api.github.com/users/triggerdotdev/subscriptions", - received_events_url: - "https://api.github.com/users/triggerdotdev/received_events", + subscriptions_url: "https://api.github.com/users/triggerdotdev/subscriptions", + received_events_url: "https://api.github.com/users/triggerdotdev/received_events", }, topics: [], git_url: "git://github.com/triggerdotdev/empty.git", @@ -214,89 +184,61 @@ export const issueAssigned: EventSpecificationExample = { has_wiki: true, homepage: null, html_url: "https://github.com/triggerdotdev/empty", - keys_url: - "https://api.github.com/repos/triggerdotdev/empty/keys{/key_id}", + keys_url: "https://api.github.com/repos/triggerdotdev/empty/keys{/key_id}", language: null, tags_url: "https://api.github.com/repos/triggerdotdev/empty/tags", watchers: 0, - blobs_url: - "https://api.github.com/repos/triggerdotdev/empty/git/blobs{/sha}", + blobs_url: "https://api.github.com/repos/triggerdotdev/empty/git/blobs{/sha}", clone_url: "https://github.com/triggerdotdev/empty.git", forks_url: "https://api.github.com/repos/triggerdotdev/empty/forks", full_name: "triggerdotdev/empty", has_pages: false, hooks_url: "https://api.github.com/repos/triggerdotdev/empty/hooks", - pulls_url: - "https://api.github.com/repos/triggerdotdev/empty/pulls{/number}", + pulls_url: "https://api.github.com/repos/triggerdotdev/empty/pulls{/number}", pushed_at: "2023-06-21T14:21:08Z", teams_url: "https://api.github.com/repos/triggerdotdev/empty/teams", - trees_url: - "https://api.github.com/repos/triggerdotdev/empty/git/trees{/sha}", + trees_url: "https://api.github.com/repos/triggerdotdev/empty/git/trees{/sha}", created_at: "2023-06-21T14:21:07Z", events_url: "https://api.github.com/repos/triggerdotdev/empty/events", has_issues: true, - issues_url: - "https://api.github.com/repos/triggerdotdev/empty/issues{/number}", - labels_url: - "https://api.github.com/repos/triggerdotdev/empty/labels{/name}", + issues_url: "https://api.github.com/repos/triggerdotdev/empty/issues{/number}", + labels_url: "https://api.github.com/repos/triggerdotdev/empty/labels{/name}", merges_url: "https://api.github.com/repos/triggerdotdev/empty/merges", mirror_url: null, updated_at: "2023-06-21T14:21:08Z", visibility: "public", - archive_url: - "https://api.github.com/repos/triggerdotdev/empty/{archive_format}{/ref}", - commits_url: - "https://api.github.com/repos/triggerdotdev/empty/commits{/sha}", - compare_url: - "https://api.github.com/repos/triggerdotdev/empty/compare/{base}...{head}", - description: - "An empty repo that can be used to test the @trigger.dev/github integration", + archive_url: "https://api.github.com/repos/triggerdotdev/empty/{archive_format}{/ref}", + commits_url: "https://api.github.com/repos/triggerdotdev/empty/commits{/sha}", + compare_url: "https://api.github.com/repos/triggerdotdev/empty/compare/{base}...{head}", + description: "An empty repo that can be used to test the @trigger.dev/github integration", forks_count: 0, is_template: false, open_issues: 4, - branches_url: - "https://api.github.com/repos/triggerdotdev/empty/branches{/branch}", - comments_url: - "https://api.github.com/repos/triggerdotdev/empty/comments{/number}", - contents_url: - "https://api.github.com/repos/triggerdotdev/empty/contents/{+path}", - git_refs_url: - "https://api.github.com/repos/triggerdotdev/empty/git/refs{/sha}", - git_tags_url: - "https://api.github.com/repos/triggerdotdev/empty/git/tags{/sha}", + branches_url: "https://api.github.com/repos/triggerdotdev/empty/branches{/branch}", + comments_url: "https://api.github.com/repos/triggerdotdev/empty/comments{/number}", + contents_url: "https://api.github.com/repos/triggerdotdev/empty/contents/{+path}", + git_refs_url: "https://api.github.com/repos/triggerdotdev/empty/git/refs{/sha}", + git_tags_url: "https://api.github.com/repos/triggerdotdev/empty/git/tags{/sha}", has_projects: true, - releases_url: - "https://api.github.com/repos/triggerdotdev/empty/releases{/id}", - statuses_url: - "https://api.github.com/repos/triggerdotdev/empty/statuses/{sha}", + releases_url: "https://api.github.com/repos/triggerdotdev/empty/releases{/id}", + statuses_url: "https://api.github.com/repos/triggerdotdev/empty/statuses/{sha}", allow_forking: true, - assignees_url: - "https://api.github.com/repos/triggerdotdev/empty/assignees{/user}", - downloads_url: - "https://api.github.com/repos/triggerdotdev/empty/downloads", + assignees_url: "https://api.github.com/repos/triggerdotdev/empty/assignees{/user}", + downloads_url: "https://api.github.com/repos/triggerdotdev/empty/downloads", has_downloads: true, - languages_url: - "https://api.github.com/repos/triggerdotdev/empty/languages", + languages_url: "https://api.github.com/repos/triggerdotdev/empty/languages", default_branch: "main", - milestones_url: - "https://api.github.com/repos/triggerdotdev/empty/milestones{/number}", - stargazers_url: - "https://api.github.com/repos/triggerdotdev/empty/stargazers", + milestones_url: "https://api.github.com/repos/triggerdotdev/empty/milestones{/number}", + stargazers_url: "https://api.github.com/repos/triggerdotdev/empty/stargazers", watchers_count: 0, - deployments_url: - "https://api.github.com/repos/triggerdotdev/empty/deployments", - git_commits_url: - "https://api.github.com/repos/triggerdotdev/empty/git/commits{/sha}", + deployments_url: "https://api.github.com/repos/triggerdotdev/empty/deployments", + git_commits_url: "https://api.github.com/repos/triggerdotdev/empty/git/commits{/sha}", has_discussions: false, - subscribers_url: - "https://api.github.com/repos/triggerdotdev/empty/subscribers", - contributors_url: - "https://api.github.com/repos/triggerdotdev/empty/contributors", - issue_events_url: - "https://api.github.com/repos/triggerdotdev/empty/issues/events{/number}", + subscribers_url: "https://api.github.com/repos/triggerdotdev/empty/subscribers", + contributors_url: "https://api.github.com/repos/triggerdotdev/empty/contributors", + issue_events_url: "https://api.github.com/repos/triggerdotdev/empty/issues/events{/number}", stargazers_count: 0, - subscription_url: - "https://api.github.com/repos/triggerdotdev/empty/subscription", + subscription_url: "https://api.github.com/repos/triggerdotdev/empty/subscription", collaborators_url: "https://api.github.com/repos/triggerdotdev/empty/collaborators{/collaborator}", issue_comment_url: @@ -318,8 +260,7 @@ export const issueAssigned: EventSpecificationExample = { issues_url: "https://api.github.com/orgs/triggerdotdev/issues", description: "", members_url: "https://api.github.com/orgs/triggerdotdev/members{/member}", - public_members_url: - "https://api.github.com/orgs/triggerdotdev/public_members{/member}", + public_members_url: "https://api.github.com/orgs/triggerdotdev/public_members{/member}", }, }, }; @@ -345,16 +286,12 @@ export const issueOpened: EventSpecificationExample = { events_url: "https://api.github.com/users/matt-aitken/events{/privacy}", site_admin: false, gravatar_id: "", - starred_url: - "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", + starred_url: "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", followers_url: "https://api.github.com/users/matt-aitken/followers", - following_url: - "https://api.github.com/users/matt-aitken/following{/other_user}", + following_url: "https://api.github.com/users/matt-aitken/following{/other_user}", organizations_url: "https://api.github.com/users/matt-aitken/orgs", - subscriptions_url: - "https://api.github.com/users/matt-aitken/subscriptions", - received_events_url: - "https://api.github.com/users/matt-aitken/received_events", + subscriptions_url: "https://api.github.com/users/matt-aitken/subscriptions", + received_events_url: "https://api.github.com/users/matt-aitken/received_events", }, state: "open", title: "This is a sample issue title #20", @@ -381,18 +318,14 @@ export const issueOpened: EventSpecificationExample = { total_count: 0, }, created_at: "2023-06-13T09:42:02Z", - events_url: - "https://api.github.com/repos/ericallam/basic-starter-12k/issues/21/events", + events_url: "https://api.github.com/repos/ericallam/basic-starter-12k/issues/21/events", labels_url: "https://api.github.com/repos/ericallam/basic-starter-12k/issues/21/labels{/name}", updated_at: "2023-06-13T09:42:02Z", - comments_url: - "https://api.github.com/repos/ericallam/basic-starter-12k/issues/21/comments", + comments_url: "https://api.github.com/repos/ericallam/basic-starter-12k/issues/21/comments", state_reason: null, - timeline_url: - "https://api.github.com/repos/ericallam/basic-starter-12k/issues/21/timeline", - repository_url: - "https://api.github.com/repos/ericallam/basic-starter-12k", + timeline_url: "https://api.github.com/repos/ericallam/basic-starter-12k/issues/21/timeline", + repository_url: "https://api.github.com/repos/ericallam/basic-starter-12k", active_lock_reason: null, author_association: "NONE", performed_via_github_app: null, @@ -411,16 +344,12 @@ export const issueOpened: EventSpecificationExample = { events_url: "https://api.github.com/users/matt-aitken/events{/privacy}", site_admin: false, gravatar_id: "", - starred_url: - "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", + starred_url: "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", followers_url: "https://api.github.com/users/matt-aitken/followers", - following_url: - "https://api.github.com/users/matt-aitken/following{/other_user}", + following_url: "https://api.github.com/users/matt-aitken/following{/other_user}", organizations_url: "https://api.github.com/users/matt-aitken/orgs", - subscriptions_url: - "https://api.github.com/users/matt-aitken/subscriptions", - received_events_url: - "https://api.github.com/users/matt-aitken/received_events", + subscriptions_url: "https://api.github.com/users/matt-aitken/subscriptions", + received_events_url: "https://api.github.com/users/matt-aitken/received_events", }, repository: { id: 602708245, @@ -442,16 +371,12 @@ export const issueOpened: EventSpecificationExample = { events_url: "https://api.github.com/users/ericallam/events{/privacy}", site_admin: false, gravatar_id: "", - starred_url: - "https://api.github.com/users/ericallam/starred{/owner}{/repo}", + starred_url: "https://api.github.com/users/ericallam/starred{/owner}{/repo}", followers_url: "https://api.github.com/users/ericallam/followers", - following_url: - "https://api.github.com/users/ericallam/following{/other_user}", + following_url: "https://api.github.com/users/ericallam/following{/other_user}", organizations_url: "https://api.github.com/users/ericallam/orgs", - subscriptions_url: - "https://api.github.com/users/ericallam/subscriptions", - received_events_url: - "https://api.github.com/users/ericallam/received_events", + subscriptions_url: "https://api.github.com/users/ericallam/subscriptions", + received_events_url: "https://api.github.com/users/ericallam/received_events", }, topics: [], git_url: "git://github.com/ericallam/basic-starter-12k.git", @@ -465,93 +390,65 @@ export const issueOpened: EventSpecificationExample = { has_wiki: true, homepage: null, html_url: "https://github.com/ericallam/basic-starter-12k", - keys_url: - "https://api.github.com/repos/ericallam/basic-starter-12k/keys{/key_id}", + keys_url: "https://api.github.com/repos/ericallam/basic-starter-12k/keys{/key_id}", language: null, tags_url: "https://api.github.com/repos/ericallam/basic-starter-12k/tags", watchers: 0, - blobs_url: - "https://api.github.com/repos/ericallam/basic-starter-12k/git/blobs{/sha}", + blobs_url: "https://api.github.com/repos/ericallam/basic-starter-12k/git/blobs{/sha}", clone_url: "https://github.com/ericallam/basic-starter-12k.git", - forks_url: - "https://api.github.com/repos/ericallam/basic-starter-12k/forks", + forks_url: "https://api.github.com/repos/ericallam/basic-starter-12k/forks", full_name: "ericallam/basic-starter-12k", has_pages: false, - hooks_url: - "https://api.github.com/repos/ericallam/basic-starter-12k/hooks", - pulls_url: - "https://api.github.com/repos/ericallam/basic-starter-12k/pulls{/number}", + hooks_url: "https://api.github.com/repos/ericallam/basic-starter-12k/hooks", + pulls_url: "https://api.github.com/repos/ericallam/basic-starter-12k/pulls{/number}", pushed_at: "2023-02-16T19:25:20Z", - teams_url: - "https://api.github.com/repos/ericallam/basic-starter-12k/teams", - trees_url: - "https://api.github.com/repos/ericallam/basic-starter-12k/git/trees{/sha}", + teams_url: "https://api.github.com/repos/ericallam/basic-starter-12k/teams", + trees_url: "https://api.github.com/repos/ericallam/basic-starter-12k/git/trees{/sha}", created_at: "2023-02-16T19:25:19Z", - events_url: - "https://api.github.com/repos/ericallam/basic-starter-12k/events", + events_url: "https://api.github.com/repos/ericallam/basic-starter-12k/events", has_issues: true, - issues_url: - "https://api.github.com/repos/ericallam/basic-starter-12k/issues{/number}", - labels_url: - "https://api.github.com/repos/ericallam/basic-starter-12k/labels{/name}", - merges_url: - "https://api.github.com/repos/ericallam/basic-starter-12k/merges", + issues_url: "https://api.github.com/repos/ericallam/basic-starter-12k/issues{/number}", + labels_url: "https://api.github.com/repos/ericallam/basic-starter-12k/labels{/name}", + merges_url: "https://api.github.com/repos/ericallam/basic-starter-12k/merges", mirror_url: null, updated_at: "2023-02-16T19:25:19Z", visibility: "public", archive_url: "https://api.github.com/repos/ericallam/basic-starter-12k/{archive_format}{/ref}", - commits_url: - "https://api.github.com/repos/ericallam/basic-starter-12k/commits{/sha}", + commits_url: "https://api.github.com/repos/ericallam/basic-starter-12k/commits{/sha}", compare_url: "https://api.github.com/repos/ericallam/basic-starter-12k/compare/{base}...{head}", description: null, forks_count: 0, is_template: false, open_issues: 21, - branches_url: - "https://api.github.com/repos/ericallam/basic-starter-12k/branches{/branch}", - comments_url: - "https://api.github.com/repos/ericallam/basic-starter-12k/comments{/number}", - contents_url: - "https://api.github.com/repos/ericallam/basic-starter-12k/contents/{+path}", - git_refs_url: - "https://api.github.com/repos/ericallam/basic-starter-12k/git/refs{/sha}", - git_tags_url: - "https://api.github.com/repos/ericallam/basic-starter-12k/git/tags{/sha}", + branches_url: "https://api.github.com/repos/ericallam/basic-starter-12k/branches{/branch}", + comments_url: "https://api.github.com/repos/ericallam/basic-starter-12k/comments{/number}", + contents_url: "https://api.github.com/repos/ericallam/basic-starter-12k/contents/{+path}", + git_refs_url: "https://api.github.com/repos/ericallam/basic-starter-12k/git/refs{/sha}", + git_tags_url: "https://api.github.com/repos/ericallam/basic-starter-12k/git/tags{/sha}", has_projects: true, - releases_url: - "https://api.github.com/repos/ericallam/basic-starter-12k/releases{/id}", - statuses_url: - "https://api.github.com/repos/ericallam/basic-starter-12k/statuses/{sha}", + releases_url: "https://api.github.com/repos/ericallam/basic-starter-12k/releases{/id}", + statuses_url: "https://api.github.com/repos/ericallam/basic-starter-12k/statuses/{sha}", allow_forking: true, - assignees_url: - "https://api.github.com/repos/ericallam/basic-starter-12k/assignees{/user}", - downloads_url: - "https://api.github.com/repos/ericallam/basic-starter-12k/downloads", + assignees_url: "https://api.github.com/repos/ericallam/basic-starter-12k/assignees{/user}", + downloads_url: "https://api.github.com/repos/ericallam/basic-starter-12k/downloads", has_downloads: true, - languages_url: - "https://api.github.com/repos/ericallam/basic-starter-12k/languages", + languages_url: "https://api.github.com/repos/ericallam/basic-starter-12k/languages", default_branch: "main", milestones_url: "https://api.github.com/repos/ericallam/basic-starter-12k/milestones{/number}", - stargazers_url: - "https://api.github.com/repos/ericallam/basic-starter-12k/stargazers", + stargazers_url: "https://api.github.com/repos/ericallam/basic-starter-12k/stargazers", watchers_count: 0, - deployments_url: - "https://api.github.com/repos/ericallam/basic-starter-12k/deployments", - git_commits_url: - "https://api.github.com/repos/ericallam/basic-starter-12k/git/commits{/sha}", + deployments_url: "https://api.github.com/repos/ericallam/basic-starter-12k/deployments", + git_commits_url: "https://api.github.com/repos/ericallam/basic-starter-12k/git/commits{/sha}", has_discussions: false, - subscribers_url: - "https://api.github.com/repos/ericallam/basic-starter-12k/subscribers", - contributors_url: - "https://api.github.com/repos/ericallam/basic-starter-12k/contributors", + subscribers_url: "https://api.github.com/repos/ericallam/basic-starter-12k/subscribers", + contributors_url: "https://api.github.com/repos/ericallam/basic-starter-12k/contributors", issue_events_url: "https://api.github.com/repos/ericallam/basic-starter-12k/issues/events{/number}", stargazers_count: 0, - subscription_url: - "https://api.github.com/repos/ericallam/basic-starter-12k/subscription", + subscription_url: "https://api.github.com/repos/ericallam/basic-starter-12k/subscription", collaborators_url: "https://api.github.com/repos/ericallam/basic-starter-12k/collaborators{/collaborator}", issue_comment_url: @@ -585,16 +482,12 @@ export const issueCommentCreated: EventSpecificationExample = { events_url: "https://api.github.com/users/matt-aitken/events{/privacy}", site_admin: false, gravatar_id: "", - starred_url: - "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", + starred_url: "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", followers_url: "https://api.github.com/users/matt-aitken/followers", - following_url: - "https://api.github.com/users/matt-aitken/following{/other_user}", + following_url: "https://api.github.com/users/matt-aitken/following{/other_user}", organizations_url: "https://api.github.com/users/matt-aitken/orgs", - subscriptions_url: - "https://api.github.com/users/matt-aitken/subscriptions", - received_events_url: - "https://api.github.com/users/matt-aitken/received_events", + subscriptions_url: "https://api.github.com/users/matt-aitken/subscriptions", + received_events_url: "https://api.github.com/users/matt-aitken/received_events", }, state: "open", title: "Fourth time lucky?", @@ -615,16 +508,12 @@ export const issueCommentCreated: EventSpecificationExample = { events_url: "https://api.github.com/users/matt-aitken/events{/privacy}", site_admin: false, gravatar_id: "", - starred_url: - "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", + starred_url: "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", followers_url: "https://api.github.com/users/matt-aitken/followers", - following_url: - "https://api.github.com/users/matt-aitken/following{/other_user}", + following_url: "https://api.github.com/users/matt-aitken/following{/other_user}", organizations_url: "https://api.github.com/users/matt-aitken/orgs", - subscriptions_url: - "https://api.github.com/users/matt-aitken/subscriptions", - received_events_url: - "https://api.github.com/users/matt-aitken/received_events", + subscriptions_url: "https://api.github.com/users/matt-aitken/subscriptions", + received_events_url: "https://api.github.com/users/matt-aitken/received_events", }, comments: 2, html_url: "https://github.com/triggerdotdev/empty/issues/4", @@ -639,20 +528,15 @@ export const issueCommentCreated: EventSpecificationExample = { gists_url: "https://api.github.com/users/matt-aitken/gists{/gist_id}", repos_url: "https://api.github.com/users/matt-aitken/repos", avatar_url: "https://avatars.githubusercontent.com/u/10635986?v=4", - events_url: - "https://api.github.com/users/matt-aitken/events{/privacy}", + events_url: "https://api.github.com/users/matt-aitken/events{/privacy}", site_admin: false, gravatar_id: "", - starred_url: - "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", + starred_url: "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", followers_url: "https://api.github.com/users/matt-aitken/followers", - following_url: - "https://api.github.com/users/matt-aitken/following{/other_user}", + following_url: "https://api.github.com/users/matt-aitken/following{/other_user}", organizations_url: "https://api.github.com/users/matt-aitken/orgs", - subscriptions_url: - "https://api.github.com/users/matt-aitken/subscriptions", - received_events_url: - "https://api.github.com/users/matt-aitken/received_events", + subscriptions_url: "https://api.github.com/users/matt-aitken/subscriptions", + received_events_url: "https://api.github.com/users/matt-aitken/received_events", }, ], closed_at: null, @@ -670,16 +554,12 @@ export const issueCommentCreated: EventSpecificationExample = { total_count: 0, }, created_at: "2023-06-21T15:24:20Z", - events_url: - "https://api.github.com/repos/triggerdotdev/empty/issues/4/events", - labels_url: - "https://api.github.com/repos/triggerdotdev/empty/issues/4/labels{/name}", + events_url: "https://api.github.com/repos/triggerdotdev/empty/issues/4/events", + labels_url: "https://api.github.com/repos/triggerdotdev/empty/issues/4/labels{/name}", updated_at: "2023-06-21T16:02:28Z", - comments_url: - "https://api.github.com/repos/triggerdotdev/empty/issues/4/comments", + comments_url: "https://api.github.com/repos/triggerdotdev/empty/issues/4/comments", state_reason: null, - timeline_url: - "https://api.github.com/repos/triggerdotdev/empty/issues/4/timeline", + timeline_url: "https://api.github.com/repos/triggerdotdev/empty/issues/4/timeline", repository_url: "https://api.github.com/repos/triggerdotdev/empty", active_lock_reason: null, author_association: "MEMBER", @@ -699,16 +579,12 @@ export const issueCommentCreated: EventSpecificationExample = { events_url: "https://api.github.com/users/matt-aitken/events{/privacy}", site_admin: false, gravatar_id: "", - starred_url: - "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", + starred_url: "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", followers_url: "https://api.github.com/users/matt-aitken/followers", - following_url: - "https://api.github.com/users/matt-aitken/following{/other_user}", + following_url: "https://api.github.com/users/matt-aitken/following{/other_user}", organizations_url: "https://api.github.com/users/matt-aitken/orgs", - subscriptions_url: - "https://api.github.com/users/matt-aitken/subscriptions", - received_events_url: - "https://api.github.com/users/matt-aitken/received_events", + subscriptions_url: "https://api.github.com/users/matt-aitken/subscriptions", + received_events_url: "https://api.github.com/users/matt-aitken/received_events", }, comment: { id: 1601114728, @@ -727,20 +603,15 @@ export const issueCommentCreated: EventSpecificationExample = { events_url: "https://api.github.com/users/matt-aitken/events{/privacy}", site_admin: false, gravatar_id: "", - starred_url: - "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", + starred_url: "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", followers_url: "https://api.github.com/users/matt-aitken/followers", - following_url: - "https://api.github.com/users/matt-aitken/following{/other_user}", + following_url: "https://api.github.com/users/matt-aitken/following{/other_user}", organizations_url: "https://api.github.com/users/matt-aitken/orgs", - subscriptions_url: - "https://api.github.com/users/matt-aitken/subscriptions", - received_events_url: - "https://api.github.com/users/matt-aitken/received_events", + subscriptions_url: "https://api.github.com/users/matt-aitken/subscriptions", + received_events_url: "https://api.github.com/users/matt-aitken/received_events", }, node_id: "IC_kwDOJyTwbc5fbxJo", - html_url: - "https://github.com/triggerdotdev/empty/issues/4#issuecomment-1601114728", + html_url: "https://github.com/triggerdotdev/empty/issues/4#issuecomment-1601114728", issue_url: "https://api.github.com/repos/triggerdotdev/empty/issues/4", reactions: { "+1": 0, @@ -776,20 +647,15 @@ export const issueCommentCreated: EventSpecificationExample = { gists_url: "https://api.github.com/users/triggerdotdev/gists{/gist_id}", repos_url: "https://api.github.com/users/triggerdotdev/repos", avatar_url: "https://avatars.githubusercontent.com/u/95297378?v=4", - events_url: - "https://api.github.com/users/triggerdotdev/events{/privacy}", + events_url: "https://api.github.com/users/triggerdotdev/events{/privacy}", site_admin: false, gravatar_id: "", - starred_url: - "https://api.github.com/users/triggerdotdev/starred{/owner}{/repo}", + starred_url: "https://api.github.com/users/triggerdotdev/starred{/owner}{/repo}", followers_url: "https://api.github.com/users/triggerdotdev/followers", - following_url: - "https://api.github.com/users/triggerdotdev/following{/other_user}", + following_url: "https://api.github.com/users/triggerdotdev/following{/other_user}", organizations_url: "https://api.github.com/users/triggerdotdev/orgs", - subscriptions_url: - "https://api.github.com/users/triggerdotdev/subscriptions", - received_events_url: - "https://api.github.com/users/triggerdotdev/received_events", + subscriptions_url: "https://api.github.com/users/triggerdotdev/subscriptions", + received_events_url: "https://api.github.com/users/triggerdotdev/received_events", }, topics: [], git_url: "git://github.com/triggerdotdev/empty.git", @@ -803,89 +669,61 @@ export const issueCommentCreated: EventSpecificationExample = { has_wiki: true, homepage: null, html_url: "https://github.com/triggerdotdev/empty", - keys_url: - "https://api.github.com/repos/triggerdotdev/empty/keys{/key_id}", + keys_url: "https://api.github.com/repos/triggerdotdev/empty/keys{/key_id}", language: null, tags_url: "https://api.github.com/repos/triggerdotdev/empty/tags", watchers: 0, - blobs_url: - "https://api.github.com/repos/triggerdotdev/empty/git/blobs{/sha}", + blobs_url: "https://api.github.com/repos/triggerdotdev/empty/git/blobs{/sha}", clone_url: "https://github.com/triggerdotdev/empty.git", forks_url: "https://api.github.com/repos/triggerdotdev/empty/forks", full_name: "triggerdotdev/empty", has_pages: false, hooks_url: "https://api.github.com/repos/triggerdotdev/empty/hooks", - pulls_url: - "https://api.github.com/repos/triggerdotdev/empty/pulls{/number}", + pulls_url: "https://api.github.com/repos/triggerdotdev/empty/pulls{/number}", pushed_at: "2023-06-21T14:21:08Z", teams_url: "https://api.github.com/repos/triggerdotdev/empty/teams", - trees_url: - "https://api.github.com/repos/triggerdotdev/empty/git/trees{/sha}", + trees_url: "https://api.github.com/repos/triggerdotdev/empty/git/trees{/sha}", created_at: "2023-06-21T14:21:07Z", events_url: "https://api.github.com/repos/triggerdotdev/empty/events", has_issues: true, - issues_url: - "https://api.github.com/repos/triggerdotdev/empty/issues{/number}", - labels_url: - "https://api.github.com/repos/triggerdotdev/empty/labels{/name}", + issues_url: "https://api.github.com/repos/triggerdotdev/empty/issues{/number}", + labels_url: "https://api.github.com/repos/triggerdotdev/empty/labels{/name}", merges_url: "https://api.github.com/repos/triggerdotdev/empty/merges", mirror_url: null, updated_at: "2023-06-21T14:21:08Z", visibility: "public", - archive_url: - "https://api.github.com/repos/triggerdotdev/empty/{archive_format}{/ref}", - commits_url: - "https://api.github.com/repos/triggerdotdev/empty/commits{/sha}", - compare_url: - "https://api.github.com/repos/triggerdotdev/empty/compare/{base}...{head}", - description: - "An empty repo that can be used to test the @trigger.dev/github integration", + archive_url: "https://api.github.com/repos/triggerdotdev/empty/{archive_format}{/ref}", + commits_url: "https://api.github.com/repos/triggerdotdev/empty/commits{/sha}", + compare_url: "https://api.github.com/repos/triggerdotdev/empty/compare/{base}...{head}", + description: "An empty repo that can be used to test the @trigger.dev/github integration", forks_count: 0, is_template: false, open_issues: 4, - branches_url: - "https://api.github.com/repos/triggerdotdev/empty/branches{/branch}", - comments_url: - "https://api.github.com/repos/triggerdotdev/empty/comments{/number}", - contents_url: - "https://api.github.com/repos/triggerdotdev/empty/contents/{+path}", - git_refs_url: - "https://api.github.com/repos/triggerdotdev/empty/git/refs{/sha}", - git_tags_url: - "https://api.github.com/repos/triggerdotdev/empty/git/tags{/sha}", + branches_url: "https://api.github.com/repos/triggerdotdev/empty/branches{/branch}", + comments_url: "https://api.github.com/repos/triggerdotdev/empty/comments{/number}", + contents_url: "https://api.github.com/repos/triggerdotdev/empty/contents/{+path}", + git_refs_url: "https://api.github.com/repos/triggerdotdev/empty/git/refs{/sha}", + git_tags_url: "https://api.github.com/repos/triggerdotdev/empty/git/tags{/sha}", has_projects: true, - releases_url: - "https://api.github.com/repos/triggerdotdev/empty/releases{/id}", - statuses_url: - "https://api.github.com/repos/triggerdotdev/empty/statuses/{sha}", + releases_url: "https://api.github.com/repos/triggerdotdev/empty/releases{/id}", + statuses_url: "https://api.github.com/repos/triggerdotdev/empty/statuses/{sha}", allow_forking: true, - assignees_url: - "https://api.github.com/repos/triggerdotdev/empty/assignees{/user}", - downloads_url: - "https://api.github.com/repos/triggerdotdev/empty/downloads", + assignees_url: "https://api.github.com/repos/triggerdotdev/empty/assignees{/user}", + downloads_url: "https://api.github.com/repos/triggerdotdev/empty/downloads", has_downloads: true, - languages_url: - "https://api.github.com/repos/triggerdotdev/empty/languages", + languages_url: "https://api.github.com/repos/triggerdotdev/empty/languages", default_branch: "main", - milestones_url: - "https://api.github.com/repos/triggerdotdev/empty/milestones{/number}", - stargazers_url: - "https://api.github.com/repos/triggerdotdev/empty/stargazers", + milestones_url: "https://api.github.com/repos/triggerdotdev/empty/milestones{/number}", + stargazers_url: "https://api.github.com/repos/triggerdotdev/empty/stargazers", watchers_count: 0, - deployments_url: - "https://api.github.com/repos/triggerdotdev/empty/deployments", - git_commits_url: - "https://api.github.com/repos/triggerdotdev/empty/git/commits{/sha}", + deployments_url: "https://api.github.com/repos/triggerdotdev/empty/deployments", + git_commits_url: "https://api.github.com/repos/triggerdotdev/empty/git/commits{/sha}", has_discussions: false, - subscribers_url: - "https://api.github.com/repos/triggerdotdev/empty/subscribers", - contributors_url: - "https://api.github.com/repos/triggerdotdev/empty/contributors", - issue_events_url: - "https://api.github.com/repos/triggerdotdev/empty/issues/events{/number}", + subscribers_url: "https://api.github.com/repos/triggerdotdev/empty/subscribers", + contributors_url: "https://api.github.com/repos/triggerdotdev/empty/contributors", + issue_events_url: "https://api.github.com/repos/triggerdotdev/empty/issues/events{/number}", stargazers_count: 0, - subscription_url: - "https://api.github.com/repos/triggerdotdev/empty/subscription", + subscription_url: "https://api.github.com/repos/triggerdotdev/empty/subscription", collaborators_url: "https://api.github.com/repos/triggerdotdev/empty/collaborators{/collaborator}", issue_comment_url: @@ -907,8 +745,7 @@ export const issueCommentCreated: EventSpecificationExample = { issues_url: "https://api.github.com/orgs/triggerdotdev/issues", description: "", members_url: "https://api.github.com/orgs/triggerdotdev/members{/member}", - public_members_url: - "https://api.github.com/orgs/triggerdotdev/public_members{/member}", + public_members_url: "https://api.github.com/orgs/triggerdotdev/public_members{/member}", }, }, }; @@ -931,16 +768,12 @@ export const starredRepo: EventSpecificationExample = { events_url: "https://api.github.com/users/matt-aitken/events{/privacy}", site_admin: false, gravatar_id: "", - starred_url: - "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", + starred_url: "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", followers_url: "https://api.github.com/users/matt-aitken/followers", - following_url: - "https://api.github.com/users/matt-aitken/following{/other_user}", + following_url: "https://api.github.com/users/matt-aitken/following{/other_user}", organizations_url: "https://api.github.com/users/matt-aitken/orgs", - subscriptions_url: - "https://api.github.com/users/matt-aitken/subscriptions", - received_events_url: - "https://api.github.com/users/matt-aitken/received_events", + subscriptions_url: "https://api.github.com/users/matt-aitken/subscriptions", + received_events_url: "https://api.github.com/users/matt-aitken/received_events", }, repository: { id: 656732269, @@ -959,20 +792,15 @@ export const starredRepo: EventSpecificationExample = { gists_url: "https://api.github.com/users/triggerdotdev/gists{/gist_id}", repos_url: "https://api.github.com/users/triggerdotdev/repos", avatar_url: "https://avatars.githubusercontent.com/u/95297378?v=4", - events_url: - "https://api.github.com/users/triggerdotdev/events{/privacy}", + events_url: "https://api.github.com/users/triggerdotdev/events{/privacy}", site_admin: false, gravatar_id: "", - starred_url: - "https://api.github.com/users/triggerdotdev/starred{/owner}{/repo}", + starred_url: "https://api.github.com/users/triggerdotdev/starred{/owner}{/repo}", followers_url: "https://api.github.com/users/triggerdotdev/followers", - following_url: - "https://api.github.com/users/triggerdotdev/following{/other_user}", + following_url: "https://api.github.com/users/triggerdotdev/following{/other_user}", organizations_url: "https://api.github.com/users/triggerdotdev/orgs", - subscriptions_url: - "https://api.github.com/users/triggerdotdev/subscriptions", - received_events_url: - "https://api.github.com/users/triggerdotdev/received_events", + subscriptions_url: "https://api.github.com/users/triggerdotdev/subscriptions", + received_events_url: "https://api.github.com/users/triggerdotdev/received_events", }, topics: [], git_url: "git://github.com/triggerdotdev/empty.git", @@ -986,89 +814,61 @@ export const starredRepo: EventSpecificationExample = { has_wiki: true, homepage: null, html_url: "https://github.com/triggerdotdev/empty", - keys_url: - "https://api.github.com/repos/triggerdotdev/empty/keys{/key_id}", + keys_url: "https://api.github.com/repos/triggerdotdev/empty/keys{/key_id}", language: null, tags_url: "https://api.github.com/repos/triggerdotdev/empty/tags", watchers: 1, - blobs_url: - "https://api.github.com/repos/triggerdotdev/empty/git/blobs{/sha}", + blobs_url: "https://api.github.com/repos/triggerdotdev/empty/git/blobs{/sha}", clone_url: "https://github.com/triggerdotdev/empty.git", forks_url: "https://api.github.com/repos/triggerdotdev/empty/forks", full_name: "triggerdotdev/empty", has_pages: false, hooks_url: "https://api.github.com/repos/triggerdotdev/empty/hooks", - pulls_url: - "https://api.github.com/repos/triggerdotdev/empty/pulls{/number}", + pulls_url: "https://api.github.com/repos/triggerdotdev/empty/pulls{/number}", pushed_at: "2023-06-21T14:21:08Z", teams_url: "https://api.github.com/repos/triggerdotdev/empty/teams", - trees_url: - "https://api.github.com/repos/triggerdotdev/empty/git/trees{/sha}", + trees_url: "https://api.github.com/repos/triggerdotdev/empty/git/trees{/sha}", created_at: "2023-06-21T14:21:07Z", events_url: "https://api.github.com/repos/triggerdotdev/empty/events", has_issues: true, - issues_url: - "https://api.github.com/repos/triggerdotdev/empty/issues{/number}", - labels_url: - "https://api.github.com/repos/triggerdotdev/empty/labels{/name}", + issues_url: "https://api.github.com/repos/triggerdotdev/empty/issues{/number}", + labels_url: "https://api.github.com/repos/triggerdotdev/empty/labels{/name}", merges_url: "https://api.github.com/repos/triggerdotdev/empty/merges", mirror_url: null, updated_at: "2023-06-21T17:22:03Z", visibility: "public", - archive_url: - "https://api.github.com/repos/triggerdotdev/empty/{archive_format}{/ref}", - commits_url: - "https://api.github.com/repos/triggerdotdev/empty/commits{/sha}", - compare_url: - "https://api.github.com/repos/triggerdotdev/empty/compare/{base}...{head}", - description: - "An empty repo that can be used to test the @trigger.dev/github integration", + archive_url: "https://api.github.com/repos/triggerdotdev/empty/{archive_format}{/ref}", + commits_url: "https://api.github.com/repos/triggerdotdev/empty/commits{/sha}", + compare_url: "https://api.github.com/repos/triggerdotdev/empty/compare/{base}...{head}", + description: "An empty repo that can be used to test the @trigger.dev/github integration", forks_count: 0, is_template: false, open_issues: 4, - branches_url: - "https://api.github.com/repos/triggerdotdev/empty/branches{/branch}", - comments_url: - "https://api.github.com/repos/triggerdotdev/empty/comments{/number}", - contents_url: - "https://api.github.com/repos/triggerdotdev/empty/contents/{+path}", - git_refs_url: - "https://api.github.com/repos/triggerdotdev/empty/git/refs{/sha}", - git_tags_url: - "https://api.github.com/repos/triggerdotdev/empty/git/tags{/sha}", + branches_url: "https://api.github.com/repos/triggerdotdev/empty/branches{/branch}", + comments_url: "https://api.github.com/repos/triggerdotdev/empty/comments{/number}", + contents_url: "https://api.github.com/repos/triggerdotdev/empty/contents/{+path}", + git_refs_url: "https://api.github.com/repos/triggerdotdev/empty/git/refs{/sha}", + git_tags_url: "https://api.github.com/repos/triggerdotdev/empty/git/tags{/sha}", has_projects: true, - releases_url: - "https://api.github.com/repos/triggerdotdev/empty/releases{/id}", - statuses_url: - "https://api.github.com/repos/triggerdotdev/empty/statuses/{sha}", + releases_url: "https://api.github.com/repos/triggerdotdev/empty/releases{/id}", + statuses_url: "https://api.github.com/repos/triggerdotdev/empty/statuses/{sha}", allow_forking: true, - assignees_url: - "https://api.github.com/repos/triggerdotdev/empty/assignees{/user}", - downloads_url: - "https://api.github.com/repos/triggerdotdev/empty/downloads", + assignees_url: "https://api.github.com/repos/triggerdotdev/empty/assignees{/user}", + downloads_url: "https://api.github.com/repos/triggerdotdev/empty/downloads", has_downloads: true, - languages_url: - "https://api.github.com/repos/triggerdotdev/empty/languages", + languages_url: "https://api.github.com/repos/triggerdotdev/empty/languages", default_branch: "main", - milestones_url: - "https://api.github.com/repos/triggerdotdev/empty/milestones{/number}", - stargazers_url: - "https://api.github.com/repos/triggerdotdev/empty/stargazers", + milestones_url: "https://api.github.com/repos/triggerdotdev/empty/milestones{/number}", + stargazers_url: "https://api.github.com/repos/triggerdotdev/empty/stargazers", watchers_count: 1, - deployments_url: - "https://api.github.com/repos/triggerdotdev/empty/deployments", - git_commits_url: - "https://api.github.com/repos/triggerdotdev/empty/git/commits{/sha}", + deployments_url: "https://api.github.com/repos/triggerdotdev/empty/deployments", + git_commits_url: "https://api.github.com/repos/triggerdotdev/empty/git/commits{/sha}", has_discussions: false, - subscribers_url: - "https://api.github.com/repos/triggerdotdev/empty/subscribers", - contributors_url: - "https://api.github.com/repos/triggerdotdev/empty/contributors", - issue_events_url: - "https://api.github.com/repos/triggerdotdev/empty/issues/events{/number}", + subscribers_url: "https://api.github.com/repos/triggerdotdev/empty/subscribers", + contributors_url: "https://api.github.com/repos/triggerdotdev/empty/contributors", + issue_events_url: "https://api.github.com/repos/triggerdotdev/empty/issues/events{/number}", stargazers_count: 1, - subscription_url: - "https://api.github.com/repos/triggerdotdev/empty/subscription", + subscription_url: "https://api.github.com/repos/triggerdotdev/empty/subscription", collaborators_url: "https://api.github.com/repos/triggerdotdev/empty/collaborators{/collaborator}", issue_comment_url: @@ -1091,8 +891,7 @@ export const starredRepo: EventSpecificationExample = { issues_url: "https://api.github.com/orgs/triggerdotdev/issues", description: "", members_url: "https://api.github.com/orgs/triggerdotdev/members{/member}", - public_members_url: - "https://api.github.com/orgs/triggerdotdev/public_members{/member}", + public_members_url: "https://api.github.com/orgs/triggerdotdev/public_members{/member}", }, }, }; @@ -1115,16 +914,12 @@ export const newBranch: EventSpecificationExample = { events_url: "https://api.github.com/users/matt-aitken/events{/privacy}", site_admin: false, gravatar_id: "", - starred_url: - "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", + starred_url: "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", followers_url: "https://api.github.com/users/matt-aitken/followers", - following_url: - "https://api.github.com/users/matt-aitken/following{/other_user}", + following_url: "https://api.github.com/users/matt-aitken/following{/other_user}", organizations_url: "https://api.github.com/users/matt-aitken/orgs", - subscriptions_url: - "https://api.github.com/users/matt-aitken/subscriptions", - received_events_url: - "https://api.github.com/users/matt-aitken/received_events", + subscriptions_url: "https://api.github.com/users/matt-aitken/subscriptions", + received_events_url: "https://api.github.com/users/matt-aitken/received_events", }, ref_type: "branch", repository: { @@ -1144,20 +939,15 @@ export const newBranch: EventSpecificationExample = { gists_url: "https://api.github.com/users/triggerdotdev/gists{/gist_id}", repos_url: "https://api.github.com/users/triggerdotdev/repos", avatar_url: "https://avatars.githubusercontent.com/u/95297378?v=4", - events_url: - "https://api.github.com/users/triggerdotdev/events{/privacy}", + events_url: "https://api.github.com/users/triggerdotdev/events{/privacy}", site_admin: false, gravatar_id: "", - starred_url: - "https://api.github.com/users/triggerdotdev/starred{/owner}{/repo}", + starred_url: "https://api.github.com/users/triggerdotdev/starred{/owner}{/repo}", followers_url: "https://api.github.com/users/triggerdotdev/followers", - following_url: - "https://api.github.com/users/triggerdotdev/following{/other_user}", + following_url: "https://api.github.com/users/triggerdotdev/following{/other_user}", organizations_url: "https://api.github.com/users/triggerdotdev/orgs", - subscriptions_url: - "https://api.github.com/users/triggerdotdev/subscriptions", - received_events_url: - "https://api.github.com/users/triggerdotdev/received_events", + subscriptions_url: "https://api.github.com/users/triggerdotdev/subscriptions", + received_events_url: "https://api.github.com/users/triggerdotdev/received_events", }, topics: [], git_url: "git://github.com/triggerdotdev/empty.git", @@ -1171,89 +961,61 @@ export const newBranch: EventSpecificationExample = { has_wiki: true, homepage: null, html_url: "https://github.com/triggerdotdev/empty", - keys_url: - "https://api.github.com/repos/triggerdotdev/empty/keys{/key_id}", + keys_url: "https://api.github.com/repos/triggerdotdev/empty/keys{/key_id}", language: null, tags_url: "https://api.github.com/repos/triggerdotdev/empty/tags", watchers: 0, - blobs_url: - "https://api.github.com/repos/triggerdotdev/empty/git/blobs{/sha}", + blobs_url: "https://api.github.com/repos/triggerdotdev/empty/git/blobs{/sha}", clone_url: "https://github.com/triggerdotdev/empty.git", forks_url: "https://api.github.com/repos/triggerdotdev/empty/forks", full_name: "triggerdotdev/empty", has_pages: false, hooks_url: "https://api.github.com/repos/triggerdotdev/empty/hooks", - pulls_url: - "https://api.github.com/repos/triggerdotdev/empty/pulls{/number}", + pulls_url: "https://api.github.com/repos/triggerdotdev/empty/pulls{/number}", pushed_at: "2023-06-21T17:54:25Z", teams_url: "https://api.github.com/repos/triggerdotdev/empty/teams", - trees_url: - "https://api.github.com/repos/triggerdotdev/empty/git/trees{/sha}", + trees_url: "https://api.github.com/repos/triggerdotdev/empty/git/trees{/sha}", created_at: "2023-06-21T14:21:07Z", events_url: "https://api.github.com/repos/triggerdotdev/empty/events", has_issues: true, - issues_url: - "https://api.github.com/repos/triggerdotdev/empty/issues{/number}", - labels_url: - "https://api.github.com/repos/triggerdotdev/empty/labels{/name}", + issues_url: "https://api.github.com/repos/triggerdotdev/empty/issues{/number}", + labels_url: "https://api.github.com/repos/triggerdotdev/empty/labels{/name}", merges_url: "https://api.github.com/repos/triggerdotdev/empty/merges", mirror_url: null, updated_at: "2023-06-21T17:23:26Z", visibility: "public", - archive_url: - "https://api.github.com/repos/triggerdotdev/empty/{archive_format}{/ref}", - commits_url: - "https://api.github.com/repos/triggerdotdev/empty/commits{/sha}", - compare_url: - "https://api.github.com/repos/triggerdotdev/empty/compare/{base}...{head}", - description: - "An empty repo that can be used to test the @trigger.dev/github integration", + archive_url: "https://api.github.com/repos/triggerdotdev/empty/{archive_format}{/ref}", + commits_url: "https://api.github.com/repos/triggerdotdev/empty/commits{/sha}", + compare_url: "https://api.github.com/repos/triggerdotdev/empty/compare/{base}...{head}", + description: "An empty repo that can be used to test the @trigger.dev/github integration", forks_count: 0, is_template: false, open_issues: 4, - branches_url: - "https://api.github.com/repos/triggerdotdev/empty/branches{/branch}", - comments_url: - "https://api.github.com/repos/triggerdotdev/empty/comments{/number}", - contents_url: - "https://api.github.com/repos/triggerdotdev/empty/contents/{+path}", - git_refs_url: - "https://api.github.com/repos/triggerdotdev/empty/git/refs{/sha}", - git_tags_url: - "https://api.github.com/repos/triggerdotdev/empty/git/tags{/sha}", + branches_url: "https://api.github.com/repos/triggerdotdev/empty/branches{/branch}", + comments_url: "https://api.github.com/repos/triggerdotdev/empty/comments{/number}", + contents_url: "https://api.github.com/repos/triggerdotdev/empty/contents/{+path}", + git_refs_url: "https://api.github.com/repos/triggerdotdev/empty/git/refs{/sha}", + git_tags_url: "https://api.github.com/repos/triggerdotdev/empty/git/tags{/sha}", has_projects: true, - releases_url: - "https://api.github.com/repos/triggerdotdev/empty/releases{/id}", - statuses_url: - "https://api.github.com/repos/triggerdotdev/empty/statuses/{sha}", + releases_url: "https://api.github.com/repos/triggerdotdev/empty/releases{/id}", + statuses_url: "https://api.github.com/repos/triggerdotdev/empty/statuses/{sha}", allow_forking: true, - assignees_url: - "https://api.github.com/repos/triggerdotdev/empty/assignees{/user}", - downloads_url: - "https://api.github.com/repos/triggerdotdev/empty/downloads", + assignees_url: "https://api.github.com/repos/triggerdotdev/empty/assignees{/user}", + downloads_url: "https://api.github.com/repos/triggerdotdev/empty/downloads", has_downloads: true, - languages_url: - "https://api.github.com/repos/triggerdotdev/empty/languages", + languages_url: "https://api.github.com/repos/triggerdotdev/empty/languages", default_branch: "main", - milestones_url: - "https://api.github.com/repos/triggerdotdev/empty/milestones{/number}", - stargazers_url: - "https://api.github.com/repos/triggerdotdev/empty/stargazers", + milestones_url: "https://api.github.com/repos/triggerdotdev/empty/milestones{/number}", + stargazers_url: "https://api.github.com/repos/triggerdotdev/empty/stargazers", watchers_count: 0, - deployments_url: - "https://api.github.com/repos/triggerdotdev/empty/deployments", - git_commits_url: - "https://api.github.com/repos/triggerdotdev/empty/git/commits{/sha}", + deployments_url: "https://api.github.com/repos/triggerdotdev/empty/deployments", + git_commits_url: "https://api.github.com/repos/triggerdotdev/empty/git/commits{/sha}", has_discussions: false, - subscribers_url: - "https://api.github.com/repos/triggerdotdev/empty/subscribers", - contributors_url: - "https://api.github.com/repos/triggerdotdev/empty/contributors", - issue_events_url: - "https://api.github.com/repos/triggerdotdev/empty/issues/events{/number}", + subscribers_url: "https://api.github.com/repos/triggerdotdev/empty/subscribers", + contributors_url: "https://api.github.com/repos/triggerdotdev/empty/contributors", + issue_events_url: "https://api.github.com/repos/triggerdotdev/empty/issues/events{/number}", stargazers_count: 0, - subscription_url: - "https://api.github.com/repos/triggerdotdev/empty/subscription", + subscription_url: "https://api.github.com/repos/triggerdotdev/empty/subscription", collaborators_url: "https://api.github.com/repos/triggerdotdev/empty/collaborators{/collaborator}", issue_comment_url: @@ -1263,8 +1025,7 @@ export const newBranch: EventSpecificationExample = { open_issues_count: 4, web_commit_signoff_required: false, }, - description: - "An empty repo that can be used to test the @trigger.dev/github integration", + description: "An empty repo that can be used to test the @trigger.dev/github integration", pusher_type: "user", organization: { id: 95297378, @@ -1278,8 +1039,7 @@ export const newBranch: EventSpecificationExample = { issues_url: "https://api.github.com/orgs/triggerdotdev/issues", description: "", members_url: "https://api.github.com/orgs/triggerdotdev/members{/member}", - public_members_url: - "https://api.github.com/orgs/triggerdotdev/public_members{/member}", + public_members_url: "https://api.github.com/orgs/triggerdotdev/public_members{/member}", }, master_branch: "main", }, @@ -1310,16 +1070,12 @@ export const push: EventSpecificationExample = { events_url: "https://api.github.com/users/matt-aitken/events{/privacy}", site_admin: false, gravatar_id: "", - starred_url: - "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", + starred_url: "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", followers_url: "https://api.github.com/users/matt-aitken/followers", - following_url: - "https://api.github.com/users/matt-aitken/following{/other_user}", + following_url: "https://api.github.com/users/matt-aitken/following{/other_user}", organizations_url: "https://api.github.com/users/matt-aitken/orgs", - subscriptions_url: - "https://api.github.com/users/matt-aitken/subscriptions", - received_events_url: - "https://api.github.com/users/matt-aitken/received_events", + subscriptions_url: "https://api.github.com/users/matt-aitken/subscriptions", + received_events_url: "https://api.github.com/users/matt-aitken/received_events", }, commits: [ { @@ -1344,8 +1100,7 @@ export const push: EventSpecificationExample = { timestamp: "2023-06-21T19:27:16+01:00", }, ], - compare: - "https://github.com/triggerdotdev/empty/compare/7f0b66558038...1ca6a91f4a13", + compare: "https://github.com/triggerdotdev/empty/compare/7f0b66558038...1ca6a91f4a13", created: false, deleted: false, base_ref: null, @@ -1368,20 +1123,15 @@ export const push: EventSpecificationExample = { gists_url: "https://api.github.com/users/triggerdotdev/gists{/gist_id}", repos_url: "https://api.github.com/users/triggerdotdev/repos", avatar_url: "https://avatars.githubusercontent.com/u/95297378?v=4", - events_url: - "https://api.github.com/users/triggerdotdev/events{/privacy}", + events_url: "https://api.github.com/users/triggerdotdev/events{/privacy}", site_admin: false, gravatar_id: "", - starred_url: - "https://api.github.com/users/triggerdotdev/starred{/owner}{/repo}", + starred_url: "https://api.github.com/users/triggerdotdev/starred{/owner}{/repo}", followers_url: "https://api.github.com/users/triggerdotdev/followers", - following_url: - "https://api.github.com/users/triggerdotdev/following{/other_user}", + following_url: "https://api.github.com/users/triggerdotdev/following{/other_user}", organizations_url: "https://api.github.com/users/triggerdotdev/orgs", - subscriptions_url: - "https://api.github.com/users/triggerdotdev/subscriptions", - received_events_url: - "https://api.github.com/users/triggerdotdev/received_events", + subscriptions_url: "https://api.github.com/users/triggerdotdev/subscriptions", + received_events_url: "https://api.github.com/users/triggerdotdev/received_events", }, topics: [], git_url: "git://github.com/triggerdotdev/empty.git", @@ -1395,92 +1145,64 @@ export const push: EventSpecificationExample = { has_wiki: true, homepage: null, html_url: "https://github.com/triggerdotdev/empty", - keys_url: - "https://api.github.com/repos/triggerdotdev/empty/keys{/key_id}", + keys_url: "https://api.github.com/repos/triggerdotdev/empty/keys{/key_id}", language: null, tags_url: "https://api.github.com/repos/triggerdotdev/empty/tags", watchers: 0, - blobs_url: - "https://api.github.com/repos/triggerdotdev/empty/git/blobs{/sha}", + blobs_url: "https://api.github.com/repos/triggerdotdev/empty/git/blobs{/sha}", clone_url: "https://github.com/triggerdotdev/empty.git", forks_url: "https://api.github.com/repos/triggerdotdev/empty/forks", full_name: "triggerdotdev/empty", has_pages: false, hooks_url: "https://api.github.com/repos/triggerdotdev/empty/hooks", - pulls_url: - "https://api.github.com/repos/triggerdotdev/empty/pulls{/number}", + pulls_url: "https://api.github.com/repos/triggerdotdev/empty/pulls{/number}", pushed_at: 1687372039, teams_url: "https://api.github.com/repos/triggerdotdev/empty/teams", - trees_url: - "https://api.github.com/repos/triggerdotdev/empty/git/trees{/sha}", + trees_url: "https://api.github.com/repos/triggerdotdev/empty/git/trees{/sha}", created_at: 1687357267, events_url: "https://api.github.com/repos/triggerdotdev/empty/events", has_issues: true, - issues_url: - "https://api.github.com/repos/triggerdotdev/empty/issues{/number}", - labels_url: - "https://api.github.com/repos/triggerdotdev/empty/labels{/name}", + issues_url: "https://api.github.com/repos/triggerdotdev/empty/issues{/number}", + labels_url: "https://api.github.com/repos/triggerdotdev/empty/labels{/name}", merges_url: "https://api.github.com/repos/triggerdotdev/empty/merges", mirror_url: null, stargazers: 0, updated_at: "2023-06-21T17:23:26Z", visibility: "public", - archive_url: - "https://api.github.com/repos/triggerdotdev/empty/{archive_format}{/ref}", - commits_url: - "https://api.github.com/repos/triggerdotdev/empty/commits{/sha}", - compare_url: - "https://api.github.com/repos/triggerdotdev/empty/compare/{base}...{head}", - description: - "An empty repo that can be used to test the @trigger.dev/github integration", + archive_url: "https://api.github.com/repos/triggerdotdev/empty/{archive_format}{/ref}", + commits_url: "https://api.github.com/repos/triggerdotdev/empty/commits{/sha}", + compare_url: "https://api.github.com/repos/triggerdotdev/empty/compare/{base}...{head}", + description: "An empty repo that can be used to test the @trigger.dev/github integration", forks_count: 0, is_template: false, open_issues: 4, - branches_url: - "https://api.github.com/repos/triggerdotdev/empty/branches{/branch}", - comments_url: - "https://api.github.com/repos/triggerdotdev/empty/comments{/number}", - contents_url: - "https://api.github.com/repos/triggerdotdev/empty/contents/{+path}", - git_refs_url: - "https://api.github.com/repos/triggerdotdev/empty/git/refs{/sha}", - git_tags_url: - "https://api.github.com/repos/triggerdotdev/empty/git/tags{/sha}", + branches_url: "https://api.github.com/repos/triggerdotdev/empty/branches{/branch}", + comments_url: "https://api.github.com/repos/triggerdotdev/empty/comments{/number}", + contents_url: "https://api.github.com/repos/triggerdotdev/empty/contents/{+path}", + git_refs_url: "https://api.github.com/repos/triggerdotdev/empty/git/refs{/sha}", + git_tags_url: "https://api.github.com/repos/triggerdotdev/empty/git/tags{/sha}", has_projects: true, organization: "triggerdotdev", - releases_url: - "https://api.github.com/repos/triggerdotdev/empty/releases{/id}", - statuses_url: - "https://api.github.com/repos/triggerdotdev/empty/statuses/{sha}", + releases_url: "https://api.github.com/repos/triggerdotdev/empty/releases{/id}", + statuses_url: "https://api.github.com/repos/triggerdotdev/empty/statuses/{sha}", allow_forking: true, - assignees_url: - "https://api.github.com/repos/triggerdotdev/empty/assignees{/user}", - downloads_url: - "https://api.github.com/repos/triggerdotdev/empty/downloads", + assignees_url: "https://api.github.com/repos/triggerdotdev/empty/assignees{/user}", + downloads_url: "https://api.github.com/repos/triggerdotdev/empty/downloads", has_downloads: true, - languages_url: - "https://api.github.com/repos/triggerdotdev/empty/languages", + languages_url: "https://api.github.com/repos/triggerdotdev/empty/languages", master_branch: "main", default_branch: "main", - milestones_url: - "https://api.github.com/repos/triggerdotdev/empty/milestones{/number}", - stargazers_url: - "https://api.github.com/repos/triggerdotdev/empty/stargazers", + milestones_url: "https://api.github.com/repos/triggerdotdev/empty/milestones{/number}", + stargazers_url: "https://api.github.com/repos/triggerdotdev/empty/stargazers", watchers_count: 0, - deployments_url: - "https://api.github.com/repos/triggerdotdev/empty/deployments", - git_commits_url: - "https://api.github.com/repos/triggerdotdev/empty/git/commits{/sha}", + deployments_url: "https://api.github.com/repos/triggerdotdev/empty/deployments", + git_commits_url: "https://api.github.com/repos/triggerdotdev/empty/git/commits{/sha}", has_discussions: false, - subscribers_url: - "https://api.github.com/repos/triggerdotdev/empty/subscribers", - contributors_url: - "https://api.github.com/repos/triggerdotdev/empty/contributors", - issue_events_url: - "https://api.github.com/repos/triggerdotdev/empty/issues/events{/number}", + subscribers_url: "https://api.github.com/repos/triggerdotdev/empty/subscribers", + contributors_url: "https://api.github.com/repos/triggerdotdev/empty/contributors", + issue_events_url: "https://api.github.com/repos/triggerdotdev/empty/issues/events{/number}", stargazers_count: 0, - subscription_url: - "https://api.github.com/repos/triggerdotdev/empty/subscription", + subscription_url: "https://api.github.com/repos/triggerdotdev/empty/subscription", collaborators_url: "https://api.github.com/repos/triggerdotdev/empty/collaborators{/collaborator}", issue_comment_url: @@ -1523,8 +1245,7 @@ export const push: EventSpecificationExample = { issues_url: "https://api.github.com/orgs/triggerdotdev/issues", description: "", members_url: "https://api.github.com/orgs/triggerdotdev/members{/member}", - public_members_url: - "https://api.github.com/orgs/triggerdotdev/public_members{/member}", + public_members_url: "https://api.github.com/orgs/triggerdotdev/public_members{/member}", }, }, }; @@ -1548,16 +1269,12 @@ export const pullRequestOpened: EventSpecificationExample = { events_url: "https://api.github.com/users/matt-aitken/events{/privacy}", site_admin: false, gravatar_id: "", - starred_url: - "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", + starred_url: "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", followers_url: "https://api.github.com/users/matt-aitken/followers", - following_url: - "https://api.github.com/users/matt-aitken/following{/other_user}", + following_url: "https://api.github.com/users/matt-aitken/following{/other_user}", organizations_url: "https://api.github.com/users/matt-aitken/orgs", - subscriptions_url: - "https://api.github.com/users/matt-aitken/subscriptions", - received_events_url: - "https://api.github.com/users/matt-aitken/received_events", + subscriptions_url: "https://api.github.com/users/matt-aitken/subscriptions", + received_events_url: "https://api.github.com/users/matt-aitken/received_events", }, repository: { id: 656732269, @@ -1576,20 +1293,15 @@ export const pullRequestOpened: EventSpecificationExample = { gists_url: "https://api.github.com/users/triggerdotdev/gists{/gist_id}", repos_url: "https://api.github.com/users/triggerdotdev/repos", avatar_url: "https://avatars.githubusercontent.com/u/95297378?v=4", - events_url: - "https://api.github.com/users/triggerdotdev/events{/privacy}", + events_url: "https://api.github.com/users/triggerdotdev/events{/privacy}", site_admin: false, gravatar_id: "", - starred_url: - "https://api.github.com/users/triggerdotdev/starred{/owner}{/repo}", + starred_url: "https://api.github.com/users/triggerdotdev/starred{/owner}{/repo}", followers_url: "https://api.github.com/users/triggerdotdev/followers", - following_url: - "https://api.github.com/users/triggerdotdev/following{/other_user}", + following_url: "https://api.github.com/users/triggerdotdev/following{/other_user}", organizations_url: "https://api.github.com/users/triggerdotdev/orgs", - subscriptions_url: - "https://api.github.com/users/triggerdotdev/subscriptions", - received_events_url: - "https://api.github.com/users/triggerdotdev/received_events", + subscriptions_url: "https://api.github.com/users/triggerdotdev/subscriptions", + received_events_url: "https://api.github.com/users/triggerdotdev/received_events", }, topics: [], git_url: "git://github.com/triggerdotdev/empty.git", @@ -1603,89 +1315,61 @@ export const pullRequestOpened: EventSpecificationExample = { has_wiki: true, homepage: null, html_url: "https://github.com/triggerdotdev/empty", - keys_url: - "https://api.github.com/repos/triggerdotdev/empty/keys{/key_id}", + keys_url: "https://api.github.com/repos/triggerdotdev/empty/keys{/key_id}", language: null, tags_url: "https://api.github.com/repos/triggerdotdev/empty/tags", watchers: 0, - blobs_url: - "https://api.github.com/repos/triggerdotdev/empty/git/blobs{/sha}", + blobs_url: "https://api.github.com/repos/triggerdotdev/empty/git/blobs{/sha}", clone_url: "https://github.com/triggerdotdev/empty.git", forks_url: "https://api.github.com/repos/triggerdotdev/empty/forks", full_name: "triggerdotdev/empty", has_pages: false, hooks_url: "https://api.github.com/repos/triggerdotdev/empty/hooks", - pulls_url: - "https://api.github.com/repos/triggerdotdev/empty/pulls{/number}", + pulls_url: "https://api.github.com/repos/triggerdotdev/empty/pulls{/number}", pushed_at: "2023-06-21T18:38:34Z", teams_url: "https://api.github.com/repos/triggerdotdev/empty/teams", - trees_url: - "https://api.github.com/repos/triggerdotdev/empty/git/trees{/sha}", + trees_url: "https://api.github.com/repos/triggerdotdev/empty/git/trees{/sha}", created_at: "2023-06-21T14:21:07Z", events_url: "https://api.github.com/repos/triggerdotdev/empty/events", has_issues: true, - issues_url: - "https://api.github.com/repos/triggerdotdev/empty/issues{/number}", - labels_url: - "https://api.github.com/repos/triggerdotdev/empty/labels{/name}", + issues_url: "https://api.github.com/repos/triggerdotdev/empty/issues{/number}", + labels_url: "https://api.github.com/repos/triggerdotdev/empty/labels{/name}", merges_url: "https://api.github.com/repos/triggerdotdev/empty/merges", mirror_url: null, updated_at: "2023-06-21T17:23:26Z", visibility: "public", - archive_url: - "https://api.github.com/repos/triggerdotdev/empty/{archive_format}{/ref}", - commits_url: - "https://api.github.com/repos/triggerdotdev/empty/commits{/sha}", - compare_url: - "https://api.github.com/repos/triggerdotdev/empty/compare/{base}...{head}", - description: - "An empty repo that can be used to test the @trigger.dev/github integration", + archive_url: "https://api.github.com/repos/triggerdotdev/empty/{archive_format}{/ref}", + commits_url: "https://api.github.com/repos/triggerdotdev/empty/commits{/sha}", + compare_url: "https://api.github.com/repos/triggerdotdev/empty/compare/{base}...{head}", + description: "An empty repo that can be used to test the @trigger.dev/github integration", forks_count: 0, is_template: false, open_issues: 5, - branches_url: - "https://api.github.com/repos/triggerdotdev/empty/branches{/branch}", - comments_url: - "https://api.github.com/repos/triggerdotdev/empty/comments{/number}", - contents_url: - "https://api.github.com/repos/triggerdotdev/empty/contents/{+path}", - git_refs_url: - "https://api.github.com/repos/triggerdotdev/empty/git/refs{/sha}", - git_tags_url: - "https://api.github.com/repos/triggerdotdev/empty/git/tags{/sha}", + branches_url: "https://api.github.com/repos/triggerdotdev/empty/branches{/branch}", + comments_url: "https://api.github.com/repos/triggerdotdev/empty/comments{/number}", + contents_url: "https://api.github.com/repos/triggerdotdev/empty/contents/{+path}", + git_refs_url: "https://api.github.com/repos/triggerdotdev/empty/git/refs{/sha}", + git_tags_url: "https://api.github.com/repos/triggerdotdev/empty/git/tags{/sha}", has_projects: true, - releases_url: - "https://api.github.com/repos/triggerdotdev/empty/releases{/id}", - statuses_url: - "https://api.github.com/repos/triggerdotdev/empty/statuses/{sha}", + releases_url: "https://api.github.com/repos/triggerdotdev/empty/releases{/id}", + statuses_url: "https://api.github.com/repos/triggerdotdev/empty/statuses/{sha}", allow_forking: true, - assignees_url: - "https://api.github.com/repos/triggerdotdev/empty/assignees{/user}", - downloads_url: - "https://api.github.com/repos/triggerdotdev/empty/downloads", + assignees_url: "https://api.github.com/repos/triggerdotdev/empty/assignees{/user}", + downloads_url: "https://api.github.com/repos/triggerdotdev/empty/downloads", has_downloads: true, - languages_url: - "https://api.github.com/repos/triggerdotdev/empty/languages", + languages_url: "https://api.github.com/repos/triggerdotdev/empty/languages", default_branch: "main", - milestones_url: - "https://api.github.com/repos/triggerdotdev/empty/milestones{/number}", - stargazers_url: - "https://api.github.com/repos/triggerdotdev/empty/stargazers", + milestones_url: "https://api.github.com/repos/triggerdotdev/empty/milestones{/number}", + stargazers_url: "https://api.github.com/repos/triggerdotdev/empty/stargazers", watchers_count: 0, - deployments_url: - "https://api.github.com/repos/triggerdotdev/empty/deployments", - git_commits_url: - "https://api.github.com/repos/triggerdotdev/empty/git/commits{/sha}", + deployments_url: "https://api.github.com/repos/triggerdotdev/empty/deployments", + git_commits_url: "https://api.github.com/repos/triggerdotdev/empty/git/commits{/sha}", has_discussions: false, - subscribers_url: - "https://api.github.com/repos/triggerdotdev/empty/subscribers", - contributors_url: - "https://api.github.com/repos/triggerdotdev/empty/contributors", - issue_events_url: - "https://api.github.com/repos/triggerdotdev/empty/issues/events{/number}", + subscribers_url: "https://api.github.com/repos/triggerdotdev/empty/subscribers", + contributors_url: "https://api.github.com/repos/triggerdotdev/empty/contributors", + issue_events_url: "https://api.github.com/repos/triggerdotdev/empty/issues/events{/number}", stargazers_count: 0, - subscription_url: - "https://api.github.com/repos/triggerdotdev/empty/subscription", + subscription_url: "https://api.github.com/repos/triggerdotdev/empty/subscription", collaborators_url: "https://api.github.com/repos/triggerdotdev/empty/collaborators{/collaborator}", issue_comment_url: @@ -1707,8 +1391,7 @@ export const pullRequestOpened: EventSpecificationExample = { issues_url: "https://api.github.com/orgs/triggerdotdev/issues", description: "", members_url: "https://api.github.com/orgs/triggerdotdev/members{/member}", - public_members_url: - "https://api.github.com/orgs/triggerdotdev/public_members{/member}", + public_members_url: "https://api.github.com/orgs/triggerdotdev/public_members{/member}", }, pull_request: { id: 1402223044, @@ -1730,26 +1413,18 @@ export const pullRequestOpened: EventSpecificationExample = { login: "triggerdotdev", node_id: "O_kgDOBa4fYg", html_url: "https://github.com/triggerdotdev", - gists_url: - "https://api.github.com/users/triggerdotdev/gists{/gist_id}", + gists_url: "https://api.github.com/users/triggerdotdev/gists{/gist_id}", repos_url: "https://api.github.com/users/triggerdotdev/repos", avatar_url: "https://avatars.githubusercontent.com/u/95297378?v=4", - events_url: - "https://api.github.com/users/triggerdotdev/events{/privacy}", + events_url: "https://api.github.com/users/triggerdotdev/events{/privacy}", site_admin: false, gravatar_id: "", - starred_url: - "https://api.github.com/users/triggerdotdev/starred{/owner}{/repo}", - followers_url: - "https://api.github.com/users/triggerdotdev/followers", - following_url: - "https://api.github.com/users/triggerdotdev/following{/other_user}", - organizations_url: - "https://api.github.com/users/triggerdotdev/orgs", - subscriptions_url: - "https://api.github.com/users/triggerdotdev/subscriptions", - received_events_url: - "https://api.github.com/users/triggerdotdev/received_events", + starred_url: "https://api.github.com/users/triggerdotdev/starred{/owner}{/repo}", + followers_url: "https://api.github.com/users/triggerdotdev/followers", + following_url: "https://api.github.com/users/triggerdotdev/following{/other_user}", + organizations_url: "https://api.github.com/users/triggerdotdev/orgs", + subscriptions_url: "https://api.github.com/users/triggerdotdev/subscriptions", + received_events_url: "https://api.github.com/users/triggerdotdev/received_events", }, topics: [], git_url: "git://github.com/triggerdotdev/empty.git", @@ -1763,90 +1438,63 @@ export const pullRequestOpened: EventSpecificationExample = { has_wiki: true, homepage: null, html_url: "https://github.com/triggerdotdev/empty", - keys_url: - "https://api.github.com/repos/triggerdotdev/empty/keys{/key_id}", + keys_url: "https://api.github.com/repos/triggerdotdev/empty/keys{/key_id}", language: null, tags_url: "https://api.github.com/repos/triggerdotdev/empty/tags", watchers: 0, - blobs_url: - "https://api.github.com/repos/triggerdotdev/empty/git/blobs{/sha}", + blobs_url: "https://api.github.com/repos/triggerdotdev/empty/git/blobs{/sha}", clone_url: "https://github.com/triggerdotdev/empty.git", forks_url: "https://api.github.com/repos/triggerdotdev/empty/forks", full_name: "triggerdotdev/empty", has_pages: false, hooks_url: "https://api.github.com/repos/triggerdotdev/empty/hooks", - pulls_url: - "https://api.github.com/repos/triggerdotdev/empty/pulls{/number}", + pulls_url: "https://api.github.com/repos/triggerdotdev/empty/pulls{/number}", pushed_at: "2023-06-21T18:38:34Z", teams_url: "https://api.github.com/repos/triggerdotdev/empty/teams", - trees_url: - "https://api.github.com/repos/triggerdotdev/empty/git/trees{/sha}", + trees_url: "https://api.github.com/repos/triggerdotdev/empty/git/trees{/sha}", created_at: "2023-06-21T14:21:07Z", events_url: "https://api.github.com/repos/triggerdotdev/empty/events", has_issues: true, - issues_url: - "https://api.github.com/repos/triggerdotdev/empty/issues{/number}", - labels_url: - "https://api.github.com/repos/triggerdotdev/empty/labels{/name}", + issues_url: "https://api.github.com/repos/triggerdotdev/empty/issues{/number}", + labels_url: "https://api.github.com/repos/triggerdotdev/empty/labels{/name}", merges_url: "https://api.github.com/repos/triggerdotdev/empty/merges", mirror_url: null, updated_at: "2023-06-21T17:23:26Z", visibility: "public", - archive_url: - "https://api.github.com/repos/triggerdotdev/empty/{archive_format}{/ref}", - commits_url: - "https://api.github.com/repos/triggerdotdev/empty/commits{/sha}", - compare_url: - "https://api.github.com/repos/triggerdotdev/empty/compare/{base}...{head}", - description: - "An empty repo that can be used to test the @trigger.dev/github integration", + archive_url: "https://api.github.com/repos/triggerdotdev/empty/{archive_format}{/ref}", + commits_url: "https://api.github.com/repos/triggerdotdev/empty/commits{/sha}", + compare_url: "https://api.github.com/repos/triggerdotdev/empty/compare/{base}...{head}", + description: "An empty repo that can be used to test the @trigger.dev/github integration", forks_count: 0, is_template: false, open_issues: 5, - branches_url: - "https://api.github.com/repos/triggerdotdev/empty/branches{/branch}", - comments_url: - "https://api.github.com/repos/triggerdotdev/empty/comments{/number}", - contents_url: - "https://api.github.com/repos/triggerdotdev/empty/contents/{+path}", - git_refs_url: - "https://api.github.com/repos/triggerdotdev/empty/git/refs{/sha}", - git_tags_url: - "https://api.github.com/repos/triggerdotdev/empty/git/tags{/sha}", + branches_url: "https://api.github.com/repos/triggerdotdev/empty/branches{/branch}", + comments_url: "https://api.github.com/repos/triggerdotdev/empty/comments{/number}", + contents_url: "https://api.github.com/repos/triggerdotdev/empty/contents/{+path}", + git_refs_url: "https://api.github.com/repos/triggerdotdev/empty/git/refs{/sha}", + git_tags_url: "https://api.github.com/repos/triggerdotdev/empty/git/tags{/sha}", has_projects: true, - releases_url: - "https://api.github.com/repos/triggerdotdev/empty/releases{/id}", - statuses_url: - "https://api.github.com/repos/triggerdotdev/empty/statuses/{sha}", + releases_url: "https://api.github.com/repos/triggerdotdev/empty/releases{/id}", + statuses_url: "https://api.github.com/repos/triggerdotdev/empty/statuses/{sha}", allow_forking: true, - assignees_url: - "https://api.github.com/repos/triggerdotdev/empty/assignees{/user}", - downloads_url: - "https://api.github.com/repos/triggerdotdev/empty/downloads", + assignees_url: "https://api.github.com/repos/triggerdotdev/empty/assignees{/user}", + downloads_url: "https://api.github.com/repos/triggerdotdev/empty/downloads", has_downloads: true, - languages_url: - "https://api.github.com/repos/triggerdotdev/empty/languages", + languages_url: "https://api.github.com/repos/triggerdotdev/empty/languages", default_branch: "main", - milestones_url: - "https://api.github.com/repos/triggerdotdev/empty/milestones{/number}", - stargazers_url: - "https://api.github.com/repos/triggerdotdev/empty/stargazers", + milestones_url: "https://api.github.com/repos/triggerdotdev/empty/milestones{/number}", + stargazers_url: "https://api.github.com/repos/triggerdotdev/empty/stargazers", watchers_count: 0, - deployments_url: - "https://api.github.com/repos/triggerdotdev/empty/deployments", - git_commits_url: - "https://api.github.com/repos/triggerdotdev/empty/git/commits{/sha}", + deployments_url: "https://api.github.com/repos/triggerdotdev/empty/deployments", + git_commits_url: "https://api.github.com/repos/triggerdotdev/empty/git/commits{/sha}", has_discussions: false, - subscribers_url: - "https://api.github.com/repos/triggerdotdev/empty/subscribers", + subscribers_url: "https://api.github.com/repos/triggerdotdev/empty/subscribers", allow_auto_merge: false, - contributors_url: - "https://api.github.com/repos/triggerdotdev/empty/contributors", + contributors_url: "https://api.github.com/repos/triggerdotdev/empty/contributors", issue_events_url: "https://api.github.com/repos/triggerdotdev/empty/issues/events{/number}", stargazers_count: 0, - subscription_url: - "https://api.github.com/repos/triggerdotdev/empty/subscription", + subscription_url: "https://api.github.com/repos/triggerdotdev/empty/subscription", collaborators_url: "https://api.github.com/repos/triggerdotdev/empty/collaborators{/collaborator}", issue_comment_url: @@ -1873,24 +1521,18 @@ export const pullRequestOpened: EventSpecificationExample = { login: "triggerdotdev", node_id: "O_kgDOBa4fYg", html_url: "https://github.com/triggerdotdev", - gists_url: - "https://api.github.com/users/triggerdotdev/gists{/gist_id}", + gists_url: "https://api.github.com/users/triggerdotdev/gists{/gist_id}", repos_url: "https://api.github.com/users/triggerdotdev/repos", avatar_url: "https://avatars.githubusercontent.com/u/95297378?v=4", - events_url: - "https://api.github.com/users/triggerdotdev/events{/privacy}", + events_url: "https://api.github.com/users/triggerdotdev/events{/privacy}", site_admin: false, gravatar_id: "", - starred_url: - "https://api.github.com/users/triggerdotdev/starred{/owner}{/repo}", + starred_url: "https://api.github.com/users/triggerdotdev/starred{/owner}{/repo}", followers_url: "https://api.github.com/users/triggerdotdev/followers", - following_url: - "https://api.github.com/users/triggerdotdev/following{/other_user}", + following_url: "https://api.github.com/users/triggerdotdev/following{/other_user}", organizations_url: "https://api.github.com/users/triggerdotdev/orgs", - subscriptions_url: - "https://api.github.com/users/triggerdotdev/subscriptions", - received_events_url: - "https://api.github.com/users/triggerdotdev/received_events", + subscriptions_url: "https://api.github.com/users/triggerdotdev/subscriptions", + received_events_url: "https://api.github.com/users/triggerdotdev/received_events", }, label: "triggerdotdev:main", }, @@ -1912,26 +1554,18 @@ export const pullRequestOpened: EventSpecificationExample = { login: "triggerdotdev", node_id: "O_kgDOBa4fYg", html_url: "https://github.com/triggerdotdev", - gists_url: - "https://api.github.com/users/triggerdotdev/gists{/gist_id}", + gists_url: "https://api.github.com/users/triggerdotdev/gists{/gist_id}", repos_url: "https://api.github.com/users/triggerdotdev/repos", avatar_url: "https://avatars.githubusercontent.com/u/95297378?v=4", - events_url: - "https://api.github.com/users/triggerdotdev/events{/privacy}", + events_url: "https://api.github.com/users/triggerdotdev/events{/privacy}", site_admin: false, gravatar_id: "", - starred_url: - "https://api.github.com/users/triggerdotdev/starred{/owner}{/repo}", - followers_url: - "https://api.github.com/users/triggerdotdev/followers", - following_url: - "https://api.github.com/users/triggerdotdev/following{/other_user}", - organizations_url: - "https://api.github.com/users/triggerdotdev/orgs", - subscriptions_url: - "https://api.github.com/users/triggerdotdev/subscriptions", - received_events_url: - "https://api.github.com/users/triggerdotdev/received_events", + starred_url: "https://api.github.com/users/triggerdotdev/starred{/owner}{/repo}", + followers_url: "https://api.github.com/users/triggerdotdev/followers", + following_url: "https://api.github.com/users/triggerdotdev/following{/other_user}", + organizations_url: "https://api.github.com/users/triggerdotdev/orgs", + subscriptions_url: "https://api.github.com/users/triggerdotdev/subscriptions", + received_events_url: "https://api.github.com/users/triggerdotdev/received_events", }, topics: [], git_url: "git://github.com/triggerdotdev/empty.git", @@ -1945,90 +1579,63 @@ export const pullRequestOpened: EventSpecificationExample = { has_wiki: true, homepage: null, html_url: "https://github.com/triggerdotdev/empty", - keys_url: - "https://api.github.com/repos/triggerdotdev/empty/keys{/key_id}", + keys_url: "https://api.github.com/repos/triggerdotdev/empty/keys{/key_id}", language: null, tags_url: "https://api.github.com/repos/triggerdotdev/empty/tags", watchers: 0, - blobs_url: - "https://api.github.com/repos/triggerdotdev/empty/git/blobs{/sha}", + blobs_url: "https://api.github.com/repos/triggerdotdev/empty/git/blobs{/sha}", clone_url: "https://github.com/triggerdotdev/empty.git", forks_url: "https://api.github.com/repos/triggerdotdev/empty/forks", full_name: "triggerdotdev/empty", has_pages: false, hooks_url: "https://api.github.com/repos/triggerdotdev/empty/hooks", - pulls_url: - "https://api.github.com/repos/triggerdotdev/empty/pulls{/number}", + pulls_url: "https://api.github.com/repos/triggerdotdev/empty/pulls{/number}", pushed_at: "2023-06-21T18:38:34Z", teams_url: "https://api.github.com/repos/triggerdotdev/empty/teams", - trees_url: - "https://api.github.com/repos/triggerdotdev/empty/git/trees{/sha}", + trees_url: "https://api.github.com/repos/triggerdotdev/empty/git/trees{/sha}", created_at: "2023-06-21T14:21:07Z", events_url: "https://api.github.com/repos/triggerdotdev/empty/events", has_issues: true, - issues_url: - "https://api.github.com/repos/triggerdotdev/empty/issues{/number}", - labels_url: - "https://api.github.com/repos/triggerdotdev/empty/labels{/name}", + issues_url: "https://api.github.com/repos/triggerdotdev/empty/issues{/number}", + labels_url: "https://api.github.com/repos/triggerdotdev/empty/labels{/name}", merges_url: "https://api.github.com/repos/triggerdotdev/empty/merges", mirror_url: null, updated_at: "2023-06-21T17:23:26Z", visibility: "public", - archive_url: - "https://api.github.com/repos/triggerdotdev/empty/{archive_format}{/ref}", - commits_url: - "https://api.github.com/repos/triggerdotdev/empty/commits{/sha}", - compare_url: - "https://api.github.com/repos/triggerdotdev/empty/compare/{base}...{head}", - description: - "An empty repo that can be used to test the @trigger.dev/github integration", + archive_url: "https://api.github.com/repos/triggerdotdev/empty/{archive_format}{/ref}", + commits_url: "https://api.github.com/repos/triggerdotdev/empty/commits{/sha}", + compare_url: "https://api.github.com/repos/triggerdotdev/empty/compare/{base}...{head}", + description: "An empty repo that can be used to test the @trigger.dev/github integration", forks_count: 0, is_template: false, open_issues: 5, - branches_url: - "https://api.github.com/repos/triggerdotdev/empty/branches{/branch}", - comments_url: - "https://api.github.com/repos/triggerdotdev/empty/comments{/number}", - contents_url: - "https://api.github.com/repos/triggerdotdev/empty/contents/{+path}", - git_refs_url: - "https://api.github.com/repos/triggerdotdev/empty/git/refs{/sha}", - git_tags_url: - "https://api.github.com/repos/triggerdotdev/empty/git/tags{/sha}", + branches_url: "https://api.github.com/repos/triggerdotdev/empty/branches{/branch}", + comments_url: "https://api.github.com/repos/triggerdotdev/empty/comments{/number}", + contents_url: "https://api.github.com/repos/triggerdotdev/empty/contents/{+path}", + git_refs_url: "https://api.github.com/repos/triggerdotdev/empty/git/refs{/sha}", + git_tags_url: "https://api.github.com/repos/triggerdotdev/empty/git/tags{/sha}", has_projects: true, - releases_url: - "https://api.github.com/repos/triggerdotdev/empty/releases{/id}", - statuses_url: - "https://api.github.com/repos/triggerdotdev/empty/statuses/{sha}", + releases_url: "https://api.github.com/repos/triggerdotdev/empty/releases{/id}", + statuses_url: "https://api.github.com/repos/triggerdotdev/empty/statuses/{sha}", allow_forking: true, - assignees_url: - "https://api.github.com/repos/triggerdotdev/empty/assignees{/user}", - downloads_url: - "https://api.github.com/repos/triggerdotdev/empty/downloads", + assignees_url: "https://api.github.com/repos/triggerdotdev/empty/assignees{/user}", + downloads_url: "https://api.github.com/repos/triggerdotdev/empty/downloads", has_downloads: true, - languages_url: - "https://api.github.com/repos/triggerdotdev/empty/languages", + languages_url: "https://api.github.com/repos/triggerdotdev/empty/languages", default_branch: "main", - milestones_url: - "https://api.github.com/repos/triggerdotdev/empty/milestones{/number}", - stargazers_url: - "https://api.github.com/repos/triggerdotdev/empty/stargazers", + milestones_url: "https://api.github.com/repos/triggerdotdev/empty/milestones{/number}", + stargazers_url: "https://api.github.com/repos/triggerdotdev/empty/stargazers", watchers_count: 0, - deployments_url: - "https://api.github.com/repos/triggerdotdev/empty/deployments", - git_commits_url: - "https://api.github.com/repos/triggerdotdev/empty/git/commits{/sha}", + deployments_url: "https://api.github.com/repos/triggerdotdev/empty/deployments", + git_commits_url: "https://api.github.com/repos/triggerdotdev/empty/git/commits{/sha}", has_discussions: false, - subscribers_url: - "https://api.github.com/repos/triggerdotdev/empty/subscribers", + subscribers_url: "https://api.github.com/repos/triggerdotdev/empty/subscribers", allow_auto_merge: false, - contributors_url: - "https://api.github.com/repos/triggerdotdev/empty/contributors", + contributors_url: "https://api.github.com/repos/triggerdotdev/empty/contributors", issue_events_url: "https://api.github.com/repos/triggerdotdev/empty/issues/events{/number}", stargazers_count: 0, - subscription_url: - "https://api.github.com/repos/triggerdotdev/empty/subscription", + subscription_url: "https://api.github.com/repos/triggerdotdev/empty/subscription", collaborators_url: "https://api.github.com/repos/triggerdotdev/empty/collaborators{/collaborator}", issue_comment_url: @@ -2055,24 +1662,18 @@ export const pullRequestOpened: EventSpecificationExample = { login: "triggerdotdev", node_id: "O_kgDOBa4fYg", html_url: "https://github.com/triggerdotdev", - gists_url: - "https://api.github.com/users/triggerdotdev/gists{/gist_id}", + gists_url: "https://api.github.com/users/triggerdotdev/gists{/gist_id}", repos_url: "https://api.github.com/users/triggerdotdev/repos", avatar_url: "https://avatars.githubusercontent.com/u/95297378?v=4", - events_url: - "https://api.github.com/users/triggerdotdev/events{/privacy}", + events_url: "https://api.github.com/users/triggerdotdev/events{/privacy}", site_admin: false, gravatar_id: "", - starred_url: - "https://api.github.com/users/triggerdotdev/starred{/owner}{/repo}", + starred_url: "https://api.github.com/users/triggerdotdev/starred{/owner}{/repo}", followers_url: "https://api.github.com/users/triggerdotdev/followers", - following_url: - "https://api.github.com/users/triggerdotdev/following{/other_user}", + following_url: "https://api.github.com/users/triggerdotdev/following{/other_user}", organizations_url: "https://api.github.com/users/triggerdotdev/orgs", - subscriptions_url: - "https://api.github.com/users/triggerdotdev/subscriptions", - received_events_url: - "https://api.github.com/users/triggerdotdev/received_events", + subscriptions_url: "https://api.github.com/users/triggerdotdev/subscriptions", + received_events_url: "https://api.github.com/users/triggerdotdev/received_events", }, label: "triggerdotdev:test", }, @@ -2089,16 +1690,12 @@ export const pullRequestOpened: EventSpecificationExample = { events_url: "https://api.github.com/users/matt-aitken/events{/privacy}", site_admin: false, gravatar_id: "", - starred_url: - "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", + starred_url: "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", followers_url: "https://api.github.com/users/matt-aitken/followers", - following_url: - "https://api.github.com/users/matt-aitken/following{/other_user}", + following_url: "https://api.github.com/users/matt-aitken/following{/other_user}", organizations_url: "https://api.github.com/users/matt-aitken/orgs", - subscriptions_url: - "https://api.github.com/users/matt-aitken/subscriptions", - received_events_url: - "https://api.github.com/users/matt-aitken/received_events", + subscriptions_url: "https://api.github.com/users/matt-aitken/subscriptions", + received_events_url: "https://api.github.com/users/matt-aitken/received_events", }, draft: false, state: "open", @@ -2153,10 +1750,8 @@ export const pullRequestOpened: EventSpecificationExample = { created_at: "2023-06-21T18:39:13Z", rebaseable: null, updated_at: "2023-06-21T18:39:13Z", - commits_url: - "https://api.github.com/repos/triggerdotdev/empty/pulls/5/commits", - comments_url: - "https://api.github.com/repos/triggerdotdev/empty/issues/5/comments", + commits_url: "https://api.github.com/repos/triggerdotdev/empty/pulls/5/commits", + comments_url: "https://api.github.com/repos/triggerdotdev/empty/issues/5/comments", statuses_url: "https://api.github.com/repos/triggerdotdev/empty/statuses/073aa42afebca03c4b34361564e3976da5c65d48", changed_files: 1, @@ -2169,8 +1764,7 @@ export const pullRequestOpened: EventSpecificationExample = { review_comment_url: "https://api.github.com/repos/triggerdotdev/empty/pulls/comments{/number}", requested_reviewers: [], - review_comments_url: - "https://api.github.com/repos/triggerdotdev/empty/pulls/5/comments", + review_comments_url: "https://api.github.com/repos/triggerdotdev/empty/pulls/5/comments", maintainer_can_modify: false, }, }, @@ -2197,16 +1791,12 @@ export const pullRequestReviewSubmitted: EventSpecificationExample = { events_url: "https://api.github.com/users/matt-aitken/events{/privacy}", site_admin: false, gravatar_id: "", - starred_url: - "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", + starred_url: "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", followers_url: "https://api.github.com/users/matt-aitken/followers", - following_url: - "https://api.github.com/users/matt-aitken/following{/other_user}", + following_url: "https://api.github.com/users/matt-aitken/following{/other_user}", organizations_url: "https://api.github.com/users/matt-aitken/orgs", - subscriptions_url: - "https://api.github.com/users/matt-aitken/subscriptions", - received_events_url: - "https://api.github.com/users/matt-aitken/received_events", + subscriptions_url: "https://api.github.com/users/matt-aitken/subscriptions", + received_events_url: "https://api.github.com/users/matt-aitken/received_events", }, state: "commented", _links: { @@ -2218,12 +1808,10 @@ export const pullRequestReviewSubmitted: EventSpecificationExample = { }, }, node_id: "PRR_kwDOJyTwbc5Y5hqz", - html_url: - "https://github.com/triggerdotdev/empty/pull/5#pullrequestreview-1491475123", + html_url: "https://github.com/triggerdotdev/empty/pull/5#pullrequestreview-1491475123", commit_id: "073aa42afebca03c4b34361564e3976da5c65d48", submitted_at: "2023-06-21T18:47:47Z", - pull_request_url: - "https://api.github.com/repos/triggerdotdev/empty/pulls/5", + pull_request_url: "https://api.github.com/repos/triggerdotdev/empty/pulls/5", author_association: "MEMBER", }, sender: { @@ -2239,16 +1827,12 @@ export const pullRequestReviewSubmitted: EventSpecificationExample = { events_url: "https://api.github.com/users/matt-aitken/events{/privacy}", site_admin: false, gravatar_id: "", - starred_url: - "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", + starred_url: "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", followers_url: "https://api.github.com/users/matt-aitken/followers", - following_url: - "https://api.github.com/users/matt-aitken/following{/other_user}", + following_url: "https://api.github.com/users/matt-aitken/following{/other_user}", organizations_url: "https://api.github.com/users/matt-aitken/orgs", - subscriptions_url: - "https://api.github.com/users/matt-aitken/subscriptions", - received_events_url: - "https://api.github.com/users/matt-aitken/received_events", + subscriptions_url: "https://api.github.com/users/matt-aitken/subscriptions", + received_events_url: "https://api.github.com/users/matt-aitken/received_events", }, repository: { id: 656732269, @@ -2267,20 +1851,15 @@ export const pullRequestReviewSubmitted: EventSpecificationExample = { gists_url: "https://api.github.com/users/triggerdotdev/gists{/gist_id}", repos_url: "https://api.github.com/users/triggerdotdev/repos", avatar_url: "https://avatars.githubusercontent.com/u/95297378?v=4", - events_url: - "https://api.github.com/users/triggerdotdev/events{/privacy}", + events_url: "https://api.github.com/users/triggerdotdev/events{/privacy}", site_admin: false, gravatar_id: "", - starred_url: - "https://api.github.com/users/triggerdotdev/starred{/owner}{/repo}", + starred_url: "https://api.github.com/users/triggerdotdev/starred{/owner}{/repo}", followers_url: "https://api.github.com/users/triggerdotdev/followers", - following_url: - "https://api.github.com/users/triggerdotdev/following{/other_user}", + following_url: "https://api.github.com/users/triggerdotdev/following{/other_user}", organizations_url: "https://api.github.com/users/triggerdotdev/orgs", - subscriptions_url: - "https://api.github.com/users/triggerdotdev/subscriptions", - received_events_url: - "https://api.github.com/users/triggerdotdev/received_events", + subscriptions_url: "https://api.github.com/users/triggerdotdev/subscriptions", + received_events_url: "https://api.github.com/users/triggerdotdev/received_events", }, topics: [], git_url: "git://github.com/triggerdotdev/empty.git", @@ -2294,89 +1873,61 @@ export const pullRequestReviewSubmitted: EventSpecificationExample = { has_wiki: true, homepage: null, html_url: "https://github.com/triggerdotdev/empty", - keys_url: - "https://api.github.com/repos/triggerdotdev/empty/keys{/key_id}", + keys_url: "https://api.github.com/repos/triggerdotdev/empty/keys{/key_id}", language: null, tags_url: "https://api.github.com/repos/triggerdotdev/empty/tags", watchers: 0, - blobs_url: - "https://api.github.com/repos/triggerdotdev/empty/git/blobs{/sha}", + blobs_url: "https://api.github.com/repos/triggerdotdev/empty/git/blobs{/sha}", clone_url: "https://github.com/triggerdotdev/empty.git", forks_url: "https://api.github.com/repos/triggerdotdev/empty/forks", full_name: "triggerdotdev/empty", has_pages: false, hooks_url: "https://api.github.com/repos/triggerdotdev/empty/hooks", - pulls_url: - "https://api.github.com/repos/triggerdotdev/empty/pulls{/number}", + pulls_url: "https://api.github.com/repos/triggerdotdev/empty/pulls{/number}", pushed_at: "2023-06-21T18:39:13Z", teams_url: "https://api.github.com/repos/triggerdotdev/empty/teams", - trees_url: - "https://api.github.com/repos/triggerdotdev/empty/git/trees{/sha}", + trees_url: "https://api.github.com/repos/triggerdotdev/empty/git/trees{/sha}", created_at: "2023-06-21T14:21:07Z", events_url: "https://api.github.com/repos/triggerdotdev/empty/events", has_issues: true, - issues_url: - "https://api.github.com/repos/triggerdotdev/empty/issues{/number}", - labels_url: - "https://api.github.com/repos/triggerdotdev/empty/labels{/name}", + issues_url: "https://api.github.com/repos/triggerdotdev/empty/issues{/number}", + labels_url: "https://api.github.com/repos/triggerdotdev/empty/labels{/name}", merges_url: "https://api.github.com/repos/triggerdotdev/empty/merges", mirror_url: null, updated_at: "2023-06-21T17:23:26Z", visibility: "public", - archive_url: - "https://api.github.com/repos/triggerdotdev/empty/{archive_format}{/ref}", - commits_url: - "https://api.github.com/repos/triggerdotdev/empty/commits{/sha}", - compare_url: - "https://api.github.com/repos/triggerdotdev/empty/compare/{base}...{head}", - description: - "An empty repo that can be used to test the @trigger.dev/github integration", + archive_url: "https://api.github.com/repos/triggerdotdev/empty/{archive_format}{/ref}", + commits_url: "https://api.github.com/repos/triggerdotdev/empty/commits{/sha}", + compare_url: "https://api.github.com/repos/triggerdotdev/empty/compare/{base}...{head}", + description: "An empty repo that can be used to test the @trigger.dev/github integration", forks_count: 0, is_template: false, open_issues: 5, - branches_url: - "https://api.github.com/repos/triggerdotdev/empty/branches{/branch}", - comments_url: - "https://api.github.com/repos/triggerdotdev/empty/comments{/number}", - contents_url: - "https://api.github.com/repos/triggerdotdev/empty/contents/{+path}", - git_refs_url: - "https://api.github.com/repos/triggerdotdev/empty/git/refs{/sha}", - git_tags_url: - "https://api.github.com/repos/triggerdotdev/empty/git/tags{/sha}", + branches_url: "https://api.github.com/repos/triggerdotdev/empty/branches{/branch}", + comments_url: "https://api.github.com/repos/triggerdotdev/empty/comments{/number}", + contents_url: "https://api.github.com/repos/triggerdotdev/empty/contents/{+path}", + git_refs_url: "https://api.github.com/repos/triggerdotdev/empty/git/refs{/sha}", + git_tags_url: "https://api.github.com/repos/triggerdotdev/empty/git/tags{/sha}", has_projects: true, - releases_url: - "https://api.github.com/repos/triggerdotdev/empty/releases{/id}", - statuses_url: - "https://api.github.com/repos/triggerdotdev/empty/statuses/{sha}", + releases_url: "https://api.github.com/repos/triggerdotdev/empty/releases{/id}", + statuses_url: "https://api.github.com/repos/triggerdotdev/empty/statuses/{sha}", allow_forking: true, - assignees_url: - "https://api.github.com/repos/triggerdotdev/empty/assignees{/user}", - downloads_url: - "https://api.github.com/repos/triggerdotdev/empty/downloads", + assignees_url: "https://api.github.com/repos/triggerdotdev/empty/assignees{/user}", + downloads_url: "https://api.github.com/repos/triggerdotdev/empty/downloads", has_downloads: true, - languages_url: - "https://api.github.com/repos/triggerdotdev/empty/languages", + languages_url: "https://api.github.com/repos/triggerdotdev/empty/languages", default_branch: "main", - milestones_url: - "https://api.github.com/repos/triggerdotdev/empty/milestones{/number}", - stargazers_url: - "https://api.github.com/repos/triggerdotdev/empty/stargazers", + milestones_url: "https://api.github.com/repos/triggerdotdev/empty/milestones{/number}", + stargazers_url: "https://api.github.com/repos/triggerdotdev/empty/stargazers", watchers_count: 0, - deployments_url: - "https://api.github.com/repos/triggerdotdev/empty/deployments", - git_commits_url: - "https://api.github.com/repos/triggerdotdev/empty/git/commits{/sha}", + deployments_url: "https://api.github.com/repos/triggerdotdev/empty/deployments", + git_commits_url: "https://api.github.com/repos/triggerdotdev/empty/git/commits{/sha}", has_discussions: false, - subscribers_url: - "https://api.github.com/repos/triggerdotdev/empty/subscribers", - contributors_url: - "https://api.github.com/repos/triggerdotdev/empty/contributors", - issue_events_url: - "https://api.github.com/repos/triggerdotdev/empty/issues/events{/number}", + subscribers_url: "https://api.github.com/repos/triggerdotdev/empty/subscribers", + contributors_url: "https://api.github.com/repos/triggerdotdev/empty/contributors", + issue_events_url: "https://api.github.com/repos/triggerdotdev/empty/issues/events{/number}", stargazers_count: 0, - subscription_url: - "https://api.github.com/repos/triggerdotdev/empty/subscription", + subscription_url: "https://api.github.com/repos/triggerdotdev/empty/subscription", collaborators_url: "https://api.github.com/repos/triggerdotdev/empty/collaborators{/collaborator}", issue_comment_url: @@ -2398,8 +1949,7 @@ export const pullRequestReviewSubmitted: EventSpecificationExample = { issues_url: "https://api.github.com/orgs/triggerdotdev/issues", description: "", members_url: "https://api.github.com/orgs/triggerdotdev/members{/member}", - public_members_url: - "https://api.github.com/orgs/triggerdotdev/public_members{/member}", + public_members_url: "https://api.github.com/orgs/triggerdotdev/public_members{/member}", }, pull_request: { id: 1402223044, @@ -2421,26 +1971,18 @@ export const pullRequestReviewSubmitted: EventSpecificationExample = { login: "triggerdotdev", node_id: "O_kgDOBa4fYg", html_url: "https://github.com/triggerdotdev", - gists_url: - "https://api.github.com/users/triggerdotdev/gists{/gist_id}", + gists_url: "https://api.github.com/users/triggerdotdev/gists{/gist_id}", repos_url: "https://api.github.com/users/triggerdotdev/repos", avatar_url: "https://avatars.githubusercontent.com/u/95297378?v=4", - events_url: - "https://api.github.com/users/triggerdotdev/events{/privacy}", + events_url: "https://api.github.com/users/triggerdotdev/events{/privacy}", site_admin: false, gravatar_id: "", - starred_url: - "https://api.github.com/users/triggerdotdev/starred{/owner}{/repo}", - followers_url: - "https://api.github.com/users/triggerdotdev/followers", - following_url: - "https://api.github.com/users/triggerdotdev/following{/other_user}", - organizations_url: - "https://api.github.com/users/triggerdotdev/orgs", - subscriptions_url: - "https://api.github.com/users/triggerdotdev/subscriptions", - received_events_url: - "https://api.github.com/users/triggerdotdev/received_events", + starred_url: "https://api.github.com/users/triggerdotdev/starred{/owner}{/repo}", + followers_url: "https://api.github.com/users/triggerdotdev/followers", + following_url: "https://api.github.com/users/triggerdotdev/following{/other_user}", + organizations_url: "https://api.github.com/users/triggerdotdev/orgs", + subscriptions_url: "https://api.github.com/users/triggerdotdev/subscriptions", + received_events_url: "https://api.github.com/users/triggerdotdev/received_events", }, topics: [], git_url: "git://github.com/triggerdotdev/empty.git", @@ -2454,90 +1996,63 @@ export const pullRequestReviewSubmitted: EventSpecificationExample = { has_wiki: true, homepage: null, html_url: "https://github.com/triggerdotdev/empty", - keys_url: - "https://api.github.com/repos/triggerdotdev/empty/keys{/key_id}", + keys_url: "https://api.github.com/repos/triggerdotdev/empty/keys{/key_id}", language: null, tags_url: "https://api.github.com/repos/triggerdotdev/empty/tags", watchers: 0, - blobs_url: - "https://api.github.com/repos/triggerdotdev/empty/git/blobs{/sha}", + blobs_url: "https://api.github.com/repos/triggerdotdev/empty/git/blobs{/sha}", clone_url: "https://github.com/triggerdotdev/empty.git", forks_url: "https://api.github.com/repos/triggerdotdev/empty/forks", full_name: "triggerdotdev/empty", has_pages: false, hooks_url: "https://api.github.com/repos/triggerdotdev/empty/hooks", - pulls_url: - "https://api.github.com/repos/triggerdotdev/empty/pulls{/number}", + pulls_url: "https://api.github.com/repos/triggerdotdev/empty/pulls{/number}", pushed_at: "2023-06-21T18:39:13Z", teams_url: "https://api.github.com/repos/triggerdotdev/empty/teams", - trees_url: - "https://api.github.com/repos/triggerdotdev/empty/git/trees{/sha}", + trees_url: "https://api.github.com/repos/triggerdotdev/empty/git/trees{/sha}", created_at: "2023-06-21T14:21:07Z", events_url: "https://api.github.com/repos/triggerdotdev/empty/events", has_issues: true, - issues_url: - "https://api.github.com/repos/triggerdotdev/empty/issues{/number}", - labels_url: - "https://api.github.com/repos/triggerdotdev/empty/labels{/name}", + issues_url: "https://api.github.com/repos/triggerdotdev/empty/issues{/number}", + labels_url: "https://api.github.com/repos/triggerdotdev/empty/labels{/name}", merges_url: "https://api.github.com/repos/triggerdotdev/empty/merges", mirror_url: null, updated_at: "2023-06-21T17:23:26Z", visibility: "public", - archive_url: - "https://api.github.com/repos/triggerdotdev/empty/{archive_format}{/ref}", - commits_url: - "https://api.github.com/repos/triggerdotdev/empty/commits{/sha}", - compare_url: - "https://api.github.com/repos/triggerdotdev/empty/compare/{base}...{head}", - description: - "An empty repo that can be used to test the @trigger.dev/github integration", + archive_url: "https://api.github.com/repos/triggerdotdev/empty/{archive_format}{/ref}", + commits_url: "https://api.github.com/repos/triggerdotdev/empty/commits{/sha}", + compare_url: "https://api.github.com/repos/triggerdotdev/empty/compare/{base}...{head}", + description: "An empty repo that can be used to test the @trigger.dev/github integration", forks_count: 0, is_template: false, open_issues: 5, - branches_url: - "https://api.github.com/repos/triggerdotdev/empty/branches{/branch}", - comments_url: - "https://api.github.com/repos/triggerdotdev/empty/comments{/number}", - contents_url: - "https://api.github.com/repos/triggerdotdev/empty/contents/{+path}", - git_refs_url: - "https://api.github.com/repos/triggerdotdev/empty/git/refs{/sha}", - git_tags_url: - "https://api.github.com/repos/triggerdotdev/empty/git/tags{/sha}", + branches_url: "https://api.github.com/repos/triggerdotdev/empty/branches{/branch}", + comments_url: "https://api.github.com/repos/triggerdotdev/empty/comments{/number}", + contents_url: "https://api.github.com/repos/triggerdotdev/empty/contents/{+path}", + git_refs_url: "https://api.github.com/repos/triggerdotdev/empty/git/refs{/sha}", + git_tags_url: "https://api.github.com/repos/triggerdotdev/empty/git/tags{/sha}", has_projects: true, - releases_url: - "https://api.github.com/repos/triggerdotdev/empty/releases{/id}", - statuses_url: - "https://api.github.com/repos/triggerdotdev/empty/statuses/{sha}", + releases_url: "https://api.github.com/repos/triggerdotdev/empty/releases{/id}", + statuses_url: "https://api.github.com/repos/triggerdotdev/empty/statuses/{sha}", allow_forking: true, - assignees_url: - "https://api.github.com/repos/triggerdotdev/empty/assignees{/user}", - downloads_url: - "https://api.github.com/repos/triggerdotdev/empty/downloads", + assignees_url: "https://api.github.com/repos/triggerdotdev/empty/assignees{/user}", + downloads_url: "https://api.github.com/repos/triggerdotdev/empty/downloads", has_downloads: true, - languages_url: - "https://api.github.com/repos/triggerdotdev/empty/languages", + languages_url: "https://api.github.com/repos/triggerdotdev/empty/languages", default_branch: "main", - milestones_url: - "https://api.github.com/repos/triggerdotdev/empty/milestones{/number}", - stargazers_url: - "https://api.github.com/repos/triggerdotdev/empty/stargazers", + milestones_url: "https://api.github.com/repos/triggerdotdev/empty/milestones{/number}", + stargazers_url: "https://api.github.com/repos/triggerdotdev/empty/stargazers", watchers_count: 0, - deployments_url: - "https://api.github.com/repos/triggerdotdev/empty/deployments", - git_commits_url: - "https://api.github.com/repos/triggerdotdev/empty/git/commits{/sha}", + deployments_url: "https://api.github.com/repos/triggerdotdev/empty/deployments", + git_commits_url: "https://api.github.com/repos/triggerdotdev/empty/git/commits{/sha}", has_discussions: false, - subscribers_url: - "https://api.github.com/repos/triggerdotdev/empty/subscribers", + subscribers_url: "https://api.github.com/repos/triggerdotdev/empty/subscribers", allow_auto_merge: false, - contributors_url: - "https://api.github.com/repos/triggerdotdev/empty/contributors", + contributors_url: "https://api.github.com/repos/triggerdotdev/empty/contributors", issue_events_url: "https://api.github.com/repos/triggerdotdev/empty/issues/events{/number}", stargazers_count: 0, - subscription_url: - "https://api.github.com/repos/triggerdotdev/empty/subscription", + subscription_url: "https://api.github.com/repos/triggerdotdev/empty/subscription", collaborators_url: "https://api.github.com/repos/triggerdotdev/empty/collaborators{/collaborator}", issue_comment_url: @@ -2564,24 +2079,18 @@ export const pullRequestReviewSubmitted: EventSpecificationExample = { login: "triggerdotdev", node_id: "O_kgDOBa4fYg", html_url: "https://github.com/triggerdotdev", - gists_url: - "https://api.github.com/users/triggerdotdev/gists{/gist_id}", + gists_url: "https://api.github.com/users/triggerdotdev/gists{/gist_id}", repos_url: "https://api.github.com/users/triggerdotdev/repos", avatar_url: "https://avatars.githubusercontent.com/u/95297378?v=4", - events_url: - "https://api.github.com/users/triggerdotdev/events{/privacy}", + events_url: "https://api.github.com/users/triggerdotdev/events{/privacy}", site_admin: false, gravatar_id: "", - starred_url: - "https://api.github.com/users/triggerdotdev/starred{/owner}{/repo}", + starred_url: "https://api.github.com/users/triggerdotdev/starred{/owner}{/repo}", followers_url: "https://api.github.com/users/triggerdotdev/followers", - following_url: - "https://api.github.com/users/triggerdotdev/following{/other_user}", + following_url: "https://api.github.com/users/triggerdotdev/following{/other_user}", organizations_url: "https://api.github.com/users/triggerdotdev/orgs", - subscriptions_url: - "https://api.github.com/users/triggerdotdev/subscriptions", - received_events_url: - "https://api.github.com/users/triggerdotdev/received_events", + subscriptions_url: "https://api.github.com/users/triggerdotdev/subscriptions", + received_events_url: "https://api.github.com/users/triggerdotdev/received_events", }, label: "triggerdotdev:main", }, @@ -2603,26 +2112,18 @@ export const pullRequestReviewSubmitted: EventSpecificationExample = { login: "triggerdotdev", node_id: "O_kgDOBa4fYg", html_url: "https://github.com/triggerdotdev", - gists_url: - "https://api.github.com/users/triggerdotdev/gists{/gist_id}", + gists_url: "https://api.github.com/users/triggerdotdev/gists{/gist_id}", repos_url: "https://api.github.com/users/triggerdotdev/repos", avatar_url: "https://avatars.githubusercontent.com/u/95297378?v=4", - events_url: - "https://api.github.com/users/triggerdotdev/events{/privacy}", + events_url: "https://api.github.com/users/triggerdotdev/events{/privacy}", site_admin: false, gravatar_id: "", - starred_url: - "https://api.github.com/users/triggerdotdev/starred{/owner}{/repo}", - followers_url: - "https://api.github.com/users/triggerdotdev/followers", - following_url: - "https://api.github.com/users/triggerdotdev/following{/other_user}", - organizations_url: - "https://api.github.com/users/triggerdotdev/orgs", - subscriptions_url: - "https://api.github.com/users/triggerdotdev/subscriptions", - received_events_url: - "https://api.github.com/users/triggerdotdev/received_events", + starred_url: "https://api.github.com/users/triggerdotdev/starred{/owner}{/repo}", + followers_url: "https://api.github.com/users/triggerdotdev/followers", + following_url: "https://api.github.com/users/triggerdotdev/following{/other_user}", + organizations_url: "https://api.github.com/users/triggerdotdev/orgs", + subscriptions_url: "https://api.github.com/users/triggerdotdev/subscriptions", + received_events_url: "https://api.github.com/users/triggerdotdev/received_events", }, topics: [], git_url: "git://github.com/triggerdotdev/empty.git", @@ -2636,90 +2137,63 @@ export const pullRequestReviewSubmitted: EventSpecificationExample = { has_wiki: true, homepage: null, html_url: "https://github.com/triggerdotdev/empty", - keys_url: - "https://api.github.com/repos/triggerdotdev/empty/keys{/key_id}", + keys_url: "https://api.github.com/repos/triggerdotdev/empty/keys{/key_id}", language: null, tags_url: "https://api.github.com/repos/triggerdotdev/empty/tags", watchers: 0, - blobs_url: - "https://api.github.com/repos/triggerdotdev/empty/git/blobs{/sha}", + blobs_url: "https://api.github.com/repos/triggerdotdev/empty/git/blobs{/sha}", clone_url: "https://github.com/triggerdotdev/empty.git", forks_url: "https://api.github.com/repos/triggerdotdev/empty/forks", full_name: "triggerdotdev/empty", has_pages: false, hooks_url: "https://api.github.com/repos/triggerdotdev/empty/hooks", - pulls_url: - "https://api.github.com/repos/triggerdotdev/empty/pulls{/number}", + pulls_url: "https://api.github.com/repos/triggerdotdev/empty/pulls{/number}", pushed_at: "2023-06-21T18:39:13Z", teams_url: "https://api.github.com/repos/triggerdotdev/empty/teams", - trees_url: - "https://api.github.com/repos/triggerdotdev/empty/git/trees{/sha}", + trees_url: "https://api.github.com/repos/triggerdotdev/empty/git/trees{/sha}", created_at: "2023-06-21T14:21:07Z", events_url: "https://api.github.com/repos/triggerdotdev/empty/events", has_issues: true, - issues_url: - "https://api.github.com/repos/triggerdotdev/empty/issues{/number}", - labels_url: - "https://api.github.com/repos/triggerdotdev/empty/labels{/name}", + issues_url: "https://api.github.com/repos/triggerdotdev/empty/issues{/number}", + labels_url: "https://api.github.com/repos/triggerdotdev/empty/labels{/name}", merges_url: "https://api.github.com/repos/triggerdotdev/empty/merges", mirror_url: null, updated_at: "2023-06-21T17:23:26Z", visibility: "public", - archive_url: - "https://api.github.com/repos/triggerdotdev/empty/{archive_format}{/ref}", - commits_url: - "https://api.github.com/repos/triggerdotdev/empty/commits{/sha}", - compare_url: - "https://api.github.com/repos/triggerdotdev/empty/compare/{base}...{head}", - description: - "An empty repo that can be used to test the @trigger.dev/github integration", + archive_url: "https://api.github.com/repos/triggerdotdev/empty/{archive_format}{/ref}", + commits_url: "https://api.github.com/repos/triggerdotdev/empty/commits{/sha}", + compare_url: "https://api.github.com/repos/triggerdotdev/empty/compare/{base}...{head}", + description: "An empty repo that can be used to test the @trigger.dev/github integration", forks_count: 0, is_template: false, open_issues: 5, - branches_url: - "https://api.github.com/repos/triggerdotdev/empty/branches{/branch}", - comments_url: - "https://api.github.com/repos/triggerdotdev/empty/comments{/number}", - contents_url: - "https://api.github.com/repos/triggerdotdev/empty/contents/{+path}", - git_refs_url: - "https://api.github.com/repos/triggerdotdev/empty/git/refs{/sha}", - git_tags_url: - "https://api.github.com/repos/triggerdotdev/empty/git/tags{/sha}", + branches_url: "https://api.github.com/repos/triggerdotdev/empty/branches{/branch}", + comments_url: "https://api.github.com/repos/triggerdotdev/empty/comments{/number}", + contents_url: "https://api.github.com/repos/triggerdotdev/empty/contents/{+path}", + git_refs_url: "https://api.github.com/repos/triggerdotdev/empty/git/refs{/sha}", + git_tags_url: "https://api.github.com/repos/triggerdotdev/empty/git/tags{/sha}", has_projects: true, - releases_url: - "https://api.github.com/repos/triggerdotdev/empty/releases{/id}", - statuses_url: - "https://api.github.com/repos/triggerdotdev/empty/statuses/{sha}", + releases_url: "https://api.github.com/repos/triggerdotdev/empty/releases{/id}", + statuses_url: "https://api.github.com/repos/triggerdotdev/empty/statuses/{sha}", allow_forking: true, - assignees_url: - "https://api.github.com/repos/triggerdotdev/empty/assignees{/user}", - downloads_url: - "https://api.github.com/repos/triggerdotdev/empty/downloads", + assignees_url: "https://api.github.com/repos/triggerdotdev/empty/assignees{/user}", + downloads_url: "https://api.github.com/repos/triggerdotdev/empty/downloads", has_downloads: true, - languages_url: - "https://api.github.com/repos/triggerdotdev/empty/languages", + languages_url: "https://api.github.com/repos/triggerdotdev/empty/languages", default_branch: "main", - milestones_url: - "https://api.github.com/repos/triggerdotdev/empty/milestones{/number}", - stargazers_url: - "https://api.github.com/repos/triggerdotdev/empty/stargazers", + milestones_url: "https://api.github.com/repos/triggerdotdev/empty/milestones{/number}", + stargazers_url: "https://api.github.com/repos/triggerdotdev/empty/stargazers", watchers_count: 0, - deployments_url: - "https://api.github.com/repos/triggerdotdev/empty/deployments", - git_commits_url: - "https://api.github.com/repos/triggerdotdev/empty/git/commits{/sha}", + deployments_url: "https://api.github.com/repos/triggerdotdev/empty/deployments", + git_commits_url: "https://api.github.com/repos/triggerdotdev/empty/git/commits{/sha}", has_discussions: false, - subscribers_url: - "https://api.github.com/repos/triggerdotdev/empty/subscribers", + subscribers_url: "https://api.github.com/repos/triggerdotdev/empty/subscribers", allow_auto_merge: false, - contributors_url: - "https://api.github.com/repos/triggerdotdev/empty/contributors", + contributors_url: "https://api.github.com/repos/triggerdotdev/empty/contributors", issue_events_url: "https://api.github.com/repos/triggerdotdev/empty/issues/events{/number}", stargazers_count: 0, - subscription_url: - "https://api.github.com/repos/triggerdotdev/empty/subscription", + subscription_url: "https://api.github.com/repos/triggerdotdev/empty/subscription", collaborators_url: "https://api.github.com/repos/triggerdotdev/empty/collaborators{/collaborator}", issue_comment_url: @@ -2746,24 +2220,18 @@ export const pullRequestReviewSubmitted: EventSpecificationExample = { login: "triggerdotdev", node_id: "O_kgDOBa4fYg", html_url: "https://github.com/triggerdotdev", - gists_url: - "https://api.github.com/users/triggerdotdev/gists{/gist_id}", + gists_url: "https://api.github.com/users/triggerdotdev/gists{/gist_id}", repos_url: "https://api.github.com/users/triggerdotdev/repos", avatar_url: "https://avatars.githubusercontent.com/u/95297378?v=4", - events_url: - "https://api.github.com/users/triggerdotdev/events{/privacy}", + events_url: "https://api.github.com/users/triggerdotdev/events{/privacy}", site_admin: false, gravatar_id: "", - starred_url: - "https://api.github.com/users/triggerdotdev/starred{/owner}{/repo}", + starred_url: "https://api.github.com/users/triggerdotdev/starred{/owner}{/repo}", followers_url: "https://api.github.com/users/triggerdotdev/followers", - following_url: - "https://api.github.com/users/triggerdotdev/following{/other_user}", + following_url: "https://api.github.com/users/triggerdotdev/following{/other_user}", organizations_url: "https://api.github.com/users/triggerdotdev/orgs", - subscriptions_url: - "https://api.github.com/users/triggerdotdev/subscriptions", - received_events_url: - "https://api.github.com/users/triggerdotdev/received_events", + subscriptions_url: "https://api.github.com/users/triggerdotdev/subscriptions", + received_events_url: "https://api.github.com/users/triggerdotdev/received_events", }, label: "triggerdotdev:test", }, @@ -2780,16 +2248,12 @@ export const pullRequestReviewSubmitted: EventSpecificationExample = { events_url: "https://api.github.com/users/matt-aitken/events{/privacy}", site_admin: false, gravatar_id: "", - starred_url: - "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", + starred_url: "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", followers_url: "https://api.github.com/users/matt-aitken/followers", - following_url: - "https://api.github.com/users/matt-aitken/following{/other_user}", + following_url: "https://api.github.com/users/matt-aitken/following{/other_user}", organizations_url: "https://api.github.com/users/matt-aitken/orgs", - subscriptions_url: - "https://api.github.com/users/matt-aitken/subscriptions", - received_events_url: - "https://api.github.com/users/matt-aitken/received_events", + subscriptions_url: "https://api.github.com/users/matt-aitken/subscriptions", + received_events_url: "https://api.github.com/users/matt-aitken/received_events", }, draft: false, state: "open", @@ -2836,10 +2300,8 @@ export const pullRequestReviewSubmitted: EventSpecificationExample = { auto_merge: null, created_at: "2023-06-21T18:39:13Z", updated_at: "2023-06-21T18:47:47Z", - commits_url: - "https://api.github.com/repos/triggerdotdev/empty/pulls/5/commits", - comments_url: - "https://api.github.com/repos/triggerdotdev/empty/issues/5/comments", + commits_url: "https://api.github.com/repos/triggerdotdev/empty/pulls/5/commits", + comments_url: "https://api.github.com/repos/triggerdotdev/empty/issues/5/comments", statuses_url: "https://api.github.com/repos/triggerdotdev/empty/statuses/073aa42afebca03c4b34361564e3976da5c65d48", requested_teams: [], @@ -2849,8 +2311,7 @@ export const pullRequestReviewSubmitted: EventSpecificationExample = { review_comment_url: "https://api.github.com/repos/triggerdotdev/empty/pulls/comments{/number}", requested_reviewers: [], - review_comments_url: - "https://api.github.com/repos/triggerdotdev/empty/pulls/5/comments", + review_comments_url: "https://api.github.com/repos/triggerdotdev/empty/pulls/5/comments", }, }, }; diff --git a/integrations/github/tsconfig.json b/integrations/github/tsconfig.json index 25fc92894..9616ac98a 100644 --- a/integrations/github/tsconfig.json +++ b/integrations/github/tsconfig.json @@ -6,12 +6,8 @@ "paths": { "@trigger.dev/sdk/*": ["../../packages/trigger-sdk/src/*"], "@trigger.dev/sdk": ["../../packages/trigger-sdk/src/index"], - "@trigger.dev/integration-kit/*": [ - "../../packages/integration-kit/src/*" - ], - "@trigger.dev/integration-kit": [ - "../../packages/integration-kit/src/index" - ] + "@trigger.dev/integration-kit/*": ["../../packages/integration-kit/src/*"], + "@trigger.dev/integration-kit": ["../../packages/integration-kit/src/index"] }, "declaration": false, "declarationMap": false, diff --git a/integrations/openai/package.json b/integrations/openai/package.json index 273654c06..79f8cfa1b 100644 --- a/integrations/openai/package.json +++ b/integrations/openai/package.json @@ -32,4 +32,4 @@ "engines": { "node": ">=16.8.0" } -} \ No newline at end of file +} diff --git a/integrations/openai/src/index.ts b/integrations/openai/src/index.ts index 17bdc0ab9..fc9dd3a50 100644 --- a/integrations/openai/src/index.ts +++ b/integrations/openai/src/index.ts @@ -3,9 +3,7 @@ import { Configuration, OpenAIApi } from "openai"; import * as tasks from "./tasks"; import { OpenAIIntegrationOptions } from "./types"; -export class OpenAI - implements TriggerIntegration> -{ +export class OpenAI implements TriggerIntegration> { client: IntegrationClient; /** diff --git a/integrations/openai/src/taskUtils.ts b/integrations/openai/src/taskUtils.ts index ee3447451..5a0536fd8 100644 --- a/integrations/openai/src/taskUtils.ts +++ b/integrations/openai/src/taskUtils.ts @@ -1,14 +1,8 @@ -import { - CreateCompletionResponseUsage, - CreateEmbeddingResponseUsage, -} from "openai"; +import { CreateCompletionResponseUsage, CreateEmbeddingResponseUsage } from "openai"; import { z } from "zod"; export function createTaskUsageProperties( - usage: - | CreateCompletionResponseUsage - | CreateEmbeddingResponseUsage - | undefined + usage: CreateCompletionResponseUsage | CreateEmbeddingResponseUsage | undefined ) { if (!usage) { return; diff --git a/integrations/openai/src/tasks.ts b/integrations/openai/src/tasks.ts index 8512b8dea..4bc7021ec 100644 --- a/integrations/openai/src/tasks.ts +++ b/integrations/openai/src/tasks.ts @@ -10,11 +10,7 @@ import { } from "openai"; import { OpenAIIntegrationAuth } from "./types"; import { redactString } from "@trigger.dev/sdk"; -import { - Prettify, - fileFromString, - truncate, -} from "@trigger.dev/integration-kit"; +import { Prettify, fileFromString, truncate } from "@trigger.dev/integration-kit"; import { createTaskUsageProperties, onTaskError } from "./taskUtils"; type OpenAIClientType = InstanceType; @@ -51,9 +47,7 @@ export const retrieveModel: AuthenticatedTask< }, }; -type ListModelsResponseData = Awaited< - ReturnType ->["data"]; +type ListModelsResponseData = Awaited>["data"]; export const listModels: AuthenticatedTask< OpenAIClientType, @@ -120,9 +114,7 @@ export const backgroundCreateCompletion: AuthenticatedTask< headers: { "Content-Type": "application/json", Authorization: redactString`Bearer ${auth.apiKey}`, - ...(auth.organization - ? { "OpenAI-Organization": auth.organization } - : {}), + ...(auth.organization ? { "OpenAI-Organization": auth.organization } : {}), }, body: JSON.stringify(params), } @@ -194,9 +186,7 @@ export const backgroundCreateChatCompletion: AuthenticatedTask< headers: { "Content-Type": "application/json", Authorization: redactString`Bearer ${auth.apiKey}`, - ...(auth.organization - ? { "OpenAI-Organization": auth.organization } - : {}), + ...(auth.organization ? { "OpenAI-Organization": auth.organization } : {}), }, body: JSON.stringify(params), }, @@ -239,9 +229,7 @@ export const backgroundCreateChatCompletion: AuthenticatedTask< }, }; -type CreateEditResponseData = Prettify< - Awaited>["data"] ->; +type CreateEditResponseData = Prettify>["data"]>; export const createEdit: AuthenticatedTask< OpenAIClientType, @@ -377,9 +365,7 @@ export const createEmbedding: AuthenticatedTask< }, }; -type CreateFileResponseData = Awaited< - ReturnType ->["data"]; +type CreateFileResponseData = Awaited>["data"]; type CreateFileRequest = { file: string | File; @@ -397,10 +383,7 @@ export const createFile: AuthenticatedTask< let file: File; if (typeof params.file === "string") { - file = (await fileFromString( - params.file, - params.fileName ?? "file.txt" - )) as any; + file = (await fileFromString(params.file, params.fileName ?? "file.txt")) as any; } else { file = params.file; } @@ -426,15 +409,9 @@ export const createFile: AuthenticatedTask< }, }; -type ListFilesResponseData = Prettify< - Awaited>["data"] ->; +type ListFilesResponseData = Prettify>["data"]>; -export const listFiles: AuthenticatedTask< - OpenAIClientType, - void, - ListFilesResponseData -> = { +export const listFiles: AuthenticatedTask = { onError: onTaskError, run: async (params, client) => { return client.listFiles().then((res) => res.data); @@ -534,11 +511,7 @@ type ListFineTunesResponseData = Prettify< Awaited>["data"] >; -export const listFineTunes: AuthenticatedTask< - OpenAIClientType, - void, - ListFineTunesResponseData -> = { +export const listFineTunes: AuthenticatedTask = { onError: onTaskError, run: async (params, client) => { return client.listFineTunes().then((res) => res.data); @@ -624,9 +597,7 @@ export const listFineTuneEvents: AuthenticatedTask< > = { onError: onTaskError, run: async (params, client) => { - return client - .listFineTuneEvents(params.fineTuneId, false) - .then((res) => res.data); + return client.listFineTuneEvents(params.fineTuneId, false).then((res) => res.data); }, init: (params) => { return { diff --git a/integrations/openai/tsconfig.json b/integrations/openai/tsconfig.json index 25fc92894..9616ac98a 100644 --- a/integrations/openai/tsconfig.json +++ b/integrations/openai/tsconfig.json @@ -6,12 +6,8 @@ "paths": { "@trigger.dev/sdk/*": ["../../packages/trigger-sdk/src/*"], "@trigger.dev/sdk": ["../../packages/trigger-sdk/src/index"], - "@trigger.dev/integration-kit/*": [ - "../../packages/integration-kit/src/*" - ], - "@trigger.dev/integration-kit": [ - "../../packages/integration-kit/src/index" - ] + "@trigger.dev/integration-kit/*": ["../../packages/integration-kit/src/*"], + "@trigger.dev/integration-kit": ["../../packages/integration-kit/src/index"] }, "declaration": false, "declarationMap": false, diff --git a/integrations/plain/package.json b/integrations/plain/package.json index 0f173ecaf..5dfb9352d 100644 --- a/integrations/plain/package.json +++ b/integrations/plain/package.json @@ -31,4 +31,4 @@ "engines": { "node": ">=16.8.0" } -} \ No newline at end of file +} diff --git a/integrations/plain/src/tasks.ts b/integrations/plain/src/tasks.ts index 49bc3b46b..53b1f607e 100644 --- a/integrations/plain/src/tasks.ts +++ b/integrations/plain/src/tasks.ts @@ -9,10 +9,7 @@ import { UpsertCustomerParams, UpsertCustomerResponse, } from "./types"; -import { - PlainSDKError, - UpsertCustomTimelineEntryInput, -} from "@team-plain/typescript-sdk"; +import { PlainSDKError, UpsertCustomTimelineEntryInput } from "@team-plain/typescript-sdk"; import { Prettify } from "@trigger.dev/integration-kit/prettify"; function isPlainError(error: unknown): error is PlainSDKError { @@ -26,42 +23,33 @@ function isPlainError(error: unknown): error is PlainSDKError { ); } -const getCustomerById: AuthenticatedTask< - PlainSDK, - GetCustomerByIdParams, - GetCustomerByIdResponse -> = { - run: async (params, client) => { - const response = await client.getCustomerById(params); +const getCustomerById: AuthenticatedTask = + { + run: async (params, client) => { + const response = await client.getCustomerById(params); - if (response.error) { - throw response.error; - } else { - return response.data - ? recursivelyRemoveTypenameProperties(response.data) - : undefined; - } - }, - init: (params) => { - return { - name: "Get Customer By Id", - params, - icon: "plain", - properties: [ - { - label: "Customer ID", - text: params.customerId, - }, - ], - }; - }, -}; + if (response.error) { + throw response.error; + } else { + return response.data ? recursivelyRemoveTypenameProperties(response.data) : undefined; + } + }, + init: (params) => { + return { + name: "Get Customer By Id", + params, + icon: "plain", + properties: [ + { + label: "Customer ID", + text: params.customerId, + }, + ], + }; + }, + }; -const upsertCustomer: AuthenticatedTask< - PlainSDK, - UpsertCustomerParams, - UpsertCustomerResponse -> = { +const upsertCustomer: AuthenticatedTask = { run: async (params, client) => { const response = await client.upsertCustomer(params); diff --git a/integrations/plain/src/types.ts b/integrations/plain/src/types.ts index 3f9359bfb..6b3d8c4b5 100644 --- a/integrations/plain/src/types.ts +++ b/integrations/plain/src/types.ts @@ -20,17 +20,13 @@ export type RemoveTypename = T extends object type ReplaceNullWithUndefined = T extends null ? undefined : T; -export type GetCustomerByIdParams = Prettify< - Parameters[0] ->; +export type GetCustomerByIdParams = Prettify[0]>; export type GetCustomerByIdResponse = GetPlainSuccessResponseData< ReturnType >; -export type UpsertCustomerParams = Prettify< - Parameters[0] ->; +export type UpsertCustomerParams = Prettify[0]>; export type UpsertCustomerResponse = GetPlainSuccessResponseData< ReturnType diff --git a/integrations/plain/tsconfig.json b/integrations/plain/tsconfig.json index 25fc92894..9616ac98a 100644 --- a/integrations/plain/tsconfig.json +++ b/integrations/plain/tsconfig.json @@ -6,12 +6,8 @@ "paths": { "@trigger.dev/sdk/*": ["../../packages/trigger-sdk/src/*"], "@trigger.dev/sdk": ["../../packages/trigger-sdk/src/index"], - "@trigger.dev/integration-kit/*": [ - "../../packages/integration-kit/src/*" - ], - "@trigger.dev/integration-kit": [ - "../../packages/integration-kit/src/index" - ] + "@trigger.dev/integration-kit/*": ["../../packages/integration-kit/src/*"], + "@trigger.dev/integration-kit": ["../../packages/integration-kit/src/index"] }, "declaration": false, "declarationMap": false, diff --git a/integrations/resend/package.json b/integrations/resend/package.json index ef7ac969d..4e1c67c74 100644 --- a/integrations/resend/package.json +++ b/integrations/resend/package.json @@ -31,4 +31,4 @@ "engines": { "node": ">=16.8.0" } -} \ No newline at end of file +} diff --git a/integrations/resend/src/index.ts b/integrations/resend/src/index.ts index 51141a29e..a5e0223a0 100644 --- a/integrations/resend/src/index.ts +++ b/integrations/resend/src/index.ts @@ -3,9 +3,7 @@ import { Resend as ResendClient } from "resend"; import type { AuthenticatedTask } from "@trigger.dev/sdk"; -type SendEmailData = Parameters< - InstanceType["sendEmail"] ->[0]; +type SendEmailData = Parameters["sendEmail"]>[0]; type SendEmailResponse = { id: string }; @@ -18,9 +16,7 @@ export const sendEmail: AuthenticatedTask< return client.sendEmail(params) as Promise; }, init: (params) => { - const subjectProperty = params.subject - ? [{ label: "Subject", text: params.subject }] - : []; + const subjectProperty = params.subject ? [{ label: "Subject", text: params.subject }] : []; return { name: "Send Email", @@ -57,9 +53,7 @@ export type ResendIntegrationOptions = { apiKey: string; }; -export class Resend - implements TriggerIntegration> -{ +export class Resend implements TriggerIntegration> { client: IntegrationClient; constructor(private options: ResendIntegrationOptions) { diff --git a/integrations/resend/tsconfig.json b/integrations/resend/tsconfig.json index 25fc92894..9616ac98a 100644 --- a/integrations/resend/tsconfig.json +++ b/integrations/resend/tsconfig.json @@ -6,12 +6,8 @@ "paths": { "@trigger.dev/sdk/*": ["../../packages/trigger-sdk/src/*"], "@trigger.dev/sdk": ["../../packages/trigger-sdk/src/index"], - "@trigger.dev/integration-kit/*": [ - "../../packages/integration-kit/src/*" - ], - "@trigger.dev/integration-kit": [ - "../../packages/integration-kit/src/index" - ] + "@trigger.dev/integration-kit/*": ["../../packages/integration-kit/src/*"], + "@trigger.dev/integration-kit": ["../../packages/integration-kit/src/index"] }, "declaration": false, "declarationMap": false, diff --git a/integrations/slack/package.json b/integrations/slack/package.json index 7e3bbf646..d07e4daaf 100644 --- a/integrations/slack/package.json +++ b/integrations/slack/package.json @@ -31,4 +31,4 @@ "engines": { "node": ">=16.8.0" } -} \ No newline at end of file +} diff --git a/integrations/slack/src/client.ts b/integrations/slack/src/client.ts index fb02717cb..830dc527e 100644 --- a/integrations/slack/src/client.ts +++ b/integrations/slack/src/client.ts @@ -1,8 +1,6 @@ import { ClientFactory } from "@trigger.dev/sdk"; import { WebClient } from "@slack/web-api"; -export const clientFactory: ClientFactory> = ( - auth -) => { +export const clientFactory: ClientFactory> = (auth) => { return new WebClient(auth.accessToken); }; diff --git a/integrations/slack/src/index.ts b/integrations/slack/src/index.ts index 7e1c8469e..93d270189 100644 --- a/integrations/slack/src/index.ts +++ b/integrations/slack/src/index.ts @@ -11,9 +11,7 @@ export type SlackIntegrationOptions = { id: string; }; -export class Slack - implements TriggerIntegration> -{ +export class Slack implements TriggerIntegration> { client: IntegrationClient; constructor(private options: SlackIntegrationOptions) { diff --git a/integrations/slack/src/tasks.ts b/integrations/slack/src/tasks.ts index 3caf0fd92..fe7dbc831 100644 --- a/integrations/slack/src/tasks.ts +++ b/integrations/slack/src/tasks.ts @@ -97,9 +97,7 @@ export const postMessage: AuthenticatedTask< }, }; -type ConversationsJoinResponse = Awaited< - ReturnType ->; +type ConversationsJoinResponse = Awaited>; export const joinConversation: AuthenticatedTask< SlackClientType, diff --git a/integrations/slack/tsconfig.json b/integrations/slack/tsconfig.json index 1b60e1db5..ce79f2079 100644 --- a/integrations/slack/tsconfig.json +++ b/integrations/slack/tsconfig.json @@ -5,7 +5,7 @@ "lib": ["DOM", "DOM.Iterable", "ES2019"], "paths": { "@trigger.dev/sdk/*": ["../../packages/trigger-sdk/src/*"], - "@trigger.dev/sdk": ["../../packages/trigger-sdk/src/index"], + "@trigger.dev/sdk": ["../../packages/trigger-sdk/src/index"] }, "declaration": false, "declarationMap": false, diff --git a/integrations/stripe/README.md b/integrations/stripe/README.md index 4ee200fb9..99110b8d9 100644 --- a/integrations/stripe/README.md +++ b/integrations/stripe/README.md @@ -1,3 +1 @@ - # @trigger.dev/stripe - \ No newline at end of file diff --git a/integrations/stripe/package.json b/integrations/stripe/package.json index 5aefc78c4..16c3e1b17 100644 --- a/integrations/stripe/package.json +++ b/integrations/stripe/package.json @@ -34,4 +34,4 @@ "engines": { "node": ">=16.8.0" } -} \ No newline at end of file +} diff --git a/integrations/stripe/src/events.ts b/integrations/stripe/src/events.ts index 923752201..8a8fea6c1 100644 --- a/integrations/stripe/src/events.ts +++ b/integrations/stripe/src/events.ts @@ -6,12 +6,7 @@ import { pausedSubscriptionExample, updatedSubscriptionExample, } from "./examples"; -import { - OnCheckoutSession, - OnCustomerSubscription, - OnPriceEvent, - OnProductEvent, -} from "./types"; +import { OnCheckoutSession, OnCustomerSubscription, OnPriceEvent, OnProductEvent } from "./types"; export const onPriceCreated: EventSpecification = { name: "price.created", @@ -255,16 +250,15 @@ export const onProductDeleted: EventSpecification = { runProperties: (payload) => [{ label: "Product ID", text: payload.id }], }; -export const onCheckoutSessionCompleted: EventSpecification = - { - name: "checkout.session.completed", - title: "On Checkout Session Completed", - source: "stripe.com", - icon: "stripe", - examples: [checkoutSessionExample], - parsePayload: (payload) => payload as OnCheckoutSession, - runProperties: (payload) => [{ label: "Session ID", text: payload.id }], - }; +export const onCheckoutSessionCompleted: EventSpecification = { + name: "checkout.session.completed", + title: "On Checkout Session Completed", + source: "stripe.com", + icon: "stripe", + examples: [checkoutSessionExample], + parsePayload: (payload) => payload as OnCheckoutSession, + runProperties: (payload) => [{ label: "Session ID", text: payload.id }], +}; export const onCheckoutSessionExpired: EventSpecification = { name: "checkout.session.expired", @@ -276,72 +270,67 @@ export const onCheckoutSessionExpired: EventSpecification = { runProperties: (payload) => [{ label: "Session ID", text: payload.id }], }; -export const onCustomerSubscriptionCreated: EventSpecification = - { - name: "customer.subscription.created", - title: "On Customer Subscription Created", - source: "stripe.com", - icon: "stripe", - examples: [customerSubscriptionExample], - parsePayload: (payload) => payload as OnCustomerSubscription, - runProperties: (payload) => [ - { label: "Subscription ID", text: payload.id }, - { label: "Status", text: payload.status }, - ], - }; +export const onCustomerSubscriptionCreated: EventSpecification = { + name: "customer.subscription.created", + title: "On Customer Subscription Created", + source: "stripe.com", + icon: "stripe", + examples: [customerSubscriptionExample], + parsePayload: (payload) => payload as OnCustomerSubscription, + runProperties: (payload) => [ + { label: "Subscription ID", text: payload.id }, + { label: "Status", text: payload.status }, + ], +}; -export const onCustomerSubscriptionPaused: EventSpecification = - { - name: "customer.subscription.paused", - title: "On Customer Subscription Paused", - source: "stripe.com", - icon: "stripe", - examples: [pausedSubscriptionExample], - parsePayload: (payload) => payload as OnCustomerSubscription, - runProperties: (payload) => [ - { label: "Subscription ID", text: payload.id }, - { label: "Status", text: payload.status }, - ], - }; +export const onCustomerSubscriptionPaused: EventSpecification = { + name: "customer.subscription.paused", + title: "On Customer Subscription Paused", + source: "stripe.com", + icon: "stripe", + examples: [pausedSubscriptionExample], + parsePayload: (payload) => payload as OnCustomerSubscription, + runProperties: (payload) => [ + { label: "Subscription ID", text: payload.id }, + { label: "Status", text: payload.status }, + ], +}; -export const onCustomerSubscriptionResumed: EventSpecification = - { - name: "customer.subscription.resumed", - title: "On Customer Subscription Resumed", - source: "stripe.com", - icon: "stripe", - examples: [customerSubscriptionExample], - parsePayload: (payload) => payload as OnCustomerSubscription, - runProperties: (payload) => [ - { label: "Subscription ID", text: payload.id }, - { label: "Status", text: payload.status }, - ], - }; +export const onCustomerSubscriptionResumed: EventSpecification = { + name: "customer.subscription.resumed", + title: "On Customer Subscription Resumed", + source: "stripe.com", + icon: "stripe", + examples: [customerSubscriptionExample], + parsePayload: (payload) => payload as OnCustomerSubscription, + runProperties: (payload) => [ + { label: "Subscription ID", text: payload.id }, + { label: "Status", text: payload.status }, + ], +}; -export const onCustomerSubscriptionDeleted: EventSpecification = - { - name: "customer.subscription.deleted", - title: "On Customer Subscription Deleted", - source: "stripe.com", - icon: "stripe", - examples: [cancelledSubscriptionExample], - parsePayload: (payload) => payload as OnCustomerSubscription, - runProperties: (payload) => [ - { label: "Subscription ID", text: payload.id }, - { label: "Status", text: payload.status }, - ], - }; +export const onCustomerSubscriptionDeleted: EventSpecification = { + name: "customer.subscription.deleted", + title: "On Customer Subscription Deleted", + source: "stripe.com", + icon: "stripe", + examples: [cancelledSubscriptionExample], + parsePayload: (payload) => payload as OnCustomerSubscription, + runProperties: (payload) => [ + { label: "Subscription ID", text: payload.id }, + { label: "Status", text: payload.status }, + ], +}; -export const onCustomerSubscriptionUpdated: EventSpecification = - { - name: "customer.subscription.updated", - title: "On Customer Subscription Deleted", - source: "stripe.com", - icon: "stripe", - examples: [updatedSubscriptionExample], - parsePayload: (payload) => payload as OnCustomerSubscription, - runProperties: (payload) => [ - { label: "Subscription ID", text: payload.id }, - { label: "Status", text: payload.status }, - ], - }; +export const onCustomerSubscriptionUpdated: EventSpecification = { + name: "customer.subscription.updated", + title: "On Customer Subscription Deleted", + source: "stripe.com", + icon: "stripe", + examples: [updatedSubscriptionExample], + parsePayload: (payload) => payload as OnCustomerSubscription, + runProperties: (payload) => [ + { label: "Subscription ID", text: payload.id }, + { label: "Status", text: payload.status }, + ], +}; diff --git a/integrations/stripe/src/index.ts b/integrations/stripe/src/index.ts index 81e9bdfa9..bc416a678 100644 --- a/integrations/stripe/src/index.ts +++ b/integrations/stripe/src/index.ts @@ -8,11 +8,7 @@ import { type Logger, type TriggerIntegration, } from "@trigger.dev/sdk"; -import type { - StripeSDK, - StripeIntegrationOptions, - WebhookEvents, -} from "./types"; +import type { StripeSDK, StripeIntegrationOptions, WebhookEvents } from "./types"; import * as tasks from "./tasks"; import z from "zod"; @@ -83,66 +79,42 @@ export class Stripe implements StripeIntegration { * Occurs whenever a price is created. */ onPriceCreated(params?: TriggerParams) { - return createTrigger( - this.source, - events.onPriceCreated, - params ?? { connect: false } - ); + return createTrigger(this.source, events.onPriceCreated, params ?? { connect: false }); } /** * Occurs whenever a price is updated. */ onPriceUpdated(params?: TriggerParams) { - return createTrigger( - this.source, - events.onPriceUpdated, - params ?? { connect: false } - ); + return createTrigger(this.source, events.onPriceUpdated, params ?? { connect: false }); } /** * Occurs whenever a price is deleted. */ onPriceDeleted(params?: TriggerParams) { - return createTrigger( - this.source, - events.onPriceDeleted, - params ?? { connect: false } - ); + return createTrigger(this.source, events.onPriceDeleted, params ?? { connect: false }); } /** * Occurs whenever a product is created. */ onProductCreated(params?: TriggerParams) { - return createTrigger( - this.source, - events.onProductCreated, - params ?? { connect: false } - ); + return createTrigger(this.source, events.onProductCreated, params ?? { connect: false }); } /** * Occurs whenever a product is updated. */ onProductUpdated(params?: TriggerParams) { - return createTrigger( - this.source, - events.onProductUpdated, - params ?? { connect: false } - ); + return createTrigger(this.source, events.onProductUpdated, params ?? { connect: false }); } /** * Occurs whenever a product is deleted. */ onProductDeleted(params?: TriggerParams) { - return createTrigger( - this.source, - events.onProductDeleted, - params ?? { connect: false } - ); + return createTrigger(this.source, events.onProductDeleted, params ?? { connect: false }); } /** @@ -230,11 +202,10 @@ export type TriggerParams = { type StripeEvents = (typeof events)[keyof typeof events]; -type CreateTriggersResult = - ExternalSourceTrigger< - TEventSpecification, - ReturnType - >; +type CreateTriggersResult = ExternalSourceTrigger< + TEventSpecification, + ReturnType +>; function createTrigger( source: ReturnType, @@ -282,14 +253,11 @@ function createWebhookEventSource( if (httpSource.active && webhookData.success) { if (missingEvents.length === 0) return; - const updatedWebhook = await io.integration.updateWebhook( - "update-webhook", - { - id: webhookData.data.id, - url: httpSource.url, - enabled_events: allEvents as unknown as WebhookEvents[], - } - ); + const updatedWebhook = await io.integration.updateWebhook("update-webhook", { + id: webhookData.data.id, + url: httpSource.url, + enabled_events: allEvents as unknown as WebhookEvents[], + }); return { data: WebhookDataSchema.parse(updatedWebhook), @@ -301,20 +269,15 @@ function createWebhookEventSource( limit: 100, }); - const existingWebhook = listResponse.data.find( - (w) => w.url === httpSource.url - ); + const existingWebhook = listResponse.data.find((w) => w.url === httpSource.url); if (existingWebhook) { - const updatedWebhook = await io.integration.updateWebhook( - "update-found-webhook", - { - id: existingWebhook.id, - url: httpSource.url, - enabled_events: allEvents as unknown as WebhookEvents[], - disabled: false, - } - ); + const updatedWebhook = await io.integration.updateWebhook("update-found-webhook", { + id: existingWebhook.id, + url: httpSource.url, + enabled_events: allEvents as unknown as WebhookEvents[], + disabled: false, + }); return { data: WebhookDataSchema.parse(updatedWebhook), @@ -356,11 +319,7 @@ async function webhookHandler(event: HandlerEvent<"HTTP">, logger: Logger) { const stripeClient = new StripeClient("", { apiVersion: "2022-11-15" }); try { - const event = stripeClient.webhooks.constructEvent( - rawBody, - signature, - source.secret - ); + const event = stripeClient.webhooks.constructEvent(rawBody, signature, source.secret); return { events: [ @@ -381,16 +340,11 @@ async function webhookHandler(event: HandlerEvent<"HTTP">, logger: Logger) { }; } catch (error) { if (error instanceof Error) { - logger.error( - "[@trigger.dev/stripe] Error while validating webhook signature", - { - error: { name: error.name, message: error.message }, - } - ); + logger.error("[@trigger.dev/stripe] Error while validating webhook signature", { + error: { name: error.name, message: error.message }, + }); } else { - logger.error( - "[@trigger.dev/stripe] Unknown Error while validating webhook signature" - ); + logger.error("[@trigger.dev/stripe] Unknown Error while validating webhook signature"); } return { events: [] }; diff --git a/integrations/stripe/src/tasks.ts b/integrations/stripe/src/tasks.ts index 4a85c1022..1c5cb3bdd 100644 --- a/integrations/stripe/src/tasks.ts +++ b/integrations/stripe/src/tasks.ts @@ -21,71 +21,68 @@ import { AuthenticatedTask } from "@trigger.dev/sdk"; import { Stripe } from "stripe"; import { omit } from "./utils"; -export const createCharge: AuthenticatedTask< - StripeSDK, - CreateChargeParams, - CreateChargeResponse -> = { - onError: (error) => { - if (error instanceof Stripe.errors.StripeError) { - console.log("Stripe error", error); - } +export const createCharge: AuthenticatedTask = + { + onError: (error) => { + if (error instanceof Stripe.errors.StripeError) { + console.log("Stripe error", error); + } - throw error; - }, - run: async (params, client, task) => { - const response = await client.charges.create(params, { - idempotencyKey: task.idempotencyKey, - stripeAccount: params.stripeAccount, - }); + throw error; + }, + run: async (params, client, task) => { + const response = await client.charges.create(params, { + idempotencyKey: task.idempotencyKey, + stripeAccount: params.stripeAccount, + }); - task.outputProperties = [ - { - label: "Charge ID", - text: response.id, - }, - ...(response.lastResponse.requestId - ? [ - { - label: "Request ID", - text: response.lastResponse.requestId, - }, - ] - : []), - ]; - - return response; - }, - init: (params) => { - return { - name: "Create Charge", - params, - icon: "stripe", - properties: [ + task.outputProperties = [ { - label: "Amount", - text: `${params.amount}`, + label: "Charge ID", + text: response.id, }, - ...(params.currency + ...(response.lastResponse.requestId ? [ { - label: "Currency", - text: params.currency, + label: "Request ID", + text: response.lastResponse.requestId, }, ] : []), - ...(params.stripeAccount - ? [ - { - label: "Stripe Account", - text: params.stripeAccount, - }, - ] - : []), - ], - }; - }, -}; + ]; + + return response; + }, + init: (params) => { + return { + name: "Create Charge", + params, + icon: "stripe", + properties: [ + { + label: "Amount", + text: `${params.amount}`, + }, + ...(params.currency + ? [ + { + label: "Currency", + text: params.currency, + }, + ] + : []), + ...(params.stripeAccount + ? [ + { + label: "Stripe Account", + text: params.stripeAccount, + }, + ] + : []), + ], + }; + }, + }; export const createCustomer: AuthenticatedTask< StripeSDK, @@ -140,14 +137,10 @@ export const updateCustomer: AuthenticatedTask< UpdateCustomerResponse > = { run: async (params, client, task) => { - const response = await client.customers.update( - params.id, - omit(params, "id"), - { - idempotencyKey: task.idempotencyKey, - stripeAccount: params.stripeAccount, - } - ); + const response = await client.customers.update(params.id, omit(params, "id"), { + idempotencyKey: task.idempotencyKey, + stripeAccount: params.stripeAccount, + }); task.outputProperties = [ ...(response.lastResponse.requestId @@ -191,13 +184,9 @@ export const retrieveSubscription: AuthenticatedTask< RetrieveSubscriptionResponse > = { run: async (params, client, task) => { - const response = await client.subscriptions.retrieve( - params.id, - omit(params, "id"), - { - stripeAccount: params.stripeAccount, - } - ); + const response = await client.subscriptions.retrieve(params.id, omit(params, "id"), { + stripeAccount: params.stripeAccount, + }); return response; }, @@ -313,13 +302,9 @@ export const updateWebhook: AuthenticatedTask< UpdateWebhookResponse > = { run: async (params, client, task) => { - const response = await client.webhookEndpoints.update( - params.id, - omit(params, "id"), - { - idempotencyKey: task.idempotencyKey, - } - ); + const response = await client.webhookEndpoints.update(params.id, omit(params, "id"), { + idempotencyKey: task.idempotencyKey, + }); task.outputProperties = [ ...(response.lastResponse.requestId @@ -349,21 +334,18 @@ export const updateWebhook: AuthenticatedTask< }, }; -export const listWebhooks: AuthenticatedTask< - StripeSDK, - ListWebhooksParams, - ListWebhooksResponse -> = { - run: async (params, client, task) => { - const response = await client.webhookEndpoints.list(params); +export const listWebhooks: AuthenticatedTask = + { + run: async (params, client, task) => { + const response = await client.webhookEndpoints.list(params); - return response; - }, - init: (params) => { - return { - name: "List Webhooks", - params, - icon: "stripe", - }; - }, -}; + return response; + }, + init: (params) => { + return { + name: "List Webhooks", + params, + icon: "stripe", + }; + }, + }; diff --git a/integrations/stripe/src/types.ts b/integrations/stripe/src/types.ts index 60dc018dc..0911c77b7 100644 --- a/integrations/stripe/src/types.ts +++ b/integrations/stripe/src/types.ts @@ -18,14 +18,10 @@ type WithStripeConnectOptions = T & { stripeAccount?: string; }; -export type CreateChargeParams = Prettify< - WithStripeConnectOptions ->; +export type CreateChargeParams = Prettify>; export type CreateChargeResponse = Prettify>; -export type CreateCustomerParams = Prettify< - WithStripeConnectOptions ->; +export type CreateCustomerParams = Prettify>; export type CreateCustomerResponse = Prettify>; @@ -39,32 +35,23 @@ export type RetrieveSubscriptionParams = Prettify< WithStripeConnectOptions >; -export type RetrieveSubscriptionResponse = Prettify< - Stripe.Response ->; +export type RetrieveSubscriptionResponse = Prettify>; export type CreateCheckoutSessionParams = Prettify< WithStripeConnectOptions >; -export type CreateCheckoutSessionResponse = Prettify< - Stripe.Response ->; +export type CreateCheckoutSessionResponse = Prettify>; export type CreateWebhookParams = Prettify; export type CreateWebhookResponse = Prettify; -export type UpdateWebhookParams = Prettify< - Stripe.WebhookEndpointUpdateParams & { id: string } ->; +export type UpdateWebhookParams = Prettify; export type UpdateWebhookResponse = Prettify; -export type WebhookEvents = Exclude< - Stripe.WebhookEndpointUpdateParams.EnabledEvent, - "*" ->; +export type WebhookEvents = Exclude; export type ListWebhooksParams = Prettify; @@ -72,15 +59,11 @@ export type ListWebhooksResponse = Prettify< Stripe.Response> >; -type ExtractWebhookPayload = Prettify< - T["data"]["object"] ->; +type ExtractWebhookPayload = Prettify; -export type OnPriceEvent = - ExtractWebhookPayload; +export type OnPriceEvent = ExtractWebhookPayload; -export type OnProductEvent = - ExtractWebhookPayload; +export type OnProductEvent = ExtractWebhookPayload; export type OnCheckoutSession = ExtractWebhookPayload; diff --git a/integrations/stripe/tsconfig.json b/integrations/stripe/tsconfig.json index ba8877255..20a53815e 100644 --- a/integrations/stripe/tsconfig.json +++ b/integrations/stripe/tsconfig.json @@ -17,17 +17,10 @@ "emitDecoratorMetadata": true, "sourceMap": true, "resolveJsonModule": true, - "lib": [ - "es2019" - ], + "lib": ["es2019"], "module": "commonjs", "target": "es2021" }, - "include": [ - "./src/**/*.ts", - "tsup.config.ts" - ], - "exclude": [ - "node_modules" - ] -} \ No newline at end of file + "include": ["./src/**/*.ts", "tsup.config.ts"], + "exclude": ["node_modules"] +} diff --git a/integrations/stripe/tsup.config.ts b/integrations/stripe/tsup.config.ts index 0869b2148..483aba1d5 100644 --- a/integrations/stripe/tsup.config.ts +++ b/integrations/stripe/tsup.config.ts @@ -1,4 +1,3 @@ - import { defineConfig } from "tsup"; export default defineConfig([ @@ -21,4 +20,3 @@ export default defineConfig([ external: ["http", "https", "util", "events", "tty", "os", "timers"], }, ]); - diff --git a/integrations/supabase/package.json b/integrations/supabase/package.json index 2d85270ed..cbfffc83f 100644 --- a/integrations/supabase/package.json +++ b/integrations/supabase/package.json @@ -34,4 +34,4 @@ "engines": { "node": ">=18.0.0" } -} \ No newline at end of file +} diff --git a/integrations/supabase/src/database/index.ts b/integrations/supabase/src/database/index.ts index a80274053..b8fbe06cb 100644 --- a/integrations/supabase/src/database/index.ts +++ b/integrations/supabase/src/database/index.ts @@ -1,8 +1,4 @@ -import { - SupabaseClient, - SupabaseClientOptions, - createClient, -} from "@supabase/supabase-js"; +import { SupabaseClient, SupabaseClientOptions, createClient } from "@supabase/supabase-js"; import { IntegrationClient, TriggerIntegration } from "@trigger.dev/sdk"; import { GenericSchema } from "./types"; @@ -48,19 +44,13 @@ export class Supabase< : string & keyof Database, Schema extends GenericSchema = Database[SchemaName] extends GenericSchema ? Database[SchemaName] - : any + : any, > implements TriggerIntegration< - IntegrationClient< - SupabaseClient, - typeof tasks - > + IntegrationClient, typeof tasks> > { - client: IntegrationClient< - SupabaseClient, - typeof tasks - >; + client: IntegrationClient, typeof tasks>; /** * The native Supabase client. This is exposed for use outside of Trigger.dev jobs @@ -85,9 +75,7 @@ export class Supabase< const supabaseOptions = options.options || {}; const supabaseUrl = - "projectId" in options - ? `https://${options.projectId}.supabase.co` - : options.supabaseUrl; + "projectId" in options ? `https://${options.projectId}.supabase.co` : options.supabaseUrl; this.native = createClient(supabaseUrl, options.supabaseKey, { ...supabaseOptions, diff --git a/integrations/supabase/src/management/index.ts b/integrations/supabase/src/management/index.ts index a203f9c67..35efe0f9e 100644 --- a/integrations/supabase/src/management/index.ts +++ b/integrations/supabase/src/management/index.ts @@ -24,12 +24,8 @@ export type SupabaseManagementIntegrationOptions = apiKey: string; }; -type SupabaseManagementIntegrationClient = IntegrationClient< - SupabaseManagementAPI, - typeof tasks ->; -type SupabaseManagementIntegration = - TriggerIntegration; +type SupabaseManagementIntegrationClient = IntegrationClient; +type SupabaseManagementIntegration = TriggerIntegration; class SupabaseDatabase { constructor( @@ -44,9 +40,8 @@ class SupabaseDatabase { Schema extends GenericSchema = Database[SchemaName] extends GenericSchema ? Database[SchemaName] : any, - TTableName extends string & keyof Schema["Tables"] = string & - keyof Schema["Tables"], - TTable extends Schema["Tables"][TTableName] = Schema["Tables"][TTableName] + TTableName extends string & keyof Schema["Tables"] = string & keyof Schema["Tables"], + TTable extends Schema["Tables"][TTableName] = Schema["Tables"][TTableName], >(params: { table: TTableName; schema?: SchemaName; filter?: EventFilter }) { return createTrigger<{ table: TTableName; @@ -68,9 +63,8 @@ class SupabaseDatabase { Schema extends GenericSchema = Database[SchemaName] extends GenericSchema ? Database[SchemaName] : any, - TTableName extends string & keyof Schema["Tables"] = string & - keyof Schema["Tables"], - TTable extends Schema["Tables"][TTableName] = Schema["Tables"][TTableName] + TTableName extends string & keyof Schema["Tables"] = string & keyof Schema["Tables"], + TTable extends Schema["Tables"][TTableName] = Schema["Tables"][TTableName], >(params: { table: TTableName; schema?: SchemaName; filter?: EventFilter }) { return createTrigger<{ table: TTableName; @@ -92,9 +86,8 @@ class SupabaseDatabase { Schema extends GenericSchema = Database[SchemaName] extends GenericSchema ? Database[SchemaName] : any, - TTableName extends string & keyof Schema["Tables"] = string & - keyof Schema["Tables"], - TTable extends Schema["Tables"][TTableName] = Schema["Tables"][TTableName] + TTableName extends string & keyof Schema["Tables"] = string & keyof Schema["Tables"], + TTable extends Schema["Tables"][TTableName] = Schema["Tables"][TTableName], >(params: { table: TTableName; schema?: SchemaName; filter?: EventFilter }) { return createTrigger<{ table: TTableName; @@ -267,10 +260,7 @@ export function createWebhookEventSource( if (httpSource.active && webhookData.success) { const { triggerName, table, schema } = webhookData.data; - const allEvents = new Set([ - ...events, - ...missingEvents, - ]) as Set; + const allEvents = new Set([...events, ...missingEvents]) as Set; const condition = createTriggerCondition(Array.from(allEvents)); @@ -363,9 +353,7 @@ function createTriggerCondition(events: WebhookEvents[]): string { } async function webhookHandler(event: HandlerEvent<"HTTP">, logger: Logger) { - logger.debug( - "[inside supabase management integration] Handling webhook handler" - ); + logger.debug("[inside supabase management integration] Handling webhook handler"); const { rawEvent: request, source } = event; @@ -379,9 +367,7 @@ async function webhookHandler(event: HandlerEvent<"HTTP">, logger: Logger) { const authHeader = request.headers.get("Authorization"); if (!authHeader) { - logger.debug( - "[inside supabase management integration] No Authorization header found" - ); + logger.debug("[inside supabase management integration] No Authorization header found"); return { events: [] }; } diff --git a/integrations/supabase/src/management/tasks.ts b/integrations/supabase/src/management/tasks.ts index ed15c3f74..9bb627303 100644 --- a/integrations/supabase/src/management/tasks.ts +++ b/integrations/supabase/src/management/tasks.ts @@ -29,22 +29,19 @@ export const getOrganizations: AuthenticatedTask< }, }; -export const getProjects: AuthenticatedTask< - SupabaseManagementAPI, - void, - GetProjectsResponseData -> = { - run: async (params, client) => { - return client.getProjects(); - }, - init: (params) => { - return { - name: "Get Projects", - params, - icon: "supabase", - }; - }, -}; +export const getProjects: AuthenticatedTask = + { + run: async (params, client) => { + return client.getProjects(); + }, + init: (params) => { + return { + name: "Get Projects", + params, + icon: "supabase", + }; + }, + }; export const createProject: AuthenticatedTask< SupabaseManagementAPI, diff --git a/integrations/typeform/package.json b/integrations/typeform/package.json index f0ea49f69..483579554 100644 --- a/integrations/typeform/package.json +++ b/integrations/typeform/package.json @@ -33,4 +33,4 @@ "engines": { "node": ">=16.8.0" } -} \ No newline at end of file +} diff --git a/integrations/typeform/src/index.ts b/integrations/typeform/src/index.ts index 42a55bcba..f5574c963 100644 --- a/integrations/typeform/src/index.ts +++ b/integrations/typeform/src/index.ts @@ -81,9 +81,7 @@ const onFormResponse: EventSpecification = { icon: "typeform", examples: [formResponseExample], parsePayload: (payload) => payload as FormResponseEvent, - runProperties: (payload) => [ - { label: "Form ID", text: payload.form_response.form_id }, - ], + runProperties: (payload) => [{ label: "Form ID", text: payload.form_response.form_id }], }; export const events = { @@ -92,16 +90,11 @@ export const events = { type TypeformEvents = (typeof events)[keyof typeof events]; -type CreateTypeformTriggerReturnType = < - TEventSpecification extends TypeformEvents ->(args: { +type CreateTypeformTriggerReturnType = (args: { event: TEventSpecification; uid: string; tag: string; -}) => ExternalSourceTrigger< - TEventSpecification, - ReturnType ->; +}) => ExternalSourceTrigger>; function createWebhookEventTrigger( source: ReturnType @@ -156,23 +149,16 @@ export function createWebhookEventSource( register: async (event, io, ctx) => { const { params, source: httpSource } = event; - if ( - httpSource.active && - isWebhookData(httpSource.data) && - !httpSource.data.enabled - ) { + if (httpSource.active && isWebhookData(httpSource.data) && !httpSource.data.enabled) { // Update the webhook to re-enable it - const newWebhookData = await io.integration.updateWebhook( - "update-webhook", - { - uid: params.uid, - tag: params.tag, - url: httpSource.url, - enabled: true, - secret: httpSource.secret, - verifySSL: true, - } - ); + const newWebhookData = await io.integration.updateWebhook("update-webhook", { + uid: params.uid, + tag: params.tag, + url: httpSource.url, + enabled: true, + secret: httpSource.secret, + verifySSL: true, + }); return { data: newWebhookData, @@ -181,17 +167,14 @@ export function createWebhookEventSource( } const createWebhook = async () => { - const newWebhookData = await io.integration.createWebhook( - "create-webhook", - { - uid: params.uid, - tag: params.tag, - url: httpSource.url, - enabled: true, - secret: httpSource.secret, - verifySSL: true, - } - ); + const newWebhookData = await io.integration.createWebhook("create-webhook", { + uid: params.uid, + tag: params.tag, + url: httpSource.url, + enabled: true, + secret: httpSource.secret, + verifySSL: true, + }); return { data: newWebhookData, @@ -200,10 +183,7 @@ export function createWebhookEventSource( }; try { - const existingWebhook = await io.integration.getWebhook( - "get-webhook", - params - ); + const existingWebhook = await io.integration.getWebhook("get-webhook", params); if (existingWebhook.url !== httpSource.url) { return createWebhook(); @@ -216,17 +196,14 @@ export function createWebhookEventSource( }; } - const newWebhookData = await io.integration.updateWebhook( - "update-webhook", - { - uid: params.uid, - tag: params.tag, - url: httpSource.url, - enabled: true, - secret: httpSource.secret, - verifySSL: true, - } - ); + const newWebhookData = await io.integration.updateWebhook("update-webhook", { + uid: params.uid, + tag: params.tag, + url: httpSource.url, + enabled: true, + secret: httpSource.secret, + verifySSL: true, + }); return { data: newWebhookData, @@ -240,9 +217,7 @@ export function createWebhookEventSource( } async function webhookHandler(event: HandlerEvent<"HTTP">, logger: Logger) { - logger.debug( - "[inside typeform integration] Handling typeform webhook handler" - ); + logger.debug("[inside typeform integration] Handling typeform webhook handler"); const { rawEvent: request, source } = event; @@ -262,16 +237,12 @@ async function webhookHandler(event: HandlerEvent<"HTTP">, logger: Logger) { return { events: [] }; } - const hash = createHmac("sha256", source.secret) - .update(rawBody) - .digest("base64"); + const hash = createHmac("sha256", source.secret).update(rawBody).digest("base64"); const actualSig = `sha256=${hash}`; if (signature !== actualSig) { - logger.debug( - "[inside typeform integration] Signature does not match, ignoring" - ); + logger.debug("[inside typeform integration] Signature does not match, ignoring"); return { events: [] }; } @@ -292,7 +263,5 @@ async function webhookHandler(event: HandlerEvent<"HTTP">, logger: Logger) { } function isWebhookData(data: any): data is GetWebhookResponse { - return ( - typeof data === "object" && data !== null && typeof data.id === "string" - ); + return typeof data === "object" && data !== null && typeof data.id === "string"; } diff --git a/integrations/typeform/src/payload-examples.ts b/integrations/typeform/src/payload-examples.ts index 159fd9e86..e39c05473 100644 --- a/integrations/typeform/src/payload-examples.ts +++ b/integrations/typeform/src/payload-examples.ts @@ -69,8 +69,7 @@ export const formResponseExample: EventSpecificationExample = { }, { id: "PNe8ZKBK8C2Q", - title: - "Which pictures do you like? You can choose as many as you like.", + title: "Which pictures do you like? You can choose as many as you like.", type: "picture_choice", ref: "readable_ref_picture_choice", allow_multiple_selections: true, diff --git a/integrations/typeform/src/tasks.ts b/integrations/typeform/src/tasks.ts index 6a7a71d84..d462fe58c 100644 --- a/integrations/typeform/src/tasks.ts +++ b/integrations/typeform/src/tasks.ts @@ -19,11 +19,7 @@ import type { UpdateWebhookParams, } from "./types"; -export const listForms: AuthenticatedTask< - TypeformSDK, - ListFormsParams, - Typeform.API.Forms.List -> = { +export const listForms: AuthenticatedTask = { run: async (params, client) => { return client.forms.list(params ?? {}); }, @@ -33,24 +29,16 @@ export const listForms: AuthenticatedTask< params, icon: "typeform", properties: [ - ...(params?.workspaceId - ? [{ label: "Workspace ID", text: params.workspaceId }] - : []), + ...(params?.workspaceId ? [{ label: "Workspace ID", text: params.workspaceId }] : []), ...(params?.search ? [{ label: "Search", text: params.search }] : []), ...(params?.page ? [{ label: "Page", text: String(params.page) }] : []), - ...(params?.pageSize - ? [{ label: "Page Size", text: String(params.pageSize) }] - : []), + ...(params?.pageSize ? [{ label: "Page Size", text: String(params.pageSize) }] : []), ], }; }, }; -export const getForm: AuthenticatedTask< - TypeformSDK, - GetFormParams, - GetFormResponse -> = { +export const getForm: AuthenticatedTask = { run: async (params, client) => { return client.forms.get(params); }, @@ -226,11 +214,7 @@ export const updateWebhook: AuthenticatedTask< }, }; -export const getWebhook: AuthenticatedTask< - TypeformSDK, - GetWebhookParams, - GetWebhookResponse -> = { +export const getWebhook: AuthenticatedTask = { run: async (params, client) => { return client.webhooks.get(params); }, diff --git a/integrations/typeform/src/types.ts b/integrations/typeform/src/types.ts index e350e9487..d1e6d9cac 100644 --- a/integrations/typeform/src/types.ts +++ b/integrations/typeform/src/types.ts @@ -33,9 +33,7 @@ export type ListResponsesParams = { }; //fix because the Typeform SDK doesn't have the `token` property on an item… -type ResponseListItem = Prettify< - Typeform.API.Responses.List["items"][number] -> & { +type ResponseListItem = Prettify & { token?: string; }; @@ -49,13 +47,9 @@ export type GetFormParams = { export type GetFormResponse = Prettify; -export type GetAllResponsesParams = Prettify< - Omit ->; +export type GetAllResponsesParams = Prettify>; -export type GetAllResponsesResponse = Prettify< - Typeform.API.Responses.List["items"] ->; +export type GetAllResponsesResponse = Prettify; export type GetWebhookResponse = Prettify; diff --git a/package.json b/package.json index a918dad0c..b8c26b818 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "db:studio": "turbo run db:studio", "dev": "turbo run dev --parallel", "i:dev": "infisical run -- turbo run dev --parallel", - "format": "prettier --write \"**/*.{ts,tsx,md}\"", + "format": "prettier . --write --config prettier.config.js", "generate": "turbo run generate", "lint": "turbo run lint", "docker": "docker-compose -p triggerdotdev-docker -f docker/docker-compose.yml up -d", @@ -45,21 +45,21 @@ "@manypkg/cli": "^0.19.2", "@tailwindcss/forms": "^0.5.3", "@tailwindcss/typography": "^0.5.8", + "@trigger.dev/cli": "workspace:*", "autoprefixer": "^10.4.12", "eslint-config-custom": "workspace:*", "postcss": "^8.4.17", - "prettier": "^2.5.1", + "prettier": "^3.0.0", "tailwindcss": "3.1.8", "tsx": "^3.7.1", "turbo": "^1.10.3", "vite": "^4.1.1", "vite-tsconfig-paths": "^4.0.5", - "vitest": "^0.28.4", - "@trigger.dev/cli": "workspace:*" + "vitest": "^0.28.4" }, "packageManager": "pnpm@7.18.1", "dependencies": { "@changesets/cli": "^2.26.0", "node-fetch": "2.6.x" } -} \ No newline at end of file +} diff --git a/packages/cli/package.json b/packages/cli/package.json index 3dd661dc0..b3023664a 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -76,4 +76,4 @@ "engines": { "node": ">=16.8.0" } -} \ No newline at end of file +} diff --git a/packages/cli/src/cli/index.ts b/packages/cli/src/cli/index.ts index 96d2128a2..026fabaca 100644 --- a/packages/cli/src/cli/index.ts +++ b/packages/cli/src/cli/index.ts @@ -14,15 +14,8 @@ program.name(COMMAND_NAME).description("The Trigger.dev CLI").version("0.0.1"); program .command("init") .description("Initialize Trigger.dev in your Next.js project") - .option( - "-p, --project-path ", - "The path to the Next.js project", - "." - ) - .option( - "-k, --api-key ", - "The development API key to use for the project." - ) + .option("-p, --project-path ", "The path to the Next.js project", ".") + .option("-k, --api-key ", "The development API key to use for the project.") .option( "-e, --endpoint-id ", "The unique ID for the endpoint to use for this project. (e.g. my-nextjs-project)" @@ -39,16 +32,10 @@ program program .command("dev") - .description( - "Tunnel your local Next.js project to Trigger.dev and start running jobs" - ) + .description("Tunnel your local Next.js project to Trigger.dev and start running jobs") .argument("[path]", "The path to the project", ".") .option("-p, --port ", "The local port your server is on", "3000") - .option( - "-e, --env-file ", - "The name of the env file to load", - ".env.local" - ) + .option("-e, --env-file ", "The name of the env file to load", ".env.local") .option( "-i, --client-id ", "The ID of the client to use for this project. Will use the value from the package.json file if not provided." @@ -66,11 +53,7 @@ program program .command("create-integration") .description("Create a new integration package for Trigger.dev") - .argument( - "[path]", - "The path where you would like the package to be created", - "." - ) + .argument("[path]", "The path where you would like the package to be created", ".") .option( "-n, --package-name ", "The name of the package to create (e.g. @trigger.dev/slack)" @@ -181,11 +164,7 @@ export const promptEndpointSlug = async (path: string): Promise => { }; export const obfuscateApiKey = (apiKey: string) => { - const [prefix, slug, secretPart] = apiKey.split("_") as [ - string, - string, - string - ]; + const [prefix, slug, secretPart] = apiKey.split("_") as [string, string, string]; return `${prefix}_${slug}_${"*".repeat(secretPart.length)}`; }; @@ -217,9 +196,7 @@ function tryToCreateValidUrlFromValue(input: string): string { let possibleUrl = input; if (!input.startsWith("http://") && !input.startsWith("https://")) { - possibleUrl = input.includes("localhost") - ? `http://${input}` - : `https://${input}`; + possibleUrl = input.includes("localhost") ? `http://${input}` : `https://${input}`; } return possibleUrl; diff --git a/packages/cli/src/commands/createIntegration.ts b/packages/cli/src/commands/createIntegration.ts index 8b71d51c3..11ffab1a3 100644 --- a/packages/cli/src/commands/createIntegration.ts +++ b/packages/cli/src/commands/createIntegration.ts @@ -4,12 +4,7 @@ import ora from "ora"; import { z } from "zod"; import { COMMAND_NAME } from "../consts.js"; import { getLatestPackageVersion } from "../utils/addDependencies.js"; -import { - createFile, - pathExists, - readJSONFile, - writeJSONFile, -} from "../utils/fileSystem.js"; +import { createFile, pathExists, readJSONFile, writeJSONFile } from "../utils/fileSystem.js"; import { generateIntegrationFiles } from "../utils/generateIntegrationFiles.js"; import { installDependencies } from "../utils/installDependencies.js"; import { logger } from "../utils/logger.js"; @@ -51,15 +46,9 @@ export async function createIntegrationCommand(path: string, cliOptions: any) { process.exit(1); } - const resolvedOptions = await resolveOptionsWithPrompts( - options, - resolvedPath - ); + const resolvedOptions = await resolveOptionsWithPrompts(options, resolvedPath); - const latestVersion = await getLatestPackageVersion( - resolvedOptions.sdkPackage, - "latest" - ); + const latestVersion = await getLatestPackageVersion(resolvedOptions.sdkPackage, "latest"); if (!latestVersion) { logger.error( @@ -79,9 +68,7 @@ export async function createIntegrationCommand(path: string, cliOptions: any) { }); if (!sdkVersion) { - logger.error( - `Could not find the latest version of @trigger.dev/sdk. Please try again later.` - ); + logger.error(`Could not find the latest version of @trigger.dev/sdk. Please try again later.`); process.exit(1); } @@ -134,11 +121,7 @@ export async function createIntegrationCommand(path: string, cliOptions: any) { }, }; - await createFileInPath( - resolvedPath, - "package.json", - JSON.stringify(packageJson, null, 2) - ); + await createFileInPath(resolvedPath, "package.json", JSON.stringify(packageJson, null, 2)); // Create the tsconfig.json const tsconfigJson = { @@ -168,11 +151,7 @@ export async function createIntegrationCommand(path: string, cliOptions: any) { exclude: ["node_modules"], }; - await createFileInPath( - resolvedPath, - "tsconfig.json", - JSON.stringify(tsconfigJson, null, 2) - ); + await createFileInPath(resolvedPath, "tsconfig.json", JSON.stringify(tsconfigJson, null, 2)); const readme = ` # ${resolvedOptions.packageName} @@ -212,10 +191,7 @@ export default defineConfig([ if (resolvedOptions.skipGeneratingCode) { await createFileInPath(resolvedPath, "src/index.ts", "export {}"); } else { - await attemptToGenerateIntegrationFiles( - pathModule.join(resolvedPath, "src"), - resolvedOptions - ); + await attemptToGenerateIntegrationFiles(pathModule.join(resolvedPath, "src"), resolvedOptions); } // If inside the monorepo: @@ -232,9 +208,7 @@ export default defineConfig([ // Install the dependencies await installDependencies(resolvedPath); - logger.success( - `✅ Successfully initialized ${resolvedOptions.packageName} at ${resolvedPath}` - ); + logger.success(`✅ Successfully initialized ${resolvedOptions.packageName} at ${resolvedPath}`); logger.info("Next steps:"); logger.info(` 1. If you generated code, double check it for errors.`); logger.info( @@ -242,16 +216,11 @@ export default defineConfig([ ); if (triggerMonorepoPath) { - logger.info( - ` 3. Write some test jobs in the examples/nextjs-example project` - ); + logger.info(` 3. Write some test jobs in the examples/nextjs-example project`); } } -async function attemptToGenerateIntegrationFiles( - path: string, - options: ResolvedCLIOptions -) { +async function attemptToGenerateIntegrationFiles(path: string, options: ResolvedCLIOptions) { const spinner = ora("Generating integration code (may take ~30s)").start(); function generateExtraInfo( @@ -291,9 +260,7 @@ async function attemptToGenerateIntegrationFiles( if (files) { await Promise.all( - Object.entries(files).map(([file, contents]) => - createFileInPath(path, file, contents) - ) + Object.entries(files).map(([file, contents]) => createFileInPath(path, file, contents)) ); spinner.succeed(`Generated integration code in ${path}`); @@ -302,11 +269,7 @@ async function attemptToGenerateIntegrationFiles( } } -async function createFileInPath( - path: string, - fileName: string, - contents: string -) { +async function createFileInPath(path: string, fileName: string, contents: string) { await createFile(pathModule.join(path, fileName), contents); } @@ -413,9 +376,7 @@ export const promptExtraInfo = async (): Promise => { }; // Choose between api-key, oauth, or both -export const promptAuthMethod = async (): Promise< - "api-key" | "oauth" | "both-methods" -> => { +export const promptAuthMethod = async (): Promise<"api-key" | "oauth" | "both-methods"> => { const { authMethod } = await inquirer.prompt<{ authMethod: "api-key" | "oauth" | "both-methods"; }>({ @@ -455,9 +416,7 @@ export const promptSkipGeneratingCode = async (): Promise => { }; // Find where the github repo is located and check if it's the trigger.dev monorepo -async function detectTriggerMonorepoPath( - path: string -): Promise { +async function detectTriggerMonorepoPath(path: string): Promise { const gitPath = await findGitPath(path); if (!gitPath) { @@ -536,11 +495,7 @@ async function updateNextJsExampleProjectWithNewIntegration( integrationPath: string, resolvedOptions: ResolvedCLIOptions ) { - const nextjsPath = pathModule.join( - monorepoPath, - "examples", - "nextjs-example" - ); + const nextjsPath = pathModule.join(monorepoPath, "examples", "nextjs-example"); const packageJsonPath = pathModule.join(nextjsPath, "package.json"); const packageJson = await readJSONFile(packageJsonPath); @@ -565,9 +520,7 @@ async function updateNextJsExampleProjectWithNewIntegration( paths: { ...tsConfig.compilerOptions.paths, [resolvedOptions.packageName]: [ - `../../integrations/${pathModule.basename( - integrationPath - )}/src/index`, + `../../integrations/${pathModule.basename(integrationPath)}/src/index`, ], [`${resolvedOptions.packageName}/*`]: [ `../../integrations/${pathModule.basename(integrationPath)}/src/*`, diff --git a/packages/cli/src/commands/dev.ts b/packages/cli/src/commands/dev.ts index bb0ac43cd..b954aa2ed 100644 --- a/packages/cli/src/commands/dev.ts +++ b/packages/cli/src/commands/dev.ts @@ -49,16 +49,11 @@ export async function devCommand(path: string, anyOptions: any) { logger.success(`✔️ [trigger.dev] Detected TriggerClient id: ${endpointId}`); // Read from .env.local or .env to get the TRIGGER_API_KEY and TRIGGER_API_URL - const { apiUrl, envFile, apiKey } = await getTriggerApiDetails( - resolvedPath, - options.envFile - ); + const { apiUrl, envFile, apiKey } = await getTriggerApiDetails(resolvedPath, options.envFile); logger.success(`✔️ [trigger.dev] Found API Key in ${envFile} file`); - logger.info( - ` [trigger.dev] Looking for Next.js site on port ${options.port}` - ); + logger.info(` [trigger.dev] Looking for Next.js site on port ${options.port}`); const localEndpointHandlerUrl = `http://localhost:${options.port}${options.handlerPath}`; @@ -80,25 +75,17 @@ export async function devCommand(path: string, anyOptions: any) { const endpointUrl = await resolveEndpointUrl(apiUrl, options.port); const endpointHandlerUrl = `${endpointUrl}${options.handlerPath}`; - const connectingSpinner = ora( - `[trigger.dev] Registering endpoint ${endpointHandlerUrl}...` - ); + const connectingSpinner = ora(`[trigger.dev] Registering endpoint ${endpointHandlerUrl}...`); //refresh function let attemptCount = 0; const refresh = async () => { connectingSpinner.start(); - const refreshedEndpointId = await getEndpointIdFromPackageJson( - resolvedPath, - options - ); + const refreshedEndpointId = await getEndpointIdFromPackageJson(resolvedPath, options); // Read from .env.local to get the TRIGGER_API_KEY and TRIGGER_API_URL - const { apiKey, apiUrl } = await getTriggerApiDetails( - resolvedPath, - envFile - ); + const { apiKey, apiUrl } = await getTriggerApiDetails(resolvedPath, envFile); const apiClient = new TriggerApi(apiKey, apiUrl); @@ -110,9 +97,9 @@ export async function devCommand(path: string, anyOptions: any) { if (result.success) { attemptCount = 0; connectingSpinner.succeed( - `[trigger.dev] 🔄 Refreshed ${ - refreshedEndpointId ?? endpointId - } ${formattedDate.format(new Date(result.data.updatedAt))}` + `[trigger.dev] 🔄 Refreshed ${refreshedEndpointId ?? endpointId} ${formattedDate.format( + new Date(result.data.updatedAt) + )}` ); } else { attemptCount++; @@ -157,10 +144,7 @@ export async function devCommand(path: string, anyOptions: any) { throttle(refresh, throttleTimeMs); } -async function getEndpointIdFromPackageJson( - path: string, - options: DevCommandOptions -) { +async function getEndpointIdFromPackageJson(path: string, options: DevCommandOptions) { if (options.clientId) { return options.clientId; } @@ -211,18 +195,14 @@ async function getTriggerApiDetails(path: string, envFile: string) { ]); if (!resolvedEnvFile) { - logger.error( - `You must add TRIGGER_API_KEY and TRIGGER_API_URL to your ${envFile} file.` - ); + logger.error(`You must add TRIGGER_API_KEY and TRIGGER_API_URL to your ${envFile} file.`); process.exit(1); } const parsedEnvFile = dotenv.parse(resolvedEnvFile.content); if (!parsedEnvFile.TRIGGER_API_KEY || !parsedEnvFile.TRIGGER_API_KEY) { - logger.error( - `You must add TRIGGER_API_KEY and TRIGGER_API_URL to your ${envFile} file.` - ); + logger.error(`You must add TRIGGER_API_KEY and TRIGGER_API_URL to your ${envFile} file.`); process.exit(1); } @@ -230,9 +210,7 @@ async function getTriggerApiDetails(path: string, envFile: string) { const apiUrl = parsedEnvFile.TRIGGER_API_URL; if (!apiKey || !apiUrl) { - logger.error( - `You must add TRIGGER_API_KEY and TRIGGER_API_URL to your ${envFile} file.` - ); + logger.error(`You must add TRIGGER_API_KEY and TRIGGER_API_URL to your ${envFile} file.`); process.exit(1); } @@ -263,11 +241,7 @@ async function createTunnel(port: number) { } } -async function refreshEndpoint( - apiClient: TriggerApi, - endpointId: string, - endpointUrl: string -) { +async function refreshEndpoint(apiClient: TriggerApi, endpointId: string, endpointUrl: string) { try { const response = await apiClient.registerEndpoint({ id: endpointId, diff --git a/packages/cli/src/commands/init.ts b/packages/cli/src/commands/init.ts index 39c6551ce..10c26f362 100644 --- a/packages/cli/src/commands/init.ts +++ b/packages/cli/src/commands/init.ts @@ -5,11 +5,7 @@ import inquirer from "inquirer"; import pathModule from "path"; import { pathToRegexp } from "path-to-regexp"; import { simpleGit } from "simple-git"; -import { - promptApiKey, - promptEndpointSlug, - promptTriggerUrl, -} from "../cli/index.js"; +import { promptApiKey, promptEndpointSlug, promptTriggerUrl } from "../cli/index.js"; import { COMMAND_NAME, CLOUD_TRIGGER_URL, CLOUD_API_URL } from "../consts.js"; import { addDependencies } from "../utils/addDependencies.js"; import { logger } from "../utils/logger.js"; @@ -20,8 +16,7 @@ import { detectNextJsProject } from "../utils/detectNextJsProject.js"; import { TriggerApi, WhoamiResponse } from "../utils/triggerApi.js"; import { parse } from "tsconfck"; import { pathExists, readJSONFile } from "../utils/fileSystem.js"; -import { pathToFileURL } from 'url' - +import { pathToFileURL } from "url"; export type InitCommandOptions = { projectPath: string; @@ -39,9 +34,7 @@ export const initCommand = async (options: InitCommandOptions) => { if (options.triggerUrl === CLOUD_TRIGGER_URL) { logger.info(`✨ Initializing project in Trigger.dev Cloud`); } else if (typeof options.triggerUrl === "string") { - logger.info( - `✨ Initializing project using Trigger.dev at ${options.triggerUrl}` - ); + logger.info(`✨ Initializing project using Trigger.dev at ${options.triggerUrl}`); } else { logger.info(`✨ Initializing Trigger.dev in project`); } @@ -68,11 +61,7 @@ export const initCommand = async (options: InitCommandOptions) => { const isTypescriptProject = await detectTypescriptProject(resolvedPath); - - const resolvedOptions = await resolveOptionsWithPrompts( - options, - resolvedPath - ); + const resolvedOptions = await resolveOptionsWithPrompts(options, resolvedPath); const apiKey = resolvedOptions.apiKey; @@ -137,10 +126,7 @@ export const initCommand = async (options: InitCommandOptions) => { process.exit(0); }; -async function printNextSteps( - options: ResolvedOptions, - authorizedKey: WhoamiResponse -) { +async function printNextSteps(options: ResolvedOptions, authorizedKey: WhoamiResponse) { const projectUrl = `${options.triggerUrl}/orgs/${authorizedKey.organization.slug}/projects/${authorizedKey.project.slug}`; logger.success(`✅ Successfully initialized Trigger.dev!`); @@ -157,10 +143,7 @@ async function printNextSteps( ); } -async function addConfigurationToPackageJson( - path: string, - options: ResolvedOptions -) { +async function addConfigurationToPackageJson(path: string, options: ResolvedOptions) { const pkgJsonPath = pathModule.join(path, "package.json"); const pkgBuffer = await fs.readFile(pkgJsonPath); const pkgJson = JSON.parse(pkgBuffer.toString()); @@ -200,11 +183,7 @@ const resolveOptionsWithPrompts = async ( const packageJSONPath = pathModule.join(path, "package.json"); const packageJSON = await readJSONFile(packageJSONPath); - if ( - packageJSON && - packageJSON["trigger.dev"] && - packageJSON["trigger.dev"].endpointId - ) { + if (packageJSON && packageJSON["trigger.dev"] && packageJSON["trigger.dev"].endpointId) { options.endpointSlug = packageJSON["trigger.dev"].endpointId; } else { options.endpointSlug = await promptEndpointSlug(path); @@ -218,9 +197,7 @@ const resolveOptionsWithPrompts = async ( // Otherwise we have to do some fancy namespace extension logic on the Error type which feels overkill for one line // eslint-disable-next-line @typescript-eslint/no-explicit-any if (err instanceof Error && (err as any).isTTYError) { - logger.warn( - `'${COMMAND_NAME} init' needs an interactive terminal to provide options` - ); + logger.warn(`'${COMMAND_NAME} init' needs an interactive terminal to provide options`); const { shouldContinue } = await inquirer.prompt<{ shouldContinue: boolean; @@ -289,14 +266,9 @@ async function detectPagesOrAppDir( // If so then we return app // If not return pages - const extension = isTypescriptProject ? "tsx" : "js" + const extension = isTypescriptProject ? "tsx" : "js"; - const appPagePath = pathModule.join( - path, - usesSrcDir ? "src" : "", - "app", - `page.${extension}` - ); + const appPagePath = pathModule.join(path, usesSrcDir ? "src" : "", "app", `page.${extension}`); const appPageExists = await pathExists(appPagePath); @@ -309,11 +281,7 @@ async function detectPagesOrAppDir( } async function detectMiddlewareUsage(path: string, usesSrcDir = false) { - const middlewarePath = pathModule.join( - path, - usesSrcDir ? "src" : "", - "middleware.ts" - ); + const middlewarePath = pathModule.join(path, usesSrcDir ? "src" : "", "middleware.ts"); const middlewareExists = await pathExists(middlewarePath); @@ -350,10 +318,7 @@ async function detectMiddlewareUsage(path: string, usesSrcDir = false) { )} which will cause issues with Trigger.dev. Please see https://trigger.dev/docs/documentation/guides/platforms/nextjs#middleware` ); } - } else if ( - Array.isArray(matcher) && - matcher.every((m) => typeof m === "string") - ) { + } else if (Array.isArray(matcher) && matcher.every((m) => typeof m === "string")) { const matcherRegexes = matcher.map((m) => pathToRegexp(m)); if (matcherRegexes.some((r) => r.test("/api/trigger"))) { @@ -367,9 +332,7 @@ async function detectMiddlewareUsage(path: string, usesSrcDir = false) { } } -async function getMiddlewareConfigMatcher( - path: string -): Promise> { +async function getMiddlewareConfigMatcher(path: string): Promise> { const fileContent = await fs.readFile(path, "utf-8"); const regex = /matcher:\s*(\[.*\]|".*")/s; @@ -408,7 +371,6 @@ async function getMiddlewareConfigMatcher( // } // In this case, we would return "@" function getPathAlias(tsconfig: any, usesSrcDir: boolean) { - if (!tsconfig.compilerOptions.paths) { return; } @@ -446,14 +408,14 @@ async function createTriggerAppRoute( isTypescriptProject: boolean, usesSrcDir = false ) { - const configFileName = isTypescriptProject ? "tsconfig.json" : "jsconfig.json" + const configFileName = isTypescriptProject ? "tsconfig.json" : "jsconfig.json"; const tsConfigPath = pathModule.join(projectPath, configFileName); const { tsconfig } = await parse(tsConfigPath); - const extension = isTypescriptProject ? ".ts" : ".js" - const triggerFileName = `trigger${extension}` - const examplesFileName = `examples${extension}` - const routeFileName = `route${extension}` + const extension = isTypescriptProject ? ".ts" : ".js"; + const triggerFileName = `trigger${extension}`; + const examplesFileName = `examples${extension}`; + const routeFileName = `route${extension}`; const pathAlias = getPathAlias(tsconfig, usesSrcDir); const routePathPrefix = pathAlias ? pathAlias + "/" : "../../../"; @@ -515,39 +477,26 @@ client.defineJob({ await fs.writeFile(pathModule.join(directories, routeFileName), routeContent); - logger.success( - `✅ Created app route at ${usesSrcDir ? "src/" : ""}app/api/trigger.ts` - ); + logger.success(`✅ Created app route at ${usesSrcDir ? "src/" : ""}app/api/trigger.ts`); - const triggerFileExists = await pathExists( - pathModule.join(path, triggerFileName) - ); + const triggerFileExists = await pathExists(pathModule.join(path, triggerFileName)); if (!triggerFileExists) { await fs.writeFile(pathModule.join(path, triggerFileName), triggerContent); - logger.success( - `✅ Created trigger client at ${usesSrcDir ? "src/" : ""}${triggerFileName}` - ); + logger.success(`✅ Created trigger client at ${usesSrcDir ? "src/" : ""}${triggerFileName}`); } const exampleDirectories = pathModule.join(path, "jobs"); await fs.mkdir(exampleDirectories, { recursive: true }); - const exampleFileExists = await pathExists( - pathModule.join(exampleDirectories, examplesFileName) - ); + const exampleFileExists = await pathExists(pathModule.join(exampleDirectories, examplesFileName)); if (!exampleFileExists) { - await fs.writeFile( - pathModule.join(exampleDirectories, examplesFileName), - jobsContent - ); + await fs.writeFile(pathModule.join(exampleDirectories, examplesFileName), jobsContent); logger.success( - `✅ Created example job at ${ - usesSrcDir ? "src/" : "" - }jobs/examples/examplesFileName` + `✅ Created example job at ${usesSrcDir ? "src/" : ""}jobs/examples/examplesFileName` ); } } @@ -557,18 +506,18 @@ async function createTriggerPageRoute( path: string, options: ResolvedOptions, isTypescriptProject: boolean, - usesSrcDir = false, + usesSrcDir = false ) { - const configFileName = isTypescriptProject ? "tsconfig.json" : "jsconfig.json" + const configFileName = isTypescriptProject ? "tsconfig.json" : "jsconfig.json"; const tsConfigPath = pathModule.join(projectPath, configFileName); const { tsconfig } = await parse(tsConfigPath); const pathAlias = getPathAlias(tsconfig, usesSrcDir); const routePathPrefix = pathAlias ? pathAlias + "/" : "../.."; - const extension = isTypescriptProject ? ".ts" : ".js" - const triggerFileName = `trigger${extension}` - const examplesFileName = `examples${extension}` + const extension = isTypescriptProject ? ".ts" : ".js"; + const triggerFileName = `trigger${extension}`; + const examplesFileName = `examples${extension}`; const routeContent = ` import { createPagesRoute } from "@trigger.dev/nextjs"; @@ -631,43 +580,29 @@ client.defineJob({ `✅ Created pages route at ${usesSrcDir ? "src/" : ""}pages/api/${triggerFileName}` ); - const triggerFileExists = await pathExists( - pathModule.join(path, triggerFileName) - ); + const triggerFileExists = await pathExists(pathModule.join(path, triggerFileName)); if (!triggerFileExists) { await fs.writeFile(pathModule.join(path, triggerFileName), triggerContent); - logger.success( - `✅ Created TriggerClient at ${usesSrcDir ? "src/" : ""}${triggerFileName}` - ); + logger.success(`✅ Created TriggerClient at ${usesSrcDir ? "src/" : ""}${triggerFileName}`); } const exampleDirectories = pathModule.join(path, "jobs"); await fs.mkdir(exampleDirectories, { recursive: true }); - const exampleFileExists = await pathExists( - pathModule.join(exampleDirectories, examplesFileName) - ); + const exampleFileExists = await pathExists(pathModule.join(exampleDirectories, examplesFileName)); if (!exampleFileExists) { - await fs.writeFile( - pathModule.join(exampleDirectories, examplesFileName), - jobsContent - ); + await fs.writeFile(pathModule.join(exampleDirectories, examplesFileName), jobsContent); logger.success( - `✅ Created example job at ${ - usesSrcDir ? "src/" : "" - }jobs/examples/${examplesFileName}` + `✅ Created example job at ${usesSrcDir ? "src/" : ""}jobs/examples/${examplesFileName}` ); } } -async function setupEnvironmentVariables( - path: string, - options: ResolvedOptions -) { +async function setupEnvironmentVariables(path: string, options: ResolvedOptions) { if (options.apiKey) { await setupEnvironmentVariable( path, @@ -680,13 +615,7 @@ async function setupEnvironmentVariables( } if (options.triggerUrl) { - await setupEnvironmentVariable( - path, - ".env.local", - "TRIGGER_API_URL", - options.triggerUrl, - true - ); + await setupEnvironmentVariable(path, ".env.local", "TRIGGER_API_URL", options.triggerUrl, true); } } @@ -710,9 +639,7 @@ async function setupEnvironmentVariable( if (envFileContent.includes(variableName)) { if (!replaceValue) { logger.info( - `☑ Skipping setting ${variableName}=${renderer( - value - )} because it already exists` + `☑ Skipping setting ${variableName}=${renderer(value)} because it already exists` ); return; } @@ -728,8 +655,6 @@ async function setupEnvironmentVariable( } else { await fs.appendFile(path, `\n${variableName}=${value}`); - logger.success( - `✅ Added ${variableName}=${renderer(value)} to ${fileName}` - ); + logger.success(`✅ Added ${variableName}=${renderer(value)} to ${fileName}`); } } diff --git a/packages/cli/src/index.ts b/packages/cli/src/index.ts index f8856cf41..87524b193 100644 --- a/packages/cli/src/index.ts +++ b/packages/cli/src/index.ts @@ -12,9 +12,7 @@ main().catch((err) => { if (err instanceof Error) { logger.error(err); } else { - logger.error( - "An unknown error has occurred. Please open an issue on github with the below:" - ); + logger.error("An unknown error has occurred. Please open an issue on github with the below:"); console.log(err); } process.exit(1); diff --git a/packages/cli/src/utils/addDependencies.ts b/packages/cli/src/utils/addDependencies.ts index 6f647f332..462087295 100644 --- a/packages/cli/src/utils/addDependencies.ts +++ b/packages/cli/src/utils/addDependencies.ts @@ -17,20 +17,12 @@ export type InstalledPackage = { version: string; }; -export async function addDependencies( - projectDir: string, - packages: Array -) { +export async function addDependencies(projectDir: string, packages: Array) { const pkgManager = getUserPkgManager(); - const spinner = ora( - "Adding @trigger.dev dependencies to package.json..." - ).start(); + const spinner = ora("Adding @trigger.dev dependencies to package.json...").start(); - const installedPackages = await addDependenciesToPackageJson( - projectDir, - packages - ); + const installedPackages = await addDependenciesToPackageJson(projectDir, packages); spinner.succeed( chalk.green( @@ -58,9 +50,7 @@ async function addDependenciesToPackageJson( // Add the dependencies to the package.json file pkgJson.dependencies = { ...pkgJson.dependencies, - ...Object.fromEntries( - packagesToInstall.map((pkg) => [pkg.name, `^${pkg.version}`]) - ), + ...Object.fromEntries(packagesToInstall.map((pkg) => [pkg.name, `^${pkg.version}`])), }; // Write the updated package.json file @@ -140,9 +130,7 @@ async function runInstallCommand( const text = data.toString(); if (text.includes("Progress")) { - pnpmSpinner.text = text.includes("|") - ? text.split(" | ")[1] ?? "" - : text; + pnpmSpinner.text = text.includes("|") ? text.split(" | ")[1] ?? "" : text; } }); pnpmSubprocess.on("error", (e) => rej(e)); diff --git a/packages/cli/src/utils/fileSystem.ts b/packages/cli/src/utils/fileSystem.ts index 40ecf7eab..89fb9b5fe 100644 --- a/packages/cli/src/utils/fileSystem.ts +++ b/packages/cli/src/utils/fileSystem.ts @@ -3,10 +3,7 @@ import fsSync from "fs"; import pathModule from "path"; // Creates a file at the given path, if the directory doesn't exist it will be created -export async function createFile( - path: string, - contents: string -): Promise { +export async function createFile(path: string, contents: string): Promise { await fsModule.mkdir(pathModule.dirname(path), { recursive: true }); await fsModule.writeFile(path, contents); diff --git a/packages/cli/src/utils/generateIntegrationFiles.ts b/packages/cli/src/utils/generateIntegrationFiles.ts index 64edad241..ac59bdd6e 100644 --- a/packages/cli/src/utils/generateIntegrationFiles.ts +++ b/packages/cli/src/utils/generateIntegrationFiles.ts @@ -25,11 +25,7 @@ function createExampleResponse(args: { `; } -function createPrompt( - packageName: string, - sdkPackage: string, - extraInfo?: string -) { +function createPrompt(packageName: string, sdkPackage: string, extraInfo?: string) { return `'I\'m wanting to know what the minimal starting point index.ts, types.ts, and tasks.ts files should look like for the package "${packageName}" using the SDK package "${sdkPackage}". ${ extraInfo ?? "" }`; @@ -288,19 +284,14 @@ export async function generateIntegrationFiles(payload: { ...createExampleMessages(), { role: "user", - content: createPrompt( - payload.packageName, - payload.sdkPackage, - payload.extraInfo - ), + content: createPrompt(payload.packageName, payload.sdkPackage, payload.extraInfo), }, ], function_call: { name: "createTypescriptFiles" }, functions: [ { name: "createTypescriptFiles", - description: - "Creates the initial typescript files for a new Trigger.dev package", + description: "Creates the initial typescript files for a new Trigger.dev package", parameters: { type: "object", properties: { diff --git a/packages/cli/src/utils/git.ts b/packages/cli/src/utils/git.ts index c9b3e5a43..6d56a1e9a 100644 --- a/packages/cli/src/utils/git.ts +++ b/packages/cli/src/utils/git.ts @@ -46,9 +46,7 @@ const getGitVersion = () => { /** @returns The git config value of "init.defaultBranch". If it is not set, returns "main". */ const getDefaultBranch = () => { - const stdout = execSync("git config --global init.defaultBranch || echo main") - .toString() - .trim(); + const stdout = execSync("git config --global init.defaultBranch || echo main").toString().trim(); return stdout; }; @@ -122,16 +120,12 @@ export const initializeGit = async (projectDir: string) => { } await execa("git", ["add", "."], { cwd: projectDir }); spinner.succeed( - `${chalk.green("Successfully initialized and staged")} ${chalk.green.bold( - "git" - )}\n` + `${chalk.green("Successfully initialized and staged")} ${chalk.green.bold("git")}\n` ); } catch (error) { // Safeguard, should be unreachable spinner.fail( - `${chalk.bold.red( - "Failed:" - )} could not initialize git. Update git to the latest version!\n` + `${chalk.bold.red("Failed:")} could not initialize git. Update git to the latest version!\n` ); } }; diff --git a/packages/cli/src/utils/installDependencies.ts b/packages/cli/src/utils/installDependencies.ts index f6812ef89..dbfa311c3 100644 --- a/packages/cli/src/utils/installDependencies.ts +++ b/packages/cli/src/utils/installDependencies.ts @@ -13,9 +13,7 @@ export async function installDependencies(projectDir: string) { // If the spinner was used to show the progress, use succeed method on it // If not, use the succeed on a new spinner - (installSpinner || ora()).succeed( - chalk.green("Successfully installed dependencies!\n") - ); + (installSpinner || ora()).succeed(chalk.green("Successfully installed dependencies!\n")); } async function runInstallCommand( @@ -44,9 +42,7 @@ async function runInstallCommand( const text = data.toString(); if (text.includes("Progress")) { - pnpmSpinner.text = text.includes("|") - ? text.split(" | ")[1] ?? "" - : text; + pnpmSpinner.text = text.includes("|") ? text.split(" | ")[1] ?? "" : text; } }); pnpmSubprocess.on("error", (e) => rej(e)); diff --git a/packages/cli/src/utils/triggerApi.ts b/packages/cli/src/utils/triggerApi.ts index e82d7d414..547fbdf75 100644 --- a/packages/cli/src/utils/triggerApi.ts +++ b/packages/cli/src/utils/triggerApi.ts @@ -52,7 +52,10 @@ const WhoamiResponseSchema = z.object({ export type WhoamiResponse = z.infer; export class TriggerApi { - constructor(private apiKey: string, private baseUrl: string) {} + constructor( + private apiKey: string, + private baseUrl: string + ) {} async whoami(apiKey: string): Promise { const response = await fetch(`${this.baseUrl}/api/v1/whoami`, { @@ -76,9 +79,7 @@ export class TriggerApi { return; } - async registerEndpoint( - options: CreateEndpointOptions - ): Promise { + async registerEndpoint(options: CreateEndpointOptions): Promise { const response = await fetch(`${this.baseUrl}/api/v1/endpoints`, { method: "POST", headers: { @@ -97,8 +98,7 @@ export class TriggerApi { if (!rawJson) { return { ok: false, - error: - "An unknown issue occurred when registering with Trigger.dev", + error: "An unknown issue occurred when registering with Trigger.dev", retryable: true, }; } @@ -108,8 +108,7 @@ export class TriggerApi { if (!parsedJson.success) { return { ok: false, - error: - "An unknown issue occurred when registering with Trigger.dev", + error: "An unknown issue occurred when registering with Trigger.dev", retryable: true, }; } diff --git a/packages/core/src/logger.ts b/packages/core/src/logger.ts index 709a6434c..1cd38c1f3 100644 --- a/packages/core/src/logger.ts +++ b/packages/core/src/logger.ts @@ -25,9 +25,7 @@ export class Logger { jsonReplacer?: (key: string, value: unknown) => unknown ) { this.#name = name; - this.#level = logLevels.indexOf( - (process.env.TRIGGER_LOG_LEVEL ?? level) as LogLevel - ); + this.#level = logLevels.indexOf((process.env.TRIGGER_LOG_LEVEL ?? level) as LogLevel); this.#filteredKeys = filteredKeys; this.#jsonReplacer = jsonReplacer; } @@ -35,12 +33,7 @@ export class Logger { // Return a new Logger instance with the same name and a new log level // but filter out the keys from the log messages (at any level) filter(...keys: string[]) { - return new Logger( - this.#name, - logLevels[this.#level], - keys, - this.#jsonReplacer - ); + return new Logger(this.#name, logLevels[this.#level], keys, this.#jsonReplacer); } static satisfiesLogLevel(logLevel: LogLevel, setLevel: LogLevel) { @@ -83,18 +76,13 @@ export class Logger { ...args: Array | undefined> ) { const structuredLog = { - ...structureArgs( - safeJsonClone(args) as Record[], - this.#filteredKeys - ), + ...structureArgs(safeJsonClone(args) as Record[], this.#filteredKeys), timestamp: new Date(), name: this.#name, message, }; - loggerFunction( - JSON.stringify(structuredLog, createReplacer(this.#jsonReplacer)) - ); + loggerFunction(JSON.stringify(structuredLog, createReplacer(this.#jsonReplacer))); } } @@ -152,19 +140,13 @@ function formattedDateTime() { } // If args is has a single item that is an object, return that object -function structureArgs( - args: Array>, - filteredKeys: string[] = [] -) { +function structureArgs(args: Array>, filteredKeys: string[] = []) { if (args.length === 0) { return; } if (args.length === 1 && typeof args[0] === "object") { - return filterKeys( - JSON.parse(JSON.stringify(args[0], bigIntReplacer)), - filteredKeys - ); + return filterKeys(JSON.parse(JSON.stringify(args[0], bigIntReplacer)), filteredKeys); } return args; diff --git a/packages/core/src/retry.ts b/packages/core/src/retry.ts index c6dd191d9..4ddbf46cd 100644 --- a/packages/core/src/retry.ts +++ b/packages/core/src/retry.ts @@ -8,10 +8,7 @@ const DEFAULT_RETRY_OPTIONS = { randomize: true, } satisfies RetryOptions; -export function calculateRetryAt( - retryOptions: RetryOptions, - attempts: number -): Date | undefined { +export function calculateRetryAt(retryOptions: RetryOptions, attempts: number): Date | undefined { const options = { ...DEFAULT_RETRY_OPTIONS, ...retryOptions, diff --git a/packages/core/src/schemas/api.ts b/packages/core/src/schemas/api.ts index 652d0ee20..b043771b7 100644 --- a/packages/core/src/schemas/api.ts +++ b/packages/core/src/schemas/api.ts @@ -21,9 +21,7 @@ export const UpdateTriggerSourceBodySchema = z.object({ data: SerializableJsonSchema.optional(), }); -export type UpdateTriggerSourceBody = z.infer< - typeof UpdateTriggerSourceBodySchema ->; +export type UpdateTriggerSourceBody = z.infer; export const HttpEventSourceSchema = UpdateTriggerSourceBodySchema.extend({ id: z.string(), @@ -109,14 +107,10 @@ export const HttpSourceRequestHeadersSchema = z.object({ "x-ts-params": z.string().transform((s) => JSON.parse(s)), "x-ts-http-url": z.string(), "x-ts-http-method": z.string(), - "x-ts-http-headers": z - .string() - .transform((s) => z.record(z.string()).parse(JSON.parse(s))), + "x-ts-http-headers": z.string().transform((s) => z.record(z.string()).parse(JSON.parse(s))), }); -export type HttpSourceRequestHeaders = z.output< - typeof HttpSourceRequestHeadersSchema ->; +export type HttpSourceRequestHeaders = z.output; export const PongSuccessResponseSchema = z.object({ ok: z.literal(true), @@ -184,9 +178,7 @@ export const DynamicTriggerEndpointMetadataSchema = z.object({ .optional(), }); -export type DynamicTriggerEndpointMetadata = z.infer< - typeof DynamicTriggerEndpointMetadataSchema ->; +export type DynamicTriggerEndpointMetadata = z.infer; export const IndexEndpointResponseSchema = z.object({ jobs: z.array(JobMetadataSchema), @@ -289,9 +281,7 @@ export const RuntimeEnvironmentTypeSchema = z.enum([ "PREVIEW", ]); -export type RuntimeEnvironmentType = z.infer< - typeof RuntimeEnvironmentTypeSchema ->; +export type RuntimeEnvironmentType = z.infer; export const RunSourceContextSchema = z.object({ id: z.string(), @@ -362,9 +352,7 @@ export const RunJobCanceledWithTaskSchema = z.object({ task: TaskSchema, }); -export type RunJobCanceledWithTask = z.infer< - typeof RunJobCanceledWithTaskSchema ->; +export type RunJobCanceledWithTask = z.infer; export const RunJobSuccessSchema = z.object({ status: z.literal("SUCCESS"), @@ -542,12 +530,8 @@ export const CompleteTaskBodyInputSchema = RunTaskBodyInputSchema.pick({ ), }); -export type CompleteTaskBodyInput = Prettify< - z.input ->; -export type CompleteTaskBodyOutput = z.infer< - typeof CompleteTaskBodyInputSchema ->; +export type CompleteTaskBodyInput = Prettify>; +export type CompleteTaskBodyOutput = z.infer; export const FailTaskBodyInputSchema = z.object({ error: ErrorWithStackSchema, @@ -606,16 +590,12 @@ const RegisterCommonScheduleBodySchema = z.object({ export const RegisterIntervalScheduleBodySchema = RegisterCommonScheduleBodySchema.merge(IntervalMetadataSchema); -export type RegisterIntervalScheduleBody = z.infer< - typeof RegisterIntervalScheduleBodySchema ->; +export type RegisterIntervalScheduleBody = z.infer; export const InitializeCronScheduleBodySchema = RegisterCommonScheduleBodySchema.merge(CronMetadataSchema); -export type RegisterCronScheduleBody = z.infer< - typeof InitializeCronScheduleBodySchema ->; +export type RegisterCronScheduleBody = z.infer; export const RegisterScheduleBodySchema = z.discriminatedUnion("type", [ RegisterIntervalScheduleBodySchema, @@ -631,9 +611,7 @@ export const RegisterScheduleResponseBodySchema = z.object({ active: z.boolean(), }); -export type RegisterScheduleResponseBody = z.infer< - typeof RegisterScheduleResponseBodySchema ->; +export type RegisterScheduleResponseBody = z.infer; export const CreateExternalConnectionBodySchema = z.object({ accessToken: z.string(), @@ -642,6 +620,4 @@ export const CreateExternalConnectionBodySchema = z.object({ metadata: z.any(), }); -export type CreateExternalConnectionBody = z.infer< - typeof CreateExternalConnectionBodySchema ->; +export type CreateExternalConnectionBody = z.infer; diff --git a/packages/core/src/schemas/fetch.ts b/packages/core/src/schemas/fetch.ts index 993744410..e6741c3c7 100644 --- a/packages/core/src/schemas/fetch.ts +++ b/packages/core/src/schemas/fetch.ts @@ -12,9 +12,7 @@ export const FetchRetryHeadersStrategySchema = z.object({ resetHeader: z.string(), }); -export type FetchRetryHeadersStrategy = z.infer< - typeof FetchRetryHeadersStrategySchema ->; +export type FetchRetryHeadersStrategy = z.infer; /** The `backoff` strategy retries the request with an exponential backoff. */ export const FetchRetryBackoffStrategySchema = RetryOptionsSchema.extend({ @@ -23,9 +21,7 @@ export const FetchRetryBackoffStrategySchema = RetryOptionsSchema.extend({ }); /** The `backoff` strategy retries the request with an exponential backoff. */ -export type FetchRetryBackoffStrategy = z.infer< - typeof FetchRetryBackoffStrategySchema ->; +export type FetchRetryBackoffStrategy = z.infer; export const FetchRetryStrategySchema = z.discriminatedUnion("strategy", [ FetchRetryHeadersStrategySchema, diff --git a/packages/core/src/schemas/json.ts b/packages/core/src/schemas/json.ts index d68a19eb0..79384db15 100644 --- a/packages/core/src/schemas/json.ts +++ b/packages/core/src/schemas/json.ts @@ -3,17 +3,10 @@ import { z } from "zod"; const LiteralSchema = z.union([z.string(), z.number(), z.boolean(), z.null()]); type Literal = z.infer; -export type DeserializedJson = - | Literal - | { [key: string]: DeserializedJson } - | DeserializedJson[]; +export type DeserializedJson = Literal | { [key: string]: DeserializedJson } | DeserializedJson[]; export const DeserializedJsonSchema: z.ZodType = z.lazy(() => - z.union([ - LiteralSchema, - z.array(DeserializedJsonSchema), - z.record(DeserializedJsonSchema), - ]) + z.union([LiteralSchema, z.array(DeserializedJsonSchema), z.record(DeserializedJsonSchema)]) ); const SerializableSchema = z.union([ @@ -33,9 +26,5 @@ export type SerializableJson = | SerializableJson[]; export const SerializableJsonSchema: z.ZodType = z.lazy(() => - z.union([ - SerializableSchema, - z.array(SerializableJsonSchema), - z.record(SerializableJsonSchema), - ]) + z.union([SerializableSchema, z.array(SerializableJsonSchema), z.record(SerializableJsonSchema)]) ); diff --git a/packages/core/src/schemas/notifications.ts b/packages/core/src/schemas/notifications.ts index 0c9500802..5949af6fb 100644 --- a/packages/core/src/schemas/notifications.ts +++ b/packages/core/src/schemas/notifications.ts @@ -1,7 +1,6 @@ import { z } from "zod"; -export const MISSING_CONNECTION_NOTIFICATION = - "dev.trigger.notifications.missingConnection"; +export const MISSING_CONNECTION_NOTIFICATION = "dev.trigger.notifications.missingConnection"; export const MISSING_CONNECTION_RESOLVED_NOTIFICATION = "dev.trigger.notifications.missingConnectionResolved"; @@ -32,32 +31,28 @@ export const MissingExternalConnectionNotificationPayloadSchema = }), }); -export const MissingConnectionNotificationPayloadSchema = z.discriminatedUnion( - "type", - [ - MissingDeveloperConnectionNotificationPayloadSchema, - MissingExternalConnectionNotificationPayloadSchema, - ] -); +export const MissingConnectionNotificationPayloadSchema = z.discriminatedUnion("type", [ + MissingDeveloperConnectionNotificationPayloadSchema, + MissingExternalConnectionNotificationPayloadSchema, +]); export type MissingConnectionNotificationPayload = z.infer< typeof MissingConnectionNotificationPayloadSchema >; -export const CommonMissingConnectionNotificationResolvedPayloadSchema = - z.object({ +export const CommonMissingConnectionNotificationResolvedPayloadSchema = z.object({ + id: z.string(), + client: z.object({ id: z.string(), - client: z.object({ - id: z.string(), - title: z.string(), - scopes: z.array(z.string()), - createdAt: z.coerce.date(), - updatedAt: z.coerce.date(), - integrationIdentifier: z.string(), - integrationAuthMethod: z.string(), - }), - expiresAt: z.coerce.date(), - }); + title: z.string(), + scopes: z.array(z.string()), + createdAt: z.coerce.date(), + updatedAt: z.coerce.date(), + integrationIdentifier: z.string(), + integrationAuthMethod: z.string(), + }), + expiresAt: z.coerce.date(), +}); export const MissingDeveloperConnectionResolvedNotificationPayloadSchema = CommonMissingConnectionNotificationResolvedPayloadSchema.extend({ @@ -73,11 +68,10 @@ export const MissingExternalConnectionResolvedNotificationPayloadSchema = }), }); -export const MissingConnectionResolvedNotificationPayloadSchema = - z.discriminatedUnion("type", [ - MissingDeveloperConnectionResolvedNotificationPayloadSchema, - MissingExternalConnectionResolvedNotificationPayloadSchema, - ]); +export const MissingConnectionResolvedNotificationPayloadSchema = z.discriminatedUnion("type", [ + MissingDeveloperConnectionResolvedNotificationPayloadSchema, + MissingExternalConnectionResolvedNotificationPayloadSchema, +]); export type MissingConnectionResolvedNotificationPayload = z.infer< typeof MissingConnectionResolvedNotificationPayloadSchema diff --git a/packages/core/src/schemas/runs.ts b/packages/core/src/schemas/runs.ts index 6122fdcff..5cfee2bfd 100644 --- a/packages/core/src/schemas/runs.ts +++ b/packages/core/src/schemas/runs.ts @@ -49,9 +49,7 @@ const GetRunOptionsWithTaskDetailsSchema = GetRunOptionsSchema.extend({ taskdetails: z.boolean().optional(), }); -export type GetRunOptionsWithTaskDetails = z.infer< - typeof GetRunOptionsWithTaskDetailsSchema ->; +export type GetRunOptionsWithTaskDetails = z.infer; const RunSchema = z.object({ /** The Run id */ diff --git a/packages/core/src/schemas/schedules.ts b/packages/core/src/schemas/schedules.ts index 1af54620f..5c23f37b5 100644 --- a/packages/core/src/schemas/schedules.ts +++ b/packages/core/src/schemas/schedules.ts @@ -63,6 +63,4 @@ export const RegisterDynamicSchedulePayloadSchema = z.object({ ), }); -export type RegisterDynamicSchedulePayload = z.infer< - typeof RegisterDynamicSchedulePayloadSchema ->; +export type RegisterDynamicSchedulePayload = z.infer; diff --git a/packages/database/.infisical.json b/packages/database/.infisical.json index 8005d473e..7668c8c4c 100755 --- a/packages/database/.infisical.json +++ b/packages/database/.infisical.json @@ -1 +1 @@ -{"workspaceId":"63e5e42daf9a537ba8d9503c"} \ No newline at end of file +{ "workspaceId": "63e5e42daf9a537ba8d9503c" } diff --git a/packages/database/package.json b/packages/database/package.json index 1467f3298..4f86fdfaf 100644 --- a/packages/database/package.json +++ b/packages/database/package.json @@ -18,4 +18,4 @@ "db:studio": "prisma studio", "typecheck": "tsc --noEmit" } -} \ No newline at end of file +} diff --git a/packages/emails/emails/components/BasePath.tsx b/packages/emails/emails/components/BasePath.tsx index fd20ed9b8..595983ca7 100644 --- a/packages/emails/emails/components/BasePath.tsx +++ b/packages/emails/emails/components/BasePath.tsx @@ -6,13 +6,7 @@ const Context = React.createContext({ basePath: "http://localhost:3000", }); -export function BasePath({ - basePath, - children, -}: { - basePath: string; - children: React.ReactNode; -}) { +export function BasePath({ basePath, children }: { basePath: string; children: React.ReactNode }) { return {children}; } diff --git a/packages/emails/emails/connect-integration.tsx b/packages/emails/emails/connect-integration.tsx index 4c69d4049..1e159c809 100644 --- a/packages/emails/emails/connect-integration.tsx +++ b/packages/emails/emails/connect-integration.tsx @@ -21,8 +21,8 @@ export default function Email({
    - Your workflow {workflowId ?? "WORKFLOWID"} can’t run because you need - to connect to {integration ?? "INTEGRATION"}. + Your workflow {workflowId ?? "WORKFLOWID"} can’t run because you need to connect to{" "} + {integration ?? "INTEGRATION"}. To fix this, just click the button below. diff --git a/packages/emails/emails/invite.tsx b/packages/emails/emails/invite.tsx index 4c20f35b1..c4c2eb287 100644 --- a/packages/emails/emails/invite.tsx +++ b/packages/emails/emails/invite.tsx @@ -8,13 +8,7 @@ import { Section } from "@react-email/section"; import { Text } from "@react-email/text"; import * as React from "react"; import { Footer } from "./components/Footer"; -import { - main, - anchor, - h1, - container, - paragraphLight, -} from "./components/styles"; +import { main, anchor, h1, container, paragraphLight } from "./components/styles"; import { z } from "zod"; export const InviteEmailSchema = z.object({ @@ -39,8 +33,7 @@ export default function Email({ {`You've been invited to ${orgName}`} - {inviterName ?? inviterEmail} has invited you to join their - organization on Trigger.dev. + {inviterName ?? inviterEmail} has invited you to join their organization on Trigger.dev. - Trigger.dev + Trigger.dev
    diff --git a/packages/emails/emails/magic-link.tsx b/packages/emails/emails/magic-link.tsx index 6a21fc471..6a9e6d8cf 100644 --- a/packages/emails/emails/magic-link.tsx +++ b/packages/emails/emails/magic-link.tsx @@ -8,13 +8,7 @@ import { Section } from "@react-email/section"; import { Text } from "@react-email/text"; import * as React from "react"; import { Footer } from "./components/Footer"; -import { - main, - anchor, - h1, - container, - paragraphLight, -} from "./components/styles"; +import { main, anchor, h1, container, paragraphLight } from "./components/styles"; export default function Email({ magicLink }: { magicLink: string }) { return ( @@ -38,12 +32,7 @@ export default function Email({ magicLink }: { magicLink: string }) { If you didn't try to log in, you can safely ignore this email. - Trigger.dev + Trigger.dev