@whop/sdk 0.0.6 → 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 +28 -0
- package/client.d.mts +5 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +5 -2
- package/client.d.ts.map +1 -1
- package/client.js +3 -0
- package/client.js.map +1 -1
- package/client.mjs +3 -0
- package/client.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 +2 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +2 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -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/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 +25 -0
- 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 +11 -0
- package/src/resources/ledger-accounts.ts +1 -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
package/src/client.ts
CHANGED
|
@@ -110,6 +110,15 @@ import {
|
|
|
110
110
|
Courses,
|
|
111
111
|
Languages,
|
|
112
112
|
} from './resources/courses';
|
|
113
|
+
import {
|
|
114
|
+
Dispute,
|
|
115
|
+
DisputeListParams,
|
|
116
|
+
DisputeListResponse,
|
|
117
|
+
DisputeListResponsesCursorPage,
|
|
118
|
+
DisputeStatuses,
|
|
119
|
+
DisputeUpdateEvidenceParams,
|
|
120
|
+
Disputes,
|
|
121
|
+
} from './resources/disputes';
|
|
113
122
|
import {
|
|
114
123
|
Entries,
|
|
115
124
|
EntryApproveResponse,
|
|
@@ -256,6 +265,8 @@ import {
|
|
|
256
265
|
} from './resources/users';
|
|
257
266
|
import {
|
|
258
267
|
CourseLessonInteractionCompletedWebhookEvent,
|
|
268
|
+
DisputeCreatedWebhookEvent,
|
|
269
|
+
DisputeUpdatedWebhookEvent,
|
|
259
270
|
EntryApprovedWebhookEvent,
|
|
260
271
|
EntryCreatedWebhookEvent,
|
|
261
272
|
EntryDeletedWebhookEvent,
|
|
@@ -1031,6 +1042,7 @@ export class Whop {
|
|
|
1031
1042
|
courseStudents: API.CourseStudents = new API.CourseStudents(this);
|
|
1032
1043
|
accessTokens: API.AccessTokens = new API.AccessTokens(this);
|
|
1033
1044
|
notifications: API.Notifications = new API.Notifications(this);
|
|
1045
|
+
disputes: API.Disputes = new API.Disputes(this);
|
|
1034
1046
|
}
|
|
1035
1047
|
|
|
1036
1048
|
Whop.Apps = Apps;
|
|
@@ -1066,6 +1078,7 @@ Whop.Reviews = Reviews;
|
|
|
1066
1078
|
Whop.CourseStudents = CourseStudents;
|
|
1067
1079
|
Whop.AccessTokens = AccessTokens;
|
|
1068
1080
|
Whop.Notifications = Notifications;
|
|
1081
|
+
Whop.Disputes = Disputes;
|
|
1069
1082
|
|
|
1070
1083
|
export declare namespace Whop {
|
|
1071
1084
|
export type RequestOptions = Opts.RequestOptions;
|
|
@@ -1126,6 +1139,8 @@ export declare namespace Whop {
|
|
|
1126
1139
|
type PaymentSucceededWebhookEvent as PaymentSucceededWebhookEvent,
|
|
1127
1140
|
type PaymentFailedWebhookEvent as PaymentFailedWebhookEvent,
|
|
1128
1141
|
type PaymentPendingWebhookEvent as PaymentPendingWebhookEvent,
|
|
1142
|
+
type DisputeCreatedWebhookEvent as DisputeCreatedWebhookEvent,
|
|
1143
|
+
type DisputeUpdatedWebhookEvent as DisputeUpdatedWebhookEvent,
|
|
1129
1144
|
type UnwrapWebhookEvent as UnwrapWebhookEvent,
|
|
1130
1145
|
};
|
|
1131
1146
|
|
|
@@ -1371,6 +1386,16 @@ export declare namespace Whop {
|
|
|
1371
1386
|
type NotificationCreateParams as NotificationCreateParams,
|
|
1372
1387
|
};
|
|
1373
1388
|
|
|
1389
|
+
export {
|
|
1390
|
+
Disputes as Disputes,
|
|
1391
|
+
type Dispute as Dispute,
|
|
1392
|
+
type DisputeStatuses as DisputeStatuses,
|
|
1393
|
+
type DisputeListResponse as DisputeListResponse,
|
|
1394
|
+
type DisputeListResponsesCursorPage as DisputeListResponsesCursorPage,
|
|
1395
|
+
type DisputeListParams as DisputeListParams,
|
|
1396
|
+
type DisputeUpdateEvidenceParams as DisputeUpdateEvidenceParams,
|
|
1397
|
+
};
|
|
1398
|
+
|
|
1374
1399
|
export type AccessLevel = API.AccessLevel;
|
|
1375
1400
|
export type AccessPassType = API.AccessPassType;
|
|
1376
1401
|
export type App = API.App;
|
|
@@ -6,15 +6,15 @@ import { RequestOptions } from '../internal/request-options';
|
|
|
6
6
|
|
|
7
7
|
export class AccessTokens extends APIResource {
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
9
|
+
* Create a short-lived access token to authenticate API requests on behalf of a
|
|
10
|
+
* Company or User. This token should be used with Whop's web and mobile embedded
|
|
11
|
+
* components. You must provide either a company_id or a user_id argument, but not
|
|
12
|
+
* both.
|
|
11
13
|
*
|
|
12
14
|
* @example
|
|
13
15
|
* ```ts
|
|
14
16
|
* const accessToken = await client.accessTokens.create({
|
|
15
|
-
*
|
|
16
|
-
* target_resource_id: 'target_resource_id',
|
|
17
|
-
* target_resource_type: 'company',
|
|
17
|
+
* company_id: 'biz_xxxxxxxxxxxxxx',
|
|
18
18
|
* });
|
|
19
19
|
* ```
|
|
20
20
|
*/
|
|
@@ -38,30 +38,57 @@ export interface AccessTokenCreateResponse {
|
|
|
38
38
|
expires_at: string;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
export
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
* of the API keys's existing permissions. Otherwise, an error will be raised.
|
|
45
|
-
*/
|
|
46
|
-
scoped_actions: Array<string>;
|
|
41
|
+
export type AccessTokenCreateParams =
|
|
42
|
+
| AccessTokenCreateParams.CreateAccessTokenInputWithCompanyID
|
|
43
|
+
| AccessTokenCreateParams.CreateAccessTokenInputWithUserID;
|
|
47
44
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
45
|
+
export declare namespace AccessTokenCreateParams {
|
|
46
|
+
export interface CreateAccessTokenInputWithCompanyID {
|
|
47
|
+
/**
|
|
48
|
+
* The ID of the Company to generate the token for. The API key must have
|
|
49
|
+
* permission to access this Company, such as the being the company the API key
|
|
50
|
+
* belongs to or a sub-merchant of it
|
|
51
|
+
*/
|
|
52
|
+
company_id: string;
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
/**
|
|
55
|
+
* The expiration timestamp for the access token. If not provided, a default
|
|
56
|
+
* expiration time of 1 hour will be used. The expiration can be set to a maximum
|
|
57
|
+
* of 3 hours from the current time.
|
|
58
|
+
*/
|
|
59
|
+
expires_at?: string | null;
|
|
58
60
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
/**
|
|
62
|
+
* Array of desired scoped actions for the access token. If sent as an empty array
|
|
63
|
+
* or not provided, all permissions from the API key making the request will be
|
|
64
|
+
* available on the token. If sending an explicit list, they must be a subset of
|
|
65
|
+
* the API keys's existing permissions. Otherwise, an error will be raised.
|
|
66
|
+
*/
|
|
67
|
+
scoped_actions?: Array<string> | null;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface CreateAccessTokenInputWithUserID {
|
|
71
|
+
/**
|
|
72
|
+
* The ID of the User to generate the token for. The API key must have permission
|
|
73
|
+
* to access this User.
|
|
74
|
+
*/
|
|
75
|
+
user_id: string;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* The expiration timestamp for the access token. If not provided, a default
|
|
79
|
+
* expiration time of 1 hour will be used. The expiration can be set to a maximum
|
|
80
|
+
* of 3 hours from the current time.
|
|
81
|
+
*/
|
|
82
|
+
expires_at?: string | null;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Array of desired scoped actions for the access token. If sent as an empty array
|
|
86
|
+
* or not provided, all permissions from the API key making the request will be
|
|
87
|
+
* available on the token. If sending an explicit list, they must be a subset of
|
|
88
|
+
* the API keys's existing permissions. Otherwise, an error will be raised.
|
|
89
|
+
*/
|
|
90
|
+
scoped_actions?: Array<string> | null;
|
|
91
|
+
}
|
|
65
92
|
}
|
|
66
93
|
|
|
67
94
|
export declare namespace AccessTokens {
|
|
@@ -205,14 +205,14 @@ export declare namespace CheckoutConfigurationCreateParams {
|
|
|
205
205
|
company_id: string;
|
|
206
206
|
|
|
207
207
|
/**
|
|
208
|
-
* The
|
|
208
|
+
* The respective currency identifier for the plan.
|
|
209
209
|
*/
|
|
210
|
-
|
|
210
|
+
currency: Shared.Currency;
|
|
211
211
|
|
|
212
212
|
/**
|
|
213
|
-
* The
|
|
213
|
+
* The interval at which the plan charges (renewal plans).
|
|
214
214
|
*/
|
|
215
|
-
|
|
215
|
+
billing_period?: number | null;
|
|
216
216
|
|
|
217
217
|
/**
|
|
218
218
|
* An array of custom field objects.
|