@futdevpro/nts-dynamo 1.7.28 → 1.9.1

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 (231) hide show
  1. package/.copilot/patterns.json +1 -1
  2. package/.eslintrc.json +9 -1
  3. package/lib/_constants/global-settings.const.d.ts +2 -2
  4. package/lib/_constants/global-settings.const.d.ts.map +1 -1
  5. package/lib/_constants/global-settings.const.js +2 -2
  6. package/lib/_constants/global-settings.const.js.map +1 -1
  7. package/lib/_constants/mocks/app-extended-server.mock.d.ts +12 -12
  8. package/lib/_constants/mocks/app-extended-server.mock.d.ts.map +1 -1
  9. package/lib/_constants/mocks/app-extended-server.mock.js +16 -16
  10. package/lib/_constants/mocks/app-extended-server.mock.js.map +1 -1
  11. package/lib/_constants/mocks/app-params.mock.d.ts +2 -2
  12. package/lib/_constants/mocks/app-params.mock.d.ts.map +1 -1
  13. package/lib/_constants/mocks/app-params.mock.js +1 -1
  14. package/lib/_constants/mocks/app-params.mock.js.map +1 -1
  15. package/lib/_constants/mocks/app-server.mock.d.ts +15 -15
  16. package/lib/_constants/mocks/app-server.mock.d.ts.map +1 -1
  17. package/lib/_constants/mocks/app-server.mock.js +10 -10
  18. package/lib/_constants/mocks/app-server.mock.js.map +1 -1
  19. package/lib/_constants/mocks/data-model.mock.d.ts +5 -5
  20. package/lib/_constants/mocks/data-model.mock.d.ts.map +1 -1
  21. package/lib/_constants/mocks/data-model.mock.js +24 -24
  22. package/lib/_constants/mocks/data-model.mock.js.map +1 -1
  23. package/lib/_constants/mocks/email-service-collection.mock.d.ts +2 -2
  24. package/lib/_constants/mocks/email-service-collection.mock.d.ts.map +1 -1
  25. package/lib/_constants/mocks/email-service-collection.mock.js +1 -1
  26. package/lib/_constants/mocks/email-service-collection.mock.js.map +1 -1
  27. package/lib/_constants/mocks/endpoint.mock.d.ts +8 -8
  28. package/lib/_constants/mocks/endpoint.mock.d.ts.map +1 -1
  29. package/lib/_constants/mocks/endpoint.mock.js +18 -18
  30. package/lib/_constants/mocks/endpoint.mock.js.map +1 -1
  31. package/lib/_constants/mocks/socket-client.mock.d.ts +2 -2
  32. package/lib/_constants/mocks/socket-client.mock.d.ts.map +1 -1
  33. package/lib/_constants/mocks/socket-client.mock.js +1 -1
  34. package/lib/_constants/mocks/socket-client.mock.js.map +1 -1
  35. package/lib/_constants/mocks/socket-server.mock.d.ts +2 -2
  36. package/lib/_constants/mocks/socket-server.mock.d.ts.map +1 -1
  37. package/lib/_constants/mocks/socket-server.mock.js +1 -1
  38. package/lib/_constants/mocks/socket-server.mock.js.map +1 -1
  39. package/lib/_enums/data-model-type.enum.d.ts +1 -0
  40. package/lib/_enums/data-model-type.enum.d.ts.map +1 -1
  41. package/lib/_enums/data-model-type.enum.js +1 -0
  42. package/lib/_enums/data-model-type.enum.js.map +1 -1
  43. package/lib/_models/control-models/api-call-params.control-model.d.ts +3 -3
  44. package/lib/_models/control-models/api-call-params.control-model.d.ts.map +1 -1
  45. package/lib/_models/control-models/api-call-params.control-model.js +6 -6
  46. package/lib/_models/control-models/api-call-params.control-model.js.map +1 -1
  47. package/lib/_models/control-models/{app-system-controls.control-model copy.d.ts → app-ext-system-controls.control-model.d.ts} +1 -1
  48. package/lib/_models/control-models/app-ext-system-controls.control-model.d.ts.map +1 -0
  49. package/lib/_models/control-models/{app-system-controls.control-model copy.js → app-ext-system-controls.control-model.js} +1 -1
  50. package/lib/_models/control-models/app-ext-system-controls.control-model.js.map +1 -0
  51. package/lib/_models/control-models/app-params.control-model.d.ts +2 -2
  52. package/lib/_models/control-models/app-params.control-model.d.ts.map +1 -1
  53. package/lib/_models/control-models/app-params.control-model.js +3 -3
  54. package/lib/_models/control-models/app-params.control-model.js.map +1 -1
  55. package/lib/_models/control-models/endpoint-params.control-model.d.ts +1 -1
  56. package/lib/_models/control-models/endpoint-params.control-model.d.ts.map +1 -1
  57. package/lib/_models/control-models/endpoint-params.control-model.js +25 -25
  58. package/lib/_models/control-models/endpoint-params.control-model.js.map +1 -1
  59. package/lib/_models/control-models/http-settings.control-model.d.ts +2 -2
  60. package/lib/_models/control-models/http-settings.control-model.d.ts.map +1 -1
  61. package/lib/_models/control-models/http-settings.control-model.js +3 -3
  62. package/lib/_models/control-models/http-settings.control-model.js.map +1 -1
  63. package/lib/_models/control-models/socket-client-service-params.control-model.d.ts +2 -2
  64. package/lib/_models/control-models/socket-client-service-params.control-model.d.ts.map +1 -1
  65. package/lib/_models/control-models/socket-client-service-params.control-model.js +3 -3
  66. package/lib/_models/control-models/socket-client-service-params.control-model.js.map +1 -1
  67. package/lib/_models/control-models/socket-event.control-model.js +11 -11
  68. package/lib/_models/control-models/socket-event.control-model.js.map +1 -1
  69. package/lib/_models/control-models/socket-presence.control-model.d.ts +12 -0
  70. package/lib/_models/control-models/socket-presence.control-model.d.ts.map +1 -1
  71. package/lib/_models/control-models/socket-presence.control-model.js +12 -8
  72. package/lib/_models/control-models/socket-presence.control-model.js.map +1 -1
  73. package/lib/_models/control-models/socket-server-service-params.control-model.d.ts +2 -2
  74. package/lib/_models/control-models/socket-server-service-params.control-model.d.ts.map +1 -1
  75. package/lib/_models/control-models/socket-server-service-params.control-model.js +4 -4
  76. package/lib/_models/control-models/socket-server-service-params.control-model.js.map +1 -1
  77. package/lib/_models/interfaces/certification-settings.interface.d.ts +1 -1
  78. package/lib/_models/interfaces/certification-settings.interface.d.ts.map +1 -1
  79. package/lib/_models/interfaces/global-service-settings.interface.d.ts +6 -6
  80. package/lib/_models/interfaces/global-service-settings.interface.d.ts.map +1 -1
  81. package/lib/_models/interfaces/global-settings.interface.d.ts +1 -1
  82. package/lib/_models/interfaces/global-settings.interface.d.ts.map +1 -1
  83. package/lib/_models/interfaces/routing-module-settings.interface.d.ts +1 -1
  84. package/lib/_models/interfaces/routing-module-settings.interface.d.ts.map +1 -1
  85. package/lib/_models/types/db-filter.type.d.ts.map +1 -1
  86. package/lib/_models/types/db-update.type.d.ts +2 -1
  87. package/lib/_models/types/db-update.type.d.ts.map +1 -1
  88. package/lib/_modules/custom-data/custom-data.controller.d.ts +2 -2
  89. package/lib/_modules/custom-data/custom-data.controller.d.ts.map +1 -1
  90. package/lib/_modules/custom-data/custom-data.controller.js +18 -16
  91. package/lib/_modules/custom-data/custom-data.controller.js.map +1 -1
  92. package/lib/_modules/custom-data/custom-data.data-service.d.ts +3 -3
  93. package/lib/_modules/custom-data/custom-data.data-service.d.ts.map +1 -1
  94. package/lib/_modules/custom-data/custom-data.data-service.js +4 -4
  95. package/lib/_modules/custom-data/custom-data.data-service.js.map +1 -1
  96. package/lib/_modules/custom-data/get-custom-data-routing-module.util.d.ts +1 -1
  97. package/lib/_modules/custom-data/get-custom-data-routing-module.util.d.ts.map +1 -1
  98. package/lib/_modules/custom-data/get-custom-data-routing-module.util.js +5 -5
  99. package/lib/_modules/custom-data/get-custom-data-routing-module.util.js.map +1 -1
  100. package/lib/_modules/test/get-test-routing-module.util.d.ts +1 -1
  101. package/lib/_modules/test/get-test-routing-module.util.d.ts.map +1 -1
  102. package/lib/_modules/test/get-test-routing-module.util.js +5 -5
  103. package/lib/_modules/test/get-test-routing-module.util.js.map +1 -1
  104. package/lib/_modules/test/test.controller.d.ts +2 -2
  105. package/lib/_modules/test/test.controller.d.ts.map +1 -1
  106. package/lib/_modules/test/test.controller.js +33 -33
  107. package/lib/_modules/test/test.controller.js.map +1 -1
  108. package/lib/_modules/usage/get-usage-routing-module.util.d.ts +1 -1
  109. package/lib/_modules/usage/get-usage-routing-module.util.d.ts.map +1 -1
  110. package/lib/_modules/usage/get-usage-routing-module.util.js +5 -5
  111. package/lib/_modules/usage/get-usage-routing-module.util.js.map +1 -1
  112. package/lib/_modules/usage/usage.controller.d.ts +2 -2
  113. package/lib/_modules/usage/usage.controller.d.ts.map +1 -1
  114. package/lib/_modules/usage/usage.controller.js +17 -17
  115. package/lib/_modules/usage/usage.controller.js.map +1 -1
  116. package/lib/_modules/usage/usage.data-service.d.ts +8 -8
  117. package/lib/_modules/usage/usage.data-service.d.ts.map +1 -1
  118. package/lib/_modules/usage/usage.data-service.js +11 -11
  119. package/lib/_modules/usage/usage.data-service.js.map +1 -1
  120. package/lib/_services/base/data.service.d.ts +4 -4
  121. package/lib/_services/base/data.service.d.ts.map +1 -1
  122. package/lib/_services/base/data.service.js +50 -50
  123. package/lib/_services/base/data.service.js.map +1 -1
  124. package/lib/_services/base/db.service.d.ts +6 -6
  125. package/lib/_services/base/db.service.d.ts.map +1 -1
  126. package/lib/_services/base/db.service.js +41 -37
  127. package/lib/_services/base/db.service.js.map +1 -1
  128. package/lib/_services/core/api.service.d.ts +4 -4
  129. package/lib/_services/core/api.service.d.ts.map +1 -1
  130. package/lib/_services/core/api.service.js +34 -34
  131. package/lib/_services/core/api.service.js.map +1 -1
  132. package/lib/_services/core/auth.service.d.ts +6 -6
  133. package/lib/_services/core/auth.service.js +2 -2
  134. package/lib/_services/core/auth.service.js.map +1 -1
  135. package/lib/_services/core/email.service.d.ts +4 -4
  136. package/lib/_services/core/email.service.d.ts.map +1 -1
  137. package/lib/_services/core/email.service.js +23 -23
  138. package/lib/_services/core/email.service.js.map +1 -1
  139. package/lib/_services/core/global.service.d.ts +13 -13
  140. package/lib/_services/core/global.service.d.ts.map +1 -1
  141. package/lib/_services/core/global.service.js +20 -7
  142. package/lib/_services/core/global.service.js.map +1 -1
  143. package/lib/_services/core/service-collection.service.d.ts +1 -1
  144. package/lib/_services/core/service-collection.service.d.ts.map +1 -1
  145. package/lib/_services/core/service-collection.service.js +3 -3
  146. package/lib/_services/core/service-collection.service.js.map +1 -1
  147. package/lib/_services/route/controller.service.d.ts +2 -2
  148. package/lib/_services/route/controller.service.d.ts.map +1 -1
  149. package/lib/_services/route/controller.service.js +1 -1
  150. package/lib/_services/route/controller.service.js.map +1 -1
  151. package/lib/_services/route/routing-module.service.d.ts +4 -4
  152. package/lib/_services/route/routing-module.service.d.ts.map +1 -1
  153. package/lib/_services/route/routing-module.service.js +10 -10
  154. package/lib/_services/route/routing-module.service.js.map +1 -1
  155. package/lib/_services/server/app-extended.server.d.ts +2 -2
  156. package/lib/_services/server/app-extended.server.js +27 -27
  157. package/lib/_services/server/app-extended.server.js.map +1 -1
  158. package/lib/_services/server/app-extended.server.spec.js +3 -3
  159. package/lib/_services/server/app-extended.server.spec.js.map +1 -1
  160. package/lib/_services/server/app.server.d.ts +16 -16
  161. package/lib/_services/server/app.server.d.ts.map +1 -1
  162. package/lib/_services/server/app.server.js +91 -90
  163. package/lib/_services/server/app.server.js.map +1 -1
  164. package/lib/_services/server/app.server.spec.js +5 -5
  165. package/lib/_services/server/app.server.spec.js.map +1 -1
  166. package/lib/_services/shared.static-service.d.ts +4 -4
  167. package/lib/_services/shared.static-service.d.ts.map +1 -1
  168. package/lib/_services/shared.static-service.js +2 -2
  169. package/lib/_services/shared.static-service.js.map +1 -1
  170. package/lib/_services/socket/socket-client.service.d.ts +3 -3
  171. package/lib/_services/socket/socket-client.service.d.ts.map +1 -1
  172. package/lib/_services/socket/socket-client.service.js +35 -29
  173. package/lib/_services/socket/socket-client.service.js.map +1 -1
  174. package/lib/_services/socket/socket-server.service.d.ts +3 -3
  175. package/lib/_services/socket/socket-server.service.d.ts.map +1 -1
  176. package/lib/_services/socket/socket-server.service.js +51 -51
  177. package/lib/_services/socket/socket-server.service.js.map +1 -1
  178. package/lib/tsconfig.tsbuildinfo +1 -1
  179. package/package.json +233 -230
  180. package/src/_constants/global-settings.const.ts +2 -2
  181. package/src/_constants/mocks/app-extended-server.mock.ts +34 -35
  182. package/src/_constants/mocks/app-params.mock.ts +2 -2
  183. package/src/_constants/mocks/app-server.mock.ts +30 -30
  184. package/src/_constants/mocks/data-model.mock.ts +25 -25
  185. package/src/_constants/mocks/email-service-collection.mock.ts +2 -2
  186. package/src/_constants/mocks/endpoint.mock.ts +22 -22
  187. package/src/_constants/mocks/socket-client.mock.ts +3 -3
  188. package/src/_constants/mocks/socket-server.mock.ts +3 -3
  189. package/src/_enums/data-model-type.enum.ts +1 -0
  190. package/src/_models/control-models/api-call-params.control-model.ts +5 -5
  191. package/src/_models/control-models/app-params.control-model.ts +2 -2
  192. package/src/_models/control-models/endpoint-params.control-model.ts +35 -35
  193. package/src/_models/control-models/http-settings.control-model.ts +2 -2
  194. package/src/_models/control-models/socket-client-service-params.control-model.ts +2 -2
  195. package/src/_models/control-models/socket-event.control-model.ts +13 -13
  196. package/src/_models/control-models/socket-presence.control-model.ts +26 -14
  197. package/src/_models/control-models/socket-server-service-params.control-model.ts +4 -4
  198. package/src/_models/interfaces/certification-settings.interface.ts +1 -1
  199. package/src/_models/interfaces/global-service-settings.interface.ts +6 -6
  200. package/src/_models/interfaces/global-settings.interface.ts +1 -1
  201. package/src/_models/interfaces/routing-module-settings.interface.ts +1 -1
  202. package/src/_models/types/db-filter.type.ts +5 -2
  203. package/src/_models/types/db-update.type.ts +3 -2
  204. package/src/_modules/custom-data/custom-data.controller.ts +20 -18
  205. package/src/_modules/custom-data/custom-data.data-service.ts +8 -6
  206. package/src/_modules/custom-data/get-custom-data-routing-module.util.ts +7 -7
  207. package/src/_modules/test/get-test-routing-module.util.ts +7 -7
  208. package/src/_modules/test/test.controller.ts +34 -34
  209. package/src/_modules/usage/get-usage-routing-module.util.ts +7 -7
  210. package/src/_modules/usage/usage.controller.ts +20 -21
  211. package/src/_modules/usage/usage.data-service.ts +28 -28
  212. package/src/_services/base/data.service.ts +62 -61
  213. package/src/_services/base/db.service.ts +53 -50
  214. package/src/_services/core/api.service.ts +54 -54
  215. package/src/_services/core/auth.service.ts +9 -9
  216. package/src/_services/core/email.service.ts +33 -33
  217. package/src/_services/core/global.service.ts +37 -23
  218. package/src/_services/core/service-collection.service.ts +1 -1
  219. package/src/_services/route/controller.service.ts +4 -4
  220. package/src/_services/route/routing-module.service.ts +21 -21
  221. package/src/_services/server/app-extended.server.spec.ts +4 -4
  222. package/src/_services/server/app-extended.server.ts +27 -27
  223. package/src/_services/server/app.server.spec.ts +6 -6
  224. package/src/_services/server/app.server.ts +118 -116
  225. package/src/_services/shared.static-service.ts +8 -5
  226. package/src/_services/socket/socket-client.service.ts +79 -47
  227. package/src/_services/socket/socket-server.service.ts +61 -61
  228. package/tsconfig.json +8 -7
  229. package/lib/_models/control-models/app-system-controls.control-model copy.d.ts.map +0 -1
  230. package/lib/_models/control-models/app-system-controls.control-model copy.js.map +0 -1
  231. /package/src/_models/control-models/{app-system-controls.control-model copy.ts → app-ext-system-controls.control-model.ts} +0 -0
