@squonk/account-server-client 1.0.2-rc.3 → 1.0.3-rc.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.
Files changed (48) hide show
  1. package/asset/asset.cjs +34 -18
  2. package/asset/asset.cjs.map +1 -1
  3. package/asset/asset.d.ts +16 -16
  4. package/asset/asset.js +35 -19
  5. package/asset/asset.js.map +1 -1
  6. package/{custom-instance-b8075093.d.ts → custom-instance-93fb01eb.d.ts} +22 -20
  7. package/index.cjs.map +1 -1
  8. package/index.d.ts +1 -1
  9. package/index.js.map +1 -1
  10. package/merchant/merchant.cjs +15 -13
  11. package/merchant/merchant.cjs.map +1 -1
  12. package/merchant/merchant.d.ts +1 -1
  13. package/merchant/merchant.js +16 -14
  14. package/merchant/merchant.js.map +1 -1
  15. package/organisation/organisation.cjs +18 -6
  16. package/organisation/organisation.cjs.map +1 -1
  17. package/organisation/organisation.d.ts +7 -7
  18. package/organisation/organisation.js +19 -7
  19. package/organisation/organisation.js.map +1 -1
  20. package/package.json +1 -1
  21. package/product/product.cjs +47 -38
  22. package/product/product.cjs.map +1 -1
  23. package/product/product.d.ts +10 -10
  24. package/product/product.js +48 -39
  25. package/product/product.js.map +1 -1
  26. package/src/account-server-api.schemas.ts +73 -87
  27. package/src/asset/asset.ts +248 -345
  28. package/src/merchant/merchant.ts +62 -84
  29. package/src/organisation/organisation.ts +131 -184
  30. package/src/product/product.ts +279 -422
  31. package/src/state/state.ts +36 -42
  32. package/src/unit/unit.ts +218 -301
  33. package/src/user/user.ts +224 -327
  34. package/state/state.cjs +9 -9
  35. package/state/state.cjs.map +1 -1
  36. package/state/state.d.ts +1 -1
  37. package/state/state.js +10 -10
  38. package/state/state.js.map +1 -1
  39. package/unit/unit.cjs +40 -25
  40. package/unit/unit.cjs.map +1 -1
  41. package/unit/unit.d.ts +10 -10
  42. package/unit/unit.js +41 -26
  43. package/unit/unit.js.map +1 -1
  44. package/user/user.cjs +38 -20
  45. package/user/user.cjs.map +1 -1
  46. package/user/user.d.ts +10 -10
  47. package/user/user.js +39 -21
  48. package/user/user.js.map +1 -1
package/user/user.cjs CHANGED
@@ -3,10 +3,17 @@
3
3
  var _chunkIUEU2LYCcjs = require('../chunk-IUEU2LYC.cjs');
4
4
 
5
5
  // src/user/user.ts
6
+
7
+
8
+
6
9
  var _reactquery = require('react-query');
7
10
  var getUserAccount = (options, signal) => {
8
11
  return _chunkIUEU2LYCcjs.customInstance.call(void 0,
9
- { url: `/user/account`, method: "get", signal },
12
+ {
13
+ url: `/user/account`,
14
+ method: "get",
15
+ signal
16
+ },
10
17
  options
11
18
  );
12
19
  };
@@ -14,22 +21,22 @@ var getGetUserAccountQueryKey = () => [`/user/account`];
14
21
  var useGetUserAccount = (options) => {
15
22
  const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
16
23
  const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetUserAccountQueryKey()));
17
- const queryFn = ({
18
- signal
19
- }) => getUserAccount(requestOptions, signal);
24
+ const queryFn = ({ signal }) => getUserAccount(requestOptions, signal);
20
25
  const query = _reactquery.useQuery.call(void 0, queryKey, queryFn, queryOptions);
21
26
  query.queryKey = queryKey;
22
27
  return query;
23
28
  };
24
29
  var getOrganisationUsers = (orgId, options, signal) => {
25
30
  return _chunkIUEU2LYCcjs.customInstance.call(void 0,
26
- { url: `/organisation/${orgId}/user`, method: "get", signal },
31
+ {
32
+ url: `/organisation/${orgId}/user`,
33
+ method: "get",
34
+ signal
35
+ },
27
36
  options
28
37
  );
29
38
  };
30
- var getGetOrganisationUsersQueryKey = (orgId) => [
31
- `/organisation/${orgId}/user`
32
- ];
39
+ var getGetOrganisationUsersQueryKey = (orgId) => [`/organisation/${orgId}/user`];
33
40
  var useGetOrganisationUsers = (orgId, options) => {
34
41
  const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
35
42
  const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetOrganisationUsersQueryKey(orgId)));
@@ -40,7 +47,10 @@ var useGetOrganisationUsers = (orgId, options) => {
40
47
  };
41
48
  var addOrganisationUser = (orgId, userId, options) => {
42
49
  return _chunkIUEU2LYCcjs.customInstance.call(void 0,
43
- { url: `/organisation/${orgId}/user/${userId}`, method: "put" },
50
+ {
51
+ url: `/organisation/${orgId}/user/${userId}`,
52
+ method: "put"
53
+ },
44
54
  options
45
55
  );
46
56
  };
@@ -54,7 +64,10 @@ var useAddOrganisationUser = (options) => {
54
64
  };
55
65
  var deleteOrganisationUser = (orgId, userId, options) => {
56
66
  return _chunkIUEU2LYCcjs.customInstance.call(void 0,
57
- { url: `/organisation/${orgId}/user/${userId}`, method: "delete" },
67
+ {
68
+ url: `/organisation/${orgId}/user/${userId}`,
69
+ method: "delete"
70
+ },
58
71
  options
59
72
  );
60
73
  };
