@whop/sdk 0.0.2 → 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 +55 -0
- package/client.d.mts +30 -12
- package/client.d.mts.map +1 -1
- package/client.d.ts +30 -12
- package/client.d.ts.map +1 -1
- package/client.js +19 -1
- package/client.js.map +1 -1
- package/client.mjs +21 -3
- 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 +252 -140
- package/resources/checkout-configurations.d.mts.map +1 -1
- package/resources/checkout-configurations.d.ts +252 -140
- package/resources/checkout-configurations.d.ts.map +1 -1
- package/resources/checkout-configurations.js +6 -20
- package/resources/checkout-configurations.js.map +1 -1
- package/resources/checkout-configurations.mjs +6 -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-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-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 +563 -0
- package/resources/course-lessons.d.mts.map +1 -0
- package/resources/course-lessons.d.ts +563 -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/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 +485 -0
- package/resources/courses.d.mts.map +1 -0
- package/resources/courses.d.ts +485 -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 +42 -11
- package/resources/experiences.d.mts.map +1 -1
- package/resources/experiences.d.ts +42 -11
- 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 +75 -10
- package/resources/forum-posts.d.mts.map +1 -1
- package/resources/forum-posts.d.ts +75 -10
- 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/index.d.mts +12 -6
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +12 -6
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +13 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +7 -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/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 +4 -0
- package/resources/members.d.mts.map +1 -1
- package/resources/members.d.ts +4 -0
- package/resources/members.d.ts.map +1 -1
- 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 +57 -10
- package/resources/messages.d.mts.map +1 -1
- package/resources/messages.d.ts +57 -10
- 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 +35 -13
- package/resources/payments.d.mts.map +1 -1
- package/resources/payments.d.ts +35 -13
- package/resources/payments.d.ts.map +1 -1
- package/resources/plans.d.mts +161 -17
- package/resources/plans.d.mts.map +1 -1
- package/resources/plans.d.ts +161 -17
- 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 +30 -33
- package/resources/products.d.mts.map +1 -1
- package/resources/products.d.ts +30 -33
- 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 +117 -14
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +117 -14
- 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 +166 -11
- package/src/resources/app-builds.ts +19 -14
- package/src/resources/apps.ts +16 -11
- package/src/resources/checkout-configurations.ts +278 -143
- package/src/resources/companies.ts +196 -0
- package/src/resources/course-chapters.ts +236 -0
- package/src/resources/course-lesson-interactions.ts +2 -2
- package/src/resources/course-lessons.ts +699 -0
- package/src/resources/course-students.ts +238 -0
- package/src/resources/courses.ts +622 -0
- package/src/resources/experiences.ts +54 -11
- package/src/resources/forum-posts.ts +95 -10
- package/src/resources/index.ts +73 -2
- package/src/resources/invoices.ts +620 -149
- package/src/resources/ledger-accounts.ts +13 -1
- package/src/resources/members.ts +5 -0
- package/src/resources/memberships.ts +31 -6
- package/src/resources/messages.ts +74 -10
- package/src/resources/payments.ts +146 -19
- package/src/resources/plans.ts +184 -17
- package/src/resources/products.ts +36 -37
- package/src/resources/promo-codes.ts +490 -0
- package/src/resources/reviews.ts +348 -0
- package/src/resources/shared.ts +128 -14
- 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
|
@@ -0,0 +1,699 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import * as CourseLessonsAPI from './course-lessons';
|
|
5
|
+
import { APIPromise } from '../core/api-promise';
|
|
6
|
+
import { CursorPage, type CursorPageParams, PagePromise } from '../core/pagination';
|
|
7
|
+
import { RequestOptions } from '../internal/request-options';
|
|
8
|
+
import { path } from '../internal/utils/path';
|
|
9
|
+
|
|
10
|
+
export class CourseLessons extends APIResource {
|
|
11
|
+
/**
|
|
12
|
+
* Creates a new course lesson
|
|
13
|
+
*
|
|
14
|
+
* Required permissions:
|
|
15
|
+
*
|
|
16
|
+
* - `courses:update`
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* const lesson = await client.courseLessons.create({
|
|
21
|
+
* chapter_id: 'chap_xxxxxxxxxxxxx',
|
|
22
|
+
* lesson_type: 'text',
|
|
23
|
+
* });
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
create(body: CourseLessonCreateParams, options?: RequestOptions): APIPromise<Lesson> {
|
|
27
|
+
return this._client.post('/course_lessons', { body, ...options });
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Retrieves a course lesson by ID
|
|
32
|
+
*
|
|
33
|
+
* Required permissions:
|
|
34
|
+
*
|
|
35
|
+
* - `courses:read`
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* const lesson = await client.courseLessons.retrieve(
|
|
40
|
+
* 'lesn_xxxxxxxxxxxxx',
|
|
41
|
+
* );
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
retrieve(id: string, options?: RequestOptions): APIPromise<Lesson> {
|
|
45
|
+
return this._client.get(path`/course_lessons/${id}`, options);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Updates a course lesson
|
|
50
|
+
*
|
|
51
|
+
* Required permissions:
|
|
52
|
+
*
|
|
53
|
+
* - `courses:update`
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```ts
|
|
57
|
+
* const lesson = await client.courseLessons.update(
|
|
58
|
+
* 'lesn_xxxxxxxxxxxxx',
|
|
59
|
+
* );
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
update(
|
|
63
|
+
id: string,
|
|
64
|
+
body: CourseLessonUpdateParams | null | undefined = {},
|
|
65
|
+
options?: RequestOptions,
|
|
66
|
+
): APIPromise<Lesson> {
|
|
67
|
+
return this._client.patch(path`/course_lessons/${id}`, { body, ...options });
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Lists lessons for a course or chapter
|
|
72
|
+
*
|
|
73
|
+
* Required permissions:
|
|
74
|
+
*
|
|
75
|
+
* - `courses:read`
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ```ts
|
|
79
|
+
* // Automatically fetches more pages as needed.
|
|
80
|
+
* for await (const courseLessonListResponse of client.courseLessons.list()) {
|
|
81
|
+
* // ...
|
|
82
|
+
* }
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
list(
|
|
86
|
+
query: CourseLessonListParams | null | undefined = {},
|
|
87
|
+
options?: RequestOptions,
|
|
88
|
+
): PagePromise<CourseLessonListResponsesCursorPage, CourseLessonListResponse> {
|
|
89
|
+
return this._client.getAPIList('/course_lessons', CursorPage<CourseLessonListResponse>, {
|
|
90
|
+
query,
|
|
91
|
+
...options,
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Deletes a course lesson
|
|
97
|
+
*
|
|
98
|
+
* Required permissions:
|
|
99
|
+
*
|
|
100
|
+
* - `courses:update`
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* ```ts
|
|
104
|
+
* const courseLesson = await client.courseLessons.delete(
|
|
105
|
+
* 'lesn_xxxxxxxxxxxxx',
|
|
106
|
+
* );
|
|
107
|
+
* ```
|
|
108
|
+
*/
|
|
109
|
+
delete(id: string, options?: RequestOptions): APIPromise<CourseLessonDeleteResponse> {
|
|
110
|
+
return this._client.delete(path`/course_lessons/${id}`, options);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export type CourseLessonListResponsesCursorPage = CursorPage<CourseLessonListResponse>;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* The available types for an assessment question
|
|
118
|
+
*/
|
|
119
|
+
export type AssessmentQuestionTypes = 'short_answer' | 'true_false' | 'multiple_choice' | 'multiple_select';
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* A lesson from the courses app
|
|
123
|
+
*/
|
|
124
|
+
export interface Lesson {
|
|
125
|
+
/**
|
|
126
|
+
* The ID of the lesson
|
|
127
|
+
*/
|
|
128
|
+
id: string;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Assessment questions for quiz/knowledge check lessons
|
|
132
|
+
*/
|
|
133
|
+
assessment_questions: Array<Lesson.AssessmentQuestion>;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* The attached files in this lesson as a flat array
|
|
137
|
+
*/
|
|
138
|
+
attachments: Array<Lesson.Attachment>;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* The content of the lesson
|
|
142
|
+
*/
|
|
143
|
+
content: string | null;
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Number of days from course start until the lesson is unlocked
|
|
147
|
+
*/
|
|
148
|
+
days_from_course_start_until_unlock: number | null;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* The type of the lesson (text, video, pdf, multi, quiz, knowledge_check)
|
|
152
|
+
*/
|
|
153
|
+
lesson_type: LessonTypes;
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* The main PDF file for this lesson
|
|
157
|
+
*/
|
|
158
|
+
main_pdf: Lesson.MainPdf | null;
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* The order of the lesson within its chapter
|
|
162
|
+
*/
|
|
163
|
+
order: number;
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* The title of the lesson
|
|
167
|
+
*/
|
|
168
|
+
title: string;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* The associated Mux asset for video lessons
|
|
172
|
+
*/
|
|
173
|
+
video_asset: Lesson.VideoAsset | null;
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* The visibility of the lesson. Determines how / whether this lesson is visible to
|
|
177
|
+
* users.
|
|
178
|
+
*/
|
|
179
|
+
visibility: LessonVisibilities;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export namespace Lesson {
|
|
183
|
+
/**
|
|
184
|
+
* An assessment question in a course quiz or knowledge check
|
|
185
|
+
*/
|
|
186
|
+
export interface AssessmentQuestion {
|
|
187
|
+
/**
|
|
188
|
+
* The ID of the assessment question
|
|
189
|
+
*/
|
|
190
|
+
id: string;
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* The correct answer for the question. Used for short answer questions. Only
|
|
194
|
+
* visible to admins (users with courses:update permission)
|
|
195
|
+
*/
|
|
196
|
+
correct_answer: string | null;
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* When the question was created
|
|
200
|
+
*/
|
|
201
|
+
created_at: string;
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Optional image attachment for the question
|
|
205
|
+
*/
|
|
206
|
+
image: AssessmentQuestion.Image | null;
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* The answer options for multiple choice/select questions
|
|
210
|
+
*/
|
|
211
|
+
options: Array<AssessmentQuestion.Option>;
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* The order of the question within its lesson
|
|
215
|
+
*/
|
|
216
|
+
order: number;
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* The text of the question
|
|
220
|
+
*/
|
|
221
|
+
question_text: string;
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* The type of the question
|
|
225
|
+
*/
|
|
226
|
+
question_type: CourseLessonsAPI.AssessmentQuestionTypes;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
export namespace AssessmentQuestion {
|
|
230
|
+
/**
|
|
231
|
+
* Optional image attachment for the question
|
|
232
|
+
*/
|
|
233
|
+
export interface Image {
|
|
234
|
+
/**
|
|
235
|
+
* The ID of the attachment
|
|
236
|
+
*/
|
|
237
|
+
id: string;
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* The attachment's content type (e.g., image/jpg, video/mp4)
|
|
241
|
+
*/
|
|
242
|
+
content_type: string | null;
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* The name of the file
|
|
246
|
+
*/
|
|
247
|
+
filename: string | null;
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* This is the URL you use to render optimized attachments on the client. This
|
|
251
|
+
* should be used for apps.
|
|
252
|
+
*/
|
|
253
|
+
url: string | null;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* An answer option for a multiple choice or multiple select assessment question
|
|
258
|
+
*/
|
|
259
|
+
export interface Option {
|
|
260
|
+
/**
|
|
261
|
+
* The ID of the assessment question option
|
|
262
|
+
*/
|
|
263
|
+
id: string;
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* Whether this option is a correct answer. Only visible to admins (users with
|
|
267
|
+
* courses:update permission)
|
|
268
|
+
*/
|
|
269
|
+
is_correct: boolean | null;
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* The text of the answer option
|
|
273
|
+
*/
|
|
274
|
+
option_text: string;
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* The order of this option within the question
|
|
278
|
+
*/
|
|
279
|
+
order: number;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* Represents an image attachment
|
|
285
|
+
*/
|
|
286
|
+
export interface Attachment {
|
|
287
|
+
/**
|
|
288
|
+
* The ID of the attachment
|
|
289
|
+
*/
|
|
290
|
+
id: string;
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* The attachment's content type (e.g., image/jpg, video/mp4)
|
|
294
|
+
*/
|
|
295
|
+
content_type: string | null;
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* The name of the file
|
|
299
|
+
*/
|
|
300
|
+
filename: string | null;
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* This is the URL you use to render optimized attachments on the client. This
|
|
304
|
+
* should be used for apps.
|
|
305
|
+
*/
|
|
306
|
+
url: string | null;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* The main PDF file for this lesson
|
|
311
|
+
*/
|
|
312
|
+
export interface MainPdf {
|
|
313
|
+
/**
|
|
314
|
+
* The ID of the attachment
|
|
315
|
+
*/
|
|
316
|
+
id: string;
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* The attachment's content type (e.g., image/jpg, video/mp4)
|
|
320
|
+
*/
|
|
321
|
+
content_type: string | null;
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* The name of the file
|
|
325
|
+
*/
|
|
326
|
+
filename: string | null;
|
|
327
|
+
|
|
328
|
+
/**
|
|
329
|
+
* This is the URL you use to render optimized attachments on the client. This
|
|
330
|
+
* should be used for apps.
|
|
331
|
+
*/
|
|
332
|
+
url: string | null;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* The associated Mux asset for video lessons
|
|
337
|
+
*/
|
|
338
|
+
export interface VideoAsset {
|
|
339
|
+
/**
|
|
340
|
+
* The ID of the Mux asset
|
|
341
|
+
*/
|
|
342
|
+
id: string;
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
* The Mux-provided ID of the asset
|
|
346
|
+
*/
|
|
347
|
+
asset_id: string | null;
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* The public playback ID of the Mux asset
|
|
351
|
+
*/
|
|
352
|
+
playback_id: string | null;
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* The available types for a lesson
|
|
358
|
+
*/
|
|
359
|
+
export type LessonTypes = 'text' | 'video' | 'pdf' | 'multi' | 'quiz' | 'knowledge_check';
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
* The available visibilities for a lesson. Determines how / whether a lesson is
|
|
363
|
+
* visible to users.
|
|
364
|
+
*/
|
|
365
|
+
export type LessonVisibilities = 'visible' | 'hidden';
|
|
366
|
+
|
|
367
|
+
/**
|
|
368
|
+
* A lesson from the courses app
|
|
369
|
+
*/
|
|
370
|
+
export interface CourseLessonListResponse {
|
|
371
|
+
/**
|
|
372
|
+
* The ID of the lesson
|
|
373
|
+
*/
|
|
374
|
+
id: string;
|
|
375
|
+
|
|
376
|
+
/**
|
|
377
|
+
* The content of the lesson
|
|
378
|
+
*/
|
|
379
|
+
content: string | null;
|
|
380
|
+
|
|
381
|
+
/**
|
|
382
|
+
* Number of days from course start until the lesson is unlocked
|
|
383
|
+
*/
|
|
384
|
+
days_from_course_start_until_unlock: number | null;
|
|
385
|
+
|
|
386
|
+
/**
|
|
387
|
+
* The type of the lesson (text, video, pdf, multi, quiz, knowledge_check)
|
|
388
|
+
*/
|
|
389
|
+
lesson_type: LessonTypes;
|
|
390
|
+
|
|
391
|
+
/**
|
|
392
|
+
* The order of the lesson within its chapter
|
|
393
|
+
*/
|
|
394
|
+
order: number;
|
|
395
|
+
|
|
396
|
+
/**
|
|
397
|
+
* The title of the lesson
|
|
398
|
+
*/
|
|
399
|
+
title: string;
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* The visibility of the lesson. Determines how / whether this lesson is visible to
|
|
403
|
+
* users.
|
|
404
|
+
*/
|
|
405
|
+
visibility: LessonVisibilities;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
/**
|
|
409
|
+
* Represents `true` or `false` values.
|
|
410
|
+
*/
|
|
411
|
+
export type CourseLessonDeleteResponse = boolean;
|
|
412
|
+
|
|
413
|
+
export interface CourseLessonCreateParams {
|
|
414
|
+
/**
|
|
415
|
+
* The ID of the chapter to create the lesson in
|
|
416
|
+
*/
|
|
417
|
+
chapter_id: string;
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* The type of the lesson
|
|
421
|
+
*/
|
|
422
|
+
lesson_type: LessonTypes;
|
|
423
|
+
|
|
424
|
+
/**
|
|
425
|
+
* The content of the lesson
|
|
426
|
+
*/
|
|
427
|
+
content?: string | null;
|
|
428
|
+
|
|
429
|
+
/**
|
|
430
|
+
* Days from course start until unlock
|
|
431
|
+
*/
|
|
432
|
+
days_from_course_start_until_unlock?: number | null;
|
|
433
|
+
|
|
434
|
+
/**
|
|
435
|
+
* The title of the lesson
|
|
436
|
+
*/
|
|
437
|
+
title?: string | null;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
export interface CourseLessonUpdateParams {
|
|
441
|
+
/**
|
|
442
|
+
* Completion requirements for quiz/knowledge check lessons
|
|
443
|
+
*/
|
|
444
|
+
assessment_completion_requirement?: CourseLessonUpdateParams.AssessmentCompletionRequirement | null;
|
|
445
|
+
|
|
446
|
+
/**
|
|
447
|
+
* Assessment questions for quiz/knowledge check lessons. Replaces all existing
|
|
448
|
+
* questions.
|
|
449
|
+
*/
|
|
450
|
+
assessment_questions?: Array<CourseLessonUpdateParams.AssessmentQuestion> | null;
|
|
451
|
+
|
|
452
|
+
/**
|
|
453
|
+
* General attachments for the lesson (PDFs, files, etc). Replaces all existing
|
|
454
|
+
* attachments.
|
|
455
|
+
*/
|
|
456
|
+
attachments?: Array<
|
|
457
|
+
| CourseLessonUpdateParams.AttachmentInputWithDirectUploadID
|
|
458
|
+
| CourseLessonUpdateParams.AttachmentInputWithID
|
|
459
|
+
> | null;
|
|
460
|
+
|
|
461
|
+
/**
|
|
462
|
+
* The content of the lesson
|
|
463
|
+
*/
|
|
464
|
+
content?: string | null;
|
|
465
|
+
|
|
466
|
+
/**
|
|
467
|
+
* Days from course start until unlock
|
|
468
|
+
*/
|
|
469
|
+
days_from_course_start_until_unlock?: number | null;
|
|
470
|
+
|
|
471
|
+
/**
|
|
472
|
+
* The available types for a lesson
|
|
473
|
+
*/
|
|
474
|
+
lesson_type?: LessonTypes | null;
|
|
475
|
+
|
|
476
|
+
/**
|
|
477
|
+
* The main PDF file for this lesson
|
|
478
|
+
*/
|
|
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;
|
|
488
|
+
|
|
489
|
+
/**
|
|
490
|
+
* The ID of the Mux asset to attach to this lesson for video lessons
|
|
491
|
+
*/
|
|
492
|
+
mux_asset_id?: string | null;
|
|
493
|
+
|
|
494
|
+
/**
|
|
495
|
+
* The title of the lesson
|
|
496
|
+
*/
|
|
497
|
+
title?: string | null;
|
|
498
|
+
|
|
499
|
+
/**
|
|
500
|
+
* The available visibilities for a lesson. Determines how / whether a lesson is
|
|
501
|
+
* visible to users.
|
|
502
|
+
*/
|
|
503
|
+
visibility?: LessonVisibilities | null;
|
|
504
|
+
}
|
|
505
|
+
|
|
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
|
+
|
|
524
|
+
/**
|
|
525
|
+
* Input for creating or updating an assessment question
|
|
526
|
+
*/
|
|
527
|
+
export interface AssessmentQuestion {
|
|
528
|
+
/**
|
|
529
|
+
* The correct answer for the question. Used for short answer questions
|
|
530
|
+
*/
|
|
531
|
+
correct_answer: string;
|
|
532
|
+
|
|
533
|
+
/**
|
|
534
|
+
* The text of the question
|
|
535
|
+
*/
|
|
536
|
+
question_text: string;
|
|
537
|
+
|
|
538
|
+
/**
|
|
539
|
+
* The type of the question
|
|
540
|
+
*/
|
|
541
|
+
question_type: CourseLessonsAPI.AssessmentQuestionTypes;
|
|
542
|
+
|
|
543
|
+
/**
|
|
544
|
+
* The ID of an existing question. If provided, the question will be updated. If
|
|
545
|
+
* not provided, a new question will be created.
|
|
546
|
+
*/
|
|
547
|
+
id?: string | null;
|
|
548
|
+
|
|
549
|
+
/**
|
|
550
|
+
* Optional image attachment for the question
|
|
551
|
+
*/
|
|
552
|
+
image?:
|
|
553
|
+
| AssessmentQuestion.AttachmentInputWithDirectUploadID
|
|
554
|
+
| AssessmentQuestion.AttachmentInputWithID
|
|
555
|
+
| null;
|
|
556
|
+
|
|
557
|
+
/**
|
|
558
|
+
* The answer options for multiple choice/select questions
|
|
559
|
+
*/
|
|
560
|
+
options?: Array<AssessmentQuestion.Option> | null;
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
export namespace AssessmentQuestion {
|
|
564
|
+
/**
|
|
565
|
+
* Input for an attachment
|
|
566
|
+
*/
|
|
567
|
+
export interface AttachmentInputWithDirectUploadID {
|
|
568
|
+
/**
|
|
569
|
+
* This ID should be used the first time you upload an attachment. It is the ID of
|
|
570
|
+
* the direct upload that was created when uploading the file to S3 via the
|
|
571
|
+
* mediaDirectUpload mutation.
|
|
572
|
+
*/
|
|
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;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
/**
|
|
589
|
+
* Input for creating or updating an assessment question option
|
|
590
|
+
*/
|
|
591
|
+
export interface Option {
|
|
592
|
+
/**
|
|
593
|
+
* Whether this option is a correct answer
|
|
594
|
+
*/
|
|
595
|
+
is_correct: boolean;
|
|
596
|
+
|
|
597
|
+
/**
|
|
598
|
+
* The text of the answer option
|
|
599
|
+
*/
|
|
600
|
+
option_text: string;
|
|
601
|
+
|
|
602
|
+
/**
|
|
603
|
+
* The ID of an existing option. If provided, the option will be updated. If not
|
|
604
|
+
* provided, a new option will be created.
|
|
605
|
+
*/
|
|
606
|
+
id?: string | null;
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
/**
|
|
611
|
+
* Input for an attachment
|
|
612
|
+
*/
|
|
613
|
+
export interface AttachmentInputWithDirectUploadID {
|
|
614
|
+
/**
|
|
615
|
+
* This ID should be used the first time you upload an attachment. It is the ID of
|
|
616
|
+
* the direct upload that was created when uploading the file to S3 via the
|
|
617
|
+
* mediaDirectUpload mutation.
|
|
618
|
+
*/
|
|
619
|
+
direct_upload_id: string;
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
/**
|
|
623
|
+
* Input for an attachment
|
|
624
|
+
*/
|
|
625
|
+
export interface AttachmentInputWithID {
|
|
626
|
+
/**
|
|
627
|
+
* The ID of an existing attachment object. Use this when updating a resource and
|
|
628
|
+
* keeping a subset of the attachments. Don't use this unless you know what you're
|
|
629
|
+
* doing.
|
|
630
|
+
*/
|
|
631
|
+
id: string;
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
/**
|
|
635
|
+
* Input for an attachment
|
|
636
|
+
*/
|
|
637
|
+
export interface AttachmentInputWithDirectUploadID {
|
|
638
|
+
/**
|
|
639
|
+
* This ID should be used the first time you upload an attachment. It is the ID of
|
|
640
|
+
* the direct upload that was created when uploading the file to S3 via the
|
|
641
|
+
* mediaDirectUpload mutation.
|
|
642
|
+
*/
|
|
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;
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
export interface CourseLessonListParams extends CursorPageParams {
|
|
660
|
+
/**
|
|
661
|
+
* Returns the elements in the list that come before the specified cursor.
|
|
662
|
+
*/
|
|
663
|
+
before?: string | null;
|
|
664
|
+
|
|
665
|
+
/**
|
|
666
|
+
* The ID of the chapter (returns lessons only for this chapter)
|
|
667
|
+
*/
|
|
668
|
+
chapter_id?: string | null;
|
|
669
|
+
|
|
670
|
+
/**
|
|
671
|
+
* The ID of the course (returns all lessons across all chapters)
|
|
672
|
+
*/
|
|
673
|
+
course_id?: string | null;
|
|
674
|
+
|
|
675
|
+
/**
|
|
676
|
+
* Returns the first _n_ elements from the list.
|
|
677
|
+
*/
|
|
678
|
+
first?: number | null;
|
|
679
|
+
|
|
680
|
+
/**
|
|
681
|
+
* Returns the last _n_ elements from the list.
|
|
682
|
+
*/
|
|
683
|
+
last?: number | null;
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
export declare namespace CourseLessons {
|
|
687
|
+
export {
|
|
688
|
+
type AssessmentQuestionTypes as AssessmentQuestionTypes,
|
|
689
|
+
type Lesson as Lesson,
|
|
690
|
+
type LessonTypes as LessonTypes,
|
|
691
|
+
type LessonVisibilities as LessonVisibilities,
|
|
692
|
+
type CourseLessonListResponse as CourseLessonListResponse,
|
|
693
|
+
type CourseLessonDeleteResponse as CourseLessonDeleteResponse,
|
|
694
|
+
type CourseLessonListResponsesCursorPage as CourseLessonListResponsesCursorPage,
|
|
695
|
+
type CourseLessonCreateParams as CourseLessonCreateParams,
|
|
696
|
+
type CourseLessonUpdateParams as CourseLessonUpdateParams,
|
|
697
|
+
type CourseLessonListParams as CourseLessonListParams,
|
|
698
|
+
};
|
|
699
|
+
}
|