@squonk/account-server-client 4.4.0-4-4.2197467763 → 4.4.0-4-4.2200269934

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 (185) hide show
  1. package/dist/api/actions/actions.cjs +4 -4
  2. package/dist/api/actions/actions.cjs.map +1 -1
  3. package/dist/api/actions/actions.d.cts +35 -17
  4. package/dist/api/actions/actions.d.cts.map +1 -1
  5. package/dist/api/actions/actions.d.ts +35 -17
  6. package/dist/api/actions/actions.d.ts.map +1 -1
  7. package/dist/api/actions/actions.fetch.cjs +4 -4
  8. package/dist/api/actions/actions.fetch.cjs.map +1 -1
  9. package/dist/api/actions/actions.fetch.d.cts +35 -17
  10. package/dist/api/actions/actions.fetch.d.cts.map +1 -1
  11. package/dist/api/actions/actions.fetch.d.ts +35 -17
  12. package/dist/api/actions/actions.fetch.d.ts.map +1 -1
  13. package/dist/api/actions/actions.fetch.js +4 -4
  14. package/dist/api/actions/actions.fetch.js.map +1 -1
  15. package/dist/api/actions/actions.js +4 -4
  16. package/dist/api/actions/actions.js.map +1 -1
  17. package/dist/api/asset/asset.cjs +22 -22
  18. package/dist/api/asset/asset.cjs.map +1 -1
  19. package/dist/api/asset/asset.d.cts +76 -40
  20. package/dist/api/asset/asset.d.cts.map +1 -1
  21. package/dist/api/asset/asset.d.ts +76 -40
  22. package/dist/api/asset/asset.d.ts.map +1 -1
  23. package/dist/api/asset/asset.fetch.cjs +22 -22
  24. package/dist/api/asset/asset.fetch.cjs.map +1 -1
  25. package/dist/api/asset/asset.fetch.d.cts +76 -40
  26. package/dist/api/asset/asset.fetch.d.cts.map +1 -1
  27. package/dist/api/asset/asset.fetch.d.ts +76 -40
  28. package/dist/api/asset/asset.fetch.d.ts.map +1 -1
  29. package/dist/api/asset/asset.fetch.js +22 -22
  30. package/dist/api/asset/asset.fetch.js.map +1 -1
  31. package/dist/api/asset/asset.js +22 -22
  32. package/dist/api/asset/asset.js.map +1 -1
  33. package/dist/api/charges/charges.cjs +16 -16
  34. package/dist/api/charges/charges.cjs.map +1 -1
  35. package/dist/api/charges/charges.d.cts +137 -65
  36. package/dist/api/charges/charges.d.cts.map +1 -1
  37. package/dist/api/charges/charges.d.ts +137 -65
  38. package/dist/api/charges/charges.d.ts.map +1 -1
  39. package/dist/api/charges/charges.fetch.cjs +16 -16
  40. package/dist/api/charges/charges.fetch.cjs.map +1 -1
  41. package/dist/api/charges/charges.fetch.d.cts +137 -65
  42. package/dist/api/charges/charges.fetch.d.cts.map +1 -1
  43. package/dist/api/charges/charges.fetch.d.ts +137 -65
  44. package/dist/api/charges/charges.fetch.d.ts.map +1 -1
  45. package/dist/api/charges/charges.fetch.js +16 -16
  46. package/dist/api/charges/charges.fetch.js.map +1 -1
  47. package/dist/api/charges/charges.js +16 -16
  48. package/dist/api/charges/charges.js.map +1 -1
  49. package/dist/api/event-stream/event-stream.cjs +12 -12
  50. package/dist/api/event-stream/event-stream.cjs.map +1 -1
  51. package/dist/api/event-stream/event-stream.d.cts +71 -35
  52. package/dist/api/event-stream/event-stream.d.cts.map +1 -1
  53. package/dist/api/event-stream/event-stream.d.ts +71 -35
  54. package/dist/api/event-stream/event-stream.d.ts.map +1 -1
  55. package/dist/api/event-stream/event-stream.fetch.cjs +12 -12
  56. package/dist/api/event-stream/event-stream.fetch.cjs.map +1 -1
  57. package/dist/api/event-stream/event-stream.fetch.d.cts +71 -35
  58. package/dist/api/event-stream/event-stream.fetch.d.cts.map +1 -1
  59. package/dist/api/event-stream/event-stream.fetch.d.ts +71 -35
  60. package/dist/api/event-stream/event-stream.fetch.d.ts.map +1 -1
  61. package/dist/api/event-stream/event-stream.fetch.js +12 -12
  62. package/dist/api/event-stream/event-stream.fetch.js.map +1 -1
  63. package/dist/api/event-stream/event-stream.js +12 -12
  64. package/dist/api/event-stream/event-stream.js.map +1 -1
  65. package/dist/api/merchant/merchant.cjs +8 -8
  66. package/dist/api/merchant/merchant.cjs.map +1 -1
  67. package/dist/api/merchant/merchant.d.cts +69 -33
  68. package/dist/api/merchant/merchant.d.cts.map +1 -1
  69. package/dist/api/merchant/merchant.d.ts +69 -33
  70. package/dist/api/merchant/merchant.d.ts.map +1 -1
  71. package/dist/api/merchant/merchant.fetch.cjs +8 -8
  72. package/dist/api/merchant/merchant.fetch.cjs.map +1 -1
  73. package/dist/api/merchant/merchant.fetch.d.cts +69 -33
  74. package/dist/api/merchant/merchant.fetch.d.cts.map +1 -1
  75. package/dist/api/merchant/merchant.fetch.d.ts +69 -33
  76. package/dist/api/merchant/merchant.fetch.d.ts.map +1 -1
  77. package/dist/api/merchant/merchant.fetch.js +8 -8
  78. package/dist/api/merchant/merchant.fetch.js.map +1 -1
  79. package/dist/api/merchant/merchant.js +8 -8
  80. package/dist/api/merchant/merchant.js.map +1 -1
  81. package/dist/api/organisation/organisation.cjs +18 -18
  82. package/dist/api/organisation/organisation.cjs.map +1 -1
  83. package/dist/api/organisation/organisation.d.cts +106 -52
  84. package/dist/api/organisation/organisation.d.cts.map +1 -1
  85. package/dist/api/organisation/organisation.d.ts +106 -52
  86. package/dist/api/organisation/organisation.d.ts.map +1 -1
  87. package/dist/api/organisation/organisation.fetch.cjs +18 -18
  88. package/dist/api/organisation/organisation.fetch.cjs.map +1 -1
  89. package/dist/api/organisation/organisation.fetch.d.cts +106 -52
  90. package/dist/api/organisation/organisation.fetch.d.cts.map +1 -1
  91. package/dist/api/organisation/organisation.fetch.d.ts +106 -52
  92. package/dist/api/organisation/organisation.fetch.d.ts.map +1 -1
  93. package/dist/api/organisation/organisation.fetch.js +18 -18
  94. package/dist/api/organisation/organisation.fetch.js.map +1 -1
  95. package/dist/api/organisation/organisation.js +18 -18
  96. package/dist/api/organisation/organisation.js.map +1 -1
  97. package/dist/api/product/product.cjs +30 -30
  98. package/dist/api/product/product.cjs.map +1 -1
  99. package/dist/api/product/product.d.cts +208 -100
  100. package/dist/api/product/product.d.cts.map +1 -1
  101. package/dist/api/product/product.d.ts +208 -100
  102. package/dist/api/product/product.d.ts.map +1 -1
  103. package/dist/api/product/product.fetch.cjs +30 -30
  104. package/dist/api/product/product.fetch.cjs.map +1 -1
  105. package/dist/api/product/product.fetch.d.cts +208 -100
  106. package/dist/api/product/product.fetch.d.cts.map +1 -1
  107. package/dist/api/product/product.fetch.d.ts +208 -100
  108. package/dist/api/product/product.fetch.d.ts.map +1 -1
  109. package/dist/api/product/product.fetch.js +30 -30
  110. package/dist/api/product/product.fetch.js.map +1 -1
  111. package/dist/api/product/product.js +30 -30
  112. package/dist/api/product/product.js.map +1 -1
  113. package/dist/api/state/state.cjs +4 -4
  114. package/dist/api/state/state.cjs.map +1 -1
  115. package/dist/api/state/state.d.cts +35 -17
  116. package/dist/api/state/state.d.cts.map +1 -1
  117. package/dist/api/state/state.d.ts +35 -17
  118. package/dist/api/state/state.d.ts.map +1 -1
  119. package/dist/api/state/state.fetch.cjs +4 -4
  120. package/dist/api/state/state.fetch.cjs.map +1 -1
  121. package/dist/api/state/state.fetch.d.cts +35 -17
  122. package/dist/api/state/state.fetch.d.cts.map +1 -1
  123. package/dist/api/state/state.fetch.d.ts +35 -17
  124. package/dist/api/state/state.fetch.d.ts.map +1 -1
  125. package/dist/api/state/state.fetch.js +4 -4
  126. package/dist/api/state/state.fetch.js.map +1 -1
  127. package/dist/api/state/state.js +4 -4
  128. package/dist/api/state/state.js.map +1 -1
  129. package/dist/api/unit/unit.cjs +30 -30
  130. package/dist/api/unit/unit.cjs.map +1 -1
  131. package/dist/api/unit/unit.d.cts +144 -72
  132. package/dist/api/unit/unit.d.cts.map +1 -1
  133. package/dist/api/unit/unit.d.ts +144 -72
  134. package/dist/api/unit/unit.d.ts.map +1 -1
  135. package/dist/api/unit/unit.fetch.cjs +30 -30
  136. package/dist/api/unit/unit.fetch.cjs.map +1 -1
  137. package/dist/api/unit/unit.fetch.d.cts +144 -72
  138. package/dist/api/unit/unit.fetch.d.cts.map +1 -1
  139. package/dist/api/unit/unit.fetch.d.ts +144 -72
  140. package/dist/api/unit/unit.fetch.d.ts.map +1 -1
  141. package/dist/api/unit/unit.fetch.js +30 -30
  142. package/dist/api/unit/unit.fetch.js.map +1 -1
  143. package/dist/api/unit/unit.js +30 -30
  144. package/dist/api/unit/unit.js.map +1 -1
  145. package/dist/api/user/user.cjs +20 -20
  146. package/dist/api/user/user.cjs.map +1 -1
  147. package/dist/api/user/user.d.cts +107 -53
  148. package/dist/api/user/user.d.cts.map +1 -1
  149. package/dist/api/user/user.d.ts +107 -53
  150. package/dist/api/user/user.d.ts.map +1 -1
  151. package/dist/api/user/user.fetch.cjs +20 -20
  152. package/dist/api/user/user.fetch.cjs.map +1 -1
  153. package/dist/api/user/user.fetch.d.cts +107 -53
  154. package/dist/api/user/user.fetch.d.cts.map +1 -1
  155. package/dist/api/user/user.fetch.d.ts +107 -53
  156. package/dist/api/user/user.fetch.d.ts.map +1 -1
  157. package/dist/api/user/user.fetch.js +20 -20
  158. package/dist/api/user/user.fetch.js.map +1 -1
  159. package/dist/api/user/user.js +20 -20
  160. package/dist/api/user/user.js.map +1 -1
  161. package/package.json +7 -5
  162. package/src/api/actions/actions.fetch.ts +103 -12
  163. package/src/api/actions/actions.ts +103 -12
  164. package/src/api/asset/asset.fetch.ts +303 -94
  165. package/src/api/asset/asset.ts +303 -94
  166. package/src/api/charges/charges.fetch.ts +456 -54
  167. package/src/api/charges/charges.ts +456 -54
  168. package/src/api/event-stream/event-stream.fetch.ts +262 -58
  169. package/src/api/event-stream/event-stream.ts +262 -58
  170. package/src/api/merchant/merchant.fetch.ts +212 -28
  171. package/src/api/merchant/merchant.ts +212 -28
  172. package/src/api/organisation/organisation.fetch.ts +381 -86
  173. package/src/api/organisation/organisation.ts +381 -86
  174. package/src/api/product/product.fetch.ts +724 -130
  175. package/src/api/product/product.ts +724 -130
  176. package/src/api/state/state.fetch.ts +105 -16
  177. package/src/api/state/state.ts +105 -16
  178. package/src/api/unit/unit.fetch.ts +521 -146
  179. package/src/api/unit/unit.ts +521 -146
  180. package/src/api/user/user.fetch.ts +401 -101
  181. package/src/api/user/user.ts +401 -101
  182. package/tests/README.md +98 -0
  183. package/tests/component.test.tsx +191 -0
  184. package/tests/tsconfig.json +7 -0
  185. package/tests/type-tests.tsx +196 -0
