@squonk/account-server-client 2.1.0-rc.2 → 2.1.0-rc.20
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/README.md +1 -1
- package/admin/admin.cjs +30 -8
- package/admin/admin.cjs.map +1 -1
- package/admin/admin.d.cts +50 -0
- package/admin/admin.d.ts +26 -6
- package/admin/admin.js +30 -8
- package/admin/admin.js.map +1 -1
- package/asset/asset.cjs +62 -22
- package/asset/asset.cjs.map +1 -1
- package/asset/asset.d.cts +260 -0
- package/asset/asset.d.ts +79 -36
- package/asset/asset.js +54 -14
- package/asset/asset.js.map +1 -1
- package/{chunk-3RNIDX7T.js → chunk-EBOQPVLG.js} +2 -2
- package/{chunk-3RNIDX7T.js.map → chunk-EBOQPVLG.js.map} +1 -1
- package/{chunk-UZTHSGDT.cjs → chunk-TKLTUR4R.cjs} +2 -2
- package/chunk-TKLTUR4R.cjs.map +1 -0
- package/event-stream/event-stream.cjs +64 -19
- package/event-stream/event-stream.cjs.map +1 -1
- package/event-stream/event-stream.d.cts +142 -0
- package/event-stream/event-stream.d.ts +66 -20
- package/event-stream/event-stream.js +61 -16
- package/event-stream/event-stream.js.map +1 -1
- package/index.cjs +10 -10
- package/index.cjs.map +1 -1
- package/{custom-instance-35e5d4fd.d.ts → index.d.cts} +165 -163
- package/index.d.ts +702 -2
- package/index.js +9 -9
- package/index.js.map +1 -1
- package/merchant/merchant.cjs +53 -14
- package/merchant/merchant.cjs.map +1 -1
- package/merchant/merchant.d.cts +91 -0
- package/merchant/merchant.d.ts +48 -8
- package/merchant/merchant.js +52 -13
- package/merchant/merchant.js.map +1 -1
- package/organisation/organisation.cjs +110 -28
- package/organisation/organisation.cjs.map +1 -1
- package/organisation/organisation.d.cts +271 -0
- package/organisation/organisation.d.ts +114 -25
- package/organisation/organisation.js +103 -21
- package/organisation/organisation.js.map +1 -1
- package/package.json +13 -13
- package/product/product.cjs +182 -47
- package/product/product.cjs.map +1 -1
- package/product/product.d.cts +399 -0
- package/product/product.d.ts +180 -31
- package/product/product.js +172 -37
- package/product/product.js.map +1 -1
- package/src/account-server-api.schemas.ts +274 -280
- package/src/admin/admin.ts +114 -84
- package/src/asset/asset.ts +480 -565
- package/src/custom-instance.ts +3 -4
- package/src/event-stream/event-stream.ts +300 -275
- package/src/merchant/merchant.ts +206 -142
- package/src/organisation/organisation.ts +549 -490
- package/src/product/product.ts +829 -688
- package/src/state/state.ts +112 -75
- package/src/unit/unit.ts +645 -599
- package/src/user/user.ts +489 -469
- package/state/state.cjs +29 -8
- package/state/state.cjs.map +1 -1
- package/state/state.d.cts +46 -0
- package/state/state.d.ts +26 -6
- package/state/state.js +29 -8
- package/state/state.js.map +1 -1
- package/unit/unit.cjs +120 -32
- package/unit/unit.cjs.map +1 -1
- package/unit/unit.d.cts +322 -0
- package/unit/unit.d.ts +133 -38
- package/unit/unit.js +112 -24
- package/unit/unit.js.map +1 -1
- package/user/user.cjs +96 -22
- package/user/user.cjs.map +1 -1
- package/user/user.d.cts +271 -0
- package/user/user.d.ts +96 -24
- package/user/user.js +90 -16
- package/user/user.js.map +1 -1
- package/chunk-UZTHSGDT.cjs.map +0 -1
package/merchant/merchant.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/merchant/merchant.ts"],"sourcesContent":["/**\n * Generated by orval v6.15.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Organisations**, **Units**, **Products**, **Users**, and **Assets**.\n\n * OpenAPI spec version: 2.1\n */\nimport { useQuery } from \"@tanstack/react-query\";\nimport type {\n UseQueryOptions,\n QueryFunction,\n UseQueryResult,\n QueryKey,\n} from \"@tanstack/react-query\";\nimport type {\n MerchantsGetResponse,\n AsError,\n MerchantGetResponse,\n} from \"../account-server-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * Gets Merchants known to the Account Server\n\nMerchants are software services (SaaS assets) whose facilities are known to and controlled by the Account Server\n\n * @summary Gets all Merchants\n */\nexport const getMerchants = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<MerchantsGetResponse>(\n { url: `/merchant`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetMerchantsQueryKey = () => [\"account-server-api\", `/merchant`] as const;\n\nexport const getGetMerchantsQueryOptions = <\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>\n>(options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getMerchants>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData> & {\n queryKey: QueryKey;\n} => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetMerchantsQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getMerchants>>> = ({\n signal,\n }) => getMerchants(requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions };\n};\n\nexport type GetMerchantsQueryResult = NonNullable<\n Awaited<ReturnType<typeof getMerchants>>\n>;\nexport type GetMerchantsQueryError = ErrorType<AsError | void>;\n\nexport const useGetMerchants = <\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>\n>(options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getMerchants>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetMerchantsQueryOptions(options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n\n/**\n * Gets a known Merchant\n\n * @summary Gets a specific Merchant\n */\nexport const getService = (\n mId: number,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<MerchantGetResponse>(\n { url: `/merchant/${mId}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetServiceQueryKey = (mId: number) =>\n [\"account-server-api\", `/merchant/${mId}`] as const;\n\nexport const getGetServiceQueryOptions = <\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>\n>(\n mId: number,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getService>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData> & {\n queryKey: QueryKey;\n} => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetServiceQueryKey(mId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getService>>> = ({\n signal,\n }) => getService(mId, requestOptions, signal);\n\n return { queryKey, queryFn, enabled: !!mId, ...queryOptions };\n};\n\nexport type GetServiceQueryResult = NonNullable<\n Awaited<ReturnType<typeof getService>>\n>;\nexport type GetServiceQueryError = ErrorType<AsError | void>;\n\nexport const useGetService = <\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>\n>(\n mId: number,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getService>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetServiceQueryOptions(mId, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n"],"mappings":";;;;;AAUA,SAAS,gBAAgB;AA8BlB,IAAM,eAAe,CAC1B,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,aAAa,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* 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 **Organisations**, **Units**, **Products**, **Users**, and **Assets**.\n\n * OpenAPI spec version: 2.1\n */\nimport {\n useQuery,\n useSuspenseQuery\n} from '@tanstack/react-query'\nimport type {\n QueryFunction,\n QueryKey,\n UseQueryOptions,\n UseQueryResult,\n UseSuspenseQueryOptions,\n UseSuspenseQueryResult\n} from '@tanstack/react-query'\nimport type {\n AsError,\n MerchantDetail,\n MerchantsGetResponse\n} from '../account-server-api.schemas'\nimport { customInstance } from '.././custom-instance';\nimport type { ErrorType } from '.././custom-instance';\n\n\ntype SecondParameter<T extends (...args: any) => any> = Parameters<T>[1];\n\n\n/**\n * Gets Merchants known to the Account Server\n\nMerchants are software services (SaaS assets) whose facilities are known to and controlled by the Account Server\n\n * @summary Gets all Merchants\n */\nexport const getMerchants = (\n \n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<MerchantsGetResponse>(\n {url: `/merchant`, method: 'GET', signal\n },\n options);\n }\n \n\nexport const getGetMerchantsQueryKey = () => {\n return [\"account-server-api\", `/merchant`] as const;\n }\n\n \nexport const getGetMerchantsQueryOptions = <TData = Awaited<ReturnType<typeof getMerchants>>, TError = ErrorType<AsError | void>>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetMerchantsQueryKey();\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getMerchants>>> = ({ signal }) => getMerchants(requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetMerchantsQueryResult = NonNullable<Awaited<ReturnType<typeof getMerchants>>>\nexport type GetMerchantsQueryError = ErrorType<AsError | void>\n\n/**\n * @summary Gets all Merchants\n */\nexport const useGetMerchants = <TData = Awaited<ReturnType<typeof getMerchants>>, TError = ErrorType<AsError | void>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetMerchantsQueryOptions(options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\nexport const getGetMerchantsSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getMerchants>>, TError = ErrorType<AsError | void>>( options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetMerchantsQueryKey();\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getMerchants>>> = ({ signal }) => getMerchants(requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetMerchantsSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getMerchants>>>\nexport type GetMerchantsSuspenseQueryError = ErrorType<AsError | void>\n\n/**\n * @summary Gets all Merchants\n */\nexport const useGetMerchantsSuspense = <TData = Awaited<ReturnType<typeof getMerchants>>, TError = ErrorType<AsError | void>>(\n options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetMerchantsSuspenseQueryOptions(options)\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * Gets a known Merchant\n\n * @summary Gets a specific Merchant\n */\nexport const getService = (\n mId: number,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<MerchantDetail>(\n {url: `/merchant/${mId}`, method: 'GET', signal\n },\n options);\n }\n \n\nexport const getGetServiceQueryKey = (mId: number,) => {\n return [\"account-server-api\", `/merchant/${mId}`] as const;\n }\n\n \nexport const getGetServiceQueryOptions = <TData = Awaited<ReturnType<typeof getService>>, TError = ErrorType<AsError | void>>(mId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetServiceQueryKey(mId);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getService>>> = ({ signal }) => getService(mId, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(mId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetServiceQueryResult = NonNullable<Awaited<ReturnType<typeof getService>>>\nexport type GetServiceQueryError = ErrorType<AsError | void>\n\n/**\n * @summary Gets a specific Merchant\n */\nexport const useGetService = <TData = Awaited<ReturnType<typeof getService>>, TError = ErrorType<AsError | void>>(\n mId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetServiceQueryOptions(mId,options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\nexport const getGetServiceSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getService>>, TError = ErrorType<AsError | void>>(mId: number, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetServiceQueryKey(mId);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getService>>> = ({ signal }) => getService(mId, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(mId), ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetServiceSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getService>>>\nexport type GetServiceSuspenseQueryError = ErrorType<AsError | void>\n\n/**\n * @summary Gets a specific Merchant\n */\nexport const useGetServiceSuspense = <TData = Awaited<ReturnType<typeof getService>>, TError = ErrorType<AsError | void>>(\n mId: number, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetServiceSuspenseQueryOptions(mId,options)\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n"],"mappings":";;;;;AAUA;AAAA,EACE;AAAA,EACA;AAAA,OACK;AA4BA,IAAM,eAAe,CAE3B,SAAiD,WAC7C;AAGC,SAAO;AAAA,IACP;AAAA,MAAC,KAAK;AAAA,MAAa,QAAQ;AAAA,MAAO;AAAA,IACpC;AAAA,IACE;AAAA,EAAO;AACT;AAGG,IAAM,0BAA0B,MAAM;AACzC,SAAO,CAAC,sBAAsB,WAAW;AACzC;AAGG,IAAM,8BA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BAAgB,MAAM;AAM9H,SAAQ,EAAE,UAAU,SAAS,SAAS,CAAC,CAAE,KAAM,GAAG,aAAY;AACjE;AAQO,IAAM,gBAAgB,CAC5B,KAAa,YAEkD;AAE9D,QAAM,eAAe,0BAA0B,KAAI,OAAO;AAE1D,QAAM,QAAQ,SAAS,YAAY;AAEnC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;AAIO,IAAM,oCAAoC,CAAqF,KAAa,YAC9I;AAEL,QAAM,EAAC,OAAO,cAAc,SAAS,eAAc,IAAI,WAAW,CAAC;AAEjE,QAAM,YAAY,6CAAc,aAAY,sBAAsB,GAAG;AAInE,QAAM,UAAiE,CAAC,EAAE,OAAO,MAAM,WAAW,KAAK,gBAAgB,MAAM;AAM9H,SAAQ,EAAE,UAAU,SAAS,SAAS,CAAC,CAAE,KAAM,GAAG,aAAY;AACjE;AAQO,IAAM,wBAAwB,CACpC,KAAa,YAE0D;AAEtE,QAAM,eAAe,kCAAkC,KAAI,OAAO;AAElE,QAAM,QAAQ,iBAAiB,YAAY;AAE3C,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;","names":[]}
|
|
@@ -1,16 +1,26 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkTKLTUR4Rcjs = require('../chunk-TKLTUR4R.cjs');
|
|
4
4
|
|
|
5
5
|
// src/organisation/organisation.ts
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
6
10
|
var _reactquery = require('@tanstack/react-query');
|
|
7
11
|
var getOrganisations = (options, signal) => {
|
|
8
|
-
return
|
|
9
|
-
{
|
|
12
|
+
return _chunkTKLTUR4Rcjs.customInstance.call(void 0,
|
|
13
|
+
{
|
|
14
|
+
url: `/organisation`,
|
|
15
|
+
method: "GET",
|
|
16
|
+
signal
|
|
17
|
+
},
|
|
10
18
|
options
|
|
11
19
|
);
|
|
12
20
|
};
|
|
13
|
-
var getGetOrganisationsQueryKey = () =>
|
|
21
|
+
var getGetOrganisationsQueryKey = () => {
|
|
22
|
+
return ["account-server-api", `/organisation`];
|
|
23
|
+
};
|
|
14
24
|
var getGetOrganisationsQueryOptions = (options) => {
|
|
15
25
|
const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
|
|
16
26
|
const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetOrganisationsQueryKey()));
|
|
@@ -23,11 +33,23 @@ var useGetOrganisations = (options) => {
|
|
|
23
33
|
query.queryKey = queryOptions.queryKey;
|
|
24
34
|
return query;
|
|
25
35
|
};
|
|
36
|
+
var getGetOrganisationsSuspenseQueryOptions = (options) => {
|
|
37
|
+
const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
|
|
38
|
+
const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetOrganisationsQueryKey()));
|
|
39
|
+
const queryFn = ({ signal }) => getOrganisations(requestOptions, signal);
|
|
40
|
+
return { queryKey, queryFn, ...queryOptions };
|
|
41
|
+
};
|
|
42
|
+
var useGetOrganisationsSuspense = (options) => {
|
|
43
|
+
const queryOptions = getGetOrganisationsSuspenseQueryOptions(options);
|
|
44
|
+
const query = _reactquery.useSuspenseQuery.call(void 0, queryOptions);
|
|
45
|
+
query.queryKey = queryOptions.queryKey;
|
|
46
|
+
return query;
|
|
47
|
+
};
|
|
26
48
|
var createOrganisation = (organisationPostBodyBody, options) => {
|
|
27
|
-
return
|
|
49
|
+
return _chunkTKLTUR4Rcjs.customInstance.call(void 0,
|
|
28
50
|
{
|
|
29
51
|
url: `/organisation`,
|
|
30
|
-
method: "
|
|
52
|
+
method: "POST",
|
|
31
53
|
headers: { "Content-Type": "application/json" },
|
|
32
54
|
data: organisationPostBodyBody
|
|
33
55
|
},
|
|
@@ -47,18 +69,22 @@ var useCreateOrganisation = (options) => {
|
|
|
47
69
|
return _reactquery.useMutation.call(void 0, mutationOptions);
|
|
48
70
|
};
|
|
49
71
|
var getOrganisation = (orgId, options, signal) => {
|
|
50
|
-
return
|
|
51
|
-
{
|
|
72
|
+
return _chunkTKLTUR4Rcjs.customInstance.call(void 0,
|
|
73
|
+
{
|
|
74
|
+
url: `/organisation/${orgId}`,
|
|
75
|
+
method: "GET",
|
|
76
|
+
signal
|
|
77
|
+
},
|
|
52
78
|
options
|
|
53
79
|
);
|
|
54
80
|
};
|
|
55
|
-
var getGetOrganisationQueryKey = (orgId) =>
|
|
81
|
+
var getGetOrganisationQueryKey = (orgId) => {
|
|
82
|
+
return ["account-server-api", `/organisation/${orgId}`];
|
|
83
|
+
};
|
|
56
84
|
var getGetOrganisationQueryOptions = (orgId, options) => {
|
|
57
85
|
const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
|
|
58
86
|
const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetOrganisationQueryKey(orgId)));
|
|
59
|
-
const queryFn = ({
|
|
60
|
-
signal
|
|
61
|
-
}) => getOrganisation(orgId, requestOptions, signal);
|
|
87
|
+
const queryFn = ({ signal }) => getOrganisation(orgId, requestOptions, signal);
|
|
62
88
|
return { queryKey, queryFn, enabled: !!orgId, ...queryOptions };
|
|
63
89
|
};
|
|
64
90
|
var useGetOrganisation = (orgId, options) => {
|
|
@@ -67,11 +93,23 @@ var useGetOrganisation = (orgId, options) => {
|
|
|
67
93
|
query.queryKey = queryOptions.queryKey;
|
|
68
94
|
return query;
|
|
69
95
|
};
|
|
96
|
+
var getGetOrganisationSuspenseQueryOptions = (orgId, options) => {
|
|
97
|
+
const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
|
|
98
|
+
const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetOrganisationQueryKey(orgId)));
|
|
99
|
+
const queryFn = ({ signal }) => getOrganisation(orgId, requestOptions, signal);
|
|
100
|
+
return { queryKey, queryFn, enabled: !!orgId, ...queryOptions };
|
|
101
|
+
};
|
|
102
|
+
var useGetOrganisationSuspense = (orgId, options) => {
|
|
103
|
+
const queryOptions = getGetOrganisationSuspenseQueryOptions(orgId, options);
|
|
104
|
+
const query = _reactquery.useSuspenseQuery.call(void 0, queryOptions);
|
|
105
|
+
query.queryKey = queryOptions.queryKey;
|
|
106
|
+
return query;
|
|
107
|
+
};
|
|
70
108
|
var patchOrganisation = (orgId, organisationPatchBodyBody, options) => {
|
|
71
|
-
return
|
|
109
|
+
return _chunkTKLTUR4Rcjs.customInstance.call(void 0,
|
|
72
110
|
{
|
|
73
111
|
url: `/organisation/${orgId}`,
|
|
74
|
-
method: "
|
|
112
|
+
method: "PATCH",
|
|
75
113
|
headers: { "Content-Type": "application/json" },
|
|
76
114
|
data: organisationPatchBodyBody
|
|
77
115
|
},
|
|
@@ -91,8 +129,11 @@ var usePatchOrganisation = (options) => {
|
|
|
91
129
|
return _reactquery.useMutation.call(void 0, mutationOptions);
|
|
92
130
|
};
|
|
93
131
|
var deleteOrganisation = (orgId, options) => {
|
|
94
|
-
return
|
|
95
|
-
{
|
|
132
|
+
return _chunkTKLTUR4Rcjs.customInstance.call(void 0,
|
|
133
|
+
{
|
|
134
|
+
url: `/organisation/${orgId}`,
|
|
135
|
+
method: "DELETE"
|
|
136
|
+
},
|
|
96
137
|
options
|
|
97
138
|
);
|
|
98
139
|
};
|
|
@@ -109,12 +150,19 @@ var useDeleteOrganisation = (options) => {
|
|
|
109
150
|
return _reactquery.useMutation.call(void 0, mutationOptions);
|
|
110
151
|
};
|
|
111
152
|
var getOrganisationCharges = (orgId, params, options, signal) => {
|
|
112
|
-
return
|
|
113
|
-
{
|
|
153
|
+
return _chunkTKLTUR4Rcjs.customInstance.call(void 0,
|
|
154
|
+
{
|
|
155
|
+
url: `/organisation/${orgId}/charges`,
|
|
156
|
+
method: "GET",
|
|
157
|
+
params,
|
|
158
|
+
signal
|
|
159
|
+
},
|
|
114
160
|
options
|
|
115
161
|
);
|
|
116
162
|
};
|
|
117
|
-
var getGetOrganisationChargesQueryKey = (orgId, params) =>
|
|
163
|
+
var getGetOrganisationChargesQueryKey = (orgId, params) => {
|
|
164
|
+
return ["account-server-api", `/organisation/${orgId}/charges`, ...params ? [params] : []];
|
|
165
|
+
};
|
|
118
166
|
var getGetOrganisationChargesQueryOptions = (orgId, params, options) => {
|
|
119
167
|
const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
|
|
120
168
|
const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetOrganisationChargesQueryKey(orgId, params)));
|
|
@@ -122,22 +170,36 @@ var getGetOrganisationChargesQueryOptions = (orgId, params, options) => {
|
|
|
122
170
|
return { queryKey, queryFn, enabled: !!orgId, ...queryOptions };
|
|
123
171
|
};
|
|
124
172
|
var useGetOrganisationCharges = (orgId, params, options) => {
|
|
125
|
-
const queryOptions = getGetOrganisationChargesQueryOptions(
|
|
126
|
-
orgId,
|
|
127
|
-
params,
|
|
128
|
-
options
|
|
129
|
-
);
|
|
173
|
+
const queryOptions = getGetOrganisationChargesQueryOptions(orgId, params, options);
|
|
130
174
|
const query = _reactquery.useQuery.call(void 0, queryOptions);
|
|
131
175
|
query.queryKey = queryOptions.queryKey;
|
|
132
176
|
return query;
|
|
133
177
|
};
|
|
178
|
+
var getGetOrganisationChargesSuspenseQueryOptions = (orgId, params, options) => {
|
|
179
|
+
const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
|
|
180
|
+
const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetOrganisationChargesQueryKey(orgId, params)));
|
|
181
|
+
const queryFn = ({ signal }) => getOrganisationCharges(orgId, params, requestOptions, signal);
|
|
182
|
+
return { queryKey, queryFn, enabled: !!orgId, ...queryOptions };
|
|
183
|
+
};
|
|
184
|
+
var useGetOrganisationChargesSuspense = (orgId, params, options) => {
|
|
185
|
+
const queryOptions = getGetOrganisationChargesSuspenseQueryOptions(orgId, params, options);
|
|
186
|
+
const query = _reactquery.useSuspenseQuery.call(void 0, queryOptions);
|
|
187
|
+
query.queryKey = queryOptions.queryKey;
|
|
188
|
+
return query;
|
|
189
|
+
};
|
|
134
190
|
var getDefaultOrganisation = (options, signal) => {
|
|
135
|
-
return
|
|
136
|
-
{
|
|
191
|
+
return _chunkTKLTUR4Rcjs.customInstance.call(void 0,
|
|
192
|
+
{
|
|
193
|
+
url: `/organisation/default`,
|
|
194
|
+
method: "GET",
|
|
195
|
+
signal
|
|
196
|
+
},
|
|
137
197
|
options
|
|
138
198
|
);
|
|
139
199
|
};
|
|
140
|
-
var getGetDefaultOrganisationQueryKey = () =>
|
|
200
|
+
var getGetDefaultOrganisationQueryKey = () => {
|
|
201
|
+
return ["account-server-api", `/organisation/default`];
|
|
202
|
+
};
|
|
141
203
|
var getGetDefaultOrganisationQueryOptions = (options) => {
|
|
142
204
|
const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
|
|
143
205
|
const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetDefaultOrganisationQueryKey()));
|
|
@@ -150,6 +212,26 @@ var useGetDefaultOrganisation = (options) => {
|
|
|
150
212
|
query.queryKey = queryOptions.queryKey;
|
|
151
213
|
return query;
|
|
152
214
|
};
|
|
215
|
+
var getGetDefaultOrganisationSuspenseQueryOptions = (options) => {
|
|
216
|
+
const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
|
|
217
|
+
const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetDefaultOrganisationQueryKey()));
|
|
218
|
+
const queryFn = ({ signal }) => getDefaultOrganisation(requestOptions, signal);
|
|
219
|
+
return { queryKey, queryFn, ...queryOptions };
|
|
220
|
+
};
|
|
221
|
+
var useGetDefaultOrganisationSuspense = (options) => {
|
|
222
|
+
const queryOptions = getGetDefaultOrganisationSuspenseQueryOptions(options);
|
|
223
|
+
const query = _reactquery.useSuspenseQuery.call(void 0, queryOptions);
|
|
224
|
+
query.queryKey = queryOptions.queryKey;
|
|
225
|
+
return query;
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
|
|
153
235
|
|
|
154
236
|
|
|
155
237
|
|
|
@@ -176,5 +258,5 @@ var useGetDefaultOrganisation = (options) => {
|
|
|
176
258
|
|
|
177
259
|
|
|
178
260
|
|
|
179
|
-
exports.createOrganisation = createOrganisation; exports.deleteOrganisation = deleteOrganisation; exports.getCreateOrganisationMutationOptions = getCreateOrganisationMutationOptions; exports.getDefaultOrganisation = getDefaultOrganisation; exports.getDeleteOrganisationMutationOptions = getDeleteOrganisationMutationOptions; exports.getGetDefaultOrganisationQueryKey = getGetDefaultOrganisationQueryKey; exports.getGetDefaultOrganisationQueryOptions = getGetDefaultOrganisationQueryOptions; exports.getGetOrganisationChargesQueryKey = getGetOrganisationChargesQueryKey; exports.getGetOrganisationChargesQueryOptions = getGetOrganisationChargesQueryOptions; exports.getGetOrganisationQueryKey = getGetOrganisationQueryKey; exports.getGetOrganisationQueryOptions = getGetOrganisationQueryOptions; exports.getGetOrganisationsQueryKey = getGetOrganisationsQueryKey; exports.getGetOrganisationsQueryOptions = getGetOrganisationsQueryOptions; exports.getOrganisation = getOrganisation; exports.getOrganisationCharges = getOrganisationCharges; exports.getOrganisations = getOrganisations; exports.getPatchOrganisationMutationOptions = getPatchOrganisationMutationOptions; exports.patchOrganisation = patchOrganisation; exports.useCreateOrganisation = useCreateOrganisation; exports.useDeleteOrganisation = useDeleteOrganisation; exports.useGetDefaultOrganisation = useGetDefaultOrganisation; exports.useGetOrganisation = useGetOrganisation; exports.useGetOrganisationCharges = useGetOrganisationCharges; exports.useGetOrganisations = useGetOrganisations; exports.usePatchOrganisation = usePatchOrganisation;
|
|
261
|
+
exports.createOrganisation = createOrganisation; exports.deleteOrganisation = deleteOrganisation; exports.getCreateOrganisationMutationOptions = getCreateOrganisationMutationOptions; exports.getDefaultOrganisation = getDefaultOrganisation; exports.getDeleteOrganisationMutationOptions = getDeleteOrganisationMutationOptions; exports.getGetDefaultOrganisationQueryKey = getGetDefaultOrganisationQueryKey; exports.getGetDefaultOrganisationQueryOptions = getGetDefaultOrganisationQueryOptions; exports.getGetDefaultOrganisationSuspenseQueryOptions = getGetDefaultOrganisationSuspenseQueryOptions; exports.getGetOrganisationChargesQueryKey = getGetOrganisationChargesQueryKey; exports.getGetOrganisationChargesQueryOptions = getGetOrganisationChargesQueryOptions; exports.getGetOrganisationChargesSuspenseQueryOptions = getGetOrganisationChargesSuspenseQueryOptions; exports.getGetOrganisationQueryKey = getGetOrganisationQueryKey; exports.getGetOrganisationQueryOptions = getGetOrganisationQueryOptions; exports.getGetOrganisationSuspenseQueryOptions = getGetOrganisationSuspenseQueryOptions; exports.getGetOrganisationsQueryKey = getGetOrganisationsQueryKey; exports.getGetOrganisationsQueryOptions = getGetOrganisationsQueryOptions; exports.getGetOrganisationsSuspenseQueryOptions = getGetOrganisationsSuspenseQueryOptions; exports.getOrganisation = getOrganisation; exports.getOrganisationCharges = getOrganisationCharges; exports.getOrganisations = getOrganisations; exports.getPatchOrganisationMutationOptions = getPatchOrganisationMutationOptions; exports.patchOrganisation = patchOrganisation; exports.useCreateOrganisation = useCreateOrganisation; exports.useDeleteOrganisation = useDeleteOrganisation; exports.useGetDefaultOrganisation = useGetDefaultOrganisation; exports.useGetDefaultOrganisationSuspense = useGetDefaultOrganisationSuspense; exports.useGetOrganisation = useGetOrganisation; exports.useGetOrganisationCharges = useGetOrganisationCharges; exports.useGetOrganisationChargesSuspense = useGetOrganisationChargesSuspense; exports.useGetOrganisationSuspense = useGetOrganisationSuspense; exports.useGetOrganisations = useGetOrganisations; exports.useGetOrganisationsSuspense = useGetOrganisationsSuspense; exports.usePatchOrganisation = usePatchOrganisation;
|
|
180
262
|
//# sourceMappingURL=organisation.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/organisation/organisation.ts"],"names":[],"mappings":";;;;;AAUA,SAAS,UAAU,mBAAmB;AAoC/B,IAAM,mBAAmB,CAC9B,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,iBAAiB,QAAQ,OAAO,OAAO;AAAA,IAC9C;AAAA,EACF;AACF;AAEO,IAAM,8BAA8B,MAAM,CAAC,sBAAsB,eAAe;AAEhF,IAAM,kCAAkC,CAG7C,YAW4B;AAC5B,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,4BAA4B;AAEvE,QAAM,UAEF,CAAC,EAAE,OAAO,MAAM,iBAAiB,gBAAgB,MAAM;AAE3D,SAAO,EAAE,UAAU,SAAS,GAAG,aAAa;AAC9C;AAOO,IAAM,sBAAsB,CAGjC,YAO4D;AAC5D,QAAM,eAAe,gCAAgC,OAAO;AAE5D,QAAM,QAAQ,SAAS,YAAY;AAInC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;AASO,IAAM,qBAAqB,CAChC,0BACA,YACG;AACH,SAAO;AAAA,IACL;AAAA,MACE,KAAK;AAAA,MACL,QAAQ;AAAA,MACR,SAAS,EAAE,gBAAgB,mBAAmB;AAAA,MAC9C,MAAM;AAAA,IACR;AAAA,IACA;AAAA,EACF;AACF;AAEO,IAAM,uCAAuC,CAGlD,YAaG;AACH,QAAM,EAAE,UAAU,iBAAiB,SAAS,eAAe,IAAI,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,KAAK,IAAI,SAAS,CAAC;AAE3B,WAAO,mBAAmB,MAAM,cAAc;AAAA,EAChD;AAEA,SAAO,EAAE,YAAY,GAAG,gBAAgB;AAC1C;AAQO,IAAM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AAAA,IACA;AAAA,EACF;AAEA,QAAM,QAAQ,SAAS,YAAY;AAInC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;AASO,IAAM,yBAAyB,CACpC,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,yBAAyB,QAAQ,OAAO,OAAO;AAAA,IACtD;AAAA,EACF;AACF;AAEO,IAAM,oCAAoC,MAC/C,CAAC,sBAAsB,uBAAuB;AAEzC,IAAM,wCAAwC,CAGnD,YAW4B;AAC5B,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YACJ,6CAAc,aAAY,kCAAkC;AAE9D,QAAM,UAEF,CAAC,EAAE,OAAO,MAAM,uBAAuB,gBAAgB,MAAM;AAEjE,SAAO,EAAE,UAAU,SAAS,GAAG,aAAa;AAC9C;AAOO,IAAM,4BAA4B,CAGvC,YAO4D;AAC5D,QAAM,eAAe,sCAAsC,OAAO;AAElE,QAAM,QAAQ,SAAS,YAAY;AAInC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT","sourcesContent":["/**\n * Generated by orval v6.15.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Organisations**, **Units**, **Products**, **Users**, and **Assets**.\n\n * OpenAPI spec version: 2.1\n */\nimport { useQuery, useMutation } from \"@tanstack/react-query\";\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"@tanstack/react-query\";\nimport type {\n OrganisationsGetResponse,\n AsError,\n OrganisationPostResponse,\n OrganisationPostBodyBody,\n OrganisationGetResponse,\n OrganisationPatchBodyBody,\n OrganisationChargesGetResponse,\n GetOrganisationChargesParams,\n OrganisationGetDefaultResponse,\n} from \"../account-server-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * Gets all the Organisations that you are a member of or are public. Admin users are members of all Organisations\n\n * @summary Gets Organisations\n */\nexport const getOrganisations = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<OrganisationsGetResponse>(\n { url: `/organisation`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetOrganisationsQueryKey = () => [\"account-server-api\", `/organisation`] as const;\n\nexport const getGetOrganisationsQueryOptions = <\n TData = Awaited<ReturnType<typeof getOrganisations>>,\n TError = ErrorType<void | AsError>\n>(options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisations>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisations>>,\n TError,\n TData\n> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetOrganisationsQueryKey();\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getOrganisations>>\n > = ({ signal }) => getOrganisations(requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions };\n};\n\nexport type GetOrganisationsQueryResult = NonNullable<\n Awaited<ReturnType<typeof getOrganisations>>\n>;\nexport type GetOrganisationsQueryError = ErrorType<void | AsError>;\n\nexport const useGetOrganisations = <\n TData = Awaited<ReturnType<typeof getOrganisations>>,\n TError = ErrorType<void | AsError>\n>(options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisations>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetOrganisationsQueryOptions(options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n\n/**\n * Creates a new Organisation\n\nYou need admin rights to use this method\n\n * @summary Create a new organisation\n */\nexport const createOrganisation = (\n organisationPostBodyBody: OrganisationPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<OrganisationPostResponse>(\n {\n url: `/organisation`,\n method: \"post\",\n headers: { \"Content-Type\": \"application/json\" },\n data: organisationPostBodyBody,\n },\n options\n );\n};\n\nexport const getCreateOrganisationMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createOrganisation>>,\n TError,\n { data: OrganisationPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof createOrganisation>>,\n TError,\n { data: OrganisationPostBodyBody },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof createOrganisation>>,\n { data: OrganisationPostBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return createOrganisation(data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type CreateOrganisationMutationResult = NonNullable<\n Awaited<ReturnType<typeof createOrganisation>>\n>;\nexport type CreateOrganisationMutationBody = OrganisationPostBodyBody;\nexport type CreateOrganisationMutationError = ErrorType<AsError | void>;\n\nexport const useCreateOrganisation = <\n TError = ErrorType<AsError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createOrganisation>>,\n TError,\n { data: OrganisationPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getCreateOrganisationMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Gets a specific Organisation. To see the Organisation you need admin rights or need to be a member of the Organisation.\n\nMembers of an Organisation's **Unit** do not necessarily have access to the Organisation.\n\n * @summary Gets an Organisation\n */\nexport const getOrganisation = (\n orgId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<OrganisationGetResponse>(\n { url: `/organisation/${orgId}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetOrganisationQueryKey = (orgId: string) =>\n [\"account-server-api\", `/organisation/${orgId}`] as const;\n\nexport const getGetOrganisationQueryOptions = <\n TData = Awaited<ReturnType<typeof getOrganisation>>,\n TError = ErrorType<void | AsError>\n>(\n orgId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisation>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisation>>,\n TError,\n TData\n> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetOrganisationQueryKey(orgId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisation>>> = ({\n signal,\n }) => getOrganisation(orgId, requestOptions, signal);\n\n return { queryKey, queryFn, enabled: !!orgId, ...queryOptions };\n};\n\nexport type GetOrganisationQueryResult = NonNullable<\n Awaited<ReturnType<typeof getOrganisation>>\n>;\nexport type GetOrganisationQueryError = ErrorType<void | AsError>;\n\nexport const useGetOrganisation = <\n TData = Awaited<ReturnType<typeof getOrganisation>>,\n TError = ErrorType<void | AsError>\n>(\n orgId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisation>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetOrganisationQueryOptions(orgId, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n\n/**\n * Used to update existing Organisation.\n\nYou have to be the Organisation owner (or an administrator) to patch an Organisation.\n\n * @summary Adjust an existing Organisation\n */\nexport const patchOrganisation = (\n orgId: string,\n organisationPatchBodyBody: OrganisationPatchBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n {\n url: `/organisation/${orgId}`,\n method: \"patch\",\n headers: { \"Content-Type\": \"application/json\" },\n data: organisationPatchBodyBody,\n },\n options\n );\n};\n\nexport const getPatchOrganisationMutationOptions = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchOrganisation>>,\n TError,\n { orgId: string; data: OrganisationPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof patchOrganisation>>,\n TError,\n { orgId: string; data: OrganisationPatchBodyBody },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof patchOrganisation>>,\n { orgId: string; data: OrganisationPatchBodyBody }\n > = (props) => {\n const { orgId, data } = props ?? {};\n\n return patchOrganisation(orgId, data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type PatchOrganisationMutationResult = NonNullable<\n Awaited<ReturnType<typeof patchOrganisation>>\n>;\nexport type PatchOrganisationMutationBody = OrganisationPatchBodyBody;\nexport type PatchOrganisationMutationError = ErrorType<AsError>;\n\nexport const usePatchOrganisation = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchOrganisation>>,\n TError,\n { orgId: string; data: OrganisationPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getPatchOrganisationMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Before an Organisation can be deleted all its underlying **Units** must also be deleted, remembering that **Units** that have undeleted **Products** cannot be deleted.\n\nYou need admin rights to use this method\n\n * @summary Deletes an Organisation\n */\nexport const deleteOrganisation = (\n orgId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/organisation/${orgId}`, method: \"delete\" },\n options\n );\n};\n\nexport const getDeleteOrganisationMutationOptions = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteOrganisation>>,\n TError,\n { orgId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof deleteOrganisation>>,\n TError,\n { orgId: string },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteOrganisation>>,\n { orgId: string }\n > = (props) => {\n const { orgId } = props ?? {};\n\n return deleteOrganisation(orgId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DeleteOrganisationMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteOrganisation>>\n>;\n\nexport type DeleteOrganisationMutationError = ErrorType<AsError>;\n\nexport const useDeleteOrganisation = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteOrganisation>>,\n TError,\n { orgId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getDeleteOrganisationMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Gets a Organisation charges.\n\nThe Organisation cannot be the **Default Organisation** and you need to be a member of the Organisation to use this endpoint\n\n * @summary Gets charges for all Units in an Organisation\n */\nexport const getOrganisationCharges = (\n orgId: string,\n params?: GetOrganisationChargesParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<OrganisationChargesGetResponse>(\n { url: `/organisation/${orgId}/charges`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetOrganisationChargesQueryKey = (\n orgId: string,\n params?: GetOrganisationChargesParams\n) => [\"account-server-api\", `/organisation/${orgId}/charges`, ...(params ? [params] : [])] as const;\n\nexport const getGetOrganisationChargesQueryOptions = <\n TData = Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError = ErrorType<void | AsError>\n>(\n orgId: string,\n params?: GetOrganisationChargesParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError,\n TData\n> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetOrganisationChargesQueryKey(orgId, params);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getOrganisationCharges>>\n > = ({ signal }) =>\n getOrganisationCharges(orgId, params, requestOptions, signal);\n\n return { queryKey, queryFn, enabled: !!orgId, ...queryOptions };\n};\n\nexport type GetOrganisationChargesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getOrganisationCharges>>\n>;\nexport type GetOrganisationChargesQueryError = ErrorType<void | AsError>;\n\nexport const useGetOrganisationCharges = <\n TData = Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError = ErrorType<void | AsError>\n>(\n orgId: string,\n params?: GetOrganisationChargesParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetOrganisationChargesQueryOptions(\n orgId,\n params,\n options\n );\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n\n/**\n * Gets the Default Organisation, a built-in Organisation used exclusively for **Personal Units**.\n\nAny authorised user can see the Default Organisation.\n\n * @summary Gets the Default Organisation\n */\nexport const getDefaultOrganisation = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<OrganisationGetDefaultResponse>(\n { url: `/organisation/default`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetDefaultOrganisationQueryKey = () =>\n [\"account-server-api\", `/organisation/default`] as const;\n\nexport const getGetDefaultOrganisationQueryOptions = <\n TData = Awaited<ReturnType<typeof getDefaultOrganisation>>,\n TError = ErrorType<void | AsError>\n>(options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getDefaultOrganisation>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryOptions<\n Awaited<ReturnType<typeof getDefaultOrganisation>>,\n TError,\n TData\n> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetDefaultOrganisationQueryKey();\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getDefaultOrganisation>>\n > = ({ signal }) => getDefaultOrganisation(requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions };\n};\n\nexport type GetDefaultOrganisationQueryResult = NonNullable<\n Awaited<ReturnType<typeof getDefaultOrganisation>>\n>;\nexport type GetDefaultOrganisationQueryError = ErrorType<void | AsError>;\n\nexport const useGetDefaultOrganisation = <\n TData = Awaited<ReturnType<typeof getDefaultOrganisation>>,\n TError = ErrorType<void | AsError>\n>(options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getDefaultOrganisation>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetDefaultOrganisationQueryOptions(options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/organisation/organisation.ts"],"names":[],"mappings":";;;;;AAUA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAkCA,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W,aAAa;AAE9B,SAAO;AACT","sourcesContent":["/**\n * Generated by orval v6.25.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Organisations**, **Units**, **Products**, **Users**, and **Assets**.\n\n * OpenAPI spec version: 2.1\n */\nimport {\n useMutation,\n useQuery,\n useSuspenseQuery\n} from '@tanstack/react-query'\nimport type {\n MutationFunction,\n QueryFunction,\n QueryKey,\n UseMutationOptions,\n UseQueryOptions,\n UseQueryResult,\n UseSuspenseQueryOptions,\n UseSuspenseQueryResult\n} from '@tanstack/react-query'\nimport type {\n AsError,\n GetOrganisationChargesParams,\n OrganisationChargesGetResponse,\n OrganisationDetail,\n OrganisationGetDefaultResponse,\n OrganisationPatchBodyBody,\n OrganisationPostBodyBody,\n OrganisationPostResponse,\n OrganisationsGetResponse\n} from '../account-server-api.schemas'\nimport { customInstance } from '.././custom-instance';\nimport type { ErrorType } from '.././custom-instance';\n\n\ntype SecondParameter<T extends (...args: any) => any> = Parameters<T>[1];\n\n\n/**\n * Gets all the Organisations that you are a member of or are public. Admin users are members of all Organisations\n\n * @summary Gets Organisations\n */\nexport const getOrganisations = (\n \n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<OrganisationsGetResponse>(\n {url: `/organisation`, method: 'GET', signal\n },\n options);\n }\n \n\nexport const getGetOrganisationsQueryKey = () => {\n return [\"account-server-api\", `/organisation`] as const;\n }\n\n \nexport const getGetOrganisationsQueryOptions = <TData = Awaited<ReturnType<typeof getOrganisations>>, TError = ErrorType<void | AsError>>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetOrganisationsQueryKey();\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisations>>> = ({ signal }) => getOrganisations(requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetOrganisationsQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisations>>>\nexport type GetOrganisationsQueryError = ErrorType<void | AsError>\n\n/**\n * @summary Gets Organisations\n */\nexport const useGetOrganisations = <TData = Awaited<ReturnType<typeof getOrganisations>>, TError = ErrorType<void | AsError>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetOrganisationsQueryOptions(options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\nexport const getGetOrganisationsSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getOrganisations>>, TError = ErrorType<void | AsError>>( options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetOrganisationsQueryKey();\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisations>>> = ({ signal }) => getOrganisations(requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetOrganisationsSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisations>>>\nexport type GetOrganisationsSuspenseQueryError = ErrorType<void | AsError>\n\n/**\n * @summary Gets Organisations\n */\nexport const useGetOrganisationsSuspense = <TData = Awaited<ReturnType<typeof getOrganisations>>, TError = ErrorType<void | AsError>>(\n options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetOrganisationsSuspenseQueryOptions(options)\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * Creates a new Organisation\n\nYou need admin rights to use this method\n\n * @summary Create a new organisation\n */\nexport const createOrganisation = (\n organisationPostBodyBody: OrganisationPostBodyBody,\n options?: SecondParameter<typeof customInstance>,) => {\n \n \n return customInstance<OrganisationPostResponse>(\n {url: `/organisation`, method: 'POST',\n headers: {'Content-Type': 'application/json', },\n data: organisationPostBodyBody\n },\n options);\n }\n \n\n\nexport const getCreateOrganisationMutationOptions = <TError = ErrorType<AsError | void>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createOrganisation>>, TError,{data: OrganisationPostBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof createOrganisation>>, TError,{data: OrganisationPostBodyBody}, TContext> => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof createOrganisation>>, {data: OrganisationPostBodyBody}> = (props) => {\n const {data} = props ?? {};\n\n return createOrganisation(data,requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type CreateOrganisationMutationResult = NonNullable<Awaited<ReturnType<typeof createOrganisation>>>\n export type CreateOrganisationMutationBody = OrganisationPostBodyBody\n export type CreateOrganisationMutationError = ErrorType<AsError | void>\n\n /**\n * @summary Create a new organisation\n */\nexport const useCreateOrganisation = <TError = ErrorType<AsError | void>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createOrganisation>>, TError,{data: OrganisationPostBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n\n const mutationOptions = getCreateOrganisationMutationOptions(options);\n\n return useMutation(mutationOptions);\n }\n /**\n * Gets a specific Organisation. To see the Organisation you need admin rights or need to be a member of the Organisation.\n\nMembers of an Organisation's **Unit** do not necessarily have access to the Organisation.\n\n * @summary Gets an Organisation\n */\nexport const getOrganisation = (\n orgId: string,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<OrganisationDetail>(\n {url: `/organisation/${orgId}`, method: 'GET', signal\n },\n options);\n }\n \n\nexport const getGetOrganisationQueryKey = (orgId: string,) => {\n return [\"account-server-api\", `/organisation/${orgId}`] as const;\n }\n\n \nexport const getGetOrganisationQueryOptions = <TData = Awaited<ReturnType<typeof getOrganisation>>, TError = ErrorType<void | AsError>>(orgId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetOrganisationQueryKey(orgId);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisation>>> = ({ signal }) => getOrganisation(orgId, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(orgId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetOrganisationQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisation>>>\nexport type GetOrganisationQueryError = ErrorType<void | AsError>\n\n/**\n * @summary Gets an Organisation\n */\nexport const useGetOrganisation = <TData = Awaited<ReturnType<typeof getOrganisation>>, TError = ErrorType<void | AsError>>(\n orgId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetOrganisationQueryOptions(orgId,options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\nexport const getGetOrganisationSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getOrganisation>>, TError = ErrorType<void | AsError>>(orgId: string, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetOrganisationQueryKey(orgId);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisation>>> = ({ signal }) => getOrganisation(orgId, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(orgId), ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetOrganisationSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisation>>>\nexport type GetOrganisationSuspenseQueryError = ErrorType<void | AsError>\n\n/**\n * @summary Gets an Organisation\n */\nexport const useGetOrganisationSuspense = <TData = Awaited<ReturnType<typeof getOrganisation>>, TError = ErrorType<void | AsError>>(\n orgId: string, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetOrganisationSuspenseQueryOptions(orgId,options)\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * Used to update existing Organisation.\n\nYou have to be the Organisation owner (or an administrator) to patch an Organisation.\n\n * @summary Adjust an existing Organisation\n */\nexport const patchOrganisation = (\n orgId: string,\n organisationPatchBodyBody: OrganisationPatchBodyBody,\n options?: SecondParameter<typeof customInstance>,) => {\n \n \n return customInstance<void>(\n {url: `/organisation/${orgId}`, method: 'PATCH',\n headers: {'Content-Type': 'application/json', },\n data: organisationPatchBodyBody\n },\n options);\n }\n \n\n\nexport const getPatchOrganisationMutationOptions = <TError = ErrorType<AsError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof patchOrganisation>>, TError,{orgId: string;data: OrganisationPatchBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof patchOrganisation>>, TError,{orgId: string;data: OrganisationPatchBodyBody}, TContext> => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof patchOrganisation>>, {orgId: string;data: OrganisationPatchBodyBody}> = (props) => {\n const {orgId,data} = props ?? {};\n\n return patchOrganisation(orgId,data,requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type PatchOrganisationMutationResult = NonNullable<Awaited<ReturnType<typeof patchOrganisation>>>\n export type PatchOrganisationMutationBody = OrganisationPatchBodyBody\n export type PatchOrganisationMutationError = ErrorType<AsError>\n\n /**\n * @summary Adjust an existing Organisation\n */\nexport const usePatchOrganisation = <TError = ErrorType<AsError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof patchOrganisation>>, TError,{orgId: string;data: OrganisationPatchBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n\n const mutationOptions = getPatchOrganisationMutationOptions(options);\n\n return useMutation(mutationOptions);\n }\n /**\n * Before an Organisation can be deleted all its underlying **Units** must also be deleted, remembering that **Units** that have undeleted **Products** cannot be deleted.\n\nYou need admin rights to use this method\n\n * @summary Deletes an Organisation\n */\nexport const deleteOrganisation = (\n orgId: string,\n options?: SecondParameter<typeof customInstance>,) => {\n \n \n return customInstance<void>(\n {url: `/organisation/${orgId}`, method: 'DELETE'\n },\n options);\n }\n \n\n\nexport const getDeleteOrganisationMutationOptions = <TError = ErrorType<AsError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteOrganisation>>, TError,{orgId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof deleteOrganisation>>, TError,{orgId: string}, TContext> => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteOrganisation>>, {orgId: string}> = (props) => {\n const {orgId} = props ?? {};\n\n return deleteOrganisation(orgId,requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type DeleteOrganisationMutationResult = NonNullable<Awaited<ReturnType<typeof deleteOrganisation>>>\n \n export type DeleteOrganisationMutationError = ErrorType<AsError>\n\n /**\n * @summary Deletes an Organisation\n */\nexport const useDeleteOrganisation = <TError = ErrorType<AsError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteOrganisation>>, TError,{orgId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n\n const mutationOptions = getDeleteOrganisationMutationOptions(options);\n\n return useMutation(mutationOptions);\n }\n /**\n * Gets a Organisation charges.\n\nThe Organisation cannot be the **Default Organisation** and you need to be a member of the Organisation to use this endpoint\n\n * @summary Gets charges for all Units in an Organisation\n */\nexport const getOrganisationCharges = (\n orgId: string,\n params?: GetOrganisationChargesParams,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<OrganisationChargesGetResponse>(\n {url: `/organisation/${orgId}/charges`, method: 'GET',\n params, signal\n },\n options);\n }\n \n\nexport const getGetOrganisationChargesQueryKey = (orgId: string,\n params?: GetOrganisationChargesParams,) => {\n return [\"account-server-api\", `/organisation/${orgId}/charges`, ...(params ? [params]: [])] as const;\n }\n\n \nexport const getGetOrganisationChargesQueryOptions = <TData = Awaited<ReturnType<typeof getOrganisationCharges>>, TError = ErrorType<void | AsError>>(orgId: string,\n params?: GetOrganisationChargesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetOrganisationChargesQueryKey(orgId,params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisationCharges>>> = ({ signal }) => getOrganisationCharges(orgId,params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(orgId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetOrganisationChargesQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisationCharges>>>\nexport type GetOrganisationChargesQueryError = ErrorType<void | AsError>\n\n/**\n * @summary Gets charges for all Units in an Organisation\n */\nexport const useGetOrganisationCharges = <TData = Awaited<ReturnType<typeof getOrganisationCharges>>, TError = ErrorType<void | AsError>>(\n orgId: string,\n params?: GetOrganisationChargesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetOrganisationChargesQueryOptions(orgId,params,options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\nexport const getGetOrganisationChargesSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getOrganisationCharges>>, TError = ErrorType<void | AsError>>(orgId: string,\n params?: GetOrganisationChargesParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetOrganisationChargesQueryKey(orgId,params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisationCharges>>> = ({ signal }) => getOrganisationCharges(orgId,params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(orgId), ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetOrganisationChargesSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisationCharges>>>\nexport type GetOrganisationChargesSuspenseQueryError = ErrorType<void | AsError>\n\n/**\n * @summary Gets charges for all Units in an Organisation\n */\nexport const useGetOrganisationChargesSuspense = <TData = Awaited<ReturnType<typeof getOrganisationCharges>>, TError = ErrorType<void | AsError>>(\n orgId: string,\n params?: GetOrganisationChargesParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetOrganisationChargesSuspenseQueryOptions(orgId,params,options)\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * Gets the Default Organisation, a built-in Organisation used exclusively for **Personal Units**.\n\nAny authorised user can see the Default Organisation.\n\n * @summary Gets the Default Organisation\n */\nexport const getDefaultOrganisation = (\n \n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<OrganisationGetDefaultResponse>(\n {url: `/organisation/default`, method: 'GET', signal\n },\n options);\n }\n \n\nexport const getGetDefaultOrganisationQueryKey = () => {\n return [\"account-server-api\", `/organisation/default`] as const;\n }\n\n \nexport const getGetDefaultOrganisationQueryOptions = <TData = Awaited<ReturnType<typeof getDefaultOrganisation>>, TError = ErrorType<void | AsError>>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetDefaultOrganisationQueryKey();\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getDefaultOrganisation>>> = ({ signal }) => getDefaultOrganisation(requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetDefaultOrganisationQueryResult = NonNullable<Awaited<ReturnType<typeof getDefaultOrganisation>>>\nexport type GetDefaultOrganisationQueryError = ErrorType<void | AsError>\n\n/**\n * @summary Gets the Default Organisation\n */\nexport const useGetDefaultOrganisation = <TData = Awaited<ReturnType<typeof getDefaultOrganisation>>, TError = ErrorType<void | AsError>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetDefaultOrganisationQueryOptions(options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\nexport const getGetDefaultOrganisationSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getDefaultOrganisation>>, TError = ErrorType<void | AsError>>( options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetDefaultOrganisationQueryKey();\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getDefaultOrganisation>>> = ({ signal }) => getDefaultOrganisation(requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetDefaultOrganisationSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getDefaultOrganisation>>>\nexport type GetDefaultOrganisationSuspenseQueryError = ErrorType<void | AsError>\n\n/**\n * @summary Gets the Default Organisation\n */\nexport const useGetDefaultOrganisationSuspense = <TData = Awaited<ReturnType<typeof getDefaultOrganisation>>, TError = ErrorType<void | AsError>>(\n options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetDefaultOrganisationSuspenseQueryOptions(options)\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n"]}
|