@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,594 @@
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 Courses extends APIResource {
11
+ /**
12
+ * Creates a new course module in an experience
13
+ *
14
+ * Required permissions:
15
+ *
16
+ * - `courses:update`
17
+ *
18
+ * @example
19
+ * ```ts
20
+ * const course = await client.courses.create({
21
+ * experience_id: 'exp_xxxxxxxxxxxxxx',
22
+ * title: 'title',
23
+ * });
24
+ * ```
25
+ */
26
+ create(body: CourseCreateParams, options?: RequestOptions): APIPromise<Course> {
27
+ return this._client.post('/courses', { body, ...options });
28
+ }
29
+
30
+ /**
31
+ * Retrieves a course by ID
32
+ *
33
+ * Required permissions:
34
+ *
35
+ * - `courses:read`
36
+ *
37
+ * @example
38
+ * ```ts
39
+ * const course = await client.courses.retrieve(
40
+ * 'cors_xxxxxxxxxxxxx',
41
+ * );
42
+ * ```
43
+ */
44
+ retrieve(id: string, options?: RequestOptions): APIPromise<Course> {
45
+ return this._client.get(path`/courses/${id}`, options);
46
+ }
47
+
48
+ /**
49
+ * Updates a course
50
+ *
51
+ * Required permissions:
52
+ *
53
+ * - `courses:update`
54
+ *
55
+ * @example
56
+ * ```ts
57
+ * const course = await client.courses.update(
58
+ * 'cors_xxxxxxxxxxxxx',
59
+ * );
60
+ * ```
61
+ */
62
+ update(
63
+ id: string,
64
+ body: CourseUpdateParams | null | undefined = {},
65
+ options?: RequestOptions,
66
+ ): APIPromise<Course> {
67
+ return this._client.patch(path`/courses/${id}`, { body, ...options });
68
+ }
69
+
70
+ /**
71
+ * Lists courses for an experience or company
72
+ *
73
+ * Required permissions:
74
+ *
75
+ * - `courses:read`
76
+ *
77
+ * @example
78
+ * ```ts
79
+ * // Automatically fetches more pages as needed.
80
+ * for await (const courseListResponse of client.courses.list()) {
81
+ * // ...
82
+ * }
83
+ * ```
84
+ */
85
+ list(
86
+ query: CourseListParams | null | undefined = {},
87
+ options?: RequestOptions,
88
+ ): PagePromise<CourseListResponsesCursorPage, CourseListResponse> {
89
+ return this._client.getAPIList('/courses', CursorPage<CourseListResponse>, { query, ...options });
90
+ }
91
+
92
+ /**
93
+ * Deletes a course
94
+ *
95
+ * Required permissions:
96
+ *
97
+ * - `courses:update`
98
+ *
99
+ * @example
100
+ * ```ts
101
+ * const course = await client.courses.delete(
102
+ * 'cors_xxxxxxxxxxxxx',
103
+ * );
104
+ * ```
105
+ */
106
+ delete(id: string, options?: RequestOptions): APIPromise<CourseDeleteResponse> {
107
+ return this._client.delete(path`/courses/${id}`, options);
108
+ }
109
+ }
110
+
111
+ export type CourseListResponsesCursorPage = CursorPage<CourseListResponse>;
112
+
113
+ /**
114
+ * A course from the courses app
115
+ */
116
+ export interface Course {
117
+ /**
118
+ * The ID of the course. Looks like cors_XXX
119
+ */
120
+ id: string;
121
+
122
+ /**
123
+ * Whether the course will award its students a PDF certificate after completing
124
+ * all lessons
125
+ */
126
+ certificate_after_completion_enabled: boolean | null;
127
+
128
+ /**
129
+ * The chapters in this course
130
+ */
131
+ chapters: Array<Course.Chapter>;
132
+
133
+ /**
134
+ * The timestamp of when the course was created
135
+ */
136
+ created_at: string;
137
+
138
+ /**
139
+ * A short description of the course
140
+ */
141
+ description: string | null;
142
+
143
+ /**
144
+ * The language spoken in the video content of the course, used to generate closed
145
+ * captions in the right language
146
+ */
147
+ language: Languages;
148
+
149
+ /**
150
+ * Whether the course requires students to complete the previous lesson before
151
+ * moving on to the next one
152
+ */
153
+ require_completing_lessons_in_order: boolean;
154
+
155
+ /**
156
+ * A short tagline for the course. It is displayed under the course title in the UI
157
+ */
158
+ tagline: string | null;
159
+
160
+ /**
161
+ * The thumbnail for the course
162
+ */
163
+ thumbnail: Course.Thumbnail | null;
164
+
165
+ /**
166
+ * The title of the course
167
+ */
168
+ title: string | null;
169
+
170
+ /**
171
+ * The timestamp of when the course was last updated
172
+ */
173
+ updated_at: string;
174
+ }
175
+
176
+ export namespace Course {
177
+ /**
178
+ * A chapter from the courses app
179
+ */
180
+ export interface Chapter {
181
+ /**
182
+ * The ID of the chapter. Looks like chap_XXX
183
+ */
184
+ id: string;
185
+
186
+ /**
187
+ * The lessons in this chapter
188
+ */
189
+ lessons: Array<Chapter.Lesson>;
190
+
191
+ /**
192
+ * The order of the chapter within its course
193
+ */
194
+ order: number;
195
+
196
+ /**
197
+ * The title of the chapter
198
+ */
199
+ title: string;
200
+ }
201
+
202
+ export namespace Chapter {
203
+ /**
204
+ * A lesson from the courses app
205
+ */
206
+ export interface Lesson {
207
+ /**
208
+ * The ID of the lesson
209
+ */
210
+ id: string;
211
+
212
+ /**
213
+ * The type of the lesson (text, video, pdf, multi, quiz, knowledge_check)
214
+ */
215
+ lesson_type: CourseLessonsAPI.LessonTypes;
216
+
217
+ /**
218
+ * The order of the lesson within its chapter
219
+ */
220
+ order: number;
221
+
222
+ /**
223
+ * The title of the lesson
224
+ */
225
+ title: string;
226
+ }
227
+ }
228
+
229
+ /**
230
+ * The thumbnail for the course
231
+ */
232
+ export interface Thumbnail {
233
+ /**
234
+ * The ID of the attachment
235
+ */
236
+ id: string;
237
+
238
+ /**
239
+ * The attachment's content type (e.g., image/jpg, video/mp4)
240
+ */
241
+ content_type: string | null;
242
+
243
+ /**
244
+ * The name of the file
245
+ */
246
+ filename: string | null;
247
+
248
+ /**
249
+ * This is the URL you use to render optimized attachments on the client. This
250
+ * should be used for apps.
251
+ */
252
+ optimized_url: string | null;
253
+
254
+ /**
255
+ * The original URL of the attachment, such as a direct link to S3. This should
256
+ * never be displayed on the client and always passed to an Imgproxy transformer.
257
+ */
258
+ source_url: string | null;
259
+ }
260
+ }
261
+
262
+ /**
263
+ * The available languages for a course
264
+ */
265
+ export type Languages =
266
+ | 'en'
267
+ | 'es'
268
+ | 'it'
269
+ | 'pt'
270
+ | 'de'
271
+ | 'fr'
272
+ | 'pl'
273
+ | 'ru'
274
+ | 'nl'
275
+ | 'ca'
276
+ | 'tr'
277
+ | 'sv'
278
+ | 'uk'
279
+ | 'no'
280
+ | 'fi'
281
+ | 'sk'
282
+ | 'el'
283
+ | 'cs'
284
+ | 'hr'
285
+ | 'da'
286
+ | 'ro'
287
+ | 'bg';
288
+
289
+ /**
290
+ * A course from the courses app
291
+ */
292
+ export interface CourseListResponse {
293
+ /**
294
+ * The ID of the course. Looks like cors_XXX
295
+ */
296
+ id: string;
297
+
298
+ /**
299
+ * Whether the course will award its students a PDF certificate after completing
300
+ * all lessons
301
+ */
302
+ certificate_after_completion_enabled: boolean | null;
303
+
304
+ /**
305
+ * The timestamp of when the course was created
306
+ */
307
+ created_at: string;
308
+
309
+ /**
310
+ * A short description of the course
311
+ */
312
+ description: string | null;
313
+
314
+ /**
315
+ * The language spoken in the video content of the course, used to generate closed
316
+ * captions in the right language
317
+ */
318
+ language: Languages;
319
+
320
+ /**
321
+ * Whether the course requires students to complete the previous lesson before
322
+ * moving on to the next one
323
+ */
324
+ require_completing_lessons_in_order: boolean;
325
+
326
+ /**
327
+ * A short tagline for the course. It is displayed under the course title in the UI
328
+ */
329
+ tagline: string | null;
330
+
331
+ /**
332
+ * The thumbnail for the course
333
+ */
334
+ thumbnail: CourseListResponse.Thumbnail | null;
335
+
336
+ /**
337
+ * The title of the course
338
+ */
339
+ title: string | null;
340
+
341
+ /**
342
+ * The timestamp of when the course was last updated
343
+ */
344
+ updated_at: string;
345
+ }
346
+
347
+ export namespace CourseListResponse {
348
+ /**
349
+ * The thumbnail for the course
350
+ */
351
+ export interface Thumbnail {
352
+ /**
353
+ * The ID of the attachment
354
+ */
355
+ id: string;
356
+
357
+ /**
358
+ * The attachment's content type (e.g., image/jpg, video/mp4)
359
+ */
360
+ content_type: string | null;
361
+
362
+ /**
363
+ * The name of the file
364
+ */
365
+ filename: string | null;
366
+
367
+ /**
368
+ * This is the URL you use to render optimized attachments on the client. This
369
+ * should be used for apps.
370
+ */
371
+ optimized_url: string | null;
372
+
373
+ /**
374
+ * The original URL of the attachment, such as a direct link to S3. This should
375
+ * never be displayed on the client and always passed to an Imgproxy transformer.
376
+ */
377
+ source_url: string | null;
378
+ }
379
+ }
380
+
381
+ /**
382
+ * Represents `true` or `false` values.
383
+ */
384
+ export type CourseDeleteResponse = boolean;
385
+
386
+ export interface CourseCreateParams {
387
+ /**
388
+ * The ID of the experience to create the course in
389
+ */
390
+ experience_id: string;
391
+
392
+ /**
393
+ * The title of the course
394
+ */
395
+ title: string;
396
+
397
+ /**
398
+ * The cover image URL of the course
399
+ */
400
+ cover_image?: string | null;
401
+
402
+ /**
403
+ * The tagline of the course
404
+ */
405
+ tagline?: string | null;
406
+
407
+ /**
408
+ * The thumbnail for the course in png, jpeg, or gif format
409
+ */
410
+ thumbnail?: CourseCreateParams.Thumbnail | null;
411
+ }
412
+
413
+ export namespace CourseCreateParams {
414
+ /**
415
+ * The thumbnail for the course in png, jpeg, or gif format
416
+ */
417
+ export interface Thumbnail {
418
+ /**
419
+ * The ID of an existing attachment object. Use this when updating a resource and
420
+ * keeping a subset of the attachments. Don't use this unless you know what you're
421
+ * doing.
422
+ */
423
+ id?: string | null;
424
+
425
+ /**
426
+ * This ID should be used the first time you upload an attachment. It is the ID of
427
+ * the direct upload that was created when uploading the file to S3 via the
428
+ * mediaDirectUpload mutation.
429
+ */
430
+ direct_upload_id?: string | null;
431
+ }
432
+ }
433
+
434
+ export interface CourseUpdateParams {
435
+ /**
436
+ * Whether the course will award its students a PDF certificate after completing
437
+ * all lessons
438
+ */
439
+ certificate_after_completion_enabled?: boolean | null;
440
+
441
+ /**
442
+ * The chapters and lessons to update
443
+ */
444
+ chapters?: Array<CourseUpdateParams.Chapter> | null;
445
+
446
+ /**
447
+ * The cover image URL of the course
448
+ */
449
+ cover_image?: string | null;
450
+
451
+ /**
452
+ * A short description of the course
453
+ */
454
+ description?: string | null;
455
+
456
+ /**
457
+ * The available languages for a course
458
+ */
459
+ language?: Languages | null;
460
+
461
+ /**
462
+ * Whether the course requires students to complete the previous lesson before
463
+ * moving on to the next one
464
+ */
465
+ require_completing_lessons_in_order?: boolean | null;
466
+
467
+ /**
468
+ * A short tagline for the course
469
+ */
470
+ tagline?: string | null;
471
+
472
+ /**
473
+ * The thumbnail for the course in png, jpeg, or gif format
474
+ */
475
+ thumbnail?: CourseUpdateParams.Thumbnail | null;
476
+
477
+ /**
478
+ * The title of the course
479
+ */
480
+ title?: string | null;
481
+ }
482
+
483
+ export namespace CourseUpdateParams {
484
+ /**
485
+ * Input for updating a chapter while updating a course
486
+ */
487
+ export interface Chapter {
488
+ /**
489
+ * The ID of the chapter to update
490
+ */
491
+ id: string;
492
+
493
+ /**
494
+ * The order of the chapter within its course
495
+ */
496
+ order: number;
497
+
498
+ /**
499
+ * The title of the chapter
500
+ */
501
+ title: string;
502
+
503
+ /**
504
+ * The lessons to update within this chapter
505
+ */
506
+ lessons?: Array<Chapter.Lesson> | null;
507
+ }
508
+
509
+ export namespace Chapter {
510
+ /**
511
+ * Input for updating a lesson while updating a course
512
+ */
513
+ export interface Lesson {
514
+ /**
515
+ * The ID of the lesson to update
516
+ */
517
+ id: string;
518
+
519
+ /**
520
+ * The ID of the chapter this lesson belongs to (for moving between chapters)
521
+ */
522
+ chapter_id: string;
523
+
524
+ /**
525
+ * The order of the lesson within its chapter
526
+ */
527
+ order: number;
528
+
529
+ /**
530
+ * The title of the lesson
531
+ */
532
+ title: string;
533
+ }
534
+ }
535
+
536
+ /**
537
+ * The thumbnail for the course in png, jpeg, or gif format
538
+ */
539
+ export interface Thumbnail {
540
+ /**
541
+ * The ID of an existing attachment object. Use this when updating a resource and
542
+ * keeping a subset of the attachments. Don't use this unless you know what you're
543
+ * doing.
544
+ */
545
+ id?: string | null;
546
+
547
+ /**
548
+ * This ID should be used the first time you upload an attachment. It is the ID of
549
+ * the direct upload that was created when uploading the file to S3 via the
550
+ * mediaDirectUpload mutation.
551
+ */
552
+ direct_upload_id?: string | null;
553
+ }
554
+ }
555
+
556
+ export interface CourseListParams extends CursorPageParams {
557
+ /**
558
+ * Returns the elements in the list that come before the specified cursor.
559
+ */
560
+ before?: string | null;
561
+
562
+ /**
563
+ * The ID of the company
564
+ */
565
+ company_id?: string | null;
566
+
567
+ /**
568
+ * The ID of the experience
569
+ */
570
+ experience_id?: string | null;
571
+
572
+ /**
573
+ * Returns the first _n_ elements from the list.
574
+ */
575
+ first?: number | null;
576
+
577
+ /**
578
+ * Returns the last _n_ elements from the list.
579
+ */
580
+ last?: number | null;
581
+ }
582
+
583
+ export declare namespace Courses {
584
+ export {
585
+ type Course as Course,
586
+ type Languages as Languages,
587
+ type CourseListResponse as CourseListResponse,
588
+ type CourseDeleteResponse as CourseDeleteResponse,
589
+ type CourseListResponsesCursorPage as CourseListResponsesCursorPage,
590
+ type CourseCreateParams as CourseCreateParams,
591
+ type CourseUpdateParams as CourseUpdateParams,
592
+ type CourseListParams as CourseListParams,
593
+ };
594
+ }
@@ -138,6 +138,33 @@ export class Experiences extends APIResource {
138
138
  detach(id: string, body: ExperienceDetachParams, options?: RequestOptions): APIPromise<Shared.Experience> {
139
139
  return this._client.post(path`/experiences/${id}/detach`, { body, ...options });
140
140
  }
141
+
142
+ /**
143
+ * Duplicates an existing experience. The name will be copied, unless provided. The
144
+ * new experience will be attached to the same products as the original experience.
145
+ * If duplicating a Forum or Chat experience, the new experience will have the same
146
+ * settings as the original experience, e.g. who can post, who can comment, etc. No
147
+ * content, e.g. posts, messages, lessons from within the original experience will
148
+ * be copied.
149
+ *
150
+ * Required permissions:
151
+ *
152
+ * - `experience:create`
153
+ *
154
+ * @example
155
+ * ```ts
156
+ * const experience = await client.experiences.duplicate(
157
+ * 'exp_xxxxxxxxxxxxxx',
158
+ * );
159
+ * ```
160
+ */
161
+ duplicate(
162
+ id: string,
163
+ body: ExperienceDuplicateParams | null | undefined = {},
164
+ options?: RequestOptions,
165
+ ): APIPromise<Shared.Experience> {
166
+ return this._client.post(path`/experiences/${id}/duplicate`, { body, ...options });
167
+ }
141
168
  }
142
169
 
143
170
  export type ExperienceListResponsesCursorPage = CursorPage<ExperienceListResponse>;
@@ -371,6 +398,13 @@ export interface ExperienceDetachParams {
371
398
  product_id: string;
372
399
  }
373
400
 
401
+ export interface ExperienceDuplicateParams {
402
+ /**
403
+ * The name of the new experience
404
+ */
405
+ name?: string | null;
406
+ }
407
+
374
408
  export declare namespace Experiences {
375
409
  export {
376
410
  type ExperienceListResponse as ExperienceListResponse,
@@ -381,5 +415,6 @@ export declare namespace Experiences {
381
415
  type ExperienceListParams as ExperienceListParams,
382
416
  type ExperienceAttachParams as ExperienceAttachParams,
383
417
  type ExperienceDetachParams as ExperienceDetachParams,
418
+ type ExperienceDuplicateParams as ExperienceDuplicateParams,
384
419
  };
385
420
  }