@lenne.tech/nest-server 8.3.1 → 8.6.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 (99) hide show
  1. package/dist/core/common/decorators/restricted.decorator.d.ts +12 -5
  2. package/dist/core/common/decorators/restricted.decorator.js +91 -29
  3. package/dist/core/common/decorators/restricted.decorator.js.map +1 -1
  4. package/dist/core/common/enums/process-type.enum.d.ts +4 -0
  5. package/dist/core/common/enums/process-type.enum.js +9 -0
  6. package/dist/core/common/enums/process-type.enum.js.map +1 -0
  7. package/dist/core/common/enums/role.enum.d.ts +1 -2
  8. package/dist/core/common/enums/role.enum.js +0 -1
  9. package/dist/core/common/enums/role.enum.js.map +1 -1
  10. package/dist/core/common/helpers/db.helper.d.ts +4 -4
  11. package/dist/core/common/helpers/db.helper.js +54 -30
  12. package/dist/core/common/helpers/db.helper.js.map +1 -1
  13. package/dist/core/common/helpers/input.helper.d.ts +6 -5
  14. package/dist/core/common/helpers/input.helper.js +4 -15
  15. package/dist/core/common/helpers/input.helper.js.map +1 -1
  16. package/dist/core/common/helpers/service.helper.d.ts +12 -0
  17. package/dist/core/common/helpers/service.helper.js +42 -3
  18. package/dist/core/common/helpers/service.helper.js.map +1 -1
  19. package/dist/core/common/interfaces/prepare-input-options.interface.d.ts +8 -0
  20. package/dist/core/common/interfaces/prepare-input-options.interface.js +3 -0
  21. package/dist/core/common/interfaces/prepare-input-options.interface.js.map +1 -0
  22. package/dist/core/common/interfaces/prepare-output-options.interface.d.ts +7 -0
  23. package/dist/core/common/interfaces/prepare-output-options.interface.js +3 -0
  24. package/dist/core/common/interfaces/prepare-output-options.interface.js.map +1 -0
  25. package/dist/core/common/interfaces/service-options.interface.d.ts +5 -17
  26. package/dist/core/common/models/core-persistence.model.d.ts +0 -1
  27. package/dist/core/common/models/core-persistence.model.js +0 -10
  28. package/dist/core/common/models/core-persistence.model.js.map +1 -1
  29. package/dist/core/common/services/module.service.d.ts +4 -4
  30. package/dist/core/common/services/module.service.js +27 -26
  31. package/dist/core/common/services/module.service.js.map +1 -1
  32. package/dist/core/common/types/require-only-one.type.d.ts +3 -0
  33. package/dist/core/common/types/require-only-one.type.js +3 -0
  34. package/dist/core/common/types/require-only-one.type.js.map +1 -0
  35. package/dist/core/common/types/required-at-least-one.type.d.ts +3 -0
  36. package/dist/core/common/types/required-at-least-one.type.js +3 -0
  37. package/dist/core/common/types/required-at-least-one.type.js.map +1 -0
  38. package/dist/core/modules/auth/inputs/core-auth-sign-in.input.d.ts +5 -0
  39. package/dist/core/modules/auth/inputs/core-auth-sign-in.input.js +34 -0
  40. package/dist/core/modules/auth/inputs/core-auth-sign-in.input.js.map +1 -0
  41. package/dist/core/modules/auth/inputs/core-auth-sign-up.input.d.ts +5 -0
  42. package/dist/core/modules/auth/inputs/core-auth-sign-up.input.js +34 -0
  43. package/dist/core/modules/auth/inputs/core-auth-sign-up.input.js.map +1 -0
  44. package/dist/core.module.js +0 -5
  45. package/dist/core.module.js.map +1 -1
  46. package/dist/index.d.ts +5 -0
  47. package/dist/index.js +5 -0
  48. package/dist/index.js.map +1 -1
  49. package/dist/server/modules/auth/auth.model.js +2 -2
  50. package/dist/server/modules/auth/auth.model.js.map +1 -1
  51. package/dist/server/modules/auth/auth.module.js +7 -2
  52. package/dist/server/modules/auth/auth.module.js.map +1 -1
  53. package/dist/server/modules/auth/auth.resolver.d.ts +8 -3
  54. package/dist/server/modules/auth/auth.resolver.js +33 -10
  55. package/dist/server/modules/auth/auth.resolver.js.map +1 -1
  56. package/dist/server/modules/auth/auth.service.d.ts +15 -0
  57. package/dist/server/modules/auth/auth.service.js +71 -0
  58. package/dist/server/modules/auth/auth.service.js.map +1 -0
  59. package/dist/server/modules/auth/inputs/auth-sign-in.input.d.ts +3 -0
  60. package/dist/server/modules/auth/inputs/auth-sign-in.input.js +18 -0
  61. package/dist/server/modules/auth/inputs/auth-sign-in.input.js.map +1 -0
  62. package/dist/server/modules/auth/inputs/auth-sign-up.input.d.ts +5 -0
  63. package/dist/server/modules/auth/inputs/auth-sign-up.input.js +34 -0
  64. package/dist/server/modules/auth/inputs/auth-sign-up.input.js.map +1 -0
  65. package/dist/server/modules/user/user.model.d.ts +1 -1
  66. package/dist/server/modules/user/user.model.js +1 -1
  67. package/dist/server/modules/user/user.model.js.map +1 -1
  68. package/dist/server/modules/user/user.resolver.js +12 -11
  69. package/dist/server/modules/user/user.resolver.js.map +1 -1
  70. package/dist/server/modules/user/user.service.js +1 -5
  71. package/dist/server/modules/user/user.service.js.map +1 -1
  72. package/dist/tsconfig.build.tsbuildinfo +1 -1
  73. package/package.json +4 -4
  74. package/src/core/common/decorators/restricted.decorator.ts +150 -53
  75. package/src/core/common/enums/process-type.enum.ts +7 -0
  76. package/src/core/common/enums/role.enum.ts +1 -4
  77. package/src/core/common/helpers/db.helper.ts +70 -56
  78. package/src/core/common/helpers/input.helper.ts +24 -15
  79. package/src/core/common/helpers/service.helper.ts +72 -2
  80. package/src/core/common/interfaces/prepare-input-options.interface.ts +11 -0
  81. package/src/core/common/interfaces/prepare-output-options.interface.ts +10 -0
  82. package/src/core/common/interfaces/service-options.interface.ts +8 -22
  83. package/src/core/common/models/core-persistence.model.ts +0 -11
  84. package/src/core/common/services/module.service.ts +32 -31
  85. package/src/core/common/types/require-only-one.type.ts +6 -0
  86. package/src/core/common/types/required-at-least-one.type.ts +6 -0
  87. package/src/core/modules/auth/inputs/core-auth-sign-in.input.ts +18 -0
  88. package/src/core/modules/auth/inputs/core-auth-sign-up.input.ts +18 -0
  89. package/src/core.module.ts +1 -19
  90. package/src/index.ts +5 -0
  91. package/src/server/modules/auth/auth.model.ts +5 -5
  92. package/src/server/modules/auth/auth.module.ts +13 -2
  93. package/src/server/modules/auth/auth.resolver.ts +30 -12
  94. package/src/server/modules/auth/auth.service.ts +84 -0
  95. package/src/server/modules/auth/inputs/auth-sign-in.input.ts +10 -0
  96. package/src/server/modules/auth/inputs/auth-sign-up.input.ts +18 -0
  97. package/src/server/modules/user/user.model.ts +2 -2
  98. package/src/server/modules/user/user.resolver.ts +12 -11
  99. package/src/server/modules/user/user.service.ts +3 -11
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.prepareOutput = exports.prepareInput = void 0;
3
+ exports.prepareServiceOptions = exports.prepareOutput = exports.prepareInput = void 0;
4
4
  const common_1 = require("@nestjs/common");
