@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.
Files changed (93) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/client.d.mts +16 -3
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +16 -3
  5. package/client.d.ts.map +1 -1
  6. package/client.js +7 -1
  7. package/client.js.map +1 -1
  8. package/client.mjs +7 -1
  9. package/client.mjs.map +1 -1
  10. package/lib/verify-user-token.d.mts +1 -0
  11. package/lib/verify-user-token.d.mts.map +1 -1
  12. package/lib/verify-user-token.d.ts +1 -0
  13. package/lib/verify-user-token.d.ts.map +1 -1
  14. package/lib/verify-user-token.js +39 -13
  15. package/lib/verify-user-token.js.map +1 -1
  16. package/lib/verify-user-token.mjs +40 -14
  17. package/lib/verify-user-token.mjs.map +1 -1
  18. package/package.json +1 -1
  19. package/resources/checkout-configurations.d.mts +24 -4
  20. package/resources/checkout-configurations.d.mts.map +1 -1
  21. package/resources/checkout-configurations.d.ts +24 -4
  22. package/resources/checkout-configurations.d.ts.map +1 -1
  23. package/resources/files.d.mts.map +1 -1
  24. package/resources/files.d.ts.map +1 -1
  25. package/resources/forums.d.mts +5 -0
  26. package/resources/forums.d.mts.map +1 -1
  27. package/resources/forums.d.ts +5 -0
  28. package/resources/forums.d.ts.map +1 -1
  29. package/resources/index.d.mts +1 -1
  30. package/resources/index.d.mts.map +1 -1
  31. package/resources/index.d.ts +1 -1
  32. package/resources/index.d.ts.map +1 -1
  33. package/resources/index.js.map +1 -1
  34. package/resources/index.mjs.map +1 -1
  35. package/resources/invoices.d.mts +26 -10
  36. package/resources/invoices.d.mts.map +1 -1
  37. package/resources/invoices.d.ts +26 -10
  38. package/resources/invoices.d.ts.map +1 -1
  39. package/resources/memberships.d.mts +6 -0
  40. package/resources/memberships.d.mts.map +1 -1
  41. package/resources/memberships.d.ts +6 -0
  42. package/resources/memberships.d.ts.map +1 -1
  43. package/resources/payments.d.mts +10 -1
  44. package/resources/payments.d.mts.map +1 -1
  45. package/resources/payments.d.ts +10 -1
  46. package/resources/payments.d.ts.map +1 -1
  47. package/resources/plans.d.mts +3 -3
  48. package/resources/plans.d.mts.map +1 -1
  49. package/resources/plans.d.ts +3 -3
  50. package/resources/plans.d.ts.map +1 -1
  51. package/resources/shared.d.mts +21 -1
  52. package/resources/shared.d.mts.map +1 -1
  53. package/resources/shared.d.ts +21 -1
  54. package/resources/shared.d.ts.map +1 -1
  55. package/resources/support-channels.d.mts +11 -8
  56. package/resources/support-channels.d.mts.map +1 -1
  57. package/resources/support-channels.d.ts +11 -8
  58. package/resources/support-channels.d.ts.map +1 -1
  59. package/resources/support-channels.js +2 -4
  60. package/resources/support-channels.js.map +1 -1
  61. package/resources/support-channels.mjs +2 -4
  62. package/resources/support-channels.mjs.map +1 -1
  63. package/resources/users.d.mts +77 -34
  64. package/resources/users.d.mts.map +1 -1
  65. package/resources/users.d.ts +77 -34
  66. package/resources/users.d.ts.map +1 -1
  67. package/resources/users.js +42 -12
  68. package/resources/users.js.map +1 -1
  69. package/resources/users.mjs +42 -12
  70. package/resources/users.mjs.map +1 -1
  71. package/resources/verifications.d.mts +1 -1
  72. package/resources/verifications.d.mts.map +1 -1
  73. package/resources/verifications.d.ts +1 -1
  74. package/resources/verifications.d.ts.map +1 -1
  75. package/src/client.ts +27 -2
  76. package/src/lib/verify-user-token.ts +49 -16
  77. package/src/resources/checkout-configurations.ts +28 -4
  78. package/src/resources/files.ts +1 -1
  79. package/src/resources/forums.ts +6 -0
  80. package/src/resources/index.ts +2 -1
  81. package/src/resources/invoices.ts +29 -10
  82. package/src/resources/memberships.ts +7 -0
  83. package/src/resources/payments.ts +16 -0
  84. package/src/resources/plans.ts +3 -3
  85. package/src/resources/shared.ts +25 -1
  86. package/src/resources/support-channels.ts +12 -8
  87. package/src/resources/users.ts +95 -44
  88. package/src/resources/verifications.ts +2 -1
  89. package/src/version.ts +1 -1
  90. package/version.d.mts +1 -1
  91. package/version.d.ts +1 -1
  92. package/version.js +1 -1
  93. package/version.mjs +1 -1
@@ -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(id: string, options?: RequestOptions): APIPromise<User> {
18
- return this._client.get(path`/users/${id}`, options);
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 UserListParams extends CursorPageParams {
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
- * Returns the last _n_ elements from the list.
216
+ * When provided, returns the user's company-specific profile overrides (name,
217
+ * profile picture) instead of their global profile.
192
218
  */
193
- last?: number | null;
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 UserCheckAccessParams {
222
+ export interface UserUpdateParams {
202
223
  /**
203
- * The unique identifier or username of the user.
224
+ * A short biography displayed on the user's public profile.
204
225
  */
205
- id: string;
206
- }
226
+ bio?: string | null;
207
227
 
208
- export interface UserUpdateProfileParams {
209
228
  /**
210
- * A short biography displayed on the user's public profile.
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
- bio?: string | null;
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?: UserUpdateProfileParams.ProfilePicture | null;
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 UserUpdateProfileParams {
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
  }
@@ -82,7 +82,8 @@ export type VerificationStatus =
82
82
  | 'resubmission_requested'
83
83
  | 'expired'
84
84
  | 'abandoned'
85
- | 'review';
85
+ | 'review'
86
+ | 'action_required';
86
87
 
87
88
  /**
88
89
  * An identity verification session used to confirm a person or entity's identity
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.0.37'; // x-release-please-version
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.37";
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.37";
1
+ export declare const VERSION = "0.0.39";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.0.37'; // x-release-please-version
4
+ exports.VERSION = '0.0.39'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.0.37'; // x-release-please-version
1
+ export const VERSION = '0.0.39'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map