@distilled.cloud/typesense 1.0.0-rc.20 → 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 +0 -1
- package/lib/_bundle/sdk.js +1 -1
- package/lib/_bundle/sdk.js.map +1 -1
- package/lib/credentials.d.ts +6 -2
- package/lib/credentials.d.ts.map +1 -1
- package/lib/errors.d.ts +7 -0
- package/lib/errors.d.ts.map +1 -1
- package/lib/errors.js +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.lazy.js.map +1 -1
- package/lib/protocol.d.ts +9 -12
- package/lib/protocol.d.ts.map +1 -1
- package/lib/retry.d.ts.map +1 -1
- package/lib/services/index.d.ts.map +1 -1
- package/lib/services/typesense.d.ts +14 -2
- package/lib/services/typesense.d.ts.map +1 -1
- package/lib/services/typesense.js +110 -109
- package/lib/services/typesense.js.map +1 -1
- package/lib/services.lazy/typesense.js +1 -1
- package/lib/traits.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/credentials.ts +19 -12
- package/src/errors.ts +9 -1
- package/src/protocol.ts +16 -20
- package/src/services/typesense.ts +534 -406
package/README.md
CHANGED
package/lib/_bundle/sdk.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{api$D as e,api$call as t,api$error as
|
|
1
|
+
import{api$D as e,api$call as t,api$error as n,api$named as r,api$newError as i,api$op as a,category$withBadRequestError as o,category$withConflictError as s,category$withParseError as c,config$String as l,config$all as ee,retry$capped as te,retry$jittered as ne,retry$makeDefault as re,retry$throttlingFactory as u,retry$throttlingOptions as d,retry$transientFactory as f,retry$transientOptions as p,schema_lite_typed$TaggedError as m,schema_lite_typed$Unknown as h,trait$Body as g,trait$FormDataFile as _,trait$Header as v,trait$Http as y,trait$HttpBody as b,trait$KeyDictionary as x,trait$Label as S,trait$Query as C,trait$ResponseCode as w,trait$UnionCases as T,trait$applyErrorMatchers as E,trait$bodySymbol as D,trait$errorMatchersSymbol as O,trait$formDataFileSymbol as k,trait$getErrorMatchers as A,trait$headerSymbol as j,trait$httpBodySymbol as M,trait$httpSymbol as N,trait$keyDictionarySymbol as P,trait$labelSymbol as F,trait$querySymbol as I,trait$responseCodeSymbol as L,trait$unionCasesSymbol as R}from"@distilled.cloud/core/_bundle/base";import{errors$API_ERRORS as z,errors$BadGateway as B,errors$BadRequest as V,errors$ConfigError as H,errors$Conflict as U,errors$DEFAULT_ERRORS as W,errors$Forbidden as G,errors$GatewayTimeout as K,errors$HTTP_STATUS_MAP as q,errors$InternalServerError as J,errors$Locked as Y,errors$NotFound as ie,errors$ServiceUnavailable as ae,errors$TooManyRequests as oe,errors$Unauthorized as se,errors$UnknownErrorFields as ce,errors$UnprocessableEntity as le,protocol_rest$RawResponse as ue,protocol_rest$RawResponseRoot as de,protocol_rest$SensitiveValue as fe,protocol_rest$rawResponseRootSymbol as pe,protocol_rest$rawResponseSymbol as me,protocol_rest$restProtocol as he,protocol_rest$sensitiveValueSymbol as ge,protocol_rest$unknownErrorProps as _e,schema_lite$Array as ve,schema_lite$Boolean as ye,schema_lite$Number as be,schema_lite$Record as xe,schema_lite$String as Se,schema_lite$Struct as Ce,schema_lite$TaggedError as we,schema_lite$Union as Te,schema_lite$Unknown as Ee,schema_lite$at as De,schema_lite$optional as Oe,schema_lite$suspend as ke}from"@distilled.cloud/core/_bundle/rest";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=``;var Credentials=class extends (/*@__PURE__*/ X.Service()(`TypesenseCredentials`)){};const je=/*@__PURE__*/ ee({apiKey:/*@__PURE__*/ l(`TYPESENSE_API_KEY`),apiBaseUrl:/*@__PURE__*/ l(`TYPESENSE_API_URL`)});const Me=/*@__PURE__*/ Q.effect(Credentials,/*@__PURE__*/ Z.map(/*@__PURE__*/ je.pipe(/*@__PURE__*/ Z.mapError(()=>new H({message:`TYPESENSE_API_KEY and TYPESENSE_API_URL environment variables are required`})),/*@__PURE__*/ Z.map(({apiKey:e,apiBaseUrl:t})=>({apiKey:$.make(e),apiBaseUrl:t}))),e=>Z.succeed(e)));const credentials=e=>Q.succeed(Credentials,Z.succeed({apiKey:e.apiKey,apiBaseUrl:e.apiBaseUrl}));const formatHeaders=e=>({"X-TYPESENSE-API-KEY":$.value(e.apiKey)});var UnknownTypesenseError=class extends (/*@__PURE__*/ m()(`UnknownTypesenseError`,ce)){};var TypesenseParseError=class extends (/*@__PURE__*/ m()(`TypesenseParseError`,{body:h,cause:h}).pipe(c)){};const Ne=z;const Pe=/*@__PURE__*/ he({credentials:/*@__PURE__*/ Z.flatten(Credentials),baseUrl:e=>e.apiBaseUrl,headers:formatHeaders,unknownError:e=>new UnknownTypesenseError(_e(e)),parseError:({body:e,cause:t})=>new TypesenseParseError({body:e,cause:t})});var Retry=class extends (/*@__PURE__*/ X.Service()(`TypesenseRetry`)){};const policy=e=>Z.provide(Q.succeed(Retry,e));const Fe=/*@__PURE__*/ Z.provide(/*@__PURE__*/ Q.succeed(Retry,{while:()=>false}));const Ie=/*@__PURE__*/ policy(u);const Le=/*@__PURE__*/ policy(f);export{De as Bc,s as Ca,Oe as Gc,ke as Hc,e as a,t as b,Credentials as credentials$Credentials,Me as credentials$CredentialsFromEnv,Ae as credentials$DEFAULT_API_BASE_URL,credentials as credentials$credentials,formatHeaders as credentials$formatHeaders,z as errors$API_ERRORS,B as errors$BadGateway,V as errors$BadRequest,H as errors$ConfigError,U as errors$Conflict,W as errors$DEFAULT_ERRORS,G as errors$Forbidden,K as errors$GatewayTimeout,q as errors$HTTP_STATUS_MAP,J as errors$InternalServerError,Y as errors$Locked,ie as errors$NotFound,ae as errors$ServiceUnavailable,oe as errors$TooManyRequests,TypesenseParseError as errors$TypesenseParseError,Ne as errors$TypesenseServiceErrors,se as errors$Unauthorized,UnknownTypesenseError as errors$UnknownTypesenseError,le as errors$UnprocessableEntity,n as f,ve as gc,ye as hc,r as l,i as m,a as n,Pe as protocol$TypesenseProtocol,be as qc,xe as rc,Retry as retry$Retry,te as retry$capped,ne as retry$jittered,re as retry$makeDefault,Fe as retry$none,policy as retry$policy,Ie as retry$throttling,u as retry$throttlingFactory,d as retry$throttlingOptions,Le as retry$transient,f as retry$transientFactory,p as retry$transientOptions,Se as tc,g as traits$Body,_ as traits$FormDataFile,v as traits$Header,y as traits$Http,b as traits$HttpBody,x as traits$KeyDictionary,S as traits$Label,C as traits$Query,ue as traits$RawResponse,de as traits$RawResponseRoot,w as traits$ResponseCode,fe as traits$SensitiveValue,T as traits$UnionCases,E as traits$applyErrorMatchers,D as traits$bodySymbol,O as traits$errorMatchersSymbol,k as traits$formDataFileSymbol,A as traits$getErrorMatchers,j as traits$headerSymbol,M as traits$httpBodySymbol,N as traits$httpSymbol,P as traits$keyDictionarySymbol,F as traits$labelSymbol,I as traits$querySymbol,pe as traits$rawResponseRootSymbol,me as traits$rawResponseSymbol,L as traits$responseCodeSymbol,ge as traits$sensitiveValueSymbol,R as traits$unionCasesSymbol,Ce as uc,we as wc,Te as yc,o as za,Ee as zc};
|
|
2
2
|
//# sourceMappingURL=sdk.js.map
|
package/lib/_bundle/sdk.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.js","names":["Schema.Unknown","Category.withParseError","D","call","error","named","newError","op","withBadRequestError","withConflictError","withParseError","String$2","all$1","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","API_ERRORS","BadGateway","BadRequest","ConfigError","Conflict","DEFAULT_ERRORS","Forbidden","GatewayTimeout","HTTP_STATUS_MAP","InternalServerError","Locked","NotFound","ServiceUnavailable","TooManyRequests","Unauthorized","UnknownErrorFields","UnprocessableEntity","RawResponse","RawResponseRoot","SensitiveValue","
|
|
1
|
+
{"version":3,"file":"sdk.js","names":["Schema.Unknown","Category.withParseError","D","call","error","named","newError","op","withBadRequestError","withConflictError","withParseError","String$2","all$1","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","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","Number","Record","String","Struct","TaggedError","Union","Unknown","at","optional","suspend","Context","Effect","Layer","Redacted","DEFAULT_API_BASE_URL","envConfig","CredentialsFromEnv","apiKey","config","TypesenseServiceErrors","TypesenseProtocol","creds","info","optionsOrFactory","none","throttling","transient"],"sources":["../../src/credentials.ts","../../src/errors.ts","../../src/protocol.ts","../../src/retry.ts"],"mappings":"muEAoBA,MAAasF,GAAuB,GAOpC,IAAa,YAAb,eACwB,gBAAQ,QAA4C,CAAC,CACzE,sBACF,EAAA,AAAE,CAAC,EAEL,MAAMC,GAA0B,iBAAiB,CAC/C,OAAsB,gBAAoB,mBAAmB,EAC7D,WAA0B,gBAAoB,mBAAmB,CACnE,CAAC,EAMD,MAAaC,GAAmC,gBAAM,OACpD,YACc,gBAAO,IACL,iBAAU,KACR,gBAAO,aAEjB,IAAIxC,EAAY,CACd,QAAS,4EACX,CAAC,CACL,EACc,gBAAO,KAAK,CAAE,SAAQ,iBAAkB,CACpD,OAAQqC,EAAS,KAAKI,CAAM,EAC5B,YACF,EAAE,CACJ,EACC,GAAWN,EAAO,QAAQO,CAAM,CACnC,CACF,EAGA,MAAa,YAAe,GAI1BN,EAAM,QACJ,YACAD,EAAO,QAAQ,CACb,OAAQO,EAAO,OACf,WAAYA,EAAO,UACrB,CAAC,CACH,EAGF,MAAa,cAAiB,IAA4C,CACxE,sBAAuBL,EAAS,MAAMK,EAAO,MAAM,CACrD,GC7CA,IAAa,sBAAb,eACwB,gBAA0C,CAAC,CAC/D,wBACA9B,EACF,EAAA,AAAE,CAAC,EAGL,IAAa,oBAAb,eACwB,gBAAwC,CAAC,CAAC,sBAAuB,CACrF,KAAM5D,EACN,MAAOA,CACT,CAAC,CAAC,CAAC,KAAKC,CAAuB,EAAA,AAAE,CAAC,EAmBpC,MAAa0F,GAAyB9C,ECzBtC,MAAa+C,GAAkC,iBAAa,CAG1D,YAA2B,gBAAO,QAAQ,WAAW,EACrD,QAAU,GAAUC,EAAM,WAC1B,QAAS,cAGT,aAAe,GAAS,IAAI,sBAAsBxB,GAAkByB,CAAI,CAAC,EACzE,YAAa,CAAE,OAAM,WAAY,IAAI,oBAAoB,CAAE,OAAM,OAAM,CAAC,CAC1E,CAAC,ECXD,IAAa,MAAb,eAAyC,gBAAQ,QAAuB,CAAC,CAAC,gBAAgB,EAAA,AAAE,CAAC,EAG7F,MAAa,OAAU,GACrBX,EAAO,QAAQC,EAAM,QAAQ,MAAOW,CAAgB,CAAC,EAGvD,MAAaC,GAAqB,gBAAO,QACzB,gBAAM,QAAQ,MAAO,CAAE,UAAa,KAAM,CAAC,CAC3D,EAGA,MAAaC,GAA2B,qBAAOjF,CAAiB,EAGhE,MAAakF,GAA0B,qBAAOhF,CAAgB"}
|
package/lib/credentials.d.ts
CHANGED
|
@@ -21,10 +21,14 @@ export interface Config {
|
|
|
21
21
|
readonly apiKey: Redacted.Redacted<string>;
|
|
22
22
|
readonly apiBaseUrl: string;
|
|
23
23
|
}
|
|
24
|
-
declare const Credentials_base: Context.ServiceClass<Credentials, "TypesenseCredentials", Effect.Effect<Config,
|
|
24
|
+
declare const Credentials_base: Context.ServiceClass<Credentials, "TypesenseCredentials", Effect.Effect<Config, never, never>>;
|
|
25
25
|
export declare class Credentials extends /*@__PURE__*/ Credentials_base {
|
|
26
26
|
}
|
|
27
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Its configuration is read and checked once, when the layer is built: a
|
|
29
|
+
* problem there fails the layer with `ConfigError`.
|
|
30
|
+
*/
|
|
31
|
+
export declare const CredentialsFromEnv: Layer.Layer<Credentials, ConfigError, never>;
|
|
28
32
|
/** Convenience layer from a redacted key + base URL (kept for local tests). */
|
|
29
33
|
export declare const credentials: (config: {
|
|
30
34
|
readonly apiKey: Redacted.Redacted<string>;
|
package/lib/credentials.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentials.d.ts","
|
|
1
|
+
{"version":3,"file":"credentials.d.ts","sources":["../src/credentials.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,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;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAEvC,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;AAON;;;GAGG;AACH,eAAO,MAAM,kBAAkB,8CAiB9B,CAAC;AAEF,+EAA+E;AAC/E,eAAO,MAAM,WAAW,WAAY;IAClC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC3C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B,KAAG,KAAK,CAAC,KAAK,CAAC,WAAW,CAOxB,CAAC;AAEJ,sDAAsD;AACtD,eAAO,MAAM,aAAa,WAAY,MAAM,KAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAElE,CAAC"}
|
package/lib/errors.d.ts
CHANGED
|
@@ -36,4 +36,11 @@ export type ClientErrors = TypesenseParseError | UnknownTypesenseError;
|
|
|
36
36
|
* core plus the client-level fallback/decode errors.
|
|
37
37
|
*/
|
|
38
38
|
export type DefaultErrors = CoreDefaultErrors | ClientErrors;
|
|
39
|
+
/**
|
|
40
|
+
* The errors declared on the Typesense service: any operation can return them,
|
|
41
|
+
* and every generated operation lists them as its `serviceErrors`. Today that
|
|
42
|
+
* is each of core's status classes (401, 403, 404, 429, the 5xx ...).
|
|
43
|
+
*/
|
|
44
|
+
export declare const TypesenseServiceErrors: 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];
|
|
45
|
+
export type TypesenseServiceError = InstanceType<(typeof TypesenseServiceErrors)[number]>;
|
|
39
46
|
//# sourceMappingURL=errors.d.ts.map
|
package/lib/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;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;AAEtC,OAAO,KAAK,EAAE,aAAa,IAAI,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEvF,OAAO,KAAK,MAAM,MAAM,yCAAyC,CAAC;;;;;;;AAGlE,qBAAa,qBACX,SAAQ,aAAa,CAAC,0BAGrB;CAAG;;;;;;;;;AAGN,qBAAa,mBACX,SAAQ,aAAa,CAAC,wBAGU;CAAG;AAErC;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,mBAAmB,GAAG,qBAAqB,CAAC;AAEvE;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,iBAAiB,GAAG,YAAY,CAAC;AAE7D;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,+tBAAa,CAAC;AACjD,MAAM,MAAM,qBAAqB,GAAG,YAAY,CAAC,CAAC,OAAO,sBAAsB,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$TypesenseParseError as TypesenseParseError, errors$Unauthorized as Unauthorized, errors$UnknownTypesenseError as UnknownTypesenseError, 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$TypesenseParseError as TypesenseParseError, errors$TypesenseServiceErrors as TypesenseServiceErrors, errors$Unauthorized as Unauthorized, errors$UnknownTypesenseError as UnknownTypesenseError, errors$UnprocessableEntity as UnprocessableEntity } from "./_bundle/sdk.js";
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","
|
|
1
|
+
{"version":3,"file":"index.d.ts","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,KAAK,gBAAgB,EAAE,KAAK,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAClG,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC"}
|
package/lib/index.lazy.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAkD,MAAM,eAAe,CAAC;AAClG,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC"}
|
package/lib/protocol.d.ts
CHANGED
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type { 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 { type
|
|
4
|
+
import { UnknownTypesenseError, TypesenseParseError, type TypesenseServiceError } from "./errors.ts";
|
|
9
5
|
/**
|
|
10
|
-
*
|
|
11
|
-
* service
|
|
12
|
-
*
|
|
13
|
-
*
|
|
6
|
+
* What every generated Typesense operation fails with besides its own errors:
|
|
7
|
+
* the service's errors, the protocol's, and what resolving the credentials
|
|
8
|
+
* fails with. Generated service files annotate operations with
|
|
9
|
+
* `API.OperationMethod<I, O, TypesenseOpError, TypesenseOpContext>` explicitly
|
|
10
|
+
* so the compiler never infers these back out of the schema generics.
|
|
14
11
|
*/
|
|
15
|
-
export type TypesenseOpError =
|
|
12
|
+
export type TypesenseOpError = TypesenseServiceError | ErrorOf<typeof TypesenseProtocol>;
|
|
16
13
|
/** Context (requirements) shared by every generated Typesense operation. */
|
|
17
14
|
export type TypesenseOpContext = Credentials | HttpClient.HttpClient;
|
|
18
|
-
export declare const TypesenseProtocol:
|
|
15
|
+
export declare const TypesenseProtocol: import("@distilled.cloud/core/protocol").Protocol<TypesenseParseError | UnknownTypesenseError | import("@distilled.cloud/core/protocol-rest").RestProtocolError, Credentials>;
|
|
19
16
|
//# sourceMappingURL=protocol.d.ts.map
|
package/lib/protocol.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.d.ts","
|
|
1
|
+
{"version":3,"file":"protocol.d.ts","sources":["../src/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAgB9D,OAAO,KAAK,KAAK,UAAU,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAiB,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,KAAK,qBAAqB,EAC3B,MAAM,aAAa,CAAC;AAErB;;;;;;GAMG;AACH,MAAM,MAAM,gBAAgB,GAAG,qBAAqB,GAAG,OAAO,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAEzF,4EAA4E;AAC5E,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG,UAAU,CAAC,UAAU,CAAC;AAErE,eAAO,MAAM,iBAAiB,+KAU5B,CAAC"}
|
package/lib/retry.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retry.d.ts","
|
|
1
|
+
{"version":3,"file":"retry.d.ts","sources":["../src/retry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAuC,MAAM,6BAA6B,CAAC;AAC/F;;;;;;;;;;;;;;;GAeG;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,yEAAyE;AACzE,qBAAa,KAAM,SAAQ,aAAa,CAAC,UAAkD;CAAG;AAE9F,2EAA2E;AAC3E,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","
|
|
1
|
+
{"version":3,"file":"index.d.ts","sources":["../../src/services/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC"}
|
|
@@ -5,32 +5,41 @@ export type { TypesenseOpError, TypesenseOpContext };
|
|
|
5
5
|
declare const BadRequest_base: S.TaggedErrorClass<"BadRequest", {
|
|
6
6
|
readonly code: any;
|
|
7
7
|
readonly message: any;
|
|
8
|
+
readonly body: any;
|
|
9
|
+
readonly headers: any;
|
|
8
10
|
}> & (new (...args: any[]) => {
|
|
9
11
|
"@distilled.cloud/error/categories": {
|
|
10
12
|
BadRequestError: true;
|
|
11
13
|
};
|
|
12
14
|
});
|
|
13
15
|
export declare class BadRequest extends /*@__PURE__*/ BadRequest_base {
|
|
16
|
+
readonly body?: ApiResponse | string;
|
|
14
17
|
}
|
|
15
18
|
declare const Conflict_base: S.TaggedErrorClass<"Conflict", {
|
|
16
19
|
readonly code: any;
|
|
17
20
|
readonly message: any;
|
|
21
|
+
readonly body: any;
|
|
22
|
+
readonly headers: any;
|
|
18
23
|
}> & (new (...args: any[]) => {
|
|
19
24
|
"@distilled.cloud/error/categories": {
|
|
20
25
|
ConflictError: true;
|
|
21
26
|
};
|
|
22
27
|
});
|
|
23
28
|
export declare class Conflict extends /*@__PURE__*/ Conflict_base {
|
|
29
|
+
readonly body?: ApiResponse | string;
|
|
24
30
|
}
|
|
25
31
|
declare const NotFound_base: S.TaggedErrorClass<"NotFound", {
|
|
26
32
|
readonly code: any;
|
|
27
33
|
readonly message: any;
|
|
34
|
+
readonly body: any;
|
|
35
|
+
readonly headers: any;
|
|
28
36
|
}> & (new (...args: any[]) => {
|
|
29
37
|
"@distilled.cloud/error/categories": {
|
|
30
38
|
BadRequestError: true;
|
|
31
39
|
};
|
|
32
40
|
});
|
|
33
41
|
export declare class NotFound extends /*@__PURE__*/ NotFound_base {
|
|
42
|
+
readonly body?: ApiResponse | string;
|
|
34
43
|
}
|
|
35
44
|
export interface ClearCacheRequest {
|
|
36
45
|
}
|
|
@@ -968,7 +977,7 @@ export interface MultiSearchCollectionParameters {
|
|
|
968
977
|
/** The collection to search in. */
|
|
969
978
|
collection?: string | undefined;
|
|
970
979
|
/** A separate search API key for each search within a multi_search request */
|
|
971
|
-
x_typesense_api_key?: string | undefined;
|
|
980
|
+
x_typesense_api_key?: string | import("effect/Redacted").Redacted<string> | undefined;
|
|
972
981
|
}
|
|
973
982
|
export type MultiSearchSearchesParameterSearchesList = Array<MultiSearchCollectionParameters>;
|
|
974
983
|
export interface MultiSearchSearchesParameter {
|
|
@@ -1348,7 +1357,7 @@ export interface GetKeysRequest {
|
|
|
1348
1357
|
export type ApiKeyActionsList = Array<string>;
|
|
1349
1358
|
export type ApiKeyCollectionsList = Array<string>;
|
|
1350
1359
|
export interface ApiKey {
|
|
1351
|
-
value?: string | undefined;
|
|
1360
|
+
value?: string | import("effect/Redacted").Redacted<string> | undefined;
|
|
1352
1361
|
description: string;
|
|
1353
1362
|
actions: ApiKeyActionsList;
|
|
1354
1363
|
collections: ApiKeyCollectionsList;
|
|
@@ -2310,6 +2319,9 @@ export interface UpsertSynonymSetItemResponse {
|
|
|
2310
2319
|
}
|
|
2311
2320
|
export interface VoteRequest {
|
|
2312
2321
|
}
|
|
2322
|
+
export interface ApiResponse {
|
|
2323
|
+
message: string;
|
|
2324
|
+
}
|
|
2313
2325
|
export type ClearCacheError = TypesenseOpError;
|
|
2314
2326
|
/** Clear the cached responses of search requests in the LRU cache. Clear the cached responses of search requests that are sent with `use_cache` parameter in the LRU cache. */
|
|
2315
2327
|
export declare const clearCache: API.OperationMethod<ClearCacheRequest, SuccessStatus, ClearCacheError, TypesenseOpContext>;
|