Class StandardClient

Default API Client implementation that respects JSON API specification.

You can override the methods in order to handle specific models, when Model configuration is not enough.

Elseway, you can use this Client implementation in order to write a custom implementation, i.e. to integrate into a GraphQL App or a local storage method.

todo

Complete definitions

Hierarchy

  • StandardClient

Implements

Index

Constructors

constructor

Properties

baseUrl

baseUrl: string

paging

transformer

transformer: ApiTransformer

Methods

addToRelation

  • addToRelation(relation: Relation, sourceId: number, targetId: number): (Anonymous function)

create

  • create(model: Model, values: any): (Anonymous function)

createRelated

  • createRelated(relation: Relation, sourceId: number, values: any): (Anonymous function)
  • While waiting for real implementation (as compliant for JSON API spec) on the backend side, we are using a temporary solution requiring two API calls.

    todo

    This is far from ideal, so we should adhere to the standard as soon as possible.

    Parameters

    • relation: Relation
    • sourceId: number
    • values: any

    Returns (Anonymous function)

delete

  • delete(model: Model, id: number): (Anonymous function)

deleteRelated

  • deleteRelated(relation: Relation, sourceId: number, targetId: number): function

endpointUrl

  • endpointUrl(model: Model): string

fetchRequest

  • Version of fetchRequest integrated with transformRequest method, in order to serialize the request body (if provided) and deserialize the response, trasforming returned data into ModelRecord elements.

    Parameters

    Returns (Anonymous function)

find

loadAll

loadAllRelated

  • loadAllRelated(relation: Relation, sourceId: number): (Anonymous function)

onDeleteSuccess

onSaveSuccess

relatedUrl

  • relatedUrl(relation: Relation, id: number): string

relationshipUrl

  • relationshipUrl(relation: Relation, id: number): string

removeFromRelation

  • removeFromRelation(relation: Relation, sourceId: number, targetId: number): (Anonymous function)

resolveFilters

resolveIncludes

resolvePaging

resolveSorting

save

  • save(model: Model, values: any): (Anonymous function)

saveRelated

  • saveRelated(relation: Relation, sourceId: number, values: any): function

transformRequest

update

  • update(model: Model, values: any): (Anonymous function)

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc