@tsed/mongoose 7.0.0-beta.2 → 7.0.0-beta.5

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 (133) hide show
  1. package/jest.config.js +1 -1
  2. package/lib/cjs/MongooseModule.js +3 -3
  3. package/lib/cjs/MongooseModule.js.map +1 -1
  4. package/lib/cjs/constants/{index.js → constants.js} +1 -1
  5. package/lib/cjs/constants/constants.js.map +1 -0
  6. package/lib/cjs/decorators/discriminatorKey.js +1 -1
  7. package/lib/cjs/decorators/discriminatorKey.js.map +1 -1
  8. package/lib/cjs/decorators/dynamicRef.js +24 -5
  9. package/lib/cjs/decorators/dynamicRef.js.map +1 -1
  10. package/lib/cjs/decorators/model.js +5 -4
  11. package/lib/cjs/decorators/model.js.map +1 -1
  12. package/lib/cjs/decorators/numberDecimal.js +2 -2
  13. package/lib/cjs/decorators/numberDecimal.js.map +1 -1
  14. package/lib/cjs/decorators/postHook.js.map +1 -1
  15. package/lib/cjs/decorators/preHook.js.map +1 -1
  16. package/lib/cjs/decorators/ref.js +1 -1
  17. package/lib/cjs/decorators/ref.js.map +1 -1
  18. package/lib/cjs/decorators/schema.js +1 -1
  19. package/lib/cjs/decorators/schema.js.map +1 -1
  20. package/lib/cjs/decorators/versionKey.js +1 -1
  21. package/lib/cjs/decorators/versionKey.js.map +1 -1
  22. package/lib/cjs/decorators/virtualRef.js +1 -1
  23. package/lib/cjs/decorators/virtualRef.js.map +1 -1
  24. package/lib/cjs/index.js +47 -6
  25. package/lib/cjs/index.js.map +1 -1
  26. package/lib/cjs/interfaces/MongooseModel.js.map +1 -1
  27. package/lib/cjs/interfaces/MongooseModelOptions.js.map +1 -1
  28. package/lib/cjs/interfaces/MongooseSchemaOptions.js.map +1 -1
  29. package/lib/cjs/interfaces/interfaces.js +3 -0
  30. package/lib/cjs/interfaces/interfaces.js.map +1 -0
  31. package/lib/cjs/package.json +3 -0
  32. package/lib/cjs/services/MongooseConnections.js +1 -5
  33. package/lib/cjs/services/MongooseConnections.js.map +1 -1
  34. package/lib/cjs/services/MongooseService.js +4 -4
  35. package/lib/cjs/services/MongooseService.js.map +1 -1
  36. package/lib/cjs/utils/createModel.js +7 -11
  37. package/lib/cjs/utils/createModel.js.map +1 -1
  38. package/lib/cjs/utils/createSchema.js +2 -2
  39. package/lib/cjs/utils/createSchema.js.map +1 -1
  40. package/lib/cjs/utils/resolveRefType.js +1 -1
  41. package/lib/cjs/utils/resolveRefType.js.map +1 -1
  42. package/lib/cjs/utils/schemaOptions.js +1 -1
  43. package/lib/cjs/utils/schemaOptions.js.map +1 -1
  44. package/lib/esm/MongooseModule.js +2 -2
  45. package/lib/esm/constants/{index.js → constants.js} +1 -1
  46. package/lib/esm/constants/constants.js.map +1 -0
  47. package/lib/esm/decorators/auto.js +1 -1
  48. package/lib/esm/decorators/discriminatorKey.js +2 -2
  49. package/lib/esm/decorators/discriminatorKey.js.map +1 -1
  50. package/lib/esm/decorators/dynamicRef.js +26 -7
  51. package/lib/esm/decorators/dynamicRef.js.map +1 -1
  52. package/lib/esm/decorators/excludeIndexes.js +1 -1
  53. package/lib/esm/decorators/expires.js +1 -1
  54. package/lib/esm/decorators/immutable.js +1 -1
  55. package/lib/esm/decorators/indexed.js +1 -1
  56. package/lib/esm/decorators/lowercase.js +1 -1
  57. package/lib/esm/decorators/model.js +5 -4
  58. package/lib/esm/decorators/model.js.map +1 -1
  59. package/lib/esm/decorators/mongooseIndex.js +1 -1
  60. package/lib/esm/decorators/mongooseIndexes.js +1 -1
  61. package/lib/esm/decorators/mongoosePlugin.js +1 -1
  62. package/lib/esm/decorators/numberDecimal.js +1 -1
  63. package/lib/esm/decorators/numberDecimal.js.map +1 -1
  64. package/lib/esm/decorators/postHook.js +1 -1
  65. package/lib/esm/decorators/postHook.js.map +1 -1
  66. package/lib/esm/decorators/preHook.js +1 -1
  67. package/lib/esm/decorators/preHook.js.map +1 -1
  68. package/lib/esm/decorators/ref.js +3 -3
  69. package/lib/esm/decorators/ref.js.map +1 -1
  70. package/lib/esm/decorators/schema.js +2 -2
  71. package/lib/esm/decorators/schema.js.map +1 -1
  72. package/lib/esm/decorators/schemaIgnore.js +1 -1
  73. package/lib/esm/decorators/select.js +1 -1
  74. package/lib/esm/decorators/sparse.js +1 -1
  75. package/lib/esm/decorators/text.js +1 -1
  76. package/lib/esm/decorators/trim.js +1 -1
  77. package/lib/esm/decorators/unique.js +1 -1
  78. package/lib/esm/decorators/uppercase.js +1 -1
  79. package/lib/esm/decorators/versionKey.js +1 -1
  80. package/lib/esm/decorators/versionKey.js.map +1 -1
  81. package/lib/esm/decorators/virtualRef.js +2 -2
  82. package/lib/esm/decorators/virtualRef.js.map +1 -1
  83. package/lib/esm/index.js +47 -6
  84. package/lib/esm/index.js.map +1 -1
  85. package/lib/esm/interfaces/MongooseModel.js.map +1 -1
  86. package/lib/esm/interfaces/MongooseModelOptions.js.map +1 -1
  87. package/lib/esm/interfaces/MongooseSchemaOptions.js.map +1 -1
  88. package/lib/esm/interfaces/interfaces.js +2 -0
  89. package/lib/esm/interfaces/interfaces.js.map +1 -0
  90. package/lib/esm/package.json +3 -0
  91. package/lib/esm/services/MongooseConnections.js +2 -6
  92. package/lib/esm/services/MongooseConnections.js.map +1 -1
  93. package/lib/esm/utils/createModel.js +8 -12
  94. package/lib/esm/utils/createModel.js.map +1 -1
  95. package/lib/esm/utils/createSchema.js +3 -3
  96. package/lib/esm/utils/createSchema.js.map +1 -1
  97. package/lib/esm/utils/resolveRefType.js +1 -1
  98. package/lib/esm/utils/resolveRefType.js.map +1 -1
  99. package/lib/esm/utils/schemaOptions.js +1 -1
  100. package/lib/esm/utils/schemaOptions.js.map +1 -1
  101. package/lib/types/constants/{index.d.ts → constants.d.ts} +0 -0
  102. package/lib/types/decorators/dynamicRef.d.ts +4 -2
  103. package/lib/types/decorators/postHook.d.ts +1 -1
  104. package/lib/types/decorators/preHook.d.ts +1 -1
  105. package/lib/types/decorators/schema.d.ts +1 -1
  106. package/lib/types/decorators/virtualRef.d.ts +0 -4
  107. package/lib/types/index.d.ts +46 -5
  108. package/lib/types/interfaces/MongooseModel.d.ts +1 -2
  109. package/lib/types/interfaces/MongooseModelOptions.d.ts +1 -1
  110. package/lib/types/interfaces/MongooseSchemaOptions.d.ts +1 -1
  111. package/lib/types/interfaces/{index.d.ts → interfaces.d.ts} +0 -6
  112. package/lib/types/utils/createModel.d.ts +2 -2
  113. package/lib/types/utils/createSchema.d.ts +1 -1
  114. package/lib/types/utils/schemaOptions.d.ts +1 -1
  115. package/package.json +20 -18
  116. package/readme.md +124 -134
  117. package/tsconfig.compile.esm.json +2 -12
  118. package/lib/cjs/constants/index.js.map +0 -1
  119. package/lib/cjs/decorators/index.js +0 -30
  120. package/lib/cjs/decorators/index.js.map +0 -1
  121. package/lib/cjs/interfaces/index.js +0 -10
  122. package/lib/cjs/interfaces/index.js.map +0 -1
  123. package/lib/cjs/utils/index.js +0 -6
  124. package/lib/cjs/utils/index.js.map +0 -1
  125. package/lib/esm/constants/index.js.map +0 -1
  126. package/lib/esm/decorators/index.js +0 -27
  127. package/lib/esm/decorators/index.js.map +0 -1
  128. package/lib/esm/interfaces/index.js +0 -7
  129. package/lib/esm/interfaces/index.js.map +0 -1
  130. package/lib/esm/utils/index.js +0 -3
  131. package/lib/esm/utils/index.js.map +0 -1
  132. package/lib/types/decorators/index.d.ts +0 -26
  133. package/lib/types/utils/index.d.ts +0 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsed/mongoose",
