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.

66 lines (65 loc) 1.96 kB
import { Http } from '@spree/core-api-v2-sdk'; import type { IQuery } from '@spree/core-api-v2-sdk'; import type { MenuResult, MenusList, MenusResult, ListOptions, ShowOptions } from '../interfaces/Menu'; export default class Menus extends Http { /** * Returns a list of Menus. See [api docs](https://api.spreecommerce.org/docs/api-v2/1021e86f10cee-list-all-menus). * * **Options schema:** * ```ts * interface options { * locale?: string * filter?: { * location?: 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 response = await client.menus.list({ * locale: 'fr', * filter: { * location: 'header' * } * }) * ``` */ list(options?: ListOptions): Promise<MenusResult>; /** * @hidden * @deprecated Use the combined options signature instead. */ list(params?: MenusList): Promise<MenusResult>; /** * Returns a single Menu. See [api docs](https://api.spreecommerce.org/docs/api-v2/b67d067a42bc5-retrieve-a-menu). * * **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 response = await client.menus.show({ * id: '2' * }) * ``` */ show(options: ShowOptions): Promise<MenuResult>; /** * @hidden * @deprecated Use the combined options signature instead. */ show(id: string, params?: IQuery): Promise<MenuResult>; }