nestjs-trpc 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/dist/decorators/context.decorator.d.ts +2 -0
  2. package/dist/decorators/index.d.ts +11 -0
  3. package/dist/decorators/input.decorator.d.ts +11 -0
  4. package/dist/decorators/middlewares.decorator.d.ts +22 -0
  5. package/dist/decorators/mutation.decorator.d.ts +1 -1
  6. package/dist/decorators/mutation.decorator.d.ts.map +1 -1
  7. package/dist/decorators/options.decorator.d.ts +9 -0
  8. package/dist/decorators/path.decorator.d.ts +9 -0
  9. package/dist/decorators/query.decorator.d.ts +1 -1
  10. package/dist/decorators/query.decorator.d.ts.map +1 -1
  11. package/dist/decorators/raw-input.decorator.d.ts +9 -0
  12. package/dist/decorators/router.decorator.d.ts +1 -1
  13. package/dist/decorators/router.decorator.d.ts.map +1 -1
  14. package/dist/decorators/type.decorator.d.ts +9 -0
  15. package/dist/factories/middleware.factory.d.ts +8 -0
  16. package/dist/factories/procedure.factory.d.ts +18 -0
  17. package/dist/factories/procedure.factory.js +3 -4
  18. package/dist/factories/router.factory.d.ts +10 -0
  19. package/dist/factories/router.factory.d.ts.map +1 -1
  20. package/dist/factories/router.factory.js +6 -6
  21. package/dist/factories/trpc.factory.d.ts +9 -0
  22. package/dist/factories/trpc.factory.d.ts.map +1 -1
  23. package/dist/factories/trpc.factory.js +1 -11
  24. package/dist/generators/context.generator.d.ts +10 -0
  25. package/dist/generators/decorator.generator.d.ts +8 -0
  26. package/dist/generators/decorator.generator.js +1 -2
  27. package/dist/generators/middleware.generator.d.ts +13 -0
  28. package/dist/generators/router.generator.d.ts +10 -0
  29. package/dist/generators/router.generator.js +1 -1
  30. package/dist/generators/trpc.generator.d.ts +20 -0
  31. package/dist/generators/trpc.generator.js +1 -2
  32. package/dist/index.d.ts +4 -0
  33. package/dist/interfaces/context.interface.d.ts +6 -0
  34. package/dist/interfaces/factory.interface.d.ts +60 -0
  35. package/dist/interfaces/generator.interface.d.ts +22 -0
  36. package/dist/interfaces/index.d.ts +5 -0
  37. package/dist/interfaces/middleware.interface.d.ts +20 -0
  38. package/dist/interfaces/module-options.interface.d.ts +38 -0
  39. package/dist/interfaces/procedure-options.interface.d.ts +8 -0
  40. package/dist/trpc.constants.d.ts +8 -0
  41. package/dist/trpc.driver.d.ts +15 -0
  42. package/dist/trpc.driver.d.ts.map +1 -1
  43. package/dist/trpc.driver.js +4 -5
  44. package/dist/trpc.enum.d.ts +5 -0
  45. package/dist/trpc.module.d.ts +11 -0
  46. package/dist/trpc.module.js +2 -3
  47. package/dist/utils/file.util.d.ts +6 -0
  48. package/dist/utils/type.util.d.ts +6 -0
  49. package/dist/utils/validate-each.util.d.ts +9 -0
  50. package/package.json +1 -1
@@ -0,0 +1,2 @@
1
+ export declare function Ctx(): ParameterDecorator;
2
+ //# sourceMappingURL=context.decorator.d.ts.map
@@ -0,0 +1,11 @@
1
+ export * from './router.decorator';
2
+ export * from './middlewares.decorator';
3
+ export * from './mutation.decorator';
4
+ export * from './query.decorator';
5
+ export * from './options.decorator';
6
+ export * from './context.decorator';
7
+ export * from './input.decorator';
8
+ export * from './raw-input.decorator';
9
+ export * from './type.decorator';
10
+ export * from './path.decorator';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Input procedure parameter decorator. Extracts the `input` parameter out of the procedure `opts`.
3
+ *
4
+ * @param key string to be used extracting a specific input key - `input[key]`.
5
+ *
6
+ * @see [Parameter Decorators](https://www.nestjs-trpc.io/docs/routers#parameter-decorators)
7
+ *
8
+ * @publicApi
9
+ */
10
+ export declare function Input(key?: string): ParameterDecorator;
11
+ //# sourceMappingURL=input.decorator.d.ts.map
@@ -0,0 +1,22 @@
1
+ import { TRPCMiddleware } from '../interfaces';
2
+ /**
3
+ * TODO: Generate Return Context Type.
4
+ *
5
+ * Decorator that binds middlewares to the scope of the router or a procedure,
6
+ * depending on its context.
7
+ *
8
+ * When `@Middlewares` is used at the router level, the middleware will be
9
+ * applied to every handler (method) in the router.
10
+ *
11
+ * When `@Middlewares` is used at the individual handler level, the middleware
12
+ * will apply only to that specific method.
13
+ *
14
+ * @param middleware a single middleware instance or class, or a list of middleware instances
15
+ * or classes.
16
+ *
17
+ * @see [Middlewares](https://nestjs-trpc.io/docs/middlewares)
18
+ *
19
+ * @publicApi
20
+ */
21
+ export declare function Middlewares(middleware?: TRPCMiddleware | Function): MethodDecorator & ClassDecorator;
22
+ //# sourceMappingURL=middlewares.decorator.d.ts.map
@@ -17,5 +17,5 @@ import { ZodSchema } from 'zod';
17
17
  export declare function Mutation(args?: {
18
18
  input?: ZodSchema;
19
19
  output?: ZodSchema;
20
- }): any;
20
+ }): <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
21
21
  //# 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":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAKhC;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,QAAQ,CAAC,IAAI,CAAC,EAAE;IAAE,KAAK,CAAC,EAAE,SAAS,CAAC;IAAC,MAAM,CAAC,EAAE,SAAS,CAAA;CAAE,OAOxE"}
