Compare commits
24 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1d7e5737a0 | |||
| 305e3b7ef2 | |||
| 03721cb18d | |||
| 773a6e2c81 | |||
| 2f13ac100f | |||
| a10782490f | |||
| 6ad91123f2 | |||
| 81f2d5e4ec | |||
| f249d8defa | |||
| 09aef5cda7 | |||
| 3028b6ad9d | |||
| 060b650845 | |||
| 6186a14398 | |||
| 916a353660 | |||
| 699878a5b1 | |||
| d2c9b64212 | |||
| 3102deccfb | |||
| 97c1b51332 | |||
| 4ab7082954 | |||
| 760f5de248 | |||
| de7e8c783e | |||
| 45b7af53e6 | |||
| aa7458fe37 | |||
| 1fd1d26780 |
+17
-4
@@ -1,11 +1,24 @@
|
||||
{
|
||||
"$schema": "https://unpkg.com/@changesets/config@2.2.0/schema.json",
|
||||
"changelog": "@changesets/cli/changelog",
|
||||
"changelog": [
|
||||
"@remix-run/changelog-github",
|
||||
{
|
||||
"repo": "triggerdotdev/trigger.dev"
|
||||
}
|
||||
],
|
||||
"commit": false,
|
||||
"fixed": [["@trigger.dev/*"]],
|
||||
"fixed": [
|
||||
[
|
||||
"@trigger.dev/*"
|
||||
]
|
||||
],
|
||||
"linked": [],
|
||||
"access": "public",
|
||||
"baseBranch": "main",
|
||||
"updateInternalDependencies": "patch",
|
||||
"ignore": ["webapp", "emails", "@trigger.dev/database"]
|
||||
}
|
||||
"ignore": [
|
||||
"webapp",
|
||||
"emails",
|
||||
"@trigger.dev/database"
|
||||
]
|
||||
}
|
||||
@@ -27,6 +27,7 @@ export type EnqueueRunExecutionV2Options = {
|
||||
runAt?: Date;
|
||||
resumeTaskId?: string;
|
||||
isRetry?: boolean;
|
||||
skipRetrying?: boolean;
|
||||
};
|
||||
|
||||
export async function enqueueRunExecutionV2(
|
||||
@@ -47,6 +48,7 @@ export async function enqueueRunExecutionV2(
|
||||
tx,
|
||||
runAt: options.runAt,
|
||||
jobKey: `job_run:${run.id}`,
|
||||
maxAttempts: options.skipRetrying ? 1 : undefined,
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@@ -195,12 +195,13 @@ export class ZodWorker<TMessageCatalog extends MessageCatalogSchema> {
|
||||
): Promise<GraphileJob> {
|
||||
const task = this.#tasks[identifier];
|
||||
|
||||
const optionsWithoutTx = omit(options ?? {}, ["tx"]);
|
||||
const optionsWithoutTx = removeUndefinedKeys(omit(options ?? {}, ["tx"]));
|
||||
const taskWithoutJobKey = omit(task, ["jobKey"]);
|
||||
|
||||
// Make sure options passed in to enqueue take precedence over task options
|
||||
const spec = {
|
||||
...optionsWithoutTx,
|
||||
...taskWithoutJobKey,
|
||||
...optionsWithoutTx,
|
||||
};
|
||||
|
||||
if (typeof task.queueName === "function") {
|
||||
@@ -437,3 +438,12 @@ export class ZodWorker<TMessageCatalog extends MessageCatalogSchema> {
|
||||
logger.debug(`[worker][${this.#name}] ${message}`, args);
|
||||
}
|
||||
}
|
||||
|
||||
function removeUndefinedKeys<T extends object>(obj: T): T {
|
||||
for (let key in obj) {
|
||||
if (Object.prototype.hasOwnProperty.call(obj, key) && obj[key] === undefined) {
|
||||
delete obj[key];
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,10 @@ export async function action({ request }: ActionArgs) {
|
||||
},
|
||||
body: JSON.stringify({
|
||||
title: body.type,
|
||||
content: body,
|
||||
content: {
|
||||
...body,
|
||||
example: { id: body.type, name: body.type, icon: "stripe", payload: body.data.object },
|
||||
},
|
||||
readOnly: true,
|
||||
}),
|
||||
});
|
||||
|
||||
+6
@@ -1,4 +1,5 @@
|
||||
import { ActionArgs, LoaderArgs, json } from "@remix-run/server-runtime";
|
||||
import { RuntimeEnvironmentType } from "@trigger.dev/database";
|
||||
import { z } from "zod";
|
||||
import { PrismaClient, prisma } from "~/db.server";
|
||||
import { logger } from "~/services/logger.server";
|
||||
@@ -99,6 +100,9 @@ export class TriggerEndpointIndexHookService {
|
||||
slug: endpointSlug,
|
||||
},
|
||||
},
|
||||
include: {
|
||||
environment: true,
|
||||
},
|
||||
});
|
||||
|
||||
if (!endpoint) {
|
||||
@@ -122,6 +126,8 @@ export class TriggerEndpointIndexHookService {
|
||||
},
|
||||
{
|
||||
runAt: new Date(Date.now() + 5000),
|
||||
maxAttempts:
|
||||
endpoint.environment.type === RuntimeEnvironmentType.DEVELOPMENT ? 1 : undefined,
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@@ -28,7 +28,10 @@ export class EndpointApiError extends Error {
|
||||
}
|
||||
|
||||
export class EndpointApi {
|
||||
constructor(private apiKey: string, private url: string) {}
|
||||
constructor(
|
||||
private apiKey: string,
|
||||
private url: string
|
||||
) {}
|
||||
|
||||
async ping(endpointId: string): Promise<PongResponse> {
|
||||
const response = await safeFetch(this.url, {
|
||||
|
||||
@@ -4,6 +4,7 @@ import { AuthenticatedEnvironment } from "../apiAuth.server";
|
||||
import { EndpointApi } from "../endpointApi.server";
|
||||
import { workerQueue } from "../worker.server";
|
||||
import { env } from "~/env.server";
|
||||
import { RuntimeEnvironmentType } from "@trigger.dev/database";
|
||||
|
||||
const indexingHookIdentifier = customAlphabet("0123456789abcdefghijklmnopqrstuvxyz", 10);
|
||||
|
||||
@@ -51,6 +52,9 @@ export class CreateEndpointService {
|
||||
slug: id,
|
||||
},
|
||||
},
|
||||
include: {
|
||||
environment: true,
|
||||
},
|
||||
create: {
|
||||
environment: {
|
||||
connect: {
|
||||
@@ -83,7 +87,11 @@ export class CreateEndpointService {
|
||||
id: endpoint.id,
|
||||
source: "INTERNAL",
|
||||
},
|
||||
{ tx }
|
||||
{
|
||||
tx,
|
||||
maxAttempts:
|
||||
endpoint.environment.type === RuntimeEnvironmentType.DEVELOPMENT ? 1 : undefined,
|
||||
}
|
||||
);
|
||||
|
||||
return endpoint;
|
||||
|
||||
@@ -5,6 +5,7 @@ import { AuthenticatedEnvironment } from "../apiAuth.server";
|
||||
import { workerQueue } from "../worker.server";
|
||||
import { CreateEndpointError } from "./createEndpoint.server";
|
||||
import { EndpointApi } from "../endpointApi.server";
|
||||
import { RuntimeEnvironmentType } from "@trigger.dev/database";
|
||||
|
||||
const indexingHookIdentifier = customAlphabet("0123456789abcdefghijklmnopqrstuvxyz", 10);
|
||||
|
||||
@@ -35,6 +36,9 @@ export class ValidateCreateEndpointService {
|
||||
slug: validationResult.endpointId,
|
||||
},
|
||||
},
|
||||
include: {
|
||||
environment: true,
|
||||
},
|
||||
create: {
|
||||
environment: {
|
||||
connect: {
|
||||
@@ -67,7 +71,11 @@ export class ValidateCreateEndpointService {
|
||||
id: endpoint.id,
|
||||
source: "INTERNAL",
|
||||
},
|
||||
{ tx }
|
||||
{
|
||||
tx,
|
||||
maxAttempts:
|
||||
endpoint.environment.type === RuntimeEnvironmentType.DEVELOPMENT ? 1 : undefined,
|
||||
}
|
||||
);
|
||||
|
||||
return endpoint;
|
||||
|
||||
@@ -7,7 +7,10 @@ import { logger } from "../logger.server";
|
||||
export class IngestSendEvent {
|
||||
#prismaClient: PrismaClientOrTransaction;
|
||||
|
||||
constructor(prismaClient: PrismaClientOrTransaction = prisma, private deliverEvents = true) {
|
||||
constructor(
|
||||
prismaClient: PrismaClientOrTransaction = prisma,
|
||||
private deliverEvents = true
|
||||
) {
|
||||
this.#prismaClient = prismaClient;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { RuntimeEnvironmentType } from "@trigger.dev/database";
|
||||
import { $transaction, Prisma, PrismaClient, prisma } from "~/db.server";
|
||||
import { enqueueRunExecutionV2 } from "~/models/jobRunExecution.server";
|
||||
|
||||
@@ -16,6 +17,9 @@ export class ContinueRunService {
|
||||
async (tx) => {
|
||||
const run = await tx.jobRun.findUniqueOrThrow({
|
||||
where: { id: runId },
|
||||
include: {
|
||||
environment: true,
|
||||
},
|
||||
});
|
||||
|
||||
if (!RESUMABLE_STATUSES.includes(run.status)) {
|
||||
@@ -35,7 +39,9 @@ export class ContinueRunService {
|
||||
},
|
||||
});
|
||||
|
||||
await enqueueRunExecutionV2(run, tx);
|
||||
await enqueueRunExecutionV2(run, tx, {
|
||||
skipRetrying: run.environment.type === RuntimeEnvironmentType.DEVELOPMENT,
|
||||
});
|
||||
},
|
||||
{ timeout: 10000 }
|
||||
);
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
RunJobSuccess,
|
||||
RunSourceContextSchema,
|
||||
} from "@trigger.dev/core";
|
||||
import type { Task } from "@trigger.dev/database";
|
||||
import { RuntimeEnvironmentType, type Task } from "@trigger.dev/database";
|
||||
import { generateErrorMessage } from "zod-error";
|
||||
import { eventRecordToApiJson } from "~/api.server";
|
||||
import { $transaction, PrismaClient, PrismaClientOrTransaction, prisma } from "~/db.server";
|
||||
@@ -135,7 +135,9 @@ export class PerformRunExecutionV2Service {
|
||||
},
|
||||
});
|
||||
|
||||
await enqueueRunExecutionV2(run, tx);
|
||||
await enqueueRunExecutionV2(run, tx, {
|
||||
skipRetrying: run.environment.type === RuntimeEnvironmentType.DEVELOPMENT,
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -337,6 +339,7 @@ export class PerformRunExecutionV2Service {
|
||||
runAt: data.task.delayUntil ?? undefined,
|
||||
resumeTaskId: data.task.id,
|
||||
isRetry,
|
||||
skipRetrying: run.environment.type === RuntimeEnvironmentType.DEVELOPMENT,
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -409,6 +412,7 @@ export class PerformRunExecutionV2Service {
|
||||
runAt: data.retryAt,
|
||||
resumeTaskId: data.task.id,
|
||||
isRetry,
|
||||
skipRetrying: run.environment.type === RuntimeEnvironmentType.DEVELOPMENT,
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -464,7 +468,9 @@ export class PerformRunExecutionV2Service {
|
||||
},
|
||||
});
|
||||
|
||||
await enqueueRunExecutionV2(run, tx);
|
||||
await enqueueRunExecutionV2(run, tx, {
|
||||
skipRetrying: run.environment.type === RuntimeEnvironmentType.DEVELOPMENT,
|
||||
});
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -477,7 +483,9 @@ export class PerformRunExecutionV2Service {
|
||||
}
|
||||
}
|
||||
|
||||
function prepareTasksForRun(tasks: FoundTask[]): CachedTask[] {
|
||||
function prepareTasksForRun(possibleTasks: FoundTask[]): CachedTask[] {
|
||||
const tasks = possibleTasks.filter((task) => task.status === "COMPLETED");
|
||||
|
||||
// We need to limit the cached tasks to not be too large >3.5MB when serialized
|
||||
const TOTAL_CACHED_TASK_BYTE_LIMIT = 3500000;
|
||||
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
import type { ConnectionType, Integration, IntegrationConnection } from "@trigger.dev/database";
|
||||
import {
|
||||
RuntimeEnvironmentType,
|
||||
type ConnectionType,
|
||||
type Integration,
|
||||
type IntegrationConnection,
|
||||
} from "@trigger.dev/database";
|
||||
import type { PrismaClient, PrismaClientOrTransaction } from "~/db.server";
|
||||
import { prisma } from "~/db.server";
|
||||
import { enqueueRunExecutionV2 } from "~/models/jobRunExecution.server";
|
||||
@@ -83,7 +88,9 @@ export class StartRunService {
|
||||
|
||||
const updatedRun = await updateRun();
|
||||
|
||||
await enqueueRunExecutionV2(updatedRun, this.#prismaClient);
|
||||
await enqueueRunExecutionV2(updatedRun, this.#prismaClient, {
|
||||
skipRetrying: run.environment.type === RuntimeEnvironmentType.DEVELOPMENT,
|
||||
});
|
||||
}
|
||||
|
||||
async #handleMissingConnections(id: string, runConnectionsByKey: RunConnectionsByKey) {
|
||||
@@ -140,6 +147,7 @@ async function findRun(tx: PrismaClientOrTransaction, id: string) {
|
||||
where: { id },
|
||||
include: {
|
||||
queue: true,
|
||||
environment: true,
|
||||
version: {
|
||||
include: {
|
||||
integrations: {
|
||||
|
||||
@@ -2,6 +2,7 @@ import type { PrismaClient } from "~/db.server";
|
||||
import { prisma } from "~/db.server";
|
||||
import { workerQueue } from "../worker.server";
|
||||
import { requestUrl } from "~/utils/requestUrl.server";
|
||||
import { RuntimeEnvironmentType } from "@trigger.dev/database";
|
||||
|
||||
export class HandleHttpSourceService {
|
||||
#prismaClient: PrismaClient;
|
||||
@@ -55,6 +56,8 @@ export class HandleHttpSourceService {
|
||||
{
|
||||
queueName: `endpoint-${triggerSource.endpointId}`,
|
||||
tx,
|
||||
maxAttempts:
|
||||
triggerSource.environment.type === RuntimeEnvironmentType.DEVELOPMENT ? 1 : undefined,
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { env } from "process";
|
||||
import { Run } from "~/presenters/RunPresenter.server";
|
||||
import {
|
||||
FetchOperationSchema,
|
||||
FetchRequestInit,
|
||||
@@ -6,7 +8,7 @@ import {
|
||||
RedactString,
|
||||
calculateRetryAt,
|
||||
} from "@trigger.dev/core";
|
||||
import type { Task } from "@trigger.dev/database";
|
||||
import { RuntimeEnvironmentType, type Task } from "@trigger.dev/database";
|
||||
import { $transaction, PrismaClient, PrismaClientOrTransaction, prisma } from "~/db.server";
|
||||
import { enqueueRunExecutionV2 } from "~/models/jobRunExecution.server";
|
||||
import { formatUnknownError } from "~/utils/formatErrors.server";
|
||||
@@ -244,7 +246,9 @@ export class PerformTaskOperationService {
|
||||
}
|
||||
|
||||
async #resumeRunExecution(task: NonNullable<FoundTask>, prisma: PrismaClientOrTransaction) {
|
||||
await enqueueRunExecutionV2(task.run, prisma);
|
||||
await enqueueRunExecutionV2(task.run, prisma, {
|
||||
skipRetrying: task.run.environment.type === RuntimeEnvironmentType.DEVELOPMENT,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -281,6 +285,7 @@ async function findTask(prisma: PrismaClient, id: string) {
|
||||
attempts: true,
|
||||
run: {
|
||||
include: {
|
||||
environment: true,
|
||||
queue: true,
|
||||
},
|
||||
},
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
---
|
||||
title: "Managing Jobs"
|
||||
description: "Managing jobs in your codebase and the dashboard"
|
||||
description: "Managing Jobs in your codebase and the dashboard"
|
||||
---
|
||||
|
||||
## Disabling jobs
|
||||
## Disabling Jobs
|
||||
|
||||
To prevent a job from processing new runs, you can disable it by setting the `enabled` option:
|
||||
To prevent a Job from processing new Runs, you can disable it by setting the `enabled` option:
|
||||
|
||||
```ts
|
||||
client.defineJob({
|
||||
@@ -15,29 +15,29 @@ client.defineJob({
|
||||
trigger: eventTrigger({ name: "example.event" }),
|
||||
enabled: false,
|
||||
run: async (payload, io, ctx) => {
|
||||
// your job code here
|
||||
// your Job code here
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
If you omit the `enabled` option, it will default to `true`.
|
||||
|
||||
The job will only be disabled in environments that have seen the `enabled = false` value. So the job will remain enabled in production until the code with the `enabled = false` is deployed to production.
|
||||
The Job will only be disabled in environments that have seen the `enabled = false` value. So the Job will remain enabled in production until the code with the `enabled = false` is deployed to production.
|
||||
|
||||
<Note>
|
||||
Currently this is the only way to disable a job. If you'd like to disable a job in the Dashboard,
|
||||
Currently this is the only way to disable a Job. If you'd like to disable a Job in the Dashboard,
|
||||
please reach out to us on [Discord](https://discord.gg/kA47vcd8P6) and let us know 👋
|
||||
</Note>
|
||||
|
||||
Once a job is disabled no **new** runs will be created for that job, and it will still be visible in the Dashboard as disabled:
|
||||
Once a Job is disabled no **new** Runs will be created for that Job, and it will still be visible in the Dashboard as disabled:
|
||||
|
||||

|
||||
|
||||
### In-progress runs
|
||||
### In-progress Runs
|
||||
|
||||
In-progress runs will be allowed to finish, even runs that are currently delayed from a call to `io.wait`. If you'd like to completely stop in-progress runs, you have two options:
|
||||
In-progress Runs will be allowed to finish, even Runs that are currently delayed from a call to `io.wait`. If you'd like to completely stop in-progress Runs, you have two options:
|
||||
|
||||
- Set the `enabled` option to false and then `throw` an error at the top of your job `run` function.
|
||||
- Set the `enabled` option to false and then `throw` an error at the top of your Job `run` function.
|
||||
|
||||
```ts
|
||||
client.defineJob({
|
||||
@@ -52,11 +52,11 @@ client.defineJob({
|
||||
});
|
||||
```
|
||||
|
||||
- Delete the job from your codebase. This will disable the job as well but also stop in progress runs.
|
||||
- Delete the Job from your codebase. This will disable the Job as well but also stop in progress Runs.
|
||||
|
||||
### Disabling in production with env vars
|
||||
|
||||
You can easily disable jobs in production using env vars so you don't have to deploy new code to disable a job.
|
||||
You can easily disable Jobs in production using env vars so you don't have to deploy new code to disable a Job.
|
||||
|
||||
```ts
|
||||
client.defineJob({
|
||||
@@ -66,19 +66,19 @@ client.defineJob({
|
||||
trigger: eventTrigger({ name: "example.event" }),
|
||||
enabled: process.env.TRIGGER_JOBS_DISABLED === "true",
|
||||
run: async (payload, io, ctx) => {
|
||||
// your job code here
|
||||
// your Job code here
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
Then you can disable the job in production by setting the `TRIGGER_JOBS_DISABLED` env var to `"true"`. And removing the env var will re-enable the job.
|
||||
Then you can disable the Job in production by setting the `TRIGGER_JOBS_DISABLED` env var to `"true"`. And removing the env var will re-enable the Job.
|
||||
|
||||
## Deleting jobs
|
||||
## Deleting Jobs
|
||||
|
||||
Once you have disabled a job in all environments, you can delete it from the dashboard by navigating to the Job list page and clicking the "triple-dot" menu next to the job you want to delete:
|
||||
Once you have disabled a Job in all environments, you can delete it from the dashboard by navigating to the Job list page and clicking the "triple-dot" menu next to the Job you want to delete:
|
||||
|
||||

|
||||
|
||||
This will bring up a dialog confirming that you want to delete the job and all of its history:
|
||||
This will bring up a dialog confirming that you want to delete the Job and all of its history:
|
||||
|
||||

|
||||
|
||||
@@ -29,7 +29,7 @@ We provide an official Trigger.dev [docker image](https://github.com/triggerdotd
|
||||
<Card
|
||||
title="Render.com"
|
||||
icon="draw-square"
|
||||
href="/documentation/guides/self-hosting/flyio"
|
||||
href="/documentation/guides/self-hosting/render"
|
||||
>
|
||||
Easily deploy to Render.com
|
||||
</Card>
|
||||
|
||||
@@ -74,10 +74,11 @@ Both of these secrets should be set to the base URL of your fly application. For
|
||||
|
||||
3. `DIRECT_URL`
|
||||
|
||||
This needs to be set to the database connection string that was printed to your terminal after the creation step above:
|
||||
This needs to match the value of `DATABASE_URL` which was printed to your terminal after the creation step above:
|
||||
|
||||
```sh
|
||||
Connection string: postgres://postgres:<PASSWORD>@<fly db name>.flycast:5432
|
||||
The following secret was added to <app name>:
|
||||
DATABASE_URL=postgres://postgres:<PASSWORD>@<fly db name>.flycast:5432/<app name>?sslmode=disable
|
||||
```
|
||||
|
||||
### Optional
|
||||
@@ -111,7 +112,7 @@ fly secrets set \
|
||||
SESSION_SECRET=<random string> \
|
||||
LOGIN_ORIGIN="https://<fly app name>.fly.dev" \
|
||||
APP_ORIGIN="https://<fly app name>.fly.dev" \
|
||||
DIRECT_URL="postgres://postgres:<PASSWORD>@<fly db name>.flycast:5432" \
|
||||
DIRECT_URL="postgres://postgres:<PASSWORD>@<fly db name>.flycast:5432/<app name>?sslmode=disable" \
|
||||
FROM_EMAIL="Acme Inc. <hello@yourdomain.com>" \
|
||||
REPLY_TO_EMAIL="Acme Inc. <reply@yourdomain.com>" \
|
||||
RESEND_API_KEY=<your API Key> \
|
||||
|
||||
@@ -0,0 +1,255 @@
|
||||
---
|
||||
title: Stripe
|
||||
---
|
||||
|
||||
<Snippet file="integration-getting-started.mdx" />
|
||||
|
||||
## Installation
|
||||
|
||||
<CodeGroup>
|
||||
|
||||
```bash npm
|
||||
npm add @trigger.dev/stripe@latest
|
||||
```
|
||||
|
||||
```bash pnpm
|
||||
pnpm add @trigger.dev/stripe@latest
|
||||
```
|
||||
|
||||
```bash yarn
|
||||
yarn add @trigger.dev/stripe@latest
|
||||
```
|
||||
|
||||
</CodeGroup>
|
||||
|
||||
## Authentication
|
||||
|
||||
The Stripe integration supports secret API Keys
|
||||
|
||||
```ts
|
||||
import { Stripe } from "@trigger.dev/stripe";
|
||||
|
||||
const stripe = new Stripe({
|
||||
id: "stripe",
|
||||
apiKey: process.env.STRIPE_API_KEY!,
|
||||
});
|
||||
```
|
||||
|
||||
## Triggers
|
||||
|
||||
The Stripe integration exposes a number of triggers that can be used on a job, powered by Stripe webhooks.
|
||||
|
||||
```ts
|
||||
client.defineJob({
|
||||
id: "stripe-price",
|
||||
name: "Stripe Price",
|
||||
version: "0.1.0",
|
||||
trigger: stripe.onPriceCreated(),
|
||||
run: async (payload, io, ctx) => {
|
||||
console.log(ctx.event.name); // "price.created"
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
As you can see above, the job will be triggered on the `price.created` event. If you'd like to trigger a job on multiple events, you can use the aggregate version of the trigger:
|
||||
|
||||
```ts
|
||||
client.defineJob({
|
||||
id: "stripe-price",
|
||||
name: "Stripe Price",
|
||||
version: "0.1.0",
|
||||
trigger: stripe.onPrice(),
|
||||
run: async (payload, io, ctx) => {
|
||||
console.log(ctx.event.name); // "price.created", "price.updated", "price.deleted"
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
"Aggregate" triggers also give you the ability to filter on specific events:
|
||||
|
||||
```ts
|
||||
client.defineJob({
|
||||
id: "stripe-price",
|
||||
name: "Stripe Price",
|
||||
version: "0.1.0",
|
||||
trigger: stripe.onPrice({
|
||||
events: ["price.created", "price.updated"],
|
||||
}),
|
||||
run: async (payload, io, ctx) => {
|
||||
console.log(ctx.event.name); // "price.created", "price.updated"
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
Available triggers are listed below:
|
||||
|
||||
| Function Name | Payload Object | Events | Aggregate Version |
|
||||
| ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ |
|
||||
| `onCharge` | [Charge](https://stripe.com/docs/api/events/types#charge_object) | `charge.succeeded`, `charge.failed`, `charge.captured`, `charge.refunded`, `charge.updated` | ✔️ |
|
||||
| `onChargeSucceeded` | [Charge](https://stripe.com/docs/api/events/types#charge_object) | `charge.succeeded` | `onCharge` |
|
||||
| `onChargeFailed` | [Charge](https://stripe.com/docs/api/events/types#charge_object) | `charge.failed` | `onCharge` |
|
||||
| `onChargeCaptured` | [Charge](https://stripe.com/docs/api/events/types#charge_object) | `charge.captured` | `onCharge` |
|
||||
| `onChargeRefunded` | [Charge](https://stripe.com/docs/api/events/types#charge_object) | `charge.refunded` | `onCharge` |
|
||||
| `onChargeUpdated` | [Charge](https://stripe.com/docs/api/events/types#charge_object) | `charge.updated` | `onCharge` |
|
||||
| `onProduct` | [Product](https://stripe.com/docs/api/events/types#product_object) | `product.created`, `product.updated`, `product.deleted` | ✔️ |
|
||||
| `onProductCreated` | [Product](https://stripe.com/docs/api/events/types#product_object) | `product.created` | `onProduct` |
|
||||
| `onProductUpdated` | [Product](https://stripe.com/docs/api/events/types#product_object) | `product.updated` | `onProduct` |
|
||||
| `onProductDeleted` | [Product](https://stripe.com/docs/api/events/types#product_object) | `product.deleted` | `onProduct` |
|
||||
| `onPrice` | [Price](https://stripe.com/docs/api/events/types#price_object) | `price.created`, `price.updated`, `price.deleted` | ✔️ |
|
||||
| `onPriceCreated` | [Price](https://stripe.com/docs/api/events/types#price_object) | `price.created` | `onPrice` |
|
||||
| `onPriceUpdated` | [Price](https://stripe.com/docs/api/events/types#price_object) | `price.updated` | `onPrice` |
|
||||
| `onPriceDeleted` | [Price](https://stripe.com/docs/api/events/types#price_object) | `price.deleted` | `onPrice` |
|
||||
| `onCheckoutSession` | [CheckoutSession](https://stripe.com/docs/api/events/types#checkout_session_object) | `checkout.session.completed`, `checkout.session.async_payment_succeeded`, `checkout.session.async_payment_failed`, `checkout.session.expired` | ✔️ |
|
||||
| `onCheckoutSessionCompleted` | [CheckoutSession](https://stripe.com/docs/api/events/types#checkout_session_object) | `checkout.session.completed` | `onCheckoutSession` |
|
||||
| `onCheckoutSessionExpired` | [CheckoutSession](https://stripe.com/docs/api/events/types#checkout_session_object) | `checkout.session.expired` | `onCheckoutSession` |
|
||||
| `onCustomerSubscription` | [Subscription](https://stripe.com/docs/api/events/types#subscription_object) | `customer.subscription.created`, `customer.subscription.updated`, `customer.subscription.deleted`, `customer.subscription.paused`, `customer.subscription.pending_updated_applied`, `customer.subscription.pending_update_expired`, `customer.subscription.resumed` | ✔️ |
|
||||
| `onCustomerSubscriptionCreated` | [Subscription](https://stripe.com/docs/api/events/types#subscription_object) | `customer.subscription.created` | `onCustomerSubscription` |
|
||||
| `onCustomerSubscriptionUpdated` | [Subscription](https://stripe.com/docs/api/events/types#subscription_object) | `customer.subscription.updated` | `onCustomerSubscription` |
|
||||
| `onCustomerSubscriptionDeleted` | [Subscription](https://stripe.com/docs/api/events/types#subscription_object) | `customer.subscription.deleted` | `onCustomerSubscription` |
|
||||
| `onCustomerSubscriptionPaused` | [Subscription](https://stripe.com/docs/api/events/types#subscription_object) | `customer.subscription.paused` | `onCustomerSubscription` |
|
||||
| `onCustomerSubscriptionPending` | [Subscription](https://stripe.com/docs/api/events/types#subscription_object) | `customer.subscription.pending_updated_applied`, `customer.subscription.pending_update_expired` | `onCustomerSubscription` |
|
||||
| `onCustomerSubscriptionResumed` | [Subscription](https://stripe.com/docs/api/events/types#subscription_object) | `customer.subscription.resumed` | `onCustomerSubscription` |
|
||||
| `onCustomer` | [Customer](https://stripe.com/docs/api/events/types#customer_object) | `customer.created`, `customer.updated`, `customer.deleted` | ✔️ |
|
||||
| `onCustomerCreated` | [Customer](https://stripe.com/docs/api/events/types#customer_object) | `customer.created` | `onCustomer` |
|
||||
| `onCustomerUpdated` | [Customer](https://stripe.com/docs/api/events/types#customer_object) | `customer.updated` | `onCustomer` |
|
||||
| `onCustomerDeleted` | [Customer](https://stripe.com/docs/api/events/types#customer_object) | `customer.deleted` | `onCustomer` |
|
||||
| `onExternalAccount` | [Card](https://stripe.com/docs/api/events/types#account_card_object) or [Bank Account](https://stripe.com/docs/api/events/types#account_bank_account_object) | `account.external_account.created`, `account.external_account.updated`, `account.external_account.deleted` | ✔️ |
|
||||
| `onExternalAccountCreated` | [Card](https://stripe.com/docs/api/events/types#account_card_object) or [Bank Account](https://stripe.com/docs/api/events/types#account_bank_account_object) | `account.external_account.created` | `onExternalAccount` |
|
||||
| `onExternalAccountUpdated` | [Card](https://stripe.com/docs/api/events/types#account_card_object) or [Bank Account](https://stripe.com/docs/api/events/types#account_bank_account_object) | `account.external_account.updated` | `onExternalAccount` |
|
||||
| `onExternalAccountDeleted` | [Card](https://stripe.com/docs/api/events/types#account_card_object) or [Bank Account](https://stripe.com/docs/api/events/types#account_bank_account_object) | `account.external_account.deleted` | `onExternalAccount` |
|
||||
| `onPerson` | [Person](https://stripe.com/docs/api/events/types#person_object) | `account.person.created`, `account.person.updated`, `account.person.deleted` | ✔️ |
|
||||
| `onPersonCreated` | [Person](https://stripe.com/docs/api/events/types#person_object) | `account.person.created` | `onPerson` |
|
||||
| `onPersonUpdated` | [Person](https://stripe.com/docs/api/events/types#person_object) | `account.person.updated` | `onPerson` |
|
||||
| `onPersonDeleted` | [Person](https://stripe.com/docs/api/events/types#person_object) | `account.person.deleted` | `onPerson` |
|
||||
| `onAccountUpdated` | [Account](https://stripe.com/docs/api/events/types#account_object) | `account.updated` | N/A |
|
||||
| `onPaymentIntent` | [PaymentIntent](https://stripe.com/docs/api/events/types#payment_intent_object) | `payment_intent.created`, `payment_intent.succeeded`, `payment_intent.payment_failed`, `payment_intent.canceled`, `payment_intent.processing`, `payment_intent.amount_capturable_updated`, `payment_intent.requires_action`, `payment_intent.partially_funded` | ✔️ |
|
||||
| `onPaymentIntentCreated` | [PaymentIntent](https://stripe.com/docs/api/events/types#payment_intent_object) | `payment_intent.created` | `onPaymentIntent` |
|
||||
| `onPaymentIntentSucceeded` | [PaymentIntent](https://stripe.com/docs/api/events/types#payment_intent_object) | `payment_intent.succeeded` | `onPaymentIntent` |
|
||||
| `onPaymentIntentPaymentFailed` | [PaymentIntent](https://stripe.com/docs/api/events/types#payment_intent_object) | `payment_intent.payment_failed` | `onPaymentIntent` |
|
||||
| `onPaymentIntentCanceled` | [PaymentIntent](https://stripe.com/docs/api/events/types#payment_intent_object) | `payment_intent.canceled` | `onPaymentIntent` |
|
||||
| `onPaymentIntentProcessing` | [PaymentIntent](https://stripe.com/docs/api/events/types#payment_intent_object) | `payment_intent.processing` | `onPaymentIntent` |
|
||||
| `onPaymentIntentRequiresAction` | [PaymentIntent](https://stripe.com/docs/api/events/types#payment_intent_object) | `payment_intent.requires_action` | `onPaymentIntent` |
|
||||
| `onPaymentIntentAmountCapturableUpdated` | [PaymentIntent](https://stripe.com/docs/api/events/types#payment_intent_object) | `payment_intent.amount_capturable_updated` | `onPaymentIntent` |
|
||||
| `onPaymentIntentPartiallyFunded` | [PaymentIntent](https://stripe.com/docs/api/events/types#payment_intent_object) | `payment_intent.partially_funded` | `onPaymentIntent` |
|
||||
| `onPayout` | [Payout](https://stripe.com/docs/api/events/types#payout_object) | `payout.created`, `payout.updated`, `payout.canceled`, `payout.paid`, `payout.failed`, `payout.reconciliation_completed` | ✔️ |
|
||||
| `onPayoutCreated` | [Payout](https://stripe.com/docs/api/events/types#payout_object) | `payout.created` | `onPayout` |
|
||||
| `onPayoutUpdated` | [Payout](https://stripe.com/docs/api/events/types#payout_object) | `payout.updated` | `onPayout` |
|
||||
| `onPayoutCanceled` | [Payout](https://stripe.com/docs/api/events/types#payout_object) | `payout.canceled` | `onPayout` |
|
||||
| `onPayoutPaid` | [Payout](https://stripe.com/docs/api/events/types#payout_object) | `payout.paid` | `onPayout` |
|
||||
| `onPayoutFailed` | [Payout](https://stripe.com/docs/api/events/types#payout_object) | `payout.failed` | `onPayout` |
|
||||
| `onPayoutReconciliationCompleted` | [Payout](https://stripe.com/docs/api/events/types#payout_object) | `payout.reconciliation_completed` | `onPayout` |
|
||||
|
||||
If there are any triggers missing that you'd like to see added, please [open a new GitHub Issue](https://github.com/triggerdotdev/trigger.dev/issues/new)
|
||||
|
||||
### Filtering
|
||||
|
||||
All the Stripe triggers take an optional `filter` parameter that allows you to only run the job when the filter matches the event payload:
|
||||
|
||||
```ts
|
||||
// Only trigger when the currency is USD
|
||||
client.defineJob({
|
||||
id: "stripe-on-subscription-created",
|
||||
name: "Stripe On Subscription Created",
|
||||
version: "0.1.0",
|
||||
trigger: stripe.onCustomerSubscriptionCreated({
|
||||
filter: {
|
||||
currency: ["usd"],
|
||||
},
|
||||
}),
|
||||
run: async (payload, io, ctx) => {
|
||||
await io.logger.info("ctx", { ctx });
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
Check out our [Event Filter docs](/documentation/guides/event-filter) for more information on how to use the filter.
|
||||
|
||||
## Tasks
|
||||
|
||||
You can make reliable calls to the Stripe API inside of jobs using the exposed stripe tasks:
|
||||
|
||||
```ts
|
||||
const stripe = new Stripe({
|
||||
id: "stripe",
|
||||
apiKey: process.env["STRIPE_API_KEY"]!,
|
||||
});
|
||||
|
||||
client.defineJob({
|
||||
id: "stripe-example-1",
|
||||
name: "Stripe Example 1",
|
||||
version: "0.1.0",
|
||||
trigger: eventTrigger({
|
||||
name: "stripe.example",
|
||||
schema: z.object({
|
||||
customerId: z.string(),
|
||||
source: z.string(),
|
||||
}),
|
||||
}),
|
||||
integrations: {
|
||||
stripe,
|
||||
},
|
||||
run: async (payload, io, ctx) => {
|
||||
await io.stripe.createCharge("create-charge", {
|
||||
amount: 100,
|
||||
currency: "usd",
|
||||
source: payload.source,
|
||||
customer: payload.customerId,
|
||||
});
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
We automatically fill in the `idempotencyKey` for you, so we can gaurentee that the API call will only be executed once.
|
||||
|
||||
Available tasks are listed below:
|
||||
|
||||
| Function Name | Description |
|
||||
| ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `createCharge` | Use the Payment Intents API to initiate a new payment instead of using this method. Confirmation of the PaymentIntent creates the Charge object used to request payment, so this method is limited to legacy integrations. |
|
||||
| `createCustomer` | Creates a new customer object |
|
||||
| `updateCustomer` | Updates the specified customer by setting the values of the parameters passed |
|
||||
| `retrieveSubscription` | Retrieves the subscription with the given ID. |
|
||||
| `createCheckoutSession` | Creates a new Checkout Session object. |
|
||||
|
||||
If there are any tasks missing that you'd like to see added, please [open a new GitHub Issue](https://github.com/triggerdotdev/trigger.dev/issues/new)
|
||||
|
||||
## Using the underlying Stripe client
|
||||
|
||||
You can use the underlying client to do anything the [stripe-node](https://github.com/stripe/stripe-node) client supports by using the `client` property on the integration:
|
||||
|
||||
```ts
|
||||
const stripe = new Stripe({
|
||||
id: "stripe",
|
||||
apiKey: process.env["STRIPE_API_KEY"]!,
|
||||
});
|
||||
|
||||
client.defineJob({
|
||||
id: "stripe-example-1",
|
||||
name: "Stripe Example 1",
|
||||
version: "0.1.0",
|
||||
trigger: eventTrigger({
|
||||
name: "stripe.example",
|
||||
}),
|
||||
integrations: {
|
||||
stripe,
|
||||
},
|
||||
run: async (payload, io, ctx) => {
|
||||
await io.runTask("create-price", { name: "Create Price" }, async (task) => {
|
||||
return stripe.client.prices.create(
|
||||
{
|
||||
unit_amount: 2000,
|
||||
currency: "usd",
|
||||
product_data: {
|
||||
name: "T-shirt",
|
||||
},
|
||||
},
|
||||
{
|
||||
idempotencyKey: task.idempotencyKey,
|
||||
}
|
||||
);
|
||||
});
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
Make sure to pass the `idempotencyKey` to the underlying client to ensure that the API call is only executed once. This is only needed for mutating API calls.
|
||||
@@ -193,6 +193,7 @@
|
||||
"integrations/apis/openai"
|
||||
]
|
||||
},
|
||||
"integrations/apis/stripe",
|
||||
"integrations/apis/plain",
|
||||
{
|
||||
"group": "Resend",
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { createExpressServer } from "@trigger.dev/express";
|
||||
import { TriggerClient, eventTrigger } from "@trigger.dev/sdk";
|
||||
import { z } from "zod";
|
||||
|
||||
export const client = new TriggerClient({
|
||||
id: "job-catalog",
|
||||
@@ -56,4 +57,45 @@ client.defineJob({
|
||||
},
|
||||
});
|
||||
|
||||
client.defineJob({
|
||||
id: "example-job",
|
||||
name: "Example Job: a joke with a delay",
|
||||
version: "0.0.2",
|
||||
trigger: eventTrigger({
|
||||
name: "shayan.event",
|
||||
schema: z.object({
|
||||
userId: z.string(),
|
||||
delay: z.number(),
|
||||
}),
|
||||
}),
|
||||
run: async (payload, io, ctx) => {
|
||||
await io.wait("sleeping", payload.delay);
|
||||
|
||||
await io.runTask("init", { name: "init" }, async () => {
|
||||
console.log("init function ran", payload.userId);
|
||||
});
|
||||
|
||||
await io.runTask("failable", { name: "task-1", retry: { limit: 3 } }, async (task) => {
|
||||
if (task.attempts > 2) {
|
||||
console.log("task succeeded");
|
||||
return {
|
||||
ok: true,
|
||||
};
|
||||
}
|
||||
console.log("task failed");
|
||||
throw new Error(`Task failed on ${task.attempts} attempt(s)`);
|
||||
});
|
||||
|
||||
await io.runTask(
|
||||
"log",
|
||||
{
|
||||
name: "log",
|
||||
},
|
||||
async () => {
|
||||
console.log("hello from the job", payload.userId);
|
||||
}
|
||||
);
|
||||
},
|
||||
});
|
||||
|
||||
createExpressServer(client);
|
||||
|
||||
@@ -186,4 +186,14 @@ client.defineJob({
|
||||
},
|
||||
});
|
||||
|
||||
client.defineJob({
|
||||
id: "stripe-on-charge",
|
||||
name: "Stripe On Charge",
|
||||
version: "0.1.0",
|
||||
trigger: stripe.onCharge(),
|
||||
run: async (payload, io, ctx) => {
|
||||
await io.logger.info("ctx", { ctx });
|
||||
},
|
||||
});
|
||||
|
||||
createExpressServer(client);
|
||||
|
||||
@@ -1,5 +1,28 @@
|
||||
# @trigger.dev/github
|
||||
|
||||
## 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@trigger.dev/github",
|
||||
"version": "2.0.11",
|
||||
"version": "2.0.14",
|
||||
"description": "The official GitHub integration for Trigger.dev",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
@@ -29,8 +29,8 @@
|
||||
"@octokit/request": "^6.2.5",
|
||||
"@octokit/request-error": "^4.0.1",
|
||||
"@octokit/webhooks": "^10.4.0",
|
||||
"@trigger.dev/sdk": "workspace:^2.0.11",
|
||||
"@trigger.dev/integration-kit": "workspace:^2.0.11",
|
||||
"@trigger.dev/sdk": "workspace:^2.0.14",
|
||||
"@trigger.dev/integration-kit": "workspace:^2.0.14",
|
||||
"octokit": "^2.0.14",
|
||||
"zod": "3.21.4"
|
||||
},
|
||||
|
||||
@@ -1,5 +1,28 @@
|
||||
# @trigger.dev/slack
|
||||
|
||||
## 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@trigger.dev/openai",
|
||||
"version": "2.0.11",
|
||||
"version": "2.0.14",
|
||||
"description": "The official OpenAI integration for Trigger.dev",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
@@ -25,8 +25,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"openai": "^4.2.0",
|
||||
"@trigger.dev/sdk": "workspace:^2.0.11",
|
||||
"@trigger.dev/integration-kit": "workspace:^2.0.11"
|
||||
"@trigger.dev/sdk": "workspace:^2.0.14",
|
||||
"@trigger.dev/integration-kit": "workspace:^2.0.14"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.8.0"
|
||||
|
||||
@@ -1,5 +1,28 @@
|
||||
# @trigger.dev/plain
|
||||
|
||||
## 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@trigger.dev/plain",
|
||||
"version": "2.0.11",
|
||||
"version": "2.0.14",
|
||||
"description": "The official Plain.com integration for Trigger.dev",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
@@ -24,8 +24,8 @@
|
||||
"build:tsup": "tsup"
|
||||
},
|
||||
"dependencies": {
|
||||
"@trigger.dev/integration-kit": "workspace:^2.0.11",
|
||||
"@trigger.dev/sdk": "workspace:^2.0.11",
|
||||
"@trigger.dev/integration-kit": "workspace:^2.0.14",
|
||||
"@trigger.dev/sdk": "workspace:^2.0.14",
|
||||
"@team-plain/typescript-sdk": "^2.7.0"
|
||||
},
|
||||
"engines": {
|
||||
|
||||
@@ -1,5 +1,28 @@
|
||||
# @trigger.dev/resend
|
||||
|
||||
## 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@trigger.dev/resend",
|
||||
"version": "2.0.11",
|
||||
"version": "2.0.14",
|
||||
"description": "The official Resend.com integration for Trigger.dev",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
@@ -24,8 +24,8 @@
|
||||
"build:tsup": "tsup"
|
||||
},
|
||||
"dependencies": {
|
||||
"@trigger.dev/integration-kit": "workspace:^2.0.11",
|
||||
"@trigger.dev/sdk": "workspace:^2.0.11",
|
||||
"@trigger.dev/integration-kit": "workspace:^2.0.14",
|
||||
"@trigger.dev/sdk": "workspace:^2.0.14",
|
||||
"resend": "^0.9.1"
|
||||
},
|
||||
"engines": {
|
||||
|
||||
@@ -1,5 +1,28 @@
|
||||
# @trigger.dev/sendgrid
|
||||
|
||||
## 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@trigger.dev/sendgrid",
|
||||
"version": "2.0.11",
|
||||
"version": "2.0.14",
|
||||
"description": "Trigger.dev integration for @sendgrid/mail",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
@@ -26,8 +26,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@sendgrid/mail": "^7.7.0",
|
||||
"@trigger.dev/sdk": "workspace:^2.0.11",
|
||||
"@trigger.dev/integration-kit": "workspace:^2.0.11"
|
||||
"@trigger.dev/sdk": "workspace:^2.0.14",
|
||||
"@trigger.dev/integration-kit": "workspace:^2.0.14"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.8.0"
|
||||
|
||||
@@ -1,5 +1,25 @@
|
||||
# @trigger.dev/slack
|
||||
|
||||
## 2.0.14
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies:
|
||||
- `@trigger.dev/sdk@2.0.14`
|
||||
|
||||
## 2.0.13
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies:
|
||||
- `@trigger.dev/sdk@2.0.13`
|
||||
|
||||
## 2.0.12
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @trigger.dev/sdk@2.0.12
|
||||
|
||||
## 2.0.11
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@trigger.dev/slack",
|
||||
"version": "2.0.11",
|
||||
"version": "2.0.14",
|
||||
"description": "The official Slack integration for Trigger.dev",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
@@ -25,7 +25,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@slack/web-api": "^6.8.1",
|
||||
"@trigger.dev/sdk": "workspace:^2.0.11",
|
||||
"@trigger.dev/sdk": "workspace:^2.0.14",
|
||||
"zod": "3.21.4"
|
||||
},
|
||||
"engines": {
|
||||
|
||||
@@ -1,5 +1,30 @@
|
||||
# @trigger.dev/stripe
|
||||
|
||||
## 2.0.14
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Added additional triggers for PaymentIntent and Payout events ([`a1078249`](https://github.com/triggerdotdev/trigger.dev/commit/a10782490fd2764fde40beff4331da89a57e1f16))
|
||||
- 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
|
||||
|
||||
- 760f5de2: Adding additional Stripe triggers for account.updated, account.external*account.*, customer._, person._, and charge.\_
|
||||
- @trigger.dev/integration-kit@2.0.12
|
||||
- @trigger.dev/sdk@2.0.12
|
||||
|
||||
## 2.0.11
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@trigger.dev/stripe",
|
||||
"version": "2.0.11",
|
||||
"version": "2.0.14",
|
||||
"description": "Trigger.dev integration for stripe",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
@@ -26,8 +26,8 @@
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"@trigger.dev/integration-kit": "workspace:^2.0.11",
|
||||
"@trigger.dev/sdk": "workspace:^2.0.11",
|
||||
"@trigger.dev/integration-kit": "workspace:^2.0.14",
|
||||
"@trigger.dev/sdk": "workspace:^2.0.14",
|
||||
"stripe": "^12.14.0",
|
||||
"zod": "3.21.4"
|
||||
},
|
||||
|
||||
@@ -1,12 +1,36 @@
|
||||
import type { EventSpecification } from "@trigger.dev/sdk";
|
||||
import {
|
||||
amountCapturablePaymentIntentExample,
|
||||
cancelledPaymentIntentExample,
|
||||
cancelledSubscriptionExample,
|
||||
capturedChargeExample,
|
||||
checkoutSessionExample,
|
||||
createdCustomerExample,
|
||||
createdPaymentIntentExample,
|
||||
customerSubscriptionExample,
|
||||
deletedCustomerExample,
|
||||
failedChargeExample,
|
||||
failedPaymentIntentExample,
|
||||
pausedSubscriptionExample,
|
||||
refundedChargeExample,
|
||||
succeededChargeExample,
|
||||
succeededPaymentIntentExample,
|
||||
updatedAccountExample,
|
||||
updatedSubscriptionExample,
|
||||
} from "./examples";
|
||||
import { OnCheckoutSession, OnCustomerSubscription, OnPriceEvent, OnProductEvent } from "./types";
|
||||
import {
|
||||
OnAccountEvent,
|
||||
OnChargeEvent,
|
||||
OnCheckoutSession,
|
||||
OnCustomerEvent,
|
||||
OnCustomerSubscription,
|
||||
OnExternalAccountEvent,
|
||||
OnPaymentIntentEvent,
|
||||
OnPayoutEvent,
|
||||
OnPersonEvent,
|
||||
OnPriceEvent,
|
||||
OnProductEvent,
|
||||
} from "./types";
|
||||
|
||||
export const onPriceCreated: EventSpecification<OnPriceEvent> = {
|
||||
name: "price.created",
|
||||
@@ -451,3 +475,460 @@ export const onCustomerSubscriptionUpdated: EventSpecification<OnCustomerSubscri
|
||||
{ label: "Status", text: payload.status },
|
||||
],
|
||||
};
|
||||
|
||||
export const onAccountUpdated: EventSpecification<OnAccountEvent> = {
|
||||
name: "account.updated",
|
||||
title: "On Account Updated",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [updatedAccountExample],
|
||||
parsePayload: (payload) => payload as OnAccountEvent,
|
||||
runProperties: (payload) => [
|
||||
{ label: "Account ID", text: payload.id },
|
||||
...(payload.business_type ? [{ label: "Business Type", text: payload.business_type }] : []),
|
||||
],
|
||||
};
|
||||
|
||||
export const onCustomer: EventSpecification<OnCustomerEvent> = {
|
||||
name: ["customer.created", "customer.deleted", "customer.updated"],
|
||||
title: "On Customer Event",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [createdCustomerExample],
|
||||
parsePayload: (payload) => payload as OnCustomerEvent,
|
||||
runProperties: (payload) => [{ label: "Customer ID", text: payload.id }],
|
||||
};
|
||||
|
||||
export const onCustomerCreated: EventSpecification<OnCustomerEvent> = {
|
||||
name: "customer.created",
|
||||
title: "On Customer Created",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [createdCustomerExample],
|
||||
parsePayload: (payload) => payload as OnCustomerEvent,
|
||||
runProperties: (payload) => [{ label: "Customer ID", text: payload.id }],
|
||||
};
|
||||
|
||||
export const onCustomerDeleted: EventSpecification<OnCustomerEvent> = {
|
||||
name: "customer.deleted",
|
||||
title: "On Customer Deleted",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [deletedCustomerExample],
|
||||
parsePayload: (payload) => payload as OnCustomerEvent,
|
||||
runProperties: (payload) => [{ label: "Customer ID", text: payload.id }],
|
||||
};
|
||||
|
||||
export const onCustomerUpdated: EventSpecification<OnCustomerEvent> = {
|
||||
name: "customer.updated",
|
||||
title: "On Customer Updated",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [createdCustomerExample],
|
||||
parsePayload: (payload) => payload as OnCustomerEvent,
|
||||
runProperties: (payload) => [{ label: "Customer ID", text: payload.id }],
|
||||
};
|
||||
|
||||
export const onCharge: EventSpecification<OnChargeEvent> = {
|
||||
name: [
|
||||
"charge.captured",
|
||||
"charge.expired",
|
||||
"charge.failed",
|
||||
"charge.pending",
|
||||
"charge.refunded",
|
||||
"charge.succeeded",
|
||||
"charge.updated",
|
||||
],
|
||||
title: "On Charge Event",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [
|
||||
capturedChargeExample,
|
||||
succeededChargeExample,
|
||||
failedChargeExample,
|
||||
refundedChargeExample,
|
||||
],
|
||||
parsePayload: (payload) => payload as OnChargeEvent,
|
||||
runProperties: (payload) => [{ label: "Charge ID", text: payload.id }],
|
||||
};
|
||||
|
||||
export const onChargeCaptured: EventSpecification<OnChargeEvent> = {
|
||||
name: "charge.captured",
|
||||
title: "On Charge Captured",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [capturedChargeExample],
|
||||
parsePayload: (payload) => payload as OnChargeEvent,
|
||||
runProperties: (payload) => [{ label: "Charge ID", text: payload.id }],
|
||||
};
|
||||
|
||||
export const onChargeExpired: EventSpecification<OnChargeEvent> = {
|
||||
name: "charge.expired",
|
||||
title: "On Charge Expired",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [],
|
||||
parsePayload: (payload) => payload as OnChargeEvent,
|
||||
runProperties: (payload) => [{ label: "Charge ID", text: payload.id }],
|
||||
};
|
||||
|
||||
export const onChargeFailed: EventSpecification<OnChargeEvent> = {
|
||||
name: "charge.failed",
|
||||
title: "On Charge Failed",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [failedChargeExample],
|
||||
parsePayload: (payload) => payload as OnChargeEvent,
|
||||
runProperties: (payload) => [{ label: "Charge ID", text: payload.id }],
|
||||
};
|
||||
|
||||
export const onChargePending: EventSpecification<OnChargeEvent> = {
|
||||
name: "charge.pending",
|
||||
title: "On Charge Pending",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [],
|
||||
parsePayload: (payload) => payload as OnChargeEvent,
|
||||
runProperties: (payload) => [{ label: "Charge ID", text: payload.id }],
|
||||
};
|
||||
|
||||
export const onChargeRefunded: EventSpecification<OnChargeEvent> = {
|
||||
name: "charge.refunded",
|
||||
title: "On Charge Refunded",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [refundedChargeExample],
|
||||
parsePayload: (payload) => payload as OnChargeEvent,
|
||||
runProperties: (payload) => [{ label: "Charge ID", text: payload.id }],
|
||||
};
|
||||
|
||||
export const onChargeSucceeded: EventSpecification<OnChargeEvent> = {
|
||||
name: "charge.succeeded",
|
||||
title: "On Charge Succeeded",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [succeededChargeExample],
|
||||
parsePayload: (payload) => payload as OnChargeEvent,
|
||||
runProperties: (payload) => [{ label: "Charge ID", text: payload.id }],
|
||||
};
|
||||
|
||||
export const onChargeUpdated: EventSpecification<OnChargeEvent> = {
|
||||
name: "charge.updated",
|
||||
title: "On Charge Updated",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [],
|
||||
parsePayload: (payload) => payload as OnChargeEvent,
|
||||
runProperties: (payload) => [{ label: "Charge ID", text: payload.id }],
|
||||
};
|
||||
|
||||
export const onExternalAccount: EventSpecification<OnExternalAccountEvent> = {
|
||||
name: [
|
||||
"account.external_account.created",
|
||||
"account.external_account.deleted",
|
||||
"account.external_account.updated",
|
||||
],
|
||||
title: "On External Account Event",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [],
|
||||
parsePayload: (payload) => payload as OnExternalAccountEvent,
|
||||
runProperties: (payload) => [
|
||||
{ label: "Type", text: payload.object },
|
||||
{ label: payload.object === "bank_account" ? "Bank Account ID" : "Card ID", text: payload.id },
|
||||
],
|
||||
};
|
||||
|
||||
export const onExternalAccountCreated: EventSpecification<OnExternalAccountEvent> = {
|
||||
name: "account.external_account.created",
|
||||
title: "On External Account Created",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [],
|
||||
parsePayload: (payload) => payload as OnExternalAccountEvent,
|
||||
runProperties: (payload) => [
|
||||
{ label: "Type", text: payload.object },
|
||||
{ label: payload.object === "bank_account" ? "Bank Account ID" : "Card ID", text: payload.id },
|
||||
],
|
||||
};
|
||||
|
||||
export const onExternalAccountDeleted: EventSpecification<OnExternalAccountEvent> = {
|
||||
name: "account.external_account.deleted",
|
||||
title: "On External Account Deleted",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [],
|
||||
parsePayload: (payload) => payload as OnExternalAccountEvent,
|
||||
runProperties: (payload) => [
|
||||
{ label: "Type", text: payload.object },
|
||||
{ label: payload.object === "bank_account" ? "Bank Account ID" : "Card ID", text: payload.id },
|
||||
],
|
||||
};
|
||||
|
||||
export const onExternalAccountUpdated: EventSpecification<OnExternalAccountEvent> = {
|
||||
name: "account.external_account.updated",
|
||||
title: "On External Account Updated",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [],
|
||||
parsePayload: (payload) => payload as OnExternalAccountEvent,
|
||||
runProperties: (payload) => [
|
||||
{ label: "Type", text: payload.object },
|
||||
{ label: payload.object === "bank_account" ? "Bank Account ID" : "Card ID", text: payload.id },
|
||||
],
|
||||
};
|
||||
|
||||
export const onPerson: EventSpecification<OnPersonEvent> = {
|
||||
name: ["person.created", "person.deleted", "person.updated"],
|
||||
title: "On Person Event",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [],
|
||||
parsePayload: (payload) => payload as OnPersonEvent,
|
||||
runProperties: (payload) => [
|
||||
{ label: "Person ID", text: payload.id },
|
||||
{ label: "Account", text: payload.account },
|
||||
],
|
||||
};
|
||||
|
||||
export const onPersonCreated: EventSpecification<OnPersonEvent> = {
|
||||
name: "person.created",
|
||||
title: "On Person Created",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [],
|
||||
parsePayload: (payload) => payload as OnPersonEvent,
|
||||
runProperties: (payload) => [
|
||||
{ label: "Person ID", text: payload.id },
|
||||
{ label: "Account", text: payload.account },
|
||||
],
|
||||
};
|
||||
|
||||
export const onPersonDeleted: EventSpecification<OnPersonEvent> = {
|
||||
name: "person.deleted",
|
||||
title: "On Person Deleted",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [],
|
||||
parsePayload: (payload) => payload as OnPersonEvent,
|
||||
runProperties: (payload) => [
|
||||
{ label: "Person ID", text: payload.id },
|
||||
{ label: "Account", text: payload.account },
|
||||
],
|
||||
};
|
||||
|
||||
export const onPersonUpdated: EventSpecification<OnPersonEvent> = {
|
||||
name: "person.updated",
|
||||
title: "On Person Updated",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [],
|
||||
parsePayload: (payload) => payload as OnPersonEvent,
|
||||
runProperties: (payload) => [
|
||||
{ label: "Person ID", text: payload.id },
|
||||
{ label: "Account", text: payload.account },
|
||||
],
|
||||
};
|
||||
|
||||
export const onPaymentIntent: EventSpecification<OnPaymentIntentEvent> = {
|
||||
name: [
|
||||
"payment_intent.created",
|
||||
"payment_intent.succeeded",
|
||||
"payment_intent.canceled",
|
||||
"payment_intent.processing",
|
||||
"payment_intent.requires_action",
|
||||
"payment_intent.amount_capturable_updated",
|
||||
"payment_intent.payment_failed",
|
||||
"payment_intent.partially_funded",
|
||||
],
|
||||
title: "On Payment Intent Event",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [
|
||||
createdPaymentIntentExample,
|
||||
succeededPaymentIntentExample,
|
||||
cancelledPaymentIntentExample,
|
||||
amountCapturablePaymentIntentExample,
|
||||
failedPaymentIntentExample,
|
||||
],
|
||||
parsePayload: (payload) => payload as OnPaymentIntentEvent,
|
||||
runProperties: (payload) => [{ label: "Payment Intent ID", text: payload.id }],
|
||||
};
|
||||
|
||||
export const onPaymentIntentCreated: EventSpecification<OnPaymentIntentEvent> = {
|
||||
name: "payment_intent.created",
|
||||
title: "On Payment Intent Created",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [createdPaymentIntentExample],
|
||||
parsePayload: (payload) => payload as OnPaymentIntentEvent,
|
||||
runProperties: (payload) => [{ label: "Payment Intent ID", text: payload.id }],
|
||||
};
|
||||
|
||||
export const onPaymentIntentSucceeded: EventSpecification<OnPaymentIntentEvent> = {
|
||||
name: "payment_intent.succeeded",
|
||||
title: "On Payment Intent Succeeded",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [succeededPaymentIntentExample],
|
||||
parsePayload: (payload) => payload as OnPaymentIntentEvent,
|
||||
runProperties: (payload) => [{ label: "Payment Intent ID", text: payload.id }],
|
||||
};
|
||||
|
||||
export const onPaymentIntentCanceled: EventSpecification<OnPaymentIntentEvent> = {
|
||||
name: "payment_intent.canceled",
|
||||
title: "On Payment Intent Canceled",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [cancelledPaymentIntentExample],
|
||||
parsePayload: (payload) => payload as OnPaymentIntentEvent,
|
||||
runProperties: (payload) => [{ label: "Payment Intent ID", text: payload.id }],
|
||||
};
|
||||
|
||||
export const onPaymentIntentProcessing: EventSpecification<OnPaymentIntentEvent> = {
|
||||
name: "payment_intent.processing",
|
||||
title: "On Payment Intent Processing",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [],
|
||||
parsePayload: (payload) => payload as OnPaymentIntentEvent,
|
||||
runProperties: (payload) => [{ label: "Payment Intent ID", text: payload.id }],
|
||||
};
|
||||
|
||||
export const onPaymentIntentRequiresAction: EventSpecification<OnPaymentIntentEvent> = {
|
||||
name: "payment_intent.requires_action",
|
||||
title: "On Payment Intent Requires Action",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [],
|
||||
parsePayload: (payload) => payload as OnPaymentIntentEvent,
|
||||
runProperties: (payload) => [{ label: "Payment Intent ID", text: payload.id }],
|
||||
};
|
||||
|
||||
export const onPaymentIntentAmountCapturableUpdated: EventSpecification<OnPaymentIntentEvent> = {
|
||||
name: "payment_intent.amount_capturable_updated",
|
||||
title: "On Payment Intent Amount Capturable Updated",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [amountCapturablePaymentIntentExample],
|
||||
parsePayload: (payload) => payload as OnPaymentIntentEvent,
|
||||
runProperties: (payload) => [{ label: "Payment Intent ID", text: payload.id }],
|
||||
};
|
||||
|
||||
export const onPaymentIntentPaymentFailed: EventSpecification<OnPaymentIntentEvent> = {
|
||||
name: "payment_intent.payment_failed",
|
||||
title: "On Payment Intent Payment Failed",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [failedPaymentIntentExample],
|
||||
parsePayload: (payload) => payload as OnPaymentIntentEvent,
|
||||
runProperties: (payload) => [{ label: "Payment Intent ID", text: payload.id }],
|
||||
};
|
||||
|
||||
export const onPaymentIntentPartiallyFunded: EventSpecification<OnPaymentIntentEvent> = {
|
||||
name: "payment_intent.partially_funded",
|
||||
title: "On Payment Intent Partially Funded",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [],
|
||||
parsePayload: (payload) => payload as OnPaymentIntentEvent,
|
||||
runProperties: (payload) => [{ label: "Payment Intent ID", text: payload.id }],
|
||||
};
|
||||
|
||||
export const onPayout: EventSpecification<OnPayoutEvent> = {
|
||||
name: [
|
||||
"payout.canceled",
|
||||
"payout.created",
|
||||
"payout.failed",
|
||||
"payout.paid",
|
||||
"payout.reconciliation_completed",
|
||||
"payout.updated",
|
||||
],
|
||||
title: "On Payout Event",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [],
|
||||
parsePayload: (payload) => payload as OnPayoutEvent,
|
||||
runProperties: (payload) => [
|
||||
{ label: "Payout ID", text: payload.id },
|
||||
{ label: "Amount", text: `${payload.amount} ${payload.currency}` },
|
||||
],
|
||||
};
|
||||
|
||||
export const onPayoutCancelled: EventSpecification<OnPayoutEvent> = {
|
||||
name: "payout.canceled",
|
||||
title: "On Payout Cancelled Event",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [],
|
||||
parsePayload: (payload) => payload as OnPayoutEvent,
|
||||
runProperties: (payload) => [
|
||||
{ label: "Payout ID", text: payload.id },
|
||||
{ label: "Amount", text: `${payload.amount} ${payload.currency}` },
|
||||
],
|
||||
};
|
||||
|
||||
export const onPayoutCreated: EventSpecification<OnPayoutEvent> = {
|
||||
name: "payout.created",
|
||||
title: "On Payout Created Event",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [],
|
||||
parsePayload: (payload) => payload as OnPayoutEvent,
|
||||
runProperties: (payload) => [
|
||||
{ label: "Payout ID", text: payload.id },
|
||||
{ label: "Amount", text: `${payload.amount} ${payload.currency}` },
|
||||
],
|
||||
};
|
||||
|
||||
export const onPayoutFailed: EventSpecification<OnPayoutEvent> = {
|
||||
name: "payout.failed",
|
||||
title: "On Payout Failed Event",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [],
|
||||
parsePayload: (payload) => payload as OnPayoutEvent,
|
||||
runProperties: (payload) => [
|
||||
{ label: "Payout ID", text: payload.id },
|
||||
{ label: "Amount", text: `${payload.amount} ${payload.currency}` },
|
||||
],
|
||||
};
|
||||
|
||||
export const onPayoutPaid: EventSpecification<OnPayoutEvent> = {
|
||||
name: "payout.paid",
|
||||
title: "On Payout Paid Event",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [],
|
||||
parsePayload: (payload) => payload as OnPayoutEvent,
|
||||
runProperties: (payload) => [
|
||||
{ label: "Payout ID", text: payload.id },
|
||||
{ label: "Amount", text: `${payload.amount} ${payload.currency}` },
|
||||
],
|
||||
};
|
||||
|
||||
export const onPayoutReconciliationCompleted: EventSpecification<OnPayoutEvent> = {
|
||||
name: "payout.reconciliation_completed",
|
||||
title: "On Payout Reconciliation Completed Event",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [],
|
||||
parsePayload: (payload) => payload as OnPayoutEvent,
|
||||
runProperties: (payload) => [
|
||||
{ label: "Payout ID", text: payload.id },
|
||||
{ label: "Amount", text: `${payload.amount} ${payload.currency}` },
|
||||
],
|
||||
};
|
||||
|
||||
export const onPayoutUpdated: EventSpecification<OnPayoutEvent> = {
|
||||
name: "payout.updated",
|
||||
title: "On Payout Updated Event",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [],
|
||||
parsePayload: (payload) => payload as OnPayoutEvent,
|
||||
runProperties: (payload) => [
|
||||
{ label: "Payout ID", text: payload.id },
|
||||
{ label: "Amount", text: `${payload.amount} ${payload.currency}` },
|
||||
],
|
||||
};
|
||||
|
||||
@@ -698,3 +698,932 @@ export const updatedSubscriptionExample = {
|
||||
trial_start: null,
|
||||
},
|
||||
};
|
||||
|
||||
export const updatedAccountExample = {
|
||||
id: "test_account",
|
||||
name: "Updated Account",
|
||||
icon: "stripe",
|
||||
payload: {
|
||||
id: "acct_1Nk2DXINGsstqbEy",
|
||||
object: "account",
|
||||
business_profile: {
|
||||
mcc: null,
|
||||
name: null,
|
||||
support_address: null,
|
||||
support_email: null,
|
||||
support_phone: null,
|
||||
support_url: null,
|
||||
url: null,
|
||||
product_description: null,
|
||||
},
|
||||
capabilities: {},
|
||||
charges_enabled: false,
|
||||
controller: {
|
||||
type: "application",
|
||||
is_controller: true,
|
||||
},
|
||||
country: "GB",
|
||||
default_currency: "gbp",
|
||||
details_submitted: false,
|
||||
email: null,
|
||||
payouts_enabled: false,
|
||||
settings: {
|
||||
bacs_debit_payments: {},
|
||||
branding: {
|
||||
icon: null,
|
||||
logo: null,
|
||||
primary_color: null,
|
||||
secondary_color: null,
|
||||
},
|
||||
card_issuing: {
|
||||
tos_acceptance: {
|
||||
date: null,
|
||||
ip: null,
|
||||
},
|
||||
},
|
||||
card_payments: {
|
||||
statement_descriptor_prefix: null,
|
||||
statement_descriptor_prefix_kanji: null,
|
||||
statement_descriptor_prefix_kana: null,
|
||||
decline_on: {
|
||||
avs_failure: false,
|
||||
cvc_failure: false,
|
||||
},
|
||||
},
|
||||
dashboard: {
|
||||
display_name: null,
|
||||
timezone: "Etc/UTC",
|
||||
},
|
||||
payments: {
|
||||
statement_descriptor: null,
|
||||
statement_descriptor_kana: null,
|
||||
statement_descriptor_kanji: null,
|
||||
},
|
||||
sepa_debit_payments: {},
|
||||
payouts: {
|
||||
debit_negative_balances: true,
|
||||
schedule: {
|
||||
delay_days: 7,
|
||||
interval: "daily",
|
||||
},
|
||||
statement_descriptor: null,
|
||||
},
|
||||
},
|
||||
type: "standard",
|
||||
business_type: null,
|
||||
created: 1693216724,
|
||||
external_accounts: {
|
||||
object: "list",
|
||||
data: [],
|
||||
has_more: false,
|
||||
total_count: 0,
|
||||
url: "/v1/accounts/acct_1Nk2DXINGsstqbEy/external_accounts",
|
||||
},
|
||||
future_requirements: {
|
||||
alternatives: [],
|
||||
current_deadline: null,
|
||||
currently_due: [],
|
||||
disabled_reason: null,
|
||||
errors: [],
|
||||
eventually_due: [],
|
||||
past_due: [],
|
||||
pending_verification: [],
|
||||
},
|
||||
metadata: {
|
||||
foo: "bar",
|
||||
},
|
||||
requirements: {
|
||||
alternatives: [],
|
||||
current_deadline: null,
|
||||
currently_due: [
|
||||
"business_profile.product_description",
|
||||
"business_profile.support_phone",
|
||||
"business_profile.url",
|
||||
"external_account",
|
||||
"tos_acceptance.date",
|
||||
"tos_acceptance.ip",
|
||||
],
|
||||
disabled_reason: "requirements.past_due",
|
||||
errors: [],
|
||||
eventually_due: [
|
||||
"business_profile.product_description",
|
||||
"business_profile.support_phone",
|
||||
"business_profile.url",
|
||||
"external_account",
|
||||
"tos_acceptance.date",
|
||||
"tos_acceptance.ip",
|
||||
],
|
||||
past_due: ["external_account", "tos_acceptance.date", "tos_acceptance.ip"],
|
||||
pending_verification: [],
|
||||
},
|
||||
tos_acceptance: {
|
||||
date: null,
|
||||
ip: null,
|
||||
user_agent: null,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const createdCustomerExample = {
|
||||
id: "created_customer",
|
||||
name: "Created Customer",
|
||||
icon: "stripe",
|
||||
payload: {
|
||||
id: "cus_OX6SuD19Ej1AwM",
|
||||
object: "customer",
|
||||
address: null,
|
||||
balance: 0,
|
||||
created: 1693216865,
|
||||
currency: null,
|
||||
default_source: null,
|
||||
delinquent: false,
|
||||
description: "(created by Stripe CLI)",
|
||||
discount: null,
|
||||
email: null,
|
||||
invoice_prefix: "02F47541",
|
||||
invoice_settings: {
|
||||
custom_fields: null,
|
||||
default_payment_method: null,
|
||||
footer: null,
|
||||
rendering_options: null,
|
||||
},
|
||||
livemode: false,
|
||||
metadata: {},
|
||||
name: null,
|
||||
phone: null,
|
||||
preferred_locales: [],
|
||||
shipping: null,
|
||||
tax_exempt: "none",
|
||||
test_clock: null,
|
||||
},
|
||||
};
|
||||
|
||||
export const deletedCustomerExample = {
|
||||
id: "deleted_customer",
|
||||
name: "Deleted Customer",
|
||||
icon: "stripe",
|
||||
payload: {
|
||||
id: "cus_OX6UWArTxl2eGx",
|
||||
object: "customer",
|
||||
address: null,
|
||||
balance: 0,
|
||||
created: 1693216947,
|
||||
currency: null,
|
||||
default_source: null,
|
||||
delinquent: false,
|
||||
description: "(created by Stripe CLI)",
|
||||
discount: null,
|
||||
email: null,
|
||||
invoice_prefix: "2761E4C9",
|
||||
invoice_settings: {
|
||||
custom_fields: null,
|
||||
default_payment_method: null,
|
||||
footer: null,
|
||||
rendering_options: null,
|
||||
},
|
||||
livemode: false,
|
||||
metadata: {},
|
||||
name: null,
|
||||
phone: null,
|
||||
preferred_locales: [],
|
||||
shipping: null,
|
||||
tax_exempt: "none",
|
||||
test_clock: null,
|
||||
},
|
||||
};
|
||||
|
||||
export const capturedChargeExample = {
|
||||
id: "charge.captured",
|
||||
name: "charge.captured",
|
||||
icon: "stripe",
|
||||
payload: {
|
||||
id: "ch_3Nk2IZI0XSgju2ur1KjXKcEP",
|
||||
object: "charge",
|
||||
amount: 2000,
|
||||
amount_captured: 2000,
|
||||
amount_refunded: 0,
|
||||
application: null,
|
||||
application_fee: null,
|
||||
application_fee_amount: null,
|
||||
balance_transaction: "txn_3Nk2IZI0XSgju2ur1yBd2FPs",
|
||||
billing_details: {
|
||||
address: {
|
||||
city: null,
|
||||
country: null,
|
||||
line1: null,
|
||||
line2: null,
|
||||
postal_code: null,
|
||||
state: null,
|
||||
},
|
||||
email: null,
|
||||
name: null,
|
||||
phone: null,
|
||||
},
|
||||
calculated_statement_descriptor: "WWW.TRIGGER.DEV",
|
||||
captured: true,
|
||||
created: 1693217035,
|
||||
currency: "usd",
|
||||
customer: null,
|
||||
description: "(created by Stripe CLI)",
|
||||
destination: null,
|
||||
dispute: null,
|
||||
disputed: false,
|
||||
failure_balance_transaction: null,
|
||||
failure_code: null,
|
||||
failure_message: null,
|
||||
fraud_details: {},
|
||||
invoice: null,
|
||||
livemode: false,
|
||||
metadata: {},
|
||||
on_behalf_of: null,
|
||||
order: null,
|
||||
outcome: {
|
||||
network_status: "approved_by_network",
|
||||
reason: null,
|
||||
risk_level: "normal",
|
||||
risk_score: 23,
|
||||
seller_message: "Payment complete.",
|
||||
type: "authorized",
|
||||
},
|
||||
paid: true,
|
||||
payment_intent: "pi_3Nk2IZI0XSgju2ur1c5PRXzB",
|
||||
payment_method: "pm_1Nk2IZI0XSgju2urQoHr945x",
|
||||
payment_method_details: {
|
||||
card: {
|
||||
brand: "visa",
|
||||
checks: {
|
||||
address_line1_check: null,
|
||||
address_postal_code_check: null,
|
||||
cvc_check: null,
|
||||
},
|
||||
country: "US",
|
||||
exp_month: 8,
|
||||
exp_year: 2024,
|
||||
fingerprint: "w6qgKDLO5EbIJ5VZ",
|
||||
funding: "credit",
|
||||
installments: null,
|
||||
last4: "4242",
|
||||
mandate: null,
|
||||
network: "visa",
|
||||
network_token: {
|
||||
used: false,
|
||||
},
|
||||
three_d_secure: null,
|
||||
wallet: null,
|
||||
},
|
||||
type: "card",
|
||||
},
|
||||
receipt_email: null,
|
||||
receipt_number: null,
|
||||
receipt_url:
|
||||
"https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xTVJtRzRJMFhTZ2p1MnVyKI3isacGMgaiHlW3-3o6LBbtHkEOlE2XK3_d2h9msrs3bTJvZi8DcqHrvcQrwxPHm8rP3LA2i5wTqA7Y",
|
||||
refunded: false,
|
||||
review: null,
|
||||
shipping: null,
|
||||
source: null,
|
||||
source_transfer: null,
|
||||
statement_descriptor: null,
|
||||
statement_descriptor_suffix: null,
|
||||
status: "succeeded",
|
||||
transfer_data: null,
|
||||
transfer_group: null,
|
||||
},
|
||||
};
|
||||
|
||||
export const succeededChargeExample = {
|
||||
id: "charge.succeeded",
|
||||
name: "charge.succeeded",
|
||||
icon: "stripe",
|
||||
payload: {
|
||||
id: "ch_3Nk2MlI0XSgju2ur0Zcv519e",
|
||||
object: "charge",
|
||||
amount: 2000,
|
||||
amount_captured: 0,
|
||||
amount_refunded: 0,
|
||||
application: null,
|
||||
application_fee: null,
|
||||
application_fee_amount: null,
|
||||
balance_transaction: null,
|
||||
billing_details: {
|
||||
address: {
|
||||
city: null,
|
||||
country: null,
|
||||
line1: null,
|
||||
line2: null,
|
||||
postal_code: null,
|
||||
state: null,
|
||||
},
|
||||
email: null,
|
||||
name: null,
|
||||
phone: null,
|
||||
},
|
||||
calculated_statement_descriptor: "WWW.TRIGGER.DEV",
|
||||
captured: false,
|
||||
created: 1693217296,
|
||||
currency: "usd",
|
||||
customer: null,
|
||||
description: "(created by Stripe CLI)",
|
||||
destination: null,
|
||||
dispute: null,
|
||||
disputed: false,
|
||||
failure_balance_transaction: null,
|
||||
failure_code: null,
|
||||
failure_message: null,
|
||||
fraud_details: {},
|
||||
invoice: null,
|
||||
livemode: false,
|
||||
metadata: {},
|
||||
on_behalf_of: null,
|
||||
order: null,
|
||||
outcome: {
|
||||
network_status: "approved_by_network",
|
||||
reason: null,
|
||||
risk_level: "normal",
|
||||
risk_score: 3,
|
||||
seller_message: "Payment complete.",
|
||||
type: "authorized",
|
||||
},
|
||||
paid: true,
|
||||
payment_intent: "pi_3Nk2MlI0XSgju2ur0p8h6qIg",
|
||||
payment_method: "pm_1Nk2MlI0XSgju2urdy1jOUTb",
|
||||
payment_method_details: {
|
||||
card: {
|
||||
brand: "visa",
|
||||
checks: {
|
||||
address_line1_check: null,
|
||||
address_postal_code_check: null,
|
||||
cvc_check: null,
|
||||
},
|
||||
country: "US",
|
||||
exp_month: 8,
|
||||
exp_year: 2024,
|
||||
fingerprint: "w6qgKDLO5EbIJ5VZ",
|
||||
funding: "credit",
|
||||
installments: null,
|
||||
last4: "4242",
|
||||
mandate: null,
|
||||
network: "visa",
|
||||
network_token: {
|
||||
used: false,
|
||||
},
|
||||
three_d_secure: null,
|
||||
wallet: null,
|
||||
},
|
||||
type: "card",
|
||||
},
|
||||
receipt_email: null,
|
||||
receipt_number: null,
|
||||
receipt_url:
|
||||
"https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xTVJtRzRJMFhTZ2p1MnVyKJDksacGMgYAj-PAr_s6LBapIJAZx3QBJGs7up7CDkowPkzJbOD1CzDvmilNbsloUF9ovZ3sWPq6F5SN",
|
||||
refunded: false,
|
||||
review: null,
|
||||
shipping: null,
|
||||
source: null,
|
||||
source_transfer: null,
|
||||
statement_descriptor: null,
|
||||
statement_descriptor_suffix: null,
|
||||
status: "succeeded",
|
||||
transfer_data: null,
|
||||
transfer_group: null,
|
||||
},
|
||||
};
|
||||
|
||||
export const failedChargeExample = {
|
||||
id: "charge.failed",
|
||||
name: "charge.failed",
|
||||
icon: "stripe",
|
||||
payload: {
|
||||
id: "ch_3Nk2OVI0XSgju2ur09WGXz58",
|
||||
object: "charge",
|
||||
amount: 100,
|
||||
amount_captured: 0,
|
||||
amount_refunded: 0,
|
||||
application: null,
|
||||
application_fee: null,
|
||||
application_fee_amount: null,
|
||||
balance_transaction: null,
|
||||
billing_details: {
|
||||
address: {
|
||||
city: null,
|
||||
country: null,
|
||||
line1: null,
|
||||
line2: null,
|
||||
postal_code: null,
|
||||
state: null,
|
||||
},
|
||||
email: null,
|
||||
name: null,
|
||||
phone: null,
|
||||
},
|
||||
calculated_statement_descriptor: "WWW.TRIGGER.DEV",
|
||||
captured: false,
|
||||
created: 1693217403,
|
||||
currency: "usd",
|
||||
customer: null,
|
||||
description: "(created by Stripe CLI)",
|
||||
destination: null,
|
||||
dispute: null,
|
||||
disputed: false,
|
||||
failure_balance_transaction: null,
|
||||
failure_code: "card_declined",
|
||||
failure_message: "Your card was declined.",
|
||||
fraud_details: {},
|
||||
invoice: null,
|
||||
livemode: false,
|
||||
metadata: {},
|
||||
on_behalf_of: null,
|
||||
order: null,
|
||||
outcome: {
|
||||
network_status: "declined_by_network",
|
||||
reason: "generic_decline",
|
||||
risk_level: "normal",
|
||||
risk_score: 10,
|
||||
seller_message: "The bank did not return any further details with this decline.",
|
||||
type: "issuer_declined",
|
||||
},
|
||||
paid: false,
|
||||
payment_intent: "pi_3Nk2OVI0XSgju2ur0HYvM3Zu",
|
||||
payment_method: "pm_1Nk2OVI0XSgju2uri9io5fc0",
|
||||
payment_method_details: {
|
||||
card: {
|
||||
brand: "visa",
|
||||
checks: {
|
||||
address_line1_check: null,
|
||||
address_postal_code_check: null,
|
||||
cvc_check: null,
|
||||
},
|
||||
country: "US",
|
||||
exp_month: 8,
|
||||
exp_year: 2024,
|
||||
fingerprint: "LvNwBVtV2ETBNH8a",
|
||||
funding: "credit",
|
||||
installments: null,
|
||||
last4: "0002",
|
||||
mandate: null,
|
||||
network: "visa",
|
||||
network_token: {
|
||||
used: false,
|
||||
},
|
||||
three_d_secure: null,
|
||||
wallet: null,
|
||||
},
|
||||
type: "card",
|
||||
},
|
||||
receipt_email: null,
|
||||
receipt_number: null,
|
||||
receipt_url: null,
|
||||
refunded: false,
|
||||
review: null,
|
||||
shipping: null,
|
||||
source: null,
|
||||
source_transfer: null,
|
||||
statement_descriptor: null,
|
||||
statement_descriptor_suffix: null,
|
||||
status: "failed",
|
||||
transfer_data: null,
|
||||
transfer_group: null,
|
||||
},
|
||||
};
|
||||
|
||||
export const refundedChargeExample = {
|
||||
id: "charge.refunded",
|
||||
name: "charge.refunded",
|
||||
icon: "stripe",
|
||||
payload: {
|
||||
id: "ch_3Nk2PLI0XSgju2ur1DqK0bOn",
|
||||
object: "charge",
|
||||
amount: 100,
|
||||
amount_captured: 100,
|
||||
amount_refunded: 100,
|
||||
application: null,
|
||||
application_fee: null,
|
||||
application_fee_amount: null,
|
||||
balance_transaction: "txn_3Nk2PLI0XSgju2ur18SfGzBU",
|
||||
billing_details: {
|
||||
address: {
|
||||
city: null,
|
||||
country: null,
|
||||
line1: null,
|
||||
line2: null,
|
||||
postal_code: null,
|
||||
state: null,
|
||||
},
|
||||
email: null,
|
||||
name: null,
|
||||
phone: null,
|
||||
},
|
||||
calculated_statement_descriptor: "WWW.TRIGGER.DEV",
|
||||
captured: true,
|
||||
created: 1693217456,
|
||||
currency: "usd",
|
||||
customer: null,
|
||||
description: "(created by Stripe CLI)",
|
||||
destination: null,
|
||||
dispute: null,
|
||||
disputed: false,
|
||||
failure_balance_transaction: null,
|
||||
failure_code: null,
|
||||
failure_message: null,
|
||||
fraud_details: {},
|
||||
invoice: null,
|
||||
livemode: false,
|
||||
metadata: {},
|
||||
on_behalf_of: null,
|
||||
order: null,
|
||||
outcome: {
|
||||
network_status: "approved_by_network",
|
||||
reason: null,
|
||||
risk_level: "normal",
|
||||
risk_score: 50,
|
||||
seller_message: "Payment complete.",
|
||||
type: "authorized",
|
||||
},
|
||||
paid: true,
|
||||
payment_intent: "pi_3Nk2PLI0XSgju2ur1yLml2Ev",
|
||||
payment_method: "pm_1Nk2PLI0XSgju2urkxIUAHNK",
|
||||
payment_method_details: {
|
||||
card: {
|
||||
brand: "visa",
|
||||
checks: {
|
||||
address_line1_check: null,
|
||||
address_postal_code_check: null,
|
||||
cvc_check: null,
|
||||
},
|
||||
country: "US",
|
||||
exp_month: 8,
|
||||
exp_year: 2024,
|
||||
fingerprint: "w6qgKDLO5EbIJ5VZ",
|
||||
funding: "credit",
|
||||
installments: null,
|
||||
last4: "4242",
|
||||
mandate: null,
|
||||
network: "visa",
|
||||
network_token: {
|
||||
used: false,
|
||||
},
|
||||
three_d_secure: null,
|
||||
wallet: null,
|
||||
},
|
||||
type: "card",
|
||||
},
|
||||
receipt_email: null,
|
||||
receipt_number: null,
|
||||
receipt_url:
|
||||
"https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xTVJtRzRJMFhTZ2p1MnVyKLLlsacGMgbTw8sUtqQ6LBZlhILTcNiKqiXYypfyG6CAcLzUmgE7d6GU9FnnRWNQy6-jhF7lW9GCj7qY",
|
||||
refunded: true,
|
||||
review: null,
|
||||
shipping: null,
|
||||
source: null,
|
||||
source_transfer: null,
|
||||
statement_descriptor: null,
|
||||
statement_descriptor_suffix: null,
|
||||
status: "succeeded",
|
||||
transfer_data: null,
|
||||
transfer_group: null,
|
||||
},
|
||||
};
|
||||
|
||||
export const createdPaymentIntentExample = {
|
||||
id: "payment_intent.created",
|
||||
name: "payment_intent.created",
|
||||
icon: "stripe",
|
||||
payload: {
|
||||
id: "pi_3Nk2yoI0XSgju2ur14qyhbN6",
|
||||
object: "payment_intent",
|
||||
amount: 2000,
|
||||
amount_capturable: 0,
|
||||
amount_details: {
|
||||
tip: {},
|
||||
},
|
||||
amount_received: 0,
|
||||
application: null,
|
||||
application_fee_amount: null,
|
||||
automatic_payment_methods: null,
|
||||
canceled_at: null,
|
||||
cancellation_reason: null,
|
||||
capture_method: "automatic",
|
||||
client_secret: "pi_3Nk2yoI0XSgju2ur14qyhbN6_secret_gBSFGokLjHKfG8f5FeVYggBls",
|
||||
confirmation_method: "automatic",
|
||||
created: 1693219654,
|
||||
currency: "usd",
|
||||
customer: null,
|
||||
description: "(created by Stripe CLI)",
|
||||
invoice: null,
|
||||
last_payment_error: null,
|
||||
latest_charge: null,
|
||||
livemode: false,
|
||||
metadata: {},
|
||||
next_action: null,
|
||||
on_behalf_of: null,
|
||||
payment_method: null,
|
||||
payment_method_options: {
|
||||
card: {
|
||||
installments: null,
|
||||
mandate_options: null,
|
||||
network: null,
|
||||
request_three_d_secure: "automatic",
|
||||
},
|
||||
},
|
||||
payment_method_types: ["card"],
|
||||
processing: null,
|
||||
receipt_email: null,
|
||||
review: null,
|
||||
setup_future_usage: null,
|
||||
shipping: null,
|
||||
source: null,
|
||||
statement_descriptor: null,
|
||||
statement_descriptor_suffix: null,
|
||||
status: "requires_payment_method",
|
||||
transfer_data: null,
|
||||
transfer_group: null,
|
||||
},
|
||||
};
|
||||
|
||||
export const succeededPaymentIntentExample = {
|
||||
id: "payment_intent.succeeded",
|
||||
name: "payment_intent.succeeded",
|
||||
icon: "stripe",
|
||||
payload: {
|
||||
id: "pi_3Nk30FI0XSgju2ur1OohIT9i",
|
||||
object: "payment_intent",
|
||||
amount: 2000,
|
||||
amount_capturable: 0,
|
||||
amount_details: {
|
||||
tip: {},
|
||||
},
|
||||
amount_received: 2000,
|
||||
application: null,
|
||||
application_fee_amount: null,
|
||||
automatic_payment_methods: null,
|
||||
canceled_at: null,
|
||||
cancellation_reason: null,
|
||||
capture_method: "automatic",
|
||||
client_secret: "pi_3Nk30FI0XSgju2ur1OohIT9i_secret_VPcrQS7qSyPZ4GL7BfQRA1X2y",
|
||||
confirmation_method: "automatic",
|
||||
created: 1693219743,
|
||||
currency: "usd",
|
||||
customer: null,
|
||||
description: "(created by Stripe CLI)",
|
||||
invoice: null,
|
||||
last_payment_error: null,
|
||||
latest_charge: "ch_3Nk30FI0XSgju2ur150Nf8Jf",
|
||||
livemode: false,
|
||||
metadata: {},
|
||||
next_action: null,
|
||||
on_behalf_of: null,
|
||||
payment_method: "pm_1Nk30FI0XSgju2urEXQYKJsw",
|
||||
payment_method_options: {
|
||||
card: {
|
||||
installments: null,
|
||||
mandate_options: null,
|
||||
network: null,
|
||||
request_three_d_secure: "automatic",
|
||||
},
|
||||
},
|
||||
payment_method_types: ["card"],
|
||||
processing: null,
|
||||
receipt_email: null,
|
||||
review: null,
|
||||
setup_future_usage: null,
|
||||
shipping: {
|
||||
address: {
|
||||
city: "San Francisco",
|
||||
country: "US",
|
||||
line1: "510 Townsend St",
|
||||
line2: null,
|
||||
postal_code: "94103",
|
||||
state: "CA",
|
||||
},
|
||||
carrier: null,
|
||||
name: "Jenny Rosen",
|
||||
phone: null,
|
||||
tracking_number: null,
|
||||
},
|
||||
source: null,
|
||||
statement_descriptor: null,
|
||||
statement_descriptor_suffix: null,
|
||||
status: "succeeded",
|
||||
transfer_data: null,
|
||||
transfer_group: null,
|
||||
},
|
||||
};
|
||||
|
||||
export const cancelledPaymentIntentExample = {
|
||||
id: "payment_intent.canceled",
|
||||
name: "payment_intent.canceled",
|
||||
icon: "stripe",
|
||||
payload: {
|
||||
id: "pi_3Nk316I0XSgju2ur0WYHIexr",
|
||||
object: "payment_intent",
|
||||
amount: 2000,
|
||||
amount_capturable: 0,
|
||||
amount_details: {
|
||||
tip: {},
|
||||
},
|
||||
amount_received: 0,
|
||||
application: null,
|
||||
application_fee_amount: null,
|
||||
automatic_payment_methods: null,
|
||||
canceled_at: 1693219796,
|
||||
cancellation_reason: "requested_by_customer",
|
||||
capture_method: "automatic",
|
||||
client_secret: "pi_3Nk316I0XSgju2ur0WYHIexr_secret_NWXEzMmLe3IXZIW0HahXUXo9w",
|
||||
confirmation_method: "automatic",
|
||||
created: 1693219796,
|
||||
currency: "usd",
|
||||
customer: null,
|
||||
description: "(created by Stripe CLI)",
|
||||
invoice: null,
|
||||
last_payment_error: null,
|
||||
latest_charge: null,
|
||||
livemode: false,
|
||||
metadata: {},
|
||||
next_action: null,
|
||||
on_behalf_of: null,
|
||||
payment_method: null,
|
||||
payment_method_options: {
|
||||
card: {
|
||||
installments: null,
|
||||
mandate_options: null,
|
||||
network: null,
|
||||
request_three_d_secure: "automatic",
|
||||
},
|
||||
},
|
||||
payment_method_types: ["card"],
|
||||
processing: null,
|
||||
receipt_email: null,
|
||||
review: null,
|
||||
setup_future_usage: null,
|
||||
shipping: null,
|
||||
source: null,
|
||||
statement_descriptor: null,
|
||||
statement_descriptor_suffix: null,
|
||||
status: "canceled",
|
||||
transfer_data: null,
|
||||
transfer_group: null,
|
||||
},
|
||||
};
|
||||
|
||||
export const amountCapturablePaymentIntentExample = {
|
||||
id: "payment_intent.amount_capturable_updated",
|
||||
name: "payment_intent.amount_capturable_updated",
|
||||
icon: "stripe",
|
||||
payload: {
|
||||
id: "pi_3Nk32UI0XSgju2ur0mIrhcYD",
|
||||
object: "payment_intent",
|
||||
amount: 2000,
|
||||
amount_capturable: 2000,
|
||||
amount_details: {
|
||||
tip: {},
|
||||
},
|
||||
amount_received: 0,
|
||||
application: null,
|
||||
application_fee_amount: null,
|
||||
automatic_payment_methods: null,
|
||||
canceled_at: null,
|
||||
cancellation_reason: null,
|
||||
capture_method: "manual",
|
||||
client_secret: "pi_3Nk32UI0XSgju2ur0mIrhcYD_secret_JyfSHNompZV9sipG3wBgfWf1s",
|
||||
confirmation_method: "manual",
|
||||
created: 1693219882,
|
||||
currency: "usd",
|
||||
customer: null,
|
||||
description: "(created by Stripe CLI)",
|
||||
invoice: null,
|
||||
last_payment_error: null,
|
||||
latest_charge: "ch_3Nk32UI0XSgju2ur0k1SMSZ4",
|
||||
livemode: false,
|
||||
metadata: {},
|
||||
next_action: null,
|
||||
on_behalf_of: null,
|
||||
payment_method: "pm_1Nk32UI0XSgju2uriPepd9pr",
|
||||
payment_method_options: {
|
||||
card: {
|
||||
installments: null,
|
||||
mandate_options: null,
|
||||
network: null,
|
||||
request_three_d_secure: "automatic",
|
||||
},
|
||||
},
|
||||
payment_method_types: ["card"],
|
||||
processing: null,
|
||||
receipt_email: null,
|
||||
review: null,
|
||||
setup_future_usage: null,
|
||||
shipping: null,
|
||||
source: null,
|
||||
statement_descriptor: null,
|
||||
statement_descriptor_suffix: null,
|
||||
status: "requires_capture",
|
||||
transfer_data: null,
|
||||
transfer_group: null,
|
||||
},
|
||||
};
|
||||
|
||||
export const failedPaymentIntentExample = {
|
||||
id: "payment_intent.payment_failed",
|
||||
name: "payment_intent.payment_failed",
|
||||
icon: "stripe",
|
||||
payload: {
|
||||
id: "pi_3Nk341I0XSgju2ur1ckiktWk",
|
||||
object: "payment_intent",
|
||||
amount: 2000,
|
||||
amount_capturable: 0,
|
||||
amount_details: {
|
||||
tip: {},
|
||||
},
|
||||
amount_received: 0,
|
||||
application: null,
|
||||
application_fee_amount: null,
|
||||
automatic_payment_methods: null,
|
||||
canceled_at: null,
|
||||
cancellation_reason: null,
|
||||
capture_method: "automatic",
|
||||
client_secret: "pi_3Nk341I0XSgju2ur1ckiktWk_secret_3Km19PEIXajFEZRi9qi2VU2d3",
|
||||
confirmation_method: "automatic",
|
||||
created: 1693219977,
|
||||
currency: "usd",
|
||||
customer: null,
|
||||
description: "(created by Stripe CLI)",
|
||||
invoice: null,
|
||||
last_payment_error: {
|
||||
charge: "ch_3Nk341I0XSgju2ur1UZC5yvb",
|
||||
code: "card_declined",
|
||||
decline_code: "generic_decline",
|
||||
doc_url: "https://stripe.com/docs/error-codes/card-declined",
|
||||
message: "Your card was declined.",
|
||||
payment_method: {
|
||||
id: "pm_1Nk341I0XSgju2uraNBls6mm",
|
||||
object: "payment_method",
|
||||
billing_details: {
|
||||
address: {
|
||||
city: null,
|
||||
country: null,
|
||||
line1: null,
|
||||
line2: null,
|
||||
postal_code: null,
|
||||
state: null,
|
||||
},
|
||||
email: null,
|
||||
name: null,
|
||||
phone: null,
|
||||
},
|
||||
card: {
|
||||
brand: "visa",
|
||||
checks: {
|
||||
address_line1_check: null,
|
||||
address_postal_code_check: null,
|
||||
cvc_check: null,
|
||||
},
|
||||
country: "US",
|
||||
exp_month: 8,
|
||||
exp_year: 2024,
|
||||
fingerprint: "LvNwBVtV2ETBNH8a",
|
||||
funding: "credit",
|
||||
generated_from: null,
|
||||
last4: "0002",
|
||||
networks: {
|
||||
available: ["visa"],
|
||||
preferred: null,
|
||||
},
|
||||
three_d_secure_usage: {
|
||||
supported: true,
|
||||
},
|
||||
wallet: null,
|
||||
},
|
||||
created: 1693219977,
|
||||
customer: null,
|
||||
livemode: false,
|
||||
metadata: {},
|
||||
type: "card",
|
||||
},
|
||||
type: "card_error",
|
||||
},
|
||||
latest_charge: "ch_3Nk341I0XSgju2ur1UZC5yvb",
|
||||
livemode: false,
|
||||
metadata: {},
|
||||
next_action: null,
|
||||
on_behalf_of: null,
|
||||
payment_method: null,
|
||||
payment_method_options: {
|
||||
card: {
|
||||
installments: null,
|
||||
mandate_options: null,
|
||||
network: null,
|
||||
request_three_d_secure: "automatic",
|
||||
},
|
||||
},
|
||||
payment_method_types: ["card"],
|
||||
processing: null,
|
||||
receipt_email: null,
|
||||
review: null,
|
||||
setup_future_usage: null,
|
||||
shipping: null,
|
||||
source: null,
|
||||
statement_descriptor: null,
|
||||
statement_descriptor_suffix: null,
|
||||
status: "requires_payment_method",
|
||||
transfer_data: null,
|
||||
transfer_group: null,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -338,6 +338,501 @@ export class Stripe implements StripeIntegration {
|
||||
params ?? { connect: false }
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Occurs whenever an account status or property has changed.
|
||||
*/
|
||||
onAccountUpdated(params?: TriggerParams) {
|
||||
return createTrigger(this.source, events.onAccountUpdated, params ?? { connect: false });
|
||||
}
|
||||
|
||||
/**
|
||||
* Occurs on customer.created, customer.deleted, and customer.updated
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* stripe.onCustomer()
|
||||
* ```
|
||||
*
|
||||
* You can detect the event name in your job by using the `ctx.event.name` property:
|
||||
*
|
||||
* ```ts
|
||||
* client.defineJob({
|
||||
* id: "stripe-example",
|
||||
* name: "Stripe Example",
|
||||
* version: "0.1.0",
|
||||
* trigger: stripe.onCustomer(),
|
||||
* run: async (payload, io, ctx) => {
|
||||
* console.log(ctx.event.name); // "customer.created" or "customer.deleted"
|
||||
* },
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
onCustomer(
|
||||
params?: TriggerParams & {
|
||||
events?: Array<"customer.created" | "customer.deleted">;
|
||||
}
|
||||
) {
|
||||
const event = {
|
||||
...events.onCustomer,
|
||||
name: params?.events ?? events.onCustomer.name,
|
||||
};
|
||||
|
||||
return createTrigger(this.source, event, params ?? { connect: false });
|
||||
}
|
||||
|
||||
/**
|
||||
* Occurs whenever a new customer is created.
|
||||
*/
|
||||
onCustomerCreated(params?: TriggerParams) {
|
||||
return createTrigger(this.source, events.onCustomerCreated, params ?? { connect: false });
|
||||
}
|
||||
|
||||
/**
|
||||
* Occurs whenever a new customer is deleted.
|
||||
*/
|
||||
onCustomerDeleted(params?: TriggerParams) {
|
||||
return createTrigger(this.source, events.onCustomerDeleted, params ?? { connect: false });
|
||||
}
|
||||
|
||||
/**
|
||||
* Occurs whenever a new customer is updated.
|
||||
*/
|
||||
onCustomerUpdated(params?: TriggerParams) {
|
||||
return createTrigger(this.source, events.onCustomerUpdated, params ?? { connect: false });
|
||||
}
|
||||
|
||||
/**
|
||||
* Occurs on any charge.* event. Accepts an optional array of events to filter on. By default it will listen to all charge.* events.
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* stripe.onCharge({ events: ["charge.refunded", "charge.succeeded"] })
|
||||
* ```
|
||||
*
|
||||
* You can detect the event name in your job by using the `ctx.event.name` property:
|
||||
*
|
||||
* ```ts
|
||||
* client.defineJob({
|
||||
* id: "stripe-example",
|
||||
* name: "Stripe Example",
|
||||
* version: "0.1.0",
|
||||
* trigger: stripe.onCharge({ events: ["charge.refunded", "charge.succeeded"] }),
|
||||
* run: async (payload, io, ctx) => {
|
||||
* console.log(ctx.event.name); // "charge.refunded" or "charge.succeeded"
|
||||
* },
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
onCharge(
|
||||
params?: TriggerParams & {
|
||||
events?: Array<
|
||||
| "charge.captured"
|
||||
| "charge.expired"
|
||||
| "charge.failed"
|
||||
| "charge.pending"
|
||||
| "charge.refunded"
|
||||
| "charge.succeeded"
|
||||
| "charge.updated"
|
||||
>;
|
||||
}
|
||||
) {
|
||||
const event = {
|
||||
...events.onCharge,
|
||||
name: params?.events ?? events.onCharge.name,
|
||||
};
|
||||
|
||||
return createTrigger(this.source, event, params ?? { connect: false });
|
||||
}
|
||||
|
||||
/**
|
||||
* Occurs whenever a previously uncaptured charge is captured
|
||||
*/
|
||||
onChargeCaptured(params?: TriggerParams) {
|
||||
return createTrigger(this.source, events.onChargeCaptured, params ?? { connect: false });
|
||||
}
|
||||
|
||||
/**
|
||||
* Occurs whenever an uncaptured charge expires.
|
||||
*/
|
||||
onChargeExpired(params?: TriggerParams) {
|
||||
return createTrigger(this.source, events.onChargeExpired, params ?? { connect: false });
|
||||
}
|
||||
|
||||
/**
|
||||
* Occurs whenever a failed charge attempt occurs
|
||||
*/
|
||||
onChargeFailed(params?: TriggerParams) {
|
||||
return createTrigger(this.source, events.onChargeFailed, params ?? { connect: false });
|
||||
}
|
||||
|
||||
/**
|
||||
* Occurs whenever a pending charge is created
|
||||
*/
|
||||
onChargePending(params?: TriggerParams) {
|
||||
return createTrigger(this.source, events.onChargePending, params ?? { connect: false });
|
||||
}
|
||||
|
||||
/**
|
||||
* Occurs whenever a charge is refunded, including partial refunds
|
||||
*/
|
||||
onChargeRefunded(params?: TriggerParams) {
|
||||
return createTrigger(this.source, events.onChargeRefunded, params ?? { connect: false });
|
||||
}
|
||||
|
||||
/**
|
||||
* Occurs whenever a charge is successful
|
||||
*/
|
||||
onChargeSucceeded(params?: TriggerParams) {
|
||||
return createTrigger(this.source, events.onChargeSucceeded, params ?? { connect: false });
|
||||
}
|
||||
|
||||
/**
|
||||
* Occurs whenever a charge description or metadata is updated, or upon an asynchronous capture
|
||||
*/
|
||||
onChargeUpdated(params?: TriggerParams) {
|
||||
return createTrigger(this.source, events.onChargeUpdated, params ?? { connect: false });
|
||||
}
|
||||
|
||||
/**
|
||||
* Occurs on any account.external_account.* event. Accepts an optional array of events to filter on. By default it will listen to all charge.* events.
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* stripe.onExternalAccount({ events: ["account.external_account.created", "account.external_account.deleted"] })
|
||||
* ```
|
||||
*
|
||||
* You can detect the event name in your job by using the `ctx.event.name` property:
|
||||
*
|
||||
* ```ts
|
||||
* client.defineJob({
|
||||
* id: "stripe-example",
|
||||
* name: "Stripe Example",
|
||||
* version: "0.1.0",
|
||||
* trigger: stripe.onExternalAccount({ events: ["account.external_account.created", "account.external_account.deleted"] }),
|
||||
* run: async (payload, io, ctx) => {
|
||||
* console.log(ctx.event.name); // "account.external_account.created" or "account.external_account.deleted"
|
||||
* },
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
onExternalAccount(
|
||||
params?: TriggerParams & {
|
||||
events?: Array<
|
||||
| "account.external_account.created"
|
||||
| "account.external_account.deleted"
|
||||
| "account.external_account.updated"
|
||||
>;
|
||||
}
|
||||
) {
|
||||
const event = {
|
||||
...events.onExternalAccount,
|
||||
name: params?.events ?? events.onExternalAccount.name,
|
||||
};
|
||||
|
||||
return createTrigger(this.source, event, params ?? { connect: false });
|
||||
}
|
||||
|
||||
/**
|
||||
* Occurs whenever an external account is created.
|
||||
* */
|
||||
onExternalAccountCreated(params?: TriggerParams) {
|
||||
return createTrigger(
|
||||
this.source,
|
||||
events.onExternalAccountCreated,
|
||||
params ?? { connect: false }
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Occurs whenever an external account is deleted.
|
||||
* */
|
||||
onExternalAccountDeleted(params?: TriggerParams) {
|
||||
return createTrigger(
|
||||
this.source,
|
||||
events.onExternalAccountDeleted,
|
||||
params ?? { connect: false }
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Occurs whenever an external account is updated.
|
||||
* */
|
||||
onExternalAccountUpdated(params?: TriggerParams) {
|
||||
return createTrigger(
|
||||
this.source,
|
||||
events.onExternalAccountUpdated,
|
||||
params ?? { connect: false }
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Occurs on any person.* event. Accepts an optional array of events to filter on. By default it will listen to all person.* events.
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* stripe.onPerson({ events: ["person.created", "person.deleted"] })
|
||||
* ```
|
||||
*
|
||||
* You can detect the event name in your job by using the `ctx.event.name` property:
|
||||
*
|
||||
* ```ts
|
||||
* client.defineJob({
|
||||
* id: "stripe-example",
|
||||
* name: "Stripe Example",
|
||||
* version: "0.1.0",
|
||||
* trigger: stripe.onPerson({ events: ["person.created", "person.deleted"] }),
|
||||
* run: async (payload, io, ctx) => {
|
||||
* console.log(ctx.event.name); // "person.created" or "person.deleted"
|
||||
* },
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
onPerson(
|
||||
params?: TriggerParams & {
|
||||
events?: Array<"person.created" | "person.deleted" | "person.updated">;
|
||||
}
|
||||
) {
|
||||
const event = {
|
||||
...events.onPerson,
|
||||
name: params?.events ?? events.onPerson.name,
|
||||
};
|
||||
|
||||
return createTrigger(this.source, event, params ?? { connect: false });
|
||||
}
|
||||
|
||||
/**
|
||||
* Occurs whenever a person associated with an account is created.
|
||||
* */
|
||||
onPersonCreated(params?: TriggerParams) {
|
||||
return createTrigger(this.source, events.onPersonCreated, params ?? { connect: false });
|
||||
}
|
||||
|
||||
/**
|
||||
* Occurs whenever a person associated with an account is deleted.
|
||||
* */
|
||||
onPersonDeleted(params?: TriggerParams) {
|
||||
return createTrigger(this.source, events.onPersonDeleted, params ?? { connect: false });
|
||||
}
|
||||
|
||||
/**
|
||||
* Occurs whenever a person associated with an account is updated.
|
||||
* */
|
||||
onPersonUpdated(params?: TriggerParams) {
|
||||
return createTrigger(this.source, events.onPersonUpdated, params ?? { connect: false });
|
||||
}
|
||||
|
||||
/**
|
||||
* Occurs on any payment_intent.* event. Accepts an optional array of events to filter on. By default it will listen to all payment_intent.* events.
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* stripe.onPaymentIntent({ events: ["payment_intent.created", "payment_intent.succeeded"] })
|
||||
* ```
|
||||
*
|
||||
* You can detect the event name in your job by using the `ctx.event.name` property:
|
||||
*
|
||||
* ```ts
|
||||
* client.defineJob({
|
||||
* id: "stripe-example",
|
||||
* name: "Stripe Example",
|
||||
* version: "0.1.0",
|
||||
* trigger: stripe.onPaymentIntent({ events: ["payment_intent.created", "payment_intent.succeeded"] }),
|
||||
* run: async (payload, io, ctx) => {
|
||||
* console.log(ctx.event.name); // "payment_intent.created" or "payment_intent.succeeded"
|
||||
* },
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
onPaymentIntent(
|
||||
params?: TriggerParams & {
|
||||
events?: Array<
|
||||
| "payment_intent.created"
|
||||
| "payment_intent.succeeded"
|
||||
| "payment_intent.canceled"
|
||||
| "payment_intent.processing"
|
||||
| "payment_intent.requires_action"
|
||||
| "payment_intent.amount_capturable_updated"
|
||||
| "payment_intent.payment_failed"
|
||||
| "payment_intent.partially_funded"
|
||||
>;
|
||||
}
|
||||
) {
|
||||
const event = {
|
||||
...events.onPaymentIntent,
|
||||
name: params?.events ?? events.onPaymentIntent.name,
|
||||
};
|
||||
|
||||
return createTrigger(this.source, event, params ?? { connect: false });
|
||||
}
|
||||
|
||||
/**
|
||||
* Occurs when a new PaymentIntent is created..
|
||||
* */
|
||||
onPaymentIntentCreated(params?: TriggerParams) {
|
||||
return createTrigger(this.source, events.onPaymentIntentCreated, params ?? { connect: false });
|
||||
}
|
||||
|
||||
/**
|
||||
* Occurs when a PaymentIntent has successfully completed payment.
|
||||
* */
|
||||
onPaymentIntentSucceeded(params?: TriggerParams) {
|
||||
return createTrigger(
|
||||
this.source,
|
||||
events.onPaymentIntentSucceeded,
|
||||
params ?? { connect: false }
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Occurs when a PaymentIntent is canceled.
|
||||
* */
|
||||
onPaymentIntentCancelled(params?: TriggerParams) {
|
||||
return createTrigger(this.source, events.onPaymentIntentCanceled, params ?? { connect: false });
|
||||
}
|
||||
|
||||
/**
|
||||
* Occurs when a PaymentIntent has started processing.
|
||||
* */
|
||||
onPaymentIntentProcessing(params?: TriggerParams) {
|
||||
return createTrigger(
|
||||
this.source,
|
||||
events.onPaymentIntentProcessing,
|
||||
params ?? { connect: false }
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Occurs when a PaymentIntent transitions to requires_action state
|
||||
* */
|
||||
onPaymentIntentRequiresAction(params?: TriggerParams) {
|
||||
return createTrigger(
|
||||
this.source,
|
||||
events.onPaymentIntentRequiresAction,
|
||||
params ?? { connect: false }
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Occurs when a PaymentIntent has funds to be captured. Check the amount_capturable property on the PaymentIntent to determine the amount that can be captured. You may capture the PaymentIntent with an amount_to_capture value up to the specified amount. [Learn more about capturing PaymentIntents](https://stripe.com/docs/api/payment_intents/capture)
|
||||
* */
|
||||
onPaymentIntentAmountCapturableUpdated(params?: TriggerParams) {
|
||||
return createTrigger(
|
||||
this.source,
|
||||
events.onPaymentIntentAmountCapturableUpdated,
|
||||
params ?? { connect: false }
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Occurs when a PaymentIntent has failed the attempt to create a payment method or a payment.
|
||||
* */
|
||||
onPaymentIntentPaymentFailed(params?: TriggerParams) {
|
||||
return createTrigger(
|
||||
this.source,
|
||||
events.onPaymentIntentPaymentFailed,
|
||||
params ?? { connect: false }
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Occurs when funds are applied to a customer_balance PaymentIntent and the ‘amount_remaining’ changes.
|
||||
* */
|
||||
onPaymentIntentPartiallyFunded(params?: TriggerParams) {
|
||||
return createTrigger(
|
||||
this.source,
|
||||
events.onPaymentIntentPartiallyFunded,
|
||||
params ?? { connect: false }
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Occurs on any payout.* event. Accepts an optional array of events to filter on. By default it will listen to all payout.* events.
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* stripe.onPayout({ events: ["payout.created", "payout.paid"] })
|
||||
* ```
|
||||
*
|
||||
* You can detect the event name in your job by using the `ctx.event.name` property:
|
||||
*
|
||||
* ```ts
|
||||
* client.defineJob({
|
||||
* id: "stripe-example",
|
||||
* name: "Stripe Example",
|
||||
* version: "0.1.0",
|
||||
* trigger: stripe.onPayout({ events: ["payout.created", "payout.paid"] }),
|
||||
* run: async (payload, io, ctx) => {
|
||||
* console.log(ctx.event.name); // "payout.created" or "payout.paid"
|
||||
* },
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
onPayout(
|
||||
params?: TriggerParams & {
|
||||
events?: Array<
|
||||
| "payout.canceled"
|
||||
| "payout.created"
|
||||
| "payout.failed"
|
||||
| "payout.paid"
|
||||
| "payout.reconciliation_completed"
|
||||
| "payout.updated"
|
||||
>;
|
||||
}
|
||||
) {
|
||||
const event = {
|
||||
...events.onPayout,
|
||||
name: params?.events ?? events.onPayout.name,
|
||||
};
|
||||
|
||||
return createTrigger(this.source, event, params ?? { connect: false });
|
||||
}
|
||||
|
||||
/**
|
||||
* Occurs whenever a payout is created.
|
||||
* */
|
||||
onPayoutCreated(params?: TriggerParams) {
|
||||
return createTrigger(this.source, events.onPayoutCreated, params ?? { connect: false });
|
||||
}
|
||||
|
||||
/**
|
||||
* Occurs whenever a payout is updated.
|
||||
* */
|
||||
onPayoutUpdated(params?: TriggerParams) {
|
||||
return createTrigger(this.source, events.onPayoutUpdated, params ?? { connect: false });
|
||||
}
|
||||
|
||||
/**
|
||||
* Occurs whenever a payout is canceled.
|
||||
* */
|
||||
onPayoutCanceled(params?: TriggerParams) {
|
||||
return createTrigger(this.source, events.onPayoutCancelled, params ?? { connect: false });
|
||||
}
|
||||
|
||||
/**
|
||||
* Occurs whenever a payout attempt fails.
|
||||
* */
|
||||
onPayoutFailed(params?: TriggerParams) {
|
||||
return createTrigger(this.source, events.onPayoutFailed, params ?? { connect: false });
|
||||
}
|
||||
|
||||
/**
|
||||
* Occurs whenever a payout is expected to be available in the destination account. If the payout fails, a `payout.failed` notification is also sent, at a later time.
|
||||
* */
|
||||
onPayoutPaid(params?: TriggerParams) {
|
||||
return createTrigger(this.source, events.onPayoutPaid, params ?? { connect: false });
|
||||
}
|
||||
|
||||
/**
|
||||
* Occurs whenever balance transactions paid out in an automatic payout can be queried.
|
||||
* */
|
||||
onPayoutReconciliationCompleted(params?: TriggerParams) {
|
||||
return createTrigger(
|
||||
this.source,
|
||||
events.onPayoutReconciliationCompleted,
|
||||
params ?? { connect: false }
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export type TriggerParams = {
|
||||
|
||||
@@ -1,26 +1,30 @@
|
||||
import { AuthenticatedTask } from "@trigger.dev/sdk";
|
||||
import type {
|
||||
StripeSDK,
|
||||
CreateChargeParams,
|
||||
CreateChargeResponse,
|
||||
CreateCustomerResponse,
|
||||
CreateCustomerParams,
|
||||
UpdateCustomerParams,
|
||||
UpdateCustomerResponse,
|
||||
RetrieveSubscriptionParams,
|
||||
RetrieveSubscriptionResponse,
|
||||
CreateCheckoutSessionParams,
|
||||
CreateCheckoutSessionResponse,
|
||||
CreateCustomerParams,
|
||||
CreateCustomerResponse,
|
||||
CreateWebhookParams,
|
||||
CreateWebhookResponse,
|
||||
ListWebhooksParams,
|
||||
ListWebhooksResponse,
|
||||
RetrieveSubscriptionParams,
|
||||
RetrieveSubscriptionResponse,
|
||||
StripeSDK,
|
||||
UpdateCustomerParams,
|
||||
UpdateCustomerResponse,
|
||||
UpdateWebhookParams,
|
||||
UpdateWebhookResponse,
|
||||
ListWebhooksResponse,
|
||||
ListWebhooksParams,
|
||||
} from "./types";
|
||||
import { AuthenticatedTask } from "@trigger.dev/sdk";
|
||||
import { Stripe } from "stripe";
|
||||
import { omit } from "./utils";
|
||||
|
||||
/**
|
||||
* Use the [Payment Intents API](https://stripe.com/docs/api/payment_intents) to initiate a new payment instead
|
||||
* of using this method. Confirmation of the PaymentIntent creates the Charge
|
||||
* object used to request payment, so this method is limited to legacy integrations.
|
||||
*/
|
||||
export const createCharge: AuthenticatedTask<StripeSDK, CreateChargeParams, CreateChargeResponse> =
|
||||
{
|
||||
run: async (params, client, task) => {
|
||||
@@ -124,6 +128,11 @@ export const createCustomer: AuthenticatedTask<
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* Updates the specified customer by setting the values of the parameters passed. Any parameters not provided will be left unchanged. For example, if you pass the source parameter, that becomes the customer's active source (e.g., a card) to be used for all charges in the future. When you update a customer to a new valid card source by passing the source parameter: for each of the customer's current subscriptions, if the subscription bills automatically and is in the past_due state, then the latest open invoice for the subscription with automatic collection enabled will be retried. This retry will not count as an automatic retry, and will not affect the next regularly scheduled payment for the invoice. Changing the default_source for a customer will not trigger this behavior.
|
||||
*
|
||||
* This request accepts mostly the same arguments as the customer creation call.
|
||||
*/
|
||||
export const updateCustomer: AuthenticatedTask<
|
||||
StripeSDK,
|
||||
UpdateCustomerParams,
|
||||
@@ -171,6 +180,9 @@ export const updateCustomer: AuthenticatedTask<
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieves the subscription with the given ID.
|
||||
*/
|
||||
export const retrieveSubscription: AuthenticatedTask<
|
||||
StripeSDK,
|
||||
RetrieveSubscriptionParams,
|
||||
@@ -206,6 +218,9 @@ export const retrieveSubscription: AuthenticatedTask<
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates a Session object.
|
||||
*/
|
||||
export const createCheckoutSession: AuthenticatedTask<
|
||||
StripeSDK,
|
||||
CreateCheckoutSessionParams,
|
||||
|
||||
@@ -70,3 +70,19 @@ export type OnCheckoutSession =
|
||||
|
||||
export type OnCustomerSubscription =
|
||||
ExtractWebhookPayload<Stripe.DiscriminatedEvent.CustomerSubscriptionEvent>;
|
||||
|
||||
export type OnAccountEvent = ExtractWebhookPayload<Stripe.DiscriminatedEvent.AccountEvent>;
|
||||
|
||||
export type OnCustomerEvent = ExtractWebhookPayload<Stripe.DiscriminatedEvent.CustomerEvent>;
|
||||
|
||||
export type OnChargeEvent = ExtractWebhookPayload<Stripe.DiscriminatedEvent.ChargeEvent>;
|
||||
|
||||
export type OnExternalAccountEvent =
|
||||
ExtractWebhookPayload<Stripe.DiscriminatedEvent.AccountExternalAccountEvent>;
|
||||
|
||||
export type OnPersonEvent = ExtractWebhookPayload<Stripe.DiscriminatedEvent.PersonEvent>;
|
||||
|
||||
export type OnPaymentIntentEvent =
|
||||
ExtractWebhookPayload<Stripe.DiscriminatedEvent.PaymentIntentEvent>;
|
||||
|
||||
export type OnPayoutEvent = ExtractWebhookPayload<Stripe.DiscriminatedEvent.PayoutEvent>;
|
||||
|
||||
@@ -1,5 +1,28 @@
|
||||
# @trigger.dev/supabase
|
||||
|
||||
## 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@trigger.dev/supabase",
|
||||
"version": "2.0.11",
|
||||
"version": "2.0.14",
|
||||
"description": "Trigger.dev integration for @supabase/supabase-js",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
@@ -26,8 +26,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@supabase/supabase-js": "^2.26.0",
|
||||
"@trigger.dev/integration-kit": "workspace:^2.0.11",
|
||||
"@trigger.dev/sdk": "workspace:^2.0.11",
|
||||
"@trigger.dev/integration-kit": "workspace:^2.0.14",
|
||||
"@trigger.dev/sdk": "workspace:^2.0.14",
|
||||
"supabase-management-js": "^0.1.4",
|
||||
"zod": "3.21.4"
|
||||
},
|
||||
|
||||
@@ -1,5 +1,28 @@
|
||||
# @trigger.dev/typeform
|
||||
|
||||
## 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@trigger.dev/typeform",
|
||||
"version": "2.0.11",
|
||||
"version": "2.0.14",
|
||||
"description": "The official Typeform integration for Trigger.dev",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
@@ -26,8 +26,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@typeform/api-client": "^1.8.0",
|
||||
"@trigger.dev/sdk": "workspace:^2.0.11",
|
||||
"@trigger.dev/integration-kit": "workspace:^2.0.11",
|
||||
"@trigger.dev/sdk": "workspace:^2.0.14",
|
||||
"@trigger.dev/integration-kit": "workspace:^2.0.14",
|
||||
"zod": "3.21.4"
|
||||
},
|
||||
"engines": {
|
||||
|
||||
@@ -64,6 +64,7 @@
|
||||
"packageManager": "pnpm@7.18.1",
|
||||
"dependencies": {
|
||||
"@changesets/cli": "^2.26.0",
|
||||
"@remix-run/changelog-github": "^0.0.5",
|
||||
"node-fetch": "2.6.x"
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,25 @@
|
||||
# @trigger.dev/astro
|
||||
|
||||
## 2.0.14
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies:
|
||||
- `@trigger.dev/sdk@2.0.14`
|
||||
|
||||
## 2.0.13
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies:
|
||||
- `@trigger.dev/sdk@2.0.13`
|
||||
|
||||
## 2.0.12
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @trigger.dev/sdk@2.0.12
|
||||
|
||||
## 2.0.11
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@trigger.dev/astro",
|
||||
"description": "An Astro-native integration for Trigger.dev background jobs platform",
|
||||
"version": "2.0.11",
|
||||
"version": "2.0.14",
|
||||
"type": "module",
|
||||
"main": "main.js",
|
||||
"scripts": {},
|
||||
"peerDependencies": {
|
||||
"@trigger.dev/sdk": "workspace:^2.0.11",
|
||||
"@trigger.dev/sdk": "workspace:^2.0.14",
|
||||
"astro": "^2.10.7"
|
||||
},
|
||||
"engines": {
|
||||
|
||||
@@ -1,5 +1,17 @@
|
||||
# create-trigger
|
||||
|
||||
## 2.0.14
|
||||
|
||||
## 2.0.13
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- provided a fix to the CLI dev command tunnel not working if you are already running ngrok ([#407](https://github.com/triggerdotdev/trigger.dev/pull/407))
|
||||
- fix: init will no longer fail when outside of a git repo ([`3028b6ad`](https://github.com/triggerdotdev/trigger.dev/commit/3028b6ad9d693d2f1662c4338d44ac9d3bf0da3a))
|
||||
- feat: Checks for outdated packages when running the dev command with instructions on how to update ([#412](https://github.com/triggerdotdev/trigger.dev/pull/412))
|
||||
|
||||
## 2.0.12
|
||||
|
||||
## 2.0.11
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@trigger.dev/cli",
|
||||
"version": "2.0.11",
|
||||
"version": "2.0.14",
|
||||
"description": "The Trigger.dev CLI",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
|
||||
@@ -12,6 +12,8 @@ import { getTriggerApiDetails } from "../utils/getTriggerApiDetails";
|
||||
import { logger } from "../utils/logger";
|
||||
import { resolvePath } from "../utils/parseNameAndPath";
|
||||
import { TriggerApi } from "../utils/triggerApi";
|
||||
import { run as ncuRun } from 'npm-check-updates'
|
||||
import chalk from "chalk";
|
||||
|
||||
const asyncExecFile = util.promisify(childProcess.execFile);
|
||||
|
||||
@@ -45,6 +47,7 @@ export async function devCommand(path: string, anyOptions: any) {
|
||||
const options = result.data;
|
||||
|
||||
const resolvedPath = resolvePath(path);
|
||||
await checkForOutdatedPackages(resolvedPath)
|
||||
|
||||
// Read from package.json to get the endpointId
|
||||
const endpointId = await getEndpointIdFromPackageJson(resolvedPath, options);
|
||||
@@ -205,6 +208,36 @@ export async function devCommand(path: string, anyOptions: any) {
|
||||
throttle(refresh, throttleTimeMs);
|
||||
}
|
||||
|
||||
export async function checkForOutdatedPackages(path: string) {
|
||||
|
||||
const updates = await ncuRun({
|
||||
packageFile: `${path}/package.json`,
|
||||
filter: "/trigger.dev\/.+$/",
|
||||
upgrade: false,
|
||||
}) as {
|
||||
[key: string]: string;
|
||||
}
|
||||
|
||||
if (typeof updates === 'undefined' || Object.keys(updates).length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
const packageFile = await fs.readFile(`${path}/package.json`);
|
||||
const data = JSON.parse(Buffer.from(packageFile).toString('utf8'));
|
||||
const dependencies = data.dependencies;
|
||||
console.log(
|
||||
chalk.bgYellow('Updates available for trigger.dev packages')
|
||||
);
|
||||
console.log(
|
||||
chalk.bgBlue('Run npx @trigger.dev/cli@latest update')
|
||||
);
|
||||
|
||||
for (let dep in updates) {
|
||||
console.log(`${dep} ${dependencies[dep]} → ${updates[dep]}`);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export async function getEndpointIdFromPackageJson(path: string, options: DevCommandOptions) {
|
||||
if (options.clientId) {
|
||||
return options.clientId;
|
||||
@@ -258,6 +291,16 @@ async function createTunnel(port: number, spinner: Ora) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (
|
||||
typeof error.message === "string" &&
|
||||
error.message.includes("connect ECONNREFUSED 127.0.0.1:4041")
|
||||
) {
|
||||
spinner.fail(
|
||||
`Ngrok failed to create a tunnel for port ${port} because ngrok is already running`
|
||||
);
|
||||
return;
|
||||
}
|
||||
spinner.fail(`Ngrok failed to create a tunnel for port ${port}.\n${error.message}`);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -253,9 +253,19 @@ const resolveOptionsWithPrompts = async (
|
||||
// Detects if there are any uncommitted git changes at path
|
||||
async function detectGitChanges(path: string): Promise<boolean> {
|
||||
const git = simpleGit(path);
|
||||
const status = await git.status();
|
||||
|
||||
return status.files.length > 0;
|
||||
try {
|
||||
const isRepo = await git.checkIsRepo();
|
||||
|
||||
if (isRepo) {
|
||||
// Check if there are uncommitted changes
|
||||
const status = await git.status();
|
||||
return status.files.length > 0;
|
||||
}
|
||||
return false;
|
||||
} catch (error) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
async function detectTypescriptProject(path: string): Promise<boolean> {
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# internal-platform
|
||||
|
||||
## 2.0.14
|
||||
|
||||
## 2.0.13
|
||||
|
||||
## 2.0.12
|
||||
|
||||
## 2.0.11
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@trigger.dev/core",
|
||||
"version": "2.0.11",
|
||||
"version": "2.0.14",
|
||||
"description": "Core code used across the Trigger.dev SDK and platform",
|
||||
"license": "MIT",
|
||||
"main": "./dist/index.js",
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
# @trigger.dev/eslint-plugin
|
||||
|
||||
## 2.0.14
|
||||
|
||||
## 2.0.13
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Fixes #391, now handling jobs when using new Job instead of client.defineJob ([`3028b6ad`](https://github.com/triggerdotdev/trigger.dev/commit/3028b6ad9d693d2f1662c4338d44ac9d3bf0da3a))
|
||||
|
||||
## 2.0.12
|
||||
|
||||
## 2.0.11
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -49,10 +49,7 @@ module.exports = {
|
||||
return property.name;
|
||||
}
|
||||
|
||||
const groupExpressionsByTask = (ExpressionStatements, map = new Map()) => ExpressionStatements.reduce((acc, { expression }) => {
|
||||
const taskName = getTaskName(expression);
|
||||
const taskKey = getKey(expression);
|
||||
|
||||
const groupByTaskKeyAndName = (acc, { taskKey, taskName }) => {
|
||||
if (acc.has(taskName)) {
|
||||
acc.get(taskName).push(taskKey);
|
||||
} else {
|
||||
@@ -60,6 +57,13 @@ module.exports = {
|
||||
}
|
||||
|
||||
return acc;
|
||||
}
|
||||
|
||||
const groupExpressionsByTask = (ExpressionStatements, map = new Map()) => ExpressionStatements.reduce((acc, { expression }) => {
|
||||
const taskName = getTaskName(expression);
|
||||
const taskKey = getKey(expression);
|
||||
|
||||
return groupByTaskKeyAndName(acc, { taskKey, taskName });
|
||||
}, map);
|
||||
|
||||
const groupVariableDeclarationsByTask = VariableDeclarations => VariableDeclarations.reduce((acc, { declarations }) => {
|
||||
@@ -70,30 +74,46 @@ module.exports = {
|
||||
|
||||
const taskKey = getKey(declaration.init);
|
||||
|
||||
if (acc.has(taskName)) {
|
||||
acc.get(taskName).push(taskKey);
|
||||
} else {
|
||||
acc.set(taskName, [taskKey]);
|
||||
}
|
||||
groupByTaskKeyAndName(acc, { taskKey, taskName });
|
||||
});
|
||||
|
||||
return acc;
|
||||
}, new Map());
|
||||
|
||||
const getInnerIfStatementBodies = (body) => body
|
||||
.filter((arg) => arg.type === 'IfStatement')
|
||||
.reduce((acc, arg) => {
|
||||
const consequent = arg.consequent.body;
|
||||
|
||||
const AlternateBodies = getInnerIfStatementBodies(consequent);
|
||||
|
||||
const body = consequent.filter((arg) => arg.type !== 'IfStatement');
|
||||
|
||||
return acc.concat(body).concat(AlternateBodies);
|
||||
}, [])
|
||||
|
||||
const getNodeBody = (node) => {
|
||||
const body = node.value.body.body;
|
||||
|
||||
return body
|
||||
.filter((arg) => arg.type !== 'IfStatement')
|
||||
.concat(getInnerIfStatementBodies(body));
|
||||
}
|
||||
|
||||
return {
|
||||
"CallExpression[callee.property.name='defineJob'] ObjectExpression BlockStatement": (node) => {
|
||||
const VariableDeclarations = node.body.filter((arg) => arg.type === 'VariableDeclaration');
|
||||
"Property[key.name='run']": (node) => {
|
||||
const body = getNodeBody(node);
|
||||
|
||||
const VariableDeclarations = body.filter((arg) => arg.type === 'VariableDeclaration');
|
||||
|
||||
const grouped = groupVariableDeclarationsByTask(VariableDeclarations);
|
||||
|
||||
const ExpressionStatements = node.body.filter((arg) => arg.type === 'ExpressionStatement');
|
||||
|
||||
|
||||
const ExpressionStatements = body.filter((arg) => arg.type === 'ExpressionStatement');
|
||||
|
||||
// it'll be a map of taskName => [key1, key2, ...]
|
||||
const groupedByTask = groupExpressionsByTask(ExpressionStatements, grouped);
|
||||
|
||||
groupedByTask.forEach((keys) => {
|
||||
const duplicated = keys.find((key, index) => keys.indexOf(key) !== index);
|
||||
|
||||
if (duplicated) {
|
||||
context.report({
|
||||
node,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@trigger.dev/eslint-plugin",
|
||||
"version": "2.0.11",
|
||||
"version": "2.0.14",
|
||||
"description": "ESLint plugin with trigger.dev best practices",
|
||||
"keywords": [
|
||||
"eslint",
|
||||
|
||||
@@ -240,6 +240,86 @@ ruleTester.run("no-duplicated-task-keys", rule, {
|
||||
{ message: "Task key 'Get Tag' is duplicated" },
|
||||
{ message: "Task key 'Tag ' is duplicated" },
|
||||
]
|
||||
},
|
||||
{
|
||||
code: `import { Job, eventTrigger } from "@trigger.dev/sdk";
|
||||
import { client } from "@/trigger";
|
||||
|
||||
// your first job
|
||||
new Job(client, {
|
||||
id: "example-job",
|
||||
name: "Example Job",
|
||||
version: "0.0.1",
|
||||
trigger: eventTrigger({
|
||||
name: "example.event",
|
||||
}),
|
||||
run: async (payload, io, ctx) => {
|
||||
await io.runTask("example.task", { name: "Task 1" }, async () => {});
|
||||
await io.runTask("example.task", { name: "Task 2" }, async () => {});
|
||||
},
|
||||
});`,
|
||||
errors: [
|
||||
{ message: "Task key 'example.task' is duplicated" },
|
||||
]
|
||||
},
|
||||
{
|
||||
code: `import { Job, eventTrigger } from "@trigger.dev/sdk";
|
||||
import { client } from "@/trigger";
|
||||
|
||||
// your first job
|
||||
new Job(client, {
|
||||
id: "example-job",
|
||||
name: "Example Job",
|
||||
version: "0.0.1",
|
||||
trigger: eventTrigger({
|
||||
name: "example.event",
|
||||
}),
|
||||
run: async (payload, io, ctx) => {
|
||||
await io.runTask("example.task", { name: "Task 1" }, async () => {});
|
||||
|
||||
await io.anotherTask("different task", { name: "Task 1" }, async () => {});
|
||||
|
||||
if (true) {
|
||||
await io.runTask("example.task", { name: "Task 2" }, async () => {});
|
||||
|
||||
if (true) {
|
||||
await io.runTask("example.task", { name: "Task 3" }, async () => {});
|
||||
await io.anotherTask("different task", { name: "Task 1" }, async () => {});
|
||||
}
|
||||
}
|
||||
},
|
||||
});`,
|
||||
errors: [
|
||||
{ message: "Task key 'example.task' is duplicated" },
|
||||
{ message: "Task key 'different task' is duplicated" },
|
||||
]
|
||||
},
|
||||
{
|
||||
code: `import { Job, eventTrigger } from "@trigger.dev/sdk";
|
||||
import { client } from "@/trigger";
|
||||
|
||||
// your first job
|
||||
new Job(client, {
|
||||
id: "example-job",
|
||||
name: "Example Job",
|
||||
version: "0.0.1",
|
||||
trigger: eventTrigger({
|
||||
name: "example.event",
|
||||
}),
|
||||
run: async (payload, io, ctx) => {
|
||||
if (true) {
|
||||
await io.runTask("example.task", { name: "Task 1" }, async () => {});
|
||||
|
||||
if (true) {
|
||||
await io.runTask("example.task", { name: "Task 2" }, async () => {});
|
||||
await io.anotherTask("different task", { name: "Task 1" }, async () => {});
|
||||
}
|
||||
}
|
||||
},
|
||||
});`,
|
||||
errors: [
|
||||
{ message: "Task key 'example.task' is duplicated" },
|
||||
]
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
@@ -1,5 +1,25 @@
|
||||
# @trigger.dev/express
|
||||
|
||||
## 2.0.14
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies:
|
||||
- `@trigger.dev/sdk@2.0.14`
|
||||
|
||||
## 2.0.13
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies:
|
||||
- `@trigger.dev/sdk@2.0.13`
|
||||
|
||||
## 2.0.12
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @trigger.dev/sdk@2.0.12
|
||||
|
||||
## 2.0.11
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@trigger.dev/express",
|
||||
"version": "2.0.11",
|
||||
"version": "2.0.14",
|
||||
"description": "Official Express adapter for Trigger.dev",
|
||||
"license": "MIT",
|
||||
"main": "./dist/index.js",
|
||||
@@ -19,7 +19,7 @@
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@trigger.dev/sdk": "workspace:^2.0.11",
|
||||
"@trigger.dev/sdk": "workspace:^2.0.14",
|
||||
"@trigger.dev/tsconfig": "workspace:*",
|
||||
"@types/debug": "^4.1.7",
|
||||
"@types/express": "^4.17.13",
|
||||
@@ -33,7 +33,7 @@
|
||||
"build:tsup": "tsup"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@trigger.dev/sdk": "workspace:^2.0.11"
|
||||
"@trigger.dev/sdk": "workspace:^2.0.14"
|
||||
},
|
||||
"dependencies": {
|
||||
"@remix-run/web-fetch": "^4.3.5",
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# @trigger.dev/integration-kit
|
||||
|
||||
## 2.0.14
|
||||
|
||||
## 2.0.13
|
||||
|
||||
## 2.0.12
|
||||
|
||||
## 2.0.11
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@trigger.dev/integration-kit",
|
||||
"version": "2.0.11",
|
||||
"version": "2.0.14",
|
||||
"description": "Trigger.dev Integration Kit has helpers to make creating integrations easier",
|
||||
"license": "MIT",
|
||||
"main": "./dist/index.js",
|
||||
|
||||
@@ -1,5 +1,25 @@
|
||||
# @trigger.dev/nextjs
|
||||
|
||||
## 2.0.14
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies:
|
||||
- `@trigger.dev/sdk@2.0.14`
|
||||
|
||||
## 2.0.13
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies:
|
||||
- `@trigger.dev/sdk@2.0.13`
|
||||
|
||||
## 2.0.12
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @trigger.dev/sdk@2.0.12
|
||||
|
||||
## 2.0.11
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@trigger.dev/nextjs",
|
||||
"version": "2.0.11",
|
||||
"version": "2.0.14",
|
||||
"description": "Trigger.dev Next.js integration",
|
||||
"license": "MIT",
|
||||
"main": "./dist/index.js",
|
||||
@@ -33,7 +33,7 @@
|
||||
"build:tsup": "tsup"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@trigger.dev/sdk": "workspace:^2.0.11",
|
||||
"@trigger.dev/sdk": "workspace:^2.0.14",
|
||||
"next": ">=12.0.0 <14.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
|
||||
@@ -1,5 +1,25 @@
|
||||
# @trigger.dev/react
|
||||
|
||||
## 2.0.14
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies:
|
||||
- `@trigger.dev/core@2.0.14`
|
||||
|
||||
## 2.0.13
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies:
|
||||
- `@trigger.dev/core@2.0.13`
|
||||
|
||||
## 2.0.12
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @trigger.dev/core@2.0.12
|
||||
|
||||
## 2.0.11
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@trigger.dev/react",
|
||||
"version": "2.0.11",
|
||||
"version": "2.0.14",
|
||||
"description": "Trigger.dev React SDK",
|
||||
"license": "MIT",
|
||||
"types": "dist/index.d.ts",
|
||||
@@ -27,7 +27,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@tanstack/react-query": "5.0.0-beta.2",
|
||||
"@trigger.dev/core": "workspace:^2.0.11",
|
||||
"@trigger.dev/core": "workspace:^2.0.14",
|
||||
"debug": "^4.3.4",
|
||||
"zod": "3.21.4"
|
||||
},
|
||||
|
||||
@@ -1,5 +1,26 @@
|
||||
# @trigger.dev/sdk
|
||||
|
||||
## 2.0.14
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies:
|
||||
- `@trigger.dev/core@2.0.14`
|
||||
|
||||
## 2.0.13
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Only use cached tasks if they are completed, otherwise retrying tasks will be considered successful ([`916a3536`](https://github.com/triggerdotdev/trigger.dev/commit/916a353660e251946d76bdf565c26b7801d3beb8))
|
||||
- Updated dependencies:
|
||||
- `@trigger.dev/core@2.0.13`
|
||||
|
||||
## 2.0.12
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @trigger.dev/core@2.0.12
|
||||
|
||||
## 2.0.11
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@trigger.dev/sdk",
|
||||
"version": "2.0.11",
|
||||
"version": "2.0.14",
|
||||
"description": "trigger.dev Node.JS SDK",
|
||||
"license": "MIT",
|
||||
"main": "./dist/index.js",
|
||||
@@ -25,7 +25,7 @@
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"@trigger.dev/core": "workspace:^2.0.11",
|
||||
"@trigger.dev/core": "workspace:^2.0.14",
|
||||
"chalk": "^5.2.0",
|
||||
"cronstrue": "^2.21.0",
|
||||
"debug": "^4.3.4",
|
||||
|
||||
@@ -504,8 +504,8 @@ export class IO {
|
||||
|
||||
const cachedTask = this._cachedTasks.get(idempotencyKey);
|
||||
|
||||
if (cachedTask) {
|
||||
this._logger.debug("Using cached task", {
|
||||
if (cachedTask && cachedTask.status === "COMPLETED") {
|
||||
this._logger.debug("Using completed cached task", {
|
||||
idempotencyKey,
|
||||
cachedTask,
|
||||
});
|
||||
|
||||
Generated
+51
-20
@@ -7,6 +7,7 @@ importers:
|
||||
'@changesets/cli': ^2.26.0
|
||||
'@manypkg/cli': ^0.19.2
|
||||
'@playwright/test': ^1.36.2
|
||||
'@remix-run/changelog-github': ^0.0.5
|
||||
'@tailwindcss/forms': ^0.5.3
|
||||
'@tailwindcss/typography': ^0.5.8
|
||||
'@trigger.dev/cli': workspace:*
|
||||
@@ -25,6 +26,7 @@ importers:
|
||||
vitest: ^0.28.4
|
||||
dependencies:
|
||||
'@changesets/cli': 2.26.0
|
||||
'@remix-run/changelog-github': 0.0.5
|
||||
node-fetch: 2.6.7
|
||||
devDependencies:
|
||||
'@manypkg/cli': 0.19.2
|
||||
@@ -614,8 +616,8 @@ importers:
|
||||
'@octokit/types': ^9.2.3
|
||||
'@octokit/webhooks': ^10.4.0
|
||||
'@octokit/webhooks-types': ^6.10.0
|
||||
'@trigger.dev/integration-kit': workspace:^2.0.11
|
||||
'@trigger.dev/sdk': workspace:^2.0.11
|
||||
'@trigger.dev/integration-kit': workspace:^2.0.14
|
||||
'@trigger.dev/sdk': workspace:^2.0.14
|
||||
'@trigger.dev/tsconfig': workspace:*
|
||||
'@types/node': '18'
|
||||
octokit: ^2.0.14
|
||||
@@ -640,8 +642,8 @@ importers:
|
||||
|
||||
integrations/openai:
|
||||
specifiers:
|
||||
'@trigger.dev/integration-kit': workspace:^2.0.11
|
||||
'@trigger.dev/sdk': workspace:^2.0.11
|
||||
'@trigger.dev/integration-kit': workspace:^2.0.14
|
||||
'@trigger.dev/sdk': workspace:^2.0.14
|
||||
'@trigger.dev/tsconfig': workspace:*
|
||||
'@types/node': '18'
|
||||
openai: ^4.2.0
|
||||
@@ -660,8 +662,8 @@ importers:
|
||||
integrations/plain:
|
||||
specifiers:
|
||||
'@team-plain/typescript-sdk': ^2.7.0
|
||||
'@trigger.dev/integration-kit': workspace:^2.0.11
|
||||
'@trigger.dev/sdk': workspace:^2.0.11
|
||||
'@trigger.dev/integration-kit': workspace:^2.0.14
|
||||
'@trigger.dev/sdk': workspace:^2.0.14
|
||||
'@trigger.dev/tsconfig': workspace:*
|
||||
'@types/node': '18'
|
||||
rimraf: ^3.0.2
|
||||
@@ -678,8 +680,8 @@ importers:
|
||||
|
||||
integrations/resend:
|
||||
specifiers:
|
||||
'@trigger.dev/integration-kit': workspace:^2.0.11
|
||||
'@trigger.dev/sdk': workspace:^2.0.11
|
||||
'@trigger.dev/integration-kit': workspace:^2.0.14
|
||||
'@trigger.dev/sdk': workspace:^2.0.14
|
||||
'@trigger.dev/tsconfig': workspace:*
|
||||
'@types/node': '18'
|
||||
resend: ^0.9.1
|
||||
@@ -698,8 +700,8 @@ importers:
|
||||
integrations/sendgrid:
|
||||
specifiers:
|
||||
'@sendgrid/mail': ^7.7.0
|
||||
'@trigger.dev/integration-kit': workspace:^2.0.11
|
||||
'@trigger.dev/sdk': workspace:^2.0.11
|
||||
'@trigger.dev/integration-kit': workspace:^2.0.14
|
||||
'@trigger.dev/sdk': workspace:^2.0.14
|
||||
'@types/node': 16.x
|
||||
rimraf: ^3.0.2
|
||||
tsup: 7.1.x
|
||||
@@ -717,7 +719,7 @@ importers:
|
||||
integrations/slack:
|
||||
specifiers:
|
||||
'@slack/web-api': ^6.8.1
|
||||
'@trigger.dev/sdk': workspace:^2.0.11
|
||||
'@trigger.dev/sdk': workspace:^2.0.14
|
||||
'@trigger.dev/tsconfig': workspace:*
|
||||
'@types/node': '18'
|
||||
rimraf: ^3.0.2
|
||||
@@ -735,8 +737,8 @@ importers:
|
||||
|
||||
integrations/stripe:
|
||||
specifiers:
|
||||
'@trigger.dev/integration-kit': workspace:^2.0.11
|
||||
'@trigger.dev/sdk': workspace:^2.0.11
|
||||
'@trigger.dev/integration-kit': workspace:^2.0.14
|
||||
'@trigger.dev/sdk': workspace:^2.0.14
|
||||
'@types/node': 16.x
|
||||
rimraf: ^3.0.2
|
||||
stripe: ^12.14.0
|
||||
@@ -759,8 +761,8 @@ importers:
|
||||
integrations/supabase:
|
||||
specifiers:
|
||||
'@supabase/supabase-js': ^2.26.0
|
||||
'@trigger.dev/integration-kit': workspace:^2.0.11
|
||||
'@trigger.dev/sdk': workspace:^2.0.11
|
||||
'@trigger.dev/integration-kit': workspace:^2.0.14
|
||||
'@trigger.dev/sdk': workspace:^2.0.14
|
||||
'@types/node': 18.x
|
||||
rimraf: ^3.0.2
|
||||
supabase-management-js: ^0.1.4
|
||||
@@ -781,8 +783,8 @@ importers:
|
||||
|
||||
integrations/typeform:
|
||||
specifiers:
|
||||
'@trigger.dev/integration-kit': workspace:^2.0.11
|
||||
'@trigger.dev/sdk': workspace:^2.0.11
|
||||
'@trigger.dev/integration-kit': workspace:^2.0.14
|
||||
'@trigger.dev/sdk': workspace:^2.0.14
|
||||
'@typeform/api-client': ^1.8.0
|
||||
'@types/node': 16.x
|
||||
rimraf: ^3.0.2
|
||||
@@ -987,7 +989,7 @@ importers:
|
||||
packages/express:
|
||||
specifiers:
|
||||
'@remix-run/web-fetch': ^4.3.5
|
||||
'@trigger.dev/sdk': workspace:^2.0.11
|
||||
'@trigger.dev/sdk': workspace:^2.0.14
|
||||
'@trigger.dev/tsconfig': workspace:*
|
||||
'@types/debug': ^4.1.7
|
||||
'@types/express': ^4.17.13
|
||||
@@ -1056,7 +1058,7 @@ importers:
|
||||
packages/react:
|
||||
specifiers:
|
||||
'@tanstack/react-query': 5.0.0-beta.2
|
||||
'@trigger.dev/core': workspace:^2.0.11
|
||||
'@trigger.dev/core': workspace:^2.0.14
|
||||
'@trigger.dev/tsconfig': workspace:*
|
||||
'@types/debug': ^4.1.7
|
||||
'@types/react': 18.2.17
|
||||
@@ -1086,7 +1088,7 @@ importers:
|
||||
|
||||
packages/trigger-sdk:
|
||||
specifiers:
|
||||
'@trigger.dev/core': workspace:^2.0.11
|
||||
'@trigger.dev/core': workspace:^2.0.14
|
||||
'@trigger.dev/tsconfig': workspace:*
|
||||
'@types/debug': ^4.1.7
|
||||
'@types/node': '18'
|
||||
@@ -3778,6 +3780,15 @@ packages:
|
||||
semver: 5.7.1
|
||||
dev: false
|
||||
|
||||
/@changesets/get-github-info/0.5.2:
|
||||
resolution: {integrity: sha512-JppheLu7S114aEs157fOZDjFqUDpm7eHdq5E8SSR0gUBTEK0cNSHsrSR5a66xs0z3RWuo46QvA3vawp8BxDHvg==}
|
||||
dependencies:
|
||||
dataloader: 1.4.0
|
||||
node-fetch: 2.6.12
|
||||
transitivePeerDependencies:
|
||||
- encoding
|
||||
dev: false
|
||||
|
||||
/@changesets/get-release-plan/3.0.16:
|
||||
resolution: {integrity: sha512-OpP9QILpBp1bY2YNIKFzwigKh7Qe9KizRsZomzLe6pK8IUo8onkAAVUD8+JRKSr8R7d4+JRuQrfSSNlEwKyPYg==}
|
||||
dependencies:
|
||||
@@ -8712,6 +8723,17 @@ packages:
|
||||
react: 18.2.0
|
||||
dev: false
|
||||
|
||||
/@remix-run/changelog-github/0.0.5:
|
||||
resolution: {integrity: sha512-43tqwUqWqirbv6D9uzo55ASPsCJ61Ein1k/M8qn+Qpros0MmbmuzjLVPmtaxfxfe2ANX0LefLvCD0pAgr1tp4g==}
|
||||
dependencies:
|
||||
'@changesets/errors': 0.1.4
|
||||
'@changesets/get-github-info': 0.5.2
|
||||
'@changesets/types': 5.2.1
|
||||
dotenv: 8.6.0
|
||||
transitivePeerDependencies:
|
||||
- encoding
|
||||
dev: false
|
||||
|
||||
/@remix-run/dev/1.19.2-pre.0_36n2i74sizt32vwpdxc4husnkq:
|
||||
resolution: {integrity: sha512-8s7g8jLueKcIr5Gb7qvZRJVzfHx2KqyApGYW55LrQ63kNwZwuKHglYSMoaQGB4xUhX2cfmzW7pIcunfbh3SNyA==}
|
||||
engines: {node: '>=14.0.0'}
|
||||
@@ -14268,6 +14290,10 @@ packages:
|
||||
engines: {node: '>= 14'}
|
||||
dev: true
|
||||
|
||||
/dataloader/1.4.0:
|
||||
resolution: {integrity: sha512-68s5jYdlvasItOJnCuI2Q9s4q98g0pCyL3HrcKJu8KNugUl8ahgmZYg38ysLTgQjjXX3H8CJLkAvWrclWfcalw==}
|
||||
dev: false
|
||||
|
||||
/date-fns/2.30.0:
|
||||
resolution: {integrity: sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==}
|
||||
engines: {node: '>=0.11'}
|
||||
@@ -14760,6 +14786,11 @@ packages:
|
||||
resolution: {integrity: sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==}
|
||||
engines: {node: '>=12'}
|
||||
|
||||
/dotenv/8.6.0:
|
||||
resolution: {integrity: sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g==}
|
||||
engines: {node: '>=10'}
|
||||
dev: false
|
||||
|
||||
/duplexer2/0.1.4:
|
||||
resolution: {integrity: sha512-asLFVfWWtJ90ZyOUHMqk7/S2w2guQKxUI2itj3d92ADHhxUSbCMGi1f1cBcJ7xM1To+pE/Khbwo1yuNbMEPKeA==}
|
||||
dependencies:
|
||||
|
||||
Reference in New Issue
Block a user