ravendb
Version:
RavenDB client for Node.js
54 lines • 2.23 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.CopyTimeSeriesCommandData = void 0;
const StringUtil_js_1 = require("../../../Utility/StringUtil.js");
const index_js_1 = require("../../../Exceptions/index.js");
const DateUtil_js_1 = require("../../../Utility/DateUtil.js");
class CopyTimeSeriesCommandData {
id;
name;
changeVector;
destinationId;
destinationName;
from;
to;
get type() {
return "TimeSeriesCopy";
}
constructor(sourceDocumentId, sourceName, destinationDocumentId, destinationName, from, to) {
if (StringUtil_js_1.StringUtil.isNullOrWhitespace(sourceDocumentId)) {
(0, index_js_1.throwError)("InvalidArgumentException", "SourceDocumentId cannot be null or whitespace.");
}
if (StringUtil_js_1.StringUtil.isNullOrWhitespace(sourceName)) {
(0, index_js_1.throwError)("InvalidArgumentException", "SourceName cannot be null or whitespace.");
}
if (StringUtil_js_1.StringUtil.isNullOrWhitespace(destinationDocumentId)) {
(0, index_js_1.throwError)("InvalidArgumentException", "DestinationDocumentId cannot be null or whitespace.");
}
if (StringUtil_js_1.StringUtil.isNullOrWhitespace(destinationName)) {
(0, index_js_1.throwError)("InvalidArgumentException", "DestinationName cannot be null or whitespace.");
}
this.id = sourceDocumentId;
this.name = sourceName;
this.destinationId = destinationDocumentId;
this.destinationName = destinationName;
this.from = from;
this.to = to;
}
serialize(conventions) {
return {
Id: this.id,
Name: this.name,
DestinationId: this.destinationId,
DestinationName: this.destinationName,
From: this.from ? DateUtil_js_1.DateUtil.utc.stringify(this.from) : null,
To: this.to ? DateUtil_js_1.DateUtil.utc.stringify(this.to) : null,
Type: "TimeSeriesCopy"
};
}
onBeforeSaveChanges(session) {
// empty
}
}
exports.CopyTimeSeriesCommandData = CopyTimeSeriesCommandData;
//# sourceMappingURL=CopyTimeSeriesCommandData.js.map