@distilled.cloud/resend 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{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 l,errors$Locked as u,errors$NotFound as ee,errors$ServiceUnavailable as d,errors$TooManyRequests as f,errors$Unauthorized as p,errors$UnprocessableEntity as te,protocol_rest$RawResponse as ne,protocol_rest$RawResponseRoot as re,protocol_rest$SensitiveValue as ie,protocol_rest$makeRestProtocol as ae,protocol_rest$rawResponseRootSymbol as oe,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$Unknown as C,schema_lite$at as w,schema_lite$optional as T,schema_lite$suspend as E}from"@distilled.cloud/core/_bundle/rest";import{api$D as D,api$call as O,api$named as k,api$op as A,api$opPaginated as j,category$withParseError as M,category$withServerError as N,pagination$getItems as P,pagination$getPath as F,retry$capped as I,retry$jittered as L,retry$makeDefault as R,retry$throttlingFactory as z,retry$throttlingOptions as B,retry$transientFactory as V,retry$transientOptions as H,trait$Body as U,trait$FormDataFile as W,trait$Header as G,trait$Http as K,trait$HttpBody as q,trait$KeyDictionary as se,trait$Label as ce,trait$Query as le,trait$ResponseCode as ue,trait$UnionCases as de,trait$applyErrorMatchers as fe,trait$bodySymbol as pe,trait$errorMatchersSymbol as me,trait$formDataFileSymbol as he,trait$getErrorMatchers as ge,trait$headerSymbol as _e,trait$httpBodySymbol as ve,trait$httpSymbol as ye,trait$keyDictionarySymbol as be,trait$labelSymbol as xe,trait$querySymbol as Se,trait$responseCodeSymbol as Ce,trait$unionCasesSymbol as we}from"@distilled.cloud/core/_bundle/base";import*as J from"effect/Context";import*as Y from"effect/Effect";import*as X from"effect/Layer";import*as Z from"effect/Redacted";import*as Q from"@distilled.cloud/core/schema-lite-typed";import*as $ from"effect/Stream";const Te=`https://api.resend.com`;var Credentials=class extends (/*@__PURE__*/ J.Service()(`ResendCredentials`)){};const fromApiKey=e=>X.succeed(Credentials,Y.succeed({apiKey:e.apiKey,apiBaseUrl:e.apiBaseUrl??`https://api.resend.com`}));const Ee=/*@__PURE__*/ X.succeed(Credentials,/*@__PURE__*/ Y.gen(function*(){const e=process.env.RESEND_API_KEY;if(!e)return yield*new r({message:`RESEND_API_KEY environment variable is required`});return{apiKey:Z.make(e),apiBaseUrl:process.env.RESEND_API_BASE_URL??`https://api.resend.com`}}).pipe(Y.orDie));var UnknownResendError=class extends (/*@__PURE__*/ Q.TaggedError()(`UnknownResendError`,{code:/*@__PURE__*/ Q.optional(Q.String),message:/*@__PURE__*/ Q.optional(Q.String),body:Q.Unknown}).pipe(N)){};var ResendParseError=class extends (/*@__PURE__*/ Q.TaggedError()(`ResendParseError`,{body:Q.Unknown,cause:Q.Unknown}).pipe(M)){};const paginateResend=(e,t,n)=>{const r=n.inputToken;if(!r)return $.die(/* @__PURE__ */ new Error(`Resend cursor pagination requires inputToken`));const i=n.hasNextPage??`has_more`;const a=n.items??`data`;const o=typeof t[r]===`string`?t[r]:void 0;return $.unfold({cursor:o,done:false},n=>Y.gen(function*(){if(n.done)return void 0;const o=yield*e({...t,...n.cursor?{[r]:n.cursor}:{}});const s=P(o,a).at(-1);const c=typeof s?.id===`string`?s.id:void 0;const l=F(o,i)===true;const u=n.cursor!==void 0&&c===n.cursor;return[o,{cursor:c,done:!l||c===void 0||u}]}))};const De=/*@__PURE__*/ ae({credentials:/*@__PURE__*/ Y.flatMap(Credentials,e=>e),baseUrl:e=>e.apiBaseUrl,headers:e=>({Authorization:`Bearer ${Z.value(e.apiKey)}`}),errorEnvelope:e=>{if(e===null||typeof e!==`object`)return void 0;const t=e;const n=typeof t.name===`string`?t.name:typeof t.code===`string`?t.code:void 0;const r=typeof t.message===`string`?t.message:void 0;if(n===void 0&&r===void 0)return void 0;return{code:n,message:r}},unknownError:({code:e,message:t,body:n})=>new UnknownResendError({code:typeof e===`string`?e:e!==void 0?String(e):void 0,message:t,body:n}),parseError:({body:e,cause:t})=>new ResendParseError({body:e,cause:t})});var Retry=class extends (/*@__PURE__*/ J.Service()(`ResendRetry`)){};const policy=e=>Y.provide(X.succeed(Retry,e));const Oe=/*@__PURE__*/ Y.provide(/*@__PURE__*/ X.succeed(Retry,{while:()=>false}));const ke=/*@__PURE__*/ policy(z);const Ae=/*@__PURE__*/ policy(V);export{b as a,C as c,Credentials as credentials$Credentials,Ee as credentials$CredentialsFromEnv,Te as credentials$DEFAULT_API_BASE_URL,fromApiKey as credentials$fromApiKey,E as d,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,l as errors$InternalServerError,u as errors$Locked,ee as errors$NotFound,ResendParseError as errors$ResendParseError,d as errors$ServiceUnavailable,f as errors$TooManyRequests,p as errors$Unauthorized,UnknownResendError as errors$UnknownResendError,te as errors$UnprocessableEntity,D as f,j as g,A as h,y as i,w as l,k as m,_ as n,x as o,O as p,paginateResend as pagination$paginateResend,De as protocol$ResendProtocol,v as r,Retry as retry$Retry,I as retry$capped,L as retry$jittered,R as retry$makeDefault,Oe as retry$none,policy as retry$policy,ke as retry$throttling,z as retry$throttlingFactory,B as retry$throttlingOptions,Ae as retry$transient,V as retry$transientFactory,H as retry$transientOptions,S as s,g as t,U as traits$Body,W as traits$FormDataFile,G as traits$Header,K as traits$Http,q as traits$HttpBody,se as traits$KeyDictionary,ce as traits$Label,le as traits$Query,ne as traits$RawResponse,re as traits$RawResponseRoot,ue as traits$ResponseCode,ie as traits$SensitiveValue,de as traits$UnionCases,fe as traits$applyErrorMatchers,pe as traits$bodySymbol,me as traits$errorMatchersSymbol,he as traits$formDataFileSymbol,ge as traits$getErrorMatchers,_e as traits$headerSymbol,ve as traits$httpBodySymbol,ye as traits$httpSymbol,be as traits$keyDictionarySymbol,xe as traits$labelSymbol,Se as traits$querySymbol,oe as traits$rawResponseRootSymbol,m as traits$rawResponseSymbol,Ce as traits$responseCodeSymbol,h as traits$sensitiveValueSymbol,we as traits$unionCasesSymbol,T as u};
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 l,errors$Locked as u,errors$NotFound as d,errors$ServiceUnavailable as f,errors$TooManyRequests as p,errors$Unauthorized as m,errors$UnprocessableEntity as h,protocol_rest$RawResponse as g,protocol_rest$RawResponseRoot as ee,protocol_rest$SensitiveValue as te,protocol_rest$makeRestProtocol as ne,protocol_rest$rawResponseRootSymbol as re,protocol_rest$rawResponseSymbol as ie,protocol_rest$sensitiveValueSymbol as ae,schema_lite$Array as _,schema_lite$Boolean as v,schema_lite$NullOr as y,schema_lite$Number as b,schema_lite$Record as x,schema_lite$String as S,schema_lite$Struct 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$named as A,api$op as j,api$opPaginated as M,category$withParseError as N,category$withServerError as P,pagination$getItems as F,pagination$getPath as I,pagination$missingPaginationConfig as L,retry$capped as R,retry$jittered as z,retry$makeDefault as B,retry$throttlingFactory as V,retry$throttlingOptions as H,retry$transientFactory as U,retry$transientOptions as W,schema_lite_typed$String as G,schema_lite_typed$TaggedError as K,schema_lite_typed$Unknown as q,schema_lite_typed$optional as J,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 Y from"effect/Context";import*as X from"effect/Effect";import*as Z from"effect/Layer";import*as Q from"effect/Redacted";import*as ke from"effect/Stream";const Ae=`https://api.resend.com`;var Credentials=class extends (/*@__PURE__*/ Y.Service()(`ResendCredentials`)){};const fromApiKey=e=>Z.succeed(Credentials,X.succeed({apiKey:e.apiKey,apiBaseUrl:e.apiBaseUrl??`https://api.resend.com`}));const $=/*@__PURE__*/ Z.succeed(Credentials,/*@__PURE__*/ X.gen(function*(){const e=process.env.RESEND_API_KEY;if(!e)return yield*new r({message:`RESEND_API_KEY environment variable is required`});return{apiKey:Q.make(e),apiBaseUrl:process.env.RESEND_API_BASE_URL??`https://api.resend.com`}}));var UnknownResendError=class extends (/*@__PURE__*/ K()(`UnknownResendError`,{code:/*@__PURE__*/ J(G),message:/*@__PURE__*/ J(G),body:q}).pipe(P)){};var ResendParseError=class extends (/*@__PURE__*/ K()(`ResendParseError`,{body:q,cause:q}).pipe(N)){};const paginateResend=(e,t,n)=>{const r=n.inputToken;if(!r)return L(`Resend cursor pagination requires inputToken`);const i=n.hasNextPage??`has_more`;const a=n.items??`data`;const o=typeof t[r]===`string`?t[r]:void 0;return ke.unfold({cursor:o,done:false},n=>X.gen(function*(){if(n.done)return void 0;const o=yield*e({...t,...n.cursor?{[r]:n.cursor}:{}});const s=F(o,a).at(-1);const c=typeof s?.id===`string`?s.id:void 0;const l=I(o,i)===true;const u=n.cursor!==void 0&&c===n.cursor;return[o,{cursor:c,done:!l||c===void 0||u}]}))};const je=/*@__PURE__*/ ne({credentials:/*@__PURE__*/ X.flatMap(Credentials,e=>e),baseUrl:e=>e.apiBaseUrl,headers:e=>({Authorization:`Bearer ${Q.value(e.apiKey)}`}),errorEnvelope:e=>{if(e===null||typeof e!==`object`)return void 0;const t=e;const n=typeof t.name===`string`?t.name:typeof t.code===`string`?t.code:void 0;const r=typeof t.message===`string`?t.message:void 0;if(n===void 0&&r===void 0)return void 0;return{code:n,message:r}},unknownError:({code:e,message:t,body:n})=>new UnknownResendError({code:typeof e===`string`?e:e!==void 0?String(e):void 0,message:t,body:n}),parseError:({body:e,cause:t})=>new ResendParseError({body:e,cause:t})});var Retry=class extends (/*@__PURE__*/ Y.Service()(`ResendRetry`)){};const policy=e=>X.provide(Z.succeed(Retry,e));const Me=/*@__PURE__*/ X.provide(/*@__PURE__*/ Z.succeed(Retry,{while:()=>false}));const Ne=/*@__PURE__*/ policy(V);const Pe=/*@__PURE__*/ policy(U);export{E as Ac,D as Bc,O as a,_ as bc,k as c,v as cc,Credentials as credentials$Credentials,$ 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,o as errors$Forbidden,s as errors$GatewayTimeout,c as errors$HTTP_STATUS_MAP,l as errors$InternalServerError,u as errors$Locked,d as errors$NotFound,ResendParseError as errors$ResendParseError,f as errors$ServiceUnavailable,p as errors$TooManyRequests,m as errors$Unauthorized,UnknownResendError as errors$UnknownResendError,h as errors$UnprocessableEntity,y as jc,A as k,b as kc,x as lc,j as m,M as n,S as nc,C as oc,paginateResend as pagination$paginateResend,je as protocol$ResendProtocol,Retry as retry$Retry,R as retry$capped,z as retry$jittered,B as retry$makeDefault,Me as retry$none,policy as retry$policy,Ne as retry$throttling,V as retry$throttlingFactory,H as retry$throttlingOptions,Pe as retry$transient,U as retry$transientFactory,W as retry$transientOptions,w as tc,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,g as traits$RawResponse,ee as traits$RawResponseRoot,me as traits$ResponseCode,te 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,re as traits$rawResponseRootSymbol,ie as traits$rawResponseSymbol,De as traits$responseCodeSymbol,ae as traits$sensitiveValueSymbol,Oe as traits$unionCasesSymbol,T as vc};
2
2
  //# sourceMappingURL=sdk.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sdk.js","names":["Category.withServerError","Category.withParseError","Pagination.getItems","Pagination.getPath","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","Unknown","at","optional","suspend","call","named","op","opPaginated","withParseError","withServerError","getItems","getPath","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","Context","Effect","Layer","Redacted","Schema","Stream","DEFAULT_API_BASE_URL","config","CredentialsFromEnv","apiKey","inputToken","pagination","hasNextPath","itemsPath","startCursor","input","state","response","operation","last","nextCursor","hasNext","stuckCursor","ResendProtocol","resolve","creds","body","rec","code","message","optionsOrFactory","none","throttling","transient"],"sources":["../../src/credentials.ts","../../src/errors.ts","../../src/pagination.ts","../../src/protocol.ts","../../src/retry.ts"],"mappings":"wnEAaA,MAAakF,GAAuB,yBAOpC,IAAa,YAAb,eACwB,gBAAQ,QAA4C,CAAC,CACzE,mBACF,EAAA,AAAE,CAAC,EAGL,MAAa,WAAc,GAIzBJ,EAAM,QACJ,YACAD,EAAO,QAAQ,CACb,OAAQM,EAAO,OACf,WAAYA,EAAO,YAAA,wBACrB,CAAC,CACH,EAGF,MAAaC,GAA6D,gBAAM,QAC9E,YACc,gBAAO,IAAI,WAAa,CACpC,MAAMC,EAAS,QAAQ,IAAI,eAE3B,GAAI,CAACA,EACH,OAAO,MAAO,IAAI9E,EAAY,CAC5B,QAAS,iDACX,CAAC,EAGH,MAAO,CACL,OAAQwE,EAAS,KAAKM,CAAM,EAC5B,WAAY,QAAQ,IAAI,qBAAA,wBAC1B,CACF,CAAC,CAAC,CAAC,KAAKR,EAAO,KAAK,CACtB,ECtBA,IAAa,mBAAb,eACwB,gBAAO,YAAgC,CAAC,CAAC,qBAAsB,CACnF,KAAoB,gBAAO,SAASG,EAAO,MAAM,EACjD,QAAuB,gBAAO,SAASA,EAAO,MAAM,EACpD,KAAMA,EAAO,OACf,CAAC,CAAC,CAAC,KAAKhF,CAAwB,EAAA,AAAE,CAAC,EAGrC,IAAa,iBAAb,eACwB,gBAAO,YAA8B,CAAC,CAAC,mBAAoB,CAC/E,KAAMgF,EAAO,QACb,MAAOA,EAAO,OAChB,CAAC,CAAC,CAAC,KAAK/E,CAAuB,EAAA,AAAE,CAAC,EC3BpC,MAAa,gBAAiD,EAAW,EAAO,IAAe,CAC7F,MAAMqF,EAAaC,EAAW,WAC9B,GAAI,CAACD,EACH,OAAOL,EAAO,oBAAI,IAA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AAaC,IAAY,IAAA,GAAW,OAAO,IAAA,GACxD,MAAO,CAAE,OAAM,SAAQ,CACzB,EACA,cAAe,CAAE,OAAM,UAAS,UAC9B,IAAI,mBAAmB,CACrB,KAAM,OAAOD,IAAS,SAAWA,EAAOA,IAAS,IAAA,GAAY,OAAOA,CAAI,EAAI,IAAA,GAC5E,UACA,MACF,CAAC,EACH,YAAa,CAAE,OAAM,WAAY,IAAI,iBAAiB,CAAE,OAAM,OAAM,CAAC,CACvE,CAAC,ECpCD,IAAa,MAAb,eAAyC,gBAAQ,QAAuB,CAAC,CAAC,aAAa,EAAA,AAAE,CAAC,EAG1F,MAAa,OAAU,GACrB3B,EAAO,QAAQC,EAAM,QAAQ,MAAO4B,CAAgB,CAAC,EAGvD,MAAaC,GAAqB,gBAAO,QACzB,gBAAM,QAAQ,MAAO,CAAE,UAAa,KAAM,CAAC,CAC3D,EAGA,MAAaC,GAA2B,qBAAO3D,CAAiB,EAGhE,MAAa4D,GAA0B,qBAAO1D,CAAgB"}
