From d71925fe275bfc297b446d21889455b0baefd1dc Mon Sep 17 00:00:00 2001 From: Eric Allam Date: Mon, 5 Aug 2024 14:44:33 +0100 Subject: [PATCH] remove v2 only packages, will be moved to a dedicated repo --- apps/yalt/.dev.vars.example | 1 - apps/yalt/.editorconfig | 13 - apps/yalt/.gitignore | 172 - apps/yalt/.prettierrc | 6 - apps/yalt/README.md | 26 - apps/yalt/package.json | 17 - apps/yalt/src/index.ts | 259 - apps/yalt/tsconfig.json | 107 - apps/yalt/wrangler.toml | 25 - experiments/context.ts | 604 - experiments/with-generic-parser.ts | 444 - experiments/with-separate-zod-task.ts | 499 - helm-charts/.gitignore | 1 - helm-charts/.helmignore | 24 - helm-charts/Chart.lock | 9 - helm-charts/Chart.yaml | 34 - helm-charts/README.md | 119 - helm-charts/my-values.yml | 14 - helm-charts/package-lock.json | 203 - helm-charts/package.json | 15 - helm-charts/templates/_helpers.tpl | 71 - helm-charts/templates/ingress.yaml | 43 - helm-charts/templates/trigger.yaml | 98 - helm-charts/values.yaml | 276 - integrations/airtable/CHANGELOG.md | 790 - integrations/airtable/README.md | 3 - integrations/airtable/package.json | 48 - integrations/airtable/src/base.ts | 164 - integrations/airtable/src/events.ts | 50 - integrations/airtable/src/index.ts | 166 - integrations/airtable/src/schemas.ts | 176 - integrations/airtable/src/types.ts | 58 - integrations/airtable/src/webhooks.ts | 464 - integrations/airtable/tsconfig.json | 20 - integrations/airtable/tsup.config.ts | 3 - integrations/github/CHANGELOG.md | 1052 - integrations/github/package.json | 52 - integrations/github/src/compound.ts | 59 - integrations/github/src/git.ts | 466 - integrations/github/src/index.ts | 628 - integrations/github/src/issues.ts | 148 - integrations/github/src/orgs.ts | 120 - integrations/github/src/propertyHelpers.ts | 21 - integrations/github/src/reactions.ts | 87 - integrations/github/src/repos.ts | 167 - integrations/github/src/sources.ts | 296 - integrations/github/src/webhook-examples.ts | 2317 - integrations/github/tsconfig.json | 20 - integrations/github/tsup.config.ts | 3 - integrations/linear/CHANGELOG.md | 727 - integrations/linear/README.md | 3 - integrations/linear/package.json | 48 - integrations/linear/src/events.ts | 535 - integrations/linear/src/index.ts | 2029 - .../src/payload-examples/Attachment.json | 25 - .../payload-examples/AttachmentCreated.json | 25 - .../payload-examples/AttachmentRemoved.json | 25 - .../payload-examples/AttachmentUpdated.json | 29 - .../linear/src/payload-examples/Comment.json | 22 - .../src/payload-examples/CommentCreated.json | 22 - .../src/payload-examples/CommentRemoved.json | 22 - .../src/payload-examples/CommentUpdated.json | 28 - .../linear/src/payload-examples/Cycle.json | 23 - .../src/payload-examples/CycleCreated.json | 23 - .../src/payload-examples/CycleRemoved.json | 23 - .../src/payload-examples/CycleUpdated.json | 27 - .../linear/src/payload-examples/Issue.json | 42 - .../src/payload-examples/IssueCreated.json | 41 - .../src/payload-examples/IssueLabel.json | 17 - .../payload-examples/IssueLabelCreated.json | 17 - .../payload-examples/IssueLabelRemoved.json | 17 - .../payload-examples/IssueLabelUpdated.json | 22 - .../src/payload-examples/IssueRemoved.json | 42 - .../src/payload-examples/IssueUpdated.json | 42 - .../linear/src/payload-examples/Project.json | 38 - .../src/payload-examples/ProjectCreated.json | 38 - .../src/payload-examples/ProjectRemoved.json | 40 - .../src/payload-examples/ProjectUpdate.json | 47 - .../ProjectUpdateCreated.json | 47 - .../ProjectUpdateRemoved.json | 48 - .../ProjectUpdateUpdated.json | 53 - .../src/payload-examples/ProjectUpdated.json | 43 - .../linear/src/payload-examples/Reaction.json | 24 - .../src/payload-examples/ReactionCreated.json | 24 - .../src/payload-examples/ReactionRemoved.json | 24 - .../src/payload-examples/ReactionUpdated.json | 28 - .../linear/src/payload-examples/index.ts | 154 - integrations/linear/src/schemas.ts | 444 - integrations/linear/src/types.ts | 28 - integrations/linear/src/utils.ts | 60 - integrations/linear/src/webhooks.ts | 319 - integrations/linear/tsconfig.json | 20 - integrations/linear/tsup.config.ts | 3 - integrations/openai/CHANGELOG.md | 1058 - integrations/openai/jest.config.js | 8 - integrations/openai/package.json | 51 - integrations/openai/src/assistants.ts | 226 - integrations/openai/src/beta.ts | 19 - integrations/openai/src/chat.ts | 112 - integrations/openai/src/completions.ts | 110 - integrations/openai/src/edits.ts | 62 - integrations/openai/src/embeddings.ts | 44 - integrations/openai/src/files.ts | 268 - integrations/openai/src/fineTunes.ts | 299 - integrations/openai/src/images.ts | 317 - integrations/openai/src/index.ts | 323 - integrations/openai/src/models.ts | 80 - integrations/openai/src/taskUtils.ts | 315 - integrations/openai/src/threads.ts | 747 - integrations/openai/src/types.ts | 37 - .../openai/test/calculateResetAt.test.ts | 18 - integrations/openai/tsconfig.build.json | 18 - integrations/openai/tsconfig.json | 20 - integrations/openai/tsup.config.ts | 4 - integrations/plain/CHANGELOG.md | 982 - integrations/plain/package.json | 46 - integrations/plain/src/index.ts | 225 - integrations/plain/src/types.ts | 41 - integrations/plain/tsconfig.json | 20 - integrations/plain/tsup.config.ts | 3 - integrations/replicate/CHANGELOG.md | 693 - integrations/replicate/README.md | 1 - integrations/replicate/package.json | 48 - integrations/replicate/src/collections.ts | 37 - integrations/replicate/src/deployments.ts | 76 - integrations/replicate/src/index.ts | 280 - integrations/replicate/src/models.ts | 82 - integrations/replicate/src/predictions.ts | 101 - integrations/replicate/src/trainings.ts | 113 - integrations/replicate/src/types.ts | 3 - integrations/replicate/src/utils.ts | 58 - integrations/replicate/tsconfig.json | 4 - integrations/replicate/tsup.config.ts | 3 - integrations/resend/CHANGELOG.md | 995 - integrations/resend/package.json | 46 - integrations/resend/src/audiences.ts | 134 - integrations/resend/src/batch.ts | 81 - integrations/resend/src/contacts.ts | 188 - integrations/resend/src/emails.ts | 125 - integrations/resend/src/index.ts | 194 - integrations/resend/src/utils.ts | 52 - integrations/resend/tsconfig.json | 20 - integrations/resend/tsup.config.ts | 3 - integrations/sendgrid/CHANGELOG.md | 839 - integrations/sendgrid/README.md | 3 - integrations/sendgrid/package.json | 47 - integrations/sendgrid/src/index.ts | 141 - integrations/sendgrid/tsconfig.json | 20 - integrations/sendgrid/tsup.config.ts | 3 - integrations/shopify/CHANGELOG.md | 604 - integrations/shopify/README.md | 1 - integrations/shopify/package.json | 48 - integrations/shopify/src/events.ts | 17 - integrations/shopify/src/index.ts | 258 - .../AppSubscriptionsUpdate.json | 12 - .../src/payload-examples/AppUninstalled.json | 56 - .../BulkOperationsFinish.json | 8 - .../src/payload-examples/CartsCreate.json | 80 - .../src/payload-examples/CheckoutsCreate.json | 188 - .../src/payload-examples/CheckoutsDelete.json | 12 - .../CollectionListingsAdd.json | 13 - .../CollectionListingsRemove.json | 5 - .../payload-examples/CollectionsCreate.json | 12 - .../payload-examples/CollectionsDelete.json | 5 - .../src/payload-examples/CompaniesCreate.json | 10 - .../CompanyContactsCreate.json | 18 - .../CompanyLocationsCreate.json | 57 - .../CustomerGroupsCreate.json | 7 - .../CustomerPaymentMethodsCreate.json | 14 - .../src/payload-examples/CustomersCreate.json | 28 - .../src/payload-examples/CustomersDelete.json | 11 - .../CustomersEmailMarketingConsentUpdate.json | 9 - .../CustomersMarketingConsentUpdate.json | 10 - .../src/payload-examples/CustomersMerge.json | 13 - .../shopify/src/payload-examples/Deleted.json | 3 - .../src/payload-examples/DeliveryProfile.json | 3 - .../src/payload-examples/DisputesCreate.json | 14 - .../src/payload-examples/DomainsCreate.json | 10 - .../payload-examples/DraftOrdersCreate.json | 231 - .../payload-examples/DraftOrdersDelete.json | 25 - .../src/payload-examples/Fulfillment.json | 164 - .../FulfillmentEventsCreate.json | 20 - ...mentOrdersCancellationRequestAccepted.json | 7 - ...mentOrdersCancellationRequestRejected.json | 8 - ...entOrdersCancellationRequestSubmitted.json | 11 - .../FulfillmentOrdersCancelled.json | 10 - ...lmentOrdersFulfillmentRequestAccepted.json | 8 - ...lmentOrdersFulfillmentRequestRejected.json | 8 - ...mentOrdersFulfillmentRequestSubmitted.json | 16 - ...ersFulfillmentServiceFailedToComplete.json | 7 - .../FulfillmentOrdersHoldReleased.json | 6 - ...dersLineItemsPreparedForLocalDelivery.json | 10 - ...lmentOrdersLineItemsPreparedForPickup.json | 10 - .../FulfillmentOrdersMoved.json | 22 - ...FulfillmentOrdersOrderRoutingComplete.json | 6 - .../FulfillmentOrdersPlacedOnHold.json | 14 - .../FulfillmentOrdersRescheduled.json | 7 - ...tOrdersScheduledFulfillmentOrderReady.json | 6 - .../src/payload-examples/InventoryItem.json | 14 - .../InventoryItemDeleted.json | 8 - .../src/payload-examples/InventoryLevel.json | 7 - .../InventoryLevelDisconnected.json | 4 - .../src/payload-examples/Location.json | 19 - .../shopify/src/payload-examples/Market.json | 10 - .../shopify/src/payload-examples/Order.json | 392 - .../src/payload-examples/OrderEdited.json | 34 - .../OrderTransactionsCreate.json | 45 - .../src/payload-examples/PaymentSchedule.json | 12 - .../shopify/src/payload-examples/Product.json | 77 - .../payload-examples/ProductFeedCreated.json | 6 - .../payload-examples/ProductFeedFullSync.json | 22 - .../ProductFeedIncrementalSync.json | 83 - .../payload-examples/ProductFeedsCreate.json | 6 - .../ProductFeedsFullSync.json | 22 - .../ProductFeedsIncrementalSync.json | 83 - .../src/payload-examples/ProductListing.json | 99 - .../ProductListingRemoved.json | 5 - .../shopify/src/payload-examples/Refund.json | 207 - .../ScheduledProductListingsAdd.json | 99 - .../ScheduledProductListingsRemove.json | 5 - .../payload-examples/SellingPlanGroup.json | 36 - .../SellingPlanGroupDeleted.json | 4 - .../shopify/src/payload-examples/Shop.json | 56 - .../src/payload-examples/ShopLocale.json | 4 - .../SubscriptionBillingAttempt.json | 12 - .../SubscriptionBillingCycle.json | 10 - .../SubscriptionContract.json | 21 - .../payload-examples/TenderTransaction.json | 12 - .../shopify/src/payload-examples/Theme.json | 11 - .../shopify/src/payload-examples/index.ts | 223 - integrations/shopify/src/rest.ts | 340 - integrations/shopify/src/schemas.ts | 261 - integrations/shopify/src/triggers.ts | 213 - integrations/shopify/src/types.ts | 58 - integrations/shopify/src/utils.ts | 40 - integrations/shopify/src/webhooks.ts | 217 - integrations/shopify/tsconfig.json | 4 - integrations/shopify/tsup.config.ts | 3 - integrations/slack/CHANGELOG.md | 897 - integrations/slack/package.json | 46 - integrations/slack/src/index.ts | 183 - integrations/slack/tsconfig.json | 18 - integrations/slack/tsup.config.ts | 3 - integrations/stripe/CHANGELOG.md | 978 - integrations/stripe/README.md | 1 - integrations/stripe/package.json | 48 - integrations/stripe/src/charges.ts | 66 - integrations/stripe/src/checkout.ts | 57 - integrations/stripe/src/customers.ts | 104 - integrations/stripe/src/events.ts | 1593 - integrations/stripe/src/examples.ts | 1629 - integrations/stripe/src/index.ts | 1189 - integrations/stripe/src/schemas.ts | 110 - integrations/stripe/src/subscriptions.ts | 45 - integrations/stripe/src/types.ts | 92 - integrations/stripe/src/utils.ts | 5 - integrations/stripe/src/webhookEndpoints.ts | 97 - integrations/stripe/tsconfig.json | 31 - integrations/stripe/tsup.config.ts | 3 - integrations/supabase/CHANGELOG.md | 970 - integrations/supabase/README.md | 3 - integrations/supabase/package.json | 49 - integrations/supabase/src/database/index.ts | 169 - integrations/supabase/src/database/types.ts | 28 - integrations/supabase/src/index.ts | 2 - integrations/supabase/src/management/index.ts | 865 - integrations/supabase/tsconfig.json | 20 - integrations/supabase/tsup.config.ts | 3 - integrations/typeform/CHANGELOG.md | 1037 - integrations/typeform/package.json | 47 - integrations/typeform/src/consts.ts | 1 - integrations/typeform/src/forms.ts | 45 - integrations/typeform/src/index.ts | 343 - integrations/typeform/src/payload-examples.ts | 279 - integrations/typeform/src/responses.ts | 80 - integrations/typeform/src/types.ts | 206 - integrations/typeform/src/webhooks.ts | 127 - integrations/typeform/tsconfig.json | 31 - integrations/typeform/tsup.config.ts | 3 - packages/astro/CHANGELOG.md | 712 - packages/astro/LICENSE | 23 - packages/astro/README.md | 9 - packages/astro/package.json | 53 - packages/astro/src/index.ts | 57 - packages/astro/tsconfig.json | 17 - packages/astro/tsup.config.ts | 19 - packages/eslint-plugin/.eslintrc.js | 23 - packages/eslint-plugin/CHANGELOG.md | 227 - packages/eslint-plugin/LICENSE | 21 - packages/eslint-plugin/README.md | 52 - .../docs/rules/no-duplicated-task-keys.md | 37 - .../docs/rules/no-trigger-core-import.md | 69 - packages/eslint-plugin/lib/index.js | 22 - .../lib/rules/no-duplicated-task-keys.js | 130 - .../lib/rules/no-trigger-core-import.js | 294 - packages/eslint-plugin/package.json | 42 - .../lib/rules/no-duplicated-task-keys.js | 318 - .../tests/lib/rules/no-trigger-core-import.js | 77 - packages/eslint-plugin/tsconfig.json | 41 - packages/express/CHANGELOG.md | 843 - packages/express/LICENSE | 21 - packages/express/package.json | 52 - packages/express/src/index.ts | 111 - packages/express/tsconfig.json | 16 - packages/express/tsup.config.ts | 3 - packages/integration-kit/CHANGELOG.md | 686 - packages/integration-kit/LICENSE | 21 - packages/integration-kit/README.md | 3 - packages/integration-kit/package.json | 48 - packages/integration-kit/src/index.ts | 7 - packages/integration-kit/src/json.ts | 7 - packages/integration-kit/src/omit.ts | 14 - packages/integration-kit/src/prettify.ts | 4 - packages/integration-kit/src/properties.ts | 3 - packages/integration-kit/src/types.ts | 45 - packages/integration-kit/src/utils.ts | 28 - packages/integration-kit/src/webhooks.ts | 19 - packages/integration-kit/tsconfig.json | 18 - packages/integration-kit/tsup.config.ts | 3 - packages/nestjs/CHANGELOG.md | 601 - packages/nestjs/LICENSE | 21 - packages/nestjs/README.md | 7 - packages/nestjs/package.json | 55 - packages/nestjs/src/index.ts | 245 - packages/nestjs/tsconfig.json | 15 - packages/nestjs/tsup.config.ts | 3 - packages/nextjs/CHANGELOG.md | 926 - packages/nextjs/LICENSE | 21 - packages/nextjs/README.md | 9 - packages/nextjs/package.json | 54 - packages/nextjs/src/index.ts | 83 - packages/nextjs/tsconfig.json | 18 - packages/nextjs/tsup.config.ts | 3 - packages/react/CHANGELOG.md | 814 - packages/react/LICENSE | 21 - packages/react/package.json | 49 - packages/react/src/TriggerProvider.tsx | 68 - packages/react/src/events.ts | 50 - packages/react/src/fetch.ts | 30 - packages/react/src/index.ts | 4 - packages/react/src/runs.ts | 54 - packages/react/src/statuses.ts | 108 - packages/react/tsconfig.json | 15 - packages/react/tsup.config.ts | 19 - packages/remix/CHANGELOG.md | 656 - packages/remix/LICENSE | 21 - packages/remix/README.md | 9 - packages/remix/package.json | 52 - packages/remix/src/index.ts | 15 - packages/remix/tsconfig.json | 18 - packages/remix/tsup.config.ts | 3 - packages/sveltekit/CHANGELOG.md | 592 - packages/sveltekit/LICENSE | 19 - packages/sveltekit/README.md | 9 - packages/sveltekit/package.json | 51 - packages/sveltekit/src/index.ts | 42 - packages/sveltekit/tsconfig.json | 20 - packages/sveltekit/tsup.config.ts | 3 - packages/testing/CHANGELOG.md | 799 - packages/testing/LICENSE | 23 - packages/testing/README.md | 83 - packages/testing/package.json | 54 - packages/testing/src/index.ts | 213 - .../testing/tests/createJobTester.test.ts | 146 - packages/testing/tsconfig.json | 19 - packages/testing/tsup.config.ts | 3 - packages/yalt/CHANGELOG.md | 145 - packages/yalt/README.md | 1 - packages/yalt/package.json | 55 - packages/yalt/src/index.ts | 265 - packages/yalt/tsconfig.json | 16 - packages/yalt/tsup.config.ts | 3 - perf/README.md | 23 - perf/package.json | 41 - perf/src/index.ts | 229 - perf/src/server.ts | 7 - perf/src/trigger.ts | 197 - perf/tsconfig.json | 39 - references/astro-referece/.env.example | 2 - references/astro-referece/.gitignore | 21 - .../astro-referece/.vscode/extensions.json | 4 - references/astro-referece/.vscode/launch.json | 11 - references/astro-referece/README.md | 54 - references/astro-referece/astro.config.mjs | 6 - references/astro-referece/package.json | 28 - references/astro-referece/public/favicon.svg | 9 - .../astro-referece/src/components/Card.astro | 61 - references/astro-referece/src/env.d.ts | 1 - references/astro-referece/src/jobs/example.ts | 21 - .../astro-referece/src/layouts/Layout.astro | 51 - .../astro-referece/src/pages/api/trigger.ts | 7 - .../astro-referece/src/pages/index.astro | 123 - references/astro-referece/src/trigger.ts | 7 - references/astro-referece/tsconfig.json | 17 - .../deno-reference/.vscode/settings.json | 3 - references/deno-reference/deno.json | 8 - references/deno-reference/deno.lock | 684 - references/deno-reference/main.ts | 41 - references/hono-reference/.gitignore | 1 - references/hono-reference/README.md | 8 - references/hono-reference/package.json | 18 - references/hono-reference/src/index.ts | 40 - references/hono-reference/tsconfig.json | 19 - references/job-catalog/.env.example | 2 - references/job-catalog/README.md | 71 - references/job-catalog/fixtures/large.json | 70010 ------- references/job-catalog/fixtures/mydata.csv | 52 - references/job-catalog/fixtures/toolarge.json | 140022 --------------- references/job-catalog/package.json | 75 - references/job-catalog/src/airtable.ts | 172 - references/job-catalog/src/auto-yield.ts | 83 - .../job-catalog/src/background-fetch.ts | 104 - references/job-catalog/src/built-ins.ts | 372 - references/job-catalog/src/byo-auth.ts | 188 - references/job-catalog/src/canceling.ts | 43 - references/job-catalog/src/cli-example.ts | 54 - .../job-catalog/src/dynamic-schedule.ts | 72 - .../job-catalog/src/dynamic-triggers.ts | 76 - references/job-catalog/src/edge-cases.ts | 117 - references/job-catalog/src/events.ts | 212 - references/job-catalog/src/github.ts | 393 - references/job-catalog/src/httpTrigger.ts | 171 - references/job-catalog/src/invoke.ts | 313 - references/job-catalog/src/linear.ts | 149 - references/job-catalog/src/misconfigured.ts | 35 - references/job-catalog/src/notifications.ts | 47 - references/job-catalog/src/openai.ts | 537 - references/job-catalog/src/plain.ts | 91 - references/job-catalog/src/redacted.ts | 153 - references/job-catalog/src/replicate.ts | 146 - references/job-catalog/src/resend.ts | 345 - references/job-catalog/src/schedules.ts | 115 - references/job-catalog/src/sendgrid.ts | 44 - references/job-catalog/src/shopify.ts | 99 - references/job-catalog/src/slack.ts | 33 - references/job-catalog/src/status.ts | 61 - references/job-catalog/src/stressTest.ts | 265 - references/job-catalog/src/stripe.ts | 175 - references/job-catalog/src/supabase-types.ts | 843 - references/job-catalog/src/supabase.ts | 163 - references/job-catalog/src/typeform.ts | 63 - references/job-catalog/tsconfig.json | 120 - references/nestjs-example/.env.example | 3 - references/nestjs-example/.eslintrc.js | 25 - references/nestjs-example/.gitignore | 38 - references/nestjs-example/.prettierrc | 4 - references/nestjs-example/README.md | 73 - references/nestjs-example/nest-cli.json | 8 - references/nestjs-example/package.json | 47 - .../nestjs-example/src/app.controller.ts | 31 - references/nestjs-example/src/app.module.ts | 24 - references/nestjs-example/src/main.ts | 8 - references/nestjs-example/tsconfig.build.json | 4 - references/nestjs-example/tsconfig.json | 21 - references/nextjs-reference/.eslintrc.json | 7 - references/nextjs-reference/.gitignore | 35 - .../nextjs-reference/.vscode/launch.json | 11 - .../nextjs-reference/.vscode/settings.json | 4 - references/nextjs-reference/README.md | 38 - references/nextjs-reference/next.config.js | 9 - references/nextjs-reference/package.json | 47 - .../nextjs-reference/public/favicon.ico | Bin 25931 -> 0 bytes references/nextjs-reference/public/next.svg | 1 - references/nextjs-reference/public/vercel.svg | 1 - .../src/app/api/send-test-event/route.ts | 9 - .../src/app/api/trigger/route.ts | 6 - .../src/app/events/[eventId]/page.tsx | 9 - .../nextjs-reference/src/app/layout.tsx | 31 - references/nextjs-reference/src/app/page.tsx | 9 - .../src/components/ReactQuery.tsx | 10 - .../src/components/RunDetails.tsx | 55 - .../src/components/SendTestEvent.tsx | 26 - references/nextjs-reference/src/jobs/hooks.ts | 76 - .../nextjs-reference/src/mocks/handlers.ts | 37 - .../src/styles/Home.module.css | 227 - .../nextjs-reference/src/styles/globals.css | 100 - .../nextjs-reference/src/supabase.types.ts | 112 - references/nextjs-reference/src/trigger.ts | 37 - references/nextjs-reference/tsconfig.json | 56 - references/nextjs-test/.env.example | 3 - references/nextjs-test/.eslintrc.json | 3 - references/nextjs-test/.gitignore | 35 - references/nextjs-test/README.md | 34 - references/nextjs-test/jsconfig.json | 7 - references/nextjs-test/next.config.js | 4 - references/nextjs-test/package.json | 30 - references/nextjs-test/public/next.svg | 1 - references/nextjs-test/public/vercel.svg | 1 - .../nextjs-test/src/app/api/trigger/route.js | 9 - references/nextjs-test/src/app/favicon.ico | Bin 25931 -> 0 bytes references/nextjs-test/src/app/globals.css | 107 - references/nextjs-test/src/app/layout.js | 17 - references/nextjs-test/src/app/page.js | 95 - .../nextjs-test/src/app/page.module.css | 229 - references/nextjs-test/src/jobs/examples.js | 20 - references/nextjs-test/src/trigger.js | 9 - references/package-tester/.env.local.example | 4 - references/package-tester/.eslintrc.json | 3 - references/package-tester/.gitignore | 35 - references/package-tester/README.md | 20 - references/package-tester/app/_actions.tsx | 23 - .../package-tester/app/api/trigger/route.ts | 8 - .../app/components/ReactHooks.tsx | 93 - .../app/components/SendReactHookEventForm.tsx | 11 - .../app/events/[eventId]/page.tsx | 13 - references/package-tester/app/favicon.ico | Bin 25931 -> 0 bytes references/package-tester/app/globals.css | 23 - .../package-tester/app/jobs/react-hook.ts | 39 - references/package-tester/app/layout.tsx | 17 - references/package-tester/app/page.tsx | 9 - references/package-tester/app/trigger.ts | 7 - references/package-tester/next.config.js | 6 - references/package-tester/package.json | 46 - references/package-tester/postcss.config.js | 6 - references/package-tester/public/next.svg | 1 - references/package-tester/public/vercel.svg | 1 - references/package-tester/tailwind.config.js | 17 - references/package-tester/tsconfig.json | 28 - references/remix-reference/.eslintrc.js | 4 - references/remix-reference/.gitignore | 6 - references/remix-reference/README.md | 58 - .../remix-reference/app/entry.client.tsx | 18 - .../remix-reference/app/entry.server.tsx | 135 - .../app/jobs/example.server.ts | 20 - references/remix-reference/app/root.tsx | 33 - .../remix-reference/app/routes/_index.tsx | 41 - .../remix-reference/app/routes/api.trigger.ts | 9 - references/remix-reference/app/trigger.ts | 6 - references/remix-reference/package.json | 36 - references/remix-reference/public/favicon.ico | Bin 16958 -> 0 bytes references/remix-reference/remix.config.js | 17 - references/remix-reference/remix.env.d.ts | 2 - references/remix-reference/tsconfig.json | 28 - references/svelte-example/.env.example | 3 - references/svelte-example/.eslintignore | 13 - references/svelte-example/.eslintrc.cjs | 30 - references/svelte-example/.gitignore | 10 - references/svelte-example/.npmrc | 2 - references/svelte-example/.prettierignore | 13 - references/svelte-example/.prettierrc | 9 - references/svelte-example/README.md | 38 - references/svelte-example/package.json | 38 - references/svelte-example/src/app.d.ts | 12 - references/svelte-example/src/app.html | 12 - references/svelte-example/src/jobs/example.ts | 20 - references/svelte-example/src/lib/index.ts | 1 - .../svelte-example/src/routes/+page.svelte | 2 - .../src/routes/api/trigger/+server.ts | 12 - references/svelte-example/src/trigger.ts | 7 - references/svelte-example/static/favicon.png | Bin 1571 -> 0 bytes references/svelte-example/svelte.config.js | 28 - references/svelte-example/tsconfig.json | 25 - references/svelte-example/vite.config.ts | 6 - references/unit-testing/.gitignore | 1 - .../unit-testing/dummy-integration/index.ts | 101 - references/unit-testing/package.json | 24 - references/unit-testing/tests/example.test.ts | 284 - references/unit-testing/tsconfig.json | 19 - runtime_tests/package.json | 32 - runtime_tests/tests/bun/index.test.ts | 50 - runtime_tests/tests/bun/tsconfig.json | 6 - runtime_tests/tests/deno/deps.ts | 1 - runtime_tests/tests/deno/trigger.test.ts | 49 - runtime_tests/tests/node/index.test.ts | 47 - runtime_tests/tests/node/vitest.config.ts | 10 - runtime_tests/tests/wrangler/index.test.ts | 39 - runtime_tests/tests/wrangler/index.ts | 30 - runtime_tests/tests/wrangler/vitest.config.ts | 10 - runtime_tests/tsconfig.json | 23 - 569 files changed, 274431 deletions(-) delete mode 100644 apps/yalt/.dev.vars.example delete mode 100644 apps/yalt/.editorconfig delete mode 100644 apps/yalt/.gitignore delete mode 100644 apps/yalt/.prettierrc delete mode 100644 apps/yalt/README.md delete mode 100644 apps/yalt/package.json delete mode 100644 apps/yalt/src/index.ts delete mode 100644 apps/yalt/tsconfig.json delete mode 100644 apps/yalt/wrangler.toml delete mode 100644 experiments/context.ts delete mode 100644 experiments/with-generic-parser.ts delete mode 100644 experiments/with-separate-zod-task.ts delete mode 100644 helm-charts/.gitignore delete mode 100644 helm-charts/.helmignore delete mode 100644 helm-charts/Chart.lock delete mode 100644 helm-charts/Chart.yaml delete mode 100644 helm-charts/README.md delete mode 100644 helm-charts/my-values.yml delete mode 100644 helm-charts/package-lock.json delete mode 100644 helm-charts/package.json delete mode 100644 helm-charts/templates/_helpers.tpl delete mode 100644 helm-charts/templates/ingress.yaml delete mode 100644 helm-charts/templates/trigger.yaml delete mode 100644 helm-charts/values.yaml delete mode 100644 integrations/airtable/CHANGELOG.md delete mode 100644 integrations/airtable/README.md delete mode 100644 integrations/airtable/package.json delete mode 100644 integrations/airtable/src/base.ts delete mode 100644 integrations/airtable/src/events.ts delete mode 100644 integrations/airtable/src/index.ts delete mode 100644 integrations/airtable/src/schemas.ts delete mode 100644 integrations/airtable/src/types.ts delete mode 100644 integrations/airtable/src/webhooks.ts delete mode 100644 integrations/airtable/tsconfig.json delete mode 100644 integrations/airtable/tsup.config.ts delete mode 100644 integrations/github/CHANGELOG.md delete mode 100644 integrations/github/package.json delete mode 100644 integrations/github/src/compound.ts delete mode 100644 integrations/github/src/git.ts delete mode 100644 integrations/github/src/index.ts delete mode 100644 integrations/github/src/issues.ts delete mode 100644 integrations/github/src/orgs.ts delete mode 100644 integrations/github/src/propertyHelpers.ts delete mode 100644 integrations/github/src/reactions.ts delete mode 100644 integrations/github/src/repos.ts delete mode 100644 integrations/github/src/sources.ts delete mode 100644 integrations/github/src/webhook-examples.ts delete mode 100644 integrations/github/tsconfig.json delete mode 100644 integrations/github/tsup.config.ts delete mode 100644 integrations/linear/CHANGELOG.md delete mode 100644 integrations/linear/README.md delete mode 100644 integrations/linear/package.json delete mode 100644 integrations/linear/src/events.ts delete mode 100644 integrations/linear/src/index.ts delete mode 100644 integrations/linear/src/payload-examples/Attachment.json delete mode 100644 integrations/linear/src/payload-examples/AttachmentCreated.json delete mode 100644 integrations/linear/src/payload-examples/AttachmentRemoved.json delete mode 100644 integrations/linear/src/payload-examples/AttachmentUpdated.json delete mode 100644 integrations/linear/src/payload-examples/Comment.json delete mode 100644 integrations/linear/src/payload-examples/CommentCreated.json delete mode 100644 integrations/linear/src/payload-examples/CommentRemoved.json delete mode 100644 integrations/linear/src/payload-examples/CommentUpdated.json delete mode 100644 integrations/linear/src/payload-examples/Cycle.json delete mode 100644 integrations/linear/src/payload-examples/CycleCreated.json delete mode 100644 integrations/linear/src/payload-examples/CycleRemoved.json delete mode 100644 integrations/linear/src/payload-examples/CycleUpdated.json delete mode 100644 integrations/linear/src/payload-examples/Issue.json delete mode 100644 integrations/linear/src/payload-examples/IssueCreated.json delete mode 100644 integrations/linear/src/payload-examples/IssueLabel.json delete mode 100644 integrations/linear/src/payload-examples/IssueLabelCreated.json delete mode 100644 integrations/linear/src/payload-examples/IssueLabelRemoved.json delete mode 100644 integrations/linear/src/payload-examples/IssueLabelUpdated.json delete mode 100644 integrations/linear/src/payload-examples/IssueRemoved.json delete mode 100644 integrations/linear/src/payload-examples/IssueUpdated.json delete mode 100644 integrations/linear/src/payload-examples/Project.json delete mode 100644 integrations/linear/src/payload-examples/ProjectCreated.json delete mode 100644 integrations/linear/src/payload-examples/ProjectRemoved.json delete mode 100644 integrations/linear/src/payload-examples/ProjectUpdate.json delete mode 100644 integrations/linear/src/payload-examples/ProjectUpdateCreated.json delete mode 100644 integrations/linear/src/payload-examples/ProjectUpdateRemoved.json delete mode 100644 integrations/linear/src/payload-examples/ProjectUpdateUpdated.json delete mode 100644 integrations/linear/src/payload-examples/ProjectUpdated.json delete mode 100644 integrations/linear/src/payload-examples/Reaction.json delete mode 100644 integrations/linear/src/payload-examples/ReactionCreated.json delete mode 100644 integrations/linear/src/payload-examples/ReactionRemoved.json delete mode 100644 integrations/linear/src/payload-examples/ReactionUpdated.json delete mode 100644 integrations/linear/src/payload-examples/index.ts delete mode 100644 integrations/linear/src/schemas.ts delete mode 100644 integrations/linear/src/types.ts delete mode 100644 integrations/linear/src/utils.ts delete mode 100644 integrations/linear/src/webhooks.ts delete mode 100644 integrations/linear/tsconfig.json delete mode 100644 integrations/linear/tsup.config.ts delete mode 100644 integrations/openai/CHANGELOG.md delete mode 100644 integrations/openai/jest.config.js delete mode 100644 integrations/openai/package.json delete mode 100644 integrations/openai/src/assistants.ts delete mode 100644 integrations/openai/src/beta.ts delete mode 100644 integrations/openai/src/chat.ts delete mode 100644 integrations/openai/src/completions.ts delete mode 100644 integrations/openai/src/edits.ts delete mode 100644 integrations/openai/src/embeddings.ts delete mode 100644 integrations/openai/src/files.ts delete mode 100644 integrations/openai/src/fineTunes.ts delete mode 100644 integrations/openai/src/images.ts delete mode 100644 integrations/openai/src/index.ts delete mode 100644 integrations/openai/src/models.ts delete mode 100644 integrations/openai/src/taskUtils.ts delete mode 100644 integrations/openai/src/threads.ts delete mode 100644 integrations/openai/src/types.ts delete mode 100644 integrations/openai/test/calculateResetAt.test.ts delete mode 100644 integrations/openai/tsconfig.build.json delete mode 100644 integrations/openai/tsconfig.json delete mode 100644 integrations/openai/tsup.config.ts delete mode 100644 integrations/plain/CHANGELOG.md delete mode 100644 integrations/plain/package.json delete mode 100644 integrations/plain/src/index.ts delete mode 100644 integrations/plain/src/types.ts delete mode 100644 integrations/plain/tsconfig.json delete mode 100644 integrations/plain/tsup.config.ts delete mode 100644 integrations/replicate/CHANGELOG.md delete mode 100644 integrations/replicate/README.md delete mode 100644 integrations/replicate/package.json delete mode 100644 integrations/replicate/src/collections.ts delete mode 100644 integrations/replicate/src/deployments.ts delete mode 100644 integrations/replicate/src/index.ts delete mode 100644 integrations/replicate/src/models.ts delete mode 100644 integrations/replicate/src/predictions.ts delete mode 100644 integrations/replicate/src/trainings.ts delete mode 100644 integrations/replicate/src/types.ts delete mode 100644 integrations/replicate/src/utils.ts delete mode 100644 integrations/replicate/tsconfig.json delete mode 100644 integrations/replicate/tsup.config.ts delete mode 100644 integrations/resend/CHANGELOG.md delete mode 100644 integrations/resend/package.json delete mode 100644 integrations/resend/src/audiences.ts delete mode 100644 integrations/resend/src/batch.ts delete mode 100644 integrations/resend/src/contacts.ts delete mode 100644 integrations/resend/src/emails.ts delete mode 100644 integrations/resend/src/index.ts delete mode 100644 integrations/resend/src/utils.ts delete mode 100644 integrations/resend/tsconfig.json delete mode 100644 integrations/resend/tsup.config.ts delete mode 100644 integrations/sendgrid/CHANGELOG.md delete mode 100644 integrations/sendgrid/README.md delete mode 100644 integrations/sendgrid/package.json delete mode 100644 integrations/sendgrid/src/index.ts delete mode 100644 integrations/sendgrid/tsconfig.json delete mode 100644 integrations/sendgrid/tsup.config.ts delete mode 100644 integrations/shopify/CHANGELOG.md delete mode 100644 integrations/shopify/README.md delete mode 100644 integrations/shopify/package.json delete mode 100644 integrations/shopify/src/events.ts delete mode 100644 integrations/shopify/src/index.ts delete mode 100644 integrations/shopify/src/payload-examples/AppSubscriptionsUpdate.json delete mode 100644 integrations/shopify/src/payload-examples/AppUninstalled.json delete mode 100644 integrations/shopify/src/payload-examples/BulkOperationsFinish.json delete mode 100644 integrations/shopify/src/payload-examples/CartsCreate.json delete mode 100644 integrations/shopify/src/payload-examples/CheckoutsCreate.json delete mode 100644 integrations/shopify/src/payload-examples/CheckoutsDelete.json delete mode 100644 integrations/shopify/src/payload-examples/CollectionListingsAdd.json delete mode 100644 integrations/shopify/src/payload-examples/CollectionListingsRemove.json delete mode 100644 integrations/shopify/src/payload-examples/CollectionsCreate.json delete mode 100644 integrations/shopify/src/payload-examples/CollectionsDelete.json delete mode 100644 integrations/shopify/src/payload-examples/CompaniesCreate.json delete mode 100644 integrations/shopify/src/payload-examples/CompanyContactsCreate.json delete mode 100644 integrations/shopify/src/payload-examples/CompanyLocationsCreate.json delete mode 100644 integrations/shopify/src/payload-examples/CustomerGroupsCreate.json delete mode 100644 integrations/shopify/src/payload-examples/CustomerPaymentMethodsCreate.json delete mode 100644 integrations/shopify/src/payload-examples/CustomersCreate.json delete mode 100644 integrations/shopify/src/payload-examples/CustomersDelete.json delete mode 100644 integrations/shopify/src/payload-examples/CustomersEmailMarketingConsentUpdate.json delete mode 100644 integrations/shopify/src/payload-examples/CustomersMarketingConsentUpdate.json delete mode 100644 integrations/shopify/src/payload-examples/CustomersMerge.json delete mode 100644 integrations/shopify/src/payload-examples/Deleted.json delete mode 100644 integrations/shopify/src/payload-examples/DeliveryProfile.json delete mode 100644 integrations/shopify/src/payload-examples/DisputesCreate.json delete mode 100644 integrations/shopify/src/payload-examples/DomainsCreate.json delete mode 100644 integrations/shopify/src/payload-examples/DraftOrdersCreate.json delete mode 100644 integrations/shopify/src/payload-examples/DraftOrdersDelete.json delete mode 100644 integrations/shopify/src/payload-examples/Fulfillment.json delete mode 100644 integrations/shopify/src/payload-examples/FulfillmentEventsCreate.json delete mode 100644 integrations/shopify/src/payload-examples/FulfillmentOrdersCancellationRequestAccepted.json delete mode 100644 integrations/shopify/src/payload-examples/FulfillmentOrdersCancellationRequestRejected.json delete mode 100644 integrations/shopify/src/payload-examples/FulfillmentOrdersCancellationRequestSubmitted.json delete mode 100644 integrations/shopify/src/payload-examples/FulfillmentOrdersCancelled.json delete mode 100644 integrations/shopify/src/payload-examples/FulfillmentOrdersFulfillmentRequestAccepted.json delete mode 100644 integrations/shopify/src/payload-examples/FulfillmentOrdersFulfillmentRequestRejected.json delete mode 100644 integrations/shopify/src/payload-examples/FulfillmentOrdersFulfillmentRequestSubmitted.json delete mode 100644 integrations/shopify/src/payload-examples/FulfillmentOrdersFulfillmentServiceFailedToComplete.json delete mode 100644 integrations/shopify/src/payload-examples/FulfillmentOrdersHoldReleased.json delete mode 100644 integrations/shopify/src/payload-examples/FulfillmentOrdersLineItemsPreparedForLocalDelivery.json delete mode 100644 integrations/shopify/src/payload-examples/FulfillmentOrdersLineItemsPreparedForPickup.json delete mode 100644 integrations/shopify/src/payload-examples/FulfillmentOrdersMoved.json delete mode 100644 integrations/shopify/src/payload-examples/FulfillmentOrdersOrderRoutingComplete.json delete mode 100644 integrations/shopify/src/payload-examples/FulfillmentOrdersPlacedOnHold.json delete mode 100644 integrations/shopify/src/payload-examples/FulfillmentOrdersRescheduled.json delete mode 100644 integrations/shopify/src/payload-examples/FulfillmentOrdersScheduledFulfillmentOrderReady.json delete mode 100644 integrations/shopify/src/payload-examples/InventoryItem.json delete mode 100644 integrations/shopify/src/payload-examples/InventoryItemDeleted.json delete mode 100644 integrations/shopify/src/payload-examples/InventoryLevel.json delete mode 100644 integrations/shopify/src/payload-examples/InventoryLevelDisconnected.json delete mode 100644 integrations/shopify/src/payload-examples/Location.json delete mode 100644 integrations/shopify/src/payload-examples/Market.json delete mode 100644 integrations/shopify/src/payload-examples/Order.json delete mode 100644 integrations/shopify/src/payload-examples/OrderEdited.json delete mode 100644 integrations/shopify/src/payload-examples/OrderTransactionsCreate.json delete mode 100644 integrations/shopify/src/payload-examples/PaymentSchedule.json delete mode 100644 integrations/shopify/src/payload-examples/Product.json delete mode 100644 integrations/shopify/src/payload-examples/ProductFeedCreated.json delete mode 100644 integrations/shopify/src/payload-examples/ProductFeedFullSync.json delete mode 100644 integrations/shopify/src/payload-examples/ProductFeedIncrementalSync.json delete mode 100644 integrations/shopify/src/payload-examples/ProductFeedsCreate.json delete mode 100644 integrations/shopify/src/payload-examples/ProductFeedsFullSync.json delete mode 100644 integrations/shopify/src/payload-examples/ProductFeedsIncrementalSync.json delete mode 100644 integrations/shopify/src/payload-examples/ProductListing.json delete mode 100644 integrations/shopify/src/payload-examples/ProductListingRemoved.json delete mode 100644 integrations/shopify/src/payload-examples/Refund.json delete mode 100644 integrations/shopify/src/payload-examples/ScheduledProductListingsAdd.json delete mode 100644 integrations/shopify/src/payload-examples/ScheduledProductListingsRemove.json delete mode 100644 integrations/shopify/src/payload-examples/SellingPlanGroup.json delete mode 100644 integrations/shopify/src/payload-examples/SellingPlanGroupDeleted.json delete mode 100644 integrations/shopify/src/payload-examples/Shop.json delete mode 100644 integrations/shopify/src/payload-examples/ShopLocale.json delete mode 100644 integrations/shopify/src/payload-examples/SubscriptionBillingAttempt.json delete mode 100644 integrations/shopify/src/payload-examples/SubscriptionBillingCycle.json delete mode 100644 integrations/shopify/src/payload-examples/SubscriptionContract.json delete mode 100644 integrations/shopify/src/payload-examples/TenderTransaction.json delete mode 100644 integrations/shopify/src/payload-examples/Theme.json delete mode 100644 integrations/shopify/src/payload-examples/index.ts delete mode 100644 integrations/shopify/src/rest.ts delete mode 100644 integrations/shopify/src/schemas.ts delete mode 100644 integrations/shopify/src/triggers.ts delete mode 100644 integrations/shopify/src/types.ts delete mode 100644 integrations/shopify/src/utils.ts delete mode 100644 integrations/shopify/src/webhooks.ts delete mode 100644 integrations/shopify/tsconfig.json delete mode 100644 integrations/shopify/tsup.config.ts delete mode 100644 integrations/slack/CHANGELOG.md delete mode 100644 integrations/slack/package.json delete mode 100644 integrations/slack/src/index.ts delete mode 100644 integrations/slack/tsconfig.json delete mode 100644 integrations/slack/tsup.config.ts delete mode 100644 integrations/stripe/CHANGELOG.md delete mode 100644 integrations/stripe/README.md delete mode 100644 integrations/stripe/package.json delete mode 100644 integrations/stripe/src/charges.ts delete mode 100644 integrations/stripe/src/checkout.ts delete mode 100644 integrations/stripe/src/customers.ts delete mode 100644 integrations/stripe/src/events.ts delete mode 100644 integrations/stripe/src/examples.ts delete mode 100644 integrations/stripe/src/index.ts delete mode 100644 integrations/stripe/src/schemas.ts delete mode 100644 integrations/stripe/src/subscriptions.ts delete mode 100644 integrations/stripe/src/types.ts delete mode 100644 integrations/stripe/src/utils.ts delete mode 100644 integrations/stripe/src/webhookEndpoints.ts delete mode 100644 integrations/stripe/tsconfig.json delete mode 100644 integrations/stripe/tsup.config.ts delete mode 100644 integrations/supabase/CHANGELOG.md delete mode 100644 integrations/supabase/README.md delete mode 100644 integrations/supabase/package.json delete mode 100644 integrations/supabase/src/database/index.ts delete mode 100644 integrations/supabase/src/database/types.ts delete mode 100644 integrations/supabase/src/index.ts delete mode 100644 integrations/supabase/src/management/index.ts delete mode 100644 integrations/supabase/tsconfig.json delete mode 100644 integrations/supabase/tsup.config.ts delete mode 100644 integrations/typeform/CHANGELOG.md delete mode 100644 integrations/typeform/package.json delete mode 100644 integrations/typeform/src/consts.ts delete mode 100644 integrations/typeform/src/forms.ts delete mode 100644 integrations/typeform/src/index.ts delete mode 100644 integrations/typeform/src/payload-examples.ts delete mode 100644 integrations/typeform/src/responses.ts delete mode 100644 integrations/typeform/src/types.ts delete mode 100644 integrations/typeform/src/webhooks.ts delete mode 100644 integrations/typeform/tsconfig.json delete mode 100644 integrations/typeform/tsup.config.ts delete mode 100644 packages/astro/CHANGELOG.md delete mode 100644 packages/astro/LICENSE delete mode 100644 packages/astro/README.md delete mode 100644 packages/astro/package.json delete mode 100644 packages/astro/src/index.ts delete mode 100644 packages/astro/tsconfig.json delete mode 100644 packages/astro/tsup.config.ts delete mode 100644 packages/eslint-plugin/.eslintrc.js delete mode 100644 packages/eslint-plugin/CHANGELOG.md delete mode 100644 packages/eslint-plugin/LICENSE delete mode 100644 packages/eslint-plugin/README.md delete mode 100644 packages/eslint-plugin/docs/rules/no-duplicated-task-keys.md delete mode 100644 packages/eslint-plugin/docs/rules/no-trigger-core-import.md delete mode 100644 packages/eslint-plugin/lib/index.js delete mode 100644 packages/eslint-plugin/lib/rules/no-duplicated-task-keys.js delete mode 100644 packages/eslint-plugin/lib/rules/no-trigger-core-import.js delete mode 100644 packages/eslint-plugin/package.json delete mode 100644 packages/eslint-plugin/tests/lib/rules/no-duplicated-task-keys.js delete mode 100644 packages/eslint-plugin/tests/lib/rules/no-trigger-core-import.js delete mode 100644 packages/eslint-plugin/tsconfig.json delete mode 100644 packages/express/CHANGELOG.md delete mode 100644 packages/express/LICENSE delete mode 100644 packages/express/package.json delete mode 100644 packages/express/src/index.ts delete mode 100644 packages/express/tsconfig.json delete mode 100644 packages/express/tsup.config.ts delete mode 100644 packages/integration-kit/CHANGELOG.md delete mode 100644 packages/integration-kit/LICENSE delete mode 100644 packages/integration-kit/README.md delete mode 100644 packages/integration-kit/package.json delete mode 100644 packages/integration-kit/src/index.ts delete mode 100644 packages/integration-kit/src/json.ts delete mode 100644 packages/integration-kit/src/omit.ts delete mode 100644 packages/integration-kit/src/prettify.ts delete mode 100644 packages/integration-kit/src/properties.ts delete mode 100644 packages/integration-kit/src/types.ts delete mode 100644 packages/integration-kit/src/utils.ts delete mode 100644 packages/integration-kit/src/webhooks.ts delete mode 100644 packages/integration-kit/tsconfig.json delete mode 100644 packages/integration-kit/tsup.config.ts delete mode 100644 packages/nestjs/CHANGELOG.md delete mode 100644 packages/nestjs/LICENSE delete mode 100644 packages/nestjs/README.md delete mode 100644 packages/nestjs/package.json delete mode 100644 packages/nestjs/src/index.ts delete mode 100644 packages/nestjs/tsconfig.json delete mode 100644 packages/nestjs/tsup.config.ts delete mode 100644 packages/nextjs/CHANGELOG.md delete mode 100644 packages/nextjs/LICENSE delete mode 100644 packages/nextjs/README.md delete mode 100644 packages/nextjs/package.json delete mode 100644 packages/nextjs/src/index.ts delete mode 100644 packages/nextjs/tsconfig.json delete mode 100644 packages/nextjs/tsup.config.ts delete mode 100644 packages/react/CHANGELOG.md delete mode 100644 packages/react/LICENSE delete mode 100644 packages/react/package.json delete mode 100644 packages/react/src/TriggerProvider.tsx delete mode 100644 packages/react/src/events.ts delete mode 100644 packages/react/src/fetch.ts delete mode 100644 packages/react/src/index.ts delete mode 100644 packages/react/src/runs.ts delete mode 100644 packages/react/src/statuses.ts delete mode 100644 packages/react/tsconfig.json delete mode 100644 packages/react/tsup.config.ts delete mode 100644 packages/remix/CHANGELOG.md delete mode 100644 packages/remix/LICENSE delete mode 100644 packages/remix/README.md delete mode 100644 packages/remix/package.json delete mode 100644 packages/remix/src/index.ts delete mode 100644 packages/remix/tsconfig.json delete mode 100644 packages/remix/tsup.config.ts delete mode 100644 packages/sveltekit/CHANGELOG.md delete mode 100644 packages/sveltekit/LICENSE delete mode 100644 packages/sveltekit/README.md delete mode 100644 packages/sveltekit/package.json delete mode 100644 packages/sveltekit/src/index.ts delete mode 100644 packages/sveltekit/tsconfig.json delete mode 100644 packages/sveltekit/tsup.config.ts delete mode 100644 packages/testing/CHANGELOG.md delete mode 100644 packages/testing/LICENSE delete mode 100644 packages/testing/README.md delete mode 100644 packages/testing/package.json delete mode 100644 packages/testing/src/index.ts delete mode 100644 packages/testing/tests/createJobTester.test.ts delete mode 100644 packages/testing/tsconfig.json delete mode 100644 packages/testing/tsup.config.ts delete mode 100644 packages/yalt/CHANGELOG.md delete mode 100644 packages/yalt/README.md delete mode 100644 packages/yalt/package.json delete mode 100644 packages/yalt/src/index.ts delete mode 100644 packages/yalt/tsconfig.json delete mode 100644 packages/yalt/tsup.config.ts delete mode 100644 perf/README.md delete mode 100644 perf/package.json delete mode 100644 perf/src/index.ts delete mode 100644 perf/src/server.ts delete mode 100644 perf/src/trigger.ts delete mode 100644 perf/tsconfig.json delete mode 100644 references/astro-referece/.env.example delete mode 100644 references/astro-referece/.gitignore delete mode 100644 references/astro-referece/.vscode/extensions.json delete mode 100644 references/astro-referece/.vscode/launch.json delete mode 100644 references/astro-referece/README.md delete mode 100644 references/astro-referece/astro.config.mjs delete mode 100644 references/astro-referece/package.json delete mode 100644 references/astro-referece/public/favicon.svg delete mode 100644 references/astro-referece/src/components/Card.astro delete mode 100644 references/astro-referece/src/env.d.ts delete mode 100644 references/astro-referece/src/jobs/example.ts delete mode 100644 references/astro-referece/src/layouts/Layout.astro delete mode 100644 references/astro-referece/src/pages/api/trigger.ts delete mode 100644 references/astro-referece/src/pages/index.astro delete mode 100644 references/astro-referece/src/trigger.ts delete mode 100644 references/astro-referece/tsconfig.json delete mode 100644 references/deno-reference/.vscode/settings.json delete mode 100644 references/deno-reference/deno.json delete mode 100644 references/deno-reference/deno.lock delete mode 100644 references/deno-reference/main.ts delete mode 100644 references/hono-reference/.gitignore delete mode 100644 references/hono-reference/README.md delete mode 100644 references/hono-reference/package.json delete mode 100644 references/hono-reference/src/index.ts delete mode 100644 references/hono-reference/tsconfig.json delete mode 100644 references/job-catalog/.env.example delete mode 100644 references/job-catalog/README.md delete mode 100644 references/job-catalog/fixtures/large.json delete mode 100644 references/job-catalog/fixtures/mydata.csv delete mode 100644 references/job-catalog/fixtures/toolarge.json delete mode 100644 references/job-catalog/package.json delete mode 100644 references/job-catalog/src/airtable.ts delete mode 100644 references/job-catalog/src/auto-yield.ts delete mode 100644 references/job-catalog/src/background-fetch.ts delete mode 100644 references/job-catalog/src/built-ins.ts delete mode 100644 references/job-catalog/src/byo-auth.ts delete mode 100644 references/job-catalog/src/canceling.ts delete mode 100644 references/job-catalog/src/cli-example.ts delete mode 100644 references/job-catalog/src/dynamic-schedule.ts delete mode 100644 references/job-catalog/src/dynamic-triggers.ts delete mode 100644 references/job-catalog/src/edge-cases.ts delete mode 100644 references/job-catalog/src/events.ts delete mode 100644 references/job-catalog/src/github.ts delete mode 100644 references/job-catalog/src/httpTrigger.ts delete mode 100644 references/job-catalog/src/invoke.ts delete mode 100644 references/job-catalog/src/linear.ts delete mode 100644 references/job-catalog/src/misconfigured.ts delete mode 100644 references/job-catalog/src/notifications.ts delete mode 100644 references/job-catalog/src/openai.ts delete mode 100644 references/job-catalog/src/plain.ts delete mode 100644 references/job-catalog/src/redacted.ts delete mode 100644 references/job-catalog/src/replicate.ts delete mode 100644 references/job-catalog/src/resend.ts delete mode 100644 references/job-catalog/src/schedules.ts delete mode 100644 references/job-catalog/src/sendgrid.ts delete mode 100644 references/job-catalog/src/shopify.ts delete mode 100644 references/job-catalog/src/slack.ts delete mode 100644 references/job-catalog/src/status.ts delete mode 100644 references/job-catalog/src/stressTest.ts delete mode 100644 references/job-catalog/src/stripe.ts delete mode 100644 references/job-catalog/src/supabase-types.ts delete mode 100644 references/job-catalog/src/supabase.ts delete mode 100644 references/job-catalog/src/typeform.ts delete mode 100644 references/job-catalog/tsconfig.json delete mode 100644 references/nestjs-example/.env.example delete mode 100644 references/nestjs-example/.eslintrc.js delete mode 100644 references/nestjs-example/.gitignore delete mode 100644 references/nestjs-example/.prettierrc delete mode 100644 references/nestjs-example/README.md delete mode 100644 references/nestjs-example/nest-cli.json delete mode 100644 references/nestjs-example/package.json delete mode 100644 references/nestjs-example/src/app.controller.ts delete mode 100644 references/nestjs-example/src/app.module.ts delete mode 100644 references/nestjs-example/src/main.ts delete mode 100644 references/nestjs-example/tsconfig.build.json delete mode 100644 references/nestjs-example/tsconfig.json delete mode 100644 references/nextjs-reference/.eslintrc.json delete mode 100644 references/nextjs-reference/.gitignore delete mode 100644 references/nextjs-reference/.vscode/launch.json delete mode 100644 references/nextjs-reference/.vscode/settings.json delete mode 100644 references/nextjs-reference/README.md delete mode 100644 references/nextjs-reference/next.config.js delete mode 100644 references/nextjs-reference/package.json delete mode 100644 references/nextjs-reference/public/favicon.ico delete mode 100644 references/nextjs-reference/public/next.svg delete mode 100644 references/nextjs-reference/public/vercel.svg delete mode 100644 references/nextjs-reference/src/app/api/send-test-event/route.ts delete mode 100644 references/nextjs-reference/src/app/api/trigger/route.ts delete mode 100644 references/nextjs-reference/src/app/events/[eventId]/page.tsx delete mode 100644 references/nextjs-reference/src/app/layout.tsx delete mode 100644 references/nextjs-reference/src/app/page.tsx delete mode 100644 references/nextjs-reference/src/components/ReactQuery.tsx delete mode 100644 references/nextjs-reference/src/components/RunDetails.tsx delete mode 100644 references/nextjs-reference/src/components/SendTestEvent.tsx delete mode 100644 references/nextjs-reference/src/jobs/hooks.ts delete mode 100644 references/nextjs-reference/src/mocks/handlers.ts delete mode 100644 references/nextjs-reference/src/styles/Home.module.css delete mode 100644 references/nextjs-reference/src/styles/globals.css delete mode 100644 references/nextjs-reference/src/supabase.types.ts delete mode 100644 references/nextjs-reference/src/trigger.ts delete mode 100644 references/nextjs-reference/tsconfig.json delete mode 100644 references/nextjs-test/.env.example delete mode 100644 references/nextjs-test/.eslintrc.json delete mode 100644 references/nextjs-test/.gitignore delete mode 100644 references/nextjs-test/README.md delete mode 100644 references/nextjs-test/jsconfig.json delete mode 100644 references/nextjs-test/next.config.js delete mode 100644 references/nextjs-test/package.json delete mode 100644 references/nextjs-test/public/next.svg delete mode 100644 references/nextjs-test/public/vercel.svg delete mode 100644 references/nextjs-test/src/app/api/trigger/route.js delete mode 100644 references/nextjs-test/src/app/favicon.ico delete mode 100644 references/nextjs-test/src/app/globals.css delete mode 100644 references/nextjs-test/src/app/layout.js delete mode 100644 references/nextjs-test/src/app/page.js delete mode 100644 references/nextjs-test/src/app/page.module.css delete mode 100644 references/nextjs-test/src/jobs/examples.js delete mode 100644 references/nextjs-test/src/trigger.js delete mode 100644 references/package-tester/.env.local.example delete mode 100644 references/package-tester/.eslintrc.json delete mode 100644 references/package-tester/.gitignore delete mode 100644 references/package-tester/README.md delete mode 100644 references/package-tester/app/_actions.tsx delete mode 100644 references/package-tester/app/api/trigger/route.ts delete mode 100644 references/package-tester/app/components/ReactHooks.tsx delete mode 100644 references/package-tester/app/components/SendReactHookEventForm.tsx delete mode 100644 references/package-tester/app/events/[eventId]/page.tsx delete mode 100644 references/package-tester/app/favicon.ico delete mode 100644 references/package-tester/app/globals.css delete mode 100644 references/package-tester/app/jobs/react-hook.ts delete mode 100644 references/package-tester/app/layout.tsx delete mode 100644 references/package-tester/app/page.tsx delete mode 100644 references/package-tester/app/trigger.ts delete mode 100644 references/package-tester/next.config.js delete mode 100644 references/package-tester/package.json delete mode 100644 references/package-tester/postcss.config.js delete mode 100644 references/package-tester/public/next.svg delete mode 100644 references/package-tester/public/vercel.svg delete mode 100644 references/package-tester/tailwind.config.js delete mode 100644 references/package-tester/tsconfig.json delete mode 100644 references/remix-reference/.eslintrc.js delete mode 100644 references/remix-reference/.gitignore delete mode 100644 references/remix-reference/README.md delete mode 100644 references/remix-reference/app/entry.client.tsx delete mode 100644 references/remix-reference/app/entry.server.tsx delete mode 100644 references/remix-reference/app/jobs/example.server.ts delete mode 100644 references/remix-reference/app/root.tsx delete mode 100644 references/remix-reference/app/routes/_index.tsx delete mode 100644 references/remix-reference/app/routes/api.trigger.ts delete mode 100644 references/remix-reference/app/trigger.ts delete mode 100644 references/remix-reference/package.json delete mode 100644 references/remix-reference/public/favicon.ico delete mode 100644 references/remix-reference/remix.config.js delete mode 100644 references/remix-reference/remix.env.d.ts delete mode 100644 references/remix-reference/tsconfig.json delete mode 100644 references/svelte-example/.env.example delete mode 100644 references/svelte-example/.eslintignore delete mode 100644 references/svelte-example/.eslintrc.cjs delete mode 100644 references/svelte-example/.gitignore delete mode 100644 references/svelte-example/.npmrc delete mode 100644 references/svelte-example/.prettierignore delete mode 100644 references/svelte-example/.prettierrc delete mode 100644 references/svelte-example/README.md delete mode 100644 references/svelte-example/package.json delete mode 100644 references/svelte-example/src/app.d.ts delete mode 100644 references/svelte-example/src/app.html delete mode 100644 references/svelte-example/src/jobs/example.ts delete mode 100644 references/svelte-example/src/lib/index.ts delete mode 100644 references/svelte-example/src/routes/+page.svelte delete mode 100644 references/svelte-example/src/routes/api/trigger/+server.ts delete mode 100644 references/svelte-example/src/trigger.ts delete mode 100644 references/svelte-example/static/favicon.png delete mode 100644 references/svelte-example/svelte.config.js delete mode 100644 references/svelte-example/tsconfig.json delete mode 100644 references/svelte-example/vite.config.ts delete mode 100644 references/unit-testing/.gitignore delete mode 100644 references/unit-testing/dummy-integration/index.ts delete mode 100644 references/unit-testing/package.json delete mode 100644 references/unit-testing/tests/example.test.ts delete mode 100644 references/unit-testing/tsconfig.json delete mode 100644 runtime_tests/package.json delete mode 100644 runtime_tests/tests/bun/index.test.ts delete mode 100644 runtime_tests/tests/bun/tsconfig.json delete mode 100644 runtime_tests/tests/deno/deps.ts delete mode 100644 runtime_tests/tests/deno/trigger.test.ts delete mode 100644 runtime_tests/tests/node/index.test.ts delete mode 100644 runtime_tests/tests/node/vitest.config.ts delete mode 100644 runtime_tests/tests/wrangler/index.test.ts delete mode 100644 runtime_tests/tests/wrangler/index.ts delete mode 100644 runtime_tests/tests/wrangler/vitest.config.ts delete mode 100644 runtime_tests/tsconfig.json diff --git a/apps/yalt/.dev.vars.example b/apps/yalt/.dev.vars.example deleted file mode 100644 index 77bf4c333..000000000 --- a/apps/yalt/.dev.vars.example +++ /dev/null @@ -1 +0,0 @@ -SECRET_KEY= \ No newline at end of file diff --git a/apps/yalt/.editorconfig b/apps/yalt/.editorconfig deleted file mode 100644 index 64ab2601f..000000000 --- a/apps/yalt/.editorconfig +++ /dev/null @@ -1,13 +0,0 @@ -# http://editorconfig.org -root = true - -[*] -indent_style = tab -tab_width = 2 -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -[*.yml] -indent_style = space diff --git a/apps/yalt/.gitignore b/apps/yalt/.gitignore deleted file mode 100644 index 3b0fe33c4..000000000 --- a/apps/yalt/.gitignore +++ /dev/null @@ -1,172 +0,0 @@ -# Logs - -logs -_.log -npm-debug.log_ -yarn-debug.log* -yarn-error.log* -lerna-debug.log* -.pnpm-debug.log* - -# Diagnostic reports (https://nodejs.org/api/report.html) - -report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json - -# Runtime data - -pids -_.pid -_.seed -\*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover - -lib-cov - -# Coverage directory used by tools like istanbul - -coverage -\*.lcov - -# nyc test coverage - -.nyc_output - -# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) - -.grunt - -# Bower dependency directory (https://bower.io/) - -bower_components - -# node-waf configuration - -.lock-wscript - -# Compiled binary addons (https://nodejs.org/api/addons.html) - -build/Release - -# Dependency directories - -node_modules/ -jspm_packages/ - -# Snowpack dependency directory (https://snowpack.dev/) - -web_modules/ - -# TypeScript cache - -\*.tsbuildinfo - -# Optional npm cache directory - -.npm - -# Optional eslint cache - -.eslintcache - -# Optional stylelint cache - -.stylelintcache - -# Microbundle cache - -.rpt2_cache/ -.rts2_cache_cjs/ -.rts2_cache_es/ -.rts2_cache_umd/ - -# Optional REPL history - -.node_repl_history - -# Output of 'npm pack' - -\*.tgz - -# Yarn Integrity file - -.yarn-integrity - -# dotenv environment variable files - -.env -.env.development.local -.env.test.local -.env.production.local -.env.local - -# parcel-bundler cache (https://parceljs.org/) - -.cache -.parcel-cache - -# Next.js build output - -.next -out - -# Nuxt.js build / generate output - -.nuxt -dist - -# Gatsby files - -.cache/ - -# Comment in the public line in if your project uses Gatsby and not Next.js - -# https://nextjs.org/blog/next-9-1#public-directory-support - -# public - -# vuepress build output - -.vuepress/dist - -# vuepress v2.x temp and cache directory - -.temp -.cache - -# Docusaurus cache and generated files - -.docusaurus - -# Serverless directories - -.serverless/ - -# FuseBox cache - -.fusebox/ - -# DynamoDB Local files - -.dynamodb/ - -# TernJS port file - -.tern-port - -# Stores VSCode versions used for testing VSCode extensions - -.vscode-test - -# yarn v2 - -.yarn/cache -.yarn/unplugged -.yarn/build-state.yml -.yarn/install-state.gz -.pnp.\* - -# wrangler project - -.dev.vars -.wrangler/ diff --git a/apps/yalt/.prettierrc b/apps/yalt/.prettierrc deleted file mode 100644 index 5c7b5d3c7..000000000 --- a/apps/yalt/.prettierrc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "printWidth": 140, - "singleQuote": true, - "semi": true, - "useTabs": true -} diff --git a/apps/yalt/README.md b/apps/yalt/README.md deleted file mode 100644 index d4604f0db..000000000 --- a/apps/yalt/README.md +++ /dev/null @@ -1,26 +0,0 @@ -## Trigger.dev Yalt Server - -Yalt (Yet Another Local Tunnel) is the Trigger.dev tunneling service that powers the local development of Trigger.dev cloud users. - -## Why? - -The Trigger.dev server communicates with user endpoints over HTTP, so during local development we need a way for the Trigger.dev server to make HTTP requests over the public internet to the user's local machine. This is accomplished via a tunneling service like ngrok, which we've been using up until now. Unfortunately, the ngrok free plan has pretty aggressive rate limits and some Trigger.dev users have faced issues with their local jobs not running/working because of this. Yalt.dev is our solution. - -## How does it work? - -Yalt.dev is a Cloudflare Worker that uses Durable Objects to persist a websocket connection from the `@trigger.dev/cli dev` command and proxies requests through the websocket connection and then returns responses from the websocket connection. - -- There is an admin API available at `admin.trigger.dev` that allows tunnels to be created (authenticated via a SECRET_KEY) -- The Cloudflare Worker has a wildcard subdomain route `*.yalt.dev/*` -- When the client receives the tunnel ID, they can connect to the server via `wss://${tunnelId}.yalt.dev/connect` -- Now, requests to `https://${tunnelId}.yalt.dev/api/trigger` are sent to the Durable Object (`YaltConnection`) using the subdomain/tunnelId -- Requests are serialized to a JSON string and sent to the WebSocket -- The WebSocket client running in `@trigger.dev/cli dev` receives the request message and makes a real request to the local dev server -- The `@trigger.dev/cli dev` serializes the response and sends it back to the server. -- The server responds to the original request - -Along with this server there is a package called `@trigger.dev/yalt` that has shared code and is used in: - -- Yalt.dev server (this project) -- `@trigger.dev/cli dev` command -- The Trigger.dev server (to create the tunnels) diff --git a/apps/yalt/package.json b/apps/yalt/package.json deleted file mode 100644 index 605f50f87..000000000 --- a/apps/yalt/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "yalt", - "version": "0.0.1", - "private": true, - "scripts": { - "deploy": "wrangler deploy", - "dev": "wrangler dev --port 8787", - "start": "wrangler dev" - }, - "devDependencies": { - "@cloudflare/workers-types": "~4.20231121.0", - "wrangler": "^3.21.0" - }, - "dependencies": { - "@trigger.dev/yalt": "workspace:*" - } -} \ No newline at end of file diff --git a/apps/yalt/src/index.ts b/apps/yalt/src/index.ts deleted file mode 100644 index d937ad17c..000000000 --- a/apps/yalt/src/index.ts +++ /dev/null @@ -1,259 +0,0 @@ -import { ClientMessages, createRequestMessage } from '@trigger.dev/yalt'; - -export interface Env { - // environemnt variables - SECRET_KEY: string; - WORKER_HOST: string; - - // bindings - connections: DurableObjectNamespace; - tunnelIds: KVNamespace; -} - -export default { - async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise { - const url = new URL(request.url); - const route = routeUrl(url, env); - - switch (route.type) { - case 'management': { - return handleManagementRequest(request, env, ctx); - } - case 'tunnel': { - console.log(`Handling tunnel request for ${route.name}`); - - const id = await env.tunnelIds.get(route.name); - - if (!id) { - return new Response('Not Found', { status: 404 }); - } - - const tunnel = env.connections.get(env.connections.idFromString(id)); - return tunnel.fetch(request); - } - case 'not_found': { - return new Response('Not Found', { status: 404 }); - } - } - - return new Response('Not Found', { status: 404 }); - }, -}; - -type RouteDecision = - | { - type: 'management'; - } - | { - type: 'tunnel'; - name: string; - } - | { type: 'not_found' }; - -function routeUrl(url: URL, env: Env): RouteDecision { - const searchParams = new URLSearchParams(url.search); - - if (searchParams.has('t')) { - const name = searchParams.get('t'); - - if (name) { - return { type: 'tunnel', name }; - } - - return { type: 'management' }; - } - - if (!url.host.includes(env.WORKER_HOST)) { - return { type: 'not_found' }; - } - - const parts = url.host.split('.'); - - if (parts.length === 2) { - return { type: 'management' }; - } - - const tunnelName = parts[0]; - - if (tunnelName === 'admin') { - return { type: 'management' }; - } - - if (parts.length === 3) { - return { type: 'tunnel', name: parts[0] }; - } - - return { type: 'not_found' }; -} - -async function handleManagementRequest(request: Request, env: Env, ctx: ExecutionContext): Promise { - const authHeader = request.headers.get('authorization'); - if (!authHeader) { - return new Response('Authorization header is required', { status: 401 }); - } - - const authHeaderParts = authHeader.split(' '); - if (authHeaderParts.length !== 2) { - return new Response('Authorization header is invalid', { status: 401 }); - } - - const [authType, authKey] = authHeaderParts; - - if (authType !== 'Bearer') { - return new Response('Authorization header is invalid', { status: 401 }); - } - - if (authKey !== env.SECRET_KEY) { - return new Response('Authorization header is invalid', { status: 401 }); - } - - // Okay now we can actually handle the request - // We need to look at the path and see what we are doing - // POST /api/tunnels -> create a new tunnel - const url = new URL(request.url); - - if (url.pathname === '/api/tunnels' && request.method === 'POST') { - return handleCreateTunnel(request, env, ctx); - } - - return new Response('Not Found', { status: 404 }); -} - -async function handleCreateTunnel(request: Request, env: Env, ctx: ExecutionContext): Promise { - const tunnelId = env.connections.newUniqueId(); - const tunnelName = crypto.randomUUID(); - - await env.tunnelIds.put(tunnelName, tunnelId.toString()); - - return new Response(JSON.stringify({ id: tunnelName }), { status: 201 }); -} - -type Resolver = { - resolve: (value: T) => void; - reject: (error: Error) => void; -}; - -export class YaltConnection implements DurableObject { - private socket?: WebSocket; - private responseResolvers: Record> = {}; - - constructor( - private state: DurableObjectState, - private env: Env, - ) {} - - async fetch(request: Request>): Promise { - const url = new URL(request.url); - - switch (url.pathname) { - case '/connect': { - console.log(`Handling connect request`); - - // This is a request from the client to connect to the tunnel - if (request.headers.get('Upgrade') !== 'websocket') { - return new Response('expected websocket', { status: 400 }); - } - - const pair = new WebSocketPair(); - const [clientSocket, serverSocket] = Object.values(pair); - - await this.handleSocket(serverSocket); - - console.log(`Successfully connected to tunnel`); - - return new Response(null, { status: 101, webSocket: clientSocket }); - } - case '/api/trigger': { - return this.handleTunnelRequest(request); - } - default: { - return new Response('Not Found', { status: 404 }); - } - } - } - - private async handleSocket(socket: WebSocket) { - if (this.socket) { - this.socket.close(1000, 'replaced'); - } - - this.socket = socket; - - this.socket.addEventListener('message', (event) => { - // Here we need to listen for "response" messages from the client and send them to the server via stored promises on this object - const data = JSON.parse(typeof event.data === 'string' ? event.data : new TextDecoder('utf-8').decode(event.data)); - - const message = ClientMessages.safeParse(data); - - if (!message.success) { - console.error(message.error); - return; - } - - switch (message.data.type) { - case 'response': { - const { id, ...response } = message.data; - - const resolver = this.responseResolvers[id]; - - if (!resolver) { - console.error(`No resolver found for ${id}`); - return; - } - - delete this.responseResolvers[id]; - - resolver.resolve( - new Response(response.body, { - status: response.status, - headers: response.headers, - }), - ); - - break; - } - } - }); - - this.socket.accept(); - } - - private async handleTunnelRequest(request: Request): Promise { - if (!this.socket) { - return createErrorResponse(); - } - - if (this.socket.readyState !== WebSocket.READY_STATE_OPEN) { - return createErrorResponse(); - } - - const id = crypto.randomUUID(); - - const promise = new Promise((resolve, reject) => { - this.responseResolvers[id] = { resolve, reject }; - }); - - try { - const message = await createRequestMessage(id, request); - this.socket.send(JSON.stringify(message)); - } catch (error) { - console.error(error); - delete this.responseResolvers[id]; - - return createErrorResponse(); - } - - return promise; - } -} - -const createErrorResponse = () => - new Response( - JSON.stringify({ - message: 'Could not connect to your dev server. Make sure you are running the `npx @trigger.dev/cli@latest dev` command', - }), - { - status: 400, - headers: { 'Content-Type': 'application/json' }, - }, - ); diff --git a/apps/yalt/tsconfig.json b/apps/yalt/tsconfig.json deleted file mode 100644 index 745718722..000000000 --- a/apps/yalt/tsconfig.json +++ /dev/null @@ -1,107 +0,0 @@ -{ - "compilerOptions": { - /* Visit https://aka.ms/tsconfig.json to read more about this file */ - - /* Projects */ - // "incremental": true, /* Enable incremental compilation */ - // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ - // "tsBuildInfoFile": "./", /* Specify the folder for .tsbuildinfo incremental compilation files. */ - // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects */ - // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ - // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ - - /* Language and Environment */ - "target": "es2021" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */, - "lib": ["es2021"] /* Specify a set of bundled library declaration files that describe the target runtime environment. */, - "jsx": "react" /* Specify what JSX code is generated. */, - // "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */ - // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ - // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h' */ - // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ - // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`.` */ - // "reactNamespace": "", /* Specify the object invoked for `createElement`. This only applies when targeting `react` JSX emit. */ - // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ - // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ - - /* Modules */ - "module": "es2022" /* Specify what module code is generated. */, - // "rootDir": "./", /* Specify the root folder within your source files. */ - "moduleResolution": "node" /* Specify how TypeScript looks up a file from a given module specifier. */, - // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ - // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ - // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ - // "typeRoots": [], /* Specify multiple folders that act like `./node_modules/@types`. */ - "types": [ - "@cloudflare/workers-types/2023-07-01" - ] /* Specify type package names to be included without being referenced in a source file. */, - // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ - "resolveJsonModule": true /* Enable importing .json files */, - // "noResolve": true, /* Disallow `import`s, `require`s or ``s from expanding the number of files TypeScript should add to a project. */ - - /* JavaScript Support */ - "allowJs": true /* Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. */, - "checkJs": false /* Enable error reporting in type-checked JavaScript files. */, - // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`. */ - - /* Emit */ - // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ - // "declarationMap": true, /* Create sourcemaps for d.ts files. */ - // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ - // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ - // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */ - // "outDir": "./", /* Specify an output folder for all emitted files. */ - // "removeComments": true, /* Disable emitting comments. */ - "noEmit": true /* Disable emitting files from a compilation. */, - // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ - // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types */ - // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ - // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ - // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ - // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ - // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ - // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ - // "newLine": "crlf", /* Set the newline character for emitting files. */ - // "stripInternal": true, /* Disable emitting declarations that have `@internal` in their JSDoc comments. */ - // "noEmitHelpers": true, /* Disable generating custom helper functions like `__extends` in compiled output. */ - // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ - // "preserveConstEnums": true, /* Disable erasing `const enum` declarations in generated code. */ - // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ - // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ - - /* Interop Constraints */ - "isolatedModules": true /* Ensure that each file can be safely transpiled without relying on other imports. */, - "allowSyntheticDefaultImports": true /* Allow 'import x from y' when a module doesn't have a default export. */, - // "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. */, - // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ - "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */, - - /* Type Checking */ - "strict": true /* Enable all strict type-checking options. */, - // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied `any` type.. */ - // "strictNullChecks": true, /* When type checking, take into account `null` and `undefined`. */ - // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ - // "strictBindCallApply": true, /* Check that the arguments for `bind`, `call`, and `apply` methods match the original function. */ - // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ - // "noImplicitThis": true, /* Enable error reporting when `this` is given the type `any`. */ - // "useUnknownInCatchVariables": true, /* Type catch clause variables as 'unknown' instead of 'any'. */ - // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ - // "noUnusedLocals": true, /* Enable error reporting when a local variables aren't read. */ - // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read */ - // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ - // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ - // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ - // "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */ - // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ - // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type */ - // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ - // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ - - /* Completeness */ - // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ - "skipLibCheck": true /* Skip type checking all .d.ts files. */, - "paths": { - "@trigger.dev/yalt": ["../../packages/yalt/src/index"], - "@trigger.dev/yalt/*": ["../../packages/yalt/src/*"] - } - } -} diff --git a/apps/yalt/wrangler.toml b/apps/yalt/wrangler.toml deleted file mode 100644 index ed2591dcd..000000000 --- a/apps/yalt/wrangler.toml +++ /dev/null @@ -1,25 +0,0 @@ -name = "yalt" -main = "src/index.ts" -compatibility_date = "2023-12-06" -workers_dev = false -logpush = true - -routes = [ - { pattern = "*.yalt.dev/*", zone_name = "yalt.dev" }, - { pattern = "yalt.dev/*", zone_name = "yalt.dev" }, -] - -[vars] -WORKER_HOST = "yalt.dev" - -[[kv_namespaces]] -binding = "tunnelIds" -id = "e8cf1fcc9ad34fa0819694d86afa97ca" - -[[durable_objects.bindings]] -name = "connections" -class_name = "YaltConnection" - -[[migrations]] -tag = "v1" -new_classes = ["YaltConnection"] diff --git a/experiments/context.ts b/experiments/context.ts deleted file mode 100644 index 3b723f873..000000000 --- a/experiments/context.ts +++ /dev/null @@ -1,604 +0,0 @@ -import { z } from "zod"; -import * as v from "valibot"; -import { wrap } from "@typeschema/valibot"; - -export type ParserZodEsque = { - _input: TInput; - _output: TParsedInput; -}; - -export type ParserMyZodEsque = { - parse: (input: any) => TInput; -}; - -export type ParserSuperstructEsque = { - create: (input: unknown) => TInput; -}; - -export type ParserCustomValidatorEsque = (input: unknown) => Promise | TInput; - -export type ParserYupEsque = { - validateSync: (input: unknown) => TInput; -}; - -export type ParserScaleEsque = { - assert(value: unknown): asserts value is TInput; -}; - -export type ParserWithoutInput = - | ParserCustomValidatorEsque - | ParserMyZodEsque - | ParserScaleEsque - | ParserSuperstructEsque - | ParserYupEsque; - -export type ParserWithInputOutput = ParserZodEsque; - -export type Parser = ParserWithInputOutput | ParserWithoutInput; - -export type inferParser = TParser extends ParserWithInputOutput< - infer $TIn, - infer $TOut -> - ? { - in: $TIn; - out: $TOut; - } - : TParser extends ParserWithoutInput - ? { - in: $InOut; - out: $InOut; - } - : never; - -export type Simplify = TType extends any[] | Date ? TType : { [K in keyof TType]: TType[K] }; - -export type TriggerResult = { - id: string; -}; - -export type TaskRunResult = - | { - ok: true; - id: string; - output: TOutput; - } - | { - ok: false; - id: string; - error: unknown; - }; - -export type RunMetadata = { - run: string; -}; - -export type inferContext = - TContextBuilder extends ContextBuilder - ? TContext extends UnsetMarker - ? unknown - : TContextOverrides extends UnsetMarker - ? Simplify - : Simplify> - : never; - -export type RunFnParams = { - /** Metadata about the task, run, attempt, queue, environment, organization, project and batch. */ - meta: RunMetadata; - - /** Context added by task middleware */ - ctx: inferContext; - - payload: TPayload; -}; - -/** - * See https://github.com/microsoft/TypeScript/issues/41966#issuecomment-758187996 - * Fixes issues with iterating over keys of objects with index signatures. - * Without this, iterations over keys of objects with index signatures will lose - * type information about the keys and only the index signature will remain. - * @internal - */ -export type WithoutIndexSignature = { - [K in keyof TObj as string extends K ? never : number extends K ? never : K]: TObj[K]; -}; - -/** - * @internal - * Overwrite properties in `TType` with properties in `TWith` - * Only overwrites properties when the type to be overwritten - * is an object. Otherwise it will just use the type from `TWith`. - */ -export type Overwrite = TWith extends any - ? TType extends object - ? { - [K in - | keyof WithoutIndexSignature - | keyof WithoutIndexSignature]: K extends keyof TWith // Exclude index signature from keys - ? TWith[K] - : K extends keyof TType - ? TType[K] - : never; - } & (string extends keyof TWith // Handle cases with an index signature - ? { [key: string]: TWith[string] } - : number extends keyof TWith - ? { [key: number]: TWith[number] } - : // eslint-disable-next-line @typescript-eslint/ban-types - {}) - : TWith - : never; - -/** @internal */ -export const contextMiddlewareMarker = "contextMiddlewareMarker" as "contextMiddlewareMarker" & { - __brand: "contextMiddlewareMarker"; -}; -type ContextMiddlewareMarker = typeof contextMiddlewareMarker; - -interface ContextMiddlewareResultBase { - /** - * All middlewares should pass through their `next()`'s output. - * Requiring this marker makes sure that can't be forgotten at compile-time. - */ - readonly marker: ContextMiddlewareMarker; -} - -interface ContextMiddlewareOKResult<_TContextOverride> extends ContextMiddlewareResultBase { - ok: true; - data: unknown; -} - -interface ContextMiddlewareErrorResult<_TContextOverride> extends ContextMiddlewareResultBase { - ok: false; - error: Error; // should be our error -} - -/** - * @internal - */ -export type ContextMiddlewareResult<_TContextOverride> = - | ContextMiddlewareErrorResult<_TContextOverride> - | ContextMiddlewareOKResult<_TContextOverride>; - -export type ContextMiddlewareFunction = { - (opts: { - ctx: Simplify>; - meta: RunMetadata; - next: { - (): Promise>; - <$ContextOverride>(ctx: $ContextOverride): Promise>; - }; - }): Promise>; -}; - -export const unsetMarker = Symbol("unsetMarker"); -export type UnsetMarker = typeof unsetMarker; - -export interface ContextBuilder { - use<$ContextOverridesOut>( - fn: ContextMiddlewareFunction - ): ContextBuilder>; -} - -export type AnyContextBuilder = ContextBuilder; - -export function createContext( - initialContext?: TContext -): ContextBuilder { - const builder: AnyContextBuilder = { - use(middlewareFn) { - return {} as AnyContextBuilder; - }, - }; - - return builder; -} - -const contextBuilder = createContext({ foo: "bar" }); -const context = contextBuilder - .use((opts) => { - return opts.next({ - baz: "whatever", - }); - }) - .use((opts) => { - return opts.next({ - db: { - find: async (id: string) => { - return "hello"; - }, - }, - }); - }); - -type ctx = inferContext; - -const contextBuilder2 = createContext(); - -type ctx2 = inferContext; - -const contextBuilder3 = createContext({ bar: "baz" }); - -type ctx3 = inferContext; - -const contextBuilder4 = createContext().use((opts) => { - return opts.next({ - hello: "world", - }); -}); - -type ctx4 = inferContext; - -export type TaskOptions< - TOutput, - TContext extends AnyContextBuilder, - TIdentifier extends string, - TParser extends Parser | undefined = undefined, -> = { - /** An id for your task. This must be unique inside your project and not change between versions. */ - id: TIdentifier; - - schema?: TParser; - - context?: TContext; - - /** This gets called when a task is triggered. It's where you put the code you want to execute. - * - * @param payload - The payload that is passed to your task when it's triggered. This must be JSON serializable. - * @param params - Metadata about the run. - */ - run: (params: Simplify, TContext>>) => Promise; -}; - -export interface Task< - TOutput, - TIdentifier extends string, - TParser extends Parser | undefined = undefined, -> { - /** - * The id of the task. - */ - id: TIdentifier; - /** - * Trigger a task with the given payload, and continue without waiting for the result. If you want to wait for the result, use `triggerAndWait`. Returns the id of the triggered task run. - * @param payload - * @param options - * @returns TriggerResult - * - `id` - The id of the triggered task run. - */ - trigger: ( - payload: Simplify>, - options?: TriggerTaskOptions - ) => Promise; - - /** - * Trigger a task with the given payload, and wait for the result. Returns the result of the task run - * @param payload - * @param options - Options for the task run - * @returns TaskRunResult - * @example - * ``` - * const result = await task.triggerAndWait({ foo: "bar" }); - * - * if (result.ok) { - * console.log(result.output); - * } else { - * console.error(result.error); - * } - * ``` - */ - triggerAndWait: ( - payload: Simplify>, - options?: TriggerTaskOptions - ) => Promise>; -} - -export type AnyTask = Task; - -type inferParserIn = TParser extends Parser - ? inferParser["in"] - : TDefault; -type inferParserOut = TParser extends Parser - ? inferParser["out"] - : TDefault; - -export type TaskPayloadIn = TTask extends Task - ? inferParserIn - : never; - -export type TaskPayloadOut = TTask extends Task - ? inferParserOut - : never; - -export type TaskOutput = TTask extends Task - ? TOutput - : never; - -export type TaskIdentifier = TTask extends Task - ? TIdentifier - : never; - -export type TaskTypes = TTask extends Task< - infer TOutput, - infer TIdentifier, - infer TParser -> - ? { - id: TIdentifier; - payloadIn: inferParserIn; - payloadOut: inferParserOut; - output: TOutput; - } - : never; - -export type TriggerTaskOptions = { - idempotencyKey?: string; - maxAttempts?: number; - startAt?: Date; - startAfter?: number; - concurrencyKey?: string; -}; - -export type Prettify = { - [K in keyof T]: T[K]; -} & {}; - -export function task< - TOutput, - TContext extends AnyContextBuilder, - TIdentifier extends string, - TParser extends Parser | undefined = undefined, ->( - options: TaskOptions -): Task { - return createTask(options); -} - -export function createTask< - TOutput, - TContext extends AnyContextBuilder, - TIndentifier extends string, - TParser extends Parser | undefined = undefined, ->( - params: TaskOptions -): Task { - const task: Task = { - id: params.id, - trigger: async (payload, options) => { - return { - id: "run_1234", - }; - }, - triggerAndWait: async (payload, options) => { - const output = await params.run({ - meta: { run: "run_1234" }, - payload: payload as unknown as inferParserOut, // Actually do the parsing - ctx: {} as inferContext, - }); - - return { - ok: true, - id: "run_1234", - output, - }; - }, - }; - - return task; -} - -export interface TaskLibraryRecord { - [key: string]: AnyTask | TaskLibraryRecord; -} - -export interface TaskLibrary { - _def: { record: TRecord }; -} - -export type AnyTaskLibrary = TaskLibrary; - -export type CreateTaskLibraryOptions = { - [key: string]: AnyTask | AnyTaskLibrary | CreateTaskLibraryOptions; -}; - -export type DecorateCreateTaskLibraryOptions = - { - [K in keyof TTaskLibraryOptions]: TTaskLibraryOptions[K] extends infer $Value - ? $Value extends AnyTask - ? $Value - : $Value extends TaskLibrary - ? TRecord - : $Value extends CreateTaskLibraryOptions - ? DecorateCreateTaskLibraryOptions<$Value> - : never - : never; - }; - -function taskLibrary( - input: TInput -): TaskLibrary>; -function taskLibrary(input: TInput): TaskLibrary; -function taskLibrary(input: TaskLibraryRecord | CreateTaskLibraryOptions) { - // TODO: reserved words - - return { - _def: { - record: input, - }, - }; -} - -// ======== client side -type DecorateTask = { - trigger: (id: TaskIdentifier, payload: TaskPayloadIn) => Promise<{ id: string }>; -}; - -type DecoratedTaskLibraryRecord< - TTaskLibrary extends AnyTaskLibrary, - TRecord extends TaskLibraryRecord, -> = { - [TKey in keyof TRecord]: TRecord[TKey] extends infer $Value - ? $Value extends TaskLibraryRecord - ? DecoratedTaskLibraryRecord - : $Value extends AnyTask - ? DecorateTask<$Value> - : never - : never; -}; - -export type inferTaskLibraryClient = - DecoratedTaskLibraryRecord; - -export type CreateTriggerClient = { - lib: inferTaskLibraryClient; - runs: { - retrieve: (id: string) => Promise<{ status: boolean }>; - }; -}; - -export type CreateTriggerClientOptions = { - secretKey?: string; -}; - -export function createTriggerClient( - options?: CreateTriggerClientOptions -): CreateTriggerClient { - return {} as CreateTriggerClient; -} - -// trigger/my-tasks.ts -const taskOne = task({ - id: "task-1", - run: async () => { - const handle = await taskTwo.trigger({ url: "https://trigger.dev" }); - const result = await taskTwo.triggerAndWait({ url: "https://trigger.dev" }); - - return "foo-bar"; - }, -}); - -const taskTwo = task({ - id: "task-2", - async run(params) { - return { - hello: "world", - payload: params.payload.other, - }; - }, -}); - -const userTaskOne = task({ - id: "user/task-1", - context: contextBuilder4, - run: async (params) => { - return "foo-bar"; - }, -}); - -const userTaskTwo = task({ - id: "user/task-2", - context: contextBuilder3, - run: async (params) => { - return "foo-bar"; - }, -}); - -const zodTaskOne = task({ - id: "zod/task-1", - context: contextBuilder, - schema: z.object({ foo: z.string() }), - run: async (params) => {}, -}); - -const zodTaskTwo = task({ - id: "zod/task-2", - schema: z.object({ foo: z.string(), isAdmin: z.boolean().default(false) }), - context: contextBuilder2, - run: async (params) => { - console.log(params.payload.foo, params.meta.run); - }, -}); - -const valibotTaskOne = task({ - id: "valibot/task-1", - schema: wrap( - v.object({ - foo: v.string(), - }) - ), - run: async (params) => { - await zodTaskOne.trigger({ foo: "bar" }); - await zodTaskTwo.trigger({ foo: "bar" }); - - await valibotTaskTwo.trigger({ foo: "bar" }); - }, -}); - -const valibotTaskTwo = task({ - id: "valibot/task-2", - schema: wrap( - v.object({ - foo: v.string(), - isAdmin: v.optional(v.boolean(), true), - }) - ), - run: async (params) => { - await valibotTaskOne.trigger({ foo: "bar" }); - }, -}); - -// in trigger/lib.ts -const myTaskLibrary = taskLibrary({ - myTasks: { taskOne, taskTwo }, -}); - -const userTaskLibrary = taskLibrary({ - userTaskOne, - userTaskTwo, -}); - -const zodTaskLibrary = taskLibrary({ - zodTaskOne, - zodTaskTwo, -}); - -const valibotTaskLibrary = taskLibrary({ - valibotTaskOne, - valibotTaskTwo, -}); - -export const library = taskLibrary({ - foo: myTaskLibrary, - bar: userTaskLibrary, - zod: zodTaskLibrary, - valibot: valibotTaskLibrary, -}); - -// Export the library type -export type Library = typeof library; - -// Now on the client -const client = createTriggerClient({ - secretKey: "tr_dev_1234", -}); - -client.runs.retrieve("run_12343"); // Call regular API client calls - -// Tasks are now available under lib -client.lib.foo.myTasks.taskOne.trigger("task-1", { hello: "world" }); -client.lib.bar.userTaskOne.trigger("user/task-1", { userId: "user_123" }); -client.lib.bar.userTaskTwo.trigger("user/task-2", { - userId: "user_123", - isAdmin: true, -}); -client.lib.bar.userTaskTwo.trigger("user/task-2", { - userId: "user_123", - isAdmin: false, -}); -client.lib.zod.zodTaskOne.trigger("zod/task-1", { foo: "bar" }); -client.lib.zod.zodTaskTwo.trigger("zod/task-2", { foo: "bar" }); -client.lib.zod.zodTaskTwo.trigger("zod/task-2", { foo: "bar", isAdmin: false }); -client.lib.valibot.valibotTaskTwo.trigger("valibot/task-2", { foo: "bar" }); -client.lib.valibot.valibotTaskTwo.trigger("valibot/task-2", { - foo: "bar", - isAdmin: true, -}); diff --git a/experiments/with-generic-parser.ts b/experiments/with-generic-parser.ts deleted file mode 100644 index 19f50a176..000000000 --- a/experiments/with-generic-parser.ts +++ /dev/null @@ -1,444 +0,0 @@ -import { z } from "zod"; -import * as v from "valibot"; -import { wrap } from "@typeschema/valibot"; - -export type ParserZodEsque = { - _input: TInput; - _output: TParsedInput; -}; - -export type ParserMyZodEsque = { - parse: (input: any) => TInput; -}; - -export type ParserSuperstructEsque = { - create: (input: unknown) => TInput; -}; - -export type ParserCustomValidatorEsque = (input: unknown) => Promise | TInput; - -export type ParserYupEsque = { - validateSync: (input: unknown) => TInput; -}; - -export type ParserScaleEsque = { - assert(value: unknown): asserts value is TInput; -}; - -export type ParserWithoutInput = - | ParserCustomValidatorEsque - | ParserMyZodEsque - | ParserScaleEsque - | ParserSuperstructEsque - | ParserYupEsque; - -export type ParserWithInputOutput = ParserZodEsque; - -export type Parser = ParserWithInputOutput | ParserWithoutInput; - -export type inferParser = TParser extends ParserWithInputOutput< - infer $TIn, - infer $TOut -> - ? { - in: $TIn; - out: $TOut; - } - : TParser extends ParserWithoutInput - ? { - in: $InOut; - out: $InOut; - } - : never; - -export type Simplify = TType extends any[] | Date ? TType : { [K in keyof TType]: TType[K] }; - -export type TriggerResult = { - id: string; -}; - -export type TaskRunResult = - | { - ok: true; - id: string; - output: TOutput; - } - | { - ok: false; - id: string; - error: unknown; - }; - -export type RunMetadata = { - run: string; -}; - -export type RunFnParams = { - /** Metadata about the task, run, attempt, queue, environment, organization, project and batch. */ - meta: RunMetadata; - - /** Context added by task middleware */ - ctx: TContext; - - payload: TPayload; -}; - -export type TaskOptions< - TOutput, - TContext extends object, - TIdentifier extends string, - TParser extends Parser | undefined = undefined, -> = { - /** An id for your task. This must be unique inside your project and not change between versions. */ - id: TIdentifier; - - schema?: TParser; - - /** This gets called when a task is triggered. It's where you put the code you want to execute. - * - * @param payload - The payload that is passed to your task when it's triggered. This must be JSON serializable. - * @param params - Metadata about the run. - */ - run: (params: Simplify, TContext>>) => Promise; -}; - -export interface Task< - TOutput, - TIdentifier extends string, - TParser extends Parser | undefined = undefined, -> { - /** - * The id of the task. - */ - id: TIdentifier; - /** - * Trigger a task with the given payload, and continue without waiting for the result. If you want to wait for the result, use `triggerAndWait`. Returns the id of the triggered task run. - * @param payload - * @param options - * @returns TriggerResult - * - `id` - The id of the triggered task run. - */ - trigger: ( - payload: Simplify>, - options?: TriggerTaskOptions - ) => Promise; - - /** - * Trigger a task with the given payload, and wait for the result. Returns the result of the task run - * @param payload - * @param options - Options for the task run - * @returns TaskRunResult - * @example - * ``` - * const result = await task.triggerAndWait({ foo: "bar" }); - * - * if (result.ok) { - * console.log(result.output); - * } else { - * console.error(result.error); - * } - * ``` - */ - triggerAndWait: ( - payload: Simplify>, - options?: TriggerTaskOptions - ) => Promise>; -} - -export type AnyTask = Task; - -type inferParserIn = TParser extends Parser - ? inferParser["in"] - : TDefault; -type inferParserOut = TParser extends Parser - ? inferParser["out"] - : TDefault; - -export type TaskPayloadIn = TTask extends Task - ? inferParserIn - : never; - -export type TaskPayloadOut = TTask extends Task - ? inferParserOut - : never; - -export type TaskOutput = TTask extends Task - ? TOutput - : never; - -export type TaskIdentifier = TTask extends Task - ? TIdentifier - : never; - -export type TaskTypes = TTask extends Task< - infer TOutput, - infer TIdentifier, - infer TParser -> - ? { - id: TIdentifier; - payloadIn: inferParserIn; - payloadOut: inferParserOut; - output: TOutput; - } - : never; - -export type TriggerTaskOptions = { - idempotencyKey?: string; - maxAttempts?: number; - startAt?: Date; - startAfter?: number; - concurrencyKey?: string; -}; - -export type Prettify = { - [K in keyof T]: T[K]; -} & {}; - -export function task< - TOutput, - TContext extends object, - TIdentifier extends string, - TParser extends Parser | undefined = undefined, ->( - options: TaskOptions -): Task { - return createTask(options); -} - -export function createTask< - TOutput, - TContext extends object, - TIndentifier extends string, - TParser extends Parser | undefined = undefined, ->( - params: TaskOptions -): Task { - const task: Task = { - id: params.id, - trigger: async (payload, options) => { - return { - id: "run_1234", - }; - }, - triggerAndWait: async (payload, options) => { - const output = await params.run({ - meta: { run: "run_1234" }, - payload: payload as unknown as inferParserOut, // Actually do the parsing - ctx: {} as TContext, - }); - - return { - ok: true, - id: "run_1234", - output, - }; - }, - }; - - return task; -} - -export interface TaskLibraryRecord { - [key: string]: AnyTask | TaskLibraryRecord; -} - -export interface TaskLibrary { - _def: { record: TRecord }; -} - -export type AnyTaskLibrary = TaskLibrary; - -export type CreateTaskLibraryOptions = { - [key: string]: AnyTask | AnyTaskLibrary | CreateTaskLibraryOptions; -}; - -export type DecorateCreateTaskLibraryOptions = - { - [K in keyof TTaskLibraryOptions]: TTaskLibraryOptions[K] extends infer $Value - ? $Value extends AnyTask - ? $Value - : $Value extends TaskLibrary - ? TRecord - : $Value extends CreateTaskLibraryOptions - ? DecorateCreateTaskLibraryOptions<$Value> - : never - : never; - }; - -function taskLibrary( - input: TInput -): TaskLibrary>; -function taskLibrary(input: TInput): TaskLibrary; -function taskLibrary(input: TaskLibraryRecord | CreateTaskLibraryOptions) { - // TODO: reserved words - - return { - _def: { - record: input, - }, - }; -} - -// ======== client side -type DecorateTask = { - trigger: (id: TaskIdentifier, payload: TaskPayloadIn) => Promise<{ id: string }>; -}; - -type DecoratedTaskLibraryRecord< - TTaskLibrary extends AnyTaskLibrary, - TRecord extends TaskLibraryRecord, -> = { - [TKey in keyof TRecord]: TRecord[TKey] extends infer $Value - ? $Value extends TaskLibraryRecord - ? DecoratedTaskLibraryRecord - : $Value extends AnyTask - ? DecorateTask<$Value> - : never - : never; -}; - -export type inferTaskLibraryClient = - DecoratedTaskLibraryRecord; - -export type CreateTriggerClient = { - lib: inferTaskLibraryClient; - runs: { - retrieve: (id: string) => Promise<{ status: boolean }>; - }; -}; - -export type CreateTriggerClientOptions = { - secretKey?: string; -}; - -export function createTriggerClient( - options?: CreateTriggerClientOptions -): CreateTriggerClient { - return {} as CreateTriggerClient; -} - -// trigger/my-tasks.ts -const taskOne = task({ - id: "task-1", - run: async () => { - const handle = await taskTwo.trigger({ url: "https://trigger.dev" }); - const result = await taskTwo.triggerAndWait({ url: "https://trigger.dev" }); - - return "foo-bar"; - }, -}); - -const taskTwo = task({ - id: "task-2", - async run(params) { - return { - hello: "world", - payload: params.payload.other, - }; - }, -}); - -const userTaskOne = task({ - id: "user/task-1", - run: async (params) => { - return "foo-bar"; - }, -}); - -const userTaskTwo = task({ - id: "user/task-2", - run: async (params) => { - return "foo-bar"; - }, -}); - -const zodTaskOne = task({ - id: "zod/task-1", - schema: z.object({ foo: z.string() }), - run: async (params) => {}, -}); - -const zodTaskTwo = task({ - id: "zod/task-2", - schema: z.object({ foo: z.string(), isAdmin: z.boolean().default(false) }), - run: async (params) => { - console.log(params.payload.foo, params.meta.run); - }, -}); - -const valibotTaskOne = task({ - id: "valibot/task-1", - schema: wrap( - v.object({ - foo: v.string(), - }) - ), - run: async (params) => { - await zodTaskOne.trigger({ foo: "bar" }); - await zodTaskTwo.trigger({ foo: "bar" }); - - await valibotTaskTwo.trigger({ foo: "bar" }); - }, -}); - -const valibotTaskTwo = task({ - id: "valibot/task-2", - schema: wrap( - v.object({ - foo: v.string(), - isAdmin: v.optional(v.boolean(), true), - }) - ), - run: async (params) => { - await valibotTaskOne.trigger({ foo: "bar" }); - }, -}); - -// in trigger/lib.ts -const myTaskLibrary = taskLibrary({ - myTasks: { taskOne, taskTwo }, -}); - -const userTaskLibrary = taskLibrary({ - userTaskOne, - userTaskTwo, -}); - -const zodTaskLibrary = taskLibrary({ - zodTaskOne, - zodTaskTwo, -}); - -const valibotTaskLibrary = taskLibrary({ - valibotTaskOne, - valibotTaskTwo, -}); - -export const library = taskLibrary({ - foo: myTaskLibrary, - bar: userTaskLibrary, - zod: zodTaskLibrary, - valibot: valibotTaskLibrary, -}); - -// Export the library type -export type Library = typeof library; - -// Now on the client -const client = createTriggerClient({ - secretKey: "tr_dev_1234", -}); - -client.runs.retrieve("run_12343"); // Call regular API client calls - -// Tasks are now available under lib -client.lib.foo.myTasks.taskOne.trigger("task-1", { hello: "world" }); -client.lib.bar.userTaskOne.trigger("user/task-1", { userId: "user_123" }); -client.lib.bar.userTaskTwo.trigger("user/task-2", { userId: "user_123", isAdmin: true }); -client.lib.bar.userTaskTwo.trigger("user/task-2", { userId: "user_123", isAdmin: false }); -client.lib.zod.zodTaskOne.trigger("zod/task-1", { foo: "bar" }); -client.lib.zod.zodTaskTwo.trigger("zod/task-2", { foo: "bar" }); -client.lib.zod.zodTaskTwo.trigger("zod/task-2", { foo: "bar", isAdmin: false }); -client.lib.valibot.valibotTaskTwo.trigger("valibot/task-2", { foo: "bar" }); -client.lib.valibot.valibotTaskTwo.trigger("valibot/task-2", { foo: "bar", isAdmin: true }); diff --git a/experiments/with-separate-zod-task.ts b/experiments/with-separate-zod-task.ts deleted file mode 100644 index 985111346..000000000 --- a/experiments/with-separate-zod-task.ts +++ /dev/null @@ -1,499 +0,0 @@ -import { z } from "zod"; -import * as v from "valibot"; - -export type ParserZodEsque = { - _input: TInput; - _output: TParsedInput; -}; - -export type ParserMyZodEsque = { - parse: (input: any) => TInput; -}; - -export type ParserSuperstructEsque = { - create: (input: unknown) => TInput; -}; - -export type ParserCustomValidatorEsque = (input: unknown) => Promise | TInput; - -export type ParserYupEsque = { - validateSync: (input: unknown) => TInput; -}; - -export type ParserScaleEsque = { - assert(value: unknown): asserts value is TInput; -}; - -export type ParserWithoutInput = - | ParserCustomValidatorEsque - | ParserMyZodEsque - | ParserScaleEsque - | ParserSuperstructEsque - | ParserYupEsque; - -export type ParserWithInputOutput = ParserZodEsque; - -export type Parser = ParserWithInputOutput | ParserWithoutInput; - -export type inferParser = TParser extends ParserWithInputOutput< - infer $TIn, - infer $TOut -> - ? { - in: $TIn; - out: $TOut; - } - : TParser extends ParserWithoutInput - ? { - in: $InOut; - out: $InOut; - } - : never; - -export type Simplify = TType extends any[] | Date ? TType : { [K in keyof TType]: TType[K] }; - -export type TriggerResult = { - id: string; -}; - -export type TaskRunResult = - | { - ok: true; - id: string; - output: TOutput; - } - | { - ok: false; - id: string; - error: unknown; - }; - -export type RunMetadata = { - run: string; -}; - -export type RunFnParams = { - /** Metadata about the task, run, attempt, queue, environment, organization, project and batch. */ - meta: RunMetadata; - - /** Context added by task middleware */ - ctx: TContext; - - payload: TPayload; -}; - -export type TaskOptions< - TPayloadIn, - TPayloadOut, - TOutput, - TContext extends object, - TIdentifier extends string, -> = { - /** An id for your task. This must be unique inside your project and not change between versions. */ - id: TIdentifier; - - schema?: Parser; - - /** This gets called when a task is triggered. It's where you put the code you want to execute. - * - * @param payload - The payload that is passed to your task when it's triggered. This must be JSON serializable. - * @param params - Metadata about the run. - */ - run: ( - params: Simplify, TContext>> - ) => Promise; -}; - -export interface Task { - /** - * The id of the task. - */ - id: TIdentifier; - /** - * Trigger a task with the given payload, and continue without waiting for the result. If you want to wait for the result, use `triggerAndWait`. Returns the id of the triggered task run. - * @param payload - * @param options - * @returns TriggerResult - * - `id` - The id of the triggered task run. - */ - trigger: ( - payload: Simplify>, - options?: TriggerTaskOptions - ) => Promise; - - /** - * Trigger a task with the given payload, and wait for the result. Returns the result of the task run - * @param payload - * @param options - Options for the task run - * @returns TaskRunResult - * @example - * ``` - * const result = await task.triggerAndWait({ foo: "bar" }); - * - * if (result.ok) { - * console.log(result.output); - * } else { - * console.error(result.error); - * } - * ``` - */ - triggerAndWait: ( - payload: Simplify>, - options?: TriggerTaskOptions - ) => Promise>; -} - -export type AnyTask = Task; - -type IsUnknown = unknown extends T ? (T extends unknown ? true : false) : false; -type NonUnknown = IsUnknown extends true ? never : T; - -export type inferTaskPayloadIn = NonUnknown extends never - ? TPayloadOut - : TPayloadIn; -export type inferTaskPayloadOut = NonUnknown extends never - ? TPayloadIn - : TPayloadOut; - -export type TaskPayloadIn = TTask extends Task< - infer TPayloadIn, - infer TPayloadOut, - any, - string -> - ? inferTaskPayloadIn - : never; - -export type TaskPayloadOut = TTask extends Task< - infer TPayloadIn, - infer TPayloadOut, - any, - string -> - ? inferTaskPayloadOut - : never; - -export type TaskOutput = TTask extends Task - ? TOutput - : never; - -export type TaskIdentifier = TTask extends Task< - any, - any, - any, - infer TIdentifier -> - ? TIdentifier - : never; - -export type TaskTypes = TTask extends Task< - infer TPayloadIn, - infer TPayloadOut, - infer TOutput, - infer TIdentifier -> - ? { - id: TIdentifier; - payloadIn: TPayloadIn; - payloadOut: TPayloadOut; - output: TOutput; - } - : never; - -export type TriggerTaskOptions = { - idempotencyKey?: string; - maxAttempts?: number; - startAt?: Date; - startAfter?: number; - concurrencyKey?: string; -}; - -export type Prettify = { - [K in keyof T]: T[K]; -} & {}; - -export function task< - TPayloadIn, - TPayloadOut, - TOutput, - TContext extends object, - TIdentifier extends string, ->( - options: TaskOptions -): Task { - return createTask(options); -} - -export function createTask< - TPayloadIn, - TPayloadOut, - TOutput, - TContext extends object, - TIndentifier extends string, ->( - params: TaskOptions -): Task { - const task: Task = { - id: params.id, - trigger: async (payload, options) => { - return { - id: "run_1234", - }; - }, - triggerAndWait: async (payload, options) => { - const output = await params.run({ - meta: { run: "run_1234" }, - payload: payload as unknown as inferTaskPayloadOut, - ctx: {} as TContext, - }); - - return { - ok: true, - id: "run_1234", - output, - }; - }, - }; - - return task; -} - -export type ZodTaskOptions< - TOutput, - TContext extends object, - TIdentifier extends string, - TSchema extends z.ZodTypeAny = z.ZodTypeAny, -> = { - schema: TSchema; -} & TaskOptions, z.output, TOutput, TContext, TIdentifier>; - -export function zodTask< - TOutput, - TContext extends object, - TIdentifier extends string, - TSchema extends z.ZodTypeAny = z.ZodTypeAny, ->( - options: ZodTaskOptions -): Task, z.output, TOutput, TIdentifier> { - return createTask, z.output, TOutput, TContext, TIdentifier>(options); -} - -export type ValibotTaskOptions< - TOutput, - TContext extends object, - TIdentifier extends string, - TSchema extends v.BaseSchema = v.AnySchema, -> = { - schema: TSchema; -} & TaskOptions, v.Output, TOutput, TContext, TIdentifier>; - -export function valibotTask< - TOutput, - TContext extends object, - TIdentifier extends string, - TSchema extends v.BaseSchema = v.AnySchema, ->( - options: ValibotTaskOptions -): Task, v.Output, TOutput, TIdentifier> { - return createTask, v.Output, TOutput, TContext, TIdentifier>(options); -} - -export interface TaskLibraryRecord { - [key: string]: AnyTask | TaskLibraryRecord; -} - -export interface TaskLibrary { - _def: { record: TRecord }; -} - -export type AnyTaskLibrary = TaskLibrary; - -export type CreateTaskLibraryOptions = { - [key: string]: AnyTask | AnyTaskLibrary | CreateTaskLibraryOptions; -}; - -export type DecorateCreateTaskLibraryOptions = - { - [K in keyof TTaskLibraryOptions]: TTaskLibraryOptions[K] extends infer $Value - ? $Value extends AnyTask - ? $Value - : $Value extends TaskLibrary - ? TRecord - : $Value extends CreateTaskLibraryOptions - ? DecorateCreateTaskLibraryOptions<$Value> - : never - : never; - }; - -function taskLibrary( - input: TInput -): TaskLibrary>; -function taskLibrary(input: TInput): TaskLibrary; -function taskLibrary(input: TaskLibraryRecord | CreateTaskLibraryOptions) { - // TODO: reserved words - - return { - _def: { - record: input, - }, - }; -} - -// ======== client side -type DecorateTask = { - trigger: (id: TaskIdentifier, payload: TaskPayloadIn) => Promise<{ id: string }>; -}; - -type DecoratedTaskLibraryRecord< - TTaskLibrary extends AnyTaskLibrary, - TRecord extends TaskLibraryRecord, -> = { - [TKey in keyof TRecord]: TRecord[TKey] extends infer $Value - ? $Value extends TaskLibraryRecord - ? DecoratedTaskLibraryRecord - : $Value extends AnyTask - ? DecorateTask<$Value> - : never - : never; -}; - -export type inferTaskLibraryClient = - DecoratedTaskLibraryRecord; - -export type CreateTriggerClient = { - lib: inferTaskLibraryClient; - runs: { - retrieve: (id: string) => Promise<{ status: boolean }>; - }; -}; - -export type CreateTriggerClientOptions = { - secretKey?: string; -}; - -export function createTriggerClient( - options?: CreateTriggerClientOptions -): CreateTriggerClient { - return {} as CreateTriggerClient; -} - -// trigger/my-tasks.ts -const taskOne = task({ - id: "task-1", - run: async () => { - const handle = await taskTwo.trigger({ url: "https://trigger.dev" }); - const result = await taskTwo.triggerAndWait({ url: "https://trigger.dev" }); - - return "foo-bar"; - }, -}); - -const taskTwo = task({ - id: "task-2", - async run(params) { - return { - hello: "world", - payload: params.payload, - }; - }, -}); - -const userTaskOne = task({ - id: "user/task-1", - run: async (params: { payload: { userId: string } }) => { - return "foo-bar"; - }, -}); - -const userTaskTwo = task({ - id: "user/task-2", - run: async (params: { payload: { userId: string; isAdmin: boolean } }) => { - return "foo-bar"; - }, -}); - -const zodTaskOne = task({ - id: "zod/task-1", - schema: z.object({ foo: z.string() }), - run: async (params) => {}, -}); - -const zodTaskTwo = task({ - id: "zod/task-2", - schema: z.object({ foo: z.string(), isAdmin: z.boolean().default(false) }), - run: async (params) => { - console.log(params.payload.foo, params.meta.run); - }, -}); - -const valibotTaskOne = task({ - id: "valibot/task-1", - schema: v.object({ - foo: v.string(), - }), - run: async (params) => { - await zodTaskOne.trigger({ foo: "bar" }); - await zodTaskTwo.trigger({ foo: "bar" }); - - await valibotTaskTwo.trigger({ foo: "bar" }); - }, -}); - -const valibotTaskTwo = task({ - id: "valibot/task-2", - schema: v.object({ - foo: v.string(), - isAdmin: v.optional(v.boolean(), true), - }), - run: async (params) => { - await valibotTaskOne.trigger({ foo: "bar" }); - }, -}); - -// in trigger/lib.ts -const myTaskLibrary = taskLibrary({ - myTasks: { taskOne, taskTwo }, -}); - -const userTaskLibrary = taskLibrary({ - userTaskOne, - userTaskTwo, -}); - -const zodTaskLibrary = taskLibrary({ - zodTaskOne, - zodTaskTwo, -}); - -const valibotTaskLibrary = taskLibrary({ - valibotTaskOne, - valibotTaskTwo, -}); - -export const library = taskLibrary({ - foo: myTaskLibrary, - bar: userTaskLibrary, - zod: zodTaskLibrary, - valibot: valibotTaskLibrary, -}); - -// Export the library type -export type Library = typeof library; - -// Now on the client -const client = createTriggerClient({ - secretKey: "tr_dev_1234", -}); - -client.runs.retrieve("run_12343"); // Call regular API client calls - -// Tasks are now available under lib -client.lib.foo.myTasks.taskOne.trigger("task-1", { hello: "world" }); -client.lib.bar.userTaskOne.trigger("user/task-1", { userId: "user_123" }); -client.lib.bar.userTaskTwo.trigger("user/task-2", { userId: "user_123", isAdmin: true }); -client.lib.bar.userTaskTwo.trigger("user/task-2", { userId: "user_123", isAdmin: false }); -client.lib.zod.zodTaskOne.trigger("zod/task-1", { foo: "bar" }); -client.lib.zod.zodTaskTwo.trigger("zod/task-2", { foo: "bar" }); -client.lib.zod.zodTaskTwo.trigger("zod/task-2", { foo: "bar", isAdmin: false }); -client.lib.valibot.valibotTaskTwo.trigger("valibot/task-2", { foo: "bar" }); -client.lib.valibot.valibotTaskTwo.trigger("valibot/task-2", { foo: "bar", isAdmin: false }); diff --git a/helm-charts/.gitignore b/helm-charts/.gitignore deleted file mode 100644 index 711a39c54..000000000 --- a/helm-charts/.gitignore +++ /dev/null @@ -1 +0,0 @@ -charts/ \ No newline at end of file diff --git a/helm-charts/.helmignore b/helm-charts/.helmignore deleted file mode 100644 index a58a8cc02..000000000 --- a/helm-charts/.helmignore +++ /dev/null @@ -1,24 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*.orig -*~ -# Various IDEs -.project -.idea/ -*.tmproj -.vscode/ -node_modules/ diff --git a/helm-charts/Chart.lock b/helm-charts/Chart.lock deleted file mode 100644 index 25db8abe6..000000000 --- a/helm-charts/Chart.lock +++ /dev/null @@ -1,9 +0,0 @@ -dependencies: -- name: postgresql - repository: https://charts.bitnami.com/bitnami - version: 13.1.5 -- name: ingress-nginx - repository: https://kubernetes.github.io/ingress-nginx - version: 4.0.13 -digest: sha256:e439e4b30ba18357defec97ba080973743a4724c423b78913990409f78f1ebd8 -generated: "2023-10-20T14:22:57.044126+05:30" diff --git a/helm-charts/Chart.yaml b/helm-charts/Chart.yaml deleted file mode 100644 index 04ff9e562..000000000 --- a/helm-charts/Chart.yaml +++ /dev/null @@ -1,34 +0,0 @@ -apiVersion: v2 -name: trigger -description: A Helm chart for a full Trigger application stack - -# A chart can be either an 'application' or a 'library' chart. -# -# Application charts are a collection of templates that can be packaged into versioned archives -# to be deployed. -# -# Library charts provide useful utilities or functions for the chart developer. They're included as -# a dependency of application charts to inject those utilities and functions into the rendering -# pipeline. Library charts do not define any templates and therefore cannot be deployed. -type: application - -# This is the chart version. This version number should be incremented each time you make changes -# to the chart and its templates, including the app version. -# Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.0 - -# This is the version number of the application being deployed. This version number should be -# incremented each time you make changes to the application. Versions are not expected to -# follow Semantic Versioning. They should reflect the version the application is using. -# It is recommended to use it with quotes. -appVersion: "1.16.0" - -dependencies: - - name: postgresql - version: "~13.1.5" - repository: https://charts.bitnami.com/bitnami - condition: postgresql.enabled - - name: ingress-nginx - version: 4.0.13 - repository: https://kubernetes.github.io/ingress-nginx - condition: ingress.nginx.enabled diff --git a/helm-charts/README.md b/helm-charts/README.md deleted file mode 100644 index 8003cb798..000000000 --- a/helm-charts/README.md +++ /dev/null @@ -1,119 +0,0 @@ -# Trigger.dev Helm Chart - -> WARNING: Kubernetes deploys are not officially supported yet, please only use these instructions as a general guide and starting point. - -## Installation - -As our charts aren't published for official use yet, you'll need a copy of the `helm-charts` dir and run the following commands within it: - -```bash -# with access to your cluster, e.g. KUBECONFIG correctly set -helm upgrade --install --atomic --namespace trigger --create-namespace trigger . - -# watch the deployment -kubectl --namespace trigger get deployments -w -``` - -## Parameters - -### Common parameters - -| Name | Description | Value | -| ------------------ | ------------------------- | ----- | -| `nameOverride` | Override release name | `""` | -| `fullnameOverride` | Override release fullname | `""` | - -### Trigger.dev parameters - -| Name | Description | Value | -| --------------------------------- | --------------------------------------------------------------------------------------------------------------- | ----------------------------------- | -| `trigger.name` | | `trigger` | -| `trigger.fullnameOverride` | trigger fullnameOverride | `""` | -| `trigger.podAnnotations` | trigger pod annotations | `{}` | -| `trigger.deploymentAnnotations` | trigger deployment annotations | `{}` | -| `trigger.replicaCount` | trigger replica count | `2` | -| `trigger.image.repository` | trigger image repository | `ghcr.io/triggerdotdev/trigger.dev` | -| `trigger.image.tag` | trigger image tag | `latest` | -| `trigger.image.pullPolicy` | trigger image pullPolicy | `Always` | -| `trigger.resources.limits.memory` | container memory limit [(docs)](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) | `800Mi` | -| `trigger.resources.requests.cpu` | container CPU requests [(docs)](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) | `250m` | -| `trigger.affinity` | Backend pod affinity | `{}` | -| `trigger.kubeSecretRef` | trigger secret resource reference name | `""` | -| `trigger.service.annotations` | trigger service annotations | `{}` | -| `trigger.service.type` | trigger service type | `ClusterIP` | -| `trigger.service.nodePort` | trigger service nodePort (used if above type is `NodePort`) | `""` | - -### Postgres parameters - -| Name | Description | Value | -| --------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------- | -| `postgresql.enabled` | Enable Postgres | `true` | -| `postgresql.name` | Name used to build variables (deprecated) | `postgresql` | -| `postgresql.nameOverride` | Name override | `postgresql` | -| `postgresql.fullnameOverride` | Fullname override | `postgresql` | -| `postgresql.global.postgresql.auth.postgresPassword` | Password for the "postgres" admin user (overrides `auth.postgresPassword`) | `password` | -| `postgresql.global.postgresql.auth.username` | Name for a custom user to create (overrides `auth.username`) | `postgres` | -| `postgresql.global.postgresql.auth.password` | Password for the custom user to create (overrides `auth.password`) | `password` | -| `postgresql.global.postgresql.auth.database` | Name for a custom database to create (overrides `auth.database`) | `trigger` | -| `postgresql.global.postgresql.auth.existingSecret` | Name of existing secret to use for PostgreSQL credentials (overrides `auth.existingSecret`). | `""` | -| `postgresql.global.postgresql.auth.secretKeys.adminPasswordKey` | Name of key in existing secret to use for PostgreSQL credentials (overrides `auth.secretKeys.adminPasswordKey`). Only used when `postgresql.global.postgresql.auth.existingSecret` is set. | `""` | -| `postgresql.global.postgresql.auth.secretKeys.userPasswordKey` | Name of key in existing secret to use for PostgreSQL credentials (overrides `auth.secretKeys.userPasswordKey`). Only used when `postgresql.global.postgresql.auth.existingSecret` is set. | `""` | -| `postgresql.global.postgresql.auth.secretKeys.replicationPasswordKey` | Name of key in existing secret to use for PostgreSQL credentials (overrides `auth.secretKeys.replicationPasswordKey`). Only used when `postgresql.global.postgresql.auth.existingSecret` is set. | `""` | -| `postgresql.global.postgresql.service.ports.postgresql` | PostgreSQL service port (overrides `service.ports.postgresql`) | `5432` | -| `postgresql.image.registry` | PostgreSQL image registry | `docker.io` | -| `postgresql.image.repository` | PostgreSQL image repository | `bitnami/postgresql` | -| `postgresql.image.tag` | PostgreSQL image tag (immutable tags are recommended) | `14.10.0-debian-11-r21` | -| `postgresql.image.digest` | PostgreSQL image digest in the way sha256:aa.... Please note this parameter, if set, will override the tag | `""` | -| `postgresql.image.pullPolicy` | PostgreSQL image pull policy | `IfNotPresent` | -| `postgresql.image.pullSecrets` | Specify image pull secrets | `[]` | -| `postgresql.image.debug` | Specify if debug values should be set | `false` | -| `postgresql.architecture` | PostgreSQL architecture (`standalone` or `replication`) | `standalone` | -| `postgresql.containerPorts.postgresql` | PostgreSQL container port | `5432` | -| `postgresql.postgresqlDataDir` | PostgreSQL data dir | `/bitnami/postgresql/data` | -| `postgresql.postgresqlSharedPreloadLibraries` | Shared preload libraries (comma-separated list) | `pgaudit` | - -### PostgreSQL Primary parameters - -| Name | Description | Value | -| ------------------------------------------------------- | ------------------------------------------------------ | ------------------- | -| `postgresql.primary.livenessProbe.enabled` | Enable livenessProbe on PostgreSQL Primary containers | `true` | -| `postgresql.primary.livenessProbe.initialDelaySeconds` | Initial delay seconds for livenessProbe | `30` | -| `postgresql.primary.livenessProbe.periodSeconds` | Period seconds for livenessProbe | `10` | -| `postgresql.primary.livenessProbe.timeoutSeconds` | Timeout seconds for livenessProbe | `5` | -| `postgresql.primary.livenessProbe.failureThreshold` | Failure threshold for livenessProbe | `6` | -| `postgresql.primary.livenessProbe.successThreshold` | Success threshold for livenessProbe | `1` | -| `postgresql.primary.readinessProbe.enabled` | Enable readinessProbe on PostgreSQL Primary containers | `true` | -| `postgresql.primary.readinessProbe.initialDelaySeconds` | Initial delay seconds for readinessProbe | `5` | -| `postgresql.primary.readinessProbe.periodSeconds` | Period seconds for readinessProbe | `10` | -| `postgresql.primary.readinessProbe.timeoutSeconds` | Timeout seconds for readinessProbe | `5` | -| `postgresql.primary.readinessProbe.failureThreshold` | Failure threshold for readinessProbe | `6` | -| `postgresql.primary.readinessProbe.successThreshold` | Success threshold for readinessProbe | `1` | -| `postgresql.primary.startupProbe.enabled` | Enable startupProbe on PostgreSQL Primary containers | `false` | -| `postgresql.primary.startupProbe.initialDelaySeconds` | Initial delay seconds for startupProbe | `30` | -| `postgresql.primary.startupProbe.periodSeconds` | Period seconds for startupProbe | `10` | -| `postgresql.primary.startupProbe.timeoutSeconds` | Timeout seconds for startupProbe | `1` | -| `postgresql.primary.startupProbe.failureThreshold` | Failure threshold for startupProbe | `15` | -| `postgresql.primary.startupProbe.successThreshold` | Success threshold for startupProbe | `1` | -| `postgresql.primary.persistence.enabled` | Enable PostgreSQL Primary data persistence using PVC | `true` | -| `postgresql.primary.persistence.existingClaim` | Name of an existing PVC to use | `""` | -| `postgresql.primary.persistence.accessModes` | PVC Access Mode for PostgreSQL volume | `["ReadWriteOnce"]` | -| `postgresql.primary.persistence.size` | PVC Storage Request for PostgreSQL volume | `8Gi` | - -### Ingress parameters - -| Name | Description | Value | -| -------------------------- | ------------------------------------------------------------------------ | -------- | -| `ingress.enabled` | Enable ingress | `true` | -| `ingress.ingressClassName` | Ingress class name | `nginx` | -| `ingress.nginx.enabled` | Ingress controller | `false` | -| `ingress.annotations` | Ingress annotations | `{}` | -| `ingress.hostName` | Ingress hostname (your custom domain name, e.g. `infisical.example.org`) | `""` | -| `ingress.tls` | Ingress TLS hosts (matching above hostName) | `[]` | -| `ingress.trigger.path` | Trigger.dev ingress path | `/` | -| `ingress.trigger.pathType` | Trigger.dev ingress path type | `Prefix` | - -## Generating docs - -This chart aims to be compliant with the [Readme Generator For Helm](https://github.com/bitnami/readme-generator-for-helm) to easily create and maintain the parameters tables above. - -To update the docs, just run: `pnpm generate-docs` diff --git a/helm-charts/my-values.yml b/helm-charts/my-values.yml deleted file mode 100644 index 438d7190d..000000000 --- a/helm-charts/my-values.yml +++ /dev/null @@ -1,14 +0,0 @@ -trigger: - name: trigger - replicaCount: 2 - image: - repository: ghcr.io/triggerdotdev/trigger.dev - tag: "latest" - pullPolicy: Always - env: - ENCRYPTION_KEY: "b1ebe43a6a6e24b2aa8fa0707d3890e3" - MAGIC_LINK_SECRET: "842727396bcee22da68518f959c5730b" - -ingress: - nginx: - enabled: false #<-- if you would like to install nginx along with Trigger.dev diff --git a/helm-charts/package-lock.json b/helm-charts/package-lock.json deleted file mode 100644 index 803b94a4e..000000000 --- a/helm-charts/package-lock.json +++ /dev/null @@ -1,203 +0,0 @@ -{ - "name": "helm-charts", - "version": "1.0.0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "helm-charts", - "version": "1.0.0", - "license": "ISC", - "dependencies": { - "@bitnami/readme-generator-for-helm": "^2.6.0" - } - }, - "node_modules/@bitnami/readme-generator-for-helm": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/@bitnami/readme-generator-for-helm/-/readme-generator-for-helm-2.6.0.tgz", - "integrity": "sha512-LcByNCryaC2OJExL9rnhyFJ18+vrZu1gVoN2Z7j/HI42EjV4kLgT4G1KEPNnrKbls9HvozBqMG+sKZIDh0McFg==", - "dependencies": { - "commander": "^7.1.0", - "dot-object": "^2.1.4", - "lodash": "^4.17.21", - "markdown-table": "^2.0.0", - "yaml": "^2.0.0-3" - }, - "bin": { - "readme-generator": "bin/index.js" - } - }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" - }, - "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/commander": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", - "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", - "engines": { - "node": ">= 10" - } - }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" - }, - "node_modules/dot-object": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/dot-object/-/dot-object-2.1.4.tgz", - "integrity": "sha512-7FXnyyCLFawNYJ+NhkqyP9Wd2yzuo+7n9pGiYpkmXCTYa8Ci2U0eUNDVg5OuO5Pm6aFXI2SWN8/N/w7SJWu1WA==", - "dependencies": { - "commander": "^4.0.0", - "glob": "^7.1.5" - }, - "bin": { - "dot-object": "bin/dot-object" - } - }, - "node_modules/dot-object/node_modules/commander": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", - "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", - "engines": { - "node": ">= 6" - } - }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" - }, - "node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" - }, - "node_modules/markdown-table": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-2.0.0.tgz", - "integrity": "sha512-Ezda85ToJUBhM6WGaG6veasyym+Tbs3cMAw/ZhOPqXiYsr0jgocBV3j3nx+4lk47plLlIqjwuTm/ywVI+zjJ/A==", - "dependencies": { - "repeat-string": "^1.0.0" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==", - "engines": { - "node": ">=0.10" - } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" - }, - "node_modules/yaml": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.4.tgz", - "integrity": "sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==", - "engines": { - "node": ">= 14" - } - }, - "readme-generator-for-helm": { - "version": "2.6.1", - "extraneous": true, - "license": "Apache-2.0", - "dependencies": { - "commander": "^7.1.0", - "dot-object": "^2.1.4", - "lodash": "^4.17.21", - "markdown-table": "^2.0.0", - "yaml": "^2.0.0-3" - }, - "bin": { - "readme-generator": "bin/index.js" - }, - "devDependencies": { - "eslint": "^7.24.0", - "eslint-config-airbnb-base": "^14.2.1", - "eslint-plugin-import": "^2.22.1", - "jest": "^29.2.1", - "temp": "^0.9.4" - } - } - } -} diff --git a/helm-charts/package.json b/helm-charts/package.json deleted file mode 100644 index 78404a5d0..000000000 --- a/helm-charts/package.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "helm-charts", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "generate-docs": "readme-generator --readme README.md --values values.yaml" - }, - "keywords": [], - "author": "", - "license": "ISC", - "devDependencies": { - "@bitnami/readme-generator-for-helm": "^2.6.0" - } -} \ No newline at end of file diff --git a/helm-charts/templates/_helpers.tpl b/helm-charts/templates/_helpers.tpl deleted file mode 100644 index 5d060c433..000000000 --- a/helm-charts/templates/_helpers.tpl +++ /dev/null @@ -1,71 +0,0 @@ -{{/* -Expand the name of the chart. -*/}} -{{- define "trigger.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "trigger.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* -Create unified labels for trigger components -*/}} -{{- define "trigger.common.matchLabels" -}} -app: {{ template "trigger.name" . }} -release: {{ .Release.Name }} -{{- end -}} - -{{- define "trigger.common.metaLabels" -}} -chart: {{ template "trigger.chart" . }} -heritage: {{ .Release.Service }} -{{- end -}} - -{{- define "trigger.common.labels" -}} -{{ include "trigger.common.matchLabels" . }} -{{ include "trigger.common.metaLabels" . }} -{{- end -}} - -{{- define "trigger.labels" -}} -{{ include "trigger.matchLabels" . }} -{{ include "trigger.common.metaLabels" . }} -{{- end -}} - -{{- define "trigger.matchLabels" -}} -component: {{ .Values.trigger.name | quote }} -{{ include "trigger.common.matchLabels" . }} -{{- end -}} - -{{/* -Create a fully qualified postgresql name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -*/}} -{{- define "trigger.postgresql.hostname" -}} -{{- if .Values.postgresql.fullnameOverride -}} -{{- .Values.postgresql.fullnameOverride | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- $name := default .Chart.Name .Values.nameOverride -}} -{{- if contains $name .Release.Name -}} -{{- printf "%s-%s" .Release.Name .Values.postgresql.name | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- printf "%s-%s-%s" .Release.Name $name .Values.postgresql.name | trunc 63 | trimSuffix "-" -}} -{{- end -}} -{{- end -}} -{{- end -}} - -{{/* -Create the postgresql connection string. -*/}} -{{- define "trigger.postgresql.connectionString" -}} -{{- $host := include "trigger.postgresql.hostname" . -}} -{{- $port := 5432 -}} -{{- $username := .Values.postgresql.global.postgresql.postgresqlUsername | default "postgres" -}} -{{- $password := .Values.postgresql.global.postgresql.postgresqlPassword | default "password" -}} -{{- $database := .Values.postgresql.global.postgresql.postgresqlDatabase | default "trigger" -}} -{{- $connectionString := printf "postgresql://%s:%s@%s:%d/%s" $username $password $host $port $database -}} -{{- printf "%s" $connectionString -}} -{{- end -}} \ No newline at end of file diff --git a/helm-charts/templates/ingress.yaml b/helm-charts/templates/ingress.yaml deleted file mode 100644 index 3f4e73f6e..000000000 --- a/helm-charts/templates/ingress.yaml +++ /dev/null @@ -1,43 +0,0 @@ -{{ if .Values.ingress.enabled }} -{{- $ingress := .Values.ingress }} -{{- if and $ingress.ingressClassName (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} - {{- if not (hasKey $ingress.annotations "kubernetes.io/ingress.class") }} - {{- $_ := set $ingress.annotations "kubernetes.io/ingress.class" $ingress.ingressClassName}} - {{- end }} -{{- end }} -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: trigger-ingress - {{- with $ingress.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -spec: - {{- if and $ingress.ingressClassName (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} - ingressClassName: {{ $ingress.ingressClassName | default "nginx" }} - {{- end }} -{{- if $ingress.tls }} - tls: - {{- range $ingress.tls }} - - hosts: - {{- range .hosts }} - - {{ . | quote }} - {{- end }} - secretName: {{ .secretName }} - {{- end }} -{{- end }} - rules: - - http: - paths: - - path: {{ $ingress.trigger.path }} - pathType: {{ $ingress.trigger.pathType }} - backend: - service: - name: {{ include "trigger.name" . }} - port: - number: 3000 - {{- if $ingress.hostName }} - host: {{ $ingress.hostName }} - {{- end }} -{{ end }} \ No newline at end of file diff --git a/helm-charts/templates/trigger.yaml b/helm-charts/templates/trigger.yaml deleted file mode 100644 index 66002716b..000000000 --- a/helm-charts/templates/trigger.yaml +++ /dev/null @@ -1,98 +0,0 @@ -{{- $trigger := .Values.trigger -}} -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ include "trigger.name" . }} - annotations: - updatedAt: {{ now | date "2006-01-01 MST 15:04:05" | quote }} - {{- with $trigger.deploymentAnnotations }} - {{- toYaml . | nindent 4 }} - {{- end }} - labels: - {{- include "trigger.labels" . | nindent 4 }} -spec: - replicas: {{ $trigger.replicaCount }} - selector: - matchLabels: - {{- include "trigger.matchLabels" . | nindent 6 }} - template: - metadata: - labels: - {{- include "trigger.matchLabels" . | nindent 8 }} - annotations: - updatedAt: {{ now | date "2006-01-01 MST 15:04:05" | quote }} - {{- with $trigger.podAnnotations }} - {{- toYaml . | nindent 8 }} - {{- end }} - spec: - {{- with $trigger.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - containers: - - name: {{ $trigger.name }} - image: "{{ $trigger.image.repository }}:{{ $trigger.image.tag | default "latest" }}" - imagePullPolicy: {{ $trigger.image.pullPolicy }} - ports: - - name: http - containerPort: 3000 - protocol: TCP - readinessProbe: - httpGet: - path: / - port: 3000 - envFrom: - - secretRef: - name: {{ $trigger.kubeSecretRef | default (include "trigger.name" .) }} - {{- if $trigger.resources }} - resources: {{- toYaml $trigger.resources | nindent 12 }} - {{- end }} ---- - -apiVersion: v1 -kind: Service -metadata: - name: {{ include "trigger.name" . }} - labels: - {{- include "trigger.labels" . | nindent 4 }} - {{- with $trigger.service.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -spec: - type: {{ $trigger.service.type }} - selector: - {{- include "trigger.matchLabels" . | nindent 8 }} - ports: - - port: 3000 - targetPort: 3000 - protocol: TCP - {{- if eq $trigger.service.type "NodePort" }} - nodePort: {{ $trigger.service.nodePort }} - {{- end }} - ---- - -{{ if not $trigger.kubeSecretRef }} -apiVersion: v1 -kind: Secret -metadata: - name: {{ include "trigger.name" . }} - annotations: - "helm.sh/resource-policy": "keep" -type: Opaque -stringData: - {{- $requiredVars := dict "MAGIC_LINK_SECRET" (randAlphaNum 32 | lower) - "SESSION_SECRET" (randAlphaNum 32 | lower) - "ENCRYPTION_KEY" (randAlphaNum 32 | lower) - "DIRECT_URL" (include "trigger.postgresql.connectionString" .) - "DATABASE_URL" (include "trigger.postgresql.connectionString" .) }} - {{- $secretObj := (lookup "v1" "Secret" .Release.Namespace (include "trigger.name" .)) | default dict }} - {{- $secretData := (get $secretObj "data") | default dict }} - {{ range $key, $value := .Values.trigger.env }} - {{- $default := get $requiredVars $key -}} - {{- $current := get $secretData $key | b64dec -}} - {{- $v := $value | default ($current | default $default) -}} - {{ $key }}: {{ $v | quote }} - {{ end -}} -{{- end }} \ No newline at end of file diff --git a/helm-charts/values.yaml b/helm-charts/values.yaml deleted file mode 100644 index 713d918ad..000000000 --- a/helm-charts/values.yaml +++ /dev/null @@ -1,276 +0,0 @@ -# Default values for helm-charts. -# This is a YAML-formatted file. -## @section Common parameters -## - -## @param nameOverride Override release name -## -nameOverride: "" -## @param fullnameOverride Override release fullname -## -fullnameOverride: "" - -## @section Trigger.dev parameters -## -trigger: - ## @param trigger.name - name: trigger - ## @param trigger.fullnameOverride trigger fullnameOverride - ## - fullnameOverride: "" - ## @param trigger.podAnnotations trigger pod annotations - ## - podAnnotations: {} - ## @param trigger.deploymentAnnotations trigger deployment annotations - ## - deploymentAnnotations: {} - ## @param trigger.replicaCount trigger replica count - ## - replicaCount: 2 - ## trigger image parameters - ## - image: - ## @param trigger.image.repository trigger image repository - ## - repository: ghcr.io/triggerdotdev/trigger.dev - ## @param trigger.image.tag trigger image tag - ## - tag: "latest" - ## @param trigger.image.pullPolicy trigger image pullPolicy - ## - pullPolicy: Always - ## @param trigger.resources.limits.memory container memory limit [(docs)](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) - ## @param trigger.resources.requests.cpu container CPU requests [(docs)](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) - ## - resources: - limits: - memory: 800Mi - requests: - cpu: 250m - ## @param trigger.affinity Backend pod affinity - ## - affinity: {} - ## @param trigger.kubeSecretRef trigger secret resource reference name - ## - kubeSecretRef: "" - ## trigger service - ## - service: - ## @param trigger.service.annotations trigger service annotations - ## - annotations: {} - ## @param trigger.service.type trigger service type - ## - type: ClusterIP - ## @param trigger.service.nodePort trigger service nodePort (used if above type is `NodePort`) - ## - nodePort: "" - ## @skip trigger.env - ## - env: - ENCRYPTION_KEY: "" - MAGIC_LINK_SECRET: "" - SESSION_SECRET: "" - LOGIN_ORIGIN: "" - APP_ORIGIN: "" - DIRECT_URL: "" - DATABASE_URL: "" - FROM_EMAIL: "" - REPLY_TO_EMAIL: "" - RESEND_API_KEY: "" - AUTH_GITHUB_CLIENT_ID: "" - AUTH_GITHUB_CLIENT_SECRET: "" - -## @section Postgres parameters -## Documentation: https://github.com/bitnami/charts/tree/main/bitnami/postgresql-ha -## -postgresql: - ## @param postgresql.enabled Enable Postgres - ## - enabled: true - ## @param postgresql.name Name used to build variables (deprecated) - ## - name: "postgresql" - ## @param postgresql.nameOverride Name override - ## - nameOverride: "postgresql" - ## @param postgresql.fullnameOverride Fullname override - ## - fullnameOverride: "postgresql" - - global: - postgresql: - ## @param postgresql.global.postgresql.auth.postgresPassword Password for the "postgres" admin user (overrides `auth.postgresPassword`) - ## @param postgresql.global.postgresql.auth.username Name for a custom user to create (overrides `auth.username`) - ## @param postgresql.global.postgresql.auth.password Password for the custom user to create (overrides `auth.password`) - ## @param postgresql.global.postgresql.auth.database Name for a custom database to create (overrides `auth.database`) - ## @param postgresql.global.postgresql.auth.existingSecret Name of existing secret to use for PostgreSQL credentials (overrides `auth.existingSecret`). - ## @param postgresql.global.postgresql.auth.secretKeys.adminPasswordKey Name of key in existing secret to use for PostgreSQL credentials (overrides `auth.secretKeys.adminPasswordKey`). Only used when `postgresql.global.postgresql.auth.existingSecret` is set. - ## @param postgresql.global.postgresql.auth.secretKeys.userPasswordKey Name of key in existing secret to use for PostgreSQL credentials (overrides `auth.secretKeys.userPasswordKey`). Only used when `postgresql.global.postgresql.auth.existingSecret` is set. - ## @param postgresql.global.postgresql.auth.secretKeys.replicationPasswordKey Name of key in existing secret to use for PostgreSQL credentials (overrides `auth.secretKeys.replicationPasswordKey`). Only used when `postgresql.global.postgresql.auth.existingSecret` is set. - ## - auth: - postgresPassword: "password" - username: "postgres" - password: "password" - database: "trigger" - existingSecret: "" - secretKeys: - adminPasswordKey: "" - userPasswordKey: "" - replicationPasswordKey: "" - ## @param postgresql.global.postgresql.service.ports.postgresql PostgreSQL service port (overrides `service.ports.postgresql`) - ## - service: - ports: - postgresql: "5432" - - ## Bitnami PostgreSQL image version - ## ref: https://hub.docker.com/r/bitnami/postgresql/tags/ - ## @param postgresql.image.registry PostgreSQL image registry - ## @param postgresql.image.repository PostgreSQL image repository - ## @param postgresql.image.tag PostgreSQL image tag (immutable tags are recommended) - ## @param postgresql.image.digest PostgreSQL image digest in the way sha256:aa.... Please note this parameter, if set, will override the tag - ## @param postgresql.image.pullPolicy PostgreSQL image pull policy - ## @param postgresql.image.pullSecrets Specify image pull secrets - ## @param postgresql.image.debug Specify if debug values should be set - ## - image: - registry: docker.io - repository: bitnami/postgresql - tag: 14.10.0-debian-11-r21 - digest: "" - ## Specify a imagePullPolicy - ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' - ## ref: https://kubernetes.io/docs/user-guide/images/#pre-pulling-images - ## - pullPolicy: IfNotPresent - ## Optionally specify an array of imagePullSecrets. - ## Secrets must be manually created in the namespace. - ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ - ## Example: - ## pullSecrets: - ## - myRegistryKeySecretName - ## - pullSecrets: [] - ## Set to true if you would like to see extra information on logs - ## - debug: false - - ## @param postgresql.architecture PostgreSQL architecture (`standalone` or `replication`) - ## - architecture: standalone - ## Replication configuration - ## Ignored if `postgresql.architecture` is `standalone` - ## - ## @param postgresql.containerPorts.postgresql PostgreSQL container port - ## - containerPorts: - postgresql: 5432 - - ## @param postgresql.postgresqlDataDir PostgreSQL data dir - ## - postgresqlDataDir: /bitnami/postgresql/data - ## @param postgresql.postgresqlSharedPreloadLibraries Shared preload libraries (comma-separated list) - ## - postgresqlSharedPreloadLibraries: "pgaudit" - ## @section PostgreSQL Primary parameters - ## - primary: - ## Configure extra options for PostgreSQL Primary containers' liveness, readiness and startup probes - ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#configure-probes - ## @param postgresql.primary.livenessProbe.enabled Enable livenessProbe on PostgreSQL Primary containers - ## @param postgresql.primary.livenessProbe.initialDelaySeconds Initial delay seconds for livenessProbe - ## @param postgresql.primary.livenessProbe.periodSeconds Period seconds for livenessProbe - ## @param postgresql.primary.livenessProbe.timeoutSeconds Timeout seconds for livenessProbe - ## @param postgresql.primary.livenessProbe.failureThreshold Failure threshold for livenessProbe - ## @param postgresql.primary.livenessProbe.successThreshold Success threshold for livenessProbe - ## - livenessProbe: - enabled: true - initialDelaySeconds: 30 - periodSeconds: 10 - timeoutSeconds: 5 - failureThreshold: 6 - successThreshold: 1 - ## @param postgresql.primary.readinessProbe.enabled Enable readinessProbe on PostgreSQL Primary containers - ## @param postgresql.primary.readinessProbe.initialDelaySeconds Initial delay seconds for readinessProbe - ## @param postgresql.primary.readinessProbe.periodSeconds Period seconds for readinessProbe - ## @param postgresql.primary.readinessProbe.timeoutSeconds Timeout seconds for readinessProbe - ## @param postgresql.primary.readinessProbe.failureThreshold Failure threshold for readinessProbe - ## @param postgresql.primary.readinessProbe.successThreshold Success threshold for readinessProbe - ## - readinessProbe: - enabled: true - initialDelaySeconds: 5 - periodSeconds: 10 - timeoutSeconds: 5 - failureThreshold: 6 - successThreshold: 1 - ## @param postgresql.primary.startupProbe.enabled Enable startupProbe on PostgreSQL Primary containers - ## @param postgresql.primary.startupProbe.initialDelaySeconds Initial delay seconds for startupProbe - ## @param postgresql.primary.startupProbe.periodSeconds Period seconds for startupProbe - ## @param postgresql.primary.startupProbe.timeoutSeconds Timeout seconds for startupProbe - ## @param postgresql.primary.startupProbe.failureThreshold Failure threshold for startupProbe - ## @param postgresql.primary.startupProbe.successThreshold Success threshold for startupProbe - ## - startupProbe: - enabled: false - initialDelaySeconds: 30 - periodSeconds: 10 - timeoutSeconds: 1 - failureThreshold: 15 - successThreshold: 1 - persistence: - ## @param postgresql.primary.persistence.enabled Enable PostgreSQL Primary data persistence using PVC - ## - enabled: true - ## @param postgresql.primary.persistence.existingClaim Name of an existing PVC to use - ## - existingClaim: "" - ## @param postgresql.primary.persistence.accessModes PVC Access Mode for PostgreSQL volume - ## - accessModes: - - ReadWriteOnce - ## @param postgresql.primary.persistence.size PVC Storage Request for PostgreSQL volume - ## - size: 8Gi - -## @section Ingress parameters -## Documentation: https://kubernetes.io/docs/concepts/services-networking/ingress/ -## -ingress: - ## @param ingress.enabled Enable ingress - ## - enabled: true - ## @param ingress.ingressClassName Ingress class name - ## - ingressClassName: nginx - ## @param ingress.nginx.enabled Ingress controller - ## - nginx: - enabled: false - ## @param ingress.annotations Ingress annotations - ## - annotations: - {} - # kubernetes.io/ingress.class: "nginx" - # cert-manager.io/issuer: letsencrypt-nginx - ## @param ingress.hostName Ingress hostname (your custom domain name, e.g. `infisical.example.org`) - ## Replace with your own domain - ## - hostName: "" - ## @param ingress.tls Ingress TLS hosts (matching above hostName) - ## Replace with your own domain - ## - tls: - [] - # - secretName: letsencrypt-nginx - # hosts: - # - infisical.local - ## @param ingress.trigger.path Trigger.dev ingress path - ## @param ingress.trigger.pathType Trigger.dev ingress path type - ## - trigger: - path: / - pathType: Prefix diff --git a/integrations/airtable/CHANGELOG.md b/integrations/airtable/CHANGELOG.md deleted file mode 100644 index a4fda4dc9..000000000 --- a/integrations/airtable/CHANGELOG.md +++ /dev/null @@ -1,790 +0,0 @@ -# @trigger.dev/airtable - -## 3.0.0-beta.55 - -### Patch Changes - -- Updated dependencies [0591db5f2] - - @trigger.dev/sdk@3.0.0-beta.55 - - @trigger.dev/integration-kit@3.0.0-beta.55 - -## 3.0.0-beta.54 - -### Patch Changes - -- Updated dependencies [728eeeff6] - - @trigger.dev/sdk@3.0.0-beta.54 - - @trigger.dev/integration-kit@3.0.0-beta.54 - -## 3.0.0-beta.53 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.53 -- @trigger.dev/sdk@3.0.0-beta.53 - -## 3.0.0-beta.52 - -### Patch Changes - -- Updated dependencies [8cae1d087] - - @trigger.dev/sdk@3.0.0-beta.52 - - @trigger.dev/integration-kit@3.0.0-beta.52 - -## 3.0.0-beta.51 - -### Patch Changes - -- Updated dependencies [979bee50d] -- Updated dependencies [086a0f95c] -- Updated dependencies [55264657d] - - @trigger.dev/sdk@3.0.0-beta.51 - - @trigger.dev/integration-kit@3.0.0-beta.51 - -## 3.0.0-beta.50 - -### Patch Changes - -- Updated dependencies [8ba998794] - - @trigger.dev/sdk@3.0.0-beta.50 - - @trigger.dev/integration-kit@3.0.0-beta.50 - -## 3.0.0-beta.49 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.49 -- @trigger.dev/sdk@3.0.0-beta.49 - -## 3.0.0-beta.48 - -### Patch Changes - -- Updated dependencies [ecf1110ab] - - @trigger.dev/sdk@3.0.0-beta.48 - - @trigger.dev/integration-kit@3.0.0-beta.48 - -## 3.0.0-beta.47 - -### Patch Changes - -- Updated dependencies [4f95c9de4] - - @trigger.dev/sdk@3.0.0-beta.47 - - @trigger.dev/integration-kit@3.0.0-beta.47 - -## 3.0.0-beta.46 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.46 -- @trigger.dev/sdk@3.0.0-beta.46 - -## 3.0.0-beta.45 - -### Patch Changes - -- Updated dependencies [0e77e7ef7] - - @trigger.dev/sdk@3.0.0-beta.45 - - @trigger.dev/integration-kit@3.0.0-beta.45 - -## 3.0.0-beta.44 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.44 -- @trigger.dev/sdk@3.0.0-beta.44 - -## 3.0.0-beta.43 - -### Patch Changes - -- Updated dependencies [34ca7667d] - - @trigger.dev/sdk@3.0.0-beta.43 - - @trigger.dev/integration-kit@3.0.0-beta.43 - -## 3.0.0-beta.42 - -### Patch Changes - -- Updated dependencies [ecef19966] - - @trigger.dev/sdk@3.0.0-beta.42 - - @trigger.dev/integration-kit@3.0.0-beta.42 - -## 3.0.0-beta.41 - -### Patch Changes - -- Updated dependencies [7c36a1a4b] - - @trigger.dev/sdk@3.0.0-beta.41 - - @trigger.dev/integration-kit@3.0.0-beta.41 - -## 3.0.0-beta.40 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.40 -- @trigger.dev/sdk@3.0.0-beta.40 - -## 3.0.0-beta.39 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.39 -- @trigger.dev/sdk@3.0.0-beta.39 - -## 3.0.0-beta.38 - -### Patch Changes - -- Updated dependencies [1b90ffbb8] -- Updated dependencies [c405ae711] - - @trigger.dev/sdk@3.0.0-beta.38 - - @trigger.dev/integration-kit@3.0.0-beta.38 - -## 3.0.0-beta.37 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.37 -- @trigger.dev/sdk@3.0.0-beta.37 - -## 3.0.0-beta.36 - -### Patch Changes - -- Updated dependencies [51bb4c887] -- Updated dependencies [ba71f959e] - - @trigger.dev/sdk@3.0.0-beta.36 - - @trigger.dev/integration-kit@3.0.0-beta.36 - -## 3.0.0-beta.35 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.35 -- @trigger.dev/sdk@3.0.0-beta.35 - -## 3.0.0-beta.34 - -### Patch Changes - -- Updated dependencies [3a1b0c486] -- Updated dependencies [3f8b6d8fc] -- Updated dependencies [1281d40e4] - - @trigger.dev/sdk@3.0.0-beta.34 - - @trigger.dev/integration-kit@3.0.0-beta.34 - -## 3.0.0-beta.33 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.33 -- @trigger.dev/sdk@3.0.0-beta.33 - -## 3.0.0-beta.32 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.32 -- @trigger.dev/sdk@3.0.0-beta.32 - -## 3.0.0-beta.31 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.31 -- @trigger.dev/sdk@3.0.0-beta.31 - -## 3.0.0-beta.30 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.30 -- @trigger.dev/sdk@3.0.0-beta.30 - -## 3.0.0-beta.29 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.29 -- @trigger.dev/sdk@3.0.0-beta.29 - -## 3.0.0-beta.28 - -### Patch Changes - -- Updated dependencies [6d9dfbc75] - - @trigger.dev/sdk@3.0.0-beta.28 - - @trigger.dev/integration-kit@3.0.0-beta.28 - -## 3.0.0-beta.27 - -### Patch Changes - -- Updated dependencies [203e00208] - - @trigger.dev/sdk@3.0.0-beta.27 - - @trigger.dev/integration-kit@3.0.0-beta.27 - -## 3.0.0-beta.26 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.26 -- @trigger.dev/sdk@3.0.0-beta.26 - -## 3.0.0-beta.25 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.25 -- @trigger.dev/sdk@3.0.0-beta.25 - -## 3.0.0-beta.24 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.24 -- @trigger.dev/sdk@3.0.0-beta.24 - -## 3.0.0-beta.23 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.23 -- @trigger.dev/sdk@3.0.0-beta.23 - -## 3.0.0-beta.22 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.22 -- @trigger.dev/sdk@3.0.0-beta.22 - -## 3.0.0-beta.21 - -### Patch Changes - -- Updated dependencies [9491a1649] - - @trigger.dev/sdk@3.0.0-beta.21 - - @trigger.dev/integration-kit@3.0.0-beta.21 - -## 3.0.0-beta.20 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.20 -- @trigger.dev/sdk@3.0.0-beta.20 - -## 3.0.0-beta.19 - -### Patch Changes - -- Updated dependencies [e9a63a486] - - @trigger.dev/sdk@3.0.0-beta.19 - - @trigger.dev/integration-kit@3.0.0-beta.19 - -## 3.0.0-beta.18 - -### Patch Changes - -- Updated dependencies [b68012f81] -- Updated dependencies [b68012f81] -- Updated dependencies [b68012f81] - - @trigger.dev/sdk@3.0.0-beta.18 - - @trigger.dev/integration-kit@3.0.0-beta.18 - -## 3.0.0-beta.17 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.17 -- @trigger.dev/sdk@3.0.0-beta.17 - -## 3.0.0-beta.16 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.16 -- @trigger.dev/sdk@3.0.0-beta.16 - -## 3.0.0-beta.15 - -### Patch Changes - -- Updated dependencies [374edef02] -- Updated dependencies [26093896d] - - @trigger.dev/sdk@3.0.0-beta.15 - - @trigger.dev/integration-kit@3.0.0-beta.15 - -## 3.0.0-beta.14 - -### Patch Changes - -- Updated dependencies [c9e1a3e9c] - - @trigger.dev/sdk@3.0.0-beta.14 - - @trigger.dev/integration-kit@3.0.0-beta.14 - -## 3.0.0-beta.13 - -### Patch Changes - -- Updated dependencies [4986bfda2] -- Updated dependencies [44e1b8754] -- Updated dependencies [4986bfda2] -- Updated dependencies [4986bfda2] - - @trigger.dev/sdk@3.0.0-beta.13 - - @trigger.dev/integration-kit@3.0.0-beta.13 - -## 3.0.0-beta.12 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.12 -- @trigger.dev/sdk@3.0.0-beta.12 - -## 3.0.0-beta.11 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.11 -- @trigger.dev/sdk@3.0.0-beta.11 - -## 3.0.0-beta.7 - -### Patch Changes - -- Updated dependencies [f854cb90e] -- Updated dependencies [f854cb90e] - - @trigger.dev/sdk@3.0.0-beta.7 - - @trigger.dev/integration-kit@3.0.0-beta.7 - -## 3.0.0-beta.6 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.6 -- @trigger.dev/sdk@3.0.0-beta.6 - -## 3.0.0-beta.5 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.5 -- @trigger.dev/sdk@3.0.0-beta.5 - -## 3.0.0-beta.4 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.4 -- @trigger.dev/sdk@3.0.0-beta.4 - -## 3.0.0-beta.3 - -### Patch Changes - -- Updated dependencies [b271742dc] - - @trigger.dev/sdk@3.0.0-beta.3 - - @trigger.dev/integration-kit@3.0.0-beta.3 - -## 3.0.0-beta.2 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.2 -- @trigger.dev/sdk@3.0.0-beta.2 - -## 3.0.0-beta.1 - -### Patch Changes - -- Updated dependencies [b66d5525e] -- Updated dependencies [719c0a0b9] -- Updated dependencies [f93eae300] - - @trigger.dev/sdk@3.0.0-beta.1 - - @trigger.dev/integration-kit@3.0.0-beta.1 - -## 3.0.0-beta.0 - -### Patch Changes - -- Updated dependencies [395abe1b9] - - @trigger.dev/sdk@3.0.0-beta.0 - - @trigger.dev/integration-kit@3.0.0-beta.0 - -## 2.3.18 - -### Patch Changes - -- @trigger.dev/integration-kit@2.3.18 -- @trigger.dev/sdk@2.3.18 - -## 2.3.17 - -### Patch Changes - -- Updated dependencies [dd879c8e] - - @trigger.dev/sdk@2.3.17 - - @trigger.dev/integration-kit@2.3.17 - -## 2.3.16 - -### Patch Changes - -- @trigger.dev/integration-kit@2.3.16 -- @trigger.dev/sdk@2.3.16 - -## 2.3.15 - -### Patch Changes - -- Updated dependencies [6c4047cf] - - @trigger.dev/sdk@2.3.15 - - @trigger.dev/integration-kit@2.3.15 - -## 2.3.14 - -### Patch Changes - -- @trigger.dev/integration-kit@2.3.14 -- @trigger.dev/sdk@2.3.14 - -## 2.3.13 - -### Patch Changes - -- Updated dependencies [a93b554f] -- Updated dependencies [0f342cd1] - - @trigger.dev/sdk@2.3.13 - - @trigger.dev/integration-kit@2.3.13 - -## 2.3.12 - -### Patch Changes - -- Updated dependencies [129f023d] -- Updated dependencies [38f5a903] -- Updated dependencies [ff4ff869] - - @trigger.dev/sdk@2.3.12 - - @trigger.dev/integration-kit@2.3.12 - -## 2.3.11 - -### Patch Changes - -- @trigger.dev/integration-kit@2.3.11 -- @trigger.dev/sdk@2.3.11 - -## 2.3.10 - -### Patch Changes - -- Updated dependencies [8277f4d2] -- Updated dependencies [73cb8839] - - @trigger.dev/sdk@2.3.10 - - @trigger.dev/integration-kit@2.3.10 - -## 2.3.9 - -### Patch Changes - -- Updated dependencies [f7bf25f0] - - @trigger.dev/sdk@2.3.9 - - @trigger.dev/integration-kit@2.3.9 - -## 2.3.8 - -### Patch Changes - -- @trigger.dev/integration-kit@2.3.8 -- @trigger.dev/sdk@2.3.8 - -## 2.3.7 - -### Patch Changes - -- @trigger.dev/integration-kit@2.3.7 -- @trigger.dev/sdk@2.3.7 - -## 2.3.6 - -### Patch Changes - -- @trigger.dev/integration-kit@2.3.6 -- @trigger.dev/sdk@2.3.6 - -## 2.3.5 - -### Patch Changes - -- @trigger.dev/integration-kit@2.3.5 -- @trigger.dev/sdk@2.3.5 - -## 2.3.4 - -### Patch Changes - -- Updated dependencies [6a3c563f] - - @trigger.dev/sdk@2.3.4 - - @trigger.dev/integration-kit@2.3.4 - -## 2.3.3 - -### Patch Changes - -- 0f9f0102: Named exports don't work because Airtable is a CommonJS module - - @trigger.dev/integration-kit@2.3.3 - - @trigger.dev/sdk@2.3.3 - -## 2.3.2 - -### Patch Changes - -- 0c14e4cd: Fixed importing package subpath - - @trigger.dev/integration-kit@2.3.2 - - @trigger.dev/sdk@2.3.2 - -## 2.3.1 - -### Patch Changes - -- Updated dependencies [f3efcc0c] - - @trigger.dev/sdk@2.3.1 - - @trigger.dev/integration-kit@2.3.1 - -## 2.3.0 - -### Minor Changes - -- 17f6f29d: Support for Deno, Bun and Cloudflare workers, as well as conditionally exporting ESM versions of the package instead of just commonjs. - - Cloudflare worker support requires the node compat flag turned on (https://developers.cloudflare.com/workers/runtime-apis/nodejs/) - -### Patch Changes - -- Updated dependencies [17f6f29d] - - @trigger.dev/integration-kit@2.3.0 - - @trigger.dev/sdk@2.3.0 - -## 2.2.11 - -### Patch Changes - -- de652c1d: Fix Shopify task types and KV `get()` return types -- Updated dependencies [de652c1d] - - @trigger.dev/sdk@2.2.11 - - @trigger.dev/integration-kit@2.2.11 - -## 2.2.10 - -### Patch Changes - -- @trigger.dev/integration-kit@2.2.10 -- @trigger.dev/sdk@2.2.10 - -## 2.2.9 - -### Patch Changes - -- Updated dependencies [1dcd87a2] -- Updated dependencies [6ebd435e] - - @trigger.dev/sdk@2.2.9 - - @trigger.dev/integration-kit@2.2.9 - -## 2.2.8 - -### Patch Changes - -- 067e19fe: - Simplify `Webhook Triggers` and use the new HTTP Endpoints - - Add a `Key-Value Store` for use in and outside of Jobs - - Add a `@trigger.dev/shopify` package -- Updated dependencies [067e19fe] -- Updated dependencies [096151c0] - - @trigger.dev/integration-kit@2.2.8 - - @trigger.dev/sdk@2.2.8 - -## 2.2.7 - -### Patch Changes - -- Updated dependencies [756024da] - - @trigger.dev/sdk@2.2.7 - - @trigger.dev/integration-kit@2.2.7 - -## 2.2.6 - -### Patch Changes - -- Updated dependencies [cb1825bf] -- Updated dependencies [cb1825bf] -- Updated dependencies [d0217344] -- Updated dependencies [cb1825bf] - - @trigger.dev/integration-kit@2.2.6 - - @trigger.dev/sdk@2.2.6 - -## 2.2.5 - -### Patch Changes - -- Updated dependencies [7e57f1f3] -- Updated dependencies [cf8f9946] -- Updated dependencies [a74716a1] -- Updated dependencies [620b8383] -- Updated dependencies [620b8383] -- Updated dependencies [4a0f030e] -- Updated dependencies [f4275e50] - - @trigger.dev/sdk@2.2.5 - - @trigger.dev/integration-kit@2.2.5 - -## 2.2.4 - -### Patch Changes - -- 9c5a7cf0: Extend the Airtable field set to accept formula errors and special values -- Updated dependencies [c1710ae7] -- Updated dependencies [9c4be40a] - - @trigger.dev/sdk@2.2.4 - - @trigger.dev/integration-kit@2.2.4 - -## 2.2.3 - -### Patch Changes - -- Updated dependencies [6e1b8a11] -- Updated dependencies [c4533c36] - - @trigger.dev/sdk@2.2.3 - - @trigger.dev/integration-kit@2.2.3 - -## 2.2.2 - -### Patch Changes - -- @trigger.dev/integration-kit@2.2.2 -- @trigger.dev/sdk@2.2.2 - -## 2.2.1 - -### Patch Changes - -- b9eba680: Export Base and Table -- Updated dependencies [044d38e3] - - @trigger.dev/sdk@2.2.1 - - @trigger.dev/integration-kit@2.2.1 - -## 2.2.0 - -### Patch Changes - -- Updated dependencies [975c5f1d] - - @trigger.dev/integration-kit@2.2.0 - - @trigger.dev/sdk@2.2.0 - -## 2.1.9 - -### Patch Changes - -- 9a187f9e: upgrade zod to 3.22.3 -- Updated dependencies [9a187f9e] -- Updated dependencies [2e9452ab] - - @trigger.dev/sdk@2.1.9 - - @trigger.dev/integration-kit@2.1.9 - -## 2.1.8 - -### Patch Changes - -- 6a992a19: First release of `@trigger.dev/replicate` integration with remote callback support. -- Updated dependencies [6a992a19] -- Updated dependencies [ab9e4a98] -- Updated dependencies [ab9e4a98] - - @trigger.dev/sdk@2.1.8 - - @trigger.dev/integration-kit@2.1.8 - -## 2.1.7 - -### Patch Changes - -- @trigger.dev/integration-kit@2.1.7 -- @trigger.dev/sdk@2.1.7 - -## 2.1.6 - -### Patch Changes - -- @trigger.dev/integration-kit@2.1.6 -- @trigger.dev/sdk@2.1.6 - -## 2.1.5 - -### Patch Changes - -- @trigger.dev/integration-kit@2.1.5 -- @trigger.dev/sdk@2.1.5 - -## 2.1.4 - -### Patch Changes - -- c0dfa804: Add support for Bring Your Own Auth -- Updated dependencies [ad14983e] -- Updated dependencies [15f17d27] -- Updated dependencies [50137a6f] -- Updated dependencies [c0dfa804] - - @trigger.dev/sdk@2.1.4 - - @trigger.dev/integration-kit@2.1.4 - -## 2.1.3 - -### Patch Changes - -- Updated dependencies: - - `@trigger.dev/sdk@2.1.3` - - `@trigger.dev/integration-kit@2.1.3` - -## 2.1.2 - -### Patch Changes - -- Updated dependencies: - - `@trigger.dev/integration-kit@2.1.2` - - `@trigger.dev/sdk@2.1.2` - -## 2.1.1 - -### Patch Changes - -- Updated dependencies: - - `@trigger.dev/sdk@2.1.1` - - `@trigger.dev/integration-kit@2.1.1` - -## 2.1.0 - -### Minor Changes - -- Integrations are now simpler and support authentication during webhook registration ([`878da3c0`](https://github.com/triggerdotdev/trigger.dev/commit/878da3c01f0a4dfaf33a1f8943a7ad4eed8b8877)) - -### Patch Changes - -- Updated dependencies: - - `@trigger.dev/integration-kit@2.1.0` - - `@trigger.dev/sdk@2.1.0` - -## 2.1.0-beta.1 - -### Patch Changes - -- Updated dependencies: - - `@trigger.dev/integration-kit@2.1.0-beta.1` - - `@trigger.dev/sdk@2.1.0-beta.1` - -## 2.1.0-beta.0 - -### Minor Changes - -- Integrations are now simpler and support authentication during webhook registration ([`878da3c0`](https://github.com/triggerdotdev/trigger.dev/commit/878da3c01f0a4dfaf33a1f8943a7ad4eed8b8877)) - -### Patch Changes - -- Updated dependencies: - - `@trigger.dev/integration-kit@2.1.0-beta.0` - - `@trigger.dev/sdk@2.1.0-beta.0` diff --git a/integrations/airtable/README.md b/integrations/airtable/README.md deleted file mode 100644 index 4fb788622..000000000 --- a/integrations/airtable/README.md +++ /dev/null @@ -1,3 +0,0 @@ - -# @trigger.dev/airtable - \ No newline at end of file diff --git a/integrations/airtable/package.json b/integrations/airtable/package.json deleted file mode 100644 index de0a5ea41..000000000 --- a/integrations/airtable/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "@trigger.dev/airtable", - "version": "3.0.0-beta.55", - "description": "Trigger.dev integration for airtable", - "main": "./dist/index.js", - "types": "./dist/index.d.ts", - "publishConfig": { - "access": "public" - }, - "files": [ - "dist" - ], - "devDependencies": { - "@trigger.dev/tsconfig": "workspace:*", - "@types/node": "16.x", - "rimraf": "^3.0.2", - "tsup": "8.0.1", - "typescript": "^5.3.0", - "@trigger.dev/tsup": "workspace:*" - }, - "scripts": { - "clean": "rimraf dist", - "build": "npm run clean && npm run build:tsup", - "build:tsup": "tsup", - "typecheck": "tsc --noEmit" - }, - "dependencies": { - "@trigger.dev/integration-kit": "workspace:^3.0.0-beta.55", - "@trigger.dev/sdk": "workspace:^3.0.0-beta.55", - "airtable": "^0.12.1", - "zod": "3.22.3" - }, - "engines": { - "node": ">=16.8.0" - }, - "exports": { - ".": { - "import": { - "types": "./dist/index.d.mts", - "default": "./dist/index.mjs" - }, - "require": "./dist/index.js", - "types": "./dist/index.d.ts" - }, - "./package.json": "./package.json" - }, - "module": "./dist/index.mjs" -} diff --git a/integrations/airtable/src/base.ts b/integrations/airtable/src/base.ts deleted file mode 100644 index 0032aa916..000000000 --- a/integrations/airtable/src/base.ts +++ /dev/null @@ -1,164 +0,0 @@ -import { DisplayProperty, IntegrationTaskKey } from "@trigger.dev/sdk"; -import AirtableSDK from "airtable"; -import { AirtableFieldSet, AirtableRecord, AirtableRunTask } from "."; - -type TableParams> = { - tableName: string; -} & Params; - -export type AirtableRecordsParams = TableParams<{}>; -export type AirtableRecords = AirtableSDK.Records; - -export class Base { - constructor( - private runTask: AirtableRunTask, - public baseId: string - ) {} - - table(tableName: string) { - return new Table(this.runTask, this.baseId, tableName); - } -} - -export class Table { - runTask: AirtableRunTask; - baseId: string; - tableName: string; - - constructor(runTask: AirtableRunTask, baseId: string, tableName: string) { - this.runTask = runTask; - this.baseId = baseId; - this.tableName = tableName; - } - - getRecords(key: IntegrationTaskKey, params?: AirtableSDK.SelectOptions) { - return this.runTask( - key, - async (client) => { - const result = await client - .base(this.baseId) - // official types are wrong - we need to use our extended AirtableFieldSet here - // @ts-ignore - .table(this.tableName) - .select(params) - .all(); - return result.map((record) => toSerializableRecord(record)); - }, - { - name: "Get Records", - params, - properties: [...tableParams({ baseId: this.baseId, tableName: this.tableName })], - } - ); - } - - getRecord(key: IntegrationTaskKey, recordId: string) { - return this.runTask( - key, - async (client) => { - // official types are wrong - we need to use our extended AirtableFieldSet here - // @ts-ignore - const result = await client.base(this.baseId).table(this.tableName).find(recordId); - return toSerializableRecord(result); - }, - { - name: "Get Record", - params: { recordId }, - properties: [ - ...tableParams({ baseId: this.baseId, tableName: this.tableName }), - { label: "Record", text: recordId }, - ], - } - ); - } - - createRecords(key: IntegrationTaskKey, records: { fields: Partial }[]) { - return this.runTask( - key, - async (client) => { - const result = await client - .base(this.baseId) - // official types are wrong - we need to use our extended AirtableFieldSet here - // @ts-ignore - .table(this.tableName) - .create(records); - return result.map((record) => toSerializableRecord(record)); - }, - { - name: "Create Records", - params: records, - properties: [ - ...tableParams({ baseId: this.baseId, tableName: this.tableName }), - { label: "Created records", text: records.length.toString() }, - ], - } - ); - } - - updateRecords(key: IntegrationTaskKey, records: { id: string; fields: Partial }[]) { - return this.runTask( - key, - async (client) => { - const result = await client - .base(this.baseId) - // official types are wrong - we need to use our extended AirtableFieldSet here - // @ts-ignore - .table(this.tableName) - .update(records); - return result.map((record) => toSerializableRecord(record)); - }, - { - name: "Update Records", - params: records, - properties: [ - ...tableParams({ baseId: this.baseId, tableName: this.tableName }), - { label: "Updated records", text: records.length.toString() }, - ], - } - ); - } - - deleteRecords(key: IntegrationTaskKey, recordIds: string[]) { - return this.runTask( - key, - async (client) => { - const result = await client - .base(this.baseId) - // official types are wrong - we need to use our extended AirtableFieldSet here - // @ts-ignore - .table(this.tableName) - .destroy(recordIds); - return result.map((record) => toSerializableRecord(record)); - }, - { - name: "Delete Records", - params: { recordIds }, - properties: [ - ...tableParams({ baseId: this.baseId, tableName: this.tableName }), - { label: "Deleted records", text: recordIds.length.toString() }, - ], - } - ); - } -} - -function toSerializableRecord(record: AirtableRecord) { - return { - id: record.id, - fields: record.fields, - commentCount: record.commentCount, - } as AirtableRecord; -} - -function tableParams(params: { baseId: string; tableName: string }): DisplayProperty[] { - return [ - { - label: "Base", - text: params.baseId, - }, - { - label: "Table", - text: params.tableName, - }, - ]; -} diff --git a/integrations/airtable/src/events.ts b/integrations/airtable/src/events.ts deleted file mode 100644 index 1d4c83fc3..000000000 --- a/integrations/airtable/src/events.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { EventSpecification } from "@trigger.dev/sdk"; -import { WebhookPayload } from "./schemas"; - -type OnTableChanged = WebhookPayload; - -export const onTableChanged: EventSpecification = { - name: "changed", - title: "On Table Changed", - source: "airtable.com", - icon: "airtable", - //todo properties with base and table (if there is one), maybe other specs too - // properties: [ - //todo: add a payload example - // examples: [ - // { - // id: "recurring", - // name: "Recurring Price", - // icon: "airtable", - // payload: { - // id: "price_1NYV6vI0XSgju2urKsSmI53v", - // object: "price", - // active: true, - // billing_scheme: "per_unit", - // created: 1690467853, - // currency: "usd", - // custom_unit_amount: null, - // livemode: false, - // lookup_key: null, - // metadata: {}, - // nickname: null, - // product: "prod_OLBTh0QPxDXkIU", - // recurring: { - // aggregate_usage: null, - // interval: "month", - // interval_count: 1, - // trial_period_days: null, - // usage_type: "licensed", - // }, - // tax_behavior: "unspecified", - // tiers_mode: null, - // transform_quantity: null, - // type: "recurring", - // unit_amount: 1500, - // unit_amount_decimal: "1500", - // }, - // }, - // ], - parsePayload: (payload) => payload as OnTableChanged, - runProperties: (payload) => [{ label: "Change source", text: payload.actionMetadata.source }], -}; diff --git a/integrations/airtable/src/index.ts b/integrations/airtable/src/index.ts deleted file mode 100644 index 8cab7baf5..000000000 --- a/integrations/airtable/src/index.ts +++ /dev/null @@ -1,166 +0,0 @@ -import { Prettify } from "@trigger.dev/integration-kit"; -import { - Json, - retry, - type ConnectionAuth, - type IO, - type IOTask, - type IntegrationTaskKey, - type RunTaskErrorCallback, - type RunTaskOptions, - type TriggerIntegration, -} from "@trigger.dev/sdk"; -import AirtableSDK from "airtable"; -import { Base } from "./base"; -import { Webhooks, createWebhookSource } from "./webhooks"; - -export * from "./base"; -export * from "./types"; - -export type AirtableIntegrationOptions = { - /** An ID for this client */ - id: string; - /** Use this if you pass in a [Personal Access Token](https://airtable.com/developers/web/guides/personal-access-tokens). If omitted, it will use OAuth. */ - token?: string; -}; - -export type AirtableRunTask = InstanceType["runTask"]; - -export class Airtable implements TriggerIntegration { - // @internal - private _options: AirtableIntegrationOptions; - // @internal - private _client?: AirtableSDK; - // @internal - private _io?: IO; - // @internal - private _connectionKey?: string; - - constructor(options: Prettify) { - if (Object.keys(options).includes("token") && !options.token) { - throw `Can't create Airtable integration (${options.id}) as token was passed in but undefined`; - } - - this._options = options; - } - - get authSource() { - return this._options.token ? ("LOCAL" as const) : ("HOSTED" as const); - } - - get id() { - return this._options.id; - } - - get metadata() { - return { id: "airtable", name: "Airtable" }; - } - - get source() { - return createWebhookSource(this); - } - - cloneForRun(io: IO, connectionKey: string, auth?: ConnectionAuth) { - const airtable = new Airtable(this._options); - airtable._io = io; - airtable._connectionKey = connectionKey; - airtable._client = this.createClient(auth); - return airtable; - } - - createClient(auth?: ConnectionAuth) { - if (auth) { - return new AirtableSDK({ - apiKey: auth.accessToken, - }); - } - - if (this._options.token) { - return new AirtableSDK({ - apiKey: this._options.token, - }); - } - - throw new Error("No auth"); - } - - runTask | void>( - key: IntegrationTaskKey, - callback: (client: AirtableSDK, task: IOTask, io: IO) => Promise, - options?: RunTaskOptions, - errorCallback?: RunTaskErrorCallback - ): Promise { - if (!this._io) throw new Error("No IO"); - if (!this._connectionKey) throw new Error("No connection key"); - - return this._io.runTask( - key, - (task, io) => { - if (!this._client) throw new Error("No client"); - return callback(this._client, task, io); - }, - { - icon: "airtable", - retry: retry.standardBackoff, - ...(options ?? {}), - connectionKey: this._connectionKey, - }, - errorCallback ?? onError - ); - } - - base(baseId: string) { - return new Base(this.runTask.bind(this), baseId); - } - - //todo these require batch support because they send too many events - // onTableChanges(params: { - // baseId: string; - // tableId?: string; - // changeTypes?: WebhookChangeType[]; - // dataTypes?: WebhookDataType[]; - // }) { - // return createWebhookTrigger(this.source, events.onTableChanged, params, { - // changeTypes: params.changeTypes ?? ["add", "remove", "update"], - // dataTypes: ["tableData", "tableFields", "tableMetadata"], - // }); - // } - - webhooks() { - return new Webhooks(this.runTask.bind(this)); - } -} - -function isAirtableApiError(error: unknown): error is AirtableSDK.Error { - if (typeof error !== "object" || error === null) { - return false; - } - - const airtableError = error as AirtableSDK.Error; - - return ( - typeof airtableError.error === "string" && - typeof airtableError.message === "string" && - typeof airtableError.statusCode === "number" - ); -} - -export function onError(error: unknown): ReturnType { - if (!isAirtableApiError(error)) { - return; - } - - if (error.statusCode === 429) { - // see: https://airtable.com/developers/web/api/rate-limits - return { - retryAt: new Date(Date.now() + 30 * 1000), - }; - } - - if (error.statusCode >= 400 && error.statusCode < 500) { - // see: https://airtable.com/developers/web/api/errors#user-error-codes - return { - skipRetrying: true, - }; - } -} diff --git a/integrations/airtable/src/schemas.ts b/integrations/airtable/src/schemas.ts deleted file mode 100644 index a8c7fd52f..000000000 --- a/integrations/airtable/src/schemas.ts +++ /dev/null @@ -1,176 +0,0 @@ -import { z } from "zod"; - -const UserSourceMetadata = z.object({ - user: z.object({ - id: z.string(), - email: z.string(), - permissionLevel: z.union([ - z.literal("none"), - z.literal("read"), - z.literal("comment"), - z.literal("edit"), - z.literal("create"), - ]), - name: z.string().optional(), - profilePicUrl: z.string().optional(), - }), -}); - -const WebhookAction = z.discriminatedUnion("source", [ - z.object({ - source: z.literal("client"), - sourceMetadata: UserSourceMetadata, - }), - z.object({ - source: z.literal("publicApi"), - sourceMetadata: UserSourceMetadata, - }), - z.object({ - source: z.literal("formSubmission"), - sourceMetadata: z.object({ - viewId: z.string(), - }), - }), - z.object({ - source: z.literal("automation"), - sourceMetadata: z.object({ - automationId: z.string(), - }), - }), - z.object({ - source: z.literal("system"), - }), - z.object({ - source: z.literal("sync"), - }), - z.object({ - source: z.literal("anonymousUser"), - }), - z.object({ - source: z.literal("unknown"), - }), -]); - -const CreatedFieldSchema = z.object({ - name: z.string(), - type: z.union([ - z.literal("singleLineText"), - z.literal("email"), - z.literal("url"), - z.literal("multilineText"), - z.literal("number"), - z.literal("percent"), - z.literal("currency"), - z.literal("singleSelect"), - z.literal("multipleSelects"), - z.literal("singleCollaborator"), - z.literal("multipleCollaborators"), - z.literal("multipleRecordLinks"), - z.literal("date"), - z.literal("dateTime"), - z.literal("phoneNumber"), - z.literal("multipleAttachments"), - z.literal("checkbox"), - z.literal("formula"), - z.literal("createdTime"), - z.literal("rollup"), - z.literal("count"), - z.literal("lookup"), - z.literal("multipleLookupValues"), - z.literal("autoNumber"), - z.literal("barcode"), - z.literal("rating"), - z.literal("richText"), - z.literal("duration"), - z.literal("lastModifiedTime"), - z.literal("button"), - z.literal("createdBy"), - z.literal("lastModifiedBy"), - z.literal("externalSyncSource"), - z.literal("aiText"), - z.string(), - ]), -}); - -const ChangedRecordFieldSchema = z.object({ - cellValuesByFieldId: z.record(z.any()), -}); - -const CreatedRecordSchema = ChangedRecordFieldSchema.and( - z.object({ - createdTime: z.string(), - }) -); - -const ChangedRecordSchema = z.object({ - current: ChangedRecordFieldSchema, - previous: ChangedRecordFieldSchema.optional(), - unchanged: ChangedRecordFieldSchema.optional(), -}); - -const ChangedTableMetadata = z.object({ - name: z.string().optional(), - description: z.string().nullish(), -}); - -const ChangedTableSchema = z.object({ - changedViewsById: z - .record( - z.object({ - changedRecordsById: z.record(ChangedRecordSchema).optional(), - createdRecordsById: z.record(CreatedRecordSchema).optional(), - destroyedRecordIds: z.array(z.string()).optional(), - }) - ) - .optional(), - changedFieldsById: z - .record( - z.object({ - current: CreatedFieldSchema.partial(), - previous: CreatedFieldSchema.partial().optional(), - }) - ) - .optional(), - changedRecordsById: z.record(ChangedRecordSchema).optional(), - createdFieldsById: z.record(CreatedFieldSchema).optional(), - createdRecordsById: z.record(CreatedRecordSchema).optional(), - changedMetadata: z - .object({ - current: ChangedTableMetadata, - previous: ChangedTableMetadata.optional(), - }) - .optional(), - destroyedFieldIds: z.array(z.string()).optional(), - destroyedRecordIds: z.array(z.string()).optional(), -}); - -const CreatedTableSchema = z.object({ - metadata: z - .object({ - name: z.string(), - description: z.string().optional(), - }) - .optional(), - fieldsById: z.record(CreatedFieldSchema).optional(), - recordsById: z.record(CreatedRecordSchema).optional(), -}); - -export const WebhookPayloadSchema = z.object({ - timestamp: z.coerce.date(), - baseTransactionNumber: z.number(), - payloadFormat: z.literal("v0"), - actionMetadata: WebhookAction, - changedTablesById: z.record(ChangedTableSchema).optional(), - createdTablesById: z.record(CreatedTableSchema).optional(), - destroyedTableIds: z.array(z.string()).optional(), -}); - -export type WebhookPayload = z.infer; - -export const ListWebhooksResponseSchema = z.object({ - cursor: z.number(), - mightHaveMore: z.boolean(), - payloads: z.array(WebhookPayloadSchema), -}); - -export type ListWebhooksResponse = z.infer; diff --git a/integrations/airtable/src/types.ts b/integrations/airtable/src/types.ts deleted file mode 100644 index a85a4a4e7..000000000 --- a/integrations/airtable/src/types.ts +++ /dev/null @@ -1,58 +0,0 @@ -export type AirtableFieldSet = { - [key: string]: - | undefined - | string - | number - | boolean - | Collaborator - | Collaborator[] - | string[] - | Attachment[] - | Formula; -}; - -export type Collaborator = { - id: string; - email: string; - name: string; -}; - -export type Attachment = { - id: string; - url: string; - filename: string; - size: number; - type: string; - thumbnails?: { - small: Thumbnail; - large: Thumbnail; - full: Thumbnail; - }; -}; - -export type FormulaError = { - error: string; -}; - -export type FormulaSpecialValue = { - specialValue: "Infinity" | "NaN"; -}; - -export type Formula = string | number | FormulaError | FormulaSpecialValue; - -export type Thumbnail = { - url: string; - width: number; - height: number; -}; - -export type AirtableRecord = { - id: string; - fields: TFields; - commentCount?: number; -}; - -export type CreateAirtableRecord = Pick< - AirtableRecord>, - "fields" ->; diff --git a/integrations/airtable/src/webhooks.ts b/integrations/airtable/src/webhooks.ts deleted file mode 100644 index f993c9357..000000000 --- a/integrations/airtable/src/webhooks.ts +++ /dev/null @@ -1,464 +0,0 @@ -import { EventFilter, IntegrationTaskKey, verifyRequestSignature } from "@trigger.dev/sdk"; -import AirtableSDK from "airtable"; -import { z } from "zod"; -import * as events from "./events"; -import { Airtable, AirtableRunTask } from "./index"; -import { ListWebhooksResponse, ListWebhooksResponseSchema } from "./schemas"; -import { WebhookSource, WebhookTrigger } from "@trigger.dev/sdk"; -import { registerJobNamespace } from "@trigger.dev/integration-kit"; -import { Buffer } from "node:buffer"; - -const WebhookFromSourceSchema = z.union([ - z.literal("formSubmission"), - z.literal("client"), - z.literal("anonymousUser"), - // we don't currently support these as they can cause feedback loops - // z.literal("publicApi"), - // z.literal("automation"), - // z.literal("system"), - // z.literal("sync"), - // z.literal("unknown"), -]); - -type WebhookFromSource = z.infer; - -const WebhookDataTypeSchema = z.union([ - z.literal("tableData"), - z.literal("tableFields"), - z.literal("tableMetadata"), -]); - -export type WebhookDataType = z.infer; - -const WebhookChangeTypeSchema = z.union([ - z.literal("add"), - z.literal("remove"), - z.literal("update"), -]); - -export type WebhookChangeType = z.infer; -type WebhookSpecification = { - filters: { - dataTypes: WebhookDataType[]; - recordChangeScope?: string; - changeTypes?: WebhookChangeType[]; - fromSources?: WebhookFromSource[]; - }; -}; - -const AirtableErrorBodySchema = z - .union([ - z.object({ - error: z.string(), - }), - z.object({ - error: z.object({ - type: z.string(), - message: z.string().optional(), - }), - }), - ]) - .transform((body) => { - if (typeof body.error === "string") { - return { - type: body.error, - }; - } else { - return { - type: body.error.type, - message: body.error.message, - }; - } - }); - -const apiUrl = "https://api.airtable.com/v0/bases"; - -export class Webhooks { - runTask: AirtableRunTask; - - constructor(runTask: AirtableRunTask) { - this.runTask = runTask; - } - - create( - key: IntegrationTaskKey, - { baseId, url, options }: { baseId: string; url: string; options: WebhookSpecification } - ): Promise { - return this.runTask( - key, - async (client, task, io) => { - const response = await fetch(`${apiUrl}/${baseId}/webhooks`, { - method: "POST", - headers: { - Authorization: `Bearer ${client._apiKey}`, - "Content-Type": "application/json", - }, - body: JSON.stringify({ - notificationUrl: url, - specification: { - options: { - ...options, - includes: { - includePreviousCellValues: true, - includePreviousFieldDefinitions: true, - }, - }, - }, - }), - redirect: "follow", - }); - - if (!response.ok) { - await handleWebhookError(response, "WEBHOOK_CREATE"); - } - - const webhook = await response.json(); - const parsed = WebhookRegistrationDataSchema.parse(webhook); - return parsed; - }, - { - name: "Create webhook", - params: { - baseId, - url, - options, - }, - } - ); - } - - list(key: IntegrationTaskKey, { baseId }: { baseId: string }): Promise { - return this.runTask( - key, - async (client, task, io) => { - const response = await fetch(`${apiUrl}/${baseId}/webhooks`, { - headers: { - Authorization: `Bearer ${client._apiKey}`, - }, - redirect: "follow", - }); - - if (!response.ok) { - await handleWebhookError(response, "WEBHOOK_LIST"); - } - - const webhook = await response.json(); - const parsed = WebhookListDataSchema.parse(webhook); - return parsed; - }, - { - name: "List webhooks", - params: { - baseId, - }, - } - ); - } - - delete(key: IntegrationTaskKey, { baseId, webhookId }: { baseId: string; webhookId: string }) { - return this.runTask( - key, - async (client, task, io) => { - const response = await fetch(`${apiUrl}/${baseId}/webhooks/${webhookId}`, { - method: "DELETE", - headers: { - Authorization: `Bearer ${client._apiKey}`, - }, - redirect: "follow", - }); - - if (!response.ok) { - await handleWebhookError(response, "WEBHOOK_DELETE"); - } - }, - { - name: "Delete webhook", - params: { - baseId, - webhookId, - }, - } - ); - } - - async update( - key: IntegrationTaskKey, - { - baseId, - url, - webhookId, - options, - }: { baseId: string; url: string; webhookId: string; options: WebhookSpecification } - ) { - await this.delete(`${key}-delete`, { baseId, webhookId }); - return await this.create(`${key}-create`, { baseId, url, options }); - } -} - -type AirtableEvents = (typeof events)[keyof typeof events]; - -export type TriggerParams = { - baseId: string; - filter?: EventFilter; -}; - -type CreateWebhookTriggersResult = WebhookTrigger< - TEventSpecification, - ReturnType ->; - -export function createWebhookTrigger( - source: ReturnType, - event: TEventSpecification, - params: TriggerParams, - config: { - dataTypes: WebhookDataType[]; - changeTypes?: WebhookChangeType[]; - fromSources?: WebhookFromSource[]; - } -): CreateWebhookTriggersResult { - return new WebhookTrigger({ - event, - params, - source, - config, - }); -} - -const WebhookRegistrationDataSchema = z.object({ - id: z.string(), - expirationTime: z.string(), - macSecretBase64: z.string(), -}); - -type WebhookRegistrationData = z.infer; - -const WebhookListDataSchema = z.object({ - webhooks: z.array( - z.object({ - id: z.string(), - notificationUrl: z.string(), - expirationTime: z.coerce.date(), - areNotificationsEnabled: z.boolean(), - isHookEnabled: z.boolean(), - }) - ), -}); - -type WebhookListData = z.infer; - -const getSpecification = (config: Record, params: any): WebhookSpecification => { - return { - filters: { - dataTypes: config.dataTypes as WebhookDataType[], - changeTypes: config.changeTypes - ? (config.changeTypes as WebhookChangeType[]) - : ["add", "remove", "update"], - fromSources: (config.fromSources ?? [ - "client", - "anonymousUser", - "formSubmission", - ]) as WebhookFromSource[], - recordChangeScope: params?.tableId, - }, - }; -}; - -export function createWebhookSource( - integration: Airtable -): WebhookSource< - Airtable, - { baseId: string; tableId?: string }, - { dataTypes: WebhookDataType[]; fromSources?: WebhookFromSource[] } -> { - return new WebhookSource({ - id: "airtable.webhook", - schemas: { - params: z.object({ baseId: z.string(), tableId: z.string().optional() }), - config: z.object({ - dataTypes: z.array(WebhookDataTypeSchema), - fromSources: z.array(WebhookFromSourceSchema).optional(), - }), - }, - version: "0.1.0", - integration, - filter: (params, options) => ({ - actionMetadata: { - source: options?.fromSources ?? ["client", "anonymousUser", "formSubmission"], - }, - }), - key: (params) => - `airtable.webhook.${params.baseId}${params.tableId ? `.${params.tableId}` : ""}`, - crud: { - create: async ({ io, ctx }) => { - const webhook = await io.integration.webhooks().create("create-webhook", { - url: ctx.url, - baseId: ctx.params?.baseId, - options: getSpecification(ctx.config.desired, ctx.params), - }); - - await io.store.job.set("set-id", "webhook-id", webhook.id); - await io.store.job.set("set-secret", "webhook-secret-base64", webhook.macSecretBase64); - }, - read: async ({ io, ctx }) => { - const listResponse = await io.integration.webhooks().list("list-webhooks", { - baseId: ctx.params?.baseId, - }); - - const existingWebhook = listResponse.webhooks.find((w) => w.notificationUrl === ctx.url); - - if (!existingWebhook) { - return await io.store.job.delete("delete-stale-webhook-id", "webhook-id"); - } - - await io.store.job.set("set-webhook-id", "webhook-id", existingWebhook.id); - }, - delete: async ({ io, ctx }) => { - const webhookId = await io.store.job.get("get-webhook-id", "webhook-id"); - - if (!webhookId) { - throw new Error("Missing webhook ID for delete operation."); - } - - await io.integration.webhooks().delete("delete-webhook", { - baseId: ctx.params?.baseId, - webhookId, - }); - }, - }, - verify: async ({ request, client, ctx }) => { - // TODO: should pass namespaced store instead, e.g. client.store.webhookRegistration.get() - const secretBase64 = await client.store.env.get( - `${registerJobNamespace(ctx.key)}:webhook-secret-base64` - ); - - if (!secretBase64) { - throw new Error("Missing secret for verification."); - } - - return await verifyRequestSignature({ - request, - headerName: "x-airtable-content-mac", - secret: Buffer.from(secretBase64, "base64"), - algorithm: "sha256", - }); - }, - generateEvents: async ({ request, client, ctx }) => { - console.log("[@trigger.dev/airtable] Handling webhook payload"); - - const webhookPayload = ReceivedPayload.parse(await request.json()); - - const webhookId = await client.store.env.get( - `${registerJobNamespace(ctx.key)}:webhook-id` - ); - - const cursorKey = `cursor-${webhookId}`; - const cursor = await client.store.env.get(cursorKey); - - // TODO: get auth back - const airtable = integration.createClient(); - - const response = await getAllPayloads( - webhookPayload.base.id, - webhookPayload.webhook.id, - airtable, - cursor - ); - - if (!response) { - return console.log("[@trigger.dev/airtable] No payload fetch response, nothing to do!"); - } - - await client.store.env.set(cursorKey, response.cursor); - - const eventsFromResponse = response.payloads.map((payload) => ({ - id: `${payload.timestamp.getTime()}-${payload.baseTransactionNumber}`, - payload, - source: "airtable.com", - name: "changed", - timestamp: payload.timestamp, - })); - - await client.sendEvents(eventsFromResponse); - }, - }); -} - -/** This is the data received from Airtable. It's not useful on its own */ -const ReceivedPayload = z.object({ - base: z.object({ - id: z.string(), - }), - webhook: z.object({ - id: z.string(), - }), - timestamp: z.coerce.date(), -}); - -async function getAllPayloads( - baseId: string, - webhookId: string, - sdk: AirtableSDK, - cursor: number | undefined -) { - let response: ListWebhooksResponse | undefined = undefined; - let hasMore = true; - - while (hasMore) { - const newResponse = await getPayload(baseId, webhookId, sdk, cursor); - cursor = newResponse.cursor; - hasMore = newResponse.mightHaveMore; - - if (response) { - response.payloads.push(...newResponse.payloads); - } else { - response = newResponse; - } - } - - return response; -} - -async function getPayload( - baseId: string, - webhookId: string, - sdk: AirtableSDK, - cursor: number | undefined -) { - const url = new URL(`${apiUrl}/${baseId}/webhooks/${webhookId}/payloads`); - if (cursor) { - url.searchParams.append("cursor", cursor.toString()); - } - - const response = await fetch(url.href, { - headers: { - Authorization: `Bearer ${sdk._apiKey}`, - }, - redirect: "follow", - }); - - if (!response.ok) { - throw new Error(`Failed to list webhooks: ${response.statusText}`); - } - - const webhook = await response.json(); - return ListWebhooksResponseSchema.parse(webhook); -} - -async function handleWebhookError(response: Response, errorType: string) { - const rawErrorBody = await response.json(); - - const parsedErrorBody = AirtableErrorBodySchema.safeParse(rawErrorBody); - - if (!parsedErrorBody.success) { - throw new AirtableSDK.Error( - `${errorType}_PARSE_ERROR`, - `${response.statusText}:\n${rawErrorBody}`, - response.status - ); - } - - const { type, message } = parsedErrorBody.data; - - throw new AirtableSDK.Error(type, message ?? response.statusText, response.status); -} diff --git a/integrations/airtable/tsconfig.json b/integrations/airtable/tsconfig.json deleted file mode 100644 index a816ed394..000000000 --- a/integrations/airtable/tsconfig.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "extends": "@trigger.dev/tsconfig/node18.json", - "include": ["./src/**/*.ts", "tsup.config.ts"], - "compilerOptions": { - "lib": ["DOM", "DOM.Iterable", "ES2019"], - "paths": { - "@trigger.dev/sdk/*": ["../../packages/trigger-sdk/src/*"], - "@trigger.dev/sdk": ["../../packages/trigger-sdk/src/index"], - "@trigger.dev/integration-kit/*": ["../../packages/integration-kit/src/*"], - "@trigger.dev/integration-kit": ["../../packages/integration-kit/src/index"], - "@trigger.dev/tsup/*": ["../../config-packages/tsup/src/*"], - "@trigger.dev/tsup": ["../../config-packages/tsup/src/index"] - }, - "declaration": false, - "declarationMap": false, - "baseUrl": ".", - "stripInternal": true - }, - "exclude": ["node_modules"] -} diff --git a/integrations/airtable/tsup.config.ts b/integrations/airtable/tsup.config.ts deleted file mode 100644 index 1d1b59a08..000000000 --- a/integrations/airtable/tsup.config.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { defineConfigPackage } from "@trigger.dev/tsup"; - -export default defineConfigPackage; diff --git a/integrations/github/CHANGELOG.md b/integrations/github/CHANGELOG.md deleted file mode 100644 index 87736f1ef..000000000 --- a/integrations/github/CHANGELOG.md +++ /dev/null @@ -1,1052 +0,0 @@ -# @trigger.dev/github - -## 3.0.0-beta.55 - -### Patch Changes - -- Updated dependencies [0591db5f2] - - @trigger.dev/sdk@3.0.0-beta.55 - - @trigger.dev/integration-kit@3.0.0-beta.55 - -## 3.0.0-beta.54 - -### Patch Changes - -- Updated dependencies [728eeeff6] - - @trigger.dev/sdk@3.0.0-beta.54 - - @trigger.dev/integration-kit@3.0.0-beta.54 - -## 3.0.0-beta.53 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.53 -- @trigger.dev/sdk@3.0.0-beta.53 - -## 3.0.0-beta.52 - -### Patch Changes - -- Updated dependencies [8cae1d087] - - @trigger.dev/sdk@3.0.0-beta.52 - - @trigger.dev/integration-kit@3.0.0-beta.52 - -## 3.0.0-beta.51 - -### Patch Changes - -- Updated dependencies [979bee50d] -- Updated dependencies [086a0f95c] -- Updated dependencies [55264657d] - - @trigger.dev/sdk@3.0.0-beta.51 - - @trigger.dev/integration-kit@3.0.0-beta.51 - -## 3.0.0-beta.50 - -### Patch Changes - -- Updated dependencies [8ba998794] - - @trigger.dev/sdk@3.0.0-beta.50 - - @trigger.dev/integration-kit@3.0.0-beta.50 - -## 3.0.0-beta.49 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.49 -- @trigger.dev/sdk@3.0.0-beta.49 - -## 3.0.0-beta.48 - -### Patch Changes - -- Updated dependencies [ecf1110ab] - - @trigger.dev/sdk@3.0.0-beta.48 - - @trigger.dev/integration-kit@3.0.0-beta.48 - -## 3.0.0-beta.47 - -### Patch Changes - -- Updated dependencies [4f95c9de4] - - @trigger.dev/sdk@3.0.0-beta.47 - - @trigger.dev/integration-kit@3.0.0-beta.47 - -## 3.0.0-beta.46 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.46 -- @trigger.dev/sdk@3.0.0-beta.46 - -## 3.0.0-beta.45 - -### Patch Changes - -- Updated dependencies [0e77e7ef7] - - @trigger.dev/sdk@3.0.0-beta.45 - - @trigger.dev/integration-kit@3.0.0-beta.45 - -## 3.0.0-beta.44 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.44 -- @trigger.dev/sdk@3.0.0-beta.44 - -## 3.0.0-beta.43 - -### Patch Changes - -- Updated dependencies [34ca7667d] - - @trigger.dev/sdk@3.0.0-beta.43 - - @trigger.dev/integration-kit@3.0.0-beta.43 - -## 3.0.0-beta.42 - -### Patch Changes - -- Updated dependencies [ecef19966] - - @trigger.dev/sdk@3.0.0-beta.42 - - @trigger.dev/integration-kit@3.0.0-beta.42 - -## 3.0.0-beta.41 - -### Patch Changes - -- Updated dependencies [7c36a1a4b] - - @trigger.dev/sdk@3.0.0-beta.41 - - @trigger.dev/integration-kit@3.0.0-beta.41 - -## 3.0.0-beta.40 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.40 -- @trigger.dev/sdk@3.0.0-beta.40 - -## 3.0.0-beta.39 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.39 -- @trigger.dev/sdk@3.0.0-beta.39 - -## 3.0.0-beta.38 - -### Patch Changes - -- Updated dependencies [1b90ffbb8] -- Updated dependencies [c405ae711] - - @trigger.dev/sdk@3.0.0-beta.38 - - @trigger.dev/integration-kit@3.0.0-beta.38 - -## 3.0.0-beta.37 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.37 -- @trigger.dev/sdk@3.0.0-beta.37 - -## 3.0.0-beta.36 - -### Patch Changes - -- Updated dependencies [51bb4c887] -- Updated dependencies [ba71f959e] - - @trigger.dev/sdk@3.0.0-beta.36 - - @trigger.dev/integration-kit@3.0.0-beta.36 - -## 3.0.0-beta.35 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.35 -- @trigger.dev/sdk@3.0.0-beta.35 - -## 3.0.0-beta.34 - -### Patch Changes - -- Updated dependencies [3a1b0c486] -- Updated dependencies [3f8b6d8fc] -- Updated dependencies [1281d40e4] - - @trigger.dev/sdk@3.0.0-beta.34 - - @trigger.dev/integration-kit@3.0.0-beta.34 - -## 3.0.0-beta.33 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.33 -- @trigger.dev/sdk@3.0.0-beta.33 - -## 3.0.0-beta.32 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.32 -- @trigger.dev/sdk@3.0.0-beta.32 - -## 3.0.0-beta.31 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.31 -- @trigger.dev/sdk@3.0.0-beta.31 - -## 3.0.0-beta.30 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.30 -- @trigger.dev/sdk@3.0.0-beta.30 - -## 3.0.0-beta.29 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.29 -- @trigger.dev/sdk@3.0.0-beta.29 - -## 3.0.0-beta.28 - -### Patch Changes - -- Updated dependencies [6d9dfbc75] - - @trigger.dev/sdk@3.0.0-beta.28 - - @trigger.dev/integration-kit@3.0.0-beta.28 - -## 3.0.0-beta.27 - -### Patch Changes - -- Updated dependencies [203e00208] - - @trigger.dev/sdk@3.0.0-beta.27 - - @trigger.dev/integration-kit@3.0.0-beta.27 - -## 3.0.0-beta.26 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.26 -- @trigger.dev/sdk@3.0.0-beta.26 - -## 3.0.0-beta.25 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.25 -- @trigger.dev/sdk@3.0.0-beta.25 - -## 3.0.0-beta.24 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.24 -- @trigger.dev/sdk@3.0.0-beta.24 - -## 3.0.0-beta.23 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.23 -- @trigger.dev/sdk@3.0.0-beta.23 - -## 3.0.0-beta.22 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.22 -- @trigger.dev/sdk@3.0.0-beta.22 - -## 3.0.0-beta.21 - -### Patch Changes - -- Updated dependencies [9491a1649] - - @trigger.dev/sdk@3.0.0-beta.21 - - @trigger.dev/integration-kit@3.0.0-beta.21 - -## 3.0.0-beta.20 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.20 -- @trigger.dev/sdk@3.0.0-beta.20 - -## 3.0.0-beta.19 - -### Patch Changes - -- Updated dependencies [e9a63a486] - - @trigger.dev/sdk@3.0.0-beta.19 - - @trigger.dev/integration-kit@3.0.0-beta.19 - -## 3.0.0-beta.18 - -### Patch Changes - -- Updated dependencies [b68012f81] -- Updated dependencies [b68012f81] -- Updated dependencies [b68012f81] - - @trigger.dev/sdk@3.0.0-beta.18 - - @trigger.dev/integration-kit@3.0.0-beta.18 - -## 3.0.0-beta.17 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.17 -- @trigger.dev/sdk@3.0.0-beta.17 - -## 3.0.0-beta.16 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.16 -- @trigger.dev/sdk@3.0.0-beta.16 - -## 3.0.0-beta.15 - -### Patch Changes - -- Updated dependencies [374edef02] -- Updated dependencies [26093896d] - - @trigger.dev/sdk@3.0.0-beta.15 - - @trigger.dev/integration-kit@3.0.0-beta.15 - -## 3.0.0-beta.14 - -### Patch Changes - -- Updated dependencies [c9e1a3e9c] - - @trigger.dev/sdk@3.0.0-beta.14 - - @trigger.dev/integration-kit@3.0.0-beta.14 - -## 3.0.0-beta.13 - -### Patch Changes - -- Updated dependencies [4986bfda2] -- Updated dependencies [44e1b8754] -- Updated dependencies [4986bfda2] -- Updated dependencies [4986bfda2] - - @trigger.dev/sdk@3.0.0-beta.13 - - @trigger.dev/integration-kit@3.0.0-beta.13 - -## 3.0.0-beta.12 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.12 -- @trigger.dev/sdk@3.0.0-beta.12 - -## 3.0.0-beta.11 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.11 -- @trigger.dev/sdk@3.0.0-beta.11 - -## 3.0.0-beta.7 - -### Patch Changes - -- Updated dependencies [f854cb90e] -- Updated dependencies [f854cb90e] - - @trigger.dev/sdk@3.0.0-beta.7 - - @trigger.dev/integration-kit@3.0.0-beta.7 - -## 3.0.0-beta.6 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.6 -- @trigger.dev/sdk@3.0.0-beta.6 - -## 3.0.0-beta.5 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.5 -- @trigger.dev/sdk@3.0.0-beta.5 - -## 3.0.0-beta.4 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.4 -- @trigger.dev/sdk@3.0.0-beta.4 - -## 3.0.0-beta.3 - -### Patch Changes - -- Updated dependencies [b271742dc] - - @trigger.dev/sdk@3.0.0-beta.3 - - @trigger.dev/integration-kit@3.0.0-beta.3 - -## 3.0.0-beta.2 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.2 -- @trigger.dev/sdk@3.0.0-beta.2 - -## 3.0.0-beta.1 - -### Patch Changes - -- Updated dependencies [b66d5525e] -- Updated dependencies [719c0a0b9] -- Updated dependencies [f93eae300] - - @trigger.dev/sdk@3.0.0-beta.1 - - @trigger.dev/integration-kit@3.0.0-beta.1 - -## 3.0.0-beta.0 - -### Patch Changes - -- Updated dependencies [395abe1b9] - - @trigger.dev/sdk@3.0.0-beta.0 - - @trigger.dev/integration-kit@3.0.0-beta.0 - -## 2.3.18 - -### Patch Changes - -- @trigger.dev/integration-kit@2.3.18 -- @trigger.dev/sdk@2.3.18 - -## 2.3.17 - -### Patch Changes - -- Updated dependencies [dd879c8e] - - @trigger.dev/sdk@2.3.17 - - @trigger.dev/integration-kit@2.3.17 - -## 2.3.16 - -### Patch Changes - -- @trigger.dev/integration-kit@2.3.16 -- @trigger.dev/sdk@2.3.16 - -## 2.3.15 - -### Patch Changes - -- Updated dependencies [6c4047cf] - - @trigger.dev/sdk@2.3.15 - - @trigger.dev/integration-kit@2.3.15 - -## 2.3.14 - -### Patch Changes - -- @trigger.dev/integration-kit@2.3.14 -- @trigger.dev/sdk@2.3.14 - -## 2.3.13 - -### Patch Changes - -- Updated dependencies [a93b554f] -- Updated dependencies [0f342cd1] - - @trigger.dev/sdk@2.3.13 - - @trigger.dev/integration-kit@2.3.13 - -## 2.3.12 - -### Patch Changes - -- Updated dependencies [129f023d] -- Updated dependencies [38f5a903] -- Updated dependencies [ff4ff869] - - @trigger.dev/sdk@2.3.12 - - @trigger.dev/integration-kit@2.3.12 - -## 2.3.11 - -### Patch Changes - -- @trigger.dev/integration-kit@2.3.11 -- @trigger.dev/sdk@2.3.11 - -## 2.3.10 - -### Patch Changes - -- Updated dependencies [8277f4d2] -- Updated dependencies [73cb8839] - - @trigger.dev/sdk@2.3.10 - - @trigger.dev/integration-kit@2.3.10 - -## 2.3.9 - -### Patch Changes - -- Updated dependencies [f7bf25f0] - - @trigger.dev/sdk@2.3.9 - - @trigger.dev/integration-kit@2.3.9 - -## 2.3.8 - -### Patch Changes - -- 5060eec0: Update Octokit to account for CVE-2023-50728 - - @trigger.dev/integration-kit@2.3.8 - - @trigger.dev/sdk@2.3.8 - -## 2.3.7 - -### Patch Changes - -- @trigger.dev/integration-kit@2.3.7 -- @trigger.dev/sdk@2.3.7 - -## 2.3.6 - -### Patch Changes - -- @trigger.dev/integration-kit@2.3.6 -- @trigger.dev/sdk@2.3.6 - -## 2.3.5 - -### Patch Changes - -- @trigger.dev/integration-kit@2.3.5 -- @trigger.dev/sdk@2.3.5 - -## 2.3.4 - -### Patch Changes - -- Updated dependencies [6a3c563f] - - @trigger.dev/sdk@2.3.4 - - @trigger.dev/integration-kit@2.3.4 - -## 2.3.3 - -### Patch Changes - -- @trigger.dev/integration-kit@2.3.3 -- @trigger.dev/sdk@2.3.3 - -## 2.3.2 - -### Patch Changes - -- @trigger.dev/integration-kit@2.3.2 -- @trigger.dev/sdk@2.3.2 - -## 2.3.1 - -### Patch Changes - -- Updated dependencies [f3efcc0c] - - @trigger.dev/sdk@2.3.1 - - @trigger.dev/integration-kit@2.3.1 - -## 2.3.0 - -### Minor Changes - -- 17f6f29d: Support for Deno, Bun and Cloudflare workers, as well as conditionally exporting ESM versions of the package instead of just commonjs. - - Cloudflare worker support requires the node compat flag turned on (https://developers.cloudflare.com/workers/runtime-apis/nodejs/) - -### Patch Changes - -- Updated dependencies [17f6f29d] - - @trigger.dev/integration-kit@2.3.0 - - @trigger.dev/sdk@2.3.0 - -## 2.2.11 - -### Patch Changes - -- Updated dependencies [de652c1d] - - @trigger.dev/sdk@2.2.11 - - @trigger.dev/integration-kit@2.2.11 - -## 2.2.10 - -### Patch Changes - -- @trigger.dev/integration-kit@2.2.10 -- @trigger.dev/sdk@2.2.10 - -## 2.2.9 - -### Patch Changes - -- Updated dependencies [1dcd87a2] -- Updated dependencies [6ebd435e] - - @trigger.dev/sdk@2.2.9 - - @trigger.dev/integration-kit@2.2.9 - -## 2.2.8 - -### Patch Changes - -- Updated dependencies [067e19fe] -- Updated dependencies [096151c0] - - @trigger.dev/integration-kit@2.2.8 - - @trigger.dev/sdk@2.2.8 - -## 2.2.7 - -### Patch Changes - -- Updated dependencies [756024da] - - @trigger.dev/sdk@2.2.7 - - @trigger.dev/integration-kit@2.2.7 - -## 2.2.6 - -### Patch Changes - -- Updated dependencies [cb1825bf] -- Updated dependencies [cb1825bf] -- Updated dependencies [d0217344] -- Updated dependencies [cb1825bf] - - @trigger.dev/integration-kit@2.2.6 - - @trigger.dev/sdk@2.2.6 - -## 2.2.5 - -### Patch Changes - -- Updated dependencies [7e57f1f3] -- Updated dependencies [cf8f9946] -- Updated dependencies [a74716a1] -- Updated dependencies [620b8383] -- Updated dependencies [620b8383] -- Updated dependencies [4a0f030e] -- Updated dependencies [f4275e50] - - @trigger.dev/sdk@2.2.5 - - @trigger.dev/integration-kit@2.2.5 - -## 2.2.4 - -### Patch Changes - -- Updated dependencies [c1710ae7] -- Updated dependencies [9c4be40a] - - @trigger.dev/sdk@2.2.4 - - @trigger.dev/integration-kit@2.2.4 - -## 2.2.3 - -### Patch Changes - -- Updated dependencies [6e1b8a11] -- Updated dependencies [c4533c36] - - @trigger.dev/sdk@2.2.3 - - @trigger.dev/integration-kit@2.2.3 - -## 2.2.2 - -### Patch Changes - -- @trigger.dev/integration-kit@2.2.2 -- @trigger.dev/sdk@2.2.2 - -## 2.2.1 - -### Patch Changes - -- Updated dependencies [044d38e3] - - @trigger.dev/sdk@2.2.1 - - @trigger.dev/integration-kit@2.2.1 - -## 2.2.0 - -### Patch Changes - -- Updated dependencies [975c5f1d] - - @trigger.dev/integration-kit@2.2.0 - - @trigger.dev/sdk@2.2.0 - -## 2.1.9 - -### Patch Changes - -- 9a187f9e: upgrade zod to 3.22.3 -- Updated dependencies [9a187f9e] -- Updated dependencies [2e9452ab] - - @trigger.dev/sdk@2.1.9 - - @trigger.dev/integration-kit@2.1.9 - -## 2.1.8 - -### Patch Changes - -- 6a992a19: First release of `@trigger.dev/replicate` integration with remote callback support. -- Updated dependencies [6a992a19] -- Updated dependencies [ab9e4a98] -- Updated dependencies [ab9e4a98] - - @trigger.dev/sdk@2.1.8 - - @trigger.dev/integration-kit@2.1.8 - -## 2.1.7 - -### Patch Changes - -- @trigger.dev/integration-kit@2.1.7 -- @trigger.dev/sdk@2.1.7 - -## 2.1.6 - -### Patch Changes - -- @trigger.dev/integration-kit@2.1.6 -- @trigger.dev/sdk@2.1.6 - -## 2.1.5 - -### Patch Changes - -- @trigger.dev/integration-kit@2.1.5 -- @trigger.dev/sdk@2.1.5 - -## 2.1.4 - -### Patch Changes - -- c0dfa804: Add support for Bring Your Own Auth -- Updated dependencies [ad14983e] -- Updated dependencies [15f17d27] -- Updated dependencies [50137a6f] -- Updated dependencies [c0dfa804] - - @trigger.dev/sdk@2.1.4 - - @trigger.dev/integration-kit@2.1.4 - -## 2.1.3 - -### Patch Changes - -- Updated dependencies: - - `@trigger.dev/sdk@2.1.3` - - `@trigger.dev/integration-kit@2.1.3` - -## 2.1.2 - -### Patch Changes - -- Updated dependencies: - - `@trigger.dev/integration-kit@2.1.2` - - `@trigger.dev/sdk@2.1.2` - -## 2.1.1 - -### Patch Changes - -- Updated dependencies: - - `@trigger.dev/sdk@2.1.1` - - `@trigger.dev/integration-kit@2.1.1` - -## 2.1.0 - -### Minor Changes - -- Integrations are now simpler and support authentication during webhook registration ([`878da3c0`](https://github.com/triggerdotdev/trigger.dev/commit/878da3c01f0a4dfaf33a1f8943a7ad4eed8b8877)) - -### Patch Changes - -- Updated dependencies: - - `@trigger.dev/integration-kit@2.1.0` - - `@trigger.dev/sdk@2.1.0` - -## 2.1.0-beta.1 - -### Patch Changes - -- Updated dependencies: - - `@trigger.dev/integration-kit@2.1.0-beta.1` - - `@trigger.dev/sdk@2.1.0-beta.1` - -## 2.1.0-beta.0 - -### Minor Changes - -- Integrations are now simpler and support authentication during webhook registration ([`878da3c0`](https://github.com/triggerdotdev/trigger.dev/commit/878da3c01f0a4dfaf33a1f8943a7ad4eed8b8877)) - -### Patch Changes - -- Updated dependencies: - - `@trigger.dev/integration-kit@2.1.0-beta.0` - - `@trigger.dev/sdk@2.1.0-beta.0` - -## 2.0.14 - -### Patch Changes - -- Updated dependencies: - - `@trigger.dev/integration-kit@2.0.14` - - `@trigger.dev/sdk@2.0.14` - -## 2.0.13 - -### Patch Changes - -- Updated dependencies: - - `@trigger.dev/sdk@2.0.13` - - `@trigger.dev/integration-kit@2.0.13` - -## 2.0.12 - -### Patch Changes - -- @trigger.dev/integration-kit@2.0.12 -- @trigger.dev/sdk@2.0.12 - -## 2.0.11 - -### Patch Changes - -- Updated dependencies [ac98219b] -- Updated dependencies [302bd02f] -- Updated dependencies [b5db9f5e] -- Updated dependencies [3ce53970] - - @trigger.dev/sdk@2.0.11 - - @trigger.dev/integration-kit@2.0.11 - -## 2.0.10 - -### Patch Changes - -- Updated dependencies [b1b9321a] -- Updated dependencies [b1b9321a] - - @trigger.dev/sdk@2.0.10 - - @trigger.dev/integration-kit@2.0.10 - -## 2.0.9 - -### Patch Changes - -- @trigger.dev/integration-kit@2.0.9 -- @trigger.dev/sdk@2.0.9 - -## 2.0.8 - -### Patch Changes - -- @trigger.dev/integration-kit@2.0.8 -- @trigger.dev/sdk@2.0.8 - -## 2.0.7 - -### Patch Changes - -- Updated dependencies [84126808] - - @trigger.dev/integration-kit@2.0.7 - - @trigger.dev/sdk@2.0.7 - -## 2.0.6 - -### Patch Changes - -- @trigger.dev/integration-kit@2.0.6 -- @trigger.dev/sdk@2.0.6 - -## 2.0.5 - -### Patch Changes - -- @trigger.dev/integration-kit@2.0.5 -- @trigger.dev/sdk@2.0.5 - -## 2.0.4 - -### Patch Changes - -- Updated dependencies [96384991] - - @trigger.dev/sdk@2.0.4 - - @trigger.dev/integration-kit@2.0.4 - -## 2.0.3 - -### Patch Changes - -- @trigger.dev/integration-kit@2.0.3 -- @trigger.dev/sdk@2.0.3 - -## 2.0.2 - -### Patch Changes - -- ee99191f: Sync all package versions -- Updated dependencies [0a790de2] -- Updated dependencies [ee99191f] - - @trigger.dev/sdk@2.0.2 - - @trigger.dev/integration-kit@2.0.2 - -## 1.0.0 - -### Major Changes - -- 99316df8: Preparing packages for V2 - -### Patch Changes - -- 23adc15c: Fixed the broken export issue with two of the new tasks -- 28914b87: Creating the init CLI package -- fe3bc6ef: Missing token/apikey error improved for display in Next.js logs -- f01af9c0: Upgrade to zod 3.21.4 -- 34ccf345: Add support for task errors and task retrying -- bac8ad10: Throw if the clients are passed an undefined apikey or token -- d4da2f32: Added getIssue Task -- e4b0b1e3: Added support for backgroundFetch -- 32ff3f31: Fixed some properties that had API urls instead of HTML urls -- 2c0ea0c1: Set Node version to 16.8 and above -- fdf1b214: added git database tasks -- Updated dependencies [acaae993] -- Updated dependencies [92233f2e] -- Updated dependencies [cca7da9d] -- Updated dependencies [9138976d] -- Updated dependencies [486d6818] -- Updated dependencies [24542d4e] -- Updated dependencies [c34a02c0] -- Updated dependencies [5ee0b188] -- Updated dependencies [28914b87] -- Updated dependencies [99316df8] -- Updated dependencies [722fe7b7] -- Updated dependencies [1961b994] -- Updated dependencies [1dc42dae] -- Updated dependencies [d6310a79] -- Updated dependencies [817b4ed1] -- Updated dependencies [f01af9c0] -- Updated dependencies [6d4922f4] -- Updated dependencies [34ccf345] -- Updated dependencies [b314178d] -- Updated dependencies [69af845a] -- Updated dependencies [c83443a4] -- Updated dependencies [8e147dbe] -- Updated dependencies [2cbf50b1] -- Updated dependencies [92233f2e] -- Updated dependencies [b4167a38] -- Updated dependencies [931be399] -- Updated dependencies [facae926] -- Updated dependencies [6d04f6c6] -- Updated dependencies [a11ddf65] -- Updated dependencies [ba446524] -- Updated dependencies [6c869466] -- Updated dependencies [f2f4d4b8] -- Updated dependencies [e4b0b1e3] -- Updated dependencies [094f6f5a] -- Updated dependencies [2c0ea0c1] -- Updated dependencies [e26923eb] -- Updated dependencies [0066971b] -- Updated dependencies [c83443a4] -- Updated dependencies [99c6cd03] -- Updated dependencies [3ee396d7] -- Updated dependencies [7e2d48ac] -- Updated dependencies [86dbd5d1] -- Updated dependencies [f160b34b] -- Updated dependencies [aaa70a9a] -- Updated dependencies [61ed1fb2] -- Updated dependencies [01cf5f3b] -- Updated dependencies [9351c051] -- Updated dependencies [94cc28d3] -- Updated dependencies [953e7fc9] -- Updated dependencies [0012bb21] -- Updated dependencies [807b9d4c] -- Updated dependencies [64477f6b] -- Updated dependencies [7f6bf992] -- Updated dependencies [767e09ee] -- Updated dependencies [917a70fb] - - @trigger.dev/sdk@2.0.0 - - @trigger.dev/integration-kit@2.0.0 - -## 1.0.0-next.9 - -### Patch Changes - -- d4da2f32: Added getIssue Task - -## 1.0.0-next.8 - -### Patch Changes - -- fe3bc6ef: Missing token/apikey error improved for display in Next.js logs - -## 1.0.0-next.7 - -### Patch Changes - -- bac8ad10: Throw if the clients are passed an undefined apikey or token -- Updated dependencies [1dc42dae] -- Updated dependencies [d6310a79] -- Updated dependencies [0012bb21] - - @trigger.dev/sdk@2.0.0-next.16 - -## 1.0.0-next.6 - -### Patch Changes - -- 2c0ea0c1: Set Node version to 16.8 and above -- Updated dependencies [2c0ea0c1] - - @trigger.dev/integration-kit@2.0.0-next.5 - - @trigger.dev/sdk@2.0.0-next.15 - -## 1.0.0-next.5 - -### Patch Changes - -- f01af9c0: Upgrade to zod 3.21.4 -- Updated dependencies [f01af9c0] -- Updated dependencies [94cc28d3] - - @trigger.dev/sdk@2.0.0-next.12 - - @trigger.dev/integration-kit@2.0.0-next.4 - -## 1.0.0-next.4 - -### Patch Changes - -- 32ff3f31: Fixed some properties that had API urls instead of HTML urls -- Updated dependencies [acaae993] -- Updated dependencies [aaa70a9a] - - @trigger.dev/sdk@2.0.0-next.9 - -## 1.0.0-next.3 - -### Patch Changes - -- 23adc15c: Fixed the broken export issue with two of the new tasks - -## 1.0.0-next.2 - -### Patch Changes - -- 28914b87: Creating the init CLI package -- e4b0b1e3: Added support for backgroundFetch -- Updated dependencies [28914b87] -- Updated dependencies [817b4ed1] -- Updated dependencies [e4b0b1e3] - - @trigger.dev/integration-kit@2.0.0-next.2 - - @trigger.dev/sdk@2.0.0-next.2 - -## 1.0.0-next.1 - -### Patch Changes - -- Add support for task errors and task retrying -- Updated dependencies -- Updated dependencies [b4167a38] - - @trigger.dev/sdk@2.0.0-next.1 - -## 1.0.0-next.0 - -### Major Changes - -- 53c9bd56: Preparing packages for V2 - -### Patch Changes - -- Updated dependencies [53c9bd56] - - @trigger.dev/sdk@2.0.0-next.0 diff --git a/integrations/github/package.json b/integrations/github/package.json deleted file mode 100644 index 727ae1faa..000000000 --- a/integrations/github/package.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "name": "@trigger.dev/github", - "version": "3.0.0-beta.55", - "description": "The official GitHub integration for Trigger.dev", - "main": "./dist/index.js", - "types": "./dist/index.d.ts", - "publishConfig": { - "access": "public" - }, - "files": [ - "dist" - ], - "devDependencies": { - "@octokit/types": "^12.4.0", - "@octokit/webhooks-types": "^7.3.1", - "@trigger.dev/tsconfig": "workspace:*", - "@types/node": "18", - "rimraf": "^3.0.2", - "tsup": "8.0.1", - "@trigger.dev/tsup": "workspace:*", - "typescript": "^5.3.0" - }, - "scripts": { - "clean": "rimraf dist", - "build": "npm run clean && npm run build:tsup", - "build:tsup": "tsup" - }, - "dependencies": { - "@octokit/request": "^8.1.6", - "@octokit/request-error": "^5.0.1", - "@octokit/webhooks": "^12.0.10", - "octokit": "^3.1.2", - "@trigger.dev/integration-kit": "workspace:^3.0.0-beta.55", - "@trigger.dev/sdk": "workspace:^3.0.0-beta.55", - "zod": "3.22.3" - }, - "engines": { - "node": ">=16.8.0" - }, - "exports": { - ".": { - "import": { - "types": "./dist/index.d.mts", - "default": "./dist/index.mjs" - }, - "require": "./dist/index.js", - "types": "./dist/index.d.ts" - }, - "./package.json": "./package.json" - }, - "module": "./dist/index.mjs" -} diff --git a/integrations/github/src/compound.ts b/integrations/github/src/compound.ts deleted file mode 100644 index ae8c85f4c..000000000 --- a/integrations/github/src/compound.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { IntegrationTaskKey } from "@trigger.dev/sdk"; -import { Octokit } from "octokit"; -import { GitHubReturnType, GitHubRunTask, onError } from "./index"; -import { Issues } from "./issues"; -import { ReactionContent, Reactions } from "./reactions"; - -export class Compound { - constructor( - private runTask: GitHubRunTask, - public issues: Issues, - public reactions: Reactions - ) {} - - createIssueCommentWithReaction( - key: IntegrationTaskKey, - params: { - body: string; - owner: string; - repo: string; - issueNumber: number; - reaction: ReactionContent; - } - ): GitHubReturnType { - return this.runTask( - key, - async () => { - const comment = await this.issues.createComment( - `Comment on Issue #${params.issueNumber}`, - params - ); - const reaction = await this.reactions.createForIssueComment( - `React with ${params.reaction}`, - { - owner: params.owner, - repo: params.repo, - commentId: comment.id, - content: params.reaction, - } - ); - return comment; - }, - { - name: "Create Issue Comment", - params, - properties: [ - { - label: "Repo", - text: params.repo, - }, - { - label: "Issue", - text: `#${params.issueNumber}`, - }, - ], - }, - onError - ); - } -} diff --git a/integrations/github/src/git.ts b/integrations/github/src/git.ts deleted file mode 100644 index 34bfd9540..000000000 --- a/integrations/github/src/git.ts +++ /dev/null @@ -1,466 +0,0 @@ -import { IntegrationTaskKey } from "@trigger.dev/sdk"; -import { Octokit } from "octokit"; -import { GitHubReturnType, GitHubRunTask, onError } from "./index"; -import { repoProperties } from "./propertyHelpers"; - -type Endcoding = "utf-8" | "base-64"; - -type AuthorContent = { - name: string; - email: string; - date?: string; -}; - -type CommitterContent = { - name?: string; - email?: string; - date?: string; -}; - -type TagType = "commit" | "tree" | "blob"; - -type TaggerContent = { - name: string; - email: string; - date?: string; -}; - -type TreeType = { - path?: string | undefined; - mode?: "100644" | "100755" | "040000" | "160000" | "120000" | undefined; - type?: "commit" | "tree" | "blob" | undefined; - sha?: string | null | undefined; - content?: string | undefined; -}; - -export class Git { - constructor(private runTask: GitHubRunTask) {} - - createBlob( - key: IntegrationTaskKey, - params: { - owner: string; - repo: string; - content: string; - encoding?: Endcoding; - } - ): GitHubReturnType { - return this.runTask( - key, - async (client, task) => { - const result = await client.rest.git.createBlob({ - owner: params.owner, - repo: params.repo, - content: params.content, - encoding: params.encoding, - }); - return result.data; - }, - { - name: "Create Blob", - params, - properties: [ - ...repoProperties(params), - { - label: "Content", - text: params.content, - }, - ], - }, - onError - ); - } - - getBlob( - key: IntegrationTaskKey, - params: { - owner: string; - repo: string; - fileSHA: string; - } - ): GitHubReturnType { - return this.runTask( - key, - async (client, task) => { - const result = await client.rest.git.getBlob({ - owner: params.owner, - repo: params.repo, - file_sha: params.fileSHA, - }); - return result.data; - }, - { - name: "Get Blob", - params, - properties: [...repoProperties(params)], - }, - onError - ); - } - - createCommit( - key: IntegrationTaskKey, - params: { - owner: string; - repo: string; - message: string; - tree: string; - parents?: string[]; - author?: AuthorContent; - committer?: CommitterContent; - signature?: string; - } - ): GitHubReturnType { - return this.runTask( - key, - async (client, task) => { - const result = await client.rest.git.createCommit({ - ...params, - }); - return result.data; - }, - { - name: "Create Commit", - params, - properties: [ - ...repoProperties(params), - { - label: "Message", - text: params.message, - }, - { - label: "Tree", - text: params.tree, - }, - ], - }, - onError - ); - } - - getCommit( - key: IntegrationTaskKey, - params: { - owner: string; - repo: string; - commitSHA: string; - } - ): GitHubReturnType { - return this.runTask( - key, - async (client, task) => { - const result = await client.rest.git.getCommit({ - owner: params.owner, - repo: params.repo, - commit_sha: params.commitSHA, - }); - return result.data; - }, - { - name: "Get Commit", - params, - properties: [ - ...repoProperties(params), - { - label: "Commit SHA", - text: params.commitSHA, - }, - ], - }, - onError - ); - } - - listMatchingRefs( - key: IntegrationTaskKey, - params: { - owner: string; - repo: string; - ref: string; - } - ): GitHubReturnType { - return this.runTask( - key, - async (client, task) => { - const result = await client.rest.git.listMatchingRefs(params); - return result.data; - }, - { - name: "List Matching References", - params, - properties: [ - ...repoProperties(params), - { - label: "Ref", - text: params.ref, - }, - ], - }, - onError - ); - } - - getRef( - key: IntegrationTaskKey, - params: { - owner: string; - repo: string; - ref: string; - } - ): GitHubReturnType { - return this.runTask( - key, - async (client, task) => { - const result = await client.rest.git.getRef(params); - return result.data; - }, - { - name: "Get Reference", - params, - properties: [ - ...repoProperties(params), - { - label: "Ref", - text: params.ref, - }, - ], - }, - onError - ); - } - - createRef( - key: IntegrationTaskKey, - params: { - owner: string; - repo: string; - ref: string; - sha: string; - } - ): GitHubReturnType { - return this.runTask( - key, - async (client, task) => { - const result = await client.rest.git.createRef(params); - return result.data; - }, - { - name: "Create Reference", - params, - properties: [ - ...repoProperties(params), - { - label: "Ref", - text: params.ref, - }, - { - label: "SHA", - text: params.ref, - }, - ], - }, - onError - ); - } - - updateRef( - key: IntegrationTaskKey, - params: { - owner: string; - repo: string; - ref: string; - sha: string; - force?: boolean; - } - ): GitHubReturnType { - return this.runTask( - key, - async (client, task) => { - const result = await client.rest.git.updateRef(params); - return result.data; - }, - { - name: "Update Reference", - params, - properties: [ - ...repoProperties(params), - { - label: "Ref", - text: params.ref, - }, - { - label: "SHA", - text: params.ref, - }, - ], - }, - onError - ); - } - - deleteRef( - key: IntegrationTaskKey, - params: { - owner: string; - repo: string; - ref: string; - } - ): GitHubReturnType { - return this.runTask( - key, - async (client, task) => { - const result = await client.rest.git.deleteRef(params); - return result.data; - }, - { - name: "Delete Reference", - params, - properties: [ - ...repoProperties(params), - { - label: "Ref", - text: params.ref, - }, - ], - }, - onError - ); - } - - createTag( - key: IntegrationTaskKey, - params: { - owner: string; - repo: string; - tag: string; - message: string; - object: string; - type: TagType; - tagger?: TaggerContent; - } - ): GitHubReturnType { - return this.runTask( - key, - async (client, task) => { - const result = await client.rest.git.createTag(params); - return result.data; - }, - { - name: "Create Tag", - params, - properties: [ - ...repoProperties(params), - { - label: "Tag", - text: params.tag, - }, - { - label: "Message", - text: params.message, - }, - { - label: "Object", - text: params.object, - }, - { - label: "Tag Type", - text: params.type, - }, - ], - }, - onError - ); - } - - getTag( - key: IntegrationTaskKey, - params: { - owner: string; - repo: string; - tagSHA: string; - } - ): GitHubReturnType { - return this.runTask( - key, - async (client, task) => { - const result = await client.rest.git.getTag({ - owner: params.owner, - repo: params.repo, - tag_sha: params.tagSHA, - }); - return result.data; - }, - { - name: "Get Tag", - params, - properties: [ - ...repoProperties(params), - { - label: "Tag SHA", - text: params.tagSHA, - }, - ], - }, - onError - ); - } - - createTree( - key: IntegrationTaskKey, - params: { - owner: string; - repo: string; - tree: TreeType[]; - baseTree?: string; - } - ): GitHubReturnType { - return this.runTask( - key, - async (client, task) => { - const result = await client.rest.git.createTree(params); - return result.data; - }, - { - name: "Create Tree", - params, - properties: [...repoProperties(params)], - }, - onError - ); - } - - getTree( - key: IntegrationTaskKey, - params: { - owner: string; - repo: string; - treeSHA: string; - recursive?: string; - } - ): GitHubReturnType { - return this.runTask( - key, - async (client, task) => { - const result = await client.rest.git.getTree({ - owner: params.owner, - repo: params.repo, - tree_sha: params.treeSHA, - recursive: params.recursive, - }); - return result.data; - }, - { - name: "Get Tree", - params, - properties: [ - ...repoProperties(params), - { - label: "Tree SHA", - text: params.treeSHA, - }, - ], - }, - onError - ); - } -} diff --git a/integrations/github/src/index.ts b/integrations/github/src/index.ts deleted file mode 100644 index 0716e849b..000000000 --- a/integrations/github/src/index.ts +++ /dev/null @@ -1,628 +0,0 @@ -import { RequestError } from "@octokit/request-error"; -import { RequestRequestOptions } from "@octokit/types"; -import { - CreateEvent, - IssueCommentEvent, - IssuesAssignedEvent, - IssuesEvent, - IssuesOpenedEvent, - PullRequestEvent, - PullRequestReviewEvent, - PushEvent, - RepositoryCreatedEvent, - StarCreatedEvent, - StarEvent, -} from "@octokit/webhooks-types"; -import { truncate } from "@trigger.dev/integration-kit"; -import { - ConnectionAuth, - EventSpecification, - ExternalSourceTrigger, - IO, - IOTask, - IntegrationTaskKey, - Json, - RunTaskErrorCallback, - RunTaskOptions, - TriggerIntegration, - retry, -} from "@trigger.dev/sdk"; -import { Octokit } from "octokit"; -import { createOrgEventSource, createRepoEventSource } from "./sources"; -import { - issueAssigned, - issueCommentCreated, - issueOpened, - newBranch, - pullRequestOpened, - pullRequestReviewSubmitted, - push, - starredRepo, -} from "./webhook-examples"; -import { Issues } from "./issues"; -import { Repos } from "./repos"; -import { Reactions } from "./reactions"; -import { Compound } from "./compound"; -import { Orgs } from "./orgs"; -import { Git } from "./git"; - -export type GithubIntegrationOptions = { - id: string; - token?: string; - octokitRequest?: RequestRequestOptions; -}; - -type GithubSources = { - repo: ReturnType; - org: ReturnType; -}; - -type GithubTriggers = { - repo: ReturnType; - org: ReturnType; -}; - -export type GitHubRunTask = InstanceType["runTask"]; -export type GitHubReturnType Promise<{ data: K }>, K = any> = Promise< - Awaited>["data"] ->; - -export class Github implements TriggerIntegration { - // @internal - private _options: GithubIntegrationOptions; - // @internal - private _client?: Octokit; - // @internal - private _io?: IO; - // @internal - private _connectionKey?: string; - - _repoSource: ReturnType; - _orgSource: ReturnType; - _repoTrigger: ReturnType; - _orgTrigger: ReturnType; - - constructor(private options: GithubIntegrationOptions) { - if (Object.keys(options).includes("token") && !options.token) { - throw `Can't create GitHub integration (${options.id}) as token was undefined`; - } - - this._options = options; - - this._repoSource = createRepoEventSource(this); - this._orgSource = createOrgEventSource(this); - this._repoTrigger = createRepoTrigger(this._repoSource); - this._orgTrigger = createOrgTrigger(this._orgSource); - } - - get id() { - return this.options.id; - } - - get metadata() { - return { name: "GitHub", id: "github" }; - } - - get authSource() { - return this._options.token ? ("LOCAL" as const) : ("HOSTED" as const); - } - - cloneForRun(io: IO, connectionKey: string, auth?: ConnectionAuth) { - const github = new Github(this._options); - github._io = io; - github._connectionKey = connectionKey; - github._client = createClientFromOptions(this._options, auth); - return github; - } - - get sources(): GithubSources { - return { - repo: this._repoSource, - org: this._orgSource, - }; - } - - get triggers(): GithubTriggers { - return { - repo: this._repoTrigger, - org: this._orgTrigger, - }; - } - - runTask | void>( - key: IntegrationTaskKey, - callback: (client: Octokit, task: IOTask, io: IO) => Promise, - options?: RunTaskOptions, - errorCallback?: RunTaskErrorCallback - ): Promise { - if (!this._io) throw new Error("No IO"); - if (!this._connectionKey) throw new Error("No connection key"); - - return this._io.runTask( - key, - (task, io) => { - if (!this._client) throw new Error("No client"); - return callback(this._client, task, io); - }, - { - icon: "github", - retry: retry.standardBackoff, - ...(options ?? {}), - connectionKey: this._connectionKey, - }, - errorCallback - ); - } - - get issues() { - return new Issues(this.runTask.bind(this)); - } - - get repos() { - return new Repos(this.runTask.bind(this)); - } - - get reactions() { - return new Reactions(this.runTask.bind(this)); - } - - get compound() { - return new Compound(this.runTask.bind(this), this.issues, this.reactions); - } - - get orgs() { - return new Orgs(this.runTask.bind(this)); - } - - get git() { - return new Git(this.runTask.bind(this)); - } - - createIssue = this.issues.create; - addIssueAssignees = this.issues.addAssignees; - addIssueLabels = this.issues.addLabels; - createIssueComment = this.issues.createComment; - getIssue = this.issues.get; - getRepo = this.repos.get; - updateWebhook = this.repos.updateWebhook; - createWebhook = this.repos.createWebhook; - listWebhooks = this.repos.listWebhooks; - addIssueCommentReaction = this.reactions.createForIssueComment; - createIssueCommentWithReaction = this.compound.createIssueCommentWithReaction; - updateOrgWebhook = this.orgs.updateWebhook; - createOrgWebhook = this.orgs.createWebhook; - listOrgWebhooks = this.orgs.listWebhooks; - createBlob = this.git.createBlob; - getBlob = this.git.getBlob; - createCommit = this.git.createCommit; - getCommit = this.git.getCommit; - listMatchingReferences = this.git.listMatchingRefs; - getReference = this.git.getRef; - createReference = this.git.createRef; - updateReference = this.git.updateRef; - deleteReference = this.git.deleteRef; - createTag = this.git.createTag; - getTag = this.git.getTag; - createTree = this.git.createTree; - getTree = this.git.getTree; -} - -function createClientFromOptions( - options: GithubIntegrationOptions, - auth?: ConnectionAuth -): Octokit { - if (Object.keys(options).includes("token") && !options.token) { - throw `Can't create GitHub integration (${options.id}) as token was undefined`; - } - - if (options.token) { - return new Octokit({ - auth: options.token, - request: options.octokitRequest, - retry: { - enabled: false, - }, - }); - } - - if (!auth) { - throw new Error("No auth"); - } - - return new Octokit({ - auth: auth.accessToken, - request: options.octokitRequest, - retry: { - enabled: false, - }, - }); -} - -const onIssue: EventSpecification = { - name: "issues", - title: "On issue", - source: "github.com", - icon: "github", - examples: [issueOpened, issueAssigned], - parsePayload: (payload) => payload as IssuesEvent, - runProperties: (payload) => issueProperties(payload), -}; - -const onIssueOpened: EventSpecification = { - name: "issues", - title: "On issue opened", - source: "github.com", - icon: "github", - filter: { - action: ["opened"], - }, - examples: [issueOpened], - parsePayload: (payload) => payload as IssuesOpenedEvent, - runProperties: (payload) => issueProperties(payload), -}; - -const onIssueAssigned: EventSpecification = { - name: "issues", - title: "On issue assigned", - source: "github.com", - icon: "github", - filter: { - action: ["assigned"], - }, - examples: [issueAssigned], - parsePayload: (payload) => payload as IssuesAssignedEvent, - runProperties: (payload) => [ - ...issueProperties(payload), - { - label: "Assignee", - text: payload.assignee?.login ?? "none", - url: payload.assignee?.html_url, - }, - ], -}; - -const onIssueComment: EventSpecification = { - name: "issue_comment", - title: "On issue comment", - source: "github.com", - icon: "github", - examples: [issueCommentCreated], - parsePayload: (payload) => payload as IssueCommentEvent, - runProperties: (payload) => [ - ...issueProperties(payload), - { - label: "Comment body", - text: truncate(payload.comment.body, 40), - url: payload.comment.html_url, - }, - ], -}; - -function issueProperties(payload: IssuesEvent | IssueCommentEvent) { - return [ - { - label: "Issue", - text: `#${payload.issue.number}: ${payload.issue.title}`, - url: payload.issue.html_url, - }, - { - label: "Author", - text: payload.sender.login, - url: payload.sender.html_url, - }, - ]; -} - -const onStar: EventSpecification = { - name: "star", - title: "On star", - source: "github.com", - icon: "github", - examples: [starredRepo], - parsePayload: (payload) => payload as StarEvent, - runProperties: (payload) => starProperties(payload), -}; - -const onNewStar: EventSpecification = { - name: "star", - title: "On new star", - source: "github.com", - icon: "github", - filter: { - action: ["created"], - }, - examples: [starredRepo], - parsePayload: (payload) => payload as StarCreatedEvent, - runProperties: (payload) => starProperties(payload), -}; - -function starProperties(payload: StarEvent) { - return [ - { - label: "Repo", - text: `${payload.repository.name}`, - url: payload.repository.html_url, - }, - { - label: "Author", - text: payload.sender.login, - url: payload.sender.html_url, - }, - { - label: "Star count", - text: `${payload.repository.stargazers_count}`, - url: payload.repository.stargazers_url, - }, - ]; -} - -const onNewRepository: EventSpecification = { - name: "repository", - title: "On new repository", - source: "github.com", - icon: "github", - filter: { - action: ["created"], - }, - parsePayload: (payload) => payload as RepositoryCreatedEvent, -}; - -const onNewBranchOrTag: EventSpecification = { - name: "create", - title: "On new branch or tag", - source: "github.com", - icon: "github", - parsePayload: (payload) => payload as CreateEvent, - runProperties: (payload) => branchTagProperties(payload), -}; - -const onNewBranch: EventSpecification = { - name: "create", - title: "On new branch tag", - source: "github.com", - icon: "github", - filter: { - ref_type: ["branch"], - }, - examples: [newBranch], - parsePayload: (payload) => payload as CreateEvent, - runProperties: (payload) => branchTagProperties(payload), -}; - -function branchTagProperties(payload: CreateEvent) { - return [ - { - label: "Repo", - text: payload.repository.name, - url: payload.repository.html_url, - }, - { - label: payload.ref_type === "branch" ? "Branch" : "Tag", - text: payload.ref, - }, - ]; -} - -const onPush: EventSpecification = { - name: "push", - title: "On push", - source: "github.com", - icon: "github", - examples: [push], - parsePayload: (payload) => payload as PushEvent, - runProperties: (payload) => { - let props = [ - { - label: "Repo", - text: payload.repository.name, - url: payload.repository.html_url, - }, - { - label: "Branch", - text: payload.ref, - }, - { - label: "Pusher", - text: payload.pusher.name, - }, - { - label: "Commits", - text: `${payload.commits.length}`, - }, - ]; - - if (payload.head_commit) { - props.push({ - label: "Head commit", - text: payload.head_commit.id, - url: payload.head_commit.url, - }); - } - - return props; - }, -}; - -const onPullRequest: EventSpecification = { - name: "pull_request", - title: "On pull request", - source: "github.com", - icon: "github", - examples: [pullRequestOpened], - parsePayload: (payload) => payload as PullRequestEvent, - runProperties: (payload) => [ - { - label: "Repo", - text: payload.repository.name, - url: payload.repository.html_url, - }, - { - label: "action", - text: payload.action, - }, - { - label: "Number", - text: `${payload.number}`, - }, - { - label: "Title", - text: payload.pull_request.title, - }, - { - label: "Author", - text: payload.pull_request.user.login, - url: payload.pull_request.user.html_url, - }, - { - label: "Commits", - text: `${payload.pull_request.commits}`, - }, - { - label: "Body", - text: truncate(payload.pull_request.body ?? "none", 40), - }, - ], -}; - -const onPullRequestReview: EventSpecification = { - name: "pull_request_review", - title: "On pull request review", - source: "github.com", - icon: "github", - examples: [pullRequestReviewSubmitted], - parsePayload: (payload) => payload as PullRequestReviewEvent, - runProperties: (payload) => [ - { - label: "Repo", - text: payload.repository.name, - url: payload.repository.html_url, - }, - { - label: "action", - text: payload.action, - }, - { - label: "Author", - text: payload.review.user.login, - url: payload.review.user.html_url, - }, - { - label: "Body", - text: truncate(payload.review.body ?? "none", 40), - }, - { - label: "PR Number", - text: `${payload.pull_request.number}`, - }, - { - label: "PR Title", - text: payload.pull_request.title, - }, - ], -}; - -export const events = { - /** When any action is performed on an issue */ - onIssue, - /** When an issue is opened */ - onIssueOpened, - /** When an issue is assigned */ - onIssueAssigned, - /** When an issue is commented on */ - onIssueComment, - /** When a repo is starred or unstarred */ - onStar, - /** When a repo is starred */ - onNewStar, - /** When a new repo is created */ - onNewRepository, - /** When a new branch or tag is created */ - onNewBranchOrTag, - /** When a new branch is created */ - onNewBranch, - /** When a push is made to a repo */ - onPush, - /** When activity occurs on a pull request. Doesn't include reviews, issues or comments. */ - onPullRequest, - /** When Pull Request review has activity. */ - onPullRequestReview, -}; - -// params.event has to be a union of all the values of the exports events object -type GitHubEvents = (typeof events)[keyof typeof events]; - -type CreateRepoTriggerReturnType = (args: { - event: TEventSpecification; - owner: string; - repo: string; -}) => ExternalSourceTrigger>; - -function createRepoTrigger( - source: ReturnType -): CreateRepoTriggerReturnType { - return ({ - event, - owner, - repo, - }: { - event: TEventSpecification; - owner: string; - repo: string; - }) => { - return new ExternalSourceTrigger({ - event, - params: { owner, repo }, - source, - options: {}, - }); - }; -} - -type CreateOrgTriggerReturnType = (args: { - event: TEventSpecification; - org: string; -}) => ExternalSourceTrigger>; - -function createOrgTrigger( - source: ReturnType -): CreateOrgTriggerReturnType { - return ({ - event, - org, - }: { - event: TEventSpecification; - org: string; - }) => { - return new ExternalSourceTrigger({ - event, - params: { org }, - source, - options: {}, - }); - }; -} - -export function isRequestError(error: unknown): error is RequestError { - return typeof error === "object" && error !== null && "status" in error; -} - -export function onError(error: unknown) { - if (!isRequestError(error)) { - return; - } - - // Check if this is a rate limit error - if (error.status === 403 && error.response) { - const rateLimitRemaining = error.response.headers["x-ratelimit-remaining"]; - const rateLimitReset = error.response.headers["x-ratelimit-reset"]; - - if (rateLimitRemaining === "0" && rateLimitReset) { - const resetDate = new Date(Number(rateLimitReset) * 1000); - - return { - retryAt: resetDate, - error, - }; - } - } -} diff --git a/integrations/github/src/issues.ts b/integrations/github/src/issues.ts deleted file mode 100644 index 80eea7955..000000000 --- a/integrations/github/src/issues.ts +++ /dev/null @@ -1,148 +0,0 @@ -import { truncate } from "@trigger.dev/integration-kit"; -import { IntegrationTaskKey, Prettify, retry } from "@trigger.dev/sdk"; -import { GitHubReturnType, GitHubRunTask, onError } from "./index"; -import { Octokit } from "octokit"; -import { issueProperties, repoProperties } from "./propertyHelpers"; - -type AddIssueLabels = GitHubReturnType; -export class Issues { - constructor(private runTask: GitHubRunTask) {} - - create( - key: IntegrationTaskKey, - params: { title: string; owner: string; repo: string } - ): GitHubReturnType { - return this.runTask( - key, - async (client, task) => { - const result = await client.rest.issues.create({ - owner: params.owner, - repo: params.repo, - title: params.title, - }); - return result.data; - }, - { - name: "Create Issue", - params, - properties: [ - ...repoProperties(params), - { - label: "Title", - text: params.title, - }, - ], - }, - onError - ); - } - - addAssignees( - key: IntegrationTaskKey, - params: { owner: string; repo: string; issueNumber: number; assignees: string[] } - ): GitHubReturnType { - return this.runTask( - key, - async (client, task) => { - const result = await client.rest.issues.addAssignees({ - owner: params.owner, - repo: params.repo, - issue_number: params.issueNumber, - assignees: params.assignees, - }); - return result.data; - }, - { - name: "Add Issue Assignees", - params, - properties: [ - ...repoProperties(params), - ...issueProperties(params), - { - label: "assignees", - text: params.assignees.join(", "), - }, - ], - }, - onError - ); - } - - addLabels( - key: IntegrationTaskKey, - params: { owner: string; repo: string; issueNumber: number; labels: string[] } - ): AddIssueLabels { - return this.runTask( - key, - async (client, task) => { - const result = await client.rest.issues.addLabels({ - owner: params.owner, - repo: params.repo, - issue_number: params.issueNumber, - labels: params.labels, - }); - return result.data; - }, - { - name: "Add Issue Labels", - params, - properties: [ - ...repoProperties(params), - ...issueProperties(params), - { - label: "Labels", - text: params.labels.join(", "), - }, - ], - }, - onError - ); - } - - createComment( - key: IntegrationTaskKey, - params: { body: string; owner: string; repo: string; issueNumber: number } - ): GitHubReturnType { - return this.runTask( - key, - async (client, task) => { - const result = await client.rest.issues.createComment({ - owner: params.owner, - repo: params.repo, - body: params.body, - issue_number: params.issueNumber, - }); - return result.data; - }, - { - name: "Create Issue Comment", - params, - properties: [...repoProperties(params), ...issueProperties(params)], - }, - onError - ); - } - - get( - key: IntegrationTaskKey, - params: { owner: string; repo: string; issueNumber: number } - ): GitHubReturnType { - return this.runTask( - key, - async (client, task) => { - const result = await client.rest.issues.get({ - owner: params.owner, - repo: params.repo, - issue_number: params.issueNumber, - }); - return result.data; - }, - { - name: "Get Issue", - params, - properties: [...repoProperties(params), ...issueProperties(params)], - }, - onError - ); - } -} diff --git a/integrations/github/src/orgs.ts b/integrations/github/src/orgs.ts deleted file mode 100644 index 495aeb7b4..000000000 --- a/integrations/github/src/orgs.ts +++ /dev/null @@ -1,120 +0,0 @@ -import { IntegrationTaskKey } from "@trigger.dev/sdk"; -import { Octokit } from "octokit"; -import { GitHubReturnType, GitHubRunTask, onError } from "./index"; - -export class Orgs { - constructor(private runTask: GitHubRunTask) {} - - updateWebhook( - key: IntegrationTaskKey, - params: { - org: string; - hookId: number; - url: string; - secret: string; - addEvents?: string[]; - } - ): GitHubReturnType { - return this.runTask( - key, - async (client, task) => { - const result = await client.rest.orgs.updateWebhook({ - org: params.org, - hook_id: params.hookId, - config: { - content_type: "json", - url: params.url, - secret: params.secret, - }, - add_events: params.addEvents, - }); - return result.data; - }, - { - name: "Update Org Webhook", - params, - properties: [ - { - label: "Org", - text: params.org, - }, - { - label: "Hook ID", - text: String(params.hookId), - }, - ], - }, - onError - ); - } - - createWebhook( - key: IntegrationTaskKey, - params: { - org: string; - url: string; - secret: string; - events: string[]; - } - ): GitHubReturnType { - return this.runTask( - key, - async (client, task) => { - const result = await client.rest.orgs.createWebhook({ - org: params.org, - name: "web", - config: { - content_type: "json", - url: params.url, - secret: params.secret, - }, - events: params.events, - }); - return result.data; - }, - { - name: "Create Org Webhook", - params, - properties: [ - { - label: "Org", - text: params.org, - }, - { - label: "Events", - text: params.events.join(", "), - }, - ], - }, - onError - ); - } - - listWebhooks( - key: IntegrationTaskKey, - params: { - org: string; - } - ): GitHubReturnType { - return this.runTask( - key, - async (client, task) => { - const result = await client.rest.orgs.listWebhooks({ - org: params.org, - }); - return result.data; - }, - { - name: "List Org Webhooks", - params, - properties: [ - { - label: "Org", - text: params.org, - }, - ], - }, - onError - ); - } -} diff --git a/integrations/github/src/propertyHelpers.ts b/integrations/github/src/propertyHelpers.ts deleted file mode 100644 index 86f03e22e..000000000 --- a/integrations/github/src/propertyHelpers.ts +++ /dev/null @@ -1,21 +0,0 @@ -export function repoProperties(params: { owner: string; repo: string }) { - return [ - { - label: "Owner", - text: params.owner, - }, - { - label: "Repo", - text: params.repo, - }, - ]; -} - -export function issueProperties(params: { issueNumber: number }) { - return [ - { - label: "Issue", - text: `#${params.issueNumber}`, - }, - ]; -} diff --git a/integrations/github/src/reactions.ts b/integrations/github/src/reactions.ts deleted file mode 100644 index e3b3c10d6..000000000 --- a/integrations/github/src/reactions.ts +++ /dev/null @@ -1,87 +0,0 @@ -import { truncate } from "@trigger.dev/integration-kit"; -import { IntegrationTaskKey, Prettify, retry } from "@trigger.dev/sdk"; -import { GitHubReturnType, GitHubRunTask, onError } from "./index"; -import { Octokit } from "octokit"; -import { issueProperties, repoProperties } from "./propertyHelpers"; - -export type ReactionContent = - | "+1" - | "-1" - | "laugh" - | "confused" - | "heart" - | "hooray" - | "rocket" - | "eyes"; - -export class Reactions { - constructor(private runTask: GitHubRunTask) {} - - createForIssueComment( - key: IntegrationTaskKey, - params: { - owner: string; - repo: string; - commentId: number; - content: ReactionContent; - } - ): GitHubReturnType { - let emoji = ""; - - switch (params.content) { - case "+1": - emoji = "👍"; - break; - case "-1": - emoji = "👎"; - break; - case "laugh": - emoji = "😄"; - break; - case "confused": - emoji = "😕"; - break; - case "heart": - emoji = "❤️"; - break; - case "hooray": - emoji = "🎉"; - break; - case "rocket": - emoji = "🚀"; - break; - case "eyes": - emoji = "👀"; - break; - } - - return this.runTask( - key, - async (client, task) => { - const result = await client.rest.reactions.createForIssueComment({ - owner: params.owner, - repo: params.repo, - comment_id: params.commentId, - content: params.content, - }); - return result.data; - }, - { - name: "Add Issue Reaction", - params, - properties: [ - { - label: "Repo", - text: params.repo, - }, - { - label: "Comment", - text: `#${params.commentId}`, - }, - { label: "reaction", text: emoji }, - ], - }, - onError - ); - } -} diff --git a/integrations/github/src/repos.ts b/integrations/github/src/repos.ts deleted file mode 100644 index 50d569085..000000000 --- a/integrations/github/src/repos.ts +++ /dev/null @@ -1,167 +0,0 @@ -import { IntegrationTaskKey } from "@trigger.dev/sdk"; -import { Octokit } from "octokit"; -import { GitHubReturnType, GitHubRunTask, onError } from "./index"; - -export class Repos { - constructor(private runTask: GitHubRunTask) {} - - get( - key: IntegrationTaskKey, - params: { owner: string; repo: string } - ): GitHubReturnType { - return this.runTask( - key, - async (client, task) => { - const result = await client.rest.repos.get({ - owner: params.owner, - repo: params.repo, - headers: { - "x-trigger-attempt": String(task.attempts), - }, - }); - return result.data; - }, - { - name: "Get Repo", - params, - properties: [ - { - label: "Repo", - text: params.repo, - }, - ], - }, - onError - ); - } - - updateWebhook( - key: IntegrationTaskKey, - params: { - owner: string; - repo: string; - hookId: number; - url: string; - secret: string; - addEvents?: string[]; - } - ): GitHubReturnType { - return this.runTask( - key, - async (client, task) => { - const result = await client.rest.repos.updateWebhook({ - owner: params.owner, - repo: params.repo, - hook_id: params.hookId, - config: { - content_type: "json", - url: params.url, - secret: params.secret, - }, - add_events: params.addEvents, - }); - return result.data; - }, - { - name: "Update Webhook", - params, - properties: [ - { - label: "Owner", - text: params.owner, - }, - { - label: "Repo", - text: params.repo, - }, - { - label: "Hook ID", - text: String(params.hookId), - }, - ], - }, - onError - ); - } - - createWebhook( - key: IntegrationTaskKey, - params: { - owner: string; - repo: string; - url: string; - secret: string; - events: string[]; - } - ): GitHubReturnType { - return this.runTask( - key, - async (client, task) => { - const result = await client.rest.repos.createWebhook({ - owner: params.owner, - repo: params.repo, - config: { - content_type: "json", - url: params.url, - secret: params.secret, - }, - events: params.events, - }); - return result.data; - }, - { - name: "Create Webhook", - params, - properties: [ - { - label: "Owner", - text: params.owner, - }, - { - label: "Repo", - text: params.repo, - }, - { - label: "Events", - text: params.events.join(", "), - }, - ], - }, - onError - ); - } - - listWebhooks( - key: IntegrationTaskKey, - params: { - owner: string; - repo: string; - } - ): GitHubReturnType { - return this.runTask( - key, - async (client, task) => { - const result = await client.rest.repos.listWebhooks({ - owner: params.owner, - repo: params.repo, - }); - return result.data; - }, - { - name: "List Webhooks", - params, - properties: [ - { - label: "Owner", - text: params.owner, - }, - { - label: "Repo", - text: params.repo, - }, - ], - }, - onError - ); - } -} diff --git a/integrations/github/src/sources.ts b/integrations/github/src/sources.ts deleted file mode 100644 index adcd8fdae..000000000 --- a/integrations/github/src/sources.ts +++ /dev/null @@ -1,296 +0,0 @@ -import { Webhooks } from "@octokit/webhooks"; -import { omit, safeJsonParse } from "@trigger.dev/integration-kit"; -import type { Logger } from "@trigger.dev/sdk"; -import { ExternalSource, HandlerEvent } from "@trigger.dev/sdk"; -import { z } from "zod"; -import { Github } from "./index"; -import { Buffer } from "node:buffer"; - -type WebhookData = { - id: number; - active: boolean; - events: string[]; - config: { - url: string; - }; -}; - -function webhookData(data: any): data is WebhookData { - return ( - typeof data === "object" && - data !== null && - typeof data.id === "number" && - typeof data.config === "object" - ); -} - -export function createRepoEventSource( - integration: Github -): ExternalSource { - return new ExternalSource("HTTP", { - id: "github.repo", - version: "0.1.1", - schema: z.object({ owner: z.string(), repo: z.string() }), - integration, - key: (params) => `${params.owner}/${params.repo}`, - properties: (params) => [ - { - label: "Owner", - text: params.owner, - url: `https://github.com/${params.owner}`, - }, - { - label: "Repo", - text: params.repo, - url: `https://github.com/${params.owner}/${params.repo}`, - }, - ], - filter: (params) => ({ - repository: { - full_name: [`${params.owner}/${params.repo}`], - }, - }), - handler: webhookHandler, - register: async (event, io, ctx) => { - const { params, source: httpSource, options } = event; - - const registeredOptions = { - event: options.event.desired, - }; - - if (httpSource.active && webhookData(httpSource.data)) { - const hasMissingOptions = Object.values(options).some( - (option) => option.missing.length > 0 - ); - if (!hasMissingOptions) return; - - // We need to update the webhook to add the new events and then return - const newWebhookData = await io.integration.updateWebhook("update-webhook", { - owner: params.owner, - repo: params.repo, - hookId: httpSource.data.id, - url: httpSource.url, - secret: httpSource.secret, - addEvents: options.event.missing, - }); - - return { - data: newWebhookData, - options: registeredOptions, - }; - } - - const webhooks = await io.integration.listWebhooks("list-webhooks", { - owner: params.owner, - repo: params.repo, - }); - - const existingWebhook = webhooks.find((w) => w.config.url === httpSource.url); - - // There is an existing webhook, but it's not synced with Trigger.dev, so we need to update it with the secret - if (existingWebhook && existingWebhook.active) { - const updatedWebhook = await io.integration.updateWebhook("update-webhook", { - owner: params.owner, - repo: params.repo, - hookId: existingWebhook.id, - url: httpSource.url, - secret: httpSource.secret, - addEvents: options.event.missing, - }); - - return { - data: updatedWebhook, - options: registeredOptions, - }; - } - - const webhook = await io.integration.createWebhook("create-webhook", { - owner: params.owner, - repo: params.repo, - events: options.event.desired, - url: httpSource.url, - secret: httpSource.secret, - }); - - return { data: webhook, options: registeredOptions }; - }, - }); -} - -export function createOrgEventSource( - integration: Github -): ExternalSource { - return new ExternalSource("HTTP", { - id: "github.org", - version: "0.1.1", - integration, - schema: z.object({ org: z.string() }), - key: (params) => params.org, - properties: (params) => [ - { - label: "Org", - text: params.org, - url: `https://github.com/${params.org}`, - }, - ], - filter: (params) => ({ - organization: { - login: [params.org], - }, - }), - handler: webhookHandler, - register: async (event, io, ctx) => { - const { params, source: httpSource, options } = event; - - const registeredOptions = { - event: options.event.desired, - }; - - const hasMissingOptions = Object.values(options).some((option) => option.missing.length > 0); - - if ( - httpSource.active && - webhookData(httpSource.data) && - httpSource.secret && - hasMissingOptions - ) { - const existingData = httpSource.data; - - // We need to update the webhook to add the new events and then return - const newWebhookData = await io.integration.updateOrgWebhook("update-webhook", { - org: params.org, - hookId: existingData.id, - url: httpSource.url, - secret: httpSource.secret, - addEvents: options.event.missing, - }); - - return { - secret: httpSource.secret, - data: newWebhookData, - options: registeredOptions, - }; - } - - const webhooks = await io.integration.listOrgWebhooks("list-webhooks", { - org: params.org, - }); - - const existingWebhook = webhooks.find((w) => w.config.url === httpSource.url); - - const secret = Math.random().toString(36).slice(2); - - if (existingWebhook && existingWebhook.active) { - const updatedWebhook = await io.integration.updateOrgWebhook("update-webhook", { - org: params.org, - hookId: existingWebhook.id, - url: httpSource.url, - secret, - }); - - return { - secret, - data: updatedWebhook, - options: registeredOptions, - }; - } - - const webhook = await io.integration.createOrgWebhook("create-webhook", { - org: params.org, - events: options.event.desired, - url: httpSource.url, - secret, - }); - - return { secret, data: webhook, options: registeredOptions }; - }, - }); -} - -// Parses the body of a request -// If it's a Buffer, it will be parsed as JSON -function parseBody(body: any) { - if (Buffer.isBuffer(body)) { - return safeJsonParse(body.toString()); - } - - if (typeof body === "string") { - return safeJsonParse(body); - } - - return body; -} - -async function webhookHandler(event: HandlerEvent<"HTTP">, logger: Logger) { - logger.debug("[inside github integration] Handling github repo event"); - - const { rawEvent: request, source } = event; - - if (!request.body) { - logger.debug("[inside github integration] No body found"); - - return; - } - - const rawBody = await request.text(); - - const deliveryId = request.headers.get("x-github-delivery"); - const hookId = request.headers.get("x-github-hook-id"); - const signature = request.headers.get("x-hub-signature-256"); - - if (source.secret && signature) { - const githubWebhooks = new Webhooks({ - secret: source.secret, - }); - - if (!githubWebhooks.verify(rawBody, signature)) { - logger.debug("[inside github integration] Unable to verify the signature of the rawBody", { - signature, - secret: source.secret, - }); - - return; - } - } - - const name = request.headers.get("x-github-event") ?? "unknown"; - const allHeaders = Object.fromEntries(request.headers.entries()); - - const context = omit(allHeaders, [ - "x-github-event", - "x-github-delivery", - "x-hub-signature-256", - "x-hub-signature", - "content-type", - "content-length", - "accept", - "accept-encoding", - "x-forwarded-proto", - ]); - - const payload = parseBody(rawBody); - - if (!payload) { - logger.debug("[inside github integration] Unable to parse the rawBody"); - - return; - } - - logger.debug("[inside github integration] Returning an event for the webhook!", { - name, - payload, - context, - }); - - return { - events: [ - { - id: [hookId, deliveryId].join(":"), - source: "github.com", - payload, - name, - context, - }, - ], - }; -} diff --git a/integrations/github/src/webhook-examples.ts b/integrations/github/src/webhook-examples.ts deleted file mode 100644 index caec3776e..000000000 --- a/integrations/github/src/webhook-examples.ts +++ /dev/null @@ -1,2317 +0,0 @@ -import { EventSpecificationExample } from "@trigger.dev/sdk"; - -export const issueAssigned: EventSpecificationExample = { - id: "issue.assigned", - name: "Issue assigned", - payload: { - issue: { - id: 1767861922, - url: "https://api.github.com/repos/triggerdotdev/empty/issues/4", - body: "This is the bod", - user: { - id: 10635986, - url: "https://api.github.com/users/matt-aitken", - type: "User", - login: "matt-aitken", - node_id: "MDQ6VXNlcjEwNjM1OTg2", - html_url: "https://github.com/matt-aitken", - gists_url: "https://api.github.com/users/matt-aitken/gists{/gist_id}", - repos_url: "https://api.github.com/users/matt-aitken/repos", - avatar_url: "https://avatars.githubusercontent.com/u/10635986?v=4", - events_url: "https://api.github.com/users/matt-aitken/events{/privacy}", - site_admin: false, - gravatar_id: "", - starred_url: "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", - followers_url: "https://api.github.com/users/matt-aitken/followers", - following_url: "https://api.github.com/users/matt-aitken/following{/other_user}", - organizations_url: "https://api.github.com/users/matt-aitken/orgs", - subscriptions_url: "https://api.github.com/users/matt-aitken/subscriptions", - received_events_url: "https://api.github.com/users/matt-aitken/received_events", - }, - state: "open", - title: "Fourth time lucky?", - labels: [], - locked: false, - number: 4, - node_id: "I_kwDOJyTwbc5pX26i", - assignee: { - id: 10635986, - url: "https://api.github.com/users/matt-aitken", - type: "User", - login: "matt-aitken", - node_id: "MDQ6VXNlcjEwNjM1OTg2", - html_url: "https://github.com/matt-aitken", - gists_url: "https://api.github.com/users/matt-aitken/gists{/gist_id}", - repos_url: "https://api.github.com/users/matt-aitken/repos", - avatar_url: "https://avatars.githubusercontent.com/u/10635986?v=4", - events_url: "https://api.github.com/users/matt-aitken/events{/privacy}", - site_admin: false, - gravatar_id: "", - starred_url: "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", - followers_url: "https://api.github.com/users/matt-aitken/followers", - following_url: "https://api.github.com/users/matt-aitken/following{/other_user}", - organizations_url: "https://api.github.com/users/matt-aitken/orgs", - subscriptions_url: "https://api.github.com/users/matt-aitken/subscriptions", - received_events_url: "https://api.github.com/users/matt-aitken/received_events", - }, - comments: 1, - html_url: "https://github.com/triggerdotdev/empty/issues/4", - assignees: [ - { - id: 10635986, - url: "https://api.github.com/users/matt-aitken", - type: "User", - login: "matt-aitken", - node_id: "MDQ6VXNlcjEwNjM1OTg2", - html_url: "https://github.com/matt-aitken", - gists_url: "https://api.github.com/users/matt-aitken/gists{/gist_id}", - repos_url: "https://api.github.com/users/matt-aitken/repos", - avatar_url: "https://avatars.githubusercontent.com/u/10635986?v=4", - events_url: "https://api.github.com/users/matt-aitken/events{/privacy}", - site_admin: false, - gravatar_id: "", - starred_url: "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", - followers_url: "https://api.github.com/users/matt-aitken/followers", - following_url: "https://api.github.com/users/matt-aitken/following{/other_user}", - organizations_url: "https://api.github.com/users/matt-aitken/orgs", - subscriptions_url: "https://api.github.com/users/matt-aitken/subscriptions", - received_events_url: "https://api.github.com/users/matt-aitken/received_events", - }, - ], - closed_at: null, - milestone: null, - reactions: { - "+1": 0, - "-1": 0, - url: "https://api.github.com/repos/triggerdotdev/empty/issues/4/reactions", - eyes: 0, - heart: 0, - laugh: 0, - hooray: 0, - rocket: 0, - confused: 0, - total_count: 0, - }, - created_at: "2023-06-21T15:24:20Z", - events_url: "https://api.github.com/repos/triggerdotdev/empty/issues/4/events", - labels_url: "https://api.github.com/repos/triggerdotdev/empty/issues/4/labels{/name}", - updated_at: "2023-06-21T15:36:53Z", - comments_url: "https://api.github.com/repos/triggerdotdev/empty/issues/4/comments", - state_reason: null, - timeline_url: "https://api.github.com/repos/triggerdotdev/empty/issues/4/timeline", - repository_url: "https://api.github.com/repos/triggerdotdev/empty", - active_lock_reason: null, - author_association: "MEMBER", - performed_via_github_app: null, - }, - action: "assigned", - sender: { - id: 10635986, - url: "https://api.github.com/users/matt-aitken", - type: "User", - login: "matt-aitken", - node_id: "MDQ6VXNlcjEwNjM1OTg2", - html_url: "https://github.com/matt-aitken", - gists_url: "https://api.github.com/users/matt-aitken/gists{/gist_id}", - repos_url: "https://api.github.com/users/matt-aitken/repos", - avatar_url: "https://avatars.githubusercontent.com/u/10635986?v=4", - events_url: "https://api.github.com/users/matt-aitken/events{/privacy}", - site_admin: false, - gravatar_id: "", - starred_url: "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", - followers_url: "https://api.github.com/users/matt-aitken/followers", - following_url: "https://api.github.com/users/matt-aitken/following{/other_user}", - organizations_url: "https://api.github.com/users/matt-aitken/orgs", - subscriptions_url: "https://api.github.com/users/matt-aitken/subscriptions", - received_events_url: "https://api.github.com/users/matt-aitken/received_events", - }, - assignee: { - id: 10635986, - url: "https://api.github.com/users/matt-aitken", - type: "User", - login: "matt-aitken", - node_id: "MDQ6VXNlcjEwNjM1OTg2", - html_url: "https://github.com/matt-aitken", - gists_url: "https://api.github.com/users/matt-aitken/gists{/gist_id}", - repos_url: "https://api.github.com/users/matt-aitken/repos", - avatar_url: "https://avatars.githubusercontent.com/u/10635986?v=4", - events_url: "https://api.github.com/users/matt-aitken/events{/privacy}", - site_admin: false, - gravatar_id: "", - starred_url: "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", - followers_url: "https://api.github.com/users/matt-aitken/followers", - following_url: "https://api.github.com/users/matt-aitken/following{/other_user}", - organizations_url: "https://api.github.com/users/matt-aitken/orgs", - subscriptions_url: "https://api.github.com/users/matt-aitken/subscriptions", - received_events_url: "https://api.github.com/users/matt-aitken/received_events", - }, - repository: { - id: 656732269, - url: "https://api.github.com/repos/triggerdotdev/empty", - fork: false, - name: "empty", - size: 0, - forks: 0, - owner: { - id: 95297378, - url: "https://api.github.com/users/triggerdotdev", - type: "Organization", - login: "triggerdotdev", - node_id: "O_kgDOBa4fYg", - html_url: "https://github.com/triggerdotdev", - gists_url: "https://api.github.com/users/triggerdotdev/gists{/gist_id}", - repos_url: "https://api.github.com/users/triggerdotdev/repos", - avatar_url: "https://avatars.githubusercontent.com/u/95297378?v=4", - events_url: "https://api.github.com/users/triggerdotdev/events{/privacy}", - site_admin: false, - gravatar_id: "", - starred_url: "https://api.github.com/users/triggerdotdev/starred{/owner}{/repo}", - followers_url: "https://api.github.com/users/triggerdotdev/followers", - following_url: "https://api.github.com/users/triggerdotdev/following{/other_user}", - organizations_url: "https://api.github.com/users/triggerdotdev/orgs", - subscriptions_url: "https://api.github.com/users/triggerdotdev/subscriptions", - received_events_url: "https://api.github.com/users/triggerdotdev/received_events", - }, - topics: [], - git_url: "git://github.com/triggerdotdev/empty.git", - license: null, - node_id: "R_kgDOJyTwbQ", - private: false, - ssh_url: "git@github.com:triggerdotdev/empty.git", - svn_url: "https://github.com/triggerdotdev/empty", - archived: false, - disabled: false, - has_wiki: true, - homepage: null, - html_url: "https://github.com/triggerdotdev/empty", - keys_url: "https://api.github.com/repos/triggerdotdev/empty/keys{/key_id}", - language: null, - tags_url: "https://api.github.com/repos/triggerdotdev/empty/tags", - watchers: 0, - blobs_url: "https://api.github.com/repos/triggerdotdev/empty/git/blobs{/sha}", - clone_url: "https://github.com/triggerdotdev/empty.git", - forks_url: "https://api.github.com/repos/triggerdotdev/empty/forks", - full_name: "triggerdotdev/empty", - has_pages: false, - hooks_url: "https://api.github.com/repos/triggerdotdev/empty/hooks", - pulls_url: "https://api.github.com/repos/triggerdotdev/empty/pulls{/number}", - pushed_at: "2023-06-21T14:21:08Z", - teams_url: "https://api.github.com/repos/triggerdotdev/empty/teams", - trees_url: "https://api.github.com/repos/triggerdotdev/empty/git/trees{/sha}", - created_at: "2023-06-21T14:21:07Z", - events_url: "https://api.github.com/repos/triggerdotdev/empty/events", - has_issues: true, - issues_url: "https://api.github.com/repos/triggerdotdev/empty/issues{/number}", - labels_url: "https://api.github.com/repos/triggerdotdev/empty/labels{/name}", - merges_url: "https://api.github.com/repos/triggerdotdev/empty/merges", - mirror_url: null, - updated_at: "2023-06-21T14:21:08Z", - visibility: "public", - archive_url: "https://api.github.com/repos/triggerdotdev/empty/{archive_format}{/ref}", - commits_url: "https://api.github.com/repos/triggerdotdev/empty/commits{/sha}", - compare_url: "https://api.github.com/repos/triggerdotdev/empty/compare/{base}...{head}", - description: "An empty repo that can be used to test the @trigger.dev/github integration", - forks_count: 0, - is_template: false, - open_issues: 4, - branches_url: "https://api.github.com/repos/triggerdotdev/empty/branches{/branch}", - comments_url: "https://api.github.com/repos/triggerdotdev/empty/comments{/number}", - contents_url: "https://api.github.com/repos/triggerdotdev/empty/contents/{+path}", - git_refs_url: "https://api.github.com/repos/triggerdotdev/empty/git/refs{/sha}", - git_tags_url: "https://api.github.com/repos/triggerdotdev/empty/git/tags{/sha}", - has_projects: true, - releases_url: "https://api.github.com/repos/triggerdotdev/empty/releases{/id}", - statuses_url: "https://api.github.com/repos/triggerdotdev/empty/statuses/{sha}", - allow_forking: true, - assignees_url: "https://api.github.com/repos/triggerdotdev/empty/assignees{/user}", - downloads_url: "https://api.github.com/repos/triggerdotdev/empty/downloads", - has_downloads: true, - languages_url: "https://api.github.com/repos/triggerdotdev/empty/languages", - default_branch: "main", - milestones_url: "https://api.github.com/repos/triggerdotdev/empty/milestones{/number}", - stargazers_url: "https://api.github.com/repos/triggerdotdev/empty/stargazers", - watchers_count: 0, - deployments_url: "https://api.github.com/repos/triggerdotdev/empty/deployments", - git_commits_url: "https://api.github.com/repos/triggerdotdev/empty/git/commits{/sha}", - has_discussions: false, - subscribers_url: "https://api.github.com/repos/triggerdotdev/empty/subscribers", - contributors_url: "https://api.github.com/repos/triggerdotdev/empty/contributors", - issue_events_url: "https://api.github.com/repos/triggerdotdev/empty/issues/events{/number}", - stargazers_count: 0, - subscription_url: "https://api.github.com/repos/triggerdotdev/empty/subscription", - collaborators_url: - "https://api.github.com/repos/triggerdotdev/empty/collaborators{/collaborator}", - issue_comment_url: - "https://api.github.com/repos/triggerdotdev/empty/issues/comments{/number}", - notifications_url: - "https://api.github.com/repos/triggerdotdev/empty/notifications{?since,all,participating}", - open_issues_count: 4, - web_commit_signoff_required: false, - }, - organization: { - id: 95297378, - url: "https://api.github.com/orgs/triggerdotdev", - login: "triggerdotdev", - node_id: "O_kgDOBa4fYg", - hooks_url: "https://api.github.com/orgs/triggerdotdev/hooks", - repos_url: "https://api.github.com/orgs/triggerdotdev/repos", - avatar_url: "https://avatars.githubusercontent.com/u/95297378?v=4", - events_url: "https://api.github.com/orgs/triggerdotdev/events", - issues_url: "https://api.github.com/orgs/triggerdotdev/issues", - description: "", - members_url: "https://api.github.com/orgs/triggerdotdev/members{/member}", - public_members_url: "https://api.github.com/orgs/triggerdotdev/public_members{/member}", - }, - }, -}; - -export const issueOpened: EventSpecificationExample = { - id: "issue.opened", - name: "Issue opened", - payload: { - issue: { - id: 1754473379, - url: "https://api.github.com/repos/ericallam/basic-starter-12k/issues/21", - body: 'This is a *big* problem:\r\n\r\n```\r\nconst foo = "bar"\r\n```', - user: { - id: 10635986, - url: "https://api.github.com/users/matt-aitken", - type: "User", - login: "matt-aitken", - node_id: "MDQ6VXNlcjEwNjM1OTg2", - html_url: "https://github.com/matt-aitken", - gists_url: "https://api.github.com/users/matt-aitken/gists{/gist_id}", - repos_url: "https://api.github.com/users/matt-aitken/repos", - avatar_url: "https://avatars.githubusercontent.com/u/10635986?v=4", - events_url: "https://api.github.com/users/matt-aitken/events{/privacy}", - site_admin: false, - gravatar_id: "", - starred_url: "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", - followers_url: "https://api.github.com/users/matt-aitken/followers", - following_url: "https://api.github.com/users/matt-aitken/following{/other_user}", - organizations_url: "https://api.github.com/users/matt-aitken/orgs", - subscriptions_url: "https://api.github.com/users/matt-aitken/subscriptions", - received_events_url: "https://api.github.com/users/matt-aitken/received_events", - }, - state: "open", - title: "This is a sample issue title #20", - labels: [], - locked: false, - number: 21, - node_id: "I_kwDOI-yZFc5okyOj", - assignee: null, - comments: 0, - html_url: "https://github.com/ericallam/basic-starter-12k/issues/21", - assignees: [], - closed_at: null, - milestone: null, - reactions: { - "+1": 0, - "-1": 0, - url: "https://api.github.com/repos/ericallam/basic-starter-12k/issues/21/reactions", - eyes: 0, - heart: 0, - laugh: 0, - hooray: 0, - rocket: 0, - confused: 0, - total_count: 0, - }, - created_at: "2023-06-13T09:42:02Z", - events_url: "https://api.github.com/repos/ericallam/basic-starter-12k/issues/21/events", - labels_url: - "https://api.github.com/repos/ericallam/basic-starter-12k/issues/21/labels{/name}", - updated_at: "2023-06-13T09:42:02Z", - comments_url: "https://api.github.com/repos/ericallam/basic-starter-12k/issues/21/comments", - state_reason: null, - timeline_url: "https://api.github.com/repos/ericallam/basic-starter-12k/issues/21/timeline", - repository_url: "https://api.github.com/repos/ericallam/basic-starter-12k", - active_lock_reason: null, - author_association: "NONE", - performed_via_github_app: null, - }, - action: "opened", - sender: { - id: 10635986, - url: "https://api.github.com/users/matt-aitken", - type: "User", - login: "matt-aitken", - node_id: "MDQ6VXNlcjEwNjM1OTg2", - html_url: "https://github.com/matt-aitken", - gists_url: "https://api.github.com/users/matt-aitken/gists{/gist_id}", - repos_url: "https://api.github.com/users/matt-aitken/repos", - avatar_url: "https://avatars.githubusercontent.com/u/10635986?v=4", - events_url: "https://api.github.com/users/matt-aitken/events{/privacy}", - site_admin: false, - gravatar_id: "", - starred_url: "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", - followers_url: "https://api.github.com/users/matt-aitken/followers", - following_url: "https://api.github.com/users/matt-aitken/following{/other_user}", - organizations_url: "https://api.github.com/users/matt-aitken/orgs", - subscriptions_url: "https://api.github.com/users/matt-aitken/subscriptions", - received_events_url: "https://api.github.com/users/matt-aitken/received_events", - }, - repository: { - id: 602708245, - url: "https://api.github.com/repos/ericallam/basic-starter-12k", - fork: false, - name: "basic-starter-12k", - size: 0, - forks: 0, - owner: { - id: 534, - url: "https://api.github.com/users/ericallam", - type: "User", - login: "ericallam", - node_id: "MDQ6VXNlcjUzNA==", - html_url: "https://github.com/ericallam", - gists_url: "https://api.github.com/users/ericallam/gists{/gist_id}", - repos_url: "https://api.github.com/users/ericallam/repos", - avatar_url: "https://avatars.githubusercontent.com/u/534?v=4", - events_url: "https://api.github.com/users/ericallam/events{/privacy}", - site_admin: false, - gravatar_id: "", - starred_url: "https://api.github.com/users/ericallam/starred{/owner}{/repo}", - followers_url: "https://api.github.com/users/ericallam/followers", - following_url: "https://api.github.com/users/ericallam/following{/other_user}", - organizations_url: "https://api.github.com/users/ericallam/orgs", - subscriptions_url: "https://api.github.com/users/ericallam/subscriptions", - received_events_url: "https://api.github.com/users/ericallam/received_events", - }, - topics: [], - git_url: "git://github.com/ericallam/basic-starter-12k.git", - license: null, - node_id: "R_kgDOI-yZFQ", - private: false, - ssh_url: "git@github.com:ericallam/basic-starter-12k.git", - svn_url: "https://github.com/ericallam/basic-starter-12k", - archived: false, - disabled: false, - has_wiki: true, - homepage: null, - html_url: "https://github.com/ericallam/basic-starter-12k", - keys_url: "https://api.github.com/repos/ericallam/basic-starter-12k/keys{/key_id}", - language: null, - tags_url: "https://api.github.com/repos/ericallam/basic-starter-12k/tags", - watchers: 0, - blobs_url: "https://api.github.com/repos/ericallam/basic-starter-12k/git/blobs{/sha}", - clone_url: "https://github.com/ericallam/basic-starter-12k.git", - forks_url: "https://api.github.com/repos/ericallam/basic-starter-12k/forks", - full_name: "ericallam/basic-starter-12k", - has_pages: false, - hooks_url: "https://api.github.com/repos/ericallam/basic-starter-12k/hooks", - pulls_url: "https://api.github.com/repos/ericallam/basic-starter-12k/pulls{/number}", - pushed_at: "2023-02-16T19:25:20Z", - teams_url: "https://api.github.com/repos/ericallam/basic-starter-12k/teams", - trees_url: "https://api.github.com/repos/ericallam/basic-starter-12k/git/trees{/sha}", - created_at: "2023-02-16T19:25:19Z", - events_url: "https://api.github.com/repos/ericallam/basic-starter-12k/events", - has_issues: true, - issues_url: "https://api.github.com/repos/ericallam/basic-starter-12k/issues{/number}", - labels_url: "https://api.github.com/repos/ericallam/basic-starter-12k/labels{/name}", - merges_url: "https://api.github.com/repos/ericallam/basic-starter-12k/merges", - mirror_url: null, - updated_at: "2023-02-16T19:25:19Z", - visibility: "public", - archive_url: - "https://api.github.com/repos/ericallam/basic-starter-12k/{archive_format}{/ref}", - commits_url: "https://api.github.com/repos/ericallam/basic-starter-12k/commits{/sha}", - compare_url: - "https://api.github.com/repos/ericallam/basic-starter-12k/compare/{base}...{head}", - description: null, - forks_count: 0, - is_template: false, - open_issues: 21, - branches_url: "https://api.github.com/repos/ericallam/basic-starter-12k/branches{/branch}", - comments_url: "https://api.github.com/repos/ericallam/basic-starter-12k/comments{/number}", - contents_url: "https://api.github.com/repos/ericallam/basic-starter-12k/contents/{+path}", - git_refs_url: "https://api.github.com/repos/ericallam/basic-starter-12k/git/refs{/sha}", - git_tags_url: "https://api.github.com/repos/ericallam/basic-starter-12k/git/tags{/sha}", - has_projects: true, - releases_url: "https://api.github.com/repos/ericallam/basic-starter-12k/releases{/id}", - statuses_url: "https://api.github.com/repos/ericallam/basic-starter-12k/statuses/{sha}", - allow_forking: true, - assignees_url: "https://api.github.com/repos/ericallam/basic-starter-12k/assignees{/user}", - downloads_url: "https://api.github.com/repos/ericallam/basic-starter-12k/downloads", - has_downloads: true, - languages_url: "https://api.github.com/repos/ericallam/basic-starter-12k/languages", - default_branch: "main", - milestones_url: - "https://api.github.com/repos/ericallam/basic-starter-12k/milestones{/number}", - stargazers_url: "https://api.github.com/repos/ericallam/basic-starter-12k/stargazers", - watchers_count: 0, - deployments_url: "https://api.github.com/repos/ericallam/basic-starter-12k/deployments", - git_commits_url: "https://api.github.com/repos/ericallam/basic-starter-12k/git/commits{/sha}", - has_discussions: false, - subscribers_url: "https://api.github.com/repos/ericallam/basic-starter-12k/subscribers", - contributors_url: "https://api.github.com/repos/ericallam/basic-starter-12k/contributors", - issue_events_url: - "https://api.github.com/repos/ericallam/basic-starter-12k/issues/events{/number}", - stargazers_count: 0, - subscription_url: "https://api.github.com/repos/ericallam/basic-starter-12k/subscription", - collaborators_url: - "https://api.github.com/repos/ericallam/basic-starter-12k/collaborators{/collaborator}", - issue_comment_url: - "https://api.github.com/repos/ericallam/basic-starter-12k/issues/comments{/number}", - notifications_url: - "https://api.github.com/repos/ericallam/basic-starter-12k/notifications{?since,all,participating}", - open_issues_count: 21, - web_commit_signoff_required: false, - }, - }, -}; - -export const issueCommentCreated: EventSpecificationExample = { - id: "issuecomment.created", - name: "Issue comment created", - payload: { - issue: { - id: 1767861922, - url: "https://api.github.com/repos/triggerdotdev/empty/issues/4", - body: "This is the bod", - user: { - id: 10635986, - url: "https://api.github.com/users/matt-aitken", - type: "User", - login: "matt-aitken", - node_id: "MDQ6VXNlcjEwNjM1OTg2", - html_url: "https://github.com/matt-aitken", - gists_url: "https://api.github.com/users/matt-aitken/gists{/gist_id}", - repos_url: "https://api.github.com/users/matt-aitken/repos", - avatar_url: "https://avatars.githubusercontent.com/u/10635986?v=4", - events_url: "https://api.github.com/users/matt-aitken/events{/privacy}", - site_admin: false, - gravatar_id: "", - starred_url: "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", - followers_url: "https://api.github.com/users/matt-aitken/followers", - following_url: "https://api.github.com/users/matt-aitken/following{/other_user}", - organizations_url: "https://api.github.com/users/matt-aitken/orgs", - subscriptions_url: "https://api.github.com/users/matt-aitken/subscriptions", - received_events_url: "https://api.github.com/users/matt-aitken/received_events", - }, - state: "open", - title: "Fourth time lucky?", - labels: [], - locked: false, - number: 4, - node_id: "I_kwDOJyTwbc5pX26i", - assignee: { - id: 10635986, - url: "https://api.github.com/users/matt-aitken", - type: "User", - login: "matt-aitken", - node_id: "MDQ6VXNlcjEwNjM1OTg2", - html_url: "https://github.com/matt-aitken", - gists_url: "https://api.github.com/users/matt-aitken/gists{/gist_id}", - repos_url: "https://api.github.com/users/matt-aitken/repos", - avatar_url: "https://avatars.githubusercontent.com/u/10635986?v=4", - events_url: "https://api.github.com/users/matt-aitken/events{/privacy}", - site_admin: false, - gravatar_id: "", - starred_url: "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", - followers_url: "https://api.github.com/users/matt-aitken/followers", - following_url: "https://api.github.com/users/matt-aitken/following{/other_user}", - organizations_url: "https://api.github.com/users/matt-aitken/orgs", - subscriptions_url: "https://api.github.com/users/matt-aitken/subscriptions", - received_events_url: "https://api.github.com/users/matt-aitken/received_events", - }, - comments: 2, - html_url: "https://github.com/triggerdotdev/empty/issues/4", - assignees: [ - { - id: 10635986, - url: "https://api.github.com/users/matt-aitken", - type: "User", - login: "matt-aitken", - node_id: "MDQ6VXNlcjEwNjM1OTg2", - html_url: "https://github.com/matt-aitken", - gists_url: "https://api.github.com/users/matt-aitken/gists{/gist_id}", - repos_url: "https://api.github.com/users/matt-aitken/repos", - avatar_url: "https://avatars.githubusercontent.com/u/10635986?v=4", - events_url: "https://api.github.com/users/matt-aitken/events{/privacy}", - site_admin: false, - gravatar_id: "", - starred_url: "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", - followers_url: "https://api.github.com/users/matt-aitken/followers", - following_url: "https://api.github.com/users/matt-aitken/following{/other_user}", - organizations_url: "https://api.github.com/users/matt-aitken/orgs", - subscriptions_url: "https://api.github.com/users/matt-aitken/subscriptions", - received_events_url: "https://api.github.com/users/matt-aitken/received_events", - }, - ], - closed_at: null, - milestone: null, - reactions: { - "+1": 0, - "-1": 0, - url: "https://api.github.com/repos/triggerdotdev/empty/issues/4/reactions", - eyes: 0, - heart: 0, - laugh: 0, - hooray: 0, - rocket: 0, - confused: 0, - total_count: 0, - }, - created_at: "2023-06-21T15:24:20Z", - events_url: "https://api.github.com/repos/triggerdotdev/empty/issues/4/events", - labels_url: "https://api.github.com/repos/triggerdotdev/empty/issues/4/labels{/name}", - updated_at: "2023-06-21T16:02:28Z", - comments_url: "https://api.github.com/repos/triggerdotdev/empty/issues/4/comments", - state_reason: null, - timeline_url: "https://api.github.com/repos/triggerdotdev/empty/issues/4/timeline", - repository_url: "https://api.github.com/repos/triggerdotdev/empty", - active_lock_reason: null, - author_association: "MEMBER", - performed_via_github_app: null, - }, - action: "created", - sender: { - id: 10635986, - url: "https://api.github.com/users/matt-aitken", - type: "User", - login: "matt-aitken", - node_id: "MDQ6VXNlcjEwNjM1OTg2", - html_url: "https://github.com/matt-aitken", - gists_url: "https://api.github.com/users/matt-aitken/gists{/gist_id}", - repos_url: "https://api.github.com/users/matt-aitken/repos", - avatar_url: "https://avatars.githubusercontent.com/u/10635986?v=4", - events_url: "https://api.github.com/users/matt-aitken/events{/privacy}", - site_admin: false, - gravatar_id: "", - starred_url: "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", - followers_url: "https://api.github.com/users/matt-aitken/followers", - following_url: "https://api.github.com/users/matt-aitken/following{/other_user}", - organizations_url: "https://api.github.com/users/matt-aitken/orgs", - subscriptions_url: "https://api.github.com/users/matt-aitken/subscriptions", - received_events_url: "https://api.github.com/users/matt-aitken/received_events", - }, - comment: { - id: 1601114728, - url: "https://api.github.com/repos/triggerdotdev/empty/issues/comments/1601114728", - body: 'This is a short comment with short code snippet:\r\n\r\n```\r\nconst rick = "astley";\r\n```', - user: { - id: 10635986, - url: "https://api.github.com/users/matt-aitken", - type: "User", - login: "matt-aitken", - node_id: "MDQ6VXNlcjEwNjM1OTg2", - html_url: "https://github.com/matt-aitken", - gists_url: "https://api.github.com/users/matt-aitken/gists{/gist_id}", - repos_url: "https://api.github.com/users/matt-aitken/repos", - avatar_url: "https://avatars.githubusercontent.com/u/10635986?v=4", - events_url: "https://api.github.com/users/matt-aitken/events{/privacy}", - site_admin: false, - gravatar_id: "", - starred_url: "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", - followers_url: "https://api.github.com/users/matt-aitken/followers", - following_url: "https://api.github.com/users/matt-aitken/following{/other_user}", - organizations_url: "https://api.github.com/users/matt-aitken/orgs", - subscriptions_url: "https://api.github.com/users/matt-aitken/subscriptions", - received_events_url: "https://api.github.com/users/matt-aitken/received_events", - }, - node_id: "IC_kwDOJyTwbc5fbxJo", - html_url: "https://github.com/triggerdotdev/empty/issues/4#issuecomment-1601114728", - issue_url: "https://api.github.com/repos/triggerdotdev/empty/issues/4", - reactions: { - "+1": 0, - "-1": 0, - url: "https://api.github.com/repos/triggerdotdev/empty/issues/comments/1601114728/reactions", - eyes: 0, - heart: 0, - laugh: 0, - hooray: 0, - rocket: 0, - confused: 0, - total_count: 0, - }, - created_at: "2023-06-21T16:02:27Z", - updated_at: "2023-06-21T16:02:27Z", - author_association: "MEMBER", - performed_via_github_app: null, - }, - repository: { - id: 656732269, - url: "https://api.github.com/repos/triggerdotdev/empty", - fork: false, - name: "empty", - size: 0, - forks: 0, - owner: { - id: 95297378, - url: "https://api.github.com/users/triggerdotdev", - type: "Organization", - login: "triggerdotdev", - node_id: "O_kgDOBa4fYg", - html_url: "https://github.com/triggerdotdev", - gists_url: "https://api.github.com/users/triggerdotdev/gists{/gist_id}", - repos_url: "https://api.github.com/users/triggerdotdev/repos", - avatar_url: "https://avatars.githubusercontent.com/u/95297378?v=4", - events_url: "https://api.github.com/users/triggerdotdev/events{/privacy}", - site_admin: false, - gravatar_id: "", - starred_url: "https://api.github.com/users/triggerdotdev/starred{/owner}{/repo}", - followers_url: "https://api.github.com/users/triggerdotdev/followers", - following_url: "https://api.github.com/users/triggerdotdev/following{/other_user}", - organizations_url: "https://api.github.com/users/triggerdotdev/orgs", - subscriptions_url: "https://api.github.com/users/triggerdotdev/subscriptions", - received_events_url: "https://api.github.com/users/triggerdotdev/received_events", - }, - topics: [], - git_url: "git://github.com/triggerdotdev/empty.git", - license: null, - node_id: "R_kgDOJyTwbQ", - private: false, - ssh_url: "git@github.com:triggerdotdev/empty.git", - svn_url: "https://github.com/triggerdotdev/empty", - archived: false, - disabled: false, - has_wiki: true, - homepage: null, - html_url: "https://github.com/triggerdotdev/empty", - keys_url: "https://api.github.com/repos/triggerdotdev/empty/keys{/key_id}", - language: null, - tags_url: "https://api.github.com/repos/triggerdotdev/empty/tags", - watchers: 0, - blobs_url: "https://api.github.com/repos/triggerdotdev/empty/git/blobs{/sha}", - clone_url: "https://github.com/triggerdotdev/empty.git", - forks_url: "https://api.github.com/repos/triggerdotdev/empty/forks", - full_name: "triggerdotdev/empty", - has_pages: false, - hooks_url: "https://api.github.com/repos/triggerdotdev/empty/hooks", - pulls_url: "https://api.github.com/repos/triggerdotdev/empty/pulls{/number}", - pushed_at: "2023-06-21T14:21:08Z", - teams_url: "https://api.github.com/repos/triggerdotdev/empty/teams", - trees_url: "https://api.github.com/repos/triggerdotdev/empty/git/trees{/sha}", - created_at: "2023-06-21T14:21:07Z", - events_url: "https://api.github.com/repos/triggerdotdev/empty/events", - has_issues: true, - issues_url: "https://api.github.com/repos/triggerdotdev/empty/issues{/number}", - labels_url: "https://api.github.com/repos/triggerdotdev/empty/labels{/name}", - merges_url: "https://api.github.com/repos/triggerdotdev/empty/merges", - mirror_url: null, - updated_at: "2023-06-21T14:21:08Z", - visibility: "public", - archive_url: "https://api.github.com/repos/triggerdotdev/empty/{archive_format}{/ref}", - commits_url: "https://api.github.com/repos/triggerdotdev/empty/commits{/sha}", - compare_url: "https://api.github.com/repos/triggerdotdev/empty/compare/{base}...{head}", - description: "An empty repo that can be used to test the @trigger.dev/github integration", - forks_count: 0, - is_template: false, - open_issues: 4, - branches_url: "https://api.github.com/repos/triggerdotdev/empty/branches{/branch}", - comments_url: "https://api.github.com/repos/triggerdotdev/empty/comments{/number}", - contents_url: "https://api.github.com/repos/triggerdotdev/empty/contents/{+path}", - git_refs_url: "https://api.github.com/repos/triggerdotdev/empty/git/refs{/sha}", - git_tags_url: "https://api.github.com/repos/triggerdotdev/empty/git/tags{/sha}", - has_projects: true, - releases_url: "https://api.github.com/repos/triggerdotdev/empty/releases{/id}", - statuses_url: "https://api.github.com/repos/triggerdotdev/empty/statuses/{sha}", - allow_forking: true, - assignees_url: "https://api.github.com/repos/triggerdotdev/empty/assignees{/user}", - downloads_url: "https://api.github.com/repos/triggerdotdev/empty/downloads", - has_downloads: true, - languages_url: "https://api.github.com/repos/triggerdotdev/empty/languages", - default_branch: "main", - milestones_url: "https://api.github.com/repos/triggerdotdev/empty/milestones{/number}", - stargazers_url: "https://api.github.com/repos/triggerdotdev/empty/stargazers", - watchers_count: 0, - deployments_url: "https://api.github.com/repos/triggerdotdev/empty/deployments", - git_commits_url: "https://api.github.com/repos/triggerdotdev/empty/git/commits{/sha}", - has_discussions: false, - subscribers_url: "https://api.github.com/repos/triggerdotdev/empty/subscribers", - contributors_url: "https://api.github.com/repos/triggerdotdev/empty/contributors", - issue_events_url: "https://api.github.com/repos/triggerdotdev/empty/issues/events{/number}", - stargazers_count: 0, - subscription_url: "https://api.github.com/repos/triggerdotdev/empty/subscription", - collaborators_url: - "https://api.github.com/repos/triggerdotdev/empty/collaborators{/collaborator}", - issue_comment_url: - "https://api.github.com/repos/triggerdotdev/empty/issues/comments{/number}", - notifications_url: - "https://api.github.com/repos/triggerdotdev/empty/notifications{?since,all,participating}", - open_issues_count: 4, - web_commit_signoff_required: false, - }, - organization: { - id: 95297378, - url: "https://api.github.com/orgs/triggerdotdev", - login: "triggerdotdev", - node_id: "O_kgDOBa4fYg", - hooks_url: "https://api.github.com/orgs/triggerdotdev/hooks", - repos_url: "https://api.github.com/orgs/triggerdotdev/repos", - avatar_url: "https://avatars.githubusercontent.com/u/95297378?v=4", - events_url: "https://api.github.com/orgs/triggerdotdev/events", - issues_url: "https://api.github.com/orgs/triggerdotdev/issues", - description: "", - members_url: "https://api.github.com/orgs/triggerdotdev/members{/member}", - public_members_url: "https://api.github.com/orgs/triggerdotdev/public_members{/member}", - }, - }, -}; - -export const starredRepo: EventSpecificationExample = { - id: "star.created", - name: "Repo starred", - payload: { - action: "created", - sender: { - id: 10635986, - url: "https://api.github.com/users/matt-aitken", - type: "User", - login: "matt-aitken", - node_id: "MDQ6VXNlcjEwNjM1OTg2", - html_url: "https://github.com/matt-aitken", - gists_url: "https://api.github.com/users/matt-aitken/gists{/gist_id}", - repos_url: "https://api.github.com/users/matt-aitken/repos", - avatar_url: "https://avatars.githubusercontent.com/u/10635986?v=4", - events_url: "https://api.github.com/users/matt-aitken/events{/privacy}", - site_admin: false, - gravatar_id: "", - starred_url: "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", - followers_url: "https://api.github.com/users/matt-aitken/followers", - following_url: "https://api.github.com/users/matt-aitken/following{/other_user}", - organizations_url: "https://api.github.com/users/matt-aitken/orgs", - subscriptions_url: "https://api.github.com/users/matt-aitken/subscriptions", - received_events_url: "https://api.github.com/users/matt-aitken/received_events", - }, - repository: { - id: 656732269, - url: "https://api.github.com/repos/triggerdotdev/empty", - fork: false, - name: "empty", - size: 0, - forks: 0, - owner: { - id: 95297378, - url: "https://api.github.com/users/triggerdotdev", - type: "Organization", - login: "triggerdotdev", - node_id: "O_kgDOBa4fYg", - html_url: "https://github.com/triggerdotdev", - gists_url: "https://api.github.com/users/triggerdotdev/gists{/gist_id}", - repos_url: "https://api.github.com/users/triggerdotdev/repos", - avatar_url: "https://avatars.githubusercontent.com/u/95297378?v=4", - events_url: "https://api.github.com/users/triggerdotdev/events{/privacy}", - site_admin: false, - gravatar_id: "", - starred_url: "https://api.github.com/users/triggerdotdev/starred{/owner}{/repo}", - followers_url: "https://api.github.com/users/triggerdotdev/followers", - following_url: "https://api.github.com/users/triggerdotdev/following{/other_user}", - organizations_url: "https://api.github.com/users/triggerdotdev/orgs", - subscriptions_url: "https://api.github.com/users/triggerdotdev/subscriptions", - received_events_url: "https://api.github.com/users/triggerdotdev/received_events", - }, - topics: [], - git_url: "git://github.com/triggerdotdev/empty.git", - license: null, - node_id: "R_kgDOJyTwbQ", - private: false, - ssh_url: "git@github.com:triggerdotdev/empty.git", - svn_url: "https://github.com/triggerdotdev/empty", - archived: false, - disabled: false, - has_wiki: true, - homepage: null, - html_url: "https://github.com/triggerdotdev/empty", - keys_url: "https://api.github.com/repos/triggerdotdev/empty/keys{/key_id}", - language: null, - tags_url: "https://api.github.com/repos/triggerdotdev/empty/tags", - watchers: 1, - blobs_url: "https://api.github.com/repos/triggerdotdev/empty/git/blobs{/sha}", - clone_url: "https://github.com/triggerdotdev/empty.git", - forks_url: "https://api.github.com/repos/triggerdotdev/empty/forks", - full_name: "triggerdotdev/empty", - has_pages: false, - hooks_url: "https://api.github.com/repos/triggerdotdev/empty/hooks", - pulls_url: "https://api.github.com/repos/triggerdotdev/empty/pulls{/number}", - pushed_at: "2023-06-21T14:21:08Z", - teams_url: "https://api.github.com/repos/triggerdotdev/empty/teams", - trees_url: "https://api.github.com/repos/triggerdotdev/empty/git/trees{/sha}", - created_at: "2023-06-21T14:21:07Z", - events_url: "https://api.github.com/repos/triggerdotdev/empty/events", - has_issues: true, - issues_url: "https://api.github.com/repos/triggerdotdev/empty/issues{/number}", - labels_url: "https://api.github.com/repos/triggerdotdev/empty/labels{/name}", - merges_url: "https://api.github.com/repos/triggerdotdev/empty/merges", - mirror_url: null, - updated_at: "2023-06-21T17:22:03Z", - visibility: "public", - archive_url: "https://api.github.com/repos/triggerdotdev/empty/{archive_format}{/ref}", - commits_url: "https://api.github.com/repos/triggerdotdev/empty/commits{/sha}", - compare_url: "https://api.github.com/repos/triggerdotdev/empty/compare/{base}...{head}", - description: "An empty repo that can be used to test the @trigger.dev/github integration", - forks_count: 0, - is_template: false, - open_issues: 4, - branches_url: "https://api.github.com/repos/triggerdotdev/empty/branches{/branch}", - comments_url: "https://api.github.com/repos/triggerdotdev/empty/comments{/number}", - contents_url: "https://api.github.com/repos/triggerdotdev/empty/contents/{+path}", - git_refs_url: "https://api.github.com/repos/triggerdotdev/empty/git/refs{/sha}", - git_tags_url: "https://api.github.com/repos/triggerdotdev/empty/git/tags{/sha}", - has_projects: true, - releases_url: "https://api.github.com/repos/triggerdotdev/empty/releases{/id}", - statuses_url: "https://api.github.com/repos/triggerdotdev/empty/statuses/{sha}", - allow_forking: true, - assignees_url: "https://api.github.com/repos/triggerdotdev/empty/assignees{/user}", - downloads_url: "https://api.github.com/repos/triggerdotdev/empty/downloads", - has_downloads: true, - languages_url: "https://api.github.com/repos/triggerdotdev/empty/languages", - default_branch: "main", - milestones_url: "https://api.github.com/repos/triggerdotdev/empty/milestones{/number}", - stargazers_url: "https://api.github.com/repos/triggerdotdev/empty/stargazers", - watchers_count: 1, - deployments_url: "https://api.github.com/repos/triggerdotdev/empty/deployments", - git_commits_url: "https://api.github.com/repos/triggerdotdev/empty/git/commits{/sha}", - has_discussions: false, - subscribers_url: "https://api.github.com/repos/triggerdotdev/empty/subscribers", - contributors_url: "https://api.github.com/repos/triggerdotdev/empty/contributors", - issue_events_url: "https://api.github.com/repos/triggerdotdev/empty/issues/events{/number}", - stargazers_count: 1, - subscription_url: "https://api.github.com/repos/triggerdotdev/empty/subscription", - collaborators_url: - "https://api.github.com/repos/triggerdotdev/empty/collaborators{/collaborator}", - issue_comment_url: - "https://api.github.com/repos/triggerdotdev/empty/issues/comments{/number}", - notifications_url: - "https://api.github.com/repos/triggerdotdev/empty/notifications{?since,all,participating}", - open_issues_count: 4, - web_commit_signoff_required: false, - }, - starred_at: "2023-06-21T17:22:03Z", - organization: { - id: 95297378, - url: "https://api.github.com/orgs/triggerdotdev", - login: "triggerdotdev", - node_id: "O_kgDOBa4fYg", - hooks_url: "https://api.github.com/orgs/triggerdotdev/hooks", - repos_url: "https://api.github.com/orgs/triggerdotdev/repos", - avatar_url: "https://avatars.githubusercontent.com/u/95297378?v=4", - events_url: "https://api.github.com/orgs/triggerdotdev/events", - issues_url: "https://api.github.com/orgs/triggerdotdev/issues", - description: "", - members_url: "https://api.github.com/orgs/triggerdotdev/members{/member}", - public_members_url: "https://api.github.com/orgs/triggerdotdev/public_members{/member}", - }, - }, -}; - -export const newBranch: EventSpecificationExample = { - id: "branch.new", - name: "Branch created", - payload: { - ref: "test", - sender: { - id: 10635986, - url: "https://api.github.com/users/matt-aitken", - type: "User", - login: "matt-aitken", - node_id: "MDQ6VXNlcjEwNjM1OTg2", - html_url: "https://github.com/matt-aitken", - gists_url: "https://api.github.com/users/matt-aitken/gists{/gist_id}", - repos_url: "https://api.github.com/users/matt-aitken/repos", - avatar_url: "https://avatars.githubusercontent.com/u/10635986?v=4", - events_url: "https://api.github.com/users/matt-aitken/events{/privacy}", - site_admin: false, - gravatar_id: "", - starred_url: "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", - followers_url: "https://api.github.com/users/matt-aitken/followers", - following_url: "https://api.github.com/users/matt-aitken/following{/other_user}", - organizations_url: "https://api.github.com/users/matt-aitken/orgs", - subscriptions_url: "https://api.github.com/users/matt-aitken/subscriptions", - received_events_url: "https://api.github.com/users/matt-aitken/received_events", - }, - ref_type: "branch", - repository: { - id: 656732269, - url: "https://api.github.com/repos/triggerdotdev/empty", - fork: false, - name: "empty", - size: 0, - forks: 0, - owner: { - id: 95297378, - url: "https://api.github.com/users/triggerdotdev", - type: "Organization", - login: "triggerdotdev", - node_id: "O_kgDOBa4fYg", - html_url: "https://github.com/triggerdotdev", - gists_url: "https://api.github.com/users/triggerdotdev/gists{/gist_id}", - repos_url: "https://api.github.com/users/triggerdotdev/repos", - avatar_url: "https://avatars.githubusercontent.com/u/95297378?v=4", - events_url: "https://api.github.com/users/triggerdotdev/events{/privacy}", - site_admin: false, - gravatar_id: "", - starred_url: "https://api.github.com/users/triggerdotdev/starred{/owner}{/repo}", - followers_url: "https://api.github.com/users/triggerdotdev/followers", - following_url: "https://api.github.com/users/triggerdotdev/following{/other_user}", - organizations_url: "https://api.github.com/users/triggerdotdev/orgs", - subscriptions_url: "https://api.github.com/users/triggerdotdev/subscriptions", - received_events_url: "https://api.github.com/users/triggerdotdev/received_events", - }, - topics: [], - git_url: "git://github.com/triggerdotdev/empty.git", - license: null, - node_id: "R_kgDOJyTwbQ", - private: false, - ssh_url: "git@github.com:triggerdotdev/empty.git", - svn_url: "https://github.com/triggerdotdev/empty", - archived: false, - disabled: false, - has_wiki: true, - homepage: null, - html_url: "https://github.com/triggerdotdev/empty", - keys_url: "https://api.github.com/repos/triggerdotdev/empty/keys{/key_id}", - language: null, - tags_url: "https://api.github.com/repos/triggerdotdev/empty/tags", - watchers: 0, - blobs_url: "https://api.github.com/repos/triggerdotdev/empty/git/blobs{/sha}", - clone_url: "https://github.com/triggerdotdev/empty.git", - forks_url: "https://api.github.com/repos/triggerdotdev/empty/forks", - full_name: "triggerdotdev/empty", - has_pages: false, - hooks_url: "https://api.github.com/repos/triggerdotdev/empty/hooks", - pulls_url: "https://api.github.com/repos/triggerdotdev/empty/pulls{/number}", - pushed_at: "2023-06-21T17:54:25Z", - teams_url: "https://api.github.com/repos/triggerdotdev/empty/teams", - trees_url: "https://api.github.com/repos/triggerdotdev/empty/git/trees{/sha}", - created_at: "2023-06-21T14:21:07Z", - events_url: "https://api.github.com/repos/triggerdotdev/empty/events", - has_issues: true, - issues_url: "https://api.github.com/repos/triggerdotdev/empty/issues{/number}", - labels_url: "https://api.github.com/repos/triggerdotdev/empty/labels{/name}", - merges_url: "https://api.github.com/repos/triggerdotdev/empty/merges", - mirror_url: null, - updated_at: "2023-06-21T17:23:26Z", - visibility: "public", - archive_url: "https://api.github.com/repos/triggerdotdev/empty/{archive_format}{/ref}", - commits_url: "https://api.github.com/repos/triggerdotdev/empty/commits{/sha}", - compare_url: "https://api.github.com/repos/triggerdotdev/empty/compare/{base}...{head}", - description: "An empty repo that can be used to test the @trigger.dev/github integration", - forks_count: 0, - is_template: false, - open_issues: 4, - branches_url: "https://api.github.com/repos/triggerdotdev/empty/branches{/branch}", - comments_url: "https://api.github.com/repos/triggerdotdev/empty/comments{/number}", - contents_url: "https://api.github.com/repos/triggerdotdev/empty/contents/{+path}", - git_refs_url: "https://api.github.com/repos/triggerdotdev/empty/git/refs{/sha}", - git_tags_url: "https://api.github.com/repos/triggerdotdev/empty/git/tags{/sha}", - has_projects: true, - releases_url: "https://api.github.com/repos/triggerdotdev/empty/releases{/id}", - statuses_url: "https://api.github.com/repos/triggerdotdev/empty/statuses/{sha}", - allow_forking: true, - assignees_url: "https://api.github.com/repos/triggerdotdev/empty/assignees{/user}", - downloads_url: "https://api.github.com/repos/triggerdotdev/empty/downloads", - has_downloads: true, - languages_url: "https://api.github.com/repos/triggerdotdev/empty/languages", - default_branch: "main", - milestones_url: "https://api.github.com/repos/triggerdotdev/empty/milestones{/number}", - stargazers_url: "https://api.github.com/repos/triggerdotdev/empty/stargazers", - watchers_count: 0, - deployments_url: "https://api.github.com/repos/triggerdotdev/empty/deployments", - git_commits_url: "https://api.github.com/repos/triggerdotdev/empty/git/commits{/sha}", - has_discussions: false, - subscribers_url: "https://api.github.com/repos/triggerdotdev/empty/subscribers", - contributors_url: "https://api.github.com/repos/triggerdotdev/empty/contributors", - issue_events_url: "https://api.github.com/repos/triggerdotdev/empty/issues/events{/number}", - stargazers_count: 0, - subscription_url: "https://api.github.com/repos/triggerdotdev/empty/subscription", - collaborators_url: - "https://api.github.com/repos/triggerdotdev/empty/collaborators{/collaborator}", - issue_comment_url: - "https://api.github.com/repos/triggerdotdev/empty/issues/comments{/number}", - notifications_url: - "https://api.github.com/repos/triggerdotdev/empty/notifications{?since,all,participating}", - open_issues_count: 4, - web_commit_signoff_required: false, - }, - description: "An empty repo that can be used to test the @trigger.dev/github integration", - pusher_type: "user", - organization: { - id: 95297378, - url: "https://api.github.com/orgs/triggerdotdev", - login: "triggerdotdev", - node_id: "O_kgDOBa4fYg", - hooks_url: "https://api.github.com/orgs/triggerdotdev/hooks", - repos_url: "https://api.github.com/orgs/triggerdotdev/repos", - avatar_url: "https://avatars.githubusercontent.com/u/95297378?v=4", - events_url: "https://api.github.com/orgs/triggerdotdev/events", - issues_url: "https://api.github.com/orgs/triggerdotdev/issues", - description: "", - members_url: "https://api.github.com/orgs/triggerdotdev/members{/member}", - public_members_url: "https://api.github.com/orgs/triggerdotdev/public_members{/member}", - }, - master_branch: "main", - }, -}; - -export const push: EventSpecificationExample = { - id: "push", - name: "Push", - payload: { - ref: "refs/heads/main", - after: "1ca6a91f4a1385e448364a5de1960a3da60d3fe2", - before: "7f0b6655803858ac09ae05354a679d6dad03120c", - forced: false, - pusher: { - name: "matt-aitken", - email: "matt@mattaitken.com", - }, - sender: { - id: 10635986, - url: "https://api.github.com/users/matt-aitken", - type: "User", - login: "matt-aitken", - node_id: "MDQ6VXNlcjEwNjM1OTg2", - html_url: "https://github.com/matt-aitken", - gists_url: "https://api.github.com/users/matt-aitken/gists{/gist_id}", - repos_url: "https://api.github.com/users/matt-aitken/repos", - avatar_url: "https://avatars.githubusercontent.com/u/10635986?v=4", - events_url: "https://api.github.com/users/matt-aitken/events{/privacy}", - site_admin: false, - gravatar_id: "", - starred_url: "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", - followers_url: "https://api.github.com/users/matt-aitken/followers", - following_url: "https://api.github.com/users/matt-aitken/following{/other_user}", - organizations_url: "https://api.github.com/users/matt-aitken/orgs", - subscriptions_url: "https://api.github.com/users/matt-aitken/subscriptions", - received_events_url: "https://api.github.com/users/matt-aitken/received_events", - }, - commits: [ - { - id: "1ca6a91f4a1385e448364a5de1960a3da60d3fe2", - url: "https://github.com/triggerdotdev/empty/commit/1ca6a91f4a1385e448364a5de1960a3da60d3fe2", - added: [], - author: { - name: "Matt Aitken", - email: "matt@mattaitken.com", - username: "matt-aitken", - }, - message: "Updated the readme", - removed: [], - tree_id: "3a584b2cae2fe34a195e1fe437cc62031ddff447", - distinct: true, - modified: ["README.md"], - committer: { - name: "Matt Aitken", - email: "matt@mattaitken.com", - username: "matt-aitken", - }, - timestamp: "2023-06-21T19:27:16+01:00", - }, - ], - compare: "https://github.com/triggerdotdev/empty/compare/7f0b66558038...1ca6a91f4a13", - created: false, - deleted: false, - base_ref: null, - repository: { - id: 656732269, - url: "https://github.com/triggerdotdev/empty", - fork: false, - name: "empty", - size: 0, - forks: 0, - owner: { - id: 95297378, - url: "https://api.github.com/users/triggerdotdev", - name: "triggerdotdev", - type: "Organization", - email: "hello@trigger.dev", - login: "triggerdotdev", - node_id: "O_kgDOBa4fYg", - html_url: "https://github.com/triggerdotdev", - gists_url: "https://api.github.com/users/triggerdotdev/gists{/gist_id}", - repos_url: "https://api.github.com/users/triggerdotdev/repos", - avatar_url: "https://avatars.githubusercontent.com/u/95297378?v=4", - events_url: "https://api.github.com/users/triggerdotdev/events{/privacy}", - site_admin: false, - gravatar_id: "", - starred_url: "https://api.github.com/users/triggerdotdev/starred{/owner}{/repo}", - followers_url: "https://api.github.com/users/triggerdotdev/followers", - following_url: "https://api.github.com/users/triggerdotdev/following{/other_user}", - organizations_url: "https://api.github.com/users/triggerdotdev/orgs", - subscriptions_url: "https://api.github.com/users/triggerdotdev/subscriptions", - received_events_url: "https://api.github.com/users/triggerdotdev/received_events", - }, - topics: [], - git_url: "git://github.com/triggerdotdev/empty.git", - license: null, - node_id: "R_kgDOJyTwbQ", - private: false, - ssh_url: "git@github.com:triggerdotdev/empty.git", - svn_url: "https://github.com/triggerdotdev/empty", - archived: false, - disabled: false, - has_wiki: true, - homepage: null, - html_url: "https://github.com/triggerdotdev/empty", - keys_url: "https://api.github.com/repos/triggerdotdev/empty/keys{/key_id}", - language: null, - tags_url: "https://api.github.com/repos/triggerdotdev/empty/tags", - watchers: 0, - blobs_url: "https://api.github.com/repos/triggerdotdev/empty/git/blobs{/sha}", - clone_url: "https://github.com/triggerdotdev/empty.git", - forks_url: "https://api.github.com/repos/triggerdotdev/empty/forks", - full_name: "triggerdotdev/empty", - has_pages: false, - hooks_url: "https://api.github.com/repos/triggerdotdev/empty/hooks", - pulls_url: "https://api.github.com/repos/triggerdotdev/empty/pulls{/number}", - pushed_at: 1687372039, - teams_url: "https://api.github.com/repos/triggerdotdev/empty/teams", - trees_url: "https://api.github.com/repos/triggerdotdev/empty/git/trees{/sha}", - created_at: 1687357267, - events_url: "https://api.github.com/repos/triggerdotdev/empty/events", - has_issues: true, - issues_url: "https://api.github.com/repos/triggerdotdev/empty/issues{/number}", - labels_url: "https://api.github.com/repos/triggerdotdev/empty/labels{/name}", - merges_url: "https://api.github.com/repos/triggerdotdev/empty/merges", - mirror_url: null, - stargazers: 0, - updated_at: "2023-06-21T17:23:26Z", - visibility: "public", - archive_url: "https://api.github.com/repos/triggerdotdev/empty/{archive_format}{/ref}", - commits_url: "https://api.github.com/repos/triggerdotdev/empty/commits{/sha}", - compare_url: "https://api.github.com/repos/triggerdotdev/empty/compare/{base}...{head}", - description: "An empty repo that can be used to test the @trigger.dev/github integration", - forks_count: 0, - is_template: false, - open_issues: 4, - branches_url: "https://api.github.com/repos/triggerdotdev/empty/branches{/branch}", - comments_url: "https://api.github.com/repos/triggerdotdev/empty/comments{/number}", - contents_url: "https://api.github.com/repos/triggerdotdev/empty/contents/{+path}", - git_refs_url: "https://api.github.com/repos/triggerdotdev/empty/git/refs{/sha}", - git_tags_url: "https://api.github.com/repos/triggerdotdev/empty/git/tags{/sha}", - has_projects: true, - organization: "triggerdotdev", - releases_url: "https://api.github.com/repos/triggerdotdev/empty/releases{/id}", - statuses_url: "https://api.github.com/repos/triggerdotdev/empty/statuses/{sha}", - allow_forking: true, - assignees_url: "https://api.github.com/repos/triggerdotdev/empty/assignees{/user}", - downloads_url: "https://api.github.com/repos/triggerdotdev/empty/downloads", - has_downloads: true, - languages_url: "https://api.github.com/repos/triggerdotdev/empty/languages", - master_branch: "main", - default_branch: "main", - milestones_url: "https://api.github.com/repos/triggerdotdev/empty/milestones{/number}", - stargazers_url: "https://api.github.com/repos/triggerdotdev/empty/stargazers", - watchers_count: 0, - deployments_url: "https://api.github.com/repos/triggerdotdev/empty/deployments", - git_commits_url: "https://api.github.com/repos/triggerdotdev/empty/git/commits{/sha}", - has_discussions: false, - subscribers_url: "https://api.github.com/repos/triggerdotdev/empty/subscribers", - contributors_url: "https://api.github.com/repos/triggerdotdev/empty/contributors", - issue_events_url: "https://api.github.com/repos/triggerdotdev/empty/issues/events{/number}", - stargazers_count: 0, - subscription_url: "https://api.github.com/repos/triggerdotdev/empty/subscription", - collaborators_url: - "https://api.github.com/repos/triggerdotdev/empty/collaborators{/collaborator}", - issue_comment_url: - "https://api.github.com/repos/triggerdotdev/empty/issues/comments{/number}", - notifications_url: - "https://api.github.com/repos/triggerdotdev/empty/notifications{?since,all,participating}", - open_issues_count: 4, - web_commit_signoff_required: false, - }, - head_commit: { - id: "1ca6a91f4a1385e448364a5de1960a3da60d3fe2", - url: "https://github.com/triggerdotdev/empty/commit/1ca6a91f4a1385e448364a5de1960a3da60d3fe2", - added: [], - author: { - name: "Matt Aitken", - email: "matt@mattaitken.com", - username: "matt-aitken", - }, - message: "Updated the readme", - removed: [], - tree_id: "3a584b2cae2fe34a195e1fe437cc62031ddff447", - distinct: true, - modified: ["README.md"], - committer: { - name: "Matt Aitken", - email: "matt@mattaitken.com", - username: "matt-aitken", - }, - timestamp: "2023-06-21T19:27:16+01:00", - }, - organization: { - id: 95297378, - url: "https://api.github.com/orgs/triggerdotdev", - login: "triggerdotdev", - node_id: "O_kgDOBa4fYg", - hooks_url: "https://api.github.com/orgs/triggerdotdev/hooks", - repos_url: "https://api.github.com/orgs/triggerdotdev/repos", - avatar_url: "https://avatars.githubusercontent.com/u/95297378?v=4", - events_url: "https://api.github.com/orgs/triggerdotdev/events", - issues_url: "https://api.github.com/orgs/triggerdotdev/issues", - description: "", - members_url: "https://api.github.com/orgs/triggerdotdev/members{/member}", - public_members_url: "https://api.github.com/orgs/triggerdotdev/public_members{/member}", - }, - }, -}; - -export const pullRequestOpened: EventSpecificationExample = { - id: "pull_request.opened", - name: "Pull request opened", - payload: { - action: "opened", - number: 5, - sender: { - id: 10635986, - url: "https://api.github.com/users/matt-aitken", - type: "User", - login: "matt-aitken", - node_id: "MDQ6VXNlcjEwNjM1OTg2", - html_url: "https://github.com/matt-aitken", - gists_url: "https://api.github.com/users/matt-aitken/gists{/gist_id}", - repos_url: "https://api.github.com/users/matt-aitken/repos", - avatar_url: "https://avatars.githubusercontent.com/u/10635986?v=4", - events_url: "https://api.github.com/users/matt-aitken/events{/privacy}", - site_admin: false, - gravatar_id: "", - starred_url: "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", - followers_url: "https://api.github.com/users/matt-aitken/followers", - following_url: "https://api.github.com/users/matt-aitken/following{/other_user}", - organizations_url: "https://api.github.com/users/matt-aitken/orgs", - subscriptions_url: "https://api.github.com/users/matt-aitken/subscriptions", - received_events_url: "https://api.github.com/users/matt-aitken/received_events", - }, - repository: { - id: 656732269, - url: "https://api.github.com/repos/triggerdotdev/empty", - fork: false, - name: "empty", - size: 0, - forks: 0, - owner: { - id: 95297378, - url: "https://api.github.com/users/triggerdotdev", - type: "Organization", - login: "triggerdotdev", - node_id: "O_kgDOBa4fYg", - html_url: "https://github.com/triggerdotdev", - gists_url: "https://api.github.com/users/triggerdotdev/gists{/gist_id}", - repos_url: "https://api.github.com/users/triggerdotdev/repos", - avatar_url: "https://avatars.githubusercontent.com/u/95297378?v=4", - events_url: "https://api.github.com/users/triggerdotdev/events{/privacy}", - site_admin: false, - gravatar_id: "", - starred_url: "https://api.github.com/users/triggerdotdev/starred{/owner}{/repo}", - followers_url: "https://api.github.com/users/triggerdotdev/followers", - following_url: "https://api.github.com/users/triggerdotdev/following{/other_user}", - organizations_url: "https://api.github.com/users/triggerdotdev/orgs", - subscriptions_url: "https://api.github.com/users/triggerdotdev/subscriptions", - received_events_url: "https://api.github.com/users/triggerdotdev/received_events", - }, - topics: [], - git_url: "git://github.com/triggerdotdev/empty.git", - license: null, - node_id: "R_kgDOJyTwbQ", - private: false, - ssh_url: "git@github.com:triggerdotdev/empty.git", - svn_url: "https://github.com/triggerdotdev/empty", - archived: false, - disabled: false, - has_wiki: true, - homepage: null, - html_url: "https://github.com/triggerdotdev/empty", - keys_url: "https://api.github.com/repos/triggerdotdev/empty/keys{/key_id}", - language: null, - tags_url: "https://api.github.com/repos/triggerdotdev/empty/tags", - watchers: 0, - blobs_url: "https://api.github.com/repos/triggerdotdev/empty/git/blobs{/sha}", - clone_url: "https://github.com/triggerdotdev/empty.git", - forks_url: "https://api.github.com/repos/triggerdotdev/empty/forks", - full_name: "triggerdotdev/empty", - has_pages: false, - hooks_url: "https://api.github.com/repos/triggerdotdev/empty/hooks", - pulls_url: "https://api.github.com/repos/triggerdotdev/empty/pulls{/number}", - pushed_at: "2023-06-21T18:38:34Z", - teams_url: "https://api.github.com/repos/triggerdotdev/empty/teams", - trees_url: "https://api.github.com/repos/triggerdotdev/empty/git/trees{/sha}", - created_at: "2023-06-21T14:21:07Z", - events_url: "https://api.github.com/repos/triggerdotdev/empty/events", - has_issues: true, - issues_url: "https://api.github.com/repos/triggerdotdev/empty/issues{/number}", - labels_url: "https://api.github.com/repos/triggerdotdev/empty/labels{/name}", - merges_url: "https://api.github.com/repos/triggerdotdev/empty/merges", - mirror_url: null, - updated_at: "2023-06-21T17:23:26Z", - visibility: "public", - archive_url: "https://api.github.com/repos/triggerdotdev/empty/{archive_format}{/ref}", - commits_url: "https://api.github.com/repos/triggerdotdev/empty/commits{/sha}", - compare_url: "https://api.github.com/repos/triggerdotdev/empty/compare/{base}...{head}", - description: "An empty repo that can be used to test the @trigger.dev/github integration", - forks_count: 0, - is_template: false, - open_issues: 5, - branches_url: "https://api.github.com/repos/triggerdotdev/empty/branches{/branch}", - comments_url: "https://api.github.com/repos/triggerdotdev/empty/comments{/number}", - contents_url: "https://api.github.com/repos/triggerdotdev/empty/contents/{+path}", - git_refs_url: "https://api.github.com/repos/triggerdotdev/empty/git/refs{/sha}", - git_tags_url: "https://api.github.com/repos/triggerdotdev/empty/git/tags{/sha}", - has_projects: true, - releases_url: "https://api.github.com/repos/triggerdotdev/empty/releases{/id}", - statuses_url: "https://api.github.com/repos/triggerdotdev/empty/statuses/{sha}", - allow_forking: true, - assignees_url: "https://api.github.com/repos/triggerdotdev/empty/assignees{/user}", - downloads_url: "https://api.github.com/repos/triggerdotdev/empty/downloads", - has_downloads: true, - languages_url: "https://api.github.com/repos/triggerdotdev/empty/languages", - default_branch: "main", - milestones_url: "https://api.github.com/repos/triggerdotdev/empty/milestones{/number}", - stargazers_url: "https://api.github.com/repos/triggerdotdev/empty/stargazers", - watchers_count: 0, - deployments_url: "https://api.github.com/repos/triggerdotdev/empty/deployments", - git_commits_url: "https://api.github.com/repos/triggerdotdev/empty/git/commits{/sha}", - has_discussions: false, - subscribers_url: "https://api.github.com/repos/triggerdotdev/empty/subscribers", - contributors_url: "https://api.github.com/repos/triggerdotdev/empty/contributors", - issue_events_url: "https://api.github.com/repos/triggerdotdev/empty/issues/events{/number}", - stargazers_count: 0, - subscription_url: "https://api.github.com/repos/triggerdotdev/empty/subscription", - collaborators_url: - "https://api.github.com/repos/triggerdotdev/empty/collaborators{/collaborator}", - issue_comment_url: - "https://api.github.com/repos/triggerdotdev/empty/issues/comments{/number}", - notifications_url: - "https://api.github.com/repos/triggerdotdev/empty/notifications{?since,all,participating}", - open_issues_count: 5, - web_commit_signoff_required: false, - }, - organization: { - id: 95297378, - url: "https://api.github.com/orgs/triggerdotdev", - login: "triggerdotdev", - node_id: "O_kgDOBa4fYg", - hooks_url: "https://api.github.com/orgs/triggerdotdev/hooks", - repos_url: "https://api.github.com/orgs/triggerdotdev/repos", - avatar_url: "https://avatars.githubusercontent.com/u/95297378?v=4", - events_url: "https://api.github.com/orgs/triggerdotdev/events", - issues_url: "https://api.github.com/orgs/triggerdotdev/issues", - description: "", - members_url: "https://api.github.com/orgs/triggerdotdev/members{/member}", - public_members_url: "https://api.github.com/orgs/triggerdotdev/public_members{/member}", - }, - pull_request: { - id: 1402223044, - url: "https://api.github.com/repos/triggerdotdev/empty/pulls/5", - base: { - ref: "main", - sha: "1ca6a91f4a1385e448364a5de1960a3da60d3fe2", - repo: { - id: 656732269, - url: "https://api.github.com/repos/triggerdotdev/empty", - fork: false, - name: "empty", - size: 0, - forks: 0, - owner: { - id: 95297378, - url: "https://api.github.com/users/triggerdotdev", - type: "Organization", - login: "triggerdotdev", - node_id: "O_kgDOBa4fYg", - html_url: "https://github.com/triggerdotdev", - gists_url: "https://api.github.com/users/triggerdotdev/gists{/gist_id}", - repos_url: "https://api.github.com/users/triggerdotdev/repos", - avatar_url: "https://avatars.githubusercontent.com/u/95297378?v=4", - events_url: "https://api.github.com/users/triggerdotdev/events{/privacy}", - site_admin: false, - gravatar_id: "", - starred_url: "https://api.github.com/users/triggerdotdev/starred{/owner}{/repo}", - followers_url: "https://api.github.com/users/triggerdotdev/followers", - following_url: "https://api.github.com/users/triggerdotdev/following{/other_user}", - organizations_url: "https://api.github.com/users/triggerdotdev/orgs", - subscriptions_url: "https://api.github.com/users/triggerdotdev/subscriptions", - received_events_url: "https://api.github.com/users/triggerdotdev/received_events", - }, - topics: [], - git_url: "git://github.com/triggerdotdev/empty.git", - license: null, - node_id: "R_kgDOJyTwbQ", - private: false, - ssh_url: "git@github.com:triggerdotdev/empty.git", - svn_url: "https://github.com/triggerdotdev/empty", - archived: false, - disabled: false, - has_wiki: true, - homepage: null, - html_url: "https://github.com/triggerdotdev/empty", - keys_url: "https://api.github.com/repos/triggerdotdev/empty/keys{/key_id}", - language: null, - tags_url: "https://api.github.com/repos/triggerdotdev/empty/tags", - watchers: 0, - blobs_url: "https://api.github.com/repos/triggerdotdev/empty/git/blobs{/sha}", - clone_url: "https://github.com/triggerdotdev/empty.git", - forks_url: "https://api.github.com/repos/triggerdotdev/empty/forks", - full_name: "triggerdotdev/empty", - has_pages: false, - hooks_url: "https://api.github.com/repos/triggerdotdev/empty/hooks", - pulls_url: "https://api.github.com/repos/triggerdotdev/empty/pulls{/number}", - pushed_at: "2023-06-21T18:38:34Z", - teams_url: "https://api.github.com/repos/triggerdotdev/empty/teams", - trees_url: "https://api.github.com/repos/triggerdotdev/empty/git/trees{/sha}", - created_at: "2023-06-21T14:21:07Z", - events_url: "https://api.github.com/repos/triggerdotdev/empty/events", - has_issues: true, - issues_url: "https://api.github.com/repos/triggerdotdev/empty/issues{/number}", - labels_url: "https://api.github.com/repos/triggerdotdev/empty/labels{/name}", - merges_url: "https://api.github.com/repos/triggerdotdev/empty/merges", - mirror_url: null, - updated_at: "2023-06-21T17:23:26Z", - visibility: "public", - archive_url: "https://api.github.com/repos/triggerdotdev/empty/{archive_format}{/ref}", - commits_url: "https://api.github.com/repos/triggerdotdev/empty/commits{/sha}", - compare_url: "https://api.github.com/repos/triggerdotdev/empty/compare/{base}...{head}", - description: "An empty repo that can be used to test the @trigger.dev/github integration", - forks_count: 0, - is_template: false, - open_issues: 5, - branches_url: "https://api.github.com/repos/triggerdotdev/empty/branches{/branch}", - comments_url: "https://api.github.com/repos/triggerdotdev/empty/comments{/number}", - contents_url: "https://api.github.com/repos/triggerdotdev/empty/contents/{+path}", - git_refs_url: "https://api.github.com/repos/triggerdotdev/empty/git/refs{/sha}", - git_tags_url: "https://api.github.com/repos/triggerdotdev/empty/git/tags{/sha}", - has_projects: true, - releases_url: "https://api.github.com/repos/triggerdotdev/empty/releases{/id}", - statuses_url: "https://api.github.com/repos/triggerdotdev/empty/statuses/{sha}", - allow_forking: true, - assignees_url: "https://api.github.com/repos/triggerdotdev/empty/assignees{/user}", - downloads_url: "https://api.github.com/repos/triggerdotdev/empty/downloads", - has_downloads: true, - languages_url: "https://api.github.com/repos/triggerdotdev/empty/languages", - default_branch: "main", - milestones_url: "https://api.github.com/repos/triggerdotdev/empty/milestones{/number}", - stargazers_url: "https://api.github.com/repos/triggerdotdev/empty/stargazers", - watchers_count: 0, - deployments_url: "https://api.github.com/repos/triggerdotdev/empty/deployments", - git_commits_url: "https://api.github.com/repos/triggerdotdev/empty/git/commits{/sha}", - has_discussions: false, - subscribers_url: "https://api.github.com/repos/triggerdotdev/empty/subscribers", - allow_auto_merge: false, - contributors_url: "https://api.github.com/repos/triggerdotdev/empty/contributors", - issue_events_url: - "https://api.github.com/repos/triggerdotdev/empty/issues/events{/number}", - stargazers_count: 0, - subscription_url: "https://api.github.com/repos/triggerdotdev/empty/subscription", - collaborators_url: - "https://api.github.com/repos/triggerdotdev/empty/collaborators{/collaborator}", - issue_comment_url: - "https://api.github.com/repos/triggerdotdev/empty/issues/comments{/number}", - notifications_url: - "https://api.github.com/repos/triggerdotdev/empty/notifications{?since,all,participating}", - open_issues_count: 5, - allow_merge_commit: true, - allow_rebase_merge: true, - allow_squash_merge: true, - merge_commit_title: "MERGE_MESSAGE", - allow_update_branch: false, - merge_commit_message: "PR_TITLE", - delete_branch_on_merge: false, - squash_merge_commit_title: "COMMIT_OR_PR_TITLE", - squash_merge_commit_message: "COMMIT_MESSAGES", - web_commit_signoff_required: false, - use_squash_pr_title_as_default: false, - }, - user: { - id: 95297378, - url: "https://api.github.com/users/triggerdotdev", - type: "Organization", - login: "triggerdotdev", - node_id: "O_kgDOBa4fYg", - html_url: "https://github.com/triggerdotdev", - gists_url: "https://api.github.com/users/triggerdotdev/gists{/gist_id}", - repos_url: "https://api.github.com/users/triggerdotdev/repos", - avatar_url: "https://avatars.githubusercontent.com/u/95297378?v=4", - events_url: "https://api.github.com/users/triggerdotdev/events{/privacy}", - site_admin: false, - gravatar_id: "", - starred_url: "https://api.github.com/users/triggerdotdev/starred{/owner}{/repo}", - followers_url: "https://api.github.com/users/triggerdotdev/followers", - following_url: "https://api.github.com/users/triggerdotdev/following{/other_user}", - organizations_url: "https://api.github.com/users/triggerdotdev/orgs", - subscriptions_url: "https://api.github.com/users/triggerdotdev/subscriptions", - received_events_url: "https://api.github.com/users/triggerdotdev/received_events", - }, - label: "triggerdotdev:main", - }, - body: "A bit more added to the readme which could be useful", - head: { - ref: "test", - sha: "073aa42afebca03c4b34361564e3976da5c65d48", - repo: { - id: 656732269, - url: "https://api.github.com/repos/triggerdotdev/empty", - fork: false, - name: "empty", - size: 0, - forks: 0, - owner: { - id: 95297378, - url: "https://api.github.com/users/triggerdotdev", - type: "Organization", - login: "triggerdotdev", - node_id: "O_kgDOBa4fYg", - html_url: "https://github.com/triggerdotdev", - gists_url: "https://api.github.com/users/triggerdotdev/gists{/gist_id}", - repos_url: "https://api.github.com/users/triggerdotdev/repos", - avatar_url: "https://avatars.githubusercontent.com/u/95297378?v=4", - events_url: "https://api.github.com/users/triggerdotdev/events{/privacy}", - site_admin: false, - gravatar_id: "", - starred_url: "https://api.github.com/users/triggerdotdev/starred{/owner}{/repo}", - followers_url: "https://api.github.com/users/triggerdotdev/followers", - following_url: "https://api.github.com/users/triggerdotdev/following{/other_user}", - organizations_url: "https://api.github.com/users/triggerdotdev/orgs", - subscriptions_url: "https://api.github.com/users/triggerdotdev/subscriptions", - received_events_url: "https://api.github.com/users/triggerdotdev/received_events", - }, - topics: [], - git_url: "git://github.com/triggerdotdev/empty.git", - license: null, - node_id: "R_kgDOJyTwbQ", - private: false, - ssh_url: "git@github.com:triggerdotdev/empty.git", - svn_url: "https://github.com/triggerdotdev/empty", - archived: false, - disabled: false, - has_wiki: true, - homepage: null, - html_url: "https://github.com/triggerdotdev/empty", - keys_url: "https://api.github.com/repos/triggerdotdev/empty/keys{/key_id}", - language: null, - tags_url: "https://api.github.com/repos/triggerdotdev/empty/tags", - watchers: 0, - blobs_url: "https://api.github.com/repos/triggerdotdev/empty/git/blobs{/sha}", - clone_url: "https://github.com/triggerdotdev/empty.git", - forks_url: "https://api.github.com/repos/triggerdotdev/empty/forks", - full_name: "triggerdotdev/empty", - has_pages: false, - hooks_url: "https://api.github.com/repos/triggerdotdev/empty/hooks", - pulls_url: "https://api.github.com/repos/triggerdotdev/empty/pulls{/number}", - pushed_at: "2023-06-21T18:38:34Z", - teams_url: "https://api.github.com/repos/triggerdotdev/empty/teams", - trees_url: "https://api.github.com/repos/triggerdotdev/empty/git/trees{/sha}", - created_at: "2023-06-21T14:21:07Z", - events_url: "https://api.github.com/repos/triggerdotdev/empty/events", - has_issues: true, - issues_url: "https://api.github.com/repos/triggerdotdev/empty/issues{/number}", - labels_url: "https://api.github.com/repos/triggerdotdev/empty/labels{/name}", - merges_url: "https://api.github.com/repos/triggerdotdev/empty/merges", - mirror_url: null, - updated_at: "2023-06-21T17:23:26Z", - visibility: "public", - archive_url: "https://api.github.com/repos/triggerdotdev/empty/{archive_format}{/ref}", - commits_url: "https://api.github.com/repos/triggerdotdev/empty/commits{/sha}", - compare_url: "https://api.github.com/repos/triggerdotdev/empty/compare/{base}...{head}", - description: "An empty repo that can be used to test the @trigger.dev/github integration", - forks_count: 0, - is_template: false, - open_issues: 5, - branches_url: "https://api.github.com/repos/triggerdotdev/empty/branches{/branch}", - comments_url: "https://api.github.com/repos/triggerdotdev/empty/comments{/number}", - contents_url: "https://api.github.com/repos/triggerdotdev/empty/contents/{+path}", - git_refs_url: "https://api.github.com/repos/triggerdotdev/empty/git/refs{/sha}", - git_tags_url: "https://api.github.com/repos/triggerdotdev/empty/git/tags{/sha}", - has_projects: true, - releases_url: "https://api.github.com/repos/triggerdotdev/empty/releases{/id}", - statuses_url: "https://api.github.com/repos/triggerdotdev/empty/statuses/{sha}", - allow_forking: true, - assignees_url: "https://api.github.com/repos/triggerdotdev/empty/assignees{/user}", - downloads_url: "https://api.github.com/repos/triggerdotdev/empty/downloads", - has_downloads: true, - languages_url: "https://api.github.com/repos/triggerdotdev/empty/languages", - default_branch: "main", - milestones_url: "https://api.github.com/repos/triggerdotdev/empty/milestones{/number}", - stargazers_url: "https://api.github.com/repos/triggerdotdev/empty/stargazers", - watchers_count: 0, - deployments_url: "https://api.github.com/repos/triggerdotdev/empty/deployments", - git_commits_url: "https://api.github.com/repos/triggerdotdev/empty/git/commits{/sha}", - has_discussions: false, - subscribers_url: "https://api.github.com/repos/triggerdotdev/empty/subscribers", - allow_auto_merge: false, - contributors_url: "https://api.github.com/repos/triggerdotdev/empty/contributors", - issue_events_url: - "https://api.github.com/repos/triggerdotdev/empty/issues/events{/number}", - stargazers_count: 0, - subscription_url: "https://api.github.com/repos/triggerdotdev/empty/subscription", - collaborators_url: - "https://api.github.com/repos/triggerdotdev/empty/collaborators{/collaborator}", - issue_comment_url: - "https://api.github.com/repos/triggerdotdev/empty/issues/comments{/number}", - notifications_url: - "https://api.github.com/repos/triggerdotdev/empty/notifications{?since,all,participating}", - open_issues_count: 5, - allow_merge_commit: true, - allow_rebase_merge: true, - allow_squash_merge: true, - merge_commit_title: "MERGE_MESSAGE", - allow_update_branch: false, - merge_commit_message: "PR_TITLE", - delete_branch_on_merge: false, - squash_merge_commit_title: "COMMIT_OR_PR_TITLE", - squash_merge_commit_message: "COMMIT_MESSAGES", - web_commit_signoff_required: false, - use_squash_pr_title_as_default: false, - }, - user: { - id: 95297378, - url: "https://api.github.com/users/triggerdotdev", - type: "Organization", - login: "triggerdotdev", - node_id: "O_kgDOBa4fYg", - html_url: "https://github.com/triggerdotdev", - gists_url: "https://api.github.com/users/triggerdotdev/gists{/gist_id}", - repos_url: "https://api.github.com/users/triggerdotdev/repos", - avatar_url: "https://avatars.githubusercontent.com/u/95297378?v=4", - events_url: "https://api.github.com/users/triggerdotdev/events{/privacy}", - site_admin: false, - gravatar_id: "", - starred_url: "https://api.github.com/users/triggerdotdev/starred{/owner}{/repo}", - followers_url: "https://api.github.com/users/triggerdotdev/followers", - following_url: "https://api.github.com/users/triggerdotdev/following{/other_user}", - organizations_url: "https://api.github.com/users/triggerdotdev/orgs", - subscriptions_url: "https://api.github.com/users/triggerdotdev/subscriptions", - received_events_url: "https://api.github.com/users/triggerdotdev/received_events", - }, - label: "triggerdotdev:test", - }, - user: { - id: 10635986, - url: "https://api.github.com/users/matt-aitken", - type: "User", - login: "matt-aitken", - node_id: "MDQ6VXNlcjEwNjM1OTg2", - html_url: "https://github.com/matt-aitken", - gists_url: "https://api.github.com/users/matt-aitken/gists{/gist_id}", - repos_url: "https://api.github.com/users/matt-aitken/repos", - avatar_url: "https://avatars.githubusercontent.com/u/10635986?v=4", - events_url: "https://api.github.com/users/matt-aitken/events{/privacy}", - site_admin: false, - gravatar_id: "", - starred_url: "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", - followers_url: "https://api.github.com/users/matt-aitken/followers", - following_url: "https://api.github.com/users/matt-aitken/following{/other_user}", - organizations_url: "https://api.github.com/users/matt-aitken/orgs", - subscriptions_url: "https://api.github.com/users/matt-aitken/subscriptions", - received_events_url: "https://api.github.com/users/matt-aitken/received_events", - }, - draft: false, - state: "open", - title: "Added more to the readme", - _links: { - html: { - href: "https://github.com/triggerdotdev/empty/pull/5", - }, - self: { - href: "https://api.github.com/repos/triggerdotdev/empty/pulls/5", - }, - issue: { - href: "https://api.github.com/repos/triggerdotdev/empty/issues/5", - }, - commits: { - href: "https://api.github.com/repos/triggerdotdev/empty/pulls/5/commits", - }, - comments: { - href: "https://api.github.com/repos/triggerdotdev/empty/issues/5/comments", - }, - statuses: { - href: "https://api.github.com/repos/triggerdotdev/empty/statuses/073aa42afebca03c4b34361564e3976da5c65d48", - }, - review_comment: { - href: "https://api.github.com/repos/triggerdotdev/empty/pulls/comments{/number}", - }, - review_comments: { - href: "https://api.github.com/repos/triggerdotdev/empty/pulls/5/comments", - }, - }, - labels: [], - locked: false, - merged: false, - number: 5, - commits: 1, - node_id: "PR_kwDOJyTwbc5TlDnE", - assignee: null, - comments: 0, - diff_url: "https://github.com/triggerdotdev/empty/pull/5.diff", - html_url: "https://github.com/triggerdotdev/empty/pull/5", - additions: 2, - assignees: [], - closed_at: null, - deletions: 0, - issue_url: "https://api.github.com/repos/triggerdotdev/empty/issues/5", - mergeable: null, - merged_at: null, - merged_by: null, - milestone: null, - patch_url: "https://github.com/triggerdotdev/empty/pull/5.patch", - auto_merge: null, - created_at: "2023-06-21T18:39:13Z", - rebaseable: null, - updated_at: "2023-06-21T18:39:13Z", - commits_url: "https://api.github.com/repos/triggerdotdev/empty/pulls/5/commits", - comments_url: "https://api.github.com/repos/triggerdotdev/empty/issues/5/comments", - statuses_url: - "https://api.github.com/repos/triggerdotdev/empty/statuses/073aa42afebca03c4b34361564e3976da5c65d48", - changed_files: 1, - mergeable_state: "unknown", - requested_teams: [], - review_comments: 0, - merge_commit_sha: null, - active_lock_reason: null, - author_association: "MEMBER", - review_comment_url: - "https://api.github.com/repos/triggerdotdev/empty/pulls/comments{/number}", - requested_reviewers: [], - review_comments_url: "https://api.github.com/repos/triggerdotdev/empty/pulls/5/comments", - maintainer_can_modify: false, - }, - }, -}; - -export const pullRequestReviewSubmitted: EventSpecificationExample = { - id: "pull_request_review.submitted", - name: "Pull request review submitted", - payload: { - action: "submitted", - review: { - id: 1491475123, - body: "This needs some work still", - user: { - id: 10635986, - url: "https://api.github.com/users/matt-aitken", - type: "User", - login: "matt-aitken", - node_id: "MDQ6VXNlcjEwNjM1OTg2", - html_url: "https://github.com/matt-aitken", - gists_url: "https://api.github.com/users/matt-aitken/gists{/gist_id}", - repos_url: "https://api.github.com/users/matt-aitken/repos", - avatar_url: "https://avatars.githubusercontent.com/u/10635986?v=4", - events_url: "https://api.github.com/users/matt-aitken/events{/privacy}", - site_admin: false, - gravatar_id: "", - starred_url: "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", - followers_url: "https://api.github.com/users/matt-aitken/followers", - following_url: "https://api.github.com/users/matt-aitken/following{/other_user}", - organizations_url: "https://api.github.com/users/matt-aitken/orgs", - subscriptions_url: "https://api.github.com/users/matt-aitken/subscriptions", - received_events_url: "https://api.github.com/users/matt-aitken/received_events", - }, - state: "commented", - _links: { - html: { - href: "https://github.com/triggerdotdev/empty/pull/5#pullrequestreview-1491475123", - }, - pull_request: { - href: "https://api.github.com/repos/triggerdotdev/empty/pulls/5", - }, - }, - node_id: "PRR_kwDOJyTwbc5Y5hqz", - html_url: "https://github.com/triggerdotdev/empty/pull/5#pullrequestreview-1491475123", - commit_id: "073aa42afebca03c4b34361564e3976da5c65d48", - submitted_at: "2023-06-21T18:47:47Z", - pull_request_url: "https://api.github.com/repos/triggerdotdev/empty/pulls/5", - author_association: "MEMBER", - }, - sender: { - id: 10635986, - url: "https://api.github.com/users/matt-aitken", - type: "User", - login: "matt-aitken", - node_id: "MDQ6VXNlcjEwNjM1OTg2", - html_url: "https://github.com/matt-aitken", - gists_url: "https://api.github.com/users/matt-aitken/gists{/gist_id}", - repos_url: "https://api.github.com/users/matt-aitken/repos", - avatar_url: "https://avatars.githubusercontent.com/u/10635986?v=4", - events_url: "https://api.github.com/users/matt-aitken/events{/privacy}", - site_admin: false, - gravatar_id: "", - starred_url: "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", - followers_url: "https://api.github.com/users/matt-aitken/followers", - following_url: "https://api.github.com/users/matt-aitken/following{/other_user}", - organizations_url: "https://api.github.com/users/matt-aitken/orgs", - subscriptions_url: "https://api.github.com/users/matt-aitken/subscriptions", - received_events_url: "https://api.github.com/users/matt-aitken/received_events", - }, - repository: { - id: 656732269, - url: "https://api.github.com/repos/triggerdotdev/empty", - fork: false, - name: "empty", - size: 0, - forks: 0, - owner: { - id: 95297378, - url: "https://api.github.com/users/triggerdotdev", - type: "Organization", - login: "triggerdotdev", - node_id: "O_kgDOBa4fYg", - html_url: "https://github.com/triggerdotdev", - gists_url: "https://api.github.com/users/triggerdotdev/gists{/gist_id}", - repos_url: "https://api.github.com/users/triggerdotdev/repos", - avatar_url: "https://avatars.githubusercontent.com/u/95297378?v=4", - events_url: "https://api.github.com/users/triggerdotdev/events{/privacy}", - site_admin: false, - gravatar_id: "", - starred_url: "https://api.github.com/users/triggerdotdev/starred{/owner}{/repo}", - followers_url: "https://api.github.com/users/triggerdotdev/followers", - following_url: "https://api.github.com/users/triggerdotdev/following{/other_user}", - organizations_url: "https://api.github.com/users/triggerdotdev/orgs", - subscriptions_url: "https://api.github.com/users/triggerdotdev/subscriptions", - received_events_url: "https://api.github.com/users/triggerdotdev/received_events", - }, - topics: [], - git_url: "git://github.com/triggerdotdev/empty.git", - license: null, - node_id: "R_kgDOJyTwbQ", - private: false, - ssh_url: "git@github.com:triggerdotdev/empty.git", - svn_url: "https://github.com/triggerdotdev/empty", - archived: false, - disabled: false, - has_wiki: true, - homepage: null, - html_url: "https://github.com/triggerdotdev/empty", - keys_url: "https://api.github.com/repos/triggerdotdev/empty/keys{/key_id}", - language: null, - tags_url: "https://api.github.com/repos/triggerdotdev/empty/tags", - watchers: 0, - blobs_url: "https://api.github.com/repos/triggerdotdev/empty/git/blobs{/sha}", - clone_url: "https://github.com/triggerdotdev/empty.git", - forks_url: "https://api.github.com/repos/triggerdotdev/empty/forks", - full_name: "triggerdotdev/empty", - has_pages: false, - hooks_url: "https://api.github.com/repos/triggerdotdev/empty/hooks", - pulls_url: "https://api.github.com/repos/triggerdotdev/empty/pulls{/number}", - pushed_at: "2023-06-21T18:39:13Z", - teams_url: "https://api.github.com/repos/triggerdotdev/empty/teams", - trees_url: "https://api.github.com/repos/triggerdotdev/empty/git/trees{/sha}", - created_at: "2023-06-21T14:21:07Z", - events_url: "https://api.github.com/repos/triggerdotdev/empty/events", - has_issues: true, - issues_url: "https://api.github.com/repos/triggerdotdev/empty/issues{/number}", - labels_url: "https://api.github.com/repos/triggerdotdev/empty/labels{/name}", - merges_url: "https://api.github.com/repos/triggerdotdev/empty/merges", - mirror_url: null, - updated_at: "2023-06-21T17:23:26Z", - visibility: "public", - archive_url: "https://api.github.com/repos/triggerdotdev/empty/{archive_format}{/ref}", - commits_url: "https://api.github.com/repos/triggerdotdev/empty/commits{/sha}", - compare_url: "https://api.github.com/repos/triggerdotdev/empty/compare/{base}...{head}", - description: "An empty repo that can be used to test the @trigger.dev/github integration", - forks_count: 0, - is_template: false, - open_issues: 5, - branches_url: "https://api.github.com/repos/triggerdotdev/empty/branches{/branch}", - comments_url: "https://api.github.com/repos/triggerdotdev/empty/comments{/number}", - contents_url: "https://api.github.com/repos/triggerdotdev/empty/contents/{+path}", - git_refs_url: "https://api.github.com/repos/triggerdotdev/empty/git/refs{/sha}", - git_tags_url: "https://api.github.com/repos/triggerdotdev/empty/git/tags{/sha}", - has_projects: true, - releases_url: "https://api.github.com/repos/triggerdotdev/empty/releases{/id}", - statuses_url: "https://api.github.com/repos/triggerdotdev/empty/statuses/{sha}", - allow_forking: true, - assignees_url: "https://api.github.com/repos/triggerdotdev/empty/assignees{/user}", - downloads_url: "https://api.github.com/repos/triggerdotdev/empty/downloads", - has_downloads: true, - languages_url: "https://api.github.com/repos/triggerdotdev/empty/languages", - default_branch: "main", - milestones_url: "https://api.github.com/repos/triggerdotdev/empty/milestones{/number}", - stargazers_url: "https://api.github.com/repos/triggerdotdev/empty/stargazers", - watchers_count: 0, - deployments_url: "https://api.github.com/repos/triggerdotdev/empty/deployments", - git_commits_url: "https://api.github.com/repos/triggerdotdev/empty/git/commits{/sha}", - has_discussions: false, - subscribers_url: "https://api.github.com/repos/triggerdotdev/empty/subscribers", - contributors_url: "https://api.github.com/repos/triggerdotdev/empty/contributors", - issue_events_url: "https://api.github.com/repos/triggerdotdev/empty/issues/events{/number}", - stargazers_count: 0, - subscription_url: "https://api.github.com/repos/triggerdotdev/empty/subscription", - collaborators_url: - "https://api.github.com/repos/triggerdotdev/empty/collaborators{/collaborator}", - issue_comment_url: - "https://api.github.com/repos/triggerdotdev/empty/issues/comments{/number}", - notifications_url: - "https://api.github.com/repos/triggerdotdev/empty/notifications{?since,all,participating}", - open_issues_count: 5, - web_commit_signoff_required: false, - }, - organization: { - id: 95297378, - url: "https://api.github.com/orgs/triggerdotdev", - login: "triggerdotdev", - node_id: "O_kgDOBa4fYg", - hooks_url: "https://api.github.com/orgs/triggerdotdev/hooks", - repos_url: "https://api.github.com/orgs/triggerdotdev/repos", - avatar_url: "https://avatars.githubusercontent.com/u/95297378?v=4", - events_url: "https://api.github.com/orgs/triggerdotdev/events", - issues_url: "https://api.github.com/orgs/triggerdotdev/issues", - description: "", - members_url: "https://api.github.com/orgs/triggerdotdev/members{/member}", - public_members_url: "https://api.github.com/orgs/triggerdotdev/public_members{/member}", - }, - pull_request: { - id: 1402223044, - url: "https://api.github.com/repos/triggerdotdev/empty/pulls/5", - base: { - ref: "main", - sha: "1ca6a91f4a1385e448364a5de1960a3da60d3fe2", - repo: { - id: 656732269, - url: "https://api.github.com/repos/triggerdotdev/empty", - fork: false, - name: "empty", - size: 0, - forks: 0, - owner: { - id: 95297378, - url: "https://api.github.com/users/triggerdotdev", - type: "Organization", - login: "triggerdotdev", - node_id: "O_kgDOBa4fYg", - html_url: "https://github.com/triggerdotdev", - gists_url: "https://api.github.com/users/triggerdotdev/gists{/gist_id}", - repos_url: "https://api.github.com/users/triggerdotdev/repos", - avatar_url: "https://avatars.githubusercontent.com/u/95297378?v=4", - events_url: "https://api.github.com/users/triggerdotdev/events{/privacy}", - site_admin: false, - gravatar_id: "", - starred_url: "https://api.github.com/users/triggerdotdev/starred{/owner}{/repo}", - followers_url: "https://api.github.com/users/triggerdotdev/followers", - following_url: "https://api.github.com/users/triggerdotdev/following{/other_user}", - organizations_url: "https://api.github.com/users/triggerdotdev/orgs", - subscriptions_url: "https://api.github.com/users/triggerdotdev/subscriptions", - received_events_url: "https://api.github.com/users/triggerdotdev/received_events", - }, - topics: [], - git_url: "git://github.com/triggerdotdev/empty.git", - license: null, - node_id: "R_kgDOJyTwbQ", - private: false, - ssh_url: "git@github.com:triggerdotdev/empty.git", - svn_url: "https://github.com/triggerdotdev/empty", - archived: false, - disabled: false, - has_wiki: true, - homepage: null, - html_url: "https://github.com/triggerdotdev/empty", - keys_url: "https://api.github.com/repos/triggerdotdev/empty/keys{/key_id}", - language: null, - tags_url: "https://api.github.com/repos/triggerdotdev/empty/tags", - watchers: 0, - blobs_url: "https://api.github.com/repos/triggerdotdev/empty/git/blobs{/sha}", - clone_url: "https://github.com/triggerdotdev/empty.git", - forks_url: "https://api.github.com/repos/triggerdotdev/empty/forks", - full_name: "triggerdotdev/empty", - has_pages: false, - hooks_url: "https://api.github.com/repos/triggerdotdev/empty/hooks", - pulls_url: "https://api.github.com/repos/triggerdotdev/empty/pulls{/number}", - pushed_at: "2023-06-21T18:39:13Z", - teams_url: "https://api.github.com/repos/triggerdotdev/empty/teams", - trees_url: "https://api.github.com/repos/triggerdotdev/empty/git/trees{/sha}", - created_at: "2023-06-21T14:21:07Z", - events_url: "https://api.github.com/repos/triggerdotdev/empty/events", - has_issues: true, - issues_url: "https://api.github.com/repos/triggerdotdev/empty/issues{/number}", - labels_url: "https://api.github.com/repos/triggerdotdev/empty/labels{/name}", - merges_url: "https://api.github.com/repos/triggerdotdev/empty/merges", - mirror_url: null, - updated_at: "2023-06-21T17:23:26Z", - visibility: "public", - archive_url: "https://api.github.com/repos/triggerdotdev/empty/{archive_format}{/ref}", - commits_url: "https://api.github.com/repos/triggerdotdev/empty/commits{/sha}", - compare_url: "https://api.github.com/repos/triggerdotdev/empty/compare/{base}...{head}", - description: "An empty repo that can be used to test the @trigger.dev/github integration", - forks_count: 0, - is_template: false, - open_issues: 5, - branches_url: "https://api.github.com/repos/triggerdotdev/empty/branches{/branch}", - comments_url: "https://api.github.com/repos/triggerdotdev/empty/comments{/number}", - contents_url: "https://api.github.com/repos/triggerdotdev/empty/contents/{+path}", - git_refs_url: "https://api.github.com/repos/triggerdotdev/empty/git/refs{/sha}", - git_tags_url: "https://api.github.com/repos/triggerdotdev/empty/git/tags{/sha}", - has_projects: true, - releases_url: "https://api.github.com/repos/triggerdotdev/empty/releases{/id}", - statuses_url: "https://api.github.com/repos/triggerdotdev/empty/statuses/{sha}", - allow_forking: true, - assignees_url: "https://api.github.com/repos/triggerdotdev/empty/assignees{/user}", - downloads_url: "https://api.github.com/repos/triggerdotdev/empty/downloads", - has_downloads: true, - languages_url: "https://api.github.com/repos/triggerdotdev/empty/languages", - default_branch: "main", - milestones_url: "https://api.github.com/repos/triggerdotdev/empty/milestones{/number}", - stargazers_url: "https://api.github.com/repos/triggerdotdev/empty/stargazers", - watchers_count: 0, - deployments_url: "https://api.github.com/repos/triggerdotdev/empty/deployments", - git_commits_url: "https://api.github.com/repos/triggerdotdev/empty/git/commits{/sha}", - has_discussions: false, - subscribers_url: "https://api.github.com/repos/triggerdotdev/empty/subscribers", - allow_auto_merge: false, - contributors_url: "https://api.github.com/repos/triggerdotdev/empty/contributors", - issue_events_url: - "https://api.github.com/repos/triggerdotdev/empty/issues/events{/number}", - stargazers_count: 0, - subscription_url: "https://api.github.com/repos/triggerdotdev/empty/subscription", - collaborators_url: - "https://api.github.com/repos/triggerdotdev/empty/collaborators{/collaborator}", - issue_comment_url: - "https://api.github.com/repos/triggerdotdev/empty/issues/comments{/number}", - notifications_url: - "https://api.github.com/repos/triggerdotdev/empty/notifications{?since,all,participating}", - open_issues_count: 5, - allow_merge_commit: true, - allow_rebase_merge: true, - allow_squash_merge: true, - merge_commit_title: "MERGE_MESSAGE", - allow_update_branch: false, - merge_commit_message: "PR_TITLE", - delete_branch_on_merge: false, - squash_merge_commit_title: "COMMIT_OR_PR_TITLE", - squash_merge_commit_message: "COMMIT_MESSAGES", - web_commit_signoff_required: false, - use_squash_pr_title_as_default: false, - }, - user: { - id: 95297378, - url: "https://api.github.com/users/triggerdotdev", - type: "Organization", - login: "triggerdotdev", - node_id: "O_kgDOBa4fYg", - html_url: "https://github.com/triggerdotdev", - gists_url: "https://api.github.com/users/triggerdotdev/gists{/gist_id}", - repos_url: "https://api.github.com/users/triggerdotdev/repos", - avatar_url: "https://avatars.githubusercontent.com/u/95297378?v=4", - events_url: "https://api.github.com/users/triggerdotdev/events{/privacy}", - site_admin: false, - gravatar_id: "", - starred_url: "https://api.github.com/users/triggerdotdev/starred{/owner}{/repo}", - followers_url: "https://api.github.com/users/triggerdotdev/followers", - following_url: "https://api.github.com/users/triggerdotdev/following{/other_user}", - organizations_url: "https://api.github.com/users/triggerdotdev/orgs", - subscriptions_url: "https://api.github.com/users/triggerdotdev/subscriptions", - received_events_url: "https://api.github.com/users/triggerdotdev/received_events", - }, - label: "triggerdotdev:main", - }, - body: "A bit more added to the readme which could be useful", - head: { - ref: "test", - sha: "073aa42afebca03c4b34361564e3976da5c65d48", - repo: { - id: 656732269, - url: "https://api.github.com/repos/triggerdotdev/empty", - fork: false, - name: "empty", - size: 0, - forks: 0, - owner: { - id: 95297378, - url: "https://api.github.com/users/triggerdotdev", - type: "Organization", - login: "triggerdotdev", - node_id: "O_kgDOBa4fYg", - html_url: "https://github.com/triggerdotdev", - gists_url: "https://api.github.com/users/triggerdotdev/gists{/gist_id}", - repos_url: "https://api.github.com/users/triggerdotdev/repos", - avatar_url: "https://avatars.githubusercontent.com/u/95297378?v=4", - events_url: "https://api.github.com/users/triggerdotdev/events{/privacy}", - site_admin: false, - gravatar_id: "", - starred_url: "https://api.github.com/users/triggerdotdev/starred{/owner}{/repo}", - followers_url: "https://api.github.com/users/triggerdotdev/followers", - following_url: "https://api.github.com/users/triggerdotdev/following{/other_user}", - organizations_url: "https://api.github.com/users/triggerdotdev/orgs", - subscriptions_url: "https://api.github.com/users/triggerdotdev/subscriptions", - received_events_url: "https://api.github.com/users/triggerdotdev/received_events", - }, - topics: [], - git_url: "git://github.com/triggerdotdev/empty.git", - license: null, - node_id: "R_kgDOJyTwbQ", - private: false, - ssh_url: "git@github.com:triggerdotdev/empty.git", - svn_url: "https://github.com/triggerdotdev/empty", - archived: false, - disabled: false, - has_wiki: true, - homepage: null, - html_url: "https://github.com/triggerdotdev/empty", - keys_url: "https://api.github.com/repos/triggerdotdev/empty/keys{/key_id}", - language: null, - tags_url: "https://api.github.com/repos/triggerdotdev/empty/tags", - watchers: 0, - blobs_url: "https://api.github.com/repos/triggerdotdev/empty/git/blobs{/sha}", - clone_url: "https://github.com/triggerdotdev/empty.git", - forks_url: "https://api.github.com/repos/triggerdotdev/empty/forks", - full_name: "triggerdotdev/empty", - has_pages: false, - hooks_url: "https://api.github.com/repos/triggerdotdev/empty/hooks", - pulls_url: "https://api.github.com/repos/triggerdotdev/empty/pulls{/number}", - pushed_at: "2023-06-21T18:39:13Z", - teams_url: "https://api.github.com/repos/triggerdotdev/empty/teams", - trees_url: "https://api.github.com/repos/triggerdotdev/empty/git/trees{/sha}", - created_at: "2023-06-21T14:21:07Z", - events_url: "https://api.github.com/repos/triggerdotdev/empty/events", - has_issues: true, - issues_url: "https://api.github.com/repos/triggerdotdev/empty/issues{/number}", - labels_url: "https://api.github.com/repos/triggerdotdev/empty/labels{/name}", - merges_url: "https://api.github.com/repos/triggerdotdev/empty/merges", - mirror_url: null, - updated_at: "2023-06-21T17:23:26Z", - visibility: "public", - archive_url: "https://api.github.com/repos/triggerdotdev/empty/{archive_format}{/ref}", - commits_url: "https://api.github.com/repos/triggerdotdev/empty/commits{/sha}", - compare_url: "https://api.github.com/repos/triggerdotdev/empty/compare/{base}...{head}", - description: "An empty repo that can be used to test the @trigger.dev/github integration", - forks_count: 0, - is_template: false, - open_issues: 5, - branches_url: "https://api.github.com/repos/triggerdotdev/empty/branches{/branch}", - comments_url: "https://api.github.com/repos/triggerdotdev/empty/comments{/number}", - contents_url: "https://api.github.com/repos/triggerdotdev/empty/contents/{+path}", - git_refs_url: "https://api.github.com/repos/triggerdotdev/empty/git/refs{/sha}", - git_tags_url: "https://api.github.com/repos/triggerdotdev/empty/git/tags{/sha}", - has_projects: true, - releases_url: "https://api.github.com/repos/triggerdotdev/empty/releases{/id}", - statuses_url: "https://api.github.com/repos/triggerdotdev/empty/statuses/{sha}", - allow_forking: true, - assignees_url: "https://api.github.com/repos/triggerdotdev/empty/assignees{/user}", - downloads_url: "https://api.github.com/repos/triggerdotdev/empty/downloads", - has_downloads: true, - languages_url: "https://api.github.com/repos/triggerdotdev/empty/languages", - default_branch: "main", - milestones_url: "https://api.github.com/repos/triggerdotdev/empty/milestones{/number}", - stargazers_url: "https://api.github.com/repos/triggerdotdev/empty/stargazers", - watchers_count: 0, - deployments_url: "https://api.github.com/repos/triggerdotdev/empty/deployments", - git_commits_url: "https://api.github.com/repos/triggerdotdev/empty/git/commits{/sha}", - has_discussions: false, - subscribers_url: "https://api.github.com/repos/triggerdotdev/empty/subscribers", - allow_auto_merge: false, - contributors_url: "https://api.github.com/repos/triggerdotdev/empty/contributors", - issue_events_url: - "https://api.github.com/repos/triggerdotdev/empty/issues/events{/number}", - stargazers_count: 0, - subscription_url: "https://api.github.com/repos/triggerdotdev/empty/subscription", - collaborators_url: - "https://api.github.com/repos/triggerdotdev/empty/collaborators{/collaborator}", - issue_comment_url: - "https://api.github.com/repos/triggerdotdev/empty/issues/comments{/number}", - notifications_url: - "https://api.github.com/repos/triggerdotdev/empty/notifications{?since,all,participating}", - open_issues_count: 5, - allow_merge_commit: true, - allow_rebase_merge: true, - allow_squash_merge: true, - merge_commit_title: "MERGE_MESSAGE", - allow_update_branch: false, - merge_commit_message: "PR_TITLE", - delete_branch_on_merge: false, - squash_merge_commit_title: "COMMIT_OR_PR_TITLE", - squash_merge_commit_message: "COMMIT_MESSAGES", - web_commit_signoff_required: false, - use_squash_pr_title_as_default: false, - }, - user: { - id: 95297378, - url: "https://api.github.com/users/triggerdotdev", - type: "Organization", - login: "triggerdotdev", - node_id: "O_kgDOBa4fYg", - html_url: "https://github.com/triggerdotdev", - gists_url: "https://api.github.com/users/triggerdotdev/gists{/gist_id}", - repos_url: "https://api.github.com/users/triggerdotdev/repos", - avatar_url: "https://avatars.githubusercontent.com/u/95297378?v=4", - events_url: "https://api.github.com/users/triggerdotdev/events{/privacy}", - site_admin: false, - gravatar_id: "", - starred_url: "https://api.github.com/users/triggerdotdev/starred{/owner}{/repo}", - followers_url: "https://api.github.com/users/triggerdotdev/followers", - following_url: "https://api.github.com/users/triggerdotdev/following{/other_user}", - organizations_url: "https://api.github.com/users/triggerdotdev/orgs", - subscriptions_url: "https://api.github.com/users/triggerdotdev/subscriptions", - received_events_url: "https://api.github.com/users/triggerdotdev/received_events", - }, - label: "triggerdotdev:test", - }, - user: { - id: 10635986, - url: "https://api.github.com/users/matt-aitken", - type: "User", - login: "matt-aitken", - node_id: "MDQ6VXNlcjEwNjM1OTg2", - html_url: "https://github.com/matt-aitken", - gists_url: "https://api.github.com/users/matt-aitken/gists{/gist_id}", - repos_url: "https://api.github.com/users/matt-aitken/repos", - avatar_url: "https://avatars.githubusercontent.com/u/10635986?v=4", - events_url: "https://api.github.com/users/matt-aitken/events{/privacy}", - site_admin: false, - gravatar_id: "", - starred_url: "https://api.github.com/users/matt-aitken/starred{/owner}{/repo}", - followers_url: "https://api.github.com/users/matt-aitken/followers", - following_url: "https://api.github.com/users/matt-aitken/following{/other_user}", - organizations_url: "https://api.github.com/users/matt-aitken/orgs", - subscriptions_url: "https://api.github.com/users/matt-aitken/subscriptions", - received_events_url: "https://api.github.com/users/matt-aitken/received_events", - }, - draft: false, - state: "open", - title: "Added more to the readme", - _links: { - html: { - href: "https://github.com/triggerdotdev/empty/pull/5", - }, - self: { - href: "https://api.github.com/repos/triggerdotdev/empty/pulls/5", - }, - issue: { - href: "https://api.github.com/repos/triggerdotdev/empty/issues/5", - }, - commits: { - href: "https://api.github.com/repos/triggerdotdev/empty/pulls/5/commits", - }, - comments: { - href: "https://api.github.com/repos/triggerdotdev/empty/issues/5/comments", - }, - statuses: { - href: "https://api.github.com/repos/triggerdotdev/empty/statuses/073aa42afebca03c4b34361564e3976da5c65d48", - }, - review_comment: { - href: "https://api.github.com/repos/triggerdotdev/empty/pulls/comments{/number}", - }, - review_comments: { - href: "https://api.github.com/repos/triggerdotdev/empty/pulls/5/comments", - }, - }, - labels: [], - locked: false, - number: 5, - node_id: "PR_kwDOJyTwbc5TlDnE", - assignee: null, - diff_url: "https://github.com/triggerdotdev/empty/pull/5.diff", - html_url: "https://github.com/triggerdotdev/empty/pull/5", - assignees: [], - closed_at: null, - issue_url: "https://api.github.com/repos/triggerdotdev/empty/issues/5", - merged_at: null, - milestone: null, - patch_url: "https://github.com/triggerdotdev/empty/pull/5.patch", - auto_merge: null, - created_at: "2023-06-21T18:39:13Z", - updated_at: "2023-06-21T18:47:47Z", - commits_url: "https://api.github.com/repos/triggerdotdev/empty/pulls/5/commits", - comments_url: "https://api.github.com/repos/triggerdotdev/empty/issues/5/comments", - statuses_url: - "https://api.github.com/repos/triggerdotdev/empty/statuses/073aa42afebca03c4b34361564e3976da5c65d48", - requested_teams: [], - merge_commit_sha: "f146c57c260778db17300c47c366bce0e2dbd53d", - active_lock_reason: null, - author_association: "MEMBER", - review_comment_url: - "https://api.github.com/repos/triggerdotdev/empty/pulls/comments{/number}", - requested_reviewers: [], - review_comments_url: "https://api.github.com/repos/triggerdotdev/empty/pulls/5/comments", - }, - }, -}; diff --git a/integrations/github/tsconfig.json b/integrations/github/tsconfig.json deleted file mode 100644 index a816ed394..000000000 --- a/integrations/github/tsconfig.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "extends": "@trigger.dev/tsconfig/node18.json", - "include": ["./src/**/*.ts", "tsup.config.ts"], - "compilerOptions": { - "lib": ["DOM", "DOM.Iterable", "ES2019"], - "paths": { - "@trigger.dev/sdk/*": ["../../packages/trigger-sdk/src/*"], - "@trigger.dev/sdk": ["../../packages/trigger-sdk/src/index"], - "@trigger.dev/integration-kit/*": ["../../packages/integration-kit/src/*"], - "@trigger.dev/integration-kit": ["../../packages/integration-kit/src/index"], - "@trigger.dev/tsup/*": ["../../config-packages/tsup/src/*"], - "@trigger.dev/tsup": ["../../config-packages/tsup/src/index"] - }, - "declaration": false, - "declarationMap": false, - "baseUrl": ".", - "stripInternal": true - }, - "exclude": ["node_modules"] -} diff --git a/integrations/github/tsup.config.ts b/integrations/github/tsup.config.ts deleted file mode 100644 index 1d1b59a08..000000000 --- a/integrations/github/tsup.config.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { defineConfigPackage } from "@trigger.dev/tsup"; - -export default defineConfigPackage; diff --git a/integrations/linear/CHANGELOG.md b/integrations/linear/CHANGELOG.md deleted file mode 100644 index 54262b517..000000000 --- a/integrations/linear/CHANGELOG.md +++ /dev/null @@ -1,727 +0,0 @@ -# @trigger.dev/linear - -## 3.0.0-beta.55 - -### Patch Changes - -- Updated dependencies [0591db5f2] - - @trigger.dev/sdk@3.0.0-beta.55 - - @trigger.dev/integration-kit@3.0.0-beta.55 - -## 3.0.0-beta.54 - -### Patch Changes - -- Updated dependencies [728eeeff6] - - @trigger.dev/sdk@3.0.0-beta.54 - - @trigger.dev/integration-kit@3.0.0-beta.54 - -## 3.0.0-beta.53 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.53 -- @trigger.dev/sdk@3.0.0-beta.53 - -## 3.0.0-beta.52 - -### Patch Changes - -- Updated dependencies [8cae1d087] - - @trigger.dev/sdk@3.0.0-beta.52 - - @trigger.dev/integration-kit@3.0.0-beta.52 - -## 3.0.0-beta.51 - -### Patch Changes - -- Updated dependencies [979bee50d] -- Updated dependencies [086a0f95c] -- Updated dependencies [55264657d] - - @trigger.dev/sdk@3.0.0-beta.51 - - @trigger.dev/integration-kit@3.0.0-beta.51 - -## 3.0.0-beta.50 - -### Patch Changes - -- Updated dependencies [8ba998794] - - @trigger.dev/sdk@3.0.0-beta.50 - - @trigger.dev/integration-kit@3.0.0-beta.50 - -## 3.0.0-beta.49 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.49 -- @trigger.dev/sdk@3.0.0-beta.49 - -## 3.0.0-beta.48 - -### Patch Changes - -- Updated dependencies [ecf1110ab] - - @trigger.dev/sdk@3.0.0-beta.48 - - @trigger.dev/integration-kit@3.0.0-beta.48 - -## 3.0.0-beta.47 - -### Patch Changes - -- Updated dependencies [4f95c9de4] - - @trigger.dev/sdk@3.0.0-beta.47 - - @trigger.dev/integration-kit@3.0.0-beta.47 - -## 3.0.0-beta.46 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.46 -- @trigger.dev/sdk@3.0.0-beta.46 - -## 3.0.0-beta.45 - -### Patch Changes - -- Updated dependencies [0e77e7ef7] - - @trigger.dev/sdk@3.0.0-beta.45 - - @trigger.dev/integration-kit@3.0.0-beta.45 - -## 3.0.0-beta.44 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.44 -- @trigger.dev/sdk@3.0.0-beta.44 - -## 3.0.0-beta.43 - -### Patch Changes - -- Updated dependencies [34ca7667d] - - @trigger.dev/sdk@3.0.0-beta.43 - - @trigger.dev/integration-kit@3.0.0-beta.43 - -## 3.0.0-beta.42 - -### Patch Changes - -- Updated dependencies [ecef19966] - - @trigger.dev/sdk@3.0.0-beta.42 - - @trigger.dev/integration-kit@3.0.0-beta.42 - -## 3.0.0-beta.41 - -### Patch Changes - -- Updated dependencies [7c36a1a4b] - - @trigger.dev/sdk@3.0.0-beta.41 - - @trigger.dev/integration-kit@3.0.0-beta.41 - -## 3.0.0-beta.40 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.40 -- @trigger.dev/sdk@3.0.0-beta.40 - -## 3.0.0-beta.39 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.39 -- @trigger.dev/sdk@3.0.0-beta.39 - -## 3.0.0-beta.38 - -### Patch Changes - -- Updated dependencies [1b90ffbb8] -- Updated dependencies [c405ae711] - - @trigger.dev/sdk@3.0.0-beta.38 - - @trigger.dev/integration-kit@3.0.0-beta.38 - -## 3.0.0-beta.37 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.37 -- @trigger.dev/sdk@3.0.0-beta.37 - -## 3.0.0-beta.36 - -### Patch Changes - -- Updated dependencies [51bb4c887] -- Updated dependencies [ba71f959e] - - @trigger.dev/sdk@3.0.0-beta.36 - - @trigger.dev/integration-kit@3.0.0-beta.36 - -## 3.0.0-beta.35 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.35 -- @trigger.dev/sdk@3.0.0-beta.35 - -## 3.0.0-beta.34 - -### Patch Changes - -- Updated dependencies [3a1b0c486] -- Updated dependencies [3f8b6d8fc] -- Updated dependencies [1281d40e4] - - @trigger.dev/sdk@3.0.0-beta.34 - - @trigger.dev/integration-kit@3.0.0-beta.34 - -## 3.0.0-beta.33 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.33 -- @trigger.dev/sdk@3.0.0-beta.33 - -## 3.0.0-beta.32 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.32 -- @trigger.dev/sdk@3.0.0-beta.32 - -## 3.0.0-beta.31 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.31 -- @trigger.dev/sdk@3.0.0-beta.31 - -## 3.0.0-beta.30 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.30 -- @trigger.dev/sdk@3.0.0-beta.30 - -## 3.0.0-beta.29 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.29 -- @trigger.dev/sdk@3.0.0-beta.29 - -## 3.0.0-beta.28 - -### Patch Changes - -- Updated dependencies [6d9dfbc75] - - @trigger.dev/sdk@3.0.0-beta.28 - - @trigger.dev/integration-kit@3.0.0-beta.28 - -## 3.0.0-beta.27 - -### Patch Changes - -- Updated dependencies [203e00208] - - @trigger.dev/sdk@3.0.0-beta.27 - - @trigger.dev/integration-kit@3.0.0-beta.27 - -## 3.0.0-beta.26 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.26 -- @trigger.dev/sdk@3.0.0-beta.26 - -## 3.0.0-beta.25 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.25 -- @trigger.dev/sdk@3.0.0-beta.25 - -## 3.0.0-beta.24 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.24 -- @trigger.dev/sdk@3.0.0-beta.24 - -## 3.0.0-beta.23 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.23 -- @trigger.dev/sdk@3.0.0-beta.23 - -## 3.0.0-beta.22 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.22 -- @trigger.dev/sdk@3.0.0-beta.22 - -## 3.0.0-beta.21 - -### Patch Changes - -- Updated dependencies [9491a1649] - - @trigger.dev/sdk@3.0.0-beta.21 - - @trigger.dev/integration-kit@3.0.0-beta.21 - -## 3.0.0-beta.20 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.20 -- @trigger.dev/sdk@3.0.0-beta.20 - -## 3.0.0-beta.19 - -### Patch Changes - -- Updated dependencies [e9a63a486] - - @trigger.dev/sdk@3.0.0-beta.19 - - @trigger.dev/integration-kit@3.0.0-beta.19 - -## 3.0.0-beta.18 - -### Patch Changes - -- Updated dependencies [b68012f81] -- Updated dependencies [b68012f81] -- Updated dependencies [b68012f81] - - @trigger.dev/sdk@3.0.0-beta.18 - - @trigger.dev/integration-kit@3.0.0-beta.18 - -## 3.0.0-beta.17 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.17 -- @trigger.dev/sdk@3.0.0-beta.17 - -## 3.0.0-beta.16 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.16 -- @trigger.dev/sdk@3.0.0-beta.16 - -## 3.0.0-beta.15 - -### Patch Changes - -- Updated dependencies [374edef02] -- Updated dependencies [26093896d] - - @trigger.dev/sdk@3.0.0-beta.15 - - @trigger.dev/integration-kit@3.0.0-beta.15 - -## 3.0.0-beta.14 - -### Patch Changes - -- Updated dependencies [c9e1a3e9c] - - @trigger.dev/sdk@3.0.0-beta.14 - - @trigger.dev/integration-kit@3.0.0-beta.14 - -## 3.0.0-beta.13 - -### Patch Changes - -- Updated dependencies [4986bfda2] -- Updated dependencies [44e1b8754] -- Updated dependencies [4986bfda2] -- Updated dependencies [4986bfda2] - - @trigger.dev/sdk@3.0.0-beta.13 - - @trigger.dev/integration-kit@3.0.0-beta.13 - -## 3.0.0-beta.12 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.12 -- @trigger.dev/sdk@3.0.0-beta.12 - -## 3.0.0-beta.11 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.11 -- @trigger.dev/sdk@3.0.0-beta.11 - -## 3.0.0-beta.7 - -### Patch Changes - -- Updated dependencies [f854cb90e] -- Updated dependencies [f854cb90e] - - @trigger.dev/sdk@3.0.0-beta.7 - - @trigger.dev/integration-kit@3.0.0-beta.7 - -## 3.0.0-beta.6 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.6 -- @trigger.dev/sdk@3.0.0-beta.6 - -## 3.0.0-beta.5 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.5 -- @trigger.dev/sdk@3.0.0-beta.5 - -## 3.0.0-beta.4 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.4 -- @trigger.dev/sdk@3.0.0-beta.4 - -## 3.0.0-beta.3 - -### Patch Changes - -- Updated dependencies [b271742dc] - - @trigger.dev/sdk@3.0.0-beta.3 - - @trigger.dev/integration-kit@3.0.0-beta.3 - -## 3.0.0-beta.2 - -### Patch Changes - -- @trigger.dev/integration-kit@3.0.0-beta.2 -- @trigger.dev/sdk@3.0.0-beta.2 - -## 3.0.0-beta.1 - -### Patch Changes - -- Updated dependencies [b66d5525e] -- Updated dependencies [719c0a0b9] -- Updated dependencies [f93eae300] - - @trigger.dev/sdk@3.0.0-beta.1 - - @trigger.dev/integration-kit@3.0.0-beta.1 - -## 3.0.0-beta.0 - -### Patch Changes - -- Updated dependencies [395abe1b9] - - @trigger.dev/sdk@3.0.0-beta.0 - - @trigger.dev/integration-kit@3.0.0-beta.0 - -## 2.3.18 - -### Patch Changes - -- @trigger.dev/integration-kit@2.3.18 -- @trigger.dev/sdk@2.3.18 - -## 2.3.17 - -### Patch Changes - -- Updated dependencies [dd879c8e] - - @trigger.dev/sdk@2.3.17 - - @trigger.dev/integration-kit@2.3.17 - -## 2.3.16 - -### Patch Changes - -- @trigger.dev/integration-kit@2.3.16 -- @trigger.dev/sdk@2.3.16 - -## 2.3.15 - -### Patch Changes - -- Updated dependencies [6c4047cf] - - @trigger.dev/sdk@2.3.15 - - @trigger.dev/integration-kit@2.3.15 - -## 2.3.14 - -### Patch Changes - -- @trigger.dev/integration-kit@2.3.14 -- @trigger.dev/sdk@2.3.14 - -## 2.3.13 - -### Patch Changes - -- Updated dependencies [a93b554f] -- Updated dependencies [0f342cd1] - - @trigger.dev/sdk@2.3.13 - - @trigger.dev/integration-kit@2.3.13 - -## 2.3.12 - -### Patch Changes - -- Updated dependencies [129f023d] -- Updated dependencies [38f5a903] -- Updated dependencies [ff4ff869] - - @trigger.dev/sdk@2.3.12 - - @trigger.dev/integration-kit@2.3.12 - -## 2.3.11 - -### Patch Changes - -- @trigger.dev/integration-kit@2.3.11 -- @trigger.dev/sdk@2.3.11 - -## 2.3.10 - -### Patch Changes - -- Updated dependencies [8277f4d2] -- Updated dependencies [73cb8839] - - @trigger.dev/sdk@2.3.10 - - @trigger.dev/integration-kit@2.3.10 - -## 2.3.9 - -### Patch Changes - -- Updated dependencies [f7bf25f0] - - @trigger.dev/sdk@2.3.9 - - @trigger.dev/integration-kit@2.3.9 - -## 2.3.8 - -### Patch Changes - -- @trigger.dev/integration-kit@2.3.8 -- @trigger.dev/sdk@2.3.8 - -## 2.3.7 - -### Patch Changes - -- @trigger.dev/integration-kit@2.3.7 -- @trigger.dev/sdk@2.3.7 - -## 2.3.6 - -### Patch Changes - -- @trigger.dev/integration-kit@2.3.6 -- @trigger.dev/sdk@2.3.6 - -## 2.3.5 - -### Patch Changes - -- @trigger.dev/integration-kit@2.3.5 -- @trigger.dev/sdk@2.3.5 - -## 2.3.4 - -### Patch Changes - -- Updated dependencies [6a3c563f] - - @trigger.dev/sdk@2.3.4 - - @trigger.dev/integration-kit@2.3.4 - -## 2.3.3 - -### Patch Changes - -- @trigger.dev/integration-kit@2.3.3 -- @trigger.dev/sdk@2.3.3 - -## 2.3.2 - -### Patch Changes - -- @trigger.dev/integration-kit@2.3.2 -- @trigger.dev/sdk@2.3.2 - -## 2.3.1 - -### Patch Changes - -- Updated dependencies [f3efcc0c] - - @trigger.dev/sdk@2.3.1 - - @trigger.dev/integration-kit@2.3.1 - -## 2.3.0 - -### Minor Changes - -- 17f6f29d: Support for Deno, Bun and Cloudflare workers, as well as conditionally exporting ESM versions of the package instead of just commonjs. - - Cloudflare worker support requires the node compat flag turned on (https://developers.cloudflare.com/workers/runtime-apis/nodejs/) - -### Patch Changes - -- Updated dependencies [17f6f29d] - - @trigger.dev/integration-kit@2.3.0 - - @trigger.dev/sdk@2.3.0 - -## 2.2.11 - -### Patch Changes - -- Updated dependencies [de652c1d] - - @trigger.dev/sdk@2.2.11 - - @trigger.dev/integration-kit@2.2.11 - -## 2.2.10 - -### Patch Changes - -- @trigger.dev/integration-kit@2.2.10 -- @trigger.dev/sdk@2.2.10 - -## 2.2.9 - -### Patch Changes - -- Updated dependencies [1dcd87a2] -- Updated dependencies [6ebd435e] - - @trigger.dev/sdk@2.2.9 - - @trigger.dev/integration-kit@2.2.9 - -## 2.2.8 - -### Patch Changes - -- Updated dependencies [067e19fe] -- Updated dependencies [096151c0] - - @trigger.dev/integration-kit@2.2.8 - - @trigger.dev/sdk@2.2.8 - -## 2.2.7 - -### Patch Changes - -- Updated dependencies [756024da] - - @trigger.dev/sdk@2.2.7 - - @trigger.dev/integration-kit@2.2.7 - -## 2.2.6 - -### Patch Changes - -- Updated dependencies [cb1825bf] -- Updated dependencies [cb1825bf] -- Updated dependencies [d0217344] -- Updated dependencies [cb1825bf] - - @trigger.dev/integration-kit@2.2.6 - - @trigger.dev/sdk@2.2.6 - -## 2.2.5 - -### Patch Changes - -- Updated dependencies [7e57f1f3] -- Updated dependencies [cf8f9946] -- Updated dependencies [a74716a1] -- Updated dependencies [620b8383] -- Updated dependencies [620b8383] -- Updated dependencies [4a0f030e] -- Updated dependencies [f4275e50] - - @trigger.dev/sdk@2.2.5 - - @trigger.dev/integration-kit@2.2.5 - -## 2.2.4 - -### Patch Changes - -- Updated dependencies [c1710ae7] -- Updated dependencies [9c4be40a] - - @trigger.dev/sdk@2.2.4 - - @trigger.dev/integration-kit@2.2.4 - -## 2.2.3 - -### Patch Changes - -- Updated dependencies [6e1b8a11] -- Updated dependencies [c4533c36] - - @trigger.dev/sdk@2.2.3 - - @trigger.dev/integration-kit@2.2.3 - -## 2.2.2 - -### Patch Changes - -- @trigger.dev/integration-kit@2.2.2 -- @trigger.dev/sdk@2.2.2 - -## 2.2.1 - -### Patch Changes - -- Updated dependencies [044d38e3] - - @trigger.dev/sdk@2.2.1 - - @trigger.dev/integration-kit@2.2.1 - -## 2.2.0 - -### Patch Changes - -- Updated dependencies [975c5f1d] - - @trigger.dev/integration-kit@2.2.0 - - @trigger.dev/sdk@2.2.0 - -## 2.1.9 - -### Patch Changes - -- 9a187f9e: upgrade zod to 3.22.3 -- Updated dependencies [9a187f9e] -- Updated dependencies [2e9452ab] - - @trigger.dev/sdk@2.1.9 - - @trigger.dev/integration-kit@2.1.9 - -## 2.1.8 - -### Patch Changes - -- 6a992a19: First release of `@trigger.dev/replicate` integration with remote callback support. -- 81e886a1: Fix `getAll` helper and search function params -- Updated dependencies [6a992a19] -- Updated dependencies [ab9e4a98] -- Updated dependencies [ab9e4a98] - - @trigger.dev/sdk@2.1.8 - - @trigger.dev/integration-kit@2.1.8 - -## 2.1.7 - -### Patch Changes - -- @trigger.dev/integration-kit@2.1.7 -- @trigger.dev/sdk@2.1.7 - -## 2.1.6 - -### Patch Changes - -- @trigger.dev/integration-kit@2.1.6 -- @trigger.dev/sdk@2.1.6 - -## 2.1.5 - -### Patch Changes - -- @trigger.dev/integration-kit@2.1.5 -- @trigger.dev/sdk@2.1.5 - -## 2.1.4 - -### Patch Changes - -- 15f17d27: First release of `@trigger.dev/linear` integration. `io.runTask()` error handlers can now prevent further retries. -- Updated dependencies [ad14983e] -- Updated dependencies [15f17d27] -- Updated dependencies [50137a6f] -- Updated dependencies [c0dfa804] - - @trigger.dev/sdk@2.1.4 - - @trigger.dev/integration-kit@2.1.4 diff --git a/integrations/linear/README.md b/integrations/linear/README.md deleted file mode 100644 index 13ffab69b..000000000 --- a/integrations/linear/README.md +++ /dev/null @@ -1,3 +0,0 @@ - -# @trigger.dev/linear - \ No newline at end of file diff --git a/integrations/linear/package.json b/integrations/linear/package.json deleted file mode 100644 index 89358f69b..000000000 --- a/integrations/linear/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "@trigger.dev/linear", - "version": "3.0.0-beta.55", - "description": "Trigger.dev integration for @linear/sdk", - "main": "./dist/index.js", - "types": "./dist/index.d.ts", - "publishConfig": { - "access": "public" - }, - "files": [ - "dist" - ], - "devDependencies": { - "@trigger.dev/tsconfig": "workspace:*", - "@types/node": "16.x", - "rimraf": "^3.0.2", - "tsup": "8.0.1", - "typescript": "^5.3.0", - "@trigger.dev/tsup": "workspace:*" - }, - "scripts": { - "clean": "rimraf dist", - "build": "npm run clean && npm run build:tsup", - "build:tsup": "tsup", - "typecheck": "tsc --noEmit" - }, - "dependencies": { - "@linear/sdk": "^8.0.0", - "@trigger.dev/integration-kit": "workspace:^3.0.0-beta.55", - "@trigger.dev/sdk": "workspace:^3.0.0-beta.55", - "zod": "3.22.3" - }, - "engines": { - "node": ">=16.8.0" - }, - "exports": { - ".": { - "import": { - "types": "./dist/index.d.mts", - "default": "./dist/index.mjs" - }, - "require": "./dist/index.js", - "types": "./dist/index.d.ts" - }, - "./package.json": "./package.json" - }, - "module": "./dist/index.mjs" -} diff --git a/integrations/linear/src/events.ts b/integrations/linear/src/events.ts deleted file mode 100644 index 18dff27b5..000000000 --- a/integrations/linear/src/events.ts +++ /dev/null @@ -1,535 +0,0 @@ -import { EventSpecification } from "@trigger.dev/sdk"; -import { - AttachmentEvent, - CommentEvent, - CycleEvent, - IssueEvent, - IssueLabelEvent, - IssueSLAEvent, - ProjectEvent, - ProjectUpdateEvent, - ReactionEvent, -} from "./schemas"; -import { GetLinearPayload } from "./types"; -import { - attachmentCreated, - attachmentRemoved, - attachmentUpdated, - commentCreated, - commentRemoved, - commentUpdated, - cycleCreated, - cycleRemoved, - cycleUpdated, - issueCreated, - issueRemoved, - issueUpdated, - issueLabelCreated, - issueLabelRemoved, - issueLabelUpdated, - projectCreated, - projectRemoved, - projectUpdated, - projectUpdateCreated, - projectUpdateRemoved, - projectUpdateUpdated, - reactionCreated, - reactionRemoved, - reactionUpdated, -} from "./payload-examples"; -import { onCommentProperties, onIssueProperties, updatedFromProperties } from "./utils"; - -/** **WARNING:** Still in alpha - use with caution! */ -export const onAttachment: EventSpecification> = { - name: "Attachment", - title: "On Attachment", - source: "linear.app", - icon: "linear", - examples: [attachmentCreated, attachmentRemoved, attachmentUpdated], - parsePayload: (payload) => payload as GetLinearPayload, - runProperties: (payload) => [ - { label: "Event action", text: payload.action }, - { label: "Attachment ID", text: payload.data.id }, - ], -}; - -/** **WARNING:** Still in alpha - use with caution! */ -export const onAttachmentCreated: EventSpecification> = - { - name: "Attachment", - title: "On Attachment Created", - source: "linear.app", - icon: "linear", - filter: { - action: ["create"], - }, - examples: [attachmentCreated], - parsePayload: (payload) => payload as GetLinearPayload, - runProperties: (payload) => [{ label: "Attachment ID", text: payload.data.id }], - }; - -/** **WARNING:** Still in alpha - use with caution! */ -export const onAttachmentRemoved: EventSpecification> = - { - name: "Attachment", - title: "On Attachment Removed", - source: "linear.app", - icon: "linear", - filter: { - action: ["remove"], - }, - examples: [attachmentRemoved], - parsePayload: (payload) => payload as GetLinearPayload, - runProperties: (payload) => [{ label: "Attachment ID", text: payload.data.id }], - }; - -/** **WARNING:** Still in alpha - use with caution! */ -export const onAttachmentUpdated: EventSpecification> = - { - name: "Attachment", - title: "On Attachment Updated", - source: "linear.app", - icon: "linear", - filter: { - action: ["update"], - }, - examples: [attachmentUpdated], - parsePayload: (payload) => payload as GetLinearPayload, - runProperties: (payload) => [{ label: "Attachment ID", text: payload.data.id }], - }; - -export const onComment: EventSpecification> = { - name: "Comment", - title: "On Comment", - source: "linear.app", - icon: "linear", - examples: [commentCreated, commentRemoved, commentUpdated], - parsePayload: (payload) => payload as GetLinearPayload, - runProperties: (payload) => [ - { label: "Event action", text: payload.action }, - ...onCommentProperties(payload), - ...updatedFromProperties(payload), - ], -}; - -export const onCommentCreated: EventSpecification> = { - name: "Comment", - title: "On Comment Created", - source: "linear.app", - icon: "linear", - filter: { - action: ["create"], - }, - examples: [commentCreated], - parsePayload: (payload) => payload as GetLinearPayload, - runProperties: (payload) => onCommentProperties(payload), -}; - -export const onCommentRemoved: EventSpecification> = { - name: "Comment", - title: "On Comment Removed", - source: "linear.app", - icon: "linear", - filter: { - action: ["remove"], - }, - examples: [commentRemoved], - parsePayload: (payload) => payload as GetLinearPayload, - runProperties: (payload) => onCommentProperties(payload), -}; - -export const onCommentUpdated: EventSpecification> = { - name: "Comment", - title: "On Comment Updated", - source: "linear.app", - icon: "linear", - filter: { - action: ["update"], - }, - examples: [commentUpdated], - parsePayload: (payload) => payload as GetLinearPayload, - runProperties: (payload) => [...onCommentProperties(payload), ...updatedFromProperties(payload)], -}; - -export const onCycle: EventSpecification> = { - name: "Cycle", - title: "On Cycle", - source: "linear.app", - icon: "linear", - examples: [cycleCreated, cycleRemoved, cycleUpdated], - parsePayload: (payload) => payload as GetLinearPayload, - runProperties: (payload) => [ - { label: "Event action", text: payload.action }, - { label: "Cycle ID", text: payload.data.id }, - ], -}; - -export const onCycleCreated: EventSpecification> = { - name: "Cycle", - title: "On Cycle Created", - source: "linear.app", - icon: "linear", - filter: { - action: ["create"], - }, - examples: [cycleCreated], - parsePayload: (payload) => payload as GetLinearPayload, - runProperties: (payload) => [{ label: "Cycle ID", text: payload.data.id }], -}; - -export const onCycleRemoved: EventSpecification> = { - name: "Cycle", - title: "On Cycle Removed", - source: "linear.app", - icon: "linear", - filter: { - action: ["remove"], - }, - examples: [cycleRemoved], - parsePayload: (payload) => payload as GetLinearPayload, - runProperties: (payload) => [{ label: "Cycle ID", text: payload.data.id }], -}; - -export const onCycleUpdated: EventSpecification> = { - name: "Cycle", - title: "On Cycle Updated", - source: "linear.app", - icon: "linear", - filter: { - action: ["update"], - }, - examples: [cycleUpdated], - parsePayload: (payload) => payload as GetLinearPayload, - runProperties: (payload) => [{ label: "Cycle ID", text: payload.data.id }], -}; - -export const onIssue: EventSpecification> = { - name: "Issue", - title: "On Issue", - source: "linear.app", - icon: "linear", - examples: [issueCreated, issueRemoved, issueUpdated], - parsePayload: (payload) => payload as GetLinearPayload, - runProperties: (payload) => [ - { label: "Event action", text: payload.action }, - ...onIssueProperties(payload), - ...updatedFromProperties(payload), - ], -}; - -export const onIssueCreated: EventSpecification> = { - name: "Issue", - title: "On Issue Created", - source: "linear.app", - icon: "linear", - filter: { - action: ["create"], - }, - examples: [issueCreated], - parsePayload: (payload) => payload as GetLinearPayload, - runProperties: (payload) => onIssueProperties(payload), -}; - -export const onIssueRemoved: EventSpecification> = { - name: "Issue", - title: "On Issue Removed", - source: "linear.app", - icon: "linear", - filter: { - action: ["remove"], - }, - examples: [issueRemoved], - parsePayload: (payload) => payload as GetLinearPayload, - runProperties: (payload) => onIssueProperties(payload), -}; - -export const onIssueUpdated: EventSpecification> = { - name: "Issue", - title: "On Issue Updated", - source: "linear.app", - icon: "linear", - filter: { - action: ["update"], - }, - examples: [issueUpdated], - parsePayload: (payload) => payload as GetLinearPayload, - runProperties: (payload) => [...onIssueProperties(payload), ...updatedFromProperties(payload)], -}; - -export const onIssueLabel: EventSpecification> = { - name: "IssueLabel", - title: "On IssueLabel", - source: "linear.app", - icon: "linear", - examples: [issueLabelCreated, issueLabelRemoved, issueLabelUpdated], - parsePayload: (payload) => payload as GetLinearPayload, - runProperties: (payload) => [ - { label: "Event action", text: payload.action }, - { label: "IssueLabel ID", text: payload.data.id }, - ], -}; - -export const onIssueLabelCreated: EventSpecification> = - { - name: "IssueLabel", - title: "On IssueLabel Created", - source: "linear.app", - icon: "linear", - filter: { - action: ["create"], - }, - examples: [issueLabelCreated], - parsePayload: (payload) => payload as GetLinearPayload, - runProperties: (payload) => [{ label: "IssueLabel ID", text: payload.data.id }], - }; - -export const onIssueLabelRemoved: EventSpecification> = - { - name: "IssueLabel", - title: "On IssueLabel Removed", - source: "linear.app", - icon: "linear", - filter: { - action: ["remove"], - }, - examples: [issueLabelRemoved], - parsePayload: (payload) => payload as GetLinearPayload, - runProperties: (payload) => [{ label: "IssueLabel ID", text: payload.data.id }], - }; - -export const onIssueLabelUpdated: EventSpecification> = - { - name: "IssueLabel", - title: "On IssueLabel Updated", - source: "linear.app", - icon: "linear", - filter: { - action: ["update"], - }, - examples: [issueLabelUpdated], - parsePayload: (payload) => payload as GetLinearPayload, - runProperties: (payload) => [{ label: "IssueLabel ID", text: payload.data.id }], - }; - -// TODO: this needs to be tested -export const onIssueSLA: EventSpecification> = { - name: "IssueSLA", - title: "On Issue SLA", - source: "linear.app", - icon: "linear", - parsePayload: (payload) => payload as GetLinearPayload, - runProperties: (payload) => [ - { label: "SLA action", text: payload.action }, - { label: "Issue ID", text: payload.issueData.id }, - ], -}; - -export const onIssueSLASet: EventSpecification> = { - name: "IssueSLA", - title: "On Issue SLA Set", - source: "linear.app", - icon: "linear", - filter: { - action: ["set"], - }, - parsePayload: (payload) => payload as GetLinearPayload, - runProperties: (payload) => [{ label: "Issue ID", text: payload.issueData.id }], -}; - -export const onIssueSLABreached: EventSpecification> = { - name: "IssueSLA", - title: "On Issue SLA Breached", - source: "linear.app", - icon: "linear", - filter: { - action: ["breached"], - }, - parsePayload: (payload) => payload as GetLinearPayload, - runProperties: (payload) => [{ label: "Issue ID", text: payload.issueData.id }], -}; - -export const onIssueSLAHighRisk: EventSpecification> = { - name: "IssueSLA", - title: "On Issue SLA High Risk", - source: "linear.app", - icon: "linear", - filter: { - action: ["highRisk"], - }, - parsePayload: (payload) => payload as GetLinearPayload, - runProperties: (payload) => [{ label: "Issue ID", text: payload.issueData.id }], -}; - -export const onProject: EventSpecification> = { - name: "Project", - title: "On Project", - source: "linear.app", - icon: "linear", - examples: [projectCreated, projectRemoved, projectUpdated], - parsePayload: (payload) => payload as GetLinearPayload, - runProperties: (payload) => [ - { label: "Event action", text: payload.action }, - { label: "Project ID", text: payload.data.id }, - { label: "Project Name", text: payload.data.name, url: payload.url ?? undefined }, - ...updatedFromProperties(payload), - ], -}; - -export const onProjectCreated: EventSpecification> = { - name: "Project", - title: "On Project Created", - source: "linear.app", - icon: "linear", - filter: { - action: ["create"], - }, - examples: [projectCreated], - parsePayload: (payload) => payload as GetLinearPayload, - runProperties: (payload) => [ - { label: "Project ID", text: payload.data.id }, - { label: "Project Name", text: payload.data.name, url: payload.url ?? undefined }, - ], -}; - -export const onProjectRemoved: EventSpecification> = { - name: "Project", - title: "On Project Removed", - source: "linear.app", - icon: "linear", - filter: { - action: ["remove"], - }, - examples: [projectRemoved], - parsePayload: (payload) => payload as GetLinearPayload, - runProperties: (payload) => [ - { label: "Project ID", text: payload.data.id }, - { label: "Project Name", text: payload.data.name, url: payload.url ?? undefined }, - ], -}; - -export const onProjectUpdated: EventSpecification> = { - name: "Project", - title: "On Project Updated", - source: "linear.app", - icon: "linear", - filter: { - action: ["update"], - }, - examples: [projectUpdated], - parsePayload: (payload) => payload as GetLinearPayload, - runProperties: (payload) => [ - { label: "Project ID", text: payload.data.id }, - { label: "Project Name", text: payload.data.name, url: payload.url ?? undefined }, - ...updatedFromProperties(payload), - ], -}; - -export const onProjectUpdate: EventSpecification> = { - name: "ProjectUpdate", - title: "On ProjectUpdate", - source: "linear.app", - icon: "linear", - examples: [projectUpdateCreated, projectUpdateRemoved, projectUpdateUpdated], - parsePayload: (payload) => payload as GetLinearPayload, - runProperties: (payload) => [ - { label: "Event action", text: payload.action }, - { label: "ProjectUpdate ID", text: payload.data.id }, - ], -}; - -export const onProjectUpdateCreated: EventSpecification< - GetLinearPayload -> = { - name: "ProjectUpdate", - title: "On ProjectUpdate Created", - source: "linear.app", - icon: "linear", - filter: { - action: ["create"], - }, - examples: [projectUpdateCreated], - parsePayload: (payload) => payload as GetLinearPayload, - runProperties: (payload) => [{ label: "ProjectUpdate ID", text: payload.data.id }], -}; - -export const onProjectUpdateRemoved: EventSpecification< - GetLinearPayload -> = { - name: "ProjectUpdate", - title: "On ProjectUpdate Removed", - source: "linear.app", - icon: "linear", - filter: { - action: ["remove"], - }, - examples: [projectUpdateRemoved], - parsePayload: (payload) => payload as GetLinearPayload, - runProperties: (payload) => [{ label: "ProjectUpdate ID", text: payload.data.id }], -}; - -export const onProjectUpdateUpdated: EventSpecification< - GetLinearPayload -> = { - name: "ProjectUpdate", - title: "On ProjectUpdate Updated", - source: "linear.app", - icon: "linear", - filter: { - action: ["update"], - }, - examples: [projectUpdateUpdated], - parsePayload: (payload) => payload as GetLinearPayload, - runProperties: (payload) => [{ label: "ProjectUpdate ID", text: payload.data.id }], -}; - -export const onReaction: EventSpecification> = { - name: "Reaction", - title: "On Reaction", - source: "linear.app", - icon: "linear", - examples: [reactionCreated, reactionRemoved, reactionUpdated], - parsePayload: (payload) => payload as GetLinearPayload, - runProperties: (payload) => [ - { label: "Event action", text: payload.action }, - { label: "Reaction ID", text: payload.data.id }, - ], -}; - -export const onReactionCreated: EventSpecification> = { - name: "Reaction", - title: "On Reaction Created", - source: "linear.app", - icon: "linear", - filter: { - action: ["create"], - }, - examples: [reactionCreated], - parsePayload: (payload) => payload as GetLinearPayload, - runProperties: (payload) => [{ label: "Reaction ID", text: payload.data.id }], -}; - -export const onReactionRemoved: EventSpecification> = { - name: "Reaction", - title: "On Reaction Removed", - source: "linear.app", - icon: "linear", - filter: { - action: ["remove"], - }, - examples: [reactionRemoved], - parsePayload: (payload) => payload as GetLinearPayload, - runProperties: (payload) => [{ label: "Reaction ID", text: payload.data.id }], -}; - -export const onReactionUpdated: EventSpecification> = { - name: "Reaction", - title: "On Reaction Updated", - source: "linear.app", - icon: "linear", - filter: { - action: ["update"], - }, - examples: [reactionUpdated], - parsePayload: (payload) => payload as GetLinearPayload, - runProperties: (payload) => [{ label: "Reaction ID", text: payload.data.id }], -}; diff --git a/integrations/linear/src/index.ts b/integrations/linear/src/index.ts deleted file mode 100644 index 0f53f9e7a..000000000 --- a/integrations/linear/src/index.ts +++ /dev/null @@ -1,2029 +0,0 @@ -import { - ConnectionAuth, - IO, - IOTask, - IntegrationTaskKey, - Json, - Prettify, - RunTaskErrorCallback, - RunTaskOptions, - TriggerIntegration, - retry, -} from "@trigger.dev/sdk"; -import { - Attachment, - AttachmentConnection, - AttachmentPayload, - Comment, - CommentConnection, - CommentPayload, - Connection, - CreateOrJoinOrganizationResponse, - CycleArchivePayload, - CyclePayload, - DeletePayload, - Document, - DocumentConnection, - DocumentPayload, - DocumentSearchPayload, - Favorite, - FavoriteConnection, - FavoritePayload, - FrontAttachmentPayload, - Issue, - IssueArchivePayload, - IssueConnection, - IssueLabel, - IssueLabelConnection, - IssueLabelPayload, - IssuePayload, - IssuePriorityValue, - IssueRelation, - IssueRelationConnection, - IssueRelationPayload, - IssueSearchPayload, - LinearClient, - LinearDocument as L, - LinearError, - Notification, - NotificationArchivePayload, - NotificationConnection, - NotificationSubscriptionPayload, - Organization, - OrganizationInvitePayload, - Project, - ProjectArchivePayload, - ProjectConnection, - ProjectLink, - ProjectLinkConnection, - ProjectLinkPayload, - ProjectMilestonePayload, - ProjectPayload, - ProjectSearchPayload, - ProjectUpdate, - ProjectUpdateConnection, - ProjectUpdatePayload, - RatelimitedLinearError, - ReactionPayload, - RoadmapArchivePayload, - RoadmapPayload, - Team, - TeamConnection, - TeamMembership, - TeamMembershipConnection, - TeamMembershipPayload, - TeamPayload, - Template, - User, - UserConnection, - UserPayload, - WorkflowState, - WorkflowStateArchivePayload, - WorkflowStateConnection, - WorkflowStatePayload, -} from "@linear/sdk"; - -import * as events from "./events"; -import { AwaitNested, LinearReturnType, SerializedLinearOutput } from "./types"; -import { Nullable, QueryVariables, queryProperties } from "./utils"; -import { TriggerParams, Webhooks, createTrigger, createWebhookEventSource } from "./webhooks"; - -export type LinearIntegrationOptions = { - id: string; - apiKey?: string; -}; - -export type LinearRunTask = InstanceType["runTask"]; - -export class Linear implements TriggerIntegration { - private _options: LinearIntegrationOptions; - private _client?: LinearClient; - private _io?: IO; - private _connectionKey?: string; - - constructor(private options: LinearIntegrationOptions) { - if (Object.keys(options).includes("apiKey") && !options.apiKey) { - throw `Can't create Linear integration (${options.id}) as apiKey was undefined`; - } - - this._options = options; - } - - get authSource() { - return this._options.apiKey ? "LOCAL" : "HOSTED"; - } - - get id() { - return this._options.id; - } - - get metadata() { - return { id: "linear", name: "Linear" }; - } - - get source() { - return createWebhookEventSource(this); - } - - cloneForRun(io: IO, connectionKey: string, auth?: ConnectionAuth) { - const linear = new Linear(this._options); - linear._io = io; - linear._connectionKey = connectionKey; - linear._client = this.createClient(auth); - return linear; - } - - createClient(auth?: ConnectionAuth) { - if (auth) { - return new LinearClient({ - accessToken: auth.accessToken, - }); - } - - if (this._options.apiKey) { - return new LinearClient({ - apiKey: this._options.apiKey, - }); - } - - throw new Error("No auth"); - } - - runTask | void>( - key: IntegrationTaskKey, - callback: (client: LinearClient, task: IOTask, io: IO) => Promise, - options?: RunTaskOptions, - errorCallback?: RunTaskErrorCallback - ): Promise { - if (!this._io) throw new Error("No IO"); - if (!this._connectionKey) throw new Error("No connection key"); - - return this._io.runTask( - key, - (task, io) => { - if (!this._client) throw new Error("No client"); - return callback(this._client, task, io); - }, - { - icon: "linear", - retry: retry.standardBackoff, - ...(options ?? {}), - connectionKey: this._connectionKey, - }, - errorCallback ?? onError - ); - } - - async getAll< - TTask extends ( - key: IntegrationTaskKey, - params: Partial> - ) => LinearReturnType>, - >( - task: TTask, - key: IntegrationTaskKey, - params: Parameters[1] = {} - ): Promise>["nodes"]> { - const boundTask = task.bind(this as any); - - let edges = await boundTask(`${key}-0`, params); - let nodes = edges.nodes; - - for (let i = 1; edges.pageInfo.hasNextPage; i++) { - edges = await boundTask(`${key}-${i}`, { ...params, after: edges.pageInfo.endCursor }); - nodes = nodes.concat(edges.nodes); - } - - return nodes; - } - - attachment(key: IntegrationTaskKey, params: { id: string }): LinearReturnType { - return this.runTask( - key, - async (client) => { - const entity = await client.attachment(params.id); - return serializeLinearOutput(entity); - }, - { - name: "Get Attachment", - params, - properties: [{ label: "Attachment ID", text: params.id }], - } - ); - } - - attachments( - key: IntegrationTaskKey, - params: L.AttachmentsQueryVariables = {} - ): LinearReturnType { - return this.runTask( - key, - async (client) => { - const edges = await client.attachments(params); - return serializeLinearOutput(edges); - }, - { - name: "Get Attachments", - params, - properties: queryProperties(params), - } - ); - } - - createAttachment( - key: IntegrationTaskKey, - params: L.AttachmentCreateInput - ): LinearReturnType { - return this.runTask( - key, - async (client) => { - const payload = await client.createAttachment(params); - return serializeLinearOutput(await payload.attachment); - }, - { - name: "Create Attachment", - params, - properties: [ - { label: "Issue ID", text: params.issueId }, - { label: "Title", text: params.title }, - { label: "URL", text: params.url }, - ], - } - ); - } - - deleteAttachment(key: IntegrationTaskKey, params: { id: string }): Promise { - return this.runTask(key, (client) => client.deleteAttachment(params.id), { - name: "Delete Attachment", - params, - properties: [{ label: "Attachment ID", text: params.id }], - }); - } - - updateAttachment( - key: IntegrationTaskKey, - params: { id: string; input: L.AttachmentUpdateInput } - ): LinearReturnType { - return this.runTask( - key, - async (client) => { - const payload = await client.updateAttachment(params.id, params.input); - return serializeLinearOutput(await payload.attachment); - }, - { - name: "Update Attachment", - params, - properties: [{ label: "Attachment ID", text: params.id }], - } - ); - } - - attachmentLinkDiscord( - key: IntegrationTaskKey, - params: { - channelId: string; - issueId: string; - messageId: string; - url: string; - variables?: Omit< - L.AttachmentLinkDiscordMutationVariables, - "channelId" | "issueId" | "messageId" | "url" - >; - } - ): LinearReturnType { - return this.runTask( - key, - async (client) => { - const payload = await client.attachmentLinkDiscord( - params.channelId, - params.issueId, - params.messageId, - params.url, - params.variables - ); - return serializeLinearOutput(await payload.attachment); - }, - { - name: "Link Discord Message", - params, - properties: [ - { label: "Issue ID", text: params.issueId }, - { label: "Channel ID", text: params.channelId }, - { label: "Message ID", text: params.messageId }, - { label: "URL", text: params.url }, - ], - } - ); - } - - attachmentLinkFront( - key: IntegrationTaskKey, - params: { - conversationId: string; - issueId: string; - variables?: Omit; - } - ): LinearReturnType { - return this.runTask( - key, - async (client) => { - const payload = await client.attachmentLinkFront( - params.conversationId, - params.issueId, - params.variables - ); - return serializeLinearOutput(payload); - }, - { - name: "Link Front Conversation", - params, - properties: [ - { label: "Issue ID", text: params.issueId }, - { label: "Conversation ID", text: params.conversationId }, - ], - } - ); - } - - attachmentLinkIntercom( - key: IntegrationTaskKey, - params: { - conversationId: string; - issueId: string; - variables?: Omit; - } - ): LinearReturnType { - return this.runTask( - key, - async (client) => { - const payload = await client.attachmentLinkIntercom( - params.conversationId, - params.issueId, - params.variables - ); - return serializeLinearOutput(await payload.attachment); - }, - { - name: "Link Intercom Conversation", - params, - properties: [ - { label: "Issue ID", text: params.issueId }, - { label: "Conversation ID", text: params.conversationId }, - ], - } - ); - } - - attachmentLinkJiraIssue( - key: IntegrationTaskKey, - params: { - issueId: string; - jiraIssueId: string; - } - ): LinearReturnType { - return this.runTask( - key, - async (client) => { - const payload = await client.attachmentLinkJiraIssue(params.issueId, params.jiraIssueId); - return serializeLinearOutput(await payload.attachment); - }, - { - name: "Link Jira Issue", - params, - properties: [ - { label: "Issue ID", text: params.issueId }, - { label: "Jira Issue ID", text: params.jiraIssueId }, - ], - } - ); - } - - attachmentLinkSlack( - key: IntegrationTaskKey, - params: { - channel: string; - issueId: string; - latest: string; - url: string; - variables?: Omit< - L.AttachmentLinkSlackMutationVariables, - "channel" | "issueId" | "latest" | "url" - >; - } - ): LinearReturnType { - return this.runTask( - key, - async (client) => { - const payload = await client.attachmentLinkSlack( - params.channel, - params.issueId, - params.latest, - params.url, - params.variables - ); - return serializeLinearOutput(await payload.attachment); - }, - { - name: "Link Slack Message", - params, - properties: [ - { label: "Issue ID", text: params.issueId }, - { label: "Channel", text: params.channel }, - { label: "Latest", text: params.latest }, - { label: "URL", text: params.url }, - ], - } - ); - } - - attachmentLinkURL( - key: IntegrationTaskKey, - params: { - issueId: string; - url: string; - variables?: Omit; - } - ): LinearReturnType { - return this.runTask( - key, - async (client) => { - const payload = await client.attachmentLinkURL( - params.issueId, - params.url, - params.variables - ); - return serializeLinearOutput(await payload.attachment); - }, - { - name: "Link URL", - params, - properties: [ - { label: "Issue ID", text: params.issueId }, - { label: "URL", text: params.url }, - ], - } - ); - } - - attachmentLinkZendesk( - key: IntegrationTaskKey, - params: { - issueId: string; - ticketId: string; - variables?: Omit; - } - ): LinearReturnType { - return this.runTask( - key, - async (client) => { - const payload = await client.attachmentLinkZendesk( - params.issueId, - params.ticketId, - params.variables - ); - return serializeLinearOutput(await payload.attachment); - }, - { - name: "Link Zendesk Ticket", - params, - properties: [ - { label: "Issue ID", text: params.issueId }, - { label: "Ticket ID", text: params.ticketId }, - ], - } - ); - } - - comment(key: IntegrationTaskKey, params: { id: string }): LinearReturnType { - return this.runTask( - key, - async (client) => { - const entity = await client.comment(params.id); - return serializeLinearOutput(entity); - }, - { - name: "Get Comment", - params, - properties: [{ label: "Comment ID", text: params.id }], - } - ); - } - - comments( - key: IntegrationTaskKey, - params: L.CommentsQueryVariables = {} - ): LinearReturnType { - return this.runTask( - key, - async (client) => { - const edges = await client.comments(params); - return serializeLinearOutput(edges); - }, - { - name: "Get Comments", - params, - properties: queryProperties(params), - } - ); - } - - createComment( - key: IntegrationTaskKey, - params: L.CommentCreateInput - ): LinearReturnType { - return this.runTask( - key, - async (client) => { - const payload = await client.createComment(params); - return serializeLinearOutput(await payload.comment); - }, - { - name: "Create Comment", - params, - properties: [ - { label: "Issue ID", text: params.issueId }, - { label: "Body", text: params.body ?? "" }, - ], - } - ); - } - - deleteComment(key: IntegrationTaskKey, params: { id: string }): Promise { - return this.runTask(key, (client) => client.deleteComment(params.id), { - name: "Delete Comment", - params, - properties: [{ label: "Comment ID", text: params.id }], - }); - } - - updateComment( - key: IntegrationTaskKey, - params: { id: string; input: L.CommentUpdateInput } - ): LinearReturnType { - return this.runTask( - key, - async (client) => { - const payload = await client.updateComment(params.id, params.input); - return serializeLinearOutput(await payload.comment); - }, - { - name: "Update Comment", - params, - properties: [{ label: "Comment ID", text: params.id }], - } - ); - } - - archiveCycle( - key: IntegrationTaskKey, - params: { id: string } - ): LinearReturnType> { - return this.runTask( - key, - async (client) => { - const payload = await client.archiveCycle(params.id); - return serializeLinearOutput({ - ...payload, - entity: await payload.entity, - }); - }, - { - name: "Archive Cycle", - params, - properties: [{ label: "Cycle ID", text: params.id }], - } - ); - } - - createCycle( - key: IntegrationTaskKey, - params: L.CycleCreateInput - ): LinearReturnType { - return this.runTask( - key, - async (client) => { - const payload = await client.createCycle(params); - return serializeLinearOutput(await payload.cycle); - }, - { - name: "Create Cycle", - params, - properties: [ - { label: "Team ID", text: params.teamId }, - { label: "Start at", text: params.startsAt.toISOString() }, - { label: "Ends at", text: params.endsAt.toISOString() }, - ], - } - ); - } - - // deleteCycle() does not exist - - updateCycle( - key: IntegrationTaskKey, - params: { id: string; input: L.CycleUpdateInput } - ): LinearReturnType { - return this.runTask( - key, - async (client) => { - const payload = await client.updateCycle(params.id, params.input); - return serializeLinearOutput(await payload.cycle); - }, - { - name: "Update Cycle", - params, - properties: [{ label: "Cycle ID", text: params.id }], - } - ); - } - - document(key: IntegrationTaskKey, params: { id: string }): LinearReturnType { - return this.runTask( - key, - async (client) => { - const entity = await client.document(params.id); - return serializeLinearOutput(entity); - }, - { - name: "Get Document", - params, - properties: [{ label: "Document ID", text: params.id }], - } - ); - } - - documents( - key: IntegrationTaskKey, - params: L.DocumentsQueryVariables - ): LinearReturnType { - return this.runTask( - key, - async (client) => { - const edges = await client.documents(params); - return serializeLinearOutput(edges); - }, - { - name: "Get Documents", - params, - properties: queryProperties(params), - } - ); - } - - createDocument( - key: IntegrationTaskKey, - params: L.DocumentCreateInput - ): LinearReturnType { - return this.runTask( - key, - async (client) => { - const payload = await client.createDocument(params); - return serializeLinearOutput(await payload.document); - }, - { - name: "Create Document", - params, - properties: [ - { label: "Project ID", text: params.projectId }, - { label: "Title", text: params.title }, - ], - } - ); - } - - searchDocuments( - key: IntegrationTaskKey, - params: { - term: string; - variables?: Parameters[1]; - } - ): LinearReturnType { - return this.runTask( - key, - async (client) => { - const payload = await client.searchDocuments(params.term, params.variables); - return serializeLinearOutput(payload); - }, - { - name: "Search Documents", - params, - properties: [{ label: "Search Term", text: params.term }], - } - ); - } - - favorite(key: IntegrationTaskKey, params: { id: string }): LinearReturnType { - return this.runTask( - key, - async (client) => { - const entity = await client.favorite(params.id); - return serializeLinearOutput(entity); - }, - { - name: "Get Favorite", - params, - properties: [{ label: "Favorite ID", text: params.id }], - } - ); - } - - favorites( - key: IntegrationTaskKey, - params: L.FavoritesQueryVariables = {} - ): LinearReturnType { - return this.runTask( - key, - async (client) => { - const edges = await client.favorites(params); - return serializeLinearOutput(edges); - }, - { - name: "Get Favorites", - params, - properties: queryProperties(params), - } - ); - } - - createFavorite( - key: IntegrationTaskKey, - params: L.FavoriteCreateInput - ): LinearReturnType { - return this.runTask( - key, - async (client) => { - const payload = await client.createFavorite(params); - return serializeLinearOutput(await payload.favorite); - }, - { - name: "Create Favorite", - params, - } - ); - } - - issue(key: IntegrationTaskKey, params: { id: string }): LinearReturnType { - return this.runTask( - key, - async (client) => { - const entity = await client.issue(params.id); - return serializeLinearOutput(entity); - }, - { - name: "Get Issue", - params, - properties: [{ label: "Issue ID", text: params.id }], - } - ); - } - - issues( - key: IntegrationTaskKey, - params: L.IssuesQueryVariables = {} - ): LinearReturnType { - return this.runTask( - key, - async (client) => { - const edges = await client.issues(params); - return serializeLinearOutput(edges); - }, - { - name: "Get Issues", - params, - properties: queryProperties(params), - } - ); - } - - archiveIssue( - key: IntegrationTaskKey, - params: { - id: string; - variables?: Omit; - } - ): LinearReturnType> { - return this.runTask( - key, - async (client) => { - const payload = await client.archiveIssue(params.id, params.variables); - return serializeLinearOutput({ - ...payload, - entity: await payload.entity, - }); - }, - { - name: "Archive Issue", - params, - properties: [{ label: "Issue ID", text: params.id }], - } - ); - } - - createIssue( - key: IntegrationTaskKey, - params: L.IssueCreateInput & { title: string } - ): LinearReturnType { - return this.runTask( - key, - async (client) => { - const payload = await client.createIssue(params); - return serializeLinearOutput(await payload.issue); - }, - { - name: "Create Issue", - params, - properties: [ - { label: "Team ID", text: params.teamId }, - { label: "Title", text: params.title }, - ], - } - ); - } - - deleteIssue( - key: IntegrationTaskKey, - params: { id: string } - ): LinearReturnType { - return this.runTask( - key, - async (client) => { - const payload = await client.deleteIssue(params.id); - return serializeLinearOutput(await payload.entity); - }, - { - name: "Delete Issue", - params, - properties: [{ label: "Issue ID", text: params.id }], - } - ); - } - - searchIssues( - key: IntegrationTaskKey, - params: { - term: string; - variables?: Parameters[1]; - } - ): LinearReturnType { - return this.runTask( - key, - async (client) => { - const payload = await client.searchIssues(params.term, params.variables); - return serializeLinearOutput(payload); - }, - { - name: "Search Issues", - params, - properties: [{ label: "Search Term", text: params.term }], - } - ); - } - - updateIssue( - key: IntegrationTaskKey, - params: { id: string; input: L.IssueUpdateInput } - ): LinearReturnType { - return this.runTask( - key, - async (client) => { - const payload = await client.updateIssue(params.id, params.input); - return serializeLinearOutput(await payload.issue); - }, - { - name: "Update Issue", - params, - properties: [{ label: "Issue ID", text: params.id }], - } - ); - } - - issueLabel(key: IntegrationTaskKey, params: { id: string }): LinearReturnType { - return this.runTask( - key, - async (client) => { - const entity = await client.issueLabel(params.id); - return serializeLinearOutput(entity); - }, - { - name: "Get IssueLabel", - params, - properties: [{ label: "IssueLabel ID", text: params.id }], - } - ); - } - - issueLabels( - key: IntegrationTaskKey, - params: L.IssueLabelsQueryVariables = {} - ): LinearReturnType { - return this.runTask( - key, - async (client) => { - const edges = await client.issueLabels(params); - return serializeLinearOutput(edges); - }, - { - name: "Get IssueLabels", - params, - properties: queryProperties(params), - } - ); - } - - createIssueLabel( - key: IntegrationTaskKey, - params: L.IssueLabelCreateInput - ): LinearReturnType { - return this.runTask( - key, - async (client) => { - const payload = await client.createIssueLabel(params); - return serializeLinearOutput(await payload.issueLabel); - }, - { - name: "Create IssueLabel", - params, - properties: [{ label: "Label name", text: params.name }], - } - ); - } - - deleteIssueLabel(key: IntegrationTaskKey, params: { id: string }): Promise { - return this.runTask(key, (client) => client.deleteIssueLabel(params.id), { - name: "Delete IssueLabel", - params, - properties: [{ label: "Label ID", text: params.id }], - }); - } - - updateIssueLabel( - key: IntegrationTaskKey, - params: { id: string; input: L.IssueLabelUpdateInput } - ): LinearReturnType { - return this.runTask( - key, - async (client) => { - const payload = await client.updateIssueLabel(params.id, params.input); - return serializeLinearOutput(await payload.issueLabel); - }, - { - name: "Update IssueLabel", - params, - properties: [{ label: "Label ID", text: params.id }], - } - ); - } - - issuePriorityValues(key: IntegrationTaskKey): LinearReturnType { - return this.runTask( - key, - async (client) => { - const entity = await client.issuePriorityValues; - return serializeLinearOutput(entity); - }, - { - name: "Get Issue Priority Values", - } - ); - } - - issueRelation(key: IntegrationTaskKey, params: { id: string }): LinearReturnType { - return this.runTask( - key, - async (client) => { - const entity = await client.issueRelation(params.id); - return serializeLinearOutput(entity); - }, - { - name: "Get IssueRelation", - params, - properties: [{ label: "IssueRelation ID", text: params.id }], - } - ); - } - - issueRelations( - key: IntegrationTaskKey, - params: L.IssueRelationsQueryVariables = {} - ): LinearReturnType { - return this.runTask( - key, - async (client) => { - const edges = await client.issueRelations(params); - return serializeLinearOutput(edges); - }, - { - name: "Get IssueRelations", - params, - properties: queryProperties(params), - } - ); - } - - createIssueRelation( - key: IntegrationTaskKey, - params: L.IssueRelationCreateInput - ): LinearReturnType { - return this.runTask( - key, - async (client) => { - const payload = await client.createIssueRelation(params); - return serializeLinearOutput(await payload.issueRelation); - }, - { - name: "Create IssueRelation", - params, - properties: [ - { label: "Issue ID", text: params.issueId }, - { label: "Related Issue ID", text: params.relatedIssueId }, - { label: "Relation Type", text: params.type }, - ], - } - ); - } - - notification(key: IntegrationTaskKey, params: { id: string }): LinearReturnType { - return this.runTask( - key, - async (client) => { - const entity = await client.notification(params.id); - return serializeLinearOutput(entity); - }, - { - name: "Get Notification", - params, - properties: [{ label: "Notification ID", text: params.id }], - } - ); - } - - notifications( - key: IntegrationTaskKey, - params: L.NotificationsQueryVariables = {} - ): LinearReturnType { - return this.runTask( - key, - async (client) => { - const edges = await client.notifications(params); - return serializeLinearOutput(edges); - }, - { - name: "Get Notifications", - params, - properties: queryProperties(params), - } - ); - } - - archiveNotification( - key: IntegrationTaskKey, - params: { id: string } - ): LinearReturnType { - return this.runTask( - key, - async (client) => { - const payload = await client.archiveNotification(params.id); - return serializeLinearOutput(payload); - }, - { - name: "Archive Notification", - params, - properties: [{ label: "Notification ID", text: params.id }], - } - ); - } - - createNotificationSubscription( - key: IntegrationTaskKey, - params: { - input: L.NotificationSubscriptionCreateInput; - } - ): LinearReturnType { - return this.runTask( - key, - async (client) => { - const payload = await client.createNotificationSubscription(params.input); - return serializeLinearOutput(payload); - }, - { - name: "Create Notification Subscription", - params, - } - ); - } - - organization(key: IntegrationTaskKey): LinearReturnType { - return this.runTask( - key, - async (client) => { - const entity = await client.organization; - return serializeLinearOutput(entity); - }, - { - name: "Get Viewer's Organization", - } - ); - } - - createOrganizationFromOnboarding( - key: IntegrationTaskKey, - params: { - input: L.CreateOrganizationInput; - variables?: Omit; - } - ): LinearReturnType { - return this.runTask( - key, - async (client) => { - const payload = await client.createOrganizationFromOnboarding( - params.input, - params.variables - ); - return serializeLinearOutput(await payload.organization); - }, - { - name: "Create Organization", - params, - properties: [ - { label: "Name", text: params.input.name }, - { label: "URL Key", text: params.input.urlKey }, - ], - } - ); - } - - /** WARNING: Causes internal server errors on Linear's side, regardless of input. */ - createOrganizationInvite( - key: IntegrationTaskKey, - params: { - input: L.OrganizationInviteCreateInput; - } - ): LinearReturnType { - return this.runTask( - key, - async (client) => { - const payload = await client.createOrganizationInvite(params.input); - return serializeLinearOutput(await payload.organizationInvite); - }, - { - name: "Create Organization Invite", - params, - properties: [{ label: "Invitee Email", text: params.input.email }], - } - ); - } - - project(key: IntegrationTaskKey, params: { id: string }): LinearReturnType { - return this.runTask( - key, - async (client) => { - const entity = await client.project(params.id); - return serializeLinearOutput(entity); - }, - { - name: "Get Project", - params, - properties: [{ label: "Project ID", text: params.id }], - } - ); - } - - projects( - key: IntegrationTaskKey, - params: L.ProjectsQueryVariables = {} - ): LinearReturnType { - return this.runTask( - key, - async (client) => { - const edges = await client.projects(params); - return serializeLinearOutput(edges); - }, - { - name: "Get Projects", - params, - properties: queryProperties(params), - } - ); - } - - archiveProject( - key: IntegrationTaskKey, - params: { - id: string; - variables?: Omit; - } - ): LinearReturnType> { - return this.runTask( - key, - async (client) => { - const payload = await client.archiveProject(params.id, params.variables); - return serializeLinearOutput({ - ...payload, - entity: await payload.entity, - }); - }, - { - name: "Archive Project", - params, - properties: [{ label: "Project ID", text: params.id }], - } - ); - } - - createProject( - key: IntegrationTaskKey, - params: L.ProjectCreateInput - ): LinearReturnType { - return this.runTask( - key, - async (client) => { - const payload = await client.createProject(params); - return serializeLinearOutput(await payload.project); - }, - { - name: "Create Project", - params, - properties: [ - { label: "Team IDs", text: params.teamIds.join(", ") }, - { label: "Project name", text: params.name }, - ], - } - ); - } - - deleteProject( - key: IntegrationTaskKey, - params: { id: string } - ): LinearReturnType { - return this.runTask( - key, - async (client) => { - const payload = await client.deleteProject(params.id); - return serializeLinearOutput(await payload.entity); - }, - { - name: "Delete Project", - params, - properties: [{ label: "Project ID", text: params.id }], - } - ); - } - - searchProjects( - key: IntegrationTaskKey, - params: { - term: string; - variables?: Parameters[1]; - } - ): LinearReturnType { - return this.runTask( - key, - async (client) => { - const payload = await client.searchProjects(params.term, params.variables); - return serializeLinearOutput(payload); - }, - { - name: "Search Projects", - params, - properties: [{ label: "Search Term", text: params.term }], - } - ); - } - - updateProject( - key: IntegrationTaskKey, - params: { id: string; input: L.ProjectUpdateInput } - ): LinearReturnType { - return this.runTask( - key, - async (client) => { - const payload = await client.updateProject(params.id, params.input); - return serializeLinearOutput(await payload.project); - }, - { - name: "Update Project", - params, - properties: [{ label: "Project ID", text: params.id }], - } - ); - } - - projectLink(key: IntegrationTaskKey, params: { id: string }): LinearReturnType { - return this.runTask( - key, - async (client) => { - const entity = await client.projectLink(params.id); - return serializeLinearOutput(entity); - }, - { - name: "Get ProjectLink", - params, - properties: [{ label: "ProjectLink ID", text: params.id }], - } - ); - } - - projectLinks( - key: IntegrationTaskKey, - params: L.ProjectLinksQueryVariables = {} - ): LinearReturnType { - return this.runTask( - key, - async (client) => { - const edges = await client.projectLinks(params); - return serializeLinearOutput(edges); - }, - { - name: "Get ProjectLinks", - params, - properties: queryProperties(params), - } - ); - } - - createProjectLink( - key: IntegrationTaskKey, - params: L.ProjectLinkCreateInput - ): LinearReturnType { - return this.runTask( - key, - async (client) => { - const payload = await client.createProjectLink(params); - return serializeLinearOutput(await payload.projectLink); - }, - { - name: "Create ProjectLink", - params, - properties: [ - { label: "Project ID", text: params.projectId }, - { label: "Link Label", text: params.label }, - { label: "Link URL", text: params.url }, - ], - } - ); - } - - createProjectMilestone( - key: IntegrationTaskKey, - params: L.ProjectMilestoneCreateInput - ): LinearReturnType { - return this.runTask( - key, - async (client) => { - const payload = await client.createProjectMilestone(params); - return serializeLinearOutput(await payload.projectMilestone); - }, - { - name: "Create ProjectMilestone", - params, - properties: [ - { label: "Project ID", text: params.projectId }, - { label: "Milestone Name", text: params.name }, - ], - } - ); - } - - projectUpdate(key: IntegrationTaskKey, params: { id: string }): LinearReturnType { - return this.runTask( - key, - async (client) => { - const entity = await client.projectUpdate(params.id); - return serializeLinearOutput(entity); - }, - { - name: "Get ProjectUpdate", - params, - properties: [{ label: "ProjectUpdate ID", text: params.id }], - } - ); - } - - projectUpdates( - key: IntegrationTaskKey, - params: L.ProjectUpdatesQueryVariables = {} - ): LinearReturnType { - return this.runTask( - key, - async (client) => { - const edges = await client.projectUpdates(params); - return serializeLinearOutput(edges); - }, - { - name: "Get ProjectUpdates", - params, - properties: queryProperties(params), - } - ); - } - - createProjectUpdate( - key: IntegrationTaskKey, - params: L.ProjectUpdateCreateInput - ): LinearReturnType { - return this.runTask( - key, - async (client) => { - const payload = await client.createProjectUpdate(params); - return serializeLinearOutput(await payload.projectUpdate); - }, - { - name: "Create ProjectUpdate", - params, - properties: [{ label: "Project ID", text: params.projectId }], - } - ); - } - - deleteProjectUpdate(key: IntegrationTaskKey, params: { id: string }): Promise { - return this.runTask(key, (client) => client.deleteProjectUpdate(params.id), { - name: "Delete ProjectUpdate", - params, - properties: [{ label: "ProjectUpdate ID", text: params.id }], - }); - } - - updateProjectUpdate( - key: IntegrationTaskKey, - params: { id: string; input: L.ProjectUpdateUpdateInput } - ): LinearReturnType { - return this.runTask( - key, - async (client) => { - const payload = await client.updateProjectUpdate(params.id, params.input); - return serializeLinearOutput(await payload.projectUpdate); - }, - { - name: "Update ProjectUpdate", - params, - properties: [{ label: "ProjectUpdate ID", text: params.id }], - } - ); - } - - createReaction( - key: IntegrationTaskKey, - params: L.ReactionCreateInput & { emoji: string } - ): LinearReturnType { - return this.runTask( - key, - async (client) => { - const payload = await client.createReaction(params); - return serializeLinearOutput(await payload.reaction); - }, - { - name: "Create Reaction", - params, - properties: [ - ...(params.commentId ? [{ label: "Comment ID", text: params.commentId }] : []), - ...(params.issueId ? [{ label: "Issue ID", text: params.issueId }] : []), - ...(params.projectUpdateId - ? [{ label: "ProjectUpdate ID", text: params.projectUpdateId }] - : []), - { label: "Emoji", text: params.emoji }, - ], - } - ); - } - - deleteReaction(key: IntegrationTaskKey, params: { id: string }): Promise { - return this.runTask(key, (client) => client.deleteReaction(params.id), { - name: "Delete Reaction", - params, - properties: [{ label: "Reaction ID", text: params.id }], - }); - } - - archiveRoadmap( - key: IntegrationTaskKey, - params: { id: string } - ): LinearReturnType> { - return this.runTask( - key, - async (client) => { - const payload = await client.archiveRoadmap(params.id); - return serializeLinearOutput({ - ...payload, - entity: await payload.entity, - }); - }, - { - name: "Archive Roadmap", - params, - properties: [{ label: "Roadmap ID", text: params.id }], - } - ); - } - - createRoadmap( - key: IntegrationTaskKey, - params: L.RoadmapCreateInput - ): LinearReturnType { - return this.runTask( - key, - async (client) => { - const payload = await client.createRoadmap(params); - return serializeLinearOutput(await payload.roadmap); - }, - { - name: "Create Roadmap", - params, - properties: [{ label: "Roadmap Name", text: params.name }], - } - ); - } - - team(key: IntegrationTaskKey, params: { id: string }): LinearReturnType { - return this.runTask( - key, - async (client) => { - const entity = await client.team(params.id); - return serializeLinearOutput(entity); - }, - { - name: "Get Team", - params, - properties: [{ label: "Team ID", text: params.id }], - } - ); - } - - teams( - key: IntegrationTaskKey, - params: L.TeamsQueryVariables = {} - ): LinearReturnType { - return this.runTask( - key, - async (client) => { - const edges = await client.teams(params); - return serializeLinearOutput(edges); - }, - { - name: "Get Teams", - params, - properties: queryProperties(params), - } - ); - } - - createTeam( - key: IntegrationTaskKey, - params: L.TeamCreateInput - ): LinearReturnType { - return this.runTask( - key, - async (client) => { - const payload = await client.createTeam(params); - return serializeLinearOutput(await payload.team); - }, - { - name: "Create Team", - params, - properties: [{ label: "Team Name", text: params.name }], - } - ); - } - - teamMembership( - key: IntegrationTaskKey, - params: { id: string } - ): LinearReturnType { - return this.runTask( - key, - async (client) => { - const entity = await client.teamMembership(params.id); - return serializeLinearOutput(entity); - }, - { - name: "Get TeamMembership", - params, - properties: [{ label: "TeamMembership ID", text: params.id }], - } - ); - } - - teamMemberships( - key: IntegrationTaskKey, - params: L.TeamMembershipsQueryVariables = {} - ): LinearReturnType { - return this.runTask( - key, - async (client) => { - const edges = await client.teamMemberships(params); - return serializeLinearOutput(edges); - }, - { - name: "Get TeamMemberships", - params, - properties: queryProperties(params), - } - ); - } - - createTeamMembership( - key: IntegrationTaskKey, - params: L.TeamMembershipCreateInput - ): LinearReturnType { - return this.runTask( - key, - async (client) => { - const payload = await client.createTeamMembership(params); - return serializeLinearOutput(await payload.teamMembership); - }, - { - name: "Create TeamMembership", - params, - properties: [ - { label: "Team ID", text: params.teamId }, - { label: "User ID", text: params.userId }, - ], - } - ); - } - - template(key: IntegrationTaskKey, params: { id: string }): LinearReturnType