@candlerip/shared3 0.0.26 → 0.0.28

Sign up to get free protection for your applications and to get access to all the features.
Files changed (21) hide show
  1. package/package.json +1 -1
  2. package/src/environment/env-file/utils/load-env-file/types.d.ts +1 -1
  3. package/src/environment/environment-variables/domains/index.d.ts +4 -2
  4. package/src/environment/environment-variables/index.d.ts +1 -0
  5. package/src/environment/environment-variables/index.js +1 -0
  6. package/src/environment/environment-variables/workers/environment-variables-worker/index.d.ts +2 -0
  7. package/src/environment/environment-variables/workers/environment-variables-worker/index.js +20 -0
  8. package/src/environment/environment-variables/workers/environment-variables-worker/types.d.ts +9 -0
  9. package/src/environment/environment-variables/workers/environment-variables-worker/types.js +1 -0
  10. package/src/environment/environment-variables/workers/index.d.ts +1 -0
  11. package/src/environment/environment-variables/workers/index.js +1 -0
  12. package/src/project/project-config/domains/index.d.ts +2 -0
  13. package/src/project/project-config/domains/index.js +2 -0
  14. package/src/project/project-config/domains/logger-service-project-config/index.d.ts +1 -1
  15. package/src/project/project-config/domains/project-config-map/index.d.ts +2 -0
  16. package/src/project/project-config/domains/rabbitmq-project-config/index.d.ts +2 -0
  17. package/src/project/project-config/domains/rabbitmq-project-config/index.js +1 -0
  18. package/src/project/project-config-name/configs/index.d.ts +1 -1
  19. package/src/project/project-config-name/configs/index.js +1 -0
  20. package/src/project/project-name/configs/index.d.ts +1 -1
  21. package/src/project/project-name/configs/index.js +1 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@candlerip/shared3",
3
- "version": "0.0.26",
3
+ "version": "0.0.28",
4
4
  "type": "module",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -1,6 +1,6 @@
1
1
  import { CustomError } from '../../../../error/index.js';
2
2
  import { EnvironmentMode } from '../../../environment-mode/index.js';
