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
@@ -56,8 +56,8 @@ interface CartSuccess {
56
56
  phone_required: boolean;
57
57
  hide_phone_field: boolean;
58
58
  event_id: string;
59
- hash?: string;
60
- total?: string;
59
+ hash?: string | number;
60
+ total?: string | number;
61
61
  hasAddOn?: boolean;
62
62
  free_ticket: boolean;
63
63
  collect_optional_wallet_address?: boolean;
@@ -168,12 +168,9 @@ export const TicketsContainer = ({
168
168
  showAlertIcons = true,
169
169
  }: IGetTickets) => {
170
170
  const [selectedTickets, setSelectedTickets] = useState({} as ISelectedTickets)
171
- const isWindowDefined = typeof window !== 'undefined'
172
- const [isLogged, setIsLogged] = useState(
173
- Boolean(getCookieByName(X_TF_ECOMMERCE))
174
- )
171
+ const [isLogged, setIsLogged] = useState(Boolean(getCookieByName(X_TF_ECOMMERCE)))
175
172
  const [showLoginModal, setShowLoginModal] = useState(false)
176
- const [tickets, setTickets] = useState([] as ITicket[])
173
+ const [tickets, setTickets] = useState([] as ITicketData[])
177
174
  const [event, setEvent] = useState<any>(null)
178
175
  const [showWaitingList, setShowWaitingList] = useState(false)
179
176
  const [isLoading, setIsLoading] = useState(true)
@@ -183,12 +180,8 @@ export const TicketsContainer = ({
183
180
  const [showPromoInput, setShowPromoInput] = useState(false)
184
181
  const [codeIsApplied, setCodeIsApplied] = useState(false)
185
182
  const [codeIsInvalid, setCodeIsInvalid] = useState(false)
186
- const [showAccessCodeSection, setShowAccessCodeSection] = useState(
187
- isAccessCodeEnabled
188
- )
189
- const [showPromoCodeSection, setShowPromoCodeSection] = useState(
190
- isPromotionsEnabled
191
- )
183
+ const [showAccessCodeSection, setShowAccessCodeSection] = useState(isAccessCodeEnabled)
184
+ const [showPromoCodeSection, setShowPromoCodeSection] = useState(isPromotionsEnabled)
192
185
  const [error, setError] = useState(null)
193
186
  const [isNotInvitedError, setIsNotInvitedError] = useState('')
194
187
  const [isInvalidLinkError, setIsInvalidLinkError] = useState('')
@@ -237,7 +230,7 @@ export const TicketsContainer = ({
237
230
  try {
238
231
  await logout()
239
232
  onLogoutSuccess()
240
- if (isWindowDefined) {
233
+ if (isBrowser) {
241
234
  window.localStorage.removeItem('access_token')
242
235
  window.localStorage.removeItem('user_data')
243
236
  setIsLogged(false)
@@ -272,22 +265,22 @@ export const TicketsContainer = ({
272
265
  const previewKey = getQueryVariable('pk') || undefined
273
266
  const response = await getTickets(eventId, code, previewKey)
274
267
  const eventResponse = await getEvent(eventId, previewKey)
275
- if (response.data.success) {
276
- const attributes = _get(response, 'data.data.attributes')
268
+ if (response.success) {
269
+ const attributes = response?.data?.attributes
277
270
  type === 'promo' && setCodeIsApplied(attributes.ValidPromoCode)
278
271
  type === 'promo' && setCodeIsInvalid(!attributes.ValidPromoCode)
279
- setTickets(_get(attributes, 'tickets'))
272
+ setTickets(attributes.tickets)
280
273
  setShowWaitingList(attributes.showWaitingList)
281
274
  onGetTicketsSuccess(response.data)
282
275
  setCode('')
283
276
  setShowAccessCodeSection(attributes.is_access_code)
284
277
  setShowPromoCodeSection(attributes.isPromotionsEnabled)
285
278
  }
286
- if (eventResponse.data.success) {
287
- const event = _get(eventResponse, 'data.data.attributes')
279
+ if (eventResponse.success) {
280
+ const event = eventResponse.data.attributes
288
281
  setEvent(event)
289
282
 
290
- if (event.country && isWindowDefined) {
283
+ if (event.country && isBrowser) {
291
284
  window.localStorage.setItem('eventCountry', event.country)
292
285
  }
293
286
  }
@@ -302,11 +295,7 @@ export const TicketsContainer = ({
302
295
  }
303
296
  }
304
297
 
305
- const handleTicketSelect = (
306
- key: string,
307
- value: number | string,
308
- isTable = false
309
- ) => {
298
+ const handleTicketSelect = (key: string, value: number | string, isTable = false) => {
310
299
  setSelectedTickets(prevState => {
311
300
  if (Object.keys(prevState)[0] !== key && !value) {
312
301
  return prevState
@@ -319,7 +308,7 @@ export const TicketsContainer = ({
319
308
  }
320
309
 
321
310
  const handleOrdersClick = () => {
322
- if (isWindowDefined) {
311
+ if (isBrowser) {
323
312
  window.location.href = ordersPath ?? '/orders'
324
313
  }
325
314
  }
@@ -330,15 +319,14 @@ export const TicketsContainer = ({
330
319
 
331
320
  const handleBook = async () => {
332
321
  setHandleBookIsLoading(true)
333
- const ticket =
334
- _find(tickets, item => selectedTickets[item.id] > 0) || ({} as ITicket)
322
+ const ticket = _find(tickets, item => selectedTickets[item.id] > 0) || ({} as ITicket)
335
323
  const optionName = _get(ticket, 'optionName')
336
324
  const ticketId = _get(ticket, 'id')
337
325
  const isTableType = _get(ticket, 'isTable', false)
338
326
  const productCartQuantity = +selectedTickets[ticket.id]
339
327
  const ticketQuantity = isTableType ? 1 : +selectedTickets[ticket.id]
340
328
 
341
- const data = {
329
+ const data: ICartRequestData = {
342
330
  attributes: {
343
331
  alternative_view_id: null,
344
332
  product_cart_quantity: productCartQuantity,
@@ -364,12 +352,11 @@ export const TicketsContainer = ({
364
352
  ? await getCheckoutPageConfigs()
365
353
  : {
366
354
  status: 200,
367
- data: { attributes: _get(result, 'data.data.attributes') },
355
+ data: { attributes: _get(result, 'data.attributes') },
368
356
  }
369
357
 
370
358
  if (result.status === 200 && pageConfigsDataResponse.status === 200) {
371
- const pageConfigsData =
372
- _get(pageConfigsDataResponse, 'data.attributes') || {}
359
+ const pageConfigsData = _get(pageConfigsDataResponse, 'data.attributes') || {}
373
360
 
374
361
  const skipBillingPage = pageConfigsData.skip_billing_page ?? false
375
362
  const nameIsRequired = pageConfigsData.names_required ?? false
@@ -383,21 +370,20 @@ export const TicketsContainer = ({
383
370
  const collectMandatoryWalletAddress =
384
371
  pageConfigsData.collect_mandatory_wallet_address ?? false
385
372
 
386
- let hash = ''
387
- let total = ''
373
+ let hash: string | number | undefined = ''
374
+ let total: string | number | undefined = ''
388
375
 
389
- const isWindowDefined = typeof window !== 'undefined'
390
- isWindowDefined && window.localStorage.removeItem('add_ons')
376
+ isBrowser && window.localStorage.removeItem('add_ons')
391
377
 
392
378
  if (skipBillingPage && !hasAddOn) {
393
379
  // Get user data for checkout data
394
380
  const userData =
395
- isWindowDefined && window.localStorage.getItem('user_data')
381
+ isBrowser && window.localStorage.getItem('user_data')
396
382
  ? JSON.parse(window.localStorage.getItem('user_data') || '')
397
383
  : {}
398
384
 
399
385
  const access_token =
400
- isWindowDefined && window.localStorage.getItem('access_token')
386
+ isBrowser && window.localStorage.getItem('access_token')
401
387
  ? window.localStorage.getItem('access_token') || ''
402
388
  : ''
403
389
 
@@ -406,12 +392,12 @@ export const TicketsContainer = ({
406
392
  userData
407
393
  )
408
394
 
409
- const checkoutResult = enableBillingInfoAutoCreate
395
+ const checkoutResponse = enableBillingInfoAutoCreate
410
396
  ? await postOnCheckout(checkoutBody, access_token, freeTicket)
411
397
  : null
412
398
 
413
- hash = _get(checkoutResult, 'data.data.attributes.hash')
414
- total = _get(checkoutResult, 'data.data.attributes.total')
399
+ hash = checkoutResponse?.data?.attributes?.hash || ''
400
+ total = checkoutResponse?.data?.attributes?.total || ''
415
401
  }
416
402
 
417
403
  onAddToCartSuccess({
@@ -464,7 +450,7 @@ export const TicketsContainer = ({
464
450
  const fetchUserData = async () => {
465
451
  try {
466
452
  const userDataResponse = await getProfileData()
467
- const profileData = _get(userDataResponse, 'data.data')
453
+ const profileData = _get(userDataResponse, 'data')
468
454
  const profileDataObj = setLoggedUserData(profileData)
469
455
  return profileDataObj
470
456
  } catch (e) {
@@ -500,11 +486,7 @@ export const TicketsContainer = ({
500
486
  ) {
501
487
  handleBook()
502
488
  } else {
503
- if (
504
- isButtonScrollable &&
505
- ticketsContainerRef &&
506
- ticketsContainerRef.current
507
- ) {
489
+ if (isButtonScrollable && ticketsContainerRef && ticketsContainerRef.current) {
508
490
  ticketsContainerRef.current.scrollIntoView({
509
491
  behavior: 'smooth',
510
492
  block: 'center',
@@ -525,9 +507,7 @@ export const TicketsContainer = ({
525
507
  ticket => ticket.displayTicket && !ticket.soldOut && ticket.salesStarted
526
508
  )
527
509
 
528
- const wrappedActionsSectionComponent = React.isValidElement(
529
- ActionsSectionComponent
530
- )
510
+ const wrappedActionsSectionComponent = React.isValidElement(ActionsSectionComponent)
531
511
  ? React.cloneElement(ActionsSectionComponent as React.ReactElement<any>, {
532
512
  handleGetTicketClick,
533
513
  isTicketOnSale,
@@ -620,12 +600,8 @@ export const TicketsContainer = ({
620
600
  sortBySoldOut={sortBySoldOut}
621
601
  ticketsHeaderComponent={ticketsHeaderComponent}
622
602
  tableTicketsHeaderComponent={tableTicketsHeaderComponent}
623
- hideTableTicketsHeader={
624
- hideTableTicketsHeader || _isEmpty(tableTickets)
625
- }
626
- hideTicketsHeader={
627
- hideTicketsHeader || _isEmpty(ordinarTickets)
628
- }
603
+ hideTableTicketsHeader={hideTableTicketsHeader || _isEmpty(tableTickets)}
604
+ hideTicketsHeader={hideTicketsHeader || _isEmpty(ordinarTickets)}
629
605
  showGroupNameBlock={showGroupNameBlock}
630
606
  currencySybmol={currencySybmol}
631
607
  isSeatMapAllowed={isSeatMapAllowed}
@@ -1,17 +1,15 @@
1
- import React, { useState } from 'react'
1
+ import './style.css'
2
+
2
3
  import Button from '@mui/material/Button'
3
4
  import CircularProgress from '@mui/material/CircularProgress'
4
5
  import { Field, Form, Formik } from 'formik'
5
- import { CustomField } from '../common/index'
6
+ import React, { useState } from 'react'
7
+
6
8
  import { addToWaitingList } from '../../api'
7
- import {
8
- combineValidators,
9
- requiredValidator,
10
- emailValidator,
11
- } from '../../validators'
9
+ import { isBrowser } from '../../utils'
12
10
  import { ErrorFocus } from '../../utils/formikErrorFocus'
13
-
14
- import './style.css'
11
+ import { combineValidators, emailValidator, requiredValidator } from '../../validators'
12
+ import { CustomField } from '../common/index'
15
13
 
16
14
  interface WaitingListProps {
17
15
  tickets: any;
@@ -34,11 +32,14 @@ const generateQuantity = (n: number) => {
34
32
  }
35
33
  return quantityList
36
34
  }
37
-
38
- const WaitingList = ({ tickets = {}, eventId, defaultMaxQuantity = 10 }: WaitingListProps) => {
39
- const isWindowDefined = typeof window !== 'undefined'
35
+
36
+ const WaitingList = ({
37
+ tickets = {},
38
+ eventId,
39
+ defaultMaxQuantity = 10,
40
+ }: WaitingListProps) => {
40
41
  const userData =
41
- isWindowDefined && window.localStorage.getItem('user_data')
42
+ isBrowser && window.localStorage.getItem('user_data')
42
43
  ? JSON.parse(window.localStorage.getItem('user_data') || '')
43
44
  : {}
44
45
 
@@ -54,14 +55,9 @@ const WaitingList = ({ tickets = {}, eventId, defaultMaxQuantity = 10 }: Waiting
54
55
  const handleSubmit = async (values: WaitingListFields) => {
55
56
  try {
56
57
  setLoading(true)
57
- const requestData = {
58
- data: {
59
- attributes: values,
60
- },
61
- }
62
- const { data } = await addToWaitingList(eventId, requestData)
58
+ const response = await addToWaitingList(eventId, values)
63
59
 
64
- if (data.success) {
60
+ if (response.success) {
65
61
  setShowSuccessMessage(true)
66
62
  }
67
63
  } catch (error) {
@@ -157,16 +153,8 @@ const WaitingList = ({ tickets = {}, eventId, defaultMaxQuantity = 10 }: Waiting
157
153
  />
158
154
  </div>
159
155
 
160
- <Button
161
- type="submit"
162
- variant="contained"
163
- className="waiting-list-button"
164
- >
165
- {loading ? (
166
- <CircularProgress size="22px" />
167
- ) : (
168
- 'ADD TO WAITING LIST'
169
- )}
156
+ <Button type="submit" variant="contained" className="waiting-list-button">
157
+ {loading ? <CircularProgress size="22px" /> : 'ADD TO WAITING LIST'}
170
158
  </Button>
171
159
  </Form>
172
160
  </Formik>
@@ -4,30 +4,38 @@ interface IAuthorizeRequestData {
4
4
  password: string;
5
5
  }
6
6
 
7
+ // ticket holder data
8
+ interface ITicketHolderData {
9
+ firstName: string | null;
10
+ lastName: string | null;
11
+ phone: string | null;
12
+ email: string | null;
13
+ }
14
+
7
15
  // authorize, get user data
8
16
  interface IProfileData {
9
17
  id: number | string;
10
18
  firstName: string;
11
19
  lastName: string;
12
20
  email: string;
13
- phone: string;
14
- streetAddress: string;
15
- zipCode: number;
16
- countryId: number;
17
- company: string;
18
- state: string | number;
19
- stateId: number;
20
- city: string;
21
+ phone?: string;
22
+ streetAddress?: string;
23
+ zipCode?: string | number;
24
+ countryId: string | number;
25
+ company: string | null;
26
+ stateId?: string | number;
27
+ city?: string;
21
28
  username: string;
22
29
  screenName: string | null;
23
- bio: string;
30
+ bio: string | null;
24
31
  shortBio: string | null;
25
32
  region: string | null;
26
- image: string;
33
+ image: string | null;
27
34
  recommendedEvents: Array<any>;
28
35
  rnRoles: Array<string>;
29
36
  hasDashboardAccess: boolean;
30
- ticketHolders: Array<any>;
37
+ ticketHolders: ITicketHolderData[];
38
+ linkedCryptoWallets: string[];
31
39
  }
32
40
 
33
41
  interface IProfileResponse extends IAxiosResponseData {
@@ -49,7 +57,7 @@ interface ISignupRequestDataExtended extends ISignupRequestData {
49
57
  phone: string | number;
50
58
  countryId: string | number;
51
59
  city: string;
52
- stateId: string | number;
60
+ stateId?: string | number;
53
61
  streetAddress: string;
54
62
  zip: string | number;
55
63
  }
@@ -0,0 +1,6 @@
1
+ interface IAxiosResponseData {
2
+ error: boolean;
3
+ message: string;
4
+ status: number;
5
+ success: boolean;
6
+ }
@@ -0,0 +1,65 @@
1
+ // Add to Cart
2
+ interface ICartData {
3
+ alternative_view_id: string | null;
4
+ product_cart_quantity: number;
5
+ product_id: string | number;
6
+ product_options: {
7
+ [key: string]: string | number;
8
+ };
9
+ ticket_types: {
10
+ [key: string]: {
11
+ product_options: {
12
+ [key: string]: string | number;
13
+ ticket_price: string | number;
14
+ };
15
+ quantity: number;
16
+ };
17
+ };
18
+ }
19
+
20
+ interface ICartRequestData {
21
+ attributes: ICartData;
22
+ }
23
+
24
+ interface ICartResponseData {
25
+ ageRequired: boolean;
26
+ namesRequired: boolean;
27
+ phoneRequired: boolean;
28
+ skipBillingPage: boolean;
29
+ minimumAge?: string | null;
30
+ }
31
+
32
+ interface ICartResponseExtendedData extends ICartResponseData {
33
+ eventId: number;
34
+ hash?: string;
35
+ total?: string | number;
36
+ }
37
+
38
+ interface ICartResponse extends IAxiosResponseData {
39
+ data: {
40
+ attributes: ICartResponseData;
41
+ relationships: Array<unknown>;
42
+ type: string;
43
+ };
44
+ }
45
+
46
+ // Get cart data
47
+ interface IGetCartData {
48
+ cartName: string;
49
+ quantity: number;
50
+ }
51
+
52
+ interface IGetCartAttributes {
53
+ cart: Array<IGetCartData>;
54
+ hideTtfOptIn: boolean;
55
+ optedIn: boolean;
56
+ ttfOptIn: boolean;
57
+ }
58
+
59
+ interface IGetCartResponse {
60
+ data: {
61
+ relationships: Array<unknown>;
62
+ type: string;
63
+ attributes: IGetCartAttributes;
64
+ };
65
+ }
@@ -0,0 +1,41 @@
1
+ interface ITicketHolderData {
2
+ firstName?: string;
3
+ lastName?: string;
4
+ email?: string | null;
5
+ phone?: string | null;
6
+ }
7
+
8
+ interface ICheckoutData {
9
+ ticketHolders?: Array<ITicketHolderData>;
10
+
11
+ brandOptIn?: boolean;
12
+ ttfOptIn?: boolean;
13
+
14
+ dobDay?: number;
15
+ dobMonth?: number;
16
+ dobYear?: number;
17
+
18
+ streetAddress?: string;
19
+ city?: string;
20
+ stateId?: number;
21
+ zip?: string;
22
+ countryId?: string | number;
23
+ }
24
+
25
+ interface ICheckoutResponseData {
26
+ id: string | number;
27
+ hash: string | number;
28
+ total: string | number;
29
+ debt: string | number;
30
+ pay_now: string | number;
31
+ guest_count: number | null;
32
+ status: string;
33
+ }
34
+
35
+ interface ICheckoutResponse extends IAxiosResponseData {
36
+ data: {
37
+ attributes: ICheckoutResponseData;
38
+ relationships: Array<unknown>;
39
+ type: string;
40
+ };
41
+ }
@@ -0,0 +1,117 @@
1
+ // Event
2
+ interface IEventResponseData {
3
+ alwaysShowWaitingList: boolean | null;
4
+ isTimeSlotEvent: boolean;
5
+ minimumAge: number | string | null;
6
+ name: string;
7
+ redirectUrl: string | null;
8
+ referralsEnabled: boolean;
9
+ salesEnd: string;
10
+ salesEnded: boolean;
11
+ salesStart: boolean | null;
12
+ salesStarted: boolean;
13
+ slug: string;
14
+ startDate: string;
15
+ timezone: string;
16
+ country: any;
17
+ }
18
+ interface IEventResponse extends IAxiosResponseData {
19
+ data: {
20
+ attributes: IEventResponseData;
21
+ relationships: Array<unknown>;
22
+ type: string;
23
+ };
24
+ }
25
+
26
+ // Tickets
27
+ interface ITicketData {
28
+ displayName: string;
29
+ displayTicket: boolean;
30
+ feeIncluded: boolean;
31
+ feeText: string;
32
+ id: string;
33
+ maxQuantity: number;
34
+ minQuantity: number;
35
+ multiplier: number;
36
+ oldPrice: number;
37
+ optionName: string;
38
+ price: number;
39
+ priceCurrency: string;
40
+ priceSymbol: string;
41
+ salesEnded: boolean;
42
+ salesStarted: boolean;
43
+ soldOut: number;
44
+ soldOutMessage: number | string;
45
+ sortOrder: number;
46
+ tags: Array<string>;
47
+ taxName: string;
48
+ taxesIncluded: boolean;
49
+ }
50
+ interface ITicketItemData {
51
+ [key: number]: ITicketData;
52
+ }
53
+ interface ITicketsResponseData {
54
+ promoCodeValidationMessage: string | null;
55
+ validPromoCode: boolean;
56
+ is_access_code: boolean;
57
+ isPromotionsEnabled: boolean;
58
+ showWaitingList: boolean;
59
+ tickets: ITicketItemData;
60
+ ValidPromoCode: boolean;
61
+ }
62
+ interface ITicketsAdaptedResponseData extends ITicketsResponseData {
63
+ tickets: ITicketData[];
64
+ }
65
+ interface ITicketsResponse extends IAxiosResponseData {
66
+ data: {
67
+ attributes: ITicketsResponseData;
68
+ relationships: Array<unknown>;
69
+ type: string;
70
+ };
71
+ }
72
+ interface ITicketsAdaptedResponse extends IAxiosResponseData {
73
+ data: {
74
+ attributes: ITicketsAdaptedResponseData;
75
+ relationships: Array<unknown>;
76
+ type: string;
77
+ };
78
+ }
79
+
80
+ // Countries
81
+ interface ICountriesAdaptedData {
82
+ label: string;
83
+ value: string;
84
+ }
85
+ interface ICountriesResponseData {
86
+ [key: number]: string;
87
+ code: string;
88
+ id: string;
89
+ name: string;
90
+ }
91
+ interface ICountriesResponse extends IAxiosResponseData {
92
+ data: ICountriesResponseData[];
93
+ }
94
+
95
+ // Country States
96
+ interface IStatesData {
97
+ [key: number]: string;
98
+ }
99
+ interface IStatesResponse extends IAxiosResponseData {
100
+ data: IStatesData;
101
+ }
102
+
103
+ // Waiting List
104
+ interface IWaitingListRequestData {
105
+ email: string;
106
+ firstName: string;
107
+ lastName: string;
108
+ quantity: string;
109
+ ticketTypeId: string;
110
+ }
111
+ type IWaitingListResponse = IAxiosResponseData
112
+
113
+ // RSVP
114
+ interface IRSVPRequestData {
115
+ email: string;
116
+ }
117
+ type IRSVPResponse = IAxiosResponseData
@@ -0,0 +1,100 @@
1
+ // Orders
2
+ interface IPurchasedEventData {
3
+ urlName: string;
4
+ eventName: string;
5
+ }
6
+
7
+ interface IOrdersItemData {
8
+ id: string;
9
+ date: string;
10
+ currency: string;
11
+ amount: string;
12
+ eventName: string;
13
+ eventUrl: string;
14
+ image: string;
15
+ }
16
+
17
+ interface IOrdersData {
18
+ page: number;
19
+ limit: number;
20
+ totalCount: number;
21
+ totalPages: number;
22
+ filter: string | null;
23
+ brandFilter: string | null;
24
+ subBrands: boolean;
25
+ purchasedEvents: IPurchasedEventData[];
26
+ orders: IOrdersItemData[];
27
+ }
28
+
29
+ interface IOrdersResponse extends IAxiosResponseData {
30
+ data: {
31
+ attributes: IOrdersData;
32
+ relationships: Array<unknown>;
33
+ type: string;
34
+ };
35
+ }
36
+
37
+ // Single Order
38
+ interface IOrderTicketType {
39
+ name: string;
40
+ currency: string;
41
+ price: string;
42
+ discount: string;
43
+ quantity: string;
44
+ total: string;
45
+ active: boolean;
46
+ hash: string;
47
+ }
48
+
49
+ interface IOrderAddOn {
50
+ currency: string;
51
+ name: string;
52
+ price: string;
53
+ quantity: string;
54
+ total: string;
55
+ }
56
+
57
+ interface IOrderTicketAddOn {
58
+ status: string;
59
+ name: string;
60
+ }
61
+
62
+ interface IOrderTicketData {
63
+ hash: string;
64
+ qrData: string;
65
+ ticketType: string;
66
+ description: string | null;
67
+ descriptionPlain: string | null;
68
+ holderName: string;
69
+ status: string;
70
+ eventName: string;
71
+ currency: string;
72
+ resaleFeeAmount: number;
73
+ holderEmail: string;
74
+ holderPhone: string | null;
75
+ isSellable: boolean;
76
+ pdfLink: string;
77
+ isOnSale: boolean;
78
+ addOns: IOrderTicketAddOn[];
79
+ ticketTypeHash: string;
80
+ }
81
+
82
+ interface IOrderData {
83
+ disableReferral: boolean;
84
+ personalShareLink: string;
85
+ salesReferred: string;
86
+ total: string;
87
+ items: {
88
+ ticketTypes: IOrderTicketType[];
89
+ addOns: IOrderAddOn[];
90
+ };
91
+ tickets: IOrderTicketData[];
92
+ }
93
+
94
+ interface IOrderResponse extends IAxiosResponseData {
95
+ data: {
96
+ attributes: IOrderData;
97
+ relationships: Array<unknown>;
98
+ type: string;
99
+ };
100
+ }