@whop/sdk 0.0.5 → 0.0.7

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 (95) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/README.md +0 -4
  3. package/client.d.mts +12 -6
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +12 -6
  6. package/client.d.ts.map +1 -1
  7. package/client.js +8 -5
  8. package/client.js.map +1 -1
  9. package/client.mjs +8 -5
  10. package/client.mjs.map +1 -1
  11. package/lib/verify-user-token.d.mts.map +1 -1
  12. package/lib/verify-user-token.d.ts.map +1 -1
  13. package/lib/verify-user-token.js +6 -3
  14. package/lib/verify-user-token.js.map +1 -1
  15. package/lib/verify-user-token.mjs +6 -3
  16. package/lib/verify-user-token.mjs.map +1 -1
  17. package/package.json +1 -1
  18. package/resources/access-tokens.d.mts +48 -26
  19. package/resources/access-tokens.d.mts.map +1 -1
  20. package/resources/access-tokens.d.ts +48 -26
  21. package/resources/access-tokens.d.ts.map +1 -1
  22. package/resources/access-tokens.js +5 -5
  23. package/resources/access-tokens.mjs +5 -5
  24. package/resources/checkout-configurations.d.mts +4 -4
  25. package/resources/checkout-configurations.d.mts.map +1 -1
  26. package/resources/checkout-configurations.d.ts +4 -4
  27. package/resources/checkout-configurations.d.ts.map +1 -1
  28. package/resources/disputes.d.mts +704 -0
  29. package/resources/disputes.d.mts.map +1 -0
  30. package/resources/disputes.d.ts +704 -0
  31. package/resources/disputes.d.ts.map +1 -0
  32. package/resources/disputes.js +77 -0
  33. package/resources/disputes.js.map +1 -0
  34. package/resources/disputes.mjs +73 -0
  35. package/resources/disputes.mjs.map +1 -0
  36. package/resources/forum-posts.d.mts +8 -0
  37. package/resources/forum-posts.d.mts.map +1 -1
  38. package/resources/forum-posts.d.ts +8 -0
  39. package/resources/forum-posts.d.ts.map +1 -1
  40. package/resources/index.d.mts +3 -1
  41. package/resources/index.d.mts.map +1 -1
  42. package/resources/index.d.ts +3 -1
  43. package/resources/index.d.ts.map +1 -1
  44. package/resources/index.js +5 -1
  45. package/resources/index.js.map +1 -1
  46. package/resources/index.mjs +2 -0
  47. package/resources/index.mjs.map +1 -1
  48. package/resources/ledger-accounts.d.mts +1 -1
  49. package/resources/ledger-accounts.d.mts.map +1 -1
  50. package/resources/ledger-accounts.d.ts +1 -1
  51. package/resources/ledger-accounts.d.ts.map +1 -1
  52. package/resources/notifications.d.mts +105 -0
  53. package/resources/notifications.d.mts.map +1 -0
  54. package/resources/notifications.d.ts +105 -0
  55. package/resources/notifications.d.ts.map +1 -0
  56. package/resources/notifications.js +24 -0
  57. package/resources/notifications.js.map +1 -0
  58. package/resources/notifications.mjs +20 -0
  59. package/resources/notifications.mjs.map +1 -0
  60. package/resources/payments.d.mts +1 -1
  61. package/resources/payments.d.mts.map +1 -1
  62. package/resources/payments.d.ts +1 -1
  63. package/resources/payments.d.ts.map +1 -1
  64. package/resources/shared.d.mts +3 -3
  65. package/resources/shared.d.mts.map +1 -1
  66. package/resources/shared.d.ts +3 -3
  67. package/resources/shared.d.ts.map +1 -1
  68. package/resources/shipments.d.mts +1 -1
  69. package/resources/shipments.d.mts.map +1 -1
  70. package/resources/shipments.d.ts +1 -1
  71. package/resources/shipments.d.ts.map +1 -1
  72. package/resources/webhooks.d.mts +47 -2
  73. package/resources/webhooks.d.mts.map +1 -1
  74. package/resources/webhooks.d.ts +47 -2
  75. package/resources/webhooks.d.ts.map +1 -1
  76. package/resources/webhooks.js.map +1 -1
  77. package/resources/webhooks.mjs.map +1 -1
  78. package/src/client.ts +43 -10
  79. package/src/lib/verify-user-token.ts +6 -3
  80. package/src/resources/access-tokens.ts +53 -26
  81. package/src/resources/checkout-configurations.ts +4 -4
  82. package/src/resources/disputes.ts +873 -0
  83. package/src/resources/forum-posts.ts +10 -0
  84. package/src/resources/index.ts +16 -0
  85. package/src/resources/ledger-accounts.ts +1 -0
  86. package/src/resources/notifications.ts +131 -0
  87. package/src/resources/payments.ts +1 -0
  88. package/src/resources/shared.ts +13 -3
  89. package/src/resources/shipments.ts +1 -1
  90. package/src/resources/webhooks.ts +60 -1
  91. package/src/version.ts +1 -1
  92. package/version.d.mts +1 -1
  93. package/version.d.ts +1 -1
  94. package/version.js +1 -1
  95. package/version.mjs +1 -1