@@ -68,27 +81,29 @@ var useDeleteOrganisationUser = (options) => {
68
81
  };
69
82
  var getOrganisationUnitUsers = (unitId, options, signal) => {
70
83
  return _chunkIUEU2LYCcjs.customInstance.call(void 0,
71
- { url: `/unit/${unitId}/user`, method: "get", signal },
84
+ {
85
+ url: `/unit/${unitId}/user`,
86
+ method: "get",
87
+ signal
88
+ },
72
89
  options
73
90
  );
74
91
  };
75
- var getGetOrganisationUnitUsersQueryKey = (unitId) => [
76
- `/unit/${unitId}/user`
77
- ];
92
+ var getGetOrganisationUnitUsersQueryKey = (unitId) => [`/unit/${unitId}/user`];
78
93
  var useGetOrganisationUnitUsers = (unitId, options) => {
79
94
  const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
80
95
  const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetOrganisationUnitUsersQueryKey(unitId)));
81
96
  const queryFn = ({ signal }) => getOrganisationUnitUsers(unitId, requestOptions, signal);
82
- const query = _reactquery.useQuery.call(void 0, queryKey, queryFn, {
83
- enabled: !!unitId,
84
- ...queryOptions
85
- });
97
+ const query = _reactquery.useQuery.call(void 0, queryKey, queryFn, { enabled: !!unitId, ...queryOptions });
86
98
  query.queryKey = queryKey;
87
99
  return query;
88
100
  };
89
101
  var addOrganisationUnitUser = (unitId, userId, options) => {
90
102
  return _chunkIUEU2LYCcjs.customInstance.call(void 0,
91
- { url: `/unit/${unitId}/user/${userId}`, method: "put" },
103
+ {
104
+ url: `/unit/${unitId}/user/${userId}`,
105
+ method: "put"
106
+ },
92
107
  options
93
108
  );
94
109
  };
@@ -102,7 +117,10 @@ var useAddOrganisationUnitUser = (options) => {
102
117
  };
103
118
  var deleteOrganisationUnitUser = (unitId, userId, options) => {
104
119
  return _chunkIUEU2LYCcjs.customInstance.call(void 0,
105
- { url: `/unit/${unitId}/user/${userId}`, method: "delete" },
120
+ {
121
+ url: `/unit/${unitId}/user/${userId}`,
122
+ method: "delete"
123
+ },
106
124
  options
107
125
  );
108
126
  };
