@distilled.cloud/resend 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.
Files changed (48) hide show
  1. package/README.md +73 -3
  2. package/lib/_bundle/sdk.js +1 -1
  3. package/lib/_bundle/sdk.js.map +1 -1
  4. package/lib/credentials.d.ts +9 -4
  5. package/lib/credentials.d.ts.map +1 -1
  6. package/lib/errors.d.ts +161 -0
  7. package/lib/errors.d.ts.map +1 -1
  8. package/lib/errors.js +1 -1
  9. package/lib/index.d.ts +2 -2
  10. package/lib/index.d.ts.map +1 -1
  11. package/lib/index.js +1 -1
  12. package/lib/index.lazy.js +1 -1
  13. package/lib/index.lazy.js.map +1 -1
  14. package/lib/pagination.d.ts.map +1 -1
  15. package/lib/protocol.d.ts +11 -12
  16. package/lib/protocol.d.ts.map +1 -1
  17. package/lib/protocol.js +1 -1
  18. package/lib/retry.d.ts.map +1 -1
  19. package/lib/services/index.d.ts +1 -0
  20. package/lib/services/index.d.ts.map +1 -1
  21. package/lib/services/index.js +1 -0
  22. package/lib/services/resend.d.ts +3313 -579
  23. package/lib/services/resend.d.ts.map +1 -1
  24. package/lib/services/resend.js +226 -102
  25. package/lib/services/resend.js.map +1 -1
  26. package/lib/services/webhook_events.d.ts +1011 -0
  27. package/lib/services/webhook_events.d.ts.map +1 -0
  28. package/lib/services/webhook_events.js +1 -0
  29. package/lib/services.lazy/index.js +2 -2
  30. package/lib/services.lazy/resend.js +3 -2
  31. package/lib/services.lazy/webhook_events.js +1 -0
  32. package/lib/traits.d.ts +1 -1
  33. package/lib/traits.d.ts.map +1 -1
  34. package/lib/traits.js +1 -1
  35. package/lib/webhooks.d.ts +42 -0
  36. package/lib/webhooks.d.ts.map +1 -0
  37. package/lib/webhooks.js +2 -0
  38. package/lib/webhooks.js.map +1 -0
  39. package/package.json +5 -5
  40. package/src/credentials.ts +24 -16
  41. package/src/errors.ts +168 -1
  42. package/src/index.ts +5 -6
  43. package/src/protocol.ts +20 -24
  44. package/src/services/index.ts +1 -0
  45. package/src/services/resend.ts +7881 -1893
  46. package/src/services/webhook_events.ts +1069 -0
  47. package/src/traits.ts +3 -0
  48. package/src/webhooks.ts +245 -0
package/README.md CHANGED
@@ -16,14 +16,18 @@ import * as FetchHttpClient from "effect/http/FetchHttpClient";
16
16
  import * as Resend from "@distilled.cloud/resend";
17
17
 
18
18
  const program = Effect.gen(function* () {
19
- const result = yield* Resend.getEmails({});
20
- return result;
19
+ const { id } = yield* Resend.createEmail({
20
+ from: "Acme <onboarding@resend.dev>",
21
+ to: ["delivered@resend.dev"],
22
+ subject: "Hello",
23
+ text: "It works.",
24
+ });
25
+ return yield* Resend.getEmail({ email_id: id });
21
26
  });
22
27
 
23
28
  const Live = Layer.mergeAll(
24
29
  FetchHttpClient.layer,
25
30
  Resend.CredentialsFromEnv,
26
- Resend.ResendProtocol,
27
31
  );
28
32
 
29
33
  program.pipe(Effect.provide(Live), Effect.runPromise);
@@ -32,3 +36,69 @@ program.pipe(Effect.provide(Live), Effect.runPromise);
32
36
  ## Auth
33
37
 
34
38
  Required: `RESEND_API_KEY`. Optional: `RESEND_API_BASE_URL`.
