@squonk/account-server-client 0.1.24-rc.1 → 0.1.27-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/{custom-instance-4a108741.d.ts → account-server-api.schemas-e6c5f956.d.ts} +15 -20
  2. package/{chunk-JR7F532L.js → chunk-GWBPVOL2.js} +2 -23
  3. package/chunk-GWBPVOL2.js.map +1 -0
  4. package/chunk-N3RLW53G.cjs +25 -0
  5. package/chunk-N3RLW53G.cjs.map +1 -0
  6. package/index.cjs +21 -5
  7. package/index.cjs.map +1 -1
  8. package/index.d.ts +20 -2
  9. package/index.js +21 -5
  10. package/index.js.map +1 -1
  11. package/organisation/organisation.cjs +31 -31
  12. package/organisation/organisation.cjs.map +1 -1
  13. package/organisation/organisation.d.ts +37 -28
  14. package/organisation/organisation.js +38 -38
  15. package/organisation/organisation.js.map +1 -1
  16. package/package.json +14 -14
  17. package/product/product.cjs +64 -61
  18. package/product/product.cjs.map +1 -1
  19. package/product/product.d.ts +70 -40
  20. package/product/product.js +75 -72
  21. package/product/product.js.map +1 -1
  22. package/service/service.cjs +23 -21
  23. package/service/service.cjs.map +1 -1
  24. package/service/service.d.ts +19 -15
  25. package/service/service.js +26 -24
  26. package/service/service.js.map +1 -1
  27. package/src/account-server-api.schemas.ts +14 -1
  28. package/src/organisation/organisation.ts +86 -83
  29. package/src/product/product.ts +210 -145
  30. package/src/service/service.ts +64 -56
  31. package/src/state/state.ts +31 -32
  32. package/src/unit/unit.ts +170 -149
  33. package/src/user/user.ts +171 -160
  34. package/state/state.cjs +12 -12
  35. package/state/state.cjs.map +1 -1
  36. package/state/state.d.ts +12 -10
  37. package/state/state.js +13 -13
  38. package/state/state.js.map +1 -1
  39. package/unit/unit.cjs +54 -58
  40. package/unit/unit.cjs.map +1 -1
  41. package/unit/unit.d.ts +64 -49
  42. package/unit/unit.js +67 -71
  43. package/unit/unit.js.map +1 -1
  44. package/user/user.cjs +56 -56
  45. package/user/user.cjs.map +1 -1
  46. package/user/user.d.ts +69 -55
  47. package/user/user.js +69 -69
  48. package/user/user.js.map +1 -1
  49. package/chunk-3DXYUDZH.cjs +0 -46
  50. package/chunk-3DXYUDZH.cjs.map +0 -1
  51. package/chunk-JR7F532L.js.map +0 -1
package/unit/unit.js CHANGED
@@ -1,119 +1,115 @@
1
1
  import {
2
- __spreadValues,
3
- customInstance
4
- } from "../chunk-JR7F532L.js";
2
+ __spreadValues
3
+ } from "../chunk-GWBPVOL2.js";
5
4
 
6
5
  // src/unit/unit.ts
6
+ import axios from "axios";
7
7
  import {
8
8
  useQuery,
9
9
  useMutation
10
10
  } from "react-query";
