Class Resource<S, R>

Type Parameters

Hierarchy

  • Request<S, R>
    • Resource

Constructors

  • Type Parameters

    Parameters

    • chatter: Chatter<S>
    • url: string
    • Optional queryParams: null | {
          [name: string]: string | number | boolean | null;
      }

    Returns Resource<S, R>

Properties

_chatter: Chatter<S>
_promise: undefined | Promise<R>
_url: string
del: (() => Request<S, void>) = ...

Synonym of Resource#destroy()

Type declaration

    • (): Request<S, void>
    • Returns Request<S, void>

delete: (() => Request<S, void>) = ...

Synonym of Resource#destroy()

Type declaration

    • (): Request<S, void>
    • Returns Request<S, void>

Methods

  • Retrieve parameters in batch request form

    Returns {
        method: HttpMethods;
        richInput?: null | string | object;
        url: string;
    }

    • method: HttpMethods
    • Optional richInput?: null | string | object
    • url: string
  • Create a new resource

    Type Parameters

    • R1 = any

    Parameters

    • data: null | string | object

    Returns Request<S, R1>

  • Retrieve parameters in batch request form

    Returns Promise<R>

    Method

    Chatter~Request#promise

  • Returns Node.js Stream object for request

    Returns Duplex

    Method

    Chatter~Request#stream

  • Promise/A+ interface http://promises-aplus.github.io/promises-spec/

    Delegate to deferred promise, return promise instance for batch result

    Type Parameters

    • U

    Parameters

    • Optional onResolve: ((value) => U | PromiseLike<U>)
        • (value): U | PromiseLike<U>
        • Parameters

          • value: R

          Returns U | PromiseLike<U>

    • Optional onReject: ((e) => U | PromiseLike<U>)
        • (e): U | PromiseLike<U>
        • Parameters

          • e: any

          Returns U | PromiseLike<U>

    Returns Promise<U>

  • Update specified resource

    Type Parameters

    • R1 = any

    Parameters

    • data: object

    Returns Request<S, R1>