@whop/sdk 0.0.7 → 0.0.8
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/CHANGELOG.md +19 -0
- package/client.d.mts +16 -10
- package/client.d.mts.map +1 -1
- package/client.d.ts +16 -10
- package/client.d.ts.map +1 -1
- package/client.js +6 -0
- package/client.js.map +1 -1
- package/client.mjs +6 -0
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/apps.d.mts +17 -1
- package/resources/apps.d.mts.map +1 -1
- package/resources/apps.d.ts +17 -1
- package/resources/apps.d.ts.map +1 -1
- package/resources/checkout-configurations.d.mts +165 -8
- package/resources/checkout-configurations.d.mts.map +1 -1
- package/resources/checkout-configurations.d.ts +165 -8
- package/resources/checkout-configurations.d.ts.map +1 -1
- package/resources/checkout-configurations.js +1 -0
- package/resources/checkout-configurations.js.map +1 -1
- package/resources/checkout-configurations.mjs +1 -0
- package/resources/checkout-configurations.mjs.map +1 -1
- package/resources/course-lessons.d.mts +199 -1
- package/resources/course-lessons.d.mts.map +1 -1
- package/resources/course-lessons.d.ts +199 -1
- package/resources/course-lessons.d.ts.map +1 -1
- package/resources/course-lessons.js +40 -0
- package/resources/course-lessons.js.map +1 -1
- package/resources/course-lessons.mjs +40 -0
- package/resources/course-lessons.mjs.map +1 -1
- package/resources/courses.d.mts +8 -0
- package/resources/courses.d.mts.map +1 -1
- package/resources/courses.d.ts +8 -0
- package/resources/courses.d.ts.map +1 -1
- package/resources/forum-posts.d.mts +7 -3
- package/resources/forum-posts.d.mts.map +1 -1
- package/resources/forum-posts.d.ts +7 -3
- package/resources/forum-posts.d.ts.map +1 -1
- package/resources/index.d.mts +7 -5
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +7 -5
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +5 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -0
- package/resources/index.mjs.map +1 -1
- package/resources/refunds.d.mts +295 -0
- package/resources/refunds.d.mts.map +1 -0
- package/resources/refunds.d.ts +295 -0
- package/resources/refunds.d.ts.map +1 -0
- package/resources/refunds.js +34 -0
- package/resources/refunds.js.map +1 -0
- package/resources/refunds.mjs +30 -0
- package/resources/refunds.mjs.map +1 -0
- package/resources/shared.d.mts +43 -2
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +43 -2
- package/resources/shared.d.ts.map +1 -1
- package/resources/webhooks.d.mts +382 -2
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +382 -2
- package/resources/webhooks.d.ts.map +1 -1
- package/resources/webhooks.js.map +1 -1
- package/resources/webhooks.mjs.map +1 -1
- package/resources/withdrawals.d.mts +233 -0
- package/resources/withdrawals.d.mts.map +1 -0
- package/resources/withdrawals.d.ts +233 -0
- package/resources/withdrawals.d.ts.map +1 -0
- package/resources/withdrawals.js +31 -0
- package/resources/withdrawals.js.map +1 -0
- package/resources/withdrawals.mjs +27 -0
- package/resources/withdrawals.mjs.map +1 -0
- package/src/client.ts +68 -0
- package/src/resources/apps.ts +21 -0
- package/src/resources/checkout-configurations.ts +189 -8
- package/src/resources/course-lessons.ts +250 -0
- package/src/resources/courses.ts +10 -0
- package/src/resources/forum-posts.ts +8 -2
- package/src/resources/index.ts +31 -0
- package/src/resources/refunds.ts +383 -0
- package/src/resources/shared.ts +49 -2
- package/src/resources/webhooks.ts +463 -1
- package/src/resources/withdrawals.ts +361 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../core/resource';
|
|
4
4
|
import * as DisputesAPI from './disputes';
|
|
5
|
+
import * as PaymentsAPI from './payments';
|
|
6
|
+
import * as RefundsAPI from './refunds';
|
|
5
7
|
import * as Shared from './shared';
|
|
6
8
|
import { Webhook } from 'standardwebhooks';
|
|
7
9
|
|
|
@@ -454,6 +456,462 @@ export interface DisputeUpdatedWebhookEvent {
|
|
|
454
456
|
type: 'dispute.updated';
|
|
455
457
|
}
|
|
456
458
|
|
|
459
|
+
export interface RefundCreatedWebhookEvent {
|
|
460
|
+
/**
|
|
461
|
+
* A unique ID for every single webhook request
|
|
462
|
+
*/
|
|
463
|
+
id: string;
|
|
464
|
+
|
|
465
|
+
/**
|
|
466
|
+
* The API version for this webhook
|
|
467
|
+
*/
|
|
468
|
+
api_version: 'v1';
|
|
469
|
+
|
|
470
|
+
/**
|
|
471
|
+
* An object representing a refund made on a payment.
|
|
472
|
+
*/
|
|
473
|
+
data: RefundCreatedWebhookEvent.Data;
|
|
474
|
+
|
|
475
|
+
/**
|
|
476
|
+
* The timestamp in ISO 8601 format that the webhook was sent at on the server
|
|
477
|
+
*/
|
|
478
|
+
timestamp: string;
|
|
479
|
+
|
|
480
|
+
/**
|
|
481
|
+
* The webhook event type
|
|
482
|
+
*/
|
|
483
|
+
type: 'refund.created';
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
export namespace RefundCreatedWebhookEvent {
|
|
487
|
+
/**
|
|
488
|
+
* An object representing a refund made on a payment.
|
|
489
|
+
*/
|
|
490
|
+
export interface Data {
|
|
491
|
+
/**
|
|
492
|
+
* The ID of the refund.
|
|
493
|
+
*/
|
|
494
|
+
id: string;
|
|
495
|
+
|
|
496
|
+
/**
|
|
497
|
+
* The amount of the refund.
|
|
498
|
+
*/
|
|
499
|
+
amount: number;
|
|
500
|
+
|
|
501
|
+
/**
|
|
502
|
+
* The time the refund was created.
|
|
503
|
+
*/
|
|
504
|
+
created_at: string;
|
|
505
|
+
|
|
506
|
+
/**
|
|
507
|
+
* The currency of the refund.
|
|
508
|
+
*/
|
|
509
|
+
currency: Shared.Currency;
|
|
510
|
+
|
|
511
|
+
/**
|
|
512
|
+
* The payment associated with the refund.
|
|
513
|
+
*/
|
|
514
|
+
payment: Data.Payment | null;
|
|
515
|
+
|
|
516
|
+
/**
|
|
517
|
+
* The provider of the refund.
|
|
518
|
+
*/
|
|
519
|
+
provider: RefundsAPI.PaymentProvider;
|
|
520
|
+
|
|
521
|
+
/**
|
|
522
|
+
* The time the refund was created by the provider.
|
|
523
|
+
*/
|
|
524
|
+
provider_created_at: string | null;
|
|
525
|
+
|
|
526
|
+
/**
|
|
527
|
+
* The status of the refund reference.
|
|
528
|
+
*/
|
|
529
|
+
reference_status: RefundsAPI.RefundReferenceStatus | null;
|
|
530
|
+
|
|
531
|
+
/**
|
|
532
|
+
* The type of refund reference that was made available by the payment provider.
|
|
533
|
+
*/
|
|
534
|
+
reference_type: RefundsAPI.RefundReferenceType | null;
|
|
535
|
+
|
|
536
|
+
/**
|
|
537
|
+
* The value of the reference.
|
|
538
|
+
*/
|
|
539
|
+
reference_value: string | null;
|
|
540
|
+
|
|
541
|
+
/**
|
|
542
|
+
* The status of the refund.
|
|
543
|
+
*/
|
|
544
|
+
status: RefundsAPI.RefundStatus;
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
export namespace Data {
|
|
548
|
+
/**
|
|
549
|
+
* The payment associated with the refund.
|
|
550
|
+
*/
|
|
551
|
+
export interface Payment {
|
|
552
|
+
/**
|
|
553
|
+
* The payment ID
|
|
554
|
+
*/
|
|
555
|
+
id: string;
|
|
556
|
+
|
|
557
|
+
/**
|
|
558
|
+
* The reason why a specific payment was billed
|
|
559
|
+
*/
|
|
560
|
+
billing_reason: PaymentsAPI.BillingReasons | null;
|
|
561
|
+
|
|
562
|
+
/**
|
|
563
|
+
* Possible card brands that a payment token can have
|
|
564
|
+
*/
|
|
565
|
+
card_brand: PaymentsAPI.CardBrands | null;
|
|
566
|
+
|
|
567
|
+
/**
|
|
568
|
+
* The last 4 digits of the card used to make the payment.
|
|
569
|
+
*/
|
|
570
|
+
card_last4: string | null;
|
|
571
|
+
|
|
572
|
+
/**
|
|
573
|
+
* The datetime the payment was created
|
|
574
|
+
*/
|
|
575
|
+
created_at: string;
|
|
576
|
+
|
|
577
|
+
/**
|
|
578
|
+
* The available currencies on the platform
|
|
579
|
+
*/
|
|
580
|
+
currency: Shared.Currency | null;
|
|
581
|
+
|
|
582
|
+
/**
|
|
583
|
+
* When an alert came in that this transaction will be disputed
|
|
584
|
+
*/
|
|
585
|
+
dispute_alerted_at: string | null;
|
|
586
|
+
|
|
587
|
+
/**
|
|
588
|
+
* The member attached to this payment.
|
|
589
|
+
*/
|
|
590
|
+
member: Payment.Member | null;
|
|
591
|
+
|
|
592
|
+
/**
|
|
593
|
+
* The membership attached to this payment.
|
|
594
|
+
*/
|
|
595
|
+
membership: Payment.Membership | null;
|
|
596
|
+
|
|
597
|
+
/**
|
|
598
|
+
* The datetime the payment was paid
|
|
599
|
+
*/
|
|
600
|
+
paid_at: string | null;
|
|
601
|
+
|
|
602
|
+
/**
|
|
603
|
+
* The different types of payment methods that can be used.
|
|
604
|
+
*/
|
|
605
|
+
payment_method_type: PaymentsAPI.PaymentMethodTypes | null;
|
|
606
|
+
|
|
607
|
+
/**
|
|
608
|
+
* The subtotal to show to the creator (excluding buyer fees).
|
|
609
|
+
*/
|
|
610
|
+
subtotal: number | null;
|
|
611
|
+
|
|
612
|
+
/**
|
|
613
|
+
* The total to show to the creator (excluding buyer fees).
|
|
614
|
+
*/
|
|
615
|
+
total: number | null;
|
|
616
|
+
|
|
617
|
+
/**
|
|
618
|
+
* The total in USD to show to the creator (excluding buyer fees).
|
|
619
|
+
*/
|
|
620
|
+
usd_total: number | null;
|
|
621
|
+
|
|
622
|
+
/**
|
|
623
|
+
* The user that made this payment.
|
|
624
|
+
*/
|
|
625
|
+
user: Payment.User | null;
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
export namespace Payment {
|
|
629
|
+
/**
|
|
630
|
+
* The member attached to this payment.
|
|
631
|
+
*/
|
|
632
|
+
export interface Member {
|
|
633
|
+
/**
|
|
634
|
+
* The ID of the member
|
|
635
|
+
*/
|
|
636
|
+
id: string;
|
|
637
|
+
|
|
638
|
+
/**
|
|
639
|
+
* The phone number for the member, if available.
|
|
640
|
+
*/
|
|
641
|
+
phone: string | null;
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
/**
|
|
645
|
+
* The membership attached to this payment.
|
|
646
|
+
*/
|
|
647
|
+
export interface Membership {
|
|
648
|
+
/**
|
|
649
|
+
* The internal ID of the membership.
|
|
650
|
+
*/
|
|
651
|
+
id: string;
|
|
652
|
+
|
|
653
|
+
/**
|
|
654
|
+
* The state of the membership.
|
|
655
|
+
*/
|
|
656
|
+
status: Shared.MembershipStatus;
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
/**
|
|
660
|
+
* The user that made this payment.
|
|
661
|
+
*/
|
|
662
|
+
export interface User {
|
|
663
|
+
/**
|
|
664
|
+
* The internal ID of the user.
|
|
665
|
+
*/
|
|
666
|
+
id: string;
|
|
667
|
+
|
|
668
|
+
/**
|
|
669
|
+
* The email of the user
|
|
670
|
+
*/
|
|
671
|
+
email: string | null;
|
|
672
|
+
|
|
673
|
+
/**
|
|
674
|
+
* The name of the user from their Whop account.
|
|
675
|
+
*/
|
|
676
|
+
name: string | null;
|
|
677
|
+
|
|
678
|
+
/**
|
|
679
|
+
* The username of the user from their Whop account.
|
|
680
|
+
*/
|
|
681
|
+
username: string;
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
export interface RefundUpdatedWebhookEvent {
|
|
688
|
+
/**
|
|
689
|
+
* A unique ID for every single webhook request
|
|
690
|
+
*/
|
|
691
|
+
id: string;
|
|
692
|
+
|
|
693
|
+
/**
|
|
694
|
+
* The API version for this webhook
|
|
695
|
+
*/
|
|
696
|
+
api_version: 'v1';
|
|
697
|
+
|
|
698
|
+
/**
|
|
699
|
+
* An object representing a refund made on a payment.
|
|
700
|
+
*/
|
|
701
|
+
data: RefundUpdatedWebhookEvent.Data;
|
|
702
|
+
|
|
703
|
+
/**
|
|
704
|
+
* The timestamp in ISO 8601 format that the webhook was sent at on the server
|
|
705
|
+
*/
|
|
706
|
+
timestamp: string;
|
|
707
|
+
|
|
708
|
+
/**
|
|
709
|
+
* The webhook event type
|
|
710
|
+
*/
|
|
711
|
+
type: 'refund.updated';
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
export namespace RefundUpdatedWebhookEvent {
|
|
715
|
+
/**
|
|
716
|
+
* An object representing a refund made on a payment.
|
|
717
|
+
*/
|
|
718
|
+
export interface Data {
|
|
719
|
+
/**
|
|
720
|
+
* The ID of the refund.
|
|
721
|
+
*/
|
|
722
|
+
id: string;
|
|
723
|
+
|
|
724
|
+
/**
|
|
725
|
+
* The amount of the refund.
|
|
726
|
+
*/
|
|
727
|
+
amount: number;
|
|
728
|
+
|
|
729
|
+
/**
|
|
730
|
+
* The time the refund was created.
|
|
731
|
+
*/
|
|
732
|
+
created_at: string;
|
|
733
|
+
|
|
734
|
+
/**
|
|
735
|
+
* The currency of the refund.
|
|
736
|
+
*/
|
|
737
|
+
currency: Shared.Currency;
|
|
738
|
+
|
|
739
|
+
/**
|
|
740
|
+
* The payment associated with the refund.
|
|
741
|
+
*/
|
|
742
|
+
payment: Data.Payment | null;
|
|
743
|
+
|
|
744
|
+
/**
|
|
745
|
+
* The provider of the refund.
|
|
746
|
+
*/
|
|
747
|
+
provider: RefundsAPI.PaymentProvider;
|
|
748
|
+
|
|
749
|
+
/**
|
|
750
|
+
* The time the refund was created by the provider.
|
|
751
|
+
*/
|
|
752
|
+
provider_created_at: string | null;
|
|
753
|
+
|
|
754
|
+
/**
|
|
755
|
+
* The status of the refund reference.
|
|
756
|
+
*/
|
|
757
|
+
reference_status: RefundsAPI.RefundReferenceStatus | null;
|
|
758
|
+
|
|
759
|
+
/**
|
|
760
|
+
* The type of refund reference that was made available by the payment provider.
|
|
761
|
+
*/
|
|
762
|
+
reference_type: RefundsAPI.RefundReferenceType | null;
|
|
763
|
+
|
|
764
|
+
/**
|
|
765
|
+
* The value of the reference.
|
|
766
|
+
*/
|
|
767
|
+
reference_value: string | null;
|
|
768
|
+
|
|
769
|
+
/**
|
|
770
|
+
* The status of the refund.
|
|
771
|
+
*/
|
|
772
|
+
status: RefundsAPI.RefundStatus;
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
export namespace Data {
|
|
776
|
+
/**
|
|
777
|
+
* The payment associated with the refund.
|
|
778
|
+
*/
|
|
779
|
+
export interface Payment {
|
|
780
|
+
/**
|
|
781
|
+
* The payment ID
|
|
782
|
+
*/
|
|
783
|
+
id: string;
|
|
784
|
+
|
|
785
|
+
/**
|
|
786
|
+
* The reason why a specific payment was billed
|
|
787
|
+
*/
|
|
788
|
+
billing_reason: PaymentsAPI.BillingReasons | null;
|
|
789
|
+
|
|
790
|
+
/**
|
|
791
|
+
* Possible card brands that a payment token can have
|
|
792
|
+
*/
|
|
793
|
+
card_brand: PaymentsAPI.CardBrands | null;
|
|
794
|
+
|
|
795
|
+
/**
|
|
796
|
+
* The last 4 digits of the card used to make the payment.
|
|
797
|
+
*/
|
|
798
|
+
card_last4: string | null;
|
|
799
|
+
|
|
800
|
+
/**
|
|
801
|
+
* The datetime the payment was created
|
|
802
|
+
*/
|
|
803
|
+
created_at: string;
|
|
804
|
+
|
|
805
|
+
/**
|
|
806
|
+
* The available currencies on the platform
|
|
807
|
+
*/
|
|
808
|
+
currency: Shared.Currency | null;
|
|
809
|
+
|
|
810
|
+
/**
|
|
811
|
+
* When an alert came in that this transaction will be disputed
|
|
812
|
+
*/
|
|
813
|
+
dispute_alerted_at: string | null;
|
|
814
|
+
|
|
815
|
+
/**
|
|
816
|
+
* The member attached to this payment.
|
|
817
|
+
*/
|
|
818
|
+
member: Payment.Member | null;
|
|
819
|
+
|
|
820
|
+
/**
|
|
821
|
+
* The membership attached to this payment.
|
|
822
|
+
*/
|
|
823
|
+
membership: Payment.Membership | null;
|
|
824
|
+
|
|
825
|
+
/**
|
|
826
|
+
* The datetime the payment was paid
|
|
827
|
+
*/
|
|
828
|
+
paid_at: string | null;
|
|
829
|
+
|
|
830
|
+
/**
|
|
831
|
+
* The different types of payment methods that can be used.
|
|
832
|
+
*/
|
|
833
|
+
payment_method_type: PaymentsAPI.PaymentMethodTypes | null;
|
|
834
|
+
|
|
835
|
+
/**
|
|
836
|
+
* The subtotal to show to the creator (excluding buyer fees).
|
|
837
|
+
*/
|
|
838
|
+
subtotal: number | null;
|
|
839
|
+
|
|
840
|
+
/**
|
|
841
|
+
* The total to show to the creator (excluding buyer fees).
|
|
842
|
+
*/
|
|
843
|
+
total: number | null;
|
|
844
|
+
|
|
845
|
+
/**
|
|
846
|
+
* The total in USD to show to the creator (excluding buyer fees).
|
|
847
|
+
*/
|
|
848
|
+
usd_total: number | null;
|
|
849
|
+
|
|
850
|
+
/**
|
|
851
|
+
* The user that made this payment.
|
|
852
|
+
*/
|
|
853
|
+
user: Payment.User | null;
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
export namespace Payment {
|
|
857
|
+
/**
|
|
858
|
+
* The member attached to this payment.
|
|
859
|
+
*/
|
|
860
|
+
export interface Member {
|
|
861
|
+
/**
|
|
862
|
+
* The ID of the member
|
|
863
|
+
*/
|
|
864
|
+
id: string;
|
|
865
|
+
|
|
866
|
+
/**
|
|
867
|
+
* The phone number for the member, if available.
|
|
868
|
+
*/
|
|
869
|
+
phone: string | null;
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
/**
|
|
873
|
+
* The membership attached to this payment.
|
|
874
|
+
*/
|
|
875
|
+
export interface Membership {
|
|
876
|
+
/**
|
|
877
|
+
* The internal ID of the membership.
|
|
878
|
+
*/
|
|
879
|
+
id: string;
|
|
880
|
+
|
|
881
|
+
/**
|
|
882
|
+
* The state of the membership.
|
|
883
|
+
*/
|
|
884
|
+
status: Shared.MembershipStatus;
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
/**
|
|
888
|
+
* The user that made this payment.
|
|
889
|
+
*/
|
|
890
|
+
export interface User {
|
|
891
|
+
/**
|
|
892
|
+
* The internal ID of the user.
|
|
893
|
+
*/
|
|
894
|
+
id: string;
|
|
895
|
+
|
|
896
|
+
/**
|
|
897
|
+
* The email of the user
|
|
898
|
+
*/
|
|
899
|
+
email: string | null;
|
|
900
|
+
|
|
901
|
+
/**
|
|
902
|
+
* The name of the user from their Whop account.
|
|
903
|
+
*/
|
|
904
|
+
name: string | null;
|
|
905
|
+
|
|
906
|
+
/**
|
|
907
|
+
* The username of the user from their Whop account.
|
|
908
|
+
*/
|
|
909
|
+
username: string;
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
}
|
|
914
|
+
|
|
457
915
|
export type UnwrapWebhookEvent =
|
|
458
916
|
| InvoiceCreatedWebhookEvent
|
|
459
917
|
| InvoicePaidWebhookEvent
|
|
@@ -470,7 +928,9 @@ export type UnwrapWebhookEvent =
|
|
|
470
928
|
| PaymentFailedWebhookEvent
|
|
471
929
|
| PaymentPendingWebhookEvent
|
|
472
930
|
| DisputeCreatedWebhookEvent
|
|
473
|
-
| DisputeUpdatedWebhookEvent
|
|
931
|
+
| DisputeUpdatedWebhookEvent
|
|
932
|
+
| RefundCreatedWebhookEvent
|
|
933
|
+
| RefundUpdatedWebhookEvent;
|
|
474
934
|
|
|
475
935
|
export declare namespace Webhooks {
|
|
476
936
|
export {
|
|
@@ -490,6 +950,8 @@ export declare namespace Webhooks {
|
|
|
490
950
|
type PaymentPendingWebhookEvent as PaymentPendingWebhookEvent,
|
|
491
951
|
type DisputeCreatedWebhookEvent as DisputeCreatedWebhookEvent,
|
|
492
952
|
type DisputeUpdatedWebhookEvent as DisputeUpdatedWebhookEvent,
|
|
953
|
+
type RefundCreatedWebhookEvent as RefundCreatedWebhookEvent,
|
|
954
|
+
type RefundUpdatedWebhookEvent as RefundUpdatedWebhookEvent,
|
|
493
955
|
type UnwrapWebhookEvent as UnwrapWebhookEvent,
|
|
494
956
|
};
|
|
495
957
|
}
|