@squonk/account-server-client 2.1.0-rc.8 → 2.1.0
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/README.md +1 -1
- package/admin/admin.cjs +19 -4
- package/admin/admin.cjs.map +1 -1
- package/admin/admin.d.cts +23 -6
- package/admin/admin.d.ts +23 -6
- package/admin/admin.js +19 -4
- package/admin/admin.js.map +1 -1
- package/asset/asset.cjs +33 -18
- package/asset/asset.cjs.map +1 -1
- package/asset/asset.d.cts +31 -14
- package/asset/asset.d.ts +31 -14
- package/asset/asset.js +25 -10
- package/asset/asset.js.map +1 -1
- package/{chunk-UKA7G3OB.js → chunk-EBOQPVLG.js} +2 -2
- package/{chunk-UKA7G3OB.js.map → chunk-EBOQPVLG.js.map} +1 -1
- package/{chunk-J22A7LHX.cjs → chunk-TKLTUR4R.cjs} +2 -2
- package/chunk-TKLTUR4R.cjs.map +1 -0
- package/event-stream/event-stream.cjs +39 -10
- package/event-stream/event-stream.cjs.map +1 -1
- package/event-stream/event-stream.d.cts +51 -17
- package/event-stream/event-stream.d.ts +51 -17
- package/event-stream/event-stream.js +36 -7
- package/event-stream/event-stream.js.map +1 -1
- package/index.cjs +2 -2
- package/index.cjs.map +1 -1
- package/index.d.cts +702 -2
- package/index.d.ts +702 -2
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/merchant/merchant.cjs +35 -6
- package/merchant/merchant.cjs.map +1 -1
- package/merchant/merchant.d.cts +42 -8
- package/merchant/merchant.d.ts +42 -8
- package/merchant/merchant.js +34 -5
- package/merchant/merchant.js.map +1 -1
- package/organisation/organisation.cjs +73 -16
- package/organisation/organisation.cjs.map +1 -1
- package/organisation/organisation.d.cts +84 -16
- package/organisation/organisation.d.ts +84 -16
- package/organisation/organisation.js +66 -9
- package/organisation/organisation.js.map +1 -1
- package/package.json +12 -12
- package/product/product.cjs +121 -22
- package/product/product.cjs.map +1 -1
- package/product/product.d.cts +141 -22
- package/product/product.d.ts +141 -22
- package/product/product.js +111 -12
- package/product/product.js.map +1 -1
- package/src/account-server-api.schemas.ts +4 -2
- package/src/admin/admin.ts +50 -14
- package/src/asset/asset.ts +57 -35
- package/src/custom-instance.ts +3 -4
- package/src/event-stream/event-stream.ts +100 -29
- package/src/merchant/merchant.ts +93 -18
- package/src/organisation/organisation.ts +184 -35
- package/src/product/product.ts +313 -47
- package/src/state/state.ts +50 -14
- package/src/unit/unit.ts +190 -45
- package/src/user/user.ts +140 -34
- package/state/state.cjs +19 -4
- package/state/state.cjs.map +1 -1
- package/state/state.d.cts +23 -6
- package/state/state.d.ts +23 -6
- package/state/state.js +19 -4
- package/state/state.js.map +1 -1
- package/unit/unit.cjs +77 -20
- package/unit/unit.cjs.map +1 -1
- package/unit/unit.d.cts +91 -23
- package/unit/unit.d.ts +91 -23
- package/unit/unit.js +68 -11
- package/unit/unit.js.map +1 -1
- package/user/user.cjs +59 -16
- package/user/user.cjs.map +1 -1
- package/user/user.d.cts +66 -15
- package/user/user.d.ts +66 -15
- package/user/user.js +53 -10
- package/user/user.js.map +1 -1
- package/chunk-J22A7LHX.cjs.map +0 -1
- package/custom-instance-6780910b.d.ts +0 -700
package/product/product.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { UseQueryOptions, QueryKey, UseQueryResult, UseMutationOptions } from '@tanstack/react-query';
|
|
3
|
-
import {
|
|
1
|
+
import * as _tanstack_react_query_build_legacy_types from '@tanstack/react-query/build/legacy/types';
|
|
2
|
+
import { UseQueryOptions, QueryKey, UseQueryResult, UseSuspenseQueryOptions, UseSuspenseQueryResult, UseMutationOptions } from '@tanstack/react-query';
|
|
3
|
+
import { customInstance, ProductsGetTypesResponse, ErrorType, AsError, ProductsGetDefaultStorageCost, ProductsGetResponse, UnitProductPostBodyBody, UnitProductPostResponse, ProductUnitGetResponse, ProductPatchBodyBody, GetProductChargesParams, ProductChargesGetResponse } from '../index.js';
|
|
4
4
|
import 'axios';
|
|
5
5
|
|
|
6
|
-
type SecondParameter<T extends (...args: any) => any> = T
|
|
6
|
+
type SecondParameter<T extends (...args: any) => any> = Parameters<T>[1];
|
|
7
7
|
/**
|
|
8
8
|
* Gets Product Types you can purchase (subscribe to)
|
|
9
9
|
|
|
@@ -12,7 +12,7 @@ type SecondParameter<T extends (...args: any) => any> = T extends (config: any,
|
|
|
12
12
|
declare const getProductTypes: (options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<ProductsGetTypesResponse>;
|
|
13
13
|
declare const getGetProductTypesQueryKey: () => readonly ["account-server-api", "/product-type"];
|
|
14
14
|
declare const getGetProductTypesQueryOptions: <TData = ProductsGetTypesResponse, TError = ErrorType<void | AsError>>(options?: {
|
|
15
|
-
query?: UseQueryOptions<ProductsGetTypesResponse, TError, TData, QueryKey
|
|
15
|
+
query?: Partial<UseQueryOptions<ProductsGetTypesResponse, TError, TData, QueryKey>> | undefined;
|
|
16
16
|
request?: SecondParameter<typeof customInstance>;
|
|
17
17
|
} | undefined) => UseQueryOptions<ProductsGetTypesResponse, TError, TData, QueryKey> & {
|
|
18
18
|
queryKey: QueryKey;
|
|
@@ -23,11 +23,28 @@ type GetProductTypesQueryError = ErrorType<AsError | void>;
|
|
|
23
23
|
* @summary Gets all Product Types
|
|
24
24
|
*/
|
|
25
25
|
declare const useGetProductTypes: <TData = ProductsGetTypesResponse, TError = ErrorType<void | AsError>>(options?: {
|
|
26
|
-
query?: UseQueryOptions<ProductsGetTypesResponse, TError, TData, QueryKey
|
|
26
|
+
query?: Partial<UseQueryOptions<ProductsGetTypesResponse, TError, TData, QueryKey>> | undefined;
|
|
27
27
|
request?: SecondParameter<typeof customInstance>;
|
|
28
28
|
} | undefined) => UseQueryResult<TData, TError> & {
|
|
29
29
|
queryKey: QueryKey;
|
|
30
30
|
};
|
|
31
|
+
declare const getGetProductTypesSuspenseQueryOptions: <TData = ProductsGetTypesResponse, TError = ErrorType<void | AsError>>(options?: {
|
|
32
|
+
query?: Partial<UseSuspenseQueryOptions<ProductsGetTypesResponse, TError, TData, QueryKey>> | undefined;
|
|
33
|
+
request?: SecondParameter<typeof customInstance>;
|
|
34
|
+
} | undefined) => UseSuspenseQueryOptions<ProductsGetTypesResponse, TError, TData, QueryKey> & {
|
|
35
|
+
queryKey: QueryKey;
|
|
36
|
+
};
|
|
37
|
+
type GetProductTypesSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getProductTypes>>>;
|
|
38
|
+
type GetProductTypesSuspenseQueryError = ErrorType<AsError | void>;
|
|
39
|
+
/**
|
|
40
|
+
* @summary Gets all Product Types
|
|
41
|
+
*/
|
|
42
|
+
declare const useGetProductTypesSuspense: <TData = ProductsGetTypesResponse, TError = ErrorType<void | AsError>>(options?: {
|
|
43
|
+
query?: Partial<UseSuspenseQueryOptions<ProductsGetTypesResponse, TError, TData, QueryKey>> | undefined;
|
|
44
|
+
request?: SecondParameter<typeof customInstance>;
|
|
45
|
+
} | undefined) => UseSuspenseQueryResult<TData, TError> & {
|
|
46
|
+
queryKey: QueryKey;
|
|
47
|
+
};
|
|
31
48
|
/**
|
|
32
49
|
* The storage cost is returned along with its measurement units, typically a Coin value based on the the peak storage that was measured on each billable day.
|
|
33
50
|
|
|
@@ -36,7 +53,7 @@ declare const useGetProductTypes: <TData = ProductsGetTypesResponse, TError = Er
|
|
|
36
53
|
declare const getProductDefaultStorageCost: (options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<ProductsGetDefaultStorageCost>;
|
|
37
54
|
declare const getGetProductDefaultStorageCostQueryKey: () => readonly ["account-server-api", "/product-default-storage-cost"];
|
|
38
55
|
declare const getGetProductDefaultStorageCostQueryOptions: <TData = ProductsGetDefaultStorageCost, TError = ErrorType<void | AsError>>(options?: {
|
|
39
|
-
query?: UseQueryOptions<ProductsGetDefaultStorageCost, TError, TData, QueryKey
|
|
56
|
+
query?: Partial<UseQueryOptions<ProductsGetDefaultStorageCost, TError, TData, QueryKey>> | undefined;
|
|
40
57
|
request?: SecondParameter<typeof customInstance>;
|
|
41
58
|
} | undefined) => UseQueryOptions<ProductsGetDefaultStorageCost, TError, TData, QueryKey> & {
|
|
42
59
|
queryKey: QueryKey;
|
|
@@ -47,11 +64,28 @@ type GetProductDefaultStorageCostQueryError = ErrorType<AsError | void>;
|
|
|
47
64
|
* @summary Gets the default cross-product storage cost
|
|
48
65
|
*/
|
|
49
66
|
declare const useGetProductDefaultStorageCost: <TData = ProductsGetDefaultStorageCost, TError = ErrorType<void | AsError>>(options?: {
|
|
50
|
-
query?: UseQueryOptions<ProductsGetDefaultStorageCost, TError, TData, QueryKey
|
|
67
|
+
query?: Partial<UseQueryOptions<ProductsGetDefaultStorageCost, TError, TData, QueryKey>> | undefined;
|
|
51
68
|
request?: SecondParameter<typeof customInstance>;
|
|
52
69
|
} | undefined) => UseQueryResult<TData, TError> & {
|
|
53
70
|
queryKey: QueryKey;
|
|
54
71
|
};
|
|
72
|
+
declare const getGetProductDefaultStorageCostSuspenseQueryOptions: <TData = ProductsGetDefaultStorageCost, TError = ErrorType<void | AsError>>(options?: {
|
|
73
|
+
query?: Partial<UseSuspenseQueryOptions<ProductsGetDefaultStorageCost, TError, TData, QueryKey>> | undefined;
|
|
74
|
+
request?: SecondParameter<typeof customInstance>;
|
|
75
|
+
} | undefined) => UseSuspenseQueryOptions<ProductsGetDefaultStorageCost, TError, TData, QueryKey> & {
|
|
76
|
+
queryKey: QueryKey;
|
|
77
|
+
};
|
|
78
|
+
type GetProductDefaultStorageCostSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getProductDefaultStorageCost>>>;
|
|
79
|
+
type GetProductDefaultStorageCostSuspenseQueryError = ErrorType<AsError | void>;
|
|
80
|
+
/**
|
|
81
|
+
* @summary Gets the default cross-product storage cost
|
|
82
|
+
*/
|
|
83
|
+
declare const useGetProductDefaultStorageCostSuspense: <TData = ProductsGetDefaultStorageCost, TError = ErrorType<void | AsError>>(options?: {
|
|
84
|
+
query?: Partial<UseSuspenseQueryOptions<ProductsGetDefaultStorageCost, TError, TData, QueryKey>> | undefined;
|
|
85
|
+
request?: SecondParameter<typeof customInstance>;
|
|
86
|
+
} | undefined) => UseSuspenseQueryResult<TData, TError> & {
|
|
87
|
+
queryKey: QueryKey;
|
|
88
|
+
};
|
|
55
89
|
/**
|
|
56
90
|
* Gets Products you have access to, across all **Units** and **Organisations**
|
|
57
91
|
|
|
@@ -60,7 +94,7 @@ declare const useGetProductDefaultStorageCost: <TData = ProductsGetDefaultStorag
|
|
|
60
94
|
declare const getProducts: (options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<ProductsGetResponse>;
|
|
61
95
|
declare const getGetProductsQueryKey: () => readonly ["account-server-api", "/product"];
|
|
62
96
|
declare const getGetProductsQueryOptions: <TData = ProductsGetResponse, TError = ErrorType<void | AsError>>(options?: {
|
|
63
|
-
query?: UseQueryOptions<ProductsGetResponse, TError, TData, QueryKey
|
|
97
|
+
query?: Partial<UseQueryOptions<ProductsGetResponse, TError, TData, QueryKey>> | undefined;
|
|
64
98
|
request?: SecondParameter<typeof customInstance>;
|
|
65
99
|
} | undefined) => UseQueryOptions<ProductsGetResponse, TError, TData, QueryKey> & {
|
|
66
100
|
queryKey: QueryKey;
|
|
@@ -71,11 +105,28 @@ type GetProductsQueryError = ErrorType<AsError | void>;
|
|
|
71
105
|
* @summary Gets all Products
|
|
72
106
|
*/
|
|
73
107
|
declare const useGetProducts: <TData = ProductsGetResponse, TError = ErrorType<void | AsError>>(options?: {
|
|
74
|
-
query?: UseQueryOptions<ProductsGetResponse, TError, TData, QueryKey
|
|
108
|
+
query?: Partial<UseQueryOptions<ProductsGetResponse, TError, TData, QueryKey>> | undefined;
|
|
75
109
|
request?: SecondParameter<typeof customInstance>;
|
|
76
110
|
} | undefined) => UseQueryResult<TData, TError> & {
|
|
77
111
|
queryKey: QueryKey;
|
|
78
112
|
};
|
|
113
|
+
declare const getGetProductsSuspenseQueryOptions: <TData = ProductsGetResponse, TError = ErrorType<void | AsError>>(options?: {
|
|
114
|
+
query?: Partial<UseSuspenseQueryOptions<ProductsGetResponse, TError, TData, QueryKey>> | undefined;
|
|
115
|
+
request?: SecondParameter<typeof customInstance>;
|
|
116
|
+
} | undefined) => UseSuspenseQueryOptions<ProductsGetResponse, TError, TData, QueryKey> & {
|
|
117
|
+
queryKey: QueryKey;
|
|
118
|
+
};
|
|
119
|
+
type GetProductsSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getProducts>>>;
|
|
120
|
+
type GetProductsSuspenseQueryError = ErrorType<AsError | void>;
|
|
121
|
+
/**
|
|
122
|
+
* @summary Gets all Products
|
|
123
|
+
*/
|
|
124
|
+
declare const useGetProductsSuspense: <TData = ProductsGetResponse, TError = ErrorType<void | AsError>>(options?: {
|
|
125
|
+
query?: Partial<UseSuspenseQueryOptions<ProductsGetResponse, TError, TData, QueryKey>> | undefined;
|
|
126
|
+
request?: SecondParameter<typeof customInstance>;
|
|
127
|
+
} | undefined) => UseSuspenseQueryResult<TData, TError> & {
|
|
128
|
+
queryKey: QueryKey;
|
|
129
|
+
};
|
|
79
130
|
/**
|
|
80
131
|
* Gets Products you have access to based on an **Organisation**
|
|
81
132
|
|
|
@@ -84,7 +135,7 @@ declare const useGetProducts: <TData = ProductsGetResponse, TError = ErrorType<v
|
|
|
84
135
|
declare const getProductsForOrganisation: (orgId: string, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<ProductsGetResponse>;
|
|
85
136
|
declare const getGetProductsForOrganisationQueryKey: (orgId: string) => readonly ["account-server-api", `/product/organisation/${string}`];
|
|
86
137
|
declare const getGetProductsForOrganisationQueryOptions: <TData = ProductsGetResponse, TError = ErrorType<void | AsError>>(orgId: string, options?: {
|
|
87
|
-
query?: UseQueryOptions<ProductsGetResponse, TError, TData, QueryKey
|
|
138
|
+
query?: Partial<UseQueryOptions<ProductsGetResponse, TError, TData, QueryKey>> | undefined;
|
|
88
139
|
request?: SecondParameter<typeof customInstance>;
|
|
89
140
|
} | undefined) => UseQueryOptions<ProductsGetResponse, TError, TData, QueryKey> & {
|
|
90
141
|
queryKey: QueryKey;
|
|
@@ -95,11 +146,28 @@ type GetProductsForOrganisationQueryError = ErrorType<void | AsError>;
|
|
|
95
146
|
* @summary Gets Products for an Organisation
|
|
96
147
|
*/
|
|
97
148
|
declare const useGetProductsForOrganisation: <TData = ProductsGetResponse, TError = ErrorType<void | AsError>>(orgId: string, options?: {
|
|
98
|
-
query?: UseQueryOptions<ProductsGetResponse, TError, TData, QueryKey
|
|
149
|
+
query?: Partial<UseQueryOptions<ProductsGetResponse, TError, TData, QueryKey>> | undefined;
|
|
99
150
|
request?: SecondParameter<typeof customInstance>;
|
|
100
151
|
} | undefined) => UseQueryResult<TData, TError> & {
|
|
101
152
|
queryKey: QueryKey;
|
|
102
153
|
};
|
|
154
|
+
declare const getGetProductsForOrganisationSuspenseQueryOptions: <TData = ProductsGetResponse, TError = ErrorType<void | AsError>>(orgId: string, options?: {
|
|
155
|
+
query?: Partial<UseSuspenseQueryOptions<ProductsGetResponse, TError, TData, QueryKey>> | undefined;
|
|
156
|
+
request?: SecondParameter<typeof customInstance>;
|
|
157
|
+
} | undefined) => UseSuspenseQueryOptions<ProductsGetResponse, TError, TData, QueryKey> & {
|
|
158
|
+
queryKey: QueryKey;
|
|
159
|
+
};
|
|
160
|
+
type GetProductsForOrganisationSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getProductsForOrganisation>>>;
|
|
161
|
+
type GetProductsForOrganisationSuspenseQueryError = ErrorType<void | AsError>;
|
|
162
|
+
/**
|
|
163
|
+
* @summary Gets Products for an Organisation
|
|
164
|
+
*/
|
|
165
|
+
declare const useGetProductsForOrganisationSuspense: <TData = ProductsGetResponse, TError = ErrorType<void | AsError>>(orgId: string, options?: {
|
|
166
|
+
query?: Partial<UseSuspenseQueryOptions<ProductsGetResponse, TError, TData, QueryKey>> | undefined;
|
|
167
|
+
request?: SecondParameter<typeof customInstance>;
|
|
168
|
+
} | undefined) => UseSuspenseQueryResult<TData, TError> & {
|
|
169
|
+
queryKey: QueryKey;
|
|
170
|
+
};
|
|
103
171
|
/**
|
|
104
172
|
* Products are **Subscriptions** that you create in a Unit and use **Merchant** services like the `DATA_MANAGER`.
|
|
105
173
|
|
|
@@ -134,7 +202,7 @@ declare const useCreateUnitProduct: <TError = ErrorType<void | AsError>, TContex
|
|
|
134
202
|
data: UnitProductPostBodyBody;
|
|
135
203
|
}, TContext> | undefined;
|
|
136
204
|
request?: SecondParameter<typeof customInstance>;
|
|
137
|
-
} | undefined) =>
|
|
205
|
+
} | undefined) => _tanstack_react_query_build_legacy_types.UseMutationResult<UnitProductPostResponse, TError, {
|
|
138
206
|
unitId: string;
|
|
139
207
|
data: UnitProductPostBodyBody;
|
|
140
208
|
}, TContext>;
|
|
@@ -146,7 +214,7 @@ declare const useCreateUnitProduct: <TError = ErrorType<void | AsError>, TContex
|
|
|
146
214
|
declare const getProductsForUnit: (unitId: string, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<ProductsGetResponse>;
|
|
147
215
|
declare const getGetProductsForUnitQueryKey: (unitId: string) => readonly ["account-server-api", `/product/unit/${string}`];
|
|
148
216
|
declare const getGetProductsForUnitQueryOptions: <TData = ProductsGetResponse, TError = ErrorType<void | AsError>>(unitId: string, options?: {
|
|
149
|
-
query?: UseQueryOptions<ProductsGetResponse, TError, TData, QueryKey
|
|
217
|
+
query?: Partial<UseQueryOptions<ProductsGetResponse, TError, TData, QueryKey>> | undefined;
|
|
150
218
|
request?: SecondParameter<typeof customInstance>;
|
|
151
219
|
} | undefined) => UseQueryOptions<ProductsGetResponse, TError, TData, QueryKey> & {
|
|
152
220
|
queryKey: QueryKey;
|
|
@@ -157,11 +225,28 @@ type GetProductsForUnitQueryError = ErrorType<void | AsError>;
|
|
|
157
225
|
* @summary Gets Products for an Organisational Unit
|
|
158
226
|
*/
|
|
159
227
|
declare const useGetProductsForUnit: <TData = ProductsGetResponse, TError = ErrorType<void | AsError>>(unitId: string, options?: {
|
|
160
|
-
query?: UseQueryOptions<ProductsGetResponse, TError, TData, QueryKey
|
|
228
|
+
query?: Partial<UseQueryOptions<ProductsGetResponse, TError, TData, QueryKey>> | undefined;
|
|
161
229
|
request?: SecondParameter<typeof customInstance>;
|
|
162
230
|
} | undefined) => UseQueryResult<TData, TError> & {
|
|
163
231
|
queryKey: QueryKey;
|
|
164
232
|
};
|
|
233
|
+
declare const getGetProductsForUnitSuspenseQueryOptions: <TData = ProductsGetResponse, TError = ErrorType<void | AsError>>(unitId: string, options?: {
|
|
234
|
+
query?: Partial<UseSuspenseQueryOptions<ProductsGetResponse, TError, TData, QueryKey>> | undefined;
|
|
235
|
+
request?: SecondParameter<typeof customInstance>;
|
|
236
|
+
} | undefined) => UseSuspenseQueryOptions<ProductsGetResponse, TError, TData, QueryKey> & {
|
|
237
|
+
queryKey: QueryKey;
|
|
238
|
+
};
|
|
239
|
+
type GetProductsForUnitSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getProductsForUnit>>>;
|
|
240
|
+
type GetProductsForUnitSuspenseQueryError = ErrorType<void | AsError>;
|
|
241
|
+
/**
|
|
242
|
+
* @summary Gets Products for an Organisational Unit
|
|
243
|
+
*/
|
|
244
|
+
declare const useGetProductsForUnitSuspense: <TData = ProductsGetResponse, TError = ErrorType<void | AsError>>(unitId: string, options?: {
|
|
245
|
+
query?: Partial<UseSuspenseQueryOptions<ProductsGetResponse, TError, TData, QueryKey>> | undefined;
|
|
246
|
+
request?: SecondParameter<typeof customInstance>;
|
|
247
|
+
} | undefined) => UseSuspenseQueryResult<TData, TError> & {
|
|
248
|
+
queryKey: QueryKey;
|
|
249
|
+
};
|
|
165
250
|
/**
|
|
166
251
|
* Gets details of a specific Product that you have access to.
|
|
167
252
|
|
|
@@ -170,7 +255,7 @@ declare const useGetProductsForUnit: <TData = ProductsGetResponse, TError = Erro
|
|
|
170
255
|
declare const getProduct: (productId: string, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<ProductUnitGetResponse>;
|
|
171
256
|
declare const getGetProductQueryKey: (productId: string) => readonly ["account-server-api", `/product/${string}`];
|
|
172
257
|
declare const getGetProductQueryOptions: <TData = ProductUnitGetResponse, TError = ErrorType<void | AsError>>(productId: string, options?: {
|
|
173
|
-
query?: UseQueryOptions<ProductUnitGetResponse, TError, TData, QueryKey
|
|
258
|
+
query?: Partial<UseQueryOptions<ProductUnitGetResponse, TError, TData, QueryKey>> | undefined;
|
|
174
259
|
request?: SecondParameter<typeof customInstance>;
|
|
175
260
|
} | undefined) => UseQueryOptions<ProductUnitGetResponse, TError, TData, QueryKey> & {
|
|
176
261
|
queryKey: QueryKey;
|
|
@@ -181,11 +266,28 @@ type GetProductQueryError = ErrorType<AsError | void>;
|
|
|
181
266
|
* @summary Gets a Product
|
|
182
267
|
*/
|
|
183
268
|
declare const useGetProduct: <TData = ProductUnitGetResponse, TError = ErrorType<void | AsError>>(productId: string, options?: {
|
|
184
|
-
query?: UseQueryOptions<ProductUnitGetResponse, TError, TData, QueryKey
|
|
269
|
+
query?: Partial<UseQueryOptions<ProductUnitGetResponse, TError, TData, QueryKey>> | undefined;
|
|
185
270
|
request?: SecondParameter<typeof customInstance>;
|
|
186
271
|
} | undefined) => UseQueryResult<TData, TError> & {
|
|
187
272
|
queryKey: QueryKey;
|
|
188
273
|
};
|
|
274
|
+
declare const getGetProductSuspenseQueryOptions: <TData = ProductUnitGetResponse, TError = ErrorType<void | AsError>>(productId: string, options?: {
|
|
275
|
+
query?: Partial<UseSuspenseQueryOptions<ProductUnitGetResponse, TError, TData, QueryKey>> | undefined;
|
|
276
|
+
request?: SecondParameter<typeof customInstance>;
|
|
277
|
+
} | undefined) => UseSuspenseQueryOptions<ProductUnitGetResponse, TError, TData, QueryKey> & {
|
|
278
|
+
queryKey: QueryKey;
|
|
279
|
+
};
|
|
280
|
+
type GetProductSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getProduct>>>;
|
|
281
|
+
type GetProductSuspenseQueryError = ErrorType<AsError | void>;
|
|
282
|
+
/**
|
|
283
|
+
* @summary Gets a Product
|
|
284
|
+
*/
|
|
285
|
+
declare const useGetProductSuspense: <TData = ProductUnitGetResponse, TError = ErrorType<void | AsError>>(productId: string, options?: {
|
|
286
|
+
query?: Partial<UseSuspenseQueryOptions<ProductUnitGetResponse, TError, TData, QueryKey>> | undefined;
|
|
287
|
+
request?: SecondParameter<typeof customInstance>;
|
|
288
|
+
} | undefined) => UseSuspenseQueryResult<TData, TError> & {
|
|
289
|
+
queryKey: QueryKey;
|
|
290
|
+
};
|
|
189
291
|
/**
|
|
190
292
|
* You need access to the Product and, if the Product is *claimable* the claim must be removed before the Product can be removed. An example claimable Product is a `DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION` where the *claimable* commodity is a Data Manager **Project**. In this case you will need to delete the Data Manager **Project** before you can delete the Account Server **Product**.
|
|
191
293
|
|
|
@@ -210,7 +312,7 @@ declare const useDeleteProduct: <TError = ErrorType<AsError>, TContext = unknown
|
|
|
210
312
|
productId: string;
|
|
211
313
|
}, TContext> | undefined;
|
|
212
314
|
request?: SecondParameter<typeof customInstance>;
|
|
213
|
-
} | undefined) =>
|
|
315
|
+
} | undefined) => _tanstack_react_query_build_legacy_types.UseMutationResult<void, TError, {
|
|
214
316
|
productId: string;
|
|
215
317
|
}, TContext>;
|
|
216
318
|
/**
|
|
@@ -243,7 +345,7 @@ declare const usePatchProduct: <TError = ErrorType<AsError>, TContext = unknown>
|
|
|
243
345
|
data: ProductPatchBodyBody;
|
|
244
346
|
}, TContext> | undefined;
|
|
245
347
|
request?: SecondParameter<typeof customInstance>;
|
|
246
|
-
} | undefined) =>
|
|
348
|
+
} | undefined) => _tanstack_react_query_build_legacy_types.UseMutationResult<void, TError, {
|
|
247
349
|
productId: string;
|
|
248
350
|
data: ProductPatchBodyBody;
|
|
249
351
|
}, TContext>;
|
|
@@ -260,7 +362,7 @@ You need to be part of the **Unit** or **Organisation** to use this method
|
|
|
260
362
|
declare const getProductCharges: (productId: string, params?: GetProductChargesParams, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<ProductChargesGetResponse>;
|
|
261
363
|
declare const getGetProductChargesQueryKey: (productId: string, params?: GetProductChargesParams) => readonly ["account-server-api", `/product/${string}/charges`, ...GetProductChargesParams[]];
|
|
262
364
|
declare const getGetProductChargesQueryOptions: <TData = ProductChargesGetResponse, TError = ErrorType<void | AsError>>(productId: string, params?: GetProductChargesParams, options?: {
|
|
263
|
-
query?: UseQueryOptions<ProductChargesGetResponse, TError, TData, QueryKey
|
|
365
|
+
query?: Partial<UseQueryOptions<ProductChargesGetResponse, TError, TData, QueryKey>> | undefined;
|
|
264
366
|
request?: SecondParameter<typeof customInstance>;
|
|
265
367
|
} | undefined) => UseQueryOptions<ProductChargesGetResponse, TError, TData, QueryKey> & {
|
|
266
368
|
queryKey: QueryKey;
|
|
@@ -271,10 +373,27 @@ type GetProductChargesQueryError = ErrorType<AsError | void>;
|
|
|
271
373
|
* @summary Get charges made against a Product
|
|
272
374
|
*/
|
|
273
375
|
declare const useGetProductCharges: <TData = ProductChargesGetResponse, TError = ErrorType<void | AsError>>(productId: string, params?: GetProductChargesParams, options?: {
|
|
274
|
-
query?: UseQueryOptions<ProductChargesGetResponse, TError, TData, QueryKey
|
|
376
|
+
query?: Partial<UseQueryOptions<ProductChargesGetResponse, TError, TData, QueryKey>> | undefined;
|
|
275
377
|
request?: SecondParameter<typeof customInstance>;
|
|
276
378
|
} | undefined) => UseQueryResult<TData, TError> & {
|
|
277
379
|
queryKey: QueryKey;
|
|
278
380
|
};
|
|
381
|
+
declare const getGetProductChargesSuspenseQueryOptions: <TData = ProductChargesGetResponse, TError = ErrorType<void | AsError>>(productId: string, params?: GetProductChargesParams, options?: {
|
|
382
|
+
query?: Partial<UseSuspenseQueryOptions<ProductChargesGetResponse, TError, TData, QueryKey>> | undefined;
|
|
383
|
+
request?: SecondParameter<typeof customInstance>;
|
|
384
|
+
} | undefined) => UseSuspenseQueryOptions<ProductChargesGetResponse, TError, TData, QueryKey> & {
|
|
385
|
+
queryKey: QueryKey;
|
|
386
|
+
};
|
|
387
|
+
type GetProductChargesSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getProductCharges>>>;
|
|
388
|
+
type GetProductChargesSuspenseQueryError = ErrorType<AsError | void>;
|
|
389
|
+
/**
|
|
390
|
+
* @summary Get charges made against a Product
|
|
391
|
+
*/
|
|
392
|
+
declare const useGetProductChargesSuspense: <TData = ProductChargesGetResponse, TError = ErrorType<void | AsError>>(productId: string, params?: GetProductChargesParams, options?: {
|
|
393
|
+
query?: Partial<UseSuspenseQueryOptions<ProductChargesGetResponse, TError, TData, QueryKey>> | undefined;
|
|
394
|
+
request?: SecondParameter<typeof customInstance>;
|
|
395
|
+
} | undefined) => UseSuspenseQueryResult<TData, TError> & {
|
|
396
|
+
queryKey: QueryKey;
|
|
397
|
+
};
|
|
279
398
|
|
|
280
|
-
export { CreateUnitProductMutationBody, CreateUnitProductMutationError, CreateUnitProductMutationResult, DeleteProductMutationError, DeleteProductMutationResult, GetProductChargesQueryError, GetProductChargesQueryResult, GetProductDefaultStorageCostQueryError, GetProductDefaultStorageCostQueryResult, GetProductQueryError, GetProductQueryResult, GetProductTypesQueryError, GetProductTypesQueryResult, GetProductsForOrganisationQueryError, GetProductsForOrganisationQueryResult, GetProductsForUnitQueryError, GetProductsForUnitQueryResult, GetProductsQueryError, GetProductsQueryResult, PatchProductMutationBody, PatchProductMutationError, PatchProductMutationResult, createUnitProduct, deleteProduct, getCreateUnitProductMutationOptions, getDeleteProductMutationOptions, getGetProductChargesQueryKey, getGetProductChargesQueryOptions, getGetProductDefaultStorageCostQueryKey, getGetProductDefaultStorageCostQueryOptions, getGetProductQueryKey, getGetProductQueryOptions, getGetProductTypesQueryKey, getGetProductTypesQueryOptions, getGetProductsForOrganisationQueryKey, getGetProductsForOrganisationQueryOptions, getGetProductsForUnitQueryKey, getGetProductsForUnitQueryOptions, getGetProductsQueryKey, getGetProductsQueryOptions, getPatchProductMutationOptions, getProduct, getProductCharges, getProductDefaultStorageCost, getProductTypes, getProducts, getProductsForOrganisation, getProductsForUnit, patchProduct, useCreateUnitProduct, useDeleteProduct, useGetProduct, useGetProductCharges, useGetProductDefaultStorageCost, useGetProductTypes, useGetProducts, useGetProductsForOrganisation, useGetProductsForUnit, usePatchProduct };
|
|
399
|
+
export { type CreateUnitProductMutationBody, type CreateUnitProductMutationError, type CreateUnitProductMutationResult, type DeleteProductMutationError, type DeleteProductMutationResult, type GetProductChargesQueryError, type GetProductChargesQueryResult, type GetProductChargesSuspenseQueryError, type GetProductChargesSuspenseQueryResult, type GetProductDefaultStorageCostQueryError, type GetProductDefaultStorageCostQueryResult, type GetProductDefaultStorageCostSuspenseQueryError, type GetProductDefaultStorageCostSuspenseQueryResult, type GetProductQueryError, type GetProductQueryResult, type GetProductSuspenseQueryError, type GetProductSuspenseQueryResult, type GetProductTypesQueryError, type GetProductTypesQueryResult, type GetProductTypesSuspenseQueryError, type GetProductTypesSuspenseQueryResult, type GetProductsForOrganisationQueryError, type GetProductsForOrganisationQueryResult, type GetProductsForOrganisationSuspenseQueryError, type GetProductsForOrganisationSuspenseQueryResult, type GetProductsForUnitQueryError, type GetProductsForUnitQueryResult, type GetProductsForUnitSuspenseQueryError, type GetProductsForUnitSuspenseQueryResult, type GetProductsQueryError, type GetProductsQueryResult, type GetProductsSuspenseQueryError, type GetProductsSuspenseQueryResult, type PatchProductMutationBody, type PatchProductMutationError, type PatchProductMutationResult, createUnitProduct, deleteProduct, getCreateUnitProductMutationOptions, getDeleteProductMutationOptions, getGetProductChargesQueryKey, getGetProductChargesQueryOptions, getGetProductChargesSuspenseQueryOptions, getGetProductDefaultStorageCostQueryKey, getGetProductDefaultStorageCostQueryOptions, getGetProductDefaultStorageCostSuspenseQueryOptions, getGetProductQueryKey, getGetProductQueryOptions, getGetProductSuspenseQueryOptions, getGetProductTypesQueryKey, getGetProductTypesQueryOptions, getGetProductTypesSuspenseQueryOptions, getGetProductsForOrganisationQueryKey, getGetProductsForOrganisationQueryOptions, getGetProductsForOrganisationSuspenseQueryOptions, getGetProductsForUnitQueryKey, getGetProductsForUnitQueryOptions, getGetProductsForUnitSuspenseQueryOptions, getGetProductsQueryKey, getGetProductsQueryOptions, getGetProductsSuspenseQueryOptions, getPatchProductMutationOptions, getProduct, getProductCharges, getProductDefaultStorageCost, getProductTypes, getProducts, getProductsForOrganisation, getProductsForUnit, patchProduct, useCreateUnitProduct, useDeleteProduct, useGetProduct, useGetProductCharges, useGetProductChargesSuspense, useGetProductDefaultStorageCost, useGetProductDefaultStorageCostSuspense, useGetProductSuspense, useGetProductTypes, useGetProductTypesSuspense, useGetProducts, useGetProductsForOrganisation, useGetProductsForOrganisationSuspense, useGetProductsForUnit, useGetProductsForUnitSuspense, useGetProductsSuspense, usePatchProduct };
|
package/product/product.js
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
customInstance
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-EBOQPVLG.js";
|
|
4
4
|
|
|
5
5
|
// src/product/product.ts
|
|
6
6
|
import {
|
|
7
7
|
useMutation,
|
|
8
|
-
useQuery
|
|
8
|
+
useQuery,
|
|
9
|
+
useSuspenseQuery
|
|
9
10
|
} from "@tanstack/react-query";
|
|
10
11
|
var getProductTypes = (options, signal) => {
|
|
11
12
|
return customInstance(
|
|
12
13
|
{
|
|
13
14
|
url: `/product-type`,
|
|
14
|
-
method: "
|
|
15
|
+
method: "GET",
|
|
15
16
|
signal
|
|
16
17
|
},
|
|
17
18
|
options
|
|
@@ -32,11 +33,23 @@ var useGetProductTypes = (options) => {
|
|
|
32
33
|
query.queryKey = queryOptions.queryKey;
|
|
33
34
|
return query;
|
|
34
35
|
};
|
|
36
|
+
var getGetProductTypesSuspenseQueryOptions = (options) => {
|
|
37
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
38
|
+
const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetProductTypesQueryKey();
|
|
39
|
+
const queryFn = ({ signal }) => getProductTypes(requestOptions, signal);
|
|
40
|
+
return { queryKey, queryFn, ...queryOptions };
|
|
41
|
+
};
|
|
42
|
+
var useGetProductTypesSuspense = (options) => {
|
|
43
|
+
const queryOptions = getGetProductTypesSuspenseQueryOptions(options);
|
|
44
|
+
const query = useSuspenseQuery(queryOptions);
|
|
45
|
+
query.queryKey = queryOptions.queryKey;
|
|
46
|
+
return query;
|
|
47
|
+
};
|
|
35
48
|
var getProductDefaultStorageCost = (options, signal) => {
|
|
36
49
|
return customInstance(
|
|
37
50
|
{
|
|
38
51
|
url: `/product-default-storage-cost`,
|
|
39
|
-
method: "
|
|
52
|
+
method: "GET",
|
|
40
53
|
signal
|
|
41
54
|
},
|
|
42
55
|
options
|
|
@@ -57,11 +70,23 @@ var useGetProductDefaultStorageCost = (options) => {
|
|
|
57
70
|
query.queryKey = queryOptions.queryKey;
|
|
58
71
|
return query;
|
|
59
72
|
};
|
|
73
|
+
var getGetProductDefaultStorageCostSuspenseQueryOptions = (options) => {
|
|
74
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
75
|
+
const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetProductDefaultStorageCostQueryKey();
|
|
76
|
+
const queryFn = ({ signal }) => getProductDefaultStorageCost(requestOptions, signal);
|
|
77
|
+
return { queryKey, queryFn, ...queryOptions };
|
|
78
|
+
};
|
|
79
|
+
var useGetProductDefaultStorageCostSuspense = (options) => {
|
|
80
|
+
const queryOptions = getGetProductDefaultStorageCostSuspenseQueryOptions(options);
|
|
81
|
+
const query = useSuspenseQuery(queryOptions);
|
|
82
|
+
query.queryKey = queryOptions.queryKey;
|
|
83
|
+
return query;
|
|
84
|
+
};
|
|
60
85
|
var getProducts = (options, signal) => {
|
|
61
86
|
return customInstance(
|
|
62
87
|
{
|
|
63
88
|
url: `/product`,
|
|
64
|
-
method: "
|
|
89
|
+
method: "GET",
|
|
65
90
|
signal
|
|
66
91
|
},
|
|
67
92
|
options
|
|
@@ -82,11 +107,23 @@ var useGetProducts = (options) => {
|
|
|
82
107
|
query.queryKey = queryOptions.queryKey;
|
|
83
108
|
return query;
|
|
84
109
|
};
|
|
110
|
+
var getGetProductsSuspenseQueryOptions = (options) => {
|
|
111
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
112
|
+
const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetProductsQueryKey();
|
|
113
|
+
const queryFn = ({ signal }) => getProducts(requestOptions, signal);
|
|
114
|
+
return { queryKey, queryFn, ...queryOptions };
|
|
115
|
+
};
|
|
116
|
+
var useGetProductsSuspense = (options) => {
|
|
117
|
+
const queryOptions = getGetProductsSuspenseQueryOptions(options);
|
|
118
|
+
const query = useSuspenseQuery(queryOptions);
|
|
119
|
+
query.queryKey = queryOptions.queryKey;
|
|
120
|
+
return query;
|
|
121
|
+
};
|
|
85
122
|
var getProductsForOrganisation = (orgId, options, signal) => {
|
|
86
123
|
return customInstance(
|
|
87
124
|
{
|
|
88
125
|
url: `/product/organisation/${orgId}`,
|
|
89
|
-
method: "
|
|
126
|
+
method: "GET",
|
|
90
127
|
signal
|
|
91
128
|
},
|
|
92
129
|
options
|
|
@@ -107,11 +144,23 @@ var useGetProductsForOrganisation = (orgId, options) => {
|
|
|
107
144
|
query.queryKey = queryOptions.queryKey;
|
|
108
145
|
return query;
|
|
109
146
|
};
|
|
147
|
+
var getGetProductsForOrganisationSuspenseQueryOptions = (orgId, options) => {
|
|
148
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
149
|
+
const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetProductsForOrganisationQueryKey(orgId);
|
|
150
|
+
const queryFn = ({ signal }) => getProductsForOrganisation(orgId, requestOptions, signal);
|
|
151
|
+
return { queryKey, queryFn, enabled: !!orgId, ...queryOptions };
|
|
152
|
+
};
|
|
153
|
+
var useGetProductsForOrganisationSuspense = (orgId, options) => {
|
|
154
|
+
const queryOptions = getGetProductsForOrganisationSuspenseQueryOptions(orgId, options);
|
|
155
|
+
const query = useSuspenseQuery(queryOptions);
|
|
156
|
+
query.queryKey = queryOptions.queryKey;
|
|
157
|
+
return query;
|
|
158
|
+
};
|
|
110
159
|
var createUnitProduct = (unitId, unitProductPostBodyBody, options) => {
|
|
111
160
|
return customInstance(
|
|
112
161
|
{
|
|
113
162
|
url: `/product/unit/${unitId}`,
|
|
114
|
-
method: "
|
|
163
|
+
method: "POST",
|
|
115
164
|
headers: { "Content-Type": "application/json" },
|
|
116
165
|
data: unitProductPostBodyBody
|
|
117
166
|
},
|
|
@@ -134,7 +183,7 @@ var getProductsForUnit = (unitId, options, signal) => {
|
|
|
134
183
|
return customInstance(
|
|
135
184
|
{
|
|
136
185
|
url: `/product/unit/${unitId}`,
|
|
137
|
-
method: "
|
|
186
|
+
method: "GET",
|
|
138
187
|
signal
|
|
139
188
|
},
|
|
140
189
|
options
|
|
@@ -155,11 +204,23 @@ var useGetProductsForUnit = (unitId, options) => {
|
|
|
155
204
|
query.queryKey = queryOptions.queryKey;
|
|
156
205
|
return query;
|
|
157
206
|
};
|
|
207
|
+
var getGetProductsForUnitSuspenseQueryOptions = (unitId, options) => {
|
|
208
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
209
|
+
const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetProductsForUnitQueryKey(unitId);
|
|
210
|
+
const queryFn = ({ signal }) => getProductsForUnit(unitId, requestOptions, signal);
|
|
211
|
+
return { queryKey, queryFn, enabled: !!unitId, ...queryOptions };
|
|
212
|
+
};
|
|
213
|
+
var useGetProductsForUnitSuspense = (unitId, options) => {
|
|
214
|
+
const queryOptions = getGetProductsForUnitSuspenseQueryOptions(unitId, options);
|
|
215
|
+
const query = useSuspenseQuery(queryOptions);
|
|
216
|
+
query.queryKey = queryOptions.queryKey;
|
|
217
|
+
return query;
|
|
218
|
+
};
|
|
158
219
|
var getProduct = (productId, options, signal) => {
|
|
159
220
|
return customInstance(
|
|
160
221
|
{
|
|
161
222
|
url: `/product/${productId}`,
|
|
162
|
-
method: "
|
|
223
|
+
method: "GET",
|
|
163
224
|
signal
|
|
164
225
|
},
|
|
165
226
|
options
|
|
@@ -180,11 +241,23 @@ var useGetProduct = (productId, options) => {
|
|
|
180
241
|
query.queryKey = queryOptions.queryKey;
|
|
181
242
|
return query;
|
|
182
243
|
};
|
|
244
|
+
var getGetProductSuspenseQueryOptions = (productId, options) => {
|
|
245
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
246
|
+
const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetProductQueryKey(productId);
|
|
247
|
+
const queryFn = ({ signal }) => getProduct(productId, requestOptions, signal);
|
|
248
|
+
return { queryKey, queryFn, enabled: !!productId, ...queryOptions };
|
|
249
|
+
};
|
|
250
|
+
var useGetProductSuspense = (productId, options) => {
|
|
251
|
+
const queryOptions = getGetProductSuspenseQueryOptions(productId, options);
|
|
252
|
+
const query = useSuspenseQuery(queryOptions);
|
|
253
|
+
query.queryKey = queryOptions.queryKey;
|
|
254
|
+
return query;
|
|
255
|
+
};
|
|
183
256
|
var deleteProduct = (productId, options) => {
|
|
184
257
|
return customInstance(
|
|
185
258
|
{
|
|
186
259
|
url: `/product/${productId}`,
|
|
187
|
-
method: "
|
|
260
|
+
method: "DELETE"
|
|
188
261
|
},
|
|
189
262
|
options
|
|
190
263
|
);
|
|
@@ -205,7 +278,7 @@ var patchProduct = (productId, productPatchBodyBody, options) => {
|
|
|
205
278
|
return customInstance(
|
|
206
279
|
{
|
|
207
280
|
url: `/product/${productId}`,
|
|
208
|
-
method: "
|
|
281
|
+
method: "PATCH",
|
|
209
282
|
headers: { "Content-Type": "application/json" },
|
|
210
283
|
data: productPatchBodyBody
|
|
211
284
|
},
|
|
@@ -228,7 +301,7 @@ var getProductCharges = (productId, params, options, signal) => {
|
|
|
228
301
|
return customInstance(
|
|
229
302
|
{
|
|
230
303
|
url: `/product/${productId}/charges`,
|
|
231
|
-
method: "
|
|
304
|
+
method: "GET",
|
|
232
305
|
params,
|
|
233
306
|
signal
|
|
234
307
|
},
|
|
@@ -250,6 +323,18 @@ var useGetProductCharges = (productId, params, options) => {
|
|
|
250
323
|
query.queryKey = queryOptions.queryKey;
|
|
251
324
|
return query;
|
|
252
325
|
};
|
|
326
|
+
var getGetProductChargesSuspenseQueryOptions = (productId, params, options) => {
|
|
327
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
328
|
+
const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetProductChargesQueryKey(productId, params);
|
|
329
|
+
const queryFn = ({ signal }) => getProductCharges(productId, params, requestOptions, signal);
|
|
330
|
+
return { queryKey, queryFn, enabled: !!productId, ...queryOptions };
|
|
331
|
+
};
|
|
332
|
+
var useGetProductChargesSuspense = (productId, params, options) => {
|
|
333
|
+
const queryOptions = getGetProductChargesSuspenseQueryOptions(productId, params, options);
|
|
334
|
+
const query = useSuspenseQuery(queryOptions);
|
|
335
|
+
query.queryKey = queryOptions.queryKey;
|
|
336
|
+
return query;
|
|
337
|
+
};
|
|
253
338
|
export {
|
|
254
339
|
createUnitProduct,
|
|
255
340
|
deleteProduct,
|
|
@@ -257,18 +342,25 @@ export {
|
|
|
257
342
|
getDeleteProductMutationOptions,
|
|
258
343
|
getGetProductChargesQueryKey,
|
|
259
344
|
getGetProductChargesQueryOptions,
|
|
345
|
+
getGetProductChargesSuspenseQueryOptions,
|
|
260
346
|
getGetProductDefaultStorageCostQueryKey,
|
|
261
347
|
getGetProductDefaultStorageCostQueryOptions,
|
|
348
|
+
getGetProductDefaultStorageCostSuspenseQueryOptions,
|
|
262
349
|
getGetProductQueryKey,
|
|
263
350
|
getGetProductQueryOptions,
|
|
351
|
+
getGetProductSuspenseQueryOptions,
|
|
264
352
|
getGetProductTypesQueryKey,
|
|
265
353
|
getGetProductTypesQueryOptions,
|
|
354
|
+
getGetProductTypesSuspenseQueryOptions,
|
|
266
355
|
getGetProductsForOrganisationQueryKey,
|
|
267
356
|
getGetProductsForOrganisationQueryOptions,
|
|
357
|
+
getGetProductsForOrganisationSuspenseQueryOptions,
|
|
268
358
|
getGetProductsForUnitQueryKey,
|
|
269
359
|
getGetProductsForUnitQueryOptions,
|
|
360
|
+
getGetProductsForUnitSuspenseQueryOptions,
|
|
270
361
|
getGetProductsQueryKey,
|
|
271
362
|
getGetProductsQueryOptions,
|
|
363
|
+
getGetProductsSuspenseQueryOptions,
|
|
272
364
|
getPatchProductMutationOptions,
|
|
273
365
|
getProduct,
|
|
274
366
|
getProductCharges,
|
|
@@ -282,11 +374,18 @@ export {
|
|
|
282
374
|
useDeleteProduct,
|
|
283
375
|
useGetProduct,
|
|
284
376
|
useGetProductCharges,
|
|
377
|
+
useGetProductChargesSuspense,
|
|
285
378
|
useGetProductDefaultStorageCost,
|
|
379
|
+
useGetProductDefaultStorageCostSuspense,
|
|
380
|
+
useGetProductSuspense,
|
|
286
381
|
useGetProductTypes,
|
|
382
|
+
useGetProductTypesSuspense,
|
|
287
383
|
useGetProducts,
|
|
288
384
|
useGetProductsForOrganisation,
|
|
385
|
+
useGetProductsForOrganisationSuspense,
|
|
289
386
|
useGetProductsForUnit,
|
|
387
|
+
useGetProductsForUnitSuspense,
|
|
388
|
+
useGetProductsSuspense,
|
|
290
389
|
usePatchProduct
|
|
291
390
|
};
|
|
292
391
|
//# sourceMappingURL=product.js.map
|