@@ -1 +1 @@
1
- {"version":3,"file":"user.fetch.js","names":["queryFn: QueryFunction<Awaited<ReturnType<typeof getUserAccount>>>","queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisationUsers>>>","mutationFn: MutationFunction<\n Awaited<ReturnType<typeof addOrganisationUser>>,\n { orgId: string; userId: string }\n >","mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteOrganisationUser>>,\n { orgId: string; userId: string }\n >","queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisationUnitUsers>>>","mutationFn: MutationFunction<\n Awaited<ReturnType<typeof addOrganisationUnitUser>>,\n { unitId: string; userId: string }\n >","mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteOrganisationUnitUser>>,\n { unitId: string; userId: string }\n >"],"sources":["../../../src/api/user/user.fetch.ts"],"sourcesContent":["/**\n * Generated by orval v7.17.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.4\n */\nimport { useMutation, useQuery, useSuspenseQuery } from \"@tanstack/react-query\";\nimport type {\n InvalidateOptions,\n MutationFunction,\n QueryClient,\n QueryFunction,\n QueryKey,\n UseMutationOptions,\n UseMutationResult,\n UseQueryOptions,\n UseQueryResult,\n UseSuspenseQueryOptions,\n UseSuspenseQueryResult,\n} from \"@tanstack/react-query\";\n\nimport type { AsError, UserAccountDetail, UsersGetResponse } from \".././api-schemas\";\n\nimport { customFetch } from \"../../custom-fetch\";\nimport type { ErrorType } from \"../../custom-fetch\";\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 type getUserAccountResponse200 = { data: UserAccountDetail; status: 200 };\n\nexport type getUserAccountResponse401 = { data: void; status: 401 };\n\nexport type getUserAccountResponse403 = { data: AsError; status: 403 };\n\nexport type getUserAccountResponseSuccess = getUserAccountResponse200 & { headers: Headers };\nexport type getUserAccountResponseError = (\n | getUserAccountResponse401\n | getUserAccountResponse403\n) & { headers: Headers };\n\nexport type getUserAccountResponse = getUserAccountResponseSuccess | getUserAccountResponseError;\n\nexport const getGetUserAccountUrl = () => {\n return `/user/account`;\n};\n\nexport const getUserAccount = async (options?: RequestInit): Promise<getUserAccountResponse> => {\n return customFetch<getUserAccountResponse>(getGetUserAccountUrl(), { ...options, method: \"GET\" });\n};\n\nexport const getGetUserAccountQueryKey = () => {\n return [\"account-server\", \"user\", \"account\"] as const;\n};\n\nexport const getGetUserAccountQueryOptions = <\n TData = Awaited<ReturnType<typeof getUserAccount>>,\n TError = ErrorType<void | AsError>,\n>(options?: {\n query?: UseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>;\n request?: SecondParameter<typeof customFetch>;\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({ signal, ...requestOptions });\n\n return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<\n Awaited<ReturnType<typeof getUserAccount>>,\n TError,\n TData\n > & { queryKey: QueryKey };\n};\n\nexport type GetUserAccountQueryResult = NonNullable<Awaited<ReturnType<typeof getUserAccount>>>;\nexport type GetUserAccountQueryError = ErrorType<void | AsError>;\n\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>(options?: {\n query?: UseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>;\n request?: SecondParameter<typeof customFetch>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } {\n const queryOptions = getGetUserAccountQueryOptions(options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * @summary Get information about your account\n */\nexport const invalidateGetUserAccount = async (\n queryClient: QueryClient,\n options?: InvalidateOptions,\n): Promise<QueryClient> => {\n await queryClient.invalidateQueries({ queryKey: getGetUserAccountQueryKey() }, options);\n\n return queryClient;\n};\n\nexport const getGetUserAccountSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getUserAccount>>,\n TError = ErrorType<void | AsError>,\n>(options?: {\n query?: UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>;\n request?: SecondParameter<typeof customFetch>;\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({ signal, ...requestOptions });\n\n return { queryKey, queryFn, ...queryOptions } as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getUserAccount>>,\n TError,\n TData\n > & { queryKey: QueryKey };\n};\n\nexport type GetUserAccountSuspenseQueryResult = NonNullable<\n Awaited<ReturnType<typeof getUserAccount>>\n>;\nexport type GetUserAccountSuspenseQueryError = ErrorType<void | AsError>;\n\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>(options?: {\n query?: UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>;\n request?: SecondParameter<typeof customFetch>;\n}): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } {\n const queryOptions = getGetUserAccountSuspenseQueryOptions(options);\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\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 type getOrganisationUsersResponse200 = { data: UsersGetResponse; status: 200 };\n\nexport type getOrganisationUsersResponse400 = { data: AsError; status: 400 };\n\nexport type getOrganisationUsersResponse401 = { data: void; status: 401 };\n\nexport type getOrganisationUsersResponse403 = { data: AsError; status: 403 };\n\nexport type getOrganisationUsersResponseSuccess = getOrganisationUsersResponse200 & {\n headers: Headers;\n};\nexport type getOrganisationUsersResponseError = (\n | getOrganisationUsersResponse400\n | getOrganisationUsersResponse401\n | getOrganisationUsersResponse403\n) & { headers: Headers };\n\nexport type getOrganisationUsersResponse =\n | getOrganisationUsersResponseSuccess\n | getOrganisationUsersResponseError;\n\nexport const getGetOrganisationUsersUrl = (orgId: string) => {\n return `/organisation/${orgId}/user`;\n};\n\nexport const getOrganisationUsers = async (\n orgId: string,\n options?: RequestInit,\n): Promise<getOrganisationUsersResponse> => {\n return customFetch<getOrganisationUsersResponse>(getGetOrganisationUsersUrl(orgId), {\n ...options,\n method: \"GET\",\n });\n};\n\nexport const getGetOrganisationUsersQueryKey = (orgId?: string) => {\n return [\"account-server\", \"organisation\", orgId, \"user\"] as const;\n};\n\nexport const getGetOrganisationUsersQueryOptions = <\n TData = Awaited<ReturnType<typeof getOrganisationUsers>>,\n TError = ErrorType<AsError | void>,\n>(\n orgId: string,\n options?: {\n query?: UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>;\n request?: SecondParameter<typeof customFetch>;\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, { signal, ...requestOptions });\n\n return { queryKey, queryFn, enabled: !!orgId, ...queryOptions } as UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUsers>>,\n TError,\n TData\n > & { queryKey: QueryKey };\n};\n\nexport type GetOrganisationUsersQueryResult = NonNullable<\n Awaited<ReturnType<typeof getOrganisationUsers>>\n>;\nexport type GetOrganisationUsersQueryError = ErrorType<AsError | void>;\n\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?: UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>;\n request?: SecondParameter<typeof customFetch>;\n },\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } {\n const queryOptions = getGetOrganisationUsersQueryOptions(orgId, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * @summary Gets users in an Organisation\n */\nexport const invalidateGetOrganisationUsers = async (\n queryClient: QueryClient,\n orgId: string,\n options?: InvalidateOptions,\n): Promise<QueryClient> => {\n await queryClient.invalidateQueries(\n { queryKey: getGetOrganisationUsersQueryKey(orgId) },\n options,\n );\n\n return queryClient;\n};\n\nexport const getGetOrganisationUsersSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getOrganisationUsers>>,\n TError = ErrorType<AsError | void>,\n>(\n orgId: string,\n options?: {\n query?: UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUsers>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customFetch>;\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, { signal, ...requestOptions });\n\n return { queryKey, queryFn, ...queryOptions } as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUsers>>,\n TError,\n TData\n > & { queryKey: QueryKey };\n};\n\nexport type GetOrganisationUsersSuspenseQueryResult = NonNullable<\n Awaited<ReturnType<typeof getOrganisationUsers>>\n>;\nexport type GetOrganisationUsersSuspenseQueryError = ErrorType<AsError | void>;\n\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?: UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUsers>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } {\n const queryOptions = getGetOrganisationUsersSuspenseQueryOptions(orgId, options);\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\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 type addOrganisationUserResponse201 = { data: void; status: 201 };\n\nexport type addOrganisationUserResponse400 = { data: AsError; status: 400 };\n\nexport type addOrganisationUserResponse401 = { data: void; status: 401 };\n\nexport type addOrganisationUserResponse403 = { data: AsError; status: 403 };\n\nexport type addOrganisationUserResponseSuccess = addOrganisationUserResponse201 & {\n headers: Headers;\n};\nexport type addOrganisationUserResponseError = (\n | addOrganisationUserResponse400\n | addOrganisationUserResponse401\n | addOrganisationUserResponse403\n) & { headers: Headers };\n\nexport type addOrganisationUserResponse =\n | addOrganisationUserResponseSuccess\n | addOrganisationUserResponseError;\n\nexport const getAddOrganisationUserUrl = (orgId: string, userId: string) => {\n return `/organisation/${orgId}/user/${userId}`;\n};\n\nexport const addOrganisationUser = async (\n orgId: string,\n userId: string,\n options?: RequestInit,\n): Promise<addOrganisationUserResponse> => {\n return customFetch<addOrganisationUserResponse>(getAddOrganisationUserUrl(orgId, userId), {\n ...options,\n method: \"PUT\",\n });\n};\n\nexport const getAddOrganisationUserMutationOptions = <\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 customFetch>;\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 return { mutationFn, ...mutationOptions };\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 = <\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 customFetch>;\n}): UseMutationResult<\n Awaited<ReturnType<typeof addOrganisationUser>>,\n TError,\n { orgId: string; userId: string },\n TContext\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 type deleteOrganisationUserResponse204 = { data: void; status: 204 };\n\nexport type deleteOrganisationUserResponse400 = { data: AsError; status: 400 };\n\nexport type deleteOrganisationUserResponse401 = { data: void; status: 401 };\n\nexport type deleteOrganisationUserResponse403 = { data: AsError; status: 403 };\n\nexport type deleteOrganisationUserResponseSuccess = deleteOrganisationUserResponse204 & {\n headers: Headers;\n};\nexport type deleteOrganisationUserResponseError = (\n | deleteOrganisationUserResponse400\n | deleteOrganisationUserResponse401\n | deleteOrganisationUserResponse403\n) & { headers: Headers };\n\nexport type deleteOrganisationUserResponse =\n | deleteOrganisationUserResponseSuccess\n | deleteOrganisationUserResponseError;\n\nexport const getDeleteOrganisationUserUrl = (orgId: string, userId: string) => {\n return `/organisation/${orgId}/user/${userId}`;\n};\n\nexport const deleteOrganisationUser = async (\n orgId: string,\n userId: string,\n options?: RequestInit,\n): Promise<deleteOrganisationUserResponse> => {\n return customFetch<deleteOrganisationUserResponse>(getDeleteOrganisationUserUrl(orgId, userId), {\n ...options,\n method: \"DELETE\",\n });\n};\n\nexport const getDeleteOrganisationUserMutationOptions = <\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 customFetch>;\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 return { mutationFn, ...mutationOptions };\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 = <\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 customFetch>;\n}): UseMutationResult<\n Awaited<ReturnType<typeof deleteOrganisationUser>>,\n TError,\n { orgId: string; userId: string },\n TContext\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 type getOrganisationUnitUsersResponse200 = { data: UsersGetResponse; status: 200 };\n\nexport type getOrganisationUnitUsersResponse400 = { data: AsError; status: 400 };\n\nexport type getOrganisationUnitUsersResponse401 = { data: void; status: 401 };\n\nexport type getOrganisationUnitUsersResponse403 = { data: AsError; status: 403 };\n\nexport type getOrganisationUnitUsersResponseSuccess = getOrganisationUnitUsersResponse200 & {\n headers: Headers;\n};\nexport type getOrganisationUnitUsersResponseError = (\n | getOrganisationUnitUsersResponse400\n | getOrganisationUnitUsersResponse401\n | getOrganisationUnitUsersResponse403\n) & { headers: Headers };\n\nexport type getOrganisationUnitUsersResponse =\n | getOrganisationUnitUsersResponseSuccess\n | getOrganisationUnitUsersResponseError;\n\nexport const getGetOrganisationUnitUsersUrl = (unitId: string) => {\n return `/unit/${unitId}/user`;\n};\n\nexport const getOrganisationUnitUsers = async (\n unitId: string,\n options?: RequestInit,\n): Promise<getOrganisationUnitUsersResponse> => {\n return customFetch<getOrganisationUnitUsersResponse>(getGetOrganisationUnitUsersUrl(unitId), {\n ...options,\n method: \"GET\",\n });\n};\n\nexport const getGetOrganisationUnitUsersQueryKey = (unitId?: string) => {\n return [\"account-server\", \"unit\", unitId, \"user\"] as const;\n};\n\nexport const getGetOrganisationUnitUsersQueryOptions = <\n TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>,\n TError = ErrorType<AsError | void>,\n>(\n unitId: string,\n options?: {\n query?: UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>;\n request?: SecondParameter<typeof customFetch>;\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, { signal, ...requestOptions });\n\n return { queryKey, queryFn, enabled: !!unitId, ...queryOptions } as UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUnitUsers>>,\n TError,\n TData\n > & { queryKey: QueryKey };\n};\n\nexport type GetOrganisationUnitUsersQueryResult = NonNullable<\n Awaited<ReturnType<typeof getOrganisationUnitUsers>>\n>;\nexport type GetOrganisationUnitUsersQueryError = ErrorType<AsError | void>;\n\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?: UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>;\n request?: SecondParameter<typeof customFetch>;\n },\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } {\n const queryOptions = getGetOrganisationUnitUsersQueryOptions(unitId, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * @summary Gets users in an Organisational Unit\n */\nexport const invalidateGetOrganisationUnitUsers = async (\n queryClient: QueryClient,\n unitId: string,\n options?: InvalidateOptions,\n): Promise<QueryClient> => {\n await queryClient.invalidateQueries(\n { queryKey: getGetOrganisationUnitUsersQueryKey(unitId) },\n options,\n );\n\n return queryClient;\n};\n\nexport const getGetOrganisationUnitUsersSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>,\n TError = ErrorType<AsError | void>,\n>(\n unitId: string,\n options?: {\n query?: UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUnitUsers>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customFetch>;\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, { signal, ...requestOptions });\n\n return { queryKey, queryFn, ...queryOptions } as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUnitUsers>>,\n TError,\n TData\n > & { queryKey: QueryKey };\n};\n\nexport type GetOrganisationUnitUsersSuspenseQueryResult = NonNullable<\n Awaited<ReturnType<typeof getOrganisationUnitUsers>>\n>;\nexport type GetOrganisationUnitUsersSuspenseQueryError = ErrorType<AsError | void>;\n\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?: UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUnitUsers>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } {\n const queryOptions = getGetOrganisationUnitUsersSuspenseQueryOptions(unitId, options);\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\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 type addOrganisationUnitUserResponse201 = { data: void; status: 201 };\n\nexport type addOrganisationUnitUserResponse400 = { data: AsError; status: 400 };\n\nexport type addOrganisationUnitUserResponse401 = { data: void; status: 401 };\n\nexport type addOrganisationUnitUserResponse403 = { data: AsError; status: 403 };\n\nexport type addOrganisationUnitUserResponseSuccess = addOrganisationUnitUserResponse201 & {\n headers: Headers;\n};\nexport type addOrganisationUnitUserResponseError = (\n | addOrganisationUnitUserResponse400\n | addOrganisationUnitUserResponse401\n | addOrganisationUnitUserResponse403\n) & { headers: Headers };\n\nexport type addOrganisationUnitUserResponse =\n | addOrganisationUnitUserResponseSuccess\n | addOrganisationUnitUserResponseError;\n\nexport const getAddOrganisationUnitUserUrl = (unitId: string, userId: string) => {\n return `/unit/${unitId}/user/${userId}`;\n};\n\nexport const addOrganisationUnitUser = async (\n unitId: string,\n userId: string,\n options?: RequestInit,\n): Promise<addOrganisationUnitUserResponse> => {\n return customFetch<addOrganisationUnitUserResponse>(\n getAddOrganisationUnitUserUrl(unitId, userId),\n { ...options, method: \"PUT\" },\n );\n};\n\nexport const getAddOrganisationUnitUserMutationOptions = <\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 customFetch>;\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 return { mutationFn, ...mutationOptions };\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 = <\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 customFetch>;\n}): UseMutationResult<\n Awaited<ReturnType<typeof addOrganisationUnitUser>>,\n TError,\n { unitId: string; userId: string },\n TContext\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 type deleteOrganisationUnitUserResponse204 = { data: void; status: 204 };\n\nexport type deleteOrganisationUnitUserResponse400 = { data: AsError; status: 400 };\n\nexport type deleteOrganisationUnitUserResponse401 = { data: void; status: 401 };\n\nexport type deleteOrganisationUnitUserResponse403 = { data: AsError; status: 403 };\n\nexport type deleteOrganisationUnitUserResponseSuccess = deleteOrganisationUnitUserResponse204 & {\n headers: Headers;\n};\nexport type deleteOrganisationUnitUserResponseError = (\n | deleteOrganisationUnitUserResponse400\n | deleteOrganisationUnitUserResponse401\n | deleteOrganisationUnitUserResponse403\n) & { headers: Headers };\n\nexport type deleteOrganisationUnitUserResponse =\n | deleteOrganisationUnitUserResponseSuccess\n | deleteOrganisationUnitUserResponseError;\n\nexport const getDeleteOrganisationUnitUserUrl = (unitId: string, userId: string) => {\n return `/unit/${unitId}/user/${userId}`;\n};\n\nexport const deleteOrganisationUnitUser = async (\n unitId: string,\n userId: string,\n options?: RequestInit,\n): Promise<deleteOrganisationUnitUserResponse> => {\n return customFetch<deleteOrganisationUnitUserResponse>(\n getDeleteOrganisationUnitUserUrl(unitId, userId),\n { ...options, method: \"DELETE\" },\n );\n};\n\nexport const getDeleteOrganisationUnitUserMutationOptions = <\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 customFetch>;\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 return { mutationFn, ...mutationOptions };\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>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteOrganisationUnitUser>>,\n TError,\n { unitId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n}): UseMutationResult<\n Awaited<ReturnType<typeof deleteOrganisationUnitUser>>,\n TError,\n { unitId: string; userId: string },\n TContext\n> => {\n const mutationOptions = getDeleteOrganisationUnitUserMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n"],"mappings":";;;;;;;;;;;;;;AAmDA,MAAa,6BAA6B;AACxC,QAAO;;AAGT,MAAa,iBAAiB,OAAO,YAA2D;AAC9F,QAAO,YAAoC,sBAAsB,EAAE;EAAE,GAAG;EAAS,QAAQ;EAAO,CAAC;;AAGnG,MAAa,kCAAkC;AAC7C,QAAO;EAAC;EAAkB;EAAQ;EAAU;;AAG9C,MAAa,iCAGX,YAGI;CACJ,MAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,EAAE;CAEtE,MAAM,WAAW,cAAc,YAAY,2BAA2B;CAEtE,MAAMA,WAAsE,EAAE,aAC5E,eAAe;EAAE;EAAQ,GAAG;EAAgB,CAAC;AAE/C,QAAO;EAAE;EAAU;EAAS,GAAG;EAAc;;;;;AAc/C,SAAgB,kBAGd,SAGyD;CACzD,MAAM,eAAe,8BAA8B,QAAQ;CAE3D,MAAM,QAAQ,SAAS,aAAa;AAEpC,OAAM,WAAW,aAAa;AAE9B,QAAO;;;;;AAMT,MAAa,2BAA2B,OACtC,aACA,YACyB;AACzB,OAAM,YAAY,kBAAkB,EAAE,UAAU,2BAA2B,EAAE,EAAE,QAAQ;AAEvF,QAAO;;AAGT,MAAa,yCA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,WAAmB;AAClF,QAAO,SAAS,OAAO,QAAQ;;AAGjC,MAAa,6BAA6B,OACxC,QACA,QACA,YACgD;AAChD,QAAO,YACL,iCAAiC,QAAQ,OAAO,EAChD;EAAE,GAAG;EAAS,QAAQ;EAAU,CACjC;;AAGH,MAAa,gDAGX,YAaG;CACH,MAAM,cAAc,CAAC,6BAA6B;CAClD,MAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,UAC3D,QAAQ,YAAY,iBAAiB,QAAQ,YAAY,QAAQ,SAAS,cACxE,UACA;EAAE,GAAG;EAAS,UAAU;GAAE,GAAG,QAAQ;GAAU;GAAa;EAAE,GAChE;EAAE,UAAU,EAAE,aAAa;EAAE,SAAS;EAAW;CAErD,MAAMC,cAGD,UAAU;EACb,MAAM,EAAE,QAAQ,WAAW,SAAS,EAAE;AAEtC,SAAO,2BAA2B,QAAQ,QAAQ,eAAe;;AAGnE,QAAO;EAAE;EAAY,GAAG;EAAiB;;;;;AAY3C,MAAa,iCAGX,YAaG;AAGH,QAAO,YAFiB,6CAA6C,QAAQ,CAE1C"}
1
+ {"version":3,"file":"user.fetch.js","names":["queryFn: QueryFunction<Awaited<ReturnType<typeof getUserAccount>>>","queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisationUsers>>>","mutationFn: MutationFunction<\n Awaited<ReturnType<typeof addOrganisationUser>>,\n { orgId: string; userId: string }\n >","mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteOrganisationUser>>,\n { orgId: string; userId: string }\n >","queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisationUnitUsers>>>","mutationFn: MutationFunction<\n Awaited<ReturnType<typeof addOrganisationUnitUser>>,\n { unitId: string; userId: string }\n >","mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteOrganisationUnitUser>>,\n { unitId: string; userId: string }\n >"],"sources":["../../../src/api/user/user.fetch.ts"],"sourcesContent":["/**\n * Generated by orval v7.17.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.4\n */\nimport { useMutation, useQuery, useSuspenseQuery } from \"@tanstack/react-query\";\nimport type {\n DataTag,\n DefinedInitialDataOptions,\n DefinedUseQueryResult,\n InvalidateOptions,\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 \".././api-schemas\";\n\nimport { customFetch } from \"../../custom-fetch\";\nimport type { ErrorType } from \"../../custom-fetch\";\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 type getUserAccountResponse200 = { data: UserAccountDetail; status: 200 };\n\nexport type getUserAccountResponse401 = { data: void; status: 401 };\n\nexport type getUserAccountResponse403 = { data: AsError; status: 403 };\n\nexport type getUserAccountResponseSuccess = getUserAccountResponse200 & { headers: Headers };\nexport type getUserAccountResponseError = (\n | getUserAccountResponse401\n | getUserAccountResponse403\n) & { headers: Headers };\n\nexport type getUserAccountResponse = getUserAccountResponseSuccess | getUserAccountResponseError;\n\nexport const getGetUserAccountUrl = () => {\n return `/user/account`;\n};\n\nexport const getUserAccount = async (options?: RequestInit): Promise<getUserAccountResponse> => {\n return customFetch<getUserAccountResponse>(getGetUserAccountUrl(), { ...options, method: \"GET\" });\n};\n\nexport const getGetUserAccountQueryKey = () => {\n return [\"account-server\", \"user\", \"account\"] as const;\n};\n\nexport const getGetUserAccountQueryOptions = <\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 customFetch>;\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({ signal, ...requestOptions });\n\n return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<\n Awaited<ReturnType<typeof getUserAccount>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData> };\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 customFetch>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\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 customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\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 customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\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 customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {\n const queryOptions = getGetUserAccountQueryOptions(options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData>;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * @summary Get information about your account\n */\nexport const invalidateGetUserAccount = async (\n queryClient: QueryClient,\n options?: InvalidateOptions,\n): Promise<QueryClient> => {\n await queryClient.invalidateQueries({ queryKey: getGetUserAccountQueryKey() }, options);\n\n return queryClient;\n};\n\nexport const getGetUserAccountSuspenseQueryOptions = <\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 customFetch>;\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({ signal, ...requestOptions });\n\n return { queryKey, queryFn, ...queryOptions } as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getUserAccount>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData> };\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 customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\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 customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\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 customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\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 customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {\n const queryOptions = getGetUserAccountSuspenseQueryOptions(options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData> };\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 type getOrganisationUsersResponse200 = { data: UsersGetResponse; status: 200 };\n\nexport type getOrganisationUsersResponse400 = { data: AsError; status: 400 };\n\nexport type getOrganisationUsersResponse401 = { data: void; status: 401 };\n\nexport type getOrganisationUsersResponse403 = { data: AsError; status: 403 };\n\nexport type getOrganisationUsersResponseSuccess = getOrganisationUsersResponse200 & {\n headers: Headers;\n};\nexport type getOrganisationUsersResponseError = (\n | getOrganisationUsersResponse400\n | getOrganisationUsersResponse401\n | getOrganisationUsersResponse403\n) & { headers: Headers };\n\nexport type getOrganisationUsersResponse =\n | getOrganisationUsersResponseSuccess\n | getOrganisationUsersResponseError;\n\nexport const getGetOrganisationUsersUrl = (orgId: string) => {\n return `/organisation/${orgId}/user`;\n};\n\nexport const getOrganisationUsers = async (\n orgId: string,\n options?: RequestInit,\n): Promise<getOrganisationUsersResponse> => {\n return customFetch<getOrganisationUsersResponse>(getGetOrganisationUsersUrl(orgId), {\n ...options,\n method: \"GET\",\n });\n};\n\nexport const getGetOrganisationUsersQueryKey = (orgId?: string) => {\n return [\"account-server\", \"organisation\", orgId, \"user\"] as const;\n};\n\nexport const getGetOrganisationUsersQueryOptions = <\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 customFetch>;\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, { signal, ...requestOptions });\n\n return { queryKey, queryFn, enabled: !!orgId, ...queryOptions } as UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUsers>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData> };\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 customFetch>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\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 customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\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 customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\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 customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {\n const queryOptions = getGetOrganisationUsersQueryOptions(orgId, options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData>;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * @summary Gets users in an Organisation\n */\nexport const invalidateGetOrganisationUsers = async (\n queryClient: QueryClient,\n orgId: string,\n options?: InvalidateOptions,\n): Promise<QueryClient> => {\n await queryClient.invalidateQueries(\n { queryKey: getGetOrganisationUsersQueryKey(orgId) },\n options,\n );\n\n return queryClient;\n};\n\nexport const getGetOrganisationUsersSuspenseQueryOptions = <\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 customFetch>;\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, { signal, ...requestOptions });\n\n return { queryKey, queryFn, ...queryOptions } as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUsers>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData> };\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 customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\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 customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\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 customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\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 customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {\n const queryOptions = getGetOrganisationUsersSuspenseQueryOptions(orgId, options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData> };\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 type addOrganisationUserResponse201 = { data: void; status: 201 };\n\nexport type addOrganisationUserResponse400 = { data: AsError; status: 400 };\n\nexport type addOrganisationUserResponse401 = { data: void; status: 401 };\n\nexport type addOrganisationUserResponse403 = { data: AsError; status: 403 };\n\nexport type addOrganisationUserResponseSuccess = addOrganisationUserResponse201 & {\n headers: Headers;\n};\nexport type addOrganisationUserResponseError = (\n | addOrganisationUserResponse400\n | addOrganisationUserResponse401\n | addOrganisationUserResponse403\n) & { headers: Headers };\n\nexport type addOrganisationUserResponse =\n | addOrganisationUserResponseSuccess\n | addOrganisationUserResponseError;\n\nexport const getAddOrganisationUserUrl = (orgId: string, userId: string) => {\n return `/organisation/${orgId}/user/${userId}`;\n};\n\nexport const addOrganisationUser = async (\n orgId: string,\n userId: string,\n options?: RequestInit,\n): Promise<addOrganisationUserResponse> => {\n return customFetch<addOrganisationUserResponse>(getAddOrganisationUserUrl(orgId, userId), {\n ...options,\n method: \"PUT\",\n });\n};\n\nexport const getAddOrganisationUserMutationOptions = <\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 customFetch>;\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 return { mutationFn, ...mutationOptions };\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 customFetch>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof addOrganisationUser>>,\n TError,\n { orgId: string; userId: string },\n TContext\n> => {\n const mutationOptions = getAddOrganisationUserMutationOptions(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 type deleteOrganisationUserResponse204 = { data: void; status: 204 };\n\nexport type deleteOrganisationUserResponse400 = { data: AsError; status: 400 };\n\nexport type deleteOrganisationUserResponse401 = { data: void; status: 401 };\n\nexport type deleteOrganisationUserResponse403 = { data: AsError; status: 403 };\n\nexport type deleteOrganisationUserResponseSuccess = deleteOrganisationUserResponse204 & {\n headers: Headers;\n};\nexport type deleteOrganisationUserResponseError = (\n | deleteOrganisationUserResponse400\n | deleteOrganisationUserResponse401\n | deleteOrganisationUserResponse403\n) & { headers: Headers };\n\nexport type deleteOrganisationUserResponse =\n | deleteOrganisationUserResponseSuccess\n | deleteOrganisationUserResponseError;\n\nexport const getDeleteOrganisationUserUrl = (orgId: string, userId: string) => {\n return `/organisation/${orgId}/user/${userId}`;\n};\n\nexport const deleteOrganisationUser = async (\n orgId: string,\n userId: string,\n options?: RequestInit,\n): Promise<deleteOrganisationUserResponse> => {\n return customFetch<deleteOrganisationUserResponse>(getDeleteOrganisationUserUrl(orgId, userId), {\n ...options,\n method: \"DELETE\",\n });\n};\n\nexport const getDeleteOrganisationUserMutationOptions = <\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 customFetch>;\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 return { mutationFn, ...mutationOptions };\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 customFetch>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof deleteOrganisationUser>>,\n TError,\n { orgId: string; userId: string },\n TContext\n> => {\n const mutationOptions = getDeleteOrganisationUserMutationOptions(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 type getOrganisationUnitUsersResponse200 = { data: UsersGetResponse; status: 200 };\n\nexport type getOrganisationUnitUsersResponse400 = { data: AsError; status: 400 };\n\nexport type getOrganisationUnitUsersResponse401 = { data: void; status: 401 };\n\nexport type getOrganisationUnitUsersResponse403 = { data: AsError; status: 403 };\n\nexport type getOrganisationUnitUsersResponseSuccess = getOrganisationUnitUsersResponse200 & {\n headers: Headers;\n};\nexport type getOrganisationUnitUsersResponseError = (\n | getOrganisationUnitUsersResponse400\n | getOrganisationUnitUsersResponse401\n | getOrganisationUnitUsersResponse403\n) & { headers: Headers };\n\nexport type getOrganisationUnitUsersResponse =\n | getOrganisationUnitUsersResponseSuccess\n | getOrganisationUnitUsersResponseError;\n\nexport const getGetOrganisationUnitUsersUrl = (unitId: string) => {\n return `/unit/${unitId}/user`;\n};\n\nexport const getOrganisationUnitUsers = async (\n unitId: string,\n options?: RequestInit,\n): Promise<getOrganisationUnitUsersResponse> => {\n return customFetch<getOrganisationUnitUsersResponse>(getGetOrganisationUnitUsersUrl(unitId), {\n ...options,\n method: \"GET\",\n });\n};\n\nexport const getGetOrganisationUnitUsersQueryKey = (unitId?: string) => {\n return [\"account-server\", \"unit\", unitId, \"user\"] as const;\n};\n\nexport const getGetOrganisationUnitUsersQueryOptions = <\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 customFetch>;\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, { signal, ...requestOptions });\n\n return { queryKey, queryFn, enabled: !!unitId, ...queryOptions } as UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUnitUsers>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData> };\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 customFetch>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\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 customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\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 customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\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 customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {\n const queryOptions = getGetOrganisationUnitUsersQueryOptions(unitId, options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData>;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * @summary Gets users in an Organisational Unit\n */\nexport const invalidateGetOrganisationUnitUsers = async (\n queryClient: QueryClient,\n unitId: string,\n options?: InvalidateOptions,\n): Promise<QueryClient> => {\n await queryClient.invalidateQueries(\n { queryKey: getGetOrganisationUnitUsersQueryKey(unitId) },\n options,\n );\n\n return queryClient;\n};\n\nexport const getGetOrganisationUnitUsersSuspenseQueryOptions = <\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 customFetch>;\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, { signal, ...requestOptions });\n\n return { queryKey, queryFn, ...queryOptions } as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUnitUsers>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData> };\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 customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\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 customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\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 customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\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 customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {\n const queryOptions = getGetOrganisationUnitUsersSuspenseQueryOptions(unitId, options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData> };\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 type addOrganisationUnitUserResponse201 = { data: void; status: 201 };\n\nexport type addOrganisationUnitUserResponse400 = { data: AsError; status: 400 };\n\nexport type addOrganisationUnitUserResponse401 = { data: void; status: 401 };\n\nexport type addOrganisationUnitUserResponse403 = { data: AsError; status: 403 };\n\nexport type addOrganisationUnitUserResponseSuccess = addOrganisationUnitUserResponse201 & {\n headers: Headers;\n};\nexport type addOrganisationUnitUserResponseError = (\n | addOrganisationUnitUserResponse400\n | addOrganisationUnitUserResponse401\n | addOrganisationUnitUserResponse403\n) & { headers: Headers };\n\nexport type addOrganisationUnitUserResponse =\n | addOrganisationUnitUserResponseSuccess\n | addOrganisationUnitUserResponseError;\n\nexport const getAddOrganisationUnitUserUrl = (unitId: string, userId: string) => {\n return `/unit/${unitId}/user/${userId}`;\n};\n\nexport const addOrganisationUnitUser = async (\n unitId: string,\n userId: string,\n options?: RequestInit,\n): Promise<addOrganisationUnitUserResponse> => {\n return customFetch<addOrganisationUnitUserResponse>(\n getAddOrganisationUnitUserUrl(unitId, userId),\n { ...options, method: \"PUT\" },\n );\n};\n\nexport const getAddOrganisationUnitUserMutationOptions = <\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 customFetch>;\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 return { mutationFn, ...mutationOptions };\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 customFetch>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof addOrganisationUnitUser>>,\n TError,\n { unitId: string; userId: string },\n TContext\n> => {\n const mutationOptions = getAddOrganisationUnitUserMutationOptions(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 type deleteOrganisationUnitUserResponse204 = { data: void; status: 204 };\n\nexport type deleteOrganisationUnitUserResponse400 = { data: AsError; status: 400 };\n\nexport type deleteOrganisationUnitUserResponse401 = { data: void; status: 401 };\n\nexport type deleteOrganisationUnitUserResponse403 = { data: AsError; status: 403 };\n\nexport type deleteOrganisationUnitUserResponseSuccess = deleteOrganisationUnitUserResponse204 & {\n headers: Headers;\n};\nexport type deleteOrganisationUnitUserResponseError = (\n | deleteOrganisationUnitUserResponse400\n | deleteOrganisationUnitUserResponse401\n | deleteOrganisationUnitUserResponse403\n) & { headers: Headers };\n\nexport type deleteOrganisationUnitUserResponse =\n | deleteOrganisationUnitUserResponseSuccess\n | deleteOrganisationUnitUserResponseError;\n\nexport const getDeleteOrganisationUnitUserUrl = (unitId: string, userId: string) => {\n return `/unit/${unitId}/user/${userId}`;\n};\n\nexport const deleteOrganisationUnitUser = async (\n unitId: string,\n userId: string,\n options?: RequestInit,\n): Promise<deleteOrganisationUnitUserResponse> => {\n return customFetch<deleteOrganisationUnitUserResponse>(\n getDeleteOrganisationUnitUserUrl(unitId, userId),\n { ...options, method: \"DELETE\" },\n );\n};\n\nexport const getDeleteOrganisationUnitUserMutationOptions = <\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 customFetch>;\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 return { mutationFn, ...mutationOptions };\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 customFetch>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof deleteOrganisationUnitUser>>,\n TError,\n { unitId: string; userId: string },\n TContext\n> => {\n const mutationOptions = getDeleteOrganisationUnitUserMutationOptions(options);\n\n return useMutation(mutationOptions, queryClient);\n};\n"],"mappings":";;;;;;;;;;;;;;AAuDA,MAAa,6BAA6B;AACxC,QAAO;;AAGT,MAAa,iBAAiB,OAAO,YAA2D;AAC9F,QAAO,YAAoC,sBAAsB,EAAE;EAAE,GAAG;EAAS,QAAQ;EAAO,CAAC;;AAGnG,MAAa,kCAAkC;AAC7C,QAAO;EAAC;EAAkB;EAAQ;EAAU;;AAG9C,MAAa,iCAGX,YAGI;CACJ,MAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,W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 @@ const getGetUserAccountQueryOptions = (options) => {
44
44
  /**
45
45
  * @summary Get information about your account
46
46
  */
47
- function useGetUserAccount(options) {
47
+ function useGetUserAccount(options, queryClient) {
48
48
  const queryOptions = getGetUserAccountQueryOptions(options);
49
- const query = useQuery(queryOptions);
49
+ const query = useQuery(queryOptions, queryClient);
50
50
  query.queryKey = queryOptions.queryKey;
51
51
  return query;
52
52
  }
@@ -70,9 +70,9 @@ const getGetUserAccountSuspenseQueryOptions = (options) => {
70
70
  /**
71
71
  * @summary Get information about your account
72
72
  */
73
- function useGetUserAccountSuspense(options) {
73
+ function useGetUserAccountSuspense(options, queryClient) {
74
74
  const queryOptions = getGetUserAccountSuspenseQueryOptions(options);
75
- const query = useSuspenseQuery(queryOptions);
75
+ const query = useSuspenseQuery(queryOptions, queryClient);
76
76
  query.queryKey = queryOptions.queryKey;
77
77
  return query;
78
78
  }
@@ -114,9 +114,9 @@ const getGetOrganisationUsersQueryOptions = (orgId, options) => {
114
114
  /**
115
115
  * @summary Gets users in an Organisation
116
116
  */
117
- function useGetOrganisationUsers(orgId, options) {
117
+ function useGetOrganisationUsers(orgId, options, queryClient) {
118
118
  const queryOptions = getGetOrganisationUsersQueryOptions(orgId, options);
119
- const query = useQuery(queryOptions);
119
+ const query = useQuery(queryOptions, queryClient);
120
120
  query.queryKey = queryOptions.queryKey;
121
121
  return query;
122
122
  }
@@ -140,9 +140,9 @@ const getGetOrganisationUsersSuspenseQueryOptions = (orgId, options) => {
140
140
  /**
141
141
  * @summary Gets users in an Organisation
142
142
  */
143
- function useGetOrganisationUsersSuspense(orgId, options) {
143
+ function useGetOrganisationUsersSuspense(orgId, options, queryClient) {
144
144
  const queryOptions = getGetOrganisationUsersSuspenseQueryOptions(orgId, options);
145
- const query = useSuspenseQuery(queryOptions);
145
+ const query = useSuspenseQuery(queryOptions, queryClient);
146
146
  query.queryKey = queryOptions.queryKey;
147
147
  return query;
148
148
  }
@@ -183,8 +183,8 @@ const getAddOrganisationUserMutationOptions = (options) => {
183
183
  /**
184
184
  * @summary Adds a User to an Organisation
185
185
  */
186
- const useAddOrganisationUser = (options) => {
187
- return useMutation(getAddOrganisationUserMutationOptions(options));
186
+ const useAddOrganisationUser = (options, queryClient) => {
187
+ return useMutation(getAddOrganisationUserMutationOptions(options), queryClient);
188
188
  };
189
189
  /**
190
190
  * Removes a User from an **Organisation**.
@@ -223,8 +223,8 @@ const getDeleteOrganisationUserMutationOptions = (options) => {
223
223
  /**
224
224
  * @summary Deletes a User from an Organisation
225
225
  */
226
- const useDeleteOrganisationUser = (options) => {
227
- return useMutation(getDeleteOrganisationUserMutationOptions(options));
226
+ const useDeleteOrganisationUser = (options, queryClient) => {
227
+ return useMutation(getDeleteOrganisationUserMutationOptions(options), queryClient);
228
228
  };
229
229
  /**
230
230
  * Gets users in an Organisational Unit.
@@ -264,9 +264,9 @@ const getGetOrganisationUnitUsersQueryOptions = (unitId, options) => {
264
264
  /**
265
265
  * @summary Gets users in an Organisational Unit
266
266
  */
267
- function useGetOrganisationUnitUsers(unitId, options) {
267
+ function useGetOrganisationUnitUsers(unitId, options, queryClient) {
268
268
  const queryOptions = getGetOrganisationUnitUsersQueryOptions(unitId, options);
269
- const query = useQuery(queryOptions);
269
+ const query = useQuery(queryOptions, queryClient);
270
270
  query.queryKey = queryOptions.queryKey;
271
271
  return query;
272
272
  }
@@ -290,9 +290,9 @@ const getGetOrganisationUnitUsersSuspenseQueryOptions = (unitId, options) => {
290
290
  /**
291
291
  * @summary Gets users in an Organisational Unit
292
292
  */
293
- function useGetOrganisationUnitUsersSuspense(unitId, options) {
293
+ function useGetOrganisationUnitUsersSuspense(unitId, options, queryClient) {
294
294
  const queryOptions = getGetOrganisationUnitUsersSuspenseQueryOptions(unitId, options);
295
- const query = useSuspenseQuery(queryOptions);
295
+ const query = useSuspenseQuery(queryOptions, queryClient);
296
296
  query.queryKey = queryOptions.queryKey;
297
297
  return query;
298
298
  }
@@ -335,8 +335,8 @@ const getAddOrganisationUnitUserMutationOptions = (options) => {
335
335
  /**
336
336
  * @summary Adds a user to an Organisational Unit
337
337
  */
338
- const useAddOrganisationUnitUser = (options) => {
339
- return useMutation(getAddOrganisationUnitUserMutationOptions(options));
338
+ const useAddOrganisationUnitUser = (options, queryClient) => {
339
+ return useMutation(getAddOrganisationUnitUserMutationOptions(options), queryClient);
340
340
  };
341
341
  /**
342
342
  * Removes a User from an Organisational Unit.
@@ -377,8 +377,8 @@ const getDeleteOrganisationUnitUserMutationOptions = (options) => {
377
377
  /**
378
378
  * @summary Deletes a User from an Organisational Unit
379
379
  */
380
- const useDeleteOrganisationUnitUser = (options) => {
381
- return useMutation(getDeleteOrganisationUnitUserMutationOptions(options));
380
+ const useDeleteOrganisationUnitUser = (options, queryClient) => {
381
+ return useMutation(getDeleteOrganisationUnitUserMutationOptions(options), queryClient);
382
382
  };
383
383
 
384
384
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"user.js","names":["queryFn: QueryFunction<Awaited<ReturnType<typeof getUserAccount>>>","queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisationUsers>>>","mutationFn: MutationFunction<\n Awaited<ReturnType<typeof addOrganisationUser>>,\n { orgId: string; userId: string }\n >","mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteOrganisationUser>>,\n { orgId: string; userId: string }\n >","queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisationUnitUsers>>>","mutationFn: MutationFunction<\n Awaited<ReturnType<typeof addOrganisationUnitUser>>,\n { unitId: string; userId: string }\n >","mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteOrganisationUnitUser>>,\n { unitId: string; userId: string }\n >"],"sources":["../../../src/api/user/user.ts"],"sourcesContent":["/**\n * Generated by orval v7.17.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.4\n */\nimport { useMutation, useQuery, useSuspenseQuery } from \"@tanstack/react-query\";\nimport type {\n InvalidateOptions,\n MutationFunction,\n QueryClient,\n QueryFunction,\n QueryKey,\n UseMutationOptions,\n UseMutationResult,\n UseQueryOptions,\n UseQueryResult,\n UseSuspenseQueryOptions,\n UseSuspenseQueryResult,\n} from \"@tanstack/react-query\";\n\nimport type { AsError, UserAccountDetail, UsersGetResponse } from \".././api-schemas\";\n\nimport { customInstance } from \"../../custom-axios\";\nimport type { ErrorType } from \"../../custom-axios\";\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 [\"account-server\", \"user\", \"account\"] as const;\n};\n\nexport const getGetUserAccountQueryOptions = <\n TData = Awaited<ReturnType<typeof getUserAccount>>,\n TError = ErrorType<void | AsError>,\n>(options?: {\n query?: 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 return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<\n Awaited<ReturnType<typeof getUserAccount>>,\n TError,\n TData\n > & { queryKey: QueryKey };\n};\n\nexport type GetUserAccountQueryResult = NonNullable<Awaited<ReturnType<typeof getUserAccount>>>;\nexport type GetUserAccountQueryError = ErrorType<void | AsError>;\n\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>(options?: {\n query?: UseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } {\n const queryOptions = getGetUserAccountQueryOptions(options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * @summary Get information about your account\n */\nexport const invalidateGetUserAccount = async (\n queryClient: QueryClient,\n options?: InvalidateOptions,\n): Promise<QueryClient> => {\n await queryClient.invalidateQueries({ queryKey: getGetUserAccountQueryKey() }, options);\n\n return queryClient;\n};\n\nexport const getGetUserAccountSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getUserAccount>>,\n TError = ErrorType<void | AsError>,\n>(options?: {\n query?: UseSuspenseQueryOptions<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 return { queryKey, queryFn, ...queryOptions } as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getUserAccount>>,\n TError,\n TData\n > & { queryKey: QueryKey };\n};\n\nexport type GetUserAccountSuspenseQueryResult = NonNullable<\n Awaited<ReturnType<typeof getUserAccount>>\n>;\nexport type GetUserAccountSuspenseQueryError = ErrorType<void | AsError>;\n\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>(options?: {\n query?: UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n}): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } {\n const queryOptions = getGetUserAccountSuspenseQueryOptions(options);\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\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 [\"account-server\", \"organisation\", orgId, \"user\"] as const;\n};\n\nexport const getGetOrganisationUsersQueryOptions = <\n TData = Awaited<ReturnType<typeof getOrganisationUsers>>,\n TError = ErrorType<AsError | void>,\n>(\n orgId: string,\n options?: {\n query?: UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>;\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 return { queryKey, queryFn, enabled: !!orgId, ...queryOptions } as UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUsers>>,\n TError,\n TData\n > & { queryKey: QueryKey };\n};\n\nexport type GetOrganisationUsersQueryResult = NonNullable<\n Awaited<ReturnType<typeof getOrganisationUsers>>\n>;\nexport type GetOrganisationUsersQueryError = ErrorType<AsError | void>;\n\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?: UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n },\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } {\n const queryOptions = getGetOrganisationUsersQueryOptions(orgId, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * @summary Gets users in an Organisation\n */\nexport const invalidateGetOrganisationUsers = async (\n queryClient: QueryClient,\n orgId: string,\n options?: InvalidateOptions,\n): Promise<QueryClient> => {\n await queryClient.invalidateQueries(\n { queryKey: getGetOrganisationUsersQueryKey(orgId) },\n options,\n );\n\n return queryClient;\n};\n\nexport const getGetOrganisationUsersSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getOrganisationUsers>>,\n TError = ErrorType<AsError | void>,\n>(\n orgId: string,\n options?: {\n query?: UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUsers>>,\n TError,\n 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 return { queryKey, queryFn, ...queryOptions } as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUsers>>,\n TError,\n TData\n > & { queryKey: QueryKey };\n};\n\nexport type GetOrganisationUsersSuspenseQueryResult = NonNullable<\n Awaited<ReturnType<typeof getOrganisationUsers>>\n>;\nexport type GetOrganisationUsersSuspenseQueryError = ErrorType<AsError | void>;\n\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?: UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUsers>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } {\n const queryOptions = getGetOrganisationUsersSuspenseQueryOptions(orgId, options);\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\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 getAddOrganisationUserMutationOptions = <\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 return { mutationFn, ...mutationOptions };\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 = <\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}): UseMutationResult<\n Awaited<ReturnType<typeof addOrganisationUser>>,\n TError,\n { orgId: string; userId: string },\n TContext\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 return customInstance<void>(\n { url: `/organisation/${orgId}/user/${userId}`, method: \"DELETE\" },\n options,\n );\n};\n\nexport const getDeleteOrganisationUserMutationOptions = <\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 return { mutationFn, ...mutationOptions };\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 = <\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}): UseMutationResult<\n Awaited<ReturnType<typeof deleteOrganisationUser>>,\n TError,\n { orgId: string; userId: string },\n TContext\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>,\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 [\"account-server\", \"unit\", unitId, \"user\"] as const;\n};\n\nexport const getGetOrganisationUnitUsersQueryOptions = <\n TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>,\n TError = ErrorType<AsError | void>,\n>(\n unitId: string,\n options?: {\n query?: UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>;\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 return { queryKey, queryFn, enabled: !!unitId, ...queryOptions } as UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUnitUsers>>,\n TError,\n TData\n > & { queryKey: QueryKey };\n};\n\nexport type GetOrganisationUnitUsersQueryResult = NonNullable<\n Awaited<ReturnType<typeof getOrganisationUnitUsers>>\n>;\nexport type GetOrganisationUnitUsersQueryError = ErrorType<AsError | void>;\n\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?: UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n },\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } {\n const queryOptions = getGetOrganisationUnitUsersQueryOptions(unitId, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * @summary Gets users in an Organisational Unit\n */\nexport const invalidateGetOrganisationUnitUsers = async (\n queryClient: QueryClient,\n unitId: string,\n options?: InvalidateOptions,\n): Promise<QueryClient> => {\n await queryClient.invalidateQueries(\n { queryKey: getGetOrganisationUnitUsersQueryKey(unitId) },\n options,\n );\n\n return queryClient;\n};\n\nexport const getGetOrganisationUnitUsersSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>,\n TError = ErrorType<AsError | void>,\n>(\n unitId: string,\n options?: {\n query?: UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUnitUsers>>,\n TError,\n 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 return { queryKey, queryFn, ...queryOptions } as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUnitUsers>>,\n TError,\n TData\n > & { queryKey: QueryKey };\n};\n\nexport type GetOrganisationUnitUsersSuspenseQueryResult = NonNullable<\n Awaited<ReturnType<typeof getOrganisationUnitUsers>>\n>;\nexport type GetOrganisationUnitUsersSuspenseQueryError = ErrorType<AsError | void>;\n\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?: UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUnitUsers>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } {\n const queryOptions = getGetOrganisationUnitUsersSuspenseQueryOptions(unitId, options);\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\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 getAddOrganisationUnitUserMutationOptions = <\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 return { mutationFn, ...mutationOptions };\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 = <\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}): UseMutationResult<\n Awaited<ReturnType<typeof addOrganisationUnitUser>>,\n TError,\n { unitId: string; userId: string },\n TContext\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 return customInstance<void>({ url: `/unit/${unitId}/user/${userId}`, method: \"DELETE\" }, options);\n};\n\nexport const getDeleteOrganisationUnitUserMutationOptions = <\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 return { mutationFn, ...mutationOptions };\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>(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}): UseMutationResult<\n Awaited<ReturnType<typeof deleteOrganisationUnitUser>>,\n TError,\n { unitId: string; userId: string },\n TContext\n> => {\n const mutationOptions = getDeleteOrganisationUnitUserMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAqCA,MAAa,kBACX,SACA,WACG;AACH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WAAW,SAAS,EAAE;AAEtC,SAAO,wBAAwB,QAAQ,QAAQ,eAAe;;AAGhE,QAAO;EAAE;EAAY,GAAG;EAAiB;;;;;AAY3C,MAAa,8BAGX,YAaG;AAGH,QAAO,YAFiB,0CAA0C,QAAQ,CAEvC;;;;;;;;;;;AAWrC,MAAa,8BACX,QACA,QACA,YACG;AACH,QAAO,eAAqB;EAAE,KAAK,SAAS,OAAO,QAAQ;EAAU,QAAQ;EAAU,EAAE,QAAQ;;AAGnG,MAAa,gDAGX,YAaG;CACH,MAAM,cAAc,CAAC,6BAA6B;CAClD,MAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,UAC3D,QAAQ,YAAY,iBAAiB,QAAQ,YAAY,QAAQ,SAAS,cACxE,UACA;EAAE,GAAG;EAAS,UAAU;GAAE,GAAG,QAAQ;GAAU;GAAa;EAAE,GAChE;EAAE,UAAU,EAAE,aAAa;EAAE,SAAS;EAAW;CAErD,MAAMC,cAGD,UAAU;EACb,MAAM,EAAE,QAAQ,WAAW,SAAS,EAAE;AAEtC,SAAO,2BAA2B,QAAQ,QAAQ,eAAe;;AAGnE,QAAO;EAAE;EAAY,GAAG;EAAiB;;;;;AAY3C,MAAa,iCAGX,YAaG;AAGH,QAAO,YAFiB,6CAA6C,QAAQ,CAE1C"}
1
+ {"version":3,"file":"user.js","names":["queryFn: QueryFunction<Awaited<ReturnType<typeof getUserAccount>>>","queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisationUsers>>>","mutationFn: MutationFunction<\n Awaited<ReturnType<typeof addOrganisationUser>>,\n { orgId: string; userId: string }\n >","mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteOrganisationUser>>,\n { orgId: string; userId: string }\n >","queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisationUnitUsers>>>","mutationFn: MutationFunction<\n Awaited<ReturnType<typeof addOrganisationUnitUser>>,\n { unitId: string; userId: string }\n >","mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteOrganisationUnitUser>>,\n { unitId: string; userId: string }\n >"],"sources":["../../../src/api/user/user.ts"],"sourcesContent":["/**\n * Generated by orval v7.17.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.4\n */\nimport { useMutation, useQuery, useSuspenseQuery } from \"@tanstack/react-query\";\nimport type {\n DataTag,\n DefinedInitialDataOptions,\n DefinedUseQueryResult,\n InvalidateOptions,\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 \".././api-schemas\";\n\nimport { customInstance } from \"../../custom-axios\";\nimport type { ErrorType } from \"../../custom-axios\";\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 [\"account-server\", \"user\", \"account\"] as const;\n};\n\nexport const getGetUserAccountQueryOptions = <\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 return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<\n Awaited<ReturnType<typeof getUserAccount>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData> };\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> };\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> };\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> };\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> } {\n const queryOptions = getGetUserAccountQueryOptions(options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData>;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * @summary Get information about your account\n */\nexport const invalidateGetUserAccount = async (\n queryClient: QueryClient,\n options?: InvalidateOptions,\n): Promise<QueryClient> => {\n await queryClient.invalidateQueries({ queryKey: getGetUserAccountQueryKey() }, options);\n\n return queryClient;\n};\n\nexport const getGetUserAccountSuspenseQueryOptions = <\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 return { queryKey, queryFn, ...queryOptions } as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getUserAccount>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData> };\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> };\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> };\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> };\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> } {\n const queryOptions = getGetUserAccountSuspenseQueryOptions(options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData> };\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 [\"account-server\", \"organisation\", orgId, \"user\"] as const;\n};\n\nexport const getGetOrganisationUsersQueryOptions = <\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 return { queryKey, queryFn, enabled: !!orgId, ...queryOptions } as UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUsers>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData> };\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> };\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> };\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> };\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> } {\n const queryOptions = getGetOrganisationUsersQueryOptions(orgId, options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData>;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * @summary Gets users in an Organisation\n */\nexport const invalidateGetOrganisationUsers = async (\n queryClient: QueryClient,\n orgId: string,\n options?: InvalidateOptions,\n): Promise<QueryClient> => {\n await queryClient.invalidateQueries(\n { queryKey: getGetOrganisationUsersQueryKey(orgId) },\n options,\n );\n\n return queryClient;\n};\n\nexport const getGetOrganisationUsersSuspenseQueryOptions = <\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 return { queryKey, queryFn, ...queryOptions } as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUsers>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData> };\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> };\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> };\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> };\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> } {\n const queryOptions = getGetOrganisationUsersSuspenseQueryOptions(orgId, options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData> };\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 getAddOrganisationUserMutationOptions = <\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 return { mutationFn, ...mutationOptions };\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 = getAddOrganisationUserMutationOptions(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 getDeleteOrganisationUserMutationOptions = <\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 return { mutationFn, ...mutationOptions };\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 = getDeleteOrganisationUserMutationOptions(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 [\"account-server\", \"unit\", unitId, \"user\"] as const;\n};\n\nexport const getGetOrganisationUnitUsersQueryOptions = <\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 return { queryKey, queryFn, enabled: !!unitId, ...queryOptions } as UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUnitUsers>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData> };\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> };\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> };\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> };\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> } {\n const queryOptions = getGetOrganisationUnitUsersQueryOptions(unitId, options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData>;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * @summary Gets users in an Organisational Unit\n */\nexport const invalidateGetOrganisationUnitUsers = async (\n queryClient: QueryClient,\n unitId: string,\n options?: InvalidateOptions,\n): Promise<QueryClient> => {\n await queryClient.invalidateQueries(\n { queryKey: getGetOrganisationUnitUsersQueryKey(unitId) },\n options,\n );\n\n return queryClient;\n};\n\nexport const getGetOrganisationUnitUsersSuspenseQueryOptions = <\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 return { queryKey, queryFn, ...queryOptions } as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUnitUsers>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData> };\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> };\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> };\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> };\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> } {\n const queryOptions = getGetOrganisationUnitUsersSuspenseQueryOptions(unitId, options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData> };\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 getAddOrganisationUnitUserMutationOptions = <\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 return { mutationFn, ...mutationOptions };\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 = getAddOrganisationUnitUserMutationOptions(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 getDeleteOrganisationUnitUserMutationOptions = <\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 return { mutationFn, ...mutationOptions };\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 = getDeleteOrganisationUnitUserMutationOptions(options);\n\n return useMutation(mutationOptions, queryClient);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAyCA,MAAa,kBACX,SACA,WACG;AACH,QAAO,eACL;EAAE,KAAK;EAAiB,QAAQ;EAAO;EAAQ,EAC/C,QACD;;AAGH,MAAa,kCAAkC;AAC7C,QAAO;EAAC;EAAkB;EAAQ;EAAU;;AAG9C,MAAa,iCAGX,YAGI;CACJ,MAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,EAAE;CAEtE,MAAM,WAAW,cAAc,YAAY,2BAA2B;CAEtE,MAAMA,WAAsE,EAAE,aAC5E,eAAe,gBAAgB,OAAO;AAExC,QAAO;EAAE;EAAU;EAAS,GAAG;EAAc;;;;;AA4D/C,SAAgB,kBAId,SAIA,aACwE;CACxE,MAAM,eAAe,8BAA8B,QAAQ;CAE3D,MAAM,QAAQ,SAAS,cAAc,YAAY;AAIjD,OAAM,WAAW,aAAa;AAE9B,QAAO;;;;;AAMT,MAAa,2BAA2B,OACtC,aACA,YACyB;AACzB,OAAM,YAAY,kBAAkB,EAAE,UAAU,2BAA2B,EAAE,EAAE,QAAQ;AAEvF,QAAO;;AAGT,MAAa,yCAGX,YAKI;CACJ,MAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,EAAE;CAEtE,MAAM,WAAW,cAAc,YAAY,2BAA2B;CAEtE,MAAMA,WAAsE,EAAE,aAC5E,eAAe,gBAAgB,OAAO;AAExC,QAAO;EAAE;EAAU;EAAS,GAAG;EAAc;;;;;AAoD/C,SAAgB,0BAId,SAMA,aACgF;CAChF,MAAM,eAAe,sCAAsC,QAAQ;CAEnE,MAAM,QAAQ,iBAAiB,cAAc,YAAY;AAKzD,OAAM,WAAW,aAAa;AAE9B,QAAO;;;;;;;;;;;AAYT,MAAa,wBACX,OACA,SACA,WACG;AACH,QAAO,eACL;EAAE,KA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
5
  "private": false,
@@ -11,11 +11,12 @@
11
11
  "license": "MIT",
12
12
  "type": "module",
13
13
  "engines": {
14
- "node": ">=20",
15
- "npm": ">=7"
14
+ "node": ">=22",
15
+ "pnpm": ">=8"
16
16
  },
17
17
  "devDependencies": {
18
18
  "@types/node": "^24.10.1",
19
+ "@types/react": "^19.2.7",
19
20
  "js-yaml": "4.1.1",
20
21
  "orval": "7.17.0",
21
22
  "prettier": "3.7.3",
@@ -26,7 +27,7 @@
26
27
  "zod": "^4.1.13"
27
28
  },
28
29
  "peerDependencies": {
29
- "@tanstack/react-query": ">=4",
30
+ "@tanstack/react-query": ">=5",
30
31
  "axios": ">=0.23",
31
32
  "zod": ">=4"
32
33
  },
@@ -431,6 +432,7 @@
431
432
  },
432
433
  "scripts": {
433
434
  "orval": "orval",
434
- "build": "tsdown"
435
+ "build": "tsdown",
436
+ "test": "tsc --noEmit -p tests/tsconfig.json"
435
437
  }
436
438
  }