skyeye-svc-common-utils 1.0.136 → 1.0.138
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/.env +2 -2
- package/.github/dependabot.yml +17 -17
- package/.vscode/settings.json +24 -24
- package/README.md +30 -30
- package/package.json +83 -83
- package/pull_request_template.md +41 -41
- package/sonar-project.properties +11 -11
- package/src/index.ts +32 -32
- package/src/interfaces/apiResponse.ts +6 -6
- package/src/interfaces/grpcListRequest.ts +5 -5
- package/src/interfaces/grpcServiceResponse.ts +7 -7
- package/src/interfaces/httpError.ts +11 -11
- package/src/interfaces/index.ts +17 -17
- package/src/interfaces/internalHttp/request/search.ts +10 -10
- package/src/interfaces/internalHttp/response/search.ts +12 -12
- package/src/interfaces/pagination.ts +10 -10
- package/src/interfaces/serviceResponse.ts +8 -8
- package/src/interfaces/subcriptionFeaturePermissionModel.ts +25 -25
- package/src/interfaces/userInfo.ts +47 -47
- package/src/lib/azure/azureBlobStorage.ts +160 -160
- package/src/lib/azure/azureKeyVault.ts +14 -14
- package/src/lib/azure/azureServiceBusClient.ts +129 -129
- package/src/lib/azure/azureServiceBusQueue.ts +24 -24
- package/src/lib/azure/azureStorageQueue.ts +11 -11
- package/src/lib/azure/azureTableStorage.ts +28 -28
- package/src/lib/httpClient.ts +38 -38
- package/src/lib/redisClient.ts +121 -121
- package/src/lib/sendGridClient.ts +251 -251
- package/src/models/baseControllerParameter.ts +15 -15
- package/src/models/campaign/grpcCampaignEventModel.ts +50 -50
- package/src/models/campaign/grpcCampaignEventUserModel.ts +34 -34
- package/src/models/campaign/grpcCampaignUserModel.ts +29 -29
- package/src/models/campaign/index.ts +8 -8
- package/src/models/digest/digestModel.ts +15 -15
- package/src/models/digest/index.ts +4 -4
- package/src/models/emailtemplate/grpcEmailTemplateModel.ts +19 -19
- package/src/models/emailtemplate/index.ts +3 -3
- package/src/models/index.ts +13 -13
- package/src/models/organisation/grpcOrganisationModel.ts +30 -30
- package/src/models/organisation/index.ts +3 -3
- package/src/models/rbac/grpcRoleModel.ts +21 -21
- package/src/models/rbac/index.ts +3 -3
- package/src/models/scoutai/grpcAIDETrainingResultListModel.ts +13 -13
- package/src/models/scoutai/grpcNerlCorrectionModel.ts +19 -19
- package/src/models/scoutai/grpcScoutAIListReq.ts +22 -22
- package/src/models/scoutai/grpcScoutAIModel.ts +17 -17
- package/src/models/scoutai/grpcScoutAIResult.ts +18 -18
- package/src/models/scoutai/grpcTaasConfigAIModel.ts +10 -10
- package/src/models/scoutai/grpcTaasConfigModel.ts +19 -19
- package/src/models/scoutai/grpcTaasConfigUserModel.ts +14 -14
- package/src/models/scoutai/grpcTagItemModel.ts +15 -15
- package/src/models/scoutai/grpcVisualisationModel.ts +18 -18
- package/src/models/scoutai/grpcVisualisationPositionModel.ts +12 -12
- package/src/models/scoutai/index.ts +20 -20
- package/src/models/search/grpcAggregation.ts +12 -12
- package/src/models/search/grpcCmsModel.ts +7 -7
- package/src/models/search/grpcCommonModels.ts +149 -149
- package/src/models/search/grpcCompanyAggregation.ts +21 -21
- package/src/models/search/grpcCompanyConnectModel.ts +25 -25
- package/src/models/search/grpcCompanyListReq.ts +70 -70
- package/src/models/search/grpcCompanyModel.ts +99 -99
- package/src/models/search/grpcCompanyNewsCountModel.ts +16 -16
- package/src/models/search/grpcCompanyPeriodMentionModel.ts +33 -33
- package/src/models/search/grpcCompanyPreviewModel.ts +49 -49
- package/src/models/search/grpcContentAggregation.ts +7 -7
- package/src/models/search/grpcContentListReq.ts +30 -30
- package/src/models/search/grpcContentModel.ts +64 -64
- package/src/models/search/grpcContentPreviewModel.ts +59 -59
- package/src/models/search/grpcContentTabsModel.ts +17 -17
- package/src/models/search/grpcCountryModel.ts +23 -23
- package/src/models/search/grpcFinancialModel.ts +293 -293
- package/src/models/search/grpcMarketModel.ts +17 -17
- package/src/models/search/grpcMentionContentCountModel.ts +4 -4
- package/src/models/search/index.ts +42 -42
- package/src/models/subscription/applicationFeatureModel.ts +12 -12
- package/src/models/subscription/featureModel.ts +13 -13
- package/src/models/subscription/grpcSubscriptionModel.ts +15 -15
- package/src/models/subscription/index.ts +19 -19
- package/src/models/subscription/licenseModel.ts +9 -9
- package/src/models/subscription/licenseUserModel.ts +7 -7
- package/src/models/subscription/subscriptionFeatureModel.ts +9 -9
- package/src/models/subscription/subscriptionModel.ts +24 -24
- package/src/models/subscription/subscriptionPlanFeatureModel.ts +8 -8
- package/src/models/subscription/subscriptionPlanModel.ts +27 -27
- package/src/models/user/grpcAccountInfoModel.ts +4 -4
- package/src/models/user/grpcAppUserModel.ts +39 -39
- package/src/models/user/grpcAppUserOrganisationStatistic.ts +12 -12
- package/src/models/user/grpcAppUserRoleModel.ts +10 -10
- package/src/models/user/grpcBrowseHistoryModel.ts +19 -19
- package/src/models/user/grpcDailyDigestUserModel.ts +23 -23
- package/src/models/user/grpcNotificationSettingModel.ts +28 -28
- package/src/models/user/grpcSavedSearchModel.ts +19 -19
- package/src/models/user/grpcSearchHistoryModel.ts +16 -16
- package/src/models/user/grpcTargetListEntityModel.ts +4 -4
- package/src/models/user/grpcTargetListExportModel.ts +19 -19
- package/src/models/user/grpcTargetListItemModel.ts +16 -16
- package/src/models/user/grpcTargetListModel.ts +21 -21
- package/src/models/user/index.ts +27 -27
- package/src/utils/appConfig.ts +52 -52
- package/src/utils/appConst.ts +178 -178
- package/src/utils/authentication/auth.ts +148 -148
- package/src/utils/authentication/role.ts +147 -147
- package/src/utils/baseClass/baseController.ts +162 -162
- package/src/utils/baseClass/baseService.ts +11 -11
- package/src/utils/commonUtils/appConfigKeyRetriever.ts +40 -40
- package/src/utils/commonUtils/appUtils.ts +200 -200
- package/src/utils/commonUtils/cronUtils.ts +24 -24
- package/src/utils/commonUtils/index.ts +5 -5
- package/src/utils/commonUtils/jwtUtils.ts +41 -41
- package/src/utils/commonUtils/responseUtils.ts +97 -97
- package/src/utils/commonUtils/validation.ts +60 -60
- package/src/utils/constant/httpCodes.ts +17 -17
- package/src/utils/documentation/swagger.ts +39 -39
- package/src/utils/logger/logger.ts +65 -65
- package/src/utils/logger/morganLogger.ts +42 -42
- package/src/utils/middleware/handleError.ts +26 -26
- package/src/utils/middleware/isPublicUser.ts +33 -33
- package/src/utils/middleware/overwriteConst.ts +65 -65
- package/src/utils/middleware/startdbConnection.ts +17 -17
- package/src/utils/monitoring/apm.ts +80 -80
- package/tsconfig.json +30 -30
package/.env
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
PUBLIC_JWT_SECRET=unittest
|
|
2
|
-
USER_PUBLIC_RETRIEVE = usersvc
|
|
1
|
+
PUBLIC_JWT_SECRET=unittest
|
|
2
|
+
USER_PUBLIC_RETRIEVE = usersvc
|
|
3
3
|
USER_INTERNAL_RETRIEVE = usersvc
|
package/.github/dependabot.yml
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
# for more information, see https://dependabot.com
|
|
2
|
-
# for more settings, see https://docs.github.com/en/free-pro-team@latest/github/administering-a-repository/configuration-options-for-dependency-updates#commit-message
|
|
3
|
-
|
|
4
|
-
version: 2
|
|
5
|
-
updates:
|
|
6
|
-
- package-ecosystem: npm
|
|
7
|
-
directory: "/"
|
|
8
|
-
schedule:
|
|
9
|
-
interval: daily
|
|
10
|
-
target-branch: "master"
|
|
11
|
-
open-pull-requests-limit: 1
|
|
12
|
-
reviewers:
|
|
13
|
-
- dexterchang-tw
|
|
14
|
-
- Clifford-Liu
|
|
15
|
-
- Steven-h3
|
|
16
|
-
- sophia6734wu
|
|
17
|
-
allow:
|
|
1
|
+
# for more information, see https://dependabot.com
|
|
2
|
+
# for more settings, see https://docs.github.com/en/free-pro-team@latest/github/administering-a-repository/configuration-options-for-dependency-updates#commit-message
|
|
3
|
+
|
|
4
|
+
version: 2
|
|
5
|
+
updates:
|
|
6
|
+
- package-ecosystem: npm
|
|
7
|
+
directory: "/"
|
|
8
|
+
schedule:
|
|
9
|
+
interval: daily
|
|
10
|
+
target-branch: "master"
|
|
11
|
+
open-pull-requests-limit: 1
|
|
12
|
+
reviewers:
|
|
13
|
+
- dexterchang-tw
|
|
14
|
+
- Clifford-Liu
|
|
15
|
+
- Steven-h3
|
|
16
|
+
- sophia6734wu
|
|
17
|
+
allow:
|
|
18
18
|
- dependency-name: skyeye-common-const
|
package/.vscode/settings.json
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
{
|
|
2
|
-
"cSpell.words": [
|
|
3
|
-
"APIKEY",
|
|
4
|
-
"DELINK",
|
|
5
|
-
"ICBSECTOR",
|
|
6
|
-
"KEYVAULT",
|
|
7
|
-
"NERL",
|
|
8
|
-
"RBAC",
|
|
9
|
-
"SCOUTAI",
|
|
10
|
-
"SCOUTAIRESULT",
|
|
11
|
-
"TAASCONFIG",
|
|
12
|
-
"blobstorage",
|
|
13
|
-
"guids",
|
|
14
|
-
"mutex",
|
|
15
|
-
"openapi",
|
|
16
|
-
"organisation",
|
|
17
|
-
"printf",
|
|
18
|
-
"proto",
|
|
19
|
-
"protobuf",
|
|
20
|
-
"skyeye",
|
|
21
|
-
"startdb",
|
|
22
|
-
"tada",
|
|
23
|
-
"typeorm"
|
|
24
|
-
]
|
|
1
|
+
{
|
|
2
|
+
"cSpell.words": [
|
|
3
|
+
"APIKEY",
|
|
4
|
+
"DELINK",
|
|
5
|
+
"ICBSECTOR",
|
|
6
|
+
"KEYVAULT",
|
|
7
|
+
"NERL",
|
|
8
|
+
"RBAC",
|
|
9
|
+
"SCOUTAI",
|
|
10
|
+
"SCOUTAIRESULT",
|
|
11
|
+
"TAASCONFIG",
|
|
12
|
+
"blobstorage",
|
|
13
|
+
"guids",
|
|
14
|
+
"mutex",
|
|
15
|
+
"openapi",
|
|
16
|
+
"organisation",
|
|
17
|
+
"printf",
|
|
18
|
+
"proto",
|
|
19
|
+
"protobuf",
|
|
20
|
+
"skyeye",
|
|
21
|
+
"startdb",
|
|
22
|
+
"tada",
|
|
23
|
+
"typeorm"
|
|
24
|
+
]
|
|
25
25
|
}
|
package/README.md
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
# SkyEye-SVC-Common-Utils
|
|
2
|
-
This is the common utils for SkyEye service projects,
|
|
3
|
-
It includes multiple utils, middilewares, authentications, some common interfaces.
|
|
4
|
-
|
|
5
|
-
# GRPC
|
|
6
|
-
This command to build .proto files for Typescript used.
|
|
7
|
-
- protoc --proto_path=./ grpcProtos/sample.proto --js_out=import_style=commonjs,binary:. --ts_out=service=true:.
|
|
8
|
-
|
|
9
|
-
Please make sure run the `npm run build` before push changes
|
|
10
|
-
|
|
11
|
-
## Command to run test
|
|
12
|
-
`npm run test`
|
|
13
|
-
|
|
14
|
-
## Command to run code coverage
|
|
15
|
-
`npm run coverage`
|
|
16
|
-
|
|
17
|
-
**Note**
|
|
18
|
-
|
|
19
|
-
* don't push the `.nyc_output\xx\xx.json` and `coverage` file to github
|
|
20
|
-
* upload all the file from **report** folder
|
|
21
|
-
|
|
22
|
-
## Permissions
|
|
23
|
-
When add new permissions, please avoid duplication,
|
|
24
|
-
value for permission list :
|
|
25
|
-
`permissionCode`: `<ServiceName>_<HTTP Method>_<Controller>_<Action>`
|
|
26
|
-
`permissionLabel`: any name you want to show to frontend for easy recognise
|
|
27
|
-
`permissionDesc`: short description on what this permission can do
|
|
28
|
-
`permissionMethod`: The http Method: GET/POST/PUT/DELETE , uppercase only
|
|
29
|
-
`permissionUrl`: the Path for this permission. `/<Controller>/<Action>`
|
|
30
|
-
`allowAnonymous`: whether this path is able to access by anyone
|
|
1
|
+
# SkyEye-SVC-Common-Utils
|
|
2
|
+
This is the common utils for SkyEye service projects,
|
|
3
|
+
It includes multiple utils, middilewares, authentications, some common interfaces.
|
|
4
|
+
|
|
5
|
+
# GRPC
|
|
6
|
+
This command to build .proto files for Typescript used.
|
|
7
|
+
- protoc --proto_path=./ grpcProtos/sample.proto --js_out=import_style=commonjs,binary:. --ts_out=service=true:.
|
|
8
|
+
|
|
9
|
+
Please make sure run the `npm run build` before push changes
|
|
10
|
+
|
|
11
|
+
## Command to run test
|
|
12
|
+
`npm run test`
|
|
13
|
+
|
|
14
|
+
## Command to run code coverage
|
|
15
|
+
`npm run coverage`
|
|
16
|
+
|
|
17
|
+
**Note**
|
|
18
|
+
|
|
19
|
+
* don't push the `.nyc_output\xx\xx.json` and `coverage` file to github
|
|
20
|
+
* upload all the file from **report** folder
|
|
21
|
+
|
|
22
|
+
## Permissions
|
|
23
|
+
When add new permissions, please avoid duplication,
|
|
24
|
+
value for permission list :
|
|
25
|
+
`permissionCode`: `<ServiceName>_<HTTP Method>_<Controller>_<Action>`
|
|
26
|
+
`permissionLabel`: any name you want to show to frontend for easy recognise
|
|
27
|
+
`permissionDesc`: short description on what this permission can do
|
|
28
|
+
`permissionMethod`: The http Method: GET/POST/PUT/DELETE , uppercase only
|
|
29
|
+
`permissionUrl`: the Path for this permission. `/<Controller>/<Action>`
|
|
30
|
+
`allowAnonymous`: whether this path is able to access by anyone
|
package/package.json
CHANGED
|
@@ -1,83 +1,83 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "skyeye-svc-common-utils",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"types": "dist/index.d.ts",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"build": "tsc -p ./tsconfig.json",
|
|
9
|
-
"clean": "rm -rf node_modules log",
|
|
10
|
-
"cleanPublish": "npm i && npm run build && npm run clean && npm publish"
|
|
11
|
-
},
|
|
12
|
-
"repository": {
|
|
13
|
-
"type": "git",
|
|
14
|
-
"url": "git+https://github.com/HandshakesByDC/SkyEye-SVC-Common-Utils.git"
|
|
15
|
-
},
|
|
16
|
-
"author": "",
|
|
17
|
-
"license": "ISC",
|
|
18
|
-
"bugs": {
|
|
19
|
-
"url": "https://github.com/HandshakesByDC/SkyEye-SVC-Common-Utils/issues"
|
|
20
|
-
},
|
|
21
|
-
"homepage": "https://github.com/HandshakesByDC/SkyEye-SVC-Common-Utils#readme",
|
|
22
|
-
"dependencies": {
|
|
23
|
-
"@azure/data-tables": "^13.2.2",
|
|
24
|
-
"@azure/identity": "4.4.1",
|
|
25
|
-
"@azure/keyvault-secrets": "4.8.0",
|
|
26
|
-
"@azure/service-bus": "7.9.1",
|
|
27
|
-
"@azure/storage-blob": "12.27.0",
|
|
28
|
-
"@azure/storage-queue": "^12.0.2",
|
|
29
|
-
"@azure/core-rest-pipeline": "1.12.2",
|
|
30
|
-
"@azure/core-lro": "2.6.0",
|
|
31
|
-
"@azure/logger": "1.0.4",
|
|
32
|
-
"@sendgrid/client": "^8.1.3",
|
|
33
|
-
"@sendgrid/helpers": "^8.0.0",
|
|
34
|
-
"@sendgrid/mail": "^7.7.0",
|
|
35
|
-
"@types/chai": "^4.2.11",
|
|
36
|
-
"@types/express": "4.17.14",
|
|
37
|
-
"@types/express-serve-static-core": "4.17.30",
|
|
38
|
-
"@types/google-protobuf": "^3.7.2",
|
|
39
|
-
"@types/ioredis": "^4.26.4",
|
|
40
|
-
"@types/jsonwebtoken": "^9.0.0",
|
|
41
|
-
"@types/lodash": "4.14.182",
|
|
42
|
-
"@types/swagger-jsdoc": "^3.0.2",
|
|
43
|
-
"@types/swagger-ui-express": "^4.1.1",
|
|
44
|
-
"async-mutex": "^0.3.2",
|
|
45
|
-
"cron-parser": "4.8.1",
|
|
46
|
-
"dateformat": "^3.0.3",
|
|
47
|
-
"debug": "^4.1.1",
|
|
48
|
-
"dotenv": "^8.2.0",
|
|
49
|
-
"elastic-apm-node": "^3.5.0",
|
|
50
|
-
"express": "^4.17.1",
|
|
51
|
-
"http-errors": "^1.7.3",
|
|
52
|
-
"https": "^1.0.0",
|
|
53
|
-
"ioredis": "^4.27.6",
|
|
54
|
-
"jsonwebtoken": "^9.0.0",
|
|
55
|
-
"logform": "2.4.2",
|
|
56
|
-
"moment": "^2.24.0",
|
|
57
|
-
"morgan": "^1.9.1",
|
|
58
|
-
"node-fetch": "^2.6.0",
|
|
59
|
-
"nyc": "^15.1.0",
|
|
60
|
-
"rotating-file-stream": "^1.4.6",
|
|
61
|
-
"skyeye-common-const": "1.0.
|
|
62
|
-
"swagger-jsdoc": "^3.5.0",
|
|
63
|
-
"swagger-ui-express": "^4.1.3",
|
|
64
|
-
"ts-node": "^9.0.0",
|
|
65
|
-
"typeorm": "^0.2.20",
|
|
66
|
-
"@types/tedious": "^18.0.0",
|
|
67
|
-
"tedious": "^18.6.1",
|
|
68
|
-
"typescript": "^4.8.4",
|
|
69
|
-
"uuid": "^3.3.3",
|
|
70
|
-
"winston": "^3.2.1",
|
|
71
|
-
"winston-daily-rotate-file": "^4.2.1",
|
|
72
|
-
"follow-redirects": "^1.15.6"
|
|
73
|
-
},
|
|
74
|
-
"devDependencies": {
|
|
75
|
-
"@types/dateformat": "^3.0.1",
|
|
76
|
-
"@types/debug": "~4.1.5",
|
|
77
|
-
"@types/http-errors": "~1.6.1",
|
|
78
|
-
"@types/morgan": "~1.7.37",
|
|
79
|
-
"@types/node": "^14.0.27",
|
|
80
|
-
"@types/node-fetch": "^2.5.3",
|
|
81
|
-
"@types/uuid": "^3.4.6"
|
|
82
|
-
}
|
|
83
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "skyeye-svc-common-utils",
|
|
3
|
+
"version": "1.0.138",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "tsc -p ./tsconfig.json",
|
|
9
|
+
"clean": "rm -rf node_modules log",
|
|
10
|
+
"cleanPublish": "npm i && npm run build && npm run clean && npm publish"
|
|
11
|
+
},
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "git+https://github.com/HandshakesByDC/SkyEye-SVC-Common-Utils.git"
|
|
15
|
+
},
|
|
16
|
+
"author": "",
|
|
17
|
+
"license": "ISC",
|
|
18
|
+
"bugs": {
|
|
19
|
+
"url": "https://github.com/HandshakesByDC/SkyEye-SVC-Common-Utils/issues"
|
|
20
|
+
},
|
|
21
|
+
"homepage": "https://github.com/HandshakesByDC/SkyEye-SVC-Common-Utils#readme",
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@azure/data-tables": "^13.2.2",
|
|
24
|
+
"@azure/identity": "4.4.1",
|
|
25
|
+
"@azure/keyvault-secrets": "4.8.0",
|
|
26
|
+
"@azure/service-bus": "7.9.1",
|
|
27
|
+
"@azure/storage-blob": "12.27.0",
|
|
28
|
+
"@azure/storage-queue": "^12.0.2",
|
|
29
|
+
"@azure/core-rest-pipeline": "1.12.2",
|
|
30
|
+
"@azure/core-lro": "2.6.0",
|
|
31
|
+
"@azure/logger": "1.0.4",
|
|
32
|
+
"@sendgrid/client": "^8.1.3",
|
|
33
|
+
"@sendgrid/helpers": "^8.0.0",
|
|
34
|
+
"@sendgrid/mail": "^7.7.0",
|
|
35
|
+
"@types/chai": "^4.2.11",
|
|
36
|
+
"@types/express": "4.17.14",
|
|
37
|
+
"@types/express-serve-static-core": "4.17.30",
|
|
38
|
+
"@types/google-protobuf": "^3.7.2",
|
|
39
|
+
"@types/ioredis": "^4.26.4",
|
|
40
|
+
"@types/jsonwebtoken": "^9.0.0",
|
|
41
|
+
"@types/lodash": "4.14.182",
|
|
42
|
+
"@types/swagger-jsdoc": "^3.0.2",
|
|
43
|
+
"@types/swagger-ui-express": "^4.1.1",
|
|
44
|
+
"async-mutex": "^0.3.2",
|
|
45
|
+
"cron-parser": "4.8.1",
|
|
46
|
+
"dateformat": "^3.0.3",
|
|
47
|
+
"debug": "^4.1.1",
|
|
48
|
+
"dotenv": "^8.2.0",
|
|
49
|
+
"elastic-apm-node": "^3.5.0",
|
|
50
|
+
"express": "^4.17.1",
|
|
51
|
+
"http-errors": "^1.7.3",
|
|
52
|
+
"https": "^1.0.0",
|
|
53
|
+
"ioredis": "^4.27.6",
|
|
54
|
+
"jsonwebtoken": "^9.0.0",
|
|
55
|
+
"logform": "2.4.2",
|
|
56
|
+
"moment": "^2.24.0",
|
|
57
|
+
"morgan": "^1.9.1",
|
|
58
|
+
"node-fetch": "^2.6.0",
|
|
59
|
+
"nyc": "^15.1.0",
|
|
60
|
+
"rotating-file-stream": "^1.4.6",
|
|
61
|
+
"skyeye-common-const": "1.0.92",
|
|
62
|
+
"swagger-jsdoc": "^3.5.0",
|
|
63
|
+
"swagger-ui-express": "^4.1.3",
|
|
64
|
+
"ts-node": "^9.0.0",
|
|
65
|
+
"typeorm": "^0.2.20",
|
|
66
|
+
"@types/tedious": "^18.0.0",
|
|
67
|
+
"tedious": "^18.6.1",
|
|
68
|
+
"typescript": "^4.8.4",
|
|
69
|
+
"uuid": "^3.3.3",
|
|
70
|
+
"winston": "^3.2.1",
|
|
71
|
+
"winston-daily-rotate-file": "^4.2.1",
|
|
72
|
+
"follow-redirects": "^1.15.6"
|
|
73
|
+
},
|
|
74
|
+
"devDependencies": {
|
|
75
|
+
"@types/dateformat": "^3.0.1",
|
|
76
|
+
"@types/debug": "~4.1.5",
|
|
77
|
+
"@types/http-errors": "~1.6.1",
|
|
78
|
+
"@types/morgan": "~1.7.37",
|
|
79
|
+
"@types/node": "^14.0.27",
|
|
80
|
+
"@types/node-fetch": "^2.5.3",
|
|
81
|
+
"@types/uuid": "^3.4.6"
|
|
82
|
+
}
|
|
83
|
+
}
|
package/pull_request_template.md
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
Thank you for your contribution to the repo.
|
|
2
|
-
Before submitting this PR, please make sure:
|
|
3
|
-
|
|
4
|
-
- [ ] Your code builds clean without any errors or warnings
|
|
5
|
-
- [ ] You are using approved terminology
|
|
6
|
-
- [ ] You have added unit tests
|
|
7
|
-
- [ ] You have updated documentation
|
|
8
|
-
- [ ] You have checked related services are updated
|
|
9
|
-
|
|
10
|
-
You may delete the sections as necessary.
|
|
11
|
-
|
|
12
|
-
### Context
|
|
13
|
-
___
|
|
14
|
-
|
|
15
|
-
Fill this up with some context that will be useful to the reviewer that is looking at your PR.
|
|
16
|
-
|
|
17
|
-
Example:
|
|
18
|
-
* Add references to a related previous PR.
|
|
19
|
-
* Link to an existing card on Click Up/Confluence.
|
|
20
|
-
* Link to an issue on Sentry.
|
|
21
|
-
|
|
22
|
-
### Changes
|
|
23
|
-
___
|
|
24
|
-
|
|
25
|
-
Fill this up with the changes that are included in this PR.
|
|
26
|
-
|
|
27
|
-
Example:
|
|
28
|
-
* Added tests.
|
|
29
|
-
* Refactored checkout flow.
|
|
30
|
-
|
|
31
|
-
### Test
|
|
32
|
-
___
|
|
33
|
-
|
|
34
|
-
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.
|
|
35
|
-
Please also list any relevant details for your test configuration.
|
|
36
|
-
|
|
37
|
-
- [ ] Test A
|
|
38
|
-
- [ ] Test B
|
|
39
|
-
|
|
40
|
-
### Shout-outs
|
|
41
|
-
___
|
|
1
|
+
Thank you for your contribution to the repo.
|
|
2
|
+
Before submitting this PR, please make sure:
|
|
3
|
+
|
|
4
|
+
- [ ] Your code builds clean without any errors or warnings
|
|
5
|
+
- [ ] You are using approved terminology
|
|
6
|
+
- [ ] You have added unit tests
|
|
7
|
+
- [ ] You have updated documentation
|
|
8
|
+
- [ ] You have checked related services are updated
|
|
9
|
+
|
|
10
|
+
You may delete the sections as necessary.
|
|
11
|
+
|
|
12
|
+
### Context
|
|
13
|
+
___
|
|
14
|
+
|
|
15
|
+
Fill this up with some context that will be useful to the reviewer that is looking at your PR.
|
|
16
|
+
|
|
17
|
+
Example:
|
|
18
|
+
* Add references to a related previous PR.
|
|
19
|
+
* Link to an existing card on Click Up/Confluence.
|
|
20
|
+
* Link to an issue on Sentry.
|
|
21
|
+
|
|
22
|
+
### Changes
|
|
23
|
+
___
|
|
24
|
+
|
|
25
|
+
Fill this up with the changes that are included in this PR.
|
|
26
|
+
|
|
27
|
+
Example:
|
|
28
|
+
* Added tests.
|
|
29
|
+
* Refactored checkout flow.
|
|
30
|
+
|
|
31
|
+
### Test
|
|
32
|
+
___
|
|
33
|
+
|
|
34
|
+
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.
|
|
35
|
+
Please also list any relevant details for your test configuration.
|
|
36
|
+
|
|
37
|
+
- [ ] Test A
|
|
38
|
+
- [ ] Test B
|
|
39
|
+
|
|
40
|
+
### Shout-outs
|
|
41
|
+
___
|
|
42
42
|
Fill this up with the people that have helped you out along the way to thank them! :tada
|
package/sonar-project.properties
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
sonar.projectKey=HandshakesByDC_SkyEye-SVC-Common-Utils
|
|
2
|
-
sonar.organization=handshakesbydc
|
|
3
|
-
|
|
4
|
-
# This is the name and version displayed in the SonarCloud UI.
|
|
5
|
-
#sonar.projectName=SkyEye-SVC-Announcement
|
|
6
|
-
#sonar.projectVersion=1.0
|
|
7
|
-
|
|
8
|
-
# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
|
|
9
|
-
#sonar.sources=.
|
|
10
|
-
|
|
11
|
-
# Encoding of the source code. Default is default system encoding
|
|
1
|
+
sonar.projectKey=HandshakesByDC_SkyEye-SVC-Common-Utils
|
|
2
|
+
sonar.organization=handshakesbydc
|
|
3
|
+
|
|
4
|
+
# This is the name and version displayed in the SonarCloud UI.
|
|
5
|
+
#sonar.projectName=SkyEye-SVC-Announcement
|
|
6
|
+
#sonar.projectVersion=1.0
|
|
7
|
+
|
|
8
|
+
# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
|
|
9
|
+
#sonar.sources=.
|
|
10
|
+
|
|
11
|
+
# Encoding of the source code. Default is default system encoding
|
|
12
12
|
#sonar.sourceEncoding=UTF-8
|
package/src/index.ts
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import SendGridClient, { ISgMessage, ISgCategoryStatistics, SgCategoryStatisticsItem, SgCategoryStatisticsMetricsItem } from './lib/sendGridClient';
|
|
2
|
-
|
|
3
|
-
export * from './utils/appConfig';
|
|
4
|
-
export * from './utils/appConst';
|
|
5
|
-
export * from './utils/commonUtils';
|
|
6
|
-
export * from './utils/authentication/auth';
|
|
7
|
-
export * from './utils/logger/logger';
|
|
8
|
-
export * from './utils/logger/morganLogger';
|
|
9
|
-
export * from './utils/middleware/handleError';
|
|
10
|
-
export * from './utils/middleware/isPublicUser';
|
|
11
|
-
export * from './utils/middleware/overwriteConst';
|
|
12
|
-
export * from './utils/middleware/startdbConnection';
|
|
13
|
-
export * from './utils/baseClass/baseController';
|
|
14
|
-
export * from './utils/baseClass/baseService';
|
|
15
|
-
export * from './interfaces/index';
|
|
16
|
-
export * from './lib/azure/azureKeyVault';
|
|
17
|
-
export * from './lib/azure/azureServiceBusClient';
|
|
18
|
-
export * from './lib/azure/azureStorageQueue';
|
|
19
|
-
export * from './lib/azure/azureServiceBusQueue';
|
|
20
|
-
export * from './lib/azure/azureTableStorage';
|
|
21
|
-
export * from './lib/azure/azureBlobStorage';
|
|
22
|
-
export * from './utils/documentation/swagger';
|
|
23
|
-
export * from './lib/httpClient';
|
|
24
|
-
export * from './utils/monitoring/apm';
|
|
25
|
-
export * from './models/baseControllerParameter';
|
|
26
|
-
export * from './models';
|
|
27
|
-
export * from './lib/redisClient';
|
|
28
|
-
export * from './interfaces/grpcServiceResponse';
|
|
29
|
-
export * from './interfaces/grpcListRequest';
|
|
30
|
-
export * from './utils/commonUtils/appConfigKeyRetriever';
|
|
31
|
-
export * from './utils/constant/httpCodes';
|
|
32
|
-
export { SendGridClient, ISgMessage, ISgCategoryStatistics, SgCategoryStatisticsItem, SgCategoryStatisticsMetricsItem };
|
|
1
|
+
import SendGridClient, { ISgMessage, ISgCategoryStatistics, SgCategoryStatisticsItem, SgCategoryStatisticsMetricsItem } from './lib/sendGridClient';
|
|
2
|
+
|
|
3
|
+
export * from './utils/appConfig';
|
|
4
|
+
export * from './utils/appConst';
|
|
5
|
+
export * from './utils/commonUtils';
|
|
6
|
+
export * from './utils/authentication/auth';
|
|
7
|
+
export * from './utils/logger/logger';
|
|
8
|
+
export * from './utils/logger/morganLogger';
|
|
9
|
+
export * from './utils/middleware/handleError';
|
|
10
|
+
export * from './utils/middleware/isPublicUser';
|
|
11
|
+
export * from './utils/middleware/overwriteConst';
|
|
12
|
+
export * from './utils/middleware/startdbConnection';
|
|
13
|
+
export * from './utils/baseClass/baseController';
|
|
14
|
+
export * from './utils/baseClass/baseService';
|
|
15
|
+
export * from './interfaces/index';
|
|
16
|
+
export * from './lib/azure/azureKeyVault';
|
|
17
|
+
export * from './lib/azure/azureServiceBusClient';
|
|
18
|
+
export * from './lib/azure/azureStorageQueue';
|
|
19
|
+
export * from './lib/azure/azureServiceBusQueue';
|
|
20
|
+
export * from './lib/azure/azureTableStorage';
|
|
21
|
+
export * from './lib/azure/azureBlobStorage';
|
|
22
|
+
export * from './utils/documentation/swagger';
|
|
23
|
+
export * from './lib/httpClient';
|
|
24
|
+
export * from './utils/monitoring/apm';
|
|
25
|
+
export * from './models/baseControllerParameter';
|
|
26
|
+
export * from './models';
|
|
27
|
+
export * from './lib/redisClient';
|
|
28
|
+
export * from './interfaces/grpcServiceResponse';
|
|
29
|
+
export * from './interfaces/grpcListRequest';
|
|
30
|
+
export * from './utils/commonUtils/appConfigKeyRetriever';
|
|
31
|
+
export * from './utils/constant/httpCodes';
|
|
32
|
+
export { SendGridClient, ISgMessage, ISgCategoryStatistics, SgCategoryStatisticsItem, SgCategoryStatisticsMetricsItem };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export interface ApiResponse {
|
|
2
|
-
isSuccess: boolean;
|
|
3
|
-
message?: string;
|
|
4
|
-
data?: any;
|
|
5
|
-
totalCount?: number;
|
|
6
|
-
aggregation?: any;
|
|
1
|
+
export interface ApiResponse {
|
|
2
|
+
isSuccess: boolean;
|
|
3
|
+
message?: string;
|
|
4
|
+
data?: any;
|
|
5
|
+
totalCount?: number;
|
|
6
|
+
aggregation?: any;
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export interface GrpcListRequest {
|
|
2
|
-
skip?: number;
|
|
3
|
-
select?: number;
|
|
4
|
-
orderBy?: string;
|
|
5
|
-
order?: string;
|
|
1
|
+
export interface GrpcListRequest {
|
|
2
|
+
skip?: number;
|
|
3
|
+
select?: number;
|
|
4
|
+
orderBy?: string;
|
|
5
|
+
order?: string;
|
|
6
6
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export interface GrpcServiceResponse {
|
|
2
|
-
isSuccess: boolean;
|
|
3
|
-
message?: string;
|
|
4
|
-
data?: any;
|
|
5
|
-
totalCount?: number;
|
|
6
|
-
error?: boolean;
|
|
7
|
-
aggregation?: boolean;
|
|
1
|
+
export interface GrpcServiceResponse {
|
|
2
|
+
isSuccess: boolean;
|
|
3
|
+
message?: string;
|
|
4
|
+
data?: any;
|
|
5
|
+
totalCount?: number;
|
|
6
|
+
error?: boolean;
|
|
7
|
+
aggregation?: boolean;
|
|
8
8
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export class HttpError extends Error {
|
|
2
|
-
statusCode: number;
|
|
3
|
-
customErrorMessage?: string;
|
|
4
|
-
|
|
5
|
-
constructor(message: string, statusCode: number) {
|
|
6
|
-
super(message);
|
|
7
|
-
this.statusCode = statusCode;
|
|
8
|
-
this.customErrorMessage = message;
|
|
9
|
-
|
|
10
|
-
Object.setPrototypeOf(this, HttpError.prototype);
|
|
11
|
-
}
|
|
1
|
+
export class HttpError extends Error {
|
|
2
|
+
statusCode: number;
|
|
3
|
+
customErrorMessage?: string;
|
|
4
|
+
|
|
5
|
+
constructor(message: string, statusCode: number) {
|
|
6
|
+
super(message);
|
|
7
|
+
this.statusCode = statusCode;
|
|
8
|
+
this.customErrorMessage = message;
|
|
9
|
+
|
|
10
|
+
Object.setPrototypeOf(this, HttpError.prototype);
|
|
11
|
+
}
|
|
12
12
|
}
|
package/src/interfaces/index.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { ApiResponse } from './apiResponse';
|
|
2
|
-
import { ServiceResponse } from './serviceResponse';
|
|
3
|
-
import { UserInfo } from './userInfo';
|
|
4
|
-
import { Pagination } from './pagination';
|
|
5
|
-
import { SubcriptionFeaturePermissionModel } from './subcriptionFeaturePermissionModel';
|
|
6
|
-
import { GrpcListRequest } from './grpcListRequest';
|
|
7
|
-
import { GrpcServiceResponse } from './grpcServiceResponse';
|
|
8
|
-
export {
|
|
9
|
-
ApiResponse,
|
|
10
|
-
ServiceResponse,
|
|
11
|
-
UserInfo,
|
|
12
|
-
Pagination,
|
|
13
|
-
SubcriptionFeaturePermissionModel,
|
|
14
|
-
GrpcListRequest,
|
|
15
|
-
GrpcServiceResponse
|
|
16
|
-
};
|
|
17
|
-
export * from './internalHttp/request';
|
|
1
|
+
import { ApiResponse } from './apiResponse';
|
|
2
|
+
import { ServiceResponse } from './serviceResponse';
|
|
3
|
+
import { UserInfo } from './userInfo';
|
|
4
|
+
import { Pagination } from './pagination';
|
|
5
|
+
import { SubcriptionFeaturePermissionModel } from './subcriptionFeaturePermissionModel';
|
|
6
|
+
import { GrpcListRequest } from './grpcListRequest';
|
|
7
|
+
import { GrpcServiceResponse } from './grpcServiceResponse';
|
|
8
|
+
export {
|
|
9
|
+
ApiResponse,
|
|
10
|
+
ServiceResponse,
|
|
11
|
+
UserInfo,
|
|
12
|
+
Pagination,
|
|
13
|
+
SubcriptionFeaturePermissionModel,
|
|
14
|
+
GrpcListRequest,
|
|
15
|
+
GrpcServiceResponse
|
|
16
|
+
};
|
|
17
|
+
export * from './internalHttp/request';
|
|
18
18
|
export * from './internalHttp/response';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { GrpcContentListReq } from "../../../models";
|
|
2
|
-
|
|
3
|
-
export interface IContentAggregateByMentionedCompanyWithFiltersFilter {
|
|
4
|
-
identifier: string;
|
|
5
|
-
filter: Partial<GrpcContentListReq>;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export interface IContentAggregateByMentionedCompanyWithFiltersRequest {
|
|
9
|
-
isOverallMentionCountRequired: boolean;
|
|
10
|
-
filters: Array<IContentAggregateByMentionedCompanyWithFiltersFilter>;
|
|
1
|
+
import { GrpcContentListReq } from "../../../models";
|
|
2
|
+
|
|
3
|
+
export interface IContentAggregateByMentionedCompanyWithFiltersFilter {
|
|
4
|
+
identifier: string;
|
|
5
|
+
filter: Partial<GrpcContentListReq>;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface IContentAggregateByMentionedCompanyWithFiltersRequest {
|
|
9
|
+
isOverallMentionCountRequired: boolean;
|
|
10
|
+
filters: Array<IContentAggregateByMentionedCompanyWithFiltersFilter>;
|
|
11
11
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { ServiceResponse } from "../../serviceResponse";
|
|
2
|
-
|
|
3
|
-
export interface IMentionedCompany {
|
|
4
|
-
companyGuid: string;
|
|
5
|
-
companyName: string;
|
|
6
|
-
mentionCount: number;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export interface IContentAggregateByMentionedCompanyWithFiltersResponseItem {
|
|
10
|
-
identifier: string;
|
|
11
|
-
totalMentionedCompany: number;
|
|
12
|
-
mentionedCompanies: IMentionedCompany[];
|
|
1
|
+
import { ServiceResponse } from "../../serviceResponse";
|
|
2
|
+
|
|
3
|
+
export interface IMentionedCompany {
|
|
4
|
+
companyGuid: string;
|
|
5
|
+
companyName: string;
|
|
6
|
+
mentionCount: number;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface IContentAggregateByMentionedCompanyWithFiltersResponseItem {
|
|
10
|
+
identifier: string;
|
|
11
|
+
totalMentionedCompany: number;
|
|
12
|
+
mentionedCompanies: IMentionedCompany[];
|
|
13
13
|
}
|