@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,248 @@
|
|
|
1
|
+
import { customInstance } from "../../custom-instance.js";
|
|
2
|
+
import { queryMutator } from "../../options-mutator.js";
|
|
3
|
+
import { useQuery, useSuspenseQuery } from "@tanstack/react-query";
|
|
4
|
+
|
|
5
|
+
//#region src/api/charges/charges.ts
|
|
6
|
+
/**
|
|
7
|
+
* Generated by orval v7.16.1 🍺
|
|
8
|
+
* Do not edit manually.
|
|
9
|
+
* Account Server API
|
|
10
|
+
* The Informatics Matters Account Server API.
|
|
11
|
+
|
|
12
|
+
A service that provides access to the Account Server, which gives *registered* users access to and management of **Organisations**, **Units**, **Products**, **Users**, and **Assets**.
|
|
13
|
+
|
|
14
|
+
* OpenAPI spec version: 4.4
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Gets global Charges.
|
|
18
|
+
|
|
19
|
+
You need admin rights to use this path.
|
|
20
|
+
|
|
21
|
+
* @summary Gets charges for all Organisations
|
|
22
|
+
*/
|
|
23
|
+
const getCharges = (params, options, signal) => {
|
|
24
|
+
return customInstance({
|
|
25
|
+
url: `/charges`,
|
|
26
|
+
method: "GET",
|
|
27
|
+
params,
|
|
28
|
+
signal
|
|
29
|
+
}, options);
|
|
30
|
+
};
|
|
31
|
+
const getGetChargesQueryKey = (params) => {
|
|
32
|
+
return [`/charges`, ...params ? [params] : []];
|
|
33
|
+
};
|
|
34
|
+
const useGetChargesQueryOptions = (params, options) => {
|
|
35
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
36
|
+
const queryKey = queryOptions?.queryKey ?? getGetChargesQueryKey(params);
|
|
37
|
+
const queryFn = ({ signal }) => getCharges(params, requestOptions, signal);
|
|
38
|
+
return queryMutator({
|
|
39
|
+
...queryOptions,
|
|
40
|
+
queryKey,
|
|
41
|
+
queryFn
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* @summary Gets charges for all Organisations
|
|
46
|
+
*/
|
|
47
|
+
function useGetCharges(params, options, queryClient) {
|
|
48
|
+
const queryOptions = useGetChargesQueryOptions(params, options);
|
|
49
|
+
const query = useQuery(queryOptions, queryClient);
|
|
50
|
+
query.queryKey = queryOptions.queryKey;
|
|
51
|
+
return query;
|
|
52
|
+
}
|
|
53
|
+
const useGetChargesSuspenseQueryOptions = (params, options) => {
|
|
54
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
55
|
+
const queryKey = queryOptions?.queryKey ?? getGetChargesQueryKey(params);
|
|
56
|
+
const queryFn = ({ signal }) => getCharges(params, requestOptions, signal);
|
|
57
|
+
return queryMutator({
|
|
58
|
+
...queryOptions,
|
|
59
|
+
queryKey,
|
|
60
|
+
queryFn
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* @summary Gets charges for all Organisations
|
|
65
|
+
*/
|
|
66
|
+
function useGetChargesSuspense(params, options, queryClient) {
|
|
67
|
+
const queryOptions = useGetChargesSuspenseQueryOptions(params, options);
|
|
68
|
+
const query = useSuspenseQuery(queryOptions, queryClient);
|
|
69
|
+
query.queryKey = queryOptions.queryKey;
|
|
70
|
+
return query;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Gets a Organisation charges.
|
|
74
|
+
|
|
75
|
+
The Organisation cannot be the **Default Organisation** and you need to be a member of the Organisation to use this endpoint
|
|
76
|
+
|
|
77
|
+
* @summary Gets charges for all Units in an Organisation
|
|
78
|
+
*/
|
|
79
|
+
const getOrganisationCharges = (orgId, params, options, signal) => {
|
|
80
|
+
return customInstance({
|
|
81
|
+
url: `/charges/organisation/${orgId}`,
|
|
82
|
+
method: "GET",
|
|
83
|
+
params,
|
|
84
|
+
signal
|
|
85
|
+
}, options);
|
|
86
|
+
};
|
|
87
|
+
const getGetOrganisationChargesQueryKey = (orgId, params) => {
|
|
88
|
+
return [`/charges/organisation/${orgId}`, ...params ? [params] : []];
|
|
89
|
+
};
|
|
90
|
+
const useGetOrganisationChargesQueryOptions = (orgId, params, options) => {
|
|
91
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
92
|
+
const queryKey = queryOptions?.queryKey ?? getGetOrganisationChargesQueryKey(orgId, params);
|
|
93
|
+
const queryFn = ({ signal }) => getOrganisationCharges(orgId, params, requestOptions, signal);
|
|
94
|
+
return queryMutator({
|
|
95
|
+
...queryOptions,
|
|
96
|
+
queryKey,
|
|
97
|
+
queryFn
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* @summary Gets charges for all Units in an Organisation
|
|
102
|
+
*/
|
|
103
|
+
function useGetOrganisationCharges(orgId, params, options, queryClient) {
|
|
104
|
+
const queryOptions = useGetOrganisationChargesQueryOptions(orgId, params, options);
|
|
105
|
+
const query = useQuery(queryOptions, queryClient);
|
|
106
|
+
query.queryKey = queryOptions.queryKey;
|
|
107
|
+
return query;
|
|
108
|
+
}
|
|
109
|
+
const useGetOrganisationChargesSuspenseQueryOptions = (orgId, params, options) => {
|
|
110
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
111
|
+
const queryKey = queryOptions?.queryKey ?? getGetOrganisationChargesQueryKey(orgId, params);
|
|
112
|
+
const queryFn = ({ signal }) => getOrganisationCharges(orgId, params, requestOptions, signal);
|
|
113
|
+
return queryMutator({
|
|
114
|
+
...queryOptions,
|
|
115
|
+
queryKey,
|
|
116
|
+
queryFn
|
|
117
|
+
});
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* @summary Gets charges for all Units in an Organisation
|
|
121
|
+
*/
|
|
122
|
+
function useGetOrganisationChargesSuspense(orgId, params, options, queryClient) {
|
|
123
|
+
const queryOptions = useGetOrganisationChargesSuspenseQueryOptions(orgId, params, options);
|
|
124
|
+
const query = useSuspenseQuery(queryOptions, queryClient);
|
|
125
|
+
query.queryKey = queryOptions.queryKey;
|
|
126
|
+
return query;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* 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.
|
|
130
|
+
|
|
131
|
+
Dates are interpreted using the Python `dateutil` parser, so the input strings are extremely flexible with, for example, `1 December 2021` as an acceptable input.
|
|
132
|
+
|
|
133
|
+
**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` allowing you to obtain charges for up to two years.
|
|
134
|
+
|
|
135
|
+
You need to be part of the **Unit** or **Organisation** to use this method
|
|
136
|
+
* @summary Get charges made against a Product
|
|
137
|
+
*/
|
|
138
|
+
const getProductCharges = (productId, params, options, signal) => {
|
|
139
|
+
return customInstance({
|
|
140
|
+
url: `/charges/product/${productId}`,
|
|
141
|
+
method: "GET",
|
|
142
|
+
params,
|
|
143
|
+
signal
|
|
144
|
+
}, options);
|
|
145
|
+
};
|
|
146
|
+
const getGetProductChargesQueryKey = (productId, params) => {
|
|
147
|
+
return [`/charges/product/${productId}`, ...params ? [params] : []];
|
|
148
|
+
};
|
|
149
|
+
const useGetProductChargesQueryOptions = (productId, params, options) => {
|
|
150
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
151
|
+
const queryKey = queryOptions?.queryKey ?? getGetProductChargesQueryKey(productId, params);
|
|
152
|
+
const queryFn = ({ signal }) => getProductCharges(productId, params, requestOptions, signal);
|
|
153
|
+
return queryMutator({
|
|
154
|
+
...queryOptions,
|
|
155
|
+
queryKey,
|
|
156
|
+
queryFn
|
|
157
|
+
});
|
|
158
|
+
};
|
|
159
|
+
/**
|
|
160
|
+
* @summary Get charges made against a Product
|
|
161
|
+
*/
|
|
162
|
+
function useGetProductCharges(productId, params, options, queryClient) {
|
|
163
|
+
const queryOptions = useGetProductChargesQueryOptions(productId, params, options);
|
|
164
|
+
const query = useQuery(queryOptions, queryClient);
|
|
165
|
+
query.queryKey = queryOptions.queryKey;
|
|
166
|
+
return query;
|
|
167
|
+
}
|
|
168
|
+
const useGetProductChargesSuspenseQueryOptions = (productId, params, options) => {
|
|
169
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
170
|
+
const queryKey = queryOptions?.queryKey ?? getGetProductChargesQueryKey(productId, params);
|
|
171
|
+
const queryFn = ({ signal }) => getProductCharges(productId, params, requestOptions, signal);
|
|
172
|
+
return queryMutator({
|
|
173
|
+
...queryOptions,
|
|
174
|
+
queryKey,
|
|
175
|
+
queryFn
|
|
176
|
+
});
|
|
177
|
+
};
|
|
178
|
+
/**
|
|
179
|
+
* @summary Get charges made against a Product
|
|
180
|
+
*/
|
|
181
|
+
function useGetProductChargesSuspense(productId, params, options, queryClient) {
|
|
182
|
+
const queryOptions = useGetProductChargesSuspenseQueryOptions(productId, params, options);
|
|
183
|
+
const query = useSuspenseQuery(queryOptions, queryClient);
|
|
184
|
+
query.queryKey = queryOptions.queryKey;
|
|
185
|
+
return query;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Get the charges made against a Unit with optional **from** (inclusive) and **until** (exclusive) dates. If no dates are provided, the charges for the current billing period are returned.
|
|
189
|
+
Dates are interpreted using the Python `dateutil` parser, so the input strings are extremely flexible with, for example, `1 December 2021` as an acceptable input.
|
|
190
|
+
|
|
191
|
+
**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` allowing you to obtain charges for up to two years.
|
|
192
|
+
|
|
193
|
+
You need to be part of the **Unit** or **Organisation** to use this method
|
|
194
|
+
* @summary Get charges made against a Unit
|
|
195
|
+
*/
|
|
196
|
+
const getUnitCharges = (unitId, params, options, signal) => {
|
|
197
|
+
return customInstance({
|
|
198
|
+
url: `/charges/unit/${unitId}`,
|
|
199
|
+
method: "GET",
|
|
200
|
+
params,
|
|
201
|
+
signal
|
|
202
|
+
}, options);
|
|
203
|
+
};
|
|
204
|
+
const getGetUnitChargesQueryKey = (unitId, params) => {
|
|
205
|
+
return [`/charges/unit/${unitId}`, ...params ? [params] : []];
|
|
206
|
+
};
|
|
207
|
+
const useGetUnitChargesQueryOptions = (unitId, params, options) => {
|
|
208
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
209
|
+
const queryKey = queryOptions?.queryKey ?? getGetUnitChargesQueryKey(unitId, params);
|
|
210
|
+
const queryFn = ({ signal }) => getUnitCharges(unitId, params, requestOptions, signal);
|
|
211
|
+
return queryMutator({
|
|
212
|
+
...queryOptions,
|
|
213
|
+
queryKey,
|
|
214
|
+
queryFn
|
|
215
|
+
});
|
|
216
|
+
};
|
|
217
|
+
/**
|
|
218
|
+
* @summary Get charges made against a Unit
|
|
219
|
+
*/
|
|
220
|
+
function useGetUnitCharges(unitId, params, options, queryClient) {
|
|
221
|
+
const queryOptions = useGetUnitChargesQueryOptions(unitId, params, options);
|
|
222
|
+
const query = useQuery(queryOptions, queryClient);
|
|
223
|
+
query.queryKey = queryOptions.queryKey;
|
|
224
|
+
return query;
|
|
225
|
+
}
|
|
226
|
+
const useGetUnitChargesSuspenseQueryOptions = (unitId, params, options) => {
|
|
227
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
228
|
+
const queryKey = queryOptions?.queryKey ?? getGetUnitChargesQueryKey(unitId, params);
|
|
229
|
+
const queryFn = ({ signal }) => getUnitCharges(unitId, params, requestOptions, signal);
|
|
230
|
+
return queryMutator({
|
|
231
|
+
...queryOptions,
|
|
232
|
+
queryKey,
|
|
233
|
+
queryFn
|
|
234
|
+
});
|
|
235
|
+
};
|
|
236
|
+
/**
|
|
237
|
+
* @summary Get charges made against a Unit
|
|
238
|
+
*/
|
|
239
|
+
function useGetUnitChargesSuspense(unitId, params, options, queryClient) {
|
|
240
|
+
const queryOptions = useGetUnitChargesSuspenseQueryOptions(unitId, params, options);
|
|
241
|
+
const query = useSuspenseQuery(queryOptions, queryClient);
|
|
242
|
+
query.queryKey = queryOptions.queryKey;
|
|
243
|
+
return query;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
//#endregion
|
|
247
|
+
export { getCharges, getGetChargesQueryKey, getGetOrganisationChargesQueryKey, getGetProductChargesQueryKey, getGetUnitChargesQueryKey, getOrganisationCharges, getProductCharges, getUnitCharges, useGetCharges, useGetChargesQueryOptions, useGetChargesSuspense, useGetChargesSuspenseQueryOptions, useGetOrganisationCharges, useGetOrganisationChargesQueryOptions, useGetOrganisationChargesSuspense, useGetOrganisationChargesSuspenseQueryOptions, useGetProductCharges, useGetProductChargesQueryOptions, useGetProductChargesSuspense, useGetProductChargesSuspenseQueryOptions, useGetUnitCharges, useGetUnitChargesQueryOptions, useGetUnitChargesSuspense, useGetUnitChargesSuspenseQueryOptions };
|
|
248
|
+
//# sourceMappingURL=charges.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"charges.js","names":["queryFn: QueryFunction<Awaited<ReturnType<typeof getCharges>>>","queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisationCharges>>>","queryFn: QueryFunction<Awaited<ReturnType<typeof getProductCharges>>>","queryFn: QueryFunction<Awaited<ReturnType<typeof getUnitCharges>>>"],"sources":["../../../src/api/charges/charges.ts"],"sourcesContent":["/**\n * Generated by orval v7.16.1 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Organisations**, **Units**, **Products**, **Users**, and **Assets**.\n\n * OpenAPI spec version: 4.4\n */\nimport { useQuery, useSuspenseQuery } from \"@tanstack/react-query\";\nimport type {\n DataTag,\n DefinedInitialDataOptions,\n DefinedUseQueryResult,\n QueryClient,\n QueryFunction,\n QueryKey,\n UndefinedInitialDataOptions,\n UseQueryOptions,\n UseQueryResult,\n UseSuspenseQueryOptions,\n UseSuspenseQueryResult,\n} from \"@tanstack/react-query\";\n\nimport type {\n AsError,\n ChargesGetResponse,\n GetChargesParams,\n GetOrganisationChargesParams,\n GetProductChargesParams,\n GetUnitChargesParams,\n OrganisationChargesGetResponse,\n ProductChargesGetResponse,\n UnitChargesGetResponse,\n} from \"../api.schemas\";\n\nimport { customInstance } from \"../../custom-instance\";\nimport type { ErrorType } from \"../../custom-instance\";\nimport { queryMutator } from \"../../options-mutator\";\n\ntype SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];\n\n/**\n * Gets global Charges.\n\nYou need admin rights to use this path.\n\n * @summary Gets charges for all Organisations\n */\nexport const getCharges = (\n params?: GetChargesParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<ChargesGetResponse>(\n { url: `/charges`, method: \"GET\", params, signal },\n options,\n );\n};\n\nexport const getGetChargesQueryKey = (params?: GetChargesParams) => {\n return [`/charges`, ...(params ? [params] : [])] as const;\n};\n\nexport const useGetChargesQueryOptions = <\n TData = Awaited<ReturnType<typeof getCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n params?: GetChargesParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetChargesQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getCharges>>> = ({ signal }) =>\n getCharges(params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData> & {\n queryKey: DataTag<QueryKey, TData, TError>;\n };\n};\n\nexport type GetChargesQueryResult = NonNullable<Awaited<ReturnType<typeof getCharges>>>;\nexport type GetChargesQueryError = ErrorType<void | AsError>;\n\nexport function useGetCharges<\n TData = Awaited<ReturnType<typeof getCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n params: undefined | GetChargesParams,\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getCharges>>,\n TError,\n Awaited<ReturnType<typeof getCharges>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetCharges<\n TData = Awaited<ReturnType<typeof getCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n params?: GetChargesParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>> &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getCharges>>,\n TError,\n Awaited<ReturnType<typeof getCharges>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetCharges<\n TData = Awaited<ReturnType<typeof getCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n params?: GetChargesParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Gets charges for all Organisations\n */\n\nexport function useGetCharges<\n TData = Awaited<ReturnType<typeof getCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n params?: GetChargesParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = useGetChargesQueryOptions(params, options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData, TError>;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\nexport const useGetChargesSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n params?: GetChargesParams,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetChargesQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getCharges>>> = ({ signal }) =>\n getCharges(params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getCharges>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetChargesSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getCharges>>>;\nexport type GetChargesSuspenseQueryError = ErrorType<void | AsError>;\n\nexport function useGetChargesSuspense<\n TData = Awaited<ReturnType<typeof getCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n params: undefined | GetChargesParams,\n options: {\n query: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetChargesSuspense<\n TData = Awaited<ReturnType<typeof getCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n params?: GetChargesParams,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetChargesSuspense<\n TData = Awaited<ReturnType<typeof getCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n params?: GetChargesParams,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Gets charges for all Organisations\n */\n\nexport function useGetChargesSuspense<\n TData = Awaited<ReturnType<typeof getCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n params?: GetChargesParams,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = useGetChargesSuspenseQueryOptions(params, options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * Gets a Organisation charges.\n\nThe Organisation cannot be the **Default Organisation** and you need to be a member of the Organisation to use this endpoint\n\n * @summary Gets charges for all Units in an Organisation\n */\nexport const getOrganisationCharges = (\n orgId: string,\n params?: GetOrganisationChargesParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<OrganisationChargesGetResponse>(\n { url: `/charges/organisation/${orgId}`, method: \"GET\", params, signal },\n options,\n );\n};\n\nexport const getGetOrganisationChargesQueryKey = (\n orgId?: string,\n params?: GetOrganisationChargesParams,\n) => {\n return [`/charges/organisation/${orgId}`, ...(params ? [params] : [])] as const;\n};\n\nexport const useGetOrganisationChargesQueryOptions = <\n TData = Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n params?: GetOrganisationChargesParams,\n options?: {\n query?: Partial<\n UseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetOrganisationChargesQueryKey(orgId, params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisationCharges>>> = ({ signal }) =>\n getOrganisationCharges(orgId, params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetOrganisationChargesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getOrganisationCharges>>\n>;\nexport type GetOrganisationChargesQueryError = ErrorType<void | AsError>;\n\nexport function useGetOrganisationCharges<\n TData = Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n params: undefined | GetOrganisationChargesParams,\n options: {\n query: Partial<\n UseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>\n > &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError,\n Awaited<ReturnType<typeof getOrganisationCharges>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetOrganisationCharges<\n TData = Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n params?: GetOrganisationChargesParams,\n options?: {\n query?: Partial<\n UseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>\n > &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError,\n Awaited<ReturnType<typeof getOrganisationCharges>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetOrganisationCharges<\n TData = Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n params?: GetOrganisationChargesParams,\n options?: {\n query?: Partial<\n UseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Gets charges for all Units in an Organisation\n */\n\nexport function useGetOrganisationCharges<\n TData = Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n params?: GetOrganisationChargesParams,\n options?: {\n query?: Partial<\n UseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = useGetOrganisationChargesQueryOptions(orgId, params, options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData, TError>;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\nexport const useGetOrganisationChargesSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n params?: GetOrganisationChargesParams,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetOrganisationChargesQueryKey(orgId, params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisationCharges>>> = ({ signal }) =>\n getOrganisationCharges(orgId, params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetOrganisationChargesSuspenseQueryResult = NonNullable<\n Awaited<ReturnType<typeof getOrganisationCharges>>\n>;\nexport type GetOrganisationChargesSuspenseQueryError = ErrorType<void | AsError>;\n\nexport function useGetOrganisationChargesSuspense<\n TData = Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n params: undefined | GetOrganisationChargesParams,\n options: {\n query: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetOrganisationChargesSuspense<\n TData = Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n params?: GetOrganisationChargesParams,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetOrganisationChargesSuspense<\n TData = Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n params?: GetOrganisationChargesParams,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Gets charges for all Units in an Organisation\n */\n\nexport function useGetOrganisationChargesSuspense<\n TData = Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n params?: GetOrganisationChargesParams,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = useGetOrganisationChargesSuspenseQueryOptions(orgId, params, options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * 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 with, for example, `1 December 2021` as an acceptable input.\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` allowing you to obtain charges for up to 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: `/charges/product/${productId}`, method: \"GET\", params, signal },\n options,\n );\n};\n\nexport const getGetProductChargesQueryKey = (\n productId?: string,\n params?: GetProductChargesParams,\n) => {\n return [`/charges/product/${productId}`, ...(params ? [params] : [])] as const;\n};\n\nexport const useGetProductChargesQueryOptions = <\n TData = Awaited<ReturnType<typeof getProductCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n productId: string,\n params?: GetProductChargesParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProductChargesQueryKey(productId, params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProductCharges>>> = ({ signal }) =>\n getProductCharges(productId, params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseQueryOptions<\n Awaited<ReturnType<typeof getProductCharges>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetProductChargesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProductCharges>>\n>;\nexport type GetProductChargesQueryError = ErrorType<AsError | void>;\n\nexport function useGetProductCharges<\n TData = Awaited<ReturnType<typeof getProductCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n productId: string,\n params: undefined | GetProductChargesParams,\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getProductCharges>>,\n TError,\n Awaited<ReturnType<typeof getProductCharges>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetProductCharges<\n TData = Awaited<ReturnType<typeof getProductCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n productId: string,\n params?: GetProductChargesParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>> &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getProductCharges>>,\n TError,\n Awaited<ReturnType<typeof getProductCharges>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetProductCharges<\n TData = Awaited<ReturnType<typeof getProductCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n productId: string,\n params?: GetProductChargesParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Get charges made against a Product\n */\n\nexport function useGetProductCharges<\n TData = Awaited<ReturnType<typeof getProductCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n productId: string,\n params?: GetProductChargesParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = useGetProductChargesQueryOptions(productId, params, options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData, TError>;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\nexport const useGetProductChargesSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getProductCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n productId: string,\n params?: GetProductChargesParams,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProductChargesQueryKey(productId, params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProductCharges>>> = ({ signal }) =>\n getProductCharges(productId, params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getProductCharges>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetProductChargesSuspenseQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProductCharges>>\n>;\nexport type GetProductChargesSuspenseQueryError = ErrorType<AsError | void>;\n\nexport function useGetProductChargesSuspense<\n TData = Awaited<ReturnType<typeof getProductCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n productId: string,\n params: undefined | GetProductChargesParams,\n options: {\n query: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetProductChargesSuspense<\n TData = Awaited<ReturnType<typeof getProductCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n productId: string,\n params?: GetProductChargesParams,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetProductChargesSuspense<\n TData = Awaited<ReturnType<typeof getProductCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n productId: string,\n params?: GetProductChargesParams,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Get charges made against a Product\n */\n\nexport function useGetProductChargesSuspense<\n TData = Awaited<ReturnType<typeof getProductCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n productId: string,\n params?: GetProductChargesParams,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = useGetProductChargesSuspenseQueryOptions(productId, params, options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * Get the charges made against a Unit with optional **from** (inclusive) and **until** (exclusive) dates. If no dates are provided, the charges for the current billing period are returned.\nDates are interpreted using the Python `dateutil` parser, so the input strings are extremely flexible with, for example, `1 December 2021` as an acceptable input.\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` allowing you to obtain charges for up to two years.\n\nYou need to be part of the **Unit** or **Organisation** to use this method\n * @summary Get charges made against a Unit\n */\nexport const getUnitCharges = (\n unitId: string,\n params?: GetUnitChargesParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<UnitChargesGetResponse>(\n { url: `/charges/unit/${unitId}`, method: \"GET\", params, signal },\n options,\n );\n};\n\nexport const getGetUnitChargesQueryKey = (unitId?: string, params?: GetUnitChargesParams) => {\n return [`/charges/unit/${unitId}`, ...(params ? [params] : [])] as const;\n};\n\nexport const useGetUnitChargesQueryOptions = <\n TData = Awaited<ReturnType<typeof getUnitCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n unitId: string,\n params?: GetUnitChargesParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUnitChargesQueryKey(unitId, params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUnitCharges>>> = ({ signal }) =>\n getUnitCharges(unitId, params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseQueryOptions<\n Awaited<ReturnType<typeof getUnitCharges>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetUnitChargesQueryResult = NonNullable<Awaited<ReturnType<typeof getUnitCharges>>>;\nexport type GetUnitChargesQueryError = ErrorType<AsError | void>;\n\nexport function useGetUnitCharges<\n TData = Awaited<ReturnType<typeof getUnitCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n unitId: string,\n params: undefined | GetUnitChargesParams,\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getUnitCharges>>,\n TError,\n Awaited<ReturnType<typeof getUnitCharges>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetUnitCharges<\n TData = Awaited<ReturnType<typeof getUnitCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n unitId: string,\n params?: GetUnitChargesParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>> &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getUnitCharges>>,\n TError,\n Awaited<ReturnType<typeof getUnitCharges>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetUnitCharges<\n TData = Awaited<ReturnType<typeof getUnitCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n unitId: string,\n params?: GetUnitChargesParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Get charges made against a Unit\n */\n\nexport function useGetUnitCharges<\n TData = Awaited<ReturnType<typeof getUnitCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n unitId: string,\n params?: GetUnitChargesParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = useGetUnitChargesQueryOptions(unitId, params, options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData, TError>;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\nexport const useGetUnitChargesSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getUnitCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n unitId: string,\n params?: GetUnitChargesParams,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUnitChargesQueryKey(unitId, params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUnitCharges>>> = ({ signal }) =>\n getUnitCharges(unitId, params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getUnitCharges>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetUnitChargesSuspenseQueryResult = NonNullable<\n Awaited<ReturnType<typeof getUnitCharges>>\n>;\nexport type GetUnitChargesSuspenseQueryError = ErrorType<AsError | void>;\n\nexport function useGetUnitChargesSuspense<\n TData = Awaited<ReturnType<typeof getUnitCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n unitId: string,\n params: undefined | GetUnitChargesParams,\n options: {\n query: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetUnitChargesSuspense<\n TData = Awaited<ReturnType<typeof getUnitCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n unitId: string,\n params?: GetUnitChargesParams,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetUnitChargesSuspense<\n TData = Awaited<ReturnType<typeof getUnitCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n unitId: string,\n params?: GetUnitChargesParams,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Get charges made against a Unit\n */\n\nexport function useGetUnitChargesSuspense<\n TData = Awaited<ReturnType<typeof getUnitCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n unitId: string,\n params?: GetUnitChargesParams,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = useGetUnitChargesSuspenseQueryOptions(unitId, params, options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAkDA,MAAa,cACX,QACA,SACA,WACG;AACH,QAAO,eACL;EAAE,KAAK;EAAY,QAAQ;EAAO;EAAQ;EAAQ,EAClD,QACD;;AAGH,MAAa,yBAAyB,WAA8B;AAClE,QAAO,CAAC,YAAY,GAAI,SAAS,CAAC,OAAO,GAAG,EAAE,CAAE;;AAGlD,MAAa,6BAIX,QACA,YAIG;CACH,MAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,EAAE;CAEtE,MAAM,WAAW,cAAc,YAAY,sBAAsB,OAAO;CAExE,MAAMA,WAAkE,EAAE,aACxE,WAAW,QAAQ,gBAAgB,OAAO;AAI5C,QAFsB,aAAa;EAAE,GAAG;EAAc;EAAU;EAAS,CAAC;;;;;AA+D5E,SAAgB,cAId,QACA,SAIA,aACgF;CAChF,MAAM,eAAe,0BAA0B,QAAQ,QAAQ;CAE/D,MAAM,QAAQ,SAAS,cAAc,YAAY;AAIjD,OAA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eAAe,sCAAsC,QAAQ,QAAQ,QAAQ;CAEnF,MAAM,QAAQ,iBAAiB,cAAc,YAAY;AAKzD,OAAM,WAAW,aAAa;AAE9B,QAAO"}
|
|
@@ -0,0 +1,230 @@
|
|
|
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/event-stream/event-stream.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 the details of the installed event stream, which includes its **protocol**, and **name**.
|
|
19
|
+
|
|
20
|
+
* @summary Gets the details of the installed event stream
|
|
21
|
+
*/
|
|
22
|
+
const getEventStreamVersion = (options, signal) => {
|
|
23
|
+
return require_custom_instance.customInstance({
|
|
24
|
+
url: `/event-stream/version`,
|
|
25
|
+
method: "GET",
|
|
26
|
+
signal
|
|
27
|
+
}, options);
|
|
28
|
+
};
|
|
29
|
+
const getGetEventStreamVersionQueryKey = () => {
|
|
30
|
+
return [`/event-stream/version`];
|
|
31
|
+
};
|
|
32
|
+
const useGetEventStreamVersionQueryOptions = (options) => {
|
|
33
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
34
|
+
const queryKey = queryOptions?.queryKey ?? getGetEventStreamVersionQueryKey();
|
|
35
|
+
const queryFn = ({ signal }) => getEventStreamVersion(requestOptions, signal);
|
|
36
|
+
return require_options_mutator.queryMutator({
|
|
37
|
+
...queryOptions,
|
|
38
|
+
queryKey,
|
|
39
|
+
queryFn
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* @summary Gets the details of the installed event stream
|
|
44
|
+
*/
|
|
45
|
+
function useGetEventStreamVersion(options, queryClient) {
|
|
46
|
+
const queryOptions = useGetEventStreamVersionQueryOptions(options);
|
|
47
|
+
const query = (0, __tanstack_react_query.useQuery)(queryOptions, queryClient);
|
|
48
|
+
query.queryKey = queryOptions.queryKey;
|
|
49
|
+
return query;
|
|
50
|
+
}
|
|
51
|
+
const useGetEventStreamVersionSuspenseQueryOptions = (options) => {
|
|
52
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
53
|
+
const queryKey = queryOptions?.queryKey ?? getGetEventStreamVersionQueryKey();
|
|
54
|
+
const queryFn = ({ signal }) => getEventStreamVersion(requestOptions, signal);
|
|
55
|
+
return require_options_mutator.queryMutator({
|
|
56
|
+
...queryOptions,
|
|
57
|
+
queryKey,
|
|
58
|
+
queryFn
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* @summary Gets the details of the installed event stream
|
|
63
|
+
*/
|
|
64
|
+
function useGetEventStreamVersionSuspense(options, queryClient) {
|
|
65
|
+
const queryOptions = useGetEventStreamVersionSuspenseQueryOptions(options);
|
|
66
|
+
const query = (0, __tanstack_react_query.useSuspenseQuery)(queryOptions, queryClient);
|
|
67
|
+
query.queryKey = queryOptions.queryKey;
|
|
68
|
+
return query;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Gets the details of your event stream, if you have created one. The response includes the event stream **id** and the **location** where events can be accessed.
|
|
72
|
+
|
|
73
|
+
* @summary Gets the details of your event stream
|
|
74
|
+
*/
|
|
75
|
+
const getEventStream = (options, signal) => {
|
|
76
|
+
return require_custom_instance.customInstance({
|
|
77
|
+
url: `/event-stream`,
|
|
78
|
+
method: "GET",
|
|
79
|
+
signal
|
|
80
|
+
}, options);
|
|
81
|
+
};
|
|
82
|
+
const getGetEventStreamQueryKey = () => {
|
|
83
|
+
return [`/event-stream`];
|
|
84
|
+
};
|
|
85
|
+
const useGetEventStreamQueryOptions = (options) => {
|
|
86
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
87
|
+
const queryKey = queryOptions?.queryKey ?? getGetEventStreamQueryKey();
|
|
88
|
+
const queryFn = ({ signal }) => getEventStream(requestOptions, signal);
|
|
89
|
+
return require_options_mutator.queryMutator({
|
|
90
|
+
...queryOptions,
|
|
91
|
+
queryKey,
|
|
92
|
+
queryFn
|
|
93
|
+
});
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* @summary Gets the details of your event stream
|
|
97
|
+
*/
|
|
98
|
+
function useGetEventStream(options, queryClient) {
|
|
99
|
+
const queryOptions = useGetEventStreamQueryOptions(options);
|
|
100
|
+
const query = (0, __tanstack_react_query.useQuery)(queryOptions, queryClient);
|
|
101
|
+
query.queryKey = queryOptions.queryKey;
|
|
102
|
+
return query;
|
|
103
|
+
}
|
|
104
|
+
const useGetEventStreamSuspenseQueryOptions = (options) => {
|
|
105
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
106
|
+
const queryKey = queryOptions?.queryKey ?? getGetEventStreamQueryKey();
|
|
107
|
+
const queryFn = ({ signal }) => getEventStream(requestOptions, signal);
|
|
108
|
+
return require_options_mutator.queryMutator({
|
|
109
|
+
...queryOptions,
|
|
110
|
+
queryKey,
|
|
111
|
+
queryFn
|
|
112
|
+
});
|
|
113
|
+
};
|
|
114
|
+
/**
|
|
115
|
+
* @summary Gets the details of your event stream
|
|
116
|
+
*/
|
|
117
|
+
function useGetEventStreamSuspense(options, queryClient) {
|
|
118
|
+
const queryOptions = useGetEventStreamSuspenseQueryOptions(options);
|
|
119
|
+
const query = (0, __tanstack_react_query.useSuspenseQuery)(queryOptions, queryClient);
|
|
120
|
+
query.queryKey = queryOptions.queryKey;
|
|
121
|
+
return query;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Creates a new event stream for the authenticated user. Event streams deliver near-real-time events to the user, typically through a long-running *Socket*. The protocol is dependent on the Event Stream Service that has been installed. Our **Python FastAPI WebSocket** service is one such service.
|
|
125
|
+
|
|
126
|
+
Events are delivered to the client using the a `format` chosen here. Internally, events are **Protocol Buffer** objects that are delivered, by default as a single-line string using `MessageToString`. This is the `PROTOCOL_STRING` format. Clients can choose to receive messages as a JSON string using the format `JSON_STRING`. Using JSON strings will incur a small processing penalty but they are useful if the client does not have access to a library that can decode protocol buffer strings.
|
|
127
|
+
|
|
128
|
+
The response will include the event stream **id** and the **location** where events can be accessed.
|
|
129
|
+
|
|
130
|
+
The event streaming service is an optional component of the Account Server. If a service is not installed you will receive a corresponding **404** error response.
|
|
131
|
+
|
|
132
|
+
A user is only permitted one event stream.
|
|
133
|
+
|
|
134
|
+
* @summary Create a new event stream
|
|
135
|
+
*/
|
|
136
|
+
const createEventStream = (eventStreamPostBodyBody, options, signal) => {
|
|
137
|
+
return require_custom_instance.customInstance({
|
|
138
|
+
url: `/event-stream`,
|
|
139
|
+
method: "POST",
|
|
140
|
+
headers: { "Content-Type": "application/json" },
|
|
141
|
+
data: eventStreamPostBodyBody,
|
|
142
|
+
signal
|
|
143
|
+
}, options);
|
|
144
|
+
};
|
|
145
|
+
const useCreateEventStreamMutationOptions = (options) => {
|
|
146
|
+
const mutationKey = ["createEventStream"];
|
|
147
|
+
const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : {
|
|
148
|
+
...options,
|
|
149
|
+
mutation: {
|
|
150
|
+
...options.mutation,
|
|
151
|
+
mutationKey
|
|
152
|
+
}
|
|
153
|
+
} : {
|
|
154
|
+
mutation: { mutationKey },
|
|
155
|
+
request: void 0
|
|
156
|
+
};
|
|
157
|
+
const mutationFn = (props) => {
|
|
158
|
+
const { data } = props ?? {};
|
|
159
|
+
return createEventStream(data, requestOptions);
|
|
160
|
+
};
|
|
161
|
+
return require_options_mutator.mutationMutator({
|
|
162
|
+
...mutationOptions,
|
|
163
|
+
mutationFn
|
|
164
|
+
});
|
|
165
|
+
};
|
|
166
|
+
/**
|
|
167
|
+
* @summary Create a new event stream
|
|
168
|
+
*/
|
|
169
|
+
const useCreateEventStream = (options, queryClient) => {
|
|
170
|
+
return (0, __tanstack_react_query.useMutation)(useCreateEventStreamMutationOptions(options), queryClient);
|
|
171
|
+
};
|
|
172
|
+
/**
|
|
173
|
+
* You must be the user who created the event stream.
|
|
174
|
+
|
|
175
|
+
* @summary Deletes an existing event stream (that you created)
|
|
176
|
+
*/
|
|
177
|
+
const deleteEventStream = (eventStreamId, options) => {
|
|
178
|
+
return require_custom_instance.customInstance({
|
|
179
|
+
url: `/event-stream/${eventStreamId}`,
|
|
180
|
+
method: "DELETE"
|
|
181
|
+
}, options);
|
|
182
|
+
};
|
|
183
|
+
const useDeleteEventStreamMutationOptions = (options) => {
|
|
184
|
+
const mutationKey = ["deleteEventStream"];
|
|
185
|
+
const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : {
|
|
186
|
+
...options,
|
|
187
|
+
mutation: {
|
|
188
|
+
...options.mutation,
|
|
189
|
+
mutationKey
|
|
190
|
+
}
|
|
191
|
+
} : {
|
|
192
|
+
mutation: { mutationKey },
|
|
193
|
+
request: void 0
|
|
194
|
+
};
|
|
195
|
+
const mutationFn = (props) => {
|
|
196
|
+
const { eventStreamId } = props ?? {};
|
|
197
|
+
return deleteEventStream(eventStreamId, requestOptions);
|
|
198
|
+
};
|
|
199
|
+
return require_options_mutator.mutationMutator({
|
|
200
|
+
...mutationOptions,
|
|
201
|
+
mutationFn
|
|
202
|
+
});
|
|
203
|
+
};
|
|
204
|
+
/**
|
|
205
|
+
* @summary Deletes an existing event stream (that you created)
|
|
206
|
+
*/
|
|
207
|
+
const useDeleteEventStream = (options, queryClient) => {
|
|
208
|
+
return (0, __tanstack_react_query.useMutation)(useDeleteEventStreamMutationOptions(options), queryClient);
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
//#endregion
|
|
212
|
+
exports.createEventStream = createEventStream;
|
|
213
|
+
exports.deleteEventStream = deleteEventStream;
|
|
214
|
+
exports.getEventStream = getEventStream;
|
|
215
|
+
exports.getEventStreamVersion = getEventStreamVersion;
|
|
216
|
+
exports.getGetEventStreamQueryKey = getGetEventStreamQueryKey;
|
|
217
|
+
exports.getGetEventStreamVersionQueryKey = getGetEventStreamVersionQueryKey;
|
|
218
|
+
exports.useCreateEventStream = useCreateEventStream;
|
|
219
|
+
exports.useCreateEventStreamMutationOptions = useCreateEventStreamMutationOptions;
|
|
220
|
+
exports.useDeleteEventStream = useDeleteEventStream;
|
|
221
|
+
exports.useDeleteEventStreamMutationOptions = useDeleteEventStreamMutationOptions;
|
|
222
|
+
exports.useGetEventStream = useGetEventStream;
|
|
223
|
+
exports.useGetEventStreamQueryOptions = useGetEventStreamQueryOptions;
|
|
224
|
+
exports.useGetEventStreamSuspense = useGetEventStreamSuspense;
|
|
225
|
+
exports.useGetEventStreamSuspenseQueryOptions = useGetEventStreamSuspenseQueryOptions;
|
|
226
|
+
exports.useGetEventStreamVersion = useGetEventStreamVersion;
|
|
227
|
+
exports.useGetEventStreamVersionQueryOptions = useGetEventStreamVersionQueryOptions;
|
|
228
|
+
exports.useGetEventStreamVersionSuspense = useGetEventStreamVersionSuspense;
|
|
229
|
+
exports.useGetEventStreamVersionSuspenseQueryOptions = useGetEventStreamVersionSuspenseQueryOptions;
|
|
230
|
+
//# sourceMappingURL=event-stream.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-stream.cjs","names":["customInstance","queryFn: QueryFunction<Awaited<ReturnType<typeof getEventStreamVersion>>>","queryMutator","queryFn: QueryFunction<Awaited<ReturnType<typeof getEventStream>>>","mutationFn: MutationFunction<\n Awaited<ReturnType<typeof createEventStream>>,\n { data: EventStreamPostBodyBody }\n >","mutationMutator","mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteEventStream>>,\n { eventStreamId: number }\n >"],"sources":["../../../src/api/event-stream/event-stream.ts"],"sourcesContent":["/**\n * Generated by orval v7.16.1 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Organisations**, **Units**, **Products**, **Users**, and **Assets**.\n\n * OpenAPI spec version: 4.4\n */\nimport { useMutation, useQuery, useSuspenseQuery } from \"@tanstack/react-query\";\nimport type {\n DataTag,\n DefinedInitialDataOptions,\n DefinedUseQueryResult,\n MutationFunction,\n QueryClient,\n QueryFunction,\n QueryKey,\n UndefinedInitialDataOptions,\n UseMutationOptions,\n UseMutationResult,\n UseQueryOptions,\n UseQueryResult,\n UseSuspenseQueryOptions,\n UseSuspenseQueryResult,\n} from \"@tanstack/react-query\";\n\nimport type {\n AsError,\n EventStreamGetPostResponse,\n EventStreamPostBodyBody,\n EventStreamVersionGetResponse,\n} from \"../api.schemas\";\n\nimport { customInstance } from \"../../custom-instance\";\nimport type { ErrorType } from \"../../custom-instance\";\nimport { queryMutator } from \"../../options-mutator\";\nimport { mutationMutator } from \"../../options-mutator\";\n\ntype SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];\n\n/**\n * Gets the details of the installed event stream, which includes its **protocol**, and **name**.\n\n * @summary Gets the details of the installed event stream\n */\nexport const getEventStreamVersion = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<EventStreamVersionGetResponse>(\n { url: `/event-stream/version`, method: \"GET\", signal },\n options,\n );\n};\n\nexport const getGetEventStreamVersionQueryKey = () => {\n return [`/event-stream/version`] as const;\n};\n\nexport const useGetEventStreamVersionQueryOptions = <\n TData = Awaited<ReturnType<typeof getEventStreamVersion>>,\n TError = ErrorType<void | AsError>,\n>(options?: {\n query?: Partial<\n UseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetEventStreamVersionQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getEventStreamVersion>>> = ({ signal }) =>\n getEventStreamVersion(requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseQueryOptions<\n Awaited<ReturnType<typeof getEventStreamVersion>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetEventStreamVersionQueryResult = NonNullable<\n Awaited<ReturnType<typeof getEventStreamVersion>>\n>;\nexport type GetEventStreamVersionQueryError = ErrorType<void | AsError>;\n\nexport function useGetEventStreamVersion<\n TData = Awaited<ReturnType<typeof getEventStreamVersion>>,\n TError = ErrorType<void | AsError>,\n>(\n options: {\n query: Partial<\n UseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>\n > &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getEventStreamVersion>>,\n TError,\n Awaited<ReturnType<typeof getEventStreamVersion>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetEventStreamVersion<\n TData = Awaited<ReturnType<typeof getEventStreamVersion>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>\n > &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getEventStreamVersion>>,\n TError,\n Awaited<ReturnType<typeof getEventStreamVersion>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetEventStreamVersion<\n TData = Awaited<ReturnType<typeof getEventStreamVersion>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Gets the details of the installed event stream\n */\n\nexport function useGetEventStreamVersion<\n TData = Awaited<ReturnType<typeof getEventStreamVersion>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = useGetEventStreamVersionQueryOptions(options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData, TError>;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\nexport const useGetEventStreamVersionSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getEventStreamVersion>>,\n TError = ErrorType<void | AsError>,\n>(options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetEventStreamVersionQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getEventStreamVersion>>> = ({ signal }) =>\n getEventStreamVersion(requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getEventStreamVersion>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetEventStreamVersionSuspenseQueryResult = NonNullable<\n Awaited<ReturnType<typeof getEventStreamVersion>>\n>;\nexport type GetEventStreamVersionSuspenseQueryError = ErrorType<void | AsError>;\n\nexport function useGetEventStreamVersionSuspense<\n TData = Awaited<ReturnType<typeof getEventStreamVersion>>,\n TError = ErrorType<void | AsError>,\n>(\n options: {\n query: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetEventStreamVersionSuspense<\n TData = Awaited<ReturnType<typeof getEventStreamVersion>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetEventStreamVersionSuspense<\n TData = Awaited<ReturnType<typeof getEventStreamVersion>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Gets the details of the installed event stream\n */\n\nexport function useGetEventStreamVersionSuspense<\n TData = Awaited<ReturnType<typeof getEventStreamVersion>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = useGetEventStreamVersionSuspenseQueryOptions(options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * Gets the details of your event stream, if you have created one. The response includes the event stream **id** and the **location** where events can be accessed.\n\n * @summary Gets the details of your event stream\n */\nexport const getEventStream = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<EventStreamGetPostResponse>(\n { url: `/event-stream`, method: \"GET\", signal },\n options,\n );\n};\n\nexport const getGetEventStreamQueryKey = () => {\n return [`/event-stream`] as const;\n};\n\nexport const useGetEventStreamQueryOptions = <\n TData = Awaited<ReturnType<typeof getEventStream>>,\n TError = ErrorType<void | AsError>,\n>(options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetEventStreamQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getEventStream>>> = ({ signal }) =>\n getEventStream(requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseQueryOptions<\n Awaited<ReturnType<typeof getEventStream>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetEventStreamQueryResult = NonNullable<Awaited<ReturnType<typeof getEventStream>>>;\nexport type GetEventStreamQueryError = ErrorType<void | AsError>;\n\nexport function useGetEventStream<\n TData = Awaited<ReturnType<typeof getEventStream>>,\n TError = ErrorType<void | AsError>,\n>(\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getEventStream>>,\n TError,\n Awaited<ReturnType<typeof getEventStream>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetEventStream<\n TData = Awaited<ReturnType<typeof getEventStream>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>> &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getEventStream>>,\n TError,\n Awaited<ReturnType<typeof getEventStream>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetEventStream<\n TData = Awaited<ReturnType<typeof getEventStream>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Gets the details of your event stream\n */\n\nexport function useGetEventStream<\n TData = Awaited<ReturnType<typeof getEventStream>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = useGetEventStreamQueryOptions(options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData, TError>;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\nexport const useGetEventStreamSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getEventStream>>,\n TError = ErrorType<void | AsError>,\n>(options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetEventStreamQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getEventStream>>> = ({ signal }) =>\n getEventStream(requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getEventStream>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetEventStreamSuspenseQueryResult = NonNullable<\n Awaited<ReturnType<typeof getEventStream>>\n>;\nexport type GetEventStreamSuspenseQueryError = ErrorType<void | AsError>;\n\nexport function useGetEventStreamSuspense<\n TData = Awaited<ReturnType<typeof getEventStream>>,\n TError = ErrorType<void | AsError>,\n>(\n options: {\n query: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetEventStreamSuspense<\n TData = Awaited<ReturnType<typeof getEventStream>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetEventStreamSuspense<\n TData = Awaited<ReturnType<typeof getEventStream>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Gets the details of your event stream\n */\n\nexport function useGetEventStreamSuspense<\n TData = Awaited<ReturnType<typeof getEventStream>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = useGetEventStreamSuspenseQueryOptions(options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * Creates a new event stream for the authenticated user. Event streams deliver near-real-time events to the user, typically through a long-running *Socket*. The protocol is dependent on the Event Stream Service that has been installed. Our **Python FastAPI WebSocket** service is one such service.\n\nEvents are delivered to the client using the a `format` chosen here. Internally, events are **Protocol Buffer** objects that are delivered, by default as a single-line string using `MessageToString`. This is the `PROTOCOL_STRING` format. Clients can choose to receive messages as a JSON string using the format `JSON_STRING`. Using JSON strings will incur a small processing penalty but they are useful if the client does not have access to a library that can decode protocol buffer strings.\n\nThe response will include the event stream **id** and the **location** where events can be accessed.\n\nThe event streaming service is an optional component of the Account Server. If a service is not installed you will receive a corresponding **404** error response.\n\nA user is only permitted one event stream.\n\n * @summary Create a new event stream\n */\nexport const createEventStream = (\n eventStreamPostBodyBody: EventStreamPostBodyBody,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<EventStreamGetPostResponse>(\n {\n url: `/event-stream`,\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n data: eventStreamPostBodyBody,\n signal,\n },\n options,\n );\n};\n\nexport const useCreateEventStreamMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createEventStream>>,\n TError,\n { data: EventStreamPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof createEventStream>>,\n TError,\n { data: EventStreamPostBodyBody },\n TContext\n> => {\n const mutationKey = [\"createEventStream\"];\n const { mutation: mutationOptions, request: requestOptions } = options\n ? options.mutation && \"mutationKey\" in options.mutation && options.mutation.mutationKey\n ? options\n : { ...options, mutation: { ...options.mutation, mutationKey } }\n : { mutation: { mutationKey }, request: undefined };\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof createEventStream>>,\n { data: EventStreamPostBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return createEventStream(data, requestOptions);\n };\n\n const customOptions = mutationMutator({ ...mutationOptions, mutationFn });\n\n return customOptions;\n};\n\nexport type CreateEventStreamMutationResult = NonNullable<\n Awaited<ReturnType<typeof createEventStream>>\n>;\nexport type CreateEventStreamMutationBody = EventStreamPostBodyBody;\nexport type CreateEventStreamMutationError = ErrorType<AsError | void>;\n\n/**\n * @summary Create a new event stream\n */\nexport const useCreateEventStream = <TError = ErrorType<AsError | void>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createEventStream>>,\n TError,\n { data: EventStreamPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof createEventStream>>,\n TError,\n { data: EventStreamPostBodyBody },\n TContext\n> => {\n const mutationOptions = useCreateEventStreamMutationOptions(options);\n\n return useMutation(mutationOptions, queryClient);\n};\n/**\n * You must be the user who created the event stream.\n\n * @summary Deletes an existing event stream (that you created)\n */\nexport const deleteEventStream = (\n eventStreamId: number,\n options?: SecondParameter<typeof customInstance>,\n) => {\n return customInstance<void>({ url: `/event-stream/${eventStreamId}`, method: \"DELETE\" }, options);\n};\n\nexport const useDeleteEventStreamMutationOptions = <\n TError = ErrorType<void | AsError>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteEventStream>>,\n TError,\n { eventStreamId: number },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof deleteEventStream>>,\n TError,\n { eventStreamId: number },\n TContext\n> => {\n const mutationKey = [\"deleteEventStream\"];\n const { mutation: mutationOptions, request: requestOptions } = options\n ? options.mutation && \"mutationKey\" in options.mutation && options.mutation.mutationKey\n ? options\n : { ...options, mutation: { ...options.mutation, mutationKey } }\n : { mutation: { mutationKey }, request: undefined };\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteEventStream>>,\n { eventStreamId: number }\n > = (props) => {\n const { eventStreamId } = props ?? {};\n\n return deleteEventStream(eventStreamId, requestOptions);\n };\n\n const customOptions = mutationMutator({ ...mutationOptions, mutationFn });\n\n return customOptions;\n};\n\nexport type DeleteEventStreamMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteEventStream>>\n>;\n\nexport type DeleteEventStreamMutationError = ErrorType<void | AsError>;\n\n/**\n * @summary Deletes an existing event stream (that you created)\n */\nexport const useDeleteEventStream = <TError = ErrorType<void | AsError>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteEventStream>>,\n TError,\n { eventStreamId: number },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof deleteEventStream>>,\n TError,\n { eventStreamId: number },\n TContext\n> => {\n const mutationOptions = useDeleteEventStreamMutationOptions(options);\n\n return useMutation(mutationOptions, queryClient);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA+CA,MAAa,yBACX,SACA,WACG;AACH,QAAOA,uCACL;EAAE,KAAK;EAAyB,QAAQ;EAAO;EAAQ,E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