@whop/sdk 0.0.7 → 0.0.9

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 (162) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/client.d.mts +19 -10
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +19 -10
  5. package/client.d.ts.map +1 -1
  6. package/client.js +9 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +9 -0
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/account-links.d.mts +59 -0
  12. package/resources/account-links.d.mts.map +1 -0
  13. package/resources/account-links.d.ts +59 -0
  14. package/resources/account-links.d.ts.map +1 -0
  15. package/resources/account-links.js +27 -0
  16. package/resources/account-links.js.map +1 -0
  17. package/resources/account-links.mjs +23 -0
  18. package/resources/account-links.mjs.map +1 -0
  19. package/resources/app-builds.d.mts +8 -0
  20. package/resources/app-builds.d.mts.map +1 -1
  21. package/resources/app-builds.d.ts +8 -0
  22. package/resources/app-builds.d.ts.map +1 -1
  23. package/resources/apps.d.mts +18 -2
  24. package/resources/apps.d.mts.map +1 -1
  25. package/resources/apps.d.ts +18 -2
  26. package/resources/apps.d.ts.map +1 -1
  27. package/resources/authorized-users.d.mts +8 -0
  28. package/resources/authorized-users.d.mts.map +1 -1
  29. package/resources/authorized-users.d.ts +8 -0
  30. package/resources/authorized-users.d.ts.map +1 -1
  31. package/resources/checkout-configurations.d.mts +173 -8
  32. package/resources/checkout-configurations.d.mts.map +1 -1
  33. package/resources/checkout-configurations.d.ts +173 -8
  34. package/resources/checkout-configurations.d.ts.map +1 -1
  35. package/resources/checkout-configurations.js +1 -0
  36. package/resources/checkout-configurations.js.map +1 -1
  37. package/resources/checkout-configurations.mjs +1 -0
  38. package/resources/checkout-configurations.mjs.map +1 -1
  39. package/resources/companies.d.mts +8 -0
  40. package/resources/companies.d.mts.map +1 -1
  41. package/resources/companies.d.ts +8 -0
  42. package/resources/companies.d.ts.map +1 -1
  43. package/resources/course-lessons.d.mts +199 -1
  44. package/resources/course-lessons.d.mts.map +1 -1
  45. package/resources/course-lessons.d.ts +199 -1
  46. package/resources/course-lessons.d.ts.map +1 -1
  47. package/resources/course-lessons.js +40 -0
  48. package/resources/course-lessons.js.map +1 -1
  49. package/resources/course-lessons.mjs +40 -0
  50. package/resources/course-lessons.mjs.map +1 -1
  51. package/resources/courses.d.mts +8 -0
  52. package/resources/courses.d.mts.map +1 -1
  53. package/resources/courses.d.ts +8 -0
  54. package/resources/courses.d.ts.map +1 -1
  55. package/resources/disputes.d.mts +8 -0
  56. package/resources/disputes.d.mts.map +1 -1
  57. package/resources/disputes.d.ts +8 -0
  58. package/resources/disputes.d.ts.map +1 -1
  59. package/resources/entries.d.mts +8 -0
  60. package/resources/entries.d.mts.map +1 -1
  61. package/resources/entries.d.ts +8 -0
  62. package/resources/entries.d.ts.map +1 -1
  63. package/resources/experiences.d.mts +8 -0
  64. package/resources/experiences.d.mts.map +1 -1
  65. package/resources/experiences.d.ts +8 -0
  66. package/resources/experiences.d.ts.map +1 -1
  67. package/resources/forum-posts.d.mts +7 -3
  68. package/resources/forum-posts.d.mts.map +1 -1
  69. package/resources/forum-posts.d.ts +7 -3
  70. package/resources/forum-posts.d.ts.map +1 -1
  71. package/resources/index.d.mts +8 -5
  72. package/resources/index.d.mts.map +1 -1
  73. package/resources/index.d.ts +8 -5
  74. package/resources/index.d.ts.map +1 -1
  75. package/resources/index.js +7 -1
  76. package/resources/index.js.map +1 -1
  77. package/resources/index.mjs +3 -0
  78. package/resources/index.mjs.map +1 -1
  79. package/resources/invoices.d.mts +8 -0
  80. package/resources/invoices.d.mts.map +1 -1
  81. package/resources/invoices.d.ts +8 -0
  82. package/resources/invoices.d.ts.map +1 -1
  83. package/resources/payments.d.mts +1 -1
  84. package/resources/payments.d.mts.map +1 -1
  85. package/resources/payments.d.ts +1 -1
  86. package/resources/payments.d.ts.map +1 -1
  87. package/resources/plans.d.mts +9 -11
  88. package/resources/plans.d.mts.map +1 -1
  89. package/resources/plans.d.ts +9 -11
  90. package/resources/plans.d.ts.map +1 -1
  91. package/resources/products.d.mts +8 -26
  92. package/resources/products.d.mts.map +1 -1
  93. package/resources/products.d.ts +8 -26
  94. package/resources/products.d.ts.map +1 -1
  95. package/resources/promo-codes.d.mts +8 -0
  96. package/resources/promo-codes.d.mts.map +1 -1
  97. package/resources/promo-codes.d.ts +8 -0
  98. package/resources/promo-codes.d.ts.map +1 -1
  99. package/resources/refunds.d.mts +303 -0
  100. package/resources/refunds.d.mts.map +1 -0
  101. package/resources/refunds.d.ts +303 -0
  102. package/resources/refunds.d.ts.map +1 -0
  103. package/resources/refunds.js +34 -0
  104. package/resources/refunds.js.map +1 -0
  105. package/resources/refunds.mjs +30 -0
  106. package/resources/refunds.mjs.map +1 -0
  107. package/resources/reviews.d.mts +8 -0
  108. package/resources/reviews.d.mts.map +1 -1
  109. package/resources/reviews.d.ts +8 -0
  110. package/resources/reviews.d.ts.map +1 -1
  111. package/resources/shared.d.mts +43 -2
  112. package/resources/shared.d.mts.map +1 -1
  113. package/resources/shared.d.ts +43 -2
  114. package/resources/shared.d.ts.map +1 -1
  115. package/resources/transfers.d.mts +8 -0
  116. package/resources/transfers.d.mts.map +1 -1
  117. package/resources/transfers.d.ts +8 -0
  118. package/resources/transfers.d.ts.map +1 -1
  119. package/resources/webhooks.d.mts +382 -2
  120. package/resources/webhooks.d.mts.map +1 -1
  121. package/resources/webhooks.d.ts +382 -2
  122. package/resources/webhooks.d.ts.map +1 -1
  123. package/resources/webhooks.js.map +1 -1
  124. package/resources/webhooks.mjs.map +1 -1
  125. package/resources/withdrawals.d.mts +233 -0
  126. package/resources/withdrawals.d.mts.map +1 -0
  127. package/resources/withdrawals.d.ts +233 -0
  128. package/resources/withdrawals.d.ts.map +1 -0
  129. package/resources/withdrawals.js +31 -0
  130. package/resources/withdrawals.js.map +1 -0
  131. package/resources/withdrawals.mjs +27 -0
  132. package/resources/withdrawals.mjs.map +1 -0
  133. package/src/client.ts +77 -0
  134. package/src/resources/account-links.ts +73 -0
  135. package/src/resources/app-builds.ts +10 -0
  136. package/src/resources/apps.ts +22 -0
  137. package/src/resources/authorized-users.ts +10 -0
  138. package/src/resources/checkout-configurations.ts +199 -8
  139. package/src/resources/companies.ts +10 -0
  140. package/src/resources/course-lessons.ts +250 -0
  141. package/src/resources/courses.ts +10 -0
  142. package/src/resources/disputes.ts +10 -0
  143. package/src/resources/entries.ts +10 -0
  144. package/src/resources/experiences.ts +10 -0
  145. package/src/resources/forum-posts.ts +8 -2
  146. package/src/resources/index.ts +32 -0
  147. package/src/resources/invoices.ts +10 -0
  148. package/src/resources/payments.ts +1 -0
  149. package/src/resources/plans.ts +11 -13
  150. package/src/resources/products.ts +10 -32
  151. package/src/resources/promo-codes.ts +10 -0
  152. package/src/resources/refunds.ts +393 -0
  153. package/src/resources/reviews.ts +10 -0
  154. package/src/resources/shared.ts +49 -2
  155. package/src/resources/transfers.ts +10 -0
  156. package/src/resources/webhooks.ts +463 -1
  157. package/src/resources/withdrawals.ts +361 -0
  158. package/src/version.ts +1 -1
  159. package/version.d.mts +1 -1
  160. package/version.d.ts +1 -1
  161. package/version.js +1 -1
  162. package/version.mjs +1 -1
