UNPKG

@configurator/ravendb

Version:
41 lines 1.33 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.GetConflictsCommand = void 0; const RavenCommand_1 = require("../../Http/RavenCommand"); class GetConflictsCommand extends RavenCommand_1.RavenCommand { constructor(id, conventions) { super(); this._id = id; this._conventions = conventions; } get isReadRequest() { return true; } createRequest(node) { const uri = node.url + "/databases/" + node.database + "/replication/conflicts?docId=" + encodeURIComponent(this._id); return { method: "GET", uri }; } async setResponseAsync(bodyStream, fromCache) { if (!bodyStream) { this._throwInvalidResponse(); } let body = null; const payload = await this._defaultPipeline(_ => body = _).process(bodyStream); const dateUtil = this._conventions.dateUtil; const { results, ...otherProps } = payload; this.result = { ...otherProps, results: results.map(r => ({ ...r, lastModified: dateUtil.parse(r.lastModified) })) }; return body; } } exports.GetConflictsCommand = GetConflictsCommand; //# sourceMappingURL=GetConflictsCommand.js.map