@candlerip/shared3 0.0.34 → 0.0.36

Sign up to get free protection for your applications and to get access to all the features.
Files changed (20) hide show
  1. package/package.json +1 -1
  2. package/src/environment/env-file/utils/load-env-file/index.js +2 -2
  3. package/src/environment/environment-variable-name/configs/environment-variable-names/index.d.ts +2 -0
  4. package/src/environment/environment-variable-name/configs/environment-variable-names/index.js +2 -0
  5. package/src/environment/environment-variable-name/configs/index.d.ts +2 -0
  6. package/src/environment/environment-variable-name/configs/index.js +2 -0
  7. package/src/environment/environment-variable-name/configs/number-environment-variable-names/index.d.ts +1 -0
  8. package/src/environment/environment-variable-name/configs/number-environment-variable-names/index.js +2 -0
  9. package/src/environment/environment-variable-name/domains/index.d.ts +2 -2
  10. package/src/environment/environment-variable-name/index.d.ts +1 -0
  11. package/src/environment/environment-variable-name/index.js +1 -0
  12. package/src/environment/environment-variables/configs/index.d.ts +18 -2
  13. package/src/environment/environment-variables/configs/index.js +18 -2
  14. package/src/error/custom-error/utils/console-custom-error/index.js +3 -3
  15. package/src/project/project-config/configs/project-config/index.d.ts +1 -1
  16. package/src/project/project-config/configs/project-config/index.js +1 -1
  17. package/src/environment/environment-variables/configs/environment-variables/index.d.ts +0 -17
  18. package/src/environment/environment-variables/configs/environment-variables/index.js +0 -17
  19. package/src/environment/environment-variables/configs/number-environment-variables/index.d.ts +0 -1
  20. package/src/environment/environment-variables/configs/number-environment-variables/index.js +0 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@candlerip/shared3",
3
- "version": "0.0.34",
3
+ "version": "0.0.36",
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_VARIABLES } from '../../../environment-variables/configs/number-environment-variables/index.js';
2
+ import { NUMBER_ENVIRONMENT_VARIABLE_NAMES } from '../../../environment-variable-name/index.js';
3
3
  export const loadEnvFile = (environmentMode) => {
4
4
  const props = { environmentMode };
5
5
  const fileName = `.env.${environmentMode}`;
@@ -17,7 +17,7 @@ export const loadEnvFile = (environmentMode) => {
17
17
  },
18
18
  };
19
19
  }
