@trigger.dev/sdk 3.0.13 → 3.1.1

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.
Files changed (52) hide show
  1. package/dist/commonjs/v3/auth.d.ts +104 -0
  2. package/dist/commonjs/v3/auth.js +99 -0
  3. package/dist/commonjs/v3/auth.js.map +1 -0
  4. package/dist/commonjs/v3/idempotencyKeys.d.ts +2 -7
  5. package/dist/commonjs/v3/idempotencyKeys.js.map +1 -1
  6. package/dist/commonjs/v3/index.d.ts +2 -19
  7. package/dist/commonjs/v3/index.js +16 -35
  8. package/dist/commonjs/v3/index.js.map +1 -1
  9. package/dist/commonjs/v3/metadata.d.ts +20 -12
  10. package/dist/commonjs/v3/metadata.js +28 -53
  11. package/dist/commonjs/v3/metadata.js.map +1 -1
  12. package/dist/commonjs/v3/runs.d.ts +36 -759
  13. package/dist/commonjs/v3/runs.js +12 -1
  14. package/dist/commonjs/v3/runs.js.map +1 -1
  15. package/dist/commonjs/v3/shared.d.ts +9 -380
  16. package/dist/commonjs/v3/shared.js +99 -54
  17. package/dist/commonjs/v3/shared.js.map +1 -1
  18. package/dist/commonjs/v3/tasks.d.ts +5 -5
  19. package/dist/commonjs/v3/tasks.js +3 -5
  20. package/dist/commonjs/v3/tasks.js.map +1 -1
  21. package/dist/commonjs/v3/tracer.d.ts +1 -1
  22. package/dist/commonjs/v3/tracer.js +2 -2
  23. package/dist/commonjs/v3/tracer.js.map +1 -1
  24. package/dist/commonjs/version.js +1 -1
  25. package/dist/esm/v3/auth.d.ts +104 -0
  26. package/dist/esm/v3/auth.js +95 -0
  27. package/dist/esm/v3/auth.js.map +1 -0
  28. package/dist/esm/v3/idempotencyKeys.d.ts +2 -7
  29. package/dist/esm/v3/idempotencyKeys.js.map +1 -1
  30. package/dist/esm/v3/index-browser.d.mts +2 -0
  31. package/dist/esm/v3/index-browser.mjs +3 -0
  32. package/dist/esm/v3/index-browser.mjs.map +1 -0
  33. package/dist/esm/v3/index.d.ts +2 -19
  34. package/dist/esm/v3/index.js +2 -22
  35. package/dist/esm/v3/index.js.map +1 -1
  36. package/dist/esm/v3/metadata.d.ts +20 -12
  37. package/dist/esm/v3/metadata.js +29 -54
  38. package/dist/esm/v3/metadata.js.map +1 -1
  39. package/dist/esm/v3/runs.d.ts +34 -757
  40. package/dist/esm/v3/runs.js +12 -1
  41. package/dist/esm/v3/runs.js.map +1 -1
  42. package/dist/esm/v3/shared.d.ts +9 -380
  43. package/dist/esm/v3/shared.js +96 -51
  44. package/dist/esm/v3/shared.js.map +1 -1
  45. package/dist/esm/v3/tasks.d.ts +5 -5
  46. package/dist/esm/v3/tasks.js +3 -4
  47. package/dist/esm/v3/tasks.js.map +1 -1
  48. package/dist/esm/v3/tracer.d.ts +1 -1
  49. package/dist/esm/v3/tracer.js +1 -1
  50. package/dist/esm/v3/tracer.js.map +1 -1
  51. package/dist/esm/version.js +1 -1
  52. package/package.json +2 -2
@@ -1,11 +1,7 @@
1
- import type { ApiRequestOptions, ListProjectRunsQueryParams, ListRunsQueryParams, RescheduleRunRequestBody } from "@trigger.dev/core/v3";
1
+ import type { AnyRetrieveRunResult, AnyRunShape, ApiRequestOptions, InferRunTypes, ListProjectRunsQueryParams, ListRunsQueryParams, RescheduleRunRequestBody, RetrieveRunResult, RunShape, RunSubscription, TaskRunShape } from "@trigger.dev/core/v3";
2
2
  import { ApiPromise, CanceledRunResponse, CursorPagePromise, ListRunResponseItem, ReplayRunResponse, RetrieveRunResponse } from "@trigger.dev/core/v3";
