Package not found. Please check the package name and try again.

@whop/sdk 0.0.9 → 0.0.10

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 (73) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/client.d.mts +11 -5
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +11 -5
  5. package/client.d.ts.map +1 -1
  6. package/client.js +6 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +6 -0
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/app-builds.d.mts +4 -0
  12. package/resources/app-builds.d.mts.map +1 -1
  13. package/resources/app-builds.d.ts +4 -0
  14. package/resources/app-builds.d.ts.map +1 -1
  15. package/resources/index.d.mts +4 -2
  16. package/resources/index.d.mts.map +1 -1
  17. package/resources/index.d.ts +4 -2
  18. package/resources/index.d.ts.map +1 -1
  19. package/resources/index.js +5 -1
  20. package/resources/index.js.map +1 -1
  21. package/resources/index.mjs +2 -0
  22. package/resources/index.mjs.map +1 -1
  23. package/resources/payment-tokens.d.mts +157 -0
  24. package/resources/payment-tokens.d.mts.map +1 -0
  25. package/resources/payment-tokens.d.ts +157 -0
  26. package/resources/payment-tokens.d.ts.map +1 -0
  27. package/resources/payment-tokens.js +34 -0
  28. package/resources/payment-tokens.js.map +1 -0
  29. package/resources/payment-tokens.mjs +30 -0
  30. package/resources/payment-tokens.mjs.map +1 -0
  31. package/resources/payments.d.mts +255 -1
  32. package/resources/payments.d.mts.map +1 -1
  33. package/resources/payments.d.ts +255 -1
  34. package/resources/payments.d.ts.map +1 -1
  35. package/resources/payments.js +31 -0
  36. package/resources/payments.js.map +1 -1
  37. package/resources/payments.mjs +31 -0
  38. package/resources/payments.mjs.map +1 -1
  39. package/resources/setup-intents.d.mts +359 -0
  40. package/resources/setup-intents.d.mts.map +1 -0
  41. package/resources/setup-intents.d.ts +359 -0
  42. package/resources/setup-intents.d.ts.map +1 -0
  43. package/resources/setup-intents.js +38 -0
  44. package/resources/setup-intents.js.map +1 -0
  45. package/resources/setup-intents.mjs +34 -0
  46. package/resources/setup-intents.mjs.map +1 -0
  47. package/resources/shared.d.mts +50 -0
  48. package/resources/shared.d.mts.map +1 -1
  49. package/resources/shared.d.ts +50 -0
  50. package/resources/shared.d.ts.map +1 -1
  51. package/resources/webhooks.d.mts +72 -2
  52. package/resources/webhooks.d.mts.map +1 -1
  53. package/resources/webhooks.d.ts +72 -2
  54. package/resources/webhooks.d.ts.map +1 -1
  55. package/resources/webhooks.js.map +1 -1
  56. package/resources/webhooks.mjs.map +1 -1
  57. package/src/client.ts +47 -1
  58. package/src/resources/app-builds.ts +5 -0
  59. package/src/resources/index.ts +20 -0
  60. package/src/resources/payment-tokens.ts +207 -0
  61. package/src/resources/payments.ts +306 -0
  62. package/src/resources/setup-intents.ts +435 -0
  63. package/src/resources/shared.ts +59 -0
  64. package/src/resources/webhooks.ts +91 -0
  65. package/src/version.ts +1 -1
  66. package/version.d.mts +1 -1
  67. package/version.d.mts.map +1 -1
  68. package/version.d.ts +1 -1
  69. package/version.d.ts.map +1 -1
  70. package/version.js +1 -1
  71. package/version.js.map +1 -1
  72. package/version.mjs +1 -1
  73. package/version.mjs.map +1 -1
