@squonk/account-server-client 3.1.0-alpha.3 → 4.0.0-beta.2
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/asset/asset.cjs +24 -24
- package/asset/asset.cjs.map +1 -1
- package/asset/asset.d.cts +137 -102
- package/asset/asset.d.ts +137 -102
- package/asset/asset.js +24 -24
- package/asset/asset.js.map +1 -1
- package/charges/charges.cjs +16 -16
- package/charges/charges.cjs.map +1 -1
- package/charges/charges.d.cts +137 -65
- package/charges/charges.d.ts +137 -65
- package/charges/charges.js +16 -16
- package/charges/charges.js.map +1 -1
- package/chunk-TKLTUR4R.cjs.map +1 -1
- package/event-stream/event-stream.cjs +8 -8
- package/event-stream/event-stream.cjs.map +1 -1
- package/event-stream/event-stream.d.cts +82 -47
- package/event-stream/event-stream.d.ts +82 -47
- package/event-stream/event-stream.js +8 -8
- package/event-stream/event-stream.js.map +1 -1
- package/index.cjs.map +1 -1
- package/index.d.cts +62 -14
- package/index.d.ts +62 -14
- package/index.js.map +1 -1
- package/merchant/merchant.cjs +8 -8
- package/merchant/merchant.cjs.map +1 -1
- package/merchant/merchant.d.cts +69 -33
- package/merchant/merchant.d.ts +69 -33
- package/merchant/merchant.js +8 -8
- package/merchant/merchant.js.map +1 -1
- package/organisation/organisation.cjs +14 -14
- package/organisation/organisation.cjs.map +1 -1
- package/organisation/organisation.d.cts +128 -75
- package/organisation/organisation.d.ts +128 -75
- package/organisation/organisation.js +14 -14
- package/organisation/organisation.js.map +1 -1
- package/package.json +7 -7
- package/product/product.cjs +24 -24
- package/product/product.cjs.map +1 -1
- package/product/product.d.cts +229 -122
- package/product/product.d.ts +229 -122
- package/product/product.js +24 -24
- package/product/product.js.map +1 -1
- package/src/account-server-api.schemas.ts +63 -14
- package/src/asset/asset.ts +185 -65
- package/src/charges/charges.ts +200 -18
- package/src/event-stream/event-stream.ts +114 -19
- package/src/merchant/merchant.ts +94 -10
- package/src/organisation/organisation.ts +171 -31
- package/src/product/product.ts +301 -41
- package/src/state/state.ts +50 -6
- package/src/unit/unit.ts +188 -38
- package/src/user/user.ts +183 -38
- package/state/state.cjs +4 -4
- package/state/state.cjs.map +1 -1
- package/state/state.d.cts +35 -17
- package/state/state.d.ts +35 -17
- package/state/state.js +4 -4
- package/state/state.js.map +1 -1
- package/unit/unit.cjs +12 -12
- package/unit/unit.cjs.map +1 -1
- package/unit/unit.d.cts +140 -87
- package/unit/unit.d.ts +140 -87
- package/unit/unit.js +12 -12
- package/unit/unit.js.map +1 -1
- package/user/user.cjs +12 -12
- package/user/user.cjs.map +1 -1
- package/user/user.d.cts +139 -86
- package/user/user.d.ts +139 -86
- package/user/user.js +12 -12
- package/user/user.js.map +1 -1
package/unit/unit.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { UseQueryOptions, QueryKey, UseQueryResult, UseSuspenseQueryOptions, UseSuspenseQueryResult, UseMutationOptions } from '@tanstack/react-query';
|
|
1
|
+
import { UseQueryOptions, QueryKey, DefinedInitialDataOptions, DefinedUseQueryResult, UndefinedInitialDataOptions, UseQueryResult, UseSuspenseQueryOptions, UseSuspenseQueryResult, UseMutationOptions, UseMutationResult } from '@tanstack/react-query';
|
|
3
2
|
import { customInstance, OrganisationUnitsGetResponse, ErrorType, AsError, OrganisationUnitPostBodyBody, OrganisationUnitPostResponse, UnitAllDetail, UnitPatchBodyBody, UnitsGetResponse, PersonalUnitPutBodyBody, PersonalUnitPutResponse } from '../index.js';
|
|
4
3
|
import 'axios';
|
|
5
4
|
|
|
@@ -12,37 +11,55 @@ type SecondParameter<T extends (...args: any) => any> = Parameters<T>[1];
|
|
|
12
11
|
declare const getOrganisationUnits: (orgId: string, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<OrganisationUnitsGetResponse>;
|
|
13
12
|
declare const getGetOrganisationUnitsQueryKey: (orgId: string) => readonly ["account-server-api", `/organisation/${string}/unit`];
|
|
14
13
|
declare const getGetOrganisationUnitsQueryOptions: <TData = OrganisationUnitsGetResponse, TError = ErrorType<void | AsError>>(orgId: string, options?: {
|
|
15
|
-
query?: Partial<UseQueryOptions<
|
|
14
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnits>>, TError, TData>>;
|
|
16
15
|
request?: SecondParameter<typeof customInstance>;
|
|
17
|
-
}
|
|
16
|
+
}) => UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnits>>, TError, TData> & {
|
|
18
17
|
queryKey: QueryKey;
|
|
19
18
|
};
|
|
20
19
|
type GetOrganisationUnitsQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisationUnits>>>;
|
|
21
20
|
type GetOrganisationUnitsQueryError = ErrorType<void | AsError>;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
*/
|
|
25
|
-
declare const useGetOrganisationUnits: <TData = OrganisationUnitsGetResponse, TError = ErrorType<void | AsError>>(orgId: string, options?: {
|
|
26
|
-
query?: Partial<UseQueryOptions<OrganisationUnitsGetResponse, TError, TData, QueryKey>> | undefined;
|
|
21
|
+
declare function useGetOrganisationUnits<TData = Awaited<ReturnType<typeof getOrganisationUnits>>, TError = ErrorType<void | AsError>>(orgId: string, options: {
|
|
22
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnits>>, TError, TData>> & Pick<DefinedInitialDataOptions<Awaited<ReturnType<typeof getOrganisationUnits>>, TError, TData>, 'initialData'>;
|
|
27
23
|
request?: SecondParameter<typeof customInstance>;
|
|
28
|
-
}
|
|
24
|
+
}): DefinedUseQueryResult<TData, TError> & {
|
|
25
|
+
queryKey: QueryKey;
|
|
26
|
+
};
|
|
27
|
+
declare function useGetOrganisationUnits<TData = Awaited<ReturnType<typeof getOrganisationUnits>>, TError = ErrorType<void | AsError>>(orgId: string, options?: {
|
|
28
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnits>>, TError, TData>> & Pick<UndefinedInitialDataOptions<Awaited<ReturnType<typeof getOrganisationUnits>>, TError, TData>, 'initialData'>;
|
|
29
|
+
request?: SecondParameter<typeof customInstance>;
|
|
30
|
+
}): UseQueryResult<TData, TError> & {
|
|
31
|
+
queryKey: QueryKey;
|
|
32
|
+
};
|
|
33
|
+
declare function useGetOrganisationUnits<TData = Awaited<ReturnType<typeof getOrganisationUnits>>, TError = ErrorType<void | AsError>>(orgId: string, options?: {
|
|
34
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnits>>, TError, TData>>;
|
|
35
|
+
request?: SecondParameter<typeof customInstance>;
|
|
36
|
+
}): UseQueryResult<TData, TError> & {
|
|
29
37
|
queryKey: QueryKey;
|
|
30
38
|
};
|
|
31
39
|
declare const getGetOrganisationUnitsSuspenseQueryOptions: <TData = OrganisationUnitsGetResponse, TError = ErrorType<void | AsError>>(orgId: string, options?: {
|
|
32
|
-
query?: Partial<UseSuspenseQueryOptions<
|
|
40
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnits>>, TError, TData>>;
|
|
33
41
|
request?: SecondParameter<typeof customInstance>;
|
|
34
|
-
}
|
|
42
|
+
}) => UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnits>>, TError, TData> & {
|
|
35
43
|
queryKey: QueryKey;
|
|
36
44
|
};
|
|
37
45
|
type GetOrganisationUnitsSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisationUnits>>>;
|
|
38
46
|
type GetOrganisationUnitsSuspenseQueryError = ErrorType<void | AsError>;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
*/
|
|
42
|
-
declare const useGetOrganisationUnitsSuspense: <TData = OrganisationUnitsGetResponse, TError = ErrorType<void | AsError>>(orgId: string, options?: {
|
|
43
|
-
query?: Partial<UseSuspenseQueryOptions<OrganisationUnitsGetResponse, TError, TData, QueryKey>> | undefined;
|
|
47
|
+
declare function useGetOrganisationUnitsSuspense<TData = Awaited<ReturnType<typeof getOrganisationUnits>>, TError = ErrorType<void | AsError>>(orgId: string, options: {
|
|
48
|
+
query: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnits>>, TError, TData>>;
|
|
44
49
|
request?: SecondParameter<typeof customInstance>;
|
|
45
|
-
}
|
|
50
|
+
}): UseSuspenseQueryResult<TData, TError> & {
|
|
51
|
+
queryKey: QueryKey;
|
|
52
|
+
};
|
|
53
|
+
declare function useGetOrganisationUnitsSuspense<TData = Awaited<ReturnType<typeof getOrganisationUnits>>, TError = ErrorType<void | AsError>>(orgId: string, options?: {
|
|
54
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnits>>, TError, TData>>;
|
|
55
|
+
request?: SecondParameter<typeof customInstance>;
|
|
56
|
+
}): UseSuspenseQueryResult<TData, TError> & {
|
|
57
|
+
queryKey: QueryKey;
|
|
58
|
+
};
|
|
59
|
+
declare function useGetOrganisationUnitsSuspense<TData = Awaited<ReturnType<typeof getOrganisationUnits>>, TError = ErrorType<void | AsError>>(orgId: string, options?: {
|
|
60
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnits>>, TError, TData>>;
|
|
61
|
+
request?: SecondParameter<typeof customInstance>;
|
|
62
|
+
}): UseSuspenseQueryResult<TData, TError> & {
|
|
46
63
|
queryKey: QueryKey;
|
|
47
64
|
};
|
|
48
65
|
/**
|
|
@@ -56,12 +73,12 @@ You need to be a member of the **Organisation** or have administration rights t
|
|
|
56
73
|
*/
|
|
57
74
|
declare const createOrganisationUnit: (orgId: string, organisationUnitPostBodyBody: OrganisationUnitPostBodyBody, options?: SecondParameter<typeof customInstance>) => Promise<OrganisationUnitPostResponse>;
|
|
58
75
|
declare const getCreateOrganisationUnitMutationOptions: <TError = ErrorType<void | AsError>, TContext = unknown>(options?: {
|
|
59
|
-
mutation?: UseMutationOptions<
|
|
76
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof createOrganisationUnit>>, TError, {
|
|
60
77
|
orgId: string;
|
|
61
78
|
data: OrganisationUnitPostBodyBody;
|
|
62
|
-
}, TContext
|
|
79
|
+
}, TContext>;
|
|
63
80
|
request?: SecondParameter<typeof customInstance>;
|
|
64
|
-
}
|
|
81
|
+
}) => UseMutationOptions<Awaited<ReturnType<typeof createOrganisationUnit>>, TError, {
|
|
65
82
|
orgId: string;
|
|
66
83
|
data: OrganisationUnitPostBodyBody;
|
|
67
84
|
}, TContext>;
|
|
@@ -72,12 +89,12 @@ type CreateOrganisationUnitMutationError = ErrorType<AsError | void>;
|
|
|
72
89
|
* @summary Create a new Organisational Unit
|
|
73
90
|
*/
|
|
74
91
|
declare const useCreateOrganisationUnit: <TError = ErrorType<void | AsError>, TContext = unknown>(options?: {
|
|
75
|
-
mutation?: UseMutationOptions<
|
|
92
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof createOrganisationUnit>>, TError, {
|
|
76
93
|
orgId: string;
|
|
77
94
|
data: OrganisationUnitPostBodyBody;
|
|
78
|
-
}, TContext
|
|
95
|
+
}, TContext>;
|
|
79
96
|
request?: SecondParameter<typeof customInstance>;
|
|
80
|
-
}
|
|
97
|
+
}) => UseMutationResult<Awaited<ReturnType<typeof createOrganisationUnit>>, TError, {
|
|
81
98
|
orgId: string;
|
|
82
99
|
data: OrganisationUnitPostBodyBody;
|
|
83
100
|
}, TContext>;
|
|
@@ -89,37 +106,55 @@ declare const useCreateOrganisationUnit: <TError = ErrorType<void | AsError>, TC
|
|
|
89
106
|
declare const getUnit: (unitId: string, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<UnitAllDetail>;
|
|
90
107
|
declare const getGetUnitQueryKey: (unitId: string) => readonly ["account-server-api", `/unit/${string}`];
|
|
91
108
|
declare const getGetUnitQueryOptions: <TData = UnitAllDetail, TError = ErrorType<void | AsError>>(unitId: string, options?: {
|
|
92
|
-
query?: Partial<UseQueryOptions<
|
|
109
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData>>;
|
|
93
110
|
request?: SecondParameter<typeof customInstance>;
|
|
94
|
-
}
|
|
111
|
+
}) => UseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData> & {
|
|
95
112
|
queryKey: QueryKey;
|
|
96
113
|
};
|
|
97
114
|
type GetUnitQueryResult = NonNullable<Awaited<ReturnType<typeof getUnit>>>;
|
|
98
115
|
type GetUnitQueryError = ErrorType<void | AsError>;
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
116
|
+
declare function useGetUnit<TData = Awaited<ReturnType<typeof getUnit>>, TError = ErrorType<void | AsError>>(unitId: string, options: {
|
|
117
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData>> & Pick<DefinedInitialDataOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData>, 'initialData'>;
|
|
118
|
+
request?: SecondParameter<typeof customInstance>;
|
|
119
|
+
}): DefinedUseQueryResult<TData, TError> & {
|
|
120
|
+
queryKey: QueryKey;
|
|
121
|
+
};
|
|
122
|
+
declare function useGetUnit<TData = Awaited<ReturnType<typeof getUnit>>, TError = ErrorType<void | AsError>>(unitId: string, options?: {
|
|
123
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData>> & Pick<UndefinedInitialDataOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData>, 'initialData'>;
|
|
124
|
+
request?: SecondParameter<typeof customInstance>;
|
|
125
|
+
}): UseQueryResult<TData, TError> & {
|
|
126
|
+
queryKey: QueryKey;
|
|
127
|
+
};
|
|
128
|
+
declare function useGetUnit<TData = Awaited<ReturnType<typeof getUnit>>, TError = ErrorType<void | AsError>>(unitId: string, options?: {
|
|
129
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData>>;
|
|
104
130
|
request?: SecondParameter<typeof customInstance>;
|
|
105
|
-
}
|
|
131
|
+
}): UseQueryResult<TData, TError> & {
|
|
106
132
|
queryKey: QueryKey;
|
|
107
133
|
};
|
|
108
134
|
declare const getGetUnitSuspenseQueryOptions: <TData = UnitAllDetail, TError = ErrorType<void | AsError>>(unitId: string, options?: {
|
|
109
|
-
query?: Partial<UseSuspenseQueryOptions<
|
|
135
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData>>;
|
|
110
136
|
request?: SecondParameter<typeof customInstance>;
|
|
111
|
-
}
|
|
137
|
+
}) => UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData> & {
|
|
112
138
|
queryKey: QueryKey;
|
|
113
139
|
};
|
|
114
140
|
type GetUnitSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getUnit>>>;
|
|
115
141
|
type GetUnitSuspenseQueryError = ErrorType<void | AsError>;
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
*/
|
|
119
|
-
declare const useGetUnitSuspense: <TData = UnitAllDetail, TError = ErrorType<void | AsError>>(unitId: string, options?: {
|
|
120
|
-
query?: Partial<UseSuspenseQueryOptions<UnitAllDetail, TError, TData, QueryKey>> | undefined;
|
|
142
|
+
declare function useGetUnitSuspense<TData = Awaited<ReturnType<typeof getUnit>>, TError = ErrorType<void | AsError>>(unitId: string, options: {
|
|
143
|
+
query: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData>>;
|
|
121
144
|
request?: SecondParameter<typeof customInstance>;
|
|
122
|
-
}
|
|
145
|
+
}): UseSuspenseQueryResult<TData, TError> & {
|
|
146
|
+
queryKey: QueryKey;
|
|
147
|
+
};
|
|
148
|
+
declare function useGetUnitSuspense<TData = Awaited<ReturnType<typeof getUnit>>, TError = ErrorType<void | AsError>>(unitId: string, options?: {
|
|
149
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData>>;
|
|
150
|
+
request?: SecondParameter<typeof customInstance>;
|
|
151
|
+
}): UseSuspenseQueryResult<TData, TError> & {
|
|
152
|
+
queryKey: QueryKey;
|
|
153
|
+
};
|
|
154
|
+
declare function useGetUnitSuspense<TData = Awaited<ReturnType<typeof getUnit>>, TError = ErrorType<void | AsError>>(unitId: string, options?: {
|
|
155
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData>>;
|
|
156
|
+
request?: SecondParameter<typeof customInstance>;
|
|
157
|
+
}): UseSuspenseQueryResult<TData, TError> & {
|
|
123
158
|
queryKey: QueryKey;
|
|
124
159
|
};
|
|
125
160
|
/**
|
|
@@ -130,29 +165,29 @@ You have to be a member of the **Unit**, a member of its **Organisation**, or an
|
|
|
130
165
|
* @summary Adjust an existing Unit
|
|
131
166
|
*/
|
|
132
167
|
declare const patchUnit: (unitId: string, unitPatchBodyBody: UnitPatchBodyBody, options?: SecondParameter<typeof customInstance>) => Promise<void>;
|
|
133
|
-
declare const getPatchUnitMutationOptions: <TError = ErrorType<AsError>, TContext = unknown>(options?: {
|
|
134
|
-
mutation?: UseMutationOptions<
|
|
168
|
+
declare const getPatchUnitMutationOptions: <TError = ErrorType<void | AsError>, TContext = unknown>(options?: {
|
|
169
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof patchUnit>>, TError, {
|
|
135
170
|
unitId: string;
|
|
136
171
|
data: UnitPatchBodyBody;
|
|
137
|
-
}, TContext
|
|
172
|
+
}, TContext>;
|
|
138
173
|
request?: SecondParameter<typeof customInstance>;
|
|
139
|
-
}
|
|
174
|
+
}) => UseMutationOptions<Awaited<ReturnType<typeof patchUnit>>, TError, {
|
|
140
175
|
unitId: string;
|
|
141
176
|
data: UnitPatchBodyBody;
|
|
142
177
|
}, TContext>;
|
|
143
178
|
type PatchUnitMutationResult = NonNullable<Awaited<ReturnType<typeof patchUnit>>>;
|
|
144
179
|
type PatchUnitMutationBody = UnitPatchBodyBody;
|
|
145
|
-
type PatchUnitMutationError = ErrorType<AsError>;
|
|
180
|
+
type PatchUnitMutationError = ErrorType<void | AsError>;
|
|
146
181
|
/**
|
|
147
182
|
* @summary Adjust an existing Unit
|
|
148
183
|
*/
|
|
149
|
-
declare const usePatchUnit: <TError = ErrorType<AsError>, TContext = unknown>(options?: {
|
|
150
|
-
mutation?: UseMutationOptions<
|
|
184
|
+
declare const usePatchUnit: <TError = ErrorType<void | AsError>, TContext = unknown>(options?: {
|
|
185
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof patchUnit>>, TError, {
|
|
151
186
|
unitId: string;
|
|
152
187
|
data: UnitPatchBodyBody;
|
|
153
|
-
}, TContext
|
|
188
|
+
}, TContext>;
|
|
154
189
|
request?: SecondParameter<typeof customInstance>;
|
|
155
|
-
}
|
|
190
|
+
}) => UseMutationResult<Awaited<ReturnType<typeof patchUnit>>, TError, {
|
|
156
191
|
unitId: string;
|
|
157
192
|
data: UnitPatchBodyBody;
|
|
158
193
|
}, TContext>;
|
|
@@ -166,25 +201,25 @@ You cannot delete a Unit that contains undeleted **Products**
|
|
|
166
201
|
* @summary Deletes an Organisational Unit
|
|
167
202
|
*/
|
|
168
203
|
declare const deleteOrganisationUnit: (unitId: string, options?: SecondParameter<typeof customInstance>) => Promise<void>;
|
|
169
|
-
declare const getDeleteOrganisationUnitMutationOptions: <TError = ErrorType<AsError>, TContext = unknown>(options?: {
|
|
170
|
-
mutation?: UseMutationOptions<
|
|
204
|
+
declare const getDeleteOrganisationUnitMutationOptions: <TError = ErrorType<void | AsError>, TContext = unknown>(options?: {
|
|
205
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof deleteOrganisationUnit>>, TError, {
|
|
171
206
|
unitId: string;
|
|
172
|
-
}, TContext
|
|
207
|
+
}, TContext>;
|
|
173
208
|
request?: SecondParameter<typeof customInstance>;
|
|
174
|
-
}
|
|
209
|
+
}) => UseMutationOptions<Awaited<ReturnType<typeof deleteOrganisationUnit>>, TError, {
|
|
175
210
|
unitId: string;
|
|
176
211
|
}, TContext>;
|
|
177
212
|
type DeleteOrganisationUnitMutationResult = NonNullable<Awaited<ReturnType<typeof deleteOrganisationUnit>>>;
|
|
178
|
-
type DeleteOrganisationUnitMutationError = ErrorType<AsError>;
|
|
213
|
+
type DeleteOrganisationUnitMutationError = ErrorType<void | AsError>;
|
|
179
214
|
/**
|
|
180
215
|
* @summary Deletes an Organisational Unit
|
|
181
216
|
*/
|
|
182
|
-
declare const useDeleteOrganisationUnit: <TError = ErrorType<AsError>, TContext = unknown>(options?: {
|
|
183
|
-
mutation?: UseMutationOptions<
|
|
217
|
+
declare const useDeleteOrganisationUnit: <TError = ErrorType<void | AsError>, TContext = unknown>(options?: {
|
|
218
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof deleteOrganisationUnit>>, TError, {
|
|
184
219
|
unitId: string;
|
|
185
|
-
}, TContext
|
|
220
|
+
}, TContext>;
|
|
186
221
|
request?: SecondParameter<typeof customInstance>;
|
|
187
|
-
}
|
|
222
|
+
}) => UseMutationResult<Awaited<ReturnType<typeof deleteOrganisationUnit>>, TError, {
|
|
188
223
|
unitId: string;
|
|
189
224
|
}, TContext>;
|
|
190
225
|
/**
|
|
@@ -197,37 +232,55 @@ You can see a Unit if you are a member of it, the owner (creator) of it, or a me
|
|
|
197
232
|
declare const getUnits: (options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<UnitsGetResponse>;
|
|
198
233
|
declare const getGetUnitsQueryKey: () => readonly ["account-server-api", "/unit"];
|
|
199
234
|
declare const getGetUnitsQueryOptions: <TData = UnitsGetResponse, TError = ErrorType<void | AsError>>(options?: {
|
|
200
|
-
query?: Partial<UseQueryOptions<
|
|
235
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData>>;
|
|
201
236
|
request?: SecondParameter<typeof customInstance>;
|
|
202
|
-
}
|
|
237
|
+
}) => UseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData> & {
|
|
203
238
|
queryKey: QueryKey;
|
|
204
239
|
};
|
|
205
240
|
type GetUnitsQueryResult = NonNullable<Awaited<ReturnType<typeof getUnits>>>;
|
|
206
241
|
type GetUnitsQueryError = ErrorType<void | AsError>;
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
*/
|
|
210
|
-
declare const useGetUnits: <TData = UnitsGetResponse, TError = ErrorType<void | AsError>>(options?: {
|
|
211
|
-
query?: Partial<UseQueryOptions<UnitsGetResponse, TError, TData, QueryKey>> | undefined;
|
|
242
|
+
declare function useGetUnits<TData = Awaited<ReturnType<typeof getUnits>>, TError = ErrorType<void | AsError>>(options: {
|
|
243
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData>> & Pick<DefinedInitialDataOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData>, 'initialData'>;
|
|
212
244
|
request?: SecondParameter<typeof customInstance>;
|
|
213
|
-
}
|
|
245
|
+
}): DefinedUseQueryResult<TData, TError> & {
|
|
246
|
+
queryKey: QueryKey;
|
|
247
|
+
};
|
|
248
|
+
declare function useGetUnits<TData = Awaited<ReturnType<typeof getUnits>>, TError = ErrorType<void | AsError>>(options?: {
|
|
249
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData>> & Pick<UndefinedInitialDataOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData>, 'initialData'>;
|
|
250
|
+
request?: SecondParameter<typeof customInstance>;
|
|
251
|
+
}): UseQueryResult<TData, TError> & {
|
|
252
|
+
queryKey: QueryKey;
|
|
253
|
+
};
|
|
254
|
+
declare function useGetUnits<TData = Awaited<ReturnType<typeof getUnits>>, TError = ErrorType<void | AsError>>(options?: {
|
|
255
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData>>;
|
|
256
|
+
request?: SecondParameter<typeof customInstance>;
|
|
257
|
+
}): UseQueryResult<TData, TError> & {
|
|
214
258
|
queryKey: QueryKey;
|
|
215
259
|
};
|
|
216
260
|
declare const getGetUnitsSuspenseQueryOptions: <TData = UnitsGetResponse, TError = ErrorType<void | AsError>>(options?: {
|
|
217
|
-
query?: Partial<UseSuspenseQueryOptions<
|
|
261
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData>>;
|
|
218
262
|
request?: SecondParameter<typeof customInstance>;
|
|
219
|
-
}
|
|
263
|
+
}) => UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData> & {
|
|
220
264
|
queryKey: QueryKey;
|
|
221
265
|
};
|
|
222
266
|
type GetUnitsSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getUnits>>>;
|
|
223
267
|
type GetUnitsSuspenseQueryError = ErrorType<void | AsError>;
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
268
|
+
declare function useGetUnitsSuspense<TData = Awaited<ReturnType<typeof getUnits>>, TError = ErrorType<void | AsError>>(options: {
|
|
269
|
+
query: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData>>;
|
|
270
|
+
request?: SecondParameter<typeof customInstance>;
|
|
271
|
+
}): UseSuspenseQueryResult<TData, TError> & {
|
|
272
|
+
queryKey: QueryKey;
|
|
273
|
+
};
|
|
274
|
+
declare function useGetUnitsSuspense<TData = Awaited<ReturnType<typeof getUnits>>, TError = ErrorType<void | AsError>>(options?: {
|
|
275
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData>>;
|
|
276
|
+
request?: SecondParameter<typeof customInstance>;
|
|
277
|
+
}): UseSuspenseQueryResult<TData, TError> & {
|
|
278
|
+
queryKey: QueryKey;
|
|
279
|
+
};
|
|
280
|
+
declare function useGetUnitsSuspense<TData = Awaited<ReturnType<typeof getUnits>>, TError = ErrorType<void | AsError>>(options?: {
|
|
281
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData>>;
|
|
229
282
|
request?: SecondParameter<typeof customInstance>;
|
|
230
|
-
}
|
|
283
|
+
}): UseSuspenseQueryResult<TData, TError> & {
|
|
231
284
|
queryKey: QueryKey;
|
|
232
285
|
};
|
|
233
286
|
/**
|
|
@@ -239,11 +292,11 @@ Users can only create one Personal unit and you cannot add other Users to a Pers
|
|
|
239
292
|
*/
|
|
240
293
|
declare const createDefaultUnit: (personalUnitPutBodyBody: PersonalUnitPutBodyBody, options?: SecondParameter<typeof customInstance>) => Promise<PersonalUnitPutResponse>;
|
|
241
294
|
declare const getCreateDefaultUnitMutationOptions: <TError = ErrorType<void | AsError>, TContext = unknown>(options?: {
|
|
242
|
-
mutation?: UseMutationOptions<
|
|
295
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof createDefaultUnit>>, TError, {
|
|
243
296
|
data: PersonalUnitPutBodyBody;
|
|
244
|
-
}, TContext
|
|
297
|
+
}, TContext>;
|
|
245
298
|
request?: SecondParameter<typeof customInstance>;
|
|
246
|
-
}
|
|
299
|
+
}) => UseMutationOptions<Awaited<ReturnType<typeof createDefaultUnit>>, TError, {
|
|
247
300
|
data: PersonalUnitPutBodyBody;
|
|
248
301
|
}, TContext>;
|
|
249
302
|
type CreateDefaultUnitMutationResult = NonNullable<Awaited<ReturnType<typeof createDefaultUnit>>>;
|
|
@@ -253,11 +306,11 @@ type CreateDefaultUnitMutationError = ErrorType<AsError | void>;
|
|
|
253
306
|
* @summary Create a new Personal Unit
|
|
254
307
|
*/
|
|
255
308
|
declare const useCreateDefaultUnit: <TError = ErrorType<void | AsError>, TContext = unknown>(options?: {
|
|
256
|
-
mutation?: UseMutationOptions<
|
|
309
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof createDefaultUnit>>, TError, {
|
|
257
310
|
data: PersonalUnitPutBodyBody;
|
|
258
|
-
}, TContext
|
|
311
|
+
}, TContext>;
|
|
259
312
|
request?: SecondParameter<typeof customInstance>;
|
|
260
|
-
}
|
|
313
|
+
}) => UseMutationResult<Awaited<ReturnType<typeof createDefaultUnit>>, TError, {
|
|
261
314
|
data: PersonalUnitPutBodyBody;
|
|
262
315
|
}, TContext>;
|
|
263
316
|
/**
|
|
@@ -266,18 +319,18 @@ declare const useCreateDefaultUnit: <TError = ErrorType<void | AsError>, TContex
|
|
|
266
319
|
* @summary Deletes a Personal Unit
|
|
267
320
|
*/
|
|
268
321
|
declare const deleteDefaultUnit: (options?: SecondParameter<typeof customInstance>) => Promise<void>;
|
|
269
|
-
declare const getDeleteDefaultUnitMutationOptions: <TError = ErrorType<AsError>, TContext = unknown>(options?: {
|
|
270
|
-
mutation?: UseMutationOptions<
|
|
322
|
+
declare const getDeleteDefaultUnitMutationOptions: <TError = ErrorType<void | AsError>, TContext = unknown>(options?: {
|
|
323
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof deleteDefaultUnit>>, TError, void, TContext>;
|
|
271
324
|
request?: SecondParameter<typeof customInstance>;
|
|
272
|
-
}
|
|
325
|
+
}) => UseMutationOptions<Awaited<ReturnType<typeof deleteDefaultUnit>>, TError, void, TContext>;
|
|
273
326
|
type DeleteDefaultUnitMutationResult = NonNullable<Awaited<ReturnType<typeof deleteDefaultUnit>>>;
|
|
274
|
-
type DeleteDefaultUnitMutationError = ErrorType<AsError>;
|
|
327
|
+
type DeleteDefaultUnitMutationError = ErrorType<void | AsError>;
|
|
275
328
|
/**
|
|
276
329
|
* @summary Deletes a Personal Unit
|
|
277
330
|
*/
|
|
278
|
-
declare const useDeleteDefaultUnit: <TError = ErrorType<AsError>, TContext = unknown>(options?: {
|
|
279
|
-
mutation?: UseMutationOptions<
|
|
331
|
+
declare const useDeleteDefaultUnit: <TError = ErrorType<void | AsError>, TContext = unknown>(options?: {
|
|
332
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof deleteDefaultUnit>>, TError, void, TContext>;
|
|
280
333
|
request?: SecondParameter<typeof customInstance>;
|
|
281
|
-
}
|
|
334
|
+
}) => UseMutationResult<Awaited<ReturnType<typeof deleteDefaultUnit>>, TError, void, TContext>;
|
|
282
335
|
|
|
283
336
|
export { type CreateDefaultUnitMutationBody, type CreateDefaultUnitMutationError, type CreateDefaultUnitMutationResult, type CreateOrganisationUnitMutationBody, type CreateOrganisationUnitMutationError, type CreateOrganisationUnitMutationResult, type DeleteDefaultUnitMutationError, type DeleteDefaultUnitMutationResult, type DeleteOrganisationUnitMutationError, type DeleteOrganisationUnitMutationResult, type GetOrganisationUnitsQueryError, type GetOrganisationUnitsQueryResult, type GetOrganisationUnitsSuspenseQueryError, type GetOrganisationUnitsSuspenseQueryResult, type GetUnitQueryError, type GetUnitQueryResult, type GetUnitSuspenseQueryError, type GetUnitSuspenseQueryResult, type GetUnitsQueryError, type GetUnitsQueryResult, type GetUnitsSuspenseQueryError, type GetUnitsSuspenseQueryResult, type PatchUnitMutationBody, type PatchUnitMutationError, type PatchUnitMutationResult, createDefaultUnit, createOrganisationUnit, deleteDefaultUnit, deleteOrganisationUnit, getCreateDefaultUnitMutationOptions, getCreateOrganisationUnitMutationOptions, getDeleteDefaultUnitMutationOptions, getDeleteOrganisationUnitMutationOptions, getGetOrganisationUnitsQueryKey, getGetOrganisationUnitsQueryOptions, getGetOrganisationUnitsSuspenseQueryOptions, getGetUnitQueryKey, getGetUnitQueryOptions, getGetUnitSuspenseQueryOptions, getGetUnitsQueryKey, getGetUnitsQueryOptions, getGetUnitsSuspenseQueryOptions, getOrganisationUnits, getPatchUnitMutationOptions, getUnit, getUnits, patchUnit, useCreateDefaultUnit, useCreateOrganisationUnit, useDeleteDefaultUnit, useDeleteOrganisationUnit, useGetOrganisationUnits, useGetOrganisationUnitsSuspense, useGetUnit, useGetUnitSuspense, useGetUnits, useGetUnitsSuspense, usePatchUnit };
|
package/unit/unit.js
CHANGED
|
@@ -27,24 +27,24 @@ var getGetOrganisationUnitsQueryOptions = (orgId, options) => {
|
|
|
27
27
|
const queryFn = ({ signal }) => getOrganisationUnits(orgId, requestOptions, signal);
|
|
28
28
|
return { queryKey, queryFn, enabled: !!orgId, ...queryOptions };
|
|
29
29
|
};
|
|
30
|
-
|
|
30
|
+
function useGetOrganisationUnits(orgId, options) {
|
|
31
31
|
const queryOptions = getGetOrganisationUnitsQueryOptions(orgId, options);
|
|
32
32
|
const query = useQuery(queryOptions);
|
|
33
33
|
query.queryKey = queryOptions.queryKey;
|
|
34
34
|
return query;
|
|
35
|
-
}
|
|
35
|
+
}
|
|
36
36
|
var getGetOrganisationUnitsSuspenseQueryOptions = (orgId, options) => {
|
|
37
37
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
38
38
|
const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetOrganisationUnitsQueryKey(orgId);
|
|
39
39
|
const queryFn = ({ signal }) => getOrganisationUnits(orgId, requestOptions, signal);
|
|
40
40
|
return { queryKey, queryFn, enabled: !!orgId, ...queryOptions };
|
|
41
41
|
};
|
|
42
|
-
|
|
42
|
+
function useGetOrganisationUnitsSuspense(orgId, options) {
|
|
43
43
|
const queryOptions = getGetOrganisationUnitsSuspenseQueryOptions(orgId, options);
|
|
44
44
|
const query = useSuspenseQuery(queryOptions);
|
|
45
45
|
query.queryKey = queryOptions.queryKey;
|
|
46
46
|
return query;
|
|
47
|
-
}
|
|
47
|
+
}
|
|
48
48
|
var createOrganisationUnit = (orgId, organisationUnitPostBodyBody, options) => {
|
|
49
49
|
return customInstance(
|
|
50
50
|
{
|
|
@@ -87,24 +87,24 @@ var getGetUnitQueryOptions = (unitId, options) => {
|
|
|
87
87
|
const queryFn = ({ signal }) => getUnit(unitId, requestOptions, signal);
|
|
88
88
|
return { queryKey, queryFn, enabled: !!unitId, ...queryOptions };
|
|
89
89
|
};
|
|
90
|
-
|
|
90
|
+
function useGetUnit(unitId, options) {
|
|
91
91
|
const queryOptions = getGetUnitQueryOptions(unitId, options);
|
|
92
92
|
const query = useQuery(queryOptions);
|
|
93
93
|
query.queryKey = queryOptions.queryKey;
|
|
94
94
|
return query;
|
|
95
|
-
}
|
|
95
|
+
}
|
|
96
96
|
var getGetUnitSuspenseQueryOptions = (unitId, options) => {
|
|
97
97
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
98
98
|
const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetUnitQueryKey(unitId);
|
|
99
99
|
const queryFn = ({ signal }) => getUnit(unitId, requestOptions, signal);
|
|
100
100
|
return { queryKey, queryFn, enabled: !!unitId, ...queryOptions };
|
|
101
101
|
};
|
|
102
|
-
|
|
102
|
+
function useGetUnitSuspense(unitId, options) {
|
|
103
103
|
const queryOptions = getGetUnitSuspenseQueryOptions(unitId, options);
|
|
104
104
|
const query = useSuspenseQuery(queryOptions);
|
|
105
105
|
query.queryKey = queryOptions.queryKey;
|
|
106
106
|
return query;
|
|
107
|
-
}
|
|
107
|
+
}
|
|
108
108
|
var patchUnit = (unitId, unitPatchBodyBody, options) => {
|
|
109
109
|
return customInstance(
|
|
110
110
|
{
|
|
@@ -168,24 +168,24 @@ var getGetUnitsQueryOptions = (options) => {
|
|
|
168
168
|
const queryFn = ({ signal }) => getUnits(requestOptions, signal);
|
|
169
169
|
return { queryKey, queryFn, ...queryOptions };
|
|
170
170
|
};
|
|
171
|
-
|
|
171
|
+
function useGetUnits(options) {
|
|
172
172
|
const queryOptions = getGetUnitsQueryOptions(options);
|
|
173
173
|
const query = useQuery(queryOptions);
|
|
174
174
|
query.queryKey = queryOptions.queryKey;
|
|
175
175
|
return query;
|
|
176
|
-
}
|
|
176
|
+
}
|
|
177
177
|
var getGetUnitsSuspenseQueryOptions = (options) => {
|
|
178
178
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
179
179
|
const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetUnitsQueryKey();
|
|
180
180
|
const queryFn = ({ signal }) => getUnits(requestOptions, signal);
|
|
181
181
|
return { queryKey, queryFn, ...queryOptions };
|
|
182
182
|
};
|
|
183
|
-
|
|
183
|
+
function useGetUnitsSuspense(options) {
|
|
184
184
|
const queryOptions = getGetUnitsSuspenseQueryOptions(options);
|
|
185
185
|
const query = useSuspenseQuery(queryOptions);
|
|
186
186
|
query.queryKey = queryOptions.queryKey;
|
|
187
187
|
return query;
|
|
188
|
-
}
|
|
188
|
+
}
|
|
189
189
|
var createDefaultUnit = (personalUnitPutBodyBody, options) => {
|
|
190
190
|
return customInstance(
|
|
191
191
|
{
|