@whop/sdk 0.0.2 → 0.0.3

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 (145) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/client.d.mts +23 -8
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +23 -8
  5. package/client.d.ts.map +1 -1
  6. package/client.js +16 -1
  7. package/client.js.map +1 -1
  8. package/client.mjs +16 -1
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/checkout-configurations.d.mts +76 -2
  12. package/resources/checkout-configurations.d.mts.map +1 -1
  13. package/resources/checkout-configurations.d.ts +76 -2
  14. package/resources/checkout-configurations.d.ts.map +1 -1
  15. package/resources/checkout-configurations.js +2 -0
  16. package/resources/checkout-configurations.js.map +1 -1
  17. package/resources/checkout-configurations.mjs +2 -0
  18. package/resources/checkout-configurations.mjs.map +1 -1
  19. package/resources/course-chapters.d.mts +185 -0
  20. package/resources/course-chapters.d.mts.map +1 -0
  21. package/resources/course-chapters.d.ts +185 -0
  22. package/resources/course-chapters.d.ts.map +1 -0
  23. package/resources/course-chapters.js +103 -0
  24. package/resources/course-chapters.js.map +1 -0
  25. package/resources/course-chapters.mjs +99 -0
  26. package/resources/course-chapters.mjs.map +1 -0
  27. package/resources/course-lessons.d.mts +523 -0
  28. package/resources/course-lessons.d.mts.map +1 -0
  29. package/resources/course-lessons.d.ts +523 -0
  30. package/resources/course-lessons.d.ts.map +1 -0
  31. package/resources/course-lessons.js +101 -0
  32. package/resources/course-lessons.js.map +1 -0
  33. package/resources/course-lessons.mjs +97 -0
  34. package/resources/course-lessons.mjs.map +1 -0
  35. package/resources/courses.d.mts +465 -0
  36. package/resources/courses.d.mts.map +1 -0
  37. package/resources/courses.d.ts +465 -0
  38. package/resources/courses.d.ts.map +1 -0
  39. package/resources/courses.js +98 -0
  40. package/resources/courses.js.map +1 -0
  41. package/resources/courses.mjs +94 -0
  42. package/resources/courses.mjs.map +1 -0
  43. package/resources/experiences.d.mts +27 -1
  44. package/resources/experiences.d.mts.map +1 -1
  45. package/resources/experiences.d.ts +27 -1
  46. package/resources/experiences.d.ts.map +1 -1
  47. package/resources/experiences.js +22 -0
  48. package/resources/experiences.js.map +1 -1
  49. package/resources/experiences.mjs +22 -0
  50. package/resources/experiences.mjs.map +1 -1
  51. package/resources/forum-posts.d.mts +56 -1
  52. package/resources/forum-posts.d.mts.map +1 -1
  53. package/resources/forum-posts.d.ts +56 -1
  54. package/resources/forum-posts.d.ts.map +1 -1
  55. package/resources/forum-posts.js +11 -0
  56. package/resources/forum-posts.js.map +1 -1
  57. package/resources/forum-posts.mjs +11 -0
  58. package/resources/forum-posts.mjs.map +1 -1
  59. package/resources/index.d.mts +9 -4
  60. package/resources/index.d.mts.map +1 -1
  61. package/resources/index.d.ts +9 -4
  62. package/resources/index.d.ts.map +1 -1
  63. package/resources/index.js +11 -1
  64. package/resources/index.js.map +1 -1
  65. package/resources/index.mjs +5 -0
  66. package/resources/index.mjs.map +1 -1
  67. package/resources/ledger-accounts.d.mts +1 -1
  68. package/resources/ledger-accounts.d.mts.map +1 -1
  69. package/resources/ledger-accounts.d.ts +1 -1
  70. package/resources/ledger-accounts.d.ts.map +1 -1
  71. package/resources/members.d.mts +4 -0
  72. package/resources/members.d.mts.map +1 -1
  73. package/resources/members.d.ts +4 -0
  74. package/resources/members.d.ts.map +1 -1
  75. package/resources/memberships.d.mts +26 -5
  76. package/resources/memberships.d.mts.map +1 -1
  77. package/resources/memberships.d.ts +26 -5
  78. package/resources/memberships.d.ts.map +1 -1
  79. package/resources/memberships.js +1 -1
  80. package/resources/memberships.js.map +1 -1
  81. package/resources/memberships.mjs +1 -1
  82. package/resources/memberships.mjs.map +1 -1
  83. package/resources/messages.d.mts +38 -1
  84. package/resources/messages.d.mts.map +1 -1
  85. package/resources/messages.d.ts +38 -1
  86. package/resources/messages.d.ts.map +1 -1
  87. package/resources/messages.js +6 -0
  88. package/resources/messages.js.map +1 -1
  89. package/resources/messages.mjs +6 -0
  90. package/resources/messages.mjs.map +1 -1
  91. package/resources/payments.d.mts +28 -13
  92. package/resources/payments.d.mts.map +1 -1
  93. package/resources/payments.d.ts +28 -13
  94. package/resources/payments.d.ts.map +1 -1
  95. package/resources/plans.d.mts +49 -1
  96. package/resources/plans.d.mts.map +1 -1
  97. package/resources/plans.d.ts +49 -1
  98. package/resources/plans.d.ts.map +1 -1
  99. package/resources/products.d.mts +17 -25
  100. package/resources/products.d.mts.map +1 -1
  101. package/resources/products.d.ts +17 -25
  102. package/resources/products.d.ts.map +1 -1
  103. package/resources/promo-codes.d.mts +394 -0
  104. package/resources/promo-codes.d.mts.map +1 -0
  105. package/resources/promo-codes.d.ts +394 -0
  106. package/resources/promo-codes.d.ts.map +1 -0
  107. package/resources/promo-codes.js +91 -0
  108. package/resources/promo-codes.js.map +1 -0
  109. package/resources/promo-codes.mjs +87 -0
  110. package/resources/promo-codes.mjs.map +1 -0
  111. package/resources/reviews.d.mts +277 -0
  112. package/resources/reviews.d.mts.map +1 -0
  113. package/resources/reviews.d.ts +277 -0
  114. package/resources/reviews.d.ts.map +1 -0
  115. package/resources/reviews.js +23 -0
  116. package/resources/reviews.js.map +1 -0
  117. package/resources/reviews.mjs +19 -0
  118. package/resources/reviews.mjs.map +1 -0
  119. package/resources/shared.d.mts +70 -14
  120. package/resources/shared.d.mts.map +1 -1
  121. package/resources/shared.d.ts +70 -14
  122. package/resources/shared.d.ts.map +1 -1
  123. package/src/client.ts +134 -1
  124. package/src/resources/checkout-configurations.ts +91 -2
  125. package/src/resources/course-chapters.ts +236 -0
  126. package/src/resources/course-lessons.ts +646 -0
  127. package/src/resources/courses.ts +594 -0
  128. package/src/resources/experiences.ts +35 -0
  129. package/src/resources/forum-posts.ts +71 -0
  130. package/src/resources/index.ts +59 -0
  131. package/src/resources/ledger-accounts.ts +13 -1
  132. package/src/resources/members.ts +5 -0
  133. package/src/resources/memberships.ts +31 -6
  134. package/src/resources/messages.ts +50 -0
  135. package/src/resources/payments.ts +139 -19
  136. package/src/resources/plans.ts +60 -1
  137. package/src/resources/products.ts +20 -29
  138. package/src/resources/promo-codes.ts +490 -0
  139. package/src/resources/reviews.ts +348 -0
  140. package/src/resources/shared.ts +80 -14
  141. package/src/version.ts +1 -1
  142. package/version.d.mts +1 -1
  143. package/version.d.ts +1 -1
  144. package/version.js +1 -1
  145. package/version.mjs +1 -1
