ravendb
Version:
RavenDB client for Node.js
34 lines • 1.09 kB
JavaScript
import { RavenCommand } from "../../../Http/RavenCommand.js";
export class GetClientConfigurationOperation {
get resultType() {
return "CommandResult";
}
getCommand(conventions) {
return new GetClientConfigurationCommand();
}
}
export class GetClientConfigurationCommand extends 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;
}
}
//# sourceMappingURL=GetClientConfigurationOperation.js.map