A service used for calling standard Haystack Ops.

Constructors

Properties

The watch ops service.

Methods

  • Read time series data from a historized point.

    https://project-haystack.org/doc/Ops#hisRead

    Parameters

    • id: string | HRef

      The id of the historized point.

    • range: string | HDateTime | HDate | [HDate, HDate] | [HDateTime, HDateTime]

      The date range.

    Returns Promise<HGrid>

    The time series data.

  • Write the time series data to the historized point.

    https://project-haystack.org/doc/Ops#hisWrite

    Parameters

    • id: string | HRef

      The id of the historized point.

    • data: HaysonDict | HDict | HGrid | HaysonDict[] | HList<HDict> | HDict[]

      The data to write to the history.

    Returns Promise<HGrid>

    The history data to write.

  • Invoke an action on the target record.

    https://project-haystack.org/doc/Ops#invokeAction

    Parameters

    • id: string | HRef

      The id of the target record to invoke the action on.

    • action: string

      The name of the action to invoke.

    • Optionalargs: HaysonDict | HDict

      Optional arguments for the action.

    Returns Promise<HGrid>

    The result of the action.

  • A generic method used to invoke any op on the server using an HTTP POST.

    Parameters

    • op: string

      The name of the op to invoke.

    • Optionalgrid: HGrid

      An optional grid argument that is encoded with the op call.

    Returns Promise<HGrid>

    The response grid.

  • Get the navigation hierarchy at the specified node via its navId. Return the root node if none is specified.

    https://project-haystack.org/doc/Ops#nav

    Parameters

    • OptionalnavId: string | HRef | HaysonDict | HDict | HGrid | HStr

      Optional navId string, str, ref, dict or grid. If a dict or grid, the id must be specified via a navId property.

    Returns Promise<HGrid>

    The navigation.

  • Write to a point's priority level.

    https://project-haystack.org/doc/Ops#pointWrite

    Parameters

    • __namedParameters: {
          duration?: number | HNum;
          id: string | HRef;
          level: number;
          val?: HVal | HaysonVal;
          who?: string;
      }

    Returns Promise<HGrid>

    The writable point's priority array.

  • Parameters

    • ids: string[] | HRef[]

      list of ids as HRef or string

    Returns Promise<HGrid>

    Reads a set of records from the server by id.

    const result = await client.read(['@id1', '@id2', '@id3'])
    

    https://project-haystack.org/doc/Ops#read

  • Parameters

    • filter: string

      The required haystack filter.

    • Optionallimit: number

      Optional limit on the number of records sent back.

    Returns Promise<HGrid>

    Reads a set of records from the server by filter.

    Please note, to help build a Haystack filter you can use HFilterBuilder available in Haystack Core.

    const filter = new HFilterBuilder()
    .has('site')
    .and()
    .equals('geoCity', 'Las Vegas')
    .build()

    const result = await client.read(filter)

    https://project-haystack.org/doc/Ops#read