@@ -2,10 +2,10 @@
2
2
 
3
3
  import { Request, Response } from 'express';
4
4
 
5
- import { Dynamo_Array, Dynamo_Error, Dynamo_Log } from '@futdevpro/fsm-dynamo';
5
+ import { DynamoFM_Array, DynamoFM_Error, DynamoFM_Log } from '@futdevpro/fsm-dynamo';
6
6
  import { DynamoNTS_RouteSecurity } from '../../_enums/route-security.enum';
7
7
  import { DynamoNTS_HttpCallType } from '../../_enums/http/http-call-type.enum';
8
- import { dynamoNTS_globalSettings } from '../../_constants/global-settings.const';
8
+ import { DynamoNTS_globalSettings } from '../../_constants/global-settings.const';
9
9
  import { DynamoNTS_GlobalService } from '../../_services/core/global.service';
10
10
 
11
11
  /**
@@ -13,7 +13,7 @@ import { DynamoNTS_GlobalService } from '../../_services/core/global.service';
13
13
  * used for specific events such as saving or getting data,
14
14
  * triggering events, logging in or out, and much more
15
15
  */
16
- export class DynamoNTS_EndpointParams{
16
+ export class DynamoNTS_Endpoint_Params {
17
17
  name: string;
18
18
  security: DynamoNTS_RouteSecurity;
19
19
 
@@ -85,13 +85,13 @@ export class DynamoNTS_EndpointParams{
85
85
  ) {
86
86
  try {
87
87
  this.name = set.name ?? set.endpoint;
88
- this.security = set.security ?? dynamoNTS_globalSettings.defaultRouteSecurity;
88
+ this.security = set.security ?? DynamoNTS_globalSettings.defaultRouteSecurity;
89
89
 
90
90
  this.type = set.type;
91
91
  this.endpoint = set.endpoint;
92
92
 
93
93
  if (!this.endpoint) {
94
- throw new Dynamo_Error({
94
+ throw new DynamoFM_Error({
95
95
  status: 406,
96
96
  errorCode: 'NTS-EP0-C00',
97
97
  addECToUserMsg: true,
@@ -111,14 +111,14 @@ export class DynamoNTS_EndpointParams{
111
111
  this.preProcessess = set.preProcessess ?? [];
112
112
  this.tasks = set.tasks ?? [];
113
113
 
114
- this.logRequest = set.logRequest ?? dynamoNTS_globalSettings.logRequest;
115
- this.logRequestsParams = set.logRequestsParams ?? dynamoNTS_globalSettings.logRequestsParams;
114
+ this.logRequest = set.logRequest ?? DynamoNTS_globalSettings.logRequest;
115
+ this.logRequestsParams = set.logRequestsParams ?? DynamoNTS_globalSettings.logRequestsParams;
116
116
  this.logRequestsContent =
117
- set.logRequestsContent ?? dynamoNTS_globalSettings.logRequestsContent;
117
+ set.logRequestsContent ?? DynamoNTS_globalSettings.logRequestsContent;
118
118
  this.logResponseContent =
119
- set.logResponseContent ?? dynamoNTS_globalSettings.logResponseContent;
119
+ set.logResponseContent ?? DynamoNTS_globalSettings.logResponseContent;
120
120
  } catch (error) {
121
- Dynamo_Log.error(
121
+ DynamoFM_Log.error(
122
122
  `\nEndpoint params setup failed: name: '${set.name}' ` +
123
123
  `(security: ${set.security}) endpoint: ${set.endpoint}` +
124
124
  `\nERROR:` +
@@ -145,9 +145,9 @@ export class DynamoNTS_EndpointParams{
145
145
  }
146
146
 
147
147
  if (this.logRequestsContent && req.body && 0 < Object.keys(req.body).length) {
148
- Dynamo_Log.info(msg + `\nbody:`, req.body);
148
+ DynamoFM_Log.info(msg + `\nbody:`, req.body);
149
149
  } else {
150
- Dynamo_Log.info(msg);
150
+ DynamoFM_Log.info(msg);
151
151
  }
152
152
  }
153
153
 
@@ -171,13 +171,13 @@ export class DynamoNTS_EndpointParams{
171
171
  await this.preLog(req, res, issuer);
172
172
  }
173
173
 
174
- await Dynamo_Array.asyncForEach(this.preProcessess,
174
+ await DynamoFM_Array.asyncForEach(this.preProcessess,
175
175
  async (preProcess: (req: Request, res: Response) => Promise<void>): Promise<void> => {
176
176
  await preProcess(req, res);
177
177
  }
178
178
  );
179
179
 
180
- await Dynamo_Array.asyncForEach(this.tasks,
180
+ await DynamoFM_Array.asyncForEach(this.tasks,
181
181
  async (
182
182
  task: (req: Request, res: Response, issuer?: string) => Promise<void>
183
183
  ): Promise<void> => {
@@ -187,10 +187,10 @@ export class DynamoNTS_EndpointParams{
187
187
 
188
188
  if (this.logRequest) {
189
189
  if (this.logResponseContent) {
190
- Dynamo_Log.success(` <<<===== ${this.name} result sent.`);
191
- Dynamo_Log.warn('sorry, the logResponseContent is not implemented yet.');
190
+ DynamoFM_Log.success(` <<<===== ${this.name} result sent.`);
191
+ DynamoFM_Log.warn('sorry, the logResponseContent is not implemented yet.');
192
192
  } else {
193
- Dynamo_Log.success(` <<<===== ${this.name} result sent.`);
193
+ DynamoFM_Log.success(` <<<===== ${this.name} result sent.`);
194
194
  }
195
195
  }
196
196
  } catch (error) {
@@ -207,7 +207,7 @@ export class DynamoNTS_EndpointParams{
207
207
  private async error(
208
208
  req: Request,
209
209
  res: Response,
210
- error: Error | Dynamo_Error,
210
+ error: Error | DynamoFM_Error,
211
211
  issuer: string
212
212
  ): Promise<void> {
213
213
  try {
@@ -215,20 +215,20 @@ export class DynamoNTS_EndpointParams{
215
215
 
216
216
  msg += this.getPathParamsLogContent(req);
217
217
 
218
- Dynamo_Log.error(msg);
219
- Dynamo_Log.error(
218
+ DynamoFM_Log.error(msg);
219
+ DynamoFM_Log.error(
220
220
  'ERROR:',
221
- (error as Dynamo_Error)?.flag?.includes('DYNAMO') ?
222
- (error as Dynamo_Error).getErrorSimplified() :
221
+ (error as DynamoFM_Error)?.flag?.includes('DYNAMO') ?
222
+ (error as DynamoFM_Error).getErrorSimplified() :
223
223
  error,
224
224
  '\n'
225
225
  );
226
226
 
227
- if ((error as Dynamo_Error)?.flag?.includes('DYNAMO')) {
228
- if (!(error as Dynamo_Error).additionalContent) {
229
- (error as Dynamo_Error).additionalContent = {};
227
+ if ((error as DynamoFM_Error)?.flag?.includes('DYNAMO')) {
228
+ if (!(error as DynamoFM_Error).additionalContent) {
229
+ (error as DynamoFM_Error).additionalContent = {};
230
230
  }
231
- (error as Dynamo_Error).additionalContent.endpointInfo = msg;
231
+ (error as DynamoFM_Error).additionalContent.endpointInfo = msg;
232
232
  }
233
233
 
234
234
  await DynamoNTS_GlobalService.globalErrorHandler?.(
@@ -237,29 +237,29 @@ export class DynamoNTS_EndpointParams{
237
237
  res,
238
238
  issuer
239
239
  ).catch((err): void => {
240
- Dynamo_Log.warn('DynamoNTS_GlobalService.globalErrorHandler failed to handle error: ', err);
241
- Dynamo_Log.warn('It will proceed as normal.');
240
+ DynamoFM_Log.warn('DynamoNTS_GlobalService.globalErrorHandler failed to handle error: ', err);
241
+ DynamoFM_Log.warn('It will proceed as normal.');
242
242
  });
243
243
 
244
- res.status((error as Dynamo_Error)?.___status ?? 501);
244
+ res.status((error as DynamoFM_Error)?.___status ?? 501);
245
245
  res.send(error);
246
246
 
247
247
  if (this.logRequest) {
248
248
  if (this.logResponseContent) {
249
- Dynamo_Log.error(
250
- ` <<<===== ${this.name} error sent: ${(error as Dynamo_Error)?._message ?? ''}`
249
+ DynamoFM_Log.error(
250
+ ` <<<===== ${this.name} error sent: ${(error as DynamoFM_Error)?._message ?? ''}`
251
251
  );
252
- Dynamo_Log.error(
252
+ DynamoFM_Log.error(
253
253
  'sorry, the logResponseContent is not implemented yet.'
254
254
  );
255
255
  } else {
256
- Dynamo_Log.error(
257
- ` <<<===== ${this.name} error sent: ${(error as Dynamo_Error)?._message ?? ''}`
256
+ DynamoFM_Log.error(
257
+ ` <<<===== ${this.name} error sent: ${(error as DynamoFM_Error)?._message ?? ''}`
258
258
  );
259
259
  }
260
260
  }
261
261
  } catch (error) {
262
- Dynamo_Log.H_error(
262
+ DynamoFM_Log.H_error(
263
263
  `\n\nDYNAMO MULTILEVEL ERROR:DynamoNTS_EndpointParams: error: ` +
264
264
  `(${this.name}, ${this.endpoint})` +
265
265
  `\n(DYNAMO MULTILEVEL ERROR means, that the ERRORHANDLING is ALSO FAILED, ` +
@@ -1,6 +1,6 @@
1
1
 
2
2
  import * as BodyParser from 'body-parser';
3
- export class DynamoNTS_HttpSettings {
3
+ export class DynamoNTS_Http_Settings {
4
4
  httpPort?: number;
5
5
  httpsPort?: number;
6
6
 
@@ -20,7 +20,7 @@ export class DynamoNTS_HttpSettings {
20
20
  };
21
21
 
22
22
  constructor(
23
- set?: DynamoNTS_HttpSettings
23
+ set?: DynamoNTS_Http_Settings
24
24
  ) {
25
25
  if (set) {
26
26
  Object.assign(this, set);
@@ -6,7 +6,7 @@ import { second } from '@futdevpro/fsm-dynamo';
6
6
  /**
7
7
  * socket handling and clarification is under development
8
8
  */
9
- export class DynamoNTS_SocketClientServiceParams {
9
+ export class DynamoNTS_SocketClientService_Params {
10
10
  service: string;
11
11
  name: string;
12
12
  address?: string = 'ws://localhost';
@@ -16,7 +16,7 @@ export class DynamoNTS_SocketClientServiceParams {
16
16
  socketOptions?: Partial<SocketIO.ManagerOptions & SocketIO.SocketOptions>;
17
17
 
18
18
  constructor(
19
- set: DynamoNTS_SocketClientServiceParams
19
+ set: DynamoNTS_SocketClientService_Params
20
20
  ) {
21
21
  Object.assign(this, set);
22
22
 
@@ -1,6 +1,6 @@
1
1
 
2
- import { Dynamo_Array, Dynamo_Log } from '@futdevpro/fsm-dynamo';
3
- import { dynamoNTS_globalSettings } from '../../_constants/global-settings.const';
2
+ import { DynamoFM_Array, DynamoFM_Log } from '@futdevpro/fsm-dynamo';
3
+ import { DynamoNTS_globalSettings } from '../../_constants/global-settings.const';
4
4
  import { DynamoNTS_SocketEventKey } from '../../_enums/http/socket-event-type.enum';
5
5
 
6
6
 
@@ -78,15 +78,15 @@ export class DynamoNTS_SocketEvent<T>{
78
78
  DynamoNTS_SocketEventKey.disconnect,
79
79
  ] as string[]).includes(this.eventKey)
80
80
  ) {
81
- this.logEvent = dynamoNTS_globalSettings.logMainSocketEvents ||
82
- dynamoNTS_globalSettings.logAllSocketEvent;
81
+ this.logEvent = DynamoNTS_globalSettings.logMainSocketEvents ||
82
+ DynamoNTS_globalSettings.logAllSocketEvent;
83
83
  } else {
84
- this.logEvent = dynamoNTS_globalSettings.logAllSocketEvent;
84
+ this.logEvent = DynamoNTS_globalSettings.logAllSocketEvent;
85
85
  }
86
86
  this.logEventContent = set.logEventContent !== undefined ?
87
- set.logEventContent : dynamoNTS_globalSettings.logSocketEventContent;
87
+ set.logEventContent : DynamoNTS_globalSettings.logSocketEventContent;
88
88
  } catch (error) {
89
- Dynamo_Log.error(
89
+ DynamoFM_Log.error(
90
90
  `\nSocket Event params setup failed (${this.serviceName}): ${set.eventKey}`,
91
91
  error
92
92
  );
@@ -102,15 +102,15 @@ export class DynamoNTS_SocketEvent<T>{
102
102
  private async getPreLog(content: T, issuer?: string): Promise<void> {
103
103
  try {
104
104
  if (this.logEventContent && this.eventKey !== DynamoNTS_SocketEventKey.connection) {
105
- Dynamo_Log.log(
105
+ DynamoFM_Log.log(
106
106
  `---> incoming socket(${this.serviceName}) event: ${this.eventKey};
107
107
  \ncontent:`, content
108
108
  );
109
109
  } else {
110
- Dynamo_Log.log(`---> incoming socket(${this.serviceName}) event: ${this.eventKey}...`);
110
+ DynamoFM_Log.log(`---> incoming socket(${this.serviceName}) event: ${this.eventKey}...`);
111
111
  }
112
112
  } catch (error) {
113
- Dynamo_Log.error(`PreLog failed... (socket: ${this.serviceName})`, error);
113
+ DynamoFM_Log.error(`PreLog failed... (socket: ${this.serviceName})`, error);
114
114
  }
115
115
  }
116
116
 
@@ -124,18 +124,18 @@ export class DynamoNTS_SocketEvent<T>{
124
124
  await this.getPreLog(content, issuer);
125
125
  }
126
126
 
127
- await Dynamo_Array.asyncForEach(
127
+ await DynamoFM_Array.asyncForEach(
128
128
  this.preProcessess,
129
129
  async (preProcess: DynamoNTS_SocketEventPreprocessTask<any, any>) => {
130
130
  content = await preProcess(content);
131
131
  }
132
132
  );
133
133
 
134
- await Dynamo_Array.asyncForEach(this.tasks, async (task: DynamoNTS_SocketEventTask<T>) => {
134
+ await DynamoFM_Array.asyncForEach(this.tasks, async (task: DynamoNTS_SocketEventTask<T>) => {
135
135
  await task(content, issuer);
136
136
  });
137
137
  } catch (error) {
138
- Dynamo_Log.error(
138
+ DynamoFM_Log.error(
139
139
  `Socket Event tasks failed to execute on ${this.serviceName}.... (${this.eventKey})`,
140
140
  error,
141
141
  'content:',
@@ -1,6 +1,6 @@
1
1
 
2
2
  import {
3
- Dynamo_AnyError, Dynamo_Error, Dynamo_Error_Settings, Dynamo_Log
3
+ DynamoFM_AnyError, DynamoFM_Error, DynamoFM_Error_Settings, DynamoFM_Log
4
4
  } from '@futdevpro/fsm-dynamo';
5
5
  import * as SocketIO from 'socket.io';
6
6
 
@@ -8,6 +8,10 @@ import * as SocketIO from 'socket.io';
8
8
  * socket handling and clarification is under development
9
9
  */
10
10
  export class DynamoNTS_SocketPresence {
11
+ /**
12
+ * this is the presence ID which is used to getand handle the presence
13
+ * usually the service master identifier such as userID
14
+ * */
11
15
  issuerId: string;
12
16
  serviceName?: string = 'unknown';
13
17
  onDestroy?: (issuerId: string) => void = (): void => {};
@@ -20,6 +24,10 @@ export class DynamoNTS_SocketPresence {
20
24
 
21
25
  constructor(
22
26
  set: {
27
+ /**
28
+ * this is the presence ID which is used to get and set handle the presence/sockets
29
+ * usually the service master identifier such as userID
30
+ * */
23
31
  issuerId: string,
24
32
  serviceName?: string,
25
33
  onDestroy?: (issuerId: string) => void,
@@ -27,11 +35,15 @@ export class DynamoNTS_SocketPresence {
27
35
  defaultErrorUserMsg?: string,
28
36
  sockets: SocketIO.Socket[],
29
37
 
38
+ /**
39
+ * this is the issuer ID which is used to register data changes,
40
+ * usually the main master identifier such as accountID
41
+ */
30
42
  issuer: string,
31
43
  }
32
44
  ) {
33
45
  if (!set?.issuerId) {
34
- throw new Dynamo_Error({
46
+ throw new DynamoFM_Error({
35
47
  ...this._getDefaultErrorSettings(
36
48
  'constructor',
37
49
  new Error(
@@ -60,7 +72,7 @@ export class DynamoNTS_SocketPresence {
60
72
  }
61
73
 
62
74
  if (!set?.sockets?.length) {
63
- throw new Dynamo_Error({
75
+ throw new DynamoFM_Error({
64
76
  ...this._getDefaultErrorSettings(
65
77
  'constructor',
66
78
  new Error(
@@ -89,13 +101,13 @@ export class DynamoNTS_SocketPresence {
89
101
 
90
102
  this.sockets.forEach((socket: SocketIO.Socket, index: number) => {
91
103
  if (!socket.connected) {
92
- Dynamo_Log.warn(
104
+ DynamoFM_Log.warn(
93
105
  `Emitting event '${event}' on socket(${this.serviceName})-(${index}) failed!` +
94
106
  `\nERROR: socket[${socket.id}] is not connected! (it will be removed...)`
95
107
  );
96
108
 
97
109
  /* errors.push(
98
- new Dynamo_Error({
110
+ new DynamoFM_Error({
99
111
  status: 500,
100
112
  errorCode: 'NTS-SPC-EE1',
101
113
  addECToUserMsg: true,
@@ -125,7 +137,7 @@ export class DynamoNTS_SocketPresence {
125
137
 
126
138
  this.sockets.forEach((socket: SocketIO.Socket, index: number): void => {
127
139
  const success: boolean = socket.emit(event, content, (error): void => {
128
- Dynamo_Log.error(
140
+ DynamoFM_Log.error(
129
141
  `Emitting event '${event}' on socket(${this.serviceName})-(${index}) failed!(0)` +
130
142
  `\nerror:`, error
131
143
  );
@@ -133,14 +145,14 @@ export class DynamoNTS_SocketPresence {
133
145
  });
134
146
 
135
147
  if (!success) {
136
- Dynamo_Log.error(
148
+ DynamoFM_Log.error(
137
149
  `Emitting event '${event}' on socket(${this.serviceName})-(${index}) failed!(1)`
138
150
  );
139
151
  }
140
152
  });
141
153
 
142
154
  if (0 < errors.length) {
143
- throw new Dynamo_Error({
155
+ throw new DynamoFM_Error({
144
156
  ...this._getDefaultErrorSettings(
145
157
  'emitEvent',
146
158
  new Error(
@@ -159,7 +171,7 @@ export class DynamoNTS_SocketPresence {
159
171
  });
160
172
 
161
173
  } else if (this.sockets.length === 0) {
162
- throw new Dynamo_Error({
174
+ throw new DynamoFM_Error({
163
175
  ...this._getDefaultErrorSettings(
164
176
  'emitEvent',
165
177
  new Error(
@@ -177,15 +189,15 @@ export class DynamoNTS_SocketPresence {
177
189
 
178
190
  private _getDefaultErrorSettings(
179
191
  fnName: string,
180
- error: Dynamo_AnyError,
192
+ error: DynamoFM_AnyError,
181
193
  issuer: string
182
- ): Dynamo_Error_Settings {
194
+ ): DynamoFM_Error_Settings {
183
195
  return {
184
- status: (error as Dynamo_Error)?.___status ?? 406,
196
+ status: (error as DynamoFM_Error)?.___status ?? 406,
185
197
  message: (error as Error)?.message ?? `${fnName} was UNSUCCESFUL (NTS; ${this.serviceName})`,
186
- userMessage: (error as Dynamo_Error)?.__userMessage ?? this.defaultErrorUserMsg,
198
+ userMessage: (error as DynamoFM_Error)?.__userMessage ?? this.defaultErrorUserMsg,
187
199
  issuerService: this.serviceName + ` (${this?.constructor?.name}-DynamoNTS_SocketPresence)`,
188
- addECToUserMsg: !(error as Dynamo_Error)?.__userMessage,
200
+ addECToUserMsg: !(error as DynamoFM_Error)?.__userMessage,
189
201
  issuer: issuer,
190
202
  error: error,
191
203
  };
@@ -1,20 +1,20 @@
1
1
 
2
- import { dynamoNTS_globalSettings } from '../../_constants/global-settings.const';
2
+ import { DynamoNTS_globalSettings } from '../../_constants/global-settings.const';
3
3
  import { DynamoNTS_SocketSecurity } from '../../_enums/socket-security.enum';
4
4
 
5
5
  /**
6
6
  * socket handling and clarification is under development
7
7
  */
8
- export class DynamoNTS_SocketServerServiceParams<T = any> {
8
+ export class DynamoNTS_SocketServerService_Params<T = any> {
9
9
  name: string;
10
10
  port: number;
11
11
  security?: DynamoNTS_SocketSecurity;
12
12
 
13
13
  constructor(
14
- set: DynamoNTS_SocketServerServiceParams<T>
14
+ set: DynamoNTS_SocketServerService_Params<T>
15
15
  ) {
16
16
  this.name = set.name;
17
17
  this.port = set.port;
18
- this.security = set.security ? set.security : dynamoNTS_globalSettings.defaultSocketSecurity;
18
+ this.security = set.security ? set.security : DynamoNTS_globalSettings.defaultSocketSecurity;
19
19
  }
20
20
  }
@@ -1,7 +1,7 @@
1
1
 
2
2
  import * as FileSystem from 'fs';
3
3
 
4
- export interface DynamoNTS_CertificationSettings {
4
+ export interface DynamoNTS_Certification_Settings {
5
5
  keyPath: FileSystem.PathLike,
6
6
  certPath: FileSystem.PathLike,
7
7
  }
@@ -4,14 +4,14 @@
4
4
 
5
5
  import { Request, Response } from 'express';
6
6
 
7
- import { Dynamo_DataParams } from '@futdevpro/fsm-dynamo';
7
+ import { DynamoFM_DataModel_Params } from '@futdevpro/fsm-dynamo';
8
8
 
9
- import { DynamoNTS_ServiceCollection } from '../../_services/core/service-collection.service';
9
+ import { DynamoNTS_Service_Collection } from '../../_services/core/service-collection.service';
10
10
  import { DynamoNTS_EmailService } from '../../_services/core/email.service';
11
11
  import { DynamoNTS_AuthService } from '../../_services/core/auth.service';
12
12
 
13
13
 
14
- export interface DynamoNTS_GlobalServiceSettings {
14
+ export interface DynamoNTS_GlobalService_Settings {
15
15
  /**
16
16
  * You need to setup your Own Auth Service extending the DynamoNTS_AuthService class
17
17
  */
@@ -20,12 +20,12 @@ export interface DynamoNTS_GlobalServiceSettings {
20
20
  /**
21
21
  * You can setup your Own Email Service extending the DynamoNTS_EmailServiceCollection class
22
22
  */
23
- emailServiceCollection?: DynamoNTS_ServiceCollection<DynamoNTS_EmailService>,
23
+ emailServiceCollection?: DynamoNTS_Service_Collection<DynamoNTS_EmailService>,
24
24
 
25
25
  /**
26
- * you can setup data tables by passing a Dynamo_DataParams list at this point
26
+ * you can setup data tables by passing a DynamoFM_DataModel_Params list at this point
27
27
  */
28
- dbModels?: Dynamo_DataParams[],
28
+ dbModels?: DynamoFM_DataModel_Params[],
29
29
 
30
30
  /**
31
31
  * you can setup other services by passing a DynamoNTS_SingletonService list at this point
@@ -9,7 +9,7 @@ import { DynamoNTS_SocketSecurity } from '../../_enums/socket-security.enum';
9
9
  * @param logEventContent only will log if the specific socket event is also set to log
10
10
  *
11
11
  */
12
- export interface DynamoNTS_GlobalSettings {
12
+ export interface DynamoNTS_Global_Settings {
13
13
  /**
14
14
  * this will be used as the main baseUrl for the application,
15
15
  * this is not required, but we suggest to use at least a '/api' as base route
@@ -4,7 +4,7 @@ import { DynamoNTS_Controller } from '../../_services';
4
4
  /**
5
5
  * This is a main route point handler, which collects a list of controllers for the API
6
6
  */
7
- export interface DynamoNTS_RoutingModuleSettings {
7
+ export interface DynamoNTS_RoutingModule_Settings {
8
8
  /**
9
9
  * main route of the module
10
10
  */
@@ -20,12 +20,15 @@
20
20
  * //
21
21
  * @returns {T} data: T
22
22
  */
23
- export type DynamoNTS_DBFilter<T> = DynamoNTS_DBFilterSimple<T> | DynamoNTS_DBFilterOR<T> |DynamoNTS_DBFilterNOR<T>;
23
+ export type DynamoNTS_DBFilter<T> =
24
+ DynamoNTS_DBFilterSimple<T> |
25
+ DynamoNTS_DBFilterOR<T> |
26
+ DynamoNTS_DBFilterNOR<T>;
24
27
 
25
28
  /**
26
29
  * A simple filter for a DynamoDB query.
27
30
  */
28
- export type DynamoNTS_DBFilterSimple<T> = {
31
+ export type DynamoNTS_DBFilterSimple<T> = {
29
32
  [K in keyof T]?: T[K] | DynamoNTS_DBFilterExpressions<T[K]>;
30
33
  } & {
31
34
  [path: string]: any;
@@ -27,7 +27,7 @@
27
27
  * $unset: // Removes the specified field from a document. (set: "" to value)
28
28
  * //
29
29
  */
30
- export type DynamoNTS_DBUpdate<T> = {
30
+ export type DynamoNTS_DBUpdate<T> = {
31
31
  /**
32
32
  * Sets the value of a field to current date, either as a Date or a Timestamp.
33
33
  */
@@ -61,7 +61,8 @@
61
61
  */
62
62
  $set?: { [K in keyof T]?: string } | any;
63
63
  /**
64
- * Sets the value of a field if an update results in an insert of a document. Has no effect on update operations that modify existing documents.
64
+ * Sets the value of a field if an update results in an insert of a document.
65
+ * Has no effect on update operations that modify existing documents.
65
66
  */
66
67
  $setOnInsert?: { [K in keyof T]?: T[K] };
67
68
  /**
@@ -1,31 +1,33 @@
1
1
 
2
2
  import { Request, Response } from 'express';
3
3
 
4
- import { customDataModuleSettings } from '@futdevpro/fsm-dynamo';
4
+ import { DynamoFM_customDataModule_settings } from '@futdevpro/fsm-dynamo';
5
5
 
6
6
  import { DynamoNTS_HttpCallType } from '../../_enums/http/http-call-type.enum';
7
7
  import { DynamoNTS_Controller } from '../../_services/route/controller.service';
8
- import { Dynamo_CustomDataService } from './custom-data.data-service';
8
+ import { DynamoFM_CustomData_DataService } from './custom-data.data-service';
9
9
  import {
10
- DynamoNTS_EndpointParams
10
+ DynamoNTS_Endpoint_Params
11
11
  } from '../../_models/control-models/endpoint-params.control-model';
12
12
 
13
- export class CustomDataController extends DynamoNTS_Controller {
13
+ export class DynamoNTS_CustomData_Controller extends DynamoNTS_Controller {
14
14
 
15
- static getInstance(): CustomDataController {
16
- return CustomDataController.getSingletonInstance();
15
+ static getInstance(): DynamoNTS_CustomData_Controller {
16
+ return DynamoNTS_CustomData_Controller.getSingletonInstance();
17
17
  }
18
18
 
19
19
  setupEndpoints(): void {
20
20
  this.endpoints = [
21
21
  // CUSTOM DATA
22
- new DynamoNTS_EndpointParams({
22
+ new DynamoNTS_Endpoint_Params({
23
23
  name: 'getCustomData',
24
24
  type: DynamoNTS_HttpCallType.get,
25
- endpoint: customDataModuleSettings.endPoints.getCustomData,
25
+ endpoint: DynamoFM_customDataModule_settings.endPoints.getCustomData,
26
26
  tasks: [
27
27
  async (req: Request, res: Response): Promise<void> => {
28
- const customDataService = new Dynamo_CustomDataService({ _id: req.params.customId });
28
+ const customDataService = new DynamoFM_CustomData_DataService({
29
+ _id: req.params.customId,
30
+ });
29
31
 
30
32
  await customDataService.getDataById();
31
33
 
@@ -33,19 +35,19 @@ export class CustomDataController extends DynamoNTS_Controller {
33
35
  url: req.url,
34
36
  result: 'get custom call was successful!',
35
37
  response: customDataService.data,
36
- request: `.../custom/get/${req.params.customId}`
38
+ request: `.../custom/get/${req.params.customId}`,
37
39
  });
38
- }
39
- ]
40
+ },
41
+ ],
40
42
  }),
41
43
 
42
- new DynamoNTS_EndpointParams({
44
+ new DynamoNTS_Endpoint_Params({
43
45
  name: 'modifyCustomData',
44
46
  type: DynamoNTS_HttpCallType.post,
45
- endpoint: customDataModuleSettings.endPoints.modifyCustomData,
47
+ endpoint: DynamoFM_customDataModule_settings.endPoints.modifyCustomData,
46
48
  tasks: [
47
49
  async (req: Request, res: Response, issuer: string): Promise<void> => {
48
- const customDataService = new Dynamo_CustomDataService(req.body, issuer);
50
+ const customDataService = new DynamoFM_CustomData_DataService(req.body, issuer);
49
51
 
50
52
  await customDataService.saveData();
51
53
 
@@ -56,10 +58,10 @@ export class CustomDataController extends DynamoNTS_Controller {
56
58
  warning:
57
59
  'keep in mind that this is a playground DB, ' +
58
60
  'and it will be cleared out from time to time',
59
- request: req.body
61
+ request: req.body,
60
62
  });
61
- }
62
- ]
63
+ },
64
+ ],
63
65
  }),
64
66
  ];
65
67
  }
@@ -1,18 +1,20 @@
1
1
 
2
2
 
3
3
 
4
- import { customDataModelParams, Dynamo_CustomData } from '@futdevpro/fsm-dynamo/custom-data-module';
4
+ import {
5
+ DynamoFM_customDataModel_params, DynamoFM_CustomData
6
+ } from '@futdevpro/fsm-dynamo/custom-data-module';
5
7
  import { DynamoNTS_DataService } from '../../_services/base/data.service';
6
8
 
7
- export class Dynamo_CustomDataService extends DynamoNTS_DataService<Dynamo_CustomData> {
9
+ export class DynamoFM_CustomData_DataService extends DynamoNTS_DataService<DynamoFM_CustomData> {
8
10
 
9
11
  constructor(
10
- customData?: Dynamo_CustomData,
11
- issuer?: string,
12
+ customData?: DynamoFM_CustomData,
13
+ issuer?: string
12
14
  ) {
13
15
  super(
14
- new Dynamo_CustomData(customData),
15
- customDataModelParams,
16
+ new DynamoFM_CustomData(customData),
17
+ DynamoFM_customDataModel_params,
16
18
  issuer
17
19
  );
18
20
  }