@revolugo/common 7.1.1 → 7.2.0-rc.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.
@@ -78,7 +78,7 @@ export interface Booking {
78
78
  createdAt: string
79
79
  /**
80
80
  *
81
- * @type {CurrencyBookingApiClient}
81
+ * @type {CurrencyClient}
82
82
  * @memberof Booking
83
83
  */
84
84
  currency: CurrencyType
@@ -163,10 +163,6 @@ export interface PrebookFormValues {
163
163
  firstName: ContactPerson['firstName']
164
164
  lastName: ContactPerson['lastName']
165
165
  nationality: ContactPerson['nationality']
166
- phoneCountry: CountryIso2Code
167
- phoneNumber: string
168
- salutation: ContactPerson['salutation']
169
- specialRequests: ContactPerson['remarks']
170
166
  organizationAddress?: string
171
167
  organizationCity?: string
172
168
  organizationCountry?: string
@@ -174,4 +170,8 @@ export interface PrebookFormValues {
174
170
  organizationState?: string
175
171
  organizationVatNumber?: string
176
172
  organizationZipCode?: string
173
+ phoneCountry: CountryIso2Code
174
+ phoneNumber: string
175
+ salutation: ContactPerson['salutation']
176
+ specialRequests: ContactPerson['remarks']
177
177
  }
@@ -65,7 +65,7 @@ export interface HotelOffer {
65
65
  countryCode?: string | null
66
66
  /**
67
67
  *
68
- * @type {CurrencyBookingApiClient}
68
+ * @type {CurrencyClient}
69
69
  * @memberof HotelOffer
70
70
  */
71
71
  currency?: CurrencyCode
@@ -127,6 +127,7 @@ export interface HotelRoomOfferRequestResponse {
127
127
  sourceMarket: SourceMarket
128
128
  }
129
129
 
130
+ // eslint-disable-next-line no-restricted-syntax
130
131
  export type HotelRoomOfferRequestCreate = Pick<
131
132
  HotelRoomOfferRequest,
132
133
  | 'adultCount'
@@ -128,7 +128,7 @@ export interface HotelRoomOffer {
128
128
  count?: number | null
129
129
  /**
130
130
  *
131
- * @type {CurrencyBookingApiClient}
131
+ * @type {CurrencyClient}
132
132
  * @memberof HotelRoomOffer
133
133
  */
134
134
  currency: CurrencyType
@@ -259,7 +259,7 @@ export interface HotelRoomOfferResponse {
259
259
  children?: string | null
260
260
  /**
261
261
  *
262
- * @type {CurrencyBookingApiClient}
262
+ * @type {CurrencyClient}
263
263
  * @memberof HotelRoomOfferResponse
264
264
  */
265
265
  currency: CurrencyType
@@ -62,7 +62,7 @@ export interface Hotel {
62
62
  countryCode?: string | null
63
63
  /**
64
64
  *
65
- * @type {CurrencyBookingApiClient}
65
+ * @type {CurrencyClient}
66
66
  * @memberof HotelApi
67
67
  */
68
68
  currency?: CurrencyType
@@ -14,7 +14,7 @@ export * from './hotel-room-offer-type.ts'
14
14
  export * from './hotel-room-offer-package-type.ts'
15
15
  export type * from './hotel-room-offer-request.ts'
16
16
  export type * from './hotel-room.ts'
17
- export { SourceMarketEnum } from './source-market.ts'
17
+ export * from './source-market.ts'
18
18
  export type * from './tag.ts'
19
19
  export * from './tax.ts'
20
20
  export * from './booking.ts'
@@ -79,7 +79,7 @@ export function keysChangeCase<T>(
79
79
 
80
80
  options: { deep?: boolean; exclude?: (string | RegExp)[] } = { deep: true },
81
81
  ): unknown {
82
- if (isObject(obj)) {
82
+ if (isObject(obj) && !(obj instanceof Date)) {
83
83
  return Object.keys(obj).reduce<any>((result, key) => {
84
84
  // Check if key should be excluded from the transformation
85
85
  const transformedKey =
@@ -17,7 +17,7 @@ import 'dayjs/locale/fr.js'
17
17
  import 'dayjs/locale/en.js'
18
18
  /* eslint-enable no-restricted-syntax, import/no-unassigned-import */
19
19
 
20
- /* eslint-disable import-x/no-named-as-default-member */
20
+ /* eslint-disable import/no-named-as-default-member */
21
21
  dayjs.extend(advancedFormat)
22
22
  dayjs.extend(isBetween)
23
23
  dayjs.extend(isSameOrAfter)
@@ -28,7 +28,7 @@ dayjs.extend(minMax)
28
28
  dayjs.extend(relativeTime)
29
29
  dayjs.extend(timezone)
30
30
  dayjs.extend(utc)
31
- /* eslint-enable import-x/no-named-as-default-member */
31
+ /* eslint-enable import/no-named-as-default-member */
32
32
 
33
33
  export { dayjs }
34
34
 
package/src/utils/omit.ts CHANGED
@@ -6,6 +6,7 @@
6
6
  export function omit<T extends object, K extends keyof T>(
7
7
  object: T | null | undefined,
8
8
  keys: readonly K[] | K,
9
+ // eslint-disable-next-line no-restricted-syntax
9
10
  ): Omit<T, K> {
10
11
  if (object === null || object === undefined) {
11
12
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -35,5 +36,6 @@ export function omit<T extends object, K extends keyof T>(
35
36
  }
36
37
  }
37
38
 
39
+ // eslint-disable-next-line no-restricted-syntax
38
40
  return result as Omit<T, K>
39
41
  }
package/src/utils/pick.ts CHANGED
@@ -1,7 +1,9 @@
1
1
  export function pick<T extends object, K extends keyof T>(
2
2
  obj: T,
3
3
  keys: readonly K[],
4
+ // eslint-disable-next-line no-restricted-syntax
4
5
  ): Pick<T, K> {
6
+ // eslint-disable-next-line no-restricted-syntax
5
7
  const result = {} as Pick<T, K>
6
8
  for (const key of keys) {
7
9
  if (Object.hasOwn(obj, key)) {
@@ -7,6 +7,7 @@ export function shake<RemovedKeys extends string, T>(
7
7
  obj: T,
8
8
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
9
9
  filter: (value: any) => boolean = x => x === undefined,
10
+ // eslint-disable-next-line no-restricted-syntax
10
11
  ): Omit<T, RemovedKeys> {
11
12
  if (!obj) {
12
13
  return {} as T
@@ -1,43 +0,0 @@
1
- import { z } from 'zod'
2
-
3
- import { CountryIso2Code } from '../constants/index.ts'
4
-
5
- export const ADULT_COUNT_SCHEMA = z.number().int().min(1).max(200).openapi({
6
- description:
7
- 'The total number of adults who will be staying in the property.',
8
- })
9
-
10
- export const CHECK_IN_DATE_SCHEMA = z
11
- .string()
12
- .regex(/^(19|20)\d\d[- /.](0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])$/u)
13
- .openapi({ description: 'Date of check-in formatted as YYYY-MM-DD.' })
14
-
15
- export const CHECK_OUT_DATE_SCHEMA = z
16
- .string()
17
- .regex(/^(19|20)\d\d[- /.](0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])$/u)
18
- .openapi({ description: 'Date of check-out formatted as YYYY-MM-DD.' })
19
-
20
- export const CHILDREN_SCHEMA = z
21
- .string()
22
- .regex(/^(([0-9]{1})|(1[0-7]){1})(,(([0-9]{1})|(1[0-7]){1}))*$|^$/u)
23
- .openapi({
24
- description:
25
- 'A comma-separated list of child ages (0 up to 17). e.g.: "3,7" represents 2 children respectively 3 and 7 years old.',
26
- })
27
-
28
- export const COUNTRY_ISO2_CODE_SCHEMA = z
29
- .enum(CountryIso2Code)
30
- .refine(check => Object.values(CountryIso2Code).includes(check), {
31
- message: 'Invalid ISO Alpha-2 country code.',
32
- })
33
- .openapi({
34
- description: 'ISO Alpha-2 country code.',
35
- })
36
-
37
- export const SOURCE_MARKET_SCHEMA = COUNTRY_ISO2_CODE_SCHEMA.openapi(
38
- 'sourceMarket',
39
- {
40
- description:
41
- 'For sourcing availability within certain markets, a source market option may be used to get more accurate prices. You may use any valid ISO Alpha-2 country code, e.g. JP.',
42
- },
43
- )