better-ship 0.42.0 → 0.43.0
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/dist/{application-BwevrnLI.js → application-Ckae0K1T.js} +2 -2
- package/dist/{application-BwevrnLI.js.map → application-Ckae0K1T.js.map} +1 -1
- package/dist/application.d.ts +2 -2
- package/dist/application.js +1 -1
- package/dist/better-auth/apple-client-secret.js +1 -1
- package/dist/better-auth/auth-client.js +1 -1
- package/dist/better-auth/rate-limit.js +1 -1
- package/dist/better-auth.js +1 -1
- package/dist/billing/client.js +1 -1
- package/dist/browser-support/floor.js +1 -1
- package/dist/browser-support/oxlint.js +1 -1
- package/dist/cloudflare/auth-secondary-storage.js +1 -1
- package/dist/cloudflare/durable-object-client.js +2 -2
- package/dist/cloudflare/durable-object-errors.js +1 -1
- package/dist/cloudflare/kv-client.js +2 -2
- package/dist/cloudflare/kv-errors.js +1 -1
- package/dist/cloudflare/queue.d.ts +1 -1
- package/dist/cloudflare/queue.js +2 -2
- package/dist/cloudflare/r2-client.js +2 -2
- package/dist/cloudflare/r2-errors.js +1 -1
- package/dist/cloudflare/rate-limiter.js +1 -1
- package/dist/cloudflare/scheduled.js +1 -1
- package/dist/cloudflare/turnstile.js +1 -1
- package/dist/cloudflare.d.ts +2 -2
- package/dist/cloudflare.js +3 -3
- package/dist/{core-CV8SQv01.js → core-CGj1ukXV.js} +2 -2
- package/dist/{core-CV8SQv01.js.map → core-CGj1ukXV.js.map} +1 -1
- package/dist/core.js +1 -1
- package/dist/{durable-object-errors-C7e7essH.js → durable-object-errors-BLGJplW-.js} +2 -2
- package/dist/{durable-object-errors-C7e7essH.js.map → durable-object-errors-BLGJplW-.js.map} +1 -1
- package/dist/{floor-BdRTO_LO.js → floor-DUb4oGQd.js} +2 -2
- package/dist/{floor-BdRTO_LO.js.map → floor-DUb4oGQd.js.map} +1 -1
- package/dist/http.js +2 -2
- package/dist/index-tJzJUgTh.d.ts.map +1 -1
- package/dist/{index-DIHLfC-p.d.ts → index-wNaxYvB2.d.ts} +2 -12
- package/dist/{index-DIHLfC-p.d.ts.map → index-wNaxYvB2.d.ts.map} +1 -1
- package/dist/{kv-errors-DXbnO7cB.js → kv-errors-dwVmCqER.js} +2 -2
- package/dist/{kv-errors-DXbnO7cB.js.map → kv-errors-dwVmCqER.js.map} +1 -1
- package/dist/{metrics-CdpccKGI.d.ts → metrics-iWktt1QT.d.ts} +2 -2
- package/dist/{metrics-CdpccKGI.d.ts.map → metrics-iWktt1QT.d.ts.map} +1 -1
- package/dist/{outbox-repository-options-BKapMX7X.js → outbox-repository-options-C3JVYiF4.js} +2 -2
- package/dist/{outbox-repository-options-BKapMX7X.js.map → outbox-repository-options-C3JVYiF4.js.map} +1 -1
- package/dist/{outbox-repository-options-BtAq0nAG.d.ts → outbox-repository-options-H-nJOB75.d.ts} +2 -2
- package/dist/{outbox-repository-options-BtAq0nAG.d.ts.map → outbox-repository-options-H-nJOB75.d.ts.map} +1 -1
- package/dist/{payment-service.error-oW2bKAfU.js → payment-service.error-o6vkwolM.js} +2 -2
- package/dist/{payment-service.error-oW2bKAfU.js.map → payment-service.error-o6vkwolM.js.map} +1 -1
- package/dist/postgres.d.ts +2 -2
- package/dist/postgres.js +3 -3
- package/dist/posthog/metrics.d.ts +1 -1
- package/dist/posthog/server.d.ts +2 -2
- package/dist/posthog/server.js +1 -1
- package/dist/{r2-errors-DzpOvciV.js → r2-errors-DeIh9VWr.js} +2 -2
- package/dist/{r2-errors-DzpOvciV.js.map → r2-errors-DeIh9VWr.js.map} +1 -1
- package/dist/{request-C5k8ME_7.js → request-ChEhRhin.js} +2 -2
- package/dist/{request-C5k8ME_7.js.map → request-ChEhRhin.js.map} +1 -1
- package/dist/resend.d.ts +1 -1
- package/dist/resend.js +2 -2
- package/dist/sentry/client.js +1 -1
- package/dist/sentry/server.d.ts +1 -1
- package/dist/stripe/payment-service.error.js +1 -1
- package/dist/stripe/payment-service.js +1 -1
- package/dist/stripe/payment-webhook.js +1 -1
- package/dist/stripe/request.js +1 -1
- package/dist/tanstack.js +1 -1
- package/dist/testing/outbox-repository.d.ts +1 -1
- package/dist/testing/payment-service.js +1 -1
- package/dist/{webhook-verification-B8v3-LQ2.js → webhook-verification-BrjingvG.js} +2 -2
- package/dist/{webhook-verification-B8v3-LQ2.js.map → webhook-verification-BrjingvG.js.map} +1 -1
- package/package.json +1 -1
- package/src/application/index.ts +0 -1
- package/src/application/queue-or-rpc-publisher.ts +0 -6
- package/src/core/classify-failure.ts +2 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as isCloudflareOverloadedError, rt as AppError, v as isCloudflareRetryableError, x as isTransientTransportError } from "./core-
|
|
1
|
+
import { _ as isCloudflareOverloadedError, rt as AppError, v as isCloudflareRetryableError, x as isTransientTransportError } from "./core-CGj1ukXV.js";
|
|
2
2
|
|
|
3
3
|
//#region src/infrastructure/cloudflare/kv-errors.ts
|
|
4
4
|
/** Extract Typist's verified KV message formats, including nested causes. */
|
|
@@ -141,4 +141,4 @@ function getDeepErrorMessage(cause) {
|
|
|
141
141
|
|
|
142
142
|
//#endregion
|
|
143
143
|
export { isRetryableKVError as a, isKVPutRateLimitError as i, decideKVRetry as n, isTerminalKVError as o, extractKVMeta as r, isTransientKVError as s, KVError as t };
|
|
144
|
-
//# sourceMappingURL=kv-errors-
|
|
144
|
+
//# sourceMappingURL=kv-errors-dwVmCqER.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kv-errors-
|
|
1
|
+
{"version":3,"file":"kv-errors-dwVmCqER.js","names":[],"sources":["../src/infrastructure/cloudflare/kv-errors.ts"],"sourcesContent":["import {\n AppError,\n isCloudflareOverloadedError,\n isCloudflareRetryableError,\n isTransientTransportError,\n type FailureClassification,\n} from '@/core'\n\n/** KV operations recognized in binding error messages. */\nexport type KVOperation = 'get' | 'put' | 'delete' | 'list'\n\n/** KV failure kinds retained from Typist's binding tests. */\nexport type KVErrorKind =\n | 'invalid_key'\n | 'key_too_large'\n | 'invalid_expiration_ttl'\n | 'invalid_expiration'\n | 'invalid_cache_ttl'\n | 'invalid_list_limit'\n | 'value_too_large'\n | 'client_error'\n | 'rate_limited'\n | 'server_error'\n\n/** Evidence extracted from a KV error and its causes. */\nexport interface KVErrorMeta {\n kind: KVErrorKind\n message: string\n status?: number | undefined\n operation?: Uppercase<KVOperation> | undefined\n}\n\n/** Extract Typist's verified KV message formats, including nested causes. */\nexport function extractKVMeta(cause: unknown): KVErrorMeta | undefined {\n const message = getDeepErrorMessage(cause)\n if (!message) return undefined\n const statusMatch = message.match(/\\bKV\\s+(GET|PUT|DELETE|LIST)\\s+failed:\\s+(\\d{3})\\b/)\n // SAFETY: The regular expression permits only uppercase KV operation names in this capture.\n const operation = statusMatch?.[1] as Uppercase<KVOperation> | undefined\n const status = statusMatch ? Number(statusMatch[2]) : undefined\n\n if (/Key name cannot be empty/i.test(message)) {\n return { kind: 'invalid_key', message, status, operation }\n }\n if (/exceeds key length limit/i.test(message)) {\n return { kind: 'key_too_large', message, status, operation }\n }\n if (/Invalid expiration_ttl/i.test(message)) {\n return { kind: 'invalid_expiration_ttl', message, status, operation }\n }\n if (/Invalid expiration of/i.test(message)) {\n return { kind: 'invalid_expiration', message, status, operation }\n }\n if (/Invalid cache_ttl/i.test(message)) {\n return { kind: 'invalid_cache_ttl', message, status, operation }\n }\n if (/Invalid key_count_limit/i.test(message)) {\n return { kind: 'invalid_list_limit', message, status, operation }\n }\n if (/value.*(too large|exceeds)|exceeds.*value/i.test(message)) {\n return { kind: 'value_too_large', message, status, operation }\n }\n if (status === 429) return { kind: 'rate_limited', message, status, operation }\n if (status !== undefined && status >= 500) {\n return { kind: 'server_error', message, status, operation }\n }\n if (status !== undefined && status >= 400) {\n return { kind: 'client_error', message, status, operation }\n }\n return undefined\n}\n\n/** Identify recognized KV failures that another attempt cannot resolve. */\nexport function isTerminalKVError(cause: unknown): boolean {\n const meta = extractKVMeta(cause)\n if (!meta) return false\n if (meta.kind === 'rate_limited' || meta.kind === 'server_error') return false\n if (meta.status === 408) return false\n return true\n}\n\n/** Identify a PUT rate limit that requires at least one second before retrying. */\nexport function isKVPutRateLimitError(cause: unknown): boolean {\n const meta = extractKVMeta(cause)\n return meta?.operation === 'PUT' && meta.kind === 'rate_limited'\n}\n\n/** Identify PUT rate limits, server failures, and request timeouts. */\nexport function isTransientKVError(cause: unknown): boolean {\n const meta = extractKVMeta(cause)\n if (!meta) return false\n return isKVPutRateLimitError(cause) || meta.kind === 'server_error' || meta.status === 408\n}\n\n/** Apply Typist's KV, overload, platform, and transport checks in their original order. */\nexport function isRetryableKVError(cause: unknown): boolean {\n if (isTerminalKVError(cause)) return false\n if (isTransientKVError(cause)) return true\n if (isCloudflareOverloadedError(cause)) return false\n return isCloudflareRetryableError(cause) || isTransientTransportError(cause)\n}\n\n/** Return the existing retry decision and minimum delay in milliseconds. */\nexport function decideKVRetry(\n cause: unknown,\n): { retry: false } | { retry: true; retryAfterMs: number } {\n if (!isRetryableKVError(cause)) return { retry: false }\n return { retry: true, retryAfterMs: isKVPutRateLimitError(cause) ? 1_000 : 0 }\n}\n\n/** A final KV failure with Typist's diagnostics and Better Ship's error classification. */\nexport class KVError extends AppError {\n readonly _tag = 'KVError'\n readonly classification: FailureClassification\n retryable: boolean\n readonly operation: KVOperation\n readonly key?: string | undefined\n override readonly cause: unknown\n readonly kv?: KVErrorMeta | undefined\n readonly context: {\n operation: KVOperation\n key?: string | undefined\n kv?: KVErrorMeta | undefined\n }\n\n constructor(args: { operation: KVOperation; key?: string | undefined; cause: unknown }) {\n const kv = extractKVMeta(args.cause)\n const causeMessage = getDeepErrorMessage(args.cause) || String(args.cause)\n const keyContext = args.key === undefined ? '' : ` for key \"${args.key}\"`\n super(`KV ${args.operation} failed${keyContext}: ${causeMessage}`, { cause: args.cause })\n this.operation = args.operation\n this.key = args.key\n this.cause = args.cause\n this.kv = kv\n this.context = { operation: args.operation, key: args.key, kv }\n this.retryable = isRetryableKVError(args.cause)\n this.classification = isTerminalKVError(args.cause)\n ? 'terminal'\n : this.retryable\n ? 'transient'\n : 'unknown'\n }\n}\n\n// oxlint-disable anti-slop/no-runtime-typeof -- Preserve Typist's primitive messages and nested causes at the raw binding boundary.\nfunction getDeepErrorMessage(cause: unknown): string {\n if (typeof cause === 'string') return cause\n if (cause === null || cause === undefined) return ''\n if (typeof cause === 'number' || typeof cause === 'boolean' || typeof cause === 'bigint') {\n return String(cause)\n }\n if (typeof cause !== 'object') return ''\n const message = 'message' in cause && typeof cause.message === 'string' ? cause.message : ''\n const causeMessage = 'cause' in cause ? getDeepErrorMessage(cause.cause) : ''\n return `${message} ${causeMessage}`.trim()\n}\n// oxlint-enable anti-slop/no-runtime-typeof\n"],"mappings":"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"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { nt as MetricOptions, rt as MetricsService } from "./index-wNaxYvB2.js";
|
|
2
2
|
import { PostHog } from "posthog-node";
|
|
3
3
|
//#region src/infrastructure/posthog/metrics.d.ts
|
|
4
4
|
/** PostHog Metrics with Worker lifetime management, ported from Typist's metrics-service.ts. */
|
|
@@ -16,4 +16,4 @@ declare class PostHogMetricsService implements MetricsService {
|
|
|
16
16
|
}
|
|
17
17
|
//#endregion
|
|
18
18
|
export { PostHogMetricsService as t };
|
|
19
|
-
//# sourceMappingURL=metrics-
|
|
19
|
+
//# sourceMappingURL=metrics-iWktt1QT.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metrics-
|
|
1
|
+
{"version":3,"file":"metrics-iWktt1QT.d.ts","names":[],"sources":["../src/infrastructure/posthog/metrics.ts"],"mappings":";;;;cAKa,iCAAiC;mBAGzB;mBACA;;EAFnB,YACmB,QAAQ,KAAK,qBACb,YAAY,SAAS;;EAIxC,MAAM,cAAc,gBAAW,UAAU;;EAMzC,MAAM,cAAc,eAAe,UAAU;;EAM7C,UAAU,cAAc,eAAe,UAAU"}
|
package/dist/{outbox-repository-options-BKapMX7X.js → outbox-repository-options-C3JVYiF4.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as UnitOfWorkAlreadyActiveError } from "./application-
|
|
1
|
+
import { t as UnitOfWorkAlreadyActiveError } from "./application-Ckae0K1T.js";
|
|
2
2
|
import { panic } from "better-result";
|
|
3
3
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
4
4
|
|
|
@@ -50,4 +50,4 @@ const OUTBOX_REPOSITORY_DEFAULTS = { leaseMs: 6e4 };
|
|
|
50
50
|
|
|
51
51
|
//#endregion
|
|
52
52
|
export { stageD1Statement as a, runWithUnitOfWorkContext as i, collectD1Statements as n, eventCollector as r, OUTBOX_REPOSITORY_DEFAULTS as t };
|
|
53
|
-
//# sourceMappingURL=outbox-repository-options-
|
|
53
|
+
//# sourceMappingURL=outbox-repository-options-C3JVYiF4.js.map
|
package/dist/{outbox-repository-options-BKapMX7X.js.map → outbox-repository-options-C3JVYiF4.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"outbox-repository-options-
|
|
1
|
+
{"version":3,"file":"outbox-repository-options-C3JVYiF4.js","names":[],"sources":["../src/infrastructure/unit-of-work-context.ts","../src/infrastructure/outbox-repository-options.ts"],"sourcesContent":["import { AsyncLocalStorage } from 'node:async_hooks'\n\nimport { panic } from 'better-result'\nimport type { BatchItem } from 'drizzle-orm/batch'\n\nimport { UnitOfWorkAlreadyActiveError, type IEventCollector } from '@/application'\nimport type { DomainEvent } from '@/core'\n\ntype UnitOfWorkContext = { readonly events: DomainEvent[] } & (\n | { readonly database: 'd1'; readonly statements: BatchItem<'sqlite'>[] }\n | { readonly database: 'postgres' }\n)\n\n// One async scope isolates events and D1 statements and rejects nesting across both adapters.\nconst storage = new AsyncLocalStorage<UnitOfWorkContext>()\n\n/** Reject nested transactions before database work starts; preserve independent concurrent execution. */\nexport async function runWithUnitOfWorkContext<T>(\n database: UnitOfWorkContext['database'],\n work: () => Promise<T>,\n): Promise<T> {\n if (storage.getStore() !== undefined) throw new UnitOfWorkAlreadyActiveError()\n const context: UnitOfWorkContext =\n database === 'd1' ? { database, events: [], statements: [] } : { database, events: [] }\n return storage.run(context, work)\n}\n\n/** Inject this shared scope into the unit of work and expose its emitter to application handlers. */\nexport const eventCollector: IEventCollector = {\n emit(event) {\n currentContext().events.push(event)\n },\n collect() {\n return [...currentContext().events]\n },\n}\n\n/** Queue one native D1 statement for the active batch; other contexts cannot accept D1 writes. */\nexport function stageD1Statement(statement: BatchItem<'sqlite'>): void {\n d1Context().statements.push(statement)\n}\n\n/** Read the active D1 batch in staging order for commit. */\nexport function collectD1Statements(): ReadonlyArray<BatchItem<'sqlite'>> {\n return [...d1Context().statements]\n}\n\nfunction d1Context(): Extract<UnitOfWorkContext, { database: 'd1' }> {\n const context = currentContext()\n if (context.database !== 'd1') return panic('D1 statements require a D1 unit of work')\n return context\n}\n\nfunction currentContext(): UnitOfWorkContext {\n return storage.getStore() ?? panic('operation requires an active unit of work')\n}\n","/** Shared lease default for both database adapters. */\nexport const OUTBOX_REPOSITORY_DEFAULTS = {\n leaseMs: 60_000,\n}\n\n/** Override the lease length at the composition root. */\nexport type OutboxRepositoryOptions = Readonly<Partial<typeof OUTBOX_REPOSITORY_DEFAULTS>>\n"],"mappings":";;;;;AAcA,MAAM,UAAU,IAAI,kBAAqC;;AAGzD,eAAsB,yBACpB,UACA,MACY;CACZ,IAAI,QAAQ,SAAS,MAAM,QAAW,MAAM,IAAI,6BAA6B;CAC7E,MAAM,UACJ,aAAa,OAAO;EAAE;EAAU,QAAQ,CAAC;EAAG,YAAY,CAAC;CAAE,IAAI;EAAE;EAAU,QAAQ,CAAC;CAAE;CACxF,OAAO,QAAQ,IAAI,SAAS,IAAI;AAClC;;AAGA,MAAa,iBAAkC;CAC7C,KAAK,OAAO;EACV,eAAe,CAAC,CAAC,OAAO,KAAK,KAAK;CACpC;CACA,UAAU;EACR,OAAO,CAAC,GAAG,eAAe,CAAC,CAAC,MAAM;CACpC;AACF;;AAGA,SAAgB,iBAAiB,WAAsC;CACrE,UAAU,CAAC,CAAC,WAAW,KAAK,SAAS;AACvC;;AAGA,SAAgB,sBAA0D;CACxE,OAAO,CAAC,GAAG,UAAU,CAAC,CAAC,UAAU;AACnC;AAEA,SAAS,YAA4D;CACnE,MAAM,UAAU,eAAe;CAC/B,IAAI,QAAQ,aAAa,MAAM,OAAO,MAAM,yCAAyC;CACrF,OAAO;AACT;AAEA,SAAS,iBAAoC;CAC3C,OAAO,QAAQ,SAAS,KAAK,MAAM,2CAA2C;AAChF;;;;;ACtDA,MAAa,6BAA6B,EACxC,SAAS,IACX"}
|
package/dist/{outbox-repository-options-BtAq0nAG.d.ts → outbox-repository-options-H-nJOB75.d.ts}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./index-tJzJUgTh.js";
|
|
2
|
-
import {
|
|
2
|
+
import { z as IEventCollector } from "./index-wNaxYvB2.js";
|
|
3
3
|
import { BatchItem } from "drizzle-orm/batch";
|
|
4
4
|
//#region src/infrastructure/drizzle-schema.d.ts
|
|
5
5
|
/**
|
|
@@ -21,4 +21,4 @@ declare const OUTBOX_REPOSITORY_DEFAULTS: {
|
|
|
21
21
|
type OutboxRepositoryOptions = Readonly<Partial<typeof OUTBOX_REPOSITORY_DEFAULTS>>;
|
|
22
22
|
//#endregion
|
|
23
23
|
export { eventCollector as n, DrizzleSchema as r, OutboxRepositoryOptions as t };
|
|
24
|
-
//# sourceMappingURL=outbox-repository-options-
|
|
24
|
+
//# sourceMappingURL=outbox-repository-options-H-nJOB75.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"outbox-repository-options-
|
|
1
|
+
{"version":3,"file":"outbox-repository-options-H-nJOB75.d.ts","names":[],"sources":["../src/infrastructure/drizzle-schema.ts","../src/infrastructure/unit-of-work-context.ts","../src/infrastructure/outbox-repository-options.ts"],"mappings":";;;;;;;;KAKY,gBAAgB;;;;cCuBf,gBAAgB;;;;cC3BhB;EACX;;;KAIU,0BAA0B,SAAS,eAAe"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { rt as AppError } from "./core-
|
|
1
|
+
import { rt as AppError } from "./core-CGj1ukXV.js";
|
|
2
2
|
import Stripe from "stripe";
|
|
3
3
|
|
|
4
4
|
//#region src/infrastructure/stripe/payment-service.error.ts
|
|
@@ -27,4 +27,4 @@ function classifyStripeError(error) {
|
|
|
27
27
|
|
|
28
28
|
//#endregion
|
|
29
29
|
export { PaymentServiceError as t };
|
|
30
|
-
//# sourceMappingURL=payment-service.error-
|
|
30
|
+
//# sourceMappingURL=payment-service.error-o6vkwolM.js.map
|
package/dist/{payment-service.error-oW2bKAfU.js.map → payment-service.error-o6vkwolM.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payment-service.error-
|
|
1
|
+
{"version":3,"file":"payment-service.error-o6vkwolM.js","names":[],"sources":["../src/infrastructure/stripe/payment-service.error.ts"],"sourcesContent":["import Stripe from 'stripe'\n\nimport { AppError, type FailureClassification } from '@/core'\n\n/** A final Stripe request failure. The caller logs once; native details remain in cause. */\nexport class PaymentServiceError extends AppError {\n readonly _tag = 'PaymentServiceError'\n readonly classification: FailureClassification\n\n /** Classify the final SDK error without scheduling another payment attempt. */\n constructor(\n readonly operation: string,\n cause: Stripe.errors.StripeError,\n ) {\n super(`Stripe request failed: ${operation}`, { cause })\n this.classification = classifyStripeError(cause)\n }\n}\n\nfunction classifyStripeError(error: Stripe.errors.StripeError): FailureClassification {\n if (error.headers?.['stripe-should-retry'] === 'false') return 'terminal'\n const status = error.statusCode\n if (status !== undefined && status >= 400 && status < 500 && status !== 409 && status !== 429)\n return 'terminal'\n if (\n error instanceof Stripe.errors.StripeAuthenticationError ||\n error instanceof Stripe.errors.StripePermissionError ||\n error instanceof Stripe.errors.StripeInvalidRequestError ||\n error instanceof Stripe.errors.StripeIdempotencyError ||\n error instanceof Stripe.errors.StripeCardError\n )\n return 'terminal'\n if (error.headers?.['stripe-should-retry'] === 'true') return 'transient'\n if (status === 409 || status === 429 || (status !== undefined && status >= 500))\n return 'transient'\n if (\n error instanceof Stripe.errors.StripeConnectionError ||\n error instanceof Stripe.errors.StripeAPIError ||\n error instanceof Stripe.errors.StripeRateLimitError\n )\n return 'transient'\n return 'unknown'\n}\n"],"mappings":";;;;;AAKA,IAAa,sBAAb,cAAyC,SAAS;CAMrC;CALX,AAAS,OAAO;CAChB,AAAS;;CAGT,YACE,AAAS,WACT,OACA;EACA,MAAM,0BAA0B,aAAa,EAAE,MAAM,CAAC;EAH7C;EAIT,KAAK,iBAAiB,oBAAoB,KAAK;CACjD;AACF;AAEA,SAAS,oBAAoB,OAAyD;CACpF,IAAI,MAAM,UAAU,2BAA2B,SAAS,OAAO;CAC/D,MAAM,SAAS,MAAM;CACrB,IAAI,WAAW,UAAa,UAAU,OAAO,SAAS,OAAO,WAAW,OAAO,WAAW,KACxF,OAAO;CACT,IACE,iBAAiB,OAAO,OAAO,6BAC/B,iBAAiB,OAAO,OAAO,yBAC/B,iBAAiB,OAAO,OAAO,6BAC/B,iBAAiB,OAAO,OAAO,0BAC/B,iBAAiB,OAAO,OAAO,iBAE/B,OAAO;CACT,IAAI,MAAM,UAAU,2BAA2B,QAAQ,OAAO;CAC9D,IAAI,WAAW,OAAO,WAAW,OAAQ,WAAW,UAAa,UAAU,KACzE,OAAO;CACT,IACE,iBAAiB,OAAO,OAAO,yBAC/B,iBAAiB,OAAO,OAAO,kBAC/B,iBAAiB,OAAO,OAAO,sBAE/B,OAAO;CACT,OAAO;AACT"}
|
package/dist/postgres.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { J as DomainEvent, Qt as AppError, Z as MessageId, at as DatabaseError, ot as DatabaseFailure } from "./index-tJzJUgTh.js";
|
|
2
|
-
import {
|
|
3
|
-
import { n as eventCollector, r as DrizzleSchema, t as OutboxRepositoryOptions } from "./outbox-repository-options-
|
|
2
|
+
import { I as ITransaction, R as IMessageStore, d as IOutboxRepository, h as OutboxRow, m as OutboxFailureReason, p as OutboxBatch } from "./index-wNaxYvB2.js";
|
|
3
|
+
import { n as eventCollector, r as DrizzleSchema, t as OutboxRepositoryOptions } from "./outbox-repository-options-H-nJOB75.js";
|
|
4
4
|
import { ExtractTablesWithRelations } from "drizzle-orm";
|
|
5
5
|
import { NodePgDatabase, NodePgTransaction } from "drizzle-orm/node-postgres";
|
|
6
6
|
import { Pool } from "pg";
|
package/dist/postgres.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A as DatabaseError, rt as AppError } from "./core-
|
|
2
|
-
import { s as MessageAlreadyProcessedError } from "./application-
|
|
3
|
-
import { i as runWithUnitOfWorkContext, r as eventCollector, t as OUTBOX_REPOSITORY_DEFAULTS } from "./outbox-repository-options-
|
|
1
|
+
import { A as DatabaseError, rt as AppError } from "./core-CGj1ukXV.js";
|
|
2
|
+
import { s as MessageAlreadyProcessedError } from "./application-Ckae0K1T.js";
|
|
3
|
+
import { i as runWithUnitOfWorkContext, r as eventCollector, t as OUTBOX_REPOSITORY_DEFAULTS } from "./outbox-repository-options-C3JVYiF4.js";
|
|
4
4
|
import { Result } from "better-result";
|
|
5
5
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
6
6
|
import { DrizzleQueryError } from "drizzle-orm/errors";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as PostHogMetricsService } from "../metrics-
|
|
1
|
+
import { t as PostHogMetricsService } from "../metrics-iWktt1QT.js";
|
|
2
2
|
export { PostHogMetricsService };
|
package/dist/posthog/server.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Jt as AnalyticsProperties, Xt as AnalyticsTarget, qt as AnalyticsEventInput } from "../index-tJzJUgTh.js";
|
|
2
|
-
import {
|
|
3
|
-
import { t as PostHogMetricsService } from "../metrics-
|
|
2
|
+
import { ot as AnalyticsService } from "../index-wNaxYvB2.js";
|
|
3
|
+
import { t as PostHogMetricsService } from "../metrics-iWktt1QT.js";
|
|
4
4
|
import { PostHog, PostHogOptions } from "posthog-node";
|
|
5
5
|
//#region src/infrastructure/posthog/server.d.ts
|
|
6
6
|
/** Deployment values and SDK options; the runtime owns delivery promises. */
|
package/dist/posthog/server.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { nt as MissingConfigurationError } from "../core-
|
|
1
|
+
import { nt as MissingConfigurationError } from "../core-CGj1ukXV.js";
|
|
2
2
|
import { t as PostHogMetricsService } from "../metrics-CWv37yf9.js";
|
|
3
3
|
import { v5, validate } from "uuid";
|
|
4
4
|
import { PostHog } from "posthog-node";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as isAbortError, f as classifyBoundaryError, rt as AppError } from "./core-
|
|
1
|
+
import { b as isAbortError, f as classifyBoundaryError, rt as AppError } from "./core-CGj1ukXV.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
|
|
4
4
|
//#region src/infrastructure/cloudflare/r2-errors.ts
|
|
@@ -87,4 +87,4 @@ var R2JsonError = class extends AppError {
|
|
|
87
87
|
|
|
88
88
|
//#endregion
|
|
89
89
|
export { R2JsonError as n, R2Error as t };
|
|
90
|
-
//# sourceMappingURL=r2-errors-
|
|
90
|
+
//# sourceMappingURL=r2-errors-DeIh9VWr.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"r2-errors-
|
|
1
|
+
{"version":3,"file":"r2-errors-DeIh9VWr.js","names":[],"sources":["../src/infrastructure/cloudflare/r2-errors.ts"],"sourcesContent":["import { z } from 'zod'\n\nimport { AppError, classifyBoundaryError, isAbortError, type FailureClassification } from '@/core'\n\n/** The storage operation that failed. */\nexport type R2Operation =\n | 'head'\n | 'get'\n | 'getJson'\n | 'put'\n | 'delete'\n | 'list'\n | 'createMultipartUpload'\n | 'uploadPart'\n | 'complete'\n | 'abort'\n\n/** Provider diagnostics from the outer failure, without request bodies or credentials. */\nexport type R2Failure = {\n readonly code: number\n readonly action?: string | undefined\n}\n\nconst R2FailureSchema = z.object({\n code: z.number().int().positive(),\n action: z.string().optional(),\n})\n\n// R2 codes describe failures; the caller owns retry decisions and repeat safety.\nconst classifications: ReadonlyMap<number, FailureClassification> = new Map([\n [10001, 'transient'],\n [10043, 'transient'],\n [10054, 'transient'],\n [10058, 'transient'],\n [10013, 'transient'],\n [10002, 'terminal'],\n [10003, 'terminal'],\n [10018, 'terminal'],\n [10035, 'terminal'],\n [10042, 'terminal'],\n [10005, 'terminal'],\n [10006, 'terminal'],\n [10008, 'terminal'],\n [10009, 'terminal'],\n [10073, 'terminal'],\n [10007, 'terminal'],\n [10020, 'terminal'],\n [100100, 'terminal'],\n [10012, 'terminal'],\n [10069, 'terminal'],\n [10033, 'terminal'],\n [10014, 'terminal'],\n [10037, 'terminal'],\n [10039, 'terminal'],\n [10031, 'terminal'],\n [10011, 'terminal'],\n [10024, 'terminal'],\n [10025, 'terminal'],\n [10048, 'terminal'],\n])\n\nfunction extractR2Failure(cause: unknown): R2Failure | undefined {\n if (!(cause instanceof Error)) return undefined\n const parsed = R2FailureSchema.safeParse(cause)\n if (parsed.success) return parsed.data\n // Cloudflare documents the numeric suffix for bindings that omit structured fields.\n const match = /\\((\\d{5,6})\\)\\s*$/.exec(cause.message)\n return match?.[1] === undefined ? undefined : { code: Number(match[1]) }\n}\n\nfunction classifyR2Code(cause: unknown): FailureClassification | undefined {\n const failure = extractR2Failure(cause)\n return failure === undefined ? undefined : (classifications.get(failure.code) ?? 'unknown')\n}\n\nfunction classifyR2Error(cause: unknown): FailureClassification {\n if (isAbortError(cause)) return 'terminal'\n if (cause instanceof AppError) return cause.classification\n return classifyBoundaryError({ cause, classifyBoundary: classifyR2Code, includeCloudflare: true })\n}\n\n/** A raw binding failure after one attempt. Classification does not establish whether a mutation committed. */\nexport class R2Error extends AppError {\n readonly _tag = 'R2Error'\n readonly classification: FailureClassification\n readonly operation: R2Operation\n readonly r2?: R2Failure | undefined\n override readonly cause: unknown\n\n constructor(input: { operation: R2Operation; cause: unknown }) {\n super(`R2 ${input.operation} failed`, { cause: input.cause })\n this.operation = input.operation\n this.cause = input.cause\n this.r2 = extractR2Failure(input.cause)\n this.classification = classifyR2Error(input.cause)\n }\n}\n\n/** JSON serialization or syntax failed. Binding and body-read failures use R2Error. */\nexport class R2JsonError extends AppError {\n readonly _tag = 'R2JsonError'\n readonly classification = 'terminal'\n readonly operation: 'encode' | 'decode'\n override readonly cause: unknown\n\n constructor(input: { operation: 'encode' | 'decode'; cause: unknown }) {\n super(`R2 JSON ${input.operation} failed`, { cause: input.cause })\n this.operation = input.operation\n this.cause = input.cause\n }\n}\n"],"mappings":";;;;AAuBA,MAAM,kBAAkB,EAAE,OAAO;CAC/B,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS;CAChC,QAAQ,EAAE,OAAO,CAAC,CAAC,SAAS;AAC9B,CAAC;AAGD,MAAM,kCAA8D,IAAI,IAAI;CAC1E,CAAC,OAAO,WAAW;CACnB,CAAC,OAAO,WAAW;CACnB,CAAC,OAAO,WAAW;CACnB,CAAC,OAAO,WAAW;CACnB,CAAC,OAAO,WAAW;CACnB,CAAC,OAAO,UAAU;CAClB,CAAC,OAAO,UAAU;CAClB,CAAC,OAAO,UAAU;CAClB,CAAC,OAAO,UAAU;CAClB,CAAC,OAAO,UAAU;CAClB,CAAC,OAAO,UAAU;CAClB,CAAC,OAAO,UAAU;CAClB,CAAC,OAAO,UAAU;CAClB,CAAC,OAAO,UAAU;CAClB,CAAC,OAAO,UAAU;CAClB,CAAC,OAAO,UAAU;CAClB,CAAC,OAAO,UAAU;CAClB,CAAC,QAAQ,UAAU;CACnB,CAAC,OAAO,UAAU;CAClB,CAAC,OAAO,UAAU;CAClB,CAAC,OAAO,UAAU;CAClB,CAAC,OAAO,UAAU;CAClB,CAAC,OAAO,UAAU;CAClB,CAAC,OAAO,UAAU;CAClB,CAAC,OAAO,UAAU;CAClB,CAAC,OAAO,UAAU;CAClB,CAAC,OAAO,UAAU;CAClB,CAAC,OAAO,UAAU;CAClB,CAAC,OAAO,UAAU;AACpB,CAAC;AAED,SAAS,iBAAiB,OAAuC;CAC/D,IAAI,EAAE,iBAAiB,QAAQ,OAAO;CACtC,MAAM,SAAS,gBAAgB,UAAU,KAAK;CAC9C,IAAI,OAAO,SAAS,OAAO,OAAO;CAElC,MAAM,QAAQ,oBAAoB,KAAK,MAAM,OAAO;CACpD,OAAO,QAAQ,OAAO,SAAY,SAAY,EAAE,MAAM,OAAO,MAAM,EAAE,EAAE;AACzE;AAEA,SAAS,eAAe,OAAmD;CACzE,MAAM,UAAU,iBAAiB,KAAK;CACtC,OAAO,YAAY,SAAY,SAAa,gBAAgB,IAAI,QAAQ,IAAI,KAAK;AACnF;AAEA,SAAS,gBAAgB,OAAuC;CAC9D,IAAI,aAAa,KAAK,GAAG,OAAO;CAChC,IAAI,iBAAiB,UAAU,OAAO,MAAM;CAC5C,OAAO,sBAAsB;EAAE;EAAO,kBAAkB;EAAgB,mBAAmB;CAAK,CAAC;AACnG;;AAGA,IAAa,UAAb,cAA6B,SAAS;CACpC,AAAS,OAAO;CAChB,AAAS;CACT,AAAS;CACT,AAAS;CACT,AAAkB;CAElB,YAAY,OAAmD;EAC7D,MAAM,MAAM,MAAM,UAAU,UAAU,EAAE,OAAO,MAAM,MAAM,CAAC;EAC5D,KAAK,YAAY,MAAM;EACvB,KAAK,QAAQ,MAAM;EACnB,KAAK,KAAK,iBAAiB,MAAM,KAAK;EACtC,KAAK,iBAAiB,gBAAgB,MAAM,KAAK;CACnD;AACF;;AAGA,IAAa,cAAb,cAAiC,SAAS;CACxC,AAAS,OAAO;CAChB,AAAS,iBAAiB;CAC1B,AAAS;CACT,AAAkB;CAElB,YAAY,OAA2D;EACrE,MAAM,WAAW,MAAM,UAAU,UAAU,EAAE,OAAO,MAAM,MAAM,CAAC;EACjE,KAAK,YAAY,MAAM;EACvB,KAAK,QAAQ,MAAM;CACrB;AACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as PaymentServiceError } from "./payment-service.error-
|
|
1
|
+
import { t as PaymentServiceError } from "./payment-service.error-o6vkwolM.js";
|
|
2
2
|
import Stripe from "stripe";
|
|
3
3
|
|
|
4
4
|
//#region src/infrastructure/stripe/request.ts
|
|
@@ -18,4 +18,4 @@ async function stripeRequest(operation, work) {
|
|
|
18
18
|
|
|
19
19
|
//#endregion
|
|
20
20
|
export { stripeRequest as t };
|
|
21
|
-
//# sourceMappingURL=request-
|
|
21
|
+
//# sourceMappingURL=request-ChEhRhin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-
|
|
1
|
+
{"version":3,"file":"request-ChEhRhin.js","names":[],"sources":["../src/infrastructure/stripe/request.ts"],"sourcesContent":["import Stripe from 'stripe'\n\nimport { PaymentServiceError } from './payment-service.error.ts'\n\n/**\n * Invoke one SDK operation; the SDK owns retries configured on its client or request.\n * Convert every Stripe error to PaymentServiceError without logging; preserve the original error in cause.\n * Non-Stripe failures propagate unchanged.\n */\nexport async function stripeRequest<T>(operation: string, work: () => Promise<T>): Promise<T> {\n try {\n return await work()\n } catch (cause) {\n if (!(cause instanceof Stripe.errors.StripeError)) throw cause\n throw new PaymentServiceError(operation, cause)\n }\n}\n"],"mappings":";;;;;;;;;AASA,eAAsB,cAAiB,WAAmB,MAAoC;CAC5F,IAAI;EACF,OAAO,MAAM,KAAK;CACpB,SAAS,OAAO;EACd,IAAI,EAAE,iBAAiB,OAAO,OAAO,cAAc,MAAM;EACzD,MAAM,IAAI,oBAAoB,WAAW,KAAK;CAChD;AACF"}
|
package/dist/resend.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Ft as BounceType } from "./index-tJzJUgTh.js";
|
|
2
|
-
import {
|
|
2
|
+
import { B as EmailAccepted, H as IEmailService, K as ReceivedContent, W as OutboundEmail, q as ReceivedEmail } from "./index-wNaxYvB2.js";
|
|
3
3
|
import { n as WebhookVerifier } from "./webhook-verification-Cy4Z5djk.js";
|
|
4
4
|
import "resend";
|
|
5
5
|
//#region src/infrastructure/resend/resend-email-service.d.ts
|
package/dist/resend.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Q as EmailServiceError, X as parseBounceType, tt as EmailAddressSchema } from "./core-
|
|
2
|
-
import { t as WebhookVerificationError } from "./webhook-verification-
|
|
1
|
+
import { Q as EmailServiceError, X as parseBounceType, tt as EmailAddressSchema } from "./core-CGj1ukXV.js";
|
|
2
|
+
import { t as WebhookVerificationError } from "./webhook-verification-BrjingvG.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { Buffer } from "node:buffer";
|
|
5
5
|
|
package/dist/sentry/client.js
CHANGED
package/dist/sentry/server.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { u as LoggerErrorHook } from "../index-tJzJUgTh.js";
|
|
2
|
-
import { $ as
|
|
2
|
+
import { $ as ObservabilityUser, Q as ObservabilityService, Z as ObservabilityScope } from "../index-wNaxYvB2.js";
|
|
3
3
|
import * as Sentry from "@sentry/cloudflare";
|
|
4
4
|
//#region src/infrastructure/sentry/server.d.ts
|
|
5
5
|
/** Application-owned deployment settings with the full Cloudflare SDK option contract. */
|
package/dist/stripe/request.js
CHANGED
package/dist/tanstack.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as ValidationError, K as AuthenticationError, W as StaleSessionError, r as createLogger, rt as AppError } from "./core-
|
|
1
|
+
import { B as ValidationError, K as AuthenticationError, W as StaleSessionError, r as createLogger, rt as AppError } from "./core-CGj1ukXV.js";
|
|
2
2
|
import { t as applyObservabilityUser } from "./request-user-B4rh1c2-.js";
|
|
3
3
|
import { n as withSpan } from "./tracing-C_7B_odV.js";
|
|
4
4
|
import { z } from "zod";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { J as DomainEvent } from "../index-tJzJUgTh.js";
|
|
2
|
-
import {
|
|
2
|
+
import { d as IOutboxRepository } from "../index-wNaxYvB2.js";
|
|
3
3
|
//#region src/infrastructure/testing/outbox-repository-contract.d.ts
|
|
4
4
|
/** Stored fields observed by the adapter contract, independent of a database library. */
|
|
5
5
|
export type OutboxContractRow = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as PaymentServiceError } from "../payment-service.error-
|
|
1
|
+
import { t as PaymentServiceError } from "../payment-service.error-o6vkwolM.js";
|
|
2
2
|
import { t as stripeFixture } from "../stripe-fixture-11EmnD6F.js";
|
|
3
3
|
import Stripe from "stripe";
|
|
4
4
|
import { deepStrictEqual, equal, ok, rejects } from "node:assert/strict";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { rt as AppError } from "./core-
|
|
1
|
+
import { rt as AppError } from "./core-CGj1ukXV.js";
|
|
2
2
|
|
|
3
3
|
//#region src/infrastructure/http/webhook-verification.ts
|
|
4
4
|
/** A webhook cannot be trusted or parsed. The HTTP handler logs the rejection once. */
|
|
@@ -15,4 +15,4 @@ var WebhookVerificationError = class extends AppError {
|
|
|
15
15
|
|
|
16
16
|
//#endregion
|
|
17
17
|
export { WebhookVerificationError as t };
|
|
18
|
-
//# sourceMappingURL=webhook-verification-
|
|
18
|
+
//# sourceMappingURL=webhook-verification-BrjingvG.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhook-verification-
|
|
1
|
+
{"version":3,"file":"webhook-verification-BrjingvG.js","names":[],"sources":["../src/infrastructure/http/webhook-verification.ts"],"sourcesContent":["import { AppError } from '@/core'\n\n/** A webhook cannot be trusted or parsed. The HTTP handler logs the rejection once. */\nexport class WebhookVerificationError extends AppError {\n readonly _tag = 'WebhookVerificationError'\n readonly classification = 'terminal'\n\n /** Keep secrets and payload details out of the public message. */\n constructor(\n readonly reason: 'missing_headers' | 'invalid_signature' | 'invalid_payload',\n cause?: unknown,\n ) {\n super(`Webhook rejected: ${reason}`, { cause })\n }\n}\n\n/** The provider owns signature verification, timestamp tolerance, and payload parsing. */\nexport interface WebhookVerifier<Verified> {\n /**\n * Verify the exact body before parsing it. Return null for an ignored webhook.\n * @throws WebhookVerificationError when the request cannot be trusted or parsed.\n */\n verify(body: string, headers: Headers): Promise<Verified | null>\n}\n"],"mappings":";;;;AAGA,IAAa,2BAAb,cAA8C,SAAS;CAM1C;CALX,AAAS,OAAO;CAChB,AAAS,iBAAiB;;CAG1B,YACE,AAAS,QACT,OACA;EACA,MAAM,qBAAqB,UAAU,EAAE,MAAM,CAAC;EAHrC;CAIX;AACF"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://www.schemastore.org/package.json",
|
|
3
3
|
"name": "better-ship",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.43.0",
|
|
5
5
|
"description": "Foundation for applications on Cloudflare Workers: logger, errors, message bus, infrastructure adapters, and UI primitives",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"repository": {
|
package/src/application/index.ts
CHANGED
|
@@ -43,7 +43,6 @@ export { OutboxRelay, type OutboxRelayOptions } from './outbox-relay.ts'
|
|
|
43
43
|
export type { IOutboxPublisher, RejectedMessage } from './outbox-publisher.ts'
|
|
44
44
|
export {
|
|
45
45
|
QueueOrRpcPublisher,
|
|
46
|
-
type ConsumeResult,
|
|
47
46
|
type IEventConsumerClient,
|
|
48
47
|
type QueueOrRpcPublisherOptions,
|
|
49
48
|
} from './queue-or-rpc-publisher.ts'
|
|
@@ -7,12 +7,6 @@ export interface IEventConsumerClient {
|
|
|
7
7
|
consume(event: DomainEvent): Promise<void>
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
/**
|
|
11
|
-
* What an RPC event consumer returns. It returns a failure instead of throwing it: the outbox owns
|
|
12
|
-
* the retries, and a throw from an RPC method is reported to Sentry on every attempt.
|
|
13
|
-
*/
|
|
14
|
-
export type ConsumeResult = { readonly ok: true } | { readonly ok: false; readonly error: unknown }
|
|
15
|
-
|
|
16
10
|
/** The two clients, the app's rule for choosing between them, and the RPC budget. */
|
|
17
11
|
export type QueueOrRpcPublisherOptions = {
|
|
18
12
|
readonly queue: IOutboxPublisher
|
|
@@ -57,7 +57,8 @@ export function classifyFailure(cause: unknown): FailureClassification {
|
|
|
57
57
|
const remote = RemoteAppErrorSchema.safeParse(cause)
|
|
58
58
|
if (cause instanceof Error && remote.success) return remote.data.classification
|
|
59
59
|
if (isAbortError(cause)) return 'terminal'
|
|
60
|
-
if (isTransientCloudflareRuntimeError(cause))
|
|
60
|
+
if (isCloudflareRetryableError(cause) || isTransientCloudflareRuntimeError(cause))
|
|
61
|
+
return 'transient'
|
|
61
62
|
return 'unknown'
|
|
62
63
|
}
|
|
63
64
|
|