@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.
- package/lib/_models/dynamo-module-settings.d.ts +3 -0
- package/lib/_models/dynamo-module-settings.d.ts.map +1 -1
- package/lib/_models/dynamobe-app-params.d.ts +3 -0
- package/lib/_models/dynamobe-app-params.d.ts.map +1 -1
- package/lib/_models/dynamobe-app-params.js +3 -0
- package/lib/_models/dynamobe-app-params.js.map +1 -1
- package/lib/_models/dynamobe-endpoint-params.d.ts +17 -1
- package/lib/_models/dynamobe-endpoint-params.d.ts.map +1 -1
- package/lib/_models/dynamobe-endpoint-params.js +16 -0
- package/lib/_models/dynamobe-endpoint-params.js.map +1 -1
- package/lib/_models/dynamobe-global-settings.d.ts +3 -0
- package/lib/_models/dynamobe-global-settings.d.ts.map +1 -1
- package/lib/_modules/usage/usage.service.d.ts.map +1 -1
- package/lib/_modules/usage/usage.service.js +20 -4
- package/lib/_modules/usage/usage.service.js.map +1 -1
- package/lib/_services/dynamobe-api.service.d.ts +9 -0
- package/lib/_services/dynamobe-api.service.d.ts.map +1 -1
- package/lib/_services/dynamobe-api.service.js +20 -3
- package/lib/_services/dynamobe-api.service.js.map +1 -1
- package/lib/_services/dynamobe-app.d.ts +24 -0
- package/lib/_services/dynamobe-app.d.ts.map +1 -1
- package/lib/_services/dynamobe-app.js +28 -4
- package/lib/_services/dynamobe-app.js.map +1 -1
- package/lib/_services/dynamobe-auth.service.d.ts +13 -0
- package/lib/_services/dynamobe-auth.service.d.ts.map +1 -1
- package/lib/_services/dynamobe-auth.service.js +8 -2
- package/lib/_services/dynamobe-auth.service.js.map +1 -1
- package/lib/_services/dynamobe-controller.service.d.ts +3 -0
- package/lib/_services/dynamobe-controller.service.d.ts.map +1 -1
- package/lib/_services/dynamobe-controller.service.js +3 -0
- package/lib/_services/dynamobe-controller.service.js.map +1 -1
- package/lib/_services/dynamobe-data.service.d.ts +8 -4
- package/lib/_services/dynamobe-data.service.d.ts.map +1 -1
- package/lib/_services/dynamobe-data.service.js +87 -32
- package/lib/_services/dynamobe-data.service.js.map +1 -1
- package/lib/_services/dynamobe-db-service-collection.service.d.ts +3 -0
- package/lib/_services/dynamobe-db-service-collection.service.d.ts.map +1 -1
- package/lib/_services/dynamobe-db-service-collection.service.js +3 -0
- package/lib/_services/dynamobe-db-service-collection.service.js.map +1 -1
- package/lib/_services/dynamobe-db.service.d.ts +110 -15
- package/lib/_services/dynamobe-db.service.d.ts.map +1 -1
- package/lib/_services/dynamobe-db.service.js +237 -63
- package/lib/_services/dynamobe-db.service.js.map +1 -1
- package/lib/_services/dynamobe-email.service.d.ts +22 -0
- package/lib/_services/dynamobe-email.service.d.ts.map +1 -1
- package/lib/_services/dynamobe-email.service.js +45 -11
- package/lib/_services/dynamobe-email.service.js.map +1 -1
- package/lib/_services/dynamobe-global.service.d.ts +22 -0
- package/lib/_services/dynamobe-global.service.d.ts.map +1 -1
- package/lib/_services/dynamobe-global.service.js +22 -0
- package/lib/_services/dynamobe-global.service.js.map +1 -1
- package/lib/_services/dynamobe-routing-module.service.d.ts +15 -0
- package/lib/_services/dynamobe-routing-module.service.d.ts.map +1 -1
- package/lib/_services/dynamobe-routing-module.service.js +28 -3
- package/lib/_services/dynamobe-routing-module.service.js.map +1 -1
- package/lib/_services/dynamobe-shared.service.d.ts +18 -0
- package/lib/_services/dynamobe-shared.service.d.ts.map +1 -1
- package/lib/_services/dynamobe-shared.service.js +18 -0
- package/lib/_services/dynamobe-shared.service.js.map +1 -1
- package/lib/_services/dynamobe-singleton.service.d.ts +3 -0
- package/lib/_services/dynamobe-singleton.service.d.ts.map +1 -1
- package/lib/_services/dynamobe-singleton.service.js +3 -0
- package/lib/_services/dynamobe-singleton.service.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +33 -47
- package/package.json +11 -11
- package/src/_models/dynamo-module-settings.ts +3 -1
- package/src/_models/dynamobe-app-params.ts +3 -0
- package/src/_models/dynamobe-endpoint-params.ts +17 -1
- package/src/_models/dynamobe-global-settings.ts +3 -0
- package/src/_modules/usage/usage.service.ts +20 -4
- package/src/_services/dynamobe-api.service.ts +20 -3
- package/src/_services/dynamobe-app.ts +28 -4
- package/src/_services/dynamobe-auth.service.ts +21 -2
- package/src/_services/dynamobe-controller.service.ts +3 -0
- package/src/_services/dynamobe-data.service.ts +89 -32
- package/src/_services/dynamobe-db-service-collection.service.ts +3 -0
- package/src/_services/dynamobe-db.service.ts +224 -48
- package/src/_services/dynamobe-email.service.ts +45 -11
- package/src/_services/dynamobe-global.service.ts +22 -0
- package/src/_services/dynamobe-routing-module.service.ts +28 -3
- package/src/_services/dynamobe-shared.service.ts +18 -0
- package/src/_services/dynamobe-singleton.service.ts +3 -0
- 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({
|
|
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({
|
|
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({
|
|
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,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
|
-
*/
|