@candlerip/shared3 0.0.45 → 0.0.46

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.45",
3
+ "version": "0.0.46",
4
4
  "type": "module",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -1 +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")[];
1
+ export declare const BOOLEAN_ENVIRONMENT_VARIABLE_NAMES: ("API_GATEWAY_PORT" | "AUTHENTICATION_AUDIENCE" | "AUTHENTICATION_DOMAIN" | "CACHE_ENABLED" | "DATABASE_URL" | "FRONTEND_URL" | "RABBITMQ_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" | "DICTIONARY_SERVICE_PORT" | "RABBITMQ_PWD" | "RABBITMQ_USER")[];
@@ -1 +1 @@
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
+ export declare const NUMBER_ENVIRONMENT_VARIABLE_NAMES: ("API_GATEWAY_PORT" | "AUTHENTICATION_AUDIENCE" | "AUTHENTICATION_DOMAIN" | "CACHE_ENABLED" | "DATABASE_URL" | "FRONTEND_URL" | "RABBITMQ_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" | "DICTIONARY_SERVICE_PORT" | "RABBITMQ_PWD" | "RABBITMQ_USER")[];
@@ -1,9 +1,10 @@
1
+ import { isDevelopment as isDev, isProduction as isProd } from '../../../environment-mode/index.js';
1
2
  import { loadEnvFile } from '../../../env-file/index.js';
