@squonk/account-server-client 0.1.26 → 0.1.27-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{account-server-api.schemas-078442c3.d.ts → account-server-api.schemas-e6c5f956.d.ts} +13 -0
- package/index.cjs.map +1 -1
- package/index.d.ts +1 -1
- package/index.js.map +1 -1
- package/organisation/organisation.cjs +64 -19
- package/organisation/organisation.cjs.map +1 -1
- package/organisation/organisation.d.ts +67 -18
- package/organisation/organisation.js +64 -19
- package/organisation/organisation.js.map +1 -1
- package/package.json +1 -1
- package/product/product.cjs +108 -30
- package/product/product.cjs.map +1 -1
- package/product/product.d.ts +114 -24
- package/product/product.js +108 -30
- package/product/product.js.map +1 -1
- package/service/service.cjs +39 -10
- package/service/service.cjs.map +1 -1
- package/service/service.d.ts +34 -8
- package/service/service.js +39 -10
- package/service/service.js.map +1 -1
- package/src/account-server-api.schemas.ts +13 -0
- package/src/organisation/organisation.ts +195 -44
- package/src/product/product.ts +356 -84
- package/src/service/service.ts +108 -16
- package/src/state/state.ts +64 -16
- package/src/unit/unit.ts +339 -74
- package/src/user/user.ts +340 -67
- package/state/state.cjs +21 -7
- package/state/state.cjs.map +1 -1
- package/state/state.d.ts +17 -6
- package/state/state.js +21 -7
- package/state/state.js.map +1 -1
- package/unit/unit.cjs +104 -29
- package/unit/unit.cjs.map +1 -1
- package/unit/unit.d.ts +107 -25
- package/unit/unit.js +104 -29
- package/unit/unit.js.map +1 -1
- package/user/user.cjs +106 -29
- package/user/user.cjs.map +1 -1
- package/user/user.d.ts +132 -20
- package/user/user.js +106 -29
- package/user/user.js.map +1 -1
package/unit/unit.cjs
CHANGED
|
@@ -1,40 +1,115 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
|
+
|
|
3
|
+
var _chunkN3RLW53Gcjs = require('../chunk-N3RLW53G.cjs');
|
|
2
4
|
|
|
3
5
|
// src/unit/unit.ts
|
|
4
6
|
var _axios = require('axios'); var _axios2 = _interopRequireDefault(_axios);
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
var _reactquery = require('react-query');
|
|
11
|
+
var appApiUnitGetOrgUnits = (orgId, options) => {
|
|
12
|
+
return _axios2.default.get(`/organisation/${orgId}/unit`, options);
|
|
13
|
+
};
|
|
14
|
+
var getAppApiUnitGetOrgUnitsQueryKey = (orgId) => [
|
|
15
|
+
`/organisation/${orgId}/unit`
|
|
16
|
+
];
|
|
17
|
+
var useAppApiUnitGetOrgUnits = (orgId, options) => {
|
|
18
|
+
const { query: queryOptions, axios: axiosOptions } = options || {};
|
|
19
|
+
const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getAppApiUnitGetOrgUnitsQueryKey(orgId)));
|
|
20
|
+
const queryFn = () => appApiUnitGetOrgUnits(orgId, axiosOptions);
|
|
21
|
+
const query = _reactquery.useQuery.call(void 0, queryKey, queryFn, _chunkN3RLW53Gcjs.__spreadValues.call(void 0, { enabled: !!orgId }, queryOptions));
|
|
22
|
+
return _chunkN3RLW53Gcjs.__spreadValues.call(void 0, {
|
|
23
|
+
queryKey
|
|
24
|
+
}, query);
|
|
25
|
+
};
|
|
26
|
+
var appApiUnitPost = (orgId, organisationUnitPostBodyBody, options) => {
|
|
27
|
+
return _axios2.default.post(`/organisation/${orgId}/unit`, organisationUnitPostBodyBody, options);
|
|
28
|
+
};
|
|
29
|
+
var useAppApiUnitPost = (options) => {
|
|
30
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options || {};
|
|
31
|
+
const mutationFn = (props) => {
|
|
32
|
+
const { orgId, data } = props || {};
|
|
33
|
+
return appApiUnitPost(orgId, data, axiosOptions);
|
|
20
34
|
};
|
|
21
|
-
|
|
22
|
-
|
|
35
|
+
return _reactquery.useMutation.call(void 0, mutationFn, mutationOptions);
|
|
36
|
+
};
|
|
37
|
+
var appApiUnitGetUnit = (orgId, unitId, options) => {
|
|
38
|
+
return _axios2.default.get(`/organisation/${orgId}/unit/${unitId}`, options);
|
|
39
|
+
};
|
|
40
|
+
var getAppApiUnitGetUnitQueryKey = (orgId, unitId) => [
|
|
41
|
+
`/organisation/${orgId}/unit/${unitId}`
|
|
42
|
+
];
|
|
43
|
+
var useAppApiUnitGetUnit = (orgId, unitId, options) => {
|
|
44
|
+
const { query: queryOptions, axios: axiosOptions } = options || {};
|
|
45
|
+
const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getAppApiUnitGetUnitQueryKey(orgId, unitId)));
|
|
46
|
+
const queryFn = () => appApiUnitGetUnit(orgId, unitId, axiosOptions);
|
|
47
|
+
const query = _reactquery.useQuery.call(void 0, queryKey, queryFn, _chunkN3RLW53Gcjs.__spreadValues.call(void 0, { enabled: !!(orgId && unitId) }, queryOptions));
|
|
48
|
+
return _chunkN3RLW53Gcjs.__spreadValues.call(void 0, {
|
|
49
|
+
queryKey
|
|
50
|
+
}, query);
|
|
51
|
+
};
|
|
52
|
+
var appApiUnitDelete = (orgId, unitId, options) => {
|
|
53
|
+
return _axios2.default.delete(`/organisation/${orgId}/unit/${unitId}`, options);
|
|
54
|
+
};
|
|
55
|
+
var useAppApiUnitDelete = (options) => {
|
|
56
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options || {};
|
|
57
|
+
const mutationFn = (props) => {
|
|
58
|
+
const { orgId, unitId } = props || {};
|
|
59
|
+
return appApiUnitDelete(orgId, unitId, axiosOptions);
|
|
23
60
|
};
|
|
24
|
-
|
|
25
|
-
|
|
61
|
+
return _reactquery.useMutation.call(void 0, mutationFn, mutationOptions);
|
|
62
|
+
};
|
|
63
|
+
var appApiUnitGet = (options) => {
|
|
64
|
+
return _axios2.default.get(`/unit`, options);
|
|
65
|
+
};
|
|
66
|
+
var getAppApiUnitGetQueryKey = () => [`/unit`];
|
|
67
|
+
var useAppApiUnitGet = (options) => {
|
|
68
|
+
const { query: queryOptions, axios: axiosOptions } = options || {};
|
|
69
|
+
const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getAppApiUnitGetQueryKey()));
|
|
70
|
+
const queryFn = () => appApiUnitGet(axiosOptions);
|
|
71
|
+
const query = _reactquery.useQuery.call(void 0, queryKey, queryFn, queryOptions);
|
|
72
|
+
return _chunkN3RLW53Gcjs.__spreadValues.call(void 0, {
|
|
73
|
+
queryKey
|
|
74
|
+
}, query);
|
|
75
|
+
};
|
|
76
|
+
var appApiUnitPersonalPut = (options) => {
|
|
77
|
+
return _axios2.default.put(`/unit`, void 0, options);
|
|
78
|
+
};
|
|
79
|
+
var useAppApiUnitPersonalPut = (options) => {
|
|
80
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options || {};
|
|
81
|
+
const mutationFn = () => {
|
|
82
|
+
return appApiUnitPersonalPut(axiosOptions);
|
|
26
83
|
};
|
|
27
|
-
return
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
84
|
+
return _reactquery.useMutation.call(void 0, mutationFn, mutationOptions);
|
|
85
|
+
};
|
|
86
|
+
var appApiUnitPersonalDelete = (options) => {
|
|
87
|
+
return _axios2.default.delete(`/unit`, options);
|
|
88
|
+
};
|
|
89
|
+
var useAppApiUnitPersonalDelete = (options) => {
|
|
90
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options || {};
|
|
91
|
+
const mutationFn = () => {
|
|
92
|
+
return appApiUnitPersonalDelete(axiosOptions);
|
|
35
93
|
};
|
|
94
|
+
return _reactquery.useMutation.call(void 0, mutationFn, mutationOptions);
|
|
36
95
|
};
|
|
37
96
|
|
|
38
97
|
|
|
39
|
-
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
exports.appApiUnitDelete = appApiUnitDelete; exports.appApiUnitGet = appApiUnitGet; exports.appApiUnitGetOrgUnits = appApiUnitGetOrgUnits; exports.appApiUnitGetUnit = appApiUnitGetUnit; exports.appApiUnitPersonalDelete = appApiUnitPersonalDelete; exports.appApiUnitPersonalPut = appApiUnitPersonalPut; exports.appApiUnitPost = appApiUnitPost; exports.getAppApiUnitGetOrgUnitsQueryKey = getAppApiUnitGetOrgUnitsQueryKey; exports.getAppApiUnitGetQueryKey = getAppApiUnitGetQueryKey; exports.getAppApiUnitGetUnitQueryKey = getAppApiUnitGetUnitQueryKey; exports.useAppApiUnitDelete = useAppApiUnitDelete; exports.useAppApiUnitGet = useAppApiUnitGet; exports.useAppApiUnitGetOrgUnits = useAppApiUnitGetOrgUnits; exports.useAppApiUnitGetUnit = useAppApiUnitGetUnit; exports.useAppApiUnitPersonalDelete = useAppApiUnitPersonalDelete; exports.useAppApiUnitPersonalPut = useAppApiUnitPersonalPut; exports.useAppApiUnitPost = useAppApiUnitPost;
|
|
40
115
|
//# sourceMappingURL=unit.cjs.map
|
package/unit/unit.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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"]}
|
|
1
|
+
{"version":3,"sources":["../../src/unit/unit.ts"],"names":[],"mappings":";;;;;AAUA;AACA;AAAA;AAAA;AAAA;AAgCO,IAAM,wBAAwB,CACnC,OACA,YACyD;AACzD,SAAO,MAAM,IAAI,iBAAiB,cAAc,OAAO;AACzD;AAEO,IAAM,mCAAmC,CAAC,UAAkB;AAAA,EACjE,iBAAiB;AACnB;AAOO,IAAM,2BAA2B,CAItC,OACA,YAQ2D;AAC3D,QAAM,EAAE,OAAO,cAAc,OAAO,iBAAiB,WAAW,CAAC;AAEjE,QAAM,WACJ,8CAAc,aAAY,iCAAiC,KAAK;AAElE,QAAM,UAEF,MAAM,sBAAsB,OAAO,YAAY;AAEnD,QAAM,QAAQ,SAIZ,UAAU,SAAS,iBAAE,SAAS,CAAC,CAAC,SAAU,aAAc;AAE1D,SAAO;AAAA,IACL;AAAA,KACG;AAEP;AAOO,IAAM,iBAAiB,CAC5B,OACA,8BACA,YACyD;AACzD,SAAO,MAAM,KACX,iBAAiB,cACjB,8BACA,OACF;AACF;AAQO,IAAM,oBAAoB,CAG/B,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,OAAO,iBAAiB,WAAW,CAAC;AAEvE,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,OAAO,SAAS,SAAS,CAAC;AAElC,WAAO,eAAe,OAAO,MAAM,YAAY;AAAA,EACjD;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B;AAMO,IAAM,oBAAoB,CAC/B,OACA,QACA,YAC4C;AAC5C,SAAO,MAAM,IAAI,iBAAiB,cAAc,UAAU,OAAO;AACnE;AAEO,IAAM,+BAA+B,CAAC,OAAe,WAAmB;AAAA,EAC7E,iBAAiB,cAAc;AACjC;AAOO,IAAM,uBAAuB,CAIlC,OACA,QACA,YAQ2D;AAC3D,QAAM,EAAE,OAAO,cAAc,OAAO,iBAAiB,WAAW,CAAC;AAEjE,QAAM,WACJ,8CAAc,aAAY,6BAA6B,OAAO,MAAM;AAEtE,QAAM,UAEF,MAAM,kBAAkB,OAAO,QAAQ,YAAY;AAEvD,QAAM,QAAQ,SAIZ,UAAU,SAAS,iBAAE,SAAS,CAAC,CAAE,UAAS,WAAY,aAAc;AAEtE,SAAO;AAAA,IACL;AAAA,KACG;AAEP;AAOO,IAAM,mBAAmB,CAC9B,OACA,QACA,YACiC;AACjC,SAAO,MAAM,OAAO,iBAAiB,cAAc,UAAU,OAAO;AACtE;AAQO,IAAM,sBAAsB,CAGjC,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,OAAO,iBAAiB,WAAW,CAAC;AAEvE,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,OAAO,WAAW,SAAS,CAAC;AAEpC,WAAO,iBAAiB,OAAO,QAAQ,YAAY;AAAA,EACrD;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B;AAMO,IAAM,gBAAgB,CAC3B,YAC6C;AAC7C,SAAO,MAAM,IAAI,SAAS,OAAO;AACnC;AAEO,IAAM,2BAA2B,MAAM,CAAC,OAAO;AAO/C,IAAM,mBAAmB,CAG9B,YAG4D;AAC5D,QAAM,EAAE,OAAO,cAAc,OAAO,iBAAiB,WAAW,CAAC;AAEjE,QAAM,WAAW,8CAAc,aAAY,yBAAyB;AAEpE,QAAM,UAAgE,MACpE,cAAc,YAAY;AAE5B,QAAM,QAAQ,SACZ,UACA,SACA,YACF;AAEA,SAAO;AAAA,IACL;AAAA,KACG;AAEP;AAOO,IAAM,wBAAwB,CACnC,YACoD;AACpD,SAAO,MAAM,IAAI,SAAS,QAAW,OAAO;AAC9C;AAQO,IAAM,2BAA2B,CAItC,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,OAAO,iBAAiB,WAAW,CAAC;AAEvE,QAAM,aAGF,MAAM;AACR,WAAO,sBAAsB,YAAY;AAAA,EAC3C;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B;AAMO,IAAM,2BAA2B,CACtC,YACiC;AACjC,SAAO,MAAM,OAAO,SAAS,OAAO;AACtC;AAQO,IAAM,8BAA8B,CAIzC,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,OAAO,iBAAiB,WAAW,CAAC;AAEvE,QAAM,aAGF,MAAM;AACR,WAAO,yBAAyB,YAAY;AAAA,EAC9C;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B","sourcesContent":["/**\n * Generated by orval v6.7.1 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Products**, **Organisations**, **Units** and **Users**.\n\n * OpenAPI spec version: 0.1\n */\nimport axios, { AxiosRequestConfig, AxiosResponse, AxiosError } from \"axios\";\nimport {\n useQuery,\n useMutation,\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"react-query\";\nimport type {\n OrganisationUnitsGetResponse,\n AsError,\n OrganisationUnitPostResponse,\n OrganisationUnitPostBodyBody,\n UnitGetResponse,\n UnitsGetResponse,\n PersonalUnitPutResponse,\n} from \"../account-server-api.schemas\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (\n ...args: any\n) => Promise<infer R>\n ? R\n : any;\n\n/**\n * Gets Organisational Units you have access to or that are public\n\n * @summary Gets Organisational Units\n */\nexport const appApiUnitGetOrgUnits = (\n orgId: string,\n options?: AxiosRequestConfig\n): Promise<AxiosResponse<OrganisationUnitsGetResponse>> => {\n return axios.get(`/organisation/${orgId}/unit`, options);\n};\n\nexport const getAppApiUnitGetOrgUnitsQueryKey = (orgId: string) => [\n `/organisation/${orgId}/unit`,\n];\n\nexport type AppApiUnitGetOrgUnitsQueryResult = NonNullable<\n AsyncReturnType<typeof appApiUnitGetOrgUnits>\n>;\nexport type AppApiUnitGetOrgUnitsQueryError = AxiosError<void | AsError>;\n\nexport const useAppApiUnitGetOrgUnits = <\n TData = AsyncReturnType<typeof appApiUnitGetOrgUnits>,\n TError = AxiosError<void | AsError>\n>(\n orgId: string,\n options?: {\n query?: UseQueryOptions<\n AsyncReturnType<typeof appApiUnitGetOrgUnits>,\n TError,\n TData\n >;\n axios?: AxiosRequestConfig;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, axios: axiosOptions } = options || {};\n\n const queryKey =\n queryOptions?.queryKey ?? getAppApiUnitGetOrgUnitsQueryKey(orgId);\n\n const queryFn: QueryFunction<\n AsyncReturnType<typeof appApiUnitGetOrgUnits>\n > = () => appApiUnitGetOrgUnits(orgId, axiosOptions);\n\n const query = useQuery<\n AsyncReturnType<typeof appApiUnitGetOrgUnits>,\n TError,\n TData\n >(queryKey, queryFn, { enabled: !!orgId, ...queryOptions });\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Creates a new organisation unit. You need to be in the Organisation or an Admin user to use this endpoint\n\n * @summary Create a new Organisational Unit\n */\nexport const appApiUnitPost = (\n orgId: string,\n organisationUnitPostBodyBody: OrganisationUnitPostBodyBody,\n options?: AxiosRequestConfig\n): Promise<AxiosResponse<OrganisationUnitPostResponse>> => {\n return axios.post(\n `/organisation/${orgId}/unit`,\n organisationUnitPostBodyBody,\n options\n );\n};\n\nexport type AppApiUnitPostMutationResult = NonNullable<\n AsyncReturnType<typeof appApiUnitPost>\n>;\nexport type AppApiUnitPostMutationBody = OrganisationUnitPostBodyBody;\nexport type AppApiUnitPostMutationError = AxiosError<AsError | void>;\n\nexport const useAppApiUnitPost = <\n TError = AxiosError<AsError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof appApiUnitPost>,\n TError,\n { orgId: string; data: OrganisationUnitPostBodyBody },\n TContext\n >;\n axios?: AxiosRequestConfig;\n}) => {\n const { mutation: mutationOptions, axios: axiosOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof appApiUnitPost>,\n { orgId: string; data: OrganisationUnitPostBodyBody }\n > = (props) => {\n const { orgId, data } = props || {};\n\n return appApiUnitPost(orgId, data, axiosOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof appApiUnitPost>,\n TError,\n { orgId: string; data: OrganisationUnitPostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets the Unit, assuming you are a member of it or it is public. Admin users can see all Units\n\n * @summary Gets a Unit\n */\nexport const appApiUnitGetUnit = (\n orgId: string,\n unitId: string,\n options?: AxiosRequestConfig\n): Promise<AxiosResponse<UnitGetResponse>> => {\n return axios.get(`/organisation/${orgId}/unit/${unitId}`, options);\n};\n\nexport const getAppApiUnitGetUnitQueryKey = (orgId: string, unitId: string) => [\n `/organisation/${orgId}/unit/${unitId}`,\n];\n\nexport type AppApiUnitGetUnitQueryResult = NonNullable<\n AsyncReturnType<typeof appApiUnitGetUnit>\n>;\nexport type AppApiUnitGetUnitQueryError = AxiosError<void | AsError>;\n\nexport const useAppApiUnitGetUnit = <\n TData = AsyncReturnType<typeof appApiUnitGetUnit>,\n TError = AxiosError<void | AsError>\n>(\n orgId: string,\n unitId: string,\n options?: {\n query?: UseQueryOptions<\n AsyncReturnType<typeof appApiUnitGetUnit>,\n TError,\n TData\n >;\n axios?: AxiosRequestConfig;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, axios: axiosOptions } = options || {};\n\n const queryKey =\n queryOptions?.queryKey ?? getAppApiUnitGetUnitQueryKey(orgId, unitId);\n\n const queryFn: QueryFunction<\n AsyncReturnType<typeof appApiUnitGetUnit>\n > = () => appApiUnitGetUnit(orgId, unitId, axiosOptions);\n\n const query = useQuery<\n AsyncReturnType<typeof appApiUnitGetUnit>,\n TError,\n TData\n >(queryKey, queryFn, { enabled: !!(orgId && unitId), ...queryOptions });\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Deletes an Organisational Unit you have access to. Units can only be deleted by Organisation users or Admin users. You cannot delete a Unit that contains Products\n\n * @summary Deletes an Organisational Unit\n */\nexport const appApiUnitDelete = (\n orgId: string,\n unitId: string,\n options?: AxiosRequestConfig\n): Promise<AxiosResponse<void>> => {\n return axios.delete(`/organisation/${orgId}/unit/${unitId}`, options);\n};\n\nexport type AppApiUnitDeleteMutationResult = NonNullable<\n AsyncReturnType<typeof appApiUnitDelete>\n>;\n\nexport type AppApiUnitDeleteMutationError = AxiosError<AsError>;\n\nexport const useAppApiUnitDelete = <\n TError = AxiosError<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof appApiUnitDelete>,\n TError,\n { orgId: string; unitId: string },\n TContext\n >;\n axios?: AxiosRequestConfig;\n}) => {\n const { mutation: mutationOptions, axios: axiosOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof appApiUnitDelete>,\n { orgId: string; unitId: string }\n > = (props) => {\n const { orgId, unitId } = props || {};\n\n return appApiUnitDelete(orgId, unitId, axiosOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof appApiUnitDelete>,\n TError,\n { orgId: string; unitId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets all the Units that are public or you are a member of. Admin users can see all Units\n\n * @summary Gets Units\n */\nexport const appApiUnitGet = (\n options?: AxiosRequestConfig\n): Promise<AxiosResponse<UnitsGetResponse>> => {\n return axios.get(`/unit`, options);\n};\n\nexport const getAppApiUnitGetQueryKey = () => [`/unit`];\n\nexport type AppApiUnitGetQueryResult = NonNullable<\n AsyncReturnType<typeof appApiUnitGet>\n>;\nexport type AppApiUnitGetQueryError = AxiosError<void | AsError>;\n\nexport const useAppApiUnitGet = <\n TData = AsyncReturnType<typeof appApiUnitGet>,\n TError = AxiosError<void | AsError>\n>(options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof appApiUnitGet>, TError, TData>;\n axios?: AxiosRequestConfig;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, axios: axiosOptions } = options || {};\n\n const queryKey = queryOptions?.queryKey ?? getAppApiUnitGetQueryKey();\n\n const queryFn: QueryFunction<AsyncReturnType<typeof appApiUnitGet>> = () =>\n appApiUnitGet(axiosOptions);\n\n const query = useQuery<AsyncReturnType<typeof appApiUnitGet>, TError, TData>(\n queryKey,\n queryFn,\n queryOptions\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Creates a 'Personal' Unit for a User. The unit will belong to the built-in **Default** Organisation. Users can only have one Personal Unit and Personal Units cannot have other Users\n\n * @summary Create a new Independent User Unit\n */\nexport const appApiUnitPersonalPut = (\n options?: AxiosRequestConfig\n): Promise<AxiosResponse<PersonalUnitPutResponse>> => {\n return axios.put(`/unit`, undefined, options);\n};\n\nexport type AppApiUnitPersonalPutMutationResult = NonNullable<\n AsyncReturnType<typeof appApiUnitPersonalPut>\n>;\n\nexport type AppApiUnitPersonalPutMutationError = AxiosError<AsError | void>;\n\nexport const useAppApiUnitPersonalPut = <\n TError = AxiosError<AsError | void>,\n TVariables = void,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof appApiUnitPersonalPut>,\n TError,\n TVariables,\n TContext\n >;\n axios?: AxiosRequestConfig;\n}) => {\n const { mutation: mutationOptions, axios: axiosOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof appApiUnitPersonalPut>,\n TVariables\n > = () => {\n return appApiUnitPersonalPut(axiosOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof appApiUnitPersonalPut>,\n TError,\n TVariables,\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Deletes a 'Personal' Unit. It must be your Unit, which belongs to the Default Organisation\n\n * @summary Deletes an Independent Unit\n */\nexport const appApiUnitPersonalDelete = (\n options?: AxiosRequestConfig\n): Promise<AxiosResponse<void>> => {\n return axios.delete(`/unit`, options);\n};\n\nexport type AppApiUnitPersonalDeleteMutationResult = NonNullable<\n AsyncReturnType<typeof appApiUnitPersonalDelete>\n>;\n\nexport type AppApiUnitPersonalDeleteMutationError = AxiosError<AsError>;\n\nexport const useAppApiUnitPersonalDelete = <\n TError = AxiosError<AsError>,\n TVariables = void,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof appApiUnitPersonalDelete>,\n TError,\n TVariables,\n TContext\n >;\n axios?: AxiosRequestConfig;\n}) => {\n const { mutation: mutationOptions, axios: axiosOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof appApiUnitPersonalDelete>,\n TVariables\n > = () => {\n return appApiUnitPersonalDelete(axiosOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof appApiUnitPersonalDelete>,\n TError,\n TVariables,\n TContext\n >(mutationFn, mutationOptions);\n};\n"]}
|
package/unit/unit.d.ts
CHANGED
|
@@ -1,32 +1,114 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import * as react_query from 'react-query';
|
|
2
|
+
import { UseQueryOptions, QueryKey, UseQueryResult, UseMutationOptions } from 'react-query';
|
|
3
|
+
import { AxiosRequestConfig, AxiosResponse, AxiosError } from 'axios';
|
|
4
|
+
import { F as OrganisationUnitsGetResponse, N as AsError, O as OrganisationUnitPostBodyBody, I as OrganisationUnitPostResponse, x as UnitGetResponse, G as UnitsGetResponse, H as PersonalUnitPutResponse } from '../account-server-api.schemas-e6c5f956.js';
|
|
3
5
|
|
|
6
|
+
declare type AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (...args: any) => Promise<infer R> ? R : any;
|
|
4
7
|
/**
|
|
5
|
-
*
|
|
6
|
-
* Do not edit manually.
|
|
7
|
-
* Account Server API
|
|
8
|
-
* The Informatics Matters Account Server API.
|
|
8
|
+
* Gets Organisational Units you have access to or that are public
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
* @summary Gets Organisational Units
|
|
11
|
+
*/
|
|
12
|
+
declare const appApiUnitGetOrgUnits: (orgId: string, options?: AxiosRequestConfig<any> | undefined) => Promise<AxiosResponse<OrganisationUnitsGetResponse>>;
|
|
13
|
+
declare const getAppApiUnitGetOrgUnitsQueryKey: (orgId: string) => string[];
|
|
14
|
+
declare type AppApiUnitGetOrgUnitsQueryResult = NonNullable<AsyncReturnType<typeof appApiUnitGetOrgUnits>>;
|
|
15
|
+
declare type AppApiUnitGetOrgUnitsQueryError = AxiosError<void | AsError>;
|
|
16
|
+
declare const useAppApiUnitGetOrgUnits: <TData = AxiosResponse<OrganisationUnitsGetResponse, any>, TError = AxiosError<void | AsError, any>>(orgId: string, options?: {
|
|
17
|
+
query?: UseQueryOptions<AxiosResponse<OrganisationUnitsGetResponse, any>, TError, TData, QueryKey> | undefined;
|
|
18
|
+
axios?: AxiosRequestConfig<any> | undefined;
|
|
19
|
+
} | undefined) => UseQueryResult<TData, TError> & {
|
|
20
|
+
queryKey: QueryKey;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Creates a new organisation unit. You need to be in the Organisation or an Admin user to use this endpoint
|
|
11
24
|
|
|
12
|
-
*
|
|
25
|
+
* @summary Create a new Organisational Unit
|
|
13
26
|
*/
|
|
27
|
+
declare const appApiUnitPost: (orgId: string, organisationUnitPostBodyBody: OrganisationUnitPostBodyBody, options?: AxiosRequestConfig<any> | undefined) => Promise<AxiosResponse<OrganisationUnitPostResponse>>;
|
|
28
|
+
declare type AppApiUnitPostMutationResult = NonNullable<AsyncReturnType<typeof appApiUnitPost>>;
|
|
29
|
+
declare type AppApiUnitPostMutationBody = OrganisationUnitPostBodyBody;
|
|
30
|
+
declare type AppApiUnitPostMutationError = AxiosError<AsError | void>;
|
|
31
|
+
declare const useAppApiUnitPost: <TError = AxiosError<void | AsError, any>, TContext = unknown>(options?: {
|
|
32
|
+
mutation?: UseMutationOptions<AxiosResponse<OrganisationUnitPostResponse, any>, TError, {
|
|
33
|
+
orgId: string;
|
|
34
|
+
data: OrganisationUnitPostBodyBody;
|
|
35
|
+
}, TContext> | undefined;
|
|
36
|
+
axios?: AxiosRequestConfig<any> | undefined;
|
|
37
|
+
} | undefined) => react_query.UseMutationResult<AxiosResponse<OrganisationUnitPostResponse, any>, TError, {
|
|
38
|
+
orgId: string;
|
|
39
|
+
data: OrganisationUnitPostBodyBody;
|
|
40
|
+
}, TContext>;
|
|
41
|
+
/**
|
|
42
|
+
* Gets the Unit, assuming you are a member of it or it is public. Admin users can see all Units
|
|
14
43
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
44
|
+
* @summary Gets a Unit
|
|
45
|
+
*/
|
|
46
|
+
declare const appApiUnitGetUnit: (orgId: string, unitId: string, options?: AxiosRequestConfig<any> | undefined) => Promise<AxiosResponse<UnitGetResponse>>;
|
|
47
|
+
declare const getAppApiUnitGetUnitQueryKey: (orgId: string, unitId: string) => string[];
|
|
48
|
+
declare type AppApiUnitGetUnitQueryResult = NonNullable<AsyncReturnType<typeof appApiUnitGetUnit>>;
|
|
49
|
+
declare type AppApiUnitGetUnitQueryError = AxiosError<void | AsError>;
|
|
50
|
+
declare const useAppApiUnitGetUnit: <TData = AxiosResponse<UnitGetResponse, any>, TError = AxiosError<void | AsError, any>>(orgId: string, unitId: string, options?: {
|
|
51
|
+
query?: UseQueryOptions<AxiosResponse<UnitGetResponse, any>, TError, TData, QueryKey> | undefined;
|
|
52
|
+
axios?: AxiosRequestConfig<any> | undefined;
|
|
53
|
+
} | undefined) => UseQueryResult<TData, TError> & {
|
|
54
|
+
queryKey: QueryKey;
|
|
23
55
|
};
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
declare
|
|
30
|
-
declare type
|
|
31
|
-
|
|
32
|
-
|
|
56
|
+
/**
|
|
57
|
+
* 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
|
|
58
|
+
|
|
59
|
+
* @summary Deletes an Organisational Unit
|
|
60
|
+
*/
|
|
61
|
+
declare const appApiUnitDelete: (orgId: string, unitId: string, options?: AxiosRequestConfig<any> | undefined) => Promise<AxiosResponse<void>>;
|
|
62
|
+
declare type AppApiUnitDeleteMutationResult = NonNullable<AsyncReturnType<typeof appApiUnitDelete>>;
|
|
63
|
+
declare type AppApiUnitDeleteMutationError = AxiosError<AsError>;
|
|
64
|
+
declare const useAppApiUnitDelete: <TError = AxiosError<AsError, any>, TContext = unknown>(options?: {
|
|
65
|
+
mutation?: UseMutationOptions<AxiosResponse<void, any>, TError, {
|
|
66
|
+
orgId: string;
|
|
67
|
+
unitId: string;
|
|
68
|
+
}, TContext> | undefined;
|
|
69
|
+
axios?: AxiosRequestConfig<any> | undefined;
|
|
70
|
+
} | undefined) => react_query.UseMutationResult<AxiosResponse<void, any>, TError, {
|
|
71
|
+
orgId: string;
|
|
72
|
+
unitId: string;
|
|
73
|
+
}, TContext>;
|
|
74
|
+
/**
|
|
75
|
+
* Gets all the Units that are public or you are a member of. Admin users can see all Units
|
|
76
|
+
|
|
77
|
+
* @summary Gets Units
|
|
78
|
+
*/
|
|
79
|
+
declare const appApiUnitGet: (options?: AxiosRequestConfig<any> | undefined) => Promise<AxiosResponse<UnitsGetResponse>>;
|
|
80
|
+
declare const getAppApiUnitGetQueryKey: () => string[];
|
|
81
|
+
declare type AppApiUnitGetQueryResult = NonNullable<AsyncReturnType<typeof appApiUnitGet>>;
|
|
82
|
+
declare type AppApiUnitGetQueryError = AxiosError<void | AsError>;
|
|
83
|
+
declare const useAppApiUnitGet: <TData = AxiosResponse<UnitsGetResponse, any>, TError = AxiosError<void | AsError, any>>(options?: {
|
|
84
|
+
query?: UseQueryOptions<AxiosResponse<UnitsGetResponse, any>, TError, TData, QueryKey> | undefined;
|
|
85
|
+
axios?: AxiosRequestConfig<any> | undefined;
|
|
86
|
+
} | undefined) => UseQueryResult<TData, TError> & {
|
|
87
|
+
queryKey: QueryKey;
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* 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
|
|
91
|
+
|
|
92
|
+
* @summary Create a new Independent User Unit
|
|
93
|
+
*/
|
|
94
|
+
declare const appApiUnitPersonalPut: (options?: AxiosRequestConfig<any> | undefined) => Promise<AxiosResponse<PersonalUnitPutResponse>>;
|
|
95
|
+
declare type AppApiUnitPersonalPutMutationResult = NonNullable<AsyncReturnType<typeof appApiUnitPersonalPut>>;
|
|
96
|
+
declare type AppApiUnitPersonalPutMutationError = AxiosError<AsError | void>;
|
|
97
|
+
declare const useAppApiUnitPersonalPut: <TError = AxiosError<void | AsError, any>, TVariables = void, TContext = unknown>(options?: {
|
|
98
|
+
mutation?: UseMutationOptions<AxiosResponse<PersonalUnitPutResponse, any>, TError, TVariables, TContext> | undefined;
|
|
99
|
+
axios?: AxiosRequestConfig<any> | undefined;
|
|
100
|
+
} | undefined) => react_query.UseMutationResult<AxiosResponse<PersonalUnitPutResponse, any>, TError, TVariables, TContext>;
|
|
101
|
+
/**
|
|
102
|
+
* Deletes a 'Personal' Unit. It must be your Unit, which belongs to the Default Organisation
|
|
103
|
+
|
|
104
|
+
* @summary Deletes an Independent Unit
|
|
105
|
+
*/
|
|
106
|
+
declare const appApiUnitPersonalDelete: (options?: AxiosRequestConfig<any> | undefined) => Promise<AxiosResponse<void>>;
|
|
107
|
+
declare type AppApiUnitPersonalDeleteMutationResult = NonNullable<AsyncReturnType<typeof appApiUnitPersonalDelete>>;
|
|
108
|
+
declare type AppApiUnitPersonalDeleteMutationError = AxiosError<AsError>;
|
|
109
|
+
declare const useAppApiUnitPersonalDelete: <TError = AxiosError<AsError, any>, TVariables = void, TContext = unknown>(options?: {
|
|
110
|
+
mutation?: UseMutationOptions<AxiosResponse<void, any>, TError, TVariables, TContext> | undefined;
|
|
111
|
+
axios?: AxiosRequestConfig<any> | undefined;
|
|
112
|
+
} | undefined) => react_query.UseMutationResult<AxiosResponse<void, any>, TError, TVariables, TContext>;
|
|
113
|
+
|
|
114
|
+
export { AppApiUnitDeleteMutationError, AppApiUnitDeleteMutationResult, AppApiUnitGetOrgUnitsQueryError, AppApiUnitGetOrgUnitsQueryResult, AppApiUnitGetQueryError, AppApiUnitGetQueryResult, AppApiUnitGetUnitQueryError, AppApiUnitGetUnitQueryResult, AppApiUnitPersonalDeleteMutationError, AppApiUnitPersonalDeleteMutationResult, AppApiUnitPersonalPutMutationError, AppApiUnitPersonalPutMutationResult, AppApiUnitPostMutationBody, AppApiUnitPostMutationError, AppApiUnitPostMutationResult, appApiUnitDelete, appApiUnitGet, appApiUnitGetOrgUnits, appApiUnitGetUnit, appApiUnitPersonalDelete, appApiUnitPersonalPut, appApiUnitPost, getAppApiUnitGetOrgUnitsQueryKey, getAppApiUnitGetQueryKey, getAppApiUnitGetUnitQueryKey, useAppApiUnitDelete, useAppApiUnitGet, useAppApiUnitGetOrgUnits, useAppApiUnitGetUnit, useAppApiUnitPersonalDelete, useAppApiUnitPersonalPut, useAppApiUnitPost };
|
package/unit/unit.js
CHANGED
|
@@ -1,40 +1,115 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {
|
|
2
|
+
__spreadValues
|
|
3
|
+
} from "../chunk-GWBPVOL2.js";
|
|
2
4
|
|
|
3
5
|
// src/unit/unit.ts
|
|
4
6
|
import axios from "axios";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
|
|
7
|
+
import {
|
|
8
|
+
useQuery,
|
|
9
|
+
useMutation
|
|
10
|
+
} from "react-query";
|
|
11
|
+
var appApiUnitGetOrgUnits = (orgId, options) => {
|
|
12
|
+
return axios.get(`/organisation/${orgId}/unit`, options);
|
|
13
|
+
};
|
|
14
|
+
var getAppApiUnitGetOrgUnitsQueryKey = (orgId) => [
|
|
15
|
+
`/organisation/${orgId}/unit`
|
|
16
|
+
];
|
|
17
|
+
var useAppApiUnitGetOrgUnits = (orgId, options) => {
|
|
18
|
+
const { query: queryOptions, axios: axiosOptions } = options || {};
|
|
19
|
+
const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getAppApiUnitGetOrgUnitsQueryKey(orgId);
|
|
20
|
+
const queryFn = () => appApiUnitGetOrgUnits(orgId, axiosOptions);
|
|
21
|
+
const query = useQuery(queryKey, queryFn, __spreadValues({ enabled: !!orgId }, queryOptions));
|
|
22
|
+
return __spreadValues({
|
|
23
|
+
queryKey
|
|
24
|
+
}, query);
|
|
25
|
+
};
|
|
26
|
+
var appApiUnitPost = (orgId, organisationUnitPostBodyBody, options) => {
|
|
27
|
+
return axios.post(`/organisation/${orgId}/unit`, organisationUnitPostBodyBody, options);
|
|
28
|
+
};
|
|
29
|
+
var useAppApiUnitPost = (options) => {
|
|
30
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options || {};
|
|
31
|
+
const mutationFn = (props) => {
|
|
32
|
+
const { orgId, data } = props || {};
|
|
33
|
+
return appApiUnitPost(orgId, data, axiosOptions);
|
|
20
34
|
};
|
|
21
|
-
|
|
22
|
-
|
|
35
|
+
return useMutation(mutationFn, mutationOptions);
|
|
36
|
+
};
|
|
37
|
+
var appApiUnitGetUnit = (orgId, unitId, options) => {
|
|
38
|
+
return axios.get(`/organisation/${orgId}/unit/${unitId}`, options);
|
|
39
|
+
};
|
|
40
|
+
var getAppApiUnitGetUnitQueryKey = (orgId, unitId) => [
|
|
41
|
+
`/organisation/${orgId}/unit/${unitId}`
|
|
42
|
+
];
|
|
43
|
+
var useAppApiUnitGetUnit = (orgId, unitId, options) => {
|
|
44
|
+
const { query: queryOptions, axios: axiosOptions } = options || {};
|
|
45
|
+
const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getAppApiUnitGetUnitQueryKey(orgId, unitId);
|
|
46
|
+
const queryFn = () => appApiUnitGetUnit(orgId, unitId, axiosOptions);
|
|
47
|
+
const query = useQuery(queryKey, queryFn, __spreadValues({ enabled: !!(orgId && unitId) }, queryOptions));
|
|
48
|
+
return __spreadValues({
|
|
49
|
+
queryKey
|
|
50
|
+
}, query);
|
|
51
|
+
};
|
|
52
|
+
var appApiUnitDelete = (orgId, unitId, options) => {
|
|
53
|
+
return axios.delete(`/organisation/${orgId}/unit/${unitId}`, options);
|
|
54
|
+
};
|
|
55
|
+
var useAppApiUnitDelete = (options) => {
|
|
56
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options || {};
|
|
57
|
+
const mutationFn = (props) => {
|
|
58
|
+
const { orgId, unitId } = props || {};
|
|
59
|
+
return appApiUnitDelete(orgId, unitId, axiosOptions);
|
|
23
60
|
};
|
|
24
|
-
|
|
25
|
-
|
|
61
|
+
return useMutation(mutationFn, mutationOptions);
|
|
62
|
+
};
|
|
63
|
+
var appApiUnitGet = (options) => {
|
|
64
|
+
return axios.get(`/unit`, options);
|
|
65
|
+
};
|
|
66
|
+
var getAppApiUnitGetQueryKey = () => [`/unit`];
|
|
67
|
+
var useAppApiUnitGet = (options) => {
|
|
68
|
+
const { query: queryOptions, axios: axiosOptions } = options || {};
|
|
69
|
+
const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getAppApiUnitGetQueryKey();
|
|
70
|
+
const queryFn = () => appApiUnitGet(axiosOptions);
|
|
71
|
+
const query = useQuery(queryKey, queryFn, queryOptions);
|
|
72
|
+
return __spreadValues({
|
|
73
|
+
queryKey
|
|
74
|
+
}, query);
|
|
75
|
+
};
|
|
76
|
+
var appApiUnitPersonalPut = (options) => {
|
|
77
|
+
return axios.put(`/unit`, void 0, options);
|
|
78
|
+
};
|
|
79
|
+
var useAppApiUnitPersonalPut = (options) => {
|
|
80
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options || {};
|
|
81
|
+
const mutationFn = () => {
|
|
82
|
+
return appApiUnitPersonalPut(axiosOptions);
|
|
26
83
|
};
|
|
27
|
-
return
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
84
|
+
return useMutation(mutationFn, mutationOptions);
|
|
85
|
+
};
|
|
86
|
+
var appApiUnitPersonalDelete = (options) => {
|
|
87
|
+
return axios.delete(`/unit`, options);
|
|
88
|
+
};
|
|
89
|
+
var useAppApiUnitPersonalDelete = (options) => {
|
|
90
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options || {};
|
|
91
|
+
const mutationFn = () => {
|
|
92
|
+
return appApiUnitPersonalDelete(axiosOptions);
|
|
35
93
|
};
|
|
94
|
+
return useMutation(mutationFn, mutationOptions);
|
|
36
95
|
};
|
|
37
96
|
export {
|
|
38
|
-
|
|
97
|
+
appApiUnitDelete,
|
|
98
|
+
appApiUnitGet,
|
|
99
|
+
appApiUnitGetOrgUnits,
|
|
100
|
+
appApiUnitGetUnit,
|
|
101
|
+
appApiUnitPersonalDelete,
|
|
102
|
+
appApiUnitPersonalPut,
|
|
103
|
+
appApiUnitPost,
|
|
104
|
+
getAppApiUnitGetOrgUnitsQueryKey,
|
|
105
|
+
getAppApiUnitGetQueryKey,
|
|
106
|
+
getAppApiUnitGetUnitQueryKey,
|
|
107
|
+
useAppApiUnitDelete,
|
|
108
|
+
useAppApiUnitGet,
|
|
109
|
+
useAppApiUnitGetOrgUnits,
|
|
110
|
+
useAppApiUnitGetUnit,
|
|
111
|
+
useAppApiUnitPersonalDelete,
|
|
112
|
+
useAppApiUnitPersonalPut,
|
|
113
|
+
useAppApiUnitPost
|
|
39
114
|
};
|
|
40
115
|
//# sourceMappingURL=unit.js.map
|
package/unit/unit.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/unit/unit.ts"],"sourcesContent":["/**\n * Generated by orval v6.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":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/unit/unit.ts"],"sourcesContent":["/**\n * Generated by orval v6.7.1 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Products**, **Organisations**, **Units** and **Users**.\n\n * OpenAPI spec version: 0.1\n */\nimport axios, { AxiosRequestConfig, AxiosResponse, AxiosError } from \"axios\";\nimport {\n useQuery,\n useMutation,\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"react-query\";\nimport type {\n OrganisationUnitsGetResponse,\n AsError,\n OrganisationUnitPostResponse,\n OrganisationUnitPostBodyBody,\n UnitGetResponse,\n UnitsGetResponse,\n PersonalUnitPutResponse,\n} from \"../account-server-api.schemas\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (\n ...args: any\n) => Promise<infer R>\n ? R\n : any;\n\n/**\n * Gets Organisational Units you have access to or that are public\n\n * @summary Gets Organisational Units\n */\nexport const appApiUnitGetOrgUnits = (\n orgId: string,\n options?: AxiosRequestConfig\n): Promise<AxiosResponse<OrganisationUnitsGetResponse>> => {\n return axios.get(`/organisation/${orgId}/unit`, options);\n};\n\nexport const getAppApiUnitGetOrgUnitsQueryKey = (orgId: string) => [\n `/organisation/${orgId}/unit`,\n];\n\nexport type AppApiUnitGetOrgUnitsQueryResult = NonNullable<\n AsyncReturnType<typeof appApiUnitGetOrgUnits>\n>;\nexport type AppApiUnitGetOrgUnitsQueryError = AxiosError<void | AsError>;\n\nexport const useAppApiUnitGetOrgUnits = <\n TData = AsyncReturnType<typeof appApiUnitGetOrgUnits>,\n TError = AxiosError<void | AsError>\n>(\n orgId: string,\n options?: {\n query?: UseQueryOptions<\n AsyncReturnType<typeof appApiUnitGetOrgUnits>,\n TError,\n TData\n >;\n axios?: AxiosRequestConfig;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, axios: axiosOptions } = options || {};\n\n const queryKey =\n queryOptions?.queryKey ?? getAppApiUnitGetOrgUnitsQueryKey(orgId);\n\n const queryFn: QueryFunction<\n AsyncReturnType<typeof appApiUnitGetOrgUnits>\n > = () => appApiUnitGetOrgUnits(orgId, axiosOptions);\n\n const query = useQuery<\n AsyncReturnType<typeof appApiUnitGetOrgUnits>,\n TError,\n TData\n >(queryKey, queryFn, { enabled: !!orgId, ...queryOptions });\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Creates a new organisation unit. You need to be in the Organisation or an Admin user to use this endpoint\n\n * @summary Create a new Organisational Unit\n */\nexport const appApiUnitPost = (\n orgId: string,\n organisationUnitPostBodyBody: OrganisationUnitPostBodyBody,\n options?: AxiosRequestConfig\n): Promise<AxiosResponse<OrganisationUnitPostResponse>> => {\n return axios.post(\n `/organisation/${orgId}/unit`,\n organisationUnitPostBodyBody,\n options\n );\n};\n\nexport type AppApiUnitPostMutationResult = NonNullable<\n AsyncReturnType<typeof appApiUnitPost>\n>;\nexport type AppApiUnitPostMutationBody = OrganisationUnitPostBodyBody;\nexport type AppApiUnitPostMutationError = AxiosError<AsError | void>;\n\nexport const useAppApiUnitPost = <\n TError = AxiosError<AsError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof appApiUnitPost>,\n TError,\n { orgId: string; data: OrganisationUnitPostBodyBody },\n TContext\n >;\n axios?: AxiosRequestConfig;\n}) => {\n const { mutation: mutationOptions, axios: axiosOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof appApiUnitPost>,\n { orgId: string; data: OrganisationUnitPostBodyBody }\n > = (props) => {\n const { orgId, data } = props || {};\n\n return appApiUnitPost(orgId, data, axiosOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof appApiUnitPost>,\n TError,\n { orgId: string; data: OrganisationUnitPostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets the Unit, assuming you are a member of it or it is public. Admin users can see all Units\n\n * @summary Gets a Unit\n */\nexport const appApiUnitGetUnit = (\n orgId: string,\n unitId: string,\n options?: AxiosRequestConfig\n): Promise<AxiosResponse<UnitGetResponse>> => {\n return axios.get(`/organisation/${orgId}/unit/${unitId}`, options);\n};\n\nexport const getAppApiUnitGetUnitQueryKey = (orgId: string, unitId: string) => [\n `/organisation/${orgId}/unit/${unitId}`,\n];\n\nexport type AppApiUnitGetUnitQueryResult = NonNullable<\n AsyncReturnType<typeof appApiUnitGetUnit>\n>;\nexport type AppApiUnitGetUnitQueryError = AxiosError<void | AsError>;\n\nexport const useAppApiUnitGetUnit = <\n TData = AsyncReturnType<typeof appApiUnitGetUnit>,\n TError = AxiosError<void | AsError>\n>(\n orgId: string,\n unitId: string,\n options?: {\n query?: UseQueryOptions<\n AsyncReturnType<typeof appApiUnitGetUnit>,\n TError,\n TData\n >;\n axios?: AxiosRequestConfig;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, axios: axiosOptions } = options || {};\n\n const queryKey =\n queryOptions?.queryKey ?? getAppApiUnitGetUnitQueryKey(orgId, unitId);\n\n const queryFn: QueryFunction<\n AsyncReturnType<typeof appApiUnitGetUnit>\n > = () => appApiUnitGetUnit(orgId, unitId, axiosOptions);\n\n const query = useQuery<\n AsyncReturnType<typeof appApiUnitGetUnit>,\n TError,\n TData\n >(queryKey, queryFn, { enabled: !!(orgId && unitId), ...queryOptions });\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Deletes an Organisational Unit you have access to. Units can only be deleted by Organisation users or Admin users. You cannot delete a Unit that contains Products\n\n * @summary Deletes an Organisational Unit\n */\nexport const appApiUnitDelete = (\n orgId: string,\n unitId: string,\n options?: AxiosRequestConfig\n): Promise<AxiosResponse<void>> => {\n return axios.delete(`/organisation/${orgId}/unit/${unitId}`, options);\n};\n\nexport type AppApiUnitDeleteMutationResult = NonNullable<\n AsyncReturnType<typeof appApiUnitDelete>\n>;\n\nexport type AppApiUnitDeleteMutationError = AxiosError<AsError>;\n\nexport const useAppApiUnitDelete = <\n TError = AxiosError<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof appApiUnitDelete>,\n TError,\n { orgId: string; unitId: string },\n TContext\n >;\n axios?: AxiosRequestConfig;\n}) => {\n const { mutation: mutationOptions, axios: axiosOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof appApiUnitDelete>,\n { orgId: string; unitId: string }\n > = (props) => {\n const { orgId, unitId } = props || {};\n\n return appApiUnitDelete(orgId, unitId, axiosOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof appApiUnitDelete>,\n TError,\n { orgId: string; unitId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets all the Units that are public or you are a member of. Admin users can see all Units\n\n * @summary Gets Units\n */\nexport const appApiUnitGet = (\n options?: AxiosRequestConfig\n): Promise<AxiosResponse<UnitsGetResponse>> => {\n return axios.get(`/unit`, options);\n};\n\nexport const getAppApiUnitGetQueryKey = () => [`/unit`];\n\nexport type AppApiUnitGetQueryResult = NonNullable<\n AsyncReturnType<typeof appApiUnitGet>\n>;\nexport type AppApiUnitGetQueryError = AxiosError<void | AsError>;\n\nexport const useAppApiUnitGet = <\n TData = AsyncReturnType<typeof appApiUnitGet>,\n TError = AxiosError<void | AsError>\n>(options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof appApiUnitGet>, TError, TData>;\n axios?: AxiosRequestConfig;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, axios: axiosOptions } = options || {};\n\n const queryKey = queryOptions?.queryKey ?? getAppApiUnitGetQueryKey();\n\n const queryFn: QueryFunction<AsyncReturnType<typeof appApiUnitGet>> = () =>\n appApiUnitGet(axiosOptions);\n\n const query = useQuery<AsyncReturnType<typeof appApiUnitGet>, TError, TData>(\n queryKey,\n queryFn,\n queryOptions\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Creates a 'Personal' Unit for a User. The unit will belong to the built-in **Default** Organisation. Users can only have one Personal Unit and Personal Units cannot have other Users\n\n * @summary Create a new Independent User Unit\n */\nexport const appApiUnitPersonalPut = (\n options?: AxiosRequestConfig\n): Promise<AxiosResponse<PersonalUnitPutResponse>> => {\n return axios.put(`/unit`, undefined, options);\n};\n\nexport type AppApiUnitPersonalPutMutationResult = NonNullable<\n AsyncReturnType<typeof appApiUnitPersonalPut>\n>;\n\nexport type AppApiUnitPersonalPutMutationError = AxiosError<AsError | void>;\n\nexport const useAppApiUnitPersonalPut = <\n TError = AxiosError<AsError | void>,\n TVariables = void,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof appApiUnitPersonalPut>,\n TError,\n TVariables,\n TContext\n >;\n axios?: AxiosRequestConfig;\n}) => {\n const { mutation: mutationOptions, axios: axiosOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof appApiUnitPersonalPut>,\n TVariables\n > = () => {\n return appApiUnitPersonalPut(axiosOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof appApiUnitPersonalPut>,\n TError,\n TVariables,\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Deletes a 'Personal' Unit. It must be your Unit, which belongs to the Default Organisation\n\n * @summary Deletes an Independent Unit\n */\nexport const appApiUnitPersonalDelete = (\n options?: AxiosRequestConfig\n): Promise<AxiosResponse<void>> => {\n return axios.delete(`/unit`, options);\n};\n\nexport type AppApiUnitPersonalDeleteMutationResult = NonNullable<\n AsyncReturnType<typeof appApiUnitPersonalDelete>\n>;\n\nexport type AppApiUnitPersonalDeleteMutationError = AxiosError<AsError>;\n\nexport const useAppApiUnitPersonalDelete = <\n TError = AxiosError<AsError>,\n TVariables = void,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof appApiUnitPersonalDelete>,\n TError,\n TVariables,\n TContext\n >;\n axios?: AxiosRequestConfig;\n}) => {\n const { mutation: mutationOptions, axios: axiosOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof appApiUnitPersonalDelete>,\n TVariables\n > = () => {\n return appApiUnitPersonalDelete(axiosOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof appApiUnitPersonalDelete>,\n TError,\n TVariables,\n TContext\n >(mutationFn, mutationOptions);\n};\n"],"mappings":"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","names":[]}
|