UNPKG

ravendb

Version:
52 lines 1.55 kB
import { throwError } from "../../../Exceptions/index.js"; import { RavenCommand } from "../../../Http/RavenCommand.js"; export class GetDatabaseSettingsOperation { _databaseName; get resultType() { return "CommandResult"; } constructor(databaseName) { if (!databaseName) { throwError("InvalidArgumentException", "DatabaseName cannot be null"); } this._databaseName = databaseName; } getCommand(conventions) { return new GetDatabaseSettingsCommand(this._databaseName); } } class GetDatabaseSettingsCommand extends RavenCommand { _databaseName; constructor(databaseName) { super(); if (!databaseName) { throwError("InvalidArgumentException", "DatabaseName cannot be null"); } this._databaseName = databaseName; } get isReadRequest() { return false; } createRequest(node) { const uri = node.url + "/databases/" + this._databaseName + "/admin/record"; return { method: "GET", uri }; } async setResponseAsync(bodyStream, fromCache) { if (!bodyStream) { this._throwInvalidResponse(); } let body; const result = await this._pipeline() .parseJsonSync() .collectBody(_ => body = _) .process(bodyStream); this.result = { settings: result.Settings }; return body; } } //# sourceMappingURL=GetDatabaseSettingsOperation.js.map