@distilled.cloud/discord 1.0.0-rc.18 → 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 n,api$named as r,api$newError as ee,api$op as te,category$withBadRequestError as i,category$withParseError as a,category$withServerError as o,config$Redacted as s,config$String as c,config$all as ne,config$orElse as re,config$withDefault as l,retry$capped as ie,retry$jittered as ae,retry$makeDefault as u,retry$throttlingFactory as d,retry$throttlingOptions as f,retry$transientFactory as p,retry$transientOptions as m,schema_lite_typed$Number as h,schema_lite_typed$String as g,schema_lite_typed$TaggedError as _,schema_lite_typed$Unknown as v,schema_lite_typed$optional as y,trait$Body as b,trait$FormDataFile as x,trait$Header as S,trait$Http as C,trait$HttpBody as w,trait$KeyDictionary as T,trait$Label as E,trait$Query as D,trait$ResponseCode as O,trait$UnionCases as k,trait$applyErrorMatchers as A,trait$bodySymbol as j,trait$errorMatchersSymbol as M,trait$formDataFileSymbol as N,trait$getErrorMatchers as P,trait$headerSymbol as F,trait$httpBodySymbol as I,trait$httpSymbol as L,trait$keyDictionarySymbol as R,trait$labelSymbol as z,trait$querySymbol as B,trait$responseCodeSymbol as V,trait$unionCasesSymbol as H}from"@distilled.cloud/core/_bundle/base";import{errors$API_ERRORS as U,errors$BadGateway as W,errors$BadRequest as G,errors$ConfigError as K,errors$Conflict as q,errors$DEFAULT_ERRORS as J,errors$Forbidden as Y,errors$GatewayTimeout as oe,errors$HTTP_STATUS_MAP as se,errors$InternalServerError as ce,errors$Locked as le,errors$NotFound as ue,errors$ServiceUnavailable as de,errors$TooManyRequests as fe,errors$Unauthorized as pe,errors$UnprocessableEntity as me,protocol_rest$RawResponse as he,protocol_rest$RawResponseRoot as ge,protocol_rest$SensitiveValue as _e,protocol_rest$makeRestProtocol as ve,protocol_rest$rawResponseRootSymbol as ye,protocol_rest$rawResponseSymbol as be,protocol_rest$sensitiveValueSymbol as xe,schema_lite$Array as Se,schema_lite$Boolean as Ce,schema_lite$NullOr as we,schema_lite$Number as Te,schema_lite$Record as Ee,schema_lite$String as De,schema_lite$Struct as Oe,schema_lite$TaggedError as ke,schema_lite$Unknown as Ae,schema_lite$at as je,schema_lite$optional as Me,schema_lite$suspend as Ne}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 Pe from"effect/Redacted";const $=`https://discord.com/api/v10`;var Credentials=class extends (/*@__PURE__*/ X.Service()(`DiscordCredentials`)){};const Fe=/*@__PURE__*/ ne({token:/*@__PURE__*/ s(`DISCORD_BOT_TOKEN`).pipe(/*@__PURE__*/ re(()=>s(`DISCORD_TOKEN`))),tokenType:/*@__PURE__*/ c(`DISCORD_TOKEN_TYPE`).pipe(/*@__PURE__*/ l(`Bot`)),apiBaseUrl:/*@__PURE__*/ c(`DISCORD_API_URL`).pipe(/*@__PURE__*/ l($))});const Ie=/*@__PURE__*/ Q.succeed(Credentials,/*@__PURE__*/ Fe.pipe(/*@__PURE__*/ Z.mapError(()=>new K({message:`DISCORD_BOT_TOKEN (or DISCORD_TOKEN) environment variable is required`})),/*@__PURE__*/ Z.map(({token:e,tokenType:t,apiBaseUrl:n})=>({token:e,tokenType:t.toLowerCase()===`bearer`?`Bearer`:`Bot`,apiBaseUrl:n}))));const credentials=e=>Q.succeed(Credentials,Z.succeed({token:e.token,tokenType:e.tokenType??`Bot`,apiBaseUrl:e.apiBaseUrl??`https://discord.com/api/v10`}));var UnknownDiscordError=class extends (/*@__PURE__*/ _()(`UnknownDiscordError`,{code:/*@__PURE__*/ y(h),message:/*@__PURE__*/ y(g),errors:/*@__PURE__*/ y(v),body:v}).pipe(o)){};var DiscordParseError=class extends (/*@__PURE__*/ _()(`DiscordParseError`,{body:v,cause:v}).pipe(a)){};const errorEnvelope=e=>{if(e===null||typeof e!==`object`)return void 0;const t=e;const n=typeof t.message===`string`?t.message:typeof t.error_description===`string`?t.error_description:typeof t.error===`string`?t.error:void 0;return{code:typeof t.code===`number`||typeof t.code===`string`?t.code:void 0,message:n}};const errorDetails=e=>{if(e===null||typeof e!==`object`)return void 0;return e.errors};const numericCode=e=>{if(typeof e===`number`)return Number.isFinite(e)?e:void 0;if(typeof e!==`string`||e.trim()===``)return void 0;const t=Number(e);return Number.isFinite(t)?t:void 0};const Le=/*@__PURE__*/ ve({credentials:/*@__PURE__*/ Z.flatMap(Credentials,e=>e),baseUrl:e=>e.apiBaseUrl,headers:e=>({Authorization:`${e.tokenType} ${Pe.value(e.token)}`}),errorEnvelope,unknownError:({code:e,message:t,body:n})=>new UnknownDiscordError({code:numericCode(e),message:t,errors:errorDetails(n),body:n}),parseError:({body:e,cause:t})=>new DiscordParseError({body:e,cause:t})});var Retry=class extends (/*@__PURE__*/ X.Service()(`DiscordRetry`)){};const policy=e=>Z.provide(Q.succeed(Retry,e));const Re=/*@__PURE__*/ Z.provide(/*@__PURE__*/ Q.succeed(Retry,{while:()=>false}));const ze=u;const Be=ae;const Ve=ie;const He=f;const Ue=/*@__PURE__*/ policy(d);const We=m;const Ge=/*@__PURE__*/ policy(p);export{Se as Rb,Ce as Sb,we as Zb,Te as _b,e as a,Ee as ac,t as c,De as cc,Credentials as credentials$Credentials,Ie as credentials$CredentialsFromEnv,$ as credentials$DEFAULT_API_BASE_URL,credentials as credentials$credentials,Oe as dc,n as e,U as errors$API_ERRORS,W as errors$BadGateway,G as errors$BadRequest,K as errors$ConfigError,q as errors$Conflict,J as errors$DEFAULT_ERRORS,DiscordParseError as errors$DiscordParseError,Y as errors$Forbidden,oe as errors$GatewayTimeout,se as errors$HTTP_STATUS_MAP,ce as errors$InternalServerError,le as errors$Locked,ue as errors$NotFound,de as errors$ServiceUnavailable,fe as errors$TooManyRequests,pe as errors$Unauthorized,UnknownDiscordError as errors$UnknownDiscordError,me as errors$UnprocessableEntity,ke as fc,Ae as ic,r as j,ee as k,je as kc,te as l,Me as pc,Le as protocol$DiscordProtocol,Ne as qc,Retry as retry$Retry,Ve as retry$capped,Be as retry$jittered,ze as retry$makeDefault,Re as retry$none,policy as retry$policy,Ue as retry$throttling,He as retry$throttlingOptions,Ge as retry$transient,We as retry$transientOptions,b as traits$Body,x as traits$FormDataFile,S as traits$Header,C as traits$Http,w as traits$HttpBody,T as traits$KeyDictionary,E as traits$Label,D as traits$Query,he as traits$RawResponse,ge as traits$RawResponseRoot,O as traits$ResponseCode,_e as traits$SensitiveValue,k as traits$UnionCases,A as traits$applyErrorMatchers,j as traits$bodySymbol,M as traits$errorMatchersSymbol,N as traits$formDataFileSymbol,P as traits$getErrorMatchers,F as traits$headerSymbol,I as traits$httpBodySymbol,L as traits$httpSymbol,R as traits$keyDictionarySymbol,z as traits$labelSymbol,B as traits$querySymbol,ye as traits$rawResponseRootSymbol,be as traits$rawResponseSymbol,V as traits$responseCodeSymbol,xe as traits$sensitiveValueSymbol,H as traits$unionCasesSymbol,i as wa};
1
+ import{api$D as e,api$call as t,api$error as n,api$named as r,api$newError as ee,api$op as te,category$withBadRequestError as i,category$withParseError as a,category$withServerError as o,config$Redacted as s,config$String as c,config$all as ne,config$orElse as re,config$withDefault as l,retry$capped as ie,retry$jittered as ae,retry$makeDefault as u,retry$throttlingFactory as d,retry$throttlingOptions as f,retry$transientFactory as p,retry$transientOptions as m,schema_lite_typed$Number as h,schema_lite_typed$String as g,schema_lite_typed$TaggedError as _,schema_lite_typed$Unknown as v,schema_lite_typed$optional as y,trait$Body as b,trait$FormDataFile as x,trait$Header as S,trait$Http as C,trait$HttpBody as w,trait$KeyDictionary as T,trait$Label as E,trait$Query as D,trait$ResponseCode as O,trait$UnionCases as k,trait$applyErrorMatchers as A,trait$bodySymbol as j,trait$errorMatchersSymbol as M,trait$formDataFileSymbol as N,trait$getErrorMatchers as P,trait$headerSymbol as F,trait$httpBodySymbol as I,trait$httpSymbol as L,trait$keyDictionarySymbol as R,trait$labelSymbol as z,trait$querySymbol as B,trait$responseCodeSymbol as V,trait$unionCasesSymbol as H}from"@distilled.cloud/core/_bundle/base";import{errors$API_ERRORS as U,errors$BadGateway as W,errors$BadRequest as G,errors$ConfigError as K,errors$Conflict as q,errors$DEFAULT_ERRORS as J,errors$Forbidden as Y,errors$GatewayTimeout as oe,errors$HTTP_STATUS_MAP as se,errors$InternalServerError as ce,errors$Locked as le,errors$NotFound as ue,errors$ServiceUnavailable as de,errors$TooManyRequests as fe,errors$Unauthorized as pe,errors$UnprocessableEntity as me,protocol_rest$RawResponse as he,protocol_rest$RawResponseRoot as ge,protocol_rest$SensitiveValue as _e,protocol_rest$makeRestProtocol as ve,protocol_rest$rawResponseRootSymbol as ye,protocol_rest$rawResponseSymbol as be,protocol_rest$sensitiveValueSymbol as xe,schema_lite$Array as Se,schema_lite$Boolean as Ce,schema_lite$NullOr as we,schema_lite$Number as Te,schema_lite$Record as Ee,schema_lite$String as De,schema_lite$Struct as Oe,schema_lite$TaggedError as ke,schema_lite$Unknown as Ae,schema_lite$at as je,schema_lite$optional as Me,schema_lite$suspend as Ne}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 Pe from"effect/Redacted";const $=`https://discord.com/api/v10`;var Credentials=class extends (/*@__PURE__*/ X.Service()(`DiscordCredentials`)){};const Fe=/*@__PURE__*/ ne({token:/*@__PURE__*/ s(`DISCORD_BOT_TOKEN`).pipe(/*@__PURE__*/ re(()=>s(`DISCORD_TOKEN`))),tokenType:/*@__PURE__*/ c(`DISCORD_TOKEN_TYPE`).pipe(/*@__PURE__*/ l(`Bot`)),apiBaseUrl:/*@__PURE__*/ c(`DISCORD_API_URL`).pipe(/*@__PURE__*/ l($))});const Ie=/*@__PURE__*/ Q.succeed(Credentials,/*@__PURE__*/ Fe.pipe(/*@__PURE__*/ Z.mapError(()=>new K({message:`DISCORD_BOT_TOKEN (or DISCORD_TOKEN) environment variable is required`})),/*@__PURE__*/ Z.map(({token:e,tokenType:t,apiBaseUrl:n})=>({token:e,tokenType:t.toLowerCase()===`bearer`?`Bearer`:`Bot`,apiBaseUrl:n}))));const credentials=e=>Q.succeed(Credentials,Z.succeed({token:e.token,tokenType:e.tokenType??`Bot`,apiBaseUrl:e.apiBaseUrl??`https://discord.com/api/v10`}));var UnknownDiscordError=class extends (/*@__PURE__*/ _()(`UnknownDiscordError`,{code:/*@__PURE__*/ y(h),message:/*@__PURE__*/ y(g),errors:/*@__PURE__*/ y(v),body:v}).pipe(o)){};var DiscordParseError=class extends (/*@__PURE__*/ _()(`DiscordParseError`,{body:v,cause:v}).pipe(a)){};const errorEnvelope=e=>{if(e===null||typeof e!==`object`)return void 0;const t=e;const n=typeof t.message===`string`?t.message:typeof t.error_description===`string`?t.error_description:typeof t.error===`string`?t.error:void 0;return{code:typeof t.code===`number`||typeof t.code===`string`?t.code:void 0,message:n}};const errorDetails=e=>{if(e===null||typeof e!==`object`)return void 0;return e.errors};const numericCode=e=>{if(typeof e===`number`)return Number.isFinite(e)?e:void 0;if(typeof e!==`string`||e.trim()===``)return void 0;const t=Number(e);return Number.isFinite(t)?t:void 0};const Le=/*@__PURE__*/ ve({credentials:/*@__PURE__*/ Z.flatMap(Credentials,e=>e),baseUrl:e=>e.apiBaseUrl,headers:e=>({Authorization:`${e.tokenType} ${Pe.value(e.token)}`}),errorEnvelope,unknownError:({code:e,message:t,body:n})=>new UnknownDiscordError({code:numericCode(e),message:t,errors:errorDetails(n),body:n}),parseError:({body:e,cause:t})=>new DiscordParseError({body:e,cause:t})});var Retry=class extends (/*@__PURE__*/ X.Service()(`DiscordRetry`)){};const policy=e=>Z.provide(Q.succeed(Retry,e));const Re=/*@__PURE__*/ Z.provide(/*@__PURE__*/ Q.succeed(Retry,{while:()=>false}));const ze=u;const Be=ae;const Ve=ie;const He=f;const Ue=/*@__PURE__*/ policy(d);const We=m;const Ge=/*@__PURE__*/ policy(p);export{Se as Ub,Ce as Vb,e as a,we as bc,t as c,Te as cc,Credentials as credentials$Credentials,Ie as credentials$CredentialsFromEnv,$ as credentials$DEFAULT_API_BASE_URL,credentials as credentials$credentials,Ee as dc,n as e,U as errors$API_ERRORS,W as errors$BadGateway,G as errors$BadRequest,K as errors$ConfigError,q as errors$Conflict,J as errors$DEFAULT_ERRORS,DiscordParseError as errors$DiscordParseError,Y as errors$Forbidden,oe as errors$GatewayTimeout,se as errors$HTTP_STATUS_MAP,ce as errors$InternalServerError,le as errors$Locked,ue as errors$NotFound,de as errors$ServiceUnavailable,fe as errors$TooManyRequests,pe as errors$Unauthorized,UnknownDiscordError as errors$UnknownDiscordError,me as errors$UnprocessableEntity,De as fc,Oe as gc,ke as ic,r as k,ee as l,Ae as lc,te as m,je as nc,Le as protocol$DiscordProtocol,Retry as retry$Retry,Ve as retry$capped,Be as retry$jittered,ze as retry$makeDefault,Re as retry$none,policy as retry$policy,Ue as retry$throttling,He as retry$throttlingOptions,Ge as retry$transient,We as retry$transientOptions,Me as sc,Ne as tc,b as traits$Body,x as traits$FormDataFile,S as traits$Header,C as traits$Http,w as traits$HttpBody,T as traits$KeyDictionary,E as traits$Label,D as traits$Query,he as traits$RawResponse,ge as traits$RawResponseRoot,O as traits$ResponseCode,_e as traits$SensitiveValue,k as traits$UnionCases,A as traits$applyErrorMatchers,j as traits$bodySymbol,M as traits$errorMatchersSymbol,N as traits$formDataFileSymbol,P as traits$getErrorMatchers,F as traits$headerSymbol,I as traits$httpBodySymbol,L as traits$httpSymbol,R as traits$keyDictionarySymbol,z as traits$labelSymbol,B as traits$querySymbol,ye as traits$rawResponseRootSymbol,be as traits$rawResponseSymbol,V as traits$responseCodeSymbol,xe as traits$sensitiveValueSymbol,H as traits$unionCasesSymbol,i as ya};
2
2
  //# sourceMappingURL=sdk.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sdk.js","names":["EffectConfig.Redacted","Schema.Number","Schema.String","Schema.Unknown","Category.withServerError","Category.withParseError","Retries.makeDefault","Retries.jittered","Retries.capped","Retries.throttlingOptions","Retries.throttlingFactory","Retries.transientOptions","Retries.transientFactory","D","call","error","named","newError","op","withBadRequestError","withParseError","withServerError","Redacted$3","String$2","all$1","orElse","withDefault","capped$1","jittered$1","makeDefault$1","throttlingFactory","throttlingOptions$1","transientFactory","transientOptions$1","Number$2","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","NullOr","Number$1","Record","String","Struct","TaggedError","Unknown","at","optional","suspend","Context","Effect","Layer","Redacted","DEFAULT_API_BASE_URL","envConfig","CredentialsFromEnv","tokenType","config","body","b","message","code","n","DiscordProtocol","resolve","creds","optionsOrFactory","none","makeDefault","jittered","capped","throttlingOptions","throttling","transientOptions","transient"],"sources":["../../src/credentials.ts","../../src/errors.ts","../../src/protocol.ts","../../src/retry.ts"],"mappings":"m0EA0BA,MAAaqG,EAAuB,8BAWpC,IAAa,YAAb,eACwB,gBAAQ,QAAyD,CAAC,CACtF,oBACF,EAAA,AAAE,CAAC,EAEL,MAAMC,GAA0B,iBAAiB,CAG/C,MAAqB,gBAAsB,mBAAmB,CAAC,CAAC,KAChD,qBAA0BtG,EAAsB,eAAe,CAAC,CAChF,EACA,UAAyB,gBAAoB,oBAAoB,CAAC,CAAC,KACnD,gBAAyB,KAAK,CAC9C,EACA,WAA0B,gBAAoB,iBAAiB,CAAC,CAAC,KACjD,gBAAyBqG,CAAoB,CAC7D,CACF,CA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,OAAOG,IAAS,SAAU,OAAO,OAAO,SAASA,CAAI,EAAIA,EAAO,IAAA,GACpE,GAAI,OAAOA,IAAS,UAAYA,EAAK,KAAK,IAAM,GAAI,OAAO,IAAA,GAC3D,MAAMC,EAAI,OAAOD,CAAI,EACrB,OAAO,OAAO,SAASC,CAAC,EAAIA,EAAI,IAAA,EAClC,EAEA,MAAaC,GAA2D,iBAAyB,CAI/F,YAA2B,gBAAO,QAAQ,YAAc,GAAYC,CAAO,EAC3E,QAAU,GAAUC,EAAM,WAC1B,QAAU,IAAW,CACnB,cAAe,GAAGA,EAAM,UAAU,GAAGb,GAAS,MAAMa,EAAM,KAAK,GACjE,GACA,cACA,cAAe,CAAE,OAAM,UAAS,UAC9B,IAAI,oBAAoB,CACtB,KAAM,YAAYJ,CAAI,EACtB,UACA,OAAQ,aAAaH,CAAI,EACzB,MACF,CAAC,EACH,YAAa,CAAE,OAAM,WAAY,IAAI,kBAAkB,CAAE,OAAM,OAAM,CAAC,CACxE,CAAC,ECtED,IAAa,MAAb,eAAyC,gBAAQ,QAAuB,CAAC,CAAC,cAAc,EAAA,AAAE,CAAC,EAG3F,MAAa,OAOR,GAAwCR,EAAO,QAAQC,EAAM,QAAQ,MAAOe,CAAgB,CAAC,EAGlG,MAAaC,GAE+C,gBAAO,QACnD,gBAAM,QAAQ,MAAO,CAAE,UAAa,KAAM,CAAC,CAC3D,EAOA,MAAaC,GAAuB9G,EAEpC,MAAa+G,GAAW9G,GACxB,MAAa+G,GAAS9G,GAGtB,MAAa+G,GAA6B9G,EAG1C,MAAa+G,GAE+C,qBAAO9G,CAAyB,EAG5F,MAAa+G,GAA4B9G,EAGzC,MAAa+G,GAE+C,qBAAO9G,CAAwB"}
