@squonk/account-server-client 0.1.32-rc.1 → 0.1.33-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 CHANGED
@@ -40,6 +40,9 @@ var createAsset = (assetPostBodyBody, options) => {
40
40
  formData.append("scope_id", assetPostBodyBody.scope_id);
41
41
  }
42
42
  formData.append("secret", assetPostBodyBody.secret.toString());
43
+ if (assetPostBodyBody.description !== void 0) {
44
+ formData.append("description", assetPostBodyBody.description);
45
+ }
43
46
  return _chunkNGBTCJWScjs.customInstance.call(void 0, {
44
47
  url: `/asset`,
45
48
  method: "post",
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/asset/asset.ts"],"names":[],"mappings":";;;;;;AAUA;AAAA;AAAA;AAAA;AAsCO,IAAM,WAAW,CACtB,QACA,SACA,WACG;AACH,SAAO,eACL,EAAE,KAAK,UAAU,QAAQ,OAAO,QAAQ,OAAO,GAC/C,OACF;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,mBAAmB,WAAW,CAAC;AAErE,QAAM,WAAW,8CAAc,aAAY,oBAAoB,MAAM;AAErE,QAAM,UAA+D,CAAC;AAAA,IACpE;AAAA,QACI,SAAS,QAAQ,gBAAgB,MAAM;AAE7C,QAAM,QAAQ,SACZ,UACA,SACA,YACF;AAEA,SAAO;AAAA,IACL;AAAA,KACG;AAEP;AAOO,IAAM,cAAc,CACzB,mBACA,YACG;AACH,QAAM,WAAW,IAAI,SAAS;AAC9B,WAAS,OAAO,QAAQ,kBAAkB,IAAI;AAC9C,MAAI,kBAAkB,iBAAiB,QAAW;AAChD,aAAS,OAAO,gBAAgB,kBAAkB,YAAY;AAAA,EAChE;AACA,MAAI,kBAAkB,m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AAO,aAAa,SAAS,cAAc;AAAA,EAC7C;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B;AAMO,IAAM,cAAc,CACzB,SACA,YACG;AACH,SAAO,eACL,EAAE,KAAK,UAAU,kBAAkB,QAAQ,QAAQ,GACnD,OACF;AACF;AAQO,IAAM,iBAAiB,CAG5B,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,YAAY,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,eACL,EAAE,KAAK,UAAU,kBAAkB,QAAQ,SAAS,OAAO,GAC3D,OACF;AACF;AAQO,IAAM,iBAAiB,CAG5B,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,SAAS,WAAW,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,eACL,EAAE,KAAK,UAAU,kBAAkB,QAAQ,SAAS,OAAO,GAC3D,OACF;AACF;AAQO,IAAM,iBAAiB,CAG5B,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,SAAS,WAAW,SAAS,CAAC;AAEtC,WAAO,YAAY,SAAS,QAAQ,cAAc;AAAA,EACpD;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B","sourcesContent":["/**\n * Generated by orval v6.8.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Products**, **Organisations**, **Units** and **Users**.\n\n * OpenAPI spec version: 0.1\n */\nimport {\n useQuery,\n useMutation,\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"react-query\";\nimport type {\n AssetGetResponse,\n AsError,\n GetAssetParams,\n AssetPostResponse,\n AssetPostBodyBody,\n AttachAssetParams,\n DetachAssetParams,\n} from \"../account-server-api.schemas\";\nimport { customInstance, ErrorType } from \".././custom-instance\";\n\nexport type AwaitedInput<T> = PromiseLike<T> | T;\n\nexport type Awaited<O> = O extends AwaitedInput<infer T> ? T : never;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * Gets 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\", signal, params },\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 );\n\n return {\n queryKey,\n ...query,\n };\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\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;AAAA;AAAA;AAsCO,IAAM,WAAW,CACtB,QACA,SACA,WACG;AACH,SAAO,eACL,EAAE,KAAK,UAAU,QAAQ,OAAO,QAAQ,OAAO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,OAAO,GAC3D,OACF;AACF;AAQO,IAAM,iBAAiB,CAG5B,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,SAAS,WAAW,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,eACL,EAAE,KAAK,UAAU,kBAAkB,QAAQ,SAAS,OAAO,GAC3D,OACF;AACF;AAQO,IAAM,iBAAiB,CAG5B,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,SAAS,WAAW,SAAS,CAAC;AAEtC,WAAO,YAAY,SAAS,QAAQ,cAAc;AAAA,EACpD;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B","sourcesContent":["/**\n * Generated by orval v6.8.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Products**, **Organisations**, **Units** and **Users**.\n\n * OpenAPI spec version: 0.1\n */\nimport {\n useQuery,\n useMutation,\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"react-query\";\nimport type {\n AssetGetResponse,\n AsError,\n GetAssetParams,\n AssetPostResponse,\n AssetPostBodyBody,\n AttachAssetParams,\n DetachAssetParams,\n} from \"../account-server-api.schemas\";\nimport { customInstance, ErrorType } from \".././custom-instance\";\n\nexport type AwaitedInput<T> = PromiseLike<T> | T;\n\nexport type Awaited<O> = O extends AwaitedInput<infer T> ? T : never;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * Gets 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\", signal, params },\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 );\n\n return {\n queryKey,\n ...query,\n };\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"]}
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 { G as GetAssetParams, a9 as customInstance, a4 as AssetGetResponse, aa as ErrorType, a5 as AsError, i as AssetPostBodyBody, a3 as AssetPostResponse, A as AttachAssetParams, D as DetachAssetParams } from '../custom-instance-6b9df5d3.js';
3
+ import { G as GetAssetParams, a9 as customInstance, a4 as AssetGetResponse, aa as ErrorType, a5 as AsError, i as AssetPostBodyBody, a3 as AssetPostResponse, A as AttachAssetParams, D as DetachAssetParams } from '../custom-instance-b985e1be.js';
4
4
  import 'axios';
5
5
 
6
6
  declare type AwaitedInput<T> = PromiseLike<T> | T;
package/asset/asset.js CHANGED
@@ -40,6 +40,9 @@ var createAsset = (assetPostBodyBody, options) => {
40
40
  formData.append("scope_id", assetPostBodyBody.scope_id);
41
41
  }
42
42
  formData.append("secret", assetPostBodyBody.secret.toString());
43
+ if (assetPostBodyBody.description !== void 0) {
44
+ formData.append("description", assetPostBodyBody.description);
45
+ }
43
46
  return customInstance({
44
47
  url: `/asset`,
45
48
  method: "post",
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/asset/asset.ts"],"sourcesContent":["/**\n * Generated by orval v6.8.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Products**, **Organisations**, **Units** and **Users**.\n\n * OpenAPI spec version: 0.1\n */\nimport {\n useQuery,\n useMutation,\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"react-query\";\nimport type {\n AssetGetResponse,\n AsError,\n GetAssetParams,\n AssetPostResponse,\n AssetPostBodyBody,\n AttachAssetParams,\n DetachAssetParams,\n} from \"../account-server-api.schemas\";\nimport { customInstance, ErrorType } from \".././custom-instance\";\n\nexport type AwaitedInput<T> = PromiseLike<T> | T;\n\nexport type Awaited<O> = O extends AwaitedInput<infer T> ? T : never;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * Gets 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\", signal, params },\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 );\n\n return {\n queryKey,\n ...query,\n };\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\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?: Detach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MO,IAAM,cAAc,CACzB,SACA,QACA,YACG;AACH,SAAO,eACL,EAAE,KAAK,UAAU,kBAAkB,QAAQ,SAAS,OAAO,GAC3D,OACF;AACF;AAQO,IAAM,iBAAiB,CAG5B,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,SAAS,WAAW,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,eACL,EAAE,KAAK,UAAU,kBAAkB,QAAQ,SAAS,OAAO,GAC3D,OACF;AACF;AAQO,IAAM,iBAAiB,CAG5B,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,SAAS,WAAW,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.8.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Products**, **Organisations**, **Units** and **Users**.\n\n * OpenAPI spec version: 0.1\n */\nimport {\n useQuery,\n useMutation,\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"react-query\";\nimport type {\n AssetGetResponse,\n AsError,\n GetAssetParams,\n AssetPostResponse,\n AssetPostBodyBody,\n AttachAssetParams,\n DetachAssetParams,\n} from \"../account-server-api.schemas\";\nimport { customInstance, ErrorType } from \".././custom-instance\";\n\nexport type AwaitedInput<T> = PromiseLike<T> | T;\n\nexport type Awaited<O> = O extends AwaitedInput<infer T> ? T : never;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * Gets 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\", signal, params },\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 );\n\n return {\n queryKey,\n ...query,\n };\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;AAAA;AAAA;AAAA;AAsCO,IAAM,WAAW,CACtB,QACA,SACA,WACG;AACH,SAAO,eACL,EAAE,KAAK,UAAU,QAAQ,OAAO,QAAQ,OAAO,GAC/C,OACF;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,mBAAmB,WAAW,CAAC;AAErE,QAAM,WAAW,8CAAc,aAAY,oBAAoB,MAAM;AAErE,QAAM,UAA+D,CAAC;AAAA,IACpE;AAAA,QACI,SAAS,QAAQ,gBAAgB,MAAM;AAE7C,QAAM,QAAQ,SACZ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,SAAS,OAAO,GAC3D,OACF;AACF;AAQO,IAAM,iBAAiB,CAG5B,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,SAAS,WAAW,SAAS,CAAC;AAEtC,WAAO,YAAY,SAAS,QAAQ,cAAc;AAAA,EACpD;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B;","names":[]}
@@ -118,6 +118,8 @@ declare type AssetPostBodyBody = {
118
118
  scope_id?: string;
119
119
  /** Is this a secret asset? */
120
120
  secret: boolean;
121
+ /** An optional description for the Asset */
122
+ description?: string;
121
123
  };
122
124
  interface UserDetail {
123
125
  /** The user identity (username) */
@@ -317,6 +319,8 @@ interface AssetDetail {
317
319
  secret: boolean;
318
320
  disabled: boolean;
319
321
  content: string;
322
+ created: string;
323
+ description?: string;
320
324
  merchants: MerchantDetail[];
321
325
  }
322
326
  declare type UserAccountGetResponse = UserAccountDetail;
@@ -325,14 +329,7 @@ interface UnitsGetResponse {
325
329
  */
326
330
  units: OrganisationUnitsGetResponse[];
327
331
  }
328
- interface UnitGetResponse {
329
- /** The Unit's unique ID */
330
- id: string;
331
- /** The Unit's name */
332
- name: string;
333
- /** The Unit's oener (username) */
334
- owner_id: string;
335
- }
332
+ declare type UnitGetResponse = UnitDetail;
336
333
  interface UnitProductPostResponse {
337
334
  /** The Products's unique ID */
338
335
  id: string;
package/index.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/account-server-api.schemas.ts"],"names":[],"mappings":";;;;;;;;AA8DO,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;AAqCO,IAAM,yBAAyB;AAAA,EACpC,MAAM;AAAA,EACN,SAAS;AAAA,EACT,MAAM;AAAA,EACN,cAAc;AAChB;AA+CO,IAAM,qBAAqB;AAAA,EAChC,cAAc;AAChB;AAyCO,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;AAiGO,IAAM,mBAAmB;AAAA,EAC9B,MAAM;AAAA,EACN,SAAS;AAAA,EACT,MAAM;AAAA,EACN,cAAc;AAChB","sourcesContent":["/**\n * Generated by orval v6.8.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Products**, **Organisations**, **Units** and **Users**.\n\n * OpenAPI spec version: 0.1\n */\nexport type DetachAssetParams = { m_id?: QMIdParameter };\n\nexport type AttachAssetParams = { m_id?: QMIdParameter };\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\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 service identity for the Product. Products are created for use on a specific service, like a Data Manager instance */\n service_id: number;\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 wil be the Unit ID if it's a UNIT. A scope_id is required if the scope is USER as it wil be automatically set to your username */\n scope_id?: string;\n /** Is this a secret asset? */\n secret: boolean;\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}\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 /** 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}\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 falvour. 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 /** The Product Service ID\n */\n service_id?: number;\n /** The Product Type\n */\n type: ProductDetailType;\n /** The Product Type falvour. 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 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 merchants: MerchantDetail[];\n}\n\nexport type UserAccountGetResponse = UserAccountDetail;\n\nexport interface UnitsGetResponse {\n /** A list of Units\n */\n units: OrganisationUnitsGetResponse[];\n}\n\nexport interface UnitGetResponse {\n /** The Unit's unique ID */\n id: string;\n /** The Unit's name */\n name: string;\n /** The Unit's oener (username) */\n owner_id: string;\n}\n\nexport interface UnitProductPostResponse {\n /** The Products'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 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 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}\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":";;;;;;;;AA8DO,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;AAqCO,IAAM,yBAAyB;AAAA,EACpC,MAAM;AAAA,EACN,SAAS;AAAA,EACT,MAAM;AAAA,EACN,cAAc;AAChB;AAiDO,IAAM,qBAAqB;AAAA,EAChC,cAAc;AAChB;AAyCO,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;AAiGO,IAAM,mBAAmB;AAAA,EAC9B,MAAM;AAAA,EACN,SAAS;AAAA,EACT,MAAM;AAAA,EACN,cAAc;AAChB","sourcesContent":["/**\n * Generated by orval v6.8.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Products**, **Organisations**, **Units** and **Users**.\n\n * OpenAPI spec version: 0.1\n */\nexport type DetachAssetParams = { m_id?: QMIdParameter };\n\nexport type AttachAssetParams = { m_id?: QMIdParameter };\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\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 service identity for the Product. Products are created for use on a specific service, like a Data Manager instance */\n service_id: number;\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 wil be the Unit ID if it's a UNIT. A scope_id is required if the scope is USER as it wil 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}\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 /** 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}\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 falvour. 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 /** The Product Service ID\n */\n service_id?: number;\n /** The Product Type\n */\n type: ProductDetailType;\n /** The Product Type falvour. 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 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 interface UnitsGetResponse {\n /** A list of Units\n */\n units: OrganisationUnitsGetResponse[];\n}\n\nexport type UnitGetResponse = UnitDetail;\n\nexport interface UnitProductPostResponse {\n /** The Products'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 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 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}\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"]}
package/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export { a6 as AXIOS_INSTANCE, a5 as AsError, I as AssetDetail, H as AssetDetailScope, a4 as AssetGetResponse, i as AssetPostBodyBody, h as AssetPostBodyBodyScope, a3 as AssetPostResponse, A as AttachAssetParams, D as DetachAssetParams, aa as ErrorType, G as GetAssetParams, m as MerchantDetail, M as MerchantDetailKind, n as MerchantGetResponse, o as MerchantsGetResponse, p as OrganisationDetail, $ as OrganisationGetDefaultResponse, g as OrganisationPostBodyBody, a1 as OrganisationPostResponse, O as OrganisationUnitPostBodyBody, _ as OrganisationUnitPostResponse, Y as OrganisationUnitsGetResponse, X as OrganisationsGetResponse, Z as PersonalUnitPutResponse, y as ProductClaimDetail, x as ProductCoinsDetail, w as ProductDetail, u as ProductDetailFlavour, v as ProductDetailType, E as ProductDmProjectTier, F as ProductDmStorage, C as ProductDmStorageDetail, z as ProductDmStorageDetailCoins, B as ProductDmStorageDetailSize, t as ProductInstanceDetail, s as ProductInstanceDetailCoins, P as ProductPatchBodyBody, r as ProductType, q as ProductTypeServiceKind, S as ProductUnitGetResponse, R as ProductUnitGetResponseProduct, W as ProductsGetResponse, V as ProductsGetResponseProductsItem, T as ProductsGetTypesResponse, c as QMIdParameter, d as QOrgIdParameter, a as QProductIdParameter, b as QUnitIdParameter, Q as QUserIdParameter, a2 as StateGetVersionResponse, l as UnitDetail, L as UnitGetResponse, f as UnitProductPostBodyBody, U as UnitProductPostBodyBodyFlavour, e as UnitProductPostBodyBodyType, N as UnitProductPostResponse, K as UnitsGetResponse, k as UserAccountDetail, J as UserAccountGetResponse, j as UserDetail, a0 as UsersGetResponse, a9 as customInstance, a7 as setAuthToken, a8 as setBaseUrl } from './custom-instance-6b9df5d3.js';
1
+ export { a6 as AXIOS_INSTANCE, a5 as AsError, I as AssetDetail, H as AssetDetailScope, a4 as AssetGetResponse, i as AssetPostBodyBody, h as AssetPostBodyBodyScope, a3 as AssetPostResponse, A as AttachAssetParams, D as DetachAssetParams, aa as ErrorType, G as GetAssetParams, m as MerchantDetail, M as MerchantDetailKind, n as MerchantGetResponse, o as MerchantsGetResponse, p as OrganisationDetail, $ as OrganisationGetDefaultResponse, g as OrganisationPostBodyBody, a1 as OrganisationPostResponse, O as OrganisationUnitPostBodyBody, _ as OrganisationUnitPostResponse, Y as OrganisationUnitsGetResponse, X as OrganisationsGetResponse, Z as PersonalUnitPutResponse, y as ProductClaimDetail, x as ProductCoinsDetail, w as ProductDetail, u as ProductDetailFlavour, v as ProductDetailType, E as ProductDmProjectTier, F as ProductDmStorage, C as ProductDmStorageDetail, z as ProductDmStorageDetailCoins, B as ProductDmStorageDetailSize, t as ProductInstanceDetail, s as ProductInstanceDetailCoins, P as ProductPatchBodyBody, r as ProductType, q as ProductTypeServiceKind, S as ProductUnitGetResponse, R as ProductUnitGetResponseProduct, W as ProductsGetResponse, V as ProductsGetResponseProductsItem, T as ProductsGetTypesResponse, c as QMIdParameter, d as QOrgIdParameter, a as QProductIdParameter, b as QUnitIdParameter, Q as QUserIdParameter, a2 as StateGetVersionResponse, l as UnitDetail, L as UnitGetResponse, f as UnitProductPostBodyBody, U as UnitProductPostBodyBodyFlavour, e as UnitProductPostBodyBodyType, N as UnitProductPostResponse, K as UnitsGetResponse, k as UserAccountDetail, J as UserAccountGetResponse, j as UserDetail, a0 as UsersGetResponse, a9 as customInstance, a7 as setAuthToken, a8 as setBaseUrl } from './custom-instance-b985e1be.js';
2
2
  import 'axios';
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/account-server-api.schemas.ts"],"sourcesContent":["/**\n * Generated by orval v6.8.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Products**, **Organisations**, **Units** and **Users**.\n\n * OpenAPI spec version: 0.1\n */\nexport type DetachAssetParams = { m_id?: QMIdParameter };\n\nexport type AttachAssetParams = { m_id?: QMIdParameter };\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\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 service identity for the Product. Products are created for use on a specific service, like a Data Manager instance */\n service_id: number;\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 wil be the Unit ID if it's a UNIT. A scope_id is required if the scope is USER as it wil be automatically set to your username */\n scope_id?: string;\n /** Is this a secret asset? */\n secret: boolean;\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}\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 /** 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}\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 falvour. 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 /** The Product Service ID\n */\n service_id?: number;\n /** The Product Type\n */\n type: ProductDetailType;\n /** The Product Type falvour. 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 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 merchants: MerchantDetail[];\n}\n\nexport type UserAccountGetResponse = UserAccountDetail;\n\nexport interface UnitsGetResponse {\n /** A list of Units\n */\n units: OrganisationUnitsGetResponse[];\n}\n\nexport interface UnitGetResponse {\n /** The Unit's unique ID */\n id: string;\n /** The Unit's name */\n name: string;\n /** The Unit's oener (username) */\n owner_id: string;\n}\n\nexport interface UnitProductPostResponse {\n /** The Products'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 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 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}\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"],"mappings":";;;;;;;;AA8DO,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;AAqCO,IAAM,yBAAyB;AAAA,EACpC,MAAM;AAAA,EACN,SAAS;AAAA,EACT,MAAM;AAAA,EACN,cAAc;AAChB;AA+CO,IAAM,qBAAqB;AAAA,EAChC,cAAc;AAChB;AAyCO,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;AAiGO,IAAM,mBAAmB;AAAA,EAC9B,MAAM;AAAA,EACN,SAAS;AAAA,EACT,MAAM;AAAA,EACN,cAAc;AAChB;","names":[]}
1
+ {"version":3,"sources":["../src/account-server-api.schemas.ts"],"sourcesContent":["/**\n * Generated by orval v6.8.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Products**, **Organisations**, **Units** and **Users**.\n\n * OpenAPI spec version: 0.1\n */\nexport type DetachAssetParams = { m_id?: QMIdParameter };\n\nexport type AttachAssetParams = { m_id?: QMIdParameter };\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\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 service identity for the Product. Products are created for use on a specific service, like a Data Manager instance */\n service_id: number;\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 wil be the Unit ID if it's a UNIT. A scope_id is required if the scope is USER as it wil 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}\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 /** 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}\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 falvour. 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 /** The Product Service ID\n */\n service_id?: number;\n /** The Product Type\n */\n type: ProductDetailType;\n /** The Product Type falvour. 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 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 interface UnitsGetResponse {\n /** A list of Units\n */\n units: OrganisationUnitsGetResponse[];\n}\n\nexport type UnitGetResponse = UnitDetail;\n\nexport interface UnitProductPostResponse {\n /** The Products'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 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 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}\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"],"mappings":";;;;;;;;AA8DO,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;AAqCO,IAAM,yBAAyB;AAAA,EACpC,MAAM;AAAA,EACN,SAAS;AAAA,EACT,MAAM;AAAA,EACN,cAAc;AAChB;AAiDO,IAAM,qBAAqB;AAAA,EAChC,cAAc;AAChB;AAyCO,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;AAiGO,IAAM,mBAAmB;AAAA,EAC9B,MAAM;AAAA,EACN,SAAS;AAAA,EACT,MAAM;AAAA,EACN,cAAc;AAChB;","names":[]}
@@ -1,4 +1,4 @@
1
- import { a9 as customInstance, o as MerchantsGetResponse, aa as ErrorType, a5 as AsError, m as MerchantDetail } from '../custom-instance-6b9df5d3.js';
1
+ import { a9 as customInstance, o as MerchantsGetResponse, aa as ErrorType, a5 as AsError, m as MerchantDetail } from '../custom-instance-b985e1be.js';
2
2
  import { UseQueryOptions, QueryKey, UseQueryResult } from 'react-query';
3
3
  import 'axios';
4
4
 
@@ -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 { a9 as customInstance, X as OrganisationsGetResponse, aa as ErrorType, a5 as AsError, g as OrganisationPostBodyBody, a1 as OrganisationPostResponse, $ as OrganisationGetDefaultResponse } from '../custom-instance-6b9df5d3.js';
3
+ import { a9 as customInstance, X as OrganisationsGetResponse, aa as ErrorType, a5 as AsError, g as OrganisationPostBodyBody, a1 as OrganisationPostResponse, $ as OrganisationGetDefaultResponse } from '../custom-instance-b985e1be.js';
4
4
  import 'axios';
5
5
 
6
6
  declare type AwaitedInput<T> = PromiseLike<T> | T;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.1.32-rc.1",
2
+ "version": "0.1.33-rc.1",
3
3
  "author": "Oliver Dudgeon",
4
4
  "name": "@squonk/account-server-client",
5
5
  "private": false,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/product/product.ts"],"names":[],"mappings":";;;;;;AAUA;AAAA;AAAA;AAAA;AAsCO,IAAM,kBAAkB,CAC7B,SACA,WACG;AACH,SAAO,eACL,EAAE,KAAK,iBAAiB,QAAQ,OAAO,OAAO,GAC9C,OACF;AACF;AAEO,IAAM,6BAA6B,MAAM,CAAC,eAAe;AAOzD,IAAM,qBAAqB,CAGhC,YAO4D;AAC5D,QAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,CAAC;AAErE,QAAM,WAAW,8CAAc,aAAY,2BAA2B;AAEtE,QAAM,UAAsE,CAAC;AAAA,IAC3E;AAAA,QACI,gBAAgB,gBAAgB,MAAM;AAE5C,QAAM,QAAQ,SAIZ,UAAU,SAAS,YAAY;AAEjC,SAAO;AAAA,IACL;AAAA,KACG;AAEP;AAOO,IAAM,cAAc,CACzB,SACA,WACG;AACH,SAAO,eACL,EAAE,KAAK,YAAY,QAAQ,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K,iBAAiB,kBAAkB,aAAa,QAAQ,SAAS,GACxE,OACF;AACF;AAQO,IAAM,mBAAmB,CAG9B,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,QAAQ,cAAc,SAAS,CAAC;AAExC,WAAO,cAAc,QAAQ,WAAW,cAAc;AAAA,EACxD;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B;AAMO,IAAM,eAAe,CAC1B,QACA,WACA,sBACA,YACG;AACH,SAAO,eACL;AAAA,IACE,KAAK,iBAAiB,kBAAkB;AAAA,IACxC,QAAQ;AAAA,IACR,SAAS,EAAE,gBAAgB,mBAAmB;AAAA,IAC9C,MAAM;AAAA,EACR,GACA,OACF;AACF;AAQO,IAAM,kBAAkB,CAG7B,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,QAAQ,WAAW,SAAS,SAAS,CAAC;AAE9C,WAAO,aAAa,QAAQ,WAAW,MAAM,cAAc;AAAA,EAC7D;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B","sourcesContent":["/**\n * Generated by orval v6.8.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Products**, **Organisations**, **Units** and **Users**.\n\n * OpenAPI spec version: 0.1\n */\nimport {\n useQuery,\n useMutation,\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"react-query\";\nimport type {\n ProductsGetTypesResponse,\n AsError,\n ProductsGetResponse,\n UnitProductPostResponse,\n UnitProductPostBodyBody,\n ProductUnitGetResponse,\n ProductPatchBodyBody,\n} from \"../account-server-api.schemas\";\nimport { customInstance, ErrorType } from \".././custom-instance\";\n\nexport type AwaitedInput<T> = PromiseLike<T> | T;\n\nexport type Awaited<O> = O extends AwaitedInput<infer T> ? T : never;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * Gets product types you can purchase\n\n * @summary Gets all Product Types\n */\nexport const getProductTypes = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProductsGetTypesResponse>(\n { url: `/product-type`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetProductTypesQueryKey = () => [`/product-type`];\n\nexport type GetProductTypesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProductTypes>>\n>;\nexport type GetProductTypesQueryError = ErrorType<AsError | void>;\n\nexport const useGetProductTypes = <\n TData = Awaited<ReturnType<typeof getProductTypes>>,\n TError = ErrorType<AsError | void>\n>(options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProductTypes>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProductTypesQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProductTypes>>> = ({\n signal,\n }) => getProductTypes(requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getProductTypes>>,\n TError,\n TData\n >(queryKey, queryFn, queryOptions);\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Gets products you have access to, across all Units and Organisations\n\n * @summary Gets all Products\n */\nexport const getProducts = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProductsGetResponse>(\n { url: `/product`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetProductsQueryKey = () => [`/product`];\n\nexport type GetProductsQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProducts>>\n>;\nexport type GetProductsQueryError = ErrorType<AsError | void>;\n\nexport const useGetProducts = <\n TData = Awaited<ReturnType<typeof getProducts>>,\n TError = ErrorType<AsError | void>\n>(options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProducts>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProductsQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProducts>>> = ({\n signal,\n }) => getProducts(requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getProducts>>,\n TError,\n TData\n >(queryKey, queryFn, queryOptions);\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Gets products you have access to based on an Organisation\n\n * @summary Gets Products for an Organisation\n */\nexport const getProductsForOrganisation = (\n orgId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProductsGetResponse>(\n { url: `/product/organisation/${orgId}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetProductsForOrganisationQueryKey = (orgId: string) => [\n `/product/organisation/${orgId}`,\n];\n\nexport type GetProductsForOrganisationQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProductsForOrganisation>>\n>;\nexport type GetProductsForOrganisationQueryError = ErrorType<void | AsError>;\n\nexport const useGetProductsForOrganisation = <\n TData = Awaited<ReturnType<typeof getProductsForOrganisation>>,\n TError = ErrorType<void | AsError>\n>(\n orgId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProductsForOrganisation>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetProductsForOrganisationQueryKey(orgId);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getProductsForOrganisation>>\n > = ({ signal }) => getProductsForOrganisation(orgId, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getProductsForOrganisation>>,\n TError,\n TData\n >(queryKey, queryFn, { enabled: !!orgId, ...queryOptions });\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * @summary Creates a Product for an Organisational Unit\n */\nexport const createUnitProduct = (\n unitId: string,\n unitProductPostBodyBody: UnitProductPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<UnitProductPostResponse>(\n {\n url: `/product/unit/${unitId}`,\n method: \"post\",\n headers: { \"Content-Type\": \"application/json\" },\n data: unitProductPostBodyBody,\n },\n options\n );\n};\n\nexport type CreateUnitProductMutationResult = NonNullable<\n Awaited<ReturnType<typeof createUnitProduct>>\n>;\nexport type CreateUnitProductMutationBody = UnitProductPostBodyBody;\nexport type CreateUnitProductMutationError = ErrorType<AsError | void>;\n\nexport const useCreateUnitProduct = <\n TError = ErrorType<AsError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createUnitProduct>>,\n TError,\n { unitId: string; data: UnitProductPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof createUnitProduct>>,\n { unitId: string; data: UnitProductPostBodyBody }\n > = (props) => {\n const { unitId, data } = props ?? {};\n\n return createUnitProduct(unitId, data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof createUnitProduct>>,\n TError,\n { unitId: string; data: UnitProductPostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets products you have access to based on an Organisational Unit\n\n * @summary Gets Products for an Organisational Unit\n */\nexport const getProductsForUnit = (\n unitId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProductsGetResponse>(\n { url: `/product/unit/${unitId}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetProductsForUnitQueryKey = (unitId: string) => [\n `/product/unit/${unitId}`,\n];\n\nexport type GetProductsForUnitQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProductsForUnit>>\n>;\nexport type GetProductsForUnitQueryError = ErrorType<void | AsError>;\n\nexport const useGetProductsForUnit = <\n TData = Awaited<ReturnType<typeof getProductsForUnit>>,\n TError = ErrorType<void | AsError>\n>(\n unitId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProductsForUnit>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetProductsForUnitQueryKey(unitId);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getProductsForUnit>>\n > = ({ signal }) => getProductsForUnit(unitId, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getProductsForUnit>>,\n TError,\n TData\n >(queryKey, queryFn, { enabled: !!unitId, ...queryOptions });\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Gets a Unit's Product\n\n * @summary Gets a Unit's Product\n */\nexport const getProduct = (\n unitId: string,\n productId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProductUnitGetResponse>(\n {\n url: `/product/unit/${unitId}/product/${productId}`,\n method: \"get\",\n signal,\n },\n options\n );\n};\n\nexport const getGetProductQueryKey = (unitId: string, productId: string) => [\n `/product/unit/${unitId}/product/${productId}`,\n];\n\nexport type GetProductQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProduct>>\n>;\nexport type GetProductQueryError = ErrorType<AsError | void>;\n\nexport const useGetProduct = <\n TData = Awaited<ReturnType<typeof getProduct>>,\n TError = ErrorType<AsError | void>\n>(\n unitId: string,\n productId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProduct>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetProductQueryKey(unitId, productId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProduct>>> = ({\n signal,\n }) => getProduct(unitId, productId, requestOptions, signal);\n\n const query = useQuery<Awaited<ReturnType<typeof getProduct>>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!(unitId && productId), ...queryOptions }\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * @summary Deletes an existing Product\n */\nexport const deleteProduct = (\n unitId: string,\n productId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/product/unit/${unitId}/product/${productId}`, method: \"delete\" },\n options\n );\n};\n\nexport type DeleteProductMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteProduct>>\n>;\n\nexport type DeleteProductMutationError = ErrorType<AsError>;\n\nexport const useDeleteProduct = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteProduct>>,\n TError,\n { unitId: string; productId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteProduct>>,\n { unitId: string; productId: string }\n > = (props) => {\n const { unitId, productId } = props ?? {};\n\n return deleteProduct(unitId, productId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof deleteProduct>>,\n TError,\n { unitId: string; productId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Used to update some adjustable parameters of a Product, i.e. to extend the Allowance or Limit. At the moment Data Manager products can be patched by changing the `name`, it's coin `allowance` or `limit`\n\n * @summary Adjust an existing Product\n */\nexport const patchProduct = (\n unitId: string,\n productId: string,\n productPatchBodyBody: ProductPatchBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n {\n url: `/product/unit/${unitId}/product/${productId}`,\n method: \"patch\",\n headers: { \"Content-Type\": \"application/json\" },\n data: productPatchBodyBody,\n },\n options\n );\n};\n\nexport type PatchProductMutationResult = NonNullable<\n Awaited<ReturnType<typeof patchProduct>>\n>;\nexport type PatchProductMutationBody = ProductPatchBodyBody;\nexport type PatchProductMutationError = ErrorType<AsError>;\n\nexport const usePatchProduct = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchProduct>>,\n TError,\n { unitId: string; productId: string; data: ProductPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof patchProduct>>,\n { unitId: string; productId: string; data: ProductPatchBodyBody }\n > = (props) => {\n const { unitId, productId, data } = props ?? {};\n\n return patchProduct(unitId, productId, data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof patchProduct>>,\n TError,\n { unitId: string; productId: string; data: ProductPatchBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n"]}
1
+ {"version":3,"sources":["../../src/product/product.ts"],"names":[],"mappings":";;;;;;AAUA;AAAA;AAAA;AAAA;AAsCO,IAAM,kBAAkB,CAC7B,SACA,WACG;AACH,SAAO,eACL,EAAE,KAAK,iBAAiB,QAAQ,OAAO,OAAO,GAC9C,OACF;AACF;AAEO,IAAM,6BAA6B,MAAM,CAAC,eAAe;AAOzD,IAAM,qBAAqB,CAGhC,YAO4D;AAC5D,QAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,CAAC;AAErE,QAAM,WAAW,8CAAc,aAAY,2BAA2B;AAEtE,QAAM,UAAsE,CAAC;AAAA,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,gBAAgB,MAAM;AAE1D,QAAM,QAAQ,SACZ,UACA,SACA,iBAAE,SAAS,CAAC,CAAE,WAAU,cAAe,aACzC;AAEA,SAAO;AAAA,IACL;AAAA,KACG;AAEP;AAKO,IAAM,gBAAgB,CAC3B,QACA,WACA,YACG;AACH,SAAO,eACL,EAAE,KAAK,iBAAiB,kBAAkB,aAAa,QAAQ,SAAS,GACxE,OACF;AACF;AAQO,IAAM,mBAAmB,CAG9B,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,QAAQ,cAAc,SAAS,CAAC;AAExC,WAAO,cAAc,QAAQ,WAAW,cAAc;AAAA,EACxD;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B;AAMO,IAAM,eAAe,CAC1B,QACA,WACA,sBACA,YACG;AACH,SAAO,eACL;AAAA,IACE,KAAK,iBAAiB,kBAAkB;AAAA,IACxC,QAAQ;AAAA,IACR,SAAS,EAAE,gBAAgB,mBAAmB;AAAA,IAC9C,MAAM;AAAA,EACR,GACA,OACF;AACF;AAQO,IAAM,kBAAkB,CAG7B,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,QAAQ,WAAW,SAAS,SAAS,CAAC;AAE9C,WAAO,aAAa,QAAQ,WAAW,MAAM,cAAc;AAAA,EAC7D;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B","sourcesContent":["/**\n * Generated by orval v6.8.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Products**, **Organisations**, **Units** and **Users**.\n\n * OpenAPI spec version: 0.1\n */\nimport {\n useQuery,\n useMutation,\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"react-query\";\nimport type {\n ProductsGetTypesResponse,\n AsError,\n ProductsGetResponse,\n UnitProductPostResponse,\n UnitProductPostBodyBody,\n ProductUnitGetResponse,\n ProductPatchBodyBody,\n} from \"../account-server-api.schemas\";\nimport { customInstance, ErrorType } from \".././custom-instance\";\n\nexport type AwaitedInput<T> = PromiseLike<T> | T;\n\nexport type Awaited<O> = O extends AwaitedInput<infer T> ? T : never;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * Gets product types you can purchase\n\n * @summary Gets all Product Types\n */\nexport const getProductTypes = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProductsGetTypesResponse>(\n { url: `/product-type`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetProductTypesQueryKey = () => [`/product-type`];\n\nexport type GetProductTypesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProductTypes>>\n>;\nexport type GetProductTypesQueryError = ErrorType<AsError | void>;\n\nexport const useGetProductTypes = <\n TData = Awaited<ReturnType<typeof getProductTypes>>,\n TError = ErrorType<AsError | void>\n>(options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProductTypes>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProductTypesQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProductTypes>>> = ({\n signal,\n }) => getProductTypes(requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getProductTypes>>,\n TError,\n TData\n >(queryKey, queryFn, queryOptions);\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Gets products you have access to, across all Units and Organisations\n\n * @summary Gets all Products\n */\nexport const getProducts = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProductsGetResponse>(\n { url: `/product`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetProductsQueryKey = () => [`/product`];\n\nexport type GetProductsQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProducts>>\n>;\nexport type GetProductsQueryError = ErrorType<AsError | void>;\n\nexport const useGetProducts = <\n TData = Awaited<ReturnType<typeof getProducts>>,\n TError = ErrorType<AsError | void>\n>(options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProducts>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProductsQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProducts>>> = ({\n signal,\n }) => getProducts(requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getProducts>>,\n TError,\n TData\n >(queryKey, queryFn, queryOptions);\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Gets products you have access to based on an Organisation\n\n * @summary Gets Products for an Organisation\n */\nexport const getProductsForOrganisation = (\n orgId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProductsGetResponse>(\n { url: `/product/organisation/${orgId}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetProductsForOrganisationQueryKey = (orgId: string) => [\n `/product/organisation/${orgId}`,\n];\n\nexport type GetProductsForOrganisationQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProductsForOrganisation>>\n>;\nexport type GetProductsForOrganisationQueryError = ErrorType<void | AsError>;\n\nexport const useGetProductsForOrganisation = <\n TData = Awaited<ReturnType<typeof getProductsForOrganisation>>,\n TError = ErrorType<void | AsError>\n>(\n orgId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProductsForOrganisation>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetProductsForOrganisationQueryKey(orgId);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getProductsForOrganisation>>\n > = ({ signal }) => getProductsForOrganisation(orgId, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getProductsForOrganisation>>,\n TError,\n TData\n >(queryKey, queryFn, { enabled: !!orgId, ...queryOptions });\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Products are **Subscriptions** that you create in a Unit and use **Merchant** services like the `DATA_MANAGER`.\n\nTypical subscriptions include `DATA_MANAGER_STORAGE_SUBSCRIPTION` and `DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION`.\n\nSome subscriptions, like the `DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION` are available i various **flavours** that influence their capabilities. Flavours are typically referred to using the names `BRONZE`, `SILVER` and `GOLD`\n\n * @summary Creates a Product for an Organisational Unit\n */\nexport const createUnitProduct = (\n unitId: string,\n unitProductPostBodyBody: UnitProductPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<UnitProductPostResponse>(\n {\n url: `/product/unit/${unitId}`,\n method: \"post\",\n headers: { \"Content-Type\": \"application/json\" },\n data: unitProductPostBodyBody,\n },\n options\n );\n};\n\nexport type CreateUnitProductMutationResult = NonNullable<\n Awaited<ReturnType<typeof createUnitProduct>>\n>;\nexport type CreateUnitProductMutationBody = UnitProductPostBodyBody;\nexport type CreateUnitProductMutationError = ErrorType<AsError | void>;\n\nexport const useCreateUnitProduct = <\n TError = ErrorType<AsError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createUnitProduct>>,\n TError,\n { unitId: string; data: UnitProductPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof createUnitProduct>>,\n { unitId: string; data: UnitProductPostBodyBody }\n > = (props) => {\n const { unitId, data } = props ?? {};\n\n return createUnitProduct(unitId, data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof createUnitProduct>>,\n TError,\n { unitId: string; data: UnitProductPostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets products you have access to based on an Organisational Unit\n\n * @summary Gets Products for an Organisational Unit\n */\nexport const getProductsForUnit = (\n unitId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProductsGetResponse>(\n { url: `/product/unit/${unitId}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetProductsForUnitQueryKey = (unitId: string) => [\n `/product/unit/${unitId}`,\n];\n\nexport type GetProductsForUnitQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProductsForUnit>>\n>;\nexport type GetProductsForUnitQueryError = ErrorType<void | AsError>;\n\nexport const useGetProductsForUnit = <\n TData = Awaited<ReturnType<typeof getProductsForUnit>>,\n TError = ErrorType<void | AsError>\n>(\n unitId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProductsForUnit>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetProductsForUnitQueryKey(unitId);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getProductsForUnit>>\n > = ({ signal }) => getProductsForUnit(unitId, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getProductsForUnit>>,\n TError,\n TData\n >(queryKey, queryFn, { enabled: !!unitId, ...queryOptions });\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Gets a Unit's Product\n\n * @summary Gets a Unit's Product\n */\nexport const getProduct = (\n unitId: string,\n productId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProductUnitGetResponse>(\n {\n url: `/product/unit/${unitId}/product/${productId}`,\n method: \"get\",\n signal,\n },\n options\n );\n};\n\nexport const getGetProductQueryKey = (unitId: string, productId: string) => [\n `/product/unit/${unitId}/product/${productId}`,\n];\n\nexport type GetProductQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProduct>>\n>;\nexport type GetProductQueryError = ErrorType<AsError | void>;\n\nexport const useGetProduct = <\n TData = Awaited<ReturnType<typeof getProduct>>,\n TError = ErrorType<AsError | void>\n>(\n unitId: string,\n productId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProduct>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetProductQueryKey(unitId, productId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProduct>>> = ({\n signal,\n }) => getProduct(unitId, productId, requestOptions, signal);\n\n const query = useQuery<Awaited<ReturnType<typeof getProduct>>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!(unitId && productId), ...queryOptions }\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * @summary Deletes an existing Product\n */\nexport const deleteProduct = (\n unitId: string,\n productId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/product/unit/${unitId}/product/${productId}`, method: \"delete\" },\n options\n );\n};\n\nexport type DeleteProductMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteProduct>>\n>;\n\nexport type DeleteProductMutationError = ErrorType<AsError>;\n\nexport const useDeleteProduct = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteProduct>>,\n TError,\n { unitId: string; productId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteProduct>>,\n { unitId: string; productId: string }\n > = (props) => {\n const { unitId, productId } = props ?? {};\n\n return deleteProduct(unitId, productId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof deleteProduct>>,\n TError,\n { unitId: string; productId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Used to update some adjustable parameters of a Product, i.e. to extend the Allowance or Limit. At the moment Data Manager products can be patched by changing the `name`, it's coin `allowance` or `limit`\n\n * @summary Adjust an existing Product\n */\nexport const patchProduct = (\n unitId: string,\n productId: string,\n productPatchBodyBody: ProductPatchBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n {\n url: `/product/unit/${unitId}/product/${productId}`,\n method: \"patch\",\n headers: { \"Content-Type\": \"application/json\" },\n data: productPatchBodyBody,\n },\n options\n );\n};\n\nexport type PatchProductMutationResult = NonNullable<\n Awaited<ReturnType<typeof patchProduct>>\n>;\nexport type PatchProductMutationBody = ProductPatchBodyBody;\nexport type PatchProductMutationError = ErrorType<AsError>;\n\nexport const usePatchProduct = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchProduct>>,\n TError,\n { unitId: string; productId: string; data: ProductPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof patchProduct>>,\n { unitId: string; productId: string; data: ProductPatchBodyBody }\n > = (props) => {\n const { unitId, productId, data } = props ?? {};\n\n return patchProduct(unitId, productId, data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof patchProduct>>,\n TError,\n { unitId: string; productId: string; data: ProductPatchBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n"]}
@@ -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 { a9 as customInstance, T as ProductsGetTypesResponse, aa as ErrorType, a5 as AsError, W as ProductsGetResponse, f as UnitProductPostBodyBody, N as UnitProductPostResponse, S as ProductUnitGetResponse, P as ProductPatchBodyBody } from '../custom-instance-6b9df5d3.js';
3
+ import { a9 as customInstance, T as ProductsGetTypesResponse, aa as ErrorType, a5 as AsError, W as ProductsGetResponse, f as UnitProductPostBodyBody, N as UnitProductPostResponse, S as ProductUnitGetResponse, P as ProductPatchBodyBody } from '../custom-instance-b985e1be.js';
4
4
  import 'axios';
5
5
 
6
6
  declare type AwaitedInput<T> = PromiseLike<T> | T;
@@ -52,6 +52,12 @@ declare const useGetProductsForOrganisation: <TData = ProductsGetResponse, TErro
52
52
  queryKey: QueryKey;
53
53
  };
54
54
  /**
55
+ * Products are **Subscriptions** that you create in a Unit and use **Merchant** services like the `DATA_MANAGER`.
56
+
57
+ Typical subscriptions include `DATA_MANAGER_STORAGE_SUBSCRIPTION` and `DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION`.
58
+
59
+ Some subscriptions, like the `DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION` are available i various **flavours** that influence their capabilities. Flavours are typically referred to using the names `BRONZE`, `SILVER` and `GOLD`
60
+
55
61
  * @summary Creates a Product for an Organisational Unit
56
62
  */
57
63
  declare const createUnitProduct: (unitId: string, unitProductPostBodyBody: UnitProductPostBodyBody, options?: SecondParameter<typeof customInstance>) => Promise<UnitProductPostResponse>;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/product/product.ts"],"sourcesContent":["/**\n * Generated by orval v6.8.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Products**, **Organisations**, **Units** and **Users**.\n\n * OpenAPI spec version: 0.1\n */\nimport {\n useQuery,\n useMutation,\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"react-query\";\nimport type {\n ProductsGetTypesResponse,\n AsError,\n ProductsGetResponse,\n UnitProductPostResponse,\n UnitProductPostBodyBody,\n ProductUnitGetResponse,\n ProductPatchBodyBody,\n} from \"../account-server-api.schemas\";\nimport { customInstance, ErrorType } from \".././custom-instance\";\n\nexport type AwaitedInput<T> = PromiseLike<T> | T;\n\nexport type Awaited<O> = O extends AwaitedInput<infer T> ? T : never;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * Gets product types you can purchase\n\n * @summary Gets all Product Types\n */\nexport const getProductTypes = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProductsGetTypesResponse>(\n { url: `/product-type`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetProductTypesQueryKey = () => [`/product-type`];\n\nexport type GetProductTypesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProductTypes>>\n>;\nexport type GetProductTypesQueryError = ErrorType<AsError | void>;\n\nexport const useGetProductTypes = <\n TData = Awaited<ReturnType<typeof getProductTypes>>,\n TError = ErrorType<AsError | void>\n>(options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProductTypes>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProductTypesQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProductTypes>>> = ({\n signal,\n }) => getProductTypes(requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getProductTypes>>,\n TError,\n TData\n >(queryKey, queryFn, queryOptions);\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Gets products you have access to, across all Units and Organisations\n\n * @summary Gets all Products\n */\nexport const getProducts = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProductsGetResponse>(\n { url: `/product`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetProductsQueryKey = () => [`/product`];\n\nexport type GetProductsQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProducts>>\n>;\nexport type GetProductsQueryError = ErrorType<AsError | void>;\n\nexport const useGetProducts = <\n TData = Awaited<ReturnType<typeof getProducts>>,\n TError = ErrorType<AsError | void>\n>(options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProducts>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProductsQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProducts>>> = ({\n signal,\n }) => getProducts(requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getProducts>>,\n TError,\n TData\n >(queryKey, queryFn, queryOptions);\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Gets products you have access to based on an Organisation\n\n * @summary Gets Products for an Organisation\n */\nexport const getProductsForOrganisation = (\n orgId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProductsGetResponse>(\n { url: `/product/organisation/${orgId}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetProductsForOrganisationQueryKey = (orgId: string) => [\n `/product/organisation/${orgId}`,\n];\n\nexport type GetProductsForOrganisationQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProductsForOrganisation>>\n>;\nexport type GetProductsForOrganisationQueryError = ErrorType<void | AsError>;\n\nexport const useGetProductsForOrganisation = <\n TData = Awaited<ReturnType<typeof getProductsForOrganisation>>,\n TError = ErrorType<void | AsError>\n>(\n orgId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProductsForOrganisation>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetProductsForOrganisationQueryKey(orgId);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getProductsForOrganisation>>\n > = ({ signal }) => getProductsForOrganisation(orgId, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getProductsForOrganisation>>,\n TError,\n TData\n >(queryKey, queryFn, { enabled: !!orgId, ...queryOptions });\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * @summary Creates a Product for an Organisational Unit\n */\nexport const createUnitProduct = (\n unitId: string,\n unitProductPostBodyBody: UnitProductPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<UnitProductPostResponse>(\n {\n url: `/product/unit/${unitId}`,\n method: \"post\",\n headers: { \"Content-Type\": \"application/json\" },\n data: unitProductPostBodyBody,\n },\n options\n );\n};\n\nexport type CreateUnitProductMutationResult = NonNullable<\n Awaited<ReturnType<typeof createUnitProduct>>\n>;\nexport type CreateUnitProductMutationBody = UnitProductPostBodyBody;\nexport type CreateUnitProductMutationError = ErrorType<AsError | void>;\n\nexport const useCreateUnitProduct = <\n TError = ErrorType<AsError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createUnitProduct>>,\n TError,\n { unitId: string; data: UnitProductPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof createUnitProduct>>,\n { unitId: string; data: UnitProductPostBodyBody }\n > = (props) => {\n const { unitId, data } = props ?? {};\n\n return createUnitProduct(unitId, data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof createUnitProduct>>,\n TError,\n { unitId: string; data: UnitProductPostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets products you have access to based on an Organisational Unit\n\n * @summary Gets Products for an Organisational Unit\n */\nexport const getProductsForUnit = (\n unitId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProductsGetResponse>(\n { url: `/product/unit/${unitId}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetProductsForUnitQueryKey = (unitId: string) => [\n `/product/unit/${unitId}`,\n];\n\nexport type GetProductsForUnitQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProductsForUnit>>\n>;\nexport type GetProductsForUnitQueryError = ErrorType<void | AsError>;\n\nexport const useGetProductsForUnit = <\n TData = Awaited<ReturnType<typeof getProductsForUnit>>,\n TError = ErrorType<void | AsError>\n>(\n unitId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProductsForUnit>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetProductsForUnitQueryKey(unitId);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getProductsForUnit>>\n > = ({ signal }) => getProductsForUnit(unitId, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getProductsForUnit>>,\n TError,\n TData\n >(queryKey, queryFn, { enabled: !!unitId, ...queryOptions });\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Gets a Unit's Product\n\n * @summary Gets a Unit's Product\n */\nexport const getProduct = (\n unitId: string,\n productId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProductUnitGetResponse>(\n {\n url: `/product/unit/${unitId}/product/${productId}`,\n method: \"get\",\n signal,\n },\n options\n );\n};\n\nexport const getGetProductQueryKey = (unitId: string, productId: string) => [\n `/product/unit/${unitId}/product/${productId}`,\n];\n\nexport type GetProductQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProduct>>\n>;\nexport type GetProductQueryError = ErrorType<AsError | void>;\n\nexport const useGetProduct = <\n TData = Awaited<ReturnType<typeof getProduct>>,\n TError = ErrorType<AsError | void>\n>(\n unitId: string,\n productId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProduct>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetProductQueryKey(unitId, productId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProduct>>> = ({\n signal,\n }) => getProduct(unitId, productId, requestOptions, signal);\n\n const query = useQuery<Awaited<ReturnType<typeof getProduct>>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!(unitId && productId), ...queryOptions }\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * @summary Deletes an existing Product\n */\nexport const deleteProduct = (\n unitId: string,\n productId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/product/unit/${unitId}/product/${productId}`, method: \"delete\" },\n options\n );\n};\n\nexport type DeleteProductMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteProduct>>\n>;\n\nexport type DeleteProductMutationError = ErrorType<AsError>;\n\nexport const useDeleteProduct = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteProduct>>,\n TError,\n { unitId: string; productId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteProduct>>,\n { unitId: string; productId: string }\n > = (props) => {\n const { unitId, productId } = props ?? {};\n\n return deleteProduct(unitId, productId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof deleteProduct>>,\n TError,\n { unitId: string; productId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Used to update some adjustable parameters of a Product, i.e. to extend the Allowance or Limit. At the moment Data Manager products can be patched by changing the `name`, it's coin `allowance` or `limit`\n\n * @summary Adjust an existing Product\n */\nexport const patchProduct = (\n unitId: string,\n productId: string,\n productPatchBodyBody: ProductPatchBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n {\n url: `/product/unit/${unitId}/product/${productId}`,\n method: \"patch\",\n headers: { \"Content-Type\": \"application/json\" },\n data: productPatchBodyBody,\n },\n options\n );\n};\n\nexport type PatchProductMutationResult = NonNullable<\n Awaited<ReturnType<typeof patchProduct>>\n>;\nexport type PatchProductMutationBody = ProductPatchBodyBody;\nexport type PatchProductMutationError = ErrorType<AsError>;\n\nexport const usePatchProduct = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchProduct>>,\n TError,\n { unitId: string; productId: string; data: ProductPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof patchProduct>>,\n { unitId: string; productId: string; data: ProductPatchBodyBody }\n > = (props) => {\n const { unitId, productId, data } = props ?? {};\n\n return patchProduct(unitId, productId, data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof patchProduct>>,\n TError,\n { unitId: string; productId: string; data: ProductPatchBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n"],"mappings":";;;;;;AAUA;AAAA;AAAA;AAAA;AAs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Ac;AAAA,EAC7D;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B;","names":[]}
1
+ {"version":3,"sources":["../../src/product/product.ts"],"sourcesContent":["/**\n * Generated by orval v6.8.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Products**, **Organisations**, **Units** and **Users**.\n\n * OpenAPI spec version: 0.1\n */\nimport {\n useQuery,\n useMutation,\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"react-query\";\nimport type {\n ProductsGetTypesResponse,\n AsError,\n ProductsGetResponse,\n UnitProductPostResponse,\n UnitProductPostBodyBody,\n ProductUnitGetResponse,\n ProductPatchBodyBody,\n} from \"../account-server-api.schemas\";\nimport { customInstance, ErrorType } from \".././custom-instance\";\n\nexport type AwaitedInput<T> = PromiseLike<T> | T;\n\nexport type Awaited<O> = O extends AwaitedInput<infer T> ? T : never;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * Gets product types you can purchase\n\n * @summary Gets all Product Types\n */\nexport const getProductTypes = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProductsGetTypesResponse>(\n { url: `/product-type`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetProductTypesQueryKey = () => [`/product-type`];\n\nexport type GetProductTypesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProductTypes>>\n>;\nexport type GetProductTypesQueryError = ErrorType<AsError | void>;\n\nexport const useGetProductTypes = <\n TData = Awaited<ReturnType<typeof getProductTypes>>,\n TError = ErrorType<AsError | void>\n>(options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProductTypes>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProductTypesQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProductTypes>>> = ({\n signal,\n }) => getProductTypes(requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getProductTypes>>,\n TError,\n TData\n >(queryKey, queryFn, queryOptions);\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Gets products you have access to, across all Units and Organisations\n\n * @summary Gets all Products\n */\nexport const getProducts = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProductsGetResponse>(\n { url: `/product`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetProductsQueryKey = () => [`/product`];\n\nexport type GetProductsQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProducts>>\n>;\nexport type GetProductsQueryError = ErrorType<AsError | void>;\n\nexport const useGetProducts = <\n TData = Awaited<ReturnType<typeof getProducts>>,\n TError = ErrorType<AsError | void>\n>(options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProducts>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProductsQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProducts>>> = ({\n signal,\n }) => getProducts(requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getProducts>>,\n TError,\n TData\n >(queryKey, queryFn, queryOptions);\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Gets products you have access to based on an Organisation\n\n * @summary Gets Products for an Organisation\n */\nexport const getProductsForOrganisation = (\n orgId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProductsGetResponse>(\n { url: `/product/organisation/${orgId}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetProductsForOrganisationQueryKey = (orgId: string) => [\n `/product/organisation/${orgId}`,\n];\n\nexport type GetProductsForOrganisationQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProductsForOrganisation>>\n>;\nexport type GetProductsForOrganisationQueryError = ErrorType<void | AsError>;\n\nexport const useGetProductsForOrganisation = <\n TData = Awaited<ReturnType<typeof getProductsForOrganisation>>,\n TError = ErrorType<void | AsError>\n>(\n orgId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProductsForOrganisation>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetProductsForOrganisationQueryKey(orgId);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getProductsForOrganisation>>\n > = ({ signal }) => getProductsForOrganisation(orgId, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getProductsForOrganisation>>,\n TError,\n TData\n >(queryKey, queryFn, { enabled: !!orgId, ...queryOptions });\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Products are **Subscriptions** that you create in a Unit and use **Merchant** services like the `DATA_MANAGER`.\n\nTypical subscriptions include `DATA_MANAGER_STORAGE_SUBSCRIPTION` and `DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION`.\n\nSome subscriptions, like the `DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION` are available i various **flavours** that influence their capabilities. Flavours are typically referred to using the names `BRONZE`, `SILVER` and `GOLD`\n\n * @summary Creates a Product for an Organisational Unit\n */\nexport const createUnitProduct = (\n unitId: string,\n unitProductPostBodyBody: UnitProductPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<UnitProductPostResponse>(\n {\n url: `/product/unit/${unitId}`,\n method: \"post\",\n headers: { \"Content-Type\": \"application/json\" },\n data: unitProductPostBodyBody,\n },\n options\n );\n};\n\nexport type CreateUnitProductMutationResult = NonNullable<\n Awaited<ReturnType<typeof createUnitProduct>>\n>;\nexport type CreateUnitProductMutationBody = UnitProductPostBodyBody;\nexport type CreateUnitProductMutationError = ErrorType<AsError | void>;\n\nexport const useCreateUnitProduct = <\n TError = ErrorType<AsError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createUnitProduct>>,\n TError,\n { unitId: string; data: UnitProductPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof createUnitProduct>>,\n { unitId: string; data: UnitProductPostBodyBody }\n > = (props) => {\n const { unitId, data } = props ?? {};\n\n return createUnitProduct(unitId, data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof createUnitProduct>>,\n TError,\n { unitId: string; data: UnitProductPostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets products you have access to based on an Organisational Unit\n\n * @summary Gets Products for an Organisational Unit\n */\nexport const getProductsForUnit = (\n unitId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProductsGetResponse>(\n { url: `/product/unit/${unitId}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetProductsForUnitQueryKey = (unitId: string) => [\n `/product/unit/${unitId}`,\n];\n\nexport type GetProductsForUnitQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProductsForUnit>>\n>;\nexport type GetProductsForUnitQueryError = ErrorType<void | AsError>;\n\nexport const useGetProductsForUnit = <\n TData = Awaited<ReturnType<typeof getProductsForUnit>>,\n TError = ErrorType<void | AsError>\n>(\n unitId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProductsForUnit>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetProductsForUnitQueryKey(unitId);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getProductsForUnit>>\n > = ({ signal }) => getProductsForUnit(unitId, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getProductsForUnit>>,\n TError,\n TData\n >(queryKey, queryFn, { enabled: !!unitId, ...queryOptions });\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Gets a Unit's Product\n\n * @summary Gets a Unit's Product\n */\nexport const getProduct = (\n unitId: string,\n productId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProductUnitGetResponse>(\n {\n url: `/product/unit/${unitId}/product/${productId}`,\n method: \"get\",\n signal,\n },\n options\n );\n};\n\nexport const getGetProductQueryKey = (unitId: string, productId: string) => [\n `/product/unit/${unitId}/product/${productId}`,\n];\n\nexport type GetProductQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProduct>>\n>;\nexport type GetProductQueryError = ErrorType<AsError | void>;\n\nexport const useGetProduct = <\n TData = Awaited<ReturnType<typeof getProduct>>,\n TError = ErrorType<AsError | void>\n>(\n unitId: string,\n productId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProduct>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetProductQueryKey(unitId, productId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProduct>>> = ({\n signal,\n }) => getProduct(unitId, productId, requestOptions, signal);\n\n const query = useQuery<Awaited<ReturnType<typeof getProduct>>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!(unitId && productId), ...queryOptions }\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * @summary Deletes an existing Product\n */\nexport const deleteProduct = (\n unitId: string,\n productId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/product/unit/${unitId}/product/${productId}`, method: \"delete\" },\n options\n );\n};\n\nexport type DeleteProductMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteProduct>>\n>;\n\nexport type DeleteProductMutationError = ErrorType<AsError>;\n\nexport const useDeleteProduct = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteProduct>>,\n TError,\n { unitId: string; productId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteProduct>>,\n { unitId: string; productId: string }\n > = (props) => {\n const { unitId, productId } = props ?? {};\n\n return deleteProduct(unitId, productId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof deleteProduct>>,\n TError,\n { unitId: string; productId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Used to update some adjustable parameters of a Product, i.e. to extend the Allowance or Limit. At the moment Data Manager products can be patched by changing the `name`, it's coin `allowance` or `limit`\n\n * @summary Adjust an existing Product\n */\nexport const patchProduct = (\n unitId: string,\n productId: string,\n productPatchBodyBody: ProductPatchBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n {\n url: `/product/unit/${unitId}/product/${productId}`,\n method: \"patch\",\n headers: { \"Content-Type\": \"application/json\" },\n data: productPatchBodyBody,\n },\n options\n );\n};\n\nexport type PatchProductMutationResult = NonNullable<\n Awaited<ReturnType<typeof patchProduct>>\n>;\nexport type PatchProductMutationBody = ProductPatchBodyBody;\nexport type PatchProductMutationError = ErrorType<AsError>;\n\nexport const usePatchProduct = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchProduct>>,\n TError,\n { unitId: string; productId: string; data: ProductPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof patchProduct>>,\n { unitId: string; productId: string; data: ProductPatchBodyBody }\n > = (props) => {\n const { unitId, productId, data } = props ?? {};\n\n return patchProduct(unitId, productId, data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof patchProduct>>,\n TError,\n { unitId: string; productId: string; data: ProductPatchBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n"],"mappings":";;;;;;AAUA;AAAA;AAAA;AAAA;AAsCO,IAAM,kBAAkB,CAC7B,SACA,WACG;AACH,SAAO,eACL,EAAE,KAAK,iBAAiB,QAAQ,OAAO,OAAO,GAC9C,OACF;AACF;AAEO,IAAM,6BAA6B,MAAM,CAAC,eAAe;AAOzD,IAAM,qBAAqB,CAGhC,YAO4D;AAC5D,QAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,CAAC;AAErE,QAAM,WAAW,8CAAc,aAAY,2BAA2B;AAEtE,QAAM,UAAsE,CAAC;AAAA,IAC3E;AAAA,QACI,gBAAgB,gBAAgB,MAAM;AAE5C,QAAM,QAAQ,SAIZ,UAAU,SAAS,YAAY;AAEjC,SAAO;AAAA,IACL;AAAA,KACG;AAEP;AAOO,IAAM,cAAc,CACzB,SACA,WACG;AACH,SAAO,eACL,EAAE,KAAK,YAAY,QAAQ,OAAO,OAAO,GACzC,OACF;AACF;AAEO,IAAM,yBAAyB,MAAM,CAAC,UAAU;AAOhD,IAAM,iBAAiB,CAG5B,YAO4D;AAC5D,QAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,CAAC;AAErE,QAAM,WAAW,8CAAc,aAAY,uBAAuB;AAElE,QAAM,UAAkE,CAAC;AAAA,IACvE;AAAA,QACI,YA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,cAAc;AAAA,EACxD;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B;AAMO,IAAM,eAAe,CAC1B,QACA,WACA,sBACA,YACG;AACH,SAAO,eACL;AAAA,IACE,KAAK,iBAAiB,kBAAkB;AAAA,IACxC,QAAQ;AAAA,IACR,SAAS,EAAE,gBAAgB,mBAAmB;AAAA,IAC9C,MAAM;AAAA,EACR,GACA,OACF;AACF;AAQO,IAAM,kBAAkB,CAG7B,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,QAAQ,WAAW,SAAS,SAAS,CAAC;AAE9C,WAAO,aAAa,QAAQ,WAAW,MAAM,cAAc;AAAA,EAC7D;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B;","names":[]}
@@ -136,6 +136,8 @@ export type AssetPostBodyBody = {
136
136
  scope_id?: string;
137
137
  /** Is this a secret asset? */
138
138
  secret: boolean;
139
+ /** An optional description for the Asset */
140
+ description?: string;
139
141
  };
140
142
 
141
143
  export interface UserDetail {
@@ -375,6 +377,8 @@ export interface AssetDetail {
375
377
  secret: boolean;
376
378
  disabled: boolean;
377
379
  content: string;
380
+ created: string;
381
+ description?: string;
378
382
  merchants: MerchantDetail[];
379
383
  }
380
384
 
@@ -386,14 +390,7 @@ export interface UnitsGetResponse {
386
390
  units: OrganisationUnitsGetResponse[];
387
391
  }
388
392
 
389
- export interface UnitGetResponse {
390
- /** The Unit's unique ID */
391
- id: string;
392
- /** The Unit's name */
393
- name: string;
394
- /** The Unit's oener (username) */
395
- owner_id: string;
396
- }
393
+ export type UnitGetResponse = UnitDetail;
397
394
 
398
395
  export interface UnitProductPostResponse {
399
396
  /** The Products's unique ID */
@@ -123,6 +123,9 @@ export const createAsset = (
123
123
  formData.append("scope_id", assetPostBodyBody.scope_id);
124
124
  }
125
125
  formData.append("secret", assetPostBodyBody.secret.toString());
126
+ if (assetPostBodyBody.description !== undefined) {
127
+ formData.append("description", assetPostBodyBody.description);
128
+ }
126
129
 
127
130
  return customInstance<AssetPostResponse>(
128
131
  {
@@ -208,6 +208,12 @@ export const useGetProductsForOrganisation = <
208
208
  };
209
209
 
210
210
  /**
211
+ * Products are **Subscriptions** that you create in a Unit and use **Merchant** services like the `DATA_MANAGER`.
212
+
213
+ Typical subscriptions include `DATA_MANAGER_STORAGE_SUBSCRIPTION` and `DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION`.
214
+
215
+ Some subscriptions, like the `DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION` are available i various **flavours** that influence their capabilities. Flavours are typically referred to using the names `BRONZE`, `SILVER` and `GOLD`
216
+
211
217
  * @summary Creates a Product for an Organisational Unit
212
218
  */
213
219
  export const createUnitProduct = (
package/state/state.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { UseQueryOptions, QueryKey, UseQueryResult } from 'react-query';
2
- import { a9 as customInstance, a2 as StateGetVersionResponse, aa as ErrorType, a5 as AsError } from '../custom-instance-6b9df5d3.js';
2
+ import { a9 as customInstance, a2 as StateGetVersionResponse, aa as ErrorType, a5 as AsError } from '../custom-instance-b985e1be.js';
3
3
  import 'axios';
4
4
 
5
5
  /**
package/unit/unit.d.ts CHANGED
@@ -1,6 +1,6 @@
1
+ import { a9 as customInstance, Y as OrganisationUnitsGetResponse, aa as ErrorType, a5 as AsError, O as OrganisationUnitPostBodyBody, _ as OrganisationUnitPostResponse, l as UnitDetail, K as UnitsGetResponse, Z as PersonalUnitPutResponse } from '../custom-instance-b985e1be.js';
1
2
  import * as react_query from 'react-query';
2
3
  import { UseQueryOptions, QueryKey, UseQueryResult, UseMutationOptions } from 'react-query';
3
- import { a9 as customInstance, Y as OrganisationUnitsGetResponse, aa as ErrorType, a5 as AsError, O as OrganisationUnitPostBodyBody, _ as OrganisationUnitPostResponse, L as UnitGetResponse, K as UnitsGetResponse, Z as PersonalUnitPutResponse } from '../custom-instance-6b9df5d3.js';
4
4
  import 'axios';
5
5
 
6
6
  declare type AwaitedInput<T> = PromiseLike<T> | T;
@@ -45,12 +45,12 @@ declare const useCreateOrganisationUnit: <TError = ErrorType<void | AsError>, TC
45
45
 
46
46
  * @summary Gets a Unit
47
47
  */
48
- declare const getUnit: (orgId: string, unitId: string, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal | undefined) => Promise<UnitGetResponse>;
48
+ declare const getUnit: (orgId: string, unitId: string, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal | undefined) => Promise<UnitDetail>;
49
49
  declare const getGetUnitQueryKey: (orgId: string, unitId: string) => string[];
50
50
  declare type GetUnitQueryResult = NonNullable<Awaited<ReturnType<typeof getUnit>>>;
51
51
  declare type GetUnitQueryError = ErrorType<void | AsError>;
52
- declare const useGetUnit: <TData = UnitGetResponse, TError = ErrorType<void | AsError>>(orgId: string, unitId: string, options?: {
53
- query?: UseQueryOptions<UnitGetResponse, TError, TData, QueryKey> | undefined;
52
+ declare const useGetUnit: <TData = UnitDetail, TError = ErrorType<void | AsError>>(orgId: string, unitId: string, options?: {
53
+ query?: UseQueryOptions<UnitDetail, TError, TData, QueryKey> | undefined;
54
54
  request?: SecondParameter<typeof customInstance>;
55
55
  } | undefined) => UseQueryResult<TData, TError> & {
56
56
  queryKey: QueryKey;
package/user/user.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 { a9 as customInstance, k as UserAccountDetail, aa as ErrorType, a5 as AsError, a0 as UsersGetResponse } from '../custom-instance-6b9df5d3.js';
3
+ import { a9 as customInstance, k as UserAccountDetail, aa as ErrorType, a5 as AsError, a0 as UsersGetResponse } from '../custom-instance-b985e1be.js';
4
4
  import 'axios';
5
5
 
6
6
  declare type AwaitedInput<T> = PromiseLike<T> | T;