3
- "version": "7.0.0-beta.2",
3
+ "version": "7.0.0-beta.5",
4
4
  "description": "Mongoose package for Ts.ED framework",
5
5
  "private": false,
6
6
  "keywords": [
@@ -12,6 +12,7 @@
12
12
  ],
13
13
  "source": "./src/index.ts",
14
14
  "main": "./lib/cjs/index.js",
15
+ "module": "./lib/esm/index.js",
15
16
  "typings": "./lib/types/index.d.ts",
16
17
  "exports": {
17
18
  "types": "./lib/types/index.d.ts",
@@ -20,38 +21,39 @@
20
21
  "default": "./lib/esm/index.js"
21
22
  },
22
23
  "scripts": {
23
- "build": "yarn run build:esm && yarn run build:cjs",
24
+ "build": "yarn barrels && yarn run build:esm && yarn run build:cjs",
24
25
  "build:cjs": "tsc --build tsconfig.compile.json",
25
26
  "build:esm": "tsc --build tsconfig.compile.esm.json",
27
+ "barrels": "yarn barrelsby --delete -d ./src -e \"\\.spec\\.ts\" -e \"__mock__\" -e \".benchmark.ts\"",
26
28
  "test": "cross-env NODE_ENV=test yarn jest"
27
29
  },