3
- export type LoadEnvFile = <T extends Record<string, unknown> = never>(environmentMode: EnvironmentMode, options?: {
3
+ export type LoadEnvFile = <T extends Record<string, unknown>>(environmentMode: EnvironmentMode, options?: {
4
4
  integers?: string[];
5
5
  }) => {
6
6
  data: T;
@@ -1,13 +1,15 @@
1
1
  export interface EnvironmentVariables {
2
2
  APP_NAME: string;
3
- REDIS_PORT: number;
4
- REDIS_PWD: string;
5
3
  CACHE_SERVICE_PORT: number;
6
4
  DATABASE_URL: string;
7
5
  DICTIONARY_SERVICE_PORT: number;
8
6
  DOMAIN_NAME: string;
9
7
  FRONTEND_URL: string;
10
8
  LOGGER_SERVICE_PORT: string;
9
+ RABBITMQ_PORT: number;
10
+ RABBITMQ_MANGEMENT_PORT: number;
11
+ REDIS_PORT: number;
12
+ REDIS_PWD: string;
11
13
  REDIS_URL: string;
12
14
  S3_IMAGES_BUCKET_NAME: string;
13
15
  }
@@ -1 +1,2 @@
1
1
  export * from './domains/index.js';
2
+ export * from './workers/index.js';
@@ -1 +1,2 @@
1
1
  export * from './domains/index.js';
2
+ export * from './workers/index.js';
@@ -0,0 +1,2 @@
1
+ import { IEnvironmentVariablesWorker } from './types.js';
2
+ export declare const EnvironmentVariablesWorker: IEnvironmentVariablesWorker;
@@ -0,0 +1,20 @@
1
+ import { loadEnvFile } from '../../../env-file/index.js';
2
+ export const EnvironmentVariablesWorker = (() => {
3
+ let envs;
4
+ const get = () => envs;
5
+ const init = (integers) => {
6
+ const ENVIRONMENT_MODE = process.env.ENVIRONMENT_MODE;
7
+ const resp = loadEnvFile(ENVIRONMENT_MODE, { integers });
8
+ if ('customError' in resp) {
9
+ return resp;
10
+ }
11
+ envs = {
12
+ ...resp.data,
13
+ ENVIRONMENT_MODE,
14
+ };
15
+ };
16
+ return {
17
+ get,
18
+ init,
19
+ };
20
+ })();
@@ -0,0 +1,9 @@
1
+ import { CustomError } from '../../../../error/index.js';
2
+ export type IEnvironmentVariablesWorker = {
3
+ get: Get;
4
+ init: Init;
5
+ };
6
+ export type Get = <T = never>() => T;
7
+ export type Init = (integers?: string[]) => undefined | {
8
+ customError: CustomError;
9
+ };
@@ -0,0 +1 @@
1
+ export * from './environment-variables-worker/index.js';
@@ -0,0 +1 @@
1
+ export * from './environment-variables-worker/index.js';
@@ -2,5 +2,7 @@ export * from './backend-project-config/index.js';
2
2
  export * from './backend-init-project-config/index.js';
3
3
  export * from './cache-service-project-config/index.js';
4
4
  export * from './dictionary-service-poject-config/index.js';
5
+ export * from './logger-service-project-config/index.js';
5
6
  export * from './project-config-map/index.js';
7
+ export * from './rabbitmq-project-config/index.js';
6
8
  export * from './redis-project-config/index.js';
@@ -2,5 +2,7 @@ export * from './backend-project-config/index.js';
2
2
  export * from './backend-init-project-config/index.js';
3
3
  export * from './cache-service-project-config/index.js';
4
4
  export * from './dictionary-service-poject-config/index.js';
5
+ export * from './logger-service-project-config/index.js';
5
6
  export * from './project-config-map/index.js';
7
+ export * from './rabbitmq-project-config/index.js';
6
8
  export * from './redis-project-config/index.js';
@@ -1,2 +1,2 @@
1
1
  import { EnvironmentVariables } from '../../../../environment/index.js';
2
- export type LoggerServiceProjectConfig = Pick<EnvironmentVariables, 'DATABASE_URL'>;
2
+ export type LoggerServiceProjectConfig = Pick<EnvironmentVariables, 'DATABASE_URL' | 'LOGGER_SERVICE_PORT'>;
@@ -5,6 +5,7 @@ import { DictionaryServiceProjectConfig } from '../dictionary-service-poject-con
5
5
  import { ImagesInitProjectConfig } from '../images-init-project-config/index.js';
6
6
  import { ImagesProjectConfig } from '../images-project-config/index.js';
7
7
  import { LoggerServiceProjectConfig } from '../logger-service-project-config/index.js';
8
+ import { RabbitmqProjectConfig } from '../rabbitmq-project-config/index.js';
8
9
  import { RedisProjectConfig } from '../redis-project-config/index.js';
9
10
  export type ProjectConfigMap = {
10
11
  'backend-project-config': BackendProjectConfig;
@@ -14,5 +15,6 @@ export type ProjectConfigMap = {
14
15
  'images-project-config': ImagesProjectConfig;
15
16
  'images-init-project-config': ImagesInitProjectConfig;
16
17
  'logger-service-project-config': LoggerServiceProjectConfig;
18
+ 'rabbitmq-project-config': RabbitmqProjectConfig;
17
19
  'redis-project-config': RedisProjectConfig;
18
20
  };
@@ -0,0 +1,2 @@
1
+ import { EnvironmentVariables } from '../../../../environment/index.js';
2
+ export type RabbitmqProjectConfig = Pick<EnvironmentVariables, 'RABBITMQ_PORT' | 'RABBITMQ_MANGEMENT_PORT'>;
@@ -1 +1 @@
1
- export declare const PROJECT_CONFIG_NAMES: readonly ["backend-init-project-config", "backend-project-config", "cache-service-project-config", "dictionary-service-project-config", "images-project-config", "images-init-project-config", "logger-service-project-config", "redis-project-config"];
1
+ export declare const PROJECT_CONFIG_NAMES: readonly ["backend-init-project-config", "backend-project-config", "cache-service-project-config", "dictionary-service-project-config", "images-project-config", "images-init-project-config", "logger-service-project-config", "rabbitmq-project-config", "redis-project-config"];
@@ -6,5 +6,6 @@ export const PROJECT_CONFIG_NAMES = [
6
6
  'images-project-config',
7
7
  'images-init-project-config',
8
8
  'logger-service-project-config',
9
+ 'rabbitmq-project-config',
9
10
  'redis-project-config',
10
11
  ];
@@ -1 +1 @@
1
- export declare const PROJECT_NAMES: readonly ["backend-init", "backend", "cache-service", "dictionary-service", "config", "images", "images-init", "logger-service", "redis", "shared", "shared-aws", "shared-backend"];
1
+ export declare const PROJECT_NAMES: readonly ["backend-init", "backend", "cache-service", "dictionary-service", "config", "images", "images-init", "logger-service", "rabbitmq", "redis", "shared", "shared-aws", "shared-backend"];
@@ -7,6 +7,7 @@ export const PROJECT_NAMES = [
7
7
  'images',
8
8
  'images-init',
9
9
  'logger-service',
10
+ 'rabbitmq',
10
11
  'redis',
11
12
  'shared',
12
13
  'shared-aws',