UNPKG

ravendb

Version:
50 lines 1.89 kB
import { StringUtil } from "../../../Utility/StringUtil.js"; import { throwError } from "../../../Exceptions/index.js"; import { DateUtil } from "../../../Utility/DateUtil.js"; export class CopyTimeSeriesCommandData { id; name; changeVector; destinationId; destinationName; from; to; get type() { return "TimeSeriesCopy"; } constructor(sourceDocumentId, sourceName, destinationDocumentId, destinationName, from, to) { if (StringUtil.isNullOrWhitespace(sourceDocumentId)) { throwError("InvalidArgumentException", "SourceDocumentId cannot be null or whitespace."); } if (StringUtil.isNullOrWhitespace(sourceName)) { throwError("InvalidArgumentException", "SourceName cannot be null or whitespace."); } if (StringUtil.isNullOrWhitespace(destinationDocumentId)) { throwError("InvalidArgumentException", "DestinationDocumentId cannot be null or whitespace."); } if (StringUtil.isNullOrWhitespace(destinationName)) { 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.utc.stringify(this.from) : null, To: this.to ? DateUtil.utc.stringify(this.to) : null, Type: "TimeSeriesCopy" }; } onBeforeSaveChanges(session) { // empty } } //# sourceMappingURL=CopyTimeSeriesCommandData.js.map