UNPKG

ravendb

Version:
39 lines 1.41 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.GetClientConfigurationCommand = exports.GetClientConfigurationOperation = void 0; const RavenCommand_js_1 = require("../../../Http/RavenCommand.js"); class GetClientConfigurationOperation { get resultType() { return "CommandResult"; } getCommand(conventions) { return new GetClientConfigurationCommand(); } } exports.GetClientConfigurationOperation = GetClientConfigurationOperation; class GetClientConfigurationCommand extends RavenCommand_js_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); // since server can send etag bigger than Number.MAX_SAFE_INTEGER we need to parse Etag as string const match = body.match("\"Etag\":(-?[0-9]+)"); if (match) { this.result.etag = match[1]; } return body; } } exports.GetClientConfigurationCommand = GetClientConfigurationCommand; //# sourceMappingURL=GetClientConfigurationOperation.js.map