@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
package/lib/tsconfig.tsbuildinfo
CHANGED
|
@@ -197,8 +197,8 @@
|
|
|
197
197
|
"affectsGlobalScope": false
|
|
198
198
|
},
|
|
199
199
|
"../src/_models/dynamobe-global-settings.ts": {
|
|
200
|
-
"version": "
|
|
201
|
-
"signature": "
|
|
200
|
+
"version": "05680f68bd24af702c5709fd2ca73e8c427abb0e3f33758d6c71c505d77a5f0a",
|
|
201
|
+
"signature": "fad300c623dfe329571759ca6a88c49f222bc99dc99ab5bdcbc5873150ae98bb",
|
|
202
202
|
"affectsGlobalScope": false
|
|
203
203
|
},
|
|
204
204
|
"../src/_constants/dynamobe-global.settings.ts": {
|
|
@@ -247,8 +247,8 @@
|
|
|
247
247
|
"affectsGlobalScope": false
|
|
248
248
|
},
|
|
249
249
|
"../src/_models/dynamobe-app-params.ts": {
|
|
250
|
-
"version": "
|
|
251
|
-
"signature": "
|
|
250
|
+
"version": "b4f959198dacf9e4003ddeb22caed68afc75f3f2d15c249c2e56ba16fc5862f2",
|
|
251
|
+
"signature": "9762933851d3dea6df374bdd99fc92e9236d681a2905ec78b4955116a82f82af",
|
|
252
252
|
"affectsGlobalScope": false
|
|
253
253
|
},
|
|
254
254
|
"../node_modules/@types/node/globals.d.ts": {
|
|
@@ -592,8 +592,8 @@
|
|
|
592
592
|
"affectsGlobalScope": false
|
|
593
593
|
},
|
|
594
594
|
"../src/_services/dynamobe-shared.service.ts": {
|
|
595
|
-
"version": "
|
|
596
|
-
"signature": "
|
|
595
|
+
"version": "09073e0ccb582b3eba2cba927046ea41ddc46e2528038b84180659b4981de8c0",
|
|
596
|
+
"signature": "ca449f54174be4a7c80a727a1ce3e8b1abf1601ceb5f8518d059970165599305",
|
|
597
597
|
"affectsGlobalScope": false
|
|
598
598
|
},
|
|
599
599
|
"../node_modules/@futdevpro/fsm-dynamo/lib/_collections/index.d.ts": {
|
|
@@ -677,13 +677,13 @@
|
|
|
677
677
|
"affectsGlobalScope": false
|
|
678
678
|
},
|
|
679
679
|
"../src/_services/dynamobe-singleton.service.ts": {
|
|
680
|
-
"version": "
|
|
681
|
-
"signature": "
|
|
680
|
+
"version": "359fb01a2cce8ac909649e534c8bed8768a2918c09ca9292a8997451e43804ca",
|
|
681
|
+
"signature": "9325824161621fab1eb9ed6d0a47f7ce08c1fd0312801f6c0a2f463bc969cf9d",
|
|
682
682
|
"affectsGlobalScope": false
|
|
683
683
|
},
|
|
684
684
|
"../src/_services/dynamobe-auth.service.ts": {
|
|
685
|
-
"version": "
|
|
686
|
-
"signature": "
|
|
685
|
+
"version": "8a1fcff9f84cf1699a2a802d6d6c49c4655b24820866e0fb3e612005d6f6d393",
|
|
686
|
+
"signature": "6611011a053562bc9ad9af62341e25ead788fb090c0a0bd46b15c20b04184550",
|
|
687
687
|
"affectsGlobalScope": false
|
|
688
688
|
},
|
|
689
689
|
"../node_modules/@types/bson/index.d.ts": {
|
|
@@ -702,13 +702,13 @@
|
|
|
702
702
|
"affectsGlobalScope": false
|
|
703
703
|
},
|
|
704
704
|
"../src/_services/dynamobe-db.service.ts": {
|
|
705
|
-
"version": "
|
|
706
|
-
"signature": "
|
|
705
|
+
"version": "4446f2a4338afc9d0122742bde10a8d3e4e9c46aa4adcbe938d45233d18d4198",
|
|
706
|
+
"signature": "f76218a432eafed7bf7dbcac9ac8d57ccbbd2d3a2208a25157afa20790e4b4a9",
|
|
707
707
|
"affectsGlobalScope": false
|
|
708
708
|
},
|
|
709
709
|
"../src/_services/dynamobe-db-service-collection.service.ts": {
|
|
710
|
-
"version": "
|
|
711
|
-
"signature": "
|
|
710
|
+
"version": "eb78b6ab9debf138ab8183b9a3e9b4cc9f64f8d56e584a25789f83aa820ff133",
|
|
711
|
+
"signature": "de2882de26709a97fd57bb08fa0440a68752321e28349c3c50147769aa6f56ad",
|
|
712
712
|
"affectsGlobalScope": false
|
|
713
713
|
},
|
|
714
714
|
"../node_modules/@types/nodemailer/lib/dkim/index.d.ts": {
|
|
@@ -782,8 +782,8 @@
|
|
|
782
782
|
"affectsGlobalScope": false
|
|
783
783
|
},
|
|
784
784
|
"../src/_services/dynamobe-email.service.ts": {
|
|
785
|
-
"version": "
|
|
786
|
-
"signature": "
|
|
785
|
+
"version": "d906d28e091005b92b1ce2ee21855e580479e5d4b1b8ad371593aa75f98a8214",
|
|
786
|
+
"signature": "a5cd7984d3a9c57f222768c0fd9f6bc649a34a46b5c1674022d6b727e2f56a5b",
|
|
787
787
|
"affectsGlobalScope": false
|
|
788
788
|
},
|
|
789
789
|
"../src/_services/dynamobe-email-service-collection.service.ts": {
|
|
@@ -792,13 +792,13 @@
|
|
|
792
792
|
"affectsGlobalScope": false
|
|
793
793
|
},
|
|
794
794
|
"../src/_services/dynamobe-global.service.ts": {
|
|
795
|
-
"version": "
|
|
796
|
-
"signature": "
|
|
795
|
+
"version": "2bf139709660b90a70d555e953786ab0d9db91676195a8cefa82f465e8f66de1",
|
|
796
|
+
"signature": "a4682c6bf3abd57035aaeeb3a0dc2fc56f39ca0ff66605e5f8862ef895a93d53",
|
|
797
797
|
"affectsGlobalScope": false
|
|
798
798
|
},
|
|
799
799
|
"../src/_models/dynamobe-endpoint-params.ts": {
|
|
800
|
-
"version": "
|
|
801
|
-
"signature": "
|
|
800
|
+
"version": "623d2a8dcd032f7acf84120f4bcaa3f8f7783b67cd51735789c3b3e414523088",
|
|
801
|
+
"signature": "e2cd8e038034d68443361d3e2d21c42d0155634e64db920192f1a4e2f609c8fd",
|
|
802
802
|
"affectsGlobalScope": false
|
|
803
803
|
},
|
|
804
804
|
"../src/_models/index.ts": {
|
|
@@ -812,13 +812,13 @@
|
|
|
812
812
|
"affectsGlobalScope": false
|
|
813
813
|
},
|
|
814
814
|
"../src/_services/dynamobe-controller.service.ts": {
|
|
815
|
-
"version": "
|
|
816
|
-
"signature": "
|
|
815
|
+
"version": "97faf1c818c107c2664cf0eb7790857ea58ea150af1ce43a23284610fac3a7ac",
|
|
816
|
+
"signature": "ffef7c5b21047deda00ef1ae1ca7aa9c94b10b17ffea7f8e6cd99c84eb644f31",
|
|
817
817
|
"affectsGlobalScope": false
|
|
818
818
|
},
|
|
819
819
|
"../src/_services/dynamobe-data.service.ts": {
|
|
820
|
-
"version": "
|
|
821
|
-
"signature": "
|
|
820
|
+
"version": "5dcf7bf46eeafd4395d2382c3f754d2660931886958a22853830bd3b1ffba844",
|
|
821
|
+
"signature": "e0b426e8c698476ba70d262800eb6881b3815f36b0c5b9f00758ffaa0787f0de",
|
|
822
822
|
"affectsGlobalScope": false
|
|
823
823
|
},
|
|
824
824
|
"../src/_modules/test/custom-data.service.ts": {
|
|
@@ -832,8 +832,8 @@
|
|
|
832
832
|
"affectsGlobalScope": false
|
|
833
833
|
},
|
|
834
834
|
"../src/_services/dynamobe-routing-module.service.ts": {
|
|
835
|
-
"version": "
|
|
836
|
-
"signature": "
|
|
835
|
+
"version": "9c5de53e08546d42aacc8af05e1900b042fec7ec235514d4c3c1e434ec605600",
|
|
836
|
+
"signature": "fb0227f2de79ff53c9231b6fac994153e167fb1f0b8e8bc81e074e7c6b4f2168",
|
|
837
837
|
"affectsGlobalScope": false
|
|
838
838
|
},
|
|
839
839
|
"../src/_modules/test/get-test-routing-module.ts": {
|
|
@@ -852,7 +852,7 @@
|
|
|
852
852
|
"affectsGlobalScope": false
|
|
853
853
|
},
|
|
854
854
|
"../src/_modules/usage/usage.service.ts": {
|
|
855
|
-
"version": "
|
|
855
|
+
"version": "f1230062a21056621b48548271abf678cafb491357d1e9529aea46b7f9aa0c2a",
|
|
856
856
|
"signature": "693186a6a786fc107ef4bef34d85f63e2c61b90acda316c6e5f4f2cb03c6fcf0",
|
|
857
857
|
"affectsGlobalScope": false
|
|
858
858
|
},
|
|
@@ -877,13 +877,13 @@
|
|
|
877
877
|
"affectsGlobalScope": false
|
|
878
878
|
},
|
|
879
879
|
"../src/_services/dynamobe-api.service.ts": {
|
|
880
|
-
"version": "
|
|
881
|
-
"signature": "
|
|
880
|
+
"version": "78e724f5394e079ceb11126c450faca442df9aa0a8f9937993762095f06b74a9",
|
|
881
|
+
"signature": "3579b764e3b3481f2dd1b2978cc43260526ee31b6a135de40c937bd6b033fc49",
|
|
882
882
|
"affectsGlobalScope": false
|
|
883
883
|
},
|
|
884
884
|
"../src/_services/dynamobe-app.ts": {
|
|
885
|
-
"version": "
|
|
886
|
-
"signature": "
|
|
885
|
+
"version": "8540021c189946eb35bc6d9dcae54312b25ac7bb2f97fc3de7bcf9836a4126b8",
|
|
886
|
+
"signature": "511c8de391c391f21fa57d761fd899c2e7e012eac7b6e1333fd42c7a311988b0",
|
|
887
887
|
"affectsGlobalScope": false
|
|
888
888
|
},
|
|
889
889
|
"../src/_services/index.ts": {
|
|
@@ -897,13 +897,8 @@
|
|
|
897
897
|
"affectsGlobalScope": false
|
|
898
898
|
},
|
|
899
899
|
"../src/_models/dynamo-module-settings.ts": {
|
|
900
|
-
"version": "
|
|
901
|
-
"signature": "
|
|
902
|
-
"affectsGlobalScope": false
|
|
903
|
-
},
|
|
904
|
-
"../src/_models/dynamobe-data-model-params.ts": {
|
|
905
|
-
"version": "b6c9306a481380cdd8d7c8c07a2795194c2cd2e4b1fd026e39b5f26d2a639f2b",
|
|
906
|
-
"signature": "21b4fe2f0cafcb37b93d25912063780529f13acda7db2f4faaee9acd875a084a",
|
|
900
|
+
"version": "e7d10386d6427293a88fdd8a5d3dc396bf0983cbf60136e9982c91a3163718f6",
|
|
901
|
+
"signature": "352d1a42abd24334ef6da1111aed8c2aad17760ccba5e8ffb0db924e13b04cdc",
|
|
907
902
|
"affectsGlobalScope": false
|
|
908
903
|
},
|
|
909
904
|
"../node_modules/@futdevpro/fsm-dynamo/lib/_modules/error-module.index.d.ts": {
|
|
@@ -2477,14 +2472,6 @@
|
|
|
2477
2472
|
"../node_modules/@types/node/ts3.2/util.d.ts",
|
|
2478
2473
|
"../node_modules/@types/node/util.d.ts"
|
|
2479
2474
|
],
|
|
2480
|
-
"../src/_models/dynamobe-data-model-params.ts": [
|
|
2481
|
-
"../node_modules/@types/node/fs.d.ts",
|
|
2482
|
-
"../node_modules/@types/node/process.d.ts",
|
|
2483
|
-
"../node_modules/@types/node/ts3.2/fs.d.ts",
|
|
2484
|
-
"../node_modules/@types/node/ts3.2/process.d.ts",
|
|
2485
|
-
"../node_modules/@types/node/ts3.2/util.d.ts",
|
|
2486
|
-
"../node_modules/@types/node/util.d.ts"
|
|
2487
|
-
],
|
|
2488
2475
|
"../src/_models/dynamobe-endpoint-params.ts": [
|
|
2489
2476
|
"../node_modules/@types/express/ts4.0/index.d.ts",
|
|
2490
2477
|
"../node_modules/@types/node/fs.d.ts",
|
|
@@ -4642,7 +4629,6 @@
|
|
|
4642
4629
|
"../src/_models/dynamo-module-settings.ts",
|
|
4643
4630
|
"../src/_models/dynamobe-api-call-params.ts",
|
|
4644
4631
|
"../src/_models/dynamobe-app-params.ts",
|
|
4645
|
-
"../src/_models/dynamobe-data-model-params.ts",
|
|
4646
4632
|
"../src/_models/dynamobe-endpoint-params.ts",
|
|
4647
4633
|
"../src/_models/dynamobe-global-settings.ts",
|
|
4648
4634
|
"../src/_models/index.ts",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@futdevpro/nts-dynamo",
|
|
3
|
-
"version": "01.05.
|
|
3
|
+
"version": "01.05.20",
|
|
4
4
|
"description": "Dynamic NodeTS (NodeJS-Typescript), MongoDB Backend System Framework by Future Development Ltd.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "npx tsc",
|
|
@@ -162,17 +162,17 @@
|
|
|
162
162
|
},
|
|
163
163
|
"homepage": "https:/futdevpro.hu/projects/dynamo",
|
|
164
164
|
"peerDependencies": {
|
|
165
|
-
"@futdevpro/fsm-dynamo": "
|
|
165
|
+
"@futdevpro/fsm-dynamo": "^1.5.15",
|
|
166
166
|
|
|
167
|
-
"@types/express": "
|
|
168
|
-
"@types/geoip-lite": "
|
|
169
|
-
"@types/nodemailer": "
|
|
170
|
-
"axios": "
|
|
171
|
-
"express": "
|
|
172
|
-
"geoip-lite": "
|
|
173
|
-
"mongoose": "
|
|
174
|
-
"nodemailer": "
|
|
175
|
-
"rxjs": "
|
|
167
|
+
"@types/express": "^4.17.7",
|
|
168
|
+
"@types/geoip-lite": "^1.4.1",
|
|
169
|
+
"@types/nodemailer": "^6.4.4",
|
|
170
|
+
"axios": "^0.21.4",
|
|
171
|
+
"express": "^4.17.1",
|
|
172
|
+
"geoip-lite": "^1.4.5",
|
|
173
|
+
"mongoose": "^5.13.14",
|
|
174
|
+
"nodemailer": "^6.7.5",
|
|
175
|
+
"rxjs": "^7.4.0"
|
|
176
176
|
},
|
|
177
177
|
"dependencies": {
|
|
178
178
|
"@types/node": "~14.0.27",
|
|
@@ -3,11 +3,14 @@
|
|
|
3
3
|
import { NextFunction, Request, Response } from 'express';
|
|
4
4
|
|
|
5
5
|
import { HttpCallType } from '../_enums/http/http-call-type.enum';
|
|
6
|
-
import { DynamoBERouteSecurity
|
|
6
|
+
import { DynamoBERouteSecurity } from '../_enums/dynamobe-route-security.enum';
|
|
7
7
|
import { DBE_Shared } from '../_services/dynamobe-shared.service';
|
|
8
8
|
import { DBE_Global_S } from '../_services/dynamobe-global.service';
|
|
9
9
|
import { dynamoBEGlobalSettings } from '../_constants';
|
|
10
10
|
|
|
11
|
+
/**
|
|
12
|
+
*
|
|
13
|
+
*/
|
|
11
14
|
export class DynamoBEEndpointParams{
|
|
12
15
|
name: string;
|
|
13
16
|
security: DynamoBERouteSecurity;
|
|
@@ -69,6 +72,10 @@ export class DynamoBEEndpointParams{
|
|
|
69
72
|
}
|
|
70
73
|
}
|
|
71
74
|
|
|
75
|
+
/**
|
|
76
|
+
*
|
|
77
|
+
* @returns
|
|
78
|
+
*/
|
|
72
79
|
getPreLog(): (req: Request, res: Response, next: NextFunction) => Promise<void> {
|
|
73
80
|
return async (req: Request, res: Response, next: NextFunction) => {
|
|
74
81
|
try {
|
|
@@ -99,6 +106,10 @@ export class DynamoBEEndpointParams{
|
|
|
99
106
|
};
|
|
100
107
|
}
|
|
101
108
|
|
|
109
|
+
/**
|
|
110
|
+
*
|
|
111
|
+
* @returns
|
|
112
|
+
*/
|
|
102
113
|
getTasksExecution(): (req: Request, res: Response) => Promise<void> {
|
|
103
114
|
return async (req: Request, res: Response) => {
|
|
104
115
|
try {
|
|
@@ -122,6 +133,11 @@ export class DynamoBEEndpointParams{
|
|
|
122
133
|
};
|
|
123
134
|
}
|
|
124
135
|
|
|
136
|
+
/**
|
|
137
|
+
*
|
|
138
|
+
* @param res
|
|
139
|
+
* @param error
|
|
140
|
+
*/
|
|
125
141
|
error(res: Response, error): void {
|
|
126
142
|
DBE_Shared.logError(`${this.name} ERROR`, error, '\n');
|
|
127
143
|
res.status(error.status ? error.status : 501);
|
|
@@ -33,7 +33,11 @@ export class UsageService extends DynamoBEDataService<DynamoUsageSession> {
|
|
|
33
33
|
|
|
34
34
|
/* console.log(`...getLocationDataFromRequest... ip: ${this.data.address}`, this.data.locationData); */
|
|
35
35
|
} catch (error) {
|
|
36
|
-
throw new DynamoBEError({
|
|
36
|
+
throw new DynamoBEError({
|
|
37
|
+
status: 417, message: 'getLocationDataFromRequest was unsuccessful',
|
|
38
|
+
userMessage: `We were unable to deep analyze your request.`,
|
|
39
|
+
error
|
|
40
|
+
});
|
|
37
41
|
}
|
|
38
42
|
}
|
|
39
43
|
|
|
@@ -81,7 +85,11 @@ export class UsageService extends DynamoBEDataService<DynamoUsageSession> {
|
|
|
81
85
|
});
|
|
82
86
|
|
|
83
87
|
} catch (error) {
|
|
84
|
-
throw new DynamoBEError({
|
|
88
|
+
throw new DynamoBEError({
|
|
89
|
+
status: 417, message: 'getDailyUsage was unsuccessful',
|
|
90
|
+
userMessage: `We've failed to collect last week's usage data.`,
|
|
91
|
+
error
|
|
92
|
+
});
|
|
85
93
|
}
|
|
86
94
|
}
|
|
87
95
|
|
|
@@ -99,7 +107,11 @@ export class UsageService extends DynamoBEDataService<DynamoUsageSession> {
|
|
|
99
107
|
this.data.totalSessionTime = totalTime;
|
|
100
108
|
await this.saveData();
|
|
101
109
|
} catch (error) {
|
|
102
|
-
throw new DynamoBEError({
|
|
110
|
+
throw new DynamoBEError({
|
|
111
|
+
status: 417, message: 'updateSessionData was unsuccessful',
|
|
112
|
+
userMessage: `The attempt to update Usage Data was unsuccessful.`,
|
|
113
|
+
error
|
|
114
|
+
});
|
|
103
115
|
}
|
|
104
116
|
}
|
|
105
117
|
|
|
@@ -116,7 +128,11 @@ export class UsageService extends DynamoBEDataService<DynamoUsageSession> {
|
|
|
116
128
|
this.data.totalSessionTime = newTotalSessionTime;
|
|
117
129
|
await this.saveData();
|
|
118
130
|
} catch (error) {
|
|
119
|
-
throw new DynamoBEError({
|
|
131
|
+
throw new DynamoBEError({
|
|
132
|
+
status: 417, message: 'closeSession was unsuccessful',
|
|
133
|
+
userMessage: `The attempt to close Usage Session was unsuccessful.`,
|
|
134
|
+
error
|
|
135
|
+
});
|
|
120
136
|
}
|
|
121
137
|
}
|
|
122
138
|
}
|
|
@@ -7,8 +7,17 @@ import { HttpResponseType } from '../_enums/http/http-response-type.enum';
|
|
|
7
7
|
import { DynamoBEApiCallParams } from '../_models/dynamobe-api-call-params';
|
|
8
8
|
import { DBE_Shared } from './dynamobe-shared.service';
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
*
|
|
12
|
+
*/
|
|
10
13
|
export class DynamoBEApiService {
|
|
11
14
|
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* @param callParams
|
|
18
|
+
* @param inputParams
|
|
19
|
+
* @returns
|
|
20
|
+
*/
|
|
12
21
|
public static async startApiCall<T>(
|
|
13
22
|
callParams: DynamoBEApiCallParams,
|
|
14
23
|
inputParams?: {
|
|
@@ -115,7 +124,7 @@ export class DynamoBEApiService {
|
|
|
115
124
|
} else {
|
|
116
125
|
a = res.data;
|
|
117
126
|
}
|
|
118
|
-
console.log(`${callParams.name} was successful`, res.data);
|
|
127
|
+
console.log(`${callParams.name} api call was successful`, res.data);
|
|
119
128
|
});
|
|
120
129
|
break;
|
|
121
130
|
default:
|
|
@@ -139,9 +148,17 @@ export class DynamoBEApiService {
|
|
|
139
148
|
throw new DynamoBEError(error.response.data);
|
|
140
149
|
} else if (error.code === 'ENOTFOUND') {
|
|
141
150
|
DBE_Shared.logError(`\n${callParams.name} was UNSUCCESSFUL\n\n`, new Error());
|
|
142
|
-
throw new DynamoBEError({
|
|
151
|
+
throw new DynamoBEError({
|
|
152
|
+
status: 404, message: 'DNS error; address cannot be resolved!',
|
|
153
|
+
userMessage: `We encountered a BackEnd API Error, please contact the responsible development team. errorcode: 965-453-300`,
|
|
154
|
+
error: error
|
|
155
|
+
});
|
|
143
156
|
} else if (error.config && error.message) {
|
|
144
|
-
throw new DynamoBEError({
|
|
157
|
+
throw new DynamoBEError({
|
|
158
|
+
status: +error.message.substring(error.message.length - 4, 3),
|
|
159
|
+
userMessage: `We encountered a BackEnd API Error, please contact the responsible development team. errorcode: 965-453-303`,
|
|
160
|
+
error: error
|
|
161
|
+
});
|
|
145
162
|
} else {
|
|
146
163
|
DBE_Shared.logError(`\n${callParams.name} was UNSUCCESSFUL`, error, '\n\n', new Error());
|
|
147
164
|
throw error;
|
|
@@ -78,6 +78,9 @@ export abstract class DynamoBEApp extends DynamoBESingletonService {
|
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
+
/**
|
|
82
|
+
*
|
|
83
|
+
*/
|
|
81
84
|
private startDB(): void {
|
|
82
85
|
this.mongoose.connection
|
|
83
86
|
.on('error', (error) => {
|
|
@@ -96,6 +99,9 @@ export abstract class DynamoBEApp extends DynamoBESingletonService {
|
|
|
96
99
|
);
|
|
97
100
|
}
|
|
98
101
|
|
|
102
|
+
/**
|
|
103
|
+
*
|
|
104
|
+
*/
|
|
99
105
|
private initExpresses() {
|
|
100
106
|
if (this.security !== DynamoBERouteSecurity.secure) {
|
|
101
107
|
if (!this.httpPort) {
|
|
@@ -166,12 +172,18 @@ export abstract class DynamoBEApp extends DynamoBESingletonService {
|
|
|
166
172
|
}
|
|
167
173
|
}
|
|
168
174
|
|
|
175
|
+
/**
|
|
176
|
+
*
|
|
177
|
+
*/
|
|
169
178
|
private initOpenExpress(): void {
|
|
170
179
|
this.openExpress = Express();
|
|
171
180
|
this.openExpress.use(BodyParser.urlencoded({ limit: '50mb', extended: true }));
|
|
172
181
|
this.openExpress.use(BodyParser.json({ limit: '50mb' }));
|
|
173
182
|
}
|
|
174
183
|
|
|
184
|
+
/**
|
|
185
|
+
*
|
|
186
|
+
*/
|
|
175
187
|
private initSecureExpress(): void {
|
|
176
188
|
this.secureExpress = Express();
|
|
177
189
|
this.secureExpress.use(BodyParser.urlencoded({ limit: '50mb', extended: true }));
|
|
@@ -184,6 +196,9 @@ export abstract class DynamoBEApp extends DynamoBESingletonService {
|
|
|
184
196
|
this.httpsServer = Https.createServer(options, this.secureExpress);
|
|
185
197
|
}
|
|
186
198
|
|
|
199
|
+
/**
|
|
200
|
+
*
|
|
201
|
+
*/
|
|
187
202
|
private async startExpresses(): Promise<void> {
|
|
188
203
|
if (this.security !== DynamoBERouteSecurity.open) {
|
|
189
204
|
this.httpsServer
|
|
@@ -191,10 +206,10 @@ export abstract class DynamoBEApp extends DynamoBESingletonService {
|
|
|
191
206
|
DBE_Shared.logSuccess(`\nHTTPS (secure) server is listening on port ${this.httpsPort}\n`);
|
|
192
207
|
})
|
|
193
208
|
.on('error', (error) => {
|
|
194
|
-
DBE_Shared.logError(`\
|
|
209
|
+
DBE_Shared.logError(`\nHTTPS (secure) server ERROR`, error);
|
|
195
210
|
})
|
|
196
211
|
.on('uncaughtException', (ex) => {
|
|
197
|
-
DBE_Shared.logWarning(`\
|
|
212
|
+
DBE_Shared.logWarning(`\nHTTPS (secure) server uncaughtException`, ex);
|
|
198
213
|
});
|
|
199
214
|
}
|
|
200
215
|
|
|
@@ -204,14 +219,17 @@ export abstract class DynamoBEApp extends DynamoBESingletonService {
|
|
|
204
219
|
DBE_Shared.logSuccess(`\nHTTP (-open-) server is listening on port ${this.httpPort}\n`);
|
|
205
220
|
})
|
|
206
221
|
.on('error', (error) => {
|
|
207
|
-
DBE_Shared.logError(`\
|
|
222
|
+
DBE_Shared.logError(`\nHTTP (-open-) server ERROR`, error);
|
|
208
223
|
})
|
|
209
224
|
.on('uncaughtException', (ex) => {
|
|
210
|
-
DBE_Shared.logWarning(`\
|
|
225
|
+
DBE_Shared.logWarning(`\nHTTP (-open-) server uncaughtException`, ex);
|
|
211
226
|
});
|
|
212
227
|
}
|
|
213
228
|
}
|
|
214
229
|
|
|
230
|
+
/**
|
|
231
|
+
*
|
|
232
|
+
*/
|
|
215
233
|
private mountSecureRoutes (): void {
|
|
216
234
|
this.routingModules.forEach((module: DynamoBERoutingModule) => {
|
|
217
235
|
if (module.security !== DynamoBERouteSecurity.open) {
|
|
@@ -231,6 +249,9 @@ export abstract class DynamoBEApp extends DynamoBESingletonService {
|
|
|
231
249
|
});
|
|
232
250
|
}
|
|
233
251
|
|
|
252
|
+
/**
|
|
253
|
+
*
|
|
254
|
+
*/
|
|
234
255
|
private mountOpenRoutes (): void {
|
|
235
256
|
this.routingModules.forEach((module: DynamoBERoutingModule) => {
|
|
236
257
|
if (module.security !== DynamoBERouteSecurity.secure) {
|
|
@@ -250,6 +271,9 @@ export abstract class DynamoBEApp extends DynamoBESingletonService {
|
|
|
250
271
|
});
|
|
251
272
|
}
|
|
252
273
|
|
|
274
|
+
/**
|
|
275
|
+
*
|
|
276
|
+
*/
|
|
253
277
|
private setSecurity(): void {
|
|
254
278
|
this.routingModules.forEach((module: DynamoBERoutingModule) => {
|
|
255
279
|
if (!this.security) {
|
|
@@ -29,16 +29,31 @@ export abstract class DynamoBEAuthService extends DynamoBESingletonService {
|
|
|
29
29
|
static getTokenFromRequest(req: Request): string {
|
|
30
30
|
const authHeader = req.headers['authorization'];
|
|
31
31
|
if (!authHeader) {
|
|
32
|
-
throw new DynamoBEError({
|
|
32
|
+
throw new DynamoBEError({
|
|
33
|
+
message: 'AuthHeader missing!',
|
|
34
|
+
userMessage: `We encountered a BackEnd Auth Error, please contact the responsible development team. errorcode: 007-636-500`,
|
|
35
|
+
});
|
|
33
36
|
}
|
|
34
37
|
const token = authHeader.split(' ')[1];
|
|
35
38
|
if (!token) {
|
|
36
|
-
throw new DynamoBEError({
|
|
39
|
+
throw new DynamoBEError({
|
|
40
|
+
message: 'Token missing!',
|
|
41
|
+
userMessage: `We encountered a BackEnd Auth Error, please contact the responsible development team. errorcode: 007-636-501`,
|
|
42
|
+
});
|
|
37
43
|
}
|
|
38
44
|
return token;
|
|
39
45
|
}
|
|
40
46
|
|
|
47
|
+
/**
|
|
48
|
+
*
|
|
49
|
+
* @param req
|
|
50
|
+
* @param res
|
|
51
|
+
* @param next
|
|
52
|
+
*/
|
|
41
53
|
abstract authenticateTokenSelf(req: Request, res: Response, next: NextFunction): Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
*
|
|
56
|
+
*/
|
|
42
57
|
abstract authenticateToken(req: Request, res: Response, next: NextFunction): Promise<void>;
|
|
43
58
|
|
|
44
59
|
/**
|
|
@@ -54,5 +69,9 @@ export abstract class DynamoBEAuthService extends DynamoBESingletonService {
|
|
|
54
69
|
* @param req
|
|
55
70
|
*/
|
|
56
71
|
abstract getAccountIdFromRequest(req: Request): string;
|
|
72
|
+
/**
|
|
73
|
+
*
|
|
74
|
+
* @param req
|
|
75
|
+
*/
|
|
57
76
|
abstract getUsernameFromRequest(req: Request): string;
|
|
58
77
|
}
|
|
@@ -4,6 +4,9 @@ import { DynamoBEEndpointParams } from '../_models/dynamobe-endpoint-params';
|
|
|
4
4
|
import { DBE_Shared } from './dynamobe-shared.service';
|
|
5
5
|
import { DynamoBESingletonService } from './dynamobe-singleton.service';
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
7
10
|
export abstract class DynamoBEController extends DynamoBESingletonService {
|
|
8
11
|
|
|
9
12
|
endpoints: DynamoBEEndpointParams[];
|