@squonk/account-server-client 1.0.2-rc.3 → 1.0.3-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 (48) hide show
  1. package/asset/asset.cjs +34 -18
  2. package/asset/asset.cjs.map +1 -1
  3. package/asset/asset.d.ts +16 -16
  4. package/asset/asset.js +35 -19
  5. package/asset/asset.js.map +1 -1
  6. package/{custom-instance-b8075093.d.ts → custom-instance-93fb01eb.d.ts} +22 -20
  7. package/index.cjs.map +1 -1
  8. package/index.d.ts +1 -1
  9. package/index.js.map +1 -1
  10. package/merchant/merchant.cjs +15 -13
  11. package/merchant/merchant.cjs.map +1 -1
  12. package/merchant/merchant.d.ts +1 -1
  13. package/merchant/merchant.js +16 -14
  14. package/merchant/merchant.js.map +1 -1
  15. package/organisation/organisation.cjs +18 -6
  16. package/organisation/organisation.cjs.map +1 -1
  17. package/organisation/organisation.d.ts +7 -7
  18. package/organisation/organisation.js +19 -7
  19. package/organisation/organisation.js.map +1 -1
  20. package/package.json +1 -1
  21. package/product/product.cjs +47 -38
  22. package/product/product.cjs.map +1 -1
  23. package/product/product.d.ts +10 -10
  24. package/product/product.js +48 -39
  25. package/product/product.js.map +1 -1
  26. package/src/account-server-api.schemas.ts +73 -87
  27. package/src/asset/asset.ts +248 -345
  28. package/src/merchant/merchant.ts +62 -84
  29. package/src/organisation/organisation.ts +131 -184
  30. package/src/product/product.ts +279 -422
  31. package/src/state/state.ts +36 -42
  32. package/src/unit/unit.ts +218 -301
  33. package/src/user/user.ts +224 -327
  34. package/state/state.cjs +9 -9
  35. package/state/state.cjs.map +1 -1
  36. package/state/state.d.ts +1 -1
  37. package/state/state.js +10 -10
  38. package/state/state.js.map +1 -1
  39. package/unit/unit.cjs +40 -25
  40. package/unit/unit.cjs.map +1 -1
  41. package/unit/unit.d.ts +10 -10
  42. package/unit/unit.js +41 -26
  43. package/unit/unit.js.map +1 -1
  44. package/user/user.cjs +38 -20
  45. package/user/user.cjs.map +1 -1
  46. package/user/user.d.ts +10 -10
  47. package/user/user.js +39 -21
  48. package/user/user.js.map +1 -1
package/asset/asset.cjs CHANGED
@@ -3,28 +3,27 @@
3
3
  var _chunkIUEU2LYCcjs = require('../chunk-IUEU2LYC.cjs');
4
4
 
5
5
  // src/asset/asset.ts
6
+
7
+
8
+
6
9
  var _reactquery = require('react-query');
7
10
  var getAsset = (params, options, signal) => {
8
11
  return _chunkIUEU2LYCcjs.customInstance.call(void 0,
9
- { url: `/asset`, method: "get", params, signal },
12
+ {
13
+ url: `/asset`,
14
+ method: "get",
15
+ params,
16
+ signal
17
+ },
10
18
  options
11
19
  );
12
20
  };
13
- var getGetAssetQueryKey = (params) => [
14
- `/asset`,
15
- ...params ? [params] : []
16
- ];
21
+ var getGetAssetQueryKey = (params) => [`/asset`, ...params ? [params] : []];
17
22
  var useGetAsset = (params, options) => {
18
23
  const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
19
24
  const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetAssetQueryKey(params)));
20
- const queryFn = ({
21
- signal
22
- }) => getAsset(params, requestOptions, signal);
23
- const query = _reactquery.useQuery.call(void 0,
24
- queryKey,
25
- queryFn,
26
- queryOptions
27
- );
25
+ const queryFn = ({ signal }) => getAsset(params, requestOptions, signal);
26
+ const query = _reactquery.useQuery.call(void 0, queryKey, queryFn, queryOptions);
28
27
  query.queryKey = queryKey;
29
28
  return query;
30
29
  };
@@ -65,7 +64,10 @@ var useCreateAsset = (options) => {
65
64
  };
66
65
  var deleteAsset = (assetId, options) => {
67
66
  return _chunkIUEU2LYCcjs.customInstance.call(void 0,
68
- { url: `/asset/${assetId}`, method: "delete" },
67
+ {
68
+ url: `/asset/${assetId}`,
69
+ method: "delete"
70
+ },
69
71
  options
70
72
  );
71
73
  };
@@ -79,7 +81,10 @@ var useDeleteAsset = (options) => {
79
81
  };
80
82
  var disableAsset = (assetId, options) => {
81
83
  return _chunkIUEU2LYCcjs.customInstance.call(void 0,
82
- { url: `/asset/${assetId}/disable`, method: "patch" },
84
+ {
85
+ url: `/asset/${assetId}/disable`,
86
+ method: "patch"
87
+ },
83
88
  options
84
89
  );
85
90
  };
@@ -93,7 +98,10 @@ var useDisableAsset = (options) => {
93
98
  };
94
99
  var enableAsset = (assetId, options) => {
95
100
  return _chunkIUEU2LYCcjs.customInstance.call(void 0,
96
- { url: `/asset/${assetId}/enable`, method: "patch" },
101
+ {
102
+ url: `/asset/${assetId}/enable`,
103
+ method: "patch"
104
+ },
97
105
  options
98
106
  );
99
107
  };
@@ -107,7 +115,11 @@ var useEnableAsset = (options) => {
107
115
  };
108
116
  var attachAsset = (assetId, params, options) => {
109
117
  return _chunkIUEU2LYCcjs.customInstance.call(void 0,
110
- { url: `/asset/${assetId}/attach`, method: "patch", params },
118
+ {
119
+ url: `/asset/${assetId}/attach`,
120
+ method: "patch",
121
+ params
122
+ },
111
123
  options
112
124
  );
113
125
  };
@@ -121,7 +133,11 @@ var useAttachAsset = (options) => {
121
133
  };
