@futdevpro/nts-dynamo 1.5.30 → 1.5.31

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 (197) hide show
  1. package/lib/_constants/dynamo-nts-global.settings.d.ts +3 -0
  2. package/lib/_constants/dynamo-nts-global.settings.d.ts.map +1 -0
  3. package/lib/_constants/dynamo-nts-global.settings.js +13 -0
  4. package/lib/_constants/dynamo-nts-global.settings.js.map +1 -0
  5. package/lib/_constants/index.d.ts +1 -1
  6. package/lib/_constants/index.d.ts.map +1 -1
  7. package/lib/_constants/index.js +1 -1
  8. package/lib/_constants/index.js.map +1 -1
  9. package/lib/_enums/dynamo-nts-data-service-function.enum.d.ts +8 -0
  10. package/lib/_enums/dynamo-nts-data-service-function.enum.d.ts.map +1 -0
  11. package/lib/_enums/dynamo-nts-data-service-function.enum.js +15 -0
  12. package/lib/_enums/dynamo-nts-data-service-function.enum.js.map +1 -0
  13. package/lib/_enums/dynamo-nts-route-security.enum.d.ts +6 -0
  14. package/lib/_enums/dynamo-nts-route-security.enum.d.ts.map +1 -0
  15. package/lib/_enums/dynamo-nts-route-security.enum.js +10 -0
  16. package/lib/_enums/dynamo-nts-route-security.enum.js.map +1 -0
  17. package/lib/_enums/index.d.ts +2 -2
  18. package/lib/_enums/index.d.ts.map +1 -1
  19. package/lib/_enums/index.js +2 -2
  20. package/lib/_enums/index.js.map +1 -1
  21. package/lib/_models/dynamo-module-settings.d.ts +0 -6
  22. package/lib/_models/dynamo-module-settings.d.ts.map +1 -1
  23. package/lib/_models/dynamo-module-settings.js +9 -2
  24. package/lib/_models/dynamo-module-settings.js.map +1 -1
  25. package/lib/_models/dynamo-nts-api-call-params.d.ts +37 -0
  26. package/lib/_models/dynamo-nts-api-call-params.d.ts.map +1 -0
  27. package/lib/_models/dynamo-nts-api-call-params.js +29 -0
  28. package/lib/_models/dynamo-nts-api-call-params.js.map +1 -0
  29. package/lib/_models/dynamo-nts-app-params.d.ts +18 -0
  30. package/lib/_models/dynamo-nts-app-params.d.ts.map +1 -0
  31. package/lib/_models/dynamo-nts-app-params.js +17 -0
  32. package/lib/_models/dynamo-nts-app-params.js.map +1 -0
  33. package/lib/_models/dynamo-nts-endpoint-params.d.ts +46 -0
  34. package/lib/_models/dynamo-nts-endpoint-params.d.ts.map +1 -0
  35. package/lib/_models/dynamo-nts-endpoint-params.js +117 -0
  36. package/lib/_models/dynamo-nts-endpoint-params.js.map +1 -0
  37. package/lib/_models/dynamo-nts-global-settings.d.ts +13 -0
  38. package/lib/_models/dynamo-nts-global-settings.d.ts.map +1 -0
  39. package/lib/_models/dynamo-nts-global-settings.js +3 -0
  40. package/lib/_models/dynamo-nts-global-settings.js.map +1 -0
  41. package/lib/_models/index.d.ts +4 -4
  42. package/lib/_models/index.d.ts.map +1 -1
  43. package/lib/_models/index.js +4 -5
  44. package/lib/_models/index.js.map +1 -1
  45. package/lib/_modules/api-service.index.d.ts +3 -3
  46. package/lib/_modules/api-service.index.d.ts.map +1 -1
  47. package/lib/_modules/api-service.index.js +3 -3
  48. package/lib/_modules/api-service.index.js.map +1 -1
  49. package/lib/_modules/app.index.d.ts +9 -9
  50. package/lib/_modules/app.index.d.ts.map +1 -1
  51. package/lib/_modules/app.index.js +9 -9
  52. package/lib/_modules/app.index.js.map +1 -1
  53. package/lib/_modules/auth.index.d.ts +2 -2
  54. package/lib/_modules/auth.index.d.ts.map +1 -1
  55. package/lib/_modules/auth.index.js +2 -2
  56. package/lib/_modules/auth.index.js.map +1 -1
  57. package/lib/_modules/controller.index.d.ts +3 -3
  58. package/lib/_modules/controller.index.d.ts.map +1 -1
  59. package/lib/_modules/controller.index.js +3 -3
  60. package/lib/_modules/controller.index.js.map +1 -1
  61. package/lib/_modules/data-service.index.d.ts +4 -4
  62. package/lib/_modules/data-service.index.d.ts.map +1 -1
  63. package/lib/_modules/data-service.index.js +4 -4
  64. package/lib/_modules/data-service.index.js.map +1 -1
  65. package/lib/_modules/email.index.d.ts +2 -2
  66. package/lib/_modules/email.index.d.ts.map +1 -1
  67. package/lib/_modules/email.index.js +2 -2
  68. package/lib/_modules/email.index.js.map +1 -1
  69. package/lib/_modules/test/custom-data.service.d.ts +2 -2
  70. package/lib/_modules/test/custom-data.service.d.ts.map +1 -1
  71. package/lib/_modules/test/custom-data.service.js +2 -2
  72. package/lib/_modules/test/custom-data.service.js.map +1 -1
  73. package/lib/_modules/test/get-test-routing-module.d.ts +3 -3
  74. package/lib/_modules/test/get-test-routing-module.d.ts.map +1 -1
  75. package/lib/_modules/test/get-test-routing-module.js +2 -2
  76. package/lib/_modules/test/get-test-routing-module.js.map +1 -1
  77. package/lib/_modules/test/test-controller.d.ts +2 -2
  78. package/lib/_modules/test/test-controller.d.ts.map +1 -1
  79. package/lib/_modules/test/test-controller.js +10 -10
  80. package/lib/_modules/test/test-controller.js.map +1 -1
  81. package/lib/_modules/usage/get-usage-routing-module.d.ts +3 -3
  82. package/lib/_modules/usage/get-usage-routing-module.d.ts.map +1 -1
  83. package/lib/_modules/usage/get-usage-routing-module.js +2 -2
  84. package/lib/_modules/usage/get-usage-routing-module.js.map +1 -1
  85. package/lib/_modules/usage/usage-controller.d.ts +2 -2
  86. package/lib/_modules/usage/usage-controller.d.ts.map +1 -1
  87. package/lib/_modules/usage/usage-controller.js +10 -10
  88. package/lib/_modules/usage/usage-controller.js.map +1 -1
  89. package/lib/_modules/usage/usage.service.d.ts +2 -2
  90. package/lib/_modules/usage/usage.service.d.ts.map +1 -1
  91. package/lib/_modules/usage/usage.service.js +6 -6
  92. package/lib/_modules/usage/usage.service.js.map +1 -1
  93. package/lib/_services/dynamo-nts-api.service.d.ts +19 -0
  94. package/lib/_services/dynamo-nts-api.service.d.ts.map +1 -0
  95. package/lib/_services/dynamo-nts-api.service.js +167 -0
  96. package/lib/_services/dynamo-nts-api.service.js.map +1 -0
  97. package/lib/_services/dynamo-nts-app-extended.d.ts +23 -0
  98. package/lib/_services/dynamo-nts-app-extended.d.ts.map +1 -0
  99. package/lib/_services/dynamo-nts-app-extended.js +92 -0
  100. package/lib/_services/dynamo-nts-app-extended.js.map +1 -0
  101. package/lib/_services/dynamo-nts-app.d.ts +130 -0
  102. package/lib/_services/dynamo-nts-app.d.ts.map +1 -0
  103. package/lib/_services/dynamo-nts-app.js +238 -0
  104. package/lib/_services/dynamo-nts-app.js.map +1 -0
  105. package/lib/_services/dynamo-nts-auth.service.d.ts +54 -0
  106. package/lib/_services/dynamo-nts-auth.service.d.ts.map +1 -0
  107. package/lib/_services/dynamo-nts-auth.service.js +46 -0
  108. package/lib/_services/dynamo-nts-auth.service.js.map +1 -0
  109. package/lib/_services/dynamo-nts-controller.service.d.ts +14 -0
  110. package/lib/_services/dynamo-nts-controller.service.d.ts.map +1 -0
  111. package/lib/_services/dynamo-nts-controller.service.js +21 -0
  112. package/lib/_services/dynamo-nts-controller.service.js.map +1 -0
  113. package/lib/_services/dynamo-nts-data.service.d.ts +54 -0
  114. package/lib/_services/dynamo-nts-data.service.d.ts.map +1 -0
  115. package/lib/_services/dynamo-nts-data.service.js +301 -0
  116. package/lib/_services/dynamo-nts-data.service.js.map +1 -0
  117. package/lib/_services/dynamo-nts-db-service-collection.service.d.ts +9 -0
  118. package/lib/_services/dynamo-nts-db-service-collection.service.d.ts.map +1 -0
  119. package/lib/_services/dynamo-nts-db-service-collection.service.js +11 -0
  120. package/lib/_services/dynamo-nts-db-service-collection.service.js.map +1 -0
  121. package/lib/_services/dynamo-nts-db.service.d.ts +244 -0
  122. package/lib/_services/dynamo-nts-db.service.d.ts.map +1 -0
  123. package/lib/_services/dynamo-nts-db.service.js +759 -0
  124. package/lib/_services/dynamo-nts-db.service.js.map +1 -0
  125. package/lib/_services/dynamo-nts-email-service-collection.service.d.ts +19 -0
  126. package/lib/_services/dynamo-nts-email-service-collection.service.d.ts.map +1 -0
  127. package/lib/_services/dynamo-nts-email-service-collection.service.js +21 -0
  128. package/lib/_services/dynamo-nts-email-service-collection.service.js.map +1 -0
  129. package/lib/_services/dynamo-nts-email.service.d.ts +56 -0
  130. package/lib/_services/dynamo-nts-email.service.d.ts.map +1 -0
  131. package/lib/_services/dynamo-nts-email.service.js +194 -0
  132. package/lib/_services/dynamo-nts-email.service.js.map +1 -0
  133. package/lib/_services/dynamo-nts-global.service.d.ts +62 -0
  134. package/lib/_services/dynamo-nts-global.service.d.ts.map +1 -0
  135. package/lib/_services/dynamo-nts-global.service.js +107 -0
  136. package/lib/_services/dynamo-nts-global.service.js.map +1 -0
  137. package/lib/_services/dynamo-nts-routing-module.service.d.ts +42 -0
  138. package/lib/_services/dynamo-nts-routing-module.service.d.ts.map +1 -0
  139. package/lib/_services/dynamo-nts-routing-module.service.js +146 -0
  140. package/lib/_services/dynamo-nts-routing-module.service.js.map +1 -0
  141. package/lib/_services/dynamo-nts-shared.service.d.ts +26 -0
  142. package/lib/_services/dynamo-nts-shared.service.d.ts.map +1 -0
  143. package/lib/_services/dynamo-nts-shared.service.js +63 -0
  144. package/lib/_services/dynamo-nts-shared.service.js.map +1 -0
  145. package/lib/_services/dynamo-nts-singleton.service.d.ts +9 -0
  146. package/lib/_services/dynamo-nts-singleton.service.d.ts.map +1 -0
  147. package/lib/_services/dynamo-nts-singleton.service.js +19 -0
  148. package/lib/_services/dynamo-nts-singleton.service.js.map +1 -0
  149. package/lib/_services/dynamobe-email.service.js +1 -1
  150. package/lib/_services/index.d.ts +13 -13
  151. package/lib/_services/index.d.ts.map +1 -1
  152. package/lib/_services/index.js +13 -13
  153. package/lib/_services/index.js.map +1 -1
  154. package/lib/tsconfig.tsbuildinfo +995 -319
  155. package/package.json +2 -6
  156. package/src/_constants/dynamo-nts-global.settings.ts +12 -0
  157. package/src/_constants/index.ts +1 -1
  158. package/src/_enums/{dynamobe-data-service-function.enum.ts → dynamo-nts-data-service-function.enum.ts} +1 -1
  159. package/src/_enums/{dynamobe-route-security.enum.ts → dynamo-nts-route-security.enum.ts} +1 -1
  160. package/src/_enums/index.ts +2 -2
  161. package/src/_models/dynamo-module-settings.ts +2 -2
  162. package/src/_models/{dynamobe-api-call-params.ts → dynamo-nts-api-call-params.ts} +1 -1
  163. package/src/_models/{dynamobe-app-params.ts → dynamo-nts-app-params.ts} +1 -1
  164. package/src/_models/{dynamobe-endpoint-params.ts → dynamo-nts-endpoint-params.ts} +20 -20
  165. package/src/_models/dynamo-nts-global-settings.ts +13 -0
  166. package/src/_models/index.ts +4 -5
  167. package/src/_modules/api-service.index.ts +3 -3
  168. package/src/_modules/app.index.ts +9 -9
  169. package/src/_modules/auth.index.ts +2 -2
  170. package/src/_modules/controller.index.ts +3 -3
  171. package/src/_modules/data-service.index.ts +4 -4
  172. package/src/_modules/email.index.ts +2 -2
  173. package/src/_modules/test/custom-data.service.ts +2 -2
  174. package/src/_modules/test/get-test-routing-module.ts +5 -5
  175. package/src/_modules/test/test-controller.ts +10 -10
  176. package/src/_modules/usage/get-usage-routing-module.ts +5 -5
  177. package/src/_modules/usage/usage-controller.ts +12 -12
  178. package/src/_modules/usage/usage.service.ts +6 -6
  179. package/src/_services/{dynamobe-api.service.ts → dynamo-nts-api.service.ts} +12 -12
  180. package/src/_services/dynamo-nts-app-extended.ts +124 -0
  181. package/src/_services/{dynamobe-app.ts → dynamo-nts-app.ts} +49 -49
  182. package/src/_services/{dynamobe-auth.service.ts → dynamo-nts-auth.service.ts} +2 -2
  183. package/src/_services/dynamo-nts-controller.service.ts +28 -0
  184. package/src/_services/{dynamobe-data.service.ts → dynamo-nts-data.service.ts} +7 -7
  185. package/src/_services/dynamo-nts-db-service-collection.service.ts +12 -0
  186. package/src/_services/{dynamobe-db.service.ts → dynamo-nts-db.service.ts} +1 -1
  187. package/src/_services/{dynamobe-email-service-collection.service.ts → dynamo-nts-email-service-collection.service.ts} +4 -4
  188. package/src/_services/{dynamobe-email.service.ts → dynamo-nts-email.service.ts} +11 -11
  189. package/src/_services/{dynamobe-global.service.ts → dynamo-nts-global.service.ts} +24 -24
  190. package/src/_services/{dynamobe-routing-module.service.ts → dynamo-nts-routing-module.service.ts} +26 -26
  191. package/src/_services/{dynamobe-shared.service.ts → dynamo-nts-shared.service.ts} +1 -1
  192. package/src/_services/{dynamobe-singleton.service.ts → dynamo-nts-singleton.service.ts} +1 -1
  193. package/src/_services/index.ts +13 -13
  194. package/src/_constants/dynamobe-global.settings.ts +0 -12
  195. package/src/_models/dynamobe-global-settings.ts +0 -13
  196. package/src/_services/dynamobe-controller.service.ts +0 -28
  197. package/src/_services/dynamobe-db-service-collection.service.ts +0 -12
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@futdevpro/nts-dynamo",
3
- "version": "01.05.30",
3
+ "version": "01.05.31",
4
4
  "description": "Dynamic NodeTS (NodeJS-Typescript), MongoDB Backend System Framework by Future Development Ltd.",