28
30
  "dependencies": {
29
31
  "change-case": "4.1.2",
30
- "tslib": "2.2.0"
32
+ "tslib": "2.3.1"
31
33
  },
32
34
  "devDependencies": {
33
- "@tsed/ajv": "7.0.0-beta.2",
34
- "@tsed/core": "7.0.0-beta.2",
35
- "@tsed/di": "7.0.0-beta.2",
36
- "@tsed/json-mapper": "7.0.0-beta.2",
37
- "@tsed/logger": "^6.0.0",
38
- "@tsed/schema": "7.0.0-beta.2",
39
- "mongoose": "^5.12.2"
35
+ "@tsed/ajv": "7.0.0-beta.5",
36
+ "@tsed/core": "7.0.0-beta.5",
37
+ "@tsed/di": "7.0.0-beta.5",
38
+ "@tsed/json-mapper": "7.0.0-beta.5",
39
+ "@tsed/logger": ">=6.1.1",
40
+ "@tsed/schema": "7.0.0-beta.5",
41
+ "mongoose": "^6.1.7"
40
42
  },
41
43
  "peerDependencies": {
42
- "@tsed/ajv": "^7.0.0-beta.2",
43
- "@tsed/core": "^7.0.0-beta.2",
44
- "@tsed/di": "^7.0.0-beta.2",
45
- "@tsed/json-mapper": "^7.0.0-beta.2",
46
- "@tsed/logger": ">=6.0.0",
47
- "@tsed/schema": "^7.0.0-beta.2",
48
- "mongoose": ">=5.12.2"
44
+ "@tsed/ajv": "^7.0.0-beta.5",
45
+ "@tsed/core": "^7.0.0-beta.5",
46
+ "@tsed/di": "^7.0.0-beta.5",
47
+ "@tsed/json-mapper": "^7.0.0-beta.5",
48
+ "@tsed/logger": ">=6.1.1",
49
+ "@tsed/schema": "^7.0.0-beta.5",
50
+ "mongoose": ">=6.0.0"
49
51
  },
50
52
  "repository": "https://github.com/tsedio/tsed",
51
53
  "bugs": {
52
54
  "url": "https://github.com/tsedio/tsed/issues"
53
55
  },
54
- "homepage": "https://github.com/tsedio/tsed/tree/alpha/packages/orm/mongoose",
56
+ "homepage": "https://github.com/tsedio/tsed/tree/production/packages/orm/mongoose",
55
57
  "author": "Romain Lenzotti",
56
58
  "license": "MIT"
57
59
  }
package/readme.md CHANGED
@@ -59,17 +59,15 @@ import {Configuration} from "@tsed/common";
59
59
  import "@tsed/mongoose"; // import mongoose ts.ed module
60
60
 
61
61
  @Configuration({
62
- mongoose: [
63
- {
64
- id: "default",
65
- url: "mongodb://127.0.0.1:27017/db1",
66
- connectionOptions: {}
67
- }
68
- ]
62
+ mongoose: [
63
+ {
64
+ id: "default",
65
+ url: "mongodb://127.0.0.1:27017/db1",
66
+ connectionOptions: {}
67
+ }
68
+ ]
69
69
  })
