hh-contracts 0.0.28 → 0.0.29

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,20 @@ exports.ICON_KEY = {
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
+ search: 'search',
12
17
  language: 'language',
13
18
  // close: 'close',
14
19
  // check: 'check',
15
20
  // closeFilled: 'closeFilled',
16
21
  logo: 'logo',
17
- housekeeping: 'housekeeping',
18
22
  flagGB: 'flagGB',
19
23
  flagRU: 'flagRU',
20
- radioBase: 'radioBase',
21
- radioChecked: 'radioChecked',
22
24
  };
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CommonQueryParamsSchema = void 0;
4
+ const order_schema_1 = require("./order.schema");
5
+ const pagination_schema_1 = require("./pagination.schema");
6
+ const search_schema_1 = require("./search.schema");
7
+ exports.CommonQueryParamsSchema = order_schema_1.OrderSchema.merge(search_schema_1.SearchSchema).merge(pagination_schema_1.PaginationRequestSchema);
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./common-query-params.schema"), exports);
17
18
  __exportStar(require("./icon-key.schema"), exports);
18
19
  __exportStar(require("./info.schema"), exports);
19
20
  __exportStar(require("./json.schema"), exports);
@@ -4,5 +4,6 @@ exports.OrderSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const order_direction_constant_1 = require("../constants/order-direction.constant");
6
6
  exports.OrderSchema = zod_1.z.object({
7
+ orderBy: zod_1.z.string().optional(),
7
8
  orderDir: zod_1.z.nativeEnum(order_direction_constant_1.ORDER_DIRECTION).optional(),
8
9
  });
@@ -15,10 +15,7 @@ const OrderBySchema = permission_model_1.PermissionSchema.pick({
15
15
  })
16
16
  .keyof()
17
17
  .optional();
18
- const FindManyPermissionsContractRequestSchema = BaseQuerySchema.extend({ orderBy: OrderBySchema })
19
- .merge(common_1.OrderSchema)
20
- .merge(common_1.SearchSchema)
21
- .merge(common_1.PaginationRequestSchema);
18
+ const FindManyPermissionsContractRequestSchema = BaseQuerySchema.merge(common_1.CommonQueryParamsSchema).extend({ orderBy: OrderBySchema });
22
19
  const FindManyPermissionsContractResponseSchema = zod_1.z
23
20
  .object({
24
21
  permissions: zod_1.z.array(permission_model_1.PermissionSchema),
@@ -2,22 +2,23 @@ export const ICON_KEY = {
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
+ search: 'search',
9
14
  language: 'language',
10
15
  // close: 'close',
11
16
  // check: 'check',
12
17
 
13
18
  // closeFilled: 'closeFilled',
14
-
15
19
  logo: 'logo',
16
- housekeeping: 'housekeeping',
17
20
  flagGB: 'flagGB',
18
21
  flagRU: 'flagRU',
19
- radioBase: 'radioBase',
20
- radioChecked: 'radioChecked',
21
22
  } as const;
22
23
 
23
24
  export type TIconKey = (typeof ICON_KEY)[keyof typeof ICON_KEY];
@@ -0,0 +1,7 @@
1
+ import { z } from "zod";
2
+ import { OrderSchema } from "./order.schema";
3
+ import { PaginationRequestSchema } from "./pagination.schema";
4
+ import { SearchSchema } from "./search.schema";
5
+
6
+ export const CommonQueryParamsSchema = OrderSchema.merge(SearchSchema).merge(PaginationRequestSchema);
7
+ export type TCommonQueryParams = z.infer<typeof CommonQueryParamsSchema>;
@@ -1,3 +1,4 @@
1
+ export * from './common-query-params.schema';
1
2
  export * from './icon-key.schema';
2
3
  export * from './info.schema';
3
4
  export * from './json.schema';
@@ -2,5 +2,6 @@ import { z } from 'zod';
2
2
  import { ORDER_DIRECTION } from '../constants/order-direction.constant';
3
3
 
4
4
  export const OrderSchema = z.object({
5
+ orderBy: z.string().optional(),
5
6
  orderDir: z.nativeEnum(ORDER_DIRECTION).optional(),
6
7
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hh-contracts",
3
- "version": "0.0.28",
3
+ "version": "0.0.29",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "scripts": {
@@ -1,10 +1,8 @@
1
1
  import { z } from 'zod';
2
2
  import {
3
+ CommonQueryParamsSchema,
3
4
  HTTP_METHOD,
4
- OrderSchema,
5
- PaginationRequestSchema,
6
5
  PaginationResponseSchema,
7
- SearchSchema,
8
6
  } from '../../common';
9
7
  import { PermissionSchema } from '../permission.model';
10
8
  import { PERMISSIONS_API, PERMISSIONS_CONTROLLER } from '../permissions.api';
@@ -19,10 +17,7 @@ const OrderBySchema = PermissionSchema.pick({
19
17
  })
20
18
  .keyof()
21
19
  .optional();
22
- const FindManyPermissionsContractRequestSchema = BaseQuerySchema.extend({ orderBy: OrderBySchema })
23
- .merge(OrderSchema)
24
- .merge(SearchSchema)
25
- .merge(PaginationRequestSchema);
20
+ const FindManyPermissionsContractRequestSchema = BaseQuerySchema.merge(CommonQueryParamsSchema).extend({ orderBy: OrderBySchema });
26
21
 
27
22
  const FindManyPermissionsContractResponseSchema = z
28
23
  .object({