Added documentation for cancelRunsForJob
This commit is contained in:
+13
-41
@@ -1,9 +1,7 @@
|
||||
{
|
||||
"$schema": "https://mintlify.com/schema.json",
|
||||
"name": "Trigger.dev",
|
||||
"openapi": [
|
||||
"/openapi.yml"
|
||||
],
|
||||
"openapi": ["/openapi.yml"],
|
||||
"logo": {
|
||||
"dark": "/logo/dark.png",
|
||||
"light": "/logo/light.png",
|
||||
@@ -256,10 +254,7 @@
|
||||
"pages": [
|
||||
{
|
||||
"group": "Airtable",
|
||||
"pages": [
|
||||
"integrations/apis/airtable",
|
||||
"integrations/apis/airtable-tasks"
|
||||
]
|
||||
"pages": ["integrations/apis/airtable", "integrations/apis/airtable-tasks"]
|
||||
},
|
||||
{
|
||||
"group": "GitHub",
|
||||
@@ -285,25 +280,16 @@
|
||||
},
|
||||
{
|
||||
"group": "Plain",
|
||||
"pages": [
|
||||
"integrations/apis/plain",
|
||||
"integrations/apis/plain-tasks"
|
||||
]
|
||||
"pages": ["integrations/apis/plain", "integrations/apis/plain-tasks"]
|
||||
},
|
||||
"integrations/apis/replicate",
|
||||
{
|
||||
"group": "SendGrid",
|
||||
"pages": [
|
||||
"integrations/apis/sendgrid",
|
||||
"integrations/apis/sendgrid-tasks"
|
||||
]
|
||||
"pages": ["integrations/apis/sendgrid", "integrations/apis/sendgrid-tasks"]
|
||||
},
|
||||
{
|
||||
"group": "Resend",
|
||||
"pages": [
|
||||
"integrations/apis/resend",
|
||||
"integrations/apis/resend-tasks"
|
||||
]
|
||||
"pages": ["integrations/apis/resend", "integrations/apis/resend-tasks"]
|
||||
},
|
||||
{
|
||||
"group": "Shopify",
|
||||
@@ -315,10 +301,7 @@
|
||||
},
|
||||
{
|
||||
"group": "Slack",
|
||||
"pages": [
|
||||
"integrations/apis/slack",
|
||||
"integrations/apis/slack-tasks"
|
||||
]
|
||||
"pages": ["integrations/apis/slack", "integrations/apis/slack-tasks"]
|
||||
},
|
||||
"integrations/apis/stripe",
|
||||
{
|
||||
@@ -343,9 +326,7 @@
|
||||
"sdk/triggerclient/constructor",
|
||||
{
|
||||
"group": "Instance properties",
|
||||
"pages": [
|
||||
"sdk/triggerclient/store"
|
||||
]
|
||||
"pages": ["sdk/triggerclient/store"]
|
||||
},
|
||||
{
|
||||
"group": "Instance methods",
|
||||
@@ -355,6 +336,7 @@
|
||||
"sdk/triggerclient/instancemethods/getevent",
|
||||
"sdk/triggerclient/instancemethods/cancel-event",
|
||||
"sdk/triggerclient/instancemethods/cancel-runs-for-event",
|
||||
"sdk/triggerclient/instancemethods/cancel-runs-for-job",
|
||||
"sdk/triggerclient/instancemethods/getruns",
|
||||
"sdk/triggerclient/instancemethods/getrun",
|
||||
"sdk/triggerclient/instancemethods/define-job",
|
||||
@@ -407,10 +389,7 @@
|
||||
"sdk/dynamictrigger/constructor",
|
||||
{
|
||||
"group": "Instance methods",
|
||||
"pages": [
|
||||
"sdk/dynamictrigger/register",
|
||||
"sdk/dynamictrigger/unregister"
|
||||
]
|
||||
"pages": ["sdk/dynamictrigger/register", "sdk/dynamictrigger/unregister"]
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -421,10 +400,7 @@
|
||||
"sdk/dynamicschedule/constructor",
|
||||
{
|
||||
"group": "Instance methods",
|
||||
"pages": [
|
||||
"sdk/dynamicschedule/register",
|
||||
"sdk/dynamicschedule/unregister"
|
||||
]
|
||||
"pages": ["sdk/dynamicschedule/register", "sdk/dynamicschedule/unregister"]
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -436,9 +412,7 @@
|
||||
},
|
||||
{
|
||||
"group": "HTTP Reference",
|
||||
"pages": [
|
||||
"sdk/api-reference/events/create-an-event"
|
||||
]
|
||||
"pages": ["sdk/api-reference/events/create-an-event"]
|
||||
},
|
||||
{
|
||||
"group": "React SDK",
|
||||
@@ -452,9 +426,7 @@
|
||||
},
|
||||
{
|
||||
"group": "Overview",
|
||||
"pages": [
|
||||
"examples/introduction"
|
||||
]
|
||||
"pages": ["examples/introduction"]
|
||||
}
|
||||
],
|
||||
"footerSocials": {
|
||||
@@ -467,4 +439,4 @@
|
||||
"apiKey": "phc_hwYmedO564b3Ik8nhA4Csrb5SueY0EwFJWCbseGwWW"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
---
|
||||
title: "TriggerClient: cancelRunsForJob() Instance Method"
|
||||
sidebarTitle: "cancelRunsForJob()"
|
||||
description: "The `cancelRunsForJob()` instance method will cancel all job runs (yet to be executed) with the given jobId."
|
||||
---
|
||||
|
||||
## Parameters
|
||||
|
||||
<ResponseField name="jobId" type="string" required>
|
||||
The job ID to cancel the job runs for. This is the `id` you set when using `client.defineJob()` or
|
||||
`new Job()`.
|
||||
</ResponseField>
|
||||
|
||||
## Returns
|
||||
|
||||
<ResponseField type="object">
|
||||
<Expandable title="properties" defaultOpen>
|
||||
<ResponseField name="cancelledRunIds" type="array" required>
|
||||
List of Job Run IDs that are cancelled.
|
||||
</ResponseField>
|
||||
<ResponseField name="failedToCancelRunIds" type="array" required>
|
||||
List of Job Run IDs that have failed to be cancelled.
|
||||
</ResponseField>
|
||||
</Expandable>
|
||||
</ResponseField>
|
||||
|
||||
<RequestExample>
|
||||
|
||||
```ts Cancelling Runs for an Event
|
||||
//this is the job we want to cancel runs for
|
||||
client.defineJob({
|
||||
//this is the job id
|
||||
id: "my-job",
|
||||
name: "My first job",
|
||||
version: "1.0.0",
|
||||
trigger: invokeTrigger({ schema: z.number() }),
|
||||
run: async (payload, io, ctx) => {
|
||||
await io.logger.info(`Hello World ${payload}`);
|
||||
},
|
||||
});
|
||||
|
||||
// Some time later...
|
||||
const res = await client.cancelRunsForJob("my-job");
|
||||
console.log(res.cancelledRunIds);
|
||||
console.log(res.failedToCancelRunIds);
|
||||
```
|
||||
|
||||
</RequestExample>
|
||||
@@ -60,6 +60,10 @@ The `cancelEvent()` method cancels an event that is scheduled to be delivered in
|
||||
|
||||
The `cancelRunsForEvent()` method cancels the job runs (yet to be executed) that are triggered by a given eventId.
|
||||
|
||||
### [cancelRunsForJob()](/sdk/triggerclient/instancemethods/cancel-runs-for-job)
|
||||
|
||||
The `cancelRunsForJob()` method cancels all runs for the specified job (yet to be executed).
|
||||
|
||||
### [getRuns()](/sdk/triggerclient/instancemethods/getruns)
|
||||
|
||||
The `getRuns()` method gets runs for a Job.
|
||||
|
||||
Reference in New Issue
Block a user