@squonk/account-server-client 4.2.5 → 4.3.1

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.
Files changed (84) hide show
  1. package/asset/asset.cjs +99 -126
  2. package/asset/asset.cjs.map +1 -1
  3. package/asset/asset.d.cts +99 -99
  4. package/asset/asset.d.ts +99 -99
  5. package/asset/asset.js +107 -134
  6. package/asset/asset.js.map +1 -1
  7. package/charges/charges.cjs +73 -85
  8. package/charges/charges.cjs.map +1 -1
  9. package/charges/charges.d.cts +47 -47
  10. package/charges/charges.d.ts +47 -47
  11. package/charges/charges.js +78 -90
  12. package/charges/charges.js.map +1 -1
  13. package/chunk-3WKSNKHE.js +25 -0
  14. package/chunk-3WKSNKHE.js.map +1 -0
  15. package/chunk-NY2VJJG7.cjs +25 -0
  16. package/chunk-NY2VJJG7.cjs.map +1 -0
  17. package/{chunk-TKLTUR4R.cjs → chunk-RB2KVIEK.cjs} +1 -1
  18. package/chunk-RB2KVIEK.cjs.map +1 -0
  19. package/{chunk-EBOQPVLG.js → chunk-XYDLYMQ2.js} +1 -1
  20. package/chunk-XYDLYMQ2.js.map +1 -0
  21. package/event-stream/event-stream.cjs +53 -61
  22. package/event-stream/event-stream.cjs.map +1 -1
  23. package/event-stream/event-stream.d.cts +44 -44
  24. package/event-stream/event-stream.d.ts +44 -44
  25. package/event-stream/event-stream.js +58 -66
  26. package/event-stream/event-stream.js.map +1 -1
  27. package/index.cjs +49 -58
  28. package/index.cjs.map +1 -1
  29. package/index.d.cts +783 -765
  30. package/index.d.ts +783 -765
  31. package/index.js +48 -57
  32. package/index.js.map +1 -1
  33. package/merchant/merchant.cjs +38 -45
  34. package/merchant/merchant.cjs.map +1 -1
  35. package/merchant/merchant.d.cts +25 -25
  36. package/merchant/merchant.d.ts +25 -25
  37. package/merchant/merchant.js +42 -49
  38. package/merchant/merchant.js.map +1 -1
  39. package/organisation/organisation.cjs +77 -87
  40. package/organisation/organisation.cjs.map +1 -1
  41. package/organisation/organisation.d.cts +72 -70
  42. package/organisation/organisation.d.ts +72 -70
  43. package/organisation/organisation.js +83 -93
  44. package/organisation/organisation.js.map +1 -1
  45. package/package.json +13 -16
  46. package/product/product.cjs +143 -153
  47. package/product/product.cjs.map +1 -1
  48. package/product/product.d.cts +100 -100
  49. package/product/product.d.ts +100 -100
  50. package/product/product.js +153 -163
  51. package/product/product.js.map +1 -1
  52. package/src/account-server-api.schemas.ts +862 -860
  53. package/src/asset/asset.ts +899 -634
  54. package/src/charges/charges.ts +822 -498
  55. package/src/custom-instance.ts +3 -3
  56. package/src/event-stream/event-stream.ts +530 -344
  57. package/src/index.ts +2 -2
  58. package/src/merchant/merchant.ts +355 -234
  59. package/src/options-mutator.ts +27 -0
  60. package/src/organisation/organisation.ts +812 -504
  61. package/src/product/product.ts +1373 -841
  62. package/src/state/state.ts +174 -127
  63. package/src/unit/unit.ts +1273 -603
  64. package/src/user/user.ts +895 -564
  65. package/state/state.cjs +22 -24
  66. package/state/state.cjs.map +1 -1
  67. package/state/state.d.cts +14 -14
  68. package/state/state.d.ts +14 -14
  69. package/state/state.js +24 -26
  70. package/state/state.js.map +1 -1
  71. package/unit/unit.cjs +171 -106
  72. package/unit/unit.cjs.map +1 -1
  73. package/unit/unit.d.cts +200 -90
  74. package/unit/unit.d.ts +200 -90
  75. package/unit/unit.js +179 -114
  76. package/unit/unit.js.map +1 -1
  77. package/user/user.cjs +94 -110
  78. package/user/user.cjs.map +1 -1
  79. package/user/user.d.cts +77 -77
  80. package/user/user.d.ts +77 -77
  81. package/user/user.js +101 -117
  82. package/user/user.js.map +1 -1
  83. package/chunk-EBOQPVLG.js.map +0 -1
  84. package/chunk-TKLTUR4R.cjs.map +0 -1
@@ -1,8 +1,8 @@
1
- import { UseQueryOptions, DataTag, QueryKey, DefinedInitialDataOptions, DefinedUseQueryResult, UndefinedInitialDataOptions, UseQueryResult, UseSuspenseQueryOptions, UseSuspenseQueryResult } from '@tanstack/react-query';
1
+ import { UseQueryOptions, DataTag, QueryKey, DefinedInitialDataOptions, QueryClient, DefinedUseQueryResult, UndefinedInitialDataOptions, UseQueryResult, UseSuspenseQueryOptions, UseSuspenseQueryResult } from '@tanstack/react-query';
2
2
  import { customInstance, MerchantsGetResponse, ErrorType, AsError, MerchantDetail } from '../index.cjs';
3
3
  import 'axios';
4
4
 
5
- type SecondParameter<T extends (...args: any) => any> = Parameters<T>[1];
5
+ type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
6
6
  /**
7
7
  * Gets Merchants known to the Account Server
8
8
 
@@ -11,8 +11,8 @@ Merchants are software services (SaaS assets) whose facilities are known to and
11
11
  * @summary Gets all Merchants
12
12
  */
