hh-contracts 0.0.108 → 0.0.110

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.
Files changed (180) hide show
  1. package/build/common/constants/app-statuses.constant.js +6 -0
  2. package/build/common/constants/icon.constants.js +4 -0
  3. package/build/index.js +1 -0
  4. package/build/users/contracts/assign-user-role.contract.js +15 -0
  5. package/build/users/contracts/create-user.contract.js +14 -0
  6. package/build/users/contracts/delete-user.contract.js +46 -0
  7. package/build/users/contracts/find-many-users.contract.js +71 -0
  8. package/build/users/contracts/find-user.contract.js +13 -0
  9. package/build/users/contracts/index.js +23 -0
  10. package/build/users/contracts/replace-user-role-assignments.contract.js +15 -0
  11. package/build/users/contracts/update-user.contract.js +14 -0
  12. package/build/users/index.js +20 -0
  13. package/build/users/user-role-assignments.models.js +107 -0
  14. package/build/users/user.models.js +80 -0
  15. package/build/users/users.api.js +17 -0
  16. package/package.json +15 -3
  17. package/app-menu/get.query.ts +0 -17
  18. package/app-menu/index.ts +0 -1
  19. package/common/constants/app-ability.constant.ts +0 -22
  20. package/common/constants/app-errors.constant.ts +0 -235
  21. package/common/constants/app-statuses.constant.ts +0 -26
  22. package/common/constants/array-splitter.constant.ts +0 -1
  23. package/common/constants/default-pagination-config.constant.ts +0 -5
  24. package/common/constants/domain-name.constant.ts +0 -8
  25. package/common/constants/entity.constant.ts +0 -10
  26. package/common/constants/http-method.constant.ts +0 -9
  27. package/common/constants/icon.constants.ts +0 -85
  28. package/common/constants/index.ts +0 -18
  29. package/common/constants/kind-of-app.constant.ts +0 -7
  30. package/common/constants/locales.constant.ts +0 -26
  31. package/common/constants/navigation-item-type.constant.ts +0 -6
  32. package/common/constants/order-direction.constant.ts +0 -10
  33. package/common/constants/role-types.constant.ts +0 -8
  34. package/common/constants/route-component-key.constants.ts +0 -5
  35. package/common/constants/slug.constant.ts +0 -8
  36. package/common/constants/time-zone.constant.ts +0 -4
  37. package/common/constants/translatable-field.constant.ts +0 -10
  38. package/common/index.ts +0 -5
  39. package/common/models/boolean-query-param.schema.ts +0 -8
  40. package/common/models/common-query-params.schema.ts +0 -10
  41. package/common/models/domain-name.schema.ts +0 -14
  42. package/common/models/icon-key.schema.ts +0 -4
  43. package/common/models/index.ts +0 -15
  44. package/common/models/info.schema.ts +0 -8
  45. package/common/models/language-keys.schema.ts +0 -4
  46. package/common/models/navigation-item.schemas.ts +0 -29
  47. package/common/models/order.schema.ts +0 -7
  48. package/common/models/pagination.schema.ts +0 -18
  49. package/common/models/search.schema.ts +0 -5
  50. package/common/models/slug.schema.ts +0 -14
  51. package/common/models/timestamp.schemas.ts +0 -14
  52. package/common/models/timezone.schema.ts +0 -10
  53. package/common/models/translations.schemas.ts +0 -14
  54. package/common/models/uuid.schemas.ts +0 -9
  55. package/common/types/index.ts +0 -1
  56. package/common/types/optionalized.type.ts +0 -40
  57. package/common/utils/create-api/create-api.ts +0 -28
  58. package/common/utils/create-api/index.ts +0 -2
  59. package/common/utils/create-api/types.ts +0 -34
  60. package/common/utils/index.ts +0 -2
  61. package/common/utils/zod-message-key/index.ts +0 -1
  62. package/common/utils/zod-message-key/types.ts +0 -7
  63. package/common/utils/zod-message-key/zod-message-key.util.ts +0 -31
  64. package/companies/company.models.ts +0 -11
  65. package/companies/index.ts +0 -1
  66. package/hotels/amenities/hotel-amenity.model.ts +0 -10
  67. package/hotels/amenities/index.ts +0 -1
  68. package/hotels/constants/hotel-amenity.constant.ts +0 -18
  69. package/hotels/constants/hotel-contact-type.constant.ts +0 -12
  70. package/hotels/constants/hotel-feature.constant.ts +0 -14
  71. package/hotels/constants/hotel-integration-connection-state.constant.ts +0 -13
  72. package/hotels/constants/hotel-integration-credential-status.constant.ts +0 -12
  73. package/hotels/constants/hotel-integration-provider.constant.ts +0 -11
  74. package/hotels/constants/hotel-integration-sync-status.constant.ts +0 -13
  75. package/hotels/constants/hotel-policy-type.constant.ts +0 -15
  76. package/hotels/constants/hotel-rating-source.constant.ts +0 -12
  77. package/hotels/constants/index.ts +0 -9
  78. package/hotels/contacts/hotel-contact.model.ts +0 -15
  79. package/hotels/contacts/index.ts +0 -1
  80. package/hotels/contracts/create-hotel.contract.ts +0 -16
  81. package/hotels/contracts/delete-hotel.contract.ts +0 -12
  82. package/hotels/contracts/find-hotel.contract.ts +0 -27
  83. package/hotels/contracts/find-many-hotels.contract.ts +0 -41
  84. package/hotels/contracts/index.ts +0 -5
  85. package/hotels/contracts/update-hotel.contract.ts +0 -17
  86. package/hotels/domains/contracts/find-hotel-domain-settings.contract.ts +0 -13
  87. package/hotels/domains/contracts/index.ts +0 -2
  88. package/hotels/domains/contracts/update-hotel-domain-settings.contract.ts +0 -16
  89. package/hotels/domains/hotel-domains.api.ts +0 -11
  90. package/hotels/domains/hotel-domains.schema.ts +0 -25
  91. package/hotels/domains/index.ts +0 -3
  92. package/hotels/features/hotel-feature.model.ts +0 -14
  93. package/hotels/features/index.ts +0 -1
  94. package/hotels/hotel.models.ts +0 -72
  95. package/hotels/hotels.api.ts +0 -22
  96. package/hotels/index.ts +0 -14
  97. package/hotels/integrations/configs/index.ts +0 -1
  98. package/hotels/integrations/configs/opera-integration-config.model.ts +0 -6
  99. package/hotels/integrations/contracts/create-hotel-integration.contract.ts +0 -21
  100. package/hotels/integrations/contracts/delete-hotel-integration.contract.ts +0 -14
  101. package/hotels/integrations/contracts/find-all-hotel-integrations.contract.ts +0 -18
  102. package/hotels/integrations/contracts/find-hotel-integration.contract.ts +0 -15
  103. package/hotels/integrations/contracts/index.ts +0 -5
  104. package/hotels/integrations/contracts/update-hotel-integration.contract.ts +0 -21
  105. package/hotels/integrations/hotel-integration.model.ts +0 -80
  106. package/hotels/integrations/hotel-integrations.api.ts +0 -16
  107. package/hotels/integrations/index.ts +0 -3
  108. package/hotels/location/hotel-location.model.ts +0 -17
  109. package/hotels/location/index.ts +0 -1
  110. package/hotels/policies/hotel-policy.model.ts +0 -16
  111. package/hotels/policies/index.ts +0 -1
  112. package/hotels/ratings/hotel-rating.model.ts +0 -15
  113. package/hotels/ratings/index.ts +0 -1
  114. package/hotels/sites/contracts/find-hotel-site-page-by-lang.contract.ts +0 -26
  115. package/hotels/sites/contracts/index.ts +0 -1
  116. package/hotels/sites/hotel-pages.api.ts +0 -24
  117. package/hotels/sites/index.ts +0 -2
  118. package/hotels/themes/constants/accent-colors.constant.ts +0 -18
  119. package/hotels/themes/constants/fonts.constant.ts +0 -9
  120. package/hotels/themes/constants/index.ts +0 -3
  121. package/hotels/themes/constants/radius.constant.ts +0 -12
  122. package/hotels/themes/contracts/find-hotel-theme.contract.ts +0 -13
  123. package/hotels/themes/contracts/index.ts +0 -1
  124. package/hotels/themes/hotel-themes.api.ts +0 -20
  125. package/hotels/themes/index.ts +0 -4
  126. package/hotels/themes/theme.models.ts +0 -13
  127. package/index.ts +0 -10
  128. package/pages/constants/block-type.constant.ts +0 -11
  129. package/pages/constants/cta-actions.constant.ts +0 -5
  130. package/pages/constants/hero.constants.ts +0 -18
  131. package/pages/constants/image-loading.constant.ts +0 -8
  132. package/pages/constants/index.ts +0 -5
  133. package/pages/constants/media.constants.ts +0 -20
  134. package/pages/index.ts +0 -2
  135. package/pages/models/blocks/base-block.schema.ts +0 -11
  136. package/pages/models/blocks/block.schemas.ts +0 -57
  137. package/pages/models/blocks/cta.schema.ts +0 -58
  138. package/pages/models/blocks/hero-block.schema.ts +0 -27
  139. package/pages/models/blocks/html-block.schema.ts +0 -14
  140. package/pages/models/blocks/index.ts +0 -6
  141. package/pages/models/blocks/media.schemas.ts +0 -66
  142. package/pages/models/index.ts +0 -2
  143. package/pages/models/page.schema.ts +0 -29
  144. package/permissions/contracts/create-permission.contract.ts +0 -18
  145. package/permissions/contracts/delete-permission.contract.ts +0 -12
  146. package/permissions/contracts/find-all-permission.contract.ts +0 -13
  147. package/permissions/contracts/find-many-permission.contract.ts +0 -40
  148. package/permissions/contracts/find-permission.contract.ts +0 -13
  149. package/permissions/contracts/index.ts +0 -6
  150. package/permissions/contracts/update-permission.contract.ts +0 -17
  151. package/permissions/index.ts +0 -3
  152. package/permissions/permission.models.ts +0 -37
  153. package/permissions/permissions.api.ts +0 -15
  154. package/permissions/permisson-conditions.model.ts +0 -7
  155. package/roles/contracts/create-role.contract.ts +0 -16
  156. package/roles/contracts/delete-role.contract.ts +0 -12
  157. package/roles/contracts/find-many-roles.contract.ts +0 -55
  158. package/roles/contracts/find-role.contract.ts +0 -13
  159. package/roles/contracts/index.ts +0 -5
  160. package/roles/contracts/update-role.contract.ts +0 -17
  161. package/roles/index.ts +0 -3
  162. package/roles/role.models.ts +0 -52
  163. package/roles/roles.api.ts +0 -14
  164. package/tenants/contracts/index.ts +0 -1
  165. package/tenants/contracts/resolve-tenant.contract.ts +0 -32
  166. package/tenants/index.ts +0 -3
  167. package/tenants/tenant.model.ts +0 -19
  168. package/tenants/tenants.api.ts +0 -10
  169. package/translate/contracts/index.ts +0 -2
  170. package/translate/contracts/translate-object.contract.ts +0 -54
  171. package/translate/contracts/translate-text.contract.ts +0 -24
  172. package/translate/index.ts +0 -2
  173. package/translate/translate.api.ts +0 -11
  174. package/translate/translate.schemas.ts +0 -7
  175. package/translations/index.ts +0 -4
  176. package/translations/resolve-translation-value-type.helper.ts +0 -14
  177. package/translations/translation-value-type-policy.ts +0 -22
  178. package/translations/translation-value-types.constant.ts +0 -10
  179. package/translations/translation.models.ts +0 -13
  180. package/tsconfig.json +0 -112
