@whop/sdk 0.0.34 → 0.0.36
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 +68 -0
- package/client.d.mts +12 -6
- package/client.d.mts.map +1 -1
- package/client.d.ts +12 -6
- package/client.d.ts.map +1 -1
- package/client.js +6 -0
- package/client.js.map +1 -1
- package/client.mjs +7 -1
- package/client.mjs.map +1 -1
- package/internal/utils/env.js +2 -2
- package/internal/utils/env.js.map +1 -1
- package/internal/utils/env.mjs +2 -2
- package/internal/utils/env.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/affiliates/affiliates.d.mts +353 -0
- package/resources/affiliates/affiliates.d.mts.map +1 -0
- package/resources/affiliates/affiliates.d.ts +353 -0
- package/resources/affiliates/affiliates.d.ts.map +1 -0
- package/resources/affiliates/affiliates.js +112 -0
- package/resources/affiliates/affiliates.js.map +1 -0
- package/resources/affiliates/affiliates.mjs +107 -0
- package/resources/affiliates/affiliates.mjs.map +1 -0
- package/resources/affiliates/index.d.mts +3 -0
- package/resources/affiliates/index.d.mts.map +1 -0
- package/resources/affiliates/index.d.ts +3 -0
- package/resources/affiliates/index.d.ts.map +1 -0
- package/resources/affiliates/index.js +9 -0
- package/resources/affiliates/index.js.map +1 -0
- package/resources/affiliates/index.mjs +4 -0
- package/resources/affiliates/index.mjs.map +1 -0
- package/resources/affiliates/overrides.d.mts +451 -0
- package/resources/affiliates/overrides.d.mts.map +1 -0
- package/resources/affiliates/overrides.d.ts +451 -0
- package/resources/affiliates/overrides.d.ts.map +1 -0
- package/resources/affiliates/overrides.js +117 -0
- package/resources/affiliates/overrides.js.map +1 -0
- package/resources/affiliates/overrides.mjs +113 -0
- package/resources/affiliates/overrides.mjs.map +1 -0
- package/resources/affiliates.d.mts +2 -0
- package/resources/affiliates.d.mts.map +1 -0
- package/resources/affiliates.d.ts +2 -0
- package/resources/affiliates.d.ts.map +1 -0
- package/resources/affiliates.js +6 -0
- package/resources/affiliates.js.map +1 -0
- package/resources/affiliates.mjs +3 -0
- package/resources/affiliates.mjs.map +1 -0
- package/resources/ai-chats.d.mts +21 -2
- package/resources/ai-chats.d.mts.map +1 -1
- package/resources/ai-chats.d.ts +21 -2
- package/resources/ai-chats.d.ts.map +1 -1
- package/resources/ai-chats.js +2 -1
- package/resources/ai-chats.js.map +1 -1
- package/resources/ai-chats.mjs +2 -1
- package/resources/ai-chats.mjs.map +1 -1
- package/resources/apps.d.mts +26 -0
- package/resources/apps.d.mts.map +1 -1
- package/resources/apps.d.ts +26 -0
- package/resources/apps.d.ts.map +1 -1
- package/resources/checkout-configurations.d.mts +69 -0
- package/resources/checkout-configurations.d.mts.map +1 -1
- package/resources/checkout-configurations.d.ts +69 -0
- package/resources/checkout-configurations.d.ts.map +1 -1
- package/resources/companies.d.mts +19 -0
- package/resources/companies.d.mts.map +1 -1
- package/resources/companies.d.ts +19 -0
- package/resources/companies.d.ts.map +1 -1
- package/resources/index.d.mts +4 -3
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +4 -3
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +4 -2
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -0
- package/resources/index.mjs.map +1 -1
- package/resources/invoices.d.mts +179 -345
- package/resources/invoices.d.mts.map +1 -1
- package/resources/invoices.d.ts +179 -345
- package/resources/invoices.d.ts.map +1 -1
- package/resources/invoices.js +20 -2
- package/resources/invoices.js.map +1 -1
- package/resources/invoices.mjs +20 -2
- package/resources/invoices.mjs.map +1 -1
- package/resources/memberships.d.mts +1 -1
- package/resources/memberships.d.mts.map +1 -1
- package/resources/memberships.d.ts +1 -1
- package/resources/memberships.d.ts.map +1 -1
- package/resources/payments.d.mts +21 -2
- package/resources/payments.d.mts.map +1 -1
- package/resources/payments.d.ts +21 -2
- package/resources/payments.d.ts.map +1 -1
- package/resources/plans.d.mts +46 -0
- package/resources/plans.d.mts.map +1 -1
- package/resources/plans.d.ts +46 -0
- package/resources/plans.d.ts.map +1 -1
- package/resources/products.d.mts +2 -2
- package/resources/products.d.ts +2 -2
- package/resources/refunds.d.mts +1 -1
- package/resources/refunds.d.mts.map +1 -1
- package/resources/refunds.d.ts +1 -1
- package/resources/refunds.d.ts.map +1 -1
- package/resources/setup-intents.d.mts +74 -0
- package/resources/setup-intents.d.mts.map +1 -1
- package/resources/setup-intents.d.ts +74 -0
- package/resources/setup-intents.d.ts.map +1 -1
- package/resources/shared.d.mts +54 -5
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +54 -5
- package/resources/shared.d.ts.map +1 -1
- package/resources/webhooks.d.mts +653 -3
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +653 -3
- package/resources/webhooks.d.ts.map +1 -1
- package/resources/webhooks.js.map +1 -1
- package/resources/webhooks.mjs.map +1 -1
- package/src/client.ts +50 -1
- package/src/internal/utils/env.ts +2 -2
- package/src/resources/affiliates/affiliates.ts +475 -0
- package/src/resources/affiliates/index.ts +32 -0
- package/src/resources/affiliates/overrides.ts +593 -0
- package/src/resources/affiliates.ts +3 -0
- package/src/resources/ai-chats.ts +25 -1
- package/src/resources/apps.ts +31 -0
- package/src/resources/checkout-configurations.ts +81 -0
- package/src/resources/companies.ts +23 -0
- package/src/resources/index.ts +19 -0
- package/src/resources/invoices.ts +316 -397
- package/src/resources/memberships.ts +1 -1
- package/src/resources/payments.ts +26 -1
- package/src/resources/plans.ts +54 -0
- package/src/resources/products.ts +2 -2
- package/src/resources/refunds.ts +2 -1
- package/src/resources/setup-intents.ts +90 -0
- package/src/resources/shared.ts +65 -5
- package/src/resources/webhooks.ts +818 -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,593 @@
|
|
|
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 { CursorPage, type CursorPageParams, PagePromise } from '../../core/pagination';
|
|
6
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
7
|
+
import { path } from '../../internal/utils/path';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Affiliates
|
|
11
|
+
*/
|
|
12
|
+
export class Overrides extends APIResource {
|
|
13
|
+
/**
|
|
14
|
+
* Creates a commission override for an affiliate.
|
|
15
|
+
*
|
|
16
|
+
* Required permissions:
|
|
17
|
+
*
|
|
18
|
+
* - `affiliate:create`
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```ts
|
|
22
|
+
* const override = await client.affiliates.overrides.create(
|
|
23
|
+
* 'aff_xxxxxxxxxxxxxx',
|
|
24
|
+
* {
|
|
25
|
+
* id: 'id',
|
|
26
|
+
* commission_value: 6.9,
|
|
27
|
+
* override_type: 'standard',
|
|
28
|
+
* plan_id: 'plan_xxxxxxxxxxxxx',
|
|
29
|
+
* },
|
|
30
|
+
* );
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
create(
|
|
34
|
+
id: string,
|
|
35
|
+
body: OverrideCreateParams,
|
|
36
|
+
options?: RequestOptions,
|
|
37
|
+
): APIPromise<OverrideCreateResponse> {
|
|
38
|
+
return this._client.post(path`/affiliates/${id}/overrides`, { body, ...options });
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Retrieves the details of a specific affiliate override.
|
|
43
|
+
*
|
|
44
|
+
* Required permissions:
|
|
45
|
+
*
|
|
46
|
+
* - `affiliate:basic:read`
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```ts
|
|
50
|
+
* const override = await client.affiliates.overrides.retrieve(
|
|
51
|
+
* 'override_id',
|
|
52
|
+
* { id: 'aff_xxxxxxxxxxxxxx' },
|
|
53
|
+
* );
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
retrieve(
|
|
57
|
+
overrideID: string,
|
|
58
|
+
params: OverrideRetrieveParams,
|
|
59
|
+
options?: RequestOptions,
|
|
60
|
+
): APIPromise<OverrideRetrieveResponse> {
|
|
61
|
+
const { id } = params;
|
|
62
|
+
return this._client.get(path`/affiliates/${id}/overrides/${overrideID}`, options);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Updates an existing affiliate override.
|
|
67
|
+
*
|
|
68
|
+
* Required permissions:
|
|
69
|
+
*
|
|
70
|
+
* - `affiliate:update`
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```ts
|
|
74
|
+
* const override = await client.affiliates.overrides.update(
|
|
75
|
+
* 'override_id',
|
|
76
|
+
* { id: 'aff_xxxxxxxxxxxxxx' },
|
|
77
|
+
* );
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
update(
|
|
81
|
+
overrideID: string,
|
|
82
|
+
params: OverrideUpdateParams,
|
|
83
|
+
options?: RequestOptions,
|
|
84
|
+
): APIPromise<OverrideUpdateResponse> {
|
|
85
|
+
const { id, ...body } = params;
|
|
86
|
+
return this._client.patch(path`/affiliates/${id}/overrides/${overrideID}`, { body, ...options });
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Returns a paginated list of overrides for an affiliate.
|
|
91
|
+
*
|
|
92
|
+
* Required permissions:
|
|
93
|
+
*
|
|
94
|
+
* - `affiliate:basic:read`
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* ```ts
|
|
98
|
+
* // Automatically fetches more pages as needed.
|
|
99
|
+
* for await (const overrideListResponse of client.affiliates.overrides.list(
|
|
100
|
+
* 'aff_xxxxxxxxxxxxxx',
|
|
101
|
+
* )) {
|
|
102
|
+
* // ...
|
|
103
|
+
* }
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
106
|
+
list(
|
|
107
|
+
id: string,
|
|
108
|
+
query: OverrideListParams | null | undefined = {},
|
|
109
|
+
options?: RequestOptions,
|
|
110
|
+
): PagePromise<OverrideListResponsesCursorPage, OverrideListResponse> {
|
|
111
|
+
return this._client.getAPIList(path`/affiliates/${id}/overrides`, CursorPage<OverrideListResponse>, {
|
|
112
|
+
query,
|
|
113
|
+
...options,
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Deletes an affiliate override.
|
|
119
|
+
*
|
|
120
|
+
* Required permissions:
|
|
121
|
+
*
|
|
122
|
+
* - `affiliate:update`
|
|
123
|
+
*
|
|
124
|
+
* @example
|
|
125
|
+
* ```ts
|
|
126
|
+
* const override = await client.affiliates.overrides.delete(
|
|
127
|
+
* 'override_id',
|
|
128
|
+
* { id: 'aff_xxxxxxxxxxxxxx' },
|
|
129
|
+
* );
|
|
130
|
+
* ```
|
|
131
|
+
*/
|
|
132
|
+
delete(
|
|
133
|
+
overrideID: string,
|
|
134
|
+
params: OverrideDeleteParams,
|
|
135
|
+
options?: RequestOptions,
|
|
136
|
+
): APIPromise<OverrideDeleteResponse> {
|
|
137
|
+
const { id } = params;
|
|
138
|
+
return this._client.delete(path`/affiliates/${id}/overrides/${overrideID}`, options);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export type OverrideListResponsesCursorPage = CursorPage<OverrideListResponse>;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Whether the affiliate commission applies to the first payment or all payments
|
|
146
|
+
*/
|
|
147
|
+
export type AffiliateAppliesToPayments = 'first_payment' | 'all_payments';
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Whether a rev-share override applies to a single product or all products
|
|
151
|
+
*/
|
|
152
|
+
export type AffiliateAppliesToProducts = 'single_product' | 'all_products';
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* The role of an affiliate override (standard or rev_share)
|
|
156
|
+
*/
|
|
157
|
+
export type AffiliateOverrideRoles = 'standard' | 'rev_share';
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* The types of payouts an affiliate can have
|
|
161
|
+
*/
|
|
162
|
+
export type AffiliatePayoutTypes = 'percentage' | 'flat_fee';
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* The calculation method for affiliate rev-share percentages
|
|
166
|
+
*/
|
|
167
|
+
export type AffiliateRevenueBases = 'pre_fees' | 'post_fees';
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* A commission configuration for an affiliate, defining payout terms for a
|
|
171
|
+
* specific plan or revenue share
|
|
172
|
+
*/
|
|
173
|
+
export interface OverrideCreateResponse {
|
|
174
|
+
/**
|
|
175
|
+
* The unique identifier for the affiliate override.
|
|
176
|
+
*/
|
|
177
|
+
id: string;
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Whether the affiliate commission applies to the first payment or all payments
|
|
181
|
+
*/
|
|
182
|
+
applies_to_payments: AffiliateAppliesToPayments | null;
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Whether a rev-share override applies to a single product or all products
|
|
186
|
+
*/
|
|
187
|
+
applies_to_products: AffiliateAppliesToProducts | null;
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* The checkout direct link for referrals (standard overrides only).
|
|
191
|
+
*/
|
|
192
|
+
checkout_direct_link: string | null;
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* The type of commission (percentage or flat_fee).
|
|
196
|
+
*/
|
|
197
|
+
commission_type: AffiliatePayoutTypes;
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* The commission amount. A percentage (1-100) when commission_type is percentage,
|
|
201
|
+
* or a dollar amount when flat_fee.
|
|
202
|
+
*/
|
|
203
|
+
commission_value: number;
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* The type of override (standard or rev_share).
|
|
207
|
+
*/
|
|
208
|
+
override_type: AffiliateOverrideRoles;
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* The plan ID (for standard overrides).
|
|
212
|
+
*/
|
|
213
|
+
plan_id: string | null;
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* The product page direct link for referrals (standard overrides only).
|
|
217
|
+
*/
|
|
218
|
+
product_direct_link: string | null;
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* The product ID (for rev-share overrides).
|
|
222
|
+
*/
|
|
223
|
+
product_id: string | null;
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* The calculation method for affiliate rev-share percentages
|
|
227
|
+
*/
|
|
228
|
+
revenue_basis: AffiliateRevenueBases | null;
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* The total earnings paid to this affiliate for referrals to this specific plan,
|
|
232
|
+
* in USD.
|
|
233
|
+
*/
|
|
234
|
+
total_referral_earnings_usd: number;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* A commission configuration for an affiliate, defining payout terms for a
|
|
239
|
+
* specific plan or revenue share
|
|
240
|
+
*/
|
|
241
|
+
export interface OverrideRetrieveResponse {
|
|
242
|
+
/**
|
|
243
|
+
* The unique identifier for the affiliate override.
|
|
244
|
+
*/
|
|
245
|
+
id: string;
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Whether the affiliate commission applies to the first payment or all payments
|
|
249
|
+
*/
|
|
250
|
+
applies_to_payments: AffiliateAppliesToPayments | null;
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Whether a rev-share override applies to a single product or all products
|
|
254
|
+
*/
|
|
255
|
+
applies_to_products: AffiliateAppliesToProducts | null;
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* The checkout direct link for referrals (standard overrides only).
|
|
259
|
+
*/
|
|
260
|
+
checkout_direct_link: string | null;
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* The type of commission (percentage or flat_fee).
|
|
264
|
+
*/
|
|
265
|
+
commission_type: AffiliatePayoutTypes;
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* The commission amount. A percentage (1-100) when commission_type is percentage,
|
|
269
|
+
* or a dollar amount when flat_fee.
|
|
270
|
+
*/
|
|
271
|
+
commission_value: number;
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* The type of override (standard or rev_share).
|
|
275
|
+
*/
|
|
276
|
+
override_type: AffiliateOverrideRoles;
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* The plan ID (for standard overrides).
|
|
280
|
+
*/
|
|
281
|
+
plan_id: string | null;
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* The product page direct link for referrals (standard overrides only).
|
|
285
|
+
*/
|
|
286
|
+
product_direct_link: string | null;
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* The product ID (for rev-share overrides).
|
|
290
|
+
*/
|
|
291
|
+
product_id: string | null;
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* The calculation method for affiliate rev-share percentages
|
|
295
|
+
*/
|
|
296
|
+
revenue_basis: AffiliateRevenueBases | null;
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* The total earnings paid to this affiliate for referrals to this specific plan,
|
|
300
|
+
* in USD.
|
|
301
|
+
*/
|
|
302
|
+
total_referral_earnings_usd: number;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* A commission configuration for an affiliate, defining payout terms for a
|
|
307
|
+
* specific plan or revenue share
|
|
308
|
+
*/
|
|
309
|
+
export interface OverrideUpdateResponse {
|
|
310
|
+
/**
|
|
311
|
+
* The unique identifier for the affiliate override.
|
|
312
|
+
*/
|
|
313
|
+
id: string;
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* Whether the affiliate commission applies to the first payment or all payments
|
|
317
|
+
*/
|
|
318
|
+
applies_to_payments: AffiliateAppliesToPayments | null;
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Whether a rev-share override applies to a single product or all products
|
|
322
|
+
*/
|
|
323
|
+
applies_to_products: AffiliateAppliesToProducts | null;
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* The checkout direct link for referrals (standard overrides only).
|
|
327
|
+
*/
|
|
328
|
+
checkout_direct_link: string | null;
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* The type of commission (percentage or flat_fee).
|
|
332
|
+
*/
|
|
333
|
+
commission_type: AffiliatePayoutTypes;
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* The commission amount. A percentage (1-100) when commission_type is percentage,
|
|
337
|
+
* or a dollar amount when flat_fee.
|
|
338
|
+
*/
|
|
339
|
+
commission_value: number;
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* The type of override (standard or rev_share).
|
|
343
|
+
*/
|
|
344
|
+
override_type: AffiliateOverrideRoles;
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* The plan ID (for standard overrides).
|
|
348
|
+
*/
|
|
349
|
+
plan_id: string | null;
|
|
350
|
+
|
|
351
|
+
/**
|
|
352
|
+
* The product page direct link for referrals (standard overrides only).
|
|
353
|
+
*/
|
|
354
|
+
product_direct_link: string | null;
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* The product ID (for rev-share overrides).
|
|
358
|
+
*/
|
|
359
|
+
product_id: string | null;
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
* The calculation method for affiliate rev-share percentages
|
|
363
|
+
*/
|
|
364
|
+
revenue_basis: AffiliateRevenueBases | null;
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* The total earnings paid to this affiliate for referrals to this specific plan,
|
|
368
|
+
* in USD.
|
|
369
|
+
*/
|
|
370
|
+
total_referral_earnings_usd: number;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* A commission configuration for an affiliate, defining payout terms for a
|
|
375
|
+
* specific plan or revenue share
|
|
376
|
+
*/
|
|
377
|
+
export interface OverrideListResponse {
|
|
378
|
+
/**
|
|
379
|
+
* The unique identifier for the affiliate override.
|
|
380
|
+
*/
|
|
381
|
+
id: string;
|
|
382
|
+
|
|
383
|
+
/**
|
|
384
|
+
* Whether the affiliate commission applies to the first payment or all payments
|
|
385
|
+
*/
|
|
386
|
+
applies_to_payments: AffiliateAppliesToPayments | null;
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
* Whether a rev-share override applies to a single product or all products
|
|
390
|
+
*/
|
|
391
|
+
applies_to_products: AffiliateAppliesToProducts | null;
|
|
392
|
+
|
|
393
|
+
/**
|
|
394
|
+
* The checkout direct link for referrals (standard overrides only).
|
|
395
|
+
*/
|
|
396
|
+
checkout_direct_link: string | null;
|
|
397
|
+
|
|
398
|
+
/**
|
|
399
|
+
* The type of commission (percentage or flat_fee).
|
|
400
|
+
*/
|
|
401
|
+
commission_type: AffiliatePayoutTypes;
|
|
402
|
+
|
|
403
|
+
/**
|
|
404
|
+
* The commission amount. A percentage (1-100) when commission_type is percentage,
|
|
405
|
+
* or a dollar amount when flat_fee.
|
|
406
|
+
*/
|
|
407
|
+
commission_value: number;
|
|
408
|
+
|
|
409
|
+
/**
|
|
410
|
+
* The type of override (standard or rev_share).
|
|
411
|
+
*/
|
|
412
|
+
override_type: AffiliateOverrideRoles;
|
|
413
|
+
|
|
414
|
+
/**
|
|
415
|
+
* The plan ID (for standard overrides).
|
|
416
|
+
*/
|
|
417
|
+
plan_id: string | null;
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* The product page direct link for referrals (standard overrides only).
|
|
421
|
+
*/
|
|
422
|
+
product_direct_link: string | null;
|
|
423
|
+
|
|
424
|
+
/**
|
|
425
|
+
* The product ID (for rev-share overrides).
|
|
426
|
+
*/
|
|
427
|
+
product_id: string | null;
|
|
428
|
+
|
|
429
|
+
/**
|
|
430
|
+
* The calculation method for affiliate rev-share percentages
|
|
431
|
+
*/
|
|
432
|
+
revenue_basis: AffiliateRevenueBases | null;
|
|
433
|
+
|
|
434
|
+
/**
|
|
435
|
+
* The total earnings paid to this affiliate for referrals to this specific plan,
|
|
436
|
+
* in USD.
|
|
437
|
+
*/
|
|
438
|
+
total_referral_earnings_usd: number;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
/**
|
|
442
|
+
* Represents `true` or `false` values.
|
|
443
|
+
*/
|
|
444
|
+
export type OverrideDeleteResponse = boolean;
|
|
445
|
+
|
|
446
|
+
export type OverrideCreateParams =
|
|
447
|
+
| OverrideCreateParams.CreateAffiliateOverrideInputOverrideTypeStandard
|
|
448
|
+
| OverrideCreateParams.CreateAffiliateOverrideInputOverrideTypeRevShare;
|
|
449
|
+
|
|
450
|
+
export declare namespace OverrideCreateParams {
|
|
451
|
+
export interface CreateAffiliateOverrideInputOverrideTypeStandard {
|
|
452
|
+
/**
|
|
453
|
+
* The affiliate ID.
|
|
454
|
+
*/
|
|
455
|
+
id: string;
|
|
456
|
+
|
|
457
|
+
/**
|
|
458
|
+
* The commission value (percentage 1-100 or flat fee).
|
|
459
|
+
*/
|
|
460
|
+
commission_value: number;
|
|
461
|
+
|
|
462
|
+
override_type: 'standard';
|
|
463
|
+
|
|
464
|
+
/**
|
|
465
|
+
* The plan ID (required for standard overrides).
|
|
466
|
+
*/
|
|
467
|
+
plan_id: string;
|
|
468
|
+
|
|
469
|
+
/**
|
|
470
|
+
* Whether the affiliate commission applies to the first payment or all payments
|
|
471
|
+
*/
|
|
472
|
+
applies_to_payments?: AffiliateAppliesToPayments | null;
|
|
473
|
+
|
|
474
|
+
/**
|
|
475
|
+
* The types of payouts an affiliate can have
|
|
476
|
+
*/
|
|
477
|
+
commission_type?: AffiliatePayoutTypes | null;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
export interface CreateAffiliateOverrideInputOverrideTypeRevShare {
|
|
481
|
+
/**
|
|
482
|
+
* The affiliate ID.
|
|
483
|
+
*/
|
|
484
|
+
id: string;
|
|
485
|
+
|
|
486
|
+
/**
|
|
487
|
+
* The commission value (percentage 1-100 or flat fee).
|
|
488
|
+
*/
|
|
489
|
+
commission_value: number;
|
|
490
|
+
|
|
491
|
+
override_type: 'rev_share';
|
|
492
|
+
|
|
493
|
+
/**
|
|
494
|
+
* The types of payouts an affiliate can have
|
|
495
|
+
*/
|
|
496
|
+
commission_type?: AffiliatePayoutTypes | null;
|
|
497
|
+
|
|
498
|
+
/**
|
|
499
|
+
* The product ID (for rev-share overrides, omit for company-wide).
|
|
500
|
+
*/
|
|
501
|
+
product_id?: string | null;
|
|
502
|
+
|
|
503
|
+
/**
|
|
504
|
+
* The calculation method for affiliate rev-share percentages
|
|
505
|
+
*/
|
|
506
|
+
revenue_basis?: AffiliateRevenueBases | null;
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
export interface OverrideRetrieveParams {
|
|
511
|
+
/**
|
|
512
|
+
* The affiliate ID.
|
|
513
|
+
*/
|
|
514
|
+
id: string;
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
export interface OverrideUpdateParams {
|
|
518
|
+
/**
|
|
519
|
+
* Path param: The affiliate ID.
|
|
520
|
+
*/
|
|
521
|
+
id: string;
|
|
522
|
+
|
|
523
|
+
/**
|
|
524
|
+
* Body param: Whether the affiliate commission applies to the first payment or all
|
|
525
|
+
* payments
|
|
526
|
+
*/
|
|
527
|
+
applies_to_payments?: AffiliateAppliesToPayments | null;
|
|
528
|
+
|
|
529
|
+
/**
|
|
530
|
+
* Body param: The types of payouts an affiliate can have
|
|
531
|
+
*/
|
|
532
|
+
commission_type?: AffiliatePayoutTypes | null;
|
|
533
|
+
|
|
534
|
+
/**
|
|
535
|
+
* Body param: The commission value (percentage 1-100 or flat fee in dollars).
|
|
536
|
+
*/
|
|
537
|
+
commission_value?: number | null;
|
|
538
|
+
|
|
539
|
+
/**
|
|
540
|
+
* Body param: The calculation method for affiliate rev-share percentages
|
|
541
|
+
*/
|
|
542
|
+
revenue_basis?: AffiliateRevenueBases | null;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
export interface OverrideListParams extends CursorPageParams {
|
|
546
|
+
/**
|
|
547
|
+
* Returns the elements in the list that come before the specified cursor.
|
|
548
|
+
*/
|
|
549
|
+
before?: string | null;
|
|
550
|
+
|
|
551
|
+
/**
|
|
552
|
+
* Returns the first _n_ elements from the list.
|
|
553
|
+
*/
|
|
554
|
+
first?: number | null;
|
|
555
|
+
|
|
556
|
+
/**
|
|
557
|
+
* Returns the last _n_ elements from the list.
|
|
558
|
+
*/
|
|
559
|
+
last?: number | null;
|
|
560
|
+
|
|
561
|
+
/**
|
|
562
|
+
* The role of an affiliate override (standard or rev_share)
|
|
563
|
+
*/
|
|
564
|
+
override_type?: AffiliateOverrideRoles | null;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
export interface OverrideDeleteParams {
|
|
568
|
+
/**
|
|
569
|
+
* The affiliate ID.
|
|
570
|
+
*/
|
|
571
|
+
id: string;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
export declare namespace Overrides {
|
|
575
|
+
export {
|
|
576
|
+
type AffiliateAppliesToPayments as AffiliateAppliesToPayments,
|
|
577
|
+
type AffiliateAppliesToProducts as AffiliateAppliesToProducts,
|
|
578
|
+
type AffiliateOverrideRoles as AffiliateOverrideRoles,
|
|
579
|
+
type AffiliatePayoutTypes as AffiliatePayoutTypes,
|
|
580
|
+
type AffiliateRevenueBases as AffiliateRevenueBases,
|
|
581
|
+
type OverrideCreateResponse as OverrideCreateResponse,
|
|
582
|
+
type OverrideRetrieveResponse as OverrideRetrieveResponse,
|
|
583
|
+
type OverrideUpdateResponse as OverrideUpdateResponse,
|
|
584
|
+
type OverrideListResponse as OverrideListResponse,
|
|
585
|
+
type OverrideDeleteResponse as OverrideDeleteResponse,
|
|
586
|
+
type OverrideListResponsesCursorPage as OverrideListResponsesCursorPage,
|
|
587
|
+
type OverrideCreateParams as OverrideCreateParams,
|
|
588
|
+
type OverrideRetrieveParams as OverrideRetrieveParams,
|
|
589
|
+
type OverrideUpdateParams as OverrideUpdateParams,
|
|
590
|
+
type OverrideListParams as OverrideListParams,
|
|
591
|
+
type OverrideDeleteParams as OverrideDeleteParams,
|
|
592
|
+
};
|
|
593
|
+
}
|
|
@@ -29,7 +29,8 @@ export class AIChats extends APIResource {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
|
-
* Update an AI chat's title or associated company
|
|
32
|
+
* Update an AI chat's title, notification preferences, or associated company
|
|
33
|
+
* context.
|
|
33
34
|
*
|
|
34
35
|
* Required permissions:
|
|
35
36
|
*
|
|
@@ -98,6 +99,12 @@ export interface AIChat {
|
|
|
98
99
|
*/
|
|
99
100
|
message_count: number;
|
|
100
101
|
|
|
102
|
+
/**
|
|
103
|
+
* The notification preference for this AI chat. `all` delivers AI chat
|
|
104
|
+
* notifications and badges, while `none` mutes them.
|
|
105
|
+
*/
|
|
106
|
+
notification_preference: NotificationPreferences;
|
|
107
|
+
|
|
101
108
|
/**
|
|
102
109
|
* A short descriptive title for this AI chat conversation. Null if no title has
|
|
103
110
|
* been set.
|
|
@@ -127,6 +134,11 @@ export namespace AIChat {
|
|
|
127
134
|
}
|
|
128
135
|
}
|
|
129
136
|
|
|
137
|
+
/**
|
|
138
|
+
* The notification preference for an AI chat
|
|
139
|
+
*/
|
|
140
|
+
export type NotificationPreferences = 'all' | 'none';
|
|
141
|
+
|
|
130
142
|
/**
|
|
131
143
|
* An AI-powered chat conversation belonging to a user, with optional scheduled
|
|
132
144
|
* automation.
|
|
@@ -158,6 +170,12 @@ export interface AIChatListResponse {
|
|
|
158
170
|
*/
|
|
159
171
|
message_count: number;
|
|
160
172
|
|
|
173
|
+
/**
|
|
174
|
+
* The notification preference for this AI chat. `all` delivers AI chat
|
|
175
|
+
* notifications and badges, while `none` mutes them.
|
|
176
|
+
*/
|
|
177
|
+
notification_preference: NotificationPreferences;
|
|
178
|
+
|
|
161
179
|
/**
|
|
162
180
|
* A short descriptive title for this AI chat conversation. Null if no title has
|
|
163
181
|
* been set.
|
|
@@ -246,6 +264,11 @@ export interface AIChatUpdateParams {
|
|
|
246
264
|
*/
|
|
247
265
|
current_company_id?: string | null;
|
|
248
266
|
|
|
267
|
+
/**
|
|
268
|
+
* The notification preference for an AI chat
|
|
269
|
+
*/
|
|
270
|
+
notification_preference?: NotificationPreferences | null;
|
|
271
|
+
|
|
249
272
|
/**
|
|
250
273
|
* The new display title for the AI chat thread (e.g., "Help with billing").
|
|
251
274
|
*/
|
|
@@ -277,6 +300,7 @@ export interface AIChatListParams extends CursorPageParams {
|
|
|
277
300
|
export declare namespace AIChats {
|
|
278
301
|
export {
|
|
279
302
|
type AIChat as AIChat,
|
|
303
|
+
type NotificationPreferences as NotificationPreferences,
|
|
280
304
|
type AIChatListResponse as AIChatListResponse,
|
|
281
305
|
type AIChatDeleteResponse as AIChatDeleteResponse,
|
|
282
306
|
type AIChatListResponsesCursorPage as AIChatListResponsesCursorPage,
|
package/src/resources/apps.ts
CHANGED
|
@@ -176,6 +176,26 @@ export interface AppListResponse {
|
|
|
176
176
|
*/
|
|
177
177
|
name: string;
|
|
178
178
|
|
|
179
|
+
/**
|
|
180
|
+
* The URL path template for a specific view of this app, appended to the base
|
|
181
|
+
* domain (e.g., '/experiences/[experienceId]'). Null if the specified view type is
|
|
182
|
+
* not configured.
|
|
183
|
+
*/
|
|
184
|
+
openapi_path: string | null;
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* The full origin URL for this app's proxied domain (e.g.,
|
|
188
|
+
* 'https://myapp.apps.whop.com'). Null if no proxy domain is configured.
|
|
189
|
+
*/
|
|
190
|
+
origin: string | null;
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* The URL path template for a specific view of this app, appended to the base
|
|
194
|
+
* domain (e.g., '/experiences/[experienceId]'). Null if the specified view type is
|
|
195
|
+
* not configured.
|
|
196
|
+
*/
|
|
197
|
+
skills_path: string | null;
|
|
198
|
+
|
|
179
199
|
/**
|
|
180
200
|
* The current visibility status of this app on the Whop app store. 'live' means
|
|
181
201
|
* publicly discoverable, 'unlisted' means accessible only via direct link, and
|
|
@@ -334,6 +354,12 @@ export interface AppUpdateParams {
|
|
|
334
354
|
*/
|
|
335
355
|
oauth_client_type?: 'public' | 'confidential' | null;
|
|
336
356
|
|
|
357
|
+
/**
|
|
358
|
+
* The URL path to the OpenAPI spec file of the app, such as
|
|
359
|
+
* '/assets/openapi.json'.
|
|
360
|
+
*/
|
|
361
|
+
openapi_path?: string | null;
|
|
362
|
+
|
|
337
363
|
/**
|
|
338
364
|
* The whitelisted OAuth callback URLs that users are redirected to after
|
|
339
365
|
* authorizing the app
|
|
@@ -345,6 +371,11 @@ export interface AppUpdateParams {
|
|
|
345
371
|
*/
|
|
346
372
|
required_scopes?: Array<'read_user'> | null;
|
|
347
373
|
|
|
374
|
+
/**
|
|
375
|
+
* The URL path to the skills directory of the app, such as '/assets/skills/'.
|
|
376
|
+
*/
|
|
377
|
+
skills_path?: string | null;
|
|
378
|
+
|
|
348
379
|
/**
|
|
349
380
|
* The status of an experience interface
|
|
350
381
|
*/
|