@candlerip/shared3 0.0.51 → 0.0.53

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. package/package.json +1 -1
  2. package/src/environment/env-file/utils/load-env-file/index.d.ts +8 -2
  3. package/src/environment/env-file/utils/load-env-file/index.js +11 -10
  4. package/src/environment/environment-variable/configs/index.d.ts +23 -0
  5. package/src/environment/environment-variable/configs/index.js +23 -0
  6. package/src/{project/project-config → environment/environment-variable}/index.d.ts +0 -1
  7. package/src/{project/project-config → environment/environment-variable}/index.js +0 -1
  8. package/src/environment/environment-variable-name/configs/index.d.ts +2 -3
  9. package/src/environment/environment-variable-name/configs/index.js +2 -3
  10. package/src/environment/environment-variables/configs/index.d.ts +11 -20
  11. package/src/environment/environment-variables/configs/index.js +32 -20
  12. package/src/environment/environment-variables/domains/index.d.ts +12 -3
  13. package/src/environment/environment-variables/index.d.ts +1 -0
  14. package/src/environment/environment-variables/index.js +1 -0
  15. package/src/environment/environment-variables/workers/environment-variables-worker/index.js +5 -11
  16. package/src/environment/environment-variables/workers/environment-variables-worker/types.d.ts +4 -3
  17. package/src/project/index.d.ts +0 -1
  18. package/src/project/index.js +0 -1
  19. package/src/type/index.d.ts +0 -1
  20. package/src/type/index.js +0 -1
  21. package/src/environment/env-file/utils/load-env-file/types.d.ts +0 -7
  22. package/src/environment/env-file/utils/load-env-file/types.js +0 -1
  23. package/src/environment/environment-variable-name/configs/boolean-environment-variable-names/index.d.ts +0 -1
  24. package/src/environment/environment-variable-name/configs/boolean-environment-variable-names/index.js +0 -2
  25. package/src/environment/environment-variable-name/configs/environment-variable-names/index.d.ts +0 -2
  26. package/src/environment/environment-variable-name/configs/environment-variable-names/index.js +0 -2
  27. package/src/environment/environment-variable-name/configs/number-environment-variable-names/index.d.ts +0 -1
  28. package/src/environment/environment-variable-name/configs/number-environment-variable-names/index.js +0 -2
  29. package/src/project/project-config/configs/index.d.ts +0 -2
  30. package/src/project/project-config/configs/index.js +0 -2
  31. package/src/project/project-config/configs/project-config/index.d.ts +0 -35
  32. package/src/project/project-config/configs/project-config/index.js +0 -54
  33. package/src/project/project-config/configs/project-config-names/index.d.ts +0 -2
  34. package/src/project/project-config/configs/project-config-names/index.js +0 -2
  35. package/src/project/project-config/domains/index.d.ts +0 -2
  36. package/src/project/project-config/domains/index.js +0 -2
  37. package/src/project/project-config/domains/project-config/index.d.ts +0 -6
  38. package/src/project/project-config/domains/project-config/index.js +0 -1
  39. package/src/project/project-config/domains/project-config-name/index.d.ts +0 -2
  40. package/src/project/project-config/domains/project-config-name/index.js +0 -1
  41. package/src/type/type-map/domains/index.d.ts +0 -5
  42. package/src/type/type-map/domains/index.js +0 -1
  43. package/src/type/type-map/index.d.ts +0 -1
  44. package/src/type/type-map/index.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@candlerip/shared3",
3
- "version": "0.0.51",
3
+ "version": "0.0.53",
4
4
  "type": "module",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -1,2 +1,8 @@
1
- import { LoadEnvFile } from './types.js';
2
- export declare const loadEnvFile: LoadEnvFile;
1
+ import { CustomError } from '../../../../error/index.js';
2
+ import { EnvironmentMode } from '../../../environment-mode/index.js';
3
+ import { EnvironmentVariables } from '../../../environment-variables/index.js';
4
+ export declare const loadEnvFile: <K extends keyof EnvironmentVariables = never, D = EnvironmentVariables[K]>(environmentMode: EnvironmentMode) => {
5
+ data: D;
6
+ } | {
7
+ customError: CustomError;
8
+ };
@@ -1,26 +1,27 @@
1
1
  import * as dotenv from 'dotenv';
