@squonk/account-server-client 2.0.4-rc.1 → 2.0.4-rc.3
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 +10 -14
- package/admin/admin.cjs.map +1 -1
- package/admin/admin.d.ts +9 -3
- package/admin/admin.js +9 -13
- package/admin/admin.js.map +1 -1
- package/asset/asset.cjs +59 -28
- package/asset/asset.cjs.map +1 -1
- package/asset/asset.d.ts +71 -3
- package/asset/asset.js +58 -27
- package/asset/asset.js.map +1 -1
- package/{custom-instance-85497958.d.ts → custom-instance-8a11f2d1.d.ts} +1 -1
- package/index.cjs.map +1 -1
- package/index.d.ts +1 -1
- package/index.js.map +1 -1
- package/merchant/merchant.cjs +19 -16
- package/merchant/merchant.cjs.map +1 -1
- package/merchant/merchant.d.ts +16 -4
- package/merchant/merchant.js +18 -15
- package/merchant/merchant.js.map +1 -1
- package/organisation/organisation.cjs +64 -40
- package/organisation/organisation.cjs.map +1 -1
- package/organisation/organisation.d.ts +56 -6
- package/organisation/organisation.js +63 -39
- package/organisation/organisation.js.map +1 -1
- package/package.json +10 -9
- package/product/product.cjs +92 -55
- package/product/product.cjs.map +1 -1
- package/product/product.d.ts +79 -9
- package/product/product.js +91 -54
- package/product/product.js.map +1 -1
- package/src/account-server-api.schemas.ts +1 -1
- package/src/admin/admin.ts +34 -18
- package/src/asset/asset.ts +223 -88
- package/src/merchant/merchant.ts +60 -27
- package/src/organisation/organisation.ts +215 -97
- package/src/product/product.ts +310 -134
- package/src/state/state.ts +30 -15
- package/src/unit/unit.ts +263 -117
- package/src/user/user.ts +207 -88
- package/state/state.cjs +10 -11
- package/state/state.cjs.map +1 -1
- package/state/state.d.ts +9 -3
- package/state/state.js +9 -10
- package/state/state.js.map +1 -1
- package/unit/unit.cjs +74 -46
- package/unit/unit.cjs.map +1 -1
- package/unit/unit.d.ts +70 -6
- package/unit/unit.js +73 -45
- package/unit/unit.js.map +1 -1
- package/user/user.cjs +56 -31
- package/user/user.cjs.map +1 -1
- package/user/user.d.ts +63 -5
- package/user/user.js +55 -30
- package/user/user.js.map +1 -1
- package/chunk-7XN3IQYV.cjs +0 -13
- package/chunk-7XN3IQYV.cjs.map +0 -1
- package/chunk-YEX2SGER.js +0 -13
- package/chunk-YEX2SGER.js.map +0 -1
- package/src/queryMutator.ts +0 -12
package/product/product.cjs
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
|
-
var _chunk7XN3IQYVcjs = require('../chunk-7XN3IQYV.cjs');
|
|
4
|
-
|
|
5
|
-
|
|
6
3
|
var _chunkUZTHSGDTcjs = require('../chunk-UZTHSGDT.cjs');
|
|
7
4
|
|
|
8
5
|
// src/product/product.ts
|
|
@@ -13,16 +10,19 @@ var getProductTypes = (options, signal) => {
|
|
|
13
10
|
options
|
|
14
11
|
);
|
|
15
12
|
};
|
|
16
|
-
var getGetProductTypesQueryKey = () => [`/product-type`];
|
|
17
|
-
var
|
|
13
|
+
var getGetProductTypesQueryKey = () => ["account-server-api", `/product-type`];
|
|
14
|
+
var getGetProductTypesQueryOptions = (options) => {
|
|
18
15
|
const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
|
|
19
16
|
const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetProductTypesQueryKey()));
|
|
20
17
|
const queryFn = ({
|
|
21
18
|
signal
|
|
22
19
|
}) => getProductTypes(requestOptions, signal);
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
return { queryKey, queryFn, ...queryOptions };
|
|
21
|
+
};
|
|
22
|
+
var useGetProductTypes = (options) => {
|
|
23
|
+
const queryOptions = getGetProductTypesQueryOptions(options);
|
|
24
|
+
const query = _reactquery.useQuery.call(void 0, queryOptions);
|
|
25
|
+
query.queryKey = queryOptions.queryKey;
|
|
26
26
|
return query;
|
|
27
27
|
};
|
|
28
28
|
var getProductDefaultStorageCost = (options, signal) => {
|
|
@@ -31,16 +31,17 @@ var getProductDefaultStorageCost = (options, signal) => {
|
|
|
31
31
|
options
|
|
32
32
|
);
|
|
33
33
|
};
|
|
34
|
-
var getGetProductDefaultStorageCostQueryKey = () => [
|
|
35
|
-
|
|
36
|
-
];
|
|
37
|
-
var useGetProductDefaultStorageCost = (options) => {
|
|
34
|
+
var getGetProductDefaultStorageCostQueryKey = () => ["account-server-api", `/product-default-storage-cost`];
|
|
35
|
+
var getGetProductDefaultStorageCostQueryOptions = (options) => {
|
|
38
36
|
const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
|
|
39
37
|
const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetProductDefaultStorageCostQueryKey()));
|
|
40
38
|
const queryFn = ({ signal }) => getProductDefaultStorageCost(requestOptions, signal);
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
return { queryKey, queryFn, ...queryOptions };
|
|
40
|
+
};
|
|
41
|
+
var useGetProductDefaultStorageCost = (options) => {
|
|
42
|
+
const queryOptions = getGetProductDefaultStorageCostQueryOptions(options);
|
|
43
|
+
const query = _reactquery.useQuery.call(void 0, queryOptions);
|
|
44
|
+
query.queryKey = queryOptions.queryKey;
|
|
44
45
|
return query;
|
|
45
46
|
};
|
|
46
47
|
var getProducts = (options, signal) => {
|
|
@@ -49,16 +50,19 @@ var getProducts = (options, signal) => {
|
|
|
49
50
|
options
|
|
50
51
|
);
|
|
51
52
|
};
|
|
52
|
-
var getGetProductsQueryKey = () => [`/product`];
|
|
53
|
-
var
|
|
53
|
+
var getGetProductsQueryKey = () => ["account-server-api", `/product`];
|
|
54
|
+
var getGetProductsQueryOptions = (options) => {
|
|
54
55
|
const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
|
|
55
56
|
const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetProductsQueryKey()));
|
|
56
57
|
const queryFn = ({
|
|
57
58
|
signal
|
|
58
59
|
}) => getProducts(requestOptions, signal);
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
return { queryKey, queryFn, ...queryOptions };
|
|
61
|
+
};
|
|
62
|
+
var useGetProducts = (options) => {
|
|
63
|
+
const queryOptions = getGetProductsQueryOptions(options);
|
|
64
|
+
const query = _reactquery.useQuery.call(void 0, queryOptions);
|
|
65
|
+
query.queryKey = queryOptions.queryKey;
|
|
62
66
|
return query;
|
|
63
67
|
};
|
|
64
68
|
var getProductsForOrganisation = (orgId, options, signal) => {
|
|
@@ -67,16 +71,20 @@ var getProductsForOrganisation = (orgId, options, signal) => {
|
|
|
67
71
|
options
|
|
68
72
|
);
|
|
69
73
|
};
|
|
70
|
-
var getGetProductsForOrganisationQueryKey = (orgId) => [
|
|
71
|
-
|
|
72
|
-
];
|
|
73
|
-
var useGetProductsForOrganisation = (orgId, options) => {
|
|
74
|
+
var getGetProductsForOrganisationQueryKey = (orgId) => ["account-server-api", `/product/organisation/${orgId}`];
|
|
75
|
+
var getGetProductsForOrganisationQueryOptions = (orgId, options) => {
|
|
74
76
|
const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
|
|
75
77
|
const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetProductsForOrganisationQueryKey(orgId)));
|
|
76
78
|
const queryFn = ({ signal }) => getProductsForOrganisation(orgId, requestOptions, signal);
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
79
|
+
return { queryKey, queryFn, enabled: !!orgId, ...queryOptions };
|
|
80
|
+
};
|
|
81
|
+
var useGetProductsForOrganisation = (orgId, options) => {
|
|
82
|
+
const queryOptions = getGetProductsForOrganisationQueryOptions(
|
|
83
|
+
orgId,
|
|
84
|
+
options
|
|
85
|
+
);
|
|
86
|
+
const query = _reactquery.useQuery.call(void 0, queryOptions);
|
|
87
|
+
query.queryKey = queryOptions.queryKey;
|
|
80
88
|
return query;
|
|
81
89
|
};
|
|
82
90
|
var createUnitProduct = (unitId, unitProductPostBodyBody, options) => {
|
|
@@ -90,13 +98,17 @@ var createUnitProduct = (unitId, unitProductPostBodyBody, options) => {
|
|
|
90
98
|
options
|
|
91
99
|
);
|
|
92
100
|
};
|
|
93
|
-
var
|
|
101
|
+
var getCreateUnitProductMutationOptions = (options) => {
|
|
94
102
|
const { mutation: mutationOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
|
|
95
103
|
const mutationFn = (props) => {
|
|
96
104
|
const { unitId, data } = _nullishCoalesce(props, () => ( {}));
|
|
97
105
|
return createUnitProduct(unitId, data, requestOptions);
|
|
98
106
|
};
|
|
99
|
-
return
|
|
107
|
+
return { mutationFn, ...mutationOptions };
|
|
108
|
+
};
|
|
109
|
+
var useCreateUnitProduct = (options) => {
|
|
110
|
+
const mutationOptions = getCreateUnitProductMutationOptions(options);
|
|
111
|
+
return _reactquery.useMutation.call(void 0, mutationOptions);
|
|
100
112
|
};
|
|
101
113
|
var getProductsForUnit = (unitId, options, signal) => {
|
|
102
114
|
return _chunkUZTHSGDTcjs.customInstance.call(void 0,
|
|
@@ -104,16 +116,17 @@ var getProductsForUnit = (unitId, options, signal) => {
|
|
|
104
116
|
options
|
|
105
117
|
);
|
|
106
118
|
};
|
|
107
|
-
var getGetProductsForUnitQueryKey = (unitId) => [
|
|
108
|
-
|
|
109
|
-
];
|
|
110
|
-
var useGetProductsForUnit = (unitId, options) => {
|
|
119
|
+
var getGetProductsForUnitQueryKey = (unitId) => ["account-server-api", `/product/unit/${unitId}`];
|
|
120
|
+
var getGetProductsForUnitQueryOptions = (unitId, options) => {
|
|
111
121
|
const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
|
|
112
122
|
const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetProductsForUnitQueryKey(unitId)));
|
|
113
123
|
const queryFn = ({ signal }) => getProductsForUnit(unitId, requestOptions, signal);
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
124
|
+
return { queryKey, queryFn, enabled: !!unitId, ...queryOptions };
|
|
125
|
+
};
|
|
126
|
+
var useGetProductsForUnit = (unitId, options) => {
|
|
127
|
+
const queryOptions = getGetProductsForUnitQueryOptions(unitId, options);
|
|
128
|
+
const query = _reactquery.useQuery.call(void 0, queryOptions);
|
|
129
|
+
query.queryKey = queryOptions.queryKey;
|
|
117
130
|
return query;
|
|
118
131
|
};
|
|
119
132
|
var getProduct = (productId, options, signal) => {
|
|
@@ -122,20 +135,19 @@ var getProduct = (productId, options, signal) => {
|
|
|
122
135
|
options
|
|
123
136
|
);
|
|
124
137
|
};
|
|
125
|
-
var getGetProductQueryKey = (productId) => [
|
|
126
|
-
|
|
127
|
-
];
|
|
128
|
-
var useGetProduct = (productId, options) => {
|
|
138
|
+
var getGetProductQueryKey = (productId) => ["account-server-api", `/product/${productId}`];
|
|
139
|
+
var getGetProductQueryOptions = (productId, options) => {
|
|
129
140
|
const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
|
|
130
141
|
const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetProductQueryKey(productId)));
|
|
131
142
|
const queryFn = ({
|
|
132
143
|
signal
|
|
133
144
|
}) => getProduct(productId, requestOptions, signal);
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
);
|
|
138
|
-
query
|
|
145
|
+
return { queryKey, queryFn, enabled: !!productId, ...queryOptions };
|
|
146
|
+
};
|
|
147
|
+
var useGetProduct = (productId, options) => {
|
|
148
|
+
const queryOptions = getGetProductQueryOptions(productId, options);
|
|
149
|
+
const query = _reactquery.useQuery.call(void 0, queryOptions);
|
|
150
|
+
query.queryKey = queryOptions.queryKey;
|
|
139
151
|
return query;
|
|
140
152
|
};
|
|
141
153
|
var deleteProduct = (productId, options) => {
|
|
@@ -144,13 +156,17 @@ var deleteProduct = (productId, options) => {
|
|
|
144
156
|
options
|
|
145
157
|
);
|
|
146
158
|
};
|
|
147
|
-
var
|
|
159
|
+
var getDeleteProductMutationOptions = (options) => {
|
|
148
160
|
const { mutation: mutationOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
|
|
149
161
|
const mutationFn = (props) => {
|
|
150
162
|
const { productId } = _nullishCoalesce(props, () => ( {}));
|
|
151
163
|
return deleteProduct(productId, requestOptions);
|
|
152
164
|
};
|
|
153
|
-
return
|
|
165
|
+
return { mutationFn, ...mutationOptions };
|
|
166
|
+
};
|
|
167
|
+
var useDeleteProduct = (options) => {
|
|
168
|
+
const mutationOptions = getDeleteProductMutationOptions(options);
|
|
169
|
+
return _reactquery.useMutation.call(void 0, mutationOptions);
|
|
154
170
|
};
|
|
155
171
|
var patchProduct = (productId, productPatchBodyBody, options) => {
|
|
156
172
|
return _chunkUZTHSGDTcjs.customInstance.call(void 0,
|
|
@@ -163,13 +179,17 @@ var patchProduct = (productId, productPatchBodyBody, options) => {
|
|
|
163
179
|
options
|
|
164
180
|
);
|
|
165
181
|
};
|
|
166
|
-
var
|
|
182
|
+
var getPatchProductMutationOptions = (options) => {
|
|
167
183
|
const { mutation: mutationOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
|
|
168
184
|
const mutationFn = (props) => {
|
|
169
185
|
const { productId, data } = _nullishCoalesce(props, () => ( {}));
|
|
170
186
|
return patchProduct(productId, data, requestOptions);
|
|
171
187
|
};
|
|
172
|
-
return
|
|
188
|
+
return { mutationFn, ...mutationOptions };
|
|
189
|
+
};
|
|
190
|
+
var usePatchProduct = (options) => {
|
|
191
|
+
const mutationOptions = getPatchProductMutationOptions(options);
|
|
192
|
+
return _reactquery.useMutation.call(void 0, mutationOptions);
|
|
173
193
|
};
|
|
174
194
|
var getProductCharges = (productId, params, options, signal) => {
|
|
175
195
|
return _chunkUZTHSGDTcjs.customInstance.call(void 0,
|
|
@@ -177,14 +197,21 @@ var getProductCharges = (productId, params, options, signal) => {
|
|
|
177
197
|
options
|
|
178
198
|
);
|
|
179
199
|
};
|
|
180
|
-
var getGetProductChargesQueryKey = (productId, params) => [`/product/${productId}/charges`, ...params ? [params] : []];
|
|
181
|
-
var
|
|
200
|
+
var getGetProductChargesQueryKey = (productId, params) => ["account-server-api", `/product/${productId}/charges`, ...params ? [params] : []];
|
|
201
|
+
var getGetProductChargesQueryOptions = (productId, params, options) => {
|
|
182
202
|
const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
|
|
183
203
|
const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetProductChargesQueryKey(productId, params)));
|
|
184
204
|
const queryFn = ({ signal }) => getProductCharges(productId, params, requestOptions, signal);
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
205
|
+
return { queryKey, queryFn, enabled: !!productId, ...queryOptions };
|
|
206
|
+
};
|
|
207
|
+
var useGetProductCharges = (productId, params, options) => {
|
|
208
|
+
const queryOptions = getGetProductChargesQueryOptions(
|
|
209
|
+
productId,
|
|
210
|
+
params,
|
|
211
|
+
options
|
|
212
|
+
);
|
|
213
|
+
const query = _reactquery.useQuery.call(void 0, queryOptions);
|
|
214
|
+
query.queryKey = queryOptions.queryKey;
|
|
188
215
|
return query;
|
|
189
216
|
};
|
|
190
217
|
|
|
@@ -215,5 +242,15 @@ var useGetProductCharges = (productId, params, options) => {
|
|
|
215
242
|
|
|
216
243
|
|
|
217
244
|
|
|
218
|
-
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
exports.createUnitProduct = createUnitProduct; exports.deleteProduct = deleteProduct; exports.getCreateUnitProductMutationOptions = getCreateUnitProductMutationOptions; exports.getDeleteProductMutationOptions = getDeleteProductMutationOptions; exports.getGetProductChargesQueryKey = getGetProductChargesQueryKey; exports.getGetProductChargesQueryOptions = getGetProductChargesQueryOptions; exports.getGetProductDefaultStorageCostQueryKey = getGetProductDefaultStorageCostQueryKey; exports.getGetProductDefaultStorageCostQueryOptions = getGetProductDefaultStorageCostQueryOptions; exports.getGetProductQueryKey = getGetProductQueryKey; exports.getGetProductQueryOptions = getGetProductQueryOptions; exports.getGetProductTypesQueryKey = getGetProductTypesQueryKey; exports.getGetProductTypesQueryOptions = getGetProductTypesQueryOptions; exports.getGetProductsForOrganisationQueryKey = getGetProductsForOrganisationQueryKey; exports.getGetProductsForOrganisationQueryOptions = getGetProductsForOrganisationQueryOptions; exports.getGetProductsForUnitQueryKey = getGetProductsForUnitQueryKey; exports.getGetProductsForUnitQueryOptions = getGetProductsForUnitQueryOptions; exports.getGetProductsQueryKey = getGetProductsQueryKey; exports.getGetProductsQueryOptions = getGetProductsQueryOptions; exports.getPatchProductMutationOptions = getPatchProductMutationOptions; exports.getProduct = getProduct; exports.getProductCharges = getProductCharges; exports.getProductDefaultStorageCost = getProductDefaultStorageCost; exports.getProductTypes = getProductTypes; exports.getProducts = getProducts; exports.getProductsForOrganisation = getProductsForOrganisation; exports.getProductsForUnit = getProductsForUnit; exports.patchProduct = patchProduct; exports.useCreateUnitProduct = useCreateUnitProduct; exports.useDeleteProduct = useDeleteProduct; exports.useGetProduct = useGetProduct; exports.useGetProductCharges = useGetProductCharges; exports.useGetProductDefaultStorageCost = useGetProductDefaultStorageCost; exports.useGetProductTypes = useGetProductTypes; exports.useGetProducts = useGetProducts; exports.useGetProductsForOrganisation = useGetProductsForOrganisation; exports.useGetProductsForUnit = useGetProductsForUnit; exports.usePatchProduct = usePatchProduct;
|
|
219
256
|
//# sourceMappingURL=product.cjs.map
|
package/product/product.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/product/product.ts"],"names":[],"mappings":";;;;;;;;AAUA,SAAS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ACJ,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","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"]}
|
|
1
|
+
{"version":3,"sources":["../../src/product/product.ts"],"names":[],"mappings":";;;;;AAUA,SAAS,UAAU,mBAAmB;AAqC/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,sBAAsB,eAAe;AAE/E,IAAM,iCAAiC,CAG5C,YAW4B;AAC5B,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,SAAO,EAAE,UAAU,SAAS,GAAG,aAAa;AAC9C;AAOO,IAAM,qBAAqB,CAGhC,YAO4D;AAC5D,QAAM,eAAe,+BAA+B,OAAO;AAE3D,QAAM,QAAQ,SAAS,YAAY;AAInC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;AAKO,IAAM,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SAAS,CAAC,MAAM,IAAI,CAAC,CAAE;AAEjF,IAAM,mCAAmC,CAI9C,WACA,QACA,YAY4B;AAC5B,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,SAAO,EAAE,UAAU,SAAS,SAAS,CAAC,CAAC,WAAW,GAAG,aAAa;AACpE;AAOO,IAAM,uBAAuB,CAIlC,WACA,QACA,YAQ2D;AAC3D,QAAM,eAAe;AAAA,IACnB;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,QAAM,QAAQ,SAAS,YAAY;AAInC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT","sourcesContent":["/**\n * Generated by orval v6.15.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 = () => [\"account-server-api\", `/product-type`] as const;\n\nexport const getGetProductTypesQueryOptions = <\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}): UseQueryOptions<\n Awaited<ReturnType<typeof getProductTypes>>,\n TError,\n TData\n> & { 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 return { queryKey, queryFn, ...queryOptions };\n};\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 queryOptions = getGetProductTypesQueryOptions(options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.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 [\"account-server-api\", `/product-default-storage-cost`] as const;\n\nexport const getGetProductDefaultStorageCostQueryOptions = <\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}): UseQueryOptions<\n Awaited<ReturnType<typeof getProductDefaultStorageCost>>,\n TError,\n TData\n> & { 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 return { queryKey, queryFn, ...queryOptions };\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 queryOptions = getGetProductDefaultStorageCostQueryOptions(options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.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 = () => [\"account-server-api\", `/product`] as const;\n\nexport const getGetProductsQueryOptions = <\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}): UseQueryOptions<Awaited<ReturnType<typeof getProducts>>, TError, TData> & {\n queryKey: QueryKey;\n} => {\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 return { queryKey, queryFn, ...queryOptions };\n};\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 queryOptions = getGetProductsQueryOptions(options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.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 [\"account-server-api\", `/product/organisation/${orgId}`] as const;\n\nexport const getGetProductsForOrganisationQueryOptions = <\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): UseQueryOptions<\n Awaited<ReturnType<typeof getProductsForOrganisation>>,\n TError,\n TData\n> & { 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 return { queryKey, queryFn, enabled: !!orgId, ...queryOptions };\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 queryOptions = getGetProductsForOrganisationQueryOptions(\n orgId,\n options\n );\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.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 const getCreateUnitProductMutationOptions = <\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}): UseMutationOptions<\n Awaited<ReturnType<typeof createUnitProduct>>,\n TError,\n { unitId: string; data: UnitProductPostBodyBody },\n TContext\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 { mutationFn, ...mutationOptions };\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 mutationOptions = getCreateUnitProductMutationOptions(options);\n\n return useMutation(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 [\"account-server-api\", `/product/unit/${unitId}`] as const;\n\nexport const getGetProductsForUnitQueryOptions = <\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): UseQueryOptions<\n Awaited<ReturnType<typeof getProductsForUnit>>,\n TError,\n TData\n> & { 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 return { queryKey, queryFn, enabled: !!unitId, ...queryOptions };\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 queryOptions = getGetProductsForUnitQueryOptions(unitId, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.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 [\"account-server-api\", `/product/${productId}`] as const;\n\nexport const getGetProductQueryOptions = <\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): UseQueryOptions<Awaited<ReturnType<typeof getProduct>>, TError, TData> & {\n queryKey: QueryKey;\n} => {\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 return { queryKey, queryFn, enabled: !!productId, ...queryOptions };\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 queryOptions = getGetProductQueryOptions(productId, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.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 const getDeleteProductMutationOptions = <\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}): UseMutationOptions<\n Awaited<ReturnType<typeof deleteProduct>>,\n TError,\n { productId: string },\n TContext\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 { mutationFn, ...mutationOptions };\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 mutationOptions = getDeleteProductMutationOptions(options);\n\n return useMutation(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 const getPatchProductMutationOptions = <\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}): UseMutationOptions<\n Awaited<ReturnType<typeof patchProduct>>,\n TError,\n { productId: string; data: ProductPatchBodyBody },\n TContext\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 { mutationFn, ...mutationOptions };\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 mutationOptions = getPatchProductMutationOptions(options);\n\n return useMutation(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) => [\"account-server-api\", `/product/${productId}/charges`, ...(params ? [params] : [])] as const;\n\nexport const getGetProductChargesQueryOptions = <\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): UseQueryOptions<\n Awaited<ReturnType<typeof getProductCharges>>,\n TError,\n TData\n> & { 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 return { queryKey, queryFn, enabled: !!productId, ...queryOptions };\n};\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 queryOptions = getGetProductChargesQueryOptions(\n productId,\n params,\n options\n );\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n"]}
|
package/product/product.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
2
2
|
import { UseQueryOptions, QueryKey, UseQueryResult, UseMutationOptions } from '@tanstack/react-query';
|
|
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-
|
|
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-8a11f2d1.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;
|
|
@@ -10,7 +10,13 @@ type SecondParameter<T extends (...args: any) => any> = T extends (config: any,
|
|
|
10
10
|
* @summary Gets all Product Types
|
|
11
11
|
*/
|
|
12
12
|
declare const getProductTypes: (options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<ProductsGetTypesResponse>;
|
|
13
|
-
declare const getGetProductTypesQueryKey: () =>
|
|
13
|
+
declare const getGetProductTypesQueryKey: () => readonly ["account-server-api", "/product-type"];
|
|
14
|
+
declare const getGetProductTypesQueryOptions: <TData = ProductsGetTypesResponse, TError = ErrorType<void | AsError>>(options?: {
|
|
15
|
+
query?: UseQueryOptions<ProductsGetTypesResponse, TError, TData, QueryKey> | undefined;
|
|
16
|
+
request?: SecondParameter<typeof customInstance>;
|
|
17
|
+
} | undefined) => UseQueryOptions<ProductsGetTypesResponse, TError, TData, QueryKey> & {
|
|
18
|
+
queryKey: QueryKey;
|
|
19
|
+
};
|
|
14
20
|
type GetProductTypesQueryResult = NonNullable<Awaited<ReturnType<typeof getProductTypes>>>;
|
|
15
21
|
type GetProductTypesQueryError = ErrorType<AsError | void>;
|
|
16
22
|
declare const useGetProductTypes: <TData = ProductsGetTypesResponse, TError = ErrorType<void | AsError>>(options?: {
|
|
@@ -23,7 +29,13 @@ declare const useGetProductTypes: <TData = ProductsGetTypesResponse, TError = Er
|
|
|
23
29
|
* @summary Gets the default cross-product storage cost
|
|
24
30
|
*/
|
|
25
31
|
declare const getProductDefaultStorageCost: (options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<ProductsGetDefaultStorageCost>;
|
|
26
|
-
declare const getGetProductDefaultStorageCostQueryKey: () =>
|
|
32
|
+
declare const getGetProductDefaultStorageCostQueryKey: () => readonly ["account-server-api", "/product-default-storage-cost"];
|
|
33
|
+
declare const getGetProductDefaultStorageCostQueryOptions: <TData = ProductsGetDefaultStorageCost, TError = ErrorType<void | AsError>>(options?: {
|
|
34
|
+
query?: UseQueryOptions<ProductsGetDefaultStorageCost, TError, TData, QueryKey> | undefined;
|
|
35
|
+
request?: SecondParameter<typeof customInstance>;
|
|
36
|
+
} | undefined) => UseQueryOptions<ProductsGetDefaultStorageCost, TError, TData, QueryKey> & {
|
|
37
|
+
queryKey: QueryKey;
|
|
38
|
+
};
|
|
27
39
|
type GetProductDefaultStorageCostQueryResult = NonNullable<Awaited<ReturnType<typeof getProductDefaultStorageCost>>>;
|
|
28
40
|
type GetProductDefaultStorageCostQueryError = ErrorType<AsError | void>;
|
|
29
41
|
declare const useGetProductDefaultStorageCost: <TData = ProductsGetDefaultStorageCost, TError = ErrorType<void | AsError>>(options?: {
|
|
@@ -38,7 +50,13 @@ declare const useGetProductDefaultStorageCost: <TData = ProductsGetDefaultStorag
|
|
|
38
50
|
* @summary Gets all Products
|
|
39
51
|
*/
|
|
40
52
|
declare const getProducts: (options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<ProductsGetResponse>;
|
|
41
|
-
declare const getGetProductsQueryKey: () =>
|
|
53
|
+
declare const getGetProductsQueryKey: () => readonly ["account-server-api", "/product"];
|
|
54
|
+
declare const getGetProductsQueryOptions: <TData = ProductsGetResponse, TError = ErrorType<void | AsError>>(options?: {
|
|
55
|
+
query?: UseQueryOptions<ProductsGetResponse, TError, TData, QueryKey> | undefined;
|
|
56
|
+
request?: SecondParameter<typeof customInstance>;
|
|
57
|
+
} | undefined) => UseQueryOptions<ProductsGetResponse, TError, TData, QueryKey> & {
|
|
58
|
+
queryKey: QueryKey;
|
|
59
|
+
};
|
|
42
60
|
type GetProductsQueryResult = NonNullable<Awaited<ReturnType<typeof getProducts>>>;
|
|
43
61
|
type GetProductsQueryError = ErrorType<AsError | void>;
|
|
44
62
|
declare const useGetProducts: <TData = ProductsGetResponse, TError = ErrorType<void | AsError>>(options?: {
|
|
@@ -53,7 +71,13 @@ declare const useGetProducts: <TData = ProductsGetResponse, TError = ErrorType<v
|
|
|
53
71
|
* @summary Gets Products for an Organisation
|
|
54
72
|
*/
|
|
55
73
|
declare const getProductsForOrganisation: (orgId: string, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<ProductsGetResponse>;
|
|
56
|
-
declare const getGetProductsForOrganisationQueryKey: (orgId: string) => string
|
|
74
|
+
declare const getGetProductsForOrganisationQueryKey: (orgId: string) => readonly ["account-server-api", `/product/organisation/${string}`];
|
|
75
|
+
declare const getGetProductsForOrganisationQueryOptions: <TData = ProductsGetResponse, TError = ErrorType<void | AsError>>(orgId: string, options?: {
|
|
76
|
+
query?: UseQueryOptions<ProductsGetResponse, TError, TData, QueryKey> | undefined;
|
|
77
|
+
request?: SecondParameter<typeof customInstance>;
|
|
78
|
+
} | undefined) => UseQueryOptions<ProductsGetResponse, TError, TData, QueryKey> & {
|
|
79
|
+
queryKey: QueryKey;
|
|
80
|
+
};
|
|
57
81
|
type GetProductsForOrganisationQueryResult = NonNullable<Awaited<ReturnType<typeof getProductsForOrganisation>>>;
|
|
58
82
|
type GetProductsForOrganisationQueryError = ErrorType<void | AsError>;
|
|
59
83
|
declare const useGetProductsForOrganisation: <TData = ProductsGetResponse, TError = ErrorType<void | AsError>>(orgId: string, options?: {
|
|
@@ -72,6 +96,16 @@ Some subscriptions, like the `DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION` are availa
|
|
|
72
96
|
* @summary Creates a Product for an Organisational Unit
|
|
73
97
|
*/
|
|
74
98
|
declare const createUnitProduct: (unitId: string, unitProductPostBodyBody: UnitProductPostBodyBody, options?: SecondParameter<typeof customInstance>) => Promise<UnitProductPostResponse>;
|
|
99
|
+
declare const getCreateUnitProductMutationOptions: <TError = ErrorType<void | AsError>, TContext = unknown>(options?: {
|
|
100
|
+
mutation?: UseMutationOptions<UnitProductPostResponse, TError, {
|
|
101
|
+
unitId: string;
|
|
102
|
+
data: UnitProductPostBodyBody;
|
|
103
|
+
}, TContext> | undefined;
|
|
104
|
+
request?: SecondParameter<typeof customInstance>;
|
|
105
|
+
} | undefined) => UseMutationOptions<UnitProductPostResponse, TError, {
|
|
106
|
+
unitId: string;
|
|
107
|
+
data: UnitProductPostBodyBody;
|
|
108
|
+
}, TContext>;
|
|
75
109
|
type CreateUnitProductMutationResult = NonNullable<Awaited<ReturnType<typeof createUnitProduct>>>;
|
|
76
110
|
type CreateUnitProductMutationBody = UnitProductPostBodyBody;
|
|
77
111
|
type CreateUnitProductMutationError = ErrorType<AsError | void>;
|
|
@@ -91,7 +125,13 @@ declare const useCreateUnitProduct: <TError = ErrorType<void | AsError>, TContex
|
|
|
91
125
|
* @summary Gets Products for an Organisational Unit
|
|
92
126
|
*/
|
|
93
127
|
declare const getProductsForUnit: (unitId: string, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<ProductsGetResponse>;
|
|
94
|
-
declare const getGetProductsForUnitQueryKey: (unitId: string) => string
|
|
128
|
+
declare const getGetProductsForUnitQueryKey: (unitId: string) => readonly ["account-server-api", `/product/unit/${string}`];
|
|
129
|
+
declare const getGetProductsForUnitQueryOptions: <TData = ProductsGetResponse, TError = ErrorType<void | AsError>>(unitId: string, options?: {
|
|
130
|
+
query?: UseQueryOptions<ProductsGetResponse, TError, TData, QueryKey> | undefined;
|
|
131
|
+
request?: SecondParameter<typeof customInstance>;
|
|
132
|
+
} | undefined) => UseQueryOptions<ProductsGetResponse, TError, TData, QueryKey> & {
|
|
133
|
+
queryKey: QueryKey;
|
|
134
|
+
};
|
|
95
135
|
type GetProductsForUnitQueryResult = NonNullable<Awaited<ReturnType<typeof getProductsForUnit>>>;
|
|
96
136
|
type GetProductsForUnitQueryError = ErrorType<void | AsError>;
|
|
97
137
|
declare const useGetProductsForUnit: <TData = ProductsGetResponse, TError = ErrorType<void | AsError>>(unitId: string, options?: {
|
|
@@ -106,7 +146,13 @@ declare const useGetProductsForUnit: <TData = ProductsGetResponse, TError = Erro
|
|
|
106
146
|
* @summary Gets a Product
|
|
107
147
|
*/
|
|
108
148
|
declare const getProduct: (productId: string, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<ProductUnitGetResponse>;
|
|
109
|
-
declare const getGetProductQueryKey: (productId: string) => string
|
|
149
|
+
declare const getGetProductQueryKey: (productId: string) => readonly ["account-server-api", `/product/${string}`];
|
|
150
|
+
declare const getGetProductQueryOptions: <TData = ProductUnitGetResponse, TError = ErrorType<void | AsError>>(productId: string, options?: {
|
|
151
|
+
query?: UseQueryOptions<ProductUnitGetResponse, TError, TData, QueryKey> | undefined;
|
|
152
|
+
request?: SecondParameter<typeof customInstance>;
|
|
153
|
+
} | undefined) => UseQueryOptions<ProductUnitGetResponse, TError, TData, QueryKey> & {
|
|
154
|
+
queryKey: QueryKey;
|
|
155
|
+
};
|
|
110
156
|
type GetProductQueryResult = NonNullable<Awaited<ReturnType<typeof getProduct>>>;
|
|
111
157
|
type GetProductQueryError = ErrorType<AsError | void>;
|
|
112
158
|
declare const useGetProduct: <TData = ProductUnitGetResponse, TError = ErrorType<void | AsError>>(productId: string, options?: {
|
|
@@ -119,6 +165,14 @@ declare const useGetProduct: <TData = ProductUnitGetResponse, TError = ErrorType
|
|
|
119
165
|
* @summary Deletes an existing Product
|
|
120
166
|
*/
|
|
121
167
|
declare const deleteProduct: (productId: string, options?: SecondParameter<typeof customInstance>) => Promise<void>;
|
|
168
|
+
declare const getDeleteProductMutationOptions: <TError = ErrorType<AsError>, TContext = unknown>(options?: {
|
|
169
|
+
mutation?: UseMutationOptions<void, TError, {
|
|
170
|
+
productId: string;
|
|
171
|
+
}, TContext> | undefined;
|
|
172
|
+
request?: SecondParameter<typeof customInstance>;
|
|
173
|
+
} | undefined) => UseMutationOptions<void, TError, {
|
|
174
|
+
productId: string;
|
|
175
|
+
}, TContext>;
|
|
122
176
|
type DeleteProductMutationResult = NonNullable<Awaited<ReturnType<typeof deleteProduct>>>;
|
|
123
177
|
type DeleteProductMutationError = ErrorType<AsError>;
|
|
124
178
|
declare const useDeleteProduct: <TError = ErrorType<AsError>, TContext = unknown>(options?: {
|
|
@@ -135,6 +189,16 @@ declare const useDeleteProduct: <TError = ErrorType<AsError>, TContext = unknown
|
|
|
135
189
|
* @summary Adjust an existing Product
|
|
136
190
|
*/
|
|
137
191
|
declare const patchProduct: (productId: string, productPatchBodyBody: ProductPatchBodyBody, options?: SecondParameter<typeof customInstance>) => Promise<void>;
|
|
192
|
+
declare const getPatchProductMutationOptions: <TError = ErrorType<AsError>, TContext = unknown>(options?: {
|
|
193
|
+
mutation?: UseMutationOptions<void, TError, {
|
|
194
|
+
productId: string;
|
|
195
|
+
data: ProductPatchBodyBody;
|
|
196
|
+
}, TContext> | undefined;
|
|
197
|
+
request?: SecondParameter<typeof customInstance>;
|
|
198
|
+
} | undefined) => UseMutationOptions<void, TError, {
|
|
199
|
+
productId: string;
|
|
200
|
+
data: ProductPatchBodyBody;
|
|
201
|
+
}, TContext>;
|
|
138
202
|
type PatchProductMutationResult = NonNullable<Awaited<ReturnType<typeof patchProduct>>>;
|
|
139
203
|
type PatchProductMutationBody = ProductPatchBodyBody;
|
|
140
204
|
type PatchProductMutationError = ErrorType<AsError>;
|
|
@@ -159,7 +223,13 @@ You need to be part of the **Unit** or **Organisation** to use this method
|
|
|
159
223
|
* @summary Get charges made against a Product
|
|
160
224
|
*/
|
|
161
225
|
declare const getProductCharges: (productId: string, params?: GetProductChargesParams, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<ProductChargesGetResponse>;
|
|
162
|
-
declare const getGetProductChargesQueryKey: (productId: string, params?: GetProductChargesParams) =>
|
|
226
|
+
declare const getGetProductChargesQueryKey: (productId: string, params?: GetProductChargesParams) => readonly ["account-server-api", `/product/${string}/charges`, ...GetProductChargesParams[]];
|
|
227
|
+
declare const getGetProductChargesQueryOptions: <TData = ProductChargesGetResponse, TError = ErrorType<void | AsError>>(productId: string, params?: GetProductChargesParams, options?: {
|
|
228
|
+
query?: UseQueryOptions<ProductChargesGetResponse, TError, TData, QueryKey> | undefined;
|
|
229
|
+
request?: SecondParameter<typeof customInstance>;
|
|
230
|
+
} | undefined) => UseQueryOptions<ProductChargesGetResponse, TError, TData, QueryKey> & {
|
|
231
|
+
queryKey: QueryKey;
|
|
232
|
+
};
|
|
163
233
|
type GetProductChargesQueryResult = NonNullable<Awaited<ReturnType<typeof getProductCharges>>>;
|
|
164
234
|
type GetProductChargesQueryError = ErrorType<AsError | void>;
|
|
165
235
|
declare const useGetProductCharges: <TData = ProductChargesGetResponse, TError = ErrorType<void | AsError>>(productId: string, params?: GetProductChargesParams, options?: {
|
|
@@ -169,4 +239,4 @@ declare const useGetProductCharges: <TData = ProductChargesGetResponse, TError =
|
|
|
169
239
|
queryKey: QueryKey;
|
|
170
240
|
};
|
|
171
241
|
|
|
172
|
-
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, getGetProductChargesQueryKey, getGetProductDefaultStorageCostQueryKey, getGetProductQueryKey, getGetProductTypesQueryKey, getGetProductsForOrganisationQueryKey, getGetProductsForUnitQueryKey, getGetProductsQueryKey, getProduct, getProductCharges, getProductDefaultStorageCost, getProductTypes, getProducts, getProductsForOrganisation, getProductsForUnit, patchProduct, useCreateUnitProduct, useDeleteProduct, useGetProduct, useGetProductCharges, useGetProductDefaultStorageCost, useGetProductTypes, useGetProducts, useGetProductsForOrganisation, useGetProductsForUnit, usePatchProduct };
|
|
242
|
+
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 };
|