@revolugo/common 7.2.3-rc.1 → 7.2.4-alpha.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@revolugo/common",
3
- "version": "7.2.3-rc.1",
3
+ "version": "7.2.4-alpha.0",
4
4
  "private": false,
5
5
  "description": "Revolugo common",
6
6
  "author": "Revolugo",
@@ -14,18 +14,18 @@ export enum RevolutEnv {
14
14
  }
15
15
 
16
16
  export enum StripeEnv {
17
+ Local = 'local',
17
18
  Production = 'live',
18
19
  Sandbox = 'sandbox',
19
20
  Staging = 'staging',
20
- Local = 'local',
21
21
  }
22
22
 
23
23
  export enum Environment {
24
+ CiCd = 'CI-CD',
25
+ Local = 'LOCAL',
24
26
  Production = 'LIVE',
25
27
  Sandbox = 'SANDBOX',
26
28
  Staging = 'STAGING',
27
- CiCd = 'CI-CD',
28
- Local = 'LOCAL',
29
29
  }
30
30
 
31
31
  export enum NodeEnv {
@@ -42,12 +42,12 @@ export enum LogLevel {
42
42
  Error = 50,
43
43
  }
44
44
  export enum BookingEnvironment {
45
+ // DEVELOPMENT: do NOT book hotel, do NOT send confirmation email
46
+ Development = 'development',
45
47
  // PRODUCTION: actually book hotel, send confirmation email
46
48
  Production = 'production',
47
49
  // SANDBOX: do NOT book hotel, still send confirmation email
48
50
  Sandbox = 'sandbox',
49
- // DEVELOPMENT: do NOT book hotel, do NOT send confirmation email
50
- Development = 'development',
51
51
  }
52
52
 
53
53
  /* @__PURE__ */
@@ -1,13 +1,13 @@
1
1
  export * from '../countries/constants.ts'
2
2
  export * from '../currencies/constants.ts'
3
3
  export * from './environment.ts'
4
- export * from './hotel.ts'
5
4
  export * from './hotel-offers.ts'
6
5
  export * from './hotel-room-offer.ts'
6
+ export * from './hotel.ts'
7
7
  export * from './locales.ts'
8
8
  export * from './measurement.ts'
9
9
  export * from './poller.ts'
10
+ export * from './stay-taxes-info.ts'
10
11
  export * from './tax.ts'
11
12
  export * from './time.ts'
12
- export * from './stay-taxes-info.ts'
13
13
  export * from './venue.ts'
package/src/http/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- export * from 'ky'
2
1
  export * from './http.utils.ts'
2
+ export * from 'ky'
3
3
 
4
4
  export { default } from 'ky'
@@ -35,10 +35,7 @@ export const BOOKING_POLICY_SCHEMA = z
35
35
  hotel_id: z.string().openapi({
36
36
  description: 'Hotel id',
37
37
  }),
38
- hotel_room_offer: HOTEL_ROOM_OFFER_SCHEMA.openapi({
39
- description:
40
- 'The **Hotel Room Offer** associated with this **Booking Policy**.',
41
- }),
38
+ hotel_room_offer: HOTEL_ROOM_OFFER_SCHEMA,
42
39
  id: z.string().openapi({
43
40
  description: '**Booking Policy** id',
44
41
  }),
@@ -1,5 +1,5 @@
1
- export * from './breakfast.ts'
2
1
  export * from './booking-policy.ts'
2
+ export * from './breakfast.ts'
3
3
  export * from './cancellation-policies.ts'
4
4
  export * from './currency.ts'
5
5
  export * from './global.ts'
@@ -16,6 +16,12 @@ export interface Booking {
16
16
  * @memberof Booking
17
17
  */
18
18
  id?: string | null
19
+ /**
20
+ * Creation date of the **Booking**.
21
+ * @type {string}
22
+ * @memberof Booking
23
+ */
24
+ createdAt: string
19
25
  /**
20
26
  * The total number of adults who will be staying in the property.
21
27
  * @type {number}
@@ -70,12 +76,6 @@ export interface Booking {
70
76
  * @memberof Booking
71
77
  */
72
78
  contactPerson: ContactPerson
73
- /**
74
- * Creation date of the **Booking**.
75
- * @type {string}
76
- * @memberof Booking
77
- */
78
- createdAt: string
79
79
  /**
80
80
  *
81
81
  * @type {CurrencyClient}
@@ -223,10 +223,10 @@ export enum BookingApiPayLaterEnum {
223
223
  type BookingApiPayLater = `${BookingApiPayLaterEnum}`
224
224
 
225
225
  export enum BookingStatusEnum {
226
- Cx = 'bkg-cx',
226
+ Af = 'bkg-af',
227
227
  Cf = 'bkg-cf',
228
228
  Created = 'bkg-created',
229
- Af = 'bkg-af',
229
+ Cx = 'bkg-cx',
230
230
  Ip = 'bkg-ip',
231
231
  Pc = 'bkg-pc',
232
232
  Pp = 'bkg-pp',
@@ -7,6 +7,12 @@ export interface HotelOfferRequest {
7
7
  * @type {string}
8
8
  */
9
9
  id: string
10
+ /**
11
+ * Date of the **Hotel Room Offer Request** creation
12
+ * @type {string}
13
+ * @memberof HotelOfferRequestApiResponse
14
+ */
15
+ createdAt: string
10
16
  /**
11
17
  * This endpoint allows to find the geo-coordinates of a known address, place or locality via this free-text address query field. This address will eventually be geocoded into a latitude/longitude pair.
12
18
  *
@@ -34,12 +40,6 @@ export interface HotelOfferRequest {
34
40
  * @type {string}
35
41
  */
36
42
  children?: string | null
37
- /**
38
- * Date of the **Hotel Room Offer Request** creation
39
- * @type {string}
40
- * @memberof HotelOfferRequestApiResponse
41
- */
42
- createdAt: string
43
43
  /**
44
44
  *
45
45
  * @type {EventMetadata}
@@ -80,6 +80,12 @@ export interface HotelOfferRequestResponse {
80
80
  * @memberof HotelOfferRequestApiResponse
81
81
  */
82
82
  id: string
83
+ /**
84
+ * Date of the **Hotel Offer Request** creation
85
+ * @type {string}
86
+ * @memberof HotelOfferRequestApiResponse
87
+ */
88
+ createdAt: string
83
89
  /**
84
90
  * This endpoint allows to find the geo-coordinates of a known address, place or locality via this free-text address query field. This address will eventually be geocoded into a latitude/longitude pair.
85
91
  *
@@ -112,12 +118,6 @@ export interface HotelOfferRequestResponse {
112
118
  * @memberof HotelOfferRequestApiResponse
113
119
  */
114
120
  children?: string | null
115
- /**
116
- * Date of the **Hotel Offer Request** creation
117
- * @type {string}
118
- * @memberof HotelOfferRequestApiResponse
119
- */
120
- createdAt: string
121
121
  /**
122
122
  *
123
123
  * @type {EventMetadataApi}
@@ -8,6 +8,12 @@ export interface HotelRoomOfferRequest {
8
8
  * @memberof HotelRoomOfferRequest
9
9
  */
10
10
  id: string
11
+ /**
12
+ * Date of the **Hotel Room Offer Request** creation
13
+ * @type {string}
14
+ * @memberof HotelRoomOfferRequest
15
+ */
16
+ createdAt: string
11
17
  /**
12
18
  * Requested number of adult(s) to be accommodated.
13
19
  * @type {number}
@@ -32,12 +38,6 @@ export interface HotelRoomOfferRequest {
32
38
  * @memberof HotelRoomOfferRequest
33
39
  */
34
40
  children?: string | null
35
- /**
36
- * Date of the **Hotel Room Offer Request** creation
37
- * @type {string}
38
- * @memberof HotelRoomOfferRequest
39
- */
40
- createdAt: string
41
41
  /**
42
42
  *
43
43
  * @type {EventMetadata}
@@ -71,6 +71,12 @@ export interface HotelRoomOfferRequestResponse {
71
71
  * @memberof HotelRoomOfferRequestApiResponse
72
72
  */
73
73
  id: string
74
+ /**
75
+ * Date of the **Hotel Room Offer Request** creation
76
+ * @type {string}
77
+ * @memberof HotelRoomOfferRequestApiResponse
78
+ */
79
+ createdAt: string
74
80
  /**
75
81
  * Requested number of adult(s) to be accommodated.
76
82
  * @type {number}
@@ -95,12 +101,6 @@ export interface HotelRoomOfferRequestResponse {
95
101
  * @memberof HotelRoomOfferRequestApiResponse
96
102
  */
97
103
  children?: string | null
98
- /**
99
- * Date of the **Hotel Room Offer Request** creation
100
- * @type {string}
101
- * @memberof HotelRoomOfferRequestApiResponse
102
- */
103
- createdAt: string
104
104
  /**
105
105
  *
106
106
  * @type {EventMetadataApi}
@@ -127,18 +127,16 @@ export interface HotelRoomOfferRequestResponse {
127
127
  sourceMarket: SourceMarket
128
128
  }
129
129
 
130
- // eslint-disable-next-line no-restricted-syntax
131
- export type HotelRoomOfferRequestCreate = Pick<
132
- HotelRoomOfferRequest,
133
- | 'adultCount'
134
- | 'checkInDate'
135
- | 'checkOutDate'
136
- | 'children'
137
- | 'eventMetadata'
138
- | 'hotelId'
139
- | 'roomCount'
140
- | 'sourceMarket'
141
- >
130
+ export interface HotelRoomOfferRequestCreate {
131
+ adultCount: HotelRoomOfferRequest['adultCount']
132
+ checkInDate: HotelRoomOfferRequest['checkInDate']
133
+ checkOutDate: HotelRoomOfferRequest['checkOutDate']
134
+ children?: HotelRoomOfferRequest['children']
135
+ eventMetadata?: HotelRoomOfferRequest['eventMetadata']
136
+ hotelId: HotelRoomOfferRequest['hotelId']
137
+ roomCount: HotelRoomOfferRequest['roomCount']
138
+ sourceMarket: HotelRoomOfferRequest['sourceMarket']
139
+ }
142
140
  export interface HotelRoomOfferRequestsCreatePayload {
143
141
  hotelRoomOfferRequestCreateApi?: HotelRoomOfferRequestCreate
144
142
  }
@@ -1,31 +1,31 @@
1
+ export * from './booking.ts'
2
+ export * from './contact-person.ts'
3
+ export * from './elements-events.ts'
4
+ export * from './hotel-offer-list.ts'
5
+ export * from './hotel-offer.ts'
6
+ export * from './hotel-offers-filters.ts'
7
+ export * from './hotel-room-offer-package-type.ts'
8
+ export * from './hotel-room-offer-type.ts'
9
+ export * from './invoice.ts'
10
+ export * from './payment-method.ts'
11
+ export * from './source-market.ts'
12
+ export * from './tax.ts'
13
+ export type * from './allowed-payment-method.ts'
1
14
  export type * from './bed.ts'
2
15
  export type * from './booking-flow.ts'
3
16
  export type * from './booking-policy.ts'
4
17
  export type * from './cancellation-policy.ts'
5
18
  export type * from './currency.ts'
6
- export * from './elements-events.ts'
7
19
  export type * from './event-metadata.ts'
8
20
  export type * from './hotel-image.ts'
9
21
  export type * from './hotel-images.ts'
10
22
  export type * from './hotel-offer-request.ts'
11
- export * from './hotel-offers-filters.ts'
12
- export type * from './hotel-room-offer.ts'
13
- export * from './hotel-room-offer-type.ts'
14
- export * from './hotel-room-offer-package-type.ts'
23
+ export type * from './hotel-review-rating.ts'
24
+ export type * from './hotel-room-offer-list.ts'
15
25
  export type * from './hotel-room-offer-request.ts'
26
+ export type * from './hotel-room-offer.ts'
16
27
  export type * from './hotel-room.ts'
17
- export * from './source-market.ts'
18
- export type * from './tag.ts'
19
- export * from './tax.ts'
20
- export * from './booking.ts'
21
- export * from './payment-method.ts'
22
- export * from './invoice.ts'
28
+ export type * from './hotel-rooming-list.ts'
23
29
  export type * from './hotel.ts'
24
- export * from './hotel-offer.ts'
25
- export * from './contact-person.ts'
26
- export type * from './hotel-review-rating.ts'
30
+ export type * from './tag.ts'
27
31
  export type * from './travel-times.ts'
28
- export * from './hotel-offer-list.ts'
29
- export type * from './hotel-room-offer-list.ts'
30
- export type * from './hotel-rooming-list.ts'
31
- export type * from './allowed-payment-method.ts'
@@ -1,8 +1,8 @@
1
1
  import type { PayLaterStatus } from '../booking.ts'
2
2
 
3
3
  export enum PaymentMethodNameEnum {
4
- CreditCard = 'CREDIT_CARD',
5
4
  Coupon = 'COUPON',
5
+ CreditCard = 'CREDIT_CARD',
6
6
  DepositAccount = 'DEPOSIT_ACCOUNT',
7
7
  PayLater = 'PAY_LATER',
8
8
  }
@@ -61,7 +61,7 @@ export interface PayloadPayLater {
61
61
  status: PayLaterStatus
62
62
  }
63
63
  export interface PaymentMethodPayLater extends BasePaymentMethodPayLater {
64
- payload: { amount: number; couponId?: string | null } & PayloadPayLater
64
+ payload: PayloadPayLater & { amount: number; couponId?: string | null }
65
65
  }
66
66
 
67
67
  export interface PaymentMethodRequest {
@@ -3,6 +3,7 @@ import type { IHotelRoomStock } from './hotel-room-stock.ts'
3
3
  export interface IHotelContract {
4
4
  id: string
5
5
  createdAt: string
6
+ updatedAt: string
6
7
  forcedTotalComissionsAmount: number
7
8
  forcedTotalPurchasedAmount: number
8
9
  forcedTotalVatComissionsAmount: number
@@ -10,6 +11,5 @@ export interface IHotelContract {
10
11
  hotelRoomStocks?: IHotelRoomStock[]
11
12
  name: string
12
13
  status: string
13
- updatedAt: string
14
14
  userId: string
15
15
  }
@@ -1,5 +1,5 @@
1
1
  export * from './bad-request.exception.ts'
2
2
  export * from './forbidden.exception.ts'
3
+ export * from './internal-server-error.exception.ts'
3
4
  export * from './unauthorized.exception.ts'
4
5
  export * from './unprocessable-entity.exception.ts'
5
- export * from './internal-server-error.exception.ts'
@@ -1,8 +1,15 @@
1
+ export * from './booking.ts'
2
+ export * from './elements/index.ts'
3
+
4
+ export * from './hotel-rooming-list.ts'
5
+ export * from './http-exception/index.ts'
6
+ export * from './pagination.ts'
7
+ export * from './payment.ts'
8
+ export * from './severities.ts'
9
+ export * from './taxable.ts'
1
10
  export type * from '../countries/types.ts'
2
11
  export type * from '../currencies/types.ts'
3
-
4
12
  export type * from './api.ts'
5
- export * from './booking.ts'
6
13
  export type * from './calendar.ts'
7
14
  export type * from './cancellation-policy.ts'
8
15
  export type * from './date.ts'
@@ -12,10 +19,3 @@ export type * from './hotel-contract.ts'
12
19
  export type * from './hotel-room-stock.ts'
13
20
  export type * from './money-object.ts'
14
21
  export type * from './paginated-queries.ts'
15
- export * from './pagination.ts'
16
- export * from './payment.ts'
17
- export * from './taxable.ts'
18
- export * from './severities.ts'
19
- export * from './http-exception/index.ts'
20
- export * from './hotel-rooming-list.ts'
21
- export * from './elements/index.ts'
@@ -4,8 +4,8 @@ export enum Order {
4
4
  }
5
5
 
6
6
  export enum PaginationMode {
7
- StartingAfter = 'STARTING_AFTER',
8
7
  EndingBefore = 'ENDING_BEFORE',
8
+ StartingAfter = 'STARTING_AFTER',
9
9
  }
10
10
 
11
11
  export interface IPaginationOptions {
@@ -11,10 +11,10 @@ export enum PaymentAssociationResourceType {
11
11
  }
12
12
 
13
13
  export enum PaymentProvider {
14
- Stripe = 'STRIPE',
15
- Qonto = 'QONTO',
16
14
  IbanFirst = 'IBANFIRST',
15
+ Qonto = 'QONTO',
17
16
  Revolut = 'REVOLUT',
17
+ Stripe = 'STRIPE',
18
18
  }
19
19
 
20
20
  export enum PublicPaymentMethod {
@@ -25,6 +25,6 @@ export enum PublicPaymentMethod {
25
25
 
26
26
  export enum PublicPaymentStatus {
27
27
  Confirmed = 'confirmed',
28
- Pending = 'pending',
29
28
  Failed = 'failed',
29
+ Pending = 'pending',
30
30
  }
@@ -1,12 +1,12 @@
1
1
  export enum Severity {
2
- Info = 'info',
3
- Success = 'success',
4
- Warn = 'warn',
2
+ Contrast = 'contrast',
3
+ Danger = 'danger',
4
+ Error = 'error',
5
5
  Help = 'help',
6
+ Info = 'info',
6
7
  Primary = 'primary',
7
8
  Secondary = 'secondary',
9
+ Success = 'success',
8
10
  Tertiary = 'tertiary',
9
- Danger = 'danger',
10
- Error = 'error',
11
- Contrast = 'contrast',
11
+ Warn = 'warn',
12
12
  }
@@ -1,7 +1,6 @@
1
1
  export * from './add-classes.ts'
2
2
  export * from './amount-from-percentage.ts'
3
3
  export * from './case-transformers.ts'
4
- export * from './keys-case-transformer.ts'
5
4
  export * from './chunk.ts'
6
5
  export * from './colors.ts'
7
6
  export * from './compact-object.ts'
@@ -9,6 +8,7 @@ export * from './compact.ts'
9
8
  export * from './compute-margin-rate.ts'
10
9
  export * from './compute-selling-price.ts'
11
10
  export * from './create-composite-key.ts'
11
+ export * from './create-dummy-hotel-images.ts'
12
12
  export * from './dates.ts'
13
13
  export * from './dayjs.ts'
14
14
  export * from './debounce.ts'
@@ -20,8 +20,8 @@ export * from './generate-numbers-from-str.ts'
20
20
  export * from './generate-pseudo-random-string.ts'
21
21
  export * from './generate-random-nearby-geolocation.ts'
22
22
  export * from './get-guest-count.ts'
23
- export * from './get-night-count.ts'
24
23
  export * from './get-hotel-room-offer-room-count.ts'
24
+ export * from './get-night-count.ts'
25
25
  export * from './get-random-element-from-array.ts'
26
26
  export * from './get-random-hex-color.ts'
27
27
  export * from './get-random-int.ts'
@@ -33,6 +33,7 @@ export * from './is-equal.ts'
33
33
  export * from './is-nil.ts'
34
34
  export * from './is-object.ts'
35
35
  export * from './key-by.ts'
36
+ export * from './keys-case-transformer.ts'
36
37
  export * from './lang-default-fallbacks.ts'
37
38
  export * from './map-keys.ts'
38
39
  export * from './map-values.ts'
@@ -55,9 +56,8 @@ export * from './to-boolean.ts'
55
56
  export * from './to-lang.ts'
56
57
  export * from './to-locale.ts'
57
58
  export * from './transform-schema-keys.ts'
58
- export * from './uniq.ts'
59
59
  export * from './uniq-by.ts'
60
60
  export * from './uniq-with.ts'
61
+ export * from './uniq.ts'
61
62
  export * from './validators.ts'
62
63
  export * from './weighted-mean.ts'
63
- export * from './create-dummy-hotel-images.ts'
package/src/utils/omit.ts CHANGED
@@ -3,6 +3,7 @@
3
3
  * Accepts a single key or an array of keys. Symbol keys are supported.
4
4
  * If `object` is nullish, returns an empty object.
5
5
  */
6
+ // eslint-disable-next-line no-restricted-syntax
6
7
  export function omit<T extends object, K extends keyof T>(
7
8
  object: T | null | undefined,
8
9
  keys: readonly K[] | K,
package/src/utils/pick.ts CHANGED
@@ -1,3 +1,4 @@
1
+ // eslint-disable-next-line no-restricted-syntax
1
2
  export function pick<T extends object, K extends keyof T>(
2
3
  obj: T,
3
4
  keys: readonly K[],
@@ -3,6 +3,7 @@
3
3
  * object. Optional second argument shakes out values
4
4
  * by custom evaluation.
5
5
  */
6
+ // eslint-disable-next-line no-restricted-syntax
6
7
  export function shake<RemovedKeys extends string, T>(
7
8
  obj: T,
8
9
  // eslint-disable-next-line @typescript-eslint/no-explicit-any