@distilled.cloud/xata 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
  Xata.CredentialsFromEnv,
26
- Xata.XataProtocol,
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.xata.tech`;var Credentials=class extends (/*@__PURE__*/ X.Service()(`XataCredentials`)){};const fromApiKey=e=>Q.succeed(Credentials,Z.succeed({apiKey:e.apiKey,apiBaseUrl:e.apiBaseUrl??`https://api.xata.tech`}));const je=/*@__PURE__*/ Q.succeed(Credentials,/*@__PURE__*/ Z.gen(function*(){const e=process.env.XATA_API_KEY;if(!e)return yield*new r({message:`XATA_API_KEY environment variable is required`});return{apiKey:$.make(e),apiBaseUrl:process.env.XATA_API_BASE_URL??`https://api.xata.tech`}}));var UnknownXataError=class extends (/*@__PURE__*/ q()(`UnknownXataError`,{code:/*@__PURE__*/ Y(K),message:/*@__PURE__*/ Y(K),body:J}).pipe(R)){};var XataParseError=class extends (/*@__PURE__*/ q()(`XataParseError`,{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 UnknownXataError({code:typeof e===`string`?e:e!==void 0?String(e):void 0,message:t,body:n}),parseError:({body:e,cause:t})=>new XataParseError({body:e,cause:t})});var Retry=class extends (/*@__PURE__*/ X.Service()(`XataRetry`)){};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,ae as errors$Unauthorized,UnknownXataError as errors$UnknownXataError,oe as errors$UnprocessableEntity,XataParseError as errors$XataParseError,T as fc,j as k,E as kc,M as l,D as lc,N as m,Me as protocol$XataProtocol,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.xata.tech`;var Credentials=class extends (/*@__PURE__*/ X.Service()(`XataCredentials`)){};const fromApiKey=e=>Q.succeed(Credentials,Z.succeed({apiKey:e.apiKey,apiBaseUrl:e.apiBaseUrl??`https://api.xata.tech`}));const je=/*@__PURE__*/ Q.effect(Credentials,/*@__PURE__*/ Z.map(/*@__PURE__*/ Z.gen(function*(){const e=process.env.XATA_API_KEY;if(!e)return yield*new r({message:`XATA_API_KEY environment variable is required`});return{apiKey:$.make(e),apiBaseUrl:process.env.XATA_API_BASE_URL??`https://api.xata.tech`}}),e=>Z.succeed(e)));var UnknownXataError=class extends (/*@__PURE__*/ J()(`UnknownXataError`,l)){};var XataParseError=class extends (/*@__PURE__*/ J()(`XataParseError`,{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 UnknownXataError(v(e)),parseError:({body:e,cause:t})=>new XataParseError({body:e,cause:t})});var Retry=class extends (/*@__PURE__*/ X.Service()(`XataRetry`)){};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,c as errors$Unauthorized,UnknownXataError as errors$UnknownXataError,u as errors$UnprocessableEntity,XataParseError as errors$XataParseError,Me as errors$XataServiceErrors,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$XataProtocol,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","XataProtocol","resolve","creds","code","optionsOrFactory","none","throttling","transient"],"sources":["../../src/credentials.ts","../../src/errors.ts","../../src/protocol.ts","../../src/retry.ts"],"mappings":"yvEAcA,MAAawF,GAAuB,wBAOpC,IAAa,YAAb,eACwB,gBAAQ,QAAyD,CAAC,CACtF,iBACF,EAAA,AAAE,CAAC,EAGL,MAAa,WAAc,GAIzBF,EAAM,QACJ,YACAD,EAAO,QAAQ,CACb,OAAQI,EAAO,OACf,WAAYA,EAAO,YAAA,uBACrB,CAAC,CACH,EAGF,MAAaC,GAA6D,gBAAM,QAC9E,YACc,gBAAO,IAAI,WAAa,CACpC,MAAMC,EAAS,QAAQ,IAAI,aAE3B,GAAI,CAACA,EACH,OAAO,MAAO,IAAIpF,EAAY,CAC5B,QAAS,+CACX,CAAC,EAGH,MAAO,CACL,OAAQgF,EAAS,KAAKI,CAAM,EAC5B,WAAY,QAAQ,IAAI,mBAAA,uBAC1B,CACF,CAAC,CACH,ECvBA,IAAa,iBAAb,eACwB,gBAAqC,CAAC,CAAC,mBAAoB,CAC/E,KAAoB,gBAAgB3F,CAAa,EACjD,QAAuB,gBAAgBA,CAAa,EACpD,KAAMC,CACR,CAAC,CAAC,CAAC,KAAKC,CAAwB,EAAA,AAAE,CAAC,EAGrC,IAAa,eAAb,eACwB,gBAAmC,CAAC,CAAC,iBAAkB,CAC3E,KAAMD,EACN,MAAOA,CACT,CAAC,CAAC,CAAC,KAAKE,CAAuB,EAAA,AAAE,CAAC,ECCpC,MAAayF,GAAwD,gBAAyB,CAG5F,YAA2B,gBAAO,QAAQ,YAAc,GAAYC,CAAO,EAC3E,QAAU,GAAUC,EAAM,WAC1B,QAAU,IAAW,CACnB,cAAe,UAAUP,EAAS,MAAMO,EAAM,MAAM,GACtD,GAGA,cAAe,CAAE,OAAM,UAAS,UAC9B,IAAI,iBAAiB,CACnB,KAAM,OAAOC,IAAS,SAAWA,EAAOA,IAAS,IAAA,GAAY,OAAOA,CAAI,EAAI,IAAA,GAC5E,UACA,MACF,CAAC,EACH,YAAa,CAAE,OAAM,WAAY,IAAI,eAAe,CAAE,OAAM,OAAM,CAAC,CACrE,CAAC,EC7BD,IAAa,MAAb,eAAyC,gBAAQ,QAAuB,CAAC,CAAC,WAAW,EAAA,AAAE,CAAC,EAGxF,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,qBAAO7C,CAAiB,EAGhE,MAAa8C,GAA0B,qBAAO5C,CAAgB"}
1
+ {"version":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","XataServiceErrors","XataProtocol","creds","info","optionsOrFactory","none","throttling","transient"],"sources":["../../src/credentials.ts","../../src/errors.ts","../../src/protocol.ts","../../src/retry.ts"],"mappings":"ovEAcA,MAAasF,GAAuB,wBAOpC,IAAa,YAAb,eACwB,gBAAQ,QAA4C,CAAC,CAAC,iBAAiB,EAAA,AAAE,CAAC,EAGlG,MAAa,WAAc,GAIzBF,EAAM,QACJ,YACAD,EAAO,QAAQ,CACb,OAAQI,EAAO,OACf,WAAYA,EAAO,YAAA,uBACrB,CAAC,CACH,EAQF,MAAaC,GAA0E,gBAAM,OAC3F,YACc,gBAAO,IACL,gBAAO,IAAI,WAAa,CACpC,MAAMC,EAAS,QAAQ,IAAI,aAE3B,GAAI,CAACA,EACH,OAAO,MAAO,IAAIpF,EAAY,CAC5B,QAAS,+CACX,CAAC,EAGH,MAAO,CACL,OAAQgF,EAAS,KAAKI,CAAM,EAC5B,WAAY,QAAQ,IAAI,mBAAA,uBAC1B,CACF,CAAC,EACA,GAAWN,EAAO,QAAQI,CAAM,CACnC,CACF,EC5BA,IAAa,iBAAb,eACwB,gBAAqC,CAAC,CAC1D,mBACAtE,CACF,EAAA,AAAE,CAAC,EAGL,IAAa,eAAb,eACwB,gBAAmC,CAAC,CAAC,iBAAkB,CAC3E,KAAMjB,EACN,MAAOA,CACT,CAAC,CAAC,CAAC,KAAKC,CAAuB,EAAA,AAAE,CAAC,EAOpC,MAAayF,GAAoBxF,EChBjC,MAAayF,GAA6B,gBAAa,CAGrD,YAA2B,gBAAO,QAAQ,WAAW,EACrD,QAAU,GAAUC,EAAM,WAC1B,QAAU,IAAW,CACnB,cAAe,UAAUP,EAAS,MAAMO,EAAM,MAAM,GACtD,GAGA,aAAe,GAAS,IAAI,iBAAiBlE,EAAkBmE,CAAI,CAAC,EACpE,YAAa,CAAE,OAAM,WAAY,IAAI,eAAe,CAAE,OAAM,OAAM,CAAC,CACrE,CAAC,ECdD,IAAa,MAAb,eAAyC,gBAAQ,QAAuB,CAAC,CAAC,WAAW,EAAA,AAAE,CAAC,EAGxF,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
  * Xata 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). Control-plane auth is a bearer API key
