diff --git a/dist/generated/qrcode_data_pb.js b/dist/generated/qrcode_data_pb.js index a41965076ef26ba10de5c6624439e575c5f668f2..e8174b2b4f1e8e1ca8b3caaa2da8a5dc01567de5 100644 --- a/dist/generated/qrcode_data_pb.js +++ b/dist/generated/qrcode_data_pb.js @@ -4279,6 +4279,201 @@ $root.vereign = (function () { }; return SealDocumentHeadData_V1; })(); + qrcode_data.Coords = (function () { + /** + * Properties of a Coords. + * @memberof vereign.protobuf.qrcode_data + * @interface ICoords + * @property {number|null} [x] Coords x + * @property {number|null} [y] Coords y + */ + /** + * Constructs a new Coords. + * @memberof vereign.protobuf.qrcode_data + * @classdesc Represents a Coords. + * @implements ICoords + * @constructor + * @param {vereign.protobuf.qrcode_data.ICoords=} [properties] Properties to set + */ + function Coords(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + /** + * Coords x. + * @member {number} x + * @memberof vereign.protobuf.qrcode_data.Coords + * @instance + */ + Coords.prototype.x = 0; + /** + * Coords y. + * @member {number} y + * @memberof vereign.protobuf.qrcode_data.Coords + * @instance + */ + Coords.prototype.y = 0; + /** + * Creates a new Coords instance using the specified properties. + * @function create + * @memberof vereign.protobuf.qrcode_data.Coords + * @static + * @param {vereign.protobuf.qrcode_data.ICoords=} [properties] Properties to set + * @returns {vereign.protobuf.qrcode_data.Coords} Coords instance + */ + Coords.create = function create(properties) { + return new Coords(properties); + }; + /** + * Encodes the specified Coords message. Does not implicitly {@link vereign.protobuf.qrcode_data.Coords.verify|verify} messages. + * @function encode + * @memberof vereign.protobuf.qrcode_data.Coords + * @static + * @param {vereign.protobuf.qrcode_data.ICoords} message Coords message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Coords.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.x != null && Object.hasOwnProperty.call(message, "x")) + writer.uint32(/* id 1, wireType 0 =*/ 8).int32(message.x); + if (message.y != null && Object.hasOwnProperty.call(message, "y")) + writer.uint32(/* id 2, wireType 0 =*/ 16).int32(message.y); + return writer; + }; + /** + * Encodes the specified Coords message, length delimited. Does not implicitly {@link vereign.protobuf.qrcode_data.Coords.verify|verify} messages. + * @function encodeDelimited + * @memberof vereign.protobuf.qrcode_data.Coords + * @static + * @param {vereign.protobuf.qrcode_data.ICoords} message Coords message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Coords.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** + * Decodes a Coords message from the specified reader or buffer. + * @function decode + * @memberof vereign.protobuf.qrcode_data.Coords + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {vereign.protobuf.qrcode_data.Coords} Coords + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Coords.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.vereign.protobuf.qrcode_data.Coords(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.x = reader.int32(); + break; + case 2: + message.y = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + /** + * Decodes a Coords message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof vereign.protobuf.qrcode_data.Coords + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {vereign.protobuf.qrcode_data.Coords} Coords + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Coords.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** + * Verifies a Coords message. + * @function verify + * @memberof vereign.protobuf.qrcode_data.Coords + * @static + * @param {Object.<string,*>} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Coords.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.x != null && message.hasOwnProperty("x")) + if (!$util.isInteger(message.x)) + return "x: integer expected"; + if (message.y != null && message.hasOwnProperty("y")) + if (!$util.isInteger(message.y)) + return "y: integer expected"; + return null; + }; + /** + * Creates a Coords message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof vereign.protobuf.qrcode_data.Coords + * @static + * @param {Object.<string,*>} object Plain object + * @returns {vereign.protobuf.qrcode_data.Coords} Coords + */ + Coords.fromObject = function fromObject(object) { + if (object instanceof $root.vereign.protobuf.qrcode_data.Coords) + return object; + var message = new $root.vereign.protobuf.qrcode_data.Coords(); + if (object.x != null) + message.x = object.x | 0; + if (object.y != null) + message.y = object.y | 0; + return message; + }; + /** + * Creates a plain object from a Coords message. Also converts values to other types if specified. + * @function toObject + * @memberof vereign.protobuf.qrcode_data.Coords + * @static + * @param {vereign.protobuf.qrcode_data.Coords} message Coords + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.<string,*>} Plain object + */ + Coords.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.x = 0; + object.y = 0; + } + if (message.x != null && message.hasOwnProperty("x")) + object.x = message.x; + if (message.y != null && message.hasOwnProperty("y")) + object.y = message.y; + return object; + }; + /** + * Converts this Coords to JSON. + * @function toJSON + * @memberof vereign.protobuf.qrcode_data.Coords + * @instance + * @returns {Object.<string,*>} JSON object + */ + Coords.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + return Coords; + })(); qrcode_data.SealIndexObject_V1 = (function () { /** * Properties of a SealIndexObject_V1. @@ -4290,6 +4485,8 @@ $root.vereign = (function () { * @property {string|null} [block] SealIndexObject_V1 block * @property {string|null} [transactionId] SealIndexObject_V1 transactionId * @property {string|null} [hashBatchId] SealIndexObject_V1 hashBatchId + * @property {string|null} [sealSize] SealIndexObject_V1 sealSize + * @property {Object.<string,vereign.protobuf.qrcode_data.ICoords>|null} [sealCoords] SealIndexObject_V1 sealCoords */ /** * Constructs a new SealIndexObject_V1. @@ -4300,6 +4497,7 @@ $root.vereign = (function () { * @param {vereign.protobuf.qrcode_data.ISealIndexObject_V1=} [properties] Properties to set */ function SealIndexObject_V1(properties) { + this.sealCoords = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4347,6 +4545,20 @@ $root.vereign = (function () { * @instance */ SealIndexObject_V1.prototype.hashBatchId = ""; + /** + * SealIndexObject_V1 sealSize. + * @member {string} sealSize + * @memberof vereign.protobuf.qrcode_data.SealIndexObject_V1 + * @instance + */ + SealIndexObject_V1.prototype.sealSize = ""; + /** + * SealIndexObject_V1 sealCoords. + * @member {Object.<string,vereign.protobuf.qrcode_data.ICoords>} sealCoords + * @memberof vereign.protobuf.qrcode_data.SealIndexObject_V1 + * @instance + */ + SealIndexObject_V1.prototype.sealCoords = $util.emptyObject; /** * Creates a new SealIndexObject_V1 instance using the specified properties. * @function create @@ -4382,6 +4594,13 @@ $root.vereign = (function () { writer.uint32(/* id 5, wireType 2 =*/ 42).string(message.transactionId); if (message.hashBatchId != null && Object.hasOwnProperty.call(message, "hashBatchId")) writer.uint32(/* id 6, wireType 2 =*/ 50).string(message.hashBatchId); + if (message.sealSize != null && Object.hasOwnProperty.call(message, "sealSize")) + writer.uint32(/* id 7, wireType 2 =*/ 58).string(message.sealSize); + if (message.sealCoords != null && Object.hasOwnProperty.call(message, "sealCoords")) + for (var keys = Object.keys(message.sealCoords), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 8, wireType 2 =*/ 66).fork().uint32(/* id 1, wireType 2 =*/ 10).string(keys[i]); + $root.vereign.protobuf.qrcode_data.Coords.encode(message.sealCoords[keys[i]], writer.uint32(/* id 2, wireType 2 =*/ 18).fork()).ldelim().ldelim(); + } return writer; }; /** @@ -4410,7 +4629,7 @@ $root.vereign = (function () { SealIndexObject_V1.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.vereign.protobuf.qrcode_data.SealIndexObject_V1(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.vereign.protobuf.qrcode_data.SealIndexObject_V1(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -4432,6 +4651,31 @@ $root.vereign = (function () { case 6: message.hashBatchId = reader.string(); break; + case 7: + message.sealSize = reader.string(); + break; + case 8: + if (message.sealCoords === $util.emptyObject) + message.sealCoords = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.vereign.protobuf.qrcode_data.Coords.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.sealCoords[key] = value; + break; default: reader.skipType(tag & 7); break; @@ -4483,6 +4727,19 @@ $root.vereign = (function () { if (message.hashBatchId != null && message.hasOwnProperty("hashBatchId")) if (!$util.isString(message.hashBatchId)) return "hashBatchId: string expected"; + if (message.sealSize != null && message.hasOwnProperty("sealSize")) + if (!$util.isString(message.sealSize)) + return "sealSize: string expected"; + if (message.sealCoords != null && message.hasOwnProperty("sealCoords")) { + if (!$util.isObject(message.sealCoords)) + return "sealCoords: object expected"; + var key = Object.keys(message.sealCoords); + for (var i = 0; i < key.length; ++i) { + var error = $root.vereign.protobuf.qrcode_data.Coords.verify(message.sealCoords[key[i]]); + if (error) + return "sealCoords." + error; + } + } return null; }; /** @@ -4512,6 +4769,18 @@ $root.vereign = (function () { message.transactionId = String(object.transactionId); if (object.hashBatchId != null) message.hashBatchId = String(object.hashBatchId); + if (object.sealSize != null) + message.sealSize = String(object.sealSize); + if (object.sealCoords) { + if (typeof object.sealCoords !== "object") + throw TypeError(".vereign.protobuf.qrcode_data.SealIndexObject_V1.sealCoords: object expected"); + message.sealCoords = {}; + for (var keys = Object.keys(object.sealCoords), i = 0; i < keys.length; ++i) { + if (typeof object.sealCoords[keys[i]] !== "object") + throw TypeError(".vereign.protobuf.qrcode_data.SealIndexObject_V1.sealCoords: object expected"); + message.sealCoords[keys[i]] = $root.vereign.protobuf.qrcode_data.Coords.fromObject(object.sealCoords[keys[i]]); + } + } return message; }; /** @@ -4527,6 +4796,8 @@ $root.vereign = (function () { if (!options) options = {}; var object = {}; + if (options.objects || options.defaults) + object.sealCoords = {}; if (options.defaults) { if (options.bytes === String) object.sealKey = ""; @@ -4540,6 +4811,7 @@ $root.vereign = (function () { object.block = ""; object.transactionId = ""; object.hashBatchId = ""; + object.sealSize = ""; } if (message.sealKey != null && message.hasOwnProperty("sealKey")) object.sealKey = options.bytes === String ? $util.base64.encode(message.sealKey, 0, message.sealKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.sealKey) : message.sealKey; @@ -4553,6 +4825,14 @@ $root.vereign = (function () { object.transactionId = message.transactionId; if (message.hashBatchId != null && message.hasOwnProperty("hashBatchId")) object.hashBatchId = message.hashBatchId; + if (message.sealSize != null && message.hasOwnProperty("sealSize")) + object.sealSize = message.sealSize; + var keys2; + if (message.sealCoords && (keys2 = Object.keys(message.sealCoords)).length) { + object.sealCoords = {}; + for (var j = 0; j < keys2.length; ++j) + object.sealCoords[keys2[j]] = $root.vereign.protobuf.qrcode_data.Coords.toObject(message.sealCoords[keys2[j]], options); + } return object; }; /** diff --git a/dist/types.d.ts b/dist/types.d.ts index 932fba52c90677507f62c6a844e12940d9b04842..8ee8dbf3224b69e2b6be391c77a7d96aed892ac8 100644 --- a/dist/types.d.ts +++ b/dist/types.d.ts @@ -183,10 +183,18 @@ export interface SealHeadData { data: string; ipfsIndexCid: string; } +export interface SealCoords { + [key: string]: { + x: number; + y: number; + }; +} export interface SealIndexObject { sealKey: string; sealTailCid: string; chain: string; transactionId: string; hashBatchId: string; + sealSize: string; + sealCoords: SealCoords; }