nestjs-trpc 2.8.1 → 2.9.1
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/bin/nestjs-trpc.js +1 -1
- package/dist/decorators/mutation.decorator.d.ts +5 -5
- package/dist/decorators/mutation.decorator.d.ts.map +1 -1
- package/dist/decorators/mutation.decorator.js +2 -2
- package/dist/decorators/mutation.decorator.js.map +1 -1
- package/dist/decorators/query.decorator.d.ts +5 -5
- package/dist/decorators/query.decorator.d.ts.map +1 -1
- package/dist/decorators/query.decorator.js +2 -2
- package/dist/decorators/query.decorator.js.map +1 -1
- package/dist/decorators/subscription.decorator.d.ts +5 -5
- package/dist/decorators/subscription.decorator.d.ts.map +1 -1
- package/dist/decorators/subscription.decorator.js +2 -2
- package/dist/decorators/subscription.decorator.js.map +1 -1
- package/dist/interfaces/factory.interface.d.ts +5 -5
- package/dist/interfaces/factory.interface.d.ts.map +1 -1
- package/dist/interfaces/index.d.ts +1 -0
- package/dist/interfaces/index.d.ts.map +1 -1
- package/dist/interfaces/index.js +1 -0
- package/dist/interfaces/index.js.map +1 -1
- package/dist/interfaces/parser.interface.d.ts +58 -0
- package/dist/interfaces/parser.interface.d.ts.map +1 -0
- package/dist/interfaces/parser.interface.js +7 -0
- package/dist/interfaces/parser.interface.js.map +1 -0
- package/native/x86_64-pc-windows-msvc/nestjs-trpc.exe +0 -0
- package/package.json +2 -2
package/bin/nestjs-trpc.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Parser } from '../interfaces/parser.interface';
|
|
2
2
|
/**
|
|
3
3
|
* Decorator that marks a router class method as a TRPC mutation procedure that can receive inbound
|
|
4
4
|
* requests and produce responses.
|
|
@@ -7,16 +7,16 @@ import { ZodSchema } from 'zod';
|
|
|
7
7
|
* for example `Mutation /trpc/userRouter.createUser`.
|
|
8
8
|
*
|
|
9
9
|
* @param {object} args configuration object specifying:
|
|
10
|
-
* - `input` - defines a
|
|
11
|
-
* - `output` - defines a
|
|
10
|
+
* - `input` - defines a schema validation logic for the input.
|
|
11
|
+
* - `output` - defines a schema validation logic for the output.
|
|
12
12
|
*
|
|
13
13
|
* @see [Method Decorators](https://nestjs-trpc.io/docs/routers#procedures)
|
|
14
14
|
*
|
|
15
15
|
* @publicApi
|
|
16
16
|
*/
|
|
17
17
|
export declare function Mutation(args?: {
|
|
18
|
-
input?:
|
|
19
|
-
output?:
|
|
18
|
+
input?: Parser;
|
|
19
|
+
output?: Parser;
|
|
20
20
|
meta?: Record<string, unknown>;
|
|
21
21
|
}): <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
|
|
22
22
|
//# sourceMappingURL=mutation.decorator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mutation.decorator.d.ts","sourceRoot":"","sources":["../../lib/decorators/mutation.decorator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mutation.decorator.d.ts","sourceRoot":"","sources":["../../lib/decorators/mutation.decorator.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAE7D;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,QAAQ,CAAC,IAAI,CAAC,EAAE;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC,+IAOA"}
|
|
@@ -12,8 +12,8 @@ const trpc_enum_1 = require("../trpc.enum");
|
|
|
12
12
|
* for example `Mutation /trpc/userRouter.createUser`.
|
|
13
13
|
*
|
|
14
14
|
* @param {object} args configuration object specifying:
|
|
15
|
-
* - `input` - defines a
|
|
16
|
-
* - `output` - defines a
|
|
15
|
+
* - `input` - defines a schema validation logic for the input.
|
|
16
|
+
* - `output` - defines a schema validation logic for the output.
|
|
17
17
|
*
|
|
18
18
|
* @see [Method Decorators](https://nestjs-trpc.io/docs/routers#procedures)
|
|
19
19
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mutation.decorator.js","sourceRoot":"","sources":["../../lib/decorators/mutation.decorator.ts"],"names":[],"mappings":";;AAoBA,4BAWC;
|
|
1
|
+
{"version":3,"file":"mutation.decorator.js","sourceRoot":"","sources":["../../lib/decorators/mutation.decorator.ts"],"names":[],"mappings":";;AAoBA,4BAWC;AA/BD,2CAA8D;AAC9D,sDAA+E;AAC/E,4CAA6C;AAG7C;;;;;;;;;;;;;;GAcG;AACH,SAAgB,QAAQ,CAAC,IAIxB;IACC,OAAO,IAAA,wBAAe,EACpB,GAAG;QACD,IAAA,oBAAW,EAAC,mCAAkB,EAAE,yBAAa,CAAC,QAAQ,CAAC;QACvD,IAAA,oBAAW,EAAC,uCAAsB,EAAE,IAAI,CAAC;KAC1C,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Parser } from '../interfaces/parser.interface';
|
|
2
2
|
/**
|
|
3
3
|
* Decorator that marks a router class method as a TRPC query procedure that can receive inbound
|
|
4
4
|
* requests and produce responses.
|
|
@@ -7,16 +7,16 @@ import { ZodSchema } from 'zod';
|
|
|
7
7
|
* for example `Query /trpc/userRouter.getUsers`.
|
|
8
8
|
*
|
|
9
9
|
* @param {object} args configuration object specifying:
|
|
10
|
-
* - `input` - defines a
|
|
11
|
-
* - `output` - defines a
|
|
10
|
+
* - `input` - defines a schema validation logic for the input.
|
|
11
|
+
* - `output` - defines a schema validation logic for the output.
|
|
12
12
|
*
|
|
13
13
|
* @see [Method Decorators](https://nestjs-trpc.io/docs/routers#procedures)
|
|
14
14
|
*
|
|
15
15
|
* @publicApi
|
|
16
16
|
*/
|
|
17
17
|
export declare function Query(args?: {
|
|
18
|
-
input?:
|
|
19
|
-
output?:
|
|
18
|
+
input?: Parser;
|
|
19
|
+
output?: Parser;
|
|
20
20
|
meta?: Record<string, unknown>;
|
|
21
21
|
}): <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
|
|
22
22
|
//# sourceMappingURL=query.decorator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.decorator.d.ts","sourceRoot":"","sources":["../../lib/decorators/query.decorator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"query.decorator.d.ts","sourceRoot":"","sources":["../../lib/decorators/query.decorator.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAE7D;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,KAAK,CAAC,IAAI,CAAC,EAAE;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC,+IAOA"}
|
|
@@ -12,8 +12,8 @@ const trpc_enum_1 = require("../trpc.enum");
|
|
|
12
12
|
* for example `Query /trpc/userRouter.getUsers`.
|
|
13
13
|
*
|
|
14
14
|
* @param {object} args configuration object specifying:
|
|
15
|
-
* - `input` - defines a
|
|
16
|
-
* - `output` - defines a
|
|
15
|
+
* - `input` - defines a schema validation logic for the input.
|
|
16
|
+
* - `output` - defines a schema validation logic for the output.
|
|
17
17
|
*
|
|
18
18
|
* @see [Method Decorators](https://nestjs-trpc.io/docs/routers#procedures)
|
|
19
19
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.decorator.js","sourceRoot":"","sources":["../../lib/decorators/query.decorator.ts"],"names":[],"mappings":";;AAoBA,sBAWC;
|
|
1
|
+
{"version":3,"file":"query.decorator.js","sourceRoot":"","sources":["../../lib/decorators/query.decorator.ts"],"names":[],"mappings":";;AAoBA,sBAWC;AA/BD,2CAA8D;AAC9D,sDAA+E;AAC/E,4CAA6C;AAG7C;;;;;;;;;;;;;;GAcG;AACH,SAAgB,KAAK,CAAC,IAIrB;IACC,OAAO,IAAA,wBAAe,EACpB,GAAG;QACD,IAAA,oBAAW,EAAC,mCAAkB,EAAE,yBAAa,CAAC,KAAK,CAAC;QACpD,IAAA,oBAAW,EAAC,uCAAsB,EAAE,IAAI,CAAC;KAC1C,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Parser } from '../interfaces/parser.interface';
|
|
2
2
|
/**
|
|
3
3
|
* Decorator that marks a router class method as a TRPC subscription procedure that can receive inbound
|
|
4
4
|
* requests and produce a stream of responses via Server-Sent Events.
|
|
@@ -7,16 +7,16 @@ import { ZodSchema } from 'zod';
|
|
|
7
7
|
* for example `Subscription /trpc/eventRouter.onMessage`.
|
|
8
8
|
*
|
|
9
9
|
* @param {object} args configuration object specifying:
|
|
10
|
-
* - `input` - defines a
|
|
11
|
-
* - `output` - defines a
|
|
10
|
+
* - `input` - defines a schema validation logic for the input.
|
|
11
|
+
* - `output` - defines a schema validation logic for the output.
|
|
12
12
|
*
|
|
13
13
|
* @see [Method Decorators](https://nestjs-trpc.io/docs/routers#procedures)
|
|
14
14
|
*
|
|
15
15
|
* @publicApi
|
|
16
16
|
*/
|
|
17
17
|
export declare function Subscription(args?: {
|
|
18
|
-
input?:
|
|
19
|
-
output?:
|
|
18
|
+
input?: Parser;
|
|
19
|
+
output?: Parser;
|
|
20
20
|
meta?: Record<string, unknown>;
|
|
21
21
|
}): <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
|
|
22
22
|
//# sourceMappingURL=subscription.decorator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscription.decorator.d.ts","sourceRoot":"","sources":["../../lib/decorators/subscription.decorator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"subscription.decorator.d.ts","sourceRoot":"","sources":["../../lib/decorators/subscription.decorator.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAE7D;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,YAAY,CAAC,IAAI,CAAC,EAAE;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC,+IAOA"}
|
|
@@ -12,8 +12,8 @@ const trpc_enum_1 = require("../trpc.enum");
|
|
|
12
12
|
* for example `Subscription /trpc/eventRouter.onMessage`.
|
|
13
13
|
*
|
|
14
14
|
* @param {object} args configuration object specifying:
|
|
15
|
-
* - `input` - defines a
|
|
16
|
-
* - `output` - defines a
|
|
15
|
+
* - `input` - defines a schema validation logic for the input.
|
|
16
|
+
* - `output` - defines a schema validation logic for the output.
|
|
17
17
|
*
|
|
18
18
|
* @see [Method Decorators](https://nestjs-trpc.io/docs/routers#procedures)
|
|
19
19
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscription.decorator.js","sourceRoot":"","sources":["../../lib/decorators/subscription.decorator.ts"],"names":[],"mappings":";;AAoBA,oCAWC;
|
|
1
|
+
{"version":3,"file":"subscription.decorator.js","sourceRoot":"","sources":["../../lib/decorators/subscription.decorator.ts"],"names":[],"mappings":";;AAoBA,oCAWC;AA/BD,2CAA8D;AAC9D,sDAA+E;AAC/E,4CAA6C;AAG7C;;;;;;;;;;;;;;GAcG;AACH,SAAgB,YAAY,CAAC,IAI5B;IACC,OAAO,IAAA,wBAAe,EACpB,GAAG;QACD,IAAA,oBAAW,EAAC,mCAAkB,EAAE,yBAAa,CAAC,YAAY,CAAC;QAC3D,IAAA,oBAAW,EAAC,uCAAsB,EAAE,IAAI,CAAC;KAC1C,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { TRPCRouterRecord, AnyRouter, TRPCProcedureBuilder } from '@trpc/server';
|
|
2
|
-
import type { ZodSchema, ZodType, ZodTypeDef } from 'zod';
|
|
3
2
|
import type { TRPCMiddleware } from './middleware.interface';
|
|
4
3
|
import type { Class, Constructor } from 'type-fest';
|
|
5
4
|
import type { ProcedureType } from '../trpc.enum';
|
|
5
|
+
import type { Parser } from './parser.interface';
|
|
6
6
|
export declare enum ProcedureParamDecoratorType {
|
|
7
7
|
Options = "options",
|
|
8
8
|
Ctx = "ctx",
|
|
@@ -12,8 +12,8 @@ export declare enum ProcedureParamDecoratorType {
|
|
|
12
12
|
Path = "path"
|
|
13
13
|
}
|
|
14
14
|
export type ProcedureImplementation = ({ input, output, }: {
|
|
15
|
-
input?:
|
|
16
|
-
output?:
|
|
15
|
+
input?: Parser;
|
|
16
|
+
output?: Parser;
|
|
17
17
|
}) => any;
|
|
18
18
|
interface ProcedureParamDecoratorBase {
|
|
19
19
|
type: ProcedureParamDecoratorType;
|
|
@@ -26,8 +26,8 @@ export type ProcedureInputParamDecorator = ProcedureParamDecoratorBase & {
|
|
|
26
26
|
export type ProcedureParamDecorator = ProcedureParamDecoratorBase | ProcedureInputParamDecorator;
|
|
27
27
|
export interface ProcedureFactoryMetadata {
|
|
28
28
|
type: ProcedureType;
|
|
29
|
-
input:
|
|
30
|
-
output:
|
|
29
|
+
input: Parser | undefined;
|
|
30
|
+
output: Parser | undefined;
|
|
31
31
|
meta: Record<string, unknown> | undefined;
|
|
32
32
|
middlewares: Array<Constructor<TRPCMiddleware> | Class<TRPCMiddleware>>;
|
|
33
33
|
name: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.interface.d.ts","sourceRoot":"","sources":["../../lib/interfaces/factory.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,SAAS,EACT,oBAAoB,EACrB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"factory.interface.d.ts","sourceRoot":"","sources":["../../lib/interfaces/factory.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,SAAS,EACT,oBAAoB,EACrB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,oBAAY,2BAA2B;IACrC,OAAO,YAAY;IACnB,GAAG,QAAQ;IACX,KAAK,UAAU;IACf,QAAQ,aAAa;IACrB,IAAI,SAAS;IACb,IAAI,SAAS;CACd;AAED,MAAM,MAAM,uBAAuB,GAAG,CAAC,EACrC,KAAK,EACL,MAAM,GACP,EAAE;IACD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,KAAK,GAAG,CAAC;AAEV,UAAU,2BAA2B;IACnC,IAAI,EAAE,2BAA2B,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,4BAA4B,GAAG,2BAA2B,GAAG;IACvE,IAAI,EAAE,2BAA2B,CAAC,KAAK,CAAC;IACxC,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAC/B,2BAA2B,GAC3B,4BAA4B,CAAC;AAEjC,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,aAAa,CAAC;IACpB,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;IAC1C,WAAW,EAAE,KAAK,CAAC,WAAW,CAAC,cAAc,CAAC,GAAG,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC;IACxE,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,uBAAuB,CAAC;IACxC,MAAM,EAAE,KAAK,CAAC,uBAAuB,CAAC,GAAG,SAAS,CAAC;CACpD;AAED,MAAM,WAAW,8BAA8B;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,KAAK,CAAC,KAAK,CAAC,cAAc,CAAC,GAAG,WAAW,CAAC,cAAc,CAAC,CAAC,CAAC;IACxE,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,cAAc,CAAC;IACzB,UAAU,EAAE,KAAK,CAAC,wBAAwB,CAAC,CAAC;CAC7C;AAED,MAAM,MAAM,UAAU,GAAG,CAAC,iBAAiB,SAAS,gBAAgB,EAClE,UAAU,EAAE,iBAAiB,KAC1B,SAAS,CAAC;AAEf,MAAM,MAAM,mBAAmB,GAAG,oBAAoB,CACpD,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,CACJ,CAAC"}
|
|
@@ -3,5 +3,6 @@ export * from './error-handler.interface';
|
|
|
3
3
|
export * from './middleware.interface';
|
|
4
4
|
export * from './factory.interface';
|
|
5
5
|
export * from './module-options.interface';
|
|
6
|
+
export * from './parser.interface';
|
|
6
7
|
export * from './procedure-options.interface';
|
|
7
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,+BAA+B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oBAAoB,CAAC;AACnC,cAAc,+BAA+B,CAAC"}
|
package/dist/interfaces/index.js
CHANGED
|
@@ -6,5 +6,6 @@ tslib_1.__exportStar(require("./error-handler.interface"), exports);
|
|
|
6
6
|
tslib_1.__exportStar(require("./middleware.interface"), exports);
|
|
7
7
|
tslib_1.__exportStar(require("./factory.interface"), exports);
|
|
8
8
|
tslib_1.__exportStar(require("./module-options.interface"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./parser.interface"), exports);
|
|
9
10
|
tslib_1.__exportStar(require("./procedure-options.interface"), exports);
|
|
10
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/interfaces/index.ts"],"names":[],"mappings":";;;AAAA,8DAAoC;AACpC,oEAA0C;AAC1C,iEAAuC;AACvC,8DAAoC;AACpC,qEAA2C;AAC3C,wEAA8C"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/interfaces/index.ts"],"names":[],"mappings":";;;AAAA,8DAAoC;AACpC,oEAA0C;AAC1C,iEAAuC;AACvC,8DAAoC;AACpC,qEAA2C;AAC3C,6DAAmC;AACnC,wEAA8C"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inlined from @trpc/server's parser types to avoid importing from unstable internals.
|
|
3
|
+
* @see https://github.com/trpc/trpc/blob/main/packages/server/src/unstable-core-do-not-import/parser.ts
|
|
4
|
+
*/
|
|
5
|
+
type StandardSchemaV1Result<Output> = {
|
|
6
|
+
readonly value: Output;
|
|
7
|
+
readonly issues?: undefined;
|
|
8
|
+
} | {
|
|
9
|
+
readonly issues: ReadonlyArray<{
|
|
10
|
+
readonly message: string;
|
|
11
|
+
}>;
|
|
12
|
+
};
|
|
13
|
+
interface StandardSchemaV1<Input = unknown, Output = Input> {
|
|
14
|
+
readonly '~standard': {
|
|
15
|
+
readonly version: 1;
|
|
16
|
+
readonly vendor: string;
|
|
17
|
+
readonly validate: (value: unknown) => StandardSchemaV1Result<Output> | Promise<StandardSchemaV1Result<Output>>;
|
|
18
|
+
readonly types?: {
|
|
19
|
+
readonly input: Input;
|
|
20
|
+
readonly output: Output;
|
|
21
|
+
} | undefined;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
type ParserZodEsque<TInput, TParsedInput> = {
|
|
25
|
+
_input: TInput;
|
|
26
|
+
_output: TParsedInput;
|
|
27
|
+
};
|
|
28
|
+
type ParserValibotEsque<TInput, TParsedInput> = {
|
|
29
|
+
schema: {
|
|
30
|
+
_types?: {
|
|
31
|
+
input: TInput;
|
|
32
|
+
output: TParsedInput;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
type ParserArkTypeEsque<TInput, TParsedInput> = {
|
|
37
|
+
inferIn: TInput;
|
|
38
|
+
infer: TParsedInput;
|
|
39
|
+
};
|
|
40
|
+
type ParserStandardSchemaEsque<TInput, TParsedInput> = StandardSchemaV1<TInput, TParsedInput>;
|
|
41
|
+
type ParserMyZodEsque<TInput> = {
|
|
42
|
+
parse: (input: any) => TInput;
|
|
43
|
+
};
|
|
44
|
+
type ParserSuperstructEsque<TInput> = {
|
|
45
|
+
create: (input: unknown) => TInput;
|
|
46
|
+
};
|
|
47
|
+
type ParserCustomValidatorEsque<TInput> = (input: unknown) => Promise<TInput> | TInput;
|
|
48
|
+
type ParserYupEsque<TInput> = {
|
|
49
|
+
validateSync: (input: unknown) => TInput;
|
|
50
|
+
};
|
|
51
|
+
type ParserScaleEsque<TInput> = {
|
|
52
|
+
assert(value: unknown): asserts value is TInput;
|
|
53
|
+
};
|
|
54
|
+
type ParserWithoutInput<TInput> = ParserCustomValidatorEsque<TInput> | ParserMyZodEsque<TInput> | ParserScaleEsque<TInput> | ParserSuperstructEsque<TInput> | ParserYupEsque<TInput>;
|
|
55
|
+
type ParserWithInputOutput<TInput, TParsedInput> = ParserZodEsque<TInput, TParsedInput> | ParserValibotEsque<TInput, TParsedInput> | ParserArkTypeEsque<TInput, TParsedInput> | ParserStandardSchemaEsque<TInput, TParsedInput>;
|
|
56
|
+
export type Parser = ParserWithInputOutput<any, any> | ParserWithoutInput<any>;
|
|
57
|
+
export {};
|
|
58
|
+
//# sourceMappingURL=parser.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parser.interface.d.ts","sourceRoot":"","sources":["../../lib/interfaces/parser.interface.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Inlined from @trpc/server's parser types to avoid importing from unstable internals.
|
|
4
|
+
* @see https://github.com/trpc/trpc/blob/main/packages/server/src/unstable-core-do-not-import/parser.ts
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
//# sourceMappingURL=parser.interface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parser.interface.js","sourceRoot":"","sources":["../../lib/interfaces/parser.interface.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nestjs-trpc",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.9.1",
|
|
4
4
|
"homepage": "https://nestjs-trpc.io",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"@trpc/server": "^11.0.0",
|
|
61
61
|
"reflect-metadata": "^0.1.13 || ^0.2.0",
|
|
62
62
|
"rxjs": "7.8.1",
|
|
63
|
-
"zod": "^3.14.0"
|
|
63
|
+
"zod": "^3.14.0 || ^4.0.0"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"@nestjs/common": "10.4.1",
|