1
+ {"version":3,"file":"mutation.decorator.d.ts","sourceRoot":"","sources":["../../lib/decorators/mutation.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAKhC;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,QAAQ,CAAC,IAAI,CAAC,EAAE;IAAE,KAAK,CAAC,EAAE,SAAS,CAAC;IAAC,MAAM,CAAC,EAAE,SAAS,CAAA;CAAE,+IAOxE"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Options procedure parameter decorator. Extracts the root `opts` parameter out of the procedure.
3
+ *
4
+ * @see [Parameter Decorators](https://www.nestjs-trpc.io/docs/routers#parameter-decorators)
5
+ *
6
+ * @publicApi
7
+ */
8
+ export declare function Options(): ParameterDecorator;
9
+ //# sourceMappingURL=options.decorator.d.ts.map
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Path procedure parameter decorator. Extracts the `path` parameter out of the procedure `opts`.
3
+ *
4
+ * @see [Parameter Decorators](https://www.nestjs-trpc.io/docs/routers#parameter-decorators)
5
+ *
6
+ * @publicApi
7
+ */
8
+ export declare function Path(): ParameterDecorator;
9
+ //# sourceMappingURL=path.decorator.d.ts.map
@@ -17,5 +17,5 @@ import { ZodSchema } from 'zod';
17
17
  export declare function Query(args?: {
18
18
  input?: ZodSchema;
19
19
  output?: ZodSchema;
20
- }): any;
20
+ }): <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
21
21
  //# 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":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAKhC;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,KAAK,CAAC,IAAI,CAAC,EAAE;IAAE,KAAK,CAAC,EAAE,SAAS,CAAC;IAAC,MAAM,CAAC,EAAE,SAAS,CAAA;CAAE,OAOrE"}
1
+ {"version":3,"file":"query.decorator.d.ts","sourceRoot":"","sources":["../../lib/decorators/query.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAKhC;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,KAAK,CAAC,IAAI,CAAC,EAAE;IAAE,KAAK,CAAC,EAAE,SAAS,CAAC;IAAC,MAAM,CAAC,EAAE,SAAS,CAAA;CAAE,+IAOrE"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Raw Input procedure parameter decorator. Extracts the `rawInput` parameter out of the procedure `opts`.
3
+ *
4
+ * @see [Parameter Decorators](https://www.nestjs-trpc.io/docs/routers#parameter-decorators)
5
+ *
6
+ * @publicApi
7
+ */
8
+ export declare function RawInput(): ParameterDecorator;
9
+ //# sourceMappingURL=raw-input.decorator.d.ts.map
@@ -16,5 +16,5 @@
16
16
  */
17
17
  export declare function Router(args?: {
18
18
  alias?: string;
19
- }): any;
19
+ }): <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
20
20
  //# sourceMappingURL=router.decorator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"router.decorator.d.ts","sourceRoot":"","sources":["../../lib/decorators/router.decorator.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,MAAM,CAAC,IAAI,CAAC,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,OAI/C"}
1
+ {"version":3,"file":"router.decorator.d.ts","sourceRoot":"","sources":["../../lib/decorators/router.decorator.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,MAAM,CAAC,IAAI,CAAC,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,+IAI/C"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Type procedure parameter decorator. Extracts the `type` parameter out of the procedure `opts`.
3
+ *
4
+ * @see [Parameter Decorators](https://www.nestjs-trpc.io/docs/routers#parameter-decorators)
5
+ *
6
+ * @publicApi
7
+ */
8
+ export declare function Type(): ParameterDecorator;
9
+ //# sourceMappingURL=type.decorator.d.ts.map
@@ -0,0 +1,8 @@
1
+ import { Class } from 'type-fest';
2
+ import { TRPCMiddleware } from '../interfaces';
3
+ export declare class MiddlewareFactory {
4
+ private readonly routerFactory;
5
+ private readonly procedureFactory;
6
+ getMiddlewares(): Array<Class<TRPCMiddleware>>;
7
+ }
8
+ //# sourceMappingURL=middleware.factory.d.ts.map
@@ -0,0 +1,18 @@
1
+ import { ModuleRef } from '@nestjs/core';
2
+ import { ProcedureFactoryMetadata, TRPCPublicProcedure } from '../interfaces/factory.interface';
3
+ import { TRPCMiddleware } from '../interfaces';
4
+ export declare class ProcedureFactory {
5
+ private moduleRef;
6
+ private readonly consoleLogger;
7
+ private readonly metadataScanner;
8
+ constructor(moduleRef: ModuleRef);
9
+ getProcedures(instance: unknown, prototype: Record<string, Function>): Array<ProcedureFactoryMetadata>;
10
+ private extractProcedureParams;
11
+ private extractProcedureMetadata;
12
+ serializeProcedures(procedures: Array<ProcedureFactoryMetadata>, instance: any, camelCasedRouterName: string, procedureBuilder: TRPCPublicProcedure, routerMiddlewares: TRPCMiddleware | undefined): Record<string, any>;
13
+ private createProcedureInstance;
14
+ private createCustomProcedureInstance;
15
+ private serializeProcedureParams;
16
+ private createSerializedProcedure;
17
+ }
18
+ //# sourceMappingURL=procedure.factory.d.ts.map
@@ -1,5 +1,4 @@
1
1
  "use strict";
2
- var _a, _b, _c;
3
2
  Object.defineProperty(exports, "__esModule", { value: true });
4
3
  exports.ProcedureFactory = void 0;
5
4
  const tslib_1 = require("tslib");
@@ -104,13 +103,13 @@ let ProcedureFactory = class ProcedureFactory {
104
103
  exports.ProcedureFactory = ProcedureFactory;
105
104
  tslib_1.__decorate([
106
105
  (0, common_1.Inject)(common_1.ConsoleLogger),
107
- tslib_1.__metadata("design:type", typeof (_b = typeof common_1.ConsoleLogger !== "undefined" && common_1.ConsoleLogger) === "function" ? _b : Object)
106
+ tslib_1.__metadata("design:type", common_1.ConsoleLogger)
108
107
  ], ProcedureFactory.prototype, "consoleLogger", void 0);
109
108
  tslib_1.__decorate([
110
109
  (0, common_1.Inject)(core_1.MetadataScanner),
111
- tslib_1.__metadata("design:type", typeof (_c = typeof core_1.MetadataScanner !== "undefined" && core_1.MetadataScanner) === "function" ? _c : Object)
110
+ tslib_1.__metadata("design:type", core_1.MetadataScanner)
112
111
  ], ProcedureFactory.prototype, "metadataScanner", void 0);
113
112
  exports.ProcedureFactory = ProcedureFactory = tslib_1.__decorate([
114
113
  (0, common_1.Injectable)(),
115
- tslib_1.__metadata("design:paramtypes", [typeof (_a = typeof core_1.ModuleRef !== "undefined" && core_1.ModuleRef) === "function" ? _a : Object])
114
+ tslib_1.__metadata("design:paramtypes", [core_1.ModuleRef])
116
115
  ], ProcedureFactory);
@@ -0,0 +1,10 @@
1
+ import { RouterInstance, TRPCPublicProcedure, TRPCRouter } from '../interfaces/factory.interface';
2
+ export declare class RouterFactory {
3
+ private readonly consoleLogger;
4
+ private readonly modulesContainer;
5
+ private readonly procedureFactory;
6
+ getRouters(): Array<RouterInstance>;
7
+ private extractRouterFromWrapper;
8
+ serializeRoutes(router: TRPCRouter, procedure: TRPCPublicProcedure): Record<string, any>;
9
+ }
10
+ //# sourceMappingURL=router.factory.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"router.factory.d.ts","sourceRoot":"","sources":["../../lib/factories/router.factory.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,cAAc,EACd,mBAAmB,EAEpB,MAAM,iCAAiC,CAAC;AAIzC,qBACa,aAAa;IAExB,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAiB;IAG/C,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAoB;IAGrD,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAoB;IAErD,UAAU,IAAI,KAAK,CAAC,cAAc,CAAC;IAenC,OAAO,CAAC,wBAAwB;IA0BhC,eAAe,CAAC,SAAS,EAAE,mBAAmB,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CA+BrE"}
1
+ {"version":3,"file":"router.factory.d.ts","sourceRoot":"","sources":["../../lib/factories/router.factory.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,UAAU,EACX,MAAM,iCAAiC,CAAC;AAIzC,qBACa,aAAa;IAExB,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAiB;IAG/C,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAoB;IAGrD,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAoB;IAErD,UAAU,IAAI,KAAK,CAAC,cAAc,CAAC;IAenC,OAAO,CAAC,wBAAwB;IA0BhC,eAAe,CAAC,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,mBAAmB,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAkCzF"}
@@ -1,5 +1,4 @@
1
1
  "use strict";
2
- var _a, _b;
3
2
  Object.defineProperty(exports, "__esModule", { value: true });
4
3
  exports.RouterFactory = void 0;
5
4
  const tslib_1 = require("tslib");
@@ -33,7 +32,7 @@ let RouterFactory = class RouterFactory {
33
32
  const middlewares = Reflect.getMetadata(trpc_constants_1.MIDDLEWARE_KEY, instance.constructor);
34
33
  return { name, instance, alias: router.alias, middlewares };
35
34
  }
36
- serializeRoutes(procedure) {
35
+ serializeRoutes(router, procedure) {
37
36
  const routers = this.getRouters();
38
37
  const routerSchema = Object.create({});
39
38
  routers.forEach((route) => {
@@ -42,8 +41,9 @@ let RouterFactory = class RouterFactory {
42
41
  const prototype = Object.getPrototypeOf(instance);
43
42
  const procedures = this.procedureFactory.getProcedures(instance, prototype);
44
43
  this.consoleLogger.log(`Router ${name} as ${camelCasedRouterName}.`, 'Router Factory');
45
- routerSchema[camelCasedRouterName] =
46
- this.procedureFactory.serializeProcedures(procedures, instance, camelCasedRouterName, procedure, middlewares);
44
+ const routerProcedures = this.procedureFactory.serializeProcedures(procedures, instance, camelCasedRouterName, procedure, middlewares);
45
+ // TODO: To get this working with `trpc` v11, we need to remove the `router()` method from here.
46
+ routerSchema[camelCasedRouterName] = router(routerProcedures);
47
47
  });
48
48
  return routerSchema;
49
49
  }
@@ -51,11 +51,11 @@ let RouterFactory = class RouterFactory {
51
51
  exports.RouterFactory = RouterFactory;
52
52
  tslib_1.__decorate([
53
53
  (0, common_1.Inject)(common_1.ConsoleLogger),
54
- tslib_1.__metadata("design:type", typeof (_a = typeof common_1.ConsoleLogger !== "undefined" && common_1.ConsoleLogger) === "function" ? _a : Object)
54
+ tslib_1.__metadata("design:type", common_1.ConsoleLogger)
55
55
  ], RouterFactory.prototype, "consoleLogger", void 0);
56
56
  tslib_1.__decorate([
57
57
  (0, common_1.Inject)(core_1.ModulesContainer),
58
- tslib_1.__metadata("design:type", typeof (_b = typeof core_1.ModulesContainer !== "undefined" && core_1.ModulesContainer) === "function" ? _b : Object)
58
+ tslib_1.__metadata("design:type", core_1.ModulesContainer)
59
59
  ], RouterFactory.prototype, "modulesContainer", void 0);
60
60
  tslib_1.__decorate([
61
61
  (0, common_1.Inject)(procedure_factory_1.ProcedureFactory),
@@ -0,0 +1,9 @@
1
+ import { MergeRouters } from '@trpc/server/dist/core/internals/mergeRouters';
2
+ import { AnyRouterDef } from '@trpc/server/dist/core/router';
3
+ import { TRPCRouter } from '../interfaces/factory.interface';
4
+ import { AnyRouter, ProcedureBuilder } from '@trpc/server';
5
+ export declare class TRPCFactory {
6
+ private readonly routerFactory;
7
+ serializeAppRoutes(router: TRPCRouter, procedure: ProcedureBuilder<any>): MergeRouters<Array<AnyRouter>, AnyRouterDef>;
8
+ }
9
+ //# sourceMappingURL=trpc.factory.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"trpc.factory.d.ts","sourceRoot":"","sources":["../../lib/factories/trpc.factory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAG7D,OAAO,EAEL,UAAU,EACX,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAmB,MAAM,cAAc,CAAC;AAK5E,qBACa,WAAW;IAEtB,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAiB;IAG/C,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAiB;IAG/C,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAoB;IAErD,kBAAkB,CAChB,MAAM,EAAE,UAAU,EAClB,SAAS,EAAE,gBAAgB,CAAC,GAAG,CAAC,GAC/B,YAAY,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,YAAY,CAAC;CAIhD"}
1
+ {"version":3,"file":"trpc.factory.d.ts","sourceRoot":"","sources":["../../lib/factories/trpc.factory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAE7D,OAAO,EACL,UAAU,EACX,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAE3D,qBACa,WAAW;IAGtB,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAiB;IAE/C,kBAAkB,CAChB,MAAM,EAAE,UAAU,EAClB,SAAS,EAAE,gBAAgB,CAAC,GAAG,CAAC,GAC/B,YAAY,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,YAAY,CAAC;CAIhD"}
@@ -3,28 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TRPCFactory = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const common_1 = require("@nestjs/common");
6
- const trpc_generator_1 = require("../generators/trpc.generator");
7
6
  const router_factory_1 = require("./router.factory");
8
- const procedure_factory_1 = require("./procedure.factory");
9
7
  let TRPCFactory = class TRPCFactory {
10
8
  serializeAppRoutes(router, procedure) {
11
- const routerSchema = this.routerFactory.serializeRoutes(procedure);
9
+ const routerSchema = this.routerFactory.serializeRoutes(router, procedure);
12
10
  return router(routerSchema);
13
11
  }
14
12
  };
15
13
  exports.TRPCFactory = TRPCFactory;
16
- tslib_1.__decorate([
17
- (0, common_1.Inject)(trpc_generator_1.TRPCGenerator),
18
- tslib_1.__metadata("design:type", trpc_generator_1.TRPCGenerator)
19
- ], TRPCFactory.prototype, "trpcGenerator", void 0);
20
14
  tslib_1.__decorate([
21
15
  (0, common_1.Inject)(router_factory_1.RouterFactory),
22
16
  tslib_1.__metadata("design:type", router_factory_1.RouterFactory)
23
17
  ], TRPCFactory.prototype, "routerFactory", void 0);
24
- tslib_1.__decorate([
25
- (0, common_1.Inject)(procedure_factory_1.ProcedureFactory),
26
- tslib_1.__metadata("design:type", procedure_factory_1.ProcedureFactory)
27
- ], TRPCFactory.prototype, "procedureFactory", void 0);
28
18
  exports.TRPCFactory = TRPCFactory = tslib_1.__decorate([
29
19
  (0, common_1.Injectable)()
30
20
  ], TRPCFactory);
@@ -0,0 +1,10 @@
1
+ import { Project } from 'ts-morph';
2
+ import type { TRPCContext } from '../interfaces';
3
+ import type { Class } from 'type-fest';
4
+ export declare class ContextGenerator {
5
+ getContextInterface(context: Class<TRPCContext>, project: Project): Promise<string | null>;
6
+ private extractReturnTypeFromCreateMethod;
7
+ private isPromiseType;
8
+ private getClassDeclaration;
9
+ }
10
+ //# sourceMappingURL=context.generator.d.ts.map
@@ -0,0 +1,8 @@
1
+ import { Decorator, SourceFile, Project } from 'ts-morph';
2
+ import { DecoratorGeneratorMetadata } from '../interfaces/generator.interface';
3
+ export declare class DecoratorGenerator {
4
+ private readonly consoleLogger;
5
+ serializeProcedureDecorators(decorators: Decorator[], sourceFile: SourceFile, project: Project): Array<DecoratorGeneratorMetadata>;
6
+ private buildSourceFileImportsMap;
7
+ }
8
+ //# sourceMappingURL=decorator.generator.d.ts.map
@@ -1,5 +1,4 @@
1
1
  "use strict";
2
- var _a;
3
2
  Object.defineProperty(exports, "__esModule", { value: true });
4
3
  exports.DecoratorGenerator = void 0;
5
4
  const tslib_1 = require("tslib");
@@ -62,7 +61,7 @@ let DecoratorGenerator = class DecoratorGenerator {
62
61
  exports.DecoratorGenerator = DecoratorGenerator;
63
62
  tslib_1.__decorate([
64
63
  (0, common_1.Inject)(common_1.ConsoleLogger),
65
- tslib_1.__metadata("design:type", typeof (_a = typeof common_1.ConsoleLogger !== "undefined" && common_1.ConsoleLogger) === "function" ? _a : Object)
64
+ tslib_1.__metadata("design:type", common_1.ConsoleLogger)
66
65
  ], DecoratorGenerator.prototype, "consoleLogger", void 0);
67
66
  exports.DecoratorGenerator = DecoratorGenerator = tslib_1.__decorate([
68
67
  (0, common_1.Injectable)()
@@ -0,0 +1,13 @@
1
+ import { Project, OptionalKind, PropertySignatureStructure } from 'ts-morph';
2
+ import { TRPCMiddleware } from '../interfaces';
3
+ import type { Class } from 'type-fest';
4
+ export declare class MiddlewareGenerator {
5
+ getMiddlewareInterface(middleware: Class<TRPCMiddleware>, project: Project): Promise<{
6
+ name: string;
7
+ properties: Array<OptionalKind<PropertySignatureStructure>>;
8
+ } | null>;
9
+ private extractCtxTypeFromUseMethod;
10
+ private getClassDeclaration;
11
+ private typeToProperties;
12
+ }
13
+ //# sourceMappingURL=middleware.generator.d.ts.map
@@ -0,0 +1,10 @@
1
+ import { Project } from 'ts-morph';
2
+ import { RouterGeneratorMetadata } from '../interfaces/generator.interface';
3
+ import { RoutersFactoryMetadata } from '../interfaces/factory.interface';
4
+ export declare class RouterGenerator {
5
+ private readonly decoratorHandler;
6
+ serializeRouters(routers: RoutersFactoryMetadata[], project: Project): Promise<RouterGeneratorMetadata[]>;
7
+ private serializeRouterProcedures;
8
+ generateRoutersStringFromMetadata(routers: Array<RouterGeneratorMetadata>): string;
9
+ }
10
+ //# sourceMappingURL=router.generator.d.ts.map
@@ -25,7 +25,7 @@ let RouterGenerator = class RouterGenerator {
25
25
  const sourceFile = project.addSourceFileAtPath(location.path);
26
26
  const classDeclaration = sourceFile.getClass(routerName);
27
27
  if (!classDeclaration) {
28
- throw new Error(`Could not find router ${routerName}, class declaration.`);
28
+ throw new Error(`Could not find router ${routerName} class declaration.`);
29
29
  }
30
30
  const methodDeclaration = classDeclaration.getMethod(procedure.name);
31
31
  if (!methodDeclaration) {
@@ -0,0 +1,20 @@
1
+ import { OnModuleInit } from '@nestjs/common';
2
+ import { TRPCContext } from '../interfaces';
3
+ import type { Class } from 'type-fest';
4
+ export declare class TRPCGenerator implements OnModuleInit {
5
+ private project;
6
+ private readonly APP_ROUTER_OUTPUT_FILE;
7
+ private readonly HELPER_TYPES_OUTPUT_FILE;
8
+ private readonly HELPER_TYPES_OUTPUT_PATH;
9
+ private readonly consoleLogger;
10
+ private readonly middlewareHandler;
11
+ private readonly contextHandler;
12
+ private readonly serializerHandler;
13
+ private readonly routerFactory;
14
+ private readonly procedureFactory;
15
+ private readonly middlewareFactory;
16
+ onModuleInit(): void;
17
+ generateSchemaFile(outputDirPath: string): Promise<void>;
18
+ generateHelpersFile(context?: Class<TRPCContext>): Promise<void>;
19
+ }
20
+ //# sourceMappingURL=trpc.generator.d.ts.map
@@ -1,5 +1,4 @@
1
1
  "use strict";
2
- var _a;
3
2
  Object.defineProperty(exports, "__esModule", { value: true });
4
3
  exports.TRPCGenerator = void 0;
5
4
  const tslib_1 = require("tslib");
@@ -87,7 +86,7 @@ let TRPCGenerator = class TRPCGenerator {
87
86
  exports.TRPCGenerator = TRPCGenerator;
88
87
  tslib_1.__decorate([
89
88
  (0, common_1.Inject)(common_1.ConsoleLogger),
90
- tslib_1.__metadata("design:type", typeof (_a = typeof common_1.ConsoleLogger !== "undefined" && common_1.ConsoleLogger) === "function" ? _a : Object)
89
+ tslib_1.__metadata("design:type", common_1.ConsoleLogger)
91
90
  ], TRPCGenerator.prototype, "consoleLogger", void 0);
92
91
  tslib_1.__decorate([
93
92
  (0, common_1.Inject)(middleware_generator_1.MiddlewareGenerator),
@@ -0,0 +1,4 @@
1
+ export * from './trpc.module';
2
+ export * from './interfaces';
3
+ export * from './decorators';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,6 @@
1
+ import type { CreateExpressContextOptions } from '@trpc/server/adapters/express';
2
+ export type ExpressContextOptions = CreateExpressContextOptions;
3
+ export interface TRPCContext {
4
+ create(opts: ExpressContextOptions): Record<string, unknown> | Promise<Record<string, unknown>>;
5
+ }
6
+ //# sourceMappingURL=context.interface.d.ts.map
@@ -0,0 +1,60 @@
1
+ import type { ProcedureRouterRecord, AnyRouter, AnyRootConfig, ProcedureBuilder, ProcedureType, Router, ProcedureParams } from '@trpc/server';
2
+ import type { RouterDef } from '@trpc/server/dist/core/router';
3
+ import type { ZodSchema, ZodType, ZodTypeDef } from 'zod';
4
+ import type { TRPCMiddleware } from './middleware.interface';
5
+ import type { Class } from 'type-fest';
6
+ export declare enum ProcedureParamDecoratorType {
7
+ Options = "options",
8
+ Ctx = "ctx",
9
+ Input = "input",
10
+ RawInput = "rawInput",
11
+ Type = "type",
12
+ Path = "path"
13
+ }
14
+ export type ProcedureImplementation = ({ input, output, }: {
15
+ input?: ZodType<any, ZodTypeDef, any>;
16
+ output?: ZodType<any, ZodTypeDef, any>;
17
+ }) => any;
18
+ interface ProcedureParamDecoratorBase {
19
+ type: ProcedureParamDecoratorType;
20
+ index: number;
21
+ }
22
+ export type ProcedureInputParamDecorator = ProcedureParamDecoratorBase & {
23
+ type: ProcedureParamDecoratorType.Input;
24
+ key?: string;
25
+ };
26
+ export type ProcedureParamDecorator = ProcedureParamDecoratorBase | ProcedureInputParamDecorator;
27
+ export interface ProcedureFactoryMetadata {
28
+ type: ProcedureType;
29
+ input: ZodSchema | undefined;
30
+ output: ZodSchema | undefined;
31
+ middlewares?: Class<TRPCMiddleware>;
32
+ name: string;
33
+ implementation: ProcedureImplementation;
34
+ params: Array<ProcedureParamDecorator> | undefined;
35
+ }
36
+ export interface CustomProcedureFactoryMetadata {
37
+ name: string;
38
+ instance: unknown;
39
+ }
40
+ export interface RouterInstance {
41
+ name: string;
42
+ instance: unknown;
43
+ alias?: string;
44
+ middlewares?: TRPCMiddleware;
45
+ }
46
+ export interface RoutersFactoryMetadata {
47
+ name: string;
48
+ alias?: string;
49
+ instance: RouterInstance;
50
+ procedures: Array<ProcedureFactoryMetadata>;
51
+ }
52
+ export type TRPCRouter = <TProcRouterRecord extends ProcedureRouterRecord>(procedures: TProcRouterRecord) => AnyRouter;
53
+ export type TRPCMergeRoutes = <TRouters extends AnyRouter[]>(...routerList_0: TRouters) => Router<RouterDef<AnyRootConfig, {}, {
54
+ queries: {};
55
+ mutations: {};
56
+ subscriptions: {};
57
+ }>>;
58
+ export type TRPCPublicProcedure = ProcedureBuilder<ProcedureParams>;
59
+ export {};
60
+ //# sourceMappingURL=factory.interface.d.ts.map
@@ -0,0 +1,22 @@
1
+ import { Expression, SourceFile } from 'ts-morph';
2
+ export interface RouterGeneratorMetadata {
3
+ name: string;
4
+ alias?: string;
5
+ procedures: Array<ProcedureGeneratorMetadata>;
6
+ }
7
+ export interface ProcedureGeneratorMetadata {
8
+ name: string;
9
+ decorators: Array<DecoratorGeneratorMetadata>;
10
+ }
11
+ export interface DecoratorGeneratorMetadata {
12
+ name: 'Query' | 'Mutation';
13
+ arguments: {
14
+ input?: string;
15
+ output?: string;
16
+ };
17
+ }
18
+ export interface SourceFileImportsMap {
19
+ initializer: Expression;
20
+ sourceFile: SourceFile;
21
+ }
22
+ //# sourceMappingURL=generator.interface.d.ts.map
@@ -0,0 +1,5 @@
1
+ export * from './module-options.interface';
2
+ export * from './middleware.interface';
3
+ export * from './procedure-options.interface';
4
+ export * from './context.interface';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,20 @@
1
+ import type { ProcedureType, ProcedureParams } from '@trpc/server';
2
+ import type { MiddlewareResult } from '@trpc/server/dist/core/middleware';
3
+ export type MiddlewareResponse = Promise<MiddlewareResult<ProcedureParams>> | (<$Context>(opts: {
4
+ ctx: $Context;
5
+ }) => Promise<MiddlewareResult<ProcedureParams>>);
6
+ export type MiddlewareOptions<TContext extends object = object> = {
7
+ ctx: TContext;
8
+ type: ProcedureType;
9
+ path: string;
10
+ input: unknown;
11
+ rawInput: unknown;
12
+ meta: unknown;
13
+ next: (opts?: {
14
+ ctx: Record<string, unknown>;
15
+ }) => Promise<MiddlewareResult<ProcedureParams>>;
16
+ };
17
+ export interface TRPCMiddleware {
18
+ use(opts: MiddlewareOptions): MiddlewareResponse | Promise<MiddlewareResponse>;
19
+ }
20
+ //# sourceMappingURL=middleware.interface.d.ts.map
@@ -0,0 +1,38 @@
1
+ import { RootConfigTypes } from '@trpc/server/dist/core/internals/config';
2
+ import { ErrorFormatter } from '@trpc/server/dist/error/formatter';
3
+ import { TRPCErrorShape } from '@trpc/server/dist/rpc';
4
+ import { TRPCContext } from './context.interface';
5
+ import type { Class } from 'type-fest';
6
+ /**
7
+ * "TRPCModule" options object.
8
+ */
9
+ export interface TRPCModuleOptions {
10
+ /**
11
+ * Path to trpc router and helpers types output.
12
+ */
13
+ autoSchemaFile?: string;
14
+ /**
15
+ * The base path for all trpc requests.
16
+ * @default "/trpc"
17
+ */
18
+ basePath?: string;
19
+ /**
20
+ * The exposed trpc options when creating a route with `createExpressMiddleware`.
21
+ * If not provided, the adapter will use a default createContext.
22
+ * @link https://nestjs-trpc.io/docs/context
23
+ */
24
+ context?: Class<TRPCContext>;
25
+ /**
26
+ * Use custom error formatting
27
+ * @link https://trpc.io/docs/error-formatting
28
+ */
29
+ errorShape?: ErrorFormatter<RootConfigTypes['ctx'], TRPCErrorShape<number> & {
30
+ [key: string]: any;
31
+ }>;
32
+ /**
33
+ * Use a data transformer
34
+ * @link https://trpc.io/docs/data-transformers
35
+ */
36
+ transformer?: RootConfigTypes['transformer'];
37
+ }
38
+ //# sourceMappingURL=module-options.interface.d.ts.map
@@ -0,0 +1,8 @@
1
+ import { ProcedureParams } from '@trpc/server';
2
+ import { ResolveOptions } from '@trpc/server/dist/core/internals/utils';
3
+ export type ProcedureOptions = ResolveOptions<ProcedureParams> & {
4
+ type: string;
5
+ path: string;
6
+ rawInput: string;
7
+ };
8
+ //# sourceMappingURL=procedure-options.interface.d.ts.map
@@ -0,0 +1,8 @@
1
+ export declare const TRPC_MODULE_OPTIONS = "TrpcModuleOptions";
2
+ export declare const ROUTER_METADATA_KEY: unique symbol;
3
+ export declare const PROCEDURE_TYPE_KEY: unique symbol;
4
+ export declare const PROCEDURE_METADATA_KEY: unique symbol;
5
+ export declare const PROCEDURE_PARAM_METADATA_KEY: unique symbol;
6
+ export declare const MIDDLEWARE_KEY: unique symbol;
7
+ export declare const LOGGER_CONTEXT = "TRPC";
8
+ //# sourceMappingURL=trpc.constants.d.ts.map
@@ -0,0 +1,15 @@
1
+ import { ConsoleLogger } from '@nestjs/common';
2
+ import { HttpAdapterHost, ModuleRef } from '@nestjs/core';
3
+ import { TRPCModuleOptions } from './interfaces';
4
+ import { TRPCFactory } from './factories/trpc.factory';
5
+ import { TRPCGenerator } from './generators/trpc.generator';
6
+ export declare class TRPCDriver<TOptions extends Record<string, any> = TRPCModuleOptions> {
7
+ private moduleRef;
8
+ protected readonly httpAdapterHost: HttpAdapterHost;
9
+ protected readonly trpcFactory: TRPCFactory;
10
+ protected readonly trpcGenerator: TRPCGenerator;
11
+ protected readonly consoleLogger: ConsoleLogger;
12
+ constructor(moduleRef: ModuleRef);
13
+ start(options: TRPCModuleOptions): Promise<void>;
14
+ }
15
+ //# sourceMappingURL=trpc.driver.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"trpc.driver.d.ts","sourceRoot":"","sources":["../lib/trpc.driver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAA4B,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAAqB,eAAe,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE7E,OAAO,EAAe,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAG9D,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAG5D,qBACa,UAAU,CACrB,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,iBAAiB;IAc5C,OAAO,CAAC,SAAS;IAX7B,SAAS,CAAC,QAAQ,CAAC,eAAe,EAAG,eAAe,CAAC;IAGrD,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAG,WAAW,CAAC;IAG7C,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAG,aAAa,CAAC;IAGjD,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAG,aAAa,CAAC;gBAE7B,SAAS,EAAE,SAAS;IAE3B,KAAK,CAAC,OAAO,EAAE,iBAAiB;CAsD9C"}
1
+ {"version":3,"file":"trpc.driver.d.ts","sourceRoot":"","sources":["../lib/trpc.driver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAA4B,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAAqB,eAAe,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE7E,OAAO,EAAe,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAG9D,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAG5D,qBACa,UAAU,CACrB,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,iBAAiB;IAc5C,OAAO,CAAC,SAAS;IAX7B,SAAS,CAAC,QAAQ,CAAC,eAAe,EAAG,eAAe,CAAC;IAGrD,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAG,WAAW,CAAC;IAG7C,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAG,aAAa,CAAC;IAGjD,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAG,aAAa,CAAC;gBAE7B,SAAS,EAAE,SAAS;IAE3B,KAAK,CAAC,OAAO,EAAE,iBAAiB;CAuD9C"}
@@ -1,5 +1,4 @@
1
1
  "use strict";
2
- var _a, _b, _c;
3
2
  Object.defineProperty(exports, "__esModule", { value: true });
4
3
  exports.TRPCDriver = void 0;
5
4
  const tslib_1 = require("tslib");
@@ -21,7 +20,7 @@ let TRPCDriver = class TRPCDriver {
21
20
  throw new Error(`No support for current HttpAdapter: ${platformName}`);
22
21
  }
23
22
  const app = httpAdapter.getInstance();
24
- //@ts-ignore Ignoring typescript here since its the same type yet it still isn't able to infer it.
23
+ //@ts-ignore Ignoring typescript here since it's the same type, yet it still isn't able to infer it.
25
24
  const { procedure, router } = server_1.initTRPC.context().create({
26
25
  ...(options.transformer != null
27
26
  ? { transformer: options.transformer }
@@ -55,7 +54,7 @@ let TRPCDriver = class TRPCDriver {
55
54
  exports.TRPCDriver = TRPCDriver;
56
55
  tslib_1.__decorate([
57
56
  (0, common_1.Inject)(core_1.HttpAdapterHost),
58
- tslib_1.__metadata("design:type", typeof (_b = typeof core_1.HttpAdapterHost !== "undefined" && core_1.HttpAdapterHost) === "function" ? _b : Object)
57
+ tslib_1.__metadata("design:type", core_1.HttpAdapterHost)
59
58
  ], TRPCDriver.prototype, "httpAdapterHost", void 0);
60
59
  tslib_1.__decorate([
61
60
  (0, common_1.Inject)(trpc_factory_1.TRPCFactory),
@@ -67,9 +66,9 @@ tslib_1.__decorate([
67
66
  ], TRPCDriver.prototype, "trpcGenerator", void 0);
68
67
  tslib_1.__decorate([
69
68
  (0, common_1.Inject)(common_1.ConsoleLogger),
70
- tslib_1.__metadata("design:type", typeof (_c = typeof common_1.ConsoleLogger !== "undefined" && common_1.ConsoleLogger) === "function" ? _c : Object)
69
+ tslib_1.__metadata("design:type", common_1.ConsoleLogger)
71
70
  ], TRPCDriver.prototype, "consoleLogger", void 0);
72
71
  exports.TRPCDriver = TRPCDriver = tslib_1.__decorate([
73
72
  (0, common_1.Injectable)(),
74
- tslib_1.__metadata("design:paramtypes", [typeof (_a = typeof core_1.ModuleRef !== "undefined" && core_1.ModuleRef) === "function" ? _a : Object])
73
+ tslib_1.__metadata("design:paramtypes", [core_1.ModuleRef])
75
74
  ], TRPCDriver);
@@ -0,0 +1,5 @@
1
+ export declare enum ProcedureType {
2
+ Query = "Query",
3
+ Mutation = "Mutation"
4
+ }
5
+ //# sourceMappingURL=trpc.enum.d.ts.map
@@ -0,0 +1,11 @@
1
+ import { DynamicModule, OnModuleInit } from '@nestjs/common/interfaces';
2
+ import { TRPCModuleOptions } from './interfaces';
3
+ export declare class TRPCModule implements OnModuleInit {
4
+ private readonly options;
5
+ private readonly consoleLogger;
6
+ private readonly httpAdapterHost;
7
+ private readonly trpcDriver;
8
+ static forRoot<TOptions extends Record<string, any> = TRPCModuleOptions>(options?: TOptions): DynamicModule;
9
+ onModuleInit(): Promise<void>;
10
+ }
11
+ //# sourceMappingURL=trpc.module.d.ts.map
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
  var TRPCModule_1;
3
- var _a, _b;
4
3
  Object.defineProperty(exports, "__esModule", { value: true });
5
4
  exports.TRPCModule = void 0;
6
5
  const tslib_1 = require("tslib");
@@ -41,11 +40,11 @@ tslib_1.__decorate([
41
40
  ], TRPCModule.prototype, "options", void 0);
42
41
  tslib_1.__decorate([
43
42
  (0, common_1.Inject)(common_1.ConsoleLogger),
44
- tslib_1.__metadata("design:type", typeof (_a = typeof common_1.ConsoleLogger !== "undefined" && common_1.ConsoleLogger) === "function" ? _a : Object)
43
+ tslib_1.__metadata("design:type", common_1.ConsoleLogger)
45
44
  ], TRPCModule.prototype, "consoleLogger", void 0);
46
45
  tslib_1.__decorate([
47
46
  (0, common_1.Inject)(core_1.HttpAdapterHost),
48
- tslib_1.__metadata("design:type", typeof (_b = typeof core_1.HttpAdapterHost !== "undefined" && core_1.HttpAdapterHost) === "function" ? _b : Object)
47
+ tslib_1.__metadata("design:type", core_1.HttpAdapterHost)
49
48
  ], TRPCModule.prototype, "httpAdapterHost", void 0);
50
49
  tslib_1.__decorate([
51
50
  (0, common_1.Inject)(trpc_driver_1.TRPCDriver),
@@ -0,0 +1,6 @@
1
+ import { SourceFile, Decorator } from 'ts-morph';
2
+ import { SourceFileImportsMap } from '../interfaces/generator.interface';
3
+ export declare function generateStaticDeclaration(sourceFile: SourceFile): void;
4
+ export declare function saveOrOverrideFile(sourceFile: SourceFile): Promise<void>;
5
+ export declare function getDecoratorPropertyValue(decorator: Decorator, propertyName: string, sourceFile: SourceFile, importsMap: Map<string, SourceFileImportsMap>): string | null;
6
+ //# sourceMappingURL=file.util.d.ts.map
@@ -0,0 +1,6 @@
1
+ import { Node, SourceFile, Type } from 'ts-morph';
2
+ import { ProcedureGeneratorMetadata, SourceFileImportsMap } from '../interfaces/generator.interface';
3
+ export declare function findCtxOutProperty(type: Type): string | undefined;
4
+ export declare function generateProcedureString(procedure: ProcedureGeneratorMetadata): string;
5
+ export declare function flattenZodSchema(node: Node, importsMap: Map<string, SourceFileImportsMap>, sourceFile: SourceFile, schema: string): string;
6
+ //# sourceMappingURL=type.util.d.ts.map
@@ -0,0 +1,9 @@
1
+ export declare class InvalidDecoratorItemException extends Error {
2
+ private readonly msg;
3
+ constructor(decorator: string, item: string, context: string);
4
+ what(): string;
5
+ }
6
+ export declare function validateEach(context: {
7
+ name: string;
8
+ }, arr: any[], predicate: Function, decorator: string, item: string): boolean;
9
+ //# sourceMappingURL=validate-each.util.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nestjs-trpc",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "homepage": "https://nestjs-trpc.io",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./lib/index.ts",