1
+ {"version":3,"file":"sdk.js","names":["EffectConfig.Redacted","Schema.Number","Schema.String","Schema.Unknown","Category.withServerError","Category.withParseError","Retries.makeDefault","Retries.jittered","Retries.capped","Retries.throttlingOptions","Retries.throttlingFactory","Retries.transientOptions","Retries.transientFactory","D","call","error","named","newError","op","withBadRequestError","withParseError","withServerError","Redacted$3","String$2","all$1","orElse","withDefault","capped$1","jittered$1","makeDefault$1","throttlingFactory","throttlingOptions$1","transientFactory","transientOptions$1","Number$2","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","NullOr","Number$1","Record","String","Struct","TaggedError","Unknown","at","optional","suspend","Context","Effect","Layer","Redacted","DEFAULT_API_BASE_URL","envConfig","CredentialsFromEnv","tokenType","config","body","b","message","code","n","DiscordProtocol","resolve","creds","optionsOrFactory","none","makeDefault","jittered","capped","throttlingOptions","throttling","transientOptions","transient"],"sources":["../../src/credentials.ts","../../src/errors.ts","../../src/protocol.ts","../../src/retry.ts"],"mappings":"m0EA0BA,MAAaqG,EAAuB,8BAWpC,IAAa,YAAb,eACwB,gBAAQ,QAAyD,CAAC,CACtF,oBACF,EAAA,AAAE,CAAC,EAEL,MAAMC,GAA0B,iBAAiB,CAG/C,MAAqB,gBAAsB,mBAAmB,CAAC,CAAC,KAChD,qBAA0BtG,EAAsB,eAAe,CAAC,CAChF,EACA,UAAyB,gBAAoB,oBAAoB,CAAC,CAAC,KACnD,gBAAyB,KAAK,CAC9C,EACA,WAA0B,gBAAoB,iBAAiB,CAAC,CAAC,KACjD,gBAAyBqG,CAAoB,CAC7D,CACF,CAAC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AAOG,IAAS,SAAU,OAAO,OAAO,SAASA,CAAI,EAAIA,EAAO,IAAA,GACpE,GAAI,OAAOA,IAAS,UAAYA,EAAK,KAAK,IAAM,GAAI,OAAO,IAAA,GAC3D,MAAMC,EAAI,OAAOD,CAAI,EACrB,OAAO,OAAO,SAASC,CAAC,EAAIA,EAAI,IAAA,EAClC,EAEA,MAAaC,GAA2D,iBAAyB,CAI/F,YAA2B,gBAAO,QAAQ,YAAc,GAAYC,CAAO,EAC3E,QAAU,GAAUC,EAAM,WAC1B,QAAU,IAAW,CACnB,cAAe,GAAGA,EAAM,UAAU,GAAGb,GAAS,MAAMa,EAAM,KAAK,GACjE,GACA,cACA,cAAe,CAAE,OAAM,UAAS,UAC9B,IAAI,oBAAoB,CACtB,KAAM,YAAYJ,CAAI,EACtB,UACA,OAAQ,aAAaH,CAAI,EACzB,MACF,CAAC,EACH,YAAa,CAAE,OAAM,WAAY,IAAI,kBAAkB,CAAE,OAAM,OAAM,CAAC,CACxE,CAAC,ECxED,IAAa,MAAb,eAAyC,gBAAQ,QAAuB,CAAC,CAAC,cAAc,EAAA,AAAE,CAAC,EAG3F,MAAa,OAOR,GAAwCR,EAAO,QAAQC,EAAM,QAAQ,MAAOe,CAAgB,CAAC,EAGlG,MAAaC,GAE+C,gBAAO,QACnD,gBAAM,QAAQ,MAAO,CAAE,UAAa,KAAM,CAAC,CAC3D,EAOA,MAAaC,GAAuB9G,EAEpC,MAAa+G,GAAW9G,GACxB,MAAa+G,GAAS9G,GAGtB,MAAa+G,GAA6B9G,EAG1C,MAAa+G,GAE+C,qBAAO9G,CAAyB,EAG5F,MAAa+G,GAA4B9G,EAGzC,MAAa+G,GAE+C,qBAAO9G,CAAwB"}
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 { 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
  * DiscordOpError, DiscordOpContext>` explicitly so the compiler never infers
12
13
  * these back out of the schema generics.
13
14
  */
14
- export type DiscordOpError = DefaultErrors | ConfigError | HttpClientError.HttpClientError | InvalidInput;
15
+ export type DiscordOpError = DefaultErrors | ConfigError | HttpClientError.HttpClientError | InvalidInput | SdkError;
15
16
  /** Context (requirements) shared by every generated Discord operation. */
16
17
  export type DiscordOpContext = Credentials | HttpClient.HttpClient;
17
18
  export declare const DiscordProtocol: 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,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAiB9E,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,EAAuB,KAAK,aAAa,EAAqB,MAAM,aAAa,CAAC;AAEzF;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GACtB,aAAa,GACb,WAAW,GACX,eAAe,CAAC,eAAe,GAC/B,YAAY,CAAC;AAEjB,0EAA0E;AAC1E,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,UAAU,CAAC,UAAU,CAAC;AAyCnE,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAkBpD,CAAC"}
1
+ {"version":3,"file":"protocol.d.ts","sourceRoot":"","sources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