UNPKG

ravendb

Version:
56 lines 1.79 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.GetDatabaseSettingsOperation = void 0; const index_js_1 = require("../../../Exceptions/index.js"); const RavenCommand_js_1 = require("../../../Http/RavenCommand.js"); class GetDatabaseSettingsOperation { _databaseName; get resultType() { return "CommandResult"; } constructor(databaseName) { if (!databaseName) { (0, index_js_1.throwError)("InvalidArgumentException", "DatabaseName cannot be null"); } this._databaseName = databaseName; } getCommand(conventions) { return new GetDatabaseSettingsCommand(this._databaseName); } } exports.GetDatabaseSettingsOperation = GetDatabaseSettingsOperation; class GetDatabaseSettingsCommand extends RavenCommand_js_1.RavenCommand { _databaseName; constructor(databaseName) { super(); if (!databaseName) { (0, index_js_1.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