@candlerip/shared3 0.0.22 → 0.0.24

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. package/package.json +1 -1
  2. package/src/environment/environment-variables/domains/index.d.ts +4 -3
  3. package/src/index.d.ts +1 -0
  4. package/src/index.js +1 -0
  5. package/src/project/project-config/domains/cache-service-project-config/index.d.ts +1 -1
  6. package/src/project/project-config/domains/images-init-project-config/index.d.ts +2 -0
  7. package/src/project/project-config/domains/images-project-config/index.d.ts +2 -0
  8. package/src/project/project-config/domains/images-project-config/index.js +1 -0
  9. package/src/project/project-config/domains/index.d.ts +1 -1
  10. package/src/project/project-config/domains/index.js +1 -1
  11. package/src/project/project-config/domains/logger-project-config/index.d.ts +2 -0
  12. package/src/project/project-config/domains/logger-project-config/index.js +1 -0
  13. package/src/project/project-config/domains/{project-config-type-map → project-config-map}/index.d.ts +6 -1
  14. package/src/project/project-config/domains/project-config-map/index.js +1 -0
  15. package/src/project/project-config-name/configs/index.d.ts +1 -1
  16. package/src/project/project-config-name/configs/index.js +4 -1
  17. package/src/project/project-name/configs/index.d.ts +1 -1
  18. package/src/project/project-name/configs/index.js +14 -1
  19. package/src/type/index.d.ts +1 -0
  20. package/src/type/index.js +1 -0
  21. package/src/type/type-guards/index.d.ts +8 -0
  22. package/src/type/type-guards/index.js +8 -0
  23. package/src/type/type-guards/is-array/index.d.ts +1 -0
  24. package/src/type/type-guards/is-array/index.js +9 -0
  25. package/src/type/type-guards/is-boolean/index.d.ts +1 -0
  26. package/src/type/type-guards/is-boolean/index.js +1 -0
  27. package/src/type/type-guards/is-null/index.d.ts +1 -0
  28. package/src/type/type-guards/is-null/index.js +1 -0
  29. package/src/type/type-guards/is-number/index.d.ts +1 -0
  30. package/src/type/type-guards/is-number/index.js +1 -0
  31. package/src/type/type-guards/is-object/index.d.ts +3 -0
  32. package/src/type/type-guards/is-object/index.js +3 -0
  33. package/src/type/type-guards/is-object/object/index.d.ts +1 -0
  34. package/src/type/type-guards/is-object/object/index.js +11 -0
  35. package/src/type/type-guards/is-object/properties-in-object/index.d.ts +1 -0
  36. package/src/type/type-guards/is-object/properties-in-object/index.js +8 -0
  37. package/src/type/type-guards/is-object/property-in-object/index.d.ts +1 -0
  38. package/src/type/type-guards/is-object/property-in-object/index.js +13 -0
  39. package/src/type/type-guards/is-string/index.d.ts +1 -0
  40. package/src/type/type-guards/is-string/index.js +1 -0
  41. package/src/type/type-guards/is-type/index.d.ts +1 -0
  42. package/src/type/type-guards/is-type/index.js +6 -0
  43. package/src/type/type-guards/is-undefined/index.d.ts +1 -0
  44. package/src/type/type-guards/is-undefined/index.js +1 -0
  45. /package/src/project/project-config/domains/{project-config-type-map → images-init-project-config}/index.js +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@candlerip/shared3",
3
- "version": "0.0.22",
3
+ "version": "0.0.24",
4
4
  "type": "module",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -1,11 +1,12 @@
1
1
  export interface EnvironmentVariables {
2
2
  APP_NAME: string;
3
+ REDIS_PORT: number;
4
+ REDIS_PWD: string;
3
5
  CACHE_SERVICE_PORT: number;
6
+ CACHE_URL: string;
4
7
  DATABASE_URL: string;
5
8
  DICTIONARY_SERVICE_PORT: number;
6
9
  DOMAIN_NAME: string;
7
- REDIS_PORT: number;
8
- REDIS_PWD: string;
9
- REDIS_URL: string;
10
+ FRONTEND_URL: string;
10
11
  S3_IMAGES_BUCKET_NAME: string;
11
12
  }
package/src/index.d.ts CHANGED
@@ -2,3 +2,4 @@ export * from './aws/index.js';
2
2
  export * from './environment/index.js';
3
3
  export * from './error/index.js';
4
4
  export * from './project/index.js';
5
+ export * from './type/index.js';
package/src/index.js CHANGED
@@ -2,3 +2,4 @@ export * from './aws/index.js';
2
2
  export * from './environment/index.js';
3
3
  export * from './error/index.js';
4
4
  export * from './project/index.js';
5
+ export * from './type/index.js';
@@ -1,2 +1,2 @@
1
1
  import { EnvironmentVariables } from '../../../../environment/index.js';