3
- import { AnyTask, Prettify, RunHandle, Task } from "./shared.js";
4
- export type RetrieveRunResult<TRunId> = Prettify<TRunId extends RunHandle<infer TOutput> ? Omit<RetrieveRunResponse, "output"> & {
5
- output?: TOutput;
6
- } : TRunId extends Task<string, any, infer TTaskOutput> ? Omit<RetrieveRunResponse, "output"> & {
7
- output?: TTaskOutput;
8
- } : TRunId extends string ? RetrieveRunResponse : never>;
3
+ import { AnyRunHandle, AnyTask } from "./shared.js";
4
+ export type { AnyRetrieveRunResult, AnyRunShape, RetrieveRunResult, RunShape, TaskRunShape };
9
5
  export declare const runs: {
10
6
  replay: typeof replayRun;
11
7
  cancel: typeof cancelRun;
@@ -13,23 +9,34 @@ export declare const runs: {
13
9
  list: typeof listRuns;
14
10
  reschedule: typeof rescheduleRun;
15
11
  poll: typeof poll;
12
+ subscribeToRun: typeof subscribeToRun;
13
+ subscribeToRunsWithTag: typeof subscribeToRunsWithTag;
16
14
  };
17
15
  export type ListRunsItem = ListRunResponseItem;
18
16
  declare function listRuns(projectRef: string, params?: ListProjectRunsQueryParams, requestOptions?: ApiRequestOptions): CursorPagePromise<typeof ListRunResponseItem>;
19
17
  declare function listRuns(params?: ListRunsQueryParams, requestOptions?: ApiRequestOptions): CursorPagePromise<typeof ListRunResponseItem>;
20
- type RunId<TRunId> = TRunId extends RunHandle<any> ? TRunId : TRunId extends AnyTask ? string : TRunId extends string ? TRunId : never;
21
- declare function retrieveRun<TRunId extends RunHandle<any> | AnyTask | string>(runId: RunId<TRunId>, requestOptions?: ApiRequestOptions): ApiPromise<RetrieveRunResult<TRunId>>;
18
+ type RunId<TRunId> = TRunId extends AnyRunHandle ? TRunId : TRunId extends AnyTask ? string : TRunId extends string ? TRunId : never;
19
+ declare function retrieveRun<TRunId extends AnyRunHandle | AnyTask | string>(runId: RunId<TRunId>, requestOptions?: ApiRequestOptions): ApiPromise<RetrieveRunResult<TRunId>>;
22
20
  declare function replayRun(runId: string, requestOptions?: ApiRequestOptions): ApiPromise<ReplayRunResponse>;
23
21
  declare function cancelRun(runId: string, requestOptions?: ApiRequestOptions): ApiPromise<CanceledRunResponse>;
24
22
  declare function rescheduleRun(runId: string, body: RescheduleRunRequestBody, requestOptions?: ApiRequestOptions): ApiPromise<RetrieveRunResponse>;
25
23
  export type PollOptions = {
26
24
  pollIntervalMs?: number;
27
25
  };
28
- declare function poll<TRunId extends RunHandle<any> | AnyTask | string>(runId: RunId<TRunId>, options?: {
26
+ declare function poll<TRunId extends AnyRunHandle | AnyTask | string>(runId: RunId<TRunId>, options?: {
29
27
  pollIntervalMs?: number;
30
- }, requestOptions?: ApiRequestOptions): Promise<(TRunId extends RunHandle<infer TOutput> ? Omit<{
31
- status: "COMPLETED" | "CANCELED" | "QUEUED" | "TIMED_OUT" | "EXECUTING" | "FAILED" | "WAITING_FOR_DEPLOY" | "REATTEMPTING" | "FROZEN" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED";
28
+ }, requestOptions?: ApiRequestOptions): Promise<{
29
+ version?: string | undefined;
30
+ status: "COMPLETED" | "CANCELED" | "QUEUED" | "TIMED_OUT" | "EXECUTING" | "WAITING_FOR_DEPLOY" | "REATTEMPTING" | "FROZEN" | "FAILED" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED";
31
+ error?: {
32
+ message: string;
33
+ name?: string | undefined;
34
+ stackTrace?: string | undefined;
35
+ } | undefined;
32
36
  id: string;
37
+ metadata?: Record<string, any> | undefined;
38
+ startedAt?: Date | undefined;
39
+ idempotencyKey?: string | undefined;
33
40
  attempts: ({
34
41
  status: "PENDING" | "COMPLETED" | "CANCELED" | "EXECUTING" | "FAILED" | "PAUSED";
35
42
  id: string;
@@ -43,115 +50,6 @@ declare function poll<TRunId extends RunHandle<any> | AnyTask | string>(runId: R
43
50
  stackTrace?: string | undefined;
44
51
  } | undefined;
45
52
  } | undefined)[];
46
- updatedAt: Date;
47
- isTest: boolean;
48
- createdAt: Date;
49
- tags: string[];
50
- durationMs: number;
51
- costInCents: number;
52
- baseCostInCents: number;
53
- depth: number;
54
- triggerFunction: "trigger" | "triggerAndWait" | "batchTriggerAndWait" | "batchTrigger";
55
- taskIdentifier: string;
56
- isQueued: boolean;
57
- isExecuting: boolean;
58
- isCompleted: boolean;
59
- isSuccess: boolean;
60
- isFailed: boolean;
61
- isCancelled: boolean;
62
- relatedRuns: {
63
- root?: {
64
- status: "COMPLETED" | "CANCELED" | "QUEUED" | "TIMED_OUT" | "EXECUTING" | "FAILED" | "WAITING_FOR_DEPLOY" | "REATTEMPTING" | "FROZEN" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED";
65
- id: string;
66
- updatedAt: Date;
67
- isTest: boolean;
68
- createdAt: Date;
69
- tags: string[];
70
- durationMs: number;
71
- costInCents: number;
72
- baseCostInCents: number;
73
- depth: number;
74
- triggerFunction: "trigger" | "triggerAndWait" | "batchTriggerAndWait" | "batchTrigger";
75
- taskIdentifier: string;
76
- isQueued: boolean;
77
- isExecuting: boolean;
78
- isCompleted: boolean;
79
- isSuccess: boolean;
80
- isFailed: boolean;
81
- isCancelled: boolean;
82
- batchId?: string | undefined;
83
- idempotencyKey?: string | undefined;
84
- version?: string | undefined;
85
- startedAt?: Date | undefined;
86
- finishedAt?: Date | undefined;
87
- delayedUntil?: Date | undefined;
88
- ttl?: string | undefined;
89
- expiredAt?: Date | undefined;
90
- metadata?: Record<string, any> | undefined;
91
- } | undefined;
92
- parent?: {
93
- status: "COMPLETED" | "CANCELED" | "QUEUED" | "TIMED_OUT" | "EXECUTING" | "FAILED" | "WAITING_FOR_DEPLOY" | "REATTEMPTING" | "FROZEN" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED";
94
- id: string;
95
- updatedAt: Date;
96
- isTest: boolean;
97
- createdAt: Date;
98
- tags: string[];
99
- durationMs: number;
100
- costInCents: number;
101
- baseCostInCents: number;
102
- depth: number;
103
- triggerFunction: "trigger" | "triggerAndWait" | "batchTriggerAndWait" | "batchTrigger";
104
- taskIdentifier: string;
105
- isQueued: boolean;
106
- isExecuting: boolean;
107
- isCompleted: boolean;
108
- isSuccess: boolean;
109
- isFailed: boolean;
110
- isCancelled: boolean;
111
- batchId?: string | undefined;
112
- idempotencyKey?: string | undefined;
113
- version?: string | undefined;
114
- startedAt?: Date | undefined;
115
- finishedAt?: Date | undefined;
116
- delayedUntil?: Date | undefined;
117
- ttl?: string | undefined;
118
- expiredAt?: Date | undefined;
119
- metadata?: Record<string, any> | undefined;
120
- } | undefined;
121
- children?: {
122
- status: "COMPLETED" | "CANCELED" | "QUEUED" | "TIMED_OUT" | "EXECUTING" | "FAILED" | "WAITING_FOR_DEPLOY" | "REATTEMPTING" | "FROZEN" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED";
123
- id: string;
124
- updatedAt: Date;
125
- isTest: boolean;
126
- createdAt: Date;
127
- tags: string[];
128
- durationMs: number;
129
- costInCents: number;
130
- baseCostInCents: number;
131
- depth: number;
132
- triggerFunction: "trigger" | "triggerAndWait" | "batchTriggerAndWait" | "batchTrigger";
133
- taskIdentifier: string;
134
- isQueued: boolean;
135
- isExecuting: boolean;
136
- isCompleted: boolean;
137
- isSuccess: boolean;
138
- isFailed: boolean;
139
- isCancelled: boolean;
140
- batchId?: string | undefined;
141
- idempotencyKey?: string | undefined;
142
- version?: string | undefined;
143
- startedAt?: Date | undefined;
144
- finishedAt?: Date | undefined;
145
- delayedUntil?: Date | undefined;
146
- ttl?: string | undefined;
147
- expiredAt?: Date | undefined;
148
- metadata?: Record<string, any> | undefined;
149
- }[] | undefined;
150
- };
151
- payload?: any;
152
- payloadPresignedUrl?: string | undefined;
153
- output?: any;
154
- outputPresignedUrl?: string | undefined;
155
53
  schedule?: {
156
54
  id: string;
157
55
  generator: {
@@ -162,33 +60,6 @@ declare function poll<TRunId extends RunHandle<any> | AnyTask | string>(runId: R
162
60
  externalId?: string | undefined;
163
61
  deduplicationKey?: string | undefined;
164
62
  } | undefined;
165
- batchId?: string | undefined;
166
- idempotencyKey?: string | undefined;
167
- version?: string | undefined;
168
- startedAt?: Date | undefined;
169
- finishedAt?: Date | undefined;
170
- delayedUntil?: Date | undefined;
171
- ttl?: string | undefined;
172
- expiredAt?: Date | undefined;
173
- metadata?: Record<string, any> | undefined;
174
- }, "output"> & {
175
- output?: TOutput;
176
- } : TRunId extends Task<string, any, infer TTaskOutput> ? Omit<{
177
- status: "COMPLETED" | "CANCELED" | "QUEUED" | "TIMED_OUT" | "EXECUTING" | "FAILED" | "WAITING_FOR_DEPLOY" | "REATTEMPTING" | "FROZEN" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED";
178
- id: string;
179
- attempts: ({
180
- status: "PENDING" | "COMPLETED" | "CANCELED" | "EXECUTING" | "FAILED" | "PAUSED";
181
- id: string;
182
- updatedAt: Date;
183
- createdAt: Date;
184
- startedAt?: Date | undefined;
185
- completedAt?: Date | undefined;
186
- error?: {
187
- message: string;
188
- name?: string | undefined;
189
- stackTrace?: string | undefined;
190
- } | undefined;
191
- } | undefined)[];
192
63
  updatedAt: Date;
193
64
  isTest: boolean;
194
65
  createdAt: Date;
@@ -196,18 +67,12 @@ declare function poll<TRunId extends RunHandle<any> | AnyTask | string>(runId: R
196
67
  durationMs: number;
197
68
  costInCents: number;
198
69
  baseCostInCents: number;
199
- depth: number;
200
- triggerFunction: "trigger" | "triggerAndWait" | "batchTriggerAndWait" | "batchTrigger";
201
70
  taskIdentifier: string;
202
- isQueued: boolean;
203
- isExecuting: boolean;
204
- isCompleted: boolean;
205
- isSuccess: boolean;
206
- isFailed: boolean;
207
- isCancelled: boolean;
71
+ payloadPresignedUrl?: string | undefined;
72
+ outputPresignedUrl?: string | undefined;
208
73
  relatedRuns: {
209
74
  root?: {
210
- status: "COMPLETED" | "CANCELED" | "QUEUED" | "TIMED_OUT" | "EXECUTING" | "FAILED" | "WAITING_FOR_DEPLOY" | "REATTEMPTING" | "FROZEN" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED";
75
+ status: "COMPLETED" | "CANCELED" | "QUEUED" | "TIMED_OUT" | "EXECUTING" | "WAITING_FOR_DEPLOY" | "REATTEMPTING" | "FROZEN" | "FAILED" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED";
211
76
  id: string;
212
77
  updatedAt: Date;
213
78
  isTest: boolean;
@@ -216,9 +81,9 @@ declare function poll<TRunId extends RunHandle<any> | AnyTask | string>(runId: R
216
81
  durationMs: number;
217
82
  costInCents: number;
218
83
  baseCostInCents: number;
84
+ taskIdentifier: string;
219
85
  depth: number;
220
86
  triggerFunction: "trigger" | "triggerAndWait" | "batchTriggerAndWait" | "batchTrigger";
221
- taskIdentifier: string;
222
87
  isQueued: boolean;
223
88
  isExecuting: boolean;
224
89
  isCompleted: boolean;
@@ -236,7 +101,7 @@ declare function poll<TRunId extends RunHandle<any> | AnyTask | string>(runId: R
236
101
  metadata?: Record<string, any> | undefined;
237
102
  } | undefined;
238
103
  parent?: {
239
- status: "COMPLETED" | "CANCELED" | "QUEUED" | "TIMED_OUT" | "EXECUTING" | "FAILED" | "WAITING_FOR_DEPLOY" | "REATTEMPTING" | "FROZEN" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED";
104
+ status: "COMPLETED" | "CANCELED" | "QUEUED" | "TIMED_OUT" | "EXECUTING" | "WAITING_FOR_DEPLOY" | "REATTEMPTING" | "FROZEN" | "FAILED" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED";
240
105
  id: string;
241
106
  updatedAt: Date;
242
107
  isTest: boolean;
@@ -245,9 +110,9 @@ declare function poll<TRunId extends RunHandle<any> | AnyTask | string>(runId: R
245
110
  durationMs: number;
246
111
  costInCents: number;
247
112
  baseCostInCents: number;
113
+ taskIdentifier: string;
248
114
  depth: number;
249
115
  triggerFunction: "trigger" | "triggerAndWait" | "batchTriggerAndWait" | "batchTrigger";
250
- taskIdentifier: string;
251
116
  isQueued: boolean;
252
117
  isExecuting: boolean;
253
118
  isCompleted: boolean;
@@ -265,7 +130,7 @@ declare function poll<TRunId extends RunHandle<any> | AnyTask | string>(runId: R
265
130
  metadata?: Record<string, any> | undefined;
266
131
  } | undefined;
267
132
  children?: {
268
- status: "COMPLETED" | "CANCELED" | "QUEUED" | "TIMED_OUT" | "EXECUTING" | "FAILED" | "WAITING_FOR_DEPLOY" | "REATTEMPTING" | "FROZEN" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED";
133
+ status: "COMPLETED" | "CANCELED" | "QUEUED" | "TIMED_OUT" | "EXECUTING" | "WAITING_FOR_DEPLOY" | "REATTEMPTING" | "FROZEN" | "FAILED" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED";
269
134
  id: string;
270
135
  updatedAt: Date;
271
136
  isTest: boolean;
@@ -274,9 +139,9 @@ declare function poll<TRunId extends RunHandle<any> | AnyTask | string>(runId: R
274
139
  durationMs: number;
275
140
  costInCents: number;
276
141
  baseCostInCents: number;
142
+ taskIdentifier: string;
277
143
  depth: number;
278
144
  triggerFunction: "trigger" | "triggerAndWait" | "batchTriggerAndWait" | "batchTrigger";
279
- taskIdentifier: string;
280
145
  isQueued: boolean;
281
146
  isExecuting: boolean;
282
147
  isCompleted: boolean;
@@ -294,610 +159,22 @@ declare function poll<TRunId extends RunHandle<any> | AnyTask | string>(runId: R
294
159
  metadata?: Record<string, any> | undefined;
295
160
  }[] | undefined;
296
161
  };
297
- payload?: any;
298
- payloadPresignedUrl?: string | undefined;
299
- output?: any;
300
- outputPresignedUrl?: string | undefined;
301
- schedule?: {
302
- id: string;
303
- generator: {
304
- type: "CRON";
305
- description: string;
306
- expression: string;
307
- };
308
- externalId?: string | undefined;
309
- deduplicationKey?: string | undefined;
310
- } | undefined;
311
- batchId?: string | undefined;
312
- idempotencyKey?: string | undefined;
313
- version?: string | undefined;
314
- startedAt?: Date | undefined;
315
- finishedAt?: Date | undefined;
316
- delayedUntil?: Date | undefined;
317
- ttl?: string | undefined;
318
- expiredAt?: Date | undefined;
319
- metadata?: Record<string, any> | undefined;
320
- }, "output"> & {
321
- output?: TTaskOutput;
322
- } : TRunId extends string ? {
323
- status: "COMPLETED" | "CANCELED" | "QUEUED" | "TIMED_OUT" | "EXECUTING" | "FAILED" | "WAITING_FOR_DEPLOY" | "REATTEMPTING" | "FROZEN" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED";
324
- id: string;
325
- attempts: ({
326
- status: "PENDING" | "COMPLETED" | "CANCELED" | "EXECUTING" | "FAILED" | "PAUSED";
327
- id: string;
328
- updatedAt: Date;
329
- createdAt: Date;
330
- startedAt?: Date | undefined;
331
- completedAt?: Date | undefined;
332
- error?: {
333
- message: string;
334
- name?: string | undefined;
335
- stackTrace?: string | undefined;
336
- } | undefined;
337
- } | undefined)[];
338
- updatedAt: Date;
339
- isTest: boolean;
340
- createdAt: Date;
341
- tags: string[];
342
- durationMs: number;
343
- costInCents: number;
344
- baseCostInCents: number;
345
162
  depth: number;
346
163
  triggerFunction: "trigger" | "triggerAndWait" | "batchTriggerAndWait" | "batchTrigger";
347
- taskIdentifier: string;
164
+ batchId?: string | undefined;
348
165
  isQueued: boolean;
349
166
  isExecuting: boolean;
350
167
  isCompleted: boolean;
351
168
  isSuccess: boolean;
352
169
  isFailed: boolean;
353
170
  isCancelled: boolean;
354
- relatedRuns: {
355
- root?: {
356
- status: "COMPLETED" | "CANCELED" | "QUEUED" | "TIMED_OUT" | "EXECUTING" | "FAILED" | "WAITING_FOR_DEPLOY" | "REATTEMPTING" | "FROZEN" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED";
357
- id: string;
358
- updatedAt: Date;
359
- isTest: boolean;
360
- createdAt: Date;
361
- tags: string[];
362
- durationMs: number;
363
- costInCents: number;
364
- baseCostInCents: number;
365
- depth: number;
366
- triggerFunction: "trigger" | "triggerAndWait" | "batchTriggerAndWait" | "batchTrigger";
367
- taskIdentifier: string;
368
- isQueued: boolean;
369
- isExecuting: boolean;
370
- isCompleted: boolean;
371
- isSuccess: boolean;
372
- isFailed: boolean;
373
- isCancelled: boolean;
374
- batchId?: string | undefined;
375
- idempotencyKey?: string | undefined;
376
- version?: string | undefined;
377
- startedAt?: Date | undefined;
378
- finishedAt?: Date | undefined;
379
- delayedUntil?: Date | undefined;
380
- ttl?: string | undefined;
381
- expiredAt?: Date | undefined;
382
- metadata?: Record<string, any> | undefined;
383
- } | undefined;
384
- parent?: {
385
- status: "COMPLETED" | "CANCELED" | "QUEUED" | "TIMED_OUT" | "EXECUTING" | "FAILED" | "WAITING_FOR_DEPLOY" | "REATTEMPTING" | "FROZEN" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED";
386
- id: string;
387
- updatedAt: Date;
388
- isTest: boolean;
389
- createdAt: Date;
390
- tags: string[];
391
- durationMs: number;
392
- costInCents: number;
393
- baseCostInCents: number;
394
- depth: number;
395
- triggerFunction: "trigger" | "triggerAndWait" | "batchTriggerAndWait" | "batchTrigger";
396
- taskIdentifier: string;
397
- isQueued: boolean;
398
- isExecuting: boolean;
399
- isCompleted: boolean;
400
- isSuccess: boolean;
401
- isFailed: boolean;
402
- isCancelled: boolean;
403
- batchId?: string | undefined;
404
- idempotencyKey?: string | undefined;
405
- version?: string | undefined;
406
- startedAt?: Date | undefined;
407
- finishedAt?: Date | undefined;
408
- delayedUntil?: Date | undefined;
409
- ttl?: string | undefined;
410
- expiredAt?: Date | undefined;
411
- metadata?: Record<string, any> | undefined;
412
- } | undefined;
413
- children?: {
414
- status: "COMPLETED" | "CANCELED" | "QUEUED" | "TIMED_OUT" | "EXECUTING" | "FAILED" | "WAITING_FOR_DEPLOY" | "REATTEMPTING" | "FROZEN" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED";
415
- id: string;
416
- updatedAt: Date;
417
- isTest: boolean;
418
- createdAt: Date;
419
- tags: string[];
420
- durationMs: number;
421
- costInCents: number;
422
- baseCostInCents: number;
423
- depth: number;
424
- triggerFunction: "trigger" | "triggerAndWait" | "batchTriggerAndWait" | "batchTrigger";
425
- taskIdentifier: string;
426
- isQueued: boolean;
427
- isExecuting: boolean;
428
- isCompleted: boolean;
429
- isSuccess: boolean;
430
- isFailed: boolean;
431
- isCancelled: boolean;
432
- batchId?: string | undefined;
433
- idempotencyKey?: string | undefined;
434
- version?: string | undefined;
435
- startedAt?: Date | undefined;
436
- finishedAt?: Date | undefined;
437
- delayedUntil?: Date | undefined;
438
- ttl?: string | undefined;
439
- expiredAt?: Date | undefined;
440
- metadata?: Record<string, any> | undefined;
441
- }[] | undefined;
442
- };
443
- payload?: any;
444
- payloadPresignedUrl?: string | undefined;
445
- output?: any;
446
- outputPresignedUrl?: string | undefined;
447
- schedule?: {
448
- id: string;
449
- generator: {
450
- type: "CRON";
451
- description: string;
452
- expression: string;
453
- };
454
- externalId?: string | undefined;
455
- deduplicationKey?: string | undefined;
456
- } | undefined;
457
- batchId?: string | undefined;
458
- idempotencyKey?: string | undefined;
459
- version?: string | undefined;
460
- startedAt?: Date | undefined;
461
- finishedAt?: Date | undefined;
462
- delayedUntil?: Date | undefined;
463
- ttl?: string | undefined;
464
- expiredAt?: Date | undefined;
465
- metadata?: Record<string, any> | undefined;
466
- } : never) extends infer T ? { [K in keyof T]: (TRunId extends RunHandle<infer TOutput> ? Omit<{
467
- status: "COMPLETED" | "CANCELED" | "QUEUED" | "TIMED_OUT" | "EXECUTING" | "FAILED" | "WAITING_FOR_DEPLOY" | "REATTEMPTING" | "FROZEN" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED";
468
- id: string;
469
- attempts: ({
470
- status: "PENDING" | "COMPLETED" | "CANCELED" | "EXECUTING" | "FAILED" | "PAUSED";
471
- id: string;
472
- updatedAt: Date;
473
- createdAt: Date;
474
- startedAt?: Date | undefined;
475
- completedAt?: Date | undefined;
476
- error?: {
477
- message: string;
478
- name?: string | undefined;
479
- stackTrace?: string | undefined;
480
- } | undefined;
481
- } | undefined)[];
482
- updatedAt: Date;
483
- isTest: boolean;
484
- createdAt: Date;
485
- tags: string[];
486
- durationMs: number;
487
- costInCents: number;
488
- baseCostInCents: number;
489
- depth: number;
490
- triggerFunction: "trigger" | "triggerAndWait" | "batchTriggerAndWait" | "batchTrigger";
491
- taskIdentifier: string;
492
- isQueued: boolean;
493
- isExecuting: boolean;
494
- isCompleted: boolean;
495
- isSuccess: boolean;
496
- isFailed: boolean;
497
- isCancelled: boolean;
498
- relatedRuns: {
499
- root?: {
500
- status: "COMPLETED" | "CANCELED" | "QUEUED" | "TIMED_OUT" | "EXECUTING" | "FAILED" | "WAITING_FOR_DEPLOY" | "REATTEMPTING" | "FROZEN" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED";
501
- id: string;
502
- updatedAt: Date;
503
- isTest: boolean;
504
- createdAt: Date;
505
- tags: string[];
506
- durationMs: number;
507
- costInCents: number;
508
- baseCostInCents: number;
509
- depth: number;
510
- triggerFunction: "trigger" | "triggerAndWait" | "batchTriggerAndWait" | "batchTrigger";
511
- taskIdentifier: string;
512
- isQueued: boolean;
513
- isExecuting: boolean;
514
- isCompleted: boolean;
515
- isSuccess: boolean;
516
- isFailed: boolean;
517
- isCancelled: boolean;
518
- batchId?: string | undefined;
519
- idempotencyKey?: string | undefined;
520
- version?: string | undefined;
521
- startedAt?: Date | undefined;
522
- finishedAt?: Date | undefined;
523
- delayedUntil?: Date | undefined;
524
- ttl?: string | undefined;
525
- expiredAt?: Date | undefined;
526
- metadata?: Record<string, any> | undefined;
527
- } | undefined;
528
- parent?: {
529
- status: "COMPLETED" | "CANCELED" | "QUEUED" | "TIMED_OUT" | "EXECUTING" | "FAILED" | "WAITING_FOR_DEPLOY" | "REATTEMPTING" | "FROZEN" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED";
530
- id: string;
531
- updatedAt: Date;
532
- isTest: boolean;
533
- createdAt: Date;
534
- tags: string[];
535
- durationMs: number;
536
- costInCents: number;
537
- baseCostInCents: number;
538
- depth: number;
539
- triggerFunction: "trigger" | "triggerAndWait" | "batchTriggerAndWait" | "batchTrigger";
540
- taskIdentifier: string;
541
- isQueued: boolean;
542
- isExecuting: boolean;
543
- isCompleted: boolean;
544
- isSuccess: boolean;
545
- isFailed: boolean;
546
- isCancelled: boolean;
547
- batchId?: string | undefined;
548
- idempotencyKey?: string | undefined;
549
- version?: string | undefined;
550
- startedAt?: Date | undefined;
551
- finishedAt?: Date | undefined;
552
- delayedUntil?: Date | undefined;
553
- ttl?: string | undefined;
554
- expiredAt?: Date | undefined;
555
- metadata?: Record<string, any> | undefined;
556
- } | undefined;
557
- children?: {
558
- status: "COMPLETED" | "CANCELED" | "QUEUED" | "TIMED_OUT" | "EXECUTING" | "FAILED" | "WAITING_FOR_DEPLOY" | "REATTEMPTING" | "FROZEN" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED";
559
- id: string;
560
- updatedAt: Date;
561
- isTest: boolean;
562
- createdAt: Date;
563
- tags: string[];
564
- durationMs: number;
565
- costInCents: number;
566
- baseCostInCents: number;
567
- depth: number;
568
- triggerFunction: "trigger" | "triggerAndWait" | "batchTriggerAndWait" | "batchTrigger";
569
- taskIdentifier: string;
570
- isQueued: boolean;
571
- isExecuting: boolean;
572
- isCompleted: boolean;
573
- isSuccess: boolean;
574
- isFailed: boolean;
575
- isCancelled: boolean;
576
- batchId?: string | undefined;
577
- idempotencyKey?: string | undefined;
578
- version?: string | undefined;
579
- startedAt?: Date | undefined;
580
- finishedAt?: Date | undefined;
581
- delayedUntil?: Date | undefined;
582
- ttl?: string | undefined;
583
- expiredAt?: Date | undefined;
584
- metadata?: Record<string, any> | undefined;
585
- }[] | undefined;
586
- };
587
- payload?: any;
588
- payloadPresignedUrl?: string | undefined;
589
- output?: any;
590
- outputPresignedUrl?: string | undefined;
591
- schedule?: {
592
- id: string;
593
- generator: {
594
- type: "CRON";
595
- description: string;
596
- expression: string;
597
- };
598
- externalId?: string | undefined;
599
- deduplicationKey?: string | undefined;
600
- } | undefined;
601
- batchId?: string | undefined;
602
- idempotencyKey?: string | undefined;
603
- version?: string | undefined;
604
- startedAt?: Date | undefined;
605
- finishedAt?: Date | undefined;
606
- delayedUntil?: Date | undefined;
607
- ttl?: string | undefined;
608
- expiredAt?: Date | undefined;
609
- metadata?: Record<string, any> | undefined;
610
- }, "output"> & {
611
- output?: TOutput;
612
- } : TRunId extends Task<string, any, infer TTaskOutput> ? Omit<{
613
- status: "COMPLETED" | "CANCELED" | "QUEUED" | "TIMED_OUT" | "EXECUTING" | "FAILED" | "WAITING_FOR_DEPLOY" | "REATTEMPTING" | "FROZEN" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED";
614
- id: string;
615
- attempts: ({
616
- status: "PENDING" | "COMPLETED" | "CANCELED" | "EXECUTING" | "FAILED" | "PAUSED";
617
- id: string;
618
- updatedAt: Date;
619
- createdAt: Date;
620
- startedAt?: Date | undefined;
621
- completedAt?: Date | undefined;
622
- error?: {
623
- message: string;
624
- name?: string | undefined;
625
- stackTrace?: string | undefined;
626
- } | undefined;
627
- } | undefined)[];
628
- updatedAt: Date;
629
- isTest: boolean;
630
- createdAt: Date;
631
- tags: string[];
632
- durationMs: number;
633
- costInCents: number;
634
- baseCostInCents: number;
635
- depth: number;
636
- triggerFunction: "trigger" | "triggerAndWait" | "batchTriggerAndWait" | "batchTrigger";
637
- taskIdentifier: string;
638
- isQueued: boolean;
639
- isExecuting: boolean;
640
- isCompleted: boolean;
641
- isSuccess: boolean;
642
- isFailed: boolean;
643
- isCancelled: boolean;
644
- relatedRuns: {
645
- root?: {
646
- status: "COMPLETED" | "CANCELED" | "QUEUED" | "TIMED_OUT" | "EXECUTING" | "FAILED" | "WAITING_FOR_DEPLOY" | "REATTEMPTING" | "FROZEN" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED";
647
- id: string;
648
- updatedAt: Date;
649
- isTest: boolean;
650
- createdAt: Date;
651
- tags: string[];
652
- durationMs: number;
653
- costInCents: number;
654
- baseCostInCents: number;
655
- depth: number;
656
- triggerFunction: "trigger" | "triggerAndWait" | "batchTriggerAndWait" | "batchTrigger";
657
- taskIdentifier: string;
658
- isQueued: boolean;
659
- isExecuting: boolean;
660
- isCompleted: boolean;
661
- isSuccess: boolean;
662
- isFailed: boolean;
663
- isCancelled: boolean;
664
- batchId?: string | undefined;
665
- idempotencyKey?: string | undefined;
666
- version?: string | undefined;
667
- startedAt?: Date | undefined;
668
- finishedAt?: Date | undefined;
669
- delayedUntil?: Date | undefined;
670
- ttl?: string | undefined;
671
- expiredAt?: Date | undefined;
672
- metadata?: Record<string, any> | undefined;
673
- } | undefined;
674
- parent?: {
675
- status: "COMPLETED" | "CANCELED" | "QUEUED" | "TIMED_OUT" | "EXECUTING" | "FAILED" | "WAITING_FOR_DEPLOY" | "REATTEMPTING" | "FROZEN" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED";
676
- id: string;
677
- updatedAt: Date;
678
- isTest: boolean;
679
- createdAt: Date;
680
- tags: string[];
681
- durationMs: number;
682
- costInCents: number;
683
- baseCostInCents: number;
684
- depth: number;
685
- triggerFunction: "trigger" | "triggerAndWait" | "batchTriggerAndWait" | "batchTrigger";
686
- taskIdentifier: string;
687
- isQueued: boolean;
688
- isExecuting: boolean;
689
- isCompleted: boolean;
690
- isSuccess: boolean;
691
- isFailed: boolean;
692
- isCancelled: boolean;
693
- batchId?: string | undefined;
694
- idempotencyKey?: string | undefined;
695
- version?: string | undefined;
696
- startedAt?: Date | undefined;
697
- finishedAt?: Date | undefined;
698
- delayedUntil?: Date | undefined;
699
- ttl?: string | undefined;
700
- expiredAt?: Date | undefined;
701
- metadata?: Record<string, any> | undefined;
702
- } | undefined;
703
- children?: {
704
- status: "COMPLETED" | "CANCELED" | "QUEUED" | "TIMED_OUT" | "EXECUTING" | "FAILED" | "WAITING_FOR_DEPLOY" | "REATTEMPTING" | "FROZEN" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED";
705
- id: string;
706
- updatedAt: Date;
707
- isTest: boolean;
708
- createdAt: Date;
709
- tags: string[];
710
- durationMs: number;
711
- costInCents: number;
712
- baseCostInCents: number;
713
- depth: number;
714
- triggerFunction: "trigger" | "triggerAndWait" | "batchTriggerAndWait" | "batchTrigger";
715
- taskIdentifier: string;
716
- isQueued: boolean;
717
- isExecuting: boolean;
718
- isCompleted: boolean;
719
- isSuccess: boolean;
720
- isFailed: boolean;
721
- isCancelled: boolean;
722
- batchId?: string | undefined;
723
- idempotencyKey?: string | undefined;
724
- version?: string | undefined;
725
- startedAt?: Date | undefined;
726
- finishedAt?: Date | undefined;
727
- delayedUntil?: Date | undefined;
728
- ttl?: string | undefined;
729
- expiredAt?: Date | undefined;
730
- metadata?: Record<string, any> | undefined;
731
- }[] | undefined;
732
- };
733
- payload?: any;
734
- payloadPresignedUrl?: string | undefined;
735
- output?: any;
736
- outputPresignedUrl?: string | undefined;
737
- schedule?: {
738
- id: string;
739
- generator: {
740
- type: "CRON";
741
- description: string;
742
- expression: string;
743
- };
744
- externalId?: string | undefined;
745
- deduplicationKey?: string | undefined;
746
- } | undefined;
747
- batchId?: string | undefined;
748
- idempotencyKey?: string | undefined;
749
- version?: string | undefined;
750
- startedAt?: Date | undefined;
751
171
  finishedAt?: Date | undefined;
752
172
  delayedUntil?: Date | undefined;
753
173
  ttl?: string | undefined;
754
174
  expiredAt?: Date | undefined;
755
- metadata?: Record<string, any> | undefined;
756
- }, "output"> & {
757
- output?: TTaskOutput;
758
- } : TRunId extends string ? {
759
- status: "COMPLETED" | "CANCELED" | "QUEUED" | "TIMED_OUT" | "EXECUTING" | "FAILED" | "WAITING_FOR_DEPLOY" | "REATTEMPTING" | "FROZEN" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED";
760
- id: string;
761
- attempts: ({
762
- status: "PENDING" | "COMPLETED" | "CANCELED" | "EXECUTING" | "FAILED" | "PAUSED";
763
- id: string;
764
- updatedAt: Date;
765
- createdAt: Date;
766
- startedAt?: Date | undefined;
767
- completedAt?: Date | undefined;
768
- error?: {
769
- message: string;
770
- name?: string | undefined;
771
- stackTrace?: string | undefined;
772
- } | undefined;
773
- } | undefined)[];
774
- updatedAt: Date;
775
- isTest: boolean;
776
- createdAt: Date;
777
- tags: string[];
778
- durationMs: number;
779
- costInCents: number;
780
- baseCostInCents: number;
781
- depth: number;
782
- triggerFunction: "trigger" | "triggerAndWait" | "batchTriggerAndWait" | "batchTrigger";
783
- taskIdentifier: string;
784
- isQueued: boolean;
785
- isExecuting: boolean;
786
- isCompleted: boolean;
787
- isSuccess: boolean;
788
- isFailed: boolean;
789
- isCancelled: boolean;
790
- relatedRuns: {
791
- root?: {
792
- status: "COMPLETED" | "CANCELED" | "QUEUED" | "TIMED_OUT" | "EXECUTING" | "FAILED" | "WAITING_FOR_DEPLOY" | "REATTEMPTING" | "FROZEN" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED";
793
- id: string;
794
- updatedAt: Date;
795
- isTest: boolean;
796
- createdAt: Date;
797
- tags: string[];
798
- durationMs: number;
799
- costInCents: number;
800
- baseCostInCents: number;
801
- depth: number;
802
- triggerFunction: "trigger" | "triggerAndWait" | "batchTriggerAndWait" | "batchTrigger";
803
- taskIdentifier: string;
804
- isQueued: boolean;
805
- isExecuting: boolean;
806
- isCompleted: boolean;
807
- isSuccess: boolean;
808
- isFailed: boolean;
809
- isCancelled: boolean;
810
- batchId?: string | undefined;
811
- idempotencyKey?: string | undefined;
812
- version?: string | undefined;
813
- startedAt?: Date | undefined;
814
- finishedAt?: Date | undefined;
815
- delayedUntil?: Date | undefined;
816
- ttl?: string | undefined;
817
- expiredAt?: Date | undefined;
818
- metadata?: Record<string, any> | undefined;
819
- } | undefined;
820
- parent?: {
821
- status: "COMPLETED" | "CANCELED" | "QUEUED" | "TIMED_OUT" | "EXECUTING" | "FAILED" | "WAITING_FOR_DEPLOY" | "REATTEMPTING" | "FROZEN" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED";
822
- id: string;
823
- updatedAt: Date;
824
- isTest: boolean;
825
- createdAt: Date;
826
- tags: string[];
827
- durationMs: number;
828
- costInCents: number;
829
- baseCostInCents: number;
830
- depth: number;
831
- triggerFunction: "trigger" | "triggerAndWait" | "batchTriggerAndWait" | "batchTrigger";
832
- taskIdentifier: string;
833
- isQueued: boolean;
834
- isExecuting: boolean;
835
- isCompleted: boolean;
836
- isSuccess: boolean;
837
- isFailed: boolean;
838
- isCancelled: boolean;
839
- batchId?: string | undefined;
840
- idempotencyKey?: string | undefined;
841
- version?: string | undefined;
842
- startedAt?: Date | undefined;
843
- finishedAt?: Date | undefined;
844
- delayedUntil?: Date | undefined;
845
- ttl?: string | undefined;
846
- expiredAt?: Date | undefined;
847
- metadata?: Record<string, any> | undefined;
848
- } | undefined;
849
- children?: {
850
- status: "COMPLETED" | "CANCELED" | "QUEUED" | "TIMED_OUT" | "EXECUTING" | "FAILED" | "WAITING_FOR_DEPLOY" | "REATTEMPTING" | "FROZEN" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED";
851
- id: string;
852
- updatedAt: Date;
853
- isTest: boolean;
854
- createdAt: Date;
855
- tags: string[];
856
- durationMs: number;
857
- costInCents: number;
858
- baseCostInCents: number;
859
- depth: number;
860
- triggerFunction: "trigger" | "triggerAndWait" | "batchTriggerAndWait" | "batchTrigger";
861
- taskIdentifier: string;
862
- isQueued: boolean;
863
- isExecuting: boolean;
864
- isCompleted: boolean;
865
- isSuccess: boolean;
866
- isFailed: boolean;
867
- isCancelled: boolean;
868
- batchId?: string | undefined;
869
- idempotencyKey?: string | undefined;
870
- version?: string | undefined;
871
- startedAt?: Date | undefined;
872
- finishedAt?: Date | undefined;
873
- delayedUntil?: Date | undefined;
874
- ttl?: string | undefined;
875
- expiredAt?: Date | undefined;
876
- metadata?: Record<string, any> | undefined;
877
- }[] | undefined;
878
- };
879
- payload?: any;
880
- payloadPresignedUrl?: string | undefined;
881
- output?: any;
882
- outputPresignedUrl?: string | undefined;
883
- schedule?: {
884
- id: string;
885
- generator: {
886
- type: "CRON";
887
- description: string;
888
- expression: string;
889
- };
890
- externalId?: string | undefined;
891
- deduplicationKey?: string | undefined;
892
- } | undefined;
893
- batchId?: string | undefined;
894
- idempotencyKey?: string | undefined;
895
- version?: string | undefined;
896
- startedAt?: Date | undefined;
897
- finishedAt?: Date | undefined;
898
- delayedUntil?: Date | undefined;
899
- ttl?: string | undefined;
900
- expiredAt?: Date | undefined;
901
- metadata?: Record<string, any> | undefined;
902
- } : never)[K]; } : never>;
903
- export {};
175
+ attemptCount: number;
176
+ output?: InferRunTypes<TRunId>["output"] | undefined;
177
+ payload?: InferRunTypes<TRunId>["payload"] | undefined;
178
+ }>;
179
+ declare function subscribeToRun<TRunId extends AnyRunHandle | AnyTask | string>(runId: RunId<TRunId>): RunSubscription<InferRunTypes<TRunId>>;
180
+ declare function subscribeToRunsWithTag<TTasks extends AnyTask>(tag: string | string[]): RunSubscription<InferRunTypes<TTasks>>;