@whop/sdk 0.0.33 → 0.0.35

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 (103) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/client.d.mts +10 -4
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +10 -4
  5. package/client.d.ts.map +1 -1
  6. package/client.js +6 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +6 -0
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/affiliates/affiliates.d.mts +345 -0
  12. package/resources/affiliates/affiliates.d.mts.map +1 -0
  13. package/resources/affiliates/affiliates.d.ts +345 -0
  14. package/resources/affiliates/affiliates.d.ts.map +1 -0
  15. package/resources/affiliates/affiliates.js +112 -0
  16. package/resources/affiliates/affiliates.js.map +1 -0
  17. package/resources/affiliates/affiliates.mjs +107 -0
  18. package/resources/affiliates/affiliates.mjs.map +1 -0
  19. package/resources/affiliates/index.d.mts +3 -0
  20. package/resources/affiliates/index.d.mts.map +1 -0
  21. package/resources/affiliates/index.d.ts +3 -0
  22. package/resources/affiliates/index.d.ts.map +1 -0
  23. package/resources/affiliates/index.js +9 -0
  24. package/resources/affiliates/index.js.map +1 -0
  25. package/resources/affiliates/index.mjs +4 -0
  26. package/resources/affiliates/index.mjs.map +1 -0
  27. package/resources/affiliates/overrides.d.mts +443 -0
  28. package/resources/affiliates/overrides.d.mts.map +1 -0
  29. package/resources/affiliates/overrides.d.ts +443 -0
  30. package/resources/affiliates/overrides.d.ts.map +1 -0
  31. package/resources/affiliates/overrides.js +117 -0
  32. package/resources/affiliates/overrides.js.map +1 -0
  33. package/resources/affiliates/overrides.mjs +113 -0
  34. package/resources/affiliates/overrides.mjs.map +1 -0
  35. package/resources/affiliates.d.mts +2 -0
  36. package/resources/affiliates.d.mts.map +1 -0
  37. package/resources/affiliates.d.ts +2 -0
  38. package/resources/affiliates.d.ts.map +1 -0
  39. package/resources/affiliates.js +6 -0
  40. package/resources/affiliates.js.map +1 -0
  41. package/resources/affiliates.mjs +3 -0
  42. package/resources/affiliates.mjs.map +1 -0
  43. package/resources/ai-chats.d.mts +21 -2
  44. package/resources/ai-chats.d.mts.map +1 -1
  45. package/resources/ai-chats.d.ts +21 -2
  46. package/resources/ai-chats.d.ts.map +1 -1
  47. package/resources/ai-chats.js +2 -1
  48. package/resources/ai-chats.js.map +1 -1
  49. package/resources/ai-chats.mjs +2 -1
  50. package/resources/ai-chats.mjs.map +1 -1
  51. package/resources/index.d.mts +3 -2
  52. package/resources/index.d.mts.map +1 -1
  53. package/resources/index.d.ts +3 -2
  54. package/resources/index.d.ts.map +1 -1
  55. package/resources/index.js +4 -2
  56. package/resources/index.js.map +1 -1
  57. package/resources/index.mjs +1 -0
  58. package/resources/index.mjs.map +1 -1
  59. package/resources/payments.d.mts +1 -1
  60. package/resources/payments.d.mts.map +1 -1
  61. package/resources/payments.d.ts +1 -1
  62. package/resources/payments.d.ts.map +1 -1
  63. package/resources/refunds.d.mts +15 -7
  64. package/resources/refunds.d.mts.map +1 -1
  65. package/resources/refunds.d.ts +15 -7
  66. package/resources/refunds.d.ts.map +1 -1
  67. package/resources/refunds.js +3 -3
  68. package/resources/refunds.js.map +1 -1
  69. package/resources/refunds.mjs +3 -3
  70. package/resources/refunds.mjs.map +1 -1
  71. package/resources/setup-intents.d.mts +74 -0
  72. package/resources/setup-intents.d.mts.map +1 -1
  73. package/resources/setup-intents.d.ts +74 -0
  74. package/resources/setup-intents.d.ts.map +1 -1
  75. package/resources/shared.d.mts +1 -1
  76. package/resources/shared.d.mts.map +1 -1
  77. package/resources/shared.d.ts +1 -1
  78. package/resources/shared.d.ts.map +1 -1
  79. package/resources/users.d.mts +70 -1
  80. package/resources/users.d.mts.map +1 -1
  81. package/resources/users.d.ts +70 -1
  82. package/resources/users.d.ts.map +1 -1
  83. package/resources/users.js +8 -0
  84. package/resources/users.js.map +1 -1
  85. package/resources/users.mjs +8 -0
  86. package/resources/users.mjs.map +1 -1
  87. package/src/client.ts +36 -0
  88. package/src/resources/affiliates/affiliates.ts +467 -0
  89. package/src/resources/affiliates/index.ts +32 -0
  90. package/src/resources/affiliates/overrides.ts +585 -0
  91. package/src/resources/affiliates.ts +3 -0
  92. package/src/resources/ai-chats.ts +25 -1
  93. package/src/resources/index.ts +15 -0
  94. package/src/resources/payments.ts +1 -0
  95. package/src/resources/refunds.ts +17 -7
  96. package/src/resources/setup-intents.ts +90 -0
  97. package/src/resources/shared.ts +1 -0
  98. package/src/resources/users.ts +90 -0
  99. package/src/version.ts +1 -1
  100. package/version.d.mts +1 -1
  101. package/version.d.ts +1 -1
  102. package/version.js +1 -1
  103. package/version.mjs +1 -1