2
- export type CacheServiceProjectConfig = Pick<EnvironmentVariables, 'CACHE_SERVICE_PORT' | 'DATABASE_URL' | 'REDIS_PWD' | 'REDIS_URL'>;
2
+ export type CacheServiceProjectConfig = Pick<EnvironmentVariables, 'CACHE_SERVICE_PORT' | 'DATABASE_URL' | 'REDIS_PWD' | 'CACHE_URL'>;
@@ -0,0 +1,2 @@
1
+ import { EnvironmentVariables } from '../../../../environment/index.js';
2
+ export type ImagesInitProjectConfig = Pick<EnvironmentVariables, 'FRONTEND_URL' | 'S3_IMAGES_BUCKET_NAME'>;
@@ -0,0 +1,2 @@
1
+ import { EnvironmentVariables } from '../../../../environment/index.js';
2
+ export type ImagesProjectConfig = Pick<EnvironmentVariables, 'S3_IMAGES_BUCKET_NAME'>;
@@ -2,5 +2,5 @@ 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 './project-config-type-map/index.js';
5
+ export * from './project-config-map/index.js';
6
6
  export * from './redis-project-config/index.js';
@@ -2,5 +2,5 @@ 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 './project-config-type-map/index.js';
5
+ export * from './project-config-map/index.js';
6
6
  export * from './redis-project-config/index.js';
@@ -0,0 +1,2 @@
1
+ import { EnvironmentVariables } from '../../../../environment/index.js';
2
+ export type LoggerProjectConfig = Pick<EnvironmentVariables, 'DATABASE_URL'>;
@@ -2,11 +2,16 @@ import { BackendInitProjectConfig } from '../backend-init-project-config/index.j
2
2
  import { BackendProjectConfig } from '../backend-project-config/index.js';
3
3
  import { CacheServiceProjectConfig } from '../cache-service-project-config/index.js';
4
4
  import { DictionaryServiceProjectConfig } from '../dictionary-service-poject-config/index.js';
5
+ import { ImagesInitProjectConfig } from '../images-init-project-config/index.js';
6
+ import { ImagesProjectConfig } from '../images-project-config/index.js';
5
7
  import { RedisProjectConfig } from '../redis-project-config/index.js';
