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
package/websql/fesm2022/taon.mjs
CHANGED
|
@@ -6,11 +6,11 @@ import * as tsorm from 'taon-typeorm/websql';
|
|
|
6
6
|
import { OrignalClassKey, Entity, Table, TableIndex, EventSubscriber, DataSource } from 'taon-typeorm/websql';
|
|
7
7
|
import { walk } from 'lodash-walk-object/websql';
|
|
8
8
|
import { SYMBOL, CLASS } from 'typescript-class-helpers/websql';
|
|
9
|
-
import { Models as Models$1, Resource, RestHeaders, Mapping } from 'ng2-rest/websql';
|
|
10
9
|
import * as i0 from '@angular/core';
|
|
11
10
|
import { InjectionToken, inject as inject$1, Injectable } from '@angular/core';
|
|
12
11
|
import axios from 'axios';
|
|
13
12
|
import { JSON10 } from 'json10/websql';
|
|
13
|
+
import { Models as Models$1, Resource, RestHeaders, Mapping } from 'ng2-rest/websql';
|
|
14
14
|
import { Observable, Subject, from } from 'rxjs';
|
|
15
15
|
import * as JSON5 from 'json5';
|
|
16
16
|
import { io } from 'socket.io-client';
|
|
@@ -122,6 +122,19 @@ var Orm;
|
|
|
122
122
|
})(Orm || (Orm = {}));
|
|
123
123
|
//#endregion
|
|
124
124
|
|
|
125
|
+
class DecoratorAbstractOpt {
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
class TaonControllerOptions extends DecoratorAbstractOpt {
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
class ControllerConfig extends TaonControllerOptions {
|
|
132
|
+
constructor() {
|
|
133
|
+
super(...arguments);
|
|
134
|
+
this.methods = {};
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
125
138
|
var Symbols;
|
|
126
139
|
(function (Symbols) {
|
|
127
140
|
Symbols.ctxInClassOrClassObj = Symbol();
|
|
@@ -312,122 +325,9 @@ var Validators;
|
|
|
312
325
|
};
|
|
313
326
|
})(Validators || (Validators = {}));
|
|
314
327
|
|
|
315
|
-
|
|
316
|
-
(function (Models) {
|
|
317
|
-
//#region models / class types
|
|
318
|
-
let ClassType;
|
|
319
|
-
(function (ClassType) {
|
|
320
|
-
ClassType["ENTITY"] = "ENTITY";
|
|
321
|
-
ClassType["CONTROLLER"] = "CONTROLLER";
|
|
322
|
-
ClassType["REPOSITORY"] = "REPOSITORY";
|
|
323
|
-
ClassType["PROVIDER"] = "PROVIDER";
|
|
324
|
-
ClassType["SUBSCRIBER"] = "SUBSCRIBER";
|
|
325
|
-
ClassType["MIGRATION"] = "MIGRATION";
|
|
326
|
-
ClassType["MIDDLEWARE"] = "MIDDLEWARE";
|
|
327
|
-
})(ClassType = Models.ClassType || (Models.ClassType = {}));
|
|
328
|
-
Models.ClassTypeKey = {
|
|
329
|
-
[ClassType.ENTITY]: 'entities',
|
|
330
|
-
[ClassType.CONTROLLER]: 'controllers',
|
|
331
|
-
[ClassType.REPOSITORY]: 'repositories',
|
|
332
|
-
[ClassType.PROVIDER]: 'providers',
|
|
333
|
-
[ClassType.SUBSCRIBER]: 'subscribers',
|
|
334
|
-
[ClassType.MIGRATION]: 'migrations',
|
|
335
|
-
[ClassType.MIDDLEWARE]: 'middlewares',
|
|
336
|
-
};
|
|
337
|
-
//#endregion
|
|
338
|
-
//#region models / database connection options
|
|
339
|
-
class DatabaseConfigTypeOrm {
|
|
340
|
-
}
|
|
341
|
-
Models.DatabaseConfigTypeOrm = DatabaseConfigTypeOrm;
|
|
342
|
-
//#endregion
|
|
343
|
-
//#region models / database config
|
|
344
|
-
class DatabaseConfig extends DatabaseConfigTypeOrm {
|
|
345
|
-
static from(databasePartialConfig) {
|
|
346
|
-
return _.merge(new DatabaseConfig(), databasePartialConfig);
|
|
347
|
-
}
|
|
348
|
-
get databaseConfigTypeORM() {
|
|
349
|
-
//#region @websqlFunc
|
|
350
|
-
const result = _.cloneDeep(this);
|
|
351
|
-
if (result.recreateMode) {
|
|
352
|
-
if (result.recreateMode === 'DROP_DB+MIGRATIONS') {
|
|
353
|
-
result.synchronize = true;
|
|
354
|
-
result.dropSchema = true;
|
|
355
|
-
}
|
|
356
|
-
else if (result.recreateMode === 'PRESERVE_DATA+MIGRATIONS') {
|
|
357
|
-
result.synchronize = false;
|
|
358
|
-
result.dropSchema = false;
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
delete result.recreateMode;
|
|
362
|
-
return result;
|
|
363
|
-
//#endregion
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
Models.DatabaseConfig = DatabaseConfig;
|
|
367
|
-
//#endregion
|
|
368
|
-
//#region models / decorator abstract options
|
|
369
|
-
class DecoratorAbstractOpt {
|
|
370
|
-
}
|
|
371
|
-
Models.DecoratorAbstractOpt = DecoratorAbstractOpt;
|
|
372
|
-
//#endregion
|
|
373
|
-
//#region models / param config
|
|
374
|
-
class ParamConfig {
|
|
375
|
-
}
|
|
376
|
-
Models.ParamConfig = ParamConfig;
|
|
377
|
-
//#endregion
|
|
378
|
-
//#region models / method config
|
|
379
|
-
class MethodConfig {
|
|
380
|
-
constructor() {
|
|
381
|
-
//#endregion
|
|
382
|
-
this.parameters = {};
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
Models.MethodConfig = MethodConfig;
|
|
386
|
-
//#endregion
|
|
387
|
-
//#region models / controller config
|
|
388
|
-
class ControllerConfig extends DecoratorAbstractOpt {
|
|
389
|
-
constructor() {
|
|
390
|
-
super(...arguments);
|
|
391
|
-
this.methods = {};
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
Models.ControllerConfig = ControllerConfig;
|
|
395
|
-
//#endregion
|
|
396
|
-
//#region models / runtime controller config
|
|
397
|
-
class RuntimeControllerConfig extends ControllerConfig {
|
|
398
|
-
}
|
|
399
|
-
Models.RuntimeControllerConfig = RuntimeControllerConfig;
|
|
400
|
-
//#endregion
|
|
401
|
-
//#region models / http
|
|
402
|
-
let Http;
|
|
403
|
-
(function (Http) {
|
|
404
|
-
Http.Rest = Models$1;
|
|
405
|
-
class Errors {
|
|
406
|
-
constructor(message, code = 400) {
|
|
407
|
-
this.message = message;
|
|
408
|
-
this.code = code;
|
|
409
|
-
this.toString = () => {
|
|
410
|
-
return this.message;
|
|
411
|
-
};
|
|
412
|
-
}
|
|
413
|
-
static create(message, code = 400) {
|
|
414
|
-
return new Errors(message, code);
|
|
415
|
-
}
|
|
416
|
-
static entityNotFound(entity) {
|
|
417
|
-
return Errors.create(`Entity ${ClassHelpers.getName(entity)} not found`);
|
|
418
|
-
}
|
|
419
|
-
static custom(message, code = 400) {
|
|
420
|
-
return Errors.create(message, code);
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
Http.Errors = Errors;
|
|
424
|
-
//#endregion
|
|
425
|
-
})(Http = Models.Http || (Models.Http = {}));
|
|
426
|
-
//#endregion
|
|
427
|
-
})(Models || (Models = {}));
|
|
428
|
-
|
|
429
|
-
/* */
|
|
328
|
+
//#region imports
|
|
430
329
|
/* */
|
|
330
|
+
//#endregion
|
|
431
331
|
var ClassHelpers;
|
|
432
332
|
(function (ClassHelpers) {
|
|
433
333
|
//#region get class from name
|
|
@@ -532,7 +432,7 @@ var ClassHelpers;
|
|
|
532
432
|
//#region get all metadata for controller
|
|
533
433
|
ClassHelpers.getControllerConfig = (target) => {
|
|
534
434
|
const classMetadataOptions = Reflect.getMetadata(Symbols.metadata.options.controller, target);
|
|
535
|
-
const classMetadata = _.merge(new
|
|
435
|
+
const classMetadata = _.merge(new ControllerConfig(), classMetadataOptions);
|
|
536
436
|
// Iterate over all methods of the class
|
|
537
437
|
const methodNames = ClassHelpers.getMethodsNames(target); // Object.getOwnPropertyNames(target.prototype);
|
|
538
438
|
// console.log(`methodNames for ${ClassHelpers.getName(target)} `, methodNames)
|
|
@@ -570,6 +470,12 @@ var ClassHelpers;
|
|
|
570
470
|
'toLocaleString',
|
|
571
471
|
];
|
|
572
472
|
//#endregion
|
|
473
|
+
/**
|
|
474
|
+
* Express async handler for middleware functions.
|
|
475
|
+
*/
|
|
476
|
+
ClassHelpers.asyncHandler = fn => (req, res, next) => {
|
|
477
|
+
Promise.resolve(fn(req, res, next)).catch(next);
|
|
478
|
+
};
|
|
573
479
|
ClassHelpers.getMethodsNames = (classOrClassInstance, allMethodsNames = []) => {
|
|
574
480
|
if (!classOrClassInstance) {
|
|
575
481
|
return Utils.uniqArray(allMethodsNames);
|
|
@@ -861,6 +767,103 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
861
767
|
type: Injectable
|
|
862
768
|
}], ctorParameters: () => [] });
|
|
863
769
|
|
|
770
|
+
var Models;
|
|
771
|
+
(function (Models) {
|
|
772
|
+
//#region models / class types
|
|
773
|
+
let ClassType;
|
|
774
|
+
(function (ClassType) {
|
|
775
|
+
ClassType["ENTITY"] = "ENTITY";
|
|
776
|
+
ClassType["CONTROLLER"] = "CONTROLLER";
|
|
777
|
+
ClassType["REPOSITORY"] = "REPOSITORY";
|
|
778
|
+
ClassType["PROVIDER"] = "PROVIDER";
|
|
779
|
+
ClassType["SUBSCRIBER"] = "SUBSCRIBER";
|
|
780
|
+
ClassType["MIGRATION"] = "MIGRATION";
|
|
781
|
+
ClassType["MIDDLEWARE"] = "MIDDLEWARE";
|
|
782
|
+
})(ClassType = Models.ClassType || (Models.ClassType = {}));
|
|
783
|
+
Models.ClassTypeKey = {
|
|
784
|
+
[ClassType.ENTITY]: 'entities',
|
|
785
|
+
[ClassType.CONTROLLER]: 'controllers',
|
|
786
|
+
[ClassType.REPOSITORY]: 'repositories',
|
|
787
|
+
[ClassType.PROVIDER]: 'providers',
|
|
788
|
+
[ClassType.SUBSCRIBER]: 'subscribers',
|
|
789
|
+
[ClassType.MIGRATION]: 'migrations',
|
|
790
|
+
[ClassType.MIDDLEWARE]: 'middlewares',
|
|
791
|
+
};
|
|
792
|
+
//#endregion
|
|
793
|
+
//#region models / database connection options
|
|
794
|
+
class DatabaseConfigTypeOrm {
|
|
795
|
+
}
|
|
796
|
+
Models.DatabaseConfigTypeOrm = DatabaseConfigTypeOrm;
|
|
797
|
+
//#endregion
|
|
798
|
+
//#region models / database config
|
|
799
|
+
class DatabaseConfig extends DatabaseConfigTypeOrm {
|
|
800
|
+
static from(databasePartialConfig) {
|
|
801
|
+
return _.merge(new DatabaseConfig(), databasePartialConfig);
|
|
802
|
+
}
|
|
803
|
+
get databaseConfigTypeORM() {
|
|
804
|
+
//#region @websqlFunc
|
|
805
|
+
const result = _.cloneDeep(this);
|
|
806
|
+
if (result.recreateMode) {
|
|
807
|
+
if (result.recreateMode === 'DROP_DB+MIGRATIONS') {
|
|
808
|
+
result.synchronize = true;
|
|
809
|
+
result.dropSchema = true;
|
|
810
|
+
}
|
|
811
|
+
else if (result.recreateMode === 'PRESERVE_DATA+MIGRATIONS') {
|
|
812
|
+
result.synchronize = false;
|
|
813
|
+
result.dropSchema = false;
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
delete result.recreateMode;
|
|
817
|
+
return result;
|
|
818
|
+
//#endregion
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
Models.DatabaseConfig = DatabaseConfig;
|
|
822
|
+
//#endregion
|
|
823
|
+
//#region models / param config
|
|
824
|
+
class ParamConfig {
|
|
825
|
+
}
|
|
826
|
+
Models.ParamConfig = ParamConfig;
|
|
827
|
+
//#endregion
|
|
828
|
+
//#region models / method config
|
|
829
|
+
/**
|
|
830
|
+
* @link './decorators/http/http-methods-decorators.ts' TaonHttpDecoratorOptions
|
|
831
|
+
*/
|
|
832
|
+
class MethodConfig {
|
|
833
|
+
constructor() {
|
|
834
|
+
this.parameters = {};
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
Models.MethodConfig = MethodConfig;
|
|
838
|
+
//#endregion
|
|
839
|
+
//#region models / http
|
|
840
|
+
let Http;
|
|
841
|
+
(function (Http) {
|
|
842
|
+
Http.Rest = Models$1;
|
|
843
|
+
class Errors {
|
|
844
|
+
constructor(message, code = 400) {
|
|
845
|
+
this.message = message;
|
|
846
|
+
this.code = code;
|
|
847
|
+
this.toString = () => {
|
|
848
|
+
return this.message;
|
|
849
|
+
};
|
|
850
|
+
}
|
|
851
|
+
static create(message, code = 400) {
|
|
852
|
+
return new Errors(message, code);
|
|
853
|
+
}
|
|
854
|
+
static entityNotFound(entity) {
|
|
855
|
+
return Errors.create(`Entity ${ClassHelpers.getName(entity)} not found`);
|
|
856
|
+
}
|
|
857
|
+
static custom(message, code = 400) {
|
|
858
|
+
return Errors.create(message, code);
|
|
859
|
+
}
|
|
860
|
+
}
|
|
861
|
+
Http.Errors = Errors;
|
|
862
|
+
//#endregion
|
|
863
|
+
})(Http = Models.Http || (Models.Http = {}));
|
|
864
|
+
//#endregion
|
|
865
|
+
})(Models || (Models = {}));
|
|
866
|
+
|
|
864
867
|
//#region imports
|
|
865
868
|
class ContextDbMigrations {
|
|
866
869
|
//#endregion
|
|
@@ -3074,7 +3077,8 @@ class EndpointContext {
|
|
|
3074
3077
|
/* */
|
|
3075
3078
|
/* */
|
|
3076
3079
|
/* */
|
|
3077
|
-
|
|
3080
|
+
/* */
|
|
3081
|
+
await this.initCustomClientMiddlewares();
|
|
3078
3082
|
}
|
|
3079
3083
|
//#endregion
|
|
3080
3084
|
//#region prepare realtime
|
|
@@ -3285,7 +3289,6 @@ class EndpointContext {
|
|
|
3285
3289
|
/* */
|
|
3286
3290
|
/* */
|
|
3287
3291
|
/* */
|
|
3288
|
-
/* */
|
|
3289
3292
|
return (void 0);
|
|
3290
3293
|
}
|
|
3291
3294
|
//#endregion
|
|
@@ -3655,6 +3658,9 @@ class EndpointContext {
|
|
|
3655
3658
|
return this.config.contextName;
|
|
3656
3659
|
}
|
|
3657
3660
|
//#endregion
|
|
3661
|
+
get cwd() {
|
|
3662
|
+
return this.config.cwd || process.cwd();
|
|
3663
|
+
}
|
|
3658
3664
|
get activeContext() {
|
|
3659
3665
|
return this.config.activeContext || null;
|
|
3660
3666
|
}
|
|
@@ -3858,6 +3864,7 @@ class EndpointContext {
|
|
|
3858
3864
|
const configs = ClassHelpers.getControllerConfigs(controllerClassFn);
|
|
3859
3865
|
// console.log(`Class config for ${ClassHelpers.getName(controllerClassFn)}`, configs)
|
|
3860
3866
|
const classConfig = configs[0];
|
|
3867
|
+
//#region update class calculate path
|
|
3861
3868
|
const parentscalculatedPath = _.slice(configs, 1)
|
|
3862
3869
|
.reverse()
|
|
3863
3870
|
.map(bc => {
|
|
@@ -3881,6 +3888,7 @@ class EndpointContext {
|
|
|
3881
3888
|
}, [])
|
|
3882
3889
|
.join('/');
|
|
3883
3890
|
}
|
|
3891
|
+
//#endregion
|
|
3884
3892
|
// console.log('calculatedPath', classConfig.calculatedPath);
|
|
3885
3893
|
_.slice(configs, 1).forEach(bc => {
|
|
3886
3894
|
const alreadyIs = classConfig.methods;
|
|
@@ -3989,44 +3997,29 @@ class EndpointContext {
|
|
|
3989
3997
|
}
|
|
3990
3998
|
//#endregion
|
|
3991
3999
|
//#region methods & getters / init middlewares
|
|
3992
|
-
async
|
|
3993
|
-
const middlewares = this.getClassesInstancesArrBy(Models.ClassType.MIDDLEWARE)
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
|
|
3997
|
-
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
});
|
|
4014
|
-
})(middlewareInstance, this.contextName, apiPrefix, this.uriPathnameOrNothingIfRoot);
|
|
4015
|
-
}
|
|
4016
|
-
}
|
|
4000
|
+
async initCustomClientMiddlewares() {
|
|
4001
|
+
const middlewares = this.getClassesInstancesArrBy(Models.ClassType.MIDDLEWARE)
|
|
4002
|
+
.map(f => f)
|
|
4003
|
+
.filter(f => _.isFunction(f.interceptClient));
|
|
4004
|
+
middlewares.forEach(instance => {
|
|
4005
|
+
const contextName = this.contextName;
|
|
4006
|
+
const interceptorName = `${contextName}-${ClassHelpers.getName(instance)}`;
|
|
4007
|
+
Resource.request.interceptors.set(interceptorName, {
|
|
4008
|
+
intercept: ({ req, next }) => {
|
|
4009
|
+
const url = new URL(req.url);
|
|
4010
|
+
if (url.pathname.startsWith(`${this.uriPathnameOrNothingIfRoot}/${apiPrefix}/${contextName}/`)) {
|
|
4011
|
+
// console.log('intercepting', url.pathname, req);
|
|
4012
|
+
return instance.interceptClient({
|
|
4013
|
+
req,
|
|
4014
|
+
next,
|
|
4015
|
+
});
|
|
4016
|
+
}
|
|
4017
|
+
return next.handle(req);
|
|
4018
|
+
},
|
|
4019
|
+
});
|
|
4020
|
+
});
|
|
4017
4021
|
}
|
|
4018
|
-
async
|
|
4019
|
-
/* */
|
|
4020
|
-
/* */
|
|
4021
|
-
/* */
|
|
4022
|
-
/* */
|
|
4023
|
-
/* */
|
|
4024
|
-
/* */
|
|
4025
|
-
/* */
|
|
4026
|
-
/* */
|
|
4027
|
-
/* */
|
|
4028
|
-
/* */
|
|
4029
|
-
/* */
|
|
4022
|
+
async initCustomBackendMiddlewares() {
|
|
4030
4023
|
/* */
|
|
4031
4024
|
/* */
|
|
4032
4025
|
/* */
|
|
@@ -4061,6 +4054,8 @@ class EndpointContext {
|
|
|
4061
4054
|
/* */
|
|
4062
4055
|
/* */
|
|
4063
4056
|
/* */
|
|
4057
|
+
}
|
|
4058
|
+
async initBackendMiddlewares() {
|
|
4064
4059
|
/* */
|
|
4065
4060
|
/* */
|
|
4066
4061
|
/* */
|
|
@@ -4170,16 +4165,31 @@ class EndpointContext {
|
|
|
4170
4165
|
//#region methods & getters / init methods node
|
|
4171
4166
|
initServer(
|
|
4172
4167
|
//#region parameters
|
|
4173
|
-
|
|
4168
|
+
httpMethodType, methodConfig, classConfig, expressPath, target) {
|
|
4174
4169
|
//#region resolve variables
|
|
4175
|
-
|
|
4176
|
-
|
|
4177
|
-
|
|
4178
|
-
|
|
4179
|
-
|
|
4180
|
-
|
|
4181
|
-
|
|
4182
|
-
|
|
4170
|
+
const middlewareHandlers = (Array.isArray(methodConfig.middlewares) &&
|
|
4171
|
+
methodConfig.middlewares?.length > 0
|
|
4172
|
+
? methodConfig.middlewares
|
|
4173
|
+
: [])
|
|
4174
|
+
.map(middlewareClassFun => {
|
|
4175
|
+
const middlewareInstance = this.getInstanceBy(middlewareClassFun);
|
|
4176
|
+
if (middlewareInstance &&
|
|
4177
|
+
_.isFunction(middlewareInstance.interceptServerMethod)) {
|
|
4178
|
+
const middlewareFn = ClassHelpers.asyncHandler(async (req, res, next) => {
|
|
4179
|
+
await middlewareInstance.interceptServerMethod({
|
|
4180
|
+
req,
|
|
4181
|
+
res,
|
|
4182
|
+
next,
|
|
4183
|
+
}, {
|
|
4184
|
+
methodName: methodConfig.methodName,
|
|
4185
|
+
expressPath,
|
|
4186
|
+
httpRequestType: methodConfig.type,
|
|
4187
|
+
});
|
|
4188
|
+
});
|
|
4189
|
+
return middlewareFn;
|
|
4190
|
+
}
|
|
4191
|
+
})
|
|
4192
|
+
.filter(f => !!f);
|
|
4183
4193
|
// const url = this.uri;
|
|
4184
4194
|
//#region get result
|
|
4185
4195
|
const getResult = async (resolvedParams, req, res) => {
|
|
@@ -4189,7 +4199,7 @@ class EndpointContext {
|
|
|
4189
4199
|
*/
|
|
4190
4200
|
this.getInstanceBy(target),
|
|
4191
4201
|
/**
|
|
4192
|
-
* Params for
|
|
4202
|
+
* Params for method @GET, @PUT etc.
|
|
4193
4203
|
*/
|
|
4194
4204
|
resolvedParams);
|
|
4195
4205
|
let result = await getResponseValue(response, { req, res });
|
|
@@ -4228,8 +4238,9 @@ class EndpointContext {
|
|
|
4228
4238
|
//#region apply dummy websql express routers
|
|
4229
4239
|
//#region @websql
|
|
4230
4240
|
if (Helpers.isWebSQL) {
|
|
4231
|
-
if (!this.expressApp[
|
|
4232
|
-
this.expressApp[
|
|
4241
|
+
if (!this.expressApp[httpMethodType.toLowerCase()]) {
|
|
4242
|
+
this.expressApp[httpMethodType.toLowerCase()] = () => { };
|
|
4243
|
+
// TODO add middlewares for WEBSQL and ELECTRON mode
|
|
4233
4244
|
}
|
|
4234
4245
|
}
|
|
4235
4246
|
//#endregion
|
|
@@ -4448,6 +4459,7 @@ class EndpointContext {
|
|
|
4448
4459
|
/* */
|
|
4449
4460
|
/* */
|
|
4450
4461
|
/* */
|
|
4462
|
+
/* */
|
|
4451
4463
|
}
|
|
4452
4464
|
return {
|
|
4453
4465
|
expressPath: expressPath,
|
|
@@ -4461,10 +4473,31 @@ class EndpointContext {
|
|
|
4461
4473
|
*/
|
|
4462
4474
|
async initClient(
|
|
4463
4475
|
//#region parameters
|
|
4464
|
-
target,
|
|
4476
|
+
target, httpRequestType, methodConfig, // Models.Http.Rest.MethodConfig,
|
|
4477
|
+
expressPath) {
|
|
4465
4478
|
const ctx = this;
|
|
4479
|
+
//#region init middlewares
|
|
4480
|
+
const middlewares = methodConfig.middlewares
|
|
4481
|
+
.map(f => this.getInstanceBy(f))
|
|
4482
|
+
.filter(f => _.isFunction(f.interceptClientMethod));
|
|
4483
|
+
middlewares.forEach(instance => {
|
|
4484
|
+
Resource.request.methodsInterceptors.set(`${methodConfig.type?.toUpperCase()}-${expressPath}`, {
|
|
4485
|
+
intercept: ({ req, next }) => {
|
|
4486
|
+
return instance.interceptClientMethod({
|
|
4487
|
+
req,
|
|
4488
|
+
next,
|
|
4489
|
+
}, {
|
|
4490
|
+
methodName: methodConfig.methodName,
|
|
4491
|
+
expressPath,
|
|
4492
|
+
httpRequestType: httpRequestType,
|
|
4493
|
+
});
|
|
4494
|
+
},
|
|
4495
|
+
});
|
|
4496
|
+
});
|
|
4497
|
+
//#endregion
|
|
4466
4498
|
// : { received: any; /* Rest<any, any> */ }
|
|
4467
|
-
this.logHttp &&
|
|
4499
|
+
this.logHttp &&
|
|
4500
|
+
console.log(`${httpRequestType?.toUpperCase()} ${expressPath} `);
|
|
4468
4501
|
// console.log('INITING', methodConfig); // TODO inject in static
|
|
4469
4502
|
//#region resolve storage
|
|
4470
4503
|
// TODO not a good idea
|
|
@@ -4506,6 +4539,9 @@ class EndpointContext {
|
|
|
4506
4539
|
received['observable'] = from(received);
|
|
4507
4540
|
return {
|
|
4508
4541
|
received,
|
|
4542
|
+
request(axiosConfig) {
|
|
4543
|
+
return received;
|
|
4544
|
+
},
|
|
4509
4545
|
};
|
|
4510
4546
|
};
|
|
4511
4547
|
return;
|
|
@@ -4626,11 +4662,16 @@ class EndpointContext {
|
|
|
4626
4662
|
if (Helpers.isWebSQL) {
|
|
4627
4663
|
return {
|
|
4628
4664
|
received,
|
|
4665
|
+
request(axiosConfig) {
|
|
4666
|
+
// console.log('request', axiosConfgi);
|
|
4667
|
+
return received;
|
|
4668
|
+
},
|
|
4629
4669
|
};
|
|
4630
4670
|
}
|
|
4631
4671
|
};
|
|
4632
4672
|
if (Helpers.isWebSQL) {
|
|
4633
|
-
|
|
4673
|
+
// @ts-ignore
|
|
4674
|
+
return undefined;
|
|
4634
4675
|
}
|
|
4635
4676
|
//#endregion
|
|
4636
4677
|
//#endregion
|
|
@@ -4673,8 +4714,7 @@ class EndpointContext {
|
|
|
4673
4714
|
else {
|
|
4674
4715
|
rest = endpoints[ctx.uriOrigin][expressPath];
|
|
4675
4716
|
}
|
|
4676
|
-
const method =
|
|
4677
|
-
const isWithBody = method === 'put' || method === 'post';
|
|
4717
|
+
const method = httpRequestType.toLowerCase();
|
|
4678
4718
|
const pathPrams = {};
|
|
4679
4719
|
let queryParams = {};
|
|
4680
4720
|
let bodyObject = {};
|
|
@@ -4772,9 +4812,13 @@ instead
|
|
|
4772
4812
|
}
|
|
4773
4813
|
//#endregion
|
|
4774
4814
|
const httpResultObj = {
|
|
4775
|
-
received
|
|
4776
|
-
|
|
4777
|
-
|
|
4815
|
+
get received() {
|
|
4816
|
+
return rest.model(pathPrams)[method](bodyObject, [queryParams]);
|
|
4817
|
+
},
|
|
4818
|
+
request(axiosConfig) {
|
|
4819
|
+
return rest
|
|
4820
|
+
.model(pathPrams)[method](bodyObject, [queryParams], axiosConfig);
|
|
4821
|
+
},
|
|
4778
4822
|
};
|
|
4779
4823
|
return httpResultObj;
|
|
4780
4824
|
};
|
|
@@ -5002,16 +5046,16 @@ const createContext = (configFn) => {
|
|
|
5002
5046
|
};
|
|
5003
5047
|
|
|
5004
5048
|
/**
|
|
5005
|
-
*
|
|
5049
|
+
* Provider decorator
|
|
5006
5050
|
*/
|
|
5007
|
-
function
|
|
5051
|
+
function TaonMiddleware(options) {
|
|
5008
5052
|
return function (constructor) {
|
|
5009
|
-
Reflect.defineMetadata(Symbols.metadata.options.
|
|
5053
|
+
Reflect.defineMetadata(Symbols.metadata.options.provider, options, constructor);
|
|
5010
5054
|
Reflect.defineMetadata(Symbols.metadata.className, options?.className || constructor.name, constructor);
|
|
5011
|
-
ClassHelpers.setName(constructor, options?.className);
|
|
5055
|
+
ClassHelpers.setName(constructor, options?.className || constructor.name);
|
|
5012
5056
|
};
|
|
5013
5057
|
}
|
|
5014
|
-
class
|
|
5058
|
+
class TaonMiddlewareOptions extends DecoratorAbstractOpt {
|
|
5015
5059
|
}
|
|
5016
5060
|
|
|
5017
5061
|
//#endregion
|
|
@@ -5198,6 +5242,95 @@ class BaseInjector {
|
|
|
5198
5242
|
}
|
|
5199
5243
|
}
|
|
5200
5244
|
|
|
5245
|
+
/**
|
|
5246
|
+
* TODO
|
|
5247
|
+
* - global provider available in all contexts
|
|
5248
|
+
* - provider available in own context
|
|
5249
|
+
*/
|
|
5250
|
+
class BaseMiddleware extends BaseInjector {
|
|
5251
|
+
}
|
|
5252
|
+
|
|
5253
|
+
//#endregion
|
|
5254
|
+
/**
|
|
5255
|
+
* Configurable file upload middleware (multer based)
|
|
5256
|
+
*/
|
|
5257
|
+
let BaseFileUploadMiddleware = class BaseFileUploadMiddleware extends BaseMiddleware {
|
|
5258
|
+
async interceptServerMethod({ req, res, next }, { methodName, expressPath }) {
|
|
5259
|
+
return this.middleware()(req, res, next);
|
|
5260
|
+
}
|
|
5261
|
+
//#region upload Dir
|
|
5262
|
+
uploadDir() {
|
|
5263
|
+
return crossPlatformPath([this.ctx.cwd, 'uploaded-files']);
|
|
5264
|
+
}
|
|
5265
|
+
//#endregion
|
|
5266
|
+
//#region storage
|
|
5267
|
+
storage() {
|
|
5268
|
+
/* */
|
|
5269
|
+
/* */
|
|
5270
|
+
/* */
|
|
5271
|
+
/* */
|
|
5272
|
+
/* */
|
|
5273
|
+
/* */
|
|
5274
|
+
/* */
|
|
5275
|
+
/* */
|
|
5276
|
+
/* */
|
|
5277
|
+
/* */
|
|
5278
|
+
/* */
|
|
5279
|
+
/* */
|
|
5280
|
+
/* */
|
|
5281
|
+
/* */
|
|
5282
|
+
/* */
|
|
5283
|
+
/* */
|
|
5284
|
+
/* */
|
|
5285
|
+
/* */
|
|
5286
|
+
/* */
|
|
5287
|
+
return (void 0);
|
|
5288
|
+
}
|
|
5289
|
+
//#endregion
|
|
5290
|
+
//#region upload
|
|
5291
|
+
upload() {
|
|
5292
|
+
/* */
|
|
5293
|
+
/* */
|
|
5294
|
+
/* */
|
|
5295
|
+
/* */
|
|
5296
|
+
/* */
|
|
5297
|
+
/* */
|
|
5298
|
+
/* */
|
|
5299
|
+
/* */
|
|
5300
|
+
/* */
|
|
5301
|
+
/* */
|
|
5302
|
+
/* */
|
|
5303
|
+
/* */
|
|
5304
|
+
/* */
|
|
5305
|
+
return (void 0);
|
|
5306
|
+
}
|
|
5307
|
+
//#endregion
|
|
5308
|
+
//#region middleware
|
|
5309
|
+
middleware() {
|
|
5310
|
+
/* */
|
|
5311
|
+
/* */
|
|
5312
|
+
return (void 0);
|
|
5313
|
+
}
|
|
5314
|
+
};
|
|
5315
|
+
BaseFileUploadMiddleware = __decorate([
|
|
5316
|
+
TaonMiddleware({
|
|
5317
|
+
className: 'BaseFileUploadMiddleware',
|
|
5318
|
+
})
|
|
5319
|
+
], BaseFileUploadMiddleware);
|
|
5320
|
+
|
|
5321
|
+
/**
|
|
5322
|
+
* Repository decorator
|
|
5323
|
+
*/
|
|
5324
|
+
function TaonRepository(options) {
|
|
5325
|
+
return function (constructor) {
|
|
5326
|
+
Reflect.defineMetadata(Symbols.metadata.options.repository, options, constructor);
|
|
5327
|
+
Reflect.defineMetadata(Symbols.metadata.className, options?.className || constructor.name, constructor);
|
|
5328
|
+
ClassHelpers.setName(constructor, options?.className);
|
|
5329
|
+
};
|
|
5330
|
+
}
|
|
5331
|
+
class TaonRepositoryOptions extends DecoratorAbstractOpt {
|
|
5332
|
+
}
|
|
5333
|
+
|
|
5201
5334
|
//#endregion
|
|
5202
5335
|
let BaseCustomRepository = class BaseCustomRepository extends BaseInjector {
|
|
5203
5336
|
};
|
|
@@ -5792,6 +5925,9 @@ BaseRepository = __decorate([
|
|
|
5792
5925
|
const BaseContext = createContext(() => ({
|
|
5793
5926
|
contextName: 'BaseContext',
|
|
5794
5927
|
abstract: true,
|
|
5928
|
+
middlewares: {
|
|
5929
|
+
BaseFileUploadMiddleware,
|
|
5930
|
+
},
|
|
5795
5931
|
repositories: {
|
|
5796
5932
|
// @ts-ignore
|
|
5797
5933
|
BaseRepository,
|
|
@@ -5813,14 +5949,6 @@ function TaonController(options) {
|
|
|
5813
5949
|
Reflect.defineMetadata(Symbols.metadata.className, options?.className || constructor.name, constructor);
|
|
5814
5950
|
};
|
|
5815
5951
|
}
|
|
5816
|
-
class TaonControllerOptions extends Models.DecoratorAbstractOpt {
|
|
5817
|
-
}
|
|
5818
|
-
|
|
5819
|
-
let BaseController = class BaseController extends BaseInjector {
|
|
5820
|
-
};
|
|
5821
|
-
BaseController = __decorate([
|
|
5822
|
-
TaonController({ className: 'BaseController' })
|
|
5823
|
-
], BaseController);
|
|
5824
5952
|
|
|
5825
5953
|
const metaReq = (method, path, target, propertyKey, descriptor, pathOrOptions, pathIsGlobal) => {
|
|
5826
5954
|
let options;
|
|
@@ -5833,13 +5961,14 @@ const metaReq = (method, path, target, propertyKey, descriptor, pathOrOptions, p
|
|
|
5833
5961
|
else {
|
|
5834
5962
|
options = { pathOrOptions, pathIsGlobal };
|
|
5835
5963
|
}
|
|
5836
|
-
const { overrideContentType,
|
|
5964
|
+
const { overrideContentType, overrideResponseType, middlewares } = options;
|
|
5837
5965
|
let methodConfig = Reflect.getMetadata(Symbols.metadata.options.controllerMethod, target.constructor, propertyKey);
|
|
5838
5966
|
if (!methodConfig) {
|
|
5839
5967
|
methodConfig = new Models.MethodConfig();
|
|
5840
5968
|
Reflect.defineMetadata(Symbols.metadata.options.controllerMethod, methodConfig, target.constructor, propertyKey);
|
|
5841
5969
|
}
|
|
5842
5970
|
methodConfig.methodName = propertyKey;
|
|
5971
|
+
methodConfig.middlewares = middlewares || [];
|
|
5843
5972
|
methodConfig.type = method;
|
|
5844
5973
|
if (!path) {
|
|
5845
5974
|
let paramsPathConcatedPath = '';
|
|
@@ -5861,7 +5990,7 @@ const metaReq = (method, path, target, propertyKey, descriptor, pathOrOptions, p
|
|
|
5861
5990
|
methodConfig.descriptor = descriptor;
|
|
5862
5991
|
methodConfig.global = pathIsGlobal;
|
|
5863
5992
|
methodConfig.contentType = overrideContentType;
|
|
5864
|
-
methodConfig.responseType =
|
|
5993
|
+
methodConfig.responseType = overrideResponseType;
|
|
5865
5994
|
Reflect.defineMetadata(Symbols.metadata.options.controllerMethod, methodConfig, target.constructor, propertyKey);
|
|
5866
5995
|
// console.log('methods updated', methodConfig);
|
|
5867
5996
|
};
|
|
@@ -5940,6 +6069,68 @@ function Body(name) {
|
|
|
5940
6069
|
};
|
|
5941
6070
|
}
|
|
5942
6071
|
|
|
6072
|
+
/* */
|
|
6073
|
+
/* */
|
|
6074
|
+
let BaseController = class BaseController extends BaseInjector {
|
|
6075
|
+
//#region upload form data to server
|
|
6076
|
+
uploadFormDataToServer(formData) {
|
|
6077
|
+
/* */
|
|
6078
|
+
/* */
|
|
6079
|
+
/* */
|
|
6080
|
+
/* */
|
|
6081
|
+
/* */
|
|
6082
|
+
/* */
|
|
6083
|
+
/* */
|
|
6084
|
+
/* */
|
|
6085
|
+
/* */
|
|
6086
|
+
/* */
|
|
6087
|
+
/* */
|
|
6088
|
+
/* */
|
|
6089
|
+
/* */
|
|
6090
|
+
/* */
|
|
6091
|
+
/* */
|
|
6092
|
+
/* */
|
|
6093
|
+
/* */
|
|
6094
|
+
/* */
|
|
6095
|
+
/* */
|
|
6096
|
+
/* */
|
|
6097
|
+
/* */
|
|
6098
|
+
return (void 0);
|
|
6099
|
+
}
|
|
6100
|
+
//#endregion
|
|
6101
|
+
//#region upload local file to server
|
|
6102
|
+
async uploadLocalFileToServer(absFilePath) {
|
|
6103
|
+
/* */
|
|
6104
|
+
/* */
|
|
6105
|
+
/* */
|
|
6106
|
+
/* */
|
|
6107
|
+
/* */
|
|
6108
|
+
/* */
|
|
6109
|
+
/* */
|
|
6110
|
+
/* */
|
|
6111
|
+
/* */
|
|
6112
|
+
/* */
|
|
6113
|
+
/* */
|
|
6114
|
+
/* */
|
|
6115
|
+
return (void 0);
|
|
6116
|
+
}
|
|
6117
|
+
};
|
|
6118
|
+
__decorate([
|
|
6119
|
+
POST({
|
|
6120
|
+
overrideContentType: 'multipart/form-data',
|
|
6121
|
+
middlewares: [BaseFileUploadMiddleware],
|
|
6122
|
+
}),
|
|
6123
|
+
__param(0, Body()),
|
|
6124
|
+
__metadata("design:type", Function),
|
|
6125
|
+
__metadata("design:paramtypes", [FormData]),
|
|
6126
|
+
__metadata("design:returntype", Object)
|
|
6127
|
+
], BaseController.prototype, "uploadFormDataToServer", null);
|
|
6128
|
+
BaseController = __decorate([
|
|
6129
|
+
TaonController({
|
|
6130
|
+
className: 'BaseController',
|
|
6131
|
+
})
|
|
6132
|
+
], BaseController);
|
|
6133
|
+
|
|
5943
6134
|
//#endregion
|
|
5944
6135
|
/**
|
|
5945
6136
|
* Please override property entityClassFn with entity class.
|
|
@@ -6216,14 +6407,6 @@ BaseCrudController = __decorate([
|
|
|
6216
6407
|
TaonController({ className: 'BaseCrudController' })
|
|
6217
6408
|
], BaseCrudController);
|
|
6218
6409
|
|
|
6219
|
-
/**
|
|
6220
|
-
* TODO
|
|
6221
|
-
* - global provider available in all contexts
|
|
6222
|
-
* - provider available in own context
|
|
6223
|
-
*/
|
|
6224
|
-
class BaseMiddleware extends BaseInjector {
|
|
6225
|
-
}
|
|
6226
|
-
|
|
6227
6410
|
class BaseMigration extends BaseInjector {
|
|
6228
6411
|
/**
|
|
6229
6412
|
* by default is READY to run
|
|
@@ -6260,7 +6443,7 @@ function TaonSubscriber(options) {
|
|
|
6260
6443
|
ClassHelpers.setName(constructor, options?.className);
|
|
6261
6444
|
};
|
|
6262
6445
|
}
|
|
6263
|
-
class TaonSubscriberOptions extends
|
|
6446
|
+
class TaonSubscriberOptions extends DecoratorAbstractOpt {
|
|
6264
6447
|
}
|
|
6265
6448
|
|
|
6266
6449
|
let BaseSubscriberForEntity = class BaseSubscriberForEntity extends BaseInjector {
|
|
@@ -6423,7 +6606,6 @@ var Base;
|
|
|
6423
6606
|
Base.Context = BaseContext;
|
|
6424
6607
|
})(Base || (Base = {}));
|
|
6425
6608
|
|
|
6426
|
-
//#endregion
|
|
6427
6609
|
/**
|
|
6428
6610
|
* Entity decorator
|
|
6429
6611
|
*/
|
|
@@ -6443,20 +6625,7 @@ function TaonEntity(options) {
|
|
|
6443
6625
|
CLASS.setName(constructor, options?.className); // TODO QUICK_FIX for ng2-rest
|
|
6444
6626
|
};
|
|
6445
6627
|
}
|
|
6446
|
-
class TaonEntityOptions extends
|
|
6447
|
-
}
|
|
6448
|
-
|
|
6449
|
-
/**
|
|
6450
|
-
* Provider decorator
|
|
6451
|
-
*/
|
|
6452
|
-
function TaonMiddleware(options) {
|
|
6453
|
-
return function (constructor) {
|
|
6454
|
-
Reflect.defineMetadata(Symbols.metadata.options.provider, options, constructor);
|
|
6455
|
-
Reflect.defineMetadata(Symbols.metadata.className, options?.className || constructor.name, constructor);
|
|
6456
|
-
ClassHelpers.setName(constructor, options?.className || constructor.name);
|
|
6457
|
-
};
|
|
6458
|
-
}
|
|
6459
|
-
class TaonMiddlewareOptions extends Models.DecoratorAbstractOpt {
|
|
6628
|
+
class TaonEntityOptions extends DecoratorAbstractOpt {
|
|
6460
6629
|
}
|
|
6461
6630
|
|
|
6462
6631
|
/**
|
|
@@ -6469,7 +6638,7 @@ function TaonMigration(options) {
|
|
|
6469
6638
|
ClassHelpers.setName(constructor, options?.className);
|
|
6470
6639
|
};
|
|
6471
6640
|
}
|
|
6472
|
-
class TaonMigrationOptions extends
|
|
6641
|
+
class TaonMigrationOptions extends DecoratorAbstractOpt {
|
|
6473
6642
|
}
|
|
6474
6643
|
|
|
6475
6644
|
/**
|
|
@@ -6482,7 +6651,7 @@ function TaonProvider(options) {
|
|
|
6482
6651
|
ClassHelpers.setName(constructor, options?.className || constructor.name);
|
|
6483
6652
|
};
|
|
6484
6653
|
}
|
|
6485
|
-
class TaonProviderOptions extends
|
|
6654
|
+
class TaonProviderOptions extends DecoratorAbstractOpt {
|
|
6486
6655
|
}
|
|
6487
6656
|
|
|
6488
6657
|
var Http;
|