@distilled.cloud/resend 1.0.0-rc.13 → 1.0.0-rc.15
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/credentials.d.ts +2 -2
- package/lib/credentials.d.ts.map +1 -1
- package/lib/credentials.js +3 -3
- package/lib/credentials.js.map +1 -1
- package/lib/errors.d.ts.map +1 -1
- package/lib/errors.js +1 -1
- package/lib/errors.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/pagination.d.ts.map +1 -1
- package/lib/pagination.js +2 -4
- package/lib/pagination.js.map +1 -1
- package/lib/protocol.d.ts +3 -3
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +3 -11
- package/lib/protocol.js.map +1 -1
- package/lib/retry.d.ts +1 -1
- package/lib/retry.d.ts.map +1 -1
- package/lib/retry.js +1 -1
- package/lib/retry.js.map +1 -1
- package/lib/services/resend.d.ts +1 -1
- package/lib/services/resend.d.ts.map +1 -1
- package/lib/services/resend.js +130 -384
- package/lib/services/resend.js.map +1 -1
- package/package.json +12 -10
- package/src/credentials.ts +7 -8
- package/src/errors.ts +5 -8
- package/src/index.ts +1 -5
- package/src/pagination.ts +5 -14
- package/src/protocol.ts +35 -45
- package/src/retry.ts +2 -8
- package/src/services/resend.ts +331 -758
- package/lib/response-validation.test.d.ts +0 -4
- package/lib/response-validation.test.d.ts.map +0 -1
- package/lib/response-validation.test.js +0 -43
- package/lib/response-validation.test.js.map +0 -1
- package/src/response-validation.test.ts +0 -57
package/lib/credentials.d.ts
CHANGED
|
@@ -17,9 +17,9 @@ export interface Config {
|
|
|
17
17
|
declare const Credentials_base: Context.ServiceClass<Credentials, "ResendCredentials", Effect.Effect<Config, never, never>>;
|
|
18
18
|
export declare class Credentials extends Credentials_base {
|
|
19
19
|
}
|
|
20
|
-
/** Layer from a
|
|
20
|
+
/** Layer from a redacted API key + optional base URL. */
|
|
21
21
|
export declare const fromApiKey: (config: {
|
|
22
|
-
readonly apiKey: string
|
|
22
|
+
readonly apiKey: Redacted.Redacted<string>;
|
|
23
23
|
readonly apiBaseUrl?: string;
|
|
24
24
|
}) => Layer.Layer<Credentials>;
|
|
25
25
|
/** Reads RESEND_API_KEY (required) and RESEND_API_BASE_URL (optional). */
|
package/lib/credentials.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"AACA;;;;;;GAMG;AACH,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAE5C,eAAO,MAAM,oBAAoB,2BAA2B,CAAC;AAE7D,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC3C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;;AAED,qBAAa,WAAY,SAAQ,gBAEhC;CAAG;AAEJ,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/credentials.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ConfigError } from "@distilled.cloud/core/errors";
|
|
1
2
|
/**
|
|
2
3
|
* Resend credentials — hand-written.
|
|
3
4
|
*
|
|
@@ -9,13 +10,12 @@ import * as Context from "effect/Context";
|
|
|
9
10
|
import * as Effect from "effect/Effect";
|
|
10
11
|
import * as Layer from "effect/Layer";
|
|
11
12
|
import * as Redacted from "effect/Redacted";
|
|
12
|
-
import { ConfigError } from "@distilled.cloud/core/errors";
|
|
13
13
|
export const DEFAULT_API_BASE_URL = "https://api.resend.com";
|
|
14
14
|
export class Credentials extends Context.Service()("ResendCredentials") {
|
|
15
15
|
}
|
|
16
|
-
/** Layer from a
|
|
16
|
+
/** Layer from a redacted API key + optional base URL. */
|
|
17
17
|
export const fromApiKey = (config) => Layer.succeed(Credentials, Effect.succeed({
|
|
18
|
-
apiKey:
|
|
18
|
+
apiKey: config.apiKey,
|
|
19
19
|
apiBaseUrl: config.apiBaseUrl ?? DEFAULT_API_BASE_URL,
|
|
20
20
|
}));
|
|
21
21
|
/** Reads RESEND_API_KEY (required) and RESEND_API_BASE_URL (optional). */
|
package/lib/credentials.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentials.js","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"credentials.js","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,CAAC;AACxC,OAAO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Ac,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;AAGlE,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;;;;;;;;;;AAExC,6EAA6E;AAC7E,qBAAa,kBAAmB,SAAQ,uBAOR;CAAG;;;;;;;;;AAEnC,kCAAkC;AAClC,qBAAa,gBAAiB,SAAQ,qBAGN;CAAG"}
|
package/lib/errors.js
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
* `catchTag` works against either.
|
|
9
9
|
*/
|
|
10
10
|
export { BadGateway, BadRequest, Conflict, ConfigError, Forbidden, GatewayTimeout, InternalServerError, Locked, NotFound, ServiceUnavailable, TooManyRequests, Unauthorized, UnprocessableEntity, HTTP_STATUS_MAP, DEFAULT_ERRORS, API_ERRORS, } from "@distilled.cloud/core/errors";
|
|
11
|
-
import * as Schema from "effect/Schema";
|
|
12
11
|
import * as Category from "@distilled.cloud/core/category";
|
|
12
|
+
import * as Schema from "effect/Schema";
|
|
13
13
|
/** Unknown Resend error — returned when nothing else matches the failure. */
|
|
14
14
|
export class UnknownResendError extends Schema.TaggedError()("UnknownResendError", {
|
|
15
15
|
code: Schema.optional(Schema.String),
|
package/lib/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","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;AAGtC,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"errors.js","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;AAGtC,OAAO,KAAK,QAAQ,MAAM,gCAAgC,CAAC;AAC3D,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,6EAA6E;AAC7E,MAAM,OAAO,kBAAmB,SAAQ,MAAM,CAAC,WAAW,EAAsB,CAC9E,oBAAoB,EACpB;IACE,IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;IACpC,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;IACvC,IAAI,EAAE,MAAM,CAAC,OAAO;CACrB,CACF,CAAC,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC;CAAG;AAEnC,kCAAkC;AAClC,MAAM,OAAO,gBAAiB,SAAQ,MAAM,CAAC,WAAW,EAAoB,CAAC,kBAAkB,EAAE;IAC/F,IAAI,EAAE,MAAM,CAAC,OAAO;IACpB,KAAK,EAAE,MAAM,CAAC,OAAO;CACtB,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC;CAAG"}
|
package/lib/index.d.ts
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
export * from "./credentials.ts";
|
|
16
16
|
export * from "./errors.ts";
|
|
17
17
|
export * as T from "./traits.ts";
|
|
18
|
-
export { ResendProtocol, type ResendOpError, type ResendOpContext
|
|
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
21
|
export * as Services from "./services/index.ts";
|
package/lib/index.d.ts.map
CHANGED
|
@@ -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,
|
|
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"}
|
package/lib/index.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
export * from "./credentials.js";
|
|
16
16
|
export * from "./errors.js";
|
|
17
17
|
export * as T from "./traits.js";
|
|
18
|
-
export { ResendProtocol
|
|
18
|
+
export { ResendProtocol } from "./protocol.js";
|
|
19
19
|
export { paginateResend } from "./pagination.js";
|
|
20
20
|
export * as Retry from "./retry.js";
|
|
21
21
|
export * as Services from "./services/index.js";
|
package/lib/index.js.map
CHANGED
|
@@ -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,
|
|
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,mEAAmE;AACnE,8CAA8C;AAC9C,cAAc,sBAAsB,CAAC"}
|
package/lib/pagination.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../src/pagination.ts"],"names":[],"mappings":"
|
|
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"}
|
package/lib/pagination.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as Pagination from "@distilled.cloud/core/pagination";
|
|
1
2
|
/**
|
|
2
3
|
* Resend pagination — hand-written.
|
|
3
4
|
*
|
|
@@ -9,7 +10,6 @@
|
|
|
9
10
|
*/
|
|
10
11
|
import * as Effect from "effect/Effect";
|
|
11
12
|
import * as Stream from "effect/Stream";
|
|
12
|
-
import * as Pagination from "@distilled.cloud/core/pagination";
|
|
13
13
|
/**
|
|
14
14
|
* Walk forward with `after` set to the last item's `id` while `has_more` is
|
|
15
15
|
* true. An empty page or a repeated cursor terminates even if `has_more`
|
|
@@ -22,9 +22,7 @@ export const paginateResend = (operation, input, pagination) => {
|
|
|
22
22
|
}
|
|
23
23
|
const hasNextPath = pagination.hasNextPage ?? "has_more";
|
|
24
24
|
const itemsPath = pagination.items ?? "data";
|
|
25
|
-
const startCursor = typeof input[inputToken] === "string"
|
|
26
|
-
? input[inputToken]
|
|
27
|
-
: undefined;
|
|
25
|
+
const startCursor = typeof input[inputToken] === "string" ? input[inputToken] : undefined;
|
|
28
26
|
return Stream.unfold({ cursor: startCursor, done: false }, (state) => Effect.gen(function* () {
|
|
29
27
|
if (state.done)
|
|
30
28
|
return undefined;
|
package/lib/pagination.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination.js","sourceRoot":"","sources":["../src/pagination.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"pagination.js","sourceRoot":"","sources":["../src/pagination.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,kCAAkC,CAAC;AAC/D;;;;;;;;GAQG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAkC,CAAC,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE;IAC5F,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AC,OAAO,CAAC,QAAQ,EAAE,WAAW,CAAC,KAAK,IAAI,CAAC;QACnE,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,KAAK,SAAS,IAAI,UAAU,KAAK,KAAK,CAAC,MAAM,CAAC;QAE9E,OAAO;YACL,QAAQ;YACR;gBACE,MAAM,EAAE,UAAU;gBAClB,IAAI,EAAE,CAAC,OAAO,IAAI,UAAU,KAAK,SAAS,IAAI,WAAW;aAC1D;SACO,CAAC;IACb,CAAC,CAAC,CACH,CAAC;AACJ,CAAC,CAAC"}
|
package/lib/protocol.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type * as Layer from "effect/Layer";
|
|
2
|
-
import type * as HttpClient from "effect/http/HttpClient";
|
|
3
|
-
import type * as HttpClientError from "effect/http/HttpClientError";
|
|
4
1
|
import type * as API from "@distilled.cloud/core/api";
|
|
5
2
|
import type { API_ERRORS, ConfigError } from "@distilled.cloud/core/errors";
|
|
3
|
+
import type * as HttpClient from "effect/http/HttpClient";
|
|
4
|
+
import type * as HttpClientError from "effect/http/HttpClientError";
|
|
5
|
+
import type * as Layer from "effect/Layer";
|
|
6
6
|
import { Credentials } from "./credentials.ts";
|
|
7
7
|
import { UnknownResendError, ResendParseError } from "./errors.ts";
|
|
8
8
|
/**
|
package/lib/protocol.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"
|
|
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,CA8BnD,CAAC"}
|
package/lib/protocol.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { makeRestProtocol } from "@distilled.cloud/core/protocol-rest";
|
|
1
2
|
/**
|
|
2
3
|
* ResendProtocol — hand-written.
|
|
3
4
|
*
|
|
@@ -16,7 +17,6 @@
|
|
|
16
17
|
*/
|
|
17
18
|
import * as Effect from "effect/Effect";
|
|
18
19
|
import * as Redacted from "effect/Redacted";
|
|
19
|
-
import { makeRestProtocol } from "@distilled.cloud/core/protocol-rest";
|
|
20
20
|
import { Credentials } from "./credentials.js";
|
|
21
21
|
import { UnknownResendError, ResendParseError } from "./errors.js";
|
|
22
22
|
export const ResendProtocol = makeRestProtocol({
|
|
@@ -37,22 +37,14 @@ export const ResendProtocol = makeRestProtocol({
|
|
|
37
37
|
if (body === null || typeof body !== "object")
|
|
38
38
|
return undefined;
|
|
39
39
|
const rec = body;
|
|
40
|
-
const code = typeof rec.name === "string"
|
|
41
|
-
? rec.name
|
|
42
|
-
: typeof rec.code === "string"
|
|
43
|
-
? rec.code
|
|
44
|
-
: undefined;
|
|
40
|
+
const code = typeof rec.name === "string" ? rec.name : typeof rec.code === "string" ? rec.code : undefined;
|
|
45
41
|
const message = typeof rec.message === "string" ? rec.message : undefined;
|
|
46
42
|
if (code === undefined && message === undefined)
|
|
47
43
|
return undefined;
|
|
48
44
|
return { code, message };
|
|
49
45
|
},
|
|
50
46
|
unknownError: ({ code, message, body }) => new UnknownResendError({
|
|
51
|
-
code: typeof code === "string"
|
|
52
|
-
? code
|
|
53
|
-
: code !== undefined
|
|
54
|
-
? String(code)
|
|
55
|
-
: undefined,
|
|
47
|
+
code: typeof code === "string" ? code : code !== undefined ? String(code) : undefined,
|
|
56
48
|
message,
|
|
57
49
|
body,
|
|
58
50
|
}),
|
package/lib/protocol.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAIxC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAe,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAkBnE,MAAM,CAAC,MAAM,cAAc,GAA8B,gBAAgB,CAAS;IAChF,mEAAmE;IACnE,wEAAwE;IACxE,WAAW,EAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;QAC/B,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,WAAW,CAAC;QACnC,OAAO,KAAK,CAAC,CAAC,OAAO,CAAC;IACxB,CAAC,CAAC;IACF,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,UAAU;IACpC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,CA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CAAC,CAAC"}
|
package/lib/retry.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type Policy } from "@distilled.cloud/core/retry";
|
|
1
2
|
/**
|
|
2
3
|
* Resend retry configuration.
|
|
3
4
|
*
|
|
@@ -15,7 +16,6 @@
|
|
|
15
16
|
*/
|
|
16
17
|
import * as Context from "effect/Context";
|
|
17
18
|
import * as Effect from "effect/Effect";
|
|
18
|
-
import { type Policy } from "@distilled.cloud/core/retry";
|
|
19
19
|
export { type Options, type Factory, type Policy, makeDefault, jittered, capped, throttlingOptions, transientOptions, throttlingFactory, transientFactory, } from "@distilled.cloud/core/retry";
|
|
20
20
|
declare const Retry_base: Context.ServiceClass<Retry, "ResendRetry", Policy>;
|
|
21
21
|
/** Context tag for configuring retry behavior of Resend API calls. */
|
package/lib/retry.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../src/retry.ts"],"names":[],"mappings":"AAAA
|
|
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,UAA+C;CAAG;AAE7E,wEAAwE;AACxE,eAAO,MAAM,MAAM,qBAAsB,MAAM,sFACS,CAAC;AAEzD,sCAAsC;AACtC,eAAO,MAAM,IAAI,mFAA+D,CAAC;AAEjF,kFAAkF;AAClF,eAAO,MAAM,UAAU,mFAA4B,CAAC;AAEpD,oFAAoF;AACpF,eAAO,MAAM,SAAS,mFAA2B,CAAC"}
|
package/lib/retry.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { throttlingFactory, transientFactory } from "@distilled.cloud/core/retry";
|
|
1
2
|
/**
|
|
2
3
|
* Resend retry configuration.
|
|
3
4
|
*
|
|
@@ -16,7 +17,6 @@
|
|
|
16
17
|
import * as Context from "effect/Context";
|
|
17
18
|
import * as Effect from "effect/Effect";
|
|
18
19
|
import * as Layer from "effect/Layer";
|
|
19
|
-
import { throttlingFactory, transientFactory, } from "@distilled.cloud/core/retry";
|
|
20
20
|
export { makeDefault, jittered, capped, throttlingOptions, transientOptions, throttlingFactory, transientFactory, } from "@distilled.cloud/core/retry";
|
|
21
21
|
/** Context tag for configuring retry behavior of Resend API calls. */
|
|
22
22
|
export class Retry extends Context.Service()("ResendRetry") {
|
package/lib/retry.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retry.js","sourceRoot":"","sources":["../src/retry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"retry.js","sourceRoot":"","sources":["../src/retry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/F;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAEtC,OAAO,EAIL,WAAW,EACX,QAAQ,EACR,MAAM,EACN,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,6BAA6B,CAAC;AAErC,sEAAsE;AACtE,MAAM,OAAO,KAAM,SAAQ,OAAO,CAAC,OAAO,EAAiB,CAAC,aAAa,CAAC;CAAG;AAE7E,wEAAwE;AACxE,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,gBAAwB,EAAE,EAAE,CACjD,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC;AAEzD,sCAAsC;AACtC,MAAM,CAAC,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;AAEjF,kFAAkF;AAClF,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC;AAEpD,oFAAoF;AACpF,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAAC"}
|
package/lib/services/resend.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import * as API from "@distilled.cloud/core/api";
|
|
1
2
|
import * as S from "@distilled.cloud/core/schema";
|
|
2
3
|
import * as Redacted from "effect/Redacted";
|
|
3
|
-
import * as API from "@distilled.cloud/core/api";
|
|
4
4
|
import { type ResendOpError, type ResendOpContext } from "../protocol.ts";
|
|
5
5
|
export type { ResendOpError, ResendOpContext };
|
|
6
6
|
export interface CancelEmailRequest {
|