chore: release v4.4.0 (#2941)
🚀 Publish Trigger.dev Docker / typecheck (push) Failing after 0s
🚀 Publish Trigger.dev Docker / publish-webapp (push) Has been skipped
🚀 Publish Trigger.dev Docker / publish-worker (push) Has been skipped
🚀 Publish Trigger.dev Docker / publish-worker-v4 (push) Has been skipped
🚀 Publish Trigger.dev Docker / units (push) Failing after 3s
🚀 Publish Trigger.dev Docker / typecheck (push) Failing after 0s
🚀 Publish Trigger.dev Docker / publish-webapp (push) Has been skipped
🚀 Publish Trigger.dev Docker / publish-worker (push) Has been skipped
🚀 Publish Trigger.dev Docker / publish-worker-v4 (push) Has been skipped
🚀 Publish Trigger.dev Docker / units (push) Failing after 3s
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and publish to npm yourself or [setup this action to publish automatically](https://github.com/changesets/action#with-publishing). If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @trigger.dev/sdk@4.4.0 ### Minor Changes - Added `query.execute()` which lets you query your Trigger.dev data using TRQL (Trigger Query Language) and returns results as typed JSON rows or CSV. It supports configurable scope (environment, project, or organization), time filtering via `period` or `from`/`to` ranges, and a `format` option for JSON or CSV output. ([#3060](https://github.com/triggerdotdev/trigger.dev/pull/3060)) ```typescript import { query } from "@trigger.dev/sdk"; import type { QueryTable } from "@trigger.dev/sdk"; // Basic untyped query const result = await query.execute("SELECT run_id, status FROM runs LIMIT 10"); // Type-safe query using QueryTable to pick specific columns const typedResult = await query.execute<QueryTable<"runs", "run_id" | "status" | "triggered_at">>( "SELECT run_id, status, triggered_at FROM runs LIMIT 10" ); typedResult.results.forEach((row) => { console.log(row.run_id, row.status); // Fully typed }); // Aggregation query with inline types const stats = await query.execute<{ status: string; count: number }>( "SELECT status, COUNT(*) as count FROM runs GROUP BY status", { scope: "project", period: "30d" } ); // CSV export const csv = await query.execute("SELECT run_id, status FROM runs", { format: "csv", period: "7d", }); console.log(csv.results); // Raw CSV string ``` ### Patch Changes - Add `maxDelay` option to debounce feature. This allows setting a maximum time limit for how long a debounced run can be delayed, ensuring execution happens within a specified window even with continuous triggers. ([#2984](https://github.com/triggerdotdev/trigger.dev/pull/2984)) ```typescript await myTask.trigger(payload, { debounce: { key: "my-key", delay: "5s", maxDelay: "30m", // Execute within 30 minutes regardless of continuous triggers }, }); ``` - Aligned the SDK's `getRunIdForOptions` logic with the Core package to handle semantic targets (`root`, `parent`) in root tasks. ([#2874](https://github.com/triggerdotdev/trigger.dev/pull/2874)) - Export `AnyOnStartAttemptHookFunction` type to allow defining `onStartAttempt` hooks for individual tasks. ([#2966](https://github.com/triggerdotdev/trigger.dev/pull/2966)) - Fixed a minor issue in the deployment command on distinguishing between local builds for the cloud vs local builds for self-hosting setups. ([#3070](https://github.com/triggerdotdev/trigger.dev/pull/3070)) - Updated dependencies: - `@trigger.dev/core@4.4.0` ## @trigger.dev/build@4.4.0 ### Patch Changes - Updated dependencies: - `@trigger.dev/core@4.4.0` ## trigger.dev@4.4.0 ### Patch Changes - Fix runner getting stuck indefinitely when `execute()` is called on a dead child process. ([#2978](https://github.com/triggerdotdev/trigger.dev/pull/2978)) - Add optional `timeoutInSeconds` parameter to the `wait_for_run_to_complete` MCP tool. Defaults to 60 seconds. If the run doesn't complete within the timeout, the current state of the run is returned instead of waiting indefinitely. ([#3035](https://github.com/triggerdotdev/trigger.dev/pull/3035)) - Fixed a minor issue in the deployment command on distinguishing between local builds for the cloud vs local builds for self-hosting setups. ([#3070](https://github.com/triggerdotdev/trigger.dev/pull/3070)) - Updated dependencies: - `@trigger.dev/core@4.4.0` - `@trigger.dev/build@4.4.0` - `@trigger.dev/schema-to-json@4.4.0` ## @trigger.dev/core@4.4.0 ### Patch Changes - Add `maxDelay` option to debounce feature. This allows setting a maximum time limit for how long a debounced run can be delayed, ensuring execution happens within a specified window even with continuous triggers. ([#2984](https://github.com/triggerdotdev/trigger.dev/pull/2984)) ```typescript await myTask.trigger(payload, { debounce: { key: "my-key", delay: "5s", maxDelay: "30m", // Execute within 30 minutes regardless of continuous triggers }, }); ``` - Fixed a minor issue in the deployment command on distinguishing between local builds for the cloud vs local builds for self-hosting setups. ([#3070](https://github.com/triggerdotdev/trigger.dev/pull/3070)) - fix: vendor superjson to fix ESM/CJS compatibility ([#2949](https://github.com/triggerdotdev/trigger.dev/pull/2949)) Bundle superjson during build to avoid `ERR_REQUIRE_ESM` errors on Node.js versions that don't support `require(ESM)` by default (< 22.12.0) and AWS Lambda which intentionally disables it. - Add Vercel integration support to API schemas: `commitSHA` and `integrationDeployments` on deployment responses, and `source` field for environment variable imports. ([#2994](https://github.com/triggerdotdev/trigger.dev/pull/2994)) ## @trigger.dev/python@4.4.0 ### Patch Changes - Updated dependencies: - `@trigger.dev/core@4.4.0` - `@trigger.dev/sdk@4.4.0` - `@trigger.dev/build@4.4.0` ## @trigger.dev/react-hooks@4.4.0 ### Patch Changes - Fix `onComplete` callback firing prematurely when the realtime stream disconnects before the run finishes. ([#2929](https://github.com/triggerdotdev/trigger.dev/pull/2929)) - Updated dependencies: - `@trigger.dev/core@4.4.0` ## @trigger.dev/redis-worker@4.4.0 ### Patch Changes - Updated dependencies: - `@trigger.dev/core@4.4.0` ## @trigger.dev/rsc@4.4.0 ### Patch Changes - Updated dependencies: - `@trigger.dev/core@4.4.0` ## @trigger.dev/schema-to-json@4.4.0 ### Patch Changes - Updated dependencies: - `@trigger.dev/core@4.4.0` --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
506b161751
commit
84a00b6eb6
@@ -1,16 +0,0 @@
|
||||
---
|
||||
"@trigger.dev/core": patch
|
||||
"@trigger.dev/sdk": patch
|
||||
---
|
||||
|
||||
Add `maxDelay` option to debounce feature. This allows setting a maximum time limit for how long a debounced run can be delayed, ensuring execution happens within a specified window even with continuous triggers.
|
||||
|
||||
```typescript
|
||||
await myTask.trigger(payload, {
|
||||
debounce: {
|
||||
key: "my-key",
|
||||
delay: "5s",
|
||||
maxDelay: "30m", // Execute within 30 minutes regardless of continuous triggers
|
||||
},
|
||||
});
|
||||
```
|
||||
@@ -1,34 +0,0 @@
|
||||
---
|
||||
"@trigger.dev/sdk": minor
|
||||
---
|
||||
|
||||
Added `query.execute()` which lets you query your Trigger.dev data using TRQL (Trigger Query Language) and returns results as typed JSON rows or CSV. It supports configurable scope (environment, project, or organization), time filtering via `period` or `from`/`to` ranges, and a `format` option for JSON or CSV output.
|
||||
|
||||
```typescript
|
||||
import { query } from "@trigger.dev/sdk";
|
||||
import type { QueryTable } from "@trigger.dev/sdk";
|
||||
|
||||
// Basic untyped query
|
||||
const result = await query.execute("SELECT run_id, status FROM runs LIMIT 10");
|
||||
|
||||
// Type-safe query using QueryTable to pick specific columns
|
||||
const typedResult = await query.execute<QueryTable<"runs", "run_id" | "status" | "triggered_at">>(
|
||||
"SELECT run_id, status, triggered_at FROM runs LIMIT 10"
|
||||
);
|
||||
typedResult.results.forEach(row => {
|
||||
console.log(row.run_id, row.status); // Fully typed
|
||||
});
|
||||
|
||||
// Aggregation query with inline types
|
||||
const stats = await query.execute<{ status: string; count: number }>(
|
||||
"SELECT status, COUNT(*) as count FROM runs GROUP BY status",
|
||||
{ scope: "project", period: "30d" }
|
||||
);
|
||||
|
||||
// CSV export
|
||||
const csv = await query.execute(
|
||||
"SELECT run_id, status FROM runs",
|
||||
{ format: "csv", period: "7d" }
|
||||
);
|
||||
console.log(csv.results); // Raw CSV string
|
||||
```
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
"@trigger.dev/react-hooks": patch
|
||||
---
|
||||
|
||||
Fix `onComplete` callback firing prematurely when the realtime stream disconnects before the run finishes.
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
"@trigger.dev/sdk": patch
|
||||
---
|
||||
|
||||
Aligned the SDK's `getRunIdForOptions` logic with the Core package to handle semantic targets (`root`, `parent`) in root tasks.
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
"@trigger.dev/sdk": patch
|
||||
---
|
||||
|
||||
Export `AnyOnStartAttemptHookFunction` type to allow defining `onStartAttempt` hooks for individual tasks.
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
"trigger.dev": patch
|
||||
---
|
||||
|
||||
Fix runner getting stuck indefinitely when `execute()` is called on a dead child process.
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
"trigger.dev": patch
|
||||
---
|
||||
|
||||
Add optional `timeoutInSeconds` parameter to the `wait_for_run_to_complete` MCP tool. Defaults to 60 seconds. If the run doesn't complete within the timeout, the current state of the run is returned instead of waiting indefinitely.
|
||||
@@ -1,7 +0,0 @@
|
||||
---
|
||||
"@trigger.dev/sdk": patch
|
||||
"trigger.dev": patch
|
||||
"@trigger.dev/core": patch
|
||||
---
|
||||
|
||||
Fixed a minor issue in the deployment command on distinguishing between local builds for the cloud vs local builds for self-hosting setups.
|
||||
@@ -1,7 +0,0 @@
|
||||
---
|
||||
"@trigger.dev/core": patch
|
||||
---
|
||||
|
||||
fix: vendor superjson to fix ESM/CJS compatibility
|
||||
|
||||
Bundle superjson during build to avoid `ERR_REQUIRE_ESM` errors on Node.js versions that don't support `require(ESM)` by default (< 22.12.0) and AWS Lambda which intentionally disables it.
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
"@trigger.dev/core": patch
|
||||
---
|
||||
|
||||
Add Vercel integration support to API schemas: `commitSHA` and `integrationDeployments` on deployment responses, and `source` field for environment variable imports.
|
||||
@@ -1,5 +1,12 @@
|
||||
# @trigger.dev/build
|
||||
|
||||
## 4.4.0
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies:
|
||||
- `@trigger.dev/core@4.4.0`
|
||||
|
||||
## 4.3.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@trigger.dev/build",
|
||||
"version": "4.3.3",
|
||||
"version": "4.4.0",
|
||||
"description": "trigger.dev build extensions",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
@@ -78,7 +78,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@prisma/config": "^6.10.0",
|
||||
"@trigger.dev/core": "workspace:4.3.3",
|
||||
"@trigger.dev/core": "workspace:4.4.0",
|
||||
"mlly": "^1.7.1",
|
||||
"pkg-types": "^1.1.3",
|
||||
"resolve": "^1.22.8",
|
||||
|
||||
@@ -1,5 +1,17 @@
|
||||
# trigger.dev
|
||||
|
||||
## 4.4.0
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Fix runner getting stuck indefinitely when `execute()` is called on a dead child process. ([#2978](https://github.com/triggerdotdev/trigger.dev/pull/2978))
|
||||
- Add optional `timeoutInSeconds` parameter to the `wait_for_run_to_complete` MCP tool. Defaults to 60 seconds. If the run doesn't complete within the timeout, the current state of the run is returned instead of waiting indefinitely. ([#3035](https://github.com/triggerdotdev/trigger.dev/pull/3035))
|
||||
- Fixed a minor issue in the deployment command on distinguishing between local builds for the cloud vs local builds for self-hosting setups. ([#3070](https://github.com/triggerdotdev/trigger.dev/pull/3070))
|
||||
- Updated dependencies:
|
||||
- `@trigger.dev/core@4.4.0`
|
||||
- `@trigger.dev/build@4.4.0`
|
||||
- `@trigger.dev/schema-to-json@4.4.0`
|
||||
|
||||
## 4.3.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "trigger.dev",
|
||||
"version": "4.3.3",
|
||||
"version": "4.4.0",
|
||||
"description": "A Command-Line Interface for Trigger.dev projects",
|
||||
"type": "module",
|
||||
"license": "MIT",
|
||||
@@ -93,9 +93,9 @@
|
||||
"@opentelemetry/sdk-trace-node": "2.0.1",
|
||||
"@opentelemetry/semantic-conventions": "1.36.0",
|
||||
"@s2-dev/streamstore": "^0.17.6",
|
||||
"@trigger.dev/build": "workspace:4.3.3",
|
||||
"@trigger.dev/core": "workspace:4.3.3",
|
||||
"@trigger.dev/schema-to-json": "workspace:4.3.3",
|
||||
"@trigger.dev/build": "workspace:4.4.0",
|
||||
"@trigger.dev/core": "workspace:4.4.0",
|
||||
"@trigger.dev/schema-to-json": "workspace:4.4.0",
|
||||
"ansi-escapes": "^7.0.0",
|
||||
"braces": "^3.0.3",
|
||||
"c12": "^1.11.1",
|
||||
|
||||
@@ -1,5 +1,28 @@
|
||||
# internal-platform
|
||||
|
||||
## 4.4.0
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Add `maxDelay` option to debounce feature. This allows setting a maximum time limit for how long a debounced run can be delayed, ensuring execution happens within a specified window even with continuous triggers. ([#2984](https://github.com/triggerdotdev/trigger.dev/pull/2984))
|
||||
|
||||
```typescript
|
||||
await myTask.trigger(payload, {
|
||||
debounce: {
|
||||
key: "my-key",
|
||||
delay: "5s",
|
||||
maxDelay: "30m", // Execute within 30 minutes regardless of continuous triggers
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
- Fixed a minor issue in the deployment command on distinguishing between local builds for the cloud vs local builds for self-hosting setups. ([#3070](https://github.com/triggerdotdev/trigger.dev/pull/3070))
|
||||
- fix: vendor superjson to fix ESM/CJS compatibility ([#2949](https://github.com/triggerdotdev/trigger.dev/pull/2949))
|
||||
|
||||
Bundle superjson during build to avoid `ERR_REQUIRE_ESM` errors on Node.js versions that don't support `require(ESM)` by default (< 22.12.0) and AWS Lambda which intentionally disables it.
|
||||
|
||||
- Add Vercel integration support to API schemas: `commitSHA` and `integrationDeployments` on deployment responses, and `source` field for environment variable imports. ([#2994](https://github.com/triggerdotdev/trigger.dev/pull/2994))
|
||||
|
||||
## 4.3.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@trigger.dev/core",
|
||||
"version": "4.3.3",
|
||||
"version": "4.4.0",
|
||||
"description": "Core code used across the Trigger.dev SDK and platform",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
# @trigger.dev/python
|
||||
|
||||
## 4.4.0
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies:
|
||||
- `@trigger.dev/core@4.4.0`
|
||||
- `@trigger.dev/sdk@4.4.0`
|
||||
- `@trigger.dev/build@4.4.0`
|
||||
|
||||
## 4.3.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@trigger.dev/python",
|
||||
"version": "4.3.3",
|
||||
"version": "4.4.0",
|
||||
"description": "Python runtime and build extension for Trigger.dev",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
@@ -45,7 +45,7 @@
|
||||
"check-exports": "attw --pack ."
|
||||
},
|
||||
"dependencies": {
|
||||
"@trigger.dev/core": "workspace:4.3.3",
|
||||
"@trigger.dev/core": "workspace:4.4.0",
|
||||
"tinyexec": "^0.3.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
@@ -56,12 +56,12 @@
|
||||
"tsx": "4.17.0",
|
||||
"esbuild": "^0.23.0",
|
||||
"@arethetypeswrong/cli": "^0.15.4",
|
||||
"@trigger.dev/build": "workspace:4.3.3",
|
||||
"@trigger.dev/sdk": "workspace:4.3.3"
|
||||
"@trigger.dev/build": "workspace:4.4.0",
|
||||
"@trigger.dev/sdk": "workspace:4.4.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@trigger.dev/sdk": "workspace:^4.3.3",
|
||||
"@trigger.dev/build": "workspace:^4.3.3"
|
||||
"@trigger.dev/sdk": "workspace:^4.4.0",
|
||||
"@trigger.dev/build": "workspace:^4.4.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18.20.0"
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# @trigger.dev/react-hooks
|
||||
|
||||
## 4.4.0
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Fix `onComplete` callback firing prematurely when the realtime stream disconnects before the run finishes. ([#2929](https://github.com/triggerdotdev/trigger.dev/pull/2929))
|
||||
- Updated dependencies:
|
||||
- `@trigger.dev/core@4.4.0`
|
||||
|
||||
## 4.3.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@trigger.dev/react-hooks",
|
||||
"version": "4.3.3",
|
||||
"version": "4.4.0",
|
||||
"description": "trigger.dev react hooks",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
@@ -37,7 +37,7 @@
|
||||
"check-exports": "attw --pack ."
|
||||
},
|
||||
"dependencies": {
|
||||
"@trigger.dev/core": "workspace:^4.3.3",
|
||||
"@trigger.dev/core": "workspace:^4.4.0",
|
||||
"swr": "^2.2.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# @trigger.dev/redis-worker
|
||||
|
||||
## 4.4.0
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies:
|
||||
- `@trigger.dev/core@4.4.0`
|
||||
|
||||
## 4.3.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@trigger.dev/redis-worker",
|
||||
"version": "4.3.3",
|
||||
"version": "4.4.0",
|
||||
"description": "Redis worker for trigger.dev",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
@@ -23,7 +23,7 @@
|
||||
"test": "vitest --sequence.concurrent=false --no-file-parallelism"
|
||||
},
|
||||
"dependencies": {
|
||||
"@trigger.dev/core": "workspace:4.3.3",
|
||||
"@trigger.dev/core": "workspace:4.4.0",
|
||||
"lodash.omit": "^4.5.0",
|
||||
"nanoid": "^5.0.7",
|
||||
"p-limit": "^6.2.0",
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# @trigger.dev/rsc
|
||||
|
||||
## 4.4.0
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies:
|
||||
- `@trigger.dev/core@4.4.0`
|
||||
|
||||
## 4.3.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@trigger.dev/rsc",
|
||||
"version": "4.3.3",
|
||||
"version": "4.4.0",
|
||||
"description": "trigger.dev rsc",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
@@ -37,14 +37,14 @@
|
||||
"check-exports": "attw --pack ."
|
||||
},
|
||||
"dependencies": {
|
||||
"@trigger.dev/core": "workspace:^4.3.3",
|
||||
"@trigger.dev/core": "workspace:^4.4.0",
|
||||
"mlly": "^1.7.1",
|
||||
"react": "19.0.0-rc.1",
|
||||
"react-dom": "19.0.0-rc.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@arethetypeswrong/cli": "^0.15.4",
|
||||
"@trigger.dev/build": "workspace:^4.3.3",
|
||||
"@trigger.dev/build": "workspace:^4.4.0",
|
||||
"@types/node": "^20.14.14",
|
||||
"@types/react": "*",
|
||||
"@types/react-dom": "*",
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# @trigger.dev/schema-to-json
|
||||
|
||||
## 4.4.0
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies:
|
||||
- `@trigger.dev/core@4.4.0`
|
||||
|
||||
## 4.3.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@trigger.dev/schema-to-json",
|
||||
"version": "4.3.3",
|
||||
"version": "4.4.0",
|
||||
"description": "Convert various schema validation libraries to JSON Schema",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
|
||||
@@ -1,5 +1,60 @@
|
||||
# @trigger.dev/sdk
|
||||
|
||||
## 4.4.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- Added `query.execute()` which lets you query your Trigger.dev data using TRQL (Trigger Query Language) and returns results as typed JSON rows or CSV. It supports configurable scope (environment, project, or organization), time filtering via `period` or `from`/`to` ranges, and a `format` option for JSON or CSV output. ([#3060](https://github.com/triggerdotdev/trigger.dev/pull/3060))
|
||||
|
||||
```typescript
|
||||
import { query } from "@trigger.dev/sdk";
|
||||
import type { QueryTable } from "@trigger.dev/sdk";
|
||||
|
||||
// Basic untyped query
|
||||
const result = await query.execute("SELECT run_id, status FROM runs LIMIT 10");
|
||||
|
||||
// Type-safe query using QueryTable to pick specific columns
|
||||
const typedResult = await query.execute<QueryTable<"runs", "run_id" | "status" | "triggered_at">>(
|
||||
"SELECT run_id, status, triggered_at FROM runs LIMIT 10"
|
||||
);
|
||||
typedResult.results.forEach((row) => {
|
||||
console.log(row.run_id, row.status); // Fully typed
|
||||
});
|
||||
|
||||
// Aggregation query with inline types
|
||||
const stats = await query.execute<{ status: string; count: number }>(
|
||||
"SELECT status, COUNT(*) as count FROM runs GROUP BY status",
|
||||
{ scope: "project", period: "30d" }
|
||||
);
|
||||
|
||||
// CSV export
|
||||
const csv = await query.execute("SELECT run_id, status FROM runs", {
|
||||
format: "csv",
|
||||
period: "7d",
|
||||
});
|
||||
console.log(csv.results); // Raw CSV string
|
||||
```
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Add `maxDelay` option to debounce feature. This allows setting a maximum time limit for how long a debounced run can be delayed, ensuring execution happens within a specified window even with continuous triggers. ([#2984](https://github.com/triggerdotdev/trigger.dev/pull/2984))
|
||||
|
||||
```typescript
|
||||
await myTask.trigger(payload, {
|
||||
debounce: {
|
||||
key: "my-key",
|
||||
delay: "5s",
|
||||
maxDelay: "30m", // Execute within 30 minutes regardless of continuous triggers
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
- Aligned the SDK's `getRunIdForOptions` logic with the Core package to handle semantic targets (`root`, `parent`) in root tasks. ([#2874](https://github.com/triggerdotdev/trigger.dev/pull/2874))
|
||||
- Export `AnyOnStartAttemptHookFunction` type to allow defining `onStartAttempt` hooks for individual tasks. ([#2966](https://github.com/triggerdotdev/trigger.dev/pull/2966))
|
||||
- Fixed a minor issue in the deployment command on distinguishing between local builds for the cloud vs local builds for self-hosting setups. ([#3070](https://github.com/triggerdotdev/trigger.dev/pull/3070))
|
||||
- Updated dependencies:
|
||||
- `@trigger.dev/core@4.4.0`
|
||||
|
||||
## 4.3.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@trigger.dev/sdk",
|
||||
"version": "4.3.3",
|
||||
"version": "4.4.0",
|
||||
"description": "trigger.dev Node.JS SDK",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
@@ -52,7 +52,7 @@
|
||||
"dependencies": {
|
||||
"@opentelemetry/api": "1.9.0",
|
||||
"@opentelemetry/semantic-conventions": "1.36.0",
|
||||
"@trigger.dev/core": "workspace:4.3.3",
|
||||
"@trigger.dev/core": "workspace:4.4.0",
|
||||
"chalk": "^5.2.0",
|
||||
"cronstrue": "^2.21.0",
|
||||
"debug": "^4.3.4",
|
||||
|
||||
Generated
+18
-18
@@ -1101,7 +1101,7 @@ importers:
|
||||
version: 18.3.1
|
||||
react-email:
|
||||
specifier: ^2.1.1
|
||||
version: 2.1.2(@opentelemetry/api@1.9.0)(@swc/helpers@0.5.15)(eslint@8.31.0)
|
||||
version: 2.1.2(@opentelemetry/api@1.9.0)(@swc/helpers@0.5.15)(bufferutil@4.0.9)(eslint@8.31.0)
|
||||
resend:
|
||||
specifier: ^3.2.0
|
||||
version: 3.2.0
|
||||
@@ -1379,7 +1379,7 @@ importers:
|
||||
specifier: ^6.10.0
|
||||
version: 6.19.0(magicast@0.3.5)
|
||||
'@trigger.dev/core':
|
||||
specifier: workspace:4.3.3
|
||||
specifier: workspace:4.4.0
|
||||
version: link:../core
|
||||
mlly:
|
||||
specifier: ^1.7.1
|
||||
@@ -1455,13 +1455,13 @@ importers:
|
||||
specifier: ^0.17.6
|
||||
version: 0.17.6
|
||||
'@trigger.dev/build':
|
||||
specifier: workspace:4.3.3
|
||||
specifier: workspace:4.4.0
|
||||
version: link:../build
|
||||
'@trigger.dev/core':
|
||||
specifier: workspace:4.3.3
|
||||
specifier: workspace:4.4.0
|
||||
version: link:../core
|
||||
'@trigger.dev/schema-to-json':
|
||||
specifier: workspace:4.3.3
|
||||
specifier: workspace:4.4.0
|
||||
version: link:../schema-to-json
|
||||
ansi-escapes:
|
||||
specifier: ^7.0.0
|
||||
@@ -1820,7 +1820,7 @@ importers:
|
||||
packages/python:
|
||||
dependencies:
|
||||
'@trigger.dev/core':
|
||||
specifier: workspace:4.3.3
|
||||
specifier: workspace:4.4.0
|
||||
version: link:../core
|
||||
tinyexec:
|
||||
specifier: ^0.3.2
|
||||
@@ -1830,10 +1830,10 @@ importers:
|
||||
specifier: ^0.15.4
|
||||
version: 0.15.4
|
||||
'@trigger.dev/build':
|
||||
specifier: workspace:4.3.3
|
||||
specifier: workspace:4.4.0
|
||||
version: link:../build
|
||||
'@trigger.dev/sdk':
|
||||
specifier: workspace:4.3.3
|
||||
specifier: workspace:4.4.0
|
||||
version: link:../trigger-sdk
|
||||
'@types/node':
|
||||
specifier: 20.14.14
|
||||
@@ -1857,7 +1857,7 @@ importers:
|
||||
packages/react-hooks:
|
||||
dependencies:
|
||||
'@trigger.dev/core':
|
||||
specifier: workspace:^4.3.3
|
||||
specifier: workspace:^4.4.0
|
||||
version: link:../core
|
||||
react:
|
||||
specifier: ^18.0 || ^19.0 || ^19.0.0-rc
|
||||
@@ -1891,7 +1891,7 @@ importers:
|
||||
packages/redis-worker:
|
||||
dependencies:
|
||||
'@trigger.dev/core':
|
||||
specifier: workspace:4.3.3
|
||||
specifier: workspace:4.4.0
|
||||
version: link:../core
|
||||
cron-parser:
|
||||
specifier: ^4.9.0
|
||||
@@ -1940,7 +1940,7 @@ importers:
|
||||
packages/rsc:
|
||||
dependencies:
|
||||
'@trigger.dev/core':
|
||||
specifier: workspace:^4.3.3
|
||||
specifier: workspace:^4.4.0
|
||||
version: link:../core
|
||||
mlly:
|
||||
specifier: ^1.7.1
|
||||
@@ -1956,7 +1956,7 @@ importers:
|
||||
specifier: ^0.15.4
|
||||
version: 0.15.4
|
||||
'@trigger.dev/build':
|
||||
specifier: workspace:^4.3.3
|
||||
specifier: workspace:^4.4.0
|
||||
version: link:../build
|
||||
'@types/node':
|
||||
specifier: 20.14.14
|
||||
@@ -2032,7 +2032,7 @@ importers:
|
||||
specifier: 1.36.0
|
||||
version: 1.36.0
|
||||
'@trigger.dev/core':
|
||||
specifier: workspace:4.3.3
|
||||
specifier: workspace:4.4.0
|
||||
version: link:../core
|
||||
chalk:
|
||||
specifier: ^5.2.0
|
||||
@@ -39164,7 +39164,7 @@ snapshots:
|
||||
react: 18.2.0
|
||||
react-dom: 18.2.0(react@18.2.0)
|
||||
|
||||
react-email@2.1.2(@opentelemetry/api@1.9.0)(@swc/helpers@0.5.15)(eslint@8.31.0):
|
||||
react-email@2.1.2(@opentelemetry/api@1.9.0)(@swc/helpers@0.5.15)(bufferutil@4.0.9)(eslint@8.31.0):
|
||||
dependencies:
|
||||
'@babel/parser': 7.24.1
|
||||
'@radix-ui/colors': 1.0.1
|
||||
@@ -39201,8 +39201,8 @@ snapshots:
|
||||
react: 18.3.1
|
||||
react-dom: 18.2.0(react@18.3.1)
|
||||
shelljs: 0.8.5
|
||||
socket.io: 4.7.3
|
||||
socket.io-client: 4.7.3
|
||||
socket.io: 4.7.3(bufferutil@4.0.9)
|
||||
socket.io-client: 4.7.3(bufferutil@4.0.9)
|
||||
sonner: 1.3.1(react-dom@18.2.0(react@18.3.1))(react@18.3.1)
|
||||
source-map-js: 1.0.2
|
||||
stacktrace-parser: 0.1.10
|
||||
@@ -40402,7 +40402,7 @@ snapshots:
|
||||
- supports-color
|
||||
- utf-8-validate
|
||||
|
||||
socket.io-client@4.7.3:
|
||||
socket.io-client@4.7.3(bufferutil@4.0.9):
|
||||
dependencies:
|
||||
'@socket.io/component-emitter': 3.1.0
|
||||
debug: 4.3.7(supports-color@10.0.0)
|
||||
@@ -40431,7 +40431,7 @@ snapshots:
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
socket.io@4.7.3:
|
||||
socket.io@4.7.3(bufferutil@4.0.9):
|
||||
dependencies:
|
||||
accepts: 1.3.8
|
||||
base64id: 2.0.0
|
||||
|
||||
Reference in New Issue
Block a user