@futdevpro/nts-dynamo 1.5.17 → 1.5.20

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 (83) hide show
  1. package/lib/_models/dynamo-module-settings.d.ts +3 -0
  2. package/lib/_models/dynamo-module-settings.d.ts.map +1 -1
  3. package/lib/_models/dynamobe-app-params.d.ts +3 -0
  4. package/lib/_models/dynamobe-app-params.d.ts.map +1 -1
  5. package/lib/_models/dynamobe-app-params.js +3 -0
  6. package/lib/_models/dynamobe-app-params.js.map +1 -1
  7. package/lib/_models/dynamobe-endpoint-params.d.ts +17 -1
  8. package/lib/_models/dynamobe-endpoint-params.d.ts.map +1 -1
  9. package/lib/_models/dynamobe-endpoint-params.js +16 -0
  10. package/lib/_models/dynamobe-endpoint-params.js.map +1 -1
  11. package/lib/_models/dynamobe-global-settings.d.ts +3 -0
  12. package/lib/_models/dynamobe-global-settings.d.ts.map +1 -1
  13. package/lib/_modules/usage/usage.service.d.ts.map +1 -1
  14. package/lib/_modules/usage/usage.service.js +20 -4
  15. package/lib/_modules/usage/usage.service.js.map +1 -1
  16. package/lib/_services/dynamobe-api.service.d.ts +9 -0
  17. package/lib/_services/dynamobe-api.service.d.ts.map +1 -1
  18. package/lib/_services/dynamobe-api.service.js +20 -3
  19. package/lib/_services/dynamobe-api.service.js.map +1 -1
  20. package/lib/_services/dynamobe-app.d.ts +24 -0
  21. package/lib/_services/dynamobe-app.d.ts.map +1 -1
  22. package/lib/_services/dynamobe-app.js +28 -4
  23. package/lib/_services/dynamobe-app.js.map +1 -1
  24. package/lib/_services/dynamobe-auth.service.d.ts +13 -0
  25. package/lib/_services/dynamobe-auth.service.d.ts.map +1 -1
  26. package/lib/_services/dynamobe-auth.service.js +8 -2
  27. package/lib/_services/dynamobe-auth.service.js.map +1 -1
  28. package/lib/_services/dynamobe-controller.service.d.ts +3 -0
  29. package/lib/_services/dynamobe-controller.service.d.ts.map +1 -1
  30. package/lib/_services/dynamobe-controller.service.js +3 -0
  31. package/lib/_services/dynamobe-controller.service.js.map +1 -1
  32. package/lib/_services/dynamobe-data.service.d.ts +8 -4
  33. package/lib/_services/dynamobe-data.service.d.ts.map +1 -1
  34. package/lib/_services/dynamobe-data.service.js +87 -32
  35. package/lib/_services/dynamobe-data.service.js.map +1 -1
  36. package/lib/_services/dynamobe-db-service-collection.service.d.ts +3 -0
  37. package/lib/_services/dynamobe-db-service-collection.service.d.ts.map +1 -1
  38. package/lib/_services/dynamobe-db-service-collection.service.js +3 -0
  39. package/lib/_services/dynamobe-db-service-collection.service.js.map +1 -1
  40. package/lib/_services/dynamobe-db.service.d.ts +110 -15
  41. package/lib/_services/dynamobe-db.service.d.ts.map +1 -1
  42. package/lib/_services/dynamobe-db.service.js +237 -63
  43. package/lib/_services/dynamobe-db.service.js.map +1 -1
  44. package/lib/_services/dynamobe-email.service.d.ts +22 -0
  45. package/lib/_services/dynamobe-email.service.d.ts.map +1 -1
  46. package/lib/_services/dynamobe-email.service.js +45 -11
  47. package/lib/_services/dynamobe-email.service.js.map +1 -1
  48. package/lib/_services/dynamobe-global.service.d.ts +22 -0
  49. package/lib/_services/dynamobe-global.service.d.ts.map +1 -1
  50. package/lib/_services/dynamobe-global.service.js +22 -0
  51. package/lib/_services/dynamobe-global.service.js.map +1 -1
  52. package/lib/_services/dynamobe-routing-module.service.d.ts +15 -0
  53. package/lib/_services/dynamobe-routing-module.service.d.ts.map +1 -1
  54. package/lib/_services/dynamobe-routing-module.service.js +28 -3
  55. package/lib/_services/dynamobe-routing-module.service.js.map +1 -1
  56. package/lib/_services/dynamobe-shared.service.d.ts +18 -0
  57. package/lib/_services/dynamobe-shared.service.d.ts.map +1 -1
  58. package/lib/_services/dynamobe-shared.service.js +18 -0
  59. package/lib/_services/dynamobe-shared.service.js.map +1 -1
  60. package/lib/_services/dynamobe-singleton.service.d.ts +3 -0
  61. package/lib/_services/dynamobe-singleton.service.d.ts.map +1 -1
  62. package/lib/_services/dynamobe-singleton.service.js +3 -0
  63. package/lib/_services/dynamobe-singleton.service.js.map +1 -1
  64. package/lib/tsconfig.tsbuildinfo +33 -47
  65. package/package.json +11 -11
  66. package/src/_models/dynamo-module-settings.ts +3 -1
  67. package/src/_models/dynamobe-app-params.ts +3 -0
  68. package/src/_models/dynamobe-endpoint-params.ts +17 -1
  69. package/src/_models/dynamobe-global-settings.ts +3 -0
  70. package/src/_modules/usage/usage.service.ts +20 -4
  71. package/src/_services/dynamobe-api.service.ts +20 -3
  72. package/src/_services/dynamobe-app.ts +28 -4
  73. package/src/_services/dynamobe-auth.service.ts +21 -2
  74. package/src/_services/dynamobe-controller.service.ts +3 -0
  75. package/src/_services/dynamobe-data.service.ts +89 -32
  76. package/src/_services/dynamobe-db-service-collection.service.ts +3 -0
  77. package/src/_services/dynamobe-db.service.ts +224 -48
  78. package/src/_services/dynamobe-email.service.ts +45 -11
  79. package/src/_services/dynamobe-global.service.ts +22 -0
  80. package/src/_services/dynamobe-routing-module.service.ts +28 -3
  81. package/src/_services/dynamobe-shared.service.ts +18 -0
  82. package/src/_services/dynamobe-singleton.service.ts +3 -0
  83. package/src/_models/dynamobe-data-model-params.ts +0 -24