1
+ {"version":3,"file":"sdk.js","names":["Schema.String","Schema.Unknown","Category.withServerError","Category.withParseError","Pagination.missingPaginationConfig","Pagination.getItems","Pagination.getPath","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","Unknown","at","optional","suspend","D","call","named","op","opPaginated","withParseError","withServerError","getItems","getPath","missingPaginationConfig","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","Stream","DEFAULT_API_BASE_URL","config","CredentialsFromEnv","apiKey","inputToken","pagination","hasNextPath","itemsPath","startCursor","input","state","response","operation","last","nextCursor","hasNext","stuckCursor","ResendProtocol","resolve","creds","body","rec","code","message","optionsOrFactory","none","throttling","transient"],"sources":["../../src/credentials.ts","../../src/errors.ts","../../src/pagination.ts","../../src/protocol.ts","../../src/retry.ts"],"mappings":"2uEAaA,MAAa0F,GAAuB,yBAOpC,IAAa,YAAb,eACwB,gBAAQ,QAAyD,CAAC,CACtF,mBACF,EAAA,AAAE,CAAC,EAGL,MAAa,WAAc,GAIzBH,EAAM,QACJ,YACAD,EAAO,QAAQ,CACb,OAAQK,EAAO,OACf,WAAYA,EAAO,YAAA,wBACrB,CAAC,CACH,EAGF,MAAaC,EAA6D,gBAAM,QAC9E,YACc,gBAAO,IAAI,WAAa,CACpC,MAAMC,EAAS,QAAQ,IAAI,eAE3B,GAAI,CAACA,EACH,OAAO,MAAO,IAAInF,EAAY,CAC5B,QAAS,iDACX,CAAC,EAGH,MAAO,CACL,OAAQ8E,EAAS,KAAKK,CAAM,EAC5B,WAAY,QAAQ,IAAI,qBAAA,wBAC1B,CACF,CAAC,CACH,ECtBA,IAAa,mBAAb,eACwB,gBAAuC,CAAC,CAAC,qBAAsB,CACnF,KAAoB,gBAAgB7F,CAAa,EACjD,QAAuB,gBAAgBA,CAAa,EACpD,KAAMC,CACR,CAAC,CAAC,CAAC,KAAKC,CAAwB,EAAA,AAAE,CAAC,EAGrC,IAAa,iBAAb,eACwB,gBAAqC,CAAC,CAAC,mBAAoB,CAC/E,KAAMD,EACN,MAAOA,CACT,CAAC,CAAC,CAAC,KAAKE,CAAuB,EAAA,AAAE,CAAC,EC3BpC,MAAa,gBAAiD,EAAW,EAAO,IAAe,CAC7F,MAAM2F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I,QAAU,IAAA,GAChE,GAAIC,IAAS,IAAA,IAAaC,IAAY,IAAA,GAAW,OAAO,IAAA,GACxD,MAAO,CAAE,OAAM,SAAQ,CACzB,EACA,cAAe,CAAE,OAAM,UAAS,UAC9B,IAAI,mBAAmB,CACrB,KAAM,OAAOD,IAAS,SAAWA,EAAOA,IAAS,IAAA,GAAY,OAAOA,CAAI,EAAI,IAAA,GAC5E,UACA,MACF,CAAC,EACH,YAAa,CAAE,OAAM,WAAY,IAAI,iBAAiB,CAAE,OAAM,OAAM,CAAC,CACvE,CAAC,ECvCD,IAAa,MAAb,eAAyC,gBAAQ,QAAuB,CAAC,CAAC,aAAa,EAAA,AAAE,CAAC,EAG1F,MAAa,OAAU,GACrB1B,EAAO,QAAQC,EAAM,QAAQ,MAAO2B,CAAgB,CAAC,EAGvD,MAAaC,GAAqB,gBAAO,QACzB,gBAAM,QAAQ,MAAO,CAAE,UAAa,KAAM,CAAC,CAC3D,EAGA,MAAaC,GAA2B,qBAAO9D,CAAiB,EAGhE,MAAa+D,GAA0B,qBAAO7D,CAAgB"}
@@ -1,3 +1,4 @@
1
+ import { ConfigError } from "@distilled.cloud/core/errors";
1
2
  /**
2
3
  * Resend credentials -- hand-written.
3
4
  *
@@ -14,7 +15,7 @@ export interface Config {
14
15
  readonly apiKey: Redacted.Redacted<string>;
15
16
  readonly apiBaseUrl: string;
16
17
  }
17
- declare const Credentials_base: Context.ServiceClass<Credentials, "ResendCredentials", Effect.Effect<Config, never, never>>;
18
+ declare const Credentials_base: Context.ServiceClass<Credentials, "ResendCredentials", Effect.Effect<Config, ConfigError, never>>;
18
19
  export declare class Credentials extends /*@__PURE__*/ Credentials_base {
19
20
  }
