@squonk/account-server-client 0.1.35 → 0.1.38-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/asset/asset.cjs +10 -15
  2. package/asset/asset.cjs.map +1 -1
  3. package/asset/asset.d.ts +2 -2
  4. package/asset/asset.js +5 -10
  5. package/asset/asset.js.map +1 -1
  6. package/{chunk-6EEIAH4R.js → chunk-3TENYKS7.js} +1 -1
  7. package/{chunk-6EEIAH4R.js.map → chunk-3TENYKS7.js.map} +0 -0
  8. package/{chunk-NGBTCJWS.cjs → chunk-RHHRF25R.cjs} +1 -1
  9. package/{chunk-NGBTCJWS.cjs.map → chunk-RHHRF25R.cjs.map} +0 -0
  10. package/{custom-instance-aeeba2ba.d.ts → custom-instance-00382740.d.ts} +1 -1
  11. package/index.cjs +2 -2
  12. package/index.cjs.map +1 -1
  13. package/index.d.ts +1 -1
  14. package/index.js +1 -1
  15. package/index.js.map +1 -1
  16. package/merchant/merchant.cjs +8 -12
  17. package/merchant/merchant.cjs.map +1 -1
  18. package/merchant/merchant.d.ts +2 -2
  19. package/merchant/merchant.js +6 -10
  20. package/merchant/merchant.js.map +1 -1
  21. package/organisation/organisation.cjs +9 -15
  22. package/organisation/organisation.cjs.map +1 -1
  23. package/organisation/organisation.d.ts +2 -2
  24. package/organisation/organisation.js +6 -12
  25. package/organisation/organisation.js.map +1 -1
  26. package/package.json +8 -8
  27. package/product/product.cjs +24 -30
  28. package/product/product.cjs.map +1 -1
  29. package/product/product.d.ts +2 -2
  30. package/product/product.js +15 -21
  31. package/product/product.js.map +1 -1
  32. package/src/account-server-api.schemas.ts +1 -1
  33. package/src/asset/asset.ts +13 -14
  34. package/src/merchant/merchant.ts +18 -17
  35. package/src/organisation/organisation.ts +20 -18
  36. package/src/product/product.ts +38 -33
  37. package/src/state/state.ts +12 -12
  38. package/src/unit/unit.ts +23 -23
  39. package/src/user/user.ts +28 -23
  40. package/state/state.cjs +4 -8
  41. package/state/state.cjs.map +1 -1
  42. package/state/state.d.ts +2 -13
  43. package/state/state.js +4 -8
  44. package/state/state.js.map +1 -1
  45. package/unit/unit.cjs +16 -22
  46. package/unit/unit.cjs.map +1 -1
  47. package/unit/unit.d.ts +2 -2
  48. package/unit/unit.js +8 -14
  49. package/unit/unit.js.map +1 -1
  50. package/user/user.cjs +18 -22
  51. package/user/user.cjs.map +1 -1
  52. package/user/user.d.ts +2 -2
  53. package/user/user.js +11 -15
  54. package/user/user.js.map +1 -1
@@ -1,13 +1,10 @@
1
1
  import {
2
2
  __spreadValues,
3
3
  customInstance
4
- } from "../chunk-6EEIAH4R.js";
4
+ } from "../chunk-3TENYKS7.js";
5
5
 
6
6
  // src/product/product.ts
7
- import {
8
- useQuery,
9
- useMutation
10
- } from "react-query";
7
+ import { useQuery, useMutation } from "react-query";
11
8
  var getProductTypes = (options, signal) => {
12
9
  return customInstance({ url: `/product-type`, method: "get", signal }, options);
13
10
  };
@@ -19,9 +16,8 @@ var useGetProductTypes = (options) => {
19
16
  signal
20
17
  }) => getProductTypes(requestOptions, signal);
21
18
  const query = useQuery(queryKey, queryFn, queryOptions);
22
- return __spreadValues({
23
- queryKey
24
- }, query);
19
+ query.queryKey = queryKey;
20
+ return query;
25
21
  };
26
22
  var getProducts = (options, signal) => {
27
23
  return customInstance({ url: `/product`, method: "get", signal }, options);
@@ -34,9 +30,8 @@ var useGetProducts = (options) => {
34
30
  signal
35
31
  }) => getProducts(requestOptions, signal);
36
32
  const query = useQuery(queryKey, queryFn, queryOptions);
37
- return __spreadValues({
38
- queryKey
39
- }, query);
33
+ query.queryKey = queryKey;
34
+ return query;
40
35
  };
