taon 19.0.53 → 19.0.55
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/browser/fesm2022/taon.mjs +389 -222
- package/browser/fesm2022/taon.mjs.map +1 -1
- package/browser/lib/base-classes/base-controller.d.ts +11 -0
- package/browser/lib/base-classes/base-file-upload.middleware.d.ts +15 -0
- package/browser/lib/base-classes/base-middleware.d.ts +30 -8
- package/browser/lib/decorators/classes/controller-config.d.ts +10 -0
- package/browser/lib/decorators/classes/controller-decorator.d.ts +2 -12
- package/browser/lib/decorators/classes/controller-options.d.ts +12 -0
- package/browser/lib/decorators/classes/entity-decorator.d.ts +2 -2
- package/browser/lib/decorators/classes/middleware-decorator.d.ts +2 -2
- package/browser/lib/decorators/classes/migration-decorator.d.ts +2 -2
- package/browser/lib/decorators/classes/provider-decorator.d.ts +2 -2
- package/browser/lib/decorators/classes/repository-decorator.d.ts +2 -2
- package/browser/lib/decorators/classes/subscriber-decorator.d.ts +2 -2
- package/browser/lib/decorators/decorator-abstract-opt.d.ts +4 -0
- package/browser/lib/decorators/http/http-methods-decorators.d.ts +8 -5
- package/browser/lib/endpoint-context.d.ts +3 -2
- package/browser/lib/helpers/class-helpers.d.ts +7 -3
- package/browser/lib/helpers/taon-helpers.d.ts +2 -1
- package/browser/lib/index.d.ts +2 -1
- package/browser/lib/models.d.ts +16 -23
- package/browser/package.json +1 -1
- package/lib/base-classes/base-context.js +4 -0
- package/lib/base-classes/base-context.js.map +1 -1
- package/lib/base-classes/base-controller.d.ts +12 -0
- package/lib/base-classes/base-controller.js +56 -1
- package/lib/base-classes/base-controller.js.map +1 -1
- package/lib/base-classes/base-file-upload.middleware.d.ts +14 -0
- package/lib/base-classes/base-file-upload.middleware.js +85 -0
- package/lib/base-classes/base-file-upload.middleware.js.map +1 -0
- package/lib/base-classes/base-middleware.d.ts +30 -12
- package/lib/base-classes/base-middleware.js.map +1 -1
- package/lib/build-info._auto-generated_.d.ts +1 -1
- package/lib/build-info._auto-generated_.js +1 -1
- package/lib/decorators/classes/controller-config.d.ts +9 -0
- package/lib/decorators/classes/controller-config.js +11 -0
- package/lib/decorators/classes/controller-config.js.map +1 -0
- package/lib/decorators/classes/controller-decorator.d.ts +2 -12
- package/lib/decorators/classes/controller-decorator.js +0 -13
- package/lib/decorators/classes/controller-decorator.js.map +1 -1
- package/lib/decorators/classes/controller-options.d.ts +11 -0
- package/lib/decorators/classes/controller-options.js +16 -0
- package/lib/decorators/classes/controller-options.js.map +1 -0
- package/lib/decorators/classes/entity-decorator.d.ts +2 -2
- package/lib/decorators/classes/entity-decorator.js +7 -9
- package/lib/decorators/classes/entity-decorator.js.map +1 -1
- package/lib/decorators/classes/middleware-decorator.d.ts +2 -2
- package/lib/decorators/classes/middleware-decorator.js +2 -2
- package/lib/decorators/classes/middleware-decorator.js.map +1 -1
- package/lib/decorators/classes/migration-decorator.d.ts +2 -2
- package/lib/decorators/classes/migration-decorator.js +2 -2
- package/lib/decorators/classes/migration-decorator.js.map +1 -1
- package/lib/decorators/classes/provider-decorator.d.ts +2 -2
- package/lib/decorators/classes/provider-decorator.js +2 -2
- package/lib/decorators/classes/provider-decorator.js.map +1 -1
- package/lib/decorators/classes/repository-decorator.d.ts +2 -2
- package/lib/decorators/classes/repository-decorator.js +2 -2
- package/lib/decorators/classes/repository-decorator.js.map +1 -1
- package/lib/decorators/classes/subscriber-decorator.d.ts +2 -2
- package/lib/decorators/classes/subscriber-decorator.js +2 -2
- package/lib/decorators/classes/subscriber-decorator.js.map +1 -1
- package/lib/decorators/decorator-abstract-opt.d.ts +3 -0
- package/lib/decorators/decorator-abstract-opt.js +8 -0
- package/lib/decorators/decorator-abstract-opt.js.map +1 -0
- package/lib/decorators/http/http-methods-decorators.d.ts +8 -5
- package/lib/decorators/http/http-methods-decorators.js +3 -2
- package/lib/decorators/http/http-methods-decorators.js.map +1 -1
- package/lib/endpoint-context.d.ts +3 -2
- package/lib/endpoint-context.js +121 -71
- package/lib/endpoint-context.js.map +1 -1
- package/lib/helpers/class-helpers.d.ts +7 -3
- package/lib/helpers/class-helpers.js +12 -6
- package/lib/helpers/class-helpers.js.map +1 -1
- package/lib/helpers/taon-helpers.d.ts +2 -1
- package/lib/helpers/taon-helpers.js +1 -1
- package/lib/helpers/taon-helpers.js.map +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.js.map +1 -1
- package/lib/models.d.ts +17 -25
- package/lib/models.js +4 -31
- package/lib/models.js.map +1 -1
- package/lib/ui/index.js +2 -2
- package/lib/ui/taon-admin-mode-configuration/index.js +2 -2
- package/package.json +1 -1
- package/websql/fesm2022/taon.mjs +386 -217
- package/websql/fesm2022/taon.mjs.map +1 -1
- package/websql/lib/base-classes/base-controller.d.ts +11 -0
- package/websql/lib/base-classes/base-file-upload.middleware.d.ts +15 -0
- package/websql/lib/base-classes/base-middleware.d.ts +30 -12
- package/websql/lib/decorators/classes/controller-config.d.ts +10 -0
- package/websql/lib/decorators/classes/controller-decorator.d.ts +2 -12
- package/websql/lib/decorators/classes/controller-options.d.ts +12 -0
- package/websql/lib/decorators/classes/entity-decorator.d.ts +2 -2
- package/websql/lib/decorators/classes/middleware-decorator.d.ts +2 -2
- package/websql/lib/decorators/classes/migration-decorator.d.ts +2 -2
- package/websql/lib/decorators/classes/provider-decorator.d.ts +2 -2
- package/websql/lib/decorators/classes/repository-decorator.d.ts +2 -2
- package/websql/lib/decorators/classes/subscriber-decorator.d.ts +2 -2
- package/websql/lib/decorators/decorator-abstract-opt.d.ts +4 -0
- package/websql/lib/decorators/http/http-methods-decorators.d.ts +8 -5
- package/websql/lib/endpoint-context.d.ts +3 -2
- package/websql/lib/helpers/class-helpers.d.ts +7 -3
- package/websql/lib/helpers/taon-helpers.d.ts +2 -1
- package/websql/lib/index.d.ts +2 -1
- package/websql/lib/models.d.ts +17 -25
- package/websql/package.json +1 -1
|
@@ -1,19 +1,32 @@
|
|
|
1
1
|
import 'reflect-metadata';
|
|
2
2
|
import * as coreHelpers from 'tnp-core/browser';
|
|
3
|
-
import { _, Utils, Helpers, UtilsOs } from 'tnp-core/browser';
|
|
3
|
+
import { _, Utils, Helpers, UtilsOs, crossPlatformPath } from 'tnp-core/browser';
|
|
4
4
|
import { __decorate, __metadata, __param } from 'tslib';
|
|
5
5
|
import { walk } from 'lodash-walk-object/browser';
|
|
6
|
-
import { OrignalClassKey, Table } from 'taon-typeorm/browser';
|
|
7
6
|
import { SYMBOL, CLASS } from 'typescript-class-helpers/browser';
|
|
8
|
-
import {
|
|
7
|
+
import { OrignalClassKey, Table } from 'taon-typeorm/browser';
|
|
9
8
|
import * as i0 from '@angular/core';
|
|
10
9
|
import { InjectionToken, inject as inject$1, Injectable } from '@angular/core';
|
|
11
10
|
import axios from 'axios';
|
|
12
11
|
import { JSON10 } from 'json10/browser';
|
|
12
|
+
import { Models as Models$1, Resource, RestHeaders, Mapping } from 'ng2-rest/browser';
|
|
13
13
|
import { Observable, from, Subject } from 'rxjs';
|
|
14
14
|
import * as JSON5 from 'json5';
|
|
15
15
|
import { io } from 'socket.io-client';
|
|
16
16
|
|
|
17
|
+
class DecoratorAbstractOpt {
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
class TaonControllerOptions extends DecoratorAbstractOpt {
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
class ControllerConfig extends TaonControllerOptions {
|
|
24
|
+
constructor() {
|
|
25
|
+
super(...arguments);
|
|
26
|
+
this.methods = {};
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
17
30
|
var Symbols;
|
|
18
31
|
(function (Symbols) {
|
|
19
32
|
Symbols.ctxInClassOrClassObj = Symbol();
|
|
@@ -204,127 +217,9 @@ var Validators;
|
|
|
204
217
|
};
|
|
205
218
|
})(Validators || (Validators = {}));
|
|
206
219
|
|
|
207
|
-
|
|
208
|
-
(function (Models) {
|
|
209
|
-
//#region models / class types
|
|
210
|
-
let ClassType;
|
|
211
|
-
(function (ClassType) {
|
|
212
|
-
ClassType["ENTITY"] = "ENTITY";
|
|
213
|
-
ClassType["CONTROLLER"] = "CONTROLLER";
|
|
214
|
-
ClassType["REPOSITORY"] = "REPOSITORY";
|
|
215
|
-
ClassType["PROVIDER"] = "PROVIDER";
|
|
216
|
-
ClassType["SUBSCRIBER"] = "SUBSCRIBER";
|
|
217
|
-
ClassType["MIGRATION"] = "MIGRATION";
|
|
218
|
-
ClassType["MIDDLEWARE"] = "MIDDLEWARE";
|
|
219
|
-
})(ClassType = Models.ClassType || (Models.ClassType = {}));
|
|
220
|
-
Models.ClassTypeKey = {
|
|
221
|
-
[ClassType.ENTITY]: 'entities',
|
|
222
|
-
[ClassType.CONTROLLER]: 'controllers',
|
|
223
|
-
[ClassType.REPOSITORY]: 'repositories',
|
|
224
|
-
[ClassType.PROVIDER]: 'providers',
|
|
225
|
-
[ClassType.SUBSCRIBER]: 'subscribers',
|
|
226
|
-
[ClassType.MIGRATION]: 'migrations',
|
|
227
|
-
[ClassType.MIDDLEWARE]: 'middlewares',
|
|
228
|
-
};
|
|
229
|
-
//#endregion
|
|
230
|
-
//#region models / database connection options
|
|
231
|
-
class DatabaseConfigTypeOrm {
|
|
232
|
-
}
|
|
233
|
-
Models.DatabaseConfigTypeOrm = DatabaseConfigTypeOrm;
|
|
234
|
-
//#endregion
|
|
235
|
-
//#region models / database config
|
|
236
|
-
class DatabaseConfig extends DatabaseConfigTypeOrm {
|
|
237
|
-
static from(databasePartialConfig) {
|
|
238
|
-
return _.merge(new DatabaseConfig(), databasePartialConfig);
|
|
239
|
-
}
|
|
240
|
-
get databaseConfigTypeORM() {
|
|
241
|
-
/* */
|
|
242
|
-
/* */
|
|
243
|
-
/* */
|
|
244
|
-
/* */
|
|
245
|
-
/* */
|
|
246
|
-
/* */
|
|
247
|
-
/* */
|
|
248
|
-
/* */
|
|
249
|
-
/* */
|
|
250
|
-
/* */
|
|
251
|
-
/* */
|
|
252
|
-
/* */
|
|
253
|
-
/* */
|
|
254
|
-
/* */
|
|
255
|
-
return (void 0);
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
Models.DatabaseConfig = DatabaseConfig;
|
|
259
|
-
//#endregion
|
|
260
|
-
//#region models / decorator abstract options
|
|
261
|
-
class DecoratorAbstractOpt {
|
|
262
|
-
}
|
|
263
|
-
Models.DecoratorAbstractOpt = DecoratorAbstractOpt;
|
|
264
|
-
//#endregion
|
|
265
|
-
//#region models / param config
|
|
266
|
-
class ParamConfig {
|
|
267
|
-
}
|
|
268
|
-
Models.ParamConfig = ParamConfig;
|
|
269
|
-
//#endregion
|
|
270
|
-
//#region models / method config
|
|
271
|
-
class MethodConfig {
|
|
272
|
-
constructor() {
|
|
273
|
-
/* */
|
|
274
|
-
/* */
|
|
275
|
-
this.parameters = {};
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
Models.MethodConfig = MethodConfig;
|
|
279
|
-
//#endregion
|
|
280
|
-
//#region models / controller config
|
|
281
|
-
class ControllerConfig extends DecoratorAbstractOpt {
|
|
282
|
-
constructor() {
|
|
283
|
-
super(...arguments);
|
|
284
|
-
this.methods = {};
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
Models.ControllerConfig = ControllerConfig;
|
|
288
|
-
//#endregion
|
|
289
|
-
//#region models / runtime controller config
|
|
290
|
-
class RuntimeControllerConfig extends ControllerConfig {
|
|
291
|
-
}
|
|
292
|
-
Models.RuntimeControllerConfig = RuntimeControllerConfig;
|
|
293
|
-
//#endregion
|
|
294
|
-
//#region models / http
|
|
295
|
-
let Http;
|
|
296
|
-
(function (Http) {
|
|
297
|
-
Http.Rest = Models$1;
|
|
298
|
-
class Errors {
|
|
299
|
-
constructor(message, code = 400) {
|
|
300
|
-
this.message = message;
|
|
301
|
-
this.code = code;
|
|
302
|
-
this.toString = () => {
|
|
303
|
-
return this.message;
|
|
304
|
-
};
|
|
305
|
-
}
|
|
306
|
-
static create(message, code = 400) {
|
|
307
|
-
return new Errors(message, code);
|
|
308
|
-
}
|
|
309
|
-
static entityNotFound(entity) {
|
|
310
|
-
return Errors.create(`Entity ${ClassHelpers.getName(entity)} not found`);
|
|
311
|
-
}
|
|
312
|
-
static custom(message, code = 400) {
|
|
313
|
-
return Errors.create(message, code);
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
Http.Errors = Errors;
|
|
317
|
-
/* */
|
|
318
|
-
/* */
|
|
319
|
-
/* */
|
|
320
|
-
/* */
|
|
321
|
-
/* */
|
|
322
|
-
})(Http = Models.Http || (Models.Http = {}));
|
|
323
|
-
//#endregion
|
|
324
|
-
})(Models || (Models = {}));
|
|
325
|
-
|
|
326
|
-
/* */
|
|
220
|
+
//#region imports
|
|
327
221
|
/* */
|
|
222
|
+
//#endregion
|
|
328
223
|
var ClassHelpers;
|
|
329
224
|
(function (ClassHelpers) {
|
|
330
225
|
//#region get class from name
|
|
@@ -429,7 +324,7 @@ var ClassHelpers;
|
|
|
429
324
|
//#region get all metadata for controller
|
|
430
325
|
ClassHelpers.getControllerConfig = (target) => {
|
|
431
326
|
const classMetadataOptions = Reflect.getMetadata(Symbols.metadata.options.controller, target);
|
|
432
|
-
const classMetadata = _.merge(new
|
|
327
|
+
const classMetadata = _.merge(new ControllerConfig(), classMetadataOptions);
|
|
433
328
|
// Iterate over all methods of the class
|
|
434
329
|
const methodNames = ClassHelpers.getMethodsNames(target); // Object.getOwnPropertyNames(target.prototype);
|
|
435
330
|
// console.log(`methodNames for ${ClassHelpers.getName(target)} `, methodNames)
|
|
@@ -467,6 +362,12 @@ var ClassHelpers;
|
|
|
467
362
|
'toLocaleString',
|
|
468
363
|
];
|
|
469
364
|
//#endregion
|
|
365
|
+
/**
|
|
366
|
+
* Express async handler for middleware functions.
|
|
367
|
+
*/
|
|
368
|
+
ClassHelpers.asyncHandler = fn => (req, res, next) => {
|
|
369
|
+
Promise.resolve(fn(req, res, next)).catch(next);
|
|
370
|
+
};
|
|
470
371
|
ClassHelpers.getMethodsNames = (classOrClassInstance, allMethodsNames = []) => {
|
|
471
372
|
if (!classOrClassInstance) {
|
|
472
373
|
return Utils.uniqArray(allMethodsNames);
|
|
@@ -1390,6 +1291,107 @@ var TaonHelpers;
|
|
|
1390
1291
|
//#endregion
|
|
1391
1292
|
})(TaonHelpers || (TaonHelpers = {}));
|
|
1392
1293
|
|
|
1294
|
+
var Models;
|
|
1295
|
+
(function (Models) {
|
|
1296
|
+
//#region models / class types
|
|
1297
|
+
let ClassType;
|
|
1298
|
+
(function (ClassType) {
|
|
1299
|
+
ClassType["ENTITY"] = "ENTITY";
|
|
1300
|
+
ClassType["CONTROLLER"] = "CONTROLLER";
|
|
1301
|
+
ClassType["REPOSITORY"] = "REPOSITORY";
|
|
1302
|
+
ClassType["PROVIDER"] = "PROVIDER";
|
|
1303
|
+
ClassType["SUBSCRIBER"] = "SUBSCRIBER";
|
|
1304
|
+
ClassType["MIGRATION"] = "MIGRATION";
|
|
1305
|
+
ClassType["MIDDLEWARE"] = "MIDDLEWARE";
|
|
1306
|
+
})(ClassType = Models.ClassType || (Models.ClassType = {}));
|
|
1307
|
+
Models.ClassTypeKey = {
|
|
1308
|
+
[ClassType.ENTITY]: 'entities',
|
|
1309
|
+
[ClassType.CONTROLLER]: 'controllers',
|
|
1310
|
+
[ClassType.REPOSITORY]: 'repositories',
|
|
1311
|
+
[ClassType.PROVIDER]: 'providers',
|
|
1312
|
+
[ClassType.SUBSCRIBER]: 'subscribers',
|
|
1313
|
+
[ClassType.MIGRATION]: 'migrations',
|
|
1314
|
+
[ClassType.MIDDLEWARE]: 'middlewares',
|
|
1315
|
+
};
|
|
1316
|
+
//#endregion
|
|
1317
|
+
//#region models / database connection options
|
|
1318
|
+
class DatabaseConfigTypeOrm {
|
|
1319
|
+
}
|
|
1320
|
+
Models.DatabaseConfigTypeOrm = DatabaseConfigTypeOrm;
|
|
1321
|
+
//#endregion
|
|
1322
|
+
//#region models / database config
|
|
1323
|
+
class DatabaseConfig extends DatabaseConfigTypeOrm {
|
|
1324
|
+
static from(databasePartialConfig) {
|
|
1325
|
+
return _.merge(new DatabaseConfig(), databasePartialConfig);
|
|
1326
|
+
}
|
|
1327
|
+
get databaseConfigTypeORM() {
|
|
1328
|
+
/* */
|
|
1329
|
+
/* */
|
|
1330
|
+
/* */
|
|
1331
|
+
/* */
|
|
1332
|
+
/* */
|
|
1333
|
+
/* */
|
|
1334
|
+
/* */
|
|
1335
|
+
/* */
|
|
1336
|
+
/* */
|
|
1337
|
+
/* */
|
|
1338
|
+
/* */
|
|
1339
|
+
/* */
|
|
1340
|
+
/* */
|
|
1341
|
+
/* */
|
|
1342
|
+
return (void 0);
|
|
1343
|
+
}
|
|
1344
|
+
}
|
|
1345
|
+
Models.DatabaseConfig = DatabaseConfig;
|
|
1346
|
+
//#endregion
|
|
1347
|
+
//#region models / param config
|
|
1348
|
+
class ParamConfig {
|
|
1349
|
+
}
|
|
1350
|
+
Models.ParamConfig = ParamConfig;
|
|
1351
|
+
//#endregion
|
|
1352
|
+
//#region models / method config
|
|
1353
|
+
/**
|
|
1354
|
+
* @link './decorators/http/http-methods-decorators.ts' TaonHttpDecoratorOptions
|
|
1355
|
+
*/
|
|
1356
|
+
class MethodConfig {
|
|
1357
|
+
constructor() {
|
|
1358
|
+
this.parameters = {};
|
|
1359
|
+
}
|
|
1360
|
+
}
|
|
1361
|
+
Models.MethodConfig = MethodConfig;
|
|
1362
|
+
//#endregion
|
|
1363
|
+
//#region models / http
|
|
1364
|
+
let Http;
|
|
1365
|
+
(function (Http) {
|
|
1366
|
+
Http.Rest = Models$1;
|
|
1367
|
+
class Errors {
|
|
1368
|
+
constructor(message, code = 400) {
|
|
1369
|
+
this.message = message;
|
|
1370
|
+
this.code = code;
|
|
1371
|
+
this.toString = () => {
|
|
1372
|
+
return this.message;
|
|
1373
|
+
};
|
|
1374
|
+
}
|
|
1375
|
+
static create(message, code = 400) {
|
|
1376
|
+
return new Errors(message, code);
|
|
1377
|
+
}
|
|
1378
|
+
static entityNotFound(entity) {
|
|
1379
|
+
return Errors.create(`Entity ${ClassHelpers.getName(entity)} not found`);
|
|
1380
|
+
}
|
|
1381
|
+
static custom(message, code = 400) {
|
|
1382
|
+
return Errors.create(message, code);
|
|
1383
|
+
}
|
|
1384
|
+
}
|
|
1385
|
+
Http.Errors = Errors;
|
|
1386
|
+
/* */
|
|
1387
|
+
/* */
|
|
1388
|
+
/* */
|
|
1389
|
+
/* */
|
|
1390
|
+
/* */
|
|
1391
|
+
})(Http = Models.Http || (Models.Http = {}));
|
|
1392
|
+
//#endregion
|
|
1393
|
+
})(Models || (Models = {}));
|
|
1394
|
+
|
|
1393
1395
|
//#region imports
|
|
1394
1396
|
/* */
|
|
1395
1397
|
/* */
|
|
@@ -3121,7 +3123,8 @@ class EndpointContext {
|
|
|
3121
3123
|
/* */
|
|
3122
3124
|
/* */
|
|
3123
3125
|
/* */
|
|
3124
|
-
|
|
3126
|
+
/* */
|
|
3127
|
+
await this.initCustomClientMiddlewares();
|
|
3125
3128
|
}
|
|
3126
3129
|
//#endregion
|
|
3127
3130
|
//#region prepare realtime
|
|
@@ -3342,7 +3345,6 @@ class EndpointContext {
|
|
|
3342
3345
|
/* */
|
|
3343
3346
|
/* */
|
|
3344
3347
|
/* */
|
|
3345
|
-
/* */
|
|
3346
3348
|
return (void 0);
|
|
3347
3349
|
}
|
|
3348
3350
|
//#endregion
|
|
@@ -3715,6 +3717,9 @@ class EndpointContext {
|
|
|
3715
3717
|
return this.config.contextName;
|
|
3716
3718
|
}
|
|
3717
3719
|
//#endregion
|
|
3720
|
+
get cwd() {
|
|
3721
|
+
return this.config.cwd || process.cwd();
|
|
3722
|
+
}
|
|
3718
3723
|
get activeContext() {
|
|
3719
3724
|
return this.config.activeContext || null;
|
|
3720
3725
|
}
|
|
@@ -3951,6 +3956,7 @@ class EndpointContext {
|
|
|
3951
3956
|
const configs = ClassHelpers.getControllerConfigs(controllerClassFn);
|
|
3952
3957
|
// console.log(`Class config for ${ClassHelpers.getName(controllerClassFn)}`, configs)
|
|
3953
3958
|
const classConfig = configs[0];
|
|
3959
|
+
//#region update class calculate path
|
|
3954
3960
|
const parentscalculatedPath = _.slice(configs, 1)
|
|
3955
3961
|
.reverse()
|
|
3956
3962
|
.map(bc => {
|
|
@@ -3974,6 +3980,7 @@ class EndpointContext {
|
|
|
3974
3980
|
}, [])
|
|
3975
3981
|
.join('/');
|
|
3976
3982
|
}
|
|
3983
|
+
//#endregion
|
|
3977
3984
|
// console.log('calculatedPath', classConfig.calculatedPath);
|
|
3978
3985
|
_.slice(configs, 1).forEach(bc => {
|
|
3979
3986
|
const alreadyIs = classConfig.methods;
|
|
@@ -4097,44 +4104,29 @@ class EndpointContext {
|
|
|
4097
4104
|
}
|
|
4098
4105
|
//#endregion
|
|
4099
4106
|
//#region methods & getters / init middlewares
|
|
4100
|
-
async
|
|
4101
|
-
const middlewares = this.getClassesInstancesArrBy(Models.ClassType.MIDDLEWARE)
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
});
|
|
4122
|
-
})(middlewareInstance, this.contextName, apiPrefix, this.uriPathnameOrNothingIfRoot);
|
|
4123
|
-
}
|
|
4124
|
-
}
|
|
4107
|
+
async initCustomClientMiddlewares() {
|
|
4108
|
+
const middlewares = this.getClassesInstancesArrBy(Models.ClassType.MIDDLEWARE)
|
|
4109
|
+
.map(f => f)
|
|
4110
|
+
.filter(f => _.isFunction(f.interceptClient));
|
|
4111
|
+
middlewares.forEach(instance => {
|
|
4112
|
+
const contextName = this.contextName;
|
|
4113
|
+
const interceptorName = `${contextName}-${ClassHelpers.getName(instance)}`;
|
|
4114
|
+
Resource.request.interceptors.set(interceptorName, {
|
|
4115
|
+
intercept: ({ req, next }) => {
|
|
4116
|
+
const url = new URL(req.url);
|
|
4117
|
+
if (url.pathname.startsWith(`${this.uriPathnameOrNothingIfRoot}/${apiPrefix}/${contextName}/`)) {
|
|
4118
|
+
// console.log('intercepting', url.pathname, req);
|
|
4119
|
+
return instance.interceptClient({
|
|
4120
|
+
req,
|
|
4121
|
+
next,
|
|
4122
|
+
});
|
|
4123
|
+
}
|
|
4124
|
+
return next.handle(req);
|
|
4125
|
+
},
|
|
4126
|
+
});
|
|
4127
|
+
});
|
|
4125
4128
|
}
|
|
4126
|
-
async
|
|
4127
|
-
/* */
|
|
4128
|
-
/* */
|
|
4129
|
-
/* */
|
|
4130
|
-
/* */
|
|
4131
|
-
/* */
|
|
4132
|
-
/* */
|
|
4133
|
-
/* */
|
|
4134
|
-
/* */
|
|
4135
|
-
/* */
|
|
4136
|
-
/* */
|
|
4137
|
-
/* */
|
|
4129
|
+
async initCustomBackendMiddlewares() {
|
|
4138
4130
|
/* */
|
|
4139
4131
|
/* */
|
|
4140
4132
|
/* */
|
|
@@ -4169,6 +4161,8 @@ class EndpointContext {
|
|
|
4169
4161
|
/* */
|
|
4170
4162
|
/* */
|
|
4171
4163
|
/* */
|
|
4164
|
+
}
|
|
4165
|
+
async initBackendMiddlewares() {
|
|
4172
4166
|
/* */
|
|
4173
4167
|
/* */
|
|
4174
4168
|
/* */
|
|
@@ -4278,16 +4272,31 @@ class EndpointContext {
|
|
|
4278
4272
|
//#region methods & getters / init methods node
|
|
4279
4273
|
initServer(
|
|
4280
4274
|
//#region parameters
|
|
4281
|
-
|
|
4275
|
+
httpMethodType, methodConfig, classConfig, expressPath, target) {
|
|
4282
4276
|
//#region resolve variables
|
|
4283
|
-
|
|
4284
|
-
|
|
4285
|
-
|
|
4286
|
-
|
|
4287
|
-
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
|
|
4277
|
+
const middlewareHandlers = (Array.isArray(methodConfig.middlewares) &&
|
|
4278
|
+
methodConfig.middlewares?.length > 0
|
|
4279
|
+
? methodConfig.middlewares
|
|
4280
|
+
: [])
|
|
4281
|
+
.map(middlewareClassFun => {
|
|
4282
|
+
const middlewareInstance = this.getInstanceBy(middlewareClassFun);
|
|
4283
|
+
if (middlewareInstance &&
|
|
4284
|
+
_.isFunction(middlewareInstance.interceptServerMethod)) {
|
|
4285
|
+
const middlewareFn = ClassHelpers.asyncHandler(async (req, res, next) => {
|
|
4286
|
+
await middlewareInstance.interceptServerMethod({
|
|
4287
|
+
req,
|
|
4288
|
+
res,
|
|
4289
|
+
next,
|
|
4290
|
+
}, {
|
|
4291
|
+
methodName: methodConfig.methodName,
|
|
4292
|
+
expressPath,
|
|
4293
|
+
httpRequestType: methodConfig.type,
|
|
4294
|
+
});
|
|
4295
|
+
});
|
|
4296
|
+
return middlewareFn;
|
|
4297
|
+
}
|
|
4298
|
+
})
|
|
4299
|
+
.filter(f => !!f);
|
|
4291
4300
|
// const url = this.uri;
|
|
4292
4301
|
//#region get result
|
|
4293
4302
|
const getResult = async (resolvedParams, req, res) => {
|
|
@@ -4297,7 +4306,7 @@ class EndpointContext {
|
|
|
4297
4306
|
*/
|
|
4298
4307
|
this.getInstanceBy(target),
|
|
4299
4308
|
/**
|
|
4300
|
-
* Params for
|
|
4309
|
+
* Params for method @GET, @PUT etc.
|
|
4301
4310
|
*/
|
|
4302
4311
|
resolvedParams);
|
|
4303
4312
|
let result = await getResponseValue(response, { req, res });
|
|
@@ -4340,6 +4349,7 @@ class EndpointContext {
|
|
|
4340
4349
|
/* */
|
|
4341
4350
|
/* */
|
|
4342
4351
|
/* */
|
|
4352
|
+
/* */
|
|
4343
4353
|
//#endregion
|
|
4344
4354
|
/* */
|
|
4345
4355
|
/* */
|
|
@@ -4555,6 +4565,7 @@ class EndpointContext {
|
|
|
4555
4565
|
/* */
|
|
4556
4566
|
/* */
|
|
4557
4567
|
/* */
|
|
4568
|
+
/* */
|
|
4558
4569
|
}
|
|
4559
4570
|
return {
|
|
4560
4571
|
expressPath: expressPath,
|
|
@@ -4568,10 +4579,31 @@ class EndpointContext {
|
|
|
4568
4579
|
*/
|
|
4569
4580
|
async initClient(
|
|
4570
4581
|
//#region parameters
|
|
4571
|
-
target,
|
|
4582
|
+
target, httpRequestType, methodConfig, // Models.Http.Rest.MethodConfig,
|
|
4583
|
+
expressPath) {
|
|
4572
4584
|
const ctx = this;
|
|
4585
|
+
//#region init middlewares
|
|
4586
|
+
const middlewares = methodConfig.middlewares
|
|
4587
|
+
.map(f => this.getInstanceBy(f))
|
|
4588
|
+
.filter(f => _.isFunction(f.interceptClientMethod));
|
|
4589
|
+
middlewares.forEach(instance => {
|
|
4590
|
+
Resource.request.methodsInterceptors.set(`${methodConfig.type?.toUpperCase()}-${expressPath}`, {
|
|
4591
|
+
intercept: ({ req, next }) => {
|
|
4592
|
+
return instance.interceptClientMethod({
|
|
4593
|
+
req,
|
|
4594
|
+
next,
|
|
4595
|
+
}, {
|
|
4596
|
+
methodName: methodConfig.methodName,
|
|
4597
|
+
expressPath,
|
|
4598
|
+
httpRequestType: httpRequestType,
|
|
4599
|
+
});
|
|
4600
|
+
},
|
|
4601
|
+
});
|
|
4602
|
+
});
|
|
4603
|
+
//#endregion
|
|
4573
4604
|
// : { received: any; /* Rest<any, any> */ }
|
|
4574
|
-
this.logHttp &&
|
|
4605
|
+
this.logHttp &&
|
|
4606
|
+
console.log(`${httpRequestType?.toUpperCase()} ${expressPath} `);
|
|
4575
4607
|
// console.log('INITING', methodConfig); // TODO inject in static
|
|
4576
4608
|
//#region resolve storage
|
|
4577
4609
|
// TODO not a good idea
|
|
@@ -4613,6 +4645,9 @@ class EndpointContext {
|
|
|
4613
4645
|
received['observable'] = from(received);
|
|
4614
4646
|
return {
|
|
4615
4647
|
received,
|
|
4648
|
+
request(axiosConfig) {
|
|
4649
|
+
return received;
|
|
4650
|
+
},
|
|
4616
4651
|
};
|
|
4617
4652
|
};
|
|
4618
4653
|
return;
|
|
@@ -4764,6 +4799,11 @@ class EndpointContext {
|
|
|
4764
4799
|
/* */
|
|
4765
4800
|
/* */
|
|
4766
4801
|
/* */
|
|
4802
|
+
/* */
|
|
4803
|
+
/* */
|
|
4804
|
+
/* */
|
|
4805
|
+
/* */
|
|
4806
|
+
/* */
|
|
4767
4807
|
//#endregion
|
|
4768
4808
|
//#region handle normal request
|
|
4769
4809
|
target.prototype[methodConfig.methodName] = function (...args) {
|
|
@@ -4804,8 +4844,7 @@ class EndpointContext {
|
|
|
4804
4844
|
else {
|
|
4805
4845
|
rest = endpoints[ctx.uriOrigin][expressPath];
|
|
4806
4846
|
}
|
|
4807
|
-
const method =
|
|
4808
|
-
const isWithBody = method === 'put' || method === 'post';
|
|
4847
|
+
const method = httpRequestType.toLowerCase();
|
|
4809
4848
|
const pathPrams = {};
|
|
4810
4849
|
let queryParams = {};
|
|
4811
4850
|
let bodyObject = {};
|
|
@@ -4903,9 +4942,13 @@ instead
|
|
|
4903
4942
|
}
|
|
4904
4943
|
//#endregion
|
|
4905
4944
|
const httpResultObj = {
|
|
4906
|
-
received
|
|
4907
|
-
|
|
4908
|
-
|
|
4945
|
+
get received() {
|
|
4946
|
+
return rest.model(pathPrams)[method](bodyObject, [queryParams]);
|
|
4947
|
+
},
|
|
4948
|
+
request(axiosConfig) {
|
|
4949
|
+
return rest
|
|
4950
|
+
.model(pathPrams)[method](bodyObject, [queryParams], axiosConfig);
|
|
4951
|
+
},
|
|
4909
4952
|
};
|
|
4910
4953
|
return httpResultObj;
|
|
4911
4954
|
};
|
|
@@ -5178,16 +5221,16 @@ const createContext = (configFn) => {
|
|
|
5178
5221
|
};
|
|
5179
5222
|
|
|
5180
5223
|
/**
|
|
5181
|
-
*
|
|
5224
|
+
* Provider decorator
|
|
5182
5225
|
*/
|
|
5183
|
-
function
|
|
5226
|
+
function TaonMiddleware(options) {
|
|
5184
5227
|
return function (constructor) {
|
|
5185
|
-
Reflect.defineMetadata(Symbols.metadata.options.
|
|
5228
|
+
Reflect.defineMetadata(Symbols.metadata.options.provider, options, constructor);
|
|
5186
5229
|
Reflect.defineMetadata(Symbols.metadata.className, options?.className || constructor.name, constructor);
|
|
5187
|
-
ClassHelpers.setName(constructor, options?.className);
|
|
5230
|
+
ClassHelpers.setName(constructor, options?.className || constructor.name);
|
|
5188
5231
|
};
|
|
5189
5232
|
}
|
|
5190
|
-
class
|
|
5233
|
+
class TaonMiddlewareOptions extends DecoratorAbstractOpt {
|
|
5191
5234
|
}
|
|
5192
5235
|
|
|
5193
5236
|
//#endregion
|
|
@@ -5374,6 +5417,95 @@ class BaseInjector {
|
|
|
5374
5417
|
}
|
|
5375
5418
|
}
|
|
5376
5419
|
|
|
5420
|
+
/**
|
|
5421
|
+
* TODO
|
|
5422
|
+
* - global provider available in all contexts
|
|
5423
|
+
* - provider available in own context
|
|
5424
|
+
*/
|
|
5425
|
+
class BaseMiddleware extends BaseInjector {
|
|
5426
|
+
}
|
|
5427
|
+
|
|
5428
|
+
//#endregion
|
|
5429
|
+
/**
|
|
5430
|
+
* Configurable file upload middleware (multer based)
|
|
5431
|
+
*/
|
|
5432
|
+
let BaseFileUploadMiddleware = class BaseFileUploadMiddleware extends BaseMiddleware {
|
|
5433
|
+
async interceptServerMethod({ req, res, next }, { methodName, expressPath }) {
|
|
5434
|
+
return this.middleware()(req, res, next);
|
|
5435
|
+
}
|
|
5436
|
+
//#region upload Dir
|
|
5437
|
+
uploadDir() {
|
|
5438
|
+
return crossPlatformPath([this.ctx.cwd, 'uploaded-files']);
|
|
5439
|
+
}
|
|
5440
|
+
//#endregion
|
|
5441
|
+
//#region storage
|
|
5442
|
+
storage() {
|
|
5443
|
+
/* */
|
|
5444
|
+
/* */
|
|
5445
|
+
/* */
|
|
5446
|
+
/* */
|
|
5447
|
+
/* */
|
|
5448
|
+
/* */
|
|
5449
|
+
/* */
|
|
5450
|
+
/* */
|
|
5451
|
+
/* */
|
|
5452
|
+
/* */
|
|
5453
|
+
/* */
|
|
5454
|
+
/* */
|
|
5455
|
+
/* */
|
|
5456
|
+
/* */
|
|
5457
|
+
/* */
|
|
5458
|
+
/* */
|
|
5459
|
+
/* */
|
|
5460
|
+
/* */
|
|
5461
|
+
/* */
|
|
5462
|
+
return (void 0);
|
|
5463
|
+
}
|
|
5464
|
+
//#endregion
|
|
5465
|
+
//#region upload
|
|
5466
|
+
upload() {
|
|
5467
|
+
/* */
|
|
5468
|
+
/* */
|
|
5469
|
+
/* */
|
|
5470
|
+
/* */
|
|
5471
|
+
/* */
|
|
5472
|
+
/* */
|
|
5473
|
+
/* */
|
|
5474
|
+
/* */
|
|
5475
|
+
/* */
|
|
5476
|
+
/* */
|
|
5477
|
+
/* */
|
|
5478
|
+
/* */
|
|
5479
|
+
/* */
|
|
5480
|
+
return (void 0);
|
|
5481
|
+
}
|
|
5482
|
+
//#endregion
|
|
5483
|
+
//#region middleware
|
|
5484
|
+
middleware() {
|
|
5485
|
+
/* */
|
|
5486
|
+
/* */
|
|
5487
|
+
return (void 0);
|
|
5488
|
+
}
|
|
5489
|
+
};
|
|
5490
|
+
BaseFileUploadMiddleware = __decorate([
|
|
5491
|
+
TaonMiddleware({
|
|
5492
|
+
className: 'BaseFileUploadMiddleware',
|
|
5493
|
+
})
|
|
5494
|
+
], BaseFileUploadMiddleware);
|
|
5495
|
+
|
|
5496
|
+
/**
|
|
5497
|
+
* Repository decorator
|
|
5498
|
+
*/
|
|
5499
|
+
function TaonRepository(options) {
|
|
5500
|
+
return function (constructor) {
|
|
5501
|
+
Reflect.defineMetadata(Symbols.metadata.options.repository, options, constructor);
|
|
5502
|
+
Reflect.defineMetadata(Symbols.metadata.className, options?.className || constructor.name, constructor);
|
|
5503
|
+
ClassHelpers.setName(constructor, options?.className);
|
|
5504
|
+
};
|
|
5505
|
+
}
|
|
5506
|
+
class TaonRepositoryOptions extends DecoratorAbstractOpt {
|
|
5507
|
+
}
|
|
5508
|
+
|
|
5377
5509
|
//#endregion
|
|
5378
5510
|
let BaseCustomRepository = class BaseCustomRepository extends BaseInjector {
|
|
5379
5511
|
};
|
|
@@ -5994,6 +6126,9 @@ BaseRepository = __decorate([
|
|
|
5994
6126
|
const BaseContext = createContext(() => ({
|
|
5995
6127
|
contextName: 'BaseContext',
|
|
5996
6128
|
abstract: true,
|
|
6129
|
+
middlewares: {
|
|
6130
|
+
BaseFileUploadMiddleware,
|
|
6131
|
+
},
|
|
5997
6132
|
repositories: {
|
|
5998
6133
|
// @ts-ignore
|
|
5999
6134
|
BaseRepository,
|
|
@@ -6015,14 +6150,6 @@ function TaonController(options) {
|
|
|
6015
6150
|
Reflect.defineMetadata(Symbols.metadata.className, options?.className || constructor.name, constructor);
|
|
6016
6151
|
};
|
|
6017
6152
|
}
|
|
6018
|
-
class TaonControllerOptions extends Models.DecoratorAbstractOpt {
|
|
6019
|
-
}
|
|
6020
|
-
|
|
6021
|
-
let BaseController = class BaseController extends BaseInjector {
|
|
6022
|
-
};
|
|
6023
|
-
BaseController = __decorate([
|
|
6024
|
-
TaonController({ className: 'BaseController' })
|
|
6025
|
-
], BaseController);
|
|
6026
6153
|
|
|
6027
6154
|
const metaReq = (method, path, target, propertyKey, descriptor, pathOrOptions, pathIsGlobal) => {
|
|
6028
6155
|
let options;
|
|
@@ -6035,13 +6162,14 @@ const metaReq = (method, path, target, propertyKey, descriptor, pathOrOptions, p
|
|
|
6035
6162
|
else {
|
|
6036
6163
|
options = { pathOrOptions, pathIsGlobal };
|
|
6037
6164
|
}
|
|
6038
|
-
const { overrideContentType,
|
|
6165
|
+
const { overrideContentType, overrideResponseType, middlewares } = options;
|
|
6039
6166
|
let methodConfig = Reflect.getMetadata(Symbols.metadata.options.controllerMethod, target.constructor, propertyKey);
|
|
6040
6167
|
if (!methodConfig) {
|
|
6041
6168
|
methodConfig = new Models.MethodConfig();
|
|
6042
6169
|
Reflect.defineMetadata(Symbols.metadata.options.controllerMethod, methodConfig, target.constructor, propertyKey);
|
|
6043
6170
|
}
|
|
6044
6171
|
methodConfig.methodName = propertyKey;
|
|
6172
|
+
methodConfig.middlewares = middlewares || [];
|
|
6045
6173
|
methodConfig.type = method;
|
|
6046
6174
|
if (!path) {
|
|
6047
6175
|
let paramsPathConcatedPath = '';
|
|
@@ -6063,7 +6191,7 @@ const metaReq = (method, path, target, propertyKey, descriptor, pathOrOptions, p
|
|
|
6063
6191
|
methodConfig.descriptor = descriptor;
|
|
6064
6192
|
methodConfig.global = pathIsGlobal;
|
|
6065
6193
|
methodConfig.contentType = overrideContentType;
|
|
6066
|
-
methodConfig.responseType =
|
|
6194
|
+
methodConfig.responseType = overrideResponseType;
|
|
6067
6195
|
Reflect.defineMetadata(Symbols.metadata.options.controllerMethod, methodConfig, target.constructor, propertyKey);
|
|
6068
6196
|
// console.log('methods updated', methodConfig);
|
|
6069
6197
|
};
|
|
@@ -6142,6 +6270,68 @@ function Body(name) {
|
|
|
6142
6270
|
};
|
|
6143
6271
|
}
|
|
6144
6272
|
|
|
6273
|
+
/* */
|
|
6274
|
+
/* */
|
|
6275
|
+
let BaseController = class BaseController extends BaseInjector {
|
|
6276
|
+
//#region upload form data to server
|
|
6277
|
+
uploadFormDataToServer(formData) {
|
|
6278
|
+
/* */
|
|
6279
|
+
/* */
|
|
6280
|
+
/* */
|
|
6281
|
+
/* */
|
|
6282
|
+
/* */
|
|
6283
|
+
/* */
|
|
6284
|
+
/* */
|
|
6285
|
+
/* */
|
|
6286
|
+
/* */
|
|
6287
|
+
/* */
|
|
6288
|
+
/* */
|
|
6289
|
+
/* */
|
|
6290
|
+
/* */
|
|
6291
|
+
/* */
|
|
6292
|
+
/* */
|
|
6293
|
+
/* */
|
|
6294
|
+
/* */
|
|
6295
|
+
/* */
|
|
6296
|
+
/* */
|
|
6297
|
+
/* */
|
|
6298
|
+
/* */
|
|
6299
|
+
return (void 0);
|
|
6300
|
+
}
|
|
6301
|
+
//#endregion
|
|
6302
|
+
//#region upload local file to server
|
|
6303
|
+
async uploadLocalFileToServer(absFilePath) {
|
|
6304
|
+
/* */
|
|
6305
|
+
/* */
|
|
6306
|
+
/* */
|
|
6307
|
+
/* */
|
|
6308
|
+
/* */
|
|
6309
|
+
/* */
|
|
6310
|
+
/* */
|
|
6311
|
+
/* */
|
|
6312
|
+
/* */
|
|
6313
|
+
/* */
|
|
6314
|
+
/* */
|
|
6315
|
+
/* */
|
|
6316
|
+
return (void 0);
|
|
6317
|
+
}
|
|
6318
|
+
};
|
|
6319
|
+
__decorate([
|
|
6320
|
+
POST({
|
|
6321
|
+
overrideContentType: 'multipart/form-data',
|
|
6322
|
+
middlewares: [BaseFileUploadMiddleware],
|
|
6323
|
+
}),
|
|
6324
|
+
__param(0, Body()),
|
|
6325
|
+
__metadata("design:type", Function),
|
|
6326
|
+
__metadata("design:paramtypes", [FormData]),
|
|
6327
|
+
__metadata("design:returntype", Object)
|
|
6328
|
+
], BaseController.prototype, "uploadFormDataToServer", null);
|
|
6329
|
+
BaseController = __decorate([
|
|
6330
|
+
TaonController({
|
|
6331
|
+
className: 'BaseController',
|
|
6332
|
+
})
|
|
6333
|
+
], BaseController);
|
|
6334
|
+
|
|
6145
6335
|
//#endregion
|
|
6146
6336
|
/**
|
|
6147
6337
|
* Please override property entityClassFn with entity class.
|
|
@@ -6426,14 +6616,6 @@ BaseCrudController = __decorate([
|
|
|
6426
6616
|
TaonController({ className: 'BaseCrudController' })
|
|
6427
6617
|
], BaseCrudController);
|
|
6428
6618
|
|
|
6429
|
-
/**
|
|
6430
|
-
* TODO
|
|
6431
|
-
* - global provider available in all contexts
|
|
6432
|
-
* - provider available in own context
|
|
6433
|
-
*/
|
|
6434
|
-
class BaseMiddleware extends BaseInjector {
|
|
6435
|
-
}
|
|
6436
|
-
|
|
6437
6619
|
class BaseMigration extends BaseInjector {
|
|
6438
6620
|
/**
|
|
6439
6621
|
* by default is READY to run
|
|
@@ -6470,7 +6652,7 @@ function TaonSubscriber(options) {
|
|
|
6470
6652
|
ClassHelpers.setName(constructor, options?.className);
|
|
6471
6653
|
};
|
|
6472
6654
|
}
|
|
6473
|
-
class TaonSubscriberOptions extends
|
|
6655
|
+
class TaonSubscriberOptions extends DecoratorAbstractOpt {
|
|
6474
6656
|
}
|
|
6475
6657
|
|
|
6476
6658
|
let BaseSubscriberForEntity = class BaseSubscriberForEntity extends BaseInjector {
|
|
@@ -6633,8 +6815,6 @@ var Base;
|
|
|
6633
6815
|
Base.Context = BaseContext;
|
|
6634
6816
|
})(Base || (Base = {}));
|
|
6635
6817
|
|
|
6636
|
-
/* */
|
|
6637
|
-
/* */
|
|
6638
6818
|
/**
|
|
6639
6819
|
* Entity decorator
|
|
6640
6820
|
*/
|
|
@@ -6653,20 +6833,7 @@ function TaonEntity(options) {
|
|
|
6653
6833
|
CLASS.setName(constructor, options?.className); // TODO QUICK_FIX for ng2-rest
|
|
6654
6834
|
};
|
|
6655
6835
|
}
|
|
6656
|
-
class TaonEntityOptions extends
|
|
6657
|
-
}
|
|
6658
|
-
|
|
6659
|
-
/**
|
|
6660
|
-
* Provider decorator
|
|
6661
|
-
*/
|
|
6662
|
-
function TaonMiddleware(options) {
|
|
6663
|
-
return function (constructor) {
|
|
6664
|
-
Reflect.defineMetadata(Symbols.metadata.options.provider, options, constructor);
|
|
6665
|
-
Reflect.defineMetadata(Symbols.metadata.className, options?.className || constructor.name, constructor);
|
|
6666
|
-
ClassHelpers.setName(constructor, options?.className || constructor.name);
|
|
6667
|
-
};
|
|
6668
|
-
}
|
|
6669
|
-
class TaonMiddlewareOptions extends Models.DecoratorAbstractOpt {
|
|
6836
|
+
class TaonEntityOptions extends DecoratorAbstractOpt {
|
|
6670
6837
|
}
|
|
6671
6838
|
|
|
6672
6839
|
/**
|
|
@@ -6679,7 +6846,7 @@ function TaonMigration(options) {
|
|
|
6679
6846
|
ClassHelpers.setName(constructor, options?.className);
|
|
6680
6847
|
};
|
|
6681
6848
|
}
|
|
6682
|
-
class TaonMigrationOptions extends
|
|
6849
|
+
class TaonMigrationOptions extends DecoratorAbstractOpt {
|
|
6683
6850
|
}
|
|
6684
6851
|
|
|
6685
6852
|
/**
|
|
@@ -6692,7 +6859,7 @@ function TaonProvider(options) {
|
|
|
6692
6859
|
ClassHelpers.setName(constructor, options?.className || constructor.name);
|
|
6693
6860
|
};
|
|
6694
6861
|
}
|
|
6695
|
-
class TaonProviderOptions extends
|
|
6862
|
+
class TaonProviderOptions extends DecoratorAbstractOpt {
|
|
6696
6863
|
}
|
|
6697
6864
|
|
|
6698
6865
|
var Http;
|