@whop/sdk 0.0.6 → 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 +47 -0
- package/client.d.mts +19 -10
- package/client.d.mts.map +1 -1
- package/client.d.ts +19 -10
- package/client.d.ts.map +1 -1
- package/client.js +9 -0
- package/client.js.map +1 -1
- package/client.mjs +9 -0
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/access-tokens.d.mts +48 -26
- package/resources/access-tokens.d.mts.map +1 -1
- package/resources/access-tokens.d.ts +48 -26
- package/resources/access-tokens.d.ts.map +1 -1
- package/resources/access-tokens.js +5 -5
- package/resources/access-tokens.mjs +5 -5
- 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 +169 -12
- package/resources/checkout-configurations.d.mts.map +1 -1
- package/resources/checkout-configurations.d.ts +169 -12
- 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/disputes.d.mts +704 -0
- package/resources/disputes.d.mts.map +1 -0
- package/resources/disputes.d.ts +704 -0
- package/resources/disputes.d.ts.map +1 -0
- package/resources/disputes.js +77 -0
- package/resources/disputes.js.map +1 -0
- package/resources/disputes.mjs +73 -0
- package/resources/disputes.mjs.map +1 -0
- package/resources/forum-posts.d.mts +13 -1
- package/resources/forum-posts.d.mts.map +1 -1
- package/resources/forum-posts.d.ts +13 -1
- package/resources/forum-posts.d.ts.map +1 -1
- package/resources/index.d.mts +8 -5
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +8 -5
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +7 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +3 -0
- package/resources/index.mjs.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/payments.d.mts +1 -1
- package/resources/payments.d.mts.map +1 -1
- package/resources/payments.d.ts +1 -1
- package/resources/payments.d.ts.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 +46 -5
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +46 -5
- package/resources/shared.d.ts.map +1 -1
- package/resources/shipments.d.mts +1 -1
- package/resources/shipments.d.mts.map +1 -1
- package/resources/shipments.d.ts +1 -1
- package/resources/shipments.d.ts.map +1 -1
- package/resources/webhooks.d.mts +427 -2
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +427 -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 +93 -0
- package/src/resources/access-tokens.ts +53 -26
- package/src/resources/apps.ts +21 -0
- package/src/resources/checkout-configurations.ts +193 -12
- package/src/resources/course-lessons.ts +250 -0
- package/src/resources/courses.ts +10 -0
- package/src/resources/disputes.ts +873 -0
- package/src/resources/forum-posts.ts +16 -0
- package/src/resources/index.ts +42 -0
- package/src/resources/ledger-accounts.ts +1 -0
- package/src/resources/payments.ts +1 -0
- package/src/resources/refunds.ts +383 -0
- package/src/resources/shared.ts +62 -5
- package/src/resources/shipments.ts +1 -1
- package/src/resources/webhooks.ts +522 -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
|
@@ -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
|
*/
|