70
- export class Server {
71
-
72
- }
70
+ export class Server {}
73
71
  ```
74
72
 
75
73
  ## Multi databases
@@ -82,27 +80,25 @@ import {Configuration} from "@tsed/common";
82
80
  import "@tsed/mongoose"; // import mongoose ts.ed module
83
81
 
84
82
  @Configuration({
85
- mongoose: [
86
- {
87
- id: "default",
88
- url: "mongodb://127.0.0.1:27017/db1",
89
- connectionOptions: {}
90
- },
91
- {
92
- id: "default",
93
- url: "mongodb://127.0.0.1:27017/db2",
94
- connectionOptions: {}
95
- }
96
- ]
83
+ mongoose: [
84
+ {
85
+ id: "default",
86
+ url: "mongodb://127.0.0.1:27017/db1",
87
+ connectionOptions: {}
88
+ },
89
+ {
90
+ id: "default",
91
+ url: "mongodb://127.0.0.1:27017/db2",
92
+ connectionOptions: {}
93
+ }
94
+ ]
97
95
  })
98
- export class Server {
99
-
100
- }
96
+ export class Server {}
101
97
  ```
102
98
 
103
99
  ## MongooseService
104
100
 
105
- MongooseService let you to retrieve an instance of Mongoose.Connection.
101
+ MongooseService let you to retrieve an instance of Mongoose.Connection.
106
102
 
107
103
  ```typescript
108
104
  import {Service} from "@tsed/common";
@@ -110,12 +106,12 @@ import {MongooseService} from "@tsed/mongoose";
110
106
 
111
107
  @Service()
112
108
  export class MyService {
113
- constructor(mongooseService: MongooseService) {
114
- mongooseService.get(); // return the default instance of Mongoose.
115
- // If you have one or more database configured with Ts.ED
116
- mongooseService.get("default");
117
- mongooseService.get("db2");
118
- }
109
+ constructor(mongooseService: MongooseService) {
110
+ mongooseService.get(); // return the default instance of Mongoose.
111
+ // If you have one or more database configured with Ts.ED
112
+ mongooseService.get("default");
113
+ mongooseService.get("db2");
114
+ }
119
115
  }
120
116
  ```
121
117
 
