@valentine-efagene/qshelter-common 2.0.155 → 2.0.156
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.
|
@@ -5,8 +5,8 @@ export interface InfrastructureConfig {
|
|
|
5
5
|
dbHost: string;
|
|
6
6
|
dbPort: number;
|
|
7
7
|
databaseSecretArn: string;
|
|
8
|
-
redisHost
|
|
9
|
-
redisPort
|
|
8
|
+
redisHost?: string;
|
|
9
|
+
redisPort?: number;
|
|
10
10
|
rolePoliciesTableName: string;
|
|
11
11
|
s3BucketName: string;
|
|
12
12
|
eventBridgeBusName: string;
|
|
@@ -110,6 +110,10 @@ export declare class ConfigService {
|
|
|
110
110
|
* Helper to extract parameter value from SSM response
|
|
111
111
|
*/
|
|
112
112
|
private getParamValue;
|
|
113
|
+
/**
|
|
114
|
+
* Helper to extract optional parameter value from SSM response
|
|
115
|
+
*/
|
|
116
|
+
private getOptionalParamValue;
|
|
113
117
|
/**
|
|
114
118
|
* Get value from cache if valid
|
|
115
119
|
*/
|
|
@@ -55,6 +55,8 @@ export class ConfigService {
|
|
|
55
55
|
}
|
|
56
56
|
nextToken = response.NextToken;
|
|
57
57
|
} while (nextToken);
|
|
58
|
+
const redisHost = this.getOptionalParamValue(params, `${pathPrefix}redis-host`);
|
|
59
|
+
const redisPortStr = this.getOptionalParamValue(params, `${pathPrefix}redis-port`);
|
|
58
60
|
const config = {
|
|
59
61
|
vpcId: this.getParamValue(params, `${pathPrefix}vpc-id`),
|
|
60
62
|
dbSecurityGroupId: this.getParamValue(params, `${pathPrefix}db-security-group-id`),
|
|
@@ -62,8 +64,8 @@ export class ConfigService {
|
|
|
62
64
|
dbHost: this.getParamValue(params, `${pathPrefix}db-host`),
|
|
63
65
|
dbPort: parseInt(this.getParamValue(params, `${pathPrefix}db-port`), 10),
|
|
64
66
|
databaseSecretArn: this.getParamValue(params, `${pathPrefix}database-secret-arn`),
|
|
65
|
-
redisHost:
|
|
66
|
-
redisPort: parseInt(
|
|
67
|
+
redisHost: redisHost || undefined,
|
|
68
|
+
redisPort: redisPortStr ? parseInt(redisPortStr, 10) : undefined,
|
|
67
69
|
rolePoliciesTableName: this.getParamValue(params, `${pathPrefix}role-policies-table-name`),
|
|
68
70
|
s3BucketName: this.getParamValue(params, `${pathPrefix}s3-bucket-name`),
|
|
69
71
|
eventBridgeBusName: this.getParamValue(params, `${pathPrefix}eventbridge-bus-name`),
|
|
@@ -252,6 +254,13 @@ export class ConfigService {
|
|
|
252
254
|
}
|
|
253
255
|
return param.Value || '';
|
|
254
256
|
}
|
|
257
|
+
/**
|
|
258
|
+
* Helper to extract optional parameter value from SSM response
|
|
259
|
+
*/
|
|
260
|
+
getOptionalParamValue(params, name) {
|
|
261
|
+
const param = params.find(p => p.Name === name);
|
|
262
|
+
return param?.Value || null;
|
|
263
|
+
}
|
|
255
264
|
/**
|
|
256
265
|
* Get value from cache if valid
|
|
257
266
|
*/
|
package/package.json
CHANGED