20
21
  /** Layer from a redacted API key + optional base URL. */
@@ -1 +1 @@
1
- {"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"AACA;;;;;;GAMG;AACH,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAA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AC,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,0EAA0E;AAC1E,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,CAgBvD,CAAC"}
package/lib/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * @distilled.cloud/resend -- Resend SDK for Effect.
3
3
  *
4
- * `./services` is generated by `scripts/generate.ts` from the Smithy model
5
- * in `.generated-specs` (written by `scripts/convert.ts` from the OpenAPI
6
- * spec). 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 OpenAPI spec. Everything else in this
6
+ * folder is hand-written.
7
7
  *
8
8
  * @example
9
9
  * ```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 { API_ERRORS, ConfigError } from "@distilled.cloud/core/errors";
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 { UnknownResendError, ResendParseError } from "./errors.ts";
11
12
  * ResendOpContext>` explicitly so the compiler never infers these back out of
12
13
  * the schema generics.
13
14
  */
14
- export type ResendOpError = InstanceType<(typeof API_ERRORS)[number]> | UnknownResendError | ConfigError | HttpClientError.HttpClientError | ResendParseError;
15
+ export type ResendOpError = InstanceType<(typeof API_ERRORS)[number]> | UnknownResendError | ConfigError | HttpClientError.HttpClientError | ResendParseError | InvalidInput | SdkError;
15
16
  /** Context (requirements) shared by every generated Resend operation. */
16
17
  export type ResendOpContext = Credentials | HttpClient.HttpClient;
17
18
  export declare const ResendProtocol: 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,UAAU,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAmB5E,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,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEnE;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GACrB,YAAY,CAAC,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC,GACzC,kBAAkB,GAClB,WAAW,GACX,eAAe,CAAC,eAAe,GAC/B,gBAAgB,CAAC;AAErB,yEAAyE;AACzE,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG,UAAU,CAAC,UAAU,CAAC;AAElE,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CA2BnD,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,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