package/user/user.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/user/user.ts"],"names":[],"mappings":";;;;;AAUA,SAAS,UAAU,mBAAmB;AA8B/B,IAAM,iBAAiB,CAC5B,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,iBAAiB,QAAQ,OAAO,OAAO;AAAA,IAC9C;AAAA,EACF;AACF;AAEO,IAAM,4BAA4B,MAAM,CAAC,eAAe;AAOxD,IAAM,oBAAoB,CAG/B,YAO4D;AAC5D,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,0BAA0B;AAErE,QAAM,UAAqE,CAAC;AAAA,IAC1E;AAAA,EACF,MAAM,eAAe,gBAAgB,MAAM;AAE3C,QAAM,QAAQ,SAIZ,UAAU,SAAS,YAAY;AAIjC,QAAM,WAAW;AAEjB,SAAO;AACT;AAOO,IAAM,uBAAuB,CAClC,OACA,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,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AM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,QAAQ,OAAO,IAAI,SAAS,CAAC;AAErC,WAAO,2BAA2B,QAAQ,QAAQ,cAAc;AAAA,EAClE;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B","sourcesContent":["/**\n * Generated by orval v6.9.1 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Products**, **Organisations**, **Units** and **Users**.\n\n * OpenAPI spec version: 1.0\n */\nimport { useQuery, useMutation } from \"react-query\";\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"react-query\";\nimport type {\n UserAccountGetResponse,\n AsError,\n UsersGetResponse,\n} from \"../account-server-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * 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<UserAccountGetResponse>(\n { url: `/user/account`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetUserAccountQueryKey = () => [`/user/account`];\n\nexport type GetUserAccountQueryResult = NonNullable<\n Awaited<ReturnType<typeof getUserAccount>>\n>;\nexport type GetUserAccountQueryError = ErrorType<void | AsError>;\n\nexport const useGetUserAccount = <\n TData = Awaited<ReturnType<typeof getUserAccount>>,\n TError = ErrorType<void | AsError>\n>(options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getUserAccount>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUserAccountQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUserAccount>>> = ({\n signal,\n }) => getUserAccount(requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getUserAccount>>,\n TError,\n TData\n >(queryKey, queryFn, queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * Gets users in an Organisation. You have to be in the Organisation or an Admin user to use this endpoint\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 `/organisation/${orgId}/user`,\n];\n\nexport type GetOrganisationUsersQueryResult = NonNullable<\n Awaited<ReturnType<typeof getOrganisationUsers>>\n>;\nexport type GetOrganisationUsersQueryError = ErrorType<AsError | void>;\n\nexport const useGetOrganisationUsers = <\n TData = Awaited<ReturnType<typeof getOrganisationUsers>>,\n TError = ErrorType<AsError | void>\n>(\n orgId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUsers>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetOrganisationUsersQueryKey(orgId);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getOrganisationUsers>>\n > = ({ signal }) => getOrganisationUsers(orgId, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getOrganisationUsers>>,\n TError,\n TData\n >(queryKey, queryFn, { enabled: !!orgId, ...queryOptions }) as UseQueryResult<\n TData,\n TError\n > & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * Adds a user to an organisation. You 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 type AddOrganisationUserMutationResult = NonNullable<\n Awaited<ReturnType<typeof addOrganisationUser>>\n>;\n\nexport type AddOrganisationUserMutationError = ErrorType<AsError>;\n\nexport const useAddOrganisationUser = <\n TError = ErrorType<AsError>,\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}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\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 return useMutation<\n Awaited<ReturnType<typeof addOrganisationUser>>,\n TError,\n { orgId: string; userId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Removes a user from an organisation. You 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 type DeleteOrganisationUserMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteOrganisationUser>>\n>;\n\nexport type DeleteOrganisationUserMutationError = ErrorType<AsError>;\n\nexport const useDeleteOrganisationUser = <\n TError = ErrorType<AsError>,\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}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\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 return useMutation<\n Awaited<ReturnType<typeof deleteOrganisationUser>>,\n TError,\n { orgId: string; userId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets users in an Organisational Unit. You have to be in the Organisation or Unit or an Admin user to use this endpoint\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 `/unit/${unitId}/user`,\n];\n\nexport type GetOrganisationUnitUsersQueryResult = NonNullable<\n Awaited<ReturnType<typeof getOrganisationUnitUsers>>\n>;\nexport type GetOrganisationUnitUsersQueryError = ErrorType<AsError | void>;\n\nexport const useGetOrganisationUnitUsers = <\n TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>,\n TError = ErrorType<AsError | void>\n>(\n unitId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUnitUsers>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetOrganisationUnitUsersQueryKey(unitId);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getOrganisationUnitUsers>>\n > = ({ signal }) => getOrganisationUnitUsers(unitId, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getOrganisationUnitUsers>>,\n TError,\n TData\n >(queryKey, queryFn, {\n enabled: !!unitId,\n ...queryOptions,\n }) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * 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>(\n { url: `/unit/${unitId}/user/${userId}`, method: \"put\" },\n options\n );\n};\n\nexport type AddOrganisationUnitUserMutationResult = NonNullable<\n Awaited<ReturnType<typeof addOrganisationUnitUser>>\n>;\n\nexport type AddOrganisationUnitUserMutationError = ErrorType<AsError>;\n\nexport const useAddOrganisationUnitUser = <\n TError = ErrorType<AsError>,\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}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\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 return useMutation<\n Awaited<ReturnType<typeof addOrganisationUnitUser>>,\n TError,\n { unitId: string; userId: string },\n TContext\n >(mutationFn, 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 return customInstance<void>(\n { url: `/unit/${unitId}/user/${userId}`, method: \"delete\" },\n options\n );\n};\n\nexport type DeleteOrganisationUnitUserMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteOrganisationUnitUser>>\n>;\n\nexport type DeleteOrganisationUnitUserMutationError = ErrorType<AsError>;\n\nexport const useDeleteOrganisationUnitUser = <\n TError = ErrorType<AsError>,\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}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\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 return useMutation<\n Awaited<ReturnType<typeof deleteOrganisationUnitUser>>,\n TError,\n { unitId: string; userId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n"]}
1
+ {"version":3,"sources":["../../src/user/user.ts"],"names":[],"mappings":";;;;;AAUA;AAAA,EACE;AAAA,EACA;AAAA,OACK;AA+BA,IAAM,iBAAiB,CAE7B,SAAiD,WAC7C;AACC,SAAO;AAAA,IACP;AAAA,MAAC,KAAK;AAAA,MAAiB,QAAQ;AAAA,MAAO;AAAA,IACxC;AAAA,IACE;AAAA,EAAO;AACT;AAGG,IAAM,4BAA4B,MAAM,CAAC,eAAe;AAMxD,IAAM,oBAAoB,CAC/B,YAE8D;AAE9D,QAAM,EAAC,OAAO,cAAc,SAAS,eAAc,IAAI,WAAW,CAAC;AAEnE,QAAM,YAAW,6CAAc,aAAY,0BAA0B;AAIrE,QAAM,UAAqE,CAAC,EAAE,OAAO,MAAM,eAAe,gBAAgB,MAAM;AAEhI,QAAM,QAAQ,SAAoE,UAAU,SAAS,YAAY;AAEjH,QAAM,WAAW;AAEjB,SAAO;AAC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AO;AAAA,IACP;AAAA,MAAC,KAAK,SAAS,eAAe;AAAA,MAAU,QAAQ;AAAA,IAClD;AAAA,IACE;AAAA,EAAO;AACT;AAQO,IAAM,gCAAgC,CAEzB,YACnB;AACC,QAAM,EAAC,UAAU,iBAAiB,SAAS,eAAc,IAAI,WAAW,CAAC;AAKzE,QAAM,aAAwH,CAAC,UAAU;AACrI,UAAM,EAAC,QAAO,OAAM,IAAI,SAAS,CAAC;AAElC,WAAQ,2BAA2B,QAAO,QAAO,cAAc;AAAA,EACjE;AAEF,SAAO,YAAuH,YAAY,eAAe;AAC3J","sourcesContent":["/**\n * Generated by orval v6.9.1 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Products**, **Organisations**, **Units** and **Users**.\n\n * OpenAPI spec version: 1.0\n */\nimport {\n useQuery,\n useMutation\n} from 'react-query'\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey\n} from 'react-query'\nimport type {\n UserAccountGetResponse,\n AsError,\n UsersGetResponse\n} from '../account-server-api.schemas'\nimport { customInstance } from '.././custom-instance'\nimport type { ErrorType } from '.././custom-instance'\n\n\n// eslint-disable-next-line\n type SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P,\n) => any\n ? P\n : never;\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 return customInstance<UserAccountGetResponse>(\n {url: `/user/account`, method: 'get', signal\n },\n options);\n }\n \n\nexport const getGetUserAccountQueryKey = () => [`/user/account`];\n\n \nexport type GetUserAccountQueryResult = NonNullable<Awaited<ReturnType<typeof getUserAccount>>>\nexport type GetUserAccountQueryError = ErrorType<void | AsError>\n\nexport const useGetUserAccount = <TData = Awaited<ReturnType<typeof getUserAccount>>, TError = ErrorType<void | AsError>>(\n options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const {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 const query = useQuery<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>(queryKey, queryFn, queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n}\n\n/**\n * Gets users in an Organisation. You have to be in the Organisation or an Admin user to use this endpoint\n\n * @summary Gets users in an organisation\n */\nexport const getOrganisationUsers = (\n orgId: string,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n return customInstance<UsersGetResponse>(\n {url: `/organisation/${orgId}/user`, method: 'get', signal\n },\n options);\n }\n \n\nexport const getGetOrganisationUsersQueryKey = (orgId: string,) => [`/organisation/${orgId}/user`];\n\n \nexport type GetOrganisationUsersQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisationUsers>>>\nexport type GetOrganisationUsersQueryError = ErrorType<AsError | void>\n\nexport const useGetOrganisationUsers = <TData = Awaited<ReturnType<typeof getOrganisationUsers>>, TError = ErrorType<AsError | void>>(\n orgId: string, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const {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 const query = useQuery<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>(queryKey, queryFn, {enabled: !!(orgId), ...queryOptions}) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n}\n\n/**\n * Adds a user to an organisation. You 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 return customInstance<void>(\n {url: `/organisation/${orgId}/user/${userId}`, method: 'put'\n },\n options);\n }\n \n\n\n export type AddOrganisationUserMutationResult = NonNullable<Awaited<ReturnType<typeof addOrganisationUser>>>\n \n export type AddOrganisationUserMutationError = ErrorType<AsError>\n\n export const useAddOrganisationUser = <TError = ErrorType<AsError>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof addOrganisationUser>>, TError,{orgId: string;userId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {}\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 return useMutation<Awaited<ReturnType<typeof addOrganisationUser>>, TError, {orgId: string;userId: string}, TContext>(mutationFn, mutationOptions)\n }\n /**\n * Removes a user from an organisation. You 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 return customInstance<void>(\n {url: `/organisation/${orgId}/user/${userId}`, method: 'delete'\n },\n options);\n }\n \n\n\n export type DeleteOrganisationUserMutationResult = NonNullable<Awaited<ReturnType<typeof deleteOrganisationUser>>>\n \n export type DeleteOrganisationUserMutationError = ErrorType<AsError>\n\n export const useDeleteOrganisationUser = <TError = ErrorType<AsError>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteOrganisationUser>>, TError,{orgId: string;userId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {}\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 return useMutation<Awaited<ReturnType<typeof deleteOrganisationUser>>, TError, {orgId: string;userId: string}, TContext>(mutationFn, mutationOptions)\n }\n /**\n * Gets users in an Organisational Unit. You have to be in the Organisation or Unit or an Admin user to use this endpoint\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 return customInstance<UsersGetResponse>(\n {url: `/unit/${unitId}/user`, method: 'get', signal\n },\n options);\n }\n \n\nexport const getGetOrganisationUnitUsersQueryKey = (unitId: string,) => [`/unit/${unitId}/user`];\n\n \nexport type GetOrganisationUnitUsersQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisationUnitUsers>>>\nexport type GetOrganisationUnitUsersQueryError = ErrorType<AsError | void>\n\nexport const useGetOrganisationUnitUsers = <TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError = ErrorType<AsError | void>>(\n unitId: string, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const {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 const query = useQuery<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>(queryKey, queryFn, {enabled: !!(unitId), ...queryOptions}) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = 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 return customInstance<void>(\n {url: `/unit/${unitId}/user/${userId}`, method: 'put'\n },\n options);\n }\n \n\n\n export type AddOrganisationUnitUserMutationResult = NonNullable<Awaited<ReturnType<typeof addOrganisationUnitUser>>>\n \n export type AddOrganisationUnitUserMutationError = ErrorType<AsError>\n\n export const useAddOrganisationUnitUser = <TError = ErrorType<AsError>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof addOrganisationUnitUser>>, TError,{unitId: string;userId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {}\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 return useMutation<Awaited<ReturnType<typeof addOrganisationUnitUser>>, TError, {unitId: string;userId: string}, TContext>(mutationFn, 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 return customInstance<void>(\n {url: `/unit/${unitId}/user/${userId}`, method: 'delete'\n },\n options);\n }\n \n\n\n export type DeleteOrganisationUnitUserMutationResult = NonNullable<Awaited<ReturnType<typeof deleteOrganisationUnitUser>>>\n \n export type DeleteOrganisationUnitUserMutationError = ErrorType<AsError>\n\n export const useDeleteOrganisationUnitUser = <TError = ErrorType<AsError>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteOrganisationUnitUser>>, TError,{unitId: string;userId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {}\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 return useMutation<Awaited<ReturnType<typeof deleteOrganisationUnitUser>>, TError, {unitId: string;userId: string}, TContext>(mutationFn, mutationOptions)\n }\n "]}
package/user/user.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_query from 'react-query';
2
2
  import { UseQueryOptions, QueryKey, UseQueryResult, UseMutationOptions } from 'react-query';
