Hierarchy

  • default
    • Sections

Constructors

  • Parameters

    • __namedParameters: EndpointOptions

    Returns Sections

Methods

  • Returns a list of all CMS Sections. See api docs.

    Success response schema: Success schema

    Failure response schema: Error schema

    Example:

    const response = await client.sections.list({
    bearer_token: '7381273269536713689562374856'
    })

    Parameters

    • options: _DeepAnyObjectObject<RequiredAccountToken & IQuery & Record<string, any>>

    Returns Promise<ISectionsResult>

  • Returns a single CMS Section by its ID. See api docs.

    Success response schema: Success schema

    Failure response schema: Error schema

    Example:

    const response = await client.sections.show({
    bearer_token: '7381273269536713689562374856'
    id: '1'
    })

    Parameters

    • options: _DeepAnyObjectObject<RequiredAccountToken & IQuery & {
          id: string;
      }>

    Returns Promise<ISectionResult>

  • Creates a new CMS Section and returns its attributes. See api docs.

    Required token: Bearer token

    Success response schema: Success schema

    Failure response schema: Error schema

    Example:

    const response = await client.sections.create({
    bearer_token: '7381273269536713689562374856',
    cms_page: {
    name: 'string',
    cms_page_id: 'string',
    type: 'Spree::Cms::Sections::HeroImage',
    linked_resource_type: 'Spree::Taxon',
    linked_resource_id: '1',
    fit: 'Screen',
    position: 2,
    gutters: 'No Gutters',
    button_text: 'Click Here',
    title: 'Shop Today'
    }
    })

    Parameters

    • options: _DeepAnyObjectObject<RequiredAccountToken & IQuery & SectionParams>

    Returns Promise<ISectionResult>

  • Update selected CMS Section for the signed in User. See api docs.

    Required token: Bearer token

    Success response schema: Success schema

    Failure response schema: Error schema

    Example:

    const response = await client.sections.update({
    bearer_token: '7381273269536713689562374856',
    id: '1',
    cms_page: {
    name: 'string',
    type: 'Spree::Cms::Sections::ProductCarousel',
    linked_resource_type: 'Spree::Taxon',
    linked_resource_id: '1',
    fit: 'Screen',
    position: 2,
    gutters: 'No Gutters',
    button_text: 'Click Here',
    title: 'Shop Today'
    }
    })

    Parameters

    • options: _DeepAnyObjectObject<RequiredAccountToken & IQuery & SectionParams & {
          id: string;
      }>

    Returns Promise<ISectionResult>

  • This endpoint removes the specified CMS Section for the current user. See api docs.

    Required token: Bearer token

    Success response schema: Success schema

    Failure response schema: Error schema

    Example:

    const response = await client.sections.remove({
    bearer_token: '7381273269536713689562374856',
    id: '1'
    })

    Parameters

    • options: _DeepAnyObjectObject<RequiredAccountToken & Record<string, unknown> & {
          id: string;
      }>

    Returns Promise<NoContentResult>

  • Type Parameters

    • ResponseType = JsonApiResponse

    Parameters

    • method: HttpMethod
    • url: string
    • Optional tokens: IToken
    • Optional params: any
    • Optional responseParsing: ResponseParsing

    Returns Promise<ResultResponse<ResponseType>>

  • The HTTP error code returned by Spree is not indicative of its response shape. This function determines the information provided by Spree and uses everything available.

    Parameters

    • error: default

    Returns ErrorType

  • Parameters

    • error: Error

    Returns default

  • Parameters

    • error: default

    Returns default

  • Parameters

    • tokens: IToken

    Returns {
        [headerName: string]: string;
    }

    • [headerName: string]: string

Properties

fetcher: Fetcher

Generated using TypeDoc