@whop/sdk 0.0.6 → 0.0.8
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/client.d.mts +19 -10
- package/client.d.mts.map +1 -1
- package/client.d.ts +19 -10
- package/client.d.ts.map +1 -1
- package/client.js +9 -0
- package/client.js.map +1 -1
- package/client.mjs +9 -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/apps.d.mts +17 -1
- package/resources/apps.d.mts.map +1 -1
- package/resources/apps.d.ts +17 -1
- package/resources/apps.d.ts.map +1 -1
- package/resources/checkout-configurations.d.mts +169 -12
- package/resources/checkout-configurations.d.mts.map +1 -1
- package/resources/checkout-configurations.d.ts +169 -12
- package/resources/checkout-configurations.d.ts.map +1 -1
- package/resources/checkout-configurations.js +1 -0
- package/resources/checkout-configurations.js.map +1 -1
- package/resources/checkout-configurations.mjs +1 -0
- package/resources/checkout-configurations.mjs.map +1 -1
- package/resources/course-lessons.d.mts +199 -1
- package/resources/course-lessons.d.mts.map +1 -1
- package/resources/course-lessons.d.ts +199 -1
- package/resources/course-lessons.d.ts.map +1 -1
- package/resources/course-lessons.js +40 -0
- package/resources/course-lessons.js.map +1 -1
- package/resources/course-lessons.mjs +40 -0
- package/resources/course-lessons.mjs.map +1 -1
- package/resources/courses.d.mts +8 -0
- package/resources/courses.d.mts.map +1 -1
- package/resources/courses.d.ts +8 -0
- package/resources/courses.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 +13 -1
- package/resources/forum-posts.d.mts.map +1 -1
- package/resources/forum-posts.d.ts +13 -1
- package/resources/forum-posts.d.ts.map +1 -1
- package/resources/index.d.mts +8 -5
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +8 -5
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +7 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +3 -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/refunds.d.mts +295 -0
- package/resources/refunds.d.mts.map +1 -0
- package/resources/refunds.d.ts +295 -0
- package/resources/refunds.d.ts.map +1 -0
- package/resources/refunds.js +34 -0
- package/resources/refunds.js.map +1 -0
- package/resources/refunds.mjs +30 -0
- package/resources/refunds.mjs.map +1 -0
- package/resources/shared.d.mts +46 -5
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +46 -5
- 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 +427 -2
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +427 -2
- package/resources/webhooks.d.ts.map +1 -1
- package/resources/webhooks.js.map +1 -1
- package/resources/webhooks.mjs.map +1 -1
- package/resources/withdrawals.d.mts +233 -0
- package/resources/withdrawals.d.mts.map +1 -0
- package/resources/withdrawals.d.ts +233 -0
- package/resources/withdrawals.d.ts.map +1 -0
- package/resources/withdrawals.js +31 -0
- package/resources/withdrawals.js.map +1 -0
- package/resources/withdrawals.mjs +27 -0
- package/resources/withdrawals.mjs.map +1 -0
- package/src/client.ts +93 -0
- package/src/resources/access-tokens.ts +53 -26
- package/src/resources/apps.ts +21 -0
- package/src/resources/checkout-configurations.ts +193 -12
- package/src/resources/course-lessons.ts +250 -0
- package/src/resources/courses.ts +10 -0
- package/src/resources/disputes.ts +873 -0
- package/src/resources/forum-posts.ts +16 -0
- package/src/resources/index.ts +42 -0
- package/src/resources/ledger-accounts.ts +1 -0
- package/src/resources/payments.ts +1 -0
- package/src/resources/refunds.ts +383 -0
- package/src/resources/shared.ts +62 -5
- package/src/resources/shipments.ts +1 -1
- package/src/resources/webhooks.ts +522 -1
- package/src/resources/withdrawals.ts +361 -0
- 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
|
@@ -0,0 +1,361 @@
|
|
|
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
|
+
export class Withdrawals extends APIResource {
|
|
11
|
+
/**
|
|
12
|
+
* Retrieves a withdrawal by ID
|
|
13
|
+
*
|
|
14
|
+
* Required permissions:
|
|
15
|
+
*
|
|
16
|
+
* - `payout:withdrawal:read`
|
|
17
|
+
*/
|
|
18
|
+
retrieve(id: string, options?: RequestOptions): APIPromise<WithdrawalRetrieveResponse> {
|
|
19
|
+
return this._client.get(path`/withdrawals/${id}`, options);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Lists withdrawals
|
|
24
|
+
*
|
|
25
|
+
* Required permissions:
|
|
26
|
+
*
|
|
27
|
+
* - `payout:withdrawal:read`
|
|
28
|
+
*/
|
|
29
|
+
list(
|
|
30
|
+
query: WithdrawalListParams,
|
|
31
|
+
options?: RequestOptions,
|
|
32
|
+
): PagePromise<WithdrawalListResponsesCursorPage, WithdrawalListResponse> {
|
|
33
|
+
return this._client.getAPIList('/withdrawals', CursorPage<WithdrawalListResponse>, { query, ...options });
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export type WithdrawalListResponsesCursorPage = CursorPage<WithdrawalListResponse>;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* The different fee types for a withdrawal.
|
|
41
|
+
*/
|
|
42
|
+
export type WithdrawalFeeTypes = 'exclusive' | 'inclusive';
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* The different speeds of withdrawals
|
|
46
|
+
*/
|
|
47
|
+
export type WithdrawalSpeeds = 'standard' | 'instant';
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* The status of a withdrawal request
|
|
51
|
+
*/
|
|
52
|
+
export type WithdrawalStatus =
|
|
53
|
+
| 'requested'
|
|
54
|
+
| 'awaiting_payment'
|
|
55
|
+
| 'in_transit'
|
|
56
|
+
| 'completed'
|
|
57
|
+
| 'failed'
|
|
58
|
+
| 'canceled'
|
|
59
|
+
| 'denied';
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* The types of withdrawals
|
|
63
|
+
*/
|
|
64
|
+
export type WithdrawalTypes = 'regular' | 'clawback';
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* A withdrawal request.
|
|
68
|
+
*/
|
|
69
|
+
export interface WithdrawalRetrieveResponse {
|
|
70
|
+
/**
|
|
71
|
+
* Internal ID of the withdrawal request.
|
|
72
|
+
*/
|
|
73
|
+
id: string;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* How much money was attempted to be withdrawn, in a float type.
|
|
77
|
+
*/
|
|
78
|
+
amount: number;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* When the withdrawal request was created.
|
|
82
|
+
*/
|
|
83
|
+
created_at: string;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* The currency of the withdrawal request.
|
|
87
|
+
*/
|
|
88
|
+
currency: Shared.Currency;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* The fee amount that was charged for the withdrawal. This is in the same currency
|
|
92
|
+
* as the withdrawal amount.
|
|
93
|
+
*/
|
|
94
|
+
fee_amount: number;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* The different fee types for a withdrawal.
|
|
98
|
+
*/
|
|
99
|
+
fee_type: WithdrawalFeeTypes | null;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* The latest payout associated with this withdrawal, if any.
|
|
103
|
+
*/
|
|
104
|
+
latest_payout: WithdrawalRetrieveResponse.LatestPayout | null;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* The payout token used for the withdrawal, if applicable.
|
|
108
|
+
*/
|
|
109
|
+
payout_token: WithdrawalRetrieveResponse.PayoutToken | null;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* The speed of the withdrawal.
|
|
113
|
+
*/
|
|
114
|
+
speed: WithdrawalSpeeds;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Status of the withdrawal.
|
|
118
|
+
*/
|
|
119
|
+
status: WithdrawalStatus;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* The type of withdrawal.
|
|
123
|
+
*/
|
|
124
|
+
withdrawal_type: WithdrawalTypes;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export namespace WithdrawalRetrieveResponse {
|
|
128
|
+
/**
|
|
129
|
+
* The latest payout associated with this withdrawal, if any.
|
|
130
|
+
*/
|
|
131
|
+
export interface LatestPayout {
|
|
132
|
+
/**
|
|
133
|
+
* The internal ID of the payout.
|
|
134
|
+
*/
|
|
135
|
+
id: string;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* The date and time the payout was created.
|
|
139
|
+
*/
|
|
140
|
+
created_at: string;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* The different error codes a payout can be in.
|
|
144
|
+
*/
|
|
145
|
+
error_code:
|
|
146
|
+
| 'account_closed'
|
|
147
|
+
| 'account_does_not_exist'
|
|
148
|
+
| 'account_information_invalid'
|
|
149
|
+
| 'account_number_invalid_region'
|
|
150
|
+
| 'account_frozen'
|
|
151
|
+
| 'account_lookup_failed'
|
|
152
|
+
| 'account_not_found'
|
|
153
|
+
| 'amount_out_of_bounds'
|
|
154
|
+
| 'attributes_not_validated'
|
|
155
|
+
| 'b2b_payments_prohibited'
|
|
156
|
+
| 'bank_statement_required'
|
|
157
|
+
| 'compliance_review'
|
|
158
|
+
| 'currency_not_supported'
|
|
159
|
+
| 'deposit_canceled'
|
|
160
|
+
| 'deposit_failed'
|
|
161
|
+
| 'deposit_rejected'
|
|
162
|
+
| 'destination_unavailable'
|
|
163
|
+
| 'exceeded_account_limit'
|
|
164
|
+
| 'expired_quote'
|
|
165
|
+
| 'generic_payout_error'
|
|
166
|
+
| 'technical_problem'
|
|
167
|
+
| 'identification_number_invalid'
|
|
168
|
+
| 'invalid_account_number'
|
|
169
|
+
| 'invalid_bank_code'
|
|
170
|
+
| 'invalid_beneficiary'
|
|
171
|
+
| 'invalid_branch_number'
|
|
172
|
+
| 'invalid_branch_code'
|
|
173
|
+
| 'invalid_phone_number'
|
|
174
|
+
| 'invalid_routing_number'
|
|
175
|
+
| 'invalid_swift_code'
|
|
176
|
+
| 'invalid_company_details'
|
|
177
|
+
| 'manual_cancelation'
|
|
178
|
+
| 'misc_error'
|
|
179
|
+
| 'missing_city_and_country'
|
|
180
|
+
| 'missing_phone_number'
|
|
181
|
+
| 'missing_remittance_info'
|
|
182
|
+
| 'payee_name_invalid'
|
|
183
|
+
| 'receiving_account_locked'
|
|
184
|
+
| 'rejected_by_compliance'
|
|
185
|
+
| 'rtp_not_supported'
|
|
186
|
+
| 'non_transaction_account'
|
|
187
|
+
| 'source_token_insufficient_funds'
|
|
188
|
+
| 'ssn_invalid'
|
|
189
|
+
| 'wallet_screenshot_required'
|
|
190
|
+
| 'unsupported_region'
|
|
191
|
+
| null;
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* The error message for the payout.
|
|
195
|
+
*/
|
|
196
|
+
error_message: string | null;
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* The estimated availability date of the payout.
|
|
200
|
+
*/
|
|
201
|
+
estimated_availability: string | null;
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* The name of the payer for the payout.
|
|
205
|
+
*/
|
|
206
|
+
payer_name: string | null;
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* The status of the payout.
|
|
210
|
+
*/
|
|
211
|
+
status:
|
|
212
|
+
| 'scheduled'
|
|
213
|
+
| 'pending'
|
|
214
|
+
| 'processing'
|
|
215
|
+
| 'completed'
|
|
216
|
+
| 'canceled'
|
|
217
|
+
| 'ready_for_pickup'
|
|
218
|
+
| 'hold'
|
|
219
|
+
| 'error'
|
|
220
|
+
| 'expired';
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* The trace code for the payout, if applicable. Provided on ACH transactions when
|
|
224
|
+
* available.
|
|
225
|
+
*/
|
|
226
|
+
trace_code: string | null;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* The payout token used for the withdrawal, if applicable.
|
|
231
|
+
*/
|
|
232
|
+
export interface PayoutToken {
|
|
233
|
+
/**
|
|
234
|
+
* The ID of the payout token
|
|
235
|
+
*/
|
|
236
|
+
id: string;
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* The date and time the payout token was created
|
|
240
|
+
*/
|
|
241
|
+
created_at: string;
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* The currency code of the payout destination. This is the currency that payouts
|
|
245
|
+
* will be made in for this token.
|
|
246
|
+
*/
|
|
247
|
+
destination_currency_code: string;
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* An optional nickname for the payout token to help the user identify it. This is
|
|
251
|
+
* not used by the provider and is only for the user's reference.
|
|
252
|
+
*/
|
|
253
|
+
nickname: string | null;
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* The status of the payout token.
|
|
257
|
+
*/
|
|
258
|
+
status: 'created' | 'active' | 'broken';
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* A withdrawal request.
|
|
264
|
+
*/
|
|
265
|
+
export interface WithdrawalListResponse {
|
|
266
|
+
/**
|
|
267
|
+
* Internal ID of the withdrawal request.
|
|
268
|
+
*/
|
|
269
|
+
id: string;
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* How much money was attempted to be withdrawn, in a float type.
|
|
273
|
+
*/
|
|
274
|
+
amount: number;
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* When the withdrawal request was created.
|
|
278
|
+
*/
|
|
279
|
+
created_at: string;
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* The currency of the withdrawal request.
|
|
283
|
+
*/
|
|
284
|
+
currency: Shared.Currency;
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* The fee amount that was charged for the withdrawal. This is in the same currency
|
|
288
|
+
* as the withdrawal amount.
|
|
289
|
+
*/
|
|
290
|
+
fee_amount: number;
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* The different fee types for a withdrawal.
|
|
294
|
+
*/
|
|
295
|
+
fee_type: WithdrawalFeeTypes | null;
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* The speed of the withdrawal.
|
|
299
|
+
*/
|
|
300
|
+
speed: WithdrawalSpeeds;
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* Status of the withdrawal.
|
|
304
|
+
*/
|
|
305
|
+
status: WithdrawalStatus;
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* The type of withdrawal.
|
|
309
|
+
*/
|
|
310
|
+
withdrawal_type: WithdrawalTypes;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
export interface WithdrawalListParams extends CursorPageParams {
|
|
314
|
+
/**
|
|
315
|
+
* The ID of the company to list withdrawals for
|
|
316
|
+
*/
|
|
317
|
+
company_id: string;
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* Returns the elements in the list that come before the specified cursor.
|
|
321
|
+
*/
|
|
322
|
+
before?: string | null;
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* The minimum creation date to filter by
|
|
326
|
+
*/
|
|
327
|
+
created_after?: string | null;
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* The maximum creation date to filter by
|
|
331
|
+
*/
|
|
332
|
+
created_before?: string | null;
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* The direction of the sort.
|
|
336
|
+
*/
|
|
337
|
+
direction?: Shared.Direction | null;
|
|
338
|
+
|
|
339
|
+
/**
|
|
340
|
+
* Returns the first _n_ elements from the list.
|
|
341
|
+
*/
|
|
342
|
+
first?: number | null;
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
* Returns the last _n_ elements from the list.
|
|
346
|
+
*/
|
|
347
|
+
last?: number | null;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
export declare namespace Withdrawals {
|
|
351
|
+
export {
|
|
352
|
+
type WithdrawalFeeTypes as WithdrawalFeeTypes,
|
|
353
|
+
type WithdrawalSpeeds as WithdrawalSpeeds,
|
|
354
|
+
type WithdrawalStatus as WithdrawalStatus,
|
|
355
|
+
type WithdrawalTypes as WithdrawalTypes,
|
|
356
|
+
type WithdrawalRetrieveResponse as WithdrawalRetrieveResponse,
|
|
357
|
+
type WithdrawalListResponse as WithdrawalListResponse,
|
|
358
|
+
type WithdrawalListResponsesCursorPage as WithdrawalListResponsesCursorPage,
|
|
359
|
+
type WithdrawalListParams as WithdrawalListParams,
|
|
360
|
+
};
|
|
361
|
+
}
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.0.
|
|
1
|
+
export const VERSION = '0.0.8'; // 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.8";
|
|
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.8";
|
|
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.8'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|