8
8
  * (`Authorization: Bearer <apiKey>`).
9
9
  */
@@ -16,7 +16,7 @@ export interface Config {
16
16
  readonly apiKey: Redacted.Redacted<string>;
17
17
  readonly apiBaseUrl: string;
18
18
  }
19
- declare const Credentials_base: Context.ServiceClass<Credentials, "XataCredentials", Effect.Effect<Config, ConfigError, never>>;
19
+ declare const Credentials_base: Context.ServiceClass<Credentials, "XataCredentials", Effect.Effect<Config, never, never>>;
20
20
  export declare class Credentials extends /*@__PURE__*/ Credentials_base {
21
21
  }
22
22
  /** Layer from a redacted API key + optional base URL. */
@@ -24,7 +24,12 @@ export declare const fromApiKey: (config: {
24
24
  readonly apiKey: Redacted.Redacted<string>;
25
25
  readonly apiBaseUrl?: string;
26
26
  }) => Layer.Layer<Credentials>;
27
- /** Reads XATA_API_KEY (required) and XATA_API_BASE_URL (optional). */
28
- export declare const CredentialsFromEnv: Layer.Layer<Credentials>;
27
+ /**
28
+ * Reads XATA_API_KEY (required) and XATA_API_BASE_URL (optional).
29
+ *
30
+ * Its configuration is read and checked once, when the layer is built: a
31
+ * problem there fails the layer with `ConfigError`.
32
+ */
33
+ export declare const CredentialsFromEnv: Layer.Layer<Credentials, ConfigError>;
29
34
  export {};
