tf-checkout-react 1.4.24 → 1.4.25

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 (79) hide show
  1. package/dist/api/auth.d.ts +5 -0
  2. package/dist/api/cart.d.ts +2 -0
  3. package/dist/api/checkout.d.ts +1 -0
  4. package/dist/api/common.d.ts +10 -0
  5. package/dist/api/index.d.ts +10 -31
  6. package/dist/api/interceptors.d.ts +1 -0
  7. package/dist/api/orders.d.ts +2 -0
  8. package/dist/api/payment.d.ts +5 -0
  9. package/dist/api/publicRequest.d.ts +10 -0
  10. package/dist/api/resale.d.ts +5 -0
  11. package/dist/components/billing-info-container/utils.d.ts +0 -28
  12. package/dist/components/common/CheckboxField.d.ts +1 -1
  13. package/dist/components/confirmationContainer/index.d.ts +7 -2
  14. package/dist/components/loginForm/index.d.ts +6 -22
  15. package/dist/components/loginModal/index.d.ts +0 -28
  16. package/dist/components/seatMapContainer/addToCart.d.ts +2 -2
  17. package/dist/components/seatMapContainer/utils.d.ts +1 -9
  18. package/dist/components/stripePayment/index.d.ts +1 -1
  19. package/dist/components/ticketsContainer/index.d.ts +2 -2
  20. package/dist/components/waitingList/index.d.ts +1 -1
  21. package/dist/tf-checkout-react.cjs.development.js +1076 -694
  22. package/dist/tf-checkout-react.cjs.development.js.map +1 -1
  23. package/dist/tf-checkout-react.cjs.production.min.js +1 -1
  24. package/dist/tf-checkout-react.cjs.production.min.js.map +1 -1
  25. package/dist/tf-checkout-react.esm.js +1076 -694
  26. package/dist/tf-checkout-react.esm.js.map +1 -1
  27. package/dist/types/order-data.d.ts +5 -5
  28. package/dist/utils/auth.d.ts +5 -5
  29. package/dist/utils/setConfigs.d.ts +0 -12
  30. package/package.json +1 -1
  31. package/src/api/auth.ts +44 -0
  32. package/src/api/cart.ts +28 -0
  33. package/src/api/checkout.ts +30 -0
  34. package/src/api/common.ts +129 -0
  35. package/src/api/guestTicketDelegation.ts +1 -1
  36. package/src/api/index.ts +40 -346
  37. package/src/api/interceptors.ts +104 -0
  38. package/src/api/orders.ts +30 -0
  39. package/src/api/payment.ts +77 -0
  40. package/src/api/publicRequest.ts +40 -0
  41. package/src/api/resale.ts +28 -0
  42. package/src/components/addonsContainer/adapters/index.tsx +2 -4
  43. package/src/components/addonsContainer/index.tsx +23 -57
  44. package/src/components/billing-info-container/index.tsx +144 -214
  45. package/src/components/billing-info-container/utils.ts +9 -59
  46. package/src/components/common/CheckboxField.tsx +3 -4
  47. package/src/components/common/CustomField.tsx +1 -5
  48. package/src/components/common/NativeSelectFeild/index.tsx +1 -5
  49. package/src/components/common/SelectField/index.tsx +1 -3
  50. package/src/components/confirmationContainer/index.tsx +20 -13
  51. package/src/components/idVerificationContainer/index.tsx +7 -19
  52. package/src/components/loginForm/index.tsx +28 -41
  53. package/src/components/loginModal/index.tsx +18 -46
  54. package/src/components/myTicketsContainer/index.tsx +1 -1
  55. package/src/components/orderDetailsContainer/index.tsx +3 -3
  56. package/src/components/paymentContainer/index.tsx +23 -16
  57. package/src/components/registerForm/index.tsx +3 -6
  58. package/src/components/registerModal/index.tsx +4 -14
  59. package/src/components/rsvpContainer/index.tsx +18 -18
  60. package/src/components/seatMapContainer/addToCart.ts +9 -12
  61. package/src/components/seatMapContainer/utils.ts +3 -8
  62. package/src/components/signupModal/index.tsx +9 -30
  63. package/src/components/stripePayment/index.tsx +1 -1
  64. package/src/components/ticketResale/index.tsx +7 -6
  65. package/src/components/ticketsContainer/TicketsSection.tsx +11 -33
  66. package/src/components/ticketsContainer/index.tsx +32 -56
  67. package/src/components/waitingList/index.tsx +18 -30
  68. package/src/types/api/auth.d.ts +20 -12
  69. package/src/types/api/axiosResponse.d.ts +6 -0
  70. package/src/types/api/cart.d.ts +65 -0
  71. package/src/types/api/checkout.d.ts +41 -0
  72. package/src/types/api/common.d.ts +117 -0
  73. package/src/types/api/orders.d.ts +100 -0
  74. package/src/types/api/payment.d.ts +168 -0
  75. package/src/types/api/ticketResale.d.ts +13 -0
  76. package/src/types/order-data.ts +5 -5
  77. package/src/utils/auth.ts +3 -3
  78. package/src/utils/setConfigs.ts +2 -25
  79. package/src/types/auth.d.ts +0 -15
