diff --git a/dist/yorkie.js b/dist/yorkie.js index 501243d73..ebaa748a2 100644 --- a/dist/yorkie.js +++ b/dist/yorkie.js @@ -2,7 +2,7 @@ * * yorkie-js-sdk for building collaborative editing applications. * - Version: v0.0.10 - * - Date: 2020-09-20T09:48Z + * - Date: 2020-09-27T12:35Z * - Homepage: https://yorkie.dev * * Copyright 2020 The Yorkie Authors. All rights reserved. @@ -4205,6 +4205,8 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var _document_json_primitive__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../document/json/primitive */ "./src/document/json/primitive.ts"); /* harmony import */ var _yorkie_pb__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./yorkie_pb */ "./src/api/yorkie_pb.js"); /* harmony import */ var _yorkie_pb__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(_yorkie_pb__WEBPACK_IMPORTED_MODULE_24__); +/* harmony import */ var _document_operation_increase_operation__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../document/operation/increase_operation */ "./src/document/operation/increase_operation.ts"); +/* harmony import */ var _document_json_counter__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../document/json/counter */ "./src/document/json/counter.ts"); /* * Copyright 2020 The Yorkie Authors. All rights reserved. * @@ -4242,6 +4244,8 @@ __webpack_require__.r(__webpack_exports__); + + @@ -4299,6 +4303,18 @@ function toValueType(valueType) { throw new _util_error__WEBPACK_IMPORTED_MODULE_1__["YorkieError"](_util_error__WEBPACK_IMPORTED_MODULE_1__["Code"].Unsupported, `unsupported type: ${valueType}`); } } +function toCounterType(valueType) { + switch (valueType) { + case _document_json_counter__WEBPACK_IMPORTED_MODULE_26__["CounterType"].IntegerCnt: + return _yorkie_pb__WEBPACK_IMPORTED_MODULE_24__["ValueType"].INTEGER_CNT; + case _document_json_counter__WEBPACK_IMPORTED_MODULE_26__["CounterType"].LongCnt: + return _yorkie_pb__WEBPACK_IMPORTED_MODULE_24__["ValueType"].LONG_CNT; + case _document_json_counter__WEBPACK_IMPORTED_MODULE_26__["CounterType"].DoubleCnt: + return _yorkie_pb__WEBPACK_IMPORTED_MODULE_24__["ValueType"].DOUBLE_CNT; + default: + throw new _util_error__WEBPACK_IMPORTED_MODULE_1__["YorkieError"](_util_error__WEBPACK_IMPORTED_MODULE_1__["Code"].Unsupported, `unsupported type: ${valueType}`); + } +} function toJSONElementSimple(jsonElement) { const pbJSONElement = new _yorkie_pb__WEBPACK_IMPORTED_MODULE_24__["JSONElementSimple"](); if (jsonElement instanceof _document_json_object__WEBPACK_IMPORTED_MODULE_18__["JSONObject"]) { @@ -4323,6 +4339,12 @@ function toJSONElementSimple(jsonElement) { pbJSONElement.setCreatedAt(toTimeTicket(jsonElement.getCreatedAt())); pbJSONElement.setValue(jsonElement.toBytes()); } + else if (jsonElement instanceof _document_json_counter__WEBPACK_IMPORTED_MODULE_26__["Counter"]) { + const counter = jsonElement; + pbJSONElement.setType(toCounterType(counter.getType())); + pbJSONElement.setCreatedAt(toTimeTicket(jsonElement.getCreatedAt())); + pbJSONElement.setValue(jsonElement.toBytes()); + } else { throw new _util_error__WEBPACK_IMPORTED_MODULE_1__["YorkieError"](_util_error__WEBPACK_IMPORTED_MODULE_1__["Code"].Unimplemented, `unimplemented element: ${jsonElement}`); } @@ -4432,6 +4454,14 @@ function toOperation(operation) { pbStyleOperation.setExecutedAt(toTimeTicket(styleOperation.getExecutedAt())); pbOperation.setStyle(pbStyleOperation); } + else if (operation instanceof _document_operation_increase_operation__WEBPACK_IMPORTED_MODULE_25__["IncreaseOperation"]) { + const increaseOperation = operation; + const pbIncreaseOperation = new _yorkie_pb__WEBPACK_IMPORTED_MODULE_24__["Operation"].Increase(); + pbIncreaseOperation.setParentCreatedAt(toTimeTicket(increaseOperation.getParentCreatedAt())); + pbIncreaseOperation.setValue(toJSONElementSimple(increaseOperation.getValue())); + pbIncreaseOperation.setExecutedAt(toTimeTicket(increaseOperation.getExecutedAt())); + pbOperation.setIncrease(pbIncreaseOperation); + } else { throw new _util_error__WEBPACK_IMPORTED_MODULE_1__["YorkieError"](_util_error__WEBPACK_IMPORTED_MODULE_1__["Code"].Unimplemented, 'unimplemented operation'); } @@ -4527,6 +4557,16 @@ function toPlainText(text) { pbJSONElement.setText(pbText); return pbJSONElement; } +function toCounter(counter) { + const pbJSONCounter = new _yorkie_pb__WEBPACK_IMPORTED_MODULE_24__["JSONElement"].Counter(); + pbJSONCounter.setType(toCounterType(counter.getType())); + pbJSONCounter.setValue(counter.toBytes()); + pbJSONCounter.setCreatedAt(toTimeTicket(counter.getCreatedAt())); + pbJSONCounter.setRemovedAt(toTimeTicket(counter.getRemovedAt())); + const pbJSONElement = new _yorkie_pb__WEBPACK_IMPORTED_MODULE_24__["JSONElement"](); + pbJSONElement.setCounter(pbJSONCounter); + return pbJSONElement; +} function toJSONElement(jsonElement) { if (jsonElement instanceof _document_json_object__WEBPACK_IMPORTED_MODULE_18__["JSONObject"]) { return toJSONObject(jsonElement); @@ -4540,6 +4580,9 @@ function toJSONElement(jsonElement) { else if (jsonElement instanceof _document_json_text__WEBPACK_IMPORTED_MODULE_21__["PlainText"]) { return toPlainText(jsonElement); } + else if (jsonElement instanceof _document_json_counter__WEBPACK_IMPORTED_MODULE_26__["Counter"]) { + return toCounter(jsonElement); + } else { throw new _util_error__WEBPACK_IMPORTED_MODULE_1__["YorkieError"](_util_error__WEBPACK_IMPORTED_MODULE_1__["Code"].Unimplemented, `unimplemented element: ${jsonElement}`); } @@ -4587,6 +4630,17 @@ function fromValueType(pbValueType) { } throw new _util_error__WEBPACK_IMPORTED_MODULE_1__["YorkieError"](_util_error__WEBPACK_IMPORTED_MODULE_1__["Code"].Unimplemented, `unimplemented value type: ${pbValueType}`); } +function fromCounterType(pbValueType) { + switch (pbValueType) { + case _yorkie_pb__WEBPACK_IMPORTED_MODULE_24__["ValueType"].INTEGER_CNT: + return _document_json_counter__WEBPACK_IMPORTED_MODULE_26__["CounterType"].IntegerCnt; + case _yorkie_pb__WEBPACK_IMPORTED_MODULE_24__["ValueType"].LONG_CNT: + return _document_json_counter__WEBPACK_IMPORTED_MODULE_26__["CounterType"].LongCnt; + case _yorkie_pb__WEBPACK_IMPORTED_MODULE_24__["ValueType"].DOUBLE_CNT: + return _document_json_counter__WEBPACK_IMPORTED_MODULE_26__["CounterType"].DoubleCnt; + } + throw new _util_error__WEBPACK_IMPORTED_MODULE_1__["YorkieError"](_util_error__WEBPACK_IMPORTED_MODULE_1__["Code"].Unimplemented, `unimplemented value type: ${pbValueType}`); +} function fromJSONElementSimple(pbJSONElement) { switch (pbJSONElement.getType()) { case _yorkie_pb__WEBPACK_IMPORTED_MODULE_24__["ValueType"].JSON_OBJECT: @@ -4605,6 +4659,10 @@ function fromJSONElementSimple(pbJSONElement) { case _yorkie_pb__WEBPACK_IMPORTED_MODULE_24__["ValueType"].BYTES: case _yorkie_pb__WEBPACK_IMPORTED_MODULE_24__["ValueType"].DATE: return _document_json_primitive__WEBPACK_IMPORTED_MODULE_23__["JSONPrimitive"].of(_document_json_primitive__WEBPACK_IMPORTED_MODULE_23__["JSONPrimitive"].valueFromBytes(fromValueType(pbJSONElement.getType()), pbJSONElement.getValue_asU8()), fromTimeTicket(pbJSONElement.getCreatedAt())); + case _yorkie_pb__WEBPACK_IMPORTED_MODULE_24__["ValueType"].INTEGER_CNT: + case _yorkie_pb__WEBPACK_IMPORTED_MODULE_24__["ValueType"].DOUBLE_CNT: + case _yorkie_pb__WEBPACK_IMPORTED_MODULE_24__["ValueType"].LONG_CNT: + return _document_json_counter__WEBPACK_IMPORTED_MODULE_26__["Counter"].of(_document_json_counter__WEBPACK_IMPORTED_MODULE_26__["Counter"].valueFromBytes(fromCounterType(pbJSONElement.getType()), pbJSONElement.getValue_asU8()), fromTimeTicket(pbJSONElement.getCreatedAt())); } throw new _util_error__WEBPACK_IMPORTED_MODULE_1__["YorkieError"](_util_error__WEBPACK_IMPORTED_MODULE_1__["Code"].Unimplemented, `unimplemented element: ${pbJSONElement}`); } @@ -4676,6 +4734,10 @@ function fromOperations(pbOperations) { }); operation = _document_operation_style_operation__WEBPACK_IMPORTED_MODULE_10__["StyleOperation"].create(fromTimeTicket(pbStyleOperation.getParentCreatedAt()), fromTextNodePos(pbStyleOperation.getFrom()), fromTextNodePos(pbStyleOperation.getTo()), attributes, fromTimeTicket(pbStyleOperation.getExecutedAt())); } + else if (pbOperation.hasIncrease()) { + const pbIncreaseOperation = pbOperation.getIncrease(); + operation = _document_operation_increase_operation__WEBPACK_IMPORTED_MODULE_25__["IncreaseOperation"].create(fromTimeTicket(pbIncreaseOperation.getParentCreatedAt()), fromJSONElementSimple(pbIncreaseOperation.getValue()), fromTimeTicket(pbIncreaseOperation.getExecutedAt())); + } else { throw new _util_error__WEBPACK_IMPORTED_MODULE_1__["YorkieError"](_util_error__WEBPACK_IMPORTED_MODULE_1__["Code"].Unimplemented, `unimplemented operation`); } @@ -4749,6 +4811,11 @@ function fromJSONRichText(pbText) { text.remove(fromTimeTicket(pbText.getRemovedAt())); return text; } +function fromCounter(pbCounter) { + const counter = _document_json_counter__WEBPACK_IMPORTED_MODULE_26__["Counter"].of(_document_json_counter__WEBPACK_IMPORTED_MODULE_26__["Counter"].valueFromBytes(fromCounterType(pbCounter.getType()), pbCounter.getValue_asU8()), fromTimeTicket(pbCounter.getCreatedAt())); + counter.remove(fromTimeTicket(pbCounter.getRemovedAt())); + return counter; +} function fromJSONElement(pbJSONElement) { if (pbJSONElement.hasObject()) { return fromJSONObject(pbJSONElement.getObject()); @@ -4765,6 +4832,9 @@ function fromJSONElement(pbJSONElement) { else if (pbJSONElement.hasRichText()) { return fromJSONRichText(pbJSONElement.getRichText()); } + else if (pbJSONElement.hasCounter()) { + return fromCounter(pbJSONElement.getCounter()); + } else { throw new _util_error__WEBPACK_IMPORTED_MODULE_1__["YorkieError"](_util_error__WEBPACK_IMPORTED_MODULE_1__["Code"].Unimplemented, `unimplemented element: ${pbJSONElement}`); } @@ -5390,6 +5460,7 @@ goog.exportSymbol('proto.api.EventType', null, global); goog.exportSymbol('proto.api.JSONElement', null, global); goog.exportSymbol('proto.api.JSONElement.Array', null, global); goog.exportSymbol('proto.api.JSONElement.BodyCase', null, global); +goog.exportSymbol('proto.api.JSONElement.Counter', null, global); goog.exportSymbol('proto.api.JSONElement.Object', null, global); goog.exportSymbol('proto.api.JSONElement.Primitive', null, global); goog.exportSymbol('proto.api.JSONElement.RichText', null, global); @@ -5399,6 +5470,7 @@ goog.exportSymbol('proto.api.Operation', null, global); goog.exportSymbol('proto.api.Operation.Add', null, global); goog.exportSymbol('proto.api.Operation.BodyCase', null, global); goog.exportSymbol('proto.api.Operation.Edit', null, global); +goog.exportSymbol('proto.api.Operation.Increase', null, global); goog.exportSymbol('proto.api.Operation.Move', null, global); goog.exportSymbol('proto.api.Operation.Remove', null, global); goog.exportSymbol('proto.api.Operation.RichEdit', null, global); @@ -6010,6 +6082,27 @@ if (goog.DEBUG && !COMPILED) { */ proto.api.Operation.Style.displayName = 'proto.api.Operation.Style'; } +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.api.Operation.Increase = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.api.Operation.Increase, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.api.Operation.Increase.displayName = 'proto.api.Operation.Increase'; +} /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -6157,6 +6250,27 @@ if (goog.DEBUG && !COMPILED) { */ proto.api.JSONElement.RichText.displayName = 'proto.api.JSONElement.RichText'; } +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.api.JSONElement.Counter = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.api.JSONElement.Counter, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.api.JSONElement.Counter.displayName = 'proto.api.JSONElement.Counter'; +} /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -10173,7 +10287,7 @@ proto.api.ChangeID.prototype.setActorId = function(value) { * @private {!Array>} * @const */ -proto.api.Operation.oneofGroups_ = [[1,2,3,4,5,6,7,8]]; +proto.api.Operation.oneofGroups_ = [[1,2,3,4,5,6,7,8,9]]; /** * @enum {number} @@ -10187,7 +10301,8 @@ proto.api.Operation.BodyCase = { EDIT: 5, SELECT: 6, RICH_EDIT: 7, - STYLE: 8 + STYLE: 8, + INCREASE: 9 }; /** @@ -10235,7 +10350,8 @@ proto.api.Operation.toObject = function(includeInstance, msg) { edit: (f = msg.getEdit()) && proto.api.Operation.Edit.toObject(includeInstance, f), select: (f = msg.getSelect()) && proto.api.Operation.Select.toObject(includeInstance, f), richEdit: (f = msg.getRichEdit()) && proto.api.Operation.RichEdit.toObject(includeInstance, f), - style: (f = msg.getStyle()) && proto.api.Operation.Style.toObject(includeInstance, f) + style: (f = msg.getStyle()) && proto.api.Operation.Style.toObject(includeInstance, f), + increase: (f = msg.getIncrease()) && proto.api.Operation.Increase.toObject(includeInstance, f) }; if (includeInstance) { @@ -10312,6 +10428,11 @@ proto.api.Operation.deserializeBinaryFromReader = function(msg, reader) { reader.readMessage(value,proto.api.Operation.Style.deserializeBinaryFromReader); msg.setStyle(value); break; + case 9: + var value = new proto.api.Operation.Increase; + reader.readMessage(value,proto.api.Operation.Increase.deserializeBinaryFromReader); + msg.setIncrease(value); + break; default: reader.skipField(); break; @@ -10405,6 +10526,14 @@ proto.api.Operation.serializeBinaryToWriter = function(message, writer) { proto.api.Operation.Style.serializeBinaryToWriter ); } + f = message.getIncrease(); + if (f != null) { + writer.writeMessage( + 9, + f, + proto.api.Operation.Increase.serializeBinaryToWriter + ); + } }; @@ -12960,68 +13089,173 @@ proto.api.Operation.Style.prototype.hasExecutedAt = function() { }; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { /** - * optional Set set = 1; - * @return {?proto.api.Operation.Set} + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} */ -proto.api.Operation.prototype.getSet = function() { - return /** @type{?proto.api.Operation.Set} */ ( - jspb.Message.getWrapperField(this, proto.api.Operation.Set, 1)); +proto.api.Operation.Increase.prototype.toObject = function(opt_includeInstance) { + return proto.api.Operation.Increase.toObject(opt_includeInstance, this); }; /** - * @param {?proto.api.Operation.Set|undefined} value - * @return {!proto.api.Operation} returns this -*/ -proto.api.Operation.prototype.setSet = function(value) { - return jspb.Message.setOneofWrapperField(this, 1, proto.api.Operation.oneofGroups_[0], value); + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.api.Operation.Increase} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.Operation.Increase.toObject = function(includeInstance, msg) { + var f, obj = { + parentCreatedAt: (f = msg.getParentCreatedAt()) && proto.api.TimeTicket.toObject(includeInstance, f), + value: (f = msg.getValue()) && proto.api.JSONElementSimple.toObject(includeInstance, f), + executedAt: (f = msg.getExecutedAt()) && proto.api.TimeTicket.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; }; +} /** - * Clears the message field making it undefined. - * @return {!proto.api.Operation} returns this + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.api.Operation.Increase} */ -proto.api.Operation.prototype.clearSet = function() { - return this.setSet(undefined); +proto.api.Operation.Increase.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.api.Operation.Increase; + return proto.api.Operation.Increase.deserializeBinaryFromReader(msg, reader); }; /** - * Returns whether this field is set. - * @return {boolean} + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.api.Operation.Increase} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.api.Operation.Increase} */ -proto.api.Operation.prototype.hasSet = function() { - return jspb.Message.getField(this, 1) != null; +proto.api.Operation.Increase.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.api.TimeTicket; + reader.readMessage(value,proto.api.TimeTicket.deserializeBinaryFromReader); + msg.setParentCreatedAt(value); + break; + case 2: + var value = new proto.api.JSONElementSimple; + reader.readMessage(value,proto.api.JSONElementSimple.deserializeBinaryFromReader); + msg.setValue(value); + break; + case 3: + var value = new proto.api.TimeTicket; + reader.readMessage(value,proto.api.TimeTicket.deserializeBinaryFromReader); + msg.setExecutedAt(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; }; /** - * optional Add add = 2; - * @return {?proto.api.Operation.Add} + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} */ -proto.api.Operation.prototype.getAdd = function() { - return /** @type{?proto.api.Operation.Add} */ ( - jspb.Message.getWrapperField(this, proto.api.Operation.Add, 2)); +proto.api.Operation.Increase.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.api.Operation.Increase.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); }; /** - * @param {?proto.api.Operation.Add|undefined} value - * @return {!proto.api.Operation} returns this + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.api.Operation.Increase} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.Operation.Increase.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getParentCreatedAt(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.api.TimeTicket.serializeBinaryToWriter + ); + } + f = message.getValue(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.api.JSONElementSimple.serializeBinaryToWriter + ); + } + f = message.getExecutedAt(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.api.TimeTicket.serializeBinaryToWriter + ); + } +}; + + +/** + * optional TimeTicket parent_created_at = 1; + * @return {?proto.api.TimeTicket} + */ +proto.api.Operation.Increase.prototype.getParentCreatedAt = function() { + return /** @type{?proto.api.TimeTicket} */ ( + jspb.Message.getWrapperField(this, proto.api.TimeTicket, 1)); +}; + + +/** + * @param {?proto.api.TimeTicket|undefined} value + * @return {!proto.api.Operation.Increase} returns this */ -proto.api.Operation.prototype.setAdd = function(value) { - return jspb.Message.setOneofWrapperField(this, 2, proto.api.Operation.oneofGroups_[0], value); +proto.api.Operation.Increase.prototype.setParentCreatedAt = function(value) { + return jspb.Message.setWrapperField(this, 1, value); }; /** * Clears the message field making it undefined. - * @return {!proto.api.Operation} returns this + * @return {!proto.api.Operation.Increase} returns this */ -proto.api.Operation.prototype.clearAdd = function() { - return this.setAdd(undefined); +proto.api.Operation.Increase.prototype.clearParentCreatedAt = function() { + return this.setParentCreatedAt(undefined); }; @@ -13029,36 +13263,36 @@ proto.api.Operation.prototype.clearAdd = function() { * Returns whether this field is set. * @return {boolean} */ -proto.api.Operation.prototype.hasAdd = function() { - return jspb.Message.getField(this, 2) != null; +proto.api.Operation.Increase.prototype.hasParentCreatedAt = function() { + return jspb.Message.getField(this, 1) != null; }; /** - * optional Move move = 3; - * @return {?proto.api.Operation.Move} + * optional JSONElementSimple value = 2; + * @return {?proto.api.JSONElementSimple} */ -proto.api.Operation.prototype.getMove = function() { - return /** @type{?proto.api.Operation.Move} */ ( - jspb.Message.getWrapperField(this, proto.api.Operation.Move, 3)); +proto.api.Operation.Increase.prototype.getValue = function() { + return /** @type{?proto.api.JSONElementSimple} */ ( + jspb.Message.getWrapperField(this, proto.api.JSONElementSimple, 2)); }; /** - * @param {?proto.api.Operation.Move|undefined} value - * @return {!proto.api.Operation} returns this + * @param {?proto.api.JSONElementSimple|undefined} value + * @return {!proto.api.Operation.Increase} returns this */ -proto.api.Operation.prototype.setMove = function(value) { - return jspb.Message.setOneofWrapperField(this, 3, proto.api.Operation.oneofGroups_[0], value); +proto.api.Operation.Increase.prototype.setValue = function(value) { + return jspb.Message.setWrapperField(this, 2, value); }; /** * Clears the message field making it undefined. - * @return {!proto.api.Operation} returns this + * @return {!proto.api.Operation.Increase} returns this */ -proto.api.Operation.prototype.clearMove = function() { - return this.setMove(undefined); +proto.api.Operation.Increase.prototype.clearValue = function() { + return this.setValue(undefined); }; @@ -13066,36 +13300,36 @@ proto.api.Operation.prototype.clearMove = function() { * Returns whether this field is set. * @return {boolean} */ -proto.api.Operation.prototype.hasMove = function() { - return jspb.Message.getField(this, 3) != null; +proto.api.Operation.Increase.prototype.hasValue = function() { + return jspb.Message.getField(this, 2) != null; }; /** - * optional Remove remove = 4; - * @return {?proto.api.Operation.Remove} + * optional TimeTicket executed_at = 3; + * @return {?proto.api.TimeTicket} */ -proto.api.Operation.prototype.getRemove = function() { - return /** @type{?proto.api.Operation.Remove} */ ( - jspb.Message.getWrapperField(this, proto.api.Operation.Remove, 4)); +proto.api.Operation.Increase.prototype.getExecutedAt = function() { + return /** @type{?proto.api.TimeTicket} */ ( + jspb.Message.getWrapperField(this, proto.api.TimeTicket, 3)); }; /** - * @param {?proto.api.Operation.Remove|undefined} value - * @return {!proto.api.Operation} returns this + * @param {?proto.api.TimeTicket|undefined} value + * @return {!proto.api.Operation.Increase} returns this */ -proto.api.Operation.prototype.setRemove = function(value) { - return jspb.Message.setOneofWrapperField(this, 4, proto.api.Operation.oneofGroups_[0], value); +proto.api.Operation.Increase.prototype.setExecutedAt = function(value) { + return jspb.Message.setWrapperField(this, 3, value); }; /** * Clears the message field making it undefined. - * @return {!proto.api.Operation} returns this + * @return {!proto.api.Operation.Increase} returns this */ -proto.api.Operation.prototype.clearRemove = function() { - return this.setRemove(undefined); +proto.api.Operation.Increase.prototype.clearExecutedAt = function() { + return this.setExecutedAt(undefined); }; @@ -13103,14 +13337,162 @@ proto.api.Operation.prototype.clearRemove = function() { * Returns whether this field is set. * @return {boolean} */ -proto.api.Operation.prototype.hasRemove = function() { - return jspb.Message.getField(this, 4) != null; +proto.api.Operation.Increase.prototype.hasExecutedAt = function() { + return jspb.Message.getField(this, 3) != null; }; /** - * optional Edit edit = 5; - * @return {?proto.api.Operation.Edit} + * optional Set set = 1; + * @return {?proto.api.Operation.Set} + */ +proto.api.Operation.prototype.getSet = function() { + return /** @type{?proto.api.Operation.Set} */ ( + jspb.Message.getWrapperField(this, proto.api.Operation.Set, 1)); +}; + + +/** + * @param {?proto.api.Operation.Set|undefined} value + * @return {!proto.api.Operation} returns this +*/ +proto.api.Operation.prototype.setSet = function(value) { + return jspb.Message.setOneofWrapperField(this, 1, proto.api.Operation.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.api.Operation} returns this + */ +proto.api.Operation.prototype.clearSet = function() { + return this.setSet(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.api.Operation.prototype.hasSet = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional Add add = 2; + * @return {?proto.api.Operation.Add} + */ +proto.api.Operation.prototype.getAdd = function() { + return /** @type{?proto.api.Operation.Add} */ ( + jspb.Message.getWrapperField(this, proto.api.Operation.Add, 2)); +}; + + +/** + * @param {?proto.api.Operation.Add|undefined} value + * @return {!proto.api.Operation} returns this +*/ +proto.api.Operation.prototype.setAdd = function(value) { + return jspb.Message.setOneofWrapperField(this, 2, proto.api.Operation.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.api.Operation} returns this + */ +proto.api.Operation.prototype.clearAdd = function() { + return this.setAdd(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.api.Operation.prototype.hasAdd = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional Move move = 3; + * @return {?proto.api.Operation.Move} + */ +proto.api.Operation.prototype.getMove = function() { + return /** @type{?proto.api.Operation.Move} */ ( + jspb.Message.getWrapperField(this, proto.api.Operation.Move, 3)); +}; + + +/** + * @param {?proto.api.Operation.Move|undefined} value + * @return {!proto.api.Operation} returns this +*/ +proto.api.Operation.prototype.setMove = function(value) { + return jspb.Message.setOneofWrapperField(this, 3, proto.api.Operation.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.api.Operation} returns this + */ +proto.api.Operation.prototype.clearMove = function() { + return this.setMove(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.api.Operation.prototype.hasMove = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * optional Remove remove = 4; + * @return {?proto.api.Operation.Remove} + */ +proto.api.Operation.prototype.getRemove = function() { + return /** @type{?proto.api.Operation.Remove} */ ( + jspb.Message.getWrapperField(this, proto.api.Operation.Remove, 4)); +}; + + +/** + * @param {?proto.api.Operation.Remove|undefined} value + * @return {!proto.api.Operation} returns this +*/ +proto.api.Operation.prototype.setRemove = function(value) { + return jspb.Message.setOneofWrapperField(this, 4, proto.api.Operation.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.api.Operation} returns this + */ +proto.api.Operation.prototype.clearRemove = function() { + return this.setRemove(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.api.Operation.prototype.hasRemove = function() { + return jspb.Message.getField(this, 4) != null; +}; + + +/** + * optional Edit edit = 5; + * @return {?proto.api.Operation.Edit} */ proto.api.Operation.prototype.getEdit = function() { return /** @type{?proto.api.Operation.Edit} */ ( @@ -13256,6 +13638,43 @@ proto.api.Operation.prototype.hasStyle = function() { }; +/** + * optional Increase increase = 9; + * @return {?proto.api.Operation.Increase} + */ +proto.api.Operation.prototype.getIncrease = function() { + return /** @type{?proto.api.Operation.Increase} */ ( + jspb.Message.getWrapperField(this, proto.api.Operation.Increase, 9)); +}; + + +/** + * @param {?proto.api.Operation.Increase|undefined} value + * @return {!proto.api.Operation} returns this +*/ +proto.api.Operation.prototype.setIncrease = function(value) { + return jspb.Message.setOneofWrapperField(this, 9, proto.api.Operation.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.api.Operation} returns this + */ +proto.api.Operation.prototype.clearIncrease = function() { + return this.setIncrease(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.api.Operation.prototype.hasIncrease = function() { + return jspb.Message.getField(this, 9) != null; +}; + + @@ -13289,7 +13708,7 @@ proto.api.JSONElementSimple.prototype.toObject = function(opt_includeInstance) { proto.api.JSONElementSimple.toObject = function(includeInstance, msg) { var f, obj = { createdAt: (f = msg.getCreatedAt()) && proto.api.TimeTicket.toObject(includeInstance, f), - updatedAt: (f = msg.getUpdatedAt()) && proto.api.TimeTicket.toObject(includeInstance, f), + movedAt: (f = msg.getMovedAt()) && proto.api.TimeTicket.toObject(includeInstance, f), removedAt: (f = msg.getRemovedAt()) && proto.api.TimeTicket.toObject(includeInstance, f), type: jspb.Message.getFieldWithDefault(msg, 4, 0), value: msg.getValue_asB64() @@ -13337,7 +13756,7 @@ proto.api.JSONElementSimple.deserializeBinaryFromReader = function(msg, reader) case 2: var value = new proto.api.TimeTicket; reader.readMessage(value,proto.api.TimeTicket.deserializeBinaryFromReader); - msg.setUpdatedAt(value); + msg.setMovedAt(value); break; case 3: var value = new proto.api.TimeTicket; @@ -13389,7 +13808,7 @@ proto.api.JSONElementSimple.serializeBinaryToWriter = function(message, writer) proto.api.TimeTicket.serializeBinaryToWriter ); } - f = message.getUpdatedAt(); + f = message.getMovedAt(); if (f != null) { writer.writeMessage( 2, @@ -13460,10 +13879,10 @@ proto.api.JSONElementSimple.prototype.hasCreatedAt = function() { /** - * optional TimeTicket updated_at = 2; + * optional TimeTicket moved_at = 2; * @return {?proto.api.TimeTicket} */ -proto.api.JSONElementSimple.prototype.getUpdatedAt = function() { +proto.api.JSONElementSimple.prototype.getMovedAt = function() { return /** @type{?proto.api.TimeTicket} */ ( jspb.Message.getWrapperField(this, proto.api.TimeTicket, 2)); }; @@ -13473,7 +13892,7 @@ proto.api.JSONElementSimple.prototype.getUpdatedAt = function() { * @param {?proto.api.TimeTicket|undefined} value * @return {!proto.api.JSONElementSimple} returns this */ -proto.api.JSONElementSimple.prototype.setUpdatedAt = function(value) { +proto.api.JSONElementSimple.prototype.setMovedAt = function(value) { return jspb.Message.setWrapperField(this, 2, value); }; @@ -13482,8 +13901,8 @@ proto.api.JSONElementSimple.prototype.setUpdatedAt = function(value) { * Clears the message field making it undefined. * @return {!proto.api.JSONElementSimple} returns this */ -proto.api.JSONElementSimple.prototype.clearUpdatedAt = function() { - return this.setUpdatedAt(undefined); +proto.api.JSONElementSimple.prototype.clearMovedAt = function() { + return this.setMovedAt(undefined); }; @@ -13491,7 +13910,7 @@ proto.api.JSONElementSimple.prototype.clearUpdatedAt = function() { * Returns whether this field is set. * @return {boolean} */ -proto.api.JSONElementSimple.prototype.hasUpdatedAt = function() { +proto.api.JSONElementSimple.prototype.hasMovedAt = function() { return jspb.Message.getField(this, 2) != null; }; @@ -13602,7 +14021,7 @@ proto.api.JSONElementSimple.prototype.setValue = function(value) { * @private {!Array>} * @const */ -proto.api.JSONElement.oneofGroups_ = [[1,2,3,4,5]]; +proto.api.JSONElement.oneofGroups_ = [[1,2,3,4,5,6]]; /** * @enum {number} @@ -13613,7 +14032,8 @@ proto.api.JSONElement.BodyCase = { ARRAY: 2, PRIMITIVE: 3, TEXT: 4, - RICH_TEXT: 5 + RICH_TEXT: 5, + COUNTER: 6 }; /** @@ -13658,7 +14078,8 @@ proto.api.JSONElement.toObject = function(includeInstance, msg) { array: (f = msg.getArray()) && proto.api.JSONElement.Array.toObject(includeInstance, f), primitive: (f = msg.getPrimitive()) && proto.api.JSONElement.Primitive.toObject(includeInstance, f), text: (f = msg.getText()) && proto.api.JSONElement.Text.toObject(includeInstance, f), - richText: (f = msg.getRichText()) && proto.api.JSONElement.RichText.toObject(includeInstance, f) + richText: (f = msg.getRichText()) && proto.api.JSONElement.RichText.toObject(includeInstance, f), + counter: (f = msg.getCounter()) && proto.api.JSONElement.Counter.toObject(includeInstance, f) }; if (includeInstance) { @@ -13720,6 +14141,11 @@ proto.api.JSONElement.deserializeBinaryFromReader = function(msg, reader) { reader.readMessage(value,proto.api.JSONElement.RichText.deserializeBinaryFromReader); msg.setRichText(value); break; + case 6: + var value = new proto.api.JSONElement.Counter; + reader.readMessage(value,proto.api.JSONElement.Counter.deserializeBinaryFromReader); + msg.setCounter(value); + break; default: reader.skipField(); break; @@ -13789,6 +14215,14 @@ proto.api.JSONElement.serializeBinaryToWriter = function(message, writer) { proto.api.JSONElement.RichText.serializeBinaryToWriter ); } + f = message.getCounter(); + if (f != null) { + writer.writeMessage( + 6, + f, + proto.api.JSONElement.Counter.serializeBinaryToWriter + ); + } }; @@ -13834,7 +14268,7 @@ proto.api.JSONElement.Object.toObject = function(includeInstance, msg) { nodesList: jspb.Message.toObjectList(msg.getNodesList(), proto.api.RHTNode.toObject, includeInstance), createdAt: (f = msg.getCreatedAt()) && proto.api.TimeTicket.toObject(includeInstance, f), - updatedAt: (f = msg.getUpdatedAt()) && proto.api.TimeTicket.toObject(includeInstance, f), + movedAt: (f = msg.getMovedAt()) && proto.api.TimeTicket.toObject(includeInstance, f), removedAt: (f = msg.getRemovedAt()) && proto.api.TimeTicket.toObject(includeInstance, f) }; @@ -13885,7 +14319,7 @@ proto.api.JSONElement.Object.deserializeBinaryFromReader = function(msg, reader) case 3: var value = new proto.api.TimeTicket; reader.readMessage(value,proto.api.TimeTicket.deserializeBinaryFromReader); - msg.setUpdatedAt(value); + msg.setMovedAt(value); break; case 4: var value = new proto.api.TimeTicket; @@ -13937,7 +14371,7 @@ proto.api.JSONElement.Object.serializeBinaryToWriter = function(message, writer) proto.api.TimeTicket.serializeBinaryToWriter ); } - f = message.getUpdatedAt(); + f = message.getMovedAt(); if (f != null) { writer.writeMessage( 3, @@ -14032,10 +14466,10 @@ proto.api.JSONElement.Object.prototype.hasCreatedAt = function() { /** - * optional TimeTicket updated_at = 3; + * optional TimeTicket moved_at = 3; * @return {?proto.api.TimeTicket} */ -proto.api.JSONElement.Object.prototype.getUpdatedAt = function() { +proto.api.JSONElement.Object.prototype.getMovedAt = function() { return /** @type{?proto.api.TimeTicket} */ ( jspb.Message.getWrapperField(this, proto.api.TimeTicket, 3)); }; @@ -14045,7 +14479,7 @@ proto.api.JSONElement.Object.prototype.getUpdatedAt = function() { * @param {?proto.api.TimeTicket|undefined} value * @return {!proto.api.JSONElement.Object} returns this */ -proto.api.JSONElement.Object.prototype.setUpdatedAt = function(value) { +proto.api.JSONElement.Object.prototype.setMovedAt = function(value) { return jspb.Message.setWrapperField(this, 3, value); }; @@ -14054,8 +14488,8 @@ proto.api.JSONElement.Object.prototype.setUpdatedAt = function(value) { * Clears the message field making it undefined. * @return {!proto.api.JSONElement.Object} returns this */ -proto.api.JSONElement.Object.prototype.clearUpdatedAt = function() { - return this.setUpdatedAt(undefined); +proto.api.JSONElement.Object.prototype.clearMovedAt = function() { + return this.setMovedAt(undefined); }; @@ -14063,7 +14497,7 @@ proto.api.JSONElement.Object.prototype.clearUpdatedAt = function() { * Returns whether this field is set. * @return {boolean} */ -proto.api.JSONElement.Object.prototype.hasUpdatedAt = function() { +proto.api.JSONElement.Object.prototype.hasMovedAt = function() { return jspb.Message.getField(this, 3) != null; }; @@ -14147,7 +14581,7 @@ proto.api.JSONElement.Array.toObject = function(includeInstance, msg) { nodesList: jspb.Message.toObjectList(msg.getNodesList(), proto.api.RGANode.toObject, includeInstance), createdAt: (f = msg.getCreatedAt()) && proto.api.TimeTicket.toObject(includeInstance, f), - updatedAt: (f = msg.getUpdatedAt()) && proto.api.TimeTicket.toObject(includeInstance, f), + movedAt: (f = msg.getMovedAt()) && proto.api.TimeTicket.toObject(includeInstance, f), removedAt: (f = msg.getRemovedAt()) && proto.api.TimeTicket.toObject(includeInstance, f) }; @@ -14198,7 +14632,7 @@ proto.api.JSONElement.Array.deserializeBinaryFromReader = function(msg, reader) case 3: var value = new proto.api.TimeTicket; reader.readMessage(value,proto.api.TimeTicket.deserializeBinaryFromReader); - msg.setUpdatedAt(value); + msg.setMovedAt(value); break; case 4: var value = new proto.api.TimeTicket; @@ -14250,7 +14684,7 @@ proto.api.JSONElement.Array.serializeBinaryToWriter = function(message, writer) proto.api.TimeTicket.serializeBinaryToWriter ); } - f = message.getUpdatedAt(); + f = message.getMovedAt(); if (f != null) { writer.writeMessage( 3, @@ -14345,10 +14779,10 @@ proto.api.JSONElement.Array.prototype.hasCreatedAt = function() { /** - * optional TimeTicket updated_at = 3; + * optional TimeTicket moved_at = 3; * @return {?proto.api.TimeTicket} */ -proto.api.JSONElement.Array.prototype.getUpdatedAt = function() { +proto.api.JSONElement.Array.prototype.getMovedAt = function() { return /** @type{?proto.api.TimeTicket} */ ( jspb.Message.getWrapperField(this, proto.api.TimeTicket, 3)); }; @@ -14358,7 +14792,7 @@ proto.api.JSONElement.Array.prototype.getUpdatedAt = function() { * @param {?proto.api.TimeTicket|undefined} value * @return {!proto.api.JSONElement.Array} returns this */ -proto.api.JSONElement.Array.prototype.setUpdatedAt = function(value) { +proto.api.JSONElement.Array.prototype.setMovedAt = function(value) { return jspb.Message.setWrapperField(this, 3, value); }; @@ -14367,8 +14801,8 @@ proto.api.JSONElement.Array.prototype.setUpdatedAt = function(value) { * Clears the message field making it undefined. * @return {!proto.api.JSONElement.Array} returns this */ -proto.api.JSONElement.Array.prototype.clearUpdatedAt = function() { - return this.setUpdatedAt(undefined); +proto.api.JSONElement.Array.prototype.clearMovedAt = function() { + return this.setMovedAt(undefined); }; @@ -14376,7 +14810,7 @@ proto.api.JSONElement.Array.prototype.clearUpdatedAt = function() { * Returns whether this field is set. * @return {boolean} */ -proto.api.JSONElement.Array.prototype.hasUpdatedAt = function() { +proto.api.JSONElement.Array.prototype.hasMovedAt = function() { return jspb.Message.getField(this, 3) != null; }; @@ -14453,7 +14887,7 @@ proto.api.JSONElement.Primitive.toObject = function(includeInstance, msg) { type: jspb.Message.getFieldWithDefault(msg, 1, 0), value: msg.getValue_asB64(), createdAt: (f = msg.getCreatedAt()) && proto.api.TimeTicket.toObject(includeInstance, f), - updatedAt: (f = msg.getUpdatedAt()) && proto.api.TimeTicket.toObject(includeInstance, f), + movedAt: (f = msg.getMovedAt()) && proto.api.TimeTicket.toObject(includeInstance, f), removedAt: (f = msg.getRemovedAt()) && proto.api.TimeTicket.toObject(includeInstance, f) }; @@ -14507,7 +14941,7 @@ proto.api.JSONElement.Primitive.deserializeBinaryFromReader = function(msg, read case 4: var value = new proto.api.TimeTicket; reader.readMessage(value,proto.api.TimeTicket.deserializeBinaryFromReader); - msg.setUpdatedAt(value); + msg.setMovedAt(value); break; case 5: var value = new proto.api.TimeTicket; @@ -14565,7 +14999,7 @@ proto.api.JSONElement.Primitive.serializeBinaryToWriter = function(message, writ proto.api.TimeTicket.serializeBinaryToWriter ); } - f = message.getUpdatedAt(); + f = message.getMovedAt(); if (f != null) { writer.writeMessage( 4, @@ -14682,10 +15116,10 @@ proto.api.JSONElement.Primitive.prototype.hasCreatedAt = function() { /** - * optional TimeTicket updated_at = 4; + * optional TimeTicket moved_at = 4; * @return {?proto.api.TimeTicket} */ -proto.api.JSONElement.Primitive.prototype.getUpdatedAt = function() { +proto.api.JSONElement.Primitive.prototype.getMovedAt = function() { return /** @type{?proto.api.TimeTicket} */ ( jspb.Message.getWrapperField(this, proto.api.TimeTicket, 4)); }; @@ -14695,7 +15129,7 @@ proto.api.JSONElement.Primitive.prototype.getUpdatedAt = function() { * @param {?proto.api.TimeTicket|undefined} value * @return {!proto.api.JSONElement.Primitive} returns this */ -proto.api.JSONElement.Primitive.prototype.setUpdatedAt = function(value) { +proto.api.JSONElement.Primitive.prototype.setMovedAt = function(value) { return jspb.Message.setWrapperField(this, 4, value); }; @@ -14704,8 +15138,8 @@ proto.api.JSONElement.Primitive.prototype.setUpdatedAt = function(value) { * Clears the message field making it undefined. * @return {!proto.api.JSONElement.Primitive} returns this */ -proto.api.JSONElement.Primitive.prototype.clearUpdatedAt = function() { - return this.setUpdatedAt(undefined); +proto.api.JSONElement.Primitive.prototype.clearMovedAt = function() { + return this.setMovedAt(undefined); }; @@ -14713,7 +15147,7 @@ proto.api.JSONElement.Primitive.prototype.clearUpdatedAt = function() { * Returns whether this field is set. * @return {boolean} */ -proto.api.JSONElement.Primitive.prototype.hasUpdatedAt = function() { +proto.api.JSONElement.Primitive.prototype.hasMovedAt = function() { return jspb.Message.getField(this, 4) != null; }; @@ -14797,7 +15231,7 @@ proto.api.JSONElement.Text.toObject = function(includeInstance, msg) { nodesList: jspb.Message.toObjectList(msg.getNodesList(), proto.api.TextNode.toObject, includeInstance), createdAt: (f = msg.getCreatedAt()) && proto.api.TimeTicket.toObject(includeInstance, f), - updatedAt: (f = msg.getUpdatedAt()) && proto.api.TimeTicket.toObject(includeInstance, f), + movedAt: (f = msg.getMovedAt()) && proto.api.TimeTicket.toObject(includeInstance, f), removedAt: (f = msg.getRemovedAt()) && proto.api.TimeTicket.toObject(includeInstance, f) }; @@ -14848,7 +15282,7 @@ proto.api.JSONElement.Text.deserializeBinaryFromReader = function(msg, reader) { case 3: var value = new proto.api.TimeTicket; reader.readMessage(value,proto.api.TimeTicket.deserializeBinaryFromReader); - msg.setUpdatedAt(value); + msg.setMovedAt(value); break; case 4: var value = new proto.api.TimeTicket; @@ -14900,7 +15334,7 @@ proto.api.JSONElement.Text.serializeBinaryToWriter = function(message, writer) { proto.api.TimeTicket.serializeBinaryToWriter ); } - f = message.getUpdatedAt(); + f = message.getMovedAt(); if (f != null) { writer.writeMessage( 3, @@ -14995,10 +15429,10 @@ proto.api.JSONElement.Text.prototype.hasCreatedAt = function() { /** - * optional TimeTicket updated_at = 3; + * optional TimeTicket moved_at = 3; * @return {?proto.api.TimeTicket} */ -proto.api.JSONElement.Text.prototype.getUpdatedAt = function() { +proto.api.JSONElement.Text.prototype.getMovedAt = function() { return /** @type{?proto.api.TimeTicket} */ ( jspb.Message.getWrapperField(this, proto.api.TimeTicket, 3)); }; @@ -15008,7 +15442,7 @@ proto.api.JSONElement.Text.prototype.getUpdatedAt = function() { * @param {?proto.api.TimeTicket|undefined} value * @return {!proto.api.JSONElement.Text} returns this */ -proto.api.JSONElement.Text.prototype.setUpdatedAt = function(value) { +proto.api.JSONElement.Text.prototype.setMovedAt = function(value) { return jspb.Message.setWrapperField(this, 3, value); }; @@ -15017,8 +15451,8 @@ proto.api.JSONElement.Text.prototype.setUpdatedAt = function(value) { * Clears the message field making it undefined. * @return {!proto.api.JSONElement.Text} returns this */ -proto.api.JSONElement.Text.prototype.clearUpdatedAt = function() { - return this.setUpdatedAt(undefined); +proto.api.JSONElement.Text.prototype.clearMovedAt = function() { + return this.setMovedAt(undefined); }; @@ -15026,7 +15460,7 @@ proto.api.JSONElement.Text.prototype.clearUpdatedAt = function() { * Returns whether this field is set. * @return {boolean} */ -proto.api.JSONElement.Text.prototype.hasUpdatedAt = function() { +proto.api.JSONElement.Text.prototype.hasMovedAt = function() { return jspb.Message.getField(this, 3) != null; }; @@ -15110,7 +15544,7 @@ proto.api.JSONElement.RichText.toObject = function(includeInstance, msg) { nodesList: jspb.Message.toObjectList(msg.getNodesList(), proto.api.RichTextNode.toObject, includeInstance), createdAt: (f = msg.getCreatedAt()) && proto.api.TimeTicket.toObject(includeInstance, f), - updatedAt: (f = msg.getUpdatedAt()) && proto.api.TimeTicket.toObject(includeInstance, f), + movedAt: (f = msg.getMovedAt()) && proto.api.TimeTicket.toObject(includeInstance, f), removedAt: (f = msg.getRemovedAt()) && proto.api.TimeTicket.toObject(includeInstance, f) }; @@ -15161,7 +15595,7 @@ proto.api.JSONElement.RichText.deserializeBinaryFromReader = function(msg, reade case 3: var value = new proto.api.TimeTicket; reader.readMessage(value,proto.api.TimeTicket.deserializeBinaryFromReader); - msg.setUpdatedAt(value); + msg.setMovedAt(value); break; case 4: var value = new proto.api.TimeTicket; @@ -15213,7 +15647,7 @@ proto.api.JSONElement.RichText.serializeBinaryToWriter = function(message, write proto.api.TimeTicket.serializeBinaryToWriter ); } - f = message.getUpdatedAt(); + f = message.getMovedAt(); if (f != null) { writer.writeMessage( 3, @@ -15308,10 +15742,10 @@ proto.api.JSONElement.RichText.prototype.hasCreatedAt = function() { /** - * optional TimeTicket updated_at = 3; + * optional TimeTicket moved_at = 3; * @return {?proto.api.TimeTicket} */ -proto.api.JSONElement.RichText.prototype.getUpdatedAt = function() { +proto.api.JSONElement.RichText.prototype.getMovedAt = function() { return /** @type{?proto.api.TimeTicket} */ ( jspb.Message.getWrapperField(this, proto.api.TimeTicket, 3)); }; @@ -15321,7 +15755,7 @@ proto.api.JSONElement.RichText.prototype.getUpdatedAt = function() { * @param {?proto.api.TimeTicket|undefined} value * @return {!proto.api.JSONElement.RichText} returns this */ -proto.api.JSONElement.RichText.prototype.setUpdatedAt = function(value) { +proto.api.JSONElement.RichText.prototype.setMovedAt = function(value) { return jspb.Message.setWrapperField(this, 3, value); }; @@ -15330,8 +15764,8 @@ proto.api.JSONElement.RichText.prototype.setUpdatedAt = function(value) { * Clears the message field making it undefined. * @return {!proto.api.JSONElement.RichText} returns this */ -proto.api.JSONElement.RichText.prototype.clearUpdatedAt = function() { - return this.setUpdatedAt(undefined); +proto.api.JSONElement.RichText.prototype.clearMovedAt = function() { + return this.setMovedAt(undefined); }; @@ -15339,7 +15773,7 @@ proto.api.JSONElement.RichText.prototype.clearUpdatedAt = function() { * Returns whether this field is set. * @return {boolean} */ -proto.api.JSONElement.RichText.prototype.hasUpdatedAt = function() { +proto.api.JSONElement.RichText.prototype.hasMovedAt = function() { return jspb.Message.getField(this, 3) != null; }; @@ -15381,36 +15815,373 @@ proto.api.JSONElement.RichText.prototype.hasRemovedAt = function() { }; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { /** - * optional Object object = 1; - * @return {?proto.api.JSONElement.Object} + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} */ -proto.api.JSONElement.prototype.getObject = function() { - return /** @type{?proto.api.JSONElement.Object} */ ( - jspb.Message.getWrapperField(this, proto.api.JSONElement.Object, 1)); +proto.api.JSONElement.Counter.prototype.toObject = function(opt_includeInstance) { + return proto.api.JSONElement.Counter.toObject(opt_includeInstance, this); }; /** - * @param {?proto.api.JSONElement.Object|undefined} value - * @return {!proto.api.JSONElement} returns this -*/ -proto.api.JSONElement.prototype.setObject = function(value) { - return jspb.Message.setOneofWrapperField(this, 1, proto.api.JSONElement.oneofGroups_[0], value); + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.api.JSONElement.Counter} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.JSONElement.Counter.toObject = function(includeInstance, msg) { + var f, obj = { + type: jspb.Message.getFieldWithDefault(msg, 1, 0), + value: msg.getValue_asB64(), + createdAt: (f = msg.getCreatedAt()) && proto.api.TimeTicket.toObject(includeInstance, f), + movedAt: (f = msg.getMovedAt()) && proto.api.TimeTicket.toObject(includeInstance, f), + removedAt: (f = msg.getRemovedAt()) && proto.api.TimeTicket.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; }; +} /** - * Clears the message field making it undefined. - * @return {!proto.api.JSONElement} returns this + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.api.JSONElement.Counter} */ -proto.api.JSONElement.prototype.clearObject = function() { - return this.setObject(undefined); +proto.api.JSONElement.Counter.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.api.JSONElement.Counter; + return proto.api.JSONElement.Counter.deserializeBinaryFromReader(msg, reader); }; /** - * Returns whether this field is set. + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.api.JSONElement.Counter} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.api.JSONElement.Counter} + */ +proto.api.JSONElement.Counter.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!proto.api.ValueType} */ (reader.readEnum()); + msg.setType(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setValue(value); + break; + case 3: + var value = new proto.api.TimeTicket; + reader.readMessage(value,proto.api.TimeTicket.deserializeBinaryFromReader); + msg.setCreatedAt(value); + break; + case 4: + var value = new proto.api.TimeTicket; + reader.readMessage(value,proto.api.TimeTicket.deserializeBinaryFromReader); + msg.setMovedAt(value); + break; + case 5: + var value = new proto.api.TimeTicket; + reader.readMessage(value,proto.api.TimeTicket.deserializeBinaryFromReader); + msg.setRemovedAt(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.api.JSONElement.Counter.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.api.JSONElement.Counter.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.api.JSONElement.Counter} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.JSONElement.Counter.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getType(); + if (f !== 0.0) { + writer.writeEnum( + 1, + f + ); + } + f = message.getValue_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } + f = message.getCreatedAt(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.api.TimeTicket.serializeBinaryToWriter + ); + } + f = message.getMovedAt(); + if (f != null) { + writer.writeMessage( + 4, + f, + proto.api.TimeTicket.serializeBinaryToWriter + ); + } + f = message.getRemovedAt(); + if (f != null) { + writer.writeMessage( + 5, + f, + proto.api.TimeTicket.serializeBinaryToWriter + ); + } +}; + + +/** + * optional ValueType type = 1; + * @return {!proto.api.ValueType} + */ +proto.api.JSONElement.Counter.prototype.getType = function() { + return /** @type {!proto.api.ValueType} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {!proto.api.ValueType} value + * @return {!proto.api.JSONElement.Counter} returns this + */ +proto.api.JSONElement.Counter.prototype.setType = function(value) { + return jspb.Message.setProto3EnumField(this, 1, value); +}; + + +/** + * optional bytes value = 2; + * @return {string} + */ +proto.api.JSONElement.Counter.prototype.getValue = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes value = 2; + * This is a type-conversion wrapper around `getValue()` + * @return {string} + */ +proto.api.JSONElement.Counter.prototype.getValue_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getValue())); +}; + + +/** + * optional bytes value = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getValue()` + * @return {!Uint8Array} + */ +proto.api.JSONElement.Counter.prototype.getValue_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getValue())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.api.JSONElement.Counter} returns this + */ +proto.api.JSONElement.Counter.prototype.setValue = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); +}; + + +/** + * optional TimeTicket created_at = 3; + * @return {?proto.api.TimeTicket} + */ +proto.api.JSONElement.Counter.prototype.getCreatedAt = function() { + return /** @type{?proto.api.TimeTicket} */ ( + jspb.Message.getWrapperField(this, proto.api.TimeTicket, 3)); +}; + + +/** + * @param {?proto.api.TimeTicket|undefined} value + * @return {!proto.api.JSONElement.Counter} returns this +*/ +proto.api.JSONElement.Counter.prototype.setCreatedAt = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.api.JSONElement.Counter} returns this + */ +proto.api.JSONElement.Counter.prototype.clearCreatedAt = function() { + return this.setCreatedAt(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.api.JSONElement.Counter.prototype.hasCreatedAt = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * optional TimeTicket moved_at = 4; + * @return {?proto.api.TimeTicket} + */ +proto.api.JSONElement.Counter.prototype.getMovedAt = function() { + return /** @type{?proto.api.TimeTicket} */ ( + jspb.Message.getWrapperField(this, proto.api.TimeTicket, 4)); +}; + + +/** + * @param {?proto.api.TimeTicket|undefined} value + * @return {!proto.api.JSONElement.Counter} returns this +*/ +proto.api.JSONElement.Counter.prototype.setMovedAt = function(value) { + return jspb.Message.setWrapperField(this, 4, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.api.JSONElement.Counter} returns this + */ +proto.api.JSONElement.Counter.prototype.clearMovedAt = function() { + return this.setMovedAt(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.api.JSONElement.Counter.prototype.hasMovedAt = function() { + return jspb.Message.getField(this, 4) != null; +}; + + +/** + * optional TimeTicket removed_at = 5; + * @return {?proto.api.TimeTicket} + */ +proto.api.JSONElement.Counter.prototype.getRemovedAt = function() { + return /** @type{?proto.api.TimeTicket} */ ( + jspb.Message.getWrapperField(this, proto.api.TimeTicket, 5)); +}; + + +/** + * @param {?proto.api.TimeTicket|undefined} value + * @return {!proto.api.JSONElement.Counter} returns this +*/ +proto.api.JSONElement.Counter.prototype.setRemovedAt = function(value) { + return jspb.Message.setWrapperField(this, 5, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.api.JSONElement.Counter} returns this + */ +proto.api.JSONElement.Counter.prototype.clearRemovedAt = function() { + return this.setRemovedAt(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.api.JSONElement.Counter.prototype.hasRemovedAt = function() { + return jspb.Message.getField(this, 5) != null; +}; + + +/** + * optional Object object = 1; + * @return {?proto.api.JSONElement.Object} + */ +proto.api.JSONElement.prototype.getObject = function() { + return /** @type{?proto.api.JSONElement.Object} */ ( + jspb.Message.getWrapperField(this, proto.api.JSONElement.Object, 1)); +}; + + +/** + * @param {?proto.api.JSONElement.Object|undefined} value + * @return {!proto.api.JSONElement} returns this +*/ +proto.api.JSONElement.prototype.setObject = function(value) { + return jspb.Message.setOneofWrapperField(this, 1, proto.api.JSONElement.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.api.JSONElement} returns this + */ +proto.api.JSONElement.prototype.clearObject = function() { + return this.setObject(undefined); +}; + + +/** + * Returns whether this field is set. * @return {boolean} */ proto.api.JSONElement.prototype.hasObject = function() { @@ -15506,8 +16277,45 @@ proto.api.JSONElement.prototype.getText = function() { * @param {?proto.api.JSONElement.Text|undefined} value * @return {!proto.api.JSONElement} returns this */ -proto.api.JSONElement.prototype.setText = function(value) { - return jspb.Message.setOneofWrapperField(this, 4, proto.api.JSONElement.oneofGroups_[0], value); +proto.api.JSONElement.prototype.setText = function(value) { + return jspb.Message.setOneofWrapperField(this, 4, proto.api.JSONElement.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.api.JSONElement} returns this + */ +proto.api.JSONElement.prototype.clearText = function() { + return this.setText(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.api.JSONElement.prototype.hasText = function() { + return jspb.Message.getField(this, 4) != null; +}; + + +/** + * optional RichText rich_text = 5; + * @return {?proto.api.JSONElement.RichText} + */ +proto.api.JSONElement.prototype.getRichText = function() { + return /** @type{?proto.api.JSONElement.RichText} */ ( + jspb.Message.getWrapperField(this, proto.api.JSONElement.RichText, 5)); +}; + + +/** + * @param {?proto.api.JSONElement.RichText|undefined} value + * @return {!proto.api.JSONElement} returns this +*/ +proto.api.JSONElement.prototype.setRichText = function(value) { + return jspb.Message.setOneofWrapperField(this, 5, proto.api.JSONElement.oneofGroups_[0], value); }; @@ -15515,8 +16323,8 @@ proto.api.JSONElement.prototype.setText = function(value) { * Clears the message field making it undefined. * @return {!proto.api.JSONElement} returns this */ -proto.api.JSONElement.prototype.clearText = function() { - return this.setText(undefined); +proto.api.JSONElement.prototype.clearRichText = function() { + return this.setRichText(undefined); }; @@ -15524,27 +16332,27 @@ proto.api.JSONElement.prototype.clearText = function() { * Returns whether this field is set. * @return {boolean} */ -proto.api.JSONElement.prototype.hasText = function() { - return jspb.Message.getField(this, 4) != null; +proto.api.JSONElement.prototype.hasRichText = function() { + return jspb.Message.getField(this, 5) != null; }; /** - * optional RichText rich_text = 5; - * @return {?proto.api.JSONElement.RichText} + * optional Counter counter = 6; + * @return {?proto.api.JSONElement.Counter} */ -proto.api.JSONElement.prototype.getRichText = function() { - return /** @type{?proto.api.JSONElement.RichText} */ ( - jspb.Message.getWrapperField(this, proto.api.JSONElement.RichText, 5)); +proto.api.JSONElement.prototype.getCounter = function() { + return /** @type{?proto.api.JSONElement.Counter} */ ( + jspb.Message.getWrapperField(this, proto.api.JSONElement.Counter, 6)); }; /** - * @param {?proto.api.JSONElement.RichText|undefined} value + * @param {?proto.api.JSONElement.Counter|undefined} value * @return {!proto.api.JSONElement} returns this */ -proto.api.JSONElement.prototype.setRichText = function(value) { - return jspb.Message.setOneofWrapperField(this, 5, proto.api.JSONElement.oneofGroups_[0], value); +proto.api.JSONElement.prototype.setCounter = function(value) { + return jspb.Message.setOneofWrapperField(this, 6, proto.api.JSONElement.oneofGroups_[0], value); }; @@ -15552,8 +16360,8 @@ proto.api.JSONElement.prototype.setRichText = function(value) { * Clears the message field making it undefined. * @return {!proto.api.JSONElement} returns this */ -proto.api.JSONElement.prototype.clearRichText = function() { - return this.setRichText(undefined); +proto.api.JSONElement.prototype.clearCounter = function() { + return this.setCounter(undefined); }; @@ -15561,8 +16369,8 @@ proto.api.JSONElement.prototype.clearRichText = function() { * Returns whether this field is set. * @return {boolean} */ -proto.api.JSONElement.prototype.hasRichText = function() { - return jspb.Message.getField(this, 5) != null; +proto.api.JSONElement.prototype.hasCounter = function() { + return jspb.Message.getField(this, 6) != null; }; @@ -17676,7 +18484,10 @@ proto.api.ValueType = { JSON_OBJECT: 8, JSON_ARRAY: 9, TEXT: 10, - RICH_TEXT: 11 + RICH_TEXT: 11, + INTEGER_CNT: 12, + LONG_CNT: 13, + DOUBLE_CNT: 14 }; /** @@ -18823,6 +19634,173 @@ class JSONArray extends _element__WEBPACK_IMPORTED_MODULE_0__["JSONContainer"] { } +/***/ }), + +/***/ "./src/document/json/counter.ts": +/*!**************************************!*\ + !*** ./src/document/json/counter.ts ***! + \**************************************/ +/*! exports provided: CounterType, Counter */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CounterType", function() { return CounterType; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Counter", function() { return Counter; }); +/* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./element */ "./src/document/json/element.ts"); +/* harmony import */ var long__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! long */ "./node_modules/long/src/long.js"); +/* harmony import */ var long__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(long__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _util_error__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../util/error */ "./src/util/error.ts"); +/* harmony import */ var _primitive__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./primitive */ "./src/document/json/primitive.ts"); +/* + * Copyright 2020 The Yorkie Authors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + + + +var CounterType; +(function (CounterType) { + CounterType[CounterType["IntegerCnt"] = 0] = "IntegerCnt"; + CounterType[CounterType["LongCnt"] = 1] = "LongCnt"; + CounterType[CounterType["DoubleCnt"] = 2] = "DoubleCnt"; +})(CounterType || (CounterType = {})); +/** + * Counter represents changeable number data type. + */ +class Counter extends _element__WEBPACK_IMPORTED_MODULE_0__["JSONElement"] { + constructor(value, createdAt) { + super(createdAt); + this.valueType = Counter.getCounterType(value); + this.value = value; + } + static of(value, createdAt) { + return new Counter(value, createdAt); + } + static valueFromBytes(counterType, bytes) { + switch (counterType) { + case CounterType.IntegerCnt: + return bytes[0] | (bytes[1] << 8) | (bytes[2] << 16) | (bytes[3] << 24); + case CounterType.DoubleCnt: { + const view = new DataView(bytes.buffer); + bytes.forEach(function (b, i) { + view.setUint8(i, b); + }); + return view.getFloat64(0, true); + } + case CounterType.LongCnt: + return long__WEBPACK_IMPORTED_MODULE_1___default.a.fromBytesLE(Array.from(bytes)); + default: + throw new _util_error__WEBPACK_IMPORTED_MODULE_2__["YorkieError"](_util_error__WEBPACK_IMPORTED_MODULE_2__["Code"].Unimplemented, `unimplemented type: ${counterType}`); + } + } + toJSON() { + return `${this.value}`; + } + toSortedJSON() { + return this.toJSON(); + } + deepcopy() { + const counter = Counter.of(this.value, this.getCreatedAt()); + counter.setMovedAt(this.getMovedAt()); + return counter; + } + getType() { + return this.valueType; + } + static getCounterType(value) { + switch (typeof value) { + case 'number': + return CounterType.DoubleCnt; + case 'object': + if (value instanceof long__WEBPACK_IMPORTED_MODULE_1___default.a) { + return CounterType.LongCnt; + } + } + return null; + } + static isSupport(value) { + return !!Counter.getCounterType(value); + } + static isInteger(num) { + return num % 1 === 0; + } + /** + * isNumericType check numeric type by JSONCounter + */ + isNumericType() { + const t = this.valueType; + return (t === CounterType.IntegerCnt || + t === CounterType.LongCnt || + t === CounterType.DoubleCnt); + } + getValue() { + return this.value; + } + toBytes() { + switch (this.valueType) { + case CounterType.IntegerCnt: { + const intVal = this.value; + return new Uint8Array([ + intVal & 0xff, + (intVal >> 8) & 0xff, + (intVal >> 16) & 0xff, + (intVal >> 24) & 0xff, + ]); + } + case CounterType.DoubleCnt: { + const doubleVal = this.value; + const uint8Array = new Uint8Array(8); + const view = new DataView(uint8Array.buffer); + view.setFloat64(0, doubleVal, true); + return uint8Array; + } + case CounterType.LongCnt: { + const longVal = this.value; + const longToBytes = longVal.toBytesLE(); + return Uint8Array.from(longToBytes); + } + default: + throw new _util_error__WEBPACK_IMPORTED_MODULE_2__["YorkieError"](_util_error__WEBPACK_IMPORTED_MODULE_2__["Code"].Unimplemented, `unimplemented type: ${this.valueType}`); + } + } + /** + * increase increase numeric data. + */ + increase(v) { + function checkNumericType(target) { + if (!target.isNumericType()) { + throw new TypeError(`Unsupported type of value: ${typeof target.getValue()}`); + } + } + checkNumericType(this); + checkNumericType(v); + if (this.valueType === CounterType.LongCnt) { + this.value = this.value.add(v.getValue()); + } + else { + this.value += + v.getType() === _primitive__WEBPACK_IMPORTED_MODULE_3__["PrimitiveType"].Long + ? v.getValue().toNumber() + : v.getValue(); + } + return this; + } +} + + /***/ }), /***/ "./src/document/json/element.ts": @@ -18864,15 +19842,15 @@ class JSONElement { getID() { return this.createdAt; } - getUpdatedAt() { - return this.updatedAt; + getMovedAt() { + return this.movedAt; } getRemovedAt() { return this.removedAt; } - setUpdatedAt(updatedAt) { - if (!this.updatedAt || (updatedAt && updatedAt.after(this.updatedAt))) { - this.updatedAt = updatedAt; + setMovedAt(movedAt) { + if (!this.movedAt || (movedAt && movedAt.after(this.movedAt))) { + this.movedAt = movedAt; return true; } return false; @@ -18948,6 +19926,15 @@ class JSONObject extends _element__WEBPACK_IMPORTED_MODULE_1__["JSONContainer"] _util_logger__WEBPACK_IMPORTED_MODULE_0__["logger"].fatal(`unsupported: this method should be called by proxy: ${key}`); return null; } + /** + * Don't use createCounter directly. Be sure to use it through a proxy. + * The reason for setting the CounterProxy type as the return value + * is to provide the CounterProxy interface to the user. + */ + createCounter(key, value) { + _util_logger__WEBPACK_IMPORTED_MODULE_0__["logger"].fatal(`unsupported: this method should be called by proxy: ${key}`); + return null; + } set(key, value) { this.memberNodes.set(key, value); } @@ -19113,7 +20100,7 @@ class JSONPrimitive extends _element__WEBPACK_IMPORTED_MODULE_2__["JSONElement"] } deepcopy() { const primitive = JSONPrimitive.of(this.value, this.getCreatedAt()); - primitive.setUpdatedAt(this.getUpdatedAt()); + primitive.setMovedAt(this.getMovedAt()); return primitive; } getType() { @@ -19146,6 +20133,15 @@ class JSONPrimitive extends _element__WEBPACK_IMPORTED_MODULE_2__["JSONElement"] static isInteger(num) { return num % 1 === 0; } + /** + * isNumericType check numeric type by JSONPrimitive + */ + isNumericType() { + const t = this.valueType; + return (t === PrimitiveType.Integer || + t === PrimitiveType.Long || + t === PrimitiveType.Double); + } getValue() { return this.value; } @@ -19340,11 +20336,11 @@ class RGATreeList { if (!node) { _util_logger__WEBPACK_IMPORTED_MODULE_0__["logger"].fatal(`cant find the given node: ${createdAt.toIDString()}`); } - if (!node.getValue().getUpdatedAt() || - executedAt.after(node.getValue().getUpdatedAt())) { + if (!node.getValue().getMovedAt() || + executedAt.after(node.getValue().getMovedAt())) { node.release(); this.insertAfter(prevNode.getCreatedAt(), node.getValue(), executedAt); - node.getValue().setUpdatedAt(executedAt); + node.getValue().setMovedAt(executedAt); } } insert(value) { @@ -19919,12 +20915,12 @@ class RHT { static create() { return new RHT(); } - set(key, value, updatedAt) { + set(key, value, executedAt) { const prev = this.nodeMapByKey.get(key); - if (prev === undefined || updatedAt.after(prev.getUpdatedAt())) { - const node = RHTNode.of(key, value, updatedAt); + if (prev === undefined || executedAt.after(prev.getUpdatedAt())) { + const node = RHTNode.of(key, value, executedAt); this.nodeMapByKey.set(key, node); - this.nodeMapByCreatedAt.set(updatedAt.toIDString(), node); + this.nodeMapByCreatedAt.set(executedAt.toIDString(), node); } } has(key) { @@ -20683,6 +21679,71 @@ class EditOperation extends _operation__WEBPACK_IMPORTED_MODULE_2__["Operation"] } +/***/ }), + +/***/ "./src/document/operation/increase_operation.ts": +/*!******************************************************!*\ + !*** ./src/document/operation/increase_operation.ts ***! + \******************************************************/ +/*! exports provided: IncreaseOperation */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IncreaseOperation", function() { return IncreaseOperation; }); +/* harmony import */ var _operation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./operation */ "./src/document/operation/operation.ts"); +/* harmony import */ var _util_logger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../util/logger */ "./src/util/logger.ts"); +/* harmony import */ var _json_counter__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../json/counter */ "./src/document/json/counter.ts"); +/* + * Copyright 2020 The Yorkie Authors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + + +/** + * Increase can be used to increment data of numerical type. + * It can be used in Counter type. + */ +class IncreaseOperation extends _operation__WEBPACK_IMPORTED_MODULE_0__["Operation"] { + constructor(parentCreatedAt, value, executedAt) { + super(parentCreatedAt, executedAt); + this.value = value; + } + static create(parentCreatedAt, value, executedAt) { + return new IncreaseOperation(parentCreatedAt, value, executedAt); + } + execute(root) { + const parentObject = root.findByCreatedAt(this.getParentCreatedAt()); + if (parentObject instanceof _json_counter__WEBPACK_IMPORTED_MODULE_2__["Counter"]) { + const counter = parentObject; + const value = this.value.deepcopy(); + counter.increase(value); + } + else { + _util_logger__WEBPACK_IMPORTED_MODULE_1__["logger"].fatal(`fail to execute, only Counter can execute increase`); + } + } + getAnnotatedString() { + return `${this.getParentCreatedAt().getAnnotatedString()}.INCREASE`; + } + getValue() { + return this.value; + } +} + + /***/ }), /***/ "./src/document/operation/move_operation.ts": @@ -21363,6 +22424,83 @@ class ArrayProxy { } +/***/ }), + +/***/ "./src/document/proxy/counter_proxy.ts": +/*!*********************************************!*\ + !*** ./src/document/proxy/counter_proxy.ts ***! + \*********************************************/ +/*! exports provided: CounterProxy */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CounterProxy", function() { return CounterProxy; }); +/* harmony import */ var _json_primitive__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../json/primitive */ "./src/document/json/primitive.ts"); +/* harmony import */ var _operation_increase_operation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../operation/increase_operation */ "./src/document/operation/increase_operation.ts"); +/* + * Copyright 2020 The Yorkie Authors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/** + * CounterProxy is a proxy representing Counter types. + */ +class CounterProxy { + constructor(context, counter) { + this.context = context; + this.counter = counter; + this.handlers = { + get: (target, method, receiver) => { + if (method === 'getID') { + return () => { + return target.getCreatedAt(); + }; + } + else if (method === 'increase') { + return (v) => { + return this.increase(v); + }; + } + return Reflect.get(target, method, receiver); + }, + }; + } + static create(context, target) { + const numberProxy = new CounterProxy(context, target); + return new Proxy(target, numberProxy.getHandlers()); + } + /** + * Increase adds an increase operation. + * Only numeric types are allowed as operand values. + */ + increase(v) { + const ticket = this.context.issueTimeTicket(); + const value = _json_primitive__WEBPACK_IMPORTED_MODULE_0__["JSONPrimitive"].of(v, ticket); + if (!value.isNumericType()) { + throw new TypeError(`Unsupported type of value: ${typeof value.getValue()}`); + } + this.context.push(_operation_increase_operation__WEBPACK_IMPORTED_MODULE_1__["IncreaseOperation"].create(this.counter.getCreatedAt(), value, ticket)); + return this; + } + getHandlers() { + return this.handlers; + } +} + + /***/ }), /***/ "./src/document/proxy/object_proxy.ts": @@ -21388,6 +22526,8 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var _text_proxy__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./text_proxy */ "./src/document/proxy/text_proxy.ts"); /* harmony import */ var _rich_text_proxy__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./rich_text_proxy */ "./src/document/proxy/rich_text_proxy.ts"); /* harmony import */ var _proxy__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./proxy */ "./src/document/proxy/proxy.ts"); +/* harmony import */ var _json_counter__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../json/counter */ "./src/document/json/counter.ts"); +/* harmony import */ var _counter_proxy__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./counter_proxy */ "./src/document/proxy/counter_proxy.ts"); /* * Copyright 2020 The Yorkie Authors. All rights reserved. * @@ -21416,6 +22556,8 @@ __webpack_require__.r(__webpack_exports__); + + class ObjectProxy { constructor(context) { this.context = context; @@ -21457,6 +22599,14 @@ class ObjectProxy { return ObjectProxy.createRichText(context, target, key); }; } + else if (keyOrMethod === 'createCounter') { + return (key, value) => { + if (_util_logger__WEBPACK_IMPORTED_MODULE_0__["logger"].isEnabled(_util_logger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"].Trivial)) { + _util_logger__WEBPACK_IMPORTED_MODULE_0__["logger"].trivial(`obj[${key}]=Text`); + } + return ObjectProxy.createCounter(context, target, key, value); + }; + } return Object(_proxy__WEBPACK_IMPORTED_MODULE_12__["toProxy"])(context, target.get(keyOrMethod)); }, deleteProperty: (target, key) => { @@ -21525,6 +22675,14 @@ class ObjectProxy { context.push(_operation_set_operation__WEBPACK_IMPORTED_MODULE_1__["SetOperation"].create(key, text.deepcopy(), target.getCreatedAt(), ticket)); return _rich_text_proxy__WEBPACK_IMPORTED_MODULE_11__["RichTextProxy"].create(context, text); } + static createCounter(context, target, key, value) { + const ticket = context.issueTimeTicket(); + const counter = _json_counter__WEBPACK_IMPORTED_MODULE_13__["Counter"].of(value, ticket); + target.set(key, counter); + context.registerElement(counter); + context.push(_operation_set_operation__WEBPACK_IMPORTED_MODULE_1__["SetOperation"].create(key, counter.deepcopy(), target.getCreatedAt(), ticket)); + return _counter_proxy__WEBPACK_IMPORTED_MODULE_14__["CounterProxy"].create(context, counter); + } static deleteInternal(context, target, key) { const ticket = context.issueTimeTicket(); const deleted = target.deleteByKey(key, ticket); @@ -21558,6 +22716,8 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var _array_proxy__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./array_proxy */ "./src/document/proxy/array_proxy.ts"); /* harmony import */ var _text_proxy__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./text_proxy */ "./src/document/proxy/text_proxy.ts"); /* harmony import */ var _rich_text_proxy__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./rich_text_proxy */ "./src/document/proxy/rich_text_proxy.ts"); +/* harmony import */ var _counter_proxy__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./counter_proxy */ "./src/document/proxy/counter_proxy.ts"); +/* harmony import */ var _json_counter__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../json/counter */ "./src/document/json/counter.ts"); /* * Copyright 2020 The Yorkie Authors. All rights reserved. * @@ -21582,6 +22742,8 @@ __webpack_require__.r(__webpack_exports__); + + function createProxy(context, target) { return _object_proxy__WEBPACK_IMPORTED_MODULE_5__["ObjectProxy"].create(context, target); } @@ -21606,6 +22768,10 @@ function toProxy(context, elem) { const text = elem; return _rich_text_proxy__WEBPACK_IMPORTED_MODULE_8__["RichTextProxy"].create(context, text); } + else if (elem instanceof _json_counter__WEBPACK_IMPORTED_MODULE_10__["Counter"]) { + const counter = elem; + return _counter_proxy__WEBPACK_IMPORTED_MODULE_9__["CounterProxy"].create(context, counter); + } else if (elem === null) { return null; } @@ -23173,4 +24339,4 @@ __webpack_require__.r(__webpack_exports__); /******/ })["default"]; }); -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly95b3JraWUvd2VicGFjay91bml2ZXJzYWxNb2R1bGVEZWZpbml0aW9uIiwid2VicGFjazovL3lvcmtpZS93ZWJwYWNrL2Jvb3RzdHJhcCIsIndlYnBhY2s6Ly95b3JraWUvLi9ub2RlX21vZHVsZXMvYmFzZTY0LWpzL2luZGV4LmpzIiwid2VicGFjazovL3lvcmtpZS8uL25vZG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b25nKS5zdWIodGhpcyk7XHJcbiAgICAgICAgICAgIHJldHVybiBkaXYudG9TdHJpbmcocmFkaXgpICsgcmVtMS50b0ludCgpLnRvU3RyaW5nKHJhZGl4KTtcclxuICAgICAgICB9IGVsc2VcclxuICAgICAgICAgICAgcmV0dXJuICctJyArIHRoaXMubmVnKCkudG9TdHJpbmcocmFkaXgpO1xyXG4gICAgfVxyXG5cclxuICAgIC8vIERvIHNldmVyYWwgKDYpIGRpZ2l0cyBlYWNoIHRpbWUgdGhyb3VnaCB0aGUgbG9vcCwgc28gYXMgdG9cclxuICAgIC8vIG1pbmltaXplIHRoZSBjYWxscyB0byB0aGUgdmVyeSBleHBlbnNpdmUgZW11bGF0ZWQgZGl2LlxyXG4gICAgdmFyIHJhZGl4VG9Qb3dlciA9IGZyb21OdW1iZXIocG93X2RibChyYWRpeCwgNiksIHRoaXMudW5zaWduZWQpLFxyXG4gICAgICAgIHJlbSA9IHRoaXM7XHJcbiAgICB2YXIgcmVzdWx0ID0gJyc7XHJcbiAgICB3aGlsZSAodHJ1ZSkge1xyXG4gICAgICAgIHZhciByZW1EaXYgPSByZW0uZGl2KHJhZGl4VG9Qb3dlciksXHJcbiAgICAgICAgICAgIGludHZhbCA9IHJlbS5zdWIocmVtRGl2Lm11bChyYWRpeFRvUG93ZXIpKS50b0ludCgpID4+PiAwLFxyXG4gICAgICAgICAgICBkaWdpdHMgPSBpbnR2YWwudG9TdHJpbmcocmFkaXgpO1xyXG4gICAgICAgIHJlbSA9IHJlbURpdjtcclxuICAgICAgICBpZiAocmVtLmlzWmVybygpKVxyXG4gICAgICAgICAgICByZXR1cm4gZGlnaXRzICsgcmVzdWx0O1xyXG4gICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICB3aGlsZSAoZGlnaXRzLmxlbmd0aCA8IDYpXHJcbiAgICAgICAgICAgICAgICBkaWdpdHMgPSAnMCcgKyBkaWdpdHM7XHJcbiAgICAgICAgICAgIHJlc3VsdCA9ICcnICsgZGlna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Uk87XHJcbiAgICBpZiAoIWlzTG9uZyhtdWx0aXBsaWVyKSlcclxuICAgICAgICBtdWx0aXBsaWVyID0gZnJvbVZhbHVlKG11bHRpcGxpZXIpO1xyXG5cclxuICAgIC8vIHVzZSB3YXNtIHN1cHBvcnQgaWYgcHJlc2VudFxyXG4gICAgaWYgKHdhc20pIHtcclxuICAgICAgICB2YXIgbG93ID0gd2FzbS5tdWwodGhpcy5sb3csXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuaGlnaCxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgbXVsdGlwbGllci5sb3csXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgIG11bHRpcGxpZXIuaGlnaCk7XHJcbiAgICAgICAgcmV0dXJuIGZyb21CaXRzKGxvdywgd2FzbS5nZXRfaGlnaCgpLCB0aGlzLnVuc2lnbmVkKTtcclxuICAgIH1cclxuXHJcbiAgICBpZiAobXVsdGlwbGllci5pc1plcm8oKSlcclxuICAgICAgICByZXR1cm4gWkVSTztcclxuICAgIGlmICh0aGlzLmVxKE1JTl9WQUxVRSkpXHJcbiAgICAgICAgcmV0dXJuIG11bHRpcGxpZXIuaXNPZGQoKSA/IE1JTl9WQUxVRSA6IFpFUk87XHJcbiAgICBpZiAobXVsdGlwbGllci5lcShNSU5fVkFMVUUpKVxyXG4gICAgICAgIHJldHVybiB0aGlzLmlzT2RkKCkgPyBNSU5fVkFMVUUgOiBaRVJPO1xyXG5cclxuICAgIGlmICh0aGlzLmlzTmVnYXRpdmUoKSkge1xyXG4gICAgICAgIGlmIChtdWx0aXBsaWVyLmlzTmVnYXRpdmUoKSlcclxuICAgICAgICAgICAgcmV0dXJuIHRoaXMubmVnKCkubXVsKG11bHRpcGxpZXIubmVnKCkpO1xyXG4gICAgICAgIGVsc2VcclxuICAgICAgICAgICAgcmV0dXJuIHRoaXMubmVnKCkubXVsKG11bHRpcGxpZXIpLm5lZygpO1xyXG4gICAgfSBlbHNlIGlmIChtd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gZGl2aXNvci5sb3cgPT09IC0xICYmIGRpdmlzb3IuaGlnaCA9PT0gLTEpIHtcclxuICAgICAgICAgICAgLy8gYmUgY29uc2lzdGVudCB3aXRoIG5vbi13YXNtIGNvZGUgcGF0aFxyXG4gICAgICAgICAgICByZXR1cm4gdGhpcztcclxuICAgICAgICB9XHJcbiAgICAgICAgdmFyIGxvdyA9ICh0aGlzLnVuc2lnbmVkID8gd2FzbS5kaXZfdSA6IHdhc20uZGl2X3MpKFxyXG4gICAgICAgICAgICB0aGlzLmxvdyxcclxuICAgICAgICAgICAgdGhpcy5oaWdoLFxyXG4gICAgICAgICAgICBkaXZpc29yLmxvdyxcclxuICAgICAgICAgICAgZGl2aXNvci5oaWdoXHJcbiAgICAgICAgKTtcclxuICAgICAgICByZXR1cm4gZnJvbUJpdHMobG93LCB3YXNtLmdldF9oaWdoKCksIHRoaXMudW5zaWduZWQpO1xyXG4gICAgfVxyXG5cclxuICAgIGlmICh0aGlzLmlzWmVybygpKVxyXG4gICAgICAgIHJldHVybiB0aGlzLnVuc2lnbmVkID8gVVpFUk8gOiBaRVJPO1xyXG4gICAgdmFyIGFwcHJveCwgcmVtLCByZXM7XHJcbiAgICBpZiAoIXRoaXMudW5zaWduZWQpIHtcclxuICAgICAgICAvLyBUaGlzIHNlY3Rpb24gaXMgb25seSByZWxldmFudCBmb3Igc2lnbmVkIGxvbmdzIGFuZCBpcyBkZXJpdmVkIGZyb20gdGhlXHJcbiAgICAgICAgLy8gY2xvc3VyZSBsaWJyYXJ5IGFzIGEgd2hvbGUuXHJcbiAgICAgICAgaWYgKHRoaXMuZXEoTUlOX1ZBTFVFKSkge1xyXG4gICAgICAgICAgICBpZiAoZGl2aXNvci5lcShPTkUpIHx8IGRpdmlzb3IuZXEoTkVHX09ORSkpXHJcbiAgICAgICAgICAgICAgICByZXR1cm4gTUlOX1ZBTFVFOyAgLy8gcmVjYWxsIHRoYXQgLU1JTl9WQUxVRSA9PSBNSU5fVkFMVUVcclxuICAgICAgICAgICAgZWxzZSBpZiAoZGl2aXNvci5lcShNSU5fVkFMVUUpKVxyXG4gICAgICAgICAgICAgICAgcmV0dXJuIE9ORTtcclxuICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAvLyBBdCB0aGlzIHBvaW50LCB3ZSBoYXZlIHxvdGhlcnwgPj0gMiwgc28gfHRoaXMvb3RoZXJ8IDwgfE1JTl9WQUxVRXwuXHJcbiAgICAgICAgICAgICAgICB2YXIgaGFsZlRoaXMgPSB0aGlzLnNocigxKTtcclxuICAgICAgICAgICAgICAgIGFwcHJveCA9IGhhbGZUaGlzLmRpdihkaXZpc29yKS5zaGwoMSk7XHJcbiAgICAgICAgICAgICAgICBpZiAoYXBwcm94LmVxKFpFUk8pKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGRpdmlzb3IuaXNOZWdhdGl2ZSgpID8gT05FIDogTkVHX09ORTtcclxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgcmVtID0gdGhpcy5zdWIoZGl2aXNvci5tdWwoYXBwcm94KSk7XHJcbiAgICAgICAgICAgICAgICAgICAgcmVzID0gYXBwcm94LmFkZChyZW0uZGl2KGRpdmlzb3IpKTtcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfSBlbHNlIGlmIChkaXZpc29yLmVxKE1JTl9WQUxVRSkpXHJcbiAgICAgICAgICAgIHJldHVybiB0aGlzLnVuc2lnbmVkID8gVVpFUk8gOiBaRVJPO1xyXG4gICAgICAgIGlmICh0aGlzLmlzTmVnYXRpdmUoKSkge1xyXG4gICAgICAgICAgICBpZiAoZGl2aXNvci5pc05lZ2F0aXZlKCkpXHJcbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5uZWcoKS5kaXYoZGl2aXNvci5uZWcoKSk7XHJcbiAgICAgIC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sxXSkgOiBuZXcgVWludDhBcnJheShbMF0pO1xuICAgICAgfVxuICAgICAgY2FzZSBQcmltaXRpdmVUeXBlLkludGVnZXI6IHtcbiAgICAgICAgY29uc3QgaW50VmFsID0gdGhpcy52YWx1ZSBhcyBudW1iZXI7XG4gICAgICAgIHJldHVybiBuZXcgVWludDhBcnJheShbXG4gICAgICAgICAgaW50VmFsICYgMHhmZixcbiAgICAgICAgICAoaW50VmFsID4+IDgpICYgMHhmZixcbiAgICAgICAgICAoaW50VmFsID4+IDE2KSAmIDB4ZmYsXG4gICAgICAgICAgKGludFZhbCA+PiAyNCkgJiAweGZmLFxuICAgICAgICBdKTtcbiAgICAgIH1cbiAgICAgIGNhc2UgUHJpbWl0aXZlVHlwZS5Eb3VibGU6IHtcbiAgICAgICAgY29uc3QgZG91YmxlVmFsID0gdGhpcy52YWx1ZSBhcyBudW1iZXI7XG4gICAgICAgIGNvbnN0IHVpbnQ4QXJyYXkgPSBuZXcgVWludDhBcnJheSg4KTtcbiAgICAgICAgY29uc3QgdmlldyA9IG5ldyBEYXRhVmlldyh1aW50OEFycmF5LmJ1ZmZlcik7XG4gICAgICAgIHZpZXcuc2V0RmxvYXQ2NCgwLCBkb3VibGVWYWwsIHRydWUpO1xuICAgICAgICByZXR1cm4gdWludDhBcnJheTtcbiAgICAgIH1cbiAgICAgIGNhc2UgUHJpbWl0aXZlVHlwZS5TdHJpbmc6IHtcbiAgICAgICAgcmV0dXJuIG5ldyBUZXh0RW5jb2RlcigpLmVuY29kZSh0aGlzLnZhbHVlIGFzIHN0cmluZyk7XG4gICAgICB9XG4gICAgICBjYXNlIFByaW1pdGl2ZVR5cGUuTG9uZzoge1xuICAgICAgICBjb25zdCBsb25nVmFsID0gdGhpcy52YWx1ZSBhcyBMb25nO1xuICAgICAgICBjb25zdCBsb25nVG9CeXRlcyA9IGxvbmdWYWwudG9CeXRlc0xFKCk7XG4gICAgICAgIHJldHVybiBVaW50OEFycmF5LmZyb20obG9uZ1RvQnl0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T4ge1xuICAgICAgICAgICAgY29uc3QgZWxlbSA9IHRhcmdldC5nZXRCeUluZGV4KGluZGV4KTtcbiAgICAgICAgICAgIGlmIChlbGVtIGluc3RhbmNlb2YgSlNPTlByaW1pdGl2ZSkge1xuICAgICAgICAgICAgICByZXR1cm4gZWxlbTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB0b1Byb3h5KGNvbnRleHQsIGVsZW0pO1xuICAgICAgICAgIH07XG4gICAgICAgIH0gZWxzZSBpZiAobWV0aG9kID09PSAnZ2V0TGFzdCcpIHtcbiAgICAgICAgICByZXR1cm4gKCk6IEpTT05FbGVtZW50ID0+IHtcbiAgICAgICAgICAgIHJldHVybiB0b1Byb3h5KGNvbnRleHQsIHRhcmdldC5nZXRMYXN0KCkpO1xuICAgICAgICAgIH07XG4gICAgICAgIH0gZWxzZSBpZiAobWV0aG9kID09PSAnZGVsZXRlQnlJRCcpIHtcbiAgICAgICAgICByZXR1cm4gKGNyZWF0ZWRBdDogVGltZVRpY2tldCk6IEpTT05FbGVtZW50ID0+IHtcbiAgICAgICAgICAgIGNvbnN0IGRlbGV0ZWQgPSBBcnJheVByb3h5LmRlbGV0ZUludGVybmFsQnlJRChcbiAgICAgICAgICAgICAgY29udGV4dCxcbiAgICAgICAgICAgICAgdGFyZ2V0LFxuICAgICAgICAgICAgICBjcmVhdGVkQXQsXG4gICAgICAgICAgICApO1xuICAgICAgICAgICAgcmV0dXJuIHRvUHJveHkoY29udGV4dCwgZGVsZXRlZCk7XG4gICAgICAgICAgfTtcbiAgICAgICAgfSBlbHNlIGlmIChtZXRob2QgPT09ICdpbnNlcnRBZnRlcicpIHtcbiAgICAgICAgICByZXR1cm4gKHByZXZJRDogVGltZVRpY2tldCwgdmFsdWU6IGFueSk6IEpTT05FbGVtZW50ID0+IHtcbiAgICAgICAgICAgIGNvbnN0IGluc2VydGVkID0gQXJyYXlQcm94eS5pbnNlcnRBZnRlckludGVybmFsKFxuICAgICAgICAgICAgICBjb250ZXh0LFxuICAgICAgICAgICAgICB0YXJnZXQsXG4gICAgICAgICAgICAgIHByZXZJRCxcbiAgICAgICAgICAgICAgdmFsdWUsXG4gICAgICAgICAgICApO1xuICAgICAgICAgICAgcmV0dXJuIHRvUHJveHkoY29udGV4dCwgaW5zZXJ0ZWQpO1xuICAgICAgICAgIH07XG4gICAgICAgIH0gZWxzZSBpZiAobWV0aG9kID09PSAnbW92ZUJlZm9yZScpIHtcbiAgICAgICAgICByZXR1cm4gKHByZXZJRDogVGltZVRpY2tldCwgaXRlbUlEOiBUaW1lVGlja2V0KTogdm9pZCA9PiB7XG4gICAgICAgICAgICBBcnJheVByb3h5Lm1vdmVCZWZvcmVJbnRlcm5hbChjb250ZXh0LCB0YXJnZXQsIHByZXZJRCwgaXRlbUlEKTtcbiAgICAgICAgICB9O1xuICAgICAgICAgIC8vIEphdmFTY3JpcHQgTmF0aXZlIEFQSVxuICAgICAgICB9IGVsc2UgaWYgKGlzTnVtZXJpY1N0cmluZyhtZXRob2QpKSB7XG4gICAgICAgICAgcmV0dXJuIHRvUHJveHkoY29udGV4dCwgdGFyZ2V0LmdldEJ5SW5kZXgoKyhtZXRob2QgYXMgc3RyaW5nKSkpO1xuICAgICAgICB9IGVsc2UgaWYgKG1ldGhvZCA9PT0gJ3B1c2gnKSB7XG4gICAgICAgICAgcmV0dXJuICh2YWx1ZTogYW55KTogbnVtYmVyID0+IHtcbiAgICAgICAgICAgIGlmIChsb2dnZXIuaXNFbmFibGVkKExvZ0xldmVsLlRyaXZpYWwpKSB7XG4gICAgICAgICAgICAgIGxvZ2dlci50cml2aWFsKGBhcnJheS5wdXNoKCR7SlNPTi5zdHJpbmdpZnkodmFsdWUpfSlgKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgcmV0dXJuIEFycmF5UHJveHkucHVzaEludGVybmFsKGNvbnRleHQsIHRhcmdldCwgdmFsdWUpO1xuICAgICAgICAgIH07XG4gICAgICAgIH0gZWxzZSBpZiAobWV0aG9kID09PSAnZmlsdGVyJykge1xuICAgICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICBjYWxsYmFjazogKFxuICAgICAgICAgICAgICBlbGVtOiBKU09ORWxlbWVudCxcbiAgICAgICAgICAgICAgaWR4OiBudW1iZXIsXG4gICAgICAgICAgICAgIGFycjogQXJyYXk8SlNPTkVsZW1lbnQ+LFxuICAgICAgICAgICAgKSA9PiBBcnJheTxKU09ORWxlbWVudD4sXG4gICAgICAgICAgKTogQXJyYXk8SlNPTkVsZW1lbnQ+ID0+IHtcbiAgICAgICAgICAgIHJldHVybiBBcnJheS5mcm9tKHRhcmdldClcbiAgICAgICAgICAgICAgLm1hcCgoZSkgPT4gdG9Qcm94eShjb250ZXh0LCBlKSlcbiAgICAgICAgICAgICAgLmZpbHRlcihjYWxsYmFjayk7XG4gICAgICAgICAgfTtcbiAgICAgICAgfSBlbHNlIGlmIChtZXRob2QgPT09ICdyZWR1Y2UnKSB7XG4gICAgICAgICAgcmV0dXJuIChcbiAgICAgICAgICAgIGNhbGxiYWNrOiAoYWNjdW11bGF0b3I6IGFueSwgY3VycjogSlNPTkVsZW1lbnQpID0+IGFueSxcbiAgICAgICAgICAgIGFjY3VtdWxhdG9yOiBhbnksXG4gICAgICAgICAgKSA9PiB7XG4gICAgICAgICAgICByZXR1cm4gQXJyYXkuZnJvbSh0YXJnZXQpXG4gICAgICAgICAgICAgIC5tYXAoKGUpID0+IHRvUHJveHkoY29udGV4dCwgZSkpXG4gICAgICAgICAgICAgIC5yZWR1Y2UoY2FsbGJhY2ssIGFjY3VtdWxhdG9yKTtcbiAgICAgICAgICB9O1xuICAgICAgICB9IGVsc2UgaWYgKG1ldGhvZCA9PT0gJ2xlbmd0aCcpIHtcbiAgICAgICAgICByZXR1cm4gdGFyZ2V0Lmxlbmd0aDtcbiAgICAgICAgfSBlbHNlIGlmIChtZXRob2QgPT09IFN5bWJvbC5pdGVyYXRvcikge1xuICAgICAgICAgIHJldHVybiBBcnJheVByb3h5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AgICByZXR1cm4gdGFyZ2V0LnRvSlNPTigpO1xuICAgICAgICAgIH07XG4gICAgICAgIH0gZWxzZSBpZiAoa2V5T3JNZXRob2QgPT09ICdjcmVhdGVUZXh0Jykge1xuICAgICAgICAgIHJldHVybiAoa2V5OiBzdHJpbmcpOiBQbGFpblRleHQgPT4ge1xuICAgICAgICAgICAgaWYgKGxvZ2dlci5pc0VuYWJsZWQoTG9nTGV2ZWwuVHJpdmlhbCkpIHtcbiAgICAgICAgICAgICAgbG9nZ2VyLnRyaXZpYWwoYG9ialske2tleX1dPVRleHRgKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBPYmplY3RQcm94eS5jcmVhdGVUZXh0KGNvbnRleHQsIHRhcmdldCwga2V5KTtcbiAgICAgICAgICB9O1xuICAgICAgICB9IGVsc2UgaWYgKGtleU9yTWV0aG9kID09PSAnY3JlYXRlUmljaFRleHQnKSB7XG4gICAgICAgICAgcmV0dXJuIChrZXk6IHN0cmluZyk6IFJpY2hUZXh0ID0+IHtcbiAgICAgICAgICAgIGlmIChsb2dnZXIuaXNFbmFibGVkKExvZ0xldmVsLlRyaXZpYWwpKSB7XG4gICAgICAgICAgICAgIGxvZ2dlci50cml2aWFsKGBvYmpbJHtrZXl9XT1UZXh0YCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gT2JqZWN0UHJveHkuY3JlYXRlUmljaFRleHQoY29udGV4dCwgdGFyZ2V0LCBrZXkpO1xuICAgICAgICAgIH07XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gdG9Qcm94eShjb250ZXh0LCB0YXJnZXQuZ2V0KGtleU9yTWV0aG9kKSk7XG4gICAgICB9LFxuXG4gICAgICBkZWxldGVQcm9wZXJ0eTogKHRhcmdldDogSlNPTk9iamVjdCwga2V5OiBzdHJpbmcpOiBib29sZWFuID0+IHtcbiAgICAgICAgaWYgKGxvZ2dlci5pc0VuYWJsZWQoTG9nTGV2ZWwuVHJpdml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IH0gZWxzZSBpZiAoQXJyYXkuaXNBcnJheSh2YWx1ZSkpIHtcbiAgICAgIGNvbnN0IGFycmF5ID0gSlNPTkFycmF5LmNyZWF0ZSh0aWNrZXQpO1xuICAgICAgdGFyZ2V0LnNldChrZXksIGFycmF5KTtcbiAgICAgIGNvbnRleHQucmVnaXN0ZXJFbGVtZW50KGFycmF5KTtcbiAgICAgIGNvbnRleHQucHVzaChcbiAgICAgICAgU2V0T3BlcmF0aW9uLmNyZWF0ZShcbiAgICAgICAgICBrZXksXG4gICAgICAgICAgYXJyYXkuZGVlcGNvcHkoKSxcbiAgICAgICAgICB0YXJnZXQuZ2V0Q3JlYXRlZEF0KCksXG4gICAgICAgICAgdGlja2V0LFxuICAgICAgICApLFxuICAgICAgKTtcbiAgICAgIGZvciAoY29uc3QgZWxlbWVudCBvZiB2YWx1ZSkge1xuICAgICAgICBBcnJheVByb3h5LnB1c2hJbnRlcm5hbChjb250ZXh0LCBhcnJheSwgZWxlbWVudCk7XG4gICAgICB9XG4gICAgfSBlbHNlIGlmICh0eXBlb2YgdmFsdWUgPT09ICdvYmplY3QnKSB7XG4gICAgICBpZiAodmFsdWUgaW5zdGFuY2VvZiBQbGFpblRleHQpIHtcbiAgICAgICAgdGFyZ2V0LnNldChrZXksIHZhbHVlKTtcbiAgICAgICAgY29udGV4dC5yZWdpc3RlckVsZW1lbnQodmFsdWUpO1xuICAgICAgICBjb250ZXh0LnB1c2goXG4gICAgICAgICAgU2V0T3BlcmF0aW9uLmNyZWF0ZShcbiAgICAgICAgICAgIGtleSxcbiAgICAgICAgICAgIHZhbHVlLmRlZXBjb3B5KCksXG4gICAgICAgICAgICB0YXJnZXQuZ2V0Q3JlYXRlZEF0KCksXG4gICAgICAgICAgICB0aWNrZXQsXG4gICAgICAgICAgKSxcbiAgICAgICAgKTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGNvbnN0IG9iaiA9IEpTT05PYmplY3QuY3JlYXRlKHRpY2tldCk7XG4gICAgIC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TtcbiAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIGlmIChtZXRob2QgPT09ICdzZXRTdHlsZScpIHtcbiAgICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgZnJvbUlkeDogbnVtYmVyLFxuICAgICAgICAgICAgdG9JZHg6IG51bWJlcixcbiAgICAgICAgICAgIGF0dHJpYnV0ZXM6IHsgW2tleTogc3RyaW5nXTogc3RyaW5nIH0sXG4gICAgICAgICAgKTogYm9vbGVhbiA9PiB7XG4gICAgICAgICAgICB0aGlzLnNldFN0eWxlKHRhcmdldCwgZnJvbUlkeCwgdG9JZHgsIGF0dHJpYnV0ZXMpO1xuICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgfTtcbiAgICAgICAgfSBlbHNlIGlmIChtZXRob2QgPT09ICd1cGRhdGVTZWxlY3Rpb24nKSB7XG4gICAgICAgICAgcmV0dXJuIChmcm9tSWR4OiBudW1iZXIsIHRvSWR4OiBudW1iZXIpOiBib29sZWFuID0+IHtcbiAgICAgICAgICAgIHRoaXMudXBkYXRlU2VsZWN0aW9uKHRhcmdldCwgZnJvbUlkeCwgdG9JZHgpO1xuICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgfTtcbiAgICAgICAgfSBlbHNlIGlmIChtZXRob2QgPT09ICdnZXRBbm5vdGF0ZWRTdHJpbmcnKSB7XG4gICAgICAgICAgcmV0dXJuICgpOiBzdHJpbmcgPT4ge1xuICAgICAgICAgICAgcmV0dXJuIHRhcmdldC5nZXRBbm5vdGF0ZWRTdHJpbmcoKTtcbiAgICAgICAgICB9O1xuICAgICAgICB9IGVsc2UgaWYgKG1ldGhvZCA9PT0gJ2dldFZhbHVlJykge1xuICAgICAgICAgIHJldHVybiAoKTogQXJyYXk8UmljaFRleHRWYWw+ID0+IHtcbiAgICAgICAgICAgIHJldHVybiB0YXJnZXQuZ2V0VmFsdWUoKTtcbiAgICAgICAgICB9O1xuICAgICAgICB9IGVsc2U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XJuaW5nIHBlcm1pc3Npb25zIGFuZFxuICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuXG4gKi9cblxuaW1wb3J0IExvbmcgZnJvbSAnbG9uZyc7XG5pbXBvcnQgeyBDbGllbnQsIENsaWVudE9wdGlvbnMgfSBmcm9tICcuL2NvcmUvY2xpZW50JztcbmltcG9ydCB7IERvY3VtZW50IH0gZnJvbSAnLi9kb2N1bWVudC9kb2N1bWVudCc7XG5cbi8vIHlvcmtpZSBuYW1lc3BhY2UuXG4vLyAgZS5nKSB5b3JraWUuY3JlYXRlQ2xpZW50KC4uLilcbmV4cG9ydCBkZWZhdWx0IHtcbiAgY3JlYXRlQ2xpZW50OiBmdW5jdGlvbiAocnBjQWRkcjogc3RyaW5nLCBvcHRzPzogQ2xpZW50T3B0aW9ucyk6IENsaWVudCB7XG4gICAgcmV0dXJuIG5ldyBDbGllbnQocnBjQWRkciwgb3B0cyk7XG4gIH0sXG4gIGNyZWF0ZURvY3VtZW50OiBmdW5jdGlvbiAoY29sbGVjdGlvbjogc3RyaW5nLCBkb2N1bWVudDogc3RyaW5nKTogRG9jdW1lbnQge1xuICAgIHJldHVybiBuZXcgRG9jdW1lbnQoY29sbGVjdGlvbiwgZG9jdW1lbnQpO1xuICB9LFxuICBMb25nOiBMb25nLFxufTtcbiJdLCJzb3VyY2VSb290IjoiIn0= \ No newline at end of file +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly95b3JraWUvd2VicGFjay91bml2ZXJzYWxNb2R1bGVEZWZpbml0aW9uIiwid2VicGFjazovL3lvcmtpZS93ZWJwYWNrL2Jvb3RzdHJhcCIsIndlYnBhY2s6Ly95b3JraWUvLi9ub2RlX21vZHVsZXMvYmFzZTY0LWpzL2luZGV4LmpzIiwid2VicGFjazovL3lvcmtpZS8uL25vZGVfbW9kdWxlcy9idWZmZXIvaW5kZXguanMiLCJ3ZWJ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6XG4gICAgICAgICAgc2Vjb25kQnl0ZSA9IGJ1ZltpICsgMV1cbiAgICAgICAgICBpZiAoKHNlY29uZEJ5dGUgJiAweEMwKSA9PT0gMHg4MCkge1xuICAgICAgICAgICAgdGVtcENvZGVQb2ludCA9IChmaXJzdEJ5dGUgJiAweDFGKSA8PCAweDYgfCAoc2Vjb25kQnl0ZSAmIDB4M0YpXG4gICAgICAgICAgICBpZiAodGVtcENvZGVQb2ludCA+IDB4N0YpIHtcbiAgICAgICAgICAgICAgY29kZVBvaW50ID0gdGVtcENvZGVQb2ludFxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBicmVha1xuICAgICAgICBjYXNlIDM6XG4gICAgICAgICAgc2Vjb25kQnl0ZSA9IGJ1ZltpICsgMV1cbiAgICAgICAgICB0aGlyZEJ5dGUgPSBidWZbaSArIDJdXG4gICAgICAgICAgaWYgKChzZWNvbmRCeXRlICYgMHhDMCkgPT09IDB4ODAgJiYgKHRoaXJkQnl0ZSAmIDB4QzApID09PSAweDgwKSB7XG4gICAgICAgICAgICB0ZW1wQ29kZVBvaW50ID0gKGZpcnN0Qnl0ZSAmIDB4RikgPDwgMHhDIHwgKHNlY29uZEJ5dGUgJiAweDNGKSA8PCAweDYgfCAodGhpcmRCeXRlICYgMHgzRilcbiAgICAgICAgICAgIGlmICh0ZW1wQ29kZVBvaW50ID4gMHg3RkYgJiYgKHRlbXBDb2RlUG9pbnQgPCAweEQ4MDAgfHwgdGVtcENvZGVQb2ludCA+IDB4REZGRikpIHtcbiAgICAgICAgICAgICAgY29kZVBvaW50ID0gdGVtcENvZGVQb2ludFxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBicmVha1xuICAgICAgICBjYXNlIDQ6XG4gICAgICAgICAgc2Vjb25kQnl0ZSA9IGJ1ZltpICsgMV1cbiAgICAgICAgICB0aGlyZEJ5dGUgPSBidWZbaSArIDJdXG4gICAgICAgICAgZm91cnRoQnl0ZSA9I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mFyIGxvdyA9IHdhc20ubXVsKHRoaXMubG93LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmhpZ2gsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgIG11bHRpcGxpZXIubG93LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICBtdWx0aXBsaWVyLmhpZ2gpO1xyXG4gICAgICAgIHJldHVybiBmcm9tQml0cyhsb3csIHdhc20uZ2V0X2hpZ2goKSwgdGhpcy51bnNpZ25lZCk7XHJcbiAgICB9XHJcblxyXG4gICAgaWYgKG11bHRpcGxpZXIuaXNaZXJvKCkpXHJcbiAgICAgICAgcmV0dXJuIFpFUk87XHJcbiAgICBpZiAodGhpcy5lcShNSU5fVkFMVUUpKVxyXG4gICAgICAgIHJldHVybiBtdWx0aXBsaWVyLmlzT2RkKCkgPyBNSU5fVkFMVUUgOiBaRVJPO1xyXG4gICAgaWYgKG11bHRpcGxpZXIuZXEoTUlOX1ZBTFVFKSlcclxuICAgICAgICByZXR1cm4gdGhpcy5pc09kZCgpID8gTUlOX1ZBTFVFIDogWkVSTztcclxuXHJcbiAgICBpZiAodGhpcy5pc05lZ2F0aXZlKCkpIHtcclxuICAgICAgICBpZiAobXVsdGlwbGllci5pc05lZ2F0aXZlKCkpXHJcbiAgICAgICAgICAgIHJldHVybiB0aGlzLm5lZygpLm11bChtdWx0aXBsaWVyLm5lZygpKTtcclxuICAgICAgICBlbHNlXHJcbiAgICAgICAgICAgIHJldHVybiB0aGlzLm5lZygpLm11bChtdWx0aXBsaWVyKS5uZWcoKTtcclxuICAgIH0gZWxzZSBpZiAobXVsdGlwbGllci5pc05lZ2F0aXZlKCkpXHJcbiAgICAgICAgcmV0dXJuIHRoaXMubXVsKG11bHRpcGxpZXIubmVnKCkpLm5lZygpO1xyXG5cclxuICAgIC8vIElmIGJvdGggbG9uZ3MgYXJlIHNtYWxsLCB1c2UgZmxvYXQgbXVsdGlwbGljYXRpb25cclxuICAgIGlmICh0aGl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fCA8IHxNSU5fVkFMVUV8LlxyXG4gICAgICAgICAgICAgICAgdmFyIGhhbGZUaGlzID0gdGhpcy5zaHIoMSk7XHJcbiAgICAgICAgICAgICAgICBhcHByb3ggPSBoYWxmVGhpcy5kaXYoZGl2aXNvcikuc2hsKDEpO1xyXG4gICAgICAgICAgICAgICAgaWYgKGFwcHJveC5lcShaRVJPKSkge1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBkaXZpc29yLmlzTmVnYXRpdmUoKSA/IE9ORSA6IE5FR19PTkU7XHJcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgIHJlbSA9IHRoaXMuc3ViKGRpdmlzb3IubXVsKGFwcHJveCkpO1xyXG4gICAgICAgICAgICAgICAgICAgIHJlcyA9IGFwcHJveC5hZGQocmVtLmRpdihkaXZpc29yKSk7XHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlcztcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH0gZWxzZSBpZiAoZGl2aXNvci5lcShNSU5fVkFMVUUpKVxyXG4gICAgICAgICAgICByZXR1cm4gdGhpcy51bnNpZ25lZCA/IFVaRVJPIDogWkVSTztcclxuICAgICAgICBpZiAodGhpcy5pc05lZ2F0aXZlKCkpIHtcclxuICAgICAgICAgICAgaWYgKGRpdmlzb3IuaXNOZWdhdGl2ZSgpKVxyXG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMubmVnKCkuZGl2KGRpdmlzb3IubmVnKCkpO1xyXG4gICAgICAgICAgICByZXR1cm4gdGhpcy5uZWcoKS5kaXYoZGl2aXNvcikubmVnKCk7XHJcbiAgICAgICAgfSBlbHNlIGlmIChkaXZpc29yLmlzTmVnYXRpdmUoKSlcclxuICAgICAgICAgICAgcmV0dXJuIHRoaXMuZGl2KGRpdmlzb3IubmVnKCkpLm5lZygpO1xyXG4gICAgICAgIHJlcyA9IFpFUk87XHJcb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G5hbWU6IENsaWVudEV2ZW50VHlwZS5Eb2N1bWVudHNXYXRjaGluZ1BlZXJDaGFuZ2VkLFxuICAgICAgICB2YWx1ZToga2V5cy5yZWR1Y2UoKHBlZXJzTWFwLCBrZXkpID0+IHtcbiAgICAgICAgICBjb25zdCBhdHRhY2htZW50ID0gdGhpcy5hdHRhY2htZW50TWFwLmdldChrZXkudG9JRFN0cmluZygpKTtcbiAgICAgICAgICBwZWVyc01hcFtrZXkudG9JRFN0cmluZygpXSA9IEFycmF5LmZyb20oXG4gICAgICAgICAgICBhdHRhY2htZW50LnBlZXJDbGllbnRzLmtleXMoKSxcbiAgICAgICAgICApO1xuICAgICAgICAgIHJldHVybiBwZWVyc01hcDtcbiAgICAgICAgfSwge30pLFxuICAgICAgfSk7XG4gICAgICByZXR1cm47XG4gICAgfVxuXG4gICAgY29uc3Qgd2F0Y2hFdmVudCA9IHJlc3AuZ2V0RXZlbnQoKTtcbiAgICBjb25zdCByZXNwS2V5cyA9IGNvbnZlcnRlci5mcm9tRG9jdW1lbnRLZXlzKFxuICAgICAgd2F0Y2hFdmVudC5nZXREb2N1bWVudEtleXNMaXN0KCksXG4gICAgKTtcbiAgICBmb3IgKGNvbnN0IGtleSBvZiByZXNwS2V5cykge1xuICAgICAgY29uc3QgYXR0YWNobWVudCA9IHRoaXMuYXR0YWNobWVudE1hcC5nZXQoa2V5LnRvSURTdHJpbmcoKSk7XG4gICAgICBzd2l0Y2ggKHdhdGNoRXZlbnQuZ2V0RXZlbnRUeXBlKCkpIHtcbiAgICAgICAgY2FzZSBXYXRjaEV2ZW50VHlwZS5ET0NVTUVOVFNfV0FUQ0hFRDpcbiAgICAgICAgICBhdHRhY2htZW50LnBlZXJDbGllbnRzLnNldCh3YXRjaEV2ZW50LmdldENsaWVudElkKCksIHRydWUpO1xuICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIFdhdGNoRXZlbnRUeXBlLkRPQ1VNRU5UU19VTldBVENIRUQ6XG4gICAgICAg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gICB9IGVsc2UgaWYgKG1ldGhvZCA9PT0gJ2dldEVsZW1lbnRCeUlEJykge1xuICAgICAgICAgIHJldHVybiAoY3JlYXRlZEF0OiBUaW1lVGlja2V0KTogSlNPTkVsZW1lbnQgPT4ge1xuICAgICAgICAgICAgcmV0dXJuIHRvUHJveHkoY29udGV4dCwgdGFyZ2V0LmdldChjcmVhdGVkQXQpKTtcbiAgICAgICAgICB9O1xuICAgICAgICB9IGVsc2UgaWYgKG1ldGhvZCA9PT0gJ2dldEVsZW1lbnRCeUluZGV4Jykge1xuICAgICAgICAgIHJldHVybiAoaW5kZXg6IG51bWJlcik6IEpTT05FbGVtZW50ID0+IHtcbiAgICAgICAgICAgIGNvbnN0IGVsZW0gPSB0YXJnZXQuZ2V0QnlJbmRleChpbmRleCk7XG4gICAgICAgICAgICBpZiAoZWxlbSBpbnN0YW5jZW9mIEpTT05QcmltaXRpdmUpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIGVsZW07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gdG9Qcm94eShjb250ZXh0LCBlbGVtKTtcbiAgICAgICAgICB9O1xuICAgICAgICB9IGVsc2UgaWYgKG1ldGhvZCA9PT0gJ2dldExhc3QnKSB7XG4gICAgICAgICAgcmV0dXJuICgpOiBKU09ORWxlbWVudCA9PiB7XG4gICAgICAgICAgICByZXR1cm4gdG9Qcm94eShjb250ZXh0LCB0YXJnZXQuZ2V0TGFzdCgpKTtcbiAgICAgICAgICB9O1xuICAgICAgICB9IGVsc2UgaWYgKG1ldGhvZCA9PT0gJ2RlbGV0ZUJ5SUQnKSB7XG4gICAgICAgICAgcmV0dXJuIChjcmVhdGVkQXQ6IFRpbWVUaWNrZXQpOiBKU09ORWxlbWVudCA9PiB7XG4gICAgICAgICAgICBjb25zdCBkZWxldGVkID0gQXJyYXlQcm94eS5kZWxldGVJbnRlcm5hbEJ5SUQoXG4gICAgICAgICAgICAgIGNvbnRleHQsXG4gICAgICAgICAgICAgI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mIChtZXRob2QgPT09ICdwdXNoJykge1xuICAgICAgICAgIHJldHVybiAodmFsdWU6IGFueSk6IG51bWJlciA9PiB7XG4gICAgICAgICAgICBpZiAobG9nZ2VyLmlzRW5hYmxlZChMb2dMZXZlbC5Ucml2aWFsKSkge1xuICAgICAgICAgICAgICBsb2dnZXIudHJpdmlhbChgYXJyYXkucHVzaCgke0pTT04uc3RyaW5naWZ5KHZhbHVlKX0pYCk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHJldHVybiBBcnJheVByb3h5LnB1c2hJbnRlcm5hbChjb250ZXh0LCB0YXJnZXQsIHZhbHVlKTtcbiAgICAgICAgICB9O1xuICAgICAgICB9IGVsc2UgaWYgKG1ldGhvZCA9PT0gJ2ZpbHRlcicpIHtcbiAgICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgY2FsbGJhY2s6IChcbiAgICAgICAgICAgICAgZWxlbTogSlNPTkVsZW1lbnQsXG4gICAgICAgICAgICAgIGlkeDogbnVtYmVyLFxuICAgICAgICAgICAgICBhcnI6IEFycmF5PEpTT05FbGVtZW50PixcbiAgICAgICAgICAgICkgPT4gQXJyYXk8SlNPTkVsZW1lbnQ+LFxuICAgICAgICAgICk6IEFycmF5PEpTT05FbGVtZW50PiA9PiB7XG4gICAgICAgICAgICByZXR1cm4gQXJyYXkuZnJvbSh0YXJnZXQpXG4gICAgICAgICAgICAgIC5tYXAoKGUpID0+IHRvUHJveHkoY29udGV4dCwgZSkpXG4gICAgICAgICAgICAgIC5maWx0ZXIoY2FsbGJhY2spO1xuICAgICAgICAgIH07XG4gICAgICAgIH0gZWxzZSBpZiAobWV0aG9kID09PSAncmVkdWNlJykge1xuICAgICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICBjYWxsYmFjazogKGFjY3VtdWxhdG9yOiBhbnksIGN1cnI6IEpTT05FbGVtZW50KSA9PiBhbnksXG4gICAgICAgICAgICBhY2N1bXVsYXRvcjogYW55LFxuICAgICAgICAgICkgPT4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I7XG5cbiAgY29uc3RydWN0b3IoY29udGV4dDogQ2hhbmdlQ29udGV4dCwgY291bnRlcjogQ291bnRlcikge1xuICAgIHRoaXMuY29udGV4dCA9IGNvbnRleHQ7XG4gICAgdGhpcy5jb3VudGVyID0gY291bnRlcjtcbiAgICB0aGlzLmhhbmRsZXJzID0ge1xuICAgICAgZ2V0OiAoXG4gICAgICAgIHRhcmdldDogSlNPTlByaW1pdGl2ZSxcbiAgICAgICAgbWV0aG9kOiBzdHJpbmcgfCBzeW1ib2wsXG4gICAgICAgIHJlY2VpdmVyOiBhbnksXG4gICAgICApOiBhbnkgPT4ge1xuICAgICAgICBpZiAobWV0aG9kID09PSAnZ2V0SUQnKSB7XG4gICAgICAgICAgcmV0dXJuICgpOiBUaW1lVGlja2V0ID0+IHtcbiAgICAgICAgICAgIHJldHVybiB0YXJnZXQuZ2V0Q3JlYXRlZEF0KCk7XG4gICAgICAgICAgfTtcbiAgICAgICAgfSBlbHNlIGlmIChtZXRob2QgPT09ICdpbmNyZWFzZScpIHtcbiAgICAgICAgICByZXR1cm4gKHY6IG51bWJlciB8IExvbmcpOiBDb3VudGVyUHJveHkgPT4ge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMuaW5jcmVhc2Uodik7XG4gICAgICAgICAgfTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBSZWZsZWN0LmdldCh0YXJnZXQsIG1ldGhvZCwgcmVjZWl2ZXIpO1xuICAgICAgfSxcbiAgICB9O1xuICB9XG5cbiAgcHVibGljIHN0YXRpYyBjcmVhdGUoY29udGV4dDogQ2hhbmdlQ29udGV4dCwgdGFyZ2V0OiBDb3VudGVyKTogQ291bnRlciB7XG4gICAgY29uc3QgbnVtYmVyUHJveHkgPSBuZXcgQ291bnRlclByb3h5KGNvbnRleHQsIHRhcmdldCk7XG4gICAgcmV0dXJuIG5ldyBQcm94eSh0YXJnZXQsIG51bWJlclByb3h5LmdldEhhbmRsZXJzKCkpO1xuICB9XG5cbiAg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gbG9nZ2VyLnRyaXZpYWwoYG9ialske2tleX1dPSR7SlNPTi5zdHJpbmdpZnkodmFsdWUpfWApO1xuICAgICAgICB9XG5cbiAgICAgICAgT2JqZWN0UHJveHkuc2V0SW50ZXJuYWwoY29udGV4dCwgdGFyZ2V0LCBrZXksIHZhbHVlKTtcbiAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICB9LFxuXG4gICAgICBnZXQ6ICh0YXJnZXQ6IEpTT05PYmplY3QsIGtleU9yTWV0aG9kOiBzdHJpbmcpOiBhbnkgPT4ge1xuICAgICAgICBpZiAobG9nZ2VyLmlzRW5hYmxlZChMb2dMZXZlbC5Ucml2aWFsKSkge1xuICAgICAgICAgIGxvZ2dlci50cml2aWFsKGBvYmpbJHtrZXlPck1ldGhvZH1dYCk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoa2V5T3JNZXRob2QgPT09ICdnZXRJRCcpIHtcbiAgICAgICAgICByZXR1cm4gKCk6IFRpbWVUaWNrZXQgPT4ge1xuICAgICAgICAgICAgcmV0dXJuIHRhcmdldC5nZXRDcmVhdGVkQXQoKTtcbiAgICAgICAgICB9O1xuICAgICAgICB9IGVsc2UgaWYgKGtleU9yTWV0aG9kID09PSAndG9KU09OJykge1xuICAgICAgICAgIHJldHVybiAoKTogc3RyaW5nID0+IHtcbiAgICAgICAgICAgIHJldHVybiB0YXJnZXQudG9KU09OKCk7XG4gICAgICAgICAgfTtcbiAgICAgICAgfSBlbHNlIGlmIChrZXlPck1ldGhvZCA9PT0gJ2NyZWF0ZVRleHQnKSB7XG4gICAgICAgICAgcmV0dXJuIChrZXk6IHN0cmluZyk6IFBsYWluVGV4dCA9PiB7XG4gICAgICAgICAgICBpZiAobG9nZ2VyLmlzRW5hYmxlZChMb2dMZXZlbC5Ucml2aWFsKSkge1xuICAgICAgICAgICAgICBsb2dnZXIudHJpdmlhbChgb2JqWyR7a2V5fV09VGV4dGApO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIE9iamVjdFByb3h5LmNyZWF0ZVRleHQoY29udGV4dCwgdGFyZ2V0LCBrZXkpO1xuICAgICAgICAgIH07XG4gICAgICAgIH0gZWxzZSBpZiAoa2V5T3JNZXRob2QgPT09ICdjcmVhdGVSaWNoVGV4dCcpIHtcbiAgICAgICAgICByZXR1cm4gKGtleTogc3RyaW5nKTogUmljaFRleHQgPT4ge1xuICAgICAgICAgICAgaWYgKGxvZ2dlci5pc0VuYWJsZWQoTG9nTGV2ZWwuVHJpdmlhbCkpIHtcbiAgICAgICAgICAgICAgbG9nZ2VyLnRyaXZpYWwoYG9ialske2tleX1dPVRleHRgKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBPYmplY3RQcm94eS5jcmVhdGVSaWNoVGV4dChjb250ZXh0LCB0YXJnZXQsIGtleSk7XG4gICAgICAgICAgfTtcbiAgICAgICAgfSBlbHNlIGlmIChrZXlPck1ldGhvZCA9PT0gJ2NyZWF0ZUNvdW50ZXInKSB7XG4gICAgICAgICAgcmV0dXJuIChrZXk6IHN0cmluZywgdmFsdWU6IENvdW50ZXJUeXBlKTogQ291bnRlciA9PiB7XG4gICAgICAgICAgICBpZiAobG9nZ2VyLmlzRW5hYmxlZChMb2dMZXZlbC5Ucml2aWFsKSkge1xuICAgICAgICAgICAgICBsb2dnZXIudHJpdmlhbChgb2JqWyR7a2V5fV09VGV4dGApO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIE9iamVjdFByb3h5LmNyZWF0ZUNvdW50ZXIoY29udGV4dCwgdGFyZ2V0LCBrZXksIHZhbHVlKTtcbiAgICAgICAgICB9O1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHRvUHJveHkoY29udGV4dCwgdGFyZ2V0LmdldChrZXlPck1ldGhvZCkpO1xuICAgICAgfSxcblxuICAgICAgZGVsZXRlUHJvcGVydHk6ICh0YXJnZXQ6IEpTT05PYmplY3QsIGtleTogc3RyaW5nKTogYm9vbGV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Gl2ZSwgdGFyZ2V0LmdldENyZWF0ZWRBdCgpLCB0aWNrZXQpLFxuICAgICAgKTtcbiAgICB9IGVsc2UgaWYgKEFycmF5LmlzQXJyYXkodmFsdWUpKSB7XG4gICAgICBjb25zdCBhcnJheSA9IEpTT05BcnJheS5jcmVhdGUodGlja2V0KTtcbiAgICAgIHRhcmdldC5zZXQoa2V5LCBhcnJheSk7XG4gICAgICBjb250ZXh0LnJlZ2lzdGVyRWxlbWVudChhcnJheSk7XG4gICAgICBjb250ZXh0LnB1c2goXG4gICAgICAgIFNldE9wZXJhdGlvbi5jcmVhdGUoXG4gICAgICAgICAga2V5LFxuICAgICAgICAgIGFycmF5LmRlZXBjb3B5KCksXG4gICAgICAgICAgdGFyZ2V0LmdldENyZWF0ZWRBdCgpLFxuICAgICAgICAgIHRpY2tldCxcbiAgICAgICAgKSxcbiAgICAgICk7XG4gICAgICBmb3IgKGNvbnN0IGVsZW1lbnQgb2YgdmFsdWUpIHtcbiAgICAgICAgQXJyYXlQcm94eS5wdXNoSW50ZXJuYWwoY29udGV4dCwgYXJyYXksIGVsZW1lbnQpO1xuICAgICAgfVxuICAgIH0gZWxzZSBpZiAodHlwZW9mIHZhbHVlID09PSAnb2JqZWN0Jykge1xuICAgICAgaWYgKHZhbHVlIGluc3RhbmNlb2YgUGxhaW5UZXh0KSB7XG4gICAgICAgIHRhcmdldC5zZXQoa2V5LCB2YWx1ZSk7XG4gICAgICAgIGNvbnRleHQucmVnaXN0ZXJFbGVtZW50KHZhbHVlKTtcbiAgICAgICAgY29udGV4dC5wdXNoKFxuICAgICAgICAgIFNldE9wZXJhdGlvbi5jcmVhdGUoXG4gICAgICAgICAgICBrZXksXG4gICAgICAgICAgICB2YWx1ZS5kZWVwY29weSgpLFxuICAgICAgICAgICAgdGFyZ2V0LmdldENyZWF0ZWRBdCgpLFxuICAgICAgICAgICAgdGlja2V0LFxuICAgICAgICAgICksXG4gICAgICAgICk7XG4gICAgICB9IGVsc2Uge1xuICAgICA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ICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgaWYgKG1ldGhvZCA9PT0gJ3NldFN0eWxlJykge1xuICAgICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICBmcm9tSWR4OiBudW1iZXIsXG4gICAgICAgICAgICB0b0lkeDogbnVtYmVyLFxuICAgICAgICAgICAgYXR0cmlidXRlczogeyBba2V5OiBzdHJpbmddOiBzdHJpbmcgfSxcbiAgICAgICAgICApOiBib29sZWFuID0+IHtcbiAgICAgICAgICAgIHRoaXMuc2V0U3R5bGUodGFyZ2V0LCBmcm9tSWR4LCB0b0lkeCwgYXR0cmlidXRlcyk7XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgICB9O1xuICAgICAgICB9IGVsc2UgaWYgKG1ldGhvZCA9PT0gJ3VwZGF0ZVNlbGVjdGlvbicpIHtcbiAgICAgICAgICByZXR1cm4gKGZyb21JZHg6IG51bWJlciwgdG9JZHg6IG51bWJlcik6IGJvb2xlYW4gPT4ge1xuICAgICAgICAgICAgdGhpcy51cGRhdGVTZWxlY3Rpb24odGFyZ2V0LCBmcm9tSWR4LCB0b0lkeCk7XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgICB9O1xuICAgICAgICB9IGVsc2UgaWYgKG1ldGhvZCA9PT0gJ2dldEFubm90YXRlZFN0cmluZycpIHtcbiAgICAgICAgICByZXR1cm4gKCk6IHN0cmluZyA9PiB7XG4gICAgICAgICAgICByZXR1cm4gdGFyZ2V0LmdldEFubm90YXRlZFN0cmluZygpO1xuICAgICAgICAgIH07XG4gICAgICAgIH0gZWxzZSBpZiAobWV0aG9kID09PSAnZ2V0VmFsdWUnKSB7XG4gICAgICAgICAgcmV0dXJuICgpOiBBcnJheTxSaWNoVGV4dFZhbD4gPT4ge1xuICAgICAgICAgICAgcmV0dXJuIHRhcmdldC5nZXRWYWx1ZSgpO1xuICAgICAgICAgIH07XG4gICAgICAgIH0gZWxzZSBpZiAobW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G5vZGUubGVmdDtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBsZXQgcGFyZW50ID0gbm9kZS5wYXJlbnQ7XG4gICAgICAgICAgbGV0IGNoaWxkTm9kZSA9IG5vZGU7XG4gICAgICAgICAgd2hpbGUgKHBhcmVudCAmJiBjaGlsZE5vZGUgPT09IHBhcmVudC5sZWZ0KSB7XG4gICAgICAgICAgICBjaGlsZE5vZGUgPSBwYXJlbnQ7XG4gICAgICAgICAgICBwYXJlbnQgPSBwYXJlbnQucGFyZW50O1xuICAgICAgICAgIH1cbiAgICAgICAgICByZXR1cm4gcGFyZW50O1xuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICByZXR1cm4gbm9kZTtcbiAgICAgIH1cbiAgICB9XG4gICAgcmV0dXJuIG51bGw7XG4gIH1cblxuICBwdWJsaWMgbGFzdEVudHJ5KCk6IEVudHJ5PEssIFY+IHtcbiAgICBpZiAoIXRoaXMucm9vdCkge1xuICAgICAgcmV0dXJuIHRoaXMucm9vdDtcbiAgICB9XG5cbiAgICBsZXQgbm9kZSA9IHRoaXMucm9vdDtcbiAgICB3aGlsZSAobm9kZS5yaWdodCkge1xuICAgICAgbm9kZSA9IG5vZGUucmlnaHQ7XG4gICAgfVxuICAgIHJldHVybiBub2RlO1xuICB9XG5cbiAgcHVibGljIHNpemUoKTogbnVtYmVyIHtcbiAgICByZXR1cm4gdGhpcy5jb3VudGVyO1xuICB9XG5cbiAgcHVibGljIGlzRW1wdHkoKTogYm9vbGVhbiB7XG4gICAgcmV0dXJuIHRoaXMuY291bnRlciA9PT0gMDtcbiAgfVxuXG4gIHByaXZhdGUgZ2V0SW50ZXJuYWwobm9kZTogTExSQk5vZGU8SywgVj4sIGtleTogSyk6IExMUkJOb2RlPEssIFY+IHtcbiAgICB3aGlsZSAobm9kZSkge1xuICAgICAgY29uc3QgY29tcGFyZSA9IHRoaXMuY29tcGFyYXRvcihrZXksIG5vZGUua2V5KTtcbiAgICAgIGlm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XBvcnQgTG9uZyBmcm9tICdsb25nJztcbmltcG9ydCB7IENsaWVudCwgQ2xpZW50T3B0aW9ucyB9IGZyb20gJy4vY29yZS9jbGllbnQnO1xuaW1wb3J0IHsgRG9jdW1lbnQgfSBmcm9tICcuL2RvY3VtZW50L2RvY3VtZW50JztcblxuLy8geW9ya2llIG5hbWVzcGFjZS5cbi8vICBlLmcpIHlvcmtpZS5jcmVhdGVDbGllbnQoLi4uKVxuZXhwb3J0IGRlZmF1bHQge1xuICBjcmVhdGVDbGllbnQ6IGZ1bmN0aW9uIChycGNBZGRyOiBzdHJpbmcsIG9wdHM/OiBDbGllbnRPcHRpb25zKTogQ2xpZW50IHtcbiAgICByZXR1cm4gbmV3IENsaWVudChycGNBZGRyLCBvcHRzKTtcbiAgfSxcbiAgY3JlYXRlRG9jdW1lbnQ6IGZ1bmN0aW9uIChjb2xsZWN0aW9uOiBzdHJpbmcsIGRvY3VtZW50OiBzdHJpbmcpOiBEb2N1bWVudCB7XG4gICAgcmV0dXJuIG5ldyBEb2N1bWVudChjb2xsZWN0aW9uLCBkb2N1bWVudCk7XG4gIH0sXG4gIExvbmc6IExvbmcsXG59O1xuIl0sInNvdXJjZVJvb3QiOiIifQ== \ No newline at end of file diff --git a/src/api/yorkie.proto b/src/api/yorkie.proto index e7dcd6dea..0ccb015e6 100644 --- a/src/api/yorkie.proto +++ b/src/api/yorkie.proto @@ -213,7 +213,7 @@ message Operation { message JSONElementSimple { TimeTicket created_at = 1; - TimeTicket updated_at = 2; + TimeTicket moved_at = 2; TimeTicket removed_at = 3; ValueType type = 4; bytes value = 5; @@ -227,32 +227,32 @@ message JSONElement { message Object { repeated RHTNode nodes = 1; TimeTicket created_at = 2; - TimeTicket updated_at = 3; + TimeTicket moved_at = 3; TimeTicket removed_at = 4; } message Array { repeated RGANode nodes = 1; TimeTicket created_at = 2; - TimeTicket updated_at = 3; + TimeTicket moved_at = 3; TimeTicket removed_at = 4; } message Primitive { ValueType type = 1; bytes value = 2; TimeTicket created_at = 3; - TimeTicket updated_at = 4; + TimeTicket moved_at = 4; TimeTicket removed_at = 5; } message Text { repeated TextNode nodes = 1; TimeTicket created_at = 2; - TimeTicket updated_at = 3; + TimeTicket moved_at = 3; TimeTicket removed_at = 4; } message RichText { repeated RichTextNode nodes = 1; TimeTicket created_at = 2; - TimeTicket updated_at = 3; + TimeTicket moved_at = 3; TimeTicket removed_at = 4; } message Counter { diff --git a/src/api/yorkie_pb.d.ts b/src/api/yorkie_pb.d.ts index 2ed631ee2..66e039c38 100644 --- a/src/api/yorkie_pb.d.ts +++ b/src/api/yorkie_pb.d.ts @@ -950,10 +950,10 @@ export class JSONElementSimple extends jspb.Message { hasCreatedAt(): boolean; clearCreatedAt(): JSONElementSimple; - getUpdatedAt(): TimeTicket | undefined; - setUpdatedAt(value?: TimeTicket): JSONElementSimple; - hasUpdatedAt(): boolean; - clearUpdatedAt(): JSONElementSimple; + getMovedAt(): TimeTicket | undefined; + setMovedAt(value?: TimeTicket): JSONElementSimple; + hasMovedAt(): boolean; + clearMovedAt(): JSONElementSimple; getRemovedAt(): TimeTicket | undefined; setRemovedAt(value?: TimeTicket): JSONElementSimple; @@ -979,7 +979,7 @@ export class JSONElementSimple extends jspb.Message { export namespace JSONElementSimple { export type AsObject = { createdAt?: TimeTicket.AsObject, - updatedAt?: TimeTicket.AsObject, + movedAt?: TimeTicket.AsObject, removedAt?: TimeTicket.AsObject, type: ValueType, value: Uint8Array | string, @@ -1029,12 +1029,12 @@ export class JSONElement extends jspb.Message { export namespace JSONElement { export type AsObject = { - object?: JSONElement.Object.AsObject, - array?: JSONElement.Array.AsObject, - primitive?: JSONElement.Primitive.AsObject, - text?: JSONElement.Text.AsObject, - richText?: JSONElement.RichText.AsObject, - counter?: JSONElement.Counter.AsObject, + object?: Object.AsObject, + array?: Array.AsObject, + primitive?: Primitive.AsObject, + text?: Text.AsObject, + richText?: RichText.AsObject, + counter?: Counter.AsObject, } export class Object extends jspb.Message { @@ -1048,10 +1048,10 @@ export namespace JSONElement { hasCreatedAt(): boolean; clearCreatedAt(): Object; - getUpdatedAt(): TimeTicket | undefined; - setUpdatedAt(value?: TimeTicket): Object; - hasUpdatedAt(): boolean; - clearUpdatedAt(): Object; + getMovedAt(): TimeTicket | undefined; + setMovedAt(value?: TimeTicket): Object; + hasMovedAt(): boolean; + clearMovedAt(): Object; getRemovedAt(): TimeTicket | undefined; setRemovedAt(value?: TimeTicket): Object; @@ -1070,7 +1070,7 @@ export namespace JSONElement { export type AsObject = { nodesList: Array, createdAt?: TimeTicket.AsObject, - updatedAt?: TimeTicket.AsObject, + movedAt?: TimeTicket.AsObject, removedAt?: TimeTicket.AsObject, } } @@ -1087,10 +1087,10 @@ export namespace JSONElement { hasCreatedAt(): boolean; clearCreatedAt(): Array; - getUpdatedAt(): TimeTicket | undefined; - setUpdatedAt(value?: TimeTicket): Array; - hasUpdatedAt(): boolean; - clearUpdatedAt(): Array; + getMovedAt(): TimeTicket | undefined; + setMovedAt(value?: TimeTicket): Array; + hasMovedAt(): boolean; + clearMovedAt(): Array; getRemovedAt(): TimeTicket | undefined; setRemovedAt(value?: TimeTicket): Array; @@ -1109,7 +1109,7 @@ export namespace JSONElement { export type AsObject = { nodesList: Array, createdAt?: TimeTicket.AsObject, - updatedAt?: TimeTicket.AsObject, + movedAt?: TimeTicket.AsObject, removedAt?: TimeTicket.AsObject, } } @@ -1129,10 +1129,10 @@ export namespace JSONElement { hasCreatedAt(): boolean; clearCreatedAt(): Primitive; - getUpdatedAt(): TimeTicket | undefined; - setUpdatedAt(value?: TimeTicket): Primitive; - hasUpdatedAt(): boolean; - clearUpdatedAt(): Primitive; + getMovedAt(): TimeTicket | undefined; + setMovedAt(value?: TimeTicket): Primitive; + hasMovedAt(): boolean; + clearMovedAt(): Primitive; getRemovedAt(): TimeTicket | undefined; setRemovedAt(value?: TimeTicket): Primitive; @@ -1152,7 +1152,7 @@ export namespace JSONElement { type: ValueType, value: Uint8Array | string, createdAt?: TimeTicket.AsObject, - updatedAt?: TimeTicket.AsObject, + movedAt?: TimeTicket.AsObject, removedAt?: TimeTicket.AsObject, } } @@ -1169,10 +1169,10 @@ export namespace JSONElement { hasCreatedAt(): boolean; clearCreatedAt(): Text; - getUpdatedAt(): TimeTicket | undefined; - setUpdatedAt(value?: TimeTicket): Text; - hasUpdatedAt(): boolean; - clearUpdatedAt(): Text; + getMovedAt(): TimeTicket | undefined; + setMovedAt(value?: TimeTicket): Text; + hasMovedAt(): boolean; + clearMovedAt(): Text; getRemovedAt(): TimeTicket | undefined; setRemovedAt(value?: TimeTicket): Text; @@ -1191,7 +1191,7 @@ export namespace JSONElement { export type AsObject = { nodesList: Array, createdAt?: TimeTicket.AsObject, - updatedAt?: TimeTicket.AsObject, + movedAt?: TimeTicket.AsObject, removedAt?: TimeTicket.AsObject, } } @@ -1208,10 +1208,10 @@ export namespace JSONElement { hasCreatedAt(): boolean; clearCreatedAt(): RichText; - getUpdatedAt(): TimeTicket | undefined; - setUpdatedAt(value?: TimeTicket): RichText; - hasUpdatedAt(): boolean; - clearUpdatedAt(): RichText; + getMovedAt(): TimeTicket | undefined; + setMovedAt(value?: TimeTicket): RichText; + hasMovedAt(): boolean; + clearMovedAt(): RichText; getRemovedAt(): TimeTicket | undefined; setRemovedAt(value?: TimeTicket): RichText; @@ -1230,7 +1230,7 @@ export namespace JSONElement { export type AsObject = { nodesList: Array, createdAt?: TimeTicket.AsObject, - updatedAt?: TimeTicket.AsObject, + movedAt?: TimeTicket.AsObject, removedAt?: TimeTicket.AsObject, } } diff --git a/src/api/yorkie_pb.js b/src/api/yorkie_pb.js index b46157303..19d637725 100644 --- a/src/api/yorkie_pb.js +++ b/src/api/yorkie_pb.js @@ -8278,7 +8278,7 @@ proto.api.JSONElementSimple.prototype.toObject = function(opt_includeInstance) { proto.api.JSONElementSimple.toObject = function(includeInstance, msg) { var f, obj = { createdAt: (f = msg.getCreatedAt()) && proto.api.TimeTicket.toObject(includeInstance, f), - updatedAt: (f = msg.getUpdatedAt()) && proto.api.TimeTicket.toObject(includeInstance, f), + movedAt: (f = msg.getMovedAt()) && proto.api.TimeTicket.toObject(includeInstance, f), removedAt: (f = msg.getRemovedAt()) && proto.api.TimeTicket.toObject(includeInstance, f), type: jspb.Message.getFieldWithDefault(msg, 4, 0), value: msg.getValue_asB64() @@ -8326,7 +8326,7 @@ proto.api.JSONElementSimple.deserializeBinaryFromReader = function(msg, reader) case 2: var value = new proto.api.TimeTicket; reader.readMessage(value,proto.api.TimeTicket.deserializeBinaryFromReader); - msg.setUpdatedAt(value); + msg.setMovedAt(value); break; case 3: var value = new proto.api.TimeTicket; @@ -8378,7 +8378,7 @@ proto.api.JSONElementSimple.serializeBinaryToWriter = function(message, writer) proto.api.TimeTicket.serializeBinaryToWriter ); } - f = message.getUpdatedAt(); + f = message.getMovedAt(); if (f != null) { writer.writeMessage( 2, @@ -8449,10 +8449,10 @@ proto.api.JSONElementSimple.prototype.hasCreatedAt = function() { /** - * optional TimeTicket updated_at = 2; + * optional TimeTicket moved_at = 2; * @return {?proto.api.TimeTicket} */ -proto.api.JSONElementSimple.prototype.getUpdatedAt = function() { +proto.api.JSONElementSimple.prototype.getMovedAt = function() { return /** @type{?proto.api.TimeTicket} */ ( jspb.Message.getWrapperField(this, proto.api.TimeTicket, 2)); }; @@ -8462,7 +8462,7 @@ proto.api.JSONElementSimple.prototype.getUpdatedAt = function() { * @param {?proto.api.TimeTicket|undefined} value * @return {!proto.api.JSONElementSimple} returns this */ -proto.api.JSONElementSimple.prototype.setUpdatedAt = function(value) { +proto.api.JSONElementSimple.prototype.setMovedAt = function(value) { return jspb.Message.setWrapperField(this, 2, value); }; @@ -8471,8 +8471,8 @@ proto.api.JSONElementSimple.prototype.setUpdatedAt = function(value) { * Clears the message field making it undefined. * @return {!proto.api.JSONElementSimple} returns this */ -proto.api.JSONElementSimple.prototype.clearUpdatedAt = function() { - return this.setUpdatedAt(undefined); +proto.api.JSONElementSimple.prototype.clearMovedAt = function() { + return this.setMovedAt(undefined); }; @@ -8480,7 +8480,7 @@ proto.api.JSONElementSimple.prototype.clearUpdatedAt = function() { * Returns whether this field is set. * @return {boolean} */ -proto.api.JSONElementSimple.prototype.hasUpdatedAt = function() { +proto.api.JSONElementSimple.prototype.hasMovedAt = function() { return jspb.Message.getField(this, 2) != null; }; @@ -8838,7 +8838,7 @@ proto.api.JSONElement.Object.toObject = function(includeInstance, msg) { nodesList: jspb.Message.toObjectList(msg.getNodesList(), proto.api.RHTNode.toObject, includeInstance), createdAt: (f = msg.getCreatedAt()) && proto.api.TimeTicket.toObject(includeInstance, f), - updatedAt: (f = msg.getUpdatedAt()) && proto.api.TimeTicket.toObject(includeInstance, f), + movedAt: (f = msg.getMovedAt()) && proto.api.TimeTicket.toObject(includeInstance, f), removedAt: (f = msg.getRemovedAt()) && proto.api.TimeTicket.toObject(includeInstance, f) }; @@ -8889,7 +8889,7 @@ proto.api.JSONElement.Object.deserializeBinaryFromReader = function(msg, reader) case 3: var value = new proto.api.TimeTicket; reader.readMessage(value,proto.api.TimeTicket.deserializeBinaryFromReader); - msg.setUpdatedAt(value); + msg.setMovedAt(value); break; case 4: var value = new proto.api.TimeTicket; @@ -8941,7 +8941,7 @@ proto.api.JSONElement.Object.serializeBinaryToWriter = function(message, writer) proto.api.TimeTicket.serializeBinaryToWriter ); } - f = message.getUpdatedAt(); + f = message.getMovedAt(); if (f != null) { writer.writeMessage( 3, @@ -9036,10 +9036,10 @@ proto.api.JSONElement.Object.prototype.hasCreatedAt = function() { /** - * optional TimeTicket updated_at = 3; + * optional TimeTicket moved_at = 3; * @return {?proto.api.TimeTicket} */ -proto.api.JSONElement.Object.prototype.getUpdatedAt = function() { +proto.api.JSONElement.Object.prototype.getMovedAt = function() { return /** @type{?proto.api.TimeTicket} */ ( jspb.Message.getWrapperField(this, proto.api.TimeTicket, 3)); }; @@ -9049,7 +9049,7 @@ proto.api.JSONElement.Object.prototype.getUpdatedAt = function() { * @param {?proto.api.TimeTicket|undefined} value * @return {!proto.api.JSONElement.Object} returns this */ -proto.api.JSONElement.Object.prototype.setUpdatedAt = function(value) { +proto.api.JSONElement.Object.prototype.setMovedAt = function(value) { return jspb.Message.setWrapperField(this, 3, value); }; @@ -9058,8 +9058,8 @@ proto.api.JSONElement.Object.prototype.setUpdatedAt = function(value) { * Clears the message field making it undefined. * @return {!proto.api.JSONElement.Object} returns this */ -proto.api.JSONElement.Object.prototype.clearUpdatedAt = function() { - return this.setUpdatedAt(undefined); +proto.api.JSONElement.Object.prototype.clearMovedAt = function() { + return this.setMovedAt(undefined); }; @@ -9067,7 +9067,7 @@ proto.api.JSONElement.Object.prototype.clearUpdatedAt = function() { * Returns whether this field is set. * @return {boolean} */ -proto.api.JSONElement.Object.prototype.hasUpdatedAt = function() { +proto.api.JSONElement.Object.prototype.hasMovedAt = function() { return jspb.Message.getField(this, 3) != null; }; @@ -9151,7 +9151,7 @@ proto.api.JSONElement.Array.toObject = function(includeInstance, msg) { nodesList: jspb.Message.toObjectList(msg.getNodesList(), proto.api.RGANode.toObject, includeInstance), createdAt: (f = msg.getCreatedAt()) && proto.api.TimeTicket.toObject(includeInstance, f), - updatedAt: (f = msg.getUpdatedAt()) && proto.api.TimeTicket.toObject(includeInstance, f), + movedAt: (f = msg.getMovedAt()) && proto.api.TimeTicket.toObject(includeInstance, f), removedAt: (f = msg.getRemovedAt()) && proto.api.TimeTicket.toObject(includeInstance, f) }; @@ -9202,7 +9202,7 @@ proto.api.JSONElement.Array.deserializeBinaryFromReader = function(msg, reader) case 3: var value = new proto.api.TimeTicket; reader.readMessage(value,proto.api.TimeTicket.deserializeBinaryFromReader); - msg.setUpdatedAt(value); + msg.setMovedAt(value); break; case 4: var value = new proto.api.TimeTicket; @@ -9254,7 +9254,7 @@ proto.api.JSONElement.Array.serializeBinaryToWriter = function(message, writer) proto.api.TimeTicket.serializeBinaryToWriter ); } - f = message.getUpdatedAt(); + f = message.getMovedAt(); if (f != null) { writer.writeMessage( 3, @@ -9349,10 +9349,10 @@ proto.api.JSONElement.Array.prototype.hasCreatedAt = function() { /** - * optional TimeTicket updated_at = 3; + * optional TimeTicket moved_at = 3; * @return {?proto.api.TimeTicket} */ -proto.api.JSONElement.Array.prototype.getUpdatedAt = function() { +proto.api.JSONElement.Array.prototype.getMovedAt = function() { return /** @type{?proto.api.TimeTicket} */ ( jspb.Message.getWrapperField(this, proto.api.TimeTicket, 3)); }; @@ -9362,7 +9362,7 @@ proto.api.JSONElement.Array.prototype.getUpdatedAt = function() { * @param {?proto.api.TimeTicket|undefined} value * @return {!proto.api.JSONElement.Array} returns this */ -proto.api.JSONElement.Array.prototype.setUpdatedAt = function(value) { +proto.api.JSONElement.Array.prototype.setMovedAt = function(value) { return jspb.Message.setWrapperField(this, 3, value); }; @@ -9371,8 +9371,8 @@ proto.api.JSONElement.Array.prototype.setUpdatedAt = function(value) { * Clears the message field making it undefined. * @return {!proto.api.JSONElement.Array} returns this */ -proto.api.JSONElement.Array.prototype.clearUpdatedAt = function() { - return this.setUpdatedAt(undefined); +proto.api.JSONElement.Array.prototype.clearMovedAt = function() { + return this.setMovedAt(undefined); }; @@ -9380,7 +9380,7 @@ proto.api.JSONElement.Array.prototype.clearUpdatedAt = function() { * Returns whether this field is set. * @return {boolean} */ -proto.api.JSONElement.Array.prototype.hasUpdatedAt = function() { +proto.api.JSONElement.Array.prototype.hasMovedAt = function() { return jspb.Message.getField(this, 3) != null; }; @@ -9457,7 +9457,7 @@ proto.api.JSONElement.Primitive.toObject = function(includeInstance, msg) { type: jspb.Message.getFieldWithDefault(msg, 1, 0), value: msg.getValue_asB64(), createdAt: (f = msg.getCreatedAt()) && proto.api.TimeTicket.toObject(includeInstance, f), - updatedAt: (f = msg.getUpdatedAt()) && proto.api.TimeTicket.toObject(includeInstance, f), + movedAt: (f = msg.getMovedAt()) && proto.api.TimeTicket.toObject(includeInstance, f), removedAt: (f = msg.getRemovedAt()) && proto.api.TimeTicket.toObject(includeInstance, f) }; @@ -9511,7 +9511,7 @@ proto.api.JSONElement.Primitive.deserializeBinaryFromReader = function(msg, read case 4: var value = new proto.api.TimeTicket; reader.readMessage(value,proto.api.TimeTicket.deserializeBinaryFromReader); - msg.setUpdatedAt(value); + msg.setMovedAt(value); break; case 5: var value = new proto.api.TimeTicket; @@ -9569,7 +9569,7 @@ proto.api.JSONElement.Primitive.serializeBinaryToWriter = function(message, writ proto.api.TimeTicket.serializeBinaryToWriter ); } - f = message.getUpdatedAt(); + f = message.getMovedAt(); if (f != null) { writer.writeMessage( 4, @@ -9686,10 +9686,10 @@ proto.api.JSONElement.Primitive.prototype.hasCreatedAt = function() { /** - * optional TimeTicket updated_at = 4; + * optional TimeTicket moved_at = 4; * @return {?proto.api.TimeTicket} */ -proto.api.JSONElement.Primitive.prototype.getUpdatedAt = function() { +proto.api.JSONElement.Primitive.prototype.getMovedAt = function() { return /** @type{?proto.api.TimeTicket} */ ( jspb.Message.getWrapperField(this, proto.api.TimeTicket, 4)); }; @@ -9699,7 +9699,7 @@ proto.api.JSONElement.Primitive.prototype.getUpdatedAt = function() { * @param {?proto.api.TimeTicket|undefined} value * @return {!proto.api.JSONElement.Primitive} returns this */ -proto.api.JSONElement.Primitive.prototype.setUpdatedAt = function(value) { +proto.api.JSONElement.Primitive.prototype.setMovedAt = function(value) { return jspb.Message.setWrapperField(this, 4, value); }; @@ -9708,8 +9708,8 @@ proto.api.JSONElement.Primitive.prototype.setUpdatedAt = function(value) { * Clears the message field making it undefined. * @return {!proto.api.JSONElement.Primitive} returns this */ -proto.api.JSONElement.Primitive.prototype.clearUpdatedAt = function() { - return this.setUpdatedAt(undefined); +proto.api.JSONElement.Primitive.prototype.clearMovedAt = function() { + return this.setMovedAt(undefined); }; @@ -9717,7 +9717,7 @@ proto.api.JSONElement.Primitive.prototype.clearUpdatedAt = function() { * Returns whether this field is set. * @return {boolean} */ -proto.api.JSONElement.Primitive.prototype.hasUpdatedAt = function() { +proto.api.JSONElement.Primitive.prototype.hasMovedAt = function() { return jspb.Message.getField(this, 4) != null; }; @@ -9801,7 +9801,7 @@ proto.api.JSONElement.Text.toObject = function(includeInstance, msg) { nodesList: jspb.Message.toObjectList(msg.getNodesList(), proto.api.TextNode.toObject, includeInstance), createdAt: (f = msg.getCreatedAt()) && proto.api.TimeTicket.toObject(includeInstance, f), - updatedAt: (f = msg.getUpdatedAt()) && proto.api.TimeTicket.toObject(includeInstance, f), + movedAt: (f = msg.getMovedAt()) && proto.api.TimeTicket.toObject(includeInstance, f), removedAt: (f = msg.getRemovedAt()) && proto.api.TimeTicket.toObject(includeInstance, f) }; @@ -9852,7 +9852,7 @@ proto.api.JSONElement.Text.deserializeBinaryFromReader = function(msg, reader) { case 3: var value = new proto.api.TimeTicket; reader.readMessage(value,proto.api.TimeTicket.deserializeBinaryFromReader); - msg.setUpdatedAt(value); + msg.setMovedAt(value); break; case 4: var value = new proto.api.TimeTicket; @@ -9904,7 +9904,7 @@ proto.api.JSONElement.Text.serializeBinaryToWriter = function(message, writer) { proto.api.TimeTicket.serializeBinaryToWriter ); } - f = message.getUpdatedAt(); + f = message.getMovedAt(); if (f != null) { writer.writeMessage( 3, @@ -9999,10 +9999,10 @@ proto.api.JSONElement.Text.prototype.hasCreatedAt = function() { /** - * optional TimeTicket updated_at = 3; + * optional TimeTicket moved_at = 3; * @return {?proto.api.TimeTicket} */ -proto.api.JSONElement.Text.prototype.getUpdatedAt = function() { +proto.api.JSONElement.Text.prototype.getMovedAt = function() { return /** @type{?proto.api.TimeTicket} */ ( jspb.Message.getWrapperField(this, proto.api.TimeTicket, 3)); }; @@ -10012,7 +10012,7 @@ proto.api.JSONElement.Text.prototype.getUpdatedAt = function() { * @param {?proto.api.TimeTicket|undefined} value * @return {!proto.api.JSONElement.Text} returns this */ -proto.api.JSONElement.Text.prototype.setUpdatedAt = function(value) { +proto.api.JSONElement.Text.prototype.setMovedAt = function(value) { return jspb.Message.setWrapperField(this, 3, value); }; @@ -10021,8 +10021,8 @@ proto.api.JSONElement.Text.prototype.setUpdatedAt = function(value) { * Clears the message field making it undefined. * @return {!proto.api.JSONElement.Text} returns this */ -proto.api.JSONElement.Text.prototype.clearUpdatedAt = function() { - return this.setUpdatedAt(undefined); +proto.api.JSONElement.Text.prototype.clearMovedAt = function() { + return this.setMovedAt(undefined); }; @@ -10030,7 +10030,7 @@ proto.api.JSONElement.Text.prototype.clearUpdatedAt = function() { * Returns whether this field is set. * @return {boolean} */ -proto.api.JSONElement.Text.prototype.hasUpdatedAt = function() { +proto.api.JSONElement.Text.prototype.hasMovedAt = function() { return jspb.Message.getField(this, 3) != null; }; @@ -10114,7 +10114,7 @@ proto.api.JSONElement.RichText.toObject = function(includeInstance, msg) { nodesList: jspb.Message.toObjectList(msg.getNodesList(), proto.api.RichTextNode.toObject, includeInstance), createdAt: (f = msg.getCreatedAt()) && proto.api.TimeTicket.toObject(includeInstance, f), - updatedAt: (f = msg.getUpdatedAt()) && proto.api.TimeTicket.toObject(includeInstance, f), + movedAt: (f = msg.getMovedAt()) && proto.api.TimeTicket.toObject(includeInstance, f), removedAt: (f = msg.getRemovedAt()) && proto.api.TimeTicket.toObject(includeInstance, f) }; @@ -10165,7 +10165,7 @@ proto.api.JSONElement.RichText.deserializeBinaryFromReader = function(msg, reade case 3: var value = new proto.api.TimeTicket; reader.readMessage(value,proto.api.TimeTicket.deserializeBinaryFromReader); - msg.setUpdatedAt(value); + msg.setMovedAt(value); break; case 4: var value = new proto.api.TimeTicket; @@ -10217,7 +10217,7 @@ proto.api.JSONElement.RichText.serializeBinaryToWriter = function(message, write proto.api.TimeTicket.serializeBinaryToWriter ); } - f = message.getUpdatedAt(); + f = message.getMovedAt(); if (f != null) { writer.writeMessage( 3, @@ -10312,10 +10312,10 @@ proto.api.JSONElement.RichText.prototype.hasCreatedAt = function() { /** - * optional TimeTicket updated_at = 3; + * optional TimeTicket moved_at = 3; * @return {?proto.api.TimeTicket} */ -proto.api.JSONElement.RichText.prototype.getUpdatedAt = function() { +proto.api.JSONElement.RichText.prototype.getMovedAt = function() { return /** @type{?proto.api.TimeTicket} */ ( jspb.Message.getWrapperField(this, proto.api.TimeTicket, 3)); }; @@ -10325,7 +10325,7 @@ proto.api.JSONElement.RichText.prototype.getUpdatedAt = function() { * @param {?proto.api.TimeTicket|undefined} value * @return {!proto.api.JSONElement.RichText} returns this */ -proto.api.JSONElement.RichText.prototype.setUpdatedAt = function(value) { +proto.api.JSONElement.RichText.prototype.setMovedAt = function(value) { return jspb.Message.setWrapperField(this, 3, value); }; @@ -10334,8 +10334,8 @@ proto.api.JSONElement.RichText.prototype.setUpdatedAt = function(value) { * Clears the message field making it undefined. * @return {!proto.api.JSONElement.RichText} returns this */ -proto.api.JSONElement.RichText.prototype.clearUpdatedAt = function() { - return this.setUpdatedAt(undefined); +proto.api.JSONElement.RichText.prototype.clearMovedAt = function() { + return this.setMovedAt(undefined); }; @@ -10343,7 +10343,7 @@ proto.api.JSONElement.RichText.prototype.clearUpdatedAt = function() { * Returns whether this field is set. * @return {boolean} */ -proto.api.JSONElement.RichText.prototype.hasUpdatedAt = function() { +proto.api.JSONElement.RichText.prototype.hasMovedAt = function() { return jspb.Message.getField(this, 3) != null; }; diff --git a/src/document/json/counter.ts b/src/document/json/counter.ts index 931034411..52d43ed65 100644 --- a/src/document/json/counter.ts +++ b/src/document/json/counter.ts @@ -79,7 +79,7 @@ export class Counter extends JSONElement { public deepcopy(): Counter { const counter = Counter.of(this.value, this.getCreatedAt()); - counter.setUpdatedAt(this.getUpdatedAt()); + counter.setMovedAt(this.getMovedAt()); return counter; } diff --git a/src/document/json/element.ts b/src/document/json/element.ts index a5b85e2e2..392a13465 100644 --- a/src/document/json/element.ts +++ b/src/document/json/element.ts @@ -21,7 +21,7 @@ import { TimeTicket } from '../time/ticket'; */ export abstract class JSONElement { private createdAt: TimeTicket; - private updatedAt: TimeTicket; + private movedAt: TimeTicket; private removedAt: TimeTicket; constructor(createdAt: TimeTicket) { @@ -36,17 +36,17 @@ export abstract class JSONElement { return this.createdAt; } - public getUpdatedAt(): TimeTicket { - return this.updatedAt; + public getMovedAt(): TimeTicket { + return this.movedAt; } public getRemovedAt(): TimeTicket { return this.removedAt; } - public setUpdatedAt(updatedAt: TimeTicket): boolean { - if (!this.updatedAt || (updatedAt && updatedAt.after(this.updatedAt))) { - this.updatedAt = updatedAt; + public setMovedAt(movedAt: TimeTicket): boolean { + if (!this.movedAt || (movedAt && movedAt.after(this.movedAt))) { + this.movedAt = movedAt; return true; } diff --git a/src/document/json/primitive.ts b/src/document/json/primitive.ts index fac374a0f..0e23a97ce 100644 --- a/src/document/json/primitive.ts +++ b/src/document/json/primitive.ts @@ -99,7 +99,7 @@ export class JSONPrimitive extends JSONElement { public deepcopy(): JSONPrimitive { const primitive = JSONPrimitive.of(this.value, this.getCreatedAt()); - primitive.setUpdatedAt(this.getUpdatedAt()); + primitive.setMovedAt(this.getMovedAt()); return primitive; } diff --git a/src/document/json/rga_tree_list.ts b/src/document/json/rga_tree_list.ts index 002743d98..fd1a374a7 100644 --- a/src/document/json/rga_tree_list.ts +++ b/src/document/json/rga_tree_list.ts @@ -183,12 +183,12 @@ export class RGATreeList { } if ( - !node.getValue().getUpdatedAt() || - executedAt.after(node.getValue().getUpdatedAt()) + !node.getValue().getMovedAt() || + executedAt.after(node.getValue().getMovedAt()) ) { node.release(); this.insertAfter(prevNode.getCreatedAt(), node.getValue(), executedAt); - node.getValue().setUpdatedAt(executedAt); + node.getValue().setMovedAt(executedAt); } } diff --git a/src/document/json/rht.ts b/src/document/json/rht.ts index e89bb9f95..1e9e53bdc 100644 --- a/src/document/json/rht.ts +++ b/src/document/json/rht.ts @@ -60,13 +60,13 @@ export class RHT { return new RHT(); } - public set(key: string, value: string, updatedAt: TimeTicket): void { + public set(key: string, value: string, executedAt: TimeTicket): void { const prev = this.nodeMapByKey.get(key); - if (prev === undefined || updatedAt.after(prev.getUpdatedAt())) { - const node = RHTNode.of(key, value, updatedAt); + if (prev === undefined || executedAt.after(prev.getUpdatedAt())) { + const node = RHTNode.of(key, value, executedAt); this.nodeMapByKey.set(key, node); - this.nodeMapByCreatedAt.set(updatedAt.toIDString(), node); + this.nodeMapByCreatedAt.set(executedAt.toIDString(), node); } }