@squonk/account-server-client 0.1.26 → 0.1.28

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/{chunk-GWBPVOL2.js → chunk-6EEIAH4R.js} +23 -2
  2. package/chunk-6EEIAH4R.js.map +1 -0
  3. package/chunk-NGBTCJWS.cjs +46 -0
  4. package/chunk-NGBTCJWS.cjs.map +1 -0
  5. package/{account-server-api.schemas-078442c3.d.ts → custom-instance-13412a15.d.ts} +32 -1
  6. package/index.cjs +5 -21
  7. package/index.cjs.map +1 -1
  8. package/index.d.ts +2 -20
  9. package/index.js +5 -21
  10. package/index.js.map +1 -1
  11. package/organisation/organisation.cjs +70 -20
  12. package/organisation/organisation.cjs.map +1 -1
  13. package/organisation/organisation.d.ts +68 -18
  14. package/organisation/organisation.js +70 -20
  15. package/organisation/organisation.js.map +1 -1
  16. package/package.json +1 -1
  17. package/product/product.cjs +121 -31
  18. package/product/product.cjs.map +1 -1
  19. package/product/product.d.ts +115 -24
  20. package/product/product.js +121 -31
  21. package/product/product.js.map +1 -1
  22. package/service/service.cjs +38 -11
  23. package/service/service.cjs.map +1 -1
  24. package/service/service.d.ts +35 -8
  25. package/service/service.js +38 -11
  26. package/service/service.js.map +1 -1
  27. package/src/account-server-api.schemas.ts +13 -0
  28. package/src/organisation/organisation.ts +219 -44
  29. package/src/product/product.ts +375 -84
  30. package/src/service/service.ts +110 -16
  31. package/src/state/state.ts +70 -16
  32. package/src/unit/unit.ts +354 -74
  33. package/src/user/user.ts +368 -67
  34. package/state/state.cjs +22 -8
  35. package/state/state.cjs.map +1 -1
  36. package/state/state.d.ts +18 -6
  37. package/state/state.js +22 -8
  38. package/state/state.js.map +1 -1
  39. package/unit/unit.cjs +110 -30
  40. package/unit/unit.cjs.map +1 -1
  41. package/unit/unit.d.ts +108 -25
  42. package/unit/unit.js +110 -30
  43. package/unit/unit.js.map +1 -1
  44. package/user/user.cjs +107 -30
  45. package/user/user.cjs.map +1 -1
  46. package/user/user.d.ts +133 -20
  47. package/user/user.js +107 -30
  48. package/user/user.js.map +1 -1
  49. package/chunk-GWBPVOL2.js.map +0 -1
  50. package/chunk-N3RLW53G.cjs +0 -25
  51. package/chunk-N3RLW53G.cjs.map +0 -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 _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
+
3
+
4
+ var _chunkNGBTCJWScjs = require('../chunk-NGBTCJWS.cjs');
2
5
 
3
6
  // src/user/user.ts