@@ -0,0 +1,5 @@
1
+ export declare const authorize: (data: IAuthorizeRequestData) => Promise<IProfileResponse>;
2
+ export declare const signUp: (data: ISignupRequestData) => Promise<IProfileResponse>;
3
+ export declare const register: (data: FormData) => Promise<IProfileResponse>;
4
+ export declare const getProfileData: (accessToken?: string | undefined) => Promise<IProfileResponse>;
5
+ export declare const logout: () => Promise<IAxiosResponseData>;
@@ -0,0 +1,2 @@
1
+ export declare const addToCart: (id: string | number, data: ICartRequestData) => Promise<ICartResponse>;
2
+ export declare const getCart: () => Promise<IGetCartResponse>;
@@ -0,0 +1 @@
1
+ export declare const postOnCheckout: (data: any, accessToken?: string | undefined, freeTicket?: boolean) => Promise<ICheckoutResponse>;
@@ -0,0 +1,10 @@
1
+ export declare const getEvent: (id: string | number, pk?: string | undefined) => Promise<IEventResponse>;
2
+ export declare const getTickets: (eventId: string | number, promoCode: string, pk?: string | undefined) => Promise<ITicketsAdaptedResponse>;
3
+ export declare const getCountries: () => Promise<ICountriesResponse>;
4
+ export declare const getStates: (countryId: string | number) => Promise<IStatesResponse>;
5
+ export declare const sendRSVPInfo: (eventId: number, data: {
6
+ data: IRSVPRequestData;
7
+ }) => Promise<IRSVPResponse>;
8
+ export declare const addToWaitingList: (id: number, data: IWaitingListRequestData) => Promise<IWaitingListResponse>;
9
+ export declare const postReferralVisits: (eventId: string, referralId: string) => Promise<IAxiosResponseData>;
10
+ export declare const validatePhoneNumber: (phone: string) => Promise<IAxiosResponseData>;
@@ -1,37 +1,20 @@
1
+ import './interceptors';
1
2
  import { AxiosRequestConfig, AxiosResponse } from 'axios';
2
- import { pageOptions } from '../hooks/usePixel';
3
3
  import { GetNetverifyUrlResponseData, UpdateVerificationStatusResponseData, VerificationStatusResponseData } from '../types/verification';
