@distilled.cloud/trigger-dev 1.0.0-rc.21 → 1.0.0-rc.22

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.
@@ -14,7 +14,7 @@ declare const BadRequest_base: S.TaggedErrorClass<"BadRequest", {
14
14
  };
15
15
  });
16
16
  export declare class BadRequest extends /*@__PURE__*/ BadRequest_base {
17
- readonly body?: Error403Body | ErrorResponse | Error400Body3 | InvalidEnvVarsRequestResponse | Error400Body4 | Error400Body5 | ErrorWithDetailsResponse | Error400Body | Error400Body2 | string;
17
+ readonly body?: Error403Body | ErrorResponse | Error400Body3 | SkewProtectionThresholdError | InvalidEnvVarsRequestResponse | Error400Body4 | Error400Body5 | ErrorWithDetailsResponse | Error400Body | Error400Body2 | string;
18
18
  }
19
19
  declare const Conflict_base: S.TaggedErrorClass<"Conflict", {
20
20
  readonly code: any;
@@ -27,7 +27,7 @@ declare const Conflict_base: S.TaggedErrorClass<"Conflict", {
27
27
  };
28
28
  });
29
29
  export declare class Conflict extends /*@__PURE__*/ Conflict_base {
30
- readonly body?: Error403Body | ErrorResponse | string;
30
+ readonly body?: Error403Body | ErrorResponse | SkewProtectionThresholdError | string;
31
31
  }
32
32
  declare const Forbidden_base: S.TaggedErrorClass<"Forbidden", {
33
33
  readonly code: any;
@@ -53,7 +53,7 @@ declare const NotFound_base: S.TaggedErrorClass<"NotFound", {
53
53
  };
54
54
  });
55
55
  export declare class NotFound extends /*@__PURE__*/ NotFound_base {
56
- readonly body?: Error404Body | Error403Body | WebhookWaiterErrorResponse | ErrorResponse | Error404Body4 | Error404Body2 | Error404Body3 | string;
56
+ readonly body?: Error404Body | Error403Body | WebhookWaiterErrorResponse | ErrorResponse | Error404Body4 | Error404Body2 | SkewProtectionThresholdError | Error404Body3 | string;
57
57
  }
