@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
|
@@ -18,6 +18,7 @@ export class CheckoutConfigurations extends APIResource {
|
|
|
18
18
|
* - `plan:create`
|
|
19
19
|
* - `access_pass:create`
|
|
20
20
|
* - `access_pass:update`
|
|
21
|
+
* - `checkout_configuration:basic:read`
|
|
21
22
|
*
|
|
22
23
|
* @example
|
|
23
24
|
* ```ts
|
|
@@ -66,6 +67,11 @@ export class CheckoutConfigurations extends APIResource {
|
|
|
66
67
|
|
|
67
68
|
export type CheckoutConfigurationListResponsesCursorPage = CursorPage<CheckoutConfigurationListResponse>;
|
|
68
69
|
|
|
70
|
+
/**
|
|
71
|
+
* The different modes a checkout can be set to.
|
|
72
|
+
*/
|
|
73
|
+
export type CheckoutModes = 'payment' | 'setup';
|
|
74
|
+
|
|
69
75
|
/**
|
|
70
76
|
* A checkout configuration object.
|
|
71
77
|
* Can be used to create a reusable custom configuration for a checkout, including attaching plans, affiliates and custom metadata to the checkout.
|
|
@@ -91,12 +97,24 @@ export interface CheckoutConfigurationListResponse {
|
|
|
91
97
|
/**
|
|
92
98
|
* The metadata to use for the checkout configuration
|
|
93
99
|
*/
|
|
94
|
-
metadata: { [key: string]: unknown };
|
|
100
|
+
metadata: { [key: string]: unknown } | null;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* The mode of the checkout session.
|
|
104
|
+
*/
|
|
105
|
+
mode: CheckoutModes;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* The explicit payment method configuration for the session, if any. This
|
|
109
|
+
* currently only works in 'setup' mode. Use the plan's
|
|
110
|
+
* payment_method_configuration for payment method.
|
|
111
|
+
*/
|
|
112
|
+
payment_method_configuration: CheckoutConfigurationListResponse.PaymentMethodConfiguration | null;
|
|
95
113
|
|
|
96
114
|
/**
|
|
97
115
|
* The plan to use for the checkout configuration
|
|
98
116
|
*/
|
|
99
|
-
plan: CheckoutConfigurationListResponse.Plan;
|
|
117
|
+
plan: CheckoutConfigurationListResponse.Plan | null;
|
|
100
118
|
|
|
101
119
|
/**
|
|
102
120
|
* A URL you can send to customers to complete a checkout. It looks like
|
|
@@ -111,6 +129,34 @@ export interface CheckoutConfigurationListResponse {
|
|
|
111
129
|
}
|
|
112
130
|
|
|
113
131
|
export namespace CheckoutConfigurationListResponse {
|
|
132
|
+
/**
|
|
133
|
+
* The explicit payment method configuration for the session, if any. This
|
|
134
|
+
* currently only works in 'setup' mode. Use the plan's
|
|
135
|
+
* payment_method_configuration for payment method.
|
|
136
|
+
*/
|
|
137
|
+
export interface PaymentMethodConfiguration {
|
|
138
|
+
/**
|
|
139
|
+
* An array of payment method identifiers that are explicitly disabled. Only
|
|
140
|
+
* applies if the include_platform_defaults is true.
|
|
141
|
+
*/
|
|
142
|
+
disabled: Array<PaymentsAPI.PaymentMethodTypes>;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* An array of payment method identifiers that are explicitly enabled. This means
|
|
146
|
+
* these payment methods will be shown on checkout. Example use case is to only
|
|
147
|
+
* enable a specific payment method like cashapp, or extending the platform
|
|
148
|
+
* defaults with additional methods.
|
|
149
|
+
*/
|
|
150
|
+
enabled: Array<PaymentsAPI.PaymentMethodTypes>;
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Whether Whop's platform default payment method enablement settings are included
|
|
154
|
+
* in this configuration. The full list of default payment methods can be found in
|
|
155
|
+
* the documentation at docs.whop.com/payments.
|
|
156
|
+
*/
|
|
157
|
+
include_platform_defaults: boolean;
|
|
158
|
+
}
|
|
159
|
+
|
|
114
160
|
/**
|
|
115
161
|
* The plan to use for the checkout configuration
|
|
116
162
|
*/
|
|
@@ -168,15 +214,16 @@ export namespace CheckoutConfigurationListResponse {
|
|
|
168
214
|
}
|
|
169
215
|
|
|
170
216
|
export type CheckoutConfigurationCreateParams =
|
|
171
|
-
| CheckoutConfigurationCreateParams.
|
|
172
|
-
| CheckoutConfigurationCreateParams.
|
|
217
|
+
| CheckoutConfigurationCreateParams.CreateCheckoutSessionInputModePaymentWithPlan
|
|
218
|
+
| CheckoutConfigurationCreateParams.CreateCheckoutSessionInputModePaymentWithPlanID
|
|
219
|
+
| CheckoutConfigurationCreateParams.CreateCheckoutSessionInputModeSetup;
|
|
173
220
|
|
|
174
221
|
export declare namespace CheckoutConfigurationCreateParams {
|
|
175
|
-
export interface
|
|
222
|
+
export interface CreateCheckoutSessionInputModePaymentWithPlan {
|
|
176
223
|
/**
|
|
177
224
|
* Pass this object to create a new plan for this checkout configuration
|
|
178
225
|
*/
|
|
179
|
-
plan:
|
|
226
|
+
plan: CreateCheckoutSessionInputModePaymentWithPlan.Plan;
|
|
180
227
|
|
|
181
228
|
/**
|
|
182
229
|
* The affiliate code to use for the checkout configuration
|
|
@@ -188,13 +235,22 @@ export declare namespace CheckoutConfigurationCreateParams {
|
|
|
188
235
|
*/
|
|
189
236
|
metadata?: { [key: string]: unknown } | null;
|
|
190
237
|
|
|
238
|
+
mode?: 'payment';
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* This currently only works for configurations made in 'setup' mode. The explicit
|
|
242
|
+
* payment method configuration for the checkout session. If not provided, the
|
|
243
|
+
* platform or company's defaults will apply.
|
|
244
|
+
*/
|
|
245
|
+
payment_method_configuration?: CreateCheckoutSessionInputModePaymentWithPlan.PaymentMethodConfiguration | null;
|
|
246
|
+
|
|
191
247
|
/**
|
|
192
248
|
* The URL to redirect the user to after the checkout configuration is created
|
|
193
249
|
*/
|
|
194
250
|
redirect_url?: string | null;
|
|
195
251
|
}
|
|
196
252
|
|
|
197
|
-
export namespace
|
|
253
|
+
export namespace CreateCheckoutSessionInputModePaymentWithPlan {
|
|
198
254
|
/**
|
|
199
255
|
* Pass this object to create a new plan for this checkout configuration
|
|
200
256
|
*/
|
|
@@ -468,9 +524,37 @@ export declare namespace CheckoutConfigurationCreateParams {
|
|
|
468
524
|
visibility?: Shared.Visibility | null;
|
|
469
525
|
}
|
|
470
526
|
}
|
|
527
|
+
|
|
528
|
+
/**
|
|
529
|
+
* This currently only works for configurations made in 'setup' mode. The explicit
|
|
530
|
+
* payment method configuration for the checkout session. If not provided, the
|
|
531
|
+
* platform or company's defaults will apply.
|
|
532
|
+
*/
|
|
533
|
+
export interface PaymentMethodConfiguration {
|
|
534
|
+
/**
|
|
535
|
+
* An array of payment method identifiers that are explicitly disabled. Only
|
|
536
|
+
* applies if the include_platform_defaults is true.
|
|
537
|
+
*/
|
|
538
|
+
disabled: Array<PaymentsAPI.PaymentMethodTypes>;
|
|
539
|
+
|
|
540
|
+
/**
|
|
541
|
+
* An array of payment method identifiers that are explicitly enabled. This means
|
|
542
|
+
* these payment methods will be shown on checkout. Example use case is to only
|
|
543
|
+
* enable a specific payment method like cashapp, or extending the platform
|
|
544
|
+
* defaults with additional methods.
|
|
545
|
+
*/
|
|
546
|
+
enabled: Array<PaymentsAPI.PaymentMethodTypes>;
|
|
547
|
+
|
|
548
|
+
/**
|
|
549
|
+
* Whether Whop's platform default payment method enablement settings are included
|
|
550
|
+
* in this configuration. The full list of default payment methods can be found in
|
|
551
|
+
* the documentation at docs.whop.com/payments.
|
|
552
|
+
*/
|
|
553
|
+
include_platform_defaults: boolean;
|
|
554
|
+
}
|
|
471
555
|
}
|
|
472
556
|
|
|
473
|
-
export interface
|
|
557
|
+
export interface CreateCheckoutSessionInputModePaymentWithPlanID {
|
|
474
558
|
/**
|
|
475
559
|
* The ID of the plan to use for the checkout configuration
|
|
476
560
|
*/
|
|
@@ -486,11 +570,107 @@ export declare namespace CheckoutConfigurationCreateParams {
|
|
|
486
570
|
*/
|
|
487
571
|
metadata?: { [key: string]: unknown } | null;
|
|
488
572
|
|
|
573
|
+
mode?: 'payment';
|
|
574
|
+
|
|
575
|
+
/**
|
|
576
|
+
* This currently only works for configurations made in 'setup' mode. The explicit
|
|
577
|
+
* payment method configuration for the checkout session. If not provided, the
|
|
578
|
+
* platform or company's defaults will apply.
|
|
579
|
+
*/
|
|
580
|
+
payment_method_configuration?: CreateCheckoutSessionInputModePaymentWithPlanID.PaymentMethodConfiguration | null;
|
|
581
|
+
|
|
582
|
+
/**
|
|
583
|
+
* The URL to redirect the user to after the checkout configuration is created
|
|
584
|
+
*/
|
|
585
|
+
redirect_url?: string | null;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
export namespace CreateCheckoutSessionInputModePaymentWithPlanID {
|
|
589
|
+
/**
|
|
590
|
+
* This currently only works for configurations made in 'setup' mode. The explicit
|
|
591
|
+
* payment method configuration for the checkout session. If not provided, the
|
|
592
|
+
* platform or company's defaults will apply.
|
|
593
|
+
*/
|
|
594
|
+
export interface PaymentMethodConfiguration {
|
|
595
|
+
/**
|
|
596
|
+
* An array of payment method identifiers that are explicitly disabled. Only
|
|
597
|
+
* applies if the include_platform_defaults is true.
|
|
598
|
+
*/
|
|
599
|
+
disabled: Array<PaymentsAPI.PaymentMethodTypes>;
|
|
600
|
+
|
|
601
|
+
/**
|
|
602
|
+
* An array of payment method identifiers that are explicitly enabled. This means
|
|
603
|
+
* these payment methods will be shown on checkout. Example use case is to only
|
|
604
|
+
* enable a specific payment method like cashapp, or extending the platform
|
|
605
|
+
* defaults with additional methods.
|
|
606
|
+
*/
|
|
607
|
+
enabled: Array<PaymentsAPI.PaymentMethodTypes>;
|
|
608
|
+
|
|
609
|
+
/**
|
|
610
|
+
* Whether Whop's platform default payment method enablement settings are included
|
|
611
|
+
* in this configuration. The full list of default payment methods can be found in
|
|
612
|
+
* the documentation at docs.whop.com/payments.
|
|
613
|
+
*/
|
|
614
|
+
include_platform_defaults: boolean;
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
export interface CreateCheckoutSessionInputModeSetup {
|
|
619
|
+
/**
|
|
620
|
+
* The ID of the company for which to generate the checkout configuration. Only
|
|
621
|
+
* required in setup mode.
|
|
622
|
+
*/
|
|
623
|
+
company_id: string;
|
|
624
|
+
|
|
625
|
+
mode: 'setup';
|
|
626
|
+
|
|
627
|
+
/**
|
|
628
|
+
* The metadata to use for the checkout configuration
|
|
629
|
+
*/
|
|
630
|
+
metadata?: { [key: string]: unknown } | null;
|
|
631
|
+
|
|
632
|
+
/**
|
|
633
|
+
* This currently only works for configurations made in 'setup' mode. The explicit
|
|
634
|
+
* payment method configuration for the checkout session. If not provided, the
|
|
635
|
+
* platform or company's defaults will apply.
|
|
636
|
+
*/
|
|
637
|
+
payment_method_configuration?: CreateCheckoutSessionInputModeSetup.PaymentMethodConfiguration | null;
|
|
638
|
+
|
|
489
639
|
/**
|
|
490
640
|
* The URL to redirect the user to after the checkout configuration is created
|
|
491
641
|
*/
|
|
492
642
|
redirect_url?: string | null;
|
|
493
643
|
}
|
|
644
|
+
|
|
645
|
+
export namespace CreateCheckoutSessionInputModeSetup {
|
|
646
|
+
/**
|
|
647
|
+
* This currently only works for configurations made in 'setup' mode. The explicit
|
|
648
|
+
* payment method configuration for the checkout session. If not provided, the
|
|
649
|
+
* platform or company's defaults will apply.
|
|
650
|
+
*/
|
|
651
|
+
export interface PaymentMethodConfiguration {
|
|
652
|
+
/**
|
|
653
|
+
* An array of payment method identifiers that are explicitly disabled. Only
|
|
654
|
+
* applies if the include_platform_defaults is true.
|
|
655
|
+
*/
|
|
656
|
+
disabled: Array<PaymentsAPI.PaymentMethodTypes>;
|
|
657
|
+
|
|
658
|
+
/**
|
|
659
|
+
* An array of payment method identifiers that are explicitly enabled. This means
|
|
660
|
+
* these payment methods will be shown on checkout. Example use case is to only
|
|
661
|
+
* enable a specific payment method like cashapp, or extending the platform
|
|
662
|
+
* defaults with additional methods.
|
|
663
|
+
*/
|
|
664
|
+
enabled: Array<PaymentsAPI.PaymentMethodTypes>;
|
|
665
|
+
|
|
666
|
+
/**
|
|
667
|
+
* Whether Whop's platform default payment method enablement settings are included
|
|
668
|
+
* in this configuration. The full list of default payment methods can be found in
|
|
669
|
+
* the documentation at docs.whop.com/payments.
|
|
670
|
+
*/
|
|
671
|
+
include_platform_defaults: boolean;
|
|
672
|
+
}
|
|
673
|
+
}
|
|
494
674
|
}
|
|
495
675
|
|
|
496
676
|
export interface CheckoutConfigurationListParams extends CursorPageParams {
|
|
@@ -527,6 +707,7 @@ export interface CheckoutConfigurationListParams extends CursorPageParams {
|
|
|
527
707
|
|
|
528
708
|
export declare namespace CheckoutConfigurations {
|
|
529
709
|
export {
|
|
710
|
+
type CheckoutModes as CheckoutModes,
|
|
530
711
|
type CheckoutConfigurationListResponse as CheckoutConfigurationListResponse,
|
|
531
712
|
type CheckoutConfigurationListResponsesCursorPage as CheckoutConfigurationListResponsesCursorPage,
|
|
532
713
|
type CheckoutConfigurationCreateParams as CheckoutConfigurationCreateParams,
|
|
@@ -109,6 +109,56 @@ export class CourseLessons extends APIResource {
|
|
|
109
109
|
delete(id: string, options?: RequestOptions): APIPromise<CourseLessonDeleteResponse> {
|
|
110
110
|
return this._client.delete(path`/course_lessons/${id}`, options);
|
|
111
111
|
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Marks a course lesson as completed
|
|
115
|
+
*
|
|
116
|
+
* @example
|
|
117
|
+
* ```ts
|
|
118
|
+
* const response = await client.courseLessons.markAsCompleted(
|
|
119
|
+
* 'lesson_id',
|
|
120
|
+
* );
|
|
121
|
+
* ```
|
|
122
|
+
*/
|
|
123
|
+
markAsCompleted(
|
|
124
|
+
lessonID: string,
|
|
125
|
+
options?: RequestOptions,
|
|
126
|
+
): APIPromise<CourseLessonMarkAsCompletedResponse> {
|
|
127
|
+
return this._client.post(path`/course_lessons/${lessonID}/mark_as_completed`, options);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Starts a course lesson
|
|
132
|
+
*
|
|
133
|
+
* @example
|
|
134
|
+
* ```ts
|
|
135
|
+
* const response = await client.courseLessons.start(
|
|
136
|
+
* 'lesson_id',
|
|
137
|
+
* );
|
|
138
|
+
* ```
|
|
139
|
+
*/
|
|
140
|
+
start(lessonID: string, options?: RequestOptions): APIPromise<CourseLessonStartResponse> {
|
|
141
|
+
return this._client.post(path`/course_lessons/${lessonID}/start`, options);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Submits answers for a course assessment
|
|
146
|
+
*
|
|
147
|
+
* @example
|
|
148
|
+
* ```ts
|
|
149
|
+
* const response =
|
|
150
|
+
* await client.courseLessons.submitAssessment('lesson_id', {
|
|
151
|
+
* answers: [{ question_id: 'question_id' }],
|
|
152
|
+
* });
|
|
153
|
+
* ```
|
|
154
|
+
*/
|
|
155
|
+
submitAssessment(
|
|
156
|
+
lessonID: string,
|
|
157
|
+
body: CourseLessonSubmitAssessmentParams,
|
|
158
|
+
options?: RequestOptions,
|
|
159
|
+
): APIPromise<CourseLessonSubmitAssessmentResponse> {
|
|
160
|
+
return this._client.post(path`/course_lessons/${lessonID}/submit_assessment`, { body, ...options });
|
|
161
|
+
}
|
|
112
162
|
}
|
|
113
163
|
|
|
114
164
|
export type CourseLessonListResponsesCursorPage = CursorPage<CourseLessonListResponse>;
|
|
@@ -147,6 +197,11 @@ export interface Lesson {
|
|
|
147
197
|
*/
|
|
148
198
|
content: string | null;
|
|
149
199
|
|
|
200
|
+
/**
|
|
201
|
+
* The timestamp of when the lesson was created
|
|
202
|
+
*/
|
|
203
|
+
created_at: string;
|
|
204
|
+
|
|
150
205
|
/**
|
|
151
206
|
* Number of days from course start until the lesson is unlocked
|
|
152
207
|
*/
|
|
@@ -377,10 +432,60 @@ export namespace Lesson {
|
|
|
377
432
|
*/
|
|
378
433
|
asset_id: string | null;
|
|
379
434
|
|
|
435
|
+
/**
|
|
436
|
+
* Whether this asset contains only audio
|
|
437
|
+
*/
|
|
438
|
+
audio_only: boolean;
|
|
439
|
+
|
|
440
|
+
/**
|
|
441
|
+
* The time at which the Mux asset was created
|
|
442
|
+
*/
|
|
443
|
+
created_at: string;
|
|
444
|
+
|
|
445
|
+
/**
|
|
446
|
+
* The duration of the video in seconds
|
|
447
|
+
*/
|
|
448
|
+
duration_seconds: number | null;
|
|
449
|
+
|
|
450
|
+
/**
|
|
451
|
+
* The time at which the video finished uploading
|
|
452
|
+
*/
|
|
453
|
+
finished_uploading_at: string | null;
|
|
454
|
+
|
|
380
455
|
/**
|
|
381
456
|
* The public playback ID of the Mux asset
|
|
382
457
|
*/
|
|
383
458
|
playback_id: string | null;
|
|
459
|
+
|
|
460
|
+
/**
|
|
461
|
+
* The signed playback ID of the Mux asset
|
|
462
|
+
*/
|
|
463
|
+
signed_playback_id: string | null;
|
|
464
|
+
|
|
465
|
+
/**
|
|
466
|
+
* The signed storyboard playback token of the Mux asset
|
|
467
|
+
*/
|
|
468
|
+
signed_storyboard_playback_token: string | null;
|
|
469
|
+
|
|
470
|
+
/**
|
|
471
|
+
* The signed thumbnail playback token of the Mux asset
|
|
472
|
+
*/
|
|
473
|
+
signed_thumbnail_playback_token: string | null;
|
|
474
|
+
|
|
475
|
+
/**
|
|
476
|
+
* The signed video playback token of the Mux asset
|
|
477
|
+
*/
|
|
478
|
+
signed_video_playback_token: string | null;
|
|
479
|
+
|
|
480
|
+
/**
|
|
481
|
+
* The status of the Mux asset
|
|
482
|
+
*/
|
|
483
|
+
status: 'uploading' | 'created' | 'ready';
|
|
484
|
+
|
|
485
|
+
/**
|
|
486
|
+
* The time at which the Mux asset was last updated
|
|
487
|
+
*/
|
|
488
|
+
updated_at: string;
|
|
384
489
|
}
|
|
385
490
|
}
|
|
386
491
|
|
|
@@ -409,6 +514,11 @@ export interface CourseLessonListResponse {
|
|
|
409
514
|
*/
|
|
410
515
|
content: string | null;
|
|
411
516
|
|
|
517
|
+
/**
|
|
518
|
+
* The timestamp of when the lesson was created
|
|
519
|
+
*/
|
|
520
|
+
created_at: string;
|
|
521
|
+
|
|
412
522
|
/**
|
|
413
523
|
* Number of days from course start until the lesson is unlocked
|
|
414
524
|
*/
|
|
@@ -469,6 +579,113 @@ export namespace CourseLessonListResponse {
|
|
|
469
579
|
*/
|
|
470
580
|
export type CourseLessonDeleteResponse = boolean;
|
|
471
581
|
|
|
582
|
+
/**
|
|
583
|
+
* Represents `true` or `false` values.
|
|
584
|
+
*/
|
|
585
|
+
export type CourseLessonMarkAsCompletedResponse = boolean;
|
|
586
|
+
|
|
587
|
+
/**
|
|
588
|
+
* Represents `true` or `false` values.
|
|
589
|
+
*/
|
|
590
|
+
export type CourseLessonStartResponse = boolean;
|
|
591
|
+
|
|
592
|
+
/**
|
|
593
|
+
* The result of a user's assessment attempt
|
|
594
|
+
*/
|
|
595
|
+
export interface CourseLessonSubmitAssessmentResponse {
|
|
596
|
+
/**
|
|
597
|
+
* The ID of the assessment result
|
|
598
|
+
*/
|
|
599
|
+
id: string;
|
|
600
|
+
|
|
601
|
+
/**
|
|
602
|
+
* When the assessment was taken
|
|
603
|
+
*/
|
|
604
|
+
created_at: string;
|
|
605
|
+
|
|
606
|
+
/**
|
|
607
|
+
* The lesson this assessment result is for
|
|
608
|
+
*/
|
|
609
|
+
lesson: CourseLessonSubmitAssessmentResponse.Lesson;
|
|
610
|
+
|
|
611
|
+
/**
|
|
612
|
+
* The number of correct answers
|
|
613
|
+
*/
|
|
614
|
+
result_correct: number;
|
|
615
|
+
|
|
616
|
+
/**
|
|
617
|
+
* The grade achieved on the assessment
|
|
618
|
+
*/
|
|
619
|
+
result_grade: number;
|
|
620
|
+
|
|
621
|
+
/**
|
|
622
|
+
* Array of graded questions with details
|
|
623
|
+
*/
|
|
624
|
+
result_graded_questions: { [key: string]: unknown };
|
|
625
|
+
|
|
626
|
+
/**
|
|
627
|
+
* Whether the user achieved a passing grade
|
|
628
|
+
*/
|
|
629
|
+
result_passing_grade: boolean;
|
|
630
|
+
|
|
631
|
+
/**
|
|
632
|
+
* The total number of questions in the assessment
|
|
633
|
+
*/
|
|
634
|
+
result_question_count: number;
|
|
635
|
+
|
|
636
|
+
/**
|
|
637
|
+
* The percentage score achieved on the assessment
|
|
638
|
+
*/
|
|
639
|
+
score_percent: number;
|
|
640
|
+
|
|
641
|
+
/**
|
|
642
|
+
* When the assessment result was last updated
|
|
643
|
+
*/
|
|
644
|
+
updated_at: string;
|
|
645
|
+
|
|
646
|
+
/**
|
|
647
|
+
* The user who took the assessment
|
|
648
|
+
*/
|
|
649
|
+
user: CourseLessonSubmitAssessmentResponse.User;
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
export namespace CourseLessonSubmitAssessmentResponse {
|
|
653
|
+
/**
|
|
654
|
+
* The lesson this assessment result is for
|
|
655
|
+
*/
|
|
656
|
+
export interface Lesson {
|
|
657
|
+
/**
|
|
658
|
+
* The ID of the lesson
|
|
659
|
+
*/
|
|
660
|
+
id: string;
|
|
661
|
+
|
|
662
|
+
/**
|
|
663
|
+
* The title of the lesson
|
|
664
|
+
*/
|
|
665
|
+
title: string;
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
/**
|
|
669
|
+
* The user who took the assessment
|
|
670
|
+
*/
|
|
671
|
+
export interface User {
|
|
672
|
+
/**
|
|
673
|
+
* The internal ID of the user.
|
|
674
|
+
*/
|
|
675
|
+
id: string;
|
|
676
|
+
|
|
677
|
+
/**
|
|
678
|
+
* The name of the user from their Whop account.
|
|
679
|
+
*/
|
|
680
|
+
name: string | null;
|
|
681
|
+
|
|
682
|
+
/**
|
|
683
|
+
* The username of the user from their Whop account.
|
|
684
|
+
*/
|
|
685
|
+
username: string;
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
|
|
472
689
|
export interface CourseLessonCreateParams {
|
|
473
690
|
/**
|
|
474
691
|
* The ID of the chapter to create the lesson in
|
|
@@ -828,6 +1045,35 @@ export interface CourseLessonListParams extends CursorPageParams {
|
|
|
828
1045
|
last?: number | null;
|
|
829
1046
|
}
|
|
830
1047
|
|
|
1048
|
+
export interface CourseLessonSubmitAssessmentParams {
|
|
1049
|
+
/**
|
|
1050
|
+
* The answers to the assessment questions
|
|
1051
|
+
*/
|
|
1052
|
+
answers: Array<CourseLessonSubmitAssessmentParams.Answer>;
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
export namespace CourseLessonSubmitAssessmentParams {
|
|
1056
|
+
/**
|
|
1057
|
+
* Input for a single question's answer in an assessment submission
|
|
1058
|
+
*/
|
|
1059
|
+
export interface Answer {
|
|
1060
|
+
/**
|
|
1061
|
+
* The ID of the question being answered
|
|
1062
|
+
*/
|
|
1063
|
+
question_id: string;
|
|
1064
|
+
|
|
1065
|
+
/**
|
|
1066
|
+
* The text answer provided by the user (for short answer questions)
|
|
1067
|
+
*/
|
|
1068
|
+
answer_text?: string | null;
|
|
1069
|
+
|
|
1070
|
+
/**
|
|
1071
|
+
* The IDs of the selected options (for multiple choice/select questions)
|
|
1072
|
+
*/
|
|
1073
|
+
selected_option_ids?: Array<string> | null;
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1076
|
+
|
|
831
1077
|
export declare namespace CourseLessons {
|
|
832
1078
|
export {
|
|
833
1079
|
type AssessmentQuestionTypes as AssessmentQuestionTypes,
|
|
@@ -837,9 +1083,13 @@ export declare namespace CourseLessons {
|
|
|
837
1083
|
type LessonVisibilities as LessonVisibilities,
|
|
838
1084
|
type CourseLessonListResponse as CourseLessonListResponse,
|
|
839
1085
|
type CourseLessonDeleteResponse as CourseLessonDeleteResponse,
|
|
1086
|
+
type CourseLessonMarkAsCompletedResponse as CourseLessonMarkAsCompletedResponse,
|
|
1087
|
+
type CourseLessonStartResponse as CourseLessonStartResponse,
|
|
1088
|
+
type CourseLessonSubmitAssessmentResponse as CourseLessonSubmitAssessmentResponse,
|
|
840
1089
|
type CourseLessonListResponsesCursorPage as CourseLessonListResponsesCursorPage,
|
|
841
1090
|
type CourseLessonCreateParams as CourseLessonCreateParams,
|
|
842
1091
|
type CourseLessonUpdateParams as CourseLessonUpdateParams,
|
|
843
1092
|
type CourseLessonListParams as CourseLessonListParams,
|
|
1093
|
+
type CourseLessonSubmitAssessmentParams as CourseLessonSubmitAssessmentParams,
|
|
844
1094
|
};
|
|
845
1095
|
}
|
package/src/resources/courses.ts
CHANGED
|
@@ -130,6 +130,11 @@ export interface Course {
|
|
|
130
130
|
*/
|
|
131
131
|
chapters: Array<Course.Chapter>;
|
|
132
132
|
|
|
133
|
+
/**
|
|
134
|
+
* The URL of the course's cover image, which is shown in course preview cards
|
|
135
|
+
*/
|
|
136
|
+
cover_image: string | null;
|
|
137
|
+
|
|
133
138
|
/**
|
|
134
139
|
* The timestamp of when the course was created
|
|
135
140
|
*/
|
|
@@ -318,6 +323,11 @@ export interface CourseListResponse {
|
|
|
318
323
|
*/
|
|
319
324
|
certificate_after_completion_enabled: boolean | null;
|
|
320
325
|
|
|
326
|
+
/**
|
|
327
|
+
* The URL of the course's cover image, which is shown in course preview cards
|
|
328
|
+
*/
|
|
329
|
+
cover_image: string | null;
|
|
330
|
+
|
|
321
331
|
/**
|
|
322
332
|
* The timestamp of when the course was created
|
|
323
333
|
*/
|
|
@@ -85,6 +85,11 @@ export class ForumPosts extends APIResource {
|
|
|
85
85
|
|
|
86
86
|
export type ForumPostListResponsesCursorPage = CursorPage<ForumPostListResponse>;
|
|
87
87
|
|
|
88
|
+
/**
|
|
89
|
+
* The visibility types for forum posts
|
|
90
|
+
*/
|
|
91
|
+
export type ForumPostVisibilityType = 'members_only' | 'globally_visible';
|
|
92
|
+
|
|
88
93
|
/**
|
|
89
94
|
* Represents a post in forum
|
|
90
95
|
*/
|
|
@@ -238,7 +243,7 @@ export interface ForumPostCreateParams {
|
|
|
238
243
|
/**
|
|
239
244
|
* The visibility types for forum posts
|
|
240
245
|
*/
|
|
241
|
-
visibility?:
|
|
246
|
+
visibility?: ForumPostVisibilityType | null;
|
|
242
247
|
}
|
|
243
248
|
|
|
244
249
|
export namespace ForumPostCreateParams {
|
|
@@ -321,7 +326,7 @@ export interface ForumPostUpdateParams {
|
|
|
321
326
|
/**
|
|
322
327
|
* The visibility types for forum posts
|
|
323
328
|
*/
|
|
324
|
-
visibility?:
|
|
329
|
+
visibility?: ForumPostVisibilityType | null;
|
|
325
330
|
}
|
|
326
331
|
|
|
327
332
|
export namespace ForumPostUpdateParams {
|
|
@@ -384,6 +389,7 @@ export interface ForumPostListParams extends CursorPageParams {
|
|
|
384
389
|
|
|
385
390
|
export declare namespace ForumPosts {
|
|
386
391
|
export {
|
|
392
|
+
type ForumPostVisibilityType as ForumPostVisibilityType,
|
|
387
393
|
type ForumPostListResponse as ForumPostListResponse,
|
|
388
394
|
type ForumPostListResponsesCursorPage as ForumPostListResponsesCursorPage,
|
|
389
395
|
type ForumPostCreateParams as ForumPostCreateParams,
|