4
+ export { authorize, getProfileData, signUp, register, logout } from './auth';
5
+ export { setAxiosHeader, setBaseUrl } from './publicRequest';
6
+ export { getOrders, getOrderDetails } from './orders';
7
+ export { addToCart, getCart } from './cart';
8
+ export { postOnCheckout } from './checkout';
9
+ export { getEvent, getTickets, getCountries, getStates, addToWaitingList, sendRSVPInfo, postReferralVisits, validatePhoneNumber, } from './common';
10
+ export { getPaymentData, getConditions, handlePaymentSuccess, handleFreeSuccess, getConfirmationData, } from './payment';
11
+ export { resaleTicket, removeFromResale, processTicket, declineInvitation, } from './resale';
4
12
  export { issueTicket, getDelegationTickets } from './guestTicketDelegation';
5
13
  export declare const setCustomHeader: (response: any) => void;
6
14
  export declare const handleSetAccessToken: (token: string) => void;
7
- export declare function getEvent(id: string | number, pk?: string): Promise<AxiosResponse<any, any>>;
8
- export declare function getTickets(id: string | number, promoCode?: string, pk?: string): Promise<AxiosResponse<any, any>>;
9
- export declare const addToCart: (id: string | number, data: any) => Promise<AxiosResponse<any, any>>;
10
- export declare const getCart: () => Promise<AxiosResponse<any, any>>;
11
- export declare const postOnCheckout: (data: any, accessToken?: string | undefined, freeTicket?: boolean) => Promise<AxiosResponse<any, any>>;
12
- export declare const authorize: (data: {
13
- email: string;
14
- password: string;
15
- }) => Promise<AxiosResponse<any, any>>;
16
- export declare const register: (data: FormData) => Promise<AxiosResponse<any, any>>;
17
15
  export declare const getAccessToken: (data: FormData) => Promise<AxiosResponse<any, any>>;
18
- export declare const getPaymentData: (hash: string) => Promise<AxiosResponse<any, any>>;
19
16
  export declare const handlePaymentData: (orderHash: string, data: any) => Promise<AxiosResponse<any, any>>;
20
- export declare const handlePaymentSuccess: (orderHash: string) => Promise<AxiosResponse<any, any>>;
21
17
  export declare const createPaymentPlan: (orderHash: string, stripePaymentMethodId: string) => Promise<AxiosResponse<any, any>>;
22
- export declare const handleFreeSuccess: (orderHash: string) => Promise<AxiosResponse<any, any>>;
23
- export declare const getProfileData: (accessToken?: string | undefined) => Promise<any>;
24
- export declare const getCountries: () => Promise<AxiosResponse<any, any>>;
25
- export declare const getConfirmationData: (orderHash: string) => Promise<AxiosResponse<any, any>>;
26
- export declare const getStates: (countryId: string | number) => Promise<AxiosResponse<any, any>>;
27
- export declare const getOrders: (page: number, limit: number, eventSlug: string) => Promise<AxiosResponse<any, any>>;
28
- export declare const getOrderDetails: (orderId: string) => Promise<AxiosResponse<any, any>>;
29
- export declare const addToWaitingList: (id: number, data: any) => Promise<AxiosResponse<any, any>>;
30
- export declare const getConditions: (eventId: string) => Promise<AxiosResponse<any, any>>;
31
- export declare const resaleTicket: (data: any, hash: string) => Promise<AxiosResponse<any, any>>;
32
- export declare const removeFromResale: (hash: string) => Promise<AxiosResponse<any, any>>;
33
- export declare const postReferralVisits: (eventId: string, referralId: string) => Promise<AxiosResponse<any, any>>;
34
- export declare const logout: () => Promise<AxiosResponse<any, any>>;
35
18
  export declare const forgotPassword: (email: string) => Promise<AxiosResponse<any, any>>;
