@distilled.cloud/typesense 1.0.0-rc.17 → 1.0.0-rc.19

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.
@@ -1,2 +1,2 @@
1
- import{api$D as e,api$call as t,api$error as ee,api$named as n,api$newError as r,api$op as i,category$withBadRequestError as a,category$withConflictError as te,category$withParseError as ne,category$withServerError as re,config$String as o,config$all as ie,retry$capped as s,retry$jittered as c,retry$makeDefault as l,retry$throttlingFactory as u,retry$throttlingOptions as d,retry$transientFactory as f,retry$transientOptions as p,trait$Body as m,trait$FormDataFile as h,trait$Header as g,trait$Http as _,trait$HttpBody as v,trait$KeyDictionary as y,trait$Label as b,trait$Query as x,trait$ResponseCode as S,trait$UnionCases as C,trait$applyErrorMatchers as w,trait$bodySymbol as T,trait$errorMatchersSymbol as E,trait$formDataFileSymbol as D,trait$getErrorMatchers as O,trait$headerSymbol as k,trait$httpBodySymbol as A,trait$httpSymbol as j,trait$keyDictionarySymbol as M,trait$labelSymbol as N,trait$querySymbol as P,trait$responseCodeSymbol as F,trait$unionCasesSymbol as I}from"@distilled.cloud/core/_bundle/base";import{errors$API_ERRORS as L,errors$BadGateway as R,errors$BadRequest as z,errors$ConfigError as B,errors$Conflict as V,errors$DEFAULT_ERRORS as H,errors$Forbidden as U,errors$GatewayTimeout as W,errors$HTTP_STATUS_MAP as G,errors$InternalServerError as K,errors$Locked as ae,errors$NotFound as q,errors$ServiceUnavailable as J,errors$TooManyRequests as oe,errors$Unauthorized as se,errors$UnprocessableEntity as ce,protocol_rest$RawResponse as le,protocol_rest$RawResponseRoot as ue,protocol_rest$SensitiveValue as de,protocol_rest$makeRestProtocol as fe,protocol_rest$rawResponseRootSymbol as pe,protocol_rest$rawResponseSymbol as me,protocol_rest$sensitiveValueSymbol as he,schema_lite$Array as ge,schema_lite$Boolean as _e,schema_lite$Number as ve,schema_lite$Record as ye,schema_lite$String as be,schema_lite$Struct as xe,schema_lite$TaggedError as Se,schema_lite$Unknown as Ce,schema_lite$at as we,schema_lite$optional as Te,schema_lite$suspend as Ee}from"@distilled.cloud/core/_bundle/rest";import*as Y from"effect/Context";import*as X from"effect/Effect";import*as Z from"effect/Layer";import*as Q from"effect/Redacted";import*as $ from"@distilled.cloud/core/schema-lite-typed";const De=``;var Credentials=class extends (/*@__PURE__*/ Y.Service()(`TypesenseCredentials`)){};const Oe=/*@__PURE__*/ ie({apiKey:/*@__PURE__*/ o(`TYPESENSE_API_KEY`),apiBaseUrl:/*@__PURE__*/ o(`TYPESENSE_API_URL`)});const ke=/*@__PURE__*/ Z.succeed(Credentials,/*@__PURE__*/ Oe.pipe(/*@__PURE__*/ X.mapError(()=>new B({message:`TYPESENSE_API_KEY and TYPESENSE_API_URL environment variables are required`})),/*@__PURE__*/ X.map(({apiKey:e,apiBaseUrl:t})=>({apiKey:Q.make(e),apiBaseUrl:t})),X.orDie));const credentials=e=>Z.succeed(Credentials,X.succeed({apiKey:e.apiKey,apiBaseUrl:e.apiBaseUrl}));const formatHeaders=e=>({"X-TYPESENSE-API-KEY":Q.value(e.apiKey)});var UnknownTypesenseError=class extends (/*@__PURE__*/ $.TaggedError()(`UnknownTypesenseError`,{code:/*@__PURE__*/ $.optional($.String),message:/*@__PURE__*/ $.optional($.String),body:$.Unknown}).pipe(re)){};var TypesenseParseError=class extends (/*@__PURE__*/ $.TaggedError()(`TypesenseParseError`,{body:$.Unknown,cause:$.Unknown}).pipe(ne)){};const Ae=/*@__PURE__*/ fe({credentials:/*@__PURE__*/ X.flatMap(Credentials,e=>e),baseUrl:e=>e.apiBaseUrl,headers:formatHeaders,unknownError:({message:e,body:t})=>new UnknownTypesenseError({message:e,body:t}),parseError:({body:e,cause:t})=>new TypesenseParseError({body:e,cause:t})});var Retry=class extends (/*@__PURE__*/ Y.Service()(`TypesenseRetry`)){};const policy=e=>X.provide(Z.succeed(Retry,e));const je=/*@__PURE__*/ X.provide(/*@__PURE__*/ Z.succeed(Retry,{while:()=>false}));const Me=/*@__PURE__*/ policy(u);const Ne=/*@__PURE__*/ policy(f);export{i as _,be as a,Ce as c,Credentials as credentials$Credentials,ke as credentials$CredentialsFromEnv,De as credentials$DEFAULT_API_BASE_URL,credentials as credentials$credentials,formatHeaders as credentials$formatHeaders,Ee as d,L as errors$API_ERRORS,R as errors$BadGateway,z as errors$BadRequest,B as errors$ConfigError,V as errors$Conflict,H as errors$DEFAULT_ERRORS,U as errors$Forbidden,W as errors$GatewayTimeout,G as errors$HTTP_STATUS_MAP,K as errors$InternalServerError,ae as errors$Locked,q as errors$NotFound,J as errors$ServiceUnavailable,oe as errors$TooManyRequests,TypesenseParseError as errors$TypesenseParseError,se as errors$Unauthorized,UnknownTypesenseError as errors$UnknownTypesenseError,ce as errors$UnprocessableEntity,e as f,r as g,n as h,ye as i,we as l,ee as m,_e as n,xe as o,t as p,Ae as protocol$TypesenseProtocol,ve as r,Retry as retry$Retry,s as retry$capped,c as retry$jittered,l as retry$makeDefault,je as retry$none,policy as retry$policy,Me as retry$throttling,u as retry$throttlingFactory,d as retry$throttlingOptions,Ne as retry$transient,f as retry$transientFactory,p as retry$transientOptions,Se as s,ge as t,m as traits$Body,h as traits$FormDataFile,g as traits$Header,_ as traits$Http,v as traits$HttpBody,y as traits$KeyDictionary,b as traits$Label,x as traits$Query,le as traits$RawResponse,ue as traits$RawResponseRoot,S as traits$ResponseCode,de as traits$SensitiveValue,C as traits$UnionCases,w as traits$applyErrorMatchers,T as traits$bodySymbol,E as traits$errorMatchersSymbol,D as traits$formDataFileSymbol,O as traits$getErrorMatchers,k as traits$headerSymbol,A as traits$httpBodySymbol,j as traits$httpSymbol,M as traits$keyDictionarySymbol,N as traits$labelSymbol,P as traits$querySymbol,pe as traits$rawResponseRootSymbol,me as traits$rawResponseSymbol,F as traits$responseCodeSymbol,he as traits$sensitiveValueSymbol,I as traits$unionCasesSymbol,Te as u,a as v,te as y};
1
+ import{api$D as e,api$call as t,api$error as n,api$named as ee,api$newError as r,api$op as i,category$withBadRequestError as a,category$withConflictError as o,category$withParseError as s,category$withServerError as c,config$String as l,config$all as te,retry$capped as ne,retry$jittered as re,retry$makeDefault as ie,retry$throttlingFactory as u,retry$throttlingOptions as d,retry$transientFactory as f,retry$transientOptions as p,schema_lite_typed$String as m,schema_lite_typed$TaggedError as h,schema_lite_typed$Unknown as g,schema_lite_typed$optional as _,trait$Body as v,trait$FormDataFile as y,trait$Header as b,trait$Http as x,trait$HttpBody as S,trait$KeyDictionary as C,trait$Label as w,trait$Query as T,trait$ResponseCode as E,trait$UnionCases as D,trait$applyErrorMatchers as O,trait$bodySymbol as k,trait$errorMatchersSymbol as A,trait$formDataFileSymbol as j,trait$getErrorMatchers as M,trait$headerSymbol as N,trait$httpBodySymbol as P,trait$httpSymbol as F,trait$keyDictionarySymbol as I,trait$labelSymbol as L,trait$querySymbol as R,trait$responseCodeSymbol as z,trait$unionCasesSymbol as B}from"@distilled.cloud/core/_bundle/base";import{errors$API_ERRORS as V,errors$BadGateway as H,errors$BadRequest as U,errors$ConfigError as W,errors$Conflict as G,errors$DEFAULT_ERRORS as K,errors$Forbidden as q,errors$GatewayTimeout as J,errors$HTTP_STATUS_MAP as Y,errors$InternalServerError as ae,errors$Locked as oe,errors$NotFound as se,errors$ServiceUnavailable as ce,errors$TooManyRequests as le,errors$Unauthorized as ue,errors$UnprocessableEntity as de,protocol_rest$RawResponse as fe,protocol_rest$RawResponseRoot as pe,protocol_rest$SensitiveValue as me,protocol_rest$makeRestProtocol as he,protocol_rest$rawResponseRootSymbol as ge,protocol_rest$rawResponseSymbol as _e,protocol_rest$sensitiveValueSymbol as ve,schema_lite$Array as ye,schema_lite$Boolean as be,schema_lite$Number as xe,schema_lite$Record as Se,schema_lite$String as Ce,schema_lite$Struct as we,schema_lite$TaggedError 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__*/ te({apiKey:/*@__PURE__*/ l(`TYPESENSE_API_KEY`),apiBaseUrl:/*@__PURE__*/ l(`TYPESENSE_API_URL`)});const Me=/*@__PURE__*/ Q.succeed(Credentials,/*@__PURE__*/ je.pipe(/*@__PURE__*/ Z.mapError(()=>new W({message:`TYPESENSE_API_KEY and TYPESENSE_API_URL environment variables are required`})),/*@__PURE__*/ Z.map(({apiKey:e,apiBaseUrl:t})=>({apiKey:$.make(e),apiBaseUrl:t}))));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__*/ h()(`UnknownTypesenseError`,{code:/*@__PURE__*/ _(m),message:/*@__PURE__*/ _(m),body:g}).pipe(c)){};var TypesenseParseError=class extends (/*@__PURE__*/ h()(`TypesenseParseError`,{body:g,cause:g}).pipe(s)){};const Ne=/*@__PURE__*/ he({credentials:/*@__PURE__*/ Z.flatMap(Credentials,e=>e),baseUrl:e=>e.apiBaseUrl,headers:formatHeaders,unknownError:({message:e,body:t})=>new UnknownTypesenseError({message:e,body:t}),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 Pe=/*@__PURE__*/ Z.provide(/*@__PURE__*/ Q.succeed(Retry,{while:()=>false}));const Fe=/*@__PURE__*/ policy(u);const Ie=/*@__PURE__*/ policy(f);export{o as Ba,ye as Ub,be as Vb,e as a,t as c,xe as cc,Credentials as credentials$Credentials,Me as credentials$CredentialsFromEnv,Ae as credentials$DEFAULT_API_BASE_URL,credentials as credentials$credentials,formatHeaders as credentials$formatHeaders,Se as dc,n as e,V as errors$API_ERRORS,H as errors$BadGateway,U as errors$BadRequest,W as errors$ConfigError,G as errors$Conflict,K as errors$DEFAULT_ERRORS,q as errors$Forbidden,J as errors$GatewayTimeout,Y as errors$HTTP_STATUS_MAP,ae as errors$InternalServerError,oe as errors$Locked,se as errors$NotFound,ce as errors$ServiceUnavailable,le as errors$TooManyRequests,TypesenseParseError as errors$TypesenseParseError,ue as errors$Unauthorized,UnknownTypesenseError as errors$UnknownTypesenseError,de as errors$UnprocessableEntity,Ce as fc,we as gc,Te as ic,ee as k,r as l,Ee as lc,i as m,De as nc,Ne as protocol$TypesenseProtocol,Retry as retry$Retry,ne as retry$capped,re as retry$jittered,ie as retry$makeDefault,Pe as retry$none,policy as retry$policy,Fe as retry$throttling,u as retry$throttlingFactory,d as retry$throttlingOptions,Ie as retry$transient,f as retry$transientFactory,p as retry$transientOptions,Oe as sc,ke as tc,v as traits$Body,y as traits$FormDataFile,b as traits$Header,x as traits$Http,S as traits$HttpBody,C as traits$KeyDictionary,w as traits$Label,T as traits$Query,fe as traits$RawResponse,pe as traits$RawResponseRoot,E as traits$ResponseCode,me as traits$SensitiveValue,D as traits$UnionCases,O as traits$applyErrorMatchers,k as traits$bodySymbol,A as traits$errorMatchersSymbol,j as traits$formDataFileSymbol,M as traits$getErrorMatchers,N as traits$headerSymbol,P as traits$httpBodySymbol,F as traits$httpSymbol,I as traits$keyDictionarySymbol,L as traits$labelSymbol,R as traits$querySymbol,ge as traits$rawResponseRootSymbol,_e as traits$rawResponseSymbol,z as traits$responseCodeSymbol,ve as traits$sensitiveValueSymbol,B as traits$unionCasesSymbol,a as ya};
2
2
  //# sourceMappingURL=sdk.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sdk.js","names":["Category.withServerError","Category.withParseError","D","call","error","named","newError","op","withBadRequestError","withConflictError","withParseError","withServerError","String$1","all$1","capped","jittered","makeDefault","throttlingFactory","throttlingOptions","transientFactory","transientOptions","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","UnprocessableEntity","RawResponse","RawResponseRoot","SensitiveValue","makeRestProtocol","rawResponseRootSymbol","rawResponseSymbol","sensitiveValueSymbol","Array","Boolean","Number","Record","String","Struct","TaggedError","Unknown","at","optional","suspend","Context","Effect","Layer","Redacted","Schema","DEFAULT_API_BASE_URL","envConfig","CredentialsFromEnv","apiKey","config","TypesenseProtocol","resolve","creds","optionsOrFactory","none","throttling","transient"],"sources":["../../src/credentials.ts","../../src/errors.ts","../../src/protocol.ts","../../src/retry.ts"],"mappings":"+pEAoBA,MAAamF,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,EAED,MAAaC,GAAmC,gBAAM,QACpD,YACc,iBAAU,KACR,gBAAO,aAEjB,IAAItC,EAAY,CACd,QAAS,4EACX,CAAC,CACL,EACc,gBAAO,KAAK,CAAE,SAAQ,iBAAkB,CACpD,OAAQkC,EAAS,KAAKK,CAAM,EAC5B,YACF,EAAE,EACFP,EAAO,KACT,CACF,EAGA,MAAa,YAAe,GAI1BC,EAAM,QACJ,YACAD,EAAO,QAAQ,CACb,OAAQQ,EAAO,OACf,WAAYA,EAAO,UACrB,CAAC,CACH,EAGF,MAAa,cAAiB,IAA4C,CACxE,sBAAuBN,EAAS,MAAMM,EAAO,MAAM,CACrD,GCxCA,IAAa,sBAAb,eACwB,gBAAO,YAAmC,CAAC,CAAC,wBAAyB,CACzF,KAAoB,gBAAO,SAASL,EAAO,MAAM,EACjD,QAAuB,gBAAO,SAASA,EAAO,MAAM,EACpD,KAAMA,EAAO,OACf,CAAC,CAAC,CAAC,KAAKlF,EAAwB,EAAA,AAAE,CAAC,EAGrC,IAAa,oBAAb,eACwB,gBAAO,YAAiC,CAAC,CAAC,sBAAuB,CACrF,KAAMkF,EAAO,QACb,MAAOA,EAAO,OAChB,CAAC,CAAC,CAAC,KAAKjF,EAAuB,EAAA,AAAE,CAAC,ECRpC,MAAauF,GAA6D,iBAAyB,CAGjG,YAA2B,gBAAO,QAAQ,YAAc,GAAYC,CAAO,EAC3E,QAAU,GAAUC,EAAM,WAC1B,QAAS,cAGT,cAAe,CAAE,UAAS,UAAW,IAAI,sBAAsB,CAAE,UAAS,MAAK,CAAC,EAChF,YAAa,CAAE,OAAM,WAAY,IAAI,oBAAoB,CAAE,OAAM,OAAM,CAAC,CAC1E,CAAC,ECTD,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,qBAAO5E,CAAiB,EAGhE,MAAa6E,GAA0B,qBAAO3E,CAAgB"}
1
+ {"version":3,"file":"sdk.js","names":["Schema.String","Schema.Unknown","Category.withServerError","Category.withParseError","D","call","error","named","newError","op","withBadRequestError","withConflictError","withParseError","withServerError","String$2","all$1","capped","jittered","makeDefault","throttlingFactory","throttlingOptions","transientFactory","transientOptions","String$1","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","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","Number","Record","String","Struct","TaggedError","Unknown","at","optional","suspend","Context","Effect","Layer","Redacted","DEFAULT_API_BASE_URL","envConfig","CredentialsFromEnv","apiKey","config","TypesenseProtocol","resolve","creds","optionsOrFactory","none","throttling","transient"],"sources":["../../src/credentials.ts","../../src/errors.ts","../../src/protocol.ts","../../src/retry.ts"],"mappings":"wuEAoBA,MAAawF,GAAuB,GAOpC,IAAa,YAAb,eACwB,gBAAQ,QAAyD,CAAC,CACtF,sBACF,EAAA,AAAE,CAAC,EAEL,MAAMC,GAA0B,iBAAiB,CAC/C,OAAsB,gBAAoB,mBAAmB,EAC7D,WAA0B,gBAAoB,mBAAmB,CACnE,CAAC,EAED,MAAaC,GAAmC,gBAAM,QACpD,YACc,iBAAU,KACR,gBAAO,aAEjB,IAAIrC,EAAY,CACd,QAAS,4EACX,CAAC,CACL,EACc,gBAAO,KAAK,CAAE,SAAQ,iBAAkB,CACpD,OAAQkC,EAAS,KAAKI,CAAM,EAC5B,YACF,EAAE,CACJ,CACF,EAGA,MAAa,YAAe,GAI1BL,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,GCvCA,IAAa,sBAAb,eACwB,gBAA0C,CAAC,CAAC,wBAAyB,CACzF,KAAoB,gBAAgB5F,CAAa,EACjD,QAAuB,gBAAgBA,CAAa,EACpD,KAAMC,CACR,CAAC,CAAC,CAAC,KAAKC,CAAwB,EAAA,AAAE,CAAC,EAGrC,IAAa,oBAAb,eACwB,gBAAwC,CAAC,CAAC,sBAAuB,CACrF,KAAMD,EACN,MAAOA,CACT,CAAC,CAAC,CAAC,KAAKE,CAAuB,EAAA,AAAE,CAAC,ECFpC,MAAa0F,GAA6D,iBAAyB,CAGjG,YAA2B,gBAAO,QAAQ,YAAc,GAAYC,CAAO,EAC3E,QAAU,GAAUC,EAAM,WAC1B,QAAS,cAGT,cAAe,CAAE,UAAS,UAAW,IAAI,sBAAsB,CAAE,UAAS,MAAK,CAAC,EAChF,YAAa,CAAE,OAAM,WAAY,IAAI,oBAAoB,CAAE,OAAM,OAAM,CAAC,CAC1E,CAAC,ECfD,IAAa,MAAb,eAAyC,gBAAQ,QAAuB,CAAC,CAAC,gBAAgB,EAAA,AAAE,CAAC,EAG7F,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,qBAAO/E,CAAiB,EAGhE,MAAagF,GAA0B,qBAAO9E,CAAgB"}
@@ -1,3 +1,12 @@
1
+ /**
2
+ * Typesense credentials -- hand-written.
3
+ *
4
+ * API-compatible port of the distilled repo's typesense credentials module:
5
+ * a static API key sent as the `X-TYPESENSE-API-KEY` header plus a
6
+ * caller-supplied base URL. The `Credentials` service holds an *effect* so
7
+ * layers may resolve the key lazily (env, vaults, ...).
8
+ */
9
+ import { ConfigError } from "@distilled.cloud/core/errors";
1
10
  import * as Context from "effect/Context";
2
11
  import * as Effect from "effect/Effect";
3
12
  import * as Layer from "effect/Layer";
@@ -12,7 +21,7 @@ export interface Config {
12
21
  readonly apiKey: Redacted.Redacted<string>;
13
22
  readonly apiBaseUrl: string;
14
23
  }
15
- declare const Credentials_base: Context.ServiceClass<Credentials, "TypesenseCredentials", Effect.Effect<Config, never, never>>;
24
+ declare const Credentials_base: Context.ServiceClass<Credentials, "TypesenseCredentials", Effect.Effect<Config, ConfigError, never>>;
16
25
  export declare class Credentials extends /*@__PURE__*/ Credentials_base {
17
26
  }
18
27
  export declare const CredentialsFromEnv: Layer.Layer<Credentials, never, never>;
@@ -1 +1 @@
1
- {"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"AAUA,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,eAAO,MAAM,kBAAkB,wCAe9B,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"}
1
+ {"version":3,"file":"credentials.d.ts","sourceRoot":"","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,eAAO,MAAM,kBAAkB,wCAc9B,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/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * @distilled.cloud/typesense -- Typesense SDK for Effect.
3
3
  *
4
- * `./services` is generated by `scripts/generate.ts` from the Smithy model
5
- * in `.generated-specs` (converted from the Typesense OpenAPI spec by
6
- * `scripts/convert.ts`). Everything else in this folder is hand-written.
4
+ * `./services` is generated by `scripts/generate.ts` from the Smithy model that
5
+ * `scripts/convert.ts` converts from the Typesense OpenAPI spec. Everything
6
+ * else in this folder is hand-written.
7
7
  */
8
8
  export * from "./credentials.ts";
9
9
  export * from "./errors.ts";
package/lib/protocol.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import type * as API from "@distilled.cloud/core/api";
2
- import type { ConfigError } from "@distilled.cloud/core/errors";
2
+ import type { 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 { type DefaultErrors } from "./errors.ts";
11
12
  * TypesenseOpError, TypesenseOpContext>` explicitly so the compiler never
12
13
  * infers these back out of the schema generics.
13
14
  */
14
- export type TypesenseOpError = DefaultErrors | ConfigError | HttpClientError.HttpClientError;
15
+ export type TypesenseOpError = DefaultErrors | ConfigError | HttpClientError.HttpClientError | InvalidInput | SdkError;
15
16
  /** Context (requirements) shared by every generated Typesense operation. */
16
17
  export type TypesenseOpContext = Credentials | HttpClient.HttpClient;
17
18
  export declare const TypesenseProtocol: Layer.Layer<API.Protocol>;
@@ -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,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAgBhE,OAAO,KAAK,KAAK,UAAU,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,KAAK,eAAe,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAe,WAAW,EAAiB,MAAM,kBAAkB,CAAC;AAC3E,OAAO,EAAE,KAAK,aAAa,EAA8C,MAAM,aAAa,CAAC;AAE7F;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG,WAAW,GAAG,eAAe,CAAC,eAAe,CAAC;AAE7F,4EAA4E;AAC5E,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG,UAAU,CAAC,UAAU,CAAC;AAErE,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAUtD,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,WAAW,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE9E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAehE,OAAO,KAAK,KAAK,UAAU,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,KAAK,eAAe,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAe,WAAW,EAAiB,MAAM,kBAAkB,CAAC;AAC3E,OAAO,EAAE,KAAK,aAAa,EAA8C,MAAM,aAAa,CAAC;AAE7F;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,GACxB,aAAa,GACb,WAAW,GACX,eAAe,CAAC,eAAe,GAC/B,YAAY,GACZ,QAAQ,CAAC;AAEb,4EAA4E;AAC5E,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG,UAAU,CAAC,UAAU,CAAC;AAErE,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAUtD,CAAC"}