hh-contracts 0.0.56 → 0.0.58

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,18 +5,27 @@ exports.ICON_KEYS = {
5
5
  // eye: 'eye',
6
6
  // eyeSlash: 'eyeSlash',
7
7
  chevronDown: 'chevronDown',
8
+ chevronLeft: 'chevronLeft',
9
+ chevronRight: 'chevronRight',
10
+ arrowDown: 'arrowDown',
11
+ arrowUp: 'arrowUp',
8
12
  moon: 'moon',
9
13
  sun: 'sun',
10
14
  // user: 'user',
11
15
  menu: 'menu',
16
+ ellipsis: 'ellipsis',
17
+ filter: 'filter',
18
+ resetFilter: 'resetFilter',
19
+ sorting: 'sorting',
20
+ create: 'create',
21
+ edit: 'edit',
22
+ delete: 'delete',
23
+ search: 'search',
12
24
  language: 'language',
13
25
  // close: 'close',
14
26
  // check: 'check',
15
27
  // closeFilled: 'closeFilled',
16
28
  logo: 'logo',
17
- housekeeping: 'housekeeping',
18
29
  flagGB: 'flagGB',
19
30
  flagRU: 'flagRU',
20
- radioBase: 'radioBase',
21
- radioChecked: 'radioChecked',
22
31
  };
@@ -19,7 +19,7 @@ __exportStar(require("./app-errors.constant"), exports);
19
19
  __exportStar(require("./locales.constant"), exports);
20
20
  __exportStar(require("./default-pagination-config.constant"), exports);
21
21
  __exportStar(require("./http-method.constant"), exports);
22
- __exportStar(require("./icon-key.constant"), exports);
22
+ __exportStar(require("./icon-keys.constant"), exports);
23
23
  __exportStar(require("./entity.constant"), exports);
24
24
  __exportStar(require("./navigation-item-type.constant"), exports);
25
25
  __exportStar(require("./order-direction.constant"), exports);
@@ -1,19 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.LANGUAGE_KEYS = exports.LANGUAGES = void 0;
4
- const icon_key_constant_1 = require("./icon-key.constant");
4
+ const icon_keys_constant_1 = require("./icon-keys.constant");
5
5
  exports.LANGUAGES = {
6
6
  en: {
7
7
  value: 'en',
8
8
  label: 'English',
9
- flag: icon_key_constant_1.ICON_KEYS.flagGB,
9
+ flag: icon_keys_constant_1.ICON_KEYS.flagGB,
10
10
  locale: 'en-US',
11
11
  postgressLocale: 'en_US',
12
12
  },
13
13
  ru: {
14
14
  value: 'ru',
15
15
  label: 'Русский',
16
- flag: icon_key_constant_1.ICON_KEYS.flagRU,
16
+ flag: icon_keys_constant_1.ICON_KEYS.flagRU,
17
17
  locale: 'ru-RU',
18
18
  postgressLocale: 'ru_RU',
19
19
  },
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TranslationsSchema = exports.TranslationsArraySchema = exports.TranslationItemSchema = exports.TranslationPersistedSchema = void 0;
4
4
  const zod_1 = require("zod");
5
+ // import { z } from 'zod/v4';
5
6
  const language_keys_schema_1 = require("./language-keys.schema");
6
7
  const translatable_field_constant_1 = require("../constants/translatable-field.constant");
7
8
  const constants_1 = require("../constants");
@@ -19,13 +20,15 @@ exports.TranslationItemSchema = exports.TranslationPersistedSchema.omit({
19
20
  });
20
21
  exports.TranslationsArraySchema = zod_1.z
21
22
  .array(exports.TranslationItemSchema)
22
- .min(1, 'errors.validation.atLeastOneTranslationRequired')
23
+ .refine(items => items.length > 0, {
24
+ params: { translationKey: 'errors.validation.atLeastOneTranslationRequired' },
25
+ })
23
26
  .refine(items => {
24
27
  const langs = items.map(item => item.lang);
25
28
  const uniqueLangs = new Set(langs);
26
29
  return langs.length === uniqueLangs.size;
27
30
  }, {
28
- message: 'errors.validation.duplicateLanguagesNotAllowed',
31
+ params: { translationKey: 'errors.validation.duplicateLanguagesNotAllowed' },
29
32
  });
30
33
  exports.TranslationsSchema = zod_1.z.object({
31
34
  name: exports.TranslationsArraySchema,
@@ -18,7 +18,7 @@ exports.JsonConditionsSchema = zod_1.z
18
18
  catch {
19
19
  return false;
20
20
  }
21
- }, { message: 'errors.validation.invalidJson' });
21
+ }, { params: { translationKey: 'errors.validation.invalidJson' } });
22
22
  exports.PermissionPersistedSchema = zod_1.z