13
13
  declare const getMerchants: (options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<MerchantsGetResponse>;
14
- declare const getGetMerchantsQueryKey: () => readonly ["account-server-api", "/merchant"];
15
- declare const getGetMerchantsQueryOptions: <TData = MerchantsGetResponse, TError = ErrorType<void | AsError>>(options?: {
14
+ declare const getGetMerchantsQueryKey: () => readonly ["/merchant"];
15
+ declare const useGetMerchantsQueryOptions: <TData = Awaited<ReturnType<typeof getMerchants>>, TError = ErrorType<AsError | void>>(options?: {
16
16
  query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>;
17
17
  request?: SecondParameter<typeof customInstance>;
18
18
  }) => UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData> & {
@@ -21,24 +21,24 @@ declare const getGetMerchantsQueryOptions: <TData = MerchantsGetResponse, TError
21
21
  type GetMerchantsQueryResult = NonNullable<Awaited<ReturnType<typeof getMerchants>>>;
22
22
  type GetMerchantsQueryError = ErrorType<AsError | void>;
23
23
  declare function useGetMerchants<TData = Awaited<ReturnType<typeof getMerchants>>, TError = ErrorType<AsError | void>>(options: {
24
- query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>> & Pick<DefinedInitialDataOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>, 'initialData'>;
24
+ query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>> & Pick<DefinedInitialDataOptions<Awaited<ReturnType<typeof getMerchants>>, TError, Awaited<ReturnType<typeof getMerchants>>>, "initialData">;
25
25
  request?: SecondParameter<typeof customInstance>;
26
- }): DefinedUseQueryResult<TData, TError> & {
26
+ }, queryClient?: QueryClient): DefinedUseQueryResult<TData, TError> & {
27
27
  queryKey: DataTag<QueryKey, TData, TError>;
28
28
  };
29
29
  declare function useGetMerchants<TData = Awaited<ReturnType<typeof getMerchants>>, TError = ErrorType<AsError | void>>(options?: {
30
- query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>> & Pick<UndefinedInitialDataOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>, 'initialData'>;
30
+ query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>> & Pick<UndefinedInitialDataOptions<Awaited<ReturnType<typeof getMerchants>>, TError, Awaited<ReturnType<typeof getMerchants>>>, "initialData">;
31
31
  request?: SecondParameter<typeof customInstance>;
32
- }): UseQueryResult<TData, TError> & {
32
+ }, queryClient?: QueryClient): UseQueryResult<TData, TError> & {
33
33
  queryKey: DataTag<QueryKey, TData, TError>;
34
34
  };
35
35
  declare function useGetMerchants<TData = Awaited<ReturnType<typeof getMerchants>>, TError = ErrorType<AsError | void>>(options?: {
36
36
  query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>;
37
37
  request?: SecondParameter<typeof customInstance>;
38
- }): UseQueryResult<TData, TError> & {
38
+ }, queryClient?: QueryClient): UseQueryResult<TData, TError> & {
39
39
  queryKey: DataTag<QueryKey, TData, TError>;
40
40
  };
41
- declare const getGetMerchantsSuspenseQueryOptions: <TData = MerchantsGetResponse, TError = ErrorType<void | AsError>>(options?: {
41
+ declare const useGetMerchantsSuspenseQueryOptions: <TData = Awaited<ReturnType<typeof getMerchants>>, TError = ErrorType<AsError | void>>(options?: {
42
42
  query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>;
43
43
  request?: SecondParameter<typeof customInstance>;
44
44
  }) => UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData> & {
@@ -49,19 +49,19 @@ type GetMerchantsSuspenseQueryError = ErrorType<AsError | void>;
49
49
  declare function useGetMerchantsSuspense<TData = Awaited<ReturnType<typeof getMerchants>>, TError = ErrorType<AsError | void>>(options: {
50
50
  query: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>;
51
51
  request?: SecondParameter<typeof customInstance>;
52
- }): UseSuspenseQueryResult<TData, TError> & {
52
+ }, queryClient?: QueryClient): UseSuspenseQueryResult<TData, TError> & {
53
53
  queryKey: DataTag<QueryKey, TData, TError>;
54
54
  };
55
55
  declare function useGetMerchantsSuspense<TData = Awaited<ReturnType<typeof getMerchants>>, TError = ErrorType<AsError | void>>(options?: {
56
56
  query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>;
57
57
  request?: SecondParameter<typeof customInstance>;
58
- }): UseSuspenseQueryResult<TData, TError> & {
58
+ }, queryClient?: QueryClient): UseSuspenseQueryResult<TData, TError> & {
59
59
  queryKey: DataTag<QueryKey, TData, TError>;
60
60
  };
61
61
  declare function useGetMerchantsSuspense<TData = Awaited<ReturnType<typeof getMerchants>>, TError = ErrorType<AsError | void>>(options?: {
62
62
  query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>;
63
63
  request?: SecondParameter<typeof customInstance>;
64
- }): UseSuspenseQueryResult<TData, TError> & {
64
+ }, queryClient?: QueryClient): UseSuspenseQueryResult<TData, TError> & {
65
65
  queryKey: DataTag<QueryKey, TData, TError>;
66
66
  };
67
67
  /**
@@ -70,8 +70,8 @@ declare function useGetMerchantsSuspense<TData = Awaited<ReturnType<typeof getMe
70
70
  * @summary Gets a specific Merchant
71
71
  */
72
72
  declare const getService: (mId: number, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<MerchantDetail>;
73
- declare const getGetServiceQueryKey: (mId: number) => readonly ["account-server-api", `/merchant/${number}`];
74
- declare const getGetServiceQueryOptions: <TData = MerchantDetail, TError = ErrorType<void | AsError>>(mId: number, options?: {
73
+ declare const getGetServiceQueryKey: (mId: number) => readonly [`/merchant/${number}`];
74
+ declare const useGetServiceQueryOptions: <TData = Awaited<ReturnType<typeof getService>>, TError = ErrorType<AsError | void>>(mId: number, options?: {
75
75
  query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;
76
76
  request?: SecondParameter<typeof customInstance>;
77
77
  }) => UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData> & {
@@ -80,24 +80,24 @@ declare const getGetServiceQueryOptions: <TData = MerchantDetail, TError = Error
80
80
  type GetServiceQueryResult = NonNullable<Awaited<ReturnType<typeof getService>>>;
81
81
  type GetServiceQueryError = ErrorType<AsError | void>;
82
82
  declare function useGetService<TData = Awaited<ReturnType<typeof getService>>, TError = ErrorType<AsError | void>>(mId: number, options: {
83
- query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>> & Pick<DefinedInitialDataOptions<Awaited<ReturnType<typeof getService>>, TError, TData>, 'initialData'>;
83
+ query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>> & Pick<DefinedInitialDataOptions<Awaited<ReturnType<typeof getService>>, TError, Awaited<ReturnType<typeof getService>>>, "initialData">;
84
84
  request?: SecondParameter<typeof customInstance>;
85
- }): DefinedUseQueryResult<TData, TError> & {
85
+ }, queryClient?: QueryClient): DefinedUseQueryResult<TData, TError> & {
86
86
  queryKey: DataTag<QueryKey, TData, TError>;
87
87
  };
88
88
  declare function useGetService<TData = Awaited<ReturnType<typeof getService>>, TError = ErrorType<AsError | void>>(mId: number, options?: {
89
- query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>> & Pick<UndefinedInitialDataOptions<Awaited<ReturnType<typeof getService>>, TError, TData>, 'initialData'>;
89
+ query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>> & Pick<UndefinedInitialDataOptions<Awaited<ReturnType<typeof getService>>, TError, Awaited<ReturnType<typeof getService>>>, "initialData">;
90
90
  request?: SecondParameter<typeof customInstance>;
91
- }): UseQueryResult<TData, TError> & {
91
+ }, queryClient?: QueryClient): UseQueryResult<TData, TError> & {
92
92
  queryKey: DataTag<QueryKey, TData, TError>;
93
93
  };
94
94
  declare function useGetService<TData = Awaited<ReturnType<typeof getService>>, TError = ErrorType<AsError | void>>(mId: number, options?: {
95
95
  query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;
96
96
  request?: SecondParameter<typeof customInstance>;
97
- }): UseQueryResult<TData, TError> & {
97
+ }, queryClient?: QueryClient): UseQueryResult<TData, TError> & {
98
98
  queryKey: DataTag<QueryKey, TData, TError>;
99
99
  };
100
- declare const getGetServiceSuspenseQueryOptions: <TData = MerchantDetail, TError = ErrorType<void | AsError>>(mId: number, options?: {
100
+ declare const useGetServiceSuspenseQueryOptions: <TData = Awaited<ReturnType<typeof getService>>, TError = ErrorType<AsError | void>>(mId: number, options?: {
101
101
  query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;
102
102
  request?: SecondParameter<typeof customInstance>;
103
103
  }) => UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData> & {
@@ -108,20 +108,20 @@ type GetServiceSuspenseQueryError = ErrorType<AsError | void>;
108
108
  declare function useGetServiceSuspense<TData = Awaited<ReturnType<typeof getService>>, TError = ErrorType<AsError | void>>(mId: number, options: {
109
109
  query: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;
110
110
  request?: SecondParameter<typeof customInstance>;
111
- }): UseSuspenseQueryResult<TData, TError> & {
111
+ }, queryClient?: QueryClient): UseSuspenseQueryResult<TData, TError> & {
112
112
  queryKey: DataTag<QueryKey, TData, TError>;
113
113
  };
114
114
  declare function useGetServiceSuspense<TData = Awaited<ReturnType<typeof getService>>, TError = ErrorType<AsError | void>>(mId: number, options?: {
115
115
  query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;
116
116
  request?: SecondParameter<typeof customInstance>;
117
- }): UseSuspenseQueryResult<TData, TError> & {
117
+ }, queryClient?: QueryClient): UseSuspenseQueryResult<TData, TError> & {
118
118
  queryKey: DataTag<QueryKey, TData, TError>;
119
119
  };
120
120
  declare function useGetServiceSuspense<TData = Awaited<ReturnType<typeof getService>>, TError = ErrorType<AsError | void>>(mId: number, options?: {
121
121
  query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;
122
122
  request?: SecondParameter<typeof customInstance>;
123
- }): UseSuspenseQueryResult<TData, TError> & {
123
+ }, queryClient?: QueryClient): UseSuspenseQueryResult<TData, TError> & {
124
124
  queryKey: DataTag<QueryKey, TData, TError>;
125
125
  };
126
126
 
127
- export { type GetMerchantsQueryError, type GetMerchantsQueryResult, type GetMerchantsSuspenseQueryError, type GetMerchantsSuspenseQueryResult, type GetServiceQueryError, type GetServiceQueryResult, type GetServiceSuspenseQueryError, type GetServiceSuspenseQueryResult, getGetMerchantsQueryKey, getGetMerchantsQueryOptions, getGetMerchantsSuspenseQueryOptions, getGetServiceQueryKey, getGetServiceQueryOptions, getGetServiceSuspenseQueryOptions, getMerchants, getService, useGetMerchants, useGetMerchantsSuspense, useGetService, useGetServiceSuspense };
127
+ export { type GetMerchantsQueryError, type GetMerchantsQueryResult, type GetMerchantsSuspenseQueryError, type GetMerchantsSuspenseQueryResult, type GetServiceQueryError, type GetServiceQueryResult, type GetServiceSuspenseQueryError, type GetServiceSuspenseQueryResult, getGetMerchantsQueryKey, getGetServiceQueryKey, getMerchants, getService, useGetMerchants, useGetMerchantsQueryOptions, useGetMerchantsSuspense, useGetMerchantsSuspenseQueryOptions, useGetService, useGetServiceQueryOptions, useGetServiceSuspense, useGetServiceSuspenseQueryOptions };
@@ -1,8 +1,8 @@
1
- import { UseQueryOptions, DataTag, QueryKey, DefinedInitialDataOptions, DefinedUseQueryResult, UndefinedInitialDataOptions, UseQueryResult, UseSuspenseQueryOptions, UseSuspenseQueryResult } from '@tanstack/react-query';
1
+ import { UseQueryOptions, DataTag, QueryKey, DefinedInitialDataOptions, QueryClient, DefinedUseQueryResult, UndefinedInitialDataOptions, UseQueryResult, UseSuspenseQueryOptions, UseSuspenseQueryResult } from '@tanstack/react-query';
2
2
  import { customInstance, MerchantsGetResponse, ErrorType, AsError, MerchantDetail } from '../index.js';
3
3
  import 'axios';
4
4
 
5
- type SecondParameter<T extends (...args: any) => any> = Parameters<T>[1];
5
+ type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
6
6
  /**
7
7
  * Gets Merchants known to the Account Server
8
8
 
@@ -11,8 +11,8 @@ Merchants are software services (SaaS assets) whose facilities are known to and
11
11
  * @summary Gets all Merchants
12
12
  */
13
13
  declare const getMerchants: (options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<MerchantsGetResponse>;
14
- declare const getGetMerchantsQueryKey: () => readonly ["account-server-api", "/merchant"];
15
- declare const getGetMerchantsQueryOptions: <TData = MerchantsGetResponse, TError = ErrorType<void | AsError>>(options?: {
14
+ declare const getGetMerchantsQueryKey: () => readonly ["/merchant"];
15
+ declare const useGetMerchantsQueryOptions: <TData = Awaited<ReturnType<typeof getMerchants>>, TError = ErrorType<AsError | void>>(options?: {
16
16
  query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>;
17
17
  request?: SecondParameter<typeof customInstance>;
18
18
  }) => UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData> & {
@@ -21,24 +21,24 @@ declare const getGetMerchantsQueryOptions: <TData = MerchantsGetResponse, TError
21
21
  type GetMerchantsQueryResult = NonNullable<Awaited<ReturnType<typeof getMerchants>>>;
22
22
  type GetMerchantsQueryError = ErrorType<AsError | void>;
23
23
  declare function useGetMerchants<TData = Awaited<ReturnType<typeof getMerchants>>, TError = ErrorType<AsError | void>>(options: {
24
- query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>> & Pick<DefinedInitialDataOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>, 'initialData'>;
24
+ query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>> & Pick<DefinedInitialDataOptions<Awaited<ReturnType<typeof getMerchants>>, TError, Awaited<ReturnType<typeof getMerchants>>>, "initialData">;
25
25
  request?: SecondParameter<typeof customInstance>;
26
- }): DefinedUseQueryResult<TData, TError> & {
26
+ }, queryClient?: QueryClient): DefinedUseQueryResult<TData, TError> & {
27
27
  queryKey: DataTag<QueryKey, TData, TError>;
28
28
  };
29
29
  declare function useGetMerchants<TData = Awaited<ReturnType<typeof getMerchants>>, TError = ErrorType<AsError | void>>(options?: {
30
- query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>> & Pick<UndefinedInitialDataOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>, 'initialData'>;
30
+ query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>> & Pick<UndefinedInitialDataOptions<Awaited<ReturnType<typeof getMerchants>>, TError, Awaited<ReturnType<typeof getMerchants>>>, "initialData">;
31
31
  request?: SecondParameter<typeof customInstance>;
32
- }): UseQueryResult<TData, TError> & {
32
+ }, queryClient?: QueryClient): UseQueryResult<TData, TError> & {
33
33
  queryKey: DataTag<QueryKey, TData, TError>;
34
34
  };
35
35
  declare function useGetMerchants<TData = Awaited<ReturnType<typeof getMerchants>>, TError = ErrorType<AsError | void>>(options?: {
36
36
  query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>;
37
37
  request?: SecondParameter<typeof customInstance>;
38
- }): UseQueryResult<TData, TError> & {
38
+ }, queryClient?: QueryClient): UseQueryResult<TData, TError> & {
39
39
  queryKey: DataTag<QueryKey, TData, TError>;
40
40
  };
41
- declare const getGetMerchantsSuspenseQueryOptions: <TData = MerchantsGetResponse, TError = ErrorType<void | AsError>>(options?: {
41
+ declare const useGetMerchantsSuspenseQueryOptions: <TData = Awaited<ReturnType<typeof getMerchants>>, TError = ErrorType<AsError | void>>(options?: {
42
42
  query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>;
43
43
  request?: SecondParameter<typeof customInstance>;
44
44
  }) => UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData> & {
@@ -49,19 +49,19 @@ type GetMerchantsSuspenseQueryError = ErrorType<AsError | void>;
49
49
  declare function useGetMerchantsSuspense<TData = Awaited<ReturnType<typeof getMerchants>>, TError = ErrorType<AsError | void>>(options: {
50
50
  query: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>;
51
51
  request?: SecondParameter<typeof customInstance>;
52
- }): UseSuspenseQueryResult<TData, TError> & {
52
+ }, queryClient?: QueryClient): UseSuspenseQueryResult<TData, TError> & {
53
53
  queryKey: DataTag<QueryKey, TData, TError>;
54
54
  };
55
55
  declare function useGetMerchantsSuspense<TData = Awaited<ReturnType<typeof getMerchants>>, TError = ErrorType<AsError | void>>(options?: {
56
56
  query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>;
57
57
  request?: SecondParameter<typeof customInstance>;
58
- }): UseSuspenseQueryResult<TData, TError> & {
58
+ }, queryClient?: QueryClient): UseSuspenseQueryResult<TData, TError> & {
59
59
  queryKey: DataTag<QueryKey, TData, TError>;
60
60
  };
61
61
  declare function useGetMerchantsSuspense<TData = Awaited<ReturnType<typeof getMerchants>>, TError = ErrorType<AsError | void>>(options?: {
62
62
  query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>;
63
63
  request?: SecondParameter<typeof customInstance>;
64
- }): UseSuspenseQueryResult<TData, TError> & {
64
+ }, queryClient?: QueryClient): UseSuspenseQueryResult<TData, TError> & {
65
65
  queryKey: DataTag<QueryKey, TData, TError>;
66
66
  };
67
67
  /**
@@ -70,8 +70,8 @@ declare function useGetMerchantsSuspense<TData = Awaited<ReturnType<typeof getMe
70
70
  * @summary Gets a specific Merchant
71
71
  */
72
72
  declare const getService: (mId: number, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<MerchantDetail>;
73
- declare const getGetServiceQueryKey: (mId: number) => readonly ["account-server-api", `/merchant/${number}`];
74
- declare const getGetServiceQueryOptions: <TData = MerchantDetail, TError = ErrorType<void | AsError>>(mId: number, options?: {
73
+ declare const getGetServiceQueryKey: (mId: number) => readonly [`/merchant/${number}`];
74
+ declare const useGetServiceQueryOptions: <TData = Awaited<ReturnType<typeof getService>>, TError = ErrorType<AsError | void>>(mId: number, options?: {
75
75
  query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;
76
76
  request?: SecondParameter<typeof customInstance>;
77
77
  }) => UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData> & {
@@ -80,24 +80,24 @@ declare const getGetServiceQueryOptions: <TData = MerchantDetail, TError = Error
80
80
  type GetServiceQueryResult = NonNullable<Awaited<ReturnType<typeof getService>>>;
81
81
  type GetServiceQueryError = ErrorType<AsError | void>;
82
82
  declare function useGetService<TData = Awaited<ReturnType<typeof getService>>, TError = ErrorType<AsError | void>>(mId: number, options: {
83
- query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>> & Pick<DefinedInitialDataOptions<Awaited<ReturnType<typeof getService>>, TError, TData>, 'initialData'>;
83
+ query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>> & Pick<DefinedInitialDataOptions<Awaited<ReturnType<typeof getService>>, TError, Awaited<ReturnType<typeof getService>>>, "initialData">;
84
84
  request?: SecondParameter<typeof customInstance>;
85
- }): DefinedUseQueryResult<TData, TError> & {
85
+ }, queryClient?: QueryClient): DefinedUseQueryResult<TData, TError> & {
86
86
  queryKey: DataTag<QueryKey, TData, TError>;
87
87
  };
88
88
  declare function useGetService<TData = Awaited<ReturnType<typeof getService>>, TError = ErrorType<AsError | void>>(mId: number, options?: {
89
- query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>> & Pick<UndefinedInitialDataOptions<Awaited<ReturnType<typeof getService>>, TError, TData>, 'initialData'>;
89
+ query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>> & Pick<UndefinedInitialDataOptions<Awaited<ReturnType<typeof getService>>, TError, Awaited<ReturnType<typeof getService>>>, "initialData">;
90
90
  request?: SecondParameter<typeof customInstance>;
91
- }): UseQueryResult<TData, TError> & {
91
+ }, queryClient?: QueryClient): UseQueryResult<TData, TError> & {
92
92
  queryKey: DataTag<QueryKey, TData, TError>;
93
93
  };
94
94
  declare function useGetService<TData = Awaited<ReturnType<typeof getService>>, TError = ErrorType<AsError | void>>(mId: number, options?: {
95
95
  query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;
96
96
  request?: SecondParameter<typeof customInstance>;
97
- }): UseQueryResult<TData, TError> & {
97
+ }, queryClient?: QueryClient): UseQueryResult<TData, TError> & {
98
98
  queryKey: DataTag<QueryKey, TData, TError>;
99
99
  };
100
- declare const getGetServiceSuspenseQueryOptions: <TData = MerchantDetail, TError = ErrorType<void | AsError>>(mId: number, options?: {
100
+ declare const useGetServiceSuspenseQueryOptions: <TData = Awaited<ReturnType<typeof getService>>, TError = ErrorType<AsError | void>>(mId: number, options?: {
101
101
  query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;
102
102
  request?: SecondParameter<typeof customInstance>;
103
103
  }) => UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData> & {
@@ -108,20 +108,20 @@ type GetServiceSuspenseQueryError = ErrorType<AsError | void>;
108
108
  declare function useGetServiceSuspense<TData = Awaited<ReturnType<typeof getService>>, TError = ErrorType<AsError | void>>(mId: number, options: {
109
109
  query: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;
110
110
  request?: SecondParameter<typeof customInstance>;
111
- }): UseSuspenseQueryResult<TData, TError> & {
111
+ }, queryClient?: QueryClient): UseSuspenseQueryResult<TData, TError> & {
112
112
  queryKey: DataTag<QueryKey, TData, TError>;
113
113
  };
114
114
  declare function useGetServiceSuspense<TData = Awaited<ReturnType<typeof getService>>, TError = ErrorType<AsError | void>>(mId: number, options?: {
115
115
  query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;
116
116
  request?: SecondParameter<typeof customInstance>;
117
- }): UseSuspenseQueryResult<TData, TError> & {
117
+ }, queryClient?: QueryClient): UseSuspenseQueryResult<TData, TError> & {
118
118
  queryKey: DataTag<QueryKey, TData, TError>;
119
119
  };
120
120
  declare function useGetServiceSuspense<TData = Awaited<ReturnType<typeof getService>>, TError = ErrorType<AsError | void>>(mId: number, options?: {
121
121
  query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;
122
122
  request?: SecondParameter<typeof customInstance>;
123
- }): UseSuspenseQueryResult<TData, TError> & {
123
+ }, queryClient?: QueryClient): UseSuspenseQueryResult<TData, TError> & {
124
124
  queryKey: DataTag<QueryKey, TData, TError>;
125
125
  };
126
126
 
127
- export { type GetMerchantsQueryError, type GetMerchantsQueryResult, type GetMerchantsSuspenseQueryError, type GetMerchantsSuspenseQueryResult, type GetServiceQueryError, type GetServiceQueryResult, type GetServiceSuspenseQueryError, type GetServiceSuspenseQueryResult, getGetMerchantsQueryKey, getGetMerchantsQueryOptions, getGetMerchantsSuspenseQueryOptions, getGetServiceQueryKey, getGetServiceQueryOptions, getGetServiceSuspenseQueryOptions, getMerchants, getService, useGetMerchants, useGetMerchantsSuspense, useGetService, useGetServiceSuspense };
127
+ export { type GetMerchantsQueryError, type GetMerchantsQueryResult, type GetMerchantsSuspenseQueryError, type GetMerchantsSuspenseQueryResult, type GetServiceQueryError, type GetServiceQueryResult, type GetServiceSuspenseQueryError, type GetServiceSuspenseQueryResult, getGetMerchantsQueryKey, getGetServiceQueryKey, getMerchants, getService, useGetMerchants, useGetMerchantsQueryOptions, useGetMerchantsSuspense, useGetMerchantsSuspenseQueryOptions, useGetService, useGetServiceQueryOptions, useGetServiceSuspense, useGetServiceSuspenseQueryOptions };
@@ -1,98 +1,91 @@
1
+ import {
2
+ queryMutator
3
+ } from "../chunk-3WKSNKHE.js";
1
4
  import {
2
5
  customInstance
3
- } from "../chunk-EBOQPVLG.js";
6
+ } from "../chunk-XYDLYMQ2.js";
4
7
 
5
8
  // src/merchant/merchant.ts
6
- import {
7
- useQuery,
8
- useSuspenseQuery
9
- } from "@tanstack/react-query";
9
+ import { useQuery, useSuspenseQuery } from "@tanstack/react-query";
10
10
  var getMerchants = (options, signal) => {
11
- return customInstance(
12
- {
13
- url: `/merchant`,
14
- method: "GET",
15
- signal
16
- },
17
- options
18
- );
11
+ return customInstance({ url: `/merchant`, method: "GET", signal }, options);
19
12
  };
20
13
  var getGetMerchantsQueryKey = () => {
21
- return ["account-server-api", `/merchant`];
14
+ return [`/merchant`];
22
15
  };
23
- var getGetMerchantsQueryOptions = (options) => {
16
+ var useGetMerchantsQueryOptions = (options) => {
24
17
  const { query: queryOptions, request: requestOptions } = options ?? {};
25
- const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetMerchantsQueryKey();
18
+ const queryKey = queryOptions?.queryKey ?? getGetMerchantsQueryKey();
26
19
  const queryFn = ({ signal }) => getMerchants(requestOptions, signal);
27
- return { queryKey, queryFn, ...queryOptions };
20
+ const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
21
+ return customOptions;
28
22
  };
29
- function useGetMerchants(options) {
30
- const queryOptions = getGetMerchantsQueryOptions(options);
31
- const query = useQuery(queryOptions);
23
+ function useGetMerchants(options, queryClient) {
24
+ const queryOptions = useGetMerchantsQueryOptions(options);
25
+ const query = useQuery(queryOptions, queryClient);
32
26
  query.queryKey = queryOptions.queryKey;
33
27
  return query;
34
28
  }
35
- var getGetMerchantsSuspenseQueryOptions = (options) => {
29
+ var useGetMerchantsSuspenseQueryOptions = (options) => {
36
30
  const { query: queryOptions, request: requestOptions } = options ?? {};
37
- const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetMerchantsQueryKey();
31
+ const queryKey = queryOptions?.queryKey ?? getGetMerchantsQueryKey();
38
32
  const queryFn = ({ signal }) => getMerchants(requestOptions, signal);
39
- return { queryKey, queryFn, ...queryOptions };
33
+ const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
34
+ return customOptions;
40
35
  };
41
- function useGetMerchantsSuspense(options) {
42
- const queryOptions = getGetMerchantsSuspenseQueryOptions(options);
43
- const query = useSuspenseQuery(queryOptions);
36
+ function useGetMerchantsSuspense(options, queryClient) {
37
+ const queryOptions = useGetMerchantsSuspenseQueryOptions(options);
38
+ const query = useSuspenseQuery(queryOptions, queryClient);
44
39
  query.queryKey = queryOptions.queryKey;
45
40
  return query;
46
41
  }
47
42
  var getService = (mId, options, signal) => {
48
43
  return customInstance(
49
- {
50
- url: `/merchant/${mId}`,
51
- method: "GET",
52
- signal
53
- },
44
+ { url: `/merchant/${mId}`, method: "GET", signal },
54
45
  options
55
46
  );
56
47
  };
57
48
  var getGetServiceQueryKey = (mId) => {
58
- return ["account-server-api", `/merchant/${mId}`];
49
+ return [`/merchant/${mId}`];
59
50
  };
60
- var getGetServiceQueryOptions = (mId, options) => {
51
+ var useGetServiceQueryOptions = (mId, options) => {
61
52
  const { query: queryOptions, request: requestOptions } = options ?? {};
62
- const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetServiceQueryKey(mId);
53
+ const queryKey = queryOptions?.queryKey ?? getGetServiceQueryKey(mId);
63
54
  const queryFn = ({ signal }) => getService(mId, requestOptions, signal);
64
- return { queryKey, queryFn, enabled: !!mId, ...queryOptions };
55
+ const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
56
+ return customOptions;
65
57
  };
66
- function useGetService(mId, options) {
67
- const queryOptions = getGetServiceQueryOptions(mId, options);
68
- const query = useQuery(queryOptions);
58
+ function useGetService(mId, options, queryClient) {
59
+ const queryOptions = useGetServiceQueryOptions(mId, options);
60
+ const query = useQuery(queryOptions, queryClient);
69
61
  query.queryKey = queryOptions.queryKey;
70
62
  return query;
71
63
  }
72
- var getGetServiceSuspenseQueryOptions = (mId, options) => {
64
+ var useGetServiceSuspenseQueryOptions = (mId, options) => {
73
65
  const { query: queryOptions, request: requestOptions } = options ?? {};
74
- const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetServiceQueryKey(mId);
66
+ const queryKey = queryOptions?.queryKey ?? getGetServiceQueryKey(mId);
75
67
  const queryFn = ({ signal }) => getService(mId, requestOptions, signal);
76
- return { queryKey, queryFn, ...queryOptions };
68
+ const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
69
+ return customOptions;
77
70
  };
78
- function useGetServiceSuspense(mId, options) {
79
- const queryOptions = getGetServiceSuspenseQueryOptions(mId, options);
80
- const query = useSuspenseQuery(queryOptions);
71
+ function useGetServiceSuspense(mId, options, queryClient) {
72
+ const queryOptions = useGetServiceSuspenseQueryOptions(mId, options);
73
+ const query = useSuspenseQuery(queryOptions, queryClient);
81
74
  query.queryKey = queryOptions.queryKey;
82
75
  return query;
83
76
  }
84
77
  export {
85
78
  getGetMerchantsQueryKey,
86
- getGetMerchantsQueryOptions,
87
- getGetMerchantsSuspenseQueryOptions,
88
79
  getGetServiceQueryKey,
89
- getGetServiceQueryOptions,
90
- getGetServiceSuspenseQueryOptions,
91
80
  getMerchants,
92
81
  getService,
93
82
  useGetMerchants,
83
+ useGetMerchantsQueryOptions,
94
84
  useGetMerchantsSuspense,
85
+ useGetMerchantsSuspenseQueryOptions,
95
86
  useGetService,
96
- useGetServiceSuspense
87
+ useGetServiceQueryOptions,
88
+ useGetServiceSuspense,
89
+ useGetServiceSuspenseQueryOptions
97
90
  };
98
91
  //# sourceMappingURL=merchant.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/merchant/merchant.ts"],"sourcesContent":["// @ts-nocheck\n/**\n * Generated by orval v7.4.1 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Organisations**, **Units**, **Products**, **Users**, and **Assets**.\n\n * OpenAPI spec version: 4.2\n */\nimport {\n useQuery,\n useSuspenseQuery\n} from '@tanstack/react-query'\nimport type {\n DataTag,\n DefinedInitialDataOptions,\n DefinedUseQueryResult,\n QueryFunction,\n QueryKey,\n UndefinedInitialDataOptions,\n UseQueryOptions,\n UseQueryResult,\n UseSuspenseQueryOptions,\n UseSuspenseQueryResult\n} from '@tanstack/react-query'\nimport type {\n AsError,\n MerchantDetail,\n MerchantsGetResponse\n} from '../account-server-api.schemas'\nimport { customInstance } from '.././custom-instance';\nimport type { ErrorType } from '.././custom-instance';\n\n\ntype SecondParameter<T extends (...args: any) => any> = Parameters<T>[1];\n\n\n/**\n * Gets Merchants known to the Account Server\n\nMerchants are software services (SaaS assets) whose facilities are known to and controlled by the Account Server\n\n * @summary Gets all Merchants\n */\nexport const getMerchants = (\n \n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<MerchantsGetResponse>(\n {url: `/merchant`, method: 'GET', signal\n },\n options);\n }\n \n\nexport const getGetMerchantsQueryKey = () => {\n return [\"account-server-api\", `/merchant`] as const;\n }\n\n \nexport const getGetMerchantsQueryOptions = <TData = Awaited<ReturnType<typeof getMerchants>>, TError = ErrorType<AsError | void>>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetMerchantsQueryKey();\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getMerchants>>> = ({ signal }) => getMerchants(requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type GetMerchantsQueryResult = NonNullable<Awaited<ReturnType<typeof getMerchants>>>\nexport type GetMerchantsQueryError = ErrorType<AsError | void>\n\n\nexport function useGetMerchants<TData = Awaited<ReturnType<typeof getMerchants>>, TError = ErrorType<AsError | void>>(\n options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getMerchants>>,\n TError,\n TData\n > , 'initialData'\n >, request?: SecondParameter<typeof customInstance>}\n\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useGetMerchants<TData = Awaited<ReturnType<typeof getMerchants>>, TError = ErrorType<AsError | void>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getMerchants>>,\n TError,\n TData\n > , 'initialData'\n >, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useGetMerchants<TData = Awaited<ReturnType<typeof getMerchants>>, TError = ErrorType<AsError | void>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary Gets all Merchants\n */\n\nexport function useGetMerchants<TData = Awaited<ReturnType<typeof getMerchants>>, TError = ErrorType<AsError | void>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getGetMerchantsQueryOptions(options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\nexport const getGetMerchantsSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getMerchants>>, TError = ErrorType<AsError | void>>( options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetMerchantsQueryKey();\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getMerchants>>> = ({ signal }) => getMerchants(requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type GetMerchantsSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getMerchants>>>\nexport type GetMerchantsSuspenseQueryError = ErrorType<AsError | void>\n\n\nexport function useGetMerchantsSuspense<TData = Awaited<ReturnType<typeof getMerchants>>, TError = ErrorType<AsError | void>>(\n options: { query:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useGetMerchantsSuspense<TData = Awaited<ReturnType<typeof getMerchants>>, TError = ErrorType<AsError | void>>(\n options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useGetMerchantsSuspense<TData = Awaited<ReturnType<typeof getMerchants>>, TError = ErrorType<AsError | void>>(\n options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary Gets all Merchants\n */\n\nexport function useGetMerchantsSuspense<TData = Awaited<ReturnType<typeof getMerchants>>, TError = ErrorType<AsError | void>>(\n options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getGetMerchantsSuspenseQueryOptions(options)\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * Gets a known Merchant\n\n * @summary Gets a specific Merchant\n */\nexport const getService = (\n mId: number,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<MerchantDetail>(\n {url: `/merchant/${mId}`, method: 'GET', signal\n },\n options);\n }\n \n\nexport const getGetServiceQueryKey = (mId: number,) => {\n return [\"account-server-api\", `/merchant/${mId}`] as const;\n }\n\n \nexport const getGetServiceQueryOptions = <TData = Awaited<ReturnType<typeof getService>>, TError = ErrorType<AsError | void>>(mId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetServiceQueryKey(mId);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getService>>> = ({ signal }) => getService(mId, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(mId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type GetServiceQueryResult = NonNullable<Awaited<ReturnType<typeof getService>>>\nexport type GetServiceQueryError = ErrorType<AsError | void>\n\n\nexport function useGetService<TData = Awaited<ReturnType<typeof getService>>, TError = ErrorType<AsError | void>>(\n mId: number, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getService>>,\n TError,\n TData\n > , 'initialData'\n >, request?: SecondParameter<typeof customInstance>}\n\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useGetService<TData = Awaited<ReturnType<typeof getService>>, TError = ErrorType<AsError | void>>(\n mId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getService>>,\n TError,\n TData\n > , 'initialData'\n >, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useGetService<TData = Awaited<ReturnType<typeof getService>>, TError = ErrorType<AsError | void>>(\n mId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary Gets a specific Merchant\n */\n\nexport function useGetService<TData = Awaited<ReturnType<typeof getService>>, TError = ErrorType<AsError | void>>(\n mId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getGetServiceQueryOptions(mId,options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\nexport const getGetServiceSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getService>>, TError = ErrorType<AsError | void>>(mId: number, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetServiceQueryKey(mId);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getService>>> = ({ signal }) => getService(mId, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type GetServiceSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getService>>>\nexport type GetServiceSuspenseQueryError = ErrorType<AsError | void>\n\n\nexport function useGetServiceSuspense<TData = Awaited<ReturnType<typeof getService>>, TError = ErrorType<AsError | void>>(\n mId: number, options: { query:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useGetServiceSuspense<TData = Awaited<ReturnType<typeof getService>>, TError = ErrorType<AsError | void>>(\n mId: number, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useGetServiceSuspense<TData = Awaited<ReturnType<typeof getService>>, TError = ErrorType<AsError | void>>(\n mId: number, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary Gets a specific Merchant\n */\n\nexport function useGetServiceSuspense<TData = Awaited<ReturnType<typeof getService>>, TError = ErrorType<AsError | void>>(\n mId: number, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getGetServiceSuspenseQueryOptions(mId,options)\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n"],"mappings":";;;;;AAWA;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAgCA,IAAM,eAAe,CAE3B,SAAiD,WAC7C;AAGC,SAAO;AAAA,IACP;AAAA,MAAC,KAAK;AAAA,MAAa,QAAQ;AAAA,MAAO;AAAA,IACpC;AAAA,IACE;AAAA,EAAO;AACT;AAGG,IAAM,0BAA0B,MAAM;AACzC,SAAO,CAAC,sBAAsB,WAAW;AACzC;AAGG,IAAM,8BAA8B,CAAwF,YAC9H;AAEL,QAAM,EAAC,OAAO,cAAc,SAAS,eAAc,IAAI,WAAW,CAAC;AAEjE,QAAM,YAAY,6CAAc,aAAY,wBAAwB;AAIlE,QAAM,UAAmE,CAAC,EAAE,OAAO,MAAM,aAAa,gBAAgB,MAAM;AAM7H,SAAQ,EAAE,UAAU,SAAS,GAAG,aAAY;AAC/C;AAkCO,SAAS,gBACd,SAEmF;AAEnF,QAAM,eAAe,4BAA4B,OAAO;AAExD,QAAM,QAAQ,SAAS,YAAY;AAEnC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;AAIO,IAAM,sCAAsC,CAAwF,YACtI;AAEL,QAAM,EAAC,OAAO,cAAc,SAAS,eAAc,IAAI,WAAW,CAAC;AAEjE,QAAM,YAAY,6CAAc,aAAY,wBAAwB;AAIlE,QAAM,UAAmE,CAAC,EAAE,OAAO,MAAM,aAAa,gBAAgB,MAAM;AAM7H,SAAQ,EAAE,UAAU,SAAS,GAAG,aAAY;AAC/C;AAsBO,SAAS,wBACd,SAE2F;AAE3F,QAAM,eAAe,oCAAoC,OAAO;AAEhE,QAAM,QAAQ,iBAAiB,YAAY;AAE3C,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;AASO,IAAM,aAAa,CACtB,KACH,SAAiD,WAC7C;AAGC,SAAO;AAAA,IACP;AAAA,MAAC,KAAK,aAAa,GAAG;AAAA,MAAI,QAAQ;AAAA,MAAO;AAAA,IAC3C;AAAA,IACE;AAAA,EAAO;AACT;AAGG,IAAM,wBAAwB,CAAC,QAAiB;AACnD,SAAO,CAAC,sBAAsB,aAAa,GAAG,EAAE;AAChD;AAGG,IAAM,4BAA4B,CAAqF,KAAa,YACtI;AAEL,QAAM,EAAC,OAAO,cAAc,SAAS,eAAc,IAAI,WAAW,CAAC;AAEjE,QAAM,YAAY,6CAAc,aAAY,sBAAsB,GAAG;AAInE,QAAM,UAAiE,CAAC,EAAE,OAAO,MAAM,WAAW,KAAK,gBAAgB,MAAM;AAM9H,SAAQ,EAAE,UAAU,SAAS,SAAS,CAAC,CAAE,KAAM,GAAG,aAAY;AACjE;AAkCO,SAAS,cACf,KAAa,SAEuE;AAEnF,QAAM,eAAe,0BAA0B,KAAI,OAAO;AAE1D,QAAM,QAAQ,SAAS,YAAY;AAEnC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;AAIO,IAAM,oCAAoC,CAAqF,KAAa,YAC9I;AAEL,QAAM,EAAC,OAAO,cAAc,SAAS,eAAc,IAAI,WAAW,CAAC;AAEjE,QAAM,YAAY,6CAAc,aAAY,sBAAsB,GAAG;AAInE,QAAM,UAAiE,CAAC,EAAE,OAAO,MAAM,WAAW,KAAK,gBAAgB,MAAM;AAM9H,SAAQ,EAAE,UAAU,SAAS,GAAG,aAAY;AAC/C;AAsBO,SAAS,sBACf,KAAa,SAE+E;AAE3F,QAAM,eAAe,kCAAkC,KAAI,OAAO;AAElE,QAAM,QAAQ,iBAAiB,YAAY;AAE3C,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../src/merchant/merchant.ts"],"sourcesContent":["/**\n * Generated by orval v7.10.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Organisations**, **Units**, **Products**, **Users**, and **Assets**.\n\n * OpenAPI spec version: 4.3\n */\nimport { useQuery, useSuspenseQuery } from \"@tanstack/react-query\";\nimport type {\n DataTag,\n DefinedInitialDataOptions,\n DefinedUseQueryResult,\n QueryClient,\n QueryFunction,\n QueryKey,\n UndefinedInitialDataOptions,\n UseQueryOptions,\n UseQueryResult,\n UseSuspenseQueryOptions,\n UseSuspenseQueryResult,\n} from \"@tanstack/react-query\";\n\nimport type { AsError, MerchantDetail, MerchantsGetResponse } from \"../account-server-api.schemas\";\n\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\nimport { queryMutator } from \".././options-mutator\";\n\ntype SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];\n\n/**\n * Gets Merchants known to the Account Server\n\nMerchants are software services (SaaS assets) whose facilities are known to and controlled by the Account Server\n\n * @summary Gets all Merchants\n */\nexport const getMerchants = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<MerchantsGetResponse>({ url: `/merchant`, method: \"GET\", signal }, options);\n};\n\nexport const getGetMerchantsQueryKey = () => {\n return [`/merchant`] as const;\n};\n\nexport const useGetMerchantsQueryOptions = <\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetMerchantsQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getMerchants>>> = ({ signal }) =>\n getMerchants(requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseQueryOptions<\n Awaited<ReturnType<typeof getMerchants>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetMerchantsQueryResult = NonNullable<Awaited<ReturnType<typeof getMerchants>>>;\nexport type GetMerchantsQueryError = ErrorType<AsError | void>;\n\nexport function useGetMerchants<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getMerchants>>,\n TError,\n Awaited<ReturnType<typeof getMerchants>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetMerchants<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>> &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getMerchants>>,\n TError,\n Awaited<ReturnType<typeof getMerchants>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetMerchants<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Gets all Merchants\n */\n\nexport function useGetMerchants<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = useGetMerchantsQueryOptions(options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData, TError>;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\nexport const useGetMerchantsSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetMerchantsQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getMerchants>>> = ({ signal }) =>\n getMerchants(requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getMerchants>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetMerchantsSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getMerchants>>>;\nexport type GetMerchantsSuspenseQueryError = ErrorType<AsError | void>;\n\nexport function useGetMerchantsSuspense<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options: {\n query: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetMerchantsSuspense<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetMerchantsSuspense<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Gets all Merchants\n */\n\nexport function useGetMerchantsSuspense<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = useGetMerchantsSuspenseQueryOptions(options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * Gets a known Merchant\n\n * @summary Gets a specific Merchant\n */\nexport const getService = (\n mId: number,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<MerchantDetail>(\n { url: `/merchant/${mId}`, method: \"GET\", signal },\n options,\n );\n};\n\nexport const getGetServiceQueryKey = (mId: number) => {\n return [`/merchant/${mId}`] as const;\n};\n\nexport const useGetServiceQueryOptions = <\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetServiceQueryKey(mId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getService>>> = ({ signal }) =>\n getService(mId, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData> & {\n queryKey: DataTag<QueryKey, TData, TError>;\n };\n};\n\nexport type GetServiceQueryResult = NonNullable<Awaited<ReturnType<typeof getService>>>;\nexport type GetServiceQueryError = ErrorType<AsError | void>;\n\nexport function useGetService<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getService>>,\n TError,\n Awaited<ReturnType<typeof getService>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetService<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>> &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getService>>,\n TError,\n Awaited<ReturnType<typeof getService>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetService<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Gets a specific Merchant\n */\n\nexport function useGetService<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = useGetServiceQueryOptions(mId, options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData, TError>;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\nexport const useGetServiceSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetServiceQueryKey(mId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getService>>> = ({ signal }) =>\n getService(mId, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getService>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetServiceSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getService>>>;\nexport type GetServiceSuspenseQueryError = ErrorType<AsError | void>;\n\nexport function useGetServiceSuspense<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options: {\n query: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetServiceSuspense<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetServiceSuspense<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Gets a specific Merchant\n */\n\nexport function useGetServiceSuspense<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = useGetServiceSuspenseQueryOptions(mId, options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n"],"mappings":";;;;;;;;AAUA,SAAS,UAAU,wBAAwB;AA8BpC,IAAM,eAAe,CAC1B,SACA,WACG;AACH,SAAO,eAAqC,EAAE,KAAK,aAAa,QAAQ,OAAO,OAAO,GAAG,OAAO;AAClG;AAEO,IAAM,0BAA0B,MAAM;AAC3C,SAAO,CAAC,WAAW;AACrB;AAEO,IAAM,8BAA8B,CAGzC,YAGI;AACJ,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,WAAW,cAAc,YAAY,wBAAwB;AAEnE,QAAM,UAAmE,CAAC,EAAE,OAAO,MACjF,aAAa,gBAAgB,MAAM;AAErC,QAAM,gBAAgB,aAAa,EAAE,GAAG,cAAc,UAAU,QAAQ,CAAC;AAEzE,SAAO;AAKT;AAuDO,SAAS,gBAId,SAIA,aACgF;AAChF,QAAM,eAAe,4BAA4B,OAAO;AAExD,QAAM,QAAQ,SAAS,cAAc,WAAW;AAIhD,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;AAEO,IAAM,sCAAsC,CAGjD,YAGI;AACJ,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,WAAW,cAAc,YAAY,wBAAwB;AAEnE,QAAM,UAAmE,CAAC,EAAE,OAAO,MACjF,aAAa,gBAAgB,MAAM;AAErC,QAAM,gBAAgB,aAAa,EAAE,GAAG,cAAc,UAAU,QAAQ,CAAC;AAEzE,SAAO;AAKT;AA6CO,SAAS,wBAId,SAMA,aACwF;AACxF,QAAM,eAAe,oCAAoC,OAAO;AAEhE,QAAM,QAAQ,iBAAiB,cAAc,WAAW;AAKxD,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;AAOO,IAAM,aAAa,CACxB,KACA,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,aAAa,GAAG,IAAI,QAAQ,OAAO,OAAO;AAAA,IACjD;AAAA,EACF;AACF;AAEO,IAAM,wBAAwB,CAAC,QAAgB;AACpD,SAAO,CAAC,aAAa,GAAG,EAAE;AAC5B;AAEO,IAAM,4BAA4B,CAIvC,KACA,YAIG;AACH,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,WAAW,cAAc,YAAY,sBAAsB,GAAG;AAEpE,QAAM,UAAiE,CAAC,EAAE,OAAO,MAC/E,WAAW,KAAK,gBAAgB,MAAM;AAExC,QAAM,gBAAgB,aAAa,EAAE,GAAG,cAAc,UAAU,QAAQ,CAAC;AAEzE,SAAO;AAGT;AA0DO,SAAS,cAId,KACA,SAIA,aACgF;AAChF,QAAM,eAAe,0BAA0B,KAAK,OAAO;AAE3D,QAAM,QAAQ,SAAS,cAAc,WAAW;AAIhD,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;AAEO,IAAM,oCAAoC,CAI/C,KACA,YAIG;AACH,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,WAAW,cAAc,YAAY,sBAAsB,GAAG;AAEpE,QAAM,UAAiE,CAAC,EAAE,OAAO,MAC/E,WAAW,KAAK,gBAAgB,MAAM;AAExC,QAAM,gBAAgB,aAAa,EAAE,GAAG,cAAc,UAAU,QAAQ,CAAC;AAEzE,SAAO;AAKT;AA0CO,SAAS,sBAId,KACA,SAIA,aACwF;AACxF,QAAM,eAAe,kCAAkC,KAAK,OAAO;AAEnE,QAAM,QAAQ,iBAAiB,cAAc,WAAW;AAKxD,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;","names":[]}