@trigger.dev/sdk 0.0.0-prerelease-20250110154019 → 0.0.0-prerelease-20250116155306

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.
@@ -242,9 +242,9 @@ export declare class IO {
242
242
  * @param options Options for sending the event.
243
243
  */
244
244
  sendEvent(cacheKey: string | any[], event: SendEvent, options?: SendEventOptions): Promise<{
245
- payload: import("@trigger.dev/core").DeserializedJson;
246
245
  name: string;
247
246
  id: string;
247
+ payload: import("@trigger.dev/core").DeserializedJson;
248
248
  timestamp: Date;
249
249
  context?: import("@trigger.dev/core").DeserializedJson | undefined;
250
250
  deliverAt?: Date | null | undefined;
@@ -257,9 +257,9 @@ export declare class IO {
257
257
  * @param options Options for sending the events.
258
258
  */
259
259
  sendEvents(cacheKey: string | any[], events: SendEvent[], options?: SendEventOptions): Promise<{
260
- payload: import("@trigger.dev/core").DeserializedJson;
261
260
  name: string;
262
261
  id: string;
262
+ payload: import("@trigger.dev/core").DeserializedJson;
263
263
  timestamp: Date;
264
264
  context?: import("@trigger.dev/core").DeserializedJson | undefined;
265
265
  deliverAt?: Date | null | undefined;
@@ -269,14 +269,14 @@ export declare class IO {
269
269
  getEvent(cacheKey: string | any[], id: string): Promise<{
270
270
  name: string;
271
271
  id: string;
272
- updatedAt: Date;
272
+ createdAt: Date;
273
273
  runs: {
274
- status: "PENDING" | "CANCELED" | "QUEUED" | "WAITING_ON_CONNECTIONS" | "PREPROCESSING" | "STARTED" | "SUCCESS" | "FAILURE" | "TIMED_OUT" | "ABORTED" | "UNRESOLVED_AUTH" | "INVALID_PAYLOAD" | "EXECUTING" | "WAITING_TO_CONTINUE" | "WAITING_TO_EXECUTE";
274
+ status: "PENDING" | "CANCELED" | "TIMED_OUT" | "QUEUED" | "EXECUTING" | "WAITING_ON_CONNECTIONS" | "PREPROCESSING" | "STARTED" | "SUCCESS" | "FAILURE" | "ABORTED" | "UNRESOLVED_AUTH" | "INVALID_PAYLOAD" | "WAITING_TO_CONTINUE" | "WAITING_TO_EXECUTE";
275
275
  id: string;
276
276
  startedAt?: Date | null | undefined;
277
277
  completedAt?: Date | null | undefined;
278
278
  }[];
279
- createdAt: Date;
279
+ updatedAt: Date;
280
280
  }>;
281
281
  /** `io.cancelEvent()` allows you to cancel an event that was previously sent with `io.sendEvent()`. This will prevent any Jobs from running that are listening for that event if the event was sent with a delay
282
282
  * @param cacheKey
@@ -284,9 +284,9 @@ export declare class IO {
284
284
  * @returns
285
285
  */
286
286
  cancelEvent(cacheKey: string | any[], eventId: string): Promise<{
287
- payload: import("@trigger.dev/core").DeserializedJson;
288
287
  name: string;
289
288
  id: string;
289
+ payload: import("@trigger.dev/core").DeserializedJson;
290
290
  timestamp: Date;
291
291
  context?: import("@trigger.dev/core").DeserializedJson | undefined;
292
292
  deliverAt?: Date | null | undefined;
@@ -296,14 +296,14 @@ export declare class IO {
296
296
  updateSource(cacheKey: string | any[], options: {
297
297
  key: string;
298
298
  } & UpdateTriggerSourceBodyV2): Promise<{
299
- id: string;
300
299
  key: string;
300
+ id: string;
301
301
  }>;
302
302
  updateWebhook(cacheKey: string | any[], options: {
303
303
  key: string;
304
304
  } & UpdateWebhookBody): Promise<{
305
- id: string;
306
305
  key: string;
306
+ id: string;
307
307
  }>;
308
308
  /** `io.registerInterval()` allows you to register a [DynamicSchedule](https://trigger.dev/docs/sdk/dynamicschedule) that will trigger any jobs it's attached to on a regular interval.
309
309
  * @param cacheKey Should be a stable and unique key inside the `run()`. See [resumability](https://trigger.dev/docs/documentation/concepts/resumability) for more information.
@@ -316,17 +316,17 @@ export declare class IO {
316
316
  registerInterval(cacheKey: string | any[], dynamicSchedule: DynamicSchedule, id: string, options: IntervalOptions): Promise<{
317
317
  id: string;
318
318
  schedule: {
319
+ type: "cron";
319
320
  options: {
320
321
  cron: string;
321
322
  };
322
- type: "cron";
323
323
  metadata?: any;
324
324
  accountId?: string | undefined;
325
325
  } | {
326
+ type: "interval";
326
327
  options: {
327
328
  seconds: number;
328
329
  };
329
- type: "interval";
330
330
  metadata?: any;
331
331
  accountId?: string | undefined;
332
332
  };
@@ -352,17 +352,17 @@ export declare class IO {
352
352
  registerCron(cacheKey: string | any[], dynamicSchedule: DynamicSchedule, id: string, options: CronOptions): Promise<{
353
353
  id: string;
354
354
  schedule: {
355
+ type: "cron";
355
356
  options: {
356
357
  cron: string;
357
358
  };
358
- type: "cron";
359
359
  metadata?: any;
360
360
  accountId?: string | undefined;
361
361
  } | {
362
+ type: "interval";
362
363
  options: {
363
364
  seconds: number;
364
365
  };
365
- type: "interval";
366
366
  metadata?: any;
367
367
  accountId?: string | undefined;
368
368
  };
@@ -6,14 +6,14 @@ export declare class TriggerStatus {
6
6
  private io;
7
7
  constructor(id: string, io: IO);
8
8
  update(key: IntegrationTaskKey, status: StatusUpdate): Promise<{
9
- label: string;
10
9
  key: string;
10
+ label: string;
11
11
  history: {
12
- label?: string | undefined;
13
- state?: "loading" | "success" | "failure" | undefined;
14
12
  data?: Record<string, import("@trigger.dev/core").SerializableJson> | undefined;
13
+ label?: string | undefined;
14
+ state?: "success" | "loading" | "failure" | undefined;
15
15
  }[];
16
- state?: "loading" | "success" | "failure" | undefined;
17
16
  data?: Record<string, import("@trigger.dev/core").SerializableJson> | undefined;
17
+ state?: "success" | "loading" | "failure" | undefined;
18
18
  }>;
19
19
  }
@@ -85,10 +85,11 @@ export declare class TriggerClient {
85
85
  missing: string[];
86
86
  orphaned: string[];
87
87
  }>;
88
+ id: string;
88
89
  source: {
89
90
  key: string;
90
- secret: string;
91
91
  active: boolean;
92
+ secret: string;
92
93
  channel: {
93
94
  type: "HTTP";
94
95
  url: string;
@@ -101,11 +102,10 @@ export declare class TriggerClient {
101
102
  data?: DeserializedJson | undefined;
102
103
  clientId?: string | undefined;
103
104
  };
104
- id: string;
105
105
  dynamicTriggerId?: string | undefined;
106
106
  }>;
107
107
  getAuth(id: string): Promise<{
108
- type: "oauth2" | "apiKey";
108
+ type: "apiKey" | "oauth2";
109
109
  accessToken: string;
110
110
  scopes?: string[] | undefined;
111
111
  additionalFields?: Record<string, string> | undefined;
@@ -116,9 +116,9 @@ export declare class TriggerClient {
116
116
  * @returns A promise that resolves to the event details
117
117
  */
118
118
  sendEvent(event: SendEvent, options?: SendEventOptions): Promise<{
119
- payload: DeserializedJson;
120
119
  name: string;
121
120
  id: string;
121
+ payload: DeserializedJson;
122
122
  timestamp: Date;
123
123
  context?: DeserializedJson | undefined;
124
124
  deliverAt?: Date | null | undefined;
@@ -131,9 +131,9 @@ export declare class TriggerClient {
131
131
  * @returns A promise that resolves to an array of event details
132
132
  */
133
133
  sendEvents(events: SendEvent[], options?: SendEventOptions): Promise<{
134
- payload: DeserializedJson;
135
134
  name: string;
136
135
  id: string;
136
+ payload: DeserializedJson;
137
137
  timestamp: Date;
138
138
  context?: DeserializedJson | undefined;
139
139
  deliverAt?: Date | null | undefined;
@@ -141,9 +141,9 @@ export declare class TriggerClient {
141
141
  cancelledAt?: Date | null | undefined;
142
142
  }[]>;
143
143
  cancelEvent(eventId: string): Promise<{
144
- payload: DeserializedJson;
145
144
  name: string;
146
145
  id: string;
146
+ payload: DeserializedJson;
147
147
  timestamp: Date;
148
148
  context?: DeserializedJson | undefined;
149
149
  deliverAt?: Date | null | undefined;
@@ -155,32 +155,30 @@ export declare class TriggerClient {
155
155
  failedToCancelRunIds: string[];
156
156
  }>;
157
157
  updateStatus(runId: string, id: string, status: StatusUpdate): Promise<{
158
- label: string;
159
158
  key: string;
159
+ label: string;
160
160
  history: {
161
- label?: string | undefined;
162
- state?: "loading" | "success" | "failure" | undefined;
163
161
  data?: Record<string, import("@trigger.dev/core").SerializableJson> | undefined;
162
+ label?: string | undefined;
163
+ state?: "success" | "loading" | "failure" | undefined;
164
164
  }[];
165
- state?: "loading" | "success" | "failure" | undefined;
166
- data?: Record<string, import(
167
- /** Default is unset and off. If set to true it will log to the server's console as well as the Trigger.dev platform */
168
- "@trigger.dev/core").SerializableJson> | undefined;
165
+ data?: Record<string, import("@trigger.dev/core").SerializableJson> | undefined;
166
+ state?: "success" | "loading" | "failure" | undefined;
169
167
  }>;
170
168
  registerSchedule(id: string, key: string, schedule: ScheduleMetadata): Promise<{
171
169
  id: string;
172
170
  schedule: {
171
+ type: "cron";
173
172
  options: {
174
173
  cron: string;
175
174
  };
176
- type: "cron";
177
175
  metadata?: any;
178
176
  accountId?: string | undefined;
179
177
  } | {
178
+ type: "interval";
180
179
  options: {
181
180
  seconds: number;
182
181
  };
183
- type: "interval";
184
182
  metadata?: any;
185
183
  accountId?: string | undefined;
186
184
  };
@@ -193,84 +191,84 @@ export declare class TriggerClient {
193
191
  getEvent(eventId: string): Promise<{
194
192
  name: string;
195
193
  id: string;
196
- updatedAt: Date;
194
+ createdAt: Date;
197
195
  runs: {
198
- status: "PENDING" | "CANCELED" | "QUEUED" | "WAITING_ON_CONNECTIONS" | "PREPROCESSING" | "STARTED" | "SUCCESS" | "FAILURE" | "TIMED_OUT" | "ABORTED" | "UNRESOLVED_AUTH" | "INVALID_PAYLOAD" | "EXECUTING" | "WAITING_TO_CONTINUE" | "WAITING_TO_EXECUTE";
196
+ status: "PENDING" | "CANCELED" | "TIMED_OUT" | "QUEUED" | "EXECUTING" | "WAITING_ON_CONNECTIONS" | "PREPROCESSING" | "STARTED" | "SUCCESS" | "FAILURE" | "ABORTED" | "UNRESOLVED_AUTH" | "INVALID_PAYLOAD" | "WAITING_TO_CONTINUE" | "WAITING_TO_EXECUTE";
199
197
  id: string;
200
198
  startedAt?: Date | null | undefined;
201
199
  completedAt?: Date | null | undefined;
202
200
  }[];
203
- createdAt: Date;
201
+ updatedAt: Date;
204
202
  }>;
205
203
  getRun(runId: string, options?: GetRunOptionsWithTaskDetails): Promise<{
206
- status: "PENDING" | "CANCELED" | "QUEUED" | "WAITING_ON_CONNECTIONS" | "PREPROCESSING" | "STARTED" | "SUCCESS" | "FAILURE" | "TIMED_OUT" | "ABORTED" | "UNRESOLVED_AUTH" | "INVALID_PAYLOAD" | "EXECUTING" | "WAITING_TO_CONTINUE" | "WAITING_TO_EXECUTE";
204
+ status: "PENDING" | "CANCELED" | "TIMED_OUT" | "QUEUED" | "EXECUTING" | "WAITING_ON_CONNECTIONS" | "PREPROCESSING" | "STARTED" | "SUCCESS" | "FAILURE" | "ABORTED" | "UNRESOLVED_AUTH" | "INVALID_PAYLOAD" | "WAITING_TO_CONTINUE" | "WAITING_TO_EXECUTE";
207
205
  id: string;
208
206
  startedAt: Date | null;
209
- completedAt: Date | null;
210
- updatedAt: Date | null;
211
207
  tasks: import("@trigger.dev/core").RunTaskWithSubtasks[];
208
+ updatedAt: Date | null;
209
+ completedAt: Date | null;
212
210
  statuses: {
213
- label: string;
214
211
  key: string;
212
+ label: string;
215
213
  history: {
216
- label?: string | undefined;
217
- state?: "loading" | "success" | "failure" | undefined;
218
214
  data?: Record<string, import("@trigger.dev/core").SerializableJson> | undefined;
215
+ label?: string | undefined;
216
+ state?: "success" | "loading" | "failure" | undefined;
219
217
  }[];
220
- state?: "loading" | "success" | "failure" | undefined;
221
218
  data?: Record<string, import("@trigger.dev/core").SerializableJson> | undefined;
219
+ state?: "success" | "loading" | "failure" | undefined;
222
220
  }[];
223
221
  output?: any;
224
222
  nextCursor?: string | undefined;
225
223
  }>;
226
224
  cancelRun(runId: string): Promise<{
227
- status: "PENDING" | "CANCELED" | "QUEUED" | "WAITING_ON_CONNECTIONS" | "PREPROCESSING" | "STARTED" | "SUCCESS" | "FAILURE" | "TIMED_OUT" | "ABORTED" | "UNRESOLVED_AUTH" | "INVALID_PAYLOAD" | "EXECUTING" | "WAITING_TO_CONTINUE" | "WAITING_TO_EXECUTE";
225
+ status: "PENDING" | "CANCELED" | "TIMED_OUT" | "QUEUED" | "EXECUTING" | "WAITING_ON_CONNECTIONS" | "PREPROCESSING" | "STARTED" | "SUCCESS" | "FAILURE" | "ABORTED" | "UNRESOLVED_AUTH" | "INVALID_PAYLOAD" | "WAITING_TO_CONTINUE" | "WAITING_TO_EXECUTE";
228
226
  id: string;
229
227
  startedAt: Date | null;
230
- completedAt: Date | null;
231
- updatedAt: Date | null;
232
228
  tasks: import("@trigger.dev/core").RunTaskWithSubtasks[];
229
+ updatedAt: Date | null;
230
+ completedAt: Date | null;
233
231
  statuses: {
234
- label: string;
235
232
  key: string;
233
+ label: string;
236
234
  history: {
237
- label?: string | undefined;
238
- state?: "loading" | "success" | "failure" | undefined;
239
235
  data?: Record<string, import("@trigger.dev/core").SerializableJson> | undefined;
236
+ label?: string | undefined;
237
+ state?: "success" | "loading" | "failure" | undefined;
240
238
  }[];
241
- state?: "loading" | "success" | "failure" | undefined;
242
239
  data?: Record<string, import("@trigger.dev/core").SerializableJson> | undefined;
240
+ state?: "success" | "loading" | "failure" | undefined;
243
241
  }[];
244
242
  output?: any;
245
243
  nextCursor?: string | undefined;
246
244
  }>;
247
245
  getRuns(jobSlug: string, options?: GetRunsOptions): Promise<{
248
246
  runs: {
249
- status: "PENDING" | "CANCELED" | "QUEUED" | "WAITING_ON_CONNECTIONS" | "PREPROCESSING" | "STARTED" | "SUCCESS" | "FAILURE" | "TIMED_OUT" | "ABORTED" | "UNRESOLVED_AUTH" | "INVALID_PAYLOAD" | "EXECUTING" | "WAITING_TO_CONTINUE" | "WAITING_TO_EXECUTE";
247
+ status: "PENDING" | "CANCELED" | "TIMED_OUT" | "QUEUED" | "EXECUTING" | "WAITING_ON_CONNECTIONS" | "PREPROCESSING" | "STARTED" | "SUCCESS" | "FAILURE" | "ABORTED" | "UNRESOLVED_AUTH" | "INVALID_PAYLOAD" | "WAITING_TO_CONTINUE" | "WAITING_TO_EXECUTE";
250
248
  id: string;
251
249
  startedAt: Date | null;
252
- completedAt: Date | null;
253
250
  updatedAt: Date | null;
251
+ completedAt: Date | null;
254
252
  }[];
255
253
  nextCursor?: string | undefined;
256
254
  }>;
257
255
  getRunStatuses(runId: string): Promise<{
256
+ run: {
257
+ status: "PENDING" | "CANCELED" | "TIMED_OUT" | "QUEUED" | "EXECUTING" | "WAITING_ON_CONNECTIONS" | "PREPROCESSING" | "STARTED" | "SUCCESS" | "FAILURE" | "ABORTED" | "UNRESOLVED_AUTH" | "INVALID_PAYLOAD" | "WAITING_TO_CONTINUE" | "WAITING_TO_EXECUTE";
258
+ id: string;
259
+ output?: any;
260
+ };
258
261
  statuses: {
259
- label: string;
260
262
  key: string;
263
+ label: string;
261
264
  history: {
262
- label?: string | undefined;
263
- state?: "loading" | "success" | "failure" | undefined;
264
265
  data?: Record<string, import("@trigger.dev/core").SerializableJson> | undefined;
266
+ label?: string | undefined;
267
+ state?: "success" | "loading" | "failure" | undefined;
265
268
  }[];
266
- state?: "loading" | "success" | "failure" | undefined;
267
269
  data?: Record<string, import("@trigger.dev/core").SerializableJson> | undefined;
270
+ state?: "success" | "loading" | "failure" | undefined;
268
271
  }[];
269
- run: {
270
- status: "PENDING" | "CANCELED" | "QUEUED" | "WAITING_ON_CONNECTIONS" | "PREPROCESSING" | "STARTED" | "SUCCESS" | "FAILURE" | "TIMED_OUT" | "ABORTED" | "UNRESOLVED_AUTH" | "INVALID_PAYLOAD" | "EXECUTING" | "WAITING_TO_CONTINUE" | "WAITING_TO_EXECUTE";
271
- id: string;
272
- output?: any;
273
- };
274
272
  }>;
275
273
  invokeJob(jobId: string, payload: any, options?: InvokeOptions): Promise<{
276
274
  id: string;
@@ -21,11 +21,11 @@ export declare class MissingConnectionNotification implements Trigger<MissingCon
21
21
  type: "DEVELOPER";
22
22
  id: string;
23
23
  client: {
24
- scopes: string[];
25
24
  id: string;
25
+ createdAt: Date;
26
26
  title: string;
27
27
  updatedAt: Date;
28
- createdAt: Date;
28
+ scopes: string[];
29
29
  };
30
30
  authorizationUrl: string;
31
31
  } | {
@@ -36,11 +36,11 @@ export declare class MissingConnectionNotification implements Trigger<MissingCon
36
36
  metadata?: any;
37
37
  };
38
38
  client: {
39
- scopes: string[];
40
39
  id: string;
40
+ createdAt: Date;
41
41
  title: string;
42
42
  updatedAt: Date;
43
- createdAt: Date;
43
+ scopes: string[];
44
44
  };
45
45
  authorizationUrl: string;
46
46
  };
@@ -69,11 +69,11 @@ export declare class MissingConnectionResolvedNotification implements Trigger<Mi
69
69
  type: "DEVELOPER";
70
70
  id: string;
71
71
  client: {
72
- scopes: string[];
73
72
  id: string;
73
+ createdAt: Date;
74
74
  title: string;
75
75
  updatedAt: Date;
76
- createdAt: Date;
76
+ scopes: string[];
77
77
  integrationIdentifier: string;
78
78
  integrationAuthMethod: string;
79
79
  };
@@ -86,11 +86,11 @@ export declare class MissingConnectionResolvedNotification implements Trigger<Mi
86
86
  metadata?: any;
87
87
  };
88
88
  client: {
89
- scopes: string[];
90
89
  id: string;
90
+ createdAt: Date;
91
91
  title: string;
92
92
  updatedAt: Date;
93
- createdAt: Date;
93
+ scopes: string[];
94
94
  integrationIdentifier: string;
95
95
  integrationAuthMethod: string;
96
96
  };
@@ -115,17 +115,17 @@ export declare class DynamicSchedule implements Trigger<ScheduledEventSpecificat
115
115
  register(key: string, metadata: ScheduleMetadata): Promise<{
116
116
  id: string;
117
117
  schedule: {
118
+ type: "cron";
118
119
  options: {
119
120
  cron: string;
120
121
  };
121
- type: "cron";
122
122
  metadata?: any;
123
123
  accountId?: string | undefined;
124
124
  } | {
125
+ type: "interval";
125
126
  options: {
126
127
  seconds: number;
127
128
  };
128
- type: "interval";
129
129
  metadata?: any;
130
130
  accountId?: string | undefined;
131
131
  };
@@ -28,20 +28,10 @@ export type PollOptions = {
28
28
  declare function poll<TRunId extends AnyRunHandle | AnyTask | string>(runId: RunId<TRunId>, options?: {
29
29
  pollIntervalMs?: number;
30
30
  }, requestOptions?: ApiRequestOptions): Promise<{
31
- status: "COMPLETED" | "CANCELED" | "QUEUED" | "TIMED_OUT" | "EXECUTING" | "WAITING_FOR_DEPLOY" | "REATTEMPTING" | "FROZEN" | "FAILED" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED";
32
- id: string;
33
- error?: {
34
- message: string;
35
- name?: string | undefined;
36
- stackTrace?: string | undefined;
37
- } | undefined;
38
- idempotencyKey?: string | undefined;
39
- startedAt?: Date | undefined;
40
- updatedAt: Date;
41
- isTest: boolean;
31
+ tags: string[];
32
+ status: "WAITING_FOR_DEPLOY" | "QUEUED" | "EXECUTING" | "REATTEMPTING" | "FROZEN" | "COMPLETED" | "CANCELED" | "FAILED" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED" | "TIMED_OUT";
33
+ taskIdentifier: string;
42
34
  version?: string | undefined;
43
- metadata?: Record<string, any> | undefined;
44
- createdAt: Date;
45
35
  schedule?: {
46
36
  id: string;
47
37
  generator: {
@@ -52,32 +42,19 @@ declare function poll<TRunId extends AnyRunHandle | AnyTask | string>(runId: Run
52
42
  externalId?: string | undefined;
53
43
  deduplicationKey?: string | undefined;
54
44
  } | undefined;
55
- tags: string[];
56
- taskIdentifier: string;
57
- attempts: ({
58
- status: "PENDING" | "COMPLETED" | "CANCELED" | "EXECUTING" | "FAILED" | "PAUSED";
59
- id: string;
60
- updatedAt: Date;
61
- createdAt: Date;
62
- startedAt?: Date | undefined;
63
- completedAt?: Date | undefined;
64
- error?: {
65
- message: string;
66
- name?: string | undefined;
67
- stackTrace?: string | undefined;
68
- } | undefined;
69
- } | undefined)[];
45
+ isTest: boolean;
46
+ id: string;
47
+ createdAt: Date;
70
48
  durationMs: number;
71
49
  costInCents: number;
72
50
  baseCostInCents: number;
73
51
  relatedRuns: {
74
52
  root?: {
75
- status: "COMPLETED" | "CANCELED" | "QUEUED" | "TIMED_OUT" | "EXECUTING" | "WAITING_FOR_DEPLOY" | "REATTEMPTING" | "FROZEN" | "FAILED" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED";
76
53
  id: string;
77
- updatedAt: Date;
54
+ status: "WAITING_FOR_DEPLOY" | "QUEUED" | "EXECUTING" | "REATTEMPTING" | "FROZEN" | "COMPLETED" | "CANCELED" | "FAILED" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED" | "TIMED_OUT";
55
+ tags: string[];
78
56
  isTest: boolean;
79
57
  createdAt: Date;
80
- tags: string[];
81
58
  durationMs: number;
82
59
  costInCents: number;
83
60
  baseCostInCents: number;
@@ -90,10 +67,11 @@ declare function poll<TRunId extends AnyRunHandle | AnyTask | string>(runId: Run
90
67
  isSuccess: boolean;
91
68
  isFailed: boolean;
92
69
  isCancelled: boolean;
70
+ updatedAt: Date;
93
71
  version?: string | undefined;
94
- metadata?: Record<string, any> | undefined;
95
72
  startedAt?: Date | undefined;
96
73
  idempotencyKey?: string | undefined;
74
+ metadata?: Record<string, any> | undefined;
97
75
  ttl?: string | undefined;
98
76
  batchId?: string | undefined;
99
77
  finishedAt?: Date | undefined;
@@ -101,12 +79,11 @@ declare function poll<TRunId extends AnyRunHandle | AnyTask | string>(runId: Run
101
79
  expiredAt?: Date | undefined;
102
80
  } | undefined;
103
81
  parent?: {
104
- status: "COMPLETED" | "CANCELED" | "QUEUED" | "TIMED_OUT" | "EXECUTING" | "WAITING_FOR_DEPLOY" | "REATTEMPTING" | "FROZEN" | "FAILED" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED";
105
82
  id: string;
106
- updatedAt: Date;
83
+ status: "WAITING_FOR_DEPLOY" | "QUEUED" | "EXECUTING" | "REATTEMPTING" | "FROZEN" | "COMPLETED" | "CANCELED" | "FAILED" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED" | "TIMED_OUT";
84
+ tags: string[];
107
85
  isTest: boolean;
108
86
  createdAt: Date;
109
- tags: string[];
110
87
  durationMs: number;
111
88
  costInCents: number;
112
89
  baseCostInCents: number;
@@ -119,10 +96,11 @@ declare function poll<TRunId extends AnyRunHandle | AnyTask | string>(runId: Run
119
96
  isSuccess: boolean;
120
97
  isFailed: boolean;
121
98
  isCancelled: boolean;
99
+ updatedAt: Date;
122
100
  version?: string | undefined;
123
- metadata?: Record<string, any> | undefined;
124
101
  startedAt?: Date | undefined;
125
102
  idempotencyKey?: string | undefined;
103
+ metadata?: Record<string, any> | undefined;
126
104
  ttl?: string | undefined;
127
105
  batchId?: string | undefined;
128
106
  finishedAt?: Date | undefined;
@@ -130,12 +108,11 @@ declare function poll<TRunId extends AnyRunHandle | AnyTask | string>(runId: Run
130
108
  expiredAt?: Date | undefined;
131
109
  } | undefined;
132
110
  children?: {
133
- status: "COMPLETED" | "CANCELED" | "QUEUED" | "TIMED_OUT" | "EXECUTING" | "WAITING_FOR_DEPLOY" | "REATTEMPTING" | "FROZEN" | "FAILED" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED";
134
111
  id: string;
135
- updatedAt: Date;
112
+ status: "WAITING_FOR_DEPLOY" | "QUEUED" | "EXECUTING" | "REATTEMPTING" | "FROZEN" | "COMPLETED" | "CANCELED" | "FAILED" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED" | "TIMED_OUT";
113
+ tags: string[];
136
114
  isTest: boolean;
137
115
  createdAt: Date;
138
- tags: string[];
139
116
  durationMs: number;
140
117
  costInCents: number;
141
118
  baseCostInCents: number;
@@ -148,10 +125,11 @@ declare function poll<TRunId extends AnyRunHandle | AnyTask | string>(runId: Run
148
125
  isSuccess: boolean;
149
126
  isFailed: boolean;
150
127
  isCancelled: boolean;
128
+ updatedAt: Date;
151
129
  version?: string | undefined;
152
- metadata?: Record<string, any> | undefined;
153
130
  startedAt?: Date | undefined;
154
131
  idempotencyKey?: string | undefined;
132
+ metadata?: Record<string, any> | undefined;
155
133
  ttl?: string | undefined;
156
134
  batchId?: string | undefined;
157
135
  finishedAt?: Date | undefined;
@@ -167,10 +145,32 @@ declare function poll<TRunId extends AnyRunHandle | AnyTask | string>(runId: Run
167
145
  isSuccess: boolean;
168
146
  isFailed: boolean;
169
147
  isCancelled: boolean;
148
+ updatedAt: Date;
149
+ attempts: ({
150
+ id: string;
151
+ status: "EXECUTING" | "COMPLETED" | "CANCELED" | "FAILED" | "PENDING" | "PAUSED";
152
+ createdAt: Date;
153
+ updatedAt: Date;
154
+ startedAt?: Date | undefined;
155
+ error?: {
156
+ message: string;
157
+ stackTrace?: string | undefined;
158
+ name?: string | undefined;
159
+ } | undefined;
160
+ completedAt?: Date | undefined;
161
+ } | undefined)[];
170
162
  attemptCount: number;
163
+ startedAt?: Date | undefined;
164
+ idempotencyKey?: string | undefined;
165
+ metadata?: Record<string, any> | undefined;
171
166
  ttl?: string | undefined;
172
167
  payloadPresignedUrl?: string | undefined;
173
168
  outputPresignedUrl?: string | undefined;
169
+ error?: {
170
+ message: string;
171
+ stackTrace?: string | undefined;
172
+ name?: string | undefined;
173
+ } | undefined;
174
174
  batchId?: string | undefined;
175
175
  finishedAt?: Date | undefined;
176
176
  delayedUntil?: Date | undefined;
@@ -77,7 +77,7 @@ function createTask(params) {
77
77
  description: params.description,
78
78
  queue: params.queue,
79
79
  retry: params.retry ? { ...v3_1.defaultRetryOptions, ...params.retry } : undefined,
80
- machine: params.machine,
80
+ machine: typeof params.machine === "string" ? { preset: params.machine } : params.machine,
81
81
  maxDuration: params.maxDuration,
82
82
  fns: {
83
83
  run: params.run,
@@ -168,7 +168,7 @@ function createSchemaTask(params) {
168
168
  description: params.description,
169
169
  queue: params.queue,
170
170
  retry: params.retry ? { ...v3_1.defaultRetryOptions, ...params.retry } : undefined,
171
- machine: params.machine,
171
+ machine: typeof params.machine === "string" ? { preset: params.machine } : params.machine,
172
172
  maxDuration: params.maxDuration,
173
173
  fns: {
174
174
  run: params.run,
@@ -362,6 +362,7 @@ async function batchTriggerById(items, options, requestOptions) {
362
362
  parentAttempt: v3_1.taskContext.ctx?.attempt.id,
363
363
  metadata: item.options?.metadata,
364
364
  maxDuration: item.options?.maxDuration,
365
+ machine: item.options?.machine,
365
366
  },
366
367
  };
367
368
  })),
@@ -510,6 +511,7 @@ async function batchTriggerByIdAndWait(items, options, requestOptions) {
510
511
  maxAttempts: item.options?.maxAttempts,
511
512
  metadata: item.options?.metadata,
512
513
  maxDuration: item.options?.maxDuration,
514
+ machine: item.options?.machine,
513
515
  },
514
516
  };
515
517
  })),
@@ -646,6 +648,7 @@ async function batchTriggerTasks(items, options, requestOptions) {
646
648
  parentAttempt: v3_1.taskContext.ctx?.attempt.id,
647
649
  metadata: item.options?.metadata,
648
650
  maxDuration: item.options?.maxDuration,
651
+ machine: item.options?.machine,
649
652
  },
650
653
  };
651
654
  })),
@@ -794,6 +797,7 @@ async function batchTriggerAndWaitTasks(items, options, requestOptions) {
794
797
  maxAttempts: item.options?.maxAttempts,
795
798
  metadata: item.options?.metadata,
796
799
  maxDuration: item.options?.maxDuration,
800
+ machine: item.options?.machine,
797
801
  },
798
802
  };
799
803
  })),
@@ -847,6 +851,7 @@ async function trigger_internal(name, id, payload, parsePayload, options, reques
847
851
  parentAttempt: v3_1.taskContext.ctx?.attempt.id,
848
852
  metadata: options?.metadata,
849
853
  maxDuration: options?.maxDuration,
854
+ machine: options?.machine,
850
855
  },
851
856
  }, {
852
857
  spanParentAsLink: true,
@@ -888,6 +893,7 @@ async function batchTrigger_internal(name, taskIdentifier, items, options, parse
888
893
  parentAttempt: v3_1.taskContext.ctx?.attempt.id,
889
894
  metadata: item.options?.metadata,
890
895
  maxDuration: item.options?.maxDuration,
896
+ machine: item.options?.machine,
891
897
  },
892
898
  };
893
899
  })),
@@ -954,6 +960,7 @@ async function triggerAndWait_internal(name, id, payload, parsePayload, options,
954
960
  maxAttempts: options?.maxAttempts,
955
961
  metadata: options?.metadata,
956
962
  maxDuration: options?.maxDuration,
963
+ machine: options?.machine,
957
964
  },
958
965
  }, {}, requestOptions);
959
966
  span.setAttribute("runId", response.id);
@@ -1004,6 +1011,7 @@ async function batchTriggerAndWait_internal(name, id, items, parsePayload, optio
1004
1011
  maxAttempts: item.options?.maxAttempts,
1005
1012
  metadata: item.options?.metadata,
1006
1013
  maxDuration: item.options?.maxDuration,
1014
+ machine: item.options?.machine,
1007
1015
  },
1008
1016
  };
1009
1017
  })),