UNPKG

@spree/storefront-api-v2-sdk

Version:

Node module to easily integrate your JavaScript or TypeScript application with Spree Storefront API V2. You can create an entirely custom Storefront in JS/TS with this package including one page checkout, Single Page Apps, PWAs and so on.

49 lines (48 loc) 1.68 kB
import { Http } from '@spree/core-api-v2-sdk'; import type { IQuery } from '@spree/core-api-v2-sdk'; import type { ITaxonResult, ITaxonsResult, ListOptions, ShowOptions } from '../interfaces/Taxon'; export default class Taxons extends Http { /** * Returns a list of Taxons. See [api docs](https://api.spreecommerce.org/docs/api-v2/b3A6MzE0Mjc2NA-list-all-taxons). * * **Success response schema:** [Success schema](../pages/response-schema.html#success-schema) * * **Failure response schema:** [Error schema](../pages/response-schema.html#error-schema) * * **Example:** * ```ts * const response = await client.taxons.list() * ``` */ list(options?: ListOptions): Promise<ITaxonsResult>; /** * @hidden * @deprecated Use the combined options signature instead. */ list(params?: IQuery): Promise<ITaxonsResult>; /** * Returns a single Taxon. See [api docs](https://api.spreecommerce.org/docs/api-v2/6e26f7594be8b-retrieve-a-taxon). * * **Options schema:** * ```ts * interface options { * id: string * } * ``` * * **Success response schema:** [Success schema](../pages/response-schema.html#success-schema) * * **Failure response schema:** [Error schema](../pages/response-schema.html#error-schema) * * **Example:** * ```ts * const products = await client.taxons.show({ id: '1' }) * ``` */ show(options: ShowOptions): Promise<ITaxonResult>; /** * @hidden * @deprecated Use the combined options signature instead. */ show(id: string, params?: IQuery): Promise<ITaxonResult>; }