@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.
- package/CHANGELOG.md +44 -0
- package/client.d.mts +39 -11
- package/client.d.mts.map +1 -1
- package/client.d.ts +39 -11
- package/client.d.ts.map +1 -1
- package/client.js +23 -2
- package/client.js.map +1 -1
- package/client.mjs +23 -2
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/apps.d.mts +16 -0
- package/resources/apps.d.mts.map +1 -1
- package/resources/apps.d.ts +16 -0
- package/resources/apps.d.ts.map +1 -1
- package/resources/checkout-configurations.d.mts +96 -19
- package/resources/checkout-configurations.d.mts.map +1 -1
- package/resources/checkout-configurations.d.ts +96 -19
- package/resources/checkout-configurations.d.ts.map +1 -1
- package/resources/checkout-configurations.js +3 -1
- package/resources/checkout-configurations.js.map +1 -1
- package/resources/checkout-configurations.mjs +3 -1
- package/resources/checkout-configurations.mjs.map +1 -1
- package/resources/course-chapters.d.mts +185 -0
- package/resources/course-chapters.d.mts.map +1 -0
- package/resources/course-chapters.d.ts +185 -0
- package/resources/course-chapters.d.ts.map +1 -0
- package/resources/course-chapters.js +103 -0
- package/resources/course-chapters.js.map +1 -0
- package/resources/course-chapters.mjs +99 -0
- package/resources/course-chapters.mjs.map +1 -0
- package/resources/course-lessons.d.mts +523 -0
- package/resources/course-lessons.d.mts.map +1 -0
- package/resources/course-lessons.d.ts +523 -0
- package/resources/course-lessons.d.ts.map +1 -0
- package/resources/course-lessons.js +101 -0
- package/resources/course-lessons.js.map +1 -0
- package/resources/course-lessons.mjs +97 -0
- package/resources/course-lessons.mjs.map +1 -0
- package/resources/courses.d.mts +465 -0
- package/resources/courses.d.mts.map +1 -0
- package/resources/courses.d.ts +465 -0
- package/resources/courses.d.ts.map +1 -0
- package/resources/courses.js +98 -0
- package/resources/courses.js.map +1 -0
- package/resources/courses.mjs +94 -0
- package/resources/courses.mjs.map +1 -0
- package/resources/experiences.d.mts +59 -1
- package/resources/experiences.d.mts.map +1 -1
- package/resources/experiences.d.ts +59 -1
- package/resources/experiences.d.ts.map +1 -1
- package/resources/experiences.js +22 -0
- package/resources/experiences.js.map +1 -1
- package/resources/experiences.mjs +22 -0
- package/resources/experiences.mjs.map +1 -1
- package/resources/forum-posts.d.mts +56 -1
- package/resources/forum-posts.d.mts.map +1 -1
- package/resources/forum-posts.d.ts +56 -1
- package/resources/forum-posts.d.ts.map +1 -1
- package/resources/forum-posts.js +11 -0
- package/resources/forum-posts.js.map +1 -1
- package/resources/forum-posts.mjs +11 -0
- package/resources/forum-posts.mjs.map +1 -1
- package/resources/forums.d.mts +112 -0
- package/resources/forums.d.mts.map +1 -0
- package/resources/forums.d.ts +112 -0
- package/resources/forums.d.ts.map +1 -0
- package/resources/forums.js +41 -0
- package/resources/forums.js.map +1 -0
- package/resources/forums.mjs +37 -0
- package/resources/forums.mjs.map +1 -0
- package/resources/index.d.mts +12 -5
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +12 -5
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +15 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +7 -0
- package/resources/index.mjs.map +1 -1
- package/resources/invoices.d.mts +5 -2
- package/resources/invoices.d.mts.map +1 -1
- package/resources/invoices.d.ts +5 -2
- package/resources/invoices.d.ts.map +1 -1
- package/resources/ledger-accounts.d.mts +1 -1
- package/resources/ledger-accounts.d.mts.map +1 -1
- package/resources/ledger-accounts.d.ts +1 -1
- package/resources/ledger-accounts.d.ts.map +1 -1
- package/resources/members.d.mts +274 -0
- package/resources/members.d.mts.map +1 -0
- package/resources/members.d.ts +274 -0
- package/resources/members.d.ts.map +1 -0
- package/resources/members.js +35 -0
- package/resources/members.js.map +1 -0
- package/resources/members.mjs +31 -0
- package/resources/members.mjs.map +1 -0
- package/resources/memberships.d.mts +26 -5
- package/resources/memberships.d.mts.map +1 -1
- package/resources/memberships.d.ts +26 -5
- package/resources/memberships.d.ts.map +1 -1
- package/resources/memberships.js +1 -1
- package/resources/memberships.js.map +1 -1
- package/resources/memberships.mjs +1 -1
- package/resources/memberships.mjs.map +1 -1
- package/resources/messages.d.mts +38 -1
- package/resources/messages.d.mts.map +1 -1
- package/resources/messages.d.ts +38 -1
- package/resources/messages.d.ts.map +1 -1
- package/resources/messages.js +6 -0
- package/resources/messages.js.map +1 -1
- package/resources/messages.mjs +6 -0
- package/resources/messages.mjs.map +1 -1
- package/resources/payments.d.mts +28 -13
- package/resources/payments.d.mts.map +1 -1
- package/resources/payments.d.ts +28 -13
- package/resources/payments.d.ts.map +1 -1
- package/resources/plans.d.mts +54 -3
- package/resources/plans.d.mts.map +1 -1
- package/resources/plans.d.ts +54 -3
- package/resources/plans.d.ts.map +1 -1
- package/resources/products.d.mts +17 -25
- package/resources/products.d.mts.map +1 -1
- package/resources/products.d.ts +17 -25
- package/resources/products.d.ts.map +1 -1
- package/resources/promo-codes.d.mts +394 -0
- package/resources/promo-codes.d.mts.map +1 -0
- package/resources/promo-codes.d.ts +394 -0
- package/resources/promo-codes.d.ts.map +1 -0
- package/resources/promo-codes.js +91 -0
- package/resources/promo-codes.js.map +1 -0
- package/resources/promo-codes.mjs +87 -0
- package/resources/promo-codes.mjs.map +1 -0
- package/resources/reviews.d.mts +277 -0
- package/resources/reviews.d.mts.map +1 -0
- package/resources/reviews.d.ts +277 -0
- package/resources/reviews.d.ts.map +1 -0
- package/resources/reviews.js +23 -0
- package/resources/reviews.js.map +1 -0
- package/resources/reviews.mjs +19 -0
- package/resources/reviews.mjs.map +1 -0
- package/resources/shared.d.mts +245 -24
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +245 -24
- package/resources/shared.d.ts.map +1 -1
- package/resources/users.d.mts +18 -1
- package/resources/users.d.mts.map +1 -1
- package/resources/users.d.ts +18 -1
- package/resources/users.d.ts.map +1 -1
- package/resources/users.js.map +1 -1
- package/resources/users.mjs.map +1 -1
- package/resources/webhooks.d.mts +224 -2
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +224 -2
- package/resources/webhooks.d.ts.map +1 -1
- package/src/client.ts +197 -3
- package/src/resources/apps.ts +18 -0
- package/src/resources/checkout-configurations.ts +111 -19
- package/src/resources/course-chapters.ts +236 -0
- package/src/resources/course-lessons.ts +646 -0
- package/src/resources/courses.ts +594 -0
- package/src/resources/experiences.ts +71 -0
- package/src/resources/forum-posts.ts +71 -0
- package/src/resources/forums.ts +152 -0
- package/src/resources/index.ts +83 -0
- package/src/resources/invoices.ts +5 -2
- package/src/resources/ledger-accounts.ts +13 -1
- package/src/resources/members.ts +342 -0
- package/src/resources/memberships.ts +31 -6
- package/src/resources/messages.ts +50 -0
- package/src/resources/payments.ts +139 -19
- package/src/resources/plans.ts +65 -3
- package/src/resources/products.ts +20 -29
- package/src/resources/promo-codes.ts +490 -0
- package/src/resources/reviews.ts +348 -0
- package/src/resources/shared.ts +296 -24
- package/src/resources/users.ts +20 -1
- package/src/resources/webhooks.ts +293 -1
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.mts.map +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import * as Shared from './shared';
|
|
5
|
+
import { APIPromise } from '../core/api-promise';
|
|
6
|
+
import { CursorPage, type CursorPageParams, PagePromise } from '../core/pagination';
|
|
7
|
+
import { RequestOptions } from '../internal/request-options';
|
|
8
|
+
import { path } from '../internal/utils/path';
|
|
9
|
+
|
|
10
|
+
export class Members extends APIResource {
|
|
11
|
+
/**
|
|
12
|
+
* Retrieves a member of a company by ID
|
|
13
|
+
*
|
|
14
|
+
* Required permissions:
|
|
15
|
+
*
|
|
16
|
+
* - `member:basic:read`
|
|
17
|
+
* - `member:email:read`
|
|
18
|
+
* - `member:phone:read`
|
|
19
|
+
*/
|
|
20
|
+
retrieve(id: string, options?: RequestOptions): APIPromise<MemberRetrieveResponse> {
|
|
21
|
+
return this._client.get(path`/members/${id}`, options);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* List the members of a company
|
|
26
|
+
*
|
|
27
|
+
* Required permissions:
|
|
28
|
+
*
|
|
29
|
+
* - `member:basic:read`
|
|
30
|
+
* - `member:email:read`
|
|
31
|
+
* - `member:phone:read`
|
|
32
|
+
*/
|
|
33
|
+
list(
|
|
34
|
+
query: MemberListParams,
|
|
35
|
+
options?: RequestOptions,
|
|
36
|
+
): PagePromise<MemberListResponsesCursorPage, MemberListResponse> {
|
|
37
|
+
return this._client.getAPIList('/members', CursorPage<MemberListResponse>, { query, ...options });
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export type MemberListResponsesCursorPage = CursorPage<MemberListResponse>;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* An object representing a connection between a creator and a user/company_buyer.
|
|
45
|
+
* This type should only be made visible to the user/company_buyer who is a part of
|
|
46
|
+
* the connection.
|
|
47
|
+
*/
|
|
48
|
+
export interface MemberRetrieveResponse {
|
|
49
|
+
/**
|
|
50
|
+
* The ID of the member
|
|
51
|
+
*/
|
|
52
|
+
id: string;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* The access level of the product member. If its admin, the member is an
|
|
56
|
+
* authorized user of the access pass. If its customer, the member has a valid
|
|
57
|
+
* membership to the access pass. If its no_access, the member does not have access
|
|
58
|
+
* to the access pass.
|
|
59
|
+
*/
|
|
60
|
+
access_level: Shared.AccessLevel;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* The company for the member.
|
|
64
|
+
*/
|
|
65
|
+
company: MemberRetrieveResponse.Company;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* When the member was created
|
|
69
|
+
*/
|
|
70
|
+
created_at: string;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* When the member joined the company
|
|
74
|
+
*/
|
|
75
|
+
joined_at: string;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* The different most recent actions a member can have.
|
|
79
|
+
*/
|
|
80
|
+
most_recent_action: Shared.MemberMostRecentActions | null;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* The time for the most recent action, if applicable.
|
|
84
|
+
*/
|
|
85
|
+
most_recent_action_at: string | null;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* The phone number for the member, if available.
|
|
89
|
+
*/
|
|
90
|
+
phone: string | null;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* The status of the member
|
|
94
|
+
*/
|
|
95
|
+
status: Shared.MemberStatuses;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* The timestamp of when this member was last updated
|
|
99
|
+
*/
|
|
100
|
+
updated_at: string;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* How much money this customer has spent on the company's products and plans
|
|
104
|
+
*/
|
|
105
|
+
usd_total_spent: number;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* The user for this member, if any.
|
|
109
|
+
*/
|
|
110
|
+
user: MemberRetrieveResponse.User | null;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export namespace MemberRetrieveResponse {
|
|
114
|
+
/**
|
|
115
|
+
* The company for the member.
|
|
116
|
+
*/
|
|
117
|
+
export interface Company {
|
|
118
|
+
/**
|
|
119
|
+
* The ID of the company
|
|
120
|
+
*/
|
|
121
|
+
id: string;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* The slug/route of the company on the Whop site.
|
|
125
|
+
*/
|
|
126
|
+
route: string;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* The written name of the company.
|
|
130
|
+
*/
|
|
131
|
+
title: string;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* The user for this member, if any.
|
|
136
|
+
*/
|
|
137
|
+
export interface User {
|
|
138
|
+
/**
|
|
139
|
+
* The internal ID of the user account.
|
|
140
|
+
*/
|
|
141
|
+
id: string;
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* The digital mailing address of the user.
|
|
145
|
+
*/
|
|
146
|
+
email: string | null;
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* The user's full name.
|
|
150
|
+
*/
|
|
151
|
+
name: string | null;
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* The whop username.
|
|
155
|
+
*/
|
|
156
|
+
username: string;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* An object representing a connection between a creator and a user/company_buyer.
|
|
162
|
+
* This type should only be made visible to the user/company_buyer who is a part of
|
|
163
|
+
* the connection.
|
|
164
|
+
*/
|
|
165
|
+
export interface MemberListResponse {
|
|
166
|
+
/**
|
|
167
|
+
* The ID of the member
|
|
168
|
+
*/
|
|
169
|
+
id: string;
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* The access level of the product member. If its admin, the member is an
|
|
173
|
+
* authorized user of the access pass. If its customer, the member has a valid
|
|
174
|
+
* membership to the access pass. If its no_access, the member does not have access
|
|
175
|
+
* to the access pass.
|
|
176
|
+
*/
|
|
177
|
+
access_level: Shared.AccessLevel;
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* When the member was created
|
|
181
|
+
*/
|
|
182
|
+
created_at: string;
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* When the member joined the company
|
|
186
|
+
*/
|
|
187
|
+
joined_at: string;
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* The different most recent actions a member can have.
|
|
191
|
+
*/
|
|
192
|
+
most_recent_action: Shared.MemberMostRecentActions | null;
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* The time for the most recent action, if applicable.
|
|
196
|
+
*/
|
|
197
|
+
most_recent_action_at: string | null;
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* The phone number for the member, if available.
|
|
201
|
+
*/
|
|
202
|
+
phone: string | null;
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* The status of the member
|
|
206
|
+
*/
|
|
207
|
+
status: Shared.MemberStatuses;
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* The timestamp of when this member was last updated
|
|
211
|
+
*/
|
|
212
|
+
updated_at: string;
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* How much money this customer has spent on the company's products and plans
|
|
216
|
+
*/
|
|
217
|
+
usd_total_spent: number;
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* The user for this member, if any.
|
|
221
|
+
*/
|
|
222
|
+
user: MemberListResponse.User | null;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
export namespace MemberListResponse {
|
|
226
|
+
/**
|
|
227
|
+
* The user for this member, if any.
|
|
228
|
+
*/
|
|
229
|
+
export interface User {
|
|
230
|
+
/**
|
|
231
|
+
* The internal ID of the user account.
|
|
232
|
+
*/
|
|
233
|
+
id: string;
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* The digital mailing address of the user.
|
|
237
|
+
*/
|
|
238
|
+
email: string | null;
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* The user's full name.
|
|
242
|
+
*/
|
|
243
|
+
name: string | null;
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* The whop username.
|
|
247
|
+
*/
|
|
248
|
+
username: string;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
export interface MemberListParams extends CursorPageParams {
|
|
253
|
+
/**
|
|
254
|
+
* The ID of the company to list members for
|
|
255
|
+
*/
|
|
256
|
+
company_id: string;
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* The access level a given user (or company) has to an access pass or company.
|
|
260
|
+
*/
|
|
261
|
+
access_level?: Shared.AccessLevel | null;
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* The access pass IDs to filter the members by
|
|
265
|
+
*/
|
|
266
|
+
access_pass_ids?: Array<string> | null;
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* Returns the elements in the list that come before the specified cursor.
|
|
270
|
+
*/
|
|
271
|
+
before?: string | null;
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* The minimum creation date to filter by
|
|
275
|
+
*/
|
|
276
|
+
created_after?: string | null;
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* The maximum creation date to filter by
|
|
280
|
+
*/
|
|
281
|
+
created_before?: string | null;
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* The direction of the sort.
|
|
285
|
+
*/
|
|
286
|
+
direction?: Shared.Direction | null;
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* Returns the first _n_ elements from the list.
|
|
290
|
+
*/
|
|
291
|
+
first?: number | null;
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* Returns the last _n_ elements from the list.
|
|
295
|
+
*/
|
|
296
|
+
last?: number | null;
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* The most recent actions to filter the members by
|
|
300
|
+
*/
|
|
301
|
+
most_recent_actions?: Array<Shared.MemberMostRecentActions> | null;
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* Which columns can be used to sort.
|
|
305
|
+
*/
|
|
306
|
+
order?: 'id' | 'usd_total_spent' | 'created_at' | 'joined_at' | 'most_recent_action' | null;
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* The plan IDs to filter the members by
|
|
310
|
+
*/
|
|
311
|
+
plan_ids?: Array<string> | null;
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* The promo code IDs to filter the members by
|
|
315
|
+
*/
|
|
316
|
+
promo_code_ids?: Array<string> | null;
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* The name, username, or email to filter the members by. The email filter will
|
|
320
|
+
* only apply if the current actor has the `member:email:read` permission.
|
|
321
|
+
*/
|
|
322
|
+
query?: string | null;
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* The statuses to filter the members by
|
|
326
|
+
*/
|
|
327
|
+
statuses?: Array<Shared.MemberStatuses> | null;
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* The user IDs to filter the members by
|
|
331
|
+
*/
|
|
332
|
+
user_ids?: Array<string> | null;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
export declare namespace Members {
|
|
336
|
+
export {
|
|
337
|
+
type MemberRetrieveResponse as MemberRetrieveResponse,
|
|
338
|
+
type MemberListResponse as MemberListResponse,
|
|
339
|
+
type MemberListResponsesCursorPage as MemberListResponsesCursorPage,
|
|
340
|
+
type MemberListParams as MemberListParams,
|
|
341
|
+
};
|
|
342
|
+
}
|
|
@@ -43,7 +43,7 @@ export class Memberships extends APIResource {
|
|
|
43
43
|
* - `member:basic:read`
|
|
44
44
|
*/
|
|
45
45
|
list(
|
|
46
|
-
query: MembershipListParams,
|
|
46
|
+
query: MembershipListParams | null | undefined = {},
|
|
47
47
|
options?: RequestOptions,
|
|
48
48
|
): PagePromise<MembershipListResponsesCursorPage, MembershipListResponse> {
|
|
49
49
|
return this._client.getAPIList('/memberships', CursorPage<MembershipListResponse>, { query, ...options });
|
|
@@ -169,6 +169,11 @@ export interface MembershipListResponse {
|
|
|
169
169
|
*/
|
|
170
170
|
plan: MembershipListResponse.Plan;
|
|
171
171
|
|
|
172
|
+
/**
|
|
173
|
+
* The Product this Membership grants access to.
|
|
174
|
+
*/
|
|
175
|
+
product: MembershipListResponse.Product;
|
|
176
|
+
|
|
172
177
|
/**
|
|
173
178
|
* The Promo Code that is currently applied to this Membership.
|
|
174
179
|
*/
|
|
@@ -238,6 +243,21 @@ export namespace MembershipListResponse {
|
|
|
238
243
|
id: string;
|
|
239
244
|
}
|
|
240
245
|
|
|
246
|
+
/**
|
|
247
|
+
* The Product this Membership grants access to.
|
|
248
|
+
*/
|
|
249
|
+
export interface Product {
|
|
250
|
+
/**
|
|
251
|
+
* The internal ID of the public product.
|
|
252
|
+
*/
|
|
253
|
+
id: string;
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* The title of the product. Use for Whop 4.0.
|
|
257
|
+
*/
|
|
258
|
+
title: string;
|
|
259
|
+
}
|
|
260
|
+
|
|
241
261
|
/**
|
|
242
262
|
* The Promo Code that is currently applied to this Membership.
|
|
243
263
|
*/
|
|
@@ -277,11 +297,6 @@ export interface MembershipUpdateParams {
|
|
|
277
297
|
}
|
|
278
298
|
|
|
279
299
|
export interface MembershipListParams extends CursorPageParams {
|
|
280
|
-
/**
|
|
281
|
-
* The ID of the company to list memberships for
|
|
282
|
-
*/
|
|
283
|
-
company_id: string;
|
|
284
|
-
|
|
285
300
|
/**
|
|
286
301
|
* The access pass IDs to filter the memberships by
|
|
287
302
|
*/
|
|
@@ -305,6 +320,11 @@ export interface MembershipListParams extends CursorPageParams {
|
|
|
305
320
|
| 'testing'
|
|
306
321
|
> | null;
|
|
307
322
|
|
|
323
|
+
/**
|
|
324
|
+
* The ID of the company to list memberships for
|
|
325
|
+
*/
|
|
326
|
+
company_id?: string | null;
|
|
327
|
+
|
|
308
328
|
/**
|
|
309
329
|
* The minimum creation date to filter by
|
|
310
330
|
*/
|
|
@@ -349,6 +369,11 @@ export interface MembershipListParams extends CursorPageParams {
|
|
|
349
369
|
* The membership status to filter the memberships by
|
|
350
370
|
*/
|
|
351
371
|
statuses?: Array<Shared.MembershipStatus> | null;
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* Only return memberships from these whop user ids
|
|
375
|
+
*/
|
|
376
|
+
user_ids?: Array<string> | null;
|
|
352
377
|
}
|
|
353
378
|
|
|
354
379
|
export interface MembershipCancelParams {
|
|
@@ -30,6 +30,17 @@ export class Messages extends APIResource {
|
|
|
30
30
|
return this._client.get(path`/messages/${id}`, options);
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
/**
|
|
34
|
+
* Updates an existing message
|
|
35
|
+
*/
|
|
36
|
+
update(
|
|
37
|
+
id: string,
|
|
38
|
+
body: MessageUpdateParams | null | undefined = {},
|
|
39
|
+
options?: RequestOptions,
|
|
40
|
+
): APIPromise<Shared.Message> {
|
|
41
|
+
return this._client.patch(path`/messages/${id}`, { body, ...options });
|
|
42
|
+
}
|
|
43
|
+
|
|
33
44
|
/**
|
|
34
45
|
* Lists messages inside a channel
|
|
35
46
|
*
|
|
@@ -266,6 +277,44 @@ export namespace MessageCreateParams {
|
|
|
266
277
|
}
|
|
267
278
|
}
|
|
268
279
|
|
|
280
|
+
export interface MessageUpdateParams {
|
|
281
|
+
/**
|
|
282
|
+
* The attachments for this message
|
|
283
|
+
*/
|
|
284
|
+
attachments?: Array<MessageUpdateParams.Attachment> | null;
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* The content of the message in Markdown format
|
|
288
|
+
*/
|
|
289
|
+
content?: string | null;
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* Whether this message is pinned
|
|
293
|
+
*/
|
|
294
|
+
is_pinned?: boolean | null;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
export namespace MessageUpdateParams {
|
|
298
|
+
/**
|
|
299
|
+
* Input for an attachment
|
|
300
|
+
*/
|
|
301
|
+
export interface Attachment {
|
|
302
|
+
/**
|
|
303
|
+
* The ID of an existing attachment object. Use this when updating a resource and
|
|
304
|
+
* keeping a subset of the attachments. Don't use this unless you know what you're
|
|
305
|
+
* doing.
|
|
306
|
+
*/
|
|
307
|
+
id?: string | null;
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* This ID should be used the first time you upload an attachment. It is the ID of
|
|
311
|
+
* the direct upload that was created when uploading the file to S3 via the
|
|
312
|
+
* mediaDirectUpload mutation.
|
|
313
|
+
*/
|
|
314
|
+
direct_upload_id?: string | null;
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
|
|
269
318
|
export interface MessageListParams extends CursorPageParams {
|
|
270
319
|
/**
|
|
271
320
|
* The ID of the channel or the experience ID to list messages for
|
|
@@ -298,6 +347,7 @@ export declare namespace Messages {
|
|
|
298
347
|
type MessageListResponse as MessageListResponse,
|
|
299
348
|
type MessageListResponsesCursorPage as MessageListResponsesCursorPage,
|
|
300
349
|
type MessageCreateParams as MessageCreateParams,
|
|
350
|
+
type MessageUpdateParams as MessageUpdateParams,
|
|
301
351
|
type MessageListParams as MessageListParams,
|
|
302
352
|
};
|
|
303
353
|
}
|
|
@@ -141,6 +141,127 @@ export class Payments extends APIResource {
|
|
|
141
141
|
|
|
142
142
|
export type PaymentListResponsesCursorPage = CursorPage<PaymentListResponse>;
|
|
143
143
|
|
|
144
|
+
/**
|
|
145
|
+
* The reason why a specific payment was billed
|
|
146
|
+
*/
|
|
147
|
+
export type BillingReasons =
|
|
148
|
+
| 'subscription_create'
|
|
149
|
+
| 'subscription_cycle'
|
|
150
|
+
| 'subscription_update'
|
|
151
|
+
| 'one_time'
|
|
152
|
+
| 'manual'
|
|
153
|
+
| 'subscription';
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Possible card brands that a payment token can have
|
|
157
|
+
*/
|
|
158
|
+
export type CardBrands =
|
|
159
|
+
| 'mastercard'
|
|
160
|
+
| 'visa'
|
|
161
|
+
| 'amex'
|
|
162
|
+
| 'discover'
|
|
163
|
+
| 'unionpay'
|
|
164
|
+
| 'jcb'
|
|
165
|
+
| 'diners'
|
|
166
|
+
| 'link'
|
|
167
|
+
| 'troy'
|
|
168
|
+
| 'visadankort'
|
|
169
|
+
| 'visabancontact'
|
|
170
|
+
| 'china_union_pay'
|
|
171
|
+
| 'rupay'
|
|
172
|
+
| 'jcbrupay'
|
|
173
|
+
| 'elo'
|
|
174
|
+
| 'unknown';
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* The different types of payment methods that can be used.
|
|
178
|
+
*/
|
|
179
|
+
export type PaymentMethodTypes =
|
|
180
|
+
| 'acss_debit'
|
|
181
|
+
| 'affirm'
|
|
182
|
+
| 'afterpay_clearpay'
|
|
183
|
+
| 'alipay'
|
|
184
|
+
| 'alma'
|
|
185
|
+
| 'amazon_pay'
|
|
186
|
+
| 'apple_pay'
|
|
187
|
+
| 'au_becs_debit'
|
|
188
|
+
| 'bacs_debit'
|
|
189
|
+
| 'bancontact'
|
|
190
|
+
| 'billie'
|
|
191
|
+
| 'blik'
|
|
192
|
+
| 'boleto'
|
|
193
|
+
| 'card'
|
|
194
|
+
| 'cashapp'
|
|
195
|
+
| 'crypto'
|
|
196
|
+
| 'eps'
|
|
197
|
+
| 'fpx'
|
|
198
|
+
| 'giropay'
|
|
199
|
+
| 'google_pay'
|
|
200
|
+
| 'grabpay'
|
|
201
|
+
| 'ideal'
|
|
202
|
+
| 'kakao_pay'
|
|
203
|
+
| 'klarna'
|
|
204
|
+
| 'konbini'
|
|
205
|
+
| 'kr_card'
|
|
206
|
+
| 'link'
|
|
207
|
+
| 'mobilepay'
|
|
208
|
+
| 'multibanco'
|
|
209
|
+
| 'naver_pay'
|
|
210
|
+
| 'nz_bank_account'
|
|
211
|
+
| 'oxxo'
|
|
212
|
+
| 'p24'
|
|
213
|
+
| 'pay_by_bank'
|
|
214
|
+
| 'payco'
|
|
215
|
+
| 'paynow'
|
|
216
|
+
| 'pix'
|
|
217
|
+
| 'promptpay'
|
|
218
|
+
| 'revolut_pay'
|
|
219
|
+
| 'samsung_pay'
|
|
220
|
+
| 'satispay'
|
|
221
|
+
| 'sepa_debit'
|
|
222
|
+
| 'sofort'
|
|
223
|
+
| 'swish'
|
|
224
|
+
| 'twint'
|
|
225
|
+
| 'us_bank_account'
|
|
226
|
+
| 'wechat_pay'
|
|
227
|
+
| 'zip'
|
|
228
|
+
| 'bizum'
|
|
229
|
+
| 'capchase_pay'
|
|
230
|
+
| 'kriya'
|
|
231
|
+
| 'mondu'
|
|
232
|
+
| 'ng_wallet'
|
|
233
|
+
| 'paypay'
|
|
234
|
+
| 'sequra'
|
|
235
|
+
| 'scalapay'
|
|
236
|
+
| 'vipps'
|
|
237
|
+
| 'custom'
|
|
238
|
+
| 'customer_balance'
|
|
239
|
+
| 'gopay'
|
|
240
|
+
| 'mb_way'
|
|
241
|
+
| 'ng_bank'
|
|
242
|
+
| 'ng_bank_transfer'
|
|
243
|
+
| 'ng_card'
|
|
244
|
+
| 'ng_market'
|
|
245
|
+
| 'ng_ussd'
|
|
246
|
+
| 'paypal'
|
|
247
|
+
| 'payto'
|
|
248
|
+
| 'qris'
|
|
249
|
+
| 'rechnung'
|
|
250
|
+
| 'south_korea_market'
|
|
251
|
+
| 'kr_market'
|
|
252
|
+
| 'shopeepay'
|
|
253
|
+
| 'upi'
|
|
254
|
+
| 'sunbit'
|
|
255
|
+
| 'netbanking'
|
|
256
|
+
| 'id_bank_transfer'
|
|
257
|
+
| 'demo_pay'
|
|
258
|
+
| 'shop_pay'
|
|
259
|
+
| 'apple'
|
|
260
|
+
| 'sezzle'
|
|
261
|
+
| 'coinbase'
|
|
262
|
+
| 'splitit'
|
|
263
|
+
| 'unknown';
|
|
264
|
+
|
|
144
265
|
/**
|
|
145
266
|
* An object representing a receipt for a membership.
|
|
146
267
|
*/
|
|
@@ -166,14 +287,14 @@ export interface PaymentListResponse {
|
|
|
166
287
|
billing_address: PaymentListResponse.BillingAddress | null;
|
|
167
288
|
|
|
168
289
|
/**
|
|
169
|
-
* The
|
|
290
|
+
* The reason why a specific payment was billed
|
|
170
291
|
*/
|
|
171
|
-
billing_reason:
|
|
292
|
+
billing_reason: BillingReasons | null;
|
|
172
293
|
|
|
173
294
|
/**
|
|
174
|
-
*
|
|
295
|
+
* Possible card brands that a payment token can have
|
|
175
296
|
*/
|
|
176
|
-
card_brand:
|
|
297
|
+
card_brand: CardBrands | null;
|
|
177
298
|
|
|
178
299
|
/**
|
|
179
300
|
* The last 4 digits of the card used to make the payment.
|
|
@@ -226,10 +347,9 @@ export interface PaymentListResponse {
|
|
|
226
347
|
paid_at: string | null;
|
|
227
348
|
|
|
228
349
|
/**
|
|
229
|
-
*
|
|
230
|
-
* klarna, affirm, card, cashapp
|
|
350
|
+
* The different types of payment methods that can be used.
|
|
231
351
|
*/
|
|
232
|
-
payment_method_type:
|
|
352
|
+
payment_method_type: PaymentMethodTypes | null;
|
|
233
353
|
|
|
234
354
|
/**
|
|
235
355
|
* The plan attached to this payment.
|
|
@@ -247,7 +367,8 @@ export interface PaymentListResponse {
|
|
|
247
367
|
promo_code: PaymentListResponse.PromoCode | null;
|
|
248
368
|
|
|
249
369
|
/**
|
|
250
|
-
*
|
|
370
|
+
* True only for payments that are `paid`, have not been fully refunded, and were
|
|
371
|
+
* processed by a payment processor that allows refunds.
|
|
251
372
|
*/
|
|
252
373
|
refundable: boolean;
|
|
253
374
|
|
|
@@ -262,7 +383,9 @@ export interface PaymentListResponse {
|
|
|
262
383
|
refunded_at: string | null;
|
|
263
384
|
|
|
264
385
|
/**
|
|
265
|
-
*
|
|
386
|
+
* True when the payment status is `open` and its membership is in one of the
|
|
387
|
+
* retry-eligible states (`active`, `trialing`, `completed`, or `past_due`);
|
|
388
|
+
* otherwise false. Used to decide if Whop can attempt the charge again.
|
|
266
389
|
*/
|
|
267
390
|
retryable: boolean;
|
|
268
391
|
|
|
@@ -297,7 +420,8 @@ export interface PaymentListResponse {
|
|
|
297
420
|
user: PaymentListResponse.User | null;
|
|
298
421
|
|
|
299
422
|
/**
|
|
300
|
-
*
|
|
423
|
+
* True when the payment is tied to a membership in `past_due`, the payment status
|
|
424
|
+
* is `open`, and the processor allows voiding payments; otherwise false.
|
|
301
425
|
*/
|
|
302
426
|
voidable: boolean;
|
|
303
427
|
}
|
|
@@ -448,7 +572,7 @@ export namespace PaymentListResponse {
|
|
|
448
572
|
code: string | null;
|
|
449
573
|
|
|
450
574
|
/**
|
|
451
|
-
* The number of
|
|
575
|
+
* The number of months the promo is applied for.
|
|
452
576
|
*/
|
|
453
577
|
number_of_intervals: number | null;
|
|
454
578
|
|
|
@@ -498,14 +622,7 @@ export interface PaymentListParams extends CursorPageParams {
|
|
|
498
622
|
/**
|
|
499
623
|
* The billing reason for the payment
|
|
500
624
|
*/
|
|
501
|
-
billing_reasons?: Array<
|
|
502
|
-
| 'subscription_create'
|
|
503
|
-
| 'subscription_cycle'
|
|
504
|
-
| 'subscription_update'
|
|
505
|
-
| 'one_time'
|
|
506
|
-
| 'manual'
|
|
507
|
-
| 'subscription'
|
|
508
|
-
> | null;
|
|
625
|
+
billing_reasons?: Array<BillingReasons> | null;
|
|
509
626
|
|
|
510
627
|
/**
|
|
511
628
|
* The minimum creation date to filter by
|
|
@@ -577,6 +694,9 @@ export interface PaymentRefundParams {
|
|
|
577
694
|
|
|
578
695
|
export declare namespace Payments {
|
|
579
696
|
export {
|
|
697
|
+
type BillingReasons as BillingReasons,
|
|
698
|
+
type CardBrands as CardBrands,
|
|
699
|
+
type PaymentMethodTypes as PaymentMethodTypes,
|
|
580
700
|
type PaymentListResponse as PaymentListResponse,
|
|
581
701
|
type PaymentListResponsesCursorPage as PaymentListResponsesCursorPage,
|
|
582
702
|
type PaymentListParams as PaymentListParams,
|