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

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/README.md CHANGED
@@ -23,7 +23,6 @@ const program = Effect.gen(function* () {
23
23
  const Live = Layer.mergeAll(
24
24
  FetchHttpClient.layer,
25
25
  TriggerDev.CredentialsFromEnv,
26
- TriggerDev.TriggerDevProtocol,
27
26
  );
28
27
 
29
28
  program.pipe(Effect.provide(Live), Effect.runPromise);
@@ -1,2 +1,2 @@
1
- import{errors$API_ERRORS as e,errors$BadGateway as t,errors$BadRequest as n,errors$ConfigError as r,errors$Conflict as i,errors$DEFAULT_ERRORS as a,errors$Forbidden as o,errors$GatewayTimeout as s,errors$HTTP_STATUS_MAP as c,errors$InternalServerError as ee,errors$Locked as te,errors$NotFound as ne,errors$ServiceUnavailable as re,errors$TooManyRequests as ie,errors$Unauthorized as ae,errors$UnprocessableEntity as oe,protocol_rest$RawResponse as l,protocol_rest$RawResponseRoot as u,protocol_rest$SensitiveValue as d,protocol_rest$makeRestProtocol as f,protocol_rest$rawResponseRootSymbol as p,protocol_rest$rawResponseSymbol as m,protocol_rest$sensitiveValueSymbol as h,schema_lite$Array as g,schema_lite$Boolean as _,schema_lite$NullOr as v,schema_lite$Number as y,schema_lite$Record as b,schema_lite$String as x,schema_lite$Struct as S,schema_lite$TaggedError as C,schema_lite$Unknown as w,schema_lite$at as T,schema_lite$optional as E,schema_lite$suspend as D}from"@distilled.cloud/core/_bundle/rest";import{api$D as O,api$call as k,api$error as A,api$named as j,api$newError as M,api$op as N,category$withAuthError as P,category$withBadRequestError as F,category$withConflictError as I,category$withParseError as L,category$withServerError as R,retry$capped as z,retry$jittered as B,retry$makeDefault as V,retry$throttlingFactory as H,retry$throttlingOptions as U,retry$transientFactory as W,retry$transientOptions as G,schema_lite_typed$String as K,schema_lite_typed$TaggedError as q,schema_lite_typed$Unknown as J,schema_lite_typed$optional as Y,trait$Body as se,trait$FormDataFile as ce,trait$Header as le,trait$Http as ue,trait$HttpBody as de,trait$KeyDictionary as fe,trait$Label as pe,trait$Query as me,trait$ResponseCode as he,trait$UnionCases as ge,trait$applyErrorMatchers as _e,trait$bodySymbol as ve,trait$errorMatchersSymbol as ye,trait$formDataFileSymbol as be,trait$getErrorMatchers as xe,trait$headerSymbol as Se,trait$httpBodySymbol as Ce,trait$httpSymbol as we,trait$keyDictionarySymbol as Te,trait$labelSymbol as Ee,trait$querySymbol as De,trait$responseCodeSymbol as Oe,trait$unionCasesSymbol as ke}from"@distilled.cloud/core/_bundle/base";import*as X from"effect/Context";import*as Z from"effect/Effect";import*as Q from"effect/Layer";import*as $ from"effect/Redacted";const Ae=`https://api.trigger.dev`;var Credentials=class extends (/*@__PURE__*/ X.Service()(`TriggerDevCredentials`)){};const fromApiKey=e=>Q.succeed(Credentials,Z.succeed({apiKey:e.apiKey,apiBaseUrl:e.apiBaseUrl??`https://api.trigger.dev`}));const je=/*@__PURE__*/ Q.succeed(Credentials,/*@__PURE__*/ Z.gen(function*(){const e=process.env.TRIGGER_DEV_API_KEY??process.env.TRIGGER_SECRET_KEY;if(!e)return yield*new r({message:`TRIGGER_DEV_API_KEY (or TRIGGER_SECRET_KEY) environment variable is required`});return{apiKey:$.make(e),apiBaseUrl:process.env.TRIGGER_DEV_API_BASE_URL??`https://api.trigger.dev`}}));var UnknownTriggerDevError=class extends (/*@__PURE__*/ q()(`UnknownTriggerDevError`,{code:/*@__PURE__*/ Y(K),message:/*@__PURE__*/ Y(K),body:J}).pipe(R)){};var TriggerDevParseError=class extends (/*@__PURE__*/ q()(`TriggerDevParseError`,{body:J,cause:J}).pipe(L)){};const Me=/*@__PURE__*/ f({credentials:/*@__PURE__*/ Z.flatMap(Credentials,e=>e),baseUrl:e=>e.apiBaseUrl,headers:e=>({Authorization:`Bearer ${$.value(e.apiKey)}`}),unknownError:({code:e,message:t,body:n})=>new UnknownTriggerDevError({code:typeof e===`string`?e:e!==void 0?String(e):void 0,message:t,body:n}),parseError:({body:e,cause:t})=>new TriggerDevParseError({body:e,cause:t})});var Retry=class extends (/*@__PURE__*/ X.Service()(`TriggerDevRetry`)){};const policy=e=>Z.provide(Q.succeed(Retry,e));const Ne=/*@__PURE__*/ Z.provide(/*@__PURE__*/ Q.succeed(Retry,{while:()=>false}));const Pe=/*@__PURE__*/ policy(H);const Fe=/*@__PURE__*/ policy(W);export{I as Ba,g as Mb,_ as Nb,v as Ub,y as Vb,b as Wb,x as Yb,S as Zb,O as a,C as ac,k as c,Credentials as credentials$Credentials,je as credentials$CredentialsFromEnv,Ae as credentials$DEFAULT_API_BASE_URL,fromApiKey as credentials$fromApiKey,w as dc,A as e,e as errors$API_ERRORS,t as errors$BadGateway,n as errors$BadRequest,r as errors$ConfigError,i as errors$Conflict,a as errors$DEFAULT_ERRORS,o as errors$Forbidden,s as errors$GatewayTimeout,c as errors$HTTP_STATUS_MAP,ee as errors$InternalServerError,te as errors$Locked,ne as errors$NotFound,re as errors$ServiceUnavailable,ie as errors$TooManyRequests,TriggerDevParseError as errors$TriggerDevParseError,ae as errors$Unauthorized,UnknownTriggerDevError as errors$UnknownTriggerDevError,oe as errors$UnprocessableEntity,T as fc,j as k,E as kc,M as l,D as lc,N as m,Me as protocol$TriggerDevProtocol,Retry as retry$Retry,z as retry$capped,B as retry$jittered,V as retry$makeDefault,Ne as retry$none,policy as retry$policy,Pe as retry$throttling,H as retry$throttlingFactory,U as retry$throttlingOptions,Fe as retry$transient,W as retry$transientFactory,G as retry$transientOptions,se as traits$Body,ce as traits$FormDataFile,le as traits$Header,ue as traits$Http,de as traits$HttpBody,fe as traits$KeyDictionary,pe as traits$Label,me as traits$Query,l as traits$RawResponse,u as traits$RawResponseRoot,he as traits$ResponseCode,d as traits$SensitiveValue,ge as traits$UnionCases,_e as traits$applyErrorMatchers,ve as traits$bodySymbol,ye as traits$errorMatchersSymbol,be as traits$formDataFileSymbol,xe as traits$getErrorMatchers,Se as traits$headerSymbol,Ce as traits$httpBodySymbol,we as traits$httpSymbol,Te as traits$keyDictionarySymbol,Ee as traits$labelSymbol,De as traits$querySymbol,p as traits$rawResponseRootSymbol,m as traits$rawResponseSymbol,Oe as traits$responseCodeSymbol,h as traits$sensitiveValueSymbol,ke as traits$unionCasesSymbol,P as xa,F as ya};
1
+ import{errors$API_ERRORS as e,errors$BadGateway as t,errors$BadRequest as n,errors$ConfigError as r,errors$Conflict as i,errors$DEFAULT_ERRORS as a,errors$Forbidden as ee,errors$GatewayTimeout as te,errors$HTTP_STATUS_MAP as ne,errors$InternalServerError as re,errors$Locked as ie,errors$NotFound as ae,errors$ServiceUnavailable as o,errors$TooManyRequests as s,errors$Unauthorized as c,errors$UnknownErrorFields as l,errors$UnprocessableEntity as u,protocol_rest$RawResponse as d,protocol_rest$RawResponseRoot as f,protocol_rest$SensitiveValue as p,protocol_rest$rawResponseRootSymbol as m,protocol_rest$rawResponseSymbol as h,protocol_rest$restProtocol as g,protocol_rest$sensitiveValueSymbol as _,protocol_rest$unknownErrorProps as v,schema_lite$Array as y,schema_lite$Boolean as b,schema_lite$NullOr as x,schema_lite$Number as S,schema_lite$Record as C,schema_lite$String as w,schema_lite$Struct as T,schema_lite$TaggedError as E,schema_lite$Union as D,schema_lite$Unknown as O,schema_lite$at as k,schema_lite$optional as A,schema_lite$suspend as j}from"@distilled.cloud/core/_bundle/rest";import{api$D as M,api$call as N,api$error as P,api$named as F,api$newError as I,api$op as L,category$withAuthError as R,category$withBadRequestError as z,category$withConflictError as B,category$withParseError as V,retry$capped as H,retry$jittered as U,retry$makeDefault as W,retry$throttlingFactory as G,retry$throttlingOptions as oe,retry$transientFactory as K,retry$transientOptions as q,schema_lite_typed$TaggedError as J,schema_lite_typed$Unknown as Y,trait$Body as se,trait$FormDataFile as ce,trait$Header as le,trait$Http as ue,trait$HttpBody as de,trait$KeyDictionary as fe,trait$Label as pe,trait$Query as me,trait$ResponseCode as he,trait$UnionCases as ge,trait$applyErrorMatchers as _e,trait$bodySymbol as ve,trait$errorMatchersSymbol as ye,trait$formDataFileSymbol as be,trait$getErrorMatchers as xe,trait$headerSymbol as Se,trait$httpBodySymbol as Ce,trait$httpSymbol as we,trait$keyDictionarySymbol as Te,trait$labelSymbol as Ee,trait$querySymbol as De,trait$responseCodeSymbol as Oe,trait$unionCasesSymbol as ke}from"@distilled.cloud/core/_bundle/base";import*as X from"effect/Context";import*as Z from"effect/Effect";import*as Q from"effect/Layer";import*as $ from"effect/Redacted";const Ae=`https://api.trigger.dev`;var Credentials=class extends (/*@__PURE__*/ X.Service()(`TriggerDevCredentials`)){};const fromApiKey=e=>Q.succeed(Credentials,Z.succeed({apiKey:e.apiKey,apiBaseUrl:e.apiBaseUrl??`https://api.trigger.dev`}));const je=/*@__PURE__*/ Q.effect(Credentials,/*@__PURE__*/ Z.map(/*@__PURE__*/ Z.gen(function*(){const e=process.env.TRIGGER_DEV_API_KEY??process.env.TRIGGER_SECRET_KEY;if(!e)return yield*new r({message:`TRIGGER_DEV_API_KEY (or TRIGGER_SECRET_KEY) environment variable is required`});return{apiKey:$.make(e),apiBaseUrl:process.env.TRIGGER_DEV_API_BASE_URL??`https://api.trigger.dev`}}),e=>Z.succeed(e)));var UnknownTriggerDevError=class extends (/*@__PURE__*/ J()(`UnknownTriggerDevError`,l)){};var TriggerDevParseError=class extends (/*@__PURE__*/ J()(`TriggerDevParseError`,{body:Y,cause:Y}).pipe(V)){};const Me=e;const Ne=/*@__PURE__*/ g({credentials:/*@__PURE__*/ Z.flatten(Credentials),baseUrl:e=>e.apiBaseUrl,headers:e=>({Authorization:`Bearer ${$.value(e.apiKey)}`}),unknownError:e=>new UnknownTriggerDevError(v(e)),parseError:({body:e,cause:t})=>new TriggerDevParseError({body:e,cause:t})});var Retry=class extends (/*@__PURE__*/ X.Service()(`TriggerDevRetry`)){};const policy=e=>Z.provide(Q.succeed(Retry,e));const Pe=/*@__PURE__*/ Z.provide(/*@__PURE__*/ Q.succeed(Retry,{while:()=>false}));const Fe=/*@__PURE__*/ policy(G);const Ie=/*@__PURE__*/ policy(K);export{B as Ca,y as Zb,b as _b,M as a,N as b,Credentials as credentials$Credentials,je as credentials$CredentialsFromEnv,Ae as credentials$DEFAULT_API_BASE_URL,fromApiKey as credentials$fromApiKey,e as errors$API_ERRORS,t as errors$BadGateway,n as errors$BadRequest,r as errors$ConfigError,i as errors$Conflict,a as errors$DEFAULT_ERRORS,ee as errors$Forbidden,te as errors$GatewayTimeout,ne as errors$HTTP_STATUS_MAP,re as errors$InternalServerError,ie as errors$Locked,ae as errors$NotFound,o as errors$ServiceUnavailable,s as errors$TooManyRequests,TriggerDevParseError as errors$TriggerDevParseError,Me as errors$TriggerDevServiceErrors,c as errors$Unauthorized,UnknownTriggerDevError as errors$UnknownTriggerDevError,u as errors$UnprocessableEntity,P as f,x as hc,S as ic,C as jc,F as l,w as lc,I as m,T as mc,L as n,E as oc,Ne as protocol$TriggerDevProtocol,D as qc,O as rc,Retry as retry$Retry,H as retry$capped,U as retry$jittered,W as retry$makeDefault,Pe as retry$none,policy as retry$policy,Fe as retry$throttling,G as retry$throttlingFactory,oe as retry$throttlingOptions,Ie as retry$transient,K as retry$transientFactory,q as retry$transientOptions,k as tc,se as traits$Body,ce as traits$FormDataFile,le as traits$Header,ue as traits$Http,de as traits$HttpBody,fe as traits$KeyDictionary,pe as traits$Label,me as traits$Query,d as traits$RawResponse,f as traits$RawResponseRoot,he as traits$ResponseCode,p as traits$SensitiveValue,ge as traits$UnionCases,_e as traits$applyErrorMatchers,ve as traits$bodySymbol,ye as traits$errorMatchersSymbol,be as traits$formDataFileSymbol,xe as traits$getErrorMatchers,Se as traits$headerSymbol,Ce as traits$httpBodySymbol,we as traits$httpSymbol,Te as traits$keyDictionarySymbol,Ee as traits$labelSymbol,De as traits$querySymbol,m as traits$rawResponseRootSymbol,h as traits$rawResponseSymbol,Oe as traits$responseCodeSymbol,_ as traits$sensitiveValueSymbol,ke as traits$unionCasesSymbol,R as ya,A as yc,z as za,j as zc};
2
2
  //# sourceMappingURL=sdk.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sdk.js","names":["Schema.String","Schema.Unknown","Category.withServerError","Category.withParseError","API_ERRORS","BadGateway","BadRequest","ConfigError","Conflict","DEFAULT_ERRORS","Forbidden","GatewayTimeout","HTTP_STATUS_MAP","InternalServerError","Locked","NotFound","ServiceUnavailable","TooManyRequests","Unauthorized","UnprocessableEntity","RawResponse","RawResponseRoot","SensitiveValue","makeRestProtocol","rawResponseRootSymbol","rawResponseSymbol","sensitiveValueSymbol","Array","Boolean","NullOr","Number","Record","String$1","Struct","TaggedError","Unknown","at","optional","suspend","D","call","error","named","newError","op","withAuthError","withBadRequestError","withConflictError","withParseError","withServerError","capped","jittered","makeDefault","throttlingFactory","throttlingOptions","transientFactory","transientOptions","String$2","TaggedError$1","Unknown$1","optional$1","Body","FormDataFile","Header","Http","HttpBody","KeyDictionary","Label","Query","ResponseCode","UnionCases","applyErrorMatchers","bodySymbol","errorMatchersSymbol","formDataFileSymbol","getErrorMatchers","headerSymbol","httpBodySymbol","httpSymbol","keyDictionarySymbol","labelSymbol","querySymbol","responseCodeSymbol","unionCasesSymbol","Context","Effect","Layer","Redacted","DEFAULT_API_BASE_URL","config","CredentialsFromEnv","apiKey","TriggerDevProtocol","resolve","creds","code","optionsOrFactory","none","throttling","transient"],"sources":["../../src/credentials.ts","../../src/errors.ts","../../src/protocol.ts","../../src/retry.ts"],"mappings":"yvEAaA,MAAawF,GAAuB,0BAOpC,IAAa,YAAb,eACwB,gBAAQ,QAAyD,CAAC,CACtF,uBACF,EAAA,AAAE,CAAC,EAGL,MAAa,WAAc,GAIzBF,EAAM,QACJ,YACAD,EAAO,QAAQ,CACb,OAAQI,EAAO,OACf,WAAYA,EAAO,YAAA,yBACrB,CAAC,CACH,EAMF,MAAaC,GAA6D,gBAAM,QAC9E,YACc,gBAAO,IAAI,WAAa,CACpC,MAAMC,EAAS,QAAQ,IAAI,qBAAuB,QAAQ,IAAI,mBAE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3,"file":"sdk.js","names":["Schema.Unknown","Category.withParseError","API_ERRORS","BadGateway","BadRequest","ConfigError","Conflict","DEFAULT_ERRORS","Forbidden","GatewayTimeout","HTTP_STATUS_MAP","InternalServerError","Locked","NotFound","ServiceUnavailable","TooManyRequests","Unauthorized","UnknownErrorFields","UnprocessableEntity","RawResponse","RawResponseRoot","SensitiveValue","rawResponseRootSymbol","rawResponseSymbol","restProtocol","sensitiveValueSymbol","unknownErrorProps","Array","Boolean","NullOr","Number","Record","String","Struct","TaggedError","Union","Unknown","at","optional","suspend","D","call","error","named","newError","op","withAuthError","withBadRequestError","withConflictError","withParseError","capped","jittered","makeDefault","throttlingFactory","throttlingOptions","transientFactory","transientOptions","TaggedError$1","Unknown$1","Body","FormDataFile","Header","Http","HttpBody","KeyDictionary","Label","Query","ResponseCode","UnionCases","applyErrorMatchers","bodySymbol","errorMatchersSymbol","formDataFileSymbol","getErrorMatchers","headerSymbol","httpBodySymbol","httpSymbol","keyDictionarySymbol","labelSymbol","querySymbol","responseCodeSymbol","unionCasesSymbol","Context","Effect","Layer","Redacted","DEFAULT_API_BASE_URL","config","CredentialsFromEnv","apiKey","TriggerDevServiceErrors","TriggerDevProtocol","creds","info","optionsOrFactory","none","throttling","transient"],"sources":["../../src/credentials.ts","../../src/errors.ts","../../src/protocol.ts","../../src/retry.ts"],"mappings":"ovEAaA,MAAasF,GAAuB,0BAOpC,IAAa,YAAb,eACwB,gBAAQ,QAA4C,CAAC,CACzE,uBACF,EAAA,AAAE,CAAC,EAGL,MAAa,WAAc,GAIzBF,EAAM,QACJ,YACAD,EAAO,QAAQ,CACb,OAAQI,EAAO,OACf,WAAYA,EAAO,YAAA,yBACrB,CAAC,CACH,EASF,MAAaC,GAA0E,gBAAM,OAC3F,YACc,gBAAO,IACL,gBAAO,IAAI,WAAa,CACpC,MAAMC,EAAS,QAAQ,IAAI,qBAAuB,QAAQ,IAAI,mBAE9D,GAAI,CAACA,EACH,OAAO,MAAO,IAAIpF,EAAY,CAC5B,QAAS,8EACX,CAAC,EAGH,MAAO,CACL,OAAQgF,EAAS,KAAKI,CAAM,EAC5B,WAAY,QAAQ,IAAI,0BAAA,yBAC1B,CACF,CAAC,EACA,GAAWN,EAAO,QAAQI,CAAM,CACnC,CACF,EC9BA,IAAa,uBAAb,eACwB,gBAA2C,CAAC,CAChE,yBACAtE,CACF,EAAA,AAAE,CAAC,EAGL,IAAa,qBAAb,eACwB,gBAAyC,CAAC,CAAC,uBAAwB,CACvF,KAAMjB,EACN,MAAOA,CACT,CAAC,CAAC,CAAC,KAAKC,CAAuB,EAAA,AAAE,CAAC,EAOpC,MAAayF,GAA0BxF,ECXvC,MAAayF,GAAmC,gBAAa,CAG3D,YAA2B,gBAAO,QAAQ,WAAW,EACrD,QAAU,GAAUC,EAAM,WAC1B,QAAU,IAAW,CACnB,cAAe,UAAUP,EAAS,MAAMO,EAAM,MAAM,GACtD,GACA,aAAe,GAAS,IAAI,uBAAuBlE,EAAkBmE,CAAI,CAAC,EAC1E,YAAa,CAAE,OAAM,WAAY,IAAI,qBAAqB,CAAE,OAAM,OAAM,CAAC,CAC3E,CAAC,ECjBD,IAAa,MAAb,eAAyC,gBAAQ,QAAuB,CAAC,CAAC,iBAAiB,EAAA,AAAE,CAAC,EAG9F,MAAa,OAAU,GACrBV,EAAO,QAAQC,EAAM,QAAQ,MAAOU,CAAgB,CAAC,EAGvD,MAAaC,GAAqB,gBAAO,QACzB,gBAAM,QAAQ,MAAO,CAAE,UAAa,KAAM,CAAC,CAC3D,EAGA,MAAaC,GAA2B,qBAAO3C,CAAiB,EAGhE,MAAa4C,GAA0B,qBAAO1C,CAAgB"}
@@ -3,7 +3,7 @@ import { ConfigError } from "@distilled.cloud/core/errors";
3
3
  * Trigger.dev credentials -- hand-written.
4
4
  *
5
5
  * The `Credentials` service holds an *effect* that resolves the current
6
- * credentials on every request (the protocol layer resolves it per request
6
+ * credentials on every request (the protocol resolves it per request
7
7
  * on the calling fiber).
8
8
  */
9
9
  import * as Context from "effect/Context";
@@ -15,7 +15,7 @@ export interface Config {
15
15
  readonly apiKey: Redacted.Redacted<string>;
16
16
  readonly apiBaseUrl: string;
17
17
  }
18
- declare const Credentials_base: Context.ServiceClass<Credentials, "TriggerDevCredentials", Effect.Effect<Config, ConfigError, never>>;
18
+ declare const Credentials_base: Context.ServiceClass<Credentials, "TriggerDevCredentials", Effect.Effect<Config, never, never>>;
19
19
  export declare class Credentials extends /*@__PURE__*/ Credentials_base {
20
20
  }
21
21
  /** Layer from a redacted API key + optional base URL. */
@@ -26,7 +26,10 @@ export declare const fromApiKey: (config: {
26
26
  /**
27
27
  * Reads TRIGGER_DEV_API_KEY (required) and TRIGGER_DEV_API_BASE_URL
28
28
  * (optional). TRIGGER_SECRET_KEY is accepted as a vendor-docs alias.
29
+ *
30
+ * Its configuration is read and checked once, when the layer is built: a
31
+ * problem there fails the layer with `ConfigError`.
29
32
  */
30
- export declare const CredentialsFromEnv: Layer.Layer<Credentials>;
33
+ export declare const CredentialsFromEnv: Layer.Layer<Credentials, ConfigError>;
31
34
  export {};
32
35
  //# sourceMappingURL=credentials.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D;;;;;;GAMG;AACH,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAE5C,eAAO,MAAM,oBAAoB,4BAA4B,CAAC;AAE9D,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC3C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;;AAED,qBAAa,WAC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,CAAC"}
package/lib/errors.d.ts CHANGED
@@ -11,14 +11,11 @@ export { BadGateway, BadRequest, Conflict, ConfigError, Forbidden, GatewayTimeou
11
11
  export type { DefaultErrors } from "@distilled.cloud/core/errors";
12
12
  import * as Schema from "@distilled.cloud/core/schema-lite-typed";
13
13
  declare const UnknownTriggerDevError_base: Schema.TaggedErrorClass<"UnknownTriggerDevError", {
14
- readonly code: import("effect/Schema").optional<import("effect/Schema").String>;
15
- readonly message: import("effect/Schema").optional<import("effect/Schema").String>;
16
- readonly body: import("effect/Schema").Unknown;
17
- }> & (new (...args: any[]) => {
18
- "@distilled.cloud/error/categories": {
19
- ServerError: true;
20
- };
21
- });
14
+ status: import("effect/Schema").Number;
15
+ code: import("effect/Schema").optional<import("effect/Schema").String>;
16
+ message: import("effect/Schema").optional<import("effect/Schema").String>;
17
+ body: import("effect/Schema").Unknown;
18
+ }>;
22
19
  /** Unknown Trigger.dev error -- returned when nothing else matches the failure. */
23
20
  export declare class UnknownTriggerDevError extends /*@__PURE__*/ UnknownTriggerDevError_base {
24
21
  }
@@ -33,4 +30,11 @@ declare const TriggerDevParseError_base: Schema.TaggedErrorClass<"TriggerDevPars
33
30
  /** Schema parse error wrapper. */
34
31
  export declare class TriggerDevParseError extends /*@__PURE__*/ TriggerDevParseError_base {
35
32
  }
33
+ /**
34
+ * The errors declared on the Trigger.dev service: any operation can return
35
+ * them, and every generated operation lists them as its `serviceErrors`. Today
36
+ * that is each of core's status classes (401, 403, 404, 429, the 5xx ...).
37
+ */
38
+ export declare const TriggerDevServiceErrors: readonly [typeof import("@distilled.cloud/core/errors").Unauthorized, typeof import("@distilled.cloud/core/errors").Forbidden, typeof import("@distilled.cloud/core/errors").NotFound, typeof import("@distilled.cloud/core/errors").BadRequest, typeof import("@distilled.cloud/core/errors").Conflict, typeof import("@distilled.cloud/core/errors").UnprocessableEntity, typeof import("@distilled.cloud/core/errors").TooManyRequests, typeof import("@distilled.cloud/core/errors").Locked, typeof import("@distilled.cloud/core/errors").InternalServerError, typeof import("@distilled.cloud/core/errors").BadGateway, typeof import("@distilled.cloud/core/errors").ServiceUnavailable, typeof import("@distilled.cloud/core/errors").GatewayTimeout];
39
+ export type TriggerDevServiceError = InstanceType<(typeof TriggerDevServiceErrors)[number]>;
36
40
  //# sourceMappingURL=errors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EACL,UAAU,EACV,UAAU,EACV,QAAQ,EACR,WAAW,EACX,SAAS,EACT,cAAc,EACd,mBAAmB,EACnB,MAAM,EACN,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,UAAU,GACX,MAAM,8BAA8B,CAAC;AACtC,YAAY,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAGlE,OAAO,KAAK,MAAM,MAAM,yCAAyC,CAAC;;;;;;;;;;AAElE,mFAAmF;AACnF,qBAAa,sBACX,SAAQ,aAAa,CAAC,2BAIW;CAAG;;;;;;;;;AAEtC,kCAAkC;AAClC,qBAAa,oBACX,SAAQ,aAAa,CAAC,yBAGU;CAAG"}
1
+ {"version":3,"file":"errors.d.ts","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EACL,UAAU,EACV,UAAU,EACV,QAAQ,EACR,WAAW,EACX,SAAS,EACT,cAAc,EACd,mBAAmB,EACnB,MAAM,EACN,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,UAAU,GACX,MAAM,8BAA8B,CAAC;AACtC,YAAY,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAIlE,OAAO,KAAK,MAAM,MAAM,yCAAyC,CAAC;;;;;;;AAElE,mFAAmF;AACnF,qBAAa,sBACX,SAAQ,aAAa,CAAC,2BAGrB;CAAG;;;;;;;;;AAEN,kCAAkC;AAClC,qBAAa,oBACX,SAAQ,aAAa,CAAC,yBAGU;CAAG;AAErC;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,+tBAAa,CAAC;AAClD,MAAM,MAAM,sBAAsB,GAAG,YAAY,CAAC,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC"}
package/lib/errors.js CHANGED
@@ -1 +1 @@
1
- export { errors$API_ERRORS as API_ERRORS, errors$BadGateway as BadGateway, errors$BadRequest as BadRequest, errors$ConfigError as ConfigError, errors$Conflict as Conflict, errors$DEFAULT_ERRORS as DEFAULT_ERRORS, errors$Forbidden as Forbidden, errors$GatewayTimeout as GatewayTimeout, errors$HTTP_STATUS_MAP as HTTP_STATUS_MAP, errors$InternalServerError as InternalServerError, errors$Locked as Locked, errors$NotFound as NotFound, errors$ServiceUnavailable as ServiceUnavailable, errors$TooManyRequests as TooManyRequests, errors$TriggerDevParseError as TriggerDevParseError, errors$Unauthorized as Unauthorized, errors$UnknownTriggerDevError as UnknownTriggerDevError, errors$UnprocessableEntity as UnprocessableEntity } from "./_bundle/sdk.js";
1
+ export { errors$API_ERRORS as API_ERRORS, errors$BadGateway as BadGateway, errors$BadRequest as BadRequest, errors$ConfigError as ConfigError, errors$Conflict as Conflict, errors$DEFAULT_ERRORS as DEFAULT_ERRORS, errors$Forbidden as Forbidden, errors$GatewayTimeout as GatewayTimeout, errors$HTTP_STATUS_MAP as HTTP_STATUS_MAP, errors$InternalServerError as InternalServerError, errors$Locked as Locked, errors$NotFound as NotFound, errors$ServiceUnavailable as ServiceUnavailable, errors$TooManyRequests as TooManyRequests, errors$TriggerDevParseError as TriggerDevParseError, errors$TriggerDevServiceErrors as TriggerDevServiceErrors, errors$Unauthorized as Unauthorized, errors$UnknownTriggerDevError as UnknownTriggerDevError, errors$UnprocessableEntity as UnprocessableEntity } from "./_bundle/sdk.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AACjC,OAAO,EACL,kBAAkB,EAClB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,GACzB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAKhD,cAAc,2BAA2B,CAAC;AAC1C,OAAO,EACL,UAAU,EACV,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,mBAAmB,GACpB,MAAM,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AACjC,OAAO,EACL,kBAAkB,EAClB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,GACzB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAKhD,cAAc,2BAA2B,CAAC;AAC1C,OAAO,EACL,UAAU,EACV,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,mBAAmB,GACpB,MAAM,2BAA2B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AACjC,OAAO,EACL,kBAAkB,GAGnB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAChD,4EAA4E;AAC5E,qEAAqE;AACrE,wEAAwE;AACxE,yBAAyB;AACzB,cAAc,2BAA2B,CAAC;AAC1C,OAAO,EACL,UAAU,EACV,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,mBAAmB,GACpB,MAAM,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.js","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AACjC,OAAO,EACL,kBAAkB,GAGnB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAChD,4EAA4E;AAC5E,qEAAqE;AACrE,wEAAwE;AACxE,yBAAyB;AACzB,cAAc,2BAA2B,CAAC;AAC1C,OAAO,EACL,UAAU,EACV,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,mBAAmB,GACpB,MAAM,2BAA2B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../src/pagination.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC"}
1
+ {"version":3,"file":"pagination.d.ts","sources":["../src/pagination.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC"}
package/lib/protocol.d.ts CHANGED
@@ -1,20 +1,17 @@
1
- import type * as API from "@distilled.cloud/core/api";
2
- import type { API_ERRORS, ConfigError, InvalidInput } from "@distilled.cloud/core/errors";
3
- import type { SdkError } from "@distilled.cloud/core/sdk-error";
1
+ import type { ErrorOf } from "@distilled.cloud/core/protocol";
4
2
  import type * as HttpClient from "effect/http/HttpClient";
5
- import type * as HttpClientError from "effect/http/HttpClientError";
6
- import type * as Layer from "effect/Layer";
7
3
  import { Credentials } from "./credentials.ts";
8
- import { UnknownTriggerDevError, TriggerDevParseError } from "./errors.ts";
4
+ import { UnknownTriggerDevError, TriggerDevParseError, type TriggerDevServiceError } from "./errors.ts";
9
5
  /**
10
- * Error channel shared by every generated Trigger.dev operation. Generated
11
- * service files annotate operations with
6
+ * What every generated Trigger.dev operation fails with besides its own
7
+ * errors: the service's errors, the protocol's, and what resolving the
8
+ * credentials fails with. Generated service files annotate operations with
12
9
  * `API.OperationMethod<I, O, TriggerDevOpError, TriggerDevOpContext>`
13
10
  * explicitly so the compiler never infers these back out of the schema
14
11
  * generics.
15
12
  */
16
- export type TriggerDevOpError = InstanceType<(typeof API_ERRORS)[number]> | UnknownTriggerDevError | ConfigError | HttpClientError.HttpClientError | TriggerDevParseError | InvalidInput | SdkError;
13
+ export type TriggerDevOpError = TriggerDevServiceError | ErrorOf<typeof TriggerDevProtocol>;
17
14
  /** Context (requirements) shared by every generated Trigger.dev operation. */
18
15
  export type TriggerDevOpContext = Credentials | HttpClient.HttpClient;
19
- export declare const TriggerDevProtocol: Layer.Layer<API.Protocol>;
16
+ export declare const TriggerDevProtocol: import("@distilled.cloud/core/protocol").Protocol<TriggerDevParseError | UnknownTriggerDevError | import("@distilled.cloud/core/protocol-rest").RestProtocolError, Credentials>;
20
17
  //# sourceMappingURL=protocol.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,GAAG,MAAM,2BAA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AC9E,MAAM,MAAM,mBAAmB,GAAG,WAAW,GAAG,UAAU,CAAC,UAAU,CAAC;AAEtE,eAAO,MAAM,kBAAkB,iLAU7B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../src/retry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAuC,MAAM,6BAA6B,CAAC;AAC/F;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,OAAO,EACZ,KAAK,MAAM,EACX,WAAW,EACX,QAAQ,EACR,MAAM,EACN,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,6BAA6B,CAAC;;AAErC,2EAA2E;AAC3E,qBAAa,KAAM,SAAQ,aAAa,CAAC,UAAmD;CAAG;AAE/F,6EAA6E;AAC7E,eAAO,MAAM,MAAM,qBAAsB,MAAM,sFACS,CAAC;AAEzD,sCAAsC;AACtC,eAAO,MAAM,IAAI,mFAEhB,CAAC;AAEF,kFAAkF;AAClF,eAAO,MAAM,UAAU,mFAA0C,CAAC;AAElE,oFAAoF;AACpF,eAAO,MAAM,SAAS,mFAAyC,CAAC"}
1
+ {"version":3,"file":"retry.d.ts","sources":["../src/retry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAuC,MAAM,6BAA6B,CAAC;AAC/F;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,OAAO,EACZ,KAAK,MAAM,EACX,WAAW,EACX,QAAQ,EACR,MAAM,EACN,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,6BAA6B,CAAC;;AAErC,2EAA2E;AAC3E,qBAAa,KAAM,SAAQ,aAAa,CAAC,UAAmD;CAAG;AAE/F,6EAA6E;AAC7E,eAAO,MAAM,MAAM,qBAAsB,MAAM,sFACS,CAAC;AAEzD,sCAAsC;AACtC,eAAO,MAAM,IAAI,mFAEhB,CAAC;AAEF,kFAAkF;AAClF,eAAO,MAAM,UAAU,mFAA0C,CAAC;AAElE,oFAAoF;AACpF,eAAO,MAAM,SAAS,mFAAyC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sources":["../../src/services/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC"}
@@ -6,52 +6,67 @@ export type { TriggerDevOpError, TriggerDevOpContext };
6
6
  declare const BadRequest_base: S.TaggedErrorClass<"BadRequest", {
7
7
  readonly code: any;
8
8
  readonly message: any;
9
+ readonly body: any;
10
+ readonly headers: any;
9
11
  }> & (new (...args: any[]) => {
10
12
  "@distilled.cloud/error/categories": {
11
13
  BadRequestError: true;
12
14
  };
13
15
  });
14
16
  export declare class BadRequest extends /*@__PURE__*/ BadRequest_base {
17
+ readonly body?: Error403Body | ErrorResponse | Error400Body3 | InvalidEnvVarsRequestResponse | Error400Body4 | Error400Body5 | ErrorWithDetailsResponse | Error400Body | Error400Body2 | string;
15
18
  }
16
19
  declare const Conflict_base: S.TaggedErrorClass<"Conflict", {
17
20
  readonly code: any;
18
21
  readonly message: any;
22
+ readonly body: any;
23
+ readonly headers: any;
19
24
  }> & (new (...args: any[]) => {
20
25
  "@distilled.cloud/error/categories": {
21
26
  ConflictError: true;
22
27
  };
23
28
  });
24
29
  export declare class Conflict extends /*@__PURE__*/ Conflict_base {
30
+ readonly body?: Error403Body | ErrorResponse | string;
25
31
  }
26
32
  declare const Forbidden_base: S.TaggedErrorClass<"Forbidden", {
27
33
  readonly code: any;
28
34
  readonly message: any;
35
+ readonly body: any;
36
+ readonly headers: any;
29
37
  }> & (new (...args: any[]) => {
30
38
  "@distilled.cloud/error/categories": {
31
39
  AuthError: true;
32
40
  };
33
41
  });
34
42
  export declare class Forbidden extends /*@__PURE__*/ Forbidden_base {
43
+ readonly body?: ErrorResponse | Error403Body | string;
35
44
  }
36
45
  declare const NotFound_base: S.TaggedErrorClass<"NotFound", {
37
46
  readonly code: any;
38
47
  readonly message: any;
48
+ readonly body: any;
49
+ readonly headers: any;
39
50
  }> & (new (...args: any[]) => {
40
51
  "@distilled.cloud/error/categories": {
41
52
  BadRequestError: true;
42
53
  };
43
54
  });
44
55
  export declare class NotFound extends /*@__PURE__*/ NotFound_base {
56
+ readonly body?: Error404Body | Error403Body | WebhookWaiterErrorResponse | ErrorResponse | Error404Body4 | Error404Body2 | Error404Body3 | string;
45
57
  }
46
58
  declare const UnprocessableEntity_base: S.TaggedErrorClass<"UnprocessableEntity", {
47
59
  readonly code: any;
48
60
  readonly message: any;
61
+ readonly body: any;
62
+ readonly headers: any;
49
63
  }> & (new (...args: any[]) => {
50
64
  "@distilled.cloud/error/categories": {
51
65
  BadRequestError: true;
52
66
  };
53
67
  });
54
68
  export declare class UnprocessableEntity extends /*@__PURE__*/ UnprocessableEntity_base {
69
+ readonly body?: Error422Body | ErrorResponse | ErrorWithDetailsResponse | WebhookWaiterErrorResponse | string;
55
70
  }
56
71
  export interface ActivateScheduleV1Request {
57
72
  /** The ID of the schedule. */
@@ -2630,6 +2645,83 @@ export interface UploadProjectEnvvarsV1Request {
2630
2645
  /** Whether to override existing variables or not */
2631
2646
  override?: boolean | undefined;
2632
2647
  }
2648
+ export interface Error403Body {
2649
+ error?: string | undefined;
2650
+ }
2651
+ export interface ErrorResponse {
2652
+ error: string;
2653
+ }
2654
+ export type Error400BodyError2 = "Invalid or missing run ID" | "Failed to create new run";
2655
+ export interface Error400Body3 {
2656
+ error?: Error400BodyError2 | undefined;
2657
+ }
2658
+ export type InvalidEnvVarsRequestResponseIssuesList = Array<unknown>;
2659
+ export type InvalidEnvVarsRequestResponseVariableErrorsList = Array<unknown>;
2660
+ export interface InvalidEnvVarsRequestResponse {
2661
+ error?: string | undefined;
2662
+ issues?: InvalidEnvVarsRequestResponseIssuesList | undefined;
2663
+ variableErrors?: InvalidEnvVarsRequestResponseVariableErrorsList | undefined;
2664
+ }
2665
+ export interface Error400Body4 {
2666
+ /** Error message describing the query error */
2667
+ error?: string | undefined;
2668
+ }
2669
+ export type Error400BodyError3 = "Invalid or missing run ID";
2670
+ export interface Error400Body5 {
2671
+ error?: Error400BodyError3 | undefined;
2672
+ }
2673
+ /** The relevant path in the request */
2674
+ export type ErrorWithDetailsResponseDetailsItemPathList = Array<string>;
2675
+ export interface ErrorWithDetailsResponseDetailsItem {
2676
+ /** The error code */
2677
+ code: string;
2678
+ /** The error message */
2679
+ message: string;
2680
+ /** The relevant path in the request */
2681
+ path?: ErrorWithDetailsResponseDetailsItemPathList | undefined;
2682
+ }
2683
+ export type ErrorWithDetailsResponseDetailsList = Array<ErrorWithDetailsResponseDetailsItem>;
2684
+ export interface ErrorWithDetailsResponse {
2685
+ error: string;
2686
+ details?: ErrorWithDetailsResponseDetailsList | undefined;
2687
+ }
2688
+ export interface Error400Body {
2689
+ /** What was wrong with the request. */
2690
+ error?: string | undefined;
2691
+ }
2692
+ export type Error400BodyError = "Invalid or missing run ID" | "Invalid metadata";
2693
+ export interface Error400Body2 {
2694
+ error?: Error400BodyError | undefined;
2695
+ }
2696
+ export type Error404BodyError = "Run not found";
2697
+ export interface Error404Body {
2698
+ error?: Error404BodyError | undefined;
2699
+ }
2700
+ export type WebhookWaiterErrorResponseCode = "webhook_waiter_limit" | "webhook_endpoint_not_found" | "webhook_filter_invalid" | "invalid_request";
2701
+ /** For `webhook_waiter_limit`, which limit was reached. */
2702
+ export type WebhookWaiterErrorResponseReason = "environment_limit" | "endpoint_limit" | "shape_limit" | "timeout_too_long";
2703
+ export interface WebhookWaiterErrorResponse {
2704
+ error: string;
2705
+ code: WebhookWaiterErrorResponseCode;
2706
+ /** For `webhook_waiter_limit`, which limit was reached. */
2707
+ reason?: WebhookWaiterErrorResponseReason | undefined;
2708
+ }
2709
+ export type Error404BodyError4 = "Run either doesn't exist or is not finished";
2710
+ export interface Error404Body4 {
2711
+ error?: Error404BodyError4 | undefined;
2712
+ }
2713
+ export type Error404BodyError2 = "Run not found" | "Trace not found";
2714
+ export interface Error404Body2 {
2715
+ error?: Error404BodyError2 | undefined;
2716
+ }
2717
+ export type Error404BodyError3 = "Task Run not found";
2718
+ export interface Error404Body3 {
2719
+ error?: Error404BodyError3 | undefined;
2720
+ }
2721
+ export interface Error422Body {
2722
+ /** Runs can only have 10 tags. */
2723
+ error?: string | undefined;
2724
+ }
2633
2725
  export type ActivateScheduleV1Error = NotFound | TriggerDevOpError;
2634
2726
  /** Activate Schedule Activate a schedule by its ID. This will only work on `IMPERATIVE` schedules that were created in the dashboard or using the imperative SDK functions like `schedules.create()`. */
2635
2727
  export declare const activateScheduleV1: API.OperationMethod<ActivateScheduleV1Request, ScheduleObject, ActivateScheduleV1Error, TriggerDevOpContext>;
@@ -2663,7 +2755,7 @@ export declare const createBulkActionV1: API.OperationMethod<CreateBulkActionV1R
2663
2755
  export type CreateDashboardV1Error = BadRequest | Forbidden | TriggerDevOpError;
2664
2756
  /** Create a dashboard Create a custom dashboard, optionally with its widgets. Every widget query is checked against the queryable tables before it is saved. Creating more dashboards than your plan allows returns a 403. */
2665
2757
  export declare const createDashboardV1: API.OperationMethod<CreateDashboardV1Request, DashboardObject, CreateDashboardV1Error, TriggerDevOpContext>;
2666
- export type CreateProjectEnvvarV1Error = BadRequest | NotFound | TriggerDevOpError;
2758
+ export type CreateProjectEnvvarV1Error = BadRequest | NotFound | Conflict | TriggerDevOpError;
2667
2759
  /** Create environment variable Create a new environment variable for a specific project and environment. */
2668
2760
  export declare const createProjectEnvvarV1: API.OperationMethod<CreateProjectEnvvarV1Request, SucceedResponse, CreateProjectEnvvarV1Error, TriggerDevOpContext>;
2669
2761
  export type CreateScheduleV1Error = BadRequest | UnprocessableEntity | TriggerDevOpError;
@@ -2687,7 +2779,7 @@ export declare const deleteDashboardV1: API.OperationMethod<DeleteDashboardV1Req
2687
2779
  export type DeleteDashboardWidgetV1Error = NotFound | Conflict | TriggerDevOpError;
2688
2780
  /** Delete a dashboard widget Remove a widget from a custom dashboard. */
2689
2781
  export declare const deleteDashboardWidgetV1: API.OperationMethod<DeleteDashboardWidgetV1Request, DashboardObject, DeleteDashboardWidgetV1Error, TriggerDevOpContext>;
2690
- export type DeleteProjectEnvvarV1Error = BadRequest | NotFound | TriggerDevOpError;
2782
+ export type DeleteProjectEnvvarV1Error = BadRequest | NotFound | Conflict | TriggerDevOpError;
2691
2783
  /** Delete environment variable Delete a specific environment variable for a specific project and environment. */
2692
2784
  export declare const deleteProjectEnvvarV1: API.OperationMethod<DeleteProjectEnvvarV1Request, SucceedResponse, DeleteProjectEnvvarV1Error, TriggerDevOpContext>;
2693
2785
  export type DeleteScheduleV1Error = NotFound | TriggerDevOpError;
@@ -2870,7 +2962,7 @@ export declare const updateDashboardV1: API.OperationMethod<UpdateDashboardV1Req
2870
2962
  export type UpdateDashboardWidgetV1Error = BadRequest | NotFound | Conflict | TriggerDevOpError;
2871
2963
  /** Update a dashboard widget Change a widget's title, query, display or position. */
2872
2964
  export declare const updateDashboardWidgetV1: API.OperationMethod<UpdateDashboardWidgetV1Request, DashboardObject, UpdateDashboardWidgetV1Error, TriggerDevOpContext>;
2873
- export type UpdateProjectEnvvarV1Error = BadRequest | NotFound | TriggerDevOpError;
2965
+ export type UpdateProjectEnvvarV1Error = BadRequest | NotFound | Conflict | TriggerDevOpError;
2874
2966
  /** Update environment variable Update a specific environment variable for a specific project and environment. */
2875
2967
  export declare const updateProjectEnvvarV1: API.OperationMethod<UpdateProjectEnvvarV1Request, SucceedResponse, UpdateProjectEnvvarV1Error, TriggerDevOpContext>;
2876
2968
  export type UpdateRunMetadataV1Error = BadRequest | NotFound | TriggerDevOpError;
@@ -2882,7 +2974,7 @@ export declare const updateScheduleV1: API.OperationMethod<UpdateScheduleV1Reque
2882
2974
  export type UpdateSessionV1Error = NotFound | UnprocessableEntity | TriggerDevOpError;
2883
2975
  /** Update a session Update a session's `tags` or `metadata`. Pass `metadata: null` to clear it. Requires a secret key -- a session public token cannot update a session. `externalId` is read-only after create: it cannot be changed or cleared. Sending a value different from the current one (including `null` when one is set) returns `422`; sending the same value is accepted as a no-op. */
2884
2976
  export declare const updateSessionV1: API.OperationMethod<UpdateSessionV1Request, SessionObject, UpdateSessionV1Error, TriggerDevOpContext>;
2885
- export type UploadProjectEnvvarsV1Error = BadRequest | NotFound | TriggerDevOpError;
2977
+ export type UploadProjectEnvvarsV1Error = BadRequest | NotFound | Conflict | TriggerDevOpError;
2886
2978
  /** Upload environment variables Upload mulitple environment variables for a specific project and environment. */
2887
2979
  export declare const uploadProjectEnvvarsV1: API.OperationMethod<UploadProjectEnvvarsV1Request, SucceedResponse, UploadProjectEnvvarsV1Error, TriggerDevOpContext>;
2888
2980
  //# sourceMappingURL=trigger-dev.d.ts.map