@distilled.cloud/xata 1.0.0-rc.18 → 1.0.0-rc.20
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/lib/_bundle/sdk.js +1 -1
- package/lib/_bundle/sdk.js.map +1 -1
- package/lib/errors.d.ts +5 -8
- package/lib/errors.d.ts.map +1 -1
- package/lib/protocol.d.ts +2 -1
- package/lib/protocol.d.ts.map +1 -1
- package/lib/services/xata.d.ts +139 -137
- package/lib/services/xata.d.ts.map +1 -1
- package/lib/services/xata.js +109 -109
- package/lib/services/xata.js.map +1 -1
- package/lib/services.lazy/xata.js +1 -1
- package/package.json +5 -5
- package/src/errors.ts +5 -5
- package/src/protocol.ts +5 -8
- package/src/services/xata.ts +144 -137
package/lib/_bundle/sdk.js
CHANGED
|
@@ -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
|
|
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 ee,errors$Forbidden as a,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$makeRestProtocol as m,protocol_rest$rawResponseRootSymbol as h,protocol_rest$rawResponseSymbol 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$Unknown as D,schema_lite$at as O,schema_lite$optional as k,schema_lite$suspend as A}from"@distilled.cloud/core/_bundle/rest";import{api$D as j,api$call as M,api$error as N,api$named as P,api$newError as F,api$op as I,category$withAuthError as L,category$withBadRequestError as R,category$withConflictError as z,category$withParseError as B,retry$capped as V,retry$jittered as H,retry$makeDefault as U,retry$throttlingFactory as W,retry$throttlingOptions as G,retry$transientFactory as K,retry$transientOptions as q,schema_lite_typed$TaggedError as J,schema_lite_typed$Unknown as Y,trait$Body as oe,trait$FormDataFile as se,trait$Header as ce,trait$Http as le,trait$HttpBody as ue,trait$KeyDictionary as de,trait$Label as fe,trait$Query as pe,trait$ResponseCode as me,trait$UnionCases as he,trait$applyErrorMatchers as ge,trait$bodySymbol as _e,trait$errorMatchersSymbol as ve,trait$formDataFileSymbol as ye,trait$getErrorMatchers as be,trait$headerSymbol as xe,trait$httpBodySymbol as Se,trait$httpSymbol as Ce,trait$keyDictionarySymbol as we,trait$labelSymbol as Te,trait$querySymbol as Ee,trait$responseCodeSymbol as De,trait$unionCasesSymbol as Oe}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 ke=`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 Ae=/*@__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__*/ J()(`UnknownXataError`,l)){};var XataParseError=class extends (/*@__PURE__*/ J()(`XataParseError`,{body:Y,cause:Y}).pipe(B)){};const je=/*@__PURE__*/ m({credentials:/*@__PURE__*/ Z.flatMap(Credentials,e=>e),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 Me=/*@__PURE__*/ Z.provide(/*@__PURE__*/ Q.succeed(Retry,{while:()=>false}));const Ne=/*@__PURE__*/ policy(W);const Pe=/*@__PURE__*/ policy(K);export{z as Ba,y as Ob,b as Pb,x as Wb,S as Xb,C as Yb,w as _b,j as a,T as ac,M as c,E as cc,Credentials as credentials$Credentials,Ae as credentials$CredentialsFromEnv,ke as credentials$DEFAULT_API_BASE_URL,fromApiKey as credentials$fromApiKey,N as e,e as errors$API_ERRORS,t as errors$BadGateway,n as errors$BadRequest,r as errors$ConfigError,i as errors$Conflict,ee as errors$DEFAULT_ERRORS,a 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,D as fc,O as hc,P as k,F as l,I as m,k as mc,A as nc,je as protocol$XataProtocol,Retry as retry$Retry,V as retry$capped,H as retry$jittered,U as retry$makeDefault,Me as retry$none,policy as retry$policy,Ne as retry$throttling,W as retry$throttlingFactory,G as retry$throttlingOptions,Pe as retry$transient,K as retry$transientFactory,q as retry$transientOptions,oe as traits$Body,se as traits$FormDataFile,ce as traits$Header,le as traits$Http,ue as traits$HttpBody,de as traits$KeyDictionary,fe as traits$Label,pe as traits$Query,d as traits$RawResponse,f as traits$RawResponseRoot,me as traits$ResponseCode,p as traits$SensitiveValue,he as traits$UnionCases,ge as traits$applyErrorMatchers,_e as traits$bodySymbol,ve as traits$errorMatchersSymbol,ye as traits$formDataFileSymbol,be as traits$getErrorMatchers,xe as traits$headerSymbol,Se as traits$httpBodySymbol,Ce as traits$httpSymbol,we as traits$keyDictionarySymbol,Te as traits$labelSymbol,Ee as traits$querySymbol,h as traits$rawResponseRootSymbol,g as traits$rawResponseSymbol,De as traits$responseCodeSymbol,_ as traits$sensitiveValueSymbol,Oe as traits$unionCasesSymbol,L as xa,R as ya};
|
|
2
2
|
//# sourceMappingURL=sdk.js.map
|
package/lib/_bundle/sdk.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.js","names":["Schema.
|
|
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","makeRestProtocol","rawResponseRootSymbol","rawResponseSymbol","sensitiveValueSymbol","unknownErrorProps","Array","Boolean","NullOr","Number","Record","String","Struct","TaggedError","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","XataProtocol","resolve","creds","info","optionsOrFactory","none","throttling","transient"],"sources":["../../src/credentials.ts","../../src/errors.ts","../../src/protocol.ts","../../src/retry.ts"],"mappings":"guEAcA,MAAaqF,GAAuB,wBAOpC,IA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AA2B,qBAAO3C,CAAiB,EAGhE,MAAa4C,GAA0B,qBAAO1C,CAAgB"}
|
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
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
}
|
package/lib/errors.d.ts.map
CHANGED
|
@@ -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;
|
|
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;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"}
|
package/lib/protocol.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type * as API from "@distilled.cloud/core/api";
|
|
2
2
|
import type { API_ERRORS, ConfigError, InvalidInput } from "@distilled.cloud/core/errors";
|
|
3
|
+
import type { SdkError } from "@distilled.cloud/core/sdk-error";
|
|
3
4
|
import type * as HttpClient from "effect/http/HttpClient";
|
|
4
5
|
import type * as HttpClientError from "effect/http/HttpClientError";
|
|
5
6
|
import type * as Layer from "effect/Layer";
|
|
@@ -11,7 +12,7 @@ import { UnknownXataError, XataParseError } from "./errors.ts";
|
|
|
11
12
|
* XataOpContext>` explicitly so the compiler never infers these back out of
|
|
12
13
|
* the schema generics.
|
|
13
14
|
*/
|
|
14
|
-
export type XataOpError = InstanceType<(typeof API_ERRORS)[number]> | UnknownXataError | ConfigError | HttpClientError.HttpClientError | XataParseError | InvalidInput;
|
|
15
|
+
export type XataOpError = InstanceType<(typeof API_ERRORS)[number]> | UnknownXataError | ConfigError | HttpClientError.HttpClientError | XataParseError | InvalidInput | SdkError;
|
|
15
16
|
/** Context (requirements) shared by every generated Xata operation. */
|
|
16
17
|
export type XataOpContext = Credentials | HttpClient.HttpClient;
|
|
17
18
|
export declare const XataProtocol: Layer.Layer<API.Protocol>;
|
package/lib/protocol.d.ts.map
CHANGED
|
@@ -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;
|
|
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,CAYjD,CAAC"}
|