36
19
  interface IResetPasswordData {
37
20
  token: string;
@@ -39,10 +22,6 @@ interface IResetPasswordData {
39
22
  confirmPassword: string;
40
23
  }
41
24
  export declare const resetPassword: (data: IResetPasswordData) => Promise<AxiosResponse<any, any>>;
42
- export declare const processTicket: (hash: string) => Promise<AxiosResponse<any, any>>;
43
- export declare const declineInvitation: (hash: string) => Promise<AxiosResponse<any, any>>;
44
- export declare const sendRSVPInfo: (eventId: number, data: any) => Promise<AxiosResponse<any, any>>;
45
- export declare const validatePhoneNumber: (phone: string) => Promise<any>;
46
25
  export declare const getAddons: (eventId: string) => Promise<any>;
47
26
  export declare const selectAddons: (data: any) => void;
48
27
  export interface AttributesConfig {
@@ -83,7 +62,7 @@ export declare const getSeatMapData: (eventId: string | number) => Promise<SeatM
83
62
  export declare const getSeatMapStatuses: (eventId: string | number) => Promise<SeatMapStatusesResponse>;
84
63
  export declare const reserveSeat: (eventId: string | number, tierId: string, seatId: string) => Promise<any>;
85
64
  export declare const removeSeatReserve: (eventId: string | number, tierId: string, seatIds: string[]) => Promise<any>;
86
- export declare function getPixelScript(id: string | number, pageOptions: pageOptions): Promise<AxiosResponse<any, any>>;
65
+ export declare function getPixelScript(id: string | number, pageOptions: any): Promise<AxiosResponse<any, any>>;
87
66
  export declare const getNetverifyUrl: () => Promise<GetNetverifyUrlResponseData>;
88
67
  export declare const checkVerificationStatus: () => Promise<{
89
68
  data: VerificationStatusResponseData;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare const getOrders: (page: number, limit: number, eventSlug: string) => Promise<IOrdersResponse>;
2
+ export declare const getOrderDetails: (orderId: string) => Promise<IOrderResponse>;
@@ -0,0 +1,5 @@
1
+ export declare const getPaymentData: (hash: string) => Promise<IPaymentDataResponse>;
2
+ export declare const handlePaymentSuccess: (orderHash: string) => Promise<IPaymentSuccessDataResponse>;
3
+ export declare const handleFreeSuccess: (orderHash: string) => Promise<IFreeRegistrationDataResponse>;
4
+ export declare const getConfirmationData: (orderHash: string) => Promise<ICheckoutCompleteDataResponse>;
5
+ export declare const getConditions: (eventId: string) => Promise<IConditionsAdaptedDataResponse>;
@@ -0,0 +1,10 @@
1
+ import { AxiosInstance } from 'axios';
2
+ export declare const setAxiosHeader: (key: string, value: string | number) => void;
3
+ interface IPublicRequest extends AxiosInstance {
4
+ setBaseUrl: (baseUrl: string) => void;
5
+ setGuestToken: (guestToken: string) => void;
6
+ setAccessToken: (token: string) => void;
7
+ }
8
+ export declare const publicRequest: IPublicRequest;
9
+ export declare const setBaseUrl: (baseUrl: string) => void;
10
+ export {};
@@ -0,0 +1,5 @@
1
+ import { AxiosResponse } from 'axios';
2
+ export declare const resaleTicket: (data: FormData, hash: string) => Promise<IResaleTicketResponse>;
3
+ export declare const removeFromResale: (hash: string) => Promise<IRemoveFromResaleResponse>;
4
+ export declare const processTicket: (hash: string) => Promise<AxiosResponse<any, any>>;
5
+ export declare const declineInvitation: (hash: string) => Promise<AxiosResponse<any, any>>;
@@ -20,34 +20,6 @@ interface ICheckoutBody {
20
20
  [key: string]: any;
21
21
  };
22
22
  }
23
- interface IUserData {
24
- id: string;
25
- firstName: string;
26
- lastName: string;
27
- email: string;
28
- city?: string;
29
- country?: string;
30
- countryId?: string;
31
- phone?: string;
32
- streetAddress?: string;
33
- state?: string;
34
- zip?: string;
35
- zipCode?: string;
36
- stateId?: string;
37
- }
38
- export declare const setLoggedUserData: (data: IUserData) => {
39
- id: string;
40
- first_name: string;
41
- last_name: string;
42
- email: string;
43
- confirmEmail: string;
44
- city: string;
45
- country: string;
46
- phone: string;
47
- street_address: string;
48
- state: string;
49
- zip: string;
50
- };
51
23
  export declare const createCheckoutDataBody: (ticketsQuantity: number, values?: IValues, logedInValues?: ILoggedInValues, includeDob?: boolean) => ICheckoutBody;
52
24
  export declare const getValidateFunctions: (element: IGroupItem, states: {
53
25
  [key: string]: any;
@@ -7,5 +7,5 @@ export interface ICheckboxField {
7
7
  interface IOtherProps {
8
8
  [key: string]: any;
9
9
  }
10
- export declare const CheckboxField: ({ label, field, selectOptions, theme, setFieldValue, disableDropdown, setPhoneValidationIsLoading, defaultCountry, required, uniqueId, dateFormat, datePlaceholder, ...rest }: ICheckboxField & IOtherProps) => JSX.Element;
10
+ export declare const CheckboxField: ({ label, field, selectOptions, theme, setFieldValue, disableDropdown, setPhoneValidationIsLoading, defaultCountry, required, uniqueId, dateFormat, datePlaceholder, isCountryCodeEditable, ...rest }: ICheckboxField & IOtherProps) => JSX.Element;
11
11
  export {};
@@ -5,7 +5,12 @@ export interface IShareButton {
5
5
  mainLabel: string;
6
6
  subLabel: string;
7
7
  platform: string;
8
- shareData: any;
8
+ shareData: {
9
+ quote?: string;
10
+ url?: string;
11
+ title?: string;
12
+ appId?: string;
13
+ };
9
14
  }
10
15
  export interface IConfirmationLabels {
11
16
  confirmationTitle?: string;
@@ -21,7 +26,7 @@ export interface IConfirmationPage {
21
26
  showDefaultShareButtons: boolean;
22
27
  messengerAppId: string;
23
28
  shareButtons: IShareButton[];
24
- onGetConfirmationDataSuccess: (res: any) => void;
29
+ onGetConfirmationDataSuccess: (res: ICheckoutCompleteData) => void;
25
30
  onGetConfirmationDataError: (e: AxiosError) => void;
26
31
  onLinkCopied: () => void;
27
32
  orderHash?: string;
@@ -1,5 +1,5 @@
1
1
  import { AxiosError } from 'axios';
2
- import { FC } from 'react';
2
+ import React, { FC } from 'react';
3
3
  export interface ILoginFormProps {
4
4
  alreadyHasUser?: boolean;
5
5
  userExpired?: boolean;
@@ -13,33 +13,17 @@ export interface ILoginFormProps {
13
13
  showForgotPasswordButton?: boolean;
14
14
  showSignUpButton?: boolean;
15
15
  }
16
- interface IUserData {
17
- id: string;
18
- firstName: string;
19
- lastName: string;
20
- email: string;
21
- city?: string;
22
- country?: string;
23
- countryId?: string;
24
- phone?: string;
25
- streetAddress?: string;
26
- state?: string;
27
- zip?: string;
28
- zipCode?: string;
29
- stateId?: string;
30
- }
31
- export declare const setLoggedUserData: (data: IUserData) => {
32
- id: string;
16
+ export declare const setLoggedUserData: (data: IProfileData) => {
17
+ id: React.ReactText;
33
18
  first_name: string;
34
19
  last_name: string;
35
20
  email: string;
36
21
  confirmEmail: string;
37
22
  city: string;
38
- country: string;
23
+ country: React.ReactText;
39
24
  phone: string;
40
25
  street_address: string;
41
- state: string;
42
- zip: string;
26
+ state: React.ReactText;
27
+ zip: React.ReactText;
43
28
  };
44
29
  export declare const LoginForm: FC<ILoginFormProps>;
45
- export {};
@@ -18,33 +18,5 @@ interface Props {
18
18
  showSignUpButton?: boolean;
19
19
  showPoweredByImage?: boolean;
20
20
  }
21
- interface IUserData {
22
- id: string;
23
- firstName: string;
24
- lastName: string;
25
- email: string;
26
- city?: string;
27
- country?: string;
28
- countryId?: string;
29
- phone?: string;
30
- streetAddress?: string;
31
- state?: string;
32
- zip?: string;
33
- zipCode?: string;
34
- stateId?: string;
35
- }
36
- export declare const setLoggedUserData: (data: IUserData) => {
37
- id: string;
38
- first_name: string;
39
- last_name: string;
40
- email: string;
41
- confirmEmail: string;
42
- city: string;
43
- country: string;
44
- phone: string;
45
- street_address: string;
46
- state: string;
47
- zip: string;
48
- };
49
21
  export declare const LoginModal: FC<Props>;
50
22
  export {};
@@ -14,8 +14,8 @@ export declare const addToCartFunc: ({ eventId, data, ticketQuantity, enableBill
14
14
  collect_optional_wallet_address: any;
15
15
  collect_mandatory_wallet_address: any;
16
16
  event_id: string;
17
- hash: string;
18
- total: string;
17
+ hash: string | number;
18
+ total: string | number;
19
19
  hasAddOn: any;
20
20
  } | null>;
21
21
  export {};
@@ -2,13 +2,5 @@ export declare const getTierIdBasedOnSeatId: (seatId: string, eventSeats: Array<
2
2
  export declare const getButtonLabel: (count: number, tableMapEnabled: boolean) => string;
3
3
  export declare const getOwnReservationsBasedOnStatuses: (statuses: any) => string[];
4
4
  export declare const getTicketDropdownData: (reservationData: Array<SeatReservationData>, tierReleations: TicketTypeTierRelations) => ITicketsDropdownsData[];
5
- export declare const getAddToCartRequestData: ({ eventId, reservations, selectedSeats, selectedTickets, guestCounts, }: any) => {
6
- attributes: {
7
- alternative_view_id: null;
8
- product_cart_quantity: any;
9
- product_options: {};
10
- product_id: any;
11
- ticket_types: {};
12
- };
13
- };
5
+ export declare const getAddToCartRequestData: ({ eventId, reservations, selectedSeats, selectedTickets, guestCounts, }: any) => ICartRequestData;
14
6
  export declare const getTierRelationsArray: (data: Array<TicketTypeTierRelationsData>) => (string | number | null)[];
@@ -2,7 +2,7 @@
2
2
  import './style.css';
3
3
  import { StripeCardNumberElementOptions } from '@stripe/stripe-js';
4
4
  export interface ICheckoutForm {
5
- total: string;
5
+ total: string | number;
6
6
  currency: string;
7
7
  onSubmit: (error: any, data?: object) => Promise<any>;
8
8
  error?: string | null;
@@ -10,8 +10,8 @@ interface CartSuccess {
10
10
  phone_required: boolean;
11
11
  hide_phone_field: boolean;
12
12
  event_id: string;
13
- hash?: string;
14
- total?: string;
13
+ hash?: string | number;
14
+ total?: string | number;
15
15
  hasAddOn?: boolean;
16
16
  free_ticket: boolean;
17
17
  collect_optional_wallet_address?: boolean;
@@ -5,5 +5,5 @@ interface WaitingListProps {
5
5
  eventId: number;
6
6
  defaultMaxQuantity: number;
7
7
  }
8
- declare const WaitingList: ({ tickets, eventId, defaultMaxQuantity }: WaitingListProps) => JSX.Element;
8
+ declare const WaitingList: ({ tickets, eventId, defaultMaxQuantity, }: WaitingListProps) => JSX.Element;
9
9
  export default WaitingList;