Class: EnterpriseEventStream

EnterpriseEventStream(client, optionsopt)

Stream of Box enterprise events. By default, the stream starts from the current time. Pass 'startDate' to start from a specific time. Pass 'streamPosition' to start from a previous stream position, or '0' for all available past events (~1 year). Once the stream catches up to the current time, it will begin polling every 'pollingInterval' seconds. If 'pollingInterval' = 0, then the stream will end when it catches up to the current time (no polling).

Constructor

new EnterpriseEventStream(client, optionsopt)

Parameters:
Name Type Attributes Description
client BoxClient The client to use to get events
options Object <optional>
Options
Properties
Name Type Attributes Default Description
streamPosition string <optional>
The stream position to start from (pass '0' for all past events)
startDate string <optional>
The date to start from
endDate string <optional>
The date to end at
eventTypeFilter Array.<EventType> <optional>
Array of event types to return
pollingInterval int <optional>
60 Polling interval (in seconds). Pass 0 for no polling.
chunkSize int <optional>
500 Number of events to fetch per call (max = 500)
Source:

Extends

  • Readable

Members

(private) _client :BoxClient

The client for making API calls
Type:
Source:

(private) _options :Object

Options
Type:
  • Object
Source:

(private, nullable) _streamPosition :string

The current stream position
Type:
  • string
Source:

Methods

(private) _read() → {void}

Implementation of the stream-internal read function. This is called by the stream whenever it needs more data, and will not be called again until data is pushed into the stream.
Source:
Returns:
Type
void

(private) _read() → {void}

Implementation of the stream-internal read function. This is called by the stream whenever it needs more data, and will not be called again until data is pushed into the stream.
Source:
Returns:
Type
void

(private) fetchEvents(callback) → {void}

Fetch the next chunk of events If there are no events, poll until events are available. If an error occurs, emit the error but continuing polling as usual.
Parameters:
Name Type Description
callback function Passed the array of events
Source:
Returns:
Type
void

(private) fetchEvents(callback) → {void}

Fetch the next chunk of events If there are no events, poll until events are available. If an error occurs, emit the error but continuing polling as usual.
Parameters:
Name Type Description
callback function Passed the array of events
Source:
Returns:
Type
void

getStreamPosition() → (nullable) {number}

Source:
Returns:
- Returns null if no events have been fetched from Box yet.
Type
number

getStreamPosition() → (nullable) {number}

Source:
Returns:
- Returns null if no events have been fetched from Box yet.
Type
number

getStreamState() → {Object}

Get the stream state.
Source:
Returns:
- The stream state
Type
Object

getStreamState() → {Object}

Get the stream state.
Source:
Returns:
- The stream state
Type
Object

setStreamState(state) → {void}

Set the stream state.
Parameters:
Name Type Description
state Object The stream state
Source:
Returns:
Type
void

setStreamState(state) → {void}

Set the stream state.
Parameters:
Name Type Description
state Object The stream state
Source:
Returns:
Type
void