@whop/sdk 0.0.2 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (196) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/client.d.mts +30 -12
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +30 -12
  5. package/client.d.ts.map +1 -1
  6. package/client.js +19 -1
  7. package/client.js.map +1 -1
  8. package/client.mjs +21 -3
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/app-builds.d.mts +16 -13
  12. package/resources/app-builds.d.mts.map +1 -1
  13. package/resources/app-builds.d.ts +16 -13
  14. package/resources/app-builds.d.ts.map +1 -1
  15. package/resources/app-builds.js +1 -1
  16. package/resources/app-builds.mjs +1 -1
  17. package/resources/apps.d.mts +15 -10
  18. package/resources/apps.d.mts.map +1 -1
  19. package/resources/apps.d.ts +15 -10
  20. package/resources/apps.d.ts.map +1 -1
  21. package/resources/checkout-configurations.d.mts +252 -140
  22. package/resources/checkout-configurations.d.mts.map +1 -1
  23. package/resources/checkout-configurations.d.ts +252 -140
  24. package/resources/checkout-configurations.d.ts.map +1 -1
  25. package/resources/checkout-configurations.js +6 -20
  26. package/resources/checkout-configurations.js.map +1 -1
  27. package/resources/checkout-configurations.mjs +6 -20
  28. package/resources/checkout-configurations.mjs.map +1 -1
  29. package/resources/companies.d.mts +157 -0
  30. package/resources/companies.d.mts.map +1 -1
  31. package/resources/companies.d.ts +157 -0
  32. package/resources/companies.d.ts.map +1 -1
  33. package/resources/companies.js +22 -0
  34. package/resources/companies.js.map +1 -1
  35. package/resources/companies.mjs +22 -0
  36. package/resources/companies.mjs.map +1 -1
  37. package/resources/course-chapters.d.mts +185 -0
  38. package/resources/course-chapters.d.mts.map +1 -0
  39. package/resources/course-chapters.d.ts +185 -0
  40. package/resources/course-chapters.d.ts.map +1 -0
  41. package/resources/course-chapters.js +103 -0
  42. package/resources/course-chapters.js.map +1 -0
  43. package/resources/course-chapters.mjs +99 -0
  44. package/resources/course-chapters.mjs.map +1 -0
  45. package/resources/course-lesson-interactions.d.mts +2 -2
  46. package/resources/course-lesson-interactions.d.ts +2 -2
  47. package/resources/course-lesson-interactions.js +2 -2
  48. package/resources/course-lesson-interactions.mjs +2 -2
  49. package/resources/course-lessons.d.mts +563 -0
  50. package/resources/course-lessons.d.mts.map +1 -0
  51. package/resources/course-lessons.d.ts +563 -0
  52. package/resources/course-lessons.d.ts.map +1 -0
  53. package/resources/course-lessons.js +101 -0
  54. package/resources/course-lessons.js.map +1 -0
  55. package/resources/course-lessons.mjs +97 -0
  56. package/resources/course-lessons.mjs.map +1 -0
  57. package/resources/course-students.d.mts +187 -0
  58. package/resources/course-students.d.mts.map +1 -0
  59. package/resources/course-students.d.ts +187 -0
  60. package/resources/course-students.d.ts.map +1 -0
  61. package/resources/course-students.js +36 -0
  62. package/resources/course-students.js.map +1 -0
  63. package/resources/course-students.mjs +32 -0
  64. package/resources/course-students.mjs.map +1 -0
  65. package/resources/courses.d.mts +485 -0
  66. package/resources/courses.d.mts.map +1 -0
  67. package/resources/courses.d.ts +485 -0
  68. package/resources/courses.d.ts.map +1 -0
  69. package/resources/courses.js +98 -0
  70. package/resources/courses.js.map +1 -0
  71. package/resources/courses.mjs +94 -0
  72. package/resources/courses.mjs.map +1 -0
  73. package/resources/experiences.d.mts +42 -11
  74. package/resources/experiences.d.mts.map +1 -1
  75. package/resources/experiences.d.ts +42 -11
  76. package/resources/experiences.d.ts.map +1 -1
  77. package/resources/experiences.js +22 -0
  78. package/resources/experiences.js.map +1 -1
  79. package/resources/experiences.mjs +22 -0
  80. package/resources/experiences.mjs.map +1 -1
  81. package/resources/forum-posts.d.mts +75 -10
  82. package/resources/forum-posts.d.mts.map +1 -1
  83. package/resources/forum-posts.d.ts +75 -10
  84. package/resources/forum-posts.d.ts.map +1 -1
  85. package/resources/forum-posts.js +11 -0
  86. package/resources/forum-posts.js.map +1 -1
  87. package/resources/forum-posts.mjs +11 -0
  88. package/resources/forum-posts.mjs.map +1 -1
  89. package/resources/index.d.mts +12 -6
  90. package/resources/index.d.mts.map +1 -1
  91. package/resources/index.d.ts +12 -6
  92. package/resources/index.d.ts.map +1 -1
  93. package/resources/index.js +13 -1
  94. package/resources/index.js.map +1 -1
  95. package/resources/index.mjs +7 -1
  96. package/resources/index.mjs.map +1 -1
  97. package/resources/invoices.d.mts +529 -146
  98. package/resources/invoices.d.mts.map +1 -1
  99. package/resources/invoices.d.ts +529 -146
  100. package/resources/invoices.d.ts.map +1 -1
  101. package/resources/invoices.js +2 -24
  102. package/resources/invoices.js.map +1 -1
  103. package/resources/invoices.mjs +2 -24
  104. package/resources/invoices.mjs.map +1 -1
  105. package/resources/ledger-accounts.d.mts +1 -1
  106. package/resources/ledger-accounts.d.mts.map +1 -1
  107. package/resources/ledger-accounts.d.ts +1 -1
  108. package/resources/ledger-accounts.d.ts.map +1 -1
  109. package/resources/members.d.mts +4 -0
  110. package/resources/members.d.mts.map +1 -1
  111. package/resources/members.d.ts +4 -0
  112. package/resources/members.d.ts.map +1 -1
  113. package/resources/memberships.d.mts +26 -5
  114. package/resources/memberships.d.mts.map +1 -1
  115. package/resources/memberships.d.ts +26 -5
  116. package/resources/memberships.d.ts.map +1 -1
  117. package/resources/memberships.js +1 -1
  118. package/resources/memberships.js.map +1 -1
  119. package/resources/memberships.mjs +1 -1
  120. package/resources/memberships.mjs.map +1 -1
  121. package/resources/messages.d.mts +57 -10
  122. package/resources/messages.d.mts.map +1 -1
  123. package/resources/messages.d.ts +57 -10
  124. package/resources/messages.d.ts.map +1 -1
  125. package/resources/messages.js +6 -0
  126. package/resources/messages.js.map +1 -1
  127. package/resources/messages.mjs +6 -0
  128. package/resources/messages.mjs.map +1 -1
  129. package/resources/payments.d.mts +35 -13
  130. package/resources/payments.d.mts.map +1 -1
  131. package/resources/payments.d.ts +35 -13
  132. package/resources/payments.d.ts.map +1 -1
  133. package/resources/plans.d.mts +161 -17
  134. package/resources/plans.d.mts.map +1 -1
  135. package/resources/plans.d.ts +161 -17
  136. package/resources/plans.d.ts.map +1 -1
  137. package/resources/plans.js.map +1 -1
  138. package/resources/plans.mjs.map +1 -1
  139. package/resources/products.d.mts +30 -33
  140. package/resources/products.d.mts.map +1 -1
  141. package/resources/products.d.ts +30 -33
  142. package/resources/products.d.ts.map +1 -1
  143. package/resources/promo-codes.d.mts +394 -0
  144. package/resources/promo-codes.d.mts.map +1 -0
  145. package/resources/promo-codes.d.ts +394 -0
  146. package/resources/promo-codes.d.ts.map +1 -0
  147. package/resources/promo-codes.js +91 -0
  148. package/resources/promo-codes.js.map +1 -0
  149. package/resources/promo-codes.mjs +87 -0
  150. package/resources/promo-codes.mjs.map +1 -0
  151. package/resources/reviews.d.mts +277 -0
  152. package/resources/reviews.d.mts.map +1 -0
  153. package/resources/reviews.d.ts +277 -0
  154. package/resources/reviews.d.ts.map +1 -0
  155. package/resources/reviews.js +23 -0
  156. package/resources/reviews.js.map +1 -0
  157. package/resources/reviews.mjs +19 -0
  158. package/resources/reviews.mjs.map +1 -0
  159. package/resources/shared.d.mts +117 -14
  160. package/resources/shared.d.mts.map +1 -1
  161. package/resources/shared.d.ts +117 -14
  162. package/resources/shared.d.ts.map +1 -1
  163. package/resources/transfers.d.mts +12 -0
  164. package/resources/transfers.d.mts.map +1 -1
  165. package/resources/transfers.d.ts +12 -0
  166. package/resources/transfers.d.ts.map +1 -1
  167. package/src/client.ts +166 -11
  168. package/src/resources/app-builds.ts +19 -14
  169. package/src/resources/apps.ts +16 -11
  170. package/src/resources/checkout-configurations.ts +278 -143
  171. package/src/resources/companies.ts +196 -0
  172. package/src/resources/course-chapters.ts +236 -0
  173. package/src/resources/course-lesson-interactions.ts +2 -2
  174. package/src/resources/course-lessons.ts +699 -0
  175. package/src/resources/course-students.ts +238 -0
  176. package/src/resources/courses.ts +622 -0
  177. package/src/resources/experiences.ts +54 -11
  178. package/src/resources/forum-posts.ts +95 -10
  179. package/src/resources/index.ts +73 -2
  180. package/src/resources/invoices.ts +620 -149
  181. package/src/resources/ledger-accounts.ts +13 -1
  182. package/src/resources/members.ts +5 -0
  183. package/src/resources/memberships.ts +31 -6
  184. package/src/resources/messages.ts +74 -10
  185. package/src/resources/payments.ts +146 -19
  186. package/src/resources/plans.ts +184 -17
  187. package/src/resources/products.ts +36 -37
  188. package/src/resources/promo-codes.ts +490 -0
  189. package/src/resources/reviews.ts +348 -0
  190. package/src/resources/shared.ts +128 -14
  191. package/src/resources/transfers.ts +10 -0
  192. package/src/version.ts +1 -1
  193. package/version.d.mts +1 -1
  194. package/version.d.ts +1 -1
  195. package/version.js +1 -1
  196. package/version.mjs +1 -1
