@distilled.cloud/whatsapp 0.0.0-stage → 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/LICENSE +201 -0
  2. package/README.md +143 -2
  3. package/lib/.lazy.json +1 -0
  4. package/lib/_bundle/lazy.js +4 -0
  5. package/lib/_bundle/sdk.js +2 -0
  6. package/lib/_bundle/sdk.js.map +1 -0
  7. package/lib/credentials.d.ts +67 -0
  8. package/lib/credentials.d.ts.map +1 -0
  9. package/lib/credentials.js +1 -0
  10. package/lib/errors.d.ts +48 -0
  11. package/lib/errors.d.ts.map +1 -0
  12. package/lib/errors.js +1 -0
  13. package/lib/index.d.ts +35 -0
  14. package/lib/index.d.ts.map +1 -0
  15. package/lib/index.js +8 -0
  16. package/lib/index.lazy.js +8 -0
  17. package/lib/index.lazy.js.map +1 -0
  18. package/lib/pagination.d.ts +5 -0
  19. package/lib/pagination.d.ts.map +1 -0
  20. package/lib/pagination.js +1 -0
  21. package/lib/protocol.d.ts +19 -0
  22. package/lib/protocol.d.ts.map +1 -0
  23. package/lib/protocol.js +1 -0
  24. package/lib/retry.d.ts +53 -0
  25. package/lib/retry.d.ts.map +1 -0
  26. package/lib/retry.js +1 -0
  27. package/lib/services/index.d.ts +2 -0
  28. package/lib/services/index.d.ts.map +1 -0
  29. package/lib/services/index.js +1 -0
  30. package/lib/services/whatsapp.d.ts +4131 -0
  31. package/lib/services/whatsapp.d.ts.map +1 -0
  32. package/lib/services/whatsapp.js +160 -0
  33. package/lib/services/whatsapp.js.map +1 -0
  34. package/lib/services.lazy/index.js +3 -0
  35. package/lib/services.lazy/whatsapp.js +4 -0
  36. package/lib/traits.d.ts +7 -0
  37. package/lib/traits.d.ts.map +1 -0
  38. package/lib/traits.js +1 -0
  39. package/package.json +89 -3
  40. package/src/credentials.ts +123 -0
  41. package/src/errors.ts +62 -0
  42. package/src/index.ts +45 -0
  43. package/src/pagination.ts +73 -0
  44. package/src/protocol.ts +72 -0
  45. package/src/retry.ts +72 -0
  46. package/src/services/index.ts +2 -0
  47. package/src/services/whatsapp.ts +9925 -0
  48. package/src/traits.ts +40 -0