58
58
  declare const UnprocessableEntity_base: S.TaggedErrorClass<"UnprocessableEntity", {
59
59
  readonly code: any;
@@ -251,6 +251,35 @@ export interface CancelWebhookWaiterResponse {
251
251
  /** With `too_late`, the delivery that resumed the run. */
252
252
  deliveryId?: string | undefined;
253
253
  }
254
+ export interface ClearSkewProtectionThresholdV1Request {
255
+ /** A task id. Clears that task's own threshold and leaves the environment's. Leave it out to clear the environment's threshold and leave each task's. */
256
+ task?: string | undefined;
257
+ }
258
+ /** `user` from the dashboard, `api` through this API, `migrated` when Trigger.dev set it for you. */
259
+ export type SkewProtectionThresholdSetByType = "user" | "api" | "migrated";
260
+ export interface SkewProtectionThresholdSetBy {
261
+ /** `user` from the dashboard, `api` through this API, `migrated` when Trigger.dev set it for you. */
262
+ type?: SkewProtectionThresholdSetByType | undefined;
263
+ }
264
+ export interface SkewProtectionThreshold {
265
+ version?: string | undefined;
266
+ /** The ID of the deployment with this version. */
267
+ deploymentId?: string | null | undefined;
268
+ setAt?: string | undefined;
269
+ setBy?: SkewProtectionThresholdSetBy | null | undefined;
270
+ }
271
+ /** Each task's own skew protection threshold, by task id. Empty when no task has one. */
272
+ export type SkewProtectionThresholdStateTasksMap = {
273
+ [key: string]: SkewProtectionThreshold | undefined;
274
+ };
275
+ export interface SkewProtectionThresholdState {
276
+ /** The current deployment's version, or null when nothing is current. */
277
+ currentVersion?: string | null | undefined;
278
+ /** The environment's skew protection threshold, or null when none is set. */
279
+ threshold?: SkewProtectionThreshold | null | undefined;
280
+ /** Each task's own skew protection threshold, by task id. Empty when no task has one. */
281
+ tasks?: SkewProtectionThresholdStateTasksMap | undefined;
282
+ }
254
283
  export interface CloseSessionV1Request {
255
284
  /** The session's friendly ID (`session_...`) or your `externalId`. The server disambiguates by the `session_` prefix. */
256
285
  session: string;
@@ -709,14 +738,14 @@ export interface EnableWebhookEndpointV1Response {
709
738
  /** Instructions for an AI coding agent to register the endpoint with its provider and set up the signing secret. */
710
739
  setupPrompt: string;
711
740
  }
712
- /** The scope of data to query - environment (default), project, or organization */
741
+ /** The scope of data to query. With an API key, every scope reads the key's own environment. Project and organization wide queries are available on the dashboard's Query page. */
713
742
  export type ExecuteQueryV1RequestScope = "environment" | "project" | "organization";
714
743
  /** Response format - "json" returns structured data (default), "csv" returns CSV string */
715
744
  export type ExecuteQueryV1RequestFormat = "json" | "csv";
716
745
  export interface ExecuteQueryV1Request {
717
746
  /** The TRQL query to execute */
718
747
  query: string;
719
- /** The scope of data to query - environment (default), project, or organization */
748
+ /** The scope of data to query. With an API key, every scope reads the key's own environment. Project and organization wide queries are available on the dashboard's Query page. */
720
749
  scope?: ExecuteQueryV1RequestScope | (string & {}) | undefined;
721
750
  /** Time period shorthand (e.g., "7d", "30d", "1h"). Cannot be used with from/to. */
722
751
  period?: string | null | undefined;
@@ -1450,6 +1479,8 @@ export interface GetSessionV1Request {
1450
1479
  /** The session's friendly ID (`session_...`) or your `externalId`. The server disambiguates by the `session_` prefix. */
1451
1480
  session: string;
1452
1481
  }
1482
+ export interface GetSkewProtectionThresholdV1Request {
1483
+ }
1453
1484
  export interface GetTimezonesV1Request {
1454
1485
  /** Defaults to false. Whether to include UTC in the results or not. */
1455
1486
  excludeUtc?: boolean | undefined;
@@ -1830,6 +1861,7 @@ export interface ListProjectRunsV1RequestPage {
1830
1861
  /** The ID of the run to start the page before. This will set the direction of the pagination to backward. */
1831
1862
  before?: string | undefined;
1832
1863
  }
1864
+ /** Without `period`, `from` or `to`, only runs created in the last 7 days are listed. The response's `appliedFilters.createdAt` says which window was used. */
1833
1865
  export interface ListProjectRunsV1RequestFilterCreatedAt {
1834
1866
  /** The start date to filter the runs by */
1835
1867
  from?: string | undefined;
@@ -1851,6 +1883,7 @@ export type ListProjectRunsV1RequestFilterTagList = Array<string>;
1851
1883
  export type ListProjectRunsV1RequestFilterEnvItem = "dev" | "staging" | "prod";
1852
1884
  export type ListProjectRunsV1RequestFilterEnvList = Array<ListProjectRunsV1RequestFilterEnvItem | (string & {})>;
1853
1885
  export interface ListProjectRunsV1RequestFilter {
1886
+ /** Without `period`, `from` or `to`, only runs created in the last 7 days are listed. The response's `appliedFilters.createdAt` says which window was used. */
1854
1887
  createdAt?: ListProjectRunsV1RequestFilterCreatedAt | undefined;
1855
1888
  status?: ListProjectRunsV1RequestFilterStatusList | undefined;
1856
1889
  /** The identifier of the task that was run */
@@ -1932,9 +1965,27 @@ export interface ListRunsResultPagination {
1932
1965
  /** The run ID to start the previous page before. This should be used as the `page[before]` parameter in the next request. */
1933
1966
  previous?: string | undefined;
1934
1967
  }
1968
+ /** The creation-time window the list used. */
1969
+ export interface ListRunsResultAppliedFiltersCreatedAt {
1970
+ /** The period, when the list used one. */
1971
+ period?: string | undefined;
1972
+ /** The start of the window, when the request set `filter[createdAt][from]`. */
1973
+ from?: string | undefined;
1974
+ /** The end of the window, when the request set `filter[createdAt][to]`. */
1975
+ to?: string | undefined;
1976
+ /** True when the request set no period, from or to, so the default 7-day period applied. */
1977
+ isDefault?: boolean | undefined;
1978
+ }
1979
+ /** The filters the list was run with, including defaults the request didn't set. */
1980
+ export interface ListRunsResultAppliedFilters {
1981
+ /** The creation-time window the list used. */
1982
+ createdAt?: ListRunsResultAppliedFiltersCreatedAt | undefined;
1983
+ }
1935
1984
  export interface ListRunsResult {
1936
1985
  data?: ListRunsResultDataList | undefined;
1937
1986
  pagination?: ListRunsResultPagination | undefined;
1987
+ /** The filters the list was run with, including defaults the request didn't set. */
1988
+ appliedFilters?: ListRunsResultAppliedFilters | undefined;
1938
1989
  }
1939
1990
  export interface ListQueuesV1Request {
1940
1991
  /** Page number of the queue listing (1-based) */
@@ -1958,6 +2009,7 @@ export interface ListQueuesResult {
1958
2009
  pagination: ListQueuesResultPagination;
1959
2010
  }
1960
2011
  export type ListRunsV1RequestPage = ListProjectRunsV1RequestPage;
2012
+ /** Without `period`, `from` or `to`, only runs created in the last 7 days are listed. The response's `appliedFilters.createdAt` says which window was used. */
1961
2013
  export type CommonRunsFilterCreatedAt = ListProjectRunsV1RequestFilterCreatedAt;
1962
2014
  /** The status of the run */
1963
2015
  export type CommonRunsFilterStatusItem = "PENDING_VERSION" | "QUEUED" | "EXECUTING" | "REATTEMPTING" | "FROZEN" | "COMPLETED" | "CANCELED" | "FAILED" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE";
@@ -1969,6 +2021,7 @@ export type CommonRunsFilterVersionList = Array<string>;
1969
2021
  /** The tags that are attached to the run */
1970
2022
  export type CommonRunsFilterTagList = Array<string>;
1971
2023
  export interface CommonRunsFilter {
2024
+ /** Without `period`, `from` or `to`, only runs created in the last 7 days are listed. The response's `appliedFilters.createdAt` says which window was used. */
1972
2025
  createdAt?: ListProjectRunsV1RequestFilterCreatedAt | undefined;
1973
2026
  status?: CommonRunsFilterStatusList | undefined;
1974
2027
  /** The identifier of the task that was run */
@@ -2230,6 +2283,26 @@ export interface PromoteDeploymentV1Request {
2230
2283
  /** The deployment version to promote (e.g., "20250228.1"). */
2231
2284
  version: string;
2232
2285
  }
2286
+ /** The environment's threshold, when it was cleared; null when only task thresholds were. */
2287
+ export interface PromoteDeploymentV1ResponseSkewProtectionThresholdClearedThreshold {
2288
+ /** The threshold's version before it was cleared */
2289
+ version?: string | undefined;
2290
+ }
2291
+ export interface PromoteDeploymentV1ResponseSkewProtectionThresholdClearedTasksValue {
2292
+ /** The task threshold's version before it was cleared */
2293
+ version?: string | undefined;
2294
+ }
2295
+ /** Each task threshold that was cleared, by task id. */
2296
+ export type PromoteDeploymentV1ResponseSkewProtectionThresholdClearedTasksMap = {
2297
+ [key: string]: PromoteDeploymentV1ResponseSkewProtectionThresholdClearedTasksValue | undefined;
2298
+ };
2299
+ /** Present when the promoted version is below a skew protection threshold (the environment's, or a task's own), which the promote cleared. */
2300
+ export interface PromoteDeploymentV1ResponseSkewProtectionThresholdCleared {
2301
+ /** The environment's threshold, when it was cleared; null when only task thresholds were. */
2302
+ threshold?: PromoteDeploymentV1ResponseSkewProtectionThresholdClearedThreshold | null | undefined;
2303
+ /** Each task threshold that was cleared, by task id. */
2304
+ tasks?: PromoteDeploymentV1ResponseSkewProtectionThresholdClearedTasksMap | undefined;
2305
+ }
2233
2306
  export interface PromoteDeploymentV1Response {
2234
2307
  /** The deployment ID */
2235
2308
  id?: string | undefined;
@@ -2237,6 +2310,8 @@ export interface PromoteDeploymentV1Response {
2237
2310
  version?: string | undefined;
2238
2311
  /** The short code for the deployment */
2239
2312
  shortCode?: string | undefined;
2313
+ /** Present when the promoted version is below a skew protection threshold (the environment's, or a task's own), which the promote cleared. */
2314
+ skewProtectionThresholdCleared?: PromoteDeploymentV1ResponseSkewProtectionThresholdCleared | undefined;
2240
2315
  }
2241
2316
  export type ReplaceDashboardV1RequestWidgetsList = Array<DashboardWidgetInput>;
2242
2317
  export interface ReplaceDashboardV1Request {
@@ -2449,6 +2524,12 @@ export interface RunRescheduleV1Response {
2449
2524
  schedule?: RunRescheduleV1ResponseSchedule | undefined;
2450
2525
  attempts: RunRescheduleV1ResponseAttemptsList;
2451
2526
  }
2527
+ export interface SetSkewProtectionThresholdV1Request {
2528
+ /** A deployed version in this environment, at or below the current deployment (e.g. "20261109.22"). */
2529
+ version: string;
2530
+ /** A task id. The threshold then covers only that task's sessions, and the task must exist in the current deployment. Leave it out to cover every session in the environment. */
2531
+ task?: string | undefined;
2532
+ }
2452
2533
  export interface SetWebhookEndpointSecretV1Request {
2453
2534
  /** The endpoint's declared id (the `id` passed to `webhooks.endpoint.define`) or its `wh_` id. A value starting with `wh_` is always a generated id, since declared ids can't start with `wh_`. A declared id names the endpoint's declared instance in the key's environment. */
2454
2535
  endpointId: string;
@@ -2655,6 +2736,7 @@ export type Error400BodyError2 = "Invalid or missing run ID" | "Failed to create
2655
2736
  export interface Error400Body3 {
2656
2737
  error?: Error400BodyError2 | undefined;
2657
2738
  }
2739
+ export type SkewProtectionThresholdError = Error403Body;
2658
2740
  export type InvalidEnvVarsRequestResponseIssuesList = Array<unknown>;
2659
2741
  export type InvalidEnvVarsRequestResponseVariableErrorsList = Array<unknown>;
2660
2742
  export interface InvalidEnvVarsRequestResponse {
@@ -2740,6 +2822,9 @@ export declare const cancelRunV1: API.OperationMethod<CancelRunV1Request, Cancel
2740
2822
  export type CancelWebhookWaiterV1Error = NotFound | TriggerDevOpError;
2741
2823
  /** Cancel a webhook waiter Cancel a waiter. It stops matching deliveries, frees its slot toward the endpoint's limit, and fails the run's wait. If a delivery already claimed the waiter, the cancel is too late: the response has `cancelled: false` with `reason: "too_late"`, and the run resumes with that delivery's event. */
2742
2824
  export declare const cancelWebhookWaiterV1: API.OperationMethod<CancelWebhookWaiterV1Request, CancelWebhookWaiterResponse, CancelWebhookWaiterV1Error, TriggerDevOpContext>;
2825
+ export type ClearSkewProtectionThresholdV1Error = BadRequest | Forbidden | TriggerDevOpError;
2826
+ /** Clear skew protection threshold Clear the environment's skew protection threshold, or with `task` the threshold of that one task. Sessions already moved stay on their new runs; the others keep their versions and stored pins. Clearing a threshold that isn't set changes nothing. Use a secret key from a deployed environment, such as staging or production. Development environments return 400. */
2827
+ export declare const clearSkewProtectionThresholdV1: API.OperationMethod<ClearSkewProtectionThresholdV1Request, SkewProtectionThresholdState, ClearSkewProtectionThresholdV1Error, TriggerDevOpContext>;
2743
2828
  export type CloseSessionV1Error = NotFound | TriggerDevOpError;
2744
2829
  /** Close a session Close a session. Closing is terminal and idempotent -- closing an already-closed session returns the existing row unchanged. A closed session cannot be reopened, and reusing its `externalId` on create returns `409`. Requires a secret key -- a session public token cannot close a session. */
2745
2830
  export declare const closeSessionV1: API.OperationMethod<CloseSessionV1Request, SessionObject, CloseSessionV1Error, TriggerDevOpContext>;
@@ -2845,6 +2930,9 @@ export declare const getScheduleV1: API.OperationMethod<GetScheduleV1Request, Sc
2845
2930
  export type GetSessionV1Error = NotFound | TriggerDevOpError;
2846
2931
  /** Retrieve a session Retrieve a single session by its friendly id (`session_...`) or your `externalId`. The response includes `triggerConfig` and the friendly `currentRunId` of the live run, if any. */
2847
2932
  export declare const getSessionV1: API.OperationMethod<GetSessionV1Request, SessionObject, GetSessionV1Error, TriggerDevOpContext>;
2933
+ export type GetSkewProtectionThresholdV1Error = Forbidden | TriggerDevOpError;
2934
+ /** Get skew protection threshold Get the environment's skew protection threshold, each task's own threshold, and the current deployment version. */
2935
+ export declare const getSkewProtectionThresholdV1: API.OperationMethod<GetSkewProtectionThresholdV1Request, SkewProtectionThresholdState, GetSkewProtectionThresholdV1Error, TriggerDevOpContext>;
2848
2936
  export type GetTimezonesV1Error = TriggerDevOpError;
2849
2937
  /** Get all supported timezones Get all supported timezones that schedule tasks support. */
2850
2938
  export declare const getTimezonesV1: API.OperationMethod<GetTimezonesV1Request, GetTimezonesResult, GetTimezonesV1Error, TriggerDevOpContext>;
@@ -2941,6 +3029,9 @@ export declare const runReplayV1: API.OperationMethod<RunReplayV1Request, RunRep
2941
3029
  export type RunRescheduleV1Error = BadRequest | NotFound | TriggerDevOpError;
2942
3030
  /** Rescheduled a delayed run Updates a delayed run with a new delay. Only valid when the run is in the DELAYED state. */
2943
3031
  export declare const runRescheduleV1: API.OperationMethod<RunRescheduleV1Request, RunRescheduleV1Response, RunRescheduleV1Error, TriggerDevOpContext>;
3032
+ export type SetSkewProtectionThresholdV1Error = BadRequest | Forbidden | NotFound | Conflict | TriggerDevOpError;
3033
+ /** Set skew protection threshold Set or move the environment's skew protection threshold, or with `task` the threshold of that one task. Sessions on versions before it move to the current deployment the next time they're used. The version must be deployed in this environment and at or below the current deployment. Setting the version that is already the threshold changes nothing. Use a secret key from a deployed environment, such as staging or production. Development environments return 400. */
3034
+ export declare const setSkewProtectionThresholdV1: API.OperationMethod<SetSkewProtectionThresholdV1Request, SkewProtectionThresholdState, SetSkewProtectionThresholdV1Error, TriggerDevOpContext>;
2944
3035
  export type SetWebhookEndpointSecretV1Error = BadRequest | NotFound | TriggerDevOpError;
2945
3036
  /** Set a webhook signing secret Store the signing secret or public key the provider issued for this endpoint, such as the `whsec_` secret Stripe returns when you create a webhook endpoint. It replaces the existing secret. Pass `previousSecretTtlSeconds` to keep accepting the old secret for a while, for example while the provider rolls its secret. */
2946
3037
  export declare const setWebhookEndpointSecretV1: API.OperationMethod<SetWebhookEndpointSecretV1Request, SetWebhookEndpointSecretResponse, SetWebhookEndpointSecretV1Error, TriggerDevOpContext>;