20
- NUMBER_ENVIRONMENT_VARIABLES.forEach((it) => {
20
+ NUMBER_ENVIRONMENT_VARIABLE_NAMES.forEach((it) => {
21
21
  if (parsed[it]) {
22
22
  parsed[it] = parseInt(parsed[it]);
23
23
  }
@@ -0,0 +1,2 @@
1
+ import { ENVIRONMENT_VARIABLES } from '../../../environment-variables/configs/index.js';
2
+ export declare const ENVIRONMENT_VARIABLE_NAMES: Array<keyof typeof ENVIRONMENT_VARIABLES>;
@@ -0,0 +1,2 @@
1
+ import { ENVIRONMENT_VARIABLES } from '../../../environment-variables/configs/index.js';
2
+ export const ENVIRONMENT_VARIABLE_NAMES = Object.keys(ENVIRONMENT_VARIABLES);
@@ -0,0 +1,2 @@
1
+ export * from './environment-variable-names/index.js';
2
+ export * from './number-environment-variable-names/index.js';
@@ -0,0 +1,2 @@
1
+ export * from './environment-variable-names/index.js';
2
+ export * from './number-environment-variable-names/index.js';
@@ -0,0 +1 @@
1
+ export declare const NUMBER_ENVIRONMENT_VARIABLE_NAMES: ("APP_NAME" | "CACHE_SERVICE_PORT" | "DATABASE_URL" | "DICTIONARY_SERVICE_PORT" | "DOMAIN_NAME" | "FRONTEND_URL" | "LOGGER_SERVICE_PORT" | "RABBITMQ_MANAGEMENT_PORT" | "RABBITMQ_PORT" | "RABBITMQ_PWD" | "RABBITMQ_URL" | "RABBITMQ_USER" | "REDIS_PORT" | "REDIS_PWD" | "REDIS_URL" | "S3_IMAGES_BUCKET_NAME")[];
@@ -0,0 +1,2 @@
1
+ import { ENVIRONMENT_VARIABLES } from '../../../environment-variables/configs/index.js';
2
+ export const NUMBER_ENVIRONMENT_VARIABLE_NAMES = Object.keys(ENVIRONMENT_VARIABLES).filter((it) => ENVIRONMENT_VARIABLES[it] === 'number');
@@ -1,2 +1,2 @@
1
- import { ENVIRONMENT_VARIABLES } from '../../environment-variables/configs/index.js';
2
- export type EnvironmentVariableName = keyof typeof ENVIRONMENT_VARIABLES;
1
+ import { ENVIRONMENT_VARIABLE_NAMES } from '../configs/index.js';
2
+ export type EnvironmentVariableName = (typeof ENVIRONMENT_VARIABLE_NAMES)[number];
@@ -1 +1,2 @@
1
+ export * from './configs/index.js';
1
2
  export * from './domains/index.js';
@@ -1 +1,2 @@
1
+ export * from './configs/index.js';
1
2
  export * from './domains/index.js';
@@ -1,2 +1,18 @@
1
- export * from './environment-variables/index.js';
2
- export * from './number-environment-variables/index.js';
1
+ export declare const ENVIRONMENT_VARIABLES: {
2
+ readonly APP_NAME: "string";
3
+ readonly CACHE_SERVICE_PORT: "number";
4
+ readonly DATABASE_URL: "string";
5
+ readonly DICTIONARY_SERVICE_PORT: "number";
6
+ readonly DOMAIN_NAME: "string";
7
+ readonly FRONTEND_URL: "string";
8
+ readonly LOGGER_SERVICE_PORT: "number";
9
+ readonly RABBITMQ_MANAGEMENT_PORT: "number";
10
+ readonly RABBITMQ_PORT: "number";
11
+ readonly RABBITMQ_PWD: "string";
12
+ readonly RABBITMQ_URL: "string";
13
+ readonly RABBITMQ_USER: "string";
14
+ readonly REDIS_PORT: "number";
15
+ readonly REDIS_PWD: "string";
16
+ readonly REDIS_URL: "string";
17
+ readonly S3_IMAGES_BUCKET_NAME: "string";
18
+ };
@@ -1,2 +1,18 @@
1
- export * from './environment-variables/index.js';
2
- export * from './number-environment-variables/index.js';
1
+ export const ENVIRONMENT_VARIABLES = {
2
+ APP_NAME: 'string',
3
+ CACHE_SERVICE_PORT: 'number',
4
+ DATABASE_URL: 'string',
5
+ DICTIONARY_SERVICE_PORT: 'number',
6
+ DOMAIN_NAME: 'string',
7
+ FRONTEND_URL: 'string',
8
+ LOGGER_SERVICE_PORT: 'number',
9
+ RABBITMQ_MANAGEMENT_PORT: 'number',
10
+ RABBITMQ_PORT: 'number',
11
+ RABBITMQ_PWD: 'string',
12
+ RABBITMQ_URL: 'string',
13
+ RABBITMQ_USER: 'string',
14
+ REDIS_PORT: 'number',
15
+ REDIS_PWD: 'string',
16
+ REDIS_URL: 'string',
17
+ S3_IMAGES_BUCKET_NAME: 'string',
18
+ };
@@ -1,12 +1,12 @@
1
1
  export const consoleCustomError = (customError) => {
2
2
  console.error('***ERROR***:', customError.message);
3
3
  if (customError.err) {
4
- console.error('err:', JSON.stringify(customError.err));
4
+ console.error('ERR:', customError.err);
5
5
  }
6
6
  if (customError.info) {
7
- console.error('info:', customError.info);
7
+ console.error('INFO:', customError.info);
8
8
  }
9
9
  if (customError.props) {
10
- console.error('props:', customError.props);
10
+ console.error('PROPS:', customError.props);
11
11
  }
12
12
  };
@@ -18,7 +18,7 @@ export declare const PROJECT_CONFIG: {
18
18
  readonly environmentVariableNames: readonly ["FRONTEND_URL", "S3_IMAGES_BUCKET_NAME"];
19
19
  };
20
20
  readonly 'logger-service-project-config': {
21
- readonly environmentVariableNames: readonly ["DATABASE_URL", "LOGGER_SERVICE_PORT"];
21
+ readonly environmentVariableNames: readonly ["DATABASE_URL", "LOGGER_SERVICE_PORT", "RABBITMQ_URL"];
22
22
  };
23
23
  readonly 'rabbitmq-project-config': {
24
24
  readonly environmentVariableNames: readonly ["RABBITMQ_PORT", "RABBITMQ_MANAGEMENT_PORT", "RABBITMQ_PWD", "RABBITMQ_USER"];
@@ -18,7 +18,7 @@ export const PROJECT_CONFIG = {
18
18
  environmentVariableNames: ['FRONTEND_URL', 'S3_IMAGES_BUCKET_NAME'],
19
19
  },
20
20
  'logger-service-project-config': {
21
- environmentVariableNames: ['DATABASE_URL', 'LOGGER_SERVICE_PORT'],
21
+ environmentVariableNames: ['DATABASE_URL', 'LOGGER_SERVICE_PORT', 'RABBITMQ_URL'],
22
22
  },
23
23
  'rabbitmq-project-config': {
24
24
  environmentVariableNames: ['RABBITMQ_PORT', 'RABBITMQ_MANAGEMENT_PORT', 'RABBITMQ_PWD', 'RABBITMQ_USER'],
@@ -1,17 +0,0 @@
1
- export declare const ENVIRONMENT_VARIABLES: {
2
- readonly APP_NAME: "string";
3
- readonly CACHE_SERVICE_PORT: "number";
4
- readonly DATABASE_URL: "string";
5
- readonly DICTIONARY_SERVICE_PORT: "number";
6
- readonly DOMAIN_NAME: "string";
7
- readonly FRONTEND_URL: "string";
8
- readonly LOGGER_SERVICE_PORT: "number";
9
- readonly RABBITMQ_MANAGEMENT_PORT: "number";
10
- readonly RABBITMQ_PORT: "number";
11
- readonly RABBITMQ_PWD: "number";
12
- readonly RABBITMQ_USER: "number";
13
- readonly REDIS_PORT: "number";
14
- readonly REDIS_PWD: "string";
15
- readonly REDIS_URL: "string";
16
- readonly S3_IMAGES_BUCKET_NAME: "string";
17
- };
@@ -1,17 +0,0 @@
1
- export const ENVIRONMENT_VARIABLES = {
2
- APP_NAME: 'string',
3
- CACHE_SERVICE_PORT: 'number',
4
- DATABASE_URL: 'string',
5
- DICTIONARY_SERVICE_PORT: 'number',
6
- DOMAIN_NAME: 'string',
7
- FRONTEND_URL: 'string',
8
- LOGGER_SERVICE_PORT: 'number',
9
- RABBITMQ_MANAGEMENT_PORT: 'number',
10
- RABBITMQ_PORT: 'number',
11
- RABBITMQ_PWD: 'number',
12
- RABBITMQ_USER: 'number',
13
- REDIS_PORT: 'number',
14
- REDIS_PWD: 'string',
15
- REDIS_URL: 'string',
16
- S3_IMAGES_BUCKET_NAME: 'string',
17
- };
@@ -1 +0,0 @@
1
- export declare const NUMBER_ENVIRONMENT_VARIABLES: ("APP_NAME" | "CACHE_SERVICE_PORT" | "DATABASE_URL" | "DICTIONARY_SERVICE_PORT" | "DOMAIN_NAME" | "FRONTEND_URL" | "LOGGER_SERVICE_PORT" | "RABBITMQ_MANAGEMENT_PORT" | "RABBITMQ_PORT" | "RABBITMQ_PWD" | "RABBITMQ_USER" | "REDIS_PORT" | "REDIS_PWD" | "REDIS_URL" | "S3_IMAGES_BUCKET_NAME")[];
@@ -1,2 +0,0 @@
1
- import { ENVIRONMENT_VARIABLES } from '../environment-variables/index.js';
2
- export const NUMBER_ENVIRONMENT_VARIABLES = Object.keys(ENVIRONMENT_VARIABLES).filter((it) => ENVIRONMENT_VARIABLES[it] === 'number');