@squonk/account-server-client 0.1.26 → 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 (42) hide show
  1. package/{account-server-api.schemas-078442c3.d.ts → account-server-api.schemas-e6c5f956.d.ts} +13 -0
  2. package/index.cjs.map +1 -1
  3. package/index.d.ts +1 -1
  4. package/index.js.map +1 -1
  5. package/organisation/organisation.cjs +64 -19
  6. package/organisation/organisation.cjs.map +1 -1
  7. package/organisation/organisation.d.ts +67 -18
  8. package/organisation/organisation.js +64 -19
  9. package/organisation/organisation.js.map +1 -1
  10. package/package.json +1 -1
  11. package/product/product.cjs +108 -30
  12. package/product/product.cjs.map +1 -1
  13. package/product/product.d.ts +114 -24
  14. package/product/product.js +108 -30
  15. package/product/product.js.map +1 -1
  16. package/service/service.cjs +39 -10
  17. package/service/service.cjs.map +1 -1
  18. package/service/service.d.ts +34 -8
  19. package/service/service.js +39 -10
  20. package/service/service.js.map +1 -1
  21. package/src/account-server-api.schemas.ts +13 -0
  22. package/src/organisation/organisation.ts +195 -44
  23. package/src/product/product.ts +356 -84
  24. package/src/service/service.ts +108 -16
  25. package/src/state/state.ts +64 -16
  26. package/src/unit/unit.ts +339 -74
  27. package/src/user/user.ts +340 -67
  28. package/state/state.cjs +21 -7
  29. package/state/state.cjs.map +1 -1
  30. package/state/state.d.ts +17 -6
  31. package/state/state.js +21 -7
  32. package/state/state.js.map +1 -1
  33. package/unit/unit.cjs +104 -29
  34. package/unit/unit.cjs.map +1 -1
  35. package/unit/unit.d.ts +107 -25
  36. package/unit/unit.js +104 -29
  37. package/unit/unit.js.map +1 -1
  38. package/user/user.cjs +106 -29
  39. package/user/user.cjs.map +1 -1
  40. package/user/user.d.ts +132 -20
  41. package/user/user.js +106 -29
  42. package/user/user.js.map +1 -1
package/user/user.cjs CHANGED
@@ -1,40 +1,117 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }require('../chunk-N3RLW53G.cjs');
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
+
3
+ var _chunkN3RLW53Gcjs = require('../chunk-N3RLW53G.cjs');
2
4
 
3
5
  // src/user/user.ts
4
6
  var _axios = require('axios'); var _axios2 = _interopRequireDefault(_axios);
