A high level Haystack Client

Implements

Constructors

Properties

defs: HNamespace = ...

The defs associated with the client.

The extended ops service.

The fetch function to use for network communication.

functions: FunctionService

The functions service

The user groups service

notifications: NotificationService

The notifications service.

notificationsSettings: NotificationSettingsService

The notifications settings service.

The ops service.

origin: string

The origin of the client.

pathPrefix: string

Is the optional path that is appended to the client origin url

The project service.

project: string

The project associated with this client.

The record service.

The user roles service

schedule: ScheduleService

The schedule service.

The user service.

The watch service.

Methods

  • Closes the client.

    Warning: this will close any watches associated with this client. Any watches may throw an error if they are used after being closed.

    Returns Promise<void>

  • Fetch a haystack value from the server.

    Type Parameters

    • T extends HVal

    Parameters

    • resource: RequestInfo

      The resource to request.

    • Optionalbody: HVal | HaysonVal

      Optional haystack value used for the request's body.

    • Optionaloptions: RequestInit

      Optional object containing any custom settings.

    Returns Promise<T>

    A promise that resolves to a value.

    A fetch or grid error.

  • Returns boolean

    True if the defs have been loaded using this service.

  • Asynchronously load the defs library using this service.

    Please note, this will overwrite any existing defs loaded.

    Returns Promise<void>

    A promise that's resolved once the defs have been loaded.

  • Returns {
        haystackServiceUrl: string;
        hostServiceUrl: string;
        opUrl: string;
        pathPrefix: string;
        project: string;
    }

    A JSON object of the Client that uniquely identifies it.