@@ -0,0 +1,123 @@
1
+ import * as EffectConfig from "@distilled.cloud/core/config";
2
+ import type { Checked } from "@distilled.cloud/core/config";
3
+ import { ConfigError } from "@distilled.cloud/core/errors";
4
+ import { invalidLabel } from "@distilled.cloud/core/protocol-http";
5
+ /**
6
+ * WhatsApp credentials -- hand-written.
7
+ *
8
+ * The WhatsApp Business Platform authenticates every call with the one
9
+ * scheme its OpenAPI spec declares: an access token sent as
10
+ * `Authorization: Bearer`. That is usually a system user access token with
11
+ * the `whatsapp_business_messaging` and `whatsapp_business_management`
12
+ * permissions, or a business token a Tech Provider obtained through
13
+ * Embedded Signup.
14
+ *
15
+ * Every Graph API path starts with a version (`/v23.0/...`). The protocol
16
+ * puts {@link Config.apiVersion} there; it defaults to
17
+ * {@link DEFAULT_API_VERSION}, the version the mirrored spec describes.
18
+ *
19
+ * Following the core convention the `Credentials` service holds an *effect*
20
+ * resolving the current config, which the protocol runs per request on
21
+ * the calling fiber.
22
+ *
23
+ * A layer here reads and checks its configuration when it is built
24
+ * ({@link check}): a missing access token or a version that can't be a URL
25
+ * path segment is a `ConfigError` at setup, and no call fails for it.
26
+ */
27
+ import * as Context from "effect/Context";
28
+ import * as Effect from "effect/Effect";
29
+ import * as Layer from "effect/Layer";
30
+ import * as Redacted from "effect/Redacted";
31
+
32
+ /** The Graph API origin (the spec's only server). */
33
+ export const DEFAULT_API_BASE_URL = "https://graph.facebook.com";
34
+
35
+ /**
36
+ * The Graph API version the generated operations describe: the spec's
37
+ * `info.version`. Update it with the spec.
38
+ */
39
+ export const DEFAULT_API_VERSION = "v23.0";
40
+
41
+ export interface Config {
42
+ readonly accessToken: Redacted.Redacted<string>;
43
+ /** Graph API version, e.g. `v23.0`, sent as the first path segment. */
44
+ readonly apiVersion: string;
45
+ readonly apiBaseUrl: string;
46
+ }
47
+
48
+ /** What the service resolves: a {@link Config} that passed {@link check}. */
49
+ export class Credentials
50
+ extends /*@__PURE__*/ Context.Service<Credentials, Effect.Effect<Checked<Config>>>()(
51
+ "WhatsAppCredentials",
52
+ ) {}
53
+
54
+ /**
55
+ * Check `config`: fails with `ConfigError` for a version that can't be a
56
+ * URL path segment (`""`, `.`, `..`, a lone UTF-16 surrogate). For a
57
+ * `Credentials` layer of your own, for example one that rotates tokens.
58
+ */
59
+ export const check = (config: Config): Effect.Effect<Checked<Config>, ConfigError> =>
60
+ invalidLabel("apiVersion", config.apiVersion) === undefined
61
+ ? // The one place that says a Config is checked.
62
+ Effect.succeed(config as Checked<Config>)
63
+ : Effect.fail(
64
+ new ConfigError({
65
+ message: `The configured WhatsApp API version ${JSON.stringify(config.apiVersion)} cannot be a URL path segment`,
66
+ }),
67
+ );
68
+
69
+ /** A layer that resolves and checks `config` once, when it is built. */
70
+ const layer = (config: Effect.Effect<Config, ConfigError>): Layer.Layer<Credentials, ConfigError> =>
71
+ Layer.effect(
72
+ Credentials,
73
+ Effect.map(Effect.flatMap(config, check), (checked) => Effect.succeed(checked)),
74
+ );
75
+
76
+ const trimSlash = (url: string): string => url.replace(/\/+$/, "");
77
+
78
+ /** Layer from a redacted access token, with an optional version and base URL. */
79
+ export const fromAccessToken = (config: {
80
+ readonly accessToken: Redacted.Redacted<string>;
81
+ readonly apiVersion?: string;
82
+ readonly apiBaseUrl?: string;
83
+ }): Layer.Layer<Credentials, ConfigError> =>
84
+ layer(
85
+ Effect.succeed({
86
+ accessToken: config.accessToken,
87
+ apiVersion: config.apiVersion ?? DEFAULT_API_VERSION,
88
+ apiBaseUrl: trimSlash(config.apiBaseUrl ?? DEFAULT_API_BASE_URL),
89
+ }),
90
+ );
91
+
92
+ const envConfig = /*@__PURE__*/ EffectConfig.all({
93
+ accessToken: /*@__PURE__*/ EffectConfig.Redacted("WHATSAPP_ACCESS_TOKEN"),
94
+ apiVersion: /*@__PURE__*/ EffectConfig.String("WHATSAPP_API_VERSION").pipe(
95
+ /*@__PURE__*/ EffectConfig.withDefault(DEFAULT_API_VERSION),
96
+ ),
97
+ apiBaseUrl: /*@__PURE__*/ EffectConfig.String("WHATSAPP_API_BASE_URL").pipe(
98
+ /*@__PURE__*/ EffectConfig.withDefault(DEFAULT_API_BASE_URL),
99
+ ),
100
+ });
101
+
102
+ /**
103
+ * Reads `WHATSAPP_ACCESS_TOKEN` (required), `WHATSAPP_API_VERSION` and
104
+ * `WHATSAPP_API_BASE_URL` (optional) through Effect `Config` -- so it follows
105
+ * whatever `ConfigProvider` is installed (in a Worker, one built from `env`).
106
+ * The environment is read, and the values checked, once: when the layer is
107
+ * built.
108
+ */
109
+ export const CredentialsFromEnv: Layer.Layer<Credentials, ConfigError> = /*@__PURE__*/ layer(
110
+ /*@__PURE__*/ envConfig.pipe(
111
+ /*@__PURE__*/ Effect.mapError(
112
+ (e) =>
113
+ new ConfigError({
114
+ message: `WhatsApp credentials require WHATSAPP_ACCESS_TOKEN: ${e.message}`,
115
+ }),
116
+ ),
117
+ /*@__PURE__*/ Effect.map(({ accessToken, apiVersion, apiBaseUrl }): Config => ({
118
+ accessToken,
119
+ apiVersion,
120
+ apiBaseUrl: trimSlash(apiBaseUrl),
121
+ })),
122
+ ),
123
+ );
package/src/errors.ts ADDED
@@ -0,0 +1,62 @@
1
+ /**
2
+ * WhatsApp error types.
3
+ *
4
+ * Failures arrive as the Graph API error object
5
+ *
6
+ * { "error": { "message": "...", "type": "OAuthException", "code": 190,
7
+ * "error_subcode": 463, "fbtrace_id": "..." } }
8
+ *
9
+ * and map by status onto the core classes re-exported here: `BadRequest`,
10
+ * `Unauthorized`, `Forbidden`, `NotFound`, `TooManyRequests` and the 5xx
11
+ * family, the last two retryable. Operations that declare a status get a
12
+ * generated class with the same `_tag`, so `catchTag` works against either.
13
+ */
14
+ export {
15
+ BadGateway,
16
+ BadRequest,
17
+ Conflict,
18
+ ConfigError,
19
+ Forbidden,
20
+ GatewayTimeout,
21
+ InternalServerError,
22
+ Locked,
23
+ NotFound,
24
+ ServiceUnavailable,
25
+ TooManyRequests,
26
+ Unauthorized,
27
+ UnprocessableEntity,
28
+ HTTP_STATUS_MAP,
29
+ DEFAULT_ERRORS,
30
+ API_ERRORS,
31
+ } from "@distilled.cloud/core/errors";
32
+ export type { DefaultErrors } from "@distilled.cloud/core/errors";
33
+
34
+ import * as Category from "@distilled.cloud/core/category";
35
+ import { API_ERRORS, UnknownErrorFields } from "@distilled.cloud/core/errors";
36
+ import * as Schema from "@distilled.cloud/core/schema-lite-typed";
37
+
38
+ /**
39
+ * A non-2xx, non-5xx status that neither the operation nor the core map
40
+ * covers. `code` is the Graph API's numeric `error.code` when the body
41
+ * carries one.
42
+ */
43
+ export class UnknownWhatsAppError
44
+ extends /*@__PURE__*/ Schema.TaggedError<UnknownWhatsAppError>()(
45
+ "UnknownWhatsAppError",
46
+ UnknownErrorFields,
47
+ ) {}
48
+
49
+ /** A 2xx response that does not match the operation's output schema. */
50
+ export class WhatsAppParseError
51
+ extends /*@__PURE__*/ Schema.TaggedError<WhatsAppParseError>()("WhatsAppParseError", {
52
+ body: Schema.Unknown,
53
+ cause: Schema.Unknown,
54
+ }).pipe(Category.withParseError) {}
55
+
56
+ /**
57
+ * The errors declared on the WhatsApp service: any operation can return them,
58
+ * and every generated operation lists them as its `serviceErrors`. Today that
59
+ * is each of core's status classes (401, 403, 404, 429, the 5xx ...).
60
+ */
61
+ export const WhatsAppServiceErrors = API_ERRORS;
62
+ export type WhatsAppServiceError = InstanceType<(typeof WhatsAppServiceErrors)[number]>;
package/src/index.ts ADDED
@@ -0,0 +1,45 @@
1
+ /**
2
+ * @distilled.cloud/whatsapp -- WhatsApp Business Platform SDK for Effect.
3
+ *
4
+ * `./services` is generated by `scripts/generate.ts` from the Smithy model
5
+ * that `scripts/convert.ts` converts from Meta's OpenAPI spec
6
+ * (https://github.com/facebook/openapi), mirrored at
7
+ * `specs/spec-mirror-whatsapp/specs/openapi.yaml`. Everything else in this
8
+ * folder is hand-written.
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * import * as Effect from "effect/Effect";
13
+ * import * as Layer from "effect/Layer";
14
+ * import * as FetchHttpClient from "effect/http/FetchHttpClient";
15
+ * import * as WhatsApp from "@distilled.cloud/whatsapp";
16
+ *
17
+ * const program = WhatsApp.getPhoneNumber({ Phone_Number_ID: "106540352242922" });
18
+ *
19
+ * program.pipe(
20
+ * Effect.provide(
21
+ * Layer.mergeAll(FetchHttpClient.layer, WhatsApp.CredentialsFromEnv),
22
+ * ),
23
+ * Effect.runPromise,
24
+ * );
25
+ * ```
26
+ */
27
+ export * from "./credentials.ts";
28
+ export * from "./errors.ts";
29
+ export * as T from "./traits.ts";
30
+ export { WhatsAppProtocol, type WhatsAppOpError, type WhatsAppOpContext } from "./protocol.ts";
31
+ export { paginateGraph } from "./pagination.ts";
32
+ export * as Retry from "./retry.ts";
33
+ // Operations, their request/response types, their typed errors and the
34
+ // `WebhookPayload` type are importable straight off the package root; the
35
+ // errors every operation can answer come from ./errors.ts. The generated
36
+ // status classes shadow the same-named core ones from ./errors.ts -- the
37
+ // operations raise the generated classes (same `_tag`).
38
+ export * from "./services/whatsapp.ts";
39
+ export {
40
+ BadRequest,
41
+ Conflict,
42
+ Forbidden,
43
+ NotFound,
44
+ UnprocessableEntity,
45
+ } from "./services/whatsapp.ts";
@@ -0,0 +1,73 @@
1
+ import {
2
+ getItems,
3
+ getPath,
4
+ isTerminalToken,
5
+ missingPaginationConfig,
6
+ type PaginationStrategy,
7
+ } from "@distilled.cloud/core/pagination";
8
+ /**
9
+ * Graph API cursor pagination -- hand-written.
10
+ *
11
+ * Graph API lists take `limit` and `after`, and answer
12
+ *
13
+ * { "data": [...], "paging": { "cursors": { "before", "after" }, "next": "<url>" } }
14
+ *
15
+ * `paging.cursors.after` is there on every page, the last one included, so
16
+ * the cursor alone never ends a traversal (core's `paginateCursor` would ask
17
+ * for the last page again). Another page exists only while `paging.next` is
18
+ * present: on 2026-11-18 a two-item `message_templates` page carried
19
+ * `cursors` and `next`, and the final page `cursors` and `previous` with no
20
+ * `next`. This strategy passes
21
+ * `paging.cursors.after` back as `after` until `paging.next` is absent, a page
22
+ * comes back empty, or the cursor stops moving.
23
+ */
24
+ import * as Effect from "effect/Effect";
25
+ import * as Stream from "effect/Stream";
26
+
27
+ export { getItems } from "@distilled.cloud/core/pagination";
28
+
29
+ /** Where the next-page URL lives, next to `cursors` (`paging.next`). */
30
+ const nextPath = (outputToken: string): string => {
31
+ const parts = outputToken.split(".");
32
+ const cursors = parts.lastIndexOf("cursors");
33
+ return [...parts.slice(0, cursors === -1 ? -1 : cursors), "next"].join(".");
34
+ };
35
+
36
+ /** Stream of pages: `after` = the previous page's cursor, while `paging.next` is set. */
37
+ export const paginateGraph: PaginationStrategy = (operation, input, pagination) => {
38
+ const inputToken = pagination.inputToken;
39
+ const outputToken = pagination.outputToken;
40
+ if (!inputToken || !outputToken) {
41
+ return missingPaginationConfig("Graph API pagination requires inputToken and outputToken");
42
+ }
43
+ const hasNextPath = pagination.hasNextPage ?? nextPath(outputToken);
44
+
45
+ type State = { cursor: string | undefined; done: boolean };
46
+ const start = typeof input[inputToken] === "string" ? (input[inputToken] as string) : undefined;
47
+
48
+ return Stream.unfold({ cursor: start, done: false } as State, (state) =>
49
+ Effect.gen(function* () {
50
+ if (state.done) return undefined;
51
+
52
+ const response = yield* operation({
53
+ ...input,
54
+ ...(state.cursor ? { [inputToken]: state.cursor } : {}),
55
+ } as typeof input);
56
+
57
+ const cursor = getPath(response, outputToken) as string | null | undefined;
58
+ const next = getPath(response, hasNextPath);
59
+ const hasNext = typeof next === "string" && next !== "";
60
+ const empty =
61
+ pagination.items !== undefined && getItems(response, pagination.items).length === 0;
62
+ const stuck = state.cursor !== undefined && cursor === state.cursor;
63
+
64
+ return [
65
+ response,
66
+ {
67
+ cursor: cursor ?? undefined,
68
+ done: !hasNext || isTerminalToken(cursor) || empty || stuck,
69
+ } satisfies State,
70
+ ] as const;
71
+ }),
72
+ );
73
+ };
@@ -0,0 +1,72 @@
1
+ import type { Checked } from "@distilled.cloud/core/config";
2
+ import type { ErrorOf } from "@distilled.cloud/core/protocol";
3
+ import { restProtocol, unknownErrorProps } from "@distilled.cloud/core/protocol-rest";
4
+ /**
5
+ * WhatsAppProtocol -- hand-written.
6
+ *
7
+ * Plain JSON REST against the Graph API, https://graph.facebook.com. Every
8
+ * request goes to `<apiBaseUrl>/<apiVersion>/<path>` with the access token
9
+ * as `Authorization: Bearer`; the generated operations carry the path after
10
+ * the version (scripts/convert.ts removes the spec's `/{Version}` segment).
11
+ * Failures are the Graph API error object
12
+ *
13
+ * { "error": { "message": "...", "type": "OAuthException", "code": 100 } }
14
+ *
15
+ * mapped by status; `code` becomes the error's `code` and `message` its
16
+ * `message`.
17
+ */
18
+ import * as Effect from "effect/Effect";
19
+ import type * as HttpClient from "effect/http/HttpClient";
20
+ import * as Redacted from "effect/Redacted";
21
+ import { Credentials, type Config } from "./credentials.ts";
22
+ import { UnknownWhatsAppError, WhatsAppParseError, type WhatsAppServiceError } from "./errors.ts";
23
+
24
+ /**
25
+ * What every generated WhatsApp operation fails with besides its own errors:
26
+ * the errors declared on the service, and the errors declared on the protocol.
27
+ * Nobody lists the protocol's: its type carries what its code fails with (a
28
+ * response that does not match its schema, a failed response nothing declares,
29
+ * core's REST errors, and what resolving the credentials fails with).
30
+ * Generated service files annotate operations with `API.OperationMethod<I, O,
31
+ * WhatsAppOpError, WhatsAppOpContext>` explicitly so the compiler never infers
32
+ * these back out of the schema generics.
33
+ */
34
+ export type WhatsAppOpError = WhatsAppServiceError | ErrorOf<typeof WhatsAppProtocol>;
35
+
36
+ /** Context (requirements) shared by every generated WhatsApp operation. */
37
+ export type WhatsAppOpContext = Credentials | HttpClient.HttpClient;
38
+
39
+ const isRecord = (v: unknown): v is Record<string, unknown> => typeof v === "object" && v !== null;
40
+
41
+ /** `{ error: { code, message } }` -> `{ code, message }`. */
42
+ const graphError = (body: unknown): { code?: number; message?: string } | undefined => {
43
+ const error = isRecord(body) && isRecord(body.error) ? body.error : undefined;
44
+ if (error === undefined) return undefined;
45
+ const code = typeof error.code === "number" ? error.code : undefined;
46
+ const message =
47
+ typeof error.message === "string" && error.message !== "" ? error.message : undefined;
48
+ return code === undefined && message === undefined ? undefined : { code, message };
49
+ };
50
+
51
+ /**
52
+ * `<apiBaseUrl>/<apiVersion>`. A version that can't be a URL path segment
53
+ * (`""`, `.`, `..`, a lone UTF-16 surrogate) is refused earlier, when the
54
+ * credentials layer is built (`check` in ./credentials.ts).
55
+ */
56
+ const baseUrlFor = (creds: Checked<Config>): string =>
57
+ `${creds.apiBaseUrl}/${encodeURIComponent(creds.apiVersion)}`;
58
+
59
+ export const WhatsAppProtocol = /*@__PURE__*/ restProtocol({
60
+ // Resolved on the calling fiber per request.
61
+ credentials: /*@__PURE__*/ Effect.flatten(Credentials),
62
+ baseUrl: baseUrlFor,
63
+ headers: (creds) => ({
64
+ Authorization: `Bearer ${Redacted.value(creds.accessToken)}`,
65
+ Accept: "application/json",
66
+ }),
67
+ errorEnvelope: graphError,
68
+ // A typed error's declared fields are read inside `error` first.
69
+ errorFieldsAt: "/error",
70
+ unknownError: (info) => new UnknownWhatsAppError(unknownErrorProps(info)),
71
+ parseError: ({ body, cause }) => new WhatsAppParseError({ body, cause }),
72
+ });
package/src/retry.ts ADDED
@@ -0,0 +1,72 @@
1
+ import * as Retries from "@distilled.cloud/core/retry";
2
+ /**
3
+ * WhatsApp retry surface -- a veneer over `@distilled.cloud/core/retry`.
4
+ *
5
+ * The spec documents 429 Too Many Requests on most operations;
6
+ * `throttling` is the policy that recovers it.
7
+ *
8
+ * The `Retry` service tag is threaded into every generated operation via
9
+ * `API.make({ retry: Retry })`, so a caller-installed policy applies to all
10
+ * WhatsApp calls below it and core's `makeDefault` is the fallback when none is
11
+ * provided.
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * import * as WhatsApp from "@distilled.cloud/whatsapp";
16
+ *
17
+ * myEffect.pipe(WhatsApp.Retry.throttling);
18
+ * ```
19
+ */
20
+ import * as Context from "effect/Context";
21
+ import * as Effect from "effect/Effect";
22
+ import * as Layer from "effect/Layer";
23
+
24
+ export type Options = Retries.Options;
25
+ export type Factory = Retries.Factory;
26
+ export type Policy = Retries.Policy;
27
+
28
+ /** Context tag for configuring retry behavior of WhatsApp API calls. */
29
+ export class Retry extends /*@__PURE__*/ Context.Service<Retry, Policy>()("WhatsAppRetry") {}
30
+
31
+ /** Provides a custom retry policy to every WhatsApp API call below it. */
32
+ export const policy: {
33
+ (
34
+ options: Options,
35
+ ): <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, Exclude<R, Retry>>;
36
+ (
37
+ factory: Factory,
38
+ ): <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, Exclude<R, Retry>>;
39
+ } = (optionsOrFactory: Options | Factory) => Effect.provide(Layer.succeed(Retry, optionsOrFactory));
40
+
41
+ /** Disables all automatic retries. */
42
+ export const none: <A, E, R>(
43
+ effect: Effect.Effect<A, E, R>,
44
+ ) => Effect.Effect<A, E, Exclude<R, Retry>> = /*@__PURE__*/ Effect.provide(
45
+ /*@__PURE__*/ Layer.succeed(Retry, { while: () => false }),
46
+ );
47
+
48
+ /**
49
+ * The default retry policy (core's): transient/throttling/retryable errors,
50
+ * capped exponential backoff with jitter, server `retryAfter` hints honored
51
+ * with precedence.
52
+ */
53
+ export const makeDefault: Factory = Retries.makeDefault;
54
+
55
+ export const jittered = Retries.jittered;
56
+ export const capped = Retries.capped;
57
+
58
+ /** Retry options that retry all throttling errors indefinitely. */
59
+ export const throttlingOptions: Options = Retries.throttlingOptions;
60
+
61
+ /** Retries all throttling errors indefinitely (honoring server hints). */
62
+ export const throttling: <A, E, R>(
63
+ effect: Effect.Effect<A, E, R>,
64
+ ) => Effect.Effect<A, E, Exclude<R, Retry>> = /*@__PURE__*/ policy(Retries.throttlingFactory);
65
+
66
+ /** Retry options that retry all transient errors indefinitely. */
67
+ export const transientOptions: Options = Retries.transientOptions;
68
+
69
+ /** Retries all transient errors indefinitely. */
70
+ export const transient: <A, E, R>(
71
+ effect: Effect.Effect<A, E, R>,
72
+ ) => Effect.Effect<A, E, Exclude<R, Retry>> = /*@__PURE__*/ policy(Retries.transientFactory);
@@ -0,0 +1,2 @@
1
+ // AUTO-GENERATED by scripts/generate.ts. Do not edit.
2
+ export * as whatsapp from "./whatsapp.ts";