@candlerip/shared3 0.0.43 → 0.0.44

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@candlerip/shared3",
3
- "version": "0.0.43",
3
+ "version": "0.0.44",
4
4
  "type": "module",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -1,5 +1,5 @@
1
1
  import * as dotenv from 'dotenv';
2
- import { NUMBER_ENVIRONMENT_VARIABLE_NAMES } from '../../../environment-variable-name/index.js';
2
+ import { BOOLEAN_ENVIRONMENT_VARIABLE_NAMES, NUMBER_ENVIRONMENT_VARIABLE_NAMES } from '../../../environment-variable-name/index.js';
3
3
  import { customErrorWorker } from '../../../../error/index.js';
4
4
  export const loadEnvFile = (environmentMode) => {
5
5
  const { composeCustomError } = customErrorWorker({ environmentMode });
@@ -15,6 +15,11 @@ export const loadEnvFile = (environmentMode) => {
15
15
  parsed[it] = parseInt(parsed[it]);
16
16
  }
17
17
  });
18
+ BOOLEAN_ENVIRONMENT_VARIABLE_NAMES.forEach((it) => {
19
+ if (parsed[it]) {
20
+ parsed[it] = Boolean(parsed[it] === 'true');
21
+ }
22
+ });
18
23
  return {
19
24
  data: parsed,
20
25
  };
@@ -0,0 +1 @@
1
+ export declare const BOOLEAN_ENVIRONMENT_VARIABLE_NAMES: ("API_GATEWAY_PORT" | "AUTHENTICATION_AUDIENCE" | "AUTHENTICATION_DOMAIN" | "CACHE_ENABLED" | "DATABASE_URL" | "FRONTEND_URL" | "REDIS_PWD" | "REDIS_URL" | "S3_IMAGES_BUCKET_NAME" | "CACHE_SERVICE_PORT" | "LOGGER_SERVICE_PORT" | "RABBITMQ_PORT" | "RABBITMQ_MANAGEMENT_PORT" | "REDIS_PORT" | "APP_NAME" | "DOMAIN_NAME" | "RABBITMQ_URL" | "DICTIONARY_SERVICE_PORT" | "RABBITMQ_PWD" | "RABBITMQ_USER")[];
@@ -0,0 +1,2 @@
1
+ import { ENVIRONMENT_VARIABLES } from '../../../environment-variables/configs/index.js';
2
+ export const BOOLEAN_ENVIRONMENT_VARIABLE_NAMES = Object.keys(ENVIRONMENT_VARIABLES).filter((it) => ENVIRONMENT_VARIABLES[it] === 'boolean');
@@ -1,2 +1,3 @@
1
+ export * from './boolean-environment-variable-names/index.js';
1
2
  export * from './environment-variable-names/index.js';
2
3
  export * from './number-environment-variable-names/index.js';
@@ -1,2 +1,3 @@
1
+ export * from './boolean-environment-variable-names/index.js';
1
2
  export * from './environment-variable-names/index.js';
2
3
  export * from './number-environment-variable-names/index.js';
@@ -1 +1 @@
1
- export declare const NUMBER_ENVIRONMENT_VARIABLE_NAMES: ("CACHE_SERVICE_PORT" | "LOGGER_SERVICE_PORT" | "RABBITMQ_PORT" | "RABBITMQ_MANAGEMENT_PORT" | "REDIS_PORT" | "APP_NAME" | "DOMAIN_NAME" | "S3_IMAGES_BUCKET_NAME" | "DATABASE_URL" | "RABBITMQ_URL" | "REDIS_PWD" | "REDIS_URL" | "DICTIONARY_SERVICE_PORT" | "FRONTEND_URL" | "RABBITMQ_PWD" | "RABBITMQ_USER")[];
1
+ export declare const NUMBER_ENVIRONMENT_VARIABLE_NAMES: ("API_GATEWAY_PORT" | "AUTHENTICATION_AUDIENCE" | "AUTHENTICATION_DOMAIN" | "CACHE_ENABLED" | "DATABASE_URL" | "FRONTEND_URL" | "REDIS_PWD" | "REDIS_URL" | "S3_IMAGES_BUCKET_NAME" | "CACHE_SERVICE_PORT" | "LOGGER_SERVICE_PORT" | "RABBITMQ_PORT" | "RABBITMQ_MANAGEMENT_PORT" | "REDIS_PORT" | "APP_NAME" | "DOMAIN_NAME" | "RABBITMQ_URL" | "DICTIONARY_SERVICE_PORT" | "RABBITMQ_PWD" | "RABBITMQ_USER")[];
@@ -1,5 +1,9 @@
1
1
  export declare const ENVIRONMENT_VARIABLES: {
2
+ readonly API_GATEWAY_PORT: "number";
2
3
  readonly APP_NAME: "string";
4
+ readonly AUTHENTICATION_AUDIENCE: "string";
5
+ readonly AUTHENTICATION_DOMAIN: "string";
6
+ readonly CACHE_ENABLED: "boolean";
3
7
  readonly CACHE_SERVICE_PORT: "number";
4
8
  readonly DATABASE_URL: "string";
5
9
  readonly DICTIONARY_SERVICE_PORT: "number";
@@ -1,5 +1,9 @@
1
1
  export const ENVIRONMENT_VARIABLES = {
2
+ API_GATEWAY_PORT: 'number',
2
3
  APP_NAME: 'string',
4
+ AUTHENTICATION_AUDIENCE: 'string',
5
+ AUTHENTICATION_DOMAIN: 'string',
6
+ CACHE_ENABLED: 'boolean',
3
7
  CACHE_SERVICE_PORT: 'number',
4
8
  DATABASE_URL: 'string',
5
9
  DICTIONARY_SERVICE_PORT: 'number',
@@ -1,4 +1,7 @@
1
1
  export declare const PROJECT_CONFIG: {
2
+ readonly 'api-gateway-project-config': {
3
+ readonly environmentVariableNames: readonly ["API_GATEWAY_PORT", "AUTHENTICATION_AUDIENCE", "AUTHENTICATION_DOMAIN", "CACHE_ENABLED", "DATABASE_URL", "FRONTEND_URL", "REDIS_PWD", "REDIS_URL", "S3_IMAGES_BUCKET_NAME"];
4
+ };
2
5
  readonly 'backend-project-config': {
3
6
  readonly environmentVariableNames: readonly ["CACHE_SERVICE_PORT", "LOGGER_SERVICE_PORT", "RABBITMQ_PORT", "RABBITMQ_MANAGEMENT_PORT", "REDIS_PORT"];
4
7
  };
@@ -1,4 +1,17 @@
1
1
  export const PROJECT_CONFIG = {
2
+ 'api-gateway-project-config': {
3
+ environmentVariableNames: [
4
+ 'API_GATEWAY_PORT',
5
+ 'AUTHENTICATION_AUDIENCE',
6
+ 'AUTHENTICATION_DOMAIN',
7
+ 'CACHE_ENABLED',
8
+ 'DATABASE_URL',
9
+ 'FRONTEND_URL',
10
+ 'REDIS_PWD',
11
+ 'REDIS_URL',
12
+ 'S3_IMAGES_BUCKET_NAME',
13
+ ],
14
+ },
2
15
  'backend-project-config': {
3
16
  environmentVariableNames: ['CACHE_SERVICE_PORT', 'LOGGER_SERVICE_PORT', 'RABBITMQ_PORT', 'RABBITMQ_MANAGEMENT_PORT', 'REDIS_PORT'],
4
17
  },