@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
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.39'; // 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.39";
|
|
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.39";
|
|
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.39'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|