@temporary-name/server 1.9.3-alpha.1a5ff4923d25c9d83e80d717687ebc859f5312f2 → 1.9.3-alpha.2d4311b66d2b675b022398c62ddc6fde97c93a6f
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.mjs +2 -2
- package/dist/adapters/fetch/index.mjs +2 -2
- package/dist/adapters/node/index.mjs +2 -2
- package/dist/adapters/standard/index.mjs +2 -2
- package/dist/index.d.mts +16 -13
- package/dist/index.d.ts +16 -13
- package/dist/index.mjs +19 -16
- package/dist/openapi/index.mjs +2 -2
- package/dist/shared/{server.B--sAUhn.mjs → server.Cn7WsRHl.mjs} +2 -2
- package/dist/shared/{server.Kxw442A9.mjs → server.JtIZ8YG7.mjs} +1 -11
- package/package.json +10 -10
|
@@ -1,13 +1,13 @@
|
|
|
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.Cn7WsRHl.mjs';
|
|
4
4
|
import '@temporary-name/contract';
|
|
5
5
|
import '@temporary-name/standard-server';
|
|
6
6
|
import '@temporary-name/server';
|
|
7
7
|
import 'rou3';
|
|
8
8
|
import '../../shared/server.CHV9AQHl.mjs';
|
|
9
9
|
import '@temporary-name/zod';
|
|
10
|
-
import '../../shared/server.
|
|
10
|
+
import '../../shared/server.JtIZ8YG7.mjs';
|
|
11
11
|
|
|
12
12
|
class AwsLambdaHandler {
|
|
13
13
|
sendStandardResponseOptions;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { ORPCError, toArray, intercept, resolveMaybeOptionalOptions } from '@temporary-name/shared';
|
|
2
2
|
import { toStandardLazyRequest, toFetchResponse } from '@temporary-name/standard-server-fetch';
|
|
3
|
-
import { C as CompositeStandardHandlerPlugin, S as StandardHandler, r as resolveFriendlyStandardHandleOptions } from '../../shared/server.
|
|
3
|
+
import { C as CompositeStandardHandlerPlugin, S as StandardHandler, r as resolveFriendlyStandardHandleOptions } from '../../shared/server.Cn7WsRHl.mjs';
|
|
4
4
|
import '@temporary-name/contract';
|
|
5
5
|
import '@temporary-name/standard-server';
|
|
6
6
|
import '@temporary-name/server';
|
|
7
7
|
import 'rou3';
|
|
8
8
|
import '@temporary-name/zod';
|
|
9
9
|
import '../../shared/server.CHV9AQHl.mjs';
|
|
10
|
-
import '../../shared/server.
|
|
10
|
+
import '../../shared/server.JtIZ8YG7.mjs';
|
|
11
11
|
|
|
12
12
|
class BodyLimitPlugin {
|
|
13
13
|
maxBodySize;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { once, ORPCError, toArray, intercept, resolveMaybeOptionalOptions } from '@temporary-name/shared';
|
|
2
2
|
import compression from '@temporary-name/interop/compression';
|
|
3
3
|
import { toStandardLazyRequest, sendStandardResponse } from '@temporary-name/standard-server-node';
|
|
4
|
-
import { C as CompositeStandardHandlerPlugin, S as StandardHandler, r as resolveFriendlyStandardHandleOptions } from '../../shared/server.
|
|
4
|
+
import { C as CompositeStandardHandlerPlugin, S as StandardHandler, r as resolveFriendlyStandardHandleOptions } from '../../shared/server.Cn7WsRHl.mjs';
|
|
5
5
|
import '@temporary-name/contract';
|
|
6
6
|
import '@temporary-name/standard-server';
|
|
7
7
|
import '@temporary-name/server';
|
|
8
8
|
import 'rou3';
|
|
9
9
|
import '@temporary-name/zod';
|
|
10
10
|
import '../../shared/server.CHV9AQHl.mjs';
|
|
11
|
-
import '../../shared/server.
|
|
11
|
+
import '../../shared/server.JtIZ8YG7.mjs';
|
|
12
12
|
|
|
13
13
|
class BodyLimitPlugin {
|
|
14
14
|
maxBodySize;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { C as CompositeStandardHandlerPlugin, S as StandardHandler, b as StandardOpenAPIMatcher, d as decode, c as decodeParams, e as encode, a as encodeError, r as resolveFriendlyStandardHandleOptions, t as toRou3Pattern } from '../../shared/server.
|
|
1
|
+
export { C as CompositeStandardHandlerPlugin, S as StandardHandler, b as StandardOpenAPIMatcher, d as decode, c as decodeParams, e as encode, a as encodeError, r as resolveFriendlyStandardHandleOptions, t as toRou3Pattern } from '../../shared/server.Cn7WsRHl.mjs';
|
|
2
2
|
import '@temporary-name/shared';
|
|
3
3
|
import '@temporary-name/standard-server';
|
|
4
4
|
import '../../shared/server.CHV9AQHl.mjs';
|
|
5
5
|
import '@temporary-name/contract';
|
|
6
6
|
import '@temporary-name/zod';
|
|
7
|
-
import '../../shared/server.
|
|
7
|
+
import '../../shared/server.JtIZ8YG7.mjs';
|
|
8
8
|
import '@temporary-name/server';
|
|
9
9
|
import 'rou3';
|
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Schemas, ErrorMap, Meta, ContractProcedure, MergedErrorMap,
|
|
1
|
+
import { Schemas, ErrorMap, Meta, ContractProcedure, MergedErrorMap, AnyShape, MergedSchemas, WrapShape, UnionToIntersection, AnySchema, Route, InferHandlerInputs, InferSchemaInput, ContractRouter, ContractProcedureDef, InitialSchemas, AnyContractRouter, InferContractRouterErrorMap, InferContractRouterMeta, AnyContractProcedure, InferProcedureClientInputs, InferSchemaOutput, ErrorFromErrorMap, Schema } from '@temporary-name/contract';
|
|
2
2
|
export { ContractProcedure, ContractProcedureDef, ContractRouter, ErrorMap, ErrorMapItem, InferSchemaInput, InferSchemaOutput, MergedErrorMap, Meta, OutputStructure, Route, Schema, ValidationError, eventIterator, validateORPCError } from '@temporary-name/contract';
|
|
3
|
-
import { ClientContext, MaybeOptionalOptions, IntersectPick, HTTPPath, ClientOptions, ClientPromiseResult } from '@temporary-name/shared';
|
|
3
|
+
import { ClientContext, MaybeOptionalOptions, HTTPEndpoint, IntersectPick, HTTPPath, ClientOptions, ClientPromiseResult } from '@temporary-name/shared';
|
|
4
4
|
export { AsyncIteratorClass, ClientContext, EventPublisher, EventPublisherOptions, EventPublisherSubscribeIteratorOptions, HTTPMethod, HTTPPath, IntersectPick, ORPCError, Registry, ThrowableError, asyncIteratorToStream as eventIteratorToStream, isDefinedError, onError, onFinish, onStart, onSuccess, safe, streamToAsyncIteratorClass as streamToEventIterator } from '@temporary-name/shared';
|
|
5
|
-
import { SchemaClass } from '@temporary-name/zod';
|
|
5
|
+
import { SchemaClass, core } from '@temporary-name/zod';
|
|
6
6
|
import { C as Context, P as Procedure, a as CreateProcedureClientOptions, b as ProcedureClient, M as Middleware, O as ORPCErrorConstructorMap, c as MergedInitialContext, d as MergedCurrentContext, e as ProcedureHandler, E as EnhanceRouterOptions, R as Router, f as EnhancedRouter, g as MapInputMiddleware, A as AnyMiddleware, L as Lazy, h as AnyProcedure, i as Lazyable, j as AnyRouter, I as InferRouterInitialContext } from './shared/server.DecvGKtb.mjs';
|
|
7
7
|
export { U as AccessibleLazyRouter, Z as ContractProcedureCallbackOptions, N as InferRouterCurrentContexts, K as InferRouterInitialContexts, Q as InferRouterInputs, S as InferRouterOutputs, o as LAZY_SYMBOL, p as LazyMeta, _ as LazyTraverseContractProceduresOptions, x as MiddlewareNextFn, w as MiddlewareNextFnOptions, z as MiddlewareOptions, y as MiddlewareOutputFn, v as MiddlewareResult, l as ORPCErrorConstructorMapItem, k as ORPCErrorConstructorMapItemOptions, H as ProcedureClientInterceptorOptions, F as ProcedureDef, D as ProcedureHandlerOptions, Y as TraverseContractProcedureCallbackOptions, X as TraverseContractProceduresOptions, a1 as UnlaziedRouter, V as createAccessibleLazyRouter, n as createORPCErrorConstructorMap, J as createProcedureClient, W as enhanceRouter, t as getLazyMeta, T as getRouter, s as isLazy, G as isProcedure, r as lazy, q as lazyInternal, m as mergeCurrentContext, B as middlewareOutputFn, a0 as resolveContractProcedures, $ as traverseContractProcedures, u as unlazy, a2 as unlazyRouter } from './shared/server.DecvGKtb.mjs';
|
|
8
8
|
export { getEventMeta, withEventMeta } from '@temporary-name/standard-server';
|
|
@@ -37,6 +37,12 @@ declare class ProcedureBuilder<TInitialContext extends Context, TCurrentContext
|
|
|
37
37
|
* @see {@link https://orpc.unnoq.com/docs/metadata Metadata Docs}
|
|
38
38
|
*/
|
|
39
39
|
meta(meta: TMeta): ProcedureBuilder<TInitialContext, TCurrentContext, TSchemas, TErrorMap, TMeta, TGateName>;
|
|
40
|
+
endpoint<U extends AnyShape[]>(strings: TemplateStringsArray, ...values: [...U]): ProcedureBuilder<TInitialContext, TCurrentContext, MergedSchemas<TSchemas, {
|
|
41
|
+
pathSchema: WrapShape<UnionToIntersection<U>>;
|
|
42
|
+
}>, TErrorMap, TMeta, TGateName>;
|
|
43
|
+
endpoint<U extends AnySchema | AnyShape = core.$ZodType<Record<string, never>, Record<string, never>>>(endpoint: HTTPEndpoint, schema?: U): ProcedureBuilder<TInitialContext, TCurrentContext, MergedSchemas<TSchemas, {
|
|
44
|
+
pathSchema: WrapShape<U>;
|
|
45
|
+
}>, TErrorMap, TMeta, TGateName>;
|
|
40
46
|
/**
|
|
41
47
|
* Sets or updates the route definition for the contract.
|
|
42
48
|
* The provided route is spared-merged with any existing route in the contract.
|
|
@@ -45,23 +51,20 @@ declare class ProcedureBuilder<TInitialContext extends Context, TCurrentContext
|
|
|
45
51
|
* @see {@link https://orpc.unnoq.com/docs/openapi/routing OpenAPI Routing Docs}
|
|
46
52
|
* @see {@link https://orpc.unnoq.com/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
|
|
47
53
|
*/
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}>, TErrorMap, TMeta, TGateName>;
|
|
52
|
-
query<USchema extends AnySchema>(schema: USchema): ProcedureBuilder<TInitialContext, TCurrentContext, MergedSchemas<TSchemas, {
|
|
53
|
-
querySchema: USchema;
|
|
54
|
+
endpointOpts(route: Route): ProcedureBuilder<TInitialContext, TCurrentContext, TSchemas, TErrorMap, TMeta, TGateName>;
|
|
55
|
+
query<U extends AnySchema | AnyShape>(schema: U): ProcedureBuilder<TInitialContext, TCurrentContext, MergedSchemas<TSchemas, {
|
|
56
|
+
querySchema: WrapShape<U>;
|
|
54
57
|
}>, TErrorMap, TMeta, TGateName>;
|
|
55
|
-
body<
|
|
56
|
-
bodySchema:
|
|
58
|
+
body<U extends AnySchema | AnyShape>(schema: U): ProcedureBuilder<TInitialContext, TCurrentContext, MergedSchemas<TSchemas, {
|
|
59
|
+
bodySchema: WrapShape<U>;
|
|
57
60
|
}>, TErrorMap, TMeta, TGateName>;
|
|
58
61
|
/**
|
|
59
62
|
* Defines the output validation schema.
|
|
60
63
|
*
|
|
61
64
|
* @see {@link https://orpc.unnoq.com/docs/procedure#input-output-validation Output Validation Docs}
|
|
62
65
|
*/
|
|
63
|
-
output<
|
|
64
|
-
outputSchema:
|
|
66
|
+
output<U extends AnySchema | AnyShape>(schema: U): ProcedureBuilder<TInitialContext, TCurrentContext, MergedSchemas<TSchemas, {
|
|
67
|
+
outputSchema: WrapShape<U>;
|
|
65
68
|
}>, TErrorMap, TMeta, TGateName>;
|
|
66
69
|
/**
|
|
67
70
|
* Uses a middleware to modify the context or improve the pipeline.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Schemas, ErrorMap, Meta, ContractProcedure, MergedErrorMap,
|
|
1
|
+
import { Schemas, ErrorMap, Meta, ContractProcedure, MergedErrorMap, AnyShape, MergedSchemas, WrapShape, UnionToIntersection, AnySchema, Route, InferHandlerInputs, InferSchemaInput, ContractRouter, ContractProcedureDef, InitialSchemas, AnyContractRouter, InferContractRouterErrorMap, InferContractRouterMeta, AnyContractProcedure, InferProcedureClientInputs, InferSchemaOutput, ErrorFromErrorMap, Schema } from '@temporary-name/contract';
|
|
2
2
|
export { ContractProcedure, ContractProcedureDef, ContractRouter, ErrorMap, ErrorMapItem, InferSchemaInput, InferSchemaOutput, MergedErrorMap, Meta, OutputStructure, Route, Schema, ValidationError, eventIterator, validateORPCError } from '@temporary-name/contract';
|
|
3
|
-
import { ClientContext, MaybeOptionalOptions, IntersectPick, HTTPPath, ClientOptions, ClientPromiseResult } from '@temporary-name/shared';
|
|
3
|
+
import { ClientContext, MaybeOptionalOptions, HTTPEndpoint, IntersectPick, HTTPPath, ClientOptions, ClientPromiseResult } from '@temporary-name/shared';
|
|
4
4
|
export { AsyncIteratorClass, ClientContext, EventPublisher, EventPublisherOptions, EventPublisherSubscribeIteratorOptions, HTTPMethod, HTTPPath, IntersectPick, ORPCError, Registry, ThrowableError, asyncIteratorToStream as eventIteratorToStream, isDefinedError, onError, onFinish, onStart, onSuccess, safe, streamToAsyncIteratorClass as streamToEventIterator } from '@temporary-name/shared';
|
|
5
|
-
import { SchemaClass } from '@temporary-name/zod';
|
|
5
|
+
import { SchemaClass, core } from '@temporary-name/zod';
|
|
6
6
|
import { C as Context, P as Procedure, a as CreateProcedureClientOptions, b as ProcedureClient, M as Middleware, O as ORPCErrorConstructorMap, c as MergedInitialContext, d as MergedCurrentContext, e as ProcedureHandler, E as EnhanceRouterOptions, R as Router, f as EnhancedRouter, g as MapInputMiddleware, A as AnyMiddleware, L as Lazy, h as AnyProcedure, i as Lazyable, j as AnyRouter, I as InferRouterInitialContext } from './shared/server.DecvGKtb.js';
|
|
7
7
|
export { U as AccessibleLazyRouter, Z as ContractProcedureCallbackOptions, N as InferRouterCurrentContexts, K as InferRouterInitialContexts, Q as InferRouterInputs, S as InferRouterOutputs, o as LAZY_SYMBOL, p as LazyMeta, _ as LazyTraverseContractProceduresOptions, x as MiddlewareNextFn, w as MiddlewareNextFnOptions, z as MiddlewareOptions, y as MiddlewareOutputFn, v as MiddlewareResult, l as ORPCErrorConstructorMapItem, k as ORPCErrorConstructorMapItemOptions, H as ProcedureClientInterceptorOptions, F as ProcedureDef, D as ProcedureHandlerOptions, Y as TraverseContractProcedureCallbackOptions, X as TraverseContractProceduresOptions, a1 as UnlaziedRouter, V as createAccessibleLazyRouter, n as createORPCErrorConstructorMap, J as createProcedureClient, W as enhanceRouter, t as getLazyMeta, T as getRouter, s as isLazy, G as isProcedure, r as lazy, q as lazyInternal, m as mergeCurrentContext, B as middlewareOutputFn, a0 as resolveContractProcedures, $ as traverseContractProcedures, u as unlazy, a2 as unlazyRouter } from './shared/server.DecvGKtb.js';
|
|
8
8
|
export { getEventMeta, withEventMeta } from '@temporary-name/standard-server';
|
|
@@ -37,6 +37,12 @@ declare class ProcedureBuilder<TInitialContext extends Context, TCurrentContext
|
|
|
37
37
|
* @see {@link https://orpc.unnoq.com/docs/metadata Metadata Docs}
|
|
38
38
|
*/
|
|
39
39
|
meta(meta: TMeta): ProcedureBuilder<TInitialContext, TCurrentContext, TSchemas, TErrorMap, TMeta, TGateName>;
|
|
40
|
+
endpoint<U extends AnyShape[]>(strings: TemplateStringsArray, ...values: [...U]): ProcedureBuilder<TInitialContext, TCurrentContext, MergedSchemas<TSchemas, {
|
|
41
|
+
pathSchema: WrapShape<UnionToIntersection<U>>;
|
|
42
|
+
}>, TErrorMap, TMeta, TGateName>;
|
|
43
|
+
endpoint<U extends AnySchema | AnyShape = core.$ZodType<Record<string, never>, Record<string, never>>>(endpoint: HTTPEndpoint, schema?: U): ProcedureBuilder<TInitialContext, TCurrentContext, MergedSchemas<TSchemas, {
|
|
44
|
+
pathSchema: WrapShape<U>;
|
|
45
|
+
}>, TErrorMap, TMeta, TGateName>;
|
|
40
46
|
/**
|
|
41
47
|
* Sets or updates the route definition for the contract.
|
|
42
48
|
* The provided route is spared-merged with any existing route in the contract.
|
|
@@ -45,23 +51,20 @@ declare class ProcedureBuilder<TInitialContext extends Context, TCurrentContext
|
|
|
45
51
|
* @see {@link https://orpc.unnoq.com/docs/openapi/routing OpenAPI Routing Docs}
|
|
46
52
|
* @see {@link https://orpc.unnoq.com/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
|
|
47
53
|
*/
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}>, TErrorMap, TMeta, TGateName>;
|
|
52
|
-
query<USchema extends AnySchema>(schema: USchema): ProcedureBuilder<TInitialContext, TCurrentContext, MergedSchemas<TSchemas, {
|
|
53
|
-
querySchema: USchema;
|
|
54
|
+
endpointOpts(route: Route): ProcedureBuilder<TInitialContext, TCurrentContext, TSchemas, TErrorMap, TMeta, TGateName>;
|
|
55
|
+
query<U extends AnySchema | AnyShape>(schema: U): ProcedureBuilder<TInitialContext, TCurrentContext, MergedSchemas<TSchemas, {
|
|
56
|
+
querySchema: WrapShape<U>;
|
|
54
57
|
}>, TErrorMap, TMeta, TGateName>;
|
|
55
|
-
body<
|
|
56
|
-
bodySchema:
|
|
58
|
+
body<U extends AnySchema | AnyShape>(schema: U): ProcedureBuilder<TInitialContext, TCurrentContext, MergedSchemas<TSchemas, {
|
|
59
|
+
bodySchema: WrapShape<U>;
|
|
57
60
|
}>, TErrorMap, TMeta, TGateName>;
|
|
58
61
|
/**
|
|
59
62
|
* Defines the output validation schema.
|
|
60
63
|
*
|
|
61
64
|
* @see {@link https://orpc.unnoq.com/docs/procedure#input-output-validation Output Validation Docs}
|
|
62
65
|
*/
|
|
63
|
-
output<
|
|
64
|
-
outputSchema:
|
|
66
|
+
output<U extends AnySchema | AnyShape>(schema: U): ProcedureBuilder<TInitialContext, TCurrentContext, MergedSchemas<TSchemas, {
|
|
67
|
+
outputSchema: WrapShape<U>;
|
|
65
68
|
}>, TErrorMap, TMeta, TGateName>;
|
|
66
69
|
/**
|
|
67
70
|
* Uses a middleware to modify the context or improve the pipeline.
|
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { mergePrefix, mergeTags, ContractProcedure, mergeErrorMap, mergeMeta, mergeRoute, prefixRoute, initialSchemas, isContractProcedure, getContractRouter } from '@temporary-name/contract';
|
|
1
|
+
import { mergePrefix, mergeTags, ContractProcedure, mergeErrorMap, mergeMeta, parseEndpointDefinition, mergeRoute, prefixRoute, initialSchemas, isContractProcedure, getContractRouter } from '@temporary-name/contract';
|
|
2
2
|
export { ValidationError, eventIterator, validateORPCError } from '@temporary-name/contract';
|
|
3
3
|
import { onError, resolveMaybeOptionalOptions } from '@temporary-name/shared';
|
|
4
4
|
export { AsyncIteratorClass, EventPublisher, ORPCError, asyncIteratorToStream as eventIteratorToStream, isDefinedError, onError, onFinish, onStart, onSuccess, safe, streamToAsyncIteratorClass as streamToEventIterator } from '@temporary-name/shared';
|
|
5
|
-
import { SchemaClass, gatingContext } from '@temporary-name/zod';
|
|
5
|
+
import { SchemaClass, object, core, gatingContext } from '@temporary-name/zod';
|
|
6
6
|
import { P as Procedure, c as createProcedureClient, e as enhanceRouter, a as addMiddleware, s as setHiddenRouterContract, l as lazyInternal, g as getLazyMeta, u as unlazy, i as isProcedure, b as isLazy, d as getRouter } from './shared/server.CHV9AQHl.mjs';
|
|
7
7
|
export { L as LAZY_SYMBOL, p as createAccessibleLazyRouter, f as createORPCErrorConstructorMap, o as getHiddenRouterContract, k as isStartWithMiddlewares, h as lazy, m as mergeCurrentContext, n as mergeMiddlewares, j as middlewareOutputFn, r as resolveContractProcedures, t as traverseContractProcedures, q as unlazyRouter } from './shared/server.CHV9AQHl.mjs';
|
|
8
8
|
export { getEventMeta, withEventMeta } from '@temporary-name/standard-server';
|
|
@@ -56,6 +56,19 @@ class ProcedureBuilder extends ContractProcedure {
|
|
|
56
56
|
meta: mergeMeta(this["~orpc"].meta, meta)
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
|
+
endpoint(stringsOrEndpoint, ...values) {
|
|
60
|
+
const { method, path, pathSchema } = parseEndpointDefinition(stringsOrEndpoint, values);
|
|
61
|
+
const { prefix } = this["~orpc"];
|
|
62
|
+
const route = { method, path };
|
|
63
|
+
return new ProcedureBuilder({
|
|
64
|
+
...this["~orpc"],
|
|
65
|
+
route: mergeRoute(this["~orpc"].route, prefix ? prefixRoute(route, prefix) : route),
|
|
66
|
+
schemas: {
|
|
67
|
+
...this["~orpc"].schemas,
|
|
68
|
+
pathSchema
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
}
|
|
59
72
|
/**
|
|
60
73
|
* Sets or updates the route definition for the contract.
|
|
61
74
|
* The provided route is spared-merged with any existing route in the contract.
|
|
@@ -64,29 +77,19 @@ class ProcedureBuilder extends ContractProcedure {
|
|
|
64
77
|
* @see {@link https://orpc.unnoq.com/docs/openapi/routing OpenAPI Routing Docs}
|
|
65
78
|
* @see {@link https://orpc.unnoq.com/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
|
|
66
79
|
*/
|
|
67
|
-
|
|
80
|
+
endpointOpts(route) {
|
|
68
81
|
const { prefix } = this["~orpc"];
|
|
69
82
|
return new ProcedureBuilder({
|
|
70
83
|
...this["~orpc"],
|
|
71
84
|
route: mergeRoute(this["~orpc"].route, prefix ? prefixRoute(route, prefix) : route)
|
|
72
85
|
});
|
|
73
86
|
}
|
|
74
|
-
path(schema) {
|
|
75
|
-
return new ProcedureBuilder({
|
|
76
|
-
...this["~orpc"],
|
|
77
|
-
schemas: {
|
|
78
|
-
...this["~orpc"].schemas,
|
|
79
|
-
pathSchema: schema
|
|
80
|
-
},
|
|
81
|
-
inputValidationIndex: this["~orpc"].middlewares.length
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
87
|
query(schema) {
|
|
85
88
|
return new ProcedureBuilder({
|
|
86
89
|
...this["~orpc"],
|
|
87
90
|
schemas: {
|
|
88
91
|
...this["~orpc"].schemas,
|
|
89
|
-
querySchema: schema
|
|
92
|
+
querySchema: schema instanceof core.$ZodType ? schema : object(schema)
|
|
90
93
|
},
|
|
91
94
|
inputValidationIndex: this["~orpc"].middlewares.length
|
|
92
95
|
});
|
|
@@ -96,7 +99,7 @@ class ProcedureBuilder extends ContractProcedure {
|
|
|
96
99
|
...this["~orpc"],
|
|
97
100
|
schemas: {
|
|
98
101
|
...this["~orpc"].schemas,
|
|
99
|
-
bodySchema: schema
|
|
102
|
+
bodySchema: schema instanceof core.$ZodType ? schema : object(schema)
|
|
100
103
|
},
|
|
101
104
|
inputValidationIndex: this["~orpc"].middlewares.length
|
|
102
105
|
});
|
|
@@ -111,7 +114,7 @@ class ProcedureBuilder extends ContractProcedure {
|
|
|
111
114
|
...this["~orpc"],
|
|
112
115
|
schemas: {
|
|
113
116
|
...this["~orpc"].schemas,
|
|
114
|
-
outputSchema: schema
|
|
117
|
+
outputSchema: schema instanceof core.$ZodType ? schema : object(schema)
|
|
115
118
|
},
|
|
116
119
|
outputValidationIndex: this["~orpc"].middlewares.length
|
|
117
120
|
});
|
package/dist/openapi/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isProcedure, resolveContractProcedures, ORPCError, createRouterClient } from '@temporary-name/server';
|
|
2
|
-
import { fallbackContractConfig, getEventIteratorSchemaDetails } from '@temporary-name/contract';
|
|
2
|
+
import { standardizeHTTPPath, fallbackContractConfig, getDynamicParams, getEventIteratorSchemaDetails } from '@temporary-name/contract';
|
|
3
3
|
import { isObject, stringifyJSON, findDeepMatches, toArray, clone, value, toHttpPath, isORPCErrorStatus, fallbackORPCErrorStatus, fallbackORPCErrorMessage, resolveMaybeOptionalOptions, createORPCErrorFromJson } from '@temporary-name/shared';
|
|
4
|
-
import {
|
|
4
|
+
import { j as jsonSerialize, d as deserialize, s as serialize } from '../shared/server.JtIZ8YG7.mjs';
|
|
5
5
|
import '@temporary-name/standard-server';
|
|
6
6
|
import { TypeName } from '@temporary-name/interop/json-schema-typed/draft-2020-12';
|
|
7
7
|
export { ContentEncoding as JSONSchemaContentEncoding, Format as JSONSchemaFormat, TypeName as JSONSchemaTypeName } from '@temporary-name/interop/json-schema-typed/draft-2020-12';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { stringifyJSON, isObject, isORPCErrorStatus, tryDecodeURIComponent, toHttpPath, toArray, intercept, runWithSpan, ORPC_NAME, isAsyncIteratorObject, asyncIteratorWithSpan, setSpanError, ORPCError, toORPCError } from '@temporary-name/shared';
|
|
2
2
|
import { flattenHeader } from '@temporary-name/standard-server';
|
|
3
3
|
import { c as createProcedureClient } from './server.CHV9AQHl.mjs';
|
|
4
|
-
import { fallbackContractConfig } from '@temporary-name/contract';
|
|
5
|
-
import { d as deserialize, b as bracketNotationDeserialize, s as serialize
|
|
4
|
+
import { fallbackContractConfig, standardizeHTTPPath } from '@temporary-name/contract';
|
|
5
|
+
import { d as deserialize, b as bracketNotationDeserialize, s as serialize } from './server.JtIZ8YG7.mjs';
|
|
6
6
|
import { traverseContractProcedures, isProcedure, getLazyMeta, unlazy, getRouter, createContractedProcedure } from '@temporary-name/server';
|
|
7
7
|
import { createRouter, addRoute, findRoute } from 'rou3';
|
|
8
8
|
|
|
@@ -234,14 +234,4 @@ function deserialize(data) {
|
|
|
234
234
|
return data;
|
|
235
235
|
}
|
|
236
236
|
|
|
237
|
-
|
|
238
|
-
return `/${path.replace(/\/{2,}/g, "/").replace(/^\/|\/$/g, "")}`;
|
|
239
|
-
}
|
|
240
|
-
function getDynamicParams(path) {
|
|
241
|
-
return path ? standardizeHTTPPath(path).match(/\/\{[^}]+\}/g)?.map((v) => ({
|
|
242
|
-
raw: v,
|
|
243
|
-
name: v.match(/\{\+?([^}]+)\}/)[1]
|
|
244
|
-
})) : void 0;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
export { standardizeHTTPPath as a, bracketNotationDeserialize as b, deserialize as d, getDynamicParams as g, jsonSerialize as j, serialize as s };
|
|
237
|
+
export { bracketNotationDeserialize as b, deserialize as d, jsonSerialize as j, serialize as s };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@temporary-name/server",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.9.3-alpha.
|
|
4
|
+
"version": "1.9.3-alpha.2d4311b66d2b675b022398c62ddc6fde97c93a6f",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://www.stainless.com/",
|
|
7
7
|
"repository": {
|
|
@@ -73,15 +73,15 @@
|
|
|
73
73
|
"cookie": "^1.0.2",
|
|
74
74
|
"rou3": "^0.7.7",
|
|
75
75
|
"zod": "^4.1.12",
|
|
76
|
-
"@temporary-name/
|
|
77
|
-
"@temporary-name/
|
|
78
|
-
"@temporary-name/
|
|
79
|
-
"@temporary-name/shared": "1.9.3-alpha.
|
|
80
|
-
"@temporary-name/standard-server": "1.9.3-alpha.
|
|
81
|
-
"@temporary-name/
|
|
82
|
-
"@temporary-name/standard-server-
|
|
83
|
-
"@temporary-name/
|
|
84
|
-
"@temporary-name/
|
|
76
|
+
"@temporary-name/interop": "1.9.3-alpha.2d4311b66d2b675b022398c62ddc6fde97c93a6f",
|
|
77
|
+
"@temporary-name/json-schema": "1.9.3-alpha.2d4311b66d2b675b022398c62ddc6fde97c93a6f",
|
|
78
|
+
"@temporary-name/standard-server": "1.9.3-alpha.2d4311b66d2b675b022398c62ddc6fde97c93a6f",
|
|
79
|
+
"@temporary-name/shared": "1.9.3-alpha.2d4311b66d2b675b022398c62ddc6fde97c93a6f",
|
|
80
|
+
"@temporary-name/standard-server-fetch": "1.9.3-alpha.2d4311b66d2b675b022398c62ddc6fde97c93a6f",
|
|
81
|
+
"@temporary-name/zod": "1.9.3-alpha.2d4311b66d2b675b022398c62ddc6fde97c93a6f",
|
|
82
|
+
"@temporary-name/standard-server-node": "1.9.3-alpha.2d4311b66d2b675b022398c62ddc6fde97c93a6f",
|
|
83
|
+
"@temporary-name/contract": "1.9.3-alpha.2d4311b66d2b675b022398c62ddc6fde97c93a6f",
|
|
84
|
+
"@temporary-name/standard-server-aws-lambda": "1.9.3-alpha.2d4311b66d2b675b022398c62ddc6fde97c93a6f"
|
|
85
85
|
},
|
|
86
86
|
"devDependencies": {
|
|
87
87
|
"@types/supertest": "^6.0.3",
|