skyeye-svc-common-utils 1.0.64 → 1.0.66
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/dist/interfaces/userInfo.d.ts +2 -0
- package/dist/interfaces/userInfo.js +1 -0
- package/dist/interfaces/userInfo.js.map +1 -1
- package/dist/models/organisation/grpcOrganisationModel.d.ts +1 -0
- package/dist/models/organisation/grpcOrganisationModel.js +1 -0
- package/dist/models/organisation/grpcOrganisationModel.js.map +1 -1
- package/dist/utils/baseClass/baseController.js +10 -9
- package/dist/utils/baseClass/baseController.js.map +1 -1
- package/package.json +1 -1
- package/src/interfaces/userInfo.ts +4 -0
- package/src/models/organisation/grpcOrganisationModel.ts +2 -1
- package/src/utils/baseClass/baseController.ts +25 -23
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { GrpcOrganisationModel } from '../models';
|
|
1
2
|
import { SubcriptionFeaturePermissionModel } from './subcriptionFeaturePermissionModel';
|
|
2
3
|
export declare class UserInfo {
|
|
3
4
|
userName: string;
|
|
@@ -7,6 +8,7 @@ export declare class UserInfo {
|
|
|
7
8
|
firstName: string;
|
|
8
9
|
lastName: string;
|
|
9
10
|
subcriptionFeaturePermissionModel: SubcriptionFeaturePermissionModel[];
|
|
11
|
+
organisation: GrpcOrganisationModel[];
|
|
10
12
|
requestOrganisation: string;
|
|
11
13
|
isPublicUser: boolean;
|
|
12
14
|
internalUsage: boolean;
|
|
@@ -12,6 +12,7 @@ class UserInfo {
|
|
|
12
12
|
this.internalUsage = null;
|
|
13
13
|
this.isApiUser = null;
|
|
14
14
|
this.subcriptionFeaturePermissionModel = new Array();
|
|
15
|
+
this.organisation = new Array();
|
|
15
16
|
this.requestOrganisation = null;
|
|
16
17
|
this.exp = Math.floor(Date.now() / 1000) + (60 * 60);
|
|
17
18
|
this.subKeys = new Array();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userInfo.js","sourceRoot":"","sources":["../../src/interfaces/userInfo.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"userInfo.js","sourceRoot":"","sources":["../../src/interfaces/userInfo.ts"],"names":[],"mappings":";;;AAGA,MAAa,QAAQ;IA6BjB;QACI,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QACzB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;QAC1B,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,IAAI,CAAC,iCAAiC,GAAG,IAAI,KAAK,EAAqC,CAAC;QACxF,IAAI,CAAC,YAAY,GAAG,IAAI,KAAK,EAAyB,CAAC;QACvD,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC;QAChC,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;QACrD,IAAI,CAAC,OAAO,GAAG,IAAI,KAAK,EAAU,CAAC;IACvC,CAAC;CACJ;AA5CD,4BA4CC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grpcOrganisationModel.js","sourceRoot":"","sources":["../../../src/models/organisation/grpcOrganisationModel.ts"],"names":[],"mappings":";;;AAAA,MAAa,qBAAqB;IAe9B;QACI,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QACxB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;QAC1B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACnB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACnB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"grpcOrganisationModel.js","sourceRoot":"","sources":["../../../src/models/organisation/grpcOrganisationModel.ts"],"names":[],"mappings":";;;AAAA,MAAa,qBAAqB;IAe9B;QACI,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QACxB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;QAC1B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACnB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACnB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QACxB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IACxB,CAAC;CACJ;AA9BD,sDA8BC"}
|
|
@@ -36,7 +36,7 @@ class BaseController {
|
|
|
36
36
|
logger_1.logger.error(`BaseController/startTransaction Release Error: ${err}`);
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
return Promise.reject(`
|
|
39
|
+
return Promise.reject(`BaseController/startTransaction error while starting transaction, ${error}`);
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
42
|
}
|
|
@@ -66,13 +66,13 @@ class BaseController {
|
|
|
66
66
|
logger_1.logger.error(`BaseController/endTransaction: ${err}`);
|
|
67
67
|
}
|
|
68
68
|
finally {
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
try {
|
|
70
|
+
if (!baseControllerParameter.queryRunner.isReleased) {
|
|
71
71
|
yield baseControllerParameter.queryRunner.release();
|
|
72
72
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}
|
|
73
|
+
}
|
|
74
|
+
catch (err) {
|
|
75
|
+
logger_1.logger.error(`BaseController/endTransaction Release Error: ${err}`);
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
});
|
|
@@ -85,7 +85,7 @@ class BaseController {
|
|
|
85
85
|
try {
|
|
86
86
|
baseControllerParameter.userInfo = (0, commonUtils_1.getUserInfo)(res);
|
|
87
87
|
if (appConfig_1.commonAppConfig.SqlEnable) {
|
|
88
|
-
BaseController.mutex.runExclusive(() =>
|
|
88
|
+
BaseController.mutex.runExclusive(() => {
|
|
89
89
|
this.startTransaction().then((queryRunner) => {
|
|
90
90
|
baseControllerParameter.queryRunner = queryRunner;
|
|
91
91
|
return this.executeImpl(req.body, baseControllerParameter);
|
|
@@ -94,18 +94,19 @@ class BaseController {
|
|
|
94
94
|
}).then(() => {
|
|
95
95
|
return (0, commonUtils_1.sendResponse)(res, next, baseControllerParameter.serviceResponse);
|
|
96
96
|
}).catch((err) => {
|
|
97
|
+
logger_1.logger.error(`BaseController/executeRest error: ${err}`);
|
|
97
98
|
baseControllerParameter.serviceResponse.isSuccess = false;
|
|
98
99
|
this.endTransaction(baseControllerParameter).then(() => {
|
|
99
100
|
next(err);
|
|
100
101
|
});
|
|
101
102
|
});
|
|
102
|
-
|
|
103
|
-
}));
|
|
103
|
+
});
|
|
104
104
|
}
|
|
105
105
|
else {
|
|
106
106
|
this.executeImpl(req.body, baseControllerParameter).then(() => {
|
|
107
107
|
return (0, commonUtils_1.sendResponse)(res, next, baseControllerParameter.serviceResponse);
|
|
108
108
|
}).catch((err) => {
|
|
109
|
+
logger_1.logger.error(`BaseController/executeRest error: ${err}`);
|
|
109
110
|
baseControllerParameter.serviceResponse.isSuccess = false;
|
|
110
111
|
next(err);
|
|
111
112
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baseController.js","sourceRoot":"","sources":["../../../src/utils/baseClass/baseController.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,gDAAsE;AACtE,6CAA0C;AAE1C,yCAAuD;AACvD,qCAAqD;AACrD,0CAA6C;AAC7C,4CAA+C;AAC/C,6CAAoC;AAGpC,MAAsB,cAAc;IAI1B,gBAAgB;;YAClB,IAAI,WAAwB,CAAC;YAE7B,IAAI;gBACA,MAAM,UAAU,GAAG,IAAA,uBAAa,GAAE,CAAC;gBACnC,WAAW,GAAG,UAAU,CAAC,iBAAiB,EAAE,CAAC;gBAC7C,MAAM,WAAW,CAAC,gBAAgB,EAAE,CAAC;gBAErC,OAAO,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;aACvC;YAAC,OAAO,KAAK,EAAE;gBACZ,IAAI,WAAW,IAAI,CAAC,WAAW,CAAC,UAAU,EAAE;oBACxC,IAAI;wBACA,MAAM,WAAW,CAAC,OAAO,EAAE,CAAC;qBAC/B;oBAAC,OAAO,GAAG,EAAE;wBACV,eAAM,CAAC,KAAK,CAAC,kDAAkD,GAAG,EAAE,CAAC,CAAC;qBACzE;iBACJ;gBAED,OAAO,OAAO,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"baseController.js","sourceRoot":"","sources":["../../../src/utils/baseClass/baseController.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,gDAAsE;AACtE,6CAA0C;AAE1C,yCAAuD;AACvD,qCAAqD;AACrD,0CAA6C;AAC7C,4CAA+C;AAC/C,6CAAoC;AAGpC,MAAsB,cAAc;IAI1B,gBAAgB;;YAClB,IAAI,WAAwB,CAAC;YAE7B,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ionFeaturePermissionModel';
|
|
2
3
|
|
|
3
4
|
export class UserInfo {
|
|
@@ -15,6 +16,8 @@ export class UserInfo {
|
|
|
15
16
|
|
|
16
17
|
subcriptionFeaturePermissionModel: SubcriptionFeaturePermissionModel[];
|
|
17
18
|
|
|
19
|
+
organisation: GrpcOrganisationModel[];
|
|
20
|
+
|
|
18
21
|
requestOrganisation: string;
|
|
19
22
|
|
|
20
23
|
isPublicUser: boolean;
|
|
@@ -37,6 +40,7 @@ export class UserInfo {
|
|
|
37
40
|
this.internalUsage = null;
|
|
38
41
|
this.isApiUser = null;
|
|
39
42
|
this.subcriptionFeaturePermissionModel = new Array<SubcriptionFeaturePermissionModel>();
|
|
43
|
+
this.organisation = new Array<GrpcOrganisationModel>();
|
|
40
44
|
this.requestOrganisation = null;
|
|
41
45
|
this.exp = Math.floor(Date.now() / 1000) + (60 * 60);
|
|
42
46
|
this.subKeys = new Array<string>();
|
|
@@ -11,7 +11,7 @@ export class GrpcOrganisationModel {
|
|
|
11
11
|
source: string;
|
|
12
12
|
industry: string;
|
|
13
13
|
salesRegion: string;
|
|
14
|
-
|
|
14
|
+
country: string;
|
|
15
15
|
|
|
16
16
|
constructor() {
|
|
17
17
|
this.guid = null;
|
|
@@ -26,5 +26,6 @@ export class GrpcOrganisationModel {
|
|
|
26
26
|
this.source = null;
|
|
27
27
|
this.industry = null;
|
|
28
28
|
this.salesRegion = null;
|
|
29
|
+
this.country = null;
|
|
29
30
|
}
|
|
30
31
|
}
|
|
@@ -31,7 +31,7 @@ export abstract class BaseController {
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
return Promise.reject(`
|
|
34
|
+
return Promise.reject(`BaseController/startTransaction error while starting transaction, ${error}`);
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
|
|
@@ -58,12 +58,12 @@ export abstract class BaseController {
|
|
|
58
58
|
} catch (err) {
|
|
59
59
|
logger.error(`BaseController/endTransaction: ${err}`);
|
|
60
60
|
} finally {
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
try {
|
|
62
|
+
if (!baseControllerParameter.queryRunner.isReleased) {
|
|
63
63
|
await baseControllerParameter.queryRunner.release();
|
|
64
|
-
} catch (err) {
|
|
65
|
-
logger.error(`BaseController/endTransaction Release Error: ${err}`);
|
|
66
64
|
}
|
|
65
|
+
} catch (err) {
|
|
66
|
+
logger.error(`BaseController/endTransaction Release Error: ${err}`);
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
}
|
|
@@ -77,28 +77,30 @@ export abstract class BaseController {
|
|
|
77
77
|
try {
|
|
78
78
|
baseControllerParameter.userInfo = getUserInfo(res);
|
|
79
79
|
if (commonAppConfig.SqlEnable) {
|
|
80
|
-
BaseController.mutex.runExclusive(
|
|
80
|
+
BaseController.mutex.runExclusive(() => {
|
|
81
81
|
this.startTransaction().then((queryRunner: QueryRunner) => {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
82
|
+
baseControllerParameter.queryRunner = queryRunner;
|
|
83
|
+
return this.executeImpl(req.body, baseControllerParameter);
|
|
84
|
+
}).then(() => {
|
|
85
|
+
return this.endTransaction(baseControllerParameter);
|
|
86
|
+
}).then(() => {
|
|
87
|
+
return sendResponse(res, next, baseControllerParameter.serviceResponse);
|
|
88
|
+
}).catch((err: Error) => {
|
|
89
|
+
logger.error(`BaseController/executeRest error: ${err}`);
|
|
90
|
+
baseControllerParameter.serviceResponse.isSuccess = false;
|
|
91
|
+
this.endTransaction(baseControllerParameter).then(() => {
|
|
92
|
+
next(err);
|
|
93
|
+
});
|
|
92
94
|
});
|
|
93
|
-
})
|
|
94
|
-
});
|
|
95
|
+
});
|
|
95
96
|
} else {
|
|
96
97
|
this.executeImpl(req.body, baseControllerParameter).then(() => {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
98
|
+
return sendResponse(res, next, baseControllerParameter.serviceResponse);
|
|
99
|
+
}).catch((err: Error) => {
|
|
100
|
+
logger.error(`BaseController/executeRest error: ${err}`);
|
|
101
|
+
baseControllerParameter.serviceResponse.isSuccess = false;
|
|
102
|
+
next(err);
|
|
103
|
+
});
|
|
102
104
|
}
|
|
103
105
|
} catch (err) {
|
|
104
106
|
next(err);
|