@outseta/react 0.2.0 → 0.2.2
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/package.json +2 -2
- package/src/generated/activity/activity.ts +175 -0
- package/src/generated/billing/billing.ts +1113 -0
- package/src/generated/crm/crm.ts +1529 -284
- package/src/generated/email/email.ts +772 -0
- package/src/generated/outsetaAPI.schemas.ts +1372 -322
- package/src/generated/support/support.ts +478 -221
- package/src/mutator.ts +32 -11
|
@@ -0,0 +1,1113 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import {
|
|
3
|
+
useMutation,
|
|
4
|
+
useQuery
|
|
5
|
+
} from '@tanstack/react-query';
|
|
6
|
+
import type {
|
|
7
|
+
MutationFunction,
|
|
8
|
+
QueryFunction,
|
|
9
|
+
QueryKey,
|
|
10
|
+
UseMutationOptions,
|
|
11
|
+
UseMutationResult,
|
|
12
|
+
UseQueryOptions,
|
|
13
|
+
UseQueryResult
|
|
14
|
+
} from '@tanstack/react-query';
|
|
15
|
+
|
|
16
|
+
import type {
|
|
17
|
+
DiscountCoupon,
|
|
18
|
+
DiscountCouponAddDiscountCouponBody,
|
|
19
|
+
Invoice,
|
|
20
|
+
InvoiceAddInvoiceBody,
|
|
21
|
+
PaymentInformation,
|
|
22
|
+
PaymentInformationSavePaymentInformationBody,
|
|
23
|
+
Plan,
|
|
24
|
+
PlanFamily,
|
|
25
|
+
Subscription,
|
|
26
|
+
SubscriptionAddOnAddSubscriptionAddOnBody,
|
|
27
|
+
SubscriptionChangeSubscriptionBody,
|
|
28
|
+
SubscriptionChangeSubscriptionParams,
|
|
29
|
+
SubscriptionChangeSubscriptionPreviewBody,
|
|
30
|
+
SubscriptionChangeSubscriptionPreviewParams,
|
|
31
|
+
SubscriptionFirstTimeSubscriptionBody,
|
|
32
|
+
SubscriptionFirstTimeSubscriptionPreviewBody,
|
|
33
|
+
SubscriptionFirstTimeSubscriptionPreviewParams,
|
|
34
|
+
SubscriptionSetSubscriptionUpgradeRequiredBody,
|
|
35
|
+
Transaction,
|
|
36
|
+
TransactionsAddPaymentTransactionBody,
|
|
37
|
+
Usage,
|
|
38
|
+
UsageAddUsageBody
|
|
39
|
+
} from '../outsetaAPI.schemas';
|
|
40
|
+
|
|
41
|
+
import { customFetch } from '../../mutator';
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* @summary Add a new discount coupon. Only one of AmountOff or PercentOff should be set.
|
|
50
|
+
Duration values: 1 = Forever, 2 = Once, 3 = Repeating (DurationInMonths must be set).
|
|
51
|
+
*/
|
|
52
|
+
export const discountCouponAddDiscountCoupon = (
|
|
53
|
+
discountCouponAddDiscountCouponBody: DiscountCouponAddDiscountCouponBody,
|
|
54
|
+
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
55
|
+
) => {
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
return customFetch<DiscountCoupon>(
|
|
59
|
+
{url: `/api/v1/billing/discountcoupons`, method: 'POST',
|
|
60
|
+
headers: {'Content-Type': 'application/json', },
|
|
61
|
+
data: discountCouponAddDiscountCouponBody, signal
|
|
62
|
+
},
|
|
63
|
+
options);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
export const getDiscountCouponAddDiscountCouponMutationOptions = <TError = void,
|
|
69
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof discountCouponAddDiscountCoupon>>, TError,{data: DiscountCouponAddDiscountCouponBody}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
70
|
+
): UseMutationOptions<Awaited<ReturnType<typeof discountCouponAddDiscountCoupon>>, TError,{data: DiscountCouponAddDiscountCouponBody}, TContext> => {
|
|
71
|
+
|
|
72
|
+
const mutationKey = ['discountCouponAddDiscountCoupon'];
|
|
73
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
74
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
75
|
+
options
|
|
76
|
+
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
77
|
+
: {mutation: { mutationKey, }, request: undefined};
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof discountCouponAddDiscountCoupon>>, {data: DiscountCouponAddDiscountCouponBody}> = (props) => {
|
|
83
|
+
const {data} = props ?? {};
|
|
84
|
+
|
|
85
|
+
return discountCouponAddDiscountCoupon(data,requestOptions)
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
return { mutationFn, ...mutationOptions }}
|
|
92
|
+
|
|
93
|
+
export type DiscountCouponAddDiscountCouponMutationResult = NonNullable<Awaited<ReturnType<typeof discountCouponAddDiscountCoupon>>>
|
|
94
|
+
export type DiscountCouponAddDiscountCouponMutationBody = DiscountCouponAddDiscountCouponBody
|
|
95
|
+
export type DiscountCouponAddDiscountCouponMutationError = void
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* @summary Add a new discount coupon. Only one of AmountOff or PercentOff should be set.
|
|
99
|
+
Duration values: 1 = Forever, 2 = Once, 3 = Repeating (DurationInMonths must be set).
|
|
100
|
+
*/
|
|
101
|
+
export const useDiscountCouponAddDiscountCoupon = <TError = void,
|
|
102
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof discountCouponAddDiscountCoupon>>, TError,{data: DiscountCouponAddDiscountCouponBody}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
103
|
+
): UseMutationResult<
|
|
104
|
+
Awaited<ReturnType<typeof discountCouponAddDiscountCoupon>>,
|
|
105
|
+
TError,
|
|
106
|
+
{data: DiscountCouponAddDiscountCouponBody},
|
|
107
|
+
TContext
|
|
108
|
+
> => {
|
|
109
|
+
|
|
110
|
+
const mutationOptions = getDiscountCouponAddDiscountCouponMutationOptions(options);
|
|
111
|
+
|
|
112
|
+
return useMutation(mutationOptions);
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* @summary Add a usage entry for an add-on that bills for usage at the end of the month.
|
|
116
|
+
*/
|
|
117
|
+
export const usageAddUsage = (
|
|
118
|
+
usageAddUsageBody: UsageAddUsageBody,
|
|
119
|
+
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
120
|
+
) => {
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
return customFetch<Usage>(
|
|
124
|
+
{url: `/api/v1/billing/usage`, method: 'POST',
|
|
125
|
+
headers: {'Content-Type': 'application/json', },
|
|
126
|
+
data: usageAddUsageBody, signal
|
|
127
|
+
},
|
|
128
|
+
options);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
export const getUsageAddUsageMutationOptions = <TError = void,
|
|
134
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof usageAddUsage>>, TError,{data: UsageAddUsageBody}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
135
|
+
): UseMutationOptions<Awaited<ReturnType<typeof usageAddUsage>>, TError,{data: UsageAddUsageBody}, TContext> => {
|
|
136
|
+
|
|
137
|
+
const mutationKey = ['usageAddUsage'];
|
|
138
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
139
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
140
|
+
options
|
|
141
|
+
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
142
|
+
: {mutation: { mutationKey, }, request: undefined};
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof usageAddUsage>>, {data: UsageAddUsageBody}> = (props) => {
|
|
148
|
+
const {data} = props ?? {};
|
|
149
|
+
|
|
150
|
+
return usageAddUsage(data,requestOptions)
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
return { mutationFn, ...mutationOptions }}
|
|
157
|
+
|
|
158
|
+
export type UsageAddUsageMutationResult = NonNullable<Awaited<ReturnType<typeof usageAddUsage>>>
|
|
159
|
+
export type UsageAddUsageMutationBody = UsageAddUsageBody
|
|
160
|
+
export type UsageAddUsageMutationError = void
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* @summary Add a usage entry for an add-on that bills for usage at the end of the month.
|
|
164
|
+
*/
|
|
165
|
+
export const useUsageAddUsage = <TError = void,
|
|
166
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof usageAddUsage>>, TError,{data: UsageAddUsageBody}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
167
|
+
): UseMutationResult<
|
|
168
|
+
Awaited<ReturnType<typeof usageAddUsage>>,
|
|
169
|
+
TError,
|
|
170
|
+
{data: UsageAddUsageBody},
|
|
171
|
+
TContext
|
|
172
|
+
> => {
|
|
173
|
+
|
|
174
|
+
const mutationOptions = getUsageAddUsageMutationOptions(options);
|
|
175
|
+
|
|
176
|
+
return useMutation(mutationOptions);
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* @summary Retrieves all transactions for a given account. Transactions are tied to accounts and invoices.
|
|
180
|
+
BillingTransactionType: Invoice = 1, Payment = 2, Credit = 3, Refund = 4, Chargeback = 5.
|
|
181
|
+
*/
|
|
182
|
+
export const transactionsGetAllTransactionsByAccountId = (
|
|
183
|
+
accountUid: string | null,
|
|
184
|
+
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
185
|
+
) => {
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
return customFetch<Transaction[]>(
|
|
189
|
+
{url: `/api/v1/billing/transactions/${accountUid}`, method: 'GET', signal
|
|
190
|
+
},
|
|
191
|
+
options);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
export const getTransactionsGetAllTransactionsByAccountIdQueryKey = (accountUid?: string | null,) => {
|
|
198
|
+
return [
|
|
199
|
+
`/api/v1/billing/transactions/${accountUid}`
|
|
200
|
+
] as const;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
export const getTransactionsGetAllTransactionsByAccountIdQueryOptions = <TData = Awaited<ReturnType<typeof transactionsGetAllTransactionsByAccountId>>, TError = void>(accountUid: string | null, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof transactionsGetAllTransactionsByAccountId>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
205
|
+
) => {
|
|
206
|
+
|
|
207
|
+
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
208
|
+
|
|
209
|
+
const queryKey = queryOptions?.queryKey ?? getTransactionsGetAllTransactionsByAccountIdQueryKey(accountUid);
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof transactionsGetAllTransactionsByAccountId>>> = ({ signal }) => transactionsGetAllTransactionsByAccountId(accountUid, requestOptions, signal);
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
return { queryKey, queryFn, enabled: !!(accountUid), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof transactionsGetAllTransactionsByAccountId>>, TError, TData> & { queryKey: QueryKey }
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
export type TransactionsGetAllTransactionsByAccountIdQueryResult = NonNullable<Awaited<ReturnType<typeof transactionsGetAllTransactionsByAccountId>>>
|
|
223
|
+
export type TransactionsGetAllTransactionsByAccountIdQueryError = void
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* @summary Retrieves all transactions for a given account. Transactions are tied to accounts and invoices.
|
|
228
|
+
BillingTransactionType: Invoice = 1, Payment = 2, Credit = 3, Refund = 4, Chargeback = 5.
|
|
229
|
+
*/
|
|
230
|
+
|
|
231
|
+
export function useTransactionsGetAllTransactionsByAccountId<TData = Awaited<ReturnType<typeof transactionsGetAllTransactionsByAccountId>>, TError = void>(
|
|
232
|
+
accountUid: string | null, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof transactionsGetAllTransactionsByAccountId>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
233
|
+
|
|
234
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
|
|
235
|
+
|
|
236
|
+
const queryOptions = getTransactionsGetAllTransactionsByAccountIdQueryOptions(accountUid,options)
|
|
237
|
+
|
|
238
|
+
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
239
|
+
|
|
240
|
+
query.queryKey = queryOptions.queryKey ;
|
|
241
|
+
|
|
242
|
+
return query;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* @summary Adds a payment to an invoice. If the amount matches the outstanding amount of the invoice,
|
|
250
|
+
the invoice will be marked as Paid.
|
|
251
|
+
*/
|
|
252
|
+
export const transactionsAddPaymentTransaction = (
|
|
253
|
+
transactionsAddPaymentTransactionBody: TransactionsAddPaymentTransactionBody,
|
|
254
|
+
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
255
|
+
) => {
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
return customFetch<Transaction>(
|
|
259
|
+
{url: `/api/v1/billing/transactions/payment`, method: 'POST',
|
|
260
|
+
headers: {'Content-Type': 'application/json', },
|
|
261
|
+
data: transactionsAddPaymentTransactionBody, signal
|
|
262
|
+
},
|
|
263
|
+
options);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
export const getTransactionsAddPaymentTransactionMutationOptions = <TError = void,
|
|
269
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof transactionsAddPaymentTransaction>>, TError,{data: TransactionsAddPaymentTransactionBody}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
270
|
+
): UseMutationOptions<Awaited<ReturnType<typeof transactionsAddPaymentTransaction>>, TError,{data: TransactionsAddPaymentTransactionBody}, TContext> => {
|
|
271
|
+
|
|
272
|
+
const mutationKey = ['transactionsAddPaymentTransaction'];
|
|
273
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
274
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
275
|
+
options
|
|
276
|
+
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
277
|
+
: {mutation: { mutationKey, }, request: undefined};
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof transactionsAddPaymentTransaction>>, {data: TransactionsAddPaymentTransactionBody}> = (props) => {
|
|
283
|
+
const {data} = props ?? {};
|
|
284
|
+
|
|
285
|
+
return transactionsAddPaymentTransaction(data,requestOptions)
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
return { mutationFn, ...mutationOptions }}
|
|
292
|
+
|
|
293
|
+
export type TransactionsAddPaymentTransactionMutationResult = NonNullable<Awaited<ReturnType<typeof transactionsAddPaymentTransaction>>>
|
|
294
|
+
export type TransactionsAddPaymentTransactionMutationBody = TransactionsAddPaymentTransactionBody
|
|
295
|
+
export type TransactionsAddPaymentTransactionMutationError = void
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* @summary Adds a payment to an invoice. If the amount matches the outstanding amount of the invoice,
|
|
299
|
+
the invoice will be marked as Paid.
|
|
300
|
+
*/
|
|
301
|
+
export const useTransactionsAddPaymentTransaction = <TError = void,
|
|
302
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof transactionsAddPaymentTransaction>>, TError,{data: TransactionsAddPaymentTransactionBody}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
303
|
+
): UseMutationResult<
|
|
304
|
+
Awaited<ReturnType<typeof transactionsAddPaymentTransaction>>,
|
|
305
|
+
TError,
|
|
306
|
+
{data: TransactionsAddPaymentTransactionBody},
|
|
307
|
+
TContext
|
|
308
|
+
> => {
|
|
309
|
+
|
|
310
|
+
const mutationOptions = getTransactionsAddPaymentTransactionMutationOptions(options);
|
|
311
|
+
|
|
312
|
+
return useMutation(mutationOptions);
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* @summary Update payment information for an account.
|
|
316
|
+
*/
|
|
317
|
+
export const paymentInformationSavePaymentInformation = (
|
|
318
|
+
paymentInformationSavePaymentInformationBody: PaymentInformationSavePaymentInformationBody,
|
|
319
|
+
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
320
|
+
) => {
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
return customFetch<PaymentInformation>(
|
|
324
|
+
{url: `/api/v1/billing/paymentinformation`, method: 'POST',
|
|
325
|
+
headers: {'Content-Type': 'application/json', },
|
|
326
|
+
data: paymentInformationSavePaymentInformationBody, signal
|
|
327
|
+
},
|
|
328
|
+
options);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
export const getPaymentInformationSavePaymentInformationMutationOptions = <TError = void,
|
|
334
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof paymentInformationSavePaymentInformation>>, TError,{data: PaymentInformationSavePaymentInformationBody}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
335
|
+
): UseMutationOptions<Awaited<ReturnType<typeof paymentInformationSavePaymentInformation>>, TError,{data: PaymentInformationSavePaymentInformationBody}, TContext> => {
|
|
336
|
+
|
|
337
|
+
const mutationKey = ['paymentInformationSavePaymentInformation'];
|
|
338
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
339
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
340
|
+
options
|
|
341
|
+
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
342
|
+
: {mutation: { mutationKey, }, request: undefined};
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof paymentInformationSavePaymentInformation>>, {data: PaymentInformationSavePaymentInformationBody}> = (props) => {
|
|
348
|
+
const {data} = props ?? {};
|
|
349
|
+
|
|
350
|
+
return paymentInformationSavePaymentInformation(data,requestOptions)
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
|
|
356
|
+
return { mutationFn, ...mutationOptions }}
|
|
357
|
+
|
|
358
|
+
export type PaymentInformationSavePaymentInformationMutationResult = NonNullable<Awaited<ReturnType<typeof paymentInformationSavePaymentInformation>>>
|
|
359
|
+
export type PaymentInformationSavePaymentInformationMutationBody = PaymentInformationSavePaymentInformationBody
|
|
360
|
+
export type PaymentInformationSavePaymentInformationMutationError = void
|
|
361
|
+
|
|
362
|
+
/**
|
|
363
|
+
* @summary Update payment information for an account.
|
|
364
|
+
*/
|
|
365
|
+
export const usePaymentInformationSavePaymentInformation = <TError = void,
|
|
366
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof paymentInformationSavePaymentInformation>>, TError,{data: PaymentInformationSavePaymentInformationBody}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
367
|
+
): UseMutationResult<
|
|
368
|
+
Awaited<ReturnType<typeof paymentInformationSavePaymentInformation>>,
|
|
369
|
+
TError,
|
|
370
|
+
{data: PaymentInformationSavePaymentInformationBody},
|
|
371
|
+
TContext
|
|
372
|
+
> => {
|
|
373
|
+
|
|
374
|
+
const mutationOptions = getPaymentInformationSavePaymentInformationMutationOptions(options);
|
|
375
|
+
|
|
376
|
+
return useMutation(mutationOptions);
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* @summary Add an add-on to a subscription.
|
|
380
|
+
*/
|
|
381
|
+
export const subscriptionAddOnAddSubscriptionAddOn = (
|
|
382
|
+
subscriptionAddOnAddSubscriptionAddOnBody: SubscriptionAddOnAddSubscriptionAddOnBody,
|
|
383
|
+
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
384
|
+
) => {
|
|
385
|
+
|
|
386
|
+
|
|
387
|
+
return customFetch<Blob>(
|
|
388
|
+
{url: `/api/v1/billing/subscriptionaddons`, method: 'POST',
|
|
389
|
+
headers: {'Content-Type': 'application/json', },
|
|
390
|
+
data: subscriptionAddOnAddSubscriptionAddOnBody,
|
|
391
|
+
responseType: 'blob', signal
|
|
392
|
+
},
|
|
393
|
+
options);
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
|
|
397
|
+
|
|
398
|
+
export const getSubscriptionAddOnAddSubscriptionAddOnMutationOptions = <TError = void,
|
|
399
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof subscriptionAddOnAddSubscriptionAddOn>>, TError,{data: SubscriptionAddOnAddSubscriptionAddOnBody}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
400
|
+
): UseMutationOptions<Awaited<ReturnType<typeof subscriptionAddOnAddSubscriptionAddOn>>, TError,{data: SubscriptionAddOnAddSubscriptionAddOnBody}, TContext> => {
|
|
401
|
+
|
|
402
|
+
const mutationKey = ['subscriptionAddOnAddSubscriptionAddOn'];
|
|
403
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
404
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
405
|
+
options
|
|
406
|
+
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
407
|
+
: {mutation: { mutationKey, }, request: undefined};
|
|
408
|
+
|
|
409
|
+
|
|
410
|
+
|
|
411
|
+
|
|
412
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof subscriptionAddOnAddSubscriptionAddOn>>, {data: SubscriptionAddOnAddSubscriptionAddOnBody}> = (props) => {
|
|
413
|
+
const {data} = props ?? {};
|
|
414
|
+
|
|
415
|
+
return subscriptionAddOnAddSubscriptionAddOn(data,requestOptions)
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
|
|
419
|
+
|
|
420
|
+
|
|
421
|
+
return { mutationFn, ...mutationOptions }}
|
|
422
|
+
|
|
423
|
+
export type SubscriptionAddOnAddSubscriptionAddOnMutationResult = NonNullable<Awaited<ReturnType<typeof subscriptionAddOnAddSubscriptionAddOn>>>
|
|
424
|
+
export type SubscriptionAddOnAddSubscriptionAddOnMutationBody = SubscriptionAddOnAddSubscriptionAddOnBody
|
|
425
|
+
export type SubscriptionAddOnAddSubscriptionAddOnMutationError = void
|
|
426
|
+
|
|
427
|
+
/**
|
|
428
|
+
* @summary Add an add-on to a subscription.
|
|
429
|
+
*/
|
|
430
|
+
export const useSubscriptionAddOnAddSubscriptionAddOn = <TError = void,
|
|
431
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof subscriptionAddOnAddSubscriptionAddOn>>, TError,{data: SubscriptionAddOnAddSubscriptionAddOnBody}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
432
|
+
): UseMutationResult<
|
|
433
|
+
Awaited<ReturnType<typeof subscriptionAddOnAddSubscriptionAddOn>>,
|
|
434
|
+
TError,
|
|
435
|
+
{data: SubscriptionAddOnAddSubscriptionAddOnBody},
|
|
436
|
+
TContext
|
|
437
|
+
> => {
|
|
438
|
+
|
|
439
|
+
const mutationOptions = getSubscriptionAddOnAddSubscriptionAddOnMutationOptions(options);
|
|
440
|
+
|
|
441
|
+
return useMutation(mutationOptions);
|
|
442
|
+
}
|
|
443
|
+
/**
|
|
444
|
+
* @summary Create an ad-hoc invoice for a given account.
|
|
445
|
+
*/
|
|
446
|
+
export const invoiceAddInvoice = (
|
|
447
|
+
invoiceAddInvoiceBody: InvoiceAddInvoiceBody,
|
|
448
|
+
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
449
|
+
) => {
|
|
450
|
+
|
|
451
|
+
|
|
452
|
+
return customFetch<Invoice>(
|
|
453
|
+
{url: `/api/v1/billing/invoices`, method: 'POST',
|
|
454
|
+
headers: {'Content-Type': 'application/json', },
|
|
455
|
+
data: invoiceAddInvoiceBody, signal
|
|
456
|
+
},
|
|
457
|
+
options);
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
|
|
461
|
+
|
|
462
|
+
export const getInvoiceAddInvoiceMutationOptions = <TError = void,
|
|
463
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof invoiceAddInvoice>>, TError,{data: InvoiceAddInvoiceBody}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
464
|
+
): UseMutationOptions<Awaited<ReturnType<typeof invoiceAddInvoice>>, TError,{data: InvoiceAddInvoiceBody}, TContext> => {
|
|
465
|
+
|
|
466
|
+
const mutationKey = ['invoiceAddInvoice'];
|
|
467
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
468
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
469
|
+
options
|
|
470
|
+
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
471
|
+
: {mutation: { mutationKey, }, request: undefined};
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
|
|
475
|
+
|
|
476
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof invoiceAddInvoice>>, {data: InvoiceAddInvoiceBody}> = (props) => {
|
|
477
|
+
const {data} = props ?? {};
|
|
478
|
+
|
|
479
|
+
return invoiceAddInvoice(data,requestOptions)
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
|
|
483
|
+
|
|
484
|
+
|
|
485
|
+
return { mutationFn, ...mutationOptions }}
|
|
486
|
+
|
|
487
|
+
export type InvoiceAddInvoiceMutationResult = NonNullable<Awaited<ReturnType<typeof invoiceAddInvoice>>>
|
|
488
|
+
export type InvoiceAddInvoiceMutationBody = InvoiceAddInvoiceBody
|
|
489
|
+
export type InvoiceAddInvoiceMutationError = void
|
|
490
|
+
|
|
491
|
+
/**
|
|
492
|
+
* @summary Create an ad-hoc invoice for a given account.
|
|
493
|
+
*/
|
|
494
|
+
export const useInvoiceAddInvoice = <TError = void,
|
|
495
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof invoiceAddInvoice>>, TError,{data: InvoiceAddInvoiceBody}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
496
|
+
): UseMutationResult<
|
|
497
|
+
Awaited<ReturnType<typeof invoiceAddInvoice>>,
|
|
498
|
+
TError,
|
|
499
|
+
{data: InvoiceAddInvoiceBody},
|
|
500
|
+
TContext
|
|
501
|
+
> => {
|
|
502
|
+
|
|
503
|
+
const mutationOptions = getInvoiceAddInvoiceMutationOptions(options);
|
|
504
|
+
|
|
505
|
+
return useMutation(mutationOptions);
|
|
506
|
+
}
|
|
507
|
+
/**
|
|
508
|
+
* @summary Retrieves a subscription.
|
|
509
|
+
*/
|
|
510
|
+
export const subscriptionGetSubscription = (
|
|
511
|
+
subscriptionUid: string | null,
|
|
512
|
+
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
513
|
+
) => {
|
|
514
|
+
|
|
515
|
+
|
|
516
|
+
return customFetch<Subscription>(
|
|
517
|
+
{url: `/api/v1/billing/subscriptions/${subscriptionUid}`, method: 'GET', signal
|
|
518
|
+
},
|
|
519
|
+
options);
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
|
|
523
|
+
|
|
524
|
+
|
|
525
|
+
export const getSubscriptionGetSubscriptionQueryKey = (subscriptionUid?: string | null,) => {
|
|
526
|
+
return [
|
|
527
|
+
`/api/v1/billing/subscriptions/${subscriptionUid}`
|
|
528
|
+
] as const;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
|
|
532
|
+
export const getSubscriptionGetSubscriptionQueryOptions = <TData = Awaited<ReturnType<typeof subscriptionGetSubscription>>, TError = void>(subscriptionUid: string | null, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof subscriptionGetSubscription>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
533
|
+
) => {
|
|
534
|
+
|
|
535
|
+
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
536
|
+
|
|
537
|
+
const queryKey = queryOptions?.queryKey ?? getSubscriptionGetSubscriptionQueryKey(subscriptionUid);
|
|
538
|
+
|
|
539
|
+
|
|
540
|
+
|
|
541
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof subscriptionGetSubscription>>> = ({ signal }) => subscriptionGetSubscription(subscriptionUid, requestOptions, signal);
|
|
542
|
+
|
|
543
|
+
|
|
544
|
+
|
|
545
|
+
|
|
546
|
+
|
|
547
|
+
return { queryKey, queryFn, enabled: !!(subscriptionUid), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof subscriptionGetSubscription>>, TError, TData> & { queryKey: QueryKey }
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
export type SubscriptionGetSubscriptionQueryResult = NonNullable<Awaited<ReturnType<typeof subscriptionGetSubscription>>>
|
|
551
|
+
export type SubscriptionGetSubscriptionQueryError = void
|
|
552
|
+
|
|
553
|
+
|
|
554
|
+
/**
|
|
555
|
+
* @summary Retrieves a subscription.
|
|
556
|
+
*/
|
|
557
|
+
|
|
558
|
+
export function useSubscriptionGetSubscription<TData = Awaited<ReturnType<typeof subscriptionGetSubscription>>, TError = void>(
|
|
559
|
+
subscriptionUid: string | null, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof subscriptionGetSubscription>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
560
|
+
|
|
561
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
|
|
562
|
+
|
|
563
|
+
const queryOptions = getSubscriptionGetSubscriptionQueryOptions(subscriptionUid,options)
|
|
564
|
+
|
|
565
|
+
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
566
|
+
|
|
567
|
+
query.queryKey = queryOptions.queryKey ;
|
|
568
|
+
|
|
569
|
+
return query;
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
|
|
573
|
+
|
|
574
|
+
|
|
575
|
+
/**
|
|
576
|
+
* @summary Add a discount to a subscription.
|
|
577
|
+
*/
|
|
578
|
+
export const subscriptionAddDiscountToSubscription = (
|
|
579
|
+
subscriptionUid: string | null,
|
|
580
|
+
discountUid: string | null,
|
|
581
|
+
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
582
|
+
) => {
|
|
583
|
+
|
|
584
|
+
|
|
585
|
+
return customFetch<Blob>(
|
|
586
|
+
{url: `/api/v1/billing/subscriptions/${subscriptionUid}/discounts/${discountUid}`, method: 'POST',
|
|
587
|
+
responseType: 'blob', signal
|
|
588
|
+
},
|
|
589
|
+
options);
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
|
|
593
|
+
|
|
594
|
+
export const getSubscriptionAddDiscountToSubscriptionMutationOptions = <TError = void,
|
|
595
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof subscriptionAddDiscountToSubscription>>, TError,{subscriptionUid: string | null;discountUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
596
|
+
): UseMutationOptions<Awaited<ReturnType<typeof subscriptionAddDiscountToSubscription>>, TError,{subscriptionUid: string | null;discountUid: string | null}, TContext> => {
|
|
597
|
+
|
|
598
|
+
const mutationKey = ['subscriptionAddDiscountToSubscription'];
|
|
599
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
600
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
601
|
+
options
|
|
602
|
+
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
603
|
+
: {mutation: { mutationKey, }, request: undefined};
|
|
604
|
+
|
|
605
|
+
|
|
606
|
+
|
|
607
|
+
|
|
608
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof subscriptionAddDiscountToSubscription>>, {subscriptionUid: string | null;discountUid: string | null}> = (props) => {
|
|
609
|
+
const {subscriptionUid,discountUid} = props ?? {};
|
|
610
|
+
|
|
611
|
+
return subscriptionAddDiscountToSubscription(subscriptionUid,discountUid,requestOptions)
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
|
|
615
|
+
|
|
616
|
+
|
|
617
|
+
return { mutationFn, ...mutationOptions }}
|
|
618
|
+
|
|
619
|
+
export type SubscriptionAddDiscountToSubscriptionMutationResult = NonNullable<Awaited<ReturnType<typeof subscriptionAddDiscountToSubscription>>>
|
|
620
|
+
|
|
621
|
+
export type SubscriptionAddDiscountToSubscriptionMutationError = void
|
|
622
|
+
|
|
623
|
+
/**
|
|
624
|
+
* @summary Add a discount to a subscription.
|
|
625
|
+
*/
|
|
626
|
+
export const useSubscriptionAddDiscountToSubscription = <TError = void,
|
|
627
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof subscriptionAddDiscountToSubscription>>, TError,{subscriptionUid: string | null;discountUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
628
|
+
): UseMutationResult<
|
|
629
|
+
Awaited<ReturnType<typeof subscriptionAddDiscountToSubscription>>,
|
|
630
|
+
TError,
|
|
631
|
+
{subscriptionUid: string | null;discountUid: string | null},
|
|
632
|
+
TContext
|
|
633
|
+
> => {
|
|
634
|
+
|
|
635
|
+
const mutationOptions = getSubscriptionAddDiscountToSubscriptionMutationOptions(options);
|
|
636
|
+
|
|
637
|
+
return useMutation(mutationOptions);
|
|
638
|
+
}
|
|
639
|
+
/**
|
|
640
|
+
* @summary Indicate that an upgrade of plan is required. When a subscription is flagged, next time
|
|
641
|
+
the user authenticates the authentication widget will prompt the user to change plan.
|
|
642
|
+
*/
|
|
643
|
+
export const subscriptionSetSubscriptionUpgradeRequired = (
|
|
644
|
+
subscriptionUid: string | null,
|
|
645
|
+
subscriptionSetSubscriptionUpgradeRequiredBody: SubscriptionSetSubscriptionUpgradeRequiredBody,
|
|
646
|
+
options?: SecondParameter<typeof customFetch>,) => {
|
|
647
|
+
|
|
648
|
+
|
|
649
|
+
return customFetch<Subscription>(
|
|
650
|
+
{url: `/api/v1/billing/subscriptions/${subscriptionUid}/setsubscriptionupgraderequired`, method: 'PUT',
|
|
651
|
+
headers: {'Content-Type': 'application/json', },
|
|
652
|
+
data: subscriptionSetSubscriptionUpgradeRequiredBody
|
|
653
|
+
},
|
|
654
|
+
options);
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
|
|
658
|
+
|
|
659
|
+
export const getSubscriptionSetSubscriptionUpgradeRequiredMutationOptions = <TError = void,
|
|
660
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof subscriptionSetSubscriptionUpgradeRequired>>, TError,{subscriptionUid: string | null;data: SubscriptionSetSubscriptionUpgradeRequiredBody}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
661
|
+
): UseMutationOptions<Awaited<ReturnType<typeof subscriptionSetSubscriptionUpgradeRequired>>, TError,{subscriptionUid: string | null;data: SubscriptionSetSubscriptionUpgradeRequiredBody}, TContext> => {
|
|
662
|
+
|
|
663
|
+
const mutationKey = ['subscriptionSetSubscriptionUpgradeRequired'];
|
|
664
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
665
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
666
|
+
options
|
|
667
|
+
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
668
|
+
: {mutation: { mutationKey, }, request: undefined};
|
|
669
|
+
|
|
670
|
+
|
|
671
|
+
|
|
672
|
+
|
|
673
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof subscriptionSetSubscriptionUpgradeRequired>>, {subscriptionUid: string | null;data: SubscriptionSetSubscriptionUpgradeRequiredBody}> = (props) => {
|
|
674
|
+
const {subscriptionUid,data} = props ?? {};
|
|
675
|
+
|
|
676
|
+
return subscriptionSetSubscriptionUpgradeRequired(subscriptionUid,data,requestOptions)
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
|
|
680
|
+
|
|
681
|
+
|
|
682
|
+
return { mutationFn, ...mutationOptions }}
|
|
683
|
+
|
|
684
|
+
export type SubscriptionSetSubscriptionUpgradeRequiredMutationResult = NonNullable<Awaited<ReturnType<typeof subscriptionSetSubscriptionUpgradeRequired>>>
|
|
685
|
+
export type SubscriptionSetSubscriptionUpgradeRequiredMutationBody = SubscriptionSetSubscriptionUpgradeRequiredBody
|
|
686
|
+
export type SubscriptionSetSubscriptionUpgradeRequiredMutationError = void
|
|
687
|
+
|
|
688
|
+
/**
|
|
689
|
+
* @summary Indicate that an upgrade of plan is required. When a subscription is flagged, next time
|
|
690
|
+
the user authenticates the authentication widget will prompt the user to change plan.
|
|
691
|
+
*/
|
|
692
|
+
export const useSubscriptionSetSubscriptionUpgradeRequired = <TError = void,
|
|
693
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof subscriptionSetSubscriptionUpgradeRequired>>, TError,{subscriptionUid: string | null;data: SubscriptionSetSubscriptionUpgradeRequiredBody}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
694
|
+
): UseMutationResult<
|
|
695
|
+
Awaited<ReturnType<typeof subscriptionSetSubscriptionUpgradeRequired>>,
|
|
696
|
+
TError,
|
|
697
|
+
{subscriptionUid: string | null;data: SubscriptionSetSubscriptionUpgradeRequiredBody},
|
|
698
|
+
TContext
|
|
699
|
+
> => {
|
|
700
|
+
|
|
701
|
+
const mutationOptions = getSubscriptionSetSubscriptionUpgradeRequiredMutationOptions(options);
|
|
702
|
+
|
|
703
|
+
return useMutation(mutationOptions);
|
|
704
|
+
}
|
|
705
|
+
/**
|
|
706
|
+
* @summary Preview what the initial or renewal invoice would look like if an account were to register
|
|
707
|
+
with this subscription. Returns an invoice object with information about the amount outstanding.
|
|
708
|
+
BillingRenewalTerm values: 1 = Monthly, 2 = Yearly, 3 = Quarterly, 4 = OneTime.
|
|
709
|
+
Pass asOf=renewal to see the renewal invoice instead of the initial invoice.
|
|
710
|
+
*/
|
|
711
|
+
export const subscriptionFirstTimeSubscriptionPreview = (
|
|
712
|
+
subscriptionFirstTimeSubscriptionPreviewBody: SubscriptionFirstTimeSubscriptionPreviewBody,
|
|
713
|
+
params?: SubscriptionFirstTimeSubscriptionPreviewParams,
|
|
714
|
+
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
715
|
+
) => {
|
|
716
|
+
|
|
717
|
+
|
|
718
|
+
return customFetch<Invoice>(
|
|
719
|
+
{url: `/api/v1/billing/subscriptions/compute-charge-summary`, method: 'POST',
|
|
720
|
+
headers: {'Content-Type': 'application/json', },
|
|
721
|
+
data: subscriptionFirstTimeSubscriptionPreviewBody,
|
|
722
|
+
params, signal
|
|
723
|
+
},
|
|
724
|
+
options);
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
|
|
728
|
+
|
|
729
|
+
export const getSubscriptionFirstTimeSubscriptionPreviewMutationOptions = <TError = unknown,
|
|
730
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof subscriptionFirstTimeSubscriptionPreview>>, TError,{data: SubscriptionFirstTimeSubscriptionPreviewBody;params?: SubscriptionFirstTimeSubscriptionPreviewParams}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
731
|
+
): UseMutationOptions<Awaited<ReturnType<typeof subscriptionFirstTimeSubscriptionPreview>>, TError,{data: SubscriptionFirstTimeSubscriptionPreviewBody;params?: SubscriptionFirstTimeSubscriptionPreviewParams}, TContext> => {
|
|
732
|
+
|
|
733
|
+
const mutationKey = ['subscriptionFirstTimeSubscriptionPreview'];
|
|
734
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
735
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
736
|
+
options
|
|
737
|
+
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
738
|
+
: {mutation: { mutationKey, }, request: undefined};
|
|
739
|
+
|
|
740
|
+
|
|
741
|
+
|
|
742
|
+
|
|
743
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof subscriptionFirstTimeSubscriptionPreview>>, {data: SubscriptionFirstTimeSubscriptionPreviewBody;params?: SubscriptionFirstTimeSubscriptionPreviewParams}> = (props) => {
|
|
744
|
+
const {data,params} = props ?? {};
|
|
745
|
+
|
|
746
|
+
return subscriptionFirstTimeSubscriptionPreview(data,params,requestOptions)
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
|
|
750
|
+
|
|
751
|
+
|
|
752
|
+
return { mutationFn, ...mutationOptions }}
|
|
753
|
+
|
|
754
|
+
export type SubscriptionFirstTimeSubscriptionPreviewMutationResult = NonNullable<Awaited<ReturnType<typeof subscriptionFirstTimeSubscriptionPreview>>>
|
|
755
|
+
export type SubscriptionFirstTimeSubscriptionPreviewMutationBody = SubscriptionFirstTimeSubscriptionPreviewBody
|
|
756
|
+
export type SubscriptionFirstTimeSubscriptionPreviewMutationError = unknown
|
|
757
|
+
|
|
758
|
+
/**
|
|
759
|
+
* @summary Preview what the initial or renewal invoice would look like if an account were to register
|
|
760
|
+
with this subscription. Returns an invoice object with information about the amount outstanding.
|
|
761
|
+
BillingRenewalTerm values: 1 = Monthly, 2 = Yearly, 3 = Quarterly, 4 = OneTime.
|
|
762
|
+
Pass asOf=renewal to see the renewal invoice instead of the initial invoice.
|
|
763
|
+
*/
|
|
764
|
+
export const useSubscriptionFirstTimeSubscriptionPreview = <TError = unknown,
|
|
765
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof subscriptionFirstTimeSubscriptionPreview>>, TError,{data: SubscriptionFirstTimeSubscriptionPreviewBody;params?: SubscriptionFirstTimeSubscriptionPreviewParams}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
766
|
+
): UseMutationResult<
|
|
767
|
+
Awaited<ReturnType<typeof subscriptionFirstTimeSubscriptionPreview>>,
|
|
768
|
+
TError,
|
|
769
|
+
{data: SubscriptionFirstTimeSubscriptionPreviewBody;params?: SubscriptionFirstTimeSubscriptionPreviewParams},
|
|
770
|
+
TContext
|
|
771
|
+
> => {
|
|
772
|
+
|
|
773
|
+
const mutationOptions = getSubscriptionFirstTimeSubscriptionPreviewMutationOptions(options);
|
|
774
|
+
|
|
775
|
+
return useMutation(mutationOptions);
|
|
776
|
+
}
|
|
777
|
+
/**
|
|
778
|
+
* @summary Add a subscription to an account for the first time. Returns an invoice object
|
|
779
|
+
with information about the amount outstanding.
|
|
780
|
+
*/
|
|
781
|
+
export const subscriptionFirstTimeSubscription = (
|
|
782
|
+
subscriptionFirstTimeSubscriptionBody: SubscriptionFirstTimeSubscriptionBody,
|
|
783
|
+
options?: SecondParameter<typeof customFetch>,) => {
|
|
784
|
+
|
|
785
|
+
|
|
786
|
+
return customFetch<Invoice>(
|
|
787
|
+
{url: `/api/v1/billing/subscriptions/firsttimesubscription`, method: 'PUT',
|
|
788
|
+
headers: {'Content-Type': 'application/json', },
|
|
789
|
+
data: subscriptionFirstTimeSubscriptionBody
|
|
790
|
+
},
|
|
791
|
+
options);
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
|
|
795
|
+
|
|
796
|
+
export const getSubscriptionFirstTimeSubscriptionMutationOptions = <TError = void,
|
|
797
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof subscriptionFirstTimeSubscription>>, TError,{data: SubscriptionFirstTimeSubscriptionBody}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
798
|
+
): UseMutationOptions<Awaited<ReturnType<typeof subscriptionFirstTimeSubscription>>, TError,{data: SubscriptionFirstTimeSubscriptionBody}, TContext> => {
|
|
799
|
+
|
|
800
|
+
const mutationKey = ['subscriptionFirstTimeSubscription'];
|
|
801
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
802
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
803
|
+
options
|
|
804
|
+
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
805
|
+
: {mutation: { mutationKey, }, request: undefined};
|
|
806
|
+
|
|
807
|
+
|
|
808
|
+
|
|
809
|
+
|
|
810
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof subscriptionFirstTimeSubscription>>, {data: SubscriptionFirstTimeSubscriptionBody}> = (props) => {
|
|
811
|
+
const {data} = props ?? {};
|
|
812
|
+
|
|
813
|
+
return subscriptionFirstTimeSubscription(data,requestOptions)
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
|
|
817
|
+
|
|
818
|
+
|
|
819
|
+
return { mutationFn, ...mutationOptions }}
|
|
820
|
+
|
|
821
|
+
export type SubscriptionFirstTimeSubscriptionMutationResult = NonNullable<Awaited<ReturnType<typeof subscriptionFirstTimeSubscription>>>
|
|
822
|
+
export type SubscriptionFirstTimeSubscriptionMutationBody = SubscriptionFirstTimeSubscriptionBody
|
|
823
|
+
export type SubscriptionFirstTimeSubscriptionMutationError = void
|
|
824
|
+
|
|
825
|
+
/**
|
|
826
|
+
* @summary Add a subscription to an account for the first time. Returns an invoice object
|
|
827
|
+
with information about the amount outstanding.
|
|
828
|
+
*/
|
|
829
|
+
export const useSubscriptionFirstTimeSubscription = <TError = void,
|
|
830
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof subscriptionFirstTimeSubscription>>, TError,{data: SubscriptionFirstTimeSubscriptionBody}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
831
|
+
): UseMutationResult<
|
|
832
|
+
Awaited<ReturnType<typeof subscriptionFirstTimeSubscription>>,
|
|
833
|
+
TError,
|
|
834
|
+
{data: SubscriptionFirstTimeSubscriptionBody},
|
|
835
|
+
TContext
|
|
836
|
+
> => {
|
|
837
|
+
|
|
838
|
+
const mutationOptions = getSubscriptionFirstTimeSubscriptionMutationOptions(options);
|
|
839
|
+
|
|
840
|
+
return useMutation(mutationOptions);
|
|
841
|
+
}
|
|
842
|
+
/**
|
|
843
|
+
* @summary Preview what the invoice would look like when changing a subscription. Returns an invoice object
|
|
844
|
+
with information about the amount outstanding. This method does not commit the subscription change.
|
|
845
|
+
*/
|
|
846
|
+
export const subscriptionChangeSubscriptionPreview = (
|
|
847
|
+
subscriptionUid: string | null,
|
|
848
|
+
subscriptionChangeSubscriptionPreviewBody: SubscriptionChangeSubscriptionPreviewBody,
|
|
849
|
+
params?: SubscriptionChangeSubscriptionPreviewParams,
|
|
850
|
+
options?: SecondParameter<typeof customFetch>,) => {
|
|
851
|
+
|
|
852
|
+
|
|
853
|
+
return customFetch<Invoice>(
|
|
854
|
+
{url: `/api/v1/billing/subscriptions/${subscriptionUid}/changesubscriptionpreview`, method: 'PUT',
|
|
855
|
+
headers: {'Content-Type': 'application/json', },
|
|
856
|
+
data: subscriptionChangeSubscriptionPreviewBody,
|
|
857
|
+
params
|
|
858
|
+
},
|
|
859
|
+
options);
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
|
|
863
|
+
|
|
864
|
+
export const getSubscriptionChangeSubscriptionPreviewMutationOptions = <TError = void,
|
|
865
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof subscriptionChangeSubscriptionPreview>>, TError,{subscriptionUid: string | null;data: SubscriptionChangeSubscriptionPreviewBody;params?: SubscriptionChangeSubscriptionPreviewParams}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
866
|
+
): UseMutationOptions<Awaited<ReturnType<typeof subscriptionChangeSubscriptionPreview>>, TError,{subscriptionUid: string | null;data: SubscriptionChangeSubscriptionPreviewBody;params?: SubscriptionChangeSubscriptionPreviewParams}, TContext> => {
|
|
867
|
+
|
|
868
|
+
const mutationKey = ['subscriptionChangeSubscriptionPreview'];
|
|
869
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
870
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
871
|
+
options
|
|
872
|
+
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
873
|
+
: {mutation: { mutationKey, }, request: undefined};
|
|
874
|
+
|
|
875
|
+
|
|
876
|
+
|
|
877
|
+
|
|
878
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof subscriptionChangeSubscriptionPreview>>, {subscriptionUid: string | null;data: SubscriptionChangeSubscriptionPreviewBody;params?: SubscriptionChangeSubscriptionPreviewParams}> = (props) => {
|
|
879
|
+
const {subscriptionUid,data,params} = props ?? {};
|
|
880
|
+
|
|
881
|
+
return subscriptionChangeSubscriptionPreview(subscriptionUid,data,params,requestOptions)
|
|
882
|
+
}
|
|
883
|
+
|
|
884
|
+
|
|
885
|
+
|
|
886
|
+
|
|
887
|
+
return { mutationFn, ...mutationOptions }}
|
|
888
|
+
|
|
889
|
+
export type SubscriptionChangeSubscriptionPreviewMutationResult = NonNullable<Awaited<ReturnType<typeof subscriptionChangeSubscriptionPreview>>>
|
|
890
|
+
export type SubscriptionChangeSubscriptionPreviewMutationBody = SubscriptionChangeSubscriptionPreviewBody
|
|
891
|
+
export type SubscriptionChangeSubscriptionPreviewMutationError = void
|
|
892
|
+
|
|
893
|
+
/**
|
|
894
|
+
* @summary Preview what the invoice would look like when changing a subscription. Returns an invoice object
|
|
895
|
+
with information about the amount outstanding. This method does not commit the subscription change.
|
|
896
|
+
*/
|
|
897
|
+
export const useSubscriptionChangeSubscriptionPreview = <TError = void,
|
|
898
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof subscriptionChangeSubscriptionPreview>>, TError,{subscriptionUid: string | null;data: SubscriptionChangeSubscriptionPreviewBody;params?: SubscriptionChangeSubscriptionPreviewParams}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
899
|
+
): UseMutationResult<
|
|
900
|
+
Awaited<ReturnType<typeof subscriptionChangeSubscriptionPreview>>,
|
|
901
|
+
TError,
|
|
902
|
+
{subscriptionUid: string | null;data: SubscriptionChangeSubscriptionPreviewBody;params?: SubscriptionChangeSubscriptionPreviewParams},
|
|
903
|
+
TContext
|
|
904
|
+
> => {
|
|
905
|
+
|
|
906
|
+
const mutationOptions = getSubscriptionChangeSubscriptionPreviewMutationOptions(options);
|
|
907
|
+
|
|
908
|
+
return useMutation(mutationOptions);
|
|
909
|
+
}
|
|
910
|
+
/**
|
|
911
|
+
* @summary Change a subscription on an account. Returns an invoice object with information about
|
|
912
|
+
the amount outstanding.
|
|
913
|
+
*/
|
|
914
|
+
export const subscriptionChangeSubscription = (
|
|
915
|
+
subscriptionUid: string | null,
|
|
916
|
+
subscriptionChangeSubscriptionBody: SubscriptionChangeSubscriptionBody,
|
|
917
|
+
params?: SubscriptionChangeSubscriptionParams,
|
|
918
|
+
options?: SecondParameter<typeof customFetch>,) => {
|
|
919
|
+
|
|
920
|
+
|
|
921
|
+
return customFetch<Subscription>(
|
|
922
|
+
{url: `/api/v1/billing/subscriptions/${subscriptionUid}/changesubscription`, method: 'PUT',
|
|
923
|
+
headers: {'Content-Type': 'application/json', },
|
|
924
|
+
data: subscriptionChangeSubscriptionBody,
|
|
925
|
+
params
|
|
926
|
+
},
|
|
927
|
+
options);
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
|
|
931
|
+
|
|
932
|
+
export const getSubscriptionChangeSubscriptionMutationOptions = <TError = void,
|
|
933
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof subscriptionChangeSubscription>>, TError,{subscriptionUid: string | null;data: SubscriptionChangeSubscriptionBody;params?: SubscriptionChangeSubscriptionParams}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
934
|
+
): UseMutationOptions<Awaited<ReturnType<typeof subscriptionChangeSubscription>>, TError,{subscriptionUid: string | null;data: SubscriptionChangeSubscriptionBody;params?: SubscriptionChangeSubscriptionParams}, TContext> => {
|
|
935
|
+
|
|
936
|
+
const mutationKey = ['subscriptionChangeSubscription'];
|
|
937
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
938
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
939
|
+
options
|
|
940
|
+
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
941
|
+
: {mutation: { mutationKey, }, request: undefined};
|
|
942
|
+
|
|
943
|
+
|
|
944
|
+
|
|
945
|
+
|
|
946
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof subscriptionChangeSubscription>>, {subscriptionUid: string | null;data: SubscriptionChangeSubscriptionBody;params?: SubscriptionChangeSubscriptionParams}> = (props) => {
|
|
947
|
+
const {subscriptionUid,data,params} = props ?? {};
|
|
948
|
+
|
|
949
|
+
return subscriptionChangeSubscription(subscriptionUid,data,params,requestOptions)
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
|
|
953
|
+
|
|
954
|
+
|
|
955
|
+
return { mutationFn, ...mutationOptions }}
|
|
956
|
+
|
|
957
|
+
export type SubscriptionChangeSubscriptionMutationResult = NonNullable<Awaited<ReturnType<typeof subscriptionChangeSubscription>>>
|
|
958
|
+
export type SubscriptionChangeSubscriptionMutationBody = SubscriptionChangeSubscriptionBody
|
|
959
|
+
export type SubscriptionChangeSubscriptionMutationError = void
|
|
960
|
+
|
|
961
|
+
/**
|
|
962
|
+
* @summary Change a subscription on an account. Returns an invoice object with information about
|
|
963
|
+
the amount outstanding.
|
|
964
|
+
*/
|
|
965
|
+
export const useSubscriptionChangeSubscription = <TError = void,
|
|
966
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof subscriptionChangeSubscription>>, TError,{subscriptionUid: string | null;data: SubscriptionChangeSubscriptionBody;params?: SubscriptionChangeSubscriptionParams}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
967
|
+
): UseMutationResult<
|
|
968
|
+
Awaited<ReturnType<typeof subscriptionChangeSubscription>>,
|
|
969
|
+
TError,
|
|
970
|
+
{subscriptionUid: string | null;data: SubscriptionChangeSubscriptionBody;params?: SubscriptionChangeSubscriptionParams},
|
|
971
|
+
TContext
|
|
972
|
+
> => {
|
|
973
|
+
|
|
974
|
+
const mutationOptions = getSubscriptionChangeSubscriptionMutationOptions(options);
|
|
975
|
+
|
|
976
|
+
return useMutation(mutationOptions);
|
|
977
|
+
}
|
|
978
|
+
/**
|
|
979
|
+
* @summary Retrieves all plans.
|
|
980
|
+
*/
|
|
981
|
+
export const planGetAllPlans = (
|
|
982
|
+
|
|
983
|
+
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
984
|
+
) => {
|
|
985
|
+
|
|
986
|
+
|
|
987
|
+
return customFetch<Plan[]>(
|
|
988
|
+
{url: `/api/v1/billing/plans`, method: 'GET', signal
|
|
989
|
+
},
|
|
990
|
+
options);
|
|
991
|
+
}
|
|
992
|
+
|
|
993
|
+
|
|
994
|
+
|
|
995
|
+
|
|
996
|
+
export const getPlanGetAllPlansQueryKey = () => {
|
|
997
|
+
return [
|
|
998
|
+
`/api/v1/billing/plans`
|
|
999
|
+
] as const;
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
|
|
1003
|
+
export const getPlanGetAllPlansQueryOptions = <TData = Awaited<ReturnType<typeof planGetAllPlans>>, TError = unknown>( options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof planGetAllPlans>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
1004
|
+
) => {
|
|
1005
|
+
|
|
1006
|
+
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
1007
|
+
|
|
1008
|
+
const queryKey = queryOptions?.queryKey ?? getPlanGetAllPlansQueryKey();
|
|
1009
|
+
|
|
1010
|
+
|
|
1011
|
+
|
|
1012
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof planGetAllPlans>>> = ({ signal }) => planGetAllPlans(requestOptions, signal);
|
|
1013
|
+
|
|
1014
|
+
|
|
1015
|
+
|
|
1016
|
+
|
|
1017
|
+
|
|
1018
|
+
return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof planGetAllPlans>>, TError, TData> & { queryKey: QueryKey }
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
export type PlanGetAllPlansQueryResult = NonNullable<Awaited<ReturnType<typeof planGetAllPlans>>>
|
|
1022
|
+
export type PlanGetAllPlansQueryError = unknown
|
|
1023
|
+
|
|
1024
|
+
|
|
1025
|
+
/**
|
|
1026
|
+
* @summary Retrieves all plans.
|
|
1027
|
+
*/
|
|
1028
|
+
|
|
1029
|
+
export function usePlanGetAllPlans<TData = Awaited<ReturnType<typeof planGetAllPlans>>, TError = unknown>(
|
|
1030
|
+
options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof planGetAllPlans>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
1031
|
+
|
|
1032
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
|
|
1033
|
+
|
|
1034
|
+
const queryOptions = getPlanGetAllPlansQueryOptions(options)
|
|
1035
|
+
|
|
1036
|
+
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
1037
|
+
|
|
1038
|
+
query.queryKey = queryOptions.queryKey ;
|
|
1039
|
+
|
|
1040
|
+
return query;
|
|
1041
|
+
}
|
|
1042
|
+
|
|
1043
|
+
|
|
1044
|
+
|
|
1045
|
+
|
|
1046
|
+
/**
|
|
1047
|
+
* @summary Retrieves all plan families.
|
|
1048
|
+
*/
|
|
1049
|
+
export const planFamilyGetAllPlanFamilies = (
|
|
1050
|
+
|
|
1051
|
+
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
1052
|
+
) => {
|
|
1053
|
+
|
|
1054
|
+
|
|
1055
|
+
return customFetch<PlanFamily[]>(
|
|
1056
|
+
{url: `/api/v1/billing/planfamilies`, method: 'GET', signal
|
|
1057
|
+
},
|
|
1058
|
+
options);
|
|
1059
|
+
}
|
|
1060
|
+
|
|
1061
|
+
|
|
1062
|
+
|
|
1063
|
+
|
|
1064
|
+
export const getPlanFamilyGetAllPlanFamiliesQueryKey = () => {
|
|
1065
|
+
return [
|
|
1066
|
+
`/api/v1/billing/planfamilies`
|
|
1067
|
+
] as const;
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1070
|
+
|
|
1071
|
+
export const getPlanFamilyGetAllPlanFamiliesQueryOptions = <TData = Awaited<ReturnType<typeof planFamilyGetAllPlanFamilies>>, TError = unknown>( options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof planFamilyGetAllPlanFamilies>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
1072
|
+
) => {
|
|
1073
|
+
|
|
1074
|
+
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
1075
|
+
|
|
1076
|
+
const queryKey = queryOptions?.queryKey ?? getPlanFamilyGetAllPlanFamiliesQueryKey();
|
|
1077
|
+
|
|
1078
|
+
|
|
1079
|
+
|
|
1080
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof planFamilyGetAllPlanFamilies>>> = ({ signal }) => planFamilyGetAllPlanFamilies(requestOptions, signal);
|
|
1081
|
+
|
|
1082
|
+
|
|
1083
|
+
|
|
1084
|
+
|
|
1085
|
+
|
|
1086
|
+
return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof planFamilyGetAllPlanFamilies>>, TError, TData> & { queryKey: QueryKey }
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1089
|
+
export type PlanFamilyGetAllPlanFamiliesQueryResult = NonNullable<Awaited<ReturnType<typeof planFamilyGetAllPlanFamilies>>>
|
|
1090
|
+
export type PlanFamilyGetAllPlanFamiliesQueryError = unknown
|
|
1091
|
+
|
|
1092
|
+
|
|
1093
|
+
/**
|
|
1094
|
+
* @summary Retrieves all plan families.
|
|
1095
|
+
*/
|
|
1096
|
+
|
|
1097
|
+
export function usePlanFamilyGetAllPlanFamilies<TData = Awaited<ReturnType<typeof planFamilyGetAllPlanFamilies>>, TError = unknown>(
|
|
1098
|
+
options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof planFamilyGetAllPlanFamilies>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
1099
|
+
|
|
1100
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
|
|
1101
|
+
|
|
1102
|
+
const queryOptions = getPlanFamilyGetAllPlanFamiliesQueryOptions(options)
|
|
1103
|
+
|
|
1104
|
+
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
1105
|
+
|
|
1106
|
+
query.queryKey = queryOptions.queryKey ;
|
|
1107
|
+
|
|
1108
|
+
return query;
|
|
1109
|
+
}
|
|
1110
|
+
|
|
1111
|
+
|
|
1112
|
+
|
|
1113
|
+
|