@squonk/account-server-client 4.2.1 → 4.3.1
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/asset/asset.cjs +99 -126
- package/asset/asset.cjs.map +1 -1
- package/asset/asset.d.cts +99 -99
- package/asset/asset.d.ts +99 -99
- package/asset/asset.js +107 -134
- package/asset/asset.js.map +1 -1
- package/charges/charges.cjs +73 -85
- package/charges/charges.cjs.map +1 -1
- package/charges/charges.d.cts +47 -47
- package/charges/charges.d.ts +47 -47
- package/charges/charges.js +78 -90
- package/charges/charges.js.map +1 -1
- package/chunk-3WKSNKHE.js +25 -0
- package/chunk-3WKSNKHE.js.map +1 -0
- package/chunk-NY2VJJG7.cjs +25 -0
- package/chunk-NY2VJJG7.cjs.map +1 -0
- package/{chunk-TKLTUR4R.cjs → chunk-RB2KVIEK.cjs} +1 -1
- package/chunk-RB2KVIEK.cjs.map +1 -0
- package/{chunk-EBOQPVLG.js → chunk-XYDLYMQ2.js} +1 -1
- package/chunk-XYDLYMQ2.js.map +1 -0
- package/event-stream/event-stream.cjs +53 -61
- package/event-stream/event-stream.cjs.map +1 -1
- package/event-stream/event-stream.d.cts +45 -45
- package/event-stream/event-stream.d.ts +45 -45
- package/event-stream/event-stream.js +58 -66
- package/event-stream/event-stream.js.map +1 -1
- package/index.cjs +49 -57
- package/index.cjs.map +1 -1
- package/index.d.cts +796 -773
- package/index.d.ts +796 -773
- package/index.js +48 -56
- package/index.js.map +1 -1
- package/merchant/merchant.cjs +38 -45
- package/merchant/merchant.cjs.map +1 -1
- package/merchant/merchant.d.cts +25 -25
- package/merchant/merchant.d.ts +25 -25
- package/merchant/merchant.js +42 -49
- package/merchant/merchant.js.map +1 -1
- package/organisation/organisation.cjs +77 -87
- package/organisation/organisation.cjs.map +1 -1
- package/organisation/organisation.d.cts +72 -70
- package/organisation/organisation.d.ts +72 -70
- package/organisation/organisation.js +83 -93
- package/organisation/organisation.js.map +1 -1
- package/package.json +13 -16
- package/product/product.cjs +143 -153
- package/product/product.cjs.map +1 -1
- package/product/product.d.cts +100 -100
- package/product/product.d.ts +100 -100
- package/product/product.js +153 -163
- package/product/product.js.map +1 -1
- package/src/account-server-api.schemas.ts +863 -856
- package/src/asset/asset.ts +899 -634
- package/src/charges/charges.ts +822 -498
- package/src/custom-instance.ts +3 -3
- package/src/event-stream/event-stream.ts +531 -345
- package/src/index.ts +2 -2
- package/src/merchant/merchant.ts +355 -234
- package/src/options-mutator.ts +27 -0
- package/src/organisation/organisation.ts +812 -504
- package/src/product/product.ts +1373 -841
- package/src/state/state.ts +174 -127
- package/src/unit/unit.ts +1273 -603
- package/src/user/user.ts +895 -564
- package/state/state.cjs +22 -24
- package/state/state.cjs.map +1 -1
- package/state/state.d.cts +14 -14
- package/state/state.d.ts +14 -14
- package/state/state.js +24 -26
- package/state/state.js.map +1 -1
- package/unit/unit.cjs +171 -106
- package/unit/unit.cjs.map +1 -1
- package/unit/unit.d.cts +200 -90
- package/unit/unit.d.ts +200 -90
- package/unit/unit.js +179 -114
- package/unit/unit.js.map +1 -1
- package/user/user.cjs +94 -110
- package/user/user.cjs.map +1 -1
- package/user/user.d.cts +77 -77
- package/user/user.d.ts +77 -77
- package/user/user.js +101 -117
- package/user/user.js.map +1 -1
- package/chunk-EBOQPVLG.js.map +0 -1
- package/chunk-TKLTUR4R.cjs.map +0 -1
package/user/user.js
CHANGED
|
@@ -1,242 +1,226 @@
|
|
|
1
|
+
import {
|
|
2
|
+
mutationMutator,
|
|
3
|
+
queryMutator
|
|
4
|
+
} from "../chunk-3WKSNKHE.js";
|
|
1
5
|
import {
|
|
2
6
|
customInstance
|
|
3
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-XYDLYMQ2.js";
|
|
4
8
|
|
|
5
9
|
// src/user/user.ts
|
|
6
|
-
import {
|
|
7
|
-
useMutation,
|
|
8
|
-
useQuery,
|
|
9
|
-
useSuspenseQuery
|
|
10
|
-
} from "@tanstack/react-query";
|
|
10
|
+
import { useMutation, useQuery, useSuspenseQuery } from "@tanstack/react-query";
|
|
11
11
|
var getUserAccount = (options, signal) => {
|
|
12
12
|
return customInstance(
|
|
13
|
-
{
|
|
14
|
-
url: `/user/account`,
|
|
15
|
-
method: "GET",
|
|
16
|
-
signal
|
|
17
|
-
},
|
|
13
|
+
{ url: `/user/account`, method: "GET", signal },
|
|
18
14
|
options
|
|
19
15
|
);
|
|
20
16
|
};
|
|
21
17
|
var getGetUserAccountQueryKey = () => {
|
|
22
|
-
return [
|
|
18
|
+
return [`/user/account`];
|
|
23
19
|
};
|
|
24
|
-
var
|
|
20
|
+
var useGetUserAccountQueryOptions = (options) => {
|
|
25
21
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
26
|
-
const queryKey =
|
|
22
|
+
const queryKey = queryOptions?.queryKey ?? getGetUserAccountQueryKey();
|
|
27
23
|
const queryFn = ({ signal }) => getUserAccount(requestOptions, signal);
|
|
28
|
-
|
|
24
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
25
|
+
return customOptions;
|
|
29
26
|
};
|
|
30
|
-
function useGetUserAccount(options) {
|
|
31
|
-
const queryOptions =
|
|
32
|
-
const query = useQuery(queryOptions);
|
|
27
|
+
function useGetUserAccount(options, queryClient) {
|
|
28
|
+
const queryOptions = useGetUserAccountQueryOptions(options);
|
|
29
|
+
const query = useQuery(queryOptions, queryClient);
|
|
33
30
|
query.queryKey = queryOptions.queryKey;
|
|
34
31
|
return query;
|
|
35
32
|
}
|
|
36
|
-
var
|
|
33
|
+
var useGetUserAccountSuspenseQueryOptions = (options) => {
|
|
37
34
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
38
|
-
const queryKey =
|
|
35
|
+
const queryKey = queryOptions?.queryKey ?? getGetUserAccountQueryKey();
|
|
39
36
|
const queryFn = ({ signal }) => getUserAccount(requestOptions, signal);
|
|
40
|
-
|
|
37
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
38
|
+
return customOptions;
|
|
41
39
|
};
|
|
42
|
-
function useGetUserAccountSuspense(options) {
|
|
43
|
-
const queryOptions =
|
|
44
|
-
const query = useSuspenseQuery(queryOptions);
|
|
40
|
+
function useGetUserAccountSuspense(options, queryClient) {
|
|
41
|
+
const queryOptions = useGetUserAccountSuspenseQueryOptions(options);
|
|
42
|
+
const query = useSuspenseQuery(queryOptions, queryClient);
|
|
45
43
|
query.queryKey = queryOptions.queryKey;
|
|
46
44
|
return query;
|
|
47
45
|
}
|
|
48
46
|
var getOrganisationUsers = (orgId, options, signal) => {
|
|
49
47
|
return customInstance(
|
|
50
|
-
{
|
|
51
|
-
url: `/organisation/${orgId}/user`,
|
|
52
|
-
method: "GET",
|
|
53
|
-
signal
|
|
54
|
-
},
|
|
48
|
+
{ url: `/organisation/${orgId}/user`, method: "GET", signal },
|
|
55
49
|
options
|
|
56
50
|
);
|
|
57
51
|
};
|
|
58
52
|
var getGetOrganisationUsersQueryKey = (orgId) => {
|
|
59
|
-
return [
|
|
53
|
+
return [`/organisation/${orgId}/user`];
|
|
60
54
|
};
|
|
61
|
-
var
|
|
55
|
+
var useGetOrganisationUsersQueryOptions = (orgId, options) => {
|
|
62
56
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
63
|
-
const queryKey =
|
|
57
|
+
const queryKey = queryOptions?.queryKey ?? getGetOrganisationUsersQueryKey(orgId);
|
|
64
58
|
const queryFn = ({ signal }) => getOrganisationUsers(orgId, requestOptions, signal);
|
|
65
|
-
|
|
59
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
60
|
+
return customOptions;
|
|
66
61
|
};
|
|
67
|
-
function useGetOrganisationUsers(orgId, options) {
|
|
68
|
-
const queryOptions =
|
|
69
|
-
const query = useQuery(queryOptions);
|
|
62
|
+
function useGetOrganisationUsers(orgId, options, queryClient) {
|
|
63
|
+
const queryOptions = useGetOrganisationUsersQueryOptions(orgId, options);
|
|
64
|
+
const query = useQuery(queryOptions, queryClient);
|
|
70
65
|
query.queryKey = queryOptions.queryKey;
|
|
71
66
|
return query;
|
|
72
67
|
}
|
|
73
|
-
var
|
|
68
|
+
var useGetOrganisationUsersSuspenseQueryOptions = (orgId, options) => {
|
|
74
69
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
75
|
-
const queryKey =
|
|
70
|
+
const queryKey = queryOptions?.queryKey ?? getGetOrganisationUsersQueryKey(orgId);
|
|
76
71
|
const queryFn = ({ signal }) => getOrganisationUsers(orgId, requestOptions, signal);
|
|
77
|
-
|
|
72
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
73
|
+
return customOptions;
|
|
78
74
|
};
|
|
79
|
-
function useGetOrganisationUsersSuspense(orgId, options) {
|
|
80
|
-
const queryOptions =
|
|
81
|
-
const query = useSuspenseQuery(queryOptions);
|
|
75
|
+
function useGetOrganisationUsersSuspense(orgId, options, queryClient) {
|
|
76
|
+
const queryOptions = useGetOrganisationUsersSuspenseQueryOptions(orgId, options);
|
|
77
|
+
const query = useSuspenseQuery(queryOptions, queryClient);
|
|
82
78
|
query.queryKey = queryOptions.queryKey;
|
|
83
79
|
return query;
|
|
84
80
|
}
|
|
85
81
|
var addOrganisationUser = (orgId, userId, options) => {
|
|
86
82
|
return customInstance(
|
|
87
|
-
{
|
|
88
|
-
url: `/organisation/${orgId}/user/${userId}`,
|
|
89
|
-
method: "PUT"
|
|
90
|
-
},
|
|
83
|
+
{ url: `/organisation/${orgId}/user/${userId}`, method: "PUT" },
|
|
91
84
|
options
|
|
92
85
|
);
|
|
93
86
|
};
|
|
94
|
-
var
|
|
87
|
+
var useAddOrganisationUserMutationOptions = (options) => {
|
|
95
88
|
const mutationKey = ["addOrganisationUser"];
|
|
96
89
|
const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey }, request: void 0 };
|
|
97
90
|
const mutationFn = (props) => {
|
|
98
91
|
const { orgId, userId } = props ?? {};
|
|
99
92
|
return addOrganisationUser(orgId, userId, requestOptions);
|
|
100
93
|
};
|
|
101
|
-
|
|
94
|
+
const customOptions = mutationMutator({ ...mutationOptions, mutationFn });
|
|
95
|
+
return customOptions;
|
|
102
96
|
};
|
|
103
|
-
var useAddOrganisationUser = (options) => {
|
|
104
|
-
const mutationOptions =
|
|
105
|
-
return useMutation(mutationOptions);
|
|
97
|
+
var useAddOrganisationUser = (options, queryClient) => {
|
|
98
|
+
const mutationOptions = useAddOrganisationUserMutationOptions(options);
|
|
99
|
+
return useMutation(mutationOptions, queryClient);
|
|
106
100
|
};
|
|
107
101
|
var deleteOrganisationUser = (orgId, userId, options) => {
|
|
108
102
|
return customInstance(
|
|
109
|
-
{
|
|
110
|
-
url: `/organisation/${orgId}/user/${userId}`,
|
|
111
|
-
method: "DELETE"
|
|
112
|
-
},
|
|
103
|
+
{ url: `/organisation/${orgId}/user/${userId}`, method: "DELETE" },
|
|
113
104
|
options
|
|
114
105
|
);
|
|
115
106
|
};
|
|
116
|
-
var
|
|
107
|
+
var useDeleteOrganisationUserMutationOptions = (options) => {
|
|
117
108
|
const mutationKey = ["deleteOrganisationUser"];
|
|
118
109
|
const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey }, request: void 0 };
|
|
119
110
|
const mutationFn = (props) => {
|
|
120
111
|
const { orgId, userId } = props ?? {};
|
|
121
112
|
return deleteOrganisationUser(orgId, userId, requestOptions);
|
|
122
113
|
};
|
|
123
|
-
|
|
114
|
+
const customOptions = mutationMutator({ ...mutationOptions, mutationFn });
|
|
115
|
+
return customOptions;
|
|
124
116
|
};
|
|
125
|
-
var useDeleteOrganisationUser = (options) => {
|
|
126
|
-
const mutationOptions =
|
|
127
|
-
return useMutation(mutationOptions);
|
|
117
|
+
var useDeleteOrganisationUser = (options, queryClient) => {
|
|
118
|
+
const mutationOptions = useDeleteOrganisationUserMutationOptions(options);
|
|
119
|
+
return useMutation(mutationOptions, queryClient);
|
|
128
120
|
};
|
|
129
121
|
var getOrganisationUnitUsers = (unitId, options, signal) => {
|
|
130
122
|
return customInstance(
|
|
131
|
-
{
|
|
132
|
-
url: `/unit/${unitId}/user`,
|
|
133
|
-
method: "GET",
|
|
134
|
-
signal
|
|
135
|
-
},
|
|
123
|
+
{ url: `/unit/${unitId}/user`, method: "GET", signal },
|
|
136
124
|
options
|
|
137
125
|
);
|
|
138
126
|
};
|
|
139
127
|
var getGetOrganisationUnitUsersQueryKey = (unitId) => {
|
|
140
|
-
return [
|
|
128
|
+
return [`/unit/${unitId}/user`];
|
|
141
129
|
};
|
|
142
|
-
var
|
|
130
|
+
var useGetOrganisationUnitUsersQueryOptions = (unitId, options) => {
|
|
143
131
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
144
|
-
const queryKey =
|
|
145
|
-
const queryFn = ({
|
|
146
|
-
|
|
147
|
-
};
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
132
|
+
const queryKey = queryOptions?.queryKey ?? getGetOrganisationUnitUsersQueryKey(unitId);
|
|
133
|
+
const queryFn = ({
|
|
134
|
+
signal
|
|
135
|
+
}) => getOrganisationUnitUsers(unitId, requestOptions, signal);
|
|
136
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
137
|
+
return customOptions;
|
|
138
|
+
};
|
|
139
|
+
function useGetOrganisationUnitUsers(unitId, options, queryClient) {
|
|
140
|
+
const queryOptions = useGetOrganisationUnitUsersQueryOptions(unitId, options);
|
|
141
|
+
const query = useQuery(queryOptions, queryClient);
|
|
151
142
|
query.queryKey = queryOptions.queryKey;
|
|
152
143
|
return query;
|
|
153
144
|
}
|
|
154
|
-
var
|
|
145
|
+
var useGetOrganisationUnitUsersSuspenseQueryOptions = (unitId, options) => {
|
|
155
146
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
156
|
-
const queryKey =
|
|
157
|
-
const queryFn = ({
|
|
158
|
-
|
|
159
|
-
};
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
147
|
+
const queryKey = queryOptions?.queryKey ?? getGetOrganisationUnitUsersQueryKey(unitId);
|
|
148
|
+
const queryFn = ({
|
|
149
|
+
signal
|
|
150
|
+
}) => getOrganisationUnitUsers(unitId, requestOptions, signal);
|
|
151
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
152
|
+
return customOptions;
|
|
153
|
+
};
|
|
154
|
+
function useGetOrganisationUnitUsersSuspense(unitId, options, queryClient) {
|
|
155
|
+
const queryOptions = useGetOrganisationUnitUsersSuspenseQueryOptions(unitId, options);
|
|
156
|
+
const query = useSuspenseQuery(queryOptions, queryClient);
|
|
163
157
|
query.queryKey = queryOptions.queryKey;
|
|
164
158
|
return query;
|
|
165
159
|
}
|
|
166
160
|
var addOrganisationUnitUser = (unitId, userId, options) => {
|
|
167
|
-
return customInstance(
|
|
168
|
-
{
|
|
169
|
-
url: `/unit/${unitId}/user/${userId}`,
|
|
170
|
-
method: "PUT"
|
|
171
|
-
},
|
|
172
|
-
options
|
|
173
|
-
);
|
|
161
|
+
return customInstance({ url: `/unit/${unitId}/user/${userId}`, method: "PUT" }, options);
|
|
174
162
|
};
|
|
175
|
-
var
|
|
163
|
+
var useAddOrganisationUnitUserMutationOptions = (options) => {
|
|
176
164
|
const mutationKey = ["addOrganisationUnitUser"];
|
|
177
165
|
const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey }, request: void 0 };
|
|
178
166
|
const mutationFn = (props) => {
|
|
179
167
|
const { unitId, userId } = props ?? {};
|
|
180
168
|
return addOrganisationUnitUser(unitId, userId, requestOptions);
|
|
181
169
|
};
|
|
182
|
-
|
|
170
|
+
const customOptions = mutationMutator({ ...mutationOptions, mutationFn });
|
|
171
|
+
return customOptions;
|
|
183
172
|
};
|
|
184
|
-
var useAddOrganisationUnitUser = (options) => {
|
|
185
|
-
const mutationOptions =
|
|
186
|
-
return useMutation(mutationOptions);
|
|
173
|
+
var useAddOrganisationUnitUser = (options, queryClient) => {
|
|
174
|
+
const mutationOptions = useAddOrganisationUnitUserMutationOptions(options);
|
|
175
|
+
return useMutation(mutationOptions, queryClient);
|
|
187
176
|
};
|
|
188
177
|
var deleteOrganisationUnitUser = (unitId, userId, options) => {
|
|
189
|
-
return customInstance(
|
|
190
|
-
{
|
|
191
|
-
url: `/unit/${unitId}/user/${userId}`,
|
|
192
|
-
method: "DELETE"
|
|
193
|
-
},
|
|
194
|
-
options
|
|
195
|
-
);
|
|
178
|
+
return customInstance({ url: `/unit/${unitId}/user/${userId}`, method: "DELETE" }, options);
|
|
196
179
|
};
|
|
197
|
-
var
|
|
180
|
+
var useDeleteOrganisationUnitUserMutationOptions = (options) => {
|
|
198
181
|
const mutationKey = ["deleteOrganisationUnitUser"];
|
|
199
182
|
const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey }, request: void 0 };
|
|
200
183
|
const mutationFn = (props) => {
|
|
201
184
|
const { unitId, userId } = props ?? {};
|
|
202
185
|
return deleteOrganisationUnitUser(unitId, userId, requestOptions);
|
|
203
186
|
};
|
|
204
|
-
|
|
187
|
+
const customOptions = mutationMutator({ ...mutationOptions, mutationFn });
|
|
188
|
+
return customOptions;
|
|
205
189
|
};
|
|
206
|
-
var useDeleteOrganisationUnitUser = (options) => {
|
|
207
|
-
const mutationOptions =
|
|
208
|
-
return useMutation(mutationOptions);
|
|
190
|
+
var useDeleteOrganisationUnitUser = (options, queryClient) => {
|
|
191
|
+
const mutationOptions = useDeleteOrganisationUnitUserMutationOptions(options);
|
|
192
|
+
return useMutation(mutationOptions, queryClient);
|
|
209
193
|
};
|
|
210
194
|
export {
|
|
211
195
|
addOrganisationUnitUser,
|
|
212
196
|
addOrganisationUser,
|
|
213
197
|
deleteOrganisationUnitUser,
|
|
214
198
|
deleteOrganisationUser,
|
|
215
|
-
getAddOrganisationUnitUserMutationOptions,
|
|
216
|
-
getAddOrganisationUserMutationOptions,
|
|
217
|
-
getDeleteOrganisationUnitUserMutationOptions,
|
|
218
|
-
getDeleteOrganisationUserMutationOptions,
|
|
219
199
|
getGetOrganisationUnitUsersQueryKey,
|
|
220
|
-
getGetOrganisationUnitUsersQueryOptions,
|
|
221
|
-
getGetOrganisationUnitUsersSuspenseQueryOptions,
|
|
222
200
|
getGetOrganisationUsersQueryKey,
|
|
223
|
-
getGetOrganisationUsersQueryOptions,
|
|
224
|
-
getGetOrganisationUsersSuspenseQueryOptions,
|
|
225
201
|
getGetUserAccountQueryKey,
|
|
226
|
-
getGetUserAccountQueryOptions,
|
|
227
|
-
getGetUserAccountSuspenseQueryOptions,
|
|
228
202
|
getOrganisationUnitUsers,
|
|
229
203
|
getOrganisationUsers,
|
|
230
204
|
getUserAccount,
|
|
231
205
|
useAddOrganisationUnitUser,
|
|
206
|
+
useAddOrganisationUnitUserMutationOptions,
|
|
232
207
|
useAddOrganisationUser,
|
|
208
|
+
useAddOrganisationUserMutationOptions,
|
|
233
209
|
useDeleteOrganisationUnitUser,
|
|
210
|
+
useDeleteOrganisationUnitUserMutationOptions,
|
|
234
211
|
useDeleteOrganisationUser,
|
|
212
|
+
useDeleteOrganisationUserMutationOptions,
|
|
235
213
|
useGetOrganisationUnitUsers,
|
|
214
|
+
useGetOrganisationUnitUsersQueryOptions,
|
|
236
215
|
useGetOrganisationUnitUsersSuspense,
|
|
216
|
+
useGetOrganisationUnitUsersSuspenseQueryOptions,
|
|
237
217
|
useGetOrganisationUsers,
|
|
218
|
+
useGetOrganisationUsersQueryOptions,
|
|
238
219
|
useGetOrganisationUsersSuspense,
|
|
220
|
+
useGetOrganisationUsersSuspenseQueryOptions,
|
|
239
221
|
useGetUserAccount,
|
|
240
|
-
|
|
222
|
+
useGetUserAccountQueryOptions,
|
|
223
|
+
useGetUserAccountSuspense,
|
|
224
|
+
useGetUserAccountSuspenseQueryOptions
|
|
241
225
|
};
|
|
242
226
|
//# sourceMappingURL=user.js.map
|
package/user/user.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/user/user.ts"],"sourcesContent":["// @ts-nocheck\n/**\n * Generated by orval v7.4.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.2\n */\nimport {\n useMutation,\n useQuery,\n useSuspenseQuery\n} from '@tanstack/react-query'\nimport type {\n DataTag,\n DefinedInitialDataOptions,\n DefinedUseQueryResult,\n MutationFunction,\n QueryFunction,\n QueryKey,\n UndefinedInitialDataOptions,\n UseMutationOptions,\n UseMutationResult,\n UseQueryOptions,\n UseQueryResult,\n UseSuspenseQueryOptions,\n UseSuspenseQueryResult\n} from '@tanstack/react-query'\nimport type {\n AsError,\n UserAccountDetail,\n UsersGetResponse\n} from '../account-server-api.schemas'\nimport { customInstance } from '.././custom-instance';\nimport type { ErrorType } from '.././custom-instance';\n\n\ntype SecondParameter<T extends (...args: any) => any> = Parameters<T>[1];\n\n\n/**\n * Returns a summary of your account\n\n * @summary Get information about your account\n */\nexport const getUserAccount = (\n \n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<UserAccountDetail>(\n {url: `/user/account`, method: 'GET', signal\n },\n options);\n }\n \n\nexport const getGetUserAccountQueryKey = () => {\n return [\"account-server-api\", `/user/account`] as const;\n }\n\n \nexport const getGetUserAccountQueryOptions = <TData = Awaited<ReturnType<typeof getUserAccount>>, TError = ErrorType<void | AsError>>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUserAccountQueryKey();\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUserAccount>>> = ({ signal }) => getUserAccount(requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type GetUserAccountQueryResult = NonNullable<Awaited<ReturnType<typeof getUserAccount>>>\nexport type GetUserAccountQueryError = ErrorType<void | AsError>\n\n\nexport function useGetUserAccount<TData = Awaited<ReturnType<typeof getUserAccount>>, TError = ErrorType<void | AsError>>(\n options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getUserAccount>>,\n TError,\n TData\n > , 'initialData'\n >, request?: SecondParameter<typeof customInstance>}\n\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useGetUserAccount<TData = Awaited<ReturnType<typeof getUserAccount>>, TError = ErrorType<void | AsError>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getUserAccount>>,\n TError,\n TData\n > , 'initialData'\n >, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useGetUserAccount<TData = Awaited<ReturnType<typeof getUserAccount>>, TError = ErrorType<void | AsError>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary Get information about your account\n */\n\nexport function useGetUserAccount<TData = Awaited<ReturnType<typeof getUserAccount>>, TError = ErrorType<void | AsError>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getGetUserAccountQueryOptions(options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\nexport const getGetUserAccountSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getUserAccount>>, TError = ErrorType<void | AsError>>( options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUserAccountQueryKey();\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUserAccount>>> = ({ signal }) => getUserAccount(requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type GetUserAccountSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getUserAccount>>>\nexport type GetUserAccountSuspenseQueryError = ErrorType<void | AsError>\n\n\nexport function useGetUserAccountSuspense<TData = Awaited<ReturnType<typeof getUserAccount>>, TError = ErrorType<void | AsError>>(\n options: { query:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useGetUserAccountSuspense<TData = Awaited<ReturnType<typeof getUserAccount>>, TError = ErrorType<void | AsError>>(\n options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useGetUserAccountSuspense<TData = Awaited<ReturnType<typeof getUserAccount>>, TError = ErrorType<void | AsError>>(\n options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary Get information about your account\n */\n\nexport function useGetUserAccountSuspense<TData = Awaited<ReturnType<typeof getUserAccount>>, TError = ErrorType<void | AsError>>(\n options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getGetUserAccountSuspenseQueryOptions(options)\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * Gets Users in an Organisation.\n\nYou have to be a member of the Organisation or an admin user to use this endpoint\n\n**WARNING**: This endpoint is **DEPRECATED** and will be removed in a future release. Please use the `GET /organisation/{org_id}` endpoint instead.\n\n * @summary Gets users in an Organisation\n */\nexport const getOrganisationUsers = (\n orgId: string,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<UsersGetResponse>(\n {url: `/organisation/${orgId}/user`, method: 'GET', signal\n },\n options);\n }\n \n\nexport const getGetOrganisationUsersQueryKey = (orgId: string,) => {\n return [\"account-server-api\", `/organisation/${orgId}/user`] as const;\n }\n\n \nexport const getGetOrganisationUsersQueryOptions = <TData = Awaited<ReturnType<typeof getOrganisationUsers>>, TError = ErrorType<AsError | void>>(orgId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetOrganisationUsersQueryKey(orgId);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisationUsers>>> = ({ signal }) => getOrganisationUsers(orgId, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(orgId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type GetOrganisationUsersQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisationUsers>>>\nexport type GetOrganisationUsersQueryError = ErrorType<AsError | void>\n\n\nexport function useGetOrganisationUsers<TData = Awaited<ReturnType<typeof getOrganisationUsers>>, TError = ErrorType<AsError | void>>(\n orgId: string, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getOrganisationUsers>>,\n TError,\n TData\n > , 'initialData'\n >, request?: SecondParameter<typeof customInstance>}\n\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useGetOrganisationUsers<TData = Awaited<ReturnType<typeof getOrganisationUsers>>, TError = ErrorType<AsError | void>>(\n orgId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getOrganisationUsers>>,\n TError,\n TData\n > , 'initialData'\n >, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useGetOrganisationUsers<TData = Awaited<ReturnType<typeof getOrganisationUsers>>, TError = ErrorType<AsError | void>>(\n orgId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary Gets users in an Organisation\n */\n\nexport function useGetOrganisationUsers<TData = Awaited<ReturnType<typeof getOrganisationUsers>>, TError = ErrorType<AsError | void>>(\n orgId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getGetOrganisationUsersQueryOptions(orgId,options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\nexport const getGetOrganisationUsersSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getOrganisationUsers>>, TError = ErrorType<AsError | void>>(orgId: string, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetOrganisationUsersQueryKey(orgId);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisationUsers>>> = ({ signal }) => getOrganisationUsers(orgId, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type GetOrganisationUsersSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisationUsers>>>\nexport type GetOrganisationUsersSuspenseQueryError = ErrorType<AsError | void>\n\n\nexport function useGetOrganisationUsersSuspense<TData = Awaited<ReturnType<typeof getOrganisationUsers>>, TError = ErrorType<AsError | void>>(\n orgId: string, options: { query:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useGetOrganisationUsersSuspense<TData = Awaited<ReturnType<typeof getOrganisationUsers>>, TError = ErrorType<AsError | void>>(\n orgId: string, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useGetOrganisationUsersSuspense<TData = Awaited<ReturnType<typeof getOrganisationUsers>>, TError = ErrorType<AsError | void>>(\n orgId: string, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary Gets users in an Organisation\n */\n\nexport function useGetOrganisationUsersSuspense<TData = Awaited<ReturnType<typeof getOrganisationUsers>>, TError = ErrorType<AsError | void>>(\n orgId: string, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getGetOrganisationUsersSuspenseQueryOptions(orgId,options)\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * Adds a User to an **Organisation**.\n\nYou have to be in the Organisation or an admin user to use this endpoint\n\n * @summary Adds a User to an Organisation\n */\nexport const addOrganisationUser = (\n orgId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>,) => {\n \n \n return customInstance<void>(\n {url: `/organisation/${orgId}/user/${userId}`, method: 'PUT'\n },\n options);\n }\n \n\n\nexport const getAddOrganisationUserMutationOptions = <TData = Awaited<ReturnType<typeof addOrganisationUser>>, TError = ErrorType<AsError | void>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<TData, TError,{orgId: string;userId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\nconst mutationKey = ['addOrganisationUser'];\nconst {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 \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof addOrganisationUser>>, {orgId: string;userId: string}> = (props) => {\n const {orgId,userId} = props ?? {};\n\n return addOrganisationUser(orgId,userId,requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions } as UseMutationOptions<TData, TError,{orgId: string;userId: string}, TContext>}\n\n export type AddOrganisationUserMutationResult = NonNullable<Awaited<ReturnType<typeof addOrganisationUser>>>\n \n export type AddOrganisationUserMutationError = ErrorType<AsError | void>\n\n /**\n * @summary Adds a User to an Organisation\n */\nexport const useAddOrganisationUser = <TData = Awaited<ReturnType<typeof addOrganisationUser>>, TError = ErrorType<AsError | void>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<TData, TError,{orgId: string;userId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationResult<\n TData,\n TError,\n {orgId: string;userId: string},\n TContext\n > => {\n\n const mutationOptions = getAddOrganisationUserMutationOptions(options);\n\n return useMutation(mutationOptions);\n }\n /**\n * Removes a User from an **Organisation**.\n\nYou have to be in the Organisation or an admin user to use this endpoint\n\n * @summary Deletes a User from an Organisation\n */\nexport const deleteOrganisationUser = (\n orgId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>,) => {\n \n \n return customInstance<void>(\n {url: `/organisation/${orgId}/user/${userId}`, method: 'DELETE'\n },\n options);\n }\n \n\n\nexport const getDeleteOrganisationUserMutationOptions = <TData = Awaited<ReturnType<typeof deleteOrganisationUser>>, TError = ErrorType<AsError | void>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<TData, TError,{orgId: string;userId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\nconst mutationKey = ['deleteOrganisationUser'];\nconst {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 \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteOrganisationUser>>, {orgId: string;userId: string}> = (props) => {\n const {orgId,userId} = props ?? {};\n\n return deleteOrganisationUser(orgId,userId,requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions } as UseMutationOptions<TData, TError,{orgId: string;userId: string}, TContext>}\n\n export type DeleteOrganisationUserMutationResult = NonNullable<Awaited<ReturnType<typeof deleteOrganisationUser>>>\n \n export type DeleteOrganisationUserMutationError = ErrorType<AsError | void>\n\n /**\n * @summary Deletes a User from an Organisation\n */\nexport const useDeleteOrganisationUser = <TData = Awaited<ReturnType<typeof deleteOrganisationUser>>, TError = ErrorType<AsError | void>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<TData, TError,{orgId: string;userId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationResult<\n TData,\n TError,\n {orgId: string;userId: string},\n TContext\n > => {\n\n const mutationOptions = getDeleteOrganisationUserMutationOptions(options);\n\n return useMutation(mutationOptions);\n }\n /**\n * Gets users in an Organisational Unit.\n\nYou have to be in the Organisation or Unit or an Admin user to use this endpoint\n\n**WARNING**: This endpoint is **DEPRECATED** and will be removed in a future release. Please use the `GET /unit/{unit_id}` endpoint instead.\n\n * @summary Gets users in an Organisational Unit\n */\nexport const getOrganisationUnitUsers = (\n unitId: string,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<UsersGetResponse>(\n {url: `/unit/${unitId}/user`, method: 'GET', signal\n },\n options);\n }\n \n\nexport const getGetOrganisationUnitUsersQueryKey = (unitId: string,) => {\n return [\"account-server-api\", `/unit/${unitId}/user`] as const;\n }\n\n \nexport const getGetOrganisationUnitUsersQueryOptions = <TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError = ErrorType<AsError | void>>(unitId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetOrganisationUnitUsersQueryKey(unitId);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisationUnitUsers>>> = ({ signal }) => getOrganisationUnitUsers(unitId, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(unitId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type GetOrganisationUnitUsersQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisationUnitUsers>>>\nexport type GetOrganisationUnitUsersQueryError = ErrorType<AsError | void>\n\n\nexport function useGetOrganisationUnitUsers<TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError = ErrorType<AsError | void>>(\n unitId: string, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getOrganisationUnitUsers>>,\n TError,\n TData\n > , 'initialData'\n >, request?: SecondParameter<typeof customInstance>}\n\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useGetOrganisationUnitUsers<TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError = ErrorType<AsError | void>>(\n unitId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getOrganisationUnitUsers>>,\n TError,\n TData\n > , 'initialData'\n >, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useGetOrganisationUnitUsers<TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError = ErrorType<AsError | void>>(\n unitId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary Gets users in an Organisational Unit\n */\n\nexport function useGetOrganisationUnitUsers<TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError = ErrorType<AsError | void>>(\n unitId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getGetOrganisationUnitUsersQueryOptions(unitId,options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\nexport const getGetOrganisationUnitUsersSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError = ErrorType<AsError | void>>(unitId: string, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetOrganisationUnitUsersQueryKey(unitId);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisationUnitUsers>>> = ({ signal }) => getOrganisationUnitUsers(unitId, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type GetOrganisationUnitUsersSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisationUnitUsers>>>\nexport type GetOrganisationUnitUsersSuspenseQueryError = ErrorType<AsError | void>\n\n\nexport function useGetOrganisationUnitUsersSuspense<TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError = ErrorType<AsError | void>>(\n unitId: string, options: { query:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useGetOrganisationUnitUsersSuspense<TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError = ErrorType<AsError | void>>(\n unitId: string, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useGetOrganisationUnitUsersSuspense<TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError = ErrorType<AsError | void>>(\n unitId: string, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary Gets users in an Organisational Unit\n */\n\nexport function useGetOrganisationUnitUsersSuspense<TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError = ErrorType<AsError | void>>(\n unitId: string, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getGetOrganisationUnitUsersSuspenseQueryOptions(unitId,options)\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * Adds a user to an Organisational Unit.\n\nUsers cannot be added to **Personal Units** (Units that are part of the ***Default** Organisation).\n\nYou have to be in the Organisation or Unit or an Admin user to use this endpoint\n\n * @summary Adds a user to an Organisational Unit\n */\nexport const addOrganisationUnitUser = (\n unitId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>,) => {\n \n \n return customInstance<void>(\n {url: `/unit/${unitId}/user/${userId}`, method: 'PUT'\n },\n options);\n }\n \n\n\nexport const getAddOrganisationUnitUserMutationOptions = <TData = Awaited<ReturnType<typeof addOrganisationUnitUser>>, TError = ErrorType<AsError | void>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<TData, TError,{unitId: string;userId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\nconst mutationKey = ['addOrganisationUnitUser'];\nconst {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 \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof addOrganisationUnitUser>>, {unitId: string;userId: string}> = (props) => {\n const {unitId,userId} = props ?? {};\n\n return addOrganisationUnitUser(unitId,userId,requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions } as UseMutationOptions<TData, TError,{unitId: string;userId: string}, TContext>}\n\n export type AddOrganisationUnitUserMutationResult = NonNullable<Awaited<ReturnType<typeof addOrganisationUnitUser>>>\n \n export type AddOrganisationUnitUserMutationError = ErrorType<AsError | void>\n\n /**\n * @summary Adds a user to an Organisational Unit\n */\nexport const useAddOrganisationUnitUser = <TData = Awaited<ReturnType<typeof addOrganisationUnitUser>>, TError = ErrorType<AsError | void>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<TData, TError,{unitId: string;userId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationResult<\n TData,\n TError,\n {unitId: string;userId: string},\n TContext\n > => {\n\n const mutationOptions = getAddOrganisationUnitUserMutationOptions(options);\n\n return useMutation(mutationOptions);\n }\n /**\n * Removes a User from an Organisational Unit.\n\nUsers cannot be removed from **Personal Units** (Units that are part of the ***Default** Organisation).\n\nYou have to be in the Organisation or Unit or an Admin user to use this endpoint\n\n * @summary Deletes a User from an Organisational Unit\n */\nexport const deleteOrganisationUnitUser = (\n unitId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>,) => {\n \n \n return customInstance<void>(\n {url: `/unit/${unitId}/user/${userId}`, method: 'DELETE'\n },\n options);\n }\n \n\n\nexport const getDeleteOrganisationUnitUserMutationOptions = <TData = Awaited<ReturnType<typeof deleteOrganisationUnitUser>>, TError = ErrorType<AsError | void>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<TData, TError,{unitId: string;userId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\nconst mutationKey = ['deleteOrganisationUnitUser'];\nconst {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 \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteOrganisationUnitUser>>, {unitId: string;userId: string}> = (props) => {\n const {unitId,userId} = props ?? {};\n\n return deleteOrganisationUnitUser(unitId,userId,requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions } as UseMutationOptions<TData, TError,{unitId: string;userId: string}, TContext>}\n\n export type DeleteOrganisationUnitUserMutationResult = NonNullable<Awaited<ReturnType<typeof deleteOrganisationUnitUser>>>\n \n export type DeleteOrganisationUnitUserMutationError = ErrorType<AsError | void>\n\n /**\n * @summary Deletes a User from an Organisational Unit\n */\nexport const useDeleteOrganisationUnitUser = <TData = Awaited<ReturnType<typeof deleteOrganisationUnitUser>>, TError = ErrorType<AsError | void>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<TData, TError,{unitId: string;userId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationResult<\n TData,\n TError,\n {unitId: string;userId: string},\n TContext\n > => {\n\n const mutationOptions = getDeleteOrganisationUnitUserMutationOptions(options);\n\n return useMutation(mutationOptions);\n }\n "],"mappings":";;;;;AAWA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAiCA,IAAM,iBAAiB,CAE7B,SAAiD,WAC7C;AAGC,SAAO;AAAA,IACP;AAAA,MAAC,KAAK;AAAA,MAAiB,QAAQ;AAAA,MAAO;AAAA,IACxC;AAAA,IACE;AAAA,EAAO;AACT;AAGG,IAAM,4BAA4B,MAAM;AAC3C,SAAO,CAAC,sBAAsB,eAAe;AAC7C;AAGG,IAAM,gCAAgC,CAA0F,YAClI;AAEL,QAAM,EAAC,OAAO,cAAc,SAAS,eAAc,IAAI,WAAW,CAAC;AAEjE,QAAM,YAAY,6CAAc,aAAY,0BAA0B;AAIpE,QAAM,UAAqE,CAAC,EAAE,OAAO,MAAM,eAAe,gBAAgB,MAAM;AAMjI,SAAQ,EAAE,UAAU,SAAS,GAAG,aAAY;AAC/C;AAkCO,SAAS,kBACd,SAEmF;AAEnF,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0CAA0C,OAAO;AAEzE,SAAO,YAAY,eAAe;AACpC;AAUG,IAAM,6BAA6B,CACtC,QACA,QACH,YAAsD;AAGjD,SAAO;AAAA,IACP;AAAA,MAAC,KAAK,SAAS,MAAM,SAAS,MAAM;AAAA,MAAI,QAAQ;AAAA,IAClD;AAAA,IACE;AAAA,EAAO;AACT;AAIG,IAAM,+CAA+C,CACpC,YACnB;AACL,QAAM,cAAc,CAAC,4BAA4B;AACjD,QAAM,EAAC,UAAU,iBAAiB,SAAS,eAAc,IAAI,UACvD,QAAQ,YAAY,iBAAiB,QAAQ,YAAY,QAAQ,SAAS,cAC1E,UACE,EAAC,GAAG,SAAS,UAAU,EAAC,GAAG,QAAQ,UAAU,YAAW,EAAC,IACzD,EAAC,UAAU,EAAE,YAAa,GAAG,SAAS,OAAS;AAKjD,QAAM,aAAwH,CAAC,UAAU;AACrI,UAAM,EAAC,QAAO,OAAM,IAAI,SAAS,CAAC;AAElC,WAAQ,2BAA2B,QAAO,QAAO,cAAc;AAAA,EACjE;AAKN,SAAQ,EAAE,YAAY,GAAG,gBAAgB;AAAgF;AASpH,IAAM,gCAAgC,CACrB,YAMb;AAEL,QAAM,kBAAkB,6CAA6C,OAAO;AAE5E,SAAO,YAAY,eAAe;AACpC;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/user/user.ts"],"sourcesContent":["/**\n * Generated by orval v7.10.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Organisations**, **Units**, **Products**, **Users**, and **Assets**.\n\n * OpenAPI spec version: 4.3\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 { AsError, UserAccountDetail, UsersGetResponse } from \"../account-server-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 * Returns a summary of your account\n\n * @summary Get information about your account\n */\nexport const getUserAccount = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<UserAccountDetail>(\n { url: `/user/account`, method: \"GET\", signal },\n options,\n );\n};\n\nexport const getGetUserAccountQueryKey = () => {\n return [`/user/account`] as const;\n};\n\nexport const useGetUserAccountQueryOptions = <\n TData = Awaited<ReturnType<typeof getUserAccount>>,\n TError = ErrorType<void | AsError>,\n>(options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUserAccountQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUserAccount>>> = ({ signal }) =>\n getUserAccount(requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseQueryOptions<\n Awaited<ReturnType<typeof getUserAccount>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetUserAccountQueryResult = NonNullable<Awaited<ReturnType<typeof getUserAccount>>>;\nexport type GetUserAccountQueryError = ErrorType<void | AsError>;\n\nexport function useGetUserAccount<\n TData = Awaited<ReturnType<typeof getUserAccount>>,\n TError = ErrorType<void | AsError>,\n>(\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getUserAccount>>,\n TError,\n Awaited<ReturnType<typeof getUserAccount>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetUserAccount<\n TData = Awaited<ReturnType<typeof getUserAccount>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>> &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getUserAccount>>,\n TError,\n Awaited<ReturnType<typeof getUserAccount>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetUserAccount<\n TData = Awaited<ReturnType<typeof getUserAccount>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Get information about your account\n */\n\nexport function useGetUserAccount<\n TData = Awaited<ReturnType<typeof getUserAccount>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = useGetUserAccountQueryOptions(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 useGetUserAccountSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getUserAccount>>,\n TError = ErrorType<void | AsError>,\n>(options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUserAccountQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUserAccount>>> = ({ signal }) =>\n getUserAccount(requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getUserAccount>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetUserAccountSuspenseQueryResult = NonNullable<\n Awaited<ReturnType<typeof getUserAccount>>\n>;\nexport type GetUserAccountSuspenseQueryError = ErrorType<void | AsError>;\n\nexport function useGetUserAccountSuspense<\n TData = Awaited<ReturnType<typeof getUserAccount>>,\n TError = ErrorType<void | AsError>,\n>(\n options: {\n query: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetUserAccountSuspense<\n TData = Awaited<ReturnType<typeof getUserAccount>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetUserAccountSuspense<\n TData = Awaited<ReturnType<typeof getUserAccount>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, 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 information about your account\n */\n\nexport function useGetUserAccountSuspense<\n TData = Awaited<ReturnType<typeof getUserAccount>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = useGetUserAccountSuspenseQueryOptions(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 Users in an Organisation.\n\nYou have to be a member of the Organisation or an admin user to use this endpoint\n\n**WARNING**: This endpoint is **DEPRECATED** and will be removed in a future release. Please use the `GET /organisation/{org_id}` endpoint instead.\n\n * @summary Gets users in an Organisation\n */\nexport const getOrganisationUsers = (\n orgId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<UsersGetResponse>(\n { url: `/organisation/${orgId}/user`, method: \"GET\", signal },\n options,\n );\n};\n\nexport const getGetOrganisationUsersQueryKey = (orgId: string) => {\n return [`/organisation/${orgId}/user`] as const;\n};\n\nexport const useGetOrganisationUsersQueryOptions = <\n TData = Awaited<ReturnType<typeof getOrganisationUsers>>,\n TError = ErrorType<AsError | void>,\n>(\n orgId: string,\n options?: {\n query?: Partial<\n UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetOrganisationUsersQueryKey(orgId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisationUsers>>> = ({ signal }) =>\n getOrganisationUsers(orgId, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUsers>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetOrganisationUsersQueryResult = NonNullable<\n Awaited<ReturnType<typeof getOrganisationUsers>>\n>;\nexport type GetOrganisationUsersQueryError = ErrorType<AsError | void>;\n\nexport function useGetOrganisationUsers<\n TData = Awaited<ReturnType<typeof getOrganisationUsers>>,\n TError = ErrorType<AsError | void>,\n>(\n orgId: string,\n options: {\n query: Partial<\n UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>\n > &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getOrganisationUsers>>,\n TError,\n Awaited<ReturnType<typeof getOrganisationUsers>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetOrganisationUsers<\n TData = Awaited<ReturnType<typeof getOrganisationUsers>>,\n TError = ErrorType<AsError | void>,\n>(\n orgId: string,\n options?: {\n query?: Partial<\n UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>\n > &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getOrganisationUsers>>,\n TError,\n Awaited<ReturnType<typeof getOrganisationUsers>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetOrganisationUsers<\n TData = Awaited<ReturnType<typeof getOrganisationUsers>>,\n TError = ErrorType<AsError | void>,\n>(\n orgId: string,\n options?: {\n query?: Partial<\n UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, 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 users in an Organisation\n */\n\nexport function useGetOrganisationUsers<\n TData = Awaited<ReturnType<typeof getOrganisationUsers>>,\n TError = ErrorType<AsError | void>,\n>(\n orgId: string,\n options?: {\n query?: Partial<\n UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = useGetOrganisationUsersQueryOptions(orgId, 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 useGetOrganisationUsersSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getOrganisationUsers>>,\n TError = ErrorType<AsError | void>,\n>(\n orgId: string,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetOrganisationUsersQueryKey(orgId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisationUsers>>> = ({ signal }) =>\n getOrganisationUsers(orgId, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUsers>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetOrganisationUsersSuspenseQueryResult = NonNullable<\n Awaited<ReturnType<typeof getOrganisationUsers>>\n>;\nexport type GetOrganisationUsersSuspenseQueryError = ErrorType<AsError | void>;\n\nexport function useGetOrganisationUsersSuspense<\n TData = Awaited<ReturnType<typeof getOrganisationUsers>>,\n TError = ErrorType<AsError | void>,\n>(\n orgId: string,\n options: {\n query: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetOrganisationUsersSuspense<\n TData = Awaited<ReturnType<typeof getOrganisationUsers>>,\n TError = ErrorType<AsError | void>,\n>(\n orgId: string,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetOrganisationUsersSuspense<\n TData = Awaited<ReturnType<typeof getOrganisationUsers>>,\n TError = ErrorType<AsError | void>,\n>(\n orgId: string,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, 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 users in an Organisation\n */\n\nexport function useGetOrganisationUsersSuspense<\n TData = Awaited<ReturnType<typeof getOrganisationUsers>>,\n TError = ErrorType<AsError | void>,\n>(\n orgId: string,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = useGetOrganisationUsersSuspenseQueryOptions(orgId, 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 * Adds a User to an **Organisation**.\n\nYou have to be in the Organisation or an admin user to use this endpoint\n\n * @summary Adds a User to an Organisation\n */\nexport const addOrganisationUser = (\n orgId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>,\n) => {\n return customInstance<void>(\n { url: `/organisation/${orgId}/user/${userId}`, method: \"PUT\" },\n options,\n );\n};\n\nexport const useAddOrganisationUserMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addOrganisationUser>>,\n TError,\n { orgId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof addOrganisationUser>>,\n TError,\n { orgId: string; userId: string },\n TContext\n> => {\n const mutationKey = [\"addOrganisationUser\"];\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 addOrganisationUser>>,\n { orgId: string; userId: string }\n > = (props) => {\n const { orgId, userId } = props ?? {};\n\n return addOrganisationUser(orgId, userId, requestOptions);\n };\n\n const customOptions = mutationMutator({ ...mutationOptions, mutationFn });\n\n return customOptions;\n};\n\nexport type AddOrganisationUserMutationResult = NonNullable<\n Awaited<ReturnType<typeof addOrganisationUser>>\n>;\n\nexport type AddOrganisationUserMutationError = ErrorType<AsError | void>;\n\n/**\n * @summary Adds a User to an Organisation\n */\nexport const useAddOrganisationUser = <TError = ErrorType<AsError | void>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addOrganisationUser>>,\n TError,\n { orgId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof addOrganisationUser>>,\n TError,\n { orgId: string; userId: string },\n TContext\n> => {\n const mutationOptions = useAddOrganisationUserMutationOptions(options);\n\n return useMutation(mutationOptions, queryClient);\n};\n/**\n * Removes a User from an **Organisation**.\n\nYou have to be in the Organisation or an admin user to use this endpoint\n\n * @summary Deletes a User from an Organisation\n */\nexport const deleteOrganisationUser = (\n orgId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>,\n) => {\n return customInstance<void>(\n { url: `/organisation/${orgId}/user/${userId}`, method: \"DELETE\" },\n options,\n );\n};\n\nexport const useDeleteOrganisationUserMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteOrganisationUser>>,\n TError,\n { orgId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof deleteOrganisationUser>>,\n TError,\n { orgId: string; userId: string },\n TContext\n> => {\n const mutationKey = [\"deleteOrganisationUser\"];\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 deleteOrganisationUser>>,\n { orgId: string; userId: string }\n > = (props) => {\n const { orgId, userId } = props ?? {};\n\n return deleteOrganisationUser(orgId, userId, requestOptions);\n };\n\n const customOptions = mutationMutator({ ...mutationOptions, mutationFn });\n\n return customOptions;\n};\n\nexport type DeleteOrganisationUserMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteOrganisationUser>>\n>;\n\nexport type DeleteOrganisationUserMutationError = ErrorType<AsError | void>;\n\n/**\n * @summary Deletes a User from an Organisation\n */\nexport const useDeleteOrganisationUser = <TError = ErrorType<AsError | void>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteOrganisationUser>>,\n TError,\n { orgId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof deleteOrganisationUser>>,\n TError,\n { orgId: string; userId: string },\n TContext\n> => {\n const mutationOptions = useDeleteOrganisationUserMutationOptions(options);\n\n return useMutation(mutationOptions, queryClient);\n};\n/**\n * Gets users in an Organisational Unit.\n\nYou have to be in the Organisation or Unit or an Admin user to use this endpoint\n\n**WARNING**: This endpoint is **DEPRECATED** and will be removed in a future release. Please use the `GET /unit/{unit_id}` endpoint instead.\n\n * @summary Gets users in an Organisational Unit\n */\nexport const getOrganisationUnitUsers = (\n unitId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<UsersGetResponse>(\n { url: `/unit/${unitId}/user`, method: \"GET\", signal },\n options,\n );\n};\n\nexport const getGetOrganisationUnitUsersQueryKey = (unitId: string) => {\n return [`/unit/${unitId}/user`] as const;\n};\n\nexport const useGetOrganisationUnitUsersQueryOptions = <\n TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>,\n TError = ErrorType<AsError | void>,\n>(\n unitId: string,\n options?: {\n query?: Partial<\n UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetOrganisationUnitUsersQueryKey(unitId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisationUnitUsers>>> = ({\n signal,\n }) => getOrganisationUnitUsers(unitId, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUnitUsers>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetOrganisationUnitUsersQueryResult = NonNullable<\n Awaited<ReturnType<typeof getOrganisationUnitUsers>>\n>;\nexport type GetOrganisationUnitUsersQueryError = ErrorType<AsError | void>;\n\nexport function useGetOrganisationUnitUsers<\n TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>,\n TError = ErrorType<AsError | void>,\n>(\n unitId: string,\n options: {\n query: Partial<\n UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>\n > &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getOrganisationUnitUsers>>,\n TError,\n Awaited<ReturnType<typeof getOrganisationUnitUsers>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetOrganisationUnitUsers<\n TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>,\n TError = ErrorType<AsError | void>,\n>(\n unitId: string,\n options?: {\n query?: Partial<\n UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>\n > &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getOrganisationUnitUsers>>,\n TError,\n Awaited<ReturnType<typeof getOrganisationUnitUsers>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetOrganisationUnitUsers<\n TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>,\n TError = ErrorType<AsError | void>,\n>(\n unitId: string,\n options?: {\n query?: Partial<\n UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, 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 users in an Organisational Unit\n */\n\nexport function useGetOrganisationUnitUsers<\n TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>,\n TError = ErrorType<AsError | void>,\n>(\n unitId: string,\n options?: {\n query?: Partial<\n UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = useGetOrganisationUnitUsersQueryOptions(unitId, 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 useGetOrganisationUnitUsersSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>,\n TError = ErrorType<AsError | void>,\n>(\n unitId: string,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetOrganisationUnitUsersQueryKey(unitId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisationUnitUsers>>> = ({\n signal,\n }) => getOrganisationUnitUsers(unitId, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUnitUsers>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetOrganisationUnitUsersSuspenseQueryResult = NonNullable<\n Awaited<ReturnType<typeof getOrganisationUnitUsers>>\n>;\nexport type GetOrganisationUnitUsersSuspenseQueryError = ErrorType<AsError | void>;\n\nexport function useGetOrganisationUnitUsersSuspense<\n TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>,\n TError = ErrorType<AsError | void>,\n>(\n unitId: string,\n options: {\n query: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetOrganisationUnitUsersSuspense<\n TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>,\n TError = ErrorType<AsError | void>,\n>(\n unitId: string,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetOrganisationUnitUsersSuspense<\n TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>,\n TError = ErrorType<AsError | void>,\n>(\n unitId: string,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, 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 users in an Organisational Unit\n */\n\nexport function useGetOrganisationUnitUsersSuspense<\n TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>,\n TError = ErrorType<AsError | void>,\n>(\n unitId: string,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = useGetOrganisationUnitUsersSuspenseQueryOptions(unitId, 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 * Adds a user to an Organisational Unit.\n\nUsers cannot be added to **Personal Units** (Units that are part of the ***Default** Organisation).\n\nYou have to be in the Organisation or Unit or an Admin user to use this endpoint\n\n * @summary Adds a user to an Organisational Unit\n */\nexport const addOrganisationUnitUser = (\n unitId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>,\n) => {\n return customInstance<void>({ url: `/unit/${unitId}/user/${userId}`, method: \"PUT\" }, options);\n};\n\nexport const useAddOrganisationUnitUserMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addOrganisationUnitUser>>,\n TError,\n { unitId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof addOrganisationUnitUser>>,\n TError,\n { unitId: string; userId: string },\n TContext\n> => {\n const mutationKey = [\"addOrganisationUnitUser\"];\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 addOrganisationUnitUser>>,\n { unitId: string; userId: string }\n > = (props) => {\n const { unitId, userId } = props ?? {};\n\n return addOrganisationUnitUser(unitId, userId, requestOptions);\n };\n\n const customOptions = mutationMutator({ ...mutationOptions, mutationFn });\n\n return customOptions;\n};\n\nexport type AddOrganisationUnitUserMutationResult = NonNullable<\n Awaited<ReturnType<typeof addOrganisationUnitUser>>\n>;\n\nexport type AddOrganisationUnitUserMutationError = ErrorType<AsError | void>;\n\n/**\n * @summary Adds a user to an Organisational Unit\n */\nexport const useAddOrganisationUnitUser = <TError = ErrorType<AsError | void>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addOrganisationUnitUser>>,\n TError,\n { unitId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof addOrganisationUnitUser>>,\n TError,\n { unitId: string; userId: string },\n TContext\n> => {\n const mutationOptions = useAddOrganisationUnitUserMutationOptions(options);\n\n return useMutation(mutationOptions, queryClient);\n};\n/**\n * Removes a User from an Organisational Unit.\n\nUsers cannot be removed from **Personal Units** (Units that are part of the ***Default** Organisation).\n\nYou have to be in the Organisation or Unit or an Admin user to use this endpoint\n\n * @summary Deletes a User from an Organisational Unit\n */\nexport const deleteOrganisationUnitUser = (\n unitId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>,\n) => {\n return customInstance<void>({ url: `/unit/${unitId}/user/${userId}`, method: \"DELETE\" }, options);\n};\n\nexport const useDeleteOrganisationUnitUserMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteOrganisationUnitUser>>,\n TError,\n { unitId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof deleteOrganisationUnitUser>>,\n TError,\n { unitId: string; userId: string },\n TContext\n> => {\n const mutationKey = [\"deleteOrganisationUnitUser\"];\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 deleteOrganisationUnitUser>>,\n { unitId: string; userId: string }\n > = (props) => {\n const { unitId, userId } = props ?? {};\n\n return deleteOrganisationUnitUser(unitId, userId, requestOptions);\n };\n\n const customOptions = mutationMutator({ ...mutationOptions, mutationFn });\n\n return customOptions;\n};\n\nexport type DeleteOrganisationUnitUserMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteOrganisationUnitUser>>\n>;\n\nexport type DeleteOrganisationUnitUserMutationError = ErrorType<AsError | void>;\n\n/**\n * @summary Deletes a User from an Organisational Unit\n */\nexport const useDeleteOrganisationUnitUser = <\n TError = ErrorType<AsError | void>,\n TContext = unknown,\n>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteOrganisationUnitUser>>,\n TError,\n { unitId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof deleteOrganisationUnitUser>>,\n TError,\n { unitId: string; userId: string },\n TContext\n> => {\n const mutationOptions = useDeleteOrganisationUnitUserMutationOptions(options);\n\n return useMutation(mutationOptions, queryClient);\n};\n"],"mappings":";;;;;;;;;AAUA,SAAS,aAAa,UAAU,wBAAwB;AAgCjD,IAAM,iBAAiB,CAC5B,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,iBAAiB,QAAQ,OAAO,OAAO;AAAA,IAC9C;AAAA,EACF;AACF;AAEO,IAAM,4BAA4B,MAAM;AAC7C,SAAO,CAAC,eAAe;AACzB;AAEO,IAAM,gCAAgC,CAG3C,YAGI;AACJ,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,WAAW,cAAc,YAAY,0BAA0B;AAErE,QAAM,UAAqE,CAAC,EAAE,OAAO,MACnF,eAAe,gBAAgB,MAAM;AAEvC,QAAM,gBAAgB,aAAa,EAAE,GAAG,cAAc,UAAU,QAAQ,CAAC;AAEzE,SAAO;AAKT;AAuDO,SAAS,kBAId,SAIA,aACgF;A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gBAAgB,gBAAgB,EAAE,GAAG,iBAAiB,WAAW,CAAC;AAExE,SAAO;AACT;AAWO,IAAM,6BAA6B,CACxC,SASA,gBAMG;AACH,QAAM,kBAAkB,0CAA0C,OAAO;AAEzE,SAAO,YAAY,iBAAiB,WAAW;AACjD;AAUO,IAAM,6BAA6B,CACxC,QACA,QACA,YACG;AACH,SAAO,eAAqB,EAAE,KAAK,SAAS,MAAM,SAAS,MAAM,IAAI,QAAQ,SAAS,GAAG,OAAO;AAClG;AAEO,IAAM,+CAA+C,CAG1D,YAaG;AACH,QAAM,cAAc,CAAC,4BAA4B;AACjD,QAAM,EAAE,UAAU,iBAAiB,SAAS,eAAe,IAAI,UAC3D,QAAQ,YAAY,iBAAiB,QAAQ,YAAY,QAAQ,SAAS,cACxE,UACA,EAAE,GAAG,SAAS,UAAU,EAAE,GAAG,QAAQ,UAAU,YAAY,EAAE,IAC/D,EAAE,UAAU,EAAE,YAAY,GAAG,SAAS,OAAU;AAEpD,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,QAAQ,OAAO,IAAI,SAAS,CAAC;AAErC,WAAO,2BAA2B,QAAQ,QAAQ,cAAc;AAAA,EAClE;AAEA,QAAM,gBAAgB,gBAAgB,EAAE,GAAG,iBAAiB,WAAW,CAAC;AAExE,SAAO;AACT;AAWO,IAAM,gCAAgC,CAI3C,SASA,gBAMG;AACH,QAAM,kBAAkB,6CAA6C,OAAO;AAE5E,SAAO,YAAY,iBAAiB,WAAW;AACjD;","names":[]}
|
package/chunk-EBOQPVLG.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/custom-instance.ts"],"sourcesContent":["/** Based off the example custom-instance from Orval docs\n * https://github.com/anymaniax/orval/blob/master/samples/react-app-with-react-query/src/api/mutator/custom-instance.ts\n *\n * See https://react-query.tanstack.com/guides/query-cancellation\n *\n * TODO: Considering using Fetch-API instead of axios. This instance will have to change. Could be\n * achieved without changing much using `redaxios`\n * Or use 'ky'\n */\n\nimport Axios, { AxiosError, AxiosRequestConfig } from 'axios';\n\nexport const AXIOS_INSTANCE = Axios.create();\n\n/**\n * Set the access token to be added as the `Authorization: Bearer 'token'` header\n * Useful for client only apps where a proxy API route isn't involved to securely add the access token\n * @param token access token\n */\nexport const setAuthToken = (token: string) => {\n AXIOS_INSTANCE.defaults.headers.common['Authorization'] = `Bearer ${token}`;\n};\n\n/**\n * Set the url to which request paths are added to.\n * @param baseUrl origin + subpath e.g. 'https://example.com/subpath' or '/subpath'\n */\nexport const setBaseUrl = (baseUrl: string) => {\n AXIOS_INSTANCE.defaults.baseURL = baseUrl;\n};\n\nexport const customInstance = <TReturn>(\n config: AxiosRequestConfig,\n options?: AxiosRequestConfig,\n): Promise<TReturn> => {\n const source = Axios.CancelToken.source();\n\n const promise = AXIOS_INSTANCE({ ...config, ...options, cancelToken: source.token }).then(\n ({ data }) => data,\n );\n\n // @ts-expect-error need to add a cancel method to the promise\n promise.cancel = () => {\n source.cancel('Query was cancelled');\n };\n\n return promise;\n};\n\nexport type ErrorType<TError> = AxiosError<TError>;\n"],"mappings":";AAUA,OAAO,WAA+C;AAE/C,IAAM,iBAAiB,MAAM,OAAO;AAOpC,IAAM,eAAe,CAAC,UAAkB;AAC7C,iBAAe,SAAS,QAAQ,OAAO,eAAe,IAAI,UAAU,KAAK;AAC3E;AAMO,IAAM,aAAa,CAAC,YAAoB;AAC7C,iBAAe,SAAS,UAAU;AACpC;AAEO,IAAM,iBAAiB,CAC5B,QACA,YACqB;AACrB,QAAM,SAAS,MAAM,YAAY,OAAO;AAExC,QAAM,UAAU,eAAe,EAAE,GAAG,QAAQ,GAAG,SAAS,aAAa,OAAO,MAAM,CAAC,EAAE;AAAA,IACnF,CAAC,EAAE,KAAK,MAAM;AAAA,EAChB;AAGA,UAAQ,SAAS,MAAM;AACrB,WAAO,OAAO,qBAAqB;AAAA,EACrC;AAEA,SAAO;AACT;","names":[]}
|
package/chunk-TKLTUR4R.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/squonk2-account-server-js-client/squonk2-account-server-js-client/dist/chunk-TKLTUR4R.cjs","../src/custom-instance.ts"],"names":[],"mappings":"AAAA;ACUA,4EAAsD;AAE/C,IAAM,eAAA,EAAiB,eAAA,CAAM,MAAA,CAAO,CAAA;AAOpC,IAAM,aAAA,EAAe,CAAC,KAAA,EAAA,GAAkB;AAC7C,EAAA,cAAA,CAAe,QAAA,CAAS,OAAA,CAAQ,MAAA,CAAO,eAAe,EAAA,EAAI,CAAA,OAAA,EAAU,KAAK,CAAA,CAAA;AAC3E;AAM+C;AACX,EAAA;AACpC;AAKuB;AACmB,EAAA;AAE6B,EAAA;AACrD,IAAA;AAChB,EAAA;AAGuB,EAAA;AACc,IAAA;AACrC,EAAA;AAEO,EAAA;AACT;AD5B4E;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/squonk2-account-server-js-client/squonk2-account-server-js-client/dist/chunk-TKLTUR4R.cjs","sourcesContent":[null,"/** Based off the example custom-instance from Orval docs\n * https://github.com/anymaniax/orval/blob/master/samples/react-app-with-react-query/src/api/mutator/custom-instance.ts\n *\n * See https://react-query.tanstack.com/guides/query-cancellation\n *\n * TODO: Considering using Fetch-API instead of axios. This instance will have to change. Could be\n * achieved without changing much using `redaxios`\n * Or use 'ky'\n */\n\nimport Axios, { AxiosError, AxiosRequestConfig } from 'axios';\n\nexport const AXIOS_INSTANCE = Axios.create();\n\n/**\n * Set the access token to be added as the `Authorization: Bearer 'token'` header\n * Useful for client only apps where a proxy API route isn't involved to securely add the access token\n * @param token access token\n */\nexport const setAuthToken = (token: string) => {\n AXIOS_INSTANCE.defaults.headers.common['Authorization'] = `Bearer ${token}`;\n};\n\n/**\n * Set the url to which request paths are added to.\n * @param baseUrl origin + subpath e.g. 'https://example.com/subpath' or '/subpath'\n */\nexport const setBaseUrl = (baseUrl: string) => {\n AXIOS_INSTANCE.defaults.baseURL = baseUrl;\n};\n\nexport const customInstance = <TReturn>(\n config: AxiosRequestConfig,\n options?: AxiosRequestConfig,\n): Promise<TReturn> => {\n const source = Axios.CancelToken.source();\n\n const promise = AXIOS_INSTANCE({ ...config, ...options, cancelToken: source.token }).then(\n ({ data }) => data,\n );\n\n // @ts-expect-error need to add a cancel method to the promise\n promise.cancel = () => {\n source.cancel('Query was cancelled');\n };\n\n return promise;\n};\n\nexport type ErrorType<TError> = AxiosError<TError>;\n"]}
|