@trigger.dev/sdk 0.0.0-prerelease-20250212002625 → 0.0.0-python-preview-20250226140121
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/commonjs/apiClient.d.ts +138 -138
- package/dist/commonjs/imports/uncrypto-cjs.cjs.map +1 -0
- package/dist/commonjs/imports/uncrypto.d.ts +1 -0
- package/dist/commonjs/imports/uncrypto.js +7 -0
- package/dist/commonjs/io.d.ts +12 -12
- package/dist/commonjs/status.d.ts +4 -4
- package/dist/commonjs/triggerClient.d.ts +43 -41
- package/dist/commonjs/triggers/notifications.d.ts +8 -8
- package/dist/commonjs/triggers/scheduled.d.ts +2 -2
- package/dist/commonjs/v3/index.d.ts +1 -1
- package/dist/commonjs/v3/index.js +1 -1
- package/dist/commonjs/v3/index.js.map +1 -1
- package/dist/commonjs/v3/runs.d.ts +24 -24
- package/dist/commonjs/v3/webhooks.d.ts +47 -0
- package/dist/commonjs/v3/webhooks.js +110 -0
- package/dist/commonjs/v3/webhooks.js.map +1 -0
- package/dist/commonjs/version.js +1 -1
- package/dist/esm/apiClient.d.ts +142 -142
- package/dist/esm/imports/uncrypto.d.ts +2 -0
- package/dist/esm/imports/uncrypto.js +5 -0
- package/dist/esm/imports/uncrypto.js.map +1 -0
- package/dist/esm/io.d.ts +15 -15
- package/dist/esm/status.d.ts +1 -1
- package/dist/esm/triggerClient.d.ts +30 -30
- package/dist/esm/triggers/notifications.d.ts +12 -12
- package/dist/esm/triggers/scheduled.d.ts +4 -4
- package/dist/esm/types.d.ts +2 -2
- package/dist/esm/v3/index.d.ts +1 -1
- package/dist/esm/v3/index.js +1 -1
- package/dist/esm/v3/index.js.map +1 -1
- package/dist/esm/v3/runs.d.ts +44 -44
- package/dist/esm/v3/webhooks.d.ts +47 -0
- package/dist/esm/v3/webhooks.js +106 -0
- package/dist/esm/v3/webhooks.js.map +1 -0
- package/dist/esm/version.js +1 -1
- package/package.json +3 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uncrypto-cjs.cjs","sourceRoot":"","sources":["../../../src/imports/uncrypto-cjs.cts"],"names":[],"mappings":";;AAAA,aAAa;AACb,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEvC,aAAa;AACb,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.subtle = void 0;
|
|
4
|
+
// @ts-ignore
|
|
5
|
+
const uncrypto_1 = require("uncrypto");
|
|
6
|
+
Object.defineProperty(exports, "subtle", { enumerable: true, get: function () { return uncrypto_1.subtle; } });
|
|
7
|
+
//# sourceMappingURL=uncrypto.js.map
|
package/dist/commonjs/io.d.ts
CHANGED
|
@@ -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;
|
|
245
246
|
name: string;
|
|
246
247
|
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;
|
|
260
261
|
name: string;
|
|
261
262
|
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
|
-
|
|
272
|
+
updatedAt: Date;
|
|
273
273
|
runs: {
|
|
274
|
-
status: "PENDING" | "CANCELED" | "
|
|
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";
|
|
275
275
|
id: string;
|
|
276
276
|
startedAt?: Date | null | undefined;
|
|
277
277
|
completedAt?: Date | null | undefined;
|
|
278
278
|
}[];
|
|
279
|
-
|
|
279
|
+
createdAt: 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;
|
|
287
288
|
name: string;
|
|
288
289
|
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
|
-
key: string;
|
|
300
299
|
id: string;
|
|
300
|
+
key: string;
|
|
301
301
|
}>;
|
|
302
302
|
updateWebhook(cacheKey: string | any[], options: {
|
|
303
303
|
key: string;
|
|
304
304
|
} & UpdateWebhookBody): Promise<{
|
|
305
|
-
key: string;
|
|
306
305
|
id: string;
|
|
306
|
+
key: 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";
|
|
320
319
|
options: {
|
|
321
320
|
cron: string;
|
|
322
321
|
};
|
|
322
|
+
type: "cron";
|
|
323
323
|
metadata?: any;
|
|
324
324
|
accountId?: string | undefined;
|
|
325
325
|
} | {
|
|
326
|
-
type: "interval";
|
|
327
326
|
options: {
|
|
328
327
|
seconds: number;
|
|
329
328
|
};
|
|
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";
|
|
356
355
|
options: {
|
|
357
356
|
cron: string;
|
|
358
357
|
};
|
|
358
|
+
type: "cron";
|
|
359
359
|
metadata?: any;
|
|
360
360
|
accountId?: string | undefined;
|
|
361
361
|
} | {
|
|
362
|
-
type: "interval";
|
|
363
362
|
options: {
|
|
364
363
|
seconds: number;
|
|
365
364
|
};
|
|
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
|
-
key: string;
|
|
10
9
|
label: string;
|
|
10
|
+
key: string;
|
|
11
11
|
history: {
|
|
12
|
-
data?: Record<string, import("@trigger.dev/core").SerializableJson> | undefined;
|
|
13
12
|
label?: string | undefined;
|
|
14
|
-
state?: "
|
|
13
|
+
state?: "loading" | "success" | "failure" | undefined;
|
|
14
|
+
data?: Record<string, import("@trigger.dev/core").SerializableJson> | undefined;
|
|
15
15
|
}[];
|
|
16
|
+
state?: "loading" | "success" | "failure" | undefined;
|
|
16
17
|
data?: Record<string, import("@trigger.dev/core").SerializableJson> | undefined;
|
|
17
|
-
state?: "success" | "loading" | "failure" | undefined;
|
|
18
18
|
}>;
|
|
19
19
|
}
|
|
@@ -85,11 +85,10 @@ export declare class TriggerClient {
|
|
|
85
85
|
missing: string[];
|
|
86
86
|
orphaned: string[];
|
|
87
87
|
}>;
|
|
88
|
-
id: string;
|
|
89
88
|
source: {
|
|
90
89
|
key: string;
|
|
91
|
-
active: boolean;
|
|
92
90
|
secret: string;
|
|
91
|
+
active: boolean;
|
|
93
92
|
channel: {
|
|
94
93
|
type: "HTTP";
|
|
95
94
|
url: string;
|
|
@@ -102,10 +101,11 @@ export declare class TriggerClient {
|
|
|
102
101
|
data?: DeserializedJson | undefined;
|
|
103
102
|
clientId?: string | undefined;
|
|
104
103
|
};
|
|
104
|
+
id: string;
|
|
105
105
|
dynamicTriggerId?: string | undefined;
|
|
106
106
|
}>;
|
|
107
107
|
getAuth(id: string): Promise<{
|
|
108
|
-
type: "
|
|
108
|
+
type: "oauth2" | "apiKey";
|
|
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;
|
|
119
120
|
name: string;
|
|
120
121
|
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;
|
|
134
135
|
name: string;
|
|
135
136
|
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;
|
|
144
145
|
name: string;
|
|
145
146
|
id: string;
|
|
146
|
-
payload: DeserializedJson;
|
|
147
147
|
timestamp: Date;
|
|
148
148
|
context?: DeserializedJson | undefined;
|
|
149
149
|
deliverAt?: Date | null | undefined;
|
|
@@ -155,30 +155,32 @@ export declare class TriggerClient {
|
|
|
155
155
|
failedToCancelRunIds: string[];
|
|
156
156
|
}>;
|
|
157
157
|
updateStatus(runId: string, id: string, status: StatusUpdate): Promise<{
|
|
158
|
-
key: string;
|
|
159
158
|
label: string;
|
|
159
|
+
key: string;
|
|
160
160
|
history: {
|
|
161
|
-
data?: Record<string, import("@trigger.dev/core").SerializableJson> | undefined;
|
|
162
161
|
label?: string | undefined;
|
|
163
|
-
state?: "
|
|
162
|
+
state?: "loading" | "success" | "failure" | undefined;
|
|
163
|
+
data?: Record<string, import("@trigger.dev/core").SerializableJson> | undefined;
|
|
164
164
|
}[];
|
|
165
|
-
|
|
166
|
-
|
|
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;
|
|
167
169
|
}>;
|
|
168
170
|
registerSchedule(id: string, key: string, schedule: ScheduleMetadata): Promise<{
|
|
169
171
|
id: string;
|
|
170
172
|
schedule: {
|
|
171
|
-
type: "cron";
|
|
172
173
|
options: {
|
|
173
174
|
cron: string;
|
|
174
175
|
};
|
|
176
|
+
type: "cron";
|
|
175
177
|
metadata?: any;
|
|
176
178
|
accountId?: string | undefined;
|
|
177
179
|
} | {
|
|
178
|
-
type: "interval";
|
|
179
180
|
options: {
|
|
180
181
|
seconds: number;
|
|
181
182
|
};
|
|
183
|
+
type: "interval";
|
|
182
184
|
metadata?: any;
|
|
183
185
|
accountId?: string | undefined;
|
|
184
186
|
};
|
|
@@ -191,84 +193,84 @@ export declare class TriggerClient {
|
|
|
191
193
|
getEvent(eventId: string): Promise<{
|
|
192
194
|
name: string;
|
|
193
195
|
id: string;
|
|
194
|
-
|
|
196
|
+
updatedAt: Date;
|
|
195
197
|
runs: {
|
|
196
|
-
status: "PENDING" | "CANCELED" | "
|
|
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";
|
|
197
199
|
id: string;
|
|
198
200
|
startedAt?: Date | null | undefined;
|
|
199
201
|
completedAt?: Date | null | undefined;
|
|
200
202
|
}[];
|
|
201
|
-
|
|
203
|
+
createdAt: Date;
|
|
202
204
|
}>;
|
|
203
205
|
getRun(runId: string, options?: GetRunOptionsWithTaskDetails): Promise<{
|
|
204
|
-
status: "PENDING" | "CANCELED" | "
|
|
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";
|
|
205
207
|
id: string;
|
|
206
208
|
startedAt: Date | null;
|
|
207
|
-
tasks: import("@trigger.dev/core").RunTaskWithSubtasks[];
|
|
208
|
-
updatedAt: Date | null;
|
|
209
209
|
completedAt: Date | null;
|
|
210
|
+
updatedAt: Date | null;
|
|
211
|
+
tasks: import("@trigger.dev/core").RunTaskWithSubtasks[];
|
|
210
212
|
statuses: {
|
|
211
|
-
key: string;
|
|
212
213
|
label: string;
|
|
214
|
+
key: string;
|
|
213
215
|
history: {
|
|
214
|
-
data?: Record<string, import("@trigger.dev/core").SerializableJson> | undefined;
|
|
215
216
|
label?: string | undefined;
|
|
216
|
-
state?: "
|
|
217
|
+
state?: "loading" | "success" | "failure" | undefined;
|
|
218
|
+
data?: Record<string, import("@trigger.dev/core").SerializableJson> | undefined;
|
|
217
219
|
}[];
|
|
220
|
+
state?: "loading" | "success" | "failure" | undefined;
|
|
218
221
|
data?: Record<string, import("@trigger.dev/core").SerializableJson> | undefined;
|
|
219
|
-
state?: "success" | "loading" | "failure" | undefined;
|
|
220
222
|
}[];
|
|
221
223
|
output?: any;
|
|
222
224
|
nextCursor?: string | undefined;
|
|
223
225
|
}>;
|
|
224
226
|
cancelRun(runId: string): Promise<{
|
|
225
|
-
status: "PENDING" | "CANCELED" | "
|
|
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";
|
|
226
228
|
id: string;
|
|
227
229
|
startedAt: Date | null;
|
|
228
|
-
tasks: import("@trigger.dev/core").RunTaskWithSubtasks[];
|
|
229
|
-
updatedAt: Date | null;
|
|
230
230
|
completedAt: Date | null;
|
|
231
|
+
updatedAt: Date | null;
|
|
232
|
+
tasks: import("@trigger.dev/core").RunTaskWithSubtasks[];
|
|
231
233
|
statuses: {
|
|
232
|
-
key: string;
|
|
233
234
|
label: string;
|
|
235
|
+
key: string;
|
|
234
236
|
history: {
|
|
235
|
-
data?: Record<string, import("@trigger.dev/core").SerializableJson> | undefined;
|
|
236
237
|
label?: string | undefined;
|
|
237
|
-
state?: "
|
|
238
|
+
state?: "loading" | "success" | "failure" | undefined;
|
|
239
|
+
data?: Record<string, import("@trigger.dev/core").SerializableJson> | undefined;
|
|
238
240
|
}[];
|
|
241
|
+
state?: "loading" | "success" | "failure" | undefined;
|
|
239
242
|
data?: Record<string, import("@trigger.dev/core").SerializableJson> | undefined;
|
|
240
|
-
state?: "success" | "loading" | "failure" | undefined;
|
|
241
243
|
}[];
|
|
242
244
|
output?: any;
|
|
243
245
|
nextCursor?: string | undefined;
|
|
244
246
|
}>;
|
|
245
247
|
getRuns(jobSlug: string, options?: GetRunsOptions): Promise<{
|
|
246
248
|
runs: {
|
|
247
|
-
status: "PENDING" | "CANCELED" | "
|
|
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";
|
|
248
250
|
id: string;
|
|
249
251
|
startedAt: Date | null;
|
|
250
|
-
updatedAt: Date | null;
|
|
251
252
|
completedAt: Date | null;
|
|
253
|
+
updatedAt: Date | null;
|
|
252
254
|
}[];
|
|
253
255
|
nextCursor?: string | undefined;
|
|
254
256
|
}>;
|
|
255
257
|
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
|
-
};
|
|
261
258
|
statuses: {
|
|
262
|
-
key: string;
|
|
263
259
|
label: string;
|
|
260
|
+
key: string;
|
|
264
261
|
history: {
|
|
265
|
-
data?: Record<string, import("@trigger.dev/core").SerializableJson> | undefined;
|
|
266
262
|
label?: string | undefined;
|
|
267
|
-
state?: "
|
|
263
|
+
state?: "loading" | "success" | "failure" | undefined;
|
|
264
|
+
data?: Record<string, import("@trigger.dev/core").SerializableJson> | undefined;
|
|
268
265
|
}[];
|
|
266
|
+
state?: "loading" | "success" | "failure" | undefined;
|
|
269
267
|
data?: Record<string, import("@trigger.dev/core").SerializableJson> | undefined;
|
|
270
|
-
state?: "success" | "loading" | "failure" | undefined;
|
|
271
268
|
}[];
|
|
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
|
+
};
|
|
272
274
|
}>;
|
|
273
275
|
invokeJob(jobId: string, payload: any, options?: InvokeOptions): Promise<{
|
|
274
276
|
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[];
|
|
24
25
|
id: string;
|
|
25
|
-
createdAt: Date;
|
|
26
26
|
title: string;
|
|
27
27
|
updatedAt: Date;
|
|
28
|
-
|
|
28
|
+
createdAt: Date;
|
|
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[];
|
|
39
40
|
id: string;
|
|
40
|
-
createdAt: Date;
|
|
41
41
|
title: string;
|
|
42
42
|
updatedAt: Date;
|
|
43
|
-
|
|
43
|
+
createdAt: Date;
|
|
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[];
|
|
72
73
|
id: string;
|
|
73
|
-
createdAt: Date;
|
|
74
74
|
title: string;
|
|
75
75
|
updatedAt: Date;
|
|
76
|
-
|
|
76
|
+
createdAt: Date;
|
|
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[];
|
|
89
90
|
id: string;
|
|
90
|
-
createdAt: Date;
|
|
91
91
|
title: string;
|
|
92
92
|
updatedAt: Date;
|
|
93
|
-
|
|
93
|
+
createdAt: Date;
|
|
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";
|
|
119
118
|
options: {
|
|
120
119
|
cron: string;
|
|
121
120
|
};
|
|
121
|
+
type: "cron";
|
|
122
122
|
metadata?: any;
|
|
123
123
|
accountId?: string | undefined;
|
|
124
124
|
} | {
|
|
125
|
-
type: "interval";
|
|
126
125
|
options: {
|
|
127
126
|
seconds: number;
|
|
128
127
|
};
|
|
128
|
+
type: "interval";
|
|
129
129
|
metadata?: any;
|
|
130
130
|
accountId?: string | undefined;
|
|
131
131
|
};
|
|
@@ -11,7 +11,7 @@ export * from "./idempotencyKeys.js";
|
|
|
11
11
|
export * from "./tags.js";
|
|
12
12
|
export * from "./metadata.js";
|
|
13
13
|
export * from "./timeout.js";
|
|
14
|
-
export * from "./
|
|
14
|
+
export * from "./webhooks.js";
|
|
15
15
|
export type { Context };
|
|
16
16
|
import type { Context } from "./shared.js";
|
|
17
17
|
import type { ApiClientConfiguration } from "@trigger.dev/core/v3";
|
|
@@ -42,7 +42,7 @@ __exportStar(require("./idempotencyKeys.js"), exports);
|
|
|
42
42
|
__exportStar(require("./tags.js"), exports);
|
|
43
43
|
__exportStar(require("./metadata.js"), exports);
|
|
44
44
|
__exportStar(require("./timeout.js"), exports);
|
|
45
|
-
__exportStar(require("./
|
|
45
|
+
__exportStar(require("./webhooks.js"), exports);
|
|
46
46
|
var v3_1 = require("@trigger.dev/core/v3");
|
|
47
47
|
Object.defineProperty(exports, "ApiError", { enumerable: true, get: function () { return v3_1.ApiError; } });
|
|
48
48
|
Object.defineProperty(exports, "AuthenticationError", { enumerable: true, get: function () { return v3_1.AuthenticationError; } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/v3/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,8CAA4B;AAC5B,uCAAsD;AAA7C,iGAAA,KAAK,OAAA;AACd,yCAAoC;AAA3B,kGAAA,KAAK,OAAA;AACd,6CAA2B;AAC3B,6CAA2B;AAC3B,4CAA0B;AAC1B,iDAA+B;AAC/B,6CAA2B;AAC3B,uDAAqC;AACrC,4CAA0B;AAC1B,gDAA8B;AAC9B,+CAA6B;AAC7B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/v3/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,8CAA4B;AAC5B,uCAAsD;AAA7C,iGAAA,KAAK,OAAA;AACd,yCAAoC;AAA3B,kGAAA,KAAK,OAAA;AACd,6CAA2B;AAC3B,6CAA2B;AAC3B,4CAA0B;AAC1B,iDAA+B;AAC/B,6CAA2B;AAC3B,uDAAqC;AACrC,4CAA0B;AAC1B,gDAA8B;AAC9B,+CAA6B;AAC7B,gDAA8B;AAS9B,2CAc8B;AAb5B,8FAAA,QAAQ,OAAA;AACR,yGAAA,mBAAmB,OAAA;AACnB,qGAAA,eAAe,OAAA;AACf,mGAAA,aAAa,OAAA;AACb,yGAAA,mBAAmB,OAAA;AACnB,mGAAA,aAAa,OAAA;AACb,2GAAA,qBAAqB,OAAA;AACrB,oGAAA,cAAc,OAAA;AACd,8GAAA,wBAAwB,OAAA;AACxB,uGAAA,iBAAiB,OAAA;AACjB,sGAAA,gBAAgB,OAAA;AAChB,4FAAA,MAAM,OAAA;AAIR,qCASmB;AARjB,+FAAA,IAAI,OAAA;AASN,kEAAkD;AAClD,wDAAwC;AAGxC,qCAA4C;AAAnC,oGAAA,SAAS,OAAA;AAAE,+FAAA,IAAI,OAAA"}
|
|
@@ -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
|
-
|
|
32
|
-
id: string;
|
|
33
|
-
error?: {
|
|
34
|
-
message: string;
|
|
35
|
-
stackTrace?: string | undefined;
|
|
36
|
-
name?: string | undefined;
|
|
37
|
-
} | undefined;
|
|
38
|
-
idempotencyKey?: string | undefined;
|
|
39
|
-
startedAt?: Date | undefined;
|
|
40
|
-
updatedAt: Date;
|
|
41
|
-
isTest: boolean;
|
|
31
|
+
tags: string[];
|
|
42
32
|
version?: string | undefined;
|
|
43
|
-
|
|
44
|
-
|
|
33
|
+
status: "WAITING_FOR_DEPLOY" | "QUEUED" | "EXECUTING" | "REATTEMPTING" | "FROZEN" | "COMPLETED" | "CANCELED" | "FAILED" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED" | "TIMED_OUT";
|
|
34
|
+
taskIdentifier: string;
|
|
45
35
|
schedule?: {
|
|
46
36
|
id: string;
|
|
47
37
|
generator: {
|
|
@@ -52,15 +42,17 @@ declare function poll<TRunId extends AnyRunHandle | AnyTask | string>(runId: Run
|
|
|
52
42
|
externalId?: string | undefined;
|
|
53
43
|
deduplicationKey?: string | undefined;
|
|
54
44
|
} | undefined;
|
|
55
|
-
|
|
56
|
-
|
|
45
|
+
isTest: boolean;
|
|
46
|
+
id: string;
|
|
47
|
+
createdAt: Date;
|
|
57
48
|
durationMs: number;
|
|
58
49
|
costInCents: number;
|
|
59
50
|
baseCostInCents: number;
|
|
51
|
+
attemptCount: number;
|
|
60
52
|
relatedRuns: {
|
|
61
53
|
root?: {
|
|
62
|
-
id: string;
|
|
63
54
|
status: "WAITING_FOR_DEPLOY" | "QUEUED" | "EXECUTING" | "REATTEMPTING" | "FROZEN" | "COMPLETED" | "CANCELED" | "FAILED" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED" | "TIMED_OUT";
|
|
55
|
+
id: string;
|
|
64
56
|
tags: string[];
|
|
65
57
|
isTest: boolean;
|
|
66
58
|
createdAt: Date;
|
|
@@ -77,9 +69,9 @@ declare function poll<TRunId extends AnyRunHandle | AnyTask | string>(runId: Run
|
|
|
77
69
|
isFailed: boolean;
|
|
78
70
|
isCancelled: boolean;
|
|
79
71
|
updatedAt: Date;
|
|
80
|
-
version?: string | undefined;
|
|
81
72
|
startedAt?: Date | undefined;
|
|
82
73
|
idempotencyKey?: string | undefined;
|
|
74
|
+
version?: string | undefined;
|
|
83
75
|
metadata?: Record<string, any> | undefined;
|
|
84
76
|
ttl?: string | undefined;
|
|
85
77
|
batchId?: string | undefined;
|
|
@@ -88,8 +80,8 @@ declare function poll<TRunId extends AnyRunHandle | AnyTask | string>(runId: Run
|
|
|
88
80
|
expiredAt?: Date | undefined;
|
|
89
81
|
} | undefined;
|
|
90
82
|
parent?: {
|
|
91
|
-
id: string;
|
|
92
83
|
status: "WAITING_FOR_DEPLOY" | "QUEUED" | "EXECUTING" | "REATTEMPTING" | "FROZEN" | "COMPLETED" | "CANCELED" | "FAILED" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED" | "TIMED_OUT";
|
|
84
|
+
id: string;
|
|
93
85
|
tags: string[];
|
|
94
86
|
isTest: boolean;
|
|
95
87
|
createdAt: Date;
|
|
@@ -106,9 +98,9 @@ declare function poll<TRunId extends AnyRunHandle | AnyTask | string>(runId: Run
|
|
|
106
98
|
isFailed: boolean;
|
|
107
99
|
isCancelled: boolean;
|
|
108
100
|
updatedAt: Date;
|
|
109
|
-
version?: string | undefined;
|
|
110
101
|
startedAt?: Date | undefined;
|
|
111
102
|
idempotencyKey?: string | undefined;
|
|
103
|
+
version?: string | undefined;
|
|
112
104
|
metadata?: Record<string, any> | undefined;
|
|
113
105
|
ttl?: string | undefined;
|
|
114
106
|
batchId?: string | undefined;
|
|
@@ -117,8 +109,8 @@ declare function poll<TRunId extends AnyRunHandle | AnyTask | string>(runId: Run
|
|
|
117
109
|
expiredAt?: Date | undefined;
|
|
118
110
|
} | undefined;
|
|
119
111
|
children?: {
|
|
120
|
-
id: string;
|
|
121
112
|
status: "WAITING_FOR_DEPLOY" | "QUEUED" | "EXECUTING" | "REATTEMPTING" | "FROZEN" | "COMPLETED" | "CANCELED" | "FAILED" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED" | "TIMED_OUT";
|
|
113
|
+
id: string;
|
|
122
114
|
tags: string[];
|
|
123
115
|
isTest: boolean;
|
|
124
116
|
createdAt: Date;
|
|
@@ -135,9 +127,9 @@ declare function poll<TRunId extends AnyRunHandle | AnyTask | string>(runId: Run
|
|
|
135
127
|
isFailed: boolean;
|
|
136
128
|
isCancelled: boolean;
|
|
137
129
|
updatedAt: Date;
|
|
138
|
-
version?: string | undefined;
|
|
139
130
|
startedAt?: Date | undefined;
|
|
140
131
|
idempotencyKey?: string | undefined;
|
|
132
|
+
version?: string | undefined;
|
|
141
133
|
metadata?: Record<string, any> | undefined;
|
|
142
134
|
ttl?: string | undefined;
|
|
143
135
|
batchId?: string | undefined;
|
|
@@ -154,20 +146,28 @@ declare function poll<TRunId extends AnyRunHandle | AnyTask | string>(runId: Run
|
|
|
154
146
|
isSuccess: boolean;
|
|
155
147
|
isFailed: boolean;
|
|
156
148
|
isCancelled: boolean;
|
|
149
|
+
updatedAt: Date;
|
|
157
150
|
attempts: ({
|
|
158
|
-
id: string;
|
|
159
151
|
status: "EXECUTING" | "COMPLETED" | "CANCELED" | "FAILED" | "PENDING" | "PAUSED";
|
|
152
|
+
id: string;
|
|
160
153
|
createdAt: Date;
|
|
161
154
|
updatedAt: Date;
|
|
162
155
|
startedAt?: Date | undefined;
|
|
163
156
|
error?: {
|
|
164
157
|
message: string;
|
|
165
|
-
stackTrace?: string | undefined;
|
|
166
158
|
name?: string | undefined;
|
|
159
|
+
stackTrace?: string | undefined;
|
|
167
160
|
} | undefined;
|
|
168
161
|
completedAt?: Date | undefined;
|
|
169
162
|
} | undefined)[];
|
|
170
|
-
|
|
163
|
+
startedAt?: Date | undefined;
|
|
164
|
+
idempotencyKey?: string | undefined;
|
|
165
|
+
metadata?: Record<string, any> | undefined;
|
|
166
|
+
error?: {
|
|
167
|
+
message: string;
|
|
168
|
+
name?: string | undefined;
|
|
169
|
+
stackTrace?: string | undefined;
|
|
170
|
+
} | undefined;
|
|
171
171
|
ttl?: string | undefined;
|
|
172
172
|
payloadPresignedUrl?: string | undefined;
|
|
173
173
|
outputPresignedUrl?: string | undefined;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Webhook } from "@trigger.dev/core/v3";
|
|
2
|
+
/**
|
|
3
|
+
* The type of error thrown when a webhook fails to parse or verify
|
|
4
|
+
*/
|
|
5
|
+
export declare class WebhookError extends Error {
|
|
6
|
+
constructor(message: string);
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Options for constructing a webhook event
|
|
10
|
+
*/
|
|
11
|
+
type ConstructEventOptions = {
|
|
12
|
+
/** Raw payload as string or Buffer */
|
|
13
|
+
payload: string | Buffer;
|
|
14
|
+
/** Signature header as string, Buffer, or string array */
|
|
15
|
+
header: string | Buffer | Array<string>;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Interface describing the webhook utilities
|
|
19
|
+
*/
|
|
20
|
+
interface Webhooks {
|
|
21
|
+
/**
|
|
22
|
+
* Constructs and validates a webhook event from an incoming request
|
|
23
|
+
* @param request - Either a Request object or ConstructEventOptions containing the payload and signature
|
|
24
|
+
* @param secret - Secret key used to verify the webhook signature
|
|
25
|
+
* @returns Promise resolving to a validated AlertWebhook object
|
|
26
|
+
* @throws {WebhookError} If validation fails or payload can't be parsed
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* // Using with Request object
|
|
30
|
+
* const event = await webhooks.constructEvent(request, "webhook_secret");
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* // Using with manual options
|
|
34
|
+
* const event = await webhooks.constructEvent({
|
|
35
|
+
* payload: rawBody,
|
|
36
|
+
* header: signatureHeader
|
|
37
|
+
* }, "webhook_secret");
|
|
38
|
+
*/
|
|
39
|
+
constructEvent(request: ConstructEventOptions | Request, secret: string): Promise<Webhook>;
|
|
40
|
+
/** Header name used for webhook signatures */
|
|
41
|
+
SIGNATURE_HEADER_NAME: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Webhook utilities for handling incoming webhook requests
|
|
45
|
+
*/
|
|
46
|
+
export declare const webhooks: Webhooks;
|
|
47
|
+
export {};
|