hh-contracts 0.0.0 → 0.0.2
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.
- package/build/constants/navigation-item-type.constant.js +2 -2
- package/build/dto/app-menu/app-menu-base.schema.js +8 -0
- package/build/dto/app-menu/get.query.js +2 -2
- package/build/models/index.js +1 -1
- package/build/models/navigation-item.schemas.js +21 -0
- package/constants/icon-keys.constant.ts +1 -1
- package/constants/navigation-item-type.constant.ts +2 -2
- package/constants/route-component-keys.constants.ts +1 -1
- package/dto/app-menu/app-menu-base.schema.ts +8 -0
- package/dto/app-menu/get.query.ts +2 -2
- package/models/index.ts +1 -1
- package/models/navigation-item.schemas.ts +23 -0
- package/package.json +1 -1
- package/build/models/app-menu-item.schema.js +0 -19
- package/models/app-menu-item.schema.ts +0 -21
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.
|
|
3
|
+
exports.NavigationItemTypes = void 0;
|
|
4
|
+
exports.NavigationItemTypes = {
|
|
5
5
|
section: 'section',
|
|
6
6
|
group: 'group',
|
|
7
7
|
link: 'link',
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AppMenuBaseSchema = void 0;
|
|
4
|
+
const models_1 = require("../../models");
|
|
5
|
+
exports.AppMenuBaseSchema = models_1.NavigationItemEntityWithChildrenSchema.omit({
|
|
6
|
+
parentId: true,
|
|
7
|
+
order: true,
|
|
8
|
+
}).partial({ description: true, link: true, iconKey: true, routeComponentKey: true });
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.GetAppMenuQuery = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
const
|
|
5
|
+
const app_menu_base_schema_1 = require("./app-menu-base.schema");
|
|
6
6
|
const GetAppMenuQueryRequestSchema = zod_1.z.object({
|
|
7
7
|
userUuid: zod_1.z.string().uuid(),
|
|
8
8
|
});
|
|
9
9
|
const GetAppMenuQueryResponseSchema = zod_1.z.object({
|
|
10
|
-
appMenu: zod_1.z.array(
|
|
10
|
+
appMenu: zod_1.z.array(app_menu_base_schema_1.AppMenuBaseSchema),
|
|
11
11
|
});
|
|
12
12
|
var GetAppMenuQuery;
|
|
13
13
|
(function (GetAppMenuQuery) {
|
package/build/models/index.js
CHANGED
|
@@ -14,4 +14,4 @@ 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("./
|
|
17
|
+
__exportStar(require("./navigation-item.schemas"), exports);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NavigationItemEntityWithChildrenSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const constants_1 = require("../constants");
|
|
6
|
+
const constants_2 = require("../constants");
|
|
7
|
+
const NavigationItemEntitySchema = zod_1.z.object({
|
|
8
|
+
id: zod_1.z.number().int().positive(),
|
|
9
|
+
parentId: zod_1.z.nullable(zod_1.z.number().int().positive()),
|
|
10
|
+
label: zod_1.z.string().min(1),
|
|
11
|
+
description: zod_1.z.nullable(zod_1.z.string().min(1)),
|
|
12
|
+
iconKey: zod_1.z.nullable(zod_1.z.nativeEnum(constants_1.IconKeys)),
|
|
13
|
+
link: zod_1.z.nullable(zod_1.z.string().min(1)),
|
|
14
|
+
routeComponentKey: zod_1.z.nullable(zod_1.z.nativeEnum(constants_1.RouteComponentKeys)),
|
|
15
|
+
type: zod_1.z.nativeEnum(constants_2.NavigationItemTypes),
|
|
16
|
+
disabled: zod_1.z.boolean().default(false),
|
|
17
|
+
order: zod_1.z.number().int().positive(),
|
|
18
|
+
});
|
|
19
|
+
exports.NavigationItemEntityWithChildrenSchema = NavigationItemEntitySchema.extend({
|
|
20
|
+
children: zod_1.z.array(NavigationItemEntitySchema).optional(),
|
|
21
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export const
|
|
1
|
+
export const NavigationItemTypes = {
|
|
2
2
|
section: 'section',
|
|
3
3
|
group: 'group',
|
|
4
4
|
link: 'link',
|
|
5
5
|
} as const;
|
|
6
|
-
export type TNavigationItemType = (typeof
|
|
6
|
+
export type TNavigationItemType = (typeof NavigationItemTypes)[keyof typeof NavigationItemTypes];
|
|
@@ -2,4 +2,4 @@ export const RouteComponentKeys = {
|
|
|
2
2
|
NavigationItem: 'navigation-item',
|
|
3
3
|
} as const;
|
|
4
4
|
|
|
5
|
-
export type
|
|
5
|
+
export type TRouteComponentKey = (typeof RouteComponentKeys)[keyof typeof RouteComponentKeys];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { NavigationItemEntityWithChildrenSchema } from '../../models';
|
|
3
|
+
|
|
4
|
+
export const AppMenuBaseSchema = NavigationItemEntityWithChildrenSchema.omit({
|
|
5
|
+
parentId: true,
|
|
6
|
+
order: true,
|
|
7
|
+
}).partial({ description: true, link: true, iconKey: true, routeComponentKey: true });
|
|
8
|
+
export type TAppMenuBase = z.infer<typeof AppMenuBaseSchema>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
2
|
+
import { AppMenuBaseSchema } from './app-menu-base.schema';
|
|
3
3
|
|
|
4
4
|
const GetAppMenuQueryRequestSchema = z.object({
|
|
5
5
|
userUuid: z.string().uuid(),
|
|
6
6
|
});
|
|
7
7
|
const GetAppMenuQueryResponseSchema = z.object({
|
|
8
|
-
appMenu: z.array(
|
|
8
|
+
appMenu: z.array(AppMenuBaseSchema),
|
|
9
9
|
});
|
|
10
10
|
|
|
11
11
|
export namespace GetAppMenuQuery {
|
package/models/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './navigation-item.schemas';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { IconKeys, RouteComponentKeys } from '../constants';
|
|
3
|
+
import { NavigationItemTypes } from '../constants';
|
|
4
|
+
|
|
5
|
+
const NavigationItemEntitySchema = z.object({
|
|
6
|
+
id: z.number().int().positive(),
|
|
7
|
+
parentId: z.nullable(z.number().int().positive()),
|
|
8
|
+
label: z.string().min(1),
|
|
9
|
+
description: z.nullable(z.string().min(1)),
|
|
10
|
+
iconKey: z.nullable(z.nativeEnum(IconKeys)),
|
|
11
|
+
link: z.nullable(z.string().min(1)),
|
|
12
|
+
routeComponentKey: z.nullable(z.nativeEnum(RouteComponentKeys)),
|
|
13
|
+
type: z.nativeEnum(NavigationItemTypes),
|
|
14
|
+
disabled: z.boolean().default(false),
|
|
15
|
+
order: z.number().int().positive(),
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export const NavigationItemEntityWithChildrenSchema = NavigationItemEntitySchema.extend({
|
|
19
|
+
children: z.array(NavigationItemEntitySchema).optional(),
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export type TNavigationItemEntity = z.infer<typeof NavigationItemEntitySchema>;
|
|
23
|
+
export type TNavigationItemWithChildren = z.infer<typeof NavigationItemEntityWithChildrenSchema>;
|
package/package.json
CHANGED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AppMenuItemWithChildrenSchema = exports.AppMenuItemSchema = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const constants_1 = require("../constants");
|
|
6
|
-
const constants_2 = require("../constants");
|
|
7
|
-
exports.AppMenuItemSchema = zod_1.z.object({
|
|
8
|
-
id: zod_1.z.number().int().positive(),
|
|
9
|
-
label: zod_1.z.string().min(1),
|
|
10
|
-
icon: zod_1.z.nullable(zod_1.z.nativeEnum(constants_1.IconKeys)),
|
|
11
|
-
link: zod_1.z.nullable(zod_1.z.string().min(1)),
|
|
12
|
-
routeComponent: zod_1.z.nullable(zod_1.z.nativeEnum(constants_1.RouteComponentKeys)),
|
|
13
|
-
type: zod_1.z.nativeEnum(constants_2.NavigationItemType),
|
|
14
|
-
disabled: zod_1.z.boolean().default(false),
|
|
15
|
-
tooltip: zod_1.z.nullable(zod_1.z.string().min(1)),
|
|
16
|
-
});
|
|
17
|
-
exports.AppMenuItemWithChildrenSchema = exports.AppMenuItemSchema.extend({
|
|
18
|
-
children: zod_1.z.array(exports.AppMenuItemSchema).optional(),
|
|
19
|
-
});
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { IconKeys, RouteComponentKeys } from '../constants';
|
|
3
|
-
import { NavigationItemType } from '../constants';
|
|
4
|
-
|
|
5
|
-
export const AppMenuItemSchema = z.object({
|
|
6
|
-
id: z.number().int().positive(),
|
|
7
|
-
label: z.string().min(1),
|
|
8
|
-
icon: z.nullable(z.nativeEnum(IconKeys)),
|
|
9
|
-
link: z.nullable(z.string().min(1)),
|
|
10
|
-
routeComponent: z.nullable(z.nativeEnum(RouteComponentKeys)),
|
|
11
|
-
type: z.nativeEnum(NavigationItemType),
|
|
12
|
-
disabled: z.boolean().default(false),
|
|
13
|
-
tooltip: z.nullable(z.string().min(1)),
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
export const AppMenuItemWithChildrenSchema = AppMenuItemSchema.extend({
|
|
17
|
-
children: z.array(AppMenuItemSchema).optional(),
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
export type TAppMenuItem = z.infer<typeof AppMenuItemSchema>;
|
|
21
|
-
export type TAppMenuItemWithChildren = z.infer<typeof AppMenuItemWithChildrenSchema>;
|