3
- import { ak as customInstance, n as UserAccountDetail, al as ErrorType, ag as AsError, ab as UsersGetResponse } from '../custom-instance-b8075093.js';
3
+ import { ak as customInstance, n as UserAccountDetail, al as ErrorType, ag as AsError, ab as UsersGetResponse } from '../custom-instance-93fb01eb.js';
4
4
  import 'axios';
5
5
 
6
6
  declare type SecondParameter<T extends (...args: any) => any> = T extends (config: any, args: infer P) => any ? P : never;
@@ -53,10 +53,10 @@ declare const useAddOrganisationUser: <TError = ErrorType<AsError>, TContext = u
53
53
  userId: string;
54
54
  }, TContext>;
55
55
  /**
56
- * Removes a user from an organisation. You have to be in the Organisation or an Admin user to use this endpoint
56
+ * Removes a user from an organisation. You have to be in the Organisation or an Admin user to use this endpoint
57
57
 
58
- * @summary Deletes a user from an organisation
59
- */
58
+ * @summary Deletes a user from an organisation
59
+ */
60
60
  declare const deleteOrganisationUser: (orgId: string, userId: string, options?: SecondParameter<typeof customInstance>) => Promise<void>;
61
61
  declare type DeleteOrganisationUserMutationResult = NonNullable<Awaited<ReturnType<typeof deleteOrganisationUser>>>;