23
23
  .object({
24
24
  id: zod_1.z.string().uuid(),
@@ -2,22 +2,30 @@ export const ICON_KEYS = {
2
2
  // eye: 'eye',
3
3
  // eyeSlash: 'eyeSlash',
4
4
  chevronDown: 'chevronDown',
5
+ chevronLeft: 'chevronLeft',
6
+ chevronRight: 'chevronRight',
7
+ arrowDown: 'arrowDown',
8
+ arrowUp: 'arrowUp',
5
9
  moon: 'moon',
6
10
  sun: 'sun',
7
11
  // user: 'user',
8
12
  menu: 'menu',
13
+ ellipsis: 'ellipsis',
14
+ filter: 'filter',
15
+ resetFilter: 'resetFilter',
16
+ sorting: 'sorting',
17
+ create: 'create',
18
+ edit: 'edit',
19
+ delete: 'delete',
20
+ search: 'search',
9
21
  language: 'language',
10
22
  // close: 'close',
11
23
  // check: 'check',
12
24
 
13
25
  // closeFilled: 'closeFilled',
14
-
15
26
  logo: 'logo',
16
- housekeeping: 'housekeeping',
17
27
  flagGB: 'flagGB',
18
28
  flagRU: 'flagRU',
19
- radioBase: 'radioBase',
20
- radioChecked: 'radioChecked',
21
29
  } as const;
22
30
 
23
31
  export type TIconKey = (typeof ICON_KEYS)[keyof typeof ICON_KEYS];
@@ -3,7 +3,7 @@ export * from './app-errors.constant';
3
3
  export * from './locales.constant';
4
4
  export * from './default-pagination-config.constant';
5
5
  export * from './http-method.constant';
6
- export * from './icon-key.constant';
6
+ export * from './icon-keys.constant';
7
7
  export * from './entity.constant';
8
8
  export * from './navigation-item-type.constant';
9
9
  export * from './order-direction.constant';
@@ -1,4 +1,4 @@
1
- import { ICON_KEYS } from './icon-key.constant';
1
+ import { ICON_KEYS } from './icon-keys.constant';
2
2
 
3
3
  export const LANGUAGES = {
4
4
  en: {
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ // import { z } from 'zod/v4';
2
3
  import { LanguageKeysSchema } from './language-keys.schema';
3
4
  import { TRANSLATABLE_FIELD_VALUES } from '../constants/translatable-field.constant';
4
5
  import { ENTITY_VALUES } from '../constants';
@@ -21,7 +22,9 @@ export type TTranslationItem = z.infer<typeof TranslationItemSchema>;
21
22
 
22
23
  export const TranslationsArraySchema = z
23
24
  .array(TranslationItemSchema)
24
- .min(1, 'errors.validation.atLeastOneTranslationRequired')
25
+ .refine(items => items.length > 0, {
26
+ params: { translationKey: 'errors.validation.atLeastOneTranslationRequired' },
27
+ })
25
28
  .refine(
26
29
  items => {
27
30
  const langs = items.map(item => item.lang);
@@ -29,7 +32,7 @@ export const TranslationsArraySchema = z
29
32
  return langs.length === uniqueLangs.size;
30
33
  },
31
34
  {
32
- message: 'errors.validation.duplicateLanguagesNotAllowed',
35
+ params: { translationKey: 'errors.validation.duplicateLanguagesNotAllowed' },
33
36
  },
34
37
  );
35
38
  export type TTranslationsArray = z.infer<typeof TranslationsArraySchema>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hh-contracts",
3
- "version": "0.0.56",
3
+ "version": "0.0.58",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "scripts": {
@@ -16,7 +16,7 @@ export const JsonConditionsSchema = z
16
16
  return false;
17
17
  }
18
18
  },
19
- { message: 'errors.validation.invalidJson' },
19
+ { params: { translationKey: 'errors.validation.invalidJson' } },
20
20
  );
21
21
 
22
22
  export const PermissionPersistedSchema = z