@@ -234,6 +234,11 @@ export interface ForumPostCreateParams {
234
234
  * The title of the post. Only visible if paywalled.
235
235
  */
236
236
  title?: string | null;
237
+
238
+ /**
239
+ * The visibility types for forum posts
240
+ */
241
+ visibility?: 'members_only' | 'globally_visible' | null;
237
242
  }
238
243
 
239
244
  export namespace ForumPostCreateParams {
@@ -312,6 +317,11 @@ export interface ForumPostUpdateParams {
312
317
  * The title of the post. Only visible if paywalled.
313
318
  */
314
319
  title?: string | null;
320
+
321
+ /**
322
+ * The visibility types for forum posts
323
+ */
324
+ visibility?: 'members_only' | 'globally_visible' | null;
315
325
  }
316
326
 
317
327
  export namespace ForumPostUpdateParams {
@@ -92,6 +92,15 @@ export {
92
92
  type CourseListParams,
93
93
  type CourseListResponsesCursorPage,
94
94
  } from './courses';
95
+ export {
96
+ Disputes,
97
+ type Dispute,
98
+ type DisputeStatuses,
99
+ type DisputeListResponse,
100
+ type DisputeListParams,
101
+ type DisputeUpdateEvidenceParams,
102
+ type DisputeListResponsesCursorPage,
103
+ } from './disputes';
95
104
  export {
96
105
  Entries,
97
106
  type EntryListResponse,
@@ -157,6 +166,11 @@ export {
157
166
  type MessageListParams,
158
167
  type MessageListResponsesCursorPage,
159
168
  } from './messages';
169
+ export {
170
+ Notifications,
171
+ type NotificationCreateResponse,
172
+ type NotificationCreateParams,
173
+ } from './notifications';
160
174
  export {
161
175
  Payments,
162
176
  type BillingReasons,
@@ -252,5 +266,7 @@ export {
252
266
  type PaymentSucceededWebhookEvent,
253
267
  type PaymentFailedWebhookEvent,
254
268
  type PaymentPendingWebhookEvent,
269
+ type DisputeCreatedWebhookEvent,
270
+ type DisputeUpdatedWebhookEvent,
255
271
  type UnwrapWebhookEvent,
256
272
  } from './webhooks';
@@ -38,6 +38,7 @@ export interface LedgerAccountRetrieveResponse {
38
38
  */
39
39
  ledger_account_audit_status:
40
40
  | 'pending'
41
+ | 'pending_ai_review'
41
42
  | 'approved'
42
43
  | 'reserves_imposed'
43
44
  | 'suspended'
@@ -0,0 +1,131 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../core/resource';
4
+ import { APIPromise } from '../core/api-promise';
5
+ import { RequestOptions } from '../internal/request-options';
6
+
7
+ export class Notifications extends APIResource {
8
+ /**
9
+ * Queues a notification to be sent to users in an experience or company team
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const notification = await client.notifications.create({
14
+ * company_id: 'biz_xxxxxxxxxxxxxx',
15
+ * content: 'content',
16
+ * title: 'title',
17
+ * });
18
+ * ```
19
+ */
20
+ create(body: NotificationCreateParams, options?: RequestOptions): APIPromise<NotificationCreateResponse> {
21
+ return this._client.post('/notifications', { body, ...options });
22
+ }
23
+ }
24
+
25
+ /**
26
+ * Response from queuing a notification
27
+ */
28
+ export interface NotificationCreateResponse {
29
+ /**
30
+ * Whether the notification was successfully queued for delivery
31
+ */
32
+ success: boolean;
33
+ }
34
+
35
+ export type NotificationCreateParams =
36
+ | NotificationCreateParams.SendNotificationV2InputWithCompanyID
37
+ | NotificationCreateParams.SendNotificationV2InputWithExperienceID;
38
+
39
+ export declare namespace NotificationCreateParams {
40
+ export interface SendNotificationV2InputWithCompanyID {
41
+ /**
42
+ * The id of the company to target. Only team members of this company will receive
43
+ * the notification. When clicked will take the user to your dashboard app view.
44
+ */
45
+ company_id: string;
46
+
47
+ /**
48
+ * The content of the notification
49
+ */
50
+ content: string;
51
+
52
+ /**
53
+ * The title of the notification
54
+ */
55
+ title: string;
56
+
57
+ /**
58
+ * Optional: ID of a Whop user whose profile picture will be used as the
59
+ * notification icon. If not provided, defaults to the experience or company
60
+ * avatar.
61
+ */
62
+ icon_user_id?: string | null;
63
+
64
+ /**
65
+ * The rest path to append to the generated deep link that opens your app. Use
66
+ * [restPath] in your app path in the dashboard to read this parameter.
67
+ */
68
+ rest_path?: string | null;
69
+
70
+ /**
71
+ * The subtitle of the notification
72
+ */
73
+ subtitle?: string | null;
74
+
75
+ /**
76
+ * If provided, this will only send to these users if they are also in the main
77
+ * scope (experience or company)
78
+ */
79
+ user_ids?: Array<string> | null;
80
+ }
81
+
82
+ export interface SendNotificationV2InputWithExperienceID {
83
+ /**
84
+ * The content of the notification
85
+ */
86
+ content: string;
87
+
88
+ /**
89
+ * The id of the experience to target. All users with access to this experience
90
+ * (customers and admins) will receive the notification. When clicked, open your
91
+ * experience view.
92
+ */
93
+ experience_id: string;
94
+
95
+ /**
96
+ * The title of the notification
97
+ */
98
+ title: string;
99
+
100
+ /**
101
+ * Optional: ID of a Whop user whose profile picture will be used as the
102
+ * notification icon. If not provided, defaults to the experience or company
103
+ * avatar.
104
+ */
105
+ icon_user_id?: string | null;
106
+
107
+ /**
108
+ * The rest path to append to the generated deep link that opens your app. Use
109
+ * [restPath] in your app path in the dashboard to read this parameter.
110
+ */
111
+ rest_path?: string | null;
112
+
113
+ /**
114
+ * The subtitle of the notification
115
+ */
116
+ subtitle?: string | null;
117
+
118
+ /**
119
+ * If provided, this will only send to these users if they are also in the main
120
+ * scope (experience or company)
121
+ */
122
+ user_ids?: Array<string> | null;
123
+ }
124
+ }
125
+
126
+ export declare namespace Notifications {
127
+ export {
128
+ type NotificationCreateResponse as NotificationCreateResponse,
129
+ type NotificationCreateParams as NotificationCreateParams,
130
+ };
131
+ }
@@ -171,6 +171,7 @@ export type CardBrands =
171
171
  | 'rupay'
172
172
  | 'jcbrupay'
173
173
  | 'elo'
174
+ | 'maestro'
174
175
  | 'unknown';
175
176
 
176
177
  /**
@@ -649,7 +649,16 @@ export namespace Company {
649
649
  /**
650
650
  * The website
651
651
  */
652
- website: 'x' | 'instagram' | 'facebook' | 'tiktok' | 'youtube' | 'linkedin' | 'twitch' | 'website';
652
+ website:
653
+ | 'x'
654
+ | 'instagram'
655
+ | 'facebook'
656
+ | 'tiktok'
657
+ | 'youtube'
658
+ | 'linkedin'
659
+ | 'twitch'
660
+ | 'website'
661
+ | 'custom';
653
662
  }
654
663
  }
655
664
 
@@ -911,7 +920,8 @@ export type Currency =
911
920
  | 'ttd'
912
921
  | 'uzs'
913
922
  | 'rub'
914
- | 'btc';
923
+ | 'btc'
924
+ | 'cny';
915
925
 
916
926
  /**
917
927
  * The different types of custom CTAs that can be selected.
@@ -2970,7 +2980,7 @@ export interface Shipment {
2970
2980
  /**
2971
2981
  * The payment of the shipment
2972
2982
  */
2973
- payment: Shipment.Payment;
2983
+ payment: Shipment.Payment | null;
2974
2984
 
2975
2985
  /**
2976
2986
  * The service of the shipment
@@ -101,7 +101,7 @@ export interface ShipmentListResponse {
101
101
  /**
102
102
  * The payment of the shipment
103
103
  */
104
- payment: ShipmentListResponse.Payment;
104
+ payment: ShipmentListResponse.Payment | null;
105
105
 
106
106
  /**
107
107
  * The service of the shipment
@@ -1,6 +1,7 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  import { APIResource } from '../core/resource';
4
+ import * as DisputesAPI from './disputes';
4
5
  import * as Shared from './shared';
5
6
  import { Webhook } from 'standardwebhooks';
6
7
 
@@ -399,6 +400,60 @@ export interface PaymentPendingWebhookEvent {
399
400
  type: 'payment.pending';
400
401
  }
401
402
 
403
+ export interface DisputeCreatedWebhookEvent {
404
+ /**
405
+ * A unique ID for every single webhook request
406
+ */
407
+ id: string;
408
+
409
+ /**
410
+ * The API version for this webhook
411
+ */
412
+ api_version: 'v1';
413
+
414
+ /**
415
+ * An object representing a dispute against a company.
416
+ */
417
+ data: DisputesAPI.Dispute;
418
+
419
+ /**
420
+ * The timestamp in ISO 8601 format that the webhook was sent at on the server
421
+ */
422
+ timestamp: string;
423
+
424
+ /**
425
+ * The webhook event type
426
+ */
427
+ type: 'dispute.created';
428
+ }
429
+
430
+ export interface DisputeUpdatedWebhookEvent {
431
+ /**
432
+ * A unique ID for every single webhook request
433
+ */
434
+ id: string;
435
+
436
+ /**
437
+ * The API version for this webhook
438
+ */
439
+ api_version: 'v1';
440
+
441
+ /**
442
+ * An object representing a dispute against a company.
443
+ */
444
+ data: DisputesAPI.Dispute;
445
+
446
+ /**
447
+ * The timestamp in ISO 8601 format that the webhook was sent at on the server
448
+ */
449
+ timestamp: string;
450
+
451
+ /**
452
+ * The webhook event type
453
+ */
454
+ type: 'dispute.updated';
455
+ }
456
+
402
457
  export type UnwrapWebhookEvent =
403
458
  | InvoiceCreatedWebhookEvent
404
459
  | InvoicePaidWebhookEvent
@@ -413,7 +468,9 @@ export type UnwrapWebhookEvent =
413
468
  | CourseLessonInteractionCompletedWebhookEvent
414
469
  | PaymentSucceededWebhookEvent
415
470
  | PaymentFailedWebhookEvent
416
- | PaymentPendingWebhookEvent;
471
+ | PaymentPendingWebhookEvent
472
+ | DisputeCreatedWebhookEvent
473
+ | DisputeUpdatedWebhookEvent;
417
474
 
418
475
  export declare namespace Webhooks {
419
476
  export {
@@ -431,6 +488,8 @@ export declare namespace Webhooks {
431
488
  type PaymentSucceededWebhookEvent as PaymentSucceededWebhookEvent,
432
489
  type PaymentFailedWebhookEvent as PaymentFailedWebhookEvent,
433
490
  type PaymentPendingWebhookEvent as PaymentPendingWebhookEvent,
491
+ type DisputeCreatedWebhookEvent as DisputeCreatedWebhookEvent,
492
+ type DisputeUpdatedWebhookEvent as DisputeUpdatedWebhookEvent,
434
493
  type UnwrapWebhookEvent as UnwrapWebhookEvent,
435
494
  };
436
495
  }
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.0.5'; // x-release-please-version
1
+ export const VERSION = '0.0.7'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.0.5";
1
+ export declare const VERSION = "0.0.7";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.0.5";
1
+ export declare const VERSION = "0.0.7";
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.5'; // x-release-please-version
4
+ exports.VERSION = '0.0.7'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.0.5'; // x-release-please-version
1
+ export const VERSION = '0.0.7'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map