6
- export type ProjectConfigTypeMap = {
8
+ export type ProjectConfigMap = {
7
9
  'backend-project-config': BackendProjectConfig;
8
10
  'backend-init-project-config': BackendInitProjectConfig;
9
11
  'cache-service-project-config': CacheServiceProjectConfig;
10
12
  'dictionary-service-project-config': DictionaryServiceProjectConfig;
13
+ 'images-project-config': ImagesProjectConfig;
14
+ 'images-init-project-config': ImagesInitProjectConfig;
15
+ 'logger-project-config': CacheServiceProjectConfig;
11
16
  'redis-project-config': RedisProjectConfig;
12
17
  };
@@ -1 +1 @@
1
- export declare const PROJECT_CONFIG_NAMES: readonly ["backend-init-project-config", "backend-project-config", "dictionary-service-project-config", "cache-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-project-config", "redis-project-config"];
@@ -1,7 +1,10 @@
1
1
  export const PROJECT_CONFIG_NAMES = [
2
2
  'backend-init-project-config',
3
3
  'backend-project-config',
4
- 'dictionary-service-project-config',
5
4
  'cache-service-project-config',
5
+ 'dictionary-service-project-config',
6
+ 'images-project-config',
7
+ 'images-init-project-config',
8
+ 'logger-project-config',
6
9
  'redis-project-config',
7
10
  ];
@@ -1 +1 @@
1
- export declare const PROJECT_NAMES: readonly ["backend-init", "backend", "dictionary-service", "cache-service", "config", "redis", "shared", "shared-aws"];
1
+ export declare const PROJECT_NAMES: readonly ["backend-init", "backend", "cache-service", "dictionary-service", "config", "images", "images-init", "logger", "redis", "shared", "shared-aws", "shared-backend"];
@@ -1 +1,14 @@
1
- export const PROJECT_NAMES = ['backend-init', 'backend', 'dictionary-service', 'cache-service', 'config', 'redis', 'shared', 'shared-aws'];
1
+ export const PROJECT_NAMES = [
2
+ 'backend-init',
3
+ 'backend',
4
+ 'cache-service',
5
+ 'dictionary-service',
6
+ 'config',
7
+ 'images',
8
+ 'images-init',
9
+ 'logger',
10
+ 'redis',
11
+ 'shared',
12
+ 'shared-aws',
13
+ 'shared-backend',
14
+ ];
@@ -0,0 +1 @@
1
+ export * from './type-guards/index.js';
@@ -0,0 +1 @@
1
+ export * from './type-guards/index.js';
@@ -0,0 +1,8 @@
1
+ export * from './is-array/index.js';
2
+ export * from './is-boolean/index.js';
3
+ export * from './is-null/index.js';
4
+ export * from './is-number/index.js';
5
+ export * from './is-object/index.js';
6
+ export * from './is-string/index.js';
7
+ export * from './is-type/index.js';
8
+ export * from './is-undefined/index.js';
@@ -0,0 +1,8 @@
1
+ export * from './is-array/index.js';
2
+ export * from './is-boolean/index.js';
3
+ export * from './is-null/index.js';
4
+ export * from './is-number/index.js';
5
+ export * from './is-object/index.js';
6
+ export * from './is-string/index.js';
7
+ export * from './is-type/index.js';
8
+ export * from './is-undefined/index.js';
@@ -0,0 +1 @@
1
+ export declare const isArray: <T>(data?: unknown, typeGuard?: (data?: unknown) => data is T) => data is T[];
@@ -0,0 +1,9 @@
1
+ export const isArray = (data, typeGuard) => {
2
+ if (!Array.isArray(data)) {
3
+ return false;
4
+ }
5
+ if (typeGuard && !data.every((a) => typeGuard(a))) {
6
+ return false;
7
+ }
8
+ return true;
9
+ };
@@ -0,0 +1 @@
1
+ export declare const isBoolean: (data?: unknown) => data is boolean;
@@ -0,0 +1 @@
1
+ export const isBoolean = (data) => typeof data === 'boolean';
@@ -0,0 +1 @@
1
+ export declare const isNull: (data?: unknown) => data is null;
@@ -0,0 +1 @@
1
+ export const isNull = (data) => data === null;
@@ -0,0 +1 @@
1
+ export declare const isNumber: (data?: unknown) => data is number;
@@ -0,0 +1 @@
1
+ export const isNumber = (data) => typeof data === 'number';
@@ -0,0 +1,3 @@
1
+ export * from './object/index.js';
2
+ export * from './properties-in-object/index.js';
3
+ export * from './property-in-object/index.js';
@@ -0,0 +1,3 @@
1
+ export * from './object/index.js';
2
+ export * from './properties-in-object/index.js';
3
+ export * from './property-in-object/index.js';
@@ -0,0 +1 @@
1
+ export declare const isObject: (data?: unknown) => data is Record<string, unknown>;
@@ -0,0 +1,11 @@
1
+ import { isArray } from '../../is-array/index.js';
2
+ import { isNull } from '../../is-null/index.js';
3
+ export const isObject = (data) => {
4
+ if (typeof data !== 'object') {
5
+ return false;
6
+ }
7
+ if (isNull(data)) {
8
+ return false;
9
+ }
10
+ return !isArray(data);
11
+ };
@@ -0,0 +1 @@
1
+ export declare const isPropertiesInObject: <X extends string, T>(props: X[], data?: unknown, typeGuard?: (data?: unknown) => data is T) => data is { [key in X]: T; };
@@ -0,0 +1,8 @@
1
+ import { isObject } from '../object/index.js';
2
+ import { isPropertyInObject } from '../property-in-object/index.js';
3
+ export const isPropertiesInObject = (props, data, typeGuard) => {
4
+ if (!isObject(data)) {
5
+ return false;
6
+ }
7
+ return props.every((a) => isPropertyInObject(a, data, typeGuard));
8
+ };
@@ -0,0 +1 @@
1
+ export declare const isPropertyInObject: <X extends string, T>(prop: X, data?: unknown, typeGuard?: (data?: unknown) => data is T) => data is Record<X, T>;
@@ -0,0 +1,13 @@
1
+ import { isObject } from '../object/index.js';
2
+ export const isPropertyInObject = (prop, data, typeGuard) => {
3
+ if (!isObject(data)) {
4
+ return false;
5
+ }
6
+ if (!(prop in data)) {
7
+ return false;
8
+ }
9
+ if (typeGuard && !typeGuard(data[prop])) {
10
+ return false;
11
+ }
12
+ return true;
13
+ };
@@ -0,0 +1 @@
1
+ export declare const isString: (data?: unknown) => data is string;
@@ -0,0 +1 @@
1
+ export const isString = (data) => typeof data === 'string';
@@ -0,0 +1 @@
1
+ export declare const isType: <T>(data: unknown, valid: readonly T[]) => data is T;
@@ -0,0 +1,6 @@
1
+ export const isType = (data, valid) => {
2
+ if (!valid.includes(data)) {
3
+ return false;
4
+ }
5
+ return true;
6
+ };
@@ -0,0 +1 @@
1
+ export declare const isUndefined: (data?: unknown) => data is undefined;
@@ -0,0 +1 @@
1
+ export const isUndefined = (data) => data === undefined;