@whop/sdk 0.0.22 → 0.0.24

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 (138) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/client.d.mts +7 -4
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +7 -4
  5. package/client.d.ts.map +1 -1
  6. package/client.js +3 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +3 -0
  9. package/client.mjs.map +1 -1
  10. package/lib/upload-file.d.mts +39 -0
  11. package/lib/upload-file.d.mts.map +1 -0
  12. package/lib/upload-file.d.ts +39 -0
  13. package/lib/upload-file.d.ts.map +1 -0
  14. package/lib/upload-file.js +68 -0
  15. package/lib/upload-file.js.map +1 -0
  16. package/lib/upload-file.mjs +65 -0
  17. package/lib/upload-file.mjs.map +1 -0
  18. package/package.json +1 -1
  19. package/resources/app-builds.d.mts +7 -18
  20. package/resources/app-builds.d.mts.map +1 -1
  21. package/resources/app-builds.d.ts +7 -18
  22. package/resources/app-builds.d.ts.map +1 -1
  23. package/resources/app-builds.js +1 -1
  24. package/resources/app-builds.mjs +1 -1
  25. package/resources/apps.d.mts +19 -17
  26. package/resources/apps.d.mts.map +1 -1
  27. package/resources/apps.d.ts +19 -17
  28. package/resources/apps.d.ts.map +1 -1
  29. package/resources/checkout-configurations.d.mts +8 -17
  30. package/resources/checkout-configurations.d.mts.map +1 -1
  31. package/resources/checkout-configurations.d.ts +8 -17
  32. package/resources/checkout-configurations.d.ts.map +1 -1
  33. package/resources/companies.d.mts +23 -34
  34. package/resources/companies.d.mts.map +1 -1
  35. package/resources/companies.d.ts +23 -34
  36. package/resources/companies.d.ts.map +1 -1
  37. package/resources/course-lessons.d.mts +19 -84
  38. package/resources/course-lessons.d.mts.map +1 -1
  39. package/resources/course-lessons.d.ts +19 -84
  40. package/resources/course-lessons.d.ts.map +1 -1
  41. package/resources/courses.d.mts +8 -42
  42. package/resources/courses.d.mts.map +1 -1
  43. package/resources/courses.d.ts +8 -42
  44. package/resources/courses.d.ts.map +1 -1
  45. package/resources/disputes.d.mts +16 -68
  46. package/resources/disputes.d.mts.map +1 -1
  47. package/resources/disputes.d.ts +16 -68
  48. package/resources/disputes.d.ts.map +1 -1
  49. package/resources/experiences.d.mts +19 -17
  50. package/resources/experiences.d.mts.map +1 -1
  51. package/resources/experiences.d.ts +19 -17
  52. package/resources/experiences.d.ts.map +1 -1
  53. package/resources/files.d.mts +104 -0
  54. package/resources/files.d.mts.map +1 -0
  55. package/resources/files.d.ts +104 -0
  56. package/resources/files.d.ts.map +1 -0
  57. package/resources/files.js +35 -0
  58. package/resources/files.js.map +1 -0
  59. package/resources/files.mjs +31 -0
  60. package/resources/files.mjs.map +1 -0
  61. package/resources/forum-posts.d.mts +6 -32
  62. package/resources/forum-posts.d.mts.map +1 -1
  63. package/resources/forum-posts.d.ts +6 -32
  64. package/resources/forum-posts.d.ts.map +1 -1
  65. package/resources/index.d.mts +3 -2
  66. package/resources/index.d.mts.map +1 -1
  67. package/resources/index.d.ts +3 -2
  68. package/resources/index.d.ts.map +1 -1
  69. package/resources/index.js +3 -1
  70. package/resources/index.js.map +1 -1
  71. package/resources/index.mjs +1 -0
  72. package/resources/index.mjs.map +1 -1
  73. package/resources/ledger-accounts.d.mts +0 -4
  74. package/resources/ledger-accounts.d.mts.map +1 -1
  75. package/resources/ledger-accounts.d.ts +0 -4
  76. package/resources/ledger-accounts.d.ts.map +1 -1
  77. package/resources/messages.d.mts +6 -32
  78. package/resources/messages.d.mts.map +1 -1
  79. package/resources/messages.d.ts +6 -32
  80. package/resources/messages.d.ts.map +1 -1
  81. package/resources/notifications.d.mts +4 -0
  82. package/resources/notifications.d.mts.map +1 -1
  83. package/resources/notifications.d.ts +4 -0
  84. package/resources/notifications.d.ts.map +1 -1
  85. package/resources/notifications.js +4 -0
  86. package/resources/notifications.js.map +1 -1
  87. package/resources/notifications.mjs +4 -0
  88. package/resources/notifications.mjs.map +1 -1
  89. package/resources/payments.d.mts +2 -2
  90. package/resources/payments.d.mts.map +1 -1
  91. package/resources/payments.d.ts +2 -2
  92. package/resources/payments.d.ts.map +1 -1
  93. package/resources/payout-methods.d.mts +8 -0
  94. package/resources/payout-methods.d.mts.map +1 -1
  95. package/resources/payout-methods.d.ts +8 -0
  96. package/resources/payout-methods.d.ts.map +1 -1
  97. package/resources/plans.d.mts +16 -34
  98. package/resources/plans.d.mts.map +1 -1
  99. package/resources/plans.d.ts +16 -34
  100. package/resources/plans.d.ts.map +1 -1
  101. package/resources/webhooks.d.mts +437 -11
  102. package/resources/webhooks.d.mts.map +1 -1
  103. package/resources/webhooks.d.ts +437 -11
  104. package/resources/webhooks.d.ts.map +1 -1
  105. package/resources/webhooks.js +90 -0
  106. package/resources/webhooks.js.map +1 -1
  107. package/resources/webhooks.mjs +90 -0
  108. package/resources/webhooks.mjs.map +1 -1
  109. package/resources/withdrawals.d.mts +8 -19
  110. package/resources/withdrawals.d.mts.map +1 -1
  111. package/resources/withdrawals.d.ts +8 -19
  112. package/resources/withdrawals.d.ts.map +1 -1
  113. package/src/client.ts +28 -2
  114. package/src/lib/upload-file.ts +115 -0
  115. package/src/resources/app-builds.ts +7 -21
  116. package/src/resources/apps.ts +21 -18
  117. package/src/resources/checkout-configurations.ts +9 -18
  118. package/src/resources/companies.ts +25 -42
  119. package/src/resources/course-lessons.ts +19 -104
  120. package/src/resources/courses.ts +8 -52
  121. package/src/resources/disputes.ts +16 -84
  122. package/src/resources/experiences.ts +21 -21
  123. package/src/resources/files.ts +140 -0
  124. package/src/resources/forum-posts.ts +6 -38
  125. package/src/resources/index.ts +10 -1
  126. package/src/resources/ledger-accounts.ts +0 -18
  127. package/src/resources/messages.ts +6 -38
  128. package/src/resources/notifications.ts +4 -0
  129. package/src/resources/payments.ts +46 -30
  130. package/src/resources/payout-methods.ts +10 -0
  131. package/src/resources/plans.ts +18 -36
  132. package/src/resources/webhooks.ts +800 -10
  133. package/src/resources/withdrawals.ts +8 -21
  134. package/src/version.ts +1 -1
  135. package/version.d.mts +1 -1
  136. package/version.d.ts +1 -1
  137. package/version.js +1 -1
  138. package/version.mjs +1 -1