@@ -124,55 +120,50 @@ export class MyService {
124
120
  By default, Ts.ED mongoose will reuse the metadata stored by the decorators dedicated
125
121
  to describe a JsonSchema. This decorators come from the `@tsed/common` package.
126
122
 
127
-
128
123
  Here a model example:
129
124
 
130
125
  ```typescript
131
- import {
132
- Minimum, Maximum, MaxLength, MinLength,
133
- Enum, Pattern, Required,
134
- CollectionOf
135
- } from "@tsed/common";
136
- import {Model, Unique, Indexed, Ref, ObjectID} from "@tsed/mongoose"
126
+ import {Minimum, Maximum, MaxLength, MinLength, Enum, Pattern, Required, CollectionOf} from "@tsed/common";
127
+ import {Model, Unique, Indexed, Ref, ObjectID} from "@tsed/mongoose";
137
128
 
138
129
  enum Categories {
139
130
  CAT1 = "cat1",
140
131
  CAT2 = "cat2"
141
132
  }
142
133
 
143
- @Model({dbName: 'default'}) // dbName is optional. By default dbName is equal to default
134
+ @Model({dbName: "default"}) // dbName is optional. By default dbName is equal to default
144
135
  export class MyModel {
145
- @ObjectID()
146
- _id: string;
147
-
148
- @Unique()
149
- @Required()
150
- unique: string;
151
-
152
- @Indexed()
153
- @MinLength(3)
154
- @MaxLength(50)
155
- indexed: string;
156
-
157
- @Minimum(0)
158
- @Maximum(100)
159
- rate: Number;
160
-
161
- @Enum(Categories)
162
- // or @Enum("type1", "type2")
163
- category: Categories;
164
-
165
- @Pattern(/[a-z]/) // equivalent of match field in mongoose
166
- pattern: String;
167
-
168
- @CollectionOf(String)
169
- arrayOf: string[];
170
-
171
- @Ref(OtherModel)
172
- ref: Ref<OtherModel>;
173
-
174
- @Ref(OtherModel)
175
- refs: Ref<OtherModel>[];
136
+ @ObjectID()
137
+ _id: string;
138
+
139
+ @Unique()
140
+ @Required()
141
+ unique: string;
142
+
143
+ @Indexed()
144
+ @MinLength(3)
145
+ @MaxLength(50)
146
+ indexed: string;
147
+
148
+ @Minimum(0)
149
+ @Maximum(100)
150
+ rate: Number;
151
+
152
+ @Enum(Categories)
153
+ // or @Enum("type1", "type2")
154
+ category: Categories;
155
+
156
+ @Pattern(/[a-z]/) // equivalent of match field in mongoose
157
+ pattern: String;
158
+
159
+ @CollectionOf(String)
160
+ arrayOf: string[];
161
+
162
+ @Ref(OtherModel)
163
+ ref: Ref<OtherModel>;
164
+
165
+ @Ref(OtherModel)
166
+ refs: Ref<OtherModel>[];
176
167
  }
177
168
  ```
178
169
 
@@ -185,31 +176,30 @@ import {MyModel} from "./models/MyModel";
185
176
 
186
177
  @Service()
187
178
  export class MyService {
188
- constructor(@Inject(MyModel) private model: MongooseModel<MyModel>): MyModel {
189
- console.log(model) // Mongoose.model class
190
- }
191
-
192
- async save(obj: MyModel): MongooseModel<MyModel> {
193
-
194
- const doc = new this.model(obj);
195
- await doc.save();
196
-
197
- return doc;
198
- }
199
-
200
- async find(query: any) {
201
- const list = await this.model.find(query).exec();
202
-
203
- console.log(list);
204
-
205
- return list;
206
- }
179
+ constructor(@Inject(MyModel) private model: MongooseModel<MyModel>): MyModel {
180
+ console.log(model); // Mongoose.model class
181
+ }
182
+
183
+ async save(obj: MyModel): MongooseModel<MyModel> {
184
+ const doc = new this.model(obj);
185
+ await doc.save();
186
+
187
+ return doc;
188
+ }
189
+
190
+ async find(query: any) {
191
+ const list = await this.model.find(query).exec();
192
+
193
+ console.log(list);
194
+
195
+ return list;
196
+ }
207
197
  }
208
198
  ```
209
199
 
210
200
  ## Register hook
211
201
 
212
- Mongoose allows the developer to add pre and post [hooks / middlewares](http://mongoosejs.com/docs/middleware.html) to the schema.
202
+ Mongoose allows the developer to add pre and post [hooks / middlewares](http://mongoosejs.com/docs/middleware.html) to the schema.
213
203
  With this it is possible to add document transformations and observations before or after validation, save and more.
214
204
 
215
205
  Ts.ED provide class decorator to register middlewares on the pre and post hook.
@@ -217,83 +207,83 @@ Ts.ED provide class decorator to register middlewares on the pre and post hook.
217
207
  ### Pre hook
218
208
 
219
209
  We can simply attach a `@PreHook` decorator to your model class and
220
- define the hook function like you normally would in Mongoose.
221
-
210
+ define the hook function like you normally would in Mongoose.
211
+
222
212
  ```typescript
223
213
  import {Required} from "@tsed/common";
224
214
  import {PreHook, Model, ObjectID} from "@tsed/mongoose";
225
215
 
226
216
  @Model()
227
217
  @PreHook("save", (car: CarModel, next) => {
228
- if (car.model === 'Tesla') {
218
+ if (car.model === "Tesla") {
229
219
  car.isFast = true;
230
220
  }
231
221
  next();
232
222
  })
233
223
  export class CarModel {
234
- @ObjectID()
235
- _id: string;
236
-
237
- @Required()
238
- model: string;
239
-
240
- @Required()
241
- isFast: boolean;
242
-
243
- // or Prehook on static method
244
- @PreHook("save")
245
- static preSave(car: CarModel, next) {
246
- if (car.model === 'Tesla') {
247
- car.isFast = true;
248
- }
249
- next();
224
+ @ObjectID()
225
+ _id: string;
226
+
227
+ @Required()
228
+ model: string;
229
+
230
+ @Required()
231
+ isFast: boolean;
232
+
233
+ // or Prehook on static method
234
+ @PreHook("save")
235
+ static preSave(car: CarModel, next) {
236
+ if (car.model === "Tesla") {
237
+ car.isFast = true;
250
238
  }
239
+ next();
240
+ }
251
241
  }
252
242
  ```
253
243
 
254
- This will execute the pre-save hook each time a `CarModel` document is saved.
244
+ This will execute the pre-save hook each time a `CarModel` document is saved.
255
245
 
256
246
  ### Post hook
257
247
 
258
248
  We can simply attach a `@PostHook` decorator to your model class and
259
- define the hook function like you normally would in Mongoose.
260
-
249
+ define the hook function like you normally would in Mongoose.
250
+
261
251
  ```typescript
262
252
  import {ObjectID, Required} from "@tsed/common";
263
253
  import {PostHook, Model} from "@tsed/mongoose";
264
254
 
265
255
  @Model()
266
256
  @PostHook("save", (car: CarModel) => {
267
- if (car.topSpeedInKmH > 300) {
268
- console.log(car.model, 'is fast!');
269
- }
257
+ if (car.topSpeedInKmH > 300) {
258
+ console.log(car.model, "is fast!");
259
+ }
270
260
  })
271
261
  export class CarModel {
272
- @ObjectID()
273
- _id: string;
274
-
275
- @Required()
276
- model: string;
277
-
278
- @Required()
279
- isFast: boolean;
280
-
281
- // or Prehook on static method
282
- @PostHook("save")
283
- static postSave(car: CarModel) {
284
- if (car.topSpeedInKmH > 300) {
285
- console.log(car.model, 'is fast!');
286
- }
262
+ @ObjectID()
263
+ _id: string;
264
+
265
+ @Required()
266
+ model: string;
267
+
268
+ @Required()
269
+ isFast: boolean;
270
+
271
+ // or Prehook on static method
272
+ @PostHook("save")
273
+ static postSave(car: CarModel) {
274
+ if (car.topSpeedInKmH > 300) {
275
+ console.log(car.model, "is fast!");
287
276
  }
277
+ }
288
278
  }
289
279
  ```
290
280
 
291
- This will execute the post-save hook each time a `CarModel` document is saved.
281
+ This will execute the post-save hook each time a `CarModel` document is saved.
292
282
 
293
283
  ## Plugin
294
284
 
295
- Using the `plugin` decorator enables the developer to attach various Mongoose plugins to the schema.
296
- Just like the regular `schema.plugin()` call, the decorator accepts 1 or 2 parameters: the plugin itself, and an optional configuration object.
285
+ Using the `plugin` decorator enables the developer to attach various Mongoose plugins to the schema.
286
+ Just like the regular `schema.plugin()` call, the decorator accepts 1 or 2 parameters: the plugin itself, and an optional configuration object.
297
287
  Multiple `plugin` decorator can be used for a single model class.
298
288
 
299
289
  ```typescript
@@ -8,16 +8,6 @@
8
8
  "declaration": true,
9
9
  "declarationDir": "./lib/types"
10
10
  },
11
- "exclude": [
12
- "node_modules",
13
- "test",
14
- "lib",
15
- "benchmark",
16
- "coverage",
17
- "spec",
18
- "**/*.benchmark.ts",
19
- "**/*.spec.ts",
20
- "keys",
21
- "jest.config.js"
22
- ]
11
+ "include": ["src"],
12
+ "exclude": ["node_modules", "test", "lib", "benchmark", "coverage", "spec", "**/*.benchmark.ts", "**/*.spec.ts", "keys", "jest.config.js"]
23
13
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/constants/index.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACU,QAAA,eAAe,GAAG,sBAAsB,CAAC;AACtD;;;GAGG;AACU,QAAA,uBAAuB,GAAG,8BAA8B,CAAC;AACtE;;;GAGG;AACU,QAAA,cAAc,GAAG,qBAAqB,CAAC;AACpD;;;GAGG;AACU,QAAA,mBAAmB,GAAG,0BAA0B,CAAC","sourcesContent":["/**\n *\n * @type {string}\n */\nexport const MONGOOSE_SCHEMA = \"tsed:mongoose:schema\";\n/**\n *\n * @type {string}\n */\nexport const MONGOOSE_SCHEMA_OPTIONS = \"tsed:mongoose:schema:options\";\n/**\n *\n * @type {string}\n */\nexport const MONGOOSE_MODEL = \"tsed:mongoose:model\";\n/**\n *\n * @type {string}\n */\nexport const MONGOOSE_MODEL_NAME = \"tsed:mongoose:model:name\";\n"]}
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- (0, tslib_1.__exportStar)(require("./auto"), exports);
5
- (0, tslib_1.__exportStar)(require("./discriminatorKey"), exports);
6
- (0, tslib_1.__exportStar)(require("./dynamicRef"), exports);
7
- (0, tslib_1.__exportStar)(require("./excludeIndexes"), exports);
8
- (0, tslib_1.__exportStar)(require("./expires"), exports);
9
- (0, tslib_1.__exportStar)(require("./immutable"), exports);
10
- (0, tslib_1.__exportStar)(require("./indexed"), exports);
11
- (0, tslib_1.__exportStar)(require("./lowercase"), exports);
12
- (0, tslib_1.__exportStar)(require("./model"), exports);
13
- (0, tslib_1.__exportStar)(require("./mongooseIndex"), exports);
14
- (0, tslib_1.__exportStar)(require("./mongoosePlugin"), exports);
15
- (0, tslib_1.__exportStar)(require("./numberDecimal"), exports);
16
- (0, tslib_1.__exportStar)(require("./objectID"), exports);
17
- (0, tslib_1.__exportStar)(require("./postHook"), exports);
18
- (0, tslib_1.__exportStar)(require("./preHook"), exports);
19
- (0, tslib_1.__exportStar)(require("./ref"), exports);
20
- (0, tslib_1.__exportStar)(require("./schema"), exports);
21
- (0, tslib_1.__exportStar)(require("./schemaIgnore"), exports);
22
- (0, tslib_1.__exportStar)(require("./select"), exports);
23
- (0, tslib_1.__exportStar)(require("./sparse"), exports);
24
- (0, tslib_1.__exportStar)(require("./text"), exports);
25
- (0, tslib_1.__exportStar)(require("./trim"), exports);
26
- (0, tslib_1.__exportStar)(require("./unique"), exports);
27
- (0, tslib_1.__exportStar)(require("./uppercase"), exports);
28
- (0, tslib_1.__exportStar)(require("./versionKey"), exports);
29
- (0, tslib_1.__exportStar)(require("./virtualRef"), exports);
30
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/decorators/index.ts"],"names":[],"mappings":";;;AAAA,sDAAuB;AACvB,kEAAmC;AACnC,4DAA6B;AAC7B,gEAAiC;AACjC,yDAA0B;AAC1B,2DAA4B;AAC5B,yDAA0B;AAC1B,2DAA4B;AAC5B,uDAAwB;AACxB,+DAAgC;AAChC,gEAAiC;AACjC,+DAAgC;AAChC,0DAA2B;AAC3B,0DAA2B;AAC3B,yDAA0B;AAC1B,qDAAsB;AACtB,wDAAyB;AACzB,8DAA+B;AAC/B,wDAAyB;AACzB,wDAAyB;AACzB,sDAAuB;AACvB,sDAAuB;AACvB,wDAAyB;AACzB,2DAA4B;AAC5B,4DAA6B;AAC7B,4DAA6B","sourcesContent":["export * from \"./auto\";\nexport * from \"./discriminatorKey\";\nexport * from \"./dynamicRef\";\nexport * from \"./excludeIndexes\";\nexport * from \"./expires\";\nexport * from \"./immutable\";\nexport * from \"./indexed\";\nexport * from \"./lowercase\";\nexport * from \"./model\";\nexport * from \"./mongooseIndex\";\nexport * from \"./mongoosePlugin\";\nexport * from \"./numberDecimal\";\nexport * from \"./objectID\";\nexport * from \"./postHook\";\nexport * from \"./preHook\";\nexport * from \"./ref\";\nexport * from \"./schema\";\nexport * from \"./schemaIgnore\";\nexport * from \"./select\";\nexport * from \"./sparse\";\nexport * from \"./text\";\nexport * from \"./trim\";\nexport * from \"./unique\";\nexport * from \"./uppercase\";\nexport * from \"./versionKey\";\nexport * from \"./virtualRef\";\n"]}
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- (0, tslib_1.__exportStar)(require("./MongooseConnectionOptions"), exports);
5
- (0, tslib_1.__exportStar)(require("./MongooseDocument"), exports);
6
- (0, tslib_1.__exportStar)(require("./MongooseModel"), exports);
7
- (0, tslib_1.__exportStar)(require("./MongooseModelOptions"), exports);
8
- (0, tslib_1.__exportStar)(require("./MongooseSchemaOptions"), exports);
9
- (0, tslib_1.__exportStar)(require("./MongooseVirtualRefOptions"), exports);
10
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interfaces/index.ts"],"names":[],"mappings":";;;AAUA,2EAA4C;AAC5C,kEAAmC;AACnC,+DAAgC;AAChC,sEAAuC;AACvC,uEAAwC;AACxC,2EAA4C","sourcesContent":["import {MongooseConnectionOptions} from \"./MongooseConnectionOptions\";\n\ndeclare global {\n namespace TsED {\n interface Configuration {\n mongoose: Omit<MongooseConnectionOptions, \"id\"> | MongooseConnectionOptions[];\n }\n }\n}\n\nexport * from \"./MongooseConnectionOptions\";\nexport * from \"./MongooseDocument\";\nexport * from \"./MongooseModel\";\nexport * from \"./MongooseModelOptions\";\nexport * from \"./MongooseSchemaOptions\";\nexport * from \"./MongooseVirtualRefOptions\";\n"]}
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- (0, tslib_1.__exportStar)(require("./createSchema"), exports);
5
- (0, tslib_1.__exportStar)(require("./createModel"), exports);
6
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":";;;AAAA,8DAA+B;AAC/B,6DAA8B","sourcesContent":["export * from \"./createSchema\";\nexport * from \"./createModel\";\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/constants/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,sBAAsB,CAAC;AACtD;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,8BAA8B,CAAC;AACtE;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,qBAAqB,CAAC;AACpD;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,0BAA0B,CAAC","sourcesContent":["/**\n *\n * @type {string}\n */\nexport const MONGOOSE_SCHEMA = \"tsed:mongoose:schema\";\n/**\n *\n * @type {string}\n */\nexport const MONGOOSE_SCHEMA_OPTIONS = \"tsed:mongoose:schema:options\";\n/**\n *\n * @type {string}\n */\nexport const MONGOOSE_MODEL = \"tsed:mongoose:model\";\n/**\n *\n * @type {string}\n */\nexport const MONGOOSE_MODEL_NAME = \"tsed:mongoose:model:name\";\n"]}
@@ -1,27 +0,0 @@
1
- export * from "./auto";
2
- export * from "./discriminatorKey";
3
- export * from "./dynamicRef";
4
- export * from "./excludeIndexes";
5
- export * from "./expires";
6
- export * from "./immutable";
7
- export * from "./indexed";
8
- export * from "./lowercase";
9
- export * from "./model";
10
- export * from "./mongooseIndex";
11
- export * from "./mongoosePlugin";
12
- export * from "./numberDecimal";
13
- export * from "./objectID";
14
- export * from "./postHook";
15
- export * from "./preHook";
16
- export * from "./ref";
17
- export * from "./schema";
18
- export * from "./schemaIgnore";
19
- export * from "./select";
20
- export * from "./sparse";
21
- export * from "./text";
22
- export * from "./trim";
23
- export * from "./unique";
24
- export * from "./uppercase";
25
- export * from "./versionKey";
26
- export * from "./virtualRef";
27
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/decorators/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC","sourcesContent":["export * from \"./auto\";\nexport * from \"./discriminatorKey\";\nexport * from \"./dynamicRef\";\nexport * from \"./excludeIndexes\";\nexport * from \"./expires\";\nexport * from \"./immutable\";\nexport * from \"./indexed\";\nexport * from \"./lowercase\";\nexport * from \"./model\";\nexport * from \"./mongooseIndex\";\nexport * from \"./mongoosePlugin\";\nexport * from \"./numberDecimal\";\nexport * from \"./objectID\";\nexport * from \"./postHook\";\nexport * from \"./preHook\";\nexport * from \"./ref\";\nexport * from \"./schema\";\nexport * from \"./schemaIgnore\";\nexport * from \"./select\";\nexport * from \"./sparse\";\nexport * from \"./text\";\nexport * from \"./trim\";\nexport * from \"./unique\";\nexport * from \"./uppercase\";\nexport * from \"./versionKey\";\nexport * from \"./virtualRef\";\n"]}
@@ -1,7 +0,0 @@
1
- export * from "./MongooseConnectionOptions";
2
- export * from "./MongooseDocument";
3
- export * from "./MongooseModel";
4
- export * from "./MongooseModelOptions";
5
- export * from "./MongooseSchemaOptions";
6
- export * from "./MongooseVirtualRefOptions";
7
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interfaces/index.ts"],"names":[],"mappings":"AAUA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC","sourcesContent":["import {MongooseConnectionOptions} from \"./MongooseConnectionOptions\";\n\ndeclare global {\n namespace TsED {\n interface Configuration {\n mongoose: Omit<MongooseConnectionOptions, \"id\"> | MongooseConnectionOptions[];\n }\n }\n}\n\nexport * from \"./MongooseConnectionOptions\";\nexport * from \"./MongooseDocument\";\nexport * from \"./MongooseModel\";\nexport * from \"./MongooseModelOptions\";\nexport * from \"./MongooseSchemaOptions\";\nexport * from \"./MongooseVirtualRefOptions\";\n"]}
@@ -1,3 +0,0 @@
1
- export * from "./createSchema";
2
- export * from "./createModel";
3
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC","sourcesContent":["export * from \"./createSchema\";\nexport * from \"./createModel\";\n"]}
@@ -1,26 +0,0 @@
1
- export * from "./auto";
2
- export * from "./discriminatorKey";
3
- export * from "./dynamicRef";
4
- export * from "./excludeIndexes";
5
- export * from "./expires";
6
- export * from "./immutable";
7
- export * from "./indexed";
8
- export * from "./lowercase";
9
- export * from "./model";
10
- export * from "./mongooseIndex";
11
- export * from "./mongoosePlugin";
12
- export * from "./numberDecimal";
13
- export * from "./objectID";
14
- export * from "./postHook";
15
- export * from "./preHook";
16
- export * from "./ref";
17
- export * from "./schema";
18
- export * from "./schemaIgnore";
19
- export * from "./select";
20
- export * from "./sparse";
21
- export * from "./text";
22
- export * from "./trim";
23
- export * from "./unique";
24
- export * from "./uppercase";
25
- export * from "./versionKey";
26
- export * from "./virtualRef";
@@ -1,2 +0,0 @@
1
- export * from "./createSchema";
2
- export * from "./createModel";