@whop/sdk 0.0.31 → 0.0.32

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 (56) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/client.d.mts +8 -2
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +8 -2
  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/ai-chats.d.mts +4 -0
  12. package/resources/ai-chats.d.mts.map +1 -1
  13. package/resources/ai-chats.d.ts +4 -0
  14. package/resources/ai-chats.d.ts.map +1 -1
  15. package/resources/authorized-users.d.mts +7 -66
  16. package/resources/authorized-users.d.mts.map +1 -1
  17. package/resources/authorized-users.d.ts +7 -66
  18. package/resources/authorized-users.d.ts.map +1 -1
  19. package/resources/authorized-users.js.map +1 -1
  20. package/resources/authorized-users.mjs.map +1 -1
  21. package/resources/index.d.mts +2 -1
  22. package/resources/index.d.mts.map +1 -1
  23. package/resources/index.d.ts +2 -1
  24. package/resources/index.d.ts.map +1 -1
  25. package/resources/index.js +4 -1
  26. package/resources/index.js.map +1 -1
  27. package/resources/index.mjs +1 -0
  28. package/resources/index.mjs.map +1 -1
  29. package/resources/products.d.mts +10 -0
  30. package/resources/products.d.mts.map +1 -1
  31. package/resources/products.d.ts +10 -0
  32. package/resources/products.d.ts.map +1 -1
  33. package/resources/resolution-center-cases.d.mts +367 -0
  34. package/resources/resolution-center-cases.d.mts.map +1 -0
  35. package/resources/resolution-center-cases.d.ts +367 -0
  36. package/resources/resolution-center-cases.d.ts.map +1 -0
  37. package/resources/resolution-center-cases.js +38 -0
  38. package/resources/resolution-center-cases.js.map +1 -0
  39. package/resources/resolution-center-cases.mjs +34 -0
  40. package/resources/resolution-center-cases.mjs.map +1 -0
  41. package/resources/shared.d.mts +8 -7
  42. package/resources/shared.d.mts.map +1 -1
  43. package/resources/shared.d.ts +8 -7
  44. package/resources/shared.d.ts.map +1 -1
  45. package/src/client.ts +32 -4
  46. package/src/resources/ai-chats.ts +5 -0
  47. package/src/resources/authorized-users.ts +7 -80
  48. package/src/resources/index.ts +13 -2
  49. package/src/resources/products.ts +12 -0
  50. package/src/resources/resolution-center-cases.ts +492 -0
  51. package/src/resources/shared.ts +8 -22
  52. package/src/version.ts +1 -1
  53. package/version.d.mts +1 -1
  54. package/version.d.ts +1 -1
  55. package/version.js +1 -1
  56. package/version.mjs +1 -1
