@whop/sdk 0.0.1-canary.0 → 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 (184) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/client.d.mts +39 -11
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +39 -11
  5. package/client.d.ts.map +1 -1
  6. package/client.js +23 -2
  7. package/client.js.map +1 -1
  8. package/client.mjs +23 -2
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/apps.d.mts +16 -0
  12. package/resources/apps.d.mts.map +1 -1
  13. package/resources/apps.d.ts +16 -0
  14. package/resources/apps.d.ts.map +1 -1
  15. package/resources/checkout-configurations.d.mts +96 -19
  16. package/resources/checkout-configurations.d.mts.map +1 -1
  17. package/resources/checkout-configurations.d.ts +96 -19
  18. package/resources/checkout-configurations.d.ts.map +1 -1
  19. package/resources/checkout-configurations.js +3 -1
  20. package/resources/checkout-configurations.js.map +1 -1
  21. package/resources/checkout-configurations.mjs +3 -1
  22. package/resources/checkout-configurations.mjs.map +1 -1
  23. package/resources/course-chapters.d.mts +185 -0
  24. package/resources/course-chapters.d.mts.map +1 -0
  25. package/resources/course-chapters.d.ts +185 -0
  26. package/resources/course-chapters.d.ts.map +1 -0
  27. package/resources/course-chapters.js +103 -0
  28. package/resources/course-chapters.js.map +1 -0
  29. package/resources/course-chapters.mjs +99 -0
  30. package/resources/course-chapters.mjs.map +1 -0
  31. package/resources/course-lessons.d.mts +523 -0
  32. package/resources/course-lessons.d.mts.map +1 -0
  33. package/resources/course-lessons.d.ts +523 -0
  34. package/resources/course-lessons.d.ts.map +1 -0
  35. package/resources/course-lessons.js +101 -0
  36. package/resources/course-lessons.js.map +1 -0
  37. package/resources/course-lessons.mjs +97 -0
  38. package/resources/course-lessons.mjs.map +1 -0
  39. package/resources/courses.d.mts +465 -0
  40. package/resources/courses.d.mts.map +1 -0
  41. package/resources/courses.d.ts +465 -0
  42. package/resources/courses.d.ts.map +1 -0
  43. package/resources/courses.js +98 -0
  44. package/resources/courses.js.map +1 -0
  45. package/resources/courses.mjs +94 -0
  46. package/resources/courses.mjs.map +1 -0
  47. package/resources/experiences.d.mts +59 -1
  48. package/resources/experiences.d.mts.map +1 -1
  49. package/resources/experiences.d.ts +59 -1
  50. package/resources/experiences.d.ts.map +1 -1
  51. package/resources/experiences.js +22 -0
  52. package/resources/experiences.js.map +1 -1
  53. package/resources/experiences.mjs +22 -0
  54. package/resources/experiences.mjs.map +1 -1
  55. package/resources/forum-posts.d.mts +56 -1
  56. package/resources/forum-posts.d.mts.map +1 -1
  57. package/resources/forum-posts.d.ts +56 -1
  58. package/resources/forum-posts.d.ts.map +1 -1
  59. package/resources/forum-posts.js +11 -0
  60. package/resources/forum-posts.js.map +1 -1
  61. package/resources/forum-posts.mjs +11 -0
  62. package/resources/forum-posts.mjs.map +1 -1
  63. package/resources/forums.d.mts +112 -0
  64. package/resources/forums.d.mts.map +1 -0
  65. package/resources/forums.d.ts +112 -0
  66. package/resources/forums.d.ts.map +1 -0
  67. package/resources/forums.js +41 -0
  68. package/resources/forums.js.map +1 -0
  69. package/resources/forums.mjs +37 -0
  70. package/resources/forums.mjs.map +1 -0
  71. package/resources/index.d.mts +12 -5
  72. package/resources/index.d.mts.map +1 -1
  73. package/resources/index.d.ts +12 -5
  74. package/resources/index.d.ts.map +1 -1
  75. package/resources/index.js +15 -1
  76. package/resources/index.js.map +1 -1
  77. package/resources/index.mjs +7 -0
  78. package/resources/index.mjs.map +1 -1
  79. package/resources/invoices.d.mts +5 -2
  80. package/resources/invoices.d.mts.map +1 -1
  81. package/resources/invoices.d.ts +5 -2
  82. package/resources/invoices.d.ts.map +1 -1
  83. package/resources/ledger-accounts.d.mts +1 -1
  84. package/resources/ledger-accounts.d.mts.map +1 -1
  85. package/resources/ledger-accounts.d.ts +1 -1
  86. package/resources/ledger-accounts.d.ts.map +1 -1
  87. package/resources/members.d.mts +274 -0
  88. package/resources/members.d.mts.map +1 -0
  89. package/resources/members.d.ts +274 -0
  90. package/resources/members.d.ts.map +1 -0
  91. package/resources/members.js +35 -0
  92. package/resources/members.js.map +1 -0
  93. package/resources/members.mjs +31 -0
  94. package/resources/members.mjs.map +1 -0
  95. package/resources/memberships.d.mts +26 -5
  96. package/resources/memberships.d.mts.map +1 -1
  97. package/resources/memberships.d.ts +26 -5
  98. package/resources/memberships.d.ts.map +1 -1
  99. package/resources/memberships.js +1 -1
  100. package/resources/memberships.js.map +1 -1
  101. package/resources/memberships.mjs +1 -1
  102. package/resources/memberships.mjs.map +1 -1
  103. package/resources/messages.d.mts +38 -1
  104. package/resources/messages.d.mts.map +1 -1
  105. package/resources/messages.d.ts +38 -1
  106. package/resources/messages.d.ts.map +1 -1
  107. package/resources/messages.js +6 -0
  108. package/resources/messages.js.map +1 -1
  109. package/resources/messages.mjs +6 -0
  110. package/resources/messages.mjs.map +1 -1
  111. package/resources/payments.d.mts +28 -13
  112. package/resources/payments.d.mts.map +1 -1
  113. package/resources/payments.d.ts +28 -13
  114. package/resources/payments.d.ts.map +1 -1
  115. package/resources/plans.d.mts +54 -3
  116. package/resources/plans.d.mts.map +1 -1
  117. package/resources/plans.d.ts +54 -3
  118. package/resources/plans.d.ts.map +1 -1
  119. package/resources/products.d.mts +17 -25
  120. package/resources/products.d.mts.map +1 -1
  121. package/resources/products.d.ts +17 -25
  122. package/resources/products.d.ts.map +1 -1
  123. package/resources/promo-codes.d.mts +394 -0
  124. package/resources/promo-codes.d.mts.map +1 -0
  125. package/resources/promo-codes.d.ts +394 -0
  126. package/resources/promo-codes.d.ts.map +1 -0
  127. package/resources/promo-codes.js +91 -0
  128. package/resources/promo-codes.js.map +1 -0
  129. package/resources/promo-codes.mjs +87 -0
  130. package/resources/promo-codes.mjs.map +1 -0
  131. package/resources/reviews.d.mts +277 -0
  132. package/resources/reviews.d.mts.map +1 -0
  133. package/resources/reviews.d.ts +277 -0
  134. package/resources/reviews.d.ts.map +1 -0
  135. package/resources/reviews.js +23 -0
  136. package/resources/reviews.js.map +1 -0
  137. package/resources/reviews.mjs +19 -0
  138. package/resources/reviews.mjs.map +1 -0
  139. package/resources/shared.d.mts +245 -24
  140. package/resources/shared.d.mts.map +1 -1
  141. package/resources/shared.d.ts +245 -24
  142. package/resources/shared.d.ts.map +1 -1
  143. package/resources/users.d.mts +18 -1
  144. package/resources/users.d.mts.map +1 -1
  145. package/resources/users.d.ts +18 -1
  146. package/resources/users.d.ts.map +1 -1
  147. package/resources/users.js.map +1 -1
  148. package/resources/users.mjs.map +1 -1
  149. package/resources/webhooks.d.mts +224 -2
  150. package/resources/webhooks.d.mts.map +1 -1
  151. package/resources/webhooks.d.ts +224 -2
  152. package/resources/webhooks.d.ts.map +1 -1
  153. package/src/client.ts +197 -3
  154. package/src/resources/apps.ts +18 -0
  155. package/src/resources/checkout-configurations.ts +111 -19
  156. package/src/resources/course-chapters.ts +236 -0
  157. package/src/resources/course-lessons.ts +646 -0
  158. package/src/resources/courses.ts +594 -0
  159. package/src/resources/experiences.ts +71 -0
  160. package/src/resources/forum-posts.ts +71 -0
  161. package/src/resources/forums.ts +152 -0
  162. package/src/resources/index.ts +83 -0
  163. package/src/resources/invoices.ts +5 -2
  164. package/src/resources/ledger-accounts.ts +13 -1
  165. package/src/resources/members.ts +342 -0
  166. package/src/resources/memberships.ts +31 -6
  167. package/src/resources/messages.ts +50 -0
  168. package/src/resources/payments.ts +139 -19
  169. package/src/resources/plans.ts +65 -3
  170. package/src/resources/products.ts +20 -29
  171. package/src/resources/promo-codes.ts +490 -0
  172. package/src/resources/reviews.ts +348 -0
  173. package/src/resources/shared.ts +296 -24
  174. package/src/resources/users.ts +20 -1
  175. package/src/resources/webhooks.ts +293 -1
  176. package/src/version.ts +1 -1
  177. package/version.d.mts +1 -1
  178. package/version.d.mts.map +1 -1
  179. package/version.d.ts +1 -1
  180. package/version.d.ts.map +1 -1
  181. package/version.js +1 -1
  182. package/version.js.map +1 -1
  183. package/version.mjs +1 -1
  184. package/version.mjs.map +1 -1
