@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.
Files changed (103) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/client.d.mts +16 -4
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +16 -4
  5. package/client.d.ts.map +1 -1
  6. package/client.js +12 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +12 -0
  9. package/client.mjs.map +1 -1
  10. package/lib/upload-file.d.mts +39 -0
  11. package/lib/upload-file.d.mts.map +1 -0
  12. package/lib/upload-file.d.ts +39 -0
  13. package/lib/upload-file.d.ts.map +1 -0
  14. package/lib/upload-file.js +68 -0
  15. package/lib/upload-file.js.map +1 -0
  16. package/lib/upload-file.mjs +65 -0
  17. package/lib/upload-file.mjs.map +1 -0
  18. package/package.json +1 -1
  19. package/resources/files.d.mts +104 -0
  20. package/resources/files.d.mts.map +1 -0
  21. package/resources/files.d.ts +104 -0
  22. package/resources/files.d.ts.map +1 -0
  23. package/resources/files.js +35 -0
  24. package/resources/files.js.map +1 -0
  25. package/resources/files.mjs +31 -0
  26. package/resources/files.mjs.map +1 -0
  27. package/resources/index.d.mts +6 -2
  28. package/resources/index.d.mts.map +1 -1
  29. package/resources/index.d.ts +6 -2
  30. package/resources/index.d.ts.map +1 -1
  31. package/resources/index.js +9 -1
  32. package/resources/index.js.map +1 -1
  33. package/resources/index.mjs +4 -0
  34. package/resources/index.mjs.map +1 -1
  35. package/resources/leads.d.mts +489 -0
  36. package/resources/leads.d.mts.map +1 -0
  37. package/resources/leads.d.ts +489 -0
  38. package/resources/leads.d.ts.map +1 -0
  39. package/resources/leads.js +94 -0
  40. package/resources/leads.js.map +1 -0
  41. package/resources/leads.mjs +90 -0
  42. package/resources/leads.mjs.map +1 -0
  43. package/resources/ledger-accounts.d.mts +25 -0
  44. package/resources/ledger-accounts.d.mts.map +1 -1
  45. package/resources/ledger-accounts.d.ts +25 -0
  46. package/resources/ledger-accounts.d.ts.map +1 -1
  47. package/resources/payments.d.mts +1 -1
  48. package/resources/payments.d.mts.map +1 -1
  49. package/resources/payments.d.ts +1 -1
  50. package/resources/payments.d.ts.map +1 -1
  51. package/resources/payout-methods.d.mts +69 -1
  52. package/resources/payout-methods.d.mts.map +1 -1
  53. package/resources/payout-methods.d.ts +69 -1
  54. package/resources/payout-methods.d.ts.map +1 -1
  55. package/resources/payout-methods.js +11 -0
  56. package/resources/payout-methods.js.map +1 -1
  57. package/resources/payout-methods.mjs +11 -0
  58. package/resources/payout-methods.mjs.map +1 -1
  59. package/resources/plans.d.mts +8 -0
  60. package/resources/plans.d.mts.map +1 -1
  61. package/resources/plans.d.ts +8 -0
  62. package/resources/plans.d.ts.map +1 -1
  63. package/resources/topups.d.mts +79 -0
  64. package/resources/topups.d.mts.map +1 -0
  65. package/resources/topups.d.ts +79 -0
  66. package/resources/topups.d.ts.map +1 -0
  67. package/resources/topups.js +29 -0
  68. package/resources/topups.js.map +1 -0
  69. package/resources/topups.mjs +25 -0
  70. package/resources/topups.mjs.map +1 -0
  71. package/resources/verifications.d.mts +38 -0
  72. package/resources/verifications.d.mts.map +1 -0
  73. package/resources/verifications.d.ts +38 -0
  74. package/resources/verifications.d.ts.map +1 -0
  75. package/resources/verifications.js +20 -0
  76. package/resources/verifications.js.map +1 -0
  77. package/resources/verifications.mjs +16 -0
  78. package/resources/verifications.mjs.map +1 -0
  79. package/resources/webhooks.d.mts +431 -1
  80. package/resources/webhooks.d.mts.map +1 -1
  81. package/resources/webhooks.d.ts +431 -1
  82. package/resources/webhooks.d.ts.map +1 -1
  83. package/resources/webhooks.js +90 -0
  84. package/resources/webhooks.js.map +1 -1
  85. package/resources/webhooks.mjs +90 -0
  86. package/resources/webhooks.mjs.map +1 -1
  87. package/src/client.ts +72 -0
  88. package/src/lib/upload-file.ts +115 -0
  89. package/src/resources/files.ts +140 -0
  90. package/src/resources/index.ts +24 -0
  91. package/src/resources/leads.ts +583 -0
  92. package/src/resources/ledger-accounts.ts +63 -0
  93. package/src/resources/payments.ts +30 -30
  94. package/src/resources/payout-methods.ts +83 -0
  95. package/src/resources/plans.ts +10 -0
  96. package/src/resources/topups.ts +95 -0
  97. package/src/resources/verifications.ts +81 -0
  98. package/src/resources/webhooks.ts +793 -0
  99. package/src/version.ts +1 -1
  100. package/version.d.mts +1 -1
  101. package/version.d.ts +1 -1
  102. package/version.js +1 -1
  103. 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
+ }
@@ -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,