Add reset endpoint
This commit is contained in:
parent
6d49f51e7d
commit
7ccced45aa
1
index.d.ts
vendored
1
index.d.ts
vendored
|
@ -72,6 +72,7 @@ export class ProjectionsManager {
|
||||||
enable(name: string, userCredentials: UserCredentials): Promise<void>;
|
enable(name: string, userCredentials: UserCredentials): Promise<void>;
|
||||||
disable(name: string, userCredentials: UserCredentials): Promise<void>;
|
disable(name: string, userCredentials: UserCredentials): Promise<void>;
|
||||||
abort(name: string, userCredentials: UserCredentials): Promise<void>;
|
abort(name: string, userCredentials: UserCredentials): Promise<void>;
|
||||||
|
reset(name: string, userCredentials: UserCredentials): Promise<void>;
|
||||||
createOneTime(query: string, userCredentials: UserCredentials): Promise<void>;
|
createOneTime(query: string, userCredentials: UserCredentials): Promise<void>;
|
||||||
createTransient(name: string, query: string, userCredentials: UserCredentials): Promise<void>;
|
createTransient(name: string, query: string, userCredentials: UserCredentials): Promise<void>;
|
||||||
createContinuous(name: string, query: string, trackEmittedStreams: boolean, userCredentials: UserCredentials): Promise<void>;
|
createContinuous(name: string, query: string, trackEmittedStreams: boolean, userCredentials: UserCredentials): Promise<void>;
|
||||||
|
|
|
@ -31,6 +31,10 @@ ProjectionsClient.prototype.abort = function(httpEndPoint, name, userCredentials
|
||||||
return this.sendPost(httpEndPoint + '/projection/' + name + '/command/abort', '', userCredentials, HTTP_OK);
|
return this.sendPost(httpEndPoint + '/projection/' + name + '/command/abort', '', userCredentials, HTTP_OK);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
ProjectionsClient.prototype.reset = function(httpEndPoint, name, userCredentials) {
|
||||||
|
return this.sendPost(httpEndPoint + '/projection/' + name + 'command/reset', userCredentials, HTTP_OK);
|
||||||
|
};
|
||||||
|
|
||||||
ProjectionsClient.prototype.createOneTime = function(httpEndPoint, query, userCredentials) {
|
ProjectionsClient.prototype.createOneTime = function(httpEndPoint, query, userCredentials) {
|
||||||
return this.sendPost(httpEndPoint + '/projections/onetime?type=JS', query, userCredentials, HTTP_CREATED);
|
return this.sendPost(httpEndPoint + '/projections/onetime?type=JS', query, userCredentials, HTTP_CREATED);
|
||||||
};
|
};
|
||||||
|
|
|
@ -45,6 +45,16 @@ ProjectionsManager.prototype.abort = function(name, userCredentials) {
|
||||||
return this._client.abort(this._httpEndPoint, name, userCredentials);
|
return this._client.abort(this._httpEndPoint, name, userCredentials);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reset a projection. (This will re-emit events, streams that are written to from the projection will also be soft deleted)
|
||||||
|
* @param name The name of the projection.
|
||||||
|
* @param userCredentials Credentials for a user with permission to disable a projection.
|
||||||
|
* @returns {Promise<void>}
|
||||||
|
*/
|
||||||
|
ProjectionsManager.prototype.reset = function(name, userCredentials) {
|
||||||
|
return this._client.abort(this._httpEndPoint, name, userCredentials);
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a one-time query.
|
* Creates a one-time query.
|
||||||
* @param query The JavaScript source code for the query.
|
* @param query The JavaScript source code for the query.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user