@trigger.dev/sdk 4.7.4 → 4.8.0-webhooks.20261020092920
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 +626 -8
- package/dist/commonjs/v3/ai.js +2343 -185
- package/dist/commonjs/v3/ai.js.map +1 -1
- package/dist/commonjs/v3/chat.d.ts +23 -0
- package/dist/commonjs/v3/chat.js.map +1 -1
- package/dist/commonjs/v3/index.d.ts +2 -0
- package/dist/commonjs/v3/index.js +23 -17
- package/dist/commonjs/v3/index.js.map +1 -1
- package/dist/commonjs/v3/modelFileDownload.d.ts +10 -0
- package/dist/commonjs/v3/modelFileDownload.js +164 -0
- package/dist/commonjs/v3/modelFileDownload.js.map +1 -0
- 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/test/index.d.ts +2 -1
- package/dist/commonjs/v3/test/index.js +4 -1
- package/dist/commonjs/v3/test/index.js.map +1 -1
- package/dist/commonjs/v3/test/mock-channel-connector.d.ts +172 -0
- package/dist/commonjs/v3/test/mock-channel-connector.js +173 -0
- package/dist/commonjs/v3/test/mock-channel-connector.js.map +1 -0
- package/dist/commonjs/v3/test/mock-chat-agent.d.ts +81 -1
- package/dist/commonjs/v3/test/mock-chat-agent.js +137 -10
- package/dist/commonjs/v3/test/mock-chat-agent.js.map +1 -1
- package/dist/commonjs/v3/transcriptStorage.d.ts +44 -1
- package/dist/commonjs/v3/transcriptStorage.js +24 -0
- package/dist/commonjs/v3/transcriptStorage.js.map +1 -1
- package/dist/commonjs/v3/webhookWaiters.d.ts +80 -0
- package/dist/commonjs/v3/webhookWaiters.js +156 -0
- package/dist/commonjs/v3/webhookWaiters.js.map +1 -0
- package/dist/commonjs/v3/webhooks.d.ts +184 -2
- package/dist/commonjs/v3/webhooks.js +323 -1
- package/dist/commonjs/v3/webhooks.js.map +1 -1
- package/dist/commonjs/version.js +1 -1
- package/dist/esm/v3/ai.d.ts +626 -8
- package/dist/esm/v3/ai.js +2336 -184
- package/dist/esm/v3/ai.js.map +1 -1
- package/dist/esm/v3/chat.d.ts +23 -0
- package/dist/esm/v3/chat.js.map +1 -1
- package/dist/esm/v3/index.d.ts +2 -0
- package/dist/esm/v3/index.js +1 -0
- package/dist/esm/v3/index.js.map +1 -1
- package/dist/esm/v3/modelFileDownload.d.ts +10 -0
- package/dist/esm/v3/modelFileDownload.js +161 -0
- package/dist/esm/v3/modelFileDownload.js.map +1 -0
- 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/test/index.d.ts +2 -1
- package/dist/esm/v3/test/index.js +2 -1
- package/dist/esm/v3/test/index.js.map +1 -1
- package/dist/esm/v3/test/mock-channel-connector.d.ts +172 -0
- package/dist/esm/v3/test/mock-channel-connector.js +170 -0
- package/dist/esm/v3/test/mock-channel-connector.js.map +1 -0
- package/dist/esm/v3/test/mock-chat-agent.d.ts +81 -1
- package/dist/esm/v3/test/mock-chat-agent.js +137 -11
- package/dist/esm/v3/test/mock-chat-agent.js.map +1 -1
- package/dist/esm/v3/transcriptStorage.d.ts +44 -1
- package/dist/esm/v3/transcriptStorage.js +24 -0
- package/dist/esm/v3/transcriptStorage.js.map +1 -1
- package/dist/esm/v3/webhookWaiters.d.ts +80 -0
- package/dist/esm/v3/webhookWaiters.js +149 -0
- package/dist/esm/v3/webhookWaiters.js.map +1 -0
- package/dist/esm/v3/webhooks.d.ts +184 -2
- package/dist/esm/v3/webhooks.js +319 -1
- package/dist/esm/v3/webhooks.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/docs/ai-chat/actions.mdx +6 -1
- package/docs/ai-chat/backend.mdx +40 -0
- package/docs/ai-chat/patterns/redacting-telemetry.mdx +117 -0
- package/docs/ai-chat/pending-messages.mdx +2 -0
- package/docs/ai-chat/reference.mdx +53 -2
- 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 +4 -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 +99 -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 +132 -0
- package/docs/webhooks/connect.mdx +84 -0
- package/docs/webhooks/deliveries.mdx +96 -0
- package/docs/webhooks/filters.mdx +142 -0
- package/docs/webhooks/human-in-the-loop.mdx +155 -0
- package/docs/webhooks/linear.mdx +189 -0
- package/docs/webhooks/overview.mdx +103 -0
- package/docs/webhooks/session-routing.mdx +138 -0
- package/docs/webhooks/slack.mdx +368 -0
- package/docs/webhooks/sources.mdx +221 -0
- package/docs/webhooks/waiters.mdx +194 -0
- package/package.json +4 -2
|
@@ -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
|
};
|
|
@@ -42,7 +42,122 @@ function dateToISOString(date) {
|
|
|
42
42
|
}
|
|
43
43
|
return new Date(date).toISOString();
|
|
44
44
|
}
|
|
45
|
+
function dashboardRequestOptions(name, attributes, requestOptions) {
|
|
46
|
+
return (0, v3_1.mergeRequestOptions)({ tracer: tracer_js_1.tracer, name, icon: "query", attributes }, requestOptions);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Lists the built-in dashboards and your organization's custom dashboards, with their widgets.
|
|
50
|
+
*/
|
|
51
|
+
function listDashboards(requestOptions) {
|
|
52
|
+
return v3_1.apiClientManager
|
|
53
|
+
.clientOrThrow()
|
|
54
|
+
.listDashboards(dashboardRequestOptions("query.dashboards.list()", {}, requestOptions));
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Retrieves a custom dashboard, including every widget, its query and its grid position.
|
|
58
|
+
*/
|
|
59
|
+
function retrieveDashboard(dashboardId, requestOptions) {
|
|
60
|
+
return v3_1.apiClientManager
|
|
61
|
+
.clientOrThrow()
|
|
62
|
+
.retrieveDashboard(dashboardId, dashboardRequestOptions("query.dashboards.retrieve()", { dashboardId }, requestOptions));
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Creates a custom dashboard, optionally with its widgets.
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```ts
|
|
69
|
+
* const dashboard = await query.dashboards.create({
|
|
70
|
+
* title: "Email tasks",
|
|
71
|
+
* widgets: [
|
|
72
|
+
* {
|
|
73
|
+
* title: "Runs per day",
|
|
74
|
+
* query: "SELECT timeBucket(), count() AS runs FROM runs GROUP BY timeBucket ORDER BY timeBucket",
|
|
75
|
+
* display: {
|
|
76
|
+
* type: "chart",
|
|
77
|
+
* chartType: "bar",
|
|
78
|
+
* xAxisColumn: "timebucket",
|
|
79
|
+
* yAxisColumns: ["runs"],
|
|
80
|
+
* groupByColumn: null,
|
|
81
|
+
* stacked: false,
|
|
82
|
+
* sortByColumn: null,
|
|
83
|
+
* sortDirection: "asc",
|
|
84
|
+
* aggregation: "sum",
|
|
85
|
+
* },
|
|
86
|
+
* },
|
|
87
|
+
* ],
|
|
88
|
+
* });
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
function createDashboard(body, requestOptions) {
|
|
92
|
+
return v3_1.apiClientManager
|
|
93
|
+
.clientOrThrow()
|
|
94
|
+
.createDashboard(body, dashboardRequestOptions("query.dashboards.create()", { title: body.title }, requestOptions));
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Renames a custom dashboard or changes its description.
|
|
98
|
+
*/
|
|
99
|
+
function updateDashboard(dashboardId, body, requestOptions) {
|
|
100
|
+
return v3_1.apiClientManager
|
|
101
|
+
.clientOrThrow()
|
|
102
|
+
.updateDashboard(dashboardId, body, dashboardRequestOptions("query.dashboards.update()", { dashboardId }, requestOptions));
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Replaces every widget on a custom dashboard. A widget that already exists keeps its position
|
|
106
|
+
* unless you pass a new one; new widgets without a `position` are placed full width below the others,
|
|
107
|
+
* in order. Pass the `revision` you last read to reject the write if someone else changed the
|
|
108
|
+
* dashboard in the meantime.
|
|
109
|
+
*/
|
|
110
|
+
function replaceDashboard(dashboardId, body, requestOptions) {
|
|
111
|
+
return v3_1.apiClientManager
|
|
112
|
+
.clientOrThrow()
|
|
113
|
+
.replaceDashboard(dashboardId, body, dashboardRequestOptions("query.dashboards.replace()", { dashboardId }, requestOptions));
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Deletes a custom dashboard.
|
|
117
|
+
*/
|
|
118
|
+
function deleteDashboard(dashboardId, requestOptions) {
|
|
119
|
+
return v3_1.apiClientManager
|
|
120
|
+
.clientOrThrow()
|
|
121
|
+
.deleteDashboard(dashboardId, dashboardRequestOptions("query.dashboards.del()", { dashboardId }, requestOptions));
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Adds a widget to a custom dashboard. Without a `position` it is placed full width at the bottom.
|
|
125
|
+
*/
|
|
126
|
+
function addDashboardWidget(dashboardId, body, requestOptions) {
|
|
127
|
+
return v3_1.apiClientManager
|
|
128
|
+
.clientOrThrow()
|
|
129
|
+
.addDashboardWidget(dashboardId, body, dashboardRequestOptions("query.dashboards.widgets.add()", { dashboardId }, requestOptions));
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Changes a widget's title, query, display, or position.
|
|
133
|
+
*/
|
|
134
|
+
function updateDashboardWidget(dashboardId, widgetId, body, requestOptions) {
|
|
135
|
+
return v3_1.apiClientManager
|
|
136
|
+
.clientOrThrow()
|
|
137
|
+
.updateDashboardWidget(dashboardId, widgetId, body, dashboardRequestOptions("query.dashboards.widgets.update()", { dashboardId, widgetId }, requestOptions));
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Removes a widget from a custom dashboard.
|
|
141
|
+
*/
|
|
142
|
+
function deleteDashboardWidget(dashboardId, widgetId, options, requestOptions) {
|
|
143
|
+
return v3_1.apiClientManager
|
|
144
|
+
.clientOrThrow()
|
|
145
|
+
.deleteDashboardWidget(dashboardId, widgetId, options, dashboardRequestOptions("query.dashboards.widgets.del()", { dashboardId, widgetId }, requestOptions));
|
|
146
|
+
}
|
|
45
147
|
exports.query = {
|
|
46
148
|
execute,
|
|
149
|
+
dashboards: {
|
|
150
|
+
list: listDashboards,
|
|
151
|
+
retrieve: retrieveDashboard,
|
|
152
|
+
create: createDashboard,
|
|
153
|
+
update: updateDashboard,
|
|
154
|
+
replace: replaceDashboard,
|
|
155
|
+
del: deleteDashboard,
|
|
156
|
+
widgets: {
|
|
157
|
+
add: addDashboardWidget,
|
|
158
|
+
update: updateDashboardWidget,
|
|
159
|
+
del: deleteDashboardWidget,
|
|
160
|
+
},
|
|
161
|
+
},
|
|
47
162
|
};
|
|
48
163
|
//# sourceMappingURL=query.js.map
|
|
@@ -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,6CAA6E;AAC7E,2CAAqC;AA6HrC,iBAAiB;AACjB,SAAS,OAAO,CACd,KAAa,EACb,OAAsB,EACtB,cAAkC;IAElC,MAAM,SAAS,GAAG,qBAAgB,CAAC,aAAa,EAAE,CAAC;IAEnD,MAAM,IAAI,GAAG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|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import "./setup-catalog.js";
|
|
2
|
-
export { mockChatAgent, type MockChatAgentOptions, type MockChatAgentHarness, type MockChatAgentTurn, } from "./mock-chat-agent.js";
|
|
2
|
+
export { mockChatAgent, DEFAULT_TEST_CONNECTOR_ID, type MockChatAgentOptions, type MockChatAgentHarness, type MockChatAgentTurn, type SeededChannelDelivery, } from "./mock-chat-agent.js";
|
|
3
3
|
export { runTranscriptStorageTests, type TranscriptStorageTestOptions, } from "./transcript-storage-tests.js";
|
|
4
|
+
export { recordingChannelConnector, type RecordingChannelConnector, type RecordingChannelConnectorOptions, type RecordedSend, type RecordedReaction, type RecordedFinalize, type RecordedLifecycle, type RecordedReplyStream, type RecordedCancel, type TestChannelEvent, type TestChannelHandle, } from "./mock-channel-connector.js";
|
|
4
5
|
export { runInMockTaskContext, type MockTaskContextDrivers, type MockTaskContextOptions, } from "@trigger.dev/core/v3/test";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.runInMockTaskContext = exports.runTranscriptStorageTests = exports.mockChatAgent = void 0;
|
|
3
|
+
exports.runInMockTaskContext = exports.recordingChannelConnector = exports.runTranscriptStorageTests = exports.DEFAULT_TEST_CONNECTOR_ID = exports.mockChatAgent = void 0;
|
|
4
4
|
// Importing this module installs an in-memory resource catalog so that
|
|
5
5
|
// chat.agent() calls (which run at import time) register their task
|
|
6
6
|
// functions where the test harness can find them.
|
|
@@ -10,8 +10,11 @@ exports.runInMockTaskContext = exports.runTranscriptStorageTests = exports.mockC
|
|
|
10
10
|
require("./setup-catalog.js");
|
|
11
11
|
var mock_chat_agent_js_1 = require("./mock-chat-agent.js");
|
|
12
12
|
Object.defineProperty(exports, "mockChatAgent", { enumerable: true, get: function () { return mock_chat_agent_js_1.mockChatAgent; } });
|
|
13
|
+
Object.defineProperty(exports, "DEFAULT_TEST_CONNECTOR_ID", { enumerable: true, get: function () { return mock_chat_agent_js_1.DEFAULT_TEST_CONNECTOR_ID; } });
|
|
13
14
|
var transcript_storage_tests_js_1 = require("./transcript-storage-tests.js");
|
|
14
15
|
Object.defineProperty(exports, "runTranscriptStorageTests", { enumerable: true, get: function () { return transcript_storage_tests_js_1.runTranscriptStorageTests; } });
|
|
16
|
+
var mock_channel_connector_js_1 = require("./mock-channel-connector.js");
|
|
17
|
+
Object.defineProperty(exports, "recordingChannelConnector", { enumerable: true, get: function () { return mock_channel_connector_js_1.recordingChannelConnector; } });
|
|
15
18
|
// Re-export the lower-level task context harness so consumers can build
|
|
16
19
|
// their own test helpers without adding a separate `@trigger.dev/core`
|
|
17
20
|
// dependency to their reference projects.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/v3/test/index.ts"],"names":[],"mappings":";;;AAAA,uEAAuE;AACvE,oEAAoE;AACpE,kDAAkD;AAClD,EAAE;AACF,oEAAoE;AACpE,sDAAsD;AACtD,8BAA4B;AAE5B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/v3/test/index.ts"],"names":[],"mappings":";;;AAAA,uEAAuE;AACvE,oEAAoE;AACpE,kDAAkD;AAClD,EAAE;AACF,oEAAoE;AACpE,sDAAsD;AACtD,8BAA4B;AAE5B,2DAO8B;AAN5B,mHAAA,aAAa,OAAA;AACb,+HAAA,yBAAyB,OAAA;AAO3B,6EAGuC;AAFrC,wIAAA,yBAAyB,OAAA;AAI3B,yEAYqC;AAXnC,sIAAA,yBAAyB,OAAA;AAa3B,wEAAwE;AACxE,uEAAuE;AACvE,0CAA0C;AAC1C,kDAImC;AAHjC,4GAAA,oBAAoB,OAAA"}
|