@squonk/account-server-client 1.0.2 → 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.
- package/asset/asset.cjs +34 -18
- package/asset/asset.cjs.map +1 -1
- package/asset/asset.d.ts +16 -16
- package/asset/asset.js +35 -19
- package/asset/asset.js.map +1 -1
- package/{custom-instance-e2d92e5c.d.ts → custom-instance-93fb01eb.d.ts} +17 -17
- package/index.cjs.map +1 -1
- package/index.d.ts +1 -1
- package/index.js.map +1 -1
- package/merchant/merchant.cjs +15 -13
- package/merchant/merchant.cjs.map +1 -1
- package/merchant/merchant.d.ts +1 -1
- package/merchant/merchant.js +16 -14
- package/merchant/merchant.js.map +1 -1
- package/organisation/organisation.cjs +18 -6
- package/organisation/organisation.cjs.map +1 -1
- package/organisation/organisation.d.ts +7 -7
- package/organisation/organisation.js +19 -7
- package/organisation/organisation.js.map +1 -1
- package/package.json +1 -1
- package/product/product.cjs +47 -38
- package/product/product.cjs.map +1 -1
- package/product/product.d.ts +10 -10
- package/product/product.js +48 -39
- package/product/product.js.map +1 -1
- package/src/account-server-api.schemas.ts +68 -84
- package/src/asset/asset.ts +248 -345
- package/src/merchant/merchant.ts +62 -84
- package/src/organisation/organisation.ts +131 -184
- package/src/product/product.ts +279 -422
- package/src/state/state.ts +36 -42
- package/src/unit/unit.ts +218 -301
- package/src/user/user.ts +224 -327
- package/state/state.cjs +9 -9
- package/state/state.cjs.map +1 -1
- package/state/state.d.ts +1 -1
- package/state/state.js +10 -10
- package/state/state.js.map +1 -1
- package/unit/unit.cjs +40 -25
- package/unit/unit.cjs.map +1 -1
- package/unit/unit.d.ts +10 -10
- package/unit/unit.js +41 -26
- package/unit/unit.js.map +1 -1
- package/user/user.cjs +38 -20
- package/user/user.cjs.map +1 -1
- package/user/user.d.ts +10 -10
- package/user/user.js +39 -21
- 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
|
-
{
|
|
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
|
-
|
|
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
|
-
{
|
|
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
|
-
{
|
|
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
|
-
{
|
|
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
|
-
{
|
|
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
|
-
{
|
|
136
|
+
{
|
|
137
|
+
url: `/asset/${assetId}/detach`,
|
|
138
|
+
method: "patch",
|
|
139
|
+
params
|
|
140
|
+
},
|
|
125
141
|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AO;AAAA,IACL,EAAE,KAAK,UAAU,kBAAkB,QAAQ,QAAQ;AAAA,IACnD;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,QAAQ,IAAI,SAAS,CAAC;AAE9B,WAAO,YAAY,SAAS,cAAc;AAAA,EAC5C;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;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,K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C;AAKzE,QAAM,aAA2F,CAAC,UAAU;AACxG,UAAM,EAAC,QAAO,IAAI,SAAS,CAAC;AAE5B,WAAQ,YAAY,SAAQ,cAAc;AAAA,EAC5C;AAEF,SAAO,YAA0F,YAAY,eAAe;AAC9H;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;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-
|
|
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
|
-
|
|
40
|
+
* Deletes a known Asset. Assets that are attached to merchants cannot be deleted
|
|
41
41
|
|
|
42
|
-
|
|
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
|
-
|
|
56
|
+
* Disables a known Asset
|
|
57
57
|
|
|
58
|
-
|
|
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
|
-
|
|
72
|
+
* Enables a known Asset
|
|
73
73
|
|
|
74
|
-
|
|
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
|
-
|
|
88
|
+
* Attaches an Asset to a merchant
|
|
89
89
|
|
|
90
|
-
|
|
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
|
-
|
|
106
|
+
* Detaches an Asset from a merchant
|
|
107
107
|
|
|
108
|
-
|
|
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 {
|
|
6
|
+
import {
|
|
7
|
+
useQuery,
|
|
8
|
+
useMutation
|
|
9
|
+
} from "react-query";
|
|
7
10
|
var getAsset = (params, options, signal) => {
|
|
8
11
|
return customInstance(
|
|
9
|
-
{
|
|
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
|
-
|
|
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
|
-
{
|
|
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
|
-
{
|
|
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
|
-
{
|
|
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
|
-
{
|
|
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
|
-
{
|
|
136
|
+
{
|
|
137
|
+
url: `/asset/${assetId}/detach`,
|
|
138
|
+
method: "patch",
|
|
139
|
+
params
|
|
140
|
+
},
|
|
125
141
|
options
|
|
126
142
|
);
|
|
127
143
|
};
|
package/asset/asset.js.map
CHANGED
|
@@ -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,E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AAU;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;","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<ReturnType<typeof detachAsset>>, TError, {assetId: string;params?: DetachAssetParams}, TContext>(mutationFn, mutationOptions)\n }\n "],"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,QAAM,WAAW;AAEjB,SAAO;AACT;AAOO,IAAM,cAAc,CACvB,mBACH,YAAsD;AAAC,QAAM,WAAW,IAAI,SAAS;AACtF,WAAS,OAAO,QAAQ,kBAAkB,IAAI;AAC9C,MAAG,kBAAkB,iBAAiB,QAAW;AAChD,aAAS,OAAO,gBAAgB,kBAAkB,YAAY;AAAA,EAC9D;AACD,MAAG,kBAAkB,mBAAmB,QAAW;AAClD,aAAS,OAAO,kBAAkB,kBAAkB,cAAc;AAAA,EAClE;AACD,WAAS,OAAO,SAAS,kBAAkB,KAAK;AAChD,MAAG,kBAAkB,aAAa,QAAW;AAC5C,aAAS,OAAO,YAAY,kBAAkB,QAAQ;AAAA,EACtD;AACD,WAAS,OA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AAM,IAAI,SAAS,CAAC;AAEnC,WAAQ,YAAY,SAAQ,QAAO,cAAc;AAAA,EACnD;AAEF,SAAO,YAAqH,YAAY,eAAe;AACzJ;","names":[]}
|
|
@@ -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 = {
|
|
@@ -426,12 +426,12 @@ interface OrganisationsGetResponse {
|
|
|
426
426
|
interface OrganisationUnitsGetResponse {
|
|
427
427
|
organisation: OrganisationDetail;
|
|
428
428
|
/** A list of Units
|
|
429
|
-
|
|
429
|
+
*/
|
|
430
430
|
units: UnitDetail[];
|
|
431
431
|
}
|
|
432
432
|
interface UnitsGetResponse {
|
|
433
433
|
/** A list of Units
|
|
434
|
-
|
|
434
|
+
*/
|
|
435
435
|
units: OrganisationUnitsGetResponse[];
|
|
436
436
|
}
|
|
437
437
|
interface PersonalUnitPutResponse {
|
|
@@ -448,13 +448,13 @@ interface OrganisationGetDefaultResponse {
|
|
|
448
448
|
/** Whether the user making the API call is a member of the Default Organisation. Only admin users are members of the Default organisation */
|
|
449
449
|
caller_is_member: boolean;
|
|
450
450
|
/** The Default Organisation ID
|
|
451
|
-
|
|
451
|
+
*/
|
|
452
452
|
id: string;
|
|
453
453
|
/** The Default Organisation Name
|
|
454
|
-
|
|
454
|
+
*/
|
|
455
455
|
name: string;
|
|
456
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
|
|
457
|
-
|
|
457
|
+
*/
|
|
458
458
|
private: boolean;
|
|
459
459
|
created: string;
|
|
460
460
|
}
|
|
@@ -462,7 +462,7 @@ interface UsersGetResponse {
|
|
|
462
462
|
organisation?: OrganisationDetail;
|
|
463
463
|
unit?: UnitDetail;
|
|
464
464
|
/** The list of Organisation Users
|
|
465
|
-
|
|
465
|
+
*/
|
|
466
466
|
users: UserDetail[];
|
|
467
467
|
}
|
|
468
468
|
interface OrganisationPostResponse {
|
|
@@ -471,17 +471,17 @@ interface OrganisationPostResponse {
|
|
|
471
471
|
}
|
|
472
472
|
interface StateGetVersionResponse {
|
|
473
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
|
|
474
|
-
|
|
474
|
+
*/
|
|
475
475
|
version: string;
|
|
476
476
|
}
|
|
477
477
|
interface AssetPostResponse {
|
|
478
478
|
/** The Asset ID
|
|
479
|
-
|
|
479
|
+
*/
|
|
480
480
|
id: string;
|
|
481
481
|
}
|
|
482
482
|
interface AssetGetResponse {
|
|
483
483
|
/** A list of Assets
|
|
484
|
-
|
|
484
|
+
*/
|
|
485
485
|
assets: AssetDetail[];
|
|
486
486
|
}
|
|
487
487
|
interface AsError {
|
package/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/account-server-api.schemas.ts"],"names":[],"mappings":";;;;;;;;AA6EO,IAAM,iCAAiC;AAAA,EAC5C,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,MAAM;AACR;AAWO,IAAM,8BAA8B;AAAA,EACzC,wCACE;AAAA,EACF,mCAAmC;AACrC;AAmCO,IAAM,yBAAyB;AAAA,EACpC,MAAM;AAAA,EACN,SAAS;AAAA,EACT,MAAM;AAAA,EACN,cAAc;AAChB;AAkDO,IAAM,qBAAqB;AAAA,EAChC,cAAc;AAChB;AA2CO,IAAM,yBAAyB;AAAA,EACpC,cAAc;AAChB;AA6BO,IAAM,uBAAuB;AAAA,EAClC,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,MAAM;AACR;AAUO,IAAM,oBAAoB;AAAA,EAC/B,wCACE;AAAA,EACF,mCAAmC;AACrC;AA6HO,IAAM,gCAAgC;AAAA,EAC3C,cAAc;AAChB;AAiBO,IAAM,mBAAmB;AAAA,EAC9B,MAAM;AAAA,EACN,SAAS;AAAA,EACT,MAAM;AAAA,EACN,cAAc;AAChB;AAuDO,IAAM,uCAAuC;AAAA,EAClD,wCACE;AAAA,EACF,mCAAmC;AACrC","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 */\nexport type AttachAssetParams = { m_id?: QMIdParameter };\n\n/**\n * A date where assets prior to this will be returned. This can be a date-time string but it is interpreted as a date, i.e. `2020-01-01T00:00:00Z` is interpreted as `2020-01-01`. Any asset that occurs prior this date will be returned. UTC is assumed if no timezone is provided\n */\nexport type QUntilParameter = string;\n\n/**\n * A date from which to retrieve assets. This can be a date-time string but it is interpreted as a date, i.e. `2020-01-01T00:00:00Z` is interpreted as `2020-01-01`. Any asset that occurs on ar after this date will be returned. UTC is assumed if no timezone is provided\n */\nexport type QFromParameter = string;\n\nexport type GetProductChargesParams = {\n from?: QFromParameter;\n until?: QUntilParameter;\n};\n\n/**\n * A User Identity\n */\nexport type QUserIdParameter = string;\n\n/**\n * A Product Identity\n */\nexport type QProductIdParameter = string;\n\n/**\n * A Unit Identity\n */\nexport type QUnitIdParameter = string;\n\nexport type GetAssetParams = {\n user_id?: QUserIdParameter;\n product_id?: QProductIdParameter;\n unit_id?: QUnitIdParameter;\n org_id?: QOrgIdParameter;\n};\n\n/**\n * A Merchant Identity\n */\nexport type QMIdParameter = number;\n\nexport type DetachAssetParams = { m_id?: QMIdParameter };\n\n/**\n * An Organisation Identity\n */\nexport type QOrgIdParameter = string;\n\nexport type ProductPatchBodyBody = {\n /** The name you want to give the Product */\n name?: string;\n /** The Product's built-in coin allowance. Product allowances cannot be reduced */\n allowance?: number;\n /** The Product's built-in coin limit. If set it must not be less than the allowance. If not set the allowance is used. The existing product limit cannot be reduced */\n limit?: number;\n};\n\n/**\n * The Flavour of the Product. Used only for Project Tier Products. Do not set this for Storage products\n */\nexport type UnitProductPostBodyBodyFlavour =\n typeof UnitProductPostBodyBodyFlavour[keyof typeof UnitProductPostBodyBodyFlavour];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const UnitProductPostBodyBodyFlavour = {\n EVALUATION: \"EVALUATION\",\n BRONZE: \"BRONZE\",\n SILVER: \"SILVER\",\n GOLD: \"GOLD\",\n} as const;\n\n/**\n * The Type of Product. Storage subscriptions require an **Allowance** to be defined and the **Flavour** must not be provided.\n\nProject Tier subscriptions have built-in allowances and Limits so you must not provide values for these for these products\n */\nexport type UnitProductPostBodyBodyType =\n typeof UnitProductPostBodyBodyType[keyof typeof UnitProductPostBodyBodyType];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const UnitProductPostBodyBodyType = {\n DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION:\n \"DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION\",\n DATA_MANAGER_STORAGE_SUBSCRIPTION: \"DATA_MANAGER_STORAGE_SUBSCRIPTION\",\n} as const;\n\nexport type UnitProductPostBodyBody = {\n /** The name you want to give the Product */\n name: string;\n /** The Type of Product. Storage subscriptions require an **Allowance** to be defined and the **Flavour** must not be provided.\n\nProject Tier subscriptions have built-in allowances and Limits so you must not provide values for these for these products */\n type: UnitProductPostBodyBodyType;\n /** The Flavour of the Product. Used only for Project Tier Products. Do not set this for Storage products */\n flavour?: UnitProductPostBodyBodyFlavour;\n /** The Product's coin allowance. You must provide this for Storage products but you must not provide a value for Project Tier Products */\n allowance?: number;\n /** The Product's built-in coin limit. If set it must not be less than the allowance. If not set the allowance is used. You can provide this for Storage products but you must not provide a value for Project Tier Products */\n limit?: number;\n /** The day you would like to be billed for the Product's subscription (a value from 1 and 28) */\n billing_day: number;\n};\n\nexport type OrganisationUnitPostBodyBody = {\n /** The name of the unit */\n name: string;\n};\n\nexport type OrganisationPostBodyBody = {\n /** The name of the organisation */\n name: string;\n /** The name of the organisation owner. A user ID */\n owner: string;\n};\n\nexport type AssetPostBodyBodyScope =\n typeof AssetPostBodyBodyScope[keyof typeof AssetPostBodyBodyScope];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const AssetPostBodyBodyScope = {\n USER: \"USER\",\n PRODUCT: \"PRODUCT\",\n UNIT: \"UNIT\",\n ORGANISATION: \"ORGANISATION\",\n} as const;\n\nexport type AssetPostBodyBody = {\n /** The name of the asset. This must be unique within its scope. For example, only one asset can be called \"asset-1\" within a given Unit. Asset names must be valid RFC 1123 Label Names */\n name: string;\n /** A file containing the content for the asset. You must provide a value here or in content_string */\n content_file?: Blob;\n /** The textual content of the asset. You must provide a value here or in content_file */\n content_string?: string;\n scope: AssetPostBodyBodyScope;\n /** The unique identity based on the Scope of the asset. For example, this will be the Unit ID if it's a UNIT. A scope_id is required if the scope is USER as it will be automatically set to your username */\n scope_id?: string;\n /** Is this a secret asset? */\n secret: boolean;\n /** An optional description for the Asset */\n description?: string;\n};\n\nexport interface UserDetail {\n /** The user identity (username) */\n id: string;\n}\n\nexport interface UserAccountDetail {\n user: UserDetail;\n /** Whether the caller has admin privilege */\n caller_has_admin_privilege: boolean;\n}\n\nexport interface UnitDetail {\n /** Whether the user making the API call is a member of the Unit */\n caller_is_member: boolean;\n /** The Unit's unique identity */\n id: string;\n /** The Unit's name */\n name: string;\n /** The Unit's owner (a username) */\n owner_id: string;\n /** True if the Unit is private */\n private: boolean;\n created: string;\n}\n\n/**\n * The kind of Service\n */\nexport type MerchantDetailKind =\n typeof MerchantDetailKind[keyof typeof MerchantDetailKind];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const MerchantDetailKind = {\n DATA_MANAGER: \"DATA_MANAGER\",\n} as const;\n\nexport interface MerchantDetail {\n /** The unique ID of the Service */\n id: number;\n created: string;\n /** The kind of Service */\n kind: MerchantDetailKind;\n /** The name assigned to the Service */\n name: string;\n /** The hostname used by the Service */\n api_hostname: string;\n}\n\nexport type MerchantGetResponse = MerchantDetail;\n\nexport interface MerchantsGetResponse {\n /** The list of known Merchants\n */\n merchants: MerchantDetail[];\n}\n\nexport interface OrganisationDetail {\n /** Whether the user making the API call is a member of the Unit */\n caller_is_member: boolean;\n /** The Organisation's unique ID */\n id: string;\n /** The Organisation's name */\n name: string;\n /** The username of the Organisation's owner. Not all Organisations have an owner. The Default Organisation has no owner. */\n owner_id?: string;\n /** True if the Unit is private */\n private: boolean;\n created: string;\n}\n\n/**\n * The kind of service that can use the Product\n */\nexport type ProductTypeServiceKind =\n typeof ProductTypeServiceKind[keyof typeof ProductTypeServiceKind];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const ProductTypeServiceKind = {\n DATA_MANAGER: \"DATA_MANAGER\",\n} as const;\n\nexport interface ProductType {\n /** A product type, this is a unique string amongst all types known to the Account Server */\n type: string;\n /** A product flavour. Not all types have a flavour, those that do have a type-specific flavour string */\n flavour?: string;\n /** The kind of service that can use the Product */\n service_kind?: ProductTypeServiceKind;\n}\n\nexport type ProductInstanceDetailCoins = {\n /** The number of coins used\n */\n used: number;\n};\n\nexport interface ProductInstanceDetail {\n coins: ProductInstanceDetailCoins;\n}\n\n/**\n * The Product Type flavour. Not all products have flavours\n\n */\nexport type ProductDetailFlavour =\n typeof ProductDetailFlavour[keyof typeof ProductDetailFlavour];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const ProductDetailFlavour = {\n EVALUATION: \"EVALUATION\",\n BRONZE: \"BRONZE\",\n SILVER: \"SILVER\",\n GOLD: \"GOLD\",\n} as const;\n\n/**\n * The Product Type\n\n */\nexport type ProductDetailType =\n typeof ProductDetailType[keyof typeof ProductDetailType];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const ProductDetailType = {\n DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION:\n \"DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION\",\n DATA_MANAGER_STORAGE_SUBSCRIPTION: \"DATA_MANAGER_STORAGE_SUBSCRIPTION\",\n} as const;\n\nexport interface ProductDetail {\n /** The Product ID\n */\n id: string;\n created: string;\n /** The Product Type\n */\n type: ProductDetailType;\n /** The Product Type flavour. Not all products have flavours\n */\n flavour?: ProductDetailFlavour;\n /** The name of the Product\n */\n name?: string;\n}\n\nexport interface ProductCoinsDetail {\n /** The billing allowance. When you exceed this during the current billing period the *cost multiplier* will increase */\n allowance: number;\n /** The limit on your billing period spend. You can exceed the allowance but you cannot exceed the spend limit. Once reached the dependent may be restricted */\n limit: number;\n /** The total number of coins consumed (in this billing period), excluding the coins that have been consumed for the current day */\n used: number;\n /** True if the product is operating at or beyond its coin limit. When it is authority to perform actions using the product are severely limited. */\n at_limit: boolean;\n /** The current burn rate, the approximate amount of coins you are currently consuming each day */\n current_burn_rate: number;\n /** The predicted billing period amount, if costs continue at the current burn rate until the end of the billing period */\n billing_prediction: number;\n /** The day of the month when the bill is due, and the end of the current billing period */\n billing_day: number;\n /** A multiplier applied to your coin usage within your allowance */\n allowance_multiplier: number;\n /** A multiplier that will be applied to coin used beyond your allowance */\n overspend_multiplier: number;\n /** The number of days remaining, in the current billing period */\n remaining_days: number;\n}\n\nexport interface ProductClaimDetail {\n /** The service-specific ID that is using this Subscription\n */\n id: string;\n /** A name for the service-specific ID\n */\n name?: string;\n}\n\nexport type ProductDmStorageDetailCoins = {\n /** The number of coins currently committed for the current day. This is added to the accumulated coins at the start of each day */\n used: number;\n /** The coin cost of a 'unit' of storage or part thereof. The unit size is defined in the storage section of the response */\n unit_cost: number;\n};\n\nexport type ProductDmStorageDetailSize = {\n /** The humanised size of the peak storage used for the current day. The value is reset at the start of each day */\n peak: string;\n /** The humanised size of the current storage used for the current day and used to calculate the 'burn rate' */\n current: string;\n /** The humanised storage unit. The cost of storage is based on the daily peak of the number of units (or part thereof) used */\n unit_size: string;\n /** The peak number of storage units used today */\n units_used: number;\n};\n\nexport interface ProductDmStorageDetail {\n size: ProductDmStorageDetailSize;\n coins: ProductDmStorageDetailCoins;\n}\n\nexport interface ProductDmProjectTier {\n product: ProductDetail;\n organisation: OrganisationDetail;\n unit: UnitDetail;\n storage: ProductDmStorageDetail;\n coins: ProductCoinsDetail;\n instance: ProductInstanceDetail;\n claim?: ProductClaimDetail;\n}\n\nexport interface ProductDmStorage {\n product: ProductDetail;\n organisation: OrganisationDetail;\n unit: UnitDetail;\n storage: ProductDmStorageDetail;\n coins: ProductCoinsDetail;\n}\n\nexport interface ChargeAdditionalData {\n [key: string]: any;\n}\n\nexport interface StorageChargeItem {\n item_number: number;\n /** The date and time of the processing charge */\n date: string;\n /** The coin-cost of the storage */\n coins: string;\n additional_data?: ChargeAdditionalData;\n}\n\nexport interface StorageCharges {\n num_items: number;\n items: StorageChargeItem[];\n}\n\nexport interface ProcessingChargeItem {\n /** The most recent sequence number for this charge */\n sqn: number;\n name?: string;\n username: string;\n /** The date and time of the processing charge */\n timestamp: string;\n /** The coin-cost of the storage */\n coins: string;\n additional_data?: ChargeAdditionalData;\n}\n\nexport type ProcessingChargesMerchantKind =\n typeof ProcessingChargesMerchantKind[keyof typeof ProcessingChargesMerchantKind];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const ProcessingChargesMerchantKind = {\n DATA_MANAGER: \"DATA_MANAGER\",\n} as const;\n\nexport interface ProcessingCharges {\n merchant_name: string;\n merchant_kind: ProcessingChargesMerchantKind;\n merchant_api_hostname: string;\n /** The date when the charges concluded */\n closed?: string;\n /** True if charges received after the charge record was closed */\n post_closure_charges?: boolean;\n charge: ProcessingChargeItem;\n}\n\nexport type AssetDetailScope =\n typeof AssetDetailScope[keyof typeof AssetDetailScope];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const AssetDetailScope = {\n USER: \"USER\",\n PRODUCT: \"PRODUCT\",\n UNIT: \"UNIT\",\n ORGANISATION: \"ORGANISATION\",\n} as const;\n\nexport interface AssetDetail {\n creator: string;\n id: string;\n name: string;\n scope: AssetDetailScope;\n scope_id: string;\n secret: boolean;\n disabled: boolean;\n content: string;\n created: string;\n description?: string;\n merchants: MerchantDetail[];\n}\n\nexport type UserAccountGetResponse = UserAccountDetail;\n\nexport type UnitGetResponse = UnitDetail;\n\nexport interface UnitProductPostResponse {\n /** The Product's unique ID */\n id: string;\n}\n\n/**\n * The Unit's Product\n */\nexport type ProductUnitGetResponseProduct =\n | ProductDmStorage\n | ProductDmProjectTier;\n\nexport interface ProductUnitGetResponse {\n /** The Unit's Product */\n product: ProductUnitGetResponseProduct;\n}\n\nexport interface ProductsGetTypesResponse {\n /** All the Product Types you have access to */\n product_types: ProductType[];\n}\n\nexport type ProductsGetResponseProductsItem =\n | ProductDmStorage\n | ProductDmProjectTier;\n\nexport interface ProductsGetResponse {\n /** All the Products you have access to */\n products: ProductsGetResponseProductsItem[];\n}\n\nexport type ProductChargesGetResponseProductType =\n typeof ProductChargesGetResponseProductType[keyof typeof ProductChargesGetResponseProductType];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const ProductChargesGetResponseProductType = {\n DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION:\n \"DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION\",\n DATA_MANAGER_STORAGE_SUBSCRIPTION: \"DATA_MANAGER_STORAGE_SUBSCRIPTION\",\n} as const;\n\nexport interface ProductChargesGetResponse {\n product_id: string;\n product_type: ProductChargesGetResponseProductType;\n billing_day: number;\n /** The claim, if present, for claimable products */\n claim_id?: string;\n /** The claim name, if present, for claimable products */\n claim_name?: string;\n /** The start of the charge period */\n from: string;\n /** The date where of first day after the charge period */\n until: string;\n /** The total number of cons consumed by this product for the invoice period */\n coins: string;\n processing_charges: ProcessingCharges[];\n storage_charges: StorageCharges;\n}\n\nexport interface OrganisationsGetResponse {\n /** A list of Organisations */\n organisations: OrganisationDetail[];\n}\n\nexport interface OrganisationUnitsGetResponse {\n organisation: OrganisationDetail;\n /** A list of Units\n */\n units: UnitDetail[];\n}\n\nexport interface UnitsGetResponse {\n /** A list of Units\n */\n units: OrganisationUnitsGetResponse[];\n}\n\nexport interface PersonalUnitPutResponse {\n /** The unit's Organisation. Used to identify the Default organisation */\n organisation_id: string;\n /** The unit's unique ID */\n id: string;\n}\n\nexport interface OrganisationUnitPostResponse {\n /** The unit's unique ID */\n id: string;\n}\n\nexport interface OrganisationGetDefaultResponse {\n /** Whether the user making the API call is a member of the Default Organisation. Only admin users are members of the Default organisation */\n caller_is_member: boolean;\n /** The Default Organisation ID\n */\n id: string;\n /** The Default Organisation Name\n */\n name: string;\n /** 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\n */\n private: boolean;\n created: string;\n}\n\nexport interface UsersGetResponse {\n organisation?: OrganisationDetail;\n unit?: UnitDetail;\n /** The list of Organisation Users\n */\n users: UserDetail[];\n}\n\nexport interface OrganisationPostResponse {\n /** The Organisation's unique ID */\n id: string;\n}\n\nexport interface StateGetVersionResponse {\n /** 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\n */\n version: string;\n}\n\nexport interface AssetPostResponse {\n /** The Asset ID\n */\n id: string;\n}\n\nexport interface AssetGetResponse {\n /** A list of Assets\n */\n assets: AssetDetail[];\n}\n\nexport interface AsError {\n /** Brief error text that can be presented to the user */\n error: string;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/account-server-api.schemas.ts"],"names":[],"mappings":";;;;;;;;AAqEO,IAAM,iCAAiC;AAAA,EAC5C,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,MAAM;AACR;AAWO,IAAM,8BAA8B;AAAA,EACzC,wCAAwC;AAAA,EACxC,mCAAmC;AACrC;AAmCO,IAAM,yBAAyB;AAAA,EACpC,MAAM;AAAA,EACN,SAAS;AAAA,EACT,MAAM;AAAA,EACN,cAAc;AAChB;AAkDO,IAAM,qBAAqB;AAAA,EAChC,cAAc;AAChB;AA2CO,IAAM,yBAAyB;AAAA,EACpC,cAAc;AAChB;AA6BO,IAAM,uBAAuB;AAAA,EAClC,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,MAAM;AACR;AAUO,IAAM,oBAAoB;AAAA,EAC/B,wCAAwC;AAAA,EACxC,mCAAmC;AACrC;AA2HO,IAAM,gCAAgC;AAAA,EAC3C,cAAc;AAChB;AAiBO,IAAM,mBAAmB;AAAA,EAC9B,MAAM;AAAA,EACN,SAAS;AAAA,EACT,MAAM;AAAA,EACN,cAAc;AAChB;AAmDO,IAAM,uCAAuC;AAAA,EAClD,wCAAwC;AAAA,EACxC,mCAAmC;AACrC","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 */\nexport type AttachAssetParams = { m_id?: QMIdParameter };\n\n/**\n * A date where assets prior to this will be returned. This can be a date-time string but it is interpreted as a date, i.e. `2020-01-01T00:00:00Z` is interpreted as `2020-01-01`. Any asset that occurs prior this date will be returned. UTC is assumed if no timezone is provided\n */\nexport type QUntilParameter = string;\n\n/**\n * A date from which to retrieve assets. This can be a date-time string but it is interpreted as a date, i.e. `2020-01-01T00:00:00Z` is interpreted as `2020-01-01`. Any asset that occurs on ar after this date will be returned. UTC is assumed if no timezone is provided\n */\nexport type QFromParameter = string;\n\nexport type GetProductChargesParams = { from?: QFromParameter; until?: QUntilParameter };\n\n/**\n * A User Identity\n */\nexport type QUserIdParameter = string;\n\n/**\n * A Product Identity\n */\nexport type QProductIdParameter = string;\n\n/**\n * A Unit Identity\n */\nexport type QUnitIdParameter = string;\n\nexport type GetAssetParams = { user_id?: QUserIdParameter; product_id?: QProductIdParameter; unit_id?: QUnitIdParameter; org_id?: QOrgIdParameter };\n\n/**\n * A Merchant Identity\n */\nexport type QMIdParameter = number;\n\nexport type DetachAssetParams = { m_id?: QMIdParameter };\n\n/**\n * An Organisation Identity\n */\nexport type QOrgIdParameter = string;\n\nexport type ProductPatchBodyBody = {\n /** The name you want to give the Product */\n name?: string;\n /** The Product's built-in coin allowance. Product allowances cannot be reduced */\n allowance?: number;\n /** The Product's built-in coin limit. If set it must not be less than the allowance. If not set the allowance is used. The existing product limit cannot be reduced */\n limit?: number;\n};\n\n/**\n * The Flavour of the Product. Used only for Project Tier Products. Do not set this for Storage products\n */\nexport type UnitProductPostBodyBodyFlavour = typeof UnitProductPostBodyBodyFlavour[keyof typeof UnitProductPostBodyBodyFlavour];\n\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const UnitProductPostBodyBodyFlavour = {\n EVALUATION: 'EVALUATION',\n BRONZE: 'BRONZE',\n SILVER: 'SILVER',\n GOLD: 'GOLD',\n} as const;\n\n/**\n * The Type of Product. Storage subscriptions require an **Allowance** to be defined and the **Flavour** must not be provided.\n\nProject Tier subscriptions have built-in allowances and Limits so you must not provide values for these for these products\n */\nexport type UnitProductPostBodyBodyType = typeof UnitProductPostBodyBodyType[keyof typeof UnitProductPostBodyBodyType];\n\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const UnitProductPostBodyBodyType = {\n DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION: 'DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION',\n DATA_MANAGER_STORAGE_SUBSCRIPTION: 'DATA_MANAGER_STORAGE_SUBSCRIPTION',\n} as const;\n\nexport type UnitProductPostBodyBody = {\n /** The name you want to give the Product */\n name: string;\n /** The Type of Product. Storage subscriptions require an **Allowance** to be defined and the **Flavour** must not be provided.\n\nProject Tier subscriptions have built-in allowances and Limits so you must not provide values for these for these products */\n type: UnitProductPostBodyBodyType;\n /** The Flavour of the Product. Used only for Project Tier Products. Do not set this for Storage products */\n flavour?: UnitProductPostBodyBodyFlavour;\n /** The Product's coin allowance. You must provide this for Storage products but you must not provide a value for Project Tier Products */\n allowance?: number;\n /** The Product's built-in coin limit. If set it must not be less than the allowance. If not set the allowance is used. You can provide this for Storage products but you must not provide a value for Project Tier Products */\n limit?: number;\n /** The day you would like to be billed for the Product's subscription (a value from 1 and 28) */\n billing_day: number;\n};\n\nexport type OrganisationUnitPostBodyBody = {\n /** The name of the unit */\n name: string;\n};\n\nexport type OrganisationPostBodyBody = {\n /** The name of the organisation */\n name: string;\n /** The name of the organisation owner. A user ID */\n owner: string;\n};\n\nexport type AssetPostBodyBodyScope = typeof AssetPostBodyBodyScope[keyof typeof AssetPostBodyBodyScope];\n\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const AssetPostBodyBodyScope = {\n USER: 'USER',\n PRODUCT: 'PRODUCT',\n UNIT: 'UNIT',\n ORGANISATION: 'ORGANISATION',\n} as const;\n\nexport type AssetPostBodyBody = {\n /** The name of the asset. This must be unique within its scope. For example, only one asset can be called \"asset-1\" within a given Unit. Asset names must be valid RFC 1123 Label Names */\n name: string;\n /** A file containing the content for the asset. You must provide a value here or in content_string */\n content_file?: Blob;\n /** The textual content of the asset. You must provide a value here or in content_file */\n content_string?: string;\n scope: AssetPostBodyBodyScope;\n /** The unique identity based on the Scope of the asset. For example, this will be the Unit ID if it's a UNIT. A scope_id is required if the scope is USER as it will be automatically set to your username */\n scope_id?: string;\n /** Is this a secret asset? */\n secret: boolean;\n /** An optional description for the Asset */\n description?: string;\n};\n\nexport interface UserDetail {\n /** The user identity (username) */\n id: string;\n}\n\nexport interface UserAccountDetail {\n user: UserDetail;\n /** Whether the caller has admin privilege */\n caller_has_admin_privilege: boolean;\n}\n\nexport interface UnitDetail {\n /** Whether the user making the API call is a member of the Unit */\n caller_is_member: boolean;\n /** The Unit's unique identity */\n id: string;\n /** The Unit's name */\n name: string;\n /** The Unit's owner (a username) */\n owner_id: string;\n /** True if the Unit is private */\n private: boolean;\n created: string;\n}\n\n/**\n * The kind of Service\n */\nexport type MerchantDetailKind = typeof MerchantDetailKind[keyof typeof MerchantDetailKind];\n\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const MerchantDetailKind = {\n DATA_MANAGER: 'DATA_MANAGER',\n} as const;\n\nexport interface MerchantDetail {\n /** The unique ID of the Service */\n id: number;\n created: string;\n /** The kind of Service */\n kind: MerchantDetailKind;\n /** The name assigned to the Service */\n name: string;\n /** The hostname used by the Service */\n api_hostname: string;\n}\n\nexport type MerchantGetResponse = MerchantDetail;\n\nexport interface MerchantsGetResponse {\n /** The list of known Merchants\n */\n merchants: MerchantDetail[];\n}\n\nexport interface OrganisationDetail {\n /** Whether the user making the API call is a member of the Unit */\n caller_is_member: boolean;\n /** The Organisation's unique ID */\n id: string;\n /** The Organisation's name */\n name: string;\n /** The username of the Organisation's owner. Not all Organisations have an owner. The Default Organisation has no owner. */\n owner_id?: string;\n /** True if the Unit is private */\n private: boolean;\n created: string;\n}\n\n/**\n * The kind of service that can use the Product\n */\nexport type ProductTypeServiceKind = typeof ProductTypeServiceKind[keyof typeof ProductTypeServiceKind];\n\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const ProductTypeServiceKind = {\n DATA_MANAGER: 'DATA_MANAGER',\n} as const;\n\nexport interface ProductType {\n /** A product type, this is a unique string amongst all types known to the Account Server */\n type: string;\n /** A product flavour. Not all types have a flavour, those that do have a type-specific flavour string */\n flavour?: string;\n /** The kind of service that can use the Product */\n service_kind?: ProductTypeServiceKind;\n}\n\nexport type ProductInstanceDetailCoins = {\n /** The number of coins used\n */\n used: number;\n};\n\nexport interface ProductInstanceDetail {\n coins: ProductInstanceDetailCoins;\n}\n\n/**\n * The Product Type flavour. Not all products have flavours\n\n */\nexport type ProductDetailFlavour = typeof ProductDetailFlavour[keyof typeof ProductDetailFlavour];\n\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const ProductDetailFlavour = {\n EVALUATION: 'EVALUATION',\n BRONZE: 'BRONZE',\n SILVER: 'SILVER',\n GOLD: 'GOLD',\n} as const;\n\n/**\n * The Product Type\n\n */\nexport type ProductDetailType = typeof ProductDetailType[keyof typeof ProductDetailType];\n\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const ProductDetailType = {\n DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION: 'DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION',\n DATA_MANAGER_STORAGE_SUBSCRIPTION: 'DATA_MANAGER_STORAGE_SUBSCRIPTION',\n} as const;\n\nexport interface ProductDetail {\n /** The Product ID\n */\n id: string;\n created: string;\n /** The Product Type\n */\n type: ProductDetailType;\n /** The Product Type flavour. Not all products have flavours\n */\n flavour?: ProductDetailFlavour;\n /** The name of the Product\n */\n name?: string;\n}\n\nexport interface ProductCoinsDetail {\n /** The billing allowance. When you exceed this during the current billing period the *cost multiplier* will increase */\n allowance: number;\n /** The limit on your billing period spend. You can exceed the allowance but you cannot exceed the spend limit. Once reached the dependent may be restricted */\n limit: number;\n /** The total number of coins consumed (in this billing period), excluding the coins that have been consumed for the current day */\n used: number;\n /** True if the product is operating at or beyond its coin limit. When it is authority to perform actions using the product are severely limited. */\n at_limit: boolean;\n /** The current burn rate, the approximate amount of coins you are currently consuming each day */\n current_burn_rate: number;\n /** The predicted billing period amount, if costs continue at the current burn rate until the end of the billing period */\n billing_prediction: number;\n /** The day of the month when the bill is due, and the end of the current billing period */\n billing_day: number;\n /** A multiplier applied to your coin usage within your allowance */\n allowance_multiplier: number;\n /** A multiplier that will be applied to coin used beyond your allowance */\n overspend_multiplier: number;\n /** The number of days remaining, in the current billing period */\n remaining_days: number;\n}\n\nexport interface ProductClaimDetail {\n /** The service-specific ID that is using this Subscription\n */\n id: string;\n /** A name for the service-specific ID\n */\n name?: string;\n}\n\nexport type ProductDmStorageDetailCoins = {\n /** The number of coins currently committed for the current day. This is added to the accumulated coins at the start of each day */\n used: number;\n /** The coin cost of a 'unit' of storage or part thereof. The unit size is defined in the storage section of the response */\n unit_cost: number;\n};\n\nexport type ProductDmStorageDetailSize = {\n /** The humanised size of the peak storage used for the current day. The value is reset at the start of each day */\n peak: string;\n /** The humanised size of the current storage used for the current day and used to calculate the 'burn rate' */\n current: string;\n /** The humanised storage unit. The cost of storage is based on the daily peak of the number of units (or part thereof) used */\n unit_size: string;\n /** The peak number of storage units used today */\n units_used: number;\n};\n\nexport interface ProductDmStorageDetail {\n size: ProductDmStorageDetailSize;\n coins: ProductDmStorageDetailCoins;\n}\n\nexport interface ProductDmProjectTier {\n product: ProductDetail;\n organisation: OrganisationDetail;\n unit: UnitDetail;\n storage: ProductDmStorageDetail;\n coins: ProductCoinsDetail;\n instance: ProductInstanceDetail;\n claim?: ProductClaimDetail;\n}\n\nexport interface ProductDmStorage {\n product: ProductDetail;\n organisation: OrganisationDetail;\n unit: UnitDetail;\n storage: ProductDmStorageDetail;\n coins: ProductCoinsDetail;\n}\n\nexport interface ChargeAdditionalData { [key: string]: any }\n\nexport interface StorageChargeItem {\n item_number: number;\n /** The date and time of the processing charge */\n date: string;\n /** The coin-cost of the storage */\n coins: string;\n additional_data?: ChargeAdditionalData;\n}\n\nexport interface StorageCharges {\n num_items: number;\n items: StorageChargeItem[];\n}\n\nexport interface ProcessingChargeItem {\n /** The most recent sequence number for this charge */\n sqn: number;\n name?: string;\n username: string;\n /** The date and time of the processing charge */\n timestamp: string;\n /** The coin-cost of the storage */\n coins: string;\n additional_data?: ChargeAdditionalData;\n}\n\nexport type ProcessingChargesMerchantKind = typeof ProcessingChargesMerchantKind[keyof typeof ProcessingChargesMerchantKind];\n\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const ProcessingChargesMerchantKind = {\n DATA_MANAGER: 'DATA_MANAGER',\n} as const;\n\nexport interface ProcessingCharges {\n merchant_name: string;\n merchant_kind: ProcessingChargesMerchantKind;\n merchant_api_hostname: string;\n /** The date when the charges concluded */\n closed?: string;\n /** True if charges received after the charge record was closed */\n post_closure_charges?: boolean;\n charge: ProcessingChargeItem;\n}\n\nexport type AssetDetailScope = typeof AssetDetailScope[keyof typeof AssetDetailScope];\n\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const AssetDetailScope = {\n USER: 'USER',\n PRODUCT: 'PRODUCT',\n UNIT: 'UNIT',\n ORGANISATION: 'ORGANISATION',\n} as const;\n\nexport interface AssetDetail {\n creator: string;\n id: string;\n name: string;\n scope: AssetDetailScope;\n scope_id: string;\n secret: boolean;\n disabled: boolean;\n content: string;\n created: string;\n description?: string;\n merchants: MerchantDetail[];\n}\n\nexport type UserAccountGetResponse = UserAccountDetail;\n\nexport type UnitGetResponse = UnitDetail;\n\nexport interface UnitProductPostResponse {\n /** The Product's unique ID */\n id: string;\n}\n\n/**\n * The Unit's Product\n */\nexport type ProductUnitGetResponseProduct = ProductDmStorage | ProductDmProjectTier;\n\nexport interface ProductUnitGetResponse {\n /** The Unit's Product */\n product: ProductUnitGetResponseProduct;\n}\n\nexport interface ProductsGetTypesResponse {\n /** All the Product Types you have access to */\n product_types: ProductType[];\n}\n\nexport type ProductsGetResponseProductsItem = ProductDmStorage | ProductDmProjectTier;\n\nexport interface ProductsGetResponse {\n /** All the Products you have access to */\n products: ProductsGetResponseProductsItem[];\n}\n\nexport type ProductChargesGetResponseProductType = typeof ProductChargesGetResponseProductType[keyof typeof ProductChargesGetResponseProductType];\n\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const ProductChargesGetResponseProductType = {\n DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION: 'DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION',\n DATA_MANAGER_STORAGE_SUBSCRIPTION: 'DATA_MANAGER_STORAGE_SUBSCRIPTION',\n} as const;\n\nexport interface ProductChargesGetResponse {\n product_id: string;\n product_type: ProductChargesGetResponseProductType;\n billing_day: number;\n /** The claim, if present, for claimable products */\n claim_id?: string;\n /** The claim name, if present, for claimable products */\n claim_name?: string;\n /** The start of the charge period */\n from: string;\n /** The date where of first day after the charge period */\n until: string;\n /** The total number of cons consumed by this product for the invoice period */\n coins: string;\n processing_charges: ProcessingCharges[];\n storage_charges: StorageCharges;\n}\n\nexport interface OrganisationsGetResponse {\n /** A list of Organisations */\n organisations: OrganisationDetail[];\n}\n\nexport interface OrganisationUnitsGetResponse {\n organisation: OrganisationDetail;\n /** A list of Units\n */\n units: UnitDetail[];\n}\n\nexport interface UnitsGetResponse {\n /** A list of Units\n */\n units: OrganisationUnitsGetResponse[];\n}\n\nexport interface PersonalUnitPutResponse {\n /** The unit's Organisation. Used to identify the Default organisation */\n organisation_id: string;\n /** The unit's unique ID */\n id: string;\n}\n\nexport interface OrganisationUnitPostResponse {\n /** The unit's unique ID */\n id: string;\n}\n\nexport interface OrganisationGetDefaultResponse {\n /** Whether the user making the API call is a member of the Default Organisation. Only admin users are members of the Default organisation */\n caller_is_member: boolean;\n /** The Default Organisation ID\n */\n id: string;\n /** The Default Organisation Name\n */\n name: string;\n /** 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\n */\n private: boolean;\n created: string;\n}\n\nexport interface UsersGetResponse {\n organisation?: OrganisationDetail;\n unit?: UnitDetail;\n /** The list of Organisation Users\n */\n users: UserDetail[];\n}\n\nexport interface OrganisationPostResponse {\n /** The Organisation's unique ID */\n id: string;\n}\n\nexport interface StateGetVersionResponse {\n /** 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\n */\n version: string;\n}\n\nexport interface AssetPostResponse {\n /** The Asset ID\n */\n id: string;\n}\n\nexport interface AssetGetResponse {\n /** A list of Assets\n */\n assets: AssetDetail[];\n}\n\nexport interface AsError {\n /** Brief error text that can be presented to the user */\n error: string;\n}\n\n"]}
|