@squonk/account-server-client 0.1.24-rc.1 → 0.1.27-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{custom-instance-4a108741.d.ts → account-server-api.schemas-e6c5f956.d.ts} +15 -20
- 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 +31 -31
- package/organisation/organisation.cjs.map +1 -1
- package/organisation/organisation.d.ts +37 -28
- package/organisation/organisation.js +38 -38
- package/organisation/organisation.js.map +1 -1
- package/package.json +14 -14
- package/product/product.cjs +64 -61
- package/product/product.cjs.map +1 -1
- package/product/product.d.ts +70 -40
- package/product/product.js +75 -72
- package/product/product.js.map +1 -1
- package/service/service.cjs +23 -21
- package/service/service.cjs.map +1 -1
- package/service/service.d.ts +19 -15
- package/service/service.js +26 -24
- package/service/service.js.map +1 -1
- package/src/account-server-api.schemas.ts +14 -1
- package/src/organisation/organisation.ts +86 -83
- package/src/product/product.ts +210 -145
- package/src/service/service.ts +64 -56
- package/src/state/state.ts +31 -32
- package/src/unit/unit.ts +170 -149
- package/src/user/user.ts +171 -160
- package/state/state.cjs +12 -12
- package/state/state.cjs.map +1 -1
- package/state/state.d.ts +12 -10
- package/state/state.js +13 -13
- package/state/state.js.map +1 -1
- package/unit/unit.cjs +54 -58
- package/unit/unit.cjs.map +1 -1
- package/unit/unit.d.ts +64 -49
- package/unit/unit.js +67 -71
- package/unit/unit.js.map +1 -1
- package/user/user.cjs +56 -56
- package/user/user.cjs.map +1 -1
- package/user/user.d.ts +69 -55
- package/user/user.js +69 -69
- 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/service/service.js
CHANGED
|
@@ -1,44 +1,46 @@
|
|
|
1
1
|
import {
|
|
2
|
-
__spreadValues
|
|
3
|
-
|
|
4
|
-
} from "../chunk-JR7F532L.js";
|
|
2
|
+
__spreadValues
|
|
3
|
+
} from "../chunk-GWBPVOL2.js";
|
|
5
4
|
|
|
6
5
|
// src/service/service.ts
|
|
6
|
+
import axios from "axios";
|
|
7
7
|
import {
|
|
8
8
|
useQuery
|
|
9
9
|
} from "react-query";
|
|
10
|
-
var
|
|
11
|
-
return
|
|
10
|
+
var appApiServiceGet = (options) => {
|
|
11
|
+
return axios.get(`/service`, options);
|
|
12
12
|
};
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
const { query: queryOptions,
|
|
16
|
-
const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ??
|
|
17
|
-
const queryFn = () =>
|
|
13
|
+
var getAppApiServiceGetQueryKey = () => [`/service`];
|
|
14
|
+
var useAppApiServiceGet = (options) => {
|
|
15
|
+
const { query: queryOptions, axios: axiosOptions } = options || {};
|
|
16
|
+
const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getAppApiServiceGetQueryKey();
|
|
17
|
+
const queryFn = () => appApiServiceGet(axiosOptions);
|
|
18
18
|
const query = useQuery(queryKey, queryFn, queryOptions);
|
|
19
19
|
return __spreadValues({
|
|
20
20
|
queryKey
|
|
21
21
|
}, query);
|
|
22
22
|
};
|
|
23
|
-
var
|
|
24
|
-
return
|
|
23
|
+
var appApiServiceGetId = (svcId, options) => {
|
|
24
|
+
return axios.get(`/service/${svcId}`, options);
|
|
25
25
|
};
|
|
26
|
-
var
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
const
|
|
31
|
-
const
|
|
26
|
+
var getAppApiServiceGetIdQueryKey = (svcId) => [
|
|
27
|
+
`/service/${svcId}`
|
|
28
|
+
];
|
|
29
|
+
var useAppApiServiceGetId = (svcId, options) => {
|
|
30
|
+
const { query: queryOptions, axios: axiosOptions } = options || {};
|
|
31
|
+
const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getAppApiServiceGetIdQueryKey(svcId);
|
|
32
|
+
const queryFn = () => appApiServiceGetId(svcId, axiosOptions);
|
|
33
|
+
const query = useQuery(queryKey, queryFn, __spreadValues({ enabled: !!svcId }, queryOptions));
|
|
32
34
|
return __spreadValues({
|
|
33
35
|
queryKey
|
|
34
36
|
}, query);
|
|
35
37
|
};
|
|
36
38
|
export {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
appApiServiceGet,
|
|
40
|
+
appApiServiceGetId,
|
|
41
|
+
getAppApiServiceGetIdQueryKey,
|
|
42
|
+
getAppApiServiceGetQueryKey,
|
|
43
|
+
useAppApiServiceGet,
|
|
44
|
+
useAppApiServiceGetId
|
|
43
45
|
};
|
|
44
46
|
//# sourceMappingURL=service.js.map
|
package/service/service.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/service/service.ts"],"sourcesContent":["/**\n * Generated by orval v6.
|
|
1
|
+
{"version":3,"sources":["../../src/service/service.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 UseQueryOptions,\n QueryFunction,\n UseQueryResult,\n QueryKey,\n} from \"react-query\";\nimport type {\n ServicesGetResponse,\n AsError,\n ServiceGetResponse,\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 services known to the Account Server\n\n * @summary Gets all Services\n */\nexport const appApiServiceGet = (\n options?: AxiosRequestConfig\n): Promise<AxiosResponse<ServicesGetResponse>> => {\n return axios.get(`/service`, options);\n};\n\nexport const getAppApiServiceGetQueryKey = () => [`/service`];\n\nexport type AppApiServiceGetQueryResult = NonNullable<\n AsyncReturnType<typeof appApiServiceGet>\n>;\nexport type AppApiServiceGetQueryError = AxiosError<AsError | void>;\n\nexport const useAppApiServiceGet = <\n TData = AsyncReturnType<typeof appApiServiceGet>,\n TError = AxiosError<AsError | void>\n>(options?: {\n query?: UseQueryOptions<\n AsyncReturnType<typeof appApiServiceGet>,\n TError,\n TData\n >;\n axios?: AxiosRequestConfig;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, axios: axiosOptions } = options || {};\n\n const queryKey = queryOptions?.queryKey ?? getAppApiServiceGetQueryKey();\n\n const queryFn: QueryFunction<AsyncReturnType<typeof appApiServiceGet>> = () =>\n appApiServiceGet(axiosOptions);\n\n const query = useQuery<\n AsyncReturnType<typeof appApiServiceGet>,\n TError,\n TData\n >(queryKey, queryFn, queryOptions);\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Gets a known service\n\n * @summary Gets a specific Service\n */\nexport const appApiServiceGetId = (\n svcId: number,\n options?: AxiosRequestConfig\n): Promise<AxiosResponse<ServiceGetResponse>> => {\n return axios.get(`/service/${svcId}`, options);\n};\n\nexport const getAppApiServiceGetIdQueryKey = (svcId: number) => [\n `/service/${svcId}`,\n];\n\nexport type AppApiServiceGetIdQueryResult = NonNullable<\n AsyncReturnType<typeof appApiServiceGetId>\n>;\nexport type AppApiServiceGetIdQueryError = AxiosError<AsError | void>;\n\nexport const useAppApiServiceGetId = <\n TData = AsyncReturnType<typeof appApiServiceGetId>,\n TError = AxiosError<AsError | void>\n>(\n svcId: number,\n options?: {\n query?: UseQueryOptions<\n AsyncReturnType<typeof appApiServiceGetId>,\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 ?? getAppApiServiceGetIdQueryKey(svcId);\n\n const queryFn: QueryFunction<\n AsyncReturnType<typeof appApiServiceGetId>\n > = () => appApiServiceGetId(svcId, axiosOptions);\n\n const query = useQuery<\n AsyncReturnType<typeof appApiServiceGetId>,\n TError,\n TData\n >(queryKey, queryFn, { enabled: !!svcId, ...queryOptions });\n\n return {\n queryKey,\n ...query,\n };\n};\n"],"mappings":";;;;;AAUA;AACA;AAAA;AAAA;AAyBO,IAAM,mBAAmB,CAC9B,YACgD;AAChD,SAAO,MAAM,IAAI,YAAY,OAAO;AACtC;AAEO,IAAM,8BAA8B,MAAM,CAAC,UAAU;AAOrD,IAAM,sBAAsB,CAGjC,YAO4D;AAC5D,QAAM,EAAE,OAAO,cAAc,OAAO,iBAAiB,WAAW,CAAC;AAEjE,QAAM,WAAW,8CAAc,aAAY,4BAA4B;AAEvE,QAAM,UAAmE,MACvE,iBAAiB,YAAY;AAE/B,QAAM,QAAQ,SAIZ,UAAU,SAAS,YAAY;AAEjC,SAAO;AAAA,IACL;AAAA,KACG;AAEP;AAOO,IAAM,qBAAqB,CAChC,OACA,YAC+C;AAC/C,SAAO,MAAM,IAAI,YAAY,SAAS,OAAO;AAC/C;AAEO,IAAM,gCAAgC,CAAC,UAAkB;AAAA,EAC9D,YAAY;AACd;AAOO,IAAM,wBAAwB,CAInC,OACA,YAQ2D;AAC3D,QAAM,EAAE,OAAO,cAAc,OAAO,iBAAiB,WAAW,CAAC;AAEjE,QAAM,WACJ,8CAAc,aAAY,8BAA8B,KAAK;AAE/D,QAAM,UAEF,MAAM,mBAAmB,OAAO,YAAY;AAEhD,QAAM,QAAQ,SAIZ,UAAU,SAAS,iBAAE,SAAS,CAAC,CAAC,SAAU,aAAc;AAE1D,SAAO;AAAA,IACL;AAAA,KACG;AAEP;","names":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Generated by orval v6.
|
|
2
|
+
* Generated by orval v6.7.1 🍺
|
|
3
3
|
* Do not edit manually.
|
|
4
4
|
* Account Server API
|
|
5
5
|
* The Informatics Matters Account Server API.
|
|
@@ -94,12 +94,16 @@ export interface UserAccountDetail {
|
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
export interface UnitDetail {
|
|
97
|
+
/** Whether the user making the API call is a member of the Unit */
|
|
98
|
+
caller_is_member: boolean;
|
|
97
99
|
/** The Unit's unique identity */
|
|
98
100
|
id: string;
|
|
99
101
|
/** The Unit's name */
|
|
100
102
|
name: string;
|
|
101
103
|
/** The Unit's owner (a username) */
|
|
102
104
|
owner_id: string;
|
|
105
|
+
/** True if the Unit is private */
|
|
106
|
+
private: boolean;
|
|
103
107
|
}
|
|
104
108
|
|
|
105
109
|
/**
|
|
@@ -128,12 +132,16 @@ export interface ServicesGetResponse {
|
|
|
128
132
|
}
|
|
129
133
|
|
|
130
134
|
export interface OrganisationDetail {
|
|
135
|
+
/** Whether the user making the API call is a member of the Unit */
|
|
136
|
+
caller_is_member: boolean;
|
|
131
137
|
/** The Organisation's unique ID */
|
|
132
138
|
id: string;
|
|
133
139
|
/** The Organisation's name */
|
|
134
140
|
name: string;
|
|
135
141
|
/** The username of the Organisation's owner. Not all Organisations have an owner. The Default Organisation has no owner. */
|
|
136
142
|
owner_id?: string;
|
|
143
|
+
/** True if the Unit is private */
|
|
144
|
+
private: boolean;
|
|
137
145
|
}
|
|
138
146
|
|
|
139
147
|
export interface ProductType {
|
|
@@ -349,12 +357,17 @@ export interface OrganisationUnitPostResponse {
|
|
|
349
357
|
}
|
|
350
358
|
|
|
351
359
|
export interface OrganisationGetDefaultResponse {
|
|
360
|
+
/** Whether the user making the API call is a member of the Default Organisation. Only admin users are members of the Default organisation */
|
|
361
|
+
caller_is_member: boolean;
|
|
352
362
|
/** The Default Organisation ID
|
|
353
363
|
*/
|
|
354
364
|
id: string;
|
|
355
365
|
/** The Default Organisation Name
|
|
356
366
|
*/
|
|
357
367
|
name: string;
|
|
368
|
+
/** True if the Organisation is private. The Default organisation is always public, although it does not contain a membership (unless you're admin) and only houses Personal Units
|
|
369
|
+
*/
|
|
370
|
+
private: boolean;
|
|
358
371
|
}
|
|
359
372
|
|
|
360
373
|
export interface UsersGetResponse {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Generated by orval v6.
|
|
2
|
+
* Generated by orval v6.7.1 🍺
|
|
3
3
|
* Do not edit manually.
|
|
4
4
|
* Account Server API
|
|
5
5
|
* The Informatics Matters Account Server API.
|
|
@@ -8,6 +8,7 @@ A service that provides access to the Account Server, which gives *registered* u
|
|
|
8
8
|
|
|
9
9
|
* OpenAPI spec version: 0.1
|
|
10
10
|
*/
|
|
11
|
+
import axios, { AxiosRequestConfig, AxiosResponse, AxiosError } from "axios";
|
|
11
12
|
import {
|
|
12
13
|
useQuery,
|
|
13
14
|
useMutation,
|
|
@@ -25,7 +26,6 @@ import type {
|
|
|
25
26
|
OrganisationPostBodyBody,
|
|
26
27
|
OrganisationGetDefaultResponse,
|
|
27
28
|
} from "../account-server-api.schemas";
|
|
28
|
-
import { customInstance, ErrorType } from ".././custom-instance";
|
|
29
29
|
|
|
30
30
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
31
31
|
type AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (
|
|
@@ -34,50 +34,45 @@ type AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (
|
|
|
34
34
|
? R
|
|
35
35
|
: any;
|
|
36
36
|
|
|
37
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
38
|
-
type SecondParameter<T extends (...args: any) => any> = T extends (
|
|
39
|
-
config: any,
|
|
40
|
-
args: infer P
|
|
41
|
-
) => any
|
|
42
|
-
? P
|
|
43
|
-
: never;
|
|
44
|
-
|
|
45
37
|
/**
|
|
46
|
-
* Gets all the Organisations you are a member of. Admin users can see all Organisations
|
|
38
|
+
* Gets all the Organisations that you are a member of or are public. Admin users are members of all organisation and can see all Organisations
|
|
47
39
|
|
|
48
40
|
* @summary Gets Organisations
|
|
49
41
|
*/
|
|
50
|
-
export const
|
|
51
|
-
options?:
|
|
52
|
-
) => {
|
|
53
|
-
return
|
|
54
|
-
{ url: `/organisation`, method: "get" },
|
|
55
|
-
options
|
|
56
|
-
);
|
|
42
|
+
export const appApiOrganisationGet = (
|
|
43
|
+
options?: AxiosRequestConfig
|
|
44
|
+
): Promise<AxiosResponse<OrganisationsGetResponse>> => {
|
|
45
|
+
return axios.get(`/organisation`, options);
|
|
57
46
|
};
|
|
58
47
|
|
|
59
|
-
export const
|
|
48
|
+
export const getAppApiOrganisationGetQueryKey = () => [`/organisation`];
|
|
60
49
|
|
|
61
|
-
export
|
|
62
|
-
|
|
63
|
-
|
|
50
|
+
export type AppApiOrganisationGetQueryResult = NonNullable<
|
|
51
|
+
AsyncReturnType<typeof appApiOrganisationGet>
|
|
52
|
+
>;
|
|
53
|
+
export type AppApiOrganisationGetQueryError = AxiosError<void | AsError>;
|
|
54
|
+
|
|
55
|
+
export const useAppApiOrganisationGet = <
|
|
56
|
+
TData = AsyncReturnType<typeof appApiOrganisationGet>,
|
|
57
|
+
TError = AxiosError<void | AsError>
|
|
64
58
|
>(options?: {
|
|
65
59
|
query?: UseQueryOptions<
|
|
66
|
-
AsyncReturnType<typeof
|
|
60
|
+
AsyncReturnType<typeof appApiOrganisationGet>,
|
|
67
61
|
TError,
|
|
68
62
|
TData
|
|
69
63
|
>;
|
|
70
|
-
|
|
64
|
+
axios?: AxiosRequestConfig;
|
|
71
65
|
}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
72
|
-
const { query: queryOptions,
|
|
66
|
+
const { query: queryOptions, axios: axiosOptions } = options || {};
|
|
73
67
|
|
|
74
|
-
const queryKey = queryOptions?.queryKey ??
|
|
68
|
+
const queryKey = queryOptions?.queryKey ?? getAppApiOrganisationGetQueryKey();
|
|
75
69
|
|
|
76
|
-
const queryFn: QueryFunction<
|
|
77
|
-
|
|
70
|
+
const queryFn: QueryFunction<
|
|
71
|
+
AsyncReturnType<typeof appApiOrganisationGet>
|
|
72
|
+
> = () => appApiOrganisationGet(axiosOptions);
|
|
78
73
|
|
|
79
74
|
const query = useQuery<
|
|
80
|
-
AsyncReturnType<typeof
|
|
75
|
+
AsyncReturnType<typeof appApiOrganisationGet>,
|
|
81
76
|
TError,
|
|
82
77
|
TData
|
|
83
78
|
>(queryKey, queryFn, queryOptions);
|
|
@@ -95,41 +90,44 @@ You need **admin** rights to use this method
|
|
|
95
90
|
|
|
96
91
|
* @summary Create a new organisation
|
|
97
92
|
*/
|
|
98
|
-
export const
|
|
93
|
+
export const appApiOrganisationPost = (
|
|
99
94
|
organisationPostBodyBody: OrganisationPostBodyBody,
|
|
100
|
-
options?:
|
|
101
|
-
) => {
|
|
102
|
-
return
|
|
103
|
-
{ url: `/organisation`, method: "post", data: organisationPostBodyBody },
|
|
104
|
-
options
|
|
105
|
-
);
|
|
95
|
+
options?: AxiosRequestConfig
|
|
96
|
+
): Promise<AxiosResponse<OrganisationPostResponse>> => {
|
|
97
|
+
return axios.post(`/organisation`, organisationPostBodyBody, options);
|
|
106
98
|
};
|
|
107
99
|
|
|
108
|
-
export
|
|
109
|
-
|
|
100
|
+
export type AppApiOrganisationPostMutationResult = NonNullable<
|
|
101
|
+
AsyncReturnType<typeof appApiOrganisationPost>
|
|
102
|
+
>;
|
|
103
|
+
export type AppApiOrganisationPostMutationBody = OrganisationPostBodyBody;
|
|
104
|
+
export type AppApiOrganisationPostMutationError = AxiosError<AsError | void>;
|
|
105
|
+
|
|
106
|
+
export const useAppApiOrganisationPost = <
|
|
107
|
+
TError = AxiosError<AsError | void>,
|
|
110
108
|
TContext = unknown
|
|
111
109
|
>(options?: {
|
|
112
110
|
mutation?: UseMutationOptions<
|
|
113
|
-
AsyncReturnType<typeof
|
|
111
|
+
AsyncReturnType<typeof appApiOrganisationPost>,
|
|
114
112
|
TError,
|
|
115
113
|
{ data: OrganisationPostBodyBody },
|
|
116
114
|
TContext
|
|
117
115
|
>;
|
|
118
|
-
|
|
116
|
+
axios?: AxiosRequestConfig;
|
|
119
117
|
}) => {
|
|
120
|
-
const { mutation: mutationOptions,
|
|
118
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options || {};
|
|
121
119
|
|
|
122
120
|
const mutationFn: MutationFunction<
|
|
123
|
-
AsyncReturnType<typeof
|
|
121
|
+
AsyncReturnType<typeof appApiOrganisationPost>,
|
|
124
122
|
{ data: OrganisationPostBodyBody }
|
|
125
123
|
> = (props) => {
|
|
126
124
|
const { data } = props || {};
|
|
127
125
|
|
|
128
|
-
return
|
|
126
|
+
return appApiOrganisationPost(data, axiosOptions);
|
|
129
127
|
};
|
|
130
128
|
|
|
131
129
|
return useMutation<
|
|
132
|
-
AsyncReturnType<typeof
|
|
130
|
+
AsyncReturnType<typeof appApiOrganisationPost>,
|
|
133
131
|
TError,
|
|
134
132
|
{ data: OrganisationPostBodyBody },
|
|
135
133
|
TContext
|
|
@@ -142,86 +140,91 @@ You need **admin** rights to use this method
|
|
|
142
140
|
|
|
143
141
|
* @summary Deletes an Organisation
|
|
144
142
|
*/
|
|
145
|
-
export const
|
|
146
|
-
|
|
147
|
-
options?:
|
|
148
|
-
) => {
|
|
149
|
-
return
|
|
150
|
-
{ url: `/organisation/${orgid}`, method: "delete" },
|
|
151
|
-
options
|
|
152
|
-
);
|
|
143
|
+
export const appApiOrganisationDelete = (
|
|
144
|
+
orgId: string,
|
|
145
|
+
options?: AxiosRequestConfig
|
|
146
|
+
): Promise<AxiosResponse<void>> => {
|
|
147
|
+
return axios.delete(`/organisation/${orgId}`, options);
|
|
153
148
|
};
|
|
154
149
|
|
|
155
|
-
export
|
|
156
|
-
|
|
150
|
+
export type AppApiOrganisationDeleteMutationResult = NonNullable<
|
|
151
|
+
AsyncReturnType<typeof appApiOrganisationDelete>
|
|
152
|
+
>;
|
|
153
|
+
|
|
154
|
+
export type AppApiOrganisationDeleteMutationError = AxiosError<AsError>;
|
|
155
|
+
|
|
156
|
+
export const useAppApiOrganisationDelete = <
|
|
157
|
+
TError = AxiosError<AsError>,
|
|
157
158
|
TContext = unknown
|
|
158
159
|
>(options?: {
|
|
159
160
|
mutation?: UseMutationOptions<
|
|
160
|
-
AsyncReturnType<typeof
|
|
161
|
+
AsyncReturnType<typeof appApiOrganisationDelete>,
|
|
161
162
|
TError,
|
|
162
|
-
{
|
|
163
|
+
{ orgId: string },
|
|
163
164
|
TContext
|
|
164
165
|
>;
|
|
165
|
-
|
|
166
|
+
axios?: AxiosRequestConfig;
|
|
166
167
|
}) => {
|
|
167
|
-
const { mutation: mutationOptions,
|
|
168
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options || {};
|
|
168
169
|
|
|
169
170
|
const mutationFn: MutationFunction<
|
|
170
|
-
AsyncReturnType<typeof
|
|
171
|
-
{
|
|
171
|
+
AsyncReturnType<typeof appApiOrganisationDelete>,
|
|
172
|
+
{ orgId: string }
|
|
172
173
|
> = (props) => {
|
|
173
|
-
const {
|
|
174
|
+
const { orgId } = props || {};
|
|
174
175
|
|
|
175
|
-
return
|
|
176
|
+
return appApiOrganisationDelete(orgId, axiosOptions);
|
|
176
177
|
};
|
|
177
178
|
|
|
178
179
|
return useMutation<
|
|
179
|
-
AsyncReturnType<typeof
|
|
180
|
+
AsyncReturnType<typeof appApiOrganisationDelete>,
|
|
180
181
|
TError,
|
|
181
|
-
{
|
|
182
|
+
{ orgId: string },
|
|
182
183
|
TContext
|
|
183
184
|
>(mutationFn, mutationOptions);
|
|
184
185
|
};
|
|
185
186
|
/**
|
|
186
|
-
* Gets the built-in Default Organisation, used exclusively for
|
|
187
|
+
* Gets the built-in Default Organisation, used exclusively for Personal Units
|
|
187
188
|
|
|
188
189
|
* @summary Gets the (built-in) Default Organisation
|
|
189
190
|
*/
|
|
190
|
-
export const
|
|
191
|
-
options?:
|
|
192
|
-
) => {
|
|
193
|
-
return
|
|
194
|
-
{ url: `/organisation/default`, method: "get" },
|
|
195
|
-
options
|
|
196
|
-
);
|
|
191
|
+
export const appApiOrganisationGetDefault = (
|
|
192
|
+
options?: AxiosRequestConfig
|
|
193
|
+
): Promise<AxiosResponse<OrganisationGetDefaultResponse>> => {
|
|
194
|
+
return axios.get(`/organisation/default`, options);
|
|
197
195
|
};
|
|
198
196
|
|
|
199
|
-
export const
|
|
197
|
+
export const getAppApiOrganisationGetDefaultQueryKey = () => [
|
|
200
198
|
`/organisation/default`,
|
|
201
199
|
];
|
|
202
200
|
|
|
203
|
-
export
|
|
204
|
-
|
|
205
|
-
|
|
201
|
+
export type AppApiOrganisationGetDefaultQueryResult = NonNullable<
|
|
202
|
+
AsyncReturnType<typeof appApiOrganisationGetDefault>
|
|
203
|
+
>;
|
|
204
|
+
export type AppApiOrganisationGetDefaultQueryError = AxiosError<void | AsError>;
|
|
205
|
+
|
|
206
|
+
export const useAppApiOrganisationGetDefault = <
|
|
207
|
+
TData = AsyncReturnType<typeof appApiOrganisationGetDefault>,
|
|
208
|
+
TError = AxiosError<void | AsError>
|
|
206
209
|
>(options?: {
|
|
207
210
|
query?: UseQueryOptions<
|
|
208
|
-
AsyncReturnType<typeof
|
|
211
|
+
AsyncReturnType<typeof appApiOrganisationGetDefault>,
|
|
209
212
|
TError,
|
|
210
213
|
TData
|
|
211
214
|
>;
|
|
212
|
-
|
|
215
|
+
axios?: AxiosRequestConfig;
|
|
213
216
|
}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
214
|
-
const { query: queryOptions,
|
|
217
|
+
const { query: queryOptions, axios: axiosOptions } = options || {};
|
|
215
218
|
|
|
216
219
|
const queryKey =
|
|
217
|
-
queryOptions?.queryKey ??
|
|
220
|
+
queryOptions?.queryKey ?? getAppApiOrganisationGetDefaultQueryKey();
|
|
218
221
|
|
|
219
222
|
const queryFn: QueryFunction<
|
|
220
|
-
AsyncReturnType<typeof
|
|
221
|
-
> = () =>
|
|
223
|
+
AsyncReturnType<typeof appApiOrganisationGetDefault>
|
|
224
|
+
> = () => appApiOrganisationGetDefault(axiosOptions);
|
|
222
225
|
|
|
223
226
|
const query = useQuery<
|
|
224
|
-
AsyncReturnType<typeof
|
|
227
|
+
AsyncReturnType<typeof appApiOrganisationGetDefault>,
|
|
225
228
|
TError,
|
|
226
229
|
TData
|
|
227
230
|
>(queryKey, queryFn, queryOptions);
|