mirror of
https://github.com/openclaw/openclaw.git
synced 2026-10-26 10:13:27 +08:00
* fix: keep optional codecs free of runtime code generation * fix: preserve registry bundles in node bootstrap artifacts * fix(packaging): resolve bundled codecs from plugin installations * fix(packaging): retain package-owned nested modules * fix(build): retain plugin-owned bundles in Docker packages * fix(gateway): include bundled node dependency closures * fix: respect nearest bundled dependency resolution
580 lines
27 KiB
Diff
580 lines
27 KiB
Diff
diff --git a/dist/src/servers/feishu-wire-codec.js b/dist/src/servers/feishu-wire-codec.js
|
|
new file mode 100644
|
|
index 0000000000000000000000000000000000000000..408a2adda53f1f53dd4bc845c0958e8ea72f6aa2
|
|
--- /dev/null
|
|
+++ b/dist/src/servers/feishu-wire-codec.js
|
|
@@ -0,0 +1,483 @@
|
|
+// Generated from feishu-wire.proto by protobufjs-cli 2.7.0; see generate-feishu-wire.mjs.
|
|
+/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-mixed-operators, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars, default-case, jsdoc/require-param*/
|
|
+import $protobuf from "protobufjs/minimal.js";
|
|
+
|
|
+const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;
|
|
+const $Object = $util.global.Object, $undefined = $util.global.undefined, $Error = $util.global.Error, $RangeError = $util.global.RangeError, $TypeError = $util.global.TypeError, $String = $util.global.String, $Array = $util.global.Array, $parseInt = $util.global.parseInt, $Number = $util.global.Number, $BigInt = $util.global.BigInt;
|
|
+
|
|
+// Keep this schema private; other protobuf clients may use the shared default root.
|
|
+const $root = {};
|
|
+
|
|
+export const Header = $root.Header = (() => {
|
|
+
|
|
+ const Header = function (properties) {
|
|
+ if (properties)
|
|
+ for (let keys = $Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
+ if (properties[keys[i]] != null && keys[i] !== "__proto__")
|
|
+ this[keys[i]] = properties[keys[i]];
|
|
+ };
|
|
+
|
|
+ Header.prototype.key = "";
|
|
+ Header.prototype.value = "";
|
|
+
|
|
+ Header.encode = function (message, writer, _depth) {
|
|
+ if (!writer)
|
|
+ writer = $Writer.create();
|
|
+ if (_depth === $undefined)
|
|
+ _depth = 0;
|
|
+ if (_depth > $util.recursionLimit)
|
|
+ throw $Error("max depth exceeded");
|
|
+ writer.uint32(10).string(message.key);
|
|
+ writer.uint32(18).string(message.value);
|
|
+ if (message.$unknowns != null && $Object.hasOwnProperty.call(message, "$unknowns"))
|
|
+ for (let i = 0; i < message.$unknowns.length; ++i)
|
|
+ writer.raw(message.$unknowns[i]);
|
|
+ return writer;
|
|
+ };
|
|
+
|
|
+ Header.decode = function (reader, length, _end, _depth, _target) {
|
|
+ if (!(reader instanceof $Reader))
|
|
+ reader = $Reader.create(reader);
|
|
+ if (_depth === $undefined)
|
|
+ _depth = 0;
|
|
+ if (_depth > $Reader.recursionLimit)
|
|
+ throw $Error("max depth exceeded");
|
|
+ let end, message;
|
|
+ if (length === $undefined)
|
|
+ end = reader.len;
|
|
+ else {
|
|
+ end = reader.pos + length;
|
|
+ if (end > reader.len)
|
|
+ throw $RangeError("index out of range");
|
|
+ length = reader.len;
|
|
+ reader.len = end;
|
|
+ }
|
|
+ message = _target || new $root.Header();
|
|
+ while (reader.pos < end) {
|
|
+ let start = reader.pos;
|
|
+ let tag = reader.tag();
|
|
+ if (tag === _end) {
|
|
+ _end = $undefined;
|
|
+ break;
|
|
+ }
|
|
+ let wireType = tag & 7;
|
|
+ switch (tag >>>= 3) {
|
|
+ case 1: {
|
|
+ if (wireType !== 2)
|
|
+ break;
|
|
+ message.key = reader.string();
|
|
+ continue;
|
|
+ }
|
|
+ case 2: {
|
|
+ if (wireType !== 2)
|
|
+ break;
|
|
+ message.value = reader.string();
|
|
+ continue;
|
|
+ }
|
|
+ }
|
|
+ reader.skipType(wireType, _depth, tag);
|
|
+ if (!reader.discardUnknown) {
|
|
+ $util.makeProp(message, "$unknowns", false);
|
|
+ (message.$unknowns || (message.$unknowns = [])).push(reader.raw(start, reader.pos));
|
|
+ }
|
|
+ }
|
|
+ if (length !== $undefined) {
|
|
+ if (reader.pos !== end)
|
|
+ throw $RangeError("index out of range");
|
|
+ reader.len = length;
|
|
+ }
|
|
+ if (_end !== $undefined)
|
|
+ throw $Error("missing end group");
|
|
+ if (!$Object.hasOwnProperty.call(message, "key"))
|
|
+ throw $util.ProtocolError("missing required 'key'", { instance: message });
|
|
+ if (!$Object.hasOwnProperty.call(message, "value"))
|
|
+ throw $util.ProtocolError("missing required 'value'", { instance: message });
|
|
+ return message;
|
|
+ };
|
|
+
|
|
+ Header.verify = function (message, _depth) {
|
|
+ if (typeof message !== "object" || message === null)
|
|
+ return "object expected";
|
|
+ if (_depth === $undefined)
|
|
+ _depth = 0;
|
|
+ if (_depth > $util.recursionLimit)
|
|
+ return "max depth exceeded";
|
|
+ if (!$util.isString(message.key))
|
|
+ return "key: string expected";
|
|
+ if (!$util.isString(message.value))
|
|
+ return "value: string expected";
|
|
+ return null;
|
|
+ };
|
|
+
|
|
+ Header.fromObject = function (object, _depth) {
|
|
+ if (object instanceof $root.Header)
|
|
+ return object;
|
|
+ if (!$util.isObject(object))
|
|
+ throw $TypeError(".Header: object expected");
|
|
+ if (_depth === $undefined)
|
|
+ _depth = 0;
|
|
+ if (_depth > $util.recursionLimit)
|
|
+ throw $Error("max depth exceeded");
|
|
+ let message = new $root.Header();
|
|
+ if (object.key != null)
|
|
+ message.key = $String(object.key);
|
|
+ if (object.value != null)
|
|
+ message.value = $String(object.value);
|
|
+ return message;
|
|
+ };
|
|
+
|
|
+ Header.toObject = function (message, options, _depth) {
|
|
+ if (!options)
|
|
+ options = {};
|
|
+ if (_depth === $undefined)
|
|
+ _depth = 0;
|
|
+ if (_depth > $util.recursionLimit)
|
|
+ throw $Error("max depth exceeded");
|
|
+ let object = {};
|
|
+ if (options.defaults) {
|
|
+ object.key = "";
|
|
+ object.value = "";
|
|
+ }
|
|
+ if (message.key != null && $Object.hasOwnProperty.call(message, "key"))
|
|
+ object.key = message.key;
|
|
+ if (message.value != null && $Object.hasOwnProperty.call(message, "value"))
|
|
+ object.value = message.value;
|
|
+ return object;
|
|
+ };
|
|
+
|
|
+ Header.prototype.toJSON = function() {
|
|
+ return Header.toObject(this, $protobuf.util.toJSONOptions);
|
|
+ };
|
|
+
|
|
+ return Header;
|
|
+})();
|
|
+
|
|
+export const Frame = $root.Frame = (() => {
|
|
+
|
|
+ const Frame = function (properties) {
|
|
+ this.headers = [];
|
|
+ if (properties)
|
|
+ for (let keys = $Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
+ if (properties[keys[i]] != null && keys[i] !== "__proto__")
|
|
+ this[keys[i]] = properties[keys[i]];
|
|
+ };
|
|
+
|
|
+ Frame.prototype.SeqID = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
|
|
+ Frame.prototype.LogID = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
|
|
+ Frame.prototype.service = 0;
|
|
+ Frame.prototype.method = 0;
|
|
+ Frame.prototype.headers = $util.emptyArray;
|
|
+ Frame.prototype.payloadEncoding = "";
|
|
+ Frame.prototype.payloadType = "";
|
|
+ Frame.prototype.payload = $util.newBuffer([]);
|
|
+ Frame.prototype.LogIDNew = "";
|
|
+
|
|
+ Frame.encode = function (message, writer, _depth) {
|
|
+ if (!writer)
|
|
+ writer = $Writer.create();
|
|
+ if (_depth === $undefined)
|
|
+ _depth = 0;
|
|
+ if (_depth > $util.recursionLimit)
|
|
+ throw $Error("max depth exceeded");
|
|
+ writer.uint32(8).uint64(message.SeqID);
|
|
+ writer.uint32(16).uint64(message.LogID);
|
|
+ writer.uint32(24).int32(message.service);
|
|
+ writer.uint32(32).int32(message.method);
|
|
+ if (message.headers != null && message.headers.length)
|
|
+ for (let i = 0; i < message.headers.length; ++i)
|
|
+ $root.Header.encode(message.headers[i], writer.uint32(42).fork(), _depth + 1).ldelim();
|
|
+ if (message.payloadEncoding != null && $Object.hasOwnProperty.call(message, "payloadEncoding"))
|
|
+ writer.uint32(50).string(message.payloadEncoding);
|
|
+ if (message.payloadType != null && $Object.hasOwnProperty.call(message, "payloadType"))
|
|
+ writer.uint32(58).string(message.payloadType);
|
|
+ if (message.payload != null && $Object.hasOwnProperty.call(message, "payload"))
|
|
+ writer.uint32(66).bytes(message.payload);
|
|
+ if (message.LogIDNew != null && $Object.hasOwnProperty.call(message, "LogIDNew"))
|
|
+ writer.uint32(74).string(message.LogIDNew);
|
|
+ if (message.$unknowns != null && $Object.hasOwnProperty.call(message, "$unknowns"))
|
|
+ for (let i = 0; i < message.$unknowns.length; ++i)
|
|
+ writer.raw(message.$unknowns[i]);
|
|
+ return writer;
|
|
+ };
|
|
+
|
|
+ Frame.decode = function (reader, length, _end, _depth, _target) {
|
|
+ if (!(reader instanceof $Reader))
|
|
+ reader = $Reader.create(reader);
|
|
+ if (_depth === $undefined)
|
|
+ _depth = 0;
|
|
+ if (_depth > $Reader.recursionLimit)
|
|
+ throw $Error("max depth exceeded");
|
|
+ let end, message;
|
|
+ if (length === $undefined)
|
|
+ end = reader.len;
|
|
+ else {
|
|
+ end = reader.pos + length;
|
|
+ if (end > reader.len)
|
|
+ throw $RangeError("index out of range");
|
|
+ length = reader.len;
|
|
+ reader.len = end;
|
|
+ }
|
|
+ message = _target || new $root.Frame();
|
|
+ while (reader.pos < end) {
|
|
+ let start = reader.pos;
|
|
+ let tag = reader.tag();
|
|
+ if (tag === _end) {
|
|
+ _end = $undefined;
|
|
+ break;
|
|
+ }
|
|
+ let wireType = tag & 7;
|
|
+ switch (tag >>>= 3) {
|
|
+ case 1: {
|
|
+ if (wireType !== 0)
|
|
+ break;
|
|
+ message.SeqID = reader.uint64();
|
|
+ continue;
|
|
+ }
|
|
+ case 2: {
|
|
+ if (wireType !== 0)
|
|
+ break;
|
|
+ message.LogID = reader.uint64();
|
|
+ continue;
|
|
+ }
|
|
+ case 3: {
|
|
+ if (wireType !== 0)
|
|
+ break;
|
|
+ message.service = reader.int32();
|
|
+ continue;
|
|
+ }
|
|
+ case 4: {
|
|
+ if (wireType !== 0)
|
|
+ break;
|
|
+ message.method = reader.int32();
|
|
+ continue;
|
|
+ }
|
|
+ case 5: {
|
|
+ if (wireType !== 2)
|
|
+ break;
|
|
+ if (!(message.headers && message.headers.length))
|
|
+ message.headers = [];
|
|
+ message.headers.push($root.Header.decode(reader, reader.uint32(), $undefined, _depth + 1));
|
|
+ continue;
|
|
+ }
|
|
+ case 6: {
|
|
+ if (wireType !== 2)
|
|
+ break;
|
|
+ message.payloadEncoding = reader.string();
|
|
+ continue;
|
|
+ }
|
|
+ case 7: {
|
|
+ if (wireType !== 2)
|
|
+ break;
|
|
+ message.payloadType = reader.string();
|
|
+ continue;
|
|
+ }
|
|
+ case 8: {
|
|
+ if (wireType !== 2)
|
|
+ break;
|
|
+ message.payload = reader.bytes();
|
|
+ continue;
|
|
+ }
|
|
+ case 9: {
|
|
+ if (wireType !== 2)
|
|
+ break;
|
|
+ message.LogIDNew = reader.string();
|
|
+ continue;
|
|
+ }
|
|
+ }
|
|
+ reader.skipType(wireType, _depth, tag);
|
|
+ if (!reader.discardUnknown) {
|
|
+ $util.makeProp(message, "$unknowns", false);
|
|
+ (message.$unknowns || (message.$unknowns = [])).push(reader.raw(start, reader.pos));
|
|
+ }
|
|
+ }
|
|
+ if (length !== $undefined) {
|
|
+ if (reader.pos !== end)
|
|
+ throw $RangeError("index out of range");
|
|
+ reader.len = length;
|
|
+ }
|
|
+ if (_end !== $undefined)
|
|
+ throw $Error("missing end group");
|
|
+ if (!$Object.hasOwnProperty.call(message, "SeqID"))
|
|
+ throw $util.ProtocolError("missing required 'SeqID'", { instance: message });
|
|
+ if (!$Object.hasOwnProperty.call(message, "LogID"))
|
|
+ throw $util.ProtocolError("missing required 'LogID'", { instance: message });
|
|
+ if (!$Object.hasOwnProperty.call(message, "service"))
|
|
+ throw $util.ProtocolError("missing required 'service'", { instance: message });
|
|
+ if (!$Object.hasOwnProperty.call(message, "method"))
|
|
+ throw $util.ProtocolError("missing required 'method'", { instance: message });
|
|
+ return message;
|
|
+ };
|
|
+
|
|
+ Frame.verify = function (message, _depth) {
|
|
+ if (typeof message !== "object" || message === null)
|
|
+ return "object expected";
|
|
+ if (_depth === $undefined)
|
|
+ _depth = 0;
|
|
+ if (_depth > $util.recursionLimit)
|
|
+ return "max depth exceeded";
|
|
+ if (!$util.isInteger(message.SeqID) && !(message.SeqID && $util.isInteger(message.SeqID.low) && $util.isInteger(message.SeqID.high)))
|
|
+ return "SeqID: integer|Long expected";
|
|
+ if (!$util.isInteger(message.LogID) && !(message.LogID && $util.isInteger(message.LogID.low) && $util.isInteger(message.LogID.high)))
|
|
+ return "LogID: integer|Long expected";
|
|
+ if (!$util.isInteger(message.service))
|
|
+ return "service: integer expected";
|
|
+ if (!$util.isInteger(message.method))
|
|
+ return "method: integer expected";
|
|
+ if (message.headers != null && $Object.hasOwnProperty.call(message, "headers")) {
|
|
+ if (!$Array.isArray(message.headers))
|
|
+ return "headers: array expected";
|
|
+ for (let i = 0; i < message.headers.length; ++i) {
|
|
+ let error = $root.Header.verify(message.headers[i], _depth + 1);
|
|
+ if (error)
|
|
+ return "headers." + error;
|
|
+ }
|
|
+ }
|
|
+ if (message.payloadEncoding != null && $Object.hasOwnProperty.call(message, "payloadEncoding"))
|
|
+ if (!$util.isString(message.payloadEncoding))
|
|
+ return "payloadEncoding: string expected";
|
|
+ if (message.payloadType != null && $Object.hasOwnProperty.call(message, "payloadType"))
|
|
+ if (!$util.isString(message.payloadType))
|
|
+ return "payloadType: string expected";
|
|
+ if (message.payload != null && $Object.hasOwnProperty.call(message, "payload"))
|
|
+ if (!(message.payload && typeof message.payload.length === "number" || $util.isString(message.payload)))
|
|
+ return "payload: buffer expected";
|
|
+ if (message.LogIDNew != null && $Object.hasOwnProperty.call(message, "LogIDNew"))
|
|
+ if (!$util.isString(message.LogIDNew))
|
|
+ return "LogIDNew: string expected";
|
|
+ return null;
|
|
+ };
|
|
+
|
|
+ Frame.fromObject = function (object, _depth) {
|
|
+ if (object instanceof $root.Frame)
|
|
+ return object;
|
|
+ if (!$util.isObject(object))
|
|
+ throw $TypeError(".Frame: object expected");
|
|
+ if (_depth === $undefined)
|
|
+ _depth = 0;
|
|
+ if (_depth > $util.recursionLimit)
|
|
+ throw $Error("max depth exceeded");
|
|
+ let message = new $root.Frame();
|
|
+ if (object.SeqID != null)
|
|
+ if ($util.Long)
|
|
+ message.SeqID = $util.Long.fromValue(object.SeqID, true);
|
|
+ else if (typeof object.SeqID === "string")
|
|
+ message.SeqID = $parseInt(object.SeqID, 10);
|
|
+ else if (typeof object.SeqID === "number")
|
|
+ message.SeqID = object.SeqID;
|
|
+ else if (typeof object.SeqID === "object")
|
|
+ message.SeqID = new $util.LongBits(object.SeqID.low >>> 0, object.SeqID.high >>> 0).toNumber(true);
|
|
+ if (object.LogID != null)
|
|
+ if ($util.Long)
|
|
+ message.LogID = $util.Long.fromValue(object.LogID, true);
|
|
+ else if (typeof object.LogID === "string")
|
|
+ message.LogID = $parseInt(object.LogID, 10);
|
|
+ else if (typeof object.LogID === "number")
|
|
+ message.LogID = object.LogID;
|
|
+ else if (typeof object.LogID === "object")
|
|
+ message.LogID = new $util.LongBits(object.LogID.low >>> 0, object.LogID.high >>> 0).toNumber(true);
|
|
+ if (object.service != null)
|
|
+ message.service = object.service | 0;
|
|
+ if (object.method != null)
|
|
+ message.method = object.method | 0;
|
|
+ if (object.headers) {
|
|
+ if (!$Array.isArray(object.headers))
|
|
+ throw $TypeError(".Frame.headers: array expected");
|
|
+ message.headers = $Array(object.headers.length);
|
|
+ for (let i = 0; i < object.headers.length; ++i) {
|
|
+ if (!$util.isObject(object.headers[i]))
|
|
+ throw $TypeError(".Frame.headers: object expected");
|
|
+ message.headers[i] = $root.Header.fromObject(object.headers[i], _depth + 1);
|
|
+ }
|
|
+ }
|
|
+ if (object.payloadEncoding != null)
|
|
+ message.payloadEncoding = $String(object.payloadEncoding);
|
|
+ if (object.payloadType != null)
|
|
+ message.payloadType = $String(object.payloadType);
|
|
+ if (object.payload != null)
|
|
+ if (typeof object.payload === "string")
|
|
+ $util.base64.decode(object.payload, message.payload = $util.newBuffer($util.base64.length(object.payload)), 0);
|
|
+ else if (object.payload.length >= 0)
|
|
+ message.payload = object.payload;
|
|
+ if (object.LogIDNew != null)
|
|
+ message.LogIDNew = $String(object.LogIDNew);
|
|
+ return message;
|
|
+ };
|
|
+
|
|
+ Frame.toObject = function (message, options, _depth) {
|
|
+ if (!options)
|
|
+ options = {};
|
|
+ if (_depth === $undefined)
|
|
+ _depth = 0;
|
|
+ if (_depth > $util.recursionLimit)
|
|
+ throw $Error("max depth exceeded");
|
|
+ let object = {};
|
|
+ if (options.arrays || options.defaults)
|
|
+ object.headers = [];
|
|
+ if (options.defaults) {
|
|
+ if ($util.Long) {
|
|
+ let long = new $util.Long(0, 0, true);
|
|
+ object.SeqID = options.longs === $String ? long.toString() : options.longs === $Number ? long.toNumber() : typeof $BigInt !== "undefined" && options.longs === $BigInt ? long.toBigInt() : long;
|
|
+ } else
|
|
+ object.SeqID = options.longs === $String ? "0" : typeof $BigInt !== "undefined" && options.longs === $BigInt ? $BigInt("0") : 0;
|
|
+ if ($util.Long) {
|
|
+ let long = new $util.Long(0, 0, true);
|
|
+ object.LogID = options.longs === $String ? long.toString() : options.longs === $Number ? long.toNumber() : typeof $BigInt !== "undefined" && options.longs === $BigInt ? long.toBigInt() : long;
|
|
+ } else
|
|
+ object.LogID = options.longs === $String ? "0" : typeof $BigInt !== "undefined" && options.longs === $BigInt ? $BigInt("0") : 0;
|
|
+ object.service = 0;
|
|
+ object.method = 0;
|
|
+ object.payloadEncoding = "";
|
|
+ object.payloadType = "";
|
|
+ if (options.bytes === $String)
|
|
+ object.payload = "";
|
|
+ else {
|
|
+ object.payload = [];
|
|
+ if (options.bytes !== $Array)
|
|
+ object.payload = $util.newBuffer(object.payload);
|
|
+ }
|
|
+ object.LogIDNew = "";
|
|
+ }
|
|
+ if (message.SeqID != null && $Object.hasOwnProperty.call(message, "SeqID"))
|
|
+ if (typeof $BigInt !== "undefined" && options.longs === $BigInt)
|
|
+ object.SeqID = typeof message.SeqID === "number" ? $BigInt(message.SeqID) : $util.Long.fromBits(message.SeqID.low >>> 0, message.SeqID.high >>> 0, true).toBigInt();
|
|
+ else if (typeof message.SeqID === "number")
|
|
+ object.SeqID = options.longs === $String ? $String(message.SeqID) : message.SeqID;
|
|
+ else
|
|
+ object.SeqID = options.longs === $String ? $util.Long.prototype.toString.call(message.SeqID) : options.longs === $Number ? new $util.LongBits(message.SeqID.low >>> 0, message.SeqID.high >>> 0).toNumber(true) : message.SeqID;
|
|
+ if (message.LogID != null && $Object.hasOwnProperty.call(message, "LogID"))
|
|
+ if (typeof $BigInt !== "undefined" && options.longs === $BigInt)
|
|
+ object.LogID = typeof message.LogID === "number" ? $BigInt(message.LogID) : $util.Long.fromBits(message.LogID.low >>> 0, message.LogID.high >>> 0, true).toBigInt();
|
|
+ else if (typeof message.LogID === "number")
|
|
+ object.LogID = options.longs === $String ? $String(message.LogID) : message.LogID;
|
|
+ else
|
|
+ object.LogID = options.longs === $String ? $util.Long.prototype.toString.call(message.LogID) : options.longs === $Number ? new $util.LongBits(message.LogID.low >>> 0, message.LogID.high >>> 0).toNumber(true) : message.LogID;
|
|
+ if (message.service != null && $Object.hasOwnProperty.call(message, "service"))
|
|
+ object.service = message.service;
|
|
+ if (message.method != null && $Object.hasOwnProperty.call(message, "method"))
|
|
+ object.method = message.method;
|
|
+ if (message.headers && message.headers.length) {
|
|
+ object.headers = $Array(message.headers.length);
|
|
+ for (let j = 0; j < message.headers.length; ++j)
|
|
+ object.headers[j] = $root.Header.toObject(message.headers[j], options, _depth + 1);
|
|
+ }
|
|
+ if (message.payloadEncoding != null && $Object.hasOwnProperty.call(message, "payloadEncoding"))
|
|
+ object.payloadEncoding = message.payloadEncoding;
|
|
+ if (message.payloadType != null && $Object.hasOwnProperty.call(message, "payloadType"))
|
|
+ object.payloadType = message.payloadType;
|
|
+ if (message.payload != null && $Object.hasOwnProperty.call(message, "payload"))
|
|
+ object.payload = options.bytes === $String ? $util.base64.encode(message.payload, 0, message.payload.length) : options.bytes === $Array ? $Array.prototype.slice.call(message.payload) : message.payload;
|
|
+ if (message.LogIDNew != null && $Object.hasOwnProperty.call(message, "LogIDNew"))
|
|
+ object.LogIDNew = message.LogIDNew;
|
|
+ return object;
|
|
+ };
|
|
+
|
|
+ Frame.prototype.toJSON = function() {
|
|
+ return Frame.toObject(this, $protobuf.util.toJSONOptions);
|
|
+ };
|
|
+
|
|
+ return Frame;
|
|
+})();
|
|
+
|
|
+export {
|
|
+ $root as default
|
|
+};
|
|
diff --git a/dist/src/servers/feishu-wire.js b/dist/src/servers/feishu-wire.js
|
|
index d59de1733b5205898cf1d52b72cd79e85c8a310e..2f1bca0b6122b2d99fbb2335e4793afaf2de9346 100644
|
|
--- a/dist/src/servers/feishu-wire.js
|
|
+++ b/dist/src/servers/feishu-wire.js
|
|
@@ -1,30 +1,4 @@
|
|
-import protobuf from "protobufjs/light.js";
|
|
-// The official protocol is proto2. A private root avoids modifying protobuf's
|
|
-// shared descriptor registry; SDK clients that reconfigure Long run separately.
|
|
-const root = protobuf.Root.fromJSON({
|
|
- nested: {
|
|
- Header: {
|
|
- fields: {
|
|
- key: { type: "string", id: 1, rule: "required" },
|
|
- value: { type: "string", id: 2, rule: "required" },
|
|
- },
|
|
- },
|
|
- Frame: {
|
|
- fields: {
|
|
- SeqID: { type: "uint64", id: 1, rule: "required" },
|
|
- LogID: { type: "uint64", id: 2, rule: "required" },
|
|
- service: { type: "int32", id: 3, rule: "required" },
|
|
- method: { type: "int32", id: 4, rule: "required" },
|
|
- headers: { type: "Header", id: 5, rule: "repeated" },
|
|
- payloadEncoding: { type: "string", id: 6 },
|
|
- payloadType: { type: "string", id: 7 },
|
|
- payload: { type: "bytes", id: 8 },
|
|
- LogIDNew: { type: "string", id: 9 },
|
|
- },
|
|
- },
|
|
- },
|
|
-}).resolveAll();
|
|
-const frameType = root.lookupType("Frame");
|
|
+import { Frame as frameType } from "./feishu-wire-codec.js";
|
|
export function encodeFeishuFrame(frame) {
|
|
for (const value of [frame.SeqID, frame.LogID]) {
|
|
if (!/^(0|[1-9][0-9]*)$/u.test(value) || BigInt(value) > 0xffffffffffffffffn) {
|
|
@@ -47,4 +21,3 @@ export function decodeFeishuFrame(bytes) {
|
|
export function feishuHeader(frame, key) {
|
|
return frame.headers.find((header) => header.key === key)?.value;
|
|
}
|
|
-//# sourceMappingURL=feishu-wire.js.map
|
|
\ No newline at end of file
|
|
diff --git a/dist/src/servers/feishu-wire.js.map b/dist/src/servers/feishu-wire.js.map
|
|
deleted file mode 100644
|
|
index 5d46e6175c75164acc788669791a75490f9e55d6..0000000000000000000000000000000000000000
|
|
diff --git a/dist/src/servers/feishu-wire.proto b/dist/src/servers/feishu-wire.proto
|
|
new file mode 100644
|
|
index 0000000000000000000000000000000000000000..136fad0dcc722660bfef186ae8c156fd442e9f46
|
|
--- /dev/null
|
|
+++ b/dist/src/servers/feishu-wire.proto
|
|
@@ -0,0 +1,18 @@
|
|
+syntax = "proto2";
|
|
+
|
|
+message Header {
|
|
+ required string key = 1;
|
|
+ required string value = 2;
|
|
+}
|
|
+
|
|
+message Frame {
|
|
+ required uint64 SeqID = 1;
|
|
+ required uint64 LogID = 2;
|
|
+ required int32 service = 3;
|
|
+ required int32 method = 4;
|
|
+ repeated Header headers = 5;
|
|
+ optional string payloadEncoding = 6;
|
|
+ optional string payloadType = 7;
|
|
+ optional bytes payload = 8;
|
|
+ optional string LogIDNew = 9;
|
|
+}
|
|
diff --git a/dist/src/servers/generate-feishu-wire.mjs b/dist/src/servers/generate-feishu-wire.mjs
|
|
new file mode 100644
|
|
index 0000000000000000000000000000000000000000..a545a259d03b6849b4b2193aaeccf4560ceaf4ad
|
|
--- /dev/null
|
|
+++ b/dist/src/servers/generate-feishu-wire.mjs
|
|
@@ -0,0 +1,15 @@
|
|
+import { execFileSync } from "node:child_process";
|
|
+import { readFileSync, writeFileSync } from "node:fs";
|
|
+import { fileURLToPath } from "node:url";
|
|
+
|
|
+const target = new URL("./feishu-wire-codec.js", import.meta.url);
|
|
+execFileSync("npm", ["exec", "--yes", "--prefer-offline", "--package=protobufjs-cli@2.7.0", "--package=protobufjs@8.8.0", "--", "pbjs",
|
|
+ "--target", "static-module", "--wrap", "es6", "--keep-case", "--no-create",
|
|
+ "--no-delimited", "--no-service", "--no-typeurl", "--no-comments", "--dependency", "protobufjs/minimal.js",
|
|
+ "--out", fileURLToPath(target), fileURLToPath(new URL("./feishu-wire.proto", import.meta.url))
|
|
+], { stdio: "inherit" });
|
|
+const source = readFileSync(target, "utf8");
|
|
+const sharedRoot = 'const $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});';
|
|
+if (!source.includes(sharedRoot)) throw new Error("Generated protobuf root changed");
|
|
+writeFileSync(target, "// Generated from feishu-wire.proto by protobufjs-cli 2.7.0; see generate-feishu-wire.mjs.\n" +
|
|
+ source.replace(sharedRoot, "// Keep this schema private; other protobuf clients may use the shared default root.\nconst $root = {};"));
|