@@ -0,0 +1,115 @@
1
+ import type { Fetch } from '../internal/builtin-types';
2
+ import type { RequestOptions } from '../internal/request-options';
3
+ import { getDefaultFetch } from '../internal/shims';
4
+ import { sleep } from '../internal/utils/sleep';
5
+ import { toFile, type ToFileInput, type Uploadable } from '../core/uploads';
6
+ import type { Whop } from '../client';
7
+ import type { FileCreateResponse, FileRetrieveResponse } from '../resources/files';
8
+
9
+ export interface UploadFileOptions {
10
+ /**
11
+ * Override the filename used when creating the file.
12
+ * If omitted, we'll use the name inferred by `toFile()`.
13
+ */
14
+ filename?: string | null | undefined;
15
+
16
+ /**
17
+ * How often to poll `files.retrieve()` for status updates.
18
+ *
19
+ * @default 1000
20
+ * @unit milliseconds
21
+ */
22
+ pollIntervalMs?: number | null | undefined;
23
+
24
+ /**
25
+ * Maximum time to wait for the file to reach `ready` after uploading.
26
+ *
27
+ * @default 120000
28
+ * @unit milliseconds
29
+ */
30
+ pollTimeoutMs?: number | null | undefined;
31
+
32
+ /**
33
+ * Request options used for the `files.create()` and `files.retrieve()` API calls.
34
+ */
35
+ requestOptions?: RequestOptions | null | undefined;
36
+ }
37
+
38
+ function normalizeUploadHeaders(
39
+ headers: FileCreateResponse['upload_headers'],
40
+ ): Record<string, string> | undefined {
41
+ if (!headers) return undefined;
42
+ const out: Record<string, string> = {};
43
+ for (const [key, value] of Object.entries(headers)) {
44
+ if (value === null || value === undefined) continue;
45
+ out[key] = String(value);
46
+ }
47
+ return out;
48
+ }
49
+
50
+ /**
51
+ * Upload a file using the `files.create()` and `files.retrieve()` APIs.
52
+ *
53
+ * Flow:
54
+ * - create a file record (returns presigned upload URL + headers)
55
+ * - upload bytes to the presigned URL
56
+ * - poll retrieve until `ready` (or `failed` / timeout)
57
+ */
58
+ export async function uploadFile(
59
+ client: Whop,
60
+ file: Uploadable | ToFileInput | PromiseLike<Uploadable | ToFileInput>,
61
+ options?: UploadFileOptions,
62
+ ): Promise<FileRetrieveResponse> {
63
+ const pollIntervalMs = options?.pollIntervalMs ?? 1000;
64
+ const pollTimeoutMs = options?.pollTimeoutMs ?? 120_000;
65
+ const requestOptions = options?.requestOptions ?? undefined;
66
+
67
+ const normalized = await toFile(file as any, options?.filename ?? undefined);
68
+ const filename = (options?.filename ?? normalized.name)?.trim();
69
+ if (!filename) {
70
+ throw new Error('uploadFile: could not determine a filename; pass { filename } or provide a named File.');
71
+ }
72
+
73
+ const created = await client.files.create({ filename }, requestOptions);
74
+
75
+ if (created.upload_status === 'failed') {
76
+ throw new Error(`uploadFile: file creation failed (id: ${created.id}).`);
77
+ }
78
+
79
+ // Some backends may immediately mark the record ready (e.g. for remote/import flows).
80
+ if (created.upload_status !== 'ready') {
81
+ if (!created.upload_url) {
82
+ throw new Error('uploadFile: missing upload_url from files.create response.');
83
+ }
84
+
85
+ const fetchImpl: Fetch = ((client as any).fetch as Fetch | undefined) ?? getDefaultFetch();
86
+
87
+ const uploadResponse = await fetchImpl(created.upload_url, {
88
+ method: 'PUT',
89
+ headers: normalizeUploadHeaders(created.upload_headers) ?? {},
90
+ body: normalized,
91
+ });
92
+
93
+ if (!uploadResponse.ok) {
94
+ throw new Error(
95
+ `uploadFile: upload failed (status ${uploadResponse.status} ${uploadResponse.statusText}).`,
96
+ );
97
+ }
98
+ }
99
+
100
+ const deadline = Date.now() + pollTimeoutMs;
101
+ while (true) {
102
+ const current = await client.files.retrieve(created.id, requestOptions);
103
+
104
+ if (current.upload_status === 'ready') return current;
105
+ if (current.upload_status === 'failed') {
106
+ throw new Error(`uploadFile: processing failed (id: ${current.id}).`);
107
+ }
108
+
109
+ if (Date.now() >= deadline) {
110
+ throw new Error(`uploadFile: timed out waiting for file to become ready (id: ${current.id}).`);
111
+ }
112
+
113
+ await sleep(pollIntervalMs);
114
+ }
115
+ }
@@ -18,7 +18,7 @@ export class AppBuilds extends APIResource {
18
18
  * @example
19
19
  * ```ts
20
20
  * const appBuild = await client.appBuilds.create({
21
- * attachment: { direct_upload_id: 'direct_upload_id' },
21
+ * attachment: { id: 'id' },
22
22
  * checksum: 'checksum',
23
23
  * platform: 'ios',
24
24
  * });
@@ -150,9 +150,7 @@ export interface AppBuildCreateParams {
150
150
  * format. The zip should contain at least one main_js_bundle.hbc file and
151
151
  * optionally an assets folder next to it.
152
152
  */
153
- attachment:
154
- | AppBuildCreateParams.AttachmentInputWithDirectUploadID
155
- | AppBuildCreateParams.AttachmentInputWithID;
153
+ attachment: AppBuildCreateParams.Attachment;
156
154
 
157
155
  /**
158
156
  * Checksum of the app build file. This is generated by the client and used to
@@ -186,25 +184,13 @@ export interface AppBuildCreateParams {
186
184
 
187
185
  export namespace AppBuildCreateParams {
188
186
  /**
189
- * Input for an attachment
190
- */
191
- export interface AttachmentInputWithDirectUploadID {
192
- /**
193
- * This ID should be used the first time you upload an attachment. It is the ID of
194
- * the direct upload that was created when uploading the file to S3 via the
195
- * mediaDirectUpload mutation.
196
- */
197
- direct_upload_id: string;
198
- }
199
-
200
- /**
201
- * Input for an attachment
187
+ * Attachment input for the app build file. This should be an upload in .zip
188
+ * format. The zip should contain at least one main_js_bundle.hbc file and
189
+ * optionally an assets folder next to it.
202
190
  */
203
- export interface AttachmentInputWithID {
191
+ export interface Attachment {
204
192
  /**
205
- * The ID of an existing attachment object. Use this when updating a resource and
206
- * keeping a subset of the attachments. Don't use this unless you know what you're
207
- * doing.
193
+ * The ID of an existing file object.
208
194
  */
209
195
  id: string;
210
196
  }
@@ -243,6 +243,23 @@ export interface AppCreateParams {
243
243
  * The base URL of the app to be created
244
244
  */
245
245
  base_url?: string | null;
246
+
247
+ /**
248
+ * The icon for the app in png, jpeg, or gif format
249
+ */
250
+ icon?: AppCreateParams.Icon | null;
251
+ }
252
+
253
+ export namespace AppCreateParams {
254
+ /**
255
+ * The icon for the app in png, jpeg, or gif format
256
+ */
257
+ export interface Icon {
258
+ /**
259
+ * The ID of an existing file object.
260
+ */
261
+ id: string;
262
+ }
246
263
  }
247
264
 
248
265
  export interface AppUpdateParams {
@@ -284,7 +301,7 @@ export interface AppUpdateParams {
284
301
  /**
285
302
  * The icon for the app
286
303
  */
287
- icon?: AppUpdateParams.AttachmentInputWithDirectUploadID | AppUpdateParams.AttachmentInputWithID | null;
304
+ icon?: AppUpdateParams.Icon | null;
288
305
 
289
306
  /**
290
307
  * The name of the app
@@ -304,25 +321,11 @@ export interface AppUpdateParams {
304
321
 
305
322
  export namespace AppUpdateParams {
306
323
  /**
307
- * Input for an attachment
308
- */
309
- export interface AttachmentInputWithDirectUploadID {
310
- /**
311
- * This ID should be used the first time you upload an attachment. It is the ID of
312
- * the direct upload that was created when uploading the file to S3 via the
313
- * mediaDirectUpload mutation.
314
- */
315
- direct_upload_id: string;
316
- }
317
-
318
- /**
319
- * Input for an attachment
324
+ * The icon for the app
320
325
  */
321
- export interface AttachmentInputWithID {
326
+ export interface Icon {
322
327
  /**
323
- * The ID of an existing attachment object. Use this when updating a resource and
324
- * keeping a subset of the attachments. Don't use this unless you know what you're
325
- * doing.
328
+ * The ID of an existing file object.
326
329
  */
327
330
  id: string;
328
331
  }
@@ -311,7 +311,7 @@ export declare namespace CheckoutConfigurationCreateParams {
311
311
  /**
312
312
  * An image for the plan. This will be visible on the product page to customers.
313
313
  */
314
- image?: Plan.AttachmentInputWithDirectUploadID | Plan.AttachmentInputWithID | null;
314
+ image?: Plan.Image | null;
315
315
 
316
316
  /**
317
317
  * An additional amount charged upon first purchase.
@@ -366,6 +366,11 @@ export declare namespace CheckoutConfigurationCreateParams {
366
366
  */
367
367
  split_pay_required_payments?: number | null;
368
368
 
369
+ /**
370
+ * The number of units available for purchase. If not provided, stock is unlimited.
371
+ */
372
+ stock?: number | null;
373
+
369
374
  /**
370
375
  * The title of the plan. This will be visible on the product page to customers.
371
376
  */
@@ -416,25 +421,11 @@ export declare namespace CheckoutConfigurationCreateParams {
416
421
  }
417
422
 
418
423
  /**
419
- * Input for an attachment
420
- */
421
- export interface AttachmentInputWithDirectUploadID {
422
- /**
423
- * This ID should be used the first time you upload an attachment. It is the ID of
424
- * the direct upload that was created when uploading the file to S3 via the
425
- * mediaDirectUpload mutation.
426
- */
427
- direct_upload_id: string;
428
- }
429
-
430
- /**
431
- * Input for an attachment
424
+ * An image for the plan. This will be visible on the product page to customers.
432
425
  */
433
- export interface AttachmentInputWithID {
426
+ export interface Image {
434
427
  /**
435
- * The ID of an existing attachment object. Use this when updating a resource and
436
- * keeping a subset of the attachments. Don't use this unless you know what you're
437
- * doing.
428
+ * The ID of an existing file object.
438
429
  */
439
430
  id: string;
440
431
  }
@@ -205,6 +205,11 @@ export interface CompanyCreateParams {
205
205
  */
206
206
  industry_type?: Shared.IndustryTypes | null;
207
207
 
208
+ /**
209
+ * The logo for the company in png, jpeg, or gif format
210
+ */
211
+ logo?: CompanyCreateParams.Logo | null;
212
+
208
213
  /**
209
214
  * Additional metadata for the account
210
215
  */
@@ -219,14 +224,23 @@ export interface CompanyCreateParams {
219
224
  send_customer_emails?: boolean | null;
220
225
  }
221
226
 
227
+ export namespace CompanyCreateParams {
228
+ /**
229
+ * The logo for the company in png, jpeg, or gif format
230
+ */
231
+ export interface Logo {
232
+ /**
233
+ * The ID of an existing file object.
234
+ */
235
+ id: string;
236
+ }
237
+ }
238
+
222
239
  export interface CompanyUpdateParams {
223
240
  /**
224
241
  * The banner image for the company in png or jpeg format
225
242
  */
226
- banner_image?:
227
- | CompanyUpdateParams.AttachmentInputWithDirectUploadID
228
- | CompanyUpdateParams.AttachmentInputWithID
229
- | null;
243
+ banner_image?: CompanyUpdateParams.BannerImage | null;
230
244
 
231
245
  /**
232
246
  * The different business types a company can be.
@@ -241,10 +255,7 @@ export interface CompanyUpdateParams {
241
255
  /**
242
256
  * The logo for the company in png, jpeg, or gif format
243
257
  */
244
- logo?:
245
- | CompanyUpdateParams.AttachmentInputWithDirectUploadID
246
- | CompanyUpdateParams.AttachmentInputWithID
247
- | null;
258
+ logo?: CompanyUpdateParams.Logo | null;
248
259
 
249
260
  /**
250
261
  * Whether Whop sends transactional emails to customers on behalf of this company.
@@ -262,49 +273,21 @@ export interface CompanyUpdateParams {
262
273
 
263
274
  export namespace CompanyUpdateParams {
264
275
  /**
265
- * Input for an attachment
266
- */
267
- export interface AttachmentInputWithDirectUploadID {
268
- /**
269
- * This ID should be used the first time you upload an attachment. It is the ID of
270
- * the direct upload that was created when uploading the file to S3 via the
271
- * mediaDirectUpload mutation.
272
- */
273
- direct_upload_id: string;
274
- }
275
-
276
- /**
277
- * Input for an attachment
276
+ * The banner image for the company in png or jpeg format
278
277
  */
279
- export interface AttachmentInputWithID {
278
+ export interface BannerImage {
280
279
  /**
281
- * The ID of an existing attachment object. Use this when updating a resource and
282
- * keeping a subset of the attachments. Don't use this unless you know what you're
283
- * doing.
280
+ * The ID of an existing file object.
284
281
  */
285
282
  id: string;
286
283
  }
287
284
 
288
285
  /**
289
- * Input for an attachment
290
- */
291
- export interface AttachmentInputWithDirectUploadID {
292
- /**
293
- * This ID should be used the first time you upload an attachment. It is the ID of
294
- * the direct upload that was created when uploading the file to S3 via the
295
- * mediaDirectUpload mutation.
296
- */
297
- direct_upload_id: string;
298
- }
299
-
300
- /**
301
- * Input for an attachment
286
+ * The logo for the company in png, jpeg, or gif format
302
287
  */
303
- export interface AttachmentInputWithID {
288
+ export interface Logo {
304
289
  /**
305
- * The ID of an existing attachment object. Use this when updating a resource and
306
- * keeping a subset of the attachments. Don't use this unless you know what you're
307
- * doing.
290
+ * The ID of an existing file object.
308
291
  */
309
292
  id: string;
310
293
  }
@@ -720,10 +720,7 @@ export interface CourseLessonCreateParams {
720
720
  /**
721
721
  * The thumbnail for the lesson in png, jpeg, or gif format
722
722
  */
723
- thumbnail?:
724
- | CourseLessonCreateParams.AttachmentInputWithDirectUploadID
725
- | CourseLessonCreateParams.AttachmentInputWithID
726
- | null;
723
+ thumbnail?: CourseLessonCreateParams.Thumbnail | null;
727
724
 
728
725
  /**
729
726
  * The title of the lesson
@@ -733,25 +730,11 @@ export interface CourseLessonCreateParams {
733
730
 
734
731
  export namespace CourseLessonCreateParams {
735
732
  /**
736
- * Input for an attachment
737
- */
738
- export interface AttachmentInputWithDirectUploadID {
739
- /**
740
- * This ID should be used the first time you upload an attachment. It is the ID of
741
- * the direct upload that was created when uploading the file to S3 via the
742
- * mediaDirectUpload mutation.
743
- */
744
- direct_upload_id: string;
745
- }
746
-
747
- /**
748
- * Input for an attachment
733
+ * The thumbnail for the lesson in png, jpeg, or gif format
749
734
  */
750
- export interface AttachmentInputWithID {
735
+ export interface Thumbnail {
751
736
  /**
752
- * The ID of an existing attachment object. Use this when updating a resource and
753
- * keeping a subset of the attachments. Don't use this unless you know what you're
754
- * doing.
737
+ * The ID of an existing file object.
755
738
  */
756
739
  id: string;
757
740
  }
@@ -773,10 +756,7 @@ export interface CourseLessonUpdateParams {
773
756
  * General attachments for the lesson (PDFs, files, etc). Replaces all existing
774
757
  * attachments.
775
758
  */
776
- attachments?: Array<
777
- | CourseLessonUpdateParams.AttachmentInputWithDirectUploadID
778
- | CourseLessonUpdateParams.AttachmentInputWithID
779
- > | null;
759
+ attachments?: Array<CourseLessonUpdateParams.Attachment> | null;
780
760
 
781
761
  /**
782
762
  * The content of the lesson
@@ -806,10 +786,7 @@ export interface CourseLessonUpdateParams {
806
786
  /**
807
787
  * The main PDF file for this lesson
808
788
  */
809
- main_pdf?:
810
- | CourseLessonUpdateParams.AttachmentInputWithDirectUploadID
811
- | CourseLessonUpdateParams.AttachmentInputWithID
812
- | null;
789
+ main_pdf?: CourseLessonUpdateParams.MainPdf | null;
813
790
 
814
791
  /**
815
792
  * Maximum number of attempts allowed for assessments
@@ -824,10 +801,7 @@ export interface CourseLessonUpdateParams {
824
801
  /**
825
802
  * The thumbnail for the lesson in png, jpeg, or gif format
826
803
  */
827
- thumbnail?:
828
- | CourseLessonUpdateParams.AttachmentInputWithDirectUploadID
829
- | CourseLessonUpdateParams.AttachmentInputWithID
830
- | null;
804
+ thumbnail?: CourseLessonUpdateParams.Thumbnail | null;
831
805
 
832
806
  /**
833
807
  * The title of the lesson
@@ -887,10 +861,7 @@ export namespace CourseLessonUpdateParams {
887
861
  /**
888
862
  * Optional image attachment for the question
889
863
  */
890
- image?:
891
- | AssessmentQuestion.AttachmentInputWithDirectUploadID
892
- | AssessmentQuestion.AttachmentInputWithID
893
- | null;
864
+ image?: AssessmentQuestion.Image | null;
894
865
 
895
866
  /**
896
867
  * The answer options for multiple choice/select questions
@@ -900,25 +871,11 @@ export namespace CourseLessonUpdateParams {
900
871
 
901
872
  export namespace AssessmentQuestion {
902
873
  /**
903
- * Input for an attachment
904
- */
905
- export interface AttachmentInputWithDirectUploadID {
906
- /**
907
- * This ID should be used the first time you upload an attachment. It is the ID of
908
- * the direct upload that was created when uploading the file to S3 via the
909
- * mediaDirectUpload mutation.
910
- */
911
- direct_upload_id: string;
912
- }
913
-
914
- /**
915
- * Input for an attachment
874
+ * Optional image attachment for the question
916
875
  */
917
- export interface AttachmentInputWithID {
876
+ export interface Image {
918
877
  /**
919
- * The ID of an existing attachment object. Use this when updating a resource and
920
- * keeping a subset of the attachments. Don't use this unless you know what you're
921
- * doing.
878
+ * The ID of an existing file object.
922
879
  */
923
880
  id: string;
924
881
  }
@@ -948,71 +905,29 @@ export namespace CourseLessonUpdateParams {
948
905
  /**
949
906
  * Input for an attachment
950
907
  */
951
- export interface AttachmentInputWithDirectUploadID {
952
- /**
953
- * This ID should be used the first time you upload an attachment. It is the ID of
954
- * the direct upload that was created when uploading the file to S3 via the
955
- * mediaDirectUpload mutation.
956
- */
957
- direct_upload_id: string;
958
- }
959
-
960
- /**
961
- * Input for an attachment
962
- */
963
- export interface AttachmentInputWithID {
908
+ export interface Attachment {
964
909
  /**
965
- * The ID of an existing attachment object. Use this when updating a resource and
966
- * keeping a subset of the attachments. Don't use this unless you know what you're
967
- * doing.
910
+ * The ID of an existing file object.
968
911
  */
969
912
  id: string;
970
913
  }
971
914
 
972
915
  /**
973
- * Input for an attachment
974
- */
975
- export interface AttachmentInputWithDirectUploadID {
976
- /**
977
- * This ID should be used the first time you upload an attachment. It is the ID of
978
- * the direct upload that was created when uploading the file to S3 via the
979
- * mediaDirectUpload mutation.
980
- */
981
- direct_upload_id: string;
982
- }
983
-
984
- /**
985
- * Input for an attachment
916
+ * The main PDF file for this lesson
986
917
  */
987
- export interface AttachmentInputWithID {
918
+ export interface MainPdf {
988
919
  /**
989
- * The ID of an existing attachment object. Use this when updating a resource and
990
- * keeping a subset of the attachments. Don't use this unless you know what you're
991
- * doing.
920
+ * The ID of an existing file object.
992
921
  */
993
922
  id: string;
994
923
  }
995
924
 
996
925
  /**
997
- * Input for an attachment
998
- */
999
- export interface AttachmentInputWithDirectUploadID {
1000
- /**
1001
- * This ID should be used the first time you upload an attachment. It is the ID of
1002
- * the direct upload that was created when uploading the file to S3 via the
1003
- * mediaDirectUpload mutation.
1004
- */
1005
- direct_upload_id: string;
1006
- }
1007
-
1008
- /**
1009
- * Input for an attachment
926
+ * The thumbnail for the lesson in png, jpeg, or gif format
1010
927
  */
1011
- export interface AttachmentInputWithID {
928
+ export interface Thumbnail {
1012
929
  /**
1013
- * The ID of an existing attachment object. Use this when updating a resource and
1014
- * keeping a subset of the attachments. Don't use this unless you know what you're
1015
- * doing.
930
+ * The ID of an existing file object.
1016
931
  */
1017
932
  id: string;
1018
933
  }
@@ -481,11 +481,6 @@ export interface CourseCreateParams {
481
481
  */
482
482
  certificate_after_completion_enabled?: boolean | null;
483
483
 
484
- /**
485
- * The cover image URL of the course
486
- */
487
- cover_image?: string | null;
488
-
489
484
  /**
490
485
  * The decimal order position of the course within its experience. If not provided,
491
486
  * it will be set to the next sequential order. Use fractional values (e.g., 1.5)
@@ -507,10 +502,7 @@ export interface CourseCreateParams {
507
502
  /**
508
503
  * The thumbnail for the course in png, jpeg, or gif format
509
504
  */
510
- thumbnail?:
511
- | CourseCreateParams.AttachmentInputWithDirectUploadID
512
- | CourseCreateParams.AttachmentInputWithID
513
- | null;
505
+ thumbnail?: CourseCreateParams.Thumbnail | null;
514
506
 
515
507
  /**
516
508
  * The available visibilities for a course. Determines how / whether a course is
@@ -521,25 +513,11 @@ export interface CourseCreateParams {
521
513
 
522
514
  export namespace CourseCreateParams {
523
515
  /**
524
- * Input for an attachment
525
- */
526
- export interface AttachmentInputWithDirectUploadID {
527
- /**
528
- * This ID should be used the first time you upload an attachment. It is the ID of
529
- * the direct upload that was created when uploading the file to S3 via the
530
- * mediaDirectUpload mutation.
531
- */
532
- direct_upload_id: string;
533
- }
534
-
535
- /**
536
- * Input for an attachment
516
+ * The thumbnail for the course in png, jpeg, or gif format
537
517
  */
538
- export interface AttachmentInputWithID {
518
+ export interface Thumbnail {
539
519
  /**
540
- * The ID of an existing attachment object. Use this when updating a resource and
541
- * keeping a subset of the attachments. Don't use this unless you know what you're
542
- * doing.
520
+ * The ID of an existing file object.
543
521
  */
544
522
  id: string;
545
523
  }
@@ -557,11 +535,6 @@ export interface CourseUpdateParams {
557
535
  */
558
536
  chapters?: Array<CourseUpdateParams.Chapter> | null;
559
537
 
560
- /**
561
- * The cover image URL of the course
562
- */
563
- cover_image?: string | null;
564
-
565
538
  /**
566
539
  * A short description of the course
567
540
  */
@@ -592,10 +565,7 @@ export interface CourseUpdateParams {
592
565
  /**
593
566
  * The thumbnail for the course in png, jpeg, or gif format
594
567
  */
595
- thumbnail?:
596
- | CourseUpdateParams.AttachmentInputWithDirectUploadID
597
- | CourseUpdateParams.AttachmentInputWithID
598
- | null;
568
+ thumbnail?: CourseUpdateParams.Thumbnail | null;
599
569
 
600
570
  /**
601
571
  * The title of the course
@@ -663,25 +633,11 @@ export namespace CourseUpdateParams {
663
633
  }
664
634
 
665
635
  /**
666
- * Input for an attachment
667
- */
668
- export interface AttachmentInputWithDirectUploadID {
669
- /**
670
- * This ID should be used the first time you upload an attachment. It is the ID of
671
- * the direct upload that was created when uploading the file to S3 via the
672
- * mediaDirectUpload mutation.
673
- */
674
- direct_upload_id: string;
675
- }
676
-
677
- /**
678
- * Input for an attachment
636
+ * The thumbnail for the course in png, jpeg, or gif format
679
637
  */
680
- export interface AttachmentInputWithID {
638
+ export interface Thumbnail {
681
639
  /**
682
- * The ID of an existing attachment object. Use this when updating a resource and
683
- * keeping a subset of the attachments. Don't use this unless you know what you're
684
- * doing.
640
+ * The ID of an existing file object.
685
641
  */
686
642
  id: string;
687
643
  }