5
5
  const bcrypt = require("bcrypt");
6
+ const class_transformer_1 = require("class-transformer");
6
7
  const _ = require("lodash");
7
8
  const role_enum_1 = require("../enums/role.enum");
8
9
  class ServiceHelper {
@@ -15,6 +16,7 @@ class ServiceHelper {
15
16
  }
16
17
  exports.default = ServiceHelper;
17
18
  async function prepareInput(input, currentUser, options = {}) {
19
+ var _a;
18
20
  const config = Object.assign({ checkRoles: false, clone: false, create: false, getNewArray: false, removeUndefined: false }, options);
19
21
  if (typeof input !== 'object') {
20
22
  return input;
@@ -31,6 +33,14 @@ async function prepareInput(input, currentUser, options = {}) {
31
33
  input = _.cloneDeep(input);
32
34
  }
33
35
  }
36
+ if (config.targetModel && !(input instanceof config.targetModel)) {
37
+ if ((_a = config.targetModel) === null || _a === void 0 ? void 0 : _a.map) {
38
+ input = await config.targetModel.map(input);
39
+ }
40
+ else {
41
+ input = (0, class_transformer_1.plainToInstance)(config.targetModel, input);
42
+ }
43
+ }
34
44
  if (config.removeUndefined) {
35
45
  Object.keys(input).forEach((key) => input[key] === undefined && delete input[key]);
36
46
  }
@@ -62,6 +72,7 @@ async function prepareInput(input, currentUser, options = {}) {
62
72
  }
63
73
  exports.prepareInput = prepareInput;
64
74
  async function prepareOutput(output, options = {}) {
75
+ var _a;
65
76
  const config = Object.assign({ clone: false, getNewArray: false, removeUndefined: false, targetModel: undefined }, options);
66
77
  if (typeof output !== 'object') {
67
78
  return output;
@@ -78,8 +89,13 @@ async function prepareOutput(output, options = {}) {
78
89
  output = _.cloneDeep(output);
79
90
  }
80
91
  }
81
- if (config.targetModel) {
82
- output = await config.targetModel.map(output);
92
+ if (config.targetModel && !(output instanceof config.targetModel)) {
93
+ if ((_a = config.targetModel) === null || _a === void 0 ? void 0 : _a.map) {
94
+ output = await config.targetModel.map(output);
95
+ }
96
+ else {
97
+ output = (0, class_transformer_1.plainToInstance)(config.targetModel, output);
98
+ }
83
99
  }
84
100
  if (output.password) {
85
101
  output.password = undefined;
@@ -96,4 +112,27 @@ async function prepareOutput(output, options = {}) {
96
112
  return output;
97
113
  }
98
114
  exports.prepareOutput = prepareOutput;
115
+ function prepareServiceOptions(serviceOptions, options) {
116
+ var _a;
117
+ const config = Object.assign({ clone: true }, options);
118
+ if (serviceOptions && config.clone) {
119
+ serviceOptions = _.cloneDeep(serviceOptions);
120
+ }
121
+ serviceOptions = serviceOptions || {};
122
+ serviceOptions.inputType = serviceOptions.inputType || (options === null || options === void 0 ? void 0 : options.inputType);
123
+ serviceOptions.outputType = serviceOptions.outputType || (options === null || options === void 0 ? void 0 : options.outputType);
124
+ if (!serviceOptions.prepareInput && 'prepareInput' in config) {
125
+ serviceOptions.prepareInput = config.prepareInput;
126
+ }
127
+ if (!serviceOptions.prepareOutput && 'prepareOutput' in config) {
128
+ serviceOptions.prepareOutput = config.prepareOutput;
129
+ }
130
+ if (config.subFieldSelection) {
131
+ if ((_a = serviceOptions.fieldSelection) === null || _a === void 0 ? void 0 : _a.select) {
132
+ serviceOptions.fieldSelection.select += '.' + config.subFieldSelection;
133
+ }
134
+ }
135
+ return serviceOptions;
136
+ }
137
+ exports.prepareServiceOptions = prepareServiceOptions;
99
138
  //# sourceMappingURL=service.helper.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"service.helper.js","sourceRoot":"","sources":["../../../../src/core/common/helpers/service.helper.ts"],"names":[],"mappings":";;;AAAA,2CAAuD;AACvD,iCAAiC;AACjC,4BAA4B;AAC5B,kDAA8C;AAM9C,MAAqB,aAAa;IAIhC,MAAM,CAAC,KAAK,CAAC,YAAY,CACvB,KAAQ,EACR,WAA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AAkB,EAAE;QAC7B,MAAM,CAAC,kBAAkB,GAAG,SAAS,CAAC;KACvC;IAGD,IAAI,MAAM,CAAC,eAAe,EAAE;QAC1B,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,SAAS,IAAI,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;KACvF;IAGD,OAAO,MAAM,CAAC;AAChB,CAAC;AAlED,sCAkEC"}
1
+ {"version":3,"file":"service.helper.js","sourceRoot":"","sources":["../../../../src/core/common/helpers/service.helper.ts"],"names":[],"mappings":";;;AAAA,2CAAuD;AACvD,iCAAiC;AACjC,yDAAoD;AACpD,4BAA4B;AAC5B,kDAA8C;AAU9C,MAAqB,aAAa;IAIhC,MAAM,CAAC,KAAK,CAAC,YAAY,CACvB,KAAQ,EACR,WAA+C,EAC/C,UAMI,EAAE;QAEN,OAAO,YAAY,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;IACnD,CAAC;IAKD,MAAM,CAAC,KAAK,CAAC,aAAa,CACxB,MAAW,EACX,UAMI,EAAE;QAEN,OAAO,aAAa,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxC,CAAC;CACF;AAjCD,gCAiCC;AAKM,KAAK,UAAU,YAAY,CAChC,KAAQ,EACR,WAA+C,EAC/C,UAOI,EAAE;;IAGN,MAAM,MAAM,mBACV,UAAU,EAAE,KAAK,EACjB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,KAAK,EACb,WAAW,EAAE,KAAK,EAClB,eAAe,EAAE,KAAK,IACnB,OAAO,CACX,CAAC;IAGF,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC7B,OAAO,KAAK,CAAC;KACd;IAGD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACxB,MAAM,cAAc,GAAG,KAAK,CAAC,GAAG,CAAC,KA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InputOptions {
2
+ [key: string]: any;
3
+ create?: boolean;
4
+ clone?: boolean;
5
+ getNewArray?: boolean;
6
+ removeUndefined?: boolean;
7
+ targetModel?: new (...args: any[]) => any;
8
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=prepare-input-options.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prepare-input-options.interface.js","sourceRoot":"","sources":["../../../../src/core/common/interfaces/prepare-input-options.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ export interface PrepareOutputOptions {
2
+ [key: string]: any;
3
+ clone?: boolean;
4
+ getNewArray?: boolean;
5
+ removeUndefined?: boolean;
6
+ targetModel?: new (...args: any[]) => any;
7
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=prepare-output-options.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prepare-output-options.interface.js","sourceRoot":"","sources":["../../../../src/core/common/interfaces/prepare-output-options.interface.ts"],"names":[],"mappings":""}
@@ -1,6 +1,7 @@
1
1
  import { Model } from 'mongoose';
2
2
  import { FieldSelection } from '../types/field-selection.type';
3
- import { IdsType } from '../types/ids.type';
3
+ import { PrepareInputOptions } from './prepare-input-options.interface';
4
+ import { PrepareOutputOptions } from './prepare-output-options.interface';
4
5
  export interface ServiceOptions {
5
6
  [key: string]: any;
6
7
  checkRights?: boolean;
@@ -11,26 +12,13 @@ export interface ServiceOptions {
11
12
  };
12
13
  fieldSelection?: FieldSelection;
13
14
  inputType?: new (...params: any[]) => any;
14
- ownerIds?: IdsType;
15
+ outputType?: new (...params: any[]) => any;
15
16
  processFieldSelection?: {
16
17
  model?: new (...args: any[]) => any;
17
18
  dbModel?: Model<any>;
18
19
  };
19
- prepareInput?: {
20
- [key: string]: any;
21
- create?: boolean;
22
- clone?: boolean;
23
- getNewArray?: boolean;
24
- removeUndefined?: boolean;
25
- };
26
- prepareOutput?: {
27
- [key: string]: any;
28
- clone?: boolean;
29
- getNewArray?: boolean;
30
- removeUndefined?: boolean;
31
- targetModel?: new (...args: any[]) => any;
32
- };
20
+ prepareInput?: PrepareInputOptions;
21
+ prepareOutput?: PrepareOutputOptions;
33
22
  pubSub?: boolean;
34
- resultType?: new (...params: any[]) => any;
35
23
  roles?: string | string[];
36
24
  }
@@ -5,7 +5,6 @@ export declare abstract class CorePersistenceModel extends CoreModel {
5
5
  id: string;
6
6
  createdAt: Date;
7
7
  labels: string[];
8
- ownerIds: string[];
9
8
  tags: string[];
10
9
  updatedAt: Date;
11
10
  init(): this;
@@ -20,7 +20,6 @@ let CorePersistenceModel = class CorePersistenceModel extends core_model_model_1
20
20
  this.id = undefined;
21
21
  this.createdAt = undefined;
22
22
  this.labels = undefined;
23
- this.ownerIds = undefined;
24
23
  this.tags = undefined;
25
24
  this.updatedAt = undefined;
26
25
  }
@@ -31,7 +30,6 @@ let CorePersistenceModel = class CorePersistenceModel extends core_model_model_1
31
30
  super.init();
32
31
  this.createdAt = this.createdAt === undefined ? new Date() : this.createdAt;
33
32
  this.labels = this.labels === undefined ? [] : this.labels;
34
- this.ownerIds = this.ownerIds === undefined ? [] : this.ownerIds;
35
33
  this.tags = this.tags === undefined ? [] : this.tags;
36
34
  this.updatedAt = this.tags === undefined ? this.createdAt : this.updatedAt;
37
35
  return this;
@@ -57,14 +55,6 @@ __decorate([
57
55
  (0, mongoose_1.Prop)([String]),
58
56
  __metadata("design:type", Array)
59
57
  ], CorePersistenceModel.prototype, "labels", void 0);
60
- __decorate([
61
- (0, graphql_1.Field)((type) => [String], {
62
- description: 'Users who own the object',
63
- nullable: true,
64
- }),
65
- (0, mongoose_1.Prop)([String]),
66
- __metadata("design:type", Array)
67
- ], CorePersistenceModel.prototype, "ownerIds", void 0);
68
58
  __decorate([
69
59
  (0, graphql_1.Field)((type) => [String], {
70
60
  description: 'Tags for the object',
@@ -1 +1 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oB;IALzC,IAAA,oBAAU,EAAC;QACV,WAAW,EAAE,6CAA6C;QAC1D,UAAU,EAAE,IAAI;KACjB,CAAC;IACD,IAAA,iBAAM,EAAC,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;GACP,oBAAoB,CAkFzC;AAlFqB,oDAAoB"}
1
+ {"version":3,"file":"core-persistence.model.js","sourceRoot":"","sources":["../../../../src/core/common/models/core-persistence.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAwD;AACxD,+CAAgD;AAChD,uCAAiC;AACjC,yDAA+C;AAmB/C,IAAsB,oBAAoB,GAA1C,MAAsB,oBAAqB,SAAQ,4BAAS;IAA5D;;QAoBE,OAAE,GAAW,SAAS,CAAC;QAOvB,cAAS,GAAS,SAAS,CAAC;QAU5B,WAAM,GAAa,SAAS,CAAC;QAU7B,SAAI,GAAa,SAAS,CAAC;QAO3B,cAAS,GAAS,SAAS,CAAC;IAiB9B,CAAC;IAlEC,IAAI,GAAG;QACL,OAAO,IAAI,gBAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACrC,CAAC;IAwDD,IAAI;QACF,KAAK,CAAC,IAAI,EAAE,CAAC;QACb,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC;QAC5E,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC;QAC3D,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QACrD,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,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;AAvEqB,oDAAoB"}
@@ -1,8 +1,8 @@
1
1
  import { Document, Model, Types } from 'mongoose';
2
+ import { ProcessType } from '../enums/process-type.enum';
2
3
  import { ServiceOptions } from '../interfaces/service-options.interface';
3
4
  import { CoreModel } from '../models/core-model.model';
4
5
  import { FieldSelection } from '../types/field-selection.type';
5
- import { IdsType } from '../types/ids.type';
6
6
  export declare abstract class ModuleService<T extends CoreModel = any> {
7
7
  protected mainModelConstructor: new (...args: any[]) => T;
8
8
  protected mainDbModel: Model<T & Document>;
@@ -14,9 +14,9 @@ export declare abstract class ModuleService<T extends CoreModel = any> {
14
14
  id: any;
15
15
  hasRole: (roles: string[]) => boolean;
16
16
  }, options?: {
17
- creator?: IdsType;
17
+ dbObject?: any;
18
18
  metatype?: any;
19
- ownerIds?: IdsType;
19
+ processType?: ProcessType;
20
20
  roles?: string | string[];
21
21
  throwError?: boolean;
22
22
  }): Promise<any>;
@@ -31,7 +31,7 @@ export declare abstract class ModuleService<T extends CoreModel = any> {
31
31
  input?: any;
32
32
  serviceOptions?: ServiceOptions;
33
33
  }): Promise<any>;
34
- prepareInput(input: Record<string, any>, options?: ServiceOptions): Promise<Record<string, any>>;
34
+ prepareInput(input: Record<string, any>, options?: ServiceOptions): Promise<any>;
35
35
  prepareOutput(output: any, options?: ServiceOptions): Promise<any>;
36
36
  processFieldSelection(data: any, fieldsSelection: FieldSelection, options?: {
37
37
  model?: new (...args: any[]) => T;
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ModuleService = void 0;
4
4
  const mongoose_1 = require("mongoose");
5
+ const process_type_enum_1 = require("../enums/process-type.enum");
5
6
  const db_helper_1 = require("../helpers/db.helper");
6
7
  const input_helper_1 = require("../helpers/input.helper");
7
8
  const service_helper_1 = require("../helpers/service.helper");
@@ -15,33 +16,26 @@ class ModuleService {
15
16
  return (0, input_helper_1.check)(input, currentUser, config);
16
17
  }
17
18
  async process(serviceFunc, options) {
18
- var _a, _b, _c;
19
19
  const config = Object.assign({ checkRights: true, dbObject: options === null || options === void 0 ? void 0 : options.dbObject, input: options === null || options === void 0 ? void 0 : options.input, processFieldSelection: {}, prepareInput: {}, prepareOutput: {}, pubSub: true }, options === null || options === void 0 ? void 0 : options.serviceOptions);
20
20
  if (config.prepareInput && this.prepareInput) {
21
- await this.prepareInput(config.input, config.prepareInput);
21
+ const opts = config.prepareInput;
22
+ if (!opts.targetModel && config.inputType) {
23
+ opts.targetModel = config.inputType;
24
+ }
25
+ await this.prepareInput(config.input, opts);
22
26
  }
23
- const getDbObject = async () => {
24
- if (config.dbObject) {
25
- if (typeof config.dbObject === 'string' || config.dbObject instanceof mongoose_1.Types.ObjectId) {
26
- const dbObject = await this.get((0, db_helper_1.getStringIds)(config.dbObject));
27
- if (dbObject) {
28
- config.dbObject = dbObject;
29
- }
27
+ if (config.dbObject && config.checkRights && this.checkRights) {
28
+ if (typeof config.dbObject === 'string' || config.dbObject instanceof mongoose_1.Types.ObjectId) {
29
+ const dbObject = await this.get((0, db_helper_1.getStringIds)(config.dbObject));
30
+ if (dbObject) {
31
+ config.dbObject = dbObject;
30
32
  }
31
33
  }
32
- return config.dbObject;
33
- };
34
- let ownerIds = undefined;
35
- if (config.checkRights && this.checkRights) {
36
- ownerIds = (0, db_helper_1.getStringIds)(config.ownerIds);
37
- if (!(ownerIds === null || ownerIds === void 0 ? void 0 : ownerIds.length)) {
38
- ownerIds = (_a = (await getDbObject())) === null || _a === void 0 ? void 0 : _a.ownerIds;
39
- }
40
34
  }
41
35
  if (config.input && config.checkRights && this.checkRights) {
42
- const opts = { creator: (_b = (await getDbObject())) === null || _b === void 0 ? void 0 : _b.createdBy, ownerIds, roles: config.roles };
36
+ const opts = { dbObject: config.dbObject, processType: process_type_enum_1.ProcessType.INPUT, roles: config.roles };
43
37
  if (config.inputType) {
44
- opts.metatype = config.resultType;
38
+ opts.metatype = config.inputType;
45
39
  }
46
40
  config.input = await this.checkRights(config.input, config.currentUser, opts);
47
41
  }
@@ -50,22 +44,29 @@ class ModuleService {
50
44
  await this.processFieldSelection(result, config.fieldSelection, config.processFieldSelection);
51
45
  }
52
46
  if (config.prepareOutput && this.prepareOutput) {
53
- if (config.processFieldSelection && config.fieldSelection && this.processFieldSelection) {
54
- config.prepareOutput.targetModel = null;
47
+ const opts = config.prepareOutput;
48
+ if (!opts.targetModel && config.outputType) {
49
+ opts.targetModel = config.outputType;
55
50
  }
56
- result = await this.prepareOutput(result, config.prepareOutput);
51
+ result = await this.prepareOutput(result, opts);
57
52
  }
58
53
  if (config.checkRights && this.checkRights) {
59
- const opts = { creator: (_c = (await getDbObject())) === null || _c === void 0 ? void 0 : _c.createdBy, ownerIds, roles: config.roles, throwError: false };
60
- if (config.resultType) {
61
- opts.metatype = config.resultType;
54
+ const opts = {
55
+ dbObject: config.dbObject,
56
+ processType: process_type_enum_1.ProcessType.OUTPUT,
57
+ roles: config.roles,
58
+ throwError: false,
59
+ };
60
+ if (config.outputType) {
61
+ opts.metatype = config.outputType;
62
62
  }
63
63
  result = await this.checkRights(result, config.currentUser, opts);
64
64
  }
65
65
  return result;
66
66
  }
67
67
  async prepareInput(input, options = {}) {
68
- return (0, service_helper_1.prepareInput)(input, options.currentUser, options.prepareInput);
68
+ const config = Object.assign({ targetModel: this.mainModelConstructor }, options === null || options === void 0 ? void 0 : options.prepareInput);
69
+ return (0, service_helper_1.prepareInput)(input, options.currentUser, config);
69
70
  }
70
71
  async prepareOutput(output, options = {}) {
71
72
  const config = Object.assign({ targetModel: this.mainModelConstructor }, options === null || options === void 0 ? void 0 : options.prepareOutput);
@@ -1 +1 @@
1
- {"version":3,"file":"module.service.js","sourceRoot":"","sources":["../../../../src/core/common/services/module.service.ts"],"names":[],"mappings":";;;AAAA,uCAAkD;AAClD,oDAA+D;AAC/D,0DAAgD;AAChD,8DAAwE;AASxE,MAAsB,aAAa;IAcjC,YAAsB,OAGrB;QACC,IAAI,CAAC,WAAW,GAAG,OAAO,aAAP,OAAO,uBAAP,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KAAK,EAAE,IAAI,CAAC,oBAAoB,EAChC,OAAO,EAAE,IAAI,CAAC,WAAW,IACtB,OAAO,CACX,CAAC;QACF,OAAO,IAAA,qBAAS,EAAC,IAAI,EAAE,eAAe,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IACxE,CAAC;CACF;AA/KD,sCA+KC"}
1
+ {"version":3,"file":"module.service.js","sourceRoot":"","sources":["../../../../src/core/common/services/module.service.ts"],"names":[],"mappings":";;;AAAA,uCAAkD;AAClD,kEAAyD;AACzD,oDAA+D;AAC/D,0DAAgD;AAChD,8DAAwE;AAQxE,MAAsB,aAAa;IAcjC,YAAsB,OAGrB;QACC,IAAI,CAAC,WAAW,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,CAAC;QACxC,IAAI,CAAC,oBAAoB,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,oBAAoB,CAAC;IAC5D,CAAC;IAKD,WAAW,CACT,KAAU,EACV,WAA+D,EAC/D,OAMC;QAED,MAAM,MAAM,mBACV,QAAQ,EAAE,IAAI,CAAC,oBAAoB,IAChC,OAAO,CACX,CAAC;QACF,OAAO,IAAA,oBAAK,EAAC,KAAK,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;IAC3C,CAAC;IAUD,KAAK,CAAC,OAAO,CACX,WAAoG,EACpG,OAKC;QAGD,MAAM,MAAM,mBACV,WAAW,EAAE,IAAI,EACjB,QAAQ,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,EAC3B,KAAK,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,EACrB,qBAAqB,EAAE,EAAE,EACzB,YAAY,EAAE,EAAE,EAChB,aAAa,EAAE,EAAE,EACjB,MAAM,EAAE,IAAI,IACT,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,cAAc,CAC3B,CAAC;QAGF,IAAI,MAAM,CAAC,YAAY,IAAI,I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,CAAC,CAAC;IAC1D,CAAC;IAKD,KAAK,CAAC,aAAa,CAAC,MAAW,EAAE,UAA0B,EAAE;QAC3D,MAAM,MAAM,mBACV,WAAW,EAAE,IAAI,CAAC,oBAAoB,IACnC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,aAAa,CAC1B,CAAC;QACF,OAAO,IAAA,8BAAa,EAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,CAAC;IAMD,KAAK,CAAC,qBAAqB,CACzB,IAAS,EACT,eAA+B,EAC/B,UAGI,EAAE;QAEN,MAAM,MAAM,mBACV,KAAK,EAAE,IAAI,CAAC,oBAAoB,EAChC,OAAO,EAAE,IAAI,CAAC,WAAW,IACtB,OAAO,CACX,CAAC;QACF,OAAO,IAAA,qBAAS,EAAC,IAAI,EAAE,eAAe,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IACxE,CAAC;CACF;AAhLD,sCAgLC"}
@@ -0,0 +1,3 @@
1
+ export declare type RequireOnlyOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, Keys>> & {
2
+ [K in Keys]-?: Required<Pick<T, K>> & Partial<Record<Exclude<Keys, K>, undefined>>;
3
+ }[Keys];
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=require-only-one.type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"require-only-one.type.js","sourceRoot":"","sources":["../../../../src/core/common/types/require-only-one.type.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ export declare type RequireAtLeastOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, Keys>> & {
2
+ [K in Keys]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<Keys, K>>>;
3
+ }[Keys];
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=required-at-least-one.type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"required-at-least-one.type.js","sourceRoot":"","sources":["../../../../src/core/common/types/required-at-least-one.type.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ import { CoreInput } from '../../../common/inputs/core-input.input';
2
+ export declare class CoreAuthSignInInput extends CoreInput {
3
+ email: string;
4
+ password: string;
5
+ }
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.CoreAuthSignInInput = void 0;
13
+ const graphql_1 = require("@nestjs/graphql");
14
+ const core_input_input_1 = require("../../../common/inputs/core-input.input");
15
+ let CoreAuthSignInInput = class CoreAuthSignInInput extends core_input_input_1.CoreInput {
16
+ constructor() {
17
+ super(...arguments);
18
+ this.email = undefined;
19
+ this.password = undefined;
20
+ }
21
+ };
22
+ __decorate([
23
+ (0, graphql_1.Field)({ description: 'Email', nullable: false }),
24
+ __metadata("design:type", String)
25
+ ], CoreAuthSignInInput.prototype, "email", void 0);
26
+ __decorate([
27
+ (0, graphql_1.Field)({ description: 'Password', nullable: false }),
28
+ __metadata("design:type", String)
29
+ ], CoreAuthSignInInput.prototype, "password", void 0);
30
+ CoreAuthSignInInput = __decorate([
31
+ (0, graphql_1.InputType)({ description: 'Sign-in input' })
32
+ ], CoreAuthSignInInput);
33
+ exports.CoreAuthSignInInput = CoreAuthSignInInput;
34
+ //# sourceMappingURL=core-auth-sign-in.input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core-auth-sign-in.input.js","sourceRoot":"","sources":["../../../../../src/core/modules/auth/inputs/core-auth-sign-in.input.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAmD;AACnD,8EAAoE;AAMpE,IAAa,mBAAmB,GAAhC,MAAa,mBAAoB,SAAQ,4BAAS;IAAlD;;QAME,UAAK,GAAW,SAAS,CAAC;QAG1B,aAAQ,GAAW,SAAS,CAAC;IAC/B,CAAC;CAAA,CAAA;AAJC;IADC,IAAA,eAAK,EAAC,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;kDACvB;AAG1B;IADC,IAAA,eAAK,EAAC,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;qDACvB;AATlB,mBAAmB;IAD/B,IAAA,mBAAS,EAAC,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC;GAC/B,mBAAmB,CAU/B;AAVY,kDAAmB"}
@@ -0,0 +1,5 @@
1
+ import { CoreInput } from '../../../common/inputs/core-input.input';
2
+ export declare class CoreAuthSignUpInput extends CoreInput {
3
+ email: string;
4
+ password: string;
5
+ }
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.CoreAuthSignUpInput = void 0;
13
+ const graphql_1 = require("@nestjs/graphql");
14
+ const core_input_input_1 = require("../../../common/inputs/core-input.input");
15
+ let CoreAuthSignUpInput = class CoreAuthSignUpInput extends core_input_input_1.CoreInput {
16
+ constructor() {
17
+ super(...arguments);
18
+ this.email = undefined;
19
+ this.password = undefined;
20
+ }
21
+ };
22
+ __decorate([
23
+ (0, graphql_1.Field)({ description: 'Email', nullable: false }),
24
+ __metadata("design:type", String)
25
+ ], CoreAuthSignUpInput.prototype, "email", void 0);
26
+ __decorate([
27
+ (0, graphql_1.Field)({ description: 'Password', nullable: false }),
28
+ __metadata("design:type", String)
29
+ ], CoreAuthSignUpInput.prototype, "password", void 0);
30
+ CoreAuthSignUpInput = __decorate([
31
+ (0, graphql_1.InputType)({ description: 'Sign-up input' })
32
+ ], CoreAuthSignUpInput);
33
+ exports.CoreAuthSignUpInput = CoreAuthSignUpInput;
34
+ //# sourceMappingURL=core-auth-sign-up.input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core-auth-sign-up.input.js","sourceRoot":"","sources":["../../../../../src/core/modules/auth/inputs/core-auth-sign-up.input.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAmD;AACnD,8EAAoE;AAMpE,IAAa,mBAAmB,GAAhC,MAAa,mBAAoB,SAAQ,4BAAS;IAAlD;;QAME,UAAK,GAAW,SAAS,CAAC;QAG1B,aAAQ,GAAW,SAAS,CAAC;IAC/B,CAAC;CAAA,CAAA;AAJC;IADC,IAAA,eAAK,EAAC,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;kDACvB;AAG1B;IADC,IAAA,eAAK,EAAC,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;qDACvB;AATlB,mBAAmB;IAD/B,IAAA,mBAAS,EAAC,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC;GAC/B,mBAAmB,CAU/B;AAVY,kDAAmB"}
@@ -12,7 +12,6 @@ const common_1 = require("@nestjs/common");
12
12
  const core_1 = require("@nestjs/core");
13
13
  const graphql_1 = require("@nestjs/graphql");
14
14
  const config_helper_1 = require("./core/common/helpers/config.helper");
15
- const check_response_interceptor_1 = require("./core/common/interceptors/check-response.interceptor");
16
15
  const map_and_validate_pipe_1 = require("./core/common/pipes/map-and-validate.pipe");
17
16
  const config_service_1 = require("./core/common/services/config.service");
18
17
  const email_service_1 = require("./core/common/services/email.service");
@@ -71,10 +70,6 @@ let CoreModule = CoreModule_1 = class CoreModule {
71
70
  provide: config_service_1.ConfigService,
72
71
  useValue: new config_service_1.ConfigService(config),
73
72
  },
74
- {
75
- provide: core_1.APP_INTERCEPTOR,
76
- useClass: check_response_interceptor_1.CheckResponseInterceptor,
77
- },
78
73
  {
79
74
  provide: core_1.APP_PIPE,
80
75
  useClass: map_and_validate_pipe_1.MapAndValidatePipe,
@@ -1 +1 @@
1
- {"version":3,"file":"core.module.js","sourceRoot":"","sources":["../src/core.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAAsF;AACtF,uCAAyD;AACzD,6CAAgD;AAChD,uEAA4D;AAC5D,sGAAiG;AAEjG,qFAA+E;AAC/E,0EAAsE;AACtE,wEAAoE;AACpE,8EAA0E;AAC1E,+CAAkD;AAClD,4EAAwE;AACxE,2CAAkE;AAmBlE,IAAa,UAAU,kBAAvB,MAAa,UAAU;IAKrB,MAAM,CAAC,OAAO,CAAC,WAAgB,EAAE,UAAe,EAAE,OAAgC;QAEhF,MAAM,MAAM,GAAmB,IAAA,qBAAK,EAClC;YACE,GAAG,EAAE,SAAS;YACd,OAAO,EAAE;gBACP,MAAM,EAAE;oBACN,OAAO,EAAE,CAAC,UAAU,CAAC;oBACrB,MAAM,EAAE,CAAC,WAAW,CA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C;gBAC9C,OAAO,EAAE;oBACP,iBAAiB,EAAE,CAAC,UAAU,EAAE,EAAE;wBAEhC,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,0CAA0C,CAAC,CAAC,CAAC;wBACvE,OAAO,UAAU,CAAC;oBACpB,CAAC;iBACF;aACF;SACgB,EACnB,OAAO,CACR,CAAC;QAGF,MAAM,SAAS,GAAG;YAEhB;gBACE,OAAO,EAAE,8BAAa;gBACtB,QAAQ,EAAE,IAAI,8BAAa,CAAC,MAAM,CAAC;aACpC;YAGD;gBACE,OAAO,EAAE,eAAQ;gBACjB,QAAQ,EAAE,0CAAkB;aAC7B;YAGD,4BAAY;YACZ,kCAAe;YACf,gCAAc;SACf,CAAC;QAGF,OAAO;YACL,MAAM,EAAE,YAAU;YAClB,OAAO,EAAE;gBACP,yBAAc,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC;gBACpE,uBAAa,CAAC,YAAY,CAAqB,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,qBAAY,EAAE,EAAE,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;aAC/G;YACD,SAAS;YACT,OAAO,EAAE,CAAC,8BAAa,EAAE,4BAAY,EAAE,kCAAe,EAAE,gCAAc,CAAC;SACxE,CAAC;IACJ,CAAC;CACF,CAAA;AA7FY,UAAU;IAFtB,IAAA,eAAM,GAAE;IACR,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,UAAU,CA6FtB;AA7FY,gCAAU"}
package/dist/index.d.ts CHANGED
@@ -7,6 +7,7 @@ export * from './core/common/decorators/restricted.decorator';
7
7
  export * from './core/common/decorators/roles.decorator';
8
8
  export * from './core/common/enums/comparison-operator.enum';
9
9
  export * from './core/common/enums/logical-operator.enum';
10
+ export * from './core/common/enums/process-type.enum';
10
11
  export * from './core/common/enums/role.enum';
11
12
  export * from './core/common/enums/sort-order.emum';
12
13
  export * from './core/common/helpers/config.helper';
@@ -26,6 +27,8 @@ export * from './core/common/inputs/sort.input';
26
27
  export * from './core/common/interceptors/check-response.interceptor';
27
28
  export * from './core/common/interfaces/core-persistence-model.interface';
28
29
  export * from './core/common/interfaces/mailjet-options.interface';
30
+ export * from './core/common/interfaces/prepare-input-options.interface';
31
+ export * from './core/common/interfaces/prepare-output-options.interface';
29
32
  export * from './core/common/interfaces/resolve-selector.interface';
30
33
  export * from './core/common/interfaces/server-options.interface';
31
34
  export * from './core/common/interfaces/service-options.interface';
@@ -46,6 +49,8 @@ export * from './core/common/types/core-model-constructor.type';
46
49
  export * from './core/common/types/field-selection.type';
47
50
  export * from './core/common/types/ids.type';
48
51
  export * from './core/common/types/plain-input.type';
52
+ export * from './core/common/types/require-only-one.type';
53
+ export * from './core/common/types/required-at-least-one.type';
49
54
  export * from './core/common/types/string-or-object-id.type';
50
55
  export * from './core/modules/auth/guards/auth.guard';
51
56
  export * from './core/modules/auth/guards/roles.guard';
package/dist/index.js CHANGED
@@ -23,6 +23,7 @@ __exportStar(require("./core/common/decorators/restricted.decorator"), exports);
23
23
  __exportStar(require("./core/common/decorators/roles.decorator"), exports);
24
24
  __exportStar(require("./core/common/enums/comparison-operator.enum"), exports);
25
25
  __exportStar(require("./core/common/enums/logical-operator.enum"), exports);
26
+ __exportStar(require("./core/common/enums/process-type.enum"), exports);
26
27
  __exportStar(require("./core/common/enums/role.enum"), exports);
27
28
  __exportStar(require("./core/common/enums/sort-order.emum"), exports);
28
29
  __exportStar(require("./core/common/helpers/config.helper"), exports);
@@ -42,6 +43,8 @@ __exportStar(require("./core/common/inputs/sort.input"), exports);
42
43
  __exportStar(require("./core/common/interceptors/check-response.interceptor"), exports);
43
44
  __exportStar(require("./core/common/interfaces/core-persistence-model.interface"), exports);
44
45
  __exportStar(require("./core/common/interfaces/mailjet-options.interface"), exports);
46
+ __exportStar(require("./core/common/interfaces/prepare-input-options.interface"), exports);
47
+ __exportStar(require("./core/common/interfaces/prepare-output-options.interface"), exports);
45
48
  __exportStar(require("./core/common/interfaces/resolve-selector.interface"), exports);
46
49
  __exportStar(require("./core/common/interfaces/server-options.interface"), exports);
47
50
  __exportStar(require("./core/common/interfaces/service-options.interface"), exports);
@@ -62,6 +65,8 @@ __exportStar(require("./core/common/types/core-model-constructor.type"), exports
62
65
  __exportStar(require("./core/common/types/field-selection.type"), exports);
63
66
  __exportStar(require("./core/common/types/ids.type"), exports);
64
67
  __exportStar(require("./core/common/types/plain-input.type"), exports);
68
+ __exportStar(require("./core/common/types/require-only-one.type"), exports);
69
+ __exportStar(require("./core/common/types/required-at-least-one.type"), exports);
65
70
  __exportStar(require("./core/common/types/string-or-object-id.type"), exports);
66
71
  __exportStar(require("./core/modules/auth/guards/auth.guard"), exports);
67
72
  __exportStar(require("./core/modules/auth/guards/roles.guard"), exports);
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAIA,gDAA8B;AAK9B,iEAA+C;AAC/C,qEAAmD;AACnD,kFAAgE;AAChE,+EAA6D;AAC7D,gFAA8D;AAC9D,2EAAyD;AACzD,+EAA6D;AAC7D,4EAA0D;AAC1D,gEAA8C;AAC9C,sEAAoD;AACpD,sEAAoD;AACpD,uEAAqD;AACrD,kEAAgD;AAChD,oEAAkD;AAClD,sEAAoD;AACpD,uEAAqD;AACrD,qEAAmD;AACnD,qEAAmD;AACnD,uEAAqD;AACrD,6EAA2D;AAC3D,wEAAsD;AACtD,oEAAkD;AAClD,2EAAyD;AACzD,kEAAgD;AAChD,wFAAsE;AACtE,4FAA0E;AAC1E,qFAAmE;AACnE,sFAAoE;AACpE,oFAAkE;AAClE,qFAAmE;AACnE,wEAAsD;AACtD,8EAA4D;AAC5D,uEAAqD;AACrD,4EAA0D;AAC1D,mEAAiD;AACjD,oEAAkD;AAClD,oEAAkD;AAClD,wEAAsD;AACtD,sEAAoD;AACpD,uEAAqD;AACrD,yEAAuD;AACvD,wEAAsD;AACtD,0EAAwD;AACxD,kFAAgE;AAChE,2EAAyD;AACzD,+DAA6C;AAC7C,uEAAqD;AACrD,+EAA6D;AAM7D,wEAAsD;AACtD,yEAAuD;AACvD,0FAAwE;AACxE,uFAAqE;AACrE,iFAA+D;AAC/D,sFAAoE;AACpE,sEAAoD;AACpD,uEAAqD;AACrD,yEAAuD;AACvD,mEAAiD;AAMjD,6EAA2D;AAC3D,oFAAkE;AAClE,sEAAoD;AACpD,wEAAsD;AAMtD,qDAAmC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAIA,gDAA8B;AAK9B,iEAA+C;AAC/C,qEAAmD;AACnD,kFAAgE;AAChE,+EAA6D;AAC7D,gFAA8D;AAC9D,2EAAyD;AACzD,+EAA6D;AAC7D,4EAA0D;AAC1D,wEAAsD;AACtD,gEAA8C;AAC9C,sEAAoD;AACpD,sEAAoD;AACpD,uEAAqD;AACrD,kEAAgD;AAChD,oEAAkD;AAClD,sEAAoD;AACpD,uEAAqD;AACrD,qEAAmD;AACnD,qEAAmD;AACnD,uEAAqD;AACrD,6EAA2D;AAC3D,wEAAsD;AACtD,oEAAkD;AAClD,2EAAyD;AACzD,kEAAgD;AAChD,wFAAsE;AACtE,4FAA0E;AAC1E,qFAAmE;AACnE,2FAAyE;AACzE,4FAA0E;AAC1E,sFAAoE;AACpE,oFAAkE;AAClE,qFAAmE;AACnE,wEAAsD;AACtD,8EAA4D;AAC5D,uEAAqD;AACrD,4EAA0D;AAC1D,mEAAiD;AACjD,oEAAkD;AAClD,oEAAkD;AAClD,wEAAsD;AACtD,sEAAoD;AACpD,uEAAqD;AACrD,yEAAuD;AACvD,wEAAsD;AACtD,0EAAwD;AACxD,kFAAgE;AAChE,2EAAyD;AACzD,+DAA6C;AAC7C,uEAAqD;AACrD,4EAA0D;AAC1D,iFAA+D;AAC/D,+EAA6D;AAM7D,wEAAsD;AACtD,yEAAuD;AACvD,0FAAwE;AACxE,uFAAqE;AACrE,iFAA+D;AAC/D,sFAAoE;AACpE,sEAAoD;AACpD,uEAAqD;AACrD,yEAAuD;AACvD,mEAAiD;AAMjD,6EAA2D;AAC3D,oFAAkE;AAClE,sEAAoD;AACpD,wEAAsD;AAMtD,qDAAmC"}
@@ -24,11 +24,11 @@ let Auth = class Auth extends core_auth_model_1.CoreAuthModel {
24
24
  }
25
25
  };
26
26
  __decorate([
27
- (0, graphql_1.Field)((type) => user_model_1.User, { description: 'User who signed in' }),
27
+ (0, graphql_1.Field)(() => user_model_1.User, { description: 'User who signed in' }),
28
28
  __metadata("design:type", user_model_1.User)
29
29
  ], Auth.prototype, "user", void 0);
30
30
  Auth = __decorate([
31
- (0, graphql_1.ObjectType)({ description: 'Auth' })
31
+ (0, graphql_1.ObjectType)({ description: 'Authentication data' })
32
32
  ], Auth);
33
33
  exports.Auth = Auth;
34
34
  //# sourceMappingURL=auth.model.js.map