@trigger.dev/sdk 2.3.7 → 2.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -728,6 +728,10 @@ declare class ApiClient {
728
728
  invokeJob(jobId: string, payload: any, options?: InvokeOptions): Promise<{
729
729
  id: string;
730
730
  }>;
731
+ cancelRunsForJob(jobId: string): Promise<{
732
+ cancelledRunIds: string[];
733
+ failedToCancelRunIds: string[];
734
+ }>;
731
735
  createEphemeralEventDispatcher(payload: EphemeralEventDispatcherRequestBody): Promise<{
732
736
  id: string;
733
737
  }>;
@@ -1855,6 +1859,10 @@ declare class TriggerClient {
1855
1859
  invokeJob(jobId: string, payload: any, options?: InvokeOptions): Promise<{
1856
1860
  id: string;
1857
1861
  }>;
1862
+ cancelRunsForJob(jobId: string): Promise<{
1863
+ cancelledRunIds: string[];
1864
+ failedToCancelRunIds: string[];
1865
+ }>;
1858
1866
  createEphemeralEventDispatcher(payload: EphemeralEventDispatcherRequestBody): Promise<{
1859
1867
  id: string;
1860
1868
  }>;
package/dist/index.d.ts CHANGED
@@ -728,6 +728,10 @@ declare class ApiClient {
728
728
  invokeJob(jobId: string, payload: any, options?: InvokeOptions): Promise<{
729
729
  id: string;
730
730
  }>;
731
+ cancelRunsForJob(jobId: string): Promise<{
732
+ cancelledRunIds: string[];
733
+ failedToCancelRunIds: string[];
734
+ }>;
731
735
  createEphemeralEventDispatcher(payload: EphemeralEventDispatcherRequestBody): Promise<{
732
736
  id: string;
733
737
  }>;
@@ -1855,6 +1859,10 @@ declare class TriggerClient {
1855
1859
  invokeJob(jobId: string, payload: any, options?: InvokeOptions): Promise<{
1856
1860
  id: string;
1857
1861
  }>;
1862
+ cancelRunsForJob(jobId: string): Promise<{
1863
+ cancelledRunIds: string[];
1864
+ failedToCancelRunIds: string[];
1865
+ }>;
1858
1866
  createEphemeralEventDispatcher(payload: EphemeralEventDispatcherRequestBody): Promise<{
1859
1867
  id: string;
1860
1868
  }>;
package/dist/index.js CHANGED
@@ -266,7 +266,7 @@ __name(_Job, "Job");
266
266
  var Job = _Job;
267
267
 
268
268
  // package.json
269
- var version = "2.3.7";
269
+ var version = "2.3.9";
270
270
 
271
271
  // src/errors.ts
272
272
  var _ResumeWithTaskError = class _ResumeWithTaskError {
@@ -2184,6 +2184,19 @@ var _ApiClient = class _ApiClient {
2184
2184
  body: JSON.stringify(body)
2185
2185
  });
2186
2186
  }
2187
+ async cancelRunsForJob(jobId) {
2188
+ const apiKey = await __privateMethod(this, _apiKey, apiKey_fn).call(this);
2189
+ __privateGet(this, _logger).debug("Cancelling Runs for Job", {
2190
+ jobId
2191
+ });
2192
+ return await zodfetch(core.CancelRunsForJobSchema, `${__privateGet(this, _apiUrl)}/api/v1/jobs/${jobId}/cancel-runs`, {
2193
+ method: "POST",
2194
+ headers: {
2195
+ "Content-Type": "application/json",
2196
+ Authorization: `Bearer ${apiKey}`
2197
+ }
2198
+ });
2199
+ }
2187
2200
  async createEphemeralEventDispatcher(payload) {
2188
2201
  const apiKey = await __privateMethod(this, _apiKey, apiKey_fn).call(this);
2189
2202
  __privateGet(this, _logger).debug("Creating ephemeral event dispatcher", {
@@ -3684,6 +3697,9 @@ var _TriggerClient = class _TriggerClient {
3684
3697
  async invokeJob(jobId, payload, options) {
3685
3698
  return __privateGet(this, _client2).invokeJob(jobId, payload, options);
3686
3699
  }
3700
+ async cancelRunsForJob(jobId) {
3701
+ return __privateGet(this, _client2).cancelRunsForJob(jobId);
3702
+ }
3687
3703
  async createEphemeralEventDispatcher(payload) {
3688
3704
  return __privateGet(this, _client2).createEphemeralEventDispatcher(payload);
3689
3705
  }