@outseta/react 0.2.2 → 0.2.4
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 +9 -9
- package/src/generated/activity/activity.ts +12 -15
- package/src/generated/attribute/attribute.ts +163 -0
- package/src/generated/billing/billing.ts +500 -34
- package/src/generated/crm/crm.ts +100 -44
- package/src/generated/email/email.ts +26 -32
- package/src/generated/outsetaAPI.schemas.ts +21 -3
- package/src/generated/support/support.ts +4 -8
|
@@ -18,6 +18,7 @@ import type {
|
|
|
18
18
|
DiscountCouponAddDiscountCouponBody,
|
|
19
19
|
Invoice,
|
|
20
20
|
InvoiceAddInvoiceBody,
|
|
21
|
+
InvoiceUpdateInvoiceBody,
|
|
21
22
|
PaymentInformation,
|
|
22
23
|
PaymentInformationSavePaymentInformationBody,
|
|
23
24
|
Plan,
|
|
@@ -46,8 +47,9 @@ type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
|
|
46
47
|
|
|
47
48
|
|
|
48
49
|
/**
|
|
49
|
-
*
|
|
50
|
+
* Only one of AmountOff or PercentOff should be set.
|
|
50
51
|
Duration values: 1 = Forever, 2 = Once, 3 = Repeating (DurationInMonths must be set).
|
|
52
|
+
* @summary Add a new discount coupon.
|
|
51
53
|
*/
|
|
52
54
|
export const discountCouponAddDiscountCoupon = (
|
|
53
55
|
discountCouponAddDiscountCouponBody: DiscountCouponAddDiscountCouponBody,
|
|
@@ -95,8 +97,7 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
|
95
97
|
export type DiscountCouponAddDiscountCouponMutationError = void
|
|
96
98
|
|
|
97
99
|
/**
|
|
98
|
-
* @summary Add a new discount coupon.
|
|
99
|
-
Duration values: 1 = Forever, 2 = Once, 3 = Repeating (DurationInMonths must be set).
|
|
100
|
+
* @summary Add a new discount coupon.
|
|
100
101
|
*/
|
|
101
102
|
export const useDiscountCouponAddDiscountCoupon = <TError = void,
|
|
102
103
|
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof discountCouponAddDiscountCoupon>>, TError,{data: DiscountCouponAddDiscountCouponBody}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
@@ -176,8 +177,9 @@ export const useUsageAddUsage = <TError = void,
|
|
|
176
177
|
return useMutation(mutationOptions);
|
|
177
178
|
}
|
|
178
179
|
/**
|
|
179
|
-
*
|
|
180
|
+
* Transactions are tied to accounts and invoices.
|
|
180
181
|
BillingTransactionType: Invoice = 1, Payment = 2, Credit = 3, Refund = 4, Chargeback = 5.
|
|
182
|
+
* @summary Retrieve all transactions for a given account.
|
|
181
183
|
*/
|
|
182
184
|
export const transactionsGetAllTransactionsByAccountId = (
|
|
183
185
|
accountUid: string | null,
|
|
@@ -224,8 +226,7 @@ export type TransactionsGetAllTransactionsByAccountIdQueryError = void
|
|
|
224
226
|
|
|
225
227
|
|
|
226
228
|
/**
|
|
227
|
-
* @summary
|
|
228
|
-
BillingTransactionType: Invoice = 1, Payment = 2, Credit = 3, Refund = 4, Chargeback = 5.
|
|
229
|
+
* @summary Retrieve all transactions for a given account.
|
|
229
230
|
*/
|
|
230
231
|
|
|
231
232
|
export function useTransactionsGetAllTransactionsByAccountId<TData = Awaited<ReturnType<typeof transactionsGetAllTransactionsByAccountId>>, TError = void>(
|
|
@@ -246,8 +247,9 @@ export function useTransactionsGetAllTransactionsByAccountId<TData = Awaited<Ret
|
|
|
246
247
|
|
|
247
248
|
|
|
248
249
|
/**
|
|
249
|
-
*
|
|
250
|
-
|
|
250
|
+
* If the amount matches the outstanding amount of the invoice, the invoice will be marked
|
|
251
|
+
as Paid.
|
|
252
|
+
* @summary Add a payment to an invoice.
|
|
251
253
|
*/
|
|
252
254
|
export const transactionsAddPaymentTransaction = (
|
|
253
255
|
transactionsAddPaymentTransactionBody: TransactionsAddPaymentTransactionBody,
|
|
@@ -295,8 +297,7 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
|
295
297
|
export type TransactionsAddPaymentTransactionMutationError = void
|
|
296
298
|
|
|
297
299
|
/**
|
|
298
|
-
* @summary
|
|
299
|
-
the invoice will be marked as Paid.
|
|
300
|
+
* @summary Add a payment to an invoice.
|
|
300
301
|
*/
|
|
301
302
|
export const useTransactionsAddPaymentTransaction = <TError = void,
|
|
302
303
|
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof transactionsAddPaymentTransaction>>, TError,{data: TransactionsAddPaymentTransactionBody}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
@@ -441,6 +442,77 @@ export const useSubscriptionAddOnAddSubscriptionAddOn = <TError = void,
|
|
|
441
442
|
return useMutation(mutationOptions);
|
|
442
443
|
}
|
|
443
444
|
/**
|
|
445
|
+
* Admins and API key callers see every invoice. Non-admin users see only invoices
|
|
446
|
+
belonging to the account they are the primary contact of.
|
|
447
|
+
Pass excludeInvoiceUid as a query parameter to omit a specific invoice from the result set.
|
|
448
|
+
* @summary Returns all invoices, optionally restricted to the requester's account.
|
|
449
|
+
*/
|
|
450
|
+
export const invoiceGetAllInvoices = (
|
|
451
|
+
|
|
452
|
+
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
453
|
+
) => {
|
|
454
|
+
|
|
455
|
+
|
|
456
|
+
return customFetch<Invoice[]>(
|
|
457
|
+
{url: `/api/v1/billing/invoices`, method: 'GET', signal
|
|
458
|
+
},
|
|
459
|
+
options);
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
|
|
463
|
+
|
|
464
|
+
|
|
465
|
+
export const getInvoiceGetAllInvoicesQueryKey = () => {
|
|
466
|
+
return [
|
|
467
|
+
`/api/v1/billing/invoices`
|
|
468
|
+
] as const;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
|
|
472
|
+
export const getInvoiceGetAllInvoicesQueryOptions = <TData = Awaited<ReturnType<typeof invoiceGetAllInvoices>>, TError = void>( options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof invoiceGetAllInvoices>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
473
|
+
) => {
|
|
474
|
+
|
|
475
|
+
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
476
|
+
|
|
477
|
+
const queryKey = queryOptions?.queryKey ?? getInvoiceGetAllInvoicesQueryKey();
|
|
478
|
+
|
|
479
|
+
|
|
480
|
+
|
|
481
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof invoiceGetAllInvoices>>> = ({ signal }) => invoiceGetAllInvoices(requestOptions, signal);
|
|
482
|
+
|
|
483
|
+
|
|
484
|
+
|
|
485
|
+
|
|
486
|
+
|
|
487
|
+
return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof invoiceGetAllInvoices>>, TError, TData> & { queryKey: QueryKey }
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
export type InvoiceGetAllInvoicesQueryResult = NonNullable<Awaited<ReturnType<typeof invoiceGetAllInvoices>>>
|
|
491
|
+
export type InvoiceGetAllInvoicesQueryError = void
|
|
492
|
+
|
|
493
|
+
|
|
494
|
+
/**
|
|
495
|
+
* @summary Returns all invoices, optionally restricted to the requester's account.
|
|
496
|
+
*/
|
|
497
|
+
|
|
498
|
+
export function useInvoiceGetAllInvoices<TData = Awaited<ReturnType<typeof invoiceGetAllInvoices>>, TError = void>(
|
|
499
|
+
options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof invoiceGetAllInvoices>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
500
|
+
|
|
501
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
|
|
502
|
+
|
|
503
|
+
const queryOptions = getInvoiceGetAllInvoicesQueryOptions(options)
|
|
504
|
+
|
|
505
|
+
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
506
|
+
|
|
507
|
+
query.queryKey = queryOptions.queryKey ;
|
|
508
|
+
|
|
509
|
+
return query;
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
|
|
513
|
+
|
|
514
|
+
|
|
515
|
+
/**
|
|
444
516
|
* @summary Create an ad-hoc invoice for a given account.
|
|
445
517
|
*/
|
|
446
518
|
export const invoiceAddInvoice = (
|
|
@@ -505,6 +577,404 @@ export const useInvoiceAddInvoice = <TError = void,
|
|
|
505
577
|
return useMutation(mutationOptions);
|
|
506
578
|
}
|
|
507
579
|
/**
|
|
580
|
+
* @summary Returns a single invoice by UID.
|
|
581
|
+
*/
|
|
582
|
+
export const invoiceGetInvoice = (
|
|
583
|
+
invoiceUid: string | null,
|
|
584
|
+
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
585
|
+
) => {
|
|
586
|
+
|
|
587
|
+
|
|
588
|
+
return customFetch<Invoice>(
|
|
589
|
+
{url: `/api/v1/billing/invoices/${invoiceUid}`, method: 'GET', signal
|
|
590
|
+
},
|
|
591
|
+
options);
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
|
|
595
|
+
|
|
596
|
+
|
|
597
|
+
export const getInvoiceGetInvoiceQueryKey = (invoiceUid?: string | null,) => {
|
|
598
|
+
return [
|
|
599
|
+
`/api/v1/billing/invoices/${invoiceUid}`
|
|
600
|
+
] as const;
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
|
|
604
|
+
export const getInvoiceGetInvoiceQueryOptions = <TData = Awaited<ReturnType<typeof invoiceGetInvoice>>, TError = void>(invoiceUid: string | null, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof invoiceGetInvoice>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
605
|
+
) => {
|
|
606
|
+
|
|
607
|
+
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
608
|
+
|
|
609
|
+
const queryKey = queryOptions?.queryKey ?? getInvoiceGetInvoiceQueryKey(invoiceUid);
|
|
610
|
+
|
|
611
|
+
|
|
612
|
+
|
|
613
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof invoiceGetInvoice>>> = ({ signal }) => invoiceGetInvoice(invoiceUid, requestOptions, signal);
|
|
614
|
+
|
|
615
|
+
|
|
616
|
+
|
|
617
|
+
|
|
618
|
+
|
|
619
|
+
return { queryKey, queryFn, enabled: !!(invoiceUid), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof invoiceGetInvoice>>, TError, TData> & { queryKey: QueryKey }
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
export type InvoiceGetInvoiceQueryResult = NonNullable<Awaited<ReturnType<typeof invoiceGetInvoice>>>
|
|
623
|
+
export type InvoiceGetInvoiceQueryError = void
|
|
624
|
+
|
|
625
|
+
|
|
626
|
+
/**
|
|
627
|
+
* @summary Returns a single invoice by UID.
|
|
628
|
+
*/
|
|
629
|
+
|
|
630
|
+
export function useInvoiceGetInvoice<TData = Awaited<ReturnType<typeof invoiceGetInvoice>>, TError = void>(
|
|
631
|
+
invoiceUid: string | null, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof invoiceGetInvoice>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
632
|
+
|
|
633
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
|
|
634
|
+
|
|
635
|
+
const queryOptions = getInvoiceGetInvoiceQueryOptions(invoiceUid,options)
|
|
636
|
+
|
|
637
|
+
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
638
|
+
|
|
639
|
+
query.queryKey = queryOptions.queryKey ;
|
|
640
|
+
|
|
641
|
+
return query;
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
|
|
645
|
+
|
|
646
|
+
|
|
647
|
+
/**
|
|
648
|
+
* Only invoices created manually via the API or admin UI can be updated; invoices
|
|
649
|
+
generated by a subscription's billing cycle are immutable and will return a
|
|
650
|
+
validation error.
|
|
651
|
+
* @summary Update an ad-hoc (manually created) invoice.
|
|
652
|
+
*/
|
|
653
|
+
export const invoiceUpdateInvoice = (
|
|
654
|
+
invoiceUid: string | null,
|
|
655
|
+
invoiceUpdateInvoiceBody: InvoiceUpdateInvoiceBody,
|
|
656
|
+
options?: SecondParameter<typeof customFetch>,) => {
|
|
657
|
+
|
|
658
|
+
|
|
659
|
+
return customFetch<Invoice>(
|
|
660
|
+
{url: `/api/v1/billing/invoices/${invoiceUid}`, method: 'PUT',
|
|
661
|
+
headers: {'Content-Type': 'application/json', },
|
|
662
|
+
data: invoiceUpdateInvoiceBody
|
|
663
|
+
},
|
|
664
|
+
options);
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
|
|
668
|
+
|
|
669
|
+
export const getInvoiceUpdateInvoiceMutationOptions = <TError = void,
|
|
670
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof invoiceUpdateInvoice>>, TError,{invoiceUid: string | null;data: InvoiceUpdateInvoiceBody}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
671
|
+
): UseMutationOptions<Awaited<ReturnType<typeof invoiceUpdateInvoice>>, TError,{invoiceUid: string | null;data: InvoiceUpdateInvoiceBody}, TContext> => {
|
|
672
|
+
|
|
673
|
+
const mutationKey = ['invoiceUpdateInvoice'];
|
|
674
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
675
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
676
|
+
options
|
|
677
|
+
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
678
|
+
: {mutation: { mutationKey, }, request: undefined};
|
|
679
|
+
|
|
680
|
+
|
|
681
|
+
|
|
682
|
+
|
|
683
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof invoiceUpdateInvoice>>, {invoiceUid: string | null;data: InvoiceUpdateInvoiceBody}> = (props) => {
|
|
684
|
+
const {invoiceUid,data} = props ?? {};
|
|
685
|
+
|
|
686
|
+
return invoiceUpdateInvoice(invoiceUid,data,requestOptions)
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
|
|
690
|
+
|
|
691
|
+
|
|
692
|
+
return { mutationFn, ...mutationOptions }}
|
|
693
|
+
|
|
694
|
+
export type InvoiceUpdateInvoiceMutationResult = NonNullable<Awaited<ReturnType<typeof invoiceUpdateInvoice>>>
|
|
695
|
+
export type InvoiceUpdateInvoiceMutationBody = InvoiceUpdateInvoiceBody
|
|
696
|
+
export type InvoiceUpdateInvoiceMutationError = void
|
|
697
|
+
|
|
698
|
+
/**
|
|
699
|
+
* @summary Update an ad-hoc (manually created) invoice.
|
|
700
|
+
*/
|
|
701
|
+
export const useInvoiceUpdateInvoice = <TError = void,
|
|
702
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof invoiceUpdateInvoice>>, TError,{invoiceUid: string | null;data: InvoiceUpdateInvoiceBody}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
703
|
+
): UseMutationResult<
|
|
704
|
+
Awaited<ReturnType<typeof invoiceUpdateInvoice>>,
|
|
705
|
+
TError,
|
|
706
|
+
{invoiceUid: string | null;data: InvoiceUpdateInvoiceBody},
|
|
707
|
+
TContext
|
|
708
|
+
> => {
|
|
709
|
+
|
|
710
|
+
const mutationOptions = getInvoiceUpdateInvoiceMutationOptions(options);
|
|
711
|
+
|
|
712
|
+
return useMutation(mutationOptions);
|
|
713
|
+
}
|
|
714
|
+
/**
|
|
715
|
+
* @summary Delete an invoice.
|
|
716
|
+
*/
|
|
717
|
+
export const invoiceDeleteInvoice = (
|
|
718
|
+
invoiceUid: string | null,
|
|
719
|
+
options?: SecondParameter<typeof customFetch>,) => {
|
|
720
|
+
|
|
721
|
+
|
|
722
|
+
return customFetch<Blob>(
|
|
723
|
+
{url: `/api/v1/billing/invoices/${invoiceUid}`, method: 'DELETE',
|
|
724
|
+
responseType: 'blob'
|
|
725
|
+
},
|
|
726
|
+
options);
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
|
|
730
|
+
|
|
731
|
+
export const getInvoiceDeleteInvoiceMutationOptions = <TError = void,
|
|
732
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof invoiceDeleteInvoice>>, TError,{invoiceUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
733
|
+
): UseMutationOptions<Awaited<ReturnType<typeof invoiceDeleteInvoice>>, TError,{invoiceUid: string | null}, TContext> => {
|
|
734
|
+
|
|
735
|
+
const mutationKey = ['invoiceDeleteInvoice'];
|
|
736
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
737
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
738
|
+
options
|
|
739
|
+
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
740
|
+
: {mutation: { mutationKey, }, request: undefined};
|
|
741
|
+
|
|
742
|
+
|
|
743
|
+
|
|
744
|
+
|
|
745
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof invoiceDeleteInvoice>>, {invoiceUid: string | null}> = (props) => {
|
|
746
|
+
const {invoiceUid} = props ?? {};
|
|
747
|
+
|
|
748
|
+
return invoiceDeleteInvoice(invoiceUid,requestOptions)
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
|
|
752
|
+
|
|
753
|
+
|
|
754
|
+
return { mutationFn, ...mutationOptions }}
|
|
755
|
+
|
|
756
|
+
export type InvoiceDeleteInvoiceMutationResult = NonNullable<Awaited<ReturnType<typeof invoiceDeleteInvoice>>>
|
|
757
|
+
|
|
758
|
+
export type InvoiceDeleteInvoiceMutationError = void
|
|
759
|
+
|
|
760
|
+
/**
|
|
761
|
+
* @summary Delete an invoice.
|
|
762
|
+
*/
|
|
763
|
+
export const useInvoiceDeleteInvoice = <TError = void,
|
|
764
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof invoiceDeleteInvoice>>, TError,{invoiceUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
765
|
+
): UseMutationResult<
|
|
766
|
+
Awaited<ReturnType<typeof invoiceDeleteInvoice>>,
|
|
767
|
+
TError,
|
|
768
|
+
{invoiceUid: string | null},
|
|
769
|
+
TContext
|
|
770
|
+
> => {
|
|
771
|
+
|
|
772
|
+
const mutationOptions = getInvoiceDeleteInvoiceMutationOptions(options);
|
|
773
|
+
|
|
774
|
+
return useMutation(mutationOptions);
|
|
775
|
+
}
|
|
776
|
+
/**
|
|
777
|
+
* Response body is a binary PDF (Content-Type: application/pdf) served as an
|
|
778
|
+
attachment named invoice-{Number}-{InvoiceDate}-{AccountName}.pdf.
|
|
779
|
+
* @summary Returns a rendered PDF copy of an invoice.
|
|
780
|
+
*/
|
|
781
|
+
export const invoiceGetInvoiceAsPdf = (
|
|
782
|
+
invoiceUid: string | null,
|
|
783
|
+
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
784
|
+
) => {
|
|
785
|
+
|
|
786
|
+
|
|
787
|
+
return customFetch<Blob>(
|
|
788
|
+
{url: `/api/v1/billing/invoices/${invoiceUid}/pdf`, method: 'GET',
|
|
789
|
+
responseType: 'blob', signal
|
|
790
|
+
},
|
|
791
|
+
options);
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
|
|
795
|
+
|
|
796
|
+
|
|
797
|
+
export const getInvoiceGetInvoiceAsPdfQueryKey = (invoiceUid?: string | null,) => {
|
|
798
|
+
return [
|
|
799
|
+
`/api/v1/billing/invoices/${invoiceUid}/pdf`
|
|
800
|
+
] as const;
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
|
|
804
|
+
export const getInvoiceGetInvoiceAsPdfQueryOptions = <TData = Awaited<ReturnType<typeof invoiceGetInvoiceAsPdf>>, TError = void>(invoiceUid: string | null, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof invoiceGetInvoiceAsPdf>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
805
|
+
) => {
|
|
806
|
+
|
|
807
|
+
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
808
|
+
|
|
809
|
+
const queryKey = queryOptions?.queryKey ?? getInvoiceGetInvoiceAsPdfQueryKey(invoiceUid);
|
|
810
|
+
|
|
811
|
+
|
|
812
|
+
|
|
813
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof invoiceGetInvoiceAsPdf>>> = ({ signal }) => invoiceGetInvoiceAsPdf(invoiceUid, requestOptions, signal);
|
|
814
|
+
|
|
815
|
+
|
|
816
|
+
|
|
817
|
+
|
|
818
|
+
|
|
819
|
+
return { queryKey, queryFn, enabled: !!(invoiceUid), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof invoiceGetInvoiceAsPdf>>, TError, TData> & { queryKey: QueryKey }
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
export type InvoiceGetInvoiceAsPdfQueryResult = NonNullable<Awaited<ReturnType<typeof invoiceGetInvoiceAsPdf>>>
|
|
823
|
+
export type InvoiceGetInvoiceAsPdfQueryError = void
|
|
824
|
+
|
|
825
|
+
|
|
826
|
+
/**
|
|
827
|
+
* @summary Returns a rendered PDF copy of an invoice.
|
|
828
|
+
*/
|
|
829
|
+
|
|
830
|
+
export function useInvoiceGetInvoiceAsPdf<TData = Awaited<ReturnType<typeof invoiceGetInvoiceAsPdf>>, TError = void>(
|
|
831
|
+
invoiceUid: string | null, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof invoiceGetInvoiceAsPdf>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
832
|
+
|
|
833
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
|
|
834
|
+
|
|
835
|
+
const queryOptions = getInvoiceGetInvoiceAsPdfQueryOptions(invoiceUid,options)
|
|
836
|
+
|
|
837
|
+
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
838
|
+
|
|
839
|
+
query.queryKey = queryOptions.queryKey ;
|
|
840
|
+
|
|
841
|
+
return query;
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
|
|
845
|
+
|
|
846
|
+
|
|
847
|
+
/**
|
|
848
|
+
* Optional query parameters:
|
|
849
|
+
note - free-text note to include in the email body.
|
|
850
|
+
bcc - comma-separated list of email addresses to BCC.
|
|
851
|
+
* @summary Email an invoice to the account's billing contact.
|
|
852
|
+
*/
|
|
853
|
+
export const invoiceSendInvoiceEmail = (
|
|
854
|
+
invoiceUid: string | null,
|
|
855
|
+
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
856
|
+
) => {
|
|
857
|
+
|
|
858
|
+
|
|
859
|
+
return customFetch<Blob>(
|
|
860
|
+
{url: `/api/v1/billing/invoices/${invoiceUid}/sendinvoiceemail`, method: 'POST',
|
|
861
|
+
responseType: 'blob', signal
|
|
862
|
+
},
|
|
863
|
+
options);
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
|
|
867
|
+
|
|
868
|
+
export const getInvoiceSendInvoiceEmailMutationOptions = <TError = void,
|
|
869
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof invoiceSendInvoiceEmail>>, TError,{invoiceUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
870
|
+
): UseMutationOptions<Awaited<ReturnType<typeof invoiceSendInvoiceEmail>>, TError,{invoiceUid: string | null}, TContext> => {
|
|
871
|
+
|
|
872
|
+
const mutationKey = ['invoiceSendInvoiceEmail'];
|
|
873
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
874
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
875
|
+
options
|
|
876
|
+
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
877
|
+
: {mutation: { mutationKey, }, request: undefined};
|
|
878
|
+
|
|
879
|
+
|
|
880
|
+
|
|
881
|
+
|
|
882
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof invoiceSendInvoiceEmail>>, {invoiceUid: string | null}> = (props) => {
|
|
883
|
+
const {invoiceUid} = props ?? {};
|
|
884
|
+
|
|
885
|
+
return invoiceSendInvoiceEmail(invoiceUid,requestOptions)
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
|
|
889
|
+
|
|
890
|
+
|
|
891
|
+
return { mutationFn, ...mutationOptions }}
|
|
892
|
+
|
|
893
|
+
export type InvoiceSendInvoiceEmailMutationResult = NonNullable<Awaited<ReturnType<typeof invoiceSendInvoiceEmail>>>
|
|
894
|
+
|
|
895
|
+
export type InvoiceSendInvoiceEmailMutationError = void
|
|
896
|
+
|
|
897
|
+
/**
|
|
898
|
+
* @summary Email an invoice to the account's billing contact.
|
|
899
|
+
*/
|
|
900
|
+
export const useInvoiceSendInvoiceEmail = <TError = void,
|
|
901
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof invoiceSendInvoiceEmail>>, TError,{invoiceUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
902
|
+
): UseMutationResult<
|
|
903
|
+
Awaited<ReturnType<typeof invoiceSendInvoiceEmail>>,
|
|
904
|
+
TError,
|
|
905
|
+
{invoiceUid: string | null},
|
|
906
|
+
TContext
|
|
907
|
+
> => {
|
|
908
|
+
|
|
909
|
+
const mutationOptions = getInvoiceSendInvoiceEmailMutationOptions(options);
|
|
910
|
+
|
|
911
|
+
return useMutation(mutationOptions);
|
|
912
|
+
}
|
|
913
|
+
/**
|
|
914
|
+
* Returns 400 Bad Request if the invoice is not in the Paid status.
|
|
915
|
+
* @summary Send the "invoice paid" receipt email to the account's billing contact.
|
|
916
|
+
*/
|
|
917
|
+
export const invoiceSendInvoicePaidEmail = (
|
|
918
|
+
invoiceUid: string | null,
|
|
919
|
+
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
920
|
+
) => {
|
|
921
|
+
|
|
922
|
+
|
|
923
|
+
return customFetch<Blob>(
|
|
924
|
+
{url: `/api/v1/billing/invoices/${invoiceUid}/sendinvoicepaidemail`, method: 'POST',
|
|
925
|
+
responseType: 'blob', signal
|
|
926
|
+
},
|
|
927
|
+
options);
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
|
|
931
|
+
|
|
932
|
+
export const getInvoiceSendInvoicePaidEmailMutationOptions = <TError = void,
|
|
933
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof invoiceSendInvoicePaidEmail>>, TError,{invoiceUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
934
|
+
): UseMutationOptions<Awaited<ReturnType<typeof invoiceSendInvoicePaidEmail>>, TError,{invoiceUid: string | null}, TContext> => {
|
|
935
|
+
|
|
936
|
+
const mutationKey = ['invoiceSendInvoicePaidEmail'];
|
|
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 invoiceSendInvoicePaidEmail>>, {invoiceUid: string | null}> = (props) => {
|
|
947
|
+
const {invoiceUid} = props ?? {};
|
|
948
|
+
|
|
949
|
+
return invoiceSendInvoicePaidEmail(invoiceUid,requestOptions)
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
|
|
953
|
+
|
|
954
|
+
|
|
955
|
+
return { mutationFn, ...mutationOptions }}
|
|
956
|
+
|
|
957
|
+
export type InvoiceSendInvoicePaidEmailMutationResult = NonNullable<Awaited<ReturnType<typeof invoiceSendInvoicePaidEmail>>>
|
|
958
|
+
|
|
959
|
+
export type InvoiceSendInvoicePaidEmailMutationError = void
|
|
960
|
+
|
|
961
|
+
/**
|
|
962
|
+
* @summary Send the "invoice paid" receipt email to the account's billing contact.
|
|
963
|
+
*/
|
|
964
|
+
export const useInvoiceSendInvoicePaidEmail = <TError = void,
|
|
965
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof invoiceSendInvoicePaidEmail>>, TError,{invoiceUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
966
|
+
): UseMutationResult<
|
|
967
|
+
Awaited<ReturnType<typeof invoiceSendInvoicePaidEmail>>,
|
|
968
|
+
TError,
|
|
969
|
+
{invoiceUid: string | null},
|
|
970
|
+
TContext
|
|
971
|
+
> => {
|
|
972
|
+
|
|
973
|
+
const mutationOptions = getInvoiceSendInvoicePaidEmailMutationOptions(options);
|
|
974
|
+
|
|
975
|
+
return useMutation(mutationOptions);
|
|
976
|
+
}
|
|
977
|
+
/**
|
|
508
978
|
* @summary Retrieves a subscription.
|
|
509
979
|
*/
|
|
510
980
|
export const subscriptionGetSubscription = (
|
|
@@ -637,8 +1107,9 @@ export const useSubscriptionAddDiscountToSubscription = <TError = void,
|
|
|
637
1107
|
return useMutation(mutationOptions);
|
|
638
1108
|
}
|
|
639
1109
|
/**
|
|
640
|
-
*
|
|
641
|
-
|
|
1110
|
+
* When a subscription is flagged, next time the user authenticates the authentication
|
|
1111
|
+
widget will prompt the user to change plan.
|
|
1112
|
+
* @summary Indicate that an upgrade of plan is required.
|
|
642
1113
|
*/
|
|
643
1114
|
export const subscriptionSetSubscriptionUpgradeRequired = (
|
|
644
1115
|
subscriptionUid: string | null,
|
|
@@ -686,8 +1157,7 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
|
686
1157
|
export type SubscriptionSetSubscriptionUpgradeRequiredMutationError = void
|
|
687
1158
|
|
|
688
1159
|
/**
|
|
689
|
-
* @summary Indicate that an upgrade of plan is required.
|
|
690
|
-
the user authenticates the authentication widget will prompt the user to change plan.
|
|
1160
|
+
* @summary Indicate that an upgrade of plan is required.
|
|
691
1161
|
*/
|
|
692
1162
|
export const useSubscriptionSetSubscriptionUpgradeRequired = <TError = void,
|
|
693
1163
|
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof subscriptionSetSubscriptionUpgradeRequired>>, TError,{subscriptionUid: string | null;data: SubscriptionSetSubscriptionUpgradeRequiredBody}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
@@ -703,10 +1173,11 @@ export const useSubscriptionSetSubscriptionUpgradeRequired = <TError = void,
|
|
|
703
1173
|
return useMutation(mutationOptions);
|
|
704
1174
|
}
|
|
705
1175
|
/**
|
|
706
|
-
*
|
|
707
|
-
with this subscription.
|
|
708
|
-
|
|
709
|
-
|
|
1176
|
+
* Returns an invoice object with information about the amount outstanding if an account
|
|
1177
|
+
were to register with this subscription. BillingRenewalTerm values: 1 = Monthly,
|
|
1178
|
+
2 = Yearly, 3 = Quarterly, 4 = OneTime. Pass asOf=renewal to see the renewal invoice
|
|
1179
|
+
instead of the initial invoice.
|
|
1180
|
+
* @summary Preview the initial or renewal invoice for a hypothetical subscription.
|
|
710
1181
|
*/
|
|
711
1182
|
export const subscriptionFirstTimeSubscriptionPreview = (
|
|
712
1183
|
subscriptionFirstTimeSubscriptionPreviewBody: SubscriptionFirstTimeSubscriptionPreviewBody,
|
|
@@ -756,10 +1227,7 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
|
756
1227
|
export type SubscriptionFirstTimeSubscriptionPreviewMutationError = unknown
|
|
757
1228
|
|
|
758
1229
|
/**
|
|
759
|
-
* @summary Preview
|
|
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.
|
|
1230
|
+
* @summary Preview the initial or renewal invoice for a hypothetical subscription.
|
|
763
1231
|
*/
|
|
764
1232
|
export const useSubscriptionFirstTimeSubscriptionPreview = <TError = unknown,
|
|
765
1233
|
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof subscriptionFirstTimeSubscriptionPreview>>, TError,{data: SubscriptionFirstTimeSubscriptionPreviewBody;params?: SubscriptionFirstTimeSubscriptionPreviewParams}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
@@ -775,8 +1243,8 @@ export const useSubscriptionFirstTimeSubscriptionPreview = <TError = unknown,
|
|
|
775
1243
|
return useMutation(mutationOptions);
|
|
776
1244
|
}
|
|
777
1245
|
/**
|
|
778
|
-
*
|
|
779
|
-
|
|
1246
|
+
* Returns an invoice object with information about the amount outstanding.
|
|
1247
|
+
* @summary Add a subscription to an account for the first time.
|
|
780
1248
|
*/
|
|
781
1249
|
export const subscriptionFirstTimeSubscription = (
|
|
782
1250
|
subscriptionFirstTimeSubscriptionBody: SubscriptionFirstTimeSubscriptionBody,
|
|
@@ -823,8 +1291,7 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
|
823
1291
|
export type SubscriptionFirstTimeSubscriptionMutationError = void
|
|
824
1292
|
|
|
825
1293
|
/**
|
|
826
|
-
* @summary Add a subscription to an account for the first time.
|
|
827
|
-
with information about the amount outstanding.
|
|
1294
|
+
* @summary Add a subscription to an account for the first time.
|
|
828
1295
|
*/
|
|
829
1296
|
export const useSubscriptionFirstTimeSubscription = <TError = void,
|
|
830
1297
|
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof subscriptionFirstTimeSubscription>>, TError,{data: SubscriptionFirstTimeSubscriptionBody}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
@@ -840,8 +1307,9 @@ export const useSubscriptionFirstTimeSubscription = <TError = void,
|
|
|
840
1307
|
return useMutation(mutationOptions);
|
|
841
1308
|
}
|
|
842
1309
|
/**
|
|
843
|
-
*
|
|
844
|
-
|
|
1310
|
+
* Returns an invoice object with information about the amount outstanding. This method
|
|
1311
|
+
does not commit the subscription change.
|
|
1312
|
+
* @summary Preview the invoice for a subscription change.
|
|
845
1313
|
*/
|
|
846
1314
|
export const subscriptionChangeSubscriptionPreview = (
|
|
847
1315
|
subscriptionUid: string | null,
|
|
@@ -891,8 +1359,7 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
|
891
1359
|
export type SubscriptionChangeSubscriptionPreviewMutationError = void
|
|
892
1360
|
|
|
893
1361
|
/**
|
|
894
|
-
* @summary Preview
|
|
895
|
-
with information about the amount outstanding. This method does not commit the subscription change.
|
|
1362
|
+
* @summary Preview the invoice for a subscription change.
|
|
896
1363
|
*/
|
|
897
1364
|
export const useSubscriptionChangeSubscriptionPreview = <TError = void,
|
|
898
1365
|
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof subscriptionChangeSubscriptionPreview>>, TError,{subscriptionUid: string | null;data: SubscriptionChangeSubscriptionPreviewBody;params?: SubscriptionChangeSubscriptionPreviewParams}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
@@ -908,8 +1375,8 @@ export const useSubscriptionChangeSubscriptionPreview = <TError = void,
|
|
|
908
1375
|
return useMutation(mutationOptions);
|
|
909
1376
|
}
|
|
910
1377
|
/**
|
|
911
|
-
*
|
|
912
|
-
|
|
1378
|
+
* Returns an invoice object with information about the amount outstanding.
|
|
1379
|
+
* @summary Change a subscription on an account.
|
|
913
1380
|
*/
|
|
914
1381
|
export const subscriptionChangeSubscription = (
|
|
915
1382
|
subscriptionUid: string | null,
|
|
@@ -959,8 +1426,7 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
|
959
1426
|
export type SubscriptionChangeSubscriptionMutationError = void
|
|
960
1427
|
|
|
961
1428
|
/**
|
|
962
|
-
* @summary Change a subscription on an account.
|
|
963
|
-
the amount outstanding.
|
|
1429
|
+
* @summary Change a subscription on an account.
|
|
964
1430
|
*/
|
|
965
1431
|
export const useSubscriptionChangeSubscription = <TError = void,
|
|
966
1432
|
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof subscriptionChangeSubscription>>, TError,{subscriptionUid: string | null;data: SubscriptionChangeSubscriptionBody;params?: SubscriptionChangeSubscriptionParams}, TContext>, request?: SecondParameter<typeof customFetch>}
|