skyeye-svc-common-utils 1.0.73 → 1.0.74

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.
@@ -4,9 +4,9 @@ export declare class AppConfigKeyRetriever {
4
4
  private static internalJwtSecret;
5
5
  private static sendgridClientSecret;
6
6
  private static redisConnection;
7
- static getSwaggerAdminRoleApiKey(): Promise<string>;
8
- static getPublicJwtSecret(): Promise<string>;
9
- static getInternalJwtSecret(): Promise<string>;
10
- static getSendgridClientSecret(): Promise<string>;
11
- static getRedisConnection(): Promise<string>;
7
+ static getSwaggerAdminRoleApiKey(refresh?: boolean): Promise<string>;
8
+ static getPublicJwtSecret(refresh?: boolean): Promise<string>;
9
+ static getInternalJwtSecret(refresh?: boolean): Promise<string>;
10
+ static getSendgridClientSecret(refresh?: boolean): Promise<string>;
11
+ static getRedisConnection(refresh?: boolean): Promise<string>;
12
12
  }
@@ -13,37 +13,37 @@ exports.AppConfigKeyRetriever = void 0;
13
13
  const appConfig_1 = require("../appConfig");
14
14
  const azureKeyVault_1 = require("../../lib/azure/azureKeyVault");
15
15
  class AppConfigKeyRetriever {
16
- static getSwaggerAdminRoleApiKey() {
16
+ static getSwaggerAdminRoleApiKey(refresh) {
17
17
  return __awaiter(this, void 0, void 0, function* () {
18
- if (!AppConfigKeyRetriever.swaggerAdminRoleApiKey)
18
+ if (!!refresh || !AppConfigKeyRetriever.swaggerAdminRoleApiKey)
19
19
  AppConfigKeyRetriever.swaggerAdminRoleApiKey = yield (0, azureKeyVault_1.getKey)(appConfig_1.commonAppConfig.SwaggerAdminRoleApiKey);
20
20
  return AppConfigKeyRetriever.swaggerAdminRoleApiKey;
21
21
  });
22
22
  }
23
- static getPublicJwtSecret() {
23
+ static getPublicJwtSecret(refresh) {
24
24
  return __awaiter(this, void 0, void 0, function* () {
25
- if (!AppConfigKeyRetriever.publicJwtSecret)
25
+ if (!!refresh || !AppConfigKeyRetriever.publicJwtSecret)
26
26
  AppConfigKeyRetriever.publicJwtSecret = yield (0, azureKeyVault_1.getKey)(appConfig_1.commonAppConfig.PublicJwtSecret);
27
27
  return AppConfigKeyRetriever.publicJwtSecret;
28
28
  });
29
29
  }
30
- static getInternalJwtSecret() {
30
+ static getInternalJwtSecret(refresh) {
31
31
  return __awaiter(this, void 0, void 0, function* () {
32
- if (!AppConfigKeyRetriever.internalJwtSecret)
32
+ if (!!refresh || !AppConfigKeyRetriever.internalJwtSecret)
33
33
  AppConfigKeyRetriever.internalJwtSecret = yield (0, azureKeyVault_1.getKey)(appConfig_1.commonAppConfig.InternalJwtSecret);
34
34
  return AppConfigKeyRetriever.internalJwtSecret;
35
35
  });
36
36
  }
37
- static getSendgridClientSecret() {
37
+ static getSendgridClientSecret(refresh) {
38
38
  return __awaiter(this, void 0, void 0, function* () {
39
- if (!AppConfigKeyRetriever.sendgridClientSecret)
39
+ if (!!refresh || !AppConfigKeyRetriever.sendgridClientSecret)
40
40
  AppConfigKeyRetriever.sendgridClientSecret = yield (0, azureKeyVault_1.getKey)(appConfig_1.commonAppConfig.SendgridClientSecretKey);
41
41
  return AppConfigKeyRetriever.sendgridClientSecret;
42
42
  });
43
43
  }
44
- static getRedisConnection() {
44
+ static getRedisConnection(refresh) {
45
45
  return __awaiter(this, void 0, void 0, function* () {
46
- if (!AppConfigKeyRetriever.redisConnection)
46
+ if (!!refresh || !AppConfigKeyRetriever.redisConnection)
47
47
  AppConfigKeyRetriever.redisConnection = yield (0, azureKeyVault_1.getKey)(appConfig_1.commonAppConfig.RedisConnectionConfigKey);
48
48
  return AppConfigKeyRetriever.redisConnection;
49
49
  });
@@ -1 +1 @@
1
- {"version":3,"file":"appConfigKeyRetriever.js","sourceRoot":"","sources":["../../../src/utils/commonUtils/appConfigKeyRetriever.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAA+C;AAC/C,iEAAuD;AAEvD,MAAa,qBAAqB;IAOvB,MAAM,CAAO,yBAAyB;;YACzC,IAAI,CAAC,qBAAqB,C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YACnG,OAAO,qBAAqB,CAAC,eAAe,CAAC;QACjD,CAAC;KAAA;CACJ;AApCD,sDAoCC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skyeye-svc-common-utils",
3
- "version": "1.0.73",
3
+ "version": "1.0.74",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -56,7 +56,7 @@
56
56
  "node-fetch": "^2.6.0",
57
57
  "nyc": "^15.1.0",
58
58
  "rotating-file-stream": "^1.4.6",
59
- "skyeye-common-const": "1.0.45",
59
+ "skyeye-common-const": "1.0.46",
60
60
  "swagger-jsdoc": "^3.5.0",
61
61
  "swagger-ui-express": "^4.1.3",
62
62
  "ts-node": "^9.0.0",
@@ -8,32 +8,32 @@ export class AppConfigKeyRetriever {
8
8
  private static sendgridClientSecret: string;
9
9
  private static redisConnection: string;
10
10
 
11
- public static async getSwaggerAdminRoleApiKey(): Promise<string> {
12
- if (!AppConfigKeyRetriever.swaggerAdminRoleApiKey)
11
+ public static async getSwaggerAdminRoleApiKey(refresh?: boolean): Promise<string> {
12
+ if (!!refresh || !AppConfigKeyRetriever.swaggerAdminRoleApiKey)
13
13
  AppConfigKeyRetriever.swaggerAdminRoleApiKey = await getKey(commonAppConfig.SwaggerAdminRoleApiKey);
14
14
  return AppConfigKeyRetriever.swaggerAdminRoleApiKey;
15
15
  }
16
16
 
17
- public static async getPublicJwtSecret(): Promise<string> {
18
- if (!AppConfigKeyRetriever.publicJwtSecret)
17
+ public static async getPublicJwtSecret(refresh?: boolean): Promise<string> {
18
+ if (!!refresh || !AppConfigKeyRetriever.publicJwtSecret)
19
19
  AppConfigKeyRetriever.publicJwtSecret = await getKey(commonAppConfig.PublicJwtSecret);
20
20
  return AppConfigKeyRetriever.publicJwtSecret;
21
21
  }
22
22
 
23
- public static async getInternalJwtSecret(): Promise<string> {
24
- if (!AppConfigKeyRetriever.internalJwtSecret)
23
+ public static async getInternalJwtSecret(refresh?: boolean): Promise<string> {
24
+ if (!!refresh || !AppConfigKeyRetriever.internalJwtSecret)
25
25
  AppConfigKeyRetriever.internalJwtSecret = await getKey(commonAppConfig.InternalJwtSecret);
26
26
  return AppConfigKeyRetriever.internalJwtSecret;
27
27
  }
28
28
 
29
- public static async getSendgridClientSecret(): Promise<string> {
30
- if (!AppConfigKeyRetriever.sendgridClientSecret)
29
+ public static async getSendgridClientSecret(refresh?: boolean): Promise<string> {
30
+ if (!!refresh || !AppConfigKeyRetriever.sendgridClientSecret)
31
31
  AppConfigKeyRetriever.sendgridClientSecret = await getKey(commonAppConfig.SendgridClientSecretKey);
32
32
  return AppConfigKeyRetriever.sendgridClientSecret;
33
33
  }
34
34
 
35
- public static async getRedisConnection(): Promise<string> {
36
- if (!AppConfigKeyRetriever.redisConnection)
35
+ public static async getRedisConnection(refresh?: boolean): Promise<string> {
36
+ if (!!refresh || !AppConfigKeyRetriever.redisConnection)
37
37
  AppConfigKeyRetriever.redisConnection = await getKey(commonAppConfig.RedisConnectionConfigKey);
38
38
  return AppConfigKeyRetriever.redisConnection;
39
39
  }