@@ -42,6 +42,22 @@ export class ForumPosts extends APIResource {
42
42
  return this._client.get(path`/forum_posts/${id}`, options);
43
43
  }
44
44
 
45
+ /**
46
+ * Update an existing forum post
47
+ *
48
+ * @example
49
+ * ```ts
50
+ * const forumPost = await client.forumPosts.update('id');
51
+ * ```
52
+ */
53
+ update(
54
+ id: string,
55
+ body: ForumPostUpdateParams | null | undefined = {},
56
+ options?: RequestOptions,
57
+ ): APIPromise<Shared.ForumPost> {
58
+ return this._client.patch(path`/forum_posts/${id}`, { body, ...options });
59
+ }
60
+
45
61
  /**
46
62
  * Lists forum posts
47
63
  *
@@ -88,6 +104,11 @@ export interface ForumPostListResponse {
88
104
  */
89
105
  content: string | null;
90
106
 
107
+ /**
108
+ * The timestamp when the post was created
109
+ */
110
+ created_at: string;
111
+
91
112
  /**
92
113
  * Whether the forum post has been edited
93
114
  */
@@ -118,6 +139,11 @@ export interface ForumPostListResponse {
118
139
  */
119
140
  title: string | null;
120
141
 
142
+ /**
143
+ * The timestamp when the post was last updated
144
+ */
145
+ updated_at: string;
146
+
121
147
  /**
122
148
  * The user who created this forum post
123
149
  */
@@ -160,7 +186,9 @@ export interface ForumPostCreateParams {
160
186
  /**
161
187
  * The attachments for this post
162
188
  */
163
- attachments?: Array<ForumPostCreateParams.Attachment> | null;
189
+ attachments?: Array<
190
+ ForumPostCreateParams.AttachmentInputWithDirectUploadID | ForumPostCreateParams.AttachmentInputWithID
191
+ > | null;
164
192
 
165
193
  /**
166
194
  * This is the main body of the post in Markdown format. Hidden if paywalled and
@@ -212,20 +240,25 @@ export namespace ForumPostCreateParams {
212
240
  /**
213
241
  * Input for an attachment
214
242
  */
215
- export interface Attachment {
216
- /**
217
- * The ID of an existing attachment object. Use this when updating a resource and
218
- * keeping a subset of the attachments. Don't use this unless you know what you're
219
- * doing.
220
- */
221
- id?: string | null;
222
-
243
+ export interface AttachmentInputWithDirectUploadID {
223
244
  /**
224
245
  * This ID should be used the first time you upload an attachment. It is the ID of
225
246
  * the direct upload that was created when uploading the file to S3 via the
226
247
  * mediaDirectUpload mutation.
227
248
  */
228
- direct_upload_id?: string | null;
249
+ direct_upload_id: string;
250
+ }
251
+
252
+ /**
253
+ * Input for an attachment
254
+ */
255
+ export interface AttachmentInputWithID {
256
+ /**
257
+ * The ID of an existing attachment object. Use this when updating a resource and
258
+ * keeping a subset of the attachments. Don't use this unless you know what you're
259
+ * doing.
260
+ */
261
+ id: string;
229
262
  }
230
263
 
231
264
  /**
@@ -256,6 +289,57 @@ export namespace ForumPostCreateParams {
256
289
  }
257
290
  }
258
291
 
292
+ export interface ForumPostUpdateParams {
293
+ /**
294
+ * The attachments for this post
295
+ */
296
+ attachments?: Array<
297
+ ForumPostUpdateParams.AttachmentInputWithDirectUploadID | ForumPostUpdateParams.AttachmentInputWithID
298
+ > | null;
299
+
300
+ /**
301
+ * This is the main body of the post in Markdown format. Hidden if paywalled and
302
+ * user hasn't purchased access to it.
303
+ */
304
+ content?: string | null;
305
+
306
+ /**
307
+ * Whether the post is pinned. You can only pin a top level posts (not comments).
308
+ */
309
+ is_pinned?: boolean | null;
310
+
311
+ /**
312
+ * The title of the post. Only visible if paywalled.
313
+ */
314
+ title?: string | null;
315
+ }
316
+
317
+ export namespace ForumPostUpdateParams {
318
+ /**
319
+ * Input for an attachment
320
+ */
321
+ export interface AttachmentInputWithDirectUploadID {
322
+ /**
323
+ * This ID should be used the first time you upload an attachment. It is the ID of
324
+ * the direct upload that was created when uploading the file to S3 via the
325
+ * mediaDirectUpload mutation.
326
+ */
327
+ direct_upload_id: string;
328
+ }
329
+
330
+ /**
331
+ * Input for an attachment
332
+ */
333
+ export interface AttachmentInputWithID {
334
+ /**
335
+ * The ID of an existing attachment object. Use this when updating a resource and
336
+ * keeping a subset of the attachments. Don't use this unless you know what you're
337
+ * doing.
338
+ */
339
+ id: string;
340
+ }
341
+ }
342
+
259
343
  export interface ForumPostListParams extends CursorPageParams {
260
344
  /**
261
345
  * The ID of the experience to list forum posts for
@@ -293,6 +377,7 @@ export declare namespace ForumPosts {
293
377
  type ForumPostListResponse as ForumPostListResponse,
294
378
  type ForumPostListResponsesCursorPage as ForumPostListResponsesCursorPage,
295
379
  type ForumPostCreateParams as ForumPostCreateParams,
380
+ type ForumPostUpdateParams as ForumPostUpdateParams,
296
381
  type ForumPostListParams as ForumPostListParams,
297
382
  };
298
383
  }
@@ -37,11 +37,58 @@ export {
37
37
  type CheckoutConfigurationListParams,
38
38
  type CheckoutConfigurationListResponsesCursorPage,
39
39
  } from './checkout-configurations';
40
- export { Companies } from './companies';
40
+ export {
41
+ Companies,
42
+ type CompanyListResponse,
43
+ type CompanyCreateParams,
44
+ type CompanyListParams,
45
+ type CompanyListResponsesCursorPage,
46
+ } from './companies';
47
+ export {
48
+ CourseChapters,
49
+ type CourseChapter,
50
+ type CourseChapterListResponse,
51
+ type CourseChapterDeleteResponse,
52
+ type CourseChapterCreateParams,
53
+ type CourseChapterUpdateParams,
54
+ type CourseChapterListParams,
55
+ type CourseChapterListResponsesCursorPage,
56
+ } from './course-chapters';
41
57
  export {
42
58
  CourseLessonInteractions,
43
59
  type CourseLessonInteractionListParams,
44
60
  } from './course-lesson-interactions';
61
+ export {
62
+ CourseLessons,
63
+ type AssessmentQuestionTypes,
64
+ type Lesson,
65
+ type LessonTypes,
66
+ type LessonVisibilities,
67
+ type CourseLessonListResponse,
68
+ type CourseLessonDeleteResponse,
69
+ type CourseLessonCreateParams,
70
+ type CourseLessonUpdateParams,
71
+ type CourseLessonListParams,
72
+ type CourseLessonListResponsesCursorPage,
73
+ } from './course-lessons';
74
+ export {
75
+ CourseStudents,
76
+ type CourseStudentRetrieveResponse,
77
+ type CourseStudentListResponse,
78
+ type CourseStudentListParams,
79
+ type CourseStudentListResponsesCursorPage,
80
+ } from './course-students';
81
+ export {
82
+ Courses,
83
+ type Course,
84
+ type Languages,
85
+ type CourseListResponse,
86
+ type CourseDeleteResponse,
87
+ type CourseCreateParams,
88
+ type CourseUpdateParams,
89
+ type CourseListParams,
90
+ type CourseListResponsesCursorPage,
91
+ } from './courses';
45
92
  export {
46
93
  Entries,
47
94
  type EntryListResponse,
@@ -58,12 +105,14 @@ export {
58
105
  type ExperienceListParams,
59
106
  type ExperienceAttachParams,
60
107
  type ExperienceDetachParams,
108
+ type ExperienceDuplicateParams,
61
109
  type ExperienceListResponsesCursorPage,
62
110
  } from './experiences';
63
111
  export {
64
112
  ForumPosts,
65
113
  type ForumPostListResponse,
66
114
  type ForumPostCreateParams,
115
+ type ForumPostUpdateParams,
67
116
  type ForumPostListParams,
68
117
  type ForumPostListResponsesCursorPage,
69
118
  } from './forum-posts';
@@ -76,7 +125,6 @@ export {
76
125
  } from './forums';
77
126
  export {
78
127
  Invoices,
79
- type InvoiceCreateResponse,
80
128
  type InvoiceVoidResponse,
81
129
  type InvoiceCreateParams,
82
130
  type InvoiceListParams,
@@ -102,11 +150,15 @@ export {
102
150
  Messages,
103
151
  type MessageListResponse,
104
152
  type MessageCreateParams,
153
+ type MessageUpdateParams,
105
154
  type MessageListParams,
106
155
  type MessageListResponsesCursorPage,
107
156
  } from './messages';
108
157
  export {
109
158
  Payments,
159
+ type BillingReasons,
160
+ type CardBrands,
161
+ type PaymentMethodTypes,
110
162
  type PaymentListResponse,
111
163
  type PaymentListParams,
112
164
  type PaymentRefundParams,
@@ -128,6 +180,17 @@ export {
128
180
  type ProductUpdateParams,
129
181
  type ProductListParams,
130
182
  } from './products';
183
+ export {
184
+ PromoCodes,
185
+ type PromoCode,
186
+ type PromoCodeStatus,
187
+ type PromoDuration,
188
+ type PromoCodeListResponse,
189
+ type PromoCodeDeleteResponse,
190
+ type PromoCodeCreateParams,
191
+ type PromoCodeListParams,
192
+ type PromoCodeListResponsesCursorPage,
193
+ } from './promo-codes';
131
194
  export {
132
195
  Reactions,
133
196
  type ReactionListResponse,
@@ -135,6 +198,14 @@ export {
135
198
  type ReactionListParams,
136
199
  type ReactionListResponsesCursorPage,
137
200
  } from './reactions';
201
+ export {
202
+ Reviews,
203
+ type ReviewStatus,
204
+ type ReviewRetrieveResponse,
205
+ type ReviewListResponse,
206
+ type ReviewListParams,
207
+ type ReviewListResponsesCursorPage,
208
+ } from './reviews';
138
209
  export {
139
210
  Shipments,
140
211
  type ShipmentListResponse,