62
62
  declare type DeleteOrganisationUserMutationError = ErrorType<AsError>;
@@ -71,10 +71,10 @@ declare const useDeleteOrganisationUser: <TError = ErrorType<AsError>, TContext
71
71
  userId: string;
72
72
  }, TContext>;
73
73
  /**
74
- * Gets users in an Organisational Unit. You have to be in the Organisation or Unit or an Admin user to use this endpoint
74
+ * Gets users in an Organisational Unit. You have to be in the Organisation or Unit or an Admin user to use this endpoint
75
75
 
76
- * @summary Gets users in an Organisational Unit
77
- */
76
+ * @summary Gets users in an Organisational Unit
77
+ */
78
78
  declare const getOrganisationUnitUsers: (unitId: string, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal | undefined) => Promise<UsersGetResponse>;
79
79
  declare const getGetOrganisationUnitUsersQueryKey: (unitId: string) => string[];
80
80
  declare type GetOrganisationUnitUsersQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisationUnitUsers>>>;
@@ -108,14 +108,14 @@ declare const useAddOrganisationUnitUser: <TError = ErrorType<AsError>, TContext
108
108
  userId: string;
109
109
  }, TContext>;
110
110
  /**
111
- * Removes a user from an Organisational Unit.
111
+ * Removes a user from an Organisational Unit.
112
112
 
113
113
  Users cannot be removed from **Personal Units** (Units that are part of the ***Default** Organisation).
114
114
 
115
115
  You have to be in the Organisation or Unit or an Admin user to use this endpoint
116
116
 
117
- * @summary Deletes a user from an Organisational Unit
118
- */
117
+ * @summary Deletes a user from an Organisational Unit
118
+ */
119
119
  declare const deleteOrganisationUnitUser: (unitId: string, userId: string, options?: SecondParameter<typeof customInstance>) => Promise<void>;
120
120
  declare type DeleteOrganisationUnitUserMutationResult = NonNullable<Awaited<ReturnType<typeof deleteOrganisationUnitUser>>>;
121
121
  declare type DeleteOrganisationUnitUserMutationError = ErrorType<AsError>;
package/user/user.js CHANGED
@@ -3,10 +3,17 @@ import {
3
3
  } from "../chunk-3O5KIRV4.js";
4
4
 
5
5
  // src/user/user.ts
6
- import { useQuery, useMutation } from "react-query";
6
+ import {
7
+ useQuery,
8
+ useMutation
9
+ } from "react-query";
7
10
  var getUserAccount = (options, signal) => {
8
11
  return customInstance(
9
- { url: `/user/account`, method: "get", signal },
12
+ {
13
+ url: `/user/account`,
14
+ method: "get",
15
+ signal
16
+ },
10
17
  options
11
18
  );
12
19
  };
@@ -14,22 +21,22 @@ var getGetUserAccountQueryKey = () => [`/user/account`];
14
21
  var useGetUserAccount = (options) => {
15
22
  const { query: queryOptions, request: requestOptions } = options ?? {};
16
23
  const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetUserAccountQueryKey();
17
- const queryFn = ({
18
- signal
19
- }) => getUserAccount(requestOptions, signal);
24
+ const queryFn = ({ signal }) => getUserAccount(requestOptions, signal);
20
25
  const query = useQuery(queryKey, queryFn, queryOptions);
21
26
  query.queryKey = queryKey;
22
27
  return query;
23
28
  };
24
29
  var getOrganisationUsers = (orgId, options, signal) => {
25
30
  return customInstance(
26
- { url: `/organisation/${orgId}/user`, method: "get", signal },
31
+ {
32
+ url: `/organisation/${orgId}/user`,
33
+ method: "get",
34
+ signal
35
+ },
27
36
  options
28
37
  );
29
38
  };