41
36
  var getProductsForOrganisation = (orgId, options, signal) => {
42
37
  return customInstance({ url: `/product/organisation/${orgId}`, method: "get", signal }, options);
@@ -49,9 +44,8 @@ var useGetProductsForOrganisation = (orgId, options) => {
49
44
  const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetProductsForOrganisationQueryKey(orgId);
50
45
  const queryFn = ({ signal }) => getProductsForOrganisation(orgId, requestOptions, signal);
51
46
  const query = useQuery(queryKey, queryFn, __spreadValues({ enabled: !!orgId }, queryOptions));
52
- return __spreadValues({
53
- queryKey
54
- }, query);
47
+ query.queryKey = queryKey;
48
+ return query;
55
49
  };
56
50
  var createUnitProduct = (unitId, unitProductPostBodyBody, options) => {
57
51
  return customInstance({
@@ -79,10 +73,11 @@ var useGetProductsForUnit = (unitId, options) => {
79
73
  const { query: queryOptions, request: requestOptions } = options ?? {};
80
74
  const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetProductsForUnitQueryKey(unitId);
81
75
  const queryFn = ({ signal }) => getProductsForUnit(unitId, requestOptions, signal);
82
- const query = useQuery(queryKey, queryFn, __spreadValues({ enabled: !!unitId }, queryOptions));
83
- return __spreadValues({
84
- queryKey
85
- }, query);
76
+ const query = useQuery(queryKey, queryFn, __spreadValues({
77
+ enabled: !!unitId
78
+ }, queryOptions));
79
+ query.queryKey = queryKey;
80
+ return query;
86
81
  };
87
82
  var getProduct = (productId, options, signal) => {
88
83
  return customInstance({ url: `/product/${productId}`, method: "get", signal }, options);
@@ -97,9 +92,8 @@ var useGetProduct = (productId, options) => {
97
92
  signal
98
93
  }) => getProduct(productId, requestOptions, signal);
99
94
  const query = useQuery(queryKey, queryFn, __spreadValues({ enabled: !!productId }, queryOptions));
100
- return __spreadValues({
101
- queryKey
102
- }, query);
95
+ query.queryKey = queryKey;
96
+ return query;
103
97
  };
104
98
  var deleteProduct = (productId, options) => {
105
99
  return customInstance({ url: `/product/${productId}`, method: "delete" }, options);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/product/product.ts"],"sourcesContent":["/**\n * Generated by orval v6.8.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Products**, **Organisations**, **Units** and **Users**.\n\n * OpenAPI spec version: 0.1\n */\nimport {\n useQuery,\n useMutation,\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"react-query\";\nimport type {\n ProductsGetTypesResponse,\n AsError,\n ProductsGetResponse,\n UnitProductPostResponse,\n UnitProductPostBodyBody,\n ProductUnitGetResponse,\n ProductPatchBodyBody,\n} from \"../account-server-api.schemas\";\nimport { customInstance, ErrorType } from \".././custom-instance\";\n\nexport type AwaitedInput<T> = PromiseLike<T> | T;\n\nexport type Awaited<O> = O extends AwaitedInput<infer T> ? T : never;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * Gets product types you can purchase\n\n * @summary Gets all Product Types\n */\nexport const getProductTypes = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProductsGetTypesResponse>(\n { url: `/product-type`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetProductTypesQueryKey = () => [`/product-type`];\n\nexport type GetProductTypesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProductTypes>>\n>;\nexport type GetProductTypesQueryError = ErrorType<AsError | void>;\n\nexport const useGetProductTypes = <\n TData = Awaited<ReturnType<typeof getProductTypes>>,\n TError = ErrorType<AsError | void>\n>(options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProductTypes>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProductTypesQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProductTypes>>> = ({\n signal,\n }) => getProductTypes(requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getProductTypes>>,\n TError,\n TData\n >(queryKey, queryFn, queryOptions);\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Gets products you have access to, across all Units and Organisations\n\n * @summary Gets all Products\n */\nexport const getProducts = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProductsGetResponse>(\n { url: `/product`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetProductsQueryKey = () => [`/product`];\n\nexport type GetProductsQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProducts>>\n>;\nexport type GetProductsQueryError = ErrorType<AsError | void>;\n\nexport const useGetProducts = <\n TData = Awaited<ReturnType<typeof getProducts>>,\n TError = ErrorType<AsError | void>\n>(options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProducts>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProductsQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProducts>>> = ({\n signal,\n }) => getProducts(requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getProducts>>,\n TError,\n TData\n >(queryKey, queryFn, queryOptions);\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Gets products you have access to based on an Organisation\n\n * @summary Gets Products for an Organisation\n */\nexport const getProductsForOrganisation = (\n orgId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProductsGetResponse>(\n { url: `/product/organisation/${orgId}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetProductsForOrganisationQueryKey = (orgId: string) => [\n `/product/organisation/${orgId}`,\n];\n\nexport type GetProductsForOrganisationQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProductsForOrganisation>>\n>;\nexport type GetProductsForOrganisationQueryError = ErrorType<void | AsError>;\n\nexport const useGetProductsForOrganisation = <\n TData = Awaited<ReturnType<typeof getProductsForOrganisation>>,\n TError = ErrorType<void | AsError>\n>(\n orgId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProductsForOrganisation>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetProductsForOrganisationQueryKey(orgId);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getProductsForOrganisation>>\n > = ({ signal }) => getProductsForOrganisation(orgId, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getProductsForOrganisation>>,\n TError,\n TData\n >(queryKey, queryFn, { enabled: !!orgId, ...queryOptions });\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Products are **Subscriptions** that you create in a Unit and use **Merchant** services like the `DATA_MANAGER`.\n\nTypical subscriptions include `DATA_MANAGER_STORAGE_SUBSCRIPTION` and `DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION`.\n\nSome subscriptions, like the `DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION` are available i various **flavours** that influence their capabilities. Flavours are typically referred to using the names `BRONZE`, `SILVER` and `GOLD`\n\n * @summary Creates a Product for an Organisational Unit\n */\nexport const createUnitProduct = (\n unitId: string,\n unitProductPostBodyBody: UnitProductPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<UnitProductPostResponse>(\n {\n url: `/product/unit/${unitId}`,\n method: \"post\",\n headers: { \"Content-Type\": \"application/json\" },\n data: unitProductPostBodyBody,\n },\n options\n );\n};\n\nexport type CreateUnitProductMutationResult = NonNullable<\n Awaited<ReturnType<typeof createUnitProduct>>\n>;\nexport type CreateUnitProductMutationBody = UnitProductPostBodyBody;\nexport type CreateUnitProductMutationError = ErrorType<AsError | void>;\n\nexport const useCreateUnitProduct = <\n TError = ErrorType<AsError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createUnitProduct>>,\n TError,\n { unitId: string; data: UnitProductPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof createUnitProduct>>,\n { unitId: string; data: UnitProductPostBodyBody }\n > = (props) => {\n const { unitId, data } = props ?? {};\n\n return createUnitProduct(unitId, data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof createUnitProduct>>,\n TError,\n { unitId: string; data: UnitProductPostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets products you have access to based on an Organisational Unit\n\n * @summary Gets Products for an Organisational Unit\n */\nexport const getProductsForUnit = (\n unitId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProductsGetResponse>(\n { url: `/product/unit/${unitId}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetProductsForUnitQueryKey = (unitId: string) => [\n `/product/unit/${unitId}`,\n];\n\nexport type GetProductsForUnitQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProductsForUnit>>\n>;\nexport type GetProductsForUnitQueryError = ErrorType<void | AsError>;\n\nexport const useGetProductsForUnit = <\n TData = Awaited<ReturnType<typeof getProductsForUnit>>,\n TError = ErrorType<void | AsError>\n>(\n unitId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProductsForUnit>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetProductsForUnitQueryKey(unitId);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getProductsForUnit>>\n > = ({ signal }) => getProductsForUnit(unitId, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getProductsForUnit>>,\n TError,\n TData\n >(queryKey, queryFn, { enabled: !!unitId, ...queryOptions });\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Gets a Product\n\n * @summary Gets a Product\n */\nexport const getProduct = (\n productId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProductUnitGetResponse>(\n { url: `/product/${productId}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetProductQueryKey = (productId: string) => [\n `/product/${productId}`,\n];\n\nexport type GetProductQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProduct>>\n>;\nexport type GetProductQueryError = ErrorType<AsError | void>;\n\nexport const useGetProduct = <\n TData = Awaited<ReturnType<typeof getProduct>>,\n TError = ErrorType<AsError | void>\n>(\n productId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProduct>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProductQueryKey(productId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProduct>>> = ({\n signal,\n }) => getProduct(productId, requestOptions, signal);\n\n const query = useQuery<Awaited<ReturnType<typeof getProduct>>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!productId, ...queryOptions }\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * @summary Deletes an existing Product\n */\nexport const deleteProduct = (\n productId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/product/${productId}`, method: \"delete\" },\n options\n );\n};\n\nexport type DeleteProductMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteProduct>>\n>;\n\nexport type DeleteProductMutationError = ErrorType<AsError>;\n\nexport const useDeleteProduct = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteProduct>>,\n TError,\n { productId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteProduct>>,\n { productId: string }\n > = (props) => {\n const { productId } = props ?? {};\n\n return deleteProduct(productId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof deleteProduct>>,\n TError,\n { productId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Used to update some adjustable parameters of a Product, i.e. to extend the Allowance or Limit. At the moment Data Manager products can be patched by changing the `name`, it's coin `allowance` or `limit`\n\n * @summary Adjust an existing Product\n */\nexport const patchProduct = (\n productId: string,\n productPatchBodyBody: ProductPatchBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n {\n url: `/product/${productId}`,\n method: \"patch\",\n headers: { \"Content-Type\": \"application/json\" },\n data: productPatchBodyBody,\n },\n options\n );\n};\n\nexport type PatchProductMutationResult = NonNullable<\n Awaited<ReturnType<typeof patchProduct>>\n>;\nexport type PatchProductMutationBody = ProductPatchBodyBody;\nexport type PatchProductMutationError = ErrorType<AsError>;\n\nexport const usePatchProduct = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchProduct>>,\n TError,\n { productId: string; data: ProductPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof patchProduct>>,\n { productId: string; data: ProductPatchBodyBody }\n > = (props) => {\n const { productId, data } = props ?? {};\n\n return patchProduct(productId, data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof patchProduct>>,\n TError,\n { productId: string; data: ProductPatchBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n"],"mappings":";;;;;;AAUA;AAAA;AAAA;AAAA;AAs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C,cAAsB;AAAA,EAC1D,YAAY;AACd;AAOO,IAAM,gBAAgB,CAI3B,WACA,YAQ2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,CAAC;AAErE,QAAM,WAAW,8CAAc,aAAY,sBAAsB,SAAS;AAE1E,QAAM,UAAiE,CAAC;AAAA,IACtE;AAAA,QACI,WAAW,WAAW,gBAAgB,MAAM;AAElD,QAAM,QAAQ,SACZ,UACA,SACA,iBAAE,SAAS,CAAC,CAAC,aAAc,aAC7B;AAEA,SAAO;AAAA,IACL;AAAA,KACG;AAEP;AAKO,IAAM,gBAAgB,CAC3B,WACA,YACG;AACH,SAAO,eACL,EAAE,KAAK,YAAY,aAAa,QAAQ,SAAS,GACjD,OACF;AACF;AAQO,IAAM,mBAAmB,CAG9B,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,cAAc,SAAS,CAAC;AAEhC,WAAO,cAAc,WAAW,cAAc;AAAA,EAChD;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B;AAMO,IAAM,eAAe,CAC1B,WACA,sBACA,YACG;AACH,SAAO,eACL;AAAA,IACE,KAAK,YAAY;AAAA,IACjB,QAAQ;AAAA,IACR,SAAS,EAAE,gBAAgB,mBAAmB;AAAA,IAC9C,MAAM;AAAA,EACR,GACA,OACF;AACF;AAQO,IAAM,kBAAkB,CAG7B,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,WAAW,SAAS,SAAS,CAAC;AAEtC,WAAO,aAAa,WAAW,MAAM,cAAc;AAAA,EACrD;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B;","names":[]}
1
+ {"version":3,"sources":["../../src/product/product.ts"],"sourcesContent":["/**\n * Generated by orval v6.9.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Products**, **Organisations**, **Units** and **Users**.\n\n * OpenAPI spec version: 0.1\n */\nimport { useQuery, useMutation } from \"react-query\";\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"react-query\";\nimport type {\n ProductsGetTypesResponse,\n AsError,\n ProductsGetResponse,\n UnitProductPostResponse,\n UnitProductPostBodyBody,\n ProductUnitGetResponse,\n ProductPatchBodyBody,\n} from \"../account-server-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\n\ntype AwaitedInput<T> = PromiseLike<T> | T;\n\ntype Awaited<O> = O extends AwaitedInput<infer T> ? T : never;\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 product types you can purchase\n\n * @summary Gets all Product Types\n */\nexport const getProductTypes = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProductsGetTypesResponse>(\n { url: `/product-type`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetProductTypesQueryKey = () => [`/product-type`];\n\nexport type GetProductTypesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProductTypes>>\n>;\nexport type GetProductTypesQueryError = ErrorType<AsError | void>;\n\nexport const useGetProductTypes = <\n TData = Awaited<ReturnType<typeof getProductTypes>>,\n TError = ErrorType<AsError | void>\n>(options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProductTypes>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProductTypesQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProductTypes>>> = ({\n signal,\n }) => getProductTypes(requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getProductTypes>>,\n TError,\n TData\n >(queryKey, queryFn, queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * Gets products you have access to, across all Units and Organisations\n\n * @summary Gets all Products\n */\nexport const getProducts = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProductsGetResponse>(\n { url: `/product`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetProductsQueryKey = () => [`/product`];\n\nexport type GetProductsQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProducts>>\n>;\nexport type GetProductsQueryError = ErrorType<AsError | void>;\n\nexport const useGetProducts = <\n TData = Awaited<ReturnType<typeof getProducts>>,\n TError = ErrorType<AsError | void>\n>(options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProducts>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProductsQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProducts>>> = ({\n signal,\n }) => getProducts(requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getProducts>>,\n TError,\n TData\n >(queryKey, queryFn, queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * Gets products you have access to based on an Organisation\n\n * @summary Gets Products for an Organisation\n */\nexport const getProductsForOrganisation = (\n orgId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProductsGetResponse>(\n { url: `/product/organisation/${orgId}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetProductsForOrganisationQueryKey = (orgId: string) => [\n `/product/organisation/${orgId}`,\n];\n\nexport type GetProductsForOrganisationQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProductsForOrganisation>>\n>;\nexport type GetProductsForOrganisationQueryError = ErrorType<void | AsError>;\n\nexport const useGetProductsForOrganisation = <\n TData = Awaited<ReturnType<typeof getProductsForOrganisation>>,\n TError = ErrorType<void | AsError>\n>(\n orgId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProductsForOrganisation>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetProductsForOrganisationQueryKey(orgId);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getProductsForOrganisation>>\n > = ({ signal }) => getProductsForOrganisation(orgId, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getProductsForOrganisation>>,\n TError,\n TData\n >(queryKey, queryFn, { enabled: !!orgId, ...queryOptions }) as UseQueryResult<\n TData,\n TError\n > & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * Products are **Subscriptions** that you create in a Unit and use **Merchant** services like the `DATA_MANAGER`.\n\nTypical subscriptions include `DATA_MANAGER_STORAGE_SUBSCRIPTION` and `DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION`.\n\nSome subscriptions, like the `DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION` are available i various **flavours** that influence their capabilities. Flavours are typically referred to using the names `BRONZE`, `SILVER` and `GOLD`\n\n * @summary Creates a Product for an Organisational Unit\n */\nexport const createUnitProduct = (\n unitId: string,\n unitProductPostBodyBody: UnitProductPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<UnitProductPostResponse>(\n {\n url: `/product/unit/${unitId}`,\n method: \"post\",\n headers: { \"Content-Type\": \"application/json\" },\n data: unitProductPostBodyBody,\n },\n options\n );\n};\n\nexport type CreateUnitProductMutationResult = NonNullable<\n Awaited<ReturnType<typeof createUnitProduct>>\n>;\nexport type CreateUnitProductMutationBody = UnitProductPostBodyBody;\nexport type CreateUnitProductMutationError = ErrorType<AsError | void>;\n\nexport const useCreateUnitProduct = <\n TError = ErrorType<AsError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createUnitProduct>>,\n TError,\n { unitId: string; data: UnitProductPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof createUnitProduct>>,\n { unitId: string; data: UnitProductPostBodyBody }\n > = (props) => {\n const { unitId, data } = props ?? {};\n\n return createUnitProduct(unitId, data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof createUnitProduct>>,\n TError,\n { unitId: string; data: UnitProductPostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets products you have access to based on an Organisational Unit\n\n * @summary Gets Products for an Organisational Unit\n */\nexport const getProductsForUnit = (\n unitId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProductsGetResponse>(\n { url: `/product/unit/${unitId}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetProductsForUnitQueryKey = (unitId: string) => [\n `/product/unit/${unitId}`,\n];\n\nexport type GetProductsForUnitQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProductsForUnit>>\n>;\nexport type GetProductsForUnitQueryError = ErrorType<void | AsError>;\n\nexport const useGetProductsForUnit = <\n TData = Awaited<ReturnType<typeof getProductsForUnit>>,\n TError = ErrorType<void | AsError>\n>(\n unitId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProductsForUnit>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetProductsForUnitQueryKey(unitId);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getProductsForUnit>>\n > = ({ signal }) => getProductsForUnit(unitId, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getProductsForUnit>>,\n TError,\n TData\n >(queryKey, queryFn, {\n enabled: !!unitId,\n ...queryOptions,\n }) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * Gets a Product\n\n * @summary Gets a Product\n */\nexport const getProduct = (\n productId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProductUnitGetResponse>(\n { url: `/product/${productId}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetProductQueryKey = (productId: string) => [\n `/product/${productId}`,\n];\n\nexport type GetProductQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProduct>>\n>;\nexport type GetProductQueryError = ErrorType<AsError | void>;\n\nexport const useGetProduct = <\n TData = Awaited<ReturnType<typeof getProduct>>,\n TError = ErrorType<AsError | void>\n>(\n productId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProduct>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProductQueryKey(productId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProduct>>> = ({\n signal,\n }) => getProduct(productId, requestOptions, signal);\n\n const query = useQuery<Awaited<ReturnType<typeof getProduct>>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!productId, ...queryOptions }\n ) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * @summary Deletes an existing Product\n */\nexport const deleteProduct = (\n productId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/product/${productId}`, method: \"delete\" },\n options\n );\n};\n\nexport type DeleteProductMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteProduct>>\n>;\n\nexport type DeleteProductMutationError = ErrorType<AsError>;\n\nexport const useDeleteProduct = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteProduct>>,\n TError,\n { productId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteProduct>>,\n { productId: string }\n > = (props) => {\n const { productId } = props ?? {};\n\n return deleteProduct(productId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof deleteProduct>>,\n TError,\n { productId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Used to update some adjustable parameters of a Product, i.e. to extend the Allowance or Limit. At the moment Data Manager products can be patched by changing the `name`, it's coin `allowance` or `limit`\n\n * @summary Adjust an existing Product\n */\nexport const patchProduct = (\n productId: string,\n productPatchBodyBody: ProductPatchBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n {\n url: `/product/${productId}`,\n method: \"patch\",\n headers: { \"Content-Type\": \"application/json\" },\n data: productPatchBodyBody,\n },\n options\n );\n};\n\nexport type PatchProductMutationResult = NonNullable<\n Awaited<ReturnType<typeof patchProduct>>\n>;\nexport type PatchProductMutationBody = ProductPatchBodyBody;\nexport type PatchProductMutationError = ErrorType<AsError>;\n\nexport const usePatchProduct = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchProduct>>,\n TError,\n { productId: string; data: ProductPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof patchProduct>>,\n { productId: string; data: ProductPatchBodyBody }\n > = (props) => {\n const { productId, data } = props ?? {};\n\n return patchProduct(productId, data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof patchProduct>>,\n TError,\n { productId: string; data: ProductPatchBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n"],"mappings":";;;;;;AAUA;AAsCO,IAAM,kBAAkB,CAC7B,SACA,WACG;AACH,SAAO,eACL,EAAE,KAAK,iBAAiB,QAAQ,OAAO,OAAO,GAC9C,OACF;AACF;AAEO,IAAM,6BAA6B,MAAM,CAAC,eAAe;AAOzD,IAAM,qBAAqB,CAGhC,YAO4D;AAC5D,QAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,CAAC;AAErE,QAAM,WAAW,8CAAc,aAAY,2BAA2B;AAEtE,QAAM,UAAsE,CAAC;AAAA,IAC3E;AAAA,QACI,gBAAgB,gBAAgB,MAAM;AAE5C,QAAM,QAAQ,SAIZ,UAAU,SAAS,YAAY;AAIjC,QAAM,WAAW;AAEjB,SAAO;AACT;AAOO,IAAM,cAAc,CACzB,SACA,WACG;AACH,SAAO,eACL,EAAE,KAAK,YAAY,QAAQ,OAAO,OAAO,GACzC,OACF;AACF;AAEO,IAAM,yBAAyB,MAAM,CAAC,UAAU;AAOhD,IAAM,iBAAiB,CAG5B,YAO4D;AAC5D,QAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,CAAC;AAErE,QAAM,WAAW,8CAAc,aAAY,uBAAuB;AAElE,QAAM,UAAkE,CAAC;AAAA,IACvE;AAAA,QACI,YAAY,gBAAgB,MAAM;AAExC,QAAM,QAAQ,SAIZ,UAAU,SAAS,YAAY;AAIjC,QAAM,WAAW;AAEjB,SAAO;AACT;AAOO,IAAM,6BAA6B,CACxC,OACA,SACA,WACG;AACH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CAG7B,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,WAAW,SAAS,SAAS,CAAC;AAEtC,WAAO,aAAa,WAAW,MAAM,cAAc;AAAA,EACrD;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B;","names":[]}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Generated by orval v6.8.0 🍺
2
+ * Generated by orval v6.9.0 🍺
3
3
  * Do not edit manually.
4
4
  * Account Server API
5
5
  * The Informatics Matters Account Server API.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Generated by orval v6.8.0 🍺
2
+ * Generated by orval v6.9.0 🍺
3
3
  * Do not edit manually.
4
4
  * Account Server API
5
5
  * The Informatics Matters Account Server API.
@@ -8,9 +8,8 @@ A service that provides access to the Account Server, which gives *registered* u
8
8
 
9
9
  * OpenAPI spec version: 0.1
10
10
  */
11
- import {
12
- useQuery,
13
- useMutation,
11
+ import { useQuery, useMutation } from "react-query";
12
+ import type {
14
13
  UseQueryOptions,
15
14
  UseMutationOptions,
16
15
  QueryFunction,
@@ -27,13 +26,14 @@ import type {
27
26
  AttachAssetParams,
28
27
  DetachAssetParams,
29
28
  } from "../account-server-api.schemas";
30
- import { customInstance, ErrorType } from ".././custom-instance";
29
+ import { customInstance } from ".././custom-instance";
30
+ import type { ErrorType } from ".././custom-instance";
31
31
 
32
- export type AwaitedInput<T> = PromiseLike<T> | T;
32
+ type AwaitedInput<T> = PromiseLike<T> | T;
33
33
 
34
- export type Awaited<O> = O extends AwaitedInput<infer T> ? T : never;
34
+ type Awaited<O> = O extends AwaitedInput<infer T> ? T : never;
35
35
 
36
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
36
+ // eslint-disable-next-line
37
37
  type SecondParameter<T extends (...args: any) => any> = T extends (
38
38
  config: any,
39
39
  args: infer P
@@ -52,7 +52,7 @@ export const getAsset = (
52
52
  signal?: AbortSignal
53
53
  ) => {
54
54
  return customInstance<AssetGetResponse>(
55
- { url: `/asset`, method: "get", signal, params },
55
+ { url: `/asset`, method: "get", params, signal },
56
56
  options
57
57
  );
58
58
  };
@@ -93,12 +93,11 @@ export const useGetAsset = <
93
93
  queryKey,
94
94
  queryFn,
95
95
  queryOptions
96
- );
96
+ ) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
97
97
 
98
- return {
99
- queryKey,
100
- ...query,
101
- };
98
+ query.queryKey = queryKey;
99
+
100
+ return query;
102
101
  };
103
102
 
104
103
  /**
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Generated by orval v6.8.0 🍺
2
+ * Generated by orval v6.9.0 🍺
3
3
  * Do not edit manually.
4
4
  * Account Server API
5
5
  * The Informatics Matters Account Server API.
@@ -8,8 +8,8 @@ A service that provides access to the Account Server, which gives *registered* u
8
8
 
9
9
  * OpenAPI spec version: 0.1
10
10
  */
11
- import {
12
- useQuery,
11
+ import { useQuery } from "react-query";
12
+ import type {
13
13
  UseQueryOptions,
14
14
  QueryFunction,
15
15
  UseQueryResult,
@@ -20,13 +20,14 @@ import type {
20
20
  AsError,
21
21
  MerchantGetResponse,
22
22
  } from "../account-server-api.schemas";
23
- import { customInstance, ErrorType } from ".././custom-instance";
23
+ import { customInstance } from ".././custom-instance";
24
+ import type { ErrorType } from ".././custom-instance";
24
25
 
25
- export type AwaitedInput<T> = PromiseLike<T> | T;
26
+ type AwaitedInput<T> = PromiseLike<T> | T;
26
27
 
27
- export type Awaited<O> = O extends AwaitedInput<infer T> ? T : never;
28
+ type Awaited<O> = O extends AwaitedInput<infer T> ? T : never;
28
29
 
29
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
30
+ // eslint-disable-next-line
30
31
  type SecondParameter<T extends (...args: any) => any> = T extends (
31
32
  config: any,
32
33
  args: infer P
@@ -79,12 +80,13 @@ export const useGetMerchants = <
79
80
  Awaited<ReturnType<typeof getMerchants>>,
80
81
  TError,
81
82
  TData
82
- >(queryKey, queryFn, queryOptions);
83
-
84
- return {
85
- queryKey,
86
- ...query,
83
+ >(queryKey, queryFn, queryOptions) as UseQueryResult<TData, TError> & {
84
+ queryKey: QueryKey;
87
85
  };
86
+
87
+ query.queryKey = queryKey;
88
+
89
+ return query;
88
90
  };
89
91
 
90
92
  /**
@@ -136,10 +138,9 @@ export const useGetService = <
136
138
  queryKey,
137
139
  queryFn,
138
140
  { enabled: !!mId, ...queryOptions }
139
- );
141
+ ) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
140
142
 
141
- return {
142
- queryKey,
143
- ...query,
144
- };
143
+ query.queryKey = queryKey;
144
+
145
+ return query;
145
146
  };
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Generated by orval v6.8.0 🍺
2
+ * Generated by orval v6.9.0 🍺
3
3
  * Do not edit manually.
4
4
  * Account Server API
5
5
  * The Informatics Matters Account Server API.
@@ -8,9 +8,8 @@ A service that provides access to the Account Server, which gives *registered* u
8
8
 
9
9
  * OpenAPI spec version: 0.1
10
10
  */
11
- import {
12
- useQuery,
13
- useMutation,
11
+ import { useQuery, useMutation } from "react-query";
12
+ import type {
14
13
  UseQueryOptions,
15
14
  UseMutationOptions,
16
15
  QueryFunction,
@@ -25,13 +24,14 @@ import type {
25
24
  OrganisationPostBodyBody,
26
25
  OrganisationGetDefaultResponse,
27
26
  } from "../account-server-api.schemas";
28
- import { customInstance, ErrorType } from ".././custom-instance";
27
+ import { customInstance } from ".././custom-instance";
28
+ import type { ErrorType } from ".././custom-instance";
29
29
 
30
- export type AwaitedInput<T> = PromiseLike<T> | T;
30
+ type AwaitedInput<T> = PromiseLike<T> | T;
31
31
 
32
- export type Awaited<O> = O extends AwaitedInput<infer T> ? T : never;
32
+ type Awaited<O> = O extends AwaitedInput<infer T> ? T : never;
33
33
 
34
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
34
+ // eslint-disable-next-line
35
35
  type SecondParameter<T extends (...args: any) => any> = T extends (
36
36
  config: any,
37
37
  args: infer P
@@ -84,12 +84,13 @@ export const useGetOrganisations = <
84
84
  Awaited<ReturnType<typeof getOrganisations>>,
85
85
  TError,
86
86
  TData
87
- >(queryKey, queryFn, queryOptions);
88
-
89
- return {
90
- queryKey,
91
- ...query,
87
+ >(queryKey, queryFn, queryOptions) as UseQueryResult<TData, TError> & {
88
+ queryKey: QueryKey;
92
89
  };
90
+
91
+ query.queryKey = queryKey;
92
+
93
+ return query;
93
94
  };
94
95
 
95
96
  /**
@@ -251,10 +252,11 @@ export const useGetDefaultOrganisation = <
251
252
  Awaited<ReturnType<typeof getDefaultOrganisation>>,
252
253
  TError,
253
254
  TData
254
- >(queryKey, queryFn, queryOptions);
255
-
256
- return {
257
- queryKey,
258
- ...query,
255
+ >(queryKey, queryFn, queryOptions) as UseQueryResult<TData, TError> & {
256
+ queryKey: QueryKey;
259
257
  };
258
+
259
+ query.queryKey = queryKey;
260
+
261
+ return query;
260
262
  };
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Generated by orval v6.8.0 🍺
2
+ * Generated by orval v6.9.0 🍺
3
3
  * Do not edit manually.
4
4
  * Account Server API
5
5
  * The Informatics Matters Account Server API.
@@ -8,9 +8,8 @@ A service that provides access to the Account Server, which gives *registered* u
8
8
 
9
9
  * OpenAPI spec version: 0.1
10
10
  */
11
- import {
12
- useQuery,
13
- useMutation,
11
+ import { useQuery, useMutation } from "react-query";
12
+ import type {
14
13
  UseQueryOptions,
15
14
  UseMutationOptions,
16
15
  QueryFunction,
@@ -27,13 +26,14 @@ import type {
27
26
  ProductUnitGetResponse,
28
27
  ProductPatchBodyBody,
29
28
  } from "../account-server-api.schemas";
30
- import { customInstance, ErrorType } from ".././custom-instance";
29
+ import { customInstance } from ".././custom-instance";
30
+ import type { ErrorType } from ".././custom-instance";
31
31
 
32
- export type AwaitedInput<T> = PromiseLike<T> | T;
32
+ type AwaitedInput<T> = PromiseLike<T> | T;
33
33
 
34
- export type Awaited<O> = O extends AwaitedInput<infer T> ? T : never;
34
+ type Awaited<O> = O extends AwaitedInput<infer T> ? T : never;
35
35
 
36
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
36
+ // eslint-disable-next-line
37
37
  type SecondParameter<T extends (...args: any) => any> = T extends (
38
38
  config: any,
39
39
  args: infer P
@@ -86,12 +86,13 @@ export const useGetProductTypes = <
86
86
  Awaited<ReturnType<typeof getProductTypes>>,
87
87
  TError,
88
88
  TData
89
- >(queryKey, queryFn, queryOptions);
90
-
91
- return {
92
- queryKey,
93
- ...query,
89
+ >(queryKey, queryFn, queryOptions) as UseQueryResult<TData, TError> & {
90
+ queryKey: QueryKey;
94
91
  };
92
+
93
+ query.queryKey = queryKey;
94
+
95
+ return query;
95
96
  };
96
97
 
97
98
  /**
@@ -139,12 +140,13 @@ export const useGetProducts = <
139
140
  Awaited<ReturnType<typeof getProducts>>,
140
141
  TError,
141
142
  TData
142
- >(queryKey, queryFn, queryOptions);
143
-
144
- return {
145
- queryKey,
146
- ...query,
143
+ >(queryKey, queryFn, queryOptions) as UseQueryResult<TData, TError> & {
144
+ queryKey: QueryKey;
147
145
  };
146
+
147
+ query.queryKey = queryKey;
148
+
149
+ return query;
148
150
  };
149
151
 
150
152
  /**
@@ -199,12 +201,14 @@ export const useGetProductsForOrganisation = <
199
201
  Awaited<ReturnType<typeof getProductsForOrganisation>>,
200
202
  TError,
201
203
  TData
202
- >(queryKey, queryFn, { enabled: !!orgId, ...queryOptions });
204
+ >(queryKey, queryFn, { enabled: !!orgId, ...queryOptions }) as UseQueryResult<
205
+ TData,
206
+ TError
207
+ > & { queryKey: QueryKey };
203
208
 
204
- return {
205
- queryKey,
206
- ...query,
207
- };
209
+ query.queryKey = queryKey;
210
+
211
+ return query;
208
212
  };
209
213
 
210
214
  /**
@@ -320,12 +324,14 @@ export const useGetProductsForUnit = <
320
324
  Awaited<ReturnType<typeof getProductsForUnit>>,
321
325
  TError,
322
326
  TData
323
- >(queryKey, queryFn, { enabled: !!unitId, ...queryOptions });
327
+ >(queryKey, queryFn, {
328
+ enabled: !!unitId,
329
+ ...queryOptions,
330
+ }) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
324
331
 
325
- return {
326
- queryKey,
327
- ...query,
328
- };
332
+ query.queryKey = queryKey;
333
+
334
+ return query;
329
335
  };
330
336
 
331
337
  /**
@@ -379,12 +385,11 @@ export const useGetProduct = <
379
385
  queryKey,
380
386
  queryFn,
381
387
  { enabled: !!productId, ...queryOptions }
382
- );
388
+ ) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
383
389
 
384
- return {
385
- queryKey,
386
- ...query,
387
- };
390
+ query.queryKey = queryKey;
391
+
392
+ return query;
388
393
  };
389
394
 
390
395
  /**
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Generated by orval v6.8.0 🍺
2
+ * Generated by orval v6.9.0 🍺
3
3
  * Do not edit manually.
4
4
  * Account Server API
5
5
  * The Informatics Matters Account Server API.
@@ -8,8 +8,8 @@ A service that provides access to the Account Server, which gives *registered* u
8
8
 
9
9
  * OpenAPI spec version: 0.1
10
10
  */
11
- import {
12
- useQuery,
11
+ import { useQuery } from "react-query";
12
+ import type {
13
13
  UseQueryOptions,
14
14
  QueryFunction,
15
15
  UseQueryResult,
@@ -19,13 +19,14 @@ import type {
19
19
  StateGetVersionResponse,
20
20
  AsError,
21
21
  } from "../account-server-api.schemas";
22
- import { customInstance, ErrorType } from ".././custom-instance";
22
+ import { customInstance } from ".././custom-instance";
23
+ import type { ErrorType } from ".././custom-instance";
23
24
 
24
- export type AwaitedInput<T> = PromiseLike<T> | T;
25
+ type AwaitedInput<T> = PromiseLike<T> | T;
25
26
 
26
- export type Awaited<O> = O extends AwaitedInput<infer T> ? T : never;
27
+ type Awaited<O> = O extends AwaitedInput<infer T> ? T : never;
27
28
 
28
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
29
+ // eslint-disable-next-line
29
30
  type SecondParameter<T extends (...args: any) => any> = T extends (
30
31
  config: any,
31
32
  args: infer P
@@ -76,10 +77,9 @@ export const useGetVersion = <
76
77
  queryKey,
77
78
  queryFn,
78
79
  queryOptions
79
- );
80
+ ) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
80
81
 
81
- return {
82
- queryKey,
83
- ...query,
84
- };
82
+ query.queryKey = queryKey;
83
+
84
+ return query;
85
85
  };
package/src/unit/unit.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Generated by orval v6.8.0 🍺
2
+ * Generated by orval v6.9.0 🍺
3
3
  * Do not edit manually.
4
4
  * Account Server API
5
5
  * The Informatics Matters Account Server API.
@@ -8,9 +8,8 @@ A service that provides access to the Account Server, which gives *registered* u
8
8
 
9
9
  * OpenAPI spec version: 0.1
10
10
  */
11
- import {
12
- useQuery,
13
- useMutation,
11
+ import { useQuery, useMutation } from "react-query";
12
+ import type {
14
13
  UseQueryOptions,
15
14
  UseMutationOptions,
16
15
  QueryFunction,
@@ -27,13 +26,14 @@ import type {
27
26
  UnitsGetResponse,
28
27
  PersonalUnitPutResponse,
29
28
  } from "../account-server-api.schemas";
30
- import { customInstance, ErrorType } from ".././custom-instance";
29
+ import { customInstance } from ".././custom-instance";
30
+ import type { ErrorType } from ".././custom-instance";
31
31
 
32
- export type AwaitedInput<T> = PromiseLike<T> | T;
32
+ type AwaitedInput<T> = PromiseLike<T> | T;
33
33
 
34
- export type Awaited<O> = O extends AwaitedInput<infer T> ? T : never;
34
+ type Awaited<O> = O extends AwaitedInput<infer T> ? T : never;
35
35
 
36
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
36
+ // eslint-disable-next-line
37
37
  type SecondParameter<T extends (...args: any) => any> = T extends (
38
38
  config: any,
39
39
  args: infer P
@@ -93,12 +93,14 @@ export const useGetOrganisationUnits = <
93
93
  Awaited<ReturnType<typeof getOrganisationUnits>>,
94
94
  TError,
95
95
  TData
96
- >(queryKey, queryFn, { enabled: !!orgId, ...queryOptions });
96
+ >(queryKey, queryFn, { enabled: !!orgId, ...queryOptions }) as UseQueryResult<
97
+ TData,
98
+ TError
99
+ > & { queryKey: QueryKey };
97
100
 
98
- return {
99
- queryKey,
100
- ...query,
101
- };
101
+ query.queryKey = queryKey;
102
+
103
+ return query;
102
104
  };
103
105
 
104
106
  /**
@@ -203,12 +205,11 @@ export const useGetUnit = <
203
205
  queryKey,
204
206
  queryFn,
205
207
  { enabled: !!unitId, ...queryOptions }
206
- );
208
+ ) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
207
209
 
208
- return {
209
- queryKey,
210
- ...query,
211
- };
210
+ query.queryKey = queryKey;
211
+
212
+ return query;
212
213
  };
213
214
 
214
215
  /**
@@ -303,12 +304,11 @@ export const useGetUnits = <
303
304
  queryKey,
304
305
  queryFn,
305
306
  queryOptions
306
- );
307
+ ) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
307
308
 
308
- return {
309
- queryKey,
310
- ...query,
311
- };
309
+ query.queryKey = queryKey;
310
+
311
+ return query;
312
312
  };
313
313
 
314
314
  /**