@@ -0,0 +1,233 @@
1
+ import { APIResource } from "../core/resource.js";
2
+ import * as Shared from "./shared.js";
3
+ import { APIPromise } from "../core/api-promise.js";
4
+ import { CursorPage, type CursorPageParams, PagePromise } from "../core/pagination.js";
5
+ import { RequestOptions } from "../internal/request-options.js";
6
+ export declare class Withdrawals extends APIResource {
7
+ /**
8
+ * Retrieves a withdrawal by ID
9
+ *
10
+ * Required permissions:
11
+ *
12
+ * - `payout:withdrawal:read`
13
+ */
14
+ retrieve(id: string, options?: RequestOptions): APIPromise<WithdrawalRetrieveResponse>;
15
+ /**
16
+ * Lists withdrawals
17
+ *
18
+ * Required permissions:
19
+ *
20
+ * - `payout:withdrawal:read`
21
+ */
22
+ list(query: WithdrawalListParams, options?: RequestOptions): PagePromise<WithdrawalListResponsesCursorPage, WithdrawalListResponse>;
23
+ }
24
+ export type WithdrawalListResponsesCursorPage = CursorPage<WithdrawalListResponse>;
25
+ /**
26
+ * The different fee types for a withdrawal.
27
+ */
28
+ export type WithdrawalFeeTypes = 'exclusive' | 'inclusive';
29
+ /**
30
+ * The different speeds of withdrawals
31
+ */
32
+ export type WithdrawalSpeeds = 'standard' | 'instant';
33
+ /**
34
+ * The status of a withdrawal request
35
+ */
36
+ export type WithdrawalStatus = 'requested' | 'awaiting_payment' | 'in_transit' | 'completed' | 'failed' | 'canceled' | 'denied';
37
+ /**
38
+ * The types of withdrawals
39
+ */
40
+ export type WithdrawalTypes = 'regular' | 'clawback';
41
+ /**
42
+ * A withdrawal request.
43
+ */
44
+ export interface WithdrawalRetrieveResponse {
45
+ /**
46
+ * Internal ID of the withdrawal request.
47
+ */
48
+ id: string;
49
+ /**
50
+ * How much money was attempted to be withdrawn, in a float type.
51
+ */
52
+ amount: number;
53
+ /**
54
+ * When the withdrawal request was created.
55
+ */
56
+ created_at: string;
57
+ /**
58
+ * The currency of the withdrawal request.
59
+ */
60
+ currency: Shared.Currency;
61
+ /**
62
+ * The fee amount that was charged for the withdrawal. This is in the same currency
63
+ * as the withdrawal amount.
64
+ */
65
+ fee_amount: number;
66
+ /**
67
+ * The different fee types for a withdrawal.
68
+ */
69
+ fee_type: WithdrawalFeeTypes | null;
70
+ /**
71
+ * The latest payout associated with this withdrawal, if any.
72
+ */
73
+ latest_payout: WithdrawalRetrieveResponse.LatestPayout | null;
74
+ /**
75
+ * The payout token used for the withdrawal, if applicable.
76
+ */
77
+ payout_token: WithdrawalRetrieveResponse.PayoutToken | null;
78
+ /**
79
+ * The speed of the withdrawal.
80
+ */
81
+ speed: WithdrawalSpeeds;
82
+ /**
83
+ * Status of the withdrawal.
84
+ */
85
+ status: WithdrawalStatus;
86
+ /**
87
+ * The type of withdrawal.
88
+ */
89
+ withdrawal_type: WithdrawalTypes;
90
+ }
91
+ export declare namespace WithdrawalRetrieveResponse {
92
+ /**
93
+ * The latest payout associated with this withdrawal, if any.
94
+ */
95
+ interface LatestPayout {
96
+ /**
97
+ * The internal ID of the payout.
98
+ */
99
+ id: string;
100
+ /**
101
+ * The date and time the payout was created.
102
+ */
103
+ created_at: string;
104
+ /**
105
+ * The different error codes a payout can be in.
106
+ */
107
+ error_code: 'account_closed' | 'account_does_not_exist' | 'account_information_invalid' | 'account_number_invalid_region' | 'account_frozen' | 'account_lookup_failed' | 'account_not_found' | 'amount_out_of_bounds' | 'attributes_not_validated' | 'b2b_payments_prohibited' | 'bank_statement_required' | 'compliance_review' | 'currency_not_supported' | 'deposit_canceled' | 'deposit_failed' | 'deposit_rejected' | 'destination_unavailable' | 'exceeded_account_limit' | 'expired_quote' | 'generic_payout_error' | 'technical_problem' | 'identification_number_invalid' | 'invalid_account_number' | 'invalid_bank_code' | 'invalid_beneficiary' | 'invalid_branch_number' | 'invalid_branch_code' | 'invalid_phone_number' | 'invalid_routing_number' | 'invalid_swift_code' | 'invalid_company_details' | 'manual_cancelation' | 'misc_error' | 'missing_city_and_country' | 'missing_phone_number' | 'missing_remittance_info' | 'payee_name_invalid' | 'receiving_account_locked' | 'rejected_by_compliance' | 'rtp_not_supported' | 'non_transaction_account' | 'source_token_insufficient_funds' | 'ssn_invalid' | 'wallet_screenshot_required' | 'unsupported_region' | null;
108
+ /**
109
+ * The error message for the payout.
110
+ */
111
+ error_message: string | null;
112
+ /**
113
+ * The estimated availability date of the payout.
114
+ */
115
+ estimated_availability: string | null;
116
+ /**
117
+ * The name of the payer for the payout.
118
+ */
119
+ payer_name: string | null;
120
+ /**
121
+ * The status of the payout.
122
+ */
123
+ status: 'scheduled' | 'pending' | 'processing' | 'completed' | 'canceled' | 'ready_for_pickup' | 'hold' | 'error' | 'expired';
124
+ /**
125
+ * The trace code for the payout, if applicable. Provided on ACH transactions when
126
+ * available.
127
+ */
128
+ trace_code: string | null;
129
+ }
130
+ /**
131
+ * The payout token used for the withdrawal, if applicable.
132
+ */
133
+ interface PayoutToken {
134
+ /**
135
+ * The ID of the payout token
136
+ */
137
+ id: string;
138
+ /**
139
+ * The date and time the payout token was created
140
+ */
141
+ created_at: string;
142
+ /**
143
+ * The currency code of the payout destination. This is the currency that payouts
144
+ * will be made in for this token.
145
+ */
146
+ destination_currency_code: string;
147
+ /**
148
+ * An optional nickname for the payout token to help the user identify it. This is
149
+ * not used by the provider and is only for the user's reference.
150
+ */
151
+ nickname: string | null;
152
+ /**
153
+ * The status of the payout token.
154
+ */
155
+ status: 'created' | 'active' | 'broken';
156
+ }
157
+ }
158
+ /**
159
+ * A withdrawal request.
160
+ */
161
+ export interface WithdrawalListResponse {
162
+ /**
163
+ * Internal ID of the withdrawal request.
164
+ */
165
+ id: string;
166
+ /**
167
+ * How much money was attempted to be withdrawn, in a float type.
168
+ */
169
+ amount: number;
170
+ /**
171
+ * When the withdrawal request was created.
172
+ */
173
+ created_at: string;
174
+ /**
175
+ * The currency of the withdrawal request.
176
+ */
177
+ currency: Shared.Currency;
178
+ /**
179
+ * The fee amount that was charged for the withdrawal. This is in the same currency
180
+ * as the withdrawal amount.
181
+ */
182
+ fee_amount: number;
183
+ /**
184
+ * The different fee types for a withdrawal.
185
+ */
186
+ fee_type: WithdrawalFeeTypes | null;
187
+ /**
188
+ * The speed of the withdrawal.
189
+ */
190
+ speed: WithdrawalSpeeds;
191
+ /**
192
+ * Status of the withdrawal.
193
+ */
194
+ status: WithdrawalStatus;
195
+ /**
196
+ * The type of withdrawal.
197
+ */
198
+ withdrawal_type: WithdrawalTypes;
199
+ }
200
+ export interface WithdrawalListParams extends CursorPageParams {
201
+ /**
202
+ * The ID of the company to list withdrawals for
203
+ */
204
+ company_id: string;
205
+ /**
206
+ * Returns the elements in the list that come before the specified cursor.
207
+ */
208
+ before?: string | null;
209
+ /**
210
+ * The minimum creation date to filter by
211
+ */
212
+ created_after?: string | null;
213
+ /**
214
+ * The maximum creation date to filter by
215
+ */
216
+ created_before?: string | null;
217
+ /**
218
+ * The direction of the sort.
219
+ */
220
+ direction?: Shared.Direction | null;
221
+ /**
222
+ * Returns the first _n_ elements from the list.
223
+ */
224
+ first?: number | null;
225
+ /**
226
+ * Returns the last _n_ elements from the list.
227
+ */
228
+ last?: number | null;
229
+ }
230
+ export declare namespace Withdrawals {
231
+ export { type WithdrawalFeeTypes as WithdrawalFeeTypes, type WithdrawalSpeeds as WithdrawalSpeeds, type WithdrawalStatus as WithdrawalStatus, type WithdrawalTypes as WithdrawalTypes, type WithdrawalRetrieveResponse as WithdrawalRetrieveResponse, type WithdrawalListResponse as WithdrawalListResponse, type WithdrawalListResponsesCursorPage as WithdrawalListResponsesCursorPage, type WithdrawalListParams as WithdrawalListParams, };
232
+ }
233
+ //# sourceMappingURL=withdrawals.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withdrawals.d.ts","sourceRoot":"","sources":["../src/resources/withdrawals.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,MAAM;OACX,EAAE,UAAU,EAAE;OACd,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,WAAW,EAAE;OAClD,EAAE,cAAc,EAAE;AAGzB,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,0BAA0B,CAAC;IAItF;;;;;;OAMG;IACH,IAAI,CACF,KAAK,EAAE,oBAAoB,EAC3B,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,iCAAiC,EAAE,sBAAsB,CAAC;CAG1E;AAED,MAAM,MAAM,iCAAiC,GAAG,UAAU,CAAC,sBAAsB,CAAC,CAAC;AAEnF;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG,WAAW,CAAC;AAE3D;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,SAAS,CAAC;AAEtD;;GAE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IACH,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC;IAE1B;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,QAAQ,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAEpC;;OAEG;IACH,KAAK,EAAE,gBAAgB,CAAC;IAExB;;OAEG;IACH,MAAM,EAAE,gBAAgB,CAAC;IAEzB;;OAEG;IACH,eAAe,EAAE,eAAe,CAAC;CAClC;AAED,MAAM,WAAW,oBAAqB,SAAQ,gBAAgB;IAC5D;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEvB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE9B;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE/B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC;IAEpC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEtB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,WAAW,WAAW,CAAC;IACnC,OAAO,EACL,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,iCAAiC,IAAI,iCAAiC,EAC3E,KAAK,oBAAoB,IAAI,oBAAoB,GAClD,CAAC;CACH"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Withdrawals = void 0;
5
+ const resource_1 = require("../core/resource.js");
6
+ const pagination_1 = require("../core/pagination.js");
7
+ const path_1 = require("../internal/utils/path.js");
8
+ class Withdrawals extends resource_1.APIResource {
9
+ /**
10
+ * Retrieves a withdrawal by ID
11
+ *
12
+ * Required permissions:
13
+ *
14
+ * - `payout:withdrawal:read`
15
+ */
16
+ retrieve(id, options) {
17
+ return this._client.get((0, path_1.path) `/withdrawals/${id}`, options);
18
+ }
19
+ /**
20
+ * Lists withdrawals
21
+ *
22
+ * Required permissions:
23
+ *
24
+ * - `payout:withdrawal:read`
25
+ */
26
+ list(query, options) {
27
+ return this._client.getAPIList('/withdrawals', (pagination_1.CursorPage), { query, ...options });
28
+ }
29
+ }
30
+ exports.Withdrawals = Withdrawals;
31
+ //# sourceMappingURL=withdrawals.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withdrawals.js","sourceRoot":"","sources":["../src/resources/withdrawals.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,sDAAoF;AAEpF,oDAA8C;AAE9C,MAAa,WAAY,SAAQ,sBAAW;IAC1C;;;;;;OAMG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,gBAAgB,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IAC7D,CAAC;IAED;;;;;;OAMG;IACH,IAAI,CACF,KAA2B,EAC3B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc,EAAE,CAAA,uBAAkC,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5G,CAAC;CACF;AAzBD,kCAyBC"}
@@ -0,0 +1,27 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../core/resource.mjs";
3
+ import { CursorPage } from "../core/pagination.mjs";
4
+ import { path } from "../internal/utils/path.mjs";
5
+ export class Withdrawals extends APIResource {
6
+ /**
7
+ * Retrieves a withdrawal by ID
8
+ *
9
+ * Required permissions:
10
+ *
11
+ * - `payout:withdrawal:read`
12
+ */
13
+ retrieve(id, options) {
14
+ return this._client.get(path `/withdrawals/${id}`, options);
15
+ }
16
+ /**
17
+ * Lists withdrawals
18
+ *
19
+ * Required permissions:
20
+ *
21
+ * - `payout:withdrawal:read`
22
+ */
23
+ list(query, options) {
24
+ return this._client.getAPIList('/withdrawals', (CursorPage), { query, ...options });
25
+ }
26
+ }
27
+ //# sourceMappingURL=withdrawals.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withdrawals.mjs","sourceRoot":"","sources":["../src/resources/withdrawals.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,UAAU,EAAsC;OAElD,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,WAAY,SAAQ,WAAW;IAC1C;;;;;;OAMG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,gBAAgB,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IAC7D,CAAC;IAED;;;;;;OAMG;IACH,IAAI,CACF,KAA2B,EAC3B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc,EAAE,CAAA,UAAkC,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5G,CAAC;CACF"}
package/src/client.ts CHANGED
@@ -20,6 +20,7 @@ import * as Uploads from './core/uploads';
20
20
  import * as API from './resources/index';
