@whop/sdk 0.0.3 → 0.0.4
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 +32 -0
- package/client.d.mts +7 -4
- package/client.d.mts.map +1 -1
- package/client.d.ts +7 -4
- package/client.d.ts.map +1 -1
- package/client.js +3 -0
- package/client.js.map +1 -1
- package/client.mjs +5 -2
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/app-builds.d.mts +16 -13
- package/resources/app-builds.d.mts.map +1 -1
- package/resources/app-builds.d.ts +16 -13
- package/resources/app-builds.d.ts.map +1 -1
- package/resources/app-builds.js +1 -1
- package/resources/app-builds.mjs +1 -1
- package/resources/apps.d.mts +15 -10
- package/resources/apps.d.mts.map +1 -1
- package/resources/apps.d.ts +15 -10
- package/resources/apps.d.ts.map +1 -1
- package/resources/checkout-configurations.d.mts +221 -183
- package/resources/checkout-configurations.d.mts.map +1 -1
- package/resources/checkout-configurations.d.ts +221 -183
- package/resources/checkout-configurations.d.ts.map +1 -1
- package/resources/checkout-configurations.js +4 -20
- package/resources/checkout-configurations.js.map +1 -1
- package/resources/checkout-configurations.mjs +4 -20
- package/resources/checkout-configurations.mjs.map +1 -1
- package/resources/companies.d.mts +157 -0
- package/resources/companies.d.mts.map +1 -1
- package/resources/companies.d.ts +157 -0
- package/resources/companies.d.ts.map +1 -1
- package/resources/companies.js +22 -0
- package/resources/companies.js.map +1 -1
- package/resources/companies.mjs +22 -0
- package/resources/companies.mjs.map +1 -1
- package/resources/course-lesson-interactions.d.mts +2 -2
- package/resources/course-lesson-interactions.d.ts +2 -2
- package/resources/course-lesson-interactions.js +2 -2
- package/resources/course-lesson-interactions.mjs +2 -2
- package/resources/course-lessons.d.mts +68 -28
- package/resources/course-lessons.d.mts.map +1 -1
- package/resources/course-lessons.d.ts +68 -28
- package/resources/course-lessons.d.ts.map +1 -1
- package/resources/course-students.d.mts +187 -0
- package/resources/course-students.d.mts.map +1 -0
- package/resources/course-students.d.ts +187 -0
- package/resources/course-students.d.ts.map +1 -0
- package/resources/course-students.js +36 -0
- package/resources/course-students.js.map +1 -0
- package/resources/course-students.mjs +32 -0
- package/resources/course-students.mjs.map +1 -0
- package/resources/courses.d.mts +40 -20
- package/resources/courses.d.mts.map +1 -1
- package/resources/courses.d.ts +40 -20
- package/resources/courses.d.ts.map +1 -1
- package/resources/experiences.d.mts +15 -10
- package/resources/experiences.d.mts.map +1 -1
- package/resources/experiences.d.ts +15 -10
- package/resources/experiences.d.ts.map +1 -1
- package/resources/forum-posts.d.mts +28 -18
- package/resources/forum-posts.d.mts.map +1 -1
- package/resources/forum-posts.d.ts +28 -18
- package/resources/forum-posts.d.ts.map +1 -1
- package/resources/index.d.mts +3 -2
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +3 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -1
- package/resources/index.mjs.map +1 -1
- package/resources/invoices.d.mts +529 -146
- package/resources/invoices.d.mts.map +1 -1
- package/resources/invoices.d.ts +529 -146
- package/resources/invoices.d.ts.map +1 -1
- package/resources/invoices.js +2 -24
- package/resources/invoices.js.map +1 -1
- package/resources/invoices.mjs +2 -24
- package/resources/invoices.mjs.map +1 -1
- package/resources/messages.d.mts +28 -18
- package/resources/messages.d.mts.map +1 -1
- package/resources/messages.d.ts +28 -18
- package/resources/messages.d.ts.map +1 -1
- package/resources/payments.d.mts +8 -1
- package/resources/payments.d.mts.map +1 -1
- package/resources/payments.d.ts +8 -1
- package/resources/payments.d.ts.map +1 -1
- package/resources/plans.d.mts +112 -16
- package/resources/plans.d.mts.map +1 -1
- package/resources/plans.d.ts +112 -16
- package/resources/plans.d.ts.map +1 -1
- package/resources/plans.js.map +1 -1
- package/resources/plans.mjs.map +1 -1
- package/resources/products.d.mts +15 -10
- package/resources/products.d.mts.map +1 -1
- package/resources/products.d.ts +15 -10
- package/resources/products.d.ts.map +1 -1
- package/resources/shared.d.mts +47 -0
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +47 -0
- package/resources/shared.d.ts.map +1 -1
- package/resources/transfers.d.mts +12 -0
- package/resources/transfers.d.mts.map +1 -1
- package/resources/transfers.d.ts +12 -0
- package/resources/transfers.d.ts.map +1 -1
- package/src/client.ts +32 -10
- package/src/resources/app-builds.ts +19 -14
- package/src/resources/apps.ts +16 -11
- package/src/resources/checkout-configurations.ts +245 -199
- package/src/resources/companies.ts +196 -0
- package/src/resources/course-lesson-interactions.ts +2 -2
- package/src/resources/course-lessons.ts +83 -30
- package/src/resources/course-students.ts +238 -0
- package/src/resources/courses.ts +50 -22
- package/src/resources/experiences.ts +19 -11
- package/src/resources/forum-posts.ts +34 -20
- package/src/resources/index.ts +14 -2
- package/src/resources/invoices.ts +620 -149
- package/src/resources/messages.ts +34 -20
- package/src/resources/payments.ts +8 -1
- package/src/resources/plans.ts +124 -16
- package/src/resources/products.ts +19 -11
- package/src/resources/shared.ts +48 -0
- package/src/resources/transfers.ts +10 -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
|
@@ -3,10 +3,23 @@
|
|
|
3
3
|
import { APIResource } from '../core/resource';
|
|
4
4
|
import * as Shared from './shared';
|
|
5
5
|
import { APIPromise } from '../core/api-promise';
|
|
6
|
+
import { CursorPage, type CursorPageParams, PagePromise } from '../core/pagination';
|
|
6
7
|
import { RequestOptions } from '../internal/request-options';
|
|
7
8
|
import { path } from '../internal/utils/path';
|
|
8
9
|
|
|
9
10
|
export class Companies extends APIResource {
|
|
11
|
+
/**
|
|
12
|
+
* Create a new sub company for your platform
|
|
13
|
+
*
|
|
14
|
+
* Required permissions:
|
|
15
|
+
*
|
|
16
|
+
* - `company:create_child`
|
|
17
|
+
* - `company:basic:read`
|
|
18
|
+
*/
|
|
19
|
+
create(body: CompanyCreateParams, options?: RequestOptions): APIPromise<Shared.Company> {
|
|
20
|
+
return this._client.post('/companies', { body, ...options });
|
|
21
|
+
}
|
|
22
|
+
|
|
10
23
|
/**
|
|
11
24
|
* Retrieves an company by ID or its url route
|
|
12
25
|
*
|
|
@@ -17,4 +30,187 @@ export class Companies extends APIResource {
|
|
|
17
30
|
retrieve(id: string, options?: RequestOptions): APIPromise<Shared.Company> {
|
|
18
31
|
return this._client.get(path`/companies/${id}`, options);
|
|
19
32
|
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Lists companies the current user has access to
|
|
36
|
+
*
|
|
37
|
+
* Required permissions:
|
|
38
|
+
*
|
|
39
|
+
* - `company:basic:read`
|
|
40
|
+
*/
|
|
41
|
+
list(
|
|
42
|
+
query: CompanyListParams,
|
|
43
|
+
options?: RequestOptions,
|
|
44
|
+
): PagePromise<CompanyListResponsesCursorPage, CompanyListResponse> {
|
|
45
|
+
return this._client.getAPIList('/companies', CursorPage<CompanyListResponse>, { query, ...options });
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export type CompanyListResponsesCursorPage = CursorPage<CompanyListResponse>;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* An object representing a (sanitized) company.
|
|
53
|
+
*/
|
|
54
|
+
export interface CompanyListResponse {
|
|
55
|
+
/**
|
|
56
|
+
* The ID (tag) of the company.
|
|
57
|
+
*/
|
|
58
|
+
id: string;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* The different business types a company can be.
|
|
62
|
+
*/
|
|
63
|
+
business_type: Shared.BusinessTypes | null;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* When the company was created (signed up)
|
|
67
|
+
*/
|
|
68
|
+
created_at: string;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* The creator pitch for the company.
|
|
72
|
+
*/
|
|
73
|
+
description: string | null;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* The different industry types a company can be in.
|
|
77
|
+
*/
|
|
78
|
+
industry_type: Shared.IndustryTypes | null;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* The company's logo.
|
|
82
|
+
*/
|
|
83
|
+
logo: CompanyListResponse.Logo | null;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* The number of members in the company.
|
|
87
|
+
*/
|
|
88
|
+
member_count: number;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* A key-value store of data for the account, created/updated by the platform that
|
|
92
|
+
* made the account.
|
|
93
|
+
*/
|
|
94
|
+
metadata: { [key: string]: unknown } | null;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* The user who owns this company
|
|
98
|
+
*/
|
|
99
|
+
owner_user: CompanyListResponse.OwnerUser;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* The number of reviews that have been published for the company.
|
|
103
|
+
*/
|
|
104
|
+
published_reviews_count: number;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* The slug/route of the company on the Whop site.
|
|
108
|
+
*/
|
|
109
|
+
route: string;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* The title of the company.
|
|
113
|
+
*/
|
|
114
|
+
title: string;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* The time the company was last updated.
|
|
118
|
+
*/
|
|
119
|
+
updated_at: string;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* If the company is Whop Verified
|
|
123
|
+
*/
|
|
124
|
+
verified: boolean;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export namespace CompanyListResponse {
|
|
128
|
+
/**
|
|
129
|
+
* The company's logo.
|
|
130
|
+
*/
|
|
131
|
+
export interface Logo {
|
|
132
|
+
/**
|
|
133
|
+
* This is the URL you use to render optimized attachments on the client. This
|
|
134
|
+
* should be used for apps.
|
|
135
|
+
*/
|
|
136
|
+
url: string | null;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* The user who owns this company
|
|
141
|
+
*/
|
|
142
|
+
export interface OwnerUser {
|
|
143
|
+
/**
|
|
144
|
+
* The internal ID of the user.
|
|
145
|
+
*/
|
|
146
|
+
id: string;
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* The name of the user from their Whop account.
|
|
150
|
+
*/
|
|
151
|
+
name: string | null;
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* The username of the user from their Whop account.
|
|
155
|
+
*/
|
|
156
|
+
username: string;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export interface CompanyCreateParams {
|
|
161
|
+
/**
|
|
162
|
+
* The email of the user who the company will belong to.
|
|
163
|
+
*/
|
|
164
|
+
email: string;
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* The company ID of the platform creating this company.
|
|
168
|
+
*/
|
|
169
|
+
parent_company_id: string;
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* The name of the company being created.
|
|
173
|
+
*/
|
|
174
|
+
title: string;
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Additional metadata for the account
|
|
178
|
+
*/
|
|
179
|
+
metadata?: { [key: string]: unknown } | null;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export interface CompanyListParams extends CursorPageParams {
|
|
183
|
+
/**
|
|
184
|
+
* The ID of the parent company to list sub companies for
|
|
185
|
+
*/
|
|
186
|
+
parent_company_id: string;
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Returns the elements in the list that come before the specified cursor.
|
|
190
|
+
*/
|
|
191
|
+
before?: string | null;
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* The direction of the sort.
|
|
195
|
+
*/
|
|
196
|
+
direction?: Shared.Direction | null;
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Returns the first _n_ elements from the list.
|
|
200
|
+
*/
|
|
201
|
+
first?: number | null;
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Returns the last _n_ elements from the list.
|
|
205
|
+
*/
|
|
206
|
+
last?: number | null;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
export declare namespace Companies {
|
|
210
|
+
export {
|
|
211
|
+
type CompanyListResponse as CompanyListResponse,
|
|
212
|
+
type CompanyListResponsesCursorPage as CompanyListResponsesCursorPage,
|
|
213
|
+
type CompanyCreateParams as CompanyCreateParams,
|
|
214
|
+
type CompanyListParams as CompanyListParams,
|
|
215
|
+
};
|
|
20
216
|
}
|
|
@@ -14,8 +14,8 @@ export class CourseLessonInteractions extends APIResource {
|
|
|
14
14
|
*
|
|
15
15
|
* Required permissions:
|
|
16
16
|
*
|
|
17
|
-
* - `course_lesson_interaction:read`
|
|
18
17
|
* - `courses:read`
|
|
18
|
+
* - `course_analytics:read`
|
|
19
19
|
*/
|
|
20
20
|
retrieve(id: string, options?: RequestOptions): APIPromise<Shared.CourseLessonInteraction> {
|
|
21
21
|
return this._client.get(path`/course_lesson_interactions/${id}`, options);
|
|
@@ -26,8 +26,8 @@ export class CourseLessonInteractions extends APIResource {
|
|
|
26
26
|
*
|
|
27
27
|
* Required permissions:
|
|
28
28
|
*
|
|
29
|
-
* - `course_lesson_interaction:read`
|
|
30
29
|
* - `courses:read`
|
|
30
|
+
* - `course_analytics:read`
|
|
31
31
|
*/
|
|
32
32
|
list(
|
|
33
33
|
query: CourseLessonInteractionListParams | null | undefined = {},
|
|
@@ -190,9 +190,10 @@ export namespace Lesson {
|
|
|
190
190
|
id: string;
|
|
191
191
|
|
|
192
192
|
/**
|
|
193
|
-
* The correct answer for the question. Used for short answer questions
|
|
193
|
+
* The correct answer for the question. Used for short answer questions. Only
|
|
194
|
+
* visible to admins (users with courses:update permission)
|
|
194
195
|
*/
|
|
195
|
-
correct_answer: string;
|
|
196
|
+
correct_answer: string | null;
|
|
196
197
|
|
|
197
198
|
/**
|
|
198
199
|
* When the question was created
|
|
@@ -262,9 +263,10 @@ export namespace Lesson {
|
|
|
262
263
|
id: string;
|
|
263
264
|
|
|
264
265
|
/**
|
|
265
|
-
* Whether this option is a correct answer
|
|
266
|
+
* Whether this option is a correct answer. Only visible to admins (users with
|
|
267
|
+
* courses:update permission)
|
|
266
268
|
*/
|
|
267
|
-
is_correct: boolean;
|
|
269
|
+
is_correct: boolean | null;
|
|
268
270
|
|
|
269
271
|
/**
|
|
270
272
|
* The text of the answer option
|
|
@@ -436,6 +438,11 @@ export interface CourseLessonCreateParams {
|
|
|
436
438
|
}
|
|
437
439
|
|
|
438
440
|
export interface CourseLessonUpdateParams {
|
|
441
|
+
/**
|
|
442
|
+
* Completion requirements for quiz/knowledge check lessons
|
|
443
|
+
*/
|
|
444
|
+
assessment_completion_requirement?: CourseLessonUpdateParams.AssessmentCompletionRequirement | null;
|
|
445
|
+
|
|
439
446
|
/**
|
|
440
447
|
* Assessment questions for quiz/knowledge check lessons. Replaces all existing
|
|
441
448
|
* questions.
|
|
@@ -446,7 +453,10 @@ export interface CourseLessonUpdateParams {
|
|
|
446
453
|
* General attachments for the lesson (PDFs, files, etc). Replaces all existing
|
|
447
454
|
* attachments.
|
|
448
455
|
*/
|
|
449
|
-
attachments?: Array<
|
|
456
|
+
attachments?: Array<
|
|
457
|
+
| CourseLessonUpdateParams.AttachmentInputWithDirectUploadID
|
|
458
|
+
| CourseLessonUpdateParams.AttachmentInputWithID
|
|
459
|
+
> | null;
|
|
450
460
|
|
|
451
461
|
/**
|
|
452
462
|
* The content of the lesson
|
|
@@ -466,7 +476,15 @@ export interface CourseLessonUpdateParams {
|
|
|
466
476
|
/**
|
|
467
477
|
* The main PDF file for this lesson
|
|
468
478
|
*/
|
|
469
|
-
main_pdf?:
|
|
479
|
+
main_pdf?:
|
|
480
|
+
| CourseLessonUpdateParams.AttachmentInputWithDirectUploadID
|
|
481
|
+
| CourseLessonUpdateParams.AttachmentInputWithID
|
|
482
|
+
| null;
|
|
483
|
+
|
|
484
|
+
/**
|
|
485
|
+
* Maximum number of attempts allowed for assessments
|
|
486
|
+
*/
|
|
487
|
+
max_attempts?: number | null;
|
|
470
488
|
|
|
471
489
|
/**
|
|
472
490
|
* The ID of the Mux asset to attach to this lesson for video lessons
|
|
@@ -486,6 +504,23 @@ export interface CourseLessonUpdateParams {
|
|
|
486
504
|
}
|
|
487
505
|
|
|
488
506
|
export namespace CourseLessonUpdateParams {
|
|
507
|
+
/**
|
|
508
|
+
* Completion requirements for quiz/knowledge check lessons
|
|
509
|
+
*/
|
|
510
|
+
export interface AssessmentCompletionRequirement {
|
|
511
|
+
/**
|
|
512
|
+
* The minimum grade percentage required to pass (0-100). Cannot be set together
|
|
513
|
+
* with minimum_questions_correct.
|
|
514
|
+
*/
|
|
515
|
+
minimum_grade_percent?: number | null;
|
|
516
|
+
|
|
517
|
+
/**
|
|
518
|
+
* The minimum number of questions that must be answered correctly. Cannot be set
|
|
519
|
+
* together with minimum_grade_percent.
|
|
520
|
+
*/
|
|
521
|
+
minimum_questions_correct?: number | null;
|
|
522
|
+
}
|
|
523
|
+
|
|
489
524
|
/**
|
|
490
525
|
* Input for creating or updating an assessment question
|
|
491
526
|
*/
|
|
@@ -514,7 +549,10 @@ export namespace CourseLessonUpdateParams {
|
|
|
514
549
|
/**
|
|
515
550
|
* Optional image attachment for the question
|
|
516
551
|
*/
|
|
517
|
-
image?:
|
|
552
|
+
image?:
|
|
553
|
+
| AssessmentQuestion.AttachmentInputWithDirectUploadID
|
|
554
|
+
| AssessmentQuestion.AttachmentInputWithID
|
|
555
|
+
| null;
|
|
518
556
|
|
|
519
557
|
/**
|
|
520
558
|
* The answer options for multiple choice/select questions
|
|
@@ -524,22 +562,27 @@ export namespace CourseLessonUpdateParams {
|
|
|
524
562
|
|
|
525
563
|
export namespace AssessmentQuestion {
|
|
526
564
|
/**
|
|
527
|
-
*
|
|
565
|
+
* Input for an attachment
|
|
528
566
|
*/
|
|
529
|
-
export interface
|
|
530
|
-
/**
|
|
531
|
-
* The ID of an existing attachment object. Use this when updating a resource and
|
|
532
|
-
* keeping a subset of the attachments. Don't use this unless you know what you're
|
|
533
|
-
* doing.
|
|
534
|
-
*/
|
|
535
|
-
id?: string | null;
|
|
536
|
-
|
|
567
|
+
export interface AttachmentInputWithDirectUploadID {
|
|
537
568
|
/**
|
|
538
569
|
* This ID should be used the first time you upload an attachment. It is the ID of
|
|
539
570
|
* the direct upload that was created when uploading the file to S3 via the
|
|
540
571
|
* mediaDirectUpload mutation.
|
|
541
572
|
*/
|
|
542
|
-
direct_upload_id
|
|
573
|
+
direct_upload_id: string;
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
/**
|
|
577
|
+
* Input for an attachment
|
|
578
|
+
*/
|
|
579
|
+
export interface AttachmentInputWithID {
|
|
580
|
+
/**
|
|
581
|
+
* The ID of an existing attachment object. Use this when updating a resource and
|
|
582
|
+
* keeping a subset of the attachments. Don't use this unless you know what you're
|
|
583
|
+
* doing.
|
|
584
|
+
*/
|
|
585
|
+
id: string;
|
|
543
586
|
}
|
|
544
587
|
|
|
545
588
|
/**
|
|
@@ -567,39 +610,49 @@ export namespace CourseLessonUpdateParams {
|
|
|
567
610
|
/**
|
|
568
611
|
* Input for an attachment
|
|
569
612
|
*/
|
|
570
|
-
export interface
|
|
571
|
-
/**
|
|
572
|
-
* The ID of an existing attachment object. Use this when updating a resource and
|
|
573
|
-
* keeping a subset of the attachments. Don't use this unless you know what you're
|
|
574
|
-
* doing.
|
|
575
|
-
*/
|
|
576
|
-
id?: string | null;
|
|
577
|
-
|
|
613
|
+
export interface AttachmentInputWithDirectUploadID {
|
|
578
614
|
/**
|
|
579
615
|
* This ID should be used the first time you upload an attachment. It is the ID of
|
|
580
616
|
* the direct upload that was created when uploading the file to S3 via the
|
|
581
617
|
* mediaDirectUpload mutation.
|
|
582
618
|
*/
|
|
583
|
-
direct_upload_id
|
|
619
|
+
direct_upload_id: string;
|
|
584
620
|
}
|
|
585
621
|
|
|
586
622
|
/**
|
|
587
|
-
*
|
|
623
|
+
* Input for an attachment
|
|
588
624
|
*/
|
|
589
|
-
export interface
|
|
625
|
+
export interface AttachmentInputWithID {
|
|
590
626
|
/**
|
|
591
627
|
* The ID of an existing attachment object. Use this when updating a resource and
|
|
592
628
|
* keeping a subset of the attachments. Don't use this unless you know what you're
|
|
593
629
|
* doing.
|
|
594
630
|
*/
|
|
595
|
-
id
|
|
631
|
+
id: string;
|
|
632
|
+
}
|
|
596
633
|
|
|
634
|
+
/**
|
|
635
|
+
* Input for an attachment
|
|
636
|
+
*/
|
|
637
|
+
export interface AttachmentInputWithDirectUploadID {
|
|
597
638
|
/**
|
|
598
639
|
* This ID should be used the first time you upload an attachment. It is the ID of
|
|
599
640
|
* the direct upload that was created when uploading the file to S3 via the
|
|
600
641
|
* mediaDirectUpload mutation.
|
|
601
642
|
*/
|
|
602
|
-
direct_upload_id
|
|
643
|
+
direct_upload_id: string;
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
/**
|
|
647
|
+
* Input for an attachment
|
|
648
|
+
*/
|
|
649
|
+
export interface AttachmentInputWithID {
|
|
650
|
+
/**
|
|
651
|
+
* The ID of an existing attachment object. Use this when updating a resource and
|
|
652
|
+
* keeping a subset of the attachments. Don't use this unless you know what you're
|
|
653
|
+
* doing.
|
|
654
|
+
*/
|
|
655
|
+
id: string;
|
|
603
656
|
}
|
|
604
657
|
}
|
|
605
658
|
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import { APIPromise } from '../core/api-promise';
|
|
5
|
+
import { CursorPage, type CursorPageParams, PagePromise } from '../core/pagination';
|
|
6
|
+
import { RequestOptions } from '../internal/request-options';
|
|
7
|
+
import { path } from '../internal/utils/path';
|
|
8
|
+
|
|
9
|
+
export class CourseStudents extends APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* Retrieves a course student by interaction ID
|
|
12
|
+
*
|
|
13
|
+
* Required permissions:
|
|
14
|
+
*
|
|
15
|
+
* - `courses:read`
|
|
16
|
+
* - `course_analytics:read`
|
|
17
|
+
*/
|
|
18
|
+
retrieve(id: string, options?: RequestOptions): APIPromise<CourseStudentRetrieveResponse> {
|
|
19
|
+
return this._client.get(path`/course_students/${id}`, options);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Lists students for a course
|
|
24
|
+
*
|
|
25
|
+
* Required permissions:
|
|
26
|
+
*
|
|
27
|
+
* - `courses:read`
|
|
28
|
+
* - `course_analytics:read`
|
|
29
|
+
*/
|
|
30
|
+
list(
|
|
31
|
+
query: CourseStudentListParams,
|
|
32
|
+
options?: RequestOptions,
|
|
33
|
+
): PagePromise<CourseStudentListResponsesCursorPage, CourseStudentListResponse> {
|
|
34
|
+
return this._client.getAPIList('/course_students', CursorPage<CourseStudentListResponse>, {
|
|
35
|
+
query,
|
|
36
|
+
...options,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export type CourseStudentListResponsesCursorPage = CursorPage<CourseStudentListResponse>;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* A course student (enrollment of a student in a course)
|
|
45
|
+
*/
|
|
46
|
+
export interface CourseStudentRetrieveResponse {
|
|
47
|
+
/**
|
|
48
|
+
* The ID of the course student. Looks like crsi_XXX
|
|
49
|
+
*/
|
|
50
|
+
id: string;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* The number of lessons the student has completed
|
|
54
|
+
*/
|
|
55
|
+
completed_lessons_count: number;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* The percentage of lessons completed (0-100)
|
|
59
|
+
*/
|
|
60
|
+
completion_rate: number;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* The course the student is enrolled in
|
|
64
|
+
*/
|
|
65
|
+
course: CourseStudentRetrieveResponse.Course;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* When the student first interacted with the course
|
|
69
|
+
*/
|
|
70
|
+
first_interaction_at: string;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* When the student last interacted with the course
|
|
74
|
+
*/
|
|
75
|
+
last_interaction_at: string;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* The total number of lessons the student has access to
|
|
79
|
+
*/
|
|
80
|
+
total_lessons_count: number;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* The user who is enrolled in the course
|
|
84
|
+
*/
|
|
85
|
+
user: CourseStudentRetrieveResponse.User;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export namespace CourseStudentRetrieveResponse {
|
|
89
|
+
/**
|
|
90
|
+
* The course the student is enrolled in
|
|
91
|
+
*/
|
|
92
|
+
export interface Course {
|
|
93
|
+
/**
|
|
94
|
+
* The ID of the course. Looks like cors_XXX
|
|
95
|
+
*/
|
|
96
|
+
id: string;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* The experience that the course belongs to
|
|
100
|
+
*/
|
|
101
|
+
experience: Course.Experience;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* The title of the course
|
|
105
|
+
*/
|
|
106
|
+
title: string | null;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export namespace Course {
|
|
110
|
+
/**
|
|
111
|
+
* The experience that the course belongs to
|
|
112
|
+
*/
|
|
113
|
+
export interface Experience {
|
|
114
|
+
/**
|
|
115
|
+
* The unique ID representing this experience
|
|
116
|
+
*/
|
|
117
|
+
id: string;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* The user who is enrolled in the course
|
|
123
|
+
*/
|
|
124
|
+
export interface User {
|
|
125
|
+
/**
|
|
126
|
+
* The internal ID of the user.
|
|
127
|
+
*/
|
|
128
|
+
id: string;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* The name of the user from their Whop account.
|
|
132
|
+
*/
|
|
133
|
+
name: string | null;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* The username of the user from their Whop account.
|
|
137
|
+
*/
|
|
138
|
+
username: string;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* A course student (enrollment of a student in a course)
|
|
144
|
+
*/
|
|
145
|
+
export interface CourseStudentListResponse {
|
|
146
|
+
/**
|
|
147
|
+
* The ID of the course student. Looks like crsi_XXX
|
|
148
|
+
*/
|
|
149
|
+
id: string;
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* The number of lessons the student has completed
|
|
153
|
+
*/
|
|
154
|
+
completed_lessons_count: number;
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* The percentage of lessons completed (0-100)
|
|
158
|
+
*/
|
|
159
|
+
completion_rate: number;
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* When the student first interacted with the course
|
|
163
|
+
*/
|
|
164
|
+
first_interaction_at: string;
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* When the student last interacted with the course
|
|
168
|
+
*/
|
|
169
|
+
last_interaction_at: string;
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* The total number of lessons the student has access to
|
|
173
|
+
*/
|
|
174
|
+
total_lessons_count: number;
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* The user who is enrolled in the course
|
|
178
|
+
*/
|
|
179
|
+
user: CourseStudentListResponse.User;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export namespace CourseStudentListResponse {
|
|
183
|
+
/**
|
|
184
|
+
* The user who is enrolled in the course
|
|
185
|
+
*/
|
|
186
|
+
export interface User {
|
|
187
|
+
/**
|
|
188
|
+
* The internal ID of the user.
|
|
189
|
+
*/
|
|
190
|
+
id: string;
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* The name of the user from their Whop account.
|
|
194
|
+
*/
|
|
195
|
+
name: string | null;
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* The username of the user from their Whop account.
|
|
199
|
+
*/
|
|
200
|
+
username: string;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
export interface CourseStudentListParams extends CursorPageParams {
|
|
205
|
+
/**
|
|
206
|
+
* The ID of the course
|
|
207
|
+
*/
|
|
208
|
+
course_id: string;
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Returns the elements in the list that come before the specified cursor.
|
|
212
|
+
*/
|
|
213
|
+
before?: string | null;
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Returns the first _n_ elements from the list.
|
|
217
|
+
*/
|
|
218
|
+
first?: number | null;
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Filter students by name - returns students whose names match the keyword
|
|
222
|
+
*/
|
|
223
|
+
keyword?: string | null;
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Returns the last _n_ elements from the list.
|
|
227
|
+
*/
|
|
228
|
+
last?: number | null;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
export declare namespace CourseStudents {
|
|
232
|
+
export {
|
|
233
|
+
type CourseStudentRetrieveResponse as CourseStudentRetrieveResponse,
|
|
234
|
+
type CourseStudentListResponse as CourseStudentListResponse,
|
|
235
|
+
type CourseStudentListResponsesCursorPage as CourseStudentListResponsesCursorPage,
|
|
236
|
+
type CourseStudentListParams as CourseStudentListParams,
|
|
237
|
+
};
|
|
238
|
+
}
|