hh-contracts 0.0.72 → 0.0.73
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/app-menu/get.query.ts +4 -4
- package/build/app-menu/get.query.js +39 -6
- package/build/common/constants/app-statuses.constant.js +25 -0
- package/build/common/constants/icon-keys.constant.js +2 -1
- package/build/common/constants/index.js +5 -2
- package/build/common/constants/kind-of-app.constant.js +8 -0
- package/build/common/constants/slug.constant.js +8 -0
- package/build/common/constants/zod-error-mapping.constant.js +41 -17
- package/build/common/index.js +1 -1
- package/build/common/models/common-query-params.schema.js +4 -1
- package/build/common/models/icon-key.schema.js +35 -2
- package/build/common/models/index.js +2 -1
- package/build/common/models/info.schema.js +37 -4
- package/build/common/models/language-keys.schema.js +35 -2
- package/build/common/models/navigation-item.schemas.js +47 -14
- package/build/common/models/order.schema.js +37 -4
- package/build/common/models/pagination.schema.js +41 -8
- package/build/common/models/search.schema.js +36 -3
- package/build/common/models/slug.schema.js +45 -0
- package/build/common/models/timestamp.schemas.js +38 -5
- package/build/common/models/translations.schemas.js +41 -8
- package/build/common/models/uuid-array.schema.js +38 -0
- package/build/common/transforms/index.js +1 -16
- package/build/common/transforms/navigation-item.transform.js +26 -16
- package/build/common/types/index.js +0 -1
- package/build/companies/company.models.js +45 -0
- package/build/companies/index.js +17 -0
- package/build/hotels/contracts/find-hotel-theme.contract.js +13 -0
- package/build/hotels/contracts/index.js +1 -1
- package/build/hotels/hotel.model.js +49 -0
- package/build/hotels/index.js +1 -0
- package/build/hotels/themes/theme.models.js +40 -7
- package/build/index.js +2 -0
- package/build/permissions/contracts/find-all-permission.contract.js +35 -2
- package/build/permissions/contracts/find-many-permission.contract.js +41 -5
- package/build/permissions/permission.models.js +41 -8
- package/build/roles/contracts/find-many-roles.contract.js +40 -6
- package/build/roles/role.models.js +44 -11
- package/build/tenants/contracts/index.js +17 -0
- package/build/tenants/contracts/resolve-tenant.contract.js +29 -0
- package/build/tenants/index.js +19 -0
- package/build/tenants/tenant.model.js +51 -0
- package/build/tenants/tenants.api.js +11 -0
- package/build/translate/contracts/batch-translate.contract.js +40 -7
- package/common/constants/app-errors.constant.ts +1 -3
- package/common/constants/app-statuses.constant.ts +26 -0
- package/common/constants/icon-keys.constant.ts +1 -1
- package/common/constants/index.ts +5 -2
- package/common/constants/kind-of-app.constant.ts +7 -0
- package/common/constants/slug.constant.ts +7 -0
- package/common/constants/zod-error-mapping.constant.ts +9 -18
- package/common/index.ts +1 -1
- package/common/models/common-query-params.schema.ts +5 -3
- package/common/models/icon-key.schema.ts +3 -3
- package/common/models/index.ts +2 -1
- package/common/models/info.schema.ts +1 -1
- package/common/models/language-keys.schema.ts +1 -1
- package/common/models/navigation-item.schemas.ts +4 -4
- package/common/models/order.schema.ts +3 -3
- package/common/models/pagination.schema.ts +1 -1
- package/common/models/search.schema.ts +1 -1
- package/common/models/slug.schema.ts +10 -0
- package/common/models/timestamp.schemas.ts +1 -1
- package/common/models/translations.schemas.ts +1 -1
- package/common/models/uuid-array.schema.ts +3 -0
- package/common/transforms/index.ts +1 -1
- package/common/transforms/navigation-item.transform.ts +26 -26
- package/common/types/index.ts +0 -1
- package/companies/company.models.ts +11 -0
- package/companies/index.ts +1 -0
- package/hotels/contracts/{find-theme.contract.ts → find-hotel-theme.contract.ts} +2 -2
- package/hotels/contracts/index.ts +1 -1
- package/hotels/hotel.model.ts +15 -0
- package/hotels/index.ts +1 -0
- package/hotels/themes/theme.models.ts +3 -3
- package/index.ts +2 -0
- package/package.json +2 -2
- package/permissions/contracts/create-permission.contract.ts +1 -1
- package/permissions/contracts/delete-permission.contract.ts +1 -1
- package/permissions/contracts/find-all-permission.contract.ts +2 -2
- package/permissions/contracts/find-many-permission.contract.ts +6 -5
- package/permissions/contracts/find-permission.contract.ts +1 -1
- package/permissions/contracts/update-permission.contract.ts +1 -1
- package/permissions/permission.models.ts +5 -5
- package/roles/contracts/create-role.contract.ts +1 -1
- package/roles/contracts/delete-role.contract.ts +1 -1
- package/roles/contracts/find-many-roles.contract.ts +5 -4
- package/roles/contracts/find-role.contract.ts +1 -1
- package/roles/contracts/update-role.contract.ts +1 -1
- package/roles/role.models.ts +5 -5
- package/tenants/contracts/index.ts +1 -0
- package/tenants/contracts/resolve-tenant.contract.ts +32 -0
- package/tenants/index.ts +3 -0
- package/tenants/tenant.model.ts +19 -0
- package/tenants/tenants.api.ts +10 -0
- package/translate/contracts/batch-translate.contract.ts +1 -1
- package/build/common/models/json.schema.js +0 -6
- package/build/common/types/zod.type.js +0 -2
- package/build/hotels/contracts/find-theme.contract.js +0 -13
- package/common/models/json.schema.ts +0 -8
- package/common/types/zod.type.ts +0 -2
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { NavigationItemEntityBaseSchema, NavigationItemEntitySchema } from '../models';
|
|
3
|
-
import { TDeepOptionalize } from '../types';
|
|
1
|
+
// import * as z from 'zod';
|
|
2
|
+
// import { NavigationItemEntityBaseSchema, NavigationItemEntitySchema } from '../models';
|
|
3
|
+
// import { TDeepOptionalize } from '../types';
|
|
4
4
|
|
|
5
|
-
const NavigationItemBase = NavigationItemEntityBaseSchema.transform(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
);
|
|
5
|
+
// const NavigationItemBase = NavigationItemEntityBaseSchema.transform(
|
|
6
|
+
// ({ parentId, description, iconKey, link, routeComponentKey, disabled, order, ...rest }) => ({
|
|
7
|
+
// ...rest,
|
|
8
|
+
// description: description || undefined,
|
|
9
|
+
// iconKey: iconKey || undefined,
|
|
10
|
+
// link: link || undefined,
|
|
11
|
+
// routeComponentKey: routeComponentKey || undefined,
|
|
12
|
+
// disabled: disabled === null ? undefined : disabled,
|
|
13
|
+
// }),
|
|
14
|
+
// );
|
|
15
15
|
|
|
16
|
-
type TInput = z.input<typeof NavigationItemEntityBaseSchema> & {
|
|
17
|
-
|
|
18
|
-
};
|
|
19
|
-
type TOutput = z.output<typeof NavigationItemBase> & {
|
|
20
|
-
|
|
21
|
-
};
|
|
16
|
+
// type TInput = z.input<typeof NavigationItemEntityBaseSchema> & {
|
|
17
|
+
// children?: TInput[];
|
|
18
|
+
// };
|
|
19
|
+
// type TOutput = z.output<typeof NavigationItemBase> & {
|
|
20
|
+
// children?: TOutput[];
|
|
21
|
+
// };
|
|
22
22
|
|
|
23
|
-
export const NavigationItem
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
);
|
|
29
|
-
export type TNavigationItem = TDeepOptionalize<z.infer<typeof NavigationItem>>;
|
|
23
|
+
// export const NavigationItem = z.lazy(() =>
|
|
24
|
+
// NavigationItemEntitySchema.transform(({ children, ...rest }) => ({
|
|
25
|
+
// ...NavigationItemBase.parse(rest),
|
|
26
|
+
// children: children?.length ? children.map(child => NavigationItem.parse(child)) : undefined,
|
|
27
|
+
// })),
|
|
28
|
+
// );
|
|
29
|
+
// export type TNavigationItem = TDeepOptionalize<z.infer<typeof NavigationItem>>;
|
package/common/types/index.ts
CHANGED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
import { TimestampSchema } from '../common';
|
|
3
|
+
|
|
4
|
+
export const CompanyPersistedSchema = z
|
|
5
|
+
.object({
|
|
6
|
+
id: z.uuid(),
|
|
7
|
+
inn: z.string(),
|
|
8
|
+
isActive: z.boolean().default(true),
|
|
9
|
+
})
|
|
10
|
+
.extend(TimestampSchema.shape);
|
|
11
|
+
export type TCompanyPersisted = z.infer<typeof CompanyPersistedSchema>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './company.models';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as z from 'zod';
|
|
2
2
|
import { HTTP_METHODS } from '../../common';
|
|
3
3
|
import { ThemePersistedSchema } from '../themes/theme.models';
|
|
4
4
|
import { HOTELS_API, HOTELS_CONTROLLER } from '../hotels.api';
|
|
5
5
|
|
|
6
|
-
export namespace
|
|
6
|
+
export namespace FindHotelThemeContract {
|
|
7
7
|
export const getUrl = HOTELS_API.findTheme;
|
|
8
8
|
export const endpoint = HOTELS_CONTROLLER.endpoints.findTheme;
|
|
9
9
|
export const httpMethod = HTTP_METHODS.get;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './find-theme.contract';
|
|
1
|
+
export * from './find-hotel-theme.contract';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
import { LANGUAGE_KEYS, TimestampSchema, AppStatuses, SlugSchema } from '../common';
|
|
3
|
+
|
|
4
|
+
export const HotelPersistedSchema = z
|
|
5
|
+
.object({
|
|
6
|
+
id: z.uuid(),
|
|
7
|
+
companyId: z.uuid(),
|
|
8
|
+
slug: SlugSchema,
|
|
9
|
+
status: z.enum(AppStatuses.HOTEL_VALUES),
|
|
10
|
+
hasServices: z.boolean(),
|
|
11
|
+
defaultLang: z.enum(LANGUAGE_KEYS),
|
|
12
|
+
availableLangs: z.array(z.enum(LANGUAGE_KEYS)),
|
|
13
|
+
})
|
|
14
|
+
.extend(TimestampSchema.shape);
|
|
15
|
+
export type THotelPersisted = z.infer<typeof HotelPersistedSchema>;
|
package/hotels/index.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as z from 'zod';
|
|
2
2
|
import { ACCENT_COLORS_VALUES, FONT_FAMILIES_VALUES, RADIUS_VALUES } from './constants';
|
|
3
3
|
import { TimestampSchema } from '../../common';
|
|
4
4
|
|
|
5
5
|
export const ThemePersistedSchema = z
|
|
6
6
|
.object({
|
|
7
|
-
hotelId: z.
|
|
7
|
+
hotelId: z.uuid(),
|
|
8
8
|
fontFamily: z.enum(FONT_FAMILIES_VALUES),
|
|
9
9
|
accentColor: z.enum(ACCENT_COLORS_VALUES),
|
|
10
10
|
radius: z.enum(RADIUS_VALUES),
|
|
11
11
|
})
|
|
12
|
-
.
|
|
12
|
+
.extend(TimestampSchema.shape);
|
|
13
13
|
export type TThemePersisted = z.infer<typeof ThemePersistedSchema>;
|
package/index.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hh-contracts",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.73",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -10,6 +10,6 @@
|
|
|
10
10
|
"author": "",
|
|
11
11
|
"license": "ISC",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"zod": "^
|
|
13
|
+
"zod": "^4.0.17"
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { HTTP_METHODS
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
import { HTTP_METHODS } from '../../common';
|
|
3
3
|
import { PermissionListItemSchema } from '../permission.models';
|
|
4
4
|
import { PERMISSIONS_API, PERMISSIONS_CONTROLLER } from '../permissions.api';
|
|
5
5
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as z from 'zod';
|
|
2
2
|
import { HTTP_METHODS, CommonQueryParamsSchema, PaginationResponseSchema } from '../../common';
|
|
3
3
|
import { PermissionListItemSchema } from '../permission.models';
|
|
4
4
|
import { PERMISSIONS_API, PERMISSIONS_CONTROLLER } from '../permissions.api';
|
|
@@ -10,15 +10,16 @@ const BaseQuerySchema = PermissionListItemSchema.pick({
|
|
|
10
10
|
|
|
11
11
|
const OrderBySchema = PermissionListItemSchema.keyof();
|
|
12
12
|
|
|
13
|
-
const FindManyPermissionsContractRequestSchema = BaseQuerySchema.
|
|
14
|
-
CommonQueryParamsSchema,
|
|
15
|
-
|
|
13
|
+
const FindManyPermissionsContractRequestSchema = BaseQuerySchema.extend({
|
|
14
|
+
...CommonQueryParamsSchema.shape,
|
|
15
|
+
orderBy: OrderBySchema.optional(),
|
|
16
|
+
});
|
|
16
17
|
|
|
17
18
|
const FindManyPermissionsContractResponseSchema = z
|
|
18
19
|
.object({
|
|
19
20
|
permissions: z.array(PermissionListItemSchema),
|
|
20
21
|
})
|
|
21
|
-
.
|
|
22
|
+
.extend(PaginationResponseSchema.shape);
|
|
22
23
|
|
|
23
24
|
export namespace FindManyPermissionsContract {
|
|
24
25
|
export const getUrl = PERMISSIONS_API.findMany;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as z from 'zod';
|
|
2
2
|
import { AppAbility, TimestampSchema, TranslationsSchema } from '../common';
|
|
3
3
|
|
|
4
4
|
export const JsonConditionsSchema = z
|
|
@@ -21,13 +21,13 @@ export const JsonConditionsSchema = z
|
|
|
21
21
|
|
|
22
22
|
export const PermissionPersistedSchema = z
|
|
23
23
|
.object({
|
|
24
|
-
id: z.
|
|
24
|
+
id: z.uuid(),
|
|
25
25
|
|
|
26
|
-
action: z.
|
|
27
|
-
subject: z.
|
|
26
|
+
action: z.enum(AppAbility.ACTION_VALUES),
|
|
27
|
+
subject: z.enum(AppAbility.SUBJECT_VALUES),
|
|
28
28
|
conditions: JsonConditionsSchema,
|
|
29
29
|
})
|
|
30
|
-
.
|
|
30
|
+
.extend(TimestampSchema.shape);
|
|
31
31
|
|
|
32
32
|
export type TPermissionPersisted = z.infer<typeof PermissionPersistedSchema>;
|
|
33
33
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as z from 'zod';
|
|
2
2
|
import { HTTP_METHODS, CommonQueryParamsSchema, PaginationResponseSchema } from '../../common';
|
|
3
3
|
import { RoleListItemSchema } from '../role.models';
|
|
4
4
|
import { ROLES_API, ROLES_CONTROLLER } from '../roles.api';
|
|
@@ -7,7 +7,7 @@ const BaseQuerySchema = RoleListItemSchema.pick({
|
|
|
7
7
|
type: true,
|
|
8
8
|
isActive: true,
|
|
9
9
|
})
|
|
10
|
-
.extend({ permissionIds: z.array(z.
|
|
10
|
+
.extend({ permissionIds: z.array(z.uuid()).optional() })
|
|
11
11
|
.partial();
|
|
12
12
|
|
|
13
13
|
const OrderBySchema = RoleListItemSchema.omit({
|
|
@@ -16,7 +16,8 @@ const OrderBySchema = RoleListItemSchema.omit({
|
|
|
16
16
|
description: true,
|
|
17
17
|
}).keyof();
|
|
18
18
|
|
|
19
|
-
const FindManyRolesContractRequestSchema = BaseQuerySchema.
|
|
19
|
+
const FindManyRolesContractRequestSchema = BaseQuerySchema.extend({
|
|
20
|
+
...CommonQueryParamsSchema.shape,
|
|
20
21
|
orderBy: OrderBySchema.optional(),
|
|
21
22
|
});
|
|
22
23
|
|
|
@@ -24,7 +25,7 @@ const FindManyRolesContractResponseSchema = z
|
|
|
24
25
|
.object({
|
|
25
26
|
roles: z.array(RoleListItemSchema),
|
|
26
27
|
})
|
|
27
|
-
.
|
|
28
|
+
.extend(PaginationResponseSchema.shape);
|
|
28
29
|
|
|
29
30
|
export namespace FindManyRolesContract {
|
|
30
31
|
export const getUrl = ROLES_API.findMany;
|
package/roles/role.models.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ROLE_TYPE_VALUES, TimestampSchema, TranslationsSchema } from '../common';
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
import { ROLE_TYPE_VALUES, TimestampSchema, TranslationsSchema, UuidArraySchema } from '../common';
|
|
3
3
|
import { PermissionListItemSchema } from '../permissions';
|
|
4
4
|
|
|
5
5
|
export const RolePersistedSchema = z
|
|
6
6
|
.object({
|
|
7
|
-
id: z.
|
|
7
|
+
id: z.uuid(),
|
|
8
8
|
type: z.enum(ROLE_TYPE_VALUES),
|
|
9
9
|
isActive: z.boolean().default(true),
|
|
10
10
|
isDefault: z.boolean().default(false),
|
|
11
11
|
})
|
|
12
|
-
.
|
|
12
|
+
.extend(TimestampSchema.shape);
|
|
13
13
|
export type TRolePersisted = z.infer<typeof RolePersistedSchema>;
|
|
14
14
|
|
|
15
15
|
export const RoleWithPermissionsSchema = RolePersistedSchema.extend({
|
|
16
|
-
permissionIds:
|
|
16
|
+
permissionIds: UuidArraySchema.optional(),
|
|
17
17
|
});
|
|
18
18
|
export type TRoleWithPermissions = z.infer<typeof RoleWithPermissionsSchema>;
|
|
19
19
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './resolve-tenant.contract';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
import { HTTP_METHODS } from '../../common';
|
|
3
|
+
import { TENANTS_API, TENANTS_CONTROLLER } from '../tenants.api';
|
|
4
|
+
import { CanonicalSchema, TenantPersistedSchema } from '../tenant.model';
|
|
5
|
+
import { HotelPersistedSchema } from '../../hotels';
|
|
6
|
+
|
|
7
|
+
const ResolveTenantRequestSchema = TenantPersistedSchema.pick({ host: true });
|
|
8
|
+
const ResolveTenantResponseSchema = TenantPersistedSchema.omit({
|
|
9
|
+
id: true,
|
|
10
|
+
createdAt: true,
|
|
11
|
+
updatedAt: true,
|
|
12
|
+
}).extend({
|
|
13
|
+
...HotelPersistedSchema.pick({
|
|
14
|
+
slug: true,
|
|
15
|
+
hasServices: true,
|
|
16
|
+
defaultLang: true,
|
|
17
|
+
availableLangs: true,
|
|
18
|
+
}).shape,
|
|
19
|
+
canonical: CanonicalSchema.nullable().optional(),
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export namespace ResolveTenantContract {
|
|
23
|
+
export const getUrl = TENANTS_API.resolve;
|
|
24
|
+
export const endpoint = TENANTS_CONTROLLER.endpoints.resolve;
|
|
25
|
+
export const httpMethod = HTTP_METHODS.get;
|
|
26
|
+
|
|
27
|
+
export const RequestSchema = ResolveTenantRequestSchema;
|
|
28
|
+
export type TRequest = z.infer<typeof RequestSchema>;
|
|
29
|
+
|
|
30
|
+
export const ResponseSchema = ResolveTenantResponseSchema;
|
|
31
|
+
export type TResponse = z.infer<typeof ResponseSchema>;
|
|
32
|
+
}
|
package/tenants/index.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
import { KIND_OF_APP_VALUES, TimestampSchema } from '../common';
|
|
3
|
+
|
|
4
|
+
export const TenantPersistedSchema = z
|
|
5
|
+
.object({
|
|
6
|
+
id: z.uuid(),
|
|
7
|
+
hotelId: z.uuid(),
|
|
8
|
+
host: z.string().trim().toLowerCase().min(3),
|
|
9
|
+
kindOfApp: z.enum(KIND_OF_APP_VALUES),
|
|
10
|
+
isPrimary: z.boolean(),
|
|
11
|
+
})
|
|
12
|
+
.extend(TimestampSchema.shape);
|
|
13
|
+
export type TTenantPersisted = z.infer<typeof TenantPersistedSchema>;
|
|
14
|
+
|
|
15
|
+
export const CanonicalSchema = z.object({
|
|
16
|
+
site: z.string().nullable(),
|
|
17
|
+
services: z.string().nullable(),
|
|
18
|
+
});
|
|
19
|
+
export type TCanonical = z.infer<typeof CanonicalSchema>;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.JsonSchema = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const literalSchema = zod_1.z.union([zod_1.z.string(), zod_1.z.number(), zod_1.z.boolean(), zod_1.z.null()]);
|
|
6
|
-
exports.JsonSchema = zod_1.z.lazy(() => zod_1.z.union([literalSchema, zod_1.z.array(exports.JsonSchema), zod_1.z.record(exports.JsonSchema)]));
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FindThemeContract = void 0;
|
|
4
|
-
const common_1 = require("../../common");
|
|
5
|
-
const theme_models_1 = require("../themes/theme.models");
|
|
6
|
-
const hotels_api_1 = require("../hotels.api");
|
|
7
|
-
var FindThemeContract;
|
|
8
|
-
(function (FindThemeContract) {
|
|
9
|
-
FindThemeContract.getUrl = hotels_api_1.HOTELS_API.findTheme;
|
|
10
|
-
FindThemeContract.endpoint = hotels_api_1.HOTELS_CONTROLLER.endpoints.findTheme;
|
|
11
|
-
FindThemeContract.httpMethod = common_1.HTTP_METHODS.get;
|
|
12
|
-
FindThemeContract.ResponseSchema = theme_models_1.ThemePersistedSchema;
|
|
13
|
-
})(FindThemeContract || (exports.FindThemeContract = FindThemeContract = {}));
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
|
|
3
|
-
const literalSchema = z.union([z.string(), z.number(), z.boolean(), z.null()]);
|
|
4
|
-
type Literal = z.infer<typeof literalSchema>;
|
|
5
|
-
export type Json = Literal | { [key: string]: Json } | Json[];
|
|
6
|
-
export const JsonSchema: z.ZodType<Json> = z.lazy(() =>
|
|
7
|
-
z.union([literalSchema, z.array(JsonSchema), z.record(JsonSchema)]),
|
|
8
|
-
);
|
package/common/types/zod.type.ts
DELETED