@squonk/account-server-client 2.0.3 → 2.0.4-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/admin/admin.cjs +8 -6
- package/admin/admin.cjs.map +1 -1
- package/admin/admin.d.ts +4 -4
- package/admin/admin.js +7 -5
- package/admin/admin.js.map +1 -1
- package/asset/asset.cjs +15 -13
- package/asset/asset.cjs.map +1 -1
- package/asset/asset.d.ts +20 -20
- package/asset/asset.js +7 -5
- package/asset/asset.js.map +1 -1
- package/{chunk-3O5KIRV4.js → chunk-3RNIDX7T.js} +1 -1
- package/{chunk-3O5KIRV4.js.map → chunk-3RNIDX7T.js.map} +1 -1
- package/chunk-7XN3IQYV.cjs +13 -0
- package/chunk-7XN3IQYV.cjs.map +1 -0
- package/{chunk-IUEU2LYC.cjs → chunk-UZTHSGDT.cjs} +1 -1
- package/chunk-UZTHSGDT.cjs.map +1 -0
- package/chunk-YEX2SGER.js +13 -0
- package/chunk-YEX2SGER.js.map +1 -0
- package/{custom-instance-dad9d28e.d.ts → custom-instance-85497958.d.ts} +110 -48
- package/index.cjs +2 -2
- package/index.cjs.map +1 -1
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/merchant/merchant.cjs +12 -9
- package/merchant/merchant.cjs.map +1 -1
- package/merchant/merchant.d.ts +6 -6
- package/merchant/merchant.js +10 -7
- package/merchant/merchant.js.map +1 -1
- package/organisation/organisation.cjs +44 -16
- package/organisation/organisation.cjs.map +1 -1
- package/organisation/organisation.d.ts +37 -16
- package/organisation/organisation.js +38 -10
- package/organisation/organisation.js.map +1 -1
- package/package.json +12 -12
- package/product/product.cjs +35 -33
- package/product/product.cjs.map +1 -1
- package/product/product.d.ts +24 -24
- package/product/product.js +25 -23
- package/product/product.js.map +1 -1
- package/src/account-server-api.schemas.ts +85 -17
- package/src/admin/admin.ts +6 -5
- package/src/asset/asset.ts +6 -5
- package/src/merchant/merchant.ts +10 -9
- package/src/organisation/organisation.ts +78 -19
- package/src/product/product.ts +30 -32
- package/src/queryMutator.ts +12 -0
- package/src/state/state.ts +6 -5
- package/src/unit/unit.ts +78 -19
- package/src/user/user.ts +14 -15
- package/state/state.cjs +8 -6
- package/state/state.cjs.map +1 -1
- package/state/state.d.ts +4 -4
- package/state/state.js +7 -5
- package/state/state.js.map +1 -1
- package/unit/unit.cjs +46 -25
- package/unit/unit.cjs.map +1 -1
- package/unit/unit.d.ts +42 -21
- package/unit/unit.js +38 -17
- package/unit/unit.js.map +1 -1
- package/user/user.cjs +20 -17
- package/user/user.cjs.map +1 -1
- package/user/user.d.ts +16 -16
- package/user/user.js +13 -10
- package/user/user.js.map +1 -1
- package/chunk-IUEU2LYC.cjs.map +0 -1
package/product/product.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
2
2
|
import { UseQueryOptions, QueryKey, UseQueryResult, UseMutationOptions } from '@tanstack/react-query';
|
|
3
|
-
import {
|
|
3
|
+
import { aE as customInstance, ae as ProductsGetTypesResponse, aF as ErrorType, aA as AsError, ag as ProductsGetDefaultStorageCost, ai as ProductsGetResponse, m as UnitProductPostBodyBody, a6 as UnitProductPostResponse, ad as ProductUnitGetResponse, P as ProductPatchBodyBody, b as GetProductChargesParams, ak as ProductChargesGetResponse } from '../custom-instance-85497958.js';
|
|
4
4
|
import 'axios';
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
type SecondParameter<T extends (...args: any) => any> = T extends (config: any, args: infer P) => any ? P : never;
|
|
7
7
|
/**
|
|
8
8
|
* Gets product types you can purchase
|
|
9
9
|
|
|
@@ -11,8 +11,8 @@ declare type SecondParameter<T extends (...args: any) => any> = T extends (confi
|
|
|
11
11
|
*/
|
|
12
12
|
declare const getProductTypes: (options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<ProductsGetTypesResponse>;
|
|
13
13
|
declare const getGetProductTypesQueryKey: () => string[];
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
type GetProductTypesQueryResult = NonNullable<Awaited<ReturnType<typeof getProductTypes>>>;
|
|
15
|
+
type GetProductTypesQueryError = ErrorType<AsError | void>;
|
|
16
16
|
declare const useGetProductTypes: <TData = ProductsGetTypesResponse, TError = ErrorType<void | AsError>>(options?: {
|
|
17
17
|
query?: UseQueryOptions<ProductsGetTypesResponse, TError, TData, QueryKey> | undefined;
|
|
18
18
|
request?: SecondParameter<typeof customInstance>;
|
|
@@ -24,8 +24,8 @@ declare const useGetProductTypes: <TData = ProductsGetTypesResponse, TError = Er
|
|
|
24
24
|
*/
|
|
25
25
|
declare const getProductDefaultStorageCost: (options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<ProductsGetDefaultStorageCost>;
|
|
26
26
|
declare const getGetProductDefaultStorageCostQueryKey: () => string[];
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
type GetProductDefaultStorageCostQueryResult = NonNullable<Awaited<ReturnType<typeof getProductDefaultStorageCost>>>;
|
|
28
|
+
type GetProductDefaultStorageCostQueryError = ErrorType<AsError | void>;
|
|
29
29
|
declare const useGetProductDefaultStorageCost: <TData = ProductsGetDefaultStorageCost, TError = ErrorType<void | AsError>>(options?: {
|
|
30
30
|
query?: UseQueryOptions<ProductsGetDefaultStorageCost, TError, TData, QueryKey> | undefined;
|
|
31
31
|
request?: SecondParameter<typeof customInstance>;
|
|
@@ -39,8 +39,8 @@ declare const useGetProductDefaultStorageCost: <TData = ProductsGetDefaultStorag
|
|
|
39
39
|
*/
|
|
40
40
|
declare const getProducts: (options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<ProductsGetResponse>;
|
|
41
41
|
declare const getGetProductsQueryKey: () => string[];
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
type GetProductsQueryResult = NonNullable<Awaited<ReturnType<typeof getProducts>>>;
|
|
43
|
+
type GetProductsQueryError = ErrorType<AsError | void>;
|
|
44
44
|
declare const useGetProducts: <TData = ProductsGetResponse, TError = ErrorType<void | AsError>>(options?: {
|
|
45
45
|
query?: UseQueryOptions<ProductsGetResponse, TError, TData, QueryKey> | undefined;
|
|
46
46
|
request?: SecondParameter<typeof customInstance>;
|
|
@@ -54,8 +54,8 @@ declare const useGetProducts: <TData = ProductsGetResponse, TError = ErrorType<v
|
|
|
54
54
|
*/
|
|
55
55
|
declare const getProductsForOrganisation: (orgId: string, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<ProductsGetResponse>;
|
|
56
56
|
declare const getGetProductsForOrganisationQueryKey: (orgId: string) => string[];
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
type GetProductsForOrganisationQueryResult = NonNullable<Awaited<ReturnType<typeof getProductsForOrganisation>>>;
|
|
58
|
+
type GetProductsForOrganisationQueryError = ErrorType<void | AsError>;
|
|
59
59
|
declare const useGetProductsForOrganisation: <TData = ProductsGetResponse, TError = ErrorType<void | AsError>>(orgId: string, options?: {
|
|
60
60
|
query?: UseQueryOptions<ProductsGetResponse, TError, TData, QueryKey> | undefined;
|
|
61
61
|
request?: SecondParameter<typeof customInstance>;
|
|
@@ -72,9 +72,9 @@ Some subscriptions, like the `DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION` are availa
|
|
|
72
72
|
* @summary Creates a Product for an Organisational Unit
|
|
73
73
|
*/
|
|
74
74
|
declare const createUnitProduct: (unitId: string, unitProductPostBodyBody: UnitProductPostBodyBody, options?: SecondParameter<typeof customInstance>) => Promise<UnitProductPostResponse>;
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
type CreateUnitProductMutationResult = NonNullable<Awaited<ReturnType<typeof createUnitProduct>>>;
|
|
76
|
+
type CreateUnitProductMutationBody = UnitProductPostBodyBody;
|
|
77
|
+
type CreateUnitProductMutationError = ErrorType<AsError | void>;
|
|
78
78
|
declare const useCreateUnitProduct: <TError = ErrorType<void | AsError>, TContext = unknown>(options?: {
|
|
79
79
|
mutation?: UseMutationOptions<UnitProductPostResponse, TError, {
|
|
80
80
|
unitId: string;
|
|
@@ -92,8 +92,8 @@ declare const useCreateUnitProduct: <TError = ErrorType<void | AsError>, TContex
|
|
|
92
92
|
*/
|
|
93
93
|
declare const getProductsForUnit: (unitId: string, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<ProductsGetResponse>;
|
|
94
94
|
declare const getGetProductsForUnitQueryKey: (unitId: string) => string[];
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
type GetProductsForUnitQueryResult = NonNullable<Awaited<ReturnType<typeof getProductsForUnit>>>;
|
|
96
|
+
type GetProductsForUnitQueryError = ErrorType<void | AsError>;
|
|
97
97
|
declare const useGetProductsForUnit: <TData = ProductsGetResponse, TError = ErrorType<void | AsError>>(unitId: string, options?: {
|
|
98
98
|
query?: UseQueryOptions<ProductsGetResponse, TError, TData, QueryKey> | undefined;
|
|
99
99
|
request?: SecondParameter<typeof customInstance>;
|
|
@@ -107,8 +107,8 @@ declare const useGetProductsForUnit: <TData = ProductsGetResponse, TError = Erro
|
|
|
107
107
|
*/
|
|
108
108
|
declare const getProduct: (productId: string, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<ProductUnitGetResponse>;
|
|
109
109
|
declare const getGetProductQueryKey: (productId: string) => string[];
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
type GetProductQueryResult = NonNullable<Awaited<ReturnType<typeof getProduct>>>;
|
|
111
|
+
type GetProductQueryError = ErrorType<AsError | void>;
|
|
112
112
|
declare const useGetProduct: <TData = ProductUnitGetResponse, TError = ErrorType<void | AsError>>(productId: string, options?: {
|
|
113
113
|
query?: UseQueryOptions<ProductUnitGetResponse, TError, TData, QueryKey> | undefined;
|
|
114
114
|
request?: SecondParameter<typeof customInstance>;
|
|
@@ -119,8 +119,8 @@ declare const useGetProduct: <TData = ProductUnitGetResponse, TError = ErrorType
|
|
|
119
119
|
* @summary Deletes an existing Product
|
|
120
120
|
*/
|
|
121
121
|
declare const deleteProduct: (productId: string, options?: SecondParameter<typeof customInstance>) => Promise<void>;
|
|
122
|
-
|
|
123
|
-
|
|
122
|
+
type DeleteProductMutationResult = NonNullable<Awaited<ReturnType<typeof deleteProduct>>>;
|
|
123
|
+
type DeleteProductMutationError = ErrorType<AsError>;
|
|
124
124
|
declare const useDeleteProduct: <TError = ErrorType<AsError>, TContext = unknown>(options?: {
|
|
125
125
|
mutation?: UseMutationOptions<void, TError, {
|
|
126
126
|
productId: string;
|
|
@@ -135,9 +135,9 @@ declare const useDeleteProduct: <TError = ErrorType<AsError>, TContext = unknown
|
|
|
135
135
|
* @summary Adjust an existing Product
|
|
136
136
|
*/
|
|
137
137
|
declare const patchProduct: (productId: string, productPatchBodyBody: ProductPatchBodyBody, options?: SecondParameter<typeof customInstance>) => Promise<void>;
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
138
|
+
type PatchProductMutationResult = NonNullable<Awaited<ReturnType<typeof patchProduct>>>;
|
|
139
|
+
type PatchProductMutationBody = ProductPatchBodyBody;
|
|
140
|
+
type PatchProductMutationError = ErrorType<AsError>;
|
|
141
141
|
declare const usePatchProduct: <TError = ErrorType<AsError>, TContext = unknown>(options?: {
|
|
142
142
|
mutation?: UseMutationOptions<void, TError, {
|
|
143
143
|
productId: string;
|
|
@@ -160,8 +160,8 @@ You need to be part of the **Unit** or **Organisation** to use this method
|
|
|
160
160
|
*/
|
|
161
161
|
declare const getProductCharges: (productId: string, params?: GetProductChargesParams, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<ProductChargesGetResponse>;
|
|
162
162
|
declare const getGetProductChargesQueryKey: (productId: string, params?: GetProductChargesParams) => (string | GetProductChargesParams)[];
|
|
163
|
-
|
|
164
|
-
|
|
163
|
+
type GetProductChargesQueryResult = NonNullable<Awaited<ReturnType<typeof getProductCharges>>>;
|
|
164
|
+
type GetProductChargesQueryError = ErrorType<AsError | void>;
|
|
165
165
|
declare const useGetProductCharges: <TData = ProductChargesGetResponse, TError = ErrorType<void | AsError>>(productId: string, params?: GetProductChargesParams, options?: {
|
|
166
166
|
query?: UseQueryOptions<ProductChargesGetResponse, TError, TData, QueryKey> | undefined;
|
|
167
167
|
request?: SecondParameter<typeof customInstance>;
|
package/product/product.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import {
|
|
2
|
+
queryMutator
|
|
3
|
+
} from "../chunk-YEX2SGER.js";
|
|
1
4
|
import {
|
|
2
5
|
customInstance
|
|
3
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-3RNIDX7T.js";
|
|
4
7
|
|
|
5
8
|
// src/product/product.ts
|
|
6
9
|
import { useQuery, useMutation } from "@tanstack/react-query";
|
|
@@ -17,8 +20,9 @@ var useGetProductTypes = (options) => {
|
|
|
17
20
|
const queryFn = ({
|
|
18
21
|
signal
|
|
19
22
|
}) => getProductTypes(requestOptions, signal);
|
|
20
|
-
const
|
|
21
|
-
query
|
|
23
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
24
|
+
const query = useQuery(customOptions);
|
|
25
|
+
query.queryKey = customOptions.queryKey;
|
|
22
26
|
return query;
|
|
23
27
|
};
|
|
24
28
|
var getProductDefaultStorageCost = (options, signal) => {
|
|
@@ -34,8 +38,9 @@ var useGetProductDefaultStorageCost = (options) => {
|
|
|
34
38
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
35
39
|
const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetProductDefaultStorageCostQueryKey();
|
|
36
40
|
const queryFn = ({ signal }) => getProductDefaultStorageCost(requestOptions, signal);
|
|
37
|
-
const
|
|
38
|
-
query
|
|
41
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
42
|
+
const query = useQuery(customOptions);
|
|
43
|
+
query.queryKey = customOptions.queryKey;
|
|
39
44
|
return query;
|
|
40
45
|
};
|
|
41
46
|
var getProducts = (options, signal) => {
|
|
@@ -51,8 +56,9 @@ var useGetProducts = (options) => {
|
|
|
51
56
|
const queryFn = ({
|
|
52
57
|
signal
|
|
53
58
|
}) => getProducts(requestOptions, signal);
|
|
54
|
-
const
|
|
55
|
-
query
|
|
59
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
60
|
+
const query = useQuery(customOptions);
|
|
61
|
+
query.queryKey = customOptions.queryKey;
|
|
56
62
|
return query;
|
|
57
63
|
};
|
|
58
64
|
var getProductsForOrganisation = (orgId, options, signal) => {
|
|
@@ -68,8 +74,9 @@ var useGetProductsForOrganisation = (orgId, options) => {
|
|
|
68
74
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
69
75
|
const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetProductsForOrganisationQueryKey(orgId);
|
|
70
76
|
const queryFn = ({ signal }) => getProductsForOrganisation(orgId, requestOptions, signal);
|
|
71
|
-
const
|
|
72
|
-
query
|
|
77
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
78
|
+
const query = useQuery(customOptions);
|
|
79
|
+
query.queryKey = customOptions.queryKey;
|
|
73
80
|
return query;
|
|
74
81
|
};
|
|
75
82
|
var createUnitProduct = (unitId, unitProductPostBodyBody, options) => {
|
|
@@ -104,11 +111,9 @@ var useGetProductsForUnit = (unitId, options) => {
|
|
|
104
111
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
105
112
|
const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetProductsForUnitQueryKey(unitId);
|
|
106
113
|
const queryFn = ({ signal }) => getProductsForUnit(unitId, requestOptions, signal);
|
|
107
|
-
const
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
});
|
|
111
|
-
query.queryKey = queryKey;
|
|
114
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
115
|
+
const query = useQuery(customOptions);
|
|
116
|
+
query.queryKey = customOptions.queryKey;
|
|
112
117
|
return query;
|
|
113
118
|
};
|
|
114
119
|
var getProduct = (productId, options, signal) => {
|
|
@@ -126,12 +131,11 @@ var useGetProduct = (productId, options) => {
|
|
|
126
131
|
const queryFn = ({
|
|
127
132
|
signal
|
|
128
133
|
}) => getProduct(productId, requestOptions, signal);
|
|
134
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
129
135
|
const query = useQuery(
|
|
130
|
-
|
|
131
|
-
queryFn,
|
|
132
|
-
{ enabled: !!productId, ...queryOptions }
|
|
136
|
+
customOptions
|
|
133
137
|
);
|
|
134
|
-
query.queryKey = queryKey;
|
|
138
|
+
query.queryKey = customOptions.queryKey;
|
|
135
139
|
return query;
|
|
136
140
|
};
|
|
137
141
|
var deleteProduct = (productId, options) => {
|
|
@@ -178,11 +182,9 @@ var useGetProductCharges = (productId, params, options) => {
|
|
|
178
182
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
179
183
|
const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetProductChargesQueryKey(productId, params);
|
|
180
184
|
const queryFn = ({ signal }) => getProductCharges(productId, params, requestOptions, signal);
|
|
181
|
-
const
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
});
|
|
185
|
-
query.queryKey = queryKey;
|
|
185
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
186
|
+
const query = useQuery(customOptions);
|
|
187
|
+
query.queryKey = customOptions.queryKey;
|
|
186
188
|
return query;
|
|
187
189
|
};
|
|
188
190
|
export {
|
package/product/product.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/product/product.ts"],"sourcesContent":["/**\n * Generated by orval v6.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 **Products**, **Organisations**, **Units** and **Users**.\n\n * OpenAPI spec version: 2.0\n */\nimport { useQuery, useMutation } from \"@tanstack/react-query\";\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"@tanstack/react-query\";\nimport type {\n ProductsGetTypesResponse,\n AsError,\n ProductsGetDefaultStorageCost,\n ProductsGetResponse,\n UnitProductPostResponse,\n UnitProductPostBodyBody,\n ProductUnitGetResponse,\n ProductPatchBodyBody,\n ProductChargesGetResponse,\n GetProductChargesParams,\n} from \"../account-server-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * Gets product types you can purchase\n\n * @summary Gets all Product Types\n */\nexport const getProductTypes = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProductsGetTypesResponse>(\n { url: `/product-type`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetProductTypesQueryKey = () => [`/product-type`];\n\nexport type GetProductTypesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProductTypes>>\n>;\nexport type GetProductTypesQueryError = ErrorType<AsError | void>;\n\nexport const useGetProductTypes = <\n TData = Awaited<ReturnType<typeof getProductTypes>>,\n TError = ErrorType<AsError | void>\n>(options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProductTypes>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProductTypesQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProductTypes>>> = ({\n signal,\n }) => getProductTypes(requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getProductTypes>>,\n TError,\n TData\n >(queryKey, queryFn, queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * @summary Gets the default cross-product storage cost\n */\nexport const getProductDefaultStorageCost = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProductsGetDefaultStorageCost>(\n { url: `/product-default-storage-cost`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetProductDefaultStorageCostQueryKey = () => [\n `/product-default-storage-cost`,\n];\n\nexport type GetProductDefaultStorageCostQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProductDefaultStorageCost>>\n>;\nexport type GetProductDefaultStorageCostQueryError = ErrorType<AsError | void>;\n\nexport const useGetProductDefaultStorageCost = <\n TData = Awaited<ReturnType<typeof getProductDefaultStorageCost>>,\n TError = ErrorType<AsError | void>\n>(options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProductDefaultStorageCost>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetProductDefaultStorageCostQueryKey();\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getProductDefaultStorageCost>>\n > = ({ signal }) => getProductDefaultStorageCost(requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getProductDefaultStorageCost>>,\n TError,\n TData\n >(queryKey, queryFn, queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * Gets products you have access to, across all Units and Organisations\n\n * @summary Gets all Products\n */\nexport const getProducts = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProductsGetResponse>(\n { url: `/product`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetProductsQueryKey = () => [`/product`];\n\nexport type GetProductsQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProducts>>\n>;\nexport type GetProductsQueryError = ErrorType<AsError | void>;\n\nexport const useGetProducts = <\n TData = Awaited<ReturnType<typeof getProducts>>,\n TError = ErrorType<AsError | void>\n>(options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProducts>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProductsQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProducts>>> = ({\n signal,\n }) => getProducts(requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getProducts>>,\n TError,\n TData\n >(queryKey, queryFn, queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * Gets products you have access to based on an Organisation\n\n * @summary Gets Products for an Organisation\n */\nexport const getProductsForOrganisation = (\n orgId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProductsGetResponse>(\n { url: `/product/organisation/${orgId}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetProductsForOrganisationQueryKey = (orgId: string) => [\n `/product/organisation/${orgId}`,\n];\n\nexport type GetProductsForOrganisationQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProductsForOrganisation>>\n>;\nexport type GetProductsForOrganisationQueryError = ErrorType<void | AsError>;\n\nexport const useGetProductsForOrganisation = <\n TData = Awaited<ReturnType<typeof getProductsForOrganisation>>,\n TError = ErrorType<void | AsError>\n>(\n orgId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProductsForOrganisation>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetProductsForOrganisationQueryKey(orgId);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getProductsForOrganisation>>\n > = ({ signal }) => getProductsForOrganisation(orgId, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getProductsForOrganisation>>,\n TError,\n TData\n >(queryKey, queryFn, { enabled: !!orgId, ...queryOptions }) as UseQueryResult<\n TData,\n TError\n > & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * Products are **Subscriptions** that you create in a Unit and use **Merchant** services like the `DATA_MANAGER`.\n\nTypical subscriptions include `DATA_MANAGER_STORAGE_SUBSCRIPTION` and `DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION`.\n\nSome subscriptions, like the `DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION` are available i various **flavours** that influence their capabilities. Flavours are typically referred to using the names `BRONZE`, `SILVER` and `GOLD`\n\n * @summary Creates a Product for an Organisational Unit\n */\nexport const createUnitProduct = (\n unitId: string,\n unitProductPostBodyBody: UnitProductPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<UnitProductPostResponse>(\n {\n url: `/product/unit/${unitId}`,\n method: \"post\",\n headers: { \"Content-Type\": \"application/json\" },\n data: unitProductPostBodyBody,\n },\n options\n );\n};\n\nexport type CreateUnitProductMutationResult = NonNullable<\n Awaited<ReturnType<typeof createUnitProduct>>\n>;\nexport type CreateUnitProductMutationBody = UnitProductPostBodyBody;\nexport type CreateUnitProductMutationError = ErrorType<AsError | void>;\n\nexport const useCreateUnitProduct = <\n TError = ErrorType<AsError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createUnitProduct>>,\n TError,\n { unitId: string; data: UnitProductPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof createUnitProduct>>,\n { unitId: string; data: UnitProductPostBodyBody }\n > = (props) => {\n const { unitId, data } = props ?? {};\n\n return createUnitProduct(unitId, data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof createUnitProduct>>,\n TError,\n { unitId: string; data: UnitProductPostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets products you have access to based on an Organisational Unit\n\n * @summary Gets Products for an Organisational Unit\n */\nexport const getProductsForUnit = (\n unitId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProductsGetResponse>(\n { url: `/product/unit/${unitId}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetProductsForUnitQueryKey = (unitId: string) => [\n `/product/unit/${unitId}`,\n];\n\nexport type GetProductsForUnitQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProductsForUnit>>\n>;\nexport type GetProductsForUnitQueryError = ErrorType<void | AsError>;\n\nexport const useGetProductsForUnit = <\n TData = Awaited<ReturnType<typeof getProductsForUnit>>,\n TError = ErrorType<void | AsError>\n>(\n unitId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProductsForUnit>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetProductsForUnitQueryKey(unitId);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getProductsForUnit>>\n > = ({ signal }) => getProductsForUnit(unitId, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getProductsForUnit>>,\n TError,\n TData\n >(queryKey, queryFn, {\n enabled: !!unitId,\n ...queryOptions,\n }) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * Gets a Product\n\n * @summary Gets a Product\n */\nexport const getProduct = (\n productId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProductUnitGetResponse>(\n { url: `/product/${productId}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetProductQueryKey = (productId: string) => [\n `/product/${productId}`,\n];\n\nexport type GetProductQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProduct>>\n>;\nexport type GetProductQueryError = ErrorType<AsError | void>;\n\nexport const useGetProduct = <\n TData = Awaited<ReturnType<typeof getProduct>>,\n TError = ErrorType<AsError | void>\n>(\n productId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProduct>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProductQueryKey(productId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProduct>>> = ({\n signal,\n }) => getProduct(productId, requestOptions, signal);\n\n const query = useQuery<Awaited<ReturnType<typeof getProduct>>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!productId, ...queryOptions }\n ) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * @summary Deletes an existing Product\n */\nexport const deleteProduct = (\n productId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/product/${productId}`, method: \"delete\" },\n options\n );\n};\n\nexport type DeleteProductMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteProduct>>\n>;\n\nexport type DeleteProductMutationError = ErrorType<AsError>;\n\nexport const useDeleteProduct = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteProduct>>,\n TError,\n { productId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteProduct>>,\n { productId: string }\n > = (props) => {\n const { productId } = props ?? {};\n\n return deleteProduct(productId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof deleteProduct>>,\n TError,\n { productId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Used to update some adjustable parameters of a Product, i.e. to extend the Allowance or Limit. At the moment Data Manager products can be patched by changing the `name`, it's coin `allowance` or `limit`\n\n * @summary Adjust an existing Product\n */\nexport const patchProduct = (\n productId: string,\n productPatchBodyBody: ProductPatchBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n {\n url: `/product/${productId}`,\n method: \"patch\",\n headers: { \"Content-Type\": \"application/json\" },\n data: productPatchBodyBody,\n },\n options\n );\n};\n\nexport type PatchProductMutationResult = NonNullable<\n Awaited<ReturnType<typeof patchProduct>>\n>;\nexport type PatchProductMutationBody = ProductPatchBodyBody;\nexport type PatchProductMutationError = ErrorType<AsError>;\n\nexport const usePatchProduct = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchProduct>>,\n TError,\n { productId: string; data: ProductPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof patchProduct>>,\n { productId: string; data: ProductPatchBodyBody }\n > = (props) => {\n const { productId, data } = props ?? {};\n\n return patchProduct(productId, data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof patchProduct>>,\n TError,\n { productId: string; data: ProductPatchBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Get the charges made against a product with optional **from** (inclusive) and **until** (exclusive) dates. If no dates are provided, the charges for the current billing period are returned.\n\nDates are interpreted using the Python dateutil parser so the input strings are extremely flexible, i.e. `1 December 2021` is an acceptable format.\n\n**from** must be a date (day) prior to **until**. For example, to see the charges for the 11th July 2022 set **from** to `11 July 2022` and **until** to `12 July 2022`. As an alternative to **From** and **Until** you can provide a **Prior Billing Period**, a value that identifies the prior period to retrieve. A value of `-1` would indicate the *prior period* (month) with an oldest retrieval value of `-23` (approximately two years).\n\nYou need to be part of the **Unit** or **Organisation** to use this method\n * @summary Get charges made against a Product\n */\nexport const getProductCharges = (\n productId: string,\n params?: GetProductChargesParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProductChargesGetResponse>(\n { url: `/product/${productId}/charges`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetProductChargesQueryKey = (\n productId: string,\n params?: GetProductChargesParams\n) => [`/product/${productId}/charges`, ...(params ? [params] : [])];\n\nexport type GetProductChargesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProductCharges>>\n>;\nexport type GetProductChargesQueryError = ErrorType<AsError | void>;\n\nexport const useGetProductCharges = <\n TData = Awaited<ReturnType<typeof getProductCharges>>,\n TError = ErrorType<AsError | void>\n>(\n productId: string,\n params?: GetProductChargesParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProductCharges>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetProductChargesQueryKey(productId, params);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getProductCharges>>\n > = ({ signal }) =>\n getProductCharges(productId, params, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getProductCharges>>,\n TError,\n TData\n >(queryKey, queryFn, {\n enabled: !!productId,\n ...queryOptions,\n }) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n"],"mappings":";;;;;AAUA,SAAS,UAAU,mBAAmB;AAqC/B,IAAM,kBAAkB,CAC7B,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,iBAAiB,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/product/product.ts"],"sourcesContent":["/**\n * Generated by orval v6.12.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 **Products**, **Organisations**, **Units** and **Users**.\n\n * OpenAPI spec version: 2.0\n */\nimport { useQuery, useMutation } from \"@tanstack/react-query\";\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"@tanstack/react-query\";\nimport type {\n ProductsGetTypesResponse,\n AsError,\n ProductsGetDefaultStorageCost,\n ProductsGetResponse,\n UnitProductPostResponse,\n UnitProductPostBodyBody,\n ProductUnitGetResponse,\n ProductPatchBodyBody,\n ProductChargesGetResponse,\n GetProductChargesParams,\n} from \"../account-server-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\nimport { queryMutator } from \".././queryMutator\";\n\n// eslint-disable-next-line\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * Gets product types you can purchase\n\n * @summary Gets all Product Types\n */\nexport const getProductTypes = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProductsGetTypesResponse>(\n { url: `/product-type`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetProductTypesQueryKey = () => [`/product-type`];\n\nexport type GetProductTypesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProductTypes>>\n>;\nexport type GetProductTypesQueryError = ErrorType<AsError | void>;\n\nexport const useGetProductTypes = <\n TData = Awaited<ReturnType<typeof getProductTypes>>,\n TError = ErrorType<AsError | void>\n>(options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProductTypes>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProductTypesQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProductTypes>>> = ({\n signal,\n }) => getProductTypes(requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n const query = useQuery<\n Awaited<ReturnType<typeof getProductTypes>>,\n TError,\n TData\n >(customOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = customOptions.queryKey;\n\n return query;\n};\n\n/**\n * @summary Gets the default cross-product storage cost\n */\nexport const getProductDefaultStorageCost = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProductsGetDefaultStorageCost>(\n { url: `/product-default-storage-cost`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetProductDefaultStorageCostQueryKey = () => [\n `/product-default-storage-cost`,\n];\n\nexport type GetProductDefaultStorageCostQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProductDefaultStorageCost>>\n>;\nexport type GetProductDefaultStorageCostQueryError = ErrorType<AsError | void>;\n\nexport const useGetProductDefaultStorageCost = <\n TData = Awaited<ReturnType<typeof getProductDefaultStorageCost>>,\n TError = ErrorType<AsError | void>\n>(options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProductDefaultStorageCost>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetProductDefaultStorageCostQueryKey();\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getProductDefaultStorageCost>>\n > = ({ signal }) => getProductDefaultStorageCost(requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n const query = useQuery<\n Awaited<ReturnType<typeof getProductDefaultStorageCost>>,\n TError,\n TData\n >(customOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = customOptions.queryKey;\n\n return query;\n};\n\n/**\n * Gets products you have access to, across all Units and Organisations\n\n * @summary Gets all Products\n */\nexport const getProducts = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProductsGetResponse>(\n { url: `/product`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetProductsQueryKey = () => [`/product`];\n\nexport type GetProductsQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProducts>>\n>;\nexport type GetProductsQueryError = ErrorType<AsError | void>;\n\nexport const useGetProducts = <\n TData = Awaited<ReturnType<typeof getProducts>>,\n TError = ErrorType<AsError | void>\n>(options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProducts>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProductsQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProducts>>> = ({\n signal,\n }) => getProducts(requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n const query = useQuery<\n Awaited<ReturnType<typeof getProducts>>,\n TError,\n TData\n >(customOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = customOptions.queryKey;\n\n return query;\n};\n\n/**\n * Gets products you have access to based on an Organisation\n\n * @summary Gets Products for an Organisation\n */\nexport const getProductsForOrganisation = (\n orgId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProductsGetResponse>(\n { url: `/product/organisation/${orgId}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetProductsForOrganisationQueryKey = (orgId: string) => [\n `/product/organisation/${orgId}`,\n];\n\nexport type GetProductsForOrganisationQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProductsForOrganisation>>\n>;\nexport type GetProductsForOrganisationQueryError = ErrorType<void | AsError>;\n\nexport const useGetProductsForOrganisation = <\n TData = Awaited<ReturnType<typeof getProductsForOrganisation>>,\n TError = ErrorType<void | AsError>\n>(\n orgId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProductsForOrganisation>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetProductsForOrganisationQueryKey(orgId);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getProductsForOrganisation>>\n > = ({ signal }) => getProductsForOrganisation(orgId, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n const query = useQuery<\n Awaited<ReturnType<typeof getProductsForOrganisation>>,\n TError,\n TData\n >(customOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = customOptions.queryKey;\n\n return query;\n};\n\n/**\n * Products are **Subscriptions** that you create in a Unit and use **Merchant** services like the `DATA_MANAGER`.\n\nTypical subscriptions include `DATA_MANAGER_STORAGE_SUBSCRIPTION` and `DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION`.\n\nSome subscriptions, like the `DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION` are available i various **flavours** that influence their capabilities. Flavours are typically referred to using the names `BRONZE`, `SILVER` and `GOLD`\n\n * @summary Creates a Product for an Organisational Unit\n */\nexport const createUnitProduct = (\n unitId: string,\n unitProductPostBodyBody: UnitProductPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<UnitProductPostResponse>(\n {\n url: `/product/unit/${unitId}`,\n method: \"post\",\n headers: { \"Content-Type\": \"application/json\" },\n data: unitProductPostBodyBody,\n },\n options\n );\n};\n\nexport type CreateUnitProductMutationResult = NonNullable<\n Awaited<ReturnType<typeof createUnitProduct>>\n>;\nexport type CreateUnitProductMutationBody = UnitProductPostBodyBody;\nexport type CreateUnitProductMutationError = ErrorType<AsError | void>;\n\nexport const useCreateUnitProduct = <\n TError = ErrorType<AsError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createUnitProduct>>,\n TError,\n { unitId: string; data: UnitProductPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof createUnitProduct>>,\n { unitId: string; data: UnitProductPostBodyBody }\n > = (props) => {\n const { unitId, data } = props ?? {};\n\n return createUnitProduct(unitId, data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof createUnitProduct>>,\n TError,\n { unitId: string; data: UnitProductPostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets products you have access to based on an Organisational Unit\n\n * @summary Gets Products for an Organisational Unit\n */\nexport const getProductsForUnit = (\n unitId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProductsGetResponse>(\n { url: `/product/unit/${unitId}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetProductsForUnitQueryKey = (unitId: string) => [\n `/product/unit/${unitId}`,\n];\n\nexport type GetProductsForUnitQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProductsForUnit>>\n>;\nexport type GetProductsForUnitQueryError = ErrorType<void | AsError>;\n\nexport const useGetProductsForUnit = <\n TData = Awaited<ReturnType<typeof getProductsForUnit>>,\n TError = ErrorType<void | AsError>\n>(\n unitId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProductsForUnit>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetProductsForUnitQueryKey(unitId);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getProductsForUnit>>\n > = ({ signal }) => getProductsForUnit(unitId, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n const query = useQuery<\n Awaited<ReturnType<typeof getProductsForUnit>>,\n TError,\n TData\n >(customOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = customOptions.queryKey;\n\n return query;\n};\n\n/**\n * Gets a Product\n\n * @summary Gets a Product\n */\nexport const getProduct = (\n productId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProductUnitGetResponse>(\n { url: `/product/${productId}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetProductQueryKey = (productId: string) => [\n `/product/${productId}`,\n];\n\nexport type GetProductQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProduct>>\n>;\nexport type GetProductQueryError = ErrorType<AsError | void>;\n\nexport const useGetProduct = <\n TData = Awaited<ReturnType<typeof getProduct>>,\n TError = ErrorType<AsError | void>\n>(\n productId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProduct>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProductQueryKey(productId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProduct>>> = ({\n signal,\n }) => getProduct(productId, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n const query = useQuery<Awaited<ReturnType<typeof getProduct>>, TError, TData>(\n customOptions\n ) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = customOptions.queryKey;\n\n return query;\n};\n\n/**\n * @summary Deletes an existing Product\n */\nexport const deleteProduct = (\n productId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/product/${productId}`, method: \"delete\" },\n options\n );\n};\n\nexport type DeleteProductMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteProduct>>\n>;\n\nexport type DeleteProductMutationError = ErrorType<AsError>;\n\nexport const useDeleteProduct = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteProduct>>,\n TError,\n { productId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteProduct>>,\n { productId: string }\n > = (props) => {\n const { productId } = props ?? {};\n\n return deleteProduct(productId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof deleteProduct>>,\n TError,\n { productId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Used to update some adjustable parameters of a Product, i.e. to extend the Allowance or Limit. At the moment Data Manager products can be patched by changing the `name`, it's coin `allowance` or `limit`\n\n * @summary Adjust an existing Product\n */\nexport const patchProduct = (\n productId: string,\n productPatchBodyBody: ProductPatchBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n {\n url: `/product/${productId}`,\n method: \"patch\",\n headers: { \"Content-Type\": \"application/json\" },\n data: productPatchBodyBody,\n },\n options\n );\n};\n\nexport type PatchProductMutationResult = NonNullable<\n Awaited<ReturnType<typeof patchProduct>>\n>;\nexport type PatchProductMutationBody = ProductPatchBodyBody;\nexport type PatchProductMutationError = ErrorType<AsError>;\n\nexport const usePatchProduct = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchProduct>>,\n TError,\n { productId: string; data: ProductPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof patchProduct>>,\n { productId: string; data: ProductPatchBodyBody }\n > = (props) => {\n const { productId, data } = props ?? {};\n\n return patchProduct(productId, data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof patchProduct>>,\n TError,\n { productId: string; data: ProductPatchBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Get the charges made against a product with optional **from** (inclusive) and **until** (exclusive) dates. If no dates are provided, the charges for the current billing period are returned.\n\nDates are interpreted using the Python dateutil parser so the input strings are extremely flexible, i.e. `1 December 2021` is an acceptable format.\n\n**from** must be a date (day) prior to **until**. For example, to see the charges for the 11th July 2022 set **from** to `11 July 2022` and **until** to `12 July 2022`. As an alternative to **From** and **Until** you can provide a **Prior Billing Period**, a value that identifies the prior period to retrieve. A value of `-1` would indicate the *prior period* (month) with an oldest retrieval value of `-23` (approximately two years).\n\nYou need to be part of the **Unit** or **Organisation** to use this method\n * @summary Get charges made against a Product\n */\nexport const getProductCharges = (\n productId: string,\n params?: GetProductChargesParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProductChargesGetResponse>(\n { url: `/product/${productId}/charges`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetProductChargesQueryKey = (\n productId: string,\n params?: GetProductChargesParams\n) => [`/product/${productId}/charges`, ...(params ? [params] : [])];\n\nexport type GetProductChargesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProductCharges>>\n>;\nexport type GetProductChargesQueryError = ErrorType<AsError | void>;\n\nexport const useGetProductCharges = <\n TData = Awaited<ReturnType<typeof getProductCharges>>,\n TError = ErrorType<AsError | void>\n>(\n productId: string,\n params?: GetProductChargesParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProductCharges>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetProductChargesQueryKey(productId, params);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getProductCharges>>\n > = ({ signal }) =>\n getProductCharges(productId, params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n const query = useQuery<\n Awaited<ReturnType<typeof getProductCharges>>,\n TError,\n TData\n >(customOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = customOptions.queryKey;\n\n return query;\n};\n"],"mappings":";;;;;;;;AAUA,SAAS,UAAU,mBAAmB;AAsC/B,IAAM,kBAAkB,CAC7B,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,iBAAiB,QAAQ,OAAO,OAAO;AAAA,IAC9C;AAAA,EACF;AACF;AAEO,IAAM,6BAA6B,MAAM,CAAC,eAAe;AAOzD,IAAM,qBAAqB,CAGhC,YAO4D;AAC5D,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,2BAA2B;AAEtE,QAAM,UAAsE,CAAC;AAAA,IAC3E;AAAA,EACF,MAAM,gBAAgB,gBAAgB,MAAM;AAE5C,QAAM,gBAAgB,aAAa,EAAE,GAAG,cAAc,UAAU,QAAQ,CAAC;AAEzE,QAAM,QAAQ,SAIZ,aAAa;AAEf,QAAM,WAAW,cAAc;AAE/B,SAAO;AACT;AAKO,IAAM,+BAA+B,CAC1C,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,iCAAiC,QAAQ,OAAO,OAAO;AAAA,IAC9D;AAAA,EACF;AACF;AAEO,IAAM,0CAA0C,MAAM;AAAA,EAC3D;AACF;AAOO,IAAM,kCAAkC,CAG7C,YAO4D;AAC5D,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YACJ,6CAAc,aAAY,wCAAwC;AAEpE,QAAM,UAEF,CAAC,EAAE,OAAO,MAAM,6BAA6B,gBAA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G;AACH,SAAO;AAAA,IACL,EAAE,KAAK,YAAY,qBAAqB,QAAQ,OAAO,QAAQ,OAAO;AAAA,IACtE;AAAA,EACF;AACF;AAEO,IAAM,+BAA+B,CAC1C,WACA,WACG,CAAC,YAAY,qBAAqB,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC,CAAE;AAO3D,IAAM,uBAAuB,CAIlC,WACA,QACA,YAQ2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YACJ,6CAAc,aAAY,6BAA6B,WAAW,MAAM;AAE1E,QAAM,UAEF,CAAC,EAAE,OAAO,MACZ,kBAAkB,WAAW,QAAQ,gBAAgB,MAAM;AAE7D,QAAM,gBAAgB,aAAa,EAAE,GAAG,cAAc,UAAU,QAAQ,CAAC;AAEzE,QAAM,QAAQ,SAIZ,aAAa;AAEf,QAAM,WAAW,cAAc;AAE/B,SAAO;AACT;","names":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Generated by orval v6.
|
|
2
|
+
* Generated by orval v6.12.1 🍺
|
|
3
3
|
* Do not edit manually.
|
|
4
4
|
* Account Server API
|
|
5
5
|
* The Informatics Matters Account Server API.
|
|
@@ -8,7 +8,19 @@ A service that provides access to the Account Server, which gives *registered* u
|
|
|
8
8
|
|
|
9
9
|
* OpenAPI spec version: 2.0
|
|
10
10
|
*/
|
|
11
|
-
export type
|
|
11
|
+
export type DetachAssetParams = {
|
|
12
|
+
/**
|
|
13
|
+
* A Merchant Identity
|
|
14
|
+
*/
|
|
15
|
+
m_id?: QMIdParameter;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export type AttachAssetParams = {
|
|
19
|
+
/**
|
|
20
|
+
* A Merchant Identity
|
|
21
|
+
*/
|
|
22
|
+
m_id?: QMIdParameter;
|
|
23
|
+
};
|
|
12
24
|
|
|
13
25
|
/**
|
|
14
26
|
* A date where assets prior to this will be returned. This can be a date-time string but it is interpreted as a date, i.e. `2020-01-01T00:00:00Z` is interpreted as `2020-01-01`. Any asset that occurs prior this date will be returned. UTC is assumed if no timezone is provided
|
|
@@ -20,21 +32,48 @@ export type QUntilParameter = string;
|
|
|
20
32
|
*/
|
|
21
33
|
export type QFromParameter = string;
|
|
22
34
|
|
|
23
|
-
export type
|
|
35
|
+
export type GetOrganisationChargesParams = {
|
|
36
|
+
/**
|
|
37
|
+
* A date from which to retrieve assets. This can be a date-time string but it is interpreted as a date, i.e. `2020-01-01T00:00:00Z` is interpreted as `2020-01-01`. Any asset that occurs on ar after this date will be returned. UTC is assumed if no timezone is provided
|
|
38
|
+
*/
|
|
24
39
|
from?: QFromParameter;
|
|
40
|
+
/**
|
|
41
|
+
* A date where assets prior to this will be returned. This can be a date-time string but it is interpreted as a date, i.e. `2020-01-01T00:00:00Z` is interpreted as `2020-01-01`. Any asset that occurs prior this date will be returned. UTC is assumed if no timezone is provided
|
|
42
|
+
*/
|
|
25
43
|
until?: QUntilParameter;
|
|
44
|
+
/**
|
|
45
|
+
* A charge Prior Billing Period, 0 implies "current" and -23 is for the period 23 months ago.
|
|
46
|
+
*/
|
|
26
47
|
pbp?: QPbpParameter;
|
|
27
48
|
};
|
|
28
49
|
|
|
29
50
|
export type GetProductChargesParams = {
|
|
51
|
+
/**
|
|
52
|
+
* A date from which to retrieve assets. This can be a date-time string but it is interpreted as a date, i.e. `2020-01-01T00:00:00Z` is interpreted as `2020-01-01`. Any asset that occurs on ar after this date will be returned. UTC is assumed if no timezone is provided
|
|
53
|
+
*/
|
|
30
54
|
from?: QFromParameter;
|
|
55
|
+
/**
|
|
56
|
+
* A date where assets prior to this will be returned. This can be a date-time string but it is interpreted as a date, i.e. `2020-01-01T00:00:00Z` is interpreted as `2020-01-01`. Any asset that occurs prior this date will be returned. UTC is assumed if no timezone is provided
|
|
57
|
+
*/
|
|
31
58
|
until?: QUntilParameter;
|
|
59
|
+
/**
|
|
60
|
+
* A charge Prior Billing Period, 0 implies "current" and -23 is for the period 23 months ago.
|
|
61
|
+
*/
|
|
32
62
|
pbp?: QPbpParameter;
|
|
33
63
|
};
|
|
34
64
|
|
|
35
65
|
export type GetChargesParams = {
|
|
66
|
+
/**
|
|
67
|
+
* A date from which to retrieve assets. This can be a date-time string but it is interpreted as a date, i.e. `2020-01-01T00:00:00Z` is interpreted as `2020-01-01`. Any asset that occurs on ar after this date will be returned. UTC is assumed if no timezone is provided
|
|
68
|
+
*/
|
|
36
69
|
from?: QFromParameter;
|
|
70
|
+
/**
|
|
71
|
+
* A date where assets prior to this will be returned. This can be a date-time string but it is interpreted as a date, i.e. `2020-01-01T00:00:00Z` is interpreted as `2020-01-01`. Any asset that occurs prior this date will be returned. UTC is assumed if no timezone is provided
|
|
72
|
+
*/
|
|
37
73
|
until?: QUntilParameter;
|
|
74
|
+
/**
|
|
75
|
+
* A charge Prior Billing Period, 0 implies "current" and -23 is for the period 23 months ago.
|
|
76
|
+
*/
|
|
38
77
|
pbp?: QPbpParameter;
|
|
39
78
|
};
|
|
40
79
|
|
|
@@ -54,9 +93,21 @@ export type QProductIdParameter = string;
|
|
|
54
93
|
export type QUnitIdParameter = string;
|
|
55
94
|
|
|
56
95
|
export type GetAssetParams = {
|
|
96
|
+
/**
|
|
97
|
+
* A User Identity
|
|
98
|
+
*/
|
|
57
99
|
user_id?: QUserIdParameter;
|
|
100
|
+
/**
|
|
101
|
+
* A Product Identity
|
|
102
|
+
*/
|
|
58
103
|
product_id?: QProductIdParameter;
|
|
104
|
+
/**
|
|
105
|
+
* A Unit Identity
|
|
106
|
+
*/
|
|
59
107
|
unit_id?: QUnitIdParameter;
|
|
108
|
+
/**
|
|
109
|
+
* An Organisation Identity
|
|
110
|
+
*/
|
|
60
111
|
org_id?: QOrgIdParameter;
|
|
61
112
|
};
|
|
62
113
|
|
|
@@ -65,8 +116,6 @@ export type GetAssetParams = {
|
|
|
65
116
|
*/
|
|
66
117
|
export type QMIdParameter = number;
|
|
67
118
|
|
|
68
|
-
export type DetachAssetParams = { m_id?: QMIdParameter };
|
|
69
|
-
|
|
70
119
|
/**
|
|
71
120
|
* An Organisation Identity
|
|
72
121
|
*/
|
|
@@ -77,9 +126,18 @@ export type QOrgIdParameter = string;
|
|
|
77
126
|
*/
|
|
78
127
|
export type QPbpParameter = number;
|
|
79
128
|
|
|
80
|
-
export type
|
|
129
|
+
export type GetUnitChargesParams = {
|
|
130
|
+
/**
|
|
131
|
+
* A date from which to retrieve assets. This can be a date-time string but it is interpreted as a date, i.e. `2020-01-01T00:00:00Z` is interpreted as `2020-01-01`. Any asset that occurs on ar after this date will be returned. UTC is assumed if no timezone is provided
|
|
132
|
+
*/
|
|
81
133
|
from?: QFromParameter;
|
|
134
|
+
/**
|
|
135
|
+
* A date where assets prior to this will be returned. This can be a date-time string but it is interpreted as a date, i.e. `2020-01-01T00:00:00Z` is interpreted as `2020-01-01`. Any asset that occurs prior this date will be returned. UTC is assumed if no timezone is provided
|
|
136
|
+
*/
|
|
82
137
|
until?: QUntilParameter;
|
|
138
|
+
/**
|
|
139
|
+
* A charge Prior Billing Period, 0 implies "current" and -23 is for the period 23 months ago.
|
|
140
|
+
*/
|
|
83
141
|
pbp?: QPbpParameter;
|
|
84
142
|
};
|
|
85
143
|
|
|
@@ -96,7 +154,7 @@ export type ProductPatchBodyBody = {
|
|
|
96
154
|
* The Flavour of the Product. Used only for Project Tier Products. Do not set this for Storage products
|
|
97
155
|
*/
|
|
98
156
|
export type UnitProductPostBodyBodyFlavour =
|
|
99
|
-
typeof UnitProductPostBodyBodyFlavour[keyof typeof UnitProductPostBodyBodyFlavour];
|
|
157
|
+
(typeof UnitProductPostBodyBodyFlavour)[keyof typeof UnitProductPostBodyBodyFlavour];
|
|
100
158
|
|
|
101
159
|
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
102
160
|
export const UnitProductPostBodyBodyFlavour = {
|
|
@@ -112,7 +170,7 @@ export const UnitProductPostBodyBodyFlavour = {
|
|
|
112
170
|
Project Tier subscriptions have built-in allowances and Limits so you must not provide values for these for these products
|
|
113
171
|
*/
|
|
114
172
|
export type UnitProductPostBodyBodyType =
|
|
115
|
-
typeof UnitProductPostBodyBodyType[keyof typeof UnitProductPostBodyBodyType];
|
|
173
|
+
(typeof UnitProductPostBodyBodyType)[keyof typeof UnitProductPostBodyBodyType];
|
|
116
174
|
|
|
117
175
|
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
118
176
|
export const UnitProductPostBodyBodyType = {
|
|
@@ -136,6 +194,16 @@ Project Tier subscriptions have built-in allowances and Limits so you must not p
|
|
|
136
194
|
limit?: number;
|
|
137
195
|
};
|
|
138
196
|
|
|
197
|
+
export type UnitPatchBodyBody = {
|
|
198
|
+
/** The new name for the Unit */
|
|
199
|
+
name?: string;
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
export type OrganisationPatchBodyBody = {
|
|
203
|
+
/** The new name for the Organisational */
|
|
204
|
+
name?: string;
|
|
205
|
+
};
|
|
206
|
+
|
|
139
207
|
export type OrganisationUnitPostBodyBody = {
|
|
140
208
|
/** The name of the unit */
|
|
141
209
|
name: string;
|
|
@@ -156,7 +224,7 @@ export type OrganisationPostBodyBody = {
|
|
|
156
224
|
};
|
|
157
225
|
|
|
158
226
|
export type AssetPostBodyBodyScope =
|
|
159
|
-
typeof AssetPostBodyBodyScope[keyof typeof AssetPostBodyBodyScope];
|
|
227
|
+
(typeof AssetPostBodyBodyScope)[keyof typeof AssetPostBodyBodyScope];
|
|
160
228
|
|
|
161
229
|
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
162
230
|
export const AssetPostBodyBodyScope = {
|
|
@@ -223,7 +291,7 @@ export interface UnitDetail {
|
|
|
223
291
|
* The kind of Service
|
|
224
292
|
*/
|
|
225
293
|
export type MerchantDetailKind =
|
|
226
|
-
typeof MerchantDetailKind[keyof typeof MerchantDetailKind];
|
|
294
|
+
(typeof MerchantDetailKind)[keyof typeof MerchantDetailKind];
|
|
227
295
|
|
|
228
296
|
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
229
297
|
export const MerchantDetailKind = {
|
|
@@ -268,7 +336,7 @@ export interface OrganisationDetail {
|
|
|
268
336
|
* The kind of service that can use the Product
|
|
269
337
|
*/
|
|
270
338
|
export type ProductTypeServiceKind =
|
|
271
|
-
typeof ProductTypeServiceKind[keyof typeof ProductTypeServiceKind];
|
|
339
|
+
(typeof ProductTypeServiceKind)[keyof typeof ProductTypeServiceKind];
|
|
272
340
|
|
|
273
341
|
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
274
342
|
export const ProductTypeServiceKind = {
|
|
@@ -299,7 +367,7 @@ export interface ProductInstanceDetail {
|
|
|
299
367
|
|
|
300
368
|
*/
|
|
301
369
|
export type ProductDetailFlavour =
|
|
302
|
-
typeof ProductDetailFlavour[keyof typeof ProductDetailFlavour];
|
|
370
|
+
(typeof ProductDetailFlavour)[keyof typeof ProductDetailFlavour];
|
|
303
371
|
|
|
304
372
|
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
305
373
|
export const ProductDetailFlavour = {
|
|
@@ -314,7 +382,7 @@ export const ProductDetailFlavour = {
|
|
|
314
382
|
|
|
315
383
|
*/
|
|
316
384
|
export type ProductDetailType =
|
|
317
|
-
typeof ProductDetailType[keyof typeof ProductDetailType];
|
|
385
|
+
(typeof ProductDetailType)[keyof typeof ProductDetailType];
|
|
318
386
|
|
|
319
387
|
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
320
388
|
export const ProductDetailType = {
|
|
@@ -451,7 +519,7 @@ export interface ProcessingChargeItem {
|
|
|
451
519
|
}
|
|
452
520
|
|
|
453
521
|
export type ProcessingChargesMerchantKind =
|
|
454
|
-
typeof ProcessingChargesMerchantKind[keyof typeof ProcessingChargesMerchantKind];
|
|
522
|
+
(typeof ProcessingChargesMerchantKind)[keyof typeof ProcessingChargesMerchantKind];
|
|
455
523
|
|
|
456
524
|
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
457
525
|
export const ProcessingChargesMerchantKind = {
|
|
@@ -472,7 +540,7 @@ export interface ProcessingCharges {
|
|
|
472
540
|
}
|
|
473
541
|
|
|
474
542
|
export type AssetDetailScope =
|
|
475
|
-
typeof AssetDetailScope[keyof typeof AssetDetailScope];
|
|
543
|
+
(typeof AssetDetailScope)[keyof typeof AssetDetailScope];
|
|
476
544
|
|
|
477
545
|
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
478
546
|
export const AssetDetailScope = {
|
|
@@ -517,7 +585,7 @@ export interface UnitProductPostResponse {
|
|
|
517
585
|
* The type of charge
|
|
518
586
|
*/
|
|
519
587
|
export type ChargeSummaryType =
|
|
520
|
-
typeof ChargeSummaryType[keyof typeof ChargeSummaryType];
|
|
588
|
+
(typeof ChargeSummaryType)[keyof typeof ChargeSummaryType];
|
|
521
589
|
|
|
522
590
|
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
523
591
|
export const ChargeSummaryType = {
|
|
@@ -599,7 +667,7 @@ export interface ProductsGetResponse {
|
|
|
599
667
|
}
|
|
600
668
|
|
|
601
669
|
export type ProductChargesGetResponseProductType =
|
|
602
|
-
typeof ProductChargesGetResponseProductType[keyof typeof ProductChargesGetResponseProductType];
|
|
670
|
+
(typeof ProductChargesGetResponseProductType)[keyof typeof ProductChargesGetResponseProductType];
|
|
603
671
|
|
|
604
672
|
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
605
673
|
export const ProductChargesGetResponseProductType = {
|
package/src/admin/admin.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Generated by orval v6.
|
|
2
|
+
* Generated by orval v6.12.1 🍺
|
|
3
3
|
* Do not edit manually.
|
|
4
4
|
* Account Server API
|
|
5
5
|
* The Informatics Matters Account Server API.
|
|
@@ -22,6 +22,7 @@ import type {
|
|
|
22
22
|
} from "../account-server-api.schemas";
|
|
23
23
|
import { customInstance } from ".././custom-instance";
|
|
24
24
|
import type { ErrorType } from ".././custom-instance";
|
|
25
|
+
import { queryMutator } from ".././queryMutator";
|
|
25
26
|
|
|
26
27
|
// eslint-disable-next-line
|
|
27
28
|
type SecondParameter<T extends (...args: any) => any> = T extends (
|
|
@@ -81,13 +82,13 @@ export const useGetCharges = <
|
|
|
81
82
|
signal,
|
|
82
83
|
}) => getCharges(params, requestOptions, signal);
|
|
83
84
|
|
|
85
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
86
|
+
|
|
84
87
|
const query = useQuery<Awaited<ReturnType<typeof getCharges>>, TError, TData>(
|
|
85
|
-
|
|
86
|
-
queryFn,
|
|
87
|
-
queryOptions
|
|
88
|
+
customOptions
|
|
88
89
|
) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
89
90
|
|
|
90
|
-
query.queryKey = queryKey;
|
|
91
|
+
query.queryKey = customOptions.queryKey;
|
|
91
92
|
|
|
92
93
|
return query;
|
|
93
94
|
};
|