@whop/sdk 0.0.1-canary.0 → 0.0.2
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 +21 -0
- package/client.d.mts +16 -3
- package/client.d.mts.map +1 -1
- package/client.d.ts +16 -3
- package/client.d.ts.map +1 -1
- package/client.js +7 -1
- package/client.js.map +1 -1
- package/client.mjs +7 -1
- 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 +21 -18
- package/resources/checkout-configurations.d.mts.map +1 -1
- package/resources/checkout-configurations.d.ts +21 -18
- package/resources/checkout-configurations.d.ts.map +1 -1
- package/resources/checkout-configurations.js +1 -1
- package/resources/checkout-configurations.mjs +1 -1
- package/resources/experiences.d.mts +32 -0
- package/resources/experiences.d.mts.map +1 -1
- package/resources/experiences.d.ts +32 -0
- package/resources/experiences.d.ts.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 +3 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +3 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +5 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -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/members.d.mts +270 -0
- package/resources/members.d.mts.map +1 -0
- package/resources/members.d.ts +270 -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/plans.d.mts +5 -2
- package/resources/plans.d.mts.map +1 -1
- package/resources/plans.d.ts +5 -2
- package/resources/plans.d.ts.map +1 -1
- package/resources/shared.d.mts +176 -11
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +176 -11
- 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 +63 -2
- package/src/resources/apps.ts +18 -0
- package/src/resources/checkout-configurations.ts +21 -18
- package/src/resources/experiences.ts +36 -0
- package/src/resources/forums.ts +152 -0
- package/src/resources/index.ts +24 -0
- package/src/resources/invoices.ts +5 -2
- package/src/resources/members.ts +337 -0
- package/src/resources/plans.ts +5 -2
- package/src/resources/shared.ts +217 -11
- 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,337 @@
|
|
|
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
|
+
export declare namespace Members {
|
|
331
|
+
export {
|
|
332
|
+
type MemberRetrieveResponse as MemberRetrieveResponse,
|
|
333
|
+
type MemberListResponse as MemberListResponse,
|
|
334
|
+
type MemberListResponsesCursorPage as MemberListResponsesCursorPage,
|
|
335
|
+
type MemberListParams as MemberListParams,
|
|
336
|
+
};
|
|
337
|
+
}
|
package/src/resources/plans.ts
CHANGED
|
@@ -305,7 +305,9 @@ export interface PlanCreateParams {
|
|
|
305
305
|
image?: PlanCreateParams.Image | null;
|
|
306
306
|
|
|
307
307
|
/**
|
|
308
|
-
* An additional amount charged upon first purchase.
|
|
308
|
+
* An additional amount charged upon first purchase. Use only if a one time payment
|
|
309
|
+
* OR you want to charge an additional amount on top of the renewal price. Provided
|
|
310
|
+
* as a number in dollars. Eg: 10.43 for $10.43
|
|
309
311
|
*/
|
|
310
312
|
initial_price?: number | null;
|
|
311
313
|
|
|
@@ -331,7 +333,8 @@ export interface PlanCreateParams {
|
|
|
331
333
|
release_method?: Shared.ReleaseMethod | null;
|
|
332
334
|
|
|
333
335
|
/**
|
|
334
|
-
* The amount the customer is charged every billing period.
|
|
336
|
+
* The amount the customer is charged every billing period. Use only if a recurring
|
|
337
|
+
* payment. Provided as a number in dollars. Eg: 10.43 for $10.43
|
|
335
338
|
*/
|
|
336
339
|
renewal_price?: number | null;
|
|
337
340
|
|