11
- var getOrganisationUnits = (orgid, options) => {
12
- return customInstance({ url: `/organisation/${orgid}/unit`, method: "get" }, options);
11
+ var appApiUnitGetOrgUnits = (orgId, options) => {
12
+ return axios.get(`/organisation/${orgId}/unit`, options);
13
13
  };
14
- var getGetOrganisationUnitsQueryKey = (orgid) => [
15
- `/organisation/${orgid}/unit`
14
+ var getAppApiUnitGetOrgUnitsQueryKey = (orgId) => [
15
+ `/organisation/${orgId}/unit`
16
16
  ];
17
- var useGetOrganisationUnits = (orgid, options) => {
18
- const { query: queryOptions, request: requestOptions } = options || {};
19
- const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetOrganisationUnitsQueryKey(orgid);
20
- const queryFn = () => getOrganisationUnits(orgid, requestOptions);
21
- const query = useQuery(queryKey, queryFn, __spreadValues({ enabled: !!orgid }, queryOptions));
17
+ var useAppApiUnitGetOrgUnits = (orgId, options) => {
18
+ const { query: queryOptions, axios: axiosOptions } = options || {};
19
+ const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getAppApiUnitGetOrgUnitsQueryKey(orgId);
20
+ const queryFn = () => appApiUnitGetOrgUnits(orgId, axiosOptions);
21
+ const query = useQuery(queryKey, queryFn, __spreadValues({ enabled: !!orgId }, queryOptions));
22
22
  return __spreadValues({
23
23
  queryKey
24
24
  }, query);
25
25
  };
26
- var createOrganisationUnit = (orgid, organisationUnitPostBodyBody, options) => {
27
- return customInstance({
28
- url: `/organisation/${orgid}/unit`,
29
- method: "post",
30
- data: organisationUnitPostBodyBody
31
- }, options);
26
+ var appApiUnitPost = (orgId, organisationUnitPostBodyBody, options) => {
27
+ return axios.post(`/organisation/${orgId}/unit`, organisationUnitPostBodyBody, options);
32
28
  };
33
- var useCreateOrganisationUnit = (options) => {
34
- const { mutation: mutationOptions, request: requestOptions } = options || {};
29
+ var useAppApiUnitPost = (options) => {
30
+ const { mutation: mutationOptions, axios: axiosOptions } = options || {};
35
31
  const mutationFn = (props) => {
36
- const { orgid, data } = props || {};
37
- return createOrganisationUnit(orgid, data, requestOptions);
32
+ const { orgId, data } = props || {};
33
+ return appApiUnitPost(orgId, data, axiosOptions);
38
34
  };
39
35
  return useMutation(mutationFn, mutationOptions);
40
36
  };
41
- var getUnit = (orgid, unitid, options) => {
42
- return customInstance({ url: `/organisation/${orgid}/unit/${unitid}`, method: "get" }, options);
37
+ var appApiUnitGetUnit = (orgId, unitId, options) => {
38
+ return axios.get(`/organisation/${orgId}/unit/${unitId}`, options);
43
39
  };
44
- var getGetUnitQueryKey = (orgid, unitid) => [
45
- `/organisation/${orgid}/unit/${unitid}`
40
+ var getAppApiUnitGetUnitQueryKey = (orgId, unitId) => [
41
+ `/organisation/${orgId}/unit/${unitId}`
46
42
  ];
47
- var useGetUnit = (orgid, unitid, options) => {
48
- const { query: queryOptions, request: requestOptions } = options || {};
49
- const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetUnitQueryKey(orgid, unitid);
50
- const queryFn = () => getUnit(orgid, unitid, requestOptions);
51
- const query = useQuery(queryKey, queryFn, __spreadValues({ enabled: !!(orgid && unitid) }, queryOptions));
43
+ var useAppApiUnitGetUnit = (orgId, unitId, options) => {
44
+ const { query: queryOptions, axios: axiosOptions } = options || {};
45
+ const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getAppApiUnitGetUnitQueryKey(orgId, unitId);
46
+ const queryFn = () => appApiUnitGetUnit(orgId, unitId, axiosOptions);
47
+ const query = useQuery(queryKey, queryFn, __spreadValues({ enabled: !!(orgId && unitId) }, queryOptions));
52
48
  return __spreadValues({
53
49
  queryKey
54
50
  }, query);
55
51
  };
56
- var deleteOrganisationUnit = (orgid, unitid, options) => {
57
- return customInstance({ url: `/organisation/${orgid}/unit/${unitid}`, method: "delete" }, options);
52
+ var appApiUnitDelete = (orgId, unitId, options) => {
53
+ return axios.delete(`/organisation/${orgId}/unit/${unitId}`, options);
58
54
  };
59
- var useDeleteOrganisationUnit = (options) => {
60
- const { mutation: mutationOptions, request: requestOptions } = options || {};
55
+ var useAppApiUnitDelete = (options) => {
56
+ const { mutation: mutationOptions, axios: axiosOptions } = options || {};
61
57
  const mutationFn = (props) => {
62
- const { orgid, unitid } = props || {};
63
- return deleteOrganisationUnit(orgid, unitid, requestOptions);
58
+ const { orgId, unitId } = props || {};
59
+ return appApiUnitDelete(orgId, unitId, axiosOptions);
64
60
  };
65
61
  return useMutation(mutationFn, mutationOptions);
66
62
  };
67
- var getUnits = (options) => {
68
- return customInstance({ url: `/unit`, method: "get" }, options);
63
+ var appApiUnitGet = (options) => {
64
+ return axios.get(`/unit`, options);
69
65
  };
70
- var getGetUnitsQueryKey = () => [`/unit`];
71
- var useGetUnits = (options) => {
72
- const { query: queryOptions, request: requestOptions } = options || {};
73
- const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetUnitsQueryKey();
74
- const queryFn = () => getUnits(requestOptions);
66
+ var getAppApiUnitGetQueryKey = () => [`/unit`];
67
+ var useAppApiUnitGet = (options) => {
68
+ const { query: queryOptions, axios: axiosOptions } = options || {};
69
+ const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getAppApiUnitGetQueryKey();
70
+ const queryFn = () => appApiUnitGet(axiosOptions);
75
71
  const query = useQuery(queryKey, queryFn, queryOptions);
76
72
  return __spreadValues({
77
73
  queryKey
78
74
  }, query);
79
75
  };
80
- var createDefaultUnit = (options) => {
81
- return customInstance({ url: `/unit`, method: "put" }, options);
76
+ var appApiUnitPersonalPut = (options) => {
77
+ return axios.put(`/unit`, void 0, options);
82
78
  };
83
- var useCreateDefaultUnit = (options) => {
84
- const { mutation: mutationOptions, request: requestOptions } = options || {};
79
+ var useAppApiUnitPersonalPut = (options) => {
80
+ const { mutation: mutationOptions, axios: axiosOptions } = options || {};
85
81
  const mutationFn = () => {
86
- return createDefaultUnit(requestOptions);
82
+ return appApiUnitPersonalPut(axiosOptions);
87
83
  };
88
84
  return useMutation(mutationFn, mutationOptions);
89
85
  };
90
- var deleteDefaultUnit = (options) => {
91
- return customInstance({ url: `/unit`, method: "delete" }, options);
86
+ var appApiUnitPersonalDelete = (options) => {
87
+ return axios.delete(`/unit`, options);
92
88
  };
93
- var useDeleteDefaultUnit = (options) => {
94
- const { mutation: mutationOptions, request: requestOptions } = options || {};
89
+ var useAppApiUnitPersonalDelete = (options) => {
90
+ const { mutation: mutationOptions, axios: axiosOptions } = options || {};
95
91
  const mutationFn = () => {
96
- return deleteDefaultUnit(requestOptions);
92
+ return appApiUnitPersonalDelete(axiosOptions);
97
93
  };
98
94
  return useMutation(mutationFn, mutationOptions);
99
95
  };
100
96
  export {
101
- createDefaultUnit,
102
- createOrganisationUnit,
103
- deleteDefaultUnit,
104
- deleteOrganisationUnit,
105
- getGetOrganisationUnitsQueryKey,
106
- getGetUnitQueryKey,
107
- getGetUnitsQueryKey,
108
- getOrganisationUnits,
109
- getUnit,
110
- getUnits,
111
- useCreateDefaultUnit,
112
- useCreateOrganisationUnit,
113
- useDeleteDefaultUnit,
114
- useDeleteOrganisationUnit,
115
- useGetOrganisationUnits,
116
- useGetUnit,
117
- useGetUnits
97
+ appApiUnitDelete,
98
+ appApiUnitGet,
99
+ appApiUnitGetOrgUnits,
100
+ appApiUnitGetUnit,
101
+ appApiUnitPersonalDelete,
102
+ appApiUnitPersonalPut,
103
+ appApiUnitPost,
104
+ getAppApiUnitGetOrgUnitsQueryKey,
105
+ getAppApiUnitGetQueryKey,
106
+ getAppApiUnitGetUnitQueryKey,
107
+ useAppApiUnitDelete,
108
+ useAppApiUnitGet,
109
+ useAppApiUnitGetOrgUnits,
110
+ useAppApiUnitGetUnit,
111
+ useAppApiUnitPersonalDelete,
112
+ useAppApiUnitPersonalPut,
113
+ useAppApiUnitPost
118
114
  };
119
115
  //# sourceMappingURL=unit.js.map
package/unit/unit.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/unit/unit.ts"],"sourcesContent":["/**\n * Generated by orval v6.6.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 **Products**, **Organisations**, **Units** and **Users**.\n\n * OpenAPI spec version: 0.1\n */\nimport {\n useQuery,\n useMutation,\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"react-query\";\nimport type {\n OrganisationUnitsGetResponse,\n AsError,\n OrganisationUnitPostResponse,\n OrganisationUnitPostBodyBody,\n UnitGetResponse,\n UnitsGetResponse,\n PersonalUnitPutResponse,\n} from \"../account-server-api.schemas\";\nimport { customInstance, ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (\n ...args: any\n) => Promise<infer R>\n ? R\n : any;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * Gets Organisational Units you have access to\n\n * @summary Gets Organisational Units\n */\nexport const getOrganisationUnits = (\n orgid: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<OrganisationUnitsGetResponse>(\n { url: `/organisation/${orgid}/unit`, method: \"get\" },\n options\n );\n};\n\nexport const getGetOrganisationUnitsQueryKey = (orgid: string) => [\n `/organisation/${orgid}/unit`,\n];\n\nexport const useGetOrganisationUnits = <\n TData = AsyncReturnType<typeof getOrganisationUnits>,\n TError = ErrorType<void | AsError>\n>(\n orgid: string,\n options?: {\n query?: UseQueryOptions<\n AsyncReturnType<typeof getOrganisationUnits>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetOrganisationUnitsQueryKey(orgid);\n\n const queryFn: QueryFunction<\n AsyncReturnType<typeof getOrganisationUnits>\n > = () => getOrganisationUnits(orgid, requestOptions);\n\n const query = useQuery<\n AsyncReturnType<typeof getOrganisationUnits>,\n TError,\n TData\n >(queryKey, queryFn, { enabled: !!orgid, ...queryOptions });\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Creates a new organisation unit. You need to be in the Organisation or an Admin user to use this endpoint\n\n * @summary Create a new Organisational Unit\n */\nexport const createOrganisationUnit = (\n orgid: string,\n organisationUnitPostBodyBody: OrganisationUnitPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<OrganisationUnitPostResponse>(\n {\n url: `/organisation/${orgid}/unit`,\n method: \"post\",\n data: organisationUnitPostBodyBody,\n },\n options\n );\n};\n\nexport const useCreateOrganisationUnit = <\n TError = ErrorType<AsError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof createOrganisationUnit>,\n TError,\n { orgid: string; data: OrganisationUnitPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof createOrganisationUnit>,\n { orgid: string; data: OrganisationUnitPostBodyBody }\n > = (props) => {\n const { orgid, data } = props || {};\n\n return createOrganisationUnit(orgid, data, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof createOrganisationUnit>,\n TError,\n { orgid: string; data: OrganisationUnitPostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets the Unit, assuming you are a member of it. Admin users can see all Units\n\n * @summary Gets a Unit\n */\nexport const getUnit = (\n orgid: string,\n unitid: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<UnitGetResponse>(\n { url: `/organisation/${orgid}/unit/${unitid}`, method: \"get\" },\n options\n );\n};\n\nexport const getGetUnitQueryKey = (orgid: string, unitid: string) => [\n `/organisation/${orgid}/unit/${unitid}`,\n];\n\nexport const useGetUnit = <\n TData = AsyncReturnType<typeof getUnit>,\n TError = ErrorType<void | AsError>\n>(\n orgid: string,\n unitid: string,\n options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof getUnit>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUnitQueryKey(orgid, unitid);\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getUnit>> = () =>\n getUnit(orgid, unitid, requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getUnit>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!(orgid && unitid), ...queryOptions }\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Deletes an Organisational Unit you have access to. Units can only be deleted by Organisation users or Admin users. You cannot delete a Unit that contains Products\n\n * @summary Deletes an Organisational Unit\n */\nexport const deleteOrganisationUnit = (\n orgid: string,\n unitid: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/organisation/${orgid}/unit/${unitid}`, method: \"delete\" },\n options\n );\n};\n\nexport const useDeleteOrganisationUnit = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof deleteOrganisationUnit>,\n TError,\n { orgid: string; unitid: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof deleteOrganisationUnit>,\n { orgid: string; unitid: string }\n > = (props) => {\n const { orgid, unitid } = props || {};\n\n return deleteOrganisationUnit(orgid, unitid, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof deleteOrganisationUnit>,\n TError,\n { orgid: string; unitid: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets all the Units you are a member of. Admin users can see all Units\n\n * @summary Gets Units a User has access to\n */\nexport const getUnits = (options?: SecondParameter<typeof customInstance>) => {\n return customInstance<UnitsGetResponse>(\n { url: `/unit`, method: \"get\" },\n options\n );\n};\n\nexport const getGetUnitsQueryKey = () => [`/unit`];\n\nexport const useGetUnits = <\n TData = AsyncReturnType<typeof getUnits>,\n TError = ErrorType<void | AsError>\n>(options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof getUnits>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUnitsQueryKey();\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getUnits>> = () =>\n getUnits(requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getUnits>, TError, TData>(\n queryKey,\n queryFn,\n queryOptions\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Creates a 'Personal' Unit for a User. The unit will belong to the built-in **Default** Organisation. Users can only have one Personal Unit and Personal Units cannot have other Users\n\n * @summary Create a new Independent User Unit\n */\nexport const createDefaultUnit = (\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<PersonalUnitPutResponse>(\n { url: `/unit`, method: \"put\" },\n options\n );\n};\n\nexport const useCreateDefaultUnit = <\n TError = ErrorType<AsError | void>,\n TVariables = void,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof createDefaultUnit>,\n TError,\n TVariables,\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof createDefaultUnit>,\n TVariables\n > = () => {\n return createDefaultUnit(requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof createDefaultUnit>,\n TError,\n TVariables,\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Deletes a 'Personal' Unit. It must be your Unit, which belongs to the Default Organisation\n\n * @summary Deletes an Independent Unit\n */\nexport const deleteDefaultUnit = (\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>({ url: `/unit`, method: \"delete\" }, options);\n};\n\nexport const useDeleteDefaultUnit = <\n TError = ErrorType<AsError>,\n TVariables = void,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof deleteDefaultUnit>,\n TError,\n TVariables,\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof deleteDefaultUnit>,\n TVariables\n > = () => {\n return deleteDefaultUnit(requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof deleteDefaultUnit>,\n TError,\n TVariables,\n TContext\n >(mutationFn, mutationOptions);\n};\n"],"mappings":";;;;;;AAUA;AAAA;AAAA;AAAA;AAyCO,IAAM,uBAAuB,CAClC,OACA,YACG;AACH,SAAO,eACL,EAAE,KAAK,iBAAiB,cAAc,QAAQ,SAC9C;AAAA;AAIG,IAAM,kCAAkC,CAAC,UAAkB;AAAA,EAChE,iBAAiB;AAAA;AAGZ,IAAM,0BAA0B,CAIrC,OACA,YAQ2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW;AAEpE,QAAM,W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AAC,UAAU;AACb,UAAM,EAAE,OAAO,WAAW,SAAS;AAEnC,WAAO,uBAAuB,OAAO,QAAQ;AAAA;AAG/C,SAAO,YAKL,YAAY;AAAA;AAOT,IAAM,WAAW,CAAC,YAAqD;AAC5E,SAAO,eACL,EAAE,KAAK,SAAS,QAAQ,SACxB;AAAA;AAIG,IAAM,sBAAsB,MAAM,CAAC;AAEnC,IAAM,cAAc,CAGzB,YAG4D;AAC5D,QAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW;AAEpE,QAAM,WAAW,8CAAc,aAAY;AAE3C,QAAM,UAA2D,MAC/D,SAAS;AAEX,QAAM,QAAQ,SACZ,UACA,SACA;AAGF,SAAO;AAAA,IACL;AAAA,KACG;AAAA;AASA,IAAM,oBAAoB,CAC/B,YACG;AACH,SAAO,eACL,EAAE,KAAK,SAAS,QAAQ,SACxB;AAAA;AAIG,IAAM,uBAAuB,CAIlC,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW;AAE1E,QAAM,aAGF,MAAM;AACR,WAAO,kBAAkB;AAAA;AAG3B,SAAO,YAKL,YAAY;AAAA;AAOT,IAAM,oBAAoB,CAC/B,YACG;AACH,SAAO,eAAqB,EAAE,KAAK,SAAS,QAAQ,YAAY;AAAA;AAG3D,IAAM,uBAAuB,CAIlC,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW;AAE1E,QAAM,aAGF,MAAM;AACR,WAAO,kBAAkB;AAAA;AAG3B,SAAO,YAKL,YAAY;AAAA;","names":[]}
1
+ {"version":3,"sources":["../../src/unit/unit.ts"],"sourcesContent":["/**\n * Generated by orval v6.7.1 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Products**, **Organisations**, **Units** and **Users**.\n\n * OpenAPI spec version: 0.1\n */\nimport axios, { AxiosRequestConfig, AxiosResponse, AxiosError } from \"axios\";\nimport {\n useQuery,\n useMutation,\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"react-query\";\nimport type {\n OrganisationUnitsGetResponse,\n AsError,\n OrganisationUnitPostResponse,\n OrganisationUnitPostBodyBody,\n UnitGetResponse,\n UnitsGetResponse,\n PersonalUnitPutResponse,\n} from \"../account-server-api.schemas\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (\n ...args: any\n) => Promise<infer R>\n ? R\n : any;\n\n/**\n * Gets Organisational Units you have access to or that are public\n\n * @summary Gets Organisational Units\n */\nexport const appApiUnitGetOrgUnits = (\n orgId: string,\n options?: AxiosRequestConfig\n): Promise<AxiosResponse<OrganisationUnitsGetResponse>> => {\n return axios.get(`/organisation/${orgId}/unit`, options);\n};\n\nexport const getAppApiUnitGetOrgUnitsQueryKey = (orgId: string) => [\n `/organisation/${orgId}/unit`,\n];\n\nexport type AppApiUnitGetOrgUnitsQueryResult = NonNullable<\n AsyncReturnType<typeof appApiUnitGetOrgUnits>\n>;\nexport type AppApiUnitGetOrgUnitsQueryError = AxiosError<void | AsError>;\n\nexport const useAppApiUnitGetOrgUnits = <\n TData = AsyncReturnType<typeof appApiUnitGetOrgUnits>,\n TError = AxiosError<void | AsError>\n>(\n orgId: string,\n options?: {\n query?: UseQueryOptions<\n AsyncReturnType<typeof appApiUnitGetOrgUnits>,\n TError,\n TData\n >;\n axios?: AxiosRequestConfig;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, axios: axiosOptions } = options || {};\n\n const queryKey =\n queryOptions?.queryKey ?? getAppApiUnitGetOrgUnitsQueryKey(orgId);\n\n const queryFn: QueryFunction<\n AsyncReturnType<typeof appApiUnitGetOrgUnits>\n > = () => appApiUnitGetOrgUnits(orgId, axiosOptions);\n\n const query = useQuery<\n AsyncReturnType<typeof appApiUnitGetOrgUnits>,\n TError,\n TData\n >(queryKey, queryFn, { enabled: !!orgId, ...queryOptions });\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Creates a new organisation unit. You need to be in the Organisation or an Admin user to use this endpoint\n\n * @summary Create a new Organisational Unit\n */\nexport const appApiUnitPost = (\n orgId: string,\n organisationUnitPostBodyBody: OrganisationUnitPostBodyBody,\n options?: AxiosRequestConfig\n): Promise<AxiosResponse<OrganisationUnitPostResponse>> => {\n return axios.post(\n `/organisation/${orgId}/unit`,\n organisationUnitPostBodyBody,\n options\n );\n};\n\nexport type AppApiUnitPostMutationResult = NonNullable<\n AsyncReturnType<typeof appApiUnitPost>\n>;\nexport type AppApiUnitPostMutationBody = OrganisationUnitPostBodyBody;\nexport type AppApiUnitPostMutationError = AxiosError<AsError | void>;\n\nexport const useAppApiUnitPost = <\n TError = AxiosError<AsError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof appApiUnitPost>,\n TError,\n { orgId: string; data: OrganisationUnitPostBodyBody },\n TContext\n >;\n axios?: AxiosRequestConfig;\n}) => {\n const { mutation: mutationOptions, axios: axiosOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof appApiUnitPost>,\n { orgId: string; data: OrganisationUnitPostBodyBody }\n > = (props) => {\n const { orgId, data } = props || {};\n\n return appApiUnitPost(orgId, data, axiosOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof appApiUnitPost>,\n TError,\n { orgId: string; data: OrganisationUnitPostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets the Unit, assuming you are a member of it or it is public. Admin users can see all Units\n\n * @summary Gets a Unit\n */\nexport const appApiUnitGetUnit = (\n orgId: string,\n unitId: string,\n options?: AxiosRequestConfig\n): Promise<AxiosResponse<UnitGetResponse>> => {\n return axios.get(`/organisation/${orgId}/unit/${unitId}`, options);\n};\n\nexport const getAppApiUnitGetUnitQueryKey = (orgId: string, unitId: string) => [\n `/organisation/${orgId}/unit/${unitId}`,\n];\n\nexport type AppApiUnitGetUnitQueryResult = NonNullable<\n AsyncReturnType<typeof appApiUnitGetUnit>\n>;\nexport type AppApiUnitGetUnitQueryError = AxiosError<void | AsError>;\n\nexport const useAppApiUnitGetUnit = <\n TData = AsyncReturnType<typeof appApiUnitGetUnit>,\n TError = AxiosError<void | AsError>\n>(\n orgId: string,\n unitId: string,\n options?: {\n query?: UseQueryOptions<\n AsyncReturnType<typeof appApiUnitGetUnit>,\n TError,\n TData\n >;\n axios?: AxiosRequestConfig;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, axios: axiosOptions } = options || {};\n\n const queryKey =\n queryOptions?.queryKey ?? getAppApiUnitGetUnitQueryKey(orgId, unitId);\n\n const queryFn: QueryFunction<\n AsyncReturnType<typeof appApiUnitGetUnit>\n > = () => appApiUnitGetUnit(orgId, unitId, axiosOptions);\n\n const query = useQuery<\n AsyncReturnType<typeof appApiUnitGetUnit>,\n TError,\n TData\n >(queryKey, queryFn, { enabled: !!(orgId && unitId), ...queryOptions });\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Deletes an Organisational Unit you have access to. Units can only be deleted by Organisation users or Admin users. You cannot delete a Unit that contains Products\n\n * @summary Deletes an Organisational Unit\n */\nexport const appApiUnitDelete = (\n orgId: string,\n unitId: string,\n options?: AxiosRequestConfig\n): Promise<AxiosResponse<void>> => {\n return axios.delete(`/organisation/${orgId}/unit/${unitId}`, options);\n};\n\nexport type AppApiUnitDeleteMutationResult = NonNullable<\n AsyncReturnType<typeof appApiUnitDelete>\n>;\n\nexport type AppApiUnitDeleteMutationError = AxiosError<AsError>;\n\nexport const useAppApiUnitDelete = <\n TError = AxiosError<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof appApiUnitDelete>,\n TError,\n { orgId: string; unitId: string },\n TContext\n >;\n axios?: AxiosRequestConfig;\n}) => {\n const { mutation: mutationOptions, axios: axiosOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof appApiUnitDelete>,\n { orgId: string; unitId: string }\n > = (props) => {\n const { orgId, unitId } = props || {};\n\n return appApiUnitDelete(orgId, unitId, axiosOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof appApiUnitDelete>,\n TError,\n { orgId: string; unitId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets all the Units that are public or you are a member of. Admin users can see all Units\n\n * @summary Gets Units\n */\nexport const appApiUnitGet = (\n options?: AxiosRequestConfig\n): Promise<AxiosResponse<UnitsGetResponse>> => {\n return axios.get(`/unit`, options);\n};\n\nexport const getAppApiUnitGetQueryKey = () => [`/unit`];\n\nexport type AppApiUnitGetQueryResult = NonNullable<\n AsyncReturnType<typeof appApiUnitGet>\n>;\nexport type AppApiUnitGetQueryError = AxiosError<void | AsError>;\n\nexport const useAppApiUnitGet = <\n TData = AsyncReturnType<typeof appApiUnitGet>,\n TError = AxiosError<void | AsError>\n>(options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof appApiUnitGet>, TError, TData>;\n axios?: AxiosRequestConfig;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, axios: axiosOptions } = options || {};\n\n const queryKey = queryOptions?.queryKey ?? getAppApiUnitGetQueryKey();\n\n const queryFn: QueryFunction<AsyncReturnType<typeof appApiUnitGet>> = () =>\n appApiUnitGet(axiosOptions);\n\n const query = useQuery<AsyncReturnType<typeof appApiUnitGet>, TError, TData>(\n queryKey,\n queryFn,\n queryOptions\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Creates a 'Personal' Unit for a User. The unit will belong to the built-in **Default** Organisation. Users can only have one Personal Unit and Personal Units cannot have other Users\n\n * @summary Create a new Independent User Unit\n */\nexport const appApiUnitPersonalPut = (\n options?: AxiosRequestConfig\n): Promise<AxiosResponse<PersonalUnitPutResponse>> => {\n return axios.put(`/unit`, undefined, options);\n};\n\nexport type AppApiUnitPersonalPutMutationResult = NonNullable<\n AsyncReturnType<typeof appApiUnitPersonalPut>\n>;\n\nexport type AppApiUnitPersonalPutMutationError = AxiosError<AsError | void>;\n\nexport const useAppApiUnitPersonalPut = <\n TError = AxiosError<AsError | void>,\n TVariables = void,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof appApiUnitPersonalPut>,\n TError,\n TVariables,\n TContext\n >;\n axios?: AxiosRequestConfig;\n}) => {\n const { mutation: mutationOptions, axios: axiosOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof appApiUnitPersonalPut>,\n TVariables\n > = () => {\n return appApiUnitPersonalPut(axiosOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof appApiUnitPersonalPut>,\n TError,\n TVariables,\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Deletes a 'Personal' Unit. It must be your Unit, which belongs to the Default Organisation\n\n * @summary Deletes an Independent Unit\n */\nexport const appApiUnitPersonalDelete = (\n options?: AxiosRequestConfig\n): Promise<AxiosResponse<void>> => {\n return axios.delete(`/unit`, options);\n};\n\nexport type AppApiUnitPersonalDeleteMutationResult = NonNullable<\n AsyncReturnType<typeof appApiUnitPersonalDelete>\n>;\n\nexport type AppApiUnitPersonalDeleteMutationError = AxiosError<AsError>;\n\nexport const useAppApiUnitPersonalDelete = <\n TError = AxiosError<AsError>,\n TVariables = void,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof appApiUnitPersonalDelete>,\n TError,\n TVariables,\n TContext\n >;\n axios?: AxiosRequestConfig;\n}) => {\n const { mutation: mutationOptions, axios: axiosOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof appApiUnitPersonalDelete>,\n TVariables\n > = () => {\n return appApiUnitPersonalDelete(axiosOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof appApiUnitPersonalDelete>,\n TError,\n TVariables,\n TContext\n >(mutationFn,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,CAIzC,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,OAAO,iBAAiB,WAAW,CAAC;AAEvE,QAAM,aAGF,MAAM;AACR,WAAO,yBAAyB,YAAY;AAAA,EAC9C;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B;","names":[]}
package/user/user.cjs CHANGED
@@ -1,97 +1,97 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
2
 
3
-
4
- var _chunk3DXYUDZHcjs = require('../chunk-3DXYUDZH.cjs');
3
+ var _chunkN3RLW53Gcjs = require('../chunk-N3RLW53G.cjs');
5
4
 
6
5
  // src/user/user.ts
6
+ var _axios = require('axios'); var _axios2 = _interopRequireDefault(_axios);
7
7
 
8
8
 
9
9
 
10
10
  var _reactquery = require('react-query');
11
- var getUserAccount = (options) => {
12
- return _chunk3DXYUDZHcjs.customInstance.call(void 0, { url: `/user/account`, method: "get" }, options);
11
+ var appApiUserGetAccount = (options) => {
12
+ return _axios2.default.get(`/user/account`, options);
13
13
  };
14
- var getGetUserAccountQueryKey = () => [`/user/account`];
15
- var useGetUserAccount = (options) => {
16
- const { query: queryOptions, request: requestOptions } = options || {};
17
- const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetUserAccountQueryKey()));
18
- const queryFn = () => getUserAccount(requestOptions);
14
+ var getAppApiUserGetAccountQueryKey = () => [`/user/account`];
15
+ var useAppApiUserGetAccount = (options) => {
16
+ const { query: queryOptions, axios: axiosOptions } = options || {};
17
+ const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getAppApiUserGetAccountQueryKey()));
18
+ const queryFn = () => appApiUserGetAccount(axiosOptions);
19
19
  const query = _reactquery.useQuery.call(void 0, queryKey, queryFn, queryOptions);
20
- return _chunk3DXYUDZHcjs.__spreadValues.call(void 0, {
20
+ return _chunkN3RLW53Gcjs.__spreadValues.call(void 0, {
21
21
  queryKey
22
22
  }, query);
23
23
  };
24
- var getOrganisationUsers = (orgid, options) => {
25
- return _chunk3DXYUDZHcjs.customInstance.call(void 0, { url: `/organisation/${orgid}/user`, method: "get" }, options);
24
+ var appApiUserOrgGetUsers = (orgId, options) => {
25
+ return _axios2.default.get(`/organisation/${orgId}/user`, options);
26
26
  };
27
- var getGetOrganisationUsersQueryKey = (orgid) => [
28
- `/organisation/${orgid}/user`
27
+ var getAppApiUserOrgGetUsersQueryKey = (orgId) => [
28
+ `/organisation/${orgId}/user`
29
29
  ];
30
- var useGetOrganisationUsers = (orgid, options) => {
31
- const { query: queryOptions, request: requestOptions } = options || {};
32
- const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetOrganisationUsersQueryKey(orgid)));
33
- const queryFn = () => getOrganisationUsers(orgid, requestOptions);
34
- const query = _reactquery.useQuery.call(void 0, queryKey, queryFn, _chunk3DXYUDZHcjs.__spreadValues.call(void 0, { enabled: !!orgid }, queryOptions));
35
- return _chunk3DXYUDZHcjs.__spreadValues.call(void 0, {
30
+ var useAppApiUserOrgGetUsers = (orgId, options) => {
31
+ const { query: queryOptions, axios: axiosOptions } = options || {};
32
+ const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getAppApiUserOrgGetUsersQueryKey(orgId)));
33
+ const queryFn = () => appApiUserOrgGetUsers(orgId, axiosOptions);
34
+ const query = _reactquery.useQuery.call(void 0, queryKey, queryFn, _chunkN3RLW53Gcjs.__spreadValues.call(void 0, { enabled: !!orgId }, queryOptions));
35
+ return _chunkN3RLW53Gcjs.__spreadValues.call(void 0, {
36
36
  queryKey
37
37
  }, query);
38
38
  };
39
- var addOrganisationUser = (orgid, userid, options) => {
40
- return _chunk3DXYUDZHcjs.customInstance.call(void 0, { url: `/organisation/${orgid}/user/${userid}`, method: "put" }, options);
39
+ var appApiUserOrgUserPut = (orgId, userId, options) => {
40
+ return _axios2.default.put(`/organisation/${orgId}/user/${userId}`, void 0, options);
41
41
  };
42
- var useAddOrganisationUser = (options) => {
43
- const { mutation: mutationOptions, request: requestOptions } = options || {};
42
+ var useAppApiUserOrgUserPut = (options) => {
43
+ const { mutation: mutationOptions, axios: axiosOptions } = options || {};
44
44
  const mutationFn = (props) => {
45
- const { orgid, userid } = props || {};
46
- return addOrganisationUser(orgid, userid, requestOptions);
45
+ const { orgId, userId } = props || {};
46
+ return appApiUserOrgUserPut(orgId, userId, axiosOptions);
47
47
  };
48
48
  return _reactquery.useMutation.call(void 0, mutationFn, mutationOptions);
49
49
  };
50
- var deleteOrganisationUser = (orgid, userid, options) => {
51
- return _chunk3DXYUDZHcjs.customInstance.call(void 0, { url: `/organisation/${orgid}/user/${userid}`, method: "delete" }, options);
50
+ var appApiUserOrgUserDelete = (orgId, userId, options) => {
51
+ return _axios2.default.delete(`/organisation/${orgId}/user/${userId}`, options);
52
52
  };
53
- var useDeleteOrganisationUser = (options) => {
54
- const { mutation: mutationOptions, request: requestOptions } = options || {};
53
+ var useAppApiUserOrgUserDelete = (options) => {
54
+ const { mutation: mutationOptions, axios: axiosOptions } = options || {};
55
55
  const mutationFn = (props) => {
56
- const { orgid, userid } = props || {};
57
- return deleteOrganisationUser(orgid, userid, requestOptions);
56
+ const { orgId, userId } = props || {};
57
+ return appApiUserOrgUserDelete(orgId, userId, axiosOptions);
58
58
  };
59
59
  return _reactquery.useMutation.call(void 0, mutationFn, mutationOptions);
60
60
  };
61
- var getOrganisationUnitUsers = (unitid, options) => {
62
- return _chunk3DXYUDZHcjs.customInstance.call(void 0, { url: `/unit/${unitid}/user`, method: "get" }, options);
61
+ var appApiUserGetUnitUsers = (unitId, options) => {
62
+ return _axios2.default.get(`/unit/${unitId}/user`, options);
63
63
  };
64
- var getGetOrganisationUnitUsersQueryKey = (unitid) => [
65
- `/unit/${unitid}/user`
64
+ var getAppApiUserGetUnitUsersQueryKey = (unitId) => [
65
+ `/unit/${unitId}/user`
66
66
  ];
67
- var useGetOrganisationUnitUsers = (unitid, options) => {
68
- const { query: queryOptions, request: requestOptions } = options || {};
69
- const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetOrganisationUnitUsersQueryKey(unitid)));
70
- const queryFn = () => getOrganisationUnitUsers(unitid, requestOptions);
71
- const query = _reactquery.useQuery.call(void 0, queryKey, queryFn, _chunk3DXYUDZHcjs.__spreadValues.call(void 0, { enabled: !!unitid }, queryOptions));
72
- return _chunk3DXYUDZHcjs.__spreadValues.call(void 0, {
67
+ var useAppApiUserGetUnitUsers = (unitId, options) => {
68
+ const { query: queryOptions, axios: axiosOptions } = options || {};
69
+ const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getAppApiUserGetUnitUsersQueryKey(unitId)));
70
+ const queryFn = () => appApiUserGetUnitUsers(unitId, axiosOptions);
71
+ const query = _reactquery.useQuery.call(void 0, queryKey, queryFn, _chunkN3RLW53Gcjs.__spreadValues.call(void 0, { enabled: !!unitId }, queryOptions));
72
+ return _chunkN3RLW53Gcjs.__spreadValues.call(void 0, {
73
73
  queryKey
74
74
  }, query);
75
75
  };
76
- var addOrganisationUnitUser = (unitid, userid, options) => {
77
- return _chunk3DXYUDZHcjs.customInstance.call(void 0, { url: `/unit/${unitid}/user/${userid}`, method: "put" }, options);
76
+ var appApiUserUnitUserPut = (unitId, userId, options) => {
77
+ return _axios2.default.put(`/unit/${unitId}/user/${userId}`, void 0, options);
78
78
  };
79
- var useAddOrganisationUnitUser = (options) => {
80
- const { mutation: mutationOptions, request: requestOptions } = options || {};
79
+ var useAppApiUserUnitUserPut = (options) => {
80
+ const { mutation: mutationOptions, axios: axiosOptions } = options || {};
81
81
  const mutationFn = (props) => {
82
- const { unitid, userid } = props || {};
83
- return addOrganisationUnitUser(unitid, userid, requestOptions);
82
+ const { unitId, userId } = props || {};
83
+ return appApiUserUnitUserPut(unitId, userId, axiosOptions);
84
84
  };
85
85
  return _reactquery.useMutation.call(void 0, mutationFn, mutationOptions);
86
86
  };
87
- var deleteOrganisationUnitUser = (unitid, userid, options) => {
88
- return _chunk3DXYUDZHcjs.customInstance.call(void 0, { url: `/unit/${unitid}/user/${userid}`, method: "delete" }, options);
87
+ var appApiUserUnitUserDelete = (unitId, userId, options) => {
88
+ return _axios2.default.delete(`/unit/${unitId}/user/${userId}`, options);
89
89
  };
90
- var useDeleteOrganisationUnitUser = (options) => {
91
- const { mutation: mutationOptions, request: requestOptions } = options || {};
90
+ var useAppApiUserUnitUserDelete = (options) => {
91
+ const { mutation: mutationOptions, axios: axiosOptions } = options || {};
92
92
  const mutationFn = (props) => {
93
- const { unitid, userid } = props || {};
94
- return deleteOrganisationUnitUser(unitid, userid, requestOptions);
93
+ const { unitId, userId } = props || {};
94
+ return appApiUserUnitUserDelete(unitId, userId, axiosOptions);
95
95
  };
96
96
  return _reactquery.useMutation.call(void 0, mutationFn, mutationOptions);
97
97
  };
@@ -113,5 +113,5 @@ var useDeleteOrganisationUnitUser = (options) => {
113
113
 
114
114
 
115
115
 
116
- exports.addOrganisationUnitUser = addOrganisationUnitUser; exports.addOrganisationUser = addOrganisationUser; exports.deleteOrganisationUnitUser = deleteOrganisationUnitUser; exports.deleteOrganisationUser = deleteOrganisationUser; exports.getGetOrganisationUnitUsersQueryKey = getGetOrganisationUnitUsersQueryKey; exports.getGetOrganisationUsersQueryKey = getGetOrganisationUsersQueryKey; exports.getGetUserAccountQueryKey = getGetUserAccountQueryKey; exports.getOrganisationUnitUsers = getOrganisationUnitUsers; exports.getOrganisationUsers = getOrganisationUsers; exports.getUserAccount = getUserAccount; exports.useAddOrganisationUnitUser = useAddOrganisationUnitUser; exports.useAddOrganisationUser = useAddOrganisationUser; exports.useDeleteOrganisationUnitUser = useDeleteOrganisationUnitUser; exports.useDeleteOrganisationUser = useDeleteOrganisationUser; exports.useGetOrganisationUnitUsers = useGetOrganisationUnitUsers; exports.useGetOrganisationUsers = useGetOrganisationUsers; exports.useGetUserAccount = useGetUserAccount;
116
+ exports.appApiUserGetAccount = appApiUserGetAccount; exports.appApiUserGetUnitUsers = appApiUserGetUnitUsers; exports.appApiUserOrgGetUsers = appApiUserOrgGetUsers; exports.appApiUserOrgUserDelete = appApiUserOrgUserDelete; exports.appApiUserOrgUserPut = appApiUserOrgUserPut; exports.appApiUserUnitUserDelete = appApiUserUnitUserDelete; exports.appApiUserUnitUserPut = appApiUserUnitUserPut; exports.getAppApiUserGetAccountQueryKey = getAppApiUserGetAccountQueryKey; exports.getAppApiUserGetUnitUsersQueryKey = getAppApiUserGetUnitUsersQueryKey; exports.getAppApiUserOrgGetUsersQueryKey = getAppApiUserOrgGetUsersQueryKey; exports.useAppApiUserGetAccount = useAppApiUserGetAccount; exports.useAppApiUserGetUnitUsers = useAppApiUserGetUnitUsers; exports.useAppApiUserOrgGetUsers = useAppApiUserOrgGetUsers; exports.useAppApiUserOrgUserDelete = useAppApiUserOrgUserDelete; exports.useAppApiUserOrgUserPut = useAppApiUserOrgUserPut; exports.useAppApiUserUnitUserDelete = useAppApiUserUnitUserDelete; exports.useAppApiUserUnitUserPut = useAppApiUserUnitUserPut;
117
117
  //# sourceMappingURL=user.cjs.map
package/user/user.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/user/user.ts"],"names":[],"mappings":";;;;;;AAUA;AAAA;AAAA;AAAA;AAqCO,IAAM,iBAAiB,CAC5B,YACG;AACH,SAAO,eACL,EAAE,KAAK,iBAAiB,QAAQ,SAChC;AAAA;AAIG,IAAM,4BAA4B,MAAM,CAAC;AAEzC,IAAM,oBAAoB,CAG/B,YAO4D;AAC5D,QAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW;AAEpE,QAAM,WAAW,8CAAc,aAA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2BAA2B,CACtC,QACA,YACG;AACH,SAAO,eACL,EAAE,KAAK,SAAS,eAAe,QAAQ,SACvC;AAAA;AAIG,IAAM,sCAAsC,CAAC,WAAmB;AAAA,EACrE,SAAS;AAAA;AAGJ,IAAM,8BAA8B,CAIzC,QACA,YAQ2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW;AAEpE,QAAM,WACJ,8CAAc,aAAY,oCAAoC;AAEhE,QAAM,UAEF,MAAM,yBAAyB,QAAQ;AAE3C,QAAM,QAAQ,SAIZ,UAAU,SAAS,iBAAE,SAAS,CAAC,CAAC,UAAW;AAE7C,SAAO;AAAA,IACL;AAAA,KACG;AAAA;AAaA,IAAM,0BAA0B,CACrC,QACA,QACA,YACG;AACH,SAAO,eACL,EAAE,KAAK,SAAS,eAAe,UAAU,QAAQ,SACjD;AAAA;AAIG,IAAM,6BAA6B,CAGxC,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW;AAE1E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,QAAQ,WAAW,SAAS;AAEpC,WAAO,wBAAwB,QAAQ,QAAQ;AAAA;AAGjD,SAAO,YAKL,YAAY;AAAA;AAWT,IAAM,6BAA6B,CACxC,QACA,QACA,YACG;AACH,SAAO,eACL,EAAE,KAAK,SAAS,eAAe,UAAU,QAAQ,YACjD;AAAA;AAIG,IAAM,gCAAgC,CAG3C,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW;AAE1E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,QAAQ,WAAW,SAAS;AAEpC,WAAO,2BAA2B,QAAQ,QAAQ;AAAA;AAGpD,SAAO,YAKL,YAAY;AAAA","sourcesContent":["/**\n * Generated by orval v6.6.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 **Products**, **Organisations**, **Units** and **Users**.\n\n * OpenAPI spec version: 0.1\n */\nimport {\n useQuery,\n useMutation,\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"react-query\";\nimport type {\n UserAccountGetResponse,\n AsError,\n UsersGetResponse,\n} from \"../account-server-api.schemas\";\nimport { customInstance, ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (\n ...args: any\n) => Promise<infer R>\n ? R\n : any;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * Returns a summary of your account\n\n * @summary Get information about your account\n */\nexport const getUserAccount = (\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<UserAccountGetResponse>(\n { url: `/user/account`, method: \"get\" },\n options\n );\n};\n\nexport const getGetUserAccountQueryKey = () => [`/user/account`];\n\nexport const useGetUserAccount = <\n TData = AsyncReturnType<typeof getUserAccount>,\n TError = ErrorType<void | AsError>\n>(options?: {\n query?: UseQueryOptions<\n AsyncReturnType<typeof getUserAccount>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUserAccountQueryKey();\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getUserAccount>> = () =>\n getUserAccount(requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getUserAccount>, TError, TData>(\n queryKey,\n queryFn,\n queryOptions\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Gets users in an Organisation. You have to be in the Organisation or an Admin user to use this endpoint\n\n * @summary Gets users in an organisation\n */\nexport const getOrganisationUsers = (\n orgid: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<UsersGetResponse>(\n { url: `/organisation/${orgid}/user`, method: \"get\" },\n options\n );\n};\n\nexport const getGetOrganisationUsersQueryKey = (orgid: string) => [\n `/organisation/${orgid}/user`,\n];\n\nexport const useGetOrganisationUsers = <\n TData = AsyncReturnType<typeof getOrganisationUsers>,\n TError = ErrorType<AsError | void>\n>(\n orgid: string,\n options?: {\n query?: UseQueryOptions<\n AsyncReturnType<typeof getOrganisationUsers>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetOrganisationUsersQueryKey(orgid);\n\n const queryFn: QueryFunction<\n AsyncReturnType<typeof getOrganisationUsers>\n > = () => getOrganisationUsers(orgid, requestOptions);\n\n const query = useQuery<\n AsyncReturnType<typeof getOrganisationUsers>,\n TError,\n TData\n >(queryKey, queryFn, { enabled: !!orgid, ...queryOptions });\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Adds a user to an organisation. You have to be in the Organisation or an Admin user to use this endpoint\n\n * @summary Adds a user to an organisation\n */\nexport const addOrganisationUser = (\n orgid: string,\n userid: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/organisation/${orgid}/user/${userid}`, method: \"put\" },\n options\n );\n};\n\nexport const useAddOrganisationUser = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof addOrganisationUser>,\n TError,\n { orgid: string; userid: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof addOrganisationUser>,\n { orgid: string; userid: string }\n > = (props) => {\n const { orgid, userid } = props || {};\n\n return addOrganisationUser(orgid, userid, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof addOrganisationUser>,\n TError,\n { orgid: string; userid: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Removes a user from an organisation. You have to be in the Organisation or an Admin user to use this endpoint\n\n * @summary Deletes a user from an organisation\n */\nexport const deleteOrganisationUser = (\n orgid: string,\n userid: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/organisation/${orgid}/user/${userid}`, method: \"delete\" },\n options\n );\n};\n\nexport const useDeleteOrganisationUser = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof deleteOrganisationUser>,\n TError,\n { orgid: string; userid: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof deleteOrganisationUser>,\n { orgid: string; userid: string }\n > = (props) => {\n const { orgid, userid } = props || {};\n\n return deleteOrganisationUser(orgid, userid, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof deleteOrganisationUser>,\n TError,\n { orgid: string; userid: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets users in an Organisational Unit. You have to be in the Organisation or Unit or an Admin user to use this endpoint\n\n * @summary Gets users in an Organisational Unit\n */\nexport const getOrganisationUnitUsers = (\n unitid: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<UsersGetResponse>(\n { url: `/unit/${unitid}/user`, method: \"get\" },\n options\n );\n};\n\nexport const getGetOrganisationUnitUsersQueryKey = (unitid: string) => [\n `/unit/${unitid}/user`,\n];\n\nexport const useGetOrganisationUnitUsers = <\n TData = AsyncReturnType<typeof getOrganisationUnitUsers>,\n TError = ErrorType<AsError | void>\n>(\n unitid: string,\n options?: {\n query?: UseQueryOptions<\n AsyncReturnType<typeof getOrganisationUnitUsers>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetOrganisationUnitUsersQueryKey(unitid);\n\n const queryFn: QueryFunction<\n AsyncReturnType<typeof getOrganisationUnitUsers>\n > = () => getOrganisationUnitUsers(unitid, requestOptions);\n\n const query = useQuery<\n AsyncReturnType<typeof getOrganisationUnitUsers>,\n TError,\n TData\n >(queryKey, queryFn, { enabled: !!unitid, ...queryOptions });\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Adds a user to an Organisational Unit.\n\nUsers cannot be added to **Independent Units** (Units that are part of the ***Default** Organisation).\n\nYou have to be in the Organisation or Unit or an Admin user to use this endpoint\n\n * @summary Adds a user to an Organisational Unit\n */\nexport const addOrganisationUnitUser = (\n unitid: string,\n userid: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/unit/${unitid}/user/${userid}`, method: \"put\" },\n options\n );\n};\n\nexport const useAddOrganisationUnitUser = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof addOrganisationUnitUser>,\n TError,\n { unitid: string; userid: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof addOrganisationUnitUser>,\n { unitid: string; userid: string }\n > = (props) => {\n const { unitid, userid } = props || {};\n\n return addOrganisationUnitUser(unitid, userid, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof addOrganisationUnitUser>,\n TError,\n { unitid: string; userid: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Removes a user from an Organisational Unit.\n\nUsers cannot be removed from **Independent Units** (Units that are part of the ***Default** Organisation).\n\nYou have to be in the Organisation or Unit or an Admin user to use this endpoint\n\n * @summary Deletes a user from an Organisational Unit\n */\nexport const deleteOrganisationUnitUser = (\n unitid: string,\n userid: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/unit/${unitid}/user/${userid}`, method: \"delete\" },\n options\n );\n};\n\nexport const useDeleteOrganisationUnitUser = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof deleteOrganisationUnitUser>,\n TError,\n { unitid: string; userid: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof deleteOrganisationUnitUser>,\n { unitid: string; userid: string }\n > = (props) => {\n const { unitid, userid } = props || {};\n\n return deleteOrganisationUnitUser(unitid, userid, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof deleteOrganisationUnitUser>,\n TError,\n { unitid: string; userid: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n"]}
1
+ {"version":3,"sources":["../../src/user/user.ts"],"names":[],"mappings":";;;;;AAUA;AACA;AAAA;AAAA;AAAA;AA4BO,IAAM,uBAAuB,CAClC,YACmD;AACnD,SAAO,MAAM,IAAI,iBAAiB,OAAO;AAC3C;AAEO,IAAM,kCAAkC,MAAM,CAAC,eAAe;AAO9D,IAAM,0BAA0B,CAGrC,YAO4D;AAC5D,QAAM,EAAE,OAAO,cAAc,OAAO,iBAAiB,WAAW,CAAC;AAEjE,QAAM,WAAW,8CAAc,aAAY,gCAAgC;AAE3E,QAAM,UAEF,MAAM,qBAAqB,YAAY;AAE3C,QAAM,QAAQ,SAIZ,UAAU,SAAS,YAAY;AAEjC,SAAO;AAAA,IACL;AAAA,KACG;AAEP;AAOO,IAAM,wBAAwB,CACnC,OACA,YAC6C;AAC7C,SAAO,MAAM,IAAI,iBAAiB,cAAc,OAAO;AACzD;AAEO,IAAM,mCAAmC,CAAC,UAAkB;AAAA,EACjE,iBAAiB;AACnB;AAOO,IAAM,2BAA2B,CAItC,OACA,YAQ2D;AAC3D,QAAM,EAA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Ac,aAAY,kCAAkC,MAAM;AAEpE,QAAM,UAEF,MAAM,uBAAuB,QAAQ,YAAY;AAErD,QAAM,QAAQ,SAIZ,UAAU,SAAS,iBAAE,SAAS,CAAC,CAAC,UAAW,aAAc;AAE3D,SAAO;AAAA,IACL;AAAA,KACG;AAEP;AAWO,IAAM,wBAAwB,CACnC,QACA,QACA,YACiC;AACjC,SAAO,MAAM,IAAI,SAAS,eAAe,UAAU,QAAW,OAAO;AACvE;AAQO,IAAM,2BAA2B,CAGtC,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,OAAO,iBAAiB,WAAW,CAAC;AAEvE,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,QAAQ,WAAW,SAAS,CAAC;AAErC,WAAO,sBAAsB,QAAQ,QAAQ,YAAY;AAAA,EAC3D;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B;AAUO,IAAM,2BAA2B,CACtC,QACA,QACA,YACiC;AACjC,SAAO,MAAM,OAAO,SAAS,eAAe,UAAU,OAAO;AAC/D;AAQO,IAAM,8BAA8B,CAGzC,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,OAAO,iBAAiB,WAAW,CAAC;AAEvE,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,QAAQ,WAAW,SAAS,CAAC;AAErC,WAAO,yBAAyB,QAAQ,QAAQ,YAAY;AAAA,EAC9D;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B","sourcesContent":["/**\n * Generated by orval v6.7.1 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Products**, **Organisations**, **Units** and **Users**.\n\n * OpenAPI spec version: 0.1\n */\nimport axios, { AxiosRequestConfig, AxiosResponse, AxiosError } from \"axios\";\nimport {\n useQuery,\n useMutation,\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"react-query\";\nimport type {\n UserAccountGetResponse,\n AsError,\n UsersGetResponse,\n} from \"../account-server-api.schemas\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (\n ...args: any\n) => Promise<infer R>\n ? R\n : any;\n\n/**\n * Returns a summary of your account\n\n * @summary Get information about your account\n */\nexport const appApiUserGetAccount = (\n options?: AxiosRequestConfig\n): Promise<AxiosResponse<UserAccountGetResponse>> => {\n return axios.get(`/user/account`, options);\n};\n\nexport const getAppApiUserGetAccountQueryKey = () => [`/user/account`];\n\nexport type AppApiUserGetAccountQueryResult = NonNullable<\n AsyncReturnType<typeof appApiUserGetAccount>\n>;\nexport type AppApiUserGetAccountQueryError = AxiosError<void | AsError>;\n\nexport const useAppApiUserGetAccount = <\n TData = AsyncReturnType<typeof appApiUserGetAccount>,\n TError = AxiosError<void | AsError>\n>(options?: {\n query?: UseQueryOptions<\n AsyncReturnType<typeof appApiUserGetAccount>,\n TError,\n TData\n >;\n axios?: AxiosRequestConfig;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, axios: axiosOptions } = options || {};\n\n const queryKey = queryOptions?.queryKey ?? getAppApiUserGetAccountQueryKey();\n\n const queryFn: QueryFunction<\n AsyncReturnType<typeof appApiUserGetAccount>\n > = () => appApiUserGetAccount(axiosOptions);\n\n const query = useQuery<\n AsyncReturnType<typeof appApiUserGetAccount>,\n TError,\n TData\n >(queryKey, queryFn, queryOptions);\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Gets users in an Organisation. You have to be in the Organisation or an Admin user to use this endpoint\n\n * @summary Gets users in an organisation\n */\nexport const appApiUserOrgGetUsers = (\n orgId: string,\n options?: AxiosRequestConfig\n): Promise<AxiosResponse<UsersGetResponse>> => {\n return axios.get(`/organisation/${orgId}/user`, options);\n};\n\nexport const getAppApiUserOrgGetUsersQueryKey = (orgId: string) => [\n `/organisation/${orgId}/user`,\n];\n\nexport type AppApiUserOrgGetUsersQueryResult = NonNullable<\n AsyncReturnType<typeof appApiUserOrgGetUsers>\n>;\nexport type AppApiUserOrgGetUsersQueryError = AxiosError<AsError | void>;\n\nexport const useAppApiUserOrgGetUsers = <\n TData = AsyncReturnType<typeof appApiUserOrgGetUsers>,\n TError = AxiosError<AsError | void>\n>(\n orgId: string,\n options?: {\n query?: UseQueryOptions<\n AsyncReturnType<typeof appApiUserOrgGetUsers>,\n TError,\n TData\n >;\n axios?: AxiosRequestConfig;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, axios: axiosOptions } = options || {};\n\n const queryKey =\n queryOptions?.queryKey ?? getAppApiUserOrgGetUsersQueryKey(orgId);\n\n const queryFn: QueryFunction<\n AsyncReturnType<typeof appApiUserOrgGetUsers>\n > = () => appApiUserOrgGetUsers(orgId, axiosOptions);\n\n const query = useQuery<\n AsyncReturnType<typeof appApiUserOrgGetUsers>,\n TError,\n TData\n >(queryKey, queryFn, { enabled: !!orgId, ...queryOptions });\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Adds a user to an organisation. You have to be in the Organisation or an Admin user to use this endpoint\n\n * @summary Adds a user to an organisation\n */\nexport const appApiUserOrgUserPut = (\n orgId: string,\n userId: string,\n options?: AxiosRequestConfig\n): Promise<AxiosResponse<void>> => {\n return axios.put(`/organisation/${orgId}/user/${userId}`, undefined, options);\n};\n\nexport type AppApiUserOrgUserPutMutationResult = NonNullable<\n AsyncReturnType<typeof appApiUserOrgUserPut>\n>;\n\nexport type AppApiUserOrgUserPutMutationError = AxiosError<AsError>;\n\nexport const useAppApiUserOrgUserPut = <\n TError = AxiosError<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof appApiUserOrgUserPut>,\n TError,\n { orgId: string; userId: string },\n TContext\n >;\n axios?: AxiosRequestConfig;\n}) => {\n const { mutation: mutationOptions, axios: axiosOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof appApiUserOrgUserPut>,\n { orgId: string; userId: string }\n > = (props) => {\n const { orgId, userId } = props || {};\n\n return appApiUserOrgUserPut(orgId, userId, axiosOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof appApiUserOrgUserPut>,\n TError,\n { orgId: string; userId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Removes a user from an organisation. You have to be in the Organisation or an Admin user to use this endpoint\n\n * @summary Deletes a user from an organisation\n */\nexport const appApiUserOrgUserDelete = (\n orgId: string,\n userId: string,\n options?: AxiosRequestConfig\n): Promise<AxiosResponse<void>> => {\n return axios.delete(`/organisation/${orgId}/user/${userId}`, options);\n};\n\nexport type AppApiUserOrgUserDeleteMutationResult = NonNullable<\n AsyncReturnType<typeof appApiUserOrgUserDelete>\n>;\n\nexport type AppApiUserOrgUserDeleteMutationError = AxiosError<AsError>;\n\nexport const useAppApiUserOrgUserDelete = <\n TError = AxiosError<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof appApiUserOrgUserDelete>,\n TError,\n { orgId: string; userId: string },\n TContext\n >;\n axios?: AxiosRequestConfig;\n}) => {\n const { mutation: mutationOptions, axios: axiosOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof appApiUserOrgUserDelete>,\n { orgId: string; userId: string }\n > = (props) => {\n const { orgId, userId } = props || {};\n\n return appApiUserOrgUserDelete(orgId, userId, axiosOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof appApiUserOrgUserDelete>,\n TError,\n { orgId: string; userId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets users in an Organisational Unit. You have to be in the Organisation or Unit or an Admin user to use this endpoint\n\n * @summary Gets users in an Organisational Unit\n */\nexport const appApiUserGetUnitUsers = (\n unitId: string,\n options?: AxiosRequestConfig\n): Promise<AxiosResponse<UsersGetResponse>> => {\n return axios.get(`/unit/${unitId}/user`, options);\n};\n\nexport const getAppApiUserGetUnitUsersQueryKey = (unitId: string) => [\n `/unit/${unitId}/user`,\n];\n\nexport type AppApiUserGetUnitUsersQueryResult = NonNullable<\n AsyncReturnType<typeof appApiUserGetUnitUsers>\n>;\nexport type AppApiUserGetUnitUsersQueryError = AxiosError<AsError | void>;\n\nexport const useAppApiUserGetUnitUsers = <\n TData = AsyncReturnType<typeof appApiUserGetUnitUsers>,\n TError = AxiosError<AsError | void>\n>(\n unitId: string,\n options?: {\n query?: UseQueryOptions<\n AsyncReturnType<typeof appApiUserGetUnitUsers>,\n TError,\n TData\n >;\n axios?: AxiosRequestConfig;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, axios: axiosOptions } = options || {};\n\n const queryKey =\n queryOptions?.queryKey ?? getAppApiUserGetUnitUsersQueryKey(unitId);\n\n const queryFn: QueryFunction<\n AsyncReturnType<typeof appApiUserGetUnitUsers>\n > = () => appApiUserGetUnitUsers(unitId, axiosOptions);\n\n const query = useQuery<\n AsyncReturnType<typeof appApiUserGetUnitUsers>,\n TError,\n TData\n >(queryKey, queryFn, { enabled: !!unitId, ...queryOptions });\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Adds a user to an Organisational Unit.\n\nUsers cannot be added to **Independent 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 appApiUserUnitUserPut = (\n unitId: string,\n userId: string,\n options?: AxiosRequestConfig\n): Promise<AxiosResponse<void>> => {\n return axios.put(`/unit/${unitId}/user/${userId}`, undefined, options);\n};\n\nexport type AppApiUserUnitUserPutMutationResult = NonNullable<\n AsyncReturnType<typeof appApiUserUnitUserPut>\n>;\n\nexport type AppApiUserUnitUserPutMutationError = AxiosError<AsError>;\n\nexport const useAppApiUserUnitUserPut = <\n TError = AxiosError<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof appApiUserUnitUserPut>,\n TError,\n { unitId: string; userId: string },\n TContext\n >;\n axios?: AxiosRequestConfig;\n}) => {\n const { mutation: mutationOptions, axios: axiosOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof appApiUserUnitUserPut>,\n { unitId: string; userId: string }\n > = (props) => {\n const { unitId, userId } = props || {};\n\n return appApiUserUnitUserPut(unitId, userId, axiosOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof appApiUserUnitUserPut>,\n TError,\n { unitId: string; userId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Removes a user from an Organisational Unit.\n\nUsers cannot be removed from **Independent 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 appApiUserUnitUserDelete = (\n unitId: string,\n userId: string,\n options?: AxiosRequestConfig\n): Promise<AxiosResponse<void>> => {\n return axios.delete(`/unit/${unitId}/user/${userId}`, options);\n};\n\nexport type AppApiUserUnitUserDeleteMutationResult = NonNullable<\n AsyncReturnType<typeof appApiUserUnitUserDelete>\n>;\n\nexport type AppApiUserUnitUserDeleteMutationError = AxiosError<AsError>;\n\nexport const useAppApiUserUnitUserDelete = <\n TError = AxiosError<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof appApiUserUnitUserDelete>,\n TError,\n { unitId: string; userId: string },\n TContext\n >;\n axios?: AxiosRequestConfig;\n}) => {\n const { mutation: mutationOptions, axios: axiosOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof appApiUserUnitUserDelete>,\n { unitId: string; userId: string }\n > = (props) => {\n const { unitId, userId } = props || {};\n\n return appApiUserUnitUserDelete(unitId, userId, axiosOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof appApiUserUnitUserDelete>,\n TError,\n { unitId: string; userId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n"]}