@whop/sdk 0.0.21 → 0.0.23
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 +24 -0
- package/client.d.mts +16 -4
- package/client.d.mts.map +1 -1
- package/client.d.ts +16 -4
- package/client.d.ts.map +1 -1
- package/client.js +12 -0
- package/client.js.map +1 -1
- package/client.mjs +12 -0
- package/client.mjs.map +1 -1
- package/lib/upload-file.d.mts +39 -0
- package/lib/upload-file.d.mts.map +1 -0
- package/lib/upload-file.d.ts +39 -0
- package/lib/upload-file.d.ts.map +1 -0
- package/lib/upload-file.js +68 -0
- package/lib/upload-file.js.map +1 -0
- package/lib/upload-file.mjs +65 -0
- package/lib/upload-file.mjs.map +1 -0
- package/package.json +1 -1
- package/resources/files.d.mts +104 -0
- package/resources/files.d.mts.map +1 -0
- package/resources/files.d.ts +104 -0
- package/resources/files.d.ts.map +1 -0
- package/resources/files.js +35 -0
- package/resources/files.js.map +1 -0
- package/resources/files.mjs +31 -0
- package/resources/files.mjs.map +1 -0
- package/resources/index.d.mts +6 -2
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +6 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +9 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +4 -0
- package/resources/index.mjs.map +1 -1
- package/resources/leads.d.mts +489 -0
- package/resources/leads.d.mts.map +1 -0
- package/resources/leads.d.ts +489 -0
- package/resources/leads.d.ts.map +1 -0
- package/resources/leads.js +94 -0
- package/resources/leads.js.map +1 -0
- package/resources/leads.mjs +90 -0
- package/resources/leads.mjs.map +1 -0
- package/resources/ledger-accounts.d.mts +25 -0
- package/resources/ledger-accounts.d.mts.map +1 -1
- package/resources/ledger-accounts.d.ts +25 -0
- 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/payout-methods.d.mts +69 -1
- package/resources/payout-methods.d.mts.map +1 -1
- package/resources/payout-methods.d.ts +69 -1
- package/resources/payout-methods.d.ts.map +1 -1
- package/resources/payout-methods.js +11 -0
- package/resources/payout-methods.js.map +1 -1
- package/resources/payout-methods.mjs +11 -0
- package/resources/payout-methods.mjs.map +1 -1
- package/resources/plans.d.mts +8 -0
- package/resources/plans.d.mts.map +1 -1
- package/resources/plans.d.ts +8 -0
- package/resources/plans.d.ts.map +1 -1
- package/resources/topups.d.mts +79 -0
- package/resources/topups.d.mts.map +1 -0
- package/resources/topups.d.ts +79 -0
- package/resources/topups.d.ts.map +1 -0
- package/resources/topups.js +29 -0
- package/resources/topups.js.map +1 -0
- package/resources/topups.mjs +25 -0
- package/resources/topups.mjs.map +1 -0
- package/resources/verifications.d.mts +38 -0
- package/resources/verifications.d.mts.map +1 -0
- package/resources/verifications.d.ts +38 -0
- package/resources/verifications.d.ts.map +1 -0
- package/resources/verifications.js +20 -0
- package/resources/verifications.js.map +1 -0
- package/resources/verifications.mjs +16 -0
- package/resources/verifications.mjs.map +1 -0
- package/resources/webhooks.d.mts +431 -1
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +431 -1
- package/resources/webhooks.d.ts.map +1 -1
- package/resources/webhooks.js +90 -0
- package/resources/webhooks.js.map +1 -1
- package/resources/webhooks.mjs +90 -0
- package/resources/webhooks.mjs.map +1 -1
- package/src/client.ts +72 -0
- package/src/lib/upload-file.ts +115 -0
- package/src/resources/files.ts +140 -0
- package/src/resources/index.ts +24 -0
- package/src/resources/leads.ts +583 -0
- package/src/resources/ledger-accounts.ts +63 -0
- package/src/resources/payments.ts +30 -30
- package/src/resources/payout-methods.ts +83 -0
- package/src/resources/plans.ts +10 -0
- package/src/resources/topups.ts +95 -0
- package/src/resources/verifications.ts +81 -0
- package/src/resources/webhooks.ts +793 -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,140 @@
|
|
|
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
|
+
import { path } from '../internal/utils/path';
|
|
7
|
+
import type { ToFileInput, Uploadable } from '../core/uploads';
|
|
8
|
+
import { uploadFile } from '../lib/upload-file';
|
|
9
|
+
|
|
10
|
+
export class Files extends APIResource {
|
|
11
|
+
/**
|
|
12
|
+
* Creates a file and returns a presigned URL for upload
|
|
13
|
+
*/
|
|
14
|
+
create(body: FileCreateParams, options?: RequestOptions): APIPromise<FileCreateResponse> {
|
|
15
|
+
return this._client.post('/files', { body, ...options });
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Retrieves a file by its ID
|
|
20
|
+
*/
|
|
21
|
+
retrieve(id: string, options?: RequestOptions): APIPromise<FileRetrieveResponse> {
|
|
22
|
+
return this._client.get(path`/files/${id}`, options);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Upload a file (create -> upload to presigned URL -> poll retrieve until ready).
|
|
27
|
+
*
|
|
28
|
+
* Polls for up to 2 minutes by default.
|
|
29
|
+
*/
|
|
30
|
+
upload(file: Uploadable | ToFileInput, options?: FileUploadOptions): Promise<FileRetrieveResponse> {
|
|
31
|
+
const { filename, ...requestOptions } = options ?? {};
|
|
32
|
+
return uploadFile(this._client, file, {
|
|
33
|
+
filename,
|
|
34
|
+
requestOptions,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* A file that has been uploaded or is pending upload
|
|
41
|
+
*/
|
|
42
|
+
export interface FileCreateResponse {
|
|
43
|
+
/**
|
|
44
|
+
* The ID of the file
|
|
45
|
+
*/
|
|
46
|
+
id: string;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* The MIME type of the file (e.g., image/jpeg, video/mp4)
|
|
50
|
+
*/
|
|
51
|
+
content_type: string | null;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* The name of the file
|
|
55
|
+
*/
|
|
56
|
+
filename: string | null;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* The size of the file in bytes
|
|
60
|
+
*/
|
|
61
|
+
size: string | null;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Headers to include in the upload request (only on create)
|
|
65
|
+
*/
|
|
66
|
+
upload_headers: { [key: string]: unknown } | null;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* The upload status of the file
|
|
70
|
+
*/
|
|
71
|
+
upload_status: 'pending' | 'processing' | 'ready' | 'failed';
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* The presigned URL to upload the file to (only on create)
|
|
75
|
+
*/
|
|
76
|
+
upload_url: string | null;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* The URL to access the file
|
|
80
|
+
*/
|
|
81
|
+
url: string | null;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* A file that has been uploaded or is pending upload
|
|
86
|
+
*/
|
|
87
|
+
export interface FileRetrieveResponse {
|
|
88
|
+
/**
|
|
89
|
+
* The ID of the file
|
|
90
|
+
*/
|
|
91
|
+
id: string;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* The MIME type of the file (e.g., image/jpeg, video/mp4)
|
|
95
|
+
*/
|
|
96
|
+
content_type: string | null;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* The name of the file
|
|
100
|
+
*/
|
|
101
|
+
filename: string | null;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* The size of the file in bytes
|
|
105
|
+
*/
|
|
106
|
+
size: string | null;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* The upload status of the file
|
|
110
|
+
*/
|
|
111
|
+
upload_status: 'pending' | 'processing' | 'ready' | 'failed';
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* The URL to access the file
|
|
115
|
+
*/
|
|
116
|
+
url: string | null;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export interface FileCreateParams {
|
|
120
|
+
/**
|
|
121
|
+
* The filename of the file
|
|
122
|
+
*/
|
|
123
|
+
filename: string;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export interface FileUploadOptions extends RequestOptions {
|
|
127
|
+
/**
|
|
128
|
+
* Override the filename used when creating the file.
|
|
129
|
+
*/
|
|
130
|
+
filename?: string | null | undefined;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export declare namespace Files {
|
|
134
|
+
export {
|
|
135
|
+
type FileCreateResponse as FileCreateResponse,
|
|
136
|
+
type FileRetrieveResponse as FileRetrieveResponse,
|
|
137
|
+
type FileCreateParams as FileCreateParams,
|
|
138
|
+
type FileUploadOptions as FileUploadOptions,
|
|
139
|
+
};
|
|
140
|
+
}
|
package/src/resources/index.ts
CHANGED
|
@@ -138,6 +138,7 @@ export {
|
|
|
138
138
|
type FeeMarkupListParams,
|
|
139
139
|
type FeeMarkupListResponsesCursorPage,
|
|
140
140
|
} from './fee-markups';
|
|
141
|
+
export { Files, type FileCreateResponse, type FileRetrieveResponse, type FileCreateParams } from './files';
|
|
141
142
|
export {
|
|
142
143
|
ForumPosts,
|
|
143
144
|
type ForumPostVisibilityType,
|
|
@@ -160,6 +161,17 @@ export {
|
|
|
160
161
|
type InvoiceCreateParams,
|
|
161
162
|
type InvoiceListParams,
|
|
162
163
|
} from './invoices';
|
|
164
|
+
export {
|
|
165
|
+
Leads,
|
|
166
|
+
type LeadCreateResponse,
|
|
167
|
+
type LeadRetrieveResponse,
|
|
168
|
+
type LeadUpdateResponse,
|
|
169
|
+
type LeadListResponse,
|
|
170
|
+
type LeadCreateParams,
|
|
171
|
+
type LeadUpdateParams,
|
|
172
|
+
type LeadListParams,
|
|
173
|
+
type LeadListResponsesCursorPage,
|
|
174
|
+
} from './leads';
|
|
163
175
|
export { LedgerAccounts, type LedgerAccountRetrieveResponse } from './ledger-accounts';
|
|
164
176
|
export {
|
|
165
177
|
Members,
|
|
@@ -214,6 +226,7 @@ export {
|
|
|
214
226
|
} from './payments';
|
|
215
227
|
export {
|
|
216
228
|
PayoutMethods,
|
|
229
|
+
type PayoutMethodRetrieveResponse,
|
|
217
230
|
type PayoutMethodListResponse,
|
|
218
231
|
type PayoutMethodListParams,
|
|
219
232
|
type PayoutMethodListResponsesCursorPage,
|
|
@@ -293,6 +306,7 @@ export {
|
|
|
293
306
|
type SupportChannelListParams,
|
|
294
307
|
type SupportChannelListResponsesCursorPage,
|
|
295
308
|
} from './support-channels';
|
|
309
|
+
export { Topups, type TopupCreateResponse, type TopupCreateParams } from './topups';
|
|
296
310
|
export {
|
|
297
311
|
Transfers,
|
|
298
312
|
type TransferListResponse,
|
|
@@ -306,8 +320,14 @@ export {
|
|
|
306
320
|
type UserCheckAccessResponse,
|
|
307
321
|
type UserCheckAccessParams,
|
|
308
322
|
} from './users';
|
|
323
|
+
export { Verifications, type VerificationRetrieveResponse } from './verifications';
|
|
309
324
|
export {
|
|
310
325
|
Webhooks,
|
|
326
|
+
type WebhookCreateResponse,
|
|
327
|
+
type WebhookRetrieveResponse,
|
|
328
|
+
type WebhookUpdateResponse,
|
|
329
|
+
type WebhookListResponse,
|
|
330
|
+
type WebhookDeleteResponse,
|
|
311
331
|
type InvoiceCreatedWebhookEvent,
|
|
312
332
|
type InvoicePaidWebhookEvent,
|
|
313
333
|
type InvoicePastDueWebhookEvent,
|
|
@@ -336,6 +356,10 @@ export {
|
|
|
336
356
|
type RefundUpdatedWebhookEvent,
|
|
337
357
|
type MembershipCancelAtPeriodEndChangedWebhookEvent,
|
|
338
358
|
type UnwrapWebhookEvent,
|
|
359
|
+
type WebhookCreateParams,
|
|
360
|
+
type WebhookUpdateParams,
|
|
361
|
+
type WebhookListParams,
|
|
362
|
+
type WebhookListResponsesCursorPage,
|
|
339
363
|
} from './webhooks';
|
|
340
364
|
export {
|
|
341
365
|
Withdrawals,
|