@candlerip/shared 0.0.42 → 0.0.44
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/package.json +1 -1
- package/src/devops/env-file/create-env-file/convert-environment-variable-name-to-ssm-parameter-name/index.js +1 -1
- package/src/devops/env-file/create-env-file/convert-environment-variable-name-to-ssm-parameter-name/types.d.ts +1 -1
- package/src/devops/env-file/create-env-file/validate-parameters/index.js +8 -4
- package/src/devops/env-file/create-env-file/validate-parameters/types.d.ts +1 -1
- package/src/environment/environment-variable-name/constants.d.ts +1 -1
- package/src/environment/environment-variable-name/constants.js +5 -0
- package/src/environment/environment-variables/domains.d.ts +5 -0
- package/src/service/service-environment-variable-names/constants.js +3 -1
- package/src/service/service-name/constants.d.ts +1 -1
- package/src/service/service-name/constants.js +1 -1
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@ import { MODE_INDEPENDENT_ENVIRONMENT_VARIABLE_NAMES } from '../../../../environ
|
|
|
2
2
|
export const convertEnvironmentVariableNameToSsmParameterName = (environmentVariableName, environmentMode) => {
|
|
3
3
|
let parameterName = environmentVariableName;
|
|
4
4
|
if (!MODE_INDEPENDENT_ENVIRONMENT_VARIABLE_NAMES.includes(environmentVariableName)) {
|
|
5
|
-
parameterName = `${parameterName}_${environmentMode
|
|
5
|
+
parameterName = `${parameterName}_${environmentMode?.toUpperCase()}`;
|
|
6
6
|
}
|
|
7
7
|
return parameterName.replace('AWS', 'AMAZONWEBSERVICES');
|
|
8
8
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { EnvironmentMode, EnvironmentVariableName } from '../../../../environment/index.js';
|
|
2
|
-
export type ConvertEnvironmentVariableNameToSsmParameterName = (environmentVariableName: EnvironmentVariableName, environmentMode
|
|
2
|
+
export type ConvertEnvironmentVariableNameToSsmParameterName = (environmentVariableName: EnvironmentVariableName, environmentMode?: EnvironmentMode) => string;
|
|
@@ -6,7 +6,7 @@ import { consoleError, ErrorWorker } from '../../../../error/index.js';
|
|
|
6
6
|
import { isEnvironmentMode, isEnvironmentVariableName } from '../../../../environment/index.js';
|
|
7
7
|
export const validateParameters = () => {
|
|
8
8
|
const argv = yargs(hideBin(process.argv)).parse();
|
|
9
|
-
const
|
|
9
|
+
const environmentModeArg = argv['environment-mode'];
|
|
10
10
|
const environmentVariableNameArg = argv['environment-variable-name'];
|
|
11
11
|
const serviceNameArg = argv['service-name'];
|
|
12
12
|
const fileName = argv['file-name'];
|
|
@@ -19,9 +19,13 @@ export const validateParameters = () => {
|
|
|
19
19
|
consoleError(composeError('Invalid or missing file-name parameter'));
|
|
20
20
|
process.exit(1);
|
|
21
21
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
let environmentMode;
|
|
23
|
+
if (environmentModeArg) {
|
|
24
|
+
if (!isEnvironmentMode(environmentModeArg)) {
|
|
25
|
+
consoleError(composeError('Invalid environment-mode parameter'));
|
|
26
|
+
process.exit(1);
|
|
27
|
+
}
|
|
28
|
+
environmentMode = environmentModeArg;
|
|
25
29
|
}
|
|
26
30
|
if (!environmentVariableNameArg && !serviceNameArg) {
|
|
27
31
|
consoleError(composeError('Missing environment-variable-name or service-name parameter'));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ServiceName } from '../../../../service/index.js';
|
|
2
2
|
import { EnvironmentMode, EnvironmentVariableName } from '../../../../environment/index.js';
|
|
3
3
|
export type ValidateParameters = () => {
|
|
4
|
-
environmentMode
|
|
4
|
+
environmentMode?: EnvironmentMode;
|
|
5
5
|
environmentVariableName?: EnvironmentVariableName;
|
|
6
6
|
fileName: string;
|
|
7
7
|
serviceName?: ServiceName;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const ENVIRONMENT_VARIABLE_NAMES: readonly ["APP_NAME", "APP_PORT", "AWS_REGION", "AWS_S3_IMAGES_BUCKET_NAME", "CACHE_SERVICE_PORT", "DATABASE_URL", "DOMAIN_NAME", "FRONTEND_URL", "LOGGER_SERVICE_PORT", "MOBILE_APP_URL", "NODE_ENV", "RABBITMQ_URL", "REDIS_PWD", "REDIS_URL", "REDIS_URL_APP", "SSL_PRIVATE_KEY"];
|
|
1
|
+
export declare const ENVIRONMENT_VARIABLE_NAMES: readonly ["APP_NAME", "APP_PORT", "AWS_REGION", "AWS_S3_IMAGES_BUCKET_NAME", "CACHE_SERVICE_PORT", "DATABASE_URL", "DOMAIN_NAME", "FRONTEND_URL", "LOGGER_SERVICE_PORT", "MOBILE_APP_URL", "NODE_ENV", "RABBITMQ_MANAGEMENT_PORT", "RABBITMQ_PORT", "RABBITMQ_PWD", "RABBITMQ_USER", "RABBITMQ_URL", "REDIS_PORT", "REDIS_PWD", "REDIS_URL", "REDIS_URL_APP", "SSL_PRIVATE_KEY"];
|
|
2
2
|
export declare const MODE_INDEPENDENT_ENVIRONMENT_VARIABLE_NAMES: readonly ["APP_NAME", "APP_PORT", "AWS_REGION", "CACHE_SERVICE_PORT", "DOMAIN_NAME", "LOGGER_SERVICE_PORT", "REDIS_PWD", "SSL_PRIVATE_KEY"];
|
|
@@ -10,7 +10,12 @@ export const ENVIRONMENT_VARIABLE_NAMES = [
|
|
|
10
10
|
'LOGGER_SERVICE_PORT',
|
|
11
11
|
'MOBILE_APP_URL',
|
|
12
12
|
'NODE_ENV',
|
|
13
|
+
'RABBITMQ_MANAGEMENT_PORT',
|
|
14
|
+
'RABBITMQ_PORT',
|
|
15
|
+
'RABBITMQ_PWD',
|
|
16
|
+
'RABBITMQ_USER',
|
|
13
17
|
'RABBITMQ_URL',
|
|
18
|
+
'REDIS_PORT',
|
|
14
19
|
'REDIS_PWD',
|
|
15
20
|
'REDIS_URL',
|
|
16
21
|
'REDIS_URL_APP',
|
|
@@ -11,7 +11,12 @@ export type EnvironmentVariables = {
|
|
|
11
11
|
LOGGER_SERVICE_PORT: number;
|
|
12
12
|
MOBILE_APP_URL: string;
|
|
13
13
|
NODE_ENV: EnvironmentMode;
|
|
14
|
+
RABBITMQ_MANAGEMENT_PORT: number;
|
|
15
|
+
RABBITMQ_PORT: number;
|
|
16
|
+
RABBITMQ_PWD: string;
|
|
17
|
+
RABBITMQ_USER: string;
|
|
14
18
|
RABBITMQ_URL: string;
|
|
19
|
+
REDIS_PORT: number;
|
|
15
20
|
REDIS_PWD: string;
|
|
16
21
|
REDIS_URL: string;
|
|
17
22
|
REDIS_URL_APP: string;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export const SERVICE_ENVIRONMENT_VARIABLE_NAMES = {
|
|
2
2
|
'cache-service': ['APP_NAME', 'MOBILE_APP_URL'],
|
|
3
|
-
nginx: ['APP_PORT'
|
|
3
|
+
nginx: ['APP_PORT'],
|
|
4
|
+
rabbitmq: ['RABBITMQ_MANAGEMENT_PORT', 'RABBITMQ_PORT', 'RABBITMQ_PWD', 'RABBITMQ_USER'],
|
|
5
|
+
redis: ['REDIS_PORT', 'REDIS_PWD'],
|
|
4
6
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SERVICE_NAMES: readonly ["cache-service", "nginx"];
|
|
1
|
+
export declare const SERVICE_NAMES: readonly ["cache-service", "nginx", "rabbitmq", "redis"];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SERVICE_NAMES = ['cache-service', 'nginx'];
|
|
1
|
+
export const SERVICE_NAMES = ['cache-service', 'nginx', 'rabbitmq', 'redis'];
|