@squonk/account-server-client 2.0.6 → 2.0.7
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/admin/admin.cjs +14 -7
- package/admin/admin.cjs.map +1 -1
- package/admin/admin.d.cts +33 -0
- package/admin/admin.d.ts +4 -1
- package/admin/admin.js +14 -7
- package/admin/admin.js.map +1 -1
- package/asset/asset.cjs +44 -19
- package/asset/asset.cjs.map +1 -1
- package/asset/asset.d.cts +241 -0
- package/asset/asset.d.ts +43 -19
- package/asset/asset.js +37 -12
- package/asset/asset.js.map +1 -1
- package/{chunk-UZTHSGDT.cjs → chunk-J22A7LHX.cjs} +1 -1
- package/chunk-J22A7LHX.cjs.map +1 -0
- package/{chunk-3RNIDX7T.js → chunk-UKA7G3OB.js} +1 -1
- package/{chunk-3RNIDX7T.js.map → chunk-UKA7G3OB.js.map} +1 -1
- package/{custom-instance-f32f6506.d.ts → custom-instance-13ade7a9.d.ts} +159 -159
- package/index.cjs +10 -10
- package/index.cjs.map +1 -1
- package/index.d.cts +2 -0
- package/index.d.ts +1 -1
- package/index.js +9 -9
- package/index.js.map +1 -1
- package/merchant/merchant.cjs +23 -13
- package/merchant/merchant.cjs.map +1 -1
- package/merchant/merchant.d.cts +57 -0
- package/merchant/merchant.d.ts +7 -1
- package/merchant/merchant.js +22 -12
- package/merchant/merchant.js.map +1 -1
- package/organisation/organisation.cjs +50 -25
- package/organisation/organisation.cjs.map +1 -1
- package/organisation/organisation.d.cts +203 -0
- package/organisation/organisation.d.ts +31 -10
- package/organisation/organisation.js +44 -19
- package/organisation/organisation.js.map +1 -1
- package/package.json +12 -12
- package/product/product.cjs +80 -44
- package/product/product.cjs.map +1 -1
- package/product/product.d.cts +280 -0
- package/product/product.d.ts +40 -10
- package/product/product.js +71 -35
- package/product/product.js.map +1 -1
- package/src/account-server-api.schemas.ts +268 -276
- package/src/admin/admin.ts +72 -78
- package/src/asset/asset.ts +447 -556
- package/src/merchant/merchant.ts +125 -136
- package/src/organisation/organisation.ts +394 -484
- package/src/product/product.ts +557 -682
- package/src/state/state.ts +70 -69
- package/src/unit/unit.ts +494 -593
- package/src/user/user.ts +377 -463
- package/state/state.cjs +13 -7
- package/state/state.cjs.map +1 -1
- package/state/state.d.cts +29 -0
- package/state/state.d.ts +4 -1
- package/state/state.js +13 -7
- package/state/state.js.map +1 -1
- package/unit/unit.cjs +59 -28
- package/unit/unit.cjs.map +1 -1
- package/unit/unit.d.cts +254 -0
- package/unit/unit.d.ts +43 -16
- package/unit/unit.js +52 -21
- package/unit/unit.js.map +1 -1
- package/user/user.cjs +52 -21
- package/user/user.cjs.map +1 -1
- package/user/user.d.cts +220 -0
- package/user/user.d.ts +31 -10
- package/user/user.js +46 -15
- package/user/user.js.map +1 -1
- package/chunk-UZTHSGDT.cjs.map +0 -1
package/product/product.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/product/product.ts"],"names":[],"mappings":";;;;;AAUA,SAAS,UAAU,mBAAmB;AAqC/B,IAAM,kBAAkB,CAC7B,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,iBAAiB,QAAQ,OAAO,OAAO;AAAA,IAC9C;AAAA,EACF;AACF;AAEO,IAAM,6BAA6B,MAAM,CAAC,sBAAsB,eAAe;AAE/E,IAAM,iCAAiC,CAG5C,YAW4B;AAC5B,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,2BAA2B;AAEtE,QAAM,UAAsE,CAAC;AAAA,IAC3E;AAAA,EACF,MAAM,gBAAgB,gBAAgB,MAAM;AAE5C,SAAO,EAAE,UAAU,SAAS,GAAG,aAAa;AAC9C;AAOO,IAAM,qBAAqB,CAGhC,YAO4D;AAC5D,QAAM,eAAe,+BAA+B,OAAO;AAE3D,QAAM,QAAQ,SAAS,YAAY;AAInC,QAAM,WAAW,aAAa;AAE9B,SAAO;AAC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qBAAqB,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC,CAAE;AAEjF,IAAM,mCAAmC,CAI9C,WACA,QACA,YAY4B;AAC5B,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YACJ,6CAAc,aAAY,6BAA6B,WAAW,MAAM;AAE1E,QAAM,UAEF,CAAC,EAAE,OAAO,MACZ,kBAAkB,WAAW,QAAQ,gBAAgB,MAAM;AAE7D,SAAO,EAAE,UAAU,SAAS,SAAS,CAAC,CAAC,WAAW,GAAG,aAAa;AACpE;AAOO,IAAM,uBAAuB,CAIlC,WACA,QACA,YAQ2D;AAC3D,QAAM,eAAe;AAAA,IACnB;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,QAAM,QAAQ,SAAS,YAAY;AAInC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT","sourcesContent":["/**\n * Generated by orval v6.15.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Organisations**, **Units**, **Products**, **Users**, and **Assets**.\n\n * OpenAPI spec version: 2.0\n */\nimport { useQuery, useMutation } from \"@tanstack/react-query\";\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"@tanstack/react-query\";\nimport type {\n ProductsGetTypesResponse,\n AsError,\n ProductsGetDefaultStorageCost,\n ProductsGetResponse,\n UnitProductPostResponse,\n UnitProductPostBodyBody,\n ProductUnitGetResponse,\n ProductPatchBodyBody,\n ProductChargesGetResponse,\n GetProductChargesParams,\n} from \"../account-server-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * Gets Product Types you can purchase (subscribe to)\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 = () => [\"account-server-api\", `/product-type`] as const;\n\nexport const getGetProductTypesQueryOptions = <\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}): UseQueryOptions<\n Awaited<ReturnType<typeof getProductTypes>>,\n TError,\n TData\n> & { 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 return { queryKey, queryFn, ...queryOptions };\n};\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 queryOptions = getGetProductTypesQueryOptions(options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n\n/**\n * The storage cost is returned along with its measurement units, typically a Coin value based on the the peak storage that was measured on each billable day.\n\n * @summary Gets the default cross-product storage cost\n */\nexport const getProductDefaultStorageCost = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProductsGetDefaultStorageCost>(\n { url: `/product-default-storage-cost`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetProductDefaultStorageCostQueryKey = () =>\n [\"account-server-api\", `/product-default-storage-cost`] as const;\n\nexport const getGetProductDefaultStorageCostQueryOptions = <\n TData = Awaited<ReturnType<typeof getProductDefaultStorageCost>>,\n TError = ErrorType<AsError | void>\n>(options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProductDefaultStorageCost>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryOptions<\n Awaited<ReturnType<typeof getProductDefaultStorageCost>>,\n TError,\n TData\n> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetProductDefaultStorageCostQueryKey();\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getProductDefaultStorageCost>>\n > = ({ signal }) => getProductDefaultStorageCost(requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions };\n};\n\nexport type GetProductDefaultStorageCostQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProductDefaultStorageCost>>\n>;\nexport type GetProductDefaultStorageCostQueryError = ErrorType<AsError | void>;\n\nexport const useGetProductDefaultStorageCost = <\n TData = Awaited<ReturnType<typeof getProductDefaultStorageCost>>,\n TError = ErrorType<AsError | void>\n>(options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProductDefaultStorageCost>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetProductDefaultStorageCostQueryOptions(options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n\n/**\n * Gets 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 = () => [\"account-server-api\", `/product`] as const;\n\nexport const getGetProductsQueryOptions = <\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}): UseQueryOptions<Awaited<ReturnType<typeof getProducts>>, TError, TData> & {\n queryKey: QueryKey;\n} => {\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 return { queryKey, queryFn, ...queryOptions };\n};\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 queryOptions = getGetProductsQueryOptions(options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n\n/**\n * Gets 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 [\"account-server-api\", `/product/organisation/${orgId}`] as const;\n\nexport const getGetProductsForOrganisationQueryOptions = <\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): UseQueryOptions<\n Awaited<ReturnType<typeof getProductsForOrganisation>>,\n TError,\n TData\n> & { 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 return { queryKey, queryFn, enabled: !!orgId, ...queryOptions };\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 queryOptions = getGetProductsForOrganisationQueryOptions(\n orgId,\n options\n );\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n\n/**\n * 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 in various **flavours** that influence their capabilities. Flavours are typically referred to using the names `BRONZE`, `SILVER` and `GOLD`\n\nTo do this you need to be a member of the **Unit** or the **Organisation**.\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 const getCreateUnitProductMutationOptions = <\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}): UseMutationOptions<\n Awaited<ReturnType<typeof createUnitProduct>>,\n TError,\n { unitId: string; data: UnitProductPostBodyBody },\n TContext\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 { mutationFn, ...mutationOptions };\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 mutationOptions = getCreateUnitProductMutationOptions(options);\n\n return useMutation(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 [\"account-server-api\", `/product/unit/${unitId}`] as const;\n\nexport const getGetProductsForUnitQueryOptions = <\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): UseQueryOptions<\n Awaited<ReturnType<typeof getProductsForUnit>>,\n TError,\n TData\n> & { 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 return { queryKey, queryFn, enabled: !!unitId, ...queryOptions };\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 queryOptions = getGetProductsForUnitQueryOptions(unitId, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n\n/**\n * Gets details of a specific Product that you have access to.\n\n * @summary Gets a Product\n */\nexport const getProduct = (\n productId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProductUnitGetResponse>(\n { url: `/product/${productId}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetProductQueryKey = (productId: string) =>\n [\"account-server-api\", `/product/${productId}`] as const;\n\nexport const getGetProductQueryOptions = <\n TData = Awaited<ReturnType<typeof getProduct>>,\n TError = ErrorType<AsError | void>\n>(\n productId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProduct>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<Awaited<ReturnType<typeof getProduct>>, TError, TData> & {\n queryKey: QueryKey;\n} => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProductQueryKey(productId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProduct>>> = ({\n signal,\n }) => getProduct(productId, requestOptions, signal);\n\n return { queryKey, queryFn, enabled: !!productId, ...queryOptions };\n};\n\nexport type GetProductQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProduct>>\n>;\nexport type GetProductQueryError = ErrorType<AsError | void>;\n\nexport const useGetProduct = <\n TData = Awaited<ReturnType<typeof getProduct>>,\n TError = ErrorType<AsError | void>\n>(\n productId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProduct>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetProductQueryOptions(productId, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n\n/**\n * You need access to the Product and, if the Product is *claimable* the claim must be removed before the Product can be removed. An example claimable Product is a `DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION` where the *claimable* commodity is a Data Manager **Project**. In this case you will need to delete the Data Manager **Project** before you can delete the Account Server **Product**.\n\n * @summary Deletes an existing Product\n */\nexport const deleteProduct = (\n productId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/product/${productId}`, method: \"delete\" },\n options\n );\n};\n\nexport const getDeleteProductMutationOptions = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteProduct>>,\n TError,\n { productId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof deleteProduct>>,\n TError,\n { productId: string },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteProduct>>,\n { productId: string }\n > = (props) => {\n const { productId } = props ?? {};\n\n return deleteProduct(productId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DeleteProductMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteProduct>>\n>;\n\nexport type DeleteProductMutationError = ErrorType<AsError>;\n\nexport const useDeleteProduct = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteProduct>>,\n TError,\n { productId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getDeleteProductMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Used to update some adjustable parameters of a Product, i.e. to extend its **Allowance** or **Limit**.\n\nAt the moment we only support Products associated with the Data Manager, and these can be patched by changing the `name`, its coin `allowance` or `limit`\n\n * @summary Adjust an existing Product\n */\nexport const patchProduct = (\n productId: string,\n productPatchBodyBody: ProductPatchBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n {\n url: `/product/${productId}`,\n method: \"patch\",\n headers: { \"Content-Type\": \"application/json\" },\n data: productPatchBodyBody,\n },\n options\n );\n};\n\nexport const getPatchProductMutationOptions = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchProduct>>,\n TError,\n { productId: string; data: ProductPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof patchProduct>>,\n TError,\n { productId: string; data: ProductPatchBodyBody },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof patchProduct>>,\n { productId: string; data: ProductPatchBodyBody }\n > = (props) => {\n const { productId, data } = props ?? {};\n\n return patchProduct(productId, data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type PatchProductMutationResult = NonNullable<\n Awaited<ReturnType<typeof patchProduct>>\n>;\nexport type PatchProductMutationBody = ProductPatchBodyBody;\nexport type PatchProductMutationError = ErrorType<AsError>;\n\nexport const usePatchProduct = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchProduct>>,\n TError,\n { productId: string; data: ProductPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getPatchProductMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Get the charges made against a Product with optional **from** (inclusive) and **until** (exclusive) dates. If no dates are provided, the charges for the current billing period are returned.\n\nDates are interpreted using the Python `dateutil` parser, so the input strings are extremely flexible with, for example, `1 December 2021` as an acceptable input.\n\n**From** must be a date (day) prior to **until**. For example, to see the charges for the 11th July 2022 set **from** to `11 July 2022` and **until** to `12 July 2022`. As an alternative to **From** and **Until** you can provide a **Prior Billing Period**, a value that identifies the prior period to retrieve. A value of `-1` would indicate the *prior period* (month) with an oldest retrieval value of `-23` allowing you to obtain charges for up to two years.\n\nYou need to be part of the **Unit** or **Organisation** to use this method\n * @summary Get charges made against a Product\n */\nexport const getProductCharges = (\n productId: string,\n params?: GetProductChargesParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProductChargesGetResponse>(\n { url: `/product/${productId}/charges`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetProductChargesQueryKey = (\n productId: string,\n params?: GetProductChargesParams\n) => [\"account-server-api\", `/product/${productId}/charges`, ...(params ? [params] : [])] as const;\n\nexport const getGetProductChargesQueryOptions = <\n TData = Awaited<ReturnType<typeof getProductCharges>>,\n TError = ErrorType<AsError | void>\n>(\n productId: string,\n params?: GetProductChargesParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProductCharges>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<\n Awaited<ReturnType<typeof getProductCharges>>,\n TError,\n TData\n> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetProductChargesQueryKey(productId, params);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getProductCharges>>\n > = ({ signal }) =>\n getProductCharges(productId, params, requestOptions, signal);\n\n return { queryKey, queryFn, enabled: !!productId, ...queryOptions };\n};\n\nexport type GetProductChargesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProductCharges>>\n>;\nexport type GetProductChargesQueryError = ErrorType<AsError | void>;\n\nexport const useGetProductCharges = <\n TData = Awaited<ReturnType<typeof getProductCharges>>,\n TError = ErrorType<AsError | void>\n>(\n productId: string,\n params?: GetProductChargesParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProductCharges>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetProductChargesQueryOptions(\n productId,\n params,\n options\n );\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/product/product.ts"],"names":[],"mappings":";;;;;AAUA;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAuCA,IAAM,kBAAkB,CAE9B,SAAiD,WAC7C;AAGC,SAAO;AAAA,IACP;AAAA,MAAC,KAAK;AAAA,MAAiB,QAAQ;AAAA,MAAO;AAAA,IACxC;AAAA,IACE;AAAA,EAAO;AACT;AAGG,IAAM,6BAA6B,MAAM;AAE5C,SAAO,CAAC,sBAAsB,eAAe;AAC7C;AAGG,IAAM,iCAAiC,CAA2F,YACpI;AAEL,QAAM,EAAC,OAAO,cAAc,SAAS,eAAc,IAAI,WAAW,CAAC;AAEjE,QAAM,YAAY,6CAAc,aAAY,2BAA2B;AAIrE,QAAM,UAAsE,CAAC,EAAE,OAAO,MAAM,gBAAgB,gBAAgB,MAAM;AAMnI,SAAQ,EAAE,UAAU,SAAS,GAAG,aAAY;AAC/C;AAQO,IAAM,qBAAqB,CAChC,YAE8D;AAE9D,QAAM,eAAe,+BAA+B,OAAO;AAE3D,QAAM,QAAQ,SAAS,YAAY;AAEnC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;AASO,IAAM,+BAA+B,CAE3C,SAAiD,WAC7C;AAGC,SAAO;AAAA,IACP;AAAA,MAAC,KAAK;AAAA,MAAiC,QAAQ;AAAA,MAAO;AAAA,IACxD;AAAA,IACE;AAAA,EAAO;AACT;AAGG,IAAM,0CAA0C,MAAM;AAEzD,SAAO,CAAC,sBAAsB,+BAA+B;AAC7D;AAGG,IAAM,8CAA8C,CAAwG,YAC9J;AAEL,QAAM,EAAC,OAAO,cAAc,SAAS,eAAc,IAAI,WAAW,CAAC;AAEjE,QAAM,YAAY,6C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,CAAC,WACzC,WAAsC;AAEtC,SAAO,CAAC,sBAAsB,YAAY,SAAS,YAAY,GAAI,SAAS,CAAC,MAAM,IAAG,CAAC,CAAE;AACzF;AAGG,IAAM,mCAAmC,CAA4F,WACxI,QAAkC,YACjC;AAEL,QAAM,EAAC,OAAO,cAAc,SAAS,eAAc,IAAI,WAAW,CAAC;AAEjE,QAAM,YAAY,6CAAc,aAAY,6BAA6B,WAAU,MAAM;AAIvF,QAAM,UAAwE,CAAC,EAAE,OAAO,MAAM,kBAAkB,WAAU,QAAQ,gBAAgB,MAAM;AAMzJ,SAAQ,EAAE,UAAU,SAAS,SAAS,CAAC,CAAE,WAAY,GAAG,aAAY;AACvE;AAQO,IAAM,uBAAuB,CACnC,WACG,QAAkC,YAE0B;AAE9D,QAAM,eAAe,iCAAiC,WAAU,QAAO,OAAO;AAE9E,QAAM,QAAQ,SAAS,YAAY;AAEnC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT","sourcesContent":["/**\n * Generated by orval v6.20.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Organisations**, **Units**, **Products**, **Users**, and **Assets**.\n\n * OpenAPI spec version: 2.0\n */\nimport {\n useMutation,\n useQuery\n} from '@tanstack/react-query'\nimport type {\n MutationFunction,\n QueryFunction,\n QueryKey,\n UseMutationOptions,\n UseQueryOptions,\n UseQueryResult\n} from '@tanstack/react-query'\nimport type {\n AsError,\n GetProductChargesParams,\n ProductChargesGetResponse,\n ProductPatchBodyBody,\n ProductUnitGetResponse,\n ProductsGetDefaultStorageCost,\n ProductsGetResponse,\n ProductsGetTypesResponse,\n UnitProductPostBodyBody,\n UnitProductPostResponse\n} from '../account-server-api.schemas'\nimport { customInstance } from '.././custom-instance';\nimport type { ErrorType } from '.././custom-instance';\n\n\n// eslint-disable-next-line\n type SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P,\n) => any\n ? P\n : never;\n\n\n/**\n * Gets Product Types you can purchase (subscribe to)\n\n * @summary Gets all Product Types\n */\nexport const getProductTypes = (\n \n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<ProductsGetTypesResponse>(\n {url: `/product-type`, method: 'get', signal\n },\n options);\n }\n \n\nexport const getGetProductTypesQueryKey = () => {\n \n return [\"account-server-api\", `/product-type`] as const;\n }\n\n \nexport const getGetProductTypesQueryOptions = <TData = Awaited<ReturnType<typeof getProductTypes>>, TError = ErrorType<AsError | void>>( options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getProductTypes>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProductTypesQueryKey();\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProductTypes>>> = ({ signal }) => getProductTypes(requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getProductTypes>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetProductTypesQueryResult = NonNullable<Awaited<ReturnType<typeof getProductTypes>>>\nexport type GetProductTypesQueryError = ErrorType<AsError | void>\n\n/**\n * @summary Gets all Product Types\n */\nexport const useGetProductTypes = <TData = Awaited<ReturnType<typeof getProductTypes>>, TError = ErrorType<AsError | void>>(\n options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getProductTypes>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetProductTypesQueryOptions(options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * The storage cost is returned along with its measurement units, typically a Coin value based on the the peak storage that was measured on each billable day.\n\n * @summary Gets the default cross-product storage cost\n */\nexport const getProductDefaultStorageCost = (\n \n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<ProductsGetDefaultStorageCost>(\n {url: `/product-default-storage-cost`, method: 'get', signal\n },\n options);\n }\n \n\nexport const getGetProductDefaultStorageCostQueryKey = () => {\n \n return [\"account-server-api\", `/product-default-storage-cost`] as const;\n }\n\n \nexport const getGetProductDefaultStorageCostQueryOptions = <TData = Awaited<ReturnType<typeof getProductDefaultStorageCost>>, TError = ErrorType<AsError | void>>( options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getProductDefaultStorageCost>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProductDefaultStorageCostQueryKey();\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProductDefaultStorageCost>>> = ({ signal }) => getProductDefaultStorageCost(requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getProductDefaultStorageCost>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetProductDefaultStorageCostQueryResult = NonNullable<Awaited<ReturnType<typeof getProductDefaultStorageCost>>>\nexport type GetProductDefaultStorageCostQueryError = ErrorType<AsError | void>\n\n/**\n * @summary Gets the default cross-product storage cost\n */\nexport const useGetProductDefaultStorageCost = <TData = Awaited<ReturnType<typeof getProductDefaultStorageCost>>, TError = ErrorType<AsError | void>>(\n options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getProductDefaultStorageCost>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetProductDefaultStorageCostQueryOptions(options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * Gets Products you have access to, across all **Units** and **Organisations**\n\n * @summary Gets all Products\n */\nexport const getProducts = (\n \n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<ProductsGetResponse>(\n {url: `/product`, method: 'get', signal\n },\n options);\n }\n \n\nexport const getGetProductsQueryKey = () => {\n \n return [\"account-server-api\", `/product`] as const;\n }\n\n \nexport const getGetProductsQueryOptions = <TData = Awaited<ReturnType<typeof getProducts>>, TError = ErrorType<AsError | void>>( options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getProducts>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProductsQueryKey();\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProducts>>> = ({ signal }) => getProducts(requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getProducts>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetProductsQueryResult = NonNullable<Awaited<ReturnType<typeof getProducts>>>\nexport type GetProductsQueryError = ErrorType<AsError | void>\n\n/**\n * @summary Gets all Products\n */\nexport const useGetProducts = <TData = Awaited<ReturnType<typeof getProducts>>, TError = ErrorType<AsError | void>>(\n options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getProducts>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetProductsQueryOptions(options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\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>,signal?: AbortSignal\n) => {\n \n \n return customInstance<ProductsGetResponse>(\n {url: `/product/organisation/${orgId}`, method: 'get', signal\n },\n options);\n }\n \n\nexport const getGetProductsForOrganisationQueryKey = (orgId: string,) => {\n \n return [\"account-server-api\", `/product/organisation/${orgId}`] as const;\n }\n\n \nexport const getGetProductsForOrganisationQueryOptions = <TData = Awaited<ReturnType<typeof getProductsForOrganisation>>, TError = ErrorType<void | AsError>>(orgId: string, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getProductsForOrganisation>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProductsForOrganisationQueryKey(orgId);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProductsForOrganisation>>> = ({ signal }) => getProductsForOrganisation(orgId, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(orgId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getProductsForOrganisation>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetProductsForOrganisationQueryResult = NonNullable<Awaited<ReturnType<typeof getProductsForOrganisation>>>\nexport type GetProductsForOrganisationQueryError = ErrorType<void | AsError>\n\n/**\n * @summary Gets Products for an Organisation\n */\nexport const useGetProductsForOrganisation = <TData = Awaited<ReturnType<typeof getProductsForOrganisation>>, TError = ErrorType<void | AsError>>(\n orgId: string, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getProductsForOrganisation>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetProductsForOrganisationQueryOptions(orgId,options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\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 in various **flavours** that influence their capabilities. Flavours are typically referred to using the names `BRONZE`, `SILVER` and `GOLD`\n\nTo do this you need to be a member of the **Unit** or the **Organisation**.\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 \n return customInstance<UnitProductPostResponse>(\n {url: `/product/unit/${unitId}`, method: 'post',\n headers: {'Content-Type': 'application/json', },\n data: unitProductPostBodyBody\n },\n options);\n }\n \n\n\nexport const getCreateUnitProductMutationOptions = <TError = ErrorType<AsError | void>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createUnitProduct>>, TError,{unitId: string;data: UnitProductPostBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof createUnitProduct>>, TError,{unitId: string;data: UnitProductPostBodyBody}, TContext> => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof createUnitProduct>>, {unitId: string;data: UnitProductPostBodyBody}> = (props) => {\n const {unitId,data} = props ?? {};\n\n return createUnitProduct(unitId,data,requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type CreateUnitProductMutationResult = NonNullable<Awaited<ReturnType<typeof createUnitProduct>>>\n export type CreateUnitProductMutationBody = UnitProductPostBodyBody\n export type CreateUnitProductMutationError = ErrorType<AsError | void>\n\n /**\n * @summary Creates a Product for an Organisational Unit\n */\nexport const useCreateUnitProduct = <TError = ErrorType<AsError | void>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createUnitProduct>>, TError,{unitId: string;data: UnitProductPostBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n\n const mutationOptions = getCreateUnitProductMutationOptions(options);\n\n return useMutation(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>,signal?: AbortSignal\n) => {\n \n \n return customInstance<ProductsGetResponse>(\n {url: `/product/unit/${unitId}`, method: 'get', signal\n },\n options);\n }\n \n\nexport const getGetProductsForUnitQueryKey = (unitId: string,) => {\n \n return [\"account-server-api\", `/product/unit/${unitId}`] as const;\n }\n\n \nexport const getGetProductsForUnitQueryOptions = <TData = Awaited<ReturnType<typeof getProductsForUnit>>, TError = ErrorType<void | AsError>>(unitId: string, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getProductsForUnit>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProductsForUnitQueryKey(unitId);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProductsForUnit>>> = ({ signal }) => getProductsForUnit(unitId, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(unitId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getProductsForUnit>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetProductsForUnitQueryResult = NonNullable<Awaited<ReturnType<typeof getProductsForUnit>>>\nexport type GetProductsForUnitQueryError = ErrorType<void | AsError>\n\n/**\n * @summary Gets Products for an Organisational Unit\n */\nexport const useGetProductsForUnit = <TData = Awaited<ReturnType<typeof getProductsForUnit>>, TError = ErrorType<void | AsError>>(\n unitId: string, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getProductsForUnit>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetProductsForUnitQueryOptions(unitId,options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * Gets details of a specific Product that you have access to.\n\n * @summary Gets a Product\n */\nexport const getProduct = (\n productId: string,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<ProductUnitGetResponse>(\n {url: `/product/${productId}`, method: 'get', signal\n },\n options);\n }\n \n\nexport const getGetProductQueryKey = (productId: string,) => {\n \n return [\"account-server-api\", `/product/${productId}`] as const;\n }\n\n \nexport const getGetProductQueryOptions = <TData = Awaited<ReturnType<typeof getProduct>>, TError = ErrorType<AsError | void>>(productId: string, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getProduct>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProductQueryKey(productId);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProduct>>> = ({ signal }) => getProduct(productId, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(productId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getProduct>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetProductQueryResult = NonNullable<Awaited<ReturnType<typeof getProduct>>>\nexport type GetProductQueryError = ErrorType<AsError | void>\n\n/**\n * @summary Gets a Product\n */\nexport const useGetProduct = <TData = Awaited<ReturnType<typeof getProduct>>, TError = ErrorType<AsError | void>>(\n productId: string, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getProduct>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetProductQueryOptions(productId,options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * You need access to the Product and, if the Product is *claimable* the claim must be removed before the Product can be removed. An example claimable Product is a `DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION` where the *claimable* commodity is a Data Manager **Project**. In this case you will need to delete the Data Manager **Project** before you can delete the Account Server **Product**.\n\n * @summary Deletes an existing Product\n */\nexport const deleteProduct = (\n productId: string,\n options?: SecondParameter<typeof customInstance>,) => {\n \n \n return customInstance<void>(\n {url: `/product/${productId}`, method: 'delete'\n },\n options);\n }\n \n\n\nexport const getDeleteProductMutationOptions = <TError = ErrorType<AsError>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteProduct>>, TError,{productId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof deleteProduct>>, TError,{productId: string}, TContext> => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteProduct>>, {productId: string}> = (props) => {\n const {productId} = props ?? {};\n\n return deleteProduct(productId,requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type DeleteProductMutationResult = NonNullable<Awaited<ReturnType<typeof deleteProduct>>>\n \n export type DeleteProductMutationError = ErrorType<AsError>\n\n /**\n * @summary Deletes an existing Product\n */\nexport const useDeleteProduct = <TError = ErrorType<AsError>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteProduct>>, TError,{productId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n\n const mutationOptions = getDeleteProductMutationOptions(options);\n\n return useMutation(mutationOptions);\n }\n /**\n * Used to update some adjustable parameters of a Product, i.e. to extend its **Allowance** or **Limit**.\n\nAt the moment we only support Products associated with the Data Manager, and these can be patched by changing the `name`, its coin `allowance` or `limit`\n\n * @summary Adjust an existing Product\n */\nexport const patchProduct = (\n productId: string,\n productPatchBodyBody: ProductPatchBodyBody,\n options?: SecondParameter<typeof customInstance>,) => {\n \n \n return customInstance<void>(\n {url: `/product/${productId}`, method: 'patch',\n headers: {'Content-Type': 'application/json', },\n data: productPatchBodyBody\n },\n options);\n }\n \n\n\nexport const getPatchProductMutationOptions = <TError = ErrorType<AsError>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof patchProduct>>, TError,{productId: string;data: ProductPatchBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof patchProduct>>, TError,{productId: string;data: ProductPatchBodyBody}, TContext> => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof patchProduct>>, {productId: string;data: ProductPatchBodyBody}> = (props) => {\n const {productId,data} = props ?? {};\n\n return patchProduct(productId,data,requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type PatchProductMutationResult = NonNullable<Awaited<ReturnType<typeof patchProduct>>>\n export type PatchProductMutationBody = ProductPatchBodyBody\n export type PatchProductMutationError = ErrorType<AsError>\n\n /**\n * @summary Adjust an existing Product\n */\nexport const usePatchProduct = <TError = ErrorType<AsError>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof patchProduct>>, TError,{productId: string;data: ProductPatchBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n\n const mutationOptions = getPatchProductMutationOptions(options);\n\n return useMutation(mutationOptions);\n }\n /**\n * Get the charges made against a Product with optional **from** (inclusive) and **until** (exclusive) dates. If no dates are provided, the charges for the current billing period are returned.\n\nDates are interpreted using the Python `dateutil` parser, so the input strings are extremely flexible with, for example, `1 December 2021` as an acceptable input.\n\n**From** must be a date (day) prior to **until**. For example, to see the charges for the 11th July 2022 set **from** to `11 July 2022` and **until** to `12 July 2022`. As an alternative to **From** and **Until** you can provide a **Prior Billing Period**, a value that identifies the prior period to retrieve. A value of `-1` would indicate the *prior period* (month) with an oldest retrieval value of `-23` allowing you to obtain charges for up to two years.\n\nYou need to be part of the **Unit** or **Organisation** to use this method\n * @summary Get charges made against a Product\n */\nexport const getProductCharges = (\n productId: string,\n params?: GetProductChargesParams,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<ProductChargesGetResponse>(\n {url: `/product/${productId}/charges`, method: 'get',\n params, signal\n },\n options);\n }\n \n\nexport const getGetProductChargesQueryKey = (productId: string,\n params?: GetProductChargesParams,) => {\n \n return [\"account-server-api\", `/product/${productId}/charges`, ...(params ? [params]: [])] as const;\n }\n\n \nexport const getGetProductChargesQueryOptions = <TData = Awaited<ReturnType<typeof getProductCharges>>, TError = ErrorType<AsError | void>>(productId: string,\n params?: GetProductChargesParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProductChargesQueryKey(productId,params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProductCharges>>> = ({ signal }) => getProductCharges(productId,params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(productId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetProductChargesQueryResult = NonNullable<Awaited<ReturnType<typeof getProductCharges>>>\nexport type GetProductChargesQueryError = ErrorType<AsError | void>\n\n/**\n * @summary Get charges made against a Product\n */\nexport const useGetProductCharges = <TData = Awaited<ReturnType<typeof getProductCharges>>, TError = ErrorType<AsError | void>>(\n productId: string,\n params?: GetProductChargesParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetProductChargesQueryOptions(productId,params,options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n"]}
|
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
2
|
+
import { UseQueryOptions, QueryKey, UseQueryResult, UseMutationOptions } from '@tanstack/react-query';
|
|
3
|
+
import { aE as customInstance, ae as ProductsGetTypesResponse, aF as ErrorType, aA as AsError, ag as ProductsGetDefaultStorageCost, ai as ProductsGetResponse, m as UnitProductPostBodyBody, a6 as UnitProductPostResponse, ad as ProductUnitGetResponse, P as ProductPatchBodyBody, b as GetProductChargesParams, ak as ProductChargesGetResponse } from '../custom-instance-13ade7a9.js';
|
|
4
|
+
import 'axios';
|
|
5
|
+
|
|
6
|
+
type SecondParameter<T extends (...args: any) => any> = T extends (config: any, args: infer P) => any ? P : never;
|
|
7
|
+
/**
|
|
8
|
+
* Gets Product Types you can purchase (subscribe to)
|
|
9
|
+
|
|
10
|
+
* @summary Gets all Product Types
|
|
11
|
+
*/
|
|
12
|
+
declare const getProductTypes: (options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<ProductsGetTypesResponse>;
|
|
13
|
+
declare const getGetProductTypesQueryKey: () => readonly ["account-server-api", "/product-type"];
|
|
14
|
+
declare const getGetProductTypesQueryOptions: <TData = ProductsGetTypesResponse, TError = ErrorType<void | AsError>>(options?: {
|
|
15
|
+
query?: UseQueryOptions<ProductsGetTypesResponse, TError, TData, QueryKey> | undefined;
|
|
16
|
+
request?: SecondParameter<typeof customInstance>;
|
|
17
|
+
} | undefined) => UseQueryOptions<ProductsGetTypesResponse, TError, TData, QueryKey> & {
|
|
18
|
+
queryKey: QueryKey;
|
|
19
|
+
};
|
|
20
|
+
type GetProductTypesQueryResult = NonNullable<Awaited<ReturnType<typeof getProductTypes>>>;
|
|
21
|
+
type GetProductTypesQueryError = ErrorType<AsError | void>;
|
|
22
|
+
/**
|
|
23
|
+
* @summary Gets all Product Types
|
|
24
|
+
*/
|
|
25
|
+
declare const useGetProductTypes: <TData = ProductsGetTypesResponse, TError = ErrorType<void | AsError>>(options?: {
|
|
26
|
+
query?: UseQueryOptions<ProductsGetTypesResponse, TError, TData, QueryKey> | undefined;
|
|
27
|
+
request?: SecondParameter<typeof customInstance>;
|
|
28
|
+
} | undefined) => UseQueryResult<TData, TError> & {
|
|
29
|
+
queryKey: QueryKey;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* The storage cost is returned along with its measurement units, typically a Coin value based on the the peak storage that was measured on each billable day.
|
|
33
|
+
|
|
34
|
+
* @summary Gets the default cross-product storage cost
|
|
35
|
+
*/
|
|
36
|
+
declare const getProductDefaultStorageCost: (options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<ProductsGetDefaultStorageCost>;
|
|
37
|
+
declare const getGetProductDefaultStorageCostQueryKey: () => readonly ["account-server-api", "/product-default-storage-cost"];
|
|
38
|
+
declare const getGetProductDefaultStorageCostQueryOptions: <TData = ProductsGetDefaultStorageCost, TError = ErrorType<void | AsError>>(options?: {
|
|
39
|
+
query?: UseQueryOptions<ProductsGetDefaultStorageCost, TError, TData, QueryKey> | undefined;
|
|
40
|
+
request?: SecondParameter<typeof customInstance>;
|
|
41
|
+
} | undefined) => UseQueryOptions<ProductsGetDefaultStorageCost, TError, TData, QueryKey> & {
|
|
42
|
+
queryKey: QueryKey;
|
|
43
|
+
};
|
|
44
|
+
type GetProductDefaultStorageCostQueryResult = NonNullable<Awaited<ReturnType<typeof getProductDefaultStorageCost>>>;
|
|
45
|
+
type GetProductDefaultStorageCostQueryError = ErrorType<AsError | void>;
|
|
46
|
+
/**
|
|
47
|
+
* @summary Gets the default cross-product storage cost
|
|
48
|
+
*/
|
|
49
|
+
declare const useGetProductDefaultStorageCost: <TData = ProductsGetDefaultStorageCost, TError = ErrorType<void | AsError>>(options?: {
|
|
50
|
+
query?: UseQueryOptions<ProductsGetDefaultStorageCost, TError, TData, QueryKey> | undefined;
|
|
51
|
+
request?: SecondParameter<typeof customInstance>;
|
|
52
|
+
} | undefined) => UseQueryResult<TData, TError> & {
|
|
53
|
+
queryKey: QueryKey;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Gets Products you have access to, across all **Units** and **Organisations**
|
|
57
|
+
|
|
58
|
+
* @summary Gets all Products
|
|
59
|
+
*/
|
|
60
|
+
declare const getProducts: (options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<ProductsGetResponse>;
|
|
61
|
+
declare const getGetProductsQueryKey: () => readonly ["account-server-api", "/product"];
|
|
62
|
+
declare const getGetProductsQueryOptions: <TData = ProductsGetResponse, TError = ErrorType<void | AsError>>(options?: {
|
|
63
|
+
query?: UseQueryOptions<ProductsGetResponse, TError, TData, QueryKey> | undefined;
|
|
64
|
+
request?: SecondParameter<typeof customInstance>;
|
|
65
|
+
} | undefined) => UseQueryOptions<ProductsGetResponse, TError, TData, QueryKey> & {
|
|
66
|
+
queryKey: QueryKey;
|
|
67
|
+
};
|
|
68
|
+
type GetProductsQueryResult = NonNullable<Awaited<ReturnType<typeof getProducts>>>;
|
|
69
|
+
type GetProductsQueryError = ErrorType<AsError | void>;
|
|
70
|
+
/**
|
|
71
|
+
* @summary Gets all Products
|
|
72
|
+
*/
|
|
73
|
+
declare const useGetProducts: <TData = ProductsGetResponse, TError = ErrorType<void | AsError>>(options?: {
|
|
74
|
+
query?: UseQueryOptions<ProductsGetResponse, TError, TData, QueryKey> | undefined;
|
|
75
|
+
request?: SecondParameter<typeof customInstance>;
|
|
76
|
+
} | undefined) => UseQueryResult<TData, TError> & {
|
|
77
|
+
queryKey: QueryKey;
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* Gets Products you have access to based on an **Organisation**
|
|
81
|
+
|
|
82
|
+
* @summary Gets Products for an Organisation
|
|
83
|
+
*/
|
|
84
|
+
declare const getProductsForOrganisation: (orgId: string, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<ProductsGetResponse>;
|
|
85
|
+
declare const getGetProductsForOrganisationQueryKey: (orgId: string) => readonly ["account-server-api", `/product/organisation/${string}`];
|
|
86
|
+
declare const getGetProductsForOrganisationQueryOptions: <TData = ProductsGetResponse, TError = ErrorType<void | AsError>>(orgId: string, options?: {
|
|
87
|
+
query?: UseQueryOptions<ProductsGetResponse, TError, TData, QueryKey> | undefined;
|
|
88
|
+
request?: SecondParameter<typeof customInstance>;
|
|
89
|
+
} | undefined) => UseQueryOptions<ProductsGetResponse, TError, TData, QueryKey> & {
|
|
90
|
+
queryKey: QueryKey;
|
|
91
|
+
};
|
|
92
|
+
type GetProductsForOrganisationQueryResult = NonNullable<Awaited<ReturnType<typeof getProductsForOrganisation>>>;
|
|
93
|
+
type GetProductsForOrganisationQueryError = ErrorType<void | AsError>;
|
|
94
|
+
/**
|
|
95
|
+
* @summary Gets Products for an Organisation
|
|
96
|
+
*/
|
|
97
|
+
declare const useGetProductsForOrganisation: <TData = ProductsGetResponse, TError = ErrorType<void | AsError>>(orgId: string, options?: {
|
|
98
|
+
query?: UseQueryOptions<ProductsGetResponse, TError, TData, QueryKey> | undefined;
|
|
99
|
+
request?: SecondParameter<typeof customInstance>;
|
|
100
|
+
} | undefined) => UseQueryResult<TData, TError> & {
|
|
101
|
+
queryKey: QueryKey;
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* Products are **Subscriptions** that you create in a Unit and use **Merchant** services like the `DATA_MANAGER`.
|
|
105
|
+
|
|
106
|
+
Typical subscriptions include `DATA_MANAGER_STORAGE_SUBSCRIPTION` and `DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION`.
|
|
107
|
+
|
|
108
|
+
Some subscriptions, like the `DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION` are available in various **flavours** that influence their capabilities. Flavours are typically referred to using the names `BRONZE`, `SILVER` and `GOLD`
|
|
109
|
+
|
|
110
|
+
To do this you need to be a member of the **Unit** or the **Organisation**.
|
|
111
|
+
|
|
112
|
+
* @summary Creates a Product for an Organisational Unit
|
|
113
|
+
*/
|
|
114
|
+
declare const createUnitProduct: (unitId: string, unitProductPostBodyBody: UnitProductPostBodyBody, options?: SecondParameter<typeof customInstance>) => Promise<UnitProductPostResponse>;
|
|
115
|
+
declare const getCreateUnitProductMutationOptions: <TError = ErrorType<void | AsError>, TContext = unknown>(options?: {
|
|
116
|
+
mutation?: UseMutationOptions<UnitProductPostResponse, TError, {
|
|
117
|
+
unitId: string;
|
|
118
|
+
data: UnitProductPostBodyBody;
|
|
119
|
+
}, TContext> | undefined;
|
|
120
|
+
request?: SecondParameter<typeof customInstance>;
|
|
121
|
+
} | undefined) => UseMutationOptions<UnitProductPostResponse, TError, {
|
|
122
|
+
unitId: string;
|
|
123
|
+
data: UnitProductPostBodyBody;
|
|
124
|
+
}, TContext>;
|
|
125
|
+
type CreateUnitProductMutationResult = NonNullable<Awaited<ReturnType<typeof createUnitProduct>>>;
|
|
126
|
+
type CreateUnitProductMutationBody = UnitProductPostBodyBody;
|
|
127
|
+
type CreateUnitProductMutationError = ErrorType<AsError | void>;
|
|
128
|
+
/**
|
|
129
|
+
* @summary Creates a Product for an Organisational Unit
|
|
130
|
+
*/
|
|
131
|
+
declare const useCreateUnitProduct: <TError = ErrorType<void | AsError>, TContext = unknown>(options?: {
|
|
132
|
+
mutation?: UseMutationOptions<UnitProductPostResponse, TError, {
|
|
133
|
+
unitId: string;
|
|
134
|
+
data: UnitProductPostBodyBody;
|
|
135
|
+
}, TContext> | undefined;
|
|
136
|
+
request?: SecondParameter<typeof customInstance>;
|
|
137
|
+
} | undefined) => _tanstack_react_query.UseMutationResult<UnitProductPostResponse, TError, {
|
|
138
|
+
unitId: string;
|
|
139
|
+
data: UnitProductPostBodyBody;
|
|
140
|
+
}, TContext>;
|
|
141
|
+
/**
|
|
142
|
+
* Gets products you have access to based on an Organisational **Unit**
|
|
143
|
+
|
|
144
|
+
* @summary Gets Products for an Organisational Unit
|
|
145
|
+
*/
|
|
146
|
+
declare const getProductsForUnit: (unitId: string, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<ProductsGetResponse>;
|
|
147
|
+
declare const getGetProductsForUnitQueryKey: (unitId: string) => readonly ["account-server-api", `/product/unit/${string}`];
|
|
148
|
+
declare const getGetProductsForUnitQueryOptions: <TData = ProductsGetResponse, TError = ErrorType<void | AsError>>(unitId: string, options?: {
|
|
149
|
+
query?: UseQueryOptions<ProductsGetResponse, TError, TData, QueryKey> | undefined;
|
|
150
|
+
request?: SecondParameter<typeof customInstance>;
|
|
151
|
+
} | undefined) => UseQueryOptions<ProductsGetResponse, TError, TData, QueryKey> & {
|
|
152
|
+
queryKey: QueryKey;
|
|
153
|
+
};
|
|
154
|
+
type GetProductsForUnitQueryResult = NonNullable<Awaited<ReturnType<typeof getProductsForUnit>>>;
|
|
155
|
+
type GetProductsForUnitQueryError = ErrorType<void | AsError>;
|
|
156
|
+
/**
|
|
157
|
+
* @summary Gets Products for an Organisational Unit
|
|
158
|
+
*/
|
|
159
|
+
declare const useGetProductsForUnit: <TData = ProductsGetResponse, TError = ErrorType<void | AsError>>(unitId: string, options?: {
|
|
160
|
+
query?: UseQueryOptions<ProductsGetResponse, TError, TData, QueryKey> | undefined;
|
|
161
|
+
request?: SecondParameter<typeof customInstance>;
|
|
162
|
+
} | undefined) => UseQueryResult<TData, TError> & {
|
|
163
|
+
queryKey: QueryKey;
|
|
164
|
+
};
|
|
165
|
+
/**
|
|
166
|
+
* Gets details of a specific Product that you have access to.
|
|
167
|
+
|
|
168
|
+
* @summary Gets a Product
|
|
169
|
+
*/
|
|
170
|
+
declare const getProduct: (productId: string, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<ProductUnitGetResponse>;
|
|
171
|
+
declare const getGetProductQueryKey: (productId: string) => readonly ["account-server-api", `/product/${string}`];
|
|
172
|
+
declare const getGetProductQueryOptions: <TData = ProductUnitGetResponse, TError = ErrorType<void | AsError>>(productId: string, options?: {
|
|
173
|
+
query?: UseQueryOptions<ProductUnitGetResponse, TError, TData, QueryKey> | undefined;
|
|
174
|
+
request?: SecondParameter<typeof customInstance>;
|
|
175
|
+
} | undefined) => UseQueryOptions<ProductUnitGetResponse, TError, TData, QueryKey> & {
|
|
176
|
+
queryKey: QueryKey;
|
|
177
|
+
};
|
|
178
|
+
type GetProductQueryResult = NonNullable<Awaited<ReturnType<typeof getProduct>>>;
|
|
179
|
+
type GetProductQueryError = ErrorType<AsError | void>;
|
|
180
|
+
/**
|
|
181
|
+
* @summary Gets a Product
|
|
182
|
+
*/
|
|
183
|
+
declare const useGetProduct: <TData = ProductUnitGetResponse, TError = ErrorType<void | AsError>>(productId: string, options?: {
|
|
184
|
+
query?: UseQueryOptions<ProductUnitGetResponse, TError, TData, QueryKey> | undefined;
|
|
185
|
+
request?: SecondParameter<typeof customInstance>;
|
|
186
|
+
} | undefined) => UseQueryResult<TData, TError> & {
|
|
187
|
+
queryKey: QueryKey;
|
|
188
|
+
};
|
|
189
|
+
/**
|
|
190
|
+
* You need access to the Product and, if the Product is *claimable* the claim must be removed before the Product can be removed. An example claimable Product is a `DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION` where the *claimable* commodity is a Data Manager **Project**. In this case you will need to delete the Data Manager **Project** before you can delete the Account Server **Product**.
|
|
191
|
+
|
|
192
|
+
* @summary Deletes an existing Product
|
|
193
|
+
*/
|
|
194
|
+
declare const deleteProduct: (productId: string, options?: SecondParameter<typeof customInstance>) => Promise<void>;
|
|
195
|
+
declare const getDeleteProductMutationOptions: <TError = ErrorType<AsError>, TContext = unknown>(options?: {
|
|
196
|
+
mutation?: UseMutationOptions<void, TError, {
|
|
197
|
+
productId: string;
|
|
198
|
+
}, TContext> | undefined;
|
|
199
|
+
request?: SecondParameter<typeof customInstance>;
|
|
200
|
+
} | undefined) => UseMutationOptions<void, TError, {
|
|
201
|
+
productId: string;
|
|
202
|
+
}, TContext>;
|
|
203
|
+
type DeleteProductMutationResult = NonNullable<Awaited<ReturnType<typeof deleteProduct>>>;
|
|
204
|
+
type DeleteProductMutationError = ErrorType<AsError>;
|
|
205
|
+
/**
|
|
206
|
+
* @summary Deletes an existing Product
|
|
207
|
+
*/
|
|
208
|
+
declare const useDeleteProduct: <TError = ErrorType<AsError>, TContext = unknown>(options?: {
|
|
209
|
+
mutation?: UseMutationOptions<void, TError, {
|
|
210
|
+
productId: string;
|
|
211
|
+
}, TContext> | undefined;
|
|
212
|
+
request?: SecondParameter<typeof customInstance>;
|
|
213
|
+
} | undefined) => _tanstack_react_query.UseMutationResult<void, TError, {
|
|
214
|
+
productId: string;
|
|
215
|
+
}, TContext>;
|
|
216
|
+
/**
|
|
217
|
+
* Used to update some adjustable parameters of a Product, i.e. to extend its **Allowance** or **Limit**.
|
|
218
|
+
|
|
219
|
+
At the moment we only support Products associated with the Data Manager, and these can be patched by changing the `name`, its coin `allowance` or `limit`
|
|
220
|
+
|
|
221
|
+
* @summary Adjust an existing Product
|
|
222
|
+
*/
|
|
223
|
+
declare const patchProduct: (productId: string, productPatchBodyBody: ProductPatchBodyBody, options?: SecondParameter<typeof customInstance>) => Promise<void>;
|
|
224
|
+
declare const getPatchProductMutationOptions: <TError = ErrorType<AsError>, TContext = unknown>(options?: {
|
|
225
|
+
mutation?: UseMutationOptions<void, TError, {
|
|
226
|
+
productId: string;
|
|
227
|
+
data: ProductPatchBodyBody;
|
|
228
|
+
}, TContext> | undefined;
|
|
229
|
+
request?: SecondParameter<typeof customInstance>;
|
|
230
|
+
} | undefined) => UseMutationOptions<void, TError, {
|
|
231
|
+
productId: string;
|
|
232
|
+
data: ProductPatchBodyBody;
|
|
233
|
+
}, TContext>;
|
|
234
|
+
type PatchProductMutationResult = NonNullable<Awaited<ReturnType<typeof patchProduct>>>;
|
|
235
|
+
type PatchProductMutationBody = ProductPatchBodyBody;
|
|
236
|
+
type PatchProductMutationError = ErrorType<AsError>;
|
|
237
|
+
/**
|
|
238
|
+
* @summary Adjust an existing Product
|
|
239
|
+
*/
|
|
240
|
+
declare const usePatchProduct: <TError = ErrorType<AsError>, TContext = unknown>(options?: {
|
|
241
|
+
mutation?: UseMutationOptions<void, TError, {
|
|
242
|
+
productId: string;
|
|
243
|
+
data: ProductPatchBodyBody;
|
|
244
|
+
}, TContext> | undefined;
|
|
245
|
+
request?: SecondParameter<typeof customInstance>;
|
|
246
|
+
} | undefined) => _tanstack_react_query.UseMutationResult<void, TError, {
|
|
247
|
+
productId: string;
|
|
248
|
+
data: ProductPatchBodyBody;
|
|
249
|
+
}, TContext>;
|
|
250
|
+
/**
|
|
251
|
+
* Get the charges made against a Product with optional **from** (inclusive) and **until** (exclusive) dates. If no dates are provided, the charges for the current billing period are returned.
|
|
252
|
+
|
|
253
|
+
Dates are interpreted using the Python `dateutil` parser, so the input strings are extremely flexible with, for example, `1 December 2021` as an acceptable input.
|
|
254
|
+
|
|
255
|
+
**From** must be a date (day) prior to **until**. For example, to see the charges for the 11th July 2022 set **from** to `11 July 2022` and **until** to `12 July 2022`. As an alternative to **From** and **Until** you can provide a **Prior Billing Period**, a value that identifies the prior period to retrieve. A value of `-1` would indicate the *prior period* (month) with an oldest retrieval value of `-23` allowing you to obtain charges for up to two years.
|
|
256
|
+
|
|
257
|
+
You need to be part of the **Unit** or **Organisation** to use this method
|
|
258
|
+
* @summary Get charges made against a Product
|
|
259
|
+
*/
|
|
260
|
+
declare const getProductCharges: (productId: string, params?: GetProductChargesParams, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<ProductChargesGetResponse>;
|
|
261
|
+
declare const getGetProductChargesQueryKey: (productId: string, params?: GetProductChargesParams) => readonly ["account-server-api", `/product/${string}/charges`, ...GetProductChargesParams[]];
|
|
262
|
+
declare const getGetProductChargesQueryOptions: <TData = ProductChargesGetResponse, TError = ErrorType<void | AsError>>(productId: string, params?: GetProductChargesParams, options?: {
|
|
263
|
+
query?: UseQueryOptions<ProductChargesGetResponse, TError, TData, QueryKey> | undefined;
|
|
264
|
+
request?: SecondParameter<typeof customInstance>;
|
|
265
|
+
} | undefined) => UseQueryOptions<ProductChargesGetResponse, TError, TData, QueryKey> & {
|
|
266
|
+
queryKey: QueryKey;
|
|
267
|
+
};
|
|
268
|
+
type GetProductChargesQueryResult = NonNullable<Awaited<ReturnType<typeof getProductCharges>>>;
|
|
269
|
+
type GetProductChargesQueryError = ErrorType<AsError | void>;
|
|
270
|
+
/**
|
|
271
|
+
* @summary Get charges made against a Product
|
|
272
|
+
*/
|
|
273
|
+
declare const useGetProductCharges: <TData = ProductChargesGetResponse, TError = ErrorType<void | AsError>>(productId: string, params?: GetProductChargesParams, options?: {
|
|
274
|
+
query?: UseQueryOptions<ProductChargesGetResponse, TError, TData, QueryKey> | undefined;
|
|
275
|
+
request?: SecondParameter<typeof customInstance>;
|
|
276
|
+
} | undefined) => UseQueryResult<TData, TError> & {
|
|
277
|
+
queryKey: QueryKey;
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
export { CreateUnitProductMutationBody, CreateUnitProductMutationError, CreateUnitProductMutationResult, DeleteProductMutationError, DeleteProductMutationResult, GetProductChargesQueryError, GetProductChargesQueryResult, GetProductDefaultStorageCostQueryError, GetProductDefaultStorageCostQueryResult, GetProductQueryError, GetProductQueryResult, GetProductTypesQueryError, GetProductTypesQueryResult, GetProductsForOrganisationQueryError, GetProductsForOrganisationQueryResult, GetProductsForUnitQueryError, GetProductsForUnitQueryResult, GetProductsQueryError, GetProductsQueryResult, PatchProductMutationBody, PatchProductMutationError, PatchProductMutationResult, createUnitProduct, deleteProduct, getCreateUnitProductMutationOptions, getDeleteProductMutationOptions, getGetProductChargesQueryKey, getGetProductChargesQueryOptions, getGetProductDefaultStorageCostQueryKey, getGetProductDefaultStorageCostQueryOptions, getGetProductQueryKey, getGetProductQueryOptions, getGetProductTypesQueryKey, getGetProductTypesQueryOptions, getGetProductsForOrganisationQueryKey, getGetProductsForOrganisationQueryOptions, getGetProductsForUnitQueryKey, getGetProductsForUnitQueryOptions, getGetProductsQueryKey, getGetProductsQueryOptions, getPatchProductMutationOptions, getProduct, getProductCharges, getProductDefaultStorageCost, getProductTypes, getProducts, getProductsForOrganisation, getProductsForUnit, patchProduct, useCreateUnitProduct, useDeleteProduct, useGetProduct, useGetProductCharges, useGetProductDefaultStorageCost, useGetProductTypes, useGetProducts, useGetProductsForOrganisation, useGetProductsForUnit, usePatchProduct };
|
package/product/product.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
2
2
|
import { UseQueryOptions, QueryKey, UseQueryResult, UseMutationOptions } from '@tanstack/react-query';
|
|
3
|
-
import { aE as customInstance, ae as ProductsGetTypesResponse, aF as ErrorType, aA as AsError, ag as ProductsGetDefaultStorageCost, ai as ProductsGetResponse, m as UnitProductPostBodyBody, a6 as UnitProductPostResponse, ad as ProductUnitGetResponse, P as ProductPatchBodyBody, b as GetProductChargesParams, ak as ProductChargesGetResponse } from '../custom-instance-
|
|
3
|
+
import { aE as customInstance, ae as ProductsGetTypesResponse, aF as ErrorType, aA as AsError, ag as ProductsGetDefaultStorageCost, ai as ProductsGetResponse, m as UnitProductPostBodyBody, a6 as UnitProductPostResponse, ad as ProductUnitGetResponse, P as ProductPatchBodyBody, b as GetProductChargesParams, ak as ProductChargesGetResponse } from '../custom-instance-13ade7a9.js';
|
|
4
4
|
import 'axios';
|
|
5
5
|
|
|
6
6
|
type SecondParameter<T extends (...args: any) => any> = T extends (config: any, args: infer P) => any ? P : never;
|
|
@@ -19,6 +19,9 @@ declare const getGetProductTypesQueryOptions: <TData = ProductsGetTypesResponse,
|
|
|
19
19
|
};
|
|
20
20
|
type GetProductTypesQueryResult = NonNullable<Awaited<ReturnType<typeof getProductTypes>>>;
|
|
21
21
|
type GetProductTypesQueryError = ErrorType<AsError | void>;
|
|
22
|
+
/**
|
|
23
|
+
* @summary Gets all Product Types
|
|
24
|
+
*/
|
|
22
25
|
declare const useGetProductTypes: <TData = ProductsGetTypesResponse, TError = ErrorType<void | AsError>>(options?: {
|
|
23
26
|
query?: UseQueryOptions<ProductsGetTypesResponse, TError, TData, QueryKey> | undefined;
|
|
24
27
|
request?: SecondParameter<typeof customInstance>;
|
|
@@ -40,6 +43,9 @@ declare const getGetProductDefaultStorageCostQueryOptions: <TData = ProductsGetD
|
|
|
40
43
|
};
|
|
41
44
|
type GetProductDefaultStorageCostQueryResult = NonNullable<Awaited<ReturnType<typeof getProductDefaultStorageCost>>>;
|
|
42
45
|
type GetProductDefaultStorageCostQueryError = ErrorType<AsError | void>;
|
|
46
|
+
/**
|
|
47
|
+
* @summary Gets the default cross-product storage cost
|
|
48
|
+
*/
|
|
43
49
|
declare const useGetProductDefaultStorageCost: <TData = ProductsGetDefaultStorageCost, TError = ErrorType<void | AsError>>(options?: {
|
|
44
50
|
query?: UseQueryOptions<ProductsGetDefaultStorageCost, TError, TData, QueryKey> | undefined;
|
|
45
51
|
request?: SecondParameter<typeof customInstance>;
|
|
@@ -61,6 +67,9 @@ declare const getGetProductsQueryOptions: <TData = ProductsGetResponse, TError =
|
|
|
61
67
|
};
|
|
62
68
|
type GetProductsQueryResult = NonNullable<Awaited<ReturnType<typeof getProducts>>>;
|
|
63
69
|
type GetProductsQueryError = ErrorType<AsError | void>;
|
|
70
|
+
/**
|
|
71
|
+
* @summary Gets all Products
|
|
72
|
+
*/
|
|
64
73
|
declare const useGetProducts: <TData = ProductsGetResponse, TError = ErrorType<void | AsError>>(options?: {
|
|
65
74
|
query?: UseQueryOptions<ProductsGetResponse, TError, TData, QueryKey> | undefined;
|
|
66
75
|
request?: SecondParameter<typeof customInstance>;
|
|
@@ -82,6 +91,9 @@ declare const getGetProductsForOrganisationQueryOptions: <TData = ProductsGetRes
|
|
|
82
91
|
};
|
|
83
92
|
type GetProductsForOrganisationQueryResult = NonNullable<Awaited<ReturnType<typeof getProductsForOrganisation>>>;
|
|
84
93
|
type GetProductsForOrganisationQueryError = ErrorType<void | AsError>;
|
|
94
|
+
/**
|
|
95
|
+
* @summary Gets Products for an Organisation
|
|
96
|
+
*/
|
|
85
97
|
declare const useGetProductsForOrganisation: <TData = ProductsGetResponse, TError = ErrorType<void | AsError>>(orgId: string, options?: {
|
|
86
98
|
query?: UseQueryOptions<ProductsGetResponse, TError, TData, QueryKey> | undefined;
|
|
87
99
|
request?: SecondParameter<typeof customInstance>;
|
|
@@ -113,6 +125,9 @@ declare const getCreateUnitProductMutationOptions: <TError = ErrorType<void | As
|
|
|
113
125
|
type CreateUnitProductMutationResult = NonNullable<Awaited<ReturnType<typeof createUnitProduct>>>;
|
|
114
126
|
type CreateUnitProductMutationBody = UnitProductPostBodyBody;
|
|
115
127
|
type CreateUnitProductMutationError = ErrorType<AsError | void>;
|
|
128
|
+
/**
|
|
129
|
+
* @summary Creates a Product for an Organisational Unit
|
|
130
|
+
*/
|
|
116
131
|
declare const useCreateUnitProduct: <TError = ErrorType<void | AsError>, TContext = unknown>(options?: {
|
|
117
132
|
mutation?: UseMutationOptions<UnitProductPostResponse, TError, {
|
|
118
133
|
unitId: string;
|
|
@@ -124,10 +139,10 @@ declare const useCreateUnitProduct: <TError = ErrorType<void | AsError>, TContex
|
|
|
124
139
|
data: UnitProductPostBodyBody;
|
|
125
140
|
}, TContext>;
|
|
126
141
|
/**
|
|
127
|
-
|
|
142
|
+
* Gets products you have access to based on an Organisational **Unit**
|
|
128
143
|
|
|
129
|
-
|
|
130
|
-
|
|
144
|
+
* @summary Gets Products for an Organisational Unit
|
|
145
|
+
*/
|
|
131
146
|
declare const getProductsForUnit: (unitId: string, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<ProductsGetResponse>;
|
|
132
147
|
declare const getGetProductsForUnitQueryKey: (unitId: string) => readonly ["account-server-api", `/product/unit/${string}`];
|
|
133
148
|
declare const getGetProductsForUnitQueryOptions: <TData = ProductsGetResponse, TError = ErrorType<void | AsError>>(unitId: string, options?: {
|
|
@@ -138,6 +153,9 @@ declare const getGetProductsForUnitQueryOptions: <TData = ProductsGetResponse, T
|
|
|
138
153
|
};
|
|
139
154
|
type GetProductsForUnitQueryResult = NonNullable<Awaited<ReturnType<typeof getProductsForUnit>>>;
|
|
140
155
|
type GetProductsForUnitQueryError = ErrorType<void | AsError>;
|
|
156
|
+
/**
|
|
157
|
+
* @summary Gets Products for an Organisational Unit
|
|
158
|
+
*/
|
|
141
159
|
declare const useGetProductsForUnit: <TData = ProductsGetResponse, TError = ErrorType<void | AsError>>(unitId: string, options?: {
|
|
142
160
|
query?: UseQueryOptions<ProductsGetResponse, TError, TData, QueryKey> | undefined;
|
|
143
161
|
request?: SecondParameter<typeof customInstance>;
|
|
@@ -159,6 +177,9 @@ declare const getGetProductQueryOptions: <TData = ProductUnitGetResponse, TError
|
|
|
159
177
|
};
|
|
160
178
|
type GetProductQueryResult = NonNullable<Awaited<ReturnType<typeof getProduct>>>;
|
|
161
179
|
type GetProductQueryError = ErrorType<AsError | void>;
|
|
180
|
+
/**
|
|
181
|
+
* @summary Gets a Product
|
|
182
|
+
*/
|
|
162
183
|
declare const useGetProduct: <TData = ProductUnitGetResponse, TError = ErrorType<void | AsError>>(productId: string, options?: {
|
|
163
184
|
query?: UseQueryOptions<ProductUnitGetResponse, TError, TData, QueryKey> | undefined;
|
|
164
185
|
request?: SecondParameter<typeof customInstance>;
|
|
@@ -181,6 +202,9 @@ declare const getDeleteProductMutationOptions: <TError = ErrorType<AsError>, TCo
|
|
|
181
202
|
}, TContext>;
|
|
182
203
|
type DeleteProductMutationResult = NonNullable<Awaited<ReturnType<typeof deleteProduct>>>;
|
|
183
204
|
type DeleteProductMutationError = ErrorType<AsError>;
|
|
205
|
+
/**
|
|
206
|
+
* @summary Deletes an existing Product
|
|
207
|
+
*/
|
|
184
208
|
declare const useDeleteProduct: <TError = ErrorType<AsError>, TContext = unknown>(options?: {
|
|
185
209
|
mutation?: UseMutationOptions<void, TError, {
|
|
186
210
|
productId: string;
|
|
@@ -190,12 +214,12 @@ declare const useDeleteProduct: <TError = ErrorType<AsError>, TContext = unknown
|
|
|
190
214
|
productId: string;
|
|
191
215
|
}, TContext>;
|
|
192
216
|
/**
|
|
193
|
-
|
|
217
|
+
* Used to update some adjustable parameters of a Product, i.e. to extend its **Allowance** or **Limit**.
|
|
194
218
|
|
|
195
219
|
At the moment we only support Products associated with the Data Manager, and these can be patched by changing the `name`, its coin `allowance` or `limit`
|
|
196
220
|
|
|
197
|
-
|
|
198
|
-
|
|
221
|
+
* @summary Adjust an existing Product
|
|
222
|
+
*/
|
|
199
223
|
declare const patchProduct: (productId: string, productPatchBodyBody: ProductPatchBodyBody, options?: SecondParameter<typeof customInstance>) => Promise<void>;
|
|
200
224
|
declare const getPatchProductMutationOptions: <TError = ErrorType<AsError>, TContext = unknown>(options?: {
|
|
201
225
|
mutation?: UseMutationOptions<void, TError, {
|
|
@@ -210,6 +234,9 @@ declare const getPatchProductMutationOptions: <TError = ErrorType<AsError>, TCon
|
|
|
210
234
|
type PatchProductMutationResult = NonNullable<Awaited<ReturnType<typeof patchProduct>>>;
|
|
211
235
|
type PatchProductMutationBody = ProductPatchBodyBody;
|
|
212
236
|
type PatchProductMutationError = ErrorType<AsError>;
|
|
237
|
+
/**
|
|
238
|
+
* @summary Adjust an existing Product
|
|
239
|
+
*/
|
|
213
240
|
declare const usePatchProduct: <TError = ErrorType<AsError>, TContext = unknown>(options?: {
|
|
214
241
|
mutation?: UseMutationOptions<void, TError, {
|
|
215
242
|
productId: string;
|
|
@@ -221,15 +248,15 @@ declare const usePatchProduct: <TError = ErrorType<AsError>, TContext = unknown>
|
|
|
221
248
|
data: ProductPatchBodyBody;
|
|
222
249
|
}, TContext>;
|
|
223
250
|
/**
|
|
224
|
-
|
|
251
|
+
* Get the charges made against a Product with optional **from** (inclusive) and **until** (exclusive) dates. If no dates are provided, the charges for the current billing period are returned.
|
|
225
252
|
|
|
226
253
|
Dates are interpreted using the Python `dateutil` parser, so the input strings are extremely flexible with, for example, `1 December 2021` as an acceptable input.
|
|
227
254
|
|
|
228
255
|
**From** must be a date (day) prior to **until**. For example, to see the charges for the 11th July 2022 set **from** to `11 July 2022` and **until** to `12 July 2022`. As an alternative to **From** and **Until** you can provide a **Prior Billing Period**, a value that identifies the prior period to retrieve. A value of `-1` would indicate the *prior period* (month) with an oldest retrieval value of `-23` allowing you to obtain charges for up to two years.
|
|
229
256
|
|
|
230
257
|
You need to be part of the **Unit** or **Organisation** to use this method
|
|
231
|
-
|
|
232
|
-
|
|
258
|
+
* @summary Get charges made against a Product
|
|
259
|
+
*/
|
|
233
260
|
declare const getProductCharges: (productId: string, params?: GetProductChargesParams, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<ProductChargesGetResponse>;
|
|
234
261
|
declare const getGetProductChargesQueryKey: (productId: string, params?: GetProductChargesParams) => readonly ["account-server-api", `/product/${string}/charges`, ...GetProductChargesParams[]];
|
|
235
262
|
declare const getGetProductChargesQueryOptions: <TData = ProductChargesGetResponse, TError = ErrorType<void | AsError>>(productId: string, params?: GetProductChargesParams, options?: {
|
|
@@ -240,6 +267,9 @@ declare const getGetProductChargesQueryOptions: <TData = ProductChargesGetRespon
|
|
|
240
267
|
};
|
|
241
268
|
type GetProductChargesQueryResult = NonNullable<Awaited<ReturnType<typeof getProductCharges>>>;
|
|
242
269
|
type GetProductChargesQueryError = ErrorType<AsError | void>;
|
|
270
|
+
/**
|
|
271
|
+
* @summary Get charges made against a Product
|
|
272
|
+
*/
|
|
243
273
|
declare const useGetProductCharges: <TData = ProductChargesGetResponse, TError = ErrorType<void | AsError>>(productId: string, params?: GetProductChargesParams, options?: {
|
|
244
274
|
query?: UseQueryOptions<ProductChargesGetResponse, TError, TData, QueryKey> | undefined;
|
|
245
275
|
request?: SecondParameter<typeof customInstance>;
|