2
- import { BOOLEAN_ENVIRONMENT_VARIABLE_NAMES, NUMBER_ENVIRONMENT_VARIABLE_NAMES } from '../../../environment-variable-name/index.js';
3
2
  import { customErrorWorker } from '../../../../error/index.js';
3
+ import { ENVIRONMENT_VARIABLE } from '../../../environment-variable/index.js';
4
4
  export const loadEnvFile = (environmentMode) => {
5
5
  const { composeCustomError } = customErrorWorker({ environmentMode });
6
6
  const fileName = `.env.${environmentMode}`;
7
7
  const envFile = dotenv.config({ path: `./${fileName}` });
8
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
9
8
  const { error: err, parsed } = envFile;
10
9
  if (err || !parsed) {
11
10
  return composeCustomError(`Error loading ${fileName}`, { err });
12
11
  }
13
- NUMBER_ENVIRONMENT_VARIABLE_NAMES.forEach((it) => {
14
- if (parsed[it]) {
15
- parsed[it] = parseInt(parsed[it]);
12
+ const data = {};
13
+ Object.keys(parsed).forEach((key) => {
14
+ if (ENVIRONMENT_VARIABLE[key] === 'boolean') {
15
+ data[key] = Boolean(parsed[key] === 'true');
16
+ return;
16
17
  }
17
- });
18
- BOOLEAN_ENVIRONMENT_VARIABLE_NAMES.forEach((it) => {
19
- if (parsed[it]) {
20
- parsed[it] = Boolean(parsed[it] === 'true');
18
+ if (ENVIRONMENT_VARIABLE[key] === 'number') {
19
+ data[key] = parseInt(parsed[key]);
20
+ return;
21
21
  }
22
+ data[key] = parsed[key];
22
23
  });
23
24
  return {
24
- data: parsed,
25
+ data: data,
25
26
  };
26
27
  };
@@ -0,0 +1,23 @@
1
+ export declare const ENVIRONMENT_VARIABLE: {
2
+ readonly API_GATEWAY_PORT: "number";
3
+ readonly APP_NAME: "string";
4
+ readonly AUTHENTICATION_AUDIENCE: "string";
5
+ readonly AUTHENTICATION_DOMAIN: "string";
6
+ readonly CACHE_ENABLED: "boolean";
7
+ readonly CACHE_SERVICE_PORT: "number";
8
+ readonly DATABASE_URL: "string";
9
+ readonly DOMAIN_NAME: "string";
10
+ readonly FRONTEND_PORT: "number";
11
+ readonly FRONTEND_URL: "string";
12
+ readonly LOGGER_SERVICE_PORT: "number";
13
+ readonly NODE_ENV: "EnvironmentMode";
14
+ readonly RABBITMQ_MANAGEMENT_PORT: "number";
15
+ readonly RABBITMQ_PORT: "number";
16
+ readonly RABBITMQ_PWD: "string";
17
+ readonly RABBITMQ_URL: "string";
18
+ readonly RABBITMQ_USER: "string";
19
+ readonly REDIS_PORT: "number";
20
+ readonly REDIS_PWD: "string";
21
+ readonly REDIS_URL: "string";
22
+ readonly S3_IMAGES_BUCKET_NAME: "string";
23
+ };
@@ -0,0 +1,23 @@
1
+ export const ENVIRONMENT_VARIABLE = {
2
+ API_GATEWAY_PORT: 'number',
3
+ APP_NAME: 'string',
4
+ AUTHENTICATION_AUDIENCE: 'string',
5
+ AUTHENTICATION_DOMAIN: 'string',
6
+ CACHE_ENABLED: 'boolean',
7
+ CACHE_SERVICE_PORT: 'number',
8
+ DATABASE_URL: 'string',
9
+ DOMAIN_NAME: 'string',
10
+ FRONTEND_PORT: 'number',
11
+ FRONTEND_URL: 'string',
12
+ LOGGER_SERVICE_PORT: 'number',
13
+ NODE_ENV: 'EnvironmentMode',
14
+ RABBITMQ_MANAGEMENT_PORT: 'number',
15
+ RABBITMQ_PORT: 'number',
16
+ RABBITMQ_PWD: 'string',
17
+ RABBITMQ_URL: 'string',
18
+ RABBITMQ_USER: 'string',
19
+ REDIS_PORT: 'number',
20
+ REDIS_PWD: 'string',
21
+ REDIS_URL: 'string',
22
+ S3_IMAGES_BUCKET_NAME: 'string',
23
+ };
@@ -1,2 +1 @@
1
1
  export * from './configs/index.js';
2
- export * from './domains/index.js';
@@ -1,2 +1 @@
1
1
  export * from './configs/index.js';
2
- export * from './domains/index.js';
@@ -1,3 +1,2 @@
1
- export * from './boolean-environment-variable-names/index.js';
2
- export * from './environment-variable-names/index.js';
3
- export * from './number-environment-variable-names/index.js';
1
+ import { ENVIRONMENT_VARIABLE } from '../../environment-variable/configs/index.js';
2
+ export declare const ENVIRONMENT_VARIABLE_NAMES: Array<keyof typeof ENVIRONMENT_VARIABLE>;
@@ -1,3 +1,2 @@
1
- export * from './boolean-environment-variable-names/index.js';
2
- export * from './environment-variable-names/index.js';
3
- export * from './number-environment-variable-names/index.js';
1
+ import { ENVIRONMENT_VARIABLE } from '../../environment-variable/configs/index.js';
2
+ export const ENVIRONMENT_VARIABLE_NAMES = Object.keys(ENVIRONMENT_VARIABLE);
@@ -1,22 +1,13 @@
1
1
  export declare const ENVIRONMENT_VARIABLES: {
2
- readonly API_GATEWAY_PORT: "number";
3
- readonly APP_NAME: "string";
4
- readonly AUTHENTICATION_AUDIENCE: "string";
5
- readonly AUTHENTICATION_DOMAIN: "string";
6
- readonly CACHE_ENABLED: "boolean";
7
- readonly CACHE_SERVICE_PORT: "number";
8
- readonly DATABASE_URL: "string";
9
- readonly DOMAIN_NAME: "string";
10
- readonly FRONTEND_PORT: "number";
11
- readonly FRONTEND_URL: "string";
12
- readonly LOGGER_SERVICE_PORT: "number";
13
- readonly RABBITMQ_MANAGEMENT_PORT: "number";
14
- readonly RABBITMQ_PORT: "number";
15
- readonly RABBITMQ_PWD: "string";
16
- readonly RABBITMQ_URL: "string";
17
- readonly RABBITMQ_USER: "string";
18
- readonly REDIS_PORT: "number";
19
- readonly REDIS_PWD: "string";
20
- readonly REDIS_URL: "string";
21
- readonly S3_IMAGES_BUCKET_NAME: "string";
2
+ readonly 'api-gateway': readonly ["API_GATEWAY_PORT", "AUTHENTICATION_AUDIENCE", "AUTHENTICATION_DOMAIN", "CACHE_ENABLED", "DATABASE_URL", "FRONTEND_URL", "RABBITMQ_URL", "REDIS_PWD", "REDIS_URL", "S3_IMAGES_BUCKET_NAME"];
3
+ readonly backend: readonly ["API_GATEWAY_PORT", "CACHE_SERVICE_PORT", "FRONTEND_PORT", "LOGGER_SERVICE_PORT", "RABBITMQ_PORT", "RABBITMQ_MANAGEMENT_PORT", "REDIS_PORT"];
4
+ readonly 'backend-init': readonly ["APP_NAME", "DOMAIN_NAME", "S3_IMAGES_BUCKET_NAME"];
5
+ readonly 'cache-service': readonly ["CACHE_ENABLED", "CACHE_SERVICE_PORT", "DATABASE_URL", "RABBITMQ_URL", "REDIS_PWD", "REDIS_URL"];
6
+ readonly frontend: readonly ["DATABASE_URL", "FRONTEND_PORT"];
7
+ readonly images: readonly ["S3_IMAGES_BUCKET_NAME"];
8
+ readonly 'images-init': readonly ["FRONTEND_URL", "S3_IMAGES_BUCKET_NAME"];
9
+ readonly 'logger-service': readonly ["DATABASE_URL", "LOGGER_SERVICE_PORT", "RABBITMQ_URL"];
10
+ readonly nginx: readonly ["FRONTEND_PORT"];
11
+ readonly rabbitmq: readonly ["RABBITMQ_PORT", "RABBITMQ_MANAGEMENT_PORT", "RABBITMQ_PWD", "RABBITMQ_USER"];
12
+ readonly redis: readonly ["REDIS_PORT", "REDIS_PWD"];
22
13
  };
@@ -1,22 +1,34 @@
1
1
  export const ENVIRONMENT_VARIABLES = {
2
- API_GATEWAY_PORT: 'number',
3
- APP_NAME: 'string',
4
- AUTHENTICATION_AUDIENCE: 'string',
5
- AUTHENTICATION_DOMAIN: 'string',
6
- CACHE_ENABLED: 'boolean',
7
- CACHE_SERVICE_PORT: 'number',
8
- DATABASE_URL: 'string',
9
- DOMAIN_NAME: 'string',
10
- FRONTEND_PORT: 'number',
11
- FRONTEND_URL: 'string',
12
- LOGGER_SERVICE_PORT: 'number',
13
- RABBITMQ_MANAGEMENT_PORT: 'number',
14
- RABBITMQ_PORT: 'number',
15
- RABBITMQ_PWD: 'string',
16
- RABBITMQ_URL: 'string',
17
- RABBITMQ_USER: 'string',
18
- REDIS_PORT: 'number',
19
- REDIS_PWD: 'string',
20
- REDIS_URL: 'string',
21
- S3_IMAGES_BUCKET_NAME: 'string',
2
+ 'api-gateway': [
3
+ 'API_GATEWAY_PORT',
4
+ 'AUTHENTICATION_AUDIENCE',
5
+ 'AUTHENTICATION_DOMAIN',
6
+ 'CACHE_ENABLED',
7
+ 'DATABASE_URL',
8
+ 'FRONTEND_URL',
9
+ 'RABBITMQ_URL',
10
+ 'REDIS_PWD',
11
+ 'REDIS_URL',
12
+ 'S3_IMAGES_BUCKET_NAME',
13
+ ],
14
+ backend: [
15
+ 'API_GATEWAY_PORT',
16
+ 'CACHE_SERVICE_PORT',
17
+ 'FRONTEND_PORT',
18
+ 'LOGGER_SERVICE_PORT',
19
+ 'RABBITMQ_PORT',
20
+ 'RABBITMQ_MANAGEMENT_PORT',
21
+ 'REDIS_PORT',
22
+ ],
23
+ 'backend-init': ['APP_NAME', 'DOMAIN_NAME', 'S3_IMAGES_BUCKET_NAME'],
24
+ 'cache-service': ['CACHE_ENABLED', 'CACHE_SERVICE_PORT', 'DATABASE_URL', 'RABBITMQ_URL', 'REDIS_PWD', 'REDIS_URL'],
25
+ frontend: ['DATABASE_URL', 'FRONTEND_PORT'],
26
+ images: ['S3_IMAGES_BUCKET_NAME'],
27
+ 'images-init': ['FRONTEND_URL', 'S3_IMAGES_BUCKET_NAME'],
28
+ 'logger-service': ['DATABASE_URL', 'LOGGER_SERVICE_PORT', 'RABBITMQ_URL'],
29
+ nginx: ['FRONTEND_PORT'],
30
+ rabbitmq: ['RABBITMQ_PORT', 'RABBITMQ_MANAGEMENT_PORT', 'RABBITMQ_PWD', 'RABBITMQ_USER'],
31
+ redis: ['REDIS_PORT', 'REDIS_PWD'],
22
32
  };
33
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
34
+ const CHECK = ENVIRONMENT_VARIABLES;
@@ -1,6 +1,15 @@
1
- import { TypeMap } from '../../../type/index.js';
2
- import { EnvironmentVariableName } from '../../environment-variable-name/domains/index.js';
1
+ import { EnvironmentMode } from '../../environment-mode/index.js';
2
+ import { ENVIRONMENT_VARIABLE } from '../../environment-variable/configs/index.js';
3
3
  import { ENVIRONMENT_VARIABLES } from '../configs/index.js';
4
4
  export type EnvironmentVariables = {
5
- [key in EnvironmentVariableName]: TypeMap[(typeof ENVIRONMENT_VARIABLES)[key]];
5
+ [key in keyof typeof ENVIRONMENT_VARIABLES]: {
6
+ [key2 in (typeof ENVIRONMENT_VARIABLES)[key][number]]: TypeMap[(typeof ENVIRONMENT_VARIABLE)[key2]];
7
+ };
6
8
  };
9
+ interface TypeMap {
10
+ boolean: boolean;
11
+ EnvironmentMode: EnvironmentMode;
12
+ number: number;
13
+ string: string;
14
+ }
15
+ export {};
@@ -1,2 +1,3 @@
1
+ export * from './configs/index.js';
1
2
  export * from './domains/index.js';
2
3
  export * from './workers/index.js';
@@ -1,2 +1,3 @@
1
+ export * from './configs/index.js';
1
2
  export * from './domains/index.js';
2
3
  export * from './workers/index.js';
@@ -1,24 +1,18 @@
1
1
  import { isDevelopment as isDev, isProduction as isProd } from '../../../environment-mode/index.js';
2
2
  import { loadEnvFile } from '../../../env-file/index.js';
3
3
  export const EnvironmentVariablesWorker = (() => {
4
- const ENVIRONMENT_MODE = process.env.ENVIRONMENT_MODE;
4
+ const NODE_ENV = process.env.NODE_ENV;
5
5
  let envs;
6
6
  const get = () => envs;
7
7
  const init = () => {
8
- const resp = loadEnvFile(ENVIRONMENT_MODE);
8
+ const resp = loadEnvFile(NODE_ENV);
9
9
  if ('customError' in resp) {
10
10
  return resp;
11
11
  }
12
- envs = {
13
- ...resp.data,
14
- ENVIRONMENT_MODE,
15
- };
16
- return {
17
- data: envs,
18
- };
12
+ return resp;
19
13
  };
20
- const isDevelopment = () => isDev(ENVIRONMENT_MODE);
21
- const isProduction = () => isProd(ENVIRONMENT_MODE);
14
+ const isDevelopment = () => isDev(NODE_ENV);
15
+ const isProduction = () => isProd(NODE_ENV);
22
16
  return {
23
17
  get,
24
18
  init,
@@ -1,13 +1,14 @@
1
1
  import { CustomError } from '../../../../error/index.js';
2
+ import { EnvironmentVariables } from '../../domains/index.js';
2
3
  export type IEnvironmentVariablesWorker = {
3
4
  get: Get;
4
5
  init: Init;
5
6
  isDevelopment: IsDevelopment;
6
7
  isProduction: IsProduction;
7
8
  };
8
- export type Get = <T = never>() => T;
9
- export type Init = <T = never>() => {
10
- data: T;
9
+ export type Get = <T extends keyof EnvironmentVariables = never>() => EnvironmentVariables[T];
10
+ export type Init = <T extends keyof EnvironmentVariables = never>() => {
11
+ data: EnvironmentVariables[T];
11
12
  } | {
12
13
  customError: CustomError;
13
14
  };
@@ -1,3 +1,2 @@
1
- export * from './project-config/index.js';
2
1
  export * from './project-name/index.js';
3
2
  export * from './singletons/index.js';
@@ -1,3 +1,2 @@
1
- export * from './project-config/index.js';
2
1
  export * from './project-name/index.js';
3
2
  export * from './singletons/index.js';
@@ -2,4 +2,3 @@ export * from './array/index.js';
2
2
  export * from './string/index.js';
3
3
  export * from './type/index.js';
4
4
  export * from './type-guards/index.js';
5
- export * from './type-map/index.js';
package/src/type/index.js CHANGED
@@ -2,4 +2,3 @@ export * from './array/index.js';
2
2
  export * from './string/index.js';
3
3
  export * from './type/index.js';
4
4
  export * from './type-guards/index.js';
5
- export * from './type-map/index.js';
@@ -1,7 +0,0 @@
1
- import { CustomError } from '../../../../error/index.js';
2
- import { EnvironmentMode } from '../../../environment-mode/index.js';
3
- export type LoadEnvFile = <T extends Record<string, unknown>>(environmentMode: EnvironmentMode) => {
4
- data: T;
5
- } | {
6
- customError: CustomError;
7
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
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" | "FRONTEND_PORT" | "LOGGER_SERVICE_PORT" | "RABBITMQ_PORT" | "RABBITMQ_MANAGEMENT_PORT" | "REDIS_PORT" | "APP_NAME" | "DOMAIN_NAME" | "RABBITMQ_PWD" | "RABBITMQ_USER")[];
@@ -1,2 +0,0 @@
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 +0,0 @@
1
- import { ENVIRONMENT_VARIABLES } from '../../../environment-variables/configs/index.js';
2
- export declare const ENVIRONMENT_VARIABLE_NAMES: Array<keyof typeof ENVIRONMENT_VARIABLES>;
@@ -1,2 +0,0 @@
1
- import { ENVIRONMENT_VARIABLES } from '../../../environment-variables/configs/index.js';
2
- export const ENVIRONMENT_VARIABLE_NAMES = Object.keys(ENVIRONMENT_VARIABLES);
@@ -1 +0,0 @@
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" | "FRONTEND_PORT" | "LOGGER_SERVICE_PORT" | "RABBITMQ_PORT" | "RABBITMQ_MANAGEMENT_PORT" | "REDIS_PORT" | "APP_NAME" | "DOMAIN_NAME" | "RABBITMQ_PWD" | "RABBITMQ_USER")[];
@@ -1,2 +0,0 @@
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 +0,0 @@
1
- export * from './project-config/index.js';
2
- export * from './project-config-names/index.js';
@@ -1,2 +0,0 @@
1
- export * from './project-config/index.js';
2
- export * from './project-config-names/index.js';
@@ -1,35 +0,0 @@
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", "RABBITMQ_URL", "REDIS_PWD", "REDIS_URL", "S3_IMAGES_BUCKET_NAME"];
4
- };
5
- readonly 'backend-project-config': {
6
- readonly environmentVariableNames: readonly ["API_GATEWAY_PORT", "CACHE_SERVICE_PORT", "FRONTEND_PORT", "LOGGER_SERVICE_PORT", "RABBITMQ_PORT", "RABBITMQ_MANAGEMENT_PORT", "REDIS_PORT"];
7
- };
8
- readonly 'backend-init-project-config': {
9
- readonly environmentVariableNames: readonly ["APP_NAME", "DOMAIN_NAME", "S3_IMAGES_BUCKET_NAME"];
10
- };
11
- readonly 'cache-service-project-config': {
12
- readonly environmentVariableNames: readonly ["CACHE_ENABLED", "CACHE_SERVICE_PORT", "DATABASE_URL", "RABBITMQ_URL", "REDIS_PWD", "REDIS_URL"];
13
- };
14
- readonly 'frontend-project-config': {
15
- readonly environmentVariableNames: readonly ["DATABASE_URL", "FRONTEND_PORT"];
16
- };
17
- readonly 'images-project-config': {
18
- readonly environmentVariableNames: readonly ["S3_IMAGES_BUCKET_NAME"];
19
- };
20
- readonly 'images-init-project-config': {
21
- readonly environmentVariableNames: readonly ["FRONTEND_URL", "S3_IMAGES_BUCKET_NAME"];
22
- };
23
- readonly 'logger-service-project-config': {
24
- readonly environmentVariableNames: readonly ["DATABASE_URL", "LOGGER_SERVICE_PORT", "RABBITMQ_URL"];
25
- };
26
- readonly 'nginx-project-config': {
27
- readonly environmentVariableNames: readonly ["FRONTEND_PORT"];
28
- };
29
- readonly 'rabbitmq-project-config': {
30
- readonly environmentVariableNames: readonly ["RABBITMQ_PORT", "RABBITMQ_MANAGEMENT_PORT", "RABBITMQ_PWD", "RABBITMQ_USER"];
31
- };
32
- readonly 'redis-project-config': {
33
- readonly environmentVariableNames: readonly ["REDIS_PORT", "REDIS_PWD"];
34
- };
35
- };
@@ -1,54 +0,0 @@
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
- 'RABBITMQ_URL',
11
- 'REDIS_PWD',
12
- 'REDIS_URL',
13
- 'S3_IMAGES_BUCKET_NAME',
14
- ],
15
- },
16
- 'backend-project-config': {
17
- environmentVariableNames: [
18
- 'API_GATEWAY_PORT',
19
- 'CACHE_SERVICE_PORT',
20
- 'FRONTEND_PORT',
21
- 'LOGGER_SERVICE_PORT',
22
- 'RABBITMQ_PORT',
23
- 'RABBITMQ_MANAGEMENT_PORT',
24
- 'REDIS_PORT',
25
- ],
26
- },
27
- 'backend-init-project-config': {
28
- environmentVariableNames: ['APP_NAME', 'DOMAIN_NAME', 'S3_IMAGES_BUCKET_NAME'],
29
- },
30
- 'cache-service-project-config': {
31
- environmentVariableNames: ['CACHE_ENABLED', 'CACHE_SERVICE_PORT', 'DATABASE_URL', 'RABBITMQ_URL', 'REDIS_PWD', 'REDIS_URL'],
32
- },
33
- 'frontend-project-config': {
34
- environmentVariableNames: ['DATABASE_URL', 'FRONTEND_PORT'],
35
- },
36
- 'images-project-config': {
37
- environmentVariableNames: ['S3_IMAGES_BUCKET_NAME'],
38
- },
39
- 'images-init-project-config': {
40
- environmentVariableNames: ['FRONTEND_URL', 'S3_IMAGES_BUCKET_NAME'],
41
- },
42
- 'logger-service-project-config': {
43
- environmentVariableNames: ['DATABASE_URL', 'LOGGER_SERVICE_PORT', 'RABBITMQ_URL'],
44
- },
45
- 'nginx-project-config': {
46
- environmentVariableNames: ['FRONTEND_PORT'],
47
- },
48
- 'rabbitmq-project-config': {
49
- environmentVariableNames: ['RABBITMQ_PORT', 'RABBITMQ_MANAGEMENT_PORT', 'RABBITMQ_PWD', 'RABBITMQ_USER'],
50
- },
51
- 'redis-project-config': {
52
- environmentVariableNames: ['REDIS_PORT', 'REDIS_PWD'],
53
- },
54
- };
@@ -1,2 +0,0 @@
1
- import { ProjectConfigName } from '../../domains/index.js';
2
- export declare const PROJECT_CONFIG_NAMES: ProjectConfigName[];
@@ -1,2 +0,0 @@
1
- import { PROJECT_CONFIG } from '../project-config/index.js';
2
- export const PROJECT_CONFIG_NAMES = Object.keys(PROJECT_CONFIG);
@@ -1,2 +0,0 @@
1
- export * from './project-config/index.js';
2
- export * from './project-config-name/index.js';
@@ -1,2 +0,0 @@
1
- export * from './project-config/index.js';
2
- export * from './project-config-name/index.js';
@@ -1,6 +0,0 @@
1
- import { EnvironmentVariables } from '../../../../environment/index.js';
2
- import { PROJECT_CONFIG } from '../../configs/index.js';
3
- import { ProjectConfigName } from '../project-config-name/index.js';
4
- export type ProjectConfig = {
5
- [key in ProjectConfigName]: Pick<EnvironmentVariables, (typeof PROJECT_CONFIG)[key]['environmentVariableNames'][number]>;
6
- };
@@ -1,2 +0,0 @@
1
- import { PROJECT_CONFIG } from '../../configs/index.js';
2
- export type ProjectConfigName = keyof typeof PROJECT_CONFIG;
@@ -1,5 +0,0 @@
1
- export interface TypeMap {
2
- boolean: boolean;
3
- number: number;
4
- string: string;
5
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export * from './domains/index.js';
@@ -1 +0,0 @@
1
- export * from './domains/index.js';