@distilled.cloud/resend 1.0.0-rc.18 → 1.0.0-rc.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/_bundle/sdk.js +1 -1
- package/lib/_bundle/sdk.js.map +1 -1
- package/lib/errors.d.ts +5 -8
- package/lib/errors.d.ts.map +1 -1
- package/lib/protocol.d.ts +2 -1
- package/lib/protocol.d.ts.map +1 -1
- package/lib/services/resend.d.ts +598 -598
- package/lib/services/resend.d.ts.map +1 -1
- package/lib/services/resend.js +99 -99
- package/lib/services/resend.js.map +1 -1
- package/package.json +5 -5
- package/src/errors.ts +5 -5
- package/src/pagination.ts +1 -1
- package/src/protocol.ts +5 -8
- package/src/services/resend.ts +600 -598
package/lib/_bundle/sdk.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{errors$API_ERRORS as e,errors$BadGateway as t,errors$BadRequest as n,errors$ConfigError as r,errors$Conflict as i,errors$DEFAULT_ERRORS as 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
|
|
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$UnknownErrorFields as ee,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 h,protocol_rest$rawResponseSymbol as g,protocol_rest$sensitiveValueSymbol as _,protocol_rest$unknownErrorProps as v,schema_lite$Array as y,schema_lite$Boolean as b,schema_lite$NullOr as x,schema_lite$Number as S,schema_lite$Record as C,schema_lite$String as w,schema_lite$Struct as T,schema_lite$Unknown as E,schema_lite$at as D,schema_lite$optional as O,schema_lite$suspend as k}from"@distilled.cloud/core/_bundle/rest";import{api$D as A,api$call as j,api$named as M,api$op as N,api$opPaginated as P,category$withParseError as F,pagination$getItems as I,pagination$getPath as L,pagination$missingPaginationConfig as R,retry$capped as z,retry$jittered as B,retry$makeDefault as V,retry$throttlingFactory as H,retry$throttlingOptions as U,retry$transientFactory as W,retry$transientOptions as G,schema_lite_typed$TaggedError as K,schema_lite_typed$Unknown as q,trait$Body as J,trait$FormDataFile as oe,trait$Header as se,trait$Http as ce,trait$HttpBody as le,trait$KeyDictionary as ue,trait$Label as de,trait$Query as fe,trait$ResponseCode as pe,trait$UnionCases as me,trait$applyErrorMatchers as he,trait$bodySymbol as ge,trait$errorMatchersSymbol as _e,trait$formDataFileSymbol as ve,trait$getErrorMatchers as ye,trait$headerSymbol as be,trait$httpBodySymbol as xe,trait$httpSymbol as Se,trait$keyDictionarySymbol as Ce,trait$labelSymbol as we,trait$querySymbol as Te,trait$responseCodeSymbol as Ee,trait$unionCasesSymbol as De}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 Oe from"effect/Stream";const ke=`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 Ae=/*@__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`,ee)){};var ResendParseError=class extends (/*@__PURE__*/ K()(`ResendParseError`,{body:q,cause:q}).pipe(F)){};const paginateResend=(e,t,n)=>{const r=n.inputToken;if(!r)return R(`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 Oe.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=I(o,a).at(-1);const c=typeof s?.id===`string`?s.id:void 0;const l=L(o,i)===true;const u=n.cursor!==void 0&&c===n.cursor;return[o,{cursor:c,done:!l||c===void 0||u}]}))};const $=/*@__PURE__*/ ae({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:e=>new UnknownResendError(v(e)),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 je=/*@__PURE__*/ X.provide(/*@__PURE__*/ Z.succeed(Retry,{while:()=>false}));const Me=/*@__PURE__*/ policy(H);const Ne=/*@__PURE__*/ policy(W);export{O as Cc,k as Dc,A as a,j as c,Credentials as credentials$Credentials,Ae as credentials$CredentialsFromEnv,ke as credentials$DEFAULT_API_BASE_URL,fromApiKey as credentials$fromApiKey,y as dc,b as ec,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,te as errors$UnprocessableEntity,M as k,x as lc,N as m,S as mc,P as n,C as nc,paginateResend as pagination$paginateResend,w as pc,$ as protocol$ResendProtocol,T as qc,Retry as retry$Retry,z as retry$capped,B as retry$jittered,V as retry$makeDefault,je as retry$none,policy as retry$policy,Me as retry$throttling,H as retry$throttlingFactory,U as retry$throttlingOptions,Ne as retry$transient,W as retry$transientFactory,G as retry$transientOptions,J as traits$Body,oe as traits$FormDataFile,se as traits$Header,ce as traits$Http,le as traits$HttpBody,ue as traits$KeyDictionary,de as traits$Label,fe as traits$Query,ne as traits$RawResponse,re as traits$RawResponseRoot,pe as traits$ResponseCode,ie as traits$SensitiveValue,me as traits$UnionCases,he as traits$applyErrorMatchers,ge as traits$bodySymbol,_e as traits$errorMatchersSymbol,ve as traits$formDataFileSymbol,ye as traits$getErrorMatchers,be as traits$headerSymbol,xe as traits$httpBodySymbol,Se as traits$httpSymbol,Ce as traits$keyDictionarySymbol,we as traits$labelSymbol,Te as traits$querySymbol,h as traits$rawResponseRootSymbol,g as traits$rawResponseSymbol,Ee as traits$responseCodeSymbol,_ as traits$sensitiveValueSymbol,De as traits$unionCasesSymbol,E as vc,D as xc};
|
|
2
2
|
//# sourceMappingURL=sdk.js.map
|
package/lib/_bundle/sdk.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.js","names":["Schema.
|
|
1
|
+
{"version":3,"file":"sdk.js","names":["Schema.Unknown","Category.withParseError","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","UnknownErrorFields","UnprocessableEntity","RawResponse","RawResponseRoot","SensitiveValue","makeRestProtocol","rawResponseRootSymbol","rawResponseSymbol","sensitiveValueSymbol","unknownErrorProps","Array","Boolean","NullOr","Number","Record","String","Struct","Unknown","at","optional","suspend","D","call","named","op","opPaginated","withParseError","getItems","getPath","missingPaginationConfig","capped","jittered","makeDefault","throttlingFactory","throttlingOptions","transientFactory","transientOptions","TaggedError$1","Unknown$1","Body","FormDataFile","Header","Http","HttpBody","KeyDictionary","Label","Query","ResponseCode","UnionCases","applyErrorMatchers","bodySymbol","errorMatchersSymbol","formDataFileSymbol","getErrorMatchers","headerSymbol","httpBodySymbol","httpSymbol","keyDictionarySymbol","labelSymbol","querySymbol","responseCodeSymbol","unionCasesSymbol","Context","Effect","Layer","Redacted","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","info","optionsOrFactory","none","throttling","transient"],"sources":["../../src/credentials.ts","../../src/errors.ts","../../src/pagination.ts","../../src/protocol.ts","../../src/retry.ts"],"mappings":"ktEAaA,MAAauF,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,GAA6D,gBAAM,QAC9E,YACc,gBAAO,IAAI,WAAa,CACpC,MAAMC,EAAS,QAAQ,IAAI,eAE3B,GAAI,CAACA,EACH,OAAO,MAAO,IAAIlF,EAAY,CAC5B,QAAS,iDACX,CAAC,EAGH,MAAO,CACL,OAAQ6E,EAAS,KAAKK,CAAM,EAC5B,WAAY,QAAQ,IAAI,qBAAA,wBAC1B,CACF,CAAC,CACH,ECrBA,IAAa,mBAAb,eACwB,gBAAuC,CAAC,CAC5D,qBACAtE,EACF,EAAA,A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,OAAOA,IAAS,SAAU,OAAO,IAAA,GACtD,MAAMC,EAAMD,EACZ,MAAME,EACJ,OAAOD,EAAI,OAAS,SAAWA,EAAI,KAAO,OAAOA,EAAI,OAAS,SAAWA,EAAI,KAAO,IAAA,GACtF,MAAME,EAAU,OAAOF,EAAI,UAAY,SAAWA,EAAI,QAAU,IAAA,GAChE,GAAIC,IAAS,IAAA,IAAaC,IAAY,IAAA,GAAW,OAAO,IAAA,GACxD,MAAO,CAAE,OAAM,SAAQ,CACzB,EACA,aAAe,GAAS,IAAI,mBAAmBjF,EAAkBkF,CAAI,CAAC,EACtE,YAAa,CAAE,OAAM,WAAY,IAAI,iBAAiB,CAAE,OAAM,OAAM,CAAC,CACvE,CAAC,EClCD,IAAa,MAAb,eAAyC,gBAAQ,QAAuB,CAAC,CAAC,aAAa,EAAA,AAAE,CAAC,EAG1F,MAAa,OAAU,GACrB5B,EAAO,QAAQC,EAAM,QAAQ,MAAO4B,CAAgB,CAAC,EAGvD,MAAaC,GAAqB,gBAAO,QACzB,gBAAM,QAAQ,MAAO,CAAE,UAAa,KAAM,CAAC,CAC3D,EAGA,MAAaC,GAA2B,qBAAO7D,CAAiB,EAGhE,MAAa8D,GAA0B,qBAAO5D,CAAgB"}
|
package/lib/errors.d.ts
CHANGED
|
@@ -11,14 +11,11 @@ export { BadGateway, BadRequest, Conflict, ConfigError, Forbidden, GatewayTimeou
|
|
|
11
11
|
export type { DefaultErrors } from "@distilled.cloud/core/errors";
|
|
12
12
|
import * as Schema from "@distilled.cloud/core/schema-lite-typed";
|
|
13
13
|
declare const UnknownResendError_base: Schema.TaggedErrorClass<"UnknownResendError", {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
ServerError: true;
|
|
20
|
-
};
|
|
21
|
-
});
|
|
14
|
+
status: import("effect/Schema").Number;
|
|
15
|
+
code: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
16
|
+
message: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
17
|
+
body: import("effect/Schema").Unknown;
|
|
18
|
+
}>;
|
|
22
19
|
/** Unknown Resend error -- returned when nothing else matches the failure. */
|
|
23
20
|
export declare class UnknownResendError extends /*@__PURE__*/ UnknownResendError_base {
|
|
24
21
|
}
|
package/lib/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EACL,UAAU,EACV,UAAU,EACV,QAAQ,EACR,WAAW,EACX,SAAS,EACT,cAAc,EACd,mBAAmB,EACnB,MAAM,EACN,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,UAAU,GACX,MAAM,8BAA8B,CAAC;AACtC,YAAY,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EACL,UAAU,EACV,UAAU,EACV,QAAQ,EACR,WAAW,EACX,SAAS,EACT,cAAc,EACd,mBAAmB,EACnB,MAAM,EACN,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,UAAU,GACX,MAAM,8BAA8B,CAAC;AACtC,YAAY,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAIlE,OAAO,KAAK,MAAM,MAAM,yCAAyC,CAAC;;;;;;;AAElE,8EAA8E;AAC9E,qBAAa,kBACX,SAAQ,aAAa,CAAC,uBAGrB;CAAG;;;;;;;;;AAEN,kCAAkC;AAClC,qBAAa,gBACX,SAAQ,aAAa,CAAC,qBAGU;CAAG"}
|
package/lib/protocol.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type * as API from "@distilled.cloud/core/api";
|
|
2
2
|
import type { API_ERRORS, ConfigError, InvalidInput } from "@distilled.cloud/core/errors";
|
|
3
|
+
import type { SdkError } from "@distilled.cloud/core/sdk-error";
|
|
3
4
|
import type * as HttpClient from "effect/http/HttpClient";
|
|
4
5
|
import type * as HttpClientError from "effect/http/HttpClientError";
|
|
5
6
|
import type * as Layer from "effect/Layer";
|
|
@@ -11,7 +12,7 @@ import { 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 | InvalidInput;
|
|
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>;
|
package/lib/protocol.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,GAAG,MAAM,2BAA2B,CAAC;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,GAAG,MAAM,2BAA2B,CAAC;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE1F,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAkBhE,OAAO,KAAK,KAAK,UAAU,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,KAAK,eAAe,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAC;AAE3C,OAAO,EAAE,WAAW,EAAe,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,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,GAChB,YAAY,GACZ,QAAQ,CAAC;AAEb,yEAAyE;AACzE,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG,UAAU,CAAC,UAAU,CAAC;AAElE,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAsBnD,CAAC"}
|