From cdb7637c6c1c3b68d677717162b2cd9086dbd64b Mon Sep 17 00:00:00 2001 From: Ben Date: Wed, 15 May 2024 11:38:32 -0700 Subject: [PATCH] built lib --- lib/cjs/Utils.d.ts | 2 + lib/cjs/Utils.js | 17 + lib/cjs/hermesclient/client.d.ts | 75 + lib/cjs/hermesclient/client.js | 689 +++ .../hermesclient/google/protobuf/struct.d.ts | 201 + .../hermesclient/google/protobuf/struct.js | 469 ++ lib/cjs/hermesclient/proto/wsmessages.d.ts | 4566 +++++++++++++++++ lib/cjs/hermesclient/proto/wsmessages.js | 2913 +++++++++++ lib/esm/Utils.d.ts | 2 + lib/esm/Utils.js | 12 + lib/esm/hermesclient/client.d.ts | 75 + lib/esm/hermesclient/client.js | 682 +++ .../hermesclient/google/protobuf/struct.d.ts | 201 + .../hermesclient/google/protobuf/struct.js | 441 ++ lib/esm/hermesclient/proto/wsmessages.d.ts | 4566 +++++++++++++++++ lib/esm/hermesclient/proto/wsmessages.js | 2879 +++++++++++ node_modules/.bin/tsc | 4 +- node_modules/.bin/tsc.cmd | 2 +- node_modules/.bin/tsc.ps1 | 8 +- node_modules/.package-lock.json | 9 - node_modules/tsc/CONTRIBUTING.md | 3 - node_modules/tsc/README.md | 3 - node_modules/tsc/bin/tsc | 2 - node_modules/tsc/bin/tsc.js | 49 - node_modules/tsc/package.json | 22 - package-lock.json | 10 - package.json | 1 - yarn.lock | 5 - 28 files changed, 17797 insertions(+), 111 deletions(-) create mode 100644 lib/cjs/Utils.d.ts create mode 100644 lib/cjs/Utils.js create mode 100644 lib/cjs/hermesclient/client.d.ts create mode 100644 lib/cjs/hermesclient/client.js create mode 100644 lib/cjs/hermesclient/google/protobuf/struct.d.ts create mode 100644 lib/cjs/hermesclient/google/protobuf/struct.js create mode 100644 lib/cjs/hermesclient/proto/wsmessages.d.ts create mode 100644 lib/cjs/hermesclient/proto/wsmessages.js create mode 100644 lib/esm/Utils.d.ts create mode 100644 lib/esm/Utils.js create mode 100644 lib/esm/hermesclient/client.d.ts create mode 100644 lib/esm/hermesclient/client.js create mode 100644 lib/esm/hermesclient/google/protobuf/struct.d.ts create mode 100644 lib/esm/hermesclient/google/protobuf/struct.js create mode 100644 lib/esm/hermesclient/proto/wsmessages.d.ts create mode 100644 lib/esm/hermesclient/proto/wsmessages.js delete mode 100644 node_modules/tsc/CONTRIBUTING.md delete mode 100644 node_modules/tsc/README.md delete mode 100644 node_modules/tsc/bin/tsc delete mode 100644 node_modules/tsc/bin/tsc.js delete mode 100644 node_modules/tsc/package.json diff --git a/lib/cjs/Utils.d.ts b/lib/cjs/Utils.d.ts new file mode 100644 index 0000000..d934a45 --- /dev/null +++ b/lib/cjs/Utils.d.ts @@ -0,0 +1,2 @@ +export declare function undef(): A | undefined; +export declare function memoize(fn: () => A): () => A; diff --git a/lib/cjs/Utils.js b/lib/cjs/Utils.js new file mode 100644 index 0000000..06f2cd5 --- /dev/null +++ b/lib/cjs/Utils.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.memoize = exports.undef = void 0; +function undef() { + return undefined; +} +exports.undef = undef; +function memoize(fn) { + let memo; + return () => { + if (memo === undefined) { + memo = fn(); + } + return memo; + }; +} +exports.memoize = memoize; diff --git a/lib/cjs/hermesclient/client.d.ts b/lib/cjs/hermesclient/client.d.ts new file mode 100644 index 0000000..3b30240 --- /dev/null +++ b/lib/cjs/hermesclient/client.d.ts @@ -0,0 +1,75 @@ +import { ContentType, Message, MessageFromClient, CreateMailboxResponse, KeyValPair, MessageEnvelope, SendReceipt } from "./proto/wsmessages"; +export interface ContentTypeHandler { + readonly webSocketUrlPath: string; + sendMessageFromClient(mfc: MessageFromClient, ws: WebSocket): void; +} +export declare const ContentTypeHandler: { + Json: ContentTypeHandler; + Protobuf: ContentTypeHandler; +}; +export declare function newHermesClient(rootUrl: string, contentTypeHandler: ContentTypeHandler): HermesClient; +export interface ChangeDataCaptureEvent { + id: string; + schema: string; + table: string; + action: string; + data: any; + commitTime: string; +} +interface RawRpcRequest { + to: string; + endPoint: string; + body?: Uint8Array; + contentType?: ContentType; + headers?: KeyValPair[]; + state?: Uint8Array; +} +export declare class RpcRequestResponse { + correlationId: string; + sendReceiptEnvelope: MessageEnvelope | undefined; + sendReceipt: SendReceipt | undefined; + sentMessage: Message | undefined; + inboxEnvelope: MessageEnvelope | undefined; + inboxMessage: Message | undefined; + constructor(correlationId: string); + role(): string | undefined; + contentType(): ContentType; + isProtobuf(): boolean; + isJson(): boolean; + isClient(): boolean | undefined; + hasRequestAndResponse(): boolean; + timeStarted(): Date | undefined; + timeStartedL(): number | undefined; + timeCompleted(): Date | undefined; + durationInMillis(): number | undefined; + endPoint(): string | undefined; + requestMessage(): Message | undefined; + requestEnvelope(): MessageEnvelope | undefined; + responseMessage(): Message | undefined; + responseEnvelope(): MessageEnvelope | undefined; + status(): string; + processSchema(reqOrResp: "request" | "response", data?: Uint8Array): Promise; + responseObj(): Promise; + requestObj(): Promise; +} +declare const GlobalClient: { + get: () => HermesClient; +}; +export default GlobalClient; +export declare function runHermesClientTest(): void; +export declare function runHermesClientTest2(): void; +export interface CdcSubscription { + tables: CdcTable[]; + startSeq?: string; +} +export interface CdcTable { + database: string; + table: string; +} +export interface HermesClient { + readonly rootUrl: string; + mailbox(): Promise; + rawRpcCall(request: RawRpcRequest): Promise; + cdcSubscribe(cdcs: CdcSubscription, listener: (cdcEvent: ChangeDataCaptureEvent, a: A) => void): void; + rpcObserverSubscribe(readerKey: string, listener: (correlation: RpcRequestResponse) => void): void; +} diff --git a/lib/cjs/hermesclient/client.js b/lib/cjs/hermesclient/client.js new file mode 100644 index 0000000..e105444 --- /dev/null +++ b/lib/cjs/hermesclient/client.js @@ -0,0 +1,689 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.runHermesClientTest2 = exports.runHermesClientTest = exports.RpcRequestResponse = exports.newHermesClient = exports.ContentTypeHandler = void 0; +const wsmessages_1 = require("./proto/wsmessages"); +const Utils_1 = require("../Utils"); +const JsonContentTypeHandler = { + webSocketUrlPath: "/api/ws/send_receive_json", + sendMessageFromClient(mfc, ws) { + const obj = wsmessages_1.MessageFromClient.toJSON(mfc); + const jsonStr = JSON.stringify(obj); + ws.send(jsonStr); + } +}; +const ProtobufContentTypeHandler = { + webSocketUrlPath: "/api/ws/send_receive_proto", + sendMessageFromClient(mfc, ws) { + const bytes = wsmessages_1.MessageFromClient.encode(mfc).finish(); + ws.send(bytes); + } +}; +exports.ContentTypeHandler = { + Json: JsonContentTypeHandler, + Protobuf: ProtobufContentTypeHandler, +}; +function newHermesClient(rootUrl, contentTypeHandler) { + const hci = new HermesClientImpl(rootUrl, contentTypeHandler); + hci.mailbox().then((mbox) => { + const correlations = hci.correlations; + hci.channelMessageSubscribe({ + id: "rpc-inbox", + state: "rpc-inbox", + readerKey: mbox.readerKey, + channel: "rpc-inbox", + startSeq: "all" + }, (me, msg) => { + var _a, _b, _c, _d, _e, _f; + if (me.messageBytes) { + try { + const msg = wsmessages_1.Message.decode(me.messageBytes); + const endPoint = (_b = (_a = msg.header) === null || _a === void 0 ? void 0 : _a.rpcHeader) === null || _b === void 0 ? void 0 : _b.endPoint; + if (((_d = (_c = msg.header) === null || _c === void 0 ? void 0 : _c.rpcHeader) === null || _d === void 0 ? void 0 : _d.frameType) === wsmessages_1.RpcFrameType.Request && endPoint == "ping") { + hci.sendPongResponse(mbox, msg, endPoint); + } + else { + const correlationId = (_f = (_e = msg.header) === null || _e === void 0 ? void 0 : _e.rpcHeader) === null || _f === void 0 ? void 0 : _f.correlationId; + if (correlationId) { + const resolve = correlations.get(correlationId); + if (resolve !== undefined) { + resolve(msg); + } + correlations.delete(correlationId); + } + } + } + catch (e) { + console.error("error decoding message", e); + } + } + // noop since we are only interested in the correlationId for rpc and that happens in onMessage + }); + }); + // send ping every 30 seconds + setInterval(() => hci.sendPing(), 30 * 1000); + return hci; +} +exports.newHermesClient = newHermesClient; +/** + * Create the mailbox + * @param channels + * @param rootUrl + * @returns + */ +async function createMailbox(channels, rootUrl) { + const mbox = { + channels: channels, + privateMetadata: {}, + publicMetadata: {}, + purgeTimeoutInMillis: 0, + closeTimeoutInMillis: 0, + extraData: {}, + }; + const mboxObj = wsmessages_1.CreateMailboxRequest.toJSON(mbox); + const mboxJson = JSON.stringify(mboxObj); + let mailboxResponse = undefined; + const response = await fetch(`${rootUrl}/api/create_mailbox`, { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: mboxJson, + }); + if (response.ok) { + const responseJsonStr = await response.text(); + mailboxResponse = wsmessages_1.CreateMailboxResponse.fromJSON(JSON.parse(responseJsonStr)); + } + else { + throw new Error(`createMailbox failed with status ${response.status}`); + } + return mailboxResponse; +} +class Constants { +} +Constants.rpcInboxChannelName = "rpc-inbox"; +Constants.rpcSentChannelName = "rpc-sent"; +class HermesConnection { + constructor(clientImpl, mailbox, webSocket) { + this.clientImpl = clientImpl; + this.mailbox = mailbox; + this.webSocket = webSocket; + const self = this; + webSocket.onmessage = function (event) { + if (event.data instanceof ArrayBuffer) { + self.onWebSocketBinaryMessage(event.data); + } + else { + self.onWebSocketTextMessage(event.data); + } + }; + webSocket.onclose = function (event) { + console.log("HermesConnection websocket closed", event); + clientImpl.reconnect(); + }; + // resend un ack'ed messages + clientImpl.sentMessagesWaitingForAck.forEach((smr, idempotentId) => { + self.sendSendMessageRequest(smr, false); + }); + } + onWebSocketTextMessage(message) { + const jsonObj = JSON.parse(message); + const m2c = wsmessages_1.MessageToClient.fromJSON(jsonObj); + this.onMessageToClient(m2c); + } + onWebSocketBinaryMessage(message) { + const m2c = wsmessages_1.MessageToClient.decode(new Uint8Array(message)); + this.onMessageToClient(m2c); + } + onMessageToClient(m2c) { + var _a, _b, _c; + if (m2c.notification !== undefined) { + console.log("hermes client received notification " + m2c.notification, m2c.notification); + } + else if (m2c.messageEnvelope !== undefined) { + const me = m2c.messageEnvelope; + if (me.messageBytes === undefined) { + console.log("hermes client received empty messageEnvelope", m2c.messageEnvelope); + } + else { + const subscriptionId = (_a = me.serverEnvelope) === null || _a === void 0 ? void 0 : _a.subscriptionId; + if (subscriptionId) { + const activeSub = this.clientImpl.activeSubscriptions.get(subscriptionId); + if (activeSub) { + const startSeq = (_b = me.serverEnvelope) === null || _b === void 0 ? void 0 : _b.sequence; + if (startSeq) { + activeSub.protoRawSubscription.startSeq = String(startSeq); + } + activeSub.onMessageEvent(me); + } + } + } + } + else if (m2c.sendMessageResponse !== undefined) { + const id = (_c = m2c.sendMessageResponse) === null || _c === void 0 ? void 0 : _c.idempotentId; + if (id) { + this.clientImpl.sentMessagesWaitingForAck.delete(id); + } + console.log("hermes client received SendMessageResponse", m2c.sendMessageResponse); + } + else if (m2c.subscribeResponse !== undefined) { + console.log("hermes client received subscribeResponse", m2c.subscribeResponse); + } + else if (m2c.ping !== undefined) { + this.webSocket.send(JSON.stringify({ pong: {} })); + } + else if (m2c.pong !== undefined) { + console.log("hermes client received pong"); + } + } + sendMessageFromClient(mfc) { + console.log("sending websocket message", mfc); + this.clientImpl.contentTypeHandler.sendMessageFromClient(mfc, this.webSocket); + } + addActiveSubscription(activeSub) { + const listeners = this.clientImpl.activeSubscriptions.get(activeSub.subscriptionId); + if (listeners) { + throw Error(`subscriptionId ${activeSub.subscriptionId} is already subscribed`); + } + else { + this.clientImpl.activeSubscriptions.set(activeSub.subscriptionId, activeSub); + } + } + cdcSubscribe(cdcs, listener) { + const subscriptionId = "cdc-" + cdcs.tables.map((t) => t.database + "." + t.table).join("-"); + const protoCdcs = { + id: subscriptionId, + matchers: cdcs.tables, + startSeq: cdcs.startSeq, + }; + this.sendMessageFromClient({ subscribeRequest: { subscriptions: [{ changeDataCapture: protoCdcs }] } }); + function onMessage(msg) { + const json = new TextDecoder().decode(msg.messageBytes); + const cdcEvent = JSON.parse(json); + listener(cdcEvent, cdcEvent.data); + } + this.addActiveSubscription({ + subscriptionId: subscriptionId, + protoRawSubscription: protoCdcs, + onMessageEvent: onMessage, + protoSubscription: { changeDataCapture: protoCdcs } + }); + } + channelMessageSubscribe(ms, listener) { + this.rawChannelSubscribe(ms, wsmessages_1.Message.decode, listener); + } + channelSendReceiptSubscribe(ms, listener) { + this.rawChannelSubscribe(ms, wsmessages_1.SendReceipt.decode, listener); + } + rawChannelSubscribe(ms, decoder, listener) { + const subscriptionId = ms.id; + if (!subscriptionId) { + throw new Error("MailboxSubscription id is undefined"); + } + function onMessage(msg) { + if (msg.messageBytes === undefined) { + console.error("MessageEnvelope.messageBytes is undefined"); + return; + } + const a = decoder(msg.messageBytes); + listener(msg, a); + } + this.sendMessageFromClient({ subscribeRequest: { subscriptions: [{ mailbox: ms }] } }); + this.addActiveSubscription({ + subscriptionId: subscriptionId, + onMessageEvent: onMessage, + protoRawSubscription: ms, + protoSubscription: { mailbox: ms } + }); + } + sendPing() { + this.sendMessageFromClient({ ping: {} }); + } + sendSendMessageRequest(smr, registerForAck) { + if (registerForAck && smr.idempotentId) { + this.clientImpl.sentMessagesWaitingForAck.set(smr.idempotentId, smr); + } + this.sendMessageFromClient({ sendMessageRequest: smr }); + } + rawRpcCall(request) { + var _a; + const emptyBytes = new Uint8Array(0); + const correlationId = ((_a = this.mailbox.address) !== null && _a !== void 0 ? _a : "") + "-" + this.clientImpl.correlationIdCounter++; + const idempotentId = this.mailbox.address + correlationId; + const smr = { + channel: Constants.rpcInboxChannelName, + to: [request.to], + idempotentId: idempotentId, + message: { + header: { + rpcHeader: { + correlationId: correlationId, + endPoint: request.endPoint, + frameType: wsmessages_1.RpcFrameType.Request, + errorInfo: undefined, + }, + sender: this.mailbox.address, + contentType: request.contentType, + extraHeaders: request.headers, + senderSequence: 0, + }, + serverEnvelope: undefined, + senderEnvelope: { + created: Date.now(), + }, + data: request.body !== undefined ? request.body : emptyBytes, + }, + }; + const promise = new Promise((resolve, reject) => { + this.clientImpl.correlations.set(correlationId, resolve); + }); + this.sendSendMessageRequest(smr, true); + return promise; + } + rpcObserverSubscribe(readerKey, listener) { + console.log("rpcObserverSubscribe", readerKey); + const correlations = new Map(); + const msInbox = { + id: "rpc-inbox-" + readerKey, + readerKey: readerKey, + channel: "rpc-inbox", + startSeq: "first", + }; + this.channelMessageSubscribe(msInbox, (me, msg) => { + var _a, _b; + const correlationId = (_b = (_a = msg.header) === null || _a === void 0 ? void 0 : _a.rpcHeader) === null || _b === void 0 ? void 0 : _b.correlationId; + if (correlationId) { + var correlation = correlations.get(correlationId); + if (!correlation) { + correlation = new RpcRequestResponse(correlationId); + correlations.set(correlationId, correlation); + } + correlation.inboxEnvelope = me; + correlation.inboxMessage = msg; + listener(correlation); + } + }); + const msSent = { + id: "rpc-sent-" + readerKey, + readerKey: readerKey, + channel: "rpc-sent", + startSeq: "first", + }; + this.channelSendReceiptSubscribe(msSent, (me, sr) => { + var _a, _b, _c, _d, _e; + const msg = (_a = sr.request) === null || _a === void 0 ? void 0 : _a.message; + const correlationId = (_e = (_d = (_c = (_b = sr.request) === null || _b === void 0 ? void 0 : _b.message) === null || _c === void 0 ? void 0 : _c.header) === null || _d === void 0 ? void 0 : _d.rpcHeader) === null || _e === void 0 ? void 0 : _e.correlationId; + if (correlationId !== undefined) { + var correlation = correlations.get(correlationId); + if (correlation === undefined) { + correlation = new RpcRequestResponse(correlationId); + correlations.set(correlationId, correlation); + } + correlation.sentMessage = msg; + correlation.sendReceiptEnvelope = me; + correlation.sendReceipt = sr; + listener(correlation); + } + }); + } +} +class HermesClientImpl { + constructor(rootUrl, contentTypeHandler) { + this.correlationIdCounter = 0; + this.correlations = new Map(); + this.activeSubscriptions = new Map(); + this.sentMessagesWaitingForAck = new Map(); + const thisHermesClientImpl = this; + this.rootUrl = rootUrl; + this.contentTypeHandler = contentTypeHandler; + this.mailboxResponseP = createMailbox([Constants.rpcInboxChannelName, Constants.rpcSentChannelName], rootUrl); + var tempMailboxResponseP = this.mailboxResponseP; + var tempWsUrl = new URL(rootUrl); + tempWsUrl.protocol = tempWsUrl.protocol.replace("http", "ws"); + tempWsUrl.pathname = contentTypeHandler.webSocketUrlPath; + this.wsUrl = tempWsUrl.toString(); + this.currentConn = this.newHermesConnection(); + } + sendPongResponse(mbox, pingMsg, endPoint) { + var _a, _b, _c, _d, _e, _f; + const correlationId = (_b = (_a = pingMsg.header) === null || _a === void 0 ? void 0 : _a.rpcHeader) === null || _b === void 0 ? void 0 : _b.correlationId; + const sender = (_c = pingMsg === null || pingMsg === void 0 ? void 0 : pingMsg.header) === null || _c === void 0 ? void 0 : _c.sender; + const contentType = (_e = (_d = pingMsg === null || pingMsg === void 0 ? void 0 : pingMsg.header) === null || _d === void 0 ? void 0 : _d.contentType) !== null && _e !== void 0 ? _e : wsmessages_1.ContentType.UnspecifiedCT; + if (correlationId !== undefined && sender !== undefined) { + var ping = {}; + if (pingMsg.data !== undefined) { + if (contentType == wsmessages_1.ContentType.Json) { + ping = wsmessages_1.Ping.fromJSON(pingMsg.data); + } + else { + ping = wsmessages_1.Ping.decode(pingMsg.data); + } + } + const pong = { payload: ping.payload }; + var data; + if (contentType == wsmessages_1.ContentType.Json) { + data = new TextEncoder().encode(JSON.stringify(wsmessages_1.Pong.toJSON(pong))); + } + else { + data = wsmessages_1.Pong.encode(pong).finish(); + } + const idempotentId = mbox.address + correlationId; + const smr = { + channel: Constants.rpcInboxChannelName, + to: [sender], + idempotentId: idempotentId, + message: { + header: { + rpcHeader: { + correlationId: correlationId, + endPoint: endPoint, + frameType: wsmessages_1.RpcFrameType.SuccessResponse, + errorInfo: undefined, + }, + sender: mbox.address, + contentType: (_f = pingMsg === null || pingMsg === void 0 ? void 0 : pingMsg.header) === null || _f === void 0 ? void 0 : _f.contentType, + }, + serverEnvelope: undefined, + senderEnvelope: { + created: Date.now(), + }, + data: data, + }, + }; + this.withConn((conn) => { + conn.sendSendMessageRequest(smr, true); + }); + } + else { + console.log("ignoring ping no correlation id", pingMsg); + } + } + reconnect() { + this.currentConn = this.newHermesConnection(); + } + newHermesConnection() { + const outerThis = this; + return new Promise((resolve, reject) => { + this.mailboxResponseP.then((mbox) => { + var webSocket = new WebSocket(this.wsUrl); + webSocket.binaryType = "arraybuffer"; + webSocket.onopen = function (event) { + console.log("hermes client websocket opened, sending first message"); + const resubscriptions = Object.values(outerThis.activeSubscriptions).map((as) => { return as.protoSubscription; }); + // send first message + const firstMessage = { + senderInfo: { + readerKey: mbox.readerKey, + address: mbox.address, + }, + subscriptions: resubscriptions, + mailboxTimeoutInMs: 2 * 60 * 1000, // 2 minutes + }; + const mfc = { + firstMessage: firstMessage, + }; + console.log("sending first message"); + outerThis.contentTypeHandler.sendMessageFromClient(mfc, webSocket); + console.log("resolving promise"); + resolve(new HermesConnection(outerThis, mbox, webSocket)); + }; + }); + }); + } + mailbox() { + return this.mailboxResponseP; + } + async withConn(fn) { + return this.currentConn.then((conn) => fn(conn)); + } + async withConnP(fn) { + return this.currentConn.then((conn) => fn(conn)); + } + rawRpcCall(request) { + return this.withConnP((conn) => { + return conn.rawRpcCall(request); + }); + } + cdcSubscribe(cdcs, listener) { + this.withConn((conn) => { + conn.cdcSubscribe(cdcs, listener); + }); + } + rpcObserverSubscribe(readerKey, listener) { + console.log("outer rpcObserverSubscribe", readerKey); + this.withConn((conn) => { + console.log("inner rpcObserverSubscribe", readerKey); + conn.rpcObserverSubscribe(readerKey, listener); + }); + } + channelMessageSubscribe(ms, listener) { + this.withConn((conn) => { + conn.channelMessageSubscribe(ms, listener); + }); + } + channelSendReceiptSubscribe(ms, listener) { + this.withConn((conn) => { + conn.channelSendReceiptSubscribe(ms, listener); + }); + } + sendPing() { + this.withConn((conn) => { + conn.sendPing(); + }); + } +} +class RpcRequestResponse { + constructor(correlationId) { + this.correlationId = correlationId; + } + role() { + const ic = this.isClient(); + if (ic) { + return "client"; + } + else if (ic === false) { + return "server"; + } + } + contentType() { + var _a, _b, _c, _d, _e, _f; + const contentType = (_f = (_c = (_b = (_a = this.requestMessage()) === null || _a === void 0 ? void 0 : _a.header) === null || _b === void 0 ? void 0 : _b.contentType) !== null && _c !== void 0 ? _c : (_e = (_d = this.responseMessage()) === null || _d === void 0 ? void 0 : _d.header) === null || _e === void 0 ? void 0 : _e.contentType) !== null && _f !== void 0 ? _f : wsmessages_1.ContentType.UnspecifiedCT; + return contentType; + } + isProtobuf() { + return this.contentType() === wsmessages_1.ContentType.Protobuf; + } + isJson() { + return this.contentType() === wsmessages_1.ContentType.Json; + } + isClient() { + var _a, _b, _c, _d, _e, _f; + const inboxFrameType = (_c = (_b = (_a = this.inboxMessage) === null || _a === void 0 ? void 0 : _a.header) === null || _b === void 0 ? void 0 : _b.rpcHeader) === null || _c === void 0 ? void 0 : _c.frameType; + const sentFrameType = (_f = (_e = (_d = this.sentMessage) === null || _d === void 0 ? void 0 : _d.header) === null || _e === void 0 ? void 0 : _e.rpcHeader) === null || _f === void 0 ? void 0 : _f.frameType; + if (sentFrameType === wsmessages_1.RpcFrameType.Request) { + return true; + } + else if (inboxFrameType === wsmessages_1.RpcFrameType.Request) { + return false; + } + } + hasRequestAndResponse() { + return this.sendReceiptEnvelope && this.inboxEnvelope ? true : false; + } + timeStarted() { + var _a, _b, _c, _d; + const ic = this.isClient(); + var time = (0, Utils_1.undef)(); + if (ic === true) { + time = (_b = (_a = this.sendReceiptEnvelope) === null || _a === void 0 ? void 0 : _a.serverEnvelope) === null || _b === void 0 ? void 0 : _b.created; + } + else if (ic === false) { + time = (_d = (_c = this.inboxEnvelope) === null || _c === void 0 ? void 0 : _c.serverEnvelope) === null || _d === void 0 ? void 0 : _d.created; + } + if (time) { + return new Date(time); + } + } + timeStartedL() { + var _a, _b, _c, _d; + const ic = this.isClient(); + var time = (0, Utils_1.undef)(); + if (ic === true) { + time = (_b = (_a = this.sendReceiptEnvelope) === null || _a === void 0 ? void 0 : _a.serverEnvelope) === null || _b === void 0 ? void 0 : _b.created; + } + else if (ic === false) { + time = (_d = (_c = this.inboxEnvelope) === null || _c === void 0 ? void 0 : _c.serverEnvelope) === null || _d === void 0 ? void 0 : _d.created; + } + return time; + } + timeCompleted() { + var _a, _b, _c, _d; + const ic = this.isClient(); + var time = undefined; + if (ic === false) { + time = (_b = (_a = this.sendReceiptEnvelope) === null || _a === void 0 ? void 0 : _a.serverEnvelope) === null || _b === void 0 ? void 0 : _b.created; + } + else if (ic === true) { + time = (_d = (_c = this.inboxEnvelope) === null || _c === void 0 ? void 0 : _c.serverEnvelope) === null || _d === void 0 ? void 0 : _d.created; + } + if (time) { + return new Date(time); + } + } + durationInMillis() { + var _a, _b; + const ts = (_a = this.timeStarted()) === null || _a === void 0 ? void 0 : _a.getTime(); + const tc = (_b = this.timeCompleted()) === null || _b === void 0 ? void 0 : _b.getTime(); + if (ts && tc) { + return tc - ts; + } + } + endPoint() { + var _a, _b, _c; + return (_c = (_b = (_a = this.requestMessage()) === null || _a === void 0 ? void 0 : _a.header) === null || _b === void 0 ? void 0 : _b.rpcHeader) === null || _c === void 0 ? void 0 : _c.endPoint; + } + requestMessage() { + const ic = this.isClient(); + if (ic === true) { + return this.sentMessage; + } + else if (ic === false) { + return this.inboxMessage; + } + } + requestEnvelope() { + const ic = this.isClient(); + if (ic === true) { + return this.sendReceiptEnvelope; + } + else if (ic === false) { + return this.inboxEnvelope; + } + } + responseMessage() { + const ic = this.isClient(); + if (ic === true) { + return this.inboxMessage; + } + else if (ic === false) { + return this.sentMessage; + } + } + responseEnvelope() { + const ic = this.isClient(); + if (ic === true) { + return this.inboxEnvelope; + } + else if (ic === false) { + return this.sendReceiptEnvelope; + } + } + status() { + var _a, _b, _c; + const frameType = (_c = (_b = (_a = this.responseMessage()) === null || _a === void 0 ? void 0 : _a.header) === null || _b === void 0 ? void 0 : _b.rpcHeader) === null || _c === void 0 ? void 0 : _c.frameType; + if (!frameType) { + return ""; + } + else if (frameType === wsmessages_1.RpcFrameType.ErrorResponse) { + return "error"; + } + else if (frameType === wsmessages_1.RpcFrameType.SuccessResponse) { + return "success"; + } + else { + return `Unexpected frame types ${frameType}`; + } + } + async processSchema(reqOrResp, data) { + if (this.isJson()) { + const jsonStr = new TextDecoder().decode(data); + return JSON.parse(jsonStr); + } + else { + const endPoint = this.endPoint(); + if (endPoint === undefined) { + return { + "error": "no endpoint" + }; + } + if (data === undefined) { + return {}; + } + return protobufToJson(endPoint, reqOrResp, data); + } + } + async responseObj() { + var _a; + return this.processSchema("response", (_a = this.responseMessage()) === null || _a === void 0 ? void 0 : _a.data); + } + async requestObj() { + var _a; + return this.processSchema("request", (_a = this.requestMessage()) === null || _a === void 0 ? void 0 : _a.data); + } +} +exports.RpcRequestResponse = RpcRequestResponse; +const GlobalClient = { + get: (0, Utils_1.memoize)(() => newHermesClient("https://hermes-go.ahsrcm.com", JsonContentTypeHandler)) +}; +exports.default = GlobalClient; +function runHermesClientTest() { +} +exports.runHermesClientTest = runHermesClientTest; +function runHermesClientTest2() { + // const hc = newHermesClient("https://hermes-go.ahsrcm.com", ContentType.Protobuf); + const hc = newHermesClient("https://hermes-go.ahsrcm.com", JsonContentTypeHandler); + hc.mailbox().then((mbox) => { + const cdcs = { + tables: [ + { + database: "nefario", + table: "service", + }, + ], + startSeq: "new", + }; + hc.cdcSubscribe(cdcs, (cdcEvent, a) => { + console.log("cdcEvent", cdcEvent); + }); + }); + // hc.correlatedRpcReader("rrb07167144dc644a0be22a85301afea7e" , (correlation) => { + // console.log("correlation", correlation); + // }); +} +exports.runHermesClientTest2 = runHermesClientTest2; +async function protobufToJson(schemaName, frametype, bytes) { + // const mboxObj = CreateMailboxRequest.toJSON(mbox); + // const mboxJson = JSON.stringify(mboxObj); + // let mailboxResponse: CreateMailboxResponse | undefined = undefined; + const rootUrl = GlobalClient.get().rootUrl; + const response = await fetch(`${rootUrl}/api/proto_to_json?schema=${schemaName}&frametype=${frametype}`, { + method: "POST", + body: bytes, + }); + if (response.ok) { + const jsonStr = await response.text(); + return JSON.parse(jsonStr); + } + else { + throw new Error(`proto_to_json failed with status ${response.status}`); + } +} diff --git a/lib/cjs/hermesclient/google/protobuf/struct.d.ts b/lib/cjs/hermesclient/google/protobuf/struct.d.ts new file mode 100644 index 0000000..8fa6281 --- /dev/null +++ b/lib/cjs/hermesclient/google/protobuf/struct.d.ts @@ -0,0 +1,201 @@ +import * as _m0 from "../../../../node_modules/protobufjs/minimal"; +export declare const protobufPackage = "google.protobuf"; +/** + * `NullValue` is a singleton enumeration to represent the null value for the + * `Value` type union. + * + * The JSON representation for `NullValue` is JSON `null`. + */ +export declare enum NullValue { + /** NULL_VALUE - Null value. */ + NULL_VALUE = 0, + UNRECOGNIZED = -1 +} +export declare function nullValueFromJSON(object: any): NullValue; +export declare function nullValueToJSON(object: NullValue): string; +/** + * `Struct` represents a structured data value, consisting of fields + * which map to dynamically typed values. In some languages, `Struct` + * might be supported by a native representation. For example, in + * scripting languages like JS a struct is represented as an + * object. The details of that representation are described together + * with the proto support for the language. + * + * The JSON representation for `Struct` is JSON object. + */ +export interface Struct { + /** Unordered map of dynamically typed values. */ + fields: { + [key: string]: any | undefined; + }; +} +export interface Struct_FieldsEntry { + key: string; + value: any | undefined; +} +/** + * `Value` represents a dynamically typed value which can be either + * null, a number, a string, a boolean, a recursive struct value, or a + * list of values. A producer of value is expected to set one of these + * variants. Absence of any variant indicates an error. + * + * The JSON representation for `Value` is JSON value. + */ +export interface Value { + /** Represents a null value. */ + nullValue?: NullValue | undefined; + /** Represents a double value. */ + numberValue?: number | undefined; + /** Represents a string value. */ + stringValue?: string | undefined; + /** Represents a boolean value. */ + boolValue?: boolean | undefined; + /** Represents a structured value. */ + structValue?: { + [key: string]: any; + } | undefined; + /** Represents a repeated `Value`. */ + listValue?: Array | undefined; +} +/** + * `ListValue` is a wrapper around a repeated field of values. + * + * The JSON representation for `ListValue` is JSON array. + */ +export interface ListValue { + /** Repeated field of dynamically typed values. */ + values: any[]; +} +export declare const Struct: { + encode(message: Struct, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): Struct; + fromJSON(object: any): Struct; + toJSON(message: Struct): unknown; + create]: never; }) | undefined; + } & { [K_1 in Exclude]: never; }>(base?: I): Struct; + fromPartial]: never; }) | undefined; + } & { [K_3 in Exclude]: never; }>(object: I_1): Struct; + wrap(object: { + [key: string]: any; + } | undefined): Struct; + unwrap(message: Struct): { + [key: string]: any; + }; +}; +export declare const Struct_FieldsEntry: { + encode(message: Struct_FieldsEntry, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): Struct_FieldsEntry; + fromJSON(object: any): Struct_FieldsEntry; + toJSON(message: Struct_FieldsEntry): unknown; + create]: never; }>(base?: I): Struct_FieldsEntry; + fromPartial]: never; }>(object: I_1): Struct_FieldsEntry; +}; +export declare const Value: { + encode(message: Value, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): Value; + fromJSON(object: any): Value; + toJSON(message: Value): unknown; + create]: never; }) | undefined; + listValue?: (any[] & any[] & { [K_1 in Exclude]: never; }) | undefined; + } & { [K_2 in Exclude]: never; }>(base?: I): Value; + fromPartial]: never; }) | undefined; + listValue?: (any[] & any[] & { [K_4 in Exclude]: never; }) | undefined; + } & { [K_5 in Exclude]: never; }>(object: I_1): Value; + wrap(value: any): Value; + unwrap(message: any): string | number | boolean | Object | null | Array | undefined; +}; +export declare const ListValue: { + encode(message: ListValue, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): ListValue; + fromJSON(object: any): ListValue; + toJSON(message: ListValue): unknown; + create]: never; }) | undefined; + } & { [K_1 in Exclude]: never; }>(base?: I): ListValue; + fromPartial]: never; }) | undefined; + } & { [K_3 in Exclude]: never; }>(object: I_1): ListValue; + wrap(array: Array | undefined): ListValue; + unwrap(message: ListValue): Array; +}; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin ? P : P & { + [K in keyof P]: Exact; +} & { + [K in Exclude>]: never; +}; +export {}; diff --git a/lib/cjs/hermesclient/google/protobuf/struct.js b/lib/cjs/hermesclient/google/protobuf/struct.js new file mode 100644 index 0000000..37c6298 --- /dev/null +++ b/lib/cjs/hermesclient/google/protobuf/struct.js @@ -0,0 +1,469 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ListValue = exports.Value = exports.Struct_FieldsEntry = exports.Struct = exports.nullValueToJSON = exports.nullValueFromJSON = exports.NullValue = exports.protobufPackage = void 0; +/* eslint-disable */ +const _m0 = __importStar(require("../../../../node_modules/protobufjs/minimal")); +exports.protobufPackage = "google.protobuf"; +/** + * `NullValue` is a singleton enumeration to represent the null value for the + * `Value` type union. + * + * The JSON representation for `NullValue` is JSON `null`. + */ +var NullValue; +(function (NullValue) { + /** NULL_VALUE - Null value. */ + NullValue[NullValue["NULL_VALUE"] = 0] = "NULL_VALUE"; + NullValue[NullValue["UNRECOGNIZED"] = -1] = "UNRECOGNIZED"; +})(NullValue || (exports.NullValue = NullValue = {})); +function nullValueFromJSON(object) { + switch (object) { + case 0: + case "NULL_VALUE": + return NullValue.NULL_VALUE; + case -1: + case "UNRECOGNIZED": + default: + return NullValue.UNRECOGNIZED; + } +} +exports.nullValueFromJSON = nullValueFromJSON; +function nullValueToJSON(object) { + switch (object) { + case NullValue.NULL_VALUE: + return "NULL_VALUE"; + case NullValue.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +exports.nullValueToJSON = nullValueToJSON; +function createBaseStruct() { + return { fields: {} }; +} +exports.Struct = { + encode(message, writer = _m0.Writer.create()) { + Object.entries(message.fields).forEach(([key, value]) => { + if (value !== undefined) { + exports.Struct_FieldsEntry.encode({ key: key, value }, writer.uint32(10).fork()).ldelim(); + } + }); + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStruct(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + const entry1 = exports.Struct_FieldsEntry.decode(reader, reader.uint32()); + if (entry1.value !== undefined) { + message.fields[entry1.key] = entry1.value; + } + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + fields: isObject(object.fields) + ? Object.entries(object.fields).reduce((acc, [key, value]) => { + acc[key] = value; + return acc; + }, {}) + : {}, + }; + }, + toJSON(message) { + const obj = {}; + if (message.fields) { + const entries = Object.entries(message.fields); + if (entries.length > 0) { + obj.fields = {}; + entries.forEach(([k, v]) => { + obj.fields[k] = v; + }); + } + } + return obj; + }, + create(base) { + return exports.Struct.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a; + const message = createBaseStruct(); + message.fields = Object.entries((_a = object.fields) !== null && _a !== void 0 ? _a : {}).reduce((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = value; + } + return acc; + }, {}); + return message; + }, + wrap(object) { + const struct = createBaseStruct(); + if (object !== undefined) { + Object.keys(object).forEach((key) => { + struct.fields[key] = object[key]; + }); + } + return struct; + }, + unwrap(message) { + const object = {}; + if (message.fields) { + Object.keys(message.fields).forEach((key) => { + object[key] = message.fields[key]; + }); + } + return object; + }, +}; +function createBaseStruct_FieldsEntry() { + return { key: "", value: undefined }; +} +exports.Struct_FieldsEntry = { + encode(message, writer = _m0.Writer.create()) { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + exports.Value.encode(exports.Value.wrap(message.value), writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStruct_FieldsEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + message.key = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + message.value = exports.Value.unwrap(exports.Value.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object === null || object === void 0 ? void 0 : object.value) ? object.value : undefined, + }; + }, + toJSON(message) { + const obj = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== undefined) { + obj.value = message.value; + } + return obj; + }, + create(base) { + return exports.Struct_FieldsEntry.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a, _b; + const message = createBaseStruct_FieldsEntry(); + message.key = (_a = object.key) !== null && _a !== void 0 ? _a : ""; + message.value = (_b = object.value) !== null && _b !== void 0 ? _b : undefined; + return message; + }, +}; +function createBaseValue() { + return { + nullValue: undefined, + numberValue: undefined, + stringValue: undefined, + boolValue: undefined, + structValue: undefined, + listValue: undefined, + }; +} +exports.Value = { + encode(message, writer = _m0.Writer.create()) { + if (message.nullValue !== undefined) { + writer.uint32(8).int32(message.nullValue); + } + if (message.numberValue !== undefined) { + writer.uint32(17).double(message.numberValue); + } + if (message.stringValue !== undefined) { + writer.uint32(26).string(message.stringValue); + } + if (message.boolValue !== undefined) { + writer.uint32(32).bool(message.boolValue); + } + if (message.structValue !== undefined) { + exports.Struct.encode(exports.Struct.wrap(message.structValue), writer.uint32(42).fork()).ldelim(); + } + if (message.listValue !== undefined) { + exports.ListValue.encode(exports.ListValue.wrap(message.listValue), writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValue(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + message.nullValue = reader.int32(); + continue; + case 2: + if (tag !== 17) { + break; + } + message.numberValue = reader.double(); + continue; + case 3: + if (tag !== 26) { + break; + } + message.stringValue = reader.string(); + continue; + case 4: + if (tag !== 32) { + break; + } + message.boolValue = reader.bool(); + continue; + case 5: + if (tag !== 42) { + break; + } + message.structValue = exports.Struct.unwrap(exports.Struct.decode(reader, reader.uint32())); + continue; + case 6: + if (tag !== 50) { + break; + } + message.listValue = exports.ListValue.unwrap(exports.ListValue.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + nullValue: isSet(object.nullValue) ? nullValueFromJSON(object.nullValue) : undefined, + numberValue: isSet(object.numberValue) ? globalThis.Number(object.numberValue) : undefined, + stringValue: isSet(object.stringValue) ? globalThis.String(object.stringValue) : undefined, + boolValue: isSet(object.boolValue) ? globalThis.Boolean(object.boolValue) : undefined, + structValue: isObject(object.structValue) ? object.structValue : undefined, + listValue: globalThis.Array.isArray(object.listValue) ? [...object.listValue] : undefined, + }; + }, + toJSON(message) { + const obj = {}; + if (message.nullValue !== undefined) { + obj.nullValue = nullValueToJSON(message.nullValue); + } + if (message.numberValue !== undefined) { + obj.numberValue = message.numberValue; + } + if (message.stringValue !== undefined) { + obj.stringValue = message.stringValue; + } + if (message.boolValue !== undefined) { + obj.boolValue = message.boolValue; + } + if (message.structValue !== undefined) { + obj.structValue = message.structValue; + } + if (message.listValue !== undefined) { + obj.listValue = message.listValue; + } + return obj; + }, + create(base) { + return exports.Value.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a, _b, _c, _d, _e, _f; + const message = createBaseValue(); + message.nullValue = (_a = object.nullValue) !== null && _a !== void 0 ? _a : undefined; + message.numberValue = (_b = object.numberValue) !== null && _b !== void 0 ? _b : undefined; + message.stringValue = (_c = object.stringValue) !== null && _c !== void 0 ? _c : undefined; + message.boolValue = (_d = object.boolValue) !== null && _d !== void 0 ? _d : undefined; + message.structValue = (_e = object.structValue) !== null && _e !== void 0 ? _e : undefined; + message.listValue = (_f = object.listValue) !== null && _f !== void 0 ? _f : undefined; + return message; + }, + wrap(value) { + const result = createBaseValue(); + if (value === null) { + result.nullValue = NullValue.NULL_VALUE; + } + else if (typeof value === "boolean") { + result.boolValue = value; + } + else if (typeof value === "number") { + result.numberValue = value; + } + else if (typeof value === "string") { + result.stringValue = value; + } + else if (globalThis.Array.isArray(value)) { + result.listValue = value; + } + else if (typeof value === "object") { + result.structValue = value; + } + else if (typeof value !== "undefined") { + throw new globalThis.Error("Unsupported any value type: " + typeof value); + } + return result; + }, + unwrap(message) { + if (message.stringValue !== undefined) { + return message.stringValue; + } + else if ((message === null || message === void 0 ? void 0 : message.numberValue) !== undefined) { + return message.numberValue; + } + else if ((message === null || message === void 0 ? void 0 : message.boolValue) !== undefined) { + return message.boolValue; + } + else if ((message === null || message === void 0 ? void 0 : message.structValue) !== undefined) { + return message.structValue; + } + else if ((message === null || message === void 0 ? void 0 : message.listValue) !== undefined) { + return message.listValue; + } + else if ((message === null || message === void 0 ? void 0 : message.nullValue) !== undefined) { + return null; + } + return undefined; + }, +}; +function createBaseListValue() { + return { values: [] }; +} +exports.ListValue = { + encode(message, writer = _m0.Writer.create()) { + for (const v of message.values) { + exports.Value.encode(exports.Value.wrap(v), writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListValue(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + message.values.push(exports.Value.unwrap(exports.Value.decode(reader, reader.uint32()))); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { values: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.values) ? [...object.values] : [] }; + }, + toJSON(message) { + var _a; + const obj = {}; + if ((_a = message.values) === null || _a === void 0 ? void 0 : _a.length) { + obj.values = message.values; + } + return obj; + }, + create(base) { + return exports.ListValue.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a; + const message = createBaseListValue(); + message.values = ((_a = object.values) === null || _a === void 0 ? void 0 : _a.map((e) => e)) || []; + return message; + }, + wrap(array) { + const result = createBaseListValue(); + result.values = array !== null && array !== void 0 ? array : []; + return result; + }, + unwrap(message) { + if ((message === null || message === void 0 ? void 0 : message.hasOwnProperty("values")) && globalThis.Array.isArray(message.values)) { + return message.values; + } + else { + return message; + } + }, +}; +function isObject(value) { + return typeof value === "object" && value !== null; +} +function isSet(value) { + return value !== null && value !== undefined; +} diff --git a/lib/cjs/hermesclient/proto/wsmessages.d.ts b/lib/cjs/hermesclient/proto/wsmessages.d.ts new file mode 100644 index 0000000..aa09aa0 --- /dev/null +++ b/lib/cjs/hermesclient/proto/wsmessages.d.ts @@ -0,0 +1,4566 @@ +import * as _m0 from "../../../node_modules/protobufjs/minimal"; +import { Observable } from "../../../node_modules/rxjs/dist/types/index"; +export declare const protobufPackage = "hermes"; +export declare enum RpcFrameType { + UnspecifiedRFT = 0, + Request = 1, + SuccessResponse = 2, + ErrorResponse = 3, + UNRECOGNIZED = -1 +} +export declare function rpcFrameTypeFromJSON(object: any): RpcFrameType; +export declare function rpcFrameTypeToJSON(object: RpcFrameType): string; +export declare enum ContentType { + UnspecifiedCT = 0, + Protobuf = 1, + Json = 2, + Binary = 3, + Text = 4, + UNRECOGNIZED = -1 +} +export declare function contentTypeFromJSON(object: any): ContentType; +export declare function contentTypeToJSON(object: ContentType): string; +export interface MessageFromClient { + sendMessageRequest?: SendMessageRequest | undefined; + firstMessage?: FirstMessage | undefined; + ping?: Ping | undefined; + pong?: Pong | undefined; + notification?: Notification | undefined; + subscribeRequest?: SubscribeRequest | undefined; +} +export interface Notification { + message?: string | undefined; +} +export interface MessageToClient { + messageEnvelope?: MessageEnvelope | undefined; + sendMessageResponse?: SendMessageResponse | undefined; + ping?: Ping | undefined; + pong?: Pong | undefined; + notification?: Notification | undefined; + subscribeResponse?: SubscribeResponse | undefined; +} +export interface Ping { + payload?: Uint8Array | undefined; +} +export interface Pong { + payload?: Uint8Array | undefined; +} +export interface MessageHeader { + sender?: string | undefined; + contentType?: ContentType | undefined; + rpcHeader?: RpcHeader | undefined; + senderSequence?: number | undefined; + extraHeaders?: KeyValPair[] | undefined; +} +export interface SenderEnvelope { + created?: number | undefined; +} +export interface ServerEnvelope { + sequence?: number | undefined; + created?: number | undefined; + channel?: string | undefined; + subscriptionId?: string | undefined; +} +export interface KeyValPair { + key?: string | undefined; + val?: string | undefined; +} +export interface RpcHeader { + correlationId?: string | undefined; + endPoint?: string | undefined; + frameType?: RpcFrameType | undefined; + errorInfo?: RpcErrorInfo | undefined; +} +export interface RpcErrorInfo { + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; +} +export interface Message { + header?: MessageHeader | undefined; + senderEnvelope?: SenderEnvelope | undefined; + serverEnvelope?: ServerEnvelope | undefined; + data?: Uint8Array | undefined; +} +export interface MessageEnvelope { + messageBytes?: Uint8Array | undefined; + serverEnvelope?: ServerEnvelope | undefined; +} +export interface SendMessageRequest { + to?: string[] | undefined; + message?: Message | undefined; + channel?: string | undefined; + idempotentId?: string | undefined; +} +export interface SendMessageResponse { + errors?: SendMessageError[] | undefined; + duplicates?: string[] | undefined; + idempotentId?: string | undefined; + correlationId?: string | undefined; +} +export interface SendReceipt { + request?: SendMessageRequest | undefined; + response?: SendMessageResponse | undefined; + serverEnvelope?: ServerEnvelope | undefined; +} +export interface SendMessageError { + message?: string | undefined; + to?: string | undefined; +} +export interface FirstMessage { + senderInfo?: SenderInfo | undefined; + mailboxTimeoutInMs?: number | undefined; + subscriptions?: Subscription[] | undefined; +} +export interface SenderInfo { + readerKey?: string | undefined; + address?: string | undefined; +} +export interface SubscribeRequest { + subscriptions?: Subscription[] | undefined; +} +export interface SubscribeResponse { + succeeded?: string[] | undefined; + errors?: SubscribeError[] | undefined; +} +export interface SubscribeError { + state?: string | undefined; + message?: string | undefined; +} +export interface Subscription { + mailbox?: MailboxSubscription | undefined; + nefario?: NefarioSubscription | undefined; + changeDataCapture?: ChangeDataCaptureSubscription | undefined; + unsubscribe?: Unsubscribe | undefined; +} +export interface MailboxSubscription { + id?: string | undefined; + state?: string | undefined; + readerKey?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; +} +export interface ChangeDataCaptureSubscription { + id?: string | undefined; + state?: string | undefined; + matchers?: RecordMatcher[] | undefined; + startSeq?: string | undefined; +} +export interface RecordMatcher { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; +} +export interface NefarioSubscription { + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; +} +export interface Unsubscribe { + id?: string | undefined; +} +export interface CreateMailboxRequest { + channels?: string[] | undefined; + privateMetadata?: { + [key: string]: any; + } | undefined; + publicMetadata?: { + [key: string]: any; + } | undefined; + purgeTimeoutInMillis?: number | undefined; + closeTimeoutInMillis?: number | undefined; + extraData?: { + [key: string]: any; + } | undefined; +} +export interface CreateMailboxResponse { + adminKey?: string | undefined; + address?: string | undefined; + readerKey?: string | undefined; + channels?: string[] | undefined; +} +export interface AddChannelRequest { + adminKey?: string | undefined; + channels?: string[] | undefined; +} +export interface AddChannelResponse { +} +export declare const MessageFromClient: { + encode(message: MessageFromClient, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): MessageFromClient; + fromJSON(object: any): MessageFromClient; + toJSON(message: MessageFromClient): unknown; + create]: never; }) | undefined; + message?: ({ + header?: { + sender?: string | undefined; + contentType?: ContentType | undefined; + rpcHeader?: { + correlationId?: string | undefined; + endPoint?: string | undefined; + frameType?: RpcFrameType | undefined; + errorInfo?: { + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } | undefined; + } | undefined; + senderSequence?: number | undefined; + extraHeaders?: { + key?: string | undefined; + val?: string | undefined; + }[] | undefined; + } | undefined; + senderEnvelope?: { + created?: number | undefined; + } | undefined; + serverEnvelope?: { + sequence?: number | undefined; + created?: number | undefined; + channel?: string | undefined; + subscriptionId?: string | undefined; + } | undefined; + data?: Uint8Array | undefined; + } & { + header?: ({ + sender?: string | undefined; + contentType?: ContentType | undefined; + rpcHeader?: { + correlationId?: string | undefined; + endPoint?: string | undefined; + frameType?: RpcFrameType | undefined; + errorInfo?: { + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } | undefined; + } | undefined; + senderSequence?: number | undefined; + extraHeaders?: { + key?: string | undefined; + val?: string | undefined; + }[] | undefined; + } & { + sender?: string | undefined; + contentType?: ContentType | undefined; + rpcHeader?: ({ + correlationId?: string | undefined; + endPoint?: string | undefined; + frameType?: RpcFrameType | undefined; + errorInfo?: { + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } | undefined; + } & { + correlationId?: string | undefined; + endPoint?: string | undefined; + frameType?: RpcFrameType | undefined; + errorInfo?: ({ + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } & { + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } & { [K_1 in Exclude]: never; }) | undefined; + } & { [K_2 in Exclude]: never; }) | undefined; + senderSequence?: number | undefined; + extraHeaders?: ({ + key?: string | undefined; + val?: string | undefined; + }[] & ({ + key?: string | undefined; + val?: string | undefined; + } & { + key?: string | undefined; + val?: string | undefined; + } & { [K_3 in Exclude]: never; })[] & { [K_4 in Exclude]: never; }) | undefined; + } & { [K_5 in Exclude]: never; }) | undefined; + senderEnvelope?: ({ + created?: number | undefined; + } & { + created?: number | undefined; + } & { [K_6 in Exclude]: never; }) | undefined; + serverEnvelope?: ({ + sequence?: number | undefined; + created?: number | undefined; + channel?: string | undefined; + subscriptionId?: string | undefined; + } & { + sequence?: number | undefined; + created?: number | undefined; + channel?: string | undefined; + subscriptionId?: string | undefined; + } & { [K_7 in Exclude]: never; }) | undefined; + data?: Uint8Array | undefined; + } & { [K_8 in Exclude]: never; }) | undefined; + channel?: string | undefined; + idempotentId?: string | undefined; + } & { [K_9 in Exclude]: never; }) | undefined; + firstMessage?: ({ + senderInfo?: { + readerKey?: string | undefined; + address?: string | undefined; + } | undefined; + mailboxTimeoutInMs?: number | undefined; + subscriptions?: { + mailbox?: { + id?: string | undefined; + state?: string | undefined; + readerKey?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + nefario?: { + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + changeDataCapture?: { + id?: string | undefined; + state?: string | undefined; + matchers?: { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] | undefined; + startSeq?: string | undefined; + } | undefined; + unsubscribe?: { + id?: string | undefined; + } | undefined; + }[] | undefined; + } & { + senderInfo?: ({ + readerKey?: string | undefined; + address?: string | undefined; + } & { + readerKey?: string | undefined; + address?: string | undefined; + } & { [K_10 in Exclude]: never; }) | undefined; + mailboxTimeoutInMs?: number | undefined; + subscriptions?: ({ + mailbox?: { + id?: string | undefined; + state?: string | undefined; + readerKey?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + nefario?: { + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + changeDataCapture?: { + id?: string | undefined; + state?: string | undefined; + matchers?: { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] | undefined; + startSeq?: string | undefined; + } | undefined; + unsubscribe?: { + id?: string | undefined; + } | undefined; + }[] & ({ + mailbox?: { + id?: string | undefined; + state?: string | undefined; + readerKey?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + nefario?: { + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + changeDataCapture?: { + id?: string | undefined; + state?: string | undefined; + matchers?: { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] | undefined; + startSeq?: string | undefined; + } | undefined; + unsubscribe?: { + id?: string | undefined; + } | undefined; + } & { + mailbox?: ({ + id?: string | undefined; + state?: string | undefined; + readerKey?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { + id?: string | undefined; + state?: string | undefined; + readerKey?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { [K_11 in Exclude]: never; }) | undefined; + nefario?: ({ + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { [K_12 in Exclude]: never; }) | undefined; + changeDataCapture?: ({ + id?: string | undefined; + state?: string | undefined; + matchers?: { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] | undefined; + startSeq?: string | undefined; + } & { + id?: string | undefined; + state?: string | undefined; + matchers?: ({ + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] & ({ + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + } & { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: (any[] & any[] & { [K_13 in Exclude]: never; }) | undefined; + } & { [K_14 in Exclude]: never; })[] & { [K_15 in Exclude]: never; }) | undefined; + startSeq?: string | undefined; + } & { [K_16 in Exclude]: never; }) | undefined; + unsubscribe?: ({ + id?: string | undefined; + } & { + id?: string | undefined; + } & { [K_17 in Exclude]: never; }) | undefined; + } & { [K_18 in Exclude]: never; })[] & { [K_19 in Exclude]: never; }) | undefined; + } & { [K_20 in Exclude]: never; }) | undefined; + ping?: ({ + payload?: Uint8Array | undefined; + } & { + payload?: Uint8Array | undefined; + } & { [K_21 in Exclude]: never; }) | undefined; + pong?: ({ + payload?: Uint8Array | undefined; + } & { + payload?: Uint8Array | undefined; + } & { [K_22 in Exclude]: never; }) | undefined; + notification?: ({ + message?: string | undefined; + } & { + message?: string | undefined; + } & { [K_23 in Exclude]: never; }) | undefined; + subscribeRequest?: ({ + subscriptions?: { + mailbox?: { + id?: string | undefined; + state?: string | undefined; + readerKey?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + nefario?: { + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + changeDataCapture?: { + id?: string | undefined; + state?: string | undefined; + matchers?: { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] | undefined; + startSeq?: string | undefined; + } | undefined; + unsubscribe?: { + id?: string | undefined; + } | undefined; + }[] | undefined; + } & { + subscriptions?: ({ + mailbox?: { + id?: string | undefined; + state?: string | undefined; + readerKey?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + nefario?: { + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + changeDataCapture?: { + id?: string | undefined; + state?: string | undefined; + matchers?: { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] | undefined; + startSeq?: string | undefined; + } | undefined; + unsubscribe?: { + id?: string | undefined; + } | undefined; + }[] & ({ + mailbox?: { + id?: string | undefined; + state?: string | undefined; + readerKey?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + nefario?: { + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + changeDataCapture?: { + id?: string | undefined; + state?: string | undefined; + matchers?: { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] | undefined; + startSeq?: string | undefined; + } | undefined; + unsubscribe?: { + id?: string | undefined; + } | undefined; + } & { + mailbox?: ({ + id?: string | undefined; + state?: string | undefined; + readerKey?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { + id?: string | undefined; + state?: string | undefined; + readerKey?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { [K_24 in Exclude]: never; }) | undefined; + nefario?: ({ + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { [K_25 in Exclude]: never; }) | undefined; + changeDataCapture?: ({ + id?: string | undefined; + state?: string | undefined; + matchers?: { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] | undefined; + startSeq?: string | undefined; + } & { + id?: string | undefined; + state?: string | undefined; + matchers?: ({ + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] & ({ + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + } & { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: (any[] & any[] & { [K_26 in Exclude]: never; }) | undefined; + } & { [K_27 in Exclude]: never; })[] & { [K_28 in Exclude]: never; }) | undefined; + startSeq?: string | undefined; + } & { [K_29 in Exclude]: never; }) | undefined; + unsubscribe?: ({ + id?: string | undefined; + } & { + id?: string | undefined; + } & { [K_30 in Exclude]: never; }) | undefined; + } & { [K_31 in Exclude]: never; })[] & { [K_32 in Exclude]: never; }) | undefined; + } & { [K_33 in Exclude]: never; }) | undefined; + } & { [K_34 in Exclude]: never; }>(base?: I): MessageFromClient; + fromPartial]: never; }) | undefined; + message?: ({ + header?: { + sender?: string | undefined; + contentType?: ContentType | undefined; + rpcHeader?: { + correlationId?: string | undefined; + endPoint?: string | undefined; + frameType?: RpcFrameType | undefined; + errorInfo?: { + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } | undefined; + } | undefined; + senderSequence?: number | undefined; + extraHeaders?: { + key?: string | undefined; + val?: string | undefined; + }[] | undefined; + } | undefined; + senderEnvelope?: { + created?: number | undefined; + } | undefined; + serverEnvelope?: { + sequence?: number | undefined; + created?: number | undefined; + channel?: string | undefined; + subscriptionId?: string | undefined; + } | undefined; + data?: Uint8Array | undefined; + } & { + header?: ({ + sender?: string | undefined; + contentType?: ContentType | undefined; + rpcHeader?: { + correlationId?: string | undefined; + endPoint?: string | undefined; + frameType?: RpcFrameType | undefined; + errorInfo?: { + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } | undefined; + } | undefined; + senderSequence?: number | undefined; + extraHeaders?: { + key?: string | undefined; + val?: string | undefined; + }[] | undefined; + } & { + sender?: string | undefined; + contentType?: ContentType | undefined; + rpcHeader?: ({ + correlationId?: string | undefined; + endPoint?: string | undefined; + frameType?: RpcFrameType | undefined; + errorInfo?: { + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } | undefined; + } & { + correlationId?: string | undefined; + endPoint?: string | undefined; + frameType?: RpcFrameType | undefined; + errorInfo?: ({ + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } & { + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } & { [K_36 in Exclude]: never; }) | undefined; + } & { [K_37 in Exclude]: never; }) | undefined; + senderSequence?: number | undefined; + extraHeaders?: ({ + key?: string | undefined; + val?: string | undefined; + }[] & ({ + key?: string | undefined; + val?: string | undefined; + } & { + key?: string | undefined; + val?: string | undefined; + } & { [K_38 in Exclude]: never; })[] & { [K_39 in Exclude]: never; }) | undefined; + } & { [K_40 in Exclude]: never; }) | undefined; + senderEnvelope?: ({ + created?: number | undefined; + } & { + created?: number | undefined; + } & { [K_41 in Exclude]: never; }) | undefined; + serverEnvelope?: ({ + sequence?: number | undefined; + created?: number | undefined; + channel?: string | undefined; + subscriptionId?: string | undefined; + } & { + sequence?: number | undefined; + created?: number | undefined; + channel?: string | undefined; + subscriptionId?: string | undefined; + } & { [K_42 in Exclude]: never; }) | undefined; + data?: Uint8Array | undefined; + } & { [K_43 in Exclude]: never; }) | undefined; + channel?: string | undefined; + idempotentId?: string | undefined; + } & { [K_44 in Exclude]: never; }) | undefined; + firstMessage?: ({ + senderInfo?: { + readerKey?: string | undefined; + address?: string | undefined; + } | undefined; + mailboxTimeoutInMs?: number | undefined; + subscriptions?: { + mailbox?: { + id?: string | undefined; + state?: string | undefined; + readerKey?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + nefario?: { + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + changeDataCapture?: { + id?: string | undefined; + state?: string | undefined; + matchers?: { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] | undefined; + startSeq?: string | undefined; + } | undefined; + unsubscribe?: { + id?: string | undefined; + } | undefined; + }[] | undefined; + } & { + senderInfo?: ({ + readerKey?: string | undefined; + address?: string | undefined; + } & { + readerKey?: string | undefined; + address?: string | undefined; + } & { [K_45 in Exclude]: never; }) | undefined; + mailboxTimeoutInMs?: number | undefined; + subscriptions?: ({ + mailbox?: { + id?: string | undefined; + state?: string | undefined; + readerKey?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + nefario?: { + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + changeDataCapture?: { + id?: string | undefined; + state?: string | undefined; + matchers?: { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] | undefined; + startSeq?: string | undefined; + } | undefined; + unsubscribe?: { + id?: string | undefined; + } | undefined; + }[] & ({ + mailbox?: { + id?: string | undefined; + state?: string | undefined; + readerKey?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + nefario?: { + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + changeDataCapture?: { + id?: string | undefined; + state?: string | undefined; + matchers?: { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] | undefined; + startSeq?: string | undefined; + } | undefined; + unsubscribe?: { + id?: string | undefined; + } | undefined; + } & { + mailbox?: ({ + id?: string | undefined; + state?: string | undefined; + readerKey?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { + id?: string | undefined; + state?: string | undefined; + readerKey?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { [K_46 in Exclude]: never; }) | undefined; + nefario?: ({ + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { [K_47 in Exclude]: never; }) | undefined; + changeDataCapture?: ({ + id?: string | undefined; + state?: string | undefined; + matchers?: { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] | undefined; + startSeq?: string | undefined; + } & { + id?: string | undefined; + state?: string | undefined; + matchers?: ({ + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] & ({ + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + } & { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: (any[] & any[] & { [K_48 in Exclude]: never; }) | undefined; + } & { [K_49 in Exclude]: never; })[] & { [K_50 in Exclude]: never; }) | undefined; + startSeq?: string | undefined; + } & { [K_51 in Exclude]: never; }) | undefined; + unsubscribe?: ({ + id?: string | undefined; + } & { + id?: string | undefined; + } & { [K_52 in Exclude]: never; }) | undefined; + } & { [K_53 in Exclude]: never; })[] & { [K_54 in Exclude]: never; }) | undefined; + } & { [K_55 in Exclude]: never; }) | undefined; + ping?: ({ + payload?: Uint8Array | undefined; + } & { + payload?: Uint8Array | undefined; + } & { [K_56 in Exclude]: never; }) | undefined; + pong?: ({ + payload?: Uint8Array | undefined; + } & { + payload?: Uint8Array | undefined; + } & { [K_57 in Exclude]: never; }) | undefined; + notification?: ({ + message?: string | undefined; + } & { + message?: string | undefined; + } & { [K_58 in Exclude]: never; }) | undefined; + subscribeRequest?: ({ + subscriptions?: { + mailbox?: { + id?: string | undefined; + state?: string | undefined; + readerKey?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + nefario?: { + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + changeDataCapture?: { + id?: string | undefined; + state?: string | undefined; + matchers?: { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] | undefined; + startSeq?: string | undefined; + } | undefined; + unsubscribe?: { + id?: string | undefined; + } | undefined; + }[] | undefined; + } & { + subscriptions?: ({ + mailbox?: { + id?: string | undefined; + state?: string | undefined; + readerKey?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + nefario?: { + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + changeDataCapture?: { + id?: string | undefined; + state?: string | undefined; + matchers?: { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] | undefined; + startSeq?: string | undefined; + } | undefined; + unsubscribe?: { + id?: string | undefined; + } | undefined; + }[] & ({ + mailbox?: { + id?: string | undefined; + state?: string | undefined; + readerKey?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + nefario?: { + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + changeDataCapture?: { + id?: string | undefined; + state?: string | undefined; + matchers?: { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] | undefined; + startSeq?: string | undefined; + } | undefined; + unsubscribe?: { + id?: string | undefined; + } | undefined; + } & { + mailbox?: ({ + id?: string | undefined; + state?: string | undefined; + readerKey?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { + id?: string | undefined; + state?: string | undefined; + readerKey?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { [K_59 in Exclude]: never; }) | undefined; + nefario?: ({ + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { [K_60 in Exclude]: never; }) | undefined; + changeDataCapture?: ({ + id?: string | undefined; + state?: string | undefined; + matchers?: { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] | undefined; + startSeq?: string | undefined; + } & { + id?: string | undefined; + state?: string | undefined; + matchers?: ({ + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] & ({ + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + } & { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: (any[] & any[] & { [K_61 in Exclude]: never; }) | undefined; + } & { [K_62 in Exclude]: never; })[] & { [K_63 in Exclude]: never; }) | undefined; + startSeq?: string | undefined; + } & { [K_64 in Exclude]: never; }) | undefined; + unsubscribe?: ({ + id?: string | undefined; + } & { + id?: string | undefined; + } & { [K_65 in Exclude]: never; }) | undefined; + } & { [K_66 in Exclude]: never; })[] & { [K_67 in Exclude]: never; }) | undefined; + } & { [K_68 in Exclude]: never; }) | undefined; + } & { [K_69 in Exclude]: never; }>(object: I_1): MessageFromClient; +}; +export declare const Notification: { + encode(message: Notification, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): Notification; + fromJSON(object: any): Notification; + toJSON(message: Notification): unknown; + create]: never; }>(base?: I): Notification; + fromPartial]: never; }>(object: I_1): Notification; +}; +export declare const MessageToClient: { + encode(message: MessageToClient, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): MessageToClient; + fromJSON(object: any): MessageToClient; + toJSON(message: MessageToClient): unknown; + create]: never; }) | undefined; + } & { [K_1 in Exclude]: never; }) | undefined; + sendMessageResponse?: ({ + errors?: { + message?: string | undefined; + to?: string | undefined; + }[] | undefined; + duplicates?: string[] | undefined; + idempotentId?: string | undefined; + correlationId?: string | undefined; + } & { + errors?: ({ + message?: string | undefined; + to?: string | undefined; + }[] & ({ + message?: string | undefined; + to?: string | undefined; + } & { + message?: string | undefined; + to?: string | undefined; + } & { [K_2 in Exclude]: never; })[] & { [K_3 in Exclude]: never; }) | undefined; + duplicates?: (string[] & string[] & { [K_4 in Exclude]: never; }) | undefined; + idempotentId?: string | undefined; + correlationId?: string | undefined; + } & { [K_5 in Exclude]: never; }) | undefined; + ping?: ({ + payload?: Uint8Array | undefined; + } & { + payload?: Uint8Array | undefined; + } & { [K_6 in Exclude]: never; }) | undefined; + pong?: ({ + payload?: Uint8Array | undefined; + } & { + payload?: Uint8Array | undefined; + } & { [K_7 in Exclude]: never; }) | undefined; + notification?: ({ + message?: string | undefined; + } & { + message?: string | undefined; + } & { [K_8 in Exclude]: never; }) | undefined; + subscribeResponse?: ({ + succeeded?: string[] | undefined; + errors?: { + state?: string | undefined; + message?: string | undefined; + }[] | undefined; + } & { + succeeded?: (string[] & string[] & { [K_9 in Exclude]: never; }) | undefined; + errors?: ({ + state?: string | undefined; + message?: string | undefined; + }[] & ({ + state?: string | undefined; + message?: string | undefined; + } & { + state?: string | undefined; + message?: string | undefined; + } & { [K_10 in Exclude]: never; })[] & { [K_11 in Exclude]: never; }) | undefined; + } & { [K_12 in Exclude]: never; }) | undefined; + } & { [K_13 in Exclude]: never; }>(base?: I): MessageToClient; + fromPartial]: never; }) | undefined; + } & { [K_15 in Exclude]: never; }) | undefined; + sendMessageResponse?: ({ + errors?: { + message?: string | undefined; + to?: string | undefined; + }[] | undefined; + duplicates?: string[] | undefined; + idempotentId?: string | undefined; + correlationId?: string | undefined; + } & { + errors?: ({ + message?: string | undefined; + to?: string | undefined; + }[] & ({ + message?: string | undefined; + to?: string | undefined; + } & { + message?: string | undefined; + to?: string | undefined; + } & { [K_16 in Exclude]: never; })[] & { [K_17 in Exclude]: never; }) | undefined; + duplicates?: (string[] & string[] & { [K_18 in Exclude]: never; }) | undefined; + idempotentId?: string | undefined; + correlationId?: string | undefined; + } & { [K_19 in Exclude]: never; }) | undefined; + ping?: ({ + payload?: Uint8Array | undefined; + } & { + payload?: Uint8Array | undefined; + } & { [K_20 in Exclude]: never; }) | undefined; + pong?: ({ + payload?: Uint8Array | undefined; + } & { + payload?: Uint8Array | undefined; + } & { [K_21 in Exclude]: never; }) | undefined; + notification?: ({ + message?: string | undefined; + } & { + message?: string | undefined; + } & { [K_22 in Exclude]: never; }) | undefined; + subscribeResponse?: ({ + succeeded?: string[] | undefined; + errors?: { + state?: string | undefined; + message?: string | undefined; + }[] | undefined; + } & { + succeeded?: (string[] & string[] & { [K_23 in Exclude]: never; }) | undefined; + errors?: ({ + state?: string | undefined; + message?: string | undefined; + }[] & ({ + state?: string | undefined; + message?: string | undefined; + } & { + state?: string | undefined; + message?: string | undefined; + } & { [K_24 in Exclude]: never; })[] & { [K_25 in Exclude]: never; }) | undefined; + } & { [K_26 in Exclude]: never; }) | undefined; + } & { [K_27 in Exclude]: never; }>(object: I_1): MessageToClient; +}; +export declare const Ping: { + encode(message: Ping, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): Ping; + fromJSON(object: any): Ping; + toJSON(message: Ping): unknown; + create]: never; }>(base?: I): Ping; + fromPartial]: never; }>(object: I_1): Ping; +}; +export declare const Pong: { + encode(message: Pong, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): Pong; + fromJSON(object: any): Pong; + toJSON(message: Pong): unknown; + create]: never; }>(base?: I): Pong; + fromPartial]: never; }>(object: I_1): Pong; +}; +export declare const MessageHeader: { + encode(message: MessageHeader, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): MessageHeader; + fromJSON(object: any): MessageHeader; + toJSON(message: MessageHeader): unknown; + create]: never; }) | undefined; + } & { [K_1 in Exclude]: never; }) | undefined; + senderSequence?: number | undefined; + extraHeaders?: ({ + key?: string | undefined; + val?: string | undefined; + }[] & ({ + key?: string | undefined; + val?: string | undefined; + } & { + key?: string | undefined; + val?: string | undefined; + } & { [K_2 in Exclude]: never; })[] & { [K_3 in Exclude]: never; }) | undefined; + } & { [K_4 in Exclude]: never; }>(base?: I): MessageHeader; + fromPartial]: never; }) | undefined; + } & { [K_6 in Exclude]: never; }) | undefined; + senderSequence?: number | undefined; + extraHeaders?: ({ + key?: string | undefined; + val?: string | undefined; + }[] & ({ + key?: string | undefined; + val?: string | undefined; + } & { + key?: string | undefined; + val?: string | undefined; + } & { [K_7 in Exclude]: never; })[] & { [K_8 in Exclude]: never; }) | undefined; + } & { [K_9 in Exclude]: never; }>(object: I_1): MessageHeader; +}; +export declare const SenderEnvelope: { + encode(message: SenderEnvelope, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): SenderEnvelope; + fromJSON(object: any): SenderEnvelope; + toJSON(message: SenderEnvelope): unknown; + create]: never; }>(base?: I): SenderEnvelope; + fromPartial]: never; }>(object: I_1): SenderEnvelope; +}; +export declare const ServerEnvelope: { + encode(message: ServerEnvelope, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): ServerEnvelope; + fromJSON(object: any): ServerEnvelope; + toJSON(message: ServerEnvelope): unknown; + create]: never; }>(base?: I): ServerEnvelope; + fromPartial]: never; }>(object: I_1): ServerEnvelope; +}; +export declare const KeyValPair: { + encode(message: KeyValPair, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): KeyValPair; + fromJSON(object: any): KeyValPair; + toJSON(message: KeyValPair): unknown; + create]: never; }>(base?: I): KeyValPair; + fromPartial]: never; }>(object: I_1): KeyValPair; +}; +export declare const RpcHeader: { + encode(message: RpcHeader, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): RpcHeader; + fromJSON(object: any): RpcHeader; + toJSON(message: RpcHeader): unknown; + create]: never; }) | undefined; + } & { [K_1 in Exclude]: never; }>(base?: I): RpcHeader; + fromPartial]: never; }) | undefined; + } & { [K_3 in Exclude]: never; }>(object: I_1): RpcHeader; +}; +export declare const RpcErrorInfo: { + encode(message: RpcErrorInfo, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): RpcErrorInfo; + fromJSON(object: any): RpcErrorInfo; + toJSON(message: RpcErrorInfo): unknown; + create]: never; }>(base?: I): RpcErrorInfo; + fromPartial]: never; }>(object: I_1): RpcErrorInfo; +}; +export declare const Message: { + encode(message: Message, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): Message; + fromJSON(object: any): Message; + toJSON(message: Message): unknown; + create]: never; }) | undefined; + } & { [K_1 in Exclude]: never; }) | undefined; + senderSequence?: number | undefined; + extraHeaders?: ({ + key?: string | undefined; + val?: string | undefined; + }[] & ({ + key?: string | undefined; + val?: string | undefined; + } & { + key?: string | undefined; + val?: string | undefined; + } & { [K_2 in Exclude]: never; })[] & { [K_3 in Exclude]: never; }) | undefined; + } & { [K_4 in Exclude]: never; }) | undefined; + senderEnvelope?: ({ + created?: number | undefined; + } & { + created?: number | undefined; + } & { [K_5 in Exclude]: never; }) | undefined; + serverEnvelope?: ({ + sequence?: number | undefined; + created?: number | undefined; + channel?: string | undefined; + subscriptionId?: string | undefined; + } & { + sequence?: number | undefined; + created?: number | undefined; + channel?: string | undefined; + subscriptionId?: string | undefined; + } & { [K_6 in Exclude]: never; }) | undefined; + data?: Uint8Array | undefined; + } & { [K_7 in Exclude]: never; }>(base?: I): Message; + fromPartial]: never; }) | undefined; + } & { [K_9 in Exclude]: never; }) | undefined; + senderSequence?: number | undefined; + extraHeaders?: ({ + key?: string | undefined; + val?: string | undefined; + }[] & ({ + key?: string | undefined; + val?: string | undefined; + } & { + key?: string | undefined; + val?: string | undefined; + } & { [K_10 in Exclude]: never; })[] & { [K_11 in Exclude]: never; }) | undefined; + } & { [K_12 in Exclude]: never; }) | undefined; + senderEnvelope?: ({ + created?: number | undefined; + } & { + created?: number | undefined; + } & { [K_13 in Exclude]: never; }) | undefined; + serverEnvelope?: ({ + sequence?: number | undefined; + created?: number | undefined; + channel?: string | undefined; + subscriptionId?: string | undefined; + } & { + sequence?: number | undefined; + created?: number | undefined; + channel?: string | undefined; + subscriptionId?: string | undefined; + } & { [K_14 in Exclude]: never; }) | undefined; + data?: Uint8Array | undefined; + } & { [K_15 in Exclude]: never; }>(object: I_1): Message; +}; +export declare const MessageEnvelope: { + encode(message: MessageEnvelope, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): MessageEnvelope; + fromJSON(object: any): MessageEnvelope; + toJSON(message: MessageEnvelope): unknown; + create]: never; }) | undefined; + } & { [K_1 in Exclude]: never; }>(base?: I): MessageEnvelope; + fromPartial]: never; }) | undefined; + } & { [K_3 in Exclude]: never; }>(object: I_1): MessageEnvelope; +}; +export declare const SendMessageRequest: { + encode(message: SendMessageRequest, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): SendMessageRequest; + fromJSON(object: any): SendMessageRequest; + toJSON(message: SendMessageRequest): unknown; + create]: never; }) | undefined; + message?: ({ + header?: { + sender?: string | undefined; + contentType?: ContentType | undefined; + rpcHeader?: { + correlationId?: string | undefined; + endPoint?: string | undefined; + frameType?: RpcFrameType | undefined; + errorInfo?: { + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } | undefined; + } | undefined; + senderSequence?: number | undefined; + extraHeaders?: { + key?: string | undefined; + val?: string | undefined; + }[] | undefined; + } | undefined; + senderEnvelope?: { + created?: number | undefined; + } | undefined; + serverEnvelope?: { + sequence?: number | undefined; + created?: number | undefined; + channel?: string | undefined; + subscriptionId?: string | undefined; + } | undefined; + data?: Uint8Array | undefined; + } & { + header?: ({ + sender?: string | undefined; + contentType?: ContentType | undefined; + rpcHeader?: { + correlationId?: string | undefined; + endPoint?: string | undefined; + frameType?: RpcFrameType | undefined; + errorInfo?: { + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } | undefined; + } | undefined; + senderSequence?: number | undefined; + extraHeaders?: { + key?: string | undefined; + val?: string | undefined; + }[] | undefined; + } & { + sender?: string | undefined; + contentType?: ContentType | undefined; + rpcHeader?: ({ + correlationId?: string | undefined; + endPoint?: string | undefined; + frameType?: RpcFrameType | undefined; + errorInfo?: { + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } | undefined; + } & { + correlationId?: string | undefined; + endPoint?: string | undefined; + frameType?: RpcFrameType | undefined; + errorInfo?: ({ + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } & { + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } & { [K_1 in Exclude]: never; }) | undefined; + } & { [K_2 in Exclude]: never; }) | undefined; + senderSequence?: number | undefined; + extraHeaders?: ({ + key?: string | undefined; + val?: string | undefined; + }[] & ({ + key?: string | undefined; + val?: string | undefined; + } & { + key?: string | undefined; + val?: string | undefined; + } & { [K_3 in Exclude]: never; })[] & { [K_4 in Exclude]: never; }) | undefined; + } & { [K_5 in Exclude]: never; }) | undefined; + senderEnvelope?: ({ + created?: number | undefined; + } & { + created?: number | undefined; + } & { [K_6 in Exclude]: never; }) | undefined; + serverEnvelope?: ({ + sequence?: number | undefined; + created?: number | undefined; + channel?: string | undefined; + subscriptionId?: string | undefined; + } & { + sequence?: number | undefined; + created?: number | undefined; + channel?: string | undefined; + subscriptionId?: string | undefined; + } & { [K_7 in Exclude]: never; }) | undefined; + data?: Uint8Array | undefined; + } & { [K_8 in Exclude]: never; }) | undefined; + channel?: string | undefined; + idempotentId?: string | undefined; + } & { [K_9 in Exclude]: never; }>(base?: I): SendMessageRequest; + fromPartial]: never; }) | undefined; + message?: ({ + header?: { + sender?: string | undefined; + contentType?: ContentType | undefined; + rpcHeader?: { + correlationId?: string | undefined; + endPoint?: string | undefined; + frameType?: RpcFrameType | undefined; + errorInfo?: { + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } | undefined; + } | undefined; + senderSequence?: number | undefined; + extraHeaders?: { + key?: string | undefined; + val?: string | undefined; + }[] | undefined; + } | undefined; + senderEnvelope?: { + created?: number | undefined; + } | undefined; + serverEnvelope?: { + sequence?: number | undefined; + created?: number | undefined; + channel?: string | undefined; + subscriptionId?: string | undefined; + } | undefined; + data?: Uint8Array | undefined; + } & { + header?: ({ + sender?: string | undefined; + contentType?: ContentType | undefined; + rpcHeader?: { + correlationId?: string | undefined; + endPoint?: string | undefined; + frameType?: RpcFrameType | undefined; + errorInfo?: { + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } | undefined; + } | undefined; + senderSequence?: number | undefined; + extraHeaders?: { + key?: string | undefined; + val?: string | undefined; + }[] | undefined; + } & { + sender?: string | undefined; + contentType?: ContentType | undefined; + rpcHeader?: ({ + correlationId?: string | undefined; + endPoint?: string | undefined; + frameType?: RpcFrameType | undefined; + errorInfo?: { + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } | undefined; + } & { + correlationId?: string | undefined; + endPoint?: string | undefined; + frameType?: RpcFrameType | undefined; + errorInfo?: ({ + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } & { + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } & { [K_11 in Exclude]: never; }) | undefined; + } & { [K_12 in Exclude]: never; }) | undefined; + senderSequence?: number | undefined; + extraHeaders?: ({ + key?: string | undefined; + val?: string | undefined; + }[] & ({ + key?: string | undefined; + val?: string | undefined; + } & { + key?: string | undefined; + val?: string | undefined; + } & { [K_13 in Exclude]: never; })[] & { [K_14 in Exclude]: never; }) | undefined; + } & { [K_15 in Exclude]: never; }) | undefined; + senderEnvelope?: ({ + created?: number | undefined; + } & { + created?: number | undefined; + } & { [K_16 in Exclude]: never; }) | undefined; + serverEnvelope?: ({ + sequence?: number | undefined; + created?: number | undefined; + channel?: string | undefined; + subscriptionId?: string | undefined; + } & { + sequence?: number | undefined; + created?: number | undefined; + channel?: string | undefined; + subscriptionId?: string | undefined; + } & { [K_17 in Exclude]: never; }) | undefined; + data?: Uint8Array | undefined; + } & { [K_18 in Exclude]: never; }) | undefined; + channel?: string | undefined; + idempotentId?: string | undefined; + } & { [K_19 in Exclude]: never; }>(object: I_1): SendMessageRequest; +}; +export declare const SendMessageResponse: { + encode(message: SendMessageResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): SendMessageResponse; + fromJSON(object: any): SendMessageResponse; + toJSON(message: SendMessageResponse): unknown; + create]: never; })[] & { [K_1 in Exclude]: never; }) | undefined; + duplicates?: (string[] & string[] & { [K_2 in Exclude]: never; }) | undefined; + idempotentId?: string | undefined; + correlationId?: string | undefined; + } & { [K_3 in Exclude]: never; }>(base?: I): SendMessageResponse; + fromPartial]: never; })[] & { [K_5 in Exclude]: never; }) | undefined; + duplicates?: (string[] & string[] & { [K_6 in Exclude]: never; }) | undefined; + idempotentId?: string | undefined; + correlationId?: string | undefined; + } & { [K_7 in Exclude]: never; }>(object: I_1): SendMessageResponse; +}; +export declare const SendReceipt: { + encode(message: SendReceipt, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): SendReceipt; + fromJSON(object: any): SendReceipt; + toJSON(message: SendReceipt): unknown; + create]: never; }) | undefined; + message?: ({ + header?: { + sender?: string | undefined; + contentType?: ContentType | undefined; + rpcHeader?: { + correlationId?: string | undefined; + endPoint?: string | undefined; + frameType?: RpcFrameType | undefined; + errorInfo?: { + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } | undefined; + } | undefined; + senderSequence?: number | undefined; + extraHeaders?: { + key?: string | undefined; + val?: string | undefined; + }[] | undefined; + } | undefined; + senderEnvelope?: { + created?: number | undefined; + } | undefined; + serverEnvelope?: { + sequence?: number | undefined; + created?: number | undefined; + channel?: string | undefined; + subscriptionId?: string | undefined; + } | undefined; + data?: Uint8Array | undefined; + } & { + header?: ({ + sender?: string | undefined; + contentType?: ContentType | undefined; + rpcHeader?: { + correlationId?: string | undefined; + endPoint?: string | undefined; + frameType?: RpcFrameType | undefined; + errorInfo?: { + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } | undefined; + } | undefined; + senderSequence?: number | undefined; + extraHeaders?: { + key?: string | undefined; + val?: string | undefined; + }[] | undefined; + } & { + sender?: string | undefined; + contentType?: ContentType | undefined; + rpcHeader?: ({ + correlationId?: string | undefined; + endPoint?: string | undefined; + frameType?: RpcFrameType | undefined; + errorInfo?: { + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } | undefined; + } & { + correlationId?: string | undefined; + endPoint?: string | undefined; + frameType?: RpcFrameType | undefined; + errorInfo?: ({ + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } & { + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } & { [K_1 in Exclude]: never; }) | undefined; + } & { [K_2 in Exclude]: never; }) | undefined; + senderSequence?: number | undefined; + extraHeaders?: ({ + key?: string | undefined; + val?: string | undefined; + }[] & ({ + key?: string | undefined; + val?: string | undefined; + } & { + key?: string | undefined; + val?: string | undefined; + } & { [K_3 in Exclude]: never; })[] & { [K_4 in Exclude]: never; }) | undefined; + } & { [K_5 in Exclude]: never; }) | undefined; + senderEnvelope?: ({ + created?: number | undefined; + } & { + created?: number | undefined; + } & { [K_6 in Exclude]: never; }) | undefined; + serverEnvelope?: ({ + sequence?: number | undefined; + created?: number | undefined; + channel?: string | undefined; + subscriptionId?: string | undefined; + } & { + sequence?: number | undefined; + created?: number | undefined; + channel?: string | undefined; + subscriptionId?: string | undefined; + } & { [K_7 in Exclude]: never; }) | undefined; + data?: Uint8Array | undefined; + } & { [K_8 in Exclude]: never; }) | undefined; + channel?: string | undefined; + idempotentId?: string | undefined; + } & { [K_9 in Exclude]: never; }) | undefined; + response?: ({ + errors?: { + message?: string | undefined; + to?: string | undefined; + }[] | undefined; + duplicates?: string[] | undefined; + idempotentId?: string | undefined; + correlationId?: string | undefined; + } & { + errors?: ({ + message?: string | undefined; + to?: string | undefined; + }[] & ({ + message?: string | undefined; + to?: string | undefined; + } & { + message?: string | undefined; + to?: string | undefined; + } & { [K_10 in Exclude]: never; })[] & { [K_11 in Exclude]: never; }) | undefined; + duplicates?: (string[] & string[] & { [K_12 in Exclude]: never; }) | undefined; + idempotentId?: string | undefined; + correlationId?: string | undefined; + } & { [K_13 in Exclude]: never; }) | undefined; + serverEnvelope?: ({ + sequence?: number | undefined; + created?: number | undefined; + channel?: string | undefined; + subscriptionId?: string | undefined; + } & { + sequence?: number | undefined; + created?: number | undefined; + channel?: string | undefined; + subscriptionId?: string | undefined; + } & { [K_14 in Exclude]: never; }) | undefined; + } & { [K_15 in Exclude]: never; }>(base?: I): SendReceipt; + fromPartial]: never; }) | undefined; + message?: ({ + header?: { + sender?: string | undefined; + contentType?: ContentType | undefined; + rpcHeader?: { + correlationId?: string | undefined; + endPoint?: string | undefined; + frameType?: RpcFrameType | undefined; + errorInfo?: { + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } | undefined; + } | undefined; + senderSequence?: number | undefined; + extraHeaders?: { + key?: string | undefined; + val?: string | undefined; + }[] | undefined; + } | undefined; + senderEnvelope?: { + created?: number | undefined; + } | undefined; + serverEnvelope?: { + sequence?: number | undefined; + created?: number | undefined; + channel?: string | undefined; + subscriptionId?: string | undefined; + } | undefined; + data?: Uint8Array | undefined; + } & { + header?: ({ + sender?: string | undefined; + contentType?: ContentType | undefined; + rpcHeader?: { + correlationId?: string | undefined; + endPoint?: string | undefined; + frameType?: RpcFrameType | undefined; + errorInfo?: { + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } | undefined; + } | undefined; + senderSequence?: number | undefined; + extraHeaders?: { + key?: string | undefined; + val?: string | undefined; + }[] | undefined; + } & { + sender?: string | undefined; + contentType?: ContentType | undefined; + rpcHeader?: ({ + correlationId?: string | undefined; + endPoint?: string | undefined; + frameType?: RpcFrameType | undefined; + errorInfo?: { + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } | undefined; + } & { + correlationId?: string | undefined; + endPoint?: string | undefined; + frameType?: RpcFrameType | undefined; + errorInfo?: ({ + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } & { + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } & { [K_17 in Exclude]: never; }) | undefined; + } & { [K_18 in Exclude]: never; }) | undefined; + senderSequence?: number | undefined; + extraHeaders?: ({ + key?: string | undefined; + val?: string | undefined; + }[] & ({ + key?: string | undefined; + val?: string | undefined; + } & { + key?: string | undefined; + val?: string | undefined; + } & { [K_19 in Exclude]: never; })[] & { [K_20 in Exclude]: never; }) | undefined; + } & { [K_21 in Exclude]: never; }) | undefined; + senderEnvelope?: ({ + created?: number | undefined; + } & { + created?: number | undefined; + } & { [K_22 in Exclude]: never; }) | undefined; + serverEnvelope?: ({ + sequence?: number | undefined; + created?: number | undefined; + channel?: string | undefined; + subscriptionId?: string | undefined; + } & { + sequence?: number | undefined; + created?: number | undefined; + channel?: string | undefined; + subscriptionId?: string | undefined; + } & { [K_23 in Exclude]: never; }) | undefined; + data?: Uint8Array | undefined; + } & { [K_24 in Exclude]: never; }) | undefined; + channel?: string | undefined; + idempotentId?: string | undefined; + } & { [K_25 in Exclude]: never; }) | undefined; + response?: ({ + errors?: { + message?: string | undefined; + to?: string | undefined; + }[] | undefined; + duplicates?: string[] | undefined; + idempotentId?: string | undefined; + correlationId?: string | undefined; + } & { + errors?: ({ + message?: string | undefined; + to?: string | undefined; + }[] & ({ + message?: string | undefined; + to?: string | undefined; + } & { + message?: string | undefined; + to?: string | undefined; + } & { [K_26 in Exclude]: never; })[] & { [K_27 in Exclude]: never; }) | undefined; + duplicates?: (string[] & string[] & { [K_28 in Exclude]: never; }) | undefined; + idempotentId?: string | undefined; + correlationId?: string | undefined; + } & { [K_29 in Exclude]: never; }) | undefined; + serverEnvelope?: ({ + sequence?: number | undefined; + created?: number | undefined; + channel?: string | undefined; + subscriptionId?: string | undefined; + } & { + sequence?: number | undefined; + created?: number | undefined; + channel?: string | undefined; + subscriptionId?: string | undefined; + } & { [K_30 in Exclude]: never; }) | undefined; + } & { [K_31 in Exclude]: never; }>(object: I_1): SendReceipt; +}; +export declare const SendMessageError: { + encode(message: SendMessageError, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): SendMessageError; + fromJSON(object: any): SendMessageError; + toJSON(message: SendMessageError): unknown; + create]: never; }>(base?: I): SendMessageError; + fromPartial]: never; }>(object: I_1): SendMessageError; +}; +export declare const FirstMessage: { + encode(message: FirstMessage, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): FirstMessage; + fromJSON(object: any): FirstMessage; + toJSON(message: FirstMessage): unknown; + create]: never; }) | undefined; + mailboxTimeoutInMs?: number | undefined; + subscriptions?: ({ + mailbox?: { + id?: string | undefined; + state?: string | undefined; + readerKey?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + nefario?: { + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + changeDataCapture?: { + id?: string | undefined; + state?: string | undefined; + matchers?: { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] | undefined; + startSeq?: string | undefined; + } | undefined; + unsubscribe?: { + id?: string | undefined; + } | undefined; + }[] & ({ + mailbox?: { + id?: string | undefined; + state?: string | undefined; + readerKey?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + nefario?: { + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + changeDataCapture?: { + id?: string | undefined; + state?: string | undefined; + matchers?: { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] | undefined; + startSeq?: string | undefined; + } | undefined; + unsubscribe?: { + id?: string | undefined; + } | undefined; + } & { + mailbox?: ({ + id?: string | undefined; + state?: string | undefined; + readerKey?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { + id?: string | undefined; + state?: string | undefined; + readerKey?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { [K_1 in Exclude]: never; }) | undefined; + nefario?: ({ + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { [K_2 in Exclude]: never; }) | undefined; + changeDataCapture?: ({ + id?: string | undefined; + state?: string | undefined; + matchers?: { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] | undefined; + startSeq?: string | undefined; + } & { + id?: string | undefined; + state?: string | undefined; + matchers?: ({ + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] & ({ + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + } & { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: (any[] & any[] & { [K_3 in Exclude]: never; }) | undefined; + } & { [K_4 in Exclude]: never; })[] & { [K_5 in Exclude]: never; }) | undefined; + startSeq?: string | undefined; + } & { [K_6 in Exclude]: never; }) | undefined; + unsubscribe?: ({ + id?: string | undefined; + } & { + id?: string | undefined; + } & { [K_7 in Exclude]: never; }) | undefined; + } & { [K_8 in Exclude]: never; })[] & { [K_9 in Exclude]: never; }) | undefined; + } & { [K_10 in Exclude]: never; }>(base?: I): FirstMessage; + fromPartial]: never; }) | undefined; + mailboxTimeoutInMs?: number | undefined; + subscriptions?: ({ + mailbox?: { + id?: string | undefined; + state?: string | undefined; + readerKey?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + nefario?: { + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + changeDataCapture?: { + id?: string | undefined; + state?: string | undefined; + matchers?: { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] | undefined; + startSeq?: string | undefined; + } | undefined; + unsubscribe?: { + id?: string | undefined; + } | undefined; + }[] & ({ + mailbox?: { + id?: string | undefined; + state?: string | undefined; + readerKey?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + nefario?: { + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + changeDataCapture?: { + id?: string | undefined; + state?: string | undefined; + matchers?: { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] | undefined; + startSeq?: string | undefined; + } | undefined; + unsubscribe?: { + id?: string | undefined; + } | undefined; + } & { + mailbox?: ({ + id?: string | undefined; + state?: string | undefined; + readerKey?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { + id?: string | undefined; + state?: string | undefined; + readerKey?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { [K_12 in Exclude]: never; }) | undefined; + nefario?: ({ + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { [K_13 in Exclude]: never; }) | undefined; + changeDataCapture?: ({ + id?: string | undefined; + state?: string | undefined; + matchers?: { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] | undefined; + startSeq?: string | undefined; + } & { + id?: string | undefined; + state?: string | undefined; + matchers?: ({ + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] & ({ + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + } & { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: (any[] & any[] & { [K_14 in Exclude]: never; }) | undefined; + } & { [K_15 in Exclude]: never; })[] & { [K_16 in Exclude]: never; }) | undefined; + startSeq?: string | undefined; + } & { [K_17 in Exclude]: never; }) | undefined; + unsubscribe?: ({ + id?: string | undefined; + } & { + id?: string | undefined; + } & { [K_18 in Exclude]: never; }) | undefined; + } & { [K_19 in Exclude]: never; })[] & { [K_20 in Exclude]: never; }) | undefined; + } & { [K_21 in Exclude]: never; }>(object: I_1): FirstMessage; +}; +export declare const SenderInfo: { + encode(message: SenderInfo, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): SenderInfo; + fromJSON(object: any): SenderInfo; + toJSON(message: SenderInfo): unknown; + create]: never; }>(base?: I): SenderInfo; + fromPartial]: never; }>(object: I_1): SenderInfo; +}; +export declare const SubscribeRequest: { + encode(message: SubscribeRequest, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): SubscribeRequest; + fromJSON(object: any): SubscribeRequest; + toJSON(message: SubscribeRequest): unknown; + create]: never; }) | undefined; + nefario?: ({ + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { [K_1 in Exclude]: never; }) | undefined; + changeDataCapture?: ({ + id?: string | undefined; + state?: string | undefined; + matchers?: { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] | undefined; + startSeq?: string | undefined; + } & { + id?: string | undefined; + state?: string | undefined; + matchers?: ({ + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] & ({ + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + } & { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: (any[] & any[] & { [K_2 in Exclude]: never; }) | undefined; + } & { [K_3 in Exclude]: never; })[] & { [K_4 in Exclude]: never; }) | undefined; + startSeq?: string | undefined; + } & { [K_5 in Exclude]: never; }) | undefined; + unsubscribe?: ({ + id?: string | undefined; + } & { + id?: string | undefined; + } & { [K_6 in Exclude]: never; }) | undefined; + } & { [K_7 in Exclude]: never; })[] & { [K_8 in Exclude]: never; }) | undefined; + } & { [K_9 in Exclude]: never; }>(base?: I): SubscribeRequest; + fromPartial]: never; }) | undefined; + nefario?: ({ + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { [K_11 in Exclude]: never; }) | undefined; + changeDataCapture?: ({ + id?: string | undefined; + state?: string | undefined; + matchers?: { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] | undefined; + startSeq?: string | undefined; + } & { + id?: string | undefined; + state?: string | undefined; + matchers?: ({ + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] & ({ + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + } & { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: (any[] & any[] & { [K_12 in Exclude]: never; }) | undefined; + } & { [K_13 in Exclude]: never; })[] & { [K_14 in Exclude]: never; }) | undefined; + startSeq?: string | undefined; + } & { [K_15 in Exclude]: never; }) | undefined; + unsubscribe?: ({ + id?: string | undefined; + } & { + id?: string | undefined; + } & { [K_16 in Exclude]: never; }) | undefined; + } & { [K_17 in Exclude]: never; })[] & { [K_18 in Exclude]: never; }) | undefined; + } & { [K_19 in Exclude]: never; }>(object: I_1): SubscribeRequest; +}; +export declare const SubscribeResponse: { + encode(message: SubscribeResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): SubscribeResponse; + fromJSON(object: any): SubscribeResponse; + toJSON(message: SubscribeResponse): unknown; + create]: never; }) | undefined; + errors?: ({ + state?: string | undefined; + message?: string | undefined; + }[] & ({ + state?: string | undefined; + message?: string | undefined; + } & { + state?: string | undefined; + message?: string | undefined; + } & { [K_1 in Exclude]: never; })[] & { [K_2 in Exclude]: never; }) | undefined; + } & { [K_3 in Exclude]: never; }>(base?: I): SubscribeResponse; + fromPartial]: never; }) | undefined; + errors?: ({ + state?: string | undefined; + message?: string | undefined; + }[] & ({ + state?: string | undefined; + message?: string | undefined; + } & { + state?: string | undefined; + message?: string | undefined; + } & { [K_5 in Exclude]: never; })[] & { [K_6 in Exclude]: never; }) | undefined; + } & { [K_7 in Exclude]: never; }>(object: I_1): SubscribeResponse; +}; +export declare const SubscribeError: { + encode(message: SubscribeError, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): SubscribeError; + fromJSON(object: any): SubscribeError; + toJSON(message: SubscribeError): unknown; + create]: never; }>(base?: I): SubscribeError; + fromPartial]: never; }>(object: I_1): SubscribeError; +}; +export declare const Subscription: { + encode(message: Subscription, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): Subscription; + fromJSON(object: any): Subscription; + toJSON(message: Subscription): unknown; + create]: never; }) | undefined; + nefario?: ({ + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { [K_1 in Exclude]: never; }) | undefined; + changeDataCapture?: ({ + id?: string | undefined; + state?: string | undefined; + matchers?: { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] | undefined; + startSeq?: string | undefined; + } & { + id?: string | undefined; + state?: string | undefined; + matchers?: ({ + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] & ({ + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + } & { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: (any[] & any[] & { [K_2 in Exclude]: never; }) | undefined; + } & { [K_3 in Exclude]: never; })[] & { [K_4 in Exclude]: never; }) | undefined; + startSeq?: string | undefined; + } & { [K_5 in Exclude]: never; }) | undefined; + unsubscribe?: ({ + id?: string | undefined; + } & { + id?: string | undefined; + } & { [K_6 in Exclude]: never; }) | undefined; + } & { [K_7 in Exclude]: never; }>(base?: I): Subscription; + fromPartial]: never; }) | undefined; + nefario?: ({ + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { [K_9 in Exclude]: never; }) | undefined; + changeDataCapture?: ({ + id?: string | undefined; + state?: string | undefined; + matchers?: { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] | undefined; + startSeq?: string | undefined; + } & { + id?: string | undefined; + state?: string | undefined; + matchers?: ({ + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] & ({ + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + } & { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: (any[] & any[] & { [K_10 in Exclude]: never; }) | undefined; + } & { [K_11 in Exclude]: never; })[] & { [K_12 in Exclude]: never; }) | undefined; + startSeq?: string | undefined; + } & { [K_13 in Exclude]: never; }) | undefined; + unsubscribe?: ({ + id?: string | undefined; + } & { + id?: string | undefined; + } & { [K_14 in Exclude]: never; }) | undefined; + } & { [K_15 in Exclude]: never; }>(object: I_1): Subscription; +}; +export declare const MailboxSubscription: { + encode(message: MailboxSubscription, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): MailboxSubscription; + fromJSON(object: any): MailboxSubscription; + toJSON(message: MailboxSubscription): unknown; + create]: never; }>(base?: I): MailboxSubscription; + fromPartial]: never; }>(object: I_1): MailboxSubscription; +}; +export declare const ChangeDataCaptureSubscription: { + encode(message: ChangeDataCaptureSubscription, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): ChangeDataCaptureSubscription; + fromJSON(object: any): ChangeDataCaptureSubscription; + toJSON(message: ChangeDataCaptureSubscription): unknown; + create]: never; }) | undefined; + } & { [K_1 in Exclude]: never; })[] & { [K_2 in Exclude]: never; }) | undefined; + startSeq?: string | undefined; + } & { [K_3 in Exclude]: never; }>(base?: I): ChangeDataCaptureSubscription; + fromPartial]: never; }) | undefined; + } & { [K_5 in Exclude]: never; })[] & { [K_6 in Exclude]: never; }) | undefined; + startSeq?: string | undefined; + } & { [K_7 in Exclude]: never; }>(object: I_1): ChangeDataCaptureSubscription; +}; +export declare const RecordMatcher: { + encode(message: RecordMatcher, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): RecordMatcher; + fromJSON(object: any): RecordMatcher; + toJSON(message: RecordMatcher): unknown; + create]: never; }) | undefined; + } & { [K_1 in Exclude]: never; }>(base?: I): RecordMatcher; + fromPartial]: never; }) | undefined; + } & { [K_3 in Exclude]: never; }>(object: I_1): RecordMatcher; +}; +export declare const NefarioSubscription: { + encode(message: NefarioSubscription, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): NefarioSubscription; + fromJSON(object: any): NefarioSubscription; + toJSON(message: NefarioSubscription): unknown; + create]: never; }>(base?: I): NefarioSubscription; + fromPartial]: never; }>(object: I_1): NefarioSubscription; +}; +export declare const Unsubscribe: { + encode(message: Unsubscribe, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): Unsubscribe; + fromJSON(object: any): Unsubscribe; + toJSON(message: Unsubscribe): unknown; + create]: never; }>(base?: I): Unsubscribe; + fromPartial]: never; }>(object: I_1): Unsubscribe; +}; +export declare const CreateMailboxRequest: { + encode(message: CreateMailboxRequest, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): CreateMailboxRequest; + fromJSON(object: any): CreateMailboxRequest; + toJSON(message: CreateMailboxRequest): unknown; + create]: never; }) | undefined; + privateMetadata?: ({ + [x: string]: any; + } & { + [x: string]: any; + } & { [K_1 in Exclude]: never; }) | undefined; + publicMetadata?: ({ + [x: string]: any; + } & { + [x: string]: any; + } & { [K_2 in Exclude]: never; }) | undefined; + purgeTimeoutInMillis?: number | undefined; + closeTimeoutInMillis?: number | undefined; + extraData?: ({ + [x: string]: any; + } & { + [x: string]: any; + } & { [K_3 in Exclude]: never; }) | undefined; + } & { [K_4 in Exclude]: never; }>(base?: I): CreateMailboxRequest; + fromPartial]: never; }) | undefined; + privateMetadata?: ({ + [x: string]: any; + } & { + [x: string]: any; + } & { [K_6 in Exclude]: never; }) | undefined; + publicMetadata?: ({ + [x: string]: any; + } & { + [x: string]: any; + } & { [K_7 in Exclude]: never; }) | undefined; + purgeTimeoutInMillis?: number | undefined; + closeTimeoutInMillis?: number | undefined; + extraData?: ({ + [x: string]: any; + } & { + [x: string]: any; + } & { [K_8 in Exclude]: never; }) | undefined; + } & { [K_9 in Exclude]: never; }>(object: I_1): CreateMailboxRequest; +}; +export declare const CreateMailboxResponse: { + encode(message: CreateMailboxResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): CreateMailboxResponse; + fromJSON(object: any): CreateMailboxResponse; + toJSON(message: CreateMailboxResponse): unknown; + create]: never; }) | undefined; + } & { [K_1 in Exclude]: never; }>(base?: I): CreateMailboxResponse; + fromPartial]: never; }) | undefined; + } & { [K_3 in Exclude]: never; }>(object: I_1): CreateMailboxResponse; +}; +export declare const AddChannelRequest: { + encode(message: AddChannelRequest, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): AddChannelRequest; + fromJSON(object: any): AddChannelRequest; + toJSON(message: AddChannelRequest): unknown; + create]: never; }) | undefined; + } & { [K_1 in Exclude]: never; }>(base?: I): AddChannelRequest; + fromPartial]: never; }) | undefined; + } & { [K_3 in Exclude]: never; }>(object: I_1): AddChannelRequest; +}; +export declare const AddChannelResponse: { + encode(_: AddChannelResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): AddChannelResponse; + fromJSON(_: any): AddChannelResponse; + toJSON(_: AddChannelResponse): unknown; + create]: never; }>(base?: I): AddChannelResponse; + fromPartial]: never; }>(_: I_1): AddChannelResponse; +}; +export interface HermesService { + SendReceive(request: Observable): Observable; + CreateMailbox(request: CreateMailboxRequest): Promise; + AddChannel(request: AddChannelRequest): Promise; +} +export declare const HermesServiceServiceName = "hermes.HermesService"; +export declare class HermesServiceClientImpl implements HermesService { + private readonly rpc; + private readonly service; + constructor(rpc: Rpc, opts?: { + service?: string; + }); + SendReceive(request: Observable): Observable; + CreateMailbox(request: CreateMailboxRequest): Promise; + AddChannel(request: AddChannelRequest): Promise; +} +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; + clientStreamingRequest(service: string, method: string, data: Observable): Promise; + serverStreamingRequest(service: string, method: string, data: Uint8Array): Observable; + bidirectionalStreamingRequest(service: string, method: string, data: Observable): Observable; +} +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin ? P : P & { + [K in keyof P]: Exact; +} & { + [K in Exclude>]: never; +}; +export {}; diff --git a/lib/cjs/hermesclient/proto/wsmessages.js b/lib/cjs/hermesclient/proto/wsmessages.js new file mode 100644 index 0000000..da64079 --- /dev/null +++ b/lib/cjs/hermesclient/proto/wsmessages.js @@ -0,0 +1,2913 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.HermesServiceClientImpl = exports.HermesServiceServiceName = exports.AddChannelResponse = exports.AddChannelRequest = exports.CreateMailboxResponse = exports.CreateMailboxRequest = exports.Unsubscribe = exports.NefarioSubscription = exports.RecordMatcher = exports.ChangeDataCaptureSubscription = exports.MailboxSubscription = exports.Subscription = exports.SubscribeError = exports.SubscribeResponse = exports.SubscribeRequest = exports.SenderInfo = exports.FirstMessage = exports.SendMessageError = exports.SendReceipt = exports.SendMessageResponse = exports.SendMessageRequest = exports.MessageEnvelope = exports.Message = exports.RpcErrorInfo = exports.RpcHeader = exports.KeyValPair = exports.ServerEnvelope = exports.SenderEnvelope = exports.MessageHeader = exports.Pong = exports.Ping = exports.MessageToClient = exports.Notification = exports.MessageFromClient = exports.contentTypeToJSON = exports.contentTypeFromJSON = exports.ContentType = exports.rpcFrameTypeToJSON = exports.rpcFrameTypeFromJSON = exports.RpcFrameType = exports.protobufPackage = void 0; +const _m0 = __importStar(require("../../../node_modules/protobufjs/minimal")); +const struct_1 = require("../google/protobuf/struct"); +const index_1 = __importDefault(require("../../../node_modules/long/index")); +const index_2 = require("../../../node_modules/rxjs/dist/types/index"); +exports.protobufPackage = "hermes"; +var RpcFrameType; +(function (RpcFrameType) { + RpcFrameType[RpcFrameType["UnspecifiedRFT"] = 0] = "UnspecifiedRFT"; + RpcFrameType[RpcFrameType["Request"] = 1] = "Request"; + RpcFrameType[RpcFrameType["SuccessResponse"] = 2] = "SuccessResponse"; + RpcFrameType[RpcFrameType["ErrorResponse"] = 3] = "ErrorResponse"; + RpcFrameType[RpcFrameType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED"; +})(RpcFrameType || (exports.RpcFrameType = RpcFrameType = {})); +function rpcFrameTypeFromJSON(object) { + switch (object) { + case 0: + case "UnspecifiedRFT": + return RpcFrameType.UnspecifiedRFT; + case 1: + case "Request": + return RpcFrameType.Request; + case 2: + case "SuccessResponse": + return RpcFrameType.SuccessResponse; + case 3: + case "ErrorResponse": + return RpcFrameType.ErrorResponse; + case -1: + case "UNRECOGNIZED": + default: + return RpcFrameType.UNRECOGNIZED; + } +} +exports.rpcFrameTypeFromJSON = rpcFrameTypeFromJSON; +function rpcFrameTypeToJSON(object) { + switch (object) { + case RpcFrameType.UnspecifiedRFT: + return "UnspecifiedRFT"; + case RpcFrameType.Request: + return "Request"; + case RpcFrameType.SuccessResponse: + return "SuccessResponse"; + case RpcFrameType.ErrorResponse: + return "ErrorResponse"; + case RpcFrameType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +exports.rpcFrameTypeToJSON = rpcFrameTypeToJSON; +var ContentType; +(function (ContentType) { + ContentType[ContentType["UnspecifiedCT"] = 0] = "UnspecifiedCT"; + ContentType[ContentType["Protobuf"] = 1] = "Protobuf"; + ContentType[ContentType["Json"] = 2] = "Json"; + ContentType[ContentType["Binary"] = 3] = "Binary"; + ContentType[ContentType["Text"] = 4] = "Text"; + ContentType[ContentType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED"; +})(ContentType || (exports.ContentType = ContentType = {})); +function contentTypeFromJSON(object) { + switch (object) { + case 0: + case "UnspecifiedCT": + return ContentType.UnspecifiedCT; + case 1: + case "Protobuf": + return ContentType.Protobuf; + case 2: + case "Json": + return ContentType.Json; + case 3: + case "Binary": + return ContentType.Binary; + case 4: + case "Text": + return ContentType.Text; + case -1: + case "UNRECOGNIZED": + default: + return ContentType.UNRECOGNIZED; + } +} +exports.contentTypeFromJSON = contentTypeFromJSON; +function contentTypeToJSON(object) { + switch (object) { + case ContentType.UnspecifiedCT: + return "UnspecifiedCT"; + case ContentType.Protobuf: + return "Protobuf"; + case ContentType.Json: + return "Json"; + case ContentType.Binary: + return "Binary"; + case ContentType.Text: + return "Text"; + case ContentType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +exports.contentTypeToJSON = contentTypeToJSON; +function createBaseMessageFromClient() { + return { + sendMessageRequest: undefined, + firstMessage: undefined, + ping: undefined, + pong: undefined, + notification: undefined, + subscribeRequest: undefined, + }; +} +exports.MessageFromClient = { + encode(message, writer = _m0.Writer.create()) { + if (message.sendMessageRequest !== undefined) { + exports.SendMessageRequest.encode(message.sendMessageRequest, writer.uint32(10).fork()).ldelim(); + } + if (message.firstMessage !== undefined) { + exports.FirstMessage.encode(message.firstMessage, writer.uint32(18).fork()).ldelim(); + } + if (message.ping !== undefined) { + exports.Ping.encode(message.ping, writer.uint32(26).fork()).ldelim(); + } + if (message.pong !== undefined) { + exports.Pong.encode(message.pong, writer.uint32(34).fork()).ldelim(); + } + if (message.notification !== undefined) { + exports.Notification.encode(message.notification, writer.uint32(42).fork()).ldelim(); + } + if (message.subscribeRequest !== undefined) { + exports.SubscribeRequest.encode(message.subscribeRequest, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMessageFromClient(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + message.sendMessageRequest = exports.SendMessageRequest.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + message.firstMessage = exports.FirstMessage.decode(reader, reader.uint32()); + continue; + case 3: + if (tag !== 26) { + break; + } + message.ping = exports.Ping.decode(reader, reader.uint32()); + continue; + case 4: + if (tag !== 34) { + break; + } + message.pong = exports.Pong.decode(reader, reader.uint32()); + continue; + case 5: + if (tag !== 42) { + break; + } + message.notification = exports.Notification.decode(reader, reader.uint32()); + continue; + case 6: + if (tag !== 50) { + break; + } + message.subscribeRequest = exports.SubscribeRequest.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + sendMessageRequest: isSet(object.sendMessageRequest) + ? exports.SendMessageRequest.fromJSON(object.sendMessageRequest) + : undefined, + firstMessage: isSet(object.firstMessage) ? exports.FirstMessage.fromJSON(object.firstMessage) : undefined, + ping: isSet(object.ping) ? exports.Ping.fromJSON(object.ping) : undefined, + pong: isSet(object.pong) ? exports.Pong.fromJSON(object.pong) : undefined, + notification: isSet(object.notification) ? exports.Notification.fromJSON(object.notification) : undefined, + subscribeRequest: isSet(object.subscribeRequest) ? exports.SubscribeRequest.fromJSON(object.subscribeRequest) : undefined, + }; + }, + toJSON(message) { + const obj = {}; + if (message.sendMessageRequest !== undefined) { + obj.sendMessageRequest = exports.SendMessageRequest.toJSON(message.sendMessageRequest); + } + if (message.firstMessage !== undefined) { + obj.firstMessage = exports.FirstMessage.toJSON(message.firstMessage); + } + if (message.ping !== undefined) { + obj.ping = exports.Ping.toJSON(message.ping); + } + if (message.pong !== undefined) { + obj.pong = exports.Pong.toJSON(message.pong); + } + if (message.notification !== undefined) { + obj.notification = exports.Notification.toJSON(message.notification); + } + if (message.subscribeRequest !== undefined) { + obj.subscribeRequest = exports.SubscribeRequest.toJSON(message.subscribeRequest); + } + return obj; + }, + create(base) { + return exports.MessageFromClient.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + const message = createBaseMessageFromClient(); + message.sendMessageRequest = (object.sendMessageRequest !== undefined && object.sendMessageRequest !== null) + ? exports.SendMessageRequest.fromPartial(object.sendMessageRequest) + : undefined; + message.firstMessage = (object.firstMessage !== undefined && object.firstMessage !== null) + ? exports.FirstMessage.fromPartial(object.firstMessage) + : undefined; + message.ping = (object.ping !== undefined && object.ping !== null) ? exports.Ping.fromPartial(object.ping) : undefined; + message.pong = (object.pong !== undefined && object.pong !== null) ? exports.Pong.fromPartial(object.pong) : undefined; + message.notification = (object.notification !== undefined && object.notification !== null) + ? exports.Notification.fromPartial(object.notification) + : undefined; + message.subscribeRequest = (object.subscribeRequest !== undefined && object.subscribeRequest !== null) + ? exports.SubscribeRequest.fromPartial(object.subscribeRequest) + : undefined; + return message; + }, +}; +function createBaseNotification() { + return { message: "" }; +} +exports.Notification = { + encode(message, writer = _m0.Writer.create()) { + if (message.message !== undefined && message.message !== "") { + writer.uint32(10).string(message.message); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseNotification(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + message.message = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { message: isSet(object.message) ? globalThis.String(object.message) : "" }; + }, + toJSON(message) { + const obj = {}; + if (message.message !== undefined && message.message !== "") { + obj.message = message.message; + } + return obj; + }, + create(base) { + return exports.Notification.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a; + const message = createBaseNotification(); + message.message = (_a = object.message) !== null && _a !== void 0 ? _a : ""; + return message; + }, +}; +function createBaseMessageToClient() { + return { + messageEnvelope: undefined, + sendMessageResponse: undefined, + ping: undefined, + pong: undefined, + notification: undefined, + subscribeResponse: undefined, + }; +} +exports.MessageToClient = { + encode(message, writer = _m0.Writer.create()) { + if (message.messageEnvelope !== undefined) { + exports.MessageEnvelope.encode(message.messageEnvelope, writer.uint32(10).fork()).ldelim(); + } + if (message.sendMessageResponse !== undefined) { + exports.SendMessageResponse.encode(message.sendMessageResponse, writer.uint32(18).fork()).ldelim(); + } + if (message.ping !== undefined) { + exports.Ping.encode(message.ping, writer.uint32(26).fork()).ldelim(); + } + if (message.pong !== undefined) { + exports.Pong.encode(message.pong, writer.uint32(34).fork()).ldelim(); + } + if (message.notification !== undefined) { + exports.Notification.encode(message.notification, writer.uint32(42).fork()).ldelim(); + } + if (message.subscribeResponse !== undefined) { + exports.SubscribeResponse.encode(message.subscribeResponse, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMessageToClient(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + message.messageEnvelope = exports.MessageEnvelope.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + message.sendMessageResponse = exports.SendMessageResponse.decode(reader, reader.uint32()); + continue; + case 3: + if (tag !== 26) { + break; + } + message.ping = exports.Ping.decode(reader, reader.uint32()); + continue; + case 4: + if (tag !== 34) { + break; + } + message.pong = exports.Pong.decode(reader, reader.uint32()); + continue; + case 5: + if (tag !== 42) { + break; + } + message.notification = exports.Notification.decode(reader, reader.uint32()); + continue; + case 6: + if (tag !== 50) { + break; + } + message.subscribeResponse = exports.SubscribeResponse.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + messageEnvelope: isSet(object.messageEnvelope) ? exports.MessageEnvelope.fromJSON(object.messageEnvelope) : undefined, + sendMessageResponse: isSet(object.sendMessageResponse) + ? exports.SendMessageResponse.fromJSON(object.sendMessageResponse) + : undefined, + ping: isSet(object.ping) ? exports.Ping.fromJSON(object.ping) : undefined, + pong: isSet(object.pong) ? exports.Pong.fromJSON(object.pong) : undefined, + notification: isSet(object.notification) ? exports.Notification.fromJSON(object.notification) : undefined, + subscribeResponse: isSet(object.subscribeResponse) + ? exports.SubscribeResponse.fromJSON(object.subscribeResponse) + : undefined, + }; + }, + toJSON(message) { + const obj = {}; + if (message.messageEnvelope !== undefined) { + obj.messageEnvelope = exports.MessageEnvelope.toJSON(message.messageEnvelope); + } + if (message.sendMessageResponse !== undefined) { + obj.sendMessageResponse = exports.SendMessageResponse.toJSON(message.sendMessageResponse); + } + if (message.ping !== undefined) { + obj.ping = exports.Ping.toJSON(message.ping); + } + if (message.pong !== undefined) { + obj.pong = exports.Pong.toJSON(message.pong); + } + if (message.notification !== undefined) { + obj.notification = exports.Notification.toJSON(message.notification); + } + if (message.subscribeResponse !== undefined) { + obj.subscribeResponse = exports.SubscribeResponse.toJSON(message.subscribeResponse); + } + return obj; + }, + create(base) { + return exports.MessageToClient.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + const message = createBaseMessageToClient(); + message.messageEnvelope = (object.messageEnvelope !== undefined && object.messageEnvelope !== null) + ? exports.MessageEnvelope.fromPartial(object.messageEnvelope) + : undefined; + message.sendMessageResponse = (object.sendMessageResponse !== undefined && object.sendMessageResponse !== null) + ? exports.SendMessageResponse.fromPartial(object.sendMessageResponse) + : undefined; + message.ping = (object.ping !== undefined && object.ping !== null) ? exports.Ping.fromPartial(object.ping) : undefined; + message.pong = (object.pong !== undefined && object.pong !== null) ? exports.Pong.fromPartial(object.pong) : undefined; + message.notification = (object.notification !== undefined && object.notification !== null) + ? exports.Notification.fromPartial(object.notification) + : undefined; + message.subscribeResponse = (object.subscribeResponse !== undefined && object.subscribeResponse !== null) + ? exports.SubscribeResponse.fromPartial(object.subscribeResponse) + : undefined; + return message; + }, +}; +function createBasePing() { + return { payload: new Uint8Array(0) }; +} +exports.Ping = { + encode(message, writer = _m0.Writer.create()) { + if (message.payload !== undefined && message.payload.length !== 0) { + writer.uint32(10).bytes(message.payload); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePing(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + message.payload = reader.bytes(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { payload: isSet(object.payload) ? bytesFromBase64(object.payload) : new Uint8Array(0) }; + }, + toJSON(message) { + const obj = {}; + if (message.payload !== undefined && message.payload.length !== 0) { + obj.payload = base64FromBytes(message.payload); + } + return obj; + }, + create(base) { + return exports.Ping.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a; + const message = createBasePing(); + message.payload = (_a = object.payload) !== null && _a !== void 0 ? _a : new Uint8Array(0); + return message; + }, +}; +function createBasePong() { + return { payload: new Uint8Array(0) }; +} +exports.Pong = { + encode(message, writer = _m0.Writer.create()) { + if (message.payload !== undefined && message.payload.length !== 0) { + writer.uint32(10).bytes(message.payload); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePong(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + message.payload = reader.bytes(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { payload: isSet(object.payload) ? bytesFromBase64(object.payload) : new Uint8Array(0) }; + }, + toJSON(message) { + const obj = {}; + if (message.payload !== undefined && message.payload.length !== 0) { + obj.payload = base64FromBytes(message.payload); + } + return obj; + }, + create(base) { + return exports.Pong.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a; + const message = createBasePong(); + message.payload = (_a = object.payload) !== null && _a !== void 0 ? _a : new Uint8Array(0); + return message; + }, +}; +function createBaseMessageHeader() { + return { sender: "", contentType: 0, rpcHeader: undefined, senderSequence: 0, extraHeaders: [] }; +} +exports.MessageHeader = { + encode(message, writer = _m0.Writer.create()) { + if (message.sender !== undefined && message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.contentType !== undefined && message.contentType !== 0) { + writer.uint32(16).int32(message.contentType); + } + if (message.rpcHeader !== undefined) { + exports.RpcHeader.encode(message.rpcHeader, writer.uint32(26).fork()).ldelim(); + } + if (message.senderSequence !== undefined && message.senderSequence !== 0) { + writer.uint32(32).int64(message.senderSequence); + } + if (message.extraHeaders !== undefined && message.extraHeaders.length !== 0) { + for (const v of message.extraHeaders) { + exports.KeyValPair.encode(v, writer.uint32(1602).fork()).ldelim(); + } + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMessageHeader(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + message.sender = reader.string(); + continue; + case 2: + if (tag !== 16) { + break; + } + message.contentType = reader.int32(); + continue; + case 3: + if (tag !== 26) { + break; + } + message.rpcHeader = exports.RpcHeader.decode(reader, reader.uint32()); + continue; + case 4: + if (tag !== 32) { + break; + } + message.senderSequence = longToNumber(reader.int64()); + continue; + case 200: + if (tag !== 1602) { + break; + } + message.extraHeaders.push(exports.KeyValPair.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + sender: isSet(object.sender) ? globalThis.String(object.sender) : "", + contentType: isSet(object.contentType) ? contentTypeFromJSON(object.contentType) : 0, + rpcHeader: isSet(object.rpcHeader) ? exports.RpcHeader.fromJSON(object.rpcHeader) : undefined, + senderSequence: isSet(object.senderSequence) ? globalThis.Number(object.senderSequence) : 0, + extraHeaders: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.extraHeaders) + ? object.extraHeaders.map((e) => exports.KeyValPair.fromJSON(e)) + : [], + }; + }, + toJSON(message) { + var _a; + const obj = {}; + if (message.sender !== undefined && message.sender !== "") { + obj.sender = message.sender; + } + if (message.contentType !== undefined && message.contentType !== 0) { + obj.contentType = contentTypeToJSON(message.contentType); + } + if (message.rpcHeader !== undefined) { + obj.rpcHeader = exports.RpcHeader.toJSON(message.rpcHeader); + } + if (message.senderSequence !== undefined && message.senderSequence !== 0) { + obj.senderSequence = Math.round(message.senderSequence); + } + if ((_a = message.extraHeaders) === null || _a === void 0 ? void 0 : _a.length) { + obj.extraHeaders = message.extraHeaders.map((e) => exports.KeyValPair.toJSON(e)); + } + return obj; + }, + create(base) { + return exports.MessageHeader.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a, _b, _c, _d; + const message = createBaseMessageHeader(); + message.sender = (_a = object.sender) !== null && _a !== void 0 ? _a : ""; + message.contentType = (_b = object.contentType) !== null && _b !== void 0 ? _b : 0; + message.rpcHeader = (object.rpcHeader !== undefined && object.rpcHeader !== null) + ? exports.RpcHeader.fromPartial(object.rpcHeader) + : undefined; + message.senderSequence = (_c = object.senderSequence) !== null && _c !== void 0 ? _c : 0; + message.extraHeaders = ((_d = object.extraHeaders) === null || _d === void 0 ? void 0 : _d.map((e) => exports.KeyValPair.fromPartial(e))) || []; + return message; + }, +}; +function createBaseSenderEnvelope() { + return { created: 0 }; +} +exports.SenderEnvelope = { + encode(message, writer = _m0.Writer.create()) { + if (message.created !== undefined && message.created !== 0) { + writer.uint32(8).int64(message.created); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSenderEnvelope(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + message.created = longToNumber(reader.int64()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { created: isSet(object.created) ? globalThis.Number(object.created) : 0 }; + }, + toJSON(message) { + const obj = {}; + if (message.created !== undefined && message.created !== 0) { + obj.created = Math.round(message.created); + } + return obj; + }, + create(base) { + return exports.SenderEnvelope.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a; + const message = createBaseSenderEnvelope(); + message.created = (_a = object.created) !== null && _a !== void 0 ? _a : 0; + return message; + }, +}; +function createBaseServerEnvelope() { + return { sequence: 0, created: 0, channel: "", subscriptionId: "" }; +} +exports.ServerEnvelope = { + encode(message, writer = _m0.Writer.create()) { + if (message.sequence !== undefined && message.sequence !== 0) { + writer.uint32(8).uint64(message.sequence); + } + if (message.created !== undefined && message.created !== 0) { + writer.uint32(16).int64(message.created); + } + if (message.channel !== undefined && message.channel !== "") { + writer.uint32(26).string(message.channel); + } + if (message.subscriptionId !== undefined && message.subscriptionId !== "") { + writer.uint32(34).string(message.subscriptionId); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseServerEnvelope(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + message.sequence = longToNumber(reader.uint64()); + continue; + case 2: + if (tag !== 16) { + break; + } + message.created = longToNumber(reader.int64()); + continue; + case 3: + if (tag !== 26) { + break; + } + message.channel = reader.string(); + continue; + case 4: + if (tag !== 34) { + break; + } + message.subscriptionId = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + sequence: isSet(object.sequence) ? globalThis.Number(object.sequence) : 0, + created: isSet(object.created) ? globalThis.Number(object.created) : 0, + channel: isSet(object.channel) ? globalThis.String(object.channel) : "", + subscriptionId: isSet(object.subscriptionId) ? globalThis.String(object.subscriptionId) : "", + }; + }, + toJSON(message) { + const obj = {}; + if (message.sequence !== undefined && message.sequence !== 0) { + obj.sequence = Math.round(message.sequence); + } + if (message.created !== undefined && message.created !== 0) { + obj.created = Math.round(message.created); + } + if (message.channel !== undefined && message.channel !== "") { + obj.channel = message.channel; + } + if (message.subscriptionId !== undefined && message.subscriptionId !== "") { + obj.subscriptionId = message.subscriptionId; + } + return obj; + }, + create(base) { + return exports.ServerEnvelope.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a, _b, _c, _d; + const message = createBaseServerEnvelope(); + message.sequence = (_a = object.sequence) !== null && _a !== void 0 ? _a : 0; + message.created = (_b = object.created) !== null && _b !== void 0 ? _b : 0; + message.channel = (_c = object.channel) !== null && _c !== void 0 ? _c : ""; + message.subscriptionId = (_d = object.subscriptionId) !== null && _d !== void 0 ? _d : ""; + return message; + }, +}; +function createBaseKeyValPair() { + return { key: "", val: "" }; +} +exports.KeyValPair = { + encode(message, writer = _m0.Writer.create()) { + if (message.key !== undefined && message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.val !== undefined && message.val !== "") { + writer.uint32(18).string(message.val); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseKeyValPair(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + message.key = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + message.val = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + val: isSet(object.val) ? globalThis.String(object.val) : "", + }; + }, + toJSON(message) { + const obj = {}; + if (message.key !== undefined && message.key !== "") { + obj.key = message.key; + } + if (message.val !== undefined && message.val !== "") { + obj.val = message.val; + } + return obj; + }, + create(base) { + return exports.KeyValPair.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a, _b; + const message = createBaseKeyValPair(); + message.key = (_a = object.key) !== null && _a !== void 0 ? _a : ""; + message.val = (_b = object.val) !== null && _b !== void 0 ? _b : ""; + return message; + }, +}; +function createBaseRpcHeader() { + return { correlationId: "", endPoint: "", frameType: 0, errorInfo: undefined }; +} +exports.RpcHeader = { + encode(message, writer = _m0.Writer.create()) { + if (message.correlationId !== undefined && message.correlationId !== "") { + writer.uint32(18).string(message.correlationId); + } + if (message.endPoint !== undefined && message.endPoint !== "") { + writer.uint32(26).string(message.endPoint); + } + if (message.frameType !== undefined && message.frameType !== 0) { + writer.uint32(32).int32(message.frameType); + } + if (message.errorInfo !== undefined) { + exports.RpcErrorInfo.encode(message.errorInfo, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRpcHeader(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + if (tag !== 18) { + break; + } + message.correlationId = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + message.endPoint = reader.string(); + continue; + case 4: + if (tag !== 32) { + break; + } + message.frameType = reader.int32(); + continue; + case 5: + if (tag !== 42) { + break; + } + message.errorInfo = exports.RpcErrorInfo.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + correlationId: isSet(object.correlationId) ? globalThis.String(object.correlationId) : "", + endPoint: isSet(object.endPoint) ? globalThis.String(object.endPoint) : "", + frameType: isSet(object.frameType) ? rpcFrameTypeFromJSON(object.frameType) : 0, + errorInfo: isSet(object.errorInfo) ? exports.RpcErrorInfo.fromJSON(object.errorInfo) : undefined, + }; + }, + toJSON(message) { + const obj = {}; + if (message.correlationId !== undefined && message.correlationId !== "") { + obj.correlationId = message.correlationId; + } + if (message.endPoint !== undefined && message.endPoint !== "") { + obj.endPoint = message.endPoint; + } + if (message.frameType !== undefined && message.frameType !== 0) { + obj.frameType = rpcFrameTypeToJSON(message.frameType); + } + if (message.errorInfo !== undefined) { + obj.errorInfo = exports.RpcErrorInfo.toJSON(message.errorInfo); + } + return obj; + }, + create(base) { + return exports.RpcHeader.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a, _b, _c; + const message = createBaseRpcHeader(); + message.correlationId = (_a = object.correlationId) !== null && _a !== void 0 ? _a : ""; + message.endPoint = (_b = object.endPoint) !== null && _b !== void 0 ? _b : ""; + message.frameType = (_c = object.frameType) !== null && _c !== void 0 ? _c : 0; + message.errorInfo = (object.errorInfo !== undefined && object.errorInfo !== null) + ? exports.RpcErrorInfo.fromPartial(object.errorInfo) + : undefined; + return message; + }, +}; +function createBaseRpcErrorInfo() { + return { errorCode: 0, message: "", stackTrace: "" }; +} +exports.RpcErrorInfo = { + encode(message, writer = _m0.Writer.create()) { + if (message.errorCode !== undefined && message.errorCode !== 0) { + writer.uint32(8).uint32(message.errorCode); + } + if (message.message !== undefined && message.message !== "") { + writer.uint32(18).string(message.message); + } + if (message.stackTrace !== undefined && message.stackTrace !== "") { + writer.uint32(26).string(message.stackTrace); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRpcErrorInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + message.errorCode = reader.uint32(); + continue; + case 2: + if (tag !== 18) { + break; + } + message.message = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + message.stackTrace = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + errorCode: isSet(object.errorCode) ? globalThis.Number(object.errorCode) : 0, + message: isSet(object.message) ? globalThis.String(object.message) : "", + stackTrace: isSet(object.stackTrace) ? globalThis.String(object.stackTrace) : "", + }; + }, + toJSON(message) { + const obj = {}; + if (message.errorCode !== undefined && message.errorCode !== 0) { + obj.errorCode = Math.round(message.errorCode); + } + if (message.message !== undefined && message.message !== "") { + obj.message = message.message; + } + if (message.stackTrace !== undefined && message.stackTrace !== "") { + obj.stackTrace = message.stackTrace; + } + return obj; + }, + create(base) { + return exports.RpcErrorInfo.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a, _b, _c; + const message = createBaseRpcErrorInfo(); + message.errorCode = (_a = object.errorCode) !== null && _a !== void 0 ? _a : 0; + message.message = (_b = object.message) !== null && _b !== void 0 ? _b : ""; + message.stackTrace = (_c = object.stackTrace) !== null && _c !== void 0 ? _c : ""; + return message; + }, +}; +function createBaseMessage() { + return { header: undefined, senderEnvelope: undefined, serverEnvelope: undefined, data: new Uint8Array(0) }; +} +exports.Message = { + encode(message, writer = _m0.Writer.create()) { + if (message.header !== undefined) { + exports.MessageHeader.encode(message.header, writer.uint32(10).fork()).ldelim(); + } + if (message.senderEnvelope !== undefined) { + exports.SenderEnvelope.encode(message.senderEnvelope, writer.uint32(18).fork()).ldelim(); + } + if (message.serverEnvelope !== undefined) { + exports.ServerEnvelope.encode(message.serverEnvelope, writer.uint32(26).fork()).ldelim(); + } + if (message.data !== undefined && message.data.length !== 0) { + writer.uint32(34).bytes(message.data); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMessage(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + message.header = exports.MessageHeader.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + message.senderEnvelope = exports.SenderEnvelope.decode(reader, reader.uint32()); + continue; + case 3: + if (tag !== 26) { + break; + } + message.serverEnvelope = exports.ServerEnvelope.decode(reader, reader.uint32()); + continue; + case 4: + if (tag !== 34) { + break; + } + message.data = reader.bytes(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + header: isSet(object.header) ? exports.MessageHeader.fromJSON(object.header) : undefined, + senderEnvelope: isSet(object.senderEnvelope) ? exports.SenderEnvelope.fromJSON(object.senderEnvelope) : undefined, + serverEnvelope: isSet(object.serverEnvelope) ? exports.ServerEnvelope.fromJSON(object.serverEnvelope) : undefined, + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(0), + }; + }, + toJSON(message) { + const obj = {}; + if (message.header !== undefined) { + obj.header = exports.MessageHeader.toJSON(message.header); + } + if (message.senderEnvelope !== undefined) { + obj.senderEnvelope = exports.SenderEnvelope.toJSON(message.senderEnvelope); + } + if (message.serverEnvelope !== undefined) { + obj.serverEnvelope = exports.ServerEnvelope.toJSON(message.serverEnvelope); + } + if (message.data !== undefined && message.data.length !== 0) { + obj.data = base64FromBytes(message.data); + } + return obj; + }, + create(base) { + return exports.Message.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a; + const message = createBaseMessage(); + message.header = (object.header !== undefined && object.header !== null) + ? exports.MessageHeader.fromPartial(object.header) + : undefined; + message.senderEnvelope = (object.senderEnvelope !== undefined && object.senderEnvelope !== null) + ? exports.SenderEnvelope.fromPartial(object.senderEnvelope) + : undefined; + message.serverEnvelope = (object.serverEnvelope !== undefined && object.serverEnvelope !== null) + ? exports.ServerEnvelope.fromPartial(object.serverEnvelope) + : undefined; + message.data = (_a = object.data) !== null && _a !== void 0 ? _a : new Uint8Array(0); + return message; + }, +}; +function createBaseMessageEnvelope() { + return { messageBytes: new Uint8Array(0), serverEnvelope: undefined }; +} +exports.MessageEnvelope = { + encode(message, writer = _m0.Writer.create()) { + if (message.messageBytes !== undefined && message.messageBytes.length !== 0) { + writer.uint32(10).bytes(message.messageBytes); + } + if (message.serverEnvelope !== undefined) { + exports.ServerEnvelope.encode(message.serverEnvelope, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMessageEnvelope(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + message.messageBytes = reader.bytes(); + continue; + case 2: + if (tag !== 18) { + break; + } + message.serverEnvelope = exports.ServerEnvelope.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + messageBytes: isSet(object.messageBytes) ? bytesFromBase64(object.messageBytes) : new Uint8Array(0), + serverEnvelope: isSet(object.serverEnvelope) ? exports.ServerEnvelope.fromJSON(object.serverEnvelope) : undefined, + }; + }, + toJSON(message) { + const obj = {}; + if (message.messageBytes !== undefined && message.messageBytes.length !== 0) { + obj.messageBytes = base64FromBytes(message.messageBytes); + } + if (message.serverEnvelope !== undefined) { + obj.serverEnvelope = exports.ServerEnvelope.toJSON(message.serverEnvelope); + } + return obj; + }, + create(base) { + return exports.MessageEnvelope.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a; + const message = createBaseMessageEnvelope(); + message.messageBytes = (_a = object.messageBytes) !== null && _a !== void 0 ? _a : new Uint8Array(0); + message.serverEnvelope = (object.serverEnvelope !== undefined && object.serverEnvelope !== null) + ? exports.ServerEnvelope.fromPartial(object.serverEnvelope) + : undefined; + return message; + }, +}; +function createBaseSendMessageRequest() { + return { to: [], message: undefined, channel: "", idempotentId: "" }; +} +exports.SendMessageRequest = { + encode(message, writer = _m0.Writer.create()) { + if (message.to !== undefined && message.to.length !== 0) { + for (const v of message.to) { + writer.uint32(10).string(v); + } + } + if (message.message !== undefined) { + exports.Message.encode(message.message, writer.uint32(18).fork()).ldelim(); + } + if (message.channel !== undefined && message.channel !== "") { + writer.uint32(26).string(message.channel); + } + if (message.idempotentId !== undefined && message.idempotentId !== "") { + writer.uint32(34).string(message.idempotentId); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSendMessageRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + message.to.push(reader.string()); + continue; + case 2: + if (tag !== 18) { + break; + } + message.message = exports.Message.decode(reader, reader.uint32()); + continue; + case 3: + if (tag !== 26) { + break; + } + message.channel = reader.string(); + continue; + case 4: + if (tag !== 34) { + break; + } + message.idempotentId = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + to: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.to) ? object.to.map((e) => globalThis.String(e)) : [], + message: isSet(object.message) ? exports.Message.fromJSON(object.message) : undefined, + channel: isSet(object.channel) ? globalThis.String(object.channel) : "", + idempotentId: isSet(object.idempotentId) ? globalThis.String(object.idempotentId) : "", + }; + }, + toJSON(message) { + var _a; + const obj = {}; + if ((_a = message.to) === null || _a === void 0 ? void 0 : _a.length) { + obj.to = message.to; + } + if (message.message !== undefined) { + obj.message = exports.Message.toJSON(message.message); + } + if (message.channel !== undefined && message.channel !== "") { + obj.channel = message.channel; + } + if (message.idempotentId !== undefined && message.idempotentId !== "") { + obj.idempotentId = message.idempotentId; + } + return obj; + }, + create(base) { + return exports.SendMessageRequest.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a, _b, _c; + const message = createBaseSendMessageRequest(); + message.to = ((_a = object.to) === null || _a === void 0 ? void 0 : _a.map((e) => e)) || []; + message.message = (object.message !== undefined && object.message !== null) + ? exports.Message.fromPartial(object.message) + : undefined; + message.channel = (_b = object.channel) !== null && _b !== void 0 ? _b : ""; + message.idempotentId = (_c = object.idempotentId) !== null && _c !== void 0 ? _c : ""; + return message; + }, +}; +function createBaseSendMessageResponse() { + return { errors: [], duplicates: [], idempotentId: "", correlationId: "" }; +} +exports.SendMessageResponse = { + encode(message, writer = _m0.Writer.create()) { + if (message.errors !== undefined && message.errors.length !== 0) { + for (const v of message.errors) { + exports.SendMessageError.encode(v, writer.uint32(10).fork()).ldelim(); + } + } + if (message.duplicates !== undefined && message.duplicates.length !== 0) { + for (const v of message.duplicates) { + writer.uint32(18).string(v); + } + } + if (message.idempotentId !== undefined && message.idempotentId !== "") { + writer.uint32(26).string(message.idempotentId); + } + if (message.correlationId !== undefined && message.correlationId !== "") { + writer.uint32(34).string(message.correlationId); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSendMessageResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + message.errors.push(exports.SendMessageError.decode(reader, reader.uint32())); + continue; + case 2: + if (tag !== 18) { + break; + } + message.duplicates.push(reader.string()); + continue; + case 3: + if (tag !== 26) { + break; + } + message.idempotentId = reader.string(); + continue; + case 4: + if (tag !== 34) { + break; + } + message.correlationId = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + errors: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.errors) + ? object.errors.map((e) => exports.SendMessageError.fromJSON(e)) + : [], + duplicates: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.duplicates) + ? object.duplicates.map((e) => globalThis.String(e)) + : [], + idempotentId: isSet(object.idempotentId) ? globalThis.String(object.idempotentId) : "", + correlationId: isSet(object.correlationId) ? globalThis.String(object.correlationId) : "", + }; + }, + toJSON(message) { + var _a, _b; + const obj = {}; + if ((_a = message.errors) === null || _a === void 0 ? void 0 : _a.length) { + obj.errors = message.errors.map((e) => exports.SendMessageError.toJSON(e)); + } + if ((_b = message.duplicates) === null || _b === void 0 ? void 0 : _b.length) { + obj.duplicates = message.duplicates; + } + if (message.idempotentId !== undefined && message.idempotentId !== "") { + obj.idempotentId = message.idempotentId; + } + if (message.correlationId !== undefined && message.correlationId !== "") { + obj.correlationId = message.correlationId; + } + return obj; + }, + create(base) { + return exports.SendMessageResponse.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a, _b, _c, _d; + const message = createBaseSendMessageResponse(); + message.errors = ((_a = object.errors) === null || _a === void 0 ? void 0 : _a.map((e) => exports.SendMessageError.fromPartial(e))) || []; + message.duplicates = ((_b = object.duplicates) === null || _b === void 0 ? void 0 : _b.map((e) => e)) || []; + message.idempotentId = (_c = object.idempotentId) !== null && _c !== void 0 ? _c : ""; + message.correlationId = (_d = object.correlationId) !== null && _d !== void 0 ? _d : ""; + return message; + }, +}; +function createBaseSendReceipt() { + return { request: undefined, response: undefined, serverEnvelope: undefined }; +} +exports.SendReceipt = { + encode(message, writer = _m0.Writer.create()) { + if (message.request !== undefined) { + exports.SendMessageRequest.encode(message.request, writer.uint32(10).fork()).ldelim(); + } + if (message.response !== undefined) { + exports.SendMessageResponse.encode(message.response, writer.uint32(18).fork()).ldelim(); + } + if (message.serverEnvelope !== undefined) { + exports.ServerEnvelope.encode(message.serverEnvelope, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSendReceipt(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + message.request = exports.SendMessageRequest.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + message.response = exports.SendMessageResponse.decode(reader, reader.uint32()); + continue; + case 3: + if (tag !== 26) { + break; + } + message.serverEnvelope = exports.ServerEnvelope.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + request: isSet(object.request) ? exports.SendMessageRequest.fromJSON(object.request) : undefined, + response: isSet(object.response) ? exports.SendMessageResponse.fromJSON(object.response) : undefined, + serverEnvelope: isSet(object.serverEnvelope) ? exports.ServerEnvelope.fromJSON(object.serverEnvelope) : undefined, + }; + }, + toJSON(message) { + const obj = {}; + if (message.request !== undefined) { + obj.request = exports.SendMessageRequest.toJSON(message.request); + } + if (message.response !== undefined) { + obj.response = exports.SendMessageResponse.toJSON(message.response); + } + if (message.serverEnvelope !== undefined) { + obj.serverEnvelope = exports.ServerEnvelope.toJSON(message.serverEnvelope); + } + return obj; + }, + create(base) { + return exports.SendReceipt.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + const message = createBaseSendReceipt(); + message.request = (object.request !== undefined && object.request !== null) + ? exports.SendMessageRequest.fromPartial(object.request) + : undefined; + message.response = (object.response !== undefined && object.response !== null) + ? exports.SendMessageResponse.fromPartial(object.response) + : undefined; + message.serverEnvelope = (object.serverEnvelope !== undefined && object.serverEnvelope !== null) + ? exports.ServerEnvelope.fromPartial(object.serverEnvelope) + : undefined; + return message; + }, +}; +function createBaseSendMessageError() { + return { message: "", to: "" }; +} +exports.SendMessageError = { + encode(message, writer = _m0.Writer.create()) { + if (message.message !== undefined && message.message !== "") { + writer.uint32(10).string(message.message); + } + if (message.to !== undefined && message.to !== "") { + writer.uint32(18).string(message.to); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSendMessageError(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + message.message = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + message.to = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + message: isSet(object.message) ? globalThis.String(object.message) : "", + to: isSet(object.to) ? globalThis.String(object.to) : "", + }; + }, + toJSON(message) { + const obj = {}; + if (message.message !== undefined && message.message !== "") { + obj.message = message.message; + } + if (message.to !== undefined && message.to !== "") { + obj.to = message.to; + } + return obj; + }, + create(base) { + return exports.SendMessageError.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a, _b; + const message = createBaseSendMessageError(); + message.message = (_a = object.message) !== null && _a !== void 0 ? _a : ""; + message.to = (_b = object.to) !== null && _b !== void 0 ? _b : ""; + return message; + }, +}; +function createBaseFirstMessage() { + return { senderInfo: undefined, mailboxTimeoutInMs: 0, subscriptions: [] }; +} +exports.FirstMessage = { + encode(message, writer = _m0.Writer.create()) { + if (message.senderInfo !== undefined) { + exports.SenderInfo.encode(message.senderInfo, writer.uint32(10).fork()).ldelim(); + } + if (message.mailboxTimeoutInMs !== undefined && message.mailboxTimeoutInMs !== 0) { + writer.uint32(16).uint32(message.mailboxTimeoutInMs); + } + if (message.subscriptions !== undefined && message.subscriptions.length !== 0) { + for (const v of message.subscriptions) { + exports.Subscription.encode(v, writer.uint32(26).fork()).ldelim(); + } + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFirstMessage(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + message.senderInfo = exports.SenderInfo.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 16) { + break; + } + message.mailboxTimeoutInMs = reader.uint32(); + continue; + case 3: + if (tag !== 26) { + break; + } + message.subscriptions.push(exports.Subscription.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + senderInfo: isSet(object.senderInfo) ? exports.SenderInfo.fromJSON(object.senderInfo) : undefined, + mailboxTimeoutInMs: isSet(object.mailboxTimeoutInMs) ? globalThis.Number(object.mailboxTimeoutInMs) : 0, + subscriptions: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.subscriptions) + ? object.subscriptions.map((e) => exports.Subscription.fromJSON(e)) + : [], + }; + }, + toJSON(message) { + var _a; + const obj = {}; + if (message.senderInfo !== undefined) { + obj.senderInfo = exports.SenderInfo.toJSON(message.senderInfo); + } + if (message.mailboxTimeoutInMs !== undefined && message.mailboxTimeoutInMs !== 0) { + obj.mailboxTimeoutInMs = Math.round(message.mailboxTimeoutInMs); + } + if ((_a = message.subscriptions) === null || _a === void 0 ? void 0 : _a.length) { + obj.subscriptions = message.subscriptions.map((e) => exports.Subscription.toJSON(e)); + } + return obj; + }, + create(base) { + return exports.FirstMessage.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a, _b; + const message = createBaseFirstMessage(); + message.senderInfo = (object.senderInfo !== undefined && object.senderInfo !== null) + ? exports.SenderInfo.fromPartial(object.senderInfo) + : undefined; + message.mailboxTimeoutInMs = (_a = object.mailboxTimeoutInMs) !== null && _a !== void 0 ? _a : 0; + message.subscriptions = ((_b = object.subscriptions) === null || _b === void 0 ? void 0 : _b.map((e) => exports.Subscription.fromPartial(e))) || []; + return message; + }, +}; +function createBaseSenderInfo() { + return { readerKey: "", address: "" }; +} +exports.SenderInfo = { + encode(message, writer = _m0.Writer.create()) { + if (message.readerKey !== undefined && message.readerKey !== "") { + writer.uint32(10).string(message.readerKey); + } + if (message.address !== undefined && message.address !== "") { + writer.uint32(18).string(message.address); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSenderInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + message.readerKey = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + message.address = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + readerKey: isSet(object.readerKey) ? globalThis.String(object.readerKey) : "", + address: isSet(object.address) ? globalThis.String(object.address) : "", + }; + }, + toJSON(message) { + const obj = {}; + if (message.readerKey !== undefined && message.readerKey !== "") { + obj.readerKey = message.readerKey; + } + if (message.address !== undefined && message.address !== "") { + obj.address = message.address; + } + return obj; + }, + create(base) { + return exports.SenderInfo.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a, _b; + const message = createBaseSenderInfo(); + message.readerKey = (_a = object.readerKey) !== null && _a !== void 0 ? _a : ""; + message.address = (_b = object.address) !== null && _b !== void 0 ? _b : ""; + return message; + }, +}; +function createBaseSubscribeRequest() { + return { subscriptions: [] }; +} +exports.SubscribeRequest = { + encode(message, writer = _m0.Writer.create()) { + if (message.subscriptions !== undefined && message.subscriptions.length !== 0) { + for (const v of message.subscriptions) { + exports.Subscription.encode(v, writer.uint32(10).fork()).ldelim(); + } + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubscribeRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + message.subscriptions.push(exports.Subscription.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + subscriptions: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.subscriptions) + ? object.subscriptions.map((e) => exports.Subscription.fromJSON(e)) + : [], + }; + }, + toJSON(message) { + var _a; + const obj = {}; + if ((_a = message.subscriptions) === null || _a === void 0 ? void 0 : _a.length) { + obj.subscriptions = message.subscriptions.map((e) => exports.Subscription.toJSON(e)); + } + return obj; + }, + create(base) { + return exports.SubscribeRequest.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a; + const message = createBaseSubscribeRequest(); + message.subscriptions = ((_a = object.subscriptions) === null || _a === void 0 ? void 0 : _a.map((e) => exports.Subscription.fromPartial(e))) || []; + return message; + }, +}; +function createBaseSubscribeResponse() { + return { succeeded: [], errors: [] }; +} +exports.SubscribeResponse = { + encode(message, writer = _m0.Writer.create()) { + if (message.succeeded !== undefined && message.succeeded.length !== 0) { + for (const v of message.succeeded) { + writer.uint32(10).string(v); + } + } + if (message.errors !== undefined && message.errors.length !== 0) { + for (const v of message.errors) { + exports.SubscribeError.encode(v, writer.uint32(18).fork()).ldelim(); + } + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubscribeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + message.succeeded.push(reader.string()); + continue; + case 2: + if (tag !== 18) { + break; + } + message.errors.push(exports.SubscribeError.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + succeeded: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.succeeded) + ? object.succeeded.map((e) => globalThis.String(e)) + : [], + errors: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.errors) ? object.errors.map((e) => exports.SubscribeError.fromJSON(e)) : [], + }; + }, + toJSON(message) { + var _a, _b; + const obj = {}; + if ((_a = message.succeeded) === null || _a === void 0 ? void 0 : _a.length) { + obj.succeeded = message.succeeded; + } + if ((_b = message.errors) === null || _b === void 0 ? void 0 : _b.length) { + obj.errors = message.errors.map((e) => exports.SubscribeError.toJSON(e)); + } + return obj; + }, + create(base) { + return exports.SubscribeResponse.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a, _b; + const message = createBaseSubscribeResponse(); + message.succeeded = ((_a = object.succeeded) === null || _a === void 0 ? void 0 : _a.map((e) => e)) || []; + message.errors = ((_b = object.errors) === null || _b === void 0 ? void 0 : _b.map((e) => exports.SubscribeError.fromPartial(e))) || []; + return message; + }, +}; +function createBaseSubscribeError() { + return { state: "", message: "" }; +} +exports.SubscribeError = { + encode(message, writer = _m0.Writer.create()) { + if (message.state !== undefined && message.state !== "") { + writer.uint32(18).string(message.state); + } + if (message.message !== undefined && message.message !== "") { + writer.uint32(26).string(message.message); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubscribeError(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + if (tag !== 18) { + break; + } + message.state = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + message.message = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + state: isSet(object.state) ? globalThis.String(object.state) : "", + message: isSet(object.message) ? globalThis.String(object.message) : "", + }; + }, + toJSON(message) { + const obj = {}; + if (message.state !== undefined && message.state !== "") { + obj.state = message.state; + } + if (message.message !== undefined && message.message !== "") { + obj.message = message.message; + } + return obj; + }, + create(base) { + return exports.SubscribeError.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a, _b; + const message = createBaseSubscribeError(); + message.state = (_a = object.state) !== null && _a !== void 0 ? _a : ""; + message.message = (_b = object.message) !== null && _b !== void 0 ? _b : ""; + return message; + }, +}; +function createBaseSubscription() { + return { mailbox: undefined, nefario: undefined, changeDataCapture: undefined, unsubscribe: undefined }; +} +exports.Subscription = { + encode(message, writer = _m0.Writer.create()) { + if (message.mailbox !== undefined) { + exports.MailboxSubscription.encode(message.mailbox, writer.uint32(10).fork()).ldelim(); + } + if (message.nefario !== undefined) { + exports.NefarioSubscription.encode(message.nefario, writer.uint32(18).fork()).ldelim(); + } + if (message.changeDataCapture !== undefined) { + exports.ChangeDataCaptureSubscription.encode(message.changeDataCapture, writer.uint32(26).fork()).ldelim(); + } + if (message.unsubscribe !== undefined) { + exports.Unsubscribe.encode(message.unsubscribe, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubscription(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + message.mailbox = exports.MailboxSubscription.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + message.nefario = exports.NefarioSubscription.decode(reader, reader.uint32()); + continue; + case 3: + if (tag !== 26) { + break; + } + message.changeDataCapture = exports.ChangeDataCaptureSubscription.decode(reader, reader.uint32()); + continue; + case 4: + if (tag !== 34) { + break; + } + message.unsubscribe = exports.Unsubscribe.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + mailbox: isSet(object.mailbox) ? exports.MailboxSubscription.fromJSON(object.mailbox) : undefined, + nefario: isSet(object.nefario) ? exports.NefarioSubscription.fromJSON(object.nefario) : undefined, + changeDataCapture: isSet(object.changeDataCapture) + ? exports.ChangeDataCaptureSubscription.fromJSON(object.changeDataCapture) + : undefined, + unsubscribe: isSet(object.unsubscribe) ? exports.Unsubscribe.fromJSON(object.unsubscribe) : undefined, + }; + }, + toJSON(message) { + const obj = {}; + if (message.mailbox !== undefined) { + obj.mailbox = exports.MailboxSubscription.toJSON(message.mailbox); + } + if (message.nefario !== undefined) { + obj.nefario = exports.NefarioSubscription.toJSON(message.nefario); + } + if (message.changeDataCapture !== undefined) { + obj.changeDataCapture = exports.ChangeDataCaptureSubscription.toJSON(message.changeDataCapture); + } + if (message.unsubscribe !== undefined) { + obj.unsubscribe = exports.Unsubscribe.toJSON(message.unsubscribe); + } + return obj; + }, + create(base) { + return exports.Subscription.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + const message = createBaseSubscription(); + message.mailbox = (object.mailbox !== undefined && object.mailbox !== null) + ? exports.MailboxSubscription.fromPartial(object.mailbox) + : undefined; + message.nefario = (object.nefario !== undefined && object.nefario !== null) + ? exports.NefarioSubscription.fromPartial(object.nefario) + : undefined; + message.changeDataCapture = (object.changeDataCapture !== undefined && object.changeDataCapture !== null) + ? exports.ChangeDataCaptureSubscription.fromPartial(object.changeDataCapture) + : undefined; + message.unsubscribe = (object.unsubscribe !== undefined && object.unsubscribe !== null) + ? exports.Unsubscribe.fromPartial(object.unsubscribe) + : undefined; + return message; + }, +}; +function createBaseMailboxSubscription() { + return { id: "", state: "", readerKey: "", channel: "", startSeq: "" }; +} +exports.MailboxSubscription = { + encode(message, writer = _m0.Writer.create()) { + if (message.id !== undefined && message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.state !== undefined && message.state !== "") { + writer.uint32(18).string(message.state); + } + if (message.readerKey !== undefined && message.readerKey !== "") { + writer.uint32(26).string(message.readerKey); + } + if (message.channel !== undefined && message.channel !== "") { + writer.uint32(34).string(message.channel); + } + if (message.startSeq !== undefined && message.startSeq !== "") { + writer.uint32(42).string(message.startSeq); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMailboxSubscription(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + message.id = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + message.state = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + message.readerKey = reader.string(); + continue; + case 4: + if (tag !== 34) { + break; + } + message.channel = reader.string(); + continue; + case 5: + if (tag !== 42) { + break; + } + message.startSeq = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + id: isSet(object.id) ? globalThis.String(object.id) : "", + state: isSet(object.state) ? globalThis.String(object.state) : "", + readerKey: isSet(object.readerKey) ? globalThis.String(object.readerKey) : "", + channel: isSet(object.channel) ? globalThis.String(object.channel) : "", + startSeq: isSet(object.startSeq) ? globalThis.String(object.startSeq) : "", + }; + }, + toJSON(message) { + const obj = {}; + if (message.id !== undefined && message.id !== "") { + obj.id = message.id; + } + if (message.state !== undefined && message.state !== "") { + obj.state = message.state; + } + if (message.readerKey !== undefined && message.readerKey !== "") { + obj.readerKey = message.readerKey; + } + if (message.channel !== undefined && message.channel !== "") { + obj.channel = message.channel; + } + if (message.startSeq !== undefined && message.startSeq !== "") { + obj.startSeq = message.startSeq; + } + return obj; + }, + create(base) { + return exports.MailboxSubscription.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a, _b, _c, _d, _e; + const message = createBaseMailboxSubscription(); + message.id = (_a = object.id) !== null && _a !== void 0 ? _a : ""; + message.state = (_b = object.state) !== null && _b !== void 0 ? _b : ""; + message.readerKey = (_c = object.readerKey) !== null && _c !== void 0 ? _c : ""; + message.channel = (_d = object.channel) !== null && _d !== void 0 ? _d : ""; + message.startSeq = (_e = object.startSeq) !== null && _e !== void 0 ? _e : ""; + return message; + }, +}; +function createBaseChangeDataCaptureSubscription() { + return { id: "", state: "", matchers: [], startSeq: "" }; +} +exports.ChangeDataCaptureSubscription = { + encode(message, writer = _m0.Writer.create()) { + if (message.id !== undefined && message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.state !== undefined && message.state !== "") { + writer.uint32(18).string(message.state); + } + if (message.matchers !== undefined && message.matchers.length !== 0) { + for (const v of message.matchers) { + exports.RecordMatcher.encode(v, writer.uint32(26).fork()).ldelim(); + } + } + if (message.startSeq !== undefined && message.startSeq !== "") { + writer.uint32(34).string(message.startSeq); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseChangeDataCaptureSubscription(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + message.id = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + message.state = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + message.matchers.push(exports.RecordMatcher.decode(reader, reader.uint32())); + continue; + case 4: + if (tag !== 34) { + break; + } + message.startSeq = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + id: isSet(object.id) ? globalThis.String(object.id) : "", + state: isSet(object.state) ? globalThis.String(object.state) : "", + matchers: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.matchers) + ? object.matchers.map((e) => exports.RecordMatcher.fromJSON(e)) + : [], + startSeq: isSet(object.startSeq) ? globalThis.String(object.startSeq) : "", + }; + }, + toJSON(message) { + var _a; + const obj = {}; + if (message.id !== undefined && message.id !== "") { + obj.id = message.id; + } + if (message.state !== undefined && message.state !== "") { + obj.state = message.state; + } + if ((_a = message.matchers) === null || _a === void 0 ? void 0 : _a.length) { + obj.matchers = message.matchers.map((e) => exports.RecordMatcher.toJSON(e)); + } + if (message.startSeq !== undefined && message.startSeq !== "") { + obj.startSeq = message.startSeq; + } + return obj; + }, + create(base) { + return exports.ChangeDataCaptureSubscription.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a, _b, _c, _d; + const message = createBaseChangeDataCaptureSubscription(); + message.id = (_a = object.id) !== null && _a !== void 0 ? _a : ""; + message.state = (_b = object.state) !== null && _b !== void 0 ? _b : ""; + message.matchers = ((_c = object.matchers) === null || _c === void 0 ? void 0 : _c.map((e) => exports.RecordMatcher.fromPartial(e))) || []; + message.startSeq = (_d = object.startSeq) !== null && _d !== void 0 ? _d : ""; + return message; + }, +}; +function createBaseRecordMatcher() { + return { database: "", table: "", primaryKeys: [] }; +} +exports.RecordMatcher = { + encode(message, writer = _m0.Writer.create()) { + if (message.database !== undefined && message.database !== "") { + writer.uint32(10).string(message.database); + } + if (message.table !== undefined && message.table !== "") { + writer.uint32(18).string(message.table); + } + if (message.primaryKeys !== undefined && message.primaryKeys.length !== 0) { + for (const v of message.primaryKeys) { + struct_1.Value.encode(struct_1.Value.wrap(v), writer.uint32(26).fork()).ldelim(); + } + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRecordMatcher(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + message.database = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + message.table = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + message.primaryKeys.push(struct_1.Value.unwrap(struct_1.Value.decode(reader, reader.uint32()))); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + database: isSet(object.database) ? globalThis.String(object.database) : "", + table: isSet(object.table) ? globalThis.String(object.table) : "", + primaryKeys: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.primaryKeys) ? [...object.primaryKeys] : [], + }; + }, + toJSON(message) { + var _a; + const obj = {}; + if (message.database !== undefined && message.database !== "") { + obj.database = message.database; + } + if (message.table !== undefined && message.table !== "") { + obj.table = message.table; + } + if ((_a = message.primaryKeys) === null || _a === void 0 ? void 0 : _a.length) { + obj.primaryKeys = message.primaryKeys; + } + return obj; + }, + create(base) { + return exports.RecordMatcher.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a, _b, _c; + const message = createBaseRecordMatcher(); + message.database = (_a = object.database) !== null && _a !== void 0 ? _a : ""; + message.table = (_b = object.table) !== null && _b !== void 0 ? _b : ""; + message.primaryKeys = ((_c = object.primaryKeys) === null || _c === void 0 ? void 0 : _c.map((e) => e)) || []; + return message; + }, +}; +function createBaseNefarioSubscription() { + return { id: "", state: "", processUid: "", channel: "", startSeq: "" }; +} +exports.NefarioSubscription = { + encode(message, writer = _m0.Writer.create()) { + if (message.id !== undefined && message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.state !== undefined && message.state !== "") { + writer.uint32(18).string(message.state); + } + if (message.processUid !== undefined && message.processUid !== "") { + writer.uint32(26).string(message.processUid); + } + if (message.channel !== undefined && message.channel !== "") { + writer.uint32(34).string(message.channel); + } + if (message.startSeq !== undefined && message.startSeq !== "") { + writer.uint32(42).string(message.startSeq); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseNefarioSubscription(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + message.id = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + message.state = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + message.processUid = reader.string(); + continue; + case 4: + if (tag !== 34) { + break; + } + message.channel = reader.string(); + continue; + case 5: + if (tag !== 42) { + break; + } + message.startSeq = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + id: isSet(object.id) ? globalThis.String(object.id) : "", + state: isSet(object.state) ? globalThis.String(object.state) : "", + processUid: isSet(object.processUid) ? globalThis.String(object.processUid) : "", + channel: isSet(object.channel) ? globalThis.String(object.channel) : "", + startSeq: isSet(object.startSeq) ? globalThis.String(object.startSeq) : "", + }; + }, + toJSON(message) { + const obj = {}; + if (message.id !== undefined && message.id !== "") { + obj.id = message.id; + } + if (message.state !== undefined && message.state !== "") { + obj.state = message.state; + } + if (message.processUid !== undefined && message.processUid !== "") { + obj.processUid = message.processUid; + } + if (message.channel !== undefined && message.channel !== "") { + obj.channel = message.channel; + } + if (message.startSeq !== undefined && message.startSeq !== "") { + obj.startSeq = message.startSeq; + } + return obj; + }, + create(base) { + return exports.NefarioSubscription.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a, _b, _c, _d, _e; + const message = createBaseNefarioSubscription(); + message.id = (_a = object.id) !== null && _a !== void 0 ? _a : ""; + message.state = (_b = object.state) !== null && _b !== void 0 ? _b : ""; + message.processUid = (_c = object.processUid) !== null && _c !== void 0 ? _c : ""; + message.channel = (_d = object.channel) !== null && _d !== void 0 ? _d : ""; + message.startSeq = (_e = object.startSeq) !== null && _e !== void 0 ? _e : ""; + return message; + }, +}; +function createBaseUnsubscribe() { + return { id: "" }; +} +exports.Unsubscribe = { + encode(message, writer = _m0.Writer.create()) { + if (message.id !== undefined && message.id !== "") { + writer.uint32(10).string(message.id); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUnsubscribe(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + message.id = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { id: isSet(object.id) ? globalThis.String(object.id) : "" }; + }, + toJSON(message) { + const obj = {}; + if (message.id !== undefined && message.id !== "") { + obj.id = message.id; + } + return obj; + }, + create(base) { + return exports.Unsubscribe.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a; + const message = createBaseUnsubscribe(); + message.id = (_a = object.id) !== null && _a !== void 0 ? _a : ""; + return message; + }, +}; +function createBaseCreateMailboxRequest() { + return { + channels: [], + privateMetadata: undefined, + publicMetadata: undefined, + purgeTimeoutInMillis: 0, + closeTimeoutInMillis: 0, + extraData: undefined, + }; +} +exports.CreateMailboxRequest = { + encode(message, writer = _m0.Writer.create()) { + if (message.channels !== undefined && message.channels.length !== 0) { + for (const v of message.channels) { + writer.uint32(10).string(v); + } + } + if (message.privateMetadata !== undefined) { + struct_1.Struct.encode(struct_1.Struct.wrap(message.privateMetadata), writer.uint32(18).fork()).ldelim(); + } + if (message.publicMetadata !== undefined) { + struct_1.Struct.encode(struct_1.Struct.wrap(message.publicMetadata), writer.uint32(26).fork()).ldelim(); + } + if (message.purgeTimeoutInMillis !== undefined && message.purgeTimeoutInMillis !== 0) { + writer.uint32(32).int64(message.purgeTimeoutInMillis); + } + if (message.closeTimeoutInMillis !== undefined && message.closeTimeoutInMillis !== 0) { + writer.uint32(40).int64(message.closeTimeoutInMillis); + } + if (message.extraData !== undefined) { + struct_1.Struct.encode(struct_1.Struct.wrap(message.extraData), writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateMailboxRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + message.channels.push(reader.string()); + continue; + case 2: + if (tag !== 18) { + break; + } + message.privateMetadata = struct_1.Struct.unwrap(struct_1.Struct.decode(reader, reader.uint32())); + continue; + case 3: + if (tag !== 26) { + break; + } + message.publicMetadata = struct_1.Struct.unwrap(struct_1.Struct.decode(reader, reader.uint32())); + continue; + case 4: + if (tag !== 32) { + break; + } + message.purgeTimeoutInMillis = longToNumber(reader.int64()); + continue; + case 5: + if (tag !== 40) { + break; + } + message.closeTimeoutInMillis = longToNumber(reader.int64()); + continue; + case 6: + if (tag !== 50) { + break; + } + message.extraData = struct_1.Struct.unwrap(struct_1.Struct.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + channels: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.channels) ? object.channels.map((e) => globalThis.String(e)) : [], + privateMetadata: isObject(object.privateMetadata) ? object.privateMetadata : undefined, + publicMetadata: isObject(object.publicMetadata) ? object.publicMetadata : undefined, + purgeTimeoutInMillis: isSet(object.purgeTimeoutInMillis) ? globalThis.Number(object.purgeTimeoutInMillis) : 0, + closeTimeoutInMillis: isSet(object.closeTimeoutInMillis) ? globalThis.Number(object.closeTimeoutInMillis) : 0, + extraData: isObject(object.extraData) ? object.extraData : undefined, + }; + }, + toJSON(message) { + var _a; + const obj = {}; + if ((_a = message.channels) === null || _a === void 0 ? void 0 : _a.length) { + obj.channels = message.channels; + } + if (message.privateMetadata !== undefined) { + obj.privateMetadata = message.privateMetadata; + } + if (message.publicMetadata !== undefined) { + obj.publicMetadata = message.publicMetadata; + } + if (message.purgeTimeoutInMillis !== undefined && message.purgeTimeoutInMillis !== 0) { + obj.purgeTimeoutInMillis = Math.round(message.purgeTimeoutInMillis); + } + if (message.closeTimeoutInMillis !== undefined && message.closeTimeoutInMillis !== 0) { + obj.closeTimeoutInMillis = Math.round(message.closeTimeoutInMillis); + } + if (message.extraData !== undefined) { + obj.extraData = message.extraData; + } + return obj; + }, + create(base) { + return exports.CreateMailboxRequest.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a, _b, _c, _d, _e, _f; + const message = createBaseCreateMailboxRequest(); + message.channels = ((_a = object.channels) === null || _a === void 0 ? void 0 : _a.map((e) => e)) || []; + message.privateMetadata = (_b = object.privateMetadata) !== null && _b !== void 0 ? _b : undefined; + message.publicMetadata = (_c = object.publicMetadata) !== null && _c !== void 0 ? _c : undefined; + message.purgeTimeoutInMillis = (_d = object.purgeTimeoutInMillis) !== null && _d !== void 0 ? _d : 0; + message.closeTimeoutInMillis = (_e = object.closeTimeoutInMillis) !== null && _e !== void 0 ? _e : 0; + message.extraData = (_f = object.extraData) !== null && _f !== void 0 ? _f : undefined; + return message; + }, +}; +function createBaseCreateMailboxResponse() { + return { adminKey: "", address: "", readerKey: "", channels: [] }; +} +exports.CreateMailboxResponse = { + encode(message, writer = _m0.Writer.create()) { + if (message.adminKey !== undefined && message.adminKey !== "") { + writer.uint32(10).string(message.adminKey); + } + if (message.address !== undefined && message.address !== "") { + writer.uint32(18).string(message.address); + } + if (message.readerKey !== undefined && message.readerKey !== "") { + writer.uint32(26).string(message.readerKey); + } + if (message.channels !== undefined && message.channels.length !== 0) { + for (const v of message.channels) { + writer.uint32(34).string(v); + } + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateMailboxResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + message.adminKey = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + message.address = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + message.readerKey = reader.string(); + continue; + case 4: + if (tag !== 34) { + break; + } + message.channels.push(reader.string()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + adminKey: isSet(object.adminKey) ? globalThis.String(object.adminKey) : "", + address: isSet(object.address) ? globalThis.String(object.address) : "", + readerKey: isSet(object.readerKey) ? globalThis.String(object.readerKey) : "", + channels: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.channels) ? object.channels.map((e) => globalThis.String(e)) : [], + }; + }, + toJSON(message) { + var _a; + const obj = {}; + if (message.adminKey !== undefined && message.adminKey !== "") { + obj.adminKey = message.adminKey; + } + if (message.address !== undefined && message.address !== "") { + obj.address = message.address; + } + if (message.readerKey !== undefined && message.readerKey !== "") { + obj.readerKey = message.readerKey; + } + if ((_a = message.channels) === null || _a === void 0 ? void 0 : _a.length) { + obj.channels = message.channels; + } + return obj; + }, + create(base) { + return exports.CreateMailboxResponse.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a, _b, _c, _d; + const message = createBaseCreateMailboxResponse(); + message.adminKey = (_a = object.adminKey) !== null && _a !== void 0 ? _a : ""; + message.address = (_b = object.address) !== null && _b !== void 0 ? _b : ""; + message.readerKey = (_c = object.readerKey) !== null && _c !== void 0 ? _c : ""; + message.channels = ((_d = object.channels) === null || _d === void 0 ? void 0 : _d.map((e) => e)) || []; + return message; + }, +}; +function createBaseAddChannelRequest() { + return { adminKey: "", channels: [] }; +} +exports.AddChannelRequest = { + encode(message, writer = _m0.Writer.create()) { + if (message.adminKey !== undefined && message.adminKey !== "") { + writer.uint32(10).string(message.adminKey); + } + if (message.channels !== undefined && message.channels.length !== 0) { + for (const v of message.channels) { + writer.uint32(18).string(v); + } + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAddChannelRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + message.adminKey = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + message.channels.push(reader.string()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + adminKey: isSet(object.adminKey) ? globalThis.String(object.adminKey) : "", + channels: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.channels) ? object.channels.map((e) => globalThis.String(e)) : [], + }; + }, + toJSON(message) { + var _a; + const obj = {}; + if (message.adminKey !== undefined && message.adminKey !== "") { + obj.adminKey = message.adminKey; + } + if ((_a = message.channels) === null || _a === void 0 ? void 0 : _a.length) { + obj.channels = message.channels; + } + return obj; + }, + create(base) { + return exports.AddChannelRequest.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a, _b; + const message = createBaseAddChannelRequest(); + message.adminKey = (_a = object.adminKey) !== null && _a !== void 0 ? _a : ""; + message.channels = ((_b = object.channels) === null || _b === void 0 ? void 0 : _b.map((e) => e)) || []; + return message; + }, +}; +function createBaseAddChannelResponse() { + return {}; +} +exports.AddChannelResponse = { + encode(_, writer = _m0.Writer.create()) { + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAddChannelResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(_) { + return {}; + }, + toJSON(_) { + const obj = {}; + return obj; + }, + create(base) { + return exports.AddChannelResponse.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(_) { + const message = createBaseAddChannelResponse(); + return message; + }, +}; +exports.HermesServiceServiceName = "hermes.HermesService"; +class HermesServiceClientImpl { + constructor(rpc, opts) { + this.service = (opts === null || opts === void 0 ? void 0 : opts.service) || exports.HermesServiceServiceName; + this.rpc = rpc; + this.SendReceive = this.SendReceive.bind(this); + this.CreateMailbox = this.CreateMailbox.bind(this); + this.AddChannel = this.AddChannel.bind(this); + } + SendReceive(request) { + const data = request.pipe((0, index_2.map)((request) => exports.MessageFromClient.encode(request).finish())); + const result = this.rpc.bidirectionalStreamingRequest(this.service, "SendReceive", data); + return result.pipe((0, index_2.map)((data) => exports.MessageToClient.decode(_m0.Reader.create(data)))); + } + CreateMailbox(request) { + const data = exports.CreateMailboxRequest.encode(request).finish(); + const promise = this.rpc.request(this.service, "CreateMailbox", data); + return promise.then((data) => exports.CreateMailboxResponse.decode(_m0.Reader.create(data))); + } + AddChannel(request) { + const data = exports.AddChannelRequest.encode(request).finish(); + const promise = this.rpc.request(this.service, "AddChannel", data); + return promise.then((data) => exports.AddChannelResponse.decode(_m0.Reader.create(data))); + } +} +exports.HermesServiceClientImpl = HermesServiceClientImpl; +function bytesFromBase64(b64) { + if (globalThis.Buffer) { + return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); + } + else { + const bin = globalThis.atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; + } +} +function base64FromBytes(arr) { + if (globalThis.Buffer) { + return globalThis.Buffer.from(arr).toString("base64"); + } + else { + const bin = []; + arr.forEach((byte) => { + bin.push(globalThis.String.fromCharCode(byte)); + }); + return globalThis.btoa(bin.join("")); + } +} +function longToNumber(long) { + if (long.gt(globalThis.Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} +if (_m0.util.Long !== index_1.default) { + _m0.util.Long = index_1.default; + _m0.configure(); +} +function isObject(value) { + return typeof value === "object" && value !== null; +} +function isSet(value) { + return value !== null && value !== undefined; +} diff --git a/lib/esm/Utils.d.ts b/lib/esm/Utils.d.ts new file mode 100644 index 0000000..d934a45 --- /dev/null +++ b/lib/esm/Utils.d.ts @@ -0,0 +1,2 @@ +export declare function undef(): A | undefined; +export declare function memoize(fn: () => A): () => A; diff --git a/lib/esm/Utils.js b/lib/esm/Utils.js new file mode 100644 index 0000000..551f6f4 --- /dev/null +++ b/lib/esm/Utils.js @@ -0,0 +1,12 @@ +export function undef() { + return undefined; +} +export function memoize(fn) { + let memo; + return () => { + if (memo === undefined) { + memo = fn(); + } + return memo; + }; +} diff --git a/lib/esm/hermesclient/client.d.ts b/lib/esm/hermesclient/client.d.ts new file mode 100644 index 0000000..3b30240 --- /dev/null +++ b/lib/esm/hermesclient/client.d.ts @@ -0,0 +1,75 @@ +import { ContentType, Message, MessageFromClient, CreateMailboxResponse, KeyValPair, MessageEnvelope, SendReceipt } from "./proto/wsmessages"; +export interface ContentTypeHandler { + readonly webSocketUrlPath: string; + sendMessageFromClient(mfc: MessageFromClient, ws: WebSocket): void; +} +export declare const ContentTypeHandler: { + Json: ContentTypeHandler; + Protobuf: ContentTypeHandler; +}; +export declare function newHermesClient(rootUrl: string, contentTypeHandler: ContentTypeHandler): HermesClient; +export interface ChangeDataCaptureEvent { + id: string; + schema: string; + table: string; + action: string; + data: any; + commitTime: string; +} +interface RawRpcRequest { + to: string; + endPoint: string; + body?: Uint8Array; + contentType?: ContentType; + headers?: KeyValPair[]; + state?: Uint8Array; +} +export declare class RpcRequestResponse { + correlationId: string; + sendReceiptEnvelope: MessageEnvelope | undefined; + sendReceipt: SendReceipt | undefined; + sentMessage: Message | undefined; + inboxEnvelope: MessageEnvelope | undefined; + inboxMessage: Message | undefined; + constructor(correlationId: string); + role(): string | undefined; + contentType(): ContentType; + isProtobuf(): boolean; + isJson(): boolean; + isClient(): boolean | undefined; + hasRequestAndResponse(): boolean; + timeStarted(): Date | undefined; + timeStartedL(): number | undefined; + timeCompleted(): Date | undefined; + durationInMillis(): number | undefined; + endPoint(): string | undefined; + requestMessage(): Message | undefined; + requestEnvelope(): MessageEnvelope | undefined; + responseMessage(): Message | undefined; + responseEnvelope(): MessageEnvelope | undefined; + status(): string; + processSchema(reqOrResp: "request" | "response", data?: Uint8Array): Promise; + responseObj(): Promise; + requestObj(): Promise; +} +declare const GlobalClient: { + get: () => HermesClient; +}; +export default GlobalClient; +export declare function runHermesClientTest(): void; +export declare function runHermesClientTest2(): void; +export interface CdcSubscription { + tables: CdcTable[]; + startSeq?: string; +} +export interface CdcTable { + database: string; + table: string; +} +export interface HermesClient { + readonly rootUrl: string; + mailbox(): Promise; + rawRpcCall(request: RawRpcRequest): Promise; + cdcSubscribe(cdcs: CdcSubscription, listener: (cdcEvent: ChangeDataCaptureEvent, a: A) => void): void; + rpcObserverSubscribe(readerKey: string, listener: (correlation: RpcRequestResponse) => void): void; +} diff --git a/lib/esm/hermesclient/client.js b/lib/esm/hermesclient/client.js new file mode 100644 index 0000000..89bfec5 --- /dev/null +++ b/lib/esm/hermesclient/client.js @@ -0,0 +1,682 @@ +import { ContentType, Message, MessageFromClient, MessageToClient, CreateMailboxResponse, CreateMailboxRequest, RpcFrameType, SendReceipt, Ping, Pong, } from "./proto/wsmessages"; +import { memoize, undef } from "../Utils"; +const JsonContentTypeHandler = { + webSocketUrlPath: "/api/ws/send_receive_json", + sendMessageFromClient(mfc, ws) { + const obj = MessageFromClient.toJSON(mfc); + const jsonStr = JSON.stringify(obj); + ws.send(jsonStr); + } +}; +const ProtobufContentTypeHandler = { + webSocketUrlPath: "/api/ws/send_receive_proto", + sendMessageFromClient(mfc, ws) { + const bytes = MessageFromClient.encode(mfc).finish(); + ws.send(bytes); + } +}; +export const ContentTypeHandler = { + Json: JsonContentTypeHandler, + Protobuf: ProtobufContentTypeHandler, +}; +export function newHermesClient(rootUrl, contentTypeHandler) { + const hci = new HermesClientImpl(rootUrl, contentTypeHandler); + hci.mailbox().then((mbox) => { + const correlations = hci.correlations; + hci.channelMessageSubscribe({ + id: "rpc-inbox", + state: "rpc-inbox", + readerKey: mbox.readerKey, + channel: "rpc-inbox", + startSeq: "all" + }, (me, msg) => { + var _a, _b, _c, _d, _e, _f; + if (me.messageBytes) { + try { + const msg = Message.decode(me.messageBytes); + const endPoint = (_b = (_a = msg.header) === null || _a === void 0 ? void 0 : _a.rpcHeader) === null || _b === void 0 ? void 0 : _b.endPoint; + if (((_d = (_c = msg.header) === null || _c === void 0 ? void 0 : _c.rpcHeader) === null || _d === void 0 ? void 0 : _d.frameType) === RpcFrameType.Request && endPoint == "ping") { + hci.sendPongResponse(mbox, msg, endPoint); + } + else { + const correlationId = (_f = (_e = msg.header) === null || _e === void 0 ? void 0 : _e.rpcHeader) === null || _f === void 0 ? void 0 : _f.correlationId; + if (correlationId) { + const resolve = correlations.get(correlationId); + if (resolve !== undefined) { + resolve(msg); + } + correlations.delete(correlationId); + } + } + } + catch (e) { + console.error("error decoding message", e); + } + } + // noop since we are only interested in the correlationId for rpc and that happens in onMessage + }); + }); + // send ping every 30 seconds + setInterval(() => hci.sendPing(), 30 * 1000); + return hci; +} +/** + * Create the mailbox + * @param channels + * @param rootUrl + * @returns + */ +async function createMailbox(channels, rootUrl) { + const mbox = { + channels: channels, + privateMetadata: {}, + publicMetadata: {}, + purgeTimeoutInMillis: 0, + closeTimeoutInMillis: 0, + extraData: {}, + }; + const mboxObj = CreateMailboxRequest.toJSON(mbox); + const mboxJson = JSON.stringify(mboxObj); + let mailboxResponse = undefined; + const response = await fetch(`${rootUrl}/api/create_mailbox`, { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: mboxJson, + }); + if (response.ok) { + const responseJsonStr = await response.text(); + mailboxResponse = CreateMailboxResponse.fromJSON(JSON.parse(responseJsonStr)); + } + else { + throw new Error(`createMailbox failed with status ${response.status}`); + } + return mailboxResponse; +} +class Constants { +} +Constants.rpcInboxChannelName = "rpc-inbox"; +Constants.rpcSentChannelName = "rpc-sent"; +class HermesConnection { + constructor(clientImpl, mailbox, webSocket) { + this.clientImpl = clientImpl; + this.mailbox = mailbox; + this.webSocket = webSocket; + const self = this; + webSocket.onmessage = function (event) { + if (event.data instanceof ArrayBuffer) { + self.onWebSocketBinaryMessage(event.data); + } + else { + self.onWebSocketTextMessage(event.data); + } + }; + webSocket.onclose = function (event) { + console.log("HermesConnection websocket closed", event); + clientImpl.reconnect(); + }; + // resend un ack'ed messages + clientImpl.sentMessagesWaitingForAck.forEach((smr, idempotentId) => { + self.sendSendMessageRequest(smr, false); + }); + } + onWebSocketTextMessage(message) { + const jsonObj = JSON.parse(message); + const m2c = MessageToClient.fromJSON(jsonObj); + this.onMessageToClient(m2c); + } + onWebSocketBinaryMessage(message) { + const m2c = MessageToClient.decode(new Uint8Array(message)); + this.onMessageToClient(m2c); + } + onMessageToClient(m2c) { + var _a, _b, _c; + if (m2c.notification !== undefined) { + console.log("hermes client received notification " + m2c.notification, m2c.notification); + } + else if (m2c.messageEnvelope !== undefined) { + const me = m2c.messageEnvelope; + if (me.messageBytes === undefined) { + console.log("hermes client received empty messageEnvelope", m2c.messageEnvelope); + } + else { + const subscriptionId = (_a = me.serverEnvelope) === null || _a === void 0 ? void 0 : _a.subscriptionId; + if (subscriptionId) { + const activeSub = this.clientImpl.activeSubscriptions.get(subscriptionId); + if (activeSub) { + const startSeq = (_b = me.serverEnvelope) === null || _b === void 0 ? void 0 : _b.sequence; + if (startSeq) { + activeSub.protoRawSubscription.startSeq = String(startSeq); + } + activeSub.onMessageEvent(me); + } + } + } + } + else if (m2c.sendMessageResponse !== undefined) { + const id = (_c = m2c.sendMessageResponse) === null || _c === void 0 ? void 0 : _c.idempotentId; + if (id) { + this.clientImpl.sentMessagesWaitingForAck.delete(id); + } + console.log("hermes client received SendMessageResponse", m2c.sendMessageResponse); + } + else if (m2c.subscribeResponse !== undefined) { + console.log("hermes client received subscribeResponse", m2c.subscribeResponse); + } + else if (m2c.ping !== undefined) { + this.webSocket.send(JSON.stringify({ pong: {} })); + } + else if (m2c.pong !== undefined) { + console.log("hermes client received pong"); + } + } + sendMessageFromClient(mfc) { + console.log("sending websocket message", mfc); + this.clientImpl.contentTypeHandler.sendMessageFromClient(mfc, this.webSocket); + } + addActiveSubscription(activeSub) { + const listeners = this.clientImpl.activeSubscriptions.get(activeSub.subscriptionId); + if (listeners) { + throw Error(`subscriptionId ${activeSub.subscriptionId} is already subscribed`); + } + else { + this.clientImpl.activeSubscriptions.set(activeSub.subscriptionId, activeSub); + } + } + cdcSubscribe(cdcs, listener) { + const subscriptionId = "cdc-" + cdcs.tables.map((t) => t.database + "." + t.table).join("-"); + const protoCdcs = { + id: subscriptionId, + matchers: cdcs.tables, + startSeq: cdcs.startSeq, + }; + this.sendMessageFromClient({ subscribeRequest: { subscriptions: [{ changeDataCapture: protoCdcs }] } }); + function onMessage(msg) { + const json = new TextDecoder().decode(msg.messageBytes); + const cdcEvent = JSON.parse(json); + listener(cdcEvent, cdcEvent.data); + } + this.addActiveSubscription({ + subscriptionId: subscriptionId, + protoRawSubscription: protoCdcs, + onMessageEvent: onMessage, + protoSubscription: { changeDataCapture: protoCdcs } + }); + } + channelMessageSubscribe(ms, listener) { + this.rawChannelSubscribe(ms, Message.decode, listener); + } + channelSendReceiptSubscribe(ms, listener) { + this.rawChannelSubscribe(ms, SendReceipt.decode, listener); + } + rawChannelSubscribe(ms, decoder, listener) { + const subscriptionId = ms.id; + if (!subscriptionId) { + throw new Error("MailboxSubscription id is undefined"); + } + function onMessage(msg) { + if (msg.messageBytes === undefined) { + console.error("MessageEnvelope.messageBytes is undefined"); + return; + } + const a = decoder(msg.messageBytes); + listener(msg, a); + } + this.sendMessageFromClient({ subscribeRequest: { subscriptions: [{ mailbox: ms }] } }); + this.addActiveSubscription({ + subscriptionId: subscriptionId, + onMessageEvent: onMessage, + protoRawSubscription: ms, + protoSubscription: { mailbox: ms } + }); + } + sendPing() { + this.sendMessageFromClient({ ping: {} }); + } + sendSendMessageRequest(smr, registerForAck) { + if (registerForAck && smr.idempotentId) { + this.clientImpl.sentMessagesWaitingForAck.set(smr.idempotentId, smr); + } + this.sendMessageFromClient({ sendMessageRequest: smr }); + } + rawRpcCall(request) { + var _a; + const emptyBytes = new Uint8Array(0); + const correlationId = ((_a = this.mailbox.address) !== null && _a !== void 0 ? _a : "") + "-" + this.clientImpl.correlationIdCounter++; + const idempotentId = this.mailbox.address + correlationId; + const smr = { + channel: Constants.rpcInboxChannelName, + to: [request.to], + idempotentId: idempotentId, + message: { + header: { + rpcHeader: { + correlationId: correlationId, + endPoint: request.endPoint, + frameType: RpcFrameType.Request, + errorInfo: undefined, + }, + sender: this.mailbox.address, + contentType: request.contentType, + extraHeaders: request.headers, + senderSequence: 0, + }, + serverEnvelope: undefined, + senderEnvelope: { + created: Date.now(), + }, + data: request.body !== undefined ? request.body : emptyBytes, + }, + }; + const promise = new Promise((resolve, reject) => { + this.clientImpl.correlations.set(correlationId, resolve); + }); + this.sendSendMessageRequest(smr, true); + return promise; + } + rpcObserverSubscribe(readerKey, listener) { + console.log("rpcObserverSubscribe", readerKey); + const correlations = new Map(); + const msInbox = { + id: "rpc-inbox-" + readerKey, + readerKey: readerKey, + channel: "rpc-inbox", + startSeq: "first", + }; + this.channelMessageSubscribe(msInbox, (me, msg) => { + var _a, _b; + const correlationId = (_b = (_a = msg.header) === null || _a === void 0 ? void 0 : _a.rpcHeader) === null || _b === void 0 ? void 0 : _b.correlationId; + if (correlationId) { + var correlation = correlations.get(correlationId); + if (!correlation) { + correlation = new RpcRequestResponse(correlationId); + correlations.set(correlationId, correlation); + } + correlation.inboxEnvelope = me; + correlation.inboxMessage = msg; + listener(correlation); + } + }); + const msSent = { + id: "rpc-sent-" + readerKey, + readerKey: readerKey, + channel: "rpc-sent", + startSeq: "first", + }; + this.channelSendReceiptSubscribe(msSent, (me, sr) => { + var _a, _b, _c, _d, _e; + const msg = (_a = sr.request) === null || _a === void 0 ? void 0 : _a.message; + const correlationId = (_e = (_d = (_c = (_b = sr.request) === null || _b === void 0 ? void 0 : _b.message) === null || _c === void 0 ? void 0 : _c.header) === null || _d === void 0 ? void 0 : _d.rpcHeader) === null || _e === void 0 ? void 0 : _e.correlationId; + if (correlationId !== undefined) { + var correlation = correlations.get(correlationId); + if (correlation === undefined) { + correlation = new RpcRequestResponse(correlationId); + correlations.set(correlationId, correlation); + } + correlation.sentMessage = msg; + correlation.sendReceiptEnvelope = me; + correlation.sendReceipt = sr; + listener(correlation); + } + }); + } +} +class HermesClientImpl { + constructor(rootUrl, contentTypeHandler) { + this.correlationIdCounter = 0; + this.correlations = new Map(); + this.activeSubscriptions = new Map(); + this.sentMessagesWaitingForAck = new Map(); + const thisHermesClientImpl = this; + this.rootUrl = rootUrl; + this.contentTypeHandler = contentTypeHandler; + this.mailboxResponseP = createMailbox([Constants.rpcInboxChannelName, Constants.rpcSentChannelName], rootUrl); + var tempMailboxResponseP = this.mailboxResponseP; + var tempWsUrl = new URL(rootUrl); + tempWsUrl.protocol = tempWsUrl.protocol.replace("http", "ws"); + tempWsUrl.pathname = contentTypeHandler.webSocketUrlPath; + this.wsUrl = tempWsUrl.toString(); + this.currentConn = this.newHermesConnection(); + } + sendPongResponse(mbox, pingMsg, endPoint) { + var _a, _b, _c, _d, _e, _f; + const correlationId = (_b = (_a = pingMsg.header) === null || _a === void 0 ? void 0 : _a.rpcHeader) === null || _b === void 0 ? void 0 : _b.correlationId; + const sender = (_c = pingMsg === null || pingMsg === void 0 ? void 0 : pingMsg.header) === null || _c === void 0 ? void 0 : _c.sender; + const contentType = (_e = (_d = pingMsg === null || pingMsg === void 0 ? void 0 : pingMsg.header) === null || _d === void 0 ? void 0 : _d.contentType) !== null && _e !== void 0 ? _e : ContentType.UnspecifiedCT; + if (correlationId !== undefined && sender !== undefined) { + var ping = {}; + if (pingMsg.data !== undefined) { + if (contentType == ContentType.Json) { + ping = Ping.fromJSON(pingMsg.data); + } + else { + ping = Ping.decode(pingMsg.data); + } + } + const pong = { payload: ping.payload }; + var data; + if (contentType == ContentType.Json) { + data = new TextEncoder().encode(JSON.stringify(Pong.toJSON(pong))); + } + else { + data = Pong.encode(pong).finish(); + } + const idempotentId = mbox.address + correlationId; + const smr = { + channel: Constants.rpcInboxChannelName, + to: [sender], + idempotentId: idempotentId, + message: { + header: { + rpcHeader: { + correlationId: correlationId, + endPoint: endPoint, + frameType: RpcFrameType.SuccessResponse, + errorInfo: undefined, + }, + sender: mbox.address, + contentType: (_f = pingMsg === null || pingMsg === void 0 ? void 0 : pingMsg.header) === null || _f === void 0 ? void 0 : _f.contentType, + }, + serverEnvelope: undefined, + senderEnvelope: { + created: Date.now(), + }, + data: data, + }, + }; + this.withConn((conn) => { + conn.sendSendMessageRequest(smr, true); + }); + } + else { + console.log("ignoring ping no correlation id", pingMsg); + } + } + reconnect() { + this.currentConn = this.newHermesConnection(); + } + newHermesConnection() { + const outerThis = this; + return new Promise((resolve, reject) => { + this.mailboxResponseP.then((mbox) => { + var webSocket = new WebSocket(this.wsUrl); + webSocket.binaryType = "arraybuffer"; + webSocket.onopen = function (event) { + console.log("hermes client websocket opened, sending first message"); + const resubscriptions = Object.values(outerThis.activeSubscriptions).map((as) => { return as.protoSubscription; }); + // send first message + const firstMessage = { + senderInfo: { + readerKey: mbox.readerKey, + address: mbox.address, + }, + subscriptions: resubscriptions, + mailboxTimeoutInMs: 2 * 60 * 1000, // 2 minutes + }; + const mfc = { + firstMessage: firstMessage, + }; + console.log("sending first message"); + outerThis.contentTypeHandler.sendMessageFromClient(mfc, webSocket); + console.log("resolving promise"); + resolve(new HermesConnection(outerThis, mbox, webSocket)); + }; + }); + }); + } + mailbox() { + return this.mailboxResponseP; + } + async withConn(fn) { + return this.currentConn.then((conn) => fn(conn)); + } + async withConnP(fn) { + return this.currentConn.then((conn) => fn(conn)); + } + rawRpcCall(request) { + return this.withConnP((conn) => { + return conn.rawRpcCall(request); + }); + } + cdcSubscribe(cdcs, listener) { + this.withConn((conn) => { + conn.cdcSubscribe(cdcs, listener); + }); + } + rpcObserverSubscribe(readerKey, listener) { + console.log("outer rpcObserverSubscribe", readerKey); + this.withConn((conn) => { + console.log("inner rpcObserverSubscribe", readerKey); + conn.rpcObserverSubscribe(readerKey, listener); + }); + } + channelMessageSubscribe(ms, listener) { + this.withConn((conn) => { + conn.channelMessageSubscribe(ms, listener); + }); + } + channelSendReceiptSubscribe(ms, listener) { + this.withConn((conn) => { + conn.channelSendReceiptSubscribe(ms, listener); + }); + } + sendPing() { + this.withConn((conn) => { + conn.sendPing(); + }); + } +} +export class RpcRequestResponse { + constructor(correlationId) { + this.correlationId = correlationId; + } + role() { + const ic = this.isClient(); + if (ic) { + return "client"; + } + else if (ic === false) { + return "server"; + } + } + contentType() { + var _a, _b, _c, _d, _e, _f; + const contentType = (_f = (_c = (_b = (_a = this.requestMessage()) === null || _a === void 0 ? void 0 : _a.header) === null || _b === void 0 ? void 0 : _b.contentType) !== null && _c !== void 0 ? _c : (_e = (_d = this.responseMessage()) === null || _d === void 0 ? void 0 : _d.header) === null || _e === void 0 ? void 0 : _e.contentType) !== null && _f !== void 0 ? _f : ContentType.UnspecifiedCT; + return contentType; + } + isProtobuf() { + return this.contentType() === ContentType.Protobuf; + } + isJson() { + return this.contentType() === ContentType.Json; + } + isClient() { + var _a, _b, _c, _d, _e, _f; + const inboxFrameType = (_c = (_b = (_a = this.inboxMessage) === null || _a === void 0 ? void 0 : _a.header) === null || _b === void 0 ? void 0 : _b.rpcHeader) === null || _c === void 0 ? void 0 : _c.frameType; + const sentFrameType = (_f = (_e = (_d = this.sentMessage) === null || _d === void 0 ? void 0 : _d.header) === null || _e === void 0 ? void 0 : _e.rpcHeader) === null || _f === void 0 ? void 0 : _f.frameType; + if (sentFrameType === RpcFrameType.Request) { + return true; + } + else if (inboxFrameType === RpcFrameType.Request) { + return false; + } + } + hasRequestAndResponse() { + return this.sendReceiptEnvelope && this.inboxEnvelope ? true : false; + } + timeStarted() { + var _a, _b, _c, _d; + const ic = this.isClient(); + var time = undef(); + if (ic === true) { + time = (_b = (_a = this.sendReceiptEnvelope) === null || _a === void 0 ? void 0 : _a.serverEnvelope) === null || _b === void 0 ? void 0 : _b.created; + } + else if (ic === false) { + time = (_d = (_c = this.inboxEnvelope) === null || _c === void 0 ? void 0 : _c.serverEnvelope) === null || _d === void 0 ? void 0 : _d.created; + } + if (time) { + return new Date(time); + } + } + timeStartedL() { + var _a, _b, _c, _d; + const ic = this.isClient(); + var time = undef(); + if (ic === true) { + time = (_b = (_a = this.sendReceiptEnvelope) === null || _a === void 0 ? void 0 : _a.serverEnvelope) === null || _b === void 0 ? void 0 : _b.created; + } + else if (ic === false) { + time = (_d = (_c = this.inboxEnvelope) === null || _c === void 0 ? void 0 : _c.serverEnvelope) === null || _d === void 0 ? void 0 : _d.created; + } + return time; + } + timeCompleted() { + var _a, _b, _c, _d; + const ic = this.isClient(); + var time = undefined; + if (ic === false) { + time = (_b = (_a = this.sendReceiptEnvelope) === null || _a === void 0 ? void 0 : _a.serverEnvelope) === null || _b === void 0 ? void 0 : _b.created; + } + else if (ic === true) { + time = (_d = (_c = this.inboxEnvelope) === null || _c === void 0 ? void 0 : _c.serverEnvelope) === null || _d === void 0 ? void 0 : _d.created; + } + if (time) { + return new Date(time); + } + } + durationInMillis() { + var _a, _b; + const ts = (_a = this.timeStarted()) === null || _a === void 0 ? void 0 : _a.getTime(); + const tc = (_b = this.timeCompleted()) === null || _b === void 0 ? void 0 : _b.getTime(); + if (ts && tc) { + return tc - ts; + } + } + endPoint() { + var _a, _b, _c; + return (_c = (_b = (_a = this.requestMessage()) === null || _a === void 0 ? void 0 : _a.header) === null || _b === void 0 ? void 0 : _b.rpcHeader) === null || _c === void 0 ? void 0 : _c.endPoint; + } + requestMessage() { + const ic = this.isClient(); + if (ic === true) { + return this.sentMessage; + } + else if (ic === false) { + return this.inboxMessage; + } + } + requestEnvelope() { + const ic = this.isClient(); + if (ic === true) { + return this.sendReceiptEnvelope; + } + else if (ic === false) { + return this.inboxEnvelope; + } + } + responseMessage() { + const ic = this.isClient(); + if (ic === true) { + return this.inboxMessage; + } + else if (ic === false) { + return this.sentMessage; + } + } + responseEnvelope() { + const ic = this.isClient(); + if (ic === true) { + return this.inboxEnvelope; + } + else if (ic === false) { + return this.sendReceiptEnvelope; + } + } + status() { + var _a, _b, _c; + const frameType = (_c = (_b = (_a = this.responseMessage()) === null || _a === void 0 ? void 0 : _a.header) === null || _b === void 0 ? void 0 : _b.rpcHeader) === null || _c === void 0 ? void 0 : _c.frameType; + if (!frameType) { + return ""; + } + else if (frameType === RpcFrameType.ErrorResponse) { + return "error"; + } + else if (frameType === RpcFrameType.SuccessResponse) { + return "success"; + } + else { + return `Unexpected frame types ${frameType}`; + } + } + async processSchema(reqOrResp, data) { + if (this.isJson()) { + const jsonStr = new TextDecoder().decode(data); + return JSON.parse(jsonStr); + } + else { + const endPoint = this.endPoint(); + if (endPoint === undefined) { + return { + "error": "no endpoint" + }; + } + if (data === undefined) { + return {}; + } + return protobufToJson(endPoint, reqOrResp, data); + } + } + async responseObj() { + var _a; + return this.processSchema("response", (_a = this.responseMessage()) === null || _a === void 0 ? void 0 : _a.data); + } + async requestObj() { + var _a; + return this.processSchema("request", (_a = this.requestMessage()) === null || _a === void 0 ? void 0 : _a.data); + } +} +const GlobalClient = { + get: memoize(() => newHermesClient("https://hermes-go.ahsrcm.com", JsonContentTypeHandler)) +}; +export default GlobalClient; +export function runHermesClientTest() { +} +export function runHermesClientTest2() { + // const hc = newHermesClient("https://hermes-go.ahsrcm.com", ContentType.Protobuf); + const hc = newHermesClient("https://hermes-go.ahsrcm.com", JsonContentTypeHandler); + hc.mailbox().then((mbox) => { + const cdcs = { + tables: [ + { + database: "nefario", + table: "service", + }, + ], + startSeq: "new", + }; + hc.cdcSubscribe(cdcs, (cdcEvent, a) => { + console.log("cdcEvent", cdcEvent); + }); + }); + // hc.correlatedRpcReader("rrb07167144dc644a0be22a85301afea7e" , (correlation) => { + // console.log("correlation", correlation); + // }); +} +async function protobufToJson(schemaName, frametype, bytes) { + // const mboxObj = CreateMailboxRequest.toJSON(mbox); + // const mboxJson = JSON.stringify(mboxObj); + // let mailboxResponse: CreateMailboxResponse | undefined = undefined; + const rootUrl = GlobalClient.get().rootUrl; + const response = await fetch(`${rootUrl}/api/proto_to_json?schema=${schemaName}&frametype=${frametype}`, { + method: "POST", + body: bytes, + }); + if (response.ok) { + const jsonStr = await response.text(); + return JSON.parse(jsonStr); + } + else { + throw new Error(`proto_to_json failed with status ${response.status}`); + } +} diff --git a/lib/esm/hermesclient/google/protobuf/struct.d.ts b/lib/esm/hermesclient/google/protobuf/struct.d.ts new file mode 100644 index 0000000..8fa6281 --- /dev/null +++ b/lib/esm/hermesclient/google/protobuf/struct.d.ts @@ -0,0 +1,201 @@ +import * as _m0 from "../../../../node_modules/protobufjs/minimal"; +export declare const protobufPackage = "google.protobuf"; +/** + * `NullValue` is a singleton enumeration to represent the null value for the + * `Value` type union. + * + * The JSON representation for `NullValue` is JSON `null`. + */ +export declare enum NullValue { + /** NULL_VALUE - Null value. */ + NULL_VALUE = 0, + UNRECOGNIZED = -1 +} +export declare function nullValueFromJSON(object: any): NullValue; +export declare function nullValueToJSON(object: NullValue): string; +/** + * `Struct` represents a structured data value, consisting of fields + * which map to dynamically typed values. In some languages, `Struct` + * might be supported by a native representation. For example, in + * scripting languages like JS a struct is represented as an + * object. The details of that representation are described together + * with the proto support for the language. + * + * The JSON representation for `Struct` is JSON object. + */ +export interface Struct { + /** Unordered map of dynamically typed values. */ + fields: { + [key: string]: any | undefined; + }; +} +export interface Struct_FieldsEntry { + key: string; + value: any | undefined; +} +/** + * `Value` represents a dynamically typed value which can be either + * null, a number, a string, a boolean, a recursive struct value, or a + * list of values. A producer of value is expected to set one of these + * variants. Absence of any variant indicates an error. + * + * The JSON representation for `Value` is JSON value. + */ +export interface Value { + /** Represents a null value. */ + nullValue?: NullValue | undefined; + /** Represents a double value. */ + numberValue?: number | undefined; + /** Represents a string value. */ + stringValue?: string | undefined; + /** Represents a boolean value. */ + boolValue?: boolean | undefined; + /** Represents a structured value. */ + structValue?: { + [key: string]: any; + } | undefined; + /** Represents a repeated `Value`. */ + listValue?: Array | undefined; +} +/** + * `ListValue` is a wrapper around a repeated field of values. + * + * The JSON representation for `ListValue` is JSON array. + */ +export interface ListValue { + /** Repeated field of dynamically typed values. */ + values: any[]; +} +export declare const Struct: { + encode(message: Struct, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): Struct; + fromJSON(object: any): Struct; + toJSON(message: Struct): unknown; + create]: never; }) | undefined; + } & { [K_1 in Exclude]: never; }>(base?: I): Struct; + fromPartial]: never; }) | undefined; + } & { [K_3 in Exclude]: never; }>(object: I_1): Struct; + wrap(object: { + [key: string]: any; + } | undefined): Struct; + unwrap(message: Struct): { + [key: string]: any; + }; +}; +export declare const Struct_FieldsEntry: { + encode(message: Struct_FieldsEntry, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): Struct_FieldsEntry; + fromJSON(object: any): Struct_FieldsEntry; + toJSON(message: Struct_FieldsEntry): unknown; + create]: never; }>(base?: I): Struct_FieldsEntry; + fromPartial]: never; }>(object: I_1): Struct_FieldsEntry; +}; +export declare const Value: { + encode(message: Value, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): Value; + fromJSON(object: any): Value; + toJSON(message: Value): unknown; + create]: never; }) | undefined; + listValue?: (any[] & any[] & { [K_1 in Exclude]: never; }) | undefined; + } & { [K_2 in Exclude]: never; }>(base?: I): Value; + fromPartial]: never; }) | undefined; + listValue?: (any[] & any[] & { [K_4 in Exclude]: never; }) | undefined; + } & { [K_5 in Exclude]: never; }>(object: I_1): Value; + wrap(value: any): Value; + unwrap(message: any): string | number | boolean | Object | null | Array | undefined; +}; +export declare const ListValue: { + encode(message: ListValue, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): ListValue; + fromJSON(object: any): ListValue; + toJSON(message: ListValue): unknown; + create]: never; }) | undefined; + } & { [K_1 in Exclude]: never; }>(base?: I): ListValue; + fromPartial]: never; }) | undefined; + } & { [K_3 in Exclude]: never; }>(object: I_1): ListValue; + wrap(array: Array | undefined): ListValue; + unwrap(message: ListValue): Array; +}; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin ? P : P & { + [K in keyof P]: Exact; +} & { + [K in Exclude>]: never; +}; +export {}; diff --git a/lib/esm/hermesclient/google/protobuf/struct.js b/lib/esm/hermesclient/google/protobuf/struct.js new file mode 100644 index 0000000..b889d81 --- /dev/null +++ b/lib/esm/hermesclient/google/protobuf/struct.js @@ -0,0 +1,441 @@ +/* eslint-disable */ +import * as _m0 from "../../../../node_modules/protobufjs/minimal"; +export const protobufPackage = "google.protobuf"; +/** + * `NullValue` is a singleton enumeration to represent the null value for the + * `Value` type union. + * + * The JSON representation for `NullValue` is JSON `null`. + */ +export var NullValue; +(function (NullValue) { + /** NULL_VALUE - Null value. */ + NullValue[NullValue["NULL_VALUE"] = 0] = "NULL_VALUE"; + NullValue[NullValue["UNRECOGNIZED"] = -1] = "UNRECOGNIZED"; +})(NullValue || (NullValue = {})); +export function nullValueFromJSON(object) { + switch (object) { + case 0: + case "NULL_VALUE": + return NullValue.NULL_VALUE; + case -1: + case "UNRECOGNIZED": + default: + return NullValue.UNRECOGNIZED; + } +} +export function nullValueToJSON(object) { + switch (object) { + case NullValue.NULL_VALUE: + return "NULL_VALUE"; + case NullValue.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +function createBaseStruct() { + return { fields: {} }; +} +export const Struct = { + encode(message, writer = _m0.Writer.create()) { + Object.entries(message.fields).forEach(([key, value]) => { + if (value !== undefined) { + Struct_FieldsEntry.encode({ key: key, value }, writer.uint32(10).fork()).ldelim(); + } + }); + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStruct(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + const entry1 = Struct_FieldsEntry.decode(reader, reader.uint32()); + if (entry1.value !== undefined) { + message.fields[entry1.key] = entry1.value; + } + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + fields: isObject(object.fields) + ? Object.entries(object.fields).reduce((acc, [key, value]) => { + acc[key] = value; + return acc; + }, {}) + : {}, + }; + }, + toJSON(message) { + const obj = {}; + if (message.fields) { + const entries = Object.entries(message.fields); + if (entries.length > 0) { + obj.fields = {}; + entries.forEach(([k, v]) => { + obj.fields[k] = v; + }); + } + } + return obj; + }, + create(base) { + return Struct.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a; + const message = createBaseStruct(); + message.fields = Object.entries((_a = object.fields) !== null && _a !== void 0 ? _a : {}).reduce((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = value; + } + return acc; + }, {}); + return message; + }, + wrap(object) { + const struct = createBaseStruct(); + if (object !== undefined) { + Object.keys(object).forEach((key) => { + struct.fields[key] = object[key]; + }); + } + return struct; + }, + unwrap(message) { + const object = {}; + if (message.fields) { + Object.keys(message.fields).forEach((key) => { + object[key] = message.fields[key]; + }); + } + return object; + }, +}; +function createBaseStruct_FieldsEntry() { + return { key: "", value: undefined }; +} +export const Struct_FieldsEntry = { + encode(message, writer = _m0.Writer.create()) { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + Value.encode(Value.wrap(message.value), writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStruct_FieldsEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + message.key = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + message.value = Value.unwrap(Value.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object === null || object === void 0 ? void 0 : object.value) ? object.value : undefined, + }; + }, + toJSON(message) { + const obj = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== undefined) { + obj.value = message.value; + } + return obj; + }, + create(base) { + return Struct_FieldsEntry.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a, _b; + const message = createBaseStruct_FieldsEntry(); + message.key = (_a = object.key) !== null && _a !== void 0 ? _a : ""; + message.value = (_b = object.value) !== null && _b !== void 0 ? _b : undefined; + return message; + }, +}; +function createBaseValue() { + return { + nullValue: undefined, + numberValue: undefined, + stringValue: undefined, + boolValue: undefined, + structValue: undefined, + listValue: undefined, + }; +} +export const Value = { + encode(message, writer = _m0.Writer.create()) { + if (message.nullValue !== undefined) { + writer.uint32(8).int32(message.nullValue); + } + if (message.numberValue !== undefined) { + writer.uint32(17).double(message.numberValue); + } + if (message.stringValue !== undefined) { + writer.uint32(26).string(message.stringValue); + } + if (message.boolValue !== undefined) { + writer.uint32(32).bool(message.boolValue); + } + if (message.structValue !== undefined) { + Struct.encode(Struct.wrap(message.structValue), writer.uint32(42).fork()).ldelim(); + } + if (message.listValue !== undefined) { + ListValue.encode(ListValue.wrap(message.listValue), writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValue(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + message.nullValue = reader.int32(); + continue; + case 2: + if (tag !== 17) { + break; + } + message.numberValue = reader.double(); + continue; + case 3: + if (tag !== 26) { + break; + } + message.stringValue = reader.string(); + continue; + case 4: + if (tag !== 32) { + break; + } + message.boolValue = reader.bool(); + continue; + case 5: + if (tag !== 42) { + break; + } + message.structValue = Struct.unwrap(Struct.decode(reader, reader.uint32())); + continue; + case 6: + if (tag !== 50) { + break; + } + message.listValue = ListValue.unwrap(ListValue.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + nullValue: isSet(object.nullValue) ? nullValueFromJSON(object.nullValue) : undefined, + numberValue: isSet(object.numberValue) ? globalThis.Number(object.numberValue) : undefined, + stringValue: isSet(object.stringValue) ? globalThis.String(object.stringValue) : undefined, + boolValue: isSet(object.boolValue) ? globalThis.Boolean(object.boolValue) : undefined, + structValue: isObject(object.structValue) ? object.structValue : undefined, + listValue: globalThis.Array.isArray(object.listValue) ? [...object.listValue] : undefined, + }; + }, + toJSON(message) { + const obj = {}; + if (message.nullValue !== undefined) { + obj.nullValue = nullValueToJSON(message.nullValue); + } + if (message.numberValue !== undefined) { + obj.numberValue = message.numberValue; + } + if (message.stringValue !== undefined) { + obj.stringValue = message.stringValue; + } + if (message.boolValue !== undefined) { + obj.boolValue = message.boolValue; + } + if (message.structValue !== undefined) { + obj.structValue = message.structValue; + } + if (message.listValue !== undefined) { + obj.listValue = message.listValue; + } + return obj; + }, + create(base) { + return Value.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a, _b, _c, _d, _e, _f; + const message = createBaseValue(); + message.nullValue = (_a = object.nullValue) !== null && _a !== void 0 ? _a : undefined; + message.numberValue = (_b = object.numberValue) !== null && _b !== void 0 ? _b : undefined; + message.stringValue = (_c = object.stringValue) !== null && _c !== void 0 ? _c : undefined; + message.boolValue = (_d = object.boolValue) !== null && _d !== void 0 ? _d : undefined; + message.structValue = (_e = object.structValue) !== null && _e !== void 0 ? _e : undefined; + message.listValue = (_f = object.listValue) !== null && _f !== void 0 ? _f : undefined; + return message; + }, + wrap(value) { + const result = createBaseValue(); + if (value === null) { + result.nullValue = NullValue.NULL_VALUE; + } + else if (typeof value === "boolean") { + result.boolValue = value; + } + else if (typeof value === "number") { + result.numberValue = value; + } + else if (typeof value === "string") { + result.stringValue = value; + } + else if (globalThis.Array.isArray(value)) { + result.listValue = value; + } + else if (typeof value === "object") { + result.structValue = value; + } + else if (typeof value !== "undefined") { + throw new globalThis.Error("Unsupported any value type: " + typeof value); + } + return result; + }, + unwrap(message) { + if (message.stringValue !== undefined) { + return message.stringValue; + } + else if ((message === null || message === void 0 ? void 0 : message.numberValue) !== undefined) { + return message.numberValue; + } + else if ((message === null || message === void 0 ? void 0 : message.boolValue) !== undefined) { + return message.boolValue; + } + else if ((message === null || message === void 0 ? void 0 : message.structValue) !== undefined) { + return message.structValue; + } + else if ((message === null || message === void 0 ? void 0 : message.listValue) !== undefined) { + return message.listValue; + } + else if ((message === null || message === void 0 ? void 0 : message.nullValue) !== undefined) { + return null; + } + return undefined; + }, +}; +function createBaseListValue() { + return { values: [] }; +} +export const ListValue = { + encode(message, writer = _m0.Writer.create()) { + for (const v of message.values) { + Value.encode(Value.wrap(v), writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListValue(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + message.values.push(Value.unwrap(Value.decode(reader, reader.uint32()))); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { values: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.values) ? [...object.values] : [] }; + }, + toJSON(message) { + var _a; + const obj = {}; + if ((_a = message.values) === null || _a === void 0 ? void 0 : _a.length) { + obj.values = message.values; + } + return obj; + }, + create(base) { + return ListValue.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a; + const message = createBaseListValue(); + message.values = ((_a = object.values) === null || _a === void 0 ? void 0 : _a.map((e) => e)) || []; + return message; + }, + wrap(array) { + const result = createBaseListValue(); + result.values = array !== null && array !== void 0 ? array : []; + return result; + }, + unwrap(message) { + if ((message === null || message === void 0 ? void 0 : message.hasOwnProperty("values")) && globalThis.Array.isArray(message.values)) { + return message.values; + } + else { + return message; + } + }, +}; +function isObject(value) { + return typeof value === "object" && value !== null; +} +function isSet(value) { + return value !== null && value !== undefined; +} diff --git a/lib/esm/hermesclient/proto/wsmessages.d.ts b/lib/esm/hermesclient/proto/wsmessages.d.ts new file mode 100644 index 0000000..aa09aa0 --- /dev/null +++ b/lib/esm/hermesclient/proto/wsmessages.d.ts @@ -0,0 +1,4566 @@ +import * as _m0 from "../../../node_modules/protobufjs/minimal"; +import { Observable } from "../../../node_modules/rxjs/dist/types/index"; +export declare const protobufPackage = "hermes"; +export declare enum RpcFrameType { + UnspecifiedRFT = 0, + Request = 1, + SuccessResponse = 2, + ErrorResponse = 3, + UNRECOGNIZED = -1 +} +export declare function rpcFrameTypeFromJSON(object: any): RpcFrameType; +export declare function rpcFrameTypeToJSON(object: RpcFrameType): string; +export declare enum ContentType { + UnspecifiedCT = 0, + Protobuf = 1, + Json = 2, + Binary = 3, + Text = 4, + UNRECOGNIZED = -1 +} +export declare function contentTypeFromJSON(object: any): ContentType; +export declare function contentTypeToJSON(object: ContentType): string; +export interface MessageFromClient { + sendMessageRequest?: SendMessageRequest | undefined; + firstMessage?: FirstMessage | undefined; + ping?: Ping | undefined; + pong?: Pong | undefined; + notification?: Notification | undefined; + subscribeRequest?: SubscribeRequest | undefined; +} +export interface Notification { + message?: string | undefined; +} +export interface MessageToClient { + messageEnvelope?: MessageEnvelope | undefined; + sendMessageResponse?: SendMessageResponse | undefined; + ping?: Ping | undefined; + pong?: Pong | undefined; + notification?: Notification | undefined; + subscribeResponse?: SubscribeResponse | undefined; +} +export interface Ping { + payload?: Uint8Array | undefined; +} +export interface Pong { + payload?: Uint8Array | undefined; +} +export interface MessageHeader { + sender?: string | undefined; + contentType?: ContentType | undefined; + rpcHeader?: RpcHeader | undefined; + senderSequence?: number | undefined; + extraHeaders?: KeyValPair[] | undefined; +} +export interface SenderEnvelope { + created?: number | undefined; +} +export interface ServerEnvelope { + sequence?: number | undefined; + created?: number | undefined; + channel?: string | undefined; + subscriptionId?: string | undefined; +} +export interface KeyValPair { + key?: string | undefined; + val?: string | undefined; +} +export interface RpcHeader { + correlationId?: string | undefined; + endPoint?: string | undefined; + frameType?: RpcFrameType | undefined; + errorInfo?: RpcErrorInfo | undefined; +} +export interface RpcErrorInfo { + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; +} +export interface Message { + header?: MessageHeader | undefined; + senderEnvelope?: SenderEnvelope | undefined; + serverEnvelope?: ServerEnvelope | undefined; + data?: Uint8Array | undefined; +} +export interface MessageEnvelope { + messageBytes?: Uint8Array | undefined; + serverEnvelope?: ServerEnvelope | undefined; +} +export interface SendMessageRequest { + to?: string[] | undefined; + message?: Message | undefined; + channel?: string | undefined; + idempotentId?: string | undefined; +} +export interface SendMessageResponse { + errors?: SendMessageError[] | undefined; + duplicates?: string[] | undefined; + idempotentId?: string | undefined; + correlationId?: string | undefined; +} +export interface SendReceipt { + request?: SendMessageRequest | undefined; + response?: SendMessageResponse | undefined; + serverEnvelope?: ServerEnvelope | undefined; +} +export interface SendMessageError { + message?: string | undefined; + to?: string | undefined; +} +export interface FirstMessage { + senderInfo?: SenderInfo | undefined; + mailboxTimeoutInMs?: number | undefined; + subscriptions?: Subscription[] | undefined; +} +export interface SenderInfo { + readerKey?: string | undefined; + address?: string | undefined; +} +export interface SubscribeRequest { + subscriptions?: Subscription[] | undefined; +} +export interface SubscribeResponse { + succeeded?: string[] | undefined; + errors?: SubscribeError[] | undefined; +} +export interface SubscribeError { + state?: string | undefined; + message?: string | undefined; +} +export interface Subscription { + mailbox?: MailboxSubscription | undefined; + nefario?: NefarioSubscription | undefined; + changeDataCapture?: ChangeDataCaptureSubscription | undefined; + unsubscribe?: Unsubscribe | undefined; +} +export interface MailboxSubscription { + id?: string | undefined; + state?: string | undefined; + readerKey?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; +} +export interface ChangeDataCaptureSubscription { + id?: string | undefined; + state?: string | undefined; + matchers?: RecordMatcher[] | undefined; + startSeq?: string | undefined; +} +export interface RecordMatcher { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; +} +export interface NefarioSubscription { + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; +} +export interface Unsubscribe { + id?: string | undefined; +} +export interface CreateMailboxRequest { + channels?: string[] | undefined; + privateMetadata?: { + [key: string]: any; + } | undefined; + publicMetadata?: { + [key: string]: any; + } | undefined; + purgeTimeoutInMillis?: number | undefined; + closeTimeoutInMillis?: number | undefined; + extraData?: { + [key: string]: any; + } | undefined; +} +export interface CreateMailboxResponse { + adminKey?: string | undefined; + address?: string | undefined; + readerKey?: string | undefined; + channels?: string[] | undefined; +} +export interface AddChannelRequest { + adminKey?: string | undefined; + channels?: string[] | undefined; +} +export interface AddChannelResponse { +} +export declare const MessageFromClient: { + encode(message: MessageFromClient, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): MessageFromClient; + fromJSON(object: any): MessageFromClient; + toJSON(message: MessageFromClient): unknown; + create]: never; }) | undefined; + message?: ({ + header?: { + sender?: string | undefined; + contentType?: ContentType | undefined; + rpcHeader?: { + correlationId?: string | undefined; + endPoint?: string | undefined; + frameType?: RpcFrameType | undefined; + errorInfo?: { + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } | undefined; + } | undefined; + senderSequence?: number | undefined; + extraHeaders?: { + key?: string | undefined; + val?: string | undefined; + }[] | undefined; + } | undefined; + senderEnvelope?: { + created?: number | undefined; + } | undefined; + serverEnvelope?: { + sequence?: number | undefined; + created?: number | undefined; + channel?: string | undefined; + subscriptionId?: string | undefined; + } | undefined; + data?: Uint8Array | undefined; + } & { + header?: ({ + sender?: string | undefined; + contentType?: ContentType | undefined; + rpcHeader?: { + correlationId?: string | undefined; + endPoint?: string | undefined; + frameType?: RpcFrameType | undefined; + errorInfo?: { + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } | undefined; + } | undefined; + senderSequence?: number | undefined; + extraHeaders?: { + key?: string | undefined; + val?: string | undefined; + }[] | undefined; + } & { + sender?: string | undefined; + contentType?: ContentType | undefined; + rpcHeader?: ({ + correlationId?: string | undefined; + endPoint?: string | undefined; + frameType?: RpcFrameType | undefined; + errorInfo?: { + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } | undefined; + } & { + correlationId?: string | undefined; + endPoint?: string | undefined; + frameType?: RpcFrameType | undefined; + errorInfo?: ({ + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } & { + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } & { [K_1 in Exclude]: never; }) | undefined; + } & { [K_2 in Exclude]: never; }) | undefined; + senderSequence?: number | undefined; + extraHeaders?: ({ + key?: string | undefined; + val?: string | undefined; + }[] & ({ + key?: string | undefined; + val?: string | undefined; + } & { + key?: string | undefined; + val?: string | undefined; + } & { [K_3 in Exclude]: never; })[] & { [K_4 in Exclude]: never; }) | undefined; + } & { [K_5 in Exclude]: never; }) | undefined; + senderEnvelope?: ({ + created?: number | undefined; + } & { + created?: number | undefined; + } & { [K_6 in Exclude]: never; }) | undefined; + serverEnvelope?: ({ + sequence?: number | undefined; + created?: number | undefined; + channel?: string | undefined; + subscriptionId?: string | undefined; + } & { + sequence?: number | undefined; + created?: number | undefined; + channel?: string | undefined; + subscriptionId?: string | undefined; + } & { [K_7 in Exclude]: never; }) | undefined; + data?: Uint8Array | undefined; + } & { [K_8 in Exclude]: never; }) | undefined; + channel?: string | undefined; + idempotentId?: string | undefined; + } & { [K_9 in Exclude]: never; }) | undefined; + firstMessage?: ({ + senderInfo?: { + readerKey?: string | undefined; + address?: string | undefined; + } | undefined; + mailboxTimeoutInMs?: number | undefined; + subscriptions?: { + mailbox?: { + id?: string | undefined; + state?: string | undefined; + readerKey?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + nefario?: { + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + changeDataCapture?: { + id?: string | undefined; + state?: string | undefined; + matchers?: { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] | undefined; + startSeq?: string | undefined; + } | undefined; + unsubscribe?: { + id?: string | undefined; + } | undefined; + }[] | undefined; + } & { + senderInfo?: ({ + readerKey?: string | undefined; + address?: string | undefined; + } & { + readerKey?: string | undefined; + address?: string | undefined; + } & { [K_10 in Exclude]: never; }) | undefined; + mailboxTimeoutInMs?: number | undefined; + subscriptions?: ({ + mailbox?: { + id?: string | undefined; + state?: string | undefined; + readerKey?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + nefario?: { + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + changeDataCapture?: { + id?: string | undefined; + state?: string | undefined; + matchers?: { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] | undefined; + startSeq?: string | undefined; + } | undefined; + unsubscribe?: { + id?: string | undefined; + } | undefined; + }[] & ({ + mailbox?: { + id?: string | undefined; + state?: string | undefined; + readerKey?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + nefario?: { + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + changeDataCapture?: { + id?: string | undefined; + state?: string | undefined; + matchers?: { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] | undefined; + startSeq?: string | undefined; + } | undefined; + unsubscribe?: { + id?: string | undefined; + } | undefined; + } & { + mailbox?: ({ + id?: string | undefined; + state?: string | undefined; + readerKey?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { + id?: string | undefined; + state?: string | undefined; + readerKey?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { [K_11 in Exclude]: never; }) | undefined; + nefario?: ({ + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { [K_12 in Exclude]: never; }) | undefined; + changeDataCapture?: ({ + id?: string | undefined; + state?: string | undefined; + matchers?: { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] | undefined; + startSeq?: string | undefined; + } & { + id?: string | undefined; + state?: string | undefined; + matchers?: ({ + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] & ({ + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + } & { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: (any[] & any[] & { [K_13 in Exclude]: never; }) | undefined; + } & { [K_14 in Exclude]: never; })[] & { [K_15 in Exclude]: never; }) | undefined; + startSeq?: string | undefined; + } & { [K_16 in Exclude]: never; }) | undefined; + unsubscribe?: ({ + id?: string | undefined; + } & { + id?: string | undefined; + } & { [K_17 in Exclude]: never; }) | undefined; + } & { [K_18 in Exclude]: never; })[] & { [K_19 in Exclude]: never; }) | undefined; + } & { [K_20 in Exclude]: never; }) | undefined; + ping?: ({ + payload?: Uint8Array | undefined; + } & { + payload?: Uint8Array | undefined; + } & { [K_21 in Exclude]: never; }) | undefined; + pong?: ({ + payload?: Uint8Array | undefined; + } & { + payload?: Uint8Array | undefined; + } & { [K_22 in Exclude]: never; }) | undefined; + notification?: ({ + message?: string | undefined; + } & { + message?: string | undefined; + } & { [K_23 in Exclude]: never; }) | undefined; + subscribeRequest?: ({ + subscriptions?: { + mailbox?: { + id?: string | undefined; + state?: string | undefined; + readerKey?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + nefario?: { + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + changeDataCapture?: { + id?: string | undefined; + state?: string | undefined; + matchers?: { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] | undefined; + startSeq?: string | undefined; + } | undefined; + unsubscribe?: { + id?: string | undefined; + } | undefined; + }[] | undefined; + } & { + subscriptions?: ({ + mailbox?: { + id?: string | undefined; + state?: string | undefined; + readerKey?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + nefario?: { + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + changeDataCapture?: { + id?: string | undefined; + state?: string | undefined; + matchers?: { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] | undefined; + startSeq?: string | undefined; + } | undefined; + unsubscribe?: { + id?: string | undefined; + } | undefined; + }[] & ({ + mailbox?: { + id?: string | undefined; + state?: string | undefined; + readerKey?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + nefario?: { + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + changeDataCapture?: { + id?: string | undefined; + state?: string | undefined; + matchers?: { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] | undefined; + startSeq?: string | undefined; + } | undefined; + unsubscribe?: { + id?: string | undefined; + } | undefined; + } & { + mailbox?: ({ + id?: string | undefined; + state?: string | undefined; + readerKey?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { + id?: string | undefined; + state?: string | undefined; + readerKey?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { [K_24 in Exclude]: never; }) | undefined; + nefario?: ({ + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { [K_25 in Exclude]: never; }) | undefined; + changeDataCapture?: ({ + id?: string | undefined; + state?: string | undefined; + matchers?: { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] | undefined; + startSeq?: string | undefined; + } & { + id?: string | undefined; + state?: string | undefined; + matchers?: ({ + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] & ({ + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + } & { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: (any[] & any[] & { [K_26 in Exclude]: never; }) | undefined; + } & { [K_27 in Exclude]: never; })[] & { [K_28 in Exclude]: never; }) | undefined; + startSeq?: string | undefined; + } & { [K_29 in Exclude]: never; }) | undefined; + unsubscribe?: ({ + id?: string | undefined; + } & { + id?: string | undefined; + } & { [K_30 in Exclude]: never; }) | undefined; + } & { [K_31 in Exclude]: never; })[] & { [K_32 in Exclude]: never; }) | undefined; + } & { [K_33 in Exclude]: never; }) | undefined; + } & { [K_34 in Exclude]: never; }>(base?: I): MessageFromClient; + fromPartial]: never; }) | undefined; + message?: ({ + header?: { + sender?: string | undefined; + contentType?: ContentType | undefined; + rpcHeader?: { + correlationId?: string | undefined; + endPoint?: string | undefined; + frameType?: RpcFrameType | undefined; + errorInfo?: { + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } | undefined; + } | undefined; + senderSequence?: number | undefined; + extraHeaders?: { + key?: string | undefined; + val?: string | undefined; + }[] | undefined; + } | undefined; + senderEnvelope?: { + created?: number | undefined; + } | undefined; + serverEnvelope?: { + sequence?: number | undefined; + created?: number | undefined; + channel?: string | undefined; + subscriptionId?: string | undefined; + } | undefined; + data?: Uint8Array | undefined; + } & { + header?: ({ + sender?: string | undefined; + contentType?: ContentType | undefined; + rpcHeader?: { + correlationId?: string | undefined; + endPoint?: string | undefined; + frameType?: RpcFrameType | undefined; + errorInfo?: { + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } | undefined; + } | undefined; + senderSequence?: number | undefined; + extraHeaders?: { + key?: string | undefined; + val?: string | undefined; + }[] | undefined; + } & { + sender?: string | undefined; + contentType?: ContentType | undefined; + rpcHeader?: ({ + correlationId?: string | undefined; + endPoint?: string | undefined; + frameType?: RpcFrameType | undefined; + errorInfo?: { + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } | undefined; + } & { + correlationId?: string | undefined; + endPoint?: string | undefined; + frameType?: RpcFrameType | undefined; + errorInfo?: ({ + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } & { + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } & { [K_36 in Exclude]: never; }) | undefined; + } & { [K_37 in Exclude]: never; }) | undefined; + senderSequence?: number | undefined; + extraHeaders?: ({ + key?: string | undefined; + val?: string | undefined; + }[] & ({ + key?: string | undefined; + val?: string | undefined; + } & { + key?: string | undefined; + val?: string | undefined; + } & { [K_38 in Exclude]: never; })[] & { [K_39 in Exclude]: never; }) | undefined; + } & { [K_40 in Exclude]: never; }) | undefined; + senderEnvelope?: ({ + created?: number | undefined; + } & { + created?: number | undefined; + } & { [K_41 in Exclude]: never; }) | undefined; + serverEnvelope?: ({ + sequence?: number | undefined; + created?: number | undefined; + channel?: string | undefined; + subscriptionId?: string | undefined; + } & { + sequence?: number | undefined; + created?: number | undefined; + channel?: string | undefined; + subscriptionId?: string | undefined; + } & { [K_42 in Exclude]: never; }) | undefined; + data?: Uint8Array | undefined; + } & { [K_43 in Exclude]: never; }) | undefined; + channel?: string | undefined; + idempotentId?: string | undefined; + } & { [K_44 in Exclude]: never; }) | undefined; + firstMessage?: ({ + senderInfo?: { + readerKey?: string | undefined; + address?: string | undefined; + } | undefined; + mailboxTimeoutInMs?: number | undefined; + subscriptions?: { + mailbox?: { + id?: string | undefined; + state?: string | undefined; + readerKey?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + nefario?: { + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + changeDataCapture?: { + id?: string | undefined; + state?: string | undefined; + matchers?: { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] | undefined; + startSeq?: string | undefined; + } | undefined; + unsubscribe?: { + id?: string | undefined; + } | undefined; + }[] | undefined; + } & { + senderInfo?: ({ + readerKey?: string | undefined; + address?: string | undefined; + } & { + readerKey?: string | undefined; + address?: string | undefined; + } & { [K_45 in Exclude]: never; }) | undefined; + mailboxTimeoutInMs?: number | undefined; + subscriptions?: ({ + mailbox?: { + id?: string | undefined; + state?: string | undefined; + readerKey?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + nefario?: { + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + changeDataCapture?: { + id?: string | undefined; + state?: string | undefined; + matchers?: { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] | undefined; + startSeq?: string | undefined; + } | undefined; + unsubscribe?: { + id?: string | undefined; + } | undefined; + }[] & ({ + mailbox?: { + id?: string | undefined; + state?: string | undefined; + readerKey?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + nefario?: { + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + changeDataCapture?: { + id?: string | undefined; + state?: string | undefined; + matchers?: { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] | undefined; + startSeq?: string | undefined; + } | undefined; + unsubscribe?: { + id?: string | undefined; + } | undefined; + } & { + mailbox?: ({ + id?: string | undefined; + state?: string | undefined; + readerKey?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { + id?: string | undefined; + state?: string | undefined; + readerKey?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { [K_46 in Exclude]: never; }) | undefined; + nefario?: ({ + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { [K_47 in Exclude]: never; }) | undefined; + changeDataCapture?: ({ + id?: string | undefined; + state?: string | undefined; + matchers?: { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] | undefined; + startSeq?: string | undefined; + } & { + id?: string | undefined; + state?: string | undefined; + matchers?: ({ + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] & ({ + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + } & { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: (any[] & any[] & { [K_48 in Exclude]: never; }) | undefined; + } & { [K_49 in Exclude]: never; })[] & { [K_50 in Exclude]: never; }) | undefined; + startSeq?: string | undefined; + } & { [K_51 in Exclude]: never; }) | undefined; + unsubscribe?: ({ + id?: string | undefined; + } & { + id?: string | undefined; + } & { [K_52 in Exclude]: never; }) | undefined; + } & { [K_53 in Exclude]: never; })[] & { [K_54 in Exclude]: never; }) | undefined; + } & { [K_55 in Exclude]: never; }) | undefined; + ping?: ({ + payload?: Uint8Array | undefined; + } & { + payload?: Uint8Array | undefined; + } & { [K_56 in Exclude]: never; }) | undefined; + pong?: ({ + payload?: Uint8Array | undefined; + } & { + payload?: Uint8Array | undefined; + } & { [K_57 in Exclude]: never; }) | undefined; + notification?: ({ + message?: string | undefined; + } & { + message?: string | undefined; + } & { [K_58 in Exclude]: never; }) | undefined; + subscribeRequest?: ({ + subscriptions?: { + mailbox?: { + id?: string | undefined; + state?: string | undefined; + readerKey?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + nefario?: { + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + changeDataCapture?: { + id?: string | undefined; + state?: string | undefined; + matchers?: { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] | undefined; + startSeq?: string | undefined; + } | undefined; + unsubscribe?: { + id?: string | undefined; + } | undefined; + }[] | undefined; + } & { + subscriptions?: ({ + mailbox?: { + id?: string | undefined; + state?: string | undefined; + readerKey?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + nefario?: { + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + changeDataCapture?: { + id?: string | undefined; + state?: string | undefined; + matchers?: { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] | undefined; + startSeq?: string | undefined; + } | undefined; + unsubscribe?: { + id?: string | undefined; + } | undefined; + }[] & ({ + mailbox?: { + id?: string | undefined; + state?: string | undefined; + readerKey?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + nefario?: { + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + changeDataCapture?: { + id?: string | undefined; + state?: string | undefined; + matchers?: { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] | undefined; + startSeq?: string | undefined; + } | undefined; + unsubscribe?: { + id?: string | undefined; + } | undefined; + } & { + mailbox?: ({ + id?: string | undefined; + state?: string | undefined; + readerKey?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { + id?: string | undefined; + state?: string | undefined; + readerKey?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { [K_59 in Exclude]: never; }) | undefined; + nefario?: ({ + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { [K_60 in Exclude]: never; }) | undefined; + changeDataCapture?: ({ + id?: string | undefined; + state?: string | undefined; + matchers?: { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] | undefined; + startSeq?: string | undefined; + } & { + id?: string | undefined; + state?: string | undefined; + matchers?: ({ + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] & ({ + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + } & { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: (any[] & any[] & { [K_61 in Exclude]: never; }) | undefined; + } & { [K_62 in Exclude]: never; })[] & { [K_63 in Exclude]: never; }) | undefined; + startSeq?: string | undefined; + } & { [K_64 in Exclude]: never; }) | undefined; + unsubscribe?: ({ + id?: string | undefined; + } & { + id?: string | undefined; + } & { [K_65 in Exclude]: never; }) | undefined; + } & { [K_66 in Exclude]: never; })[] & { [K_67 in Exclude]: never; }) | undefined; + } & { [K_68 in Exclude]: never; }) | undefined; + } & { [K_69 in Exclude]: never; }>(object: I_1): MessageFromClient; +}; +export declare const Notification: { + encode(message: Notification, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): Notification; + fromJSON(object: any): Notification; + toJSON(message: Notification): unknown; + create]: never; }>(base?: I): Notification; + fromPartial]: never; }>(object: I_1): Notification; +}; +export declare const MessageToClient: { + encode(message: MessageToClient, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): MessageToClient; + fromJSON(object: any): MessageToClient; + toJSON(message: MessageToClient): unknown; + create]: never; }) | undefined; + } & { [K_1 in Exclude]: never; }) | undefined; + sendMessageResponse?: ({ + errors?: { + message?: string | undefined; + to?: string | undefined; + }[] | undefined; + duplicates?: string[] | undefined; + idempotentId?: string | undefined; + correlationId?: string | undefined; + } & { + errors?: ({ + message?: string | undefined; + to?: string | undefined; + }[] & ({ + message?: string | undefined; + to?: string | undefined; + } & { + message?: string | undefined; + to?: string | undefined; + } & { [K_2 in Exclude]: never; })[] & { [K_3 in Exclude]: never; }) | undefined; + duplicates?: (string[] & string[] & { [K_4 in Exclude]: never; }) | undefined; + idempotentId?: string | undefined; + correlationId?: string | undefined; + } & { [K_5 in Exclude]: never; }) | undefined; + ping?: ({ + payload?: Uint8Array | undefined; + } & { + payload?: Uint8Array | undefined; + } & { [K_6 in Exclude]: never; }) | undefined; + pong?: ({ + payload?: Uint8Array | undefined; + } & { + payload?: Uint8Array | undefined; + } & { [K_7 in Exclude]: never; }) | undefined; + notification?: ({ + message?: string | undefined; + } & { + message?: string | undefined; + } & { [K_8 in Exclude]: never; }) | undefined; + subscribeResponse?: ({ + succeeded?: string[] | undefined; + errors?: { + state?: string | undefined; + message?: string | undefined; + }[] | undefined; + } & { + succeeded?: (string[] & string[] & { [K_9 in Exclude]: never; }) | undefined; + errors?: ({ + state?: string | undefined; + message?: string | undefined; + }[] & ({ + state?: string | undefined; + message?: string | undefined; + } & { + state?: string | undefined; + message?: string | undefined; + } & { [K_10 in Exclude]: never; })[] & { [K_11 in Exclude]: never; }) | undefined; + } & { [K_12 in Exclude]: never; }) | undefined; + } & { [K_13 in Exclude]: never; }>(base?: I): MessageToClient; + fromPartial]: never; }) | undefined; + } & { [K_15 in Exclude]: never; }) | undefined; + sendMessageResponse?: ({ + errors?: { + message?: string | undefined; + to?: string | undefined; + }[] | undefined; + duplicates?: string[] | undefined; + idempotentId?: string | undefined; + correlationId?: string | undefined; + } & { + errors?: ({ + message?: string | undefined; + to?: string | undefined; + }[] & ({ + message?: string | undefined; + to?: string | undefined; + } & { + message?: string | undefined; + to?: string | undefined; + } & { [K_16 in Exclude]: never; })[] & { [K_17 in Exclude]: never; }) | undefined; + duplicates?: (string[] & string[] & { [K_18 in Exclude]: never; }) | undefined; + idempotentId?: string | undefined; + correlationId?: string | undefined; + } & { [K_19 in Exclude]: never; }) | undefined; + ping?: ({ + payload?: Uint8Array | undefined; + } & { + payload?: Uint8Array | undefined; + } & { [K_20 in Exclude]: never; }) | undefined; + pong?: ({ + payload?: Uint8Array | undefined; + } & { + payload?: Uint8Array | undefined; + } & { [K_21 in Exclude]: never; }) | undefined; + notification?: ({ + message?: string | undefined; + } & { + message?: string | undefined; + } & { [K_22 in Exclude]: never; }) | undefined; + subscribeResponse?: ({ + succeeded?: string[] | undefined; + errors?: { + state?: string | undefined; + message?: string | undefined; + }[] | undefined; + } & { + succeeded?: (string[] & string[] & { [K_23 in Exclude]: never; }) | undefined; + errors?: ({ + state?: string | undefined; + message?: string | undefined; + }[] & ({ + state?: string | undefined; + message?: string | undefined; + } & { + state?: string | undefined; + message?: string | undefined; + } & { [K_24 in Exclude]: never; })[] & { [K_25 in Exclude]: never; }) | undefined; + } & { [K_26 in Exclude]: never; }) | undefined; + } & { [K_27 in Exclude]: never; }>(object: I_1): MessageToClient; +}; +export declare const Ping: { + encode(message: Ping, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): Ping; + fromJSON(object: any): Ping; + toJSON(message: Ping): unknown; + create]: never; }>(base?: I): Ping; + fromPartial]: never; }>(object: I_1): Ping; +}; +export declare const Pong: { + encode(message: Pong, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): Pong; + fromJSON(object: any): Pong; + toJSON(message: Pong): unknown; + create]: never; }>(base?: I): Pong; + fromPartial]: never; }>(object: I_1): Pong; +}; +export declare const MessageHeader: { + encode(message: MessageHeader, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): MessageHeader; + fromJSON(object: any): MessageHeader; + toJSON(message: MessageHeader): unknown; + create]: never; }) | undefined; + } & { [K_1 in Exclude]: never; }) | undefined; + senderSequence?: number | undefined; + extraHeaders?: ({ + key?: string | undefined; + val?: string | undefined; + }[] & ({ + key?: string | undefined; + val?: string | undefined; + } & { + key?: string | undefined; + val?: string | undefined; + } & { [K_2 in Exclude]: never; })[] & { [K_3 in Exclude]: never; }) | undefined; + } & { [K_4 in Exclude]: never; }>(base?: I): MessageHeader; + fromPartial]: never; }) | undefined; + } & { [K_6 in Exclude]: never; }) | undefined; + senderSequence?: number | undefined; + extraHeaders?: ({ + key?: string | undefined; + val?: string | undefined; + }[] & ({ + key?: string | undefined; + val?: string | undefined; + } & { + key?: string | undefined; + val?: string | undefined; + } & { [K_7 in Exclude]: never; })[] & { [K_8 in Exclude]: never; }) | undefined; + } & { [K_9 in Exclude]: never; }>(object: I_1): MessageHeader; +}; +export declare const SenderEnvelope: { + encode(message: SenderEnvelope, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): SenderEnvelope; + fromJSON(object: any): SenderEnvelope; + toJSON(message: SenderEnvelope): unknown; + create]: never; }>(base?: I): SenderEnvelope; + fromPartial]: never; }>(object: I_1): SenderEnvelope; +}; +export declare const ServerEnvelope: { + encode(message: ServerEnvelope, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): ServerEnvelope; + fromJSON(object: any): ServerEnvelope; + toJSON(message: ServerEnvelope): unknown; + create]: never; }>(base?: I): ServerEnvelope; + fromPartial]: never; }>(object: I_1): ServerEnvelope; +}; +export declare const KeyValPair: { + encode(message: KeyValPair, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): KeyValPair; + fromJSON(object: any): KeyValPair; + toJSON(message: KeyValPair): unknown; + create]: never; }>(base?: I): KeyValPair; + fromPartial]: never; }>(object: I_1): KeyValPair; +}; +export declare const RpcHeader: { + encode(message: RpcHeader, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): RpcHeader; + fromJSON(object: any): RpcHeader; + toJSON(message: RpcHeader): unknown; + create]: never; }) | undefined; + } & { [K_1 in Exclude]: never; }>(base?: I): RpcHeader; + fromPartial]: never; }) | undefined; + } & { [K_3 in Exclude]: never; }>(object: I_1): RpcHeader; +}; +export declare const RpcErrorInfo: { + encode(message: RpcErrorInfo, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): RpcErrorInfo; + fromJSON(object: any): RpcErrorInfo; + toJSON(message: RpcErrorInfo): unknown; + create]: never; }>(base?: I): RpcErrorInfo; + fromPartial]: never; }>(object: I_1): RpcErrorInfo; +}; +export declare const Message: { + encode(message: Message, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): Message; + fromJSON(object: any): Message; + toJSON(message: Message): unknown; + create]: never; }) | undefined; + } & { [K_1 in Exclude]: never; }) | undefined; + senderSequence?: number | undefined; + extraHeaders?: ({ + key?: string | undefined; + val?: string | undefined; + }[] & ({ + key?: string | undefined; + val?: string | undefined; + } & { + key?: string | undefined; + val?: string | undefined; + } & { [K_2 in Exclude]: never; })[] & { [K_3 in Exclude]: never; }) | undefined; + } & { [K_4 in Exclude]: never; }) | undefined; + senderEnvelope?: ({ + created?: number | undefined; + } & { + created?: number | undefined; + } & { [K_5 in Exclude]: never; }) | undefined; + serverEnvelope?: ({ + sequence?: number | undefined; + created?: number | undefined; + channel?: string | undefined; + subscriptionId?: string | undefined; + } & { + sequence?: number | undefined; + created?: number | undefined; + channel?: string | undefined; + subscriptionId?: string | undefined; + } & { [K_6 in Exclude]: never; }) | undefined; + data?: Uint8Array | undefined; + } & { [K_7 in Exclude]: never; }>(base?: I): Message; + fromPartial]: never; }) | undefined; + } & { [K_9 in Exclude]: never; }) | undefined; + senderSequence?: number | undefined; + extraHeaders?: ({ + key?: string | undefined; + val?: string | undefined; + }[] & ({ + key?: string | undefined; + val?: string | undefined; + } & { + key?: string | undefined; + val?: string | undefined; + } & { [K_10 in Exclude]: never; })[] & { [K_11 in Exclude]: never; }) | undefined; + } & { [K_12 in Exclude]: never; }) | undefined; + senderEnvelope?: ({ + created?: number | undefined; + } & { + created?: number | undefined; + } & { [K_13 in Exclude]: never; }) | undefined; + serverEnvelope?: ({ + sequence?: number | undefined; + created?: number | undefined; + channel?: string | undefined; + subscriptionId?: string | undefined; + } & { + sequence?: number | undefined; + created?: number | undefined; + channel?: string | undefined; + subscriptionId?: string | undefined; + } & { [K_14 in Exclude]: never; }) | undefined; + data?: Uint8Array | undefined; + } & { [K_15 in Exclude]: never; }>(object: I_1): Message; +}; +export declare const MessageEnvelope: { + encode(message: MessageEnvelope, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): MessageEnvelope; + fromJSON(object: any): MessageEnvelope; + toJSON(message: MessageEnvelope): unknown; + create]: never; }) | undefined; + } & { [K_1 in Exclude]: never; }>(base?: I): MessageEnvelope; + fromPartial]: never; }) | undefined; + } & { [K_3 in Exclude]: never; }>(object: I_1): MessageEnvelope; +}; +export declare const SendMessageRequest: { + encode(message: SendMessageRequest, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): SendMessageRequest; + fromJSON(object: any): SendMessageRequest; + toJSON(message: SendMessageRequest): unknown; + create]: never; }) | undefined; + message?: ({ + header?: { + sender?: string | undefined; + contentType?: ContentType | undefined; + rpcHeader?: { + correlationId?: string | undefined; + endPoint?: string | undefined; + frameType?: RpcFrameType | undefined; + errorInfo?: { + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } | undefined; + } | undefined; + senderSequence?: number | undefined; + extraHeaders?: { + key?: string | undefined; + val?: string | undefined; + }[] | undefined; + } | undefined; + senderEnvelope?: { + created?: number | undefined; + } | undefined; + serverEnvelope?: { + sequence?: number | undefined; + created?: number | undefined; + channel?: string | undefined; + subscriptionId?: string | undefined; + } | undefined; + data?: Uint8Array | undefined; + } & { + header?: ({ + sender?: string | undefined; + contentType?: ContentType | undefined; + rpcHeader?: { + correlationId?: string | undefined; + endPoint?: string | undefined; + frameType?: RpcFrameType | undefined; + errorInfo?: { + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } | undefined; + } | undefined; + senderSequence?: number | undefined; + extraHeaders?: { + key?: string | undefined; + val?: string | undefined; + }[] | undefined; + } & { + sender?: string | undefined; + contentType?: ContentType | undefined; + rpcHeader?: ({ + correlationId?: string | undefined; + endPoint?: string | undefined; + frameType?: RpcFrameType | undefined; + errorInfo?: { + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } | undefined; + } & { + correlationId?: string | undefined; + endPoint?: string | undefined; + frameType?: RpcFrameType | undefined; + errorInfo?: ({ + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } & { + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } & { [K_1 in Exclude]: never; }) | undefined; + } & { [K_2 in Exclude]: never; }) | undefined; + senderSequence?: number | undefined; + extraHeaders?: ({ + key?: string | undefined; + val?: string | undefined; + }[] & ({ + key?: string | undefined; + val?: string | undefined; + } & { + key?: string | undefined; + val?: string | undefined; + } & { [K_3 in Exclude]: never; })[] & { [K_4 in Exclude]: never; }) | undefined; + } & { [K_5 in Exclude]: never; }) | undefined; + senderEnvelope?: ({ + created?: number | undefined; + } & { + created?: number | undefined; + } & { [K_6 in Exclude]: never; }) | undefined; + serverEnvelope?: ({ + sequence?: number | undefined; + created?: number | undefined; + channel?: string | undefined; + subscriptionId?: string | undefined; + } & { + sequence?: number | undefined; + created?: number | undefined; + channel?: string | undefined; + subscriptionId?: string | undefined; + } & { [K_7 in Exclude]: never; }) | undefined; + data?: Uint8Array | undefined; + } & { [K_8 in Exclude]: never; }) | undefined; + channel?: string | undefined; + idempotentId?: string | undefined; + } & { [K_9 in Exclude]: never; }>(base?: I): SendMessageRequest; + fromPartial]: never; }) | undefined; + message?: ({ + header?: { + sender?: string | undefined; + contentType?: ContentType | undefined; + rpcHeader?: { + correlationId?: string | undefined; + endPoint?: string | undefined; + frameType?: RpcFrameType | undefined; + errorInfo?: { + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } | undefined; + } | undefined; + senderSequence?: number | undefined; + extraHeaders?: { + key?: string | undefined; + val?: string | undefined; + }[] | undefined; + } | undefined; + senderEnvelope?: { + created?: number | undefined; + } | undefined; + serverEnvelope?: { + sequence?: number | undefined; + created?: number | undefined; + channel?: string | undefined; + subscriptionId?: string | undefined; + } | undefined; + data?: Uint8Array | undefined; + } & { + header?: ({ + sender?: string | undefined; + contentType?: ContentType | undefined; + rpcHeader?: { + correlationId?: string | undefined; + endPoint?: string | undefined; + frameType?: RpcFrameType | undefined; + errorInfo?: { + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } | undefined; + } | undefined; + senderSequence?: number | undefined; + extraHeaders?: { + key?: string | undefined; + val?: string | undefined; + }[] | undefined; + } & { + sender?: string | undefined; + contentType?: ContentType | undefined; + rpcHeader?: ({ + correlationId?: string | undefined; + endPoint?: string | undefined; + frameType?: RpcFrameType | undefined; + errorInfo?: { + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } | undefined; + } & { + correlationId?: string | undefined; + endPoint?: string | undefined; + frameType?: RpcFrameType | undefined; + errorInfo?: ({ + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } & { + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } & { [K_11 in Exclude]: never; }) | undefined; + } & { [K_12 in Exclude]: never; }) | undefined; + senderSequence?: number | undefined; + extraHeaders?: ({ + key?: string | undefined; + val?: string | undefined; + }[] & ({ + key?: string | undefined; + val?: string | undefined; + } & { + key?: string | undefined; + val?: string | undefined; + } & { [K_13 in Exclude]: never; })[] & { [K_14 in Exclude]: never; }) | undefined; + } & { [K_15 in Exclude]: never; }) | undefined; + senderEnvelope?: ({ + created?: number | undefined; + } & { + created?: number | undefined; + } & { [K_16 in Exclude]: never; }) | undefined; + serverEnvelope?: ({ + sequence?: number | undefined; + created?: number | undefined; + channel?: string | undefined; + subscriptionId?: string | undefined; + } & { + sequence?: number | undefined; + created?: number | undefined; + channel?: string | undefined; + subscriptionId?: string | undefined; + } & { [K_17 in Exclude]: never; }) | undefined; + data?: Uint8Array | undefined; + } & { [K_18 in Exclude]: never; }) | undefined; + channel?: string | undefined; + idempotentId?: string | undefined; + } & { [K_19 in Exclude]: never; }>(object: I_1): SendMessageRequest; +}; +export declare const SendMessageResponse: { + encode(message: SendMessageResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): SendMessageResponse; + fromJSON(object: any): SendMessageResponse; + toJSON(message: SendMessageResponse): unknown; + create]: never; })[] & { [K_1 in Exclude]: never; }) | undefined; + duplicates?: (string[] & string[] & { [K_2 in Exclude]: never; }) | undefined; + idempotentId?: string | undefined; + correlationId?: string | undefined; + } & { [K_3 in Exclude]: never; }>(base?: I): SendMessageResponse; + fromPartial]: never; })[] & { [K_5 in Exclude]: never; }) | undefined; + duplicates?: (string[] & string[] & { [K_6 in Exclude]: never; }) | undefined; + idempotentId?: string | undefined; + correlationId?: string | undefined; + } & { [K_7 in Exclude]: never; }>(object: I_1): SendMessageResponse; +}; +export declare const SendReceipt: { + encode(message: SendReceipt, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): SendReceipt; + fromJSON(object: any): SendReceipt; + toJSON(message: SendReceipt): unknown; + create]: never; }) | undefined; + message?: ({ + header?: { + sender?: string | undefined; + contentType?: ContentType | undefined; + rpcHeader?: { + correlationId?: string | undefined; + endPoint?: string | undefined; + frameType?: RpcFrameType | undefined; + errorInfo?: { + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } | undefined; + } | undefined; + senderSequence?: number | undefined; + extraHeaders?: { + key?: string | undefined; + val?: string | undefined; + }[] | undefined; + } | undefined; + senderEnvelope?: { + created?: number | undefined; + } | undefined; + serverEnvelope?: { + sequence?: number | undefined; + created?: number | undefined; + channel?: string | undefined; + subscriptionId?: string | undefined; + } | undefined; + data?: Uint8Array | undefined; + } & { + header?: ({ + sender?: string | undefined; + contentType?: ContentType | undefined; + rpcHeader?: { + correlationId?: string | undefined; + endPoint?: string | undefined; + frameType?: RpcFrameType | undefined; + errorInfo?: { + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } | undefined; + } | undefined; + senderSequence?: number | undefined; + extraHeaders?: { + key?: string | undefined; + val?: string | undefined; + }[] | undefined; + } & { + sender?: string | undefined; + contentType?: ContentType | undefined; + rpcHeader?: ({ + correlationId?: string | undefined; + endPoint?: string | undefined; + frameType?: RpcFrameType | undefined; + errorInfo?: { + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } | undefined; + } & { + correlationId?: string | undefined; + endPoint?: string | undefined; + frameType?: RpcFrameType | undefined; + errorInfo?: ({ + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } & { + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } & { [K_1 in Exclude]: never; }) | undefined; + } & { [K_2 in Exclude]: never; }) | undefined; + senderSequence?: number | undefined; + extraHeaders?: ({ + key?: string | undefined; + val?: string | undefined; + }[] & ({ + key?: string | undefined; + val?: string | undefined; + } & { + key?: string | undefined; + val?: string | undefined; + } & { [K_3 in Exclude]: never; })[] & { [K_4 in Exclude]: never; }) | undefined; + } & { [K_5 in Exclude]: never; }) | undefined; + senderEnvelope?: ({ + created?: number | undefined; + } & { + created?: number | undefined; + } & { [K_6 in Exclude]: never; }) | undefined; + serverEnvelope?: ({ + sequence?: number | undefined; + created?: number | undefined; + channel?: string | undefined; + subscriptionId?: string | undefined; + } & { + sequence?: number | undefined; + created?: number | undefined; + channel?: string | undefined; + subscriptionId?: string | undefined; + } & { [K_7 in Exclude]: never; }) | undefined; + data?: Uint8Array | undefined; + } & { [K_8 in Exclude]: never; }) | undefined; + channel?: string | undefined; + idempotentId?: string | undefined; + } & { [K_9 in Exclude]: never; }) | undefined; + response?: ({ + errors?: { + message?: string | undefined; + to?: string | undefined; + }[] | undefined; + duplicates?: string[] | undefined; + idempotentId?: string | undefined; + correlationId?: string | undefined; + } & { + errors?: ({ + message?: string | undefined; + to?: string | undefined; + }[] & ({ + message?: string | undefined; + to?: string | undefined; + } & { + message?: string | undefined; + to?: string | undefined; + } & { [K_10 in Exclude]: never; })[] & { [K_11 in Exclude]: never; }) | undefined; + duplicates?: (string[] & string[] & { [K_12 in Exclude]: never; }) | undefined; + idempotentId?: string | undefined; + correlationId?: string | undefined; + } & { [K_13 in Exclude]: never; }) | undefined; + serverEnvelope?: ({ + sequence?: number | undefined; + created?: number | undefined; + channel?: string | undefined; + subscriptionId?: string | undefined; + } & { + sequence?: number | undefined; + created?: number | undefined; + channel?: string | undefined; + subscriptionId?: string | undefined; + } & { [K_14 in Exclude]: never; }) | undefined; + } & { [K_15 in Exclude]: never; }>(base?: I): SendReceipt; + fromPartial]: never; }) | undefined; + message?: ({ + header?: { + sender?: string | undefined; + contentType?: ContentType | undefined; + rpcHeader?: { + correlationId?: string | undefined; + endPoint?: string | undefined; + frameType?: RpcFrameType | undefined; + errorInfo?: { + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } | undefined; + } | undefined; + senderSequence?: number | undefined; + extraHeaders?: { + key?: string | undefined; + val?: string | undefined; + }[] | undefined; + } | undefined; + senderEnvelope?: { + created?: number | undefined; + } | undefined; + serverEnvelope?: { + sequence?: number | undefined; + created?: number | undefined; + channel?: string | undefined; + subscriptionId?: string | undefined; + } | undefined; + data?: Uint8Array | undefined; + } & { + header?: ({ + sender?: string | undefined; + contentType?: ContentType | undefined; + rpcHeader?: { + correlationId?: string | undefined; + endPoint?: string | undefined; + frameType?: RpcFrameType | undefined; + errorInfo?: { + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } | undefined; + } | undefined; + senderSequence?: number | undefined; + extraHeaders?: { + key?: string | undefined; + val?: string | undefined; + }[] | undefined; + } & { + sender?: string | undefined; + contentType?: ContentType | undefined; + rpcHeader?: ({ + correlationId?: string | undefined; + endPoint?: string | undefined; + frameType?: RpcFrameType | undefined; + errorInfo?: { + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } | undefined; + } & { + correlationId?: string | undefined; + endPoint?: string | undefined; + frameType?: RpcFrameType | undefined; + errorInfo?: ({ + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } & { + errorCode?: number | undefined; + message?: string | undefined; + stackTrace?: string | undefined; + } & { [K_17 in Exclude]: never; }) | undefined; + } & { [K_18 in Exclude]: never; }) | undefined; + senderSequence?: number | undefined; + extraHeaders?: ({ + key?: string | undefined; + val?: string | undefined; + }[] & ({ + key?: string | undefined; + val?: string | undefined; + } & { + key?: string | undefined; + val?: string | undefined; + } & { [K_19 in Exclude]: never; })[] & { [K_20 in Exclude]: never; }) | undefined; + } & { [K_21 in Exclude]: never; }) | undefined; + senderEnvelope?: ({ + created?: number | undefined; + } & { + created?: number | undefined; + } & { [K_22 in Exclude]: never; }) | undefined; + serverEnvelope?: ({ + sequence?: number | undefined; + created?: number | undefined; + channel?: string | undefined; + subscriptionId?: string | undefined; + } & { + sequence?: number | undefined; + created?: number | undefined; + channel?: string | undefined; + subscriptionId?: string | undefined; + } & { [K_23 in Exclude]: never; }) | undefined; + data?: Uint8Array | undefined; + } & { [K_24 in Exclude]: never; }) | undefined; + channel?: string | undefined; + idempotentId?: string | undefined; + } & { [K_25 in Exclude]: never; }) | undefined; + response?: ({ + errors?: { + message?: string | undefined; + to?: string | undefined; + }[] | undefined; + duplicates?: string[] | undefined; + idempotentId?: string | undefined; + correlationId?: string | undefined; + } & { + errors?: ({ + message?: string | undefined; + to?: string | undefined; + }[] & ({ + message?: string | undefined; + to?: string | undefined; + } & { + message?: string | undefined; + to?: string | undefined; + } & { [K_26 in Exclude]: never; })[] & { [K_27 in Exclude]: never; }) | undefined; + duplicates?: (string[] & string[] & { [K_28 in Exclude]: never; }) | undefined; + idempotentId?: string | undefined; + correlationId?: string | undefined; + } & { [K_29 in Exclude]: never; }) | undefined; + serverEnvelope?: ({ + sequence?: number | undefined; + created?: number | undefined; + channel?: string | undefined; + subscriptionId?: string | undefined; + } & { + sequence?: number | undefined; + created?: number | undefined; + channel?: string | undefined; + subscriptionId?: string | undefined; + } & { [K_30 in Exclude]: never; }) | undefined; + } & { [K_31 in Exclude]: never; }>(object: I_1): SendReceipt; +}; +export declare const SendMessageError: { + encode(message: SendMessageError, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): SendMessageError; + fromJSON(object: any): SendMessageError; + toJSON(message: SendMessageError): unknown; + create]: never; }>(base?: I): SendMessageError; + fromPartial]: never; }>(object: I_1): SendMessageError; +}; +export declare const FirstMessage: { + encode(message: FirstMessage, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): FirstMessage; + fromJSON(object: any): FirstMessage; + toJSON(message: FirstMessage): unknown; + create]: never; }) | undefined; + mailboxTimeoutInMs?: number | undefined; + subscriptions?: ({ + mailbox?: { + id?: string | undefined; + state?: string | undefined; + readerKey?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + nefario?: { + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + changeDataCapture?: { + id?: string | undefined; + state?: string | undefined; + matchers?: { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] | undefined; + startSeq?: string | undefined; + } | undefined; + unsubscribe?: { + id?: string | undefined; + } | undefined; + }[] & ({ + mailbox?: { + id?: string | undefined; + state?: string | undefined; + readerKey?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + nefario?: { + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + changeDataCapture?: { + id?: string | undefined; + state?: string | undefined; + matchers?: { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] | undefined; + startSeq?: string | undefined; + } | undefined; + unsubscribe?: { + id?: string | undefined; + } | undefined; + } & { + mailbox?: ({ + id?: string | undefined; + state?: string | undefined; + readerKey?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { + id?: string | undefined; + state?: string | undefined; + readerKey?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { [K_1 in Exclude]: never; }) | undefined; + nefario?: ({ + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { [K_2 in Exclude]: never; }) | undefined; + changeDataCapture?: ({ + id?: string | undefined; + state?: string | undefined; + matchers?: { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] | undefined; + startSeq?: string | undefined; + } & { + id?: string | undefined; + state?: string | undefined; + matchers?: ({ + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] & ({ + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + } & { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: (any[] & any[] & { [K_3 in Exclude]: never; }) | undefined; + } & { [K_4 in Exclude]: never; })[] & { [K_5 in Exclude]: never; }) | undefined; + startSeq?: string | undefined; + } & { [K_6 in Exclude]: never; }) | undefined; + unsubscribe?: ({ + id?: string | undefined; + } & { + id?: string | undefined; + } & { [K_7 in Exclude]: never; }) | undefined; + } & { [K_8 in Exclude]: never; })[] & { [K_9 in Exclude]: never; }) | undefined; + } & { [K_10 in Exclude]: never; }>(base?: I): FirstMessage; + fromPartial]: never; }) | undefined; + mailboxTimeoutInMs?: number | undefined; + subscriptions?: ({ + mailbox?: { + id?: string | undefined; + state?: string | undefined; + readerKey?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + nefario?: { + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + changeDataCapture?: { + id?: string | undefined; + state?: string | undefined; + matchers?: { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] | undefined; + startSeq?: string | undefined; + } | undefined; + unsubscribe?: { + id?: string | undefined; + } | undefined; + }[] & ({ + mailbox?: { + id?: string | undefined; + state?: string | undefined; + readerKey?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + nefario?: { + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } | undefined; + changeDataCapture?: { + id?: string | undefined; + state?: string | undefined; + matchers?: { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] | undefined; + startSeq?: string | undefined; + } | undefined; + unsubscribe?: { + id?: string | undefined; + } | undefined; + } & { + mailbox?: ({ + id?: string | undefined; + state?: string | undefined; + readerKey?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { + id?: string | undefined; + state?: string | undefined; + readerKey?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { [K_12 in Exclude]: never; }) | undefined; + nefario?: ({ + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { [K_13 in Exclude]: never; }) | undefined; + changeDataCapture?: ({ + id?: string | undefined; + state?: string | undefined; + matchers?: { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] | undefined; + startSeq?: string | undefined; + } & { + id?: string | undefined; + state?: string | undefined; + matchers?: ({ + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] & ({ + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + } & { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: (any[] & any[] & { [K_14 in Exclude]: never; }) | undefined; + } & { [K_15 in Exclude]: never; })[] & { [K_16 in Exclude]: never; }) | undefined; + startSeq?: string | undefined; + } & { [K_17 in Exclude]: never; }) | undefined; + unsubscribe?: ({ + id?: string | undefined; + } & { + id?: string | undefined; + } & { [K_18 in Exclude]: never; }) | undefined; + } & { [K_19 in Exclude]: never; })[] & { [K_20 in Exclude]: never; }) | undefined; + } & { [K_21 in Exclude]: never; }>(object: I_1): FirstMessage; +}; +export declare const SenderInfo: { + encode(message: SenderInfo, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): SenderInfo; + fromJSON(object: any): SenderInfo; + toJSON(message: SenderInfo): unknown; + create]: never; }>(base?: I): SenderInfo; + fromPartial]: never; }>(object: I_1): SenderInfo; +}; +export declare const SubscribeRequest: { + encode(message: SubscribeRequest, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): SubscribeRequest; + fromJSON(object: any): SubscribeRequest; + toJSON(message: SubscribeRequest): unknown; + create]: never; }) | undefined; + nefario?: ({ + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { [K_1 in Exclude]: never; }) | undefined; + changeDataCapture?: ({ + id?: string | undefined; + state?: string | undefined; + matchers?: { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] | undefined; + startSeq?: string | undefined; + } & { + id?: string | undefined; + state?: string | undefined; + matchers?: ({ + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] & ({ + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + } & { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: (any[] & any[] & { [K_2 in Exclude]: never; }) | undefined; + } & { [K_3 in Exclude]: never; })[] & { [K_4 in Exclude]: never; }) | undefined; + startSeq?: string | undefined; + } & { [K_5 in Exclude]: never; }) | undefined; + unsubscribe?: ({ + id?: string | undefined; + } & { + id?: string | undefined; + } & { [K_6 in Exclude]: never; }) | undefined; + } & { [K_7 in Exclude]: never; })[] & { [K_8 in Exclude]: never; }) | undefined; + } & { [K_9 in Exclude]: never; }>(base?: I): SubscribeRequest; + fromPartial]: never; }) | undefined; + nefario?: ({ + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { [K_11 in Exclude]: never; }) | undefined; + changeDataCapture?: ({ + id?: string | undefined; + state?: string | undefined; + matchers?: { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] | undefined; + startSeq?: string | undefined; + } & { + id?: string | undefined; + state?: string | undefined; + matchers?: ({ + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] & ({ + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + } & { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: (any[] & any[] & { [K_12 in Exclude]: never; }) | undefined; + } & { [K_13 in Exclude]: never; })[] & { [K_14 in Exclude]: never; }) | undefined; + startSeq?: string | undefined; + } & { [K_15 in Exclude]: never; }) | undefined; + unsubscribe?: ({ + id?: string | undefined; + } & { + id?: string | undefined; + } & { [K_16 in Exclude]: never; }) | undefined; + } & { [K_17 in Exclude]: never; })[] & { [K_18 in Exclude]: never; }) | undefined; + } & { [K_19 in Exclude]: never; }>(object: I_1): SubscribeRequest; +}; +export declare const SubscribeResponse: { + encode(message: SubscribeResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): SubscribeResponse; + fromJSON(object: any): SubscribeResponse; + toJSON(message: SubscribeResponse): unknown; + create]: never; }) | undefined; + errors?: ({ + state?: string | undefined; + message?: string | undefined; + }[] & ({ + state?: string | undefined; + message?: string | undefined; + } & { + state?: string | undefined; + message?: string | undefined; + } & { [K_1 in Exclude]: never; })[] & { [K_2 in Exclude]: never; }) | undefined; + } & { [K_3 in Exclude]: never; }>(base?: I): SubscribeResponse; + fromPartial]: never; }) | undefined; + errors?: ({ + state?: string | undefined; + message?: string | undefined; + }[] & ({ + state?: string | undefined; + message?: string | undefined; + } & { + state?: string | undefined; + message?: string | undefined; + } & { [K_5 in Exclude]: never; })[] & { [K_6 in Exclude]: never; }) | undefined; + } & { [K_7 in Exclude]: never; }>(object: I_1): SubscribeResponse; +}; +export declare const SubscribeError: { + encode(message: SubscribeError, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): SubscribeError; + fromJSON(object: any): SubscribeError; + toJSON(message: SubscribeError): unknown; + create]: never; }>(base?: I): SubscribeError; + fromPartial]: never; }>(object: I_1): SubscribeError; +}; +export declare const Subscription: { + encode(message: Subscription, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): Subscription; + fromJSON(object: any): Subscription; + toJSON(message: Subscription): unknown; + create]: never; }) | undefined; + nefario?: ({ + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { [K_1 in Exclude]: never; }) | undefined; + changeDataCapture?: ({ + id?: string | undefined; + state?: string | undefined; + matchers?: { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] | undefined; + startSeq?: string | undefined; + } & { + id?: string | undefined; + state?: string | undefined; + matchers?: ({ + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] & ({ + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + } & { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: (any[] & any[] & { [K_2 in Exclude]: never; }) | undefined; + } & { [K_3 in Exclude]: never; })[] & { [K_4 in Exclude]: never; }) | undefined; + startSeq?: string | undefined; + } & { [K_5 in Exclude]: never; }) | undefined; + unsubscribe?: ({ + id?: string | undefined; + } & { + id?: string | undefined; + } & { [K_6 in Exclude]: never; }) | undefined; + } & { [K_7 in Exclude]: never; }>(base?: I): Subscription; + fromPartial]: never; }) | undefined; + nefario?: ({ + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { + id?: string | undefined; + state?: string | undefined; + processUid?: string | undefined; + channel?: string | undefined; + startSeq?: string | undefined; + } & { [K_9 in Exclude]: never; }) | undefined; + changeDataCapture?: ({ + id?: string | undefined; + state?: string | undefined; + matchers?: { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] | undefined; + startSeq?: string | undefined; + } & { + id?: string | undefined; + state?: string | undefined; + matchers?: ({ + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + }[] & ({ + database?: string | undefined; + table?: string | undefined; + primaryKeys?: any[] | undefined; + } & { + database?: string | undefined; + table?: string | undefined; + primaryKeys?: (any[] & any[] & { [K_10 in Exclude]: never; }) | undefined; + } & { [K_11 in Exclude]: never; })[] & { [K_12 in Exclude]: never; }) | undefined; + startSeq?: string | undefined; + } & { [K_13 in Exclude]: never; }) | undefined; + unsubscribe?: ({ + id?: string | undefined; + } & { + id?: string | undefined; + } & { [K_14 in Exclude]: never; }) | undefined; + } & { [K_15 in Exclude]: never; }>(object: I_1): Subscription; +}; +export declare const MailboxSubscription: { + encode(message: MailboxSubscription, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): MailboxSubscription; + fromJSON(object: any): MailboxSubscription; + toJSON(message: MailboxSubscription): unknown; + create]: never; }>(base?: I): MailboxSubscription; + fromPartial]: never; }>(object: I_1): MailboxSubscription; +}; +export declare const ChangeDataCaptureSubscription: { + encode(message: ChangeDataCaptureSubscription, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): ChangeDataCaptureSubscription; + fromJSON(object: any): ChangeDataCaptureSubscription; + toJSON(message: ChangeDataCaptureSubscription): unknown; + create]: never; }) | undefined; + } & { [K_1 in Exclude]: never; })[] & { [K_2 in Exclude]: never; }) | undefined; + startSeq?: string | undefined; + } & { [K_3 in Exclude]: never; }>(base?: I): ChangeDataCaptureSubscription; + fromPartial]: never; }) | undefined; + } & { [K_5 in Exclude]: never; })[] & { [K_6 in Exclude]: never; }) | undefined; + startSeq?: string | undefined; + } & { [K_7 in Exclude]: never; }>(object: I_1): ChangeDataCaptureSubscription; +}; +export declare const RecordMatcher: { + encode(message: RecordMatcher, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): RecordMatcher; + fromJSON(object: any): RecordMatcher; + toJSON(message: RecordMatcher): unknown; + create]: never; }) | undefined; + } & { [K_1 in Exclude]: never; }>(base?: I): RecordMatcher; + fromPartial]: never; }) | undefined; + } & { [K_3 in Exclude]: never; }>(object: I_1): RecordMatcher; +}; +export declare const NefarioSubscription: { + encode(message: NefarioSubscription, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): NefarioSubscription; + fromJSON(object: any): NefarioSubscription; + toJSON(message: NefarioSubscription): unknown; + create]: never; }>(base?: I): NefarioSubscription; + fromPartial]: never; }>(object: I_1): NefarioSubscription; +}; +export declare const Unsubscribe: { + encode(message: Unsubscribe, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): Unsubscribe; + fromJSON(object: any): Unsubscribe; + toJSON(message: Unsubscribe): unknown; + create]: never; }>(base?: I): Unsubscribe; + fromPartial]: never; }>(object: I_1): Unsubscribe; +}; +export declare const CreateMailboxRequest: { + encode(message: CreateMailboxRequest, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): CreateMailboxRequest; + fromJSON(object: any): CreateMailboxRequest; + toJSON(message: CreateMailboxRequest): unknown; + create]: never; }) | undefined; + privateMetadata?: ({ + [x: string]: any; + } & { + [x: string]: any; + } & { [K_1 in Exclude]: never; }) | undefined; + publicMetadata?: ({ + [x: string]: any; + } & { + [x: string]: any; + } & { [K_2 in Exclude]: never; }) | undefined; + purgeTimeoutInMillis?: number | undefined; + closeTimeoutInMillis?: number | undefined; + extraData?: ({ + [x: string]: any; + } & { + [x: string]: any; + } & { [K_3 in Exclude]: never; }) | undefined; + } & { [K_4 in Exclude]: never; }>(base?: I): CreateMailboxRequest; + fromPartial]: never; }) | undefined; + privateMetadata?: ({ + [x: string]: any; + } & { + [x: string]: any; + } & { [K_6 in Exclude]: never; }) | undefined; + publicMetadata?: ({ + [x: string]: any; + } & { + [x: string]: any; + } & { [K_7 in Exclude]: never; }) | undefined; + purgeTimeoutInMillis?: number | undefined; + closeTimeoutInMillis?: number | undefined; + extraData?: ({ + [x: string]: any; + } & { + [x: string]: any; + } & { [K_8 in Exclude]: never; }) | undefined; + } & { [K_9 in Exclude]: never; }>(object: I_1): CreateMailboxRequest; +}; +export declare const CreateMailboxResponse: { + encode(message: CreateMailboxResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): CreateMailboxResponse; + fromJSON(object: any): CreateMailboxResponse; + toJSON(message: CreateMailboxResponse): unknown; + create]: never; }) | undefined; + } & { [K_1 in Exclude]: never; }>(base?: I): CreateMailboxResponse; + fromPartial]: never; }) | undefined; + } & { [K_3 in Exclude]: never; }>(object: I_1): CreateMailboxResponse; +}; +export declare const AddChannelRequest: { + encode(message: AddChannelRequest, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): AddChannelRequest; + fromJSON(object: any): AddChannelRequest; + toJSON(message: AddChannelRequest): unknown; + create]: never; }) | undefined; + } & { [K_1 in Exclude]: never; }>(base?: I): AddChannelRequest; + fromPartial]: never; }) | undefined; + } & { [K_3 in Exclude]: never; }>(object: I_1): AddChannelRequest; +}; +export declare const AddChannelResponse: { + encode(_: AddChannelResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): AddChannelResponse; + fromJSON(_: any): AddChannelResponse; + toJSON(_: AddChannelResponse): unknown; + create]: never; }>(base?: I): AddChannelResponse; + fromPartial]: never; }>(_: I_1): AddChannelResponse; +}; +export interface HermesService { + SendReceive(request: Observable): Observable; + CreateMailbox(request: CreateMailboxRequest): Promise; + AddChannel(request: AddChannelRequest): Promise; +} +export declare const HermesServiceServiceName = "hermes.HermesService"; +export declare class HermesServiceClientImpl implements HermesService { + private readonly rpc; + private readonly service; + constructor(rpc: Rpc, opts?: { + service?: string; + }); + SendReceive(request: Observable): Observable; + CreateMailbox(request: CreateMailboxRequest): Promise; + AddChannel(request: AddChannelRequest): Promise; +} +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; + clientStreamingRequest(service: string, method: string, data: Observable): Promise; + serverStreamingRequest(service: string, method: string, data: Uint8Array): Observable; + bidirectionalStreamingRequest(service: string, method: string, data: Observable): Observable; +} +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin ? P : P & { + [K in keyof P]: Exact; +} & { + [K in Exclude>]: never; +}; +export {}; diff --git a/lib/esm/hermesclient/proto/wsmessages.js b/lib/esm/hermesclient/proto/wsmessages.js new file mode 100644 index 0000000..93895fc --- /dev/null +++ b/lib/esm/hermesclient/proto/wsmessages.js @@ -0,0 +1,2879 @@ +import * as _m0 from "../../../node_modules/protobufjs/minimal"; +import { Struct, Value } from "../google/protobuf/struct"; +import Long from "../../../node_modules/long/index"; +import { map } from "../../../node_modules/rxjs/dist/types/index"; +export const protobufPackage = "hermes"; +export var RpcFrameType; +(function (RpcFrameType) { + RpcFrameType[RpcFrameType["UnspecifiedRFT"] = 0] = "UnspecifiedRFT"; + RpcFrameType[RpcFrameType["Request"] = 1] = "Request"; + RpcFrameType[RpcFrameType["SuccessResponse"] = 2] = "SuccessResponse"; + RpcFrameType[RpcFrameType["ErrorResponse"] = 3] = "ErrorResponse"; + RpcFrameType[RpcFrameType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED"; +})(RpcFrameType || (RpcFrameType = {})); +export function rpcFrameTypeFromJSON(object) { + switch (object) { + case 0: + case "UnspecifiedRFT": + return RpcFrameType.UnspecifiedRFT; + case 1: + case "Request": + return RpcFrameType.Request; + case 2: + case "SuccessResponse": + return RpcFrameType.SuccessResponse; + case 3: + case "ErrorResponse": + return RpcFrameType.ErrorResponse; + case -1: + case "UNRECOGNIZED": + default: + return RpcFrameType.UNRECOGNIZED; + } +} +export function rpcFrameTypeToJSON(object) { + switch (object) { + case RpcFrameType.UnspecifiedRFT: + return "UnspecifiedRFT"; + case RpcFrameType.Request: + return "Request"; + case RpcFrameType.SuccessResponse: + return "SuccessResponse"; + case RpcFrameType.ErrorResponse: + return "ErrorResponse"; + case RpcFrameType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export var ContentType; +(function (ContentType) { + ContentType[ContentType["UnspecifiedCT"] = 0] = "UnspecifiedCT"; + ContentType[ContentType["Protobuf"] = 1] = "Protobuf"; + ContentType[ContentType["Json"] = 2] = "Json"; + ContentType[ContentType["Binary"] = 3] = "Binary"; + ContentType[ContentType["Text"] = 4] = "Text"; + ContentType[ContentType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED"; +})(ContentType || (ContentType = {})); +export function contentTypeFromJSON(object) { + switch (object) { + case 0: + case "UnspecifiedCT": + return ContentType.UnspecifiedCT; + case 1: + case "Protobuf": + return ContentType.Protobuf; + case 2: + case "Json": + return ContentType.Json; + case 3: + case "Binary": + return ContentType.Binary; + case 4: + case "Text": + return ContentType.Text; + case -1: + case "UNRECOGNIZED": + default: + return ContentType.UNRECOGNIZED; + } +} +export function contentTypeToJSON(object) { + switch (object) { + case ContentType.UnspecifiedCT: + return "UnspecifiedCT"; + case ContentType.Protobuf: + return "Protobuf"; + case ContentType.Json: + return "Json"; + case ContentType.Binary: + return "Binary"; + case ContentType.Text: + return "Text"; + case ContentType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +function createBaseMessageFromClient() { + return { + sendMessageRequest: undefined, + firstMessage: undefined, + ping: undefined, + pong: undefined, + notification: undefined, + subscribeRequest: undefined, + }; +} +export const MessageFromClient = { + encode(message, writer = _m0.Writer.create()) { + if (message.sendMessageRequest !== undefined) { + SendMessageRequest.encode(message.sendMessageRequest, writer.uint32(10).fork()).ldelim(); + } + if (message.firstMessage !== undefined) { + FirstMessage.encode(message.firstMessage, writer.uint32(18).fork()).ldelim(); + } + if (message.ping !== undefined) { + Ping.encode(message.ping, writer.uint32(26).fork()).ldelim(); + } + if (message.pong !== undefined) { + Pong.encode(message.pong, writer.uint32(34).fork()).ldelim(); + } + if (message.notification !== undefined) { + Notification.encode(message.notification, writer.uint32(42).fork()).ldelim(); + } + if (message.subscribeRequest !== undefined) { + SubscribeRequest.encode(message.subscribeRequest, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMessageFromClient(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + message.sendMessageRequest = SendMessageRequest.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + message.firstMessage = FirstMessage.decode(reader, reader.uint32()); + continue; + case 3: + if (tag !== 26) { + break; + } + message.ping = Ping.decode(reader, reader.uint32()); + continue; + case 4: + if (tag !== 34) { + break; + } + message.pong = Pong.decode(reader, reader.uint32()); + continue; + case 5: + if (tag !== 42) { + break; + } + message.notification = Notification.decode(reader, reader.uint32()); + continue; + case 6: + if (tag !== 50) { + break; + } + message.subscribeRequest = SubscribeRequest.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + sendMessageRequest: isSet(object.sendMessageRequest) + ? SendMessageRequest.fromJSON(object.sendMessageRequest) + : undefined, + firstMessage: isSet(object.firstMessage) ? FirstMessage.fromJSON(object.firstMessage) : undefined, + ping: isSet(object.ping) ? Ping.fromJSON(object.ping) : undefined, + pong: isSet(object.pong) ? Pong.fromJSON(object.pong) : undefined, + notification: isSet(object.notification) ? Notification.fromJSON(object.notification) : undefined, + subscribeRequest: isSet(object.subscribeRequest) ? SubscribeRequest.fromJSON(object.subscribeRequest) : undefined, + }; + }, + toJSON(message) { + const obj = {}; + if (message.sendMessageRequest !== undefined) { + obj.sendMessageRequest = SendMessageRequest.toJSON(message.sendMessageRequest); + } + if (message.firstMessage !== undefined) { + obj.firstMessage = FirstMessage.toJSON(message.firstMessage); + } + if (message.ping !== undefined) { + obj.ping = Ping.toJSON(message.ping); + } + if (message.pong !== undefined) { + obj.pong = Pong.toJSON(message.pong); + } + if (message.notification !== undefined) { + obj.notification = Notification.toJSON(message.notification); + } + if (message.subscribeRequest !== undefined) { + obj.subscribeRequest = SubscribeRequest.toJSON(message.subscribeRequest); + } + return obj; + }, + create(base) { + return MessageFromClient.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + const message = createBaseMessageFromClient(); + message.sendMessageRequest = (object.sendMessageRequest !== undefined && object.sendMessageRequest !== null) + ? SendMessageRequest.fromPartial(object.sendMessageRequest) + : undefined; + message.firstMessage = (object.firstMessage !== undefined && object.firstMessage !== null) + ? FirstMessage.fromPartial(object.firstMessage) + : undefined; + message.ping = (object.ping !== undefined && object.ping !== null) ? Ping.fromPartial(object.ping) : undefined; + message.pong = (object.pong !== undefined && object.pong !== null) ? Pong.fromPartial(object.pong) : undefined; + message.notification = (object.notification !== undefined && object.notification !== null) + ? Notification.fromPartial(object.notification) + : undefined; + message.subscribeRequest = (object.subscribeRequest !== undefined && object.subscribeRequest !== null) + ? SubscribeRequest.fromPartial(object.subscribeRequest) + : undefined; + return message; + }, +}; +function createBaseNotification() { + return { message: "" }; +} +export const Notification = { + encode(message, writer = _m0.Writer.create()) { + if (message.message !== undefined && message.message !== "") { + writer.uint32(10).string(message.message); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseNotification(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + message.message = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { message: isSet(object.message) ? globalThis.String(object.message) : "" }; + }, + toJSON(message) { + const obj = {}; + if (message.message !== undefined && message.message !== "") { + obj.message = message.message; + } + return obj; + }, + create(base) { + return Notification.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a; + const message = createBaseNotification(); + message.message = (_a = object.message) !== null && _a !== void 0 ? _a : ""; + return message; + }, +}; +function createBaseMessageToClient() { + return { + messageEnvelope: undefined, + sendMessageResponse: undefined, + ping: undefined, + pong: undefined, + notification: undefined, + subscribeResponse: undefined, + }; +} +export const MessageToClient = { + encode(message, writer = _m0.Writer.create()) { + if (message.messageEnvelope !== undefined) { + MessageEnvelope.encode(message.messageEnvelope, writer.uint32(10).fork()).ldelim(); + } + if (message.sendMessageResponse !== undefined) { + SendMessageResponse.encode(message.sendMessageResponse, writer.uint32(18).fork()).ldelim(); + } + if (message.ping !== undefined) { + Ping.encode(message.ping, writer.uint32(26).fork()).ldelim(); + } + if (message.pong !== undefined) { + Pong.encode(message.pong, writer.uint32(34).fork()).ldelim(); + } + if (message.notification !== undefined) { + Notification.encode(message.notification, writer.uint32(42).fork()).ldelim(); + } + if (message.subscribeResponse !== undefined) { + SubscribeResponse.encode(message.subscribeResponse, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMessageToClient(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + message.messageEnvelope = MessageEnvelope.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + message.sendMessageResponse = SendMessageResponse.decode(reader, reader.uint32()); + continue; + case 3: + if (tag !== 26) { + break; + } + message.ping = Ping.decode(reader, reader.uint32()); + continue; + case 4: + if (tag !== 34) { + break; + } + message.pong = Pong.decode(reader, reader.uint32()); + continue; + case 5: + if (tag !== 42) { + break; + } + message.notification = Notification.decode(reader, reader.uint32()); + continue; + case 6: + if (tag !== 50) { + break; + } + message.subscribeResponse = SubscribeResponse.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + messageEnvelope: isSet(object.messageEnvelope) ? MessageEnvelope.fromJSON(object.messageEnvelope) : undefined, + sendMessageResponse: isSet(object.sendMessageResponse) + ? SendMessageResponse.fromJSON(object.sendMessageResponse) + : undefined, + ping: isSet(object.ping) ? Ping.fromJSON(object.ping) : undefined, + pong: isSet(object.pong) ? Pong.fromJSON(object.pong) : undefined, + notification: isSet(object.notification) ? Notification.fromJSON(object.notification) : undefined, + subscribeResponse: isSet(object.subscribeResponse) + ? SubscribeResponse.fromJSON(object.subscribeResponse) + : undefined, + }; + }, + toJSON(message) { + const obj = {}; + if (message.messageEnvelope !== undefined) { + obj.messageEnvelope = MessageEnvelope.toJSON(message.messageEnvelope); + } + if (message.sendMessageResponse !== undefined) { + obj.sendMessageResponse = SendMessageResponse.toJSON(message.sendMessageResponse); + } + if (message.ping !== undefined) { + obj.ping = Ping.toJSON(message.ping); + } + if (message.pong !== undefined) { + obj.pong = Pong.toJSON(message.pong); + } + if (message.notification !== undefined) { + obj.notification = Notification.toJSON(message.notification); + } + if (message.subscribeResponse !== undefined) { + obj.subscribeResponse = SubscribeResponse.toJSON(message.subscribeResponse); + } + return obj; + }, + create(base) { + return MessageToClient.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + const message = createBaseMessageToClient(); + message.messageEnvelope = (object.messageEnvelope !== undefined && object.messageEnvelope !== null) + ? MessageEnvelope.fromPartial(object.messageEnvelope) + : undefined; + message.sendMessageResponse = (object.sendMessageResponse !== undefined && object.sendMessageResponse !== null) + ? SendMessageResponse.fromPartial(object.sendMessageResponse) + : undefined; + message.ping = (object.ping !== undefined && object.ping !== null) ? Ping.fromPartial(object.ping) : undefined; + message.pong = (object.pong !== undefined && object.pong !== null) ? Pong.fromPartial(object.pong) : undefined; + message.notification = (object.notification !== undefined && object.notification !== null) + ? Notification.fromPartial(object.notification) + : undefined; + message.subscribeResponse = (object.subscribeResponse !== undefined && object.subscribeResponse !== null) + ? SubscribeResponse.fromPartial(object.subscribeResponse) + : undefined; + return message; + }, +}; +function createBasePing() { + return { payload: new Uint8Array(0) }; +} +export const Ping = { + encode(message, writer = _m0.Writer.create()) { + if (message.payload !== undefined && message.payload.length !== 0) { + writer.uint32(10).bytes(message.payload); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePing(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + message.payload = reader.bytes(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { payload: isSet(object.payload) ? bytesFromBase64(object.payload) : new Uint8Array(0) }; + }, + toJSON(message) { + const obj = {}; + if (message.payload !== undefined && message.payload.length !== 0) { + obj.payload = base64FromBytes(message.payload); + } + return obj; + }, + create(base) { + return Ping.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a; + const message = createBasePing(); + message.payload = (_a = object.payload) !== null && _a !== void 0 ? _a : new Uint8Array(0); + return message; + }, +}; +function createBasePong() { + return { payload: new Uint8Array(0) }; +} +export const Pong = { + encode(message, writer = _m0.Writer.create()) { + if (message.payload !== undefined && message.payload.length !== 0) { + writer.uint32(10).bytes(message.payload); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePong(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + message.payload = reader.bytes(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { payload: isSet(object.payload) ? bytesFromBase64(object.payload) : new Uint8Array(0) }; + }, + toJSON(message) { + const obj = {}; + if (message.payload !== undefined && message.payload.length !== 0) { + obj.payload = base64FromBytes(message.payload); + } + return obj; + }, + create(base) { + return Pong.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a; + const message = createBasePong(); + message.payload = (_a = object.payload) !== null && _a !== void 0 ? _a : new Uint8Array(0); + return message; + }, +}; +function createBaseMessageHeader() { + return { sender: "", contentType: 0, rpcHeader: undefined, senderSequence: 0, extraHeaders: [] }; +} +export const MessageHeader = { + encode(message, writer = _m0.Writer.create()) { + if (message.sender !== undefined && message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.contentType !== undefined && message.contentType !== 0) { + writer.uint32(16).int32(message.contentType); + } + if (message.rpcHeader !== undefined) { + RpcHeader.encode(message.rpcHeader, writer.uint32(26).fork()).ldelim(); + } + if (message.senderSequence !== undefined && message.senderSequence !== 0) { + writer.uint32(32).int64(message.senderSequence); + } + if (message.extraHeaders !== undefined && message.extraHeaders.length !== 0) { + for (const v of message.extraHeaders) { + KeyValPair.encode(v, writer.uint32(1602).fork()).ldelim(); + } + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMessageHeader(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + message.sender = reader.string(); + continue; + case 2: + if (tag !== 16) { + break; + } + message.contentType = reader.int32(); + continue; + case 3: + if (tag !== 26) { + break; + } + message.rpcHeader = RpcHeader.decode(reader, reader.uint32()); + continue; + case 4: + if (tag !== 32) { + break; + } + message.senderSequence = longToNumber(reader.int64()); + continue; + case 200: + if (tag !== 1602) { + break; + } + message.extraHeaders.push(KeyValPair.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + sender: isSet(object.sender) ? globalThis.String(object.sender) : "", + contentType: isSet(object.contentType) ? contentTypeFromJSON(object.contentType) : 0, + rpcHeader: isSet(object.rpcHeader) ? RpcHeader.fromJSON(object.rpcHeader) : undefined, + senderSequence: isSet(object.senderSequence) ? globalThis.Number(object.senderSequence) : 0, + extraHeaders: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.extraHeaders) + ? object.extraHeaders.map((e) => KeyValPair.fromJSON(e)) + : [], + }; + }, + toJSON(message) { + var _a; + const obj = {}; + if (message.sender !== undefined && message.sender !== "") { + obj.sender = message.sender; + } + if (message.contentType !== undefined && message.contentType !== 0) { + obj.contentType = contentTypeToJSON(message.contentType); + } + if (message.rpcHeader !== undefined) { + obj.rpcHeader = RpcHeader.toJSON(message.rpcHeader); + } + if (message.senderSequence !== undefined && message.senderSequence !== 0) { + obj.senderSequence = Math.round(message.senderSequence); + } + if ((_a = message.extraHeaders) === null || _a === void 0 ? void 0 : _a.length) { + obj.extraHeaders = message.extraHeaders.map((e) => KeyValPair.toJSON(e)); + } + return obj; + }, + create(base) { + return MessageHeader.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a, _b, _c, _d; + const message = createBaseMessageHeader(); + message.sender = (_a = object.sender) !== null && _a !== void 0 ? _a : ""; + message.contentType = (_b = object.contentType) !== null && _b !== void 0 ? _b : 0; + message.rpcHeader = (object.rpcHeader !== undefined && object.rpcHeader !== null) + ? RpcHeader.fromPartial(object.rpcHeader) + : undefined; + message.senderSequence = (_c = object.senderSequence) !== null && _c !== void 0 ? _c : 0; + message.extraHeaders = ((_d = object.extraHeaders) === null || _d === void 0 ? void 0 : _d.map((e) => KeyValPair.fromPartial(e))) || []; + return message; + }, +}; +function createBaseSenderEnvelope() { + return { created: 0 }; +} +export const SenderEnvelope = { + encode(message, writer = _m0.Writer.create()) { + if (message.created !== undefined && message.created !== 0) { + writer.uint32(8).int64(message.created); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSenderEnvelope(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + message.created = longToNumber(reader.int64()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { created: isSet(object.created) ? globalThis.Number(object.created) : 0 }; + }, + toJSON(message) { + const obj = {}; + if (message.created !== undefined && message.created !== 0) { + obj.created = Math.round(message.created); + } + return obj; + }, + create(base) { + return SenderEnvelope.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a; + const message = createBaseSenderEnvelope(); + message.created = (_a = object.created) !== null && _a !== void 0 ? _a : 0; + return message; + }, +}; +function createBaseServerEnvelope() { + return { sequence: 0, created: 0, channel: "", subscriptionId: "" }; +} +export const ServerEnvelope = { + encode(message, writer = _m0.Writer.create()) { + if (message.sequence !== undefined && message.sequence !== 0) { + writer.uint32(8).uint64(message.sequence); + } + if (message.created !== undefined && message.created !== 0) { + writer.uint32(16).int64(message.created); + } + if (message.channel !== undefined && message.channel !== "") { + writer.uint32(26).string(message.channel); + } + if (message.subscriptionId !== undefined && message.subscriptionId !== "") { + writer.uint32(34).string(message.subscriptionId); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseServerEnvelope(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + message.sequence = longToNumber(reader.uint64()); + continue; + case 2: + if (tag !== 16) { + break; + } + message.created = longToNumber(reader.int64()); + continue; + case 3: + if (tag !== 26) { + break; + } + message.channel = reader.string(); + continue; + case 4: + if (tag !== 34) { + break; + } + message.subscriptionId = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + sequence: isSet(object.sequence) ? globalThis.Number(object.sequence) : 0, + created: isSet(object.created) ? globalThis.Number(object.created) : 0, + channel: isSet(object.channel) ? globalThis.String(object.channel) : "", + subscriptionId: isSet(object.subscriptionId) ? globalThis.String(object.subscriptionId) : "", + }; + }, + toJSON(message) { + const obj = {}; + if (message.sequence !== undefined && message.sequence !== 0) { + obj.sequence = Math.round(message.sequence); + } + if (message.created !== undefined && message.created !== 0) { + obj.created = Math.round(message.created); + } + if (message.channel !== undefined && message.channel !== "") { + obj.channel = message.channel; + } + if (message.subscriptionId !== undefined && message.subscriptionId !== "") { + obj.subscriptionId = message.subscriptionId; + } + return obj; + }, + create(base) { + return ServerEnvelope.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a, _b, _c, _d; + const message = createBaseServerEnvelope(); + message.sequence = (_a = object.sequence) !== null && _a !== void 0 ? _a : 0; + message.created = (_b = object.created) !== null && _b !== void 0 ? _b : 0; + message.channel = (_c = object.channel) !== null && _c !== void 0 ? _c : ""; + message.subscriptionId = (_d = object.subscriptionId) !== null && _d !== void 0 ? _d : ""; + return message; + }, +}; +function createBaseKeyValPair() { + return { key: "", val: "" }; +} +export const KeyValPair = { + encode(message, writer = _m0.Writer.create()) { + if (message.key !== undefined && message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.val !== undefined && message.val !== "") { + writer.uint32(18).string(message.val); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseKeyValPair(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + message.key = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + message.val = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + val: isSet(object.val) ? globalThis.String(object.val) : "", + }; + }, + toJSON(message) { + const obj = {}; + if (message.key !== undefined && message.key !== "") { + obj.key = message.key; + } + if (message.val !== undefined && message.val !== "") { + obj.val = message.val; + } + return obj; + }, + create(base) { + return KeyValPair.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a, _b; + const message = createBaseKeyValPair(); + message.key = (_a = object.key) !== null && _a !== void 0 ? _a : ""; + message.val = (_b = object.val) !== null && _b !== void 0 ? _b : ""; + return message; + }, +}; +function createBaseRpcHeader() { + return { correlationId: "", endPoint: "", frameType: 0, errorInfo: undefined }; +} +export const RpcHeader = { + encode(message, writer = _m0.Writer.create()) { + if (message.correlationId !== undefined && message.correlationId !== "") { + writer.uint32(18).string(message.correlationId); + } + if (message.endPoint !== undefined && message.endPoint !== "") { + writer.uint32(26).string(message.endPoint); + } + if (message.frameType !== undefined && message.frameType !== 0) { + writer.uint32(32).int32(message.frameType); + } + if (message.errorInfo !== undefined) { + RpcErrorInfo.encode(message.errorInfo, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRpcHeader(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + if (tag !== 18) { + break; + } + message.correlationId = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + message.endPoint = reader.string(); + continue; + case 4: + if (tag !== 32) { + break; + } + message.frameType = reader.int32(); + continue; + case 5: + if (tag !== 42) { + break; + } + message.errorInfo = RpcErrorInfo.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + correlationId: isSet(object.correlationId) ? globalThis.String(object.correlationId) : "", + endPoint: isSet(object.endPoint) ? globalThis.String(object.endPoint) : "", + frameType: isSet(object.frameType) ? rpcFrameTypeFromJSON(object.frameType) : 0, + errorInfo: isSet(object.errorInfo) ? RpcErrorInfo.fromJSON(object.errorInfo) : undefined, + }; + }, + toJSON(message) { + const obj = {}; + if (message.correlationId !== undefined && message.correlationId !== "") { + obj.correlationId = message.correlationId; + } + if (message.endPoint !== undefined && message.endPoint !== "") { + obj.endPoint = message.endPoint; + } + if (message.frameType !== undefined && message.frameType !== 0) { + obj.frameType = rpcFrameTypeToJSON(message.frameType); + } + if (message.errorInfo !== undefined) { + obj.errorInfo = RpcErrorInfo.toJSON(message.errorInfo); + } + return obj; + }, + create(base) { + return RpcHeader.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a, _b, _c; + const message = createBaseRpcHeader(); + message.correlationId = (_a = object.correlationId) !== null && _a !== void 0 ? _a : ""; + message.endPoint = (_b = object.endPoint) !== null && _b !== void 0 ? _b : ""; + message.frameType = (_c = object.frameType) !== null && _c !== void 0 ? _c : 0; + message.errorInfo = (object.errorInfo !== undefined && object.errorInfo !== null) + ? RpcErrorInfo.fromPartial(object.errorInfo) + : undefined; + return message; + }, +}; +function createBaseRpcErrorInfo() { + return { errorCode: 0, message: "", stackTrace: "" }; +} +export const RpcErrorInfo = { + encode(message, writer = _m0.Writer.create()) { + if (message.errorCode !== undefined && message.errorCode !== 0) { + writer.uint32(8).uint32(message.errorCode); + } + if (message.message !== undefined && message.message !== "") { + writer.uint32(18).string(message.message); + } + if (message.stackTrace !== undefined && message.stackTrace !== "") { + writer.uint32(26).string(message.stackTrace); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRpcErrorInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + message.errorCode = reader.uint32(); + continue; + case 2: + if (tag !== 18) { + break; + } + message.message = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + message.stackTrace = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + errorCode: isSet(object.errorCode) ? globalThis.Number(object.errorCode) : 0, + message: isSet(object.message) ? globalThis.String(object.message) : "", + stackTrace: isSet(object.stackTrace) ? globalThis.String(object.stackTrace) : "", + }; + }, + toJSON(message) { + const obj = {}; + if (message.errorCode !== undefined && message.errorCode !== 0) { + obj.errorCode = Math.round(message.errorCode); + } + if (message.message !== undefined && message.message !== "") { + obj.message = message.message; + } + if (message.stackTrace !== undefined && message.stackTrace !== "") { + obj.stackTrace = message.stackTrace; + } + return obj; + }, + create(base) { + return RpcErrorInfo.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a, _b, _c; + const message = createBaseRpcErrorInfo(); + message.errorCode = (_a = object.errorCode) !== null && _a !== void 0 ? _a : 0; + message.message = (_b = object.message) !== null && _b !== void 0 ? _b : ""; + message.stackTrace = (_c = object.stackTrace) !== null && _c !== void 0 ? _c : ""; + return message; + }, +}; +function createBaseMessage() { + return { header: undefined, senderEnvelope: undefined, serverEnvelope: undefined, data: new Uint8Array(0) }; +} +export const Message = { + encode(message, writer = _m0.Writer.create()) { + if (message.header !== undefined) { + MessageHeader.encode(message.header, writer.uint32(10).fork()).ldelim(); + } + if (message.senderEnvelope !== undefined) { + SenderEnvelope.encode(message.senderEnvelope, writer.uint32(18).fork()).ldelim(); + } + if (message.serverEnvelope !== undefined) { + ServerEnvelope.encode(message.serverEnvelope, writer.uint32(26).fork()).ldelim(); + } + if (message.data !== undefined && message.data.length !== 0) { + writer.uint32(34).bytes(message.data); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMessage(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + message.header = MessageHeader.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + message.senderEnvelope = SenderEnvelope.decode(reader, reader.uint32()); + continue; + case 3: + if (tag !== 26) { + break; + } + message.serverEnvelope = ServerEnvelope.decode(reader, reader.uint32()); + continue; + case 4: + if (tag !== 34) { + break; + } + message.data = reader.bytes(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + header: isSet(object.header) ? MessageHeader.fromJSON(object.header) : undefined, + senderEnvelope: isSet(object.senderEnvelope) ? SenderEnvelope.fromJSON(object.senderEnvelope) : undefined, + serverEnvelope: isSet(object.serverEnvelope) ? ServerEnvelope.fromJSON(object.serverEnvelope) : undefined, + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(0), + }; + }, + toJSON(message) { + const obj = {}; + if (message.header !== undefined) { + obj.header = MessageHeader.toJSON(message.header); + } + if (message.senderEnvelope !== undefined) { + obj.senderEnvelope = SenderEnvelope.toJSON(message.senderEnvelope); + } + if (message.serverEnvelope !== undefined) { + obj.serverEnvelope = ServerEnvelope.toJSON(message.serverEnvelope); + } + if (message.data !== undefined && message.data.length !== 0) { + obj.data = base64FromBytes(message.data); + } + return obj; + }, + create(base) { + return Message.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a; + const message = createBaseMessage(); + message.header = (object.header !== undefined && object.header !== null) + ? MessageHeader.fromPartial(object.header) + : undefined; + message.senderEnvelope = (object.senderEnvelope !== undefined && object.senderEnvelope !== null) + ? SenderEnvelope.fromPartial(object.senderEnvelope) + : undefined; + message.serverEnvelope = (object.serverEnvelope !== undefined && object.serverEnvelope !== null) + ? ServerEnvelope.fromPartial(object.serverEnvelope) + : undefined; + message.data = (_a = object.data) !== null && _a !== void 0 ? _a : new Uint8Array(0); + return message; + }, +}; +function createBaseMessageEnvelope() { + return { messageBytes: new Uint8Array(0), serverEnvelope: undefined }; +} +export const MessageEnvelope = { + encode(message, writer = _m0.Writer.create()) { + if (message.messageBytes !== undefined && message.messageBytes.length !== 0) { + writer.uint32(10).bytes(message.messageBytes); + } + if (message.serverEnvelope !== undefined) { + ServerEnvelope.encode(message.serverEnvelope, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMessageEnvelope(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + message.messageBytes = reader.bytes(); + continue; + case 2: + if (tag !== 18) { + break; + } + message.serverEnvelope = ServerEnvelope.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + messageBytes: isSet(object.messageBytes) ? bytesFromBase64(object.messageBytes) : new Uint8Array(0), + serverEnvelope: isSet(object.serverEnvelope) ? ServerEnvelope.fromJSON(object.serverEnvelope) : undefined, + }; + }, + toJSON(message) { + const obj = {}; + if (message.messageBytes !== undefined && message.messageBytes.length !== 0) { + obj.messageBytes = base64FromBytes(message.messageBytes); + } + if (message.serverEnvelope !== undefined) { + obj.serverEnvelope = ServerEnvelope.toJSON(message.serverEnvelope); + } + return obj; + }, + create(base) { + return MessageEnvelope.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a; + const message = createBaseMessageEnvelope(); + message.messageBytes = (_a = object.messageBytes) !== null && _a !== void 0 ? _a : new Uint8Array(0); + message.serverEnvelope = (object.serverEnvelope !== undefined && object.serverEnvelope !== null) + ? ServerEnvelope.fromPartial(object.serverEnvelope) + : undefined; + return message; + }, +}; +function createBaseSendMessageRequest() { + return { to: [], message: undefined, channel: "", idempotentId: "" }; +} +export const SendMessageRequest = { + encode(message, writer = _m0.Writer.create()) { + if (message.to !== undefined && message.to.length !== 0) { + for (const v of message.to) { + writer.uint32(10).string(v); + } + } + if (message.message !== undefined) { + Message.encode(message.message, writer.uint32(18).fork()).ldelim(); + } + if (message.channel !== undefined && message.channel !== "") { + writer.uint32(26).string(message.channel); + } + if (message.idempotentId !== undefined && message.idempotentId !== "") { + writer.uint32(34).string(message.idempotentId); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSendMessageRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + message.to.push(reader.string()); + continue; + case 2: + if (tag !== 18) { + break; + } + message.message = Message.decode(reader, reader.uint32()); + continue; + case 3: + if (tag !== 26) { + break; + } + message.channel = reader.string(); + continue; + case 4: + if (tag !== 34) { + break; + } + message.idempotentId = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + to: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.to) ? object.to.map((e) => globalThis.String(e)) : [], + message: isSet(object.message) ? Message.fromJSON(object.message) : undefined, + channel: isSet(object.channel) ? globalThis.String(object.channel) : "", + idempotentId: isSet(object.idempotentId) ? globalThis.String(object.idempotentId) : "", + }; + }, + toJSON(message) { + var _a; + const obj = {}; + if ((_a = message.to) === null || _a === void 0 ? void 0 : _a.length) { + obj.to = message.to; + } + if (message.message !== undefined) { + obj.message = Message.toJSON(message.message); + } + if (message.channel !== undefined && message.channel !== "") { + obj.channel = message.channel; + } + if (message.idempotentId !== undefined && message.idempotentId !== "") { + obj.idempotentId = message.idempotentId; + } + return obj; + }, + create(base) { + return SendMessageRequest.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a, _b, _c; + const message = createBaseSendMessageRequest(); + message.to = ((_a = object.to) === null || _a === void 0 ? void 0 : _a.map((e) => e)) || []; + message.message = (object.message !== undefined && object.message !== null) + ? Message.fromPartial(object.message) + : undefined; + message.channel = (_b = object.channel) !== null && _b !== void 0 ? _b : ""; + message.idempotentId = (_c = object.idempotentId) !== null && _c !== void 0 ? _c : ""; + return message; + }, +}; +function createBaseSendMessageResponse() { + return { errors: [], duplicates: [], idempotentId: "", correlationId: "" }; +} +export const SendMessageResponse = { + encode(message, writer = _m0.Writer.create()) { + if (message.errors !== undefined && message.errors.length !== 0) { + for (const v of message.errors) { + SendMessageError.encode(v, writer.uint32(10).fork()).ldelim(); + } + } + if (message.duplicates !== undefined && message.duplicates.length !== 0) { + for (const v of message.duplicates) { + writer.uint32(18).string(v); + } + } + if (message.idempotentId !== undefined && message.idempotentId !== "") { + writer.uint32(26).string(message.idempotentId); + } + if (message.correlationId !== undefined && message.correlationId !== "") { + writer.uint32(34).string(message.correlationId); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSendMessageResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + message.errors.push(SendMessageError.decode(reader, reader.uint32())); + continue; + case 2: + if (tag !== 18) { + break; + } + message.duplicates.push(reader.string()); + continue; + case 3: + if (tag !== 26) { + break; + } + message.idempotentId = reader.string(); + continue; + case 4: + if (tag !== 34) { + break; + } + message.correlationId = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + errors: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.errors) + ? object.errors.map((e) => SendMessageError.fromJSON(e)) + : [], + duplicates: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.duplicates) + ? object.duplicates.map((e) => globalThis.String(e)) + : [], + idempotentId: isSet(object.idempotentId) ? globalThis.String(object.idempotentId) : "", + correlationId: isSet(object.correlationId) ? globalThis.String(object.correlationId) : "", + }; + }, + toJSON(message) { + var _a, _b; + const obj = {}; + if ((_a = message.errors) === null || _a === void 0 ? void 0 : _a.length) { + obj.errors = message.errors.map((e) => SendMessageError.toJSON(e)); + } + if ((_b = message.duplicates) === null || _b === void 0 ? void 0 : _b.length) { + obj.duplicates = message.duplicates; + } + if (message.idempotentId !== undefined && message.idempotentId !== "") { + obj.idempotentId = message.idempotentId; + } + if (message.correlationId !== undefined && message.correlationId !== "") { + obj.correlationId = message.correlationId; + } + return obj; + }, + create(base) { + return SendMessageResponse.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a, _b, _c, _d; + const message = createBaseSendMessageResponse(); + message.errors = ((_a = object.errors) === null || _a === void 0 ? void 0 : _a.map((e) => SendMessageError.fromPartial(e))) || []; + message.duplicates = ((_b = object.duplicates) === null || _b === void 0 ? void 0 : _b.map((e) => e)) || []; + message.idempotentId = (_c = object.idempotentId) !== null && _c !== void 0 ? _c : ""; + message.correlationId = (_d = object.correlationId) !== null && _d !== void 0 ? _d : ""; + return message; + }, +}; +function createBaseSendReceipt() { + return { request: undefined, response: undefined, serverEnvelope: undefined }; +} +export const SendReceipt = { + encode(message, writer = _m0.Writer.create()) { + if (message.request !== undefined) { + SendMessageRequest.encode(message.request, writer.uint32(10).fork()).ldelim(); + } + if (message.response !== undefined) { + SendMessageResponse.encode(message.response, writer.uint32(18).fork()).ldelim(); + } + if (message.serverEnvelope !== undefined) { + ServerEnvelope.encode(message.serverEnvelope, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSendReceipt(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + message.request = SendMessageRequest.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + message.response = SendMessageResponse.decode(reader, reader.uint32()); + continue; + case 3: + if (tag !== 26) { + break; + } + message.serverEnvelope = ServerEnvelope.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + request: isSet(object.request) ? SendMessageRequest.fromJSON(object.request) : undefined, + response: isSet(object.response) ? SendMessageResponse.fromJSON(object.response) : undefined, + serverEnvelope: isSet(object.serverEnvelope) ? ServerEnvelope.fromJSON(object.serverEnvelope) : undefined, + }; + }, + toJSON(message) { + const obj = {}; + if (message.request !== undefined) { + obj.request = SendMessageRequest.toJSON(message.request); + } + if (message.response !== undefined) { + obj.response = SendMessageResponse.toJSON(message.response); + } + if (message.serverEnvelope !== undefined) { + obj.serverEnvelope = ServerEnvelope.toJSON(message.serverEnvelope); + } + return obj; + }, + create(base) { + return SendReceipt.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + const message = createBaseSendReceipt(); + message.request = (object.request !== undefined && object.request !== null) + ? SendMessageRequest.fromPartial(object.request) + : undefined; + message.response = (object.response !== undefined && object.response !== null) + ? SendMessageResponse.fromPartial(object.response) + : undefined; + message.serverEnvelope = (object.serverEnvelope !== undefined && object.serverEnvelope !== null) + ? ServerEnvelope.fromPartial(object.serverEnvelope) + : undefined; + return message; + }, +}; +function createBaseSendMessageError() { + return { message: "", to: "" }; +} +export const SendMessageError = { + encode(message, writer = _m0.Writer.create()) { + if (message.message !== undefined && message.message !== "") { + writer.uint32(10).string(message.message); + } + if (message.to !== undefined && message.to !== "") { + writer.uint32(18).string(message.to); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSendMessageError(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + message.message = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + message.to = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + message: isSet(object.message) ? globalThis.String(object.message) : "", + to: isSet(object.to) ? globalThis.String(object.to) : "", + }; + }, + toJSON(message) { + const obj = {}; + if (message.message !== undefined && message.message !== "") { + obj.message = message.message; + } + if (message.to !== undefined && message.to !== "") { + obj.to = message.to; + } + return obj; + }, + create(base) { + return SendMessageError.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a, _b; + const message = createBaseSendMessageError(); + message.message = (_a = object.message) !== null && _a !== void 0 ? _a : ""; + message.to = (_b = object.to) !== null && _b !== void 0 ? _b : ""; + return message; + }, +}; +function createBaseFirstMessage() { + return { senderInfo: undefined, mailboxTimeoutInMs: 0, subscriptions: [] }; +} +export const FirstMessage = { + encode(message, writer = _m0.Writer.create()) { + if (message.senderInfo !== undefined) { + SenderInfo.encode(message.senderInfo, writer.uint32(10).fork()).ldelim(); + } + if (message.mailboxTimeoutInMs !== undefined && message.mailboxTimeoutInMs !== 0) { + writer.uint32(16).uint32(message.mailboxTimeoutInMs); + } + if (message.subscriptions !== undefined && message.subscriptions.length !== 0) { + for (const v of message.subscriptions) { + Subscription.encode(v, writer.uint32(26).fork()).ldelim(); + } + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFirstMessage(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + message.senderInfo = SenderInfo.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 16) { + break; + } + message.mailboxTimeoutInMs = reader.uint32(); + continue; + case 3: + if (tag !== 26) { + break; + } + message.subscriptions.push(Subscription.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + senderInfo: isSet(object.senderInfo) ? SenderInfo.fromJSON(object.senderInfo) : undefined, + mailboxTimeoutInMs: isSet(object.mailboxTimeoutInMs) ? globalThis.Number(object.mailboxTimeoutInMs) : 0, + subscriptions: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.subscriptions) + ? object.subscriptions.map((e) => Subscription.fromJSON(e)) + : [], + }; + }, + toJSON(message) { + var _a; + const obj = {}; + if (message.senderInfo !== undefined) { + obj.senderInfo = SenderInfo.toJSON(message.senderInfo); + } + if (message.mailboxTimeoutInMs !== undefined && message.mailboxTimeoutInMs !== 0) { + obj.mailboxTimeoutInMs = Math.round(message.mailboxTimeoutInMs); + } + if ((_a = message.subscriptions) === null || _a === void 0 ? void 0 : _a.length) { + obj.subscriptions = message.subscriptions.map((e) => Subscription.toJSON(e)); + } + return obj; + }, + create(base) { + return FirstMessage.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a, _b; + const message = createBaseFirstMessage(); + message.senderInfo = (object.senderInfo !== undefined && object.senderInfo !== null) + ? SenderInfo.fromPartial(object.senderInfo) + : undefined; + message.mailboxTimeoutInMs = (_a = object.mailboxTimeoutInMs) !== null && _a !== void 0 ? _a : 0; + message.subscriptions = ((_b = object.subscriptions) === null || _b === void 0 ? void 0 : _b.map((e) => Subscription.fromPartial(e))) || []; + return message; + }, +}; +function createBaseSenderInfo() { + return { readerKey: "", address: "" }; +} +export const SenderInfo = { + encode(message, writer = _m0.Writer.create()) { + if (message.readerKey !== undefined && message.readerKey !== "") { + writer.uint32(10).string(message.readerKey); + } + if (message.address !== undefined && message.address !== "") { + writer.uint32(18).string(message.address); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSenderInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + message.readerKey = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + message.address = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + readerKey: isSet(object.readerKey) ? globalThis.String(object.readerKey) : "", + address: isSet(object.address) ? globalThis.String(object.address) : "", + }; + }, + toJSON(message) { + const obj = {}; + if (message.readerKey !== undefined && message.readerKey !== "") { + obj.readerKey = message.readerKey; + } + if (message.address !== undefined && message.address !== "") { + obj.address = message.address; + } + return obj; + }, + create(base) { + return SenderInfo.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a, _b; + const message = createBaseSenderInfo(); + message.readerKey = (_a = object.readerKey) !== null && _a !== void 0 ? _a : ""; + message.address = (_b = object.address) !== null && _b !== void 0 ? _b : ""; + return message; + }, +}; +function createBaseSubscribeRequest() { + return { subscriptions: [] }; +} +export const SubscribeRequest = { + encode(message, writer = _m0.Writer.create()) { + if (message.subscriptions !== undefined && message.subscriptions.length !== 0) { + for (const v of message.subscriptions) { + Subscription.encode(v, writer.uint32(10).fork()).ldelim(); + } + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubscribeRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + message.subscriptions.push(Subscription.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + subscriptions: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.subscriptions) + ? object.subscriptions.map((e) => Subscription.fromJSON(e)) + : [], + }; + }, + toJSON(message) { + var _a; + const obj = {}; + if ((_a = message.subscriptions) === null || _a === void 0 ? void 0 : _a.length) { + obj.subscriptions = message.subscriptions.map((e) => Subscription.toJSON(e)); + } + return obj; + }, + create(base) { + return SubscribeRequest.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a; + const message = createBaseSubscribeRequest(); + message.subscriptions = ((_a = object.subscriptions) === null || _a === void 0 ? void 0 : _a.map((e) => Subscription.fromPartial(e))) || []; + return message; + }, +}; +function createBaseSubscribeResponse() { + return { succeeded: [], errors: [] }; +} +export const SubscribeResponse = { + encode(message, writer = _m0.Writer.create()) { + if (message.succeeded !== undefined && message.succeeded.length !== 0) { + for (const v of message.succeeded) { + writer.uint32(10).string(v); + } + } + if (message.errors !== undefined && message.errors.length !== 0) { + for (const v of message.errors) { + SubscribeError.encode(v, writer.uint32(18).fork()).ldelim(); + } + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubscribeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + message.succeeded.push(reader.string()); + continue; + case 2: + if (tag !== 18) { + break; + } + message.errors.push(SubscribeError.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + succeeded: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.succeeded) + ? object.succeeded.map((e) => globalThis.String(e)) + : [], + errors: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.errors) ? object.errors.map((e) => SubscribeError.fromJSON(e)) : [], + }; + }, + toJSON(message) { + var _a, _b; + const obj = {}; + if ((_a = message.succeeded) === null || _a === void 0 ? void 0 : _a.length) { + obj.succeeded = message.succeeded; + } + if ((_b = message.errors) === null || _b === void 0 ? void 0 : _b.length) { + obj.errors = message.errors.map((e) => SubscribeError.toJSON(e)); + } + return obj; + }, + create(base) { + return SubscribeResponse.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a, _b; + const message = createBaseSubscribeResponse(); + message.succeeded = ((_a = object.succeeded) === null || _a === void 0 ? void 0 : _a.map((e) => e)) || []; + message.errors = ((_b = object.errors) === null || _b === void 0 ? void 0 : _b.map((e) => SubscribeError.fromPartial(e))) || []; + return message; + }, +}; +function createBaseSubscribeError() { + return { state: "", message: "" }; +} +export const SubscribeError = { + encode(message, writer = _m0.Writer.create()) { + if (message.state !== undefined && message.state !== "") { + writer.uint32(18).string(message.state); + } + if (message.message !== undefined && message.message !== "") { + writer.uint32(26).string(message.message); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubscribeError(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + if (tag !== 18) { + break; + } + message.state = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + message.message = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + state: isSet(object.state) ? globalThis.String(object.state) : "", + message: isSet(object.message) ? globalThis.String(object.message) : "", + }; + }, + toJSON(message) { + const obj = {}; + if (message.state !== undefined && message.state !== "") { + obj.state = message.state; + } + if (message.message !== undefined && message.message !== "") { + obj.message = message.message; + } + return obj; + }, + create(base) { + return SubscribeError.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a, _b; + const message = createBaseSubscribeError(); + message.state = (_a = object.state) !== null && _a !== void 0 ? _a : ""; + message.message = (_b = object.message) !== null && _b !== void 0 ? _b : ""; + return message; + }, +}; +function createBaseSubscription() { + return { mailbox: undefined, nefario: undefined, changeDataCapture: undefined, unsubscribe: undefined }; +} +export const Subscription = { + encode(message, writer = _m0.Writer.create()) { + if (message.mailbox !== undefined) { + MailboxSubscription.encode(message.mailbox, writer.uint32(10).fork()).ldelim(); + } + if (message.nefario !== undefined) { + NefarioSubscription.encode(message.nefario, writer.uint32(18).fork()).ldelim(); + } + if (message.changeDataCapture !== undefined) { + ChangeDataCaptureSubscription.encode(message.changeDataCapture, writer.uint32(26).fork()).ldelim(); + } + if (message.unsubscribe !== undefined) { + Unsubscribe.encode(message.unsubscribe, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubscription(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + message.mailbox = MailboxSubscription.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + message.nefario = NefarioSubscription.decode(reader, reader.uint32()); + continue; + case 3: + if (tag !== 26) { + break; + } + message.changeDataCapture = ChangeDataCaptureSubscription.decode(reader, reader.uint32()); + continue; + case 4: + if (tag !== 34) { + break; + } + message.unsubscribe = Unsubscribe.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + mailbox: isSet(object.mailbox) ? MailboxSubscription.fromJSON(object.mailbox) : undefined, + nefario: isSet(object.nefario) ? NefarioSubscription.fromJSON(object.nefario) : undefined, + changeDataCapture: isSet(object.changeDataCapture) + ? ChangeDataCaptureSubscription.fromJSON(object.changeDataCapture) + : undefined, + unsubscribe: isSet(object.unsubscribe) ? Unsubscribe.fromJSON(object.unsubscribe) : undefined, + }; + }, + toJSON(message) { + const obj = {}; + if (message.mailbox !== undefined) { + obj.mailbox = MailboxSubscription.toJSON(message.mailbox); + } + if (message.nefario !== undefined) { + obj.nefario = NefarioSubscription.toJSON(message.nefario); + } + if (message.changeDataCapture !== undefined) { + obj.changeDataCapture = ChangeDataCaptureSubscription.toJSON(message.changeDataCapture); + } + if (message.unsubscribe !== undefined) { + obj.unsubscribe = Unsubscribe.toJSON(message.unsubscribe); + } + return obj; + }, + create(base) { + return Subscription.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + const message = createBaseSubscription(); + message.mailbox = (object.mailbox !== undefined && object.mailbox !== null) + ? MailboxSubscription.fromPartial(object.mailbox) + : undefined; + message.nefario = (object.nefario !== undefined && object.nefario !== null) + ? NefarioSubscription.fromPartial(object.nefario) + : undefined; + message.changeDataCapture = (object.changeDataCapture !== undefined && object.changeDataCapture !== null) + ? ChangeDataCaptureSubscription.fromPartial(object.changeDataCapture) + : undefined; + message.unsubscribe = (object.unsubscribe !== undefined && object.unsubscribe !== null) + ? Unsubscribe.fromPartial(object.unsubscribe) + : undefined; + return message; + }, +}; +function createBaseMailboxSubscription() { + return { id: "", state: "", readerKey: "", channel: "", startSeq: "" }; +} +export const MailboxSubscription = { + encode(message, writer = _m0.Writer.create()) { + if (message.id !== undefined && message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.state !== undefined && message.state !== "") { + writer.uint32(18).string(message.state); + } + if (message.readerKey !== undefined && message.readerKey !== "") { + writer.uint32(26).string(message.readerKey); + } + if (message.channel !== undefined && message.channel !== "") { + writer.uint32(34).string(message.channel); + } + if (message.startSeq !== undefined && message.startSeq !== "") { + writer.uint32(42).string(message.startSeq); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMailboxSubscription(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + message.id = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + message.state = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + message.readerKey = reader.string(); + continue; + case 4: + if (tag !== 34) { + break; + } + message.channel = reader.string(); + continue; + case 5: + if (tag !== 42) { + break; + } + message.startSeq = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + id: isSet(object.id) ? globalThis.String(object.id) : "", + state: isSet(object.state) ? globalThis.String(object.state) : "", + readerKey: isSet(object.readerKey) ? globalThis.String(object.readerKey) : "", + channel: isSet(object.channel) ? globalThis.String(object.channel) : "", + startSeq: isSet(object.startSeq) ? globalThis.String(object.startSeq) : "", + }; + }, + toJSON(message) { + const obj = {}; + if (message.id !== undefined && message.id !== "") { + obj.id = message.id; + } + if (message.state !== undefined && message.state !== "") { + obj.state = message.state; + } + if (message.readerKey !== undefined && message.readerKey !== "") { + obj.readerKey = message.readerKey; + } + if (message.channel !== undefined && message.channel !== "") { + obj.channel = message.channel; + } + if (message.startSeq !== undefined && message.startSeq !== "") { + obj.startSeq = message.startSeq; + } + return obj; + }, + create(base) { + return MailboxSubscription.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a, _b, _c, _d, _e; + const message = createBaseMailboxSubscription(); + message.id = (_a = object.id) !== null && _a !== void 0 ? _a : ""; + message.state = (_b = object.state) !== null && _b !== void 0 ? _b : ""; + message.readerKey = (_c = object.readerKey) !== null && _c !== void 0 ? _c : ""; + message.channel = (_d = object.channel) !== null && _d !== void 0 ? _d : ""; + message.startSeq = (_e = object.startSeq) !== null && _e !== void 0 ? _e : ""; + return message; + }, +}; +function createBaseChangeDataCaptureSubscription() { + return { id: "", state: "", matchers: [], startSeq: "" }; +} +export const ChangeDataCaptureSubscription = { + encode(message, writer = _m0.Writer.create()) { + if (message.id !== undefined && message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.state !== undefined && message.state !== "") { + writer.uint32(18).string(message.state); + } + if (message.matchers !== undefined && message.matchers.length !== 0) { + for (const v of message.matchers) { + RecordMatcher.encode(v, writer.uint32(26).fork()).ldelim(); + } + } + if (message.startSeq !== undefined && message.startSeq !== "") { + writer.uint32(34).string(message.startSeq); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseChangeDataCaptureSubscription(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + message.id = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + message.state = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + message.matchers.push(RecordMatcher.decode(reader, reader.uint32())); + continue; + case 4: + if (tag !== 34) { + break; + } + message.startSeq = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + id: isSet(object.id) ? globalThis.String(object.id) : "", + state: isSet(object.state) ? globalThis.String(object.state) : "", + matchers: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.matchers) + ? object.matchers.map((e) => RecordMatcher.fromJSON(e)) + : [], + startSeq: isSet(object.startSeq) ? globalThis.String(object.startSeq) : "", + }; + }, + toJSON(message) { + var _a; + const obj = {}; + if (message.id !== undefined && message.id !== "") { + obj.id = message.id; + } + if (message.state !== undefined && message.state !== "") { + obj.state = message.state; + } + if ((_a = message.matchers) === null || _a === void 0 ? void 0 : _a.length) { + obj.matchers = message.matchers.map((e) => RecordMatcher.toJSON(e)); + } + if (message.startSeq !== undefined && message.startSeq !== "") { + obj.startSeq = message.startSeq; + } + return obj; + }, + create(base) { + return ChangeDataCaptureSubscription.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a, _b, _c, _d; + const message = createBaseChangeDataCaptureSubscription(); + message.id = (_a = object.id) !== null && _a !== void 0 ? _a : ""; + message.state = (_b = object.state) !== null && _b !== void 0 ? _b : ""; + message.matchers = ((_c = object.matchers) === null || _c === void 0 ? void 0 : _c.map((e) => RecordMatcher.fromPartial(e))) || []; + message.startSeq = (_d = object.startSeq) !== null && _d !== void 0 ? _d : ""; + return message; + }, +}; +function createBaseRecordMatcher() { + return { database: "", table: "", primaryKeys: [] }; +} +export const RecordMatcher = { + encode(message, writer = _m0.Writer.create()) { + if (message.database !== undefined && message.database !== "") { + writer.uint32(10).string(message.database); + } + if (message.table !== undefined && message.table !== "") { + writer.uint32(18).string(message.table); + } + if (message.primaryKeys !== undefined && message.primaryKeys.length !== 0) { + for (const v of message.primaryKeys) { + Value.encode(Value.wrap(v), writer.uint32(26).fork()).ldelim(); + } + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRecordMatcher(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + message.database = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + message.table = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + message.primaryKeys.push(Value.unwrap(Value.decode(reader, reader.uint32()))); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + database: isSet(object.database) ? globalThis.String(object.database) : "", + table: isSet(object.table) ? globalThis.String(object.table) : "", + primaryKeys: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.primaryKeys) ? [...object.primaryKeys] : [], + }; + }, + toJSON(message) { + var _a; + const obj = {}; + if (message.database !== undefined && message.database !== "") { + obj.database = message.database; + } + if (message.table !== undefined && message.table !== "") { + obj.table = message.table; + } + if ((_a = message.primaryKeys) === null || _a === void 0 ? void 0 : _a.length) { + obj.primaryKeys = message.primaryKeys; + } + return obj; + }, + create(base) { + return RecordMatcher.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a, _b, _c; + const message = createBaseRecordMatcher(); + message.database = (_a = object.database) !== null && _a !== void 0 ? _a : ""; + message.table = (_b = object.table) !== null && _b !== void 0 ? _b : ""; + message.primaryKeys = ((_c = object.primaryKeys) === null || _c === void 0 ? void 0 : _c.map((e) => e)) || []; + return message; + }, +}; +function createBaseNefarioSubscription() { + return { id: "", state: "", processUid: "", channel: "", startSeq: "" }; +} +export const NefarioSubscription = { + encode(message, writer = _m0.Writer.create()) { + if (message.id !== undefined && message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.state !== undefined && message.state !== "") { + writer.uint32(18).string(message.state); + } + if (message.processUid !== undefined && message.processUid !== "") { + writer.uint32(26).string(message.processUid); + } + if (message.channel !== undefined && message.channel !== "") { + writer.uint32(34).string(message.channel); + } + if (message.startSeq !== undefined && message.startSeq !== "") { + writer.uint32(42).string(message.startSeq); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseNefarioSubscription(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + message.id = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + message.state = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + message.processUid = reader.string(); + continue; + case 4: + if (tag !== 34) { + break; + } + message.channel = reader.string(); + continue; + case 5: + if (tag !== 42) { + break; + } + message.startSeq = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + id: isSet(object.id) ? globalThis.String(object.id) : "", + state: isSet(object.state) ? globalThis.String(object.state) : "", + processUid: isSet(object.processUid) ? globalThis.String(object.processUid) : "", + channel: isSet(object.channel) ? globalThis.String(object.channel) : "", + startSeq: isSet(object.startSeq) ? globalThis.String(object.startSeq) : "", + }; + }, + toJSON(message) { + const obj = {}; + if (message.id !== undefined && message.id !== "") { + obj.id = message.id; + } + if (message.state !== undefined && message.state !== "") { + obj.state = message.state; + } + if (message.processUid !== undefined && message.processUid !== "") { + obj.processUid = message.processUid; + } + if (message.channel !== undefined && message.channel !== "") { + obj.channel = message.channel; + } + if (message.startSeq !== undefined && message.startSeq !== "") { + obj.startSeq = message.startSeq; + } + return obj; + }, + create(base) { + return NefarioSubscription.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a, _b, _c, _d, _e; + const message = createBaseNefarioSubscription(); + message.id = (_a = object.id) !== null && _a !== void 0 ? _a : ""; + message.state = (_b = object.state) !== null && _b !== void 0 ? _b : ""; + message.processUid = (_c = object.processUid) !== null && _c !== void 0 ? _c : ""; + message.channel = (_d = object.channel) !== null && _d !== void 0 ? _d : ""; + message.startSeq = (_e = object.startSeq) !== null && _e !== void 0 ? _e : ""; + return message; + }, +}; +function createBaseUnsubscribe() { + return { id: "" }; +} +export const Unsubscribe = { + encode(message, writer = _m0.Writer.create()) { + if (message.id !== undefined && message.id !== "") { + writer.uint32(10).string(message.id); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUnsubscribe(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + message.id = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { id: isSet(object.id) ? globalThis.String(object.id) : "" }; + }, + toJSON(message) { + const obj = {}; + if (message.id !== undefined && message.id !== "") { + obj.id = message.id; + } + return obj; + }, + create(base) { + return Unsubscribe.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a; + const message = createBaseUnsubscribe(); + message.id = (_a = object.id) !== null && _a !== void 0 ? _a : ""; + return message; + }, +}; +function createBaseCreateMailboxRequest() { + return { + channels: [], + privateMetadata: undefined, + publicMetadata: undefined, + purgeTimeoutInMillis: 0, + closeTimeoutInMillis: 0, + extraData: undefined, + }; +} +export const CreateMailboxRequest = { + encode(message, writer = _m0.Writer.create()) { + if (message.channels !== undefined && message.channels.length !== 0) { + for (const v of message.channels) { + writer.uint32(10).string(v); + } + } + if (message.privateMetadata !== undefined) { + Struct.encode(Struct.wrap(message.privateMetadata), writer.uint32(18).fork()).ldelim(); + } + if (message.publicMetadata !== undefined) { + Struct.encode(Struct.wrap(message.publicMetadata), writer.uint32(26).fork()).ldelim(); + } + if (message.purgeTimeoutInMillis !== undefined && message.purgeTimeoutInMillis !== 0) { + writer.uint32(32).int64(message.purgeTimeoutInMillis); + } + if (message.closeTimeoutInMillis !== undefined && message.closeTimeoutInMillis !== 0) { + writer.uint32(40).int64(message.closeTimeoutInMillis); + } + if (message.extraData !== undefined) { + Struct.encode(Struct.wrap(message.extraData), writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateMailboxRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + message.channels.push(reader.string()); + continue; + case 2: + if (tag !== 18) { + break; + } + message.privateMetadata = Struct.unwrap(Struct.decode(reader, reader.uint32())); + continue; + case 3: + if (tag !== 26) { + break; + } + message.publicMetadata = Struct.unwrap(Struct.decode(reader, reader.uint32())); + continue; + case 4: + if (tag !== 32) { + break; + } + message.purgeTimeoutInMillis = longToNumber(reader.int64()); + continue; + case 5: + if (tag !== 40) { + break; + } + message.closeTimeoutInMillis = longToNumber(reader.int64()); + continue; + case 6: + if (tag !== 50) { + break; + } + message.extraData = Struct.unwrap(Struct.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + channels: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.channels) ? object.channels.map((e) => globalThis.String(e)) : [], + privateMetadata: isObject(object.privateMetadata) ? object.privateMetadata : undefined, + publicMetadata: isObject(object.publicMetadata) ? object.publicMetadata : undefined, + purgeTimeoutInMillis: isSet(object.purgeTimeoutInMillis) ? globalThis.Number(object.purgeTimeoutInMillis) : 0, + closeTimeoutInMillis: isSet(object.closeTimeoutInMillis) ? globalThis.Number(object.closeTimeoutInMillis) : 0, + extraData: isObject(object.extraData) ? object.extraData : undefined, + }; + }, + toJSON(message) { + var _a; + const obj = {}; + if ((_a = message.channels) === null || _a === void 0 ? void 0 : _a.length) { + obj.channels = message.channels; + } + if (message.privateMetadata !== undefined) { + obj.privateMetadata = message.privateMetadata; + } + if (message.publicMetadata !== undefined) { + obj.publicMetadata = message.publicMetadata; + } + if (message.purgeTimeoutInMillis !== undefined && message.purgeTimeoutInMillis !== 0) { + obj.purgeTimeoutInMillis = Math.round(message.purgeTimeoutInMillis); + } + if (message.closeTimeoutInMillis !== undefined && message.closeTimeoutInMillis !== 0) { + obj.closeTimeoutInMillis = Math.round(message.closeTimeoutInMillis); + } + if (message.extraData !== undefined) { + obj.extraData = message.extraData; + } + return obj; + }, + create(base) { + return CreateMailboxRequest.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a, _b, _c, _d, _e, _f; + const message = createBaseCreateMailboxRequest(); + message.channels = ((_a = object.channels) === null || _a === void 0 ? void 0 : _a.map((e) => e)) || []; + message.privateMetadata = (_b = object.privateMetadata) !== null && _b !== void 0 ? _b : undefined; + message.publicMetadata = (_c = object.publicMetadata) !== null && _c !== void 0 ? _c : undefined; + message.purgeTimeoutInMillis = (_d = object.purgeTimeoutInMillis) !== null && _d !== void 0 ? _d : 0; + message.closeTimeoutInMillis = (_e = object.closeTimeoutInMillis) !== null && _e !== void 0 ? _e : 0; + message.extraData = (_f = object.extraData) !== null && _f !== void 0 ? _f : undefined; + return message; + }, +}; +function createBaseCreateMailboxResponse() { + return { adminKey: "", address: "", readerKey: "", channels: [] }; +} +export const CreateMailboxResponse = { + encode(message, writer = _m0.Writer.create()) { + if (message.adminKey !== undefined && message.adminKey !== "") { + writer.uint32(10).string(message.adminKey); + } + if (message.address !== undefined && message.address !== "") { + writer.uint32(18).string(message.address); + } + if (message.readerKey !== undefined && message.readerKey !== "") { + writer.uint32(26).string(message.readerKey); + } + if (message.channels !== undefined && message.channels.length !== 0) { + for (const v of message.channels) { + writer.uint32(34).string(v); + } + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateMailboxResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + message.adminKey = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + message.address = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + message.readerKey = reader.string(); + continue; + case 4: + if (tag !== 34) { + break; + } + message.channels.push(reader.string()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + adminKey: isSet(object.adminKey) ? globalThis.String(object.adminKey) : "", + address: isSet(object.address) ? globalThis.String(object.address) : "", + readerKey: isSet(object.readerKey) ? globalThis.String(object.readerKey) : "", + channels: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.channels) ? object.channels.map((e) => globalThis.String(e)) : [], + }; + }, + toJSON(message) { + var _a; + const obj = {}; + if (message.adminKey !== undefined && message.adminKey !== "") { + obj.adminKey = message.adminKey; + } + if (message.address !== undefined && message.address !== "") { + obj.address = message.address; + } + if (message.readerKey !== undefined && message.readerKey !== "") { + obj.readerKey = message.readerKey; + } + if ((_a = message.channels) === null || _a === void 0 ? void 0 : _a.length) { + obj.channels = message.channels; + } + return obj; + }, + create(base) { + return CreateMailboxResponse.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a, _b, _c, _d; + const message = createBaseCreateMailboxResponse(); + message.adminKey = (_a = object.adminKey) !== null && _a !== void 0 ? _a : ""; + message.address = (_b = object.address) !== null && _b !== void 0 ? _b : ""; + message.readerKey = (_c = object.readerKey) !== null && _c !== void 0 ? _c : ""; + message.channels = ((_d = object.channels) === null || _d === void 0 ? void 0 : _d.map((e) => e)) || []; + return message; + }, +}; +function createBaseAddChannelRequest() { + return { adminKey: "", channels: [] }; +} +export const AddChannelRequest = { + encode(message, writer = _m0.Writer.create()) { + if (message.adminKey !== undefined && message.adminKey !== "") { + writer.uint32(10).string(message.adminKey); + } + if (message.channels !== undefined && message.channels.length !== 0) { + for (const v of message.channels) { + writer.uint32(18).string(v); + } + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAddChannelRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + message.adminKey = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + message.channels.push(reader.string()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(object) { + return { + adminKey: isSet(object.adminKey) ? globalThis.String(object.adminKey) : "", + channels: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.channels) ? object.channels.map((e) => globalThis.String(e)) : [], + }; + }, + toJSON(message) { + var _a; + const obj = {}; + if (message.adminKey !== undefined && message.adminKey !== "") { + obj.adminKey = message.adminKey; + } + if ((_a = message.channels) === null || _a === void 0 ? void 0 : _a.length) { + obj.channels = message.channels; + } + return obj; + }, + create(base) { + return AddChannelRequest.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(object) { + var _a, _b; + const message = createBaseAddChannelRequest(); + message.adminKey = (_a = object.adminKey) !== null && _a !== void 0 ? _a : ""; + message.channels = ((_b = object.channels) === null || _b === void 0 ? void 0 : _b.map((e) => e)) || []; + return message; + }, +}; +function createBaseAddChannelResponse() { + return {}; +} +export const AddChannelResponse = { + encode(_, writer = _m0.Writer.create()) { + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAddChannelResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + fromJSON(_) { + return {}; + }, + toJSON(_) { + const obj = {}; + return obj; + }, + create(base) { + return AddChannelResponse.fromPartial(base !== null && base !== void 0 ? base : {}); + }, + fromPartial(_) { + const message = createBaseAddChannelResponse(); + return message; + }, +}; +export const HermesServiceServiceName = "hermes.HermesService"; +export class HermesServiceClientImpl { + constructor(rpc, opts) { + this.service = (opts === null || opts === void 0 ? void 0 : opts.service) || HermesServiceServiceName; + this.rpc = rpc; + this.SendReceive = this.SendReceive.bind(this); + this.CreateMailbox = this.CreateMailbox.bind(this); + this.AddChannel = this.AddChannel.bind(this); + } + SendReceive(request) { + const data = request.pipe(map((request) => MessageFromClient.encode(request).finish())); + const result = this.rpc.bidirectionalStreamingRequest(this.service, "SendReceive", data); + return result.pipe(map((data) => MessageToClient.decode(_m0.Reader.create(data)))); + } + CreateMailbox(request) { + const data = CreateMailboxRequest.encode(request).finish(); + const promise = this.rpc.request(this.service, "CreateMailbox", data); + return promise.then((data) => CreateMailboxResponse.decode(_m0.Reader.create(data))); + } + AddChannel(request) { + const data = AddChannelRequest.encode(request).finish(); + const promise = this.rpc.request(this.service, "AddChannel", data); + return promise.then((data) => AddChannelResponse.decode(_m0.Reader.create(data))); + } +} +function bytesFromBase64(b64) { + if (globalThis.Buffer) { + return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); + } + else { + const bin = globalThis.atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; + } +} +function base64FromBytes(arr) { + if (globalThis.Buffer) { + return globalThis.Buffer.from(arr).toString("base64"); + } + else { + const bin = []; + arr.forEach((byte) => { + bin.push(globalThis.String.fromCharCode(byte)); + }); + return globalThis.btoa(bin.join("")); + } +} +function longToNumber(long) { + if (long.gt(globalThis.Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} +if (_m0.util.Long !== Long) { + _m0.util.Long = Long; + _m0.configure(); +} +function isObject(value) { + return typeof value === "object" && value !== null; +} +function isSet(value) { + return value !== null && value !== undefined; +} diff --git a/node_modules/.bin/tsc b/node_modules/.bin/tsc index eea8856..c4864b9 100644 --- a/node_modules/.bin/tsc +++ b/node_modules/.bin/tsc @@ -10,7 +10,7 @@ case `uname` in esac if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../tsc/bin/tsc" "$@" + exec "$basedir/node" "$basedir/../typescript/bin/tsc" "$@" else - exec node "$basedir/../tsc/bin/tsc" "$@" + exec node "$basedir/../typescript/bin/tsc" "$@" fi diff --git a/node_modules/.bin/tsc.cmd b/node_modules/.bin/tsc.cmd index 3d98661..40bf128 100644 --- a/node_modules/.bin/tsc.cmd +++ b/node_modules/.bin/tsc.cmd @@ -14,4 +14,4 @@ IF EXIST "%dp0%\node.exe" ( SET PATHEXT=%PATHEXT:;.JS;=;% ) -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\tsc\bin\tsc" %* +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\typescript\bin\tsc" %* diff --git a/node_modules/.bin/tsc.ps1 b/node_modules/.bin/tsc.ps1 index 61e15d3..112413b 100644 --- a/node_modules/.bin/tsc.ps1 +++ b/node_modules/.bin/tsc.ps1 @@ -11,17 +11,17 @@ $ret=0 if (Test-Path "$basedir/node$exe") { # Support pipeline input if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../tsc/bin/tsc" $args + $input | & "$basedir/node$exe" "$basedir/../typescript/bin/tsc" $args } else { - & "$basedir/node$exe" "$basedir/../tsc/bin/tsc" $args + & "$basedir/node$exe" "$basedir/../typescript/bin/tsc" $args } $ret=$LASTEXITCODE } else { # Support pipeline input if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../tsc/bin/tsc" $args + $input | & "node$exe" "$basedir/../typescript/bin/tsc" $args } else { - & "node$exe" "$basedir/../tsc/bin/tsc" $args + & "node$exe" "$basedir/../typescript/bin/tsc" $args } $ret=$LASTEXITCODE } diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json index 79c56a4..d5a97c1 100644 --- a/node_modules/.package-lock.json +++ b/node_modules/.package-lock.json @@ -102,15 +102,6 @@ "tslib": "^2.1.0" } }, - "node_modules/tsc": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/tsc/-/tsc-2.0.4.tgz", - "integrity": "sha512-fzoSieZI5KKJVBYGvwbVZs/J5za84f2lSTLPYf6AGiIf43tZ3GNrI1QzTLcjtyDDP4aLxd46RTZq1nQxe7+k5Q==", - "dev": true, - "bin": { - "tsc": "bin/tsc" - } - }, "node_modules/tslib": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", diff --git a/node_modules/tsc/CONTRIBUTING.md b/node_modules/tsc/CONTRIBUTING.md deleted file mode 100644 index 7a6b6d8..0000000 --- a/node_modules/tsc/CONTRIBUTING.md +++ /dev/null @@ -1,3 +0,0 @@ -# Release - -`npm publish` diff --git a/node_modules/tsc/README.md b/node_modules/tsc/README.md deleted file mode 100644 index 18aec37..0000000 --- a/node_modules/tsc/README.md +++ /dev/null @@ -1,3 +0,0 @@ -## DEPRECATED. - -Use [`typescript`](https://www.npmjs.com/package/typescript) to get access to the `tsc` CLI command. diff --git a/node_modules/tsc/bin/tsc b/node_modules/tsc/bin/tsc deleted file mode 100644 index 3c0dab5..0000000 --- a/node_modules/tsc/bin/tsc +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env node -require('./tsc.js') diff --git a/node_modules/tsc/bin/tsc.js b/node_modules/tsc/bin/tsc.js deleted file mode 100644 index 50419f5..0000000 --- a/node_modules/tsc/bin/tsc.js +++ /dev/null @@ -1,49 +0,0 @@ -// @ts-check - -// https://stackoverflow.com/questions/9781218/how-to-change-node-jss-console-font-color -const colours = { - reset: "\x1b[0m", - bright: "\x1b[1m", - dim: "\x1b[2m", - underscore: "\x1b[4m", - blink: "\x1b[5m", - reverse: "\x1b[7m", - hidden: "\x1b[8m", - - fg: { - black: "\x1b[30m", - red: "\x1b[31m", - green: "\x1b[32m", - yellow: "\x1b[33m", - blue: "\x1b[34m", - magenta: "\x1b[35m", - cyan: "\x1b[36m", - white: "\x1b[37m", - crimson: "\x1b[38m" // Scarlet - }, - bg: { - black: "\x1b[40m", - red: "\x1b[41m", - green: "\x1b[42m", - yellow: "\x1b[43m", - blue: "\x1b[44m", - magenta: "\x1b[45m", - cyan: "\x1b[46m", - white: "\x1b[47m", - crimson: "\x1b[48m" - } -}; - - -console.log() -const msg = " This is not the tsc command you are looking for " -console.log(colours.bg.red + " ".repeat(msg.length) + colours.reset) -console.log(colours.bg.red + colours.fg.white + msg + colours.reset); -console.log(colours.bg.red + " ".repeat(msg.length) + colours.reset) - -console.log() -console.log(`To get access to the TypeScript compiler, ${colours.fg.blue}tsc${colours.reset}, from the command line either:\n`) -console.log(`- Use ${colours.bright}npm install typescript${colours.reset} to first add TypeScript to your project ${colours.bright}before${colours.reset} using npx`) -console.log(`- Use ${colours.bright}yarn${colours.reset} to avoid accidentally running code from un-installed packages`) - -process.exitCode = 1; \ No newline at end of file diff --git a/node_modules/tsc/package.json b/node_modules/tsc/package.json deleted file mode 100644 index e09ee53..0000000 --- a/node_modules/tsc/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "tsc", - "version": "2.0.4", - "description": "A deprecated release of the TypeScript compiler", - "main": "./bin/tsc.js", - "bin": { - "tsc": "./bin/tsc" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/basarat/tsc.git" - }, - "keywords": [ - "typescript" - ], - "author": "basaratali@gmail.com", - "license": "MIT", - "bugs": { - "url": "https://github.com/basarat/tsc/issues" - }, - "homepage": "https://github.com/basarat/tsc#readme" -} diff --git a/package-lock.json b/package-lock.json index 48a613d..29cad81 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,6 @@ "rxjs": "^7.8.1" }, "devDependencies": { - "tsc": "^2.0.4", "typescript": "^5.4.5" } }, @@ -116,15 +115,6 @@ "tslib": "^2.1.0" } }, - "node_modules/tsc": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/tsc/-/tsc-2.0.4.tgz", - "integrity": "sha512-fzoSieZI5KKJVBYGvwbVZs/J5za84f2lSTLPYf6AGiIf43tZ3GNrI1QzTLcjtyDDP4aLxd46RTZq1nQxe7+k5Q==", - "dev": true, - "bin": { - "tsc": "bin/tsc" - } - }, "node_modules/tslib": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", diff --git a/package.json b/package.json index 8dcf495..ff2bdb2 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,6 @@ "license": "ISC", "description": "", "devDependencies": { - "tsc": "^2.0.4", "typescript": "^5.4.5" }, "dependencies": { diff --git a/yarn.lock b/yarn.lock index 4785b4c..5088d39 100644 --- a/yarn.lock +++ b/yarn.lock @@ -92,11 +92,6 @@ rxjs@^7.8.1: dependencies: tslib "^2.1.0" -tsc@^2.0.4: - version "2.0.4" - resolved "https://registry.npmjs.org/tsc/-/tsc-2.0.4.tgz" - integrity sha512-fzoSieZI5KKJVBYGvwbVZs/J5za84f2lSTLPYf6AGiIf43tZ3GNrI1QzTLcjtyDDP4aLxd46RTZq1nQxe7+k5Q== - tslib@^2.1.0: version "2.6.2" resolved "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz"