@futdevpro/nts-dynamo 1.3.68 → 1.3.69
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/fullstack/module-settings/test-module-settings.d.ts +3 -0
- package/lib/_constants/fullstack/module-settings/test-module-settings.d.ts.map +1 -0
- package/lib/_constants/fullstack/module-settings/test-module-settings.js +16 -0
- package/lib/_constants/fullstack/module-settings/test-module-settings.js.map +1 -0
- package/lib/_constants/fullstack/module-settings/usage-module-settings.d.ts +3 -0
- package/lib/_constants/fullstack/module-settings/usage-module-settings.d.ts.map +1 -0
- package/lib/_constants/fullstack/module-settings/usage-module-settings.js +13 -0
- package/lib/_constants/fullstack/module-settings/usage-module-settings.js.map +1 -0
- package/lib/_models/dynamo-module-settings.d.ts +7 -0
- package/lib/_models/dynamo-module-settings.d.ts.map +1 -0
- package/lib/_models/dynamo-module-settings.js +3 -0
- package/lib/_models/dynamo-module-settings.js.map +1 -0
- package/lib/_models/dynamobe-data-model-params.d.ts +1 -1
- package/lib/_models/dynamobe-data-model-params.d.ts.map +1 -1
- package/lib/_models/dynamobe-endpoint-params.d.ts +30 -0
- package/lib/_models/dynamobe-endpoint-params.d.ts.map +1 -0
- package/lib/_models/dynamobe-endpoint-params.js +95 -0
- package/lib/_models/dynamobe-endpoint-params.js.map +1 -0
- package/lib/_models/fullstack-models/control-models/daily-usage-data.d.ts.map +1 -1
- package/lib/_models/fullstack-models/control-models/daily-usage-data.js.map +1 -1
- package/lib/_models/fullstack-models/control-models/dynamobe-data-params.d.ts.map +1 -1
- package/lib/_models/fullstack-models/control-models/dynamobe-data-params.js.map +1 -1
- package/lib/_models/fullstack-models/control-models/dynamobe-data-property-params.d.ts.map +1 -1
- package/lib/_models/fullstack-models/control-models/dynamobe-data-property-params.js.map +1 -1
- package/lib/_models/fullstack-models/control-models/dynamobe-error.d.ts.map +1 -1
- package/lib/_models/fullstack-models/control-models/dynamobe-error.js.map +1 -1
- package/lib/_models/fullstack-models/control-models/geo-ip-location.d.ts.map +1 -1
- package/lib/_models/fullstack-models/control-models/geo-ip-location.js.map +1 -1
- package/lib/_models/fullstack-models/control-models/usage-action.d.ts.map +1 -1
- package/lib/_models/fullstack-models/control-models/usage-action.js.map +1 -1
- package/lib/_models/fullstack-models/control-models/usage-data.d.ts.map +1 -1
- package/lib/_models/fullstack-models/control-models/usage-data.js.map +1 -1
- package/lib/_models/fullstack-models/data-models/custom-data.d.ts.map +1 -1
- package/lib/_models/fullstack-models/data-models/custom-data.js.map +1 -1
- package/lib/_models/fullstack-models/data-models/metadata.d.ts.map +1 -1
- package/lib/_models/fullstack-models/data-models/metadata.js.map +1 -1
- package/lib/_models/fullstack-models/data-models/usage-session.d.ts.map +1 -1
- package/lib/_models/fullstack-models/data-models/usage-session.js.map +1 -1
- package/lib/_models/index.d.ts +11 -11
- package/lib/_models/index.d.ts.map +1 -1
- package/lib/_models/index.js +12 -23
- package/lib/_models/index.js.map +1 -1
- package/lib/_modules/test/custom-data.service.d.ts +6 -0
- package/lib/_modules/test/custom-data.service.d.ts.map +1 -0
- package/lib/_modules/test/custom-data.service.js +12 -0
- package/lib/_modules/test/custom-data.service.js.map +1 -0
- package/lib/_modules/test/index.d.ts +4 -0
- package/lib/_modules/test/index.d.ts.map +1 -0
- package/lib/_modules/test/index.js +8 -0
- package/lib/_modules/test/index.js.map +1 -0
- package/lib/_modules/test/test-controller.d.ts +6 -0
- package/lib/_modules/test/test-controller.d.ts.map +1 -0
- package/lib/_modules/test/test-controller.js +127 -0
- package/lib/_modules/test/test-controller.js.map +1 -0
- package/lib/_modules/test/test-routing-module.d.ts +3 -0
- package/lib/_modules/test/test-routing-module.d.ts.map +1 -0
- package/lib/_modules/test/test-routing-module.js +10 -0
- package/lib/_modules/test/test-routing-module.js.map +1 -0
- package/lib/_modules/test-route/custom-data.service.d.ts +1 -1
- package/lib/_modules/test-route/custom-data.service.js +1 -1
- package/lib/_modules/usage/index.d.ts +4 -0
- package/lib/_modules/usage/index.d.ts.map +1 -0
- package/lib/_modules/usage/index.js +8 -0
- package/lib/_modules/usage/index.js.map +1 -0
- package/lib/_modules/usage/usage-controller.d.ts +7 -0
- package/lib/_modules/usage/usage-controller.d.ts.map +1 -0
- package/lib/_modules/usage/usage-controller.js +90 -0
- package/lib/_modules/usage/usage-controller.js.map +1 -0
- package/lib/_modules/usage/usage-routing-module.d.ts +3 -0
- package/lib/_modules/usage/usage-routing-module.d.ts.map +1 -0
- package/lib/_modules/usage/usage-routing-module.js +10 -0
- package/lib/_modules/usage/usage-routing-module.js.map +1 -0
- package/lib/_modules/usage/usage.service.d.ts +19 -0
- package/lib/_modules/usage/usage.service.d.ts.map +1 -0
- package/lib/_modules/usage/usage.service.js +110 -0
- package/lib/_modules/usage/usage.service.js.map +1 -0
- package/lib/_modules/usage-route/usage-controller.js +1 -1
- package/lib/_modules/usage-route/usage.service.d.ts +3 -3
- package/lib/_modules/usage-route/usage.service.js +3 -3
- package/lib/_services/dynamobe-api.service.js +1 -1
- package/lib/_services/dynamobe-api.service.js.map +1 -1
- package/lib/_services/dynamobe-app.d.ts.map +1 -1
- package/lib/_services/dynamobe-app.js +11 -9
- package/lib/_services/dynamobe-app.js.map +1 -1
- package/lib/_services/dynamobe-auth.service.js +1 -1
- package/lib/_services/dynamobe-auth.service.js.map +1 -1
- package/lib/_services/dynamobe-controller.service.d.ts +1 -1
- package/lib/_services/dynamobe-controller.service.d.ts.map +1 -1
- package/lib/_services/dynamobe-data.service.d.ts +3 -3
- package/lib/_services/dynamobe-data.service.d.ts.map +1 -1
- package/lib/_services/dynamobe-data.service.js +1 -1
- package/lib/_services/dynamobe-data.service.js.map +1 -1
- package/lib/_services/dynamobe-db.service.d.ts +2 -2
- package/lib/_services/dynamobe-db.service.d.ts.map +1 -1
- package/lib/_services/dynamobe-db.service.js +1 -1
- package/lib/_services/dynamobe-db.service.js.map +1 -1
- package/lib/_services/dynamobe-email.service.d.ts.map +1 -1
- package/lib/_services/dynamobe-email.service.js +1 -2
- package/lib/_services/dynamobe-email.service.js.map +1 -1
- package/lib/_services/dynamobe-global.service.d.ts +2 -2
- package/lib/_services/dynamobe-global.service.d.ts.map +1 -1
- package/lib/_services/dynamobe-routing-module.service.d.ts +1 -1
- package/lib/_services/dynamobe-routing-module.service.d.ts.map +1 -1
- package/lib/_services/dynamobe-routing-module.service.js +1 -1
- package/lib/_services/dynamobe-routing-module.service.js.map +1 -1
- package/lib/_services/dynamobe-shared.service.d.ts +2 -2
- package/lib/_services/dynamobe-shared.service.d.ts.map +1 -1
- package/lib/_services/dynamobe-shared.service.js +22 -13
- package/lib/_services/dynamobe-shared.service.js.map +1 -1
- package/lib/_services/index.d.ts +0 -1
- package/lib/_services/index.d.ts.map +1 -1
- package/lib/_services/index.js +0 -1
- package/lib/_services/index.js.map +1 -1
- package/lib/api-service.d.ts +6 -0
- package/lib/api-service.d.ts.map +1 -0
- package/lib/api-service.js +12 -0
- package/lib/api-service.js.map +1 -0
- package/lib/app.d.ts +11 -0
- package/lib/app.d.ts.map +1 -0
- package/lib/app.js +17 -0
- package/lib/app.js.map +1 -0
- package/lib/controller.d.ts +5 -0
- package/lib/controller.d.ts.map +1 -0
- package/lib/controller.js +11 -0
- package/lib/controller.js.map +1 -0
- package/lib/data-models.d.ts +3 -0
- package/lib/data-models.d.ts.map +1 -0
- package/lib/data-models.js +6 -0
- package/lib/data-models.js.map +1 -0
- package/lib/data-service.d.ts +6 -0
- package/lib/data-service.d.ts.map +1 -0
- package/lib/data-service.js +11 -0
- package/lib/data-service.js.map +1 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +427 -287
- package/package.json +87 -31
- package/src/_constants/fullstack/module-settings/test-module-settings.ts +14 -0
- package/src/_constants/fullstack/module-settings/usage-module-settings.ts +12 -0
- package/src/_models/dynamo-module-settings.ts +8 -0
- package/src/_models/dynamobe-data-model-params.ts +1 -1
- package/src/_models/index.ts +12 -24
- package/src/_modules/{test-route → test}/custom-data.service.ts +1 -1
- package/src/_modules/test/index.ts +6 -0
- package/src/_modules/{test-route → test}/test-controller.ts +8 -7
- package/src/_modules/test/test-routing-module.ts +7 -0
- package/src/_modules/usage/index.ts +6 -0
- package/src/_modules/{usage-route → usage}/usage-controller.ts +5 -4
- package/src/_modules/usage/usage-routing-module.ts +7 -0
- package/src/_modules/{usage-route → usage}/usage.service.ts +4 -4
- package/src/_services/dynamobe-api.service.ts +1 -1
- package/src/_services/dynamobe-app.ts +12 -10
- package/src/_services/dynamobe-auth.service.ts +1 -1
- package/src/_services/dynamobe-controller.service.ts +1 -1
- package/src/_services/dynamobe-data.service.ts +4 -4
- package/src/_services/dynamobe-db.service.ts +4 -4
- package/src/_services/dynamobe-email.service.ts +2 -4
- package/src/_services/dynamobe-global.service.ts +2 -2
- package/src/_services/dynamobe-routing-module.service.ts +2 -2
- package/src/_services/dynamobe-shared.service.ts +23 -15
- package/src/_services/index.ts +0 -1
- package/src/api-service.ts +11 -0
- package/src/app.ts +16 -0
- package/src/controller.ts +10 -0
- package/src/data-models.ts +3 -0
- package/src/data-service.ts +9 -0
- package/src/index.ts +1 -1
- package/src/sync.ffs_db +0 -0
- package/src/version.json +1 -1
- package/tsconfig.json +6 -4
- package/src/_modules/index.ts +0 -7
- package/src/_services/dynamobe-global-collection.service.ts +0 -57
- package/src/_services/dynamobe-server.ts +0 -226
- /package/src/_models/{dynamobe-endpoint-control.ts → dynamobe-endpoint-params.ts} +0 -0
- /package/src/_models/{fullstack-models → fullstack}/control-models/daily-usage-data.ts +0 -0
- /package/src/_models/{fullstack-models → fullstack}/control-models/dynamobe-data-params.ts +0 -0
- /package/src/_models/{fullstack-models → fullstack}/control-models/dynamobe-data-property-params.ts +0 -0
- /package/src/_models/{fullstack-models → fullstack}/control-models/dynamobe-error.ts +0 -0
- /package/src/_models/{fullstack-models → fullstack}/control-models/geo-ip-location.ts +0 -0
- /package/src/_models/{fullstack-models → fullstack}/control-models/usage-action.ts +0 -0
- /package/src/_models/{fullstack-models → fullstack}/control-models/usage-data.ts +0 -0
- /package/src/_models/{fullstack-models → fullstack}/data-models/custom-data.ts +0 -0
- /package/src/_models/{fullstack-models → fullstack}/data-models/metadata.ts +0 -0
- /package/src/_models/{fullstack-models → fullstack}/data-models/usage-session.ts +0 -0
package/src/app.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
|
|
2
|
+
// SERVICES
|
|
3
|
+
export * from './_services/dynamobe-app';
|
|
4
|
+
export * from './_services/dynamobe-global.service';
|
|
5
|
+
export * from './_services/dynamobe-routing-module.service';
|
|
6
|
+
export * from './_services/dynamobe-shared.service';
|
|
7
|
+
|
|
8
|
+
// MODELS
|
|
9
|
+
export * from './_models/dynamobe-app-params';
|
|
10
|
+
export * from './_models/fullstack/data-models/custom-data';
|
|
11
|
+
export * from './_models/fullstack/data-models/usage-session';
|
|
12
|
+
export * from './_models/dynamobe-endpoint-params';
|
|
13
|
+
export * from './_models/dynamobe-global-settings';
|
|
14
|
+
|
|
15
|
+
// ENUMS
|
|
16
|
+
export * from './_enums/dynamobe-route-security.enum';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
|
|
2
|
+
// SERVICES
|
|
3
|
+
export * from './_services/dynamobe-controller.service';
|
|
4
|
+
|
|
5
|
+
// MODELS
|
|
6
|
+
export * from './_models/dynamobe-endpoint-params';
|
|
7
|
+
|
|
8
|
+
// ENUMS
|
|
9
|
+
export * from './_enums/dynamobe-route-security.enum';
|
|
10
|
+
export * from './_enums/http/http-call-type.enum';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
|
|
2
|
+
// SERVICES
|
|
3
|
+
export * from './_services/dynamobe-data.service';
|
|
4
|
+
export * from './_services/dynamobe-db.service';
|
|
5
|
+
export * from './_services/dynamobe-global.service';
|
|
6
|
+
export * from './_services/dynamobe-shared.service';
|
|
7
|
+
|
|
8
|
+
// MODELS
|
|
9
|
+
export * from './_models/fullstack/control-models/dynamobe-error';
|
package/src/index.ts
CHANGED
package/src/sync.ffs_db
CHANGED
|
Binary file
|
package/src/version.json
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"v01.04.
|
|
2
|
+
"v01.04.03"
|
package/tsconfig.json
CHANGED
|
@@ -4,9 +4,11 @@
|
|
|
4
4
|
"incremental": true, /* Enable incremental compilation */
|
|
5
5
|
"target": "es6", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */
|
|
6
6
|
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
|
|
7
|
-
"lib": [
|
|
7
|
+
"lib": [
|
|
8
|
+
"es6",
|
|
8
9
|
"es2018",
|
|
9
|
-
"dom"
|
|
10
|
+
"dom"
|
|
11
|
+
], /* Specify library files to be included in the compilation. */
|
|
10
12
|
"allowJs": true, /* Allow javascript files to be compiled. */
|
|
11
13
|
// "checkJs": true, /* Report errors in .js files. */
|
|
12
14
|
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
|
|
@@ -41,14 +43,14 @@
|
|
|
41
43
|
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
|
|
42
44
|
|
|
43
45
|
/* Module Resolution Options */
|
|
44
|
-
|
|
46
|
+
"moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
|
|
45
47
|
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
|
|
46
48
|
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
|
|
47
49
|
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
|
|
48
50
|
// "typeRoots": [], /* List of folders to include type definitions from. */
|
|
49
51
|
//"types": [ "./build/src/index.d.ts" ], /* Type declaration files to be included in compilation. */
|
|
50
52
|
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
|
|
51
|
-
|
|
53
|
+
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
|
|
52
54
|
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
|
|
53
55
|
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
|
54
56
|
|
package/src/_modules/index.ts
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
|
|
3
|
-
import { DynamoBEAuthService } from './dynamobe-auth.service';
|
|
4
|
-
import { DynamoBEDBServiceCollection } from './dynamobe-db-service-collection.service';
|
|
5
|
-
import { DynamoBEEmailServiceCollection } from './dynamobe-email-service-collection.service';
|
|
6
|
-
import { DynamoBESingletonService } from './dynamobe-singleton.service';
|
|
7
|
-
|
|
8
|
-
export class DBE_Global_SC extends DynamoBESingletonService { // unused, dont use this for now
|
|
9
|
-
|
|
10
|
-
static getInstance(): DBE_Global_SC {
|
|
11
|
-
return DBE_Global_SC.getSingletonInstance();
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
authService: DynamoBEAuthService;
|
|
15
|
-
dbServiceCollection: DynamoBEDBServiceCollection;
|
|
16
|
-
emailServiceCollection: DynamoBEEmailServiceCollection;
|
|
17
|
-
|
|
18
|
-
static setServices(
|
|
19
|
-
set: {
|
|
20
|
-
authService: DynamoBEAuthService,
|
|
21
|
-
dbServiceCollection: DynamoBEDBServiceCollection,
|
|
22
|
-
emailServiceCollection: DynamoBEEmailServiceCollection,
|
|
23
|
-
}
|
|
24
|
-
): void {
|
|
25
|
-
this.getInstance();
|
|
26
|
-
this.instance.authService = set.authService;
|
|
27
|
-
this.instance.dbServiceCollection = set.dbServiceCollection;
|
|
28
|
-
this.instance.emailServiceCollection = set.emailServiceCollection;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
static getAuthService(): DynamoBEAuthService {
|
|
32
|
-
if (!this.instance?.authService?.authenticateToken) {
|
|
33
|
-
throw new Error(`Unique Authentication Service missing!` +
|
|
34
|
-
`\nPlease create a Unique Authentication Service extending DynamoBEAuthService, ` +
|
|
35
|
-
`and Setup with "DBE_Global_SC.setServices(...)"`);
|
|
36
|
-
}
|
|
37
|
-
return this.instance.authService;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
static getDBServiceCollection(): DynamoBEDBServiceCollection {
|
|
41
|
-
if (!this.instance?.dbServiceCollection) {
|
|
42
|
-
throw new Error(`Unique DataBase Service Collection missing!` +
|
|
43
|
-
`\nPlease create a Unique DataBase Service Collectio extending DynamoBEDBServiceCollection, ` +
|
|
44
|
-
`and Setup with "DBE_Global_SC.setServices(...)"`);
|
|
45
|
-
}
|
|
46
|
-
return this.instance.authService;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
static getEmailServiceCollection(): DynamoBEEmailServiceCollection {
|
|
50
|
-
if (!this.instance?.emailServiceCollection) {
|
|
51
|
-
throw new Error(`Unique Email Service Collection missing!` +
|
|
52
|
-
`\nPlease create a Unique Email Service Collection extending DynamoBEEmailServiceCollection, ` +
|
|
53
|
-
`and Setup with "DBE_Global_SC.setServices(...)"`);
|
|
54
|
-
}
|
|
55
|
-
return this.instance.emailServiceCollection;
|
|
56
|
-
}
|
|
57
|
-
} */
|
|
@@ -1,226 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/* import * as Express from 'express'; */
|
|
4
|
-
import Express = require("express");
|
|
5
|
-
import * as Https from 'https';
|
|
6
|
-
import * as FileSystem from 'fs';
|
|
7
|
-
import * as BodyParser from 'body-parser';
|
|
8
|
-
import { DynamoBERountingModule } from './dynamobe-routing-module.service';
|
|
9
|
-
import { DynamoBESingletonService } from './dynamobe-singleton.service';
|
|
10
|
-
import { DynamoBERouteSecurity } from '../_enums/dynamobe-route-security.enum';
|
|
11
|
-
import { DBE_Shared } from './dynamobe-shared.service';
|
|
12
|
-
import { DynamoBEEndpointParams } from '../_models/dynamobe-endpoint-control';
|
|
13
|
-
import { DBE_Global_S } from './dynamobe-global.service';
|
|
14
|
-
|
|
15
|
-
export abstract class DynamoBEServer extends DynamoBESingletonService {
|
|
16
|
-
|
|
17
|
-
protected security: DynamoBERouteSecurity;
|
|
18
|
-
|
|
19
|
-
protected httpPort?: number;
|
|
20
|
-
protected httpsPort?: number;
|
|
21
|
-
|
|
22
|
-
protected cert?: {
|
|
23
|
-
keyPath: FileSystem.PathLike,
|
|
24
|
-
certPath: FileSystem.PathLike,
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
private secureExpress: Express.Application;
|
|
28
|
-
private httpsServer: Https.Server;
|
|
29
|
-
private openExpress: Express.Application;
|
|
30
|
-
|
|
31
|
-
protected routingModules: DynamoBERountingModule[];
|
|
32
|
-
|
|
33
|
-
protected log: boolean = DBE_Global_S.getGlobalSettings().logSetup;
|
|
34
|
-
|
|
35
|
-
protected constructor(){
|
|
36
|
-
super();
|
|
37
|
-
|
|
38
|
-
try {
|
|
39
|
-
this.setupRoutingModules();
|
|
40
|
-
this.setSecurity();
|
|
41
|
-
|
|
42
|
-
this.initExpresses();
|
|
43
|
-
this.startExpresses();
|
|
44
|
-
|
|
45
|
-
if (this.security !== DynamoBERouteSecurity.secure) {
|
|
46
|
-
this.mountOpenRoutes();
|
|
47
|
-
}
|
|
48
|
-
if (this.security !== DynamoBERouteSecurity.open && this.cert) {
|
|
49
|
-
this.mountSecureRoutes();
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
if (this.log) console.log(`\nRoutes mounted.... server using security: ${this.security}`);
|
|
53
|
-
} catch (error) {
|
|
54
|
-
DBE_Shared.logError('DynamoBEServer ERROR: Server start failed:', error);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
private initExpresses() {
|
|
59
|
-
if (this.security !== DynamoBERouteSecurity.secure) {
|
|
60
|
-
if (!this.httpPort) {
|
|
61
|
-
let errorMsg: string =
|
|
62
|
-
`You have open routes, but httpPort is not set!` +
|
|
63
|
-
`\nsecurity: ${this.security}` +
|
|
64
|
-
`\nset httpPort in DynamoBEServer - setupRoutingModules() to enable secure routes.`;
|
|
65
|
-
|
|
66
|
-
errorMsg += '\n\nThe routes setted to use open server:';
|
|
67
|
-
this.routingModules.forEach((module: DynamoBERountingModule) => {
|
|
68
|
-
if (module.security != DynamoBERouteSecurity.secure) {
|
|
69
|
-
errorMsg += `\n ${module.route} (security: ${module.security}) \n subroutes using open sever:`;
|
|
70
|
-
module.endpoints.forEach((endpoint: DynamoBEEndpointParams) => {
|
|
71
|
-
if (endpoint.security != DynamoBERouteSecurity.secure) {
|
|
72
|
-
errorMsg += `\n ${endpoint.endpoint} (security: ${endpoint.security})`;
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
DBE_Shared.logError(errorMsg);
|
|
78
|
-
|
|
79
|
-
let error = new Error('Open routes cannot be established!');
|
|
80
|
-
let errorStack: string[] = error.stack.split('\n');
|
|
81
|
-
errorStack.splice(1, 2);
|
|
82
|
-
error.stack = errorStack.join('\n');
|
|
83
|
-
|
|
84
|
-
throw error;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
this.initOpenExpress();
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
if (this.security !== DynamoBERouteSecurity.open) {
|
|
91
|
-
if (!this.cert || !this.httpsPort) {
|
|
92
|
-
let errorMsg: string =
|
|
93
|
-
`You have secure routes, but the certification paths or httpsPort are not set!` +
|
|
94
|
-
`\nsecurity: ${this.security}` +
|
|
95
|
-
`\nset...` +
|
|
96
|
-
`\n httpsPort and` +
|
|
97
|
-
`\n cert: {` +
|
|
98
|
-
`\n keyPath: FileSystem.PathLike,` +
|
|
99
|
-
`\n certPath: FileSystem.PathLike,` +
|
|
100
|
-
`\n }` +
|
|
101
|
-
`\nin DynamoBEServer - setupRoutingModules() to enable secure routes.`;
|
|
102
|
-
|
|
103
|
-
errorMsg += '\n\nThe routes setted to use secure server:';
|
|
104
|
-
this.routingModules.forEach((module: DynamoBERountingModule) => {
|
|
105
|
-
if (module.security != DynamoBERouteSecurity.open) {
|
|
106
|
-
errorMsg += `\n ${module.route} (security: ${module.security}) \n subroutes using secure sever:`;
|
|
107
|
-
module.endpoints.forEach((endpoint: DynamoBEEndpointParams) => {
|
|
108
|
-
if (endpoint.security != DynamoBERouteSecurity.open) {
|
|
109
|
-
errorMsg += `\n ${endpoint.endpoint} (security: ${endpoint.security})`;
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
DBE_Shared.logError(errorMsg);
|
|
115
|
-
|
|
116
|
-
let error = new Error('Secure routes cannot be established!');
|
|
117
|
-
let errorStack: string[] = error.stack.split('\n');
|
|
118
|
-
errorStack.splice(1, 2);
|
|
119
|
-
error.stack = errorStack.join('\n');
|
|
120
|
-
|
|
121
|
-
throw error;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
this.initSecureExpress();
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
private initOpenExpress(): void {
|
|
129
|
-
this.openExpress = Express();
|
|
130
|
-
this.openExpress.use(BodyParser.urlencoded({ limit: '50mb', extended: true }));
|
|
131
|
-
this.openExpress.use(BodyParser.json({ limit: '50mb' }));
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
private initSecureExpress(): void {
|
|
135
|
-
this.secureExpress = Express();
|
|
136
|
-
this.secureExpress.use(BodyParser.urlencoded({ limit: '50mb', extended: true }));
|
|
137
|
-
this.secureExpress.use(BodyParser.json({ limit: '50mb' }));
|
|
138
|
-
|
|
139
|
-
const options = {
|
|
140
|
-
key: FileSystem.readFileSync(this.cert.keyPath),
|
|
141
|
-
cert: FileSystem.readFileSync(this.cert.certPath),
|
|
142
|
-
};
|
|
143
|
-
this.httpsServer = Https.createServer(options, this.secureExpress);
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
private async startExpresses(): Promise<void> {
|
|
147
|
-
if (this.security !== DynamoBERouteSecurity.open) {
|
|
148
|
-
this.httpsServer
|
|
149
|
-
.listen(this.httpsPort, 'localhost', 0, () => {
|
|
150
|
-
DBE_Shared.logSuccess(`\nHTTPS (secure) server is listening on port ${this.httpsPort}\n`);
|
|
151
|
-
})
|
|
152
|
-
.on('error', (error) => {
|
|
153
|
-
DBE_Shared.logError(`https (secure) server ERROR`, error);
|
|
154
|
-
})
|
|
155
|
-
.on('uncaughtException', (ex) => {
|
|
156
|
-
DBE_Shared.logWarning(`https (secure) server uncaughtException`, ex);
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
if (this.security !== DynamoBERouteSecurity.secure) {
|
|
161
|
-
this.openExpress
|
|
162
|
-
.listen(this.httpPort, () => {
|
|
163
|
-
DBE_Shared.logSuccess(`\nHTTP (-open-) server is listening on port ${this.httpPort}\n`);
|
|
164
|
-
})
|
|
165
|
-
.on('error', (error) => {
|
|
166
|
-
DBE_Shared.logError(`http (-open-) server ERROR`, error);
|
|
167
|
-
})
|
|
168
|
-
.on('uncaughtException', (ex) => {
|
|
169
|
-
DBE_Shared.logWarning(`http (-open-) server uncaughtException`, ex);
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
private mountSecureRoutes (): void {
|
|
175
|
-
this.routingModules.forEach((module: DynamoBERountingModule) => {
|
|
176
|
-
if (module.security !== DynamoBERouteSecurity.open) {
|
|
177
|
-
if (this.log) console.log(`route mount (secure): ${module.route}`);
|
|
178
|
-
const existingRoutes: DynamoBERountingModule[] = this.routingModules.filter(
|
|
179
|
-
(mod: DynamoBERountingModule) => mod.route === module.route);
|
|
180
|
-
if (1 < existingRoutes.length) {
|
|
181
|
-
let error = new Error(`ROUTE DUPLICATION: ${module.route}`);
|
|
182
|
-
let errorStack: string[] = error.stack.split('\n');
|
|
183
|
-
errorStack.splice(1, 4);
|
|
184
|
-
error.stack = errorStack.join('\n');
|
|
185
|
-
|
|
186
|
-
throw error;
|
|
187
|
-
}
|
|
188
|
-
this.secureExpress.use(module.route, module.secureRouter);
|
|
189
|
-
}
|
|
190
|
-
});
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
private mountOpenRoutes (): void {
|
|
194
|
-
this.routingModules.forEach((module: DynamoBERountingModule) => {
|
|
195
|
-
if (module.security !== DynamoBERouteSecurity.secure) {
|
|
196
|
-
if (this.log) console.log(`route mount (open): ${module.route}`);
|
|
197
|
-
const existingRoutes: DynamoBERountingModule[] = this.routingModules.filter(
|
|
198
|
-
(mod: DynamoBERountingModule) => mod.route === module.route);
|
|
199
|
-
if (1 < existingRoutes.length) {
|
|
200
|
-
let error = new Error(`ROUTE DUPLICATION: ${module.route}`);
|
|
201
|
-
let errorStack: string[] = error.stack.split('\n');
|
|
202
|
-
errorStack.splice(1, 4);
|
|
203
|
-
error.stack = errorStack.join('\n');
|
|
204
|
-
|
|
205
|
-
throw error;
|
|
206
|
-
}
|
|
207
|
-
this.openExpress.use(module.route, module.openRouter);
|
|
208
|
-
}
|
|
209
|
-
});
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
private setSecurity(): void {
|
|
213
|
-
this.routingModules.forEach((module: DynamoBERountingModule) => {
|
|
214
|
-
if (!this.security) {
|
|
215
|
-
this.security = module.security;
|
|
216
|
-
} else if (this.security !== module.security) {
|
|
217
|
-
this.security = DynamoBERouteSecurity.both;
|
|
218
|
-
}
|
|
219
|
-
});
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
/**
|
|
223
|
-
* You must setup endpoints and required services in this function
|
|
224
|
-
*/
|
|
225
|
-
abstract setupRoutingModules(): void;
|
|
226
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/src/_models/{fullstack-models → fullstack}/control-models/dynamobe-data-property-params.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|