5
5
  "scripts": {
6
6
  "build": "npx tsc",
@@ -41,7 +41,6 @@
41
41
  "types": "./lib/_services/index.d.ts",
42
42
  "typings": "./lib/_services/index.d.ts"
43
43
  },
44
-
45
44
  "./test-module": {
46
45
  "default": "./lib/_modules/test/index.js",
47
46
  "module": "./lib/_modules/test/index.js",
@@ -54,7 +53,6 @@
54
53
  "types": "./lib/_modules/usage/index.d.ts",
55
54
  "typings": "./lib/_modules/usage/index.d.ts"
56
55
  },
57
-
58
56
  "./app": {
59
57
  "default": "./lib/_modules/app.index.js",
60
58
  "module": "./lib/_modules/app.index.js",
@@ -112,14 +110,12 @@
112
110
  "services": [
113
111
  "lib/_services/index.d.ts"
114
112
  ],
115
-
116
113
  "test-module": [
117
114
  "lib/_modules/test/index.d.ts"
118
115
  ],
119
116
  "usage-module": [
120
117
  "lib/_modules/usage/index.d.ts"
121
118
  ],
122
-
123
119
  "app": [
124
120
  "lib/_modules/app.index.d.ts"
125
121
  ],
@@ -163,7 +159,6 @@
163
159
  "homepage": "https:/futdevpro.hu/projects/dynamo",
164
160
  "peerDependencies": {
165
161
  "@futdevpro/fsm-dynamo": "^1.5.23",
166
-
167
162
  "@types/express": "^4.17.7",
168
163
  "@types/geoip-lite": "^1.4.1",
169
164
  "@types/nodemailer": "^6.4.4",
@@ -176,6 +171,7 @@
176
171
  },
177
172
  "dependencies": {
178
173
  "@types/node": "~14.0.27",
174
+ "socket.io": "^4.5.2",
179
175
  "ts-node": "~8.10.2",
180
176
  "tslib": "~2.0.1",
181
177
  "typescript": "~3.9.7"
@@ -0,0 +1,12 @@
1
+
2
+ import { DynamoNTS_RouteSecurity } from '../_enums/dynamo-nts-route-security.enum';
3
+ import { DynamoNTS_GlobalSettings } from '../_models/dynamo-nts-global-settings';
4
+
5
+ export const dynamoNTS_GlobalSettings: DynamoNTS_GlobalSettings = {
6
+ baseUrl: '/api',
7
+ defaultRouteSecurity: DynamoNTS_RouteSecurity.open,
8
+ logSetup: false,
9
+ logRequests: true,
10
+ logRequestsContent: true,
11
+ logResponseContent: false,
12
+ };
@@ -1,2 +1,2 @@
1
1
 
2
- export * from './dynamobe-global.settings';
2
+ export * from './dynamo-nts-global.settings';
@@ -1,6 +1,6 @@
1
1
 
2
2
  /* DataServiceFunction */
3
- export enum DynamoBEDSF {
3
+ export enum DynamoNTS_DSF {
4
4
  getAll = 'getAll',
5
5
  getDataById = 'getDataById',
6
6
  /* checkIfDataExists = 'checkIfDataExists',
@@ -1,5 +1,5 @@
1
1
 
2
- export enum DynamoBERouteSecurity {
2
+ export enum DynamoNTS_RouteSecurity {
3
3
  open = 'open',
4
4
  secure = 'secure',
5
5
  both = 'both',
@@ -2,8 +2,8 @@
2
2
 
3
3
  // ENUMS
4
4
  export * from './data-model-type.enum';
5
- export * from './dynamobe-data-service-function.enum';
6
- export * from './dynamobe-route-security.enum';
5
+ export * from './dynamo-nts-data-service-function.enum';
6
+ export * from './dynamo-nts-route-security.enum';
7
7
  export * from './predefined-data-types.enum';
8
8
  // HTTP ENUMS
9
9
  export * from './http/http-call-type.enum';
@@ -2,9 +2,9 @@
2
2
  /**
3
3
  *
4
4
  */
5
- export interface DynamoModuleSettings {
5
+ /* export interface DynamoModuleSettings {
6
6
  mainRoute: string;
7
7
  endPoints: {
8
8
  [endpointName: string]: string
9
9
  }
10
- }
10
+ } */
@@ -2,7 +2,7 @@
2
2
  import { HttpCallType } from "../_enums/http/http-call-type.enum";
3
3
  import { HttpResponseType } from "../_enums/http/http-response-type.enum";
4
4
 
5
- export class DynamoBEApiCallParams {
5
+ export class DynamoNTS_ApiCallParams {
6
6
  name: string;
7
7
  type: HttpCallType;
8
8
  baseUrl: string;
@@ -2,7 +2,7 @@
2
2
  /**
3
3
  *
4
4
  */
5
- export class DynamoBEAppParams {
5
+ export class DynamoNTS_AppParams {
6
6
  name: string;
7
7
  title: string;
8
8
  version: string;
@@ -3,17 +3,17 @@
3
3
  import { NextFunction, Request, Response } from 'express';
4
4
 
5
5
  import { HttpCallType } from '../_enums/http/http-call-type.enum';
6
- import { DynamoBERouteSecurity } from '../_enums/dynamobe-route-security.enum';
7
- import { DBE_Shared } from '../_services/dynamobe-shared.service';
8
- import { DBE_Global_S } from '../_services/dynamobe-global.service';
9
- import { dynamoBEGlobalSettings } from '../_constants';
6
+ import { DynamoNTS_RouteSecurity } from '../_enums/dynamo-nts-route-security.enum';
7
+ import { DynamoNTS_Shared } from '../_services/dynamo-nts-shared.service';
8
+ import { DynamoNTS_GlobalService } from '../_services/dynamo-nts-global.service';
9
+ import { dynamoNTS_GlobalSettings } from '../_constants';
10
10
 
11
11
  /**
12
12
  *
13
13
  */
14
- export class DynamoBEEndpointParams{
14
+ export class DynamoNTS_EndpointParams{
15
15
  name: string;
16
- security: DynamoBERouteSecurity;
16
+ security: DynamoNTS_RouteSecurity;
17
17
 
18
18
  type: HttpCallType;
19
19
  endpoint: string;
@@ -30,7 +30,7 @@ export class DynamoBEEndpointParams{
30
30
  constructor(
31
31
  set: {
32
32
  name: string,
33
- security?: DynamoBERouteSecurity,
33
+ security?: DynamoNTS_RouteSecurity,
34
34
 
35
35
  type: HttpCallType,
36
36
  endpoint: string,
@@ -45,7 +45,7 @@ export class DynamoBEEndpointParams{
45
45
  ) {
46
46
  try {
47
47
  this.name = set.name ? set.name : set.endpoint;
48
- this.security = set.security ? set.security : dynamoBEGlobalSettings.defaultRouteSecurity;
48
+ this.security = set.security ? set.security : dynamoNTS_GlobalSettings.defaultRouteSecurity;
49
49
 
50
50
  this.type = set.type;
51
51
  this.endpoint = set.endpoint;
@@ -58,15 +58,15 @@ export class DynamoBEEndpointParams{
58
58
  this.preProcessess = set.preProcessess ? set.preProcessess : [];
59
59
  this.tasks = set.tasks;
60
60
 
61
- this.logRequest = set.logRequest !== undefined ? set.logRequest : dynamoBEGlobalSettings.logRequests;
62
- this.logRequestsContent = set.logRequestsContent !== undefined ? set.logRequestsContent : dynamoBEGlobalSettings.logRequestsContent;
63
- this.logResponseContent = set.logResponseContent !== undefined ? set.logResponseContent : dynamoBEGlobalSettings.logResponseContent;
61
+ this.logRequest = set.logRequest !== undefined ? set.logRequest : dynamoNTS_GlobalSettings.logRequests;
62
+ this.logRequestsContent = set.logRequestsContent !== undefined ? set.logRequestsContent : dynamoNTS_GlobalSettings.logRequestsContent;
63
+ this.logResponseContent = set.logResponseContent !== undefined ? set.logResponseContent : dynamoNTS_GlobalSettings.logResponseContent;
64
64
 
65
65
  if (this.logRequest) {
66
66
  this.preProcessess.unshift(this.getPreLog());
67
67
  }
68
68
  } catch (error) {
69
- DBE_Shared.logError(
69
+ DynamoNTS_Shared.logError(
70
70
  `\nEndpoint params setup failed: ${set.name} (${set.security}): ${set.endpoint}`, error);
71
71
  throw error;
72
72
  }
@@ -113,7 +113,7 @@ export class DynamoBEEndpointParams{
113
113
  getTasksExecution(): (req: Request, res: Response) => Promise<void> {
114
114
  return async (req: Request, res: Response) => {
115
115
  try {
116
- const issuer: string = DBE_Global_S.getAuthService().getAccountIdFromRequest(req);
116
+ const issuer: string = DynamoNTS_GlobalService.getAuthService().getAccountIdFromRequest(req);
117
117
 
118
118
  for (let i = 0; i < this.tasks.length; i++) {
119
119
  await this.tasks[i](req, res, issuer);
@@ -121,10 +121,10 @@ export class DynamoBEEndpointParams{
121
121
 
122
122
  if (this.logRequest) {
123
123
  if (this.logResponseContent) {
124
- DBE_Shared.logSuccess(` <<<===== ${this.name} result sent.`);
125
- DBE_Shared.logSuccess('sorry, the logResponseContent is not implemented yet.');
124
+ DynamoNTS_Shared.logSuccess(` <<<===== ${this.name} result sent.`);
125
+ DynamoNTS_Shared.logSuccess('sorry, the logResponseContent is not implemented yet.');
126
126
  } else {
127
- DBE_Shared.logSuccess(` <<<===== ${this.name} result sent.`);
127
+ DynamoNTS_Shared.logSuccess(` <<<===== ${this.name} result sent.`);
128
128
  }
129
129
  }
130
130
  } catch (error) {
@@ -139,16 +139,16 @@ export class DynamoBEEndpointParams{
139
139
  * @param error
140
140
  */
141
141
  error(res: Response, error): void {
142
- DBE_Shared.logError(`${this.name} ERROR`, error, '\n');
142
+ DynamoNTS_Shared.logError(`${this.name} ERROR`, error, '\n');
143
143
  res.status(error.status ? error.status : 501);
144
144
  res.send(error);
145
145
 
146
146
  if (this.logRequest) {
147
147
  if (this.logResponseContent) {
148
- DBE_Shared.logError(` <<<===== ${this.name} error sent.`);
149
- DBE_Shared.logError('sorry, the logResponseContent is not implemented yet.');
148
+ DynamoNTS_Shared.logError(` <<<===== ${this.name} error sent.`);
149
+ DynamoNTS_Shared.logError('sorry, the logResponseContent is not implemented yet.');
150
150
  } else {
151
- DBE_Shared.logError(` <<<===== ${this.name} error sent.`);
151
+ DynamoNTS_Shared.logError(` <<<===== ${this.name} error sent.`);
152
152
  }
153
153
  }
154
154
  }
@@ -0,0 +1,13 @@
1
+ import { DynamoNTS_RouteSecurity } from '../_enums/dynamo-nts-route-security.enum';
2
+
3
+ /**
4
+ *
5
+ */
6
+ export interface DynamoNTS_GlobalSettings {
7
+ baseUrl: string;
8
+ defaultRouteSecurity: DynamoNTS_RouteSecurity;
9
+ logSetup?: boolean;
10
+ logRequests?: boolean;
11
+ logRequestsContent?: boolean;
12
+ logResponseContent?: boolean;
13
+ }
@@ -1,9 +1,8 @@
1
1
 
2
2
 
3
3
  // MODELS
4
- export * from './dynamobe-api-call-params';
5
- export * from './dynamobe-app-params';
6
- /* export * from './dynamobe-data-model-params'; */
7
- export * from './dynamobe-endpoint-params';
8
- export * from './dynamobe-global-settings';
4
+ export * from './dynamo-nts-api-call-params';
5
+ export * from './dynamo-nts-app-params';
6
+ export * from './dynamo-nts-endpoint-params';
7
+ export * from './dynamo-nts-global-settings';
9
8
 
@@ -1,10 +1,10 @@
1
1
 
2
2
  // SERVICES
3
- export * from '../_services/dynamobe-api.service';
4
- export * from '../_services/dynamobe-singleton.service';
3
+ export * from '../_services/dynamo-nts-api.service';
4
+ export * from '../_services/dynamo-nts-singleton.service';
5
5
 
6
6
  // MODELS
7
- export * from '../_models/dynamobe-api-call-params';
7
+ export * from '../_models/dynamo-nts-api-call-params';
8
8
  export * from '@futdevpro/fsm-dynamo/error-module';
9
9
 
10
10
  // ENUMS
@@ -1,18 +1,18 @@
1
1
 
2
2
  // SERVICES
3
- export * from '../_services/dynamobe-app';
4
- export * from '../_services/dynamobe-global.service';
5
- export * from '../_services/dynamobe-routing-module.service';
6
- export * from '../_services/dynamobe-shared.service';
3
+ export * from '../_services/dynamo-nts-app';
4
+ export * from '../_services/dynamo-nts-global.service';
5
+ export * from '../_services/dynamo-nts-routing-module.service';
6
+ export * from '../_services/dynamo-nts-shared.service';
7
7
 
8
8
  // MODELS
9
- export * from '../_models/dynamobe-app-params';
10
- export * from '../_models/dynamobe-endpoint-params';
11
- export * from '../_models/dynamobe-global-settings';
9
+ export * from '../_models/dynamo-nts-app-params';
10
+ export * from '../_models/dynamo-nts-endpoint-params';
11
+ export * from '../_models/dynamo-nts-global-settings';
12
12
 
13
13
  // ENUMS
14
- export * from '../_enums/dynamobe-route-security.enum';
14
+ export * from '../_enums/dynamo-nts-route-security.enum';
15
15
 
16
16
  // CONSTANTS
17
- export * from '../_constants/dynamobe-global.settings';
17
+ export * from '../_constants/dynamo-nts-global.settings';
18
18
 
@@ -1,7 +1,7 @@
1
1
 
2
2
  // SERVICES
3
- export * from '../_services/dynamobe-auth.service';
4
- export * from '../_services/dynamobe-shared.service';
3
+ export * from '../_services/dynamo-nts-auth.service';
4
+ export * from '../_services/dynamo-nts-shared.service';
5
5
 
6
6
  // MODELS
7
7
  export * from '@futdevpro/fsm-dynamo/error-module';
@@ -1,10 +1,10 @@
1
1
 
2
2
  // SERVICES
3
- export * from '../_services/dynamobe-controller.service';
3
+ export * from '../_services/dynamo-nts-controller.service';
4
4
 
5
5
  // MODELS
6
- export * from '../_models/dynamobe-endpoint-params';
6
+ export * from '../_models/dynamo-nts-endpoint-params';
7
7
 
8
8
  // ENUMS
9
- export * from '../_enums/dynamobe-route-security.enum';
9
+ export * from '../_enums/dynamo-nts-route-security.enum';
10
10
  export * from '../_enums/http/http-call-type.enum';
@@ -1,9 +1,9 @@
1
1
 
2
2
  // SERVICES
3
- export * from '../_services/dynamobe-data.service';
4
- export * from '../_services/dynamobe-db.service';
5
- export * from '../_services/dynamobe-global.service';
6
- export * from '../_services/dynamobe-shared.service';
3
+ export * from '../_services/dynamo-nts-data.service';
4
+ export * from '../_services/dynamo-nts-db.service';
5
+ export * from '../_services/dynamo-nts-global.service';
6
+ export * from '../_services/dynamo-nts-shared.service';
7
7
 
8
8
  // MODELS
9
9
  export * from '@futdevpro/fsm-dynamo/error-module';
@@ -1,7 +1,7 @@
1
1
 
2
2
  // SERVICES
3
- export * from '../_services/dynamobe-email.service';
4
- export * from '../_services/dynamobe-email-service-collection.service';
3
+ export * from '../_services/dynamo-nts-email.service';
4
+ export * from '../_services/dynamo-nts-email-service-collection.service';
5
5
 
6
6
  // MODELS
7
7
  export * from '@futdevpro/fsm-dynamo/error-module';
@@ -2,9 +2,9 @@
2
2
 
3
3
 
4
4
  import { CustomData, customDataModelParams } from '@futdevpro/fsm-dynamo/test-module';
5
- import { DynamoBEDataService } from '../../_services/dynamobe-data.service';
5
+ import { DynamoNTS_DataService } from '../../_services/dynamo-nts-data.service';
6
6
 
7
- export class CustomDataService extends DynamoBEDataService<CustomData> {
7
+ export class CustomDataService extends DynamoNTS_DataService<CustomData> {
8
8
 
9
9
  constructor(
10
10
  customData?: CustomData,
@@ -1,16 +1,16 @@
1
1
 
2
2
  import { testModuleSettings } from '@futdevpro/fsm-dynamo/test-module';
3
- import { DynamoBERouteSecurity } from '../../_enums/dynamobe-route-security.enum';
4
- import { DynamoBERoutingModule, DynamoBERoutingModuleSettings } from '../../_services/dynamobe-routing-module.service';
3
+ import { DynamoNTS_RouteSecurity } from '../../_enums/dynamo-nts-route-security.enum';
4
+ import { DynamoNTS_RoutingModule, DynamoNTS_RoutingModuleSettings } from '../../_services/dynamo-nts-routing-module.service';
5
5
  import { TestController } from './test-controller';
6
6
 
7
- export function getTestRoutingModule(securityOverride?: DynamoBERouteSecurity): DynamoBERoutingModule {
8
- const set: DynamoBERoutingModuleSettings = {
7
+ export function getTestRoutingModule(securityOverride?: DynamoNTS_RouteSecurity): DynamoNTS_RoutingModule {
8
+ const set: DynamoNTS_RoutingModuleSettings = {
9
9
  route: testModuleSettings.mainRoute,
10
10
  controllers: [ TestController.getInstance() ]
11
11
  }
12
12
  if (securityOverride) {
13
13
  set.securityOverride = securityOverride;
14
14
  }
15
- return new DynamoBERoutingModule(set);
15
+ return new DynamoNTS_RoutingModule(set);
16
16
  }
@@ -2,11 +2,11 @@
2
2
  import { Request, Response } from 'express';
3
3
  import { testModuleSettings } from '@futdevpro/fsm-dynamo/test-module';
4
4
  import { HttpCallType } from '../../_enums/http/http-call-type.enum';
5
- import { DynamoBEEndpointParams } from '../../_models/dynamobe-endpoint-params';
6
- import { DynamoBEController } from '../../_services/dynamobe-controller.service';
5
+ import { DynamoNTS_EndpointParams } from '../../_models/dynamo-nts-endpoint-params';
6
+ import { DynamoNTS_Controller } from '../../_services/dynamo-nts-controller.service';
7
7
  import { CustomDataService } from './custom-data.service';
8
8
 
9
- export class TestController extends DynamoBEController {
9
+ export class TestController extends DynamoNTS_Controller {
10
10
 
11
11
  static getInstance(): TestController {
12
12
  return TestController.getSingletonInstance();
@@ -15,7 +15,7 @@ export class TestController extends DynamoBEController {
15
15
  setupEndpoints(): void {
16
16
  this.endpoints = [
17
17
  // TESTS
18
- new DynamoBEEndpointParams({
18
+ new DynamoNTS_EndpointParams({
19
19
  name: 'testGet',
20
20
  type: HttpCallType.get,
21
21
  endpoint: testModuleSettings.endPoints.testGet,
@@ -30,7 +30,7 @@ export class TestController extends DynamoBEController {
30
30
  ]
31
31
  }),
32
32
 
33
- new DynamoBEEndpointParams({
33
+ new DynamoNTS_EndpointParams({
34
34
  name: 'testPost',
35
35
  type: HttpCallType.post,
36
36
  endpoint: testModuleSettings.endPoints.testPost,
@@ -45,7 +45,7 @@ export class TestController extends DynamoBEController {
45
45
  ]
46
46
  }),
47
47
 
48
- new DynamoBEEndpointParams({
48
+ new DynamoNTS_EndpointParams({
49
49
  name: 'testPut',
50
50
  type: HttpCallType.put,
51
51
  endpoint: testModuleSettings.endPoints.testPut,
@@ -60,7 +60,7 @@ export class TestController extends DynamoBEController {
60
60
  ]
61
61
  }),
62
62
 
63
- new DynamoBEEndpointParams({
63
+ new DynamoNTS_EndpointParams({
64
64
  name: 'testPatch',
65
65
  type: HttpCallType.patch,
66
66
  endpoint: testModuleSettings.endPoints.testPatch,
@@ -75,7 +75,7 @@ export class TestController extends DynamoBEController {
75
75
  ]
76
76
  }),
77
77
 
78
- new DynamoBEEndpointParams({
78
+ new DynamoNTS_EndpointParams({
79
79
  name: 'testDelete',
80
80
  type: HttpCallType.delete,
81
81
  endpoint: testModuleSettings.endPoints.testDelete,
@@ -91,7 +91,7 @@ export class TestController extends DynamoBEController {
91
91
  }),
92
92
 
93
93
  // CUSTOM DATA
94
- new DynamoBEEndpointParams({
94
+ new DynamoNTS_EndpointParams({
95
95
  name: 'getCustomData',
96
96
  type: HttpCallType.get,
97
97
  endpoint: testModuleSettings.endPoints.getCustomData,
@@ -111,7 +111,7 @@ export class TestController extends DynamoBEController {
111
111
  ]
112
112
  }),
113
113
 
114
- new DynamoBEEndpointParams({
114
+ new DynamoNTS_EndpointParams({
115
115
  name: 'modifyCustomData',
116
116
  type: HttpCallType.post,
117
117
  endpoint: testModuleSettings.endPoints.modifyCustomData,
@@ -1,16 +1,16 @@
1
1
 
2
2
  import { usageModuleSettings } from '@futdevpro/fsm-dynamo/usage-module';
3
- import { DynamoBERouteSecurity } from '../../_enums/dynamobe-route-security.enum';
4
- import { DynamoBERoutingModule, DynamoBERoutingModuleSettings } from '../../_services/dynamobe-routing-module.service';
3
+ import { DynamoNTS_RouteSecurity } from '../../_enums/dynamo-nts-route-security.enum';
4
+ import { DynamoNTS_RoutingModule, DynamoNTS_RoutingModuleSettings } from '../../_services/dynamo-nts-routing-module.service';
5
5
  import { UsageController } from './usage-controller';
6
6
 
7
- export function getUsageRoutingModule(securityOverride?: DynamoBERouteSecurity): DynamoBERoutingModule {
8
- const set: DynamoBERoutingModuleSettings = {
7
+ export function getUsageRoutingModule(securityOverride?: DynamoNTS_RouteSecurity): DynamoNTS_RoutingModule {
8
+ const set: DynamoNTS_RoutingModuleSettings = {
9
9
  route: usageModuleSettings.mainRoute,
10
10
  controllers: [ UsageController.getInstance() ]
11
11
  }
12
12
  if (securityOverride) {
13
13
  set.securityOverride = securityOverride;
14
14
  }
15
- return new DynamoBERoutingModule(set);
15
+ return new DynamoNTS_RoutingModule(set);
16
16
  }
@@ -2,32 +2,32 @@
2
2
  import { Request, Response } from 'express';
3
3
  import { usageModuleSettings, DynamoUsageSession } from '@futdevpro/fsm-dynamo/usage-module';
4
4
  import { HttpCallType } from '../../_enums/http/http-call-type.enum';
5
- import { DynamoBEEndpointParams } from '../../_models/dynamobe-endpoint-params';
6
- import { DynamoBEAuthService } from '../../_services/dynamobe-auth.service';
7
- import { DynamoBEController } from '../../_services/dynamobe-controller.service';
8
- import { DBE_Global_S } from '../../_services/dynamobe-global.service';
5
+ import { DynamoNTS_EndpointParams } from '../../_models/dynamo-nts-endpoint-params';
6
+ import { DynamoNTS_AuthService } from '../../_services/dynamo-nts-auth.service';
7
+ import { DynamoNTS_Controller } from '../../_services/dynamo-nts-controller.service';
8
+ import { DynamoNTS_GlobalService } from '../../_services/dynamo-nts-global.service';
9
9
  import { UsageService } from './usage.service';
10
10
 
11
- export class UsageController extends DynamoBEController {
11
+ export class UsageController extends DynamoNTS_Controller {
12
12
 
13
13
  static getInstance(): UsageController {
14
14
  return UsageController.getSingletonInstance();
15
15
  }
16
16
 
17
17
  // SERVICES
18
- private authService: DynamoBEAuthService;
18
+ private authService: DynamoNTS_AuthService;
19
19
 
20
20
  setupEndpoints(): void {
21
- this.authService = DBE_Global_S.getAuthService();
21
+ this.authService = DynamoNTS_GlobalService.getAuthService();
22
22
 
23
23
  this.endpoints = [
24
- new DynamoBEEndpointParams({
24
+ new DynamoNTS_EndpointParams({
25
25
  name: 'newSession',
26
26
  type: HttpCallType.get,
27
27
  endpoint: usageModuleSettings.endPoints.newSession,
28
28
  tasks: [
29
29
  async (req: Request, res: Response, issuer: string) => {
30
- const authService = DBE_Global_S.getAuthService();
30
+ const authService = DynamoNTS_GlobalService.getAuthService();
31
31
  const username = authService.getUsernameFromRequest(req);
32
32
  const usageService = new UsageService({
33
33
  usageSession: new DynamoUsageSession({
@@ -47,7 +47,7 @@ export class UsageController extends DynamoBEController {
47
47
  ]
48
48
  }),
49
49
 
50
- new DynamoBEEndpointParams({
50
+ new DynamoNTS_EndpointParams({
51
51
  name: 'updateUsage',
52
52
  type: HttpCallType.post,
53
53
  endpoint: usageModuleSettings.endPoints.updateUsage,
@@ -69,7 +69,7 @@ export class UsageController extends DynamoBEController {
69
69
  ]
70
70
  }),
71
71
 
72
- new DynamoBEEndpointParams({
72
+ new DynamoNTS_EndpointParams({
73
73
  name: 'closeSession',
74
74
  type: HttpCallType.get,
75
75
  endpoint: usageModuleSettings.endPoints.closeSession,
@@ -90,7 +90,7 @@ export class UsageController extends DynamoBEController {
90
90
  ]
91
91
  }),
92
92
 
93
- new DynamoBEEndpointParams({
93
+ new DynamoNTS_EndpointParams({
94
94
  name: 'getAllUsageData',
95
95
  type: HttpCallType.get,
96
96
  endpoint: usageModuleSettings.endPoints.getAllUsageData,
@@ -4,10 +4,10 @@ import { DynamoBEError } from '@futdevpro/fsm-dynamo';
4
4
  import { DynamoUsageSession, usageSessionModelParams, DynamoUsageData,
5
5
  DailyUsageData } from '@futdevpro/fsm-dynamo/usage-module';
6
6
 
7
- import { DynamoBEDataService } from '../../_services/dynamobe-data.service';
8
- import { DBE_Shared } from '../../_services/dynamobe-shared.service';
7
+ import { DynamoNTS_DataService } from '../../_services/dynamo-nts-data.service';
8
+ import { DynamoNTS_Shared } from '../../_services/dynamo-nts-shared.service';
9
9
 
10
- export class UsageService extends DynamoBEDataService<DynamoUsageSession> {
10
+ export class UsageService extends DynamoNTS_DataService<DynamoUsageSession> {
11
11
  usageData: DynamoUsageData[] = [];
12
12
  simplifiedDailyUsage: DailyUsageData[] = [];
13
13
 
@@ -28,8 +28,8 @@ export class UsageService extends DynamoBEDataService<DynamoUsageSession> {
28
28
 
29
29
  getLocationDataFromRequest(req: Request): void {
30
30
  try {
31
- this.data.address = DBE_Shared.getIpFromRequest(req);
32
- this.data.locationData = DBE_Shared.getLocationDataByRequest(req);
31
+ this.data.address = DynamoNTS_Shared.getIpFromRequest(req);
32
+ this.data.locationData = DynamoNTS_Shared.getLocationDataByRequest(req);
33
33
 
34
34
  /* console.log(`...getLocationDataFromRequest... ip: ${this.data.address}`, this.data.locationData); */
35
35
  } catch (error) {
@@ -44,7 +44,7 @@ export class UsageService extends DynamoBEDataService<DynamoUsageSession> {
44
44
  async getLastWeekUsage(): Promise<void> {
45
45
  try {
46
46
  await this.dataDBService.find({
47
- sessionStart: { $gte: DBE_Shared.oneWeekAgo() }
47
+ sessionStart: { $gte: DynamoNTS_Shared.oneWeekAgo() }
48
48
  }).then((res: DynamoUsageSession[]) => {
49
49
  this.dataList = res;
50
50
  });