@@ -214,6 +214,12 @@ export interface ProductCreateParams {
214
214
  */
215
215
  route?: string | null;
216
216
 
217
+ /**
218
+ * Whether to send an automated welcome message via support chat when a user joins
219
+ * this product. Defaults to true.
220
+ */
221
+ send_welcome_message?: boolean | null;
222
+
217
223
  /**
218
224
  * Visibility of a resource
219
225
  */
@@ -379,6 +385,12 @@ export interface ProductUpdateParams {
379
385
  */
380
386
  route?: string | null;
381
387
 
388
+ /**
389
+ * Whether to send an automated welcome message via support chat when a user joins
390
+ * this product.
391
+ */
392
+ send_welcome_message?: boolean | null;
393
+
382
394
  /**
383
395
  * Layout and display configuration for this product on the company's store page.
384
396
  */
@@ -0,0 +1,492 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../core/resource';
4
+ import * as Shared from './shared';
5
+ import { APIPromise } from '../core/api-promise';
6
+ import { CursorPage, type CursorPageParams, PagePromise } from '../core/pagination';
7
+ import { RequestOptions } from '../internal/request-options';
8
+ import { path } from '../internal/utils/path';
9
+
10
+ /**
11
+ * Resolution center cases
12
+ */
13
+ export class ResolutionCenterCases extends APIResource {
14
+ /**
15
+ * Retrieves the details of an existing resolution center case.
16
+ *
17
+ * Required permissions:
18
+ *
19
+ * - `payment:resolution_center_case:read`
20
+ */
21
+ retrieve(id: string, options?: RequestOptions): APIPromise<ResolutionCenterCaseRetrieveResponse> {
22
+ return this._client.get(path`/resolution_center_cases/${id}`, options);
23
+ }
24
+
25
+ /**
26
+ * Returns a paginated list of resolution center cases, with optional filtering by
27
+ * company, status, and creation date.
28
+ *
29
+ * Required permissions:
30
+ *
31
+ * - `payment:resolution_center_case:read`
32
+ */
33
+ list(
34
+ query: ResolutionCenterCaseListParams | null | undefined = {},
35
+ options?: RequestOptions,
36
+ ): PagePromise<ResolutionCenterCaseListResponsesCursorPage, ResolutionCenterCaseListResponse> {
37
+ return this._client.getAPIList('/resolution_center_cases', CursorPage<ResolutionCenterCaseListResponse>, {
38
+ query,
39
+ ...options,
40
+ });
41
+ }
42
+ }
43
+
44
+ export type ResolutionCenterCaseListResponsesCursorPage = CursorPage<ResolutionCenterCaseListResponse>;
45
+
46
+ /**
47
+ * The types of responses a customer can make to a resolution.
48
+ */
49
+ export type ResolutionCenterCaseCustomerResponse = 'respond' | 'appeal' | 'withdraw';
50
+
51
+ /**
52
+ * The different types of issues a resolution can be
53
+ */
54
+ export type ResolutionCenterCaseIssueType =
55
+ | 'forgot_to_cancel'
56
+ | 'item_not_received'
57
+ | 'significantly_not_as_described'
58
+ | 'unauthorized_transaction'
59
+ | 'product_unacceptable';
60
+
61
+ /**
62
+ * The types of responses a merchant can make to a resolution.
63
+ */
64
+ export type ResolutionCenterCaseMerchantResponse =
65
+ | 'accept'
66
+ | 'deny'
67
+ | 'request_more_info'
68
+ | 'appeal'
69
+ | 'respond';
70
+
71
+ /**
72
+ * The types of responses the platform can make to a resolution.
73
+ */
74
+ export type ResolutionCenterCasePlatformResponse =
75
+ | 'request_buyer_info'
76
+ | 'request_merchant_info'
77
+ | 'merchant_wins'
78
+ | 'platform_refund'
79
+ | 'merchant_refund';
80
+
81
+ /**
82
+ * The statuses a resolution object can have
83
+ */
84
+ export type ResolutionCenterCaseStatus =
85
+ | 'merchant_response_needed'
86
+ | 'customer_response_needed'
87
+ | 'merchant_info_needed'
88
+ | 'customer_info_needed'
89
+ | 'under_platform_review'
90
+ | 'customer_won'
91
+ | 'merchant_won'
92
+ | 'customer_withdrew';
93
+
94
+ /**
95
+ * A resolution center case is a dispute or support case between a user and a
96
+ * company, tracking the issue, status, and outcome.
97
+ */
98
+ export interface ResolutionCenterCaseRetrieveResponse {
99
+ /**
100
+ * The unique identifier for the resolution.
101
+ */
102
+ id: string;
103
+
104
+ /**
105
+ * The company involved in this resolution case. Null if the company no longer
106
+ * exists.
107
+ */
108
+ company: ResolutionCenterCaseRetrieveResponse.Company | null;
109
+
110
+ /**
111
+ * The datetime the resolution was created.
112
+ */
113
+ created_at: string;
114
+
115
+ /**
116
+ * Whether the customer has filed an appeal after the initial resolution decision.
117
+ */
118
+ customer_appealed: boolean;
119
+
120
+ /**
121
+ * The list of actions currently available to the customer.
122
+ */
123
+ customer_response_actions: Array<ResolutionCenterCaseCustomerResponse>;
124
+
125
+ /**
126
+ * The deadline by which the next response is required. Null if no deadline is
127
+ * currently active. As a Unix timestamp.
128
+ */
129
+ due_date: string | null;
130
+
131
+ /**
132
+ * The category of the dispute.
133
+ */
134
+ issue: ResolutionCenterCaseIssueType;
135
+
136
+ /**
137
+ * The membership record associated with the disputed payment. Null if the
138
+ * membership no longer exists.
139
+ */
140
+ member: ResolutionCenterCaseRetrieveResponse.Member | null;
141
+
142
+ /**
143
+ * Whether the merchant has filed an appeal after the initial resolution decision.
144
+ */
145
+ merchant_appealed: boolean;
146
+
147
+ /**
148
+ * The list of actions currently available to the merchant.
149
+ */
150
+ merchant_response_actions: Array<ResolutionCenterCaseMerchantResponse>;
151
+
152
+ /**
153
+ * The payment record that is the subject of this resolution case.
154
+ */
155
+ payment: ResolutionCenterCaseRetrieveResponse.Payment;
156
+
157
+ /**
158
+ * The list of actions currently available to the Whop platform for moderating this
159
+ * resolution.
160
+ */
161
+ platform_response_actions: Array<ResolutionCenterCasePlatformResponse>;
162
+
163
+ /**
164
+ * The most recent 50 messages, actions, and status changes that have occurred
165
+ * during this resolution case.
166
+ */
167
+ resolution_events: Array<ResolutionCenterCaseRetrieveResponse.ResolutionEvent>;
168
+
169
+ /**
170
+ * The current status of the resolution case, indicating which party needs to
171
+ * respond or if the case is closed.
172
+ */
173
+ status: ResolutionCenterCaseStatus;
174
+
175
+ /**
176
+ * The datetime the resolution was last updated.
177
+ */
178
+ updated_at: string;
179
+
180
+ /**
181
+ * The customer (buyer) who filed this resolution case.
182
+ */
183
+ user: ResolutionCenterCaseRetrieveResponse.User;
184
+ }
185
+
186
+ export namespace ResolutionCenterCaseRetrieveResponse {
187
+ /**
188
+ * The company involved in this resolution case. Null if the company no longer
189
+ * exists.
190
+ */
191
+ export interface Company {
192
+ /**
193
+ * The unique identifier for the company.
194
+ */
195
+ id: string;
196
+
197
+ /**
198
+ * The display name of the company shown to customers.
199
+ */
200
+ title: string;
201
+ }
202
+
203
+ /**
204
+ * The membership record associated with the disputed payment. Null if the
205
+ * membership no longer exists.
206
+ */
207
+ export interface Member {
208
+ /**
209
+ * The unique identifier for the extra public member.
210
+ */
211
+ id: string;
212
+ }
213
+
214
+ /**
215
+ * The payment record that is the subject of this resolution case.
216
+ */
217
+ export interface Payment {
218
+ /**
219
+ * The unique identifier for the payment.
220
+ */
221
+ id: string;
222
+
223
+ /**
224
+ * The datetime the payment was created.
225
+ */
226
+ created_at: string;
227
+
228
+ /**
229
+ * The available currencies on the platform
230
+ */
231
+ currency: Shared.Currency | null;
232
+
233
+ /**
234
+ * The time at which this payment was successfully collected. Null if the payment
235
+ * has not yet succeeded. As a Unix timestamp.
236
+ */
237
+ paid_at: string | null;
238
+
239
+ /**
240
+ * The payment amount before taxes and discounts are applied. In the currency
241
+ * specified by the currency field.
242
+ */
243
+ subtotal: number | null;
244
+
245
+ /**
246
+ * The total amount charged to the customer for this payment, including taxes and
247
+ * after any discounts. In the currency specified by the currency field.
248
+ */
249
+ total: number;
250
+ }
251
+
252
+ /**
253
+ * A resolution event is a message or action within a resolution case, such as a
254
+ * response, escalation, or status change.
255
+ */
256
+ export interface ResolutionEvent {
257
+ /**
258
+ * The unique identifier for the resolution event.
259
+ */
260
+ id: string;
261
+
262
+ /**
263
+ * The type of action recorded in this event.
264
+ */
265
+ action:
266
+ | 'created'
267
+ | 'responded'
268
+ | 'accepted'
269
+ | 'denied'
270
+ | 'appealed'
271
+ | 'withdrew'
272
+ | 'requested_more_info'
273
+ | 'escalated'
274
+ | 'dispute_opened'
275
+ | 'dispute_customer_won'
276
+ | 'dispute_merchant_won';
277
+
278
+ /**
279
+ * The datetime the resolution event was created.
280
+ */
281
+ created_at: string;
282
+
283
+ /**
284
+ * The message body or additional context provided with this resolution event. Null
285
+ * if no details were included.
286
+ */
287
+ details: string | null;
288
+
289
+ /**
290
+ * The party who performed this action.
291
+ */
292
+ reporter_type: 'merchant' | 'customer' | 'platform' | 'system';
293
+ }
294
+
295
+ /**
296
+ * The customer (buyer) who filed this resolution case.
297
+ */
298
+ export interface User {
299
+ /**
300
+ * The unique identifier for the user.
301
+ */
302
+ id: string;
303
+
304
+ /**
305
+ * The user's display name shown on their public profile.
306
+ */
307
+ name: string | null;
308
+
309
+ /**
310
+ * The user's unique username shown on their public profile.
311
+ */
312
+ username: string;
313
+ }
314
+ }
315
+
316
+ /**
317
+ * A resolution center case is a dispute or support case between a user and a
318
+ * company, tracking the issue, status, and outcome.
319
+ */
320
+ export interface ResolutionCenterCaseListResponse {
321
+ /**
322
+ * The unique identifier for the resolution.
323
+ */
324
+ id: string;
325
+
326
+ /**
327
+ * The company involved in this resolution case. Null if the company no longer
328
+ * exists.
329
+ */
330
+ company: ResolutionCenterCaseListResponse.Company | null;
331
+
332
+ /**
333
+ * The datetime the resolution was created.
334
+ */
335
+ created_at: string;
336
+
337
+ /**
338
+ * Whether the customer has filed an appeal after the initial resolution decision.
339
+ */
340
+ customer_appealed: boolean;
341
+
342
+ /**
343
+ * The list of actions currently available to the customer.
344
+ */
345
+ customer_response_actions: Array<ResolutionCenterCaseCustomerResponse>;
346
+
347
+ /**
348
+ * The deadline by which the next response is required. Null if no deadline is
349
+ * currently active. As a Unix timestamp.
350
+ */
351
+ due_date: string | null;
352
+
353
+ /**
354
+ * The category of the dispute.
355
+ */
356
+ issue: ResolutionCenterCaseIssueType;
357
+
358
+ /**
359
+ * Whether the merchant has filed an appeal after the initial resolution decision.
360
+ */
361
+ merchant_appealed: boolean;
362
+
363
+ /**
364
+ * The list of actions currently available to the merchant.
365
+ */
366
+ merchant_response_actions: Array<ResolutionCenterCaseMerchantResponse>;
367
+
368
+ /**
369
+ * The payment record that is the subject of this resolution case.
370
+ */
371
+ payment: ResolutionCenterCaseListResponse.Payment;
372
+
373
+ /**
374
+ * The current status of the resolution case, indicating which party needs to
375
+ * respond or if the case is closed.
376
+ */
377
+ status: ResolutionCenterCaseStatus;
378
+
379
+ /**
380
+ * The datetime the resolution was last updated.
381
+ */
382
+ updated_at: string;
383
+
384
+ /**
385
+ * The customer (buyer) who filed this resolution case.
386
+ */
387
+ user: ResolutionCenterCaseListResponse.User;
388
+ }
389
+
390
+ export namespace ResolutionCenterCaseListResponse {
391
+ /**
392
+ * The company involved in this resolution case. Null if the company no longer
393
+ * exists.
394
+ */
395
+ export interface Company {
396
+ /**
397
+ * The unique identifier for the company.
398
+ */
399
+ id: string;
400
+
401
+ /**
402
+ * The display name of the company shown to customers.
403
+ */
404
+ title: string;
405
+ }
406
+
407
+ /**
408
+ * The payment record that is the subject of this resolution case.
409
+ */
410
+ export interface Payment {
411
+ /**
412
+ * The unique identifier for the payment.
413
+ */
414
+ id: string;
415
+ }
416
+
417
+ /**
418
+ * The customer (buyer) who filed this resolution case.
419
+ */
420
+ export interface User {
421
+ /**
422
+ * The unique identifier for the user.
423
+ */
424
+ id: string;
425
+
426
+ /**
427
+ * The user's display name shown on their public profile.
428
+ */
429
+ name: string | null;
430
+
431
+ /**
432
+ * The user's unique username shown on their public profile.
433
+ */
434
+ username: string;
435
+ }
436
+ }
437
+
438
+ export interface ResolutionCenterCaseListParams extends CursorPageParams {
439
+ /**
440
+ * Returns the elements in the list that come before the specified cursor.
441
+ */
442
+ before?: string | null;
443
+
444
+ /**
445
+ * The unique identifier of the company to list resolution center cases for.
446
+ */
447
+ company_id?: string | null;
448
+
449
+ /**
450
+ * Only return cases created after this timestamp.
451
+ */
452
+ created_after?: string | null;
453
+
454
+ /**
455
+ * Only return cases created before this timestamp.
456
+ */
457
+ created_before?: string | null;
458
+
459
+ /**
460
+ * The direction of the sort.
461
+ */
462
+ direction?: Shared.Direction | null;
463
+
464
+ /**
465
+ * Returns the first _n_ elements from the list.
466
+ */
467
+ first?: number | null;
468
+
469
+ /**
470
+ * Returns the last _n_ elements from the list.
471
+ */
472
+ last?: number | null;
473
+
474
+ /**
475
+ * Filter by resolution center case status.
476
+ */
477
+ statuses?: Array<ResolutionCenterCaseStatus> | null;
478
+ }
479
+
480
+ export declare namespace ResolutionCenterCases {
481
+ export {
482
+ type ResolutionCenterCaseCustomerResponse as ResolutionCenterCaseCustomerResponse,
483
+ type ResolutionCenterCaseIssueType as ResolutionCenterCaseIssueType,
484
+ type ResolutionCenterCaseMerchantResponse as ResolutionCenterCaseMerchantResponse,
485
+ type ResolutionCenterCasePlatformResponse as ResolutionCenterCasePlatformResponse,
486
+ type ResolutionCenterCaseStatus as ResolutionCenterCaseStatus,
487
+ type ResolutionCenterCaseRetrieveResponse as ResolutionCenterCaseRetrieveResponse,
488
+ type ResolutionCenterCaseListResponse as ResolutionCenterCaseListResponse,
489
+ type ResolutionCenterCaseListResponsesCursorPage as ResolutionCenterCaseListResponsesCursorPage,
490
+ type ResolutionCenterCaseListParams as ResolutionCenterCaseListParams,
491
+ };
492
+ }
@@ -7,6 +7,7 @@ import * as CompaniesAPI from './companies';
7
7
  import * as DisputesAPI from './disputes';
8
8
  import * as MembershipsAPI from './memberships';
9
9
  import * as PaymentsAPI from './payments';
10
+ import * as ResolutionCenterCasesAPI from './resolution-center-cases';
10
11
  import { CursorPage } from '../core/pagination';
11
12
 
12
13
  /**
@@ -2819,8 +2820,8 @@ export namespace Payment {
2819
2820
  }
2820
2821
 
2821
2822
  /**
2822
- * A resolution is a dispute or support case between a buyer and seller, tracking
2823
- * the issue, status, and outcome.
2823
+ * A resolution center case is a dispute or support case between a user and a
2824
+ * company, tracking the issue, status, and outcome.
2824
2825
  */
2825
2826
  export interface Resolution {
2826
2827
  /**
@@ -2836,7 +2837,7 @@ export namespace Payment {
2836
2837
  /**
2837
2838
  * The list of actions currently available to the customer.
2838
2839
  */
2839
- customer_response_actions: Array<'respond' | 'appeal' | 'withdraw'>;
2840
+ customer_response_actions: Array<ResolutionCenterCasesAPI.ResolutionCenterCaseCustomerResponse>;
2840
2841
 
2841
2842
  /**
2842
2843
  * The deadline by which the next response is required. Null if no deadline is
@@ -2847,12 +2848,7 @@ export namespace Payment {
2847
2848
  /**
2848
2849
  * The category of the dispute.
2849
2850
  */
2850
- issue:
2851
- | 'forgot_to_cancel'
2852
- | 'item_not_received'
2853
- | 'significantly_not_as_described'
2854
- | 'unauthorized_transaction'
2855
- | 'product_unacceptable';
2851
+ issue: ResolutionCenterCasesAPI.ResolutionCenterCaseIssueType;
2856
2852
 
2857
2853
  /**
2858
2854
  * Whether the merchant has filed an appeal after the initial resolution decision.
@@ -2862,29 +2858,19 @@ export namespace Payment {
2862
2858
  /**
2863
2859
  * The list of actions currently available to the merchant.
2864
2860
  */
2865
- merchant_response_actions: Array<'accept' | 'deny' | 'request_more_info' | 'appeal' | 'respond'>;
2861
+ merchant_response_actions: Array<ResolutionCenterCasesAPI.ResolutionCenterCaseMerchantResponse>;
2866
2862
 
2867
2863
  /**
2868
2864
  * The list of actions currently available to the Whop platform for moderating this
2869
2865
  * resolution.
2870
2866
  */
2871
- platform_response_actions: Array<
2872
- 'request_buyer_info' | 'request_merchant_info' | 'merchant_wins' | 'platform_refund' | 'merchant_refund'
2873
- >;
2867
+ platform_response_actions: Array<ResolutionCenterCasesAPI.ResolutionCenterCasePlatformResponse>;
2874
2868
 
2875
2869
  /**
2876
2870
  * The current status of the resolution case, indicating which party needs to
2877
2871
  * respond or if the case is closed.
2878
2872
  */
2879
- status:
2880
- | 'merchant_response_needed'
2881
- | 'customer_response_needed'
2882
- | 'merchant_info_needed'
2883
- | 'customer_info_needed'
2884
- | 'under_platform_review'
2885
- | 'customer_won'
2886
- | 'merchant_won'
2887
- | 'customer_withdrew';
2873
+ status: ResolutionCenterCasesAPI.ResolutionCenterCaseStatus;
2888
2874
  }
2889
2875
 
2890
2876
  /**
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.0.31'; // x-release-please-version
1
+ export const VERSION = '0.0.32'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.0.31";
1
+ export declare const VERSION = "0.0.32";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.0.31";
1
+ export declare const VERSION = "0.0.32";
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.31'; // x-release-please-version
4
+ exports.VERSION = '0.0.32'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.0.31'; // x-release-please-version
1
+ export const VERSION = '0.0.32'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map