@whop/sdk 0.0.37 → 0.0.39
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 +39 -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/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 +24 -4
- package/resources/checkout-configurations.d.mts.map +1 -1
- package/resources/checkout-configurations.d.ts +24 -4
- package/resources/checkout-configurations.d.ts.map +1 -1
- package/resources/files.d.mts.map +1 -1
- package/resources/files.d.ts.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 +1 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -1
- 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 +26 -10
- package/resources/invoices.d.mts.map +1 -1
- package/resources/invoices.d.ts +26 -10
- package/resources/invoices.d.ts.map +1 -1
- package/resources/memberships.d.mts +6 -0
- package/resources/memberships.d.mts.map +1 -1
- package/resources/memberships.d.ts +6 -0
- package/resources/memberships.d.ts.map +1 -1
- package/resources/payments.d.mts +10 -1
- package/resources/payments.d.mts.map +1 -1
- package/resources/payments.d.ts +10 -1
- package/resources/payments.d.ts.map +1 -1
- package/resources/plans.d.mts +3 -3
- package/resources/plans.d.mts.map +1 -1
- package/resources/plans.d.ts +3 -3
- package/resources/plans.d.ts.map +1 -1
- package/resources/shared.d.mts +21 -1
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +21 -1
- package/resources/shared.d.ts.map +1 -1
- package/resources/support-channels.d.mts +11 -8
- package/resources/support-channels.d.mts.map +1 -1
- package/resources/support-channels.d.ts +11 -8
- package/resources/support-channels.d.ts.map +1 -1
- package/resources/support-channels.js +2 -4
- package/resources/support-channels.js.map +1 -1
- package/resources/support-channels.mjs +2 -4
- package/resources/support-channels.mjs.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 +27 -2
- package/src/lib/verify-user-token.ts +49 -16
- package/src/resources/checkout-configurations.ts +28 -4
- package/src/resources/files.ts +1 -1
- package/src/resources/forums.ts +6 -0
- package/src/resources/index.ts +2 -1
- package/src/resources/invoices.ts +29 -10
- package/src/resources/memberships.ts +7 -0
- package/src/resources/payments.ts +16 -0
- package/src/resources/plans.ts +3 -3
- package/src/resources/shared.ts +25 -1
- package/src/resources/support-channels.ts +12 -8
- 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
|
@@ -1,9 +1,26 @@
|
|
|
1
|
-
import { importJWK, jwtVerify } from 'jose';
|
|
1
|
+
import { createRemoteJWKSet, importJWK, jwtVerify } from 'jose';
|
|
2
2
|
import type { Whop } from '../client';
|
|
3
3
|
|
|
4
4
|
const USER_TOKEN_HEADER_NAME = 'x-whop-user-token';
|
|
5
|
-
const
|
|
6
|
-
|
|
5
|
+
const DEFAULT_JWKS_URL = 'https://api.whop.com/.well-known/jwks.json';
|
|
6
|
+
|
|
7
|
+
// Module-level cache: one RemoteJWKSet per URL. jose's remote set handles
|
|
8
|
+
// HTTP caching (respecting the endpoint's Cache-Control), a cooldown to
|
|
9
|
+
// prevent tight-loop refetches on unknown kids, and thread-safe in-flight
|
|
10
|
+
// deduplication. Reusing the same instance across calls is what makes the
|
|
11
|
+
// verify path effectively free after the first lookup.
|
|
12
|
+
const jwksCache = new Map<string, ReturnType<typeof createRemoteJWKSet>>();
|
|
13
|
+
|
|
14
|
+
function getRemoteJwks(url: string): ReturnType<typeof createRemoteJWKSet> {
|
|
15
|
+
let existing = jwksCache.get(url);
|
|
16
|
+
if (existing) return existing;
|
|
17
|
+
existing = createRemoteJWKSet(new URL(url), {
|
|
18
|
+
cacheMaxAge: 12 * 60 * 60 * 1000,
|
|
19
|
+
cooldownDuration: 30_000,
|
|
20
|
+
});
|
|
21
|
+
jwksCache.set(url, existing);
|
|
22
|
+
return existing;
|
|
23
|
+
}
|
|
7
24
|
|
|
8
25
|
export interface GetUserTokenOptions {
|
|
9
26
|
headerName?: string | null | undefined;
|
|
@@ -43,9 +60,17 @@ export interface VerifyUserTokenOptions<DontThrow extends boolean = false> {
|
|
|
43
60
|
/// This is the app id of your app. You can find it in the app settings dashboard.
|
|
44
61
|
appId: string;
|
|
45
62
|
|
|
46
|
-
///
|
|
63
|
+
/// Static JWK (JSON string) used to verify the user token. When set, the
|
|
64
|
+
/// SDK skips the remote JWKS fetch entirely — useful for self-hosted or
|
|
65
|
+
/// test setups where you know the signing key. Prefer leaving this unset
|
|
66
|
+
/// and using `jwksUrl` instead so key rotation is handled automatically.
|
|
47
67
|
publicKey?: string;
|
|
48
68
|
|
|
69
|
+
/// URL of a JWKS endpoint to verify the user token against. Defaults to
|
|
70
|
+
/// Whop's canonical JWKS. Override this when pointing at a local Whop
|
|
71
|
+
/// backend (for example during local development).
|
|
72
|
+
jwksUrl?: string;
|
|
73
|
+
|
|
49
74
|
/// If true, the function will instead return null if the user token is invalid.
|
|
50
75
|
/// Otherwise, it will throw an error. Defaults to `false`, meaning on validation failure, an error will be thrown.
|
|
51
76
|
dontThrow?: DontThrow;
|
|
@@ -62,9 +87,9 @@ export function makeUserTokenVerifierFromSdk(client: Whop) {
|
|
|
62
87
|
if (!client.appID) {
|
|
63
88
|
throw Error('You must set appID in the Whop client constructor if you want to verify user tokens.');
|
|
64
89
|
}
|
|
65
|
-
const baseOptions: VerifyUserTokenOptions<false> = {
|
|
66
|
-
|
|
67
|
-
|
|
90
|
+
const baseOptions: VerifyUserTokenOptions<false> = { appId: client.appID };
|
|
91
|
+
if (client.userTokenPublicKey) baseOptions.publicKey = client.userTokenPublicKey;
|
|
92
|
+
if (client.userTokenJwksUrl) baseOptions.jwksUrl = client.userTokenJwksUrl;
|
|
68
93
|
return await internalVerifyUserToken<DT>(tokenOrHeadersOrRequest, {
|
|
69
94
|
...baseOptions,
|
|
70
95
|
...options,
|
|
@@ -96,15 +121,23 @@ async function internalVerifyUserToken<DontThrow extends boolean = false>(
|
|
|
96
121
|
);
|
|
97
122
|
}
|
|
98
123
|
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
124
|
+
const verifyOptions = { issuer: 'urn:whopcom:exp-proxy', algorithms: ['ES256'] };
|
|
125
|
+
|
|
126
|
+
let token;
|
|
127
|
+
if (options.publicKey) {
|
|
128
|
+
const key = await importJWK(JSON.parse(options.publicKey), 'ES256').catch(() => {
|
|
129
|
+
throw new Error('Invalid public key provided to verifyUserToken');
|
|
130
|
+
});
|
|
131
|
+
token = await jwtVerify(tokenString, key, verifyOptions).catch(() => {
|
|
132
|
+
throw new Error('Invalid user token provided to verifyUserToken');
|
|
133
|
+
});
|
|
134
|
+
} else {
|
|
135
|
+
const jwks = getRemoteJwks(options.jwksUrl ?? DEFAULT_JWKS_URL);
|
|
136
|
+
token = await jwtVerify(tokenString, jwks, verifyOptions).catch(() => {
|
|
137
|
+
throw new Error('Invalid user token provided to verifyUserToken');
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
|
|
108
141
|
if (!(token.payload.sub && token.payload.aud) || Array.isArray(token.payload.aud)) {
|
|
109
142
|
throw new Error('Invalid user token provided to verifyUserToken');
|
|
110
143
|
}
|
|
@@ -93,6 +93,12 @@ export interface CheckoutConfigurationListResponse {
|
|
|
93
93
|
*/
|
|
94
94
|
affiliate_code: string | null;
|
|
95
95
|
|
|
96
|
+
/**
|
|
97
|
+
* Whether the checkout configuration allows promo codes. When false, the promo
|
|
98
|
+
* code input is hidden and promo codes are rejected.
|
|
99
|
+
*/
|
|
100
|
+
allow_promo_codes: boolean;
|
|
101
|
+
|
|
96
102
|
/**
|
|
97
103
|
* The ID of the company to use for the checkout configuration
|
|
98
104
|
*/
|
|
@@ -250,6 +256,12 @@ export declare namespace CheckoutConfigurationCreateParams {
|
|
|
250
256
|
*/
|
|
251
257
|
affiliate_code?: string | null;
|
|
252
258
|
|
|
259
|
+
/**
|
|
260
|
+
* Whether the checkout should show the promo code input field and accept promo
|
|
261
|
+
* codes. Defaults to true.
|
|
262
|
+
*/
|
|
263
|
+
allow_promo_codes?: boolean | null;
|
|
264
|
+
|
|
253
265
|
/**
|
|
254
266
|
* Checkout styling overrides for this session. Overrides plan and company
|
|
255
267
|
* defaults.
|
|
@@ -484,7 +496,7 @@ export declare namespace CheckoutConfigurationCreateParams {
|
|
|
484
496
|
* in this configuration. The full list of default payment methods can be found in
|
|
485
497
|
* the documentation at docs.whop.com/payments.
|
|
486
498
|
*/
|
|
487
|
-
include_platform_defaults
|
|
499
|
+
include_platform_defaults?: boolean | null;
|
|
488
500
|
}
|
|
489
501
|
|
|
490
502
|
/**
|
|
@@ -603,7 +615,7 @@ export declare namespace CheckoutConfigurationCreateParams {
|
|
|
603
615
|
* in this configuration. The full list of default payment methods can be found in
|
|
604
616
|
* the documentation at docs.whop.com/payments.
|
|
605
617
|
*/
|
|
606
|
-
include_platform_defaults
|
|
618
|
+
include_platform_defaults?: boolean | null;
|
|
607
619
|
}
|
|
608
620
|
}
|
|
609
621
|
|
|
@@ -619,6 +631,12 @@ export declare namespace CheckoutConfigurationCreateParams {
|
|
|
619
631
|
*/
|
|
620
632
|
affiliate_code?: string | null;
|
|
621
633
|
|
|
634
|
+
/**
|
|
635
|
+
* Whether the checkout should show the promo code input field and accept promo
|
|
636
|
+
* codes. Defaults to true.
|
|
637
|
+
*/
|
|
638
|
+
allow_promo_codes?: boolean | null;
|
|
639
|
+
|
|
622
640
|
/**
|
|
623
641
|
* Checkout styling overrides for this session. Overrides plan and company
|
|
624
642
|
* defaults.
|
|
@@ -700,7 +718,7 @@ export declare namespace CheckoutConfigurationCreateParams {
|
|
|
700
718
|
* in this configuration. The full list of default payment methods can be found in
|
|
701
719
|
* the documentation at docs.whop.com/payments.
|
|
702
720
|
*/
|
|
703
|
-
include_platform_defaults
|
|
721
|
+
include_platform_defaults?: boolean | null;
|
|
704
722
|
}
|
|
705
723
|
}
|
|
706
724
|
|
|
@@ -713,6 +731,12 @@ export declare namespace CheckoutConfigurationCreateParams {
|
|
|
713
731
|
|
|
714
732
|
mode: 'setup';
|
|
715
733
|
|
|
734
|
+
/**
|
|
735
|
+
* Whether the checkout should show the promo code input field and accept promo
|
|
736
|
+
* codes. Defaults to true.
|
|
737
|
+
*/
|
|
738
|
+
allow_promo_codes?: boolean | null;
|
|
739
|
+
|
|
716
740
|
/**
|
|
717
741
|
* Checkout styling overrides for this session. Overrides plan and company
|
|
718
742
|
* defaults.
|
|
@@ -792,7 +816,7 @@ export declare namespace CheckoutConfigurationCreateParams {
|
|
|
792
816
|
* in this configuration. The full list of default payment methods can be found in
|
|
793
817
|
* the documentation at docs.whop.com/payments.
|
|
794
818
|
*/
|
|
795
|
-
include_platform_defaults
|
|
819
|
+
include_platform_defaults?: boolean | null;
|
|
796
820
|
}
|
|
797
821
|
}
|
|
798
822
|
}
|
package/src/resources/files.ts
CHANGED
|
@@ -43,7 +43,7 @@ export class Files extends APIResource {
|
|
|
43
43
|
/**
|
|
44
44
|
* The upload status of a file
|
|
45
45
|
*/
|
|
46
|
-
export type UploadStatus = 'pending' | 'processing' | 'ready' | 'failed'
|
|
46
|
+
export type UploadStatus = 'pending' | 'processing' | 'ready' | 'failed'
|
|
47
47
|
|
|
48
48
|
/**
|
|
49
49
|
* A file that has been uploaded or is pending upload.
|
package/src/resources/forums.ts
CHANGED
|
@@ -109,6 +109,12 @@ export namespace ForumListResponse {
|
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
export interface ForumUpdateParams {
|
|
112
|
+
/**
|
|
113
|
+
* A list of words that are automatically blocked from posts in this forum. For
|
|
114
|
+
* example, ['spam', 'scam'].
|
|
115
|
+
*/
|
|
116
|
+
banned_words?: Array<string> | null;
|
|
117
|
+
|
|
112
118
|
/**
|
|
113
119
|
* The banner image displayed at the top of the forum page. Pass null to remove the
|
|
114
120
|
* existing banner.
|
package/src/resources/index.ts
CHANGED
|
@@ -419,9 +419,10 @@ export {
|
|
|
419
419
|
type User,
|
|
420
420
|
type UserListResponse,
|
|
421
421
|
type UserCheckAccessResponse,
|
|
422
|
+
type UserRetrieveParams,
|
|
423
|
+
type UserUpdateParams,
|
|
422
424
|
type UserListParams,
|
|
423
425
|
type UserCheckAccessParams,
|
|
424
|
-
type UserUpdateProfileParams,
|
|
425
426
|
type UserListResponsesCursorPage,
|
|
426
427
|
} from './users';
|
|
427
428
|
export {
|
|
@@ -339,9 +339,9 @@ export declare namespace InvoiceCreateParams {
|
|
|
339
339
|
product: CreateInvoiceInputWithProduct.Product;
|
|
340
340
|
|
|
341
341
|
/**
|
|
342
|
-
* The date and time when the invoice will be automatically finalized
|
|
343
|
-
*
|
|
344
|
-
*
|
|
342
|
+
* The date and time when the invoice will be automatically finalized. For
|
|
343
|
+
* charge_automatically, triggers an automatic charge. For send_invoice, sends the
|
|
344
|
+
* invoice email to the customer at the specified time.
|
|
345
345
|
*/
|
|
346
346
|
automatically_finalizes_at?: string | null;
|
|
347
347
|
|
|
@@ -409,6 +409,12 @@ export declare namespace InvoiceCreateParams {
|
|
|
409
409
|
* customer and due date requirements.
|
|
410
410
|
*/
|
|
411
411
|
save_as_draft?: boolean | null;
|
|
412
|
+
|
|
413
|
+
/**
|
|
414
|
+
* The date that defines when the subscription billing cycle should start. When set
|
|
415
|
+
* on a renewal plan invoice, this anchors all future billing periods to this date.
|
|
416
|
+
*/
|
|
417
|
+
subscription_billing_anchor_at?: string | null;
|
|
412
418
|
}
|
|
413
419
|
|
|
414
420
|
export namespace CreateInvoiceInputWithProduct {
|
|
@@ -556,7 +562,7 @@ export declare namespace InvoiceCreateParams {
|
|
|
556
562
|
* in this configuration. The full list of default payment methods can be found in
|
|
557
563
|
* the documentation at docs.whop.com/payments.
|
|
558
564
|
*/
|
|
559
|
-
include_platform_defaults
|
|
565
|
+
include_platform_defaults?: boolean | null;
|
|
560
566
|
}
|
|
561
567
|
}
|
|
562
568
|
|
|
@@ -679,9 +685,9 @@ export declare namespace InvoiceCreateParams {
|
|
|
679
685
|
product_id: string;
|
|
680
686
|
|
|
681
687
|
/**
|
|
682
|
-
* The date and time when the invoice will be automatically finalized
|
|
683
|
-
*
|
|
684
|
-
*
|
|
688
|
+
* The date and time when the invoice will be automatically finalized. For
|
|
689
|
+
* charge_automatically, triggers an automatic charge. For send_invoice, sends the
|
|
690
|
+
* invoice email to the customer at the specified time.
|
|
685
691
|
*/
|
|
686
692
|
automatically_finalizes_at?: string | null;
|
|
687
693
|
|
|
@@ -749,6 +755,12 @@ export declare namespace InvoiceCreateParams {
|
|
|
749
755
|
* customer and due date requirements.
|
|
750
756
|
*/
|
|
751
757
|
save_as_draft?: boolean | null;
|
|
758
|
+
|
|
759
|
+
/**
|
|
760
|
+
* The date that defines when the subscription billing cycle should start. When set
|
|
761
|
+
* on a renewal plan invoice, this anchors all future billing periods to this date.
|
|
762
|
+
*/
|
|
763
|
+
subscription_billing_anchor_at?: string | null;
|
|
752
764
|
}
|
|
753
765
|
|
|
754
766
|
export namespace CreateInvoiceInputWithProductID {
|
|
@@ -896,7 +908,7 @@ export declare namespace InvoiceCreateParams {
|
|
|
896
908
|
* in this configuration. The full list of default payment methods can be found in
|
|
897
909
|
* the documentation at docs.whop.com/payments.
|
|
898
910
|
*/
|
|
899
|
-
include_platform_defaults
|
|
911
|
+
include_platform_defaults?: boolean | null;
|
|
900
912
|
}
|
|
901
913
|
}
|
|
902
914
|
|
|
@@ -982,7 +994,9 @@ export declare namespace InvoiceCreateParams {
|
|
|
982
994
|
|
|
983
995
|
export interface InvoiceUpdateParams {
|
|
984
996
|
/**
|
|
985
|
-
* The date and time when the invoice will be automatically finalized
|
|
997
|
+
* The date and time when the invoice will be automatically finalized. For
|
|
998
|
+
* charge_automatically, triggers an automatic charge. For send_invoice, sends the
|
|
999
|
+
* invoice email at the specified time.
|
|
986
1000
|
*/
|
|
987
1001
|
automatically_finalizes_at?: string | null;
|
|
988
1002
|
|
|
@@ -1040,6 +1054,11 @@ export interface InvoiceUpdateParams {
|
|
|
1040
1054
|
* Updated plan attributes.
|
|
1041
1055
|
*/
|
|
1042
1056
|
plan?: InvoiceUpdateParams.Plan | null;
|
|
1057
|
+
|
|
1058
|
+
/**
|
|
1059
|
+
* The date that defines when the subscription billing cycle should start.
|
|
1060
|
+
*/
|
|
1061
|
+
subscription_billing_anchor_at?: string | null;
|
|
1043
1062
|
}
|
|
1044
1063
|
|
|
1045
1064
|
export namespace InvoiceUpdateParams {
|
|
@@ -1263,7 +1282,7 @@ export namespace InvoiceUpdateParams {
|
|
|
1263
1282
|
* in this configuration. The full list of default payment methods can be found in
|
|
1264
1283
|
* the documentation at docs.whop.com/payments.
|
|
1265
1284
|
*/
|
|
1266
|
-
include_platform_defaults
|
|
1285
|
+
include_platform_defaults?: boolean | null;
|
|
1267
1286
|
}
|
|
1268
1287
|
}
|
|
1269
1288
|
}
|
|
@@ -246,6 +246,13 @@ export interface MembershipListResponse {
|
|
|
246
246
|
*/
|
|
247
247
|
cancellation_reason: string | null;
|
|
248
248
|
|
|
249
|
+
/**
|
|
250
|
+
* The ID of the checkout session/configuration that produced this membership, if
|
|
251
|
+
* any. Use this to map memberships back to the checkout configuration that created
|
|
252
|
+
* them.
|
|
253
|
+
*/
|
|
254
|
+
checkout_configuration_id: string | null;
|
|
255
|
+
|
|
249
256
|
/**
|
|
250
257
|
* The company this membership belongs to.
|
|
251
258
|
*/
|
|
@@ -290,6 +290,7 @@ 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'
|
|
295
296
|
| 'bancolombia'
|
|
@@ -311,6 +312,7 @@ export type PaymentMethodTypes =
|
|
|
311
312
|
| 'eps'
|
|
312
313
|
| 'eu_bank_transfer'
|
|
313
314
|
| 'fpx'
|
|
315
|
+
| 'gb_bank_transfer'
|
|
314
316
|
| 'giropay'
|
|
315
317
|
| 'google_pay'
|
|
316
318
|
| 'gopay'
|
|
@@ -320,12 +322,14 @@ export type PaymentMethodTypes =
|
|
|
320
322
|
| 'interac'
|
|
321
323
|
| 'kakao_pay'
|
|
322
324
|
| 'klarna'
|
|
325
|
+
| 'klarna_pay_now'
|
|
323
326
|
| 'konbini'
|
|
324
327
|
| 'kr_card'
|
|
325
328
|
| 'kr_market'
|
|
326
329
|
| 'kriya'
|
|
327
330
|
| 'link'
|
|
328
331
|
| 'mb_way'
|
|
332
|
+
| 'm_pesa'
|
|
329
333
|
| 'mercado_pago'
|
|
330
334
|
| 'mobilepay'
|
|
331
335
|
| 'mondu'
|
|
@@ -373,6 +377,7 @@ export type PaymentMethodTypes =
|
|
|
373
377
|
| 'twint'
|
|
374
378
|
| 'upi'
|
|
375
379
|
| 'us_bank_account'
|
|
380
|
+
| 'us_bank_transfer'
|
|
376
381
|
| 'venmo'
|
|
377
382
|
| 'vipps'
|
|
378
383
|
| 'wechat_pay'
|
|
@@ -432,6 +437,12 @@ export interface PaymentListResponse {
|
|
|
432
437
|
*/
|
|
433
438
|
card_last4: string | null;
|
|
434
439
|
|
|
440
|
+
/**
|
|
441
|
+
* The ID of the checkout session/configuration that produced this payment, if any.
|
|
442
|
+
* Use this to map payments back to the checkout configuration that created them.
|
|
443
|
+
*/
|
|
444
|
+
checkout_configuration_id: string | null;
|
|
445
|
+
|
|
435
446
|
/**
|
|
436
447
|
* The company for the payment.
|
|
437
448
|
*/
|
|
@@ -784,6 +795,11 @@ export namespace PaymentListResponse {
|
|
|
784
795
|
* The unique identifier for the plan.
|
|
785
796
|
*/
|
|
786
797
|
id: string;
|
|
798
|
+
|
|
799
|
+
/**
|
|
800
|
+
* A personal description or notes section for the business.
|
|
801
|
+
*/
|
|
802
|
+
internal_notes: string | null;
|
|
787
803
|
}
|
|
788
804
|
|
|
789
805
|
/**
|
package/src/resources/plans.ts
CHANGED
|
@@ -170,7 +170,7 @@ export interface PlanListResponse {
|
|
|
170
170
|
currency: Shared.Currency;
|
|
171
171
|
|
|
172
172
|
/**
|
|
173
|
-
* A text description of the plan visible to customers. Maximum
|
|
173
|
+
* A text description of the plan visible to customers. Maximum 1000 characters.
|
|
174
174
|
* Null if no description is set.
|
|
175
175
|
*/
|
|
176
176
|
description: string | null;
|
|
@@ -578,7 +578,7 @@ export namespace PlanCreateParams {
|
|
|
578
578
|
* in this configuration. The full list of default payment methods can be found in
|
|
579
579
|
* the documentation at docs.whop.com/payments.
|
|
580
580
|
*/
|
|
581
|
-
include_platform_defaults
|
|
581
|
+
include_platform_defaults?: boolean | null;
|
|
582
582
|
}
|
|
583
583
|
}
|
|
584
584
|
|
|
@@ -787,7 +787,7 @@ export namespace PlanUpdateParams {
|
|
|
787
787
|
* in this configuration. The full list of default payment methods can be found in
|
|
788
788
|
* the documentation at docs.whop.com/payments.
|
|
789
789
|
*/
|
|
790
|
-
include_platform_defaults
|
|
790
|
+
include_platform_defaults?: boolean | null;
|
|
791
791
|
}
|
|
792
792
|
}
|
|
793
793
|
|
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
|
*/
|
|
@@ -1866,6 +1872,13 @@ export interface Membership {
|
|
|
1866
1872
|
*/
|
|
1867
1873
|
cancellation_reason: string | null;
|
|
1868
1874
|
|
|
1875
|
+
/**
|
|
1876
|
+
* The ID of the checkout session/configuration that produced this membership, if
|
|
1877
|
+
* any. Use this to map memberships back to the checkout configuration that created
|
|
1878
|
+
* them.
|
|
1879
|
+
*/
|
|
1880
|
+
checkout_configuration_id: string | null;
|
|
1881
|
+
|
|
1869
1882
|
/**
|
|
1870
1883
|
* The company this membership belongs to.
|
|
1871
1884
|
*/
|
|
@@ -2333,6 +2346,12 @@ export interface Payment {
|
|
|
2333
2346
|
*/
|
|
2334
2347
|
card_last4: string | null;
|
|
2335
2348
|
|
|
2349
|
+
/**
|
|
2350
|
+
* The ID of the checkout session/configuration that produced this payment, if any.
|
|
2351
|
+
* Use this to map payments back to the checkout configuration that created them.
|
|
2352
|
+
*/
|
|
2353
|
+
checkout_configuration_id: string | null;
|
|
2354
|
+
|
|
2336
2355
|
/**
|
|
2337
2356
|
* The company for the payment.
|
|
2338
2357
|
*/
|
|
@@ -2818,6 +2837,11 @@ export namespace Payment {
|
|
|
2818
2837
|
* The unique identifier for the plan.
|
|
2819
2838
|
*/
|
|
2820
2839
|
id: string;
|
|
2840
|
+
|
|
2841
|
+
/**
|
|
2842
|
+
* A personal description or notes section for the business.
|
|
2843
|
+
*/
|
|
2844
|
+
internal_notes: string | null;
|
|
2821
2845
|
}
|
|
2822
2846
|
|
|
2823
2847
|
/**
|
|
@@ -3007,7 +3031,7 @@ export interface Plan {
|
|
|
3007
3031
|
custom_fields: Array<Plan.CustomField>;
|
|
3008
3032
|
|
|
3009
3033
|
/**
|
|
3010
|
-
* A text description of the plan visible to customers. Maximum
|
|
3034
|
+
* A text description of the plan visible to customers. Maximum 1000 characters.
|
|
3011
3035
|
* Null if no description is set.
|
|
3012
3036
|
*/
|
|
3013
3037
|
description: string | null;
|
|
@@ -59,15 +59,13 @@ export class SupportChannels extends APIResource {
|
|
|
59
59
|
* @example
|
|
60
60
|
* ```ts
|
|
61
61
|
* // Automatically fetches more pages as needed.
|
|
62
|
-
* for await (const supportChannelListResponse of client.supportChannels.list(
|
|
63
|
-
* { company_id: 'biz_xxxxxxxxxxxxxx' },
|
|
64
|
-
* )) {
|
|
62
|
+
* for await (const supportChannelListResponse of client.supportChannels.list()) {
|
|
65
63
|
* // ...
|
|
66
64
|
* }
|
|
67
65
|
* ```
|
|
68
66
|
*/
|
|
69
67
|
list(
|
|
70
|
-
query: SupportChannelListParams,
|
|
68
|
+
query: SupportChannelListParams | null | undefined = {},
|
|
71
69
|
options?: RequestOptions,
|
|
72
70
|
): PagePromise<SupportChannelListResponsesCursorPage, SupportChannelListResponse> {
|
|
73
71
|
return this._client.getAPIList('/support_channels', CursorPage<SupportChannelListResponse>, {
|
|
@@ -163,14 +161,15 @@ export interface SupportChannelCreateParams {
|
|
|
163
161
|
|
|
164
162
|
export interface SupportChannelListParams extends CursorPageParams {
|
|
165
163
|
/**
|
|
166
|
-
*
|
|
164
|
+
* Returns the elements in the list that come before the specified cursor.
|
|
167
165
|
*/
|
|
168
|
-
|
|
166
|
+
before?: string | null;
|
|
169
167
|
|
|
170
168
|
/**
|
|
171
|
-
*
|
|
169
|
+
* The unique identifier of the company to list support channels for. When omitted,
|
|
170
|
+
* returns support channels across all companies the user has access to.
|
|
172
171
|
*/
|
|
173
|
-
|
|
172
|
+
company_id?: string | null;
|
|
174
173
|
|
|
175
174
|
/**
|
|
176
175
|
* The direction of the sort.
|
|
@@ -197,6 +196,11 @@ export interface SupportChannelListParams extends CursorPageParams {
|
|
|
197
196
|
* Sort options for message channels
|
|
198
197
|
*/
|
|
199
198
|
order?: 'created_at' | 'last_post_sent_at' | null;
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* The perspective to filter support channels by.
|
|
202
|
+
*/
|
|
203
|
+
view?: 'all' | 'admin' | 'customer' | null;
|
|
200
204
|
}
|
|
201
205
|
|
|
202
206
|
export declare namespace SupportChannels {
|