@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.
- package/CHANGELOG.md +47 -0
- package/README.md +0 -4
- package/client.d.mts +12 -6
- package/client.d.mts.map +1 -1
- package/client.d.ts +12 -6
- package/client.d.ts.map +1 -1
- package/client.js +8 -5
- package/client.js.map +1 -1
- package/client.mjs +8 -5
- package/client.mjs.map +1 -1
- package/lib/verify-user-token.d.mts.map +1 -1
- package/lib/verify-user-token.d.ts.map +1 -1
- package/lib/verify-user-token.js +6 -3
- package/lib/verify-user-token.js.map +1 -1
- package/lib/verify-user-token.mjs +6 -3
- package/lib/verify-user-token.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/access-tokens.d.mts +48 -26
- package/resources/access-tokens.d.mts.map +1 -1
- package/resources/access-tokens.d.ts +48 -26
- package/resources/access-tokens.d.ts.map +1 -1
- package/resources/access-tokens.js +5 -5
- package/resources/access-tokens.mjs +5 -5
- package/resources/checkout-configurations.d.mts +4 -4
- package/resources/checkout-configurations.d.mts.map +1 -1
- package/resources/checkout-configurations.d.ts +4 -4
- package/resources/checkout-configurations.d.ts.map +1 -1
- package/resources/disputes.d.mts +704 -0
- package/resources/disputes.d.mts.map +1 -0
- package/resources/disputes.d.ts +704 -0
- package/resources/disputes.d.ts.map +1 -0
- package/resources/disputes.js +77 -0
- package/resources/disputes.js.map +1 -0
- package/resources/disputes.mjs +73 -0
- package/resources/disputes.mjs.map +1 -0
- package/resources/forum-posts.d.mts +8 -0
- package/resources/forum-posts.d.mts.map +1 -1
- package/resources/forum-posts.d.ts +8 -0
- package/resources/forum-posts.d.ts.map +1 -1
- package/resources/index.d.mts +3 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +3 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +5 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -0
- package/resources/index.mjs.map +1 -1
- package/resources/ledger-accounts.d.mts +1 -1
- package/resources/ledger-accounts.d.mts.map +1 -1
- package/resources/ledger-accounts.d.ts +1 -1
- package/resources/ledger-accounts.d.ts.map +1 -1
- package/resources/notifications.d.mts +105 -0
- package/resources/notifications.d.mts.map +1 -0
- package/resources/notifications.d.ts +105 -0
- package/resources/notifications.d.ts.map +1 -0
- package/resources/notifications.js +24 -0
- package/resources/notifications.js.map +1 -0
- package/resources/notifications.mjs +20 -0
- package/resources/notifications.mjs.map +1 -0
- package/resources/payments.d.mts +1 -1
- package/resources/payments.d.mts.map +1 -1
- package/resources/payments.d.ts +1 -1
- package/resources/payments.d.ts.map +1 -1
- package/resources/shared.d.mts +3 -3
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +3 -3
- package/resources/shared.d.ts.map +1 -1
- package/resources/shipments.d.mts +1 -1
- package/resources/shipments.d.mts.map +1 -1
- package/resources/shipments.d.ts +1 -1
- package/resources/shipments.d.ts.map +1 -1
- package/resources/webhooks.d.mts +47 -2
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +47 -2
- package/resources/webhooks.d.ts.map +1 -1
- package/resources/webhooks.js.map +1 -1
- package/resources/webhooks.mjs.map +1 -1
- package/src/client.ts +43 -10
- package/src/lib/verify-user-token.ts +6 -3
- package/src/resources/access-tokens.ts +53 -26
- package/src/resources/checkout-configurations.ts +4 -4
- package/src/resources/disputes.ts +873 -0
- package/src/resources/forum-posts.ts +10 -0
- package/src/resources/index.ts +16 -0
- package/src/resources/ledger-accounts.ts +1 -0
- package/src/resources/notifications.ts +131 -0
- package/src/resources/payments.ts +1 -0
- package/src/resources/shared.ts +13 -3
- package/src/resources/shipments.ts +1 -1
- package/src/resources/webhooks.ts +60 -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
|
@@ -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 {
|
package/src/resources/index.ts
CHANGED
|
@@ -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';
|
|
@@ -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
|
+
}
|
package/src/resources/shared.ts
CHANGED
|
@@ -649,7 +649,16 @@ export namespace Company {
|
|
|
649
649
|
/**
|
|
650
650
|
* The website
|
|
651
651
|
*/
|
|
652
|
-
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
|
|
@@ -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.
|
|
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.
|
|
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.
|
|
1
|
+
export declare const VERSION = "0.0.7";
|
|
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.7'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|