@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.
Files changed (196) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/client.d.mts +30 -12
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +30 -12
  5. package/client.d.ts.map +1 -1
  6. package/client.js +19 -1
  7. package/client.js.map +1 -1
  8. package/client.mjs +21 -3
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/app-builds.d.mts +16 -13
  12. package/resources/app-builds.d.mts.map +1 -1
  13. package/resources/app-builds.d.ts +16 -13
  14. package/resources/app-builds.d.ts.map +1 -1
  15. package/resources/app-builds.js +1 -1
  16. package/resources/app-builds.mjs +1 -1
  17. package/resources/apps.d.mts +15 -10
  18. package/resources/apps.d.mts.map +1 -1
  19. package/resources/apps.d.ts +15 -10
  20. package/resources/apps.d.ts.map +1 -1
  21. package/resources/checkout-configurations.d.mts +252 -140
  22. package/resources/checkout-configurations.d.mts.map +1 -1
  23. package/resources/checkout-configurations.d.ts +252 -140
  24. package/resources/checkout-configurations.d.ts.map +1 -1
  25. package/resources/checkout-configurations.js +6 -20
  26. package/resources/checkout-configurations.js.map +1 -1
  27. package/resources/checkout-configurations.mjs +6 -20
  28. package/resources/checkout-configurations.mjs.map +1 -1
  29. package/resources/companies.d.mts +157 -0
  30. package/resources/companies.d.mts.map +1 -1
  31. package/resources/companies.d.ts +157 -0
  32. package/resources/companies.d.ts.map +1 -1
  33. package/resources/companies.js +22 -0
  34. package/resources/companies.js.map +1 -1
  35. package/resources/companies.mjs +22 -0
  36. package/resources/companies.mjs.map +1 -1
  37. package/resources/course-chapters.d.mts +185 -0
  38. package/resources/course-chapters.d.mts.map +1 -0
  39. package/resources/course-chapters.d.ts +185 -0
  40. package/resources/course-chapters.d.ts.map +1 -0
  41. package/resources/course-chapters.js +103 -0
  42. package/resources/course-chapters.js.map +1 -0
  43. package/resources/course-chapters.mjs +99 -0
  44. package/resources/course-chapters.mjs.map +1 -0
  45. package/resources/course-lesson-interactions.d.mts +2 -2
  46. package/resources/course-lesson-interactions.d.ts +2 -2
  47. package/resources/course-lesson-interactions.js +2 -2
  48. package/resources/course-lesson-interactions.mjs +2 -2
  49. package/resources/course-lessons.d.mts +563 -0
  50. package/resources/course-lessons.d.mts.map +1 -0
  51. package/resources/course-lessons.d.ts +563 -0
  52. package/resources/course-lessons.d.ts.map +1 -0
  53. package/resources/course-lessons.js +101 -0
  54. package/resources/course-lessons.js.map +1 -0
  55. package/resources/course-lessons.mjs +97 -0
  56. package/resources/course-lessons.mjs.map +1 -0
  57. package/resources/course-students.d.mts +187 -0
  58. package/resources/course-students.d.mts.map +1 -0
  59. package/resources/course-students.d.ts +187 -0
  60. package/resources/course-students.d.ts.map +1 -0
  61. package/resources/course-students.js +36 -0
  62. package/resources/course-students.js.map +1 -0
  63. package/resources/course-students.mjs +32 -0
  64. package/resources/course-students.mjs.map +1 -0
  65. package/resources/courses.d.mts +485 -0
  66. package/resources/courses.d.mts.map +1 -0
  67. package/resources/courses.d.ts +485 -0
  68. package/resources/courses.d.ts.map +1 -0
  69. package/resources/courses.js +98 -0
  70. package/resources/courses.js.map +1 -0
  71. package/resources/courses.mjs +94 -0
  72. package/resources/courses.mjs.map +1 -0
  73. package/resources/experiences.d.mts +42 -11
  74. package/resources/experiences.d.mts.map +1 -1
  75. package/resources/experiences.d.ts +42 -11
  76. package/resources/experiences.d.ts.map +1 -1
  77. package/resources/experiences.js +22 -0
  78. package/resources/experiences.js.map +1 -1
  79. package/resources/experiences.mjs +22 -0
  80. package/resources/experiences.mjs.map +1 -1
  81. package/resources/forum-posts.d.mts +75 -10
  82. package/resources/forum-posts.d.mts.map +1 -1
  83. package/resources/forum-posts.d.ts +75 -10
  84. package/resources/forum-posts.d.ts.map +1 -1
  85. package/resources/forum-posts.js +11 -0
  86. package/resources/forum-posts.js.map +1 -1
  87. package/resources/forum-posts.mjs +11 -0
  88. package/resources/forum-posts.mjs.map +1 -1
  89. package/resources/index.d.mts +12 -6
  90. package/resources/index.d.mts.map +1 -1
  91. package/resources/index.d.ts +12 -6
  92. package/resources/index.d.ts.map +1 -1
  93. package/resources/index.js +13 -1
  94. package/resources/index.js.map +1 -1
  95. package/resources/index.mjs +7 -1
  96. package/resources/index.mjs.map +1 -1
  97. package/resources/invoices.d.mts +529 -146
  98. package/resources/invoices.d.mts.map +1 -1
  99. package/resources/invoices.d.ts +529 -146
  100. package/resources/invoices.d.ts.map +1 -1
  101. package/resources/invoices.js +2 -24
  102. package/resources/invoices.js.map +1 -1
  103. package/resources/invoices.mjs +2 -24
  104. package/resources/invoices.mjs.map +1 -1
  105. package/resources/ledger-accounts.d.mts +1 -1
  106. package/resources/ledger-accounts.d.mts.map +1 -1
  107. package/resources/ledger-accounts.d.ts +1 -1
  108. package/resources/ledger-accounts.d.ts.map +1 -1
  109. package/resources/members.d.mts +4 -0
  110. package/resources/members.d.mts.map +1 -1
  111. package/resources/members.d.ts +4 -0
  112. package/resources/members.d.ts.map +1 -1
  113. package/resources/memberships.d.mts +26 -5
  114. package/resources/memberships.d.mts.map +1 -1
  115. package/resources/memberships.d.ts +26 -5
  116. package/resources/memberships.d.ts.map +1 -1
  117. package/resources/memberships.js +1 -1
  118. package/resources/memberships.js.map +1 -1
  119. package/resources/memberships.mjs +1 -1
  120. package/resources/memberships.mjs.map +1 -1
  121. package/resources/messages.d.mts +57 -10
  122. package/resources/messages.d.mts.map +1 -1
  123. package/resources/messages.d.ts +57 -10
  124. package/resources/messages.d.ts.map +1 -1
  125. package/resources/messages.js +6 -0
  126. package/resources/messages.js.map +1 -1
  127. package/resources/messages.mjs +6 -0
  128. package/resources/messages.mjs.map +1 -1
  129. package/resources/payments.d.mts +35 -13
  130. package/resources/payments.d.mts.map +1 -1
  131. package/resources/payments.d.ts +35 -13
  132. package/resources/payments.d.ts.map +1 -1
  133. package/resources/plans.d.mts +161 -17
  134. package/resources/plans.d.mts.map +1 -1
  135. package/resources/plans.d.ts +161 -17
  136. package/resources/plans.d.ts.map +1 -1
  137. package/resources/plans.js.map +1 -1
  138. package/resources/plans.mjs.map +1 -1
  139. package/resources/products.d.mts +30 -33
  140. package/resources/products.d.mts.map +1 -1
  141. package/resources/products.d.ts +30 -33
  142. package/resources/products.d.ts.map +1 -1
  143. package/resources/promo-codes.d.mts +394 -0
  144. package/resources/promo-codes.d.mts.map +1 -0
  145. package/resources/promo-codes.d.ts +394 -0
  146. package/resources/promo-codes.d.ts.map +1 -0
  147. package/resources/promo-codes.js +91 -0
  148. package/resources/promo-codes.js.map +1 -0
  149. package/resources/promo-codes.mjs +87 -0
  150. package/resources/promo-codes.mjs.map +1 -0
  151. package/resources/reviews.d.mts +277 -0
  152. package/resources/reviews.d.mts.map +1 -0
  153. package/resources/reviews.d.ts +277 -0
  154. package/resources/reviews.d.ts.map +1 -0
  155. package/resources/reviews.js +23 -0
  156. package/resources/reviews.js.map +1 -0
  157. package/resources/reviews.mjs +19 -0
  158. package/resources/reviews.mjs.map +1 -0
  159. package/resources/shared.d.mts +117 -14
  160. package/resources/shared.d.mts.map +1 -1
  161. package/resources/shared.d.ts +117 -14
  162. package/resources/shared.d.ts.map +1 -1
  163. package/resources/transfers.d.mts +12 -0
  164. package/resources/transfers.d.mts.map +1 -1
  165. package/resources/transfers.d.ts +12 -0
  166. package/resources/transfers.d.ts.map +1 -1
  167. package/src/client.ts +166 -11
  168. package/src/resources/app-builds.ts +19 -14
  169. package/src/resources/apps.ts +16 -11
  170. package/src/resources/checkout-configurations.ts +278 -143
  171. package/src/resources/companies.ts +196 -0
  172. package/src/resources/course-chapters.ts +236 -0
  173. package/src/resources/course-lesson-interactions.ts +2 -2
  174. package/src/resources/course-lessons.ts +699 -0
  175. package/src/resources/course-students.ts +238 -0
  176. package/src/resources/courses.ts +622 -0
  177. package/src/resources/experiences.ts +54 -11
  178. package/src/resources/forum-posts.ts +95 -10
  179. package/src/resources/index.ts +73 -2
  180. package/src/resources/invoices.ts +620 -149
  181. package/src/resources/ledger-accounts.ts +13 -1
  182. package/src/resources/members.ts +5 -0
  183. package/src/resources/memberships.ts +31 -6
  184. package/src/resources/messages.ts +74 -10
  185. package/src/resources/payments.ts +146 -19
  186. package/src/resources/plans.ts +184 -17
  187. package/src/resources/products.ts +36 -37
  188. package/src/resources/promo-codes.ts +490 -0
  189. package/src/resources/reviews.ts +348 -0
  190. package/src/resources/shared.ts +128 -14
  191. package/src/resources/transfers.ts +10 -0
  192. package/src/version.ts +1 -1
  193. package/version.d.mts +1 -1
  194. package/version.d.ts +1 -1
  195. package/version.js +1 -1
  196. 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
+ }