hh-contracts 0.0.74 → 0.0.76

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.
@@ -158,4 +158,46 @@ exports.APP_ERRORS = {
158
158
  messageKey: 'errors.room.notFound',
159
159
  },
160
160
  },
161
+ page: {
162
+ notFound: {
163
+ statusCode: 404,
164
+ code: 'PAGE-01',
165
+ messageKey: 'errors.page.notFound',
166
+ },
167
+ draft: {
168
+ statusCode: 404,
169
+ code: 'PAGE-02',
170
+ messageKey: 'errors.page.draft',
171
+ },
172
+ inactive: {
173
+ statusCode: 404,
174
+ code: 'PAGE-03',
175
+ messageKey: 'errors.page.inactive',
176
+ },
177
+ alreadyExists: {
178
+ statusCode: 409,
179
+ code: 'PAGE-04',
180
+ messageKey: 'errors.page.alreadyExists',
181
+ },
182
+ createFailed: {
183
+ statusCode: 500,
184
+ code: 'PAGE-05',
185
+ messageKey: 'errors.page.createFailed',
186
+ },
187
+ updateFailed: {
188
+ statusCode: 500,
189
+ code: 'PAGE-06',
190
+ messageKey: 'errors.page.updateFailed',
191
+ },
192
+ deleteFailed: {
193
+ statusCode: 500,
194
+ code: 'PAGE-07',
195
+ messageKey: 'errors.page.deleteFailed',
196
+ },
197
+ findFailed: {
198
+ statusCode: 500,
199
+ code: 'PAGE-08',
200
+ messageKey: 'errors.page.findFailed',
201
+ },
202
+ },
161
203
  };
