Class Entities

The client used to fetch, create, update, and delete entities. Example usage:

const entitiesClient = new Entities();
const item = await entitiesClient.get({ entityName: 'item', id: '123' });
const items = await entitiesClient.get({ entityName: 'item', ids: ['123', '456'] });

Constructors

  • Instantiates a new Entities client with the optionally provided context.

    Parameters

    • Optional ctx: any

      InvocationContext The invocation context to use for this client. If not passed, the default invocation client detected from the AuthConfig is used.

    • apiVersion: API_VERSION = DEFAULT_API_VERSION

      The version to use for calls by this client. If not passed, the default version is used. Version can be overriden separately on each function as well.

    Returns Entities

Properties

apiVersion: API_VERSION = DEFAULT_API_VERSION

The version to use for calls by this client. If not passed, the default version is used. Version can be overriden separately on each function as well.

ctx?: any

InvocationContext The invocation context to use for this client. If not passed, the default invocation client detected from the AuthConfig is used.

Methods

  • Batch create will often return an array of created objects and an array of errors, if any were encountered. This is not guaranteed as the implementation depends on the entity being created.

    Returns Promise<any>

  • Deletes the entities with the given ids in the options.

    Returns Promise<any>

  • Batch update will often return an array of updated objects and an array of errors, if any were encountered. This is not guaranteed as the implementation depends on the entity being updated.

    Returns Promise<any>

  • Creates and returns the entity from the object passed in the options.

    Parameters

    Returns Promise<any>

  • Deletes and returns the passed entity object or id(s) in the options.

    Parameters

    Returns Promise<any>

  • Fetches a single entity or a list of entities based on the options passed.

    Parameters

    Returns Promise<any>

    If id is passed in the options, returns a single entity (object). If ids is passed, returns a list of entities.

  • Take collection of entity references and fetches them from the API returning a map keyed by reference

    Parameters

    Returns Promise<Map<string, any>>

  • Updates the entity with the given object in the options.

    Parameters

    • options: EntitiesClientUpdateOptions

    Returns Promise<any>

    The updated entity.

Generated using TypeDoc