@configurator/ravendb
Version:
RavenDB client for Node.js
40 lines • 1.18 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.GetTcpInfoCommand = exports.TcpConnectionInfo = void 0;
const RavenCommand_1 = require("../../Http/RavenCommand");
class TcpConnectionInfo {
}
exports.TcpConnectionInfo = TcpConnectionInfo;
class GetTcpInfoCommand extends RavenCommand_1.RavenCommand {
constructor(tag, dbName) {
super();
this._tag = tag;
this._dbName = dbName;
this.timeout = 15000;
}
createRequest(node) {
let uri;
if (!this._dbName) {
uri = `${node.url}/info/tcp?tcp=${this._tag}`;
}
else {
uri = `${node.url}/databases/${this._dbName}/info/tcp?tcp=${this._tag}`;
}
this.requestedNode = node;
return {
uri,
method: "GET"
};
}
async setResponseAsync(bodyStream, fromCache) {
if (!bodyStream) {
this._throwInvalidResponse();
}
return this._parseResponseDefaultAsync(bodyStream);
}
get isReadRequest() {
return true;
}
}
exports.GetTcpInfoCommand = GetTcpInfoCommand;
//# sourceMappingURL=GetTcpInfoCommand.js.map