21
21
  import { APIPromise } from './core/api-promise';
22
22
  import { AccessTokenCreateParams, AccessTokenCreateResponse, AccessTokens } from './resources/access-tokens';
23
+ import { AccountLinkCreateParams, AccountLinkCreateResponse, AccountLinks } from './resources/account-links';
23
24
  import {
24
25
  AppBuildCreateParams,
25
26
  AppBuildListParams,
@@ -32,6 +33,7 @@ import {
32
33
  AppListParams,
33
34
  AppListResponse,
34
35
  AppListResponsesCursorPage,
36
+ AppType,
35
37
  AppUpdateParams,
36
38
  Apps,
37
39
  } from './resources/apps';
@@ -55,6 +57,7 @@ import {
55
57
  CheckoutConfigurationListResponse,
56
58
  CheckoutConfigurationListResponsesCursorPage,
57
59
  CheckoutConfigurations,
60
+ CheckoutModes,
58
61
  } from './resources/checkout-configurations';
59
62
  import {
60
63
  Companies,
@@ -84,6 +87,10 @@ import {
84
87
  CourseLessonListParams,
85
88
  CourseLessonListResponse,
86
89
  CourseLessonListResponsesCursorPage,
90
+ CourseLessonMarkAsCompletedResponse,
91
+ CourseLessonStartResponse,
92
+ CourseLessonSubmitAssessmentParams,
93
+ CourseLessonSubmitAssessmentResponse,
87
94
  CourseLessonUpdateParams,
88
95
  CourseLessons,
89
96
  EmbedType,
@@ -144,6 +151,7 @@ import {
144
151
  ForumPostListResponse,
145
152
  ForumPostListResponsesCursorPage,
146
153
  ForumPostUpdateParams,
154
+ ForumPostVisibilityType,
147
155
  ForumPosts,
148
156
  } from './resources/forum-posts';
149
157
  import {
@@ -228,6 +236,17 @@ import {
228
236
  ReactionListResponsesCursorPage,
229
237
  Reactions,
230
238
  } from './resources/reactions';
239
+ import {
240
+ PaymentProvider,
241
+ RefundListParams,
242
+ RefundListResponse,
243
+ RefundListResponsesCursorPage,
244
+ RefundReferenceStatus,
245
+ RefundReferenceType,
246
+ RefundRetrieveResponse,
247
+ RefundStatus,
248
+ Refunds,
249
+ } from './resources/refunds';
231
250
  import {
232
251
  ReviewListParams,
233
252
  ReviewListResponse,
@@ -280,9 +299,22 @@ import {
280
299
  PaymentFailedWebhookEvent,
281
300
  PaymentPendingWebhookEvent,
282
301
  PaymentSucceededWebhookEvent,
302
+ RefundCreatedWebhookEvent,
303
+ RefundUpdatedWebhookEvent,
283
304
  UnwrapWebhookEvent,
284
305
  Webhooks,
285
306
  } from './resources/webhooks';
307
+ import {
308
+ WithdrawalFeeTypes,
309
+ WithdrawalListParams,
310
+ WithdrawalListResponse,
311
+ WithdrawalListResponsesCursorPage,
312
+ WithdrawalRetrieveResponse,
313
+ WithdrawalSpeeds,
314
+ WithdrawalStatus,
315
+ WithdrawalTypes,
316
+ Withdrawals,
317
+ } from './resources/withdrawals';
286
318
  import { type Fetch } from './internal/builtin-types';
287
319
  import { HeadersLike, NullableHeaders, buildHeaders } from './internal/headers';
288
320
  import { FinalRequestOptions, RequestOptions } from './internal/request-options';
@@ -1043,6 +1075,9 @@ export class Whop {
1043
1075
  accessTokens: API.AccessTokens = new API.AccessTokens(this);
1044
1076
  notifications: API.Notifications = new API.Notifications(this);
1045
1077
  disputes: API.Disputes = new API.Disputes(this);
1078
+ refunds: API.Refunds = new API.Refunds(this);
1079
+ withdrawals: API.Withdrawals = new API.Withdrawals(this);
1080
+ accountLinks: API.AccountLinks = new API.AccountLinks(this);
1046
1081
  }
1047
1082
 
1048
1083
  Whop.Apps = Apps;
@@ -1079,6 +1114,9 @@ Whop.CourseStudents = CourseStudents;
1079
1114
  Whop.AccessTokens = AccessTokens;
1080
1115
  Whop.Notifications = Notifications;
1081
1116
  Whop.Disputes = Disputes;
1117
+ Whop.Refunds = Refunds;
1118
+ Whop.Withdrawals = Withdrawals;
1119
+ Whop.AccountLinks = AccountLinks;
1082
1120
 
1083
1121
  export declare namespace Whop {
1084
1122
  export type RequestOptions = Opts.RequestOptions;
@@ -1088,6 +1126,7 @@ export declare namespace Whop {
1088
1126
 
1089
1127
  export {
1090
1128
  Apps as Apps,
1129
+ type AppType as AppType,
1091
1130
  type AppListResponse as AppListResponse,
1092
1131
  type AppListResponsesCursorPage as AppListResponsesCursorPage,
1093
1132
  type AppCreateParams as AppCreateParams,
@@ -1141,6 +1180,8 @@ export declare namespace Whop {
1141
1180
  type PaymentPendingWebhookEvent as PaymentPendingWebhookEvent,
1142
1181
  type DisputeCreatedWebhookEvent as DisputeCreatedWebhookEvent,
1143
1182
  type DisputeUpdatedWebhookEvent as DisputeUpdatedWebhookEvent,
1183
+ type RefundCreatedWebhookEvent as RefundCreatedWebhookEvent,
1184
+ type RefundUpdatedWebhookEvent as RefundUpdatedWebhookEvent,
1144
1185
  type UnwrapWebhookEvent as UnwrapWebhookEvent,
1145
1186
  };
1146
1187
 
@@ -1164,6 +1205,7 @@ export declare namespace Whop {
1164
1205
 
1165
1206
  export {
1166
1207
  ForumPosts as ForumPosts,
1208
+ type ForumPostVisibilityType as ForumPostVisibilityType,
1167
1209
  type ForumPostListResponse as ForumPostListResponse,
1168
1210
  type ForumPostListResponsesCursorPage as ForumPostListResponsesCursorPage,
1169
1211
  type ForumPostCreateParams as ForumPostCreateParams,
@@ -1220,6 +1262,7 @@ export declare namespace Whop {
1220
1262
 
1221
1263
  export {
1222
1264
  CheckoutConfigurations as CheckoutConfigurations,
1265
+ type CheckoutModes as CheckoutModes,
1223
1266
  type CheckoutConfigurationListResponse as CheckoutConfigurationListResponse,
1224
1267
  type CheckoutConfigurationListResponsesCursorPage as CheckoutConfigurationListResponsesCursorPage,
1225
1268
  type CheckoutConfigurationCreateParams as CheckoutConfigurationCreateParams,
@@ -1351,10 +1394,14 @@ export declare namespace Whop {
1351
1394
  type LessonVisibilities as LessonVisibilities,
1352
1395
  type CourseLessonListResponse as CourseLessonListResponse,
1353
1396
  type CourseLessonDeleteResponse as CourseLessonDeleteResponse,
1397
+ type CourseLessonMarkAsCompletedResponse as CourseLessonMarkAsCompletedResponse,
1398
+ type CourseLessonStartResponse as CourseLessonStartResponse,
1399
+ type CourseLessonSubmitAssessmentResponse as CourseLessonSubmitAssessmentResponse,
1354
1400
  type CourseLessonListResponsesCursorPage as CourseLessonListResponsesCursorPage,
1355
1401
  type CourseLessonCreateParams as CourseLessonCreateParams,
1356
1402
  type CourseLessonUpdateParams as CourseLessonUpdateParams,
1357
1403
  type CourseLessonListParams as CourseLessonListParams,
1404
+ type CourseLessonSubmitAssessmentParams as CourseLessonSubmitAssessmentParams,
1358
1405
  };
1359
1406
 
1360
1407
  export {
@@ -1396,6 +1443,36 @@ export declare namespace Whop {
1396
1443
  type DisputeUpdateEvidenceParams as DisputeUpdateEvidenceParams,
1397
1444
  };
1398
1445
 
1446
+ export {
1447
+ Refunds as Refunds,
1448
+ type PaymentProvider as PaymentProvider,
1449
+ type RefundReferenceStatus as RefundReferenceStatus,
1450
+ type RefundReferenceType as RefundReferenceType,
1451
+ type RefundStatus as RefundStatus,
1452
+ type RefundRetrieveResponse as RefundRetrieveResponse,
1453
+ type RefundListResponse as RefundListResponse,
1454
+ type RefundListResponsesCursorPage as RefundListResponsesCursorPage,
1455
+ type RefundListParams as RefundListParams,
1456
+ };
1457
+
1458
+ export {
1459
+ Withdrawals as Withdrawals,
1460
+ type WithdrawalFeeTypes as WithdrawalFeeTypes,
1461
+ type WithdrawalSpeeds as WithdrawalSpeeds,
1462
+ type WithdrawalStatus as WithdrawalStatus,
1463
+ type WithdrawalTypes as WithdrawalTypes,
1464
+ type WithdrawalRetrieveResponse as WithdrawalRetrieveResponse,
1465
+ type WithdrawalListResponse as WithdrawalListResponse,
1466
+ type WithdrawalListResponsesCursorPage as WithdrawalListResponsesCursorPage,
1467
+ type WithdrawalListParams as WithdrawalListParams,
1468
+ };
1469
+
1470
+ export {
1471
+ AccountLinks as AccountLinks,
1472
+ type AccountLinkCreateResponse as AccountLinkCreateResponse,
1473
+ type AccountLinkCreateParams as AccountLinkCreateParams,
1474
+ };
1475
+
1399
1476
  export type AccessLevel = API.AccessLevel;
1400
1477
  export type AccessPassType = API.AccessPassType;
1401
1478
  export type App = API.App;
@@ -0,0 +1,73 @@
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
+
7
+ export class AccountLinks extends APIResource {
8
+ /**
9
+ * Generates a url that a user can be directed to in order to access their
10
+ * sub-merchant account. For example, they can visit the hosted payouts portal or
11
+ * the hosted KYC onboarding flow.
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * const accountLink = await client.accountLinks.create({
16
+ * company_id: 'biz_xxxxxxxxxxxxxx',
17
+ * refresh_url: 'refresh_url',
18
+ * return_url: 'return_url',
19
+ * use_case: 'account_onboarding',
20
+ * });
21
+ * ```
22
+ */
23
+ create(body: AccountLinkCreateParams, options?: RequestOptions): APIPromise<AccountLinkCreateResponse> {
24
+ return this._client.post('/account_links', { body, ...options });
25
+ }
26
+ }
27
+
28
+ /**
29
+ * An object representing a url that a user can be directed to to access their
30
+ * account.
31
+ */
32
+ export interface AccountLinkCreateResponse {
33
+ /**
34
+ * The expiration timestamp of the url.
35
+ */
36
+ expires_at: string;
37
+
38
+ /**
39
+ * The URL to navigate the user to.
40
+ */
41
+ url: string;
42
+ }
43
+
44
+ export interface AccountLinkCreateParams {
45
+ /**
46
+ * The ID of the Company to generate the url for. The company must be a
47
+ * sub-merchant of the API key's company.
48
+ */
49
+ company_id: string;
50
+
51
+ /**
52
+ * The URL to redirect to if the session expires and needs to be re-authenticated
53
+ * due to the token expiring.
54
+ */
55
+ refresh_url: string;
56
+
57
+ /**
58
+ * The URL to redirect to when the customer wants to return to your site.
59
+ */
60
+ return_url: string;
61
+
62
+ /**
63
+ * The use case for which the link will be used.
64
+ */
65
+ use_case: 'account_onboarding' | 'payouts_portal';
66
+ }
67
+
68
+ export declare namespace AccountLinks {
69
+ export {
70
+ type AccountLinkCreateResponse as AccountLinkCreateResponse,
71
+ type AccountLinkCreateParams as AccountLinkCreateParams,
72
+ };
73
+ }
@@ -216,6 +216,16 @@ export interface AppBuildListParams extends CursorPageParams {
216
216
  */
217
217
  before?: string | null;
218
218
 
219
+ /**
220
+ * The minimum creation date to filter by
221
+ */
222
+ created_after?: string | null;
223
+
224
+ /**
225
+ * The maximum creation date to filter by
226
+ */
227
+ created_before?: string | null;
228
+
219
229
  /**
220
230
  * Returns the first _n_ elements from the list.
221
231
  */
@@ -88,6 +88,11 @@ export class Apps extends APIResource {
88
88
 
89
89
  export type AppListResponsesCursorPage = CursorPage<AppListResponse>;
90
90
 
91
+ /**
92
+ * The type of end-user an app is built for
93
+ */
94
+ export type AppType = 'b2b_app' | 'b2c_app' | 'company_app' | 'component';
95
+
91
96
  /**
92
97
  * An object representing an app
93
98
  */
@@ -97,6 +102,11 @@ export interface AppListResponse {
97
102
  */
98
103
  id: string;
99
104
 
105
+ /**
106
+ * The type of end-user an app is built for
107
+ */
108
+ app_type: AppType;
109
+
100
110
  /**
101
111
  * The base url of the app
102
112
  */
@@ -241,6 +251,11 @@ export interface AppUpdateParams {
241
251
  */
242
252
  app_store_description?: string | null;
243
253
 
254
+ /**
255
+ * The type of end-user an app is built for
256
+ */
257
+ app_type?: AppType | null;
258
+
244
259
  /**
245
260
  * The base production url of the app
246
261
  */
@@ -314,6 +329,11 @@ export namespace AppUpdateParams {
314
329
  }
315
330
 
316
331
  export interface AppListParams extends CursorPageParams {
332
+ /**
333
+ * The type of end-user an app is built for
334
+ */
335
+ app_type?: AppType | null;
336
+
317
337
  /**
318
338
  * Returns the elements in the list that come before the specified cursor.
319
339
  */
@@ -345,6 +365,7 @@ export interface AppListParams extends CursorPageParams {
345
365
  order?:
346
366
  | 'discoverable_at'
347
367
  | 'total_installs_last_30_days'
368
+ | 'total_installs_last_7_days'
348
369
  | 'time_spent'
349
370
  | 'time_spent_last_24_hours'
350
371
  | 'daily_active_users'
@@ -369,6 +390,7 @@ export interface AppListParams extends CursorPageParams {
369
390
 
370
391
  export declare namespace Apps {
371
392
  export {
393
+ type AppType as AppType,
372
394
  type AppListResponse as AppListResponse,
373
395
  type AppListResponsesCursorPage as AppListResponsesCursorPage,
374
396
  type AppCreateParams as AppCreateParams,
@@ -146,6 +146,16 @@ export interface AuthorizedUserListParams extends CursorPageParams {
146
146
  */
147
147
  before?: string | null;
148
148
 
149
+ /**
150
+ * The minimum creation date to filter by
151
+ */
152
+ created_after?: string | null;
153
+
154
+ /**
155
+ * The maximum creation date to filter by
156
+ */
157
+ created_before?: string | null;
158
+
149
159
  /**
150
160
  * Returns the first _n_ elements from the list.
151
161
  */