30
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;;;;;;;GAOG;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,0BAA0B,CAAC;AAE5D,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,WACX,SAAQ,aAAa,CAAC,gBAErB;CAAG;AAEN,yDAAyD;AACzD,eAAO,MAAM,UAAU,WAAY;IACjC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC3C,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B,KAAG,KAAK,CAAC,KAAK,CAAC,WAAW,CAOxB,CAAC;AAEJ,sEAAsE;AACtE,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,CAgBvD,CAAC"}
1
+ {"version":3,"file":"credentials.d.ts","sources":["../src/credentials.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D;;;;;;;GAOG;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,0BAA0B,CAAC;AAE5D,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,WACX,SAAQ,aAAa,CAAC,gBAAwE;CAAG;AAEnG,yDAAyD;AACzD,eAAO,MAAM,UAAU,WAAY;IACjC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC3C,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B,KAAG,KAAK,CAAC,KAAK,CAAC,WAAW,CAOxB,CAAC;AAEJ;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,EAAE,WAAW,CAmBpE,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 UnknownXataError_base: Schema.TaggedErrorClass<"UnknownXataError", {
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 Xata error -- returned when nothing else matches the failure. */
23
20
  export declare class UnknownXataError extends /*@__PURE__*/ UnknownXataError_base {
24
21
  }
@@ -33,4 +30,11 @@ declare const XataParseError_base: Schema.TaggedErrorClass<"XataParseError", {
33
30
  /** Schema parse error wrapper. */
34
31
  export declare class XataParseError extends /*@__PURE__*/ XataParseError_base {
35
32
  }
33
+ /**
34
+ * The errors declared on the Xata service: any operation can return them, and
35
+ * every generated operation lists them as its `serviceErrors`. Today that is
36
+ * each of core's status classes (401, 403, 404, 429, the 5xx ...).
37
+ */
38
+ export declare const XataServiceErrors: 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 XataServiceError = InstanceType<(typeof XataServiceErrors)[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,4EAA4E;AAC5E,qBAAa,gBACX,SAAQ,aAAa,CAAC,qBAIW;CAAG;;;;;;;;;AAEtC,kCAAkC;AAClC,qBAAa,cACX,SAAQ,aAAa,CAAC,mBAGU;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,4EAA4E;AAC5E,qBAAa,gBACX,SAAQ,aAAa,CAAC,qBAGrB;CAAG;;;;;;;;;AAEN,kCAAkC;AAClC,qBAAa,cACX,SAAQ,aAAa,CAAC,mBAGU;CAAG;AAErC;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,+tBAAa,CAAC;AAC5C,MAAM,MAAM,gBAAgB,GAAG,YAAY,CAAC,CAAC,OAAO,iBAAiB,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$Unauthorized as Unauthorized, errors$UnknownXataError as UnknownXataError, errors$UnprocessableEntity as UnprocessableEntity, errors$XataParseError as XataParseError } 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$Unauthorized as Unauthorized, errors$UnknownXataError as UnknownXataError, errors$UnprocessableEntity as UnprocessableEntity, errors$XataParseError as XataParseError, errors$XataServiceErrors as XataServiceErrors } 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,EAAE,YAAY,EAAE,KAAK,WAAW,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AACnF,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAKhD,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,oBAAoB,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,EAAE,YAAY,EAAE,KAAK,WAAW,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AACnF,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAKhD,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,oBAAoB,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,EAAE,YAAY,EAAwC,MAAM,eAAe,CAAC;AACnF,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,oBAAoB,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,oBAAoB,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,EAAE,YAAY,EAAwC,MAAM,eAAe,CAAC;AACnF,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,oBAAoB,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../src/pagination.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC"}
1
+ {"version":3,"file":"pagination.d.ts","sources":["../src/pagination.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC"}
package/lib/protocol.d.ts CHANGED
@@ -1,19 +1,16 @@
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 { UnknownXataError, XataParseError } from "./errors.ts";
4
+ import { UnknownXataError, XataParseError, type XataServiceError } from "./errors.ts";
9
5
  /**
10
- * Error channel shared by every generated Xata operation. Generated service
11
- * files annotate operations with `API.OperationMethod<I, O, XataOpError,
12
- * XataOpContext>` explicitly so the compiler never infers these back out of
13
- * the schema generics.
6
+ * What every generated Xata operation fails with besides its own errors: the
7
+ * service's errors, the protocol's, and what resolving the credentials fails
8
+ * with. Generated service files annotate operations with
9
+ * `API.OperationMethod<I, O, XataOpError, XataOpContext>` explicitly so the
10
+ * compiler never infers these back out of the schema generics.
14
11
  */
15
- export type XataOpError = InstanceType<(typeof API_ERRORS)[number]> | UnknownXataError | ConfigError | HttpClientError.HttpClientError | XataParseError | InvalidInput | SdkError;
12
+ export type XataOpError = XataServiceError | ErrorOf<typeof XataProtocol>;
16
13
  /** Context (requirements) shared by every generated Xata operation. */
17
14
  export type XataOpContext = Credentials | HttpClient.HttpClient;
18
- export declare const XataProtocol: Layer.Layer<API.Protocol>;
15
+ export declare const XataProtocol: import("@distilled.cloud/core/protocol").Protocol<UnknownXataError | XataParseError | import("@distilled.cloud/core/protocol-rest").RestProtocolError, Credentials>;
19
16
  //# 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,2BAA2B,CAAC;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE1F,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAkBhE,OAAO,KAAK,KAAK,UAAU,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,KAAK,eAAe,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAC;AAE3C,OAAO,EAAE,WAAW,EAAe,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE/D;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GACnB,YAAY,CAAC,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC,GACzC,gBAAgB,GAChB,WAAW,GACX,eAAe,CAAC,eAAe,GAC/B,cAAc,GACd,YAAY,GACZ,QAAQ,CAAC;AAEb,uEAAuE;AACvE,MAAM,MAAM,aAAa,GAAG,WAAW,GAAG,UAAU,CAAC,UAAU,CAAC;AAEhE,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAiBjD,CAAC"}
1
+ {"version":3,"file":"protocol.d.ts","sources":["../src/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAmB9D,OAAO,KAAK,KAAK,UAAU,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,KAAK,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEtF;;;;;;GAMG;AACH,MAAM,MAAM,WAAW,GAAG,gBAAgB,GAAG,OAAO,CAAC,OAAO,YAAY,CAAC,CAAC;AAE1E,uEAAuE;AACvE,MAAM,MAAM,aAAa,GAAG,WAAW,GAAG,UAAU,CAAC,UAAU,CAAC;AAEhE,eAAO,MAAM,YAAY,qKAYvB,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,oEAAoE;AACpE,qBAAa,KAAM,SAAQ,aAAa,CAAC,UAA6C;CAAG;AAEzF,sEAAsE;AACtE,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,oEAAoE;AACpE,qBAAa,KAAM,SAAQ,aAAa,CAAC,UAA6C;CAAG;AAEzF,sEAAsE;AACtE,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,IAAI,MAAM,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sources":["../../src/services/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC"}
@@ -6,42 +6,54 @@ export type { XataOpError, XataOpContext };
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?: Error400Body | VercelError | ResourceError | ErrorResponse | 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?: AuthErrorResponse | Error400Body | VercelError | ResourceError | 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?: AuthErrorResponse | Error401Body | VercelError | ResourceError | Error401Body2 | ErrorResponse | 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?: Error400Body | ResourceError | VercelError | ErrorResponse | AuthErrorResponse | string;
45
57
  }
46
58
  /** Log attribute to filter on. */
47
59
  export type LogFilterField = "instance" | "level" | "process" | "body";
@@ -248,6 +260,8 @@ export interface BranchShortMetadata {
248
260
  region: string;
249
261
  /** Whether the branch allows public access without authentication */
250
262
  publicAccess: boolean;
263
+ /** Whether backups are enabled for the newly created branch. Only set in responses to branch creation. */
264
+ backupsEnabled?: boolean | undefined;
251
265
  }
252
266
  export interface CreateGithubAppInstallationRequest {
253
267
  /** Unique identifier of the organization */
@@ -373,7 +387,7 @@ export interface FullAPIKey {
373
387
  /** Timestamp of the last time the key was used (null if never) */
374
388
  last_used: string | null;
375
389
  /** The actual API key token */
376
- token: string;
390
+ token: string | Redacted.Redacted<string>;
377
391
  /** ID of the user that created this API key */
378
392
  created_by?: string | null | undefined;
379
393
  /** ID of the API key that created this API key */
@@ -675,7 +689,7 @@ export interface BranchMetadata {
675
689
  connectionString: string | Redacted.Redacted<string> | null;
676
690
  /** Whether the branch allows public access without authentication */
677
691
  publicAccess: boolean;
678
- /** Whether the branch is in a region that supports backups */
692
+ /** Whether backups are enabled for this branch */
679
693
  backupsEnabled: boolean;
680
694
  scaleToZero: ScaleToZeroConfiguration;
681
695
  configuration: ClusterConfiguration;
@@ -1136,7 +1150,7 @@ export interface BranchListMetadata {
1136
1150
  region: string;
1137
1151
  /** Whether the branch allows public access without authentication */
1138
1152
  publicAccess: boolean;
1139
- /** Whether the branch is in a region that supports backups */
1153
+ /** Whether the branch's region supports backups. A branch can still have backups disabled; see the branch details for its actual state. */
1140
1154
  backupsEnabled: boolean;
1141
1155
  }
1142
1156
  /** Array of branch objects with their metadata */
@@ -1412,7 +1426,7 @@ export interface Secret {
1412
1426
  /** Environment variable name. */
1413
1427
  name: string;
1414
1428
  /** Default value, used when no per-environment override applies. */
1415
- value: string;
1429
+ value: string | Redacted.Redacted<string>;
1416
1430
  /** Per-environment values that override value for that Vercel environment. */
1417
1431
  environmentOverrides?: SecretEnvironmentOverrides | undefined;
1418
1432
  }
@@ -1780,6 +1794,109 @@ export interface WebsocketRequest {
1780
1794
  }
1781
1795
  export interface WebsocketResponse {
1782
1796
  }
1797
+ export interface Error400Body {
1798
+ /** Error identifier for tracking and debugging */
1799
+ id?: string | undefined;
1800
+ /** Human-readable error message explaining the issue */
1801
+ message: string;
1802
+ }
1803
+ /** User-facing error details, if applicable. */
1804
+ export interface VercelErrorErrorUser {
1805
+ /** User-facing error message. */
1806
+ message?: string | undefined;
1807
+ /** URL to a help article or dashboard page for resolution. */
1808
+ url?: string | undefined;
1809
+ }
1810
+ export interface VercelErrorErrorFieldsItem {
1811
+ key: string;
1812
+ message?: string | undefined;
1813
+ }
1814
+ /** Offending fields, for validation errors. */
1815
+ export type VercelErrorErrorFieldsList = Array<VercelErrorErrorFieldsItem>;
1816
+ export interface VercelErrorError {
1817
+ /** Machine-readable error code (e.g. validation_error, conflict). */
1818
+ code: string;
1819
+ /** Human-readable (system) error message. */
1820
+ message: string;
1821
+ /** User-facing error details, if applicable. */
1822
+ user?: VercelErrorErrorUser | undefined;
1823
+ /** Offending fields, for validation errors. */
1824
+ fields?: VercelErrorErrorFieldsList | undefined;
1825
+ }
1826
+ /** Vercel Partner API error envelope. */
1827
+ export interface VercelError {
1828
+ error: VercelErrorError;
1829
+ }
1830
+ /** User-facing error details, if applicable. */
1831
+ export type ResourceErrorErrorUser = VercelErrorErrorUser;
1832
+ export interface ResourceErrorErrorFieldsItem {
1833
+ /** The metadata field the error applies to. */
1834
+ key: string;
1835
+ /** Validation message for this field. */
1836
+ message?: string | undefined;
1837
+ }
1838
+ /** Field-level validation errors, for 400 responses. */
1839
+ export type ResourceErrorErrorFieldsList = Array<ResourceErrorErrorFieldsItem>;
1840
+ export interface ResourceErrorError {
1841
+ /** Machine-readable error code (e.g. validation_error, conflict). */
1842
+ code: string;
1843
+ /** Human-readable (system) error message. */
1844
+ message: string;
1845
+ /** User-facing error details, if applicable. */
1846
+ user?: VercelErrorErrorUser | undefined;
1847
+ /** Field-level validation errors, for 400 responses. */
1848
+ fields?: ResourceErrorErrorFieldsList | undefined;
1849
+ }
1850
+ /** Vercel Partner API error envelope. */
1851
+ export interface ResourceError {
1852
+ error: ResourceErrorError;
1853
+ }
1854
+ /** Error response with PostgreSQL error fields. */
1855
+ export interface ErrorResponse {
1856
+ /** Human-readable error message. */
1857
+ message: string;
1858
+ /** PostgreSQL error code (SQLSTATE) or application error code. */
1859
+ code?: string | undefined;
1860
+ /** PostgreSQL error severity (e.g. `ERROR`, `FATAL`). */
1861
+ severity?: string | undefined;
1862
+ /** Optional detail message. */
1863
+ detail?: string | undefined;
1864
+ /** Optional hint for resolving the error. */
1865
+ hint?: string | undefined;
1866
+ /** Character position in the query where the error occurred. */
1867
+ position?: string | undefined;
1868
+ /** Position in an internally-generated query. */
1869
+ internalPosition?: string | undefined;
1870
+ /** Text of the internally-generated query. */
1871
+ internalQuery?: string | undefined;
1872
+ /** Context in which the error occurred. */
1873
+ where?: string | undefined;
1874
+ /** Schema name related to the error. */
1875
+ schema?: string | undefined;
1876
+ /** Table name related to the error. */
1877
+ table?: string | undefined;
1878
+ /** Column name related to the error. */
1879
+ column?: string | undefined;
1880
+ /** Data type name related to the error. */
1881
+ dataType?: string | undefined;
1882
+ /** Constraint name related to the error. */
1883
+ constraint?: string | undefined;
1884
+ /** Source file where the error was reported (server-side). */
1885
+ file?: string | undefined;
1886
+ /** Source line where the error was reported (server-side). */
1887
+ line?: string | undefined;
1888
+ /** Source routine where the error was reported (server-side). */
1889
+ routine?: string | undefined;
1890
+ }
1891
+ /** Error response */
1892
+ export type AuthErrorResponse = Error400Body;
1893
+ export type Error401Body = Error400Body;
1894
+ export interface Error401Body2 {
1895
+ /** Error identifier for tracking and debugging */
1896
+ id?: string | undefined;
1897
+ /** Human-readable error message explaining the authentication or authorization issue */
1898
+ message: string;
1899
+ }
1783
1900
  export type BranchLogs2Error = BadRequest | NotFound | XataOpError;
1784
1901
  /** Retrieve branch logs */
1785
1902
  export declare const branchLogs2: API.OperationMethod<BranchLogsRequest, BranchLogs, BranchLogs2Error, XataOpContext>;
@@ -1973,7 +2090,7 @@ export type ResendOrganizationInvitationError = BadRequest | Forbidden | NotFoun
1973
2090
  /** Resend an invitation Resend a pending invitation with a fresh expiration time. */
1974
2091
  export declare const resendOrganizationInvitation: API.OperationMethod<ResendOrganizationInvitationRequest, ResendOrganizationInvitationResponse, ResendOrganizationInvitationError, XataOpContext>;
1975
2092
  export type RestoreFromBackupError = BadRequest | NotFound | XataOpError;
1976
- /** Create a new branch from a backup of another branch Creates a new branch from the continuous backup of the source branch. The source branch does not change. The new branch is created in the region and cell of the source branch, and its parentID is the source branch. */
2093
+ /** Create a new branch from a backup of another branch Creates a new branch from the continuous backup of the source branch. The source branch does not change. The new branch is created in the region and cell of the source branch, and its parentID is the source branch. Returns 412 if the backups of the source branch cannot be restored to a new branch. */
1977
2094
  export declare const restoreFromBackup: API.OperationMethod<RestoreFromBackupRequest, BranchShortMetadata, RestoreFromBackupError, XataOpContext>;
1978
2095
  export type RotateBranchCredentialsError = BadRequest | NotFound | XataOpError;
1979
2096
  /** Rotate branch credentials Triggers a credential rotation for the branch database user. The new credentials can be retrieved via the credentials endpoint after rotation completes. */