@whop/sdk 0.0.34 → 0.0.35
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 +17 -0
- package/client.d.mts +8 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +8 -2
- package/client.d.ts.map +1 -1
- package/client.js +6 -0
- package/client.js.map +1 -1
- package/client.mjs +6 -0
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/affiliates/affiliates.d.mts +345 -0
- package/resources/affiliates/affiliates.d.mts.map +1 -0
- package/resources/affiliates/affiliates.d.ts +345 -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 +443 -0
- package/resources/affiliates/overrides.d.mts.map +1 -0
- package/resources/affiliates/overrides.d.ts +443 -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/index.d.mts +2 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +2 -1
- 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/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/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 +1 -1
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +1 -1
- package/resources/shared.d.ts.map +1 -1
- package/src/client.ts +30 -0
- package/src/resources/affiliates/affiliates.ts +467 -0
- package/src/resources/affiliates/index.ts +32 -0
- package/src/resources/affiliates/overrides.ts +585 -0
- package/src/resources/affiliates.ts +3 -0
- package/src/resources/ai-chats.ts +25 -1
- package/src/resources/index.ts +12 -0
- package/src/resources/payments.ts +1 -0
- package/src/resources/setup-intents.ts +90 -0
- package/src/resources/shared.ts +1 -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,585 @@
|
|
|
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
|
+
* An object storing information about the affiliate
|
|
171
|
+
*/
|
|
172
|
+
export interface OverrideCreateResponse {
|
|
173
|
+
/**
|
|
174
|
+
* The unique identifier for the affiliate override.
|
|
175
|
+
*/
|
|
176
|
+
id: string;
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Whether the affiliate commission applies to the first payment or all payments
|
|
180
|
+
*/
|
|
181
|
+
applies_to_payments: AffiliateAppliesToPayments | null;
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Whether a rev-share override applies to a single product or all products
|
|
185
|
+
*/
|
|
186
|
+
applies_to_products: AffiliateAppliesToProducts | null;
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* The checkout direct link for referrals (standard overrides only).
|
|
190
|
+
*/
|
|
191
|
+
checkout_direct_link: string | null;
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* The type of commission (percentage or flat_fee).
|
|
195
|
+
*/
|
|
196
|
+
commission_type: AffiliatePayoutTypes;
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* The commission value (percentage 1-100 or flat fee in dollars).
|
|
200
|
+
*/
|
|
201
|
+
commission_value: number;
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* The type of override (standard or rev_share).
|
|
205
|
+
*/
|
|
206
|
+
override_type: AffiliateOverrideRoles;
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* The plan ID (for standard overrides).
|
|
210
|
+
*/
|
|
211
|
+
plan_id: string | null;
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* The product page direct link for referrals (standard overrides only).
|
|
215
|
+
*/
|
|
216
|
+
product_direct_link: string | null;
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* The product ID (for rev-share overrides).
|
|
220
|
+
*/
|
|
221
|
+
product_id: string | null;
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* The calculation method for affiliate rev-share percentages
|
|
225
|
+
*/
|
|
226
|
+
revenue_basis: AffiliateRevenueBases | null;
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* The total earnings paid to this affiliate for referrals to this specific plan,
|
|
230
|
+
* in USD.
|
|
231
|
+
*/
|
|
232
|
+
total_referral_earnings_usd: number;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* An object storing information about the affiliate
|
|
237
|
+
*/
|
|
238
|
+
export interface OverrideRetrieveResponse {
|
|
239
|
+
/**
|
|
240
|
+
* The unique identifier for the affiliate override.
|
|
241
|
+
*/
|
|
242
|
+
id: string;
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Whether the affiliate commission applies to the first payment or all payments
|
|
246
|
+
*/
|
|
247
|
+
applies_to_payments: AffiliateAppliesToPayments | null;
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Whether a rev-share override applies to a single product or all products
|
|
251
|
+
*/
|
|
252
|
+
applies_to_products: AffiliateAppliesToProducts | null;
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* The checkout direct link for referrals (standard overrides only).
|
|
256
|
+
*/
|
|
257
|
+
checkout_direct_link: string | null;
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* The type of commission (percentage or flat_fee).
|
|
261
|
+
*/
|
|
262
|
+
commission_type: AffiliatePayoutTypes;
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* The commission value (percentage 1-100 or flat fee in dollars).
|
|
266
|
+
*/
|
|
267
|
+
commission_value: number;
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* The type of override (standard or rev_share).
|
|
271
|
+
*/
|
|
272
|
+
override_type: AffiliateOverrideRoles;
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* The plan ID (for standard overrides).
|
|
276
|
+
*/
|
|
277
|
+
plan_id: string | null;
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* The product page direct link for referrals (standard overrides only).
|
|
281
|
+
*/
|
|
282
|
+
product_direct_link: string | null;
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* The product ID (for rev-share overrides).
|
|
286
|
+
*/
|
|
287
|
+
product_id: string | null;
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* The calculation method for affiliate rev-share percentages
|
|
291
|
+
*/
|
|
292
|
+
revenue_basis: AffiliateRevenueBases | null;
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* The total earnings paid to this affiliate for referrals to this specific plan,
|
|
296
|
+
* in USD.
|
|
297
|
+
*/
|
|
298
|
+
total_referral_earnings_usd: number;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* An object storing information about the affiliate
|
|
303
|
+
*/
|
|
304
|
+
export interface OverrideUpdateResponse {
|
|
305
|
+
/**
|
|
306
|
+
* The unique identifier for the affiliate override.
|
|
307
|
+
*/
|
|
308
|
+
id: string;
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* Whether the affiliate commission applies to the first payment or all payments
|
|
312
|
+
*/
|
|
313
|
+
applies_to_payments: AffiliateAppliesToPayments | null;
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* Whether a rev-share override applies to a single product or all products
|
|
317
|
+
*/
|
|
318
|
+
applies_to_products: AffiliateAppliesToProducts | null;
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* The checkout direct link for referrals (standard overrides only).
|
|
322
|
+
*/
|
|
323
|
+
checkout_direct_link: string | null;
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* The type of commission (percentage or flat_fee).
|
|
327
|
+
*/
|
|
328
|
+
commission_type: AffiliatePayoutTypes;
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* The commission value (percentage 1-100 or flat fee in dollars).
|
|
332
|
+
*/
|
|
333
|
+
commission_value: number;
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* The type of override (standard or rev_share).
|
|
337
|
+
*/
|
|
338
|
+
override_type: AffiliateOverrideRoles;
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* The plan ID (for standard overrides).
|
|
342
|
+
*/
|
|
343
|
+
plan_id: string | null;
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* The product page direct link for referrals (standard overrides only).
|
|
347
|
+
*/
|
|
348
|
+
product_direct_link: string | null;
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* The product ID (for rev-share overrides).
|
|
352
|
+
*/
|
|
353
|
+
product_id: string | null;
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* The calculation method for affiliate rev-share percentages
|
|
357
|
+
*/
|
|
358
|
+
revenue_basis: AffiliateRevenueBases | null;
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* The total earnings paid to this affiliate for referrals to this specific plan,
|
|
362
|
+
* in USD.
|
|
363
|
+
*/
|
|
364
|
+
total_referral_earnings_usd: number;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
/**
|
|
368
|
+
* An object storing information about the affiliate
|
|
369
|
+
*/
|
|
370
|
+
export interface OverrideListResponse {
|
|
371
|
+
/**
|
|
372
|
+
* The unique identifier for the affiliate override.
|
|
373
|
+
*/
|
|
374
|
+
id: string;
|
|
375
|
+
|
|
376
|
+
/**
|
|
377
|
+
* Whether the affiliate commission applies to the first payment or all payments
|
|
378
|
+
*/
|
|
379
|
+
applies_to_payments: AffiliateAppliesToPayments | null;
|
|
380
|
+
|
|
381
|
+
/**
|
|
382
|
+
* Whether a rev-share override applies to a single product or all products
|
|
383
|
+
*/
|
|
384
|
+
applies_to_products: AffiliateAppliesToProducts | null;
|
|
385
|
+
|
|
386
|
+
/**
|
|
387
|
+
* The checkout direct link for referrals (standard overrides only).
|
|
388
|
+
*/
|
|
389
|
+
checkout_direct_link: string | null;
|
|
390
|
+
|
|
391
|
+
/**
|
|
392
|
+
* The type of commission (percentage or flat_fee).
|
|
393
|
+
*/
|
|
394
|
+
commission_type: AffiliatePayoutTypes;
|
|
395
|
+
|
|
396
|
+
/**
|
|
397
|
+
* The commission value (percentage 1-100 or flat fee in dollars).
|
|
398
|
+
*/
|
|
399
|
+
commission_value: number;
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* The type of override (standard or rev_share).
|
|
403
|
+
*/
|
|
404
|
+
override_type: AffiliateOverrideRoles;
|
|
405
|
+
|
|
406
|
+
/**
|
|
407
|
+
* The plan ID (for standard overrides).
|
|
408
|
+
*/
|
|
409
|
+
plan_id: string | null;
|
|
410
|
+
|
|
411
|
+
/**
|
|
412
|
+
* The product page direct link for referrals (standard overrides only).
|
|
413
|
+
*/
|
|
414
|
+
product_direct_link: string | null;
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* The product ID (for rev-share overrides).
|
|
418
|
+
*/
|
|
419
|
+
product_id: string | null;
|
|
420
|
+
|
|
421
|
+
/**
|
|
422
|
+
* The calculation method for affiliate rev-share percentages
|
|
423
|
+
*/
|
|
424
|
+
revenue_basis: AffiliateRevenueBases | null;
|
|
425
|
+
|
|
426
|
+
/**
|
|
427
|
+
* The total earnings paid to this affiliate for referrals to this specific plan,
|
|
428
|
+
* in USD.
|
|
429
|
+
*/
|
|
430
|
+
total_referral_earnings_usd: number;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
/**
|
|
434
|
+
* Represents `true` or `false` values.
|
|
435
|
+
*/
|
|
436
|
+
export type OverrideDeleteResponse = boolean;
|
|
437
|
+
|
|
438
|
+
export type OverrideCreateParams =
|
|
439
|
+
| OverrideCreateParams.CreateAffiliateOverrideInputOverrideTypeStandard
|
|
440
|
+
| OverrideCreateParams.CreateAffiliateOverrideInputOverrideTypeRevShare;
|
|
441
|
+
|
|
442
|
+
export declare namespace OverrideCreateParams {
|
|
443
|
+
export interface CreateAffiliateOverrideInputOverrideTypeStandard {
|
|
444
|
+
/**
|
|
445
|
+
* The affiliate ID.
|
|
446
|
+
*/
|
|
447
|
+
id: string;
|
|
448
|
+
|
|
449
|
+
/**
|
|
450
|
+
* The commission value (percentage 1-100 or flat fee).
|
|
451
|
+
*/
|
|
452
|
+
commission_value: number;
|
|
453
|
+
|
|
454
|
+
override_type: 'standard';
|
|
455
|
+
|
|
456
|
+
/**
|
|
457
|
+
* The plan ID (required for standard overrides).
|
|
458
|
+
*/
|
|
459
|
+
plan_id: string;
|
|
460
|
+
|
|
461
|
+
/**
|
|
462
|
+
* Whether the affiliate commission applies to the first payment or all payments
|
|
463
|
+
*/
|
|
464
|
+
applies_to_payments?: AffiliateAppliesToPayments | null;
|
|
465
|
+
|
|
466
|
+
/**
|
|
467
|
+
* The types of payouts an affiliate can have
|
|
468
|
+
*/
|
|
469
|
+
commission_type?: AffiliatePayoutTypes | null;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
export interface CreateAffiliateOverrideInputOverrideTypeRevShare {
|
|
473
|
+
/**
|
|
474
|
+
* The affiliate ID.
|
|
475
|
+
*/
|
|
476
|
+
id: string;
|
|
477
|
+
|
|
478
|
+
/**
|
|
479
|
+
* The commission value (percentage 1-100 or flat fee).
|
|
480
|
+
*/
|
|
481
|
+
commission_value: number;
|
|
482
|
+
|
|
483
|
+
override_type: 'rev_share';
|
|
484
|
+
|
|
485
|
+
/**
|
|
486
|
+
* The types of payouts an affiliate can have
|
|
487
|
+
*/
|
|
488
|
+
commission_type?: AffiliatePayoutTypes | null;
|
|
489
|
+
|
|
490
|
+
/**
|
|
491
|
+
* The product ID (for rev-share overrides, omit for company-wide).
|
|
492
|
+
*/
|
|
493
|
+
product_id?: string | null;
|
|
494
|
+
|
|
495
|
+
/**
|
|
496
|
+
* The calculation method for affiliate rev-share percentages
|
|
497
|
+
*/
|
|
498
|
+
revenue_basis?: AffiliateRevenueBases | null;
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
export interface OverrideRetrieveParams {
|
|
503
|
+
/**
|
|
504
|
+
* The affiliate ID.
|
|
505
|
+
*/
|
|
506
|
+
id: string;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
export interface OverrideUpdateParams {
|
|
510
|
+
/**
|
|
511
|
+
* Path param: The affiliate ID.
|
|
512
|
+
*/
|
|
513
|
+
id: string;
|
|
514
|
+
|
|
515
|
+
/**
|
|
516
|
+
* Body param: Whether the affiliate commission applies to the first payment or all
|
|
517
|
+
* payments
|
|
518
|
+
*/
|
|
519
|
+
applies_to_payments?: AffiliateAppliesToPayments | null;
|
|
520
|
+
|
|
521
|
+
/**
|
|
522
|
+
* Body param: The types of payouts an affiliate can have
|
|
523
|
+
*/
|
|
524
|
+
commission_type?: AffiliatePayoutTypes | null;
|
|
525
|
+
|
|
526
|
+
/**
|
|
527
|
+
* Body param: The commission value (percentage 1-100 or flat fee in dollars).
|
|
528
|
+
*/
|
|
529
|
+
commission_value?: number | null;
|
|
530
|
+
|
|
531
|
+
/**
|
|
532
|
+
* Body param: The calculation method for affiliate rev-share percentages
|
|
533
|
+
*/
|
|
534
|
+
revenue_basis?: AffiliateRevenueBases | null;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
export interface OverrideListParams extends CursorPageParams {
|
|
538
|
+
/**
|
|
539
|
+
* Returns the elements in the list that come before the specified cursor.
|
|
540
|
+
*/
|
|
541
|
+
before?: string | null;
|
|
542
|
+
|
|
543
|
+
/**
|
|
544
|
+
* Returns the first _n_ elements from the list.
|
|
545
|
+
*/
|
|
546
|
+
first?: number | null;
|
|
547
|
+
|
|
548
|
+
/**
|
|
549
|
+
* Returns the last _n_ elements from the list.
|
|
550
|
+
*/
|
|
551
|
+
last?: number | null;
|
|
552
|
+
|
|
553
|
+
/**
|
|
554
|
+
* The role of an affiliate override (standard or rev_share)
|
|
555
|
+
*/
|
|
556
|
+
override_type?: AffiliateOverrideRoles | null;
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
export interface OverrideDeleteParams {
|
|
560
|
+
/**
|
|
561
|
+
* The affiliate ID.
|
|
562
|
+
*/
|
|
563
|
+
id: string;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
export declare namespace Overrides {
|
|
567
|
+
export {
|
|
568
|
+
type AffiliateAppliesToPayments as AffiliateAppliesToPayments,
|
|
569
|
+
type AffiliateAppliesToProducts as AffiliateAppliesToProducts,
|
|
570
|
+
type AffiliateOverrideRoles as AffiliateOverrideRoles,
|
|
571
|
+
type AffiliatePayoutTypes as AffiliatePayoutTypes,
|
|
572
|
+
type AffiliateRevenueBases as AffiliateRevenueBases,
|
|
573
|
+
type OverrideCreateResponse as OverrideCreateResponse,
|
|
574
|
+
type OverrideRetrieveResponse as OverrideRetrieveResponse,
|
|
575
|
+
type OverrideUpdateResponse as OverrideUpdateResponse,
|
|
576
|
+
type OverrideListResponse as OverrideListResponse,
|
|
577
|
+
type OverrideDeleteResponse as OverrideDeleteResponse,
|
|
578
|
+
type OverrideListResponsesCursorPage as OverrideListResponsesCursorPage,
|
|
579
|
+
type OverrideCreateParams as OverrideCreateParams,
|
|
580
|
+
type OverrideRetrieveParams as OverrideRetrieveParams,
|
|
581
|
+
type OverrideUpdateParams as OverrideUpdateParams,
|
|
582
|
+
type OverrideListParams as OverrideListParams,
|
|
583
|
+
type OverrideDeleteParams as OverrideDeleteParams,
|
|
584
|
+
};
|
|
585
|
+
}
|
|
@@ -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/index.ts
CHANGED
|
@@ -4,6 +4,7 @@ export * from './shared';
|
|
|
4
4
|
export {
|
|
5
5
|
AIChats,
|
|
6
6
|
type AIChat,
|
|
7
|
+
type NotificationPreferences,
|
|
7
8
|
type AIChatListResponse,
|
|
8
9
|
type AIChatDeleteResponse,
|
|
9
10
|
type AIChatCreateParams,
|
|
@@ -13,6 +14,17 @@ export {
|
|
|
13
14
|
} from './ai-chats';
|
|
14
15
|
export { AccessTokens, type AccessTokenCreateResponse, type AccessTokenCreateParams } from './access-tokens';
|
|
15
16
|
export { AccountLinks, type AccountLinkCreateResponse, type AccountLinkCreateParams } from './account-links';
|
|
17
|
+
export {
|
|
18
|
+
Affiliates,
|
|
19
|
+
type Affiliate,
|
|
20
|
+
type Status,
|
|
21
|
+
type AffiliateListResponse,
|
|
22
|
+
type AffiliateArchiveResponse,
|
|
23
|
+
type AffiliateUnarchiveResponse,
|
|
24
|
+
type AffiliateCreateParams,
|
|
25
|
+
type AffiliateListParams,
|
|
26
|
+
type AffiliateListResponsesCursorPage,
|
|
27
|
+
} from './affiliates/affiliates';
|
|
16
28
|
export {
|
|
17
29
|
AppBuilds,
|
|
18
30
|
type AppBuildListResponse,
|