@squonk/account-server-client 4.3.1 → 4.4.0-4-4.2174798239
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/dist/_virtual/rolldown_runtime.cjs +29 -0
- package/dist/api/actions/actions.cjs +85 -0
- package/dist/api/actions/actions.cjs.map +1 -0
- package/dist/api/actions/actions.d.cts +74 -0
- package/dist/api/actions/actions.d.cts.map +1 -0
- package/dist/api/actions/actions.d.ts +74 -0
- package/dist/api/actions/actions.d.ts.map +1 -0
- package/dist/api/actions/actions.js +79 -0
- package/dist/api/actions/actions.js.map +1 -0
- package/dist/api/api.schemas.cjs +142 -0
- package/dist/api/api.schemas.cjs.map +1 -0
- package/dist/api/api.schemas.d.cts +1032 -0
- package/dist/api/api.schemas.d.cts.map +1 -0
- package/dist/api/api.schemas.d.ts +1032 -0
- package/dist/api/api.schemas.d.ts.map +1 -0
- package/dist/api/api.schemas.js +118 -0
- package/dist/api/api.schemas.js.map +1 -0
- package/dist/api/asset/asset.cjs +464 -0
- package/dist/api/asset/asset.cjs.map +1 -0
- package/{asset → dist/api/asset}/asset.d.cts +132 -130
- package/dist/api/asset/asset.d.cts.map +1 -0
- package/{asset → dist/api/asset}/asset.d.ts +132 -130
- package/dist/api/asset/asset.d.ts.map +1 -0
- package/dist/api/asset/asset.js +431 -0
- package/dist/api/asset/asset.js.map +1 -0
- package/dist/api/charges/charges.cjs +272 -0
- package/dist/api/charges/charges.cjs.map +1 -0
- package/{charges → dist/api/charges}/charges.d.cts +106 -104
- package/dist/api/charges/charges.d.cts.map +1 -0
- package/{charges → dist/api/charges}/charges.d.ts +106 -104
- package/dist/api/charges/charges.d.ts.map +1 -0
- package/dist/api/charges/charges.js +248 -0
- package/dist/api/charges/charges.js.map +1 -0
- package/dist/api/event-stream/event-stream.cjs +230 -0
- package/dist/api/event-stream/event-stream.cjs.map +1 -0
- package/{event-stream → dist/api/event-stream}/event-stream.d.cts +75 -73
- package/dist/api/event-stream/event-stream.d.cts.map +1 -0
- package/{event-stream → dist/api/event-stream}/event-stream.d.ts +75 -73
- package/dist/api/event-stream/event-stream.d.ts.map +1 -0
- package/dist/api/event-stream/event-stream.js +212 -0
- package/dist/api/event-stream/event-stream.js.map +1 -0
- package/dist/api/merchant/merchant.cjs +139 -0
- package/dist/api/merchant/merchant.cjs.map +1 -0
- package/{merchant → dist/api/merchant}/merchant.d.cts +56 -54
- package/dist/api/merchant/merchant.d.cts.map +1 -0
- package/{merchant → dist/api/merchant}/merchant.d.ts +56 -54
- package/dist/api/merchant/merchant.d.ts.map +1 -0
- package/dist/api/merchant/merchant.js +127 -0
- package/dist/api/merchant/merchant.js.map +1 -0
- package/dist/api/organisation/organisation.cjs +341 -0
- package/dist/api/organisation/organisation.cjs.map +1 -0
- package/{organisation → dist/api/organisation}/organisation.d.cts +112 -110
- package/dist/api/organisation/organisation.d.cts.map +1 -0
- package/{organisation → dist/api/organisation}/organisation.d.ts +112 -110
- package/dist/api/organisation/organisation.d.ts.map +1 -0
- package/dist/api/organisation/organisation.js +314 -0
- package/dist/api/organisation/organisation.js.map +1 -0
- package/dist/api/product/product.cjs +513 -0
- package/dist/api/product/product.cjs.map +1 -0
- package/{product → dist/api/product}/product.d.cts +188 -186
- package/dist/api/product/product.d.cts.map +1 -0
- package/{product → dist/api/product}/product.d.ts +188 -186
- package/dist/api/product/product.d.ts.map +1 -0
- package/dist/api/product/product.js +468 -0
- package/dist/api/product/product.js.map +1 -0
- package/dist/api/state/state.cjs +76 -0
- package/dist/api/state/state.cjs.map +1 -0
- package/dist/api/state/state.d.cts +66 -0
- package/dist/api/state/state.d.cts.map +1 -0
- package/dist/api/state/state.d.ts +66 -0
- package/dist/api/state/state.d.ts.map +1 -0
- package/dist/api/state/state.js +70 -0
- package/dist/api/state/state.js.map +1 -0
- package/dist/api/unit/unit.cjs +568 -0
- package/dist/api/unit/unit.cjs.map +1 -0
- package/{unit → dist/api/unit}/unit.d.cts +167 -165
- package/dist/api/unit/unit.d.cts.map +1 -0
- package/{unit → dist/api/unit}/unit.d.ts +167 -165
- package/dist/api/unit/unit.d.ts.map +1 -0
- package/dist/api/unit/unit.js +523 -0
- package/dist/api/unit/unit.js.map +1 -0
- package/dist/api/user/user.cjs +380 -0
- package/dist/api/user/user.cjs.map +1 -0
- package/{user → dist/api/user}/user.d.cts +129 -127
- package/dist/api/user/user.d.cts.map +1 -0
- package/{user → dist/api/user}/user.d.ts +129 -127
- package/dist/api/user/user.d.ts.map +1 -0
- package/dist/api/user/user.js +350 -0
- package/dist/api/user/user.js.map +1 -0
- package/dist/custom-instance.cjs +49 -0
- package/dist/custom-instance.cjs.map +1 -0
- package/dist/custom-instance.d.cts +22 -0
- package/dist/custom-instance.d.cts.map +1 -0
- package/dist/custom-instance.d.ts +22 -0
- package/dist/custom-instance.d.ts.map +1 -0
- package/dist/custom-instance.js +44 -0
- package/dist/custom-instance.js.map +1 -0
- package/dist/index.cjs +31 -0
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +4 -0
- package/dist/options-mutator.cjs +24 -0
- package/dist/options-mutator.cjs.map +1 -0
- package/dist/options-mutator.js +23 -0
- package/dist/options-mutator.js.map +1 -0
- package/orval.config.ts +24 -0
- package/package.json +163 -16
- package/pnpm-workspace.yaml +3 -0
- package/src/api/actions/actions.ts +249 -0
- package/src/{account-server-api.schemas.ts → api/api.schemas.ts} +82 -2
- package/src/{asset → api/asset}/asset.ts +8 -8
- package/src/{charges → api/charges}/charges.ts +9 -9
- package/src/{event-stream → api/event-stream}/event-stream.ts +7 -7
- package/src/{merchant → api/merchant}/merchant.ts +7 -7
- package/src/{organisation → api/organisation}/organisation.ts +8 -8
- package/src/{product → api/product}/product.ts +10 -10
- package/src/{state → api/state}/state.ts +6 -6
- package/src/{unit → api/unit}/unit.ts +9 -9
- package/src/{user → api/user}/user.ts +9 -9
- package/src/index.ts +2 -2
- package/src/options-mutator.ts +2 -2
- package/tsconfig.json +29 -0
- package/tsdown.config.ts +52 -0
- package/asset/asset.cjs +0 -281
- package/asset/asset.cjs.map +0 -1
- package/asset/asset.js +0 -281
- package/asset/asset.js.map +0 -1
- package/asset/package.json +0 -7
- package/charges/charges.cjs +0 -176
- package/charges/charges.cjs.map +0 -1
- package/charges/charges.js +0 -176
- package/charges/charges.js.map +0 -1
- package/charges/package.json +0 -7
- package/chunk-3WKSNKHE.js +0 -25
- package/chunk-3WKSNKHE.js.map +0 -1
- package/chunk-NY2VJJG7.cjs +0 -25
- package/chunk-NY2VJJG7.cjs.map +0 -1
- package/chunk-RB2KVIEK.cjs +0 -27
- package/chunk-RB2KVIEK.cjs.map +0 -1
- package/chunk-XYDLYMQ2.js +0 -27
- package/chunk-XYDLYMQ2.js.map +0 -1
- package/event-stream/event-stream.cjs +0 -144
- package/event-stream/event-stream.cjs.map +0 -1
- package/event-stream/event-stream.js +0 -144
- package/event-stream/event-stream.js.map +0 -1
- package/event-stream/package.json +0 -7
- package/index.cjs +0 -142
- package/index.cjs.map +0 -1
- package/index.d.cts +0 -979
- package/index.d.ts +0 -979
- package/index.js +0 -142
- package/index.js.map +0 -1
- package/merchant/merchant.cjs +0 -91
- package/merchant/merchant.cjs.map +0 -1
- package/merchant/merchant.js +0 -91
- package/merchant/merchant.js.map +0 -1
- package/merchant/package.json +0 -7
- package/organisation/organisation.cjs +0 -213
- package/organisation/organisation.cjs.map +0 -1
- package/organisation/organisation.js +0 -213
- package/organisation/organisation.js.map +0 -1
- package/organisation/package.json +0 -7
- package/product/package.json +0 -7
- package/product/product.cjs +0 -341
- package/product/product.cjs.map +0 -1
- package/product/product.js +0 -341
- package/product/product.js.map +0 -1
- package/state/package.json +0 -7
- package/state/state.cjs +0 -53
- package/state/state.cjs.map +0 -1
- package/state/state.d.cts +0 -64
- package/state/state.d.ts +0 -64
- package/state/state.js +0 -53
- package/state/state.js.map +0 -1
- package/unit/package.json +0 -7
- package/unit/unit.cjs +0 -339
- package/unit/unit.cjs.map +0 -1
- package/unit/unit.js +0 -339
- package/unit/unit.js.map +0 -1
- package/user/package.json +0 -7
- package/user/user.cjs +0 -226
- package/user/user.cjs.map +0 -1
- package/user/user.js +0 -226
- package/user/user.js.map +0 -1
|
@@ -0,0 +1,513 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_custom_instance = require('../../custom-instance.cjs');
|
|
3
|
+
const require_options_mutator = require('../../options-mutator.cjs');
|
|
4
|
+
let __tanstack_react_query = require("@tanstack/react-query");
|
|
5
|
+
|
|
6
|
+
//#region src/api/product/product.ts
|
|
7
|
+
/**
|
|
8
|
+
* Generated by orval v7.16.1 🍺
|
|
9
|
+
* Do not edit manually.
|
|
10
|
+
* Account Server API
|
|
11
|
+
* The Informatics Matters Account Server API.
|
|
12
|
+
|
|
13
|
+
A service that provides access to the Account Server, which gives *registered* users access to and management of **Organisations**, **Units**, **Products**, **Users**, and **Assets**.
|
|
14
|
+
|
|
15
|
+
* OpenAPI spec version: 4.4
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Gets Product Types you can purchase (subscribe to)
|
|
19
|
+
|
|
20
|
+
* @summary Gets all Product Types
|
|
21
|
+
*/
|
|
22
|
+
const getProductTypes = (options, signal) => {
|
|
23
|
+
return require_custom_instance.customInstance({
|
|
24
|
+
url: `/product-type`,
|
|
25
|
+
method: "GET",
|
|
26
|
+
signal
|
|
27
|
+
}, options);
|
|
28
|
+
};
|
|
29
|
+
const getGetProductTypesQueryKey = () => {
|
|
30
|
+
return [`/product-type`];
|
|
31
|
+
};
|
|
32
|
+
const useGetProductTypesQueryOptions = (options) => {
|
|
33
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
34
|
+
const queryKey = queryOptions?.queryKey ?? getGetProductTypesQueryKey();
|
|
35
|
+
const queryFn = ({ signal }) => getProductTypes(requestOptions, signal);
|
|
36
|
+
return require_options_mutator.queryMutator({
|
|
37
|
+
...queryOptions,
|
|
38
|
+
queryKey,
|
|
39
|
+
queryFn
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* @summary Gets all Product Types
|
|
44
|
+
*/
|
|
45
|
+
function useGetProductTypes(options, queryClient) {
|
|
46
|
+
const queryOptions = useGetProductTypesQueryOptions(options);
|
|
47
|
+
const query = (0, __tanstack_react_query.useQuery)(queryOptions, queryClient);
|
|
48
|
+
query.queryKey = queryOptions.queryKey;
|
|
49
|
+
return query;
|
|
50
|
+
}
|
|
51
|
+
const useGetProductTypesSuspenseQueryOptions = (options) => {
|
|
52
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
53
|
+
const queryKey = queryOptions?.queryKey ?? getGetProductTypesQueryKey();
|
|
54
|
+
const queryFn = ({ signal }) => getProductTypes(requestOptions, signal);
|
|
55
|
+
return require_options_mutator.queryMutator({
|
|
56
|
+
...queryOptions,
|
|
57
|
+
queryKey,
|
|
58
|
+
queryFn
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* @summary Gets all Product Types
|
|
63
|
+
*/
|
|
64
|
+
function useGetProductTypesSuspense(options, queryClient) {
|
|
65
|
+
const queryOptions = useGetProductTypesSuspenseQueryOptions(options);
|
|
66
|
+
const query = (0, __tanstack_react_query.useSuspenseQuery)(queryOptions, queryClient);
|
|
67
|
+
query.queryKey = queryOptions.queryKey;
|
|
68
|
+
return query;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* The storage cost is returned along with its measurement units, typically a Coin value based on the the peak storage that was measured on each billable day.
|
|
72
|
+
|
|
73
|
+
* @summary Gets the default cross-product storage cost
|
|
74
|
+
*/
|
|
75
|
+
const getProductDefaultStorageCost = (options, signal) => {
|
|
76
|
+
return require_custom_instance.customInstance({
|
|
77
|
+
url: `/product-default-storage-cost`,
|
|
78
|
+
method: "GET",
|
|
79
|
+
signal
|
|
80
|
+
}, options);
|
|
81
|
+
};
|
|
82
|
+
const getGetProductDefaultStorageCostQueryKey = () => {
|
|
83
|
+
return [`/product-default-storage-cost`];
|
|
84
|
+
};
|
|
85
|
+
const useGetProductDefaultStorageCostQueryOptions = (options) => {
|
|
86
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
87
|
+
const queryKey = queryOptions?.queryKey ?? getGetProductDefaultStorageCostQueryKey();
|
|
88
|
+
const queryFn = ({ signal }) => getProductDefaultStorageCost(requestOptions, signal);
|
|
89
|
+
return require_options_mutator.queryMutator({
|
|
90
|
+
...queryOptions,
|
|
91
|
+
queryKey,
|
|
92
|
+
queryFn
|
|
93
|
+
});
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* @summary Gets the default cross-product storage cost
|
|
97
|
+
*/
|
|
98
|
+
function useGetProductDefaultStorageCost(options, queryClient) {
|
|
99
|
+
const queryOptions = useGetProductDefaultStorageCostQueryOptions(options);
|
|
100
|
+
const query = (0, __tanstack_react_query.useQuery)(queryOptions, queryClient);
|
|
101
|
+
query.queryKey = queryOptions.queryKey;
|
|
102
|
+
return query;
|
|
103
|
+
}
|
|
104
|
+
const useGetProductDefaultStorageCostSuspenseQueryOptions = (options) => {
|
|
105
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
106
|
+
const queryKey = queryOptions?.queryKey ?? getGetProductDefaultStorageCostQueryKey();
|
|
107
|
+
const queryFn = ({ signal }) => getProductDefaultStorageCost(requestOptions, signal);
|
|
108
|
+
return require_options_mutator.queryMutator({
|
|
109
|
+
...queryOptions,
|
|
110
|
+
queryKey,
|
|
111
|
+
queryFn
|
|
112
|
+
});
|
|
113
|
+
};
|
|
114
|
+
/**
|
|
115
|
+
* @summary Gets the default cross-product storage cost
|
|
116
|
+
*/
|
|
117
|
+
function useGetProductDefaultStorageCostSuspense(options, queryClient) {
|
|
118
|
+
const queryOptions = useGetProductDefaultStorageCostSuspenseQueryOptions(options);
|
|
119
|
+
const query = (0, __tanstack_react_query.useSuspenseQuery)(queryOptions, queryClient);
|
|
120
|
+
query.queryKey = queryOptions.queryKey;
|
|
121
|
+
return query;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Gets Products you have access to, across all **Units** and **Organisations**
|
|
125
|
+
|
|
126
|
+
* @summary Gets all Products
|
|
127
|
+
*/
|
|
128
|
+
const getProducts = (options, signal) => {
|
|
129
|
+
return require_custom_instance.customInstance({
|
|
130
|
+
url: `/product`,
|
|
131
|
+
method: "GET",
|
|
132
|
+
signal
|
|
133
|
+
}, options);
|
|
134
|
+
};
|
|
135
|
+
const getGetProductsQueryKey = () => {
|
|
136
|
+
return [`/product`];
|
|
137
|
+
};
|
|
138
|
+
const useGetProductsQueryOptions = (options) => {
|
|
139
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
140
|
+
const queryKey = queryOptions?.queryKey ?? getGetProductsQueryKey();
|
|
141
|
+
const queryFn = ({ signal }) => getProducts(requestOptions, signal);
|
|
142
|
+
return require_options_mutator.queryMutator({
|
|
143
|
+
...queryOptions,
|
|
144
|
+
queryKey,
|
|
145
|
+
queryFn
|
|
146
|
+
});
|
|
147
|
+
};
|
|
148
|
+
/**
|
|
149
|
+
* @summary Gets all Products
|
|
150
|
+
*/
|
|
151
|
+
function useGetProducts(options, queryClient) {
|
|
152
|
+
const queryOptions = useGetProductsQueryOptions(options);
|
|
153
|
+
const query = (0, __tanstack_react_query.useQuery)(queryOptions, queryClient);
|
|
154
|
+
query.queryKey = queryOptions.queryKey;
|
|
155
|
+
return query;
|
|
156
|
+
}
|
|
157
|
+
const useGetProductsSuspenseQueryOptions = (options) => {
|
|
158
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
159
|
+
const queryKey = queryOptions?.queryKey ?? getGetProductsQueryKey();
|
|
160
|
+
const queryFn = ({ signal }) => getProducts(requestOptions, signal);
|
|
161
|
+
return require_options_mutator.queryMutator({
|
|
162
|
+
...queryOptions,
|
|
163
|
+
queryKey,
|
|
164
|
+
queryFn
|
|
165
|
+
});
|
|
166
|
+
};
|
|
167
|
+
/**
|
|
168
|
+
* @summary Gets all Products
|
|
169
|
+
*/
|
|
170
|
+
function useGetProductsSuspense(options, queryClient) {
|
|
171
|
+
const queryOptions = useGetProductsSuspenseQueryOptions(options);
|
|
172
|
+
const query = (0, __tanstack_react_query.useSuspenseQuery)(queryOptions, queryClient);
|
|
173
|
+
query.queryKey = queryOptions.queryKey;
|
|
174
|
+
return query;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Gets Products you have access to based on an **Organisation**
|
|
178
|
+
|
|
179
|
+
* @summary Gets Products for an Organisation
|
|
180
|
+
*/
|
|
181
|
+
const getProductsForOrganisation = (orgId, options, signal) => {
|
|
182
|
+
return require_custom_instance.customInstance({
|
|
183
|
+
url: `/product/organisation/${orgId}`,
|
|
184
|
+
method: "GET",
|
|
185
|
+
signal
|
|
186
|
+
}, options);
|
|
187
|
+
};
|
|
188
|
+
const getGetProductsForOrganisationQueryKey = (orgId) => {
|
|
189
|
+
return [`/product/organisation/${orgId}`];
|
|
190
|
+
};
|
|
191
|
+
const useGetProductsForOrganisationQueryOptions = (orgId, options) => {
|
|
192
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
193
|
+
const queryKey = queryOptions?.queryKey ?? getGetProductsForOrganisationQueryKey(orgId);
|
|
194
|
+
const queryFn = ({ signal }) => getProductsForOrganisation(orgId, requestOptions, signal);
|
|
195
|
+
return require_options_mutator.queryMutator({
|
|
196
|
+
...queryOptions,
|
|
197
|
+
queryKey,
|
|
198
|
+
queryFn
|
|
199
|
+
});
|
|
200
|
+
};
|
|
201
|
+
/**
|
|
202
|
+
* @summary Gets Products for an Organisation
|
|
203
|
+
*/
|
|
204
|
+
function useGetProductsForOrganisation(orgId, options, queryClient) {
|
|
205
|
+
const queryOptions = useGetProductsForOrganisationQueryOptions(orgId, options);
|
|
206
|
+
const query = (0, __tanstack_react_query.useQuery)(queryOptions, queryClient);
|
|
207
|
+
query.queryKey = queryOptions.queryKey;
|
|
208
|
+
return query;
|
|
209
|
+
}
|
|
210
|
+
const useGetProductsForOrganisationSuspenseQueryOptions = (orgId, options) => {
|
|
211
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
212
|
+
const queryKey = queryOptions?.queryKey ?? getGetProductsForOrganisationQueryKey(orgId);
|
|
213
|
+
const queryFn = ({ signal }) => getProductsForOrganisation(orgId, requestOptions, signal);
|
|
214
|
+
return require_options_mutator.queryMutator({
|
|
215
|
+
...queryOptions,
|
|
216
|
+
queryKey,
|
|
217
|
+
queryFn
|
|
218
|
+
});
|
|
219
|
+
};
|
|
220
|
+
/**
|
|
221
|
+
* @summary Gets Products for an Organisation
|
|
222
|
+
*/
|
|
223
|
+
function useGetProductsForOrganisationSuspense(orgId, options, queryClient) {
|
|
224
|
+
const queryOptions = useGetProductsForOrganisationSuspenseQueryOptions(orgId, options);
|
|
225
|
+
const query = (0, __tanstack_react_query.useSuspenseQuery)(queryOptions, queryClient);
|
|
226
|
+
query.queryKey = queryOptions.queryKey;
|
|
227
|
+
return query;
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Products are **Subscriptions** that you create in a **Unit** that allow you to use services provided by a **Merchant**. To create products you need to be a member of the **Unit** or the Unit's **Organisation**.
|
|
231
|
+
|
|
232
|
+
Supported subscription **types** include `DATA_MANAGER_STORAGE_SUBSCRIPTION`, and `DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION`.
|
|
233
|
+
|
|
234
|
+
The `DATA_MANAGER_STORAGE_SUBSCRIPTION` **type** needs a **name**, an **allowance**, and an optional **limit** (that cannot be less than the **allowance**). If no **limit** is provided the **allowance** is used.
|
|
235
|
+
|
|
236
|
+
The `DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION` **type** needs a **name**, and a **flavour**. The **flavour**, a string, should typically be one of `EVALUATION`, `BRONZE`, `SILVER` or `GOLD`.
|
|
237
|
+
|
|
238
|
+
Users who are **Evaluators** can only create products in their Personal Unit, and where products support flavours, are restricted to `EVALUATION` flavours .
|
|
239
|
+
|
|
240
|
+
* @summary Creates a Product for a Unit
|
|
241
|
+
*/
|
|
242
|
+
const createUnitProduct = (unitId, unitProductPostBodyBody, options, signal) => {
|
|
243
|
+
return require_custom_instance.customInstance({
|
|
244
|
+
url: `/product/unit/${unitId}`,
|
|
245
|
+
method: "POST",
|
|
246
|
+
headers: { "Content-Type": "application/json" },
|
|
247
|
+
data: unitProductPostBodyBody,
|
|
248
|
+
signal
|
|
249
|
+
}, options);
|
|
250
|
+
};
|
|
251
|
+
const useCreateUnitProductMutationOptions = (options) => {
|
|
252
|
+
const mutationKey = ["createUnitProduct"];
|
|
253
|
+
const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : {
|
|
254
|
+
...options,
|
|
255
|
+
mutation: {
|
|
256
|
+
...options.mutation,
|
|
257
|
+
mutationKey
|
|
258
|
+
}
|
|
259
|
+
} : {
|
|
260
|
+
mutation: { mutationKey },
|
|
261
|
+
request: void 0
|
|
262
|
+
};
|
|
263
|
+
const mutationFn = (props) => {
|
|
264
|
+
const { unitId, data } = props ?? {};
|
|
265
|
+
return createUnitProduct(unitId, data, requestOptions);
|
|
266
|
+
};
|
|
267
|
+
return require_options_mutator.mutationMutator({
|
|
268
|
+
...mutationOptions,
|
|
269
|
+
mutationFn
|
|
270
|
+
});
|
|
271
|
+
};
|
|
272
|
+
/**
|
|
273
|
+
* @summary Creates a Product for a Unit
|
|
274
|
+
*/
|
|
275
|
+
const useCreateUnitProduct = (options, queryClient) => {
|
|
276
|
+
return (0, __tanstack_react_query.useMutation)(useCreateUnitProductMutationOptions(options), queryClient);
|
|
277
|
+
};
|
|
278
|
+
/**
|
|
279
|
+
* Gets products you have access to based on an Organisational **Unit**
|
|
280
|
+
|
|
281
|
+
* @summary Gets Products for an Organisational Unit
|
|
282
|
+
*/
|
|
283
|
+
const getProductsForUnit = (unitId, options, signal) => {
|
|
284
|
+
return require_custom_instance.customInstance({
|
|
285
|
+
url: `/product/unit/${unitId}`,
|
|
286
|
+
method: "GET",
|
|
287
|
+
signal
|
|
288
|
+
}, options);
|
|
289
|
+
};
|
|
290
|
+
const getGetProductsForUnitQueryKey = (unitId) => {
|
|
291
|
+
return [`/product/unit/${unitId}`];
|
|
292
|
+
};
|
|
293
|
+
const useGetProductsForUnitQueryOptions = (unitId, options) => {
|
|
294
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
295
|
+
const queryKey = queryOptions?.queryKey ?? getGetProductsForUnitQueryKey(unitId);
|
|
296
|
+
const queryFn = ({ signal }) => getProductsForUnit(unitId, requestOptions, signal);
|
|
297
|
+
return require_options_mutator.queryMutator({
|
|
298
|
+
...queryOptions,
|
|
299
|
+
queryKey,
|
|
300
|
+
queryFn
|
|
301
|
+
});
|
|
302
|
+
};
|
|
303
|
+
/**
|
|
304
|
+
* @summary Gets Products for an Organisational Unit
|
|
305
|
+
*/
|
|
306
|
+
function useGetProductsForUnit(unitId, options, queryClient) {
|
|
307
|
+
const queryOptions = useGetProductsForUnitQueryOptions(unitId, options);
|
|
308
|
+
const query = (0, __tanstack_react_query.useQuery)(queryOptions, queryClient);
|
|
309
|
+
query.queryKey = queryOptions.queryKey;
|
|
310
|
+
return query;
|
|
311
|
+
}
|
|
312
|
+
const useGetProductsForUnitSuspenseQueryOptions = (unitId, options) => {
|
|
313
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
314
|
+
const queryKey = queryOptions?.queryKey ?? getGetProductsForUnitQueryKey(unitId);
|
|
315
|
+
const queryFn = ({ signal }) => getProductsForUnit(unitId, requestOptions, signal);
|
|
316
|
+
return require_options_mutator.queryMutator({
|
|
317
|
+
...queryOptions,
|
|
318
|
+
queryKey,
|
|
319
|
+
queryFn
|
|
320
|
+
});
|
|
321
|
+
};
|
|
322
|
+
/**
|
|
323
|
+
* @summary Gets Products for an Organisational Unit
|
|
324
|
+
*/
|
|
325
|
+
function useGetProductsForUnitSuspense(unitId, options, queryClient) {
|
|
326
|
+
const queryOptions = useGetProductsForUnitSuspenseQueryOptions(unitId, options);
|
|
327
|
+
const query = (0, __tanstack_react_query.useSuspenseQuery)(queryOptions, queryClient);
|
|
328
|
+
query.queryKey = queryOptions.queryKey;
|
|
329
|
+
return query;
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* Gets details of a specific Product that you have access to.
|
|
333
|
+
|
|
334
|
+
* @summary Gets a Product
|
|
335
|
+
*/
|
|
336
|
+
const getProduct = (productId, options, signal) => {
|
|
337
|
+
return require_custom_instance.customInstance({
|
|
338
|
+
url: `/product/${productId}`,
|
|
339
|
+
method: "GET",
|
|
340
|
+
signal
|
|
341
|
+
}, options);
|
|
342
|
+
};
|
|
343
|
+
const getGetProductQueryKey = (productId) => {
|
|
344
|
+
return [`/product/${productId}`];
|
|
345
|
+
};
|
|
346
|
+
const useGetProductQueryOptions = (productId, options) => {
|
|
347
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
348
|
+
const queryKey = queryOptions?.queryKey ?? getGetProductQueryKey(productId);
|
|
349
|
+
const queryFn = ({ signal }) => getProduct(productId, requestOptions, signal);
|
|
350
|
+
return require_options_mutator.queryMutator({
|
|
351
|
+
...queryOptions,
|
|
352
|
+
queryKey,
|
|
353
|
+
queryFn
|
|
354
|
+
});
|
|
355
|
+
};
|
|
356
|
+
/**
|
|
357
|
+
* @summary Gets a Product
|
|
358
|
+
*/
|
|
359
|
+
function useGetProduct(productId, options, queryClient) {
|
|
360
|
+
const queryOptions = useGetProductQueryOptions(productId, options);
|
|
361
|
+
const query = (0, __tanstack_react_query.useQuery)(queryOptions, queryClient);
|
|
362
|
+
query.queryKey = queryOptions.queryKey;
|
|
363
|
+
return query;
|
|
364
|
+
}
|
|
365
|
+
const useGetProductSuspenseQueryOptions = (productId, options) => {
|
|
366
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
367
|
+
const queryKey = queryOptions?.queryKey ?? getGetProductQueryKey(productId);
|
|
368
|
+
const queryFn = ({ signal }) => getProduct(productId, requestOptions, signal);
|
|
369
|
+
return require_options_mutator.queryMutator({
|
|
370
|
+
...queryOptions,
|
|
371
|
+
queryKey,
|
|
372
|
+
queryFn
|
|
373
|
+
});
|
|
374
|
+
};
|
|
375
|
+
/**
|
|
376
|
+
* @summary Gets a Product
|
|
377
|
+
*/
|
|
378
|
+
function useGetProductSuspense(productId, options, queryClient) {
|
|
379
|
+
const queryOptions = useGetProductSuspenseQueryOptions(productId, options);
|
|
380
|
+
const query = (0, __tanstack_react_query.useSuspenseQuery)(queryOptions, queryClient);
|
|
381
|
+
query.queryKey = queryOptions.queryKey;
|
|
382
|
+
return query;
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* You need access to the Product and, if the Product is *claimable* the claim must be removed before the Product can be removed. An example claimable Product is a `DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION` where the *claimable* commodity is a Data Manager **Project**. In this case you will need to delete the Data Manager **Project** before you can delete the Account Server **Product**.
|
|
386
|
+
|
|
387
|
+
* @summary Deletes an existing Product
|
|
388
|
+
*/
|
|
389
|
+
const deleteProduct = (productId, options) => {
|
|
390
|
+
return require_custom_instance.customInstance({
|
|
391
|
+
url: `/product/${productId}`,
|
|
392
|
+
method: "DELETE"
|
|
393
|
+
}, options);
|
|
394
|
+
};
|
|
395
|
+
const useDeleteProductMutationOptions = (options) => {
|
|
396
|
+
const mutationKey = ["deleteProduct"];
|
|
397
|
+
const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : {
|
|
398
|
+
...options,
|
|
399
|
+
mutation: {
|
|
400
|
+
...options.mutation,
|
|
401
|
+
mutationKey
|
|
402
|
+
}
|
|
403
|
+
} : {
|
|
404
|
+
mutation: { mutationKey },
|
|
405
|
+
request: void 0
|
|
406
|
+
};
|
|
407
|
+
const mutationFn = (props) => {
|
|
408
|
+
const { productId } = props ?? {};
|
|
409
|
+
return deleteProduct(productId, requestOptions);
|
|
410
|
+
};
|
|
411
|
+
return require_options_mutator.mutationMutator({
|
|
412
|
+
...mutationOptions,
|
|
413
|
+
mutationFn
|
|
414
|
+
});
|
|
415
|
+
};
|
|
416
|
+
/**
|
|
417
|
+
* @summary Deletes an existing Product
|
|
418
|
+
*/
|
|
419
|
+
const useDeleteProduct = (options, queryClient) => {
|
|
420
|
+
return (0, __tanstack_react_query.useMutation)(useDeleteProductMutationOptions(options), queryClient);
|
|
421
|
+
};
|
|
422
|
+
/**
|
|
423
|
+
* Used to update some adjustable parameters of a Product, i.e. to extend its **Allowance** or **Limit**.
|
|
424
|
+
|
|
425
|
+
You must be a member of the **Unit**, or its **Organisation**, or an administrator to use this method.
|
|
426
|
+
|
|
427
|
+
At the moment we only support Products associated with the Data Manager, and these can be patched by changing the `name`, its coin `allowance` or `limit`
|
|
428
|
+
|
|
429
|
+
* @summary Adjust an existing Product
|
|
430
|
+
*/
|
|
431
|
+
const patchProduct = (productId, productPatchBodyBody, options) => {
|
|
432
|
+
return require_custom_instance.customInstance({
|
|
433
|
+
url: `/product/${productId}`,
|
|
434
|
+
method: "PATCH",
|
|
435
|
+
headers: { "Content-Type": "application/json" },
|
|
436
|
+
data: productPatchBodyBody
|
|
437
|
+
}, options);
|
|
438
|
+
};
|
|
439
|
+
const usePatchProductMutationOptions = (options) => {
|
|
440
|
+
const mutationKey = ["patchProduct"];
|
|
441
|
+
const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : {
|
|
442
|
+
...options,
|
|
443
|
+
mutation: {
|
|
444
|
+
...options.mutation,
|
|
445
|
+
mutationKey
|
|
446
|
+
}
|
|
447
|
+
} : {
|
|
448
|
+
mutation: { mutationKey },
|
|
449
|
+
request: void 0
|
|
450
|
+
};
|
|
451
|
+
const mutationFn = (props) => {
|
|
452
|
+
const { productId, data } = props ?? {};
|
|
453
|
+
return patchProduct(productId, data, requestOptions);
|
|
454
|
+
};
|
|
455
|
+
return require_options_mutator.mutationMutator({
|
|
456
|
+
...mutationOptions,
|
|
457
|
+
mutationFn
|
|
458
|
+
});
|
|
459
|
+
};
|
|
460
|
+
/**
|
|
461
|
+
* @summary Adjust an existing Product
|
|
462
|
+
*/
|
|
463
|
+
const usePatchProduct = (options, queryClient) => {
|
|
464
|
+
return (0, __tanstack_react_query.useMutation)(usePatchProductMutationOptions(options), queryClient);
|
|
465
|
+
};
|
|
466
|
+
|
|
467
|
+
//#endregion
|
|
468
|
+
exports.createUnitProduct = createUnitProduct;
|
|
469
|
+
exports.deleteProduct = deleteProduct;
|
|
470
|
+
exports.getGetProductDefaultStorageCostQueryKey = getGetProductDefaultStorageCostQueryKey;
|
|
471
|
+
exports.getGetProductQueryKey = getGetProductQueryKey;
|
|
472
|
+
exports.getGetProductTypesQueryKey = getGetProductTypesQueryKey;
|
|
473
|
+
exports.getGetProductsForOrganisationQueryKey = getGetProductsForOrganisationQueryKey;
|
|
474
|
+
exports.getGetProductsForUnitQueryKey = getGetProductsForUnitQueryKey;
|
|
475
|
+
exports.getGetProductsQueryKey = getGetProductsQueryKey;
|
|
476
|
+
exports.getProduct = getProduct;
|
|
477
|
+
exports.getProductDefaultStorageCost = getProductDefaultStorageCost;
|
|
478
|
+
exports.getProductTypes = getProductTypes;
|
|
479
|
+
exports.getProducts = getProducts;
|
|
480
|
+
exports.getProductsForOrganisation = getProductsForOrganisation;
|
|
481
|
+
exports.getProductsForUnit = getProductsForUnit;
|
|
482
|
+
exports.patchProduct = patchProduct;
|
|
483
|
+
exports.useCreateUnitProduct = useCreateUnitProduct;
|
|
484
|
+
exports.useCreateUnitProductMutationOptions = useCreateUnitProductMutationOptions;
|
|
485
|
+
exports.useDeleteProduct = useDeleteProduct;
|
|
486
|
+
exports.useDeleteProductMutationOptions = useDeleteProductMutationOptions;
|
|
487
|
+
exports.useGetProduct = useGetProduct;
|
|
488
|
+
exports.useGetProductDefaultStorageCost = useGetProductDefaultStorageCost;
|
|
489
|
+
exports.useGetProductDefaultStorageCostQueryOptions = useGetProductDefaultStorageCostQueryOptions;
|
|
490
|
+
exports.useGetProductDefaultStorageCostSuspense = useGetProductDefaultStorageCostSuspense;
|
|
491
|
+
exports.useGetProductDefaultStorageCostSuspenseQueryOptions = useGetProductDefaultStorageCostSuspenseQueryOptions;
|
|
492
|
+
exports.useGetProductQueryOptions = useGetProductQueryOptions;
|
|
493
|
+
exports.useGetProductSuspense = useGetProductSuspense;
|
|
494
|
+
exports.useGetProductSuspenseQueryOptions = useGetProductSuspenseQueryOptions;
|
|
495
|
+
exports.useGetProductTypes = useGetProductTypes;
|
|
496
|
+
exports.useGetProductTypesQueryOptions = useGetProductTypesQueryOptions;
|
|
497
|
+
exports.useGetProductTypesSuspense = useGetProductTypesSuspense;
|
|
498
|
+
exports.useGetProductTypesSuspenseQueryOptions = useGetProductTypesSuspenseQueryOptions;
|
|
499
|
+
exports.useGetProducts = useGetProducts;
|
|
500
|
+
exports.useGetProductsForOrganisation = useGetProductsForOrganisation;
|
|
501
|
+
exports.useGetProductsForOrganisationQueryOptions = useGetProductsForOrganisationQueryOptions;
|
|
502
|
+
exports.useGetProductsForOrganisationSuspense = useGetProductsForOrganisationSuspense;
|
|
503
|
+
exports.useGetProductsForOrganisationSuspenseQueryOptions = useGetProductsForOrganisationSuspenseQueryOptions;
|
|
504
|
+
exports.useGetProductsForUnit = useGetProductsForUnit;
|
|
505
|
+
exports.useGetProductsForUnitQueryOptions = useGetProductsForUnitQueryOptions;
|
|
506
|
+
exports.useGetProductsForUnitSuspense = useGetProductsForUnitSuspense;
|
|
507
|
+
exports.useGetProductsForUnitSuspenseQueryOptions = useGetProductsForUnitSuspenseQueryOptions;
|
|
508
|
+
exports.useGetProductsQueryOptions = useGetProductsQueryOptions;
|
|
509
|
+
exports.useGetProductsSuspense = useGetProductsSuspense;
|
|
510
|
+
exports.useGetProductsSuspenseQueryOptions = useGetProductsSuspenseQueryOptions;
|
|
511
|
+
exports.usePatchProduct = usePatchProduct;
|
|
512
|
+
exports.usePatchProductMutationOptions = usePatchProductMutationOptions;
|
|
513
|
+
//# sourceMappingURL=product.cjs.map
|