39
+
40
+ ## Errors
41
+
42
+ Each operation fails with typed errors matched on Resend's error `name`: auth
43
+ errors (`RestrictedApiKey`, `InvalidApiKey`, ...), `ValidationError`, a
44
+ not-found per resource (`ContactNotFound`, `DomainNotFound`, ...),
45
+ `AlreadyExists`, and on the sending operations `UnverifiedSender`,
46
+ `TestingRecipientOnly`, `DailyQuotaExceeded` and `MonthlyQuotaExceeded`.
47
+ Refusals that depend on a resource's state have their own tags too, such as
48
+ `BroadcastNotDeletable` (a sent broadcast) and `CannotDeleteLastSegment`.
49
+
50
+ ```ts
51
+ Resend.getContact({ id }).pipe(
52
+ Effect.catchTag("ContactNotFound", () => Effect.succeed(undefined)),
53
+ );
54
+ ```
55
+
56
+ Rate limits (`TooManyRequests`) are retried by default; the quota errors are
57
+ not, because they reset at midnight UTC.
58
+
59
+ ## Automations
60
+
61
+ An automation step's `config` is typed by its `type`, so a wrong config fails
62
+ to compile instead of failing at Resend. Values in a step can refer to the
63
+ triggering event with `{ var: "event.<field>" }`:
64
+
65
+ ```ts
66
+ yield* Resend.createAutomation({
67
+ name: "Welcome",
68
+ status: "disabled",
69
+ steps: [
70
+ { key: "start", type: "trigger", config: { event_name: "user.created" } },
71
+ { key: "wait", type: "delay", config: { duration: "1 hour" } },
72
+ {
73
+ key: "mail",
74
+ type: "send_email",
75
+ config: { template: { id: templateId, variables: { NAME: { var: "event.name" } } } },
76
+ },
77
+ ],
78
+ connections: [
79
+ { from: "start", to: "wait", type: "default" },
80
+ { from: "wait", to: "mail", type: "default" },
81
+ ],
82
+ });
83
+ ```
84
+
85
+ ## Webhooks
86
+
87
+ `Resend.Webhooks.constructEvent` checks a delivery's Svix signature with
88
+ core's `Crypto` service (Node, Bun and workerd) and returns the event typed
89
+ from the spec, narrowed on `type`:
90
+
91
+ ```ts
92
+ const event = yield* Resend.Webhooks.constructEvent({
93
+ payload: rawBody, // the body exactly as received
94
+ headers: request.headers, // svix-id, svix-timestamp, svix-signature
95
+ secret: signingSecret, // whsec_..., from createWebhook or getWebhook
96
+ });
97
+ if (event.type === "email.bounced") console.log(event.data.bounce.type);
98
+ ```
99
+
100
+ ## Spec
101
+
102
+ Generated from [resend/resend-openapi](https://github.com/resend/resend-openapi),
103
+ with the corrections in `patches/` taken from live responses and Resend's
104
+ official Node SDK.
@@ -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 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};
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 h,errors$UnprocessableEntity as ee,protocol_rest$RawResponse as te,protocol_rest$RawResponseRoot as ne,protocol_rest$SensitiveValue as re,protocol_rest$rawResponseRootSymbol as ie,protocol_rest$rawResponseSymbol as ae,protocol_rest$restProtocol as oe,protocol_rest$sensitiveValueSymbol as se,protocol_rest$unknownErrorProps as ce,schema_lite$Array as le,schema_lite$Boolean as ue,schema_lite$Duration as de,schema_lite$NullOr as fe,schema_lite$Number as pe,schema_lite$Record as g,schema_lite$String as _,schema_lite$Struct as v,schema_lite$StructWithRest as y,schema_lite$TaggedError as b,schema_lite$Unknown as x,schema_lite$at as S,schema_lite$optional as C,schema_lite$suspend as w}from"@distilled.cloud/core/_bundle/rest";import{api$D as T,api$call as E,api$error as D,api$named as O,api$newError as k,api$op as A,api$opPaginated as j,category$withAuthError as M,category$withBadRequestError as N,category$withConflictError as P,category$withParseError as F,category$withRetryableError as I,pagination$getItems as L,pagination$getPath as R,pagination$missingPaginationConfig as z,retry$capped as B,retry$jittered as me,retry$makeDefault as he,retry$throttlingFactory as V,retry$throttlingOptions as ge,retry$transientFactory as H,retry$transientOptions as _e,schema_lite_typed$String as U,schema_lite_typed$TaggedError as W,schema_lite_typed$Unknown as G,schema_lite_typed$optional as K,trait$Body as ve,trait$CommaDelimited as ye,trait$FormDataFile as be,trait$Header as xe,trait$Http as Se,trait$HttpBody as Ce,trait$IdempotencyToken as we,trait$KeyDictionary as Te,trait$Label as Ee,trait$Query as De,trait$ResponseCode as Oe,trait$UnionCases as ke,trait$applyErrorMatchers as q,trait$bodySymbol as Ae,trait$commaDelimitedSymbol as je,trait$errorMatchersSymbol as Me,trait$formDataFileSymbol as Ne,trait$getErrorMatchers as Pe,trait$headerSymbol as Fe,trait$httpBodySymbol as Ie,trait$httpSymbol as Le,trait$keyDictionarySymbol as Re,trait$labelSymbol as ze,trait$querySymbol as Be,trait$responseCodeSymbol as Ve,trait$unionCasesSymbol as He}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 Ue from"effect/Stream";const We=`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 Ge=/*@__PURE__*/ X.effect(Credentials,/*@__PURE__*/ Y.map(/*@__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`}}),e=>Y.succeed(e)));var UnknownResendError=class extends (/*@__PURE__*/ W()(`UnknownResendError`,h)){};var MissingApiKey=class extends (/*@__PURE__*/ W()(`MissingApiKey`,{message:U}).pipe(M)){};q(MissingApiKey,[{status:401,body:{"/name":`missing_api_key`}}]);var InvalidApiKey=class extends (/*@__PURE__*/ W()(`InvalidApiKey`,{message:U}).pipe(M)){};q(InvalidApiKey,[{status:400,body:{"/name":`validation_error`},message:{includes:`API key is invalid`}},{status:401,body:{"/name":`validation_error`},message:{includes:`API key is invalid`}}]);var RestrictedApiKey=class extends (/*@__PURE__*/ W()(`RestrictedApiKey`,{message:U}).pipe(M)){};q(RestrictedApiKey,[{status:401,body:{"/name":`restricted_api_key`}}]);var InactiveApiKey=class extends (/*@__PURE__*/ W()(`InactiveApiKey`,{message:U}).pipe(M)){};q(InactiveApiKey,[{status:403,body:{"/name":`restricted_api_key`}}]);var SuspendedApiKey=class extends (/*@__PURE__*/ W()(`SuspendedApiKey`,{message:U}).pipe(M)){};q(SuspendedApiKey,[{status:403,body:{"/name":`suspended_api_key`}}]);var InvalidPermission=class extends (/*@__PURE__*/ W()(`InvalidPermission`,{message:U}).pipe(M)){};q(InvalidPermission,[{body:{"/name":`invalid_permission`}}]);var ValidationError=class extends (/*@__PURE__*/ W()(`ValidationError`,{message:U}).pipe(N)){};q(ValidationError,[{body:{"/name":`validation_error`}}]);var MissingRequiredField=class extends (/*@__PURE__*/ W()(`MissingRequiredField`,{message:U}).pipe(N)){};q(MissingRequiredField,[{body:{"/name":`missing_required_field`}}]);var MissingRequiredParameter=class extends (/*@__PURE__*/ W()(`MissingRequiredParameter`,{message:U}).pipe(N)){};q(MissingRequiredParameter,[{body:{"/name":`missing_required_parameter`}}]);var InvalidParameter=class extends (/*@__PURE__*/ W()(`InvalidParameter`,{message:U}).pipe(N)){};q(InvalidParameter,[{body:{"/name":`invalid_parameter`}}]);var ResourceLocked=class extends (/*@__PURE__*/ W()(`ResourceLocked`,{message:U}).pipe(P,I)){};q(ResourceLocked,[{status:409,body:{"/name":`resource_locked`}}]);const Q=[MissingApiKey,InvalidApiKey,RestrictedApiKey,InactiveApiKey,SuspendedApiKey,InvalidPermission,ValidationError,MissingRequiredField,MissingRequiredParameter,InvalidParameter,ResourceLocked,...e];var ResendParseError=class extends (/*@__PURE__*/ W()(`ResendParseError`,{body:G,cause:G}).pipe(F)){};var ResendWebhookSignatureError=class extends (/*@__PURE__*/ W()(`ResendWebhookSignatureError`,{message:U,cause:/*@__PURE__*/ K(G)}).pipe(M)){};var ResendWebhookPayloadParseError=class extends (/*@__PURE__*/ W()(`ResendWebhookPayloadParseError`,{message:U,cause:/*@__PURE__*/ K(G)}).pipe(F)){};const paginateResend=(e,t,n)=>{const r=n.inputToken;if(!r)return z(`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 Ue.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=L(o,a).at(-1);const c=typeof s?.id===`string`?s.id:void 0;const l=R(o,i)===true;const u=n.cursor!==void 0&&c===n.cursor;return[o,{cursor:c,done:!l||c===void 0||u}]}))};const $=`distilled.cloud-resend`;const Ke=/*@__PURE__*/ oe({credentials:/*@__PURE__*/ Y.flatten(Credentials),baseUrl:e=>e.apiBaseUrl,headers:e=>({Authorization:`Bearer ${Z.value(e.apiKey)}`,"User-Agent":$}),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(ce(e)),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 qe=/*@__PURE__*/ Y.provide(/*@__PURE__*/ X.succeed(Retry,{while:()=>false}));const Je=/*@__PURE__*/ policy(V);const Ye=/*@__PURE__*/ policy(H);export{_ as Bc,P as Ca,v as Cc,y as Dc,b as Ec,x as Hc,S as Jc,I as Ka,C as Oc,w as Pc,T as a,E as b,Credentials as credentials$Credentials,Ge as credentials$CredentialsFromEnv,We 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,InactiveApiKey as errors$InactiveApiKey,l as errors$InternalServerError,InvalidApiKey as errors$InvalidApiKey,InvalidParameter as errors$InvalidParameter,InvalidPermission as errors$InvalidPermission,u as errors$Locked,MissingApiKey as errors$MissingApiKey,MissingRequiredField as errors$MissingRequiredField,MissingRequiredParameter as errors$MissingRequiredParameter,d as errors$NotFound,ResendParseError as errors$ResendParseError,Q as errors$ResendServiceErrors,ResendWebhookPayloadParseError as errors$ResendWebhookPayloadParseError,ResendWebhookSignatureError as errors$ResendWebhookSignatureError,ResourceLocked as errors$ResourceLocked,RestrictedApiKey as errors$RestrictedApiKey,f as errors$ServiceUnavailable,SuspendedApiKey as errors$SuspendedApiKey,p as errors$TooManyRequests,m as errors$Unauthorized,UnknownResendError as errors$UnknownResendError,ee as errors$UnprocessableEntity,ValidationError as errors$ValidationError,D as f,O as l,k as m,A as n,j as o,le as oc,paginateResend as pagination$paginateResend,ue as pc,Ke as protocol$ResendProtocol,$ as protocol$USER_AGENT,de as rc,Retry as retry$Retry,B as retry$capped,me as retry$jittered,he as retry$makeDefault,qe as retry$none,policy as retry$policy,Je as retry$throttling,V as retry$throttlingFactory,ge as retry$throttlingOptions,Ye as retry$transient,H as retry$transientFactory,_e as retry$transientOptions,ve as traits$Body,ye as traits$CommaDelimited,be as traits$FormDataFile,xe as traits$Header,Se as traits$Http,Ce as traits$HttpBody,we as traits$IdempotencyToken,Te as traits$KeyDictionary,Ee as traits$Label,De as traits$Query,te as traits$RawResponse,ne as traits$RawResponseRoot,Oe as traits$ResponseCode,re as traits$SensitiveValue,ke as traits$UnionCases,q as traits$applyErrorMatchers,Ae as traits$bodySymbol,je as traits$commaDelimitedSymbol,Me as traits$errorMatchersSymbol,Ne as traits$formDataFileSymbol,Pe as traits$getErrorMatchers,Fe as traits$headerSymbol,Ie as traits$httpBodySymbol,Le as traits$httpSymbol,Re as traits$keyDictionarySymbol,ze as traits$labelSymbol,Be as traits$querySymbol,ie as traits$rawResponseRootSymbol,ae as traits$rawResponseSymbol,Ve as traits$responseCodeSymbol,se as traits$sensitiveValueSymbol,He as traits$unionCasesSymbol,fe as xc,M as ya,pe as yc,N as za,g as zc};
2
2
  //# sourceMappingURL=sdk.js.map
@@ -1 +1 @@
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,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AIA,cAAgB,GAAS,CACvB,GAAIC,IAAS,MAAQ,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"}
1
+ {"version":3,"file":"sdk.js","names":["Schema.String","Category.withAuthError","Category.withBadRequestError","Category.withConflictError","Category.withRetryableError","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","rawResponseRootSymbol","rawResponseSymbol","restProtocol","sensitiveValueSymbol","unknownErrorProps","Array","Boolean","Duration","NullOr","Number","Record","String","Struct","StructWithRest","TaggedError","Unknown","at","optional","suspend","D","call","error","named","newError","op","opPaginated","withAuthError","withBadRequestError","withConflictError","withParseError","withRetryableError","getItems","getPath","missingPaginationConfig","capped","jittered","makeDefault","throttlingFactory","throttlingOptions","transientFactory","transientOptions","String$1","TaggedError$1","Unknown$1","optional$1","Body","CommaDelimited","FormDataFile","Header","Http","HttpBody","IdempotencyToken","KeyDictionary","Label","Query","ResponseCode","UnionCases","applyErrorMatchers","bodySymbol","commaDelimitedSymbol","errorMatchersSymbol","formDataFileSymbol","getErrorMatchers","headerSymbol","httpBodySymbol","httpSymbol","keyDictionarySymbol","labelSymbol","querySymbol","responseCodeSymbol","unionCasesSymbol","Context","Effect","Layer","Redacted","Stream","DEFAULT_API_BASE_URL","config","CredentialsFromEnv","apiKey","ResendServiceErrors","inputToken","pagination","hasNextPath","itemsPath","startCursor","input","state","response","operation","last","nextCursor","hasNext","stuckCursor","USER_AGENT","ResendProtocol","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":"wmFAaA,MAAa0G,GAAuB,yBAOpC,IAAa,YAAb,eACwB,gBAAQ,QAA4C,CAAC,CACzE,mBACF,EAAA,AAAE,CAAC,EAGL,MAAa,WAAc,GAIzBH,EAAM,QACJ,YACAD,EAAO,QAAQ,CACb,OAAQK,EAAO,OACf,WAAYA,EAAO,YAAA,wBACrB,CAAC,CACH,EAQF,MAAaC,GAA0E,gBAAM,OAC3F,YACc,gBAAO,IACL,gBAAO,IAAI,WAAa,CACpC,MAAMC,EAAS,QAAQ,IAAI,eAE3B,GAAI,CAACA,EACH,OAAO,MAAO,IAAIhG,EAAY,CAC5B,QAAS,iDACX,CAAC,EAGH,MAAO,CACL,OAAQ2F,EAAS,KAAKK,CAAM,EAC5B,WAAY,QAAQ,IAAI,qBAAA,wBAC1B,CACF,CAAC,EACA,GAAWP,EAAO,QA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oE,GAA0B,qBAAOlE,CAAgB"}
@@ -3,7 +3,7 @@ import { ConfigError } from "@distilled.cloud/core/errors";
3
3
  * Resend credentials -- hand-written.
4
4
  *
5
5
  * The `Credentials` service holds an *effect* that resolves the current
6
- * credentials on every request (the protocol layer resolves it per request
6
+ * credentials on every request (the protocol resolves it per request
7
7
  * on the calling fiber).
8
8
  */
9
9
  import * as Context from "effect/Context";
@@ -15,7 +15,7 @@ export interface Config {
15
15
  readonly apiKey: Redacted.Redacted<string>;
16
16
  readonly apiBaseUrl: string;
17
17
  }
18
- declare const Credentials_base: Context.ServiceClass<Credentials, "ResendCredentials", Effect.Effect<Config, ConfigError, never>>;
18
+ declare const Credentials_base: Context.ServiceClass<Credentials, "ResendCredentials", Effect.Effect<Config, never, never>>;
19
19
  export declare class Credentials extends /*@__PURE__*/ Credentials_base {
20
20
  }
21
21
  /** Layer from a redacted API key + optional base URL. */
@@ -23,7 +23,12 @@ export declare const fromApiKey: (config: {
23
23
  readonly apiKey: Redacted.Redacted<string>;
24
24
  readonly apiBaseUrl?: string;
25
25
  }) => Layer.Layer<Credentials>;
26
- /** Reads RESEND_API_KEY (required) and RESEND_API_BASE_URL (optional). */
27
- export declare const CredentialsFromEnv: Layer.Layer<Credentials>;
26
+ /**
27
+ * Reads RESEND_API_KEY (required) and RESEND_API_BASE_URL (optional).
28
+ *
29
+ * Its configuration is read and checked once, when the layer is built: a
30
+ * problem there fails the layer with `ConfigError`.
31
+ */
32
+ export declare const CredentialsFromEnv: Layer.Layer<Credentials, ConfigError>;
28
33
  export {};
29
34
  //# sourceMappingURL=credentials.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D;;;;;;GAMG;AACH,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,C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AAO,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;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,EAAE,WAAW,CAmBpE,CAAC"}
package/lib/errors.d.ts CHANGED
@@ -19,6 +19,141 @@ declare const UnknownResendError_base: Schema.TaggedErrorClass<"UnknownResendErr
19
19
  /** Unknown Resend error -- returned when nothing else matches the failure. */
20
20
  export declare class UnknownResendError extends /*@__PURE__*/ UnknownResendError_base {
21
21
  }
22
+ declare const MissingApiKey_base: Schema.TaggedErrorClass<"MissingApiKey", {
23
+ readonly message: import("effect/Schema").String;
24
+ }> & (new (...args: any[]) => {
25
+ "@distilled.cloud/error/categories": {
26
+ AuthError: true;
27
+ };
28
+ });
29
+ /** No `Authorization` header (401 `missing_api_key`). */
30
+ export declare class MissingApiKey extends /*@__PURE__*/ MissingApiKey_base {
31
+ }
32
+ declare const InvalidApiKey_base: Schema.TaggedErrorClass<"InvalidApiKey", {
33
+ readonly message: import("effect/Schema").String;
34
+ }> & (new (...args: any[]) => {
35
+ "@distilled.cloud/error/categories": {
36
+ AuthError: true;
37
+ };
38
+ });
39
+ /**
40
+ * The API key does not exist, was deleted or is malformed
41
+ * (`validation_error`, "API key is invalid": 400, or 401 from the sending
42
+ * endpoints).
43
+ */
44
+ export declare class InvalidApiKey extends /*@__PURE__*/ InvalidApiKey_base {
45
+ }
46
+ declare const RestrictedApiKey_base: Schema.TaggedErrorClass<"RestrictedApiKey", {
47
+ readonly message: import("effect/Schema").String;
48
+ }> & (new (...args: any[]) => {
49
+ "@distilled.cloud/error/categories": {
50
+ AuthError: true;
51
+ };
52
+ });
53
+ /** A sending-only API key called an endpoint that needs full access (401 `restricted_api_key`). */
54
+ export declare class RestrictedApiKey extends /*@__PURE__*/ RestrictedApiKey_base {
55
+ }
56
+ declare const InactiveApiKey_base: Schema.TaggedErrorClass<"InactiveApiKey", {
57
+ readonly message: import("effect/Schema").String;
58
+ }> & (new (...args: any[]) => {
59
+ "@distilled.cloud/error/categories": {
60
+ AuthError: true;
61
+ };
62
+ });
63
+ /** The API key is not active (403 `restricted_api_key`). */
64
+ export declare class InactiveApiKey extends /*@__PURE__*/ InactiveApiKey_base {
65
+ }
66
+ declare const SuspendedApiKey_base: Schema.TaggedErrorClass<"SuspendedApiKey", {
67
+ readonly message: import("effect/Schema").String;
68
+ }> & (new (...args: any[]) => {
69
+ "@distilled.cloud/error/categories": {
70
+ AuthError: true;
71
+ };
72
+ });
73
+ /** The API key is suspended (403 `suspended_api_key`). */
74
+ export declare class SuspendedApiKey extends /*@__PURE__*/ SuspendedApiKey_base {
75
+ }
76
+ declare const InvalidPermission_base: Schema.TaggedErrorClass<"InvalidPermission", {
77
+ readonly message: import("effect/Schema").String;
78
+ }> & (new (...args: any[]) => {
79
+ "@distilled.cloud/error/categories": {
80
+ AuthError: true;
81
+ };
82
+ });
83
+ /**
84
+ * An OAuth access token lacks a scope the endpoint needs (403
85
+ * `invalid_permission`), or a permission value is not one Resend accepts
86
+ * (422).
87
+ */
88
+ export declare class InvalidPermission extends /*@__PURE__*/ InvalidPermission_base {
89
+ }
90
+ declare const ValidationError_base: Schema.TaggedErrorClass<"ValidationError", {
91
+ readonly message: import("effect/Schema").String;
92
+ }> & (new (...args: any[]) => {
93
+ "@distilled.cloud/error/categories": {
94
+ BadRequestError: true;
95
+ };
96
+ });
97
+ /**
98
+ * Resend rejected the request (`validation_error`); `message` says which
99
+ * field. More specific errors cover the cases worth handling.
100
+ */
101
+ export declare class ValidationError extends /*@__PURE__*/ ValidationError_base {
102
+ }
103
+ declare const MissingRequiredField_base: Schema.TaggedErrorClass<"MissingRequiredField", {
104
+ readonly message: import("effect/Schema").String;
105
+ }> & (new (...args: any[]) => {
106
+ "@distilled.cloud/error/categories": {
107
+ BadRequestError: true;
108
+ };
109
+ });
110
+ /** The request body lacks a required field (422 `missing_required_field`). */
111
+ export declare class MissingRequiredField extends /*@__PURE__*/ MissingRequiredField_base {
112
+ }
113
+ declare const MissingRequiredParameter_base: Schema.TaggedErrorClass<"MissingRequiredParameter", {
114
+ readonly message: import("effect/Schema").String;
115
+ }> & (new (...args: any[]) => {
116
+ "@distilled.cloud/error/categories": {
117
+ BadRequestError: true;
118
+ };
119
+ });
120
+ /** The request lacks a required parameter (422 `missing_required_parameter`). */
121
+ export declare class MissingRequiredParameter extends /*@__PURE__*/ MissingRequiredParameter_base {
122
+ }
123
+ declare const InvalidParameter_base: Schema.TaggedErrorClass<"InvalidParameter", {
124
+ readonly message: import("effect/Schema").String;
125
+ }> & (new (...args: any[]) => {
126
+ "@distilled.cloud/error/categories": {
127
+ BadRequestError: true;
128
+ };
129
+ });
130
+ /** A parameter is malformed, such as an id that is not a UUID (`invalid_parameter`). */
131
+ export declare class InvalidParameter extends /*@__PURE__*/ InvalidParameter_base {
132
+ }
133
+ declare const ResourceLocked_base: Schema.TaggedErrorClass<"ResourceLocked", {
134
+ readonly message: import("effect/Schema").String;
135
+ }> & (new (...args: any[]) => {
136
+ "@distilled.cloud/error/categories": {
137
+ ConflictError: true;
138
+ };
139
+ }) & (new (...args: any[]) => {
140
+ "@distilled.cloud/error/categories": {
141
+ RetryableError: true;
142
+ };
143
+ });
144
+ /** Another request is already updating this resource (409 `resource_locked`). Retried by default. */
145
+ export declare class ResourceLocked extends /*@__PURE__*/ ResourceLocked_base {
146
+ }
147
+ /** The errors any operation can answer (above); part of every operation's error union. */
148
+ export type ResendCommonError = MissingApiKey | InvalidApiKey | RestrictedApiKey | InactiveApiKey | SuspendedApiKey | InvalidPermission | ValidationError | MissingRequiredField | MissingRequiredParameter | InvalidParameter | ResourceLocked;
149
+ /**
150
+ * The errors declared on the Resend service: any operation can return them,
151
+ * and every generated operation lists them as its `serviceErrors`. The
152
+ * errors above, matched by Resend's `name`, then each of core's status
153
+ * classes (401, 403, 404, 429, the 5xx ...).
154
+ */
155
+ export declare const ResendServiceErrors: readonly [typeof MissingApiKey, typeof InvalidApiKey, typeof RestrictedApiKey, typeof InactiveApiKey, typeof SuspendedApiKey, typeof InvalidPermission, typeof ValidationError, typeof MissingRequiredField, typeof MissingRequiredParameter, typeof InvalidParameter, typeof ResourceLocked, 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];
156
+ export type ResendServiceError = InstanceType<(typeof ResendServiceErrors)[number]>;
22
157
  declare const ResendParseError_base: Schema.TaggedErrorClass<"ResendParseError", {
23
158
  readonly body: import("effect/Schema").Unknown;
24
159
  readonly cause: import("effect/Schema").Unknown;
@@ -30,4 +165,30 @@ declare const ResendParseError_base: Schema.TaggedErrorClass<"ResendParseError",
30
165
  /** Schema parse error wrapper. */
31
166
  export declare class ResendParseError extends /*@__PURE__*/ ResendParseError_base {
32
167
  }
168
+ declare const ResendWebhookSignatureError_base: Schema.TaggedErrorClass<"ResendWebhookSignatureError", {
169
+ readonly message: import("effect/Schema").String;
170
+ readonly cause: import("effect/Schema").optional<import("effect/Schema").Unknown>;
171
+ }> & (new (...args: any[]) => {
172
+ "@distilled.cloud/error/categories": {
173
+ AuthError: true;
174
+ };
175
+ });
176
+ /**
177
+ * Resend webhook signature verification failed: a signature header is
178
+ * missing or malformed, the timestamp is outside the tolerance window, or no
179
+ * signature matches the raw request payload.
180
+ */
181
+ export declare class ResendWebhookSignatureError extends /*@__PURE__*/ ResendWebhookSignatureError_base {
182
+ }
183
+ declare const ResendWebhookPayloadParseError_base: Schema.TaggedErrorClass<"ResendWebhookPayloadParseError", {
184
+ readonly message: import("effect/Schema").String;
185
+ readonly cause: import("effect/Schema").optional<import("effect/Schema").Unknown>;
186
+ }> & (new (...args: any[]) => {
187
+ "@distilled.cloud/error/categories": {
188
+ ParseError: true;
189
+ };
190
+ });
191
+ /** Resend webhook payload JSON parsing failed after signature verification. */
192
+ export declare class ResendWebhookPayloadParseError extends /*@__PURE__*/ ResendWebhookPayloadParseError_base {
193
+ }
33
194
  //# sourceMappingURL=errors.d.ts.map
@@ -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;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"}
1
+ {"version":3,"file":"errors.d.ts","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,kBAA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BAAoB,GACpB,wBAAwB,GACxB,gBAAgB,GAChB,cAAc,CAAC;AAEnB;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,m/BAatB,CAAC;AACX,MAAM,MAAM,kBAAkB,GAAG,YAAY,CAAC,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;;;;;;;;;AAEpF,kCAAkC;AAClC,qBAAa,gBACX,SAAQ,aAAa,CAAC,qBAGU;CAAG;;;;;;;;;AAErC;;;;GAIG;AACH,qBAAa,2BACX,SAAQ,aAAa,CAAC,gCAMQ;CAAG;;;;;;;;;AAEnC,+EAA+E;AAC/E,qBAAa,8BACX,SAAQ,aAAa,CAAC,mCAMS;CAAG"}
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$ResendParseError as ResendParseError, errors$ServiceUnavailable as ServiceUnavailable, errors$TooManyRequests as TooManyRequests, errors$Unauthorized as Unauthorized, errors$UnknownResendError as UnknownResendError, 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$InactiveApiKey as InactiveApiKey, errors$InternalServerError as InternalServerError, errors$InvalidApiKey as InvalidApiKey, errors$InvalidParameter as InvalidParameter, errors$InvalidPermission as InvalidPermission, errors$Locked as Locked, errors$MissingApiKey as MissingApiKey, errors$MissingRequiredField as MissingRequiredField, errors$MissingRequiredParameter as MissingRequiredParameter, errors$NotFound as NotFound, errors$ResendParseError as ResendParseError, errors$ResendServiceErrors as ResendServiceErrors, errors$ResendWebhookPayloadParseError as ResendWebhookPayloadParseError, errors$ResendWebhookSignatureError as ResendWebhookSignatureError, errors$ResourceLocked as ResourceLocked, errors$RestrictedApiKey as RestrictedApiKey, errors$ServiceUnavailable as ServiceUnavailable, errors$SuspendedApiKey as SuspendedApiKey, errors$TooManyRequests as TooManyRequests, errors$Unauthorized as Unauthorized, errors$UnknownResendError as UnknownResendError, errors$UnprocessableEntity as UnprocessableEntity, errors$ValidationError as ValidationError } from "./_bundle/sdk.js";
package/lib/index.d.ts CHANGED
@@ -9,7 +9,7 @@
9
9
  * ```ts
10
10
  * import * as Resend from "@distilled.cloud/resend";
11
11
  *
12
- * const emails = yield* Resend.Services.resend.getEmails({});
12
+ * const emails = yield* Resend.listEmails({});
13
13
  * ```
14
14
  */
15
15
  export * from "./credentials.ts";
@@ -18,6 +18,6 @@ export * as T from "./traits.ts";
18
18
  export { ResendProtocol, type ResendOpError, type ResendOpContext } from "./protocol.ts";
19
19
  export { paginateResend } from "./pagination.ts";
20
20
  export * as Retry from "./retry.ts";
21
- export * as Services from "./services/index.ts";
21
+ export * as Webhooks from "./webhooks.ts";
22
22
  export * from "./services/resend.ts";
23
23
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,KAAK,aAAa,EAAE,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AACzF,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAKhD,cAAc,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,KAAK,aAAa,EAAE,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AACzF,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAI1C,cAAc,sBAAsB,CAAC"}
package/lib/index.js CHANGED
@@ -4,5 +4,5 @@ export * as T from "./traits.js";
4
4
  export { ResendProtocol } from "./protocol.js";
5
5
  export { paginateResend } from "./pagination.js";
6
6
  export * as Retry from "./retry.js";
7
- export * as Services from "./services/index.js";
7
+ export * as Webhooks from "./webhooks.js";
8
8
  export * from "./services/resend.js";
package/lib/index.lazy.js CHANGED
@@ -4,5 +4,5 @@ export * as T from "./traits.js";
4
4
  export { ResendProtocol } from "./protocol.js";
5
5
  export { paginateResend } from "./pagination.js";
6
6
  export * as Retry from "./retry.js";
7
- export * as Services from "./services.lazy/index.js";
7
+ export * as Webhooks from "./webhooks.js";
8
8
  export * from "./services.lazy/resend.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,cAAc,EAA4C,MAAM,eAAe,CAAC;AACzF,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAChD,4EAA4E;AAC5E,2EAA2E;AAC3E,oEAAoE;AACpE,8CAA8C;AAC9C,cAAc,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.js","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,cAAc,EAA4C,MAAM,eAAe,CAAC;AACzF,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,2EAA2E;AAC3E,6EAA6E;AAC7E,+DAA+D;AAC/D,cAAc,sBAAsB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../src/pagination.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,kCAAkC,CAAC;AAa/D;;;;GAIG;AACH,eAAO,MAAM,cAAc,EAAE,UAAU,CAAC,kBAoCvC,CAAC"}
1
+ {"version":3,"file":"pagination.d.ts","sources":["../src/pagination.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,kCAAkC,CAAC;AAa/D;;;;GAIG;AACH,eAAO,MAAM,cAAc,EAAE,UAAU,CAAC,kBAoCvC,CAAC"}
package/lib/protocol.d.ts CHANGED
@@ -1,19 +1,18 @@
1
- import type * as API from "@distilled.cloud/core/api";
2
- import type { API_ERRORS, 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 { UnknownResendError, ResendParseError } from "./errors.ts";
4
+ import { UnknownResendError, ResendParseError, type ResendServiceError } from "./errors.ts";
5
+ /** Sent on every request; Resend's edge returns 403 (error 1010) without one. */
6
+ export declare const USER_AGENT = "distilled.cloud-resend";
9
7
  /**
10
- * Error channel shared by every generated Resend operation. Generated service
11
- * files annotate operations with `API.OperationMethod<I, O, ResendOpError,
12
- * ResendOpContext>` explicitly so the compiler never infers these back out of
13
- * the schema generics.
8
+ * What every generated Resend operation fails with besides its own errors: the
9
+ * service's errors, the protocol's, and what resolving the credentials fails
10
+ * with. Generated service files annotate operations with
11
+ * `API.OperationMethod<I, O, ResendOpError, ResendOpContext>` explicitly so
12
+ * the compiler never infers these back out of the schema generics.
14
13
  */
15
- export type ResendOpError = InstanceType<(typeof API_ERRORS)[number]> | UnknownResendError | ConfigError | HttpClientError.HttpClientError | ResendParseError | InvalidInput | SdkError;
14
+ export type ResendOpError = ResendServiceError | ErrorOf<typeof ResendProtocol>;
16
15
  /** Context (requirements) shared by every generated Resend operation. */
17
16
  export type ResendOpContext = Credentials | HttpClient.HttpClient;
18
- export declare const ResendProtocol: Layer.Layer<API.Protocol>;
17
+ export declare const ResendProtocol: import("@distilled.cloud/core/protocol").Protocol<ResendParseError | UnknownResendError | import("@distilled.cloud/core/protocol-rest").RestProtocolError, Credentials>;
19
18
  //# sourceMappingURL=protocol.d.ts.map
@@ -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;AAE1F,OAAO,KAAK,EAAE,QAAQ,EAAE,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KAuBzB,CAAC"}
package/lib/protocol.js CHANGED
@@ -1 +1 @@
1
- export { protocol$ResendProtocol as ResendProtocol } from "./_bundle/sdk.js";
1
+ export { protocol$ResendProtocol as ResendProtocol, protocol$USER_AGENT as USER_AGENT } from "./_bundle/sdk.js";
@@ -1 +1 @@
1
- {"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../src/retry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAuC,MAAM,6BAA6B,CAAC;AAC/F;;;;;;;;;;;;;;GAcG;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,sEAAsE;AACtE,qBAAa,KAAM,SAAQ,aAAa,CAAC,UAA+C;CAAG;AAE3F,wEAAwE;AACxE,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
+ {"version":3,"file":"retry.d.ts","sources":["../src/retry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAuC,MAAM,6BAA6B,CAAC;AAC/F;;;;;;;;;;;;;;GAcG;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,sEAAsE;AACtE,qBAAa,KAAM,SAAQ,aAAa,CAAC,UAA+C;CAAG;AAE3F,wEAAwE;AACxE,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,2 +1,3 @@
1
1
  export * as resend from "./resend.ts";
2
+ export * as webhook_events from "./webhook_events.ts";
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sources":["../../src/services/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,cAAc,MAAM,qBAAqB,CAAC"}
@@ -1 +1,2 @@
1
1
  export * as resend from "./resend.js";
2
+ export * as webhook_events from "./webhook_events.js";