@@ -0,0 +1,523 @@
1
+ import { APIResource } from "../core/resource.js";
2
+ import * as CourseLessonsAPI from "./course-lessons.js";
3
+ import { APIPromise } from "../core/api-promise.js";
4
+ import { CursorPage, type CursorPageParams, PagePromise } from "../core/pagination.js";
5
+ import { RequestOptions } from "../internal/request-options.js";
6
+ export declare class CourseLessons extends APIResource {
7
+ /**
8
+ * Creates a new course lesson
9
+ *
10
+ * Required permissions:
11
+ *
12
+ * - `courses:update`
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * const lesson = await client.courseLessons.create({
17
+ * chapter_id: 'chap_xxxxxxxxxxxxx',
18
+ * lesson_type: 'text',
19
+ * });
20
+ * ```
21
+ */
22
+ create(body: CourseLessonCreateParams, options?: RequestOptions): APIPromise<Lesson>;
23
+ /**
24
+ * Retrieves a course lesson by ID
25
+ *
26
+ * Required permissions:
27
+ *
28
+ * - `courses:read`
29
+ *
30
+ * @example
31
+ * ```ts
32
+ * const lesson = await client.courseLessons.retrieve(
33
+ * 'lesn_xxxxxxxxxxxxx',
34
+ * );
35
+ * ```
36
+ */
37
+ retrieve(id: string, options?: RequestOptions): APIPromise<Lesson>;
38
+ /**
39
+ * Updates a course lesson
40
+ *
41
+ * Required permissions:
42
+ *
43
+ * - `courses:update`
44
+ *
45
+ * @example
46
+ * ```ts
47
+ * const lesson = await client.courseLessons.update(
48
+ * 'lesn_xxxxxxxxxxxxx',
49
+ * );
50
+ * ```
51
+ */
52
+ update(id: string, body?: CourseLessonUpdateParams | null | undefined, options?: RequestOptions): APIPromise<Lesson>;
53
+ /**
54
+ * Lists lessons for a course or chapter
55
+ *
56
+ * Required permissions:
57
+ *
58
+ * - `courses:read`
59
+ *
60
+ * @example
61
+ * ```ts
62
+ * // Automatically fetches more pages as needed.
63
+ * for await (const courseLessonListResponse of client.courseLessons.list()) {
64
+ * // ...
65
+ * }
66
+ * ```
67
+ */
68
+ list(query?: CourseLessonListParams | null | undefined, options?: RequestOptions): PagePromise<CourseLessonListResponsesCursorPage, CourseLessonListResponse>;
69
+ /**
70
+ * Deletes a course lesson
71
+ *
72
+ * Required permissions:
73
+ *
74
+ * - `courses:update`
75
+ *
76
+ * @example
77
+ * ```ts
78
+ * const courseLesson = await client.courseLessons.delete(
79
+ * 'lesn_xxxxxxxxxxxxx',
80
+ * );
81
+ * ```
82
+ */
83
+ delete(id: string, options?: RequestOptions): APIPromise<CourseLessonDeleteResponse>;
84
+ }
85
+ export type CourseLessonListResponsesCursorPage = CursorPage<CourseLessonListResponse>;
86
+ /**
87
+ * The available types for an assessment question
88
+ */
89
+ export type AssessmentQuestionTypes = 'short_answer' | 'true_false' | 'multiple_choice' | 'multiple_select';
90
+ /**
91
+ * A lesson from the courses app
92
+ */
93
+ export interface Lesson {
94
+ /**
95
+ * The ID of the lesson
96
+ */
97
+ id: string;
98
+ /**
99
+ * Assessment questions for quiz/knowledge check lessons
100
+ */
101
+ assessment_questions: Array<Lesson.AssessmentQuestion>;
102
+ /**
103
+ * The attached files in this lesson as a flat array
104
+ */
105
+ attachments: Array<Lesson.Attachment>;
106
+ /**
107
+ * The content of the lesson
108
+ */
109
+ content: string | null;
110
+ /**
111
+ * Number of days from course start until the lesson is unlocked
112
+ */
113
+ days_from_course_start_until_unlock: number | null;
114
+ /**
115
+ * The type of the lesson (text, video, pdf, multi, quiz, knowledge_check)
116
+ */
117
+ lesson_type: LessonTypes;
118
+ /**
119
+ * The main PDF file for this lesson
120
+ */
121
+ main_pdf: Lesson.MainPdf | null;
122
+ /**
123
+ * The order of the lesson within its chapter
124
+ */
125
+ order: number;
126
+ /**
127
+ * The title of the lesson
128
+ */
129
+ title: string;
130
+ /**
131
+ * The associated Mux asset for video lessons
132
+ */
133
+ video_asset: Lesson.VideoAsset | null;
134
+ /**
135
+ * The visibility of the lesson. Determines how / whether this lesson is visible to
136
+ * users.
137
+ */
138
+ visibility: LessonVisibilities;
139
+ }
140
+ export declare namespace Lesson {
141
+ /**
142
+ * An assessment question in a course quiz or knowledge check
143
+ */
144
+ interface AssessmentQuestion {
145
+ /**
146
+ * The ID of the assessment question
147
+ */
148
+ id: string;
149
+ /**
150
+ * The correct answer for the question. Used for short answer questions
151
+ */
152
+ correct_answer: string;
153
+ /**
154
+ * When the question was created
155
+ */
156
+ created_at: string;
157
+ /**
158
+ * Optional image attachment for the question
159
+ */
160
+ image: AssessmentQuestion.Image | null;
161
+ /**
162
+ * The answer options for multiple choice/select questions
163
+ */
164
+ options: Array<AssessmentQuestion.Option>;
165
+ /**
166
+ * The order of the question within its lesson
167
+ */
168
+ order: number;
169
+ /**
170
+ * The text of the question
171
+ */
172
+ question_text: string;
173
+ /**
174
+ * The type of the question
175
+ */
176
+ question_type: CourseLessonsAPI.AssessmentQuestionTypes;
177
+ }
178
+ namespace AssessmentQuestion {
179
+ /**
180
+ * Optional image attachment for the question
181
+ */
182
+ interface Image {
183
+ /**
184
+ * The ID of the attachment
185
+ */
186
+ id: string;
187
+ /**
188
+ * The attachment's content type (e.g., image/jpg, video/mp4)
189
+ */
190
+ content_type: string | null;
191
+ /**
192
+ * The name of the file
193
+ */
194
+ filename: string | null;
195
+ /**
196
+ * This is the URL you use to render optimized attachments on the client. This
197
+ * should be used for apps.
198
+ */
199
+ url: string | null;
200
+ }
201
+ /**
202
+ * An answer option for a multiple choice or multiple select assessment question
203
+ */
204
+ interface Option {
205
+ /**
206
+ * The ID of the assessment question option
207
+ */
208
+ id: string;
209
+ /**
210
+ * Whether this option is a correct answer
211
+ */
212
+ is_correct: boolean;
213
+ /**
214
+ * The text of the answer option
215
+ */
216
+ option_text: string;
217
+ /**
218
+ * The order of this option within the question
219
+ */
220
+ order: number;
221
+ }
222
+ }
223
+ /**
224
+ * Represents an image attachment
225
+ */
226
+ interface Attachment {
227
+ /**
228
+ * The ID of the attachment
229
+ */
230
+ id: string;
231
+ /**
232
+ * The attachment's content type (e.g., image/jpg, video/mp4)
233
+ */
234
+ content_type: string | null;
235
+ /**
236
+ * The name of the file
237
+ */
238
+ filename: string | null;
239
+ /**
240
+ * This is the URL you use to render optimized attachments on the client. This
241
+ * should be used for apps.
242
+ */
243
+ url: string | null;
244
+ }
245
+ /**
246
+ * The main PDF file for this lesson
247
+ */
248
+ interface MainPdf {
249
+ /**
250
+ * The ID of the attachment
251
+ */
252
+ id: string;
253
+ /**
254
+ * The attachment's content type (e.g., image/jpg, video/mp4)
255
+ */
256
+ content_type: string | null;
257
+ /**
258
+ * The name of the file
259
+ */
260
+ filename: string | null;
261
+ /**
262
+ * This is the URL you use to render optimized attachments on the client. This
263
+ * should be used for apps.
264
+ */
265
+ url: string | null;
266
+ }
267
+ /**
268
+ * The associated Mux asset for video lessons
269
+ */
270
+ interface VideoAsset {
271
+ /**
272
+ * The ID of the Mux asset
273
+ */
274
+ id: string;
275
+ /**
276
+ * The Mux-provided ID of the asset
277
+ */
278
+ asset_id: string | null;
279
+ /**
280
+ * The public playback ID of the Mux asset
281
+ */
282
+ playback_id: string | null;
283
+ }
284
+ }
285
+ /**
286
+ * The available types for a lesson
287
+ */
288
+ export type LessonTypes = 'text' | 'video' | 'pdf' | 'multi' | 'quiz' | 'knowledge_check';
289
+ /**
290
+ * The available visibilities for a lesson. Determines how / whether a lesson is
291
+ * visible to users.
292
+ */
293
+ export type LessonVisibilities = 'visible' | 'hidden';
294
+ /**
295
+ * A lesson from the courses app
296
+ */
297
+ export interface CourseLessonListResponse {
298
+ /**
299
+ * The ID of the lesson
300
+ */
301
+ id: string;
302
+ /**
303
+ * The content of the lesson
304
+ */
305
+ content: string | null;
306
+ /**
307
+ * Number of days from course start until the lesson is unlocked
308
+ */
309
+ days_from_course_start_until_unlock: number | null;
310
+ /**
311
+ * The type of the lesson (text, video, pdf, multi, quiz, knowledge_check)
312
+ */
313
+ lesson_type: LessonTypes;
314
+ /**
315
+ * The order of the lesson within its chapter
316
+ */
317
+ order: number;
318
+ /**
319
+ * The title of the lesson
320
+ */
321
+ title: string;
322
+ /**
323
+ * The visibility of the lesson. Determines how / whether this lesson is visible to
324
+ * users.
325
+ */
326
+ visibility: LessonVisibilities;
327
+ }
328
+ /**
329
+ * Represents `true` or `false` values.
330
+ */
331
+ export type CourseLessonDeleteResponse = boolean;
332
+ export interface CourseLessonCreateParams {
333
+ /**
334
+ * The ID of the chapter to create the lesson in
335
+ */
336
+ chapter_id: string;
337
+ /**
338
+ * The type of the lesson
339
+ */
340
+ lesson_type: LessonTypes;
341
+ /**
342
+ * The content of the lesson
343
+ */
344
+ content?: string | null;
345
+ /**
346
+ * Days from course start until unlock
347
+ */
348
+ days_from_course_start_until_unlock?: number | null;
349
+ /**
350
+ * The title of the lesson
351
+ */
352
+ title?: string | null;
353
+ }
354
+ export interface CourseLessonUpdateParams {
355
+ /**
356
+ * Assessment questions for quiz/knowledge check lessons. Replaces all existing
357
+ * questions.
358
+ */
359
+ assessment_questions?: Array<CourseLessonUpdateParams.AssessmentQuestion> | null;
360
+ /**
361
+ * General attachments for the lesson (PDFs, files, etc). Replaces all existing
362
+ * attachments.
363
+ */
364
+ attachments?: Array<CourseLessonUpdateParams.Attachment> | null;
365
+ /**
366
+ * The content of the lesson
367
+ */
368
+ content?: string | null;
369
+ /**
370
+ * Days from course start until unlock
371
+ */
372
+ days_from_course_start_until_unlock?: number | null;
373
+ /**
374
+ * The available types for a lesson
375
+ */
376
+ lesson_type?: LessonTypes | null;
377
+ /**
378
+ * The main PDF file for this lesson
379
+ */
380
+ main_pdf?: CourseLessonUpdateParams.MainPdf | null;
381
+ /**
382
+ * The ID of the Mux asset to attach to this lesson for video lessons
383
+ */
384
+ mux_asset_id?: string | null;
385
+ /**
386
+ * The title of the lesson
387
+ */
388
+ title?: string | null;
389
+ /**
390
+ * The available visibilities for a lesson. Determines how / whether a lesson is
391
+ * visible to users.
392
+ */
393
+ visibility?: LessonVisibilities | null;
394
+ }
395
+ export declare namespace CourseLessonUpdateParams {
396
+ /**
397
+ * Input for creating or updating an assessment question
398
+ */
399
+ interface AssessmentQuestion {
400
+ /**
401
+ * The correct answer for the question. Used for short answer questions
402
+ */
403
+ correct_answer: string;
404
+ /**
405
+ * The text of the question
406
+ */
407
+ question_text: string;
408
+ /**
409
+ * The type of the question
410
+ */
411
+ question_type: CourseLessonsAPI.AssessmentQuestionTypes;
412
+ /**
413
+ * The ID of an existing question. If provided, the question will be updated. If
414
+ * not provided, a new question will be created.
415
+ */
416
+ id?: string | null;
417
+ /**
418
+ * Optional image attachment for the question
419
+ */
420
+ image?: AssessmentQuestion.Image | null;
421
+ /**
422
+ * The answer options for multiple choice/select questions
423
+ */
424
+ options?: Array<AssessmentQuestion.Option> | null;
425
+ }
426
+ namespace AssessmentQuestion {
427
+ /**
428
+ * Optional image attachment for the question
429
+ */
430
+ interface Image {
431
+ /**
432
+ * The ID of an existing attachment object. Use this when updating a resource and
433
+ * keeping a subset of the attachments. Don't use this unless you know what you're
434
+ * doing.
435
+ */
436
+ id?: string | null;
437
+ /**
438
+ * This ID should be used the first time you upload an attachment. It is the ID of
439
+ * the direct upload that was created when uploading the file to S3 via the
440
+ * mediaDirectUpload mutation.
441
+ */
442
+ direct_upload_id?: string | null;
443
+ }
444
+ /**
445
+ * Input for creating or updating an assessment question option
446
+ */
447
+ interface Option {
448
+ /**
449
+ * Whether this option is a correct answer
450
+ */
451
+ is_correct: boolean;
452
+ /**
453
+ * The text of the answer option
454
+ */
455
+ option_text: string;
456
+ /**
457
+ * The ID of an existing option. If provided, the option will be updated. If not
458
+ * provided, a new option will be created.
459
+ */
460
+ id?: string | null;
461
+ }
462
+ }
463
+ /**
464
+ * Input for an attachment
465
+ */
466
+ interface Attachment {
467
+ /**
468
+ * The ID of an existing attachment object. Use this when updating a resource and
469
+ * keeping a subset of the attachments. Don't use this unless you know what you're
470
+ * doing.
471
+ */
472
+ id?: string | null;
473
+ /**
474
+ * This ID should be used the first time you upload an attachment. It is the ID of
475
+ * the direct upload that was created when uploading the file to S3 via the
476
+ * mediaDirectUpload mutation.
477
+ */
478
+ direct_upload_id?: string | null;
479
+ }
480
+ /**
481
+ * The main PDF file for this lesson
482
+ */
483
+ interface MainPdf {
484
+ /**
485
+ * The ID of an existing attachment object. Use this when updating a resource and
486
+ * keeping a subset of the attachments. Don't use this unless you know what you're
487
+ * doing.
488
+ */
489
+ id?: string | null;
490
+ /**
491
+ * This ID should be used the first time you upload an attachment. It is the ID of
492
+ * the direct upload that was created when uploading the file to S3 via the
493
+ * mediaDirectUpload mutation.
494
+ */
495
+ direct_upload_id?: string | null;
496
+ }
497
+ }
498
+ export interface CourseLessonListParams extends CursorPageParams {
499
+ /**
500
+ * Returns the elements in the list that come before the specified cursor.
501
+ */
502
+ before?: string | null;
503
+ /**
504
+ * The ID of the chapter (returns lessons only for this chapter)
505
+ */
506
+ chapter_id?: string | null;
507
+ /**
508
+ * The ID of the course (returns all lessons across all chapters)
509
+ */
510
+ course_id?: string | null;
511
+ /**
512
+ * Returns the first _n_ elements from the list.
513
+ */
514
+ first?: number | null;
515
+ /**
516
+ * Returns the last _n_ elements from the list.
517
+ */
518
+ last?: number | null;
519
+ }
520
+ export declare namespace CourseLessons {
521
+ export { type AssessmentQuestionTypes as AssessmentQuestionTypes, type Lesson as Lesson, type LessonTypes as LessonTypes, type LessonVisibilities as LessonVisibilities, type CourseLessonListResponse as CourseLessonListResponse, type CourseLessonDeleteResponse as CourseLessonDeleteResponse, type CourseLessonListResponsesCursorPage as CourseLessonListResponsesCursorPage, type CourseLessonCreateParams as CourseLessonCreateParams, type CourseLessonUpdateParams as CourseLessonUpdateParams, type CourseLessonListParams as CourseLessonListParams, };
522
+ }
523
+ //# sourceMappingURL=course-lessons.d.ts.map
@@ -0,0 +1 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,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KAClC;CACF;AAED,MAAM,WAAW,sBAAuB,SAAQ,gBAAgB;IAC9D;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEvB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE3B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE1B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEtB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,WAAW,aAAa,CAAC;IACrC,OAAO,EACL,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,MAAM,IAAI,MAAM,EACrB,KAAK,WAAW,IAAI,WAAW,EAC/B,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,mCAAmC,IAAI,mCAAmC,EAC/E,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;CACH"}
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.CourseLessons = void 0;
5
+ const resource_1 = require("../core/resource.js");
6
+ const pagination_1 = require("../core/pagination.js");
7
+ const path_1 = require("../internal/utils/path.js");
8
+ class CourseLessons extends resource_1.APIResource {
9
+ /**
10
+ * Creates a new course lesson
11
+ *
12
+ * Required permissions:
13
+ *
14
+ * - `courses:update`
15
+ *
16
+ * @example
17
+ * ```ts
18
+ * const lesson = await client.courseLessons.create({
19
+ * chapter_id: 'chap_xxxxxxxxxxxxx',
20
+ * lesson_type: 'text',
21
+ * });
22
+ * ```
23
+ */
24
+ create(body, options) {
25
+ return this._client.post('/course_lessons', { body, ...options });
26
+ }
27
+ /**
28
+ * Retrieves a course lesson by ID
29
+ *
30
+ * Required permissions:
31
+ *
32
+ * - `courses:read`
33
+ *
34
+ * @example
35
+ * ```ts
36
+ * const lesson = await client.courseLessons.retrieve(
37
+ * 'lesn_xxxxxxxxxxxxx',
38
+ * );
39
+ * ```
40
+ */
41
+ retrieve(id, options) {
42
+ return this._client.get((0, path_1.path) `/course_lessons/${id}`, options);
43
+ }
44
+ /**
45
+ * Updates a course lesson
46
+ *
47
+ * Required permissions:
48
+ *
49
+ * - `courses:update`
50
+ *
51
+ * @example
52
+ * ```ts
53
+ * const lesson = await client.courseLessons.update(
54
+ * 'lesn_xxxxxxxxxxxxx',
55
+ * );
56
+ * ```
57
+ */
58
+ update(id, body = {}, options) {
59
+ return this._client.patch((0, path_1.path) `/course_lessons/${id}`, { body, ...options });
60
+ }
61
+ /**
62
+ * Lists lessons for a course or chapter
63
+ *
64
+ * Required permissions:
65
+ *
66
+ * - `courses:read`
67
+ *
68
+ * @example
69
+ * ```ts
70
+ * // Automatically fetches more pages as needed.
71
+ * for await (const courseLessonListResponse of client.courseLessons.list()) {
72
+ * // ...
73
+ * }
74
+ * ```
75
+ */
76
+ list(query = {}, options) {
77
+ return this._client.getAPIList('/course_lessons', (pagination_1.CursorPage), {
78
+ query,
79
+ ...options,
80
+ });
81
+ }
82
+ /**
83
+ * Deletes a course lesson
84
+ *
85
+ * Required permissions:
86
+ *
87
+ * - `courses:update`
88
+ *
89
+ * @example
90
+ * ```ts
91
+ * const courseLesson = await client.courseLessons.delete(
92
+ * 'lesn_xxxxxxxxxxxxx',
93
+ * );
94
+ * ```
95
+ */
96
+ delete(id, options) {
97
+ return this._client.delete((0, path_1.path) `/course_lessons/${id}`, options);
98
+ }
99
+ }
100
+ exports.CourseLessons = CourseLessons;
101
+ //# sourceMappingURL=course-lessons.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"course-lessons.js","sourceRoot":"","sources":["../src/resources/course-lessons.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,sDAAoF;AAEpF,oDAA8C;AAE9C,MAAa,aAAc,SAAQ,sBAAW;IAC5C;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,IAA8B,EAAE,OAAwB;QAC7D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAiB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACpE,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,mBAAmB,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IAChE,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,MAAM,CACJ,EAAU,EACV,OAAoD,EAAE,EACtD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAA,WAAI,EAAA,mBAAmB,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,IAAI,CACF,QAAmD,EAAE,EACrD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,iBAAiB,EAAE,CAAA,uBAAoC,CAAA,EAAE;YACtF,KAAK;YACL,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,EAAU,EAAE,OAAwB;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,mBAAmB,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACnE,CAAC;CACF;AAtGD,sCAsGC"}