@revolugo/common 6.9.7 → 6.10.0-beta.1

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 (68) hide show
  1. package/package.json +13 -7
  2. package/src/cancellation-policies.test.ts +12 -9
  3. package/src/cancellation-policies.ts +31 -26
  4. package/src/constants/countries.ts +0 -2515
  5. package/src/constants/currencies.ts +0 -1812
  6. package/src/constants/environment.ts +1 -0
  7. package/src/constants/hotel-offers.ts +2 -0
  8. package/src/constants/hotel.ts +3 -0
  9. package/src/constants/locales.ts +6 -0
  10. package/src/constants/measurement.ts +1 -0
  11. package/src/constants/time.ts +1 -0
  12. package/src/countries/constants.ts +2518 -0
  13. package/src/countries/index.ts +7 -0
  14. package/src/currencies/index.ts +1817 -0
  15. package/src/map/distance.ts +22 -0
  16. package/src/map/index.ts +1 -0
  17. package/src/models/paginated-queries.ts +1 -0
  18. package/src/types/country.ts +1 -1
  19. package/src/types/elements/amenity.ts +266 -0
  20. package/src/types/elements/bed.ts +20 -0
  21. package/src/types/elements/booking-policy.ts +80 -0
  22. package/src/types/elements/booking.ts +236 -0
  23. package/src/types/elements/cancellation-policy.ts +20 -0
  24. package/src/types/elements/contact-person.ts +158 -0
  25. package/src/types/elements/currency.ts +3 -0
  26. package/src/types/elements/event-metadata.ts +38 -0
  27. package/src/types/elements/event.ts +14 -0
  28. package/src/types/elements/hotel-image.ts +44 -0
  29. package/src/types/elements/hotel-images.ts +47 -0
  30. package/src/types/elements/hotel-offer-request.ts +82 -0
  31. package/src/types/elements/hotel-offer.ts +208 -0
  32. package/src/types/elements/hotel-review-rating.ts +14 -0
  33. package/src/types/elements/hotel-room-offer-package-type.ts +8 -0
  34. package/src/types/elements/hotel-room-offer-request.ts +77 -0
  35. package/src/types/elements/hotel-room-offer-type.ts +6 -0
  36. package/src/types/elements/hotel-room-offer.ts +192 -0
  37. package/src/types/elements/hotel-room.ts +102 -0
  38. package/src/types/elements/hotel-rooming-list.ts +49 -0
  39. package/src/types/elements/hotel.ts +184 -0
  40. package/src/types/elements/index.ts +22 -0
  41. package/src/types/elements/invoice.ts +21 -0
  42. package/src/types/elements/payment-method.ts +159 -0
  43. package/src/types/elements/source-market.ts +247 -0
  44. package/src/types/elements/tag.ts +32 -0
  45. package/src/types/elements/tax.ts +52 -0
  46. package/src/types/elements/travel-times.ts +45 -0
  47. package/src/types/geo-coordinates.ts +4 -0
  48. package/src/types/index.ts +2 -0
  49. package/src/utils/array-tools.ts +3 -2
  50. package/src/utils/case-transformers.ts +1 -0
  51. package/src/utils/colors.ts +4 -4
  52. package/src/utils/currency.ts +30 -18
  53. package/src/utils/dates.ts +6 -10
  54. package/src/utils/debounce.ts +2 -2
  55. package/src/utils/find-unique-keys.ts +2 -2
  56. package/src/utils/get-guest-count.ts +1 -0
  57. package/src/utils/images.ts +58 -0
  58. package/src/utils/index.ts +2 -1
  59. package/src/utils/lang-default-fallbacks.ts +1 -1
  60. package/src/utils/math.ts +3 -3
  61. package/src/utils/numbers.ts +8 -7
  62. package/src/utils/object-tools.ts +66 -2
  63. package/src/utils/poller.ts +1 -0
  64. package/src/utils/random.ts +12 -0
  65. package/src/utils/strings.ts +5 -2
  66. package/src/utils/uniq-by.ts +12 -9
  67. package/src/utils/validators.ts +1 -0
  68. package/src/utils/countries.ts +0 -4
@@ -39,6 +39,7 @@ export enum BookingEnvironment {
39
39
  Development = 'development',
40
40
  }
41
41
 
42
+ /* @__PURE__ */
42
43
  export const BOOKING_API_URLS = {
43
44
  [Environment.Production]: 'https://booking-api.revolugo.com',
44
45
  [Environment.Sandbox]: 'https://booking-api.sandbox.revolugo.com',
@@ -1,3 +1,5 @@
1
+ /* @__PURE__ */
1
2
  export const CURRENCY_MARKUP = 0.025
2
3
 
4
+ /* @__PURE__ */
3
5
  export const DEFAULT_HOTEL_OFFERS_LIMIT = 50
@@ -4,4 +4,7 @@ export enum BreakfastOption {
4
4
  Optional = 'OPTIONAL',
5
5
  }
6
6
 
7
+ export type BreakfastOptionType = `${BreakfastOption}`
8
+
9
+ /* @__PURE__ */
7
10
  export const ALLOWED_IMAGE_TYPES = ['webp', 'png', 'jpg', 'jpeg']
@@ -29,6 +29,7 @@ export function langFromString(langStr: string): Lang | undefined {
29
29
  }
30
30
  /* eslint-enable */
31
31
 
32
+ /* @__PURE__ */
32
33
  export const LANG_TO_LOCALE: Record<Lang, Locale> = {
33
34
  [Lang.EN]: Locale.en_US,
34
35
  [Lang.FR]: Locale.fr_FR,
@@ -39,6 +40,7 @@ export const LANG_TO_LOCALE: Record<Lang, Locale> = {
39
40
  [Lang.PT]: Locale.en_US,
40
41
  }
41
42
 
43
+ /* @__PURE__ */
42
44
  export const LOCALE_TO_LANG = {
43
45
  [Locale.de_DE]: Lang.DE,
44
46
  [Locale.en_US]: Lang.EN,
@@ -49,6 +51,7 @@ export const LOCALE_TO_LANG = {
49
51
  [Locale.pt_PT]: Lang.PT,
50
52
  }
51
53
 
54
+ /* @__PURE__ */
52
55
  export const LOCALES = {
53
56
  [Locale.en_US]: {
54
57
  code: Locale.en_US,
@@ -101,6 +104,9 @@ export const LOCALES = {
101
104
  },
102
105
  }
103
106
 
107
+ /* @__PURE__ */
104
108
  export const DATE_STRING_FORMAT = 'YYYY-MM-DD'
109
+ /* @__PURE__ */
105
110
  export const FR_DATE_STRING_FORMAT = 'DD-MM-YYYY'
111
+ /* @__PURE__ */
106
112
  export const DEFAULT_LOCALE = Locale.fr_FR
@@ -1,3 +1,4 @@
1
+ /* @__PURE__ */
1
2
  export const MEGABYTE = 1_048_576
2
3
 
3
4
  export enum ConversionFactor {
@@ -1 +1,2 @@
1
+ /* @__PURE__ */
1
2
  export const DEFAULT_TIMEZONE = 'Europe/Paris'