@meaple-com/types 1.0.4 → 1.0.5

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 (3) hide show
  1. package/dist/index.d.mts +276 -140
  2. package/dist/index.d.ts +276 -140
  3. package/package.json +1 -1
package/dist/index.d.mts CHANGED
@@ -59,9 +59,9 @@ type TagProps = {
59
59
  };
60
60
 
61
61
  type EventContact = {
62
- email?: string;
63
- phoneNumber?: string;
64
- instagramUsername?: string;
62
+ email?: string | null;
63
+ phoneNumber?: string | null;
64
+ instagramUsername?: string | null;
65
65
  };
66
66
 
67
67
  type ExternalAnalyticsProps = {
@@ -71,15 +71,20 @@ type ExternalAnalyticsProps = {
71
71
 
72
72
  type EventType = 'DRAFT' | 'PUBLISHED' | 'PRIVATE';
73
73
 
74
+ type EventReviewStats = {
75
+ averageRating: number | null;
76
+ totalReviews: number;
77
+ };
78
+
74
79
  type EventProps = {
75
80
  id: string;
76
81
  slug: string;
77
- channelId: string;
82
+ channelId?: string;
78
83
  name: string;
79
84
  isSeatAssigned: boolean;
80
85
  description: Record<string, any>[];
81
86
  status: EventType;
82
- createdAt: string;
87
+ createdAt?: string;
83
88
  startsAt: string;
84
89
  endsAt: string;
85
90
  opensAt?: string | null;
@@ -87,12 +92,12 @@ type EventProps = {
87
92
  timezone: string;
88
93
  canceledAt: string | null;
89
94
  address?: AddressProps | null;
90
- image: FileProps;
95
+ image: FileProps | null;
91
96
  legalAgeRequired: boolean;
92
97
  contact?: EventContact;
93
98
  categories: CategoryProps[];
94
- tags: TagProps[];
95
- hasTicketInsurance: boolean;
99
+ tags?: TagProps[];
100
+ hasTicketInsurance?: boolean;
96
101
  channel: Pick<
97
102
  ChannelProps,
98
103
  'id' | 'name' | 'avatar' | 'slug' | 'eventsCount'
@@ -102,6 +107,7 @@ type EventProps = {
102
107
  EventProps,
103
108
  'id' | 'startsAt' | 'timezone' | 'isSeatAssigned'
104
109
  >[];
110
+ reviewStats?: EventReviewStats | null;
105
111
  };
106
112
 
107
113
  type GetChannelEventProps = {
@@ -112,34 +118,26 @@ type GetChannelEventsProps = {
112
118
  events: EventProps[];
113
119
  };
114
120
 
121
+ type CheckCouponProps = {
122
+ eventId: string;
123
+ couponCode: string;
124
+ };
125
+
115
126
  type CouponProps = {
116
127
  id: string;
117
128
  type: 'FIXED' | 'PERCENTAGE';
118
129
  code: string;
119
130
  value: number;
120
- expiresAt: string;
131
+ expiresAt: string | null;
121
132
  amount: number | null;
122
133
  availableAmount: number | null;
123
134
  ticketIds: string[];
124
135
  };
125
136
 
126
- type CheckCouponProps = {
127
- eventId: string;
128
- couponCode: string;
129
- };
130
-
131
- type CouponsListProps = {
132
- coupons: CouponProps[];
133
- cursor?: string;
134
- };
135
-
136
137
  type CreateEventReminderProps = {
137
138
  email: string;
138
- };
139
-
140
- type ChartCategoryProps = {
141
- id: string;
142
139
  name: string;
140
+ phoneNumber: string;
143
141
  };
144
142
 
145
143
  type GaugeProps = {
@@ -147,6 +145,11 @@ type GaugeProps = {
147
145
  usedAmount: number;
148
146
  };
149
147
 
148
+ type ChartCategoryProps = {
149
+ id: string;
150
+ name: string;
151
+ };
152
+
150
153
  type GroupProps = {
151
154
  id: string;
152
155
  name: string;
@@ -192,7 +195,7 @@ type TicketProps = {
192
195
  description?: string;
193
196
  amount: number;
194
197
  visibility: TicketVisibility;
195
- privateToken?: string;
198
+ privateToken?: string | null;
196
199
  image: (FileProps & { id: string }) | null;
197
200
  amount: number;
198
201
  availableAmount: number;
@@ -202,8 +205,8 @@ type TicketProps = {
202
205
  isInvite: boolean;
203
206
  startsAt?: string;
204
207
  endsAt?: string;
205
- minBuy?: number;
206
- maxBuy?: number;
208
+ minBuy?: number | null;
209
+ maxBuy?: number | null;
207
210
  beginsAt?: string;
208
211
  predecessor?: Pick<TicketProps, 'id' | 'name' | 'group'>;
209
212
  expireBehavior?: 'VISIBLE' | 'HIDDEN';
@@ -211,20 +214,61 @@ type TicketProps = {
211
214
  customFields?: TicketCustomField[];
212
215
  };
213
216
 
217
+ type FindEventProductEventProps = Pick<
218
+ EventProps,
219
+ 'id' | 'endsAt' | 'presaleStartsAt'
220
+ > & {
221
+ gauge: GaugeProps | null;
222
+ maxBuyAmount: number | null;
223
+ };
224
+
225
+ type FindEventProductItemProps = Pick<
226
+ TicketProps,
227
+ | 'id'
228
+ | 'name'
229
+ | 'description'
230
+ | 'amount'
231
+ | 'availableAmount'
232
+ | 'endsAt'
233
+ | 'price'
234
+ | 'image'
235
+ | 'privateToken'
236
+ | 'minBuy'
237
+ | 'maxBuy'
238
+ >;
239
+
214
240
  type FindEventProductsProps = {
215
- event: Pick<
216
- EventProps,
217
- 'id',
218
- 'endsAt',
219
- 'presaleStartsAt',
220
- 'maxBuyAmount',
221
- 'gauge'
222
- >;
223
- products: TicketProps[];
241
+ event: FindEventProductEventProps;
242
+ products: FindEventProductItemProps[];
243
+ };
244
+
245
+ type FindEventTagItemProps = Pick<
246
+ TagProps,
247
+ 'id' | 'name' | 'description' | 'emoji' | 'parentId'
248
+ >;
249
+
250
+ type FindEventItemProps = Pick<
251
+ EventProps,
252
+ | 'id'
253
+ | 'name'
254
+ | 'slug'
255
+ | 'description'
256
+ | 'canceledAt'
257
+ | 'endsAt'
258
+ | 'startsAt'
259
+ | 'presaleStartsAt'
260
+ | 'timezone'
261
+ | 'status'
262
+ | 'categories'
263
+ | 'address'
264
+ | 'channel'
265
+ > & {
266
+ image: FileProps | null;
267
+ tags: FindEventTagItemProps[];
224
268
  };
225
269
 
226
270
  type FindEventsProps = {
227
- events: EventProps[];
271
+ events: FindEventItemProps[];
228
272
  cursor?: string;
229
273
  };
230
274
 
@@ -239,17 +283,44 @@ type FindEventsParams = {
239
283
  categoryIds?: string[];
240
284
  };
241
285
 
286
+ type FindEventTicketsEventProps = Pick<
287
+ EventProps,
288
+ 'id' | 'startsAt' | 'endsAt' | 'presaleStartsAt'
289
+ > & {
290
+ maxBuyAmount: number | null;
291
+ };
292
+
293
+ type FindEventTicketItemProps = Pick<
294
+ TicketProps,
295
+ | 'id'
296
+ | 'type'
297
+ | 'groupId'
298
+ | 'name'
299
+ | 'description'
300
+ | 'amount'
301
+ | 'availableAmount'
302
+ | 'endsAt'
303
+ | 'price'
304
+ | 'orderAt'
305
+ | 'expireBehavior'
306
+ | 'image'
307
+ | 'chartCategory'
308
+ | 'privateToken'
309
+ | 'minBuy'
310
+ | 'maxBuy'
311
+ >;
312
+
313
+ type FindEventTicketGroupProps = Pick<
314
+ GroupProps,
315
+ 'id' | 'name' | 'description' | 'defaultOpen' | 'orderAt' | 'maxBuyAmount'
316
+ > & {
317
+ tickets: FindEventTicketItemProps[];
318
+ };
319
+
242
320
  type FindEventTicketsProps = {
243
- event: Pick<
244
- EventProps,
245
- 'id',
246
- 'startsAt',
247
- 'endsAt',
248
- 'presaleStartsAt',
249
- 'maxBuyAmount'
250
- >;
251
- tickets: TicketProps[];
252
- groups: GroupProps[];
321
+ event: FindEventTicketsEventProps;
322
+ tickets: FindEventTicketItemProps[];
323
+ groups: FindEventTicketGroupProps[];
253
324
  };
254
325
 
255
326
  type BuyerProps = {
@@ -261,6 +332,33 @@ type BuyerProps = {
261
332
  birthdate?: string | null;
262
333
  };
263
334
 
335
+ type NominationProps = {
336
+ name: string;
337
+ document: string | null;
338
+ };
339
+
340
+ type OrderItemTicketProps = Pick<
341
+ TicketProps,
342
+ | 'id'
343
+ | 'type'
344
+ | 'name'
345
+ | 'image'
346
+ | 'price'
347
+ | 'nominable'
348
+ | 'beginsAt'
349
+ | 'customFields'
350
+ > & {
351
+ group: Pick<GroupProps, 'id' | 'name'> | null;
352
+ };
353
+
354
+ type OrderItemProps = {
355
+ id: string;
356
+ amount: number;
357
+ seatIds: string[];
358
+ nominations: NominationProps[];
359
+ ticket: OrderItemTicketProps;
360
+ };
361
+
264
362
  type OrderStatus =
265
363
  | 'PENDING'
266
364
  | 'PAID'
@@ -275,6 +373,23 @@ type PaymentProps = {
275
373
  type: 'PIX' | 'CREDIT_CARD';
276
374
  };
277
375
 
376
+ type OrderEventProps = Pick<
377
+ EventProps,
378
+ | 'id'
379
+ | 'name'
380
+ | 'slug'
381
+ | 'legalAgeRequired'
382
+ | 'hasTicketInsurance'
383
+ | 'startsAt'
384
+ | 'opensAt'
385
+ | 'timezone'
386
+ | 'image'
387
+ | 'address'
388
+ | 'externalAnalytics'
389
+ > & {
390
+ channel: Pick<ChannelProps, 'id' | 'slug'>;
391
+ };
392
+
278
393
  type OrderProps = {
279
394
  id: string;
280
395
  status: OrderStatus;
@@ -284,34 +399,55 @@ type OrderProps = {
284
399
  totalDiscount: number;
285
400
  totalRefund?: number;
286
401
  totalCreditCardFee?: number;
402
+ totalInsurance?: number;
403
+ processingFee?: number;
287
404
  eventId: string;
288
- event: Pick<
289
- EventProps,
290
- | 'id'
291
- | 'name'
292
- | 'slug'
293
- | 'channel'
294
- | 'address'
295
- | 'startsAt'
296
- | 'image'
297
- | 'legalAgeRequired'
298
- | 'timezone'
299
- | 'externalAnalytics'
300
- >;
405
+ event: OrderEventProps;
301
406
  payment?: PaymentProps;
302
407
  buyer?: BuyerProps;
303
408
  coupon?: { usedAmount: number; coupon: Pick<CouponProps, 'id' | 'code'> };
304
409
  expiresAt: string;
305
410
  createdAt?: string;
306
411
  venue?: OrderVenue;
412
+ stoneTransactions?: unknown[];
413
+ };
414
+
415
+ type CreatedOrderEventProps = Pick<
416
+ EventProps,
417
+ 'id' | 'name' | 'startsAt'
418
+ >;
419
+
420
+ type CreatedOrderGroupProps = Pick<GroupProps, 'id' | 'name'> & {
421
+ gauge?: Pick<GaugeProps, 'totalAmount' | 'usedAmount' | 'id'> | null;
422
+ };
423
+
424
+ type CreatedOrderItemTicketProps = Pick<
425
+ TicketProps,
426
+ 'id' | 'name' | 'type' | 'price'
427
+ > & {
428
+ group: CreatedOrderGroupProps | null;
429
+ };
430
+
431
+ type CreatedOrderItemProps = Pick<OrderItemProps, 'id' | 'amount'> & {
432
+ ticket: CreatedOrderItemTicketProps;
433
+ };
434
+
435
+ type CreatedOrderOrderProps = Pick<
436
+ OrderProps,
437
+ 'id' | 'rawPrice' | 'totalPrice' | 'totalFee' | 'totalDiscount'
438
+ > & {
439
+ utmSource: string | null;
440
+ utmCampaign: string | null;
441
+ buyer: BuyerProps | null;
442
+ event: CreatedOrderEventProps;
443
+ items: CreatedOrderItemProps[];
444
+ info: Record<string, unknown>;
307
445
  };
308
446
 
309
447
  type CreatedOrderProps = {
310
- order: Pick<
311
- OrderProps,
312
- 'id' | 'expiresAt' | 'totalDiscount' | 'totalFee' | 'totalPrice'
313
- >;
314
- clientSecret?: string;
448
+ type: 'success';
449
+ order: CreatedOrderOrderProps;
450
+ clientSecret: string;
315
451
  };
316
452
 
317
453
  type CreateOrderTicketProps = {
@@ -330,58 +466,43 @@ type CreateOrderProps = {
330
466
  buyer?: BuyerProps;
331
467
  };
332
468
 
333
- type NominationProps = {
334
- name: string;
335
- document: string | null;
336
- };
337
-
338
- type EventWithChannelProps = {
339
- channel: Pick<ChannelProps, 'slug' | 'name'>;
340
- } & Pick<
469
+ type UserTicketEventProps = Pick<
341
470
  EventProps,
342
- 'id' | 'name' | 'slug' | 'startsAt' | 'timezone' | 'address' | 'image'
343
- >;
344
-
345
- type TicketWithEventPops = {
346
- event: EventWithChannelProps;
347
- } & TicketProps;
348
-
349
- type UserTicketProps = {
350
- id: string;
351
- slug: string;
352
- qrCodeDataUrl: string;
353
- ticket: TicketWithEventPops;
354
- nomination?: Pick<NominationProps, 'name' | 'document'>;
355
- seatId?: string;
356
- usedAt?: string | null;
357
- isInvite: boolean;
358
- ownerEmail: string;
359
- };
360
-
361
- type OrderItemTicketProps = Pick<
362
- TicketProps,
363
471
  | 'id'
364
- | 'type'
365
472
  | 'name'
473
+ | 'slug'
474
+ | 'startsAt'
475
+ | 'opensAt'
476
+ | 'timezone'
477
+ | 'address'
366
478
  | 'image'
367
- | 'price'
368
- | 'nominable'
369
- | 'beginsAt'
370
- | 'event'
371
479
  > & {
372
- group: Pick<GroupProps, 'id' | 'name'> | null;
480
+ channel: Pick<ChannelProps, 'id' | 'name' | 'slug'>;
373
481
  };
374
482
 
375
- type OrderItemProps = {
483
+ type UserTicketItemTicketProps = Pick<
484
+ TicketProps,
485
+ 'type' | 'name' | 'transferable' | 'image' | 'group'
486
+ > & {
487
+ beginsAt?: string | null;
488
+ event: UserTicketEventProps;
489
+ };
490
+
491
+ type UserTicketProps = {
376
492
  id: string;
377
- amount: number;
378
- seatIds: string[];
379
- nominations: NominationProps[];
380
- ticket: OrderItemTicketProps;
493
+ slug: string;
494
+ qrCodeDataUrl: string;
495
+ ticket: UserTicketItemTicketProps;
496
+ nomination?: Pick<NominationProps, 'name' | 'document'> | null;
497
+ seatId?: string | null;
498
+ usedAt?: string | null;
499
+ isInvite?: boolean;
500
+ ownerEmail?: string;
381
501
  };
382
502
 
383
503
  type OrderWithCreditCardProps = {
384
504
  paymentMethod: 'CREDIT_CARD';
505
+ creditCard?: { firstSixDigits: string };
385
506
  };
386
507
 
387
508
  type OrderWithPixProps = {
@@ -425,6 +546,7 @@ type ThreeDSProps = {
425
546
 
426
547
  type PaymentIntentProps = {
427
548
  id: string;
549
+ externalId?: string;
428
550
  status: PaymentIntentStatus;
429
551
  failureReason?: FailureReasonProps;
430
552
  threeDS?: ThreeDSProps;
@@ -453,7 +575,7 @@ type BaseFeeProps = {
453
575
  type ProcessingFeeProps = {
454
576
  fixedFee: number;
455
577
  percentageFee: number;
456
- lessThan: number;
578
+ lessThan?: number;
457
579
  };
458
580
 
459
581
  type PlatformFeeProps = BaseFeeProps & {
@@ -484,20 +606,50 @@ type UpdateUserTicketProps = {
484
606
  nomination?: NominationProps;
485
607
  };
486
608
 
487
- type GetUserEventsProps = {
488
- events: EventProps[];
609
+ type GetUserEventsProps = Pick<
610
+ EventProps,
611
+ | 'id'
612
+ | 'slug'
613
+ | 'name'
614
+ | 'description'
615
+ | 'status'
616
+ | 'startsAt'
617
+ | 'endsAt'
618
+ | 'opensAt'
619
+ | 'timezone'
620
+ | 'canceledAt'
621
+ | 'address'
622
+ | 'image'
623
+ > & {
624
+ channel: Pick<ChannelProps, 'id' | 'name' | 'slug' | 'avatar'>;
625
+ };
626
+
627
+ type UserOrderItemEventProps = Pick<
628
+ EventProps,
629
+ 'name' | 'startsAt' | 'endsAt'
630
+ > & {
631
+ channel: Pick<ChannelProps, 'id' | 'name' | 'avatar'>;
632
+ };
633
+
634
+ type UserOrderItemGroupProps = Pick<GroupProps, 'name' | 'id'>;
635
+
636
+ type UserOrderItemTicketProps = Pick<TicketProps, 'name' | 'id'> & {
637
+ group: UserOrderItemGroupProps | null;
638
+ event: UserOrderItemEventProps;
489
639
  };
490
640
 
491
641
  type UserOrderItemProps = {
492
642
  id: string;
493
643
  amount: number;
494
- ticket: Pick<TicketProps, 'id' | 'name' | 'group'>;
644
+ ticket: UserOrderItemTicketProps;
495
645
  };
496
646
 
497
647
  type UserOrderProps = Pick<
498
648
  OrderProps,
499
- 'id' | 'status' | 'rawPrice' | 'totalPrice' | 'createdAt' | 'totalFee'
500
- > & { items: UserOrderItemProps[] };
649
+ 'id' | 'status' | 'totalPrice' | 'createdAt' | 'totalFee' | 'totalInsurance'
650
+ > & {
651
+ items: UserOrderItemProps[];
652
+ };
501
653
 
502
654
  type GetUserOrdersProps = {
503
655
  orders: UserOrderProps[];
@@ -510,39 +662,23 @@ type UserProps = {
510
662
  phoneNumber?: string | null;
511
663
  document?: string | null;
512
664
  birthdate?: string | null;
665
+ role?: string;
666
+ avatar?: Pick<FileProps, 'url'> | null;
513
667
  avatarId?: string | null;
514
668
  createdAt?: string;
515
669
  updatedAt?: string;
516
670
  };
517
671
 
518
- type CreateUserProps = {
519
- name: string;
520
- email: string;
521
- password: string;
522
- phoneNumber?: string;
523
- document?: string;
524
- birthdate?: string;
525
- };
526
-
527
- type UpdateUserProps = {
528
- name?: string;
529
- phoneNumber?: string;
530
- document?: string;
531
- birthdate?: string;
532
- avatarId?: string;
533
- };
534
-
535
- type UpdateUserEmailProps = {
536
- email: string;
537
- };
538
-
539
- type UpdateUserPasswordProps = {
540
- currentPassword: string;
541
- newPassword: string;
542
- };
543
-
544
- type FindUserEventTicketsProps = {
545
- userTickets: UserTicketProps[];
546
- };
672
+ type GetMeUserProps = Pick<
673
+ UserProps,
674
+ | 'id'
675
+ | 'name'
676
+ | 'email'
677
+ | 'document'
678
+ | 'phoneNumber'
679
+ | 'birthdate'
680
+ | 'role'
681
+ | 'avatar'
682
+ >;
547
683
 
548
- export type { AddressProps, BuyerProps, CategoryProps, ChannelProps, ChartCategoryProps, CheckCouponProps, CouponProps, CouponsListProps, CreateEventReminderProps, CreateOrderProps, CreateOrderTicketProps, CreateTicketFileProps, CreateUserProps, CreatedOrderProps, EventContact, EventProps, ExternalAnalyticsProps, FileProps, FindEventProductsProps, FindEventTicketsProps, FindEventsParams, FindEventsProps, FindUserEventTicketsProps, GaugeProps, GetChannelEventProps, GetChannelEventsProps, GetOrderProps, GetUserEventsProps, GetUserOrdersProps, GroupProps, NominationProps, OrderItemProps, OrderItemTicketProps, OrderProps, PaymentIntentProps, PlatformFeeProps, TagProps, TicketCustomField, TicketCustomFieldType, TicketFileOutput, TicketProps, TransferTicketProps, TransferTicketRecipientProps, UpdateUserEmailProps, UpdateUserPasswordProps, UpdateUserProps, UpdateUserTicketProps, UserOrderItemProps, UserOrderProps, UserProps, UserTicketProps };
684
+ export type { AddressProps, BuyerProps, CategoryProps, ChannelProps, ChartCategoryProps, CheckCouponProps, CouponProps, CreateEventReminderProps, CreateOrderProps, CreateOrderTicketProps, CreateTicketFileProps, CreatedOrderEventProps, CreatedOrderGroupProps, CreatedOrderItemProps, CreatedOrderItemTicketProps, CreatedOrderOrderProps, CreatedOrderProps, EventContact, EventProps, EventReviewStats, ExternalAnalyticsProps, FileProps, FindEventItemProps, FindEventProductEventProps, FindEventProductItemProps, FindEventProductsProps, FindEventTagItemProps, FindEventTicketGroupProps, FindEventTicketItemProps, FindEventTicketsEventProps, FindEventTicketsProps, FindEventsParams, FindEventsProps, GaugeProps, GetChannelEventProps, GetChannelEventsProps, GetMeUserProps, GetOrderProps, GetUserEventsProps, GetUserOrdersProps, GroupProps, NominationProps, OrderEventProps, OrderItemProps, OrderItemTicketProps, OrderProps, PaymentIntentProps, PlatformFeeProps, TagProps, TicketCustomField, TicketCustomFieldType, TicketFileOutput, TicketProps, TransferTicketProps, TransferTicketRecipientProps, UpdateUserTicketProps, UserOrderItemProps, UserOrderProps, UserProps, UserTicketEventProps, UserTicketItemTicketProps, UserTicketProps };
package/dist/index.d.ts CHANGED
@@ -59,9 +59,9 @@ type TagProps = {
59
59
  };
60
60
 
61
61
  type EventContact = {
62
- email?: string;
63
- phoneNumber?: string;
64
- instagramUsername?: string;
62
+ email?: string | null;
63
+ phoneNumber?: string | null;
64
+ instagramUsername?: string | null;
65
65
  };
66
66
 
67
67
  type ExternalAnalyticsProps = {
@@ -71,15 +71,20 @@ type ExternalAnalyticsProps = {
71
71
 
72
72
  type EventType = 'DRAFT' | 'PUBLISHED' | 'PRIVATE';
73
73
 
74
+ type EventReviewStats = {
75
+ averageRating: number | null;
76
+ totalReviews: number;
77
+ };
78
+
74
79
  type EventProps = {
75
80
  id: string;
76
81
  slug: string;
77
- channelId: string;
82
+ channelId?: string;
78
83
  name: string;
79
84
  isSeatAssigned: boolean;
80
85
  description: Record<string, any>[];
81
86
  status: EventType;
82
- createdAt: string;
87
+ createdAt?: string;
83
88
  startsAt: string;
84
89
  endsAt: string;
85
90
  opensAt?: string | null;
@@ -87,12 +92,12 @@ type EventProps = {
87
92
  timezone: string;
88
93
  canceledAt: string | null;
89
94
  address?: AddressProps | null;
90
- image: FileProps;
95
+ image: FileProps | null;
91
96
  legalAgeRequired: boolean;
92
97
  contact?: EventContact;
93
98
  categories: CategoryProps[];
94
- tags: TagProps[];
95
- hasTicketInsurance: boolean;
99
+ tags?: TagProps[];
100
+ hasTicketInsurance?: boolean;
96
101
  channel: Pick<
97
102
  ChannelProps,
98
103
  'id' | 'name' | 'avatar' | 'slug' | 'eventsCount'
@@ -102,6 +107,7 @@ type EventProps = {
102
107
  EventProps,
103
108
  'id' | 'startsAt' | 'timezone' | 'isSeatAssigned'
104
109
  >[];
110
+ reviewStats?: EventReviewStats | null;
105
111
  };
106
112
 
107
113
  type GetChannelEventProps = {
@@ -112,34 +118,26 @@ type GetChannelEventsProps = {
112
118
  events: EventProps[];
113
119
  };
114
120
 
121
+ type CheckCouponProps = {
122
+ eventId: string;
123
+ couponCode: string;
124
+ };
125
+
115
126
  type CouponProps = {
116
127
  id: string;
117
128
  type: 'FIXED' | 'PERCENTAGE';
118
129
  code: string;
119
130
  value: number;
120
- expiresAt: string;
131
+ expiresAt: string | null;
121
132
  amount: number | null;
122
133
  availableAmount: number | null;
123
134
  ticketIds: string[];
124
135
  };
125
136
 
126
- type CheckCouponProps = {
127
- eventId: string;
128
- couponCode: string;
129
- };
130
-
131
- type CouponsListProps = {
132
- coupons: CouponProps[];
133
- cursor?: string;
134
- };
135
-
136
137
  type CreateEventReminderProps = {
137
138
  email: string;
138
- };
139
-
140
- type ChartCategoryProps = {
141
- id: string;
142
139
  name: string;
140
+ phoneNumber: string;
143
141
  };
144
142
 
145
143
  type GaugeProps = {
@@ -147,6 +145,11 @@ type GaugeProps = {
147
145
  usedAmount: number;
148
146
  };
149
147
 
148
+ type ChartCategoryProps = {
149
+ id: string;
150
+ name: string;
151
+ };
152
+
150
153
  type GroupProps = {
151
154
  id: string;
152
155
  name: string;
@@ -192,7 +195,7 @@ type TicketProps = {
192
195
  description?: string;
193
196
  amount: number;
194
197
  visibility: TicketVisibility;
195
- privateToken?: string;
198
+ privateToken?: string | null;
196
199
  image: (FileProps & { id: string }) | null;
197
200
  amount: number;
198
201
  availableAmount: number;
@@ -202,8 +205,8 @@ type TicketProps = {
202
205
  isInvite: boolean;
203
206
  startsAt?: string;
204
207
  endsAt?: string;
205
- minBuy?: number;
206
- maxBuy?: number;
208
+ minBuy?: number | null;
209
+ maxBuy?: number | null;
207
210
  beginsAt?: string;
208
211
  predecessor?: Pick<TicketProps, 'id' | 'name' | 'group'>;
209
212
  expireBehavior?: 'VISIBLE' | 'HIDDEN';
@@ -211,20 +214,61 @@ type TicketProps = {
211
214
  customFields?: TicketCustomField[];
212
215
  };
213
216
 
217
+ type FindEventProductEventProps = Pick<
218
+ EventProps,
219
+ 'id' | 'endsAt' | 'presaleStartsAt'
220
+ > & {
221
+ gauge: GaugeProps | null;
222
+ maxBuyAmount: number | null;
223
+ };
224
+
225
+ type FindEventProductItemProps = Pick<
226
+ TicketProps,
227
+ | 'id'
228
+ | 'name'
229
+ | 'description'
230
+ | 'amount'
231
+ | 'availableAmount'
232
+ | 'endsAt'
233
+ | 'price'
234
+ | 'image'
235
+ | 'privateToken'
236
+ | 'minBuy'
237
+ | 'maxBuy'
238
+ >;
239
+
214
240
  type FindEventProductsProps = {
215
- event: Pick<
216
- EventProps,
217
- 'id',
218
- 'endsAt',
219
- 'presaleStartsAt',
220
- 'maxBuyAmount',
221
- 'gauge'
222
- >;
223
- products: TicketProps[];
241
+ event: FindEventProductEventProps;
242
+ products: FindEventProductItemProps[];
243
+ };
244
+
245
+ type FindEventTagItemProps = Pick<
246
+ TagProps,
247
+ 'id' | 'name' | 'description' | 'emoji' | 'parentId'
248
+ >;
249
+
250
+ type FindEventItemProps = Pick<
251
+ EventProps,
252
+ | 'id'
253
+ | 'name'
254
+ | 'slug'
255
+ | 'description'
256
+ | 'canceledAt'
257
+ | 'endsAt'
258
+ | 'startsAt'
259
+ | 'presaleStartsAt'
260
+ | 'timezone'
261
+ | 'status'
262
+ | 'categories'
263
+ | 'address'
264
+ | 'channel'
265
+ > & {
266
+ image: FileProps | null;
267
+ tags: FindEventTagItemProps[];
224
268
  };
225
269
 
226
270
  type FindEventsProps = {
227
- events: EventProps[];
271
+ events: FindEventItemProps[];
228
272
  cursor?: string;
229
273
  };
230
274
 
@@ -239,17 +283,44 @@ type FindEventsParams = {
239
283
  categoryIds?: string[];
240
284
  };
241
285
 
286
+ type FindEventTicketsEventProps = Pick<
287
+ EventProps,
288
+ 'id' | 'startsAt' | 'endsAt' | 'presaleStartsAt'
289
+ > & {
290
+ maxBuyAmount: number | null;
291
+ };
292
+
293
+ type FindEventTicketItemProps = Pick<
294
+ TicketProps,
295
+ | 'id'
296
+ | 'type'
297
+ | 'groupId'
298
+ | 'name'
299
+ | 'description'
300
+ | 'amount'
301
+ | 'availableAmount'
302
+ | 'endsAt'
303
+ | 'price'
304
+ | 'orderAt'
305
+ | 'expireBehavior'
306
+ | 'image'
307
+ | 'chartCategory'
308
+ | 'privateToken'
309
+ | 'minBuy'
310
+ | 'maxBuy'
311
+ >;
312
+
313
+ type FindEventTicketGroupProps = Pick<
314
+ GroupProps,
315
+ 'id' | 'name' | 'description' | 'defaultOpen' | 'orderAt' | 'maxBuyAmount'
316
+ > & {
317
+ tickets: FindEventTicketItemProps[];
318
+ };
319
+
242
320
  type FindEventTicketsProps = {
243
- event: Pick<
244
- EventProps,
245
- 'id',
246
- 'startsAt',
247
- 'endsAt',
248
- 'presaleStartsAt',
249
- 'maxBuyAmount'
250
- >;
251
- tickets: TicketProps[];
252
- groups: GroupProps[];
321
+ event: FindEventTicketsEventProps;
322
+ tickets: FindEventTicketItemProps[];
323
+ groups: FindEventTicketGroupProps[];
253
324
  };
254
325
 
255
326
  type BuyerProps = {
@@ -261,6 +332,33 @@ type BuyerProps = {
261
332
  birthdate?: string | null;
262
333
  };
263
334
 
335
+ type NominationProps = {
336
+ name: string;
337
+ document: string | null;
338
+ };
339
+
340
+ type OrderItemTicketProps = Pick<
341
+ TicketProps,
342
+ | 'id'
343
+ | 'type'
344
+ | 'name'
345
+ | 'image'
346
+ | 'price'
347
+ | 'nominable'
348
+ | 'beginsAt'
349
+ | 'customFields'
350
+ > & {
351
+ group: Pick<GroupProps, 'id' | 'name'> | null;
352
+ };
353
+
354
+ type OrderItemProps = {
355
+ id: string;
356
+ amount: number;
357
+ seatIds: string[];
358
+ nominations: NominationProps[];
359
+ ticket: OrderItemTicketProps;
360
+ };
361
+
264
362
  type OrderStatus =
265
363
  | 'PENDING'
266
364
  | 'PAID'
@@ -275,6 +373,23 @@ type PaymentProps = {
275
373
  type: 'PIX' | 'CREDIT_CARD';
276
374
  };
277
375
 
376
+ type OrderEventProps = Pick<
377
+ EventProps,
378
+ | 'id'
379
+ | 'name'
380
+ | 'slug'
381
+ | 'legalAgeRequired'
382
+ | 'hasTicketInsurance'
383
+ | 'startsAt'
384
+ | 'opensAt'
385
+ | 'timezone'
386
+ | 'image'
387
+ | 'address'
388
+ | 'externalAnalytics'
389
+ > & {
390
+ channel: Pick<ChannelProps, 'id' | 'slug'>;
391
+ };
392
+
278
393
  type OrderProps = {
279
394
  id: string;
280
395
  status: OrderStatus;
@@ -284,34 +399,55 @@ type OrderProps = {
284
399
  totalDiscount: number;
285
400
  totalRefund?: number;
286
401
  totalCreditCardFee?: number;
402
+ totalInsurance?: number;
403
+ processingFee?: number;
287
404
  eventId: string;
288
- event: Pick<
289
- EventProps,
290
- | 'id'
291
- | 'name'
292
- | 'slug'
293
- | 'channel'
294
- | 'address'
295
- | 'startsAt'
296
- | 'image'
297
- | 'legalAgeRequired'
298
- | 'timezone'
299
- | 'externalAnalytics'
300
- >;
405
+ event: OrderEventProps;
301
406
  payment?: PaymentProps;
302
407
  buyer?: BuyerProps;
303
408
  coupon?: { usedAmount: number; coupon: Pick<CouponProps, 'id' | 'code'> };
304
409
  expiresAt: string;
305
410
  createdAt?: string;
306
411
  venue?: OrderVenue;
412
+ stoneTransactions?: unknown[];
413
+ };
414
+
415
+ type CreatedOrderEventProps = Pick<
416
+ EventProps,
417
+ 'id' | 'name' | 'startsAt'
418
+ >;
419
+
420
+ type CreatedOrderGroupProps = Pick<GroupProps, 'id' | 'name'> & {
421
+ gauge?: Pick<GaugeProps, 'totalAmount' | 'usedAmount' | 'id'> | null;
422
+ };
423
+
424
+ type CreatedOrderItemTicketProps = Pick<
425
+ TicketProps,
426
+ 'id' | 'name' | 'type' | 'price'
427
+ > & {
428
+ group: CreatedOrderGroupProps | null;
429
+ };
430
+
431
+ type CreatedOrderItemProps = Pick<OrderItemProps, 'id' | 'amount'> & {
432
+ ticket: CreatedOrderItemTicketProps;
433
+ };
434
+
435
+ type CreatedOrderOrderProps = Pick<
436
+ OrderProps,
437
+ 'id' | 'rawPrice' | 'totalPrice' | 'totalFee' | 'totalDiscount'
438
+ > & {
439
+ utmSource: string | null;
440
+ utmCampaign: string | null;
441
+ buyer: BuyerProps | null;
442
+ event: CreatedOrderEventProps;
443
+ items: CreatedOrderItemProps[];
444
+ info: Record<string, unknown>;
307
445
  };
308
446
 
309
447
  type CreatedOrderProps = {
310
- order: Pick<
311
- OrderProps,
312
- 'id' | 'expiresAt' | 'totalDiscount' | 'totalFee' | 'totalPrice'
313
- >;
314
- clientSecret?: string;
448
+ type: 'success';
449
+ order: CreatedOrderOrderProps;
450
+ clientSecret: string;
315
451
  };
316
452
 
317
453
  type CreateOrderTicketProps = {
@@ -330,58 +466,43 @@ type CreateOrderProps = {
330
466
  buyer?: BuyerProps;
331
467
  };
332
468
 
333
- type NominationProps = {
334
- name: string;
335
- document: string | null;
336
- };
337
-
338
- type EventWithChannelProps = {
339
- channel: Pick<ChannelProps, 'slug' | 'name'>;
340
- } & Pick<
469
+ type UserTicketEventProps = Pick<
341
470
  EventProps,
342
- 'id' | 'name' | 'slug' | 'startsAt' | 'timezone' | 'address' | 'image'
343
- >;
344
-
345
- type TicketWithEventPops = {
346
- event: EventWithChannelProps;
347
- } & TicketProps;
348
-
349
- type UserTicketProps = {
350
- id: string;
351
- slug: string;
352
- qrCodeDataUrl: string;
353
- ticket: TicketWithEventPops;
354
- nomination?: Pick<NominationProps, 'name' | 'document'>;
355
- seatId?: string;
356
- usedAt?: string | null;
357
- isInvite: boolean;
358
- ownerEmail: string;
359
- };
360
-
361
- type OrderItemTicketProps = Pick<
362
- TicketProps,
363
471
  | 'id'
364
- | 'type'
365
472
  | 'name'
473
+ | 'slug'
474
+ | 'startsAt'
475
+ | 'opensAt'
476
+ | 'timezone'
477
+ | 'address'
366
478
  | 'image'
367
- | 'price'
368
- | 'nominable'
369
- | 'beginsAt'
370
- | 'event'
371
479
  > & {
372
- group: Pick<GroupProps, 'id' | 'name'> | null;
480
+ channel: Pick<ChannelProps, 'id' | 'name' | 'slug'>;
373
481
  };
374
482
 
375
- type OrderItemProps = {
483
+ type UserTicketItemTicketProps = Pick<
484
+ TicketProps,
485
+ 'type' | 'name' | 'transferable' | 'image' | 'group'
486
+ > & {
487
+ beginsAt?: string | null;
488
+ event: UserTicketEventProps;
489
+ };
490
+
491
+ type UserTicketProps = {
376
492
  id: string;
377
- amount: number;
378
- seatIds: string[];
379
- nominations: NominationProps[];
380
- ticket: OrderItemTicketProps;
493
+ slug: string;
494
+ qrCodeDataUrl: string;
495
+ ticket: UserTicketItemTicketProps;
496
+ nomination?: Pick<NominationProps, 'name' | 'document'> | null;
497
+ seatId?: string | null;
498
+ usedAt?: string | null;
499
+ isInvite?: boolean;
500
+ ownerEmail?: string;
381
501
  };
382
502
 
383
503
  type OrderWithCreditCardProps = {
384
504
  paymentMethod: 'CREDIT_CARD';
505
+ creditCard?: { firstSixDigits: string };
385
506
  };
386
507
 
387
508
  type OrderWithPixProps = {
@@ -425,6 +546,7 @@ type ThreeDSProps = {
425
546
 
426
547
  type PaymentIntentProps = {
427
548
  id: string;
549
+ externalId?: string;
428
550
  status: PaymentIntentStatus;
429
551
  failureReason?: FailureReasonProps;
430
552
  threeDS?: ThreeDSProps;
@@ -453,7 +575,7 @@ type BaseFeeProps = {
453
575
  type ProcessingFeeProps = {
454
576
  fixedFee: number;
455
577
  percentageFee: number;
456
- lessThan: number;
578
+ lessThan?: number;
457
579
  };
458
580
 
459
581
  type PlatformFeeProps = BaseFeeProps & {
@@ -484,20 +606,50 @@ type UpdateUserTicketProps = {
484
606
  nomination?: NominationProps;
485
607
  };
486
608
 
487
- type GetUserEventsProps = {
488
- events: EventProps[];
609
+ type GetUserEventsProps = Pick<
610
+ EventProps,
611
+ | 'id'
612
+ | 'slug'
613
+ | 'name'
614
+ | 'description'
615
+ | 'status'
616
+ | 'startsAt'
617
+ | 'endsAt'
618
+ | 'opensAt'
619
+ | 'timezone'
620
+ | 'canceledAt'
621
+ | 'address'
622
+ | 'image'
623
+ > & {
624
+ channel: Pick<ChannelProps, 'id' | 'name' | 'slug' | 'avatar'>;
625
+ };
626
+
627
+ type UserOrderItemEventProps = Pick<
628
+ EventProps,
629
+ 'name' | 'startsAt' | 'endsAt'
630
+ > & {
631
+ channel: Pick<ChannelProps, 'id' | 'name' | 'avatar'>;
632
+ };
633
+
634
+ type UserOrderItemGroupProps = Pick<GroupProps, 'name' | 'id'>;
635
+
636
+ type UserOrderItemTicketProps = Pick<TicketProps, 'name' | 'id'> & {
637
+ group: UserOrderItemGroupProps | null;
638
+ event: UserOrderItemEventProps;
489
639
  };
490
640
 
491
641
  type UserOrderItemProps = {
492
642
  id: string;
493
643
  amount: number;
494
- ticket: Pick<TicketProps, 'id' | 'name' | 'group'>;
644
+ ticket: UserOrderItemTicketProps;
495
645
  };
496
646
 
497
647
  type UserOrderProps = Pick<
498
648
  OrderProps,
499
- 'id' | 'status' | 'rawPrice' | 'totalPrice' | 'createdAt' | 'totalFee'
500
- > & { items: UserOrderItemProps[] };
649
+ 'id' | 'status' | 'totalPrice' | 'createdAt' | 'totalFee' | 'totalInsurance'
650
+ > & {
651
+ items: UserOrderItemProps[];
652
+ };
501
653
 
502
654
  type GetUserOrdersProps = {
503
655
  orders: UserOrderProps[];
@@ -510,39 +662,23 @@ type UserProps = {
510
662
  phoneNumber?: string | null;
511
663
  document?: string | null;
512
664
  birthdate?: string | null;
665
+ role?: string;
666
+ avatar?: Pick<FileProps, 'url'> | null;
513
667
  avatarId?: string | null;
514
668
  createdAt?: string;
515
669
  updatedAt?: string;
516
670
  };
517
671
 
518
- type CreateUserProps = {
519
- name: string;
520
- email: string;
521
- password: string;
522
- phoneNumber?: string;
523
- document?: string;
524
- birthdate?: string;
525
- };
526
-
527
- type UpdateUserProps = {
528
- name?: string;
529
- phoneNumber?: string;
530
- document?: string;
531
- birthdate?: string;
532
- avatarId?: string;
533
- };
534
-
535
- type UpdateUserEmailProps = {
536
- email: string;
537
- };
538
-
539
- type UpdateUserPasswordProps = {
540
- currentPassword: string;
541
- newPassword: string;
542
- };
543
-
544
- type FindUserEventTicketsProps = {
545
- userTickets: UserTicketProps[];
546
- };
672
+ type GetMeUserProps = Pick<
673
+ UserProps,
674
+ | 'id'
675
+ | 'name'
676
+ | 'email'
677
+ | 'document'
678
+ | 'phoneNumber'
679
+ | 'birthdate'
680
+ | 'role'
681
+ | 'avatar'
682
+ >;
547
683
 
548
- export type { AddressProps, BuyerProps, CategoryProps, ChannelProps, ChartCategoryProps, CheckCouponProps, CouponProps, CouponsListProps, CreateEventReminderProps, CreateOrderProps, CreateOrderTicketProps, CreateTicketFileProps, CreateUserProps, CreatedOrderProps, EventContact, EventProps, ExternalAnalyticsProps, FileProps, FindEventProductsProps, FindEventTicketsProps, FindEventsParams, FindEventsProps, FindUserEventTicketsProps, GaugeProps, GetChannelEventProps, GetChannelEventsProps, GetOrderProps, GetUserEventsProps, GetUserOrdersProps, GroupProps, NominationProps, OrderItemProps, OrderItemTicketProps, OrderProps, PaymentIntentProps, PlatformFeeProps, TagProps, TicketCustomField, TicketCustomFieldType, TicketFileOutput, TicketProps, TransferTicketProps, TransferTicketRecipientProps, UpdateUserEmailProps, UpdateUserPasswordProps, UpdateUserProps, UpdateUserTicketProps, UserOrderItemProps, UserOrderProps, UserProps, UserTicketProps };
684
+ export type { AddressProps, BuyerProps, CategoryProps, ChannelProps, ChartCategoryProps, CheckCouponProps, CouponProps, CreateEventReminderProps, CreateOrderProps, CreateOrderTicketProps, CreateTicketFileProps, CreatedOrderEventProps, CreatedOrderGroupProps, CreatedOrderItemProps, CreatedOrderItemTicketProps, CreatedOrderOrderProps, CreatedOrderProps, EventContact, EventProps, EventReviewStats, ExternalAnalyticsProps, FileProps, FindEventItemProps, FindEventProductEventProps, FindEventProductItemProps, FindEventProductsProps, FindEventTagItemProps, FindEventTicketGroupProps, FindEventTicketItemProps, FindEventTicketsEventProps, FindEventTicketsProps, FindEventsParams, FindEventsProps, GaugeProps, GetChannelEventProps, GetChannelEventsProps, GetMeUserProps, GetOrderProps, GetUserEventsProps, GetUserOrdersProps, GroupProps, NominationProps, OrderEventProps, OrderItemProps, OrderItemTicketProps, OrderProps, PaymentIntentProps, PlatformFeeProps, TagProps, TicketCustomField, TicketCustomFieldType, TicketFileOutput, TicketProps, TransferTicketProps, TransferTicketRecipientProps, UpdateUserTicketProps, UserOrderItemProps, UserOrderProps, UserProps, UserTicketEventProps, UserTicketItemTicketProps, UserTicketProps };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meaple-com/types",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "TypeScript types for Meaple SDK",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",