@whop/sdk 0.0.36 → 0.0.38
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 +33 -0
- package/client.d.mts +20 -7
- package/client.d.mts.map +1 -1
- package/client.d.ts +20 -7
- 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/lib/verify-user-token.d.mts +1 -0
- package/lib/verify-user-token.d.mts.map +1 -1
- package/lib/verify-user-token.d.ts +1 -0
- package/lib/verify-user-token.d.ts.map +1 -1
- package/lib/verify-user-token.js +39 -13
- package/lib/verify-user-token.js.map +1 -1
- package/lib/verify-user-token.mjs +40 -14
- package/lib/verify-user-token.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/checkout-configurations.d.mts +27 -6
- package/resources/checkout-configurations.d.mts.map +1 -1
- package/resources/checkout-configurations.d.ts +27 -6
- package/resources/checkout-configurations.d.ts.map +1 -1
- package/resources/checkout-configurations.js.map +1 -1
- package/resources/checkout-configurations.mjs.map +1 -1
- package/resources/forums.d.mts +5 -0
- package/resources/forums.d.mts.map +1 -1
- package/resources/forums.d.ts +5 -0
- package/resources/forums.d.ts.map +1 -1
- package/resources/index.d.mts +3 -3
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +3 -3
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/invoices.d.mts +332 -7
- package/resources/invoices.d.mts.map +1 -1
- package/resources/invoices.d.ts +332 -7
- package/resources/invoices.d.ts.map +1 -1
- package/resources/invoices.js +70 -0
- package/resources/invoices.js.map +1 -1
- package/resources/invoices.mjs +70 -0
- package/resources/invoices.mjs.map +1 -1
- package/resources/payments.d.mts +5 -1
- package/resources/payments.d.mts.map +1 -1
- package/resources/payments.d.ts +5 -1
- package/resources/payments.d.ts.map +1 -1
- package/resources/plans.d.mts +15 -6
- package/resources/plans.d.mts.map +1 -1
- package/resources/plans.d.ts +15 -6
- package/resources/plans.d.ts.map +1 -1
- package/resources/plans.js.map +1 -1
- package/resources/plans.mjs.map +1 -1
- package/resources/refunds.d.mts +1 -1
- package/resources/refunds.d.mts.map +1 -1
- package/resources/refunds.d.ts +1 -1
- package/resources/refunds.d.ts.map +1 -1
- package/resources/shared.d.mts +10 -1
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +10 -1
- package/resources/shared.d.ts.map +1 -1
- package/resources/users.d.mts +77 -34
- package/resources/users.d.mts.map +1 -1
- package/resources/users.d.ts +77 -34
- package/resources/users.d.ts.map +1 -1
- package/resources/users.js +42 -12
- package/resources/users.js.map +1 -1
- package/resources/users.mjs +42 -12
- package/resources/users.mjs.map +1 -1
- package/resources/verifications.d.mts +1 -1
- package/resources/verifications.d.mts.map +1 -1
- package/resources/verifications.d.ts +1 -1
- package/resources/verifications.d.ts.map +1 -1
- package/src/client.ts +35 -2
- package/src/lib/verify-user-token.ts +49 -16
- package/src/resources/checkout-configurations.ts +31 -6
- package/src/resources/forums.ts +6 -0
- package/src/resources/index.ts +6 -1
- package/src/resources/invoices.ts +396 -6
- package/src/resources/payments.ts +15 -0
- package/src/resources/plans.ts +18 -5
- package/src/resources/refunds.ts +2 -1
- package/src/resources/shared.ts +12 -1
- package/src/resources/users.ts +95 -44
- package/src/resources/verifications.ts +2 -1
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -290,8 +290,10 @@ export type PaymentMethodTypes =
|
|
|
290
290
|
| 'amazon_pay'
|
|
291
291
|
| 'apple'
|
|
292
292
|
| 'apple_pay'
|
|
293
|
+
| 'au_bank_transfer'
|
|
293
294
|
| 'au_becs_debit'
|
|
294
295
|
| 'bacs_debit'
|
|
296
|
+
| 'bancolombia'
|
|
295
297
|
| 'bancontact'
|
|
296
298
|
| 'billie'
|
|
297
299
|
| 'bizum'
|
|
@@ -306,9 +308,11 @@ export type PaymentMethodTypes =
|
|
|
306
308
|
| 'custom'
|
|
307
309
|
| 'customer_balance'
|
|
308
310
|
| 'demo_pay'
|
|
311
|
+
| 'efecty'
|
|
309
312
|
| 'eps'
|
|
310
313
|
| 'eu_bank_transfer'
|
|
311
314
|
| 'fpx'
|
|
315
|
+
| 'gb_bank_transfer'
|
|
312
316
|
| 'giropay'
|
|
313
317
|
| 'google_pay'
|
|
314
318
|
| 'gopay'
|
|
@@ -324,10 +328,13 @@ export type PaymentMethodTypes =
|
|
|
324
328
|
| 'kriya'
|
|
325
329
|
| 'link'
|
|
326
330
|
| 'mb_way'
|
|
331
|
+
| 'm_pesa'
|
|
332
|
+
| 'mercado_pago'
|
|
327
333
|
| 'mobilepay'
|
|
328
334
|
| 'mondu'
|
|
329
335
|
| 'multibanco'
|
|
330
336
|
| 'naver_pay'
|
|
337
|
+
| 'nequi'
|
|
331
338
|
| 'netbanking'
|
|
332
339
|
| 'ng_bank'
|
|
333
340
|
| 'ng_bank_transfer'
|
|
@@ -338,6 +345,7 @@ export type PaymentMethodTypes =
|
|
|
338
345
|
| 'nz_bank_account'
|
|
339
346
|
| 'oxxo'
|
|
340
347
|
| 'p24'
|
|
348
|
+
| 'pse'
|
|
341
349
|
| 'pay_by_bank'
|
|
342
350
|
| 'payco'
|
|
343
351
|
| 'paynow'
|
|
@@ -360,6 +368,7 @@ export type PaymentMethodTypes =
|
|
|
360
368
|
| 'shopeepay'
|
|
361
369
|
| 'sofort'
|
|
362
370
|
| 'south_korea_market'
|
|
371
|
+
| 'spei'
|
|
363
372
|
| 'splitit'
|
|
364
373
|
| 'sunbit'
|
|
365
374
|
| 'swish'
|
|
@@ -367,6 +376,7 @@ export type PaymentMethodTypes =
|
|
|
367
376
|
| 'twint'
|
|
368
377
|
| 'upi'
|
|
369
378
|
| 'us_bank_account'
|
|
379
|
+
| 'us_bank_transfer'
|
|
370
380
|
| 'venmo'
|
|
371
381
|
| 'vipps'
|
|
372
382
|
| 'wechat_pay'
|
|
@@ -778,6 +788,11 @@ export namespace PaymentListResponse {
|
|
|
778
788
|
* The unique identifier for the plan.
|
|
779
789
|
*/
|
|
780
790
|
id: string;
|
|
791
|
+
|
|
792
|
+
/**
|
|
793
|
+
* A personal description or notes section for the business.
|
|
794
|
+
*/
|
|
795
|
+
internal_notes: string | null;
|
|
781
796
|
}
|
|
782
797
|
|
|
783
798
|
/**
|
package/src/resources/plans.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../core/resource';
|
|
4
|
+
import * as PlansAPI from './plans';
|
|
4
5
|
import * as PaymentsAPI from './payments';
|
|
5
6
|
import * as Shared from './shared';
|
|
6
7
|
import { APIPromise } from '../core/api-promise';
|
|
@@ -124,6 +125,16 @@ export class Plans extends APIResource {
|
|
|
124
125
|
|
|
125
126
|
export type PlanListResponsesCursorPage = CursorPage<PlanListResponse>;
|
|
126
127
|
|
|
128
|
+
/**
|
|
129
|
+
* The different font families available for checkout pages.
|
|
130
|
+
*/
|
|
131
|
+
export type CheckoutFont = 'system' | 'roboto' | 'open_sans';
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* The different border-radius styles available for checkout pages.
|
|
135
|
+
*/
|
|
136
|
+
export type CheckoutShape = 'rounded' | 'pill' | 'rectangular';
|
|
137
|
+
|
|
127
138
|
/**
|
|
128
139
|
* A plan defines pricing and billing terms for a checkout. Plans can optionally
|
|
129
140
|
* belong to a product, where they represent different pricing options such as
|
|
@@ -159,7 +170,7 @@ export interface PlanListResponse {
|
|
|
159
170
|
currency: Shared.Currency;
|
|
160
171
|
|
|
161
172
|
/**
|
|
162
|
-
* A text description of the plan visible to customers. Maximum
|
|
173
|
+
* A text description of the plan visible to customers. Maximum 1000 characters.
|
|
163
174
|
* Null if no description is set.
|
|
164
175
|
*/
|
|
165
176
|
description: string | null;
|
|
@@ -488,7 +499,7 @@ export namespace PlanCreateParams {
|
|
|
488
499
|
/**
|
|
489
500
|
* The different border-radius styles available for checkout pages.
|
|
490
501
|
*/
|
|
491
|
-
border_style?:
|
|
502
|
+
border_style?: PlansAPI.CheckoutShape | null;
|
|
492
503
|
|
|
493
504
|
/**
|
|
494
505
|
* A hex color code for the button color (e.g. #FF5733).
|
|
@@ -498,7 +509,7 @@ export namespace PlanCreateParams {
|
|
|
498
509
|
/**
|
|
499
510
|
* The different font families available for checkout pages.
|
|
500
511
|
*/
|
|
501
|
-
font_family?:
|
|
512
|
+
font_family?: PlansAPI.CheckoutFont | null;
|
|
502
513
|
}
|
|
503
514
|
|
|
504
515
|
export interface CustomField {
|
|
@@ -697,7 +708,7 @@ export namespace PlanUpdateParams {
|
|
|
697
708
|
/**
|
|
698
709
|
* The different border-radius styles available for checkout pages.
|
|
699
710
|
*/
|
|
700
|
-
border_style?:
|
|
711
|
+
border_style?: PlansAPI.CheckoutShape | null;
|
|
701
712
|
|
|
702
713
|
/**
|
|
703
714
|
* A hex color code for the button color (e.g. #FF5733).
|
|
@@ -707,7 +718,7 @@ export namespace PlanUpdateParams {
|
|
|
707
718
|
/**
|
|
708
719
|
* The different font families available for checkout pages.
|
|
709
720
|
*/
|
|
710
|
-
font_family?:
|
|
721
|
+
font_family?: PlansAPI.CheckoutFont | null;
|
|
711
722
|
}
|
|
712
723
|
|
|
713
724
|
export interface CustomField {
|
|
@@ -844,6 +855,8 @@ export interface PlanListParams extends CursorPageParams {
|
|
|
844
855
|
|
|
845
856
|
export declare namespace Plans {
|
|
846
857
|
export {
|
|
858
|
+
type CheckoutFont as CheckoutFont,
|
|
859
|
+
type CheckoutShape as CheckoutShape,
|
|
847
860
|
type PlanListResponse as PlanListResponse,
|
|
848
861
|
type PlanDeleteResponse as PlanDeleteResponse,
|
|
849
862
|
type PlanListResponsesCursorPage as PlanListResponsesCursorPage,
|
package/src/resources/refunds.ts
CHANGED
package/src/resources/shared.ts
CHANGED
|
@@ -461,6 +461,12 @@ export interface CheckoutConfiguration {
|
|
|
461
461
|
*/
|
|
462
462
|
affiliate_code: string | null;
|
|
463
463
|
|
|
464
|
+
/**
|
|
465
|
+
* Whether the checkout configuration allows promo codes. When false, the promo
|
|
466
|
+
* code input is hidden and promo codes are rejected.
|
|
467
|
+
*/
|
|
468
|
+
allow_promo_codes: boolean;
|
|
469
|
+
|
|
464
470
|
/**
|
|
465
471
|
* The ID of the company to use for the checkout configuration
|
|
466
472
|
*/
|
|
@@ -2818,6 +2824,11 @@ export namespace Payment {
|
|
|
2818
2824
|
* The unique identifier for the plan.
|
|
2819
2825
|
*/
|
|
2820
2826
|
id: string;
|
|
2827
|
+
|
|
2828
|
+
/**
|
|
2829
|
+
* A personal description or notes section for the business.
|
|
2830
|
+
*/
|
|
2831
|
+
internal_notes: string | null;
|
|
2821
2832
|
}
|
|
2822
2833
|
|
|
2823
2834
|
/**
|
|
@@ -3007,7 +3018,7 @@ export interface Plan {
|
|
|
3007
3018
|
custom_fields: Array<Plan.CustomField>;
|
|
3008
3019
|
|
|
3009
3020
|
/**
|
|
3010
|
-
* A text description of the plan visible to customers. Maximum
|
|
3021
|
+
* A text description of the plan visible to customers. Maximum 1000 characters.
|
|
3011
3022
|
* Null if no description is set.
|
|
3012
3023
|
*/
|
|
3013
3024
|
description: string | null;
|
package/src/resources/users.ts
CHANGED
|
@@ -13,14 +13,55 @@ import { path } from '../internal/utils/path';
|
|
|
13
13
|
export class Users extends APIResource {
|
|
14
14
|
/**
|
|
15
15
|
* Retrieves the details of an existing user.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* const user = await client.users.retrieve(
|
|
20
|
+
* 'user_xxxxxxxxxxxxx',
|
|
21
|
+
* );
|
|
22
|
+
* ```
|
|
16
23
|
*/
|
|
17
|
-
retrieve(
|
|
18
|
-
|
|
24
|
+
retrieve(
|
|
25
|
+
id: string,
|
|
26
|
+
query: UserRetrieveParams | null | undefined = {},
|
|
27
|
+
options?: RequestOptions,
|
|
28
|
+
): APIPromise<User> {
|
|
29
|
+
return this._client.get(path`/users/${id}`, { query, ...options });
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Update a user's profile by their ID.
|
|
34
|
+
*
|
|
35
|
+
* Required permissions:
|
|
36
|
+
*
|
|
37
|
+
* - `user:profile:update`
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```ts
|
|
41
|
+
* const user = await client.users.update(
|
|
42
|
+
* 'user_xxxxxxxxxxxxx',
|
|
43
|
+
* );
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
update(
|
|
47
|
+
id: string,
|
|
48
|
+
body: UserUpdateParams | null | undefined = {},
|
|
49
|
+
options?: RequestOptions,
|
|
50
|
+
): APIPromise<User> {
|
|
51
|
+
return this._client.patch(path`/users/${id}`, { body, ...options });
|
|
19
52
|
}
|
|
20
53
|
|
|
21
54
|
/**
|
|
22
55
|
* Search for users by name or username, ranked by social proximity to the
|
|
23
56
|
* authenticated user.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* // Automatically fetches more pages as needed.
|
|
61
|
+
* for await (const userListResponse of client.users.list()) {
|
|
62
|
+
* // ...
|
|
63
|
+
* }
|
|
64
|
+
* ```
|
|
24
65
|
*/
|
|
25
66
|
list(
|
|
26
67
|
query: UserListParams | null | undefined = {},
|
|
@@ -32,6 +73,14 @@ export class Users extends APIResource {
|
|
|
32
73
|
/**
|
|
33
74
|
* Check whether a user has access to a specific resource, and return their access
|
|
34
75
|
* level.
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ```ts
|
|
79
|
+
* const response = await client.users.checkAccess(
|
|
80
|
+
* 'resource_id',
|
|
81
|
+
* { id: 'user_xxxxxxxxxxxxx' },
|
|
82
|
+
* );
|
|
83
|
+
* ```
|
|
35
84
|
*/
|
|
36
85
|
checkAccess(
|
|
37
86
|
resourceID: string,
|
|
@@ -41,20 +90,6 @@ export class Users extends APIResource {
|
|
|
41
90
|
const { id } = params;
|
|
42
91
|
return this._client.get(path`/users/${id}/access/${resourceID}`, options);
|
|
43
92
|
}
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Update the currently authenticated user's profile.
|
|
47
|
-
*
|
|
48
|
-
* Required permissions:
|
|
49
|
-
*
|
|
50
|
-
* - `user:profile:update`
|
|
51
|
-
*/
|
|
52
|
-
updateProfile(
|
|
53
|
-
body: UserUpdateProfileParams | null | undefined = {},
|
|
54
|
-
options?: RequestOptions,
|
|
55
|
-
): APIPromise<User> {
|
|
56
|
-
return this._client.patch('/users/me', { body, ...options });
|
|
57
|
-
}
|
|
58
93
|
}
|
|
59
94
|
|
|
60
95
|
export type UserListResponsesCursorPage = CursorPage<UserListResponse>;
|
|
@@ -176,40 +211,26 @@ export interface UserCheckAccessResponse {
|
|
|
176
211
|
has_access: boolean;
|
|
177
212
|
}
|
|
178
213
|
|
|
179
|
-
export interface
|
|
180
|
-
/**
|
|
181
|
-
* Returns the elements in the list that come before the specified cursor.
|
|
182
|
-
*/
|
|
183
|
-
before?: string | null;
|
|
184
|
-
|
|
185
|
-
/**
|
|
186
|
-
* Returns the first _n_ elements from the list.
|
|
187
|
-
*/
|
|
188
|
-
first?: number | null;
|
|
189
|
-
|
|
214
|
+
export interface UserRetrieveParams {
|
|
190
215
|
/**
|
|
191
|
-
*
|
|
216
|
+
* When provided, returns the user's company-specific profile overrides (name,
|
|
217
|
+
* profile picture) instead of their global profile.
|
|
192
218
|
*/
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
/**
|
|
196
|
-
* Search term to filter by name or username.
|
|
197
|
-
*/
|
|
198
|
-
query?: string | null;
|
|
219
|
+
company_id?: string | null;
|
|
199
220
|
}
|
|
200
221
|
|
|
201
|
-
export interface
|
|
222
|
+
export interface UserUpdateParams {
|
|
202
223
|
/**
|
|
203
|
-
*
|
|
224
|
+
* A short biography displayed on the user's public profile.
|
|
204
225
|
*/
|
|
205
|
-
|
|
206
|
-
}
|
|
226
|
+
bio?: string | null;
|
|
207
227
|
|
|
208
|
-
export interface UserUpdateProfileParams {
|
|
209
228
|
/**
|
|
210
|
-
*
|
|
229
|
+
* When provided, updates the user's profile overrides for this company instead of
|
|
230
|
+
* the global profile. Pass name and profile_picture to set overrides, or null to
|
|
231
|
+
* clear them.
|
|
211
232
|
*/
|
|
212
|
-
|
|
233
|
+
company_id?: string | null;
|
|
213
234
|
|
|
214
235
|
/**
|
|
215
236
|
* The user's display name shown on their public profile. Maximum 100 characters.
|
|
@@ -219,7 +240,7 @@ export interface UserUpdateProfileParams {
|
|
|
219
240
|
/**
|
|
220
241
|
* The user's profile picture image attachment.
|
|
221
242
|
*/
|
|
222
|
-
profile_picture?:
|
|
243
|
+
profile_picture?: UserUpdateParams.ProfilePicture | null;
|
|
223
244
|
|
|
224
245
|
/**
|
|
225
246
|
* The user's unique username. Alphanumeric characters and hyphens only. Maximum 42
|
|
@@ -228,7 +249,7 @@ export interface UserUpdateProfileParams {
|
|
|
228
249
|
username?: string | null;
|
|
229
250
|
}
|
|
230
251
|
|
|
231
|
-
export namespace
|
|
252
|
+
export namespace UserUpdateParams {
|
|
232
253
|
/**
|
|
233
254
|
* The user's profile picture image attachment.
|
|
234
255
|
*/
|
|
@@ -240,14 +261,44 @@ export namespace UserUpdateProfileParams {
|
|
|
240
261
|
}
|
|
241
262
|
}
|
|
242
263
|
|
|
264
|
+
export interface UserListParams extends CursorPageParams {
|
|
265
|
+
/**
|
|
266
|
+
* Returns the elements in the list that come before the specified cursor.
|
|
267
|
+
*/
|
|
268
|
+
before?: string | null;
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* Returns the first _n_ elements from the list.
|
|
272
|
+
*/
|
|
273
|
+
first?: number | null;
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* Returns the last _n_ elements from the list.
|
|
277
|
+
*/
|
|
278
|
+
last?: number | null;
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* Search term to filter by name or username.
|
|
282
|
+
*/
|
|
283
|
+
query?: string | null;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
export interface UserCheckAccessParams {
|
|
287
|
+
/**
|
|
288
|
+
* The unique identifier or username of the user.
|
|
289
|
+
*/
|
|
290
|
+
id: string;
|
|
291
|
+
}
|
|
292
|
+
|
|
243
293
|
export declare namespace Users {
|
|
244
294
|
export {
|
|
245
295
|
type User as User,
|
|
246
296
|
type UserListResponse as UserListResponse,
|
|
247
297
|
type UserCheckAccessResponse as UserCheckAccessResponse,
|
|
248
298
|
type UserListResponsesCursorPage as UserListResponsesCursorPage,
|
|
299
|
+
type UserRetrieveParams as UserRetrieveParams,
|
|
300
|
+
type UserUpdateParams as UserUpdateParams,
|
|
249
301
|
type UserListParams as UserListParams,
|
|
250
302
|
type UserCheckAccessParams as UserCheckAccessParams,
|
|
251
|
-
type UserUpdateProfileParams as UserUpdateProfileParams,
|
|
252
303
|
};
|
|
253
304
|
}
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.0.
|
|
1
|
+
export const VERSION = '0.0.38'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.0.
|
|
1
|
+
export declare const VERSION = "0.0.38";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.0.
|
|
1
|
+
export declare const VERSION = "0.0.38";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.0.
|
|
1
|
+
export const VERSION = '0.0.38'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|