@configurator/ravendb
Version:
RavenDB client for Node.js
38 lines • 1.3 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.GetClientConfigurationCommand = exports.GetClientConfigurationOperation = void 0;
const RavenCommand_1 = require("../../../Http/RavenCommand");
class GetClientConfigurationOperation {
get resultType() {
return "CommandResult";
}
getCommand(conventions) {
return new GetClientConfigurationCommand();
}
}
exports.GetClientConfigurationOperation = GetClientConfigurationOperation;
class GetClientConfigurationCommand extends RavenCommand_1.RavenCommand {
constructor() {
super();
}
get isReadRequest() {
return false;
}
createRequest(node) {
const uri = `${node.url}/databases/${node.database}/configuration/client`;
return { uri };
}
async setResponseAsync(bodyStream, fromCache) {
if (!bodyStream) {
this._throwInvalidResponse();
}
const body = await this._parseResponseDefaultAsync(bodyStream);
const match = body.match("\"Etag\":(-?[0-9]+)");
if (match) {
this.result.etag = match[1];
}
return body;
}
}
exports.GetClientConfigurationCommand = GetClientConfigurationCommand;
//# sourceMappingURL=GetClientConfigurationOperation.js.map