@roomstay/core 0.1.58 → 0.1.59
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/dist/node.js.LICENSE.txt +7 -0
- package/dist/types/Booking/IBookingCreateErrorResponse.type.d.ts +2 -0
- package/dist/types/Booking/IBookingPayment.type.d.ts +3 -0
- package/dist/types/Booking/ICheckoutBrowserSession.type.d.ts +14 -0
- package/dist/types/General/IJsonString.type.d.ts +6 -0
- package/dist/types/GiftCards/GiftCard.types.d.ts +16 -88
- package/dist/types/GiftCards/GiftCardAuth.types.d.ts +1 -1
- package/dist/utils/zodUtils.d.ts +2 -2
- package/dist/web.js.LICENSE.txt +7 -0
- package/package.json +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IPaymentCheckoutDetails } from './IBookingPayment.type';
|
|
1
2
|
/**
|
|
2
3
|
* This is the response body that comes down if a booking fails anywhere in the booking flow.
|
|
3
4
|
*
|
|
@@ -6,6 +7,7 @@
|
|
|
6
7
|
export type IBookingCreateErrorResponse = {
|
|
7
8
|
canRetryPayment: boolean;
|
|
8
9
|
isPaymentTaken: boolean;
|
|
10
|
+
paymentRequired?: IPaymentCheckoutDetails;
|
|
9
11
|
publicMessage: string;
|
|
10
12
|
roomstayId: string;
|
|
11
13
|
};
|
|
@@ -56,6 +56,7 @@ export type IBookingPayment = {
|
|
|
56
56
|
PaymentCard?: IBookingPaymentTokenizedCard;
|
|
57
57
|
PCICardDetails?: IPCIBookingCardNotificationData;
|
|
58
58
|
RedirectUrl?: string;
|
|
59
|
+
SplitPaymentAmount?: number;
|
|
59
60
|
};
|
|
60
61
|
export type IPaymentCheckoutDetails = {
|
|
61
62
|
planpay?: {
|
|
@@ -85,5 +86,7 @@ export type IPaymentCheckoutDetails = {
|
|
|
85
86
|
paymentMode: 'EmbeddedPage' | 'PaymentPage';
|
|
86
87
|
baseUrl: string;
|
|
87
88
|
};
|
|
89
|
+
isSplitPayment?: boolean;
|
|
90
|
+
totalAuthorizedAmount?: number;
|
|
88
91
|
};
|
|
89
92
|
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { EHotelCardProcessor, EHotelCardProcessorInitData } from './IBookingPayment.type';
|
|
2
|
+
export type ICheckoutBrowserSession<T extends EHotelCardProcessor | undefined = EHotelCardProcessor> = {
|
|
3
|
+
browserSessionId: string;
|
|
4
|
+
checkoutSessionId: string;
|
|
5
|
+
rows: {}[];
|
|
6
|
+
/**
|
|
7
|
+
* ISO 8601 date string
|
|
8
|
+
*/
|
|
9
|
+
expiry: string;
|
|
10
|
+
payment: {
|
|
11
|
+
processor: T;
|
|
12
|
+
data: EHotelCardProcessorInitData[T];
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -1,42 +1,4 @@
|
|
|
1
|
-
import * as z from 'zod';
|
|
2
|
-
/**
|
|
3
|
-
* Schema for validating international addresses.
|
|
4
|
-
*/
|
|
5
|
-
export declare const InternationalAddressSchema: z.ZodObject<{
|
|
6
|
-
address1: z.ZodString;
|
|
7
|
-
address2: z.ZodOptional<z.ZodString>;
|
|
8
|
-
city: z.ZodString;
|
|
9
|
-
state: z.ZodOptional<z.ZodString>;
|
|
10
|
-
postcode: z.ZodOptional<z.ZodString>;
|
|
11
|
-
country: z.ZodString;
|
|
12
|
-
}, z.core.$strip>;
|
|
13
|
-
/**
|
|
14
|
-
* Basic details of a gift card that can be shared with customers.
|
|
15
|
-
*/
|
|
16
|
-
export type IGiftCardDTO = {
|
|
17
|
-
code: string;
|
|
18
|
-
amount: number;
|
|
19
|
-
balance: number;
|
|
20
|
-
expiry: Date;
|
|
21
|
-
giverFirstName: string;
|
|
22
|
-
giverLastName: string;
|
|
23
|
-
cardHolder: string;
|
|
24
|
-
message?: string | null;
|
|
25
|
-
};
|
|
26
|
-
/**
|
|
27
|
-
* Details of a gift card that can be shared with admins.
|
|
28
|
-
*/
|
|
29
|
-
export type IAdminGiftCardDTO = IGiftCardDTO & {
|
|
30
|
-
createdBy?: string | null;
|
|
31
|
-
giverEmail: string;
|
|
32
|
-
giverPhone: string;
|
|
33
|
-
recipientEmail: string;
|
|
34
|
-
recipientPhone?: string | null;
|
|
35
|
-
notes?: string | null;
|
|
36
|
-
};
|
|
37
|
-
/**
|
|
38
|
-
* Schema for valiated adding a new gift card from admin.
|
|
39
|
-
*/
|
|
1
|
+
import * as z from 'zod/v4';
|
|
40
2
|
export declare const AddGiftCardSchema: z.ZodObject<{
|
|
41
3
|
amount: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodType<number, unknown, z.core.$ZodTypeInternals<number, unknown>>>;
|
|
42
4
|
expiry: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodType<Date, unknown, z.core.$ZodTypeInternals<Date, unknown>>>;
|
|
@@ -44,61 +6,27 @@ export declare const AddGiftCardSchema: z.ZodObject<{
|
|
|
44
6
|
giverLastName: z.ZodString;
|
|
45
7
|
giverEmail: z.ZodEmail;
|
|
46
8
|
giverPhone: z.ZodString;
|
|
47
|
-
giverAddress: z.ZodObject<{
|
|
48
|
-
address1: z.ZodString;
|
|
49
|
-
address2: z.ZodOptional<z.ZodString>;
|
|
50
|
-
city: z.ZodString;
|
|
51
|
-
state: z.ZodOptional<z.ZodString>;
|
|
52
|
-
postcode: z.ZodOptional<z.ZodString>;
|
|
53
|
-
country: z.ZodString;
|
|
54
|
-
}, z.core.$strip>;
|
|
55
9
|
cardHolder: z.ZodString;
|
|
56
10
|
recipientEmail: z.ZodEmail;
|
|
57
11
|
recipientPhone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
58
12
|
notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
59
13
|
}, z.core.$strip>;
|
|
60
14
|
export type IAddGiftCardRequest = z.infer<typeof AddGiftCardSchema>;
|
|
61
|
-
export type IAddGiftCardResponse =
|
|
15
|
+
export type IAddGiftCardResponse = IGiftCardDTO & {
|
|
62
16
|
password: string;
|
|
63
17
|
};
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
giverFirstName:
|
|
71
|
-
giverLastName:
|
|
72
|
-
giverEmail:
|
|
73
|
-
giverPhone:
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
state: z.ZodOptional<z.ZodString>;
|
|
79
|
-
postcode: z.ZodOptional<z.ZodString>;
|
|
80
|
-
country: z.ZodString;
|
|
81
|
-
}, z.core.$strip>;
|
|
82
|
-
cardHolder: z.ZodString;
|
|
83
|
-
recipientFirstName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
84
|
-
recipientLastName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
85
|
-
recipientEmail: z.ZodOptional<z.ZodNullable<z.ZodEmail>>;
|
|
86
|
-
recipientPhone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
87
|
-
sendViaEmail: z.ZodDefault<z.ZodBoolean>;
|
|
88
|
-
message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
89
|
-
payment: z.ZodOptional<z.ZodObject<{
|
|
90
|
-
cardHolder: z.ZodString;
|
|
91
|
-
cardNumberToken: z.ZodString;
|
|
92
|
-
cardExpiry: z.ZodString;
|
|
93
|
-
cardCvcToken: z.ZodString;
|
|
94
|
-
}, z.core.$strip>>;
|
|
95
|
-
}, z.core.$strip>;
|
|
96
|
-
export type IPurchaseGiftCardRequest = z.infer<typeof PurchaseGiftCardSchema>;
|
|
97
|
-
export type IPurchaseGiftCardResponse = IGiftCardDTO & {
|
|
98
|
-
password: string;
|
|
18
|
+
export type IGiftCardDTO = {
|
|
19
|
+
code: string;
|
|
20
|
+
createdBy?: string | null;
|
|
21
|
+
amount: number;
|
|
22
|
+
balance: number;
|
|
23
|
+
expiry: Date;
|
|
24
|
+
giverFirstName: string;
|
|
25
|
+
giverLastName: string;
|
|
26
|
+
giverEmail: string;
|
|
27
|
+
giverPhone: string;
|
|
28
|
+
cardHolder: string;
|
|
29
|
+
recipientEmail: string;
|
|
30
|
+
recipientPhone?: string | null;
|
|
31
|
+
notes?: string | null;
|
|
99
32
|
};
|
|
100
|
-
export declare const RedeemGiftCardSchema: z.ZodObject<{
|
|
101
|
-
code: z.ZodString;
|
|
102
|
-
password: z.ZodString;
|
|
103
|
-
}, z.core.$strip>;
|
|
104
|
-
export type IRedeemGiftCardRequest = z.infer<typeof RedeemGiftCardSchema>;
|
package/dist/utils/zodUtils.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { FieldValues, UseFormReturn } from 'react-hook-form';
|
|
2
|
-
import * as z from 'zod';
|
|
2
|
+
import * as z from 'zod/v4';
|
|
3
3
|
/**
|
|
4
4
|
* Processes a form submission using Zod for validation.
|
|
5
5
|
*/
|
|
6
|
-
export declare function validateFormWithZod<T extends FieldValues>(formMethods: UseFormReturn<T>, schema: z.
|
|
6
|
+
export declare function validateFormWithZod<T extends FieldValues>(formMethods: UseFormReturn<T>, schema: z.ZodSchema<T>, data: any): T;
|
|
7
7
|
/**
|
|
8
8
|
* Preprocesses a form input to convert string values to numbers.
|
|
9
9
|
*/
|