@@ -182,6 +182,18 @@ import type {
182
182
ListOfferingPlansData ,
183
183
ListOfferingFeaturesData ,
184
184
ListOfferingProductsData ,
185
+ ListSubscriptionsData ,
186
+ GetSubscriptionData ,
187
+ ListSubscriptionProductsData ,
188
+ ListSubscriptionPlansData ,
189
+ ListSubscriptionStatesData ,
190
+ GetSubscriptionStateData ,
191
+ ListSubscriptionInvoicesData ,
192
+ ListSubscriptionInvoicePaymentsData ,
193
+ GetSubscriptionInvoicePaymentData ,
194
+ GetSubscriptionInvoiceData ,
195
+ ListInvoicesData ,
196
+ GetInvoiceData ,
185
197
GetFeatureData ,
186
198
GetStockData ,
187
199
ListLocationsData ,
@@ -311,6 +323,18 @@ import {
311
323
listOfferingPlans ,
312
324
listOfferingFeatures ,
313
325
listOfferingProducts ,
326
+ listSubscriptions ,
327
+ getSubscription ,
328
+ listSubscriptionProducts ,
329
+ listSubscriptionPlans ,
330
+ listSubscriptionStates ,
331
+ getSubscriptionState ,
332
+ listSubscriptionInvoices ,
333
+ listSubscriptionInvoicePayments ,
334
+ getSubscriptionInvoicePayment ,
335
+ getSubscriptionInvoice ,
336
+ listInvoices ,
337
+ getInvoice ,
314
338
getFeature ,
315
339
getStock ,
316
340
listLocations ,
@@ -2621,6 +2645,254 @@ export const listOfferingProductsOptions = (
2621
2645
} )
2622
2646
}
2623
2647
2648
+ export const listSubscriptionsQueryKey = (
2649
+ options ?: Options < ListSubscriptionsData > ,
2650
+ ) => [ createQueryKey ( "listSubscriptions" , options ) ]
2651
+
2652
+ export const listSubscriptionsOptions = (
2653
+ options ?: Options < ListSubscriptionsData > ,
2654
+ ) => {
2655
+ return queryOptions ( {
2656
+ queryFn : async ( { queryKey, signal } ) => {
2657
+ const { data } = await listSubscriptions ( {
2658
+ ...options ,
2659
+ ...queryKey [ 0 ] ,
2660
+ signal,
2661
+ throwOnError : true ,
2662
+ } )
2663
+ return data
2664
+ } ,
2665
+ queryKey : listSubscriptionsQueryKey ( options ) ,
2666
+ } )
2667
+ }
2668
+
2669
+ export const getSubscriptionQueryKey = (
2670
+ options : Options < GetSubscriptionData > ,
2671
+ ) => [ createQueryKey ( "getSubscription" , options ) ]
2672
+
2673
+ export const getSubscriptionOptions = (
2674
+ options : Options < GetSubscriptionData > ,
2675
+ ) => {
2676
+ return queryOptions ( {
2677
+ queryFn : async ( { queryKey, signal } ) => {
2678
+ const { data } = await getSubscription ( {
2679
+ ...options ,
2680
+ ...queryKey [ 0 ] ,
2681
+ signal,
2682
+ throwOnError : true ,
2683
+ } )
2684
+ return data
2685
+ } ,
2686
+ queryKey : getSubscriptionQueryKey ( options ) ,
2687
+ } )
2688
+ }
2689
+
2690
+ export const listSubscriptionProductsQueryKey = (
2691
+ options : Options < ListSubscriptionProductsData > ,
2692
+ ) => [ createQueryKey ( "listSubscriptionProducts" , options ) ]
2693
+
2694
+ export const listSubscriptionProductsOptions = (
2695
+ options : Options < ListSubscriptionProductsData > ,
2696
+ ) => {
2697
+ return queryOptions ( {
2698
+ queryFn : async ( { queryKey, signal } ) => {
2699
+ const { data } = await listSubscriptionProducts ( {
2700
+ ...options ,
2701
+ ...queryKey [ 0 ] ,
2702
+ signal,
2703
+ throwOnError : true ,
2704
+ } )
2705
+ return data
2706
+ } ,
2707
+ queryKey : listSubscriptionProductsQueryKey ( options ) ,
2708
+ } )
2709
+ }
2710
+
2711
+ export const listSubscriptionPlansQueryKey = (
2712
+ options : Options < ListSubscriptionPlansData > ,
2713
+ ) => [ createQueryKey ( "listSubscriptionPlans" , options ) ]
2714
+
2715
+ export const listSubscriptionPlansOptions = (
2716
+ options : Options < ListSubscriptionPlansData > ,
2717
+ ) => {
2718
+ return queryOptions ( {
2719
+ queryFn : async ( { queryKey, signal } ) => {
2720
+ const { data } = await listSubscriptionPlans ( {
2721
+ ...options ,
2722
+ ...queryKey [ 0 ] ,
2723
+ signal,
2724
+ throwOnError : true ,
2725
+ } )
2726
+ return data
2727
+ } ,
2728
+ queryKey : listSubscriptionPlansQueryKey ( options ) ,
2729
+ } )
2730
+ }
2731
+
2732
+ export const listSubscriptionStatesQueryKey = (
2733
+ options : Options < ListSubscriptionStatesData > ,
2734
+ ) => [ createQueryKey ( "listSubscriptionStates" , options ) ]
2735
+
2736
+ export const listSubscriptionStatesOptions = (
2737
+ options : Options < ListSubscriptionStatesData > ,
2738
+ ) => {
2739
+ return queryOptions ( {
2740
+ queryFn : async ( { queryKey, signal } ) => {
2741
+ const { data } = await listSubscriptionStates ( {
2742
+ ...options ,
2743
+ ...queryKey [ 0 ] ,
2744
+ signal,
2745
+ throwOnError : true ,
2746
+ } )
2747
+ return data
2748
+ } ,
2749
+ queryKey : listSubscriptionStatesQueryKey ( options ) ,
2750
+ } )
2751
+ }
2752
+
2753
+ export const getSubscriptionStateQueryKey = (
2754
+ options : Options < GetSubscriptionStateData > ,
2755
+ ) => [ createQueryKey ( "getSubscriptionState" , options ) ]
2756
+
2757
+ export const getSubscriptionStateOptions = (
2758
+ options : Options < GetSubscriptionStateData > ,
2759
+ ) => {
2760
+ return queryOptions ( {
2761
+ queryFn : async ( { queryKey, signal } ) => {
2762
+ const { data } = await getSubscriptionState ( {
2763
+ ...options ,
2764
+ ...queryKey [ 0 ] ,
2765
+ signal,
2766
+ throwOnError : true ,
2767
+ } )
2768
+ return data
2769
+ } ,
2770
+ queryKey : getSubscriptionStateQueryKey ( options ) ,
2771
+ } )
2772
+ }
2773
+
2774
+ export const listSubscriptionInvoicesQueryKey = (
2775
+ options : Options < ListSubscriptionInvoicesData > ,
2776
+ ) => [ createQueryKey ( "listSubscriptionInvoices" , options ) ]
2777
+
2778
+ export const listSubscriptionInvoicesOptions = (
2779
+ options : Options < ListSubscriptionInvoicesData > ,
2780
+ ) => {
2781
+ return queryOptions ( {
2782
+ queryFn : async ( { queryKey, signal } ) => {
2783
+ const { data } = await listSubscriptionInvoices ( {
2784
+ ...options ,
2785
+ ...queryKey [ 0 ] ,
2786
+ signal,
2787
+ throwOnError : true ,
2788
+ } )
2789
+ return data
2790
+ } ,
2791
+ queryKey : listSubscriptionInvoicesQueryKey ( options ) ,
2792
+ } )
2793
+ }
2794
+
2795
+ export const listSubscriptionInvoicePaymentsQueryKey = (
2796
+ options : Options < ListSubscriptionInvoicePaymentsData > ,
2797
+ ) => [ createQueryKey ( "listSubscriptionInvoicePayments" , options ) ]
2798
+
2799
+ export const listSubscriptionInvoicePaymentsOptions = (
2800
+ options : Options < ListSubscriptionInvoicePaymentsData > ,
2801
+ ) => {
2802
+ return queryOptions ( {
2803
+ queryFn : async ( { queryKey, signal } ) => {
2804
+ const { data } = await listSubscriptionInvoicePayments ( {
2805
+ ...options ,
2806
+ ...queryKey [ 0 ] ,
2807
+ signal,
2808
+ throwOnError : true ,
2809
+ } )
2810
+ return data
2811
+ } ,
2812
+ queryKey : listSubscriptionInvoicePaymentsQueryKey ( options ) ,
2813
+ } )
2814
+ }
2815
+
2816
+ export const getSubscriptionInvoicePaymentQueryKey = (
2817
+ options : Options < GetSubscriptionInvoicePaymentData > ,
2818
+ ) => [ createQueryKey ( "getSubscriptionInvoicePayment" , options ) ]
2819
+
2820
+ export const getSubscriptionInvoicePaymentOptions = (
2821
+ options : Options < GetSubscriptionInvoicePaymentData > ,
2822
+ ) => {
2823
+ return queryOptions ( {
2824
+ queryFn : async ( { queryKey, signal } ) => {
2825
+ const { data } = await getSubscriptionInvoicePayment ( {
2826
+ ...options ,
2827
+ ...queryKey [ 0 ] ,
2828
+ signal,
2829
+ throwOnError : true ,
2830
+ } )
2831
+ return data
2832
+ } ,
2833
+ queryKey : getSubscriptionInvoicePaymentQueryKey ( options ) ,
2834
+ } )
2835
+ }
2836
+
2837
+ export const getSubscriptionInvoiceQueryKey = (
2838
+ options : Options < GetSubscriptionInvoiceData > ,
2839
+ ) => [ createQueryKey ( "getSubscriptionInvoice" , options ) ]
2840
+
2841
+ export const getSubscriptionInvoiceOptions = (
2842
+ options : Options < GetSubscriptionInvoiceData > ,
2843
+ ) => {
2844
+ return queryOptions ( {
2845
+ queryFn : async ( { queryKey, signal } ) => {
2846
+ const { data } = await getSubscriptionInvoice ( {
2847
+ ...options ,
2848
+ ...queryKey [ 0 ] ,
2849
+ signal,
2850
+ throwOnError : true ,
2851
+ } )
2852
+ return data
2853
+ } ,
2854
+ queryKey : getSubscriptionInvoiceQueryKey ( options ) ,
2855
+ } )
2856
+ }
2857
+
2858
+ export const listInvoicesQueryKey = ( options ?: Options < ListInvoicesData > ) => [
2859
+ createQueryKey ( "listInvoices" , options ) ,
2860
+ ]
2861
+
2862
+ export const listInvoicesOptions = ( options ?: Options < ListInvoicesData > ) => {
2863
+ return queryOptions ( {
2864
+ queryFn : async ( { queryKey, signal } ) => {
2865
+ const { data } = await listInvoices ( {
2866
+ ...options ,
2867
+ ...queryKey [ 0 ] ,
2868
+ signal,
2869
+ throwOnError : true ,
2870
+ } )
2871
+ return data
2872
+ } ,
2873
+ queryKey : listInvoicesQueryKey ( options ) ,
2874
+ } )
2875
+ }
2876
+
2877
+ export const getInvoiceQueryKey = ( options : Options < GetInvoiceData > ) => [
2878
+ createQueryKey ( "getInvoice" , options ) ,
2879
+ ]
2880
+
2881
+ export const getInvoiceOptions = ( options : Options < GetInvoiceData > ) => {
2882
+ return queryOptions ( {
2883
+ queryFn : async ( { queryKey, signal } ) => {
2884
+ const { data } = await getInvoice ( {
2885
+ ...options ,
2886
+ ...queryKey [ 0 ] ,
2887
+ signal,
2888
+ throwOnError : true ,
2889
+ } )
2890
+ return data
2891
+ } ,
2892
+ queryKey : getInvoiceQueryKey ( options ) ,
2893
+ } )
2894
+ }
2895
+
2624
2896
export const getFeatureQueryKey = ( options : Options < GetFeatureData > ) => [
2625
2897
createQueryKey ( "getFeature" , options ) ,
2626
2898
]
0 commit comments