@@ -0,0 +1,348 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../core/resource';
4
+ import { APIPromise } from '../core/api-promise';
5
+ import { CursorPage, type CursorPageParams, PagePromise } from '../core/pagination';
6
+ import { RequestOptions } from '../internal/request-options';
7
+ import { path } from '../internal/utils/path';
8
+
9
+ export class Reviews extends APIResource {
10
+ /**
11
+ * Retrieve a review by its ID
12
+ */
13
+ retrieve(id: string, options?: RequestOptions): APIPromise<ReviewRetrieveResponse> {
14
+ return this._client.get(path`/reviews/${id}`, options);
15
+ }
16
+
17
+ /**
18
+ * List all reviews
19
+ */
20
+ list(
21
+ query: ReviewListParams,
22
+ options?: RequestOptions,
23
+ ): PagePromise<ReviewListResponsesCursorPage, ReviewListResponse> {
24
+ return this._client.getAPIList('/reviews', CursorPage<ReviewListResponse>, { query, ...options });
25
+ }
26
+ }
27
+
28
+ export type ReviewListResponsesCursorPage = CursorPage<ReviewListResponse>;
29
+
30
+ /**
31
+ * The statuses a review can have
32
+ */
33
+ export type ReviewStatus = 'pending' | 'published' | 'removed';
34
+
35
+ /**
36
+ * An object representing a user review of a company.
37
+ */
38
+ export interface ReviewRetrieveResponse {
39
+ /**
40
+ * The internal ID of the review.
41
+ */
42
+ id: string;
43
+
44
+ /**
45
+ * The attachments attached to the review.
46
+ */
47
+ attachments: Array<ReviewRetrieveResponse.Attachment>;
48
+
49
+ /**
50
+ * The company the review is for.
51
+ */
52
+ company: ReviewRetrieveResponse.Company;
53
+
54
+ /**
55
+ * The timestamp of when the review was created.
56
+ */
57
+ created_at: string;
58
+
59
+ /**
60
+ * The description of the review.
61
+ */
62
+ description: string | null;
63
+
64
+ /**
65
+ * The timestamp of when the user joined the product.
66
+ */
67
+ joined_at: string | null;
68
+
69
+ /**
70
+ * Whether or not the user paid for the product. If null, the payment status is
71
+ * unknown.
72
+ */
73
+ paid_for_product: boolean | null;
74
+
75
+ /**
76
+ * The product the review is for.
77
+ */
78
+ product: ReviewRetrieveResponse.Product;
79
+
80
+ /**
81
+ * The timestamp of when the review was published.
82
+ */
83
+ published_at: string | null;
84
+
85
+ /**
86
+ * The number of stars the user gave the product.
87
+ */
88
+ stars: number;
89
+
90
+ /**
91
+ * The status of the review.
92
+ */
93
+ status: ReviewStatus;
94
+
95
+ /**
96
+ * The title of the review.
97
+ */
98
+ title: string | null;
99
+
100
+ /**
101
+ * The timestamp of when the review was last updated.
102
+ */
103
+ updated_at: string;
104
+
105
+ /**
106
+ * The user account that performed the action.
107
+ */
108
+ user: ReviewRetrieveResponse.User;
109
+ }
110
+
111
+ export namespace ReviewRetrieveResponse {
112
+ /**
113
+ * Represents an image attachment
114
+ */
115
+ export interface Attachment {
116
+ /**
117
+ * The ID of the attachment
118
+ */
119
+ id: string;
120
+
121
+ /**
122
+ * The attachment's content type (e.g., image/jpg, video/mp4)
123
+ */
124
+ content_type: string | null;
125
+
126
+ /**
127
+ * The name of the file
128
+ */
129
+ filename: string | null;
130
+
131
+ /**
132
+ * This is the URL you use to render optimized attachments on the client. This
133
+ * should be used for apps.
134
+ */
135
+ url: string | null;
136
+ }
137
+
138
+ /**
139
+ * The company the review is for.
140
+ */
141
+ export interface Company {
142
+ /**
143
+ * The ID (tag) of the company.
144
+ */
145
+ id: string;
146
+
147
+ /**
148
+ * The slug/route of the company on the Whop site.
149
+ */
150
+ route: string;
151
+
152
+ /**
153
+ * The title of the company.
154
+ */
155
+ title: string;
156
+ }
157
+
158
+ /**
159
+ * The product the review is for.
160
+ */
161
+ export interface Product {
162
+ /**
163
+ * The internal ID of the public product.
164
+ */
165
+ id: string;
166
+
167
+ /**
168
+ * The title of the product. Use for Whop 4.0.
169
+ */
170
+ title: string;
171
+ }
172
+
173
+ /**
174
+ * The user account that performed the action.
175
+ */
176
+ export interface User {
177
+ /**
178
+ * The internal ID of the user.
179
+ */
180
+ id: string;
181
+
182
+ /**
183
+ * The name of the user from their Whop account.
184
+ */
185
+ name: string | null;
186
+
187
+ /**
188
+ * The username of the user from their Whop account.
189
+ */
190
+ username: string;
191
+ }
192
+ }
193
+
194
+ /**
195
+ * An object representing a user review of a company.
196
+ */
197
+ export interface ReviewListResponse {
198
+ /**
199
+ * The internal ID of the review.
200
+ */
201
+ id: string;
202
+
203
+ /**
204
+ * The attachments attached to the review.
205
+ */
206
+ attachments: Array<ReviewListResponse.Attachment>;
207
+
208
+ /**
209
+ * The timestamp of when the review was created.
210
+ */
211
+ created_at: string;
212
+
213
+ /**
214
+ * The description of the review.
215
+ */
216
+ description: string | null;
217
+
218
+ /**
219
+ * The timestamp of when the user joined the product.
220
+ */
221
+ joined_at: string | null;
222
+
223
+ /**
224
+ * Whether or not the user paid for the product. If null, the payment status is
225
+ * unknown.
226
+ */
227
+ paid_for_product: boolean | null;
228
+
229
+ /**
230
+ * The timestamp of when the review was published.
231
+ */
232
+ published_at: string | null;
233
+
234
+ /**
235
+ * The number of stars the user gave the product.
236
+ */
237
+ stars: number;
238
+
239
+ /**
240
+ * The status of the review.
241
+ */
242
+ status: ReviewStatus;
243
+
244
+ /**
245
+ * The title of the review.
246
+ */
247
+ title: string | null;
248
+
249
+ /**
250
+ * The timestamp of when the review was last updated.
251
+ */
252
+ updated_at: string;
253
+
254
+ /**
255
+ * The user account that performed the action.
256
+ */
257
+ user: ReviewListResponse.User;
258
+ }
259
+
260
+ export namespace ReviewListResponse {
261
+ /**
262
+ * Represents an image attachment
263
+ */
264
+ export interface Attachment {
265
+ /**
266
+ * The ID of the attachment
267
+ */
268
+ id: string;
269
+
270
+ /**
271
+ * The attachment's content type (e.g., image/jpg, video/mp4)
272
+ */
273
+ content_type: string | null;
274
+
275
+ /**
276
+ * The name of the file
277
+ */
278
+ filename: string | null;
279
+
280
+ /**
281
+ * This is the URL you use to render optimized attachments on the client. This
282
+ * should be used for apps.
283
+ */
284
+ url: string | null;
285
+ }
286
+
287
+ /**
288
+ * The user account that performed the action.
289
+ */
290
+ export interface User {
291
+ /**
292
+ * The internal ID of the user.
293
+ */
294
+ id: string;
295
+
296
+ /**
297
+ * The name of the user from their Whop account.
298
+ */
299
+ name: string | null;
300
+
301
+ /**
302
+ * The username of the user from their Whop account.
303
+ */
304
+ username: string;
305
+ }
306
+ }
307
+
308
+ export interface ReviewListParams extends CursorPageParams {
309
+ /**
310
+ * The ID of the product
311
+ */
312
+ product_id: string;
313
+
314
+ /**
315
+ * Returns the elements in the list that come before the specified cursor.
316
+ */
317
+ before?: string | null;
318
+
319
+ /**
320
+ * Returns the first _n_ elements from the list.
321
+ */
322
+ first?: number | null;
323
+
324
+ /**
325
+ * Returns the last _n_ elements from the list.
326
+ */
327
+ last?: number | null;
328
+
329
+ /**
330
+ * The maximum star rating of the review (inclusive)
331
+ */
332
+ max_stars?: number | null;
333
+
334
+ /**
335
+ * The minimum star rating of the review (inclusive)
336
+ */
337
+ min_stars?: number | null;
338
+ }
339
+
340
+ export declare namespace Reviews {
341
+ export {
342
+ type ReviewStatus as ReviewStatus,
343
+ type ReviewRetrieveResponse as ReviewRetrieveResponse,
344
+ type ReviewListResponse as ReviewListResponse,
345
+ type ReviewListResponsesCursorPage as ReviewListResponsesCursorPage,
346
+ type ReviewListParams as ReviewListParams,
347
+ };
348
+ }