@trigger.dev/sdk 4.8.0-webhooks.20261015065339 → 4.8.0
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/v3/ai.d.ts +69 -2
- package/dist/commonjs/v3/ai.js +120 -30
- package/dist/commonjs/v3/ai.js.map +1 -1
- package/dist/commonjs/v3/query.d.ts +434 -1
- package/dist/commonjs/v3/query.js +115 -0
- package/dist/commonjs/v3/query.js.map +1 -1
- package/dist/commonjs/v3/webhooks.d.ts +19 -5
- package/dist/commonjs/v3/webhooks.js +19 -2
- package/dist/commonjs/v3/webhooks.js.map +1 -1
- package/dist/commonjs/version.js +1 -1
- package/dist/esm/v3/ai.d.ts +69 -2
- package/dist/esm/v3/ai.js +119 -29
- package/dist/esm/v3/ai.js.map +1 -1
- package/dist/esm/v3/query.d.ts +434 -1
- package/dist/esm/v3/query.js +115 -0
- package/dist/esm/v3/query.js.map +1 -1
- package/dist/esm/v3/webhooks.d.ts +19 -5
- package/dist/esm/v3/webhooks.js +19 -2
- package/dist/esm/v3/webhooks.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/docs/ai-chat/backend.mdx +12 -3
- package/docs/ai-chat/client-protocol.mdx +6 -3
- package/docs/ai-chat/patterns/redacting-telemetry.mdx +117 -0
- package/docs/ai-chat/reference.mdx +3 -0
- package/docs/ai-chat/transcript-storage.mdx +1 -1
- package/docs/apikeys.mdx +6 -4
- package/docs/cli-runs-commands.mdx +2 -2
- package/docs/cli-tasks-commands.mdx +95 -0
- package/docs/config/config-file.mdx +58 -0
- package/docs/config/extensions/prismaExtension.mdx +4 -4
- package/docs/deploy-environment-variables.mdx +23 -0
- package/docs/deployment/atomic-deployment.mdx +3 -3
- package/docs/deployment/overview.mdx +1 -1
- package/docs/deployment/preview-branches.mdx +1 -1
- package/docs/github-actions.mdx +3 -3
- package/docs/limits.mdx +6 -0
- package/docs/manual-setup.mdx +1 -1
- package/docs/mcp-tools.mdx +19 -3
- package/docs/observability/dashboards.mdx +62 -0
- package/docs/runs/max-duration.mdx +4 -0
- package/docs/self-hosting/env/supervisor.mdx +1 -0
- package/docs/webhooks/channels.mdx +31 -5
- package/docs/webhooks/connect.mdx +14 -3
- package/docs/webhooks/deliveries.mdx +8 -1
- package/docs/webhooks/filters.mdx +39 -2
- package/docs/webhooks/human-in-the-loop.mdx +11 -2
- package/docs/webhooks/linear.mdx +5 -4
- package/docs/webhooks/overview.mdx +16 -0
- package/docs/webhooks/session-routing.mdx +11 -2
- package/docs/webhooks/slack.mdx +51 -18
- package/docs/webhooks/sources.mdx +36 -3
- package/docs/webhooks/waiters.mdx +22 -2
- package/package.json +3 -2
package/dist/esm/v3/query.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { ApiRequestOptions, Prettify } from "@trigger.dev/core/v3";
|
|
1
|
+
import type { AddDashboardWidgetRequestBody, ApiRequestOptions, CreateDashboardRequestBody, Prettify, ReplaceDashboardRequestBody, UpdateDashboardRequestBody, UpdateDashboardWidgetRequestBody } from "@trigger.dev/core/v3";
|
|
2
2
|
export type { QueryTable, RunsTableRow, RunFriendlyStatus } from "@trigger.dev/core/v3";
|
|
3
|
+
export type { DashboardObject, DashboardSummary, DashboardWidget, DashboardWidgetDisplay, DashboardWidgetInput, DashboardWidgetPosition, } from "@trigger.dev/core/v3";
|
|
3
4
|
export type QueryScope = "environment" | "project" | "organization";
|
|
4
5
|
export type QueryFormat = "json" | "csv";
|
|
5
6
|
/**
|
|
@@ -107,6 +108,438 @@ declare function execute<TRow extends Record<string, any> = Record<string, any>>
|
|
|
107
108
|
format: "json";
|
|
108
109
|
results: Array<Prettify<TRow>>;
|
|
109
110
|
}>;
|
|
111
|
+
/**
|
|
112
|
+
* Lists the built-in dashboards and your organization's custom dashboards, with their widgets.
|
|
113
|
+
*/
|
|
114
|
+
declare function listDashboards(requestOptions?: ApiRequestOptions): Promise<{
|
|
115
|
+
dashboards: {
|
|
116
|
+
key: string;
|
|
117
|
+
title: string;
|
|
118
|
+
type?: "builtIn" | "custom" | undefined;
|
|
119
|
+
description?: string | undefined;
|
|
120
|
+
widgets: {
|
|
121
|
+
id: string;
|
|
122
|
+
title: string;
|
|
123
|
+
query: string;
|
|
124
|
+
type: "bignumber" | "chart" | "table" | "title";
|
|
125
|
+
}[];
|
|
126
|
+
}[];
|
|
127
|
+
}>;
|
|
128
|
+
/**
|
|
129
|
+
* Retrieves a custom dashboard, including every widget, its query and its grid position.
|
|
130
|
+
*/
|
|
131
|
+
declare function retrieveDashboard(dashboardId: string, requestOptions?: ApiRequestOptions): import("@trigger.dev/core/v3").ApiPromise<{
|
|
132
|
+
id: string;
|
|
133
|
+
title: string;
|
|
134
|
+
description: string;
|
|
135
|
+
revision: string;
|
|
136
|
+
createdAt: Date;
|
|
137
|
+
updatedAt: Date;
|
|
138
|
+
widgets: {
|
|
139
|
+
id: string;
|
|
140
|
+
title: string;
|
|
141
|
+
query: string;
|
|
142
|
+
display: {
|
|
143
|
+
type: "table";
|
|
144
|
+
prettyFormatting: boolean;
|
|
145
|
+
sorting: {
|
|
146
|
+
desc: boolean;
|
|
147
|
+
id: string;
|
|
148
|
+
}[];
|
|
149
|
+
} | {
|
|
150
|
+
chartType: "bar" | "line";
|
|
151
|
+
xAxisColumn: string | null;
|
|
152
|
+
yAxisColumns: string[];
|
|
153
|
+
groupByColumn: string | null;
|
|
154
|
+
stacked: boolean;
|
|
155
|
+
sortByColumn: string | null;
|
|
156
|
+
sortDirection: "asc" | "desc";
|
|
157
|
+
aggregation: "avg" | "count" | "max" | "min" | "sum";
|
|
158
|
+
seriesColors?: Record<string, string> | undefined;
|
|
159
|
+
type: "chart";
|
|
160
|
+
} | {
|
|
161
|
+
column: string;
|
|
162
|
+
aggregation: "avg" | "count" | "first" | "last" | "max" | "min" | "sum";
|
|
163
|
+
sortDirection?: "asc" | "desc" | undefined;
|
|
164
|
+
abbreviate: boolean;
|
|
165
|
+
prefix?: string | undefined;
|
|
166
|
+
suffix?: string | undefined;
|
|
167
|
+
type: "bignumber";
|
|
168
|
+
} | {
|
|
169
|
+
type: "title";
|
|
170
|
+
};
|
|
171
|
+
fillGaps?: boolean | undefined;
|
|
172
|
+
position: {
|
|
173
|
+
x: number;
|
|
174
|
+
y: number;
|
|
175
|
+
w: number;
|
|
176
|
+
h: number;
|
|
177
|
+
};
|
|
178
|
+
}[];
|
|
179
|
+
}>;
|
|
180
|
+
/**
|
|
181
|
+
* Creates a custom dashboard, optionally with its widgets.
|
|
182
|
+
*
|
|
183
|
+
* @example
|
|
184
|
+
* ```ts
|
|
185
|
+
* const dashboard = await query.dashboards.create({
|
|
186
|
+
* title: "Email tasks",
|
|
187
|
+
* widgets: [
|
|
188
|
+
* {
|
|
189
|
+
* title: "Runs per day",
|
|
190
|
+
* query: "SELECT timeBucket(), count() AS runs FROM runs GROUP BY timeBucket ORDER BY timeBucket",
|
|
191
|
+
* display: {
|
|
192
|
+
* type: "chart",
|
|
193
|
+
* chartType: "bar",
|
|
194
|
+
* xAxisColumn: "timebucket",
|
|
195
|
+
* yAxisColumns: ["runs"],
|
|
196
|
+
* groupByColumn: null,
|
|
197
|
+
* stacked: false,
|
|
198
|
+
* sortByColumn: null,
|
|
199
|
+
* sortDirection: "asc",
|
|
200
|
+
* aggregation: "sum",
|
|
201
|
+
* },
|
|
202
|
+
* },
|
|
203
|
+
* ],
|
|
204
|
+
* });
|
|
205
|
+
* ```
|
|
206
|
+
*/
|
|
207
|
+
declare function createDashboard(body: CreateDashboardRequestBody, requestOptions?: ApiRequestOptions): import("@trigger.dev/core/v3").ApiPromise<{
|
|
208
|
+
id: string;
|
|
209
|
+
title: string;
|
|
210
|
+
description: string;
|
|
211
|
+
revision: string;
|
|
212
|
+
createdAt: Date;
|
|
213
|
+
updatedAt: Date;
|
|
214
|
+
widgets: {
|
|
215
|
+
id: string;
|
|
216
|
+
title: string;
|
|
217
|
+
query: string;
|
|
218
|
+
display: {
|
|
219
|
+
type: "table";
|
|
220
|
+
prettyFormatting: boolean;
|
|
221
|
+
sorting: {
|
|
222
|
+
desc: boolean;
|
|
223
|
+
id: string;
|
|
224
|
+
}[];
|
|
225
|
+
} | {
|
|
226
|
+
chartType: "bar" | "line";
|
|
227
|
+
xAxisColumn: string | null;
|
|
228
|
+
yAxisColumns: string[];
|
|
229
|
+
groupByColumn: string | null;
|
|
230
|
+
stacked: boolean;
|
|
231
|
+
sortByColumn: string | null;
|
|
232
|
+
sortDirection: "asc" | "desc";
|
|
233
|
+
aggregation: "avg" | "count" | "max" | "min" | "sum";
|
|
234
|
+
seriesColors?: Record<string, string> | undefined;
|
|
235
|
+
type: "chart";
|
|
236
|
+
} | {
|
|
237
|
+
column: string;
|
|
238
|
+
aggregation: "avg" | "count" | "first" | "last" | "max" | "min" | "sum";
|
|
239
|
+
sortDirection?: "asc" | "desc" | undefined;
|
|
240
|
+
abbreviate: boolean;
|
|
241
|
+
prefix?: string | undefined;
|
|
242
|
+
suffix?: string | undefined;
|
|
243
|
+
type: "bignumber";
|
|
244
|
+
} | {
|
|
245
|
+
type: "title";
|
|
246
|
+
};
|
|
247
|
+
fillGaps?: boolean | undefined;
|
|
248
|
+
position: {
|
|
249
|
+
x: number;
|
|
250
|
+
y: number;
|
|
251
|
+
w: number;
|
|
252
|
+
h: number;
|
|
253
|
+
};
|
|
254
|
+
}[];
|
|
255
|
+
}>;
|
|
256
|
+
/**
|
|
257
|
+
* Renames a custom dashboard or changes its description.
|
|
258
|
+
*/
|
|
259
|
+
declare function updateDashboard(dashboardId: string, body: UpdateDashboardRequestBody, requestOptions?: ApiRequestOptions): import("@trigger.dev/core/v3").ApiPromise<{
|
|
260
|
+
id: string;
|
|
261
|
+
title: string;
|
|
262
|
+
description: string;
|
|
263
|
+
revision: string;
|
|
264
|
+
createdAt: Date;
|
|
265
|
+
updatedAt: Date;
|
|
266
|
+
widgets: {
|
|
267
|
+
id: string;
|
|
268
|
+
title: string;
|
|
269
|
+
query: string;
|
|
270
|
+
display: {
|
|
271
|
+
type: "table";
|
|
272
|
+
prettyFormatting: boolean;
|
|
273
|
+
sorting: {
|
|
274
|
+
desc: boolean;
|
|
275
|
+
id: string;
|
|
276
|
+
}[];
|
|
277
|
+
} | {
|
|
278
|
+
chartType: "bar" | "line";
|
|
279
|
+
xAxisColumn: string | null;
|
|
280
|
+
yAxisColumns: string[];
|
|
281
|
+
groupByColumn: string | null;
|
|
282
|
+
stacked: boolean;
|
|
283
|
+
sortByColumn: string | null;
|
|
284
|
+
sortDirection: "asc" | "desc";
|
|
285
|
+
aggregation: "avg" | "count" | "max" | "min" | "sum";
|
|
286
|
+
seriesColors?: Record<string, string> | undefined;
|
|
287
|
+
type: "chart";
|
|
288
|
+
} | {
|
|
289
|
+
column: string;
|
|
290
|
+
aggregation: "avg" | "count" | "first" | "last" | "max" | "min" | "sum";
|
|
291
|
+
sortDirection?: "asc" | "desc" | undefined;
|
|
292
|
+
abbreviate: boolean;
|
|
293
|
+
prefix?: string | undefined;
|
|
294
|
+
suffix?: string | undefined;
|
|
295
|
+
type: "bignumber";
|
|
296
|
+
} | {
|
|
297
|
+
type: "title";
|
|
298
|
+
};
|
|
299
|
+
fillGaps?: boolean | undefined;
|
|
300
|
+
position: {
|
|
301
|
+
x: number;
|
|
302
|
+
y: number;
|
|
303
|
+
w: number;
|
|
304
|
+
h: number;
|
|
305
|
+
};
|
|
306
|
+
}[];
|
|
307
|
+
}>;
|
|
308
|
+
/**
|
|
309
|
+
* Replaces every widget on a custom dashboard. A widget that already exists keeps its position
|
|
310
|
+
* unless you pass a new one; new widgets without a `position` are placed full width below the others,
|
|
311
|
+
* in order. Pass the `revision` you last read to reject the write if someone else changed the
|
|
312
|
+
* dashboard in the meantime.
|
|
313
|
+
*/
|
|
314
|
+
declare function replaceDashboard(dashboardId: string, body: ReplaceDashboardRequestBody, requestOptions?: ApiRequestOptions): import("@trigger.dev/core/v3").ApiPromise<{
|
|
315
|
+
id: string;
|
|
316
|
+
title: string;
|
|
317
|
+
description: string;
|
|
318
|
+
revision: string;
|
|
319
|
+
createdAt: Date;
|
|
320
|
+
updatedAt: Date;
|
|
321
|
+
widgets: {
|
|
322
|
+
id: string;
|
|
323
|
+
title: string;
|
|
324
|
+
query: string;
|
|
325
|
+
display: {
|
|
326
|
+
type: "table";
|
|
327
|
+
prettyFormatting: boolean;
|
|
328
|
+
sorting: {
|
|
329
|
+
desc: boolean;
|
|
330
|
+
id: string;
|
|
331
|
+
}[];
|
|
332
|
+
} | {
|
|
333
|
+
chartType: "bar" | "line";
|
|
334
|
+
xAxisColumn: string | null;
|
|
335
|
+
yAxisColumns: string[];
|
|
336
|
+
groupByColumn: string | null;
|
|
337
|
+
stacked: boolean;
|
|
338
|
+
sortByColumn: string | null;
|
|
339
|
+
sortDirection: "asc" | "desc";
|
|
340
|
+
aggregation: "avg" | "count" | "max" | "min" | "sum";
|
|
341
|
+
seriesColors?: Record<string, string> | undefined;
|
|
342
|
+
type: "chart";
|
|
343
|
+
} | {
|
|
344
|
+
column: string;
|
|
345
|
+
aggregation: "avg" | "count" | "first" | "last" | "max" | "min" | "sum";
|
|
346
|
+
sortDirection?: "asc" | "desc" | undefined;
|
|
347
|
+
abbreviate: boolean;
|
|
348
|
+
prefix?: string | undefined;
|
|
349
|
+
suffix?: string | undefined;
|
|
350
|
+
type: "bignumber";
|
|
351
|
+
} | {
|
|
352
|
+
type: "title";
|
|
353
|
+
};
|
|
354
|
+
fillGaps?: boolean | undefined;
|
|
355
|
+
position: {
|
|
356
|
+
x: number;
|
|
357
|
+
y: number;
|
|
358
|
+
w: number;
|
|
359
|
+
h: number;
|
|
360
|
+
};
|
|
361
|
+
}[];
|
|
362
|
+
}>;
|
|
363
|
+
/**
|
|
364
|
+
* Deletes a custom dashboard.
|
|
365
|
+
*/
|
|
366
|
+
declare function deleteDashboard(dashboardId: string, requestOptions?: ApiRequestOptions): import("@trigger.dev/core/v3").ApiPromise<{
|
|
367
|
+
id: string;
|
|
368
|
+
}>;
|
|
369
|
+
/**
|
|
370
|
+
* Adds a widget to a custom dashboard. Without a `position` it is placed full width at the bottom.
|
|
371
|
+
*/
|
|
372
|
+
declare function addDashboardWidget(dashboardId: string, body: AddDashboardWidgetRequestBody, requestOptions?: ApiRequestOptions): import("@trigger.dev/core/v3").ApiPromise<{
|
|
373
|
+
widgetId: string;
|
|
374
|
+
dashboard: {
|
|
375
|
+
id: string;
|
|
376
|
+
title: string;
|
|
377
|
+
description: string;
|
|
378
|
+
revision: string;
|
|
379
|
+
createdAt: Date;
|
|
380
|
+
updatedAt: Date;
|
|
381
|
+
widgets: {
|
|
382
|
+
id: string;
|
|
383
|
+
title: string;
|
|
384
|
+
query: string;
|
|
385
|
+
display: {
|
|
386
|
+
type: "table";
|
|
387
|
+
prettyFormatting: boolean;
|
|
388
|
+
sorting: {
|
|
389
|
+
desc: boolean;
|
|
390
|
+
id: string;
|
|
391
|
+
}[];
|
|
392
|
+
} | {
|
|
393
|
+
chartType: "bar" | "line";
|
|
394
|
+
xAxisColumn: string | null;
|
|
395
|
+
yAxisColumns: string[];
|
|
396
|
+
groupByColumn: string | null;
|
|
397
|
+
stacked: boolean;
|
|
398
|
+
sortByColumn: string | null;
|
|
399
|
+
sortDirection: "asc" | "desc";
|
|
400
|
+
aggregation: "avg" | "count" | "max" | "min" | "sum";
|
|
401
|
+
seriesColors?: Record<string, string> | undefined;
|
|
402
|
+
type: "chart";
|
|
403
|
+
} | {
|
|
404
|
+
column: string;
|
|
405
|
+
aggregation: "avg" | "count" | "first" | "last" | "max" | "min" | "sum";
|
|
406
|
+
sortDirection?: "asc" | "desc" | undefined;
|
|
407
|
+
abbreviate: boolean;
|
|
408
|
+
prefix?: string | undefined;
|
|
409
|
+
suffix?: string | undefined;
|
|
410
|
+
type: "bignumber";
|
|
411
|
+
} | {
|
|
412
|
+
type: "title";
|
|
413
|
+
};
|
|
414
|
+
fillGaps?: boolean | undefined;
|
|
415
|
+
position: {
|
|
416
|
+
x: number;
|
|
417
|
+
y: number;
|
|
418
|
+
w: number;
|
|
419
|
+
h: number;
|
|
420
|
+
};
|
|
421
|
+
}[];
|
|
422
|
+
};
|
|
423
|
+
}>;
|
|
424
|
+
/**
|
|
425
|
+
* Changes a widget's title, query, display, or position.
|
|
426
|
+
*/
|
|
427
|
+
declare function updateDashboardWidget(dashboardId: string, widgetId: string, body: UpdateDashboardWidgetRequestBody, requestOptions?: ApiRequestOptions): import("@trigger.dev/core/v3").ApiPromise<{
|
|
428
|
+
id: string;
|
|
429
|
+
title: string;
|
|
430
|
+
description: string;
|
|
431
|
+
revision: string;
|
|
432
|
+
createdAt: Date;
|
|
433
|
+
updatedAt: Date;
|
|
434
|
+
widgets: {
|
|
435
|
+
id: string;
|
|
436
|
+
title: string;
|
|
437
|
+
query: string;
|
|
438
|
+
display: {
|
|
439
|
+
type: "table";
|
|
440
|
+
prettyFormatting: boolean;
|
|
441
|
+
sorting: {
|
|
442
|
+
desc: boolean;
|
|
443
|
+
id: string;
|
|
444
|
+
}[];
|
|
445
|
+
} | {
|
|
446
|
+
chartType: "bar" | "line";
|
|
447
|
+
xAxisColumn: string | null;
|
|
448
|
+
yAxisColumns: string[];
|
|
449
|
+
groupByColumn: string | null;
|
|
450
|
+
stacked: boolean;
|
|
451
|
+
sortByColumn: string | null;
|
|
452
|
+
sortDirection: "asc" | "desc";
|
|
453
|
+
aggregation: "avg" | "count" | "max" | "min" | "sum";
|
|
454
|
+
seriesColors?: Record<string, string> | undefined;
|
|
455
|
+
type: "chart";
|
|
456
|
+
} | {
|
|
457
|
+
column: string;
|
|
458
|
+
aggregation: "avg" | "count" | "first" | "last" | "max" | "min" | "sum";
|
|
459
|
+
sortDirection?: "asc" | "desc" | undefined;
|
|
460
|
+
abbreviate: boolean;
|
|
461
|
+
prefix?: string | undefined;
|
|
462
|
+
suffix?: string | undefined;
|
|
463
|
+
type: "bignumber";
|
|
464
|
+
} | {
|
|
465
|
+
type: "title";
|
|
466
|
+
};
|
|
467
|
+
fillGaps?: boolean | undefined;
|
|
468
|
+
position: {
|
|
469
|
+
x: number;
|
|
470
|
+
y: number;
|
|
471
|
+
w: number;
|
|
472
|
+
h: number;
|
|
473
|
+
};
|
|
474
|
+
}[];
|
|
475
|
+
}>;
|
|
476
|
+
/**
|
|
477
|
+
* Removes a widget from a custom dashboard.
|
|
478
|
+
*/
|
|
479
|
+
declare function deleteDashboardWidget(dashboardId: string, widgetId: string, options?: {
|
|
480
|
+
revision?: string;
|
|
481
|
+
}, requestOptions?: ApiRequestOptions): import("@trigger.dev/core/v3").ApiPromise<{
|
|
482
|
+
id: string;
|
|
483
|
+
title: string;
|
|
484
|
+
description: string;
|
|
485
|
+
revision: string;
|
|
486
|
+
createdAt: Date;
|
|
487
|
+
updatedAt: Date;
|
|
488
|
+
widgets: {
|
|
489
|
+
id: string;
|
|
490
|
+
title: string;
|
|
491
|
+
query: string;
|
|
492
|
+
display: {
|
|
493
|
+
type: "table";
|
|
494
|
+
prettyFormatting: boolean;
|
|
495
|
+
sorting: {
|
|
496
|
+
desc: boolean;
|
|
497
|
+
id: string;
|
|
498
|
+
}[];
|
|
499
|
+
} | {
|
|
500
|
+
chartType: "bar" | "line";
|
|
501
|
+
xAxisColumn: string | null;
|
|
502
|
+
yAxisColumns: string[];
|
|
503
|
+
groupByColumn: string | null;
|
|
504
|
+
stacked: boolean;
|
|
505
|
+
sortByColumn: string | null;
|
|
506
|
+
sortDirection: "asc" | "desc";
|
|
507
|
+
aggregation: "avg" | "count" | "max" | "min" | "sum";
|
|
508
|
+
seriesColors?: Record<string, string> | undefined;
|
|
509
|
+
type: "chart";
|
|
510
|
+
} | {
|
|
511
|
+
column: string;
|
|
512
|
+
aggregation: "avg" | "count" | "first" | "last" | "max" | "min" | "sum";
|
|
513
|
+
sortDirection?: "asc" | "desc" | undefined;
|
|
514
|
+
abbreviate: boolean;
|
|
515
|
+
prefix?: string | undefined;
|
|
516
|
+
suffix?: string | undefined;
|
|
517
|
+
type: "bignumber";
|
|
518
|
+
} | {
|
|
519
|
+
type: "title";
|
|
520
|
+
};
|
|
521
|
+
fillGaps?: boolean | undefined;
|
|
522
|
+
position: {
|
|
523
|
+
x: number;
|
|
524
|
+
y: number;
|
|
525
|
+
w: number;
|
|
526
|
+
h: number;
|
|
527
|
+
};
|
|
528
|
+
}[];
|
|
529
|
+
}>;
|
|
110
530
|
export declare const query: {
|
|
111
531
|
execute: typeof execute;
|
|
532
|
+
dashboards: {
|
|
533
|
+
list: typeof listDashboards;
|
|
534
|
+
retrieve: typeof retrieveDashboard;
|
|
535
|
+
create: typeof createDashboard;
|
|
536
|
+
update: typeof updateDashboard;
|
|
537
|
+
replace: typeof replaceDashboard;
|
|
538
|
+
del: typeof deleteDashboard;
|
|
539
|
+
widgets: {
|
|
540
|
+
add: typeof addDashboardWidget;
|
|
541
|
+
update: typeof updateDashboardWidget;
|
|
542
|
+
del: typeof deleteDashboardWidget;
|
|
543
|
+
};
|
|
544
|
+
};
|
|
112
545
|
};
|
package/dist/esm/v3/query.js
CHANGED
|
@@ -39,7 +39,122 @@ function dateToISOString(date) {
|
|
|
39
39
|
}
|
|
40
40
|
return new Date(date).toISOString();
|
|
41
41
|
}
|
|
42
|
+
function dashboardRequestOptions(name, attributes, requestOptions) {
|
|
43
|
+
return mergeRequestOptions({ tracer, name, icon: "query", attributes }, requestOptions);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Lists the built-in dashboards and your organization's custom dashboards, with their widgets.
|
|
47
|
+
*/
|
|
48
|
+
function listDashboards(requestOptions) {
|
|
49
|
+
return apiClientManager
|
|
50
|
+
.clientOrThrow()
|
|
51
|
+
.listDashboards(dashboardRequestOptions("query.dashboards.list()", {}, requestOptions));
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Retrieves a custom dashboard, including every widget, its query and its grid position.
|
|
55
|
+
*/
|
|
56
|
+
function retrieveDashboard(dashboardId, requestOptions) {
|
|
57
|
+
return apiClientManager
|
|
58
|
+
.clientOrThrow()
|
|
59
|
+
.retrieveDashboard(dashboardId, dashboardRequestOptions("query.dashboards.retrieve()", { dashboardId }, requestOptions));
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Creates a custom dashboard, optionally with its widgets.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```ts
|
|
66
|
+
* const dashboard = await query.dashboards.create({
|
|
67
|
+
* title: "Email tasks",
|
|
68
|
+
* widgets: [
|
|
69
|
+
* {
|
|
70
|
+
* title: "Runs per day",
|
|
71
|
+
* query: "SELECT timeBucket(), count() AS runs FROM runs GROUP BY timeBucket ORDER BY timeBucket",
|
|
72
|
+
* display: {
|
|
73
|
+
* type: "chart",
|
|
74
|
+
* chartType: "bar",
|
|
75
|
+
* xAxisColumn: "timebucket",
|
|
76
|
+
* yAxisColumns: ["runs"],
|
|
77
|
+
* groupByColumn: null,
|
|
78
|
+
* stacked: false,
|
|
79
|
+
* sortByColumn: null,
|
|
80
|
+
* sortDirection: "asc",
|
|
81
|
+
* aggregation: "sum",
|
|
82
|
+
* },
|
|
83
|
+
* },
|
|
84
|
+
* ],
|
|
85
|
+
* });
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
function createDashboard(body, requestOptions) {
|
|
89
|
+
return apiClientManager
|
|
90
|
+
.clientOrThrow()
|
|
91
|
+
.createDashboard(body, dashboardRequestOptions("query.dashboards.create()", { title: body.title }, requestOptions));
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Renames a custom dashboard or changes its description.
|
|
95
|
+
*/
|
|
96
|
+
function updateDashboard(dashboardId, body, requestOptions) {
|
|
97
|
+
return apiClientManager
|
|
98
|
+
.clientOrThrow()
|
|
99
|
+
.updateDashboard(dashboardId, body, dashboardRequestOptions("query.dashboards.update()", { dashboardId }, requestOptions));
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Replaces every widget on a custom dashboard. A widget that already exists keeps its position
|
|
103
|
+
* unless you pass a new one; new widgets without a `position` are placed full width below the others,
|
|
104
|
+
* in order. Pass the `revision` you last read to reject the write if someone else changed the
|
|
105
|
+
* dashboard in the meantime.
|
|
106
|
+
*/
|
|
107
|
+
function replaceDashboard(dashboardId, body, requestOptions) {
|
|
108
|
+
return apiClientManager
|
|
109
|
+
.clientOrThrow()
|
|
110
|
+
.replaceDashboard(dashboardId, body, dashboardRequestOptions("query.dashboards.replace()", { dashboardId }, requestOptions));
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Deletes a custom dashboard.
|
|
114
|
+
*/
|
|
115
|
+
function deleteDashboard(dashboardId, requestOptions) {
|
|
116
|
+
return apiClientManager
|
|
117
|
+
.clientOrThrow()
|
|
118
|
+
.deleteDashboard(dashboardId, dashboardRequestOptions("query.dashboards.del()", { dashboardId }, requestOptions));
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Adds a widget to a custom dashboard. Without a `position` it is placed full width at the bottom.
|
|
122
|
+
*/
|
|
123
|
+
function addDashboardWidget(dashboardId, body, requestOptions) {
|
|
124
|
+
return apiClientManager
|
|
125
|
+
.clientOrThrow()
|
|
126
|
+
.addDashboardWidget(dashboardId, body, dashboardRequestOptions("query.dashboards.widgets.add()", { dashboardId }, requestOptions));
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Changes a widget's title, query, display, or position.
|
|
130
|
+
*/
|
|
131
|
+
function updateDashboardWidget(dashboardId, widgetId, body, requestOptions) {
|
|
132
|
+
return apiClientManager
|
|
133
|
+
.clientOrThrow()
|
|
134
|
+
.updateDashboardWidget(dashboardId, widgetId, body, dashboardRequestOptions("query.dashboards.widgets.update()", { dashboardId, widgetId }, requestOptions));
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Removes a widget from a custom dashboard.
|
|
138
|
+
*/
|
|
139
|
+
function deleteDashboardWidget(dashboardId, widgetId, options, requestOptions) {
|
|
140
|
+
return apiClientManager
|
|
141
|
+
.clientOrThrow()
|
|
142
|
+
.deleteDashboardWidget(dashboardId, widgetId, options, dashboardRequestOptions("query.dashboards.widgets.del()", { dashboardId, widgetId }, requestOptions));
|
|
143
|
+
}
|
|
42
144
|
export const query = {
|
|
43
145
|
execute,
|
|
146
|
+
dashboards: {
|
|
147
|
+
list: listDashboards,
|
|
148
|
+
retrieve: retrieveDashboard,
|
|
149
|
+
create: createDashboard,
|
|
150
|
+
update: updateDashboard,
|
|
151
|
+
replace: replaceDashboard,
|
|
152
|
+
del: deleteDashboard,
|
|
153
|
+
widgets: {
|
|
154
|
+
add: addDashboardWidget,
|
|
155
|
+
update: updateDashboardWidget,
|
|
156
|
+
del: deleteDashboardWidget,
|
|
157
|
+
},
|
|
158
|
+
},
|
|
44
159
|
};
|
|
45
160
|
//# sourceMappingURL=query.js.map
|
package/dist/esm/v3/query.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.js","sourceRoot":"","sources":["../../../src/v3/query.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"query.js","sourceRoot":"","sources":["../../../src/v3/query.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AA6HrC,iBAAiB;AACjB,SAAS,OAAO,CACd,KAAa,EACb,OAAsB,EACtB,cAAkC;IAElC,MAAM,SAAS,GAAG,gBAAgB,CAAC,aAAa,EAAE,CAAC;IAEnD,MAAM,IAAI,GAAG,eAAe,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAC5C,MAAM,EAAE,GAAG,eAAe,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IAExC,MAAM,eAAe,GAAG,mBAAmB,CACzC;QACE,MAAM;QACN,IAAI,EAAE,iBAAiB;QACvB,IAAI,EAAE,OAAO;QACb,UAAU,EAAE;YACV,KAAK,EAAE,OAAO,EAAE,KAAK,IAAI,aAAa;YACtC,MAAM,EAAE,OAAO,EAAE,MAAM,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AAC;AAED;;GAEG;AACH,SAAS,qBAAqB,CAC5B,WAAmB,EACnB,QAAgB,EAChB,IAAsC,EACtC,cAAkC;IAElC,OAAO,gBAAgB;SACpB,aAAa,EAAE;SACf,qBAAqB,CACpB,WAAW,EACX,QAAQ,EACR,IAAI,EACJ,uBAAuB,CACrB,mCAAmC,EACnC,EAAE,WAAW,EAAE,QAAQ,EAAE,EACzB,cAAc,CACf,CACF,CAAC;AACN,CAAC;AAED;;GAEG;AACH,SAAS,qBAAqB,CAC5B,WAAmB,EACnB,QAAgB,EAChB,OAA+B,EAC/B,cAAkC;IAElC,OAAO,gBAAgB;SACpB,aAAa,EAAE;SACf,qBAAqB,CACpB,WAAW,EACX,QAAQ,EACR,OAAO,EACP,uBAAuB,CACrB,gCAAgC,EAChC,EAAE,WAAW,EAAE,QAAQ,EAAE,EACzB,cAAc,CACf,CACF,CAAC;AACN,CAAC;AAED,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,OAAO;IACP,UAAU,EAAE;QACV,IAAI,EAAE,cAAc;QACpB,QAAQ,EAAE,iBAAiB;QAC3B,MAAM,EAAE,eAAe;QACvB,MAAM,EAAE,eAAe;QACvB,OAAO,EAAE,gBAAgB;QACzB,GAAG,EAAE,eAAe;QACpB,OAAO,EAAE;YACP,GAAG,EAAE,kBAAkB;YACvB,MAAM,EAAE,qBAAqB;YAC7B,GAAG,EAAE,qBAAqB;SAC3B;KACF;CACF,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Webhook } from "@trigger.dev/core/v3";
|
|
2
|
-
import type { WebhookSource, InferWebhookEvent, AnyWebhookSource, ValidateWebhookFilter, NarrowWebhookEvent, ChatEvent, ValidatedWebhookKey, WebhookResponseConfig, WebhookUrlSecretConfig, WebhookVerifierConfig, StripeWebhookEvent, GitHubWebhookEvent, TaskRunContext, AnyWebhookEndpoint, InferWebhookEndpointEvent, WebhookEndpoint, WebhookEndpointContext } from "@trigger.dev/core/v3";
|
|
2
|
+
import type { WebhookSource, InferWebhookEvent, AnyWebhookSource, ValidateWebhookFilter, NarrowWebhookEvent, ChatEvent, ValidatedWebhookKey, WebhookResponseConfig, WebhookUrlSecretConfig, WebhookVerifierConfig, StripeWebhookEvent, GitHubWebhookEvent, TaskRunContext, AnyWebhookEndpoint, InferWebhookEndpointEvent, WebhookEndpoint, WebhookEndpointContext, TaskOptions } from "@trigger.dev/core/v3";
|
|
3
3
|
import { cancelWebhookWaiter, createWebhookWaiter, waitForWebhookWaiter } from "./webhookWaiters.js";
|
|
4
4
|
import { type Task } from "./shared.js";
|
|
5
|
-
import { type WebhookProviderId } from "@trigger.dev/core/webhooks";
|
|
5
|
+
import { type HookdeckSourceOptions, type WebhookProviderId } from "@trigger.dev/core/webhooks";
|
|
6
6
|
/**
|
|
7
7
|
* The type of error thrown when a webhook fails to parse or verify
|
|
8
8
|
*/
|
|
@@ -74,6 +74,13 @@ export declare const webhookSources: {
|
|
|
74
74
|
* the endpoint's Connect panel, which you paste into Meta's Verify Token field.
|
|
75
75
|
*/
|
|
76
76
|
readonly whatsapp: <T = unknown>() => WebhookSource<T>;
|
|
77
|
+
/**
|
|
78
|
+
* Hookdeck relays deliveries from another provider, so `T` is the original provider's event. It
|
|
79
|
+
* verifies `x-hookdeck-signature` (and `x-hookdeck-signature-2` while a secret is being rolled)
|
|
80
|
+
* with the Hookdeck project's signing secret, and dedupes retries on `x-hookdeck-eventid`. Pass
|
|
81
|
+
* `headerPrefix` when the project's header prefix was changed from `x-hookdeck`.
|
|
82
|
+
*/
|
|
83
|
+
readonly hookdeck: <T = unknown>(options?: HookdeckSourceOptions) => WebhookSource<T>;
|
|
77
84
|
};
|
|
78
85
|
type CamelCase<S extends string> = S extends `${infer Head}-${infer Tail}` ? `${Head}${Capitalize<CamelCase<Tail>>}` : S;
|
|
79
86
|
/**
|
|
@@ -85,7 +92,7 @@ type CamelCase<S extends string> = S extends `${infer Head}-${infer Tail}` ? `${
|
|
|
85
92
|
export type ProviderProducers = {
|
|
86
93
|
[K in Exclude<WebhookProviderId, "zoom"> as CamelCase<K>]: <TEvent = unknown>() => WebhookSource<TEvent>;
|
|
87
94
|
};
|
|
88
|
-
export declare const providerProducers: Omit<ProviderProducers, "slack">;
|
|
95
|
+
export declare const providerProducers: Omit<ProviderProducers, "slack" | "hookdeck">;
|
|
89
96
|
export type WebhookEndpointOptions<TIdentifier extends string, TSource extends AnyWebhookSource> = {
|
|
90
97
|
/** The endpoint id. Subscribers reference the endpoint, and it names the endpoint's URL. */
|
|
91
98
|
id: TIdentifier;
|
|
@@ -112,7 +119,13 @@ export type WebhookOnEventParams<TEvent> = {
|
|
|
112
119
|
endpoint?: WebhookEndpointContext;
|
|
113
120
|
ctx: TaskRunContext;
|
|
114
121
|
};
|
|
115
|
-
|
|
122
|
+
/**
|
|
123
|
+
* The `task()` options a webhook task also takes: `queue`, `concurrency`, `machine`, `retry`,
|
|
124
|
+
* `maxDuration`, `ttl` and the lifecycle hooks. e.g. `queue: { concurrencyLimit: 1 }` handles one
|
|
125
|
+
* delivery at a time.
|
|
126
|
+
*/
|
|
127
|
+
export type WebhookTaskOptions<TIdentifier extends string, TEvent> = Omit<TaskOptions<TIdentifier, WebhookTaskPayload<TEvent>, void>, "id" | "run" | "jsonSchema" | "triggerSource" | "agentConfig">;
|
|
128
|
+
export type WebhookOptions<TIdentifier extends string, TEndpoint extends AnyWebhookEndpoint, TEvent = InferWebhookEndpointEvent<TEndpoint>> = WebhookTaskOptions<TIdentifier, TEvent> & {
|
|
116
129
|
id: TIdentifier;
|
|
117
130
|
/** The endpoint this task subscribes to. */
|
|
118
131
|
endpoint: TEndpoint;
|
|
@@ -206,6 +219,7 @@ interface Webhooks {
|
|
|
206
219
|
composio: typeof webhookSources.composio;
|
|
207
220
|
gitlab: typeof webhookSources.gitlab;
|
|
208
221
|
whatsapp: typeof webhookSources.whatsapp;
|
|
222
|
+
hookdeck: typeof webhookSources.hookdeck;
|
|
209
223
|
/** Declare the URLs providers deliver to. */
|
|
210
224
|
endpoint: {
|
|
211
225
|
define: typeof defineWebhookEndpoint;
|
|
@@ -220,4 +234,4 @@ interface Webhooks {
|
|
|
220
234
|
/**
|
|
221
235
|
* Webhook utilities for handling incoming webhook requests
|
|
222
236
|
*/
|
|
223
|
-
export declare const webhooks: Webhooks & Omit<ProviderProducers, "slack">;
|
|
237
|
+
export declare const webhooks: Webhooks & Omit<ProviderProducers, "slack" | "hookdeck">;
|