@whop/sdk 0.0.1-canary.0 → 0.0.3
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 +44 -0
- package/client.d.mts +39 -11
- package/client.d.mts.map +1 -1
- package/client.d.ts +39 -11
- package/client.d.ts.map +1 -1
- package/client.js +23 -2
- package/client.js.map +1 -1
- package/client.mjs +23 -2
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/apps.d.mts +16 -0
- package/resources/apps.d.mts.map +1 -1
- package/resources/apps.d.ts +16 -0
- package/resources/apps.d.ts.map +1 -1
- package/resources/checkout-configurations.d.mts +96 -19
- package/resources/checkout-configurations.d.mts.map +1 -1
- package/resources/checkout-configurations.d.ts +96 -19
- package/resources/checkout-configurations.d.ts.map +1 -1
- package/resources/checkout-configurations.js +3 -1
- package/resources/checkout-configurations.js.map +1 -1
- package/resources/checkout-configurations.mjs +3 -1
- package/resources/checkout-configurations.mjs.map +1 -1
- package/resources/course-chapters.d.mts +185 -0
- package/resources/course-chapters.d.mts.map +1 -0
- package/resources/course-chapters.d.ts +185 -0
- package/resources/course-chapters.d.ts.map +1 -0
- package/resources/course-chapters.js +103 -0
- package/resources/course-chapters.js.map +1 -0
- package/resources/course-chapters.mjs +99 -0
- package/resources/course-chapters.mjs.map +1 -0
- package/resources/course-lessons.d.mts +523 -0
- package/resources/course-lessons.d.mts.map +1 -0
- package/resources/course-lessons.d.ts +523 -0
- package/resources/course-lessons.d.ts.map +1 -0
- package/resources/course-lessons.js +101 -0
- package/resources/course-lessons.js.map +1 -0
- package/resources/course-lessons.mjs +97 -0
- package/resources/course-lessons.mjs.map +1 -0
- package/resources/courses.d.mts +465 -0
- package/resources/courses.d.mts.map +1 -0
- package/resources/courses.d.ts +465 -0
- package/resources/courses.d.ts.map +1 -0
- package/resources/courses.js +98 -0
- package/resources/courses.js.map +1 -0
- package/resources/courses.mjs +94 -0
- package/resources/courses.mjs.map +1 -0
- package/resources/experiences.d.mts +59 -1
- package/resources/experiences.d.mts.map +1 -1
- package/resources/experiences.d.ts +59 -1
- package/resources/experiences.d.ts.map +1 -1
- package/resources/experiences.js +22 -0
- package/resources/experiences.js.map +1 -1
- package/resources/experiences.mjs +22 -0
- package/resources/experiences.mjs.map +1 -1
- package/resources/forum-posts.d.mts +56 -1
- package/resources/forum-posts.d.mts.map +1 -1
- package/resources/forum-posts.d.ts +56 -1
- package/resources/forum-posts.d.ts.map +1 -1
- package/resources/forum-posts.js +11 -0
- package/resources/forum-posts.js.map +1 -1
- package/resources/forum-posts.mjs +11 -0
- package/resources/forum-posts.mjs.map +1 -1
- package/resources/forums.d.mts +112 -0
- package/resources/forums.d.mts.map +1 -0
- package/resources/forums.d.ts +112 -0
- package/resources/forums.d.ts.map +1 -0
- package/resources/forums.js +41 -0
- package/resources/forums.js.map +1 -0
- package/resources/forums.mjs +37 -0
- package/resources/forums.mjs.map +1 -0
- package/resources/index.d.mts +12 -5
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +12 -5
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +15 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +7 -0
- package/resources/index.mjs.map +1 -1
- package/resources/invoices.d.mts +5 -2
- package/resources/invoices.d.mts.map +1 -1
- package/resources/invoices.d.ts +5 -2
- package/resources/invoices.d.ts.map +1 -1
- package/resources/ledger-accounts.d.mts +1 -1
- package/resources/ledger-accounts.d.mts.map +1 -1
- package/resources/ledger-accounts.d.ts +1 -1
- package/resources/ledger-accounts.d.ts.map +1 -1
- package/resources/members.d.mts +274 -0
- package/resources/members.d.mts.map +1 -0
- package/resources/members.d.ts +274 -0
- package/resources/members.d.ts.map +1 -0
- package/resources/members.js +35 -0
- package/resources/members.js.map +1 -0
- package/resources/members.mjs +31 -0
- package/resources/members.mjs.map +1 -0
- package/resources/memberships.d.mts +26 -5
- package/resources/memberships.d.mts.map +1 -1
- package/resources/memberships.d.ts +26 -5
- package/resources/memberships.d.ts.map +1 -1
- package/resources/memberships.js +1 -1
- package/resources/memberships.js.map +1 -1
- package/resources/memberships.mjs +1 -1
- package/resources/memberships.mjs.map +1 -1
- package/resources/messages.d.mts +38 -1
- package/resources/messages.d.mts.map +1 -1
- package/resources/messages.d.ts +38 -1
- package/resources/messages.d.ts.map +1 -1
- package/resources/messages.js +6 -0
- package/resources/messages.js.map +1 -1
- package/resources/messages.mjs +6 -0
- package/resources/messages.mjs.map +1 -1
- package/resources/payments.d.mts +28 -13
- package/resources/payments.d.mts.map +1 -1
- package/resources/payments.d.ts +28 -13
- package/resources/payments.d.ts.map +1 -1
- package/resources/plans.d.mts +54 -3
- package/resources/plans.d.mts.map +1 -1
- package/resources/plans.d.ts +54 -3
- package/resources/plans.d.ts.map +1 -1
- package/resources/products.d.mts +17 -25
- package/resources/products.d.mts.map +1 -1
- package/resources/products.d.ts +17 -25
- package/resources/products.d.ts.map +1 -1
- package/resources/promo-codes.d.mts +394 -0
- package/resources/promo-codes.d.mts.map +1 -0
- package/resources/promo-codes.d.ts +394 -0
- package/resources/promo-codes.d.ts.map +1 -0
- package/resources/promo-codes.js +91 -0
- package/resources/promo-codes.js.map +1 -0
- package/resources/promo-codes.mjs +87 -0
- package/resources/promo-codes.mjs.map +1 -0
- package/resources/reviews.d.mts +277 -0
- package/resources/reviews.d.mts.map +1 -0
- package/resources/reviews.d.ts +277 -0
- package/resources/reviews.d.ts.map +1 -0
- package/resources/reviews.js +23 -0
- package/resources/reviews.js.map +1 -0
- package/resources/reviews.mjs +19 -0
- package/resources/reviews.mjs.map +1 -0
- package/resources/shared.d.mts +245 -24
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +245 -24
- package/resources/shared.d.ts.map +1 -1
- package/resources/users.d.mts +18 -1
- package/resources/users.d.mts.map +1 -1
- package/resources/users.d.ts +18 -1
- package/resources/users.d.ts.map +1 -1
- package/resources/users.js.map +1 -1
- package/resources/users.mjs.map +1 -1
- package/resources/webhooks.d.mts +224 -2
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +224 -2
- package/resources/webhooks.d.ts.map +1 -1
- package/src/client.ts +197 -3
- package/src/resources/apps.ts +18 -0
- package/src/resources/checkout-configurations.ts +111 -19
- package/src/resources/course-chapters.ts +236 -0
- package/src/resources/course-lessons.ts +646 -0
- package/src/resources/courses.ts +594 -0
- package/src/resources/experiences.ts +71 -0
- package/src/resources/forum-posts.ts +71 -0
- package/src/resources/forums.ts +152 -0
- package/src/resources/index.ts +83 -0
- package/src/resources/invoices.ts +5 -2
- package/src/resources/ledger-accounts.ts +13 -1
- package/src/resources/members.ts +342 -0
- package/src/resources/memberships.ts +31 -6
- package/src/resources/messages.ts +50 -0
- package/src/resources/payments.ts +139 -19
- package/src/resources/plans.ts +65 -3
- package/src/resources/products.ts +20 -29
- package/src/resources/promo-codes.ts +490 -0
- package/src/resources/reviews.ts +348 -0
- package/src/resources/shared.ts +296 -24
- package/src/resources/users.ts +20 -1
- package/src/resources/webhooks.ts +293 -1
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.mts.map +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
package/src/resources/shared.ts
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
3
|
import * as Shared from './shared';
|
|
4
|
+
import * as PaymentsAPI from './payments';
|
|
4
5
|
import { CursorPage } from '../core/pagination';
|
|
5
6
|
|
|
7
|
+
/**
|
|
8
|
+
* The access level a given user (or company) has to an access pass or company.
|
|
9
|
+
*/
|
|
10
|
+
export type AccessLevel = 'no_access' | 'admin' | 'customer';
|
|
11
|
+
|
|
6
12
|
/**
|
|
7
13
|
* The different types an access pass can be.
|
|
8
14
|
*/
|
|
@@ -67,6 +73,12 @@ export interface App {
|
|
|
67
73
|
*/
|
|
68
74
|
experience_path: string | null;
|
|
69
75
|
|
|
76
|
+
/**
|
|
77
|
+
* The icon for the app. This icon is shown on discovery, on the product page, on
|
|
78
|
+
* checkout, and as a default icon for the experiences.
|
|
79
|
+
*/
|
|
80
|
+
icon: App.Icon | null;
|
|
81
|
+
|
|
70
82
|
/**
|
|
71
83
|
* The name of the app
|
|
72
84
|
*/
|
|
@@ -155,6 +167,18 @@ export namespace App {
|
|
|
155
167
|
username: string;
|
|
156
168
|
}
|
|
157
169
|
|
|
170
|
+
/**
|
|
171
|
+
* The icon for the app. This icon is shown on discovery, on the product page, on
|
|
172
|
+
* checkout, and as a default icon for the experiences.
|
|
173
|
+
*/
|
|
174
|
+
export interface Icon {
|
|
175
|
+
/**
|
|
176
|
+
* This is the URL you use to render optimized attachments on the client. This
|
|
177
|
+
* should be used for apps.
|
|
178
|
+
*/
|
|
179
|
+
url: string | null;
|
|
180
|
+
}
|
|
181
|
+
|
|
158
182
|
/**
|
|
159
183
|
* A permission that the app requests from the admin of a company during the oauth
|
|
160
184
|
* flow.
|
|
@@ -389,48 +413,52 @@ export namespace ChatChannel {
|
|
|
389
413
|
}
|
|
390
414
|
|
|
391
415
|
/**
|
|
392
|
-
* A checkout
|
|
416
|
+
* A checkout configuration object.
|
|
417
|
+
* Can be used to create a reusable custom configuration for a checkout, including attaching plans, affiliates and custom metadata to the checkout.
|
|
418
|
+
* This configuration can be re-used by multiple users.
|
|
419
|
+
* All successful payments and memberships resulting from a checkout will contain the passed metadata.
|
|
393
420
|
*/
|
|
394
421
|
export interface CheckoutConfiguration {
|
|
395
422
|
/**
|
|
396
|
-
* The ID of the checkout
|
|
423
|
+
* The ID of the checkout configuration
|
|
397
424
|
*/
|
|
398
425
|
id: string;
|
|
399
426
|
|
|
400
427
|
/**
|
|
401
|
-
* The affiliate code to use for the checkout
|
|
428
|
+
* The affiliate code to use for the checkout configuration
|
|
402
429
|
*/
|
|
403
|
-
affiliate_code: string;
|
|
430
|
+
affiliate_code: string | null;
|
|
404
431
|
|
|
405
432
|
/**
|
|
406
|
-
* The ID of the company to use for the checkout
|
|
433
|
+
* The ID of the company to use for the checkout configuration
|
|
407
434
|
*/
|
|
408
435
|
company_id: string;
|
|
409
436
|
|
|
410
437
|
/**
|
|
411
|
-
* The metadata to use for the checkout
|
|
438
|
+
* The metadata to use for the checkout configuration
|
|
412
439
|
*/
|
|
413
440
|
metadata: { [key: string]: unknown };
|
|
414
441
|
|
|
415
442
|
/**
|
|
416
|
-
* The plan to use for the checkout
|
|
443
|
+
* The plan to use for the checkout configuration
|
|
417
444
|
*/
|
|
418
445
|
plan: CheckoutConfiguration.Plan;
|
|
419
446
|
|
|
420
447
|
/**
|
|
421
|
-
*
|
|
448
|
+
* A URL you can send to customers to complete a checkout. It looks like
|
|
449
|
+
* `/checkout/plan_xxxx?session={id}`
|
|
422
450
|
*/
|
|
423
451
|
purchase_url: string;
|
|
424
452
|
|
|
425
453
|
/**
|
|
426
|
-
* The URL to redirect the user to after the checkout
|
|
454
|
+
* The URL to redirect the user to after the checkout configuration is created
|
|
427
455
|
*/
|
|
428
|
-
redirect_url: string;
|
|
456
|
+
redirect_url: string | null;
|
|
429
457
|
}
|
|
430
458
|
|
|
431
459
|
export namespace CheckoutConfiguration {
|
|
432
460
|
/**
|
|
433
|
-
* The plan to use for the checkout
|
|
461
|
+
* The plan to use for the checkout configuration
|
|
434
462
|
*/
|
|
435
463
|
export interface Plan {
|
|
436
464
|
/**
|
|
@@ -509,11 +537,21 @@ export interface Company {
|
|
|
509
537
|
*/
|
|
510
538
|
created_at: string;
|
|
511
539
|
|
|
540
|
+
/**
|
|
541
|
+
* The creator pitch for the company.
|
|
542
|
+
*/
|
|
543
|
+
description: string | null;
|
|
544
|
+
|
|
512
545
|
/**
|
|
513
546
|
* The different industry types a company can be in.
|
|
514
547
|
*/
|
|
515
548
|
industry_type: IndustryTypes | null;
|
|
516
549
|
|
|
550
|
+
/**
|
|
551
|
+
* The company's logo.
|
|
552
|
+
*/
|
|
553
|
+
logo: Company.Logo | null;
|
|
554
|
+
|
|
517
555
|
/**
|
|
518
556
|
* The number of members in the company.
|
|
519
557
|
*/
|
|
@@ -556,6 +594,17 @@ export interface Company {
|
|
|
556
594
|
}
|
|
557
595
|
|
|
558
596
|
export namespace Company {
|
|
597
|
+
/**
|
|
598
|
+
* The company's logo.
|
|
599
|
+
*/
|
|
600
|
+
export interface Logo {
|
|
601
|
+
/**
|
|
602
|
+
* This is the URL you use to render optimized attachments on the client. This
|
|
603
|
+
* should be used for apps.
|
|
604
|
+
*/
|
|
605
|
+
url: string | null;
|
|
606
|
+
}
|
|
607
|
+
|
|
559
608
|
/**
|
|
560
609
|
* The user who owns this company
|
|
561
610
|
*/
|
|
@@ -611,6 +660,11 @@ export interface CourseLessonInteraction {
|
|
|
611
660
|
*/
|
|
612
661
|
completed: boolean;
|
|
613
662
|
|
|
663
|
+
/**
|
|
664
|
+
* The course for this lesson interaction
|
|
665
|
+
*/
|
|
666
|
+
course: CourseLessonInteraction.Course;
|
|
667
|
+
|
|
614
668
|
/**
|
|
615
669
|
* When the interaction was created
|
|
616
670
|
*/
|
|
@@ -628,6 +682,38 @@ export interface CourseLessonInteraction {
|
|
|
628
682
|
}
|
|
629
683
|
|
|
630
684
|
export namespace CourseLessonInteraction {
|
|
685
|
+
/**
|
|
686
|
+
* The course for this lesson interaction
|
|
687
|
+
*/
|
|
688
|
+
export interface Course {
|
|
689
|
+
/**
|
|
690
|
+
* The ID of the course. Looks like cors_XXX
|
|
691
|
+
*/
|
|
692
|
+
id: string;
|
|
693
|
+
|
|
694
|
+
/**
|
|
695
|
+
* The experience that the course belongs to
|
|
696
|
+
*/
|
|
697
|
+
experience: Course.Experience;
|
|
698
|
+
|
|
699
|
+
/**
|
|
700
|
+
* The title of the course
|
|
701
|
+
*/
|
|
702
|
+
title: string | null;
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
export namespace Course {
|
|
706
|
+
/**
|
|
707
|
+
* The experience that the course belongs to
|
|
708
|
+
*/
|
|
709
|
+
export interface Experience {
|
|
710
|
+
/**
|
|
711
|
+
* The unique ID representing this experience
|
|
712
|
+
*/
|
|
713
|
+
id: string;
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
|
|
631
717
|
/**
|
|
632
718
|
* The lesson this interaction is for
|
|
633
719
|
*/
|
|
@@ -848,6 +934,11 @@ export type Direction = 'asc' | 'desc';
|
|
|
848
934
|
*/
|
|
849
935
|
export type DmsPostTypes = 'regular' | 'system' | 'automated';
|
|
850
936
|
|
|
937
|
+
/**
|
|
938
|
+
* Email notification preference option for a forum feed
|
|
939
|
+
*/
|
|
940
|
+
export type EmailNotificationPreferences = 'all_admin_posts' | 'only_weekly_summary' | 'none';
|
|
941
|
+
|
|
851
942
|
/**
|
|
852
943
|
* An object representing an entry in a waitlist.
|
|
853
944
|
*/
|
|
@@ -989,6 +1080,11 @@ export interface Experience {
|
|
|
989
1080
|
*/
|
|
990
1081
|
created_at: string;
|
|
991
1082
|
|
|
1083
|
+
/**
|
|
1084
|
+
* The logo for the experience.
|
|
1085
|
+
*/
|
|
1086
|
+
image: Experience.Image | null;
|
|
1087
|
+
|
|
992
1088
|
/**
|
|
993
1089
|
* The written name of the description.
|
|
994
1090
|
*/
|
|
@@ -1018,12 +1114,32 @@ export namespace Experience {
|
|
|
1018
1114
|
*/
|
|
1019
1115
|
id: string;
|
|
1020
1116
|
|
|
1117
|
+
/**
|
|
1118
|
+
* The icon for the app. This icon is shown on discovery, on the product page, on
|
|
1119
|
+
* checkout, and as a default icon for the experiences.
|
|
1120
|
+
*/
|
|
1121
|
+
icon: App.Icon | null;
|
|
1122
|
+
|
|
1021
1123
|
/**
|
|
1022
1124
|
* The name of the app
|
|
1023
1125
|
*/
|
|
1024
1126
|
name: string;
|
|
1025
1127
|
}
|
|
1026
1128
|
|
|
1129
|
+
export namespace App {
|
|
1130
|
+
/**
|
|
1131
|
+
* The icon for the app. This icon is shown on discovery, on the product page, on
|
|
1132
|
+
* checkout, and as a default icon for the experiences.
|
|
1133
|
+
*/
|
|
1134
|
+
export interface Icon {
|
|
1135
|
+
/**
|
|
1136
|
+
* This is the URL you use to render optimized attachments on the client. This
|
|
1137
|
+
* should be used for apps.
|
|
1138
|
+
*/
|
|
1139
|
+
url: string | null;
|
|
1140
|
+
}
|
|
1141
|
+
}
|
|
1142
|
+
|
|
1027
1143
|
/**
|
|
1028
1144
|
* The company that owns this experience.
|
|
1029
1145
|
*/
|
|
@@ -1044,6 +1160,17 @@ export namespace Experience {
|
|
|
1044
1160
|
title: string;
|
|
1045
1161
|
}
|
|
1046
1162
|
|
|
1163
|
+
/**
|
|
1164
|
+
* The logo for the experience.
|
|
1165
|
+
*/
|
|
1166
|
+
export interface Image {
|
|
1167
|
+
/**
|
|
1168
|
+
* This is the URL you use to render optimized attachments on the client. This
|
|
1169
|
+
* should be used for apps.
|
|
1170
|
+
*/
|
|
1171
|
+
url: string | null;
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1047
1174
|
/**
|
|
1048
1175
|
* An object representing a (sanitized) access pass.
|
|
1049
1176
|
*/
|
|
@@ -1065,6 +1192,53 @@ export namespace Experience {
|
|
|
1065
1192
|
}
|
|
1066
1193
|
}
|
|
1067
1194
|
|
|
1195
|
+
/**
|
|
1196
|
+
* Represents a forum feed
|
|
1197
|
+
*/
|
|
1198
|
+
export interface Forum {
|
|
1199
|
+
/**
|
|
1200
|
+
* The unique identifier for the entity
|
|
1201
|
+
*/
|
|
1202
|
+
id: string;
|
|
1203
|
+
|
|
1204
|
+
/**
|
|
1205
|
+
* The email notification preference for this forum
|
|
1206
|
+
*/
|
|
1207
|
+
email_notification_preference: EmailNotificationPreferences;
|
|
1208
|
+
|
|
1209
|
+
/**
|
|
1210
|
+
* The experience for this forum
|
|
1211
|
+
*/
|
|
1212
|
+
experience: Forum.Experience;
|
|
1213
|
+
|
|
1214
|
+
/**
|
|
1215
|
+
* Who can comment on this forum
|
|
1216
|
+
*/
|
|
1217
|
+
who_can_comment: WhoCanCommentTypes;
|
|
1218
|
+
|
|
1219
|
+
/**
|
|
1220
|
+
* Who can post on this forum
|
|
1221
|
+
*/
|
|
1222
|
+
who_can_post: WhoCanPostTypes;
|
|
1223
|
+
}
|
|
1224
|
+
|
|
1225
|
+
export namespace Forum {
|
|
1226
|
+
/**
|
|
1227
|
+
* The experience for this forum
|
|
1228
|
+
*/
|
|
1229
|
+
export interface Experience {
|
|
1230
|
+
/**
|
|
1231
|
+
* The unique ID representing this experience
|
|
1232
|
+
*/
|
|
1233
|
+
id: string;
|
|
1234
|
+
|
|
1235
|
+
/**
|
|
1236
|
+
* The written name of the description.
|
|
1237
|
+
*/
|
|
1238
|
+
name: string;
|
|
1239
|
+
}
|
|
1240
|
+
}
|
|
1241
|
+
|
|
1068
1242
|
/**
|
|
1069
1243
|
* Represents a post in forum
|
|
1070
1244
|
*/
|
|
@@ -1084,6 +1258,11 @@ export interface ForumPost {
|
|
|
1084
1258
|
*/
|
|
1085
1259
|
content: string | null;
|
|
1086
1260
|
|
|
1261
|
+
/**
|
|
1262
|
+
* The timestamp when the post was created
|
|
1263
|
+
*/
|
|
1264
|
+
created_at: string;
|
|
1265
|
+
|
|
1087
1266
|
/**
|
|
1088
1267
|
* Whether the forum post has been edited
|
|
1089
1268
|
*/
|
|
@@ -1114,6 +1293,11 @@ export interface ForumPost {
|
|
|
1114
1293
|
*/
|
|
1115
1294
|
title: string | null;
|
|
1116
1295
|
|
|
1296
|
+
/**
|
|
1297
|
+
* The timestamp when the post was last updated
|
|
1298
|
+
*/
|
|
1299
|
+
updated_at: string;
|
|
1300
|
+
|
|
1117
1301
|
/**
|
|
1118
1302
|
* The user who created this forum post
|
|
1119
1303
|
*/
|
|
@@ -1267,7 +1451,8 @@ export interface Invoice {
|
|
|
1267
1451
|
email_address: string | null;
|
|
1268
1452
|
|
|
1269
1453
|
/**
|
|
1270
|
-
*
|
|
1454
|
+
* A signed token that allows fetching the invoice data publically without being
|
|
1455
|
+
* authenticated.
|
|
1271
1456
|
*/
|
|
1272
1457
|
fetch_invoice_token: string;
|
|
1273
1458
|
|
|
@@ -1359,7 +1544,8 @@ export interface InvoiceListItem {
|
|
|
1359
1544
|
email_address: string | null;
|
|
1360
1545
|
|
|
1361
1546
|
/**
|
|
1362
|
-
*
|
|
1547
|
+
* A signed token that allows fetching the invoice data publically without being
|
|
1548
|
+
* authenticated.
|
|
1363
1549
|
*/
|
|
1364
1550
|
fetch_invoice_token: string;
|
|
1365
1551
|
|
|
@@ -1426,6 +1612,30 @@ export namespace InvoiceListItem {
|
|
|
1426
1612
|
*/
|
|
1427
1613
|
export type InvoiceStatus = 'open' | 'paid' | 'past_due' | 'void';
|
|
1428
1614
|
|
|
1615
|
+
/**
|
|
1616
|
+
* The different most recent actions a member can have.
|
|
1617
|
+
*/
|
|
1618
|
+
export type MemberMostRecentActions =
|
|
1619
|
+
| 'canceling'
|
|
1620
|
+
| 'churned'
|
|
1621
|
+
| 'finished_split_pay'
|
|
1622
|
+
| 'paused'
|
|
1623
|
+
| 'paid_subscriber'
|
|
1624
|
+
| 'paid_once'
|
|
1625
|
+
| 'expiring'
|
|
1626
|
+
| 'joined'
|
|
1627
|
+
| 'drafted'
|
|
1628
|
+
| 'left'
|
|
1629
|
+
| 'trialing'
|
|
1630
|
+
| 'pending_entry'
|
|
1631
|
+
| 'renewing'
|
|
1632
|
+
| 'past_due';
|
|
1633
|
+
|
|
1634
|
+
/**
|
|
1635
|
+
* The different statuses a Member can have.
|
|
1636
|
+
*/
|
|
1637
|
+
export type MemberStatuses = 'drafted' | 'joined' | 'left';
|
|
1638
|
+
|
|
1429
1639
|
/**
|
|
1430
1640
|
* A membership represents a purchase between a User and a Company for a specific
|
|
1431
1641
|
* Product.
|
|
@@ -1498,6 +1708,11 @@ export interface Membership {
|
|
|
1498
1708
|
*/
|
|
1499
1709
|
plan: Membership.Plan;
|
|
1500
1710
|
|
|
1711
|
+
/**
|
|
1712
|
+
* The Product this Membership grants access to.
|
|
1713
|
+
*/
|
|
1714
|
+
product: Membership.Product;
|
|
1715
|
+
|
|
1501
1716
|
/**
|
|
1502
1717
|
* The Promo Code that is currently applied to this Membership.
|
|
1503
1718
|
*/
|
|
@@ -1567,6 +1782,21 @@ export namespace Membership {
|
|
|
1567
1782
|
id: string;
|
|
1568
1783
|
}
|
|
1569
1784
|
|
|
1785
|
+
/**
|
|
1786
|
+
* The Product this Membership grants access to.
|
|
1787
|
+
*/
|
|
1788
|
+
export interface Product {
|
|
1789
|
+
/**
|
|
1790
|
+
* The internal ID of the public product.
|
|
1791
|
+
*/
|
|
1792
|
+
id: string;
|
|
1793
|
+
|
|
1794
|
+
/**
|
|
1795
|
+
* The title of the product. Use for Whop 4.0.
|
|
1796
|
+
*/
|
|
1797
|
+
title: string;
|
|
1798
|
+
}
|
|
1799
|
+
|
|
1570
1800
|
/**
|
|
1571
1801
|
* The Promo Code that is currently applied to this Membership.
|
|
1572
1802
|
*/
|
|
@@ -1810,14 +2040,14 @@ export interface Payment {
|
|
|
1810
2040
|
billing_address: Payment.BillingAddress | null;
|
|
1811
2041
|
|
|
1812
2042
|
/**
|
|
1813
|
-
* The
|
|
2043
|
+
* The reason why a specific payment was billed
|
|
1814
2044
|
*/
|
|
1815
|
-
billing_reason:
|
|
2045
|
+
billing_reason: PaymentsAPI.BillingReasons | null;
|
|
1816
2046
|
|
|
1817
2047
|
/**
|
|
1818
|
-
*
|
|
2048
|
+
* Possible card brands that a payment token can have
|
|
1819
2049
|
*/
|
|
1820
|
-
card_brand:
|
|
2050
|
+
card_brand: PaymentsAPI.CardBrands | null;
|
|
1821
2051
|
|
|
1822
2052
|
/**
|
|
1823
2053
|
* The last 4 digits of the card used to make the payment.
|
|
@@ -1870,10 +2100,9 @@ export interface Payment {
|
|
|
1870
2100
|
paid_at: string | null;
|
|
1871
2101
|
|
|
1872
2102
|
/**
|
|
1873
|
-
*
|
|
1874
|
-
* klarna, affirm, card, cashapp
|
|
2103
|
+
* The different types of payment methods that can be used.
|
|
1875
2104
|
*/
|
|
1876
|
-
payment_method_type:
|
|
2105
|
+
payment_method_type: PaymentsAPI.PaymentMethodTypes | null;
|
|
1877
2106
|
|
|
1878
2107
|
/**
|
|
1879
2108
|
* The plan attached to this payment.
|
|
@@ -1891,7 +2120,8 @@ export interface Payment {
|
|
|
1891
2120
|
promo_code: Payment.PromoCode | null;
|
|
1892
2121
|
|
|
1893
2122
|
/**
|
|
1894
|
-
*
|
|
2123
|
+
* True only for payments that are `paid`, have not been fully refunded, and were
|
|
2124
|
+
* processed by a payment processor that allows refunds.
|
|
1895
2125
|
*/
|
|
1896
2126
|
refundable: boolean;
|
|
1897
2127
|
|
|
@@ -1906,7 +2136,9 @@ export interface Payment {
|
|
|
1906
2136
|
refunded_at: string | null;
|
|
1907
2137
|
|
|
1908
2138
|
/**
|
|
1909
|
-
*
|
|
2139
|
+
* True when the payment status is `open` and its membership is in one of the
|
|
2140
|
+
* retry-eligible states (`active`, `trialing`, `completed`, or `past_due`);
|
|
2141
|
+
* otherwise false. Used to decide if Whop can attempt the charge again.
|
|
1910
2142
|
*/
|
|
1911
2143
|
retryable: boolean;
|
|
1912
2144
|
|
|
@@ -1941,7 +2173,8 @@ export interface Payment {
|
|
|
1941
2173
|
user: Payment.User | null;
|
|
1942
2174
|
|
|
1943
2175
|
/**
|
|
1944
|
-
*
|
|
2176
|
+
* True when the payment is tied to a membership in `past_due`, the payment status
|
|
2177
|
+
* is `open`, and the processor allows voiding payments; otherwise false.
|
|
1945
2178
|
*/
|
|
1946
2179
|
voidable: boolean;
|
|
1947
2180
|
}
|
|
@@ -2092,7 +2325,7 @@ export namespace Payment {
|
|
|
2092
2325
|
code: string | null;
|
|
2093
2326
|
|
|
2094
2327
|
/**
|
|
2095
|
-
* The number of
|
|
2328
|
+
* The number of months the promo is applied for.
|
|
2096
2329
|
*/
|
|
2097
2330
|
number_of_intervals: number | null;
|
|
2098
2331
|
|
|
@@ -2222,16 +2455,31 @@ export interface Plan {
|
|
|
2222
2455
|
*/
|
|
2223
2456
|
renewal_price: number;
|
|
2224
2457
|
|
|
2458
|
+
/**
|
|
2459
|
+
* The number of units available for purchase. Only displayed to authorized actors
|
|
2460
|
+
*/
|
|
2461
|
+
stock: number | null;
|
|
2462
|
+
|
|
2225
2463
|
/**
|
|
2226
2464
|
* The tax type for the plan.
|
|
2227
2465
|
*/
|
|
2228
2466
|
tax_type: TaxType;
|
|
2229
2467
|
|
|
2468
|
+
/**
|
|
2469
|
+
* The title of the plan. This will be visible on the product page to customers.
|
|
2470
|
+
*/
|
|
2471
|
+
title: string | null;
|
|
2472
|
+
|
|
2230
2473
|
/**
|
|
2231
2474
|
* The number of free trial days added before a renewal plan.
|
|
2232
2475
|
*/
|
|
2233
2476
|
trial_period_days: number | null;
|
|
2234
2477
|
|
|
2478
|
+
/**
|
|
2479
|
+
* Limits/doesn't limit the number of units available for purchase.
|
|
2480
|
+
*/
|
|
2481
|
+
unlimited_stock: boolean;
|
|
2482
|
+
|
|
2235
2483
|
/**
|
|
2236
2484
|
* When the plan was last updated.
|
|
2237
2485
|
*/
|
|
@@ -2369,6 +2617,13 @@ export interface Product {
|
|
|
2369
2617
|
*/
|
|
2370
2618
|
description: string | null;
|
|
2371
2619
|
|
|
2620
|
+
/**
|
|
2621
|
+
* A unique identifier used to create or update products. When provided on product
|
|
2622
|
+
* creation endpoints, we’ll look up an existing product by this identifier — if it
|
|
2623
|
+
* exists, we’ll update it; if not, we’ll create a new one.
|
|
2624
|
+
*/
|
|
2625
|
+
external_identifier: string | null;
|
|
2626
|
+
|
|
2372
2627
|
/**
|
|
2373
2628
|
* The percentage of a transaction a user is eligible to earn from the whop
|
|
2374
2629
|
* marketplace global affiliate program.
|
|
@@ -2528,6 +2783,13 @@ export interface ProductListItem {
|
|
|
2528
2783
|
*/
|
|
2529
2784
|
created_at: string;
|
|
2530
2785
|
|
|
2786
|
+
/**
|
|
2787
|
+
* A unique identifier used to create or update products. When provided on product
|
|
2788
|
+
* creation endpoints, we’ll look up an existing product by this identifier — if it
|
|
2789
|
+
* exists, we’ll update it; if not, we’ll create a new one.
|
|
2790
|
+
*/
|
|
2791
|
+
external_identifier: string | null;
|
|
2792
|
+
|
|
2531
2793
|
/**
|
|
2532
2794
|
* The headline of the product.
|
|
2533
2795
|
*/
|
|
@@ -3069,11 +3331,21 @@ export type VisibilityFilter =
|
|
|
3069
3331
|
| 'not_quick_link'
|
|
3070
3332
|
| 'not_archived';
|
|
3071
3333
|
|
|
3334
|
+
/**
|
|
3335
|
+
* Who can comment on a forum feed
|
|
3336
|
+
*/
|
|
3337
|
+
export type WhoCanCommentTypes = 'everyone' | 'admins';
|
|
3338
|
+
|
|
3072
3339
|
/**
|
|
3073
3340
|
* Who can post on a chat feed
|
|
3074
3341
|
*/
|
|
3075
3342
|
export type WhoCanPost = 'everyone' | 'admins';
|
|
3076
3343
|
|
|
3344
|
+
/**
|
|
3345
|
+
* Who can post on a forum feed
|
|
3346
|
+
*/
|
|
3347
|
+
export type WhoCanPostTypes = 'everyone' | 'admins';
|
|
3348
|
+
|
|
3077
3349
|
/**
|
|
3078
3350
|
* Who can react on a chat feed
|
|
3079
3351
|
*/
|
package/src/resources/users.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../core/resource';
|
|
4
|
+
import * as Shared from './shared';
|
|
4
5
|
import { APIPromise } from '../core/api-promise';
|
|
5
6
|
import { RequestOptions } from '../internal/request-options';
|
|
6
7
|
import { path } from '../internal/utils/path';
|
|
@@ -50,12 +51,30 @@ export interface UserRetrieveResponse {
|
|
|
50
51
|
*/
|
|
51
52
|
name: string | null;
|
|
52
53
|
|
|
54
|
+
/**
|
|
55
|
+
* The user's profile picture
|
|
56
|
+
*/
|
|
57
|
+
profile_picture: UserRetrieveResponse.ProfilePicture | null;
|
|
58
|
+
|
|
53
59
|
/**
|
|
54
60
|
* The username of the user from their Whop account.
|
|
55
61
|
*/
|
|
56
62
|
username: string;
|
|
57
63
|
}
|
|
58
64
|
|
|
65
|
+
export namespace UserRetrieveResponse {
|
|
66
|
+
/**
|
|
67
|
+
* The user's profile picture
|
|
68
|
+
*/
|
|
69
|
+
export interface ProfilePicture {
|
|
70
|
+
/**
|
|
71
|
+
* This is the URL you use to render optimized attachments on the client. This
|
|
72
|
+
* should be used for apps.
|
|
73
|
+
*/
|
|
74
|
+
url: string | null;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
59
78
|
/**
|
|
60
79
|
* The result of a has access check for the developer API
|
|
61
80
|
*/
|
|
@@ -63,7 +82,7 @@ export interface UserCheckAccessResponse {
|
|
|
63
82
|
/**
|
|
64
83
|
* The permission level of the user
|
|
65
84
|
*/
|
|
66
|
-
access_level:
|
|
85
|
+
access_level: Shared.AccessLevel;
|
|
67
86
|
|
|
68
87
|
/**
|
|
69
88
|
* Whether the user has access to the resource
|