@@ -1,72 +0,0 @@
1
- import * as z from 'zod';
2
- import {
3
- LANGUAGE_KEYS,
4
- TimestampSchema,
5
- AppStatuses,
6
- SlugSchema,
7
- makeTranslations,
8
- IsoTimeSchema,
9
- TimezoneSchema,
10
- UuidSchema,
11
- } from '../common';
12
-
13
- export const HotelSchema = z.object({
14
- slug: SlugSchema,
15
- chainId: UuidSchema.nullable().optional(),
16
- status: z.enum(AppStatuses.HOTEL_VALUES).optional(), // сервер может проставить дефолт
17
- category: z.string().min(1).max(64).nullable().optional(),
18
- timezone: TimezoneSchema,
19
- currency: z.string().length(3),
20
- defaultLang: z.enum(LANGUAGE_KEYS),
21
- availableLangs: z.array(z.enum(LANGUAGE_KEYS)),
22
- stars: z.number().int().min(1).max(5).nullable().optional(),
23
- checkInFrom: IsoTimeSchema,
24
- checkOutUntil: IsoTimeSchema,
25
- metadata: z.record(z.string(), z.unknown()).nullable().optional(),
26
- });
27
- export type THotel = z.infer<typeof HotelSchema>;
28
-
29
- export const HotelPersistedSchema = HotelSchema.required({ status: true }).extend({
30
- id: UuidSchema,
31
- version: z.number().int().nonnegative(),
32
- ...TimestampSchema.shape,
33
- });
34
- export type THotelPersisted = z.infer<typeof HotelPersistedSchema>;
35
-
36
- export const HotelTranslationsSchema = z.object({
37
- name: z.string().min(3),
38
- description: z.string().optional(),
39
- });
40
- export type THotelTranslations = z.infer<typeof HotelTranslationsSchema>;
41
-
42
- export const HotelWriteSchema = HotelSchema.extend({
43
- translations: makeTranslations(HotelTranslationsSchema),
44
- });
45
- export type THotelWrite = z.infer<typeof HotelWriteSchema>;
46
-
47
- export const HotelWithTranslationsSchema = HotelPersistedSchema.extend({
48
- translations: makeTranslations(HotelTranslationsSchema),
49
- });
50
- export type THotelWithTranslations = z.infer<typeof HotelWithTranslationsSchema>;
51
-
52
- export const HotelDetailSchema = HotelPersistedSchema.extend({
53
- translations: makeTranslations(HotelTranslationsSchema),
54
- });
55
- export type THotelDetail = z.infer<typeof HotelDetailSchema>;
56
-
57
- export const HotelListItemSchema = HotelPersistedSchema.omit({
58
- chainId: true,
59
- category: true,
60
- stars: true,
61
- metadata: true,
62
- timezone: true,
63
- currency: true,
64
- defaultLang: true,
65
- availableLangs: true,
66
- checkInFrom: true,
67
- checkOutUntil: true,
68
- version: true,
69
- }).extend({
70
- name: z.string().nullable(),
71
- });
72
- export type THotelListItem = z.infer<typeof HotelListItemSchema>;
@@ -1,22 +0,0 @@
1
- import { createApi, TController } from '../common/utils';
2
-
3
- export const HOTELS_CONTROLLER = {
4
- prefix: 'hotels',
5
- endpoints: {
6
- create: '',
7
- findMany: '',
8
- findById: 'by-id/:hotelId',
9
- updateById: 'by-id/:hotelId',
10
- deleteById: 'by-id/:hotelId',
11
- },
12
- } as const satisfies TController;
13
-
14
- export const HOTELS_BY_SLUG_CONTROLLER = {
15
- prefix: 'hotels/by-slug/:hotelSlug',
16
- endpoints: {
17
- find: '',
18
- },
19
- } as const satisfies TController;
20
-
21
- export const HOTELS_API = createApi(HOTELS_CONTROLLER);
22
- export const HOTELS_BY_SLUG_API = createApi(HOTELS_BY_SLUG_CONTROLLER);
package/hotels/index.ts DELETED
@@ -1,14 +0,0 @@
1
- export * from './contracts';
2
- export * from './constants';
3
- export * from './amenities';
4
- export * from './contacts';
5
- export * from './features';
6
- export * from './integrations';
7
- export * from './location';
8
- export * from './policies';
9
- export * from './ratings';
10
- export * from './sites';
11
- export * from './domains';
12
- export * from './themes';
13
- export * from './hotel.models';
14
- export * from './hotels.api';
@@ -1 +0,0 @@
1
- export * from './opera-integration-config.model';
@@ -1,6 +0,0 @@
1
- import * as z from 'zod';
2
- import { HOTEL_INTEGRATION_PROVIDERS } from '../../constants';
3
-
4
- export const OperaIntegrationConfigSchema = z.object({
5
- provider: z.literal(HOTEL_INTEGRATION_PROVIDERS.opera),
6
- });
@@ -1,21 +0,0 @@
1
- import * as z from 'zod';
2
- import { HTTP_METHODS } from '../../../common';
3
- import { HOTEL_INTEGRATIONS_API, HOTEL_INTEGRATIONS_CONTROLLER } from '../hotel-integrations.api';
4
- import {
5
- HotelIntegrationDetailSchema,
6
- HotelIntegrationWriteSchema,
7
- } from '../hotel-integration.model';
8
-
9
- export namespace CreateHotelIntegrationContract {
10
- export const getUrl = HOTEL_INTEGRATIONS_API.create;
11
- export const endpoint = HOTEL_INTEGRATIONS_CONTROLLER.endpoints.create;
12
- export const httpMethod = HTTP_METHODS.post;
13
-
14
- export const RequestSchema = HotelIntegrationWriteSchema;
15
- export type TRequest = z.infer<typeof RequestSchema>;
16
-
17
- export const ResponseSchema = HotelIntegrationDetailSchema;
18
- export type TResponse = z.infer<typeof ResponseSchema>;
19
-
20
- export type TPathParams = { hotelId: string };
21
- }
@@ -1,14 +0,0 @@
1
- import * as z from 'zod';
2
- import { HTTP_METHODS } from '../../../common';
3
- import { HOTEL_INTEGRATIONS_API, HOTEL_INTEGRATIONS_CONTROLLER } from '../hotel-integrations.api';
4
-
5
- export namespace DeleteHotelIntegrationContract {
6
- export const getUrl = HOTEL_INTEGRATIONS_API.delete;
7
- export const endpoint = HOTEL_INTEGRATIONS_CONTROLLER.endpoints.delete;
8
- export const httpMethod = HTTP_METHODS.delete;
9
-
10
- export const ResponseSchema = z.void();
11
- export type TResponse = z.infer<typeof ResponseSchema>;
12
-
13
- export type TPathParams = { hotelId: string; integrationId: string };
14
- }
@@ -1,18 +0,0 @@
1
- import * as z from 'zod';
2
- import { HTTP_METHODS, SearchSchema } from '../../../common';
3
- import { HOTEL_INTEGRATIONS_API, HOTEL_INTEGRATIONS_CONTROLLER } from '../hotel-integrations.api';
4
- import { HotelIntegrationSchema } from '../hotel-integration.model';
5
-
6
- export namespace FindAllHotelIntegrationsContract {
7
- export const getUrl = HOTEL_INTEGRATIONS_API.findAll;
8
- export const endpoint = HOTEL_INTEGRATIONS_CONTROLLER.endpoints.findAll;
9
- export const httpMethod = HTTP_METHODS.get;
10
-
11
- export const RequestSchema = SearchSchema;
12
- export type TRequest = z.infer<typeof RequestSchema>;
13
-
14
- export const ResponseSchema = z.array(HotelIntegrationSchema);
15
- export type TResponse = z.infer<typeof ResponseSchema>;
16
-
17
- export type TPathParams = { hotelId: string };
18
- }
@@ -1,15 +0,0 @@
1
- import * as z from 'zod';
2
- import { HTTP_METHODS } from '../../../common';
3
- import { HOTEL_INTEGRATIONS_API, HOTEL_INTEGRATIONS_CONTROLLER } from '../hotel-integrations.api';
4
- import { HotelIntegrationDetailSchema } from '../hotel-integration.model';
5
-
6
- export namespace FindHotelIntegrationContract {
7
- export const getUrl = HOTEL_INTEGRATIONS_API.findOne;
8
- export const endpoint = HOTEL_INTEGRATIONS_CONTROLLER.endpoints.findOne;
9
- export const httpMethod = HTTP_METHODS.get;
10
-
11
- export const ResponseSchema = HotelIntegrationDetailSchema;
12
- export type TResponse = z.infer<typeof ResponseSchema>;
13
-
14
- export type TPathParams = { hotelId: string; integrationId: string };
15
- }
@@ -1,5 +0,0 @@
1
- export * from './find-all-hotel-integrations.contract';
2
- export * from './find-hotel-integration.contract';
3
- export * from './create-hotel-integration.contract';
4
- export * from './update-hotel-integration.contract';
5
- export * from './delete-hotel-integration.contract';
@@ -1,21 +0,0 @@
1
- import * as z from 'zod';
2
- import { HTTP_METHODS } from '../../../common';
3
- import { HOTEL_INTEGRATIONS_API, HOTEL_INTEGRATIONS_CONTROLLER } from '../hotel-integrations.api';
4
- import {
5
- HotelIntegrationDetailSchema,
6
- HotelIntegrationWriteSchema,
7
- } from '../hotel-integration.model';
8
-
9
- export namespace UpdateHotelIntegrationContract {
10
- export const getUrl = HOTEL_INTEGRATIONS_API.update;
11
- export const endpoint = HOTEL_INTEGRATIONS_CONTROLLER.endpoints.update;
12
- export const httpMethod = HTTP_METHODS.put;
13
-
14
- export const RequestSchema = HotelIntegrationWriteSchema;
15
- export type TRequest = z.infer<typeof RequestSchema>;
16
-
17
- export const ResponseSchema = HotelIntegrationDetailSchema;
18
- export type TResponse = z.infer<typeof ResponseSchema>;
19
-
20
- export type TPathParams = { hotelId: string; integrationId: string };
21
- }
@@ -1,80 +0,0 @@
1
- import * as z from 'zod';
2
- import { SlugSchema, TimestampSchema } from '../../common';
3
- import {
4
- HOTEL_INTEGRATION_CONNECTION_STATE_VALUES,
5
- HOTEL_INTEGRATION_CREDENTIAL_STATUS_VALUES,
6
- HOTEL_INTEGRATION_PROVIDER_VALUES,
7
- HOTEL_INTEGRATION_SYNC_STATUS_VALUES,
8
- } from '../constants';
9
- import { OperaIntegrationConfigSchema } from './configs';
10
-
11
- export const HotelIntegrationConfigSchema = z.discriminatedUnion('provider', [
12
- OperaIntegrationConfigSchema,
13
- ]);
14
-
15
- export const HotelIntegrationSchema = z.object({
16
- alias: SlugSchema,
17
- config: HotelIntegrationConfigSchema,
18
- credentialId: z.uuid().nullable().optional(),
19
- });
20
- export type THotelIntegration = z.infer<typeof HotelIntegrationSchema>;
21
-
22
- export const HotelIntegrationPersistedSchema = HotelIntegrationSchema.required({
23
- credentialId: true,
24
- }).extend({
25
- id: z.uuid(),
26
- secretHash: z.string().min(1),
27
- secretSalt: z.string().min(1),
28
- ...TimestampSchema.shape,
29
- });
30
-
31
- export const HotelIntegrationWriteSchema = HotelIntegrationSchema;
32
- export type THotelIntegrationWrite = z.infer<typeof HotelIntegrationWriteSchema>;
33
-
34
- export const HotelIntegrationDetailSchema = HotelIntegrationPersistedSchema.omit({
35
- secretHash: true,
36
- secretSalt: true,
37
- });
38
- export type THotelIntegrationDetail = z.infer<typeof HotelIntegrationDetailSchema>;
39
-
40
- export const HotelIntegrationAssignSchema = z
41
- .object({
42
- id: z.uuid(),
43
- integrationId: z.uuid(),
44
- hotelId: z.uuid(),
45
- hotelExternalId: z.string(),
46
- isActive: z.boolean().default(true),
47
- })
48
- .extend(TimestampSchema.shape);
49
- export type THotelIntegrationAssign = z.infer<typeof HotelIntegrationAssignSchema>;
50
-
51
- export const HotelIntegrationConnectionSchema = z
52
- .object({
53
- id: z.uuid(),
54
- integrationId: z.uuid(),
55
- connectionState: z.enum(HOTEL_INTEGRATION_CONNECTION_STATE_VALUES),
56
- lastHeartbeatAt: z.date(),
57
- lastSeenAt: z.date(),
58
- lastSyncStatus: z.enum(HOTEL_INTEGRATION_SYNC_STATUS_VALUES),
59
- lastSyncAt: z.date().nullable(),
60
- failedAt: z.date().nullable(),
61
- metadata: z.record(z.string(), z.unknown()).optional(),
62
- })
63
- .extend(TimestampSchema.shape);
64
- export type THotelIntegrationConnection = z.infer<typeof HotelIntegrationConnectionSchema>;
65
-
66
- export const HotelIntegrationCredentialSchema = z
67
- .object({
68
- id: z.uuid(),
69
- integrationId: z.uuid(),
70
- provider: z.enum(HOTEL_INTEGRATION_PROVIDER_VALUES),
71
- login: z.string().min(1),
72
- encryptedSecret: z.string().min(1),
73
- encryptionVersion: z.string().min(1),
74
- status: z.enum(HOTEL_INTEGRATION_CREDENTIAL_STATUS_VALUES),
75
- expiresAt: z.date().nullable(),
76
- meta: z.record(z.string(), z.unknown()).optional(),
77
- rotatedAt: z.date().nullable(),
78
- })
79
- .extend(TimestampSchema.shape);
80
- export type THotelIntegrationCredential = z.infer<typeof HotelIntegrationCredentialSchema>;
@@ -1,16 +0,0 @@
1
- import { createApi, TController } from '../../common/utils';
2
-
3
- export const HOTEL_INTEGRATIONS_CONTROLLER = {
4
- prefix: 'hotels/by-id/:hotelId/integrations',
5
- endpoints: {
6
- findAll: 'findAll',
7
- findOne: ':integrationId',
8
- create: '',
9
- update: ':integrationId',
10
- delete: ':integrationId',
11
- enable: ':integrationId/enable',
12
- disable: ':integrationId/disable',
13
- },
14
- } as const satisfies TController;
15
-
16
- export const HOTEL_INTEGRATIONS_API = createApi(HOTEL_INTEGRATIONS_CONTROLLER);
@@ -1,3 +0,0 @@
1
- export * from './hotel-integration.model';
2
- export * from './hotel-integrations.api';
3
- export * from './contracts';
@@ -1,17 +0,0 @@
1
- import * as z from 'zod';
2
- import { TimestampSchema } from '../../common';
3
-
4
- export const HotelLocationSchema = z
5
- .object({
6
- hotelId: z.uuid(),
7
- countryCode: z.string().length(2),
8
- regionCode: z.string().max(32).optional(),
9
- city: z.string().min(1).max(128),
10
- addressLine1: z.string().min(1).max(256),
11
- addressLine2: z.string().max(256).optional(),
12
- postalCode: z.string().max(16).optional(),
13
- latitude: z.number().min(-90).max(90),
14
- longitude: z.number().min(-180).max(180),
15
- })
16
- .extend(TimestampSchema.shape);
17
- export type THotelLocation = z.infer<typeof HotelLocationSchema>;
@@ -1 +0,0 @@
1
- export * from './hotel-location.model';
@@ -1,16 +0,0 @@
1
- import * as z from 'zod';
2
- import { TimestampSchema } from '../../common';
3
- import { HOTEL_POLICY_TYPE_VALUES } from '../constants';
4
-
5
- export const HotelPolicySchema = z
6
- .object({
7
- hotelId: z.uuid(),
8
- policyType: z.enum(HOTEL_POLICY_TYPE_VALUES),
9
- valueKey: z.string().min(1).optional(),
10
- valueJson: z.record(z.string(), z.unknown()).optional(),
11
- effectiveFrom: z.date().optional(),
12
- effectiveTo: z.date().optional(),
13
- })
14
- .extend(TimestampSchema.shape);
15
-
16
- export type THotelPolicy = z.infer<typeof HotelPolicySchema>;
@@ -1 +0,0 @@
1
- export * from './hotel-policy.model';
@@ -1,15 +0,0 @@
1
- import * as z from 'zod';
2
- import { IsoDatetimeSchema, TimestampSchema } from '../../common';
3
- import { HOTEL_RATING_SOURCE_VALUES } from '../constants';
4
-
5
- export const HotelRatingSchema = z
6
- .object({
7
- hotelId: z.uuid(),
8
- source: z.enum(HOTEL_RATING_SOURCE_VALUES),
9
- value: z.number().min(0).max(10),
10
- reviewsCount: z.number().int().nonnegative().optional(),
11
- metadata: z.record(z.string(), z.unknown()).optional(),
12
- })
13
- .extend(TimestampSchema.shape);
14
-
15
- export type THotelRating = z.infer<typeof HotelRatingSchema>;
@@ -1 +0,0 @@
1
- export * from './hotel-rating.model';
@@ -1,26 +0,0 @@
1
- import * as z from 'zod';
2
- import { HTTP_METHODS, LanguageKeysSchema } from '../../../common';
3
- import { HOTEL_PAGES_PUBLIC_API, HOTEL_PAGES_PUBLIC_CONTROLLER } from '../hotel-pages.api';
4
- import { PageLangTranslationSchema, PageSchema } from '../../../pages';
5
-
6
- const FindHotelSitePageByLangContractRequestSchema = z.object({
7
- lang: LanguageKeysSchema,
8
- });
9
-
10
- const FindHotelSitePageByLangContractResponseSchema = PageSchema.omit({
11
- translations: true,
12
- }).extend({
13
- translation: PageLangTranslationSchema,
14
- });
15
-
16
- export namespace FindHotelSitePageByLangContract {
17
- export const getUrl = HOTEL_PAGES_PUBLIC_API.findBySlugAndLang;
18
- export const endpoint = HOTEL_PAGES_PUBLIC_CONTROLLER.endpoints.findBySlugAndLang;
19
- export const httpMethod = HTTP_METHODS.get;
20
-
21
- export const RequestSchema = FindHotelSitePageByLangContractRequestSchema;
22
- export type TRequest = z.infer<typeof RequestSchema>;
23
-
24
- export const ResponseSchema = FindHotelSitePageByLangContractResponseSchema;
25
- export type TResponse = z.infer<typeof ResponseSchema>;
26
- }
@@ -1 +0,0 @@
1
- export * from './find-hotel-site-page-by-lang.contract';
@@ -1,24 +0,0 @@
1
- import { createApi, TController } from '../../common/utils';
2
-
3
- export const HOTEL_PAGES_CONTROLLER = {
4
- prefix: 'hotels/by-id/:hotelId/sites/pages',
5
- endpoints: {
6
- findMany: '',
7
- findBySlug: ':slug',
8
- findBySlugAndLang: ':slug/lang/:lang',
9
- create: '',
10
- update: ':slug',
11
- delete: ':slug',
12
- },
13
- } as const satisfies TController;
14
-
15
- export const HOTEL_PAGES_PUBLIC_CONTROLLER = {
16
- prefix: 'hotels/by-slug/:hotelSlug/sites/pages',
17
- endpoints: {
18
- findBySlug: ':slug',
19
- findBySlugAndLang: ':slug/lang/:lang',
20
- },
21
- } as const satisfies TController;
22
-
23
- export const HOTEL_PAGES_API = createApi(HOTEL_PAGES_CONTROLLER);
24
- export const HOTEL_PAGES_PUBLIC_API = createApi(HOTEL_PAGES_PUBLIC_CONTROLLER);
@@ -1,2 +0,0 @@
1
- export * from './hotel-pages.api';
2
- export * from './contracts';
@@ -1,18 +0,0 @@
1
- export const ACCENT_COLORS = {
2
- gray: 'gray',
3
- red: 'red',
4
- orange: 'orange',
5
- yellow: 'yellow',
6
- green: 'green',
7
- teal: 'teal',
8
- blue: 'blue',
9
- cyan: 'cyan',
10
- purple: 'purple',
11
- pink: 'pink',
12
- } as const;
13
-
14
- export type TAccentColor = (typeof ACCENT_COLORS)[keyof typeof ACCENT_COLORS];
15
- export const ACCENT_COLORS_VALUES = Object.values(ACCENT_COLORS) as [
16
- TAccentColor,
17
- ...TAccentColor[],
18
- ];
@@ -1,9 +0,0 @@
1
- export const FONT_FAMILIES = {
2
- inter: 'inter',
3
- outfit: 'outfit',
4
- geist: 'geist',
5
- figtree: 'figtree',
6
- } as const;
7
-
8
- export type TFontFamily = (typeof FONT_FAMILIES)[keyof typeof FONT_FAMILIES];
9
- export const FONT_FAMILIES_VALUES = Object.values(FONT_FAMILIES) as [TFontFamily, ...TFontFamily[]];
@@ -1,3 +0,0 @@
1
- export * from './accent-colors.constant';
2
- export * from './fonts.constant';
3
- export * from './radius.constant';
@@ -1,12 +0,0 @@
1
- const RADIUS = {
2
- none: 'none',
3
- xs: 'xs',
4
- sm: 'sm',
5
- md: 'md',
6
- lg: 'lg',
7
- xl: 'xl',
8
- '2xl': '2xl',
9
- } as const;
10
-
11
- export type TRadius = (typeof RADIUS)[keyof typeof RADIUS];
12
- export const RADIUS_VALUES = Object.values(RADIUS) as [TRadius, ...TRadius[]];
@@ -1,13 +0,0 @@
1
- import * as z from 'zod';
2
- import { HTTP_METHODS } from '../../../common';
3
- import { ThemePersistedSchema } from '../theme.models';
4
- import { HOTEL_THEMES_PUBLIC_API, HOTEL_THEMES_PUBLIC_CONTROLLER } from '../hotel-themes.api';
5
-
6
- export namespace FindHotelThemeContract {
7
- export const getUrl = HOTEL_THEMES_PUBLIC_API.get;
8
- export const endpoint = HOTEL_THEMES_PUBLIC_CONTROLLER.endpoints.get;
9
- export const httpMethod = HTTP_METHODS.get;
10
-
11
- export const ResponseSchema = ThemePersistedSchema;
12
- export type TResponse = z.infer<typeof ResponseSchema>;
13
- }
@@ -1 +0,0 @@
1
- export * from './find-hotel-theme.contract';
@@ -1,20 +0,0 @@
1
- import { createApi, TController } from '../../common/utils';
2
-
3
- export const HOTEL_THEMES_CONTROLLER = {
4
- prefix: 'hotels/by-id/:hotelId/theme',
5
- endpoints: {
6
- get: '',
7
- upsert: '',
8
- delete: '',
9
- },
10
- } as const satisfies TController;
11
-
12
- export const HOTEL_THEMES_PUBLIC_CONTROLLER = {
13
- prefix: 'hotels/by-slug/:hotelSlug/theme',
14
- endpoints: {
15
- get: '',
16
- },
17
- } as const satisfies TController;
18
-
19
- export const HOTEL_THEMES_API = createApi(HOTEL_THEMES_CONTROLLER);
20
- export const HOTEL_THEMES_PUBLIC_API = createApi(HOTEL_THEMES_PUBLIC_CONTROLLER);
@@ -1,4 +0,0 @@
1
- export * from './constants';
2
- export * from './theme.models';
3
- export * from './hotel-themes.api';
4
- export * from './contracts';
@@ -1,13 +0,0 @@
1
- import * as z from 'zod';
2
- import { ACCENT_COLORS_VALUES, FONT_FAMILIES_VALUES, RADIUS_VALUES } from './constants';
3
- import { TimestampSchema } from '../../common';
4
-
5
- export const ThemePersistedSchema = z
6
- .object({
7
- hotelId: z.uuid(),
8
- fontFamily: z.enum(FONT_FAMILIES_VALUES),
9
- accentColor: z.enum(ACCENT_COLORS_VALUES),
10
- radius: z.enum(RADIUS_VALUES),
11
- })
12
- .extend(TimestampSchema.shape);
13
- export type TThemePersisted = z.infer<typeof ThemePersistedSchema>;
package/index.ts DELETED
@@ -1,10 +0,0 @@
1
- export * from './hotels';
2
- export * from './common';
3
- export * from './companies';
4
- export * from './app-menu';
5
- export * from './pages';
6
- export * from './permissions';
7
- export * from './roles';
8
- export * from './tenants';
9
- export * from './translate';
10
- export * from './translations';
@@ -1,11 +0,0 @@
1
- export const BLOCK_TYPES = {
2
- hero: 'hero',
3
- html: 'html',
4
- linkCta: 'link-cta',
5
- buttonCta: 'button-cta',
6
- container: 'container',
7
- } as const;
8
-
9
- export type TBlockType = (typeof BLOCK_TYPES)[keyof typeof BLOCK_TYPES];
10
-
11
- export const BLOCK_TYPE_VALUES = Object.values(BLOCK_TYPES) as [TBlockType, ...TBlockType[]];
@@ -1,5 +0,0 @@
1
- export const CTA_ACTIONS = {
2
- book: 'book',
3
- } as const;
4
- export type TCTAAction = (typeof CTA_ACTIONS)[keyof typeof CTA_ACTIONS];
5
- export const CTA_ACTIONS_VALUES = Object.values(CTA_ACTIONS) as [TCTAAction];
@@ -1,18 +0,0 @@
1
- export const HERO_VARIANTS = {
2
- headerOnMedia: 'header-on-media',
3
- } as const;
4
- export type THeroVariants = (typeof HERO_VARIANTS)[keyof typeof HERO_VARIANTS];
5
- export const HERO_VARIANT_VALUES = Object.values(HERO_VARIANTS) as [
6
- THeroVariants,
7
- ...THeroVariants[],
8
- ];
9
-
10
- export const HERO_HEIGHT = {
11
- screen50: '50dvh',
12
- screen75: '75dvh',
13
- screen80: '80dvh',
14
- screen90: '90dvh',
15
- screen100: '100dvh',
16
- } as const;
17
- export type THeroHeight = (typeof HERO_HEIGHT)[keyof typeof HERO_HEIGHT];
18
- export const HERO_HEIGHT_VALUES = Object.values(HERO_HEIGHT) as [THeroHeight, ...THeroHeight[]];
@@ -1,8 +0,0 @@
1
- export const IMAGE_LOADING = {
2
- lazy: 'lazy',
3
- eager: 'eager',
4
- } as const;
5
-
6
- export type TImageLoading = (typeof IMAGE_LOADING)[keyof typeof IMAGE_LOADING];
7
-
8
- export const IMAGE_LOADING_VALUES = Object.values(IMAGE_LOADING) as [TImageLoading, ...TImageLoading[]];
@@ -1,5 +0,0 @@
1
- export * from './block-type.constant';
2
- export * from './cta-actions.constant';
3
- export * from './hero.constants';
4
- export * from './image-loading.constant';
5
- export * from './media.constants';
@@ -1,20 +0,0 @@
1
- export const MEDIA_TYPES = {
2
- image: 'image',
3
- video: 'video',
4
- slider: 'slider',
5
- } as const;
6
- export type TMediaType = (typeof MEDIA_TYPES)[keyof typeof MEDIA_TYPES];
7
- export const MEDIA_TYPE_VALUES = Object.values(MEDIA_TYPES) as [TMediaType, ...TMediaType[]];
8
-
9
- // Добавляем приоритеты для адаптивности
10
- export const MEDIA_PRIORITIES = {
11
- desktop: 'desktop',
12
- mobile: 'mobile',
13
- tablet: 'tablet',
14
- all: 'all', // универсальное медиа
15
- } as const;
16
- export type TMediaPriority = (typeof MEDIA_PRIORITIES)[keyof typeof MEDIA_PRIORITIES];
17
- export const MEDIA_PRIORITY_VALUES = Object.values(MEDIA_PRIORITIES) as [
18
- TMediaPriority,
19
- ...TMediaPriority[],
20
- ];
package/pages/index.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from './constants';
2
- export * from './models';