@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,277 @@
1
+ import { APIResource } from "../core/resource.mjs";
2
+ import { APIPromise } from "../core/api-promise.mjs";
3
+ import { CursorPage, type CursorPageParams, PagePromise } from "../core/pagination.mjs";
4
+ import { RequestOptions } from "../internal/request-options.mjs";
5
+ export declare class Reviews extends APIResource {
6
+ /**
7
+ * Retrieve a review by its ID
8
+ */
9
+ retrieve(id: string, options?: RequestOptions): APIPromise<ReviewRetrieveResponse>;
10
+ /**
11
+ * List all reviews
12
+ */
13
+ list(query: ReviewListParams, options?: RequestOptions): PagePromise<ReviewListResponsesCursorPage, ReviewListResponse>;
14
+ }
15
+ export type ReviewListResponsesCursorPage = CursorPage<ReviewListResponse>;
16
+ /**
17
+ * The statuses a review can have
18
+ */
19
+ export type ReviewStatus = 'pending' | 'published' | 'removed';
20
+ /**
21
+ * An object representing a user review of a company.
22
+ */
23
+ export interface ReviewRetrieveResponse {
24
+ /**
25
+ * The internal ID of the review.
26
+ */
27
+ id: string;
28
+ /**
29
+ * The attachments attached to the review.
30
+ */
31
+ attachments: Array<ReviewRetrieveResponse.Attachment>;
32
+ /**
33
+ * The company the review is for.
34
+ */
35
+ company: ReviewRetrieveResponse.Company;
36
+ /**
37
+ * The timestamp of when the review was created.
38
+ */
39
+ created_at: string;
40
+ /**
41
+ * The description of the review.
42
+ */
43
+ description: string | null;
44
+ /**
45
+ * The timestamp of when the user joined the product.
46
+ */
47
+ joined_at: string | null;
48
+ /**
49
+ * Whether or not the user paid for the product. If null, the payment status is
50
+ * unknown.
51
+ */
52
+ paid_for_product: boolean | null;
53
+ /**
54
+ * The product the review is for.
55
+ */
56
+ product: ReviewRetrieveResponse.Product;
57
+ /**
58
+ * The timestamp of when the review was published.
59
+ */
60
+ published_at: string | null;
61
+ /**
62
+ * The number of stars the user gave the product.
63
+ */
64
+ stars: number;
65
+ /**
66
+ * The status of the review.
67
+ */
68
+ status: ReviewStatus;
69
+ /**
70
+ * The title of the review.
71
+ */
72
+ title: string | null;
73
+ /**
74
+ * The timestamp of when the review was last updated.
75
+ */
76
+ updated_at: string;
77
+ /**
78
+ * The user account that performed the action.
79
+ */
80
+ user: ReviewRetrieveResponse.User;
81
+ }
82
+ export declare namespace ReviewRetrieveResponse {
83
+ /**
84
+ * Represents an image attachment
85
+ */
86
+ interface Attachment {
87
+ /**
88
+ * The ID of the attachment
89
+ */
90
+ id: string;
91
+ /**
92
+ * The attachment's content type (e.g., image/jpg, video/mp4)
93
+ */
94
+ content_type: string | null;
95
+ /**
96
+ * The name of the file
97
+ */
98
+ filename: string | null;
99
+ /**
100
+ * This is the URL you use to render optimized attachments on the client. This
101
+ * should be used for apps.
102
+ */
103
+ url: string | null;
104
+ }
105
+ /**
106
+ * The company the review is for.
107
+ */
108
+ interface Company {
109
+ /**
110
+ * The ID (tag) of the company.
111
+ */
112
+ id: string;
113
+ /**
114
+ * The slug/route of the company on the Whop site.
115
+ */
116
+ route: string;
117
+ /**
118
+ * The title of the company.
119
+ */
120
+ title: string;
121
+ }
122
+ /**
123
+ * The product the review is for.
124
+ */
125
+ interface Product {
126
+ /**
127
+ * The internal ID of the public product.
128
+ */
129
+ id: string;
130
+ /**
131
+ * The title of the product. Use for Whop 4.0.
132
+ */
133
+ title: string;
134
+ }
135
+ /**
136
+ * The user account that performed the action.
137
+ */
138
+ interface User {
139
+ /**
140
+ * The internal ID of the user.
141
+ */
142
+ id: string;
143
+ /**
144
+ * The name of the user from their Whop account.
145
+ */
146
+ name: string | null;
147
+ /**
148
+ * The username of the user from their Whop account.
149
+ */
150
+ username: string;
151
+ }
152
+ }
153
+ /**
154
+ * An object representing a user review of a company.
155
+ */
156
+ export interface ReviewListResponse {
157
+ /**
158
+ * The internal ID of the review.
159
+ */
160
+ id: string;
161
+ /**
162
+ * The attachments attached to the review.
163
+ */
164
+ attachments: Array<ReviewListResponse.Attachment>;
165
+ /**
166
+ * The timestamp of when the review was created.
167
+ */
168
+ created_at: string;
169
+ /**
170
+ * The description of the review.
171
+ */
172
+ description: string | null;
173
+ /**
174
+ * The timestamp of when the user joined the product.
175
+ */
176
+ joined_at: string | null;
177
+ /**
178
+ * Whether or not the user paid for the product. If null, the payment status is
179
+ * unknown.
180
+ */
181
+ paid_for_product: boolean | null;
182
+ /**
183
+ * The timestamp of when the review was published.
184
+ */
185
+ published_at: string | null;
186
+ /**
187
+ * The number of stars the user gave the product.
188
+ */
189
+ stars: number;
190
+ /**
191
+ * The status of the review.
192
+ */
193
+ status: ReviewStatus;
194
+ /**
195
+ * The title of the review.
196
+ */
197
+ title: string | null;
198
+ /**
199
+ * The timestamp of when the review was last updated.
200
+ */
201
+ updated_at: string;
202
+ /**
203
+ * The user account that performed the action.
204
+ */
205
+ user: ReviewListResponse.User;
206
+ }
207
+ export declare namespace ReviewListResponse {
208
+ /**
209
+ * Represents an image attachment
210
+ */
211
+ interface Attachment {
212
+ /**
213
+ * The ID of the attachment
214
+ */
215
+ id: string;
216
+ /**
217
+ * The attachment's content type (e.g., image/jpg, video/mp4)
218
+ */
219
+ content_type: string | null;
220
+ /**
221
+ * The name of the file
222
+ */
223
+ filename: string | null;
224
+ /**
225
+ * This is the URL you use to render optimized attachments on the client. This
226
+ * should be used for apps.
227
+ */
228
+ url: string | null;
229
+ }
230
+ /**
231
+ * The user account that performed the action.
232
+ */
233
+ interface User {
234
+ /**
235
+ * The internal ID of the user.
236
+ */
237
+ id: string;
238
+ /**
239
+ * The name of the user from their Whop account.
240
+ */
241
+ name: string | null;
242
+ /**
243
+ * The username of the user from their Whop account.
244
+ */
245
+ username: string;
246
+ }
247
+ }
248
+ export interface ReviewListParams extends CursorPageParams {
249
+ /**
250
+ * The ID of the product
251
+ */
252
+ product_id: string;
253
+ /**
254
+ * Returns the elements in the list that come before the specified cursor.
255
+ */
256
+ before?: string | null;
257
+ /**
258
+ * Returns the first _n_ elements from the list.
259
+ */
260
+ first?: number | null;
261
+ /**
262
+ * Returns the last _n_ elements from the list.
263
+ */
264
+ last?: number | null;
265
+ /**
266
+ * The maximum star rating of the review (inclusive)
267
+ */
268
+ max_stars?: number | null;
269
+ /**
270
+ * The minimum star rating of the review (inclusive)
271
+ */
272
+ min_stars?: number | null;
273
+ }
274
+ export declare namespace Reviews {
275
+ export { type ReviewStatus as ReviewStatus, type ReviewRetrieveResponse as ReviewRetrieveResponse, type ReviewListResponse as ReviewListResponse, type ReviewListResponsesCursorPage as ReviewListResponsesCursorPage, type ReviewListParams as ReviewListParams, };
276
+ }
277
+ //# sourceMappingURL=reviews.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reviews.d.mts","sourceRoot":"","sources":["../src/resources/reviews.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,WAAW,EAAE;OAClD,EAAE,cAAc,EAAE;AAGzB,qBAAa,OAAQ,SAAQ,WAAW;IACtC;;OAEG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,sBAAsB,CAAC;IAIlF;;OAEG;IACH,IAAI,CACF,KAAK,EAAE,gBAAgB,EACvB,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,6BAA6B,EAAE,kBAAkB,CAAC;CAGlE;AAED,MAAM,MAAM,6BAA6B,GAAG,UAAU,CAAC,kBAAkB,CAAC,CAAC;AAE3E;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,CAAC;AAE/D;;GAEG;AACH,MAAM,WAAW,sBA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EG;QACH,EAAE,EAAE,MAAM,CAAC;QAEX;;WAEG;QACH,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;QAEpB;;WAEG;QACH,QAAQ,EAAE,MAAM,CAAC;KAClB;CACF;AAED,MAAM,WAAW,gBAAiB,SAAQ,gBAAgB;IACxD;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEvB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEtB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAErB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE1B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,OAAO,EACL,KAAK,YAAY,IAAI,YAAY,EACjC,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;CACH"}
@@ -0,0 +1,277 @@
1
+ import { APIResource } from "../core/resource.js";
2
+ import { APIPromise } from "../core/api-promise.js";
3
+ import { CursorPage, type CursorPageParams, PagePromise } from "../core/pagination.js";
4
+ import { RequestOptions } from "../internal/request-options.js";
5
+ export declare class Reviews extends APIResource {
6
+ /**
7
+ * Retrieve a review by its ID
8
+ */
9
+ retrieve(id: string, options?: RequestOptions): APIPromise<ReviewRetrieveResponse>;
10
+ /**
11
+ * List all reviews
12
+ */
13
+ list(query: ReviewListParams, options?: RequestOptions): PagePromise<ReviewListResponsesCursorPage, ReviewListResponse>;
14
+ }
15
+ export type ReviewListResponsesCursorPage = CursorPage<ReviewListResponse>;
16
+ /**
17
+ * The statuses a review can have
18
+ */
19
+ export type ReviewStatus = 'pending' | 'published' | 'removed';
20
+ /**
21
+ * An object representing a user review of a company.
22
+ */
23
+ export interface ReviewRetrieveResponse {
24
+ /**
25
+ * The internal ID of the review.
26
+ */
27
+ id: string;
28
+ /**
29
+ * The attachments attached to the review.
30
+ */
31
+ attachments: Array<ReviewRetrieveResponse.Attachment>;
32
+ /**
33
+ * The company the review is for.
34
+ */
35
+ company: ReviewRetrieveResponse.Company;
36
+ /**
37
+ * The timestamp of when the review was created.
38
+ */
39
+ created_at: string;
40
+ /**
41
+ * The description of the review.
42
+ */
43
+ description: string | null;
44
+ /**
45
+ * The timestamp of when the user joined the product.
46
+ */
47
+ joined_at: string | null;
48
+ /**
49
+ * Whether or not the user paid for the product. If null, the payment status is
50
+ * unknown.
51
+ */
52
+ paid_for_product: boolean | null;
53
+ /**
54
+ * The product the review is for.
55
+ */
56
+ product: ReviewRetrieveResponse.Product;
57
+ /**
58
+ * The timestamp of when the review was published.
59
+ */
60
+ published_at: string | null;
61
+ /**
62
+ * The number of stars the user gave the product.
63
+ */
64
+ stars: number;
65
+ /**
66
+ * The status of the review.
67
+ */
68
+ status: ReviewStatus;
69
+ /**
70
+ * The title of the review.
71
+ */
72
+ title: string | null;
73
+ /**
74
+ * The timestamp of when the review was last updated.
75
+ */
76
+ updated_at: string;
77
+ /**
78
+ * The user account that performed the action.
79
+ */
80
+ user: ReviewRetrieveResponse.User;
81
+ }
82
+ export declare namespace ReviewRetrieveResponse {
83
+ /**
84
+ * Represents an image attachment
85
+ */
86
+ interface Attachment {
87
+ /**
88
+ * The ID of the attachment
89
+ */
90
+ id: string;
91
+ /**
92
+ * The attachment's content type (e.g., image/jpg, video/mp4)
93
+ */
94
+ content_type: string | null;
95
+ /**
96
+ * The name of the file
97
+ */
98
+ filename: string | null;
99
+ /**
100
+ * This is the URL you use to render optimized attachments on the client. This
101
+ * should be used for apps.
102
+ */
103
+ url: string | null;
104
+ }
105
+ /**
106
+ * The company the review is for.
107
+ */
108
+ interface Company {
109
+ /**
110
+ * The ID (tag) of the company.
111
+ */
112
+ id: string;
113
+ /**
114
+ * The slug/route of the company on the Whop site.
115
+ */
116
+ route: string;
117
+ /**
118
+ * The title of the company.
119
+ */
120
+ title: string;
121
+ }
122
+ /**
123
+ * The product the review is for.
124
+ */
125
+ interface Product {
126
+ /**
127
+ * The internal ID of the public product.
128
+ */
129
+ id: string;
130
+ /**
131
+ * The title of the product. Use for Whop 4.0.
132
+ */
133
+ title: string;
134
+ }
135
+ /**
136
+ * The user account that performed the action.
137
+ */
138
+ interface User {
139
+ /**
140
+ * The internal ID of the user.
141
+ */
142
+ id: string;
143
+ /**
144
+ * The name of the user from their Whop account.
145
+ */
146
+ name: string | null;
147
+ /**
148
+ * The username of the user from their Whop account.
149
+ */
150
+ username: string;
151
+ }
152
+ }
153
+ /**
154
+ * An object representing a user review of a company.
155
+ */
156
+ export interface ReviewListResponse {
157
+ /**
158
+ * The internal ID of the review.
159
+ */
160
+ id: string;
161
+ /**
162
+ * The attachments attached to the review.
163
+ */
164
+ attachments: Array<ReviewListResponse.Attachment>;
165
+ /**
166
+ * The timestamp of when the review was created.
167
+ */
168
+ created_at: string;
169
+ /**
170
+ * The description of the review.
171
+ */
172
+ description: string | null;
173
+ /**
174
+ * The timestamp of when the user joined the product.
175
+ */
176
+ joined_at: string | null;
177
+ /**
178
+ * Whether or not the user paid for the product. If null, the payment status is
179
+ * unknown.
180
+ */
181
+ paid_for_product: boolean | null;
182
+ /**
183
+ * The timestamp of when the review was published.
184
+ */
185
+ published_at: string | null;
186
+ /**
187
+ * The number of stars the user gave the product.
188
+ */
189
+ stars: number;
190
+ /**
191
+ * The status of the review.
192
+ */
193
+ status: ReviewStatus;
194
+ /**
195
+ * The title of the review.
196
+ */
197
+ title: string | null;
198
+ /**
199
+ * The timestamp of when the review was last updated.
200
+ */
201
+ updated_at: string;
202
+ /**
203
+ * The user account that performed the action.
204
+ */
205
+ user: ReviewListResponse.User;
206
+ }
207
+ export declare namespace ReviewListResponse {
208
+ /**
209
+ * Represents an image attachment
210
+ */
211
+ interface Attachment {
212
+ /**
213
+ * The ID of the attachment
214
+ */
215
+ id: string;
216
+ /**
217
+ * The attachment's content type (e.g., image/jpg, video/mp4)
218
+ */
219
+ content_type: string | null;
220
+ /**
221
+ * The name of the file
222
+ */
223
+ filename: string | null;
224
+ /**
225
+ * This is the URL you use to render optimized attachments on the client. This
226
+ * should be used for apps.
227
+ */
228
+ url: string | null;
229
+ }
230
+ /**
231
+ * The user account that performed the action.
232
+ */
233
+ interface User {
234
+ /**
235
+ * The internal ID of the user.
236
+ */
237
+ id: string;
238
+ /**
239
+ * The name of the user from their Whop account.
240
+ */
241
+ name: string | null;
242
+ /**
243
+ * The username of the user from their Whop account.
244
+ */
245
+ username: string;
246
+ }
247
+ }
248
+ export interface ReviewListParams extends CursorPageParams {
249
+ /**
250
+ * The ID of the product
251
+ */
252
+ product_id: string;
253
+ /**
254
+ * Returns the elements in the list that come before the specified cursor.
255
+ */
256
+ before?: string | null;
257
+ /**
258
+ * Returns the first _n_ elements from the list.
259
+ */
260
+ first?: number | null;
261
+ /**
262
+ * Returns the last _n_ elements from the list.
263
+ */
264
+ last?: number | null;
265
+ /**
266
+ * The maximum star rating of the review (inclusive)
267
+ */
268
+ max_stars?: number | null;
269
+ /**
270
+ * The minimum star rating of the review (inclusive)
271
+ */
272
+ min_stars?: number | null;
273
+ }
274
+ export declare namespace Reviews {
275
+ export { type ReviewStatus as ReviewStatus, type ReviewRetrieveResponse as ReviewRetrieveResponse, type ReviewListResponse as ReviewListResponse, type ReviewListResponsesCursorPage as ReviewListResponsesCursorPage, type ReviewListParams as ReviewListParams, };
276
+ }
277
+ //# sourceMappingURL=reviews.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reviews.d.ts","sourceRoot":"","sources":["../src/resources/reviews.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,UAAU,EAAE,KAAK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AA6B,EACnE,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;CACH"}
@@ -0,0 +1,23 @@
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.Reviews = 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 Reviews extends resource_1.APIResource {
9
+ /**
10
+ * Retrieve a review by its ID
11
+ */
12
+ retrieve(id, options) {
13
+ return this._client.get((0, path_1.path) `/reviews/${id}`, options);
14
+ }
15
+ /**
16
+ * List all reviews
17
+ */
18
+ list(query, options) {
19
+ return this._client.getAPIList('/reviews', (pagination_1.CursorPage), { query, ...options });
20
+ }
21
+ }
22
+ exports.Reviews = Reviews;
23
+ //# sourceMappingURL=reviews.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reviews.js","sourceRoot":"","sources":["../src/resources/reviews.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAE/C,sDAAoF;AAEpF,oDAA8C;AAE9C,MAAa,OAAQ,SAAQ,sBAAW;IACtC;;OAEG;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;;OAEG;IACH,IAAI,CACF,KAAuB,EACvB,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;CACF;AAjBD,0BAiBC"}
@@ -0,0 +1,19 @@
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 Reviews extends APIResource {
6
+ /**
7
+ * Retrieve a review by its ID
8
+ */
9
+ retrieve(id, options) {
10
+ return this._client.get(path `/reviews/${id}`, options);
11
+ }
12
+ /**
13
+ * List all reviews
14
+ */
15
+ list(query, options) {
16
+ return this._client.getAPIList('/reviews', (CursorPage), { query, ...options });
17
+ }
18
+ }
19
+ //# sourceMappingURL=reviews.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reviews.mjs","sourceRoot":"","sources":["../src/resources/reviews.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,EAAE,UAAU,EAAsC;OAElD,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,OAAQ,SAAQ,WAAW;IACtC;;OAEG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,YAAY,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC;IAED;;OAEG;IACH,IAAI,CACF,KAAuB,EACvB,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,UAAU,EAAE,CAAA,UAA8B,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACpG,CAAC;CACF"}