@temporary-name/server 1.9.3-alpha.30822ad82102dcf9276d473ba372416778807e52 → 1.9.3-alpha.6ef4729e23affbe6454d37025d1dfc4d998b0649
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/index.d.mts +54 -1
- package/dist/index.d.ts +54 -1
- package/package.json +9 -9
package/dist/index.d.mts
CHANGED
|
@@ -234,6 +234,59 @@ interface ProcedureBuilder<TInitialContext extends Context, TCurrentContext exte
|
|
|
234
234
|
*/
|
|
235
235
|
'handler'<UFuncOutput>(handler: ProcedureHandler<TCurrentContext, InferSchemaOutput<TInputSchema>, UFuncOutput, TErrorMap, TMeta>): DecoratedProcedure<TInitialContext, TCurrentContext, TInputSchema, Schema<UFuncOutput, UFuncOutput>, TErrorMap, TMeta>;
|
|
236
236
|
}
|
|
237
|
+
interface ProcedureBuilderWithInputOutput<TInitialContext extends Context, TCurrentContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TMeta extends Meta, TGateName extends string> {
|
|
238
|
+
/**
|
|
239
|
+
* This property holds the defined options.
|
|
240
|
+
*/
|
|
241
|
+
'~orpc': BuilderDef<TInputSchema, TOutputSchema, TErrorMap, TMeta, TGateName>;
|
|
242
|
+
/**
|
|
243
|
+
* Adds type-safe custom errors.
|
|
244
|
+
* The provided errors are spared-merged with any existing errors.
|
|
245
|
+
*
|
|
246
|
+
* @see {@link https://orpc.unnoq.com/docs/error-handling#type%E2%80%90safe-error-handling Type-Safe Error Handling Docs}
|
|
247
|
+
*/
|
|
248
|
+
'errors'<U extends ErrorMap>(errors: U): ProcedureBuilderWithInputOutput<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, MergedErrorMap<TErrorMap, U>, TMeta, TGateName>;
|
|
249
|
+
/**
|
|
250
|
+
* Uses a middleware to modify the context or improve the pipeline.
|
|
251
|
+
*
|
|
252
|
+
* @info Supports both normal middleware and inline middleware implementations.
|
|
253
|
+
* @info Pass second argument to map the input.
|
|
254
|
+
* @note The current context must be satisfy middleware dependent-context
|
|
255
|
+
* @see {@link https://orpc.unnoq.com/docs/middleware Middleware Docs}
|
|
256
|
+
*/
|
|
257
|
+
'use'<UOutContext extends IntersectPick<TCurrentContext, UOutContext>, UInContext extends Context = TCurrentContext>(middleware: Middleware<UInContext | TCurrentContext, UOutContext, InferSchemaOutput<TInputSchema>, InferSchemaInput<TOutputSchema>, ORPCErrorConstructorMap<TErrorMap>, TMeta>): ProcedureBuilderWithInputOutput<MergedInitialContext<TInitialContext, UInContext, TCurrentContext>, MergedCurrentContext<TCurrentContext, UOutContext>, TInputSchema, TOutputSchema, TErrorMap, TMeta, TGateName>;
|
|
258
|
+
/**
|
|
259
|
+
* Uses a middleware to modify the context or improve the pipeline.
|
|
260
|
+
*
|
|
261
|
+
* @info Supports both normal middleware and inline middleware implementations.
|
|
262
|
+
* @info Pass second argument to map the input.
|
|
263
|
+
* @note The current context must be satisfy middleware dependent-context
|
|
264
|
+
* @see {@link https://orpc.unnoq.com/docs/middleware Middleware Docs}
|
|
265
|
+
*/
|
|
266
|
+
'use'<UOutContext extends IntersectPick<TCurrentContext, UOutContext>, UInput, UInContext extends Context = TCurrentContext>(middleware: Middleware<UInContext | TCurrentContext, UOutContext, UInput, InferSchemaInput<TOutputSchema>, ORPCErrorConstructorMap<TErrorMap>, TMeta>, mapInput: MapInputMiddleware<InferSchemaOutput<TInputSchema>, UInput>): ProcedureBuilderWithInputOutput<MergedInitialContext<TInitialContext, UInContext, TCurrentContext>, MergedCurrentContext<TCurrentContext, UOutContext>, TInputSchema, TOutputSchema, TErrorMap, TMeta, TGateName>;
|
|
267
|
+
/**
|
|
268
|
+
* Sets or updates the metadata.
|
|
269
|
+
* The provided metadata is spared-merged with any existing metadata.
|
|
270
|
+
*
|
|
271
|
+
* @see {@link https://orpc.unnoq.com/docs/metadata Metadata Docs}
|
|
272
|
+
*/
|
|
273
|
+
'meta'(meta: TMeta): ProcedureBuilderWithInputOutput<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, TErrorMap, TMeta, TGateName>;
|
|
274
|
+
/**
|
|
275
|
+
* Sets or updates the route definition.
|
|
276
|
+
* The provided route is spared-merged with any existing route.
|
|
277
|
+
* This option is typically relevant when integrating with OpenAPI.
|
|
278
|
+
*
|
|
279
|
+
* @see {@link https://orpc.unnoq.com/docs/openapi/routing OpenAPI Routing Docs}
|
|
280
|
+
* @see {@link https://orpc.unnoq.com/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
|
|
281
|
+
*/
|
|
282
|
+
'route'(route: Route): ProcedureBuilderWithInputOutput<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, TErrorMap, TMeta, TGateName>;
|
|
283
|
+
/**
|
|
284
|
+
* Defines the handler of the procedure.
|
|
285
|
+
*
|
|
286
|
+
* @see {@link https://orpc.unnoq.com/docs/procedure Procedure Docs}
|
|
287
|
+
*/
|
|
288
|
+
'handler'(handler: ProcedureHandler<TCurrentContext, InferSchemaOutput<TInputSchema>, InferSchemaInput<TOutputSchema>, TErrorMap, TMeta>): DecoratedProcedure<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, TErrorMap, TMeta>;
|
|
289
|
+
}
|
|
237
290
|
interface RouterBuilder<TInitialContext extends Context, TCurrentContext extends Context, TErrorMap extends ErrorMap, TMeta extends Meta> {
|
|
238
291
|
/**
|
|
239
292
|
* This property holds the defined options.
|
|
@@ -600,4 +653,4 @@ declare function setHiddenRouterContract<T extends Lazyable<AnyRouter>>(router:
|
|
|
600
653
|
declare function getHiddenRouterContract(router: Lazyable<AnyRouter | AnyContractRouter>): AnyContractRouter | undefined;
|
|
601
654
|
|
|
602
655
|
export { AnyMiddleware, AnyProcedure, AnyRouter, Builder, Context, CreateProcedureClientOptions, DecoratedProcedure, InferRouterInitialContext, Lazy, Lazyable, MapInputMiddleware, MergedCurrentContext, MergedInitialContext, Middleware, ORPCErrorConstructorMap, Procedure, ProcedureClient, ProcedureHandler, Router, addMiddleware, call, createAccessibleLazyRouter, createApiBuilder, createAssertedLazyProcedure, createContractedProcedure, createRouterClient, decorateMiddleware, enhanceRouter, getHiddenRouterContract, getRouter, implement, implementerInternal, isStartWithMiddlewares, mergeMiddlewares, os, resolveContractProcedures, setHiddenRouterContract, traverseContractProcedures, unlazyRouter };
|
|
603
|
-
export type { AccessibleLazyRouter, ApiBuilder, BuilderDef, BuilderWithMiddlewares, ContractProcedureCallbackOptions, DecoratedMiddleware, EnhanceRouterOptions, EnhancedRouter, ImplementedProcedure, Implementer, ImplementerInternal, ImplementerInternalWithMiddlewares, LazyTraverseContractProceduresOptions, ProcedureBuilder, ProcedureImplementer, RouterBuilder, RouterClient, RouterImplementer, RouterImplementerWithMiddlewares, TraverseContractProcedureCallbackOptions, TraverseContractProceduresOptions, UnlaziedRouter };
|
|
656
|
+
export type { AccessibleLazyRouter, ApiBuilder, BuilderDef, BuilderWithMiddlewares, ContractProcedureCallbackOptions, DecoratedMiddleware, EnhanceRouterOptions, EnhancedRouter, ImplementedProcedure, Implementer, ImplementerInternal, ImplementerInternalWithMiddlewares, LazyTraverseContractProceduresOptions, ProcedureBuilder, ProcedureBuilderWithInputOutput, ProcedureImplementer, RouterBuilder, RouterClient, RouterImplementer, RouterImplementerWithMiddlewares, TraverseContractProcedureCallbackOptions, TraverseContractProceduresOptions, UnlaziedRouter };
|
package/dist/index.d.ts
CHANGED
|
@@ -234,6 +234,59 @@ interface ProcedureBuilder<TInitialContext extends Context, TCurrentContext exte
|
|
|
234
234
|
*/
|
|
235
235
|
'handler'<UFuncOutput>(handler: ProcedureHandler<TCurrentContext, InferSchemaOutput<TInputSchema>, UFuncOutput, TErrorMap, TMeta>): DecoratedProcedure<TInitialContext, TCurrentContext, TInputSchema, Schema<UFuncOutput, UFuncOutput>, TErrorMap, TMeta>;
|
|
236
236
|
}
|
|
237
|
+
interface ProcedureBuilderWithInputOutput<TInitialContext extends Context, TCurrentContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TMeta extends Meta, TGateName extends string> {
|
|
238
|
+
/**
|
|
239
|
+
* This property holds the defined options.
|
|
240
|
+
*/
|
|
241
|
+
'~orpc': BuilderDef<TInputSchema, TOutputSchema, TErrorMap, TMeta, TGateName>;
|
|
242
|
+
/**
|
|
243
|
+
* Adds type-safe custom errors.
|
|
244
|
+
* The provided errors are spared-merged with any existing errors.
|
|
245
|
+
*
|
|
246
|
+
* @see {@link https://orpc.unnoq.com/docs/error-handling#type%E2%80%90safe-error-handling Type-Safe Error Handling Docs}
|
|
247
|
+
*/
|
|
248
|
+
'errors'<U extends ErrorMap>(errors: U): ProcedureBuilderWithInputOutput<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, MergedErrorMap<TErrorMap, U>, TMeta, TGateName>;
|
|
249
|
+
/**
|
|
250
|
+
* Uses a middleware to modify the context or improve the pipeline.
|
|
251
|
+
*
|
|
252
|
+
* @info Supports both normal middleware and inline middleware implementations.
|
|
253
|
+
* @info Pass second argument to map the input.
|
|
254
|
+
* @note The current context must be satisfy middleware dependent-context
|
|
255
|
+
* @see {@link https://orpc.unnoq.com/docs/middleware Middleware Docs}
|
|
256
|
+
*/
|
|
257
|
+
'use'<UOutContext extends IntersectPick<TCurrentContext, UOutContext>, UInContext extends Context = TCurrentContext>(middleware: Middleware<UInContext | TCurrentContext, UOutContext, InferSchemaOutput<TInputSchema>, InferSchemaInput<TOutputSchema>, ORPCErrorConstructorMap<TErrorMap>, TMeta>): ProcedureBuilderWithInputOutput<MergedInitialContext<TInitialContext, UInContext, TCurrentContext>, MergedCurrentContext<TCurrentContext, UOutContext>, TInputSchema, TOutputSchema, TErrorMap, TMeta, TGateName>;
|
|
258
|
+
/**
|
|
259
|
+
* Uses a middleware to modify the context or improve the pipeline.
|
|
260
|
+
*
|
|
261
|
+
* @info Supports both normal middleware and inline middleware implementations.
|
|
262
|
+
* @info Pass second argument to map the input.
|
|
263
|
+
* @note The current context must be satisfy middleware dependent-context
|
|
264
|
+
* @see {@link https://orpc.unnoq.com/docs/middleware Middleware Docs}
|
|
265
|
+
*/
|
|
266
|
+
'use'<UOutContext extends IntersectPick<TCurrentContext, UOutContext>, UInput, UInContext extends Context = TCurrentContext>(middleware: Middleware<UInContext | TCurrentContext, UOutContext, UInput, InferSchemaInput<TOutputSchema>, ORPCErrorConstructorMap<TErrorMap>, TMeta>, mapInput: MapInputMiddleware<InferSchemaOutput<TInputSchema>, UInput>): ProcedureBuilderWithInputOutput<MergedInitialContext<TInitialContext, UInContext, TCurrentContext>, MergedCurrentContext<TCurrentContext, UOutContext>, TInputSchema, TOutputSchema, TErrorMap, TMeta, TGateName>;
|
|
267
|
+
/**
|
|
268
|
+
* Sets or updates the metadata.
|
|
269
|
+
* The provided metadata is spared-merged with any existing metadata.
|
|
270
|
+
*
|
|
271
|
+
* @see {@link https://orpc.unnoq.com/docs/metadata Metadata Docs}
|
|
272
|
+
*/
|
|
273
|
+
'meta'(meta: TMeta): ProcedureBuilderWithInputOutput<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, TErrorMap, TMeta, TGateName>;
|
|
274
|
+
/**
|
|
275
|
+
* Sets or updates the route definition.
|
|
276
|
+
* The provided route is spared-merged with any existing route.
|
|
277
|
+
* This option is typically relevant when integrating with OpenAPI.
|
|
278
|
+
*
|
|
279
|
+
* @see {@link https://orpc.unnoq.com/docs/openapi/routing OpenAPI Routing Docs}
|
|
280
|
+
* @see {@link https://orpc.unnoq.com/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
|
|
281
|
+
*/
|
|
282
|
+
'route'(route: Route): ProcedureBuilderWithInputOutput<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, TErrorMap, TMeta, TGateName>;
|
|
283
|
+
/**
|
|
284
|
+
* Defines the handler of the procedure.
|
|
285
|
+
*
|
|
286
|
+
* @see {@link https://orpc.unnoq.com/docs/procedure Procedure Docs}
|
|
287
|
+
*/
|
|
288
|
+
'handler'(handler: ProcedureHandler<TCurrentContext, InferSchemaOutput<TInputSchema>, InferSchemaInput<TOutputSchema>, TErrorMap, TMeta>): DecoratedProcedure<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, TErrorMap, TMeta>;
|
|
289
|
+
}
|
|
237
290
|
interface RouterBuilder<TInitialContext extends Context, TCurrentContext extends Context, TErrorMap extends ErrorMap, TMeta extends Meta> {
|
|
238
291
|
/**
|
|
239
292
|
* This property holds the defined options.
|
|
@@ -600,4 +653,4 @@ declare function setHiddenRouterContract<T extends Lazyable<AnyRouter>>(router:
|
|
|
600
653
|
declare function getHiddenRouterContract(router: Lazyable<AnyRouter | AnyContractRouter>): AnyContractRouter | undefined;
|
|
601
654
|
|
|
602
655
|
export { AnyMiddleware, AnyProcedure, AnyRouter, Builder, Context, CreateProcedureClientOptions, DecoratedProcedure, InferRouterInitialContext, Lazy, Lazyable, MapInputMiddleware, MergedCurrentContext, MergedInitialContext, Middleware, ORPCErrorConstructorMap, Procedure, ProcedureClient, ProcedureHandler, Router, addMiddleware, call, createAccessibleLazyRouter, createApiBuilder, createAssertedLazyProcedure, createContractedProcedure, createRouterClient, decorateMiddleware, enhanceRouter, getHiddenRouterContract, getRouter, implement, implementerInternal, isStartWithMiddlewares, mergeMiddlewares, os, resolveContractProcedures, setHiddenRouterContract, traverseContractProcedures, unlazyRouter };
|
|
603
|
-
export type { AccessibleLazyRouter, ApiBuilder, BuilderDef, BuilderWithMiddlewares, ContractProcedureCallbackOptions, DecoratedMiddleware, EnhanceRouterOptions, EnhancedRouter, ImplementedProcedure, Implementer, ImplementerInternal, ImplementerInternalWithMiddlewares, LazyTraverseContractProceduresOptions, ProcedureBuilder, ProcedureImplementer, RouterBuilder, RouterClient, RouterImplementer, RouterImplementerWithMiddlewares, TraverseContractProcedureCallbackOptions, TraverseContractProceduresOptions, UnlaziedRouter };
|
|
656
|
+
export type { AccessibleLazyRouter, ApiBuilder, BuilderDef, BuilderWithMiddlewares, ContractProcedureCallbackOptions, DecoratedMiddleware, EnhanceRouterOptions, EnhancedRouter, ImplementedProcedure, Implementer, ImplementerInternal, ImplementerInternalWithMiddlewares, LazyTraverseContractProceduresOptions, ProcedureBuilder, ProcedureBuilderWithInputOutput, ProcedureImplementer, RouterBuilder, RouterClient, RouterImplementer, RouterImplementerWithMiddlewares, TraverseContractProcedureCallbackOptions, TraverseContractProceduresOptions, UnlaziedRouter };
|
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.6ef4729e23affbe6454d37025d1dfc4d998b0649",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://www.stainless.com/",
|
|
7
7
|
"repository": {
|
|
@@ -68,14 +68,14 @@
|
|
|
68
68
|
"cookie": "^1.0.2",
|
|
69
69
|
"@standard-schema/spec": "^1.0.0",
|
|
70
70
|
"zod": "^4.1.12",
|
|
71
|
-
"@temporary-name/
|
|
72
|
-
"@temporary-name/
|
|
73
|
-
"@temporary-name/shared": "1.9.3-alpha.
|
|
74
|
-
"@temporary-name/standard-server": "1.9.3-alpha.
|
|
75
|
-
"@temporary-name/standard-server-
|
|
76
|
-
"@temporary-name/standard-server-
|
|
77
|
-
"@temporary-name/
|
|
78
|
-
"@temporary-name/
|
|
71
|
+
"@temporary-name/contract": "1.9.3-alpha.6ef4729e23affbe6454d37025d1dfc4d998b0649",
|
|
72
|
+
"@temporary-name/interop": "1.9.3-alpha.6ef4729e23affbe6454d37025d1dfc4d998b0649",
|
|
73
|
+
"@temporary-name/shared": "1.9.3-alpha.6ef4729e23affbe6454d37025d1dfc4d998b0649",
|
|
74
|
+
"@temporary-name/standard-server": "1.9.3-alpha.6ef4729e23affbe6454d37025d1dfc4d998b0649",
|
|
75
|
+
"@temporary-name/standard-server-fetch": "1.9.3-alpha.6ef4729e23affbe6454d37025d1dfc4d998b0649",
|
|
76
|
+
"@temporary-name/standard-server-aws-lambda": "1.9.3-alpha.6ef4729e23affbe6454d37025d1dfc4d998b0649",
|
|
77
|
+
"@temporary-name/openapi": "1.9.3-alpha.6ef4729e23affbe6454d37025d1dfc4d998b0649",
|
|
78
|
+
"@temporary-name/standard-server-node": "1.9.3-alpha.6ef4729e23affbe6454d37025d1dfc4d998b0649"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
81
|
"@types/ws": "^8.18.1",
|