@@ -2,8 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ICON_POSITION_VALUES = exports.ICON_POSITION = exports.ICON_KEY_VALUES = exports.ICON_KEYS = void 0;
4
4
  exports.ICON_KEYS = {
5
- // eye: 'eye',
6
- // eyeSlash: 'eyeSlash',
5
+ //interface
7
6
  chevronDown: 'chevronDown',
8
7
  chevronLeft: 'chevronLeft',
9
8
  chevronRight: 'chevronRight',
@@ -11,7 +10,6 @@ exports.ICON_KEYS = {
11
10
  arrowUp: 'arrowUp',
12
11
  moon: 'moon',
13
12
  sun: 'sun',
14
- // user: 'user',
15
13
  menu: 'menu',
16
14
  ellipsis: 'ellipsis',
17
15
  filter: 'filter',
@@ -24,10 +22,44 @@ exports.ICON_KEYS = {
24
22
  language: 'language',
25
23
  magic: 'magic',
26
24
  play: 'play',
27
- // close: 'close',
28
- // check: 'check',
29
- // closeFilled: 'closeFilled',
25
+ // logos
30
26
  logo: 'logo',
27
+ accorLogo: 'accorLogo',
28
+ ibisLogo: 'ibisLogo',
29
+ yandexTravelLogo: 'yandexTravelLogo',
30
+ ostrovokLogo: 'ostrovokLogo',
31
+ oneTwoTripLogo: 'oneTwoTripLogo',
32
+ hotel101Logo: 'hotel101Logo',
33
+ twoGisLogo: 'twoGisLogo',
34
+ // advantages
35
+ location: 'location',
36
+ hotel: 'hotel',
37
+ breakfast: 'breakfast',
38
+ pets: 'pets',
39
+ room: 'room',
40
+ bed: 'bed',
41
+ meeting: 'meeting',
42
+ qualityStandards: 'qualityStandards',
43
+ //room
44
+ guests: 'guests',
45
+ squareMeter: 'squareMeter',
46
+ beds: 'beds',
47
+ //amenities
48
+ wifi: 'wifi',
49
+ tv: 'tv',
50
+ airConditioning: 'airConditioning',
51
+ shower: 'shower',
52
+ toiletries: 'toiletries',
53
+ bathrobe: 'bathrobe',
54
+ slippers: 'slippers',
55
+ safe: 'safe',
56
+ wardrobe: 'wardrobe',
57
+ sofa: 'sofa',
58
+ hairdryer: 'hairdryer',
59
+ miniFridge: 'miniFridge',
60
+ kettle: 'kettle',
61
+ teaStation: 'teaStation',
62
+ fridge: 'fridge',
31
63
  flagGB: 'flagGB',
32
64
  flagRU: 'flagRU',
33
65
  };
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.HOTELS_API = exports.HOTELS_CONTROLLER = void 0;
3
+ exports.HOTELS_BY_SLUG_API = exports.HOTELS_BY_SLUG_CONTROLLER = void 0;
4
4
  const utils_1 = require("../common/utils");
5
- exports.HOTELS_CONTROLLER = {
6
- prefix: 'hotels',
5
+ exports.HOTELS_BY_SLUG_CONTROLLER = {
6
+ prefix: 'hotels/by-slug',
7
7
  endpoints: {
8
- findTheme: 'by-slug/:hotelslug/theme',
9
- findSitePageByLang: 'by-slug/:hotelslug/sites/pages/:slug',
10
- findSitePage: 'by-slug/:hotelslug/sites/pages/:slug',
8
+ findTheme: ':hotelSlug/theme',
9
+ findSitePageByLang: ':hotelSlug/sites/pages/:slug',
10
+ findSitePage: ':hotelSlug/sites/pages/:slug',
11
11
  },
12
12
  };
13
- exports.HOTELS_API = (0, utils_1.createApi)(exports.HOTELS_CONTROLLER);
13
+ exports.HOTELS_BY_SLUG_API = (0, utils_1.createApi)(exports.HOTELS_BY_SLUG_CONTROLLER);
@@ -48,8 +48,8 @@ const FindHotelSitePageByLangContractResponseSchema = pages_1.PageSchema.omit({
48
48
  });
49
49
  var FindHotelSitePageByLangContract;
50
50
  (function (FindHotelSitePageByLangContract) {
51
- FindHotelSitePageByLangContract.getUrl = hotels_api_1.HOTELS_API.findSitePageByLang;
52
- FindHotelSitePageByLangContract.endpoint = hotels_api_1.HOTELS_CONTROLLER.endpoints.findSitePageByLang;
51
+ FindHotelSitePageByLangContract.getUrl = hotels_api_1.HOTELS_BY_SLUG_API.findSitePageByLang;
52
+ FindHotelSitePageByLangContract.endpoint = hotels_api_1.HOTELS_BY_SLUG_CONTROLLER.endpoints.findSitePageByLang;
53
53
  FindHotelSitePageByLangContract.httpMethod = common_1.HTTP_METHODS.get;
54
54
  FindHotelSitePageByLangContract.RequestSchema = FindHotelSitePageByLangContractRequestSchema;
55
55
  FindHotelSitePageByLangContract.ResponseSchema = FindHotelSitePageByLangContractResponseSchema;
@@ -6,8 +6,8 @@ const theme_models_1 = require("../theme.models");
6
6
  const hotels_api_1 = require("../../hotels.api");
7
7
  var FindHotelThemeContract;
8
8
  (function (FindHotelThemeContract) {
9
- FindHotelThemeContract.getUrl = hotels_api_1.HOTELS_API.findTheme;
10
- FindHotelThemeContract.endpoint = hotels_api_1.HOTELS_CONTROLLER.endpoints.findTheme;
9
+ FindHotelThemeContract.getUrl = hotels_api_1.HOTELS_BY_SLUG_API.findTheme;
10
+ FindHotelThemeContract.endpoint = hotels_api_1.HOTELS_BY_SLUG_CONTROLLER.endpoints.findTheme;
11
11
  FindHotelThemeContract.httpMethod = common_1.HTTP_METHODS.get;
12
12
  FindHotelThemeContract.ResponseSchema = theme_models_1.ThemePersistedSchema;
13
13
  })(FindHotelThemeContract || (exports.FindHotelThemeContract = FindHotelThemeContract = {}));
@@ -41,8 +41,6 @@ const MetaSchema = z.object({
41
41
  slug: common_1.SlugSchema,
42
42
  status: z.enum(common_1.AppStatuses.PAGE_VALUES),
43
43
  revision: z.number().int().nonnegative().default(0),
44
- revalidate: z.number().int().positive().default(300),
45
- tags: z.array(z.string()).default([]),
46
44
  });
47
45
  exports.PageLangTranslationSchema = z.object({
48
46
  seo: z
@@ -155,6 +155,49 @@ export const APP_ERRORS = {
155
155
  messageKey: 'errors.room.notFound',
156
156
  },
157
157
  },
158
+
159
+ page: {
160
+ notFound: {
161
+ statusCode: 404,
162
+ code: 'PAGE-01',
163
+ messageKey: 'errors.page.notFound',
164
+ },
165
+ draft: {
166
+ statusCode: 404,
167
+ code: 'PAGE-02',
168
+ messageKey: 'errors.page.draft',
169
+ },
170
+ inactive: {
171
+ statusCode: 404,
172
+ code: 'PAGE-03',
173
+ messageKey: 'errors.page.inactive',
174
+ },
175
+ alreadyExists: {
176
+ statusCode: 409,
177
+ code: 'PAGE-04',
178
+ messageKey: 'errors.page.alreadyExists',
179
+ },
180
+ createFailed: {
181
+ statusCode: 500,
182
+ code: 'PAGE-05',
183
+ messageKey: 'errors.page.createFailed',
184
+ },
185
+ updateFailed: {
186
+ statusCode: 500,
187
+ code: 'PAGE-06',
188
+ messageKey: 'errors.page.updateFailed',
189
+ },
190
+ deleteFailed: {
191
+ statusCode: 500,
192
+ code: 'PAGE-07',
193
+ messageKey: 'errors.page.deleteFailed',
194
+ },
195
+ findFailed: {
196
+ statusCode: 500,
197
+ code: 'PAGE-08',
198
+ messageKey: 'errors.page.findFailed',
199
+ },
200
+ },
158
201
  } as const;
159
202
 
160
203
  interface IError {
@@ -1,6 +1,5 @@
1
1
  export const ICON_KEYS = {
2
- // eye: 'eye',
3
- // eyeSlash: 'eyeSlash',
2
+ //interface
4
3
  chevronDown: 'chevronDown',
5
4
  chevronLeft: 'chevronLeft',
6
5
  chevronRight: 'chevronRight',
@@ -8,7 +7,6 @@ export const ICON_KEYS = {
8
7
  arrowUp: 'arrowUp',
9
8
  moon: 'moon',
10
9
  sun: 'sun',
11
- // user: 'user',
12
10
  menu: 'menu',
13
11
  ellipsis: 'ellipsis',
14
12
  filter: 'filter',
@@ -21,11 +19,45 @@ export const ICON_KEYS = {
21
19
  language: 'language',
22
20
  magic: 'magic',
23
21
  play: 'play',
24
- // close: 'close',
25
- // check: 'check',
26
-
27
- // closeFilled: 'closeFilled',
22
+ // logos
28
23
  logo: 'logo',
24
+ accorLogo: 'accorLogo',
25
+ ibisLogo: 'ibisLogo',
26
+ yandexTravelLogo: 'yandexTravelLogo',
27
+ ostrovokLogo: 'ostrovokLogo',
28
+ oneTwoTripLogo: 'oneTwoTripLogo',
29
+ hotel101Logo: 'hotel101Logo',
30
+ twoGisLogo: 'twoGisLogo',
31
+ // advantages
32
+ location: 'location',
33
+ hotel: 'hotel',
34
+ breakfast: 'breakfast',
35
+ pets: 'pets',
36
+ room: 'room',
37
+ bed: 'bed',
38
+ meeting: 'meeting',
39
+ qualityStandards: 'qualityStandards',
40
+ //room
41
+ guests: 'guests',
42
+ squareMeter: 'squareMeter',
43
+ beds: 'beds',
44
+ //amenities
45
+ wifi: 'wifi',
46
+ tv: 'tv',
47
+ airConditioning: 'airConditioning',
48
+ shower: 'shower',
49
+ toiletries: 'toiletries',
50
+ bathrobe: 'bathrobe',
51
+ slippers: 'slippers',
52
+ safe: 'safe',
53
+ wardrobe: 'wardrobe',
54
+ sofa: 'sofa',
55
+ hairdryer: 'hairdryer',
56
+ miniFridge: 'miniFridge',
57
+ kettle: 'kettle',
58
+ teaStation: 'teaStation',
59
+ fridge: 'fridge',
60
+
29
61
  flagGB: 'flagGB',
30
62
  flagRU: 'flagRU',
31
63
  } as const;
@@ -1,12 +1,12 @@
1
1
  import { createApi, TController } from '../common/utils';
2
2
 
3
- export const HOTELS_CONTROLLER = {
4
- prefix: 'hotels',
3
+ export const HOTELS_BY_SLUG_CONTROLLER = {
4
+ prefix: 'hotels/by-slug',
5
5
  endpoints: {
6
- findTheme: 'by-slug/:hotelslug/theme',
7
- findSitePageByLang: 'by-slug/:hotelslug/sites/pages/:slug',
8
- findSitePage: 'by-slug/:hotelslug/sites/pages/:slug',
6
+ findTheme: ':hotelSlug/theme',
7
+ findSitePageByLang: ':hotelSlug/sites/pages/:slug',
8
+ findSitePage: ':hotelSlug/sites/pages/:slug',
9
9
  },
10
10
  } as const satisfies TController;
11
11
 
12
- export const HOTELS_API = createApi(HOTELS_CONTROLLER);
12
+ export const HOTELS_BY_SLUG_API = createApi(HOTELS_BY_SLUG_CONTROLLER);
@@ -1,6 +1,6 @@
1
1
  import * as z from 'zod';
2
2
  import { HTTP_METHODS, LanguageKeysSchema } from '../../../common';
3
- import { HOTELS_API, HOTELS_CONTROLLER } from '../../hotels.api';
3
+ import { HOTELS_BY_SLUG_API, HOTELS_BY_SLUG_CONTROLLER } from '../../hotels.api';
4
4
  import { PageLangTranslationSchema, PageSchema } from '../../../pages';
5
5
 
6
6
  const FindHotelSitePageByLangContractRequestSchema = z.object({
@@ -14,8 +14,8 @@ const FindHotelSitePageByLangContractResponseSchema = PageSchema.omit({
14
14
  });
15
15
 
16
16
  export namespace FindHotelSitePageByLangContract {
17
- export const getUrl = HOTELS_API.findSitePageByLang;
18
- export const endpoint = HOTELS_CONTROLLER.endpoints.findSitePageByLang;
17
+ export const getUrl = HOTELS_BY_SLUG_API.findSitePageByLang;
18
+ export const endpoint = HOTELS_BY_SLUG_CONTROLLER.endpoints.findSitePageByLang;
19
19
  export const httpMethod = HTTP_METHODS.get;
20
20
 
21
21
  export const RequestSchema = FindHotelSitePageByLangContractRequestSchema;
@@ -1,11 +1,11 @@
1
1
  import * as z from 'zod';
2
2
  import { HTTP_METHODS } from '../../../common';
3
3
  import { ThemePersistedSchema } from '../theme.models';
4
- import { HOTELS_API, HOTELS_CONTROLLER } from '../../hotels.api';
4
+ import { HOTELS_BY_SLUG_API, HOTELS_BY_SLUG_CONTROLLER } from '../../hotels.api';
5
5
 
6
6
  export namespace FindHotelThemeContract {
7
- export const getUrl = HOTELS_API.findTheme;
8
- export const endpoint = HOTELS_CONTROLLER.endpoints.findTheme;
7
+ export const getUrl = HOTELS_BY_SLUG_API.findTheme;
8
+ export const endpoint = HOTELS_BY_SLUG_CONTROLLER.endpoints.findTheme;
9
9
  export const httpMethod = HTTP_METHODS.get;
10
10
 
11
11
  export const ResponseSchema = ThemePersistedSchema;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hh-contracts",
3
- "version": "0.0.74",
3
+ "version": "0.0.76",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "scripts": {
@@ -6,8 +6,6 @@ const MetaSchema = z.object({
6
6
  slug: SlugSchema,
7
7
  status: z.enum(AppStatuses.PAGE_VALUES),
8
8
  revision: z.number().int().nonnegative().default(0),
9
- revalidate: z.number().int().positive().default(300),
10
- tags: z.array(z.string()).default([]),
11
9
  });
12
10
 
13
11
  export const PageLangTranslationSchema = z.object({