4
- 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 getUserAccount = (options) => {
12
+ return _chunkNGBTCJWScjs.customInstance.call(void 0, { url: `/user/account`, method: "get" }, options);
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);
19
+ const query = _reactquery.useQuery.call(void 0, queryKey, queryFn, queryOptions);
20
+ return _chunkNGBTCJWScjs.__spreadValues.call(void 0, {
21
+ queryKey
22
+ }, query);
23
+ };
24
+ var getOrganisationUsers = (orgId, options) => {
25
+ return _chunkNGBTCJWScjs.customInstance.call(void 0, { url: `/organisation/${orgId}/user`, method: "get" }, options);
26
+ };
27
+ var getGetOrganisationUsersQueryKey = (orgId) => [
28
+ `/organisation/${orgId}/user`
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, _chunkNGBTCJWScjs.__spreadValues.call(void 0, { enabled: !!orgId }, queryOptions));
35
+ return _chunkNGBTCJWScjs.__spreadValues.call(void 0, {
36
+ queryKey
37
+ }, query);
38
+ };
39
+ var addOrganisationUser = (orgId, userId, options) => {
40
+ return _chunkNGBTCJWScjs.customInstance.call(void 0, { url: `/organisation/${orgId}/user/${userId}`, method: "put" }, options);
41
+ };
42
+ var useAddOrganisationUser = (options) => {
43
+ const { mutation: mutationOptions, request: requestOptions } = options || {};
44
+ const mutationFn = (props) => {
45
+ const { orgId, userId } = props || {};
46
+ return addOrganisationUser(orgId, userId, requestOptions);
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 deleteOrganisationUser = (orgId, userId, options) => {
51
+ return _chunkNGBTCJWScjs.customInstance.call(void 0, { url: `/organisation/${orgId}/user/${userId}`, method: "delete" }, options);
52
+ };
53
+ var useDeleteOrganisationUser = (options) => {
54
+ const { mutation: mutationOptions, request: requestOptions } = options || {};
55
+ const mutationFn = (props) => {
56
+ const { orgId, userId } = props || {};
57
+ return deleteOrganisationUser(orgId, userId, requestOptions);
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 getOrganisationUnitUsers = (unitId, options) => {
62
+ return _chunkNGBTCJWScjs.customInstance.call(void 0, { url: `/unit/${unitId}/user`, method: "get" }, options);
63
+ };
64
+ var getGetOrganisationUnitUsersQueryKey = (unitId) => [
65
+ `/unit/${unitId}/user`
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, _chunkNGBTCJWScjs.__spreadValues.call(void 0, { enabled: !!unitId }, queryOptions));
72
+ return _chunkNGBTCJWScjs.__spreadValues.call(void 0, {
73
+ queryKey
74
+ }, query);
75
+ };
76
+ var addOrganisationUnitUser = (unitId, userId, options) => {
77
+ return _chunkNGBTCJWScjs.customInstance.call(void 0, { url: `/unit/${unitId}/user/${userId}`, method: "put" }, options);
78
+ };
79
+ var useAddOrganisationUnitUser = (options) => {
80
+ const { mutation: mutationOptions, request: requestOptions } = options || {};
81
+ const mutationFn = (props) => {
82
+ const { unitId, userId } = props || {};
83
+ return addOrganisationUnitUser(unitId, userId, requestOptions);
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 deleteOrganisationUnitUser = (unitId, userId, options) => {
88
+ return _chunkNGBTCJWScjs.customInstance.call(void 0, { url: `/unit/${unitId}/user/${userId}`, method: "delete" }, options);
89
+ };
90
+ var useDeleteOrganisationUnitUser = (options) => {
91
+ const { mutation: mutationOptions, request: requestOptions } = options || {};
92
+ const mutationFn = (props) => {
93
+ const { unitId, userId } = props || {};
94
+ return deleteOrganisationUnitUser(unitId, userId, requestOptions);
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.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;
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 {\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 type GetUserAccountQueryResult = NonNullable<\n AsyncReturnType<typeof getUserAccount>\n>;\nexport type GetUserAccountQueryError = ErrorType<void | AsError>;\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 type GetOrganisationUsersQueryResult = NonNullable<\n AsyncReturnType<typeof getOrganisationUsers>\n>;\nexport type GetOrganisationUsersQueryError = ErrorType<AsError | void>;\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 type AddOrganisationUserMutationResult = NonNullable<\n AsyncReturnType<typeof addOrganisationUser>\n>;\n\nexport type AddOrganisationUserMutationError = ErrorType<AsError>;\n\nexport const useAddOrganisationUser = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n 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 type DeleteOrganisationUserMutationResult = NonNullable<\n AsyncReturnType<typeof deleteOrganisationUser>\n>;\n\nexport type DeleteOrganisationUserMutationError = ErrorType<AsError>;\n\nexport const useDeleteOrganisationUser = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n 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 type GetOrganisationUnitUsersQueryResult = NonNullable<\n AsyncReturnType<typeof getOrganisationUnitUsers>\n>;\nexport type GetOrganisationUnitUsersQueryError = ErrorType<AsError | void>;\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 type AddOrganisationUnitUserMutationResult = NonNullable<\n AsyncReturnType<typeof addOrganisationUnitUser>\n>;\n\nexport type AddOrganisationUnitUserMutationError = ErrorType<AsError>;\n\nexport const useAddOrganisationUnitUser = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n 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 type DeleteOrganisationUnitUserMutationResult = NonNullable<\n AsyncReturnType<typeof deleteOrganisationUnitUser>\n>;\n\nexport type DeleteOrganisationUnitUserMutationError = ErrorType<AsError>;\n\nexport const useDeleteOrganisationUnitUser = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n 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"]}
package/user/user.d.ts CHANGED
@@ -1,21 +1,134 @@
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 { V as customInstance, e as UserAccountDetail, W as ErrorType, N as AsError, K as UsersGetResponse } from '../custom-instance-13412a15.js';
4
+ import 'axios';
5
+
6
+ declare type AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (...args: any) => Promise<infer R> ? R : any;
7
+ declare type SecondParameter<T extends (...args: any) => any> = T extends (config: any, args: infer P) => any ? P : never;
8
+ /**
9
+ * Returns a summary of your account
10
+
11
+ * @summary Get information about your account
12
+ */
13
+ declare const getUserAccount: (options?: SecondParameter<typeof customInstance>) => Promise<UserAccountDetail>;
14
+ declare const getGetUserAccountQueryKey: () => string[];
15
+ declare type GetUserAccountQueryResult = NonNullable<AsyncReturnType<typeof getUserAccount>>;
16
+ declare type GetUserAccountQueryError = ErrorType<void | AsError>;
17
+ declare const useGetUserAccount: <TData = UserAccountDetail, TError = ErrorType<void | AsError>>(options?: {
18
+ query?: UseQueryOptions<UserAccountDetail, TError, TData, QueryKey> | undefined;
19
+ request?: SecondParameter<typeof customInstance>;
20
+ } | undefined) => UseQueryResult<TData, TError> & {
21
+ queryKey: QueryKey;
22
+ };
23
+ /**
24
+ * Gets users in an Organisation. You have to be in the Organisation or an Admin user to use this endpoint
25
+
26
+ * @summary Gets users in an organisation
27
+ */
28
+ declare const getOrganisationUsers: (orgId: string, options?: SecondParameter<typeof customInstance>) => Promise<UsersGetResponse>;
29
+ declare const getGetOrganisationUsersQueryKey: (orgId: string) => string[];
30
+ declare type GetOrganisationUsersQueryResult = NonNullable<AsyncReturnType<typeof getOrganisationUsers>>;
31
+ declare type GetOrganisationUsersQueryError = ErrorType<AsError | void>;
32
+ declare const useGetOrganisationUsers: <TData = UsersGetResponse, TError = ErrorType<void | AsError>>(orgId: string, options?: {
33
+ query?: UseQueryOptions<UsersGetResponse, TError, TData, QueryKey> | undefined;
34
+ request?: SecondParameter<typeof customInstance>;
35
+ } | undefined) => UseQueryResult<TData, TError> & {
36
+ queryKey: QueryKey;
37
+ };
38
+ /**
39
+ * Adds a user to an organisation. You have to be in the Organisation or an Admin user to use this endpoint
40
+
41
+ * @summary Adds a user to an organisation
42
+ */
43
+ declare const addOrganisationUser: (orgId: string, userId: string, options?: SecondParameter<typeof customInstance>) => Promise<void>;
44
+ declare type AddOrganisationUserMutationResult = NonNullable<AsyncReturnType<typeof addOrganisationUser>>;
45
+ declare type AddOrganisationUserMutationError = ErrorType<AsError>;
46
+ declare const useAddOrganisationUser: <TError = ErrorType<AsError>, TContext = unknown>(options?: {
47
+ mutation?: UseMutationOptions<void, TError, {
48
+ orgId: string;
49
+ userId: string;
50
+ }, TContext> | undefined;
51
+ request?: SecondParameter<typeof customInstance>;
52
+ } | undefined) => react_query.UseMutationResult<void, TError, {
53
+ orgId: string;
54
+ userId: string;
55
+ }, TContext>;
56
+ /**
57
+ * Removes a user from an organisation. You have to be in the Organisation or an Admin user to use this endpoint
58
+
59
+ * @summary Deletes a user from an organisation
60
+ */
61
+ declare const deleteOrganisationUser: (orgId: string, userId: string, options?: SecondParameter<typeof customInstance>) => Promise<void>;
62
+ declare type DeleteOrganisationUserMutationResult = NonNullable<AsyncReturnType<typeof deleteOrganisationUser>>;
63
+ declare type DeleteOrganisationUserMutationError = ErrorType<AsError>;
64
+ declare const useDeleteOrganisationUser: <TError = ErrorType<AsError>, TContext = unknown>(options?: {
65
+ mutation?: UseMutationOptions<void, TError, {
66
+ orgId: string;
67
+ userId: string;
68
+ }, TContext> | undefined;
69
+ request?: SecondParameter<typeof customInstance>;
70
+ } | undefined) => react_query.UseMutationResult<void, TError, {
71
+ orgId: string;
72
+ userId: string;
73
+ }, TContext>;
74
+ /**
75
+ * Gets users in an Organisational Unit. You have to be in the Organisation or Unit or an Admin user to use this endpoint
76
+
77
+ * @summary Gets users in an Organisational Unit
78
+ */
79
+ declare const getOrganisationUnitUsers: (unitId: string, options?: SecondParameter<typeof customInstance>) => Promise<UsersGetResponse>;
80
+ declare const getGetOrganisationUnitUsersQueryKey: (unitId: string) => string[];
81
+ declare type GetOrganisationUnitUsersQueryResult = NonNullable<AsyncReturnType<typeof getOrganisationUnitUsers>>;
82
+ declare type GetOrganisationUnitUsersQueryError = ErrorType<AsError | void>;
83
+ declare const useGetOrganisationUnitUsers: <TData = UsersGetResponse, TError = ErrorType<void | AsError>>(unitId: string, options?: {
84
+ query?: UseQueryOptions<UsersGetResponse, TError, TData, QueryKey> | undefined;
85
+ request?: SecondParameter<typeof customInstance>;
86
+ } | undefined) => UseQueryResult<TData, TError> & {
87
+ queryKey: QueryKey;
12
88
  };
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 };
89
+ /**
90
+ * Adds a user to an Organisational Unit.
91
+
92
+ Users cannot be added to **Independent Units** (Units that are part of the ***Default** Organisation).
93
+
94
+ You have to be in the Organisation or Unit or an Admin user to use this endpoint
95
+
96
+ * @summary Adds a user to an Organisational Unit
97
+ */
98
+ declare const addOrganisationUnitUser: (unitId: string, userId: string, options?: SecondParameter<typeof customInstance>) => Promise<void>;
99
+ declare type AddOrganisationUnitUserMutationResult = NonNullable<AsyncReturnType<typeof addOrganisationUnitUser>>;
100
+ declare type AddOrganisationUnitUserMutationError = ErrorType<AsError>;
101
+ declare const useAddOrganisationUnitUser: <TError = ErrorType<AsError>, TContext = unknown>(options?: {
102
+ mutation?: UseMutationOptions<void, TError, {
103
+ unitId: string;
104
+ userId: string;
105
+ }, TContext> | undefined;
106
+ request?: SecondParameter<typeof customInstance>;
107
+ } | undefined) => react_query.UseMutationResult<void, TError, {
108
+ unitId: string;
109
+ userId: string;
110
+ }, TContext>;
111
+ /**
112
+ * Removes a user from an Organisational Unit.
113
+
114
+ Users cannot be removed from **Independent Units** (Units that are part of the ***Default** Organisation).
115
+
116
+ You have to be in the Organisation or Unit or an Admin user to use this endpoint
117
+
118
+ * @summary Deletes a user from an Organisational Unit
119
+ */
120
+ declare const deleteOrganisationUnitUser: (unitId: string, userId: string, options?: SecondParameter<typeof customInstance>) => Promise<void>;
121
+ declare type DeleteOrganisationUnitUserMutationResult = NonNullable<AsyncReturnType<typeof deleteOrganisationUnitUser>>;
122
+ declare type DeleteOrganisationUnitUserMutationError = ErrorType<AsError>;
123
+ declare const useDeleteOrganisationUnitUser: <TError = ErrorType<AsError>, TContext = unknown>(options?: {
124
+ mutation?: UseMutationOptions<void, TError, {
125
+ unitId: string;
126
+ userId: string;
127
+ }, TContext> | undefined;
128
+ request?: SecondParameter<typeof customInstance>;
129
+ } | undefined) => react_query.UseMutationResult<void, TError, {
130
+ unitId: string;
131
+ userId: string;
132
+ }, TContext>;
133
+
134
+ export { AddOrganisationUnitUserMutationError, AddOrganisationUnitUserMutationResult, AddOrganisationUserMutationError, AddOrganisationUserMutationResult, DeleteOrganisationUnitUserMutationError, DeleteOrganisationUnitUserMutationResult, DeleteOrganisationUserMutationError, DeleteOrganisationUserMutationResult, GetOrganisationUnitUsersQueryError, GetOrganisationUnitUsersQueryResult, GetOrganisationUsersQueryError, GetOrganisationUsersQueryResult, GetUserAccountQueryError, GetUserAccountQueryResult, addOrganisationUnitUser, addOrganisationUser, deleteOrganisationUnitUser, deleteOrganisationUser, getGetOrganisationUnitUsersQueryKey, getGetOrganisationUsersQueryKey, getGetUserAccountQueryKey, getOrganisationUnitUsers, getOrganisationUsers, getUserAccount, useAddOrganisationUnitUser, useAddOrganisationUser, useDeleteOrganisationUnitUser, useDeleteOrganisationUser, useGetOrganisationUnitUsers, useGetOrganisationUsers, useGetUserAccount };
package/user/user.js CHANGED
@@ -1,40 +1,117 @@
1
- import "../chunk-GWBPVOL2.js";
1
+ import {
2
+ __spreadValues,
3
+ customInstance
4
+ } from "../chunk-6EEIAH4R.js";
2
5
 
3
6
  // src/user/user.ts
4
- 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 getUserAccount = (options) => {
12
+ return customInstance({ url: `/user/account`, method: "get" }, options);
13
+ };
14
+ var getGetUserAccountQueryKey = () => [`/user/account`];
15
+ var useGetUserAccount = (options) => {
16
+ const { query: queryOptions, request: requestOptions } = options || {};
17
+ const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetUserAccountQueryKey();
18
+ const queryFn = () => getUserAccount(requestOptions);
19
+ const query = useQuery(queryKey, queryFn, queryOptions);
20
+ return __spreadValues({
21
+ queryKey
22
+ }, query);
23
+ };
24
+ var getOrganisationUsers = (orgId, options) => {
25
+ return customInstance({ url: `/organisation/${orgId}/user`, method: "get" }, options);
26
+ };
27
+ var getGetOrganisationUsersQueryKey = (orgId) => [
28
+ `/organisation/${orgId}/user`
29
+ ];
30
+ var useGetOrganisationUsers = (orgId, options) => {
31
+ const { query: queryOptions, request: requestOptions } = options || {};
32
+ const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetOrganisationUsersQueryKey(orgId);
33
+ const queryFn = () => getOrganisationUsers(orgId, requestOptions);
34
+ const query = useQuery(queryKey, queryFn, __spreadValues({ enabled: !!orgId }, queryOptions));
35
+ return __spreadValues({
36
+ queryKey
37
+ }, query);
38
+ };
39
+ var addOrganisationUser = (orgId, userId, options) => {
40
+ return customInstance({ url: `/organisation/${orgId}/user/${userId}`, method: "put" }, options);
41
+ };
42
+ var useAddOrganisationUser = (options) => {
43
+ const { mutation: mutationOptions, request: requestOptions } = options || {};
44
+ const mutationFn = (props) => {
45
+ const { orgId, userId } = props || {};
46
+ return addOrganisationUser(orgId, userId, requestOptions);
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 deleteOrganisationUser = (orgId, userId, options) => {
51
+ return customInstance({ url: `/organisation/${orgId}/user/${userId}`, method: "delete" }, options);
52
+ };
53
+ var useDeleteOrganisationUser = (options) => {
54
+ const { mutation: mutationOptions, request: requestOptions } = options || {};
55
+ const mutationFn = (props) => {
56
+ const { orgId, userId } = props || {};
57
+ return deleteOrganisationUser(orgId, userId, requestOptions);
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 getOrganisationUnitUsers = (unitId, options) => {
62
+ return customInstance({ url: `/unit/${unitId}/user`, method: "get" }, options);
63
+ };
64
+ var getGetOrganisationUnitUsersQueryKey = (unitId) => [
65
+ `/unit/${unitId}/user`
66
+ ];
67
+ var useGetOrganisationUnitUsers = (unitId, options) => {
68
+ const { query: queryOptions, request: requestOptions } = options || {};
69
+ const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetOrganisationUnitUsersQueryKey(unitId);
70
+ const queryFn = () => getOrganisationUnitUsers(unitId, requestOptions);
71
+ const query = useQuery(queryKey, queryFn, __spreadValues({ enabled: !!unitId }, queryOptions));
72
+ return __spreadValues({
73
+ queryKey
74
+ }, query);
75
+ };
76
+ var addOrganisationUnitUser = (unitId, userId, options) => {
77
+ return customInstance({ url: `/unit/${unitId}/user/${userId}`, method: "put" }, options);
78
+ };
79
+ var useAddOrganisationUnitUser = (options) => {
80
+ const { mutation: mutationOptions, request: requestOptions } = options || {};
81
+ const mutationFn = (props) => {
82
+ const { unitId, userId } = props || {};
83
+ return addOrganisationUnitUser(unitId, userId, requestOptions);
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 deleteOrganisationUnitUser = (unitId, userId, options) => {
88
+ return customInstance({ url: `/unit/${unitId}/user/${userId}`, method: "delete" }, options);
89
+ };
90
+ var useDeleteOrganisationUnitUser = (options) => {
91
+ const { mutation: mutationOptions, request: requestOptions } = options || {};
92
+ const mutationFn = (props) => {
93
+ const { unitId, userId } = props || {};
94
+ return deleteOrganisationUnitUser(unitId, userId, requestOptions);
35
95
  };
96
+ return useMutation(mutationFn, mutationOptions);
36
97
  };
37
98
  export {
38
- getUser
99
+ addOrganisationUnitUser,
100
+ addOrganisationUser,
101
+ deleteOrganisationUnitUser,
102
+ deleteOrganisationUser,
103
+ getGetOrganisationUnitUsersQueryKey,
104
+ getGetOrganisationUsersQueryKey,
105
+ getGetUserAccountQueryKey,
106
+ getOrganisationUnitUsers,
107
+ getOrganisationUsers,
108
+ getUserAccount,
109
+ useAddOrganisationUnitUser,
110
+ useAddOrganisationUser,
111
+ useDeleteOrganisationUnitUser,
112
+ useDeleteOrganisationUser,
113
+ useGetOrganisationUnitUsers,
114
+ useGetOrganisationUsers,
115
+ useGetUserAccount
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 {\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 type GetUserAccountQueryResult = NonNullable<\n AsyncReturnType<typeof getUserAccount>\n>;\nexport type GetUserAccountQueryError = ErrorType<void | AsError>;\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 type GetOrganisationUsersQueryResult = NonNullable<\n AsyncReturnType<typeof getOrganisationUsers>\n>;\nexport type GetOrganisationUsersQueryError = ErrorType<AsError | void>;\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 type AddOrganisationUserMutationResult = NonNullable<\n AsyncReturnType<typeof addOrganisationUser>\n>;\n\nexport type AddOrganisationUserMutationError = ErrorType<AsError>;\n\nexport const useAddOrganisationUser = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n 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 type DeleteOrganisationUserMutationResult = NonNullable<\n AsyncReturnType<typeof deleteOrganisationUser>\n>;\n\nexport type DeleteOrganisationUserMutationError = ErrorType<AsError>;\n\nexport const useDeleteOrganisationUser = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n 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 type GetOrganisationUnitUsersQueryResult = NonNullable<\n AsyncReturnType<typeof getOrganisationUnitUsers>\n>;\nexport type GetOrganisationUnitUsersQueryError = ErrorType<AsError | void>;\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 type AddOrganisationUnitUserMutationResult = NonNullable<\n AsyncReturnType<typeof addOrganisationUnitUser>\n>;\n\nexport type AddOrganisationUnitUserMutationError = ErrorType<AsError>;\n\nexport const useAddOrganisationUnitUser = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n 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 type DeleteOrganisationUnitUserMutationResult = NonNullable<\n AsyncReturnType<typeof deleteOrganisationUnitUser>\n>;\n\nexport type DeleteOrganisationUnitUserMutationError = ErrorType<AsError>;\n\nexport const useDeleteOrganisationUnitUser = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n 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"],"mappings":";;;;;;AAUA;AAAA;AAAA;AAAA;AAqCO,IAAM,iBAAiB,CAC5B,YACG;AACH,SAAO,eACL,EAAE,KAAK,iBAAiB,QAAQ,MAAM,GACtC,OACF;AACF;AAEO,IAAM,4BAA4B,MAAM,CAAC,eAAe;AAOxD,IAAM,oBAAoB,CAG/B,YAO4D;AAC5D,QAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,CAAC;AAErE,QAAM,WAAW,8CAAc,aAAY,0BAA0B;AAErE,QAAM,UAAiE,MACrE,eAAe,cAAc;AAE/B,QAAM,QAAQ,SACZ,UACA,SACA,YACF;AAEA,SAAO;AAAA,IACL;AAAA,KACG;AAEP;AAOO,IAAM,uBAAuB,CAClC,OACA,YACG;AACH,SAAO,eACL,EAAE,KAAK,iBAAiB,cAAc,QAAQ,MAAM,GACpD,OACF;AACF;AAEO,IAAM,kCAAkC,CAAC,UAAkB;AAAA,EAChE,iBAAiB;AACnB;AAOO,IAAM,0BAA0B,CAIrC,OACA,YAQ2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,CAAC;AAErE,QAAM,WACJ,8CAAc,aAAY,gCAAgC,KAAK;AAEjE,QAAM,UAEF,MAAM,qBAAqB,OAAO,cAAc;AAEpD,QAAM,QAAQ,SAIZ,UAAU,SAAS,iBAAE,SAAS,CAAC,CAAC,SAAU,aAAc;AAE1D,SAAO;AAAA,IACL;AAAA,KACG;AAEP;AAOO,IAAM,sBAAsB,CACjC,OACA,QACA,YACG;AACH,SAAO,eACL,EAAE,KAAK,iBAAiB,cAAc,UAAU,QAAQ,MAAM,GAC9D,OACF;AACF;AAQO,IAAM,yBAAyB,CAGpC,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,OAAO,WAAW,SAAS,CAAC;AAEpC,WAAO,oBAAoB,OAAO,QAAQ,cAAc;AAAA,EAC1D;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B;AAMO,IAAM,yBAAyB,CACpC,OACA,QACA,YACG;AACH,SAAO,eACL,EAAE,KAAK,iBAAiB,cAAc,UAAU,QAAQ,SAAS,GACjE,OACF;AACF;AAQO,IAAM,4BAA4B,CAGvC,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,OAAO,WAAW,SAAS,CAAC;AAEpC,WAAO,uBAAuB,OAAO,QAAQ,cAAc;AAAA,EAC7D;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B;AAMO,IAAM,2BAA2B,CACtC,QACA,YACG;AACH,SAAO,eACL,EAAE,KAAK,SAAS,eAAe,QAAQ,MAAM,GAC7C,OACF;AACF;AAEO,IAAM,sCAAsC,CAAC,WAAmB;AAAA,EACrE,SAAS;AACX;AAOO,IAAM,8BAA8B,CAIzC,QACA,YAQ2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,CAAC;AAErE,QAAM,WACJ,8CAAc,aAAY,oCAAoC,MAAM;AAEtE,QAAM,UAEF,MAAM,yBAAyB,QAAQ,cAAc;AAEzD,QAAM,QAAQ,SAIZ,UAAU,SAAS,iBAAE,SAAS,CAAC,CAAC,UAAW,aAAc;AAE3D,SAAO;AAAA,IACL;AAAA,KACG;AAEP;AAWO,IAAM,0BAA0B,CACrC,QACA,QACA,YACG;AACH,SAAO,eACL,EAAE,KAAK,SAAS,eAAe,UAAU,QAAQ,MAAM,GACvD,OACF;AACF;AAQO,IAAM,6BAA6B,CAGxC,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,QAAQ,WAAW,SAAS,CAAC;AAErC,WAAO,wBAAwB,QAAQ,QAAQ,cAAc;AAAA,EAC/D;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B;AAUO,IAAM,6BAA6B,CACxC,QACA,QACA,YACG;AACH,SAAO,eACL,EAAE,KAAK,SAAS,eAAe,UAAU,QAAQ,SAAS,GAC1D,OACF;AACF;AAQO,IAAM,gCAAgC,CAG3C,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,QAAQ,WAAW,SAAS,CAAC;AAErC,WAAO,2BAA2B,QAAQ,QAAQ,cAAc;AAAA,EAClE;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,25 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var __defProp = Object.defineProperty;
2
- var __defProps = Object.defineProperties;
3
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __spreadValues = (a, b) => {
9
- for (var prop in b || (b = {}))
10
- if (__hasOwnProp.call(b, prop))
11
- __defNormalProp(a, prop, b[prop]);
12
- if (__getOwnPropSymbols)
13
- for (var prop of __getOwnPropSymbols(b)) {
14
- if (__propIsEnum.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
16
- }
17
- return a;
18
- };
19
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
-
21
-
22
-
23
-
24
- exports.__spreadValues = __spreadValues; exports.__spreadProps = __spreadProps;
25
- //# sourceMappingURL=chunk-N3RLW53G.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}