@temporary-name/server 1.9.3-alpha.205fb2d0874fa3b8bbf83112a63016937380442e → 1.9.3-alpha.25c9bb040aec8c367ea668ebd2fedbdb6ee024ff
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/adapters/aws-lambda/index.d.mts +2 -2
- package/dist/adapters/aws-lambda/index.d.ts +2 -2
- package/dist/adapters/aws-lambda/index.mjs +3 -3
- package/dist/adapters/fetch/index.d.mts +2 -2
- package/dist/adapters/fetch/index.d.ts +2 -2
- package/dist/adapters/fetch/index.mjs +3 -3
- package/dist/adapters/node/index.d.mts +2 -2
- package/dist/adapters/node/index.d.ts +2 -2
- package/dist/adapters/node/index.mjs +3 -3
- package/dist/handler/index.d.mts +2 -2
- package/dist/handler/index.d.ts +2 -2
- package/dist/handler/index.mjs +3 -3
- package/dist/index.d.mts +2 -3
- package/dist/index.d.ts +2 -3
- package/dist/index.mjs +9 -10
- package/dist/openapi/index.d.mts +1 -1
- package/dist/openapi/index.d.ts +1 -1
- package/dist/openapi/index.mjs +5 -5
- package/dist/shared/{server.BGG3eatg.mjs → server.0XttqWC4.mjs} +31 -7
- package/dist/shared/{server.X8F6e8eV.mjs → server.BT6UIZKq.mjs} +63 -130
- package/dist/shared/{server.Coz0LFSE.d.ts → server.CDPDcFfG.d.ts} +1 -1
- package/dist/shared/{server.CmNVzZVe.mjs → server.CqRXKroQ.mjs} +1 -1
- package/dist/shared/{server.BM9lK_Yv.mjs → server.gacqwfQ1.mjs} +1 -1
- package/dist/shared/{server.BxyeakF-.d.mts → server.pPvU6DyC.d.mts} +1 -1
- package/dist/shared/{server.B5ntjz_x.d.mts → server.yrTiAhAF.d.mts} +76 -361
- package/dist/shared/{server.B5ntjz_x.d.ts → server.yrTiAhAF.d.ts} +76 -361
- package/package.json +8 -8
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MaybeOptionalOptions } from '@temporary-name/shared';
|
|
2
2
|
import { SendStandardResponseOptions, APIGatewayProxyEventV2, ResponseStream } from '@temporary-name/standard-server-aws-lambda';
|
|
3
|
-
import { C as Context, m as Router } from '../../shared/server.
|
|
4
|
-
import { F as FriendlyStandardHandleOptions } from '../../shared/server.
|
|
3
|
+
import { C as Context, m as Router } from '../../shared/server.yrTiAhAF.mjs';
|
|
4
|
+
import { F as FriendlyStandardHandleOptions } from '../../shared/server.pPvU6DyC.mjs';
|
|
5
5
|
import '@temporary-name/zod';
|
|
6
6
|
|
|
7
7
|
interface AwsLambdaHandlerOptions extends SendStandardResponseOptions {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MaybeOptionalOptions } from '@temporary-name/shared';
|
|
2
2
|
import { SendStandardResponseOptions, APIGatewayProxyEventV2, ResponseStream } from '@temporary-name/standard-server-aws-lambda';
|
|
3
|
-
import { C as Context, m as Router } from '../../shared/server.
|
|
4
|
-
import { F as FriendlyStandardHandleOptions } from '../../shared/server.
|
|
3
|
+
import { C as Context, m as Router } from '../../shared/server.yrTiAhAF.js';
|
|
4
|
+
import { F as FriendlyStandardHandleOptions } from '../../shared/server.CDPDcFfG.js';
|
|
5
5
|
import '@temporary-name/zod';
|
|
6
6
|
|
|
7
7
|
interface AwsLambdaHandlerOptions extends SendStandardResponseOptions {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { resolveMaybeOptionalOptions } from '@temporary-name/shared';
|
|
2
2
|
import { toStandardLazyRequest, sendStandardResponse } from '@temporary-name/standard-server-aws-lambda';
|
|
3
|
-
import { S as StandardHandler, r as resolveFriendlyStandardHandleOptions } from '../../shared/server.
|
|
3
|
+
import { S as StandardHandler, r as resolveFriendlyStandardHandleOptions } from '../../shared/server.0XttqWC4.mjs';
|
|
4
4
|
import '@temporary-name/server';
|
|
5
5
|
import '@temporary-name/standard-server';
|
|
6
|
-
import '../../shared/server.
|
|
6
|
+
import '../../shared/server.BT6UIZKq.mjs';
|
|
7
7
|
import 'rou3';
|
|
8
|
-
import '../../shared/server.
|
|
8
|
+
import '../../shared/server.CqRXKroQ.mjs';
|
|
9
9
|
import '@temporary-name/zod';
|
|
10
10
|
|
|
11
11
|
class AwsLambdaHandler {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MaybeOptionalOptions } from '@temporary-name/shared';
|
|
2
2
|
import { ToFetchResponseOptions } from '@temporary-name/standard-server-fetch';
|
|
3
|
-
import { C as Context, m as Router } from '../../shared/server.
|
|
4
|
-
import { F as FriendlyStandardHandleOptions } from '../../shared/server.
|
|
3
|
+
import { C as Context, m as Router } from '../../shared/server.yrTiAhAF.mjs';
|
|
4
|
+
import { F as FriendlyStandardHandleOptions } from '../../shared/server.pPvU6DyC.mjs';
|
|
5
5
|
import '@temporary-name/zod';
|
|
6
6
|
|
|
7
7
|
type FetchHandleResult = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MaybeOptionalOptions } from '@temporary-name/shared';
|
|
2
2
|
import { ToFetchResponseOptions } from '@temporary-name/standard-server-fetch';
|
|
3
|
-
import { C as Context, m as Router } from '../../shared/server.
|
|
4
|
-
import { F as FriendlyStandardHandleOptions } from '../../shared/server.
|
|
3
|
+
import { C as Context, m as Router } from '../../shared/server.yrTiAhAF.js';
|
|
4
|
+
import { F as FriendlyStandardHandleOptions } from '../../shared/server.CDPDcFfG.js';
|
|
5
5
|
import '@temporary-name/zod';
|
|
6
6
|
|
|
7
7
|
type FetchHandleResult = {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { resolveMaybeOptionalOptions } from '@temporary-name/shared';
|
|
2
2
|
import { toStandardLazyRequest, toFetchResponse } from '@temporary-name/standard-server-fetch';
|
|
3
|
-
import { S as StandardHandler, r as resolveFriendlyStandardHandleOptions } from '../../shared/server.
|
|
3
|
+
import { S as StandardHandler, r as resolveFriendlyStandardHandleOptions } from '../../shared/server.0XttqWC4.mjs';
|
|
4
4
|
import '@temporary-name/server';
|
|
5
5
|
import '@temporary-name/standard-server';
|
|
6
|
-
import '../../shared/server.
|
|
6
|
+
import '../../shared/server.BT6UIZKq.mjs';
|
|
7
7
|
import 'rou3';
|
|
8
|
-
import '../../shared/server.
|
|
8
|
+
import '../../shared/server.CqRXKroQ.mjs';
|
|
9
9
|
import '@temporary-name/zod';
|
|
10
10
|
|
|
11
11
|
class FetchHandler {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MaybeOptionalOptions } from '@temporary-name/shared';
|
|
2
2
|
import { SendStandardResponseOptions, NodeHttpRequest, NodeHttpResponse } from '@temporary-name/standard-server-node';
|
|
3
|
-
import { C as Context, m as Router } from '../../shared/server.
|
|
4
|
-
import { F as FriendlyStandardHandleOptions } from '../../shared/server.
|
|
3
|
+
import { C as Context, m as Router } from '../../shared/server.yrTiAhAF.mjs';
|
|
4
|
+
import { F as FriendlyStandardHandleOptions } from '../../shared/server.pPvU6DyC.mjs';
|
|
5
5
|
import '@temporary-name/zod';
|
|
6
6
|
|
|
7
7
|
type NodeHttpHandleResult = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MaybeOptionalOptions } from '@temporary-name/shared';
|
|
2
2
|
import { SendStandardResponseOptions, NodeHttpRequest, NodeHttpResponse } from '@temporary-name/standard-server-node';
|
|
3
|
-
import { C as Context, m as Router } from '../../shared/server.
|
|
4
|
-
import { F as FriendlyStandardHandleOptions } from '../../shared/server.
|
|
3
|
+
import { C as Context, m as Router } from '../../shared/server.yrTiAhAF.js';
|
|
4
|
+
import { F as FriendlyStandardHandleOptions } from '../../shared/server.CDPDcFfG.js';
|
|
5
5
|
import '@temporary-name/zod';
|
|
6
6
|
|
|
7
7
|
type NodeHttpHandleResult = {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { resolveMaybeOptionalOptions } from '@temporary-name/shared';
|
|
2
2
|
import { toStandardLazyRequest, sendStandardResponse } from '@temporary-name/standard-server-node';
|
|
3
|
-
import { S as StandardHandler, r as resolveFriendlyStandardHandleOptions } from '../../shared/server.
|
|
3
|
+
import { S as StandardHandler, r as resolveFriendlyStandardHandleOptions } from '../../shared/server.0XttqWC4.mjs';
|
|
4
4
|
import '@temporary-name/server';
|
|
5
5
|
import '@temporary-name/standard-server';
|
|
6
|
-
import '../../shared/server.
|
|
6
|
+
import '../../shared/server.BT6UIZKq.mjs';
|
|
7
7
|
import 'rou3';
|
|
8
|
-
import '../../shared/server.
|
|
8
|
+
import '../../shared/server.CqRXKroQ.mjs';
|
|
9
9
|
import '@temporary-name/zod';
|
|
10
10
|
|
|
11
11
|
class NodeHttpHandler {
|
package/dist/handler/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { F as FriendlyStandardHandleOptions, S as StandardHandleOptions, a as StandardHandleResult, b as StandardHandler, d as decodeParams, r as resolveFriendlyStandardHandleOptions, t as toRou3Pattern } from '../shared/server.
|
|
1
|
+
export { F as FriendlyStandardHandleOptions, S as StandardHandleOptions, a as StandardHandleResult, b as StandardHandler, d as decodeParams, r as resolveFriendlyStandardHandleOptions, t as toRou3Pattern } from '../shared/server.pPvU6DyC.mjs';
|
|
2
2
|
import { AnyProcedure, AnyRouter } from '@temporary-name/server';
|
|
3
3
|
import { StandardLazyRequest, StandardResponse, HTTPPath } from '@temporary-name/shared';
|
|
4
|
-
import '../shared/server.
|
|
4
|
+
import '../shared/server.yrTiAhAF.mjs';
|
|
5
5
|
import '@temporary-name/zod';
|
|
6
6
|
|
|
7
7
|
declare function decode(request: StandardLazyRequest, pathParams: Record<string, string> | undefined): Promise<{
|
package/dist/handler/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { F as FriendlyStandardHandleOptions, S as StandardHandleOptions, a as StandardHandleResult, b as StandardHandler, d as decodeParams, r as resolveFriendlyStandardHandleOptions, t as toRou3Pattern } from '../shared/server.
|
|
1
|
+
export { F as FriendlyStandardHandleOptions, S as StandardHandleOptions, a as StandardHandleResult, b as StandardHandler, d as decodeParams, r as resolveFriendlyStandardHandleOptions, t as toRou3Pattern } from '../shared/server.CDPDcFfG.js';
|
|
2
2
|
import { AnyProcedure, AnyRouter } from '@temporary-name/server';
|
|
3
3
|
import { StandardLazyRequest, StandardResponse, HTTPPath } from '@temporary-name/shared';
|
|
4
|
-
import '../shared/server.
|
|
4
|
+
import '../shared/server.yrTiAhAF.js';
|
|
5
5
|
import '@temporary-name/zod';
|
|
6
6
|
|
|
7
7
|
declare function decode(request: StandardLazyRequest, pathParams: Record<string, string> | undefined): Promise<{
|
package/dist/handler/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { S as StandardHandler, a as StandardOpenAPIMatcher, d as decode, b as decodeParams, e as encode, r as resolveFriendlyStandardHandleOptions, t as toRou3Pattern } from '../shared/server.
|
|
1
|
+
export { S as StandardHandler, a as StandardOpenAPIMatcher, d as decode, b as decodeParams, e as encode, r as resolveFriendlyStandardHandleOptions, t as toRou3Pattern } from '../shared/server.0XttqWC4.mjs';
|
|
2
2
|
import '@temporary-name/shared';
|
|
3
|
-
import '../shared/server.
|
|
3
|
+
import '../shared/server.BT6UIZKq.mjs';
|
|
4
4
|
import '@temporary-name/zod';
|
|
5
|
-
import '../shared/server.
|
|
5
|
+
import '../shared/server.CqRXKroQ.mjs';
|
|
6
6
|
import '@temporary-name/standard-server';
|
|
7
7
|
import '@temporary-name/server';
|
|
8
8
|
import 'rou3';
|
package/dist/index.d.mts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import * as z from '@temporary-name/zod';
|
|
2
2
|
import { SchemaClass, core } from '@temporary-name/zod';
|
|
3
|
-
export { z as baseZ };
|
|
4
3
|
import * as zod_v4_core from 'zod/v4/core';
|
|
5
4
|
import { $input, $output } from 'zod/v4/core';
|
|
6
5
|
import { ClientContext, Value, Promisable, Client, MaybeOptionalOptions, HTTPEndpoint as HTTPEndpoint$1, IntersectPick, HTTPPath, AsyncIteratorClass, ClientOptions, HTTPMethod } from '@temporary-name/shared';
|
|
7
6
|
export { AsyncIteratorClass, ClientContext, EventPublisher, EventPublisherOptions, EventPublisherSubscribeIteratorOptions, HTTPMethod, HTTPPath, IntersectPick, asyncIteratorToStream as eventIteratorToStream, onError, onFinish, onStart, onSuccess, streamToAsyncIteratorClass as streamToEventIterator } from '@temporary-name/shared';
|
|
8
|
-
import { C as Context, S as Schemas, I as InferProcedureClientInputs, a as InferSchemaOutput, M as Meta, L as Lazyable, P as Procedure, b as Contract, A as AnyShape, c as MergedSchemas, W as WrapShape, U as UnionToIntersection, d as AnySchema, R as Route, e as Middleware, f as MergedCurrentContext, g as MergedInitialContext, E as ErrorMap, V as ValidatedAuthContext, h as AuthConfig, B as BuildContextWithAuth, i as ProcedureHandler, j as InferHandlerInputs, k as InferSchemaInput, l as EnhanceRouterOptions, m as Router, n as EnhancedRouter, o as MapInputMiddleware, p as ContractDef, q as Schema, r as AnyMiddleware, s as Lazy, t as AnyProcedure, u as SchemaIssue } from './shared/server.
|
|
9
|
-
export {
|
|
7
|
+
import { C as Context, S as Schemas, I as InferProcedureClientInputs, a as InferSchemaOutput, M as Meta, L as Lazyable, P as Procedure, b as Contract, A as AnyShape, c as MergedSchemas, W as WrapShape, U as UnionToIntersection, d as AnySchema, R as Route, e as Middleware, f as MergedCurrentContext, g as MergedInitialContext, E as ErrorMap, V as ValidatedAuthContext, h as AuthConfig, B as BuildContextWithAuth, i as ProcedureHandler, j as InferHandlerInputs, k as InferSchemaInput, l as EnhanceRouterOptions, m as Router, n as EnhancedRouter, o as MapInputMiddleware, p as ContractDef, q as Schema, r as AnyMiddleware, s as Lazy, t as AnyProcedure, u as SchemaIssue } from './shared/server.yrTiAhAF.mjs';
|
|
8
|
+
export { av as AccessibleLazyRouter, ak as AnyContractDef, ao as AnyRouter, z as ApiError, y as ApiErrorStatic, a0 as BadGatewayError, D as BadRequestError, O as ConflictError, T as ContentTooLargeError, aA as ContractProcedureCallbackOptions, an as ContractRouter, G as ForbiddenError, a2 as GatewayTimeoutError, ar as InferRouterCurrentContexts, ap as InferRouterInitialContext, aq as InferRouterInitialContexts, as as InferRouterInputs, at as InferRouterOutputs, aI as InitialSchemas, _ as InternalServerError, a6 as LAZY_SYMBOL, a7 as LazyMeta, aB as LazyTraverseContractProceduresOptions, H as MethodNotAllowedError, af as MiddlewareNextFn, ah as MiddlewareOptions, ag as MiddlewareOutputFn, ae as MiddlewareResult, J as NotAcceptableError, N as NotFoundError, $ as NotImplementedError, Q as PreconditionFailedError, al as ProcedureDef, aj as ProcedureHandlerOptions, K as RequestTimeoutError, a1 as ServiceUnavailableError, Z as TooManyRequestsError, az as TraverseContractProcedureCallbackOptions, ay as TraverseContractProceduresOptions, aG as TypeRest, F as UnauthorizedError, aE as UnlaziedRouter, Y as UnprocessableContentError, X as UnsupportedMediaTypeError, x as ValidationError, w as ValidationErrorOptions, aw as createAccessibleLazyRouter, a5 as encodeError, ax as enhanceRouter, ab as getLazyMeta, au as getRouter, aH as initialSchemas, a3 as isApiErrorStatus, aa as isLazy, am as isProcedure, a9 as lazy, a8 as lazyInternal, v as mergeCurrentContext, ad as mergeMeta, ai as middlewareOutputFn, aD as resolveContractProcedures, a4 as toApiError, aC as traverseContractProcedures, ac as unlazy, aF as unlazyRouter } from './shared/server.yrTiAhAF.mjs';
|
|
10
9
|
import * as Draft07 from '@temporary-name/interop/json-schema-typed/draft-07';
|
|
11
10
|
import * as Draft2019 from '@temporary-name/interop/json-schema-typed/draft-2019-09';
|
|
12
11
|
import * as Draft2020 from '@temporary-name/interop/json-schema-typed/draft-2020-12';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import * as z from '@temporary-name/zod';
|
|
2
2
|
import { SchemaClass, core } from '@temporary-name/zod';
|
|
3
|
-
export { z as baseZ };
|
|
4
3
|
import * as zod_v4_core from 'zod/v4/core';
|
|
5
4
|
import { $input, $output } from 'zod/v4/core';
|
|
6
5
|
import { ClientContext, Value, Promisable, Client, MaybeOptionalOptions, HTTPEndpoint as HTTPEndpoint$1, IntersectPick, HTTPPath, AsyncIteratorClass, ClientOptions, HTTPMethod } from '@temporary-name/shared';
|
|
7
6
|
export { AsyncIteratorClass, ClientContext, EventPublisher, EventPublisherOptions, EventPublisherSubscribeIteratorOptions, HTTPMethod, HTTPPath, IntersectPick, asyncIteratorToStream as eventIteratorToStream, onError, onFinish, onStart, onSuccess, streamToAsyncIteratorClass as streamToEventIterator } from '@temporary-name/shared';
|
|
8
|
-
import { C as Context, S as Schemas, I as InferProcedureClientInputs, a as InferSchemaOutput, M as Meta, L as Lazyable, P as Procedure, b as Contract, A as AnyShape, c as MergedSchemas, W as WrapShape, U as UnionToIntersection, d as AnySchema, R as Route, e as Middleware, f as MergedCurrentContext, g as MergedInitialContext, E as ErrorMap, V as ValidatedAuthContext, h as AuthConfig, B as BuildContextWithAuth, i as ProcedureHandler, j as InferHandlerInputs, k as InferSchemaInput, l as EnhanceRouterOptions, m as Router, n as EnhancedRouter, o as MapInputMiddleware, p as ContractDef, q as Schema, r as AnyMiddleware, s as Lazy, t as AnyProcedure, u as SchemaIssue } from './shared/server.
|
|
9
|
-
export {
|
|
7
|
+
import { C as Context, S as Schemas, I as InferProcedureClientInputs, a as InferSchemaOutput, M as Meta, L as Lazyable, P as Procedure, b as Contract, A as AnyShape, c as MergedSchemas, W as WrapShape, U as UnionToIntersection, d as AnySchema, R as Route, e as Middleware, f as MergedCurrentContext, g as MergedInitialContext, E as ErrorMap, V as ValidatedAuthContext, h as AuthConfig, B as BuildContextWithAuth, i as ProcedureHandler, j as InferHandlerInputs, k as InferSchemaInput, l as EnhanceRouterOptions, m as Router, n as EnhancedRouter, o as MapInputMiddleware, p as ContractDef, q as Schema, r as AnyMiddleware, s as Lazy, t as AnyProcedure, u as SchemaIssue } from './shared/server.yrTiAhAF.js';
|
|
8
|
+
export { av as AccessibleLazyRouter, ak as AnyContractDef, ao as AnyRouter, z as ApiError, y as ApiErrorStatic, a0 as BadGatewayError, D as BadRequestError, O as ConflictError, T as ContentTooLargeError, aA as ContractProcedureCallbackOptions, an as ContractRouter, G as ForbiddenError, a2 as GatewayTimeoutError, ar as InferRouterCurrentContexts, ap as InferRouterInitialContext, aq as InferRouterInitialContexts, as as InferRouterInputs, at as InferRouterOutputs, aI as InitialSchemas, _ as InternalServerError, a6 as LAZY_SYMBOL, a7 as LazyMeta, aB as LazyTraverseContractProceduresOptions, H as MethodNotAllowedError, af as MiddlewareNextFn, ah as MiddlewareOptions, ag as MiddlewareOutputFn, ae as MiddlewareResult, J as NotAcceptableError, N as NotFoundError, $ as NotImplementedError, Q as PreconditionFailedError, al as ProcedureDef, aj as ProcedureHandlerOptions, K as RequestTimeoutError, a1 as ServiceUnavailableError, Z as TooManyRequestsError, az as TraverseContractProcedureCallbackOptions, ay as TraverseContractProceduresOptions, aG as TypeRest, F as UnauthorizedError, aE as UnlaziedRouter, Y as UnprocessableContentError, X as UnsupportedMediaTypeError, x as ValidationError, w as ValidationErrorOptions, aw as createAccessibleLazyRouter, a5 as encodeError, ax as enhanceRouter, ab as getLazyMeta, au as getRouter, aH as initialSchemas, a3 as isApiErrorStatus, aa as isLazy, am as isProcedure, a9 as lazy, a8 as lazyInternal, v as mergeCurrentContext, ad as mergeMeta, ai as middlewareOutputFn, aD as resolveContractProcedures, a4 as toApiError, aC as traverseContractProcedures, ac as unlazy, aF as unlazyRouter } from './shared/server.yrTiAhAF.js';
|
|
10
9
|
import * as Draft07 from '@temporary-name/interop/json-schema-typed/draft-07';
|
|
11
10
|
import * as Draft2019 from '@temporary-name/interop/json-schema-typed/draft-2019-09';
|
|
12
11
|
import * as Draft2020 from '@temporary-name/interop/json-schema-typed/draft-2020-12';
|
package/dist/index.mjs
CHANGED
|
@@ -2,14 +2,13 @@ import { assertNever, splitFirst, onError, isObject, toArray, guard, resolveMayb
|
|
|
2
2
|
export { AsyncIteratorClass, EventPublisher, asyncIteratorToStream as eventIteratorToStream, onError, onFinish, onStart, onSuccess, streamToAsyncIteratorClass as streamToEventIterator } from '@temporary-name/shared';
|
|
3
3
|
import * as z from '@temporary-name/zod';
|
|
4
4
|
import { SchemaClass, object, core, gatingContext } from '@temporary-name/zod';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export { A as APIError, B as BadRequestError, F as ForbiddenError, I as InternalServerError, L as LAZY_SYMBOL, N as NotFoundError, V as ValidationError, x as createAccessibleLazyRouter, e as encodeError, D as endpointRegex, g as getDynamicParams, w as getRouter, i as isAPIErrorStatus, E as isDevelopment, o as isLazy, q as isStartWithMiddlewares, n as lazy, k as makeErrors, v as mergeMiddlewares, r as resolveContractProcedures, s as standardizeHTTPPath, t as toAPIError, y as traverseContractProcedures, z as unlazyRouter } from './shared/server.X8F6e8eV.mjs';
|
|
5
|
+
import { U as UnauthorizedError, P as Procedure, m as mergePrefix, a as mergeTags, b as enhanceRouter, C as Contract, p as parseEndpointDefinition, c as mergeRoute, d as prefixRoute, f as addMiddleware, I as InternalServerError, N as NotFoundError, F as ForbiddenError, B as BadRequestError, l as lazyInternal, h as getLazyMeta, u as unlazy, j as isProcedure } from './shared/server.BT6UIZKq.mjs';
|
|
6
|
+
export { A as ApiError, y as BadGatewayError, n as ConflictError, q as ContentTooLargeError, G as GatewayTimeoutError, L as LAZY_SYMBOL, M as MethodNotAllowedError, k as NotAcceptableError, x as NotImplementedError, o as PreconditionFailedError, R as RequestTimeoutError, S as ServiceUnavailableError, T as TooManyRequestsError, w as UnprocessableContentError, v as UnsupportedMediaTypeError, V as ValidationError, K as createAccessibleLazyRouter, e as encodeError, W as endpointRegex, g as getDynamicParams, J as getRouter, i as isApiErrorStatus, X as isDevelopment, D as isLazy, E as isStartWithMiddlewares, z as lazy, H as mergeMiddlewares, r as resolveContractProcedures, s as standardizeHTTPPath, t as toApiError, O as traverseContractProcedures, Q as unlazyRouter } from './shared/server.BT6UIZKq.mjs';
|
|
8
7
|
import { g as getCookie } from './shared/server.C1RJffw4.mjs';
|
|
9
|
-
import { c as createProcedureClient } from './shared/server.
|
|
10
|
-
export { m as mergeCurrentContext, a as middlewareOutputFn } from './shared/server.
|
|
11
|
-
import { J as JsonSchemaXNativeType } from './shared/server.
|
|
12
|
-
export { b as JSON_SCHEMA_INPUT_REGISTRY, c as JSON_SCHEMA_OUTPUT_REGISTRY, a as JSON_SCHEMA_REGISTRY, Z as ZodToJsonSchemaConverter, e as eventIterator, g as getEventIteratorSchemaDetails } from './shared/server.
|
|
8
|
+
import { c as createProcedureClient } from './shared/server.CqRXKroQ.mjs';
|
|
9
|
+
export { m as mergeCurrentContext, a as middlewareOutputFn } from './shared/server.CqRXKroQ.mjs';
|
|
10
|
+
import { J as JsonSchemaXNativeType } from './shared/server.gacqwfQ1.mjs';
|
|
11
|
+
export { b as JSON_SCHEMA_INPUT_REGISTRY, c as JSON_SCHEMA_OUTPUT_REGISTRY, a as JSON_SCHEMA_REGISTRY, Z as ZodToJsonSchemaConverter, e as eventIterator, g as getEventIteratorSchemaDetails } from './shared/server.gacqwfQ1.mjs';
|
|
13
12
|
export { getEventMeta, withEventMeta } from '@temporary-name/standard-server';
|
|
14
13
|
import 'cookie';
|
|
15
14
|
import '@temporary-name/server/openapi';
|
|
@@ -192,7 +191,7 @@ class ProcedureBuilder extends Contract {
|
|
|
192
191
|
useErrors(errorMap) {
|
|
193
192
|
return new this.constructor({
|
|
194
193
|
...this["~orpc"],
|
|
195
|
-
errorMap
|
|
194
|
+
errorMap: { ...this["~orpc"].errorMap, ...errorMap }
|
|
196
195
|
});
|
|
197
196
|
}
|
|
198
197
|
// The default of false for ValidatedAuthContext is used when you pass in the type 'none'. We use false
|
|
@@ -315,7 +314,7 @@ class Builder extends BuilderWithMiddlewares {
|
|
|
315
314
|
const baseApi = new Builder({
|
|
316
315
|
route: {},
|
|
317
316
|
meta: {},
|
|
318
|
-
errorMap: {},
|
|
317
|
+
errorMap: { BadRequestError, UnauthorizedError, ForbiddenError, NotFoundError, InternalServerError },
|
|
319
318
|
inputValidationIndex: 0,
|
|
320
319
|
outputValidationIndex: 0,
|
|
321
320
|
middlewares: [
|
|
@@ -692,4 +691,4 @@ function isSchemaIssue(issue) {
|
|
|
692
691
|
return true;
|
|
693
692
|
}
|
|
694
693
|
|
|
695
|
-
export { Builder, BuilderWithMiddlewares, Contract, DecoratedProcedure, JsonSchemaXNativeType, Procedure, ProcedureBuilder, UnauthorizedError, addMiddleware, baseApi, call, createAssertedLazyProcedure, createProcedureClient, decorateMiddleware, enhanceRouter, experimental_JsonSchemaCoercer, getLazyMeta, initialSchemas, isProcedure, isSchemaIssue, lazyInternal, mergeMeta, parseEndpointDefinition, unlazy };
|
|
694
|
+
export { BadRequestError, Builder, BuilderWithMiddlewares, Contract, DecoratedProcedure, ForbiddenError, InternalServerError, JsonSchemaXNativeType, NotFoundError, Procedure, ProcedureBuilder, UnauthorizedError, addMiddleware, baseApi, call, createAssertedLazyProcedure, createProcedureClient, decorateMiddleware, enhanceRouter, experimental_JsonSchemaCoercer, getLazyMeta, initialSchemas, isProcedure, isSchemaIssue, lazyInternal, mergeMeta, parseEndpointDefinition, unlazy };
|
package/dist/openapi/index.d.mts
CHANGED
|
@@ -2,7 +2,7 @@ import { Contract } from '@temporary-name/server';
|
|
|
2
2
|
import { OpenAPI, Promisable, Value, HTTPPath, HTTPMethod } from '@temporary-name/shared';
|
|
3
3
|
export { OpenAPI } from '@temporary-name/shared';
|
|
4
4
|
import { Z as ZodToJsonSchemaConverterOptions } from '../shared/server.CjPiuQYH.mjs';
|
|
5
|
-
import { d as AnySchema, b as Contract$1,
|
|
5
|
+
import { d as AnySchema, b as Contract$1, az as TraverseContractProcedureCallbackOptions, an as ContractRouter, ao as AnyRouter } from '../shared/server.yrTiAhAF.mjs';
|
|
6
6
|
import { JSONSchema } from '@temporary-name/interop/json-schema-typed/draft-2020-12';
|
|
7
7
|
export { JSONSchema, ContentEncoding as JSONSchemaContentEncoding, Format as JSONSchemaFormat, TypeName as JSONSchemaTypeName } from '@temporary-name/interop/json-schema-typed/draft-2020-12';
|
|
8
8
|
import '@temporary-name/server/openapi';
|
package/dist/openapi/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Contract } from '@temporary-name/server';
|
|
|
2
2
|
import { OpenAPI, Promisable, Value, HTTPPath, HTTPMethod } from '@temporary-name/shared';
|
|
3
3
|
export { OpenAPI } from '@temporary-name/shared';
|
|
4
4
|
import { Z as ZodToJsonSchemaConverterOptions } from '../shared/server.CjPiuQYH.js';
|
|
5
|
-
import { d as AnySchema, b as Contract$1,
|
|
5
|
+
import { d as AnySchema, b as Contract$1, az as TraverseContractProcedureCallbackOptions, an as ContractRouter, ao as AnyRouter } from '../shared/server.yrTiAhAF.js';
|
|
6
6
|
import { JSONSchema } from '@temporary-name/interop/json-schema-typed/draft-2020-12';
|
|
7
7
|
export { JSONSchema, ContentEncoding as JSONSchemaContentEncoding, Format as JSONSchemaFormat, TypeName as JSONSchemaTypeName } from '@temporary-name/interop/json-schema-typed/draft-2020-12';
|
|
8
8
|
import '@temporary-name/server/openapi';
|
package/dist/openapi/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isObject, stringifyJSON, findDeepMatches, clone, value, fallbackContractConfig, toHttpPath, assertNever } from '@temporary-name/shared';
|
|
2
2
|
import * as z from '@temporary-name/zod';
|
|
3
|
-
import { s as standardizeHTTPPath, r as resolveContractProcedures, g as getDynamicParams, i as
|
|
4
|
-
import { Z as ZodToJsonSchemaConverter, g as getEventIteratorSchemaDetails } from '../shared/server.
|
|
3
|
+
import { s as standardizeHTTPPath, r as resolveContractProcedures, g as getDynamicParams, i as isApiErrorStatus } from '../shared/server.BT6UIZKq.mjs';
|
|
4
|
+
import { Z as ZodToJsonSchemaConverter, g as getEventIteratorSchemaDetails } from '../shared/server.gacqwfQ1.mjs';
|
|
5
5
|
import { TypeName } from '@temporary-name/interop/json-schema-typed/draft-2020-12';
|
|
6
6
|
export { ContentEncoding as JSONSchemaContentEncoding, Format as JSONSchemaFormat, TypeName as JSONSchemaTypeName } from '@temporary-name/interop/json-schema-typed/draft-2020-12';
|
|
7
7
|
import '@temporary-name/standard-server';
|
|
@@ -639,7 +639,7 @@ async function handleSuccessResponse(doc, ref, def, baseSchemaConvertOptions, co
|
|
|
639
639
|
let schemaDescription;
|
|
640
640
|
if (item.properties?.status !== void 0) {
|
|
641
641
|
const statusSchema = resolveOpenAPIJsonSchemaRef(doc, item.properties.status);
|
|
642
|
-
if (typeof statusSchema !== "object" || statusSchema.const === void 0 || typeof statusSchema.const !== "number" || !Number.isInteger(statusSchema.const) ||
|
|
642
|
+
if (typeof statusSchema !== "object" || statusSchema.const === void 0 || typeof statusSchema.const !== "number" || !Number.isInteger(statusSchema.const) || isApiErrorStatus(statusSchema.const)) {
|
|
643
643
|
throw error;
|
|
644
644
|
}
|
|
645
645
|
schemaStatus = statusSchema.const;
|
|
@@ -724,8 +724,8 @@ function authConfigToSecurityScheme(authConfig) {
|
|
|
724
724
|
async function handleErrorResponse(doc, ref, def, baseSchemaConvertOptions, converter) {
|
|
725
725
|
const errorMap = def.errorMap;
|
|
726
726
|
const errorResponsesByStatus = {};
|
|
727
|
-
for (const
|
|
728
|
-
const errorClass = errorMap[
|
|
727
|
+
for (const mapKey in errorMap) {
|
|
728
|
+
const errorClass = errorMap[mapKey];
|
|
729
729
|
if (!errorClass) {
|
|
730
730
|
continue;
|
|
731
731
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isObject, NullProtoObj, fallbackContractConfig, stringifyJSON, isAsyncIteratorObject, tryDecodeURIComponent, toHttpPath, runWithSpan, ORPC_NAME, asyncIteratorWithSpan, setSpanError } from '@temporary-name/shared';
|
|
2
|
-
import { e as encodeError, i as
|
|
3
|
-
import { c as createProcedureClient } from './server.
|
|
4
|
-
import {
|
|
2
|
+
import { e as encodeError, i as isApiErrorStatus, s as standardizeHTTPPath, A as ApiError, B as BadRequestError, t as toApiError$1 } from './server.BT6UIZKq.mjs';
|
|
3
|
+
import { c as createProcedureClient } from './server.CqRXKroQ.mjs';
|
|
4
|
+
import { toApiError, traverseContractProcedures, getLazyMeta, unlazy } from '@temporary-name/server';
|
|
5
5
|
import { mapEventIterator, ErrorEvent } from '@temporary-name/standard-server';
|
|
6
6
|
import { createRouter, addRoute, findRoute } from 'rou3';
|
|
7
7
|
|
|
@@ -120,7 +120,7 @@ function asyncSafeSerialize(data) {
|
|
|
120
120
|
value: async (value) => value,
|
|
121
121
|
error: async (e) => {
|
|
122
122
|
return new ErrorEvent({
|
|
123
|
-
data: encodeError(
|
|
123
|
+
data: encodeError(toApiError(e))["body"],
|
|
124
124
|
cause: e
|
|
125
125
|
});
|
|
126
126
|
}
|
|
@@ -170,7 +170,7 @@ function isDetailedOutput(output) {
|
|
|
170
170
|
if (output.headers && !isObject(output.headers)) {
|
|
171
171
|
return false;
|
|
172
172
|
}
|
|
173
|
-
if (output.status !== void 0 && (typeof output.status !== "number" || !Number.isInteger(output.status) ||
|
|
173
|
+
if (output.status !== void 0 && (typeof output.status !== "number" || !Number.isInteger(output.status) || isApiErrorStatus(output.status))) {
|
|
174
174
|
return false;
|
|
175
175
|
}
|
|
176
176
|
return true;
|
|
@@ -240,6 +240,13 @@ class StandardOpenAPIMatcher {
|
|
|
240
240
|
}
|
|
241
241
|
}
|
|
242
242
|
|
|
243
|
+
function throwOrLog(error) {
|
|
244
|
+
if (process.env.NODE_ENV !== "production") {
|
|
245
|
+
throw error;
|
|
246
|
+
} else {
|
|
247
|
+
console.error(error);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
243
250
|
class StandardHandler {
|
|
244
251
|
matcher;
|
|
245
252
|
constructor(router) {
|
|
@@ -253,6 +260,7 @@ class StandardHandler {
|
|
|
253
260
|
}
|
|
254
261
|
return runWithSpan({ name: `${request.method} ${request.url.pathname}` }, async (span) => {
|
|
255
262
|
let step;
|
|
263
|
+
let errorMap;
|
|
256
264
|
try {
|
|
257
265
|
const context = options.context;
|
|
258
266
|
const method = request.method;
|
|
@@ -265,6 +273,7 @@ class StandardHandler {
|
|
|
265
273
|
if (!match) {
|
|
266
274
|
return { matched: false, response: void 0 };
|
|
267
275
|
}
|
|
276
|
+
errorMap = match.procedure["~orpc"].errorMap;
|
|
268
277
|
span?.updateName(`${ORPC_NAME}.${match.path.join("/")}`);
|
|
269
278
|
span?.setAttribute("rpc.system", ORPC_NAME);
|
|
270
279
|
span?.setAttribute("rpc.method", match.path.join("."));
|
|
@@ -297,11 +306,26 @@ class StandardHandler {
|
|
|
297
306
|
if (step !== "call_procedure") {
|
|
298
307
|
setSpanError(span, e);
|
|
299
308
|
}
|
|
300
|
-
const
|
|
309
|
+
const isApiError = e instanceof ApiError;
|
|
310
|
+
if (isApiError) {
|
|
311
|
+
if (!errorMap) {
|
|
312
|
+
throwOrLog(
|
|
313
|
+
new Error(`Got ApiError but errorMap is undefined. ApiError="{${e.message}"`, { cause: e })
|
|
314
|
+
);
|
|
315
|
+
} else if (!errorMap[e.constructor.name]) {
|
|
316
|
+
throwOrLog(
|
|
317
|
+
new Error(
|
|
318
|
+
`ApiError "${e.constructor.name}" (type "${e.constructor.type}") is not registered. Add it to your API with: baseApi.useErrors({ ${e.constructor.name} })`,
|
|
319
|
+
{ cause: e }
|
|
320
|
+
)
|
|
321
|
+
);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
const error = step === "decode_input" && !(e instanceof ApiError) ? new BadRequestError({
|
|
301
325
|
code: "malformed_request",
|
|
302
326
|
message: `Malformed request. Ensure the request body is properly formatted and the 'Content-Type' header is set correctly.`,
|
|
303
327
|
cause: e
|
|
304
|
-
}) :
|
|
328
|
+
}) : toApiError$1(e);
|
|
305
329
|
const response = encodeError(error);
|
|
306
330
|
return {
|
|
307
331
|
matched: true,
|