@futdevpro/nts-dynamo 1.5.76 → 1.5.81

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.
Files changed (227) hide show
  1. package/LICENSE +2 -2
  2. package/lib/_constants/dynamo-nts-global-settings.d.ts +2 -2
  3. package/lib/_constants/dynamo-nts-global-settings.js +17 -17
  4. package/lib/_constants/index.d.ts +1 -1
  5. package/lib/_constants/index.js +4 -4
  6. package/lib/_enums/data-model-type.enum.d.ts +12 -12
  7. package/lib/_enums/data-model-type.enum.js +16 -16
  8. package/lib/_enums/data-model-type.enum.js.map +1 -1
  9. package/lib/_enums/dynamo-nts-data-service-function.enum.d.ts +12 -12
  10. package/lib/_enums/dynamo-nts-data-service-function.enum.js +18 -18
  11. package/lib/_enums/dynamo-nts-data-service-function.enum.js.map +1 -1
  12. package/lib/_enums/dynamo-nts-route-security.enum.d.ts +11 -11
  13. package/lib/_enums/dynamo-nts-route-security.enum.js +15 -15
  14. package/lib/_enums/dynamo-nts-route-security.enum.js.map +1 -1
  15. package/lib/_enums/dynamo-nts-socket-security.enum.d.ts +10 -10
  16. package/lib/_enums/dynamo-nts-socket-security.enum.js +14 -14
  17. package/lib/_enums/dynamo-nts-socket-security.enum.js.map +1 -1
  18. package/lib/_enums/http/http-call-type.enum.d.ts +11 -11
  19. package/lib/_enums/http/http-call-type.enum.js +15 -15
  20. package/lib/_enums/http/http-call-type.enum.js.map +1 -1
  21. package/lib/_enums/http/http-response-type.enum.d.ts +6 -6
  22. package/lib/_enums/http/http-response-type.enum.js +10 -10
  23. package/lib/_enums/http/http-response-type.enum.js.map +1 -1
  24. package/lib/_enums/http/socket-event.enum.d.ts +9 -8
  25. package/lib/_enums/http/socket-event.enum.d.ts.map +1 -1
  26. package/lib/_enums/http/socket-event.enum.js +13 -12
  27. package/lib/_enums/http/socket-event.enum.js.map +1 -1
  28. package/lib/_enums/index.d.ts +8 -8
  29. package/lib/_enums/index.js +13 -13
  30. package/lib/_enums/predefined-data-types.enum.d.ts +10 -10
  31. package/lib/_enums/predefined-data-types.enum.js +14 -14
  32. package/lib/_enums/predefined-data-types.enum.js.map +1 -1
  33. package/lib/_interfaces/certification-settings.interface.d.ts +7 -0
  34. package/lib/_interfaces/certification-settings.interface.d.ts.map +1 -0
  35. package/lib/_interfaces/certification-settings.interface.js +3 -0
  36. package/lib/_interfaces/certification-settings.interface.js.map +1 -0
  37. package/lib/_interfaces/global-service-settings.interface.d.ts +18 -0
  38. package/lib/_interfaces/global-service-settings.interface.d.ts.map +1 -0
  39. package/lib/_interfaces/global-service-settings.interface.js +3 -0
  40. package/lib/_interfaces/global-service-settings.interface.js.map +1 -0
  41. package/lib/_interfaces/index.d.ts +1 -0
  42. package/lib/_interfaces/index.d.ts.map +1 -0
  43. package/lib/_interfaces/index.js +4 -0
  44. package/lib/_interfaces/index.js.map +1 -0
  45. package/lib/_interfaces/port-settings.interface.d.ts +5 -0
  46. package/lib/_interfaces/port-settings.interface.d.ts.map +1 -0
  47. package/lib/_interfaces/port-settings.interface.js +3 -0
  48. package/lib/_interfaces/port-settings.interface.js.map +1 -0
  49. package/lib/_models/dynamo-nts-api-call-params.d.ts +95 -95
  50. package/lib/_models/dynamo-nts-api-call-params.js +47 -47
  51. package/lib/_models/dynamo-nts-app-params.d.ts +49 -49
  52. package/lib/_models/dynamo-nts-app-params.js +17 -17
  53. package/lib/_models/dynamo-nts-endpoint-params.d.ts +80 -80
  54. package/lib/_models/dynamo-nts-endpoint-params.js +139 -139
  55. package/lib/_models/dynamo-nts-global-settings.d.ts +53 -53
  56. package/lib/_models/dynamo-nts-global-settings.js +2 -2
  57. package/lib/_models/dynamo-nts-routing-module-settings.d.ts +19 -19
  58. package/lib/_models/dynamo-nts-routing-module-settings.js +2 -2
  59. package/lib/_models/dynamo-nts-socket-event-params.d.ts +32 -30
  60. package/lib/_models/dynamo-nts-socket-event-params.d.ts.map +1 -1
  61. package/lib/_models/dynamo-nts-socket-event-params.js +80 -79
  62. package/lib/_models/dynamo-nts-socket-event-params.js.map +1 -1
  63. package/lib/_models/dynamo-nts-socket-presence.d.ts +21 -0
  64. package/lib/_models/dynamo-nts-socket-presence.d.ts.map +1 -0
  65. package/lib/_models/dynamo-nts-socket-presence.js +45 -0
  66. package/lib/_models/dynamo-nts-socket-presence.js.map +1 -0
  67. package/lib/_models/dynamo-nts-socket-service-params.d.ts +18 -18
  68. package/lib/_models/dynamo-nts-socket-service-params.d.ts.map +1 -1
  69. package/lib/_models/dynamo-nts-socket-service-params.js +26 -26
  70. package/lib/_models/dynamo-nts-socket-service-params.js.map +1 -1
  71. package/lib/_models/index.d.ts +7 -8
  72. package/lib/_models/index.d.ts.map +1 -1
  73. package/lib/_models/index.js +12 -12
  74. package/lib/_models/index.js.map +1 -1
  75. package/lib/_modules/api-service.index.d.ts +5 -5
  76. package/lib/_modules/api-service.index.js +11 -11
  77. package/lib/_modules/app-extended.index.d.ts +15 -12
  78. package/lib/_modules/app-extended.index.d.ts.map +1 -1
  79. package/lib/_modules/app-extended.index.js +23 -19
  80. package/lib/_modules/app-extended.index.js.map +1 -1
  81. package/lib/_modules/app.index.d.ts +13 -10
  82. package/lib/_modules/app.index.d.ts.map +1 -1
  83. package/lib/_modules/app.index.js +21 -17
  84. package/lib/_modules/app.index.js.map +1 -1
  85. package/lib/_modules/auth.index.d.ts +3 -3
  86. package/lib/_modules/auth.index.js +8 -8
  87. package/lib/_modules/constants.index.d.ts +1 -1
  88. package/lib/_modules/constants.index.js +4 -4
  89. package/lib/_modules/controller.index.d.ts +4 -4
  90. package/lib/_modules/controller.index.js +10 -10
  91. package/lib/_modules/custom-data/custom-data.controller.d.ts +5 -5
  92. package/lib/_modules/custom-data/custom-data.controller.js +55 -55
  93. package/lib/_modules/custom-data/custom-data.service.d.ts +5 -5
  94. package/lib/_modules/custom-data/custom-data.service.js +11 -11
  95. package/lib/_modules/custom-data/get-custom-data-routing-module.d.ts +3 -3
  96. package/lib/_modules/custom-data/get-custom-data-routing-module.js +17 -17
  97. package/lib/_modules/custom-data/index.d.ts +4 -4
  98. package/lib/_modules/custom-data/index.js +8 -8
  99. package/lib/_modules/custom-data-module.index.d.ts +1 -1
  100. package/lib/_modules/custom-data-module.index.js +4 -4
  101. package/lib/_modules/data-service.index.d.ts +5 -5
  102. package/lib/_modules/data-service.index.js +10 -10
  103. package/lib/_modules/email.index.d.ts +3 -3
  104. package/lib/_modules/email.index.js +8 -8
  105. package/lib/_modules/enums.index.d.ts +1 -1
  106. package/lib/_modules/enums.index.js +4 -4
  107. package/lib/_modules/models.index.d.ts +1 -1
  108. package/lib/_modules/models.index.js +4 -4
  109. package/lib/_modules/services.index.d.ts +1 -1
  110. package/lib/_modules/services.index.js +4 -4
  111. package/lib/_modules/test/get-test-routing-module.d.ts +3 -3
  112. package/lib/_modules/test/get-test-routing-module.js +17 -17
  113. package/lib/_modules/test/index.d.ts +3 -3
  114. package/lib/_modules/test/index.js +7 -7
  115. package/lib/_modules/test/test.controller.d.ts +5 -5
  116. package/lib/_modules/test/test.controller.js +104 -104
  117. package/lib/_modules/test-module.index.d.ts +1 -1
  118. package/lib/_modules/test-module.index.js +4 -4
  119. package/lib/_modules/usage/get-usage-routing-module.d.ts +3 -3
  120. package/lib/_modules/usage/get-usage-routing-module.js +17 -17
  121. package/lib/_modules/usage/index.d.ts +4 -4
  122. package/lib/_modules/usage/index.js +8 -8
  123. package/lib/_modules/usage/usage-controller.d.ts +6 -6
  124. package/lib/_modules/usage/usage-controller.js +88 -88
  125. package/lib/_modules/usage/usage.service.d.ts +16 -16
  126. package/lib/_modules/usage/usage.service.js +132 -132
  127. package/lib/_modules/usage-module.index.d.ts +1 -1
  128. package/lib/_modules/usage-module.index.js +4 -4
  129. package/lib/_services/dynamo-nts-api.service.d.ts +34 -34
  130. package/lib/_services/dynamo-nts-api.service.js +188 -188
  131. package/lib/_services/dynamo-nts-app-extended.d.ts +128 -128
  132. package/lib/_services/dynamo-nts-app-extended.d.ts.map +1 -1
  133. package/lib/_services/dynamo-nts-app-extended.js +212 -212
  134. package/lib/_services/dynamo-nts-app-extended.js.map +1 -1
  135. package/lib/_services/dynamo-nts-app.d.ts +270 -278
  136. package/lib/_services/dynamo-nts-app.d.ts.map +1 -1
  137. package/lib/_services/dynamo-nts-app.js +371 -371
  138. package/lib/_services/dynamo-nts-app.js.map +1 -1
  139. package/lib/_services/dynamo-nts-app.spec.d.ts +1 -0
  140. package/lib/_services/dynamo-nts-app.spec.d.ts.map +1 -0
  141. package/lib/_services/dynamo-nts-app.spec.js +10 -0
  142. package/lib/_services/dynamo-nts-app.spec.js.map +1 -0
  143. package/lib/_services/dynamo-nts-auth.service.d.ts +127 -127
  144. package/lib/_services/dynamo-nts-auth.service.d.ts.map +1 -1
  145. package/lib/_services/dynamo-nts-auth.service.js +53 -53
  146. package/lib/_services/dynamo-nts-auth.service.js.map +1 -1
  147. package/lib/_services/dynamo-nts-controller.service.d.ts +105 -105
  148. package/lib/_services/dynamo-nts-controller.service.d.ts.map +1 -1
  149. package/lib/_services/dynamo-nts-controller.service.js +57 -57
  150. package/lib/_services/dynamo-nts-controller.service.js.map +1 -1
  151. package/lib/_services/dynamo-nts-data.service.d.ts +230 -229
  152. package/lib/_services/dynamo-nts-data.service.d.ts.map +1 -1
  153. package/lib/_services/dynamo-nts-data.service.js +689 -686
  154. package/lib/_services/dynamo-nts-data.service.js.map +1 -1
  155. package/lib/_services/dynamo-nts-db-service-collection.service.d.ts +8 -8
  156. package/lib/_services/dynamo-nts-db-service-collection.service.js +10 -10
  157. package/lib/_services/dynamo-nts-db.service.d.ts +312 -312
  158. package/lib/_services/dynamo-nts-db.service.d.ts.map +1 -1
  159. package/lib/_services/dynamo-nts-db.service.js +856 -856
  160. package/lib/_services/dynamo-nts-db.service.js.map +1 -1
  161. package/lib/_services/dynamo-nts-email-service-collection.service.d.ts +18 -18
  162. package/lib/_services/dynamo-nts-email-service-collection.service.js +20 -20
  163. package/lib/_services/dynamo-nts-email.service.d.ts +56 -56
  164. package/lib/_services/dynamo-nts-email.service.d.ts.map +1 -1
  165. package/lib/_services/dynamo-nts-email.service.js +203 -203
  166. package/lib/_services/dynamo-nts-email.service.js.map +1 -1
  167. package/lib/_services/dynamo-nts-global.service.d.ts +71 -84
  168. package/lib/_services/dynamo-nts-global.service.d.ts.map +1 -1
  169. package/lib/_services/dynamo-nts-global.service.js +156 -156
  170. package/lib/_services/dynamo-nts-global.service.js.map +1 -1
  171. package/lib/_services/dynamo-nts-routing-module.service.d.ts +76 -76
  172. package/lib/_services/dynamo-nts-routing-module.service.d.ts.map +1 -1
  173. package/lib/_services/dynamo-nts-routing-module.service.js +191 -191
  174. package/lib/_services/dynamo-nts-routing-module.service.js.map +1 -1
  175. package/lib/_services/dynamo-nts-shared.service.d.ts +31 -31
  176. package/lib/_services/dynamo-nts-shared.service.d.ts.map +1 -1
  177. package/lib/_services/dynamo-nts-shared.service.js +70 -70
  178. package/lib/_services/dynamo-nts-shared.service.js.map +1 -1
  179. package/lib/_services/dynamo-nts-shared.service.spec.d.ts +2 -0
  180. package/lib/_services/dynamo-nts-shared.service.spec.d.ts.map +1 -0
  181. package/lib/_services/dynamo-nts-shared.service.spec.js +12 -0
  182. package/lib/_services/dynamo-nts-shared.service.spec.js.map +1 -0
  183. package/lib/_services/dynamo-nts-singleton.service.d.ts +8 -8
  184. package/lib/_services/dynamo-nts-singleton.service.js +18 -18
  185. package/lib/_services/dynamo-nts-singleton.service.js.map +1 -1
  186. package/lib/_services/dynamo-nts-socket-service-collection.service.d.ts +9 -9
  187. package/lib/_services/dynamo-nts-socket-service-collection.service.js +13 -13
  188. package/lib/_services/dynamo-nts-socket.service.d.ts +57 -45
  189. package/lib/_services/dynamo-nts-socket.service.d.ts.map +1 -1
  190. package/lib/_services/dynamo-nts-socket.service.js +188 -165
  191. package/lib/_services/dynamo-nts-socket.service.js.map +1 -1
  192. package/lib/_services/index.d.ts +14 -16
  193. package/lib/_services/index.d.ts.map +1 -1
  194. package/lib/_services/index.js +20 -20
  195. package/lib/_services/index.js.map +1 -1
  196. package/lib/index.d.ts +6 -6
  197. package/lib/index.js +14 -14
  198. package/lib/tsconfig.tsbuildinfo +1 -1
  199. package/package SAVE.json +216 -0
  200. package/package-NEW with test but not working.json +228 -0
  201. package/package.json +15 -8
  202. package/spec/support/jasmine.json +14 -0
  203. package/src/_enums/http/socket-event.enum.ts +2 -1
  204. package/src/_interfaces/certification-settings.interface.ts +7 -0
  205. package/src/_interfaces/global-service-settings.interface.ts +23 -0
  206. package/src/_interfaces/index.ts +5 -0
  207. package/src/_interfaces/port-settings.interface.ts +5 -0
  208. package/src/_models/dynamo-nts-socket-event-params.ts +23 -21
  209. package/src/_models/{dynamo-nts-socket-dictionary.ts → dynamo-nts-socket-presence.ts} +21 -5
  210. package/src/_models/dynamo-nts-socket-service-params.ts +1 -0
  211. package/src/_models/index.ts +2 -2
  212. package/src/_modules/app-extended.index.ts +7 -2
  213. package/src/_modules/app.index.ts +5 -0
  214. package/src/_services/dynamo-nts-app-extended.ts +6 -2
  215. package/src/_services/dynamo-nts-app.spec.ts +14 -0
  216. package/src/_services/dynamo-nts-app.ts +8 -14
  217. package/src/_services/dynamo-nts-auth.service.ts +1 -0
  218. package/src/_services/dynamo-nts-controller.service.ts +2 -1
  219. package/src/_services/dynamo-nts-data.service.ts +16 -10
  220. package/src/_services/dynamo-nts-db.service.ts +8 -5
  221. package/src/_services/dynamo-nts-email.service.ts +1 -0
  222. package/src/_services/dynamo-nts-global.service.ts +3 -18
  223. package/src/_services/dynamo-nts-routing-module.service.ts +1 -0
  224. package/src/_services/dynamo-nts-shared.service.spec.ts +10 -0
  225. package/src/_services/dynamo-nts-shared.service.ts +2 -1
  226. package/src/_services/dynamo-nts-socket.service.ts +80 -41
  227. package/src/_services/index.ts +2 -2
