ravendb
Version:
RavenDB client for Node.js
48 lines • 1.3 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.GetTcpInfoCommand = exports.TcpConnectionInfo = void 0;
const RavenCommand_js_1 = require("../../Http/RavenCommand.js");
class TcpConnectionInfo {
url;
certificate;
urls;
nodeTag;
serverId;
}
exports.TcpConnectionInfo = TcpConnectionInfo;
class GetTcpInfoCommand extends RavenCommand_js_1.RavenCommand {
_tag;
_dbName;
requestedNode;
constructor(tag, dbName) {
super();
this._tag = tag;
this._dbName = dbName;
this.timeout = 15_000;
}
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