UNPKG

@aptpod/iscp-ts

Version:

iSCP 2.0 client library for TypeScript

159 lines 7.07 kB
import { WireType } from "@protobuf-ts/runtime"; import { UnknownFieldHandler } from "@protobuf-ts/runtime"; import { reflectionMergePartial } from "@protobuf-ts/runtime"; import { MESSAGE_TYPE } from "@protobuf-ts/runtime"; import { MessageType } from "@protobuf-ts/runtime"; // @generated message type with reflection information, may provide speed optimized methods class ConnectRequestExtensionFields$Type extends MessageType { constructor() { super("iscp2.ConnectRequestExtensionFields", [ { no: 1, name: "access_token", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 1024, name: "intdash", kind: "message", T: () => IntdashExtensionFields } ]); } create(value) { const message = { accessToken: "" }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); return message; } internalBinaryRead(reader, length, options, target) { let message = target ?? this.create(), end = reader.pos + length; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* string access_token */ 1: message.accessToken = reader.string(); break; case /* iscp2.IntdashExtensionFields intdash */ 1024: message.intdash = IntdashExtensionFields.internalBinaryRead(reader, reader.uint32(), options, message.intdash); break; default: let u = options.readUnknownField; if (u === "throw") throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); let d = reader.skip(wireType); if (u !== false) (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); } } return message; } internalBinaryWrite(message, writer, options) { /* string access_token = 1; */ if (message.accessToken !== "") writer.tag(1, WireType.LengthDelimited).string(message.accessToken); /* iscp2.IntdashExtensionFields intdash = 1024; */ if (message.intdash) IntdashExtensionFields.internalBinaryWrite(message.intdash, writer.tag(1024, WireType.LengthDelimited).fork(), options).join(); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } } /** * @generated MessageType for protobuf message iscp2.ConnectRequestExtensionFields */ export const ConnectRequestExtensionFields = new ConnectRequestExtensionFields$Type(); // @generated message type with reflection information, may provide speed optimized methods class IntdashExtensionFields$Type extends MessageType { constructor() { super("iscp2.IntdashExtensionFields", [ { no: 1, name: "project_uuid", kind: "scalar", T: 9 /*ScalarType.STRING*/ } ]); } create(value) { const message = { projectUuid: "" }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); return message; } internalBinaryRead(reader, length, options, target) { let message = target ?? this.create(), end = reader.pos + length; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* string project_uuid */ 1: message.projectUuid = reader.string(); break; default: let u = options.readUnknownField; if (u === "throw") throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); let d = reader.skip(wireType); if (u !== false) (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); } } return message; } internalBinaryWrite(message, writer, options) { /* string project_uuid = 1; */ if (message.projectUuid !== "") writer.tag(1, WireType.LengthDelimited).string(message.projectUuid); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } } /** * @generated MessageType for protobuf message iscp2.IntdashExtensionFields */ export const IntdashExtensionFields = new IntdashExtensionFields$Type(); // @generated message type with reflection information, may provide speed optimized methods class ConnectResponseExtensionFields$Type extends MessageType { constructor() { super("iscp2.ConnectResponseExtensionFields", []); } create(value) { const message = {}; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); return message; } internalBinaryRead(reader, length, options, target) { return target ?? this.create(); } internalBinaryWrite(message, writer, options) { let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } } /** * @generated MessageType for protobuf message iscp2.ConnectResponseExtensionFields */ export const ConnectResponseExtensionFields = new ConnectResponseExtensionFields$Type(); // @generated message type with reflection information, may provide speed optimized methods class DisconnectExtensionFields$Type extends MessageType { constructor() { super("iscp2.DisconnectExtensionFields", []); } create(value) { const message = {}; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); return message; } internalBinaryRead(reader, length, options, target) { return target ?? this.create(); } internalBinaryWrite(message, writer, options) { let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } } /** * @generated MessageType for protobuf message iscp2.DisconnectExtensionFields */ export const DisconnectExtensionFields = new DisconnectExtensionFields$Type(); //# sourceMappingURL=connection.js.map