@tsed/mongoose 7.0.0-beta.2 → 7.0.0-beta.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/jest.config.js +1 -1
- package/lib/cjs/MongooseModule.js +6 -4
- package/lib/cjs/MongooseModule.js.map +1 -1
- package/lib/cjs/constants/{index.js → constants.js} +1 -1
- package/lib/cjs/constants/constants.js.map +1 -0
- package/lib/cjs/decorators/discriminatorKey.js +1 -1
- package/lib/cjs/decorators/discriminatorKey.js.map +1 -1
- package/lib/cjs/decorators/dynamicRef.js +24 -5
- package/lib/cjs/decorators/dynamicRef.js.map +1 -1
- package/lib/cjs/decorators/model.js +5 -4
- package/lib/cjs/decorators/model.js.map +1 -1
- package/lib/cjs/decorators/numberDecimal.js +2 -2
- package/lib/cjs/decorators/numberDecimal.js.map +1 -1
- package/lib/cjs/decorators/objectID.js +1 -1
- package/lib/cjs/decorators/objectID.js.map +1 -1
- package/lib/cjs/decorators/postHook.js.map +1 -1
- package/lib/cjs/decorators/preHook.js.map +1 -1
- package/lib/cjs/decorators/ref.js +5 -2
- package/lib/cjs/decorators/ref.js.map +1 -1
- package/lib/cjs/decorators/schema.js +1 -1
- package/lib/cjs/decorators/schema.js.map +1 -1
- package/lib/cjs/decorators/versionKey.js +1 -1
- package/lib/cjs/decorators/versionKey.js.map +1 -1
- package/lib/cjs/decorators/virtualRef.js +1 -1
- package/lib/cjs/decorators/virtualRef.js.map +1 -1
- package/lib/cjs/index.js +47 -6
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/interfaces/MongooseModel.js.map +1 -1
- package/lib/cjs/interfaces/MongooseModelOptions.js.map +1 -1
- package/lib/cjs/interfaces/MongooseSchemaOptions.js.map +1 -1
- package/lib/cjs/interfaces/interfaces.js +3 -0
- package/lib/cjs/interfaces/interfaces.js.map +1 -0
- package/lib/cjs/package.json +3 -0
- package/lib/cjs/services/MongooseConnections.js +1 -5
- package/lib/cjs/services/MongooseConnections.js.map +1 -1
- package/lib/cjs/services/MongooseService.js +7 -8
- package/lib/cjs/services/MongooseService.js.map +1 -1
- package/lib/cjs/utils/createModel.js +7 -11
- package/lib/cjs/utils/createModel.js.map +1 -1
- package/lib/cjs/utils/createSchema.js +5 -5
- package/lib/cjs/utils/createSchema.js.map +1 -1
- package/lib/cjs/utils/resolveRefType.js +1 -1
- package/lib/cjs/utils/resolveRefType.js.map +1 -1
- package/lib/cjs/utils/schemaOptions.js +1 -1
- package/lib/cjs/utils/schemaOptions.js.map +1 -1
- package/lib/esm/MongooseModule.js +5 -3
- package/lib/esm/MongooseModule.js.map +1 -1
- package/lib/esm/constants/{index.js → constants.js} +1 -1
- package/lib/esm/constants/constants.js.map +1 -0
- package/lib/esm/decorators/auto.js +1 -1
- package/lib/esm/decorators/discriminatorKey.js +2 -2
- package/lib/esm/decorators/discriminatorKey.js.map +1 -1
- package/lib/esm/decorators/dynamicRef.js +26 -7
- package/lib/esm/decorators/dynamicRef.js.map +1 -1
- package/lib/esm/decorators/excludeIndexes.js +1 -1
- package/lib/esm/decorators/expires.js +1 -1
- package/lib/esm/decorators/immutable.js +1 -1
- package/lib/esm/decorators/indexed.js +1 -1
- package/lib/esm/decorators/lowercase.js +1 -1
- package/lib/esm/decorators/model.js +5 -4
- package/lib/esm/decorators/model.js.map +1 -1
- package/lib/esm/decorators/mongooseIndex.js +1 -1
- package/lib/esm/decorators/mongooseIndexes.js +1 -1
- package/lib/esm/decorators/mongoosePlugin.js +1 -1
- package/lib/esm/decorators/numberDecimal.js +1 -1
- package/lib/esm/decorators/numberDecimal.js.map +1 -1
- package/lib/esm/decorators/objectID.js +1 -1
- package/lib/esm/decorators/objectID.js.map +1 -1
- package/lib/esm/decorators/postHook.js +1 -1
- package/lib/esm/decorators/postHook.js.map +1 -1
- package/lib/esm/decorators/preHook.js +1 -1
- package/lib/esm/decorators/preHook.js.map +1 -1
- package/lib/esm/decorators/ref.js +7 -4
- package/lib/esm/decorators/ref.js.map +1 -1
- package/lib/esm/decorators/schema.js +2 -2
- package/lib/esm/decorators/schema.js.map +1 -1
- package/lib/esm/decorators/schemaIgnore.js +1 -1
- package/lib/esm/decorators/select.js +1 -1
- package/lib/esm/decorators/sparse.js +1 -1
- package/lib/esm/decorators/text.js +1 -1
- package/lib/esm/decorators/trim.js +1 -1
- package/lib/esm/decorators/unique.js +1 -1
- package/lib/esm/decorators/uppercase.js +1 -1
- package/lib/esm/decorators/versionKey.js +1 -1
- package/lib/esm/decorators/versionKey.js.map +1 -1
- package/lib/esm/decorators/virtualRef.js +2 -2
- package/lib/esm/decorators/virtualRef.js.map +1 -1
- package/lib/esm/index.js +47 -6
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/interfaces/MongooseModel.js.map +1 -1
- package/lib/esm/interfaces/MongooseModelOptions.js.map +1 -1
- package/lib/esm/interfaces/MongooseSchemaOptions.js.map +1 -1
- package/lib/esm/interfaces/interfaces.js +2 -0
- package/lib/esm/interfaces/interfaces.js.map +1 -0
- package/lib/esm/package.json +3 -0
- package/lib/esm/services/MongooseConnections.js +2 -6
- package/lib/esm/services/MongooseConnections.js.map +1 -1
- package/lib/esm/services/MongooseService.js +3 -4
- package/lib/esm/services/MongooseService.js.map +1 -1
- package/lib/esm/utils/createModel.js +8 -12
- package/lib/esm/utils/createModel.js.map +1 -1
- package/lib/esm/utils/createSchema.js +6 -6
- package/lib/esm/utils/createSchema.js.map +1 -1
- package/lib/esm/utils/resolveRefType.js +1 -1
- package/lib/esm/utils/resolveRefType.js.map +1 -1
- package/lib/esm/utils/schemaOptions.js +1 -1
- package/lib/esm/utils/schemaOptions.js.map +1 -1
- package/lib/types/constants/{index.d.ts → constants.d.ts} +0 -0
- package/lib/types/decorators/dynamicRef.d.ts +4 -2
- package/lib/types/decorators/postHook.d.ts +1 -1
- package/lib/types/decorators/preHook.d.ts +1 -1
- package/lib/types/decorators/schema.d.ts +1 -1
- package/lib/types/decorators/virtualRef.d.ts +0 -4
- package/lib/types/index.d.ts +46 -5
- package/lib/types/interfaces/MongooseModel.d.ts +1 -2
- package/lib/types/interfaces/MongooseModelOptions.d.ts +1 -1
- package/lib/types/interfaces/MongooseSchemaOptions.d.ts +4 -4
- package/lib/types/interfaces/{index.d.ts → interfaces.d.ts} +0 -6
- package/lib/types/utils/createModel.d.ts +2 -2
- package/lib/types/utils/createSchema.d.ts +1 -1
- package/lib/types/utils/schemaOptions.d.ts +1 -1
- package/package.json +24 -19
- package/readme.md +127 -136
- package/tsconfig.compile.esm.json +2 -12
- package/lib/cjs/constants/index.js.map +0 -1
- package/lib/cjs/decorators/index.js +0 -30
- package/lib/cjs/decorators/index.js.map +0 -1
- package/lib/cjs/interfaces/index.js +0 -10
- package/lib/cjs/interfaces/index.js.map +0 -1
- package/lib/cjs/utils/index.js +0 -6
- package/lib/cjs/utils/index.js.map +0 -1
- package/lib/esm/constants/index.js.map +0 -1
- package/lib/esm/decorators/index.js +0 -27
- package/lib/esm/decorators/index.js.map +0 -1
- package/lib/esm/interfaces/index.js +0 -7
- package/lib/esm/interfaces/index.js.map +0 -1
- package/lib/esm/utils/index.js +0 -3
- package/lib/esm/utils/index.js.map +0 -1
- package/lib/types/decorators/index.d.ts +0 -26
- package/lib/types/utils/index.d.ts +0 -2
package/readme.md
CHANGED
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
[](https://badge.fury.io/js/%40tsed%2Fcommon)
|
|
12
12
|
[](https://github.com/semantic-release/semantic-release)
|
|
13
13
|
[](https://github.com/prettier/prettier)
|
|
14
|
-
[](https://github.com/sponsors/romakita)
|
|
15
|
+
[](https://opencollective.com/tsed)
|
|
15
16
|
|
|
16
17
|
</div>
|
|
17
18
|
|
|
@@ -59,17 +60,15 @@ import {Configuration} from "@tsed/common";
|
|
|
59
60
|
import "@tsed/mongoose"; // import mongoose ts.ed module
|
|
60
61
|
|
|
61
62
|
@Configuration({
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
63
|
+
mongoose: [
|
|
64
|
+
{
|
|
65
|
+
id: "default",
|
|
66
|
+
url: "mongodb://127.0.0.1:27017/db1",
|
|
67
|
+
connectionOptions: {}
|
|
68
|
+
}
|
|
69
|
+
]
|
|
69
70
|
})
|
|
70
|
-
export class Server {
|
|
71
|
-
|
|
72
|
-
}
|
|
71
|
+
export class Server {}
|
|
73
72
|
```
|
|
74
73
|
|
|
75
74
|
## Multi databases
|
|
@@ -82,27 +81,25 @@ import {Configuration} from "@tsed/common";
|
|
|
82
81
|
import "@tsed/mongoose"; // import mongoose ts.ed module
|
|
83
82
|
|
|
84
83
|
@Configuration({
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
84
|
+
mongoose: [
|
|
85
|
+
{
|
|
86
|
+
id: "default",
|
|
87
|
+
url: "mongodb://127.0.0.1:27017/db1",
|
|
88
|
+
connectionOptions: {}
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
id: "default",
|
|
92
|
+
url: "mongodb://127.0.0.1:27017/db2",
|
|
93
|
+
connectionOptions: {}
|
|
94
|
+
}
|
|
95
|
+
]
|
|
97
96
|
})
|
|
98
|
-
export class Server {
|
|
99
|
-
|
|
100
|
-
}
|
|
97
|
+
export class Server {}
|
|
101
98
|
```
|
|
102
99
|
|
|
103
100
|
## MongooseService
|
|
104
101
|
|
|
105
|
-
MongooseService let you to retrieve an instance of Mongoose.Connection.
|
|
102
|
+
MongooseService let you to retrieve an instance of Mongoose.Connection.
|
|
106
103
|
|
|
107
104
|
```typescript
|
|
108
105
|
import {Service} from "@tsed/common";
|
|
@@ -110,12 +107,12 @@ import {MongooseService} from "@tsed/mongoose";
|
|
|
110
107
|
|
|
111
108
|
@Service()
|
|
112
109
|
export class MyService {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
110
|
+
constructor(mongooseService: MongooseService) {
|
|
111
|
+
mongooseService.get(); // return the default instance of Mongoose.
|
|
112
|
+
// If you have one or more database configured with Ts.ED
|
|
113
|
+
mongooseService.get("default");
|
|
114
|
+
mongooseService.get("db2");
|
|
115
|
+
}
|
|
119
116
|
}
|
|
120
117
|
```
|
|
121
118
|
|
|
@@ -124,55 +121,50 @@ export class MyService {
|
|
|
124
121
|
By default, Ts.ED mongoose will reuse the metadata stored by the decorators dedicated
|
|
125
122
|
to describe a JsonSchema. This decorators come from the `@tsed/common` package.
|
|
126
123
|
|
|
127
|
-
|
|
128
124
|
Here a model example:
|
|
129
125
|
|
|
130
126
|
```typescript
|
|
131
|
-
import {
|
|
132
|
-
|
|
133
|
-
Enum, Pattern, Required,
|
|
134
|
-
CollectionOf
|
|
135
|
-
} from "@tsed/common";
|
|
136
|
-
import {Model, Unique, Indexed, Ref, ObjectID} from "@tsed/mongoose"
|
|
127
|
+
import {Minimum, Maximum, MaxLength, MinLength, Enum, Pattern, Required, CollectionOf} from "@tsed/common";
|
|
128
|
+
import {Model, Unique, Indexed, Ref, ObjectID} from "@tsed/mongoose";
|
|
137
129
|
|
|
138
130
|
enum Categories {
|
|
139
131
|
CAT1 = "cat1",
|
|
140
132
|
CAT2 = "cat2"
|
|
141
133
|
}
|
|
142
134
|
|
|
143
|
-
@Model({dbName:
|
|
135
|
+
@Model({dbName: "default"}) // dbName is optional. By default dbName is equal to default
|
|
144
136
|
export class MyModel {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
137
|
+
@ObjectID()
|
|
138
|
+
_id: string;
|
|
139
|
+
|
|
140
|
+
@Unique()
|
|
141
|
+
@Required()
|
|
142
|
+
unique: string;
|
|
143
|
+
|
|
144
|
+
@Indexed()
|
|
145
|
+
@MinLength(3)
|
|
146
|
+
@MaxLength(50)
|
|
147
|
+
indexed: string;
|
|
148
|
+
|
|
149
|
+
@Minimum(0)
|
|
150
|
+
@Maximum(100)
|
|
151
|
+
rate: Number;
|
|
152
|
+
|
|
153
|
+
@Enum(Categories)
|
|
154
|
+
// or @Enum("type1", "type2")
|
|
155
|
+
category: Categories;
|
|
156
|
+
|
|
157
|
+
@Pattern(/[a-z]/) // equivalent of match field in mongoose
|
|
158
|
+
pattern: String;
|
|
159
|
+
|
|
160
|
+
@CollectionOf(String)
|
|
161
|
+
arrayOf: string[];
|
|
162
|
+
|
|
163
|
+
@Ref(OtherModel)
|
|
164
|
+
ref: Ref<OtherModel>;
|
|
165
|
+
|
|
166
|
+
@Ref(OtherModel)
|
|
167
|
+
refs: Ref<OtherModel>[];
|
|
176
168
|
}
|
|
177
169
|
```
|
|
178
170
|
|
|
@@ -185,31 +177,30 @@ import {MyModel} from "./models/MyModel";
|
|
|
185
177
|
|
|
186
178
|
@Service()
|
|
187
179
|
export class MyService {
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
}
|
|
180
|
+
constructor(@Inject(MyModel) private model: MongooseModel<MyModel>): MyModel {
|
|
181
|
+
console.log(model); // Mongoose.model class
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
async save(obj: MyModel): MongooseModel<MyModel> {
|
|
185
|
+
const doc = new this.model(obj);
|
|
186
|
+
await doc.save();
|
|
187
|
+
|
|
188
|
+
return doc;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
async find(query: any) {
|
|
192
|
+
const list = await this.model.find(query).exec();
|
|
193
|
+
|
|
194
|
+
console.log(list);
|
|
195
|
+
|
|
196
|
+
return list;
|
|
197
|
+
}
|
|
207
198
|
}
|
|
208
199
|
```
|
|
209
200
|
|
|
210
201
|
## Register hook
|
|
211
202
|
|
|
212
|
-
Mongoose allows the developer to add pre and post [hooks / middlewares](http://mongoosejs.com/docs/middleware.html) to the schema.
|
|
203
|
+
Mongoose allows the developer to add pre and post [hooks / middlewares](http://mongoosejs.com/docs/middleware.html) to the schema.
|
|
213
204
|
With this it is possible to add document transformations and observations before or after validation, save and more.
|
|
214
205
|
|
|
215
206
|
Ts.ED provide class decorator to register middlewares on the pre and post hook.
|
|
@@ -217,83 +208,83 @@ Ts.ED provide class decorator to register middlewares on the pre and post hook.
|
|
|
217
208
|
### Pre hook
|
|
218
209
|
|
|
219
210
|
We can simply attach a `@PreHook` decorator to your model class and
|
|
220
|
-
|
|
221
|
-
|
|
211
|
+
define the hook function like you normally would in Mongoose.
|
|
212
|
+
|
|
222
213
|
```typescript
|
|
223
214
|
import {Required} from "@tsed/common";
|
|
224
215
|
import {PreHook, Model, ObjectID} from "@tsed/mongoose";
|
|
225
216
|
|
|
226
217
|
@Model()
|
|
227
218
|
@PreHook("save", (car: CarModel, next) => {
|
|
228
|
-
if (car.model ===
|
|
219
|
+
if (car.model === "Tesla") {
|
|
229
220
|
car.isFast = true;
|
|
230
221
|
}
|
|
231
222
|
next();
|
|
232
223
|
})
|
|
233
224
|
export class CarModel {
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
}
|
|
249
|
-
next();
|
|
225
|
+
@ObjectID()
|
|
226
|
+
_id: string;
|
|
227
|
+
|
|
228
|
+
@Required()
|
|
229
|
+
model: string;
|
|
230
|
+
|
|
231
|
+
@Required()
|
|
232
|
+
isFast: boolean;
|
|
233
|
+
|
|
234
|
+
// or Prehook on static method
|
|
235
|
+
@PreHook("save")
|
|
236
|
+
static preSave(car: CarModel, next) {
|
|
237
|
+
if (car.model === "Tesla") {
|
|
238
|
+
car.isFast = true;
|
|
250
239
|
}
|
|
240
|
+
next();
|
|
241
|
+
}
|
|
251
242
|
}
|
|
252
243
|
```
|
|
253
244
|
|
|
254
|
-
This will execute the pre-save hook each time a `CarModel` document is saved.
|
|
245
|
+
This will execute the pre-save hook each time a `CarModel` document is saved.
|
|
255
246
|
|
|
256
247
|
### Post hook
|
|
257
248
|
|
|
258
249
|
We can simply attach a `@PostHook` decorator to your model class and
|
|
259
|
-
|
|
260
|
-
|
|
250
|
+
define the hook function like you normally would in Mongoose.
|
|
251
|
+
|
|
261
252
|
```typescript
|
|
262
253
|
import {ObjectID, Required} from "@tsed/common";
|
|
263
254
|
import {PostHook, Model} from "@tsed/mongoose";
|
|
264
255
|
|
|
265
256
|
@Model()
|
|
266
257
|
@PostHook("save", (car: CarModel) => {
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
258
|
+
if (car.topSpeedInKmH > 300) {
|
|
259
|
+
console.log(car.model, "is fast!");
|
|
260
|
+
}
|
|
270
261
|
})
|
|
271
262
|
export class CarModel {
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
}
|
|
263
|
+
@ObjectID()
|
|
264
|
+
_id: string;
|
|
265
|
+
|
|
266
|
+
@Required()
|
|
267
|
+
model: string;
|
|
268
|
+
|
|
269
|
+
@Required()
|
|
270
|
+
isFast: boolean;
|
|
271
|
+
|
|
272
|
+
// or Prehook on static method
|
|
273
|
+
@PostHook("save")
|
|
274
|
+
static postSave(car: CarModel) {
|
|
275
|
+
if (car.topSpeedInKmH > 300) {
|
|
276
|
+
console.log(car.model, "is fast!");
|
|
287
277
|
}
|
|
278
|
+
}
|
|
288
279
|
}
|
|
289
280
|
```
|
|
290
281
|
|
|
291
|
-
This will execute the post-save hook each time a `CarModel` document is saved.
|
|
282
|
+
This will execute the post-save hook each time a `CarModel` document is saved.
|
|
292
283
|
|
|
293
284
|
## Plugin
|
|
294
285
|
|
|
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.
|
|
286
|
+
Using the `plugin` decorator enables the developer to attach various Mongoose plugins to the schema.
|
|
287
|
+
Just like the regular `schema.plugin()` call, the decorator accepts 1 or 2 parameters: the plugin itself, and an optional configuration object.
|
|
297
288
|
Multiple `plugin` decorator can be used for a single model class.
|
|
298
289
|
|
|
299
290
|
```typescript
|
|
@@ -373,7 +364,7 @@ Support this project by becoming a sponsor. Your logo will show up here with a l
|
|
|
373
364
|
|
|
374
365
|
The MIT License (MIT)
|
|
375
366
|
|
|
376
|
-
Copyright (c) 2016 -
|
|
367
|
+
Copyright (c) 2016 - 2022 Romain Lenzotti
|
|
377
368
|
|
|
378
369
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
379
370
|
|
|
@@ -8,16 +8,6 @@
|
|
|
8
8
|
"declaration": true,
|
|
9
9
|
"declarationDir": "./lib/types"
|
|
10
10
|
},
|
|
11
|
-
"
|
|
12
|
-
|
|
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"]}
|
package/lib/cjs/utils/index.js
DELETED
|
@@ -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"]}
|
package/lib/esm/utils/index.js
DELETED
|
@@ -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";
|