Compare commits

...

325 Commits

Author SHA1 Message Date
Matt Aitken 9193b3c90b Merge pull request #157 from triggerdotdev/changeset-release/main
🚀 Publish Trigger.dev Docker / ʦ TypeScript (push) Has been cancelled
🚀 Publish Trigger.dev Docker / publish (push) Has been cancelled
chore: Update version for release (next)
2023-07-13 16:38:10 +01:00
github-actions[bot] c349b50164 chore: Update version for release (next) 2023-07-13 15:36:48 +00:00
Matt Aitken fe3bc6efe4 Missing token/apikey error improved for display in Next.js logs 2023-07-13 16:35:21 +01:00
Matt Aitken df138ee96e Latest lockfile 2023-07-13 16:11:37 +01:00
Matt Aitken d0b8e560c9 Merge pull request #153 from triggerdotdev/changeset-release/main
chore: Update version for release (next)
2023-07-13 16:09:51 +01:00
github-actions[bot] 537409cec1 chore: Update version for release (next) 2023-07-13 14:36:23 +00:00
Matt Aitken bac8ad1040 Throw if the clients are passed an undefined apikey or token 2023-07-13 15:34:35 +01:00
James Ritchie cc26cbeb7b Fixed nintendo related typo 2023-07-13 15:23:37 +01:00
James Ritchie 3b6c2bd0e8 Update CONTRIBUTING.md to include new steps to login when developing locally 2023-07-13 13:50:46 +01:00
Eric Allam 0b004fbcaf Print out emails instead of sending them through resend if missing resend API key 2023-07-13 12:20:54 +01:00
Eric Allam c72c21e2a9 Only retry runs when the response is a non-400 2023-07-13 11:21:14 +01:00
Eric Allam d6310a79fa @trigger.dev/nextjs and @trigger.dev/sdk: Set duplex "half" when creating fetch based Request objects when they have a body 2023-07-12 21:40:13 +01:00
Eric Allam 953354f367 @trigger.dev/typeform: Update how tasks are exported 2023-07-12 21:01:34 +01:00
James Ritchie f8ddb21510 Added env var instructions to CONTRIBUTING.md 2023-07-12 17:53:09 +01:00
Matt Aitken 761e89108b Docker prisma generate uses the same semver as the package.json 2023-07-12 17:35:27 +01:00
James Ritchie ec34a84d6d Removed the Development guide and pointing to CONTRIBUTING.md instead 2023-07-12 16:45:36 +01:00
Eric Allam 9cb5e6847b Update CONTRIBUTING.md
Remove the Next.js prereq
2023-07-12 16:44:28 +01:00
James Ritchie 43f0c6f7f2 Deleted old file 2023-07-12 16:40:52 +01:00
James Ritchie ffcad81498 Deleted old file 2023-07-12 16:40:28 +01:00
James Ritchie f16a337c50 Created a CONTRIBUTING.md guide 2023-07-12 16:39:19 +01:00
Matt Aitken 30e5303c36 Removed eventTrigger.example idea from the example 2023-07-12 16:36:12 +01:00
Matt Aitken 19d5cb596f Merge remote-tracking branch 'origin/triggers-page' 2023-07-12 15:45:54 +01:00
Matt Aitken ff58925606 The Project side menu now shows an error icon on Triggers and Integrations if action is required 2023-07-12 15:44:13 +01:00
Matt Aitken 12b16a0030 Removed unused imports/code 2023-07-12 15:43:54 +01:00
Matt Aitken b08c10a716 Warnings are triangles, errors are circles 2023-07-12 15:43:40 +01:00
Matt Aitken b878561f65 Added custom ErrorIcon that has a white exclamation so it can be seen on busy backgrounds 2023-07-12 15:43:28 +01:00
Eric Allam 5e36ad961f @trigger.dev/cli: create-integration - Generate the README.md file 2023-07-12 15:34:33 +01:00
Matt Aitken 3dc2f0cfff Scheduled Triggers table 2023-07-12 15:06:52 +01:00
Matt Aitken 073c4fb76e TextLink moved to a separate file, and added a secondary style to it 2023-07-12 15:06:46 +01:00
Matt Aitken cef0bd172d Scheduled Triggers tab 2023-07-12 14:43:48 +01:00
Matt Aitken 23eed197ee Don’t show other user’s Dev external triggers 2023-07-12 14:43:33 +01:00
Matt Aitken 3f8f76df76 Interval Trigger icon is a clock, instead of a calendar to differentiate from CRON 2023-07-12 14:43:16 +01:00
Matt Aitken b047023d9c When registering a ScheduleSource you can associate a DynamicTrigger 2023-07-12 14:43:02 +01:00
Matt Aitken 420655f231 Database migration: relationship between ScheduleSource and DynamicTrigger 2023-07-12 14:42:35 +01:00
Eric Allam 520ab88a97 Adding the create-integration command to scaffold out new integration packages (inside or outside of the monorepo) 2023-07-12 13:38:43 +01:00
Eric Allam f96da50e6a Update the typeform integration package
Now uses a dependency free tsconfig file, and updated the typescript and tsup dev deps
2023-07-12 13:35:19 +01:00
Matt Aitken 1dc42daed4 Added SDK and API support to stop runs when they’re canceled 2023-07-12 13:14:23 +01:00
Matt Aitken 0a80e2f5ec Added CANCELED TaskStatus to the server 2023-07-12 09:18:59 +01:00
Matt Aitken 4661d2019c Canceling runs 2023-07-11 19:50:06 +01:00
Matt Aitken 4e4e7b705d Rerun moved to a resource route 2023-07-11 18:49:00 +01:00
Matt Aitken bae1b0be72 Added action to retry registration 2023-07-11 18:06:42 +01:00
Matt Aitken e890ee01a3 renamed pathBuilder functions to external 2023-07-11 18:06:36 +01:00
Matt Aitken af4b0757a9 Improved spacing and copy 2023-07-11 16:30:39 +01:00
Matt Aitken 6ef62d82c4 You can add containerClassName to a Table 2023-07-11 16:27:05 +01:00
Matt Aitken 44df509b62 Added a code comment to explain the complicated breadcrumb for the extrnal trigger page 2023-07-11 15:56:18 +01:00
Matt Aitken 5d3fe2a5ea Changed paths from “triggersources” to “external” 2023-07-11 15:53:15 +01:00
Matt Aitken 076e6dce73 Cloud seed updates existing secret store values 2023-07-11 15:35:04 +01:00
Matt Aitken f745320456 Added DynamicTrigger column 2023-07-11 14:46:26 +01:00
Matt Aitken 6e64aaa1ee Better explanations of triggers 2023-07-11 14:46:21 +01:00
Matt Aitken 8b68edfc05 Get only the required DynamicTrigger info 2023-07-11 14:46:06 +01:00
Matt Aitken 0a7bae4dac Use the handle to determine if the side menu is expanded 2023-07-11 14:35:14 +01:00
Matt Aitken b925a573f3 Added paginated runs 2023-07-11 13:24:38 +01:00
Eric Allam 0012bb21ce All logs are now structured logs 2023-07-11 13:11:30 +01:00
Matt Aitken 3b3ec9fc4a Run streaming logic moved to a presenter, shared with the External Trigger run page 2023-07-11 13:04:56 +01:00
Matt Aitken 396663d65c Hooks can use passed in matches. Breadcrumb updated to be in the route 2023-07-11 12:46:39 +01:00
Eric Allam f275b47755 Fixed pnpm lock 2023-07-11 11:31:42 +01:00
Eric Allam cfb7481d7e Merge pull request #152 from triggerdotdev/changeset-release/main
chore: Update version for release (next)
2023-07-11 11:22:55 +01:00
github-actions[bot] 57fcce90d9 chore: Update version for release (next) 2023-07-11 10:22:13 +00:00
Eric Allam 2c0ea0c108 Published packages now work with 16.8 and above 2023-07-11 11:20:47 +01:00
Eric Allam e81317b72c Loosen the @trigger.dev/nextjs next version 2023-07-11 11:04:21 +01:00
Matt Aitken 686cf9dc7e Trigger registration runs displaying 2023-07-10 16:35:48 +01:00
Matt Aitken a9e7cda37d Run page turned into components so it can be shared 2023-07-10 15:47:13 +01:00
Matt Aitken eae0b8a95e The Run page now uses a component so it can be shared 2023-07-10 15:20:01 +01:00
Matt Aitken 1b65b1d596 Deleted legal pages from the app 2023-07-10 15:19:45 +01:00
Matt Aitken d85b1fe2fd Moved components to the components/run folder ready for sharing 2023-07-10 15:02:03 +01:00
Matt Aitken f00006af1b Run summary title made the same size as the others 2023-07-10 14:58:01 +01:00
Matt Aitken 75a07fe4ef RunsTable displaying for registration attempts 2023-07-10 14:40:10 +01:00
James Ritchie 946e429906 Merge pull request #151 from triggerdotdev/changeset-release/main
chore: Update version for release (next)
2023-07-10 13:44:20 +01:00
github-actions[bot] 2e5a401ff7 chore: Update version for release (next) 2023-07-10 12:42:38 +00:00
James Ritchie b8b84d8d16 CLI: Improved the endpoint prompt 2023-07-10 13:41:04 +01:00
Matt Aitken 4373538476 ClipboardField changed to spans so it can work inside a paragraph 2023-07-10 12:24:11 +01:00
Matt Aitken af79ea2f72 Triggers page now has tabs 2023-07-10 11:49:19 +01:00
Matt Aitken aab859bc20 Added scheduled path 2023-07-10 11:48:58 +01:00
Matt Aitken c692c16183 Trigger red table row and added slug to the Integration 2023-07-10 11:07:08 +01:00
Matt Aitken cb59808be2 Better type for LabelValueStack variations 2023-07-10 11:06:51 +01:00
Matt Aitken 039777bf63 Merge pull request #150 from triggerdotdev/changeset-release/main
chore: Update version for release (next)
2023-07-10 10:59:15 +01:00
github-actions[bot] 3547ec13c3 chore: Update version for release (next) 2023-07-10 09:58:47 +00:00
Matt Aitken 3763577451 CLI dev: improved spinner and made port clear in logs 2023-07-10 10:57:10 +01:00
Matt Aitken c6618049f2 Merge pull request #149 from triggerdotdev/changeset-release/main
chore: Update version for release (next)
2023-07-10 10:35:07 +01:00
github-actions[bot] 28d6aa9885 chore: Update version for release (next) 2023-07-10 09:33:29 +00:00
Matt Aitken 568786e4f6 Fix when setting the url as an option 2023-07-10 10:32:07 +01:00
Matt Aitken 2aad2d29de Early work on Trigger detail page 2023-07-10 10:16:44 +01:00
Matt Aitken 400354ee9e Improved the layout 2023-07-09 21:12:46 +01:00
Matt Aitken ea3ba78d1a Started the Triggers page 2023-07-09 20:56:33 +01:00
Eric Allam 38614ee526 Update pnpm lockfile 2023-07-09 20:43:27 +01:00
Eric Allam 15ad6bb5f8 Merge pull request #148 from triggerdotdev/changeset-release/main
chore: Update version for release (next)
2023-07-09 20:41:41 +01:00
github-actions[bot] 15f431ada6 chore: Update version for release (next) 2023-07-09 18:48:48 +00:00
Matt Aitken 5163acc6ef Plain changed to @latest
🚀 Publish Trigger.dev Docker / ʦ TypeScript (push) Has been cancelled
🚀 Publish Trigger.dev Docker / publish (push) Has been cancelled
2023-07-09 19:47:32 +01:00
Matt Aitken f9297d783a Added Plain to the integration catalog 2023-07-08 22:17:58 +01:00
Eric Allam c34a02c06f Improved OpenAI integration task errors
And also now allowing runTask.onError to also return an Error by itself if it wants to not retry the task
2023-07-08 22:14:27 +01:00
Eric Allam 61ed1fb202 Added support for output properties on tasks 2023-07-08 22:14:27 +01:00
Eric Allam 87638ba6c5 Merge pull request #147 from owen-duncan-snobel/main
Update README.md
2023-07-07 21:51:36 +01:00
owen-duncan-snobel 26b4100bb0 Update README.md
Use the permanent link to the discord
2023-07-07 15:26:34 -04:00
Matt Aitken 1157c2adf6 Merge pull request #144 from triggerdotdev/changeset-release/main
chore: Update version for release (next)
2023-07-07 19:05:26 +01:00
github-actions[bot] 8613d3288b chore: Update version for release (next) 2023-07-07 18:05:13 +00:00
Matt Aitken ab008fbdff Typeform example formId is optional 2023-07-07 19:03:17 +01:00
Matt Aitken 0b30197280 Set schema for passing in the formId 2023-07-07 19:03:17 +01:00
Matt Aitken 89a121f21e Typeform SDK getAllResponses fixed 2023-07-07 19:03:17 +01:00
Matt Aitken 045a8c56af Subtasks are now ordered correctly 2023-07-07 19:03:17 +01:00
Eric Allam d83c11db8c Add back in npm-run-all
🚀 Publish Trigger.dev Docker / ʦ TypeScript (push) Has been cancelled
🚀 Publish Trigger.dev Docker / publish (push) Has been cancelled
2023-07-07 16:39:29 +01:00
Eric Allam 7efe14b835 Logging in via github should work even after changing your email address 2023-07-07 16:34:41 +01:00
Matt Aitken 37116aecf9 Latest lockfile 2023-07-07 15:37:51 +01:00
Matt Aitken 9a606e8f2a Merge pull request #143 from triggerdotdev/changeset-release/main
chore: Update version for release (next)
2023-07-07 15:35:00 +01:00
github-actions[bot] b1e65ed500 chore: Update version for release (next) 2023-07-07 14:34:41 +00:00
Matt Aitken 26f3dbff06 Typeform: safeBodyParse webhook import fixed 2023-07-07 15:32:45 +01:00
Eric Allam 5ee0b188bd Improve the error display when a run cannot connect to an endpoint 2023-07-07 15:32:19 +01:00
Matt Aitken 4692cd6a55 Latest lockfile 2023-07-07 15:20:42 +01:00
Matt Aitken 7ad8c01853 Merge pull request #142 from triggerdotdev/changeset-release/main
chore: Update version for release (next)
2023-07-07 15:19:13 +01:00
github-actions[bot] bc27b45fd7 chore: Update version for release (next) 2023-07-07 14:18:55 +00:00
Matt Aitken 94cc28d377 Changeset: integration-kit uses webhook package 2023-07-07 15:17:32 +01:00
Matt Aitken 19e80cef3b Removed “internal-queue” from indexEndpoint 2023-07-07 15:16:18 +01:00
James Ritchie 5397cd3194 Added environment labels to the enironment and api keys help panel 2023-07-07 14:51:44 +01:00
Eric Allam f01af9c0ec Remove a bunch of unused webapp deps and upgrade packages to zod 3.21.4 2023-07-07 14:47:28 +01:00
James Ritchie a288010d02 Added a new help panel to the api and endpoints page 2023-07-07 14:20:35 +01:00
James Ritchie b9a7a1c32b Label component now uses the correct <label> html element 2023-07-07 14:20:35 +01:00
James Ritchie 65b9a0dce5 Improved the Header component to make it easier to add more props 2023-07-07 14:20:35 +01:00
Eric Allam 7464006e19 Associated trigger sources and dynamic triggers with their registration job 2023-07-07 13:47:19 +01:00
Matt Aitken 590d56b7e7 Merge pull request #141 from triggerdotdev/changeset-release/main
chore: Update version for release (next)
2023-07-07 12:18:57 +01:00
github-actions[bot] c75cb1e87e chore: Update version for release (next) 2023-07-07 11:16:51 +00:00
Matt Aitken 597b2f4a6f Plain example Job 2023-07-07 12:15:16 +01:00
Matt Aitken 2e84c6bbb2 Plain: Added upsertCustomTimelineEntry Task and exported the components from the plain package 2023-07-07 12:15:16 +01:00
Matt Aitken 06c0cd5297 Import plain jobs file so it gets run, also alphabetized them 2023-07-07 12:15:16 +01:00
Eric Allam 79eab3d62f Cleanup unused graphile tasks 2023-07-07 11:46:56 +01:00
Eric Allam 6527723a0e Refactor index endpoint to work sequentially so we can add associations between sources and jobs 2023-07-07 11:36:01 +01:00
Eric Allam 3d6652f132 WIP plain integration 2023-07-07 10:59:36 +01:00
Matt Aitken da5d9779d4 Check if the Highlight id is defined before attempting to send the error 2023-07-06 21:03:20 +01:00
Matt Aitken 865399e753 Enabled tracing so we can track down errors between frontend and backend 2023-07-06 20:56:50 +01:00
Matt Aitken 960ea6c8dd Removed the throw button from the NavBar… obvs should never have been committed ;) 2023-07-06 20:56:35 +01:00
Matt Aitken 39ab48f0cb Highlight server-side error tracking 2023-07-06 20:45:20 +01:00
Matt Aitken 7341b4cf61 Highlight identifies users 2023-07-06 20:45:00 +01:00
Matt Aitken 28c5acc6af Added Highlight to the project, with basic client-side tracking 2023-07-06 19:34:53 +01:00
Matt Aitken 4366eefc66 Removed unused import 2023-07-06 19:34:05 +01:00
Matt Aitken cb95e761c1 Added an error boundary to the _app route 2023-07-06 19:33:32 +01:00
Matt Aitken 7136748463 Added an error boundary to org 2023-07-06 19:29:42 +01:00
Matt Aitken b0cacfd75c Added an error boundary to project 2023-07-06 19:29:32 +01:00
Matt Aitken 81f03dac79 Better error when a job isn’t found 2023-07-06 19:29:17 +01:00
Matt Aitken e37d1eadcd Breadcrumb null checks in case error boundaries are hit deep in the app 2023-07-06 19:29:00 +01:00
Matt Aitken 23fb310374 Reusable ErrorDisplay 2023-07-06 19:28:36 +01:00
Matt Aitken 797a1732d2 Organize imports on ProjectSideMenu 2023-07-06 19:08:06 +01:00
Matt Aitken c405a417e9 If an error boundary is hit the meta function can return undefined… 2023-07-06 19:07:46 +01:00
James Ritchie 808deb1d77 Added data attributes to the side menu items 2023-07-06 17:50:44 +01:00
Eric Allam 6ac1473ec3 Merge pull request #139 from triggerdotdev/changeset-release/main
chore: Update version for release (next)
2023-07-06 15:31:53 +01:00
github-actions[bot] 9c183abf4b chore: Update version for release (next) 2023-07-06 14:27:36 +00:00
Eric Allam 33c33faae9 Adding the typeform integration to the catalog 2023-07-06 15:26:02 +01:00
Matt Aitken 4cccbc2039 PostHog updated to change hooks, also added “job” group 2023-07-06 14:58:29 +01:00
Matt Aitken cc061dedf8 Change hooks for User, Org, Project, Job 2023-07-06 14:58:29 +01:00
Matt Aitken 402ce2210f New hook that lets you trigger an action when an object changes 2023-07-06 14:58:29 +01:00
Matt Aitken 329c5c4070 Updated posthogjs 2023-07-06 14:58:29 +01:00
Matt Aitken 878aeb7a8c useOrganizationChanged 2023-07-06 14:58:29 +01:00
Eric Allam 3ee396d788 Adding the typeform integration with webhook support 2023-07-06 13:42:49 +01:00
Eric Allam 090037602c WIP create-integration CLI command 2023-07-06 13:42:49 +01:00
Matt Aitken bee77051e7 Added UI to guide you to fixing unconfigured integrations 2023-07-06 11:56:19 +01:00
Matt Aitken be6741a4a8 Example Job that has an unconfigured Integration (for testing) 2023-07-06 11:56:19 +01:00
Matt Aitken 3e9b440322 NamedIcon uses the new type 2023-07-06 11:56:19 +01:00
Matt Aitken dfea5bc77c The connection-alert trigger type has an amber icon so it doesn’t look like an error 2023-07-06 11:56:19 +01:00
Matt Aitken 1eef30e298 Callout uses to and supports internal and external links 2023-07-06 11:56:19 +01:00
James Ritchie e5b9a9de3f Noun’d up Job 2023-07-06 11:36:13 +01:00
Matt Aitken dfedd3a6e8 Consistently use “Log in” everywhere 2023-07-06 10:08:09 +01:00
Matt Aitken a19845b4ca Added a jsdoc markr to the source id 2023-07-06 09:32:15 +01:00
Matt Aitken 094f6f5a7a jsdocs for DynamicTrigger and DynamicSchedule changeset 2023-07-06 00:37:01 +01:00
Matt Aitken fa60edce2b jsdocs for DynamicTrigger and DynamicSchedule 2023-07-06 00:36:08 +01:00
Matt Aitken ba44652457 intervalTrigger() jsdocs 2023-07-05 20:17:09 +01:00
Matt Aitken 931be39912 cronTrigger jsdocs 2023-07-05 19:32:35 +01:00
James Ritchie 5048a27acb Capital J for Job 2023-07-05 18:27:04 +01:00
Matt Aitken 71fc615b31 Fix for the profile photo sizing being weird 2023-07-05 18:05:41 +01:00
Eric Allam 20ed4e22ef Implement the cloud private beta invite form
🚀 Publish Trigger.dev Docker / ʦ TypeScript (push) Has been cancelled
🚀 Publish Trigger.dev Docker / publish (push) Has been cancelled
2023-07-05 17:27:59 +01:00
Matt Aitken fc2d337a39 Optional trailing icon on a <TextLink> 2023-07-05 17:22:53 +01:00
Matt Aitken 31d96f3862 External icon uses the small version 2023-07-05 17:22:44 +01:00
Matt Aitken 7b43853ec6 Help content for the Job page 2023-07-05 17:11:45 +01:00
Matt Aitken 40fa913272 TextLink can have a to or an href 2023-07-05 17:10:34 +01:00
Matt Aitken cdd5482aad Capitalized Runs 2023-07-05 17:10:17 +01:00
Matt Aitken 4a3fa20ee7 Export the callout styles 2023-07-05 17:10:10 +01:00
Matt Aitken d49ed4cd47 Fix for div inside paragraph error 2023-07-05 17:09:53 +01:00
James Ritchie db3cf77f5b Updated the pagination buttons style 2023-07-05 17:08:35 +01:00
James Ritchie c4a08961d6 Added a Help Panel to the Jobs list page 2023-07-05 17:08:35 +01:00
James Ritchie 5ba1643d46 Added a new qr code named icon 2023-07-05 16:57:33 +01:00
Eric Allam d189f425e8 Limit access to the cloud product to people who have invite codes 2023-07-05 16:31:41 +01:00
Matt Aitken 0fe6fb83ac The test help panel is open when you load the page 2023-07-05 16:09:20 +01:00
Matt Aitken f15ae41f48 Help lightbulb is always yellow 2023-07-05 16:09:20 +01:00
Eric Allam 46a07fc72e Merge pull request #138 from triggerdotdev/changeset-release/main
chore: Update version for release (next)
2023-07-05 15:59:30 +01:00
github-actions[bot] 83af317739 chore: Update version for release (next) 2023-07-05 14:57:17 +00:00
Eric Allam f4db1b2735 @trigger.dev/cli init - Create a better file structure 2023-07-05 15:54:58 +01:00
Eric Allam 6d4922f419 api.trigger.dev is now the default cloud url 2023-07-05 14:47:41 +01:00
Eric Allam 6af098ee8a Default the apiUrl to cloud.trigger.dev 2023-07-05 12:29:48 +01:00
Eric Allam 1dcb2ebcac Update pnpm lock file 2023-07-05 12:25:10 +01:00
Eric Allam f65cb463cc Merge pull request #137 from triggerdotdev/changeset-release/main
chore: Update version for release (next)
2023-07-05 12:20:43 +01:00
github-actions[bot] 2b4ce97f8a chore: Update version for release (next) 2023-07-05 11:12:37 +00:00
Eric Allam 25abf319ab PageInfoProperty not puts the value inside a paragraph even if it’s a react node
🚀 Publish Trigger.dev Docker / ʦ TypeScript (push) Has been cancelled
🚀 Publish Trigger.dev Docker / publish (push) Has been cancelled
2023-07-05 12:11:12 +01:00
James Ritchie 77807ab42a Changed ‘Clients’ to ‘Endpoints’ on the API keys page and reordered URL in table 2023-07-05 11:38:06 +01:00
Eric Allam f21990b14f Removed the datetime logging
🚀 Publish Trigger.dev Docker / ʦ TypeScript (push) Has been cancelled
🚀 Publish Trigger.dev Docker / publish (push) Has been cancelled
2023-07-05 11:36:44 +01:00
Eric Allam 1873d10e95 Normalize the whitespace characters in formatted date times 2023-07-05 11:13:26 +01:00
Matt Aitken 32ff3f3136 @trigger.dev/github: Fixed some properties that had API urls instead of HTML urls 2023-07-05 11:12:27 +01:00
Matt Aitken 354b0aefb0 “This Run returned nothing.” 2023-07-05 10:59:37 +01:00
Matt Aitken aaa70a9aab eventTrigger() jsdocs 2023-07-05 10:59:37 +01:00
Eric Allam 3b90739087 Rework the DateTime component to use a Fragment and render the correct datetime timezone in a useEffect 2023-07-05 10:51:08 +01:00
Matt Aitken acaae993a5 Run context jsdocs 2023-07-04 22:55:49 +01:00
Eric Allam a74f0322e2 Attempt to fix the prisma “Transaction already closed: Could not perform operation” error
🚀 Publish Trigger.dev Docker / ʦ TypeScript (push) Has been cancelled
🚀 Publish Trigger.dev Docker / publish (push) Has been cancelled
- Removes the transaction stuff from StartRunService (can try putting it back more granularly)
- Uses $transaction in TestJobService
- Better queue names for the startRun and deliverEvent worker job
2023-07-04 22:11:53 +01:00
Matt Aitken 1a0286f6b0 Run pnpm i 2023-07-04 18:52:54 +01:00
Matt Aitken 64182483e2 Merge pull request #136 from triggerdotdev/changeset-release/main
chore: Update version for release (next)
2023-07-04 18:37:46 +01:00
github-actions[bot] 87a25fba62 chore: Update version for release (next) 2023-07-04 17:34:44 +00:00
Matt Aitken 12803536fa OpenAI integration: listModels returns the response.data instead of response.data.data 2023-07-04 18:33:27 +01:00
Matt Aitken f160b34b34 isTriggerError jsdocs 2023-07-04 16:28:58 +01:00
Matt Aitken cca7da9da2 Better docs for io.try 2023-07-04 16:15:47 +01:00
Matt Aitken 01cf5f3bdc io.try jsdocs 2023-07-04 16:14:31 +01:00
Matt Aitken 33a928a9ea Removed new job examples from general 2023-07-04 15:30:56 +01:00
Matt Aitken c83443a41a io.runTask and io.registerTrigger jsdocs 2023-07-04 15:30:06 +01:00
Eric Allam 374007bffd Fixed incorrectly scoping job test runs to the specific selected project
🚀 Publish Trigger.dev Docker / ʦ TypeScript (push) Has been cancelled
🚀 Publish Trigger.dev Docker / publish (push) Has been cancelled
2023-07-04 15:23:19 +01:00
Eric Allam 092382f319 Cleanup some of the date times 2023-07-04 15:14:45 +01:00
Eric Allam 79a0532e1d Handle OS signals in the docker container
🚀 Publish Trigger.dev Docker / publish (push) Has been cancelled
🚀 Publish Trigger.dev Docker / ʦ TypeScript (push) Has been cancelled
2023-07-04 14:36:59 +01:00
Eric Allam 56c7c8b1ee Better handle interactive transaction errors and adding increased timeouts 2023-07-04 14:36:59 +01:00
Matt Aitken 722fe7b71e registerCron and unregisterCron jsdocs 2023-07-04 12:48:32 +01:00
Eric Allam 759793b2e3 Fix hydration errors by using the LocaleProvider for all rendered dates, and always use UTC to prevent timezone mismatches 2023-07-04 12:36:42 +01:00
Matt Aitken 99c6cd0371 io.registerInterval and io.unregisterInterval jsdocs 2023-07-04 11:22:28 +01:00
Eric Allam 9fbc5ab8de Adding logging to investigate hydration errors 2023-07-04 11:09:47 +01:00
Eric Allam 75ac2c9961 Scheduled triggers are now disabled on dev env by default
Also added pk api key to the environments now
2023-07-04 10:59:05 +01:00
Eric Allam 87330dd863 Merge pull request #135 from triggerdotdev/changeset-release/main
chore: Update version for release (next)
2023-07-04 10:50:18 +01:00
github-actions[bot] 38fe9302cf chore: Update version for release (next) 2023-07-04 09:36:25 +00:00
Eric Allam 33a455c593 pnpm i 2023-07-04 10:34:29 +01:00
Eric Allam 37db0ac58d Remove @trigger.dev/internal changeset 2023-07-04 10:33:00 +01:00
Eric Allam 2cbf50b1cc @trigger.dev/sdk: deliverAt and timestamp event properties are now dates 2023-07-04 10:32:08 +01:00
Matt Aitken e26923eb19 backgroundFetch jsdocs 2023-07-04 10:31:44 +01:00
Eric Allam 3e63bcfb11 Merge pull request #134 from triggerdotdev/changeset-release/main
chore: Update version for release (next)
2023-07-03 22:50:55 +01:00
github-actions[bot] 1e1c18c4a1 chore: Update version for release (next) 2023-07-03 21:49:48 +00:00
Eric Allam 953e7fc918 Allow scheduled jobs to have their schedule updated
Also added human readable cron property to cron triggers
2023-07-03 22:48:03 +01:00
Matt Aitken 8e147dbe0c io.sendEvent jsdocs 2023-07-03 19:19:56 +01:00
Matt Aitken 86dbd5d1dc Added JSdocs for io.wait and io.logger 2023-07-03 19:02:58 +01:00
Eric Allam e85ecfacba Remove the commented out jobs 2023-07-03 17:49:00 +01:00
Eric Allam f210532870 @trigger.dev/slack: Added joinConversation task, and automatically try and join a public conversation if the bot is not in it when posting a message 2023-07-03 17:48:14 +01:00
James Ritchie 6c9ca686cb Tweaked callout icon margin 2023-07-03 16:39:21 +01:00
James Ritchie 35b556d4a3 Using the path builder for URLs on the Jobs page 2023-07-03 16:39:21 +01:00
James Ritchie c83339404a Using the path builder for the integration docs URL 2023-07-03 16:39:21 +01:00
James Ritchie 4172def1a3 Added a docs root path to the path builder 2023-07-03 16:39:21 +01:00
James Ritchie c99481ea8d Added a callout to link to the docs 2023-07-03 16:39:21 +01:00
Matt Aitken a11ddf6564 Added JSDocs related to logging 2023-07-03 16:21:14 +01:00
Matt Aitken 917a70fbe9 Docs for the Job constructor() 2023-07-03 16:12:21 +01:00
Eric Allam 486d6818ba SDK: IO Logging now respects the job and client logLevel, and only outputs locally when ioLogLocalEnabled is true 2023-07-03 16:00:18 +01:00
Matt Aitken 807b9d4c45 SDK changeset: Added jsdocs for TriggerClient() and sendEvent() 2023-07-03 15:37:36 +01:00
Matt Aitken 0013e78b1a CLI changeset: Export the client from the generated code and added code comments 2023-07-03 15:37:25 +01:00
Matt Aitken 9dd46c83fd Added code comments to the CLI generated code, and exported the client 2023-07-03 15:35:40 +01:00
Matt Aitken 1eb6bb8aa9 Added JSDocs for TriggerCient() and client.sendEvent() 2023-07-03 15:35:40 +01:00
Eric Allam 6c86946614 SDK: Fixes issue with PING response
CLI: improves how the dev command handles register errors, also doesn’t create a tunnel when hitting local trigger.dev, and improves the dev command output
2023-07-03 15:33:44 +01:00
Eric Allam 612b016a15 When registering a schedule source < 60 seconds, make it 60 seconds 2023-07-03 14:00:46 +01:00
Eric Allam be8beacaec chore: update to Remix 1.18.1 2023-07-03 13:53:38 +01:00
Eric Allam 4d316c5524 Fixed the OAuth2 callback urls by constructing URL using x-forwarded-proto header 2023-07-03 13:47:58 +01:00
Eric Allam 7fee5d6a87 Remove logging of headers and replace integration list date with DateTime component 2023-07-03 13:26:53 +01:00
Eric Allam 0dd1aa5a5b Log out the server locale context 2023-07-03 13:11:32 +01:00
Eric Allam ed65ba4a73 isManagedCloud should be true when in the test cloud 2023-07-03 11:53:23 +01:00
Matt Aitken d39020370c Merge pull request #133 from triggerdotdev/changeset-release/main
chore: Update version for release (next)
2023-07-03 11:43:28 +01:00
github-actions[bot] c18ba11819 chore: Update version for release (next) 2023-07-03 10:29:42 +00:00
Matt Aitken 5fbd7226eb Changeset: @trigger.dev/cli: Added retrying and better messaging 2023-07-03 11:28:22 +01:00
Matt Aitken c9e27fd586 Improved the loading state of the CLI dev command. Fail after 10 connection attempts 2023-07-03 11:27:36 +01:00
Matt Aitken 51b80eb09b Deleted old CLI createProject file 2023-07-03 11:27:22 +01:00
Matt Aitken f409e9f329 Improved the messaging when it’s connecting with a retry 2023-07-02 18:54:25 +01:00
Matt Aitken 304e6aaad5 Only triggers a refresh when a relevant file is changed, retries with exponential backoff 2023-07-02 18:45:34 +01:00
Eric Allam 3c5d02043e Merge pull request #132 from triggerdotdev/changeset-release/main 2023-06-30 22:07:19 +01:00
github-actions[bot] 63980f63d4 chore: Update version for release (next) 2023-06-30 18:45:02 +00:00
Eric Allam facd2b2131 Update lockfile 2023-06-30 19:43:20 +01:00
Matt Aitken 25452588cc Update the sdk version in peer dependencies of @trigger.dev/nextjs 2023-06-30 18:05:53 +01:00
Matt Aitken 195d8c42fc Updated posthog-js to the latest 2023-06-30 18:02:03 +01:00
Matt Aitken fe04b9d32d Next.js changeset: adaptors no longer take an options object 2023-06-30 17:44:55 +01:00
Matt Aitken d03b3aeb5f Latets lockfile 2023-06-30 17:29:04 +01:00
Matt Aitken 2ee33e70f7 Fixed Slack help line highlighting 2023-06-30 17:25:57 +01:00
Matt Aitken e9209629f7 Show contextual help for an Integration 2023-06-30 17:24:55 +01:00
Matt Aitken fa1e6bf5e6 The new fields from the Integration catalog are now in the database 2023-06-30 17:24:40 +01:00
Matt Aitken 93c3b10bf7 Improved the help text some more
🚀 Publish Trigger.dev Docker / ʦ TypeScript (push) Has been cancelled
🚀 Publish Trigger.dev Docker / publish (push) Has been cancelled
2023-06-30 15:43:45 +01:00
Matt Aitken 56cb2e3b07 Updated the in-app quick start instructions 2023-06-30 15:38:40 +01:00
Eric Allam eabfb2457a Remove pushing to ECR 2023-06-30 15:35:20 +01:00
Eric Allam 317ab442ee Merge pull request #131 from triggerdotdev/changeset-release/main
chore: Update version for release (next)
2023-06-30 15:12:43 +01:00
github-actions[bot] 2b24b36da6 chore: Update version for release (next) 2023-06-30 14:10:09 +00:00
Eric Allam 161d59d01d Added better Next Steps in the init cli command 2023-06-30 15:07:46 +01:00
Eric Allam 821b75ed26 Merge pull request #130 from triggerdotdev/changeset-release/main
chore: Update version for release (next)
2023-06-30 14:30:38 +01:00
github-actions[bot] 1f901e68d3 chore: Update version for release (next) 2023-06-30 13:27:31 +00:00
Eric Allam 46d94a6a8f Fixed type errors 2023-06-30 14:26:07 +01:00
Eric Allam 44c2146505 Merge pull request #129 from triggerdotdev/changeset-release/main
chore: Update version for release (next)
2023-06-30 14:14:32 +01:00
Matt Aitken ec2f1f5931 Support for Integrations that are incomplete on the integrations page 2023-06-30 14:13:23 +01:00
Matt Aitken e86c59f4ec If logging is on show Posthogs logs 2023-06-30 14:13:23 +01:00
James Ritchie 6df6813a17 Styled scroll bar for the test json 2023-06-30 14:06:10 +01:00
James Ritchie f73679e2a6 Updated help image 2023-06-30 14:06:10 +01:00
Eric Allam 68b866921a Remove triggering a test deploy on publishing 2023-06-30 13:48:08 +01:00
James Ritchie 35364d615a Custom scrollbars now on the Job and Project navbar menus 2023-06-30 13:18:13 +01:00
Matt Aitken f64dd2a99c Added nice scrollbar, commented out missing integration stuff for now 2023-06-30 12:56:10 +01:00
Matt Aitken a309a75a4d NamedIcon now gives autocomplete in the editor (but also accepts any string) 2023-06-30 12:18:19 +01:00
Matt Aitken c2e2f7cad9 CLI: removed —tunnel param as we currently just support ngrok 2023-06-30 12:18:19 +01:00
Matt Aitken f69b92b153 Uncommented the jobs 2023-06-30 12:18:19 +01:00
Matt Aitken f8760fdd6b Moved the jobs so they’re imported and can be easily commented out 2023-06-30 12:18:19 +01:00
Matt Aitken caa4daabe2 Use the id as the temporary name 2023-06-30 12:18:19 +01:00
github-actions[bot] 67f685af26 chore: Update version for release (next) 2023-06-30 11:11:54 +00:00
Eric Allam b2a8b5653f Adding changeset for the new dev command 2023-06-30 12:10:30 +01:00
Eric Allam 9232f019e1 Fixed a couple type errors in the @trigger.dev/cli 2023-06-30 11:29:25 +01:00
Eric Allam ac371664af Better handle input for the --trigger-url option 2023-06-30 11:26:46 +01:00
Matt Aitken e4cca81124 Integrations page: added a Connections column and deal with local auth better 2023-06-30 11:11:28 +01:00
Matt Aitken d76d2b86d2 Indexing endpoints happens in a transaction 2023-06-30 11:11:28 +01:00
Matt Aitken fcd2d6eea2 Integrations now have a setupStatus and can be missing fields 2023-06-30 11:11:28 +01:00
Matt Aitken 067064d19c Include Slack jobs 2023-06-30 11:11:28 +01:00
Matt Aitken 52cdfb98a4 Added extra error checking to the refresh endpoint call 2023-06-30 11:11:28 +01:00
Eric Allam 41261afcc4 Fix the pnpm lock file AGAIN 2023-06-30 11:10:13 +01:00
James Ritchie 77f71fdeb7 WIP adding 2 links below the api list 2023-06-30 11:09:15 +01:00
James Ritchie ce0032e7e5 Minor copy tweaks 2023-06-30 10:33:05 +01:00
Matt Aitken c97ca350ad The endpoint gets automatically refreshed when files are changed, with a throttle 2023-06-29 22:19:55 +01:00
Matt Aitken 90abcb2cf7 Improved messages 2023-06-29 21:53:16 +01:00
Matt Aitken 8626172faa Installed packages 2023-06-29 21:53:09 +01:00
Matt Aitken 44ef97c656 Set the nextjs-example packages to workspace again 🤦‍♂️ 2023-06-29 21:53:05 +01:00
Matt Aitken 7661fe5309 CLI dev command is creating a tunnel and attempting to connect to the API 2023-06-29 21:29:28 +01:00
Matt Aitken beb02c871d Added the CLI to the nextjs-example project 2023-06-29 21:12:21 +01:00
Matt Aitken 8a47320272 WIP on dev CLI command 2023-06-29 20:32:07 +01:00
Matt Aitken 114c8990a3 Change the main header to h1 to stop eslint complaining 2023-06-29 19:34:00 +01:00
Eric Allam 7e2d48ac6a Adding SDK changeset for trigger client url 2023-06-29 18:26:53 +01:00
Eric Allam dbb6667889 Couple of changes for matt 2023-06-29 18:25:31 +01:00
Eric Allam 29a02131d2 WIP converting the init into a multi-command CLI to support dev 2023-06-29 18:15:19 +01:00
James Ritchie 5d887f1cfb Improved the sheet style 2023-06-29 17:29:46 +01:00
James Ritchie 18f0e73ed4 Added yarn and pnpm options for installing the package 2023-06-29 16:41:19 +01:00
James Ritchie c4c1425c9b WIP making the 2 styles of dropdowns similar. Bare minimum for now for launch. 2023-06-29 15:55:15 +01:00
James Ritchie 00bb3934ad import cleanup 2023-06-29 15:27:59 +01:00
James Ritchie 324096e14e typo 2023-06-29 15:27:48 +01:00
James Ritchie 9cad2bb308 scopes title style update 2023-06-29 15:15:13 +01:00
James Ritchie eec537135a fixed radio button alignment 2023-06-29 15:13:04 +01:00
James Ritchie 53e42d3350 Integration page layout now uses 2 and 1 col grid layout 2023-06-29 15:01:00 +01:00
James Ritchie e74122977a logo alignment fix 2023-06-29 15:00:10 +01:00
James Ritchie f32c3ebe2c higher res help images 2023-06-29 14:48:58 +01:00
James Ritchie d07ac4fef0 Added a callout link to the docs 2023-06-29 14:42:49 +01:00
James Ritchie 183761b01f Aligned the callout icon top 2023-06-29 14:42:39 +01:00
James Ritchie 361ef70ce8 api key fields not fullwidth 2023-06-29 14:42:31 +01:00
James Ritchie 2bac0a4e5b Added content to the Test help panel and made the -t dynamic 2023-06-29 14:35:34 +01:00
James Ritchie b89a68bb9c Added a hook for appOrigin 2023-06-29 14:35:34 +01:00
James Ritchie 496dadebbd Fixed the page layout to work with 1 or 2 col grid layout 2023-06-29 14:35:34 +01:00
420 changed files with 17147 additions and 10430 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"@trigger.dev/sdk": patch
---
run context jsdocs
+5
View File
@@ -0,0 +1,5 @@
---
"@trigger.dev/sdk": patch
---
Better docs for io.try
+5
View File
@@ -0,0 +1,5 @@
---
"@trigger.dev/cli": patch
---
Added retrying and better messaging
+5
View File
@@ -0,0 +1,5 @@
---
"@trigger.dev/sdk": patch
---
IO Logging now respects the job and client logLevel, and only outputs locally when ioLogLocalEnabled is true
+6
View File
@@ -0,0 +1,6 @@
---
"@trigger.dev/sdk": patch
"@trigger.dev/openai": patch
---
Improved OpenAI task errors
+5
View File
@@ -0,0 +1,5 @@
---
"@trigger.dev/sdk": patch
---
Don't return the apiKey when they don't match
+5
View File
@@ -0,0 +1,5 @@
---
"@trigger.dev/typeform": patch
---
getAllResponses fixed
+9
View File
@@ -0,0 +1,9 @@
---
"@trigger.dev/typeform": patch
"@trigger.dev/github": patch
"@trigger.dev/openai": patch
"@trigger.dev/resend": patch
"@trigger.dev/plain": patch
---
Missing token/apikey error improved for display in Next.js logs
+5
View File
@@ -0,0 +1,5 @@
---
"@trigger.dev/sdk": patch
---
registerCron and unregisterCron jsdocs
+5
View File
@@ -0,0 +1,5 @@
---
"@trigger.dev/sdk": patch
---
Added support for Runs being canceled
+6
View File
@@ -0,0 +1,6 @@
---
"@trigger.dev/sdk": patch
"@trigger.dev/nextjs": patch
---
Set duplex "half" when creating fetch based Request objects when they have a body
+5
View File
@@ -0,0 +1,5 @@
---
"@trigger.dev/cli": patch
---
Split the CLI into two commands, init and a new dev command
+5
View File
@@ -0,0 +1,5 @@
---
"@trigger.dev/plain": patch
---
Added upsertCustomTimelineEntry Task and exported the components from the plain package
+10
View File
@@ -0,0 +1,10 @@
---
"@trigger.dev/typeform": patch
"@trigger.dev/sdk": patch
"@trigger.dev/github": patch
"@trigger.dev/openai": patch
"@trigger.dev/slack": patch
"@trigger.dev/cli": patch
---
Upgrade to zod 3.21.4
+6
View File
@@ -0,0 +1,6 @@
---
"@trigger.dev/sdk": patch
"@trigger.dev/cli": patch
---
api.trigger.dev is now the default cloud url
+5
View File
@@ -0,0 +1,5 @@
---
"@trigger.dev/sdk": patch
---
io.runTask jsdocs
+5
View File
@@ -0,0 +1,5 @@
---
"@trigger.dev/cli": patch
---
[dev] Better handle errors when registering endpoint
+5
View File
@@ -0,0 +1,5 @@
---
"@trigger.dev/sdk": patch
---
io.sendEvent jsdocs
+5
View File
@@ -0,0 +1,5 @@
---
"@trigger.dev/sdk": patch
---
deliverAt and timestamp event properties are now dates
+5
View File
@@ -0,0 +1,5 @@
---
"@trigger.dev/openai": patch
---
listModels returns the response.data instead of response.data.data
+5
View File
@@ -0,0 +1,5 @@
---
"@trigger.dev/sdk": patch
---
cronTrigger jsdocs
+9
View File
@@ -0,0 +1,9 @@
---
"@trigger.dev/typeform": patch
"@trigger.dev/github": patch
"@trigger.dev/openai": patch
"@trigger.dev/resend": patch
"@trigger.dev/plain": patch
---
Throw if the clients are passed an undefined apikey or token
+5
View File
@@ -0,0 +1,5 @@
---
"@trigger.dev/sdk": patch
---
Added JSDocs related to logging
+5
View File
@@ -0,0 +1,5 @@
---
"@trigger.dev/typeform": patch
---
Use a standalone tsconfig.json file to increase portability
+5
View File
@@ -0,0 +1,5 @@
---
"@trigger.dev/cli": patch
---
Removed --tunnel option, currently we just support ngrok
+5
View File
@@ -0,0 +1,5 @@
---
"@trigger.dev/sdk": patch
---
intervalTrigger() jsdocs
+5
View File
@@ -0,0 +1,5 @@
---
"@trigger.dev/sdk": patch
---
Fixed responses from the PING action to match expected schema
+5
View File
@@ -0,0 +1,5 @@
---
"@trigger.dev/cli": patch
---
Generate the README for a new integration package
+5
View File
@@ -0,0 +1,5 @@
---
"@trigger.dev/cli": patch
---
Adding the create-integration command to scaffold out new integration packages (inside or outside of the monorepo)
+5
View File
@@ -0,0 +1,5 @@
---
"@trigger.dev/sdk": patch
---
jsdocs for DynamicTrigger and DynamicSchedule
+5
View File
@@ -0,0 +1,5 @@
---
"@trigger.dev/cli": patch
---
Export the client from the generated code and added code comments
+5
View File
@@ -0,0 +1,5 @@
---
"@trigger.dev/github": patch
---
Fixed some properties that had API urls instead of HTML urls
+5
View File
@@ -0,0 +1,5 @@
---
"@trigger.dev/nextjs": patch
---
Adaptors no longer take an options object
+14
View File
@@ -0,0 +1,14 @@
---
"@trigger.dev/integration-kit": patch
"@trigger.dev/typeform": patch
"@trigger.dev/sdk": patch
"@trigger.dev/github": patch
"@trigger.dev/openai": patch
"@trigger.dev/resend": patch
"@trigger.dev/plain": patch
"@trigger.dev/slack": patch
"@trigger.dev/nextjs": patch
"@trigger.dev/cli": patch
---
Set Node version to 16.8 and above
+5
View File
@@ -0,0 +1,5 @@
---
"@trigger.dev/nextjs": patch
---
Loosen the Next.js dependency version
+6
View File
@@ -0,0 +1,6 @@
---
"@trigger.dev/sdk": patch
"@trigger.dev/internal": patch
---
backgroundFetch jsdocs
+64 -2
View File
@@ -14,29 +14,91 @@
"@trigger.dev/database": "0.0.0",
"@trigger.dev/init": "0.2.0",
"@trigger.dev/integration-kit": "2.0.0-next.1",
"@trigger.dev/resend": "1.0.0-next.1"
"@trigger.dev/resend": "1.0.0-next.1",
"@trigger.dev/cli": "0.2.1-next.8",
"@trigger.dev/typeform": "1.0.0-next.2",
"@trigger.dev/plain": "1.0.0-next.2"
},
"changesets": [
"afraid-hornets-cheer",
"beige-maps-hug",
"big-tables-search",
"bright-buses-join",
"bright-horses-bathe",
"brown-bikes-bathe",
"chatty-cars-agree",
"chilly-meals-warn",
"clever-bats-learn",
"cuddly-pets-arrive",
"curly-hornets-sort",
"dirty-needles-kneel",
"dull-bulldogs-design",
"eight-buckets-agree",
"eighty-queens-prove",
"empty-falcons-run",
"fast-ligers-wink",
"fifty-melons-enjoy",
"forty-pugs-share",
"four-ligers-perform",
"friendly-parents-clean",
"funny-elephants-sing",
"gentle-dogs-end",
"gentle-guests-leave",
"great-meals-listen",
"healthy-rockets-cry",
"heavy-eyes-own",
"heavy-mails-explain",
"hot-eggs-protect",
"hot-seals-press",
"itchy-cars-count",
"itchy-rockets-provide",
"khaki-needles-wait",
"lemon-ads-wait",
"long-clocks-hide",
"lovely-chicken-serve",
"lovely-hounds-accept",
"lovely-plants-brake",
"lucky-crews-matter",
"metal-donkeys-relate",
"metal-trainers-work",
"mighty-seals-fold",
"modern-emus-suffer",
"modern-turtles-eat",
"moody-islands-melt",
"odd-colts-smash",
"pink-islands-pay",
"pink-numbers-jam",
"plenty-ties-raise",
"popular-cooks-boil",
"pretty-bats-obey",
"quick-stingrays-own",
"quiet-berries-tickle",
"quiet-dryers-collect",
"rich-clocks-attack",
"rude-bees-taste",
"shiny-mirrors-beam",
"shy-bobcats-hear",
"silent-mirrors-lay",
"silver-clocks-visit",
"silver-insects-sneeze",
"six-humans-happen",
"sixty-pandas-deliver",
"sixty-squids-wink",
"strange-jobs-shout",
"strong-cars-visit",
"stupid-files-cough",
"sweet-adults-applaud",
"sweet-cups-rescue",
"sweet-houses-drum",
"sweet-snails-refuse",
"tame-flowers-invite",
"tasty-bats-flow",
"ten-birds-confess",
"thirty-apes-happen",
"tidy-planes-compete",
"tough-walls-share",
"wild-rats-mix"
"two-tools-hide",
"wild-rats-mix",
"young-birds-unite"
]
}
+5
View File
@@ -0,0 +1,5 @@
---
"@trigger.dev/typeform": patch
---
safeBodyParse webhook import fixed
+5
View File
@@ -0,0 +1,5 @@
---
"@trigger.dev/cli": patch
---
Initializing a next.js project now creates a better file structure
+5
View File
@@ -0,0 +1,5 @@
---
"@trigger.dev/sdk": patch
---
registerTrigger jsdocs
+5
View File
@@ -0,0 +1,5 @@
---
"@trigger.dev/sdk": patch
---
io.registerInterval and io.unregisterInterval jsdocs
+5
View File
@@ -0,0 +1,5 @@
---
"@trigger.dev/cli": patch
---
Fix when setting the url as an option
+7
View File
@@ -0,0 +1,7 @@
---
"@trigger.dev/integration-kit": patch
"@trigger.dev/sdk": patch
"@trigger.dev/typeform": patch
---
Creating the typeform integration package
+5
View File
@@ -0,0 +1,5 @@
---
"@trigger.dev/sdk": patch
---
Removed the url option for TriggerClient
+5
View File
@@ -0,0 +1,5 @@
---
"@trigger.dev/sdk": patch
---
Added JSdocs for io.wait and io.logger
+5
View File
@@ -0,0 +1,5 @@
---
"@trigger.dev/typeform": patch
---
Update how tasks are exported
+5
View File
@@ -0,0 +1,5 @@
---
"@trigger.dev/sdk": patch
---
isTriggerError jsdocs
+5
View File
@@ -0,0 +1,5 @@
---
"@trigger.dev/sdk": patch
---
eventTrigger() jsdocs
+6
View File
@@ -0,0 +1,6 @@
---
"@trigger.dev/sdk": patch
"@trigger.dev/openai": patch
---
Adding support for output properties on tasks
+5
View File
@@ -0,0 +1,5 @@
---
"@trigger.dev/sdk": patch
---
io.try jsdocs
+5
View File
@@ -0,0 +1,5 @@
---
"@trigger.dev/cli": patch
---
Added better Next Steps in the init cli command
+6
View File
@@ -0,0 +1,6 @@
---
"@trigger.dev/typeform": patch
"@trigger.dev/integration-kit": patch
---
integration-kit uses webhook package
+5
View File
@@ -0,0 +1,5 @@
---
"@trigger.dev/sdk": patch
---
Added human readable cron expression property to cron triggers
+5
View File
@@ -0,0 +1,5 @@
---
"@trigger.dev/sdk": patch
---
All logs are now structured logs
+5
View File
@@ -0,0 +1,5 @@
---
"@trigger.dev/sdk": patch
---
Added jsdocs for TriggerClient() and sendEvent()
+5
View File
@@ -0,0 +1,5 @@
---
"@trigger.dev/cli": patch
---
Better handle input for the --trigger-url option
+5
View File
@@ -0,0 +1,5 @@
---
"@trigger.dev/cli": patch
---
Improved the endpoint prompt
+5
View File
@@ -0,0 +1,5 @@
---
"@trigger.dev/slack": patch
---
Added joinConversation task, and automatically try and join a public conversation if the bot is not in it when posting a message
+5
View File
@@ -0,0 +1,5 @@
---
"@trigger.dev/cli": patch
---
Improved spinner and made port clear in logs
+5
View File
@@ -0,0 +1,5 @@
---
"@trigger.dev/sdk": patch
---
Added JSdocs for Job
-45
View File
@@ -106,48 +106,3 @@ jobs:
env:
REGISTRY: ghcr.io/triggerdotdev
REPOSITORY: trigger.dev
- name: 🌐 Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: arn:aws:iam::067435167850:role/GitHubAction-AssumeRoleWithAction
aws-region: ${{ env.AWS_REGION }}
- name: 🌐 Login to ECR
id: ecr-login
uses: aws-actions/amazon-ecr-login@v1
- name: 🌐 Push to Amazon ECR
run: |
docker tag release_build_image $REGISTRY/$REPOSITORY:$IMAGE_TAG
docker push $REGISTRY/$REPOSITORY:$IMAGE_TAG
env:
REGISTRY: ${{ steps.ecr-login.outputs.registry }}
REPOSITORY: trigger.dev
IMAGE_TAG: ${{ steps.get_version.outputs.version }}
- name: 🌐 Push 'latest' to Amazon ECR
if: startsWith(github.ref, 'refs/tags/')
run: |
docker tag release_build_image $REGISTRY/$REPOSITORY:latest
docker push $REGISTRY/$REPOSITORY:latest
env:
REGISTRY: ${{ steps.ecr-login.outputs.registry }}
REPOSITORY: trigger.dev
- name: 🌐 Push commit hash to Amazon ECR
if: startsWith(github.ref, 'refs/heads/')
run: |
docker tag release_build_image $REGISTRY/$REPOSITORY:$IMAGE_TAG
docker push $REGISTRY/$REPOSITORY:$IMAGE_TAG
env:
REGISTRY: ${{ steps.ecr-login.outputs.registry }}
REPOSITORY: trigger.dev
IMAGE_TAG: ${{ steps.get_version.outputs.version }}-${{ steps.get_commit.outputs.sha_short }}
- name: 🚀 Trigger Test Deploy
if: github.ref == 'refs/heads/main' && github.event_name == 'push' && github.repository == 'triggerdotdev/trigger.dev'
env:
DEPLOY_TEST_HOOK: ${{ secrets.DEPLOY_TEST_HOOK }}
run: |
curl -X POST $DEPLOY_TEST_HOOK
+90
View File
@@ -0,0 +1,90 @@
# Contributing to Trigger.dev
Thank you for taking the time to contribute to Trigger.dev. Your involvement is not just welcomed, but we encourage it! 🚀
Please take some time to read this guide to understand contributing best practices for Trigger.dev.
Thank you for helping us make Trigger.dev even better! 🤩
## Developing
The development branch is `main`. This is the branch that all pull
requests should be made against. The changes on the `main`
branch are tagged into a release monthly.
### Prerequisites
- [Node.js](https://nodejs.org/en) version >=16.x
- [pnpm package manager](https://pnpm.io/installation) version 7
- [Docker](https://www.docker.com/get-started/)
### Setup
1. Clone the repo into a public GitHub repository or [fork the repo](https://github.com/triggerdotdev/trigger.dev/fork). If you plan to distribute the code, keep the source code public to comply with the [Apache Licence 2.0](https://github.com/triggerdotdev/trigger.dev/blob/main/LICENSE).
```
git clone https://github.com/triggerdotdev/trigger.dev.git
```
> If you are on windows, run the following command on gitbash with admin privileges:
> `git clone -c core.symlinks=true https://triggerdotdev/trigger.dev.git`
2. Navigate to the project folder
```
cd trigger.dev
```
3. Install the required packages using pnpm.
```
pnpm i
```
4. Create your `.env` files
```
cp .env.example .env && cp packages/database/.env.example packages/database/.env
```
5. Open the root `.env` file and fill in the required values Magic Link:
Both of these secrets should be random strings, which you can easily generate (and copy into your pasteboard) with the following command:
```sh
openssl rand -hex 16 | pbcopy
```
<p>Then set them here:</p>
```
SESSION_SECRET=<string>
MAGIC_LINK_SECRET=<string>
```
7. Start Docker. This starts the required services like Postgres.
```
pnpm run docker
```
8. Migrate the database
```
pnpm run db:migrate
```
9. Run the seed script
```
pnpm run db:seed
```
5. Run the app. See the section below.
## Running
1. You can run the app with:
```
pnpm run dev --filter webapp
```
It should run on port `3030`: [http://localhost:3030](http://localhost:3030/)
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.
4. Paste the magic link shown in your terminal into your browser to login.
## Making a pull request
**If you get errors, be sure to fix them before committing.**
- Be sure to [check the "Allow edits from maintainers" option](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork) while creating you PR.
- If your PR refers to or fixes an issue, be sure to add `refs #XXX` or `fixes #XXX` to the PR description. Replacing `XXX` with the respective issue number. See more about [Linking a pull request to an issue
](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue).
- Be sure to fill the PR Template accordingly.
-32
View File
@@ -1,32 +0,0 @@
# Trigger.dev Deployment Guide
## StreamNative Cloud - Hosted Pulsar
### Generic client credentials
```sh
snctl auth export-service-account webapp --key-file webapp-credentials.json
snctl auth export-service-account websocketserver --key-file wss-credentials.json
```
### Topics
#### Triggers (`persistent://triggerdotdev/workflows/triggers`)
Events that trigger workflows to run. These are sent by the "platform" and read by the Web Socket Servers, which then coordinate with the hosts for running the workflows
#### Run Commands (`persistent://triggerdotdev/workflows/run-commands`)
These are events that come from hosts and are published by the Web Socket Servers, e.g. Sending Integration Requests, Sending Logs, Initializing a Delay
#### Run Command Responses (`persistent://triggerdotdev/workflows/run-command-responses`)
These are events that come from the platform and are read by the Web Socket Servers, to resolve or reject a previous Run Command
#### Integration Requests (`persistent://triggerdotdev/queues/integration-requests`)
This is an internal queue used by the platform to perform integration requests, and retry them.
#### App Task Queue (`persistent://triggerdotdev/queues/background-tasks`)
This is an internal queue used by the platform to do tasks in a queue. Basically a background job system.
-231
View File
@@ -1,231 +0,0 @@
# Initial setup
## Prerequisites
### Pulsar requirements
1. Ensure you have Homebrew installed by running `which brew` in terminal. If it's not found then you should install it: https://brew.sh/. Run `which brew` again to check it's found. If it's not you may need to [add it your path](https://stackoverflow.com/questions/36657321/after-installing-homebrew-i-get-zsh-command-not-found-brew)
2. Run `brew install libpulsar` to install the C++ libraries that the pulsar-client depends on
3. Make sure you have Python installed on your machine by running `which python3` in terminal.
4. If python isn't found then you should install it: https://www.python.org/downloads/. In a new terminal window run `which python3` again.
5. Run `npm config set python /the/path/from/the/which/python3/command` inserting the path from step 2 or 3
6. Install node-gyp: `npm install -g node-gyp`
7. Make sure you have the Xcode command line tools installed by running `xcode-select --install` from the terminal. If it says they're already installed then you're set.
8. Run this in the terminal:
```sh
export CPLUS_INCLUDE_PATH="$CPLUS_INCLUDE_PATH:$(brew --prefix)/include"
export LIBRARY_PATH="$LIBRARY_PATH:$(brew --prefix)/lib"
export PULSAR_CPP_DIR=/opt/homebrew/Cellar/libpulsar/3.1.0
```
9. Run `pnpm install` in the same terminal window.
## Building and running the webapp
> **Warning**
> All the following commands should be launched from the **monorepo root directory**
1. Install the dependencies.
```bash
pnpm install
```
2. Optionally, if you are testing auth (pizzly) or webhooks (webapp) then you'll need to use ngrok to proxy internet traffic to your local machine
Get access to ngrok and then follow the instructions here to get it setup: https://ngrok.com/download (use homebrew) and make sure to authenticate.
Then run the following scripts to start proxying:
```sh
./scripts/proxy-pizzly.sh dan-pizzly-dev
./scripts/proxy-webapp.sh dan-trigger-dev
```
3. Environment variables. You will need to create copies of the `.env.example` files in `app/webapp`
```sh
cp ./apps/webapp/.env.example ./apps/webapp/.env
```
Then you will need to fill in the fields with real values.
You also need to create the `pizzly-server.env` files under the `.docker` directory:
```sh
cp ./.docker/pizzly-server.env.example ./.docker/pizzly-server.env
```
Next, update the `AUTH_CALLBACK_URL` env var in the `pizzly-server.env` env file with the value provided to the `./scripts/proxy-pizzly.sh` command. Using the example above the `AUTH_CALLBACK_URL` would be `AUTH_CALLBACK_URL=https://dan-pizzly-dev.eu.ngrok.io/oauth/callback`.
If you aren't proxying pizzly according to step 2, then leave the `pizzly-server.env` file empty.
If you are proxying the webapp according to step 2 then in `webapp/.env`, set the `APP_ORIGIN` to the `NGROK_SUBDOMAIN` provided to the `./scripts/proxy-webapp.sh` command, e.g. `APP_ORIGIN=https://dan-trigger-dev.eu.ngrok.io`
4. Start postgresql, redis, pizzly server, followed by pulsar standalone
```bash
pnpm run docker:services
pnpm run docker:pulsar
```
> **Note:** The npm script will complete while Docker sets up the container in the background. Ensure that Docker has finished and your container is running before proceeding.
5. Generate prisma schema
```bash
pnpm run generate
```
6. Run the Prisma migration to the database
```bash
pnpm run db:migrate:deploy
```
7. Run the first build (with dependencies via the `...` option)
```bash
pnpm run build --filter=webapp...
```
**Running simply `pnpm run build` will build everything, including the Remix app.**
8. Run the Remix dev server
```bash
pnpm run dev --filter=webapp
```
## Attaching an API integration using Pizzly
```bash
PIZZLY_HOSTPORT=http://localhost:3004 npx pizzly config:create github github <client-id> <client-secret> "repo,user"
```
## Tests, Typechecks, Lint, Install packages...
Check the `turbo.json` file to see the available pipelines.
- Run the Cypress tests and Dev
```bash
pnpm run test:e2e:dev --filter=webapp
```
- Lint everything
```bash
pnpm run lint
```
- Typecheck the whole monorepo
```bash
pnpm run typecheck
```
- Test the whole monorepo
```bash
pnpm run test
or
pnpm run test:dev
```
- How to install an npm package in the Remix app ?
```bash
pnpm add dayjs --filter webapp
```
- Tweak the tsconfigs, eslint configs in the `config-package` folder. Any package or app will then extend from these configs.
# Running a workflow locally
## After pulling a change
1. Ensure there are no database migrations to run
```bash
pnpm run db:migrate:dev
```
2. Generate the Prisma database client
```bash
pnpm run generate
```
3. Install packages
```bash
pnpm install
```
4. Build everything
```bash
pnpm run build
```
5. Install packages again, this makes sure the local packages are linked
```bash
pnpm install
```
## Running the servers
1. Ensure the docker containers are running
```bash
pnpm run docker:services
pnpm run docker:pulsar
```
2. Run the webapp
```bash
pnpm run dev --filter=webapp
```
3. Run the Web Socket Server
```bash
pnpm run dev --filter=wss
```
4. Build all the @trigger.dev/\* packages
```bash
pnpm run dev --filter="@trigger.dev/*"
```
## Running the smoke test
1. Run the smoke test workflow
```bash
cd ./examples/smoke-test
pnpm run dev
```
2. Running the workflow requires you to send data to the local API.
You can use this cURL command to send a `user.created` event. This will run the workflow and generate the corresponding logs.
```bash
curl --request POST \
--url http://localhost:3000/api/v1/events \
--header 'Authorization: Bearer trigger_dev_zC25mKNn6c0q' \
--header 'Content-Type: application/json' \
--data '{
"name": "user.created",
"payload": {
"id": "123"
}
}'
```
## Dependency & Package graph
![Dependency Graph](assets/dependencyGraph.png)
## Warp Launch Configuration
Setup a custom launch configuration for the Warp terminal ([docs here](https://docs.warp.dev/features/sessions/launch-configurations)) by copying the `.warp/triggerdotdev.yaml.example` file to `~/.warp/launch_configurations/triggerdotdev.yaml`. Make sure you edit the file and replace `<your-trigger-dev>` and `<your-pizzly-dev>` with your custom ngrok subdomains.
+2 -43
View File
@@ -7,7 +7,7 @@
### The background jobs framework for Next.js
[Discord](https://discord.gg/bpVDSjcG) | [Website](https://trigger.dev) | [Issues](https://github.com/triggerdotdev/trigger.dev/issues) | [Docs](https://trigger.dev/docs)
[Discord](https://discord.gg/JtBAxBr2m3) | [Website](https://trigger.dev) | [Issues](https://github.com/triggerdotdev/trigger.dev/issues) | [Docs](https://trigger.dev/docs)
[![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)
@@ -60,46 +60,5 @@ We provide an official trigger.dev docker image you can use to easily self-host
## Development
### Prerequisites
- [Node.js](https://nodejs.org/en) version >=18.x
- [pnpm package manager](https://pnpm.io/installation) version 7
- [Docker](https://www.docker.com/get-started/)
To setup and develop locally or contribute to the open source project, follow our [developement guide](./CONTRIBUTING.md).
### Setup
1. Clone the repo into a public GitHub repository or [fork the repo](https://github.com/triggerdotdev/trigger.dev/fork). If you plan to distribute the code, keep the source code public to comply with the [Apache Licence 2.0](https://github.com/triggerdotdev/trigger.dev/blob/main/LICENSE).
```
git clone https://github.com/triggerdotdev/trigger.dev.git
```
> If you are on windows, run the following command on gitbash with admin privileges:
> `git clone -c core.symlinks=true https://triggerdotdev/trigger.dev.git`
2. Navigate to the project folder
```
cd trigger.dev
```
3. Install the required packages using pnpm.
```
pnpm i
```
4. Create your `.env` files
```
cp .env.example .env && cp packages/database/.env.example packages/database/.env
```
Open the root `.env` file and fill in the required values.
6. Start Docker. This starts the required services like Postgres.
```
pnpm run docker
```
7. Migrate the database
```
pnpm run db:migrate
```
8. Run the seed script
```
pnpm run db:seed
```
5. Run the project. It should run on `port:3030`
```
pnpm run dev --filter webapp
```
@@ -0,0 +1,18 @@
export function ErrorIcon({ className }: { className?: string }) {
return (
<svg
className={className}
viewBox="0 0 20 20"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<circle cx="10" cy="10" r="7" fill="white" />
<path
fillRule="evenodd"
clipRule="evenodd"
d="M18 10C18 14.4183 14.4183 18 10 18C5.58172 18 2 14.4183 2 10C2 5.58172 5.58172 2 10 2C14.4183 2 18 5.58172 18 10ZM10 5C10.4142 5 10.75 5.33579 10.75 5.75V10.25C10.75 10.6642 10.4142 11 10 11C9.58579 11 9.25 10.6642 9.25 10.25V5.75C9.25 5.33579 9.58579 5 10 5ZM10 15C10.5523 15 11 14.5523 11 14C11 13.4477 10.5523 13 10 13C9.44771 13 9 13.4477 9 14C9 14.5523 9.44771 15 10 15Z"
fill="currentColor"
/>
</svg>
);
}
+4 -4
View File
@@ -1,7 +1,7 @@
import { ReactNode } from "react";
import { MainCenteredContainer } from "./layout/AppLayout";
import { Header1, Header2 } from "./primitives/Headers";
import { NamedIcon, NamedIconInBox } from "./primitives/NamedIcon";
import { Header2 } from "./primitives/Headers";
import { NamedIconInBox } from "./primitives/NamedIcon";
import { Paragraph } from "./primitives/Paragraph";
type ComingSoonProps = {
@@ -23,9 +23,9 @@ export function ComingSoon({ title, description, icon }: ComingSoonProps) {
) : (
icon
)}
<div className="mt-0.5 flex flex-col">
<div className="mt-0.5 flex flex-col gap-y-1">
<Paragraph variant="extra-extra-small/caps">Coming soon</Paragraph>
<Header1 className="-mt-0.5">{title}</Header1>
<Header2 className="-mt-0.5">{title}</Header2>
</div>
</div>
<Paragraph variant="small" className="p-4">
@@ -0,0 +1,59 @@
import { isRouteErrorResponse, useRouteError } from "@remix-run/react";
import { LinkButton } from "./primitives/Buttons";
import { Header1, Header3 } from "./primitives/Headers";
import { friendlyErrorDisplay } from "~/utils/httpErrors";
type ErrorDisplayOptions = {
button?: {
title: string;
to: string;
};
};
export function RouteErrorDisplay(options?: ErrorDisplayOptions) {
const error = useRouteError();
return (
<>
{isRouteErrorResponse(error) ? (
<ErrorDisplay
title={friendlyErrorDisplay(error.status, error.statusText).title}
message={
error.data.message ??
friendlyErrorDisplay(error.status, error.statusText).message
}
{...options}
/>
) : error instanceof Error ? (
<ErrorDisplay title={error.name} message={error.message} {...options} />
) : (
<ErrorDisplay
title="Oops"
message={JSON.stringify(error)}
{...options}
/>
)}
</>
);
}
type DisplayOptionsProps = {
title: string;
message?: string;
} & ErrorDisplayOptions;
export function ErrorDisplay({ title, message, button }: DisplayOptionsProps) {
return (
<div className="p-4">
<Header1 className="mb-4 border-b border-slate-800 pb-4">{title}</Header1>
{message && <Header3>{message}</Header3>}
<LinkButton
to={button ? button.to : "/"}
variant="primary/medium"
className="mt-8"
>
{button ? button.title : "Home"}
</LinkButton>
</div>
);
}
@@ -0,0 +1,14 @@
import { H, HighlightOptions } from "highlight.run";
import { useEffect } from "react";
interface Props extends HighlightOptions {
projectId?: string;
}
export function HighlightInit({ projectId, ...highlightOptions }: Props) {
useEffect(() => {
projectId && H.init(projectId, highlightOptions);
}, []); // eslint-disable-line react-hooks/exhaustive-deps
return null;
}
@@ -23,9 +23,9 @@ export function UserAvatar({
className?: string;
}) {
return avatarUrl ? (
<div>
<div className={cn("grid aspect-square place-items-center", className)}>
<img
className={cn("aspect-square rounded-full p-[7%]", className)}
className={cn("aspect-square rounded-full p-[7%]")}
src={avatarUrl}
alt={name ?? "User"}
/>
@@ -1,97 +1,44 @@
import { Paragraph, TextLink } from "~/components/primitives/Paragraph";
import { Link } from "@remix-run/react";
import { Paragraph } from "~/components/primitives/Paragraph";
import { StepNumber } from "~/components/primitives/StepNumber";
import { IntegrationIcon } from "~/routes/_app.orgs.$organizationSlug.projects.$projectParam.integrations/route";
import { Callout } from "../primitives/Callout";
import integrationButton from "./integration-button.png";
import ngrok from "./ngrok.png";
import publicUrl from "./public-url.png";
import { useAppOrigin } from "~/hooks/useAppOrigin";
import { useDevEnvironment } from "~/hooks/useEnvironments";
import { ClipboardField } from "../primitives/ClipboardField";
import { Button } from "../primitives/Buttons";
import { useJob } from "~/hooks/useJob";
import { useOrganization } from "~/hooks/useOrganizations";
import { useProject } from "~/hooks/useProject";
import { IntegrationIcon } from "~/routes/_app.orgs.$organizationSlug.projects.$projectParam.integrations/route";
import { jobTestPath } from "~/utils/pathBuilder";
import { InlineCode } from "../code/InlineCode";
import { HelpPanelProps } from "../integrations/ApiKeyHelp";
import { HelpInstall } from "../integrations/HelpInstall";
import { HelpSamples } from "../integrations/HelpSamples";
import { Button, LinkButton } from "../primitives/Buttons";
import { Callout, variantClasses } from "../primitives/Callout";
import {
ClientTabs,
ClientTabsContent,
ClientTabsList,
ClientTabsTrigger,
} from "../primitives/ClientTabs";
import { ClipboardField } from "../primitives/ClipboardField";
import integrationButton from "./integration-button.png";
import selectEnvironment from "./select-environment.png";
import selectExample from "./select-example.png";
import { Header2 } from "../primitives/Headers";
import { CodeBlock } from "../code/CodeBlock";
import { EnvironmentLabel } from "../environments/EnvironmentLabel";
import { TextLink } from "../primitives/TextLink";
export function HowToSetupYourProject() {
const devEnvironment = useDevEnvironment();
const appOrigin = useAppOrigin();
return (
<>
<StepNumber stepNumber="1" title="Run your Next.js app" />
<StepContentContainer>
<Paragraph>
Ensure your Next.js app is running locally on port 3000.
</Paragraph>
</StepContentContainer>
<StepNumber stepNumber="2" title="Create a tunnel to your Next.js app" />
<StepNumber stepNumber="1" title="Run the CLI init command" />
<StepContentContainer>
<Paragraph spacing>
There are a few ways to do this, but we recommend using{" "}
<TextLink
href="https://trigger.dev/docs/documentation/guides/tunneling-localhost"
target="_blank"
>
ngrok
</TextLink>
. Its free and easy to use and required to create a tunnel, making
your local machine accessible to the internet.
Run this CLI command in a terminal window from your Next.js project.
</Paragraph>
<StepNumber stepNumber="a" title="Install ngrok" className="mb-2" />
<StepContentContainer>
<ClientTabs defaultValue="mac">
<ClientTabsList>
<ClientTabsTrigger value={"mac"}>Mac</ClientTabsTrigger>
<ClientTabsTrigger value={"windows"}>Windows</ClientTabsTrigger>
</ClientTabsList>
<ClientTabsContent value={"mac"}>
<ClipboardField
variant="primary/medium"
fullWidth={false}
value={`brew install ngrok/ngrok/ngrok`}
/>
</ClientTabsContent>
<ClientTabsContent value={"windows"}>
<ClipboardField
variant="primary/medium"
fullWidth={false}
value={`choco install ngrok`}
/>
</ClientTabsContent>
</ClientTabs>
</StepContentContainer>
<StepNumber stepNumber="b" title="Open a new terminal window/tab" />
<StepContentContainer>
<Paragraph spacing>You need to leave this running.</Paragraph>
</StepContentContainer>
<StepNumber stepNumber="c" title="Create an http tunnel at port 3000" />
<StepContentContainer>
<Paragraph spacing>
This creates a tunnel to your Next.js app.
</Paragraph>
<ClipboardField
variant="primary/medium"
fullWidth={false}
className="mb-4"
value={`ngrok http 3000`}
/>
</StepContentContainer>
<StepNumber
stepNumber="d"
title={`Grab your "forwarding" URL from the ngrok output`}
/>
<StepContentContainer>
<img src={ngrok} className="mt-2 w-full" />
</StepContentContainer>
</StepContentContainer>
<StepNumber stepNumber="3" title="Use the CLI" />
<StepContentContainer>
<Paragraph spacing>
Copy this CLI command into a new terminal window.{" "}
</Paragraph>
<ClientTabs defaultValue="npm">
<ClientTabsList>
<ClientTabsTrigger value={"npm"}>npm</ClientTabsTrigger>
@@ -102,42 +49,87 @@ export function HowToSetupYourProject() {
<ClipboardField
variant="primary/medium"
className="mb-4"
secure="npx @trigger.dev/init@latest -k ••••••••• -t https://cloud.trigger.dev -u <ngrok_forwarding_url>"
value={`npx @trigger.dev/init@latest -k ${devEnvironment?.apiKey} -t https://cloud.trigger.dev -u <ngrok_forwarding_url>`}
secure={`npx @trigger.dev/cli@latest init -k ••••••••• -t ${appOrigin}`}
value={`npx @trigger.dev/cli@latest init -k ${devEnvironment?.apiKey} -t ${appOrigin}`}
/>
</ClientTabsContent>
<ClientTabsContent value={"pnpm"}>
<ClipboardField
variant="primary/medium"
className="mb-4"
secure="pnpm dlx @trigger.dev/init@latest -k ••••••••• -t https://cloud.trigger.dev -u <ngrok_forwarding_url>"
value={`pnpm dlx @trigger.dev/init@latest -k ${devEnvironment?.apiKey} -t https://cloud.trigger.dev -u <ngrok_forwarding_url>`}
secure={`pnpm dlx @trigger.dev/cli@latest init -k ••••••••• -t ${appOrigin}`}
value={`pnpm dlx @trigger.dev/cli@latest init -k ${devEnvironment?.apiKey} -t ${appOrigin}`}
/>
</ClientTabsContent>
<ClientTabsContent value={"yarn"}>
<ClipboardField
variant="primary/medium"
className="mb-4"
secure="yarn @trigger.dev/init@latest -k ••••••••• -t https://cloud.trigger.dev -u <ngrok_forwarding_url>"
value={`yarn @trigger.dev/init@latest -k ${devEnvironment?.apiKey} -t https://cloud.trigger.dev -u <ngrok_forwarding_url>`}
secure={`yarn @trigger.dev/cli@latest init -k ••••••••• -t ${appOrigin}`}
value={`yarn @trigger.dev/cli@latest init -k ${devEnvironment?.apiKey} -t ${appOrigin}`}
/>
</ClientTabsContent>
</ClientTabs>
<Paragraph spacing>
Use the "forwarding" URL from step 2d above to replace the -u
placeholder text.
<Paragraph spacing variant="small">
It will ask you for a "unique ID for your endpoint". You can use the
default by hitting enter.
</Paragraph>
<img src={publicUrl} className="mb-4 mt-2 w-full" />
</StepContentContainer>
<StepNumber stepNumber="4" title="Run the CLI" />
<StepNumber stepNumber="2" title="Run your Next.js app" />
<StepContentContainer>
<Paragraph>
Ensure your Next.js app is running locally on port 3000.
</Paragraph>
</StepContentContainer>
<StepNumber stepNumber="3" title="Run the CLI dev command" />
<StepContentContainer>
<Paragraph spacing>
It will add Trigger.dev to your existing Next.js project, setup a
route and give you an example file.
The CLI <InlineCode>dev</InlineCode> command allows the Trigger.dev
service to send messages to your Next.js site. This is required for
registering Jobs, triggering them and running Tasks. To achieve this
it creates a tunnel (using{" "}
<TextLink href="https://ngrok.com/">ngrok</TextLink>) so Trigger.dev
can send messages to your machine.
</Paragraph>
<Paragraph spacing>
You should leave the <InlineCode>dev</InlineCode> command running when
you're developing.
</Paragraph>
<Paragraph spacing>
In a{" "}
<strong className="text-bright">new terminal window or tab</strong>{" "}
run:
</Paragraph>
<ClientTabs defaultValue="npm">
<ClientTabsList>
<ClientTabsTrigger value={"npm"}>npm</ClientTabsTrigger>
<ClientTabsTrigger value={"pnpm"}>pnpm</ClientTabsTrigger>
<ClientTabsTrigger value={"yarn"}>yarn</ClientTabsTrigger>
</ClientTabsList>
<ClientTabsContent value={"npm"}>
<ClipboardField
variant="primary/medium"
className="mb-4"
value={`npx @trigger.dev/cli@latest dev`}
/>
</ClientTabsContent>
<ClientTabsContent value={"pnpm"}>
<ClipboardField
variant="primary/medium"
className="mb-4"
value={`pnpm dlx @trigger.dev/cli@latest dev`}
/>
</ClientTabsContent>
<ClientTabsContent value={"yarn"}>
<ClipboardField
variant="primary/medium"
className="mb-4"
value={`yarn @trigger.dev/cli@latest dev`}
/>
</ClientTabsContent>
</ClientTabs>
</StepContentContainer>
<StepNumber stepNumber="5" title="Check for Jobs" />
<StepNumber stepNumber="4" title="Check for Jobs" />
<StepContentContainer>
<Paragraph>
Once you've run the CLI command, click Refresh to view your example
@@ -156,13 +148,100 @@ export function HowToSetupYourProject() {
);
}
export function HowToRunYourJob() {
const organization = useOrganization();
const project = useProject();
const job = useJob();
return (
<>
<Callout variant="info" className="mb-6">
<Paragraph variant={"small"} className={variantClasses.info.textColor}>
Scheduled Triggers <strong>do not</strong> trigger Jobs in the DEV
Environment. When developing locally you should use the{" "}
<Link
to={jobTestPath(organization, project, job)}
className="underline underline-offset-2 transition hover:text-blue-100"
>
Test feature
</Link>{" "}
to trigger any scheduled Jobs.
</Paragraph>
</Callout>
<Paragraph spacing>There are two ways to run your Job:</Paragraph>
<StepNumber stepNumber="1" title="Trigger a test Run" />
<StepContentContainer>
<Paragraph spacing>
You can perform a Run with any payload you want, or use one of our
examples, on the test page.
</Paragraph>
<LinkButton
to={jobTestPath(organization, project, job)}
variant={"primary/small"}
LeadingIcon={"beaker"}
leadingIconClassName="text-bright"
>
Test
</LinkButton>
</StepContentContainer>
<StepNumber stepNumber="2" title="Trigger your Job for real" />
<StepContentContainer>
<Paragraph spacing>
Performing a real run depends on the type of Trigger your Job is
using.
</Paragraph>
<LinkButton
to="https://trigger.dev/docs/documentation/guides/running-jobs"
variant={"primary/small"}
LeadingIcon={"docs"}
leadingIconClassName="text-bright"
>
How to run a Job
</LinkButton>
</StepContentContainer>
</>
);
}
export function HowToRunATest() {
return (
<>
<StepNumber stepNumber="1" title="Step 1 title" />
<StepNumber
stepNumber="1"
title="Select an environment
"
/>
<StepContentContainer>
<Paragraph>Content</Paragraph>
<Paragraph spacing>
Select the environment youd like the test to run against.
</Paragraph>
<img src={selectEnvironment} className="mt-2 w-52" />
</StepContentContainer>
<StepNumber stepNumber="2" title="Write your test payload" />
<StepContentContainer>
<Paragraph spacing>
Write your own payload specific to your Job. Some Triggers also
provide example payloads that you can select from. This will populate
the code editor below.
</Paragraph>
<img src={selectExample} className="mt-2 h-40" />
</StepContentContainer>
<StepNumber stepNumber="3" title="Run your test" />
<StepContentContainer>
<Paragraph spacing>
When youre happy with the payload, click Run test.
</Paragraph>
</StepContentContainer>
<Callout
variant="docs"
to="https://trigger.dev/docs/documentation/guides/testing-jobs"
>
Learn more about running tests.
</Callout>
</>
);
}
@@ -207,7 +286,7 @@ export function HowToConnectAnIntegration() {
</StepContentContainer>
<Callout
variant={"docs"}
href="https://trigger.dev/docs/integrations/introduction"
to="https://trigger.dev/docs/integrations/introduction"
>
View the Integration docs page for more information on connecting an API
using an Integration or other method.
@@ -216,13 +295,124 @@ export function HowToConnectAnIntegration() {
);
}
export function HowToUseThisIntegration() {
export function HowToUseThisIntegration({
integration,
help,
integrationClient,
}: HelpPanelProps) {
return (
<>
<StepNumber stepNumber="1" title="Step 1 title" />
<StepNumber stepNumber="1" title="Install the package" />
<StepContentContainer>
<Paragraph>Content</Paragraph>
<HelpInstall packageName={integration.packageName} />
</StepContentContainer>
{help && (
<>
<StepNumber stepNumber="2" title="Create a Job" />
<StepContentContainer>
<HelpSamples
help={help}
integration={integration}
integrationClient={integrationClient}
/>
</StepContentContainer>
</>
)}
</>
);
}
export function HowToUseApiKeysAndEndpoints() {
return (
<>
<Paragraph spacing>
Environments and Endpoints are used to connect your server to the
Trigger.dev platform.
</Paragraph>
<Header2 spacing>Environments</Header2>
<Paragraph spacing>
Each environment has an API Key associated with it. This API Key is used
to authenticate your Jobs with the Trigger.dev platform.
</Paragraph>
<Paragraph spacing>
The API Key you use for your{" "}
<TextLink to="https://trigger.dev/docs/documentation/concepts/client-adaptors">
Client
</TextLink>{" "}
is how we know which environment to run your code against:
</Paragraph>
<CodeBlock
showLineNumbers={false}
className="mb-4"
code={`export const client = new TriggerClient({
id: "nextjs-example",
//this environment variable should be set to your DEV API Key locally,
//and your PROD API Key in production
apiKey: process.env.TRIGGER_API_KEY!,
});`}
/>
<StepNumber
stepNumber="→"
title={
<span className="flex items-center gap-x-2">
<span>Development</span>
<EnvironmentLabel environment={{ type: "DEVELOPMENT" }} />
</span>
}
/>
<StepContentContainer>
<Paragraph>
The <InlineCode>DEV</InlineCode> environment should only be used for
local development. Its where you can test your Jobs before deploying
them to servers.
</Paragraph>
<Callout variant="warning" className="my-2">
Scheduled Triggers do not trigger Jobs in the DEV Environment. When
youre working locally you should use the Test feature to trigger any
scheduled Jobs.
</Callout>
</StepContentContainer>
<StepNumber
stepNumber="→"
title={
<span className="flex items-center gap-x-2">
<span>Production</span>
<EnvironmentLabel environment={{ type: "PRODUCTION" }} />
</span>
}
/>
<StepContentContainer>
<Paragraph spacing>
The <InlineCode>PROD</InlineCode> environment is where your Jobs will
run in production. Its where you can run your Jobs against real data.
</Paragraph>
</StepContentContainer>
<Header2 spacing>Endpoints</Header2>
<Paragraph spacing>
An Endpoint is a URL on your server that Trigger.dev can connect to.
This URL is used to register Jobs, start them and orchestrate runs and
retries.
</Paragraph>
<Paragraph spacing>
<InlineCode>DEV</InlineCode> has multiple endpoints associated with it
one for each team member. This allows each team member to run their own
Jobs, without interfering with each other.
</Paragraph>
<Paragraph spacing>
All other environments have just a single endpoint (with a single URL)
associated with them.
</Paragraph>
<Header2 spacing>Deployment</Header2>
<Paragraph spacing>
Deployment uses Environments and Endpoints to connect your Jobs to the
Trigger.dev platform.
</Paragraph>
<Callout
variant="docs"
to="https://trigger.dev/docs/documentation/guides/deployment"
>
Read the deployment guide to learn more.
</Callout>
</>
);
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

@@ -1,20 +1,26 @@
import {
ApiAuthenticationMethodApiKey,
Integration,
} from "~/services/externalApis/types";
import { Paragraph } from "../primitives/Paragraph";
import { CodeBlock } from "../code/CodeBlock";
import { Help, Integration } from "~/services/externalApis/types";
import { InlineCode } from "../code/InlineCode";
import { Header1, Header2 } from "../primitives/Headers";
import { ClipboardField } from "../primitives/ClipboardField";
import { Header1 } from "../primitives/Headers";
import { Paragraph } from "../primitives/Paragraph";
import { HelpInstall } from "./HelpInstall";
import { HelpSamples, ReplacementData } from "./HelpSamples";
export type HelpPanelIntegration = Pick<
Integration,
"name" | "packageName" | "identifier"
>;
export type HelpPanelProps = {
integration: HelpPanelIntegration;
help?: Help;
integrationClient?: ReplacementData;
};
export function ApiKeyHelp({
integration,
apiAuth,
}: {
integration: Integration;
apiAuth: ApiAuthenticationMethodApiKey;
}) {
help,
integrationClient,
}: HelpPanelProps) {
return (
<div className="mt-4">
<Header1 className="mb-2">
@@ -28,21 +34,14 @@ export function ApiKeyHelp({
First install the <InlineCode>{integration.packageName}</InlineCode>{" "}
package using your preferred package manager. For example:
</Paragraph>
<ClipboardField
variant="secondary/medium"
value={`npm install ${integration.packageName}`}
className="mb-4"
/>
{apiAuth.help.samples.map((sample, i) => (
<div key={i}>
<Paragraph spacing>{sample.title}</Paragraph>
<CodeBlock
code={sample.code}
className="mb-4"
highlightedRanges={sample.highlight}
/>
</div>
))}
<HelpInstall packageName={integration.packageName} />
{help && (
<HelpSamples
help={help}
integration={integration}
integrationClient={integrationClient}
/>
)}
</div>
);
}
@@ -5,7 +5,7 @@ import {
} from "~/services/externalApis/types";
import { docsIntegrationPath } from "~/utils/pathBuilder";
import { LinkButton } from "../primitives/Buttons";
import { Header2 } from "../primitives/Headers";
import { Header1, Header2 } from "../primitives/Headers";
import { NamedIconInBox } from "../primitives/NamedIcon";
import { Paragraph } from "../primitives/Paragraph";
import { RadioGroup, RadioGroupItem } from "../primitives/RadioButton";
@@ -50,7 +50,7 @@ export function ConnectToIntegrationSheet({
<SheetHeader>
<NamedIconInBox name={integration.identifier} className="h-9 w-9" />
<div className="grow">
<Header2>{integration.name}</Header2>
<Header1>{integration.name}</Header1>
{integration.description && (
<Paragraph variant="small">{integration.description}</Paragraph>
)}
@@ -129,12 +129,7 @@ function SelectedIntegrationMethod({
case "apikey":
const apiAuth = authMethods.find((a) => a.type === "apikey");
if (!apiAuth) return null;
return (
<ApiKeyHelp
integration={integration}
apiAuth={apiAuth as ApiAuthenticationMethodApiKey}
/>
);
return <ApiKeyHelp integration={integration} help={apiAuth.help} />;
case "oauth2":
return (
<SelectOAuthMethod
@@ -0,0 +1,45 @@
import { Integration } from "~/services/externalApis/types";
import { InlineCode } from "../code/InlineCode";
import {
ClientTabs,
ClientTabsList,
ClientTabsTrigger,
ClientTabsContent,
} from "../primitives/ClientTabs";
import { ClipboardField } from "../primitives/ClipboardField";
import { Paragraph } from "../primitives/Paragraph";
export function HelpInstall({ packageName }: { packageName: string }) {
return (
<>
<ClientTabs defaultValue="npm">
<ClientTabsList>
<ClientTabsTrigger value={"npm"}>npm</ClientTabsTrigger>
<ClientTabsTrigger value={"pnpm"}>pnpm</ClientTabsTrigger>
<ClientTabsTrigger value={"yarn"}>yarn</ClientTabsTrigger>
</ClientTabsList>
<ClientTabsContent value={"npm"}>
<ClipboardField
variant="secondary/medium"
value={`npm install ${packageName}`}
className="mb-4"
/>
</ClientTabsContent>
<ClientTabsContent value={"pnpm"}>
<ClipboardField
variant="secondary/medium"
value={`pnpm install ${packageName}`}
className="mb-4"
/>
</ClientTabsContent>
<ClientTabsContent value={"yarn"}>
<ClipboardField
variant="secondary/medium"
value={`yarn add ${packageName}`}
className="mb-4"
/>
</ClientTabsContent>
</ClientTabs>
</>
);
}
@@ -0,0 +1,62 @@
import { Integration } from "~/services/externalApis/types";
import { HelpPanelIntegration, HelpPanelProps } from "./ApiKeyHelp";
import { Paragraph } from "../primitives/Paragraph";
import { CodeBlock } from "../code/CodeBlock";
export type ReplacementData = {
slug: string;
};
export function HelpSamples({
help,
integrationClient,
integration,
}: HelpPanelProps) {
return (
<>
{help &&
help.samples.map((sample, i) => {
const code = runReplacers(
sample.code,
integrationClient,
integration
);
return (
<div key={i}>
<Paragraph spacing>{sample.title}</Paragraph>
<CodeBlock
code={code}
className="mb-4"
highlightedRanges={sample.highlight}
/>
</div>
);
})}
</>
);
}
const replacements = [
{
match: /__SLUG__/g,
replacement: (
data: ReplacementData | undefined,
integration: HelpPanelIntegration
) => {
if (data) return data.slug;
return integration.identifier;
},
},
];
function runReplacers(
code: string,
replacementData: ReplacementData | undefined,
integration: HelpPanelIntegration
) {
replacements.forEach((r) => {
code = code.replace(r.match, r.replacement(replacementData, integration));
});
return code;
}
@@ -0,0 +1,63 @@
import { docsIntegrationPath } from "~/utils/pathBuilder";
import { LinkButton } from "../primitives/Buttons";
import { Header1 } from "../primitives/Headers";
import { NamedIconInBox } from "../primitives/NamedIcon";
import { Paragraph } from "../primitives/Paragraph";
import {
Sheet,
SheetBody,
SheetContent,
SheetHeader,
SheetTrigger,
} from "../primitives/Sheet";
import { SelectOAuthMethod } from "./SelectOAuthMethod";
import { Integration } from "~/services/externalApis/types";
import { Client } from "~/presenters/IntegrationsPresenter.server";
export function IntegrationWithMissingFieldSheet({
integration,
organizationId,
button,
callbackUrl,
existingIntegration,
className,
}: {
integration: Integration;
organizationId: string;
button: React.ReactNode;
callbackUrl: string;
existingIntegration: Client;
className?: string;
}) {
return (
<Sheet>
<SheetTrigger className={className}>{button}</SheetTrigger>
<SheetContent size="lg" className="relative">
<SheetHeader>
<NamedIconInBox name={integration.identifier} className="h-9 w-9" />
<div className="grow">
<Header1>{integration.name}</Header1>
{integration.description && (
<Paragraph variant="small">{integration.description}</Paragraph>
)}
</div>
<LinkButton
to={docsIntegrationPath(integration.identifier)}
variant="secondary/small"
LeadingIcon="docs"
>
View docs
</LinkButton>
</SheetHeader>
<SheetBody>
<SelectOAuthMethod
integration={integration}
organizationId={organizationId}
callbackUrl={callbackUrl}
existingIntegration={existingIntegration}
/>
</SheetBody>
</SheetContent>
</Sheet>
);
}
@@ -41,7 +41,7 @@ export function NoIntegrationSheet({
<div className="flex items-center gap-1">
<CheckIcon className="h-4 w-4 text-green-500" />
<Paragraph variant="small">
We'll let you know when the integration is available.
We'll let you know when the Integration is available.
</Paragraph>
</div>
) : (
@@ -56,16 +56,16 @@ export function NoIntegrationSheet({
>
{isLoading
? "Saving…"
: `I want an integration for ${api.name}`}
: `I want an Integration for ${api.name}`}
</Button>
</fetcher.Form>
)}
</SheetHeader>
<SheetBody>
<Callout variant="info">
We dont have an integration for the {api.name} API yet but you can
We dont 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 the methods below.
to {api.name} using one of the methods below.
</Callout>
<CustomHelp name={api.name} />
</SheetBody>
@@ -8,12 +8,16 @@ import type { ConnectionType } from "@trigger.dev/database";
import { Header2 } from "../primitives/Headers";
import { ConnectToOAuthForm } from "./ConnectToOAuthForm";
import { Paragraph } from "../primitives/Paragraph";
import { Client } from "~/presenters/IntegrationsPresenter.server";
import { UpdateOAuthForm } from "./UpdateOAuthForm";
export function SelectOAuthMethod({
integration,
organizationId,
callbackUrl
callbackUrl,
existingIntegration,
}: {
existingIntegration?: Client;
integration: Integration;
organizationId: string;
callbackUrl: string;
@@ -91,14 +95,26 @@ export function SelectOAuthMethod({
connectionType &&
oAuthKey &&
(connectionType === "DEVELOPER" ? (
<ConnectToOAuthForm
integration={integration}
authMethod={selectedOAuthMethod}
authMethodKey={oAuthKey}
organizationId={organizationId}
clientType={connectionType}
callbackUrl={callbackUrl}
/>
existingIntegration ? (
<UpdateOAuthForm
existingIntegration={existingIntegration}
integration={integration}
authMethod={selectedOAuthMethod}
authMethodKey={oAuthKey}
organizationId={organizationId}
clientType={connectionType}
callbackUrl={callbackUrl}
/>
) : (
<ConnectToOAuthForm
integration={integration}
authMethod={selectedOAuthMethod}
authMethodKey={oAuthKey}
organizationId={organizationId}
clientType={connectionType}
callbackUrl={callbackUrl}
/>
)
) : (
<>
<Header2 className="mb-1 mt-4">User OAuth coming soon</Header2>
@@ -0,0 +1,263 @@
import { conform, useForm } from "@conform-to/react";
import { parse } from "@conform-to/zod";
import { useFetcher, useLocation, useNavigation } from "@remix-run/react";
import type { ConnectionType } from "@trigger.dev/database";
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 { cn } from "~/utils/cn";
import { CodeBlock } from "../code/CodeBlock";
import { Button } from "../primitives/Buttons";
import { Checkbox } from "../primitives/Checkbox";
import { Fieldset } from "../primitives/Fieldset";
import { FormError } from "../primitives/FormError";
import { Header2, Header3 } from "../primitives/Headers";
import { Input } from "../primitives/Input";
import { InputGroup } from "../primitives/InputGroup";
import { Label } from "../primitives/Label";
import { Paragraph } from "../primitives/Paragraph";
import { Client } from "~/presenters/IntegrationsPresenter.server";
import { schema } from "~/routes/resources.connection.$organizationId.oauth2.$integrationId";
export type Status = "loading" | "idle";
export function UpdateOAuthForm({
existingIntegration,
integration,
authMethod,
authMethodKey,
organizationId,
clientType,
callbackUrl,
}: {
existingIntegration: Client;
integration: Integration;
authMethod: ApiAuthenticationMethodOAuth2;
authMethodKey: string;
organizationId: string;
clientType: ConnectionType;
callbackUrl: string;
}) {
const transition = useNavigation();
const fetcher = useFetcher();
const { isManagedCloud } = useFeatures();
const [
form,
{ title, scopes, hasCustomClient, customClientId, customClientSecret },
] = useForm({
lastSubmission: fetcher.data,
onValidate({ formData }) {
return parse(formData, {
schema,
});
},
});
const location = useLocation();
const [selectedScopes, setSelectedScopes] = useState<Set<string>>(
new Set(
authMethod.scopes.filter((s) => s.defaultChecked).map((s) => s.name)
)
);
const requiresCustomOAuthApp = clientType === "EXTERNAL" || !isManagedCloud;
const [useMyOAuthApp, setUseMyOAuthApp] = useState(requiresCustomOAuthApp);
const { filterText, setFilterText, filteredItems } = useTextFilter<Scope>({
items: authMethod.scopes,
filter: (scope, text) => {
if (scope.name.toLowerCase().includes(text.toLowerCase())) return true;
if (
scope.description &&
scope.description.toLowerCase().includes(text.toLowerCase())
)
return true;
return false;
},
});
return (
<fetcher.Form
method="put"
action={`/resources/connection/${organizationId}/oauth2/${existingIntegration.id}`}
{...form.props}
className="flex h-full max-h-full flex-grow flex-col"
>
<Fieldset>
<input type="hidden" name="id" value={existingIntegration.id} />
<input
type="hidden"
name="integrationIdentifier"
value={integration.identifier}
/>
<input
type="hidden"
name="integrationAuthMethod"
value={authMethodKey}
/>
<input type="hidden" name="redirectTo" value={location.pathname} />
<InputGroup>
<FormError>{form.error}</FormError>
</InputGroup>
<InputGroup fullWidth>
<Label variant="large">ID</Label>
<Paragraph variant="small" className="mb-2">
{existingIntegration.slug}
</Paragraph>
</InputGroup>
<InputGroup fullWidth>
<Label variant="large">Name</Label>
<Input
type="text"
fullWidth
{...conform.input(title)}
defaultValue={existingIntegration.title ?? undefined}
placeholder={`e.g. Personal ${integration.name}`}
/>
<FormError>{title.error}</FormError>
</InputGroup>
<input type="hidden" name="clientType" value={clientType} />
<div>
<Header2>Use my OAuth App</Header2>
<Paragraph variant="small" className="mb-2">
To use your own OAuth app, check the option below and insert the
details.
</Paragraph>
<Checkbox
id="hasCustomClient"
label="Use my OAuth App"
variant="simple/small"
disabled={requiresCustomOAuthApp}
onChange={(checked) => setUseMyOAuthApp(checked)}
{...conform.input(hasCustomClient, { type: "checkbox" })}
defaultChecked={requiresCustomOAuthApp}
/>
{useMyOAuthApp && (
<div className="ml-6 mt-2">
<Paragraph variant="small" className="mb-2">
Set the callback url to{" "}
<CodeBlock code={callbackUrl} showLineNumbers={false} />
</Paragraph>
<div className="flex flex-col gap-2">
<div className="flex gap-2">
<InputGroup fullWidth>
<Label variant="small">Client ID</Label>
<Input
fullWidth
{...conform.input(customClientId, { type: "text" })}
/>
</InputGroup>
<InputGroup fullWidth>
<Label variant="small">Client secret</Label>
<Input
fullWidth
{...conform.input(customClientSecret, {
type: "password",
})}
/>
</InputGroup>
</div>
<FormError>{customClientId.error}</FormError>
</div>
</div>
)}
</div>
<div>
<Header2>Scopes</Header2>
<Paragraph variant="small" className="mb-4">
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 havent granted, that task will
fail.
</Paragraph>
{/* <Header3 className="mb-2">
Select from popular scope collections
</Header3>
<fieldset>
<Checkbox
id="allScopes"
label="Select all"
variant="button/small"
/>
</fieldset> */}
<div className="mb-2 mt-4 flex items-center justify-between">
<Header3>Select {integration.name} scopes</Header3>
<Paragraph variant="small" className="text-slate-500">
{simplur`${selectedScopes.size} scope[|s] selected`}
</Paragraph>
</div>
<Input
placeholder="Search scopes"
className="mb-2"
variant="medium"
icon="search"
fullWidth={true}
value={filterText}
onChange={(e) => setFilterText(e.target.value)}
/>
<div className="mb-28 flex flex-col gap-y-0.5 overflow-hidden rounded-md">
{filteredItems.length === 0 && (
<Paragraph variant="small" className="p-4">
No scopes match {filterText}. Try a different search query.
</Paragraph>
)}
{authMethod.scopes.map((s) => {
return (
<Checkbox
key={s.name}
id={s.name}
value={s.name}
name="scopes"
label={s.name}
defaultChecked={s.defaultChecked ?? false}
badges={s.annotations?.map((a) => a.label)}
description={s.description}
variant="description"
className={cn(
filteredItems.find((f) => f.name === s.name) ? "" : "hidden"
)}
onChange={(isChecked) => {
if (isChecked) {
setSelectedScopes((selected) => {
selected.add(s.name);
return new Set(selected);
});
} else {
setSelectedScopes((selected) => {
selected.delete(s.name);
return new Set(selected);
});
}
}}
/>
);
})}
</div>
</div>
</Fieldset>
<div className="absolute bottom-0 left-0 flex w-full items-center justify-end gap-x-4 rounded-b-md border-t border-slate-800 bg-midnight-900 p-4">
<FormError>{scopes.error}</FormError>
<Button
type="submit"
className="flex gap-2"
disabled={transition.state !== "idle"}
variant="primary/medium"
LeadingIcon={integration.identifier}
>
Connect to {integration.name}
</Button>
</div>
</fetcher.Form>
);
}
+33 -10
View File
@@ -18,6 +18,7 @@ import { runStatusTitle } from "../runs/RunStatuses";
import { ProjectJob, useProject } from "~/hooks/useProject";
import { useOrganization } from "~/hooks/useOrganizations";
import { JobRunStatus } from "~/models/job.server";
import { cn } from "~/utils/cn";
export function JobsTable({
jobs,
@@ -46,7 +47,12 @@ export function JobsTable({
jobs.map((job) => {
const path = jobPath(organization, project, job);
return (
<TableRow key={job.id}>
<TableRow
key={job.id}
className={cn(
job.hasIntegrationsRequiringAction && "bg-rose-500/30"
)}
>
<TableCell to={path}>
<span className="flex items-center gap-2">
<NamedIcon name={job.event.icon} className="h-8 w-8" />
@@ -79,12 +85,30 @@ export function JobsTable({
<SimpleTooltip
key={integration.key}
button={
<NamedIcon
name={integration.icon}
className="h-6 w-6"
/>
<div className="relative">
<NamedIcon
name={integration.icon}
className="h-6 w-6"
/>
{integration.setupStatus === "MISSING_FIELDS" && (
<NamedIcon
name="error"
className="absolute -left-1 -top-1 h-4 w-4"
/>
)}
</div>
}
content={
<div>
<p className="mb-1 text-rose-400">
{integration.setupStatus === "MISSING_FIELDS" &&
"This integration requires configuration"}
</p>
<p>
{integration.title}: {integration.key}
</p>
</div>
}
content={`${integration.title}: ${integration.key}`}
/>
))}
</TableCell>
@@ -126,10 +150,9 @@ export function JobsTable({
</span>
}
value={
<DateTime
date={job.lastRun.createdAt}
className={classForJobStatus(job.lastRun.status)}
/>
<span className={classForJobStatus(job.lastRun.status)}>
<DateTime date={job.lastRun.createdAt} />
</span>
}
/>
) : (
@@ -1,211 +1,29 @@
import { useMatches } from "@remix-run/react";
import { Fragment } from "react";
import {
useIntegrationClient,
useOptionalIntegrationClient,
} from "~/hooks/useIntegrationClient";
import { useJob, useOptionalJob } from "~/hooks/useJob";
import {
useOptionalOrganization,
useOrganization,
} from "~/hooks/useOrganizations";
import { useOptionalProject, useProject } from "~/hooks/useProject";
import { useOptionalRun, useRun } from "~/hooks/useRun";
import {
integrationClientConnectionsPath,
integrationClientPath,
integrationClientScopesPath,
jobPath,
jobTestPath,
projectEnvironmentsPath,
projectIntegrationsPath,
projectPath,
runDashboardPath,
} from "~/utils/pathBuilder";
import { RouteMatch, useMatches } from "@remix-run/react";
import { Fragment, ReactNode } from "react";
import { BreadcrumbIcon } from "../primitives/BreadcrumbIcon";
import { JobsMenu } from "./JobsMenu";
import { BreadcrumbLink } from "./NavBar";
import { ProjectsMenu } from "./ProjectsMenu";
export type Breadcrumb = {
slug:
| "projects"
| "jobs"
| "integrations"
| "integration"
| "integration-job"
| "integration-connections"
| "integration-scopes"
| "environments"
| "job"
| "test"
| "runs"
| "run";
link?: {
to: string;
title: string;
};
};
function useBreadcrumbs(): Breadcrumb[] {
const matches = useMatches();
return matches
.filter((match) => match.handle)
.filter((match) => match.handle!.breadcrumb)
.map((match) => match.handle!.breadcrumb as Breadcrumb);
}
export type BreadcrumbItem = (
match: RouteMatch,
allMatches: RouteMatch[]
) => ReactNode;
export function Breadcrumb() {
const breadcrumbs = useBreadcrumbs();
const organization = useOptionalOrganization();
const project = useOptionalProject();
const job = useOptionalJob();
const run = useOptionalRun();
const client = useOptionalIntegrationClient();
const matches = useMatches();
return (
<div className="hidden items-center md:flex">
{breadcrumbs.map((breadcrumb, index) => (
<Fragment key={breadcrumb.slug}>
<BreadcrumbIcon />
<BreadcrumbItem
breadcrumb={breadcrumb}
organization={organization}
project={project}
job={job}
run={run}
client={client}
/>
</Fragment>
))}
{matches.map((match) => {
if (!match.handle || !match.handle.breadcrumb) return null;
const breadcrumb = match.handle.breadcrumb as BreadcrumbItem;
return (
<Fragment key={match.id}>
<BreadcrumbIcon />
{breadcrumb(match, matches)}
</Fragment>
);
})}
</div>
);
}
function BreadcrumbItem({
breadcrumb,
organization,
project,
job,
run,
client,
}: {
breadcrumb: Breadcrumb;
organization?: ReturnType<typeof useOrganization>;
project?: ReturnType<typeof useProject>;
job?: ReturnType<typeof useJob>;
run?: ReturnType<typeof useRun>;
client?: ReturnType<typeof useIntegrationClient>;
}) {
switch (breadcrumb.slug) {
case "projects":
return <ProjectsMenu key={breadcrumb.slug} />;
case "jobs":
return (
<BreadcrumbLink
key={breadcrumb.slug}
to={projectPath(organization!, project!)}
title="Jobs"
/>
);
case "environments":
return (
<BreadcrumbLink
key={breadcrumb.slug}
to={projectEnvironmentsPath(organization!, project!)}
title="Environments"
/>
);
case "integrations":
return (
<BreadcrumbLink
key={breadcrumb.slug}
to={projectIntegrationsPath(organization!, project!)}
title="Integrations"
/>
);
case "integration":
return (
<Fragment key={breadcrumb.slug}>
<BreadcrumbLink
to={projectIntegrationsPath(organization!, project!)}
title="Integrations"
/>
<BreadcrumbIcon />
<BreadcrumbLink
to={integrationClientPath(organization!, project!, client!)}
title={client!.title}
/>
</Fragment>
);
case "integration-job":
return (
<BreadcrumbLink
to={integrationClientPath(organization!, project!, client!)}
title={"Jobs"}
/>
);
case "integration-connections":
return (
<BreadcrumbLink
to={integrationClientConnectionsPath(
organization!,
project!,
client!
)}
title={"Connections"}
/>
);
case "integration-scopes":
return (
<BreadcrumbLink
to={integrationClientScopesPath(organization!, project!, client!)}
title={"Scopes"}
/>
);
case "job":
return (
<Fragment key={breadcrumb.slug}>
<BreadcrumbLink
to={projectPath(organization!, project!)}
title="Jobs"
/>
<BreadcrumbIcon />
<JobsMenu key={breadcrumb.slug} />
</Fragment>
);
case "test":
return (
<BreadcrumbLink
key={breadcrumb.slug}
to={jobTestPath(organization!, project!, job!)}
title="Test"
/>
);
case "runs":
return (
<BreadcrumbLink
key={breadcrumb.slug}
to={jobPath(organization!, project!, job!)}
title="Runs"
/>
);
case "run":
return (
<Fragment key={breadcrumb.slug}>
<BreadcrumbLink
to={jobPath(organization!, project!, job!)}
title="Runs"
/>
<BreadcrumbIcon />
<BreadcrumbLink
to={runDashboardPath(organization!, project!, job!, run!)}
title={`Run #${run!.number}`}
/>
</Fragment>
);
}
return <span className="text-red-500">{breadcrumb.slug}</span>;
}
@@ -1,26 +1,24 @@
import { Link, RouteMatch } from "@remix-run/react";
import { useState } from "react";
import { useJob } from "~/hooks/useJob";
import { useOrganization } from "~/hooks/useOrganizations";
import { useProject } from "~/hooks/useProject";
import { cn } from "~/utils/cn";
import { jobPath } from "~/utils/pathBuilder";
import { IconNames, NamedIcon } from "../primitives/NamedIcon";
import { LabelValueStack } from "../primitives/LabelValueStack";
import { NamedIcon } from "../primitives/NamedIcon";
import {
Popover,
PopoverArrowTrigger,
PopoverContent,
PopoverMenuItem,
PopoverSectionHeader,
} from "../primitives/Popover";
import { LabelValueStack } from "../primitives/LabelValueStack";
import { LinkButton } from "../primitives/Buttons";
import { Link } from "@remix-run/react";
import { cn } from "~/utils/cn";
export function JobsMenu() {
export function JobsMenu({ matches }: { matches: RouteMatch[] }) {
const [isOpen, setIsOpen] = useState(false);
const organization = useOrganization();
const project = useProject();
const currentJob = useJob();
const organization = useOrganization(matches);
const project = useProject(matches);
const currentJob = useJob(matches);
return (
<>
@@ -29,7 +27,7 @@ export function JobsMenu() {
{currentJob?.title ?? "Select a job"}
</PopoverArrowTrigger>
<PopoverContent
className="w-80 overflow-y-auto p-0"
className="min-w-[20rem] overflow-y-auto p-0 scrollbar-thin scrollbar-track-transparent scrollbar-thumb-slate-700"
align="start"
collisionPadding={20}
>
@@ -42,11 +40,11 @@ export function JobsMenu() {
key={job.id}
to={jobPath(organization, project, job)}
className={cn(
"flex w-full items-center gap-2 rounded-md p-2",
"flex w-full items-center gap-2 rounded-md p-2 transition hover:bg-slate-800",
isSelected && "bg-slate-750 group-hover:bg-slate-750"
)}
>
<NamedIcon name={job.event.icon} className="h-6 w-6" />
<NamedIcon name={job.event.icon} className="h-8 w-8" />
<LabelValueStack
label={job.title}
value={job.slug}
@@ -11,7 +11,7 @@ import { docsRoot } from "~/utils/pathBuilder";
export function NavBar() {
return (
<div className="z-50 flex w-full items-center justify-between gap-2 border-b border-divide py-1 pl-2 pr-2.5">
<div className="z-50 flex w-full items-center justify-between gap-2 border-b border-divide py-1 pl-1 pr-2.5">
<div className="flex gap-0.5">
<Link to="/" className="p-2">
<LogoIcon className="h-5 w-5" />
@@ -1,10 +1,10 @@
import { useMatches } from "@remix-run/react";
import { motion } from "framer-motion";
import invariant from "tiny-invariant";
import { useJob, useOptionalJob } from "~/hooks/useJob";
import { useOptionalJob } from "~/hooks/useJob";
import { useOrganization } from "~/hooks/useOrganizations";
import { useProject } from "~/hooks/useProject";
import { cn } from "~/utils/cn";
import { Handle } from "~/utils/handle";
import {
accountPath,
organizationBillingPath,
@@ -12,12 +12,12 @@ import {
projectEnvironmentsPath,
projectIntegrationsPath,
projectPath,
projectTriggersPath,
} from "~/utils/pathBuilder";
import { NavLinkButton } from "../primitives/Buttons";
import type { IconNames } from "../primitives/NamedIcon";
import { SimpleTooltip } from "../primitives/Tooltip";
import { UserProfilePhoto } from "../UserProfilePhoto";
import { useOptionalIntegrationClient } from "~/hooks/useIntegrationClient";
import { NavLinkButton } from "../primitives/Buttons";
import { NamedIcon, type IconNames } from "../primitives/NamedIcon";
import { SimpleTooltip } from "../primitives/Tooltip";
export function SideMenuContainer({ children }: { children: React.ReactNode }) {
return (
@@ -46,14 +46,15 @@ export function ProjectSideMenu() {
const project = useProject();
const matches = useMatches();
//we collapse the menu if we're in a job or an integration
const job = useOptionalJob();
const client = useOptionalIntegrationClient();
const isCollapsed = job !== undefined || client !== undefined;
//the deepest route `handle` determines if the menu is expanded
const deepestMatch = matches.at(-1);
const handle = deepestMatch?.handle as Handle;
const isCollapsed = handle?.expandSidebar ? !handle.expandSidebar : true;
const job = useOptionalJob();
const jobsActive =
job !== undefined ||
matches.at(-1)?.id ===
deepestMatch?.id ===
"routes/_app.orgs.$organizationSlug.projects.$projectParam._index";
return (
@@ -72,18 +73,30 @@ export function ProjectSideMenu() {
to={projectPath(organization, project)}
isCollapsed={isCollapsed}
forceActive={jobsActive}
data-action="jobs"
/>
<SideMenuItem
name="Integrations"
icon="integration"
to={projectIntegrationsPath(organization, project)}
isCollapsed={isCollapsed}
hasWarning={project.hasUnconfiguredIntegrations}
data-action="integrations"
/>
<SideMenuItem
name="Triggers"
icon="trigger"
to={projectTriggersPath(organization, project)}
isCollapsed={isCollapsed}
hasWarning={project.hasInactiveExternalTriggers}
data-action="triggers"
/>
<SideMenuItem
name="Environments & API Keys"
icon="environment"
to={projectEnvironmentsPath(organization, project)}
isCollapsed={isCollapsed}
data-action="environments & api keys"
/>
</div>
<div className="flex flex-col">
@@ -92,18 +105,21 @@ export function ProjectSideMenu() {
icon="team"
to={organizationTeamPath(organization)}
isCollapsed={isCollapsed}
data-action="team"
/>
<SideMenuItem
name="Usage & Billing"
icon="billing"
to={organizationBillingPath(organization)}
isCollapsed={isCollapsed}
data-action="usage & billing"
/>
<SideMenuItem
name="Account"
icon={UserProfilePhoto}
to={accountPath()}
isCollapsed={isCollapsed}
data-action="account"
/>
</div>
</motion.div>
@@ -125,11 +141,13 @@ function SideMenuItem({
to,
isCollapsed,
forceActive,
hasWarning = false,
}: {
icon: IconNames | React.ComponentType<any>;
name: string;
to: string;
isCollapsed: boolean;
hasWarning?: boolean;
forceActive?: boolean;
}) {
return (
@@ -147,6 +165,7 @@ function SideMenuItem({
isActive = forceActive;
}
return cn(
"relative",
isActive
? "bg-slate-800 text-bright group-hover:bg-slate-800"
: "text-dimmed group-hover:bg-slate-850 group-hover:text-bright"
@@ -161,6 +180,9 @@ function SideMenuItem({
>
{name}
</motion.span>
{hasWarning && (
<NamedIcon name="error" className="absolute left-1 top-1 h-4 w-4" />
)}
</NavLinkButton>
}
content={name}
@@ -1,9 +1,10 @@
import { RouteMatch } from "@remix-run/react";
import { Fragment, useState } from "react";
import {
useIsNewOrganizationPage,
useOrganizations,
} from "~/hooks/useOrganizations";
import { useOptionalProject, useProject } from "~/hooks/useProject";
import { useOptionalProject } from "~/hooks/useProject";
import {
newOrganizationPath,
newProjectPath,
@@ -17,11 +18,11 @@ import {
PopoverSectionHeader,
} from "../primitives/Popover";
export function ProjectsMenu() {
export function ProjectsMenu({ matches }: { matches: RouteMatch[] }) {
const [isOpen, setIsOpen] = useState(false);
const organizations = useOrganizations();
const isNewOrgPage = useIsNewOrganizationPage();
const currentProject = useOptionalProject();
const organizations = useOrganizations(matches);
const isNewOrgPage = useIsNewOrganizationPage(matches);
const currentProject = useOptionalProject(matches);
if (isNewOrgPage) {
return null;
@@ -33,11 +34,15 @@ export function ProjectsMenu() {
<PopoverArrowTrigger isOpen={isOpen}>
{currentProject?.name ?? "Select a project"}
</PopoverArrowTrigger>
<PopoverContent className="w-80 p-0" align="start">
<PopoverContent
className="min-w-[20rem] overflow-y-auto p-0 scrollbar-thin scrollbar-track-transparent scrollbar-thumb-slate-700"
align="start"
collisionPadding={20}
>
{organizations.map((organization) => (
<Fragment key={organization.id}>
<PopoverSectionHeader title={organization.title} />
<div className="flex flex-col gap-1 p-1">
<div className="flex flex-col gap-1 p-1 ">
{organization.projects.map((project) => {
const isSelected = project.id === currentProject?.id;
return (
@@ -7,7 +7,7 @@ import React, {
} from "react";
import { ShortcutDefinition, useShortcutKeys } from "~/hooks/useShortcutKeys";
import { cn } from "~/utils/cn";
import { NamedIcon } from "./NamedIcon";
import { IconNamesOrString, NamedIcon } from "./NamedIcon";
import { ShortcutKey } from "./ShortcutKey";
const variant = {
@@ -125,8 +125,8 @@ const allVariants = {
type ButtonContentPropsType = {
children?: React.ReactNode;
LeadingIcon?: React.ComponentType<any> | string;
TrailingIcon?: React.ComponentType<any> | string;
LeadingIcon?: React.ComponentType<any> | IconNamesOrString;
TrailingIcon?: React.ComponentType<any> | IconNamesOrString;
trailingIconClassName?: string;
leadingIconClassName?: string;
fullWidth?: boolean;
@@ -4,49 +4,54 @@ import {
InformationCircleIcon,
LightBulbIcon,
} from "@heroicons/react/20/solid";
import { cn } from "~/utils/cn";
import { Paragraph } from "./Paragraph";
import {
ArrowTopRightOnSquareIcon,
BookOpenIcon,
CheckCircleIcon,
ChevronRightIcon,
} from "@heroicons/react/24/solid";
import { Link } from "@remix-run/react";
import { cn } from "~/utils/cn";
import { Paragraph } from "./Paragraph";
const variantClasses = {
export const variantClasses = {
info: {
className: "border-blue-400/20 bg-blue-400/30",
icon: <InformationCircleIcon className="h-5 w-5 shrink-0 text-blue-400" />,
text: "text-blue-200",
textColor: "text-blue-200",
linkClassName: "transition hover:bg-blue-400/40",
},
warning: {
className: "border-yellow-400/20 bg-yellow-400/30",
icon: (
<ExclamationCircleIcon className="h-5 w-5 shrink-0 text-yellow-400" />
<ExclamationTriangleIcon className="h-5 w-5 shrink-0 text-yellow-400" />
),
text: "text-yellow-200",
textColor: "text-yellow-200",
linkClassName: "transition hover:bg-yellow-400/40",
},
error: {
className: "border-[hsl(347,77%,50%)]/30 bg-[hsl(347,77%,50%)]/20",
icon: (
<ExclamationTriangleIcon className="h-5 w-5 shrink-0 text-rose-400" />
),
text: "text-rose-200",
className: "border-rose-500/20 bg-rose-500/30",
icon: <ExclamationCircleIcon className="h-5 w-5 shrink-0 text-rose-400" />,
textColor: "text-rose-200",
linkClassName: "transition hover:bg-rose-500/40",
},
idea: {
className: "border-green-400/20 bg-green-400/30",
icon: <LightBulbIcon className="h-5 w-5 shrink-0 text-green-400" />,
text: "text-green-200",
textColor: "text-green-200",
linkClassName: "transition hover:bg-green-400/40",
},
success: {
className: "border-green-400/20 bg-green-400/30",
icon: <CheckCircleIcon className="h-5 w-5 shrink-0 text-green-400" />,
text: "text-green-200",
textColor: "text-green-200",
linkClassName: "transition hover:bg-green-400/40",
},
docs: {
className:
"border-blue-400/20 bg-blue-400/30 transition hover:bg-blue-400/40",
icon: <BookOpenIcon className="h-5 w-5 shrink-0 text-blue-400" />,
text: "text-blue-200",
className: "border-blue-400/20 bg-blue-400/30",
icon: <BookOpenIcon className="mt-0.5 h-5 w-5 shrink-0 text-blue-400" />,
textColor: "text-blue-200",
linkClassName: "transition hover:bg-blue-400/40",
},
} as const;
@@ -55,41 +60,79 @@ export function Callout({
className,
icon,
variant,
href,
to,
}: {
children?: React.ReactNode;
className?: string;
icon?: React.ReactNode;
variant: keyof typeof variantClasses;
href?: string;
to?: string;
}) {
const variantDefinition = variantClasses[variant];
if (variant === "docs") {
return (
<a
href={href}
target="_blank"
className={cn(
`flex w-full items-start justify-between gap-2.5 rounded-md border py-2 pl-2 pr-3 shadow-md backdrop-blur-sm`,
variantDefinition.className,
className
)}
>
<div className="flex w-full items-center gap-x-2">
{icon ? icon : variantDefinition.icon}
{typeof children === "string" ? (
<Paragraph variant={"small"} className={variantDefinition.text}>
{children}
</Paragraph>
) : (
children
if (to !== undefined) {
if (to.startsWith("http")) {
return (
<a
href={to}
target="_blank"
className={cn(
`flex w-full items-start justify-between gap-2.5 rounded-md border py-2 pl-2 pr-3 shadow-md backdrop-blur-sm`,
variantDefinition.className,
variantDefinition.linkClassName,
className
)}
</div>
<ArrowTopRightOnSquareIcon className="h-5 w-5 text-blue-400" />
</a>
);
>
<div className={"flex w-full items-start gap-x-2"}>
{icon ? icon : variantDefinition.icon}
{typeof children === "string" ? (
<Paragraph
variant={"small"}
className={variantDefinition.textColor}
>
{children}
</Paragraph>
) : (
children
)}
</div>
<ArrowTopRightOnSquareIcon
className={cn("h-5 w-5", variantDefinition.textColor)}
/>
</a>
);
} else {
return (
<Link
to={to}
className={cn(
`flex w-full items-start justify-between gap-2.5 rounded-md border py-2 pl-2 pr-3 shadow-md backdrop-blur-sm`,
variantDefinition.className,
variantDefinition.linkClassName,
className
)}
>
<div className={"flex w-full items-start gap-x-2"}>
{icon ? icon : variantDefinition.icon}
{typeof children === "string" ? (
<Paragraph
variant={"small"}
className={variantDefinition.textColor}
>
{children}
</Paragraph>
) : (
children
)}
</div>
<ChevronRightIcon
className={cn("h-5 w-5", variantDefinition.textColor)}
/>
</Link>
);
}
}
return (
@@ -103,7 +146,7 @@ export function Callout({
{icon ? icon : variantDefinition.icon}
{typeof children === "string" ? (
<Paragraph variant={"small"} className={variantDefinition.text}>
<Paragraph variant={"small"} className={variantDefinition.textColor}>
{children}
</Paragraph>
) : (
@@ -106,11 +106,11 @@ export function ClipboardField({
const inputIcon = useRef<HTMLInputElement>(null);
return (
<div
<span
className={cn(container, fullWidth ? "w-full" : "max-w-max", className)}
>
{icon && (
<div
<span
onClick={() => inputIcon.current && inputIcon.current.focus()}
className={cn(iconPosition, "flex items-center")}
>
@@ -119,7 +119,7 @@ export function ClipboardField({
) : (
icon
)}
</div>
</span>
)}
<input
type="text"
@@ -153,6 +153,6 @@ export function ClipboardField({
>
{copied ? <CheckIcon className="h-4 w-4 text-green-500" /> : "Copy"}
</Button>
</div>
</span>
);
}
@@ -1,60 +1,114 @@
import { Fragment, useEffect, useState } from "react";
import { useLocales } from "./LocaleProvider";
type DateTimeProps = {
date: Date | string;
timeZone?: string;
className?: string;
includeSeconds?: boolean;
};
export const DateTime = ({ date, timeZone, className }: DateTimeProps) => {
export const DateTime = ({
date,
timeZone = "UTC",
includeSeconds = true,
}: DateTimeProps) => {
const locales = useLocales();
const realDate = typeof date === "string" ? new Date(date) : date;
const locales = useLocales();
const isoString = realDate.toISOString();
const formattedDate = new Intl.DateTimeFormat(locales, {
const initialFormattedDateTime = formatDateTime(
realDate,
timeZone,
locales,
includeSeconds
);
const [formattedDateTime, setFormattedDateTime] = useState<string>(
initialFormattedDateTime
);
useEffect(() => {
const resolvedOptions = Intl.DateTimeFormat().resolvedOptions();
setFormattedDateTime(
formatDateTime(
realDate,
resolvedOptions.timeZone,
locales,
includeSeconds
)
);
}, [locales, includeSeconds, realDate]);
return (
<Fragment>
{formattedDateTime.replace(/\s/g, String.fromCharCode(32))}
</Fragment>
);
};
function formatDateTime(
date: Date,
timeZone: string,
locales: string[],
includeSeconds: boolean
): string {
return new Intl.DateTimeFormat(locales, {
year: "numeric",
month: "short",
day: "numeric",
timeZone,
}).format(realDate);
const formattedTime = new Intl.DateTimeFormat(locales, {
hour: "numeric",
minute: "numeric",
second: includeSeconds ? "numeric" : undefined,
timeZone,
}).format(realDate);
}).format(date);
}
export const DateTimeAccurate = ({ date, timeZone = "UTC" }: DateTimeProps) => {
const locales = useLocales();
const realDate = typeof date === "string" ? new Date(date) : date;
const initialFormattedDateTime = formatDateTimeAccurate(
realDate,
timeZone,
locales
);
const [formattedDateTime, setFormattedDateTime] = useState<string>(
initialFormattedDateTime
);
useEffect(() => {
const resolvedOptions = Intl.DateTimeFormat().resolvedOptions();
setFormattedDateTime(
formatDateTimeAccurate(realDate, resolvedOptions.timeZone, locales)
);
}, [locales, realDate]);
return (
<time dateTime={isoString} className={className}>
{formattedDate} at {formattedTime}
</time>
<Fragment>
{formattedDateTime.replace(/\s/g, String.fromCharCode(32))}
</Fragment>
);
};
export const DateTimeAccurate = ({ date, timeZone }: DateTimeProps) => {
const realDate = typeof date === "string" ? new Date(date) : date;
function formatDateTimeAccurate(
date: Date,
timeZone: string,
locales: string[]
): string {
const milliseconds = `00${date.getMilliseconds()}`.slice(-3);
const locales = useLocales();
const isoString = realDate.toISOString();
const formattedDate = new Intl.DateTimeFormat(locales, {
const formattedDateTime = new Intl.DateTimeFormat(locales, {
month: "short",
day: "2-digit",
timeZone,
}).format(realDate);
const formattedTime = new Intl.DateTimeFormat(locales, {
hour: "numeric",
minute: "2-digit",
second: "2-digit",
hour12: false,
timeZone,
}).format(realDate);
}).format(date);
const milliseconds = `00${realDate.getMilliseconds()}`.slice(-3);
return (
<time dateTime={isoString}>
{formattedDate} {formattedTime}.{milliseconds}
</time>
);
};
return `${formatDateTime}.${milliseconds}`;
}
@@ -1,40 +1,96 @@
import { cn } from "~/utils/cn";
const header1Styles =
"font-sans text-base md:text-lg lg:text-xl leading-5 md:leading-6 lg:leading-7 font-semibold";
const header2Styles = "font-sans text-base leading-6 font-medium text-bright";
const header3Styles = "font-sans text-sm leading-5 font-medium text-bright";
const headerVariants = {
header1: {
text: "font-sans text-base md:text-lg lg:text-xl leading-5 md:leading-6 lg:leading-7 font-semibold",
spacing: "mb-2",
},
header2: {
text: "font-sans text-base leading-6 font-medium",
spacing: "mb-2",
},
header3: {
text: "font-sans text-sm leading-5 font-medium",
spacing: "mb-2",
},
};
const header1Variants = {
default: "text-bright",
const textColorVariants = {
bright: "text-bright",
dimmed: "text-dimmed",
};
export type HeaderVariant = keyof typeof headerVariants;
type HeaderProps = {
className?: string;
children: React.ReactNode;
};
type Header1Props = HeaderProps & {
variant?: keyof typeof header1Variants;
};
spacing?: boolean;
textColor?: "bright" | "dimmed";
} & React.HTMLAttributes<HTMLHeadingElement>;
export function Header1({
variant = "default",
className,
children,
}: Header1Props) {
spacing = false,
textColor = "bright",
}: HeaderProps) {
return (
<h1 className={cn(header1Styles, header1Variants[variant], className)}>
<h1
className={cn(
headerVariants.header1.text,
spacing === true && headerVariants.header1.spacing,
textColor === "bright"
? textColorVariants.bright
: textColorVariants.dimmed,
className
)}
>
{children}
</h1>
);
}
export function Header2({ className, children }: HeaderProps) {
return <h2 className={cn(header2Styles, className)}>{children}</h2>;
export function Header2({
className,
children,
spacing = false,
textColor = "bright",
}: HeaderProps) {
return (
<h2
className={cn(
headerVariants.header2.text,
spacing === true && headerVariants.header2.spacing,
textColor === "bright"
? textColorVariants.bright
: textColorVariants.dimmed,
className
)}
>
{children}
</h2>
);
}
export function Header3({ className, children }: HeaderProps) {
return <h3 className={cn(header3Styles, className)}>{children}</h3>;
export function Header3({
className,
children,
spacing = false,
textColor = "bright",
}: HeaderProps) {
return (
<h3
className={cn(
headerVariants.header3.text,
spacing === true && headerVariants.header3.spacing,
textColor === "bright"
? textColorVariants.bright
: textColorVariants.dimmed,
className
)}
>
{children}
</h3>
);
}
@@ -52,7 +52,7 @@ export function HelpTrigger({ title }: { title: string }) {
<Button
variant="tertiary/small"
LeadingIcon="lightbulb"
leadingIconClassName="text-slate-400"
leadingIconClassName="text-amber-400"
onClick={() => setOpen(true)}
>
{title}
@@ -1,6 +1,6 @@
import * as React from "react";
import { cn } from "~/utils/cn";
import type { IconNames } from "./NamedIcon";
import type { IconNamesOrString } from "./NamedIcon";
import { NamedIcon } from "./NamedIcon";
const variants = {
@@ -44,7 +44,7 @@ const variants = {
export type InputProps = React.InputHTMLAttributes<HTMLInputElement> & {
variant?: keyof typeof variants;
icon?: IconNames;
icon?: IconNamesOrString;
shortcut?: string;
fullWidth?: boolean;
};
+17 -14
View File
@@ -1,12 +1,22 @@
import * as React from "react";
import { cn } from "~/utils/cn";
import { Header2, Header3 } from "./Headers";
import { Paragraph } from "./Paragraph";
const labelVariants = {
small: {
text: "font-sans text-sm font-normal",
},
medium: {
text: "font-sans text-sm leading-5 font-medium",
},
large: {
text: "font-sans text-base leading-6 font-medium",
},
};
type LabelProps = React.AllHTMLAttributes<HTMLLabelElement> & {
className?: string;
children: React.ReactNode;
variant?: "small" | "medium" | "large";
variant?: keyof typeof labelVariants;
};
export function Label({
@@ -15,17 +25,10 @@ export function Label({
variant = "medium",
...props
}: LabelProps) {
return variant === "medium" ? (
<Header3 className={cn(className)} {...props}>
const variation = labelVariants[variant];
return (
<label className={cn(variation.text, className)} {...props}>
{children}
</Header3>
) : variant === "large" ? (
<Header2 className={cn(className)} {...props}>
{children}
</Header2>
) : (
<Paragraph variant="small" className={cn(className)}>
{children}
</Paragraph>
</label>
);
}
@@ -3,10 +3,7 @@ import { Paragraph, ParagraphVariant } from "./Paragraph";
import { ArrowTopRightOnSquareIcon } from "@heroicons/react/20/solid";
import { SimpleTooltip } from "./Tooltip";
const variations: Record<
string,
{ label: ParagraphVariant; value: ParagraphVariant }
> = {
const variations = {
primary: {
label: "extra-small/bright",
value: "extra-small",
@@ -15,7 +12,7 @@ const variations: Record<
label: "extra-extra-small/caps",
value: "extra-small/bright",
},
};
} as const;
type LabelValueStackProps = {
label: React.ReactNode;
@@ -1,15 +1,13 @@
import {
ExclamationCircleIcon,
ArrowTopRightOnSquareIcon,
ExclamationTriangleIcon,
InformationCircleIcon,
StopIcon,
} from "@heroicons/react/20/solid";
import { CompanyIcon, hasIcon } from "@trigger.dev/companyicons";
import {
ArrowLeftIcon,
ArrowPathIcon,
ArrowRightIcon,
ArrowTopRightOnSquareIcon,
BeakerIcon,
BellAlertIcon,
BoltIcon,
@@ -17,6 +15,7 @@ import {
BuildingOffice2Icon,
CalendarDaysIcon,
ChatBubbleLeftEllipsisIcon,
CheckCircleIcon,
CheckIcon,
ChevronDownIcon,
ChevronLeftIcon,
@@ -39,6 +38,7 @@ import {
MagnifyingGlassIcon,
PlusIcon,
PlusSmallIcon,
QrCodeIcon,
SquaresPlusIcon,
StarIcon,
UserCircleIcon,
@@ -46,20 +46,26 @@ import {
UserIcon,
UserPlusIcon,
WrenchScrewdriverIcon,
XCircleIcon,
XMarkIcon,
} from "@heroicons/react/24/solid";
import { CompanyIcon, hasIcon } from "@trigger.dev/companyicons";
import { HourglassIcon } from "lucide-react";
import { DynamicTriggerIcon } from "~/assets/icons/DynamicTriggerIcon";
import { ErrorIcon } from "~/assets/icons/ErrorIcon";
import { ScheduleIcon } from "~/assets/icons/ScheduleIcon";
import { WebhookIcon } from "~/assets/icons/WebhookIcon";
import { cn } from "~/utils/cn";
import { LogoIcon } from "../LogoIcon";
import { Spinner } from "./Spinner";
import { HourglassIcon } from "lucide-react";
import { DynamicTriggerIcon } from "~/assets/icons/DynamicTriggerIcon";
const icons = {
account: (className: string) => (
<UserCircleIcon className={cn("text-slate-400", className)} />
),
active: (className: string) => (
<CheckCircleIcon className={cn("text-green-500", className)} />
),
"arrow-right": (className: string) => (
<ArrowRightIcon className={cn("text-white", className)} />
),
@@ -103,7 +109,7 @@ const icons = {
<XMarkIcon className={cn("text-dimmed", className)} />
),
"connection-alert": (className: string) => (
<BellAlertIcon className={cn("text-rose-500", className)} />
<BellAlertIcon className={cn("text-amber-500", className)} />
),
docs: (className: string) => (
<BookOpenIcon className={cn("text-slate-400", className)} />
@@ -112,7 +118,7 @@ const icons = {
<DynamicTriggerIcon className={cn("text-cyan-500", className)} />
),
error: (className: string) => (
<ExclamationCircleIcon className={cn("text-rose-500", className)} />
<ErrorIcon className={cn("text-rose-500", className)} />
),
"external-link": (className: string) => (
<ArrowTopRightOnSquareIcon className={cn("text-dimmed", className)} />
@@ -141,6 +147,9 @@ const icons = {
id: (className: string) => (
<FingerPrintIcon className={cn("text-rose-200", className)} />
),
inactive: (className: string) => (
<XCircleIcon className={cn("text-rose-500", className)} />
),
info: (className: string) => (
<InformationCircleIcon className={cn("text-blue-500", className)} />
),
@@ -175,6 +184,9 @@ const icons = {
property: (className: string) => (
<Cog8ToothIcon className={cn("text-slate-600", className)} />
),
"qr-code": (className: string) => (
<QrCodeIcon className={cn("text-amber-400", className)} />
),
refresh: (className: string) => (
<ArrowPathIcon className={cn("text-bright", className)} />
),
@@ -193,6 +205,9 @@ const icons = {
star: (className: string) => (
<StarIcon className={cn("text-yellow-500", className)} />
),
stop: (className: string) => (
<StopIcon className={cn("text-rose-500", className)} />
),
team: (className: string) => (
<UserGroupIcon className={cn("text-blue-500", className)} />
),
@@ -209,8 +224,11 @@ const icons = {
"custom-event": (className: string) => (
<CodeBracketSquareIcon className={cn("text-toxic-600", className)} />
),
"register-source": (className: string) => (
<GlobeAltIcon className={cn("text-sky-500", className)} />
),
"schedule-interval": (className: string) => (
<ScheduleIcon className={cn("text-sky-500", className)} />
<ClockIcon className={cn("text-sky-500", className)} />
),
"schedule-cron": (className: string) => (
<ScheduleIcon className={cn("text-sky-500", className)} />
@@ -224,6 +242,7 @@ const icons = {
};
export type IconNames = keyof typeof icons;
export type IconNamesOrString = IconNames | (string & {});
export const iconNames = Object.keys(icons) as IconNames[];
export function NamedIcon({
@@ -231,7 +250,7 @@ export function NamedIcon({
className,
fallback,
}: {
name: string;
name: IconNamesOrString;
className: string;
fallback?: JSX.Element;
}) {
@@ -241,7 +260,7 @@ export function NamedIcon({
if (hasIcon(name)) {
return (
<div
<span
className={cn(
"grid aspect-square min-h-fit place-items-center",
className
@@ -255,7 +274,7 @@ export function NamedIcon({
shapeRendering: "geometricPrecision",
}}
/>
</div>
</span>
);
}
@@ -50,7 +50,7 @@ export function PageTitle({ title, backButton }: PageTitleProps) {
>
<ChevronLeftIcon className="h-6" />
<Header1
variant="dimmed"
textColor="dimmed"
className="transition group-hover:text-white"
>
{backButton.text}
@@ -120,11 +120,7 @@ export function PageInfoProperty({
{label}:
</Paragraph>
)}
{typeof value === "string" || typeof value === "number" ? (
<Paragraph variant="small">{value}</Paragraph>
) : (
value
)}
<Paragraph variant="small">{value}</Paragraph>
</div>
);
}

Some files were not shown because too many files have changed in this diff Show More