@futdevpro/nts-dynamo 1.5.94 → 1.5.96
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/_models/control-models/dynamo-nts-socket-client-service-params.model.d.ts +1 -1
- package/lib/_models/control-models/dynamo-nts-socket-client-service-params.model.d.ts.map +1 -1
- package/lib/_models/control-models/dynamo-nts-socket-client-service-params.model.js +1 -1
- package/lib/_models/control-models/dynamo-nts-socket-client-service-params.model.js.map +1 -1
- package/lib/_models/control-models/dynamo-nts-socket-event.model.d.ts +4 -4
- package/lib/_models/control-models/dynamo-nts-socket-event.model.d.ts.map +1 -1
- package/lib/_models/control-models/dynamo-nts-socket-event.model.js +6 -6
- package/lib/_models/control-models/dynamo-nts-socket-event.model.js.map +1 -1
- package/lib/_modules/app-extended.index.d.ts +1 -1
- package/lib/_modules/app-extended.index.d.ts.map +1 -1
- package/lib/_modules/app-extended.index.js +1 -1
- package/lib/_modules/app-extended.index.js.map +1 -1
- package/lib/_modules/app.index.d.ts +1 -1
- package/lib/_modules/app.index.d.ts.map +1 -1
- package/lib/_modules/app.index.js +1 -1
- package/lib/_modules/app.index.js.map +1 -1
- package/lib/_services/dynamo-nts-app-extended.server.d.ts +129 -0
- package/lib/_services/dynamo-nts-app-extended.server.d.ts.map +1 -0
- package/lib/_services/dynamo-nts-app-extended.server.js +213 -0
- package/lib/_services/dynamo-nts-app-extended.server.js.map +1 -0
- package/lib/_services/dynamo-nts-app.server.d.ts +275 -0
- package/lib/_services/dynamo-nts-app.server.d.ts.map +1 -0
- package/lib/_services/dynamo-nts-app.server.js +372 -0
- package/lib/_services/dynamo-nts-app.server.js.map +1 -0
- package/lib/_services/dynamo-nts-app.server.spec.d.ts +1 -0
- package/lib/_services/dynamo-nts-app.server.spec.d.ts.map +1 -0
- package/lib/_services/dynamo-nts-app.server.spec.js +10 -0
- package/lib/_services/dynamo-nts-app.server.spec.js.map +1 -0
- package/lib/_services/dynamo-nts-socket-client.service.d.ts +8 -1
- package/lib/_services/dynamo-nts-socket-client.service.d.ts.map +1 -1
- package/lib/_services/dynamo-nts-socket-client.service.js +40 -18
- package/lib/_services/dynamo-nts-socket-client.service.js.map +1 -1
- package/lib/_services/dynamo-nts-socket-server.service.d.ts.map +1 -1
- package/lib/_services/dynamo-nts-socket-server.service.js +9 -13
- package/lib/_services/dynamo-nts-socket-server.service.js.map +1 -1
- package/lib/_services/index.d.ts +2 -2
- package/lib/_services/index.d.ts.map +1 -1
- package/lib/_services/index.js +2 -2
- package/lib/_services/index.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/_models/control-models/dynamo-nts-socket-client-service-params.model.ts +1 -1
- package/src/_models/control-models/dynamo-nts-socket-event.model.ts +10 -10
- package/src/_modules/app-extended.index.ts +1 -1
- package/src/_modules/app.index.ts +1 -1
- package/src/_services/{dynamo-nts-app-extended.ts → dynamo-nts-app-extended.server.ts} +1 -1
- package/src/_services/dynamo-nts-socket-client.service.ts +40 -15
- package/src/_services/dynamo-nts-socket-server.service.ts +9 -14
- package/src/_services/index.ts +2 -2
- /package/src/_services/{dynamo-nts-app.spec.ts → dynamo-nts-app.server.spec.ts} +0 -0
- /package/src/_services/{dynamo-nts-app.ts → dynamo-nts-app.server.ts} +0 -0
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import Mongoose = require("mongoose");
|
|
3
|
+
import Express = require("express");
|
|
4
|
+
import * as Https from 'https';
|
|
5
|
+
import { DynamoNTS_SingletonService } from './dynamo-nts-singleton.service';
|
|
6
|
+
import { DynamoNTS_RouteSecurity } from '../_enums/dynamo-nts-route-security.enum';
|
|
7
|
+
import { DynamoNTS_RoutingModule } from './dynamo-nts-routing-module.service';
|
|
8
|
+
import { DynamoNTS_PortSettings } from '../_models/interfaces/dynamo-nts-port-settings.interface';
|
|
9
|
+
import { DynamoNTS_CertificationSettings } from '../_models/interfaces/dynamo-nts-certification-settings.interface';
|
|
10
|
+
import { DynamoNTS_GlobalServiceSettings } from '../_models/interfaces/dynamo-nts-global-service-settings.interface';
|
|
11
|
+
import { DynamoNTS_AppParams } from '../_models/control-models/dynamo-nts-app-params.model';
|
|
12
|
+
/**
|
|
13
|
+
* This will be the MAIN service of our server project,
|
|
14
|
+
* follow the types and type instructions while setting up your project
|
|
15
|
+
*
|
|
16
|
+
* In this service, there are abstract functions that you will need to implement,
|
|
17
|
+
* where you need to set up the main params for your application.
|
|
18
|
+
*
|
|
19
|
+
* (after the example, you can find the list of services you can/should setup)
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* export class App extends DynamoNTS_AppExtended {
|
|
23
|
+
*
|
|
24
|
+
* ...
|
|
25
|
+
*
|
|
26
|
+
* // Setting up App params, and preparing project global settings
|
|
27
|
+
* setupAppParams(): void {
|
|
28
|
+
* this.params = new DynamoNTS_AppParams({
|
|
29
|
+
* name: 'Warbots Server',
|
|
30
|
+
* title: warbotsTitleLog,
|
|
31
|
+
* version: version,
|
|
32
|
+
* dbName: 'warbots',
|
|
33
|
+
* });
|
|
34
|
+
*
|
|
35
|
+
* // dynamoNTS_GlobalSettings.logRequestsContent = false;
|
|
36
|
+
* }
|
|
37
|
+
*
|
|
38
|
+
* ...
|
|
39
|
+
*
|
|
40
|
+
* // Setting up DBServices
|
|
41
|
+
* setGlobalServiceCollection(): void {
|
|
42
|
+
* DynamoNTS_GlobalService.setServices({
|
|
43
|
+
* authService: AuthService.getInstance(),
|
|
44
|
+
* emailServiceCollection: EmailServiceCollectionService.getInstance(),
|
|
45
|
+
* dbModels: [
|
|
46
|
+
* userModelParams,
|
|
47
|
+
* userDataModelParams,
|
|
48
|
+
* userOptionsModelParams,
|
|
49
|
+
* userStatisticsModelParams,
|
|
50
|
+
* userAchievementsModelParams,
|
|
51
|
+
* userNotificationsModelParams,
|
|
52
|
+
*
|
|
53
|
+
* matchStatisticsModelParams,
|
|
54
|
+
* matchDataModelParams,
|
|
55
|
+
|
|
56
|
+
* usageSessionModelParams,
|
|
57
|
+
* customDataModelParams,
|
|
58
|
+
* ]
|
|
59
|
+
* });
|
|
60
|
+
* }
|
|
61
|
+
*
|
|
62
|
+
* ...
|
|
63
|
+
*
|
|
64
|
+
* // Setting up Routes
|
|
65
|
+
* setupRoutingModules(): void {
|
|
66
|
+
* this.httpPort = env.port;
|
|
67
|
+
|
|
68
|
+
* this.routingModules = [
|
|
69
|
+
* new DynamoNTS_RoutingModule({
|
|
70
|
+
* route: '/user',
|
|
71
|
+
* controllers: [
|
|
72
|
+
* UserController.getInstance(),
|
|
73
|
+
* UserDataController.getInstance(),
|
|
74
|
+
* UserOptionsController.getInstance(),
|
|
75
|
+
* UserStatisticsController.getInstance(),
|
|
76
|
+
* UserAchievementsController.getInstance(),
|
|
77
|
+
* UserNotificationsController.getInstance()
|
|
78
|
+
* ]
|
|
79
|
+
* }),
|
|
80
|
+
* new DynamoNTS_RoutingModule({
|
|
81
|
+
* route: '/match',
|
|
82
|
+
* controllers: [
|
|
83
|
+
* MatchController.getInstance(),
|
|
84
|
+
* MatchDistributionController.getInstance(),
|
|
85
|
+
* MatchStatisticsController.getInstance(),
|
|
86
|
+
* ]
|
|
87
|
+
* }),
|
|
88
|
+
* new DynamoNTS_RoutingModule({
|
|
89
|
+
* route: '/server',
|
|
90
|
+
* controllers: [
|
|
91
|
+
* ServerController.getInstance(),
|
|
92
|
+
* ]
|
|
93
|
+
* }),
|
|
94
|
+
|
|
95
|
+
* getTestRoutingModule(),
|
|
96
|
+
* getUsageRoutingModule()
|
|
97
|
+
* ];
|
|
98
|
+
* }
|
|
99
|
+
* }
|
|
100
|
+
*
|
|
101
|
+
* //
|
|
102
|
+
* // The Services available
|
|
103
|
+
* //
|
|
104
|
+
* // Authentication Service
|
|
105
|
+
* // A commonly used basic service,
|
|
106
|
+
* // which is necessary fur certain functions (such as registering call issuers)
|
|
107
|
+
* //
|
|
108
|
+
* // This will handle Authentication Token checking/refreshing, checking issuer's identifier and routeParams,
|
|
109
|
+
* // handling JWT Token, or maybe with OAuth2 or other commonly used security procedures
|
|
110
|
+
* //
|
|
111
|
+
* // You can create one with this Dynamo Object:
|
|
112
|
+
* //
|
|
113
|
+
*
|
|
114
|
+
* @example
|
|
115
|
+
* // follow the instructions on the abstract class (DynamoNTS_AuthService)
|
|
116
|
+
* export class AuthService extends DynamoNTS_AuthService {}
|
|
117
|
+
*
|
|
118
|
+
*
|
|
119
|
+
*
|
|
120
|
+
* //
|
|
121
|
+
*/
|
|
122
|
+
export declare abstract class DynamoNTS_App extends DynamoNTS_SingletonService {
|
|
123
|
+
private _params;
|
|
124
|
+
protected get params(): DynamoNTS_AppParams;
|
|
125
|
+
protected mongoose: typeof Mongoose;
|
|
126
|
+
private _security;
|
|
127
|
+
protected get security(): DynamoNTS_RouteSecurity;
|
|
128
|
+
protected _ports: DynamoNTS_PortSettings;
|
|
129
|
+
protected get ports(): DynamoNTS_PortSettings;
|
|
130
|
+
private _cert?;
|
|
131
|
+
protected get cert(): DynamoNTS_CertificationSettings;
|
|
132
|
+
protected openExpress: Express.Application;
|
|
133
|
+
private secureExpress;
|
|
134
|
+
protected httpsServer: Https.Server;
|
|
135
|
+
private _routingModules;
|
|
136
|
+
private _rootServices;
|
|
137
|
+
/**
|
|
138
|
+
* setting this value to true, enables this service debug logs
|
|
139
|
+
*/
|
|
140
|
+
protected debugLog: boolean;
|
|
141
|
+
constructor();
|
|
142
|
+
/**
|
|
143
|
+
*
|
|
144
|
+
*/
|
|
145
|
+
private startDB;
|
|
146
|
+
/**
|
|
147
|
+
*
|
|
148
|
+
*/
|
|
149
|
+
private initExpresses;
|
|
150
|
+
/**
|
|
151
|
+
*
|
|
152
|
+
*/
|
|
153
|
+
protected initOpenExpress(): void;
|
|
154
|
+
/**
|
|
155
|
+
*
|
|
156
|
+
*/
|
|
157
|
+
protected initSecureExpress(): void;
|
|
158
|
+
/**
|
|
159
|
+
*
|
|
160
|
+
*/
|
|
161
|
+
private startExpresses;
|
|
162
|
+
/**
|
|
163
|
+
*
|
|
164
|
+
*/
|
|
165
|
+
private mountSecureRoutes;
|
|
166
|
+
/**
|
|
167
|
+
*
|
|
168
|
+
*/
|
|
169
|
+
private mountOpenRoutes;
|
|
170
|
+
/**
|
|
171
|
+
*
|
|
172
|
+
*/
|
|
173
|
+
private setSecurity;
|
|
174
|
+
/**
|
|
175
|
+
* #OUTDATED
|
|
176
|
+
* Setting up App params, and preparing project global settings
|
|
177
|
+
* You must setup app params in this function like this:
|
|
178
|
+
*
|
|
179
|
+
* @example
|
|
180
|
+
* setupAppParams(): void {
|
|
181
|
+
* this.params = new DynamoBEAppParams({
|
|
182
|
+
* name: 'Sample Server',
|
|
183
|
+
* title: 'A BIG nice header that will be logged on start',
|
|
184
|
+
* version: version,
|
|
185
|
+
* dbName: 'sampleapp',
|
|
186
|
+
* });
|
|
187
|
+
*
|
|
188
|
+
* DBE_Global_S.setGlobalSettings({
|
|
189
|
+
* defaultRouteSecurity: DynamoBERouteSecurity.secure,
|
|
190
|
+
* logSetup: true,
|
|
191
|
+
* });
|
|
192
|
+
* }
|
|
193
|
+
*/
|
|
194
|
+
abstract getAppParams(): DynamoNTS_AppParams;
|
|
195
|
+
/**
|
|
196
|
+
* MISSING Description (TODO)
|
|
197
|
+
*/
|
|
198
|
+
abstract overrideDynamoNTSGlobalSettings?(): void;
|
|
199
|
+
/**
|
|
200
|
+
* #OUTDATED
|
|
201
|
+
* Setting up DBServices
|
|
202
|
+
* You must setup globalServiceCollection and dbServices in this function
|
|
203
|
+
*
|
|
204
|
+
* @example
|
|
205
|
+
* setGlobalServiceCollection(): void {
|
|
206
|
+
* DBE_Global_S.setServices({
|
|
207
|
+
* authService: AuthService.getInstance(),
|
|
208
|
+
* emailServiceCollection: EmailServiceCollectionService.getInstance(),
|
|
209
|
+
* dbModels: [
|
|
210
|
+
* accountModelParams,
|
|
211
|
+
* projectModelParams,
|
|
212
|
+
* ...
|
|
213
|
+
* ]
|
|
214
|
+
* });
|
|
215
|
+
* }
|
|
216
|
+
*/
|
|
217
|
+
abstract getGlobalServiceCollection(): DynamoNTS_GlobalServiceSettings;
|
|
218
|
+
/**
|
|
219
|
+
* MISSING Description (TODO)
|
|
220
|
+
*/
|
|
221
|
+
abstract getPortSettings(): DynamoNTS_PortSettings;
|
|
222
|
+
/**
|
|
223
|
+
* #OUTDATED
|
|
224
|
+
* You must setup endpoints and required services in this function
|
|
225
|
+
*
|
|
226
|
+
* @example
|
|
227
|
+
* // Setting up Routes
|
|
228
|
+
* setupRoutingModules(): void {
|
|
229
|
+
* this.httpPort = env.httpPort;
|
|
230
|
+
* this.httpsPort = env.httpsPort;
|
|
231
|
+
*
|
|
232
|
+
* this.cert = {
|
|
233
|
+
* keyPath: Path.join(__dirname, './_assets/cert/ucc.key'),
|
|
234
|
+
* certPath: Path.join(__dirname, './_assets/cert/ucc.crt'),
|
|
235
|
+
* };
|
|
236
|
+
*
|
|
237
|
+
* this.routingModules = [
|
|
238
|
+
* new DynamoBERountingModule({
|
|
239
|
+
* route: '/api/account',
|
|
240
|
+
* controllers: [
|
|
241
|
+
* AccountController.getInstance(),
|
|
242
|
+
* PersonalInformationController.getInstance(),
|
|
243
|
+
* ...
|
|
244
|
+
* ]
|
|
245
|
+
* }),
|
|
246
|
+
* new DynamoBERountingModule({
|
|
247
|
+
* route: '/api/project',
|
|
248
|
+
* controllers: [
|
|
249
|
+
* ProjectController.getInstance(),
|
|
250
|
+
* ProjectExtensionController.getInstance(),
|
|
251
|
+
* ]
|
|
252
|
+
* }),
|
|
253
|
+
* ...
|
|
254
|
+
* ];
|
|
255
|
+
* }
|
|
256
|
+
*/
|
|
257
|
+
abstract getRoutingModules(): DynamoNTS_RoutingModule[];
|
|
258
|
+
/**
|
|
259
|
+
* MISSING Description (TODO)
|
|
260
|
+
*/
|
|
261
|
+
getRootServices?(): DynamoNTS_SingletonService[];
|
|
262
|
+
/**
|
|
263
|
+
* MISSING Description (TODO)
|
|
264
|
+
*/
|
|
265
|
+
getCertificationSettings?(): DynamoNTS_CertificationSettings;
|
|
266
|
+
/**
|
|
267
|
+
* MISSING Description (TODO)
|
|
268
|
+
*/
|
|
269
|
+
createEntries?(): void;
|
|
270
|
+
/**
|
|
271
|
+
* MISSING Description (TODO)
|
|
272
|
+
*/
|
|
273
|
+
postProcess?(): void;
|
|
274
|
+
}
|
|
275
|
+
//# sourceMappingURL=dynamo-nts-app.server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dynamo-nts-app.server.d.ts","sourceRoot":"","sources":["../../src/_services/dynamo-nts-app.server.ts"],"names":[],"mappings":";AACA,OAAO,QAAQ,GAAG,QAAQ,UAAU,CAAC,CAAC;AACtC,OAAO,OAAO,GAAG,QAAQ,SAAS,CAAC,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAC;AACnF,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAE9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,0DAA0D,CAAC;AAClG,OAAO,EAAE,+BAA+B,EAAE,MAAM,mEAAmE,CAAC;AACpH,OAAO,EAAE,+BAA+B,EAAE,MAAM,oEAAoE,CAAC;AAErH,OAAO,EAAE,mBAAmB,EAAE,MAAM,uDAAuD,CAAC;AAG5F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6GG;AACH,8BAAsB,aAAc,SAAQ,0BAA0B;IAEpE,OAAO,CAAC,OAAO,CAAsB;IACrC,SAAS,KAAK,MAAM,IAAI,mBAAmB,CAAyB;IAEpE,SAAS,CAAC,QAAQ,kBAAY;IAE9B,OAAO,CAAC,SAAS,CAA0B;IAC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IACH,wBAAwB,CAAC,IAAI,+BAA+B;IAE5D;;OAEG;IACH,aAAa,CAAC,IAAI,IAAI;IAEtB;;OAEG;IACH,WAAW,CAAC,IAAI,IAAI;CACrB"}
|
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DynamoNTS_App = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const Mongoose = require("mongoose");
|
|
6
|
+
const Express = require("express");
|
|
7
|
+
const Https = tslib_1.__importStar(require("https"));
|
|
8
|
+
const FileSystem = tslib_1.__importStar(require("fs"));
|
|
9
|
+
const BodyParser = tslib_1.__importStar(require("body-parser"));
|
|
10
|
+
const fsm_dynamo_1 = require("@futdevpro/fsm-dynamo");
|
|
11
|
+
const dynamo_nts_singleton_service_1 = require("./dynamo-nts-singleton.service");
|
|
12
|
+
const dynamo_nts_route_security_enum_1 = require("../_enums/dynamo-nts-route-security.enum");
|
|
13
|
+
const dynamo_nts_global_service_1 = require("./dynamo-nts-global.service");
|
|
14
|
+
const dynamo_nts_global_settings_const_1 = require("../_constants/dynamo-nts-global-settings.const");
|
|
15
|
+
/**
|
|
16
|
+
* This will be the MAIN service of our server project,
|
|
17
|
+
* follow the types and type instructions while setting up your project
|
|
18
|
+
*
|
|
19
|
+
* In this service, there are abstract functions that you will need to implement,
|
|
20
|
+
* where you need to set up the main params for your application.
|
|
21
|
+
*
|
|
22
|
+
* (after the example, you can find the list of services you can/should setup)
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* export class App extends DynamoNTS_AppExtended {
|
|
26
|
+
*
|
|
27
|
+
* ...
|
|
28
|
+
*
|
|
29
|
+
* // Setting up App params, and preparing project global settings
|
|
30
|
+
* setupAppParams(): void {
|
|
31
|
+
* this.params = new DynamoNTS_AppParams({
|
|
32
|
+
* name: 'Warbots Server',
|
|
33
|
+
* title: warbotsTitleLog,
|
|
34
|
+
* version: version,
|
|
35
|
+
* dbName: 'warbots',
|
|
36
|
+
* });
|
|
37
|
+
*
|
|
38
|
+
* // dynamoNTS_GlobalSettings.logRequestsContent = false;
|
|
39
|
+
* }
|
|
40
|
+
*
|
|
41
|
+
* ...
|
|
42
|
+
*
|
|
43
|
+
* // Setting up DBServices
|
|
44
|
+
* setGlobalServiceCollection(): void {
|
|
45
|
+
* DynamoNTS_GlobalService.setServices({
|
|
46
|
+
* authService: AuthService.getInstance(),
|
|
47
|
+
* emailServiceCollection: EmailServiceCollectionService.getInstance(),
|
|
48
|
+
* dbModels: [
|
|
49
|
+
* userModelParams,
|
|
50
|
+
* userDataModelParams,
|
|
51
|
+
* userOptionsModelParams,
|
|
52
|
+
* userStatisticsModelParams,
|
|
53
|
+
* userAchievementsModelParams,
|
|
54
|
+
* userNotificationsModelParams,
|
|
55
|
+
*
|
|
56
|
+
* matchStatisticsModelParams,
|
|
57
|
+
* matchDataModelParams,
|
|
58
|
+
|
|
59
|
+
* usageSessionModelParams,
|
|
60
|
+
* customDataModelParams,
|
|
61
|
+
* ]
|
|
62
|
+
* });
|
|
63
|
+
* }
|
|
64
|
+
*
|
|
65
|
+
* ...
|
|
66
|
+
*
|
|
67
|
+
* // Setting up Routes
|
|
68
|
+
* setupRoutingModules(): void {
|
|
69
|
+
* this.httpPort = env.port;
|
|
70
|
+
|
|
71
|
+
* this.routingModules = [
|
|
72
|
+
* new DynamoNTS_RoutingModule({
|
|
73
|
+
* route: '/user',
|
|
74
|
+
* controllers: [
|
|
75
|
+
* UserController.getInstance(),
|
|
76
|
+
* UserDataController.getInstance(),
|
|
77
|
+
* UserOptionsController.getInstance(),
|
|
78
|
+
* UserStatisticsController.getInstance(),
|
|
79
|
+
* UserAchievementsController.getInstance(),
|
|
80
|
+
* UserNotificationsController.getInstance()
|
|
81
|
+
* ]
|
|
82
|
+
* }),
|
|
83
|
+
* new DynamoNTS_RoutingModule({
|
|
84
|
+
* route: '/match',
|
|
85
|
+
* controllers: [
|
|
86
|
+
* MatchController.getInstance(),
|
|
87
|
+
* MatchDistributionController.getInstance(),
|
|
88
|
+
* MatchStatisticsController.getInstance(),
|
|
89
|
+
* ]
|
|
90
|
+
* }),
|
|
91
|
+
* new DynamoNTS_RoutingModule({
|
|
92
|
+
* route: '/server',
|
|
93
|
+
* controllers: [
|
|
94
|
+
* ServerController.getInstance(),
|
|
95
|
+
* ]
|
|
96
|
+
* }),
|
|
97
|
+
|
|
98
|
+
* getTestRoutingModule(),
|
|
99
|
+
* getUsageRoutingModule()
|
|
100
|
+
* ];
|
|
101
|
+
* }
|
|
102
|
+
* }
|
|
103
|
+
*
|
|
104
|
+
* //
|
|
105
|
+
* // The Services available
|
|
106
|
+
* //
|
|
107
|
+
* // Authentication Service
|
|
108
|
+
* // A commonly used basic service,
|
|
109
|
+
* // which is necessary fur certain functions (such as registering call issuers)
|
|
110
|
+
* //
|
|
111
|
+
* // This will handle Authentication Token checking/refreshing, checking issuer's identifier and routeParams,
|
|
112
|
+
* // handling JWT Token, or maybe with OAuth2 or other commonly used security procedures
|
|
113
|
+
* //
|
|
114
|
+
* // You can create one with this Dynamo Object:
|
|
115
|
+
* //
|
|
116
|
+
*
|
|
117
|
+
* @example
|
|
118
|
+
* // follow the instructions on the abstract class (DynamoNTS_AuthService)
|
|
119
|
+
* export class AuthService extends DynamoNTS_AuthService {}
|
|
120
|
+
*
|
|
121
|
+
*
|
|
122
|
+
*
|
|
123
|
+
* //
|
|
124
|
+
*/
|
|
125
|
+
class DynamoNTS_App extends dynamo_nts_singleton_service_1.DynamoNTS_SingletonService {
|
|
126
|
+
get params() { return this._params; }
|
|
127
|
+
get security() { return this._security; }
|
|
128
|
+
get ports() { return this._ports; }
|
|
129
|
+
get cert() { return this._cert; }
|
|
130
|
+
constructor() {
|
|
131
|
+
var _a, _b;
|
|
132
|
+
super();
|
|
133
|
+
this.mongoose = Mongoose;
|
|
134
|
+
try {
|
|
135
|
+
this._params = this.getAppParams();
|
|
136
|
+
if (this.overrideDynamoNTSGlobalSettings) {
|
|
137
|
+
this.overrideDynamoNTSGlobalSettings();
|
|
138
|
+
}
|
|
139
|
+
dynamo_nts_global_service_1.DynamoNTS_GlobalService.setServices(this.getGlobalServiceCollection());
|
|
140
|
+
dynamo_nts_global_service_1.DynamoNTS_GlobalService.setParams(this.params);
|
|
141
|
+
this._ports = this.getPortSettings();
|
|
142
|
+
if (this.getCertificationSettings) {
|
|
143
|
+
this._cert = this.getCertificationSettings();
|
|
144
|
+
}
|
|
145
|
+
this._routingModules = this.getRoutingModules();
|
|
146
|
+
if (this.createEntries) {
|
|
147
|
+
this.createEntries();
|
|
148
|
+
}
|
|
149
|
+
console.log(`\n\n\nStarting ${this._params.name}... `);
|
|
150
|
+
if (this._params.title) {
|
|
151
|
+
console.log(this._params.title);
|
|
152
|
+
}
|
|
153
|
+
console.log(`\nVersion: ${this._params.version}`);
|
|
154
|
+
this.startDB();
|
|
155
|
+
this.getGlobalServiceCollection();
|
|
156
|
+
this.debugLog = dynamo_nts_global_settings_const_1.dynamoNTS_GlobalSettings.logSetup;
|
|
157
|
+
this.getRoutingModules();
|
|
158
|
+
this.setSecurity();
|
|
159
|
+
if ((_a = this._routingModules) === null || _a === void 0 ? void 0 : _a.length) {
|
|
160
|
+
this.initExpresses();
|
|
161
|
+
this.startExpresses();
|
|
162
|
+
if (this._security !== dynamo_nts_route_security_enum_1.DynamoNTS_RouteSecurity.secure) {
|
|
163
|
+
this.mountOpenRoutes();
|
|
164
|
+
}
|
|
165
|
+
if (this._security !== dynamo_nts_route_security_enum_1.DynamoNTS_RouteSecurity.open && this._cert) {
|
|
166
|
+
this.mountSecureRoutes();
|
|
167
|
+
}
|
|
168
|
+
if (this.debugLog) {
|
|
169
|
+
console.log(`\nRoutes mounted.... server using security: ${this._security}`);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
this._rootServices = (_b = this.getRootServices()) !== null && _b !== void 0 ? _b : [];
|
|
173
|
+
if (this.postProcess) {
|
|
174
|
+
this.postProcess();
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
catch (error) {
|
|
178
|
+
fsm_dynamo_1.Dynamo_Log.error('\nApplication start failed.\n', error);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
*
|
|
183
|
+
*/
|
|
184
|
+
startDB() {
|
|
185
|
+
this.mongoose.connection
|
|
186
|
+
.on('error', (error) => {
|
|
187
|
+
fsm_dynamo_1.Dynamo_Log.error('\nUnable to connect to MongoDB server, ERROR: ', error);
|
|
188
|
+
})
|
|
189
|
+
.once('open', () => {
|
|
190
|
+
fsm_dynamo_1.Dynamo_Log.success('\nConnected to MongoDB\n');
|
|
191
|
+
});
|
|
192
|
+
this.mongoose.connect(this._params.dbUri, {
|
|
193
|
+
useNewUrlParser: true,
|
|
194
|
+
useUnifiedTopology: true
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
*
|
|
199
|
+
*/
|
|
200
|
+
initExpresses() {
|
|
201
|
+
if (this._security !== dynamo_nts_route_security_enum_1.DynamoNTS_RouteSecurity.secure) {
|
|
202
|
+
if (!this._ports.httpPort) {
|
|
203
|
+
let errorMsg = `\nYou have open routes, but httpPort is not set!` +
|
|
204
|
+
`\nsecurity: ${this._security}` +
|
|
205
|
+
`\nset httpPort in DynamoBEServer - setupRoutingModules() to enable secure routes.`;
|
|
206
|
+
errorMsg += '\n\nThe routes setted to use open server:';
|
|
207
|
+
this._routingModules.forEach((module) => {
|
|
208
|
+
if (module.security != dynamo_nts_route_security_enum_1.DynamoNTS_RouteSecurity.secure) {
|
|
209
|
+
errorMsg += `\n ${module.route} (security: ${module.security}) \n subroutes using open sever:`;
|
|
210
|
+
module.endpoints.forEach((endpoint) => {
|
|
211
|
+
if (endpoint.security != dynamo_nts_route_security_enum_1.DynamoNTS_RouteSecurity.secure) {
|
|
212
|
+
errorMsg += `\n ${endpoint.endpoint} (security: ${endpoint.security})`;
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
fsm_dynamo_1.Dynamo_Log.error(errorMsg);
|
|
218
|
+
let error = new Error('Open routes cannot be established!');
|
|
219
|
+
let errorStack = error.stack.split('\n');
|
|
220
|
+
errorStack.splice(1, 2);
|
|
221
|
+
error.stack = errorStack.join('\n');
|
|
222
|
+
throw error;
|
|
223
|
+
}
|
|
224
|
+
this.initOpenExpress();
|
|
225
|
+
}
|
|
226
|
+
if (this._security !== dynamo_nts_route_security_enum_1.DynamoNTS_RouteSecurity.open) {
|
|
227
|
+
if (!this._cert || !this._ports.httpsPort) {
|
|
228
|
+
let errorMsg = `\nYou have secure routes, but the certification paths or httpsPort are not set!` +
|
|
229
|
+
`\nsecurity: ${this._security}` +
|
|
230
|
+
`\nset...` +
|
|
231
|
+
`\n httpsPort and` +
|
|
232
|
+
`\n cert: {` +
|
|
233
|
+
`\n keyPath: FileSystem.PathLike,` +
|
|
234
|
+
`\n certPath: FileSystem.PathLike,` +
|
|
235
|
+
`\n }` +
|
|
236
|
+
`\nin DynamoBEServer - setupRoutingModules() to enable secure routes.`;
|
|
237
|
+
errorMsg += '\n\nThe routes setted to use secure server:';
|
|
238
|
+
this._routingModules.forEach((module) => {
|
|
239
|
+
if (module.security != dynamo_nts_route_security_enum_1.DynamoNTS_RouteSecurity.open) {
|
|
240
|
+
errorMsg += `\n ${module.route} (security: ${module.security}) \n subroutes using secure sever:`;
|
|
241
|
+
module.endpoints.forEach((endpoint) => {
|
|
242
|
+
if (endpoint.security != dynamo_nts_route_security_enum_1.DynamoNTS_RouteSecurity.open) {
|
|
243
|
+
errorMsg += `\n ${endpoint.endpoint} (security: ${endpoint.security})`;
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
});
|
|
248
|
+
fsm_dynamo_1.Dynamo_Log.error(errorMsg);
|
|
249
|
+
let error = new Error('Secure routes cannot be established!');
|
|
250
|
+
let errorStack = error.stack.split('\n');
|
|
251
|
+
errorStack.splice(1, 2);
|
|
252
|
+
error.stack = errorStack.join('\n');
|
|
253
|
+
throw error;
|
|
254
|
+
}
|
|
255
|
+
this.initSecureExpress();
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
*
|
|
260
|
+
*/
|
|
261
|
+
initOpenExpress() {
|
|
262
|
+
this.openExpress = Express();
|
|
263
|
+
this.openExpress.use(BodyParser.urlencoded({ limit: '50mb', extended: true }));
|
|
264
|
+
this.openExpress.use(BodyParser.json({ limit: '50mb' }));
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
*
|
|
268
|
+
*/
|
|
269
|
+
initSecureExpress() {
|
|
270
|
+
this.secureExpress = Express();
|
|
271
|
+
this.secureExpress.use(BodyParser.urlencoded({ limit: '50mb', extended: true }));
|
|
272
|
+
this.secureExpress.use(BodyParser.json({ limit: '50mb' }));
|
|
273
|
+
const options = {
|
|
274
|
+
key: FileSystem.readFileSync(this._cert.keyPath),
|
|
275
|
+
cert: FileSystem.readFileSync(this._cert.certPath),
|
|
276
|
+
};
|
|
277
|
+
this.httpsServer = Https.createServer(options, this.secureExpress);
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
*
|
|
281
|
+
*/
|
|
282
|
+
startExpresses() {
|
|
283
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
284
|
+
try {
|
|
285
|
+
if (this._security !== dynamo_nts_route_security_enum_1.DynamoNTS_RouteSecurity.open) {
|
|
286
|
+
this.httpsServer
|
|
287
|
+
.listen(this._ports.httpsPort, 'localhost', 0, () => {
|
|
288
|
+
fsm_dynamo_1.Dynamo_Log.success(`\nHTTPS (secure) server is listening on port ${this._ports.httpsPort}\n`);
|
|
289
|
+
})
|
|
290
|
+
.on('error', (error) => {
|
|
291
|
+
fsm_dynamo_1.Dynamo_Log.error(`\nHTTPS (secure) server ERROR`, error);
|
|
292
|
+
})
|
|
293
|
+
.on('uncaughtException', (ex) => {
|
|
294
|
+
fsm_dynamo_1.Dynamo_Log.warn(`\nHTTPS (secure) server uncaughtException`, ex);
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
if (this._security !== dynamo_nts_route_security_enum_1.DynamoNTS_RouteSecurity.secure) {
|
|
298
|
+
this.openExpress
|
|
299
|
+
.listen(this._ports.httpPort, () => {
|
|
300
|
+
fsm_dynamo_1.Dynamo_Log.success(`\nHTTP (-open-) server is listening on port ${this._ports.httpPort}\n`);
|
|
301
|
+
})
|
|
302
|
+
.on('error', (error) => {
|
|
303
|
+
fsm_dynamo_1.Dynamo_Log.error(`\nHTTP (-open-) server ERROR`, error);
|
|
304
|
+
})
|
|
305
|
+
.on('uncaughtException', (ex) => {
|
|
306
|
+
fsm_dynamo_1.Dynamo_Log.warn(`\nHTTP (-open-) server uncaughtException`, ex);
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
catch (error) {
|
|
311
|
+
fsm_dynamo_1.Dynamo_Log.error(`startExpresses failed...`, error);
|
|
312
|
+
}
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
*
|
|
317
|
+
*/
|
|
318
|
+
mountSecureRoutes() {
|
|
319
|
+
this._routingModules.forEach((module) => {
|
|
320
|
+
if (module.security !== dynamo_nts_route_security_enum_1.DynamoNTS_RouteSecurity.open) {
|
|
321
|
+
if (this.debugLog) {
|
|
322
|
+
console.log(`route mount (secure): ${module.route}`);
|
|
323
|
+
}
|
|
324
|
+
const existingRoutes = this._routingModules.filter((mod) => mod.route === module.route);
|
|
325
|
+
if (1 < existingRoutes.length) {
|
|
326
|
+
let error = new Error(`ROUTE DUPLICATION: ${module.route}`);
|
|
327
|
+
let errorStack = error.stack.split('\n');
|
|
328
|
+
errorStack.splice(1, 4);
|
|
329
|
+
error.stack = errorStack.join('\n');
|
|
330
|
+
throw error;
|
|
331
|
+
}
|
|
332
|
+
this.secureExpress.use(module.route, module.secureRouter);
|
|
333
|
+
}
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
*
|
|
338
|
+
*/
|
|
339
|
+
mountOpenRoutes() {
|
|
340
|
+
this._routingModules.forEach((module) => {
|
|
341
|
+
if (module.security !== dynamo_nts_route_security_enum_1.DynamoNTS_RouteSecurity.secure) {
|
|
342
|
+
if (this.debugLog) {
|
|
343
|
+
console.log(`route mount (open): ${module.route}`);
|
|
344
|
+
}
|
|
345
|
+
const existingRoutes = this._routingModules.filter((mod) => mod.route === module.route);
|
|
346
|
+
if (1 < existingRoutes.length) {
|
|
347
|
+
let error = new Error(`ROUTE DUPLICATION: ${module.route}`);
|
|
348
|
+
let errorStack = error.stack.split('\n');
|
|
349
|
+
errorStack.splice(1, 4);
|
|
350
|
+
error.stack = errorStack.join('\n');
|
|
351
|
+
throw error;
|
|
352
|
+
}
|
|
353
|
+
this.openExpress.use(module.route, module.openRouter);
|
|
354
|
+
}
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
*
|
|
359
|
+
*/
|
|
360
|
+
setSecurity() {
|
|
361
|
+
this._routingModules.forEach((module) => {
|
|
362
|
+
if (!this._security) {
|
|
363
|
+
this._security = module.security;
|
|
364
|
+
}
|
|
365
|
+
else if (this._security !== module.security) {
|
|
366
|
+
this._security = dynamo_nts_route_security_enum_1.DynamoNTS_RouteSecurity.both;
|
|
367
|
+
}
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
exports.DynamoNTS_App = DynamoNTS_App;
|
|
372
|
+
//# sourceMappingURL=dynamo-nts-app.server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dynamo-nts-app.server.js","sourceRoot":"","sources":["../../src/_services/dynamo-nts-app.server.ts"],"names":[],"mappings":";;;;AACA,qCAAsC;AACtC,mCAAoC;AACpC,qDAA+B;AAC/B,uDAAiC;AACjC,gEAA0C;AAE1C,sDAAmD;AAEnD,iFAA4E;AAC5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;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CA8GF;AAraD,sCAqaC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=dynamo-nts-app.server.spec.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dynamo-nts-app.server.spec.d.ts","sourceRoot":"","sources":["../../src/_services/dynamo-nts-app.server.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
describe('DynamoNTS_App', () => {
|
|
2
|
+
it('should create an instance', () => {
|
|
3
|
+
expect(true).toBeTruthy();
|
|
4
|
+
});
|
|
5
|
+
/* it('should ') */
|
|
6
|
+
xit('should create an instance NOT', () => {
|
|
7
|
+
expect(false).toBeTruthy();
|
|
8
|
+
});
|
|
9
|
+
});
|
|
10
|
+
//# sourceMappingURL=dynamo-nts-app.server.spec.js.map
|