@@ -15,6 +15,9 @@ export interface DynamoBERoutingModuleSettings {
15
15
  securityOverride?: DynamoBERouteSecurity;
16
16
  }
17
17
 
18
+ /**
19
+ *
20
+ */
18
21
  export class DynamoBERoutingModule {
19
22
 
20
23
  security: DynamoBERouteSecurity;
@@ -52,6 +55,10 @@ export class DynamoBERoutingModule {
52
55
  });
53
56
  }
54
57
 
58
+ /**
59
+ *
60
+ * @param securityOverride
61
+ */
55
62
  private mountRoutes(securityOverride?: DynamoBERouteSecurity): void {
56
63
  if (securityOverride) {
57
64
  this.security = securityOverride;
@@ -87,11 +94,19 @@ export class DynamoBERoutingModule {
87
94
  this.mountSecureRoute(endpoint);
88
95
  }
89
96
  } catch (error) {
90
- throw new DynamoBEError({ message: `DYNAMOBEERROR: Failed to mount routes.`, error })
97
+ throw new DynamoBEError({
98
+ message: `DYNAMOBEERROR: Failed to mount routes.`,
99
+ userMessage: `We encountered an uncought BackEnd Build Error, please contact the responsible development team. errorcode: 900-456-100`,
100
+ error
101
+ })
91
102
  }
92
103
  });
93
104
  }
94
105
 