@@ -1,279 +1,271 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
- import { DynamoNTS_AppParams } from '../_models/dynamo-nts-app-params';
4
- import Mongoose = require("mongoose");
5
- import Express = require("express");
6
- import * as Https from 'https';
7
- import * as FileSystem from 'fs';
8
- import { DynamoNTS_SingletonService } from './dynamo-nts-singleton.service';
9
- import { DynamoNTS_RouteSecurity } from '../_enums/dynamo-nts-route-security.enum';
10
- import { DynamoNTS_RoutingModule } from './dynamo-nts-routing-module.service';
11
- import { DynamoNTS_GlobalServiceSettings } from './dynamo-nts-global.service';
12
- export interface DynamoNTS_CertificationSettings {
13
- keyPath: FileSystem.PathLike;
14
- certPath: FileSystem.PathLike;
15
- }
16
- export interface DynamoNTS_PortSettings {
17
- httpPort?: number;
18
- httpsPort?: number;
19
- }
20
- /**
21
- * This will be the MAIN service of our server project,
22
- * follow the types and type instructions while setting up your project
23
- *
24
- * In this service, there are abstract functions that you will need to implement,
25
- * where you need to set up the main params for your application.
26
- *
27
- * (after the example, you can find the list of services you can/should setup)
28
- *
29
- * @example
30
- * export class App extends DynamoNTS_AppExtended {
31
- *
32
- * ...
33
- *
34
- * // Setting up App params, and preparing project global settings
35
- * setupAppParams(): void {
36
- * this.params = new DynamoNTS_AppParams({
37
- * name: 'Warbots Server',
38
- * title: warbotsTitleLog,
39
- * version: version,
40
- * dbName: 'warbots',
41
- * });
42
- *
43
- * // dynamoNTS_GlobalSettings.logRequestsContent = false;
44
- * }
45
- *
46
- * ...
47
- *
48
- * // Setting up DBServices
49
- * setGlobalServiceCollection(): void {
50
- * DynamoNTS_GlobalService.setServices({
51
- * authService: AuthService.getInstance(),
52
- * emailServiceCollection: EmailServiceCollectionService.getInstance(),
53
- * dbModels: [
54
- * userModelParams,
55
- * userDataModelParams,
56
- * userOptionsModelParams,
57
- * userStatisticsModelParams,
58
- * userAchievementsModelParams,
59
- * userNotificationsModelParams,
60
- *
61
- * matchStatisticsModelParams,
62
- * matchDataModelParams,
63
-
64
- * usageSessionModelParams,
65
- * customDataModelParams,
66
- * ]
67
- * });
68
- * }
69
- *
70
- * ...
71
- *
72
- * // Setting up Routes
73
- * setupRoutingModules(): void {
74
- * this.httpPort = env.port;
75
-
76
- * this.routingModules = [
77
- * new DynamoNTS_RoutingModule({
78
- * route: '/user',
79
- * controllers: [
80
- * UserController.getInstance(),
81
- * UserDataController.getInstance(),
82
- * UserOptionsController.getInstance(),
83
- * UserStatisticsController.getInstance(),
84
- * UserAchievementsController.getInstance(),
85
- * UserNotificationsController.getInstance()
86
- * ]
87
- * }),
88
- * new DynamoNTS_RoutingModule({
89
- * route: '/match',
90
- * controllers: [
91
- * MatchController.getInstance(),
92
- * MatchDistributionController.getInstance(),
93
- * MatchStatisticsController.getInstance(),
94
- * ]
95
- * }),
96
- * new DynamoNTS_RoutingModule({
97
- * route: '/server',
98
- * controllers: [
99
- * ServerController.getInstance(),
100
- * ]
101
- * }),
102
-
103
- * getTestRoutingModule(),
104
- * getUsageRoutingModule()
105
- * ];
106
- * }
107
- * }
108
- *
109
- * //
110
- * // The Services available
111
- * //
112
- * // Authentication Service
113
- * // A commonly used basic service,
114
- * // which is necessary fur certain functions (such as registering call issuers)
115
- * //
116
- * // This will handle Authentication Token checking/refreshing, checking issuer's identifier and routeParams,
117
- * // handling JWT Token, or maybe with OAuth2 or other commonly used security procedures
118
- * //
119
- * // You can create one with this Dynamo Object:
120
- * //
121
- *
122
- * @example
123
- * // follow the instructions on the abstract class (DynamoNTS_AuthService)
124
- * export class AuthService extends DynamoNTS_AuthService {}
125
- *
126
- *
127
- *
128
- * //
129
- */
130
- export declare abstract class DynamoNTS_App extends DynamoNTS_SingletonService {
131
- private _params;
132
- protected get params(): DynamoNTS_AppParams;
133
- protected mongoose: typeof Mongoose;
134
- private _security;
135
- protected get security(): DynamoNTS_RouteSecurity;
136
- protected _ports: DynamoNTS_PortSettings;
137
- protected get ports(): DynamoNTS_PortSettings;
138
- private _cert?;
139
- protected get cert(): DynamoNTS_CertificationSettings;
140
- protected openExpress: Express.Application;
141
- private secureExpress;
142
- protected httpsServer: Https.Server;
143
- private _routingModules;
144
- protected get routingModules(): DynamoNTS_RoutingModule[];
145
- /**
146
- * setting this value to true, enables this service debug logs
147
- */
148
- protected debugLog: boolean;
149
- constructor();
150
- /**
151
- *
152
- */
153
- private startDB;
154
- /**
155
- *
156
- */
157
- private initExpresses;
158
- /**
159
- *
160
- */
161
- protected initOpenExpress(): void;
162
- /**
163
- *
164
- */
165
- protected initSecureExpress(): void;
166
- /**
167
- *
168
- */
169
- private startExpresses;
170
- /**
171
- *
172
- */
173
- private mountSecureRoutes;
174
- /**
175
- *
176
- */
177
- private mountOpenRoutes;
178
- /**
179
- *
180
- */
181
- private setSecurity;
182
- /**
183
- * #OUTDATED
184
- * Setting up App params, and preparing project global settings
185
- * You must setup app params in this function like this:
186
- *
187
- * @example
188
- * setupAppParams(): void {
189
- * this.params = new DynamoBEAppParams({
190
- * name: 'Sample Server',
191
- * title: 'A BIG nice header that will be logged on start',
192
- * version: version,
193
- * dbName: 'sampleapp',
194
- * });
195
- *
196
- * DBE_Global_S.setGlobalSettings({
197
- * defaultRouteSecurity: DynamoBERouteSecurity.secure,
198
- * logSetup: true,
199
- * });
200
- * }
201
- */
202
- abstract getAppParams(): DynamoNTS_AppParams;
203
- /**
204
- * MISSING Description (TODO)
205
- */
206
- abstract overrideDynamoNTSGlobalSettings?(): void;
207
- /**
208
- * #OUTDATED
209
- * Setting up DBServices
210
- * You must setup globalServiceCollection and dbServices in this function
211
- *
212
- * @example
213
- * setGlobalServiceCollection(): void {
214
- * DBE_Global_S.setServices({
215
- * authService: AuthService.getInstance(),
216
- * emailServiceCollection: EmailServiceCollectionService.getInstance(),
217
- * dbModels: [
218
- * accountModelParams,
219
- * projectModelParams,
220
- * ...
221
- * ]
222
- * });
223
- * }
224
- */
225
- abstract getGlobalServiceCollection(): DynamoNTS_GlobalServiceSettings;
226
- /**
227
- * MISSING Description (TODO)
228
- */
229
- abstract getPortSettings(): DynamoNTS_PortSettings;
230
- /**
231
- * #OUTDATED
232
- * You must setup endpoints and required services in this function
233
- *
234
- * @example
235
- * // Setting up Routes
236
- * setupRoutingModules(): void {
237
- * this.httpPort = env.httpPort;
238
- * this.httpsPort = env.httpsPort;
239
- *
240
- * this.cert = {
241
- * keyPath: Path.join(__dirname, './_assets/cert/ucc.key'),
242
- * certPath: Path.join(__dirname, './_assets/cert/ucc.crt'),
243
- * };
244
- *
245
- * this.routingModules = [
246
- * new DynamoBERountingModule({
247
- * route: '/api/account',
248
- * controllers: [
249
- * AccountController.getInstance(),
250
- * PersonalInformationController.getInstance(),
251
- * ...
252
- * ]
253
- * }),
254
- * new DynamoBERountingModule({
255
- * route: '/api/project',
256
- * controllers: [
257
- * ProjectController.getInstance(),
258
- * ProjectExtensionController.getInstance(),
259
- * ]
260
- * }),
261
- * ...
262
- * ];
263
- * }
264
- */
265
- abstract getRoutingModules(): DynamoNTS_RoutingModule[];
266
- /**
267
- * MISSING Description (TODO)
268
- */
269
- getCertificationSettings?(): DynamoNTS_CertificationSettings;
270
- /**
271
- * MISSING Description (TODO)
272
- */
273
- createEntries?(): void;
274
- /**
275
- * MISSING Description (TODO)
276
- */
277
- postProcess?(): void;
278
- }
1
+ /// <reference types="node" />
2
+ import Mongoose = require("mongoose");
3
+ import Express = require("express");
4
+ import * as Https from 'https';
5
+ import { DynamoNTS_AppParams } from '../_models/dynamo-nts-app-params';
6
+ import { DynamoNTS_SingletonService } from './dynamo-nts-singleton.service';
7
+ import { DynamoNTS_RouteSecurity } from '../_enums/dynamo-nts-route-security.enum';
8
+ import { DynamoNTS_RoutingModule } from './dynamo-nts-routing-module.service';
9
+ import { DynamoNTS_PortSettings } from '../_interfaces/port-settings.interface';
10
+ import { DynamoNTS_CertificationSettings } from '../_interfaces/certification-settings.interface';
11
+ import { DynamoNTS_GlobalServiceSettings } from '../_interfaces/global-service-settings.interface';
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
+ protected get routingModules(): DynamoNTS_RoutingModule[];
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
+ getCertificationSettings?(): DynamoNTS_CertificationSettings;
262
+ /**
263
+ * MISSING Description (TODO)
264
+ */
265
+ createEntries?(): void;
266
+ /**
267
+ * MISSING Description (TODO)
268
+ */
269
+ postProcess?(): void;
270
+ }
279
271
  //# sourceMappingURL=dynamo-nts-app.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dynamo-nts-app.d.ts","sourceRoot":"","sources":["../../src/_services/dynamo-nts-app.ts"],"names":[],"mappings":";;AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,QAAQ,GAAG,QAAQ,UAAU,CAAC,CAAC;AACtC,OAAO,OAAO,GAAG,QAAQ,SAAS,CAAC,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,UAAU,MAAM,IAAI,CAAC;AAGjC,OAAO,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAC;AACnF,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAI9E,OAAO,EAA2B,+BAA+B,EAAE,MAAM,6BAA6B,CAAC;AAEvG,MAAM,WAAW,+BAA+B;IAC9C,OAAO,EAAE,UAAU,CAAC,QAAQ,CAAC;IAC7B,QAAQ,EAAE,UAAU,CAAC,QAAQ,CAAC;CAC/B;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;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