@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,465 @@
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 Courses extends APIResource {
7
+ /**
8
+ * Creates a new course module in an experience
9
+ *
10
+ * Required permissions:
11
+ *
12
+ * - `courses:update`
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * const course = await client.courses.create({
17
+ * experience_id: 'exp_xxxxxxxxxxxxxx',
18
+ * title: 'title',
19
+ * });
20
+ * ```
21
+ */
22
+ create(body: CourseCreateParams, options?: RequestOptions): APIPromise<Course>;
23
+ /**
24
+ * Retrieves a course by ID
25
+ *
26
+ * Required permissions:
27
+ *
28
+ * - `courses:read`
29
+ *
30
+ * @example
31
+ * ```ts
32
+ * const course = await client.courses.retrieve(
33
+ * 'cors_xxxxxxxxxxxxx',
34
+ * );
35
+ * ```
36
+ */
37
+ retrieve(id: string, options?: RequestOptions): APIPromise<Course>;
38
+ /**
39
+ * Updates a course
40
+ *
41
+ * Required permissions:
42
+ *
43
+ * - `courses:update`
44
+ *
45
+ * @example
46
+ * ```ts
47
+ * const course = await client.courses.update(
48
+ * 'cors_xxxxxxxxxxxxx',
49
+ * );
50
+ * ```
51
+ */
52
+ update(id: string, body?: CourseUpdateParams | null | undefined, options?: RequestOptions): APIPromise<Course>;
53
+ /**
54
+ * Lists courses for an experience or company
55
+ *
56
+ * Required permissions:
57
+ *
58
+ * - `courses:read`
59
+ *
60
+ * @example
61
+ * ```ts
62
+ * // Automatically fetches more pages as needed.
63
+ * for await (const courseListResponse of client.courses.list()) {
64
+ * // ...
65
+ * }
66
+ * ```
67
+ */
68
+ list(query?: CourseListParams | null | undefined, options?: RequestOptions): PagePromise<CourseListResponsesCursorPage, CourseListResponse>;
69
+ /**
70
+ * Deletes a course
71
+ *
72
+ * Required permissions:
73
+ *
74
+ * - `courses:update`
75
+ *
76
+ * @example
77
+ * ```ts
78
+ * const course = await client.courses.delete(
79
+ * 'cors_xxxxxxxxxxxxx',
80
+ * );
81
+ * ```
82
+ */
83
+ delete(id: string, options?: RequestOptions): APIPromise<CourseDeleteResponse>;
84
+ }
85
+ export type CourseListResponsesCursorPage = CursorPage<CourseListResponse>;
86
+ /**
87
+ * A course from the courses app
88
+ */
89
+ export interface Course {
90
+ /**
91
+ * The ID of the course. Looks like cors_XXX
92
+ */
93
+ id: string;
94
+ /**
95
+ * Whether the course will award its students a PDF certificate after completing
96
+ * all lessons
97
+ */
98
+ certificate_after_completion_enabled: boolean | null;
99
+ /**
100
+ * The chapters in this course
101
+ */
102
+ chapters: Array<Course.Chapter>;
103
+ /**
104
+ * The timestamp of when the course was created
105
+ */
106
+ created_at: string;
107
+ /**
108
+ * A short description of the course
109
+ */
110
+ description: string | null;
111
+ /**
112
+ * The language spoken in the video content of the course, used to generate closed
113
+ * captions in the right language
114
+ */
115
+ language: Languages;
116
+ /**
117
+ * Whether the course requires students to complete the previous lesson before
118
+ * moving on to the next one
119
+ */
120
+ require_completing_lessons_in_order: boolean;
121
+ /**
122
+ * A short tagline for the course. It is displayed under the course title in the UI
123
+ */
124
+ tagline: string | null;
125
+ /**
126
+ * The thumbnail for the course
127
+ */
128
+ thumbnail: Course.Thumbnail | null;
129
+ /**
130
+ * The title of the course
131
+ */
132
+ title: string | null;
133
+ /**
134
+ * The timestamp of when the course was last updated
135
+ */
136
+ updated_at: string;
137
+ }
138
+ export declare namespace Course {
139
+ /**
140
+ * A chapter from the courses app
141
+ */
142
+ interface Chapter {
143
+ /**
144
+ * The ID of the chapter. Looks like chap_XXX
145
+ */
146
+ id: string;
147
+ /**
148
+ * The lessons in this chapter
149
+ */
150
+ lessons: Array<Chapter.Lesson>;
151
+ /**
152
+ * The order of the chapter within its course
153
+ */
154
+ order: number;
155
+ /**
156
+ * The title of the chapter
157
+ */
158
+ title: string;
159
+ }
160
+ namespace Chapter {
161
+ /**
162
+ * A lesson from the courses app
163
+ */
164
+ interface Lesson {
165
+ /**
166
+ * The ID of the lesson
167
+ */
168
+ id: string;
169
+ /**
170
+ * The type of the lesson (text, video, pdf, multi, quiz, knowledge_check)
171
+ */
172
+ lesson_type: CourseLessonsAPI.LessonTypes;
173
+ /**
174
+ * The order of the lesson within its chapter
175
+ */
176
+ order: number;
177
+ /**
178
+ * The title of the lesson
179
+ */
180
+ title: string;
181
+ }
182
+ }
183
+ /**
184
+ * The thumbnail for the course
185
+ */
186
+ interface Thumbnail {
187
+ /**
188
+ * The ID of the attachment
189
+ */
190
+ id: string;
191
+ /**
192
+ * The attachment's content type (e.g., image/jpg, video/mp4)
193
+ */
194
+ content_type: string | null;
195
+ /**
196
+ * The name of the file
197
+ */
198
+ filename: string | null;
199
+ /**
200
+ * This is the URL you use to render optimized attachments on the client. This
201
+ * should be used for apps.
202
+ */
203
+ optimized_url: string | null;
204
+ /**
205
+ * The original URL of the attachment, such as a direct link to S3. This should
206
+ * never be displayed on the client and always passed to an Imgproxy transformer.
207
+ */
208
+ source_url: string | null;
209
+ }
210
+ }
211
+ /**
212
+ * The available languages for a course
213
+ */
214
+ export type Languages = 'en' | 'es' | 'it' | 'pt' | 'de' | 'fr' | 'pl' | 'ru' | 'nl' | 'ca' | 'tr' | 'sv' | 'uk' | 'no' | 'fi' | 'sk' | 'el' | 'cs' | 'hr' | 'da' | 'ro' | 'bg';
215
+ /**
216
+ * A course from the courses app
217
+ */
218
+ export interface CourseListResponse {
219
+ /**
220
+ * The ID of the course. Looks like cors_XXX
221
+ */
222
+ id: string;
223
+ /**
224
+ * Whether the course will award its students a PDF certificate after completing
225
+ * all lessons
226
+ */
227
+ certificate_after_completion_enabled: boolean | null;
228
+ /**
229
+ * The timestamp of when the course was created
230
+ */
231
+ created_at: string;
232
+ /**
233
+ * A short description of the course
234
+ */
235
+ description: string | null;
236
+ /**
237
+ * The language spoken in the video content of the course, used to generate closed
238
+ * captions in the right language
239
+ */
240
+ language: Languages;
241
+ /**
242
+ * Whether the course requires students to complete the previous lesson before
243
+ * moving on to the next one
244
+ */
245
+ require_completing_lessons_in_order: boolean;
246
+ /**
247
+ * A short tagline for the course. It is displayed under the course title in the UI
248
+ */
249
+ tagline: string | null;
250
+ /**
251
+ * The thumbnail for the course
252
+ */
253
+ thumbnail: CourseListResponse.Thumbnail | null;
254
+ /**
255
+ * The title of the course
256
+ */
257
+ title: string | null;
258
+ /**
259
+ * The timestamp of when the course was last updated
260
+ */
261
+ updated_at: string;
262
+ }
263
+ export declare namespace CourseListResponse {
264
+ /**
265
+ * The thumbnail for the course
266
+ */
267
+ interface Thumbnail {
268
+ /**
269
+ * The ID of the attachment
270
+ */
271
+ id: string;
272
+ /**
273
+ * The attachment's content type (e.g., image/jpg, video/mp4)
274
+ */
275
+ content_type: string | null;
276
+ /**
277
+ * The name of the file
278
+ */
279
+ filename: string | null;
280
+ /**
281
+ * This is the URL you use to render optimized attachments on the client. This
282
+ * should be used for apps.
283
+ */
284
+ optimized_url: string | null;
285
+ /**
286
+ * The original URL of the attachment, such as a direct link to S3. This should
287
+ * never be displayed on the client and always passed to an Imgproxy transformer.
288
+ */
289
+ source_url: string | null;
290
+ }
291
+ }
292
+ /**
293
+ * Represents `true` or `false` values.
294
+ */
295
+ export type CourseDeleteResponse = boolean;
296
+ export interface CourseCreateParams {
297
+ /**
298
+ * The ID of the experience to create the course in
299
+ */
300
+ experience_id: string;
301
+ /**
302
+ * The title of the course
303
+ */
304
+ title: string;
305
+ /**
306
+ * The cover image URL of the course
307
+ */
308
+ cover_image?: string | null;
309
+ /**
310
+ * The tagline of the course
311
+ */
312
+ tagline?: string | null;
313
+ /**
314
+ * The thumbnail for the course in png, jpeg, or gif format
315
+ */
316
+ thumbnail?: CourseCreateParams.Thumbnail | null;
317
+ }
318
+ export declare namespace CourseCreateParams {
319
+ /**
320
+ * The thumbnail for the course in png, jpeg, or gif format
321
+ */
322
+ interface Thumbnail {
323
+ /**
324
+ * The ID of an existing attachment object. Use this when updating a resource and
325
+ * keeping a subset of the attachments. Don't use this unless you know what you're
326
+ * doing.
327
+ */
328
+ id?: string | null;
329
+ /**
330
+ * This ID should be used the first time you upload an attachment. It is the ID of
331
+ * the direct upload that was created when uploading the file to S3 via the
332
+ * mediaDirectUpload mutation.
333
+ */
334
+ direct_upload_id?: string | null;
335
+ }
336
+ }
337
+ export interface CourseUpdateParams {
338
+ /**
339
+ * Whether the course will award its students a PDF certificate after completing
340
+ * all lessons
341
+ */
342
+ certificate_after_completion_enabled?: boolean | null;
343
+ /**
344
+ * The chapters and lessons to update
345
+ */
346
+ chapters?: Array<CourseUpdateParams.Chapter> | null;
347
+ /**
348
+ * The cover image URL of the course
349
+ */
350
+ cover_image?: string | null;
351
+ /**
352
+ * A short description of the course
353
+ */
354
+ description?: string | null;
355
+ /**
356
+ * The available languages for a course
357
+ */
358
+ language?: Languages | null;
359
+ /**
360
+ * Whether the course requires students to complete the previous lesson before
361
+ * moving on to the next one
362
+ */
363
+ require_completing_lessons_in_order?: boolean | null;
364
+ /**
365
+ * A short tagline for the course
366
+ */
367
+ tagline?: string | null;
368
+ /**
369
+ * The thumbnail for the course in png, jpeg, or gif format
370
+ */
371
+ thumbnail?: CourseUpdateParams.Thumbnail | null;
372
+ /**
373
+ * The title of the course
374
+ */
375
+ title?: string | null;
376
+ }
377
+ export declare namespace CourseUpdateParams {
378
+ /**
379
+ * Input for updating a chapter while updating a course
380
+ */
381
+ interface Chapter {
382
+ /**
383
+ * The ID of the chapter to update
384
+ */
385
+ id: string;
386
+ /**
387
+ * The order of the chapter within its course
388
+ */
389
+ order: number;
390
+ /**
391
+ * The title of the chapter
392
+ */
393
+ title: string;
394
+ /**
395
+ * The lessons to update within this chapter
396
+ */
397
+ lessons?: Array<Chapter.Lesson> | null;
398
+ }
399
+ namespace Chapter {
400
+ /**
401
+ * Input for updating a lesson while updating a course
402
+ */
403
+ interface Lesson {
404
+ /**
405
+ * The ID of the lesson to update
406
+ */
407
+ id: string;
408
+ /**
409
+ * The ID of the chapter this lesson belongs to (for moving between chapters)
410
+ */
411
+ chapter_id: string;
412
+ /**
413
+ * The order of the lesson within its chapter
414
+ */
415
+ order: number;
416
+ /**
417
+ * The title of the lesson
418
+ */
419
+ title: string;
420
+ }
421
+ }
422
+ /**
423
+ * The thumbnail for the course in png, jpeg, or gif format
424
+ */
425
+ interface Thumbnail {
426
+ /**
427
+ * The ID of an existing attachment object. Use this when updating a resource and
428
+ * keeping a subset of the attachments. Don't use this unless you know what you're
429
+ * doing.
430
+ */
431
+ id?: string | null;
432
+ /**
433
+ * This ID should be used the first time you upload an attachment. It is the ID of
434
+ * the direct upload that was created when uploading the file to S3 via the
435
+ * mediaDirectUpload mutation.
436
+ */
437
+ direct_upload_id?: string | null;
438
+ }
439
+ }
440
+ export interface CourseListParams extends CursorPageParams {
441
+ /**
442
+ * Returns the elements in the list that come before the specified cursor.
443
+ */
444
+ before?: string | null;
445
+ /**
446
+ * The ID of the company
447
+ */
448
+ company_id?: string | null;
449
+ /**
450
+ * The ID of the experience
451
+ */
452
+ experience_id?: string | null;
453
+ /**
454
+ * Returns the first _n_ elements from the list.
455
+ */
456
+ first?: number | null;
457
+ /**
458
+ * Returns the last _n_ elements from the list.
459
+ */
460
+ last?: number | null;
461
+ }
462
+ export declare namespace Courses {
463
+ export { type Course as Course, type Languages as Languages, type CourseListResponse as CourseListResponse, type CourseDeleteResponse as CourseDeleteResponse, type CourseListResponsesCursorPage as CourseListResponsesCursorPage, type CourseCreateParams as CourseCreateParams, type CourseUpdateParams as CourseUpdateParams, type CourseListParams as CourseListParams, };
464
+ }
465
+ //# sourceMappingURL=courses.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"courses.d.ts","sourceRoot":"","sources":["../src/resources/courses.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,gBAAgB;OACrB,EAAE,UAAU,EAAE;OACd,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,WAAW,EAAE;OAClD,EAAE,cAAc,EAAE;AAGzB,qBAAa,OAAQ,SAAQ,WAAW;IACtC;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC;IAI9E;;;;;;;;;;;;;OAaG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC;IAIlE;;;;;;;;;;;;;OAaG;IACH,MAAM,CACJ,EAAE,EAAE,MAAM,EACV,IAAI,GAAE,kBAAkB,GAAG,IAAI,GAAG,SAAc,EAChD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,MAAM,CAAC;IAIrB;;;;;;;;;;;;;;OAcG;IACH,IAAI,CACF,KAAK,GAAE,gBAAgB,GAAG,IAAI,GAAG,SAAc,EAC/C,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,6BAA6B,EAAE,kBAAkB,CAAC;IAIjE;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,oBAAoB,CAAC;CAG/E;AAED,MAAM,MAAM,6BAA6B,GAAG,UAAU,CAAC,kBAAkB,CAAC,CAAC;AAE3E;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;;OAGG;IACH,oCAAoC,EAAE,OAA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AK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;CACH"}
@@ -0,0 +1,98 @@
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.Courses = 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 Courses extends resource_1.APIResource {
9
+ /**
10
+ * Creates a new course module in an experience
11
+ *
12
+ * Required permissions:
13
+ *
14
+ * - `courses:update`
15
+ *
16
+ * @example
17
+ * ```ts
18
+ * const course = await client.courses.create({
19
+ * experience_id: 'exp_xxxxxxxxxxxxxx',
20
+ * title: 'title',
21
+ * });
22
+ * ```
23
+ */
24
+ create(body, options) {
25
+ return this._client.post('/courses', { body, ...options });
26
+ }
27
+ /**
28
+ * Retrieves a course by ID
29
+ *
30
+ * Required permissions:
31
+ *
32
+ * - `courses:read`
33
+ *
34
+ * @example
35
+ * ```ts
36
+ * const course = await client.courses.retrieve(
37
+ * 'cors_xxxxxxxxxxxxx',
38
+ * );
39
+ * ```
40
+ */
41
+ retrieve(id, options) {
42
+ return this._client.get((0, path_1.path) `/courses/${id}`, options);
43
+ }
44
+ /**
45
+ * Updates a course
46
+ *
47
+ * Required permissions:
48
+ *
49
+ * - `courses:update`
50
+ *
51
+ * @example
52
+ * ```ts
53
+ * const course = await client.courses.update(
54
+ * 'cors_xxxxxxxxxxxxx',
55
+ * );
56
+ * ```
57
+ */
58
+ update(id, body = {}, options) {
59
+ return this._client.patch((0, path_1.path) `/courses/${id}`, { body, ...options });
60
+ }
61
+ /**
62
+ * Lists courses for an experience or company
63
+ *
64
+ * Required permissions:
65
+ *
66
+ * - `courses:read`
67
+ *
68
+ * @example
69
+ * ```ts
70
+ * // Automatically fetches more pages as needed.
71
+ * for await (const courseListResponse of client.courses.list()) {
72
+ * // ...
73
+ * }
74
+ * ```
75
+ */
76
+ list(query = {}, options) {
77
+ return this._client.getAPIList('/courses', (pagination_1.CursorPage), { query, ...options });
78
+ }
79
+ /**
80
+ * Deletes a course
81
+ *
82
+ * Required permissions:
83
+ *
84
+ * - `courses:update`
85
+ *
86
+ * @example
87
+ * ```ts
88
+ * const course = await client.courses.delete(
89
+ * 'cors_xxxxxxxxxxxxx',
90
+ * );
91
+ * ```
92
+ */
93
+ delete(id, options) {
94
+ return this._client.delete((0, path_1.path) `/courses/${id}`, options);
95
+ }
96
+ }
97
+ exports.Courses = Courses;
98
+ //# sourceMappingURL=courses.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"courses.js","sourceRoot":"","sources":["../src/resources/courses.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,sDAAoF;AAEpF,oDAA8C;AAE9C,MAAa,OAAQ,SAAQ,sBAAW;IACtC;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,IAAwB,EAAE,OAAwB;QACvD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7D,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,YAAY,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,MAAM,CACJ,EAAU,EACV,OAA8C,EAAE,EAChD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAA,WAAI,EAAA,YAAY,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACxE,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,IAAI,CACF,QAA6C,EAAE,EAC/C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,UAAU,EAAE,CAAA,uBAA8B,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACpG,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,EAAU,EAAE,OAAwB;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,YAAY,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IAC5D,CAAC;CACF;AAnGD,0BAmGC"}
@@ -0,0 +1,94 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../core/resource.mjs";
3
+ import { CursorPage } from "../core/pagination.mjs";
4
+ import { path } from "../internal/utils/path.mjs";
5
+ export class Courses extends APIResource {
6
+ /**
7
+ * Creates a new course module in an experience
8
+ *
9
+ * Required permissions:
10
+ *
11
+ * - `courses:update`
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * const course = await client.courses.create({
16
+ * experience_id: 'exp_xxxxxxxxxxxxxx',
17
+ * title: 'title',
18
+ * });
19
+ * ```
20
+ */
21
+ create(body, options) {
22
+ return this._client.post('/courses', { body, ...options });
23
+ }
24
+ /**
25
+ * Retrieves a course by ID
26
+ *
27
+ * Required permissions:
28
+ *
29
+ * - `courses:read`
30
+ *
31
+ * @example
32
+ * ```ts
33
+ * const course = await client.courses.retrieve(
34
+ * 'cors_xxxxxxxxxxxxx',
35
+ * );
36
+ * ```
37
+ */
38
+ retrieve(id, options) {
39
+ return this._client.get(path `/courses/${id}`, options);
40
+ }
41
+ /**
42
+ * Updates a course
43
+ *
44
+ * Required permissions:
45
+ *
46
+ * - `courses:update`
47
+ *
48
+ * @example
49
+ * ```ts
50
+ * const course = await client.courses.update(
51
+ * 'cors_xxxxxxxxxxxxx',
52
+ * );
53
+ * ```
54
+ */
55
+ update(id, body = {}, options) {
56
+ return this._client.patch(path `/courses/${id}`, { body, ...options });
57
+ }
58
+ /**
59
+ * Lists courses for an experience or company
60
+ *
61
+ * Required permissions:
62
+ *
63
+ * - `courses:read`
64
+ *
65
+ * @example
66
+ * ```ts
67
+ * // Automatically fetches more pages as needed.
68
+ * for await (const courseListResponse of client.courses.list()) {
69
+ * // ...
70
+ * }
71
+ * ```
72
+ */
73
+ list(query = {}, options) {
74
+ return this._client.getAPIList('/courses', (CursorPage), { query, ...options });
75
+ }
76
+ /**
77
+ * Deletes a course
78
+ *
79
+ * Required permissions:
80
+ *
81
+ * - `courses:update`
82
+ *
83
+ * @example
84
+ * ```ts
85
+ * const course = await client.courses.delete(
86
+ * 'cors_xxxxxxxxxxxxx',
87
+ * );
88
+ * ```
89
+ */
90
+ delete(id, options) {
91
+ return this._client.delete(path `/courses/${id}`, options);
92
+ }
93
+ }
94
+ //# sourceMappingURL=courses.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"courses.mjs","sourceRoot":"","sources":["../src/resources/courses.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,UAAU,EAAsC;OAElD,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,OAAQ,SAAQ,WAAW;IACtC;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,IAAwB,EAAE,OAAwB;QACvD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7D,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,YAAY,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACzD,CA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