@@ -27,15 +27,15 @@ export class Refunds extends APIResource {
27
27
  }
28
28
 
29
29
  /**
30
- * Returns a paginated list of refunds for a specific payment, with optional
31
- * filtering by creation date.
30
+ * Returns a paginated list of refunds, with optional filtering by payment,
31
+ * company, user, and creation date.
32
32
  *
33
33
  * Required permissions:
34
34
  *
35
35
  * - `payment:basic:read`
36
36
  */
37
37
  list(
38
- query: RefundListParams,
38
+ query: RefundListParams | null | undefined = {},
39
39
  options?: RequestOptions,
40
40
  ): PagePromise<RefundListResponsesCursorPage, RefundListResponse> {
41
41
  return this._client.getAPIList('/refunds', CursorPage<RefundListResponse>, { query, ...options });
@@ -386,14 +386,14 @@ export namespace RefundListResponse {
386
386
 
387
387
  export interface RefundListParams extends CursorPageParams {
388
388
  /**
389
- * The unique identifier of the payment to list refunds for.
389
+ * Returns the elements in the list that come before the specified cursor.
390
390
  */
391
- payment_id: string;
391
+ before?: string | null;
392
392
 
393
393
  /**
394
- * Returns the elements in the list that come before the specified cursor.
394
+ * Filter refunds to only those belonging to this company.
395
395
  */
396
- before?: string | null;
396
+ company_id?: string | null;
397
397
 
398
398
  /**
399
399
  * Only return refunds created after this timestamp.
@@ -419,6 +419,16 @@ export interface RefundListParams extends CursorPageParams {
419
419
  * Returns the last _n_ elements from the list.
420
420
  */
421
421
  last?: number | null;
422
+
423
+ /**
424
+ * Filter refunds to only those associated with this specific payment.
425
+ */
426
+ payment_id?: string | null;
427
+
428
+ /**
429
+ * Filter refunds to only those associated with this specific user.
430
+ */
431
+ user_id?: string | null;
422
432
  }
423
433
 
424
434
  export declare namespace Refunds {
@@ -192,6 +192,11 @@ export namespace SetupIntent {
192
192
  */
193
193
  created_at: string;
194
194
 
195
+ /**
196
+ * The mailing address associated with the payment method's user
197
+ */
198
+ mailing_address: PaymentMethod.MailingAddress | null;
199
+
195
200
  /**
196
201
  * The payment method type of the payment method
197
202
  */
@@ -224,6 +229,46 @@ export namespace SetupIntent {
224
229
  */
225
230
  last4: string | null;
226
231
  }
232
+
233
+ /**
234
+ * The mailing address associated with the payment method's user
235
+ */
236
+ export interface MailingAddress {
237
+ /**
238
+ * The city of the address.
239
+ */
240
+ city: string | null;
241
+
242
+ /**
243
+ * The country of the address.
244
+ */
245
+ country: string | null;
246
+
247
+ /**
248
+ * The line 1 of the address.
249
+ */
250
+ line1: string | null;
251
+
252
+ /**
253
+ * The line 2 of the address.
254
+ */
255
+ line2: string | null;
256
+
257
+ /**
258
+ * The name of the customer.
259
+ */
260
+ name: string | null;
261
+
262
+ /**
263
+ * The postal code of the address.
264
+ */
265
+ postal_code: string | null;
266
+
267
+ /**
268
+ * The state of the address.
269
+ */
270
+ state: string | null;
271
+ }
227
272
  }
228
273
  }
229
274
 
@@ -375,6 +420,11 @@ export namespace SetupIntentListResponse {
375
420
  */
376
421
  created_at: string;
377
422
 
423
+ /**
424
+ * The mailing address associated with the payment method's user
425
+ */
426
+ mailing_address: PaymentMethod.MailingAddress | null;
427
+
378
428
  /**
379
429
  * The payment method type of the payment method
380
430
  */
@@ -407,6 +457,46 @@ export namespace SetupIntentListResponse {
407
457
  */
408
458
  last4: string | null;
409
459
  }
460
+
461
+ /**
462
+ * The mailing address associated with the payment method's user
463
+ */
464
+ export interface MailingAddress {
465
+ /**
466
+ * The city of the address.
467
+ */
468
+ city: string | null;
469
+
470
+ /**
471
+ * The country of the address.
472
+ */
473
+ country: string | null;
474
+
475
+ /**
476
+ * The line 1 of the address.
477
+ */
478
+ line1: string | null;
479
+
480
+ /**
481
+ * The line 2 of the address.
482
+ */
483
+ line2: string | null;
484
+
485
+ /**
486
+ * The name of the customer.
487
+ */
488
+ name: string | null;
489
+
490
+ /**
491
+ * The postal code of the address.
492
+ */
493
+ postal_code: string | null;
494
+
495
+ /**
496
+ * The state of the address.
497
+ */
498
+ state: string | null;
499
+ }
410
500
  }
411
501
  }
412
502
 
@@ -2660,6 +2660,7 @@ export namespace Payment {
2660
2660
  | 'cancel'
2661
2661
  | 'verify'
2662
2662
  | 'chargeback'
2663
+ | 'pre_chargeback'
2663
2664
  | 'three_d_secure'
2664
2665
  | 'fraud_screening'
2665
2666
  | 'authorization'
@@ -3,6 +3,7 @@
3
3
  import { APIResource } from '../core/resource';
4
4
  import * as Shared from './shared';
5
5
  import { APIPromise } from '../core/api-promise';
6
+ import { CursorPage, type CursorPageParams, PagePromise } from '../core/pagination';
6
7
  import { RequestOptions } from '../internal/request-options';
7
8
  import { path } from '../internal/utils/path';
8
9
 
@@ -17,6 +18,17 @@ export class Users extends APIResource {
17
18
  return this._client.get(path`/users/${id}`, options);
18
19
  }
19
20
 
21
+ /**
22
+ * Search for users by name or username, ranked by social proximity to the
23
+ * authenticated user.
24
+ */
25
+ list(
26
+ query: UserListParams | null | undefined = {},
27
+ options?: RequestOptions,
28
+ ): PagePromise<UserListResponsesCursorPage, UserListResponse> {
29
+ return this._client.getAPIList('/users', CursorPage<UserListResponse>, { query, ...options });
30
+ }
31
+
20
32
  /**
21
33
  * Check whether a user has access to a specific resource, and return their access
22
34
  * level.
@@ -45,6 +57,8 @@ export class Users extends APIResource {
45
57
  }
46
58
  }
47
59
 
60
+ export type UserListResponsesCursorPage = CursorPage<UserListResponse>;
61
+
48
62
  /**
49
63
  * A user account on Whop. Contains profile information, identity details, and
50
64
  * social connections.
@@ -96,6 +110,57 @@ export namespace User {
96
110
  }
97
111
  }
98
112
 
113
+ /**
114
+ * A user account on Whop. Contains profile information, identity details, and
115
+ * social connections.
116
+ */
117
+ export interface UserListResponse {
118
+ /**
119
+ * The unique identifier for the user.
120
+ */
121
+ id: string;
122
+
123
+ /**
124
+ * A short biography written by the user, displayed on their public profile.
125
+ */
126
+ bio: string | null;
127
+
128
+ /**
129
+ * The datetime the user was created.
130
+ */
131
+ created_at: string;
132
+
133
+ /**
134
+ * The user's display name shown on their public profile.
135
+ */
136
+ name: string | null;
137
+
138
+ /**
139
+ * The user's profile picture attachment with URL, content type, and file metadata.
140
+ * Null if using a legacy profile picture.
141
+ */
142
+ profile_picture: UserListResponse.ProfilePicture | null;
143
+
144
+ /**
145
+ * The user's unique username shown on their public profile.
146
+ */
147
+ username: string;
148
+ }
149
+
150
+ export namespace UserListResponse {
151
+ /**
152
+ * The user's profile picture attachment with URL, content type, and file metadata.
153
+ * Null if using a legacy profile picture.
154
+ */
155
+ export interface ProfilePicture {
156
+ /**
157
+ * A pre-optimized URL for rendering this attachment on the client. This should be
158
+ * used for displaying attachments in apps.
159
+ */
160
+ url: string | null;
161
+ }
162
+ }
163
+
99
164
  /**
100
165
  * The result of a has access check for the developer API
101
166
  */
@@ -111,6 +176,28 @@ export interface UserCheckAccessResponse {
111
176
  has_access: boolean;
112
177
  }
113
178
 
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
+
190
+ /**
191
+ * Returns the last _n_ elements from the list.
192
+ */
193
+ last?: number | null;
194
+
195
+ /**
196
+ * Search term to filter by name or username.
197
+ */
198
+ query?: string | null;
199
+ }
200
+
114
201
  export interface UserCheckAccessParams {
115
202
  /**
116
203
  * The unique identifier or username of the user.
@@ -156,7 +243,10 @@ export namespace UserUpdateProfileParams {
156
243
  export declare namespace Users {
157
244
  export {
158
245
  type User as User,
246
+ type UserListResponse as UserListResponse,
159
247
  type UserCheckAccessResponse as UserCheckAccessResponse,
248
+ type UserListResponsesCursorPage as UserListResponsesCursorPage,
249
+ type UserListParams as UserListParams,
160
250
  type UserCheckAccessParams as UserCheckAccessParams,
161
251
  type UserUpdateProfileParams as UserUpdateProfileParams,
162
252
  };
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.0.33'; // x-release-please-version
1
+ export const VERSION = '0.0.35'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.0.33";
1
+ export declare const VERSION = "0.0.35";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.0.33";
1
+ export declare const VERSION = "0.0.35";
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.33'; // x-release-please-version
4
+ exports.VERSION = '0.0.35'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.0.33'; // x-release-please-version
1
+ export const VERSION = '0.0.35'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map