2
3
  export const EnvironmentVariablesWorker = (() => {
4
+ const ENVIRONMENT_MODE = process.env.ENVIRONMENT_MODE;
3
5
  let envs;
4
6
  const get = () => envs;
5
7
  const init = () => {
6
- const ENVIRONMENT_MODE = process.env.ENVIRONMENT_MODE;
7
8
  const resp = loadEnvFile(ENVIRONMENT_MODE);
8
9
  if ('customError' in resp) {
9
10
  return resp;
@@ -12,9 +13,16 @@ export const EnvironmentVariablesWorker = (() => {
12
13
  ...resp.data,
13
14
  ENVIRONMENT_MODE,
14
15
  };
16
+ return {
17
+ data: envs,
18
+ };
15
19
  };
20
+ const isDevelopment = () => isDev(ENVIRONMENT_MODE);
21
+ const isProduction = () => isProd(ENVIRONMENT_MODE);
16
22
  return {
17
23
  get,
18
24
  init,
25
+ isDevelopment,
26
+ isProduction,
19
27
  };
20
28
  })();
@@ -2,8 +2,14 @@ import { CustomError } from '../../../../error/index.js';
2
2
  export type IEnvironmentVariablesWorker = {
3
3
  get: Get;
4
4
  init: Init;
5
+ isDevelopment: IsDevelopment;
6
+ isProduction: IsProduction;
5
7
  };
6
8
  export type Get = <T = never>() => T;
7
- export type Init = () => undefined | {
9
+ export type Init = <T = never>() => {
10
+ data: T;
11
+ } | {
8
12
  customError: CustomError;
9
13
  };
14
+ export type IsDevelopment = () => boolean;
15
+ export type IsProduction = () => boolean;
@@ -1,6 +1,6 @@
1
1
  export declare const PROJECT_CONFIG: {
2
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"];
3
+ readonly environmentVariableNames: readonly ["API_GATEWAY_PORT", "AUTHENTICATION_AUDIENCE", "AUTHENTICATION_DOMAIN", "CACHE_ENABLED", "DATABASE_URL", "FRONTEND_URL", "RABBITMQ_URL", "REDIS_PWD", "REDIS_URL", "S3_IMAGES_BUCKET_NAME"];
4
4
  };
5
5
  readonly 'backend-project-config': {
6
6
  readonly environmentVariableNames: readonly ["API_GATEWAY_PORT", "CACHE_SERVICE_PORT", "LOGGER_SERVICE_PORT", "RABBITMQ_PORT", "RABBITMQ_MANAGEMENT_PORT", "REDIS_PORT"];
@@ -9,7 +9,7 @@ export declare const PROJECT_CONFIG: {
9
9
  readonly environmentVariableNames: readonly ["APP_NAME", "DOMAIN_NAME", "S3_IMAGES_BUCKET_NAME"];
10
10
  };
11
11
  readonly 'cache-service-project-config': {
12
- readonly environmentVariableNames: readonly ["CACHE_SERVICE_PORT", "DATABASE_URL", "RABBITMQ_URL", "REDIS_PWD", "REDIS_URL"];
12
+ readonly environmentVariableNames: readonly ["CACHE_ENABLED", "CACHE_SERVICE_PORT", "DATABASE_URL", "RABBITMQ_URL", "REDIS_PWD", "REDIS_URL"];
13
13
  };
14
14
  readonly 'dictionary-service-project-config': {
15
15
  readonly environmentVariableNames: readonly ["DICTIONARY_SERVICE_PORT"];
@@ -23,6 +23,9 @@ export declare const PROJECT_CONFIG: {
23
23
  readonly 'logger-service-project-config': {
24
24
  readonly environmentVariableNames: readonly ["DATABASE_URL", "LOGGER_SERVICE_PORT", "RABBITMQ_URL"];
25
25
  };
26
+ readonly 'nginx-project-config': {
27
+ readonly environmentVariableNames: readonly ["API_GATEWAY_PORT"];
28
+ };
26
29
  readonly 'rabbitmq-project-config': {
27
30
  readonly environmentVariableNames: readonly ["RABBITMQ_PORT", "RABBITMQ_MANAGEMENT_PORT", "RABBITMQ_PWD", "RABBITMQ_USER"];
28
31
  };
@@ -7,6 +7,7 @@ export const PROJECT_CONFIG = {
7
7
  'CACHE_ENABLED',
8
8
  'DATABASE_URL',
9
9
  'FRONTEND_URL',
10
+ 'RABBITMQ_URL',
10
11
  'REDIS_PWD',
11
12
  'REDIS_URL',
12
13
  'S3_IMAGES_BUCKET_NAME',
@@ -26,7 +27,7 @@ export const PROJECT_CONFIG = {
26
27
  environmentVariableNames: ['APP_NAME', 'DOMAIN_NAME', 'S3_IMAGES_BUCKET_NAME'],
27
28
  },
28
29
  'cache-service-project-config': {
29
- environmentVariableNames: ['CACHE_SERVICE_PORT', 'DATABASE_URL', 'RABBITMQ_URL', 'REDIS_PWD', 'REDIS_URL'],
30
+ environmentVariableNames: ['CACHE_ENABLED', 'CACHE_SERVICE_PORT', 'DATABASE_URL', 'RABBITMQ_URL', 'REDIS_PWD', 'REDIS_URL'],
30
31
  },
31
32
  'dictionary-service-project-config': {
32
33
  environmentVariableNames: ['DICTIONARY_SERVICE_PORT'],
@@ -40,6 +41,9 @@ export const PROJECT_CONFIG = {
40
41
  'logger-service-project-config': {
41
42
  environmentVariableNames: ['DATABASE_URL', 'LOGGER_SERVICE_PORT', 'RABBITMQ_URL'],
42
43
  },
44
+ 'nginx-project-config': {
45
+ environmentVariableNames: ['API_GATEWAY_PORT'],
46
+ },
43
47
  'rabbitmq-project-config': {
44
48
  environmentVariableNames: ['RABBITMQ_PORT', 'RABBITMQ_MANAGEMENT_PORT', 'RABBITMQ_PWD', 'RABBITMQ_USER'],
45
49
  },
@@ -1 +1 @@
1
- export declare const PROJECT_NAMES: readonly ["backend", "backend-init", "cache-service", "dictionary-service", "config", "images", "images-init", "logger-service", "rabbitmq", "redis", "shared", "shared-aws", "shared-backend"];
1
+ export declare const PROJECT_NAMES: readonly ["api-gateway", "backend", "backend-init", "cache-service", "dictionary-service", "config", "images", "images-init", "logger-service", "nginx", "rabbitmq", "redis", "shared", "shared-aws", "shared-backend"];
@@ -1,4 +1,5 @@
1
1
  export const PROJECT_NAMES = [
2
+ 'api-gateway',
2
3
  'backend',
3
4
  'backend-init',
4
5
  'cache-service',
@@ -7,6 +8,7 @@ export const PROJECT_NAMES = [
7
8
  'images',
8
9
  'images-init',
9
10
  'logger-service',
11
+ 'nginx',
10
12
  'rabbitmq',
11
13
  'redis',
12
14
  'shared',