Class: ProjectionsManager

ProjectionsManager(log, httpEndPoint, operationTimeout, rejectUnauthorizedopt)

new ProjectionsManager(log, httpEndPoint, operationTimeout, rejectUnauthorizedopt)

Creates a new instance of ProjectionsManager.
Parameters:
Name Type Attributes Description
log Logger Instance of Logger to use for logging.
httpEndPoint string HTTP endpoint of an Event Store server.
operationTimeout number Operation timeout in milliseconds.
rejectUnauthorized boolean <optional>
Reject authorized SSL certs (if using SSL) - set to false is using self-signed certs
Source:

Methods

abort(name, userCredentials) → {Promise.<void>}

Disables a projection.
Parameters:
Name Type Description
name The name of the projection.
userCredentials Credentials for a user with permission to disable a projection.
Source:
Returns:
Type
Promise.<void>

createContinuous(name, query, trackEmittedStreams, userCredentials) → {Promise.<void>}

Creates a one-time query.
Parameters:
Name Type Description
name The name of the projection.
query The JavaScript source code for the query.
trackEmittedStreams Whether the streams emitted by this projection should be tracked.
userCredentials Credentials for a user with permission to create a query.
Source:
Returns:
Type
Promise.<void>

createOneTime(query, userCredentials) → {Promise.<void>}

Creates a one-time query.
Parameters:
Name Type Description
query The JavaScript source code for the query.
userCredentials Credentials for a user with permission to create a query.
Source:
Returns:
Type
Promise.<void>

createTransient(name, query, userCredentials) → {Promise.<void>}

Creates a one-time query.
Parameters:
Name Type Description
name A name for the query.
query The JavaScript source code for the query.
userCredentials Credentials for a user with permission to create a query.
Source:
Returns:
Type
Promise.<void>

delete(name, deleteEmittedStreams, deleteStateStream, deleteCheckpointStream, userCredentials) → {Promise.<void>}

Updates the definition of a query.
Parameters:
Name Type Description
name The name of the projection.
deleteEmittedStreams Whether to delete the streams that were emitted by this projection.
deleteStateStream Where to delete the state stream for this projection
deleteCheckpointStream Where to delete the checkpoint stream for this projection
userCredentials Credentials for a user with permission to delete a projection.
Source:
Returns:
Type
Promise.<void>

disable(name, userCredentials) → {Promise.<void>}

Aborts and disables a projection without writing a checkpoint.
Parameters:
Name Type Description
name The name of the projection.
userCredentials Credentials for a user with permission to disable a projection.
Source:
Returns:
Type
Promise.<void>

enable(name, userCredentials) → {Promise.<void>}

Enables a projection.
Parameters:
Name Type Description
name The name of the projection.
userCredentials Credentials for a user with permission to enable a projection.
Source:
Returns:
Type
Promise.<void>

getPartitionResult(name, partitionId, userCredentials) → {Promise.<string>}

Gets the state of a projection for a specified partition.
Parameters:
Name Type Description
name The name of the projection.
partitionId The id of the partition.
userCredentials Credentials for the operation.
Source:
Returns:
String of JSON containing projection state.
Type
Promise.<string>

getPartitionState(name, partitionId, userCredentials) → {Promise.<string>}

Gets the state of a projection for a specified partition.
Parameters:
Name Type Description
name The name of the projection.
partitionId The id of the partition.
userCredentials Credentials for the operation.
Source:
Returns:
String of JSON containing projection state.
Type
Promise.<string>

getQuery(name, userCredentials) → {Promise.<string>}

Gets the status of a query.
Parameters:
Name Type Description
name The name of the query.
userCredentials Credentials for the operation.
Source:
Returns:
String of JSON containing query status.
Type
Promise.<string>

getResult(name, userCredentials) → {Promise.<string>}

Gets the state of a projection.
Parameters:
Name Type Description
name The name of the projection.
userCredentials Credentials for the operation.
Source:
Returns:
String of JSON containing projection state.
Type
Promise.<string>

getState(name, userCredentials) → {Promise.<string>}

Gets the state of a projection.
Parameters:
Name Type Description
name The name of the projection.
userCredentials Credentials for the operation.
Source:
Returns:
String of JSON containing projection state.
Type
Promise.<string>

getStatistics(name, userCredentials) → {Promise.<string>}

Gets the statistics of a projection.
Parameters:
Name Type Description
name The name of the projection.
userCredentials Credentials for the operation.
Source:
Returns:
String of JSON containing projection statistics.
Type
Promise.<string>

getStatus(name, userCredentials) → {Promise.<string>}

Gets the status of a projection.
Parameters:
Name Type Description
name The name of the projection.
userCredentials Credentials for the operation.
Source:
Returns:
String of JSON containing projection status.
Type
Promise.<string>

listAll(userCredentials) → {Promise.<Array.<ProjectionDetails>>}

Lists the status of all projections.
Parameters:
Name Type Description
userCredentials Credentials for the operation.
Source:
Returns:
Type
Promise.<Array.<ProjectionDetails>>

listContinuous(userCredentials) → {Promise.<Array.<ProjectionDetails>>}

Lists the status of all continuous projections.
Parameters:
Name Type Description
userCredentials Credentials for the operation.
Source:
Returns:
Type
Promise.<Array.<ProjectionDetails>>

listOneTime(userCredentials) → {Promise.<Array.<ProjectionDetails>>}

Lists the status of all one-time projections.
Parameters:
Name Type Description
userCredentials Credentials for the operation.
Source:
Returns:
Type
Promise.<Array.<ProjectionDetails>>

reset(name, userCredentials) → {Promise.<void>}

Reset a projection. (This will re-emit events, streams that are written to from the projection will also be soft deleted)
Parameters:
Name Type Description
name The name of the projection.
userCredentials Credentials for a user with permission to reset a projection.
Source:
Returns:
Type
Promise.<void>

updateQuery(name, query, userCredentials) → {Promise.<void>}

Updates the definition of a query.
Parameters:
Name Type Description
name The name of the query.
query The JavaScript source code for the query.
userCredentials Credentials for the operation.
Source:
Returns:
Type
Promise.<void>