30
- var getGetOrganisationUsersQueryKey = (orgId) => [
31
- `/organisation/${orgId}/user`
32
- ];
39
+ var getGetOrganisationUsersQueryKey = (orgId) => [`/organisation/${orgId}/user`];
33
40
  var useGetOrganisationUsers = (orgId, options) => {
34
41
  const { query: queryOptions, request: requestOptions } = options ?? {};
35
42
  const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetOrganisationUsersQueryKey(orgId);
@@ -40,7 +47,10 @@ var useGetOrganisationUsers = (orgId, options) => {
40
47
  };
41
48
  var addOrganisationUser = (orgId, userId, options) => {
42
49
  return customInstance(
43
- { url: `/organisation/${orgId}/user/${userId}`, method: "put" },
50
+ {
51
+ url: `/organisation/${orgId}/user/${userId}`,
52
+ method: "put"
53
+ },
44
54
  options
45
55
  );
46
56
  };
@@ -54,7 +64,10 @@ var useAddOrganisationUser = (options) => {
54
64
  };
55
65
  var deleteOrganisationUser = (orgId, userId, options) => {
56
66
  return customInstance(
57
- { url: `/organisation/${orgId}/user/${userId}`, method: "delete" },
67
+ {
68
+ url: `/organisation/${orgId}/user/${userId}`,
69
+ method: "delete"
70
+ },
58
71
  options
59
72
  );
60
73
  };
@@ -68,27 +81,29 @@ var useDeleteOrganisationUser = (options) => {
68
81
  };
69
82
  var getOrganisationUnitUsers = (unitId, options, signal) => {
70
83
  return customInstance(
71
- { url: `/unit/${unitId}/user`, method: "get", signal },
84
+ {
85
+ url: `/unit/${unitId}/user`,
86
+ method: "get",
87
+ signal
88
+ },
72
89
  options
73
90
  );
74
91
  };
75
- var getGetOrganisationUnitUsersQueryKey = (unitId) => [
76
- `/unit/${unitId}/user`
77
- ];
92
+ var getGetOrganisationUnitUsersQueryKey = (unitId) => [`/unit/${unitId}/user`];
78
93
  var useGetOrganisationUnitUsers = (unitId, options) => {
79
94
  const { query: queryOptions, request: requestOptions } = options ?? {};
80
95
  const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetOrganisationUnitUsersQueryKey(unitId);
81
96
  const queryFn = ({ signal }) => getOrganisationUnitUsers(unitId, requestOptions, signal);
82
- const query = useQuery(queryKey, queryFn, {
83
- enabled: !!unitId,
84
- ...queryOptions
85
- });
97
+ const query = useQuery(queryKey, queryFn, { enabled: !!unitId, ...queryOptions });
86
98
  query.queryKey = queryKey;
87
99
  return query;
88
100
  };
89
101
  var addOrganisationUnitUser = (unitId, userId, options) => {
90
102
  return customInstance(
91
- { url: `/unit/${unitId}/user/${userId}`, method: "put" },
103
+ {
104
+ url: `/unit/${unitId}/user/${userId}`,
105
+ method: "put"
106
+ },
92
107
  options
93
108
  );
94
109
  };
@@ -102,7 +117,10 @@ var useAddOrganisationUnitUser = (options) => {
102
117
  };
103
118
  var deleteOrganisationUnitUser = (unitId, userId, options) => {
104
119
  return customInstance(
105
- { url: `/unit/${unitId}/user/${userId}`, method: "delete" },
120
+ {
121
+ url: `/unit/${unitId}/user/${userId}`,
122
+ method: "delete"
123
+ },
106
124
  options
107
125
  );
108
126
  };
package/user/user.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/user/user.ts"],"sourcesContent":["/**\n * Generated by orval v6.9.1 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Products**, **Organisations**, **Units** and **Users**.\n\n * OpenAPI spec version: 1.0\n */\nimport { useQuery, useMutation } from \"react-query\";\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"react-query\";\nimport type {\n UserAccountGetResponse,\n AsError,\n UsersGetResponse,\n} from \"../account-server-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * 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<UserAccountGetResponse>(\n { url: `/user/account`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetUserAccountQueryKey = () => [`/user/account`];\n\nexport type GetUserAccountQueryResult = NonNullable<\n Awaited<ReturnType<typeof getUserAccount>>\n>;\nexport type GetUserAccountQueryError = ErrorType<void | AsError>;\n\nexport const useGetUserAccount = <\n TData = Awaited<ReturnType<typeof getUserAccount>>,\n TError = ErrorType<void | AsError>\n>(options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getUserAccount>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUserAccountQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUserAccount>>> = ({\n signal,\n }) => getUserAccount(requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getUserAccount>>,\n TError,\n TData\n >(queryKey, queryFn, queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * Gets users in an Organisation. You have to be in the Organisation or an Admin user to use this endpoint\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 `/organisation/${orgId}/user`,\n];\n\nexport type GetOrganisationUsersQueryResult = NonNullable<\n Awaited<ReturnType<typeof getOrganisationUsers>>\n>;\nexport type GetOrganisationUsersQueryError = ErrorType<AsError | void>;\n\nexport const useGetOrganisationUsers = <\n TData = Awaited<ReturnType<typeof getOrganisationUsers>>,\n TError = ErrorType<AsError | void>\n>(\n orgId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUsers>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetOrganisationUsersQueryKey(orgId);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getOrganisationUsers>>\n > = ({ signal }) => getOrganisationUsers(orgId, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getOrganisationUsers>>,\n TError,\n TData\n >(queryKey, queryFn, { enabled: !!orgId, ...queryOptions }) as UseQueryResult<\n TData,\n TError\n > & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * Adds a user to an organisation. You 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 type AddOrganisationUserMutationResult = NonNullable<\n Awaited<ReturnType<typeof addOrganisationUser>>\n>;\n\nexport type AddOrganisationUserMutationError = ErrorType<AsError>;\n\nexport const useAddOrganisationUser = <\n TError = ErrorType<AsError>,\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}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\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 return useMutation<\n Awaited<ReturnType<typeof addOrganisationUser>>,\n TError,\n { orgId: string; userId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Removes a user from an organisation. You 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 type DeleteOrganisationUserMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteOrganisationUser>>\n>;\n\nexport type DeleteOrganisationUserMutationError = ErrorType<AsError>;\n\nexport const useDeleteOrganisationUser = <\n TError = ErrorType<AsError>,\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}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\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 return useMutation<\n Awaited<ReturnType<typeof deleteOrganisationUser>>,\n TError,\n { orgId: string; userId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets users in an Organisational Unit. You have to be in the Organisation or Unit or an Admin user to use this endpoint\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 `/unit/${unitId}/user`,\n];\n\nexport type GetOrganisationUnitUsersQueryResult = NonNullable<\n Awaited<ReturnType<typeof getOrganisationUnitUsers>>\n>;\nexport type GetOrganisationUnitUsersQueryError = ErrorType<AsError | void>;\n\nexport const useGetOrganisationUnitUsers = <\n TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>,\n TError = ErrorType<AsError | void>\n>(\n unitId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUnitUsers>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetOrganisationUnitUsersQueryKey(unitId);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getOrganisationUnitUsers>>\n > = ({ signal }) => getOrganisationUnitUsers(unitId, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getOrganisationUnitUsers>>,\n TError,\n TData\n >(queryKey, queryFn, {\n enabled: !!unitId,\n ...queryOptions,\n }) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * 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>(\n { url: `/unit/${unitId}/user/${userId}`, method: \"put\" },\n options\n );\n};\n\nexport type AddOrganisationUnitUserMutationResult = NonNullable<\n Awaited<ReturnType<typeof addOrganisationUnitUser>>\n>;\n\nexport type AddOrganisationUnitUserMutationError = ErrorType<AsError>;\n\nexport const useAddOrganisationUnitUser = <\n TError = ErrorType<AsError>,\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}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\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 return useMutation<\n Awaited<ReturnType<typeof addOrganisationUnitUser>>,\n TError,\n { unitId: string; userId: string },\n TContext\n >(mutationFn, 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 return customInstance<void>(\n { url: `/unit/${unitId}/user/${userId}`, method: \"delete\" },\n options\n );\n};\n\nexport type DeleteOrganisationUnitUserMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteOrganisationUnitUser>>\n>;\n\nexport type DeleteOrganisationUnitUserMutationError = ErrorType<AsError>;\n\nexport const useDeleteOrganisationUnitUser = <\n TError = ErrorType<AsError>,\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}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\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 return useMutation<\n Awaited<ReturnType<typeof deleteOrganisationUnitUser>>,\n TError,\n { unitId: string; userId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n"],"mappings":";;;;;AAUA,SAAS,UAAU,mBAAmB;AA8B/B,IAAM,iBAAiB,CAC5B,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,iBAAiB,QAAQ,OAAO,OAAO;AAAA,IAC9C;AAAA,EACF;AACF;AAEO,IAAM,4BAA4B,MAAM,CAAC,eAAe;AAOxD,IAAM,oBAAoB,CAG/B,YAO4D;AAC5D,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,0BAA0B;AAErE,QAAM,UAAqE,CAAC;AAAA,IAC1E;AAAA,EACF,MAAM,eAAe,gBAAgB,MAAM;AAE3C,QAAM,QAAQ,SAIZ,UAAU,SAAS,YAAY;AAIjC,QAAM,WAAW;AAEjB,SA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G3C,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,eAAe,IAAI,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,QAAQ,OAAO,IAAI,SAAS,CAAC;AAErC,WAAO,2BAA2B,QAAQ,QAAQ,cAAc;AAAA,EAClE;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B;","names":[]}
1
+ {"version":3,"sources":["../../src/user/user.ts"],"sourcesContent":["/**\n * Generated by orval v6.9.1 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Products**, **Organisations**, **Units** and **Users**.\n\n * OpenAPI spec version: 1.0\n */\nimport {\n useQuery,\n useMutation\n} from 'react-query'\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey\n} from 'react-query'\nimport type {\n UserAccountGetResponse,\n AsError,\n UsersGetResponse\n} from '../account-server-api.schemas'\nimport { customInstance } from '.././custom-instance'\nimport type { ErrorType } from '.././custom-instance'\n\n\n// eslint-disable-next-line\n type SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P,\n) => any\n ? P\n : never;\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 return customInstance<UserAccountGetResponse>(\n {url: `/user/account`, method: 'get', signal\n },\n options);\n }\n \n\nexport const getGetUserAccountQueryKey = () => [`/user/account`];\n\n \nexport type GetUserAccountQueryResult = NonNullable<Awaited<ReturnType<typeof getUserAccount>>>\nexport type GetUserAccountQueryError = ErrorType<void | AsError>\n\nexport const useGetUserAccount = <TData = Awaited<ReturnType<typeof getUserAccount>>, TError = ErrorType<void | AsError>>(\n options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const {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 const query = useQuery<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>(queryKey, queryFn, queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n}\n\n/**\n * Gets users in an Organisation. You have to be in the Organisation or an Admin user to use this endpoint\n\n * @summary Gets users in an organisation\n */\nexport const getOrganisationUsers = (\n orgId: string,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n return customInstance<UsersGetResponse>(\n {url: `/organisation/${orgId}/user`, method: 'get', signal\n },\n options);\n }\n \n\nexport const getGetOrganisationUsersQueryKey = (orgId: string,) => [`/organisation/${orgId}/user`];\n\n \nexport type GetOrganisationUsersQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisationUsers>>>\nexport type GetOrganisationUsersQueryError = ErrorType<AsError | void>\n\nexport const useGetOrganisationUsers = <TData = Awaited<ReturnType<typeof getOrganisationUsers>>, TError = ErrorType<AsError | void>>(\n orgId: string, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const {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 const query = useQuery<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>(queryKey, queryFn, {enabled: !!(orgId), ...queryOptions}) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n}\n\n/**\n * Adds a user to an organisation. You 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 return customInstance<void>(\n {url: `/organisation/${orgId}/user/${userId}`, method: 'put'\n },\n options);\n }\n \n\n\n export type AddOrganisationUserMutationResult = NonNullable<Awaited<ReturnType<typeof addOrganisationUser>>>\n \n export type AddOrganisationUserMutationError = ErrorType<AsError>\n\n export const useAddOrganisationUser = <TError = ErrorType<AsError>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof addOrganisationUser>>, TError,{orgId: string;userId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {}\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 return useMutation<Awaited<ReturnType<typeof addOrganisationUser>>, TError, {orgId: string;userId: string}, TContext>(mutationFn, mutationOptions)\n }\n /**\n * Removes a user from an organisation. You 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 return customInstance<void>(\n {url: `/organisation/${orgId}/user/${userId}`, method: 'delete'\n },\n options);\n }\n \n\n\n export type DeleteOrganisationUserMutationResult = NonNullable<Awaited<ReturnType<typeof deleteOrganisationUser>>>\n \n export type DeleteOrganisationUserMutationError = ErrorType<AsError>\n\n export const useDeleteOrganisationUser = <TError = ErrorType<AsError>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteOrganisationUser>>, TError,{orgId: string;userId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {}\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 return useMutation<Awaited<ReturnType<typeof deleteOrganisationUser>>, TError, {orgId: string;userId: string}, TContext>(mutationFn, mutationOptions)\n }\n /**\n * Gets users in an Organisational Unit. You have to be in the Organisation or Unit or an Admin user to use this endpoint\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 return customInstance<UsersGetResponse>(\n {url: `/unit/${unitId}/user`, method: 'get', signal\n },\n options);\n }\n \n\nexport const getGetOrganisationUnitUsersQueryKey = (unitId: string,) => [`/unit/${unitId}/user`];\n\n \nexport type GetOrganisationUnitUsersQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisationUnitUsers>>>\nexport type GetOrganisationUnitUsersQueryError = ErrorType<AsError | void>\n\nexport const useGetOrganisationUnitUsers = <TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError = ErrorType<AsError | void>>(\n unitId: string, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const {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 const query = useQuery<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>(queryKey, queryFn, {enabled: !!(unitId), ...queryOptions}) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = 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 return customInstance<void>(\n {url: `/unit/${unitId}/user/${userId}`, method: 'put'\n },\n options);\n }\n \n\n\n export type AddOrganisationUnitUserMutationResult = NonNullable<Awaited<ReturnType<typeof addOrganisationUnitUser>>>\n \n export type AddOrganisationUnitUserMutationError = ErrorType<AsError>\n\n export const useAddOrganisationUnitUser = <TError = ErrorType<AsError>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof addOrganisationUnitUser>>, TError,{unitId: string;userId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {}\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 return useMutation<Awaited<ReturnType<typeof addOrganisationUnitUser>>, TError, {unitId: string;userId: string}, TContext>(mutationFn, 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 return customInstance<void>(\n {url: `/unit/${unitId}/user/${userId}`, method: 'delete'\n },\n options);\n }\n \n\n\n export type DeleteOrganisationUnitUserMutationResult = NonNullable<Awaited<ReturnType<typeof deleteOrganisationUnitUser>>>\n \n export type DeleteOrganisationUnitUserMutationError = ErrorType<AsError>\n\n export const useDeleteOrganisationUnitUser = <TError = ErrorType<AsError>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteOrganisationUnitUser>>, TError,{unitId: string;userId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {}\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 return useMutation<Awaited<ReturnType<typeof deleteOrganisationUnitUser>>, TError, {unitId: string;userId: string}, TContext>(mutationFn, mutationOptions)\n }\n "],"mappings":";;;;;AAUA;AAAA,EACE;AAAA,EACA;AAAA,OACK;AA+BA,IAAM,iBAAiB,CAE7B,SAAiD,WAC7C;AACC,SAAO;AAAA,IACP;AAAA,MAAC,KAAK;AAAA,MAAiB,QAAQ;AAAA,MAAO;AAAA,IACxC;AAAA,IACE;AAAA,EAAO;AACT;AAGG,IAAM,4BAA4B,MAAM,CAAC,eAAe;AAMxD,IAAM,oBAAoB,CAC/B,YAE8D;AAE9D,QAAM,EAAC,OAAO,cAAc,SAAS,eAAc,IAAI,WAAW,CAAC;AAEnE,QAAM,YAAW,6CAAc,aAAY,0BAA0B;AAIrE,QAAM,UAAqE,CAAC,EAAE,OAAO,MAAM,eAAe,gBAAgB,MAAM;AAEhI,QAAM,QAAQ,SAAoE,UAAU,SAAS,YAAY;AAEjH,QAAM,WAAW;AAEjB,SAAO;AACT;AAOO,IAAM,uBAAuB,CAChC,OACH,SAAiD,WAC7C;AACC,SAAO;AAAA,IACP;AAAA,MAAC,KAAK,iBAAiB;AAAA,MAAc,QAAQ;AAAA,MAAO;AAAA,IACtD;AAAA,IACE;AAAA,EAAO;AACT;AAGG,IAAM,kCAAkC,CAAC,UAAmB,CAAC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