@squonk/account-server-client 0.1.23-rc.2 → 0.1.26-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.
- package/{custom-instance-86dd5ce6.d.ts → account-server-api.schemas-078442c3.d.ts} +4 -22
- package/{chunk-JR7F532L.js → chunk-GWBPVOL2.js} +2 -23
- package/chunk-GWBPVOL2.js.map +1 -0
- package/chunk-N3RLW53G.cjs +25 -0
- package/chunk-N3RLW53G.cjs.map +1 -0
- package/index.cjs +21 -5
- package/index.cjs.map +1 -1
- package/index.d.ts +20 -2
- package/index.js +21 -5
- package/index.js.map +1 -1
- package/organisation/organisation.cjs +20 -65
- package/organisation/organisation.cjs.map +1 -1
- package/organisation/organisation.d.ts +18 -58
- package/organisation/organisation.js +20 -65
- package/organisation/organisation.js.map +1 -1
- package/package.json +14 -14
- package/product/product.cjs +32 -107
- package/product/product.cjs.map +1 -1
- package/product/product.d.ts +24 -84
- package/product/product.js +32 -107
- package/product/product.js.map +1 -1
- package/service/service.cjs +11 -38
- package/service/service.cjs.map +1 -1
- package/service/service.d.ts +9 -31
- package/service/service.js +11 -38
- package/service/service.js.map +1 -1
- package/src/account-server-api.schemas.ts +3 -3
- package/src/organisation/organisation.ts +43 -191
- package/src/product/product.ts +87 -294
- package/src/service/service.ts +17 -101
- package/src/state/state.ts +17 -66
- package/src/unit/unit.ts +71 -315
- package/src/user/user.ts +68 -330
- package/state/state.cjs +8 -22
- package/state/state.cjs.map +1 -1
- package/state/state.d.ts +7 -16
- package/state/state.js +8 -22
- package/state/state.js.map +1 -1
- package/unit/unit.cjs +30 -109
- package/unit/unit.cjs.map +1 -1
- package/unit/unit.d.ts +25 -92
- package/unit/unit.js +30 -109
- package/unit/unit.js.map +1 -1
- package/user/user.cjs +30 -107
- package/user/user.cjs.map +1 -1
- package/user/user.d.ts +20 -118
- package/user/user.js +30 -107
- package/user/user.js.map +1 -1
- package/chunk-3DXYUDZH.cjs +0 -46
- package/chunk-3DXYUDZH.cjs.map +0 -1
- package/chunk-JR7F532L.js.map +0 -1
package/unit/unit.cjs
CHANGED
|
@@ -1,119 +1,40 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var _chunk3DXYUDZHcjs = require('../chunk-3DXYUDZH.cjs');
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }require('../chunk-N3RLW53G.cjs');
|
|
5
2
|
|
|
6
3
|
// src/unit/unit.ts
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var getOrganisationUnits = (orgid, options) => {
|
|
12
|
-
return _chunk3DXYUDZHcjs.customInstance.call(void 0, { url: `/organisation/${orgid}/unit`, method: "get" }, options);
|
|
13
|
-
};
|
|
14
|
-
var getGetOrganisationUnitsQueryKey = (orgid) => [
|
|
15
|
-
`/organisation/${orgid}/unit`
|
|
16
|
-
];
|
|
17
|
-
var useGetOrganisationUnits = (orgid, options) => {
|
|
18
|
-
const { query: queryOptions, request: requestOptions } = options || {};
|
|
19
|
-
const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetOrganisationUnitsQueryKey(orgid)));
|
|
20
|
-
const queryFn = () => getOrganisationUnits(orgid, requestOptions);
|
|
21
|
-
const query = _reactquery.useQuery.call(void 0, queryKey, queryFn, _chunk3DXYUDZHcjs.__spreadValues.call(void 0, { enabled: !!orgid }, queryOptions));
|
|
22
|
-
return _chunk3DXYUDZHcjs.__spreadValues.call(void 0, {
|
|
23
|
-
queryKey
|
|
24
|
-
}, query);
|
|
25
|
-
};
|
|
26
|
-
var createOrganisationUnit = (orgid, organisationUnitPostBodyBody, options) => {
|
|
27
|
-
return _chunk3DXYUDZHcjs.customInstance.call(void 0, {
|
|
28
|
-
url: `/organisation/${orgid}/unit`,
|
|
29
|
-
method: "post",
|
|
30
|
-
data: organisationUnitPostBodyBody
|
|
31
|
-
}, options);
|
|
32
|
-
};
|
|
33
|
-
var useCreateOrganisationUnit = (options) => {
|
|
34
|
-
const { mutation: mutationOptions, request: requestOptions } = options || {};
|
|
35
|
-
const mutationFn = (props) => {
|
|
36
|
-
const { orgid, data } = props || {};
|
|
37
|
-
return createOrganisationUnit(orgid, data, requestOptions);
|
|
4
|
+
var _axios = require('axios'); var _axios2 = _interopRequireDefault(_axios);
|
|
5
|
+
var getUnit = () => {
|
|
6
|
+
const appApiUnitGetOrgUnits = (orgId, options) => {
|
|
7
|
+
return _axios2.default.get(`/organisation/${orgId}/unit`, options);
|
|
38
8
|
};
|
|
39
|
-
|
|
40
|
-
};
|
|
41
|
-
var getUnit = (orgid, unitid, options) => {
|
|
42
|
-
return _chunk3DXYUDZHcjs.customInstance.call(void 0, { url: `/organisation/${orgid}/unit/${unitid}`, method: "get" }, options);
|
|
43
|
-
};
|
|
44
|
-
var getGetUnitQueryKey = (orgid, unitid) => [
|
|
45
|
-
`/organisation/${orgid}/unit/${unitid}`
|
|
46
|
-
];
|
|
47
|
-
var useGetUnit = (orgid, unitid, options) => {
|
|
48
|
-
const { query: queryOptions, request: requestOptions } = options || {};
|
|
49
|
-
const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetUnitQueryKey(orgid, unitid)));
|
|
50
|
-
const queryFn = () => getUnit(orgid, unitid, requestOptions);
|
|
51
|
-
const query = _reactquery.useQuery.call(void 0, queryKey, queryFn, _chunk3DXYUDZHcjs.__spreadValues.call(void 0, { enabled: !!(orgid && unitid) }, queryOptions));
|
|
52
|
-
return _chunk3DXYUDZHcjs.__spreadValues.call(void 0, {
|
|
53
|
-
queryKey
|
|
54
|
-
}, query);
|
|
55
|
-
};
|
|
56
|
-
var deleteOrganisationUnit = (orgid, unitid, options) => {
|
|
57
|
-
return _chunk3DXYUDZHcjs.customInstance.call(void 0, { url: `/organisation/${orgid}/unit/${unitid}`, method: "delete" }, options);
|
|
58
|
-
};
|
|
59
|
-
var useDeleteOrganisationUnit = (options) => {
|
|
60
|
-
const { mutation: mutationOptions, request: requestOptions } = options || {};
|
|
61
|
-
const mutationFn = (props) => {
|
|
62
|
-
const { orgid, unitid } = props || {};
|
|
63
|
-
return deleteOrganisationUnit(orgid, unitid, requestOptions);
|
|
9
|
+
const appApiUnitPost = (orgId, organisationUnitPostBodyBody, options) => {
|
|
10
|
+
return _axios2.default.post(`/organisation/${orgId}/unit`, organisationUnitPostBodyBody, options);
|
|
64
11
|
};
|
|
65
|
-
|
|
66
|
-
};
|
|
67
|
-
var getUnits = (options) => {
|
|
68
|
-
return _chunk3DXYUDZHcjs.customInstance.call(void 0, { url: `/unit`, method: "get" }, options);
|
|
69
|
-
};
|
|
70
|
-
var getGetUnitsQueryKey = () => [`/unit`];
|
|
71
|
-
var useGetUnits = (options) => {
|
|
72
|
-
const { query: queryOptions, request: requestOptions } = options || {};
|
|
73
|
-
const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetUnitsQueryKey()));
|
|
74
|
-
const queryFn = () => getUnits(requestOptions);
|
|
75
|
-
const query = _reactquery.useQuery.call(void 0, queryKey, queryFn, queryOptions);
|
|
76
|
-
return _chunk3DXYUDZHcjs.__spreadValues.call(void 0, {
|
|
77
|
-
queryKey
|
|
78
|
-
}, query);
|
|
79
|
-
};
|
|
80
|
-
var createDefaultUnit = (options) => {
|
|
81
|
-
return _chunk3DXYUDZHcjs.customInstance.call(void 0, { url: `/unit`, method: "put" }, options);
|
|
82
|
-
};
|
|
83
|
-
var useCreateDefaultUnit = (options) => {
|
|
84
|
-
const { mutation: mutationOptions, request: requestOptions } = options || {};
|
|
85
|
-
const mutationFn = () => {
|
|
86
|
-
return createDefaultUnit(requestOptions);
|
|
12
|
+
const appApiUnitGetUnit = (orgId, unitId, options) => {
|
|
13
|
+
return _axios2.default.get(`/organisation/${orgId}/unit/${unitId}`, options);
|
|
87
14
|
};
|
|
88
|
-
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
|
|
15
|
+
const appApiUnitDelete = (orgId, unitId, options) => {
|
|
16
|
+
return _axios2.default.delete(`/organisation/${orgId}/unit/${unitId}`, options);
|
|
17
|
+
};
|
|
18
|
+
const appApiUnitGet = (options) => {
|
|
19
|
+
return _axios2.default.get(`/unit`, options);
|
|
20
|
+
};
|
|
21
|
+
const appApiUnitPersonalPut = (options) => {
|
|
22
|
+
return _axios2.default.put(`/unit`, void 0, options);
|
|
23
|
+
};
|
|
24
|
+
const appApiUnitPersonalDelete = (options) => {
|
|
25
|
+
return _axios2.default.delete(`/unit`, options);
|
|
26
|
+
};
|
|
27
|
+
return {
|
|
28
|
+
appApiUnitGetOrgUnits,
|
|
29
|
+
appApiUnitPost,
|
|
30
|
+
appApiUnitGetUnit,
|
|
31
|
+
appApiUnitDelete,
|
|
32
|
+
appApiUnitGet,
|
|
33
|
+
appApiUnitPersonalPut,
|
|
34
|
+
appApiUnitPersonalDelete
|
|
97
35
|
};
|
|
98
|
-
return _reactquery.useMutation.call(void 0, mutationFn, mutationOptions);
|
|
99
36
|
};
|
|
100
37
|
|
|
101
38
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
exports.createDefaultUnit = createDefaultUnit; exports.createOrganisationUnit = createOrganisationUnit; exports.deleteDefaultUnit = deleteDefaultUnit; exports.deleteOrganisationUnit = deleteOrganisationUnit; exports.getGetOrganisationUnitsQueryKey = getGetOrganisationUnitsQueryKey; exports.getGetUnitQueryKey = getGetUnitQueryKey; exports.getGetUnitsQueryKey = getGetUnitsQueryKey; exports.getOrganisationUnits = getOrganisationUnits; exports.getUnit = getUnit; exports.getUnits = getUnits; exports.useCreateDefaultUnit = useCreateDefaultUnit; exports.useCreateOrganisationUnit = useCreateOrganisationUnit; exports.useDeleteDefaultUnit = useDeleteDefaultUnit; exports.useDeleteOrganisationUnit = useDeleteOrganisationUnit; exports.useGetOrganisationUnits = useGetOrganisationUnits; exports.useGetUnit = useGetUnit; exports.useGetUnits = useGetUnits;
|
|
39
|
+
exports.getUnit = getUnit;
|
|
119
40
|
//# sourceMappingURL=unit.cjs.map
|
package/unit/unit.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/unit/unit.ts"],"names":[],"mappings":";;;;;;AAUA;AAAA;AAAA;AAAA;AAyCO,IAAM,uBAAuB,CAClC,OACA,YACG;AACH,SAAO,eACL,EAAE,KAAK,iBAAiB,cAAc,QAAQ,SAC9C;AAAA;AAIG,IAAM,kCAAkC,CAAC,UAAkB;AAAA,EAChE,iBAAiB;AAAA;AAGZ,IAAM,0BAA0B,CAIrC,OACA,YAQ2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW;AAEpE,QAAM,WACJ,8CAAc,aAAY,gCAAgC;AAE5D,QAAM,UAEF,MAAM,qBAAqB,OAAO;AAEtC,QAAM,QAAQ,SAIZ,UAAU,SAAS,iBAAE,SAAS,CAAC,CAAC,SAAU;AAE5C,SAAO;AAAA,IACL;AAAA,KACG;AAAA;AASA,IAAM,yBAAyB,CACpC,OACA,8BACA,YACG;AACH,SAAO,eACL;AAAA,IACE,KAAK,iBAAiB;AAAA,IACtB,QAAQ;AAAA,IACR,MAAM;AAAA,KAER;AAAA;AAIG,IAAM,4BAA4B,CAGvC,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW;AAE1E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,OAAO,SAAS,SAAS;AAEjC,WAAO,uBAAuB,OAAO,MAAM;AAAA;AAG7C,SAAO,YAKL,YAAY;AAAA;AAOT,IAAM,UAAU,CACrB,OACA,QACA,YACG;AACH,SAAO,eACL,EAAE,KAAK,iBAAiB,cAAc,UAAU,QAAQ,SACxD;AAAA;AAIG,IAAM,qBAAqB,CAAC,OAAe,WAAmB;AAAA,EACnE,iBAAiB,cAAc;AAAA;AAG1B,IAAM,aAAa,CAIxB,OACA,QACA,YAI2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW;AAEpE,QAAM,WAAW,8CAAc,aAAY,mBAAmB,OAAO;AAErE,QAAM,UAA0D,MAC9D,QAAQ,OAAO,QAAQ;AAEzB,QAAM,QAAQ,SACZ,UACA,SACA,iBAAE,SAAS,CAAC,CAAE,UAAS,WAAY;AAGrC,SAAO;AAAA,IACL;AAAA,KACG;AAAA;AASA,IAAM,yBAAyB,CACpC,OACA,QACA,YACG;AACH,SAAO,eACL,EAAE,KAAK,iBAAiB,cAAc,UAAU,QAAQ,YACxD;AAAA;AAIG,IAAM,4BAA4B,CAGvC,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW;AAE1E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,OAAO,WAAW,SAAS;AAEnC,WAAO,uBAAuB,OAAO,QAAQ;AAAA;AAG/C,SAAO,YAKL,YAAY;AAAA;AAOT,IAAM,WAAW,CAAC,YAAqD;AAC5E,SAAO,eACL,EAAE,KAAK,SAAS,QAAQ,SACxB;AAAA;AAIG,IAAM,sBAAsB,MAAM,CAAC;AAEnC,IAAM,cAAc,CAGzB,YAG4D;AAC5D,QAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW;AAEpE,QAAM,WAAW,8CAAc,aAAY;AAE3C,QAAM,UAA2D,MAC/D,SAAS;AAEX,QAAM,QAAQ,SACZ,UACA,SACA;AAGF,SAAO;AAAA,IACL;AAAA,KACG;AAAA;AASA,IAAM,oBAAoB,CAC/B,YACG;AACH,SAAO,eACL,EAAE,KAAK,SAAS,QAAQ,SACxB;AAAA;AAIG,IAAM,uBAAuB,CAIlC,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW;AAE1E,QAAM,aAGF,MAAM;AACR,WAAO,kBAAkB;AAAA;AAG3B,SAAO,YAKL,YAAY;AAAA;AAOT,IAAM,oBAAoB,CAC/B,YACG;AACH,SAAO,eAAqB,EAAE,KAAK,SAAS,QAAQ,YAAY;AAAA;AAG3D,IAAM,uBAAuB,CAIlC,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW;AAE1E,QAAM,aAGF,MAAM;AACR,WAAO,kBAAkB;AAAA;AAG3B,SAAO,YAKL,YAAY;AAAA","sourcesContent":["/**\n * Generated by orval v6.6.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Products**, **Organisations**, **Units** and **Users**.\n\n * OpenAPI spec version: 0.1\n */\nimport {\n useQuery,\n useMutation,\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"react-query\";\nimport type {\n OrganisationUnitsGetResponse,\n AsError,\n OrganisationUnitPostResponse,\n OrganisationUnitPostBodyBody,\n UnitGetResponse,\n UnitsGetResponse,\n PersonalUnitPutResponse,\n} from \"../account-server-api.schemas\";\nimport { customInstance, ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (\n ...args: any\n) => Promise<infer R>\n ? R\n : any;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * Gets Organisational Units you have access to\n\n * @summary Gets Organisational Units\n */\nexport const getOrganisationUnits = (\n orgid: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<OrganisationUnitsGetResponse>(\n { url: `/organisation/${orgid}/unit`, method: \"get\" },\n options\n );\n};\n\nexport const getGetOrganisationUnitsQueryKey = (orgid: string) => [\n `/organisation/${orgid}/unit`,\n];\n\nexport const useGetOrganisationUnits = <\n TData = AsyncReturnType<typeof getOrganisationUnits>,\n TError = ErrorType<void | AsError>\n>(\n orgid: string,\n options?: {\n query?: UseQueryOptions<\n AsyncReturnType<typeof getOrganisationUnits>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetOrganisationUnitsQueryKey(orgid);\n\n const queryFn: QueryFunction<\n AsyncReturnType<typeof getOrganisationUnits>\n > = () => getOrganisationUnits(orgid, requestOptions);\n\n const query = useQuery<\n AsyncReturnType<typeof getOrganisationUnits>,\n TError,\n TData\n >(queryKey, queryFn, { enabled: !!orgid, ...queryOptions });\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Creates a new organisation unit. You need to be in the Organisation or an Admin user to use this endpoint\n\n * @summary Create a new Organisational Unit\n */\nexport const createOrganisationUnit = (\n orgid: string,\n organisationUnitPostBodyBody: OrganisationUnitPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<OrganisationUnitPostResponse>(\n {\n url: `/organisation/${orgid}/unit`,\n method: \"post\",\n data: organisationUnitPostBodyBody,\n },\n options\n );\n};\n\nexport const useCreateOrganisationUnit = <\n TError = ErrorType<AsError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof createOrganisationUnit>,\n TError,\n { orgid: string; data: OrganisationUnitPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof createOrganisationUnit>,\n { orgid: string; data: OrganisationUnitPostBodyBody }\n > = (props) => {\n const { orgid, data } = props || {};\n\n return createOrganisationUnit(orgid, data, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof createOrganisationUnit>,\n TError,\n { orgid: string; data: OrganisationUnitPostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets the Unit, assuming you are a member of it. Admin users can see all Units\n\n * @summary Gets a Unit\n */\nexport const getUnit = (\n orgid: string,\n unitid: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<UnitGetResponse>(\n { url: `/organisation/${orgid}/unit/${unitid}`, method: \"get\" },\n options\n );\n};\n\nexport const getGetUnitQueryKey = (orgid: string, unitid: string) => [\n `/organisation/${orgid}/unit/${unitid}`,\n];\n\nexport const useGetUnit = <\n TData = AsyncReturnType<typeof getUnit>,\n TError = ErrorType<void | AsError>\n>(\n orgid: string,\n unitid: string,\n options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof getUnit>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUnitQueryKey(orgid, unitid);\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getUnit>> = () =>\n getUnit(orgid, unitid, requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getUnit>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!(orgid && unitid), ...queryOptions }\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Deletes an Organisational Unit you have access to. Units can only be deleted by Organisation users or Admin users. You cannot delete a Unit that contains Products\n\n * @summary Deletes an Organisational Unit\n */\nexport const deleteOrganisationUnit = (\n orgid: string,\n unitid: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/organisation/${orgid}/unit/${unitid}`, method: \"delete\" },\n options\n );\n};\n\nexport const useDeleteOrganisationUnit = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof deleteOrganisationUnit>,\n TError,\n { orgid: string; unitid: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof deleteOrganisationUnit>,\n { orgid: string; unitid: string }\n > = (props) => {\n const { orgid, unitid } = props || {};\n\n return deleteOrganisationUnit(orgid, unitid, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof deleteOrganisationUnit>,\n TError,\n { orgid: string; unitid: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets all the Units you are a member of. Admin users can see all Units\n\n * @summary Gets Units a User has access to\n */\nexport const getUnits = (options?: SecondParameter<typeof customInstance>) => {\n return customInstance<UnitsGetResponse>(\n { url: `/unit`, method: \"get\" },\n options\n );\n};\n\nexport const getGetUnitsQueryKey = () => [`/unit`];\n\nexport const useGetUnits = <\n TData = AsyncReturnType<typeof getUnits>,\n TError = ErrorType<void | AsError>\n>(options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof getUnits>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUnitsQueryKey();\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getUnits>> = () =>\n getUnits(requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getUnits>, TError, TData>(\n queryKey,\n queryFn,\n queryOptions\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Creates a 'Personal' Unit for a User. The unit will belong to the built-in **Default** Organisation. Users can only have one Personal Unit and Personal Units cannot have other Users\n\n * @summary Create a new Independent User Unit\n */\nexport const createDefaultUnit = (\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<PersonalUnitPutResponse>(\n { url: `/unit`, method: \"put\" },\n options\n );\n};\n\nexport const useCreateDefaultUnit = <\n TError = ErrorType<AsError | void>,\n TVariables = void,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof createDefaultUnit>,\n TError,\n TVariables,\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof createDefaultUnit>,\n TVariables\n > = () => {\n return createDefaultUnit(requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof createDefaultUnit>,\n TError,\n TVariables,\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Deletes a 'Personal' Unit. It must be your Unit, which belongs to the Default Organisation\n\n * @summary Deletes an Independent Unit\n */\nexport const deleteDefaultUnit = (\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>({ url: `/unit`, method: \"delete\" }, options);\n};\n\nexport const useDeleteDefaultUnit = <\n TError = ErrorType<AsError>,\n TVariables = void,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof deleteDefaultUnit>,\n TError,\n TVariables,\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof deleteDefaultUnit>,\n TVariables\n > = () => {\n return deleteDefaultUnit(requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof deleteDefaultUnit>,\n TError,\n TVariables,\n TContext\n >(mutationFn, mutationOptions);\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/unit/unit.ts"],"names":[],"mappings":";;;AAUA;AAUO,IAAM,UAAU,MAAM;AAM3B,QAAM,wBAAwB,CAG5B,OACA,YACmB;AACnB,WAAO,MAAM,IAAI,iBAAiB,cAAc,OAAO;AAAA,EACzD;AAMA,QAAM,iBAAiB,CACrB,OACA,8BACA,YACmB;AACnB,WAAO,MAAM,KACX,iBAAiB,cACjB,8BACA,OACF;AAAA,EACF;AAMA,QAAM,oBAAoB,CACxB,OACA,QACA,YACmB;AACnB,WAAO,MAAM,IAAI,iBAAiB,cAAc,UAAU,OAAO;AAAA,EACnE;AAMA,QAAM,mBAAmB,CACvB,OACA,QACA,YACmB;AACnB,WAAO,MAAM,OAAO,iBAAiB,cAAc,UAAU,OAAO;AAAA,EACtE;AAMA,QAAM,gBAAgB,CACpB,YACmB;AACnB,WAAO,MAAM,IAAI,SAAS,OAAO;AAAA,EACnC;AAMA,QAAM,wBAAwB,CAG5B,YACmB;AACnB,WAAO,MAAM,IAAI,SAAS,QAAW,OAAO;AAAA,EAC9C;AAMA,QAAM,2BAA2B,CAC/B,YACmB;AACnB,WAAO,MAAM,OAAO,SAAS,OAAO;AAAA,EACtC;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 OrganisationUnitsGetResponse,\n OrganisationUnitPostResponse,\n OrganisationUnitPostBodyBody,\n UnitGetResponse,\n UnitsGetResponse,\n PersonalUnitPutResponse,\n} from \"../account-server-api.schemas\";\n\nexport const getUnit = () => {\n /**\n * Gets Organisational Units you have access to\n\n * @summary Gets Organisational Units\n */\n const appApiUnitGetOrgUnits = <\n TData = AxiosResponse<OrganisationUnitsGetResponse>\n >(\n orgId: string,\n options?: AxiosRequestConfig\n ): Promise<TData> => {\n return axios.get(`/organisation/${orgId}/unit`, options);\n };\n /**\n * Creates a new organisation unit. You need to be in the Organisation or an Admin user to use this endpoint\n\n * @summary Create a new Organisational Unit\n */\n const appApiUnitPost = <TData = AxiosResponse<OrganisationUnitPostResponse>>(\n orgId: string,\n organisationUnitPostBodyBody: OrganisationUnitPostBodyBody,\n options?: AxiosRequestConfig\n ): Promise<TData> => {\n return axios.post(\n `/organisation/${orgId}/unit`,\n organisationUnitPostBodyBody,\n options\n );\n };\n /**\n * Gets the Unit, assuming you are a member of it. Admin users can see all Units\n\n * @summary Gets a Unit\n */\n const appApiUnitGetUnit = <TData = AxiosResponse<UnitGetResponse>>(\n orgId: string,\n unitId: string,\n options?: AxiosRequestConfig\n ): Promise<TData> => {\n return axios.get(`/organisation/${orgId}/unit/${unitId}`, options);\n };\n /**\n * Deletes an Organisational Unit you have access to. Units can only be deleted by Organisation users or Admin users. You cannot delete a Unit that contains Products\n\n * @summary Deletes an Organisational Unit\n */\n const appApiUnitDelete = <TData = AxiosResponse<void>>(\n orgId: string,\n unitId: string,\n options?: AxiosRequestConfig\n ): Promise<TData> => {\n return axios.delete(`/organisation/${orgId}/unit/${unitId}`, options);\n };\n /**\n * Gets all the Units you are a member of. Admin users can see all Units\n\n * @summary Gets Units a User has access to\n */\n const appApiUnitGet = <TData = AxiosResponse<UnitsGetResponse>>(\n options?: AxiosRequestConfig\n ): Promise<TData> => {\n return axios.get(`/unit`, options);\n };\n /**\n * Creates a 'Personal' Unit for a User. The unit will belong to the built-in **Default** Organisation. Users can only have one Personal Unit and Personal Units cannot have other Users\n\n * @summary Create a new Independent User Unit\n */\n const appApiUnitPersonalPut = <\n TData = AxiosResponse<PersonalUnitPutResponse>\n >(\n options?: AxiosRequestConfig\n ): Promise<TData> => {\n return axios.put(`/unit`, undefined, options);\n };\n /**\n * Deletes a 'Personal' Unit. It must be your Unit, which belongs to the Default Organisation\n\n * @summary Deletes an Independent Unit\n */\n const appApiUnitPersonalDelete = <TData = AxiosResponse<void>>(\n options?: AxiosRequestConfig\n ): Promise<TData> => {\n return axios.delete(`/unit`, options);\n };\n return {\n appApiUnitGetOrgUnits,\n appApiUnitPost,\n appApiUnitGetUnit,\n appApiUnitDelete,\n appApiUnitGet,\n appApiUnitPersonalPut,\n appApiUnitPersonalDelete,\n };\n};\nexport type AppApiUnitGetOrgUnitsResult =\n AxiosResponse<OrganisationUnitsGetResponse>;\nexport type AppApiUnitPostResult = AxiosResponse<OrganisationUnitPostResponse>;\nexport type AppApiUnitGetUnitResult = AxiosResponse<UnitGetResponse>;\nexport type AppApiUnitDeleteResult = AxiosResponse<void>;\nexport type AppApiUnitGetResult = AxiosResponse<UnitsGetResponse>;\nexport type AppApiUnitPersonalPutResult =\n AxiosResponse<PersonalUnitPutResponse>;\nexport type AppApiUnitPersonalDeleteResult = AxiosResponse<void>;\n"]}
|
package/unit/unit.d.ts
CHANGED
|
@@ -1,99 +1,32 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { V as customInstance, F as OrganisationUnitsGetResponse, W as ErrorType, N as AsError, O as OrganisationUnitPostBodyBody, I as OrganisationUnitPostResponse, x as UnitGetResponse, G as UnitsGetResponse, H as PersonalUnitPutResponse } from '../custom-instance-86dd5ce6';
|
|
4
|
-
import 'axios';
|
|
1
|
+
import { AxiosResponse, AxiosRequestConfig } from 'axios';
|
|
2
|
+
import { F as OrganisationUnitsGetResponse, I as OrganisationUnitPostResponse, O as OrganisationUnitPostBodyBody, x as UnitGetResponse, G as UnitsGetResponse, H as PersonalUnitPutResponse } from '../account-server-api.schemas-078442c3.js';
|
|
5
3
|
|
|
6
|
-
declare type SecondParameter<T extends (...args: any) => any> = T extends (config: any, args: infer P) => any ? P : never;
|
|
7
4
|
/**
|
|
8
|
-
*
|
|
5
|
+
* Generated by orval v6.7.1 🍺
|
|
6
|
+
* Do not edit manually.
|
|
7
|
+
* Account Server API
|
|
8
|
+
* The Informatics Matters Account Server API.
|
|
9
9
|
|
|
10
|
-
*
|
|
11
|
-
*/
|
|
12
|
-
declare const getOrganisationUnits: (orgid: string, options?: SecondParameter<typeof customInstance>) => Promise<OrganisationUnitsGetResponse>;
|
|
13
|
-
declare const getGetOrganisationUnitsQueryKey: (orgid: string) => string[];
|
|
14
|
-
declare const useGetOrganisationUnits: <TData = OrganisationUnitsGetResponse, TError = ErrorType<void | AsError>>(orgid: string, options?: {
|
|
15
|
-
query?: UseQueryOptions<OrganisationUnitsGetResponse, TError, TData, QueryKey> | undefined;
|
|
16
|
-
request?: SecondParameter<typeof customInstance>;
|
|
17
|
-
} | undefined) => UseQueryResult<TData, TError> & {
|
|
18
|
-
queryKey: QueryKey;
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* Creates a new organisation unit. You need to be in the Organisation or an Admin user to use this endpoint
|
|
10
|
+
A service that provides access to the Account Server, which gives *registered* users access to and management of **Products**, **Organisations**, **Units** and **Users**.
|
|
22
11
|
|
|
23
|
-
*
|
|
12
|
+
* OpenAPI spec version: 0.1
|
|
24
13
|
*/
|
|
25
|
-
declare const createOrganisationUnit: (orgid: string, organisationUnitPostBodyBody: OrganisationUnitPostBodyBody, options?: SecondParameter<typeof customInstance>) => Promise<OrganisationUnitPostResponse>;
|
|
26
|
-
declare const useCreateOrganisationUnit: <TError = ErrorType<void | AsError>, TContext = unknown>(options?: {
|
|
27
|
-
mutation?: UseMutationOptions<OrganisationUnitPostResponse, TError, {
|
|
28
|
-
orgid: string;
|
|
29
|
-
data: OrganisationUnitPostBodyBody;
|
|
30
|
-
}, TContext> | undefined;
|
|
31
|
-
request?: SecondParameter<typeof customInstance>;
|
|
32
|
-
} | undefined) => react_query.UseMutationResult<OrganisationUnitPostResponse, TError, {
|
|
33
|
-
orgid: string;
|
|
34
|
-
data: OrganisationUnitPostBodyBody;
|
|
35
|
-
}, TContext>;
|
|
36
|
-
/**
|
|
37
|
-
* Gets the Unit, assuming you are a member of it. Admin users can see all Units
|
|
38
14
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
queryKey: QueryKey;
|
|
15
|
+
declare const getUnit: () => {
|
|
16
|
+
appApiUnitGetOrgUnits: <TData = AxiosResponse<OrganisationUnitsGetResponse, any>>(orgId: string, options?: AxiosRequestConfig<any> | undefined) => Promise<TData>;
|
|
17
|
+
appApiUnitPost: <TData_1 = AxiosResponse<OrganisationUnitPostResponse, any>>(orgId: string, organisationUnitPostBodyBody: OrganisationUnitPostBodyBody, options?: AxiosRequestConfig<any> | undefined) => Promise<TData_1>;
|
|
18
|
+
appApiUnitGetUnit: <TData_2 = AxiosResponse<UnitGetResponse, any>>(orgId: string, unitId: string, options?: AxiosRequestConfig<any> | undefined) => Promise<TData_2>;
|
|
19
|
+
appApiUnitDelete: <TData_3 = AxiosResponse<void, any>>(orgId: string, unitId: string, options?: AxiosRequestConfig<any> | undefined) => Promise<TData_3>;
|
|
20
|
+
appApiUnitGet: <TData_4 = AxiosResponse<UnitsGetResponse, any>>(options?: AxiosRequestConfig<any> | undefined) => Promise<TData_4>;
|
|
21
|
+
appApiUnitPersonalPut: <TData_5 = AxiosResponse<PersonalUnitPutResponse, any>>(options?: AxiosRequestConfig<any> | undefined) => Promise<TData_5>;
|
|
22
|
+
appApiUnitPersonalDelete: <TData_6 = AxiosResponse<void, any>>(options?: AxiosRequestConfig<any> | undefined) => Promise<TData_6>;
|
|
48
23
|
};
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
declare
|
|
55
|
-
declare
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
unitid: string;
|
|
59
|
-
}, TContext> | undefined;
|
|
60
|
-
request?: SecondParameter<typeof customInstance>;
|
|
61
|
-
} | undefined) => react_query.UseMutationResult<void, TError, {
|
|
62
|
-
orgid: string;
|
|
63
|
-
unitid: string;
|
|
64
|
-
}, TContext>;
|
|
65
|
-
/**
|
|
66
|
-
* Gets all the Units you are a member of. Admin users can see all Units
|
|
67
|
-
|
|
68
|
-
* @summary Gets Units a User has access to
|
|
69
|
-
*/
|
|
70
|
-
declare const getUnits: (options?: SecondParameter<typeof customInstance>) => Promise<UnitsGetResponse>;
|
|
71
|
-
declare const getGetUnitsQueryKey: () => string[];
|
|
72
|
-
declare const useGetUnits: <TData = UnitsGetResponse, TError = ErrorType<void | AsError>>(options?: {
|
|
73
|
-
query?: UseQueryOptions<UnitsGetResponse, TError, TData, QueryKey> | undefined;
|
|
74
|
-
request?: SecondParameter<typeof customInstance>;
|
|
75
|
-
} | undefined) => UseQueryResult<TData, TError> & {
|
|
76
|
-
queryKey: QueryKey;
|
|
77
|
-
};
|
|
78
|
-
/**
|
|
79
|
-
* Creates a 'Personal' Unit for a User. The unit will belong to the built-in **Default** Organisation. Users can only have one Personal Unit and Personal Units cannot have other Users
|
|
80
|
-
|
|
81
|
-
* @summary Create a new Independent User Unit
|
|
82
|
-
*/
|
|
83
|
-
declare const createDefaultUnit: (options?: SecondParameter<typeof customInstance>) => Promise<PersonalUnitPutResponse>;
|
|
84
|
-
declare const useCreateDefaultUnit: <TError = ErrorType<void | AsError>, TVariables = void, TContext = unknown>(options?: {
|
|
85
|
-
mutation?: UseMutationOptions<PersonalUnitPutResponse, TError, TVariables, TContext> | undefined;
|
|
86
|
-
request?: SecondParameter<typeof customInstance>;
|
|
87
|
-
} | undefined) => react_query.UseMutationResult<PersonalUnitPutResponse, TError, TVariables, TContext>;
|
|
88
|
-
/**
|
|
89
|
-
* Deletes a 'Personal' Unit. It must be your Unit, which belongs to the Default Organisation
|
|
90
|
-
|
|
91
|
-
* @summary Deletes an Independent Unit
|
|
92
|
-
*/
|
|
93
|
-
declare const deleteDefaultUnit: (options?: SecondParameter<typeof customInstance>) => Promise<void>;
|
|
94
|
-
declare const useDeleteDefaultUnit: <TError = ErrorType<AsError>, TVariables = void, TContext = unknown>(options?: {
|
|
95
|
-
mutation?: UseMutationOptions<void, TError, TVariables, TContext> | undefined;
|
|
96
|
-
request?: SecondParameter<typeof customInstance>;
|
|
97
|
-
} | undefined) => react_query.UseMutationResult<void, TError, TVariables, TContext>;
|
|
98
|
-
|
|
99
|
-
export { createDefaultUnit, createOrganisationUnit, deleteDefaultUnit, deleteOrganisationUnit, getGetOrganisationUnitsQueryKey, getGetUnitQueryKey, getGetUnitsQueryKey, getOrganisationUnits, getUnit, getUnits, useCreateDefaultUnit, useCreateOrganisationUnit, useDeleteDefaultUnit, useDeleteOrganisationUnit, useGetOrganisationUnits, useGetUnit, useGetUnits };
|
|
24
|
+
declare type AppApiUnitGetOrgUnitsResult = AxiosResponse<OrganisationUnitsGetResponse>;
|
|
25
|
+
declare type AppApiUnitPostResult = AxiosResponse<OrganisationUnitPostResponse>;
|
|
26
|
+
declare type AppApiUnitGetUnitResult = AxiosResponse<UnitGetResponse>;
|
|
27
|
+
declare type AppApiUnitDeleteResult = AxiosResponse<void>;
|
|
28
|
+
declare type AppApiUnitGetResult = AxiosResponse<UnitsGetResponse>;
|
|
29
|
+
declare type AppApiUnitPersonalPutResult = AxiosResponse<PersonalUnitPutResponse>;
|
|
30
|
+
declare type AppApiUnitPersonalDeleteResult = AxiosResponse<void>;
|
|
31
|
+
|
|
32
|
+
export { AppApiUnitDeleteResult, AppApiUnitGetOrgUnitsResult, AppApiUnitGetResult, AppApiUnitGetUnitResult, AppApiUnitPersonalDeleteResult, AppApiUnitPersonalPutResult, AppApiUnitPostResult, getUnit };
|
package/unit/unit.js
CHANGED
|
@@ -1,119 +1,40 @@
|
|
|
1
|
-
import
|
|
2
|
-
__spreadValues,
|
|
3
|
-
customInstance
|
|
4
|
-
} from "../chunk-JR7F532L.js";
|
|
1
|
+
import "../chunk-GWBPVOL2.js";
|
|
5
2
|
|
|
6
3
|
// src/unit/unit.ts
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
var getOrganisationUnits = (orgid, options) => {
|
|
12
|
-
return customInstance({ url: `/organisation/${orgid}/unit`, method: "get" }, options);
|
|
13
|
-
};
|
|
14
|
-
var getGetOrganisationUnitsQueryKey = (orgid) => [
|
|
15
|
-
`/organisation/${orgid}/unit`
|
|
16
|
-
];
|
|
17
|
-
var useGetOrganisationUnits = (orgid, options) => {
|
|
18
|
-
const { query: queryOptions, request: requestOptions } = options || {};
|
|
19
|
-
const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetOrganisationUnitsQueryKey(orgid);
|
|
20
|
-
const queryFn = () => getOrganisationUnits(orgid, requestOptions);
|
|
21
|
-
const query = useQuery(queryKey, queryFn, __spreadValues({ enabled: !!orgid }, queryOptions));
|
|
22
|
-
return __spreadValues({
|
|
23
|
-
queryKey
|
|
24
|
-
}, query);
|
|
25
|
-
};
|
|
26
|
-
var createOrganisationUnit = (orgid, organisationUnitPostBodyBody, options) => {
|
|
27
|
-
return customInstance({
|
|
28
|
-
url: `/organisation/${orgid}/unit`,
|
|
29
|
-
method: "post",
|
|
30
|
-
data: organisationUnitPostBodyBody
|
|
31
|
-
}, options);
|
|
32
|
-
};
|
|
33
|
-
var useCreateOrganisationUnit = (options) => {
|
|
34
|
-
const { mutation: mutationOptions, request: requestOptions } = options || {};
|
|
35
|
-
const mutationFn = (props) => {
|
|
36
|
-
const { orgid, data } = props || {};
|
|
37
|
-
return createOrganisationUnit(orgid, data, requestOptions);
|
|
4
|
+
import axios from "axios";
|
|
5
|
+
var getUnit = () => {
|
|
6
|
+
const appApiUnitGetOrgUnits = (orgId, options) => {
|
|
7
|
+
return axios.get(`/organisation/${orgId}/unit`, options);
|
|
38
8
|
};
|
|
39
|
-
|
|
40
|
-
};
|
|
41
|
-
var getUnit = (orgid, unitid, options) => {
|
|
42
|
-
return customInstance({ url: `/organisation/${orgid}/unit/${unitid}`, method: "get" }, options);
|
|
43
|
-
};
|
|
44
|
-
var getGetUnitQueryKey = (orgid, unitid) => [
|
|
45
|
-
`/organisation/${orgid}/unit/${unitid}`
|
|
46
|
-
];
|
|
47
|
-
var useGetUnit = (orgid, unitid, options) => {
|
|
48
|
-
const { query: queryOptions, request: requestOptions } = options || {};
|
|
49
|
-
const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetUnitQueryKey(orgid, unitid);
|
|
50
|
-
const queryFn = () => getUnit(orgid, unitid, requestOptions);
|
|
51
|
-
const query = useQuery(queryKey, queryFn, __spreadValues({ enabled: !!(orgid && unitid) }, queryOptions));
|
|
52
|
-
return __spreadValues({
|
|
53
|
-
queryKey
|
|
54
|
-
}, query);
|
|
55
|
-
};
|
|
56
|
-
var deleteOrganisationUnit = (orgid, unitid, options) => {
|
|
57
|
-
return customInstance({ url: `/organisation/${orgid}/unit/${unitid}`, method: "delete" }, options);
|
|
58
|
-
};
|
|
59
|
-
var useDeleteOrganisationUnit = (options) => {
|
|
60
|
-
const { mutation: mutationOptions, request: requestOptions } = options || {};
|
|
61
|
-
const mutationFn = (props) => {
|
|
62
|
-
const { orgid, unitid } = props || {};
|
|
63
|
-
return deleteOrganisationUnit(orgid, unitid, requestOptions);
|
|
9
|
+
const appApiUnitPost = (orgId, organisationUnitPostBodyBody, options) => {
|
|
10
|
+
return axios.post(`/organisation/${orgId}/unit`, organisationUnitPostBodyBody, options);
|
|
64
11
|
};
|
|
65
|
-
|
|
66
|
-
};
|
|
67
|
-
var getUnits = (options) => {
|
|
68
|
-
return customInstance({ url: `/unit`, method: "get" }, options);
|
|
69
|
-
};
|
|
70
|
-
var getGetUnitsQueryKey = () => [`/unit`];
|
|
71
|
-
var useGetUnits = (options) => {
|
|
72
|
-
const { query: queryOptions, request: requestOptions } = options || {};
|
|
73
|
-
const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetUnitsQueryKey();
|
|
74
|
-
const queryFn = () => getUnits(requestOptions);
|
|
75
|
-
const query = useQuery(queryKey, queryFn, queryOptions);
|
|
76
|
-
return __spreadValues({
|
|
77
|
-
queryKey
|
|
78
|
-
}, query);
|
|
79
|
-
};
|
|
80
|
-
var createDefaultUnit = (options) => {
|
|
81
|
-
return customInstance({ url: `/unit`, method: "put" }, options);
|
|
82
|
-
};
|
|
83
|
-
var useCreateDefaultUnit = (options) => {
|
|
84
|
-
const { mutation: mutationOptions, request: requestOptions } = options || {};
|
|
85
|
-
const mutationFn = () => {
|
|
86
|
-
return createDefaultUnit(requestOptions);
|
|
12
|
+
const appApiUnitGetUnit = (orgId, unitId, options) => {
|
|
13
|
+
return axios.get(`/organisation/${orgId}/unit/${unitId}`, options);
|
|
87
14
|
};
|
|
88
|
-
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
|
|
15
|
+
const appApiUnitDelete = (orgId, unitId, options) => {
|
|
16
|
+
return axios.delete(`/organisation/${orgId}/unit/${unitId}`, options);
|
|
17
|
+
};
|
|
18
|
+
const appApiUnitGet = (options) => {
|
|
19
|
+
return axios.get(`/unit`, options);
|
|
20
|
+
};
|
|
21
|
+
const appApiUnitPersonalPut = (options) => {
|
|
22
|
+
return axios.put(`/unit`, void 0, options);
|
|
23
|
+
};
|
|
24
|
+
const appApiUnitPersonalDelete = (options) => {
|
|
25
|
+
return axios.delete(`/unit`, options);
|
|
26
|
+
};
|
|
27
|
+
return {
|
|
28
|
+
appApiUnitGetOrgUnits,
|
|
29
|
+
appApiUnitPost,
|
|
30
|
+
appApiUnitGetUnit,
|
|
31
|
+
appApiUnitDelete,
|
|
32
|
+
appApiUnitGet,
|
|
33
|
+
appApiUnitPersonalPut,
|
|
34
|
+
appApiUnitPersonalDelete
|
|
97
35
|
};
|
|
98
|
-
return useMutation(mutationFn, mutationOptions);
|
|
99
36
|
};
|
|
100
37
|
export {
|
|
101
|
-
|
|
102
|
-
createOrganisationUnit,
|
|
103
|
-
deleteDefaultUnit,
|
|
104
|
-
deleteOrganisationUnit,
|
|
105
|
-
getGetOrganisationUnitsQueryKey,
|
|
106
|
-
getGetUnitQueryKey,
|
|
107
|
-
getGetUnitsQueryKey,
|
|
108
|
-
getOrganisationUnits,
|
|
109
|
-
getUnit,
|
|
110
|
-
getUnits,
|
|
111
|
-
useCreateDefaultUnit,
|
|
112
|
-
useCreateOrganisationUnit,
|
|
113
|
-
useDeleteDefaultUnit,
|
|
114
|
-
useDeleteOrganisationUnit,
|
|
115
|
-
useGetOrganisationUnits,
|
|
116
|
-
useGetUnit,
|
|
117
|
-
useGetUnits
|
|
38
|
+
getUnit
|
|
118
39
|
};
|
|
119
40
|
//# sourceMappingURL=unit.js.map
|
package/unit/unit.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/unit/unit.ts"],"sourcesContent":["/**\n * Generated by orval v6.6.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Products**, **Organisations**, **Units** and **Users**.\n\n * OpenAPI spec version: 0.1\n */\nimport {\n useQuery,\n useMutation,\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"react-query\";\nimport type {\n OrganisationUnitsGetResponse,\n AsError,\n OrganisationUnitPostResponse,\n OrganisationUnitPostBodyBody,\n UnitGetResponse,\n UnitsGetResponse,\n PersonalUnitPutResponse,\n} from \"../account-server-api.schemas\";\nimport { customInstance, ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (\n ...args: any\n) => Promise<infer R>\n ? R\n : any;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * Gets Organisational Units you have access to\n\n * @summary Gets Organisational Units\n */\nexport const getOrganisationUnits = (\n orgid: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<OrganisationUnitsGetResponse>(\n { url: `/organisation/${orgid}/unit`, method: \"get\" },\n options\n );\n};\n\nexport const getGetOrganisationUnitsQueryKey = (orgid: string) => [\n `/organisation/${orgid}/unit`,\n];\n\nexport const useGetOrganisationUnits = <\n TData = AsyncReturnType<typeof getOrganisationUnits>,\n TError = ErrorType<void | AsError>\n>(\n orgid: string,\n options?: {\n query?: UseQueryOptions<\n AsyncReturnType<typeof getOrganisationUnits>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetOrganisationUnitsQueryKey(orgid);\n\n const queryFn: QueryFunction<\n AsyncReturnType<typeof getOrganisationUnits>\n > = () => getOrganisationUnits(orgid, requestOptions);\n\n const query = useQuery<\n AsyncReturnType<typeof getOrganisationUnits>,\n TError,\n TData\n >(queryKey, queryFn, { enabled: !!orgid, ...queryOptions });\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Creates a new organisation unit. You need to be in the Organisation or an Admin user to use this endpoint\n\n * @summary Create a new Organisational Unit\n */\nexport const createOrganisationUnit = (\n orgid: string,\n organisationUnitPostBodyBody: OrganisationUnitPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<OrganisationUnitPostResponse>(\n {\n url: `/organisation/${orgid}/unit`,\n method: \"post\",\n data: organisationUnitPostBodyBody,\n },\n options\n );\n};\n\nexport const useCreateOrganisationUnit = <\n TError = ErrorType<AsError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof createOrganisationUnit>,\n TError,\n { orgid: string; data: OrganisationUnitPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof createOrganisationUnit>,\n { orgid: string; data: OrganisationUnitPostBodyBody }\n > = (props) => {\n const { orgid, data } = props || {};\n\n return createOrganisationUnit(orgid, data, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof createOrganisationUnit>,\n TError,\n { orgid: string; data: OrganisationUnitPostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets the Unit, assuming you are a member of it. Admin users can see all Units\n\n * @summary Gets a Unit\n */\nexport const getUnit = (\n orgid: string,\n unitid: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<UnitGetResponse>(\n { url: `/organisation/${orgid}/unit/${unitid}`, method: \"get\" },\n options\n );\n};\n\nexport const getGetUnitQueryKey = (orgid: string, unitid: string) => [\n `/organisation/${orgid}/unit/${unitid}`,\n];\n\nexport const useGetUnit = <\n TData = AsyncReturnType<typeof getUnit>,\n TError = ErrorType<void | AsError>\n>(\n orgid: string,\n unitid: string,\n options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof getUnit>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUnitQueryKey(orgid, unitid);\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getUnit>> = () =>\n getUnit(orgid, unitid, requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getUnit>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!(orgid && unitid), ...queryOptions }\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Deletes an Organisational Unit you have access to. Units can only be deleted by Organisation users or Admin users. You cannot delete a Unit that contains Products\n\n * @summary Deletes an Organisational Unit\n */\nexport const deleteOrganisationUnit = (\n orgid: string,\n unitid: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/organisation/${orgid}/unit/${unitid}`, method: \"delete\" },\n options\n );\n};\n\nexport const useDeleteOrganisationUnit = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof deleteOrganisationUnit>,\n TError,\n { orgid: string; unitid: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof deleteOrganisationUnit>,\n { orgid: string; unitid: string }\n > = (props) => {\n const { orgid, unitid } = props || {};\n\n return deleteOrganisationUnit(orgid, unitid, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof deleteOrganisationUnit>,\n TError,\n { orgid: string; unitid: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets all the Units you are a member of. Admin users can see all Units\n\n * @summary Gets Units a User has access to\n */\nexport const getUnits = (options?: SecondParameter<typeof customInstance>) => {\n return customInstance<UnitsGetResponse>(\n { url: `/unit`, method: \"get\" },\n options\n );\n};\n\nexport const getGetUnitsQueryKey = () => [`/unit`];\n\nexport const useGetUnits = <\n TData = AsyncReturnType<typeof getUnits>,\n TError = ErrorType<void | AsError>\n>(options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof getUnits>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUnitsQueryKey();\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getUnits>> = () =>\n getUnits(requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getUnits>, TError, TData>(\n queryKey,\n queryFn,\n queryOptions\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Creates a 'Personal' Unit for a User. The unit will belong to the built-in **Default** Organisation. Users can only have one Personal Unit and Personal Units cannot have other Users\n\n * @summary Create a new Independent User Unit\n */\nexport const createDefaultUnit = (\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<PersonalUnitPutResponse>(\n { url: `/unit`, method: \"put\" },\n options\n );\n};\n\nexport const useCreateDefaultUnit = <\n TError = ErrorType<AsError | void>,\n TVariables = void,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof createDefaultUnit>,\n TError,\n TVariables,\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof createDefaultUnit>,\n TVariables\n > = () => {\n return createDefaultUnit(requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof createDefaultUnit>,\n TError,\n TVariables,\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Deletes a 'Personal' Unit. It must be your Unit, which belongs to the Default Organisation\n\n * @summary Deletes an Independent Unit\n */\nexport const deleteDefaultUnit = (\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>({ url: `/unit`, method: \"delete\" }, options);\n};\n\nexport const useDeleteDefaultUnit = <\n TError = ErrorType<AsError>,\n TVariables = void,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof deleteDefaultUnit>,\n TError,\n TVariables,\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof deleteDefaultUnit>,\n TVariables\n > = () => {\n return deleteDefaultUnit(requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof deleteDefaultUnit>,\n TError,\n TVariables,\n TContext\n >(mutationFn, mutationOptions);\n};\n"],"mappings":";;;;;;AAUA;AAAA;AAAA;AAAA;AAyCO,IAAM,uBAAuB,CAClC,OACA,YACG;AACH,SAAO,eACL,EAAE,KAAK,iBAAiB,cAAc,QAAQ,SAC9C;AAAA;AAIG,IAAM,kCAAkC,CAAC,UAAkB;AAAA,EAChE,iBAAiB;AAAA;AAGZ,IAAM,0BAA0B,CAIrC,OACA,YAQ2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW;AAEpE,QAAM,WACJ,8CAAc,aAAY,gCAAgC;AAE5D,QAAM,UAEF,MAAM,qBAAqB,OAAO;AAEtC,QAAM,QAAQ,SAIZ,UAAU,SAAS,iBAAE,SAAS,CAAC,CAAC,SAAU;AAE5C,SAAO;AAAA,IACL;AAAA,KACG;AAAA;AASA,IAAM,yBAAyB,CACpC,OACA,8BACA,YACG;AACH,SAAO,eACL;AAAA,IACE,KAAK,iBAAiB;AAAA,IACtB,QAAQ;AAAA,IACR,MAAM;AAAA,KAER;AAAA;AAIG,IAAM,4BAA4B,CAGvC,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW;AAE1E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,OAAO,SAAS,SAAS;AAEjC,WAAO,uBAAuB,OAAO,MAAM;AAAA;AAG7C,SAAO,YAKL,YAAY;AAAA;AAOT,IAAM,UAAU,CACrB,OACA,QACA,YACG;AACH,SAAO,eACL,EAAE,KAAK,iBAAiB,cAAc,UAAU,QAAQ,SACxD;AAAA;AAIG,IAAM,qBAAqB,CAAC,OAAe,WAAmB;AAAA,EACnE,iBAAiB,cAAc;AAAA;AAG1B,IAAM,aAAa,CAIxB,OACA,QACA,YAI2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW;AAEpE,QAAM,WAAW,8CAAc,aAAY,mBAAmB,OAAO;AAErE,QAAM,UAA0D,MAC9D,QAAQ,OAAO,QAAQ;AAEzB,QAAM,QAAQ,SACZ,UACA,SACA,iBAAE,SAAS,CAAC,CAAE,UAAS,WAAY;AAGrC,SAAO;AAAA,IACL;AAAA,KACG;AAAA;AASA,IAAM,yBAAyB,CACpC,OACA,QACA,YACG;AACH,SAAO,eACL,EAAE,KAAK,iBAAiB,cAAc,UAAU,QAAQ,YACxD;AAAA;AAIG,IAAM,4BAA4B,CAGvC,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW;AAE1E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,OAAO,WAAW,SAAS;AAEnC,WAAO,uBAAuB,OAAO,QAAQ;AAAA;AAG/C,SAAO,YAKL,YAAY;AAAA;AAOT,IAAM,WAAW,CAAC,YAAqD;AAC5E,SAAO,eACL,EAAE,KAAK,SAAS,QAAQ,SACxB;AAAA;AAIG,IAAM,sBAAsB,MAAM,CAAC;AAEnC,IAAM,cAAc,CAGzB,YAG4D;AAC5D,QAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW;AAEpE,QAAM,WAAW,8CAAc,aAAY;AAE3C,QAAM,UAA2D,MAC/D,SAAS;AAEX,QAAM,QAAQ,SACZ,UACA,SACA;AAGF,SAAO;AAAA,IACL;AAAA,KACG;AAAA;AASA,IAAM,oBAAoB,CAC/B,YACG;AACH,SAAO,eACL,EAAE,KAAK,SAAS,QAAQ,SACxB;AAAA;AAIG,IAAM,uBAAuB,CAIlC,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW;AAE1E,QAAM,aAGF,MAAM;AACR,WAAO,kBAAkB;AAAA;AAG3B,SAAO,YAKL,YAAY;AAAA;AAOT,IAAM,oBAAoB,CAC/B,YACG;AACH,SAAO,eAAqB,EAAE,KAAK,SAAS,QAAQ,YAAY;AAAA;AAG3D,IAAM,uBAAuB,CAIlC,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW;AAE1E,QAAM,aAGF,MAAM;AACR,WAAO,kBAAkB;AAAA;AAG3B,SAAO,YAKL,YAAY;AAAA;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/unit/unit.ts"],"sourcesContent":["/**\n * Generated by orval v6.7.1 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Products**, **Organisations**, **Units** and **Users**.\n\n * OpenAPI spec version: 0.1\n */\nimport axios, { AxiosRequestConfig, AxiosResponse } from \"axios\";\nimport type {\n OrganisationUnitsGetResponse,\n OrganisationUnitPostResponse,\n OrganisationUnitPostBodyBody,\n UnitGetResponse,\n UnitsGetResponse,\n PersonalUnitPutResponse,\n} from \"../account-server-api.schemas\";\n\nexport const getUnit = () => {\n /**\n * Gets Organisational Units you have access to\n\n * @summary Gets Organisational Units\n */\n const appApiUnitGetOrgUnits = <\n TData = AxiosResponse<OrganisationUnitsGetResponse>\n >(\n orgId: string,\n options?: AxiosRequestConfig\n ): Promise<TData> => {\n return axios.get(`/organisation/${orgId}/unit`, options);\n };\n /**\n * Creates a new organisation unit. You need to be in the Organisation or an Admin user to use this endpoint\n\n * @summary Create a new Organisational Unit\n */\n const appApiUnitPost = <TData = AxiosResponse<OrganisationUnitPostResponse>>(\n orgId: string,\n organisationUnitPostBodyBody: OrganisationUnitPostBodyBody,\n options?: AxiosRequestConfig\n ): Promise<TData> => {\n return axios.post(\n `/organisation/${orgId}/unit`,\n organisationUnitPostBodyBody,\n options\n );\n };\n /**\n * Gets the Unit, assuming you are a member of it. Admin users can see all Units\n\n * @summary Gets a Unit\n */\n const appApiUnitGetUnit = <TData = AxiosResponse<UnitGetResponse>>(\n orgId: string,\n unitId: string,\n options?: AxiosRequestConfig\n ): Promise<TData> => {\n return axios.get(`/organisation/${orgId}/unit/${unitId}`, options);\n };\n /**\n * Deletes an Organisational Unit you have access to. Units can only be deleted by Organisation users or Admin users. You cannot delete a Unit that contains Products\n\n * @summary Deletes an Organisational Unit\n */\n const appApiUnitDelete = <TData = AxiosResponse<void>>(\n orgId: string,\n unitId: string,\n options?: AxiosRequestConfig\n ): Promise<TData> => {\n return axios.delete(`/organisation/${orgId}/unit/${unitId}`, options);\n };\n /**\n * Gets all the Units you are a member of. Admin users can see all Units\n\n * @summary Gets Units a User has access to\n */\n const appApiUnitGet = <TData = AxiosResponse<UnitsGetResponse>>(\n options?: AxiosRequestConfig\n ): Promise<TData> => {\n return axios.get(`/unit`, options);\n };\n /**\n * Creates a 'Personal' Unit for a User. The unit will belong to the built-in **Default** Organisation. Users can only have one Personal Unit and Personal Units cannot have other Users\n\n * @summary Create a new Independent User Unit\n */\n const appApiUnitPersonalPut = <\n TData = AxiosResponse<PersonalUnitPutResponse>\n >(\n options?: AxiosRequestConfig\n ): Promise<TData> => {\n return axios.put(`/unit`, undefined, options);\n };\n /**\n * Deletes a 'Personal' Unit. It must be your Unit, which belongs to the Default Organisation\n\n * @summary Deletes an Independent Unit\n */\n const appApiUnitPersonalDelete = <TData = AxiosResponse<void>>(\n options?: AxiosRequestConfig\n ): Promise<TData> => {\n return axios.delete(`/unit`, options);\n };\n return {\n appApiUnitGetOrgUnits,\n appApiUnitPost,\n appApiUnitGetUnit,\n appApiUnitDelete,\n appApiUnitGet,\n appApiUnitPersonalPut,\n appApiUnitPersonalDelete,\n };\n};\nexport type AppApiUnitGetOrgUnitsResult =\n AxiosResponse<OrganisationUnitsGetResponse>;\nexport type AppApiUnitPostResult = AxiosResponse<OrganisationUnitPostResponse>;\nexport type AppApiUnitGetUnitResult = AxiosResponse<UnitGetResponse>;\nexport type AppApiUnitDeleteResult = AxiosResponse<void>;\nexport type AppApiUnitGetResult = AxiosResponse<UnitsGetResponse>;\nexport type AppApiUnitPersonalPutResult =\n AxiosResponse<PersonalUnitPutResponse>;\nexport type AppApiUnitPersonalDeleteResult = AxiosResponse<void>;\n"],"mappings":";;;AAUA;AAUO,IAAM,UAAU,MAAM;AAM3B,QAAM,wBAAwB,CAG5B,OACA,YACmB;AACnB,WAAO,MAAM,IAAI,iBAAiB,cAAc,OAAO;AAAA,EACzD;AAMA,QAAM,iBAAiB,CACrB,OACA,8BACA,YACmB;AACnB,WAAO,MAAM,KACX,iBAAiB,cACjB,8BACA,OACF;AAAA,EACF;AAMA,QAAM,oBAAoB,CACxB,OACA,QACA,YACmB;AACnB,WAAO,MAAM,IAAI,iBAAiB,cAAc,UAAU,OAAO;AAAA,EACnE;AAMA,QAAM,mBAAmB,CACvB,OACA,QACA,YACmB;AACnB,WAAO,MAAM,OAAO,iBAAiB,cAAc,UAAU,OAAO;AAAA,EACtE;AAMA,QAAM,gBAAgB,CACpB,YACmB;AACnB,WAAO,MAAM,IAAI,SAAS,OAAO;AAAA,EACnC;AAMA,QAAM,wBAAwB,CAG5B,YACmB;AACnB,WAAO,MAAM,IAAI,SAAS,QAAW,OAAO;AAAA,EAC9C;AAMA,QAAM,2BAA2B,CAC/B,YACmB;AACnB,WAAO,MAAM,OAAO,SAAS,OAAO;AAAA,EACtC;AACA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
|