106
+ /**
107
+ *
108
+ * @param endpointParams
109
+ */
95
110
  private mountOpenRoute(endpointParams: DynamoBEEndpointParams): void {
96
111
  switch(endpointParams.type) {
97
112
  case HttpCallType.get:
@@ -115,10 +130,17 @@ export class DynamoBERoutingModule {
115
130
  endpointParams.preProcessess, endpointParams.getTasksExecution());
116
131
  break;
117
132
  default:
118
- throw new DynamoBEError({ message: `DYNAMOBEERROR: INVALID route type: ${endpointParams.type} - ${endpointParams.name}` })
133
+ throw new DynamoBEError({
134
+ message: `DYNAMOBEERROR: INVALID route type: ${endpointParams.type} - ${endpointParams.name}` ,
135
+ userMessage: `We encountered an uncought BackEnd Build Error, please contact the responsible development team. errorcode: 900-456-200`,
136
+ })
119
137
  }
120
138
  }
121
139
 
140
+ /**
141
+ *
142
+ * @param endpointParams
143
+ */
122
144
  private mountSecureRoute(endpointParams: DynamoBEEndpointParams): void {
123
145
  switch(endpointParams.type) {
124
146
  case HttpCallType.get:
@@ -142,7 +164,10 @@ export class DynamoBERoutingModule {
142
164
  endpointParams.preProcessess, endpointParams.getTasksExecution());
143
165
  break;
144
166
  default:
145
- throw new DynamoBEError({ message: `DYNAMOBEERROR: INVALID route type: ${endpointParams.type} - ${endpointParams.name}` })
167
+ throw new DynamoBEError({
168
+ message: `DYNAMOBEERROR: INVALID route type: ${endpointParams.type} - ${endpointParams.name}`,
169
+ userMessage: `We encountered an uncought BackEnd Build Error, please contact the responsible development team. errorcode: 900-456-300`,
170
+ })
146
171
  }
147
172
  }
148
173
  }
@@ -4,8 +4,16 @@ import { Request } from 'express';
4
4
  import * as GeoIp from 'geoip-lite';
5
5
  import { GeoIpLocation, D_Shared } from '@futdevpro/fsm-dynamo/shared-service';
6
6
 
7
+ /**
8
+ *
9
+ */
7
10
  export class DBE_Shared extends D_Shared {
8
11
 
12
+ /**
13
+ *
14
+ * @param request
15
+ * @returns
16
+ */
9
17
  static getIpFromRequest(request: Request): string {
10
18
  let ip: string;
11
19
  if (request.headers['x-forwarded-for']) {
@@ -18,10 +26,20 @@ export class DBE_Shared extends D_Shared {
18
26
  return ip;
19
27
  }
20
28
 
29
+ /**
30
+ *
31
+ * @param request
32
+ * @returns
33
+ */
21
34
  static getLocationDataByRequest(request: Request): GeoIpLocation {
22
35
  return GeoIp.lookup(this.getIpFromRequest(request));
23
36
  }
24
37
 
38
+ /**
39
+ *
40
+ * @param question
41
+ * @returns
42
+ */
25
43
  static async prompt(question: string): Promise<string> {
26
44
  const readLine = ReadLine.createInterface({
27
45
  input: process.stdin,
@@ -1,4 +1,7 @@
1
1
 
2
+ /**
3
+ *
4
+ */
2
5
  export class DynamoBESingletonService {
3
6
  /// --- --- --- SINGLETON --- --- --- \\\
4
7
  protected static instance;
@@ -1,24 +0,0 @@
1
- /*
2
- export { DynamoBEDataPropertyParams } from '@futdevpro/fsm-dynamo';
3
- import { DataModelType } from '../_enums/data-model-type.enum';
4
-
5
- export class DynamoBEDataModelParams {
6
- dataName: string;
7
- type: DataModelType;
8
- properties: DynamoBEDataPropertyParams[] = [];
9
-
10
- constructor(
11
- set?: {
12
- dataName: string,
13
- type: DataModelType,
14
- properties: DynamoBEDataPropertyParams[],
15
- }
16
- ) {
17
- if (set) {
18
- this.dataName = set.dataName;
19
- this.type = set.type;
20
- this.properties = set.properties ? set.properties : [];
21
- }
22
- }
23
- }
24
- */