@futdevpro/nts-dynamo 1.3.72 → 1.3.74
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/lib/_constants/dynamobe-global.settings.d.ts +0 -2
- package/lib/_constants/dynamobe-global.settings.d.ts.map +1 -1
- package/lib/_constants/dynamobe-global.settings.js +10 -10
- package/lib/_constants/dynamobe-global.settings.js.map +1 -1
- package/lib/_models/dynamobe-global-settings.d.ts +2 -1
- package/lib/_models/dynamobe-global-settings.d.ts.map +1 -1
- package/lib/_modules/test/test-routing-module.d.ts +2 -2
- package/lib/_modules/test/test-routing-module.d.ts.map +1 -1
- package/lib/_modules/test/test-routing-module.js +4 -4
- package/lib/_modules/test/test-routing-module.js.map +1 -1
- package/lib/_modules/usage/usage-routing-module.d.ts +2 -2
- package/lib/_modules/usage/usage-routing-module.d.ts.map +1 -1
- package/lib/_modules/usage/usage-routing-module.js +5 -5
- package/lib/_modules/usage/usage-routing-module.js.map +1 -1
- package/lib/_services/dynamobe-app.d.ts +2 -2
- package/lib/_services/dynamobe-app.d.ts.map +1 -1
- package/lib/_services/dynamobe-app.js +7 -7
- package/lib/_services/dynamobe-app.js.map +1 -1
- package/lib/_services/dynamobe-global.service.d.ts +0 -2
- package/lib/_services/dynamobe-global.service.d.ts.map +1 -1
- package/lib/_services/dynamobe-global.service.js +33 -41
- package/lib/_services/dynamobe-global.service.js.map +1 -1
- package/lib/_services/dynamobe-routing-module.service.d.ts +8 -7
- package/lib/_services/dynamobe-routing-module.service.d.ts.map +1 -1
- package/lib/_services/dynamobe-routing-module.service.js +9 -4
- package/lib/_services/dynamobe-routing-module.service.js.map +1 -1
- package/lib/dynamobe-global.settings.d.ts.map +1 -1
- package/lib/dynamobe-global.settings.js +1 -0
- package/lib/dynamobe-global.settings.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +27 -30
- package/package.json +1 -1
- package/src/_constants/dynamobe-global.settings.ts +2 -1
- package/src/_models/dynamobe-global-settings.ts +2 -1
- package/src/_modules/test/test-routing-module.ts +6 -4
- package/src/_modules/usage/usage-routing-module.ts +6 -4
- package/src/_services/dynamobe-app.ts +18 -18
- package/src/_services/dynamobe-global.service.ts +26 -16
- package/src/_services/dynamobe-routing-module.service.ts +21 -8
- package/src/dynamobe-global.settings.ts +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamobe-global.settings.d.ts","sourceRoot":"","sources":["../../src/_constants/dynamobe-global.settings.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dynamobe-global.settings.d.ts","sourceRoot":"","sources":["../../src/_constants/dynamobe-global.settings.ts"],"names":[],"mappings":""}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
logResponseContent: false,
|
|
1
|
+
/* import { DynamoBERouteSecurity } from '../_enums/dynamobe-route-security.enum';
|
|
2
|
+
import { DynamoBEGlobalSettings } from '../_models/dynamobe-global-settings';
|
|
3
|
+
|
|
4
|
+
export const dynamoBEDefaultGlobalSettings: DynamoBEGlobalSettings = {
|
|
5
|
+
defaultRouteSecurity: DynamoBERouteSecurity.open,
|
|
6
|
+
logSetup: false,
|
|
7
|
+
logRequests: true,
|
|
8
|
+
logRequestsContent: true,
|
|
9
|
+
logResponseContent: false,
|
|
11
10
|
};
|
|
11
|
+
*/
|
|
12
12
|
//# sourceMappingURL=dynamobe-global.settings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamobe-global.settings.js","sourceRoot":"","sources":["../../src/_constants/dynamobe-global.settings.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dynamobe-global.settings.js","sourceRoot":"","sources":["../../src/_constants/dynamobe-global.settings.ts"],"names":[],"mappings":"AACA;;;;;;;;;;GAUG"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { DynamoBERouteSecurity } from '../_enums/dynamobe-route-security.enum';
|
|
2
2
|
export interface DynamoBEGlobalSettings {
|
|
3
|
-
|
|
3
|
+
baseUrl: string;
|
|
4
|
+
defaultRouteSecurity: DynamoBERouteSecurity;
|
|
4
5
|
logSetup?: boolean;
|
|
5
6
|
logRequests?: boolean;
|
|
6
7
|
logRequestsContent?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamobe-global-settings.d.ts","sourceRoot":"","sources":["../../src/_models/dynamobe-global-settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAE/E,MAAM,WAAW,sBAAsB;IACrC,
|
|
1
|
+
{"version":3,"file":"dynamobe-global-settings.d.ts","sourceRoot":"","sources":["../../src/_models/dynamobe-global-settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAE/E,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,oBAAoB,EAAE,qBAAqB,CAAC;IAC5C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const testRoutingModule:
|
|
1
|
+
import { DynamoBERoutingModuleSettings } from '../../_services/dynamobe-routing-module.service';
|
|
2
|
+
export declare const testRoutingModule: DynamoBERoutingModuleSettings;
|
|
3
3
|
//# sourceMappingURL=test-routing-module.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-routing-module.d.ts","sourceRoot":"","sources":["../../../src/_modules/test/test-routing-module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"test-routing-module.d.ts","sourceRoot":"","sources":["../../../src/_modules/test/test-routing-module.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,6BAA6B,EAAE,MAAM,iDAAiD,CAAC;AAGhG,eAAO,MAAM,iBAAiB,EAAE,6BAG/B,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.testRoutingModule = void 0;
|
|
4
|
-
const
|
|
4
|
+
const test_module_settings_1 = require("../../_constants/fullstack/module-settings/test-module-settings");
|
|
5
5
|
const test_controller_1 = require("./test-controller");
|
|
6
|
-
exports.testRoutingModule =
|
|
7
|
-
route:
|
|
6
|
+
exports.testRoutingModule = {
|
|
7
|
+
route: test_module_settings_1.testModuleSettings.mainRoute,
|
|
8
8
|
controllers: [test_controller_1.TestController.getInstance()]
|
|
9
|
-
}
|
|
9
|
+
};
|
|
10
10
|
//# sourceMappingURL=test-routing-module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-routing-module.js","sourceRoot":"","sources":["../../../src/_modules/test/test-routing-module.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"test-routing-module.js","sourceRoot":"","sources":["../../../src/_modules/test/test-routing-module.ts"],"names":[],"mappings":";;;AACA,0GAAqG;AAErG,uDAAmD;AAEtC,QAAA,iBAAiB,GAAkC;IAC9D,KAAK,EAAE,yCAAkB,CAAC,SAAS;IACnC,WAAW,EAAE,CAAE,gCAAc,CAAC,WAAW,EAAE,CAAE;CAC9C,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const
|
|
1
|
+
import { DynamoBERoutingModuleSettings } from '../../_services/dynamobe-routing-module.service';
|
|
2
|
+
export declare const usageRoutingModuleSettings: DynamoBERoutingModuleSettings;
|
|
3
3
|
//# sourceMappingURL=usage-routing-module.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usage-routing-module.d.ts","sourceRoot":"","sources":["../../../src/_modules/usage/usage-routing-module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"usage-routing-module.d.ts","sourceRoot":"","sources":["../../../src/_modules/usage/usage-routing-module.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,6BAA6B,EAAE,MAAM,iDAAiD,CAAC;AAGhG,eAAO,MAAM,0BAA0B,EAAE,6BAGxC,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
const
|
|
3
|
+
exports.usageRoutingModuleSettings = void 0;
|
|
4
|
+
const usage_module_settings_1 = require("../../_constants/fullstack/module-settings/usage-module-settings");
|
|
5
5
|
const usage_controller_1 = require("./usage-controller");
|
|
6
|
-
exports.
|
|
7
|
-
route:
|
|
6
|
+
exports.usageRoutingModuleSettings = {
|
|
7
|
+
route: usage_module_settings_1.usageModuleSettings.mainRoute,
|
|
8
8
|
controllers: [usage_controller_1.UsageController.getInstance()]
|
|
9
|
-
}
|
|
9
|
+
};
|
|
10
10
|
//# sourceMappingURL=usage-routing-module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usage-routing-module.js","sourceRoot":"","sources":["../../../src/_modules/usage/usage-routing-module.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"usage-routing-module.js","sourceRoot":"","sources":["../../../src/_modules/usage/usage-routing-module.ts"],"names":[],"mappings":";;;AACA,4GAAuG;AAEvG,yDAAqD;AAExC,QAAA,0BAA0B,GAAkC;IACvE,KAAK,EAAE,2CAAmB,CAAC,SAAS;IACpC,WAAW,EAAE,CAAE,kCAAe,CAAC,WAAW,EAAE,CAAE;CAC/C,CAAC"}
|
|
@@ -4,7 +4,7 @@ import Mongoose = require("mongoose");
|
|
|
4
4
|
import * as FileSystem from 'fs';
|
|
5
5
|
import { DynamoBESingletonService } from './dynamobe-singleton.service';
|
|
6
6
|
import { DynamoBERouteSecurity } from '../_enums/dynamobe-route-security.enum';
|
|
7
|
-
import {
|
|
7
|
+
import { DynamoBERoutingModule } from './dynamobe-routing-module.service';
|
|
8
8
|
/**
|
|
9
9
|
* This will be the main service of our server project,
|
|
10
10
|
* follow the types and type instructions while setting up your project
|
|
@@ -25,7 +25,7 @@ export declare abstract class DynamoBEApp extends DynamoBESingletonService {
|
|
|
25
25
|
private secureExpress;
|
|
26
26
|
private httpsServer;
|
|
27
27
|
private openExpress;
|
|
28
|
-
protected routingModules:
|
|
28
|
+
protected routingModules: DynamoBERoutingModule[];
|
|
29
29
|
protected log: boolean;
|
|
30
30
|
constructor();
|
|
31
31
|
private startDB;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamobe-app.d.ts","sourceRoot":"","sources":["../../src/_services/dynamobe-app.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAGnE,OAAO,QAAQ,GAAG,QAAQ,UAAU,CAAC,CAAC;AAGtC,OAAO,KAAK,UAAU,MAAM,IAAI,CAAC;AAIjC,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"dynamobe-app.d.ts","sourceRoot":"","sources":["../../src/_services/dynamobe-app.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAGnE,OAAO,QAAQ,GAAG,QAAQ,UAAU,CAAC,CAAC;AAGtC,OAAO,KAAK,UAAU,MAAM,IAAI,CAAC;AAIjC,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAE,qBAAq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DBE_Shared.logError('
|
|
57
|
+
dynamobe_shared_service_1.DBE_Shared.logError('\nUnable to connect to MongoDB server, ERROR: ', error);
|
|
58
58
|
})
|
|
59
59
|
.once('open', () => {
|
|
60
60
|
dynamobe_shared_service_1.DBE_Shared.logSuccess('\nConnected to MongoDB\n');
|
|
@@ -67,7 +67,7 @@ class DynamoBEApp extends dynamobe_singleton_service_1.DynamoBESingletonService
|
|
|
67
67
|
initExpresses() {
|
|
68
68
|
if (this.security !== dynamobe_route_security_enum_1.DynamoBERouteSecurity.secure) {
|
|
69
69
|
if (!this.httpPort) {
|
|
70
|
-
let errorMsg =
|
|
70
|
+
let errorMsg = `\nYou have open routes, but httpPort is not set!` +
|
|
71
71
|
`\nsecurity: ${this.security}` +
|
|
72
72
|
`\nset httpPort in DynamoBEServer - setupRoutingModules() to enable secure routes.`;
|
|
73
73
|
errorMsg += '\n\nThe routes setted to use open server:';
|
|
@@ -92,7 +92,7 @@ class DynamoBEApp extends dynamobe_singleton_service_1.DynamoBESingletonService
|
|
|
92
92
|
}
|
|
93
93
|
if (this.security !== dynamobe_route_security_enum_1.DynamoBERouteSecurity.open) {
|
|
94
94
|
if (!this.cert || !this.httpsPort) {
|
|
95
|
-
let errorMsg =
|
|
95
|
+
let errorMsg = `\nYou have secure routes, but the certification paths or httpsPort are not set!` +
|
|
96
96
|
`\nsecurity: ${this.security}` +
|
|
97
97
|
`\nset...` +
|
|
98
98
|
`\n httpsPort and` +
|
|
@@ -145,10 +145,10 @@ class DynamoBEApp extends dynamobe_singleton_service_1.DynamoBESingletonService
|
|
|
145
145
|
dynamobe_shared_service_1.DBE_Shared.logSuccess(`\nHTTPS (secure) server is listening on port ${this.httpsPort}\n`);
|
|
146
146
|
})
|
|
147
147
|
.on('error', (error) => {
|
|
148
|
-
dynamobe_shared_service_1.DBE_Shared.logError(
|
|
148
|
+
dynamobe_shared_service_1.DBE_Shared.logError(`\nhttps (secure) server ERROR`, error);
|
|
149
149
|
})
|
|
150
150
|
.on('uncaughtException', (ex) => {
|
|
151
|
-
dynamobe_shared_service_1.DBE_Shared.logWarning(
|
|
151
|
+
dynamobe_shared_service_1.DBE_Shared.logWarning(`\nhttps (secure) server uncaughtException`, ex);
|
|
152
152
|
});
|
|
153
153
|
}
|
|
154
154
|
if (this.security !== dynamobe_route_security_enum_1.DynamoBERouteSecurity.secure) {
|
|
@@ -157,10 +157,10 @@ class DynamoBEApp extends dynamobe_singleton_service_1.DynamoBESingletonService
|
|
|
157
157
|
dynamobe_shared_service_1.DBE_Shared.logSuccess(`\nHTTP (-open-) server is listening on port ${this.httpPort}\n`);
|
|
158
158
|
})
|
|
159
159
|
.on('error', (error) => {
|
|
160
|
-
dynamobe_shared_service_1.DBE_Shared.logError(
|
|
160
|
+
dynamobe_shared_service_1.DBE_Shared.logError(`\nhttp (-open-) server ERROR`, error);
|
|
161
161
|
})
|
|
162
162
|
.on('uncaughtException', (ex) => {
|
|
163
|
-
dynamobe_shared_service_1.DBE_Shared.logWarning(
|
|
163
|
+
dynamobe_shared_service_1.DBE_Shared.logWarning(`\nhttp (-open-) server uncaughtException`, ex);
|
|
164
164
|
});
|
|
165
165
|
}
|
|
166
166
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamobe-app.js","sourceRoot":"","sources":["../../src/_services/dynamobe-app.ts"],"names":[],"mappings":";;;;AAEA,2CAA2C;AAC3C,yCAAyC;AACzC,qCAAsC;AACtC,mCAAoC;AACpC,qDAA+B;AAC/B,uDAAiC;AACjC,gEAA0C;AAE1C,uEAAuD;AACvD,6EAAwE;AACxE,yFAA+E;AAE/E,uEAAyD;AAGzD;;;;;;GAMG;AACH,MAAsB,WAAY,SAAQ,qDAAwB;IAwBhE;QACE,KAAK,EAAE,CAAC;QArBA,aAAQ,GAAG,QAAQ,CAAC;QAuB5B,IAAI;YACF,IAAI,CAAC,cAAc,EAAE,CAAC;YACtB,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,CAAC,MAAM,CAA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-13,7 +13,6 @@ import { DynamoBEDataParams } from '../_models/fullstack/control-models/dynamobe
|
|
|
13
13
|
*/
|
|
14
14
|
export declare class DBE_Global_S extends DynamoBESingletonService {
|
|
15
15
|
static getInstance(): DBE_Global_S;
|
|
16
|
-
globalSettings: DynamoBEGlobalSettings;
|
|
17
16
|
authService: DynamoBEAuthService;
|
|
18
17
|
dbServiceCollection: DynamoBEDBServiceCollection;
|
|
19
18
|
emailServiceCollection: DynamoBEEmailServiceCollection;
|
|
@@ -35,7 +34,6 @@ export declare class DBE_Global_S extends DynamoBESingletonService {
|
|
|
35
34
|
dbModels: DynamoBEDataParams[];
|
|
36
35
|
}): void;
|
|
37
36
|
static getGlobalSettings(): DynamoBEGlobalSettings;
|
|
38
|
-
static setGlobalSettings(set: DynamoBEGlobalSettings): void;
|
|
39
37
|
static getAuthService(): DynamoBEAuthService;
|
|
40
38
|
static getDBServiceCollection(): DynamoBEDBServiceCollection;
|
|
41
39
|
static getDBService<T extends Metadata>(dataParams: DynamoBEDataParams): DynamoBEDBService<T>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamobe-global.service.d.ts","sourceRoot":"","sources":["../../src/_services/dynamobe-global.service.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,2CAA2C,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,2BAA2B,EAAE,MAAM,0CAA0C,CAAC;AACvF,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,8BAA8B,EAAE,MAAM,6CAA6C,CAAC;AAC7F,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,0DAA0D,CAAC;AAE9F;;;;GAIG;AACH,qBAAa,YAAa,S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AAC,iBAAiB,CAAC,CAAC,SAAS,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,iBAAiB,CAAC,CAAC,CAAC;IAe/E,MAAM,CAAC,yBAAyB,IAAI,8BAA8B;CASnE"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DBE_Global_S = void 0;
|
|
4
|
-
const dynamobe_route_security_enum_1 = require("../_enums/dynamobe-route-security.enum");
|
|
5
4
|
const dynamobe_db_service_collection_service_1 = require("./dynamobe-db-service-collection.service");
|
|
6
5
|
const dynamobe_db_service_1 = require("./dynamobe-db.service");
|
|
7
6
|
const dynamobe_singleton_service_1 = require("./dynamobe-singleton.service");
|
|
@@ -11,16 +10,6 @@ const dynamobe_singleton_service_1 = require("./dynamobe-singleton.service");
|
|
|
11
10
|
* dbServices, emailServices, or authService
|
|
12
11
|
*/
|
|
13
12
|
class DBE_Global_S extends dynamobe_singleton_service_1.DynamoBESingletonService {
|
|
14
|
-
constructor() {
|
|
15
|
-
super(...arguments);
|
|
16
|
-
this.globalSettings = {
|
|
17
|
-
defaultRouteSecurity: dynamobe_route_security_enum_1.DynamoBERouteSecurity.open,
|
|
18
|
-
logSetup: false,
|
|
19
|
-
logRequests: true,
|
|
20
|
-
logRequestsContent: true,
|
|
21
|
-
logResponseContent: false,
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
13
|
static getInstance() {
|
|
25
14
|
return DBE_Global_S.getSingletonInstance();
|
|
26
15
|
}
|
|
@@ -34,43 +23,46 @@ class DBE_Global_S extends dynamobe_singleton_service_1.DynamoBESingletonService
|
|
|
34
23
|
this.instance.dbServiceCollection[dbModel.dataName] = new dynamobe_db_service_1.DynamoBEDBService(dbModel); // dbModel.constructDBService();
|
|
35
24
|
});
|
|
36
25
|
this.instance.authService = set.authService;
|
|
37
|
-
/* this.instance.dbServiceCollection = set.dbServiceCollection; */
|
|
38
26
|
this.instance.emailServiceCollection = set.emailServiceCollection;
|
|
39
27
|
}
|
|
40
28
|
static getGlobalSettings() {
|
|
41
29
|
if (!this.instance) {
|
|
42
|
-
throw new Error(
|
|
30
|
+
throw new Error(`\nDynamoBE Global Service missing!` +
|
|
43
31
|
`\nPlease setup DynamoBE Global Service by calling "DBE_Global_SC.setServices(...)"` +
|
|
44
32
|
`before calling getGlobalSettings"`);
|
|
45
33
|
}
|
|
46
34
|
return this.instance.globalSettings;
|
|
47
35
|
}
|
|
48
|
-
static setGlobalSettings(set) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
36
|
+
/* static setGlobalSettings(set: DynamoBEGlobalSettings): void {
|
|
37
|
+
if (!this.instance) {
|
|
38
|
+
throw new Error(
|
|
39
|
+
`\nDynamoBE Global Service missing!` +
|
|
40
|
+
`\nPlease setup DynamoBE Global Service by calling "DBE_Global_SC.setServices(...)"` +
|
|
41
|
+
`before calling setGlobalSettings"`);
|
|
42
|
+
}
|
|
43
|
+
if (set.baseUrl) {
|
|
44
|
+
this.instance.globalSettings.baseUrl = set.baseUrl;
|
|
45
|
+
}
|
|
46
|
+
if (set.defaultRouteSecurity) {
|
|
47
|
+
this.instance.globalSettings.defaultRouteSecurity = set.defaultRouteSecurity;
|
|
48
|
+
}
|
|
49
|
+
if (set.logSetup !== undefined) {
|
|
50
|
+
this.instance.globalSettings.logSetup = set.logSetup;
|
|
51
|
+
}
|
|
52
|
+
if (set.logRequests !== undefined) {
|
|
53
|
+
this.instance.globalSettings.logRequests = set.logRequests;
|
|
54
|
+
}
|
|
55
|
+
if (set.logRequestsContent !== undefined) {
|
|
56
|
+
this.instance.globalSettings.logRequestsContent = set.logRequestsContent;
|
|
57
|
+
}
|
|
58
|
+
if (set.logResponseContent !== undefined) {
|
|
59
|
+
this.instance.globalSettings.logResponseContent = set.logResponseContent;
|
|
60
|
+
}
|
|
61
|
+
} */
|
|
70
62
|
static getAuthService() {
|
|
71
63
|
var _a, _b;
|
|
72
64
|
if (!((_b = (_a = this.instance) === null || _a === void 0 ? void 0 : _a.authService) === null || _b === void 0 ? void 0 : _b.authenticateToken)) {
|
|
73
|
-
throw new Error(
|
|
65
|
+
throw new Error(`\nUnique Authentication Service missing!` +
|
|
74
66
|
`\nPlease create a Unique Authentication Service extending DynamoBEAuthService, ` +
|
|
75
67
|
`and Setup with "DBE_Global_SC.setServices(...)"`);
|
|
76
68
|
}
|
|
@@ -79,7 +71,7 @@ class DBE_Global_S extends dynamobe_singleton_service_1.DynamoBESingletonService
|
|
|
79
71
|
static getDBServiceCollection() {
|
|
80
72
|
var _a;
|
|
81
73
|
if (!((_a = this.instance) === null || _a === void 0 ? void 0 : _a.dbServiceCollection)) {
|
|
82
|
-
throw new Error(
|
|
74
|
+
throw new Error(`\nUnique DataBase Service Collection missing!` +
|
|
83
75
|
`\nPlease create a Unique DataBase Service Collectio extending DynamoBEDBServiceCollection, ` +
|
|
84
76
|
`and Setup with "DBE_Global_SC.setServices(...)"`);
|
|
85
77
|
}
|
|
@@ -95,11 +87,11 @@ class DBE_Global_S extends dynamobe_singleton_service_1.DynamoBESingletonService
|
|
|
95
87
|
}
|
|
96
88
|
else {
|
|
97
89
|
let keys = `${Object.keys(collection)}`;
|
|
98
|
-
keys = keys.replace(/,/g, '\n
|
|
90
|
+
keys = keys.replace(/,/g, '\n ');
|
|
99
91
|
throw new Error(`\nDBE_Global_S.getDBService failed ERROR:
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
92
|
+
no dbService on collection with this key: ${key}!
|
|
93
|
+
The available dbServices on collection:
|
|
94
|
+
${keys}\n`);
|
|
103
95
|
}
|
|
104
96
|
}
|
|
105
97
|
static getEmailServiceCollection() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamobe-global.service.js","sourceRoot":"","sources":["../../src/_services/dynamobe-global.service.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"dynamobe-global.service.js","sourceRoot":"","sources":["../../src/_services/dynamobe-global.service.ts"],"names":[],"mappings":";;;AAMA,qGAAuF;AACvF,+DAA0D;AAE1D,6EAAwE;AAGxE;;;;GAIG;AACH,MAAa,YAAa,SAAQ,qDAAwB;IAExD,MAAM,CAAC,WAAW;QAChB,OAAO,YAAY,CAAC,oBAAoB,EAAE,CAAC;IAC7C,CAAC;IAeD;;OAEG;IACH,MAAM,CAAC,WAAW,CAChB,GAeC;QAED,IAAI,CAAC,WAAW,EAAE,CAAC;QAEnB,IAAI,CAAC,QAAQ,CAAC,mBAAmB,GAAG,IAAI,oEAA2B,EAAE,CAAC;QACtE,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,OAA2B,EAAE,EAAE;YACnD,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,IAAI,uCAAiB,CAAC,OAAO,CAAC,CAAC,CAAC,gCAAgC;QACxH,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,QAAQ,CAAC,WAAW,GAAG,GAAG,CAAC,WAAW,CAAC;QAC5C,IAAI,CAAC,QAAQ,CAAC,sBAAsB,GAAG,GAAG,CAAC,sBAAsB,CAAC;IACpE,CAAC;IAED,MAAM,CAAC,iBAAiB;QACtB,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YAClB,MAAM,IAAI,KAAK,CACb,oCAAoC;gBACpC,oFAAoF;gBACpF,mCAAmC,CAAC,CAAC;SACxC;QACD,OAAO,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC;IACtC,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;QAyBI;IAEJ,MAAM,CAAC,cAA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AAC,QAAQ,CAAC,sBAAsB,CAAC;IAC9C,CAAC;CACF;AAxID,oCAwIC"}
|
|
@@ -2,7 +2,12 @@ import { Router } from 'express';
|
|
|
2
2
|
import { DynamoBERouteSecurity } from '../_enums/dynamobe-route-security.enum';
|
|
3
3
|
import { DynamoBEEndpointParams } from '../_models/dynamobe-endpoint-params';
|
|
4
4
|
import { DynamoBEController } from './dynamobe-controller.service';
|
|
5
|
-
export
|
|
5
|
+
export interface DynamoBERoutingModuleSettings {
|
|
6
|
+
route: string;
|
|
7
|
+
controllers: DynamoBEController[];
|
|
8
|
+
securityOverride?: DynamoBERouteSecurity;
|
|
9
|
+
}
|
|
10
|
+
export declare class DynamoBERoutingModule {
|
|
6
11
|
security: DynamoBERouteSecurity;
|
|
7
12
|
route: string;
|
|
8
13
|
private controllers;
|
|
@@ -10,15 +15,11 @@ export declare class DynamoBERountingModule {
|
|
|
10
15
|
openRouter: Router;
|
|
11
16
|
secureRouter: Router;
|
|
12
17
|
protected log: boolean;
|
|
13
|
-
constructor(set:
|
|
14
|
-
route: string;
|
|
15
|
-
controllers: DynamoBEController[];
|
|
16
|
-
securityOverride?: DynamoBERouteSecurity;
|
|
17
|
-
});
|
|
18
|
+
constructor(set: DynamoBERoutingModuleSettings);
|
|
18
19
|
/**
|
|
19
20
|
* You must setup endpoints and required services in this function
|
|
20
21
|
*/
|
|
21
|
-
setupRoutes
|
|
22
|
+
private setupRoutes;
|
|
22
23
|
private mountRoutes;
|
|
23
24
|
private mountOpenRoute;
|
|
24
25
|
private mountSecureRoute;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamobe-routing-module.service.d.ts","sourceRoot":"","sources":["../../src/_services/dynamobe-routing-module.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"dynamobe-routing-module.service.d.ts","sourceRoot":"","sources":["../../src/_services/dynamobe-routing-module.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEjC,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAE/E,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAE7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAInE,MAAM,WAAW,6BAA6B;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,kBAAkB,EAAE,CAAC;IAClC,gBAAgB,CAAC,EAAE,qBAAqB,CAAC;CAC1C;AAED,qBAAa,qBAAqB;IAEhC,QAAQ,EAAE,qBAAqB,CAAC;IAChC,KAAK,EAAE,MAAM,CAAC;IAEd,OAAO,CAAC,WAAW,CAAuB;IAC1C,SAAS,EAAE,sBAAsB,EAAE,CAAM;IAEzC,UAAU,EAAE,MAAM,CAAY;IAC9B,YAAY,EAAE,MAAM,CAAY;IAEhC,SAAS,CAAC,GAAG,EAAE,OAAO,CAA6C;gBAGjE,GAAG,EAAE,6BAA6B;IAmBpC;;OAEG;IACH,OAAO,CAAC,WAAW;IAMnB,OAAO,CAAC,WAAW;IAwCnB,OAAO,CAAC,cAAc;IA2BtB,OAAO,CAAC,gBAAgB;CA+BzB"}
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.DynamoBERoutingModule = void 0;
|
|
4
4
|
const express_1 = require("express");
|
|
5
|
+
const dynamobe_global_settings_1 = require("../dynamobe-global.settings");
|
|
5
6
|
const dynamobe_route_security_enum_1 = require("../_enums/dynamobe-route-security.enum");
|
|
6
7
|
const http_call_type_enum_1 = require("../_enums/http/http-call-type.enum");
|
|
7
8
|
const dynamobe_error_1 = require("../_models/fullstack/control-models/dynamobe-error");
|
|
8
9
|
const dynamobe_global_service_1 = require("./dynamobe-global.service");
|
|
9
10
|
const dynamobe_shared_service_1 = require("./dynamobe-shared.service");
|
|
10
|
-
class
|
|
11
|
+
class DynamoBERoutingModule {
|
|
11
12
|
constructor(set) {
|
|
12
13
|
this.endpoints = [];
|
|
13
14
|
this.openRouter = express_1.Router();
|
|
14
15
|
this.secureRouter = express_1.Router();
|
|
15
16
|
this.log = dynamobe_global_service_1.DBE_Global_S.getGlobalSettings().logSetup;
|
|
16
17
|
try {
|
|
17
|
-
this.route = set.route;
|
|
18
|
+
this.route = dynamobe_global_settings_1.dynamoBEGlobalSettings.baseUrl + set.route;
|
|
18
19
|
this.controllers = set.controllers;
|
|
19
20
|
this.setupRoutes();
|
|
20
21
|
this.mountRoutes(set.securityOverride);
|
|
@@ -25,6 +26,10 @@ class DynamoBERountingModule {
|
|
|
25
26
|
dynamobe_shared_service_1.DBE_Shared.logError(`Routing module setup failed (${this.route})`, error);
|
|
26
27
|
}
|
|
27
28
|
}
|
|
29
|
+
/* securityOverride(securityOverride: DynamoBERouteSecurity): void {
|
|
30
|
+
this.resetRouters();
|
|
31
|
+
this.mountRoutes(securityOverride);
|
|
32
|
+
} */
|
|
28
33
|
/**
|
|
29
34
|
* You must setup endpoints and required services in this function
|
|
30
35
|
*/
|
|
@@ -115,5 +120,5 @@ class DynamoBERountingModule {
|
|
|
115
120
|
}
|
|
116
121
|
}
|
|
117
122
|
}
|
|
118
|
-
exports.
|
|
123
|
+
exports.DynamoBERoutingModule = DynamoBERoutingModule;
|
|
119
124
|
//# sourceMappingURL=dynamobe-routing-module.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamobe-routing-module.service.js","sourceRoot":"","sources":["../../src/_services/dynamobe-routing-module.service.ts"],"names":[],"mappings":";;;AACA,qCAAiC;AACjC,yFAA+E;AAC/E,4EAAkE;AAElE,uFAAmF;AAEnF,uEAAyD;AACzD,uEAAuD;
|
|
1
|
+
{"version":3,"file":"dynamobe-routing-module.service.js","sourceRoot":"","sources":["../../src/_services/dynamobe-routing-module.service.ts"],"names":[],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,"file":"dynamobe-global.settings.d.ts","sourceRoot":"","sources":["../src/dynamobe-global.settings.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAE5E,eAAO,MAAM,sBAAsB,EAAE,
|
|
1
|
+
{"version":3,"file":"dynamobe-global.settings.d.ts","sourceRoot":"","sources":["../src/dynamobe-global.settings.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAE5E,eAAO,MAAM,sBAAsB,EAAE,sBAOpC,CAAC"}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.dynamoBEGlobalSettings = void 0;
|
|
4
4
|
const dynamobe_route_security_enum_1 = require("./_enums/dynamobe-route-security.enum");
|
|
5
5
|
exports.dynamoBEGlobalSettings = {
|
|
6
|
+
baseUrl: '/api',
|
|
6
7
|
defaultRouteSecurity: dynamobe_route_security_enum_1.DynamoBERouteSecurity.open,
|
|
7
8
|
logSetup: false,
|
|
8
9
|
logRequests: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamobe-global.settings.js","sourceRoot":"","sources":["../src/dynamobe-global.settings.ts"],"names":[],"mappings":";;;AAAA,wFAA8E;AAGjE,QAAA,sBAAsB,GAA2B;IAC5D,oBAAoB,EAAE,oDAAqB,CAAC,IAAI;IAChD,QAAQ,EAAE,KAAK;IACf,WAAW,EAAE,IAAI;IACjB,kBAAkB,EAAE,IAAI;IACxB,kBAAkB,EAAE,KAAK;CAC1B,CAAC"}
|
|
1
|
+
{"version":3,"file":"dynamobe-global.settings.js","sourceRoot":"","sources":["../src/dynamobe-global.settings.ts"],"names":[],"mappings":";;;AAAA,wFAA8E;AAGjE,QAAA,sBAAsB,GAA2B;IAC5D,OAAO,EAAE,MAAM;IACf,oBAAoB,EAAE,oDAAqB,CAAC,IAAI;IAChD,QAAQ,EAAE,KAAK;IACf,WAAW,EAAE,IAAI;IACjB,kBAAkB,EAAE,IAAI;IACxB,kBAAkB,EAAE,KAAK;CAC1B,CAAC"}
|
package/lib/tsconfig.tsbuildinfo
CHANGED
|
@@ -531,16 +531,21 @@
|
|
|
531
531
|
"signature": "d298bd3831d9ca38bafbaa4daf195f41f7a1bf141e114485411d292802612ec5",
|
|
532
532
|
"affectsGlobalScope": false
|
|
533
533
|
},
|
|
534
|
+
"../src/_models/dynamobe-global-settings.ts": {
|
|
535
|
+
"version": "2295ca9bd5dcfc612d9b07ff86920b6c6f5b6ecd964c10fcda1db04da00335dd",
|
|
536
|
+
"signature": "4fbab01ec3449a13b44653906c34853adbd8e034e1e1e3b857f79a687de56afa",
|
|
537
|
+
"affectsGlobalScope": false
|
|
538
|
+
},
|
|
539
|
+
"../src/dynamobe-global.settings.ts": {
|
|
540
|
+
"version": "74616ac16498f2b4616f39c106529071066bdf0a0326c9fbf72175b821ce33e9",
|
|
541
|
+
"signature": "9cf53dee82685e9f79477476828eb65ef2bed364cee3e39e858fdf81cef0c6a2",
|
|
542
|
+
"affectsGlobalScope": false
|
|
543
|
+
},
|
|
534
544
|
"../src/_models/fullstack/data-models/metadata.ts": {
|
|
535
545
|
"version": "3516e88bb340706b4e5e0c75ff24ec79621cec501d7fd6ff5af3fe809efa173f",
|
|
536
546
|
"signature": "3a6ad5b0efc28eef16cc0568bce7fb02abb8231bb6430fbe40c1c6252e6ab910",
|
|
537
547
|
"affectsGlobalScope": false
|
|
538
548
|
},
|
|
539
|
-
"../src/_models/dynamobe-global-settings.ts": {
|
|
540
|
-
"version": "aaa3527474b056626ad000bf8fb076de3dce217efab490f9d42bc385d8677cb9",
|
|
541
|
-
"signature": "fb387e484f7eab1268be576aeb48beb0188a600a6b5987a9b0801f8a08f38c29",
|
|
542
|
-
"affectsGlobalScope": false
|
|
543
|
-
},
|
|
544
549
|
"../src/_services/dynamobe-auth.service.ts": {
|
|
545
550
|
"version": "9a6037adcbf32900a958d698507eb7b0f1c2c94a5389d287c1cfb3116f685239",
|
|
546
551
|
"signature": "f7205c2d08a3f7125c35504d48fd057e454ad8b4cc9a390464451bd8b383224c",
|
|
@@ -647,8 +652,8 @@
|
|
|
647
652
|
"affectsGlobalScope": false
|
|
648
653
|
},
|
|
649
654
|
"../src/_services/dynamobe-global.service.ts": {
|
|
650
|
-
"version": "
|
|
651
|
-
"signature": "
|
|
655
|
+
"version": "0c8c7e286aa0010734294528f4b3dcaec491e24bfa08a67724bfcc98d5da4e92",
|
|
656
|
+
"signature": "ce31cc4e69ff881537f58b67dcd13f03be5ea4dc6378d4daf140dd9308549e75",
|
|
652
657
|
"affectsGlobalScope": false
|
|
653
658
|
},
|
|
654
659
|
"../src/_models/dynamobe-endpoint-params.ts": {
|
|
@@ -662,13 +667,13 @@
|
|
|
662
667
|
"affectsGlobalScope": false
|
|
663
668
|
},
|
|
664
669
|
"../src/_services/dynamobe-routing-module.service.ts": {
|
|
665
|
-
"version": "
|
|
666
|
-
"signature": "
|
|
670
|
+
"version": "af08a4033cf4cdada7f2acf20284f7a03c2cc89a9e12924236340d1d2359cc69",
|
|
671
|
+
"signature": "1c5ee82c7daa73098c6f971e9979d7233cc392450bb5dde5bb9a0f8c43452ad3",
|
|
667
672
|
"affectsGlobalScope": false
|
|
668
673
|
},
|
|
669
674
|
"../src/_services/dynamobe-app.ts": {
|
|
670
|
-
"version": "
|
|
671
|
-
"signature": "
|
|
675
|
+
"version": "19d56f2df7447f88131893ae145c00669b24bdce4afd1122573249455ec4ab42",
|
|
676
|
+
"signature": "14ebd273862fb791086141d2c1e1e2a6ee0a6fbc0e1ca10f44778ae71088b07b",
|
|
672
677
|
"affectsGlobalScope": false
|
|
673
678
|
},
|
|
674
679
|
"../src/_models/fullstack/data-models/custom-data.ts": {
|
|
@@ -721,11 +726,6 @@
|
|
|
721
726
|
"signature": "4f3b1387b1096d4e3bcad59fffec513168ac14e5d111a318127d28f01298c230",
|
|
722
727
|
"affectsGlobalScope": false
|
|
723
728
|
},
|
|
724
|
-
"../src/dynamobe-global.settings.ts": {
|
|
725
|
-
"version": "9eb9d0eac08867e5e14507f6d079972537e01774fa791483e1e1e2e022fd2abd",
|
|
726
|
-
"signature": "9cf53dee82685e9f79477476828eb65ef2bed364cee3e39e858fdf81cef0c6a2",
|
|
727
|
-
"affectsGlobalScope": false
|
|
728
|
-
},
|
|
729
729
|
"../src/_enums/data-model-type.enum.ts": {
|
|
730
730
|
"version": "17d3b646a98bd788ea718b31249b4d3f53d37be1c18890520f940658d2d45b45",
|
|
731
731
|
"signature": "58db1bde43f232985d47f296cec0e0c9e09b30c2a24d28a0aee8d4dfc25f1de8",
|
|
@@ -772,8 +772,8 @@
|
|
|
772
772
|
"affectsGlobalScope": false
|
|
773
773
|
},
|
|
774
774
|
"../src/_constants/dynamobe-global.settings.ts": {
|
|
775
|
-
"version": "
|
|
776
|
-
"signature": "
|
|
775
|
+
"version": "2f424decf08076b9566e17172681f2f9981a0ba531c0292713e244ffec270a08",
|
|
776
|
+
"signature": "badf9a28c3e60e96d3e5b79ede680ba7d2a50a2a18201fdb44f077af96cb0b40",
|
|
777
777
|
"affectsGlobalScope": false
|
|
778
778
|
},
|
|
779
779
|
"../src/_models/dynamo-module-settings.ts": {
|
|
@@ -802,8 +802,8 @@
|
|
|
802
802
|
"affectsGlobalScope": false
|
|
803
803
|
},
|
|
804
804
|
"../src/_modules/test/test-routing-module.ts": {
|
|
805
|
-
"version": "
|
|
806
|
-
"signature": "
|
|
805
|
+
"version": "6c7bf047a20085c480099f5fe75a7f27b8d760c4a452148ee9caf53e3b2b62c7",
|
|
806
|
+
"signature": "83fd0981ea036b762f41cb0c9e4df84e7f73af94d2799dd74aefdc3e3b12eff3",
|
|
807
807
|
"affectsGlobalScope": false
|
|
808
808
|
},
|
|
809
809
|
"../src/_modules/test/index.ts": {
|
|
@@ -822,8 +822,8 @@
|
|
|
822
822
|
"affectsGlobalScope": false
|
|
823
823
|
},
|
|
824
824
|
"../src/_modules/usage/usage-routing-module.ts": {
|
|
825
|
-
"version": "
|
|
826
|
-
"signature": "
|
|
825
|
+
"version": "a1e77798e2077b4a9b0ad0069bc4dfb6aade92b54c6f575eaad37b2add470cb2",
|
|
826
|
+
"signature": "5914ceb5a232ab9da44cecb1e91c794ee6e01ec2f07bd839c3cb94e271c5ad21",
|
|
827
827
|
"affectsGlobalScope": false
|
|
828
828
|
},
|
|
829
829
|
"../src/_modules/usage/index.ts": {
|
|
@@ -1983,9 +1983,7 @@
|
|
|
1983
1983
|
"../node_modules/@types/node/ts3.2/fs.d.ts",
|
|
1984
1984
|
"../node_modules/@types/node/ts3.2/process.d.ts",
|
|
1985
1985
|
"../node_modules/@types/node/ts3.2/util.d.ts",
|
|
1986
|
-
"../node_modules/@types/node/util.d.ts"
|
|
1987
|
-
"../src/_enums/dynamobe-route-security.enum.ts",
|
|
1988
|
-
"../src/_models/dynamobe-global-settings.ts"
|
|
1986
|
+
"../node_modules/@types/node/util.d.ts"
|
|
1989
1987
|
],
|
|
1990
1988
|
"../src/_constants/fullstack/module-settings/test-module-settings.ts": [
|
|
1991
1989
|
"../node_modules/@types/node/fs.d.ts",
|
|
@@ -2289,6 +2287,7 @@
|
|
|
2289
2287
|
"../node_modules/@types/node/ts3.2/process.d.ts",
|
|
2290
2288
|
"../node_modules/@types/node/ts3.2/util.d.ts",
|
|
2291
2289
|
"../node_modules/@types/node/util.d.ts",
|
|
2290
|
+
"../src/_constants/fullstack/module-settings/test-module-settings.ts",
|
|
2292
2291
|
"../src/_modules/test/test-controller.ts",
|
|
2293
2292
|
"../src/_services/dynamobe-routing-module.service.ts"
|
|
2294
2293
|
],
|
|
@@ -2327,6 +2326,7 @@
|
|
|
2327
2326
|
"../node_modules/@types/node/ts3.2/process.d.ts",
|
|
2328
2327
|
"../node_modules/@types/node/ts3.2/util.d.ts",
|
|
2329
2328
|
"../node_modules/@types/node/util.d.ts",
|
|
2329
|
+
"../src/_constants/fullstack/module-settings/usage-module-settings.ts",
|
|
2330
2330
|
"../src/_modules/usage/usage-controller.ts",
|
|
2331
2331
|
"../src/_services/dynamobe-routing-module.service.ts"
|
|
2332
2332
|
],
|
|
@@ -2467,7 +2467,6 @@
|
|
|
2467
2467
|
"../node_modules/@types/node/ts3.2/process.d.ts",
|
|
2468
2468
|
"../node_modules/@types/node/ts3.2/util.d.ts",
|
|
2469
2469
|
"../node_modules/@types/node/util.d.ts",
|
|
2470
|
-
"../src/_enums/dynamobe-route-security.enum.ts",
|
|
2471
2470
|
"../src/_models/dynamobe-global-settings.ts",
|
|
2472
2471
|
"../src/_models/fullstack/control-models/dynamobe-data-params.ts",
|
|
2473
2472
|
"../src/_models/fullstack/data-models/metadata.ts",
|
|
@@ -2491,7 +2490,8 @@
|
|
|
2491
2490
|
"../src/_models/fullstack/control-models/dynamobe-error.ts",
|
|
2492
2491
|
"../src/_services/dynamobe-controller.service.ts",
|
|
2493
2492
|
"../src/_services/dynamobe-global.service.ts",
|
|
2494
|
-
"../src/_services/dynamobe-shared.service.ts"
|
|
2493
|
+
"../src/_services/dynamobe-shared.service.ts",
|
|
2494
|
+
"../src/dynamobe-global.settings.ts"
|
|
2495
2495
|
],
|
|
2496
2496
|
"../src/_services/dynamobe-shared.service.ts": [
|
|
2497
2497
|
"../node_modules/@types/express/ts4.0/index.d.ts",
|
|
@@ -3461,9 +3461,6 @@
|
|
|
3461
3461
|
"../node_modules/@types/node/util.d.ts",
|
|
3462
3462
|
"../node_modules/mongoose/index.d.ts"
|
|
3463
3463
|
],
|
|
3464
|
-
"../src/_constants/dynamobe-global.settings.ts": [
|
|
3465
|
-
"../src/_models/dynamobe-global-settings.ts"
|
|
3466
|
-
],
|
|
3467
3464
|
"../src/_constants/fullstack/module-settings/usage-module-settings.ts": [
|
|
3468
3465
|
"../src/_models/dynamo-module-settings.ts"
|
|
3469
3466
|
],
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { DynamoBERouteSecurity } from '../_enums/dynamobe-route-security.enum';
|
|
2
|
+
/* import { DynamoBERouteSecurity } from '../_enums/dynamobe-route-security.enum';
|
|
3
3
|
import { DynamoBEGlobalSettings } from '../_models/dynamobe-global-settings';
|
|
4
4
|
|
|
5
5
|
export const dynamoBEDefaultGlobalSettings: DynamoBEGlobalSettings = {
|
|
@@ -9,3 +9,4 @@ export const dynamoBEDefaultGlobalSettings: DynamoBEGlobalSettings = {
|
|
|
9
9
|
logRequestsContent: true,
|
|
10
10
|
logResponseContent: false,
|
|
11
11
|
};
|
|
12
|
+
*/
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { DynamoBERouteSecurity } from '../_enums/dynamobe-route-security.enum';
|
|
2
2
|
|
|
3
3
|
export interface DynamoBEGlobalSettings {
|
|
4
|
-
|
|
4
|
+
baseUrl: string;
|
|
5
|
+
defaultRouteSecurity: DynamoBERouteSecurity;
|
|
5
6
|
logSetup?: boolean;
|
|
6
7
|
logRequests?: boolean;
|
|
7
8
|
logRequestsContent?: boolean;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
import { testModuleSettings } from '../../_constants/fullstack/module-settings/test-module-settings';
|
|
3
|
+
import { DynamoBERoutingModuleSettings } from '../../_services/dynamobe-routing-module.service';
|
|
2
4
|
import { TestController } from './test-controller';
|
|
3
5
|
|
|
4
|
-
export const testRoutingModule =
|
|
5
|
-
route:
|
|
6
|
+
export const testRoutingModule: DynamoBERoutingModuleSettings = {
|
|
7
|
+
route: testModuleSettings.mainRoute,
|
|
6
8
|
controllers: [ TestController.getInstance() ]
|
|
7
|
-
}
|
|
9
|
+
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
import { usageModuleSettings } from '../../_constants/fullstack/module-settings/usage-module-settings';
|
|
3
|
+
import { DynamoBERoutingModuleSettings } from '../../_services/dynamobe-routing-module.service';
|
|
2
4
|
import { UsageController } from './usage-controller';
|
|
3
5
|
|
|
4
|
-
export const
|
|
5
|
-
route:
|
|
6
|
+
export const usageRoutingModuleSettings: DynamoBERoutingModuleSettings = {
|
|
7
|
+
route: usageModuleSettings.mainRoute,
|
|
6
8
|
controllers: [ UsageController.getInstance() ]
|
|
7
|
-
}
|
|
9
|
+
};
|
|
@@ -11,7 +11,7 @@ import * as BodyParser from 'body-parser';
|
|
|
11
11
|
import { DBE_Shared } from './dynamobe-shared.service';
|
|
12
12
|
import { DynamoBESingletonService } from './dynamobe-singleton.service';
|
|
13
13
|
import { DynamoBERouteSecurity } from '../_enums/dynamobe-route-security.enum';
|
|
14
|
-
import {
|
|
14
|
+
import { DynamoBERoutingModule } from './dynamobe-routing-module.service';
|
|
15
15
|
import { DBE_Global_S } from './dynamobe-global.service';
|
|
16
16
|
import { DynamoBEEndpointParams } from '../_models/dynamobe-endpoint-params';
|
|
17
17
|
|
|
@@ -42,7 +42,7 @@ export abstract class DynamoBEApp extends DynamoBESingletonService {
|
|
|
42
42
|
private httpsServer: Https.Server;
|
|
43
43
|
private openExpress: Express.Application;
|
|
44
44
|
|
|
45
|
-
protected routingModules:
|
|
45
|
+
protected routingModules: DynamoBERoutingModule[];
|
|
46
46
|
|
|
47
47
|
protected log: boolean;
|
|
48
48
|
|
|
@@ -83,7 +83,7 @@ export abstract class DynamoBEApp extends DynamoBESingletonService {
|
|
|
83
83
|
private startDB(): void {
|
|
84
84
|
this.mongoose.connection
|
|
85
85
|
.on('error', (error) => {
|
|
86
|
-
DBE_Shared.logError('
|
|
86
|
+
DBE_Shared.logError('\nUnable to connect to MongoDB server, ERROR: ', error);
|
|
87
87
|
})
|
|
88
88
|
.once('open', () => {
|
|
89
89
|
DBE_Shared.logSuccess('\nConnected to MongoDB\n');
|
|
@@ -102,12 +102,12 @@ export abstract class DynamoBEApp extends DynamoBESingletonService {
|
|
|
102
102
|
if (this.security !== DynamoBERouteSecurity.secure) {
|
|
103
103
|
if (!this.httpPort) {
|
|
104
104
|
let errorMsg: string =
|
|
105
|
-
|
|
105
|
+
`\nYou have open routes, but httpPort is not set!` +
|
|
106
106
|
`\nsecurity: ${this.security}` +
|
|
107
107
|
`\nset httpPort in DynamoBEServer - setupRoutingModules() to enable secure routes.`;
|
|
108
108
|
|
|
109
109
|
errorMsg += '\n\nThe routes setted to use open server:';
|
|
110
|
-
this.routingModules.forEach((module:
|
|
110
|
+
this.routingModules.forEach((module: DynamoBERoutingModule) => {
|
|
111
111
|
if (module.security != DynamoBERouteSecurity.secure) {
|
|
112
112
|
errorMsg += `\n ${module.route} (security: ${module.security}) \n subroutes using open sever:`;
|
|
113
113
|
module.endpoints.forEach((endpoint: DynamoBEEndpointParams) => {
|
|
@@ -133,7 +133,7 @@ export abstract class DynamoBEApp extends DynamoBESingletonService {
|
|
|
133
133
|
if (this.security !== DynamoBERouteSecurity.open) {
|
|
134
134
|
if (!this.cert || !this.httpsPort) {
|
|
135
135
|
let errorMsg: string =
|
|
136
|
-
|
|
136
|
+
`\nYou have secure routes, but the certification paths or httpsPort are not set!` +
|
|
137
137
|
`\nsecurity: ${this.security}` +
|
|
138
138
|
`\nset...` +
|
|
139
139
|
`\n httpsPort and` +
|
|
@@ -144,7 +144,7 @@ export abstract class DynamoBEApp extends DynamoBESingletonService {
|
|
|
144
144
|
`\nin DynamoBEServer - setupRoutingModules() to enable secure routes.`;
|
|
145
145
|
|
|
146
146
|
errorMsg += '\n\nThe routes setted to use secure server:';
|
|
147
|
-
this.routingModules.forEach((module:
|
|
147
|
+
this.routingModules.forEach((module: DynamoBERoutingModule) => {
|
|
148
148
|
if (module.security != DynamoBERouteSecurity.open) {
|
|
149
149
|
errorMsg += `\n ${module.route} (security: ${module.security}) \n subroutes using secure sever:`;
|
|
150
150
|
module.endpoints.forEach((endpoint: DynamoBEEndpointParams) => {
|
|
@@ -193,10 +193,10 @@ export abstract class DynamoBEApp extends DynamoBESingletonService {
|
|
|
193
193
|
DBE_Shared.logSuccess(`\nHTTPS (secure) server is listening on port ${this.httpsPort}\n`);
|
|
194
194
|
})
|
|
195
195
|
.on('error', (error) => {
|
|
196
|
-
DBE_Shared.logError(
|
|
196
|
+
DBE_Shared.logError(`\nhttps (secure) server ERROR`, error);
|
|
197
197
|
})
|
|
198
198
|
.on('uncaughtException', (ex) => {
|
|
199
|
-
DBE_Shared.logWarning(
|
|
199
|
+
DBE_Shared.logWarning(`\nhttps (secure) server uncaughtException`, ex);
|
|
200
200
|
});
|
|
201
201
|
}
|
|
202
202
|
|
|
@@ -206,20 +206,20 @@ export abstract class DynamoBEApp extends DynamoBESingletonService {
|
|
|
206
206
|
DBE_Shared.logSuccess(`\nHTTP (-open-) server is listening on port ${this.httpPort}\n`);
|
|
207
207
|
})
|
|
208
208
|
.on('error', (error) => {
|
|
209
|
-
DBE_Shared.logError(
|
|
209
|
+
DBE_Shared.logError(`\nhttp (-open-) server ERROR`, error);
|
|
210
210
|
})
|
|
211
211
|
.on('uncaughtException', (ex) => {
|
|
212
|
-
DBE_Shared.logWarning(
|
|
212
|
+
DBE_Shared.logWarning(`\nhttp (-open-) server uncaughtException`, ex);
|
|
213
213
|
});
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
216
|
|
|
217
217
|
private mountSecureRoutes (): void {
|
|
218
|
-
this.routingModules.forEach((module:
|
|
218
|
+
this.routingModules.forEach((module: DynamoBERoutingModule) => {
|
|
219
219
|
if (module.security !== DynamoBERouteSecurity.open) {
|
|
220
220
|
if (this.log) console.log(`route mount (secure): ${module.route}`);
|
|
221
|
-
const existingRoutes:
|
|
222
|
-
(mod:
|
|
221
|
+
const existingRoutes: DynamoBERoutingModule[] = this.routingModules.filter(
|
|
222
|
+
(mod: DynamoBERoutingModule) => mod.route === module.route);
|
|
223
223
|
if (1 < existingRoutes.length) {
|
|
224
224
|
let error = new Error(`ROUTE DUPLICATION: ${module.route}`);
|
|
225
225
|
let errorStack: string[] = error.stack.split('\n');
|
|
@@ -234,11 +234,11 @@ export abstract class DynamoBEApp extends DynamoBESingletonService {
|
|
|
234
234
|
}
|
|
235
235
|
|
|
236
236
|
private mountOpenRoutes (): void {
|
|
237
|
-
this.routingModules.forEach((module:
|
|
237
|
+
this.routingModules.forEach((module: DynamoBERoutingModule) => {
|
|
238
238
|
if (module.security !== DynamoBERouteSecurity.secure) {
|
|
239
239
|
if (this.log) console.log(`route mount (open): ${module.route}`);
|
|
240
|
-
const existingRoutes:
|
|
241
|
-
(mod:
|
|
240
|
+
const existingRoutes: DynamoBERoutingModule[] = this.routingModules.filter(
|
|
241
|
+
(mod: DynamoBERoutingModule) => mod.route === module.route);
|
|
242
242
|
if (1 < existingRoutes.length) {
|
|
243
243
|
let error = new Error(`ROUTE DUPLICATION: ${module.route}`);
|
|
244
244
|
let errorStack: string[] = error.stack.split('\n');
|
|
@@ -253,7 +253,7 @@ export abstract class DynamoBEApp extends DynamoBESingletonService {
|
|
|
253
253
|
}
|
|
254
254
|
|
|
255
255
|
private setSecurity(): void {
|
|
256
|
-
this.routingModules.forEach((module:
|
|
256
|
+
this.routingModules.forEach((module: DynamoBERoutingModule) => {
|
|
257
257
|
if (!this.security) {
|
|
258
258
|
this.security = module.security;
|
|
259
259
|
} else if (this.security !== module.security) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
import { DynamoBERouteSecurity } from '../_enums/dynamobe-route-security.enum';
|
|
3
|
+
/* import { DynamoBERouteSecurity } from '../_enums/dynamobe-route-security.enum'; */
|
|
4
4
|
import { Metadata } from '../_models/fullstack/data-models/metadata';
|
|
5
5
|
import { DynamoBEGlobalSettings } from '../_models/dynamobe-global-settings';
|
|
6
6
|
import { DynamoBEAuthService } from './dynamobe-auth.service';
|
|
@@ -21,13 +21,14 @@ export class DBE_Global_S extends DynamoBESingletonService {
|
|
|
21
21
|
return DBE_Global_S.getSingletonInstance();
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
globalSettings: DynamoBEGlobalSettings = {
|
|
24
|
+
/* globalSettings: DynamoBEGlobalSettings = {
|
|
25
|
+
baseUrl: '/api',
|
|
25
26
|
defaultRouteSecurity: DynamoBERouteSecurity.open,
|
|
26
27
|
logSetup: false,
|
|
27
28
|
logRequests: true,
|
|
28
29
|
logRequestsContent: true,
|
|
29
30
|
logResponseContent: false,
|
|
30
|
-
};
|
|
31
|
+
}; */
|
|
31
32
|
|
|
32
33
|
authService: DynamoBEAuthService;
|
|
33
34
|
dbServiceCollection: DynamoBEDBServiceCollection;
|
|
@@ -42,6 +43,7 @@ export class DBE_Global_S extends DynamoBESingletonService {
|
|
|
42
43
|
* You need to setup your Own Auth Service extending the DynamoBEAuthService class
|
|
43
44
|
*/
|
|
44
45
|
authService: DynamoBEAuthService,
|
|
46
|
+
|
|
45
47
|
/**
|
|
46
48
|
* You can setup your Own Email Service extending the DynamoBEEmailServiceCollection class
|
|
47
49
|
*/
|
|
@@ -61,25 +63,29 @@ export class DBE_Global_S extends DynamoBESingletonService {
|
|
|
61
63
|
});
|
|
62
64
|
|
|
63
65
|
this.instance.authService = set.authService;
|
|
64
|
-
/* this.instance.dbServiceCollection = set.dbServiceCollection; */
|
|
65
66
|
this.instance.emailServiceCollection = set.emailServiceCollection;
|
|
66
67
|
}
|
|
67
68
|
|
|
68
69
|
static getGlobalSettings(): DynamoBEGlobalSettings {
|
|
69
70
|
if (!this.instance) {
|
|
70
|
-
throw new Error(
|
|
71
|
+
throw new Error(
|
|
72
|
+
`\nDynamoBE Global Service missing!` +
|
|
71
73
|
`\nPlease setup DynamoBE Global Service by calling "DBE_Global_SC.setServices(...)"` +
|
|
72
74
|
`before calling getGlobalSettings"`);
|
|
73
75
|
}
|
|
74
76
|
return this.instance.globalSettings;
|
|
75
77
|
}
|
|
76
78
|
|
|
77
|
-
static setGlobalSettings(set: DynamoBEGlobalSettings): void {
|
|
79
|
+
/* static setGlobalSettings(set: DynamoBEGlobalSettings): void {
|
|
78
80
|
if (!this.instance) {
|
|
79
|
-
throw new Error(
|
|
81
|
+
throw new Error(
|
|
82
|
+
`\nDynamoBE Global Service missing!` +
|
|
80
83
|
`\nPlease setup DynamoBE Global Service by calling "DBE_Global_SC.setServices(...)"` +
|
|
81
84
|
`before calling setGlobalSettings"`);
|
|
82
85
|
}
|
|
86
|
+
if (set.baseUrl) {
|
|
87
|
+
this.instance.globalSettings.baseUrl = set.baseUrl;
|
|
88
|
+
}
|
|
83
89
|
if (set.defaultRouteSecurity) {
|
|
84
90
|
this.instance.globalSettings.defaultRouteSecurity = set.defaultRouteSecurity;
|
|
85
91
|
}
|
|
@@ -95,11 +101,12 @@ export class DBE_Global_S extends DynamoBESingletonService {
|
|
|
95
101
|
if (set.logResponseContent !== undefined) {
|
|
96
102
|
this.instance.globalSettings.logResponseContent = set.logResponseContent;
|
|
97
103
|
}
|
|
98
|
-
}
|
|
104
|
+
} */
|
|
99
105
|
|
|
100
106
|
static getAuthService(): DynamoBEAuthService {
|
|
101
107
|
if (!this.instance?.authService?.authenticateToken) {
|
|
102
|
-
throw new Error(
|
|
108
|
+
throw new Error(
|
|
109
|
+
`\nUnique Authentication Service missing!` +
|
|
103
110
|
`\nPlease create a Unique Authentication Service extending DynamoBEAuthService, ` +
|
|
104
111
|
`and Setup with "DBE_Global_SC.setServices(...)"`);
|
|
105
112
|
}
|
|
@@ -108,7 +115,8 @@ export class DBE_Global_S extends DynamoBESingletonService {
|
|
|
108
115
|
|
|
109
116
|
static getDBServiceCollection(): DynamoBEDBServiceCollection {
|
|
110
117
|
if (!this.instance?.dbServiceCollection) {
|
|
111
|
-
throw new Error(
|
|
118
|
+
throw new Error(
|
|
119
|
+
`\nUnique DataBase Service Collection missing!` +
|
|
112
120
|
`\nPlease create a Unique DataBase Service Collectio extending DynamoBEDBServiceCollection, ` +
|
|
113
121
|
`and Setup with "DBE_Global_SC.setServices(...)"`);
|
|
114
122
|
}
|
|
@@ -125,17 +133,19 @@ export class DBE_Global_S extends DynamoBESingletonService {
|
|
|
125
133
|
return collection[key] as DynamoBEDBService<T>;
|
|
126
134
|
} else {
|
|
127
135
|
let keys: string = `${Object.keys(collection)}`;
|
|
128
|
-
keys = keys.replace(/,/g, '\n
|
|
129
|
-
throw new Error(
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
136
|
+
keys = keys.replace(/,/g, '\n ');
|
|
137
|
+
throw new Error(
|
|
138
|
+
`\nDBE_Global_S.getDBService failed ERROR:
|
|
139
|
+
no dbService on collection with this key: ${key}!
|
|
140
|
+
The available dbServices on collection:
|
|
141
|
+
${keys}\n`);
|
|
133
142
|
}
|
|
134
143
|
}
|
|
135
144
|
|
|
136
145
|
static getEmailServiceCollection(): DynamoBEEmailServiceCollection {
|
|
137
146
|
if (!this.instance?.emailServiceCollection) {
|
|
138
|
-
throw new Error(
|
|
147
|
+
throw new Error(
|
|
148
|
+
`Unique Email Service Collection missing!` +
|
|
139
149
|
`\nPlease create a Unique Email Service Collection extending DynamoBEEmailServiceCollection, ` +
|
|
140
150
|
`and Setup with "DBE_Global_SC.setServices(...)"`);
|
|
141
151
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { Router } from 'express';
|
|
3
|
+
import { dynamoBEGlobalSettings } from '../dynamobe-global.settings';
|
|
3
4
|
import { DynamoBERouteSecurity } from '../_enums/dynamobe-route-security.enum';
|
|
4
5
|
import { HttpCallType } from '../_enums/http/http-call-type.enum';
|
|
5
6
|
import { DynamoBEEndpointParams } from '../_models/dynamobe-endpoint-params';
|
|
@@ -8,7 +9,13 @@ import { DynamoBEController } from './dynamobe-controller.service';
|
|
|
8
9
|
import { DBE_Global_S } from './dynamobe-global.service';
|
|
9
10
|
import { DBE_Shared } from './dynamobe-shared.service';
|
|
10
11
|
|
|
11
|
-
export
|
|
12
|
+
export interface DynamoBERoutingModuleSettings {
|
|
13
|
+
route: string;
|
|
14
|
+
controllers: DynamoBEController[];
|
|
15
|
+
securityOverride?: DynamoBERouteSecurity;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export class DynamoBERoutingModule {
|
|
12
19
|
|
|
13
20
|
security: DynamoBERouteSecurity;
|
|
14
21
|
route: string;
|
|
@@ -22,14 +29,10 @@ export class DynamoBERountingModule {
|
|
|
22
29
|
protected log: boolean = DBE_Global_S.getGlobalSettings().logSetup;
|
|
23
30
|
|
|
24
31
|
constructor(
|
|
25
|
-
set:
|
|
26
|
-
route: string,
|
|
27
|
-
controllers: DynamoBEController[],
|
|
28
|
-
securityOverride?: DynamoBERouteSecurity,
|
|
29
|
-
}
|
|
32
|
+
set: DynamoBERoutingModuleSettings
|
|
30
33
|
){
|
|
31
34
|
try {
|
|
32
|
-
this.route = set.route;
|
|
35
|
+
this.route = dynamoBEGlobalSettings.baseUrl + set.route;
|
|
33
36
|
this.controllers = set.controllers;
|
|
34
37
|
this.setupRoutes();
|
|
35
38
|
this.mountRoutes(set.securityOverride);
|
|
@@ -40,10 +43,15 @@ export class DynamoBERountingModule {
|
|
|
40
43
|
}
|
|
41
44
|
}
|
|
42
45
|
|
|
46
|
+
/* securityOverride(securityOverride: DynamoBERouteSecurity): void {
|
|
47
|
+
this.resetRouters();
|
|
48
|
+
this.mountRoutes(securityOverride);
|
|
49
|
+
} */
|
|
50
|
+
|
|
43
51
|
/**
|
|
44
52
|
* You must setup endpoints and required services in this function
|
|
45
53
|
*/
|
|
46
|
-
setupRoutes(): void {
|
|
54
|
+
private setupRoutes(): void {
|
|
47
55
|
this.controllers.forEach((controller: DynamoBEController) => {
|
|
48
56
|
this.endpoints.push(...controller.endpoints);
|
|
49
57
|
});
|
|
@@ -142,4 +150,9 @@ export class DynamoBERountingModule {
|
|
|
142
150
|
throw new DynamoBEError({ message: `DYNAMOBEERROR: INVALID route type: ${endpointParams.type} - ${endpointParams.name}` })
|
|
143
151
|
}
|
|
144
152
|
}
|
|
153
|
+
|
|
154
|
+
/* private resetRouters(): void {
|
|
155
|
+
this.openRouter = Router();
|
|
156
|
+
this.secureRouter = Router();
|
|
157
|
+
} */
|
|
145
158
|
}
|
|
@@ -2,6 +2,7 @@ import { DynamoBERouteSecurity } from './_enums/dynamobe-route-security.enum';
|
|
|
2
2
|
import { DynamoBEGlobalSettings } from './_models/dynamobe-global-settings';
|
|
3
3
|
|
|
4
4
|
export const dynamoBEGlobalSettings: DynamoBEGlobalSettings = {
|
|
5
|
+
baseUrl: '/api',
|
|
5
6
|
defaultRouteSecurity: DynamoBERouteSecurity.open,
|
|
6
7
|
logSetup: false,
|
|
7
8
|
logRequests: true,
|