@@ -0,0 +1,359 @@
1
+ import { APIResource } from "../core/resource.mjs";
2
+ import * as PaymentsAPI from "./payments.mjs";
3
+ import * as Shared from "./shared.mjs";
4
+ import { APIPromise } from "../core/api-promise.mjs";
5
+ import { CursorPage, type CursorPageParams, PagePromise } from "../core/pagination.mjs";
6
+ import { RequestOptions } from "../internal/request-options.mjs";
7
+ export declare class SetupIntents extends APIResource {
8
+ /**
9
+ * Retrieves a Setup Intent by ID
10
+ *
11
+ * Required permissions:
12
+ *
13
+ * - `payment:setup_intent:read`
14
+ * - `member:basic:read`
15
+ * - `member:email:read`
16
+ */
17
+ retrieve(id: string, options?: RequestOptions): APIPromise<SetupIntent>;
18
+ /**
19
+ * Lists Setup Intents
20
+ *
21
+ * Required permissions:
22
+ *
23
+ * - `payment:setup_intent:read`
24
+ * - `member:basic:read`
25
+ * - `member:email:read`
26
+ */
27
+ list(query: SetupIntentListParams, options?: RequestOptions): PagePromise<SetupIntentListResponsesCursorPage, SetupIntentListResponse>;
28
+ }
29
+ export type SetupIntentListResponsesCursorPage = CursorPage<SetupIntentListResponse>;
30
+ /**
31
+ * An object representing a setup intent, which is a flow for allowing a customer
32
+ * to add a payment method to their account without making a purchase.
33
+ */
34
+ export interface SetupIntent {
35
+ /**
36
+ * The setup intent ID
37
+ */
38
+ id: string;
39
+ /**
40
+ * The checkout configuration associated with the setup intent
41
+ */
42
+ checkout_configuration: SetupIntent.CheckoutConfiguration | null;
43
+ /**
44
+ * The company of the setup intent
45
+ */
46
+ company: SetupIntent.Company | null;
47
+ /**
48
+ * The datetime the payment was created
49
+ */
50
+ created_at: string;
51
+ /**
52
+ * The error message, if any.
53
+ */
54
+ error_message: string | null;
55
+ /**
56
+ * The member connected to the setup intent
57
+ */
58
+ member: SetupIntent.Member | null;
59
+ /**
60
+ * The metadata associated with the setup intent
61
+ */
62
+ metadata: {
63
+ [key: string]: unknown;
64
+ } | null;
65
+ /**
66
+ * The payment token created during the setup, if available.
67
+ */
68
+ payment_token: SetupIntent.PaymentToken | null;
69
+ /**
70
+ * The status of the setup intent
71
+ */
72
+ status: SetupIntentStatus;
73
+ }
74
+ export declare namespace SetupIntent {
75
+ /**
76
+ * The checkout configuration associated with the setup intent
77
+ */
78
+ interface CheckoutConfiguration {
79
+ /**
80
+ * The ID of the checkout configuration
81
+ */
82
+ id: string;
83
+ }
84
+ /**
85
+ * The company of the setup intent
86
+ */
87
+ interface Company {
88
+ /**
89
+ * The ID (tag) of the company.
90
+ */
91
+ id: string;
92
+ }
93
+ /**
94
+ * The member connected to the setup intent
95
+ */
96
+ interface Member {
97
+ /**
98
+ * The ID of the member
99
+ */
100
+ id: string;
101
+ /**
102
+ * The user for this member, if any.
103
+ */
104
+ user: Member.User | null;
105
+ }
106
+ namespace Member {
107
+ /**
108
+ * The user for this member, if any.
109
+ */
110
+ interface User {
111
+ /**
112
+ * The internal ID of the user account.
113
+ */
114
+ id: string;
115
+ /**
116
+ * The digital mailing address of the user.
117
+ */
118
+ email: string | null;
119
+ /**
120
+ * The user's full name.
121
+ */
122
+ name: string | null;
123
+ /**
124
+ * The whop username.
125
+ */
126
+ username: string;
127
+ }
128
+ }
129
+ /**
130
+ * The payment token created during the setup, if available.
131
+ */
132
+ interface PaymentToken {
133
+ /**
134
+ * The ID of the payment token
135
+ */
136
+ id: string;
137
+ /**
138
+ * The card data associated with the payment token, if its a debit or credit card
139
+ * token.
140
+ */
141
+ card: PaymentToken.Card | null;
142
+ /**
143
+ * The date and time the payment token was created
144
+ */
145
+ created_at: string;
146
+ /**
147
+ * The payment method type of the payment token
148
+ */
149
+ payment_method_type: PaymentsAPI.PaymentMethodTypes;
150
+ }
151
+ namespace PaymentToken {
152
+ /**
153
+ * The card data associated with the payment token, if its a debit or credit card
154
+ * token.
155
+ */
156
+ interface Card {
157
+ /**
158
+ * Possible card brands that a payment token can have
159
+ */
160
+ brand: PaymentsAPI.CardBrands | null;
161
+ /**
162
+ * Card expiration month, like 03 for March.
163
+ */
164
+ exp_month: number | null;
165
+ /**
166
+ * Card expiration year, like 27 for 2027.
167
+ */
168
+ exp_year: number | null;
169
+ /**
170
+ * Last four digits of the card.
171
+ */
172
+ last4: string | null;
173
+ }
174
+ }
175
+ }
176
+ /**
177
+ * The status of the setup intent.
178
+ */
179
+ export type SetupIntentStatus = 'processing' | 'succeeded' | 'canceled' | 'requires_action';
180
+ /**
181
+ * An object representing a setup intent, which is a flow for allowing a customer
182
+ * to add a payment method to their account without making a purchase.
183
+ */
184
+ export interface SetupIntentListResponse {
185
+ /**
186
+ * The setup intent ID
187
+ */
188
+ id: string;
189
+ /**
190
+ * The checkout configuration associated with the setup intent
191
+ */
192
+ checkout_configuration: SetupIntentListResponse.CheckoutConfiguration | null;
193
+ /**
194
+ * The company of the setup intent
195
+ */
196
+ company: SetupIntentListResponse.Company | null;
197
+ /**
198
+ * The datetime the payment was created
199
+ */
200
+ created_at: string;
201
+ /**
202
+ * The error message, if any.
203
+ */
204
+ error_message: string | null;
205
+ /**
206
+ * The member connected to the setup intent
207
+ */
208
+ member: SetupIntentListResponse.Member | null;
209
+ /**
210
+ * The metadata associated with the setup intent
211
+ */
212
+ metadata: {
213
+ [key: string]: unknown;
214
+ } | null;
215
+ /**
216
+ * The payment token created during the setup, if available.
217
+ */
218
+ payment_token: SetupIntentListResponse.PaymentToken | null;
219
+ /**
220
+ * The status of the setup intent
221
+ */
222
+ status: SetupIntentStatus;
223
+ }
224
+ export declare namespace SetupIntentListResponse {
225
+ /**
226
+ * The checkout configuration associated with the setup intent
227
+ */
228
+ interface CheckoutConfiguration {
229
+ /**
230
+ * The ID of the checkout configuration
231
+ */
232
+ id: string;
233
+ }
234
+ /**
235
+ * The company of the setup intent
236
+ */
237
+ interface Company {
238
+ /**
239
+ * The ID (tag) of the company.
240
+ */
241
+ id: string;
242
+ }
243
+ /**
244
+ * The member connected to the setup intent
245
+ */
246
+ interface Member {
247
+ /**
248
+ * The ID of the member
249
+ */
250
+ id: string;
251
+ /**
252
+ * The user for this member, if any.
253
+ */
254
+ user: Member.User | null;
255
+ }
256
+ namespace Member {
257
+ /**
258
+ * The user for this member, if any.
259
+ */
260
+ interface User {
261
+ /**
262
+ * The internal ID of the user account.
263
+ */
264
+ id: string;
265
+ /**
266
+ * The digital mailing address of the user.
267
+ */
268
+ email: string | null;
269
+ /**
270
+ * The user's full name.
271
+ */
272
+ name: string | null;
273
+ /**
274
+ * The whop username.
275
+ */
276
+ username: string;
277
+ }
278
+ }
279
+ /**
280
+ * The payment token created during the setup, if available.
281
+ */
282
+ interface PaymentToken {
283
+ /**
284
+ * The ID of the payment token
285
+ */
286
+ id: string;
287
+ /**
288
+ * The card data associated with the payment token, if its a debit or credit card
289
+ * token.
290
+ */
291
+ card: PaymentToken.Card | null;
292
+ /**
293
+ * The date and time the payment token was created
294
+ */
295
+ created_at: string;
296
+ /**
297
+ * The payment method type of the payment token
298
+ */
299
+ payment_method_type: PaymentsAPI.PaymentMethodTypes;
300
+ }
301
+ namespace PaymentToken {
302
+ /**
303
+ * The card data associated with the payment token, if its a debit or credit card
304
+ * token.
305
+ */
306
+ interface Card {
307
+ /**
308
+ * Possible card brands that a payment token can have
309
+ */
310
+ brand: PaymentsAPI.CardBrands | null;
311
+ /**
312
+ * Card expiration month, like 03 for March.
313
+ */
314
+ exp_month: number | null;
315
+ /**
316
+ * Card expiration year, like 27 for 2027.
317
+ */
318
+ exp_year: number | null;
319
+ /**
320
+ * Last four digits of the card.
321
+ */
322
+ last4: string | null;
323
+ }
324
+ }
325
+ }
326
+ export interface SetupIntentListParams extends CursorPageParams {
327
+ /**
328
+ * The ID of the company to list setup intents for
329
+ */
330
+ company_id: string;
331
+ /**
332
+ * Returns the elements in the list that come before the specified cursor.
333
+ */
334
+ before?: string | null;
335
+ /**
336
+ * The minimum creation date to filter by
337
+ */
338
+ created_after?: string | null;
339
+ /**
340
+ * The maximum creation date to filter by
341
+ */
342
+ created_before?: string | null;
343
+ /**
344
+ * The direction of the sort.
345
+ */
346
+ direction?: Shared.Direction | null;
347
+ /**
348
+ * Returns the first _n_ elements from the list.
349
+ */
350
+ first?: number | null;
351
+ /**
352
+ * Returns the last _n_ elements from the list.
353
+ */
354
+ last?: number | null;
355
+ }
356
+ export declare namespace SetupIntents {
357
+ export { type SetupIntent as SetupIntent, type SetupIntentStatus as SetupIntentStatus, type SetupIntentListResponse as SetupIntentListResponse, type SetupIntentListResponsesCursorPage as SetupIntentListResponsesCursorPage, type SetupIntentListParams as SetupIntentListParams, };
358
+ }
359
+ //# sourceMappingURL=setup-intents.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup-intents.d.mts","sourceRoot":"","sources":["../src/resources/setup-intents.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,WAAW;OAChB,KA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