122
134
  var detachAsset = (assetId, params, options) => {
123
135
  return _chunkIUEU2LYCcjs.customInstance.call(void 0,
124
- { url: `/asset/${assetId}/detach`, method: "patch", params },
136
+ {
137
+ url: `/asset/${assetId}/detach`,
138
+ method: "patch",
139
+ params
140
+ },
125
141
  options
126
142
  );
127
143
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/asset/asset.ts"],"names":[],"mappings":";;;;;AAUA,SAAS,UAAU,mBAAmB;AAkC/B,IAAM,WAAW,CACtB,QACA,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,UAAU,QAAQ,OAAO,QAAQ,OAAO;AAAA,IAC/C;AAAA,EACF;AACF;AAEO,IAAM,sBAAsB,CAAC,WAA4B;AAAA,EAC9D;AAAA,EACA,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC;AAC3B;AAOO,IAAM,cAAc,CAIzB,QACA,YAQ2D;AAC3D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IAC3D;AAAA,EACF;AACF;AAQO,IAAM,iBAAiB,CAG5B,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,eAAe,IAAI,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,SAAS,OAAO,IAAI,SAAS,CAAC;AAEtC,WAAO,YAAY,SAAS,QAAQ,cAAc;AAAA,EACpD;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B;AAMO,IAAM,cAAc,CACzB,SACA,QACA,YACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,UAAU,kBAAkB,QAAQ,SAAS,OAAO;AAAA,IAC3D;AAAA,EACF;AACF;AAQO,IAAM,iBAAiB,CAG5B,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,eAAe,IAAI,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,SAAS,OAAO,IAAI,SAAS,CAAC;AAEtC,WAAO,YAAY,SAAS,QAAQ,cAAc;AAAA,EACpD;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B","sourcesContent":["/**\n * Generated by orval v6.9.1 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Products**, **Organisations**, **Units** and **Users**.\n\n * OpenAPI spec version: 1.0\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 AssetGetResponse,\n AsError,\n GetAssetParams,\n AssetPostResponse,\n AssetPostBodyBody,\n AttachAssetParams,\n DetachAssetParams,\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 Assets\n\n * @summary Gets Assets\n */\nexport const getAsset = (\n params?: GetAssetParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<AssetGetResponse>(\n { url: `/asset`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetAssetQueryKey = (params?: GetAssetParams) => [\n `/asset`,\n ...(params ? [params] : []),\n];\n\nexport type GetAssetQueryResult = NonNullable<\n Awaited<ReturnType<typeof getAsset>>\n>;\nexport type GetAssetQueryError = ErrorType<AsError | void>;\n\nexport const useGetAsset = <\n TData = Awaited<ReturnType<typeof getAsset>>,\n TError = ErrorType<AsError | void>\n>(\n params?: GetAssetParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getAsset>>,\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 ?? getGetAssetQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getAsset>>> = ({\n signal,\n }) => getAsset(params, requestOptions, signal);\n\n const query = useQuery<Awaited<ReturnType<typeof getAsset>>, TError, TData>(\n queryKey,\n queryFn,\n queryOptions\n ) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * Creates an Asset, which can be attached to our User account, or a Product, Unit or Organisation you have access to\n\n * @summary Create an Asset\n */\nexport const createAsset = (\n assetPostBodyBody: AssetPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"name\", assetPostBodyBody.name);\n if (assetPostBodyBody.content_file !== undefined) {\n formData.append(\"content_file\", assetPostBodyBody.content_file);\n }\n if (assetPostBodyBody.content_string !== undefined) {\n formData.append(\"content_string\", assetPostBodyBody.content_string);\n }\n formData.append(\"scope\", assetPostBodyBody.scope);\n if (assetPostBodyBody.scope_id !== undefined) {\n formData.append(\"scope_id\", assetPostBodyBody.scope_id);\n }\n formData.append(\"secret\", assetPostBodyBody.secret.toString());\n if (assetPostBodyBody.description !== undefined) {\n formData.append(\"description\", assetPostBodyBody.description);\n }\n\n return customInstance<AssetPostResponse>(\n {\n url: `/asset`,\n method: \"post\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type CreateAssetMutationResult = NonNullable<\n Awaited<ReturnType<typeof createAsset>>\n>;\nexport type CreateAssetMutationBody = AssetPostBodyBody;\nexport type CreateAssetMutationError = ErrorType<AsError | void>;\n\nexport const useCreateAsset = <\n TError = ErrorType<AsError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createAsset>>,\n TError,\n { data: AssetPostBodyBody },\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 createAsset>>,\n { data: AssetPostBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return createAsset(data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof createAsset>>,\n TError,\n { data: AssetPostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Deletes a known Asset. Assets that are attached to merchants cannot be deleted\n\n * @summary Deletes an Asset\n */\nexport const deleteAsset = (\n assetId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/asset/${assetId}`, method: \"delete\" },\n options\n );\n};\n\nexport type DeleteAssetMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteAsset>>\n>;\n\nexport type DeleteAssetMutationError = ErrorType<AsError>;\n\nexport const useDeleteAsset = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteAsset>>,\n TError,\n { assetId: 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 deleteAsset>>,\n { assetId: string }\n > = (props) => {\n const { assetId } = props ?? {};\n\n return deleteAsset(assetId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof deleteAsset>>,\n TError,\n { assetId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Disables a known Asset\n\n * @summary Disables an Asset\n */\nexport const disableAsset = (\n assetId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/asset/${assetId}/disable`, method: \"patch\" },\n options\n );\n};\n\nexport type DisableAssetMutationResult = NonNullable<\n Awaited<ReturnType<typeof disableAsset>>\n>;\n\nexport type DisableAssetMutationError = ErrorType<AsError>;\n\nexport const useDisableAsset = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof disableAsset>>,\n TError,\n { assetId: 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 disableAsset>>,\n { assetId: string }\n > = (props) => {\n const { assetId } = props ?? {};\n\n return disableAsset(assetId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof disableAsset>>,\n TError,\n { assetId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Enables a known Asset\n\n * @summary Enables an Asset\n */\nexport const enableAsset = (\n assetId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/asset/${assetId}/enable`, method: \"patch\" },\n options\n );\n};\n\nexport type EnableAssetMutationResult = NonNullable<\n Awaited<ReturnType<typeof enableAsset>>\n>;\n\nexport type EnableAssetMutationError = ErrorType<AsError>;\n\nexport const useEnableAsset = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof enableAsset>>,\n TError,\n { assetId: 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 enableAsset>>,\n { assetId: string }\n > = (props) => {\n const { assetId } = props ?? {};\n\n return enableAsset(assetId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof enableAsset>>,\n TError,\n { assetId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Attaches an Asset to a merchant\n\n * @summary Attaches an Asset to a Merchant\n */\nexport const attachAsset = (\n assetId: string,\n params?: AttachAssetParams,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/asset/${assetId}/attach`, method: \"patch\", params },\n options\n );\n};\n\nexport type AttachAssetMutationResult = NonNullable<\n Awaited<ReturnType<typeof attachAsset>>\n>;\n\nexport type AttachAssetMutationError = ErrorType<AsError>;\n\nexport const useAttachAsset = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof attachAsset>>,\n TError,\n { assetId: string; params?: AttachAssetParams },\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 attachAsset>>,\n { assetId: string; params?: AttachAssetParams }\n > = (props) => {\n const { assetId, params } = props ?? {};\n\n return attachAsset(assetId, params, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof attachAsset>>,\n TError,\n { assetId: string; params?: AttachAssetParams },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Detaches an Asset from a merchant\n\n * @summary Detaches an Asset from a Merchant\n */\nexport const detachAsset = (\n assetId: string,\n params?: DetachAssetParams,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/asset/${assetId}/detach`, method: \"patch\", params },\n options\n );\n};\n\nexport type DetachAssetMutationResult = NonNullable<\n Awaited<ReturnType<typeof detachAsset>>\n>;\n\nexport type DetachAssetMutationError = ErrorType<AsError>;\n\nexport const useDetachAsset = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof detachAsset>>,\n TError,\n { assetId: string; params?: DetachAssetParams },\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 detachAsset>>,\n { assetId: string; params?: DetachAssetParams }\n > = (props) => {\n const { assetId, params } = props ?? {};\n\n return detachAsset(assetId, params, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof detachAsset>>,\n TError,\n { assetId: string; params?: DetachAssetParams },\n TContext\n >(mutationFn, mutationOptions);\n};\n"]}
1
+ {"version":3,"sources":["../../src/asset/asset.ts"],"names":[],"mappings":";;;;;AAUA;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAmCA,IAAM,WAAW,CACpB,QACH,SAAiD,WAC7C;AACC,SAAO;AAAA,IACP;AAAA,MAAC,KAAK;AAAA,MAAU,QAAQ;AAAA,MACtB;AAAA,MAAQ;AAAA,IACZ;AAAA,IACE;AAAA,EAAO;AACT;AAGG,IAAM,sBAAsB,CAAC,WAA6B,CAAC,UAAU,GAAI,SAAS,CAAC,MAAM,IAAG,CAAC,CAAE;AAM/F,IAAM,cAAc,CAC1B,QAAyB,YAEsC;AAE9D,QAAM,EAAC,OAAO,cAAc,SAAS,eAAc,IAAI,WAAW,CAAC;AAEnE,QAAM,YAAW,6CAAc,aAAY,oBAAoB,MAAM;AAIrE,QAAM,UAA+D,CAAC,EAAE,OAAO,MAAM,SAAS,QAAQ,gBAAgB,MAAM;AAE5H,QAAM,QAAQ,SAA8D,UAAU,SAAS,YAAY;AAE3G,QA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,UAAM,EAAC,SAAQ,OAAM,IAAI,SAAS,CAAC;AAEnC,WAAQ,YAAY,SAAQ,QAAO,cAAc;AAAA,EACnD;AAEF,SAAO,YAAqH,YAAY,eAAe;AACzJ;AAMG,IAAM,cAAc,CACvB,SACA,QACH,YAAsD;AACjD,SAAO;AAAA,IACP;AAAA,MAAC,KAAK,UAAU;AAAA,MAAkB,QAAQ;AAAA,MACxC;AAAA,IACJ;AAAA,IACE;AAAA,EAAO;AACT;AAQO,IAAM,iBAAiB,CAEV,YACnB;AACC,QAAM,EAAC,UAAU,iBAAiB,SAAS,eAAc,IAAI,WAAW,CAAC;AAKzE,QAAM,aAAsH,CAAC,UAAU;AACnI,UAAM,EAAC,SAAQ,OAAM,IAAI,SAAS,CAAC;AAEnC,WAAQ,YAAY,SAAQ,QAAO,cAAc;AAAA,EACnD;AAEF,SAAO,YAAqH,YAAY,eAAe;AACzJ","sourcesContent":["/**\n * Generated by orval v6.9.1 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Products**, **Organisations**, **Units** and **Users**.\n\n * OpenAPI spec version: 1.0\n */\nimport {\n useQuery,\n useMutation\n} from 'react-query'\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey\n} from 'react-query'\nimport type {\n AssetGetResponse,\n AsError,\n GetAssetParams,\n AssetPostResponse,\n AssetPostBodyBody,\n AttachAssetParams,\n DetachAssetParams\n} from '../account-server-api.schemas'\nimport { customInstance } from '.././custom-instance'\nimport type { ErrorType } from '.././custom-instance'\n\n\n// eslint-disable-next-line\n type 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 Assets\n\n * @summary Gets Assets\n */\nexport const getAsset = (\n params?: GetAssetParams,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n return customInstance<AssetGetResponse>(\n {url: `/asset`, method: 'get',\n params, signal\n },\n options);\n }\n \n\nexport const getGetAssetQueryKey = (params?: GetAssetParams,) => [`/asset`, ...(params ? [params]: [])];\n\n \nexport type GetAssetQueryResult = NonNullable<Awaited<ReturnType<typeof getAsset>>>\nexport type GetAssetQueryError = ErrorType<AsError | void>\n\nexport const useGetAsset = <TData = Awaited<ReturnType<typeof getAsset>>, TError = ErrorType<AsError | void>>(\n params?: GetAssetParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const {query: queryOptions, request: requestOptions} = options ?? {}\n\n const queryKey = queryOptions?.queryKey ?? getGetAssetQueryKey(params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getAsset>>> = ({ signal }) => getAsset(params, requestOptions, signal);\n\n const query = useQuery<Awaited<ReturnType<typeof getAsset>>, TError, TData>(queryKey, queryFn, queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n}\n\n/**\n * Creates an Asset, which can be attached to our User account, or a Product, Unit or Organisation you have access to\n\n * @summary Create an Asset\n */\nexport const createAsset = (\n assetPostBodyBody: AssetPostBodyBody,\n options?: SecondParameter<typeof customInstance>,) => {const formData = new FormData();\nformData.append('name', assetPostBodyBody.name)\nif(assetPostBodyBody.content_file !== undefined) {\n formData.append('content_file', assetPostBodyBody.content_file)\n }\nif(assetPostBodyBody.content_string !== undefined) {\n formData.append('content_string', assetPostBodyBody.content_string)\n }\nformData.append('scope', assetPostBodyBody.scope)\nif(assetPostBodyBody.scope_id !== undefined) {\n formData.append('scope_id', assetPostBodyBody.scope_id)\n }\nformData.append('secret', assetPostBodyBody.secret.toString())\nif(assetPostBodyBody.description !== undefined) {\n formData.append('description', assetPostBodyBody.description)\n }\n\n return customInstance<AssetPostResponse>(\n {url: `/asset`, method: 'post',\n headers: {'Content-Type': 'multipart/form-data', },\n data: formData\n },\n options);\n }\n \n\n\n export type CreateAssetMutationResult = NonNullable<Awaited<ReturnType<typeof createAsset>>>\n export type CreateAssetMutationBody = AssetPostBodyBody\n export type CreateAssetMutationError = ErrorType<AsError | void>\n\n export const useCreateAsset = <TError = ErrorType<AsError | void>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createAsset>>, TError,{data: AssetPostBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {}\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof createAsset>>, {data: AssetPostBodyBody}> = (props) => {\n const {data} = props ?? {};\n\n return createAsset(data,requestOptions)\n }\n\n return useMutation<Awaited<ReturnType<typeof createAsset>>, TError, {data: AssetPostBodyBody}, TContext>(mutationFn, mutationOptions)\n }\n /**\n * Deletes a known Asset. Assets that are attached to merchants cannot be deleted\n\n * @summary Deletes an Asset\n */\nexport const deleteAsset = (\n assetId: string,\n options?: SecondParameter<typeof customInstance>,) => {\n return customInstance<void>(\n {url: `/asset/${assetId}`, method: 'delete'\n },\n options);\n }\n \n\n\n export type DeleteAssetMutationResult = NonNullable<Awaited<ReturnType<typeof deleteAsset>>>\n \n export type DeleteAssetMutationError = ErrorType<AsError>\n\n export const useDeleteAsset = <TError = ErrorType<AsError>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteAsset>>, TError,{assetId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {}\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteAsset>>, {assetId: string}> = (props) => {\n const {assetId} = props ?? {};\n\n return deleteAsset(assetId,requestOptions)\n }\n\n return useMutation<Awaited<ReturnType<typeof deleteAsset>>, TError, {assetId: string}, TContext>(mutationFn, mutationOptions)\n }\n /**\n * Disables a known Asset\n\n * @summary Disables an Asset\n */\nexport const disableAsset = (\n assetId: string,\n options?: SecondParameter<typeof customInstance>,) => {\n return customInstance<void>(\n {url: `/asset/${assetId}/disable`, method: 'patch'\n },\n options);\n }\n \n\n\n export type DisableAssetMutationResult = NonNullable<Awaited<ReturnType<typeof disableAsset>>>\n \n export type DisableAssetMutationError = ErrorType<AsError>\n\n export const useDisableAsset = <TError = ErrorType<AsError>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof disableAsset>>, TError,{assetId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {}\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof disableAsset>>, {assetId: string}> = (props) => {\n const {assetId} = props ?? {};\n\n return disableAsset(assetId,requestOptions)\n }\n\n return useMutation<Awaited<ReturnType<typeof disableAsset>>, TError, {assetId: string}, TContext>(mutationFn, mutationOptions)\n }\n /**\n * Enables a known Asset\n\n * @summary Enables an Asset\n */\nexport const enableAsset = (\n assetId: string,\n options?: SecondParameter<typeof customInstance>,) => {\n return customInstance<void>(\n {url: `/asset/${assetId}/enable`, method: 'patch'\n },\n options);\n }\n \n\n\n export type EnableAssetMutationResult = NonNullable<Awaited<ReturnType<typeof enableAsset>>>\n \n export type EnableAssetMutationError = ErrorType<AsError>\n\n export const useEnableAsset = <TError = ErrorType<AsError>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof enableAsset>>, TError,{assetId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {}\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof enableAsset>>, {assetId: string}> = (props) => {\n const {assetId} = props ?? {};\n\n return enableAsset(assetId,requestOptions)\n }\n\n return useMutation<Awaited<ReturnType<typeof enableAsset>>, TError, {assetId: string}, TContext>(mutationFn, mutationOptions)\n }\n /**\n * Attaches an Asset to a merchant\n\n * @summary Attaches an Asset to a Merchant\n */\nexport const attachAsset = (\n assetId: string,\n params?: AttachAssetParams,\n options?: SecondParameter<typeof customInstance>,) => {\n return customInstance<void>(\n {url: `/asset/${assetId}/attach`, method: 'patch',\n params\n },\n options);\n }\n \n\n\n export type AttachAssetMutationResult = NonNullable<Awaited<ReturnType<typeof attachAsset>>>\n \n export type AttachAssetMutationError = ErrorType<AsError>\n\n export const useAttachAsset = <TError = ErrorType<AsError>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof attachAsset>>, TError,{assetId: string;params?: AttachAssetParams}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {}\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof attachAsset>>, {assetId: string;params?: AttachAssetParams}> = (props) => {\n const {assetId,params} = props ?? {};\n\n return attachAsset(assetId,params,requestOptions)\n }\n\n return useMutation<Awaited<ReturnType<typeof attachAsset>>, TError, {assetId: string;params?: AttachAssetParams}, TContext>(mutationFn, mutationOptions)\n }\n /**\n * Detaches an Asset from a merchant\n\n * @summary Detaches an Asset from a Merchant\n */\nexport const detachAsset = (\n assetId: string,\n params?: DetachAssetParams,\n options?: SecondParameter<typeof customInstance>,) => {\n return customInstance<void>(\n {url: `/asset/${assetId}/detach`, method: 'patch',\n params\n },\n options);\n }\n \n\n\n export type DetachAssetMutationResult = NonNullable<Awaited<ReturnType<typeof detachAsset>>>\n \n export type DetachAssetMutationError = ErrorType<AsError>\n\n export const useDetachAsset = <TError = ErrorType<AsError>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof detachAsset>>, TError,{assetId: string;params?: DetachAssetParams}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {}\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof detachAsset>>, {assetId: string;params?: DetachAssetParams}> = (props) => {\n const {assetId,params} = props ?? {};\n\n return detachAsset(assetId,params,requestOptions)\n }\n\n return useMutation<Awaited<ReturnType<typeof detachAsset>>, TError, {assetId: string;params?: DetachAssetParams}, TContext>(mutationFn, mutationOptions)\n }\n "]}
package/asset/asset.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_query from 'react-query';
2
2
  import { UseQueryOptions, QueryKey, UseQueryResult, UseMutationOptions } from 'react-query';
3
- import { e as GetAssetParams, ak as customInstance, af as AssetGetResponse, al as ErrorType, ag as AsError, l as AssetPostBodyBody, ae as AssetPostResponse, A as AttachAssetParams, D as DetachAssetParams } from '../custom-instance-b8075093.js';
3
+ import { e as GetAssetParams, ak as customInstance, af as AssetGetResponse, al as ErrorType, ag as AsError, l as AssetPostBodyBody, ae as AssetPostResponse, A as AttachAssetParams, D as DetachAssetParams } from '../custom-instance-93fb01eb.js';
4
4
  import 'axios';
5
5
 
6
6
  declare type SecondParameter<T extends (...args: any) => any> = T extends (config: any, args: infer P) => any ? P : never;
@@ -37,10 +37,10 @@ declare const useCreateAsset: <TError = ErrorType<void | AsError>, TContext = un
37
37
  data: AssetPostBodyBody;
38
38
  }, TContext>;
39
39
  /**
40
- * Deletes a known Asset. Assets that are attached to merchants cannot be deleted
40
+ * Deletes a known Asset. Assets that are attached to merchants cannot be deleted
41
41
 
42
- * @summary Deletes an Asset
43
- */
42
+ * @summary Deletes an Asset
43
+ */
44
44
  declare const deleteAsset: (assetId: string, options?: SecondParameter<typeof customInstance>) => Promise<void>;
45
45
  declare type DeleteAssetMutationResult = NonNullable<Awaited<ReturnType<typeof deleteAsset>>>;
46
46
  declare type DeleteAssetMutationError = ErrorType<AsError>;
@@ -53,10 +53,10 @@ declare const useDeleteAsset: <TError = ErrorType<AsError>, TContext = unknown>(
53
53
  assetId: string;
54
54
  }, TContext>;
55
55
  /**
56
- * Disables a known Asset
56
+ * Disables a known Asset
57
57
 
58
- * @summary Disables an Asset
59
- */
58
+ * @summary Disables an Asset
59
+ */
60
60
  declare const disableAsset: (assetId: string, options?: SecondParameter<typeof customInstance>) => Promise<void>;
61
61
  declare type DisableAssetMutationResult = NonNullable<Awaited<ReturnType<typeof disableAsset>>>;
62
62
  declare type DisableAssetMutationError = ErrorType<AsError>;
@@ -69,10 +69,10 @@ declare const useDisableAsset: <TError = ErrorType<AsError>, TContext = unknown>
69
69
  assetId: string;
70
70
  }, TContext>;
71
71
  /**
72
- * Enables a known Asset
72
+ * Enables a known Asset
73
73
 
74
- * @summary Enables an Asset
75
- */
74
+ * @summary Enables an Asset
75
+ */
76
76
  declare const enableAsset: (assetId: string, options?: SecondParameter<typeof customInstance>) => Promise<void>;
77
77
  declare type EnableAssetMutationResult = NonNullable<Awaited<ReturnType<typeof enableAsset>>>;
78
78
  declare type EnableAssetMutationError = ErrorType<AsError>;
@@ -85,10 +85,10 @@ declare const useEnableAsset: <TError = ErrorType<AsError>, TContext = unknown>(
85
85
  assetId: string;
86
86
  }, TContext>;
87
87
  /**
88
- * Attaches an Asset to a merchant
88
+ * Attaches an Asset to a merchant
89
89
 
90
- * @summary Attaches an Asset to a Merchant
91
- */
90
+ * @summary Attaches an Asset to a Merchant
91
+ */
92
92
  declare const attachAsset: (assetId: string, params?: AttachAssetParams | undefined, options?: SecondParameter<typeof customInstance>) => Promise<void>;
93
93
  declare type AttachAssetMutationResult = NonNullable<Awaited<ReturnType<typeof attachAsset>>>;
94
94
  declare type AttachAssetMutationError = ErrorType<AsError>;
@@ -103,10 +103,10 @@ declare const useAttachAsset: <TError = ErrorType<AsError>, TContext = unknown>(
103
103
  params?: AttachAssetParams | undefined;
104
104
  }, TContext>;
105
105
  /**
106
- * Detaches an Asset from a merchant
106
+ * Detaches an Asset from a merchant
107
107
 
108
- * @summary Detaches an Asset from a Merchant
109
- */
108
+ * @summary Detaches an Asset from a Merchant
109
+ */
110
110
  declare const detachAsset: (assetId: string, params?: DetachAssetParams | undefined, options?: SecondParameter<typeof customInstance>) => Promise<void>;
111
111
  declare type DetachAssetMutationResult = NonNullable<Awaited<ReturnType<typeof detachAsset>>>;
112
112
  declare type DetachAssetMutationError = ErrorType<AsError>;
package/asset/asset.js CHANGED
@@ -3,28 +3,27 @@ import {
3
3
  } from "../chunk-3O5KIRV4.js";
4
4
 
5
5
  // src/asset/asset.ts
6
- import { useQuery, useMutation } from "react-query";
6
+ import {
7
+ useQuery,
8
+ useMutation
9
+ } from "react-query";
7
10
  var getAsset = (params, options, signal) => {
8
11
  return customInstance(
9
- { url: `/asset`, method: "get", params, signal },
12
+ {
13
+ url: `/asset`,
14
+ method: "get",
15
+ params,
16
+ signal
17
+ },
10
18
  options
11
19
  );
12
20
  };
13
- var getGetAssetQueryKey = (params) => [
14
- `/asset`,
15
- ...params ? [params] : []
16
- ];
21
+ var getGetAssetQueryKey = (params) => [`/asset`, ...params ? [params] : []];
17
22
  var useGetAsset = (params, options) => {
18
23
  const { query: queryOptions, request: requestOptions } = options ?? {};
19
24
  const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetAssetQueryKey(params);
20
- const queryFn = ({
21
- signal
22
- }) => getAsset(params, requestOptions, signal);
23
- const query = useQuery(
24
- queryKey,
25
- queryFn,
26
- queryOptions
27
- );
25
+ const queryFn = ({ signal }) => getAsset(params, requestOptions, signal);
26
+ const query = useQuery(queryKey, queryFn, queryOptions);
28
27
  query.queryKey = queryKey;
29
28
  return query;
30
29
  };
@@ -65,7 +64,10 @@ var useCreateAsset = (options) => {
65
64
  };
66
65
  var deleteAsset = (assetId, options) => {
67
66
  return customInstance(
68
- { url: `/asset/${assetId}`, method: "delete" },
67
+ {
68
+ url: `/asset/${assetId}`,
69
+ method: "delete"
70
+ },
69
71
  options
70
72
  );
71
73
  };
@@ -79,7 +81,10 @@ var useDeleteAsset = (options) => {
79
81
  };
80
82
  var disableAsset = (assetId, options) => {
81
83
  return customInstance(
82
- { url: `/asset/${assetId}/disable`, method: "patch" },
84
+ {
85
+ url: `/asset/${assetId}/disable`,
86
+ method: "patch"
87
+ },
83
88
  options
84
89
  );
85
90
  };
@@ -93,7 +98,10 @@ var useDisableAsset = (options) => {
93
98
  };
94
99
  var enableAsset = (assetId, options) => {
95
100
  return customInstance(
96
- { url: `/asset/${assetId}/enable`, method: "patch" },
101
+ {
102
+ url: `/asset/${assetId}/enable`,
103
+ method: "patch"
104
+ },
97
105
  options
98
106
  );
99
107
  };
@@ -107,7 +115,11 @@ var useEnableAsset = (options) => {
107
115
  };
108
116
  var attachAsset = (assetId, params, options) => {
109
117
  return customInstance(
110
- { url: `/asset/${assetId}/attach`, method: "patch", params },
118
+ {
119
+ url: `/asset/${assetId}/attach`,
120
+ method: "patch",
121
+ params
122
+ },
111
123
  options
112
124
  );
113
125
  };
@@ -121,7 +133,11 @@ var useAttachAsset = (options) => {
121
133
  };
122
134
  var detachAsset = (assetId, params, options) => {
123
135
  return customInstance(
124
- { url: `/asset/${assetId}/detach`, method: "patch", params },
136
+ {
137
+ url: `/asset/${assetId}/detach`,
138
+ method: "patch",
139
+ params
140
+ },
125
141
  options
126
142
  );
127
143
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/asset/asset.ts"],"sourcesContent":["/**\n * Generated by orval v6.9.1 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Products**, **Organisations**, **Units** and **Users**.\n\n * OpenAPI spec version: 1.0\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 AssetGetResponse,\n AsError,\n GetAssetParams,\n AssetPostResponse,\n AssetPostBodyBody,\n AttachAssetParams,\n DetachAssetParams,\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 Assets\n\n * @summary Gets Assets\n */\nexport const getAsset = (\n params?: GetAssetParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<AssetGetResponse>(\n { url: `/asset`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetAssetQueryKey = (params?: GetAssetParams) => [\n `/asset`,\n ...(params ? [params] : []),\n];\n\nexport type GetAssetQueryResult = NonNullable<\n Awaited<ReturnType<typeof getAsset>>\n>;\nexport type GetAssetQueryError = ErrorType<AsError | void>;\n\nexport const useGetAsset = <\n TData = Awaited<ReturnType<typeof getAsset>>,\n TError = ErrorType<AsError | void>\n>(\n params?: GetAssetParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getAsset>>,\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 ?? getGetAssetQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getAsset>>> = ({\n signal,\n }) => getAsset(params, requestOptions, signal);\n\n const query = useQuery<Awaited<ReturnType<typeof getAsset>>, TError, TData>(\n queryKey,\n queryFn,\n queryOptions\n ) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * Creates an Asset, which can be attached to our User account, or a Product, Unit or Organisation you have access to\n\n * @summary Create an Asset\n */\nexport const createAsset = (\n assetPostBodyBody: AssetPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"name\", assetPostBodyBody.name);\n if (assetPostBodyBody.content_file !== undefined) {\n formData.append(\"content_file\", assetPostBodyBody.content_file);\n }\n if (assetPostBodyBody.content_string !== undefined) {\n formData.append(\"content_string\", assetPostBodyBody.content_string);\n }\n formData.append(\"scope\", assetPostBodyBody.scope);\n if (assetPostBodyBody.scope_id !== undefined) {\n formData.append(\"scope_id\", assetPostBodyBody.scope_id);\n }\n formData.append(\"secret\", assetPostBodyBody.secret.toString());\n if (assetPostBodyBody.description !== undefined) {\n formData.append(\"description\", assetPostBodyBody.description);\n }\n\n return customInstance<AssetPostResponse>(\n {\n url: `/asset`,\n method: \"post\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type CreateAssetMutationResult = NonNullable<\n Awaited<ReturnType<typeof createAsset>>\n>;\nexport type CreateAssetMutationBody = AssetPostBodyBody;\nexport type CreateAssetMutationError = ErrorType<AsError | void>;\n\nexport const useCreateAsset = <\n TError = ErrorType<AsError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createAsset>>,\n TError,\n { data: AssetPostBodyBody },\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 createAsset>>,\n { data: AssetPostBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return createAsset(data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof createAsset>>,\n TError,\n { data: AssetPostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Deletes a known Asset. Assets that are attached to merchants cannot be deleted\n\n * @summary Deletes an Asset\n */\nexport const deleteAsset = (\n assetId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/asset/${assetId}`, method: \"delete\" },\n options\n );\n};\n\nexport type DeleteAssetMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteAsset>>\n>;\n\nexport type DeleteAssetMutationError = ErrorType<AsError>;\n\nexport const useDeleteAsset = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteAsset>>,\n TError,\n { assetId: 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 deleteAsset>>,\n { assetId: string }\n > = (props) => {\n const { assetId } = props ?? {};\n\n return deleteAsset(assetId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof deleteAsset>>,\n TError,\n { assetId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Disables a known Asset\n\n * @summary Disables an Asset\n */\nexport const disableAsset = (\n assetId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/asset/${assetId}/disable`, method: \"patch\" },\n options\n );\n};\n\nexport type DisableAssetMutationResult = NonNullable<\n Awaited<ReturnType<typeof disableAsset>>\n>;\n\nexport type DisableAssetMutationError = ErrorType<AsError>;\n\nexport const useDisableAsset = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof disableAsset>>,\n TError,\n { assetId: 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 disableAsset>>,\n { assetId: string }\n > = (props) => {\n const { assetId } = props ?? {};\n\n return disableAsset(assetId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof disableAsset>>,\n TError,\n { assetId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Enables a known Asset\n\n * @summary Enables an Asset\n */\nexport const enableAsset = (\n assetId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/asset/${assetId}/enable`, method: \"patch\" },\n options\n );\n};\n\nexport type EnableAssetMutationResult = NonNullable<\n Awaited<ReturnType<typeof enableAsset>>\n>;\n\nexport type EnableAssetMutationError = ErrorType<AsError>;\n\nexport const useEnableAsset = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof enableAsset>>,\n TError,\n { assetId: 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 enableAsset>>,\n { assetId: string }\n > = (props) => {\n const { assetId } = props ?? {};\n\n return enableAsset(assetId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof enableAsset>>,\n TError,\n { assetId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Attaches an Asset to a merchant\n\n * @summary Attaches an Asset to a Merchant\n */\nexport const attachAsset = (\n assetId: string,\n params?: AttachAssetParams,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/asset/${assetId}/attach`, method: \"patch\", params },\n options\n );\n};\n\nexport type AttachAssetMutationResult = NonNullable<\n Awaited<ReturnType<typeof attachAsset>>\n>;\n\nexport type AttachAssetMutationError = ErrorType<AsError>;\n\nexport const useAttachAsset = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof attachAsset>>,\n TError,\n { assetId: string; params?: AttachAssetParams },\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 attachAsset>>,\n { assetId: string; params?: AttachAssetParams }\n > = (props) => {\n const { assetId, params } = props ?? {};\n\n return attachAsset(assetId, params, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof attachAsset>>,\n TError,\n { assetId: string; params?: AttachAssetParams },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Detaches an Asset from a merchant\n\n * @summary Detaches an Asset from a Merchant\n */\nexport const detachAsset = (\n assetId: string,\n params?: DetachAssetParams,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/asset/${assetId}/detach`, method: \"patch\", params },\n options\n );\n};\n\nexport type DetachAssetMutationResult = NonNullable<\n Awaited<ReturnType<typeof detachAsset>>\n>;\n\nexport type DetachAssetMutationError = ErrorType<AsError>;\n\nexport const useDetachAsset = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof detachAsset>>,\n TError,\n { assetId: string; params?: DetachAssetParams },\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 detachAsset>>,\n { assetId: string; params?: DetachAssetParams }\n > = (props) => {\n const { assetId, params } = props ?? {};\n\n return detachAsset(assetId, params, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof detachAsset>>,\n TError,\n { assetId: string; params?: DetachAssetParams },\n TContext\n >(mutationFn, mutationOptions);\n};\n"],"mappings":";;;;;AAUA,SAAS,UAAU,mBAAmB;AAkC/B,IAAM,WAAW,CACtB,QACA,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,UAAU,QAAQ,OAAO,QAAQ,OAAO;AAAA,IAC/C;AAAA,EACF;AACF;AAEO,IAAM,sBAAsB,CAAC,WAA4B;AAAA,EAC9D;AAAA,EACA,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC;AAC3B;AAOO,IAAM,cAAc,CAIzB,QACA,YAQ2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,oBAAoB,MAAM;AAErE,QAAM,UAA+D,CAAC;AAAA,IACpE;AAAA,EACF,MAAM,SAAS,QAAQ,gBAAgB,MAAM;AAE7C,QAAM,QAAQ;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,QAAM,WA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KL,YAAY,eAAe;AAC/B;AAMO,IAAM,cAAc,CACzB,SACA,QACA,YACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,UAAU,kBAAkB,QAAQ,SAAS,OAAO;AAAA,IAC3D;AAAA,EACF;AACF;AAQO,IAAM,iBAAiB,CAG5B,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,eAAe,IAAI,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,SAAS,OAAO,IAAI,SAAS,CAAC;AAEtC,WAAO,YAAY,SAAS,QAAQ,cAAc;AAAA,EACpD;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B;","names":[]}
1
+ {"version":3,"sources":["../../src/asset/asset.ts"],"sourcesContent":["/**\n * Generated by orval v6.9.1 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Products**, **Organisations**, **Units** and **Users**.\n\n * OpenAPI spec version: 1.0\n */\nimport {\n useQuery,\n useMutation\n} from 'react-query'\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey\n} from 'react-query'\nimport type {\n AssetGetResponse,\n AsError,\n GetAssetParams,\n AssetPostResponse,\n AssetPostBodyBody,\n AttachAssetParams,\n DetachAssetParams\n} from '../account-server-api.schemas'\nimport { customInstance } from '.././custom-instance'\nimport type { ErrorType } from '.././custom-instance'\n\n\n// eslint-disable-next-line\n type 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 Assets\n\n * @summary Gets Assets\n */\nexport const getAsset = (\n params?: GetAssetParams,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n return customInstance<AssetGetResponse>(\n {url: `/asset`, method: 'get',\n params, signal\n },\n options);\n }\n \n\nexport const getGetAssetQueryKey = (params?: GetAssetParams,) => [`/asset`, ...(params ? [params]: [])];\n\n \nexport type GetAssetQueryResult = NonNullable<Awaited<ReturnType<typeof getAsset>>>\nexport type GetAssetQueryError = ErrorType<AsError | void>\n\nexport const useGetAsset = <TData = Awaited<ReturnType<typeof getAsset>>, TError = ErrorType<AsError | void>>(\n params?: GetAssetParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const {query: queryOptions, request: requestOptions} = options ?? {}\n\n const queryKey = queryOptions?.queryKey ?? getGetAssetQueryKey(params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getAsset>>> = ({ signal }) => getAsset(params, requestOptions, signal);\n\n const query = useQuery<Awaited<ReturnType<typeof getAsset>>, TError, TData>(queryKey, queryFn, queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n}\n\n/**\n * Creates an Asset, which can be attached to our User account, or a Product, Unit or Organisation you have access to\n\n * @summary Create an Asset\n */\nexport const createAsset = (\n assetPostBodyBody: AssetPostBodyBody,\n options?: SecondParameter<typeof customInstance>,) => {const formData = new FormData();\nformData.append('name', assetPostBodyBody.name)\nif(assetPostBodyBody.content_file !== undefined) {\n formData.append('content_file', assetPostBodyBody.content_file)\n }\nif(assetPostBodyBody.content_string !== undefined) {\n formData.append('content_string', assetPostBodyBody.content_string)\n }\nformData.append('scope', assetPostBodyBody.scope)\nif(assetPostBodyBody.scope_id !== undefined) {\n formData.append('scope_id', assetPostBodyBody.scope_id)\n }\nformData.append('secret', assetPostBodyBody.secret.toString())\nif(assetPostBodyBody.description !== undefined) {\n formData.append('description', assetPostBodyBody.description)\n }\n\n return customInstance<AssetPostResponse>(\n {url: `/asset`, method: 'post',\n headers: {'Content-Type': 'multipart/form-data', },\n data: formData\n },\n options);\n }\n \n\n\n export type CreateAssetMutationResult = NonNullable<Awaited<ReturnType<typeof createAsset>>>\n export type CreateAssetMutationBody = AssetPostBodyBody\n export type CreateAssetMutationError = ErrorType<AsError | void>\n\n export const useCreateAsset = <TError = ErrorType<AsError | void>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createAsset>>, TError,{data: AssetPostBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {}\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof createAsset>>, {data: AssetPostBodyBody}> = (props) => {\n const {data} = props ?? {};\n\n return createAsset(data,requestOptions)\n }\n\n return useMutation<Awaited<ReturnType<typeof createAsset>>, TError, {data: AssetPostBodyBody}, TContext>(mutationFn, mutationOptions)\n }\n /**\n * Deletes a known Asset. Assets that are attached to merchants cannot be deleted\n\n * @summary Deletes an Asset\n */\nexport const deleteAsset = (\n assetId: string,\n options?: SecondParameter<typeof customInstance>,) => {\n return customInstance<void>(\n {url: `/asset/${assetId}`, method: 'delete'\n },\n options);\n }\n \n\n\n export type DeleteAssetMutationResult = NonNullable<Awaited<ReturnType<typeof deleteAsset>>>\n \n export type DeleteAssetMutationError = ErrorType<AsError>\n\n export const useDeleteAsset = <TError = ErrorType<AsError>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteAsset>>, TError,{assetId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {}\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteAsset>>, {assetId: string}> = (props) => {\n const {assetId} = props ?? {};\n\n return deleteAsset(assetId,requestOptions)\n }\n\n return useMutation<Awaited<ReturnType<typeof deleteAsset>>, TError, {assetId: string}, TContext>(mutationFn, mutationOptions)\n }\n /**\n * Disables a known Asset\n\n * @summary Disables an Asset\n */\nexport const disableAsset = (\n assetId: string,\n options?: SecondParameter<typeof customInstance>,) => {\n return customInstance<void>(\n {url: `/asset/${assetId}/disable`, method: 'patch'\n },\n options);\n }\n \n\n\n export type DisableAssetMutationResult = NonNullable<Awaited<ReturnType<typeof disableAsset>>>\n \n export type DisableAssetMutationError = ErrorType<AsError>\n\n export const useDisableAsset = <TError = ErrorType<AsError>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof disableAsset>>, TError,{assetId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {}\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof disableAsset>>, {assetId: string}> = (props) => {\n const {assetId} = props ?? {};\n\n return disableAsset(assetId,requestOptions)\n }\n\n return useMutation<Awaited<ReturnType<typeof disableAsset>>, TError, {assetId: string}, TContext>(mutationFn, mutationOptions)\n }\n /**\n * Enables a known Asset\n\n * @summary Enables an Asset\n */\nexport const enableAsset = (\n assetId: string,\n options?: SecondParameter<typeof customInstance>,) => {\n return customInstance<void>(\n {url: `/asset/${assetId}/enable`, method: 'patch'\n },\n options);\n }\n \n\n\n export type EnableAssetMutationResult = NonNullable<Awaited<ReturnType<typeof enableAsset>>>\n \n export type EnableAssetMutationError = ErrorType<AsError>\n\n export const useEnableAsset = <TError = ErrorType<AsError>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof enableAsset>>, TError,{assetId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {}\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof enableAsset>>, {assetId: string}> = (props) => {\n const {assetId} = props ?? {};\n\n return enableAsset(assetId,requestOptions)\n }\n\n return useMutation<Awaited<ReturnType<typeof enableAsset>>, TError, {assetId: string}, TContext>(mutationFn, mutationOptions)\n }\n /**\n * Attaches an Asset to a merchant\n\n * @summary Attaches an Asset to a Merchant\n */\nexport const attachAsset = (\n assetId: string,\n params?: AttachAssetParams,\n options?: SecondParameter<typeof customInstance>,) => {\n return customInstance<void>(\n {url: `/asset/${assetId}/attach`, method: 'patch',\n params\n },\n options);\n }\n \n\n\n export type AttachAssetMutationResult = NonNullable<Awaited<ReturnType<typeof attachAsset>>>\n \n export type AttachAssetMutationError = ErrorType<AsError>\n\n export const useAttachAsset = <TError = ErrorType<AsError>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof attachAsset>>, TError,{assetId: string;params?: AttachAssetParams}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {}\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof attachAsset>>, {assetId: string;params?: AttachAssetParams}> = (props) => {\n const {assetId,params} = props ?? {};\n\n return attachAsset(assetId,params,requestOptions)\n }\n\n return useMutation<Awaited<ReturnType<typeof attachAsset>>, TError, {assetId: string;params?: AttachAssetParams}, TContext>(mutationFn, mutationOptions)\n }\n /**\n * Detaches an Asset from a merchant\n\n * @summary Detaches an Asset from a Merchant\n */\nexport const detachAsset = (\n assetId: string,\n params?: DetachAssetParams,\n options?: SecondParameter<typeof customInstance>,) => {\n return customInstance<void>(\n {url: `/asset/${assetId}/detach`, method: 'patch',\n params\n },\n options);\n }\n \n\n\n export type DetachAssetMutationResult = NonNullable<Awaited<ReturnType<typeof detachAsset>>>\n \n export type DetachAssetMutationError = ErrorType<AsError>\n\n export const useDetachAsset = <TError = ErrorType<AsError>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof detachAsset>>, TError,{assetId: string;params?: DetachAssetParams}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {}\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof detachAsset>>, {assetId: string;params?: DetachAssetParams}> = (props) => {\n const {assetId,params} = props ?? {};\n\n return detachAsset(assetId,params,requestOptions)\n }\n\n return useMutation<Awaited<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 -174,7 +174,7 @@ interface MerchantDetail {
174
174
  declare type MerchantGetResponse = MerchantDetail;
175
175
  interface MerchantsGetResponse {
176
176
  /** The list of known Merchants
177
- */
177
+ */
178
178
  merchants: MerchantDetail[];
179
179
  }
180
180
  interface OrganisationDetail {
@@ -207,7 +207,7 @@ interface ProductType {
207
207
  }
208
208
  declare type ProductInstanceDetailCoins = {
209
209
  /** The number of coins used
210
- */
210
+ */
211
211
  used: number;
212
212
  };
213
213
  interface ProductInstanceDetail {
@@ -235,17 +235,17 @@ declare const ProductDetailType: {
235
235
  };
236
236
  interface ProductDetail {
237
237
  /** The Product ID
238
- */
238
+ */
239
239
  id: string;
240
240
  created: string;
241
241
  /** The Product Type
242
- */
242
+ */
243
243
  type: ProductDetailType;
244
244
  /** The Product Type flavour. Not all products have flavours
245
- */
245
+ */
246
246
  flavour?: ProductDetailFlavour;
247
247
  /** The name of the Product
248
- */
248
+ */
249
249
  name?: string;
250
250
  }
251
251
  interface ProductCoinsDetail {
@@ -272,10 +272,10 @@ interface ProductCoinsDetail {
272
272
  }
273
273
  interface ProductClaimDetail {
274
274
  /** The service-specific ID that is using this Subscription
275
- */
275
+ */
276
276
  id: string;
277
277
  /** A name for the service-specific ID
278
- */
278
+ */
279
279
  name?: string;
280
280
  }
281
281
  declare type ProductDmStorageDetailCoins = {
@@ -330,7 +330,6 @@ interface StorageCharges {
330
330
  items: StorageChargeItem[];
331
331
  }
332
332
  interface ProcessingChargeItem {
333
- item_number: number;
334
333
  /** The most recent sequence number for this charge */
335
334
  sqn: number;
336
335
  name?: string;
@@ -349,8 +348,11 @@ interface ProcessingCharges {
349
348
  merchant_name: string;
350
349
  merchant_kind: ProcessingChargesMerchantKind;
351
350
  merchant_api_hostname: string;
352
- num_items: number;
353
- items: ProcessingChargeItem[];
351
+ /** The date when the charges concluded */
352
+ closed?: string;
353
+ /** True if charges received after the charge record was closed */
354
+ post_closure_charges?: boolean;
355
+ charge: ProcessingChargeItem;
354
356
  }
355
357
  declare type AssetDetailScope = typeof AssetDetailScope[keyof typeof AssetDetailScope];
356
358
  declare const AssetDetailScope: {
@@ -424,12 +426,12 @@ interface OrganisationsGetResponse {
424
426
  interface OrganisationUnitsGetResponse {
425
427
  organisation: OrganisationDetail;
426
428
  /** A list of Units
427
- */
429
+ */
428
430
  units: UnitDetail[];
429
431
  }
430
432
  interface UnitsGetResponse {
431
433
  /** A list of Units
432
- */
434
+ */
433
435
  units: OrganisationUnitsGetResponse[];
434
436
  }
435
437
  interface PersonalUnitPutResponse {
@@ -446,13 +448,13 @@ interface OrganisationGetDefaultResponse {
446
448
  /** Whether the user making the API call is a member of the Default Organisation. Only admin users are members of the Default organisation */
447
449
  caller_is_member: boolean;
448
450
  /** The Default Organisation ID
449
- */
451
+ */
450
452
  id: string;
451
453
  /** The Default Organisation Name
452
- */
454
+ */
453
455
  name: string;
454
456
  /** True if the Organisation is private. The Default organisation is always public, although it does not contain a membership (unless you're admin) and only houses Personal Units
455
- */
457
+ */
456
458
  private: boolean;
457
459
  created: string;
458
460
  }
@@ -460,7 +462,7 @@ interface UsersGetResponse {
460
462
  organisation?: OrganisationDetail;
461
463
  unit?: UnitDetail;
462
464
  /** The list of Organisation Users
463
- */
465
+ */
464
466
  users: UserDetail[];
465
467
  }
466
468
  interface OrganisationPostResponse {
@@ -469,17 +471,17 @@ interface OrganisationPostResponse {
469
471
  }
470
472
  interface StateGetVersionResponse {
471
473
  /** The Account Server version. This is guaranteed to be a valid semantic version for official (tagged) images. The version value format for unofficial images is a string but otherwise undefined
472
- */
474
+ */
473
475
  version: string;
474
476
  }
475
477
  interface AssetPostResponse {
476
478
  /** The Asset ID
477
- */
479
+ */
478
480
  id: string;
479
481
  }
480
482
  interface AssetGetResponse {
481
483
  /** A list of Assets
482
- */
484
+ */
483
485
  assets: AssetDetail[];
484
486
  }
485
487
  interface AsError {