@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.
51 lines (50 loc) • 1.77 kB
TypeScript
import { Http } from '@spree/core-api-v2-sdk';
import type { IQuery } from '@spree/core-api-v2-sdk';
import type { IPageResult, IPagesResult, ListOptions, ShowOptions } from '../interfaces/Page';
export default class Pages extends Http {
/**
* Returns a list of all CMS Pages available in the current store. See [api docs](https://api.spreecommerce.org/docs/api-v2/48dab6913cd0d-list-all-cms-pages).
*
* **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 pages = await client.pages.list()
* ```
*/
list(options?: ListOptions): Promise<IPagesResult>;
/**
* @hidden
* @deprecated Use the combined options signature instead.
*/
list(params?: IQuery): Promise<IPagesResult>;
/**
* Returns a single CMS Page. You can use either a CMS Page slug or ID. See [api docs](https://api.spreecommerce.org/docs/api-v2/cedb218a94c4d-retrieve-a-cms-page).
*
* **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 page = await client.pages.show({
* id: 'about-us'
* })
* ```
*/
show(options: ShowOptions): Promise<IPageResult>;
/**
* @hidden
* @deprecated Use the combined options signature instead.
*/
show(id: string, params?: IQuery): Promise<IPageResult>;
}