5
- var getUser = () => {
6
- const appApiUserGetAccount = (options) => {
7
- return _axios2.default.get(`/user/account`, options);
8
- };
9
- const appApiUserOrgGetUsers = (orgId, options) => {
10
- return _axios2.default.get(`/organisation/${orgId}/user`, options);
11
- };
12
- const appApiUserOrgUserPut = (orgId, userId, options) => {
13
- return _axios2.default.put(`/organisation/${orgId}/user/${userId}`, void 0, options);
14
- };
15
- const appApiUserOrgUserDelete = (orgId, userId, options) => {
16
- return _axios2.default.delete(`/organisation/${orgId}/user/${userId}`, options);
17
- };
18
- const appApiUserGetUnitUsers = (unitId, options) => {
19
- return _axios2.default.get(`/unit/${unitId}/user`, options);
7
+
8
+
9
+
10
+ var _reactquery = require('react-query');
11
+ var appApiUserGetAccount = (options) => {
12
+ return _axios2.default.get(`/user/account`, options);
13
+ };
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
+ const query = _reactquery.useQuery.call(void 0, queryKey, queryFn, queryOptions);
20
+ return _chunkN3RLW53Gcjs.__spreadValues.call(void 0, {
21
+ queryKey
22
+ }, query);
23
+ };
24
+ var appApiUserOrgGetUsers = (orgId, options) => {
25
+ return _axios2.default.get(`/organisation/${orgId}/user`, options);
26
+ };
27
+ var getAppApiUserOrgGetUsersQueryKey = (orgId) => [
28
+ `/organisation/${orgId}/user`
29
+ ];
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
+ queryKey
37
+ }, query);
38
+ };
39
+ var appApiUserOrgUserPut = (orgId, userId, options) => {
40
+ return _axios2.default.put(`/organisation/${orgId}/user/${userId}`, void 0, options);
41
+ };
42
+ var useAppApiUserOrgUserPut = (options) => {
43
+ const { mutation: mutationOptions, axios: axiosOptions } = options || {};
44
+ const mutationFn = (props) => {
45
+ const { orgId, userId } = props || {};
46
+ return appApiUserOrgUserPut(orgId, userId, axiosOptions);
20
47
  };
21
- const appApiUserUnitUserPut = (unitId, userId, options) => {
22
- return _axios2.default.put(`/unit/${unitId}/user/${userId}`, void 0, options);
48
+ return _reactquery.useMutation.call(void 0, mutationFn, mutationOptions);
49
+ };
50
+ var appApiUserOrgUserDelete = (orgId, userId, options) => {
51
+ return _axios2.default.delete(`/organisation/${orgId}/user/${userId}`, options);
52
+ };
53
+ var useAppApiUserOrgUserDelete = (options) => {
54
+ const { mutation: mutationOptions, axios: axiosOptions } = options || {};
55
+ const mutationFn = (props) => {
56
+ const { orgId, userId } = props || {};
57
+ return appApiUserOrgUserDelete(orgId, userId, axiosOptions);
23
58
  };
24
- const appApiUserUnitUserDelete = (unitId, userId, options) => {
25
- return _axios2.default.delete(`/unit/${unitId}/user/${userId}`, options);
59
+ return _reactquery.useMutation.call(void 0, mutationFn, mutationOptions);
60
+ };
61
+ var appApiUserGetUnitUsers = (unitId, options) => {
62
+ return _axios2.default.get(`/unit/${unitId}/user`, options);
63
+ };
64
+ var getAppApiUserGetUnitUsersQueryKey = (unitId) => [
65
+ `/unit/${unitId}/user`
66
+ ];
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
+ queryKey
74
+ }, query);
75
+ };
76
+ var appApiUserUnitUserPut = (unitId, userId, options) => {
77
+ return _axios2.default.put(`/unit/${unitId}/user/${userId}`, void 0, options);
78
+ };
79
+ var useAppApiUserUnitUserPut = (options) => {
80
+ const { mutation: mutationOptions, axios: axiosOptions } = options || {};
81
+ const mutationFn = (props) => {
82
+ const { unitId, userId } = props || {};
83
+ return appApiUserUnitUserPut(unitId, userId, axiosOptions);
26
84
  };
27
- return {
28
- appApiUserGetAccount,
29
- appApiUserOrgGetUsers,
30
- appApiUserOrgUserPut,
31
- appApiUserOrgUserDelete,
32
- appApiUserGetUnitUsers,
33
- appApiUserUnitUserPut,
34
- appApiUserUnitUserDelete
85
+ return _reactquery.useMutation.call(void 0, mutationFn, mutationOptions);
86
+ };
87
+ var appApiUserUnitUserDelete = (unitId, userId, options) => {
88
+ return _axios2.default.delete(`/unit/${unitId}/user/${userId}`, options);
89
+ };
90
+ var useAppApiUserUnitUserDelete = (options) => {
91
+ const { mutation: mutationOptions, axios: axiosOptions } = options || {};
92
+ const mutationFn = (props) => {
93
+ const { unitId, userId } = props || {};
94
+ return appApiUserUnitUserDelete(unitId, userId, axiosOptions);
35
95
  };
96
+ return _reactquery.useMutation.call(void 0, mutationFn, mutationOptions);
36
97
  };
37
98
 
38
99
 
39
- exports.getUser = getUser;
100
+
101
+
102
+
103
+
104
+
105
+
106
+
107
+
108
+
109
+
110
+
111
+
112
+
113
+
114
+
115
+
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;
40
117
  //# sourceMappingURL=user.cjs.map
package/user/user.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/user/user.ts"],"names":[],"mappings":";;;AAUA;AAMO,IAAM,UAAU,MAAM;AAM3B,QAAM,uBAAuB,CAC3B,YACmB;AACnB,WAAO,MAAM,IAAI,iBAAiB,OAAO;AAAA,EAC3C;AAMA,QAAM,wBAAwB,CAC5B,OACA,YACmB;AACnB,WAAO,MAAM,IAAI,iBAAiB,cAAc,OAAO;AAAA,EACzD;AAMA,QAAM,uBAAuB,CAC3B,OACA,QACA,YACmB;AACnB,WAAO,MAAM,IACX,iBAAiB,cAAc,UAC/B,QACA,OACF;AAAA,EACF;AAMA,QAAM,0BAA0B,CAC9B,OACA,QACA,YACmB;AACnB,WAAO,MAAM,OAAO,iBAAiB,cAAc,UAAU,OAAO;AAAA,EACtE;AAMA,QAAM,yBAAyB,CAC7B,QACA,YACmB;AACnB,WAAO,MAAM,IAAI,SAAS,eAAe,OAAO;AAAA,EAClD;AAUA,QAAM,wBAAwB,CAC5B,QACA,QACA,YACmB;AACnB,WAAO,MAAM,IAAI,SAAS,eAAe,UAAU,QAAW,OAAO;AAAA,EACvE;AAUA,QAAM,2BAA2B,CAC/B,QACA,QACA,YACmB;AACnB,WAAO,MAAM,OAAO,SAAS,eAAe,UAAU,OAAO;AAAA,EAC/D;AACA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF","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 } from \"axios\";\nimport type {\n UserAccountGetResponse,\n UsersGetResponse,\n} from \"../account-server-api.schemas\";\n\nexport const getUser = () => {\n /**\n * Returns a summary of your account\n\n * @summary Get information about your account\n */\n const appApiUserGetAccount = <TData = AxiosResponse<UserAccountGetResponse>>(\n options?: AxiosRequestConfig\n ): Promise<TData> => {\n return axios.get(`/user/account`, options);\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 */\n const appApiUserOrgGetUsers = <TData = AxiosResponse<UsersGetResponse>>(\n orgId: string,\n options?: AxiosRequestConfig\n ): Promise<TData> => {\n return axios.get(`/organisation/${orgId}/user`, options);\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 */\n const appApiUserOrgUserPut = <TData = AxiosResponse<void>>(\n orgId: string,\n userId: string,\n options?: AxiosRequestConfig\n ): Promise<TData> => {\n return axios.put(\n `/organisation/${orgId}/user/${userId}`,\n undefined,\n options\n );\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 */\n const appApiUserOrgUserDelete = <TData = AxiosResponse<void>>(\n orgId: string,\n userId: string,\n options?: AxiosRequestConfig\n ): Promise<TData> => {\n return axios.delete(`/organisation/${orgId}/user/${userId}`, options);\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 */\n const appApiUserGetUnitUsers = <TData = AxiosResponse<UsersGetResponse>>(\n unitId: string,\n options?: AxiosRequestConfig\n ): Promise<TData> => {\n return axios.get(`/unit/${unitId}/user`, options);\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 */\n const appApiUserUnitUserPut = <TData = AxiosResponse<void>>(\n unitId: string,\n userId: string,\n options?: AxiosRequestConfig\n ): Promise<TData> => {\n return axios.put(`/unit/${unitId}/user/${userId}`, undefined, options);\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 */\n const appApiUserUnitUserDelete = <TData = AxiosResponse<void>>(\n unitId: string,\n userId: string,\n options?: AxiosRequestConfig\n ): Promise<TData> => {\n return axios.delete(`/unit/${unitId}/user/${userId}`, options);\n };\n return {\n appApiUserGetAccount,\n appApiUserOrgGetUsers,\n appApiUserOrgUserPut,\n appApiUserOrgUserDelete,\n appApiUserGetUnitUsers,\n appApiUserUnitUserPut,\n appApiUserUnitUserDelete,\n };\n};\nexport type AppApiUserGetAccountResult = AxiosResponse<UserAccountGetResponse>;\nexport type AppApiUserOrgGetUsersResult = AxiosResponse<UsersGetResponse>;\nexport type AppApiUserOrgUserPutResult = AxiosResponse<void>;\nexport type AppApiUserOrgUserDeleteResult = AxiosResponse<void>;\nexport type AppApiUserGetUnitUsersResult = AxiosResponse<UsersGetResponse>;\nexport type AppApiUserUnitUserPutResult = AxiosResponse<void>;\nexport type AppApiUserUnitUserDeleteResult = AxiosResponse<void>;\n"]}
1
+ {"version":3,"sources":["../../src/user/user.ts"],"names":[],"mappings":"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","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"]}
package/user/user.d.ts CHANGED
@@ -1,21 +1,133 @@
1
- import { e as UserAccountDetail, K as UsersGetResponse, w as UserAccountGetResponse } from '../account-server-api.schemas-078442c3.js';
2
- import { AxiosResponse, AxiosRequestConfig } from 'axios';
3
-
4
- declare const getUser: () => {
5
- appApiUserGetAccount: <TData = AxiosResponse<UserAccountDetail, any>>(options?: AxiosRequestConfig<any> | undefined) => Promise<TData>;
6
- appApiUserOrgGetUsers: <TData_1 = AxiosResponse<UsersGetResponse, any>>(orgId: string, options?: AxiosRequestConfig<any> | undefined) => Promise<TData_1>;
7
- appApiUserOrgUserPut: <TData_2 = AxiosResponse<void, any>>(orgId: string, userId: string, options?: AxiosRequestConfig<any> | undefined) => Promise<TData_2>;
8
- appApiUserOrgUserDelete: <TData_3 = AxiosResponse<void, any>>(orgId: string, userId: string, options?: AxiosRequestConfig<any> | undefined) => Promise<TData_3>;
9
- appApiUserGetUnitUsers: <TData_4 = AxiosResponse<UsersGetResponse, any>>(unitId: string, options?: AxiosRequestConfig<any> | undefined) => Promise<TData_4>;
10
- appApiUserUnitUserPut: <TData_5 = AxiosResponse<void, any>>(unitId: string, userId: string, options?: AxiosRequestConfig<any> | undefined) => Promise<TData_5>;
11
- appApiUserUnitUserDelete: <TData_6 = AxiosResponse<void, any>>(unitId: string, userId: string, options?: AxiosRequestConfig<any> | undefined) => Promise<TData_6>;
1
+ import * as react_query from 'react-query';
2
+ import { UseQueryOptions, QueryKey, UseQueryResult, UseMutationOptions } from 'react-query';
3
+ import { w as UserAccountGetResponse, N as AsError, e as UserAccountDetail, K as UsersGetResponse } from '../account-server-api.schemas-e6c5f956.js';
4
+ import { AxiosRequestConfig, AxiosResponse, AxiosError } from 'axios';
5
+
6
+ declare type AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (...args: any) => Promise<infer R> ? R : any;
7
+ /**
8
+ * Returns a summary of your account
9
+
10
+ * @summary Get information about your account
11
+ */
12
+ declare const appApiUserGetAccount: (options?: AxiosRequestConfig<any> | undefined) => Promise<AxiosResponse<UserAccountGetResponse>>;
13
+ declare const getAppApiUserGetAccountQueryKey: () => string[];
14
+ declare type AppApiUserGetAccountQueryResult = NonNullable<AsyncReturnType<typeof appApiUserGetAccount>>;
15
+ declare type AppApiUserGetAccountQueryError = AxiosError<void | AsError>;
16
+ declare const useAppApiUserGetAccount: <TData = AxiosResponse<UserAccountDetail, any>, TError = AxiosError<void | AsError, any>>(options?: {
17
+ query?: UseQueryOptions<AxiosResponse<UserAccountDetail, any>, TError, TData, QueryKey> | undefined;
18
+ axios?: AxiosRequestConfig<any> | undefined;
19
+ } | undefined) => UseQueryResult<TData, TError> & {
20
+ queryKey: QueryKey;
21
+ };
22
+ /**
23
+ * Gets users in an Organisation. You have to be in the Organisation or an Admin user to use this endpoint
24
+
25
+ * @summary Gets users in an organisation
26
+ */
27
+ declare const appApiUserOrgGetUsers: (orgId: string, options?: AxiosRequestConfig<any> | undefined) => Promise<AxiosResponse<UsersGetResponse>>;
28
+ declare const getAppApiUserOrgGetUsersQueryKey: (orgId: string) => string[];
29
+ declare type AppApiUserOrgGetUsersQueryResult = NonNullable<AsyncReturnType<typeof appApiUserOrgGetUsers>>;
30
+ declare type AppApiUserOrgGetUsersQueryError = AxiosError<AsError | void>;
31
+ declare const useAppApiUserOrgGetUsers: <TData = AxiosResponse<UsersGetResponse, any>, TError = AxiosError<void | AsError, any>>(orgId: string, options?: {
32
+ query?: UseQueryOptions<AxiosResponse<UsersGetResponse, any>, TError, TData, QueryKey> | undefined;
33
+ axios?: AxiosRequestConfig<any> | undefined;
34
+ } | undefined) => UseQueryResult<TData, TError> & {
35
+ queryKey: QueryKey;
36
+ };
37
+ /**
38
+ * Adds a user to an organisation. You have to be in the Organisation or an Admin user to use this endpoint
39
+
40
+ * @summary Adds a user to an organisation
41
+ */
42
+ declare const appApiUserOrgUserPut: (orgId: string, userId: string, options?: AxiosRequestConfig<any> | undefined) => Promise<AxiosResponse<void>>;
43
+ declare type AppApiUserOrgUserPutMutationResult = NonNullable<AsyncReturnType<typeof appApiUserOrgUserPut>>;
44
+ declare type AppApiUserOrgUserPutMutationError = AxiosError<AsError>;
45
+ declare const useAppApiUserOrgUserPut: <TError = AxiosError<AsError, any>, TContext = unknown>(options?: {
46
+ mutation?: UseMutationOptions<AxiosResponse<void, any>, TError, {
47
+ orgId: string;
48
+ userId: string;
49
+ }, TContext> | undefined;
50
+ axios?: AxiosRequestConfig<any> | undefined;
51
+ } | undefined) => react_query.UseMutationResult<AxiosResponse<void, any>, TError, {
52
+ orgId: string;
53
+ userId: string;
54
+ }, TContext>;
55
+ /**
56
+ * Removes a user from an organisation. You have to be in the Organisation or an Admin user to use this endpoint
57
+
58
+ * @summary Deletes a user from an organisation
59
+ */
60
+ declare const appApiUserOrgUserDelete: (orgId: string, userId: string, options?: AxiosRequestConfig<any> | undefined) => Promise<AxiosResponse<void>>;
61
+ declare type AppApiUserOrgUserDeleteMutationResult = NonNullable<AsyncReturnType<typeof appApiUserOrgUserDelete>>;
62
+ declare type AppApiUserOrgUserDeleteMutationError = AxiosError<AsError>;
63
+ declare const useAppApiUserOrgUserDelete: <TError = AxiosError<AsError, any>, TContext = unknown>(options?: {
64
+ mutation?: UseMutationOptions<AxiosResponse<void, any>, TError, {
65
+ orgId: string;
66
+ userId: string;
67
+ }, TContext> | undefined;
68
+ axios?: AxiosRequestConfig<any> | undefined;
69
+ } | undefined) => react_query.UseMutationResult<AxiosResponse<void, any>, TError, {
70
+ orgId: string;
71
+ userId: string;
72
+ }, TContext>;
73
+ /**
74
+ * Gets users in an Organisational Unit. You have to be in the Organisation or Unit or an Admin user to use this endpoint
75
+
76
+ * @summary Gets users in an Organisational Unit
77
+ */
78
+ declare const appApiUserGetUnitUsers: (unitId: string, options?: AxiosRequestConfig<any> | undefined) => Promise<AxiosResponse<UsersGetResponse>>;
79
+ declare const getAppApiUserGetUnitUsersQueryKey: (unitId: string) => string[];
80
+ declare type AppApiUserGetUnitUsersQueryResult = NonNullable<AsyncReturnType<typeof appApiUserGetUnitUsers>>;
81
+ declare type AppApiUserGetUnitUsersQueryError = AxiosError<AsError | void>;
82
+ declare const useAppApiUserGetUnitUsers: <TData = AxiosResponse<UsersGetResponse, any>, TError = AxiosError<void | AsError, any>>(unitId: string, options?: {
83
+ query?: UseQueryOptions<AxiosResponse<UsersGetResponse, any>, TError, TData, QueryKey> | undefined;
84
+ axios?: AxiosRequestConfig<any> | undefined;
85
+ } | undefined) => UseQueryResult<TData, TError> & {
86
+ queryKey: QueryKey;
12
87
  };
13
- declare type AppApiUserGetAccountResult = AxiosResponse<UserAccountGetResponse>;
14
- declare type AppApiUserOrgGetUsersResult = AxiosResponse<UsersGetResponse>;
15
- declare type AppApiUserOrgUserPutResult = AxiosResponse<void>;
16
- declare type AppApiUserOrgUserDeleteResult = AxiosResponse<void>;
17
- declare type AppApiUserGetUnitUsersResult = AxiosResponse<UsersGetResponse>;
18
- declare type AppApiUserUnitUserPutResult = AxiosResponse<void>;
19
- declare type AppApiUserUnitUserDeleteResult = AxiosResponse<void>;
20
-
21
- export { AppApiUserGetAccountResult, AppApiUserGetUnitUsersResult, AppApiUserOrgGetUsersResult, AppApiUserOrgUserDeleteResult, AppApiUserOrgUserPutResult, AppApiUserUnitUserDeleteResult, AppApiUserUnitUserPutResult, getUser };
88
+ /**
89
+ * Adds a user to an Organisational Unit.
90
+
91
+ Users cannot be added to **Independent Units** (Units that are part of the ***Default** Organisation).
92
+
93
+ You have to be in the Organisation or Unit or an Admin user to use this endpoint
94
+
95
+ * @summary Adds a user to an Organisational Unit
96
+ */
97
+ declare const appApiUserUnitUserPut: (unitId: string, userId: string, options?: AxiosRequestConfig<any> | undefined) => Promise<AxiosResponse<void>>;
98
+ declare type AppApiUserUnitUserPutMutationResult = NonNullable<AsyncReturnType<typeof appApiUserUnitUserPut>>;
99
+ declare type AppApiUserUnitUserPutMutationError = AxiosError<AsError>;
100
+ declare const useAppApiUserUnitUserPut: <TError = AxiosError<AsError, any>, TContext = unknown>(options?: {
101
+ mutation?: UseMutationOptions<AxiosResponse<void, any>, TError, {
102
+ unitId: string;
103
+ userId: string;
104
+ }, TContext> | undefined;
105
+ axios?: AxiosRequestConfig<any> | undefined;
106
+ } | undefined) => react_query.UseMutationResult<AxiosResponse<void, any>, TError, {
107
+ unitId: string;
108
+ userId: string;
109
+ }, TContext>;
110
+ /**
111
+ * Removes a user from an Organisational Unit.
112
+
113
+ Users cannot be removed from **Independent Units** (Units that are part of the ***Default** Organisation).
114
+
115
+ You have to be in the Organisation or Unit or an Admin user to use this endpoint
116
+
117
+ * @summary Deletes a user from an Organisational Unit
118
+ */
119
+ declare const appApiUserUnitUserDelete: (unitId: string, userId: string, options?: AxiosRequestConfig<any> | undefined) => Promise<AxiosResponse<void>>;
120
+ declare type AppApiUserUnitUserDeleteMutationResult = NonNullable<AsyncReturnType<typeof appApiUserUnitUserDelete>>;
121
+ declare type AppApiUserUnitUserDeleteMutationError = AxiosError<AsError>;
122
+ declare const useAppApiUserUnitUserDelete: <TError = AxiosError<AsError, any>, TContext = unknown>(options?: {
123
+ mutation?: UseMutationOptions<AxiosResponse<void, any>, TError, {
124
+ unitId: string;
125
+ userId: string;
126
+ }, TContext> | undefined;
127
+ axios?: AxiosRequestConfig<any> | undefined;
128
+ } | undefined) => react_query.UseMutationResult<AxiosResponse<void, any>, TError, {
129
+ unitId: string;
130
+ userId: string;
131
+ }, TContext>;
132
+
133
+ export { AppApiUserGetAccountQueryError, AppApiUserGetAccountQueryResult, AppApiUserGetUnitUsersQueryError, AppApiUserGetUnitUsersQueryResult, AppApiUserOrgGetUsersQueryError, AppApiUserOrgGetUsersQueryResult, AppApiUserOrgUserDeleteMutationError, AppApiUserOrgUserDeleteMutationResult, AppApiUserOrgUserPutMutationError, AppApiUserOrgUserPutMutationResult, AppApiUserUnitUserDeleteMutationError, AppApiUserUnitUserDeleteMutationResult, AppApiUserUnitUserPutMutationError, AppApiUserUnitUserPutMutationResult, appApiUserGetAccount, appApiUserGetUnitUsers, appApiUserOrgGetUsers, appApiUserOrgUserDelete, appApiUserOrgUserPut, appApiUserUnitUserDelete, appApiUserUnitUserPut, getAppApiUserGetAccountQueryKey, getAppApiUserGetUnitUsersQueryKey, getAppApiUserOrgGetUsersQueryKey, useAppApiUserGetAccount, useAppApiUserGetUnitUsers, useAppApiUserOrgGetUsers, useAppApiUserOrgUserDelete, useAppApiUserOrgUserPut, useAppApiUserUnitUserDelete, useAppApiUserUnitUserPut };
package/user/user.js CHANGED
@@ -1,40 +1,117 @@
1
- import "../chunk-GWBPVOL2.js";
1
+ import {
2
+ __spreadValues
3
+ } from "../chunk-GWBPVOL2.js";
2
4
 
3
5
  // src/user/user.ts
4
6
  import axios from "axios";
5
- var getUser = () => {
6
- const appApiUserGetAccount = (options) => {
7
- return axios.get(`/user/account`, options);
8
- };
9
- const appApiUserOrgGetUsers = (orgId, options) => {
10
- return axios.get(`/organisation/${orgId}/user`, options);
11
- };
12
- const appApiUserOrgUserPut = (orgId, userId, options) => {
13
- return axios.put(`/organisation/${orgId}/user/${userId}`, void 0, options);
14
- };
15
- const appApiUserOrgUserDelete = (orgId, userId, options) => {
16
- return axios.delete(`/organisation/${orgId}/user/${userId}`, options);
17
- };
18
- const appApiUserGetUnitUsers = (unitId, options) => {
19
- return axios.get(`/unit/${unitId}/user`, options);
7
+ import {
8
+ useQuery,
9
+ useMutation
10
+ } from "react-query";
11
+ var appApiUserGetAccount = (options) => {
12
+ return axios.get(`/user/account`, options);
13
+ };
14
+ var getAppApiUserGetAccountQueryKey = () => [`/user/account`];
15
+ var useAppApiUserGetAccount = (options) => {
16
+ const { query: queryOptions, axios: axiosOptions } = options || {};
17
+ const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getAppApiUserGetAccountQueryKey();
18
+ const queryFn = () => appApiUserGetAccount(axiosOptions);
19
+ const query = useQuery(queryKey, queryFn, queryOptions);
20
+ return __spreadValues({
21
+ queryKey
22
+ }, query);
23
+ };
24
+ var appApiUserOrgGetUsers = (orgId, options) => {
25
+ return axios.get(`/organisation/${orgId}/user`, options);
26
+ };
27
+ var getAppApiUserOrgGetUsersQueryKey = (orgId) => [
28
+ `/organisation/${orgId}/user`
29
+ ];
30
+ var useAppApiUserOrgGetUsers = (orgId, options) => {
31
+ const { query: queryOptions, axios: axiosOptions } = options || {};
32
+ const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getAppApiUserOrgGetUsersQueryKey(orgId);
33
+ const queryFn = () => appApiUserOrgGetUsers(orgId, axiosOptions);
34
+ const query = useQuery(queryKey, queryFn, __spreadValues({ enabled: !!orgId }, queryOptions));
35
+ return __spreadValues({
36
+ queryKey
37
+ }, query);
38
+ };
39
+ var appApiUserOrgUserPut = (orgId, userId, options) => {
40
+ return axios.put(`/organisation/${orgId}/user/${userId}`, void 0, options);
41
+ };
42
+ var useAppApiUserOrgUserPut = (options) => {
43
+ const { mutation: mutationOptions, axios: axiosOptions } = options || {};
44
+ const mutationFn = (props) => {
45
+ const { orgId, userId } = props || {};
46
+ return appApiUserOrgUserPut(orgId, userId, axiosOptions);
20
47
  };
21
- const appApiUserUnitUserPut = (unitId, userId, options) => {
22
- return axios.put(`/unit/${unitId}/user/${userId}`, void 0, options);
48
+ return useMutation(mutationFn, mutationOptions);
49
+ };
50
+ var appApiUserOrgUserDelete = (orgId, userId, options) => {
51
+ return axios.delete(`/organisation/${orgId}/user/${userId}`, options);
52
+ };
53
+ var useAppApiUserOrgUserDelete = (options) => {
54
+ const { mutation: mutationOptions, axios: axiosOptions } = options || {};
55
+ const mutationFn = (props) => {
56
+ const { orgId, userId } = props || {};
57
+ return appApiUserOrgUserDelete(orgId, userId, axiosOptions);
23
58
  };
24
- const appApiUserUnitUserDelete = (unitId, userId, options) => {
25
- return axios.delete(`/unit/${unitId}/user/${userId}`, options);
59
+ return useMutation(mutationFn, mutationOptions);
60
+ };
61
+ var appApiUserGetUnitUsers = (unitId, options) => {
62
+ return axios.get(`/unit/${unitId}/user`, options);
63
+ };
64
+ var getAppApiUserGetUnitUsersQueryKey = (unitId) => [
65
+ `/unit/${unitId}/user`
66
+ ];
67
+ var useAppApiUserGetUnitUsers = (unitId, options) => {
68
+ const { query: queryOptions, axios: axiosOptions } = options || {};
69
+ const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getAppApiUserGetUnitUsersQueryKey(unitId);
70
+ const queryFn = () => appApiUserGetUnitUsers(unitId, axiosOptions);
71
+ const query = useQuery(queryKey, queryFn, __spreadValues({ enabled: !!unitId }, queryOptions));
72
+ return __spreadValues({
73
+ queryKey
74
+ }, query);
75
+ };
76
+ var appApiUserUnitUserPut = (unitId, userId, options) => {
77
+ return axios.put(`/unit/${unitId}/user/${userId}`, void 0, options);
78
+ };
79
+ var useAppApiUserUnitUserPut = (options) => {
80
+ const { mutation: mutationOptions, axios: axiosOptions } = options || {};
81
+ const mutationFn = (props) => {
82
+ const { unitId, userId } = props || {};
83
+ return appApiUserUnitUserPut(unitId, userId, axiosOptions);
26
84
  };
27
- return {
28
- appApiUserGetAccount,
29
- appApiUserOrgGetUsers,
30
- appApiUserOrgUserPut,
31
- appApiUserOrgUserDelete,
32
- appApiUserGetUnitUsers,
33
- appApiUserUnitUserPut,
34
- appApiUserUnitUserDelete
85
+ return useMutation(mutationFn, mutationOptions);
86
+ };
87
+ var appApiUserUnitUserDelete = (unitId, userId, options) => {
88
+ return axios.delete(`/unit/${unitId}/user/${userId}`, options);
89
+ };
90
+ var useAppApiUserUnitUserDelete = (options) => {
91
+ const { mutation: mutationOptions, axios: axiosOptions } = options || {};
92
+ const mutationFn = (props) => {
93
+ const { unitId, userId } = props || {};
94
+ return appApiUserUnitUserDelete(unitId, userId, axiosOptions);
35
95
  };
96
+ return useMutation(mutationFn, mutationOptions);
36
97
  };
37
98
  export {
38
- getUser
99
+ appApiUserGetAccount,
100
+ appApiUserGetUnitUsers,
101
+ appApiUserOrgGetUsers,
102
+ appApiUserOrgUserDelete,
103
+ appApiUserOrgUserPut,
104
+ appApiUserUnitUserDelete,
105
+ appApiUserUnitUserPut,
106
+ getAppApiUserGetAccountQueryKey,
107
+ getAppApiUserGetUnitUsersQueryKey,
108
+ getAppApiUserOrgGetUsersQueryKey,
109
+ useAppApiUserGetAccount,
110
+ useAppApiUserGetUnitUsers,
111
+ useAppApiUserOrgGetUsers,
112
+ useAppApiUserOrgUserDelete,
113
+ useAppApiUserOrgUserPut,
114
+ useAppApiUserUnitUserDelete,
115
+ useAppApiUserUnitUserPut
39
116
  };
40
117
  //# sourceMappingURL=user.js.map
package/user/user.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/user/user.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 } from \"axios\";\nimport type {\n UserAccountGetResponse,\n UsersGetResponse,\n} from \"../account-server-api.schemas\";\n\nexport const getUser = () => {\n /**\n * Returns a summary of your account\n\n * @summary Get information about your account\n */\n const appApiUserGetAccount = <TData = AxiosResponse<UserAccountGetResponse>>(\n options?: AxiosRequestConfig\n ): Promise<TData> => {\n return axios.get(`/user/account`, options);\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 */\n const appApiUserOrgGetUsers = <TData = AxiosResponse<UsersGetResponse>>(\n orgId: string,\n options?: AxiosRequestConfig\n ): Promise<TData> => {\n return axios.get(`/organisation/${orgId}/user`, options);\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 */\n const appApiUserOrgUserPut = <TData = AxiosResponse<void>>(\n orgId: string,\n userId: string,\n options?: AxiosRequestConfig\n ): Promise<TData> => {\n return axios.put(\n `/organisation/${orgId}/user/${userId}`,\n undefined,\n options\n );\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 */\n const appApiUserOrgUserDelete = <TData = AxiosResponse<void>>(\n orgId: string,\n userId: string,\n options?: AxiosRequestConfig\n ): Promise<TData> => {\n return axios.delete(`/organisation/${orgId}/user/${userId}`, options);\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 */\n const appApiUserGetUnitUsers = <TData = AxiosResponse<UsersGetResponse>>(\n unitId: string,\n options?: AxiosRequestConfig\n ): Promise<TData> => {\n return axios.get(`/unit/${unitId}/user`, options);\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 */\n const appApiUserUnitUserPut = <TData = AxiosResponse<void>>(\n unitId: string,\n userId: string,\n options?: AxiosRequestConfig\n ): Promise<TData> => {\n return axios.put(`/unit/${unitId}/user/${userId}`, undefined, options);\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 */\n const appApiUserUnitUserDelete = <TData = AxiosResponse<void>>(\n unitId: string,\n userId: string,\n options?: AxiosRequestConfig\n ): Promise<TData> => {\n return axios.delete(`/unit/${unitId}/user/${userId}`, options);\n };\n return {\n appApiUserGetAccount,\n appApiUserOrgGetUsers,\n appApiUserOrgUserPut,\n appApiUserOrgUserDelete,\n appApiUserGetUnitUsers,\n appApiUserUnitUserPut,\n appApiUserUnitUserDelete,\n };\n};\nexport type AppApiUserGetAccountResult = AxiosResponse<UserAccountGetResponse>;\nexport type AppApiUserOrgGetUsersResult = AxiosResponse<UsersGetResponse>;\nexport type AppApiUserOrgUserPutResult = AxiosResponse<void>;\nexport type AppApiUserOrgUserDeleteResult = AxiosResponse<void>;\nexport type AppApiUserGetUnitUsersResult = AxiosResponse<UsersGetResponse>;\nexport type AppApiUserUnitUserPutResult = AxiosResponse<void>;\nexport type AppApiUserUnitUserDeleteResult = AxiosResponse<void>;\n"],"mappings":";;;AAUA;AAMO,IAAM,UAAU,MAAM;AAM3B,QAAM,uBAAuB,CAC3B,YACmB;AACnB,WAAO,MAAM,IAAI,iBAAiB,OAAO;AAAA,EAC3C;AAMA,QAAM,wBAAwB,CAC5B,OACA,YACmB;AACnB,WAAO,MAAM,IAAI,iBAAiB,cAAc,OAAO;AAAA,EACzD;AAMA,QAAM,uBAAuB,CAC3B,OACA,QACA,YACmB;AACnB,WAAO,MAAM,IACX,iBAAiB,cAAc,UAC/B,QACA,OACF;AAAA,EACF;AAMA,QAAM,0BAA0B,CAC9B,OACA,QACA,YACmB;AACnB,WAAO,MAAM,OAAO,iBAAiB,cAAc,UAAU,OAAO;AAAA,EACtE;AAMA,QAAM,yBAAyB,CAC7B,QACA,YACmB;AACnB,WAAO,MAAM,IAAI,SAAS,eAAe,OAAO;AAAA,EAClD;AAUA,QAAM,wBAAwB,CAC5B,QACA,QACA,YACmB;AACnB,WAAO,MAAM,IAAI,SAAS,eAAe,UAAU,QAAW,OAAO;AAAA,EACvE;AAUA,QAAM,2BAA2B,CAC/B,QACA,QACA,YACmB;AACnB,WAAO,MAAM,OAAO,SAAS,eAAe,UAAU,OAAO;AAAA,EAC/D;AACA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
1
+ {"version":3,"sources":["../../src/user/user.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 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"],"mappings":"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","names":[]}