重构websocket消息代理功能
添加Centrifuge消息客户端实现 websocket消息可支持json和protobuf两种协议
This commit is contained in:
parent
7fe73a8334
commit
a1a9eac588
@ -19,6 +19,7 @@
|
|||||||
"@stomp/stompjs": "^7.0.0",
|
"@stomp/stompjs": "^7.0.0",
|
||||||
"alova": "^2.7.1",
|
"alova": "^2.7.1",
|
||||||
"axios": "^1.4.0",
|
"axios": "^1.4.0",
|
||||||
|
"centrifuge": "^4.0.1",
|
||||||
"google-protobuf": "^3.21.2",
|
"google-protobuf": "^3.21.2",
|
||||||
"js-base64": "^3.7.5",
|
"js-base64": "^3.7.5",
|
||||||
"pinia": "^2.0.11",
|
"pinia": "^2.0.11",
|
||||||
|
@ -9,5 +9,6 @@ export function getHttpBase() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function getWebsocketUrl() {
|
export function getWebsocketUrl() {
|
||||||
return `ws://${getHost()}/ws-default`;
|
const host = '192.168.3.233:8000';
|
||||||
|
return `ws://${host}/connection/websocket`;
|
||||||
}
|
}
|
||||||
|
@ -21,10 +21,10 @@ import {
|
|||||||
import { AbsorbablePosition } from '../graphic';
|
import { AbsorbablePosition } from '../graphic';
|
||||||
import {
|
import {
|
||||||
AppWsMsgBroker,
|
AppWsMsgBroker,
|
||||||
StompCli,
|
WsMsgCli,
|
||||||
type AppStateSubscription,
|
type AppStateSubscription,
|
||||||
type StompCliOption,
|
type MessageCliOption,
|
||||||
} from '../message/WsMsgBroker';
|
} from '../message';
|
||||||
import { OperationRecord } from '../operation/JlOperation';
|
import { OperationRecord } from '../operation/JlOperation';
|
||||||
import {
|
import {
|
||||||
AnimationManager,
|
AnimationManager,
|
||||||
@ -498,10 +498,10 @@ export class GraphicApp extends EventEmitter<GraphicAppEvents> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 使能websocket Stomp通信
|
* 启动websocket消息客户端
|
||||||
*/
|
*/
|
||||||
enableWsStomp(options: StompCliOption) {
|
enableWsMassaging(options: MessageCliOption) {
|
||||||
StompCli.new(options);
|
WsMsgCli.new(options);
|
||||||
this.wsMsgBroker = new AppWsMsgBroker(this);
|
this.wsMsgBroker = new AppWsMsgBroker(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -513,7 +513,7 @@ export class GraphicApp extends EventEmitter<GraphicAppEvents> {
|
|||||||
// console.log('APP订阅', sub)
|
// console.log('APP订阅', sub)
|
||||||
this.wsMsgBroker.subscribe(sub);
|
this.wsMsgBroker.subscribe(sub);
|
||||||
} else {
|
} else {
|
||||||
throw new Error('请先打开StompClient, 执行app.enableWebsocket()');
|
throw new Error('订阅消息需先启动消息代理, 执行app.enableWebsocket()');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
40
src/jlgraphic/message/BasicMessageClient.ts
Normal file
40
src/jlgraphic/message/BasicMessageClient.ts
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
|
import EventEmitter from 'eventemitter3';
|
||||||
|
import { IMessageClient } from './MessageBroker';
|
||||||
|
|
||||||
|
export type MessageHandler = (data: any) => void;
|
||||||
|
|
||||||
|
export interface MessageClientEvents {
|
||||||
|
connecting: [ctx: any];
|
||||||
|
connected: [ctx: any];
|
||||||
|
disconnected: [ctx: any];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订阅接口
|
||||||
|
*/
|
||||||
|
export interface ISubscription {
|
||||||
|
/**
|
||||||
|
* 取消订阅
|
||||||
|
*/
|
||||||
|
unsubscribe(): void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export abstract class MessageClient
|
||||||
|
extends EventEmitter<MessageClientEvents>
|
||||||
|
implements IMessageClient
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 订阅消息
|
||||||
|
* @param destination
|
||||||
|
* @param handle
|
||||||
|
*/
|
||||||
|
abstract subscribe(
|
||||||
|
destination: string,
|
||||||
|
handle: MessageHandler
|
||||||
|
): ISubscription;
|
||||||
|
|
||||||
|
abstract get connected(): boolean;
|
||||||
|
|
||||||
|
abstract close(): void;
|
||||||
|
}
|
70
src/jlgraphic/message/CentrifugeBroker.ts
Normal file
70
src/jlgraphic/message/CentrifugeBroker.ts
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
import { Centrifuge, State } from 'centrifuge';
|
||||||
|
import CentrifugeProtobuf from 'centrifuge/build/protobuf';
|
||||||
|
import { MessageCliOption } from './MessageBroker';
|
||||||
|
import {
|
||||||
|
ISubscription,
|
||||||
|
MessageClient,
|
||||||
|
MessageHandler,
|
||||||
|
} from './BasicMessageClient';
|
||||||
|
|
||||||
|
export class CentrifugeMessagingClient extends MessageClient {
|
||||||
|
options: MessageCliOption;
|
||||||
|
cli: Centrifuge;
|
||||||
|
constructor(options: MessageCliOption) {
|
||||||
|
super();
|
||||||
|
this.options = options;
|
||||||
|
if (this.options.protocol === 'json') {
|
||||||
|
this.cli = new Centrifuge(options.wsUrl, {
|
||||||
|
token: options.token,
|
||||||
|
protocol: options.protocol,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.cli = new CentrifugeProtobuf(options.wsUrl, {
|
||||||
|
token: options.token,
|
||||||
|
protocol: options.protocol,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
this.cli
|
||||||
|
.on('connecting', (ctx) => {
|
||||||
|
console.debug(`centrifuge连接中: ${ctx}, ${ctx.reason}`);
|
||||||
|
this.emit('connecting', ctx);
|
||||||
|
})
|
||||||
|
.on('connected', (ctx) => {
|
||||||
|
console.debug(`连接成功: ${ctx.transport}`);
|
||||||
|
this.emit('connected', ctx);
|
||||||
|
})
|
||||||
|
.on('disconnected', (ctx) => {
|
||||||
|
console.log(`断开连接: ${ctx.code}, ${ctx.reason}`);
|
||||||
|
this.emit('disconnected', ctx);
|
||||||
|
})
|
||||||
|
.on('error', (ctx) => {
|
||||||
|
console.error('centrifuge错误', ctx);
|
||||||
|
})
|
||||||
|
.connect();
|
||||||
|
}
|
||||||
|
|
||||||
|
get connected(): boolean {
|
||||||
|
return this.cli.state === State.Connected;
|
||||||
|
}
|
||||||
|
|
||||||
|
subscribe(destination: string, handle: MessageHandler): ISubscription {
|
||||||
|
const sub = this.cli.newSubscription(destination);
|
||||||
|
sub
|
||||||
|
.on('publication', (ctx) => {
|
||||||
|
if (this.options.protocol === 'json') {
|
||||||
|
console.log('收到centrifuge消息:', ctx.data);
|
||||||
|
}
|
||||||
|
handle(ctx.data);
|
||||||
|
})
|
||||||
|
.on('subscribed', (ctx) => {
|
||||||
|
console.log('订阅centrifuge服务消息成功', destination, ctx);
|
||||||
|
})
|
||||||
|
.subscribe();
|
||||||
|
return sub;
|
||||||
|
}
|
||||||
|
|
||||||
|
close(): void {
|
||||||
|
this.cli.disconnect();
|
||||||
|
}
|
||||||
|
}
|
248
src/jlgraphic/message/MessageBroker.ts
Normal file
248
src/jlgraphic/message/MessageBroker.ts
Normal file
@ -0,0 +1,248 @@
|
|||||||
|
import EventEmitter from 'eventemitter3';
|
||||||
|
import { CentrifugeMessagingClient } from './CentrifugeBroker';
|
||||||
|
import { StompMessagingClient } from './WsMsgBroker';
|
||||||
|
import { GraphicState } from '../core';
|
||||||
|
import { GraphicApp } from '../app';
|
||||||
|
import {
|
||||||
|
ISubscription,
|
||||||
|
MessageClientEvents,
|
||||||
|
MessageHandler,
|
||||||
|
} from './BasicMessageClient';
|
||||||
|
|
||||||
|
export enum ClientEngine {
|
||||||
|
Stomp,
|
||||||
|
Centrifugo,
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MessageCliOption {
|
||||||
|
/**
|
||||||
|
* 客户端引擎
|
||||||
|
*/
|
||||||
|
engine?: ClientEngine;
|
||||||
|
/**
|
||||||
|
* 消息协议,默认protobuf
|
||||||
|
*/
|
||||||
|
protocol?: 'json' | 'protobuf';
|
||||||
|
/**
|
||||||
|
* websocket url地址
|
||||||
|
*/
|
||||||
|
wsUrl: string;
|
||||||
|
/**
|
||||||
|
* 认证token
|
||||||
|
*/
|
||||||
|
token?: string;
|
||||||
|
/**
|
||||||
|
* 认证失败处理
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
onAuthenticationFailed?: () => void;
|
||||||
|
/**
|
||||||
|
* 连接成功处理
|
||||||
|
* @param ctx
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
onConnected?: (ctx: unknown) => void;
|
||||||
|
/**
|
||||||
|
* 端口连接处理
|
||||||
|
*/
|
||||||
|
onDisconnected?: (ctx: unknown) => void;
|
||||||
|
reconnectDelay?: number; // 重连延时,默认3秒,设置为0不重连.
|
||||||
|
heartbeatIncoming?: number; // 服务端过来的心跳间隔,默认30秒
|
||||||
|
heartbeatOutgoing?: number; // 到服务端的心跳间隔,默认30秒
|
||||||
|
}
|
||||||
|
|
||||||
|
const DefaultStompOption: MessageCliOption = {
|
||||||
|
engine: ClientEngine.Stomp,
|
||||||
|
protocol: 'protobuf',
|
||||||
|
wsUrl: '',
|
||||||
|
token: '',
|
||||||
|
reconnectDelay: 3000,
|
||||||
|
heartbeatIncoming: 30000,
|
||||||
|
heartbeatOutgoing: 30000,
|
||||||
|
};
|
||||||
|
|
||||||
|
export interface IMessageClient extends EventEmitter<MessageClientEvents> {
|
||||||
|
/**
|
||||||
|
* 订阅消息
|
||||||
|
* @param destination
|
||||||
|
* @param handle
|
||||||
|
*/
|
||||||
|
subscribe(destination: string, handle: MessageHandler): ISubscription;
|
||||||
|
|
||||||
|
get connected(): boolean;
|
||||||
|
|
||||||
|
close(): void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class WsMsgCli {
|
||||||
|
private static client: IMessageClient;
|
||||||
|
private static options: MessageCliOption;
|
||||||
|
private static appMsgBroker: AppWsMsgBroker[] = [];
|
||||||
|
static new(options: MessageCliOption) {
|
||||||
|
if (WsMsgCli.client) {
|
||||||
|
// 已经创建
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
WsMsgCli.options = Object.assign({}, DefaultStompOption, options);
|
||||||
|
if (WsMsgCli.options.engine == ClientEngine.Centrifugo) {
|
||||||
|
WsMsgCli.client = new CentrifugeMessagingClient(WsMsgCli.options);
|
||||||
|
} else {
|
||||||
|
WsMsgCli.client = new StompMessagingClient(WsMsgCli.options);
|
||||||
|
// WsMsgCli.client.onStompError = (frame: Frame) => {
|
||||||
|
// const errMsg = frame.headers['message'];
|
||||||
|
// if (errMsg === '401') {
|
||||||
|
// console.warn('认证失败,断开WebSocket连接');
|
||||||
|
// StompCli.close();
|
||||||
|
// if (StompCli.options.onAuthenticationFailed) {
|
||||||
|
// StompCli.options.onAuthenticationFailed();
|
||||||
|
// }
|
||||||
|
// } else {
|
||||||
|
// console.error('收到Stomp错误消息', frame);
|
||||||
|
// }
|
||||||
|
// };
|
||||||
|
}
|
||||||
|
const cli = WsMsgCli.client;
|
||||||
|
cli.on('connected', () => {
|
||||||
|
WsMsgCli.emitConnectStateChangeEvent(true);
|
||||||
|
});
|
||||||
|
cli.on('disconnected', () => {
|
||||||
|
WsMsgCli.emitConnectStateChangeEvent(false);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
static emitConnectStateChangeEvent(connected: boolean) {
|
||||||
|
WsMsgCli.appMsgBroker.forEach((broker) => {
|
||||||
|
broker.app.emit('websocket-connect-state-change', connected);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
static isConnected(): boolean {
|
||||||
|
return WsMsgCli.client && WsMsgCli.client.connected;
|
||||||
|
}
|
||||||
|
|
||||||
|
static trySubscribe(
|
||||||
|
destination: string,
|
||||||
|
handler: MessageHandler
|
||||||
|
): ISubscription {
|
||||||
|
return WsMsgCli.client.subscribe(destination, handler);
|
||||||
|
// if (WsMsgCli.isConnected()) {
|
||||||
|
// }
|
||||||
|
// return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
static registerAppMsgBroker(broker: AppWsMsgBroker) {
|
||||||
|
WsMsgCli.appMsgBroker.push(broker);
|
||||||
|
}
|
||||||
|
|
||||||
|
static removeAppMsgBroker(broker: AppWsMsgBroker) {
|
||||||
|
const index = WsMsgCli.appMsgBroker.findIndex((mb) => mb == broker);
|
||||||
|
if (index >= 0) {
|
||||||
|
WsMsgCli.appMsgBroker.splice(index, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static hasAppMsgBroker(): boolean {
|
||||||
|
return WsMsgCli.appMsgBroker.length > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关闭websocket连接
|
||||||
|
*/
|
||||||
|
static close() {
|
||||||
|
if (WsMsgCli.client) {
|
||||||
|
WsMsgCli.client.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 状态订阅消息转换器
|
||||||
|
export type GraphicStateMessageConvert = (
|
||||||
|
message: Uint8Array
|
||||||
|
) => GraphicState[];
|
||||||
|
|
||||||
|
// 订阅消息处理器
|
||||||
|
export type SubscriptionMessageHandle = (message: Uint8Array) => void;
|
||||||
|
|
||||||
|
// 图形app状态订阅
|
||||||
|
export interface AppStateSubscription {
|
||||||
|
/**
|
||||||
|
* 订阅路径
|
||||||
|
*/
|
||||||
|
destination: string;
|
||||||
|
/**
|
||||||
|
* 图形状态消息转换
|
||||||
|
*/
|
||||||
|
messageConverter?: GraphicStateMessageConvert;
|
||||||
|
/**
|
||||||
|
* 订阅消息处理
|
||||||
|
*/
|
||||||
|
messageHandle?: SubscriptionMessageHandle;
|
||||||
|
/**
|
||||||
|
* 订阅成功对象,用于取消订阅
|
||||||
|
* 非客户端使用
|
||||||
|
*/
|
||||||
|
subscription?: ISubscription;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 图形APP的websocket消息代理
|
||||||
|
*/
|
||||||
|
export class AppWsMsgBroker {
|
||||||
|
app: GraphicApp;
|
||||||
|
subscriptions: Map<string, AppStateSubscription> = new Map<
|
||||||
|
string,
|
||||||
|
AppStateSubscription
|
||||||
|
>();
|
||||||
|
|
||||||
|
constructor(app: GraphicApp) {
|
||||||
|
this.app = app;
|
||||||
|
WsMsgCli.registerAppMsgBroker(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
subscribe(sub: AppStateSubscription) {
|
||||||
|
this.unsbuscribe(sub.destination); // 先尝试取消之前订阅
|
||||||
|
sub.subscription = WsMsgCli.trySubscribe(sub.destination, (data) => {
|
||||||
|
if (sub.messageConverter) {
|
||||||
|
const graphicStates = sub.messageConverter(data);
|
||||||
|
this.app.handleGraphicStates(graphicStates);
|
||||||
|
} else if (sub.messageHandle) {
|
||||||
|
sub.messageHandle(data);
|
||||||
|
} else {
|
||||||
|
console.error(
|
||||||
|
`订阅destination:${sub.destination}没有消息处理器或图形状态消息转换器`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.subscriptions.set(sub.destination, sub);
|
||||||
|
}
|
||||||
|
|
||||||
|
resubscribe() {
|
||||||
|
this.subscriptions.forEach((record) => {
|
||||||
|
this.subscribe(record);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
unsbuscribe(destination: string) {
|
||||||
|
const oldSub = this.subscriptions.get(destination);
|
||||||
|
if (oldSub) {
|
||||||
|
if (oldSub.subscription && WsMsgCli.isConnected()) {
|
||||||
|
oldSub.subscription.unsubscribe();
|
||||||
|
}
|
||||||
|
oldSub.subscription = undefined;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
unsbuscribeAll() {
|
||||||
|
this.subscriptions.forEach((record) => {
|
||||||
|
this.unsbuscribe(record.destination);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消所有订阅,从通用Stomp客户端移除此消息代理
|
||||||
|
*/
|
||||||
|
close() {
|
||||||
|
WsMsgCli.removeAppMsgBroker(this);
|
||||||
|
this.unsbuscribeAll();
|
||||||
|
}
|
||||||
|
}
|
@ -1,246 +1,74 @@
|
|||||||
|
import { Client as StompClient, type Frame } from '@stomp/stompjs';
|
||||||
|
import { MessageCliOption } from './MessageBroker';
|
||||||
import {
|
import {
|
||||||
Client as StompClient,
|
ISubscription,
|
||||||
StompSubscription,
|
MessageClient,
|
||||||
type Frame,
|
MessageHandler,
|
||||||
type Message,
|
} from './BasicMessageClient';
|
||||||
type messageCallbackType,
|
|
||||||
} from '@stomp/stompjs';
|
|
||||||
import type { GraphicApp } from '../app/JlGraphicApp';
|
|
||||||
import { GraphicState } from '../core/JlGraphic';
|
|
||||||
|
|
||||||
export interface StompCliOption {
|
export class StompMessagingClient extends MessageClient {
|
||||||
/**
|
options: MessageCliOption;
|
||||||
* websocket url地址
|
cli: StompClient;
|
||||||
*/
|
constructor(options: MessageCliOption) {
|
||||||
wsUrl: string;
|
super();
|
||||||
/**
|
this.options = options;
|
||||||
* 认证token
|
this.cli = new StompClient({
|
||||||
*/
|
brokerURL: options.wsUrl,
|
||||||
token?: string;
|
|
||||||
/**
|
|
||||||
* 认证失败处理
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
onAuthenticationFailed?: () => void;
|
|
||||||
reconnectDelay?: number; // 重连延时,默认3秒,设置为0不重连.
|
|
||||||
heartbeatIncoming?: number; // 服务端过来的心跳间隔,默认30秒
|
|
||||||
heartbeatOutgoing?: number; // 到服务端的心跳间隔,默认30秒
|
|
||||||
}
|
|
||||||
|
|
||||||
const DefaultStompOption: StompCliOption = {
|
|
||||||
wsUrl: '',
|
|
||||||
token: '',
|
|
||||||
reconnectDelay: 3000,
|
|
||||||
heartbeatIncoming: 30000,
|
|
||||||
heartbeatOutgoing: 30000,
|
|
||||||
};
|
|
||||||
|
|
||||||
export class StompCli {
|
|
||||||
private static client: StompClient;
|
|
||||||
private static options: StompCliOption;
|
|
||||||
private static appMsgBroker: AppWsMsgBroker[] = [];
|
|
||||||
/**
|
|
||||||
* key-订阅路径
|
|
||||||
*/
|
|
||||||
subscriptions: Map<string, AppStateSubscription> = new Map<
|
|
||||||
string,
|
|
||||||
AppStateSubscription
|
|
||||||
>();
|
|
||||||
private static connected = false;
|
|
||||||
static new(options: StompCliOption) {
|
|
||||||
if (StompCli.client) {
|
|
||||||
// 已经创建
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
StompCli.options = Object.assign({}, DefaultStompOption, options);
|
|
||||||
StompCli.client = new StompClient({
|
|
||||||
brokerURL: StompCli.options.wsUrl,
|
|
||||||
connectHeaders: {
|
connectHeaders: {
|
||||||
Authorization: StompCli.options.token ? StompCli.options.token : '',
|
Authorization: options.token ? options.token : '',
|
||||||
},
|
},
|
||||||
reconnectDelay: StompCli.options.reconnectDelay,
|
reconnectDelay: options.reconnectDelay,
|
||||||
heartbeatIncoming: StompCli.options.heartbeatIncoming,
|
heartbeatIncoming: options.heartbeatIncoming,
|
||||||
heartbeatOutgoing: StompCli.options.heartbeatOutgoing,
|
heartbeatOutgoing: options.heartbeatOutgoing,
|
||||||
});
|
});
|
||||||
|
|
||||||
StompCli.client.onConnect = () => {
|
this.cli.onConnect = () => {
|
||||||
// console.log('websocket连接(重连),重新订阅', StompCli.appMsgBroker.length)
|
this.emit('connected', '');
|
||||||
StompCli.emitConnectStateChangeEvent(true);
|
|
||||||
StompCli.appMsgBroker.forEach((broker) => {
|
|
||||||
broker.resubscribe();
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
this.cli.onStompError = (frame: Frame) => {
|
||||||
StompCli.client.onStompError = (frame: Frame) => {
|
|
||||||
const errMsg = frame.headers['message'];
|
const errMsg = frame.headers['message'];
|
||||||
if (errMsg === '401') {
|
if (errMsg === '401') {
|
||||||
console.warn('认证失败,断开WebSocket连接');
|
console.warn('认证失败,断开WebSocket连接');
|
||||||
StompCli.close();
|
|
||||||
if (StompCli.options.onAuthenticationFailed) {
|
|
||||||
StompCli.options.onAuthenticationFailed();
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
console.error('收到Stomp错误消息', frame);
|
console.error('收到Stomp错误消息', frame);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
StompCli.client.onDisconnect = (frame: Frame) => {
|
this.cli.onDisconnect = (frame: Frame) => {
|
||||||
console.log('Stomp 断开连接', frame);
|
console.log('Stomp 断开连接', frame);
|
||||||
StompCli.emitConnectStateChangeEvent(false);
|
this.emit('disconnected', frame);
|
||||||
};
|
|
||||||
StompCli.client.onWebSocketClose = (evt: CloseEvent) => {
|
|
||||||
console.log('websocket 关闭', evt);
|
|
||||||
StompCli.emitConnectStateChangeEvent(false);
|
|
||||||
};
|
};
|
||||||
// websocket错误处理
|
// websocket错误处理
|
||||||
StompCli.client.onWebSocketError = (err: Event) => {
|
this.cli.onWebSocketError = (err: Event) => {
|
||||||
console.log('websocket错误', err);
|
console.error('websocket错误', err);
|
||||||
};
|
};
|
||||||
|
|
||||||
StompCli.client.activate();
|
this.cli.activate();
|
||||||
}
|
}
|
||||||
|
|
||||||
static emitConnectStateChangeEvent(connected: boolean) {
|
get connected(): boolean {
|
||||||
StompCli.connected = connected;
|
return this.cli.connected;
|
||||||
StompCli.appMsgBroker.forEach((broker) => {
|
|
||||||
broker.app.emit('websocket-connect-state-change', connected);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static isConnected(): boolean {
|
subscribe(destination: string, handle: MessageHandler): ISubscription {
|
||||||
return StompCli.client && StompCli.client.connected;
|
const sub = this.cli.subscribe(
|
||||||
}
|
destination,
|
||||||
|
(frame) => {
|
||||||
static trySubscribe(
|
if (this.options.protocol === 'json') {
|
||||||
destination: string,
|
const data = JSON.parse(frame.body);
|
||||||
handler: messageCallbackType
|
handle(data);
|
||||||
): StompSubscription | undefined {
|
|
||||||
if (StompCli.isConnected()) {
|
|
||||||
return StompCli.client.subscribe(destination, handler, {
|
|
||||||
id: destination,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
static registerAppMsgBroker(broker: AppWsMsgBroker) {
|
|
||||||
StompCli.appMsgBroker.push(broker);
|
|
||||||
}
|
|
||||||
|
|
||||||
static removeAppMsgBroker(broker: AppWsMsgBroker) {
|
|
||||||
const index = StompCli.appMsgBroker.findIndex((mb) => mb == broker);
|
|
||||||
if (index >= 0) {
|
|
||||||
StompCli.appMsgBroker.splice(index, 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static hasAppMsgBroker(): boolean {
|
|
||||||
return StompCli.appMsgBroker.length > 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关闭websocket连接
|
|
||||||
*/
|
|
||||||
static close() {
|
|
||||||
StompCli.connected = false;
|
|
||||||
if (StompCli.client) {
|
|
||||||
StompCli.client.deactivate();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 状态订阅消息转换器
|
|
||||||
export type GraphicStateMessageConvert = (
|
|
||||||
message: Uint8Array
|
|
||||||
) => GraphicState[];
|
|
||||||
|
|
||||||
// 订阅消息处理器
|
|
||||||
export type SubscriptionMessageHandle = (message: Uint8Array) => void;
|
|
||||||
|
|
||||||
// 图形app状态订阅
|
|
||||||
export interface AppStateSubscription {
|
|
||||||
/**
|
|
||||||
* 订阅路径
|
|
||||||
*/
|
|
||||||
destination: string;
|
|
||||||
/**
|
|
||||||
* 图形状态消息转换
|
|
||||||
*/
|
|
||||||
messageConverter?: GraphicStateMessageConvert;
|
|
||||||
/**
|
|
||||||
* 订阅消息处理
|
|
||||||
*/
|
|
||||||
messageHandle?: SubscriptionMessageHandle;
|
|
||||||
/**
|
|
||||||
* 订阅成功对象,用于取消订阅
|
|
||||||
* 非客户端使用
|
|
||||||
*/
|
|
||||||
subscription?: StompSubscription;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 图形APP的websocket消息代理
|
|
||||||
*/
|
|
||||||
export class AppWsMsgBroker {
|
|
||||||
app: GraphicApp;
|
|
||||||
subscriptions: Map<string, AppStateSubscription> = new Map<
|
|
||||||
string,
|
|
||||||
AppStateSubscription
|
|
||||||
>();
|
|
||||||
|
|
||||||
constructor(app: GraphicApp) {
|
|
||||||
this.app = app;
|
|
||||||
StompCli.registerAppMsgBroker(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
subscribe(sub: AppStateSubscription) {
|
|
||||||
this.unsbuscribe(sub.destination); // 先尝试取消之前订阅
|
|
||||||
sub.subscription = StompCli.trySubscribe(
|
|
||||||
sub.destination,
|
|
||||||
(message: Message) => {
|
|
||||||
if (sub.messageConverter) {
|
|
||||||
const graphicStates = sub.messageConverter(message.binaryBody);
|
|
||||||
this.app.handleGraphicStates(graphicStates);
|
|
||||||
} else if (sub.messageHandle) {
|
|
||||||
sub.messageHandle(message.binaryBody);
|
|
||||||
} else {
|
} else {
|
||||||
console.error(
|
handle(frame.binaryBody);
|
||||||
`订阅destination:${sub.destination}没有消息处理器或图形状态消息转换器`
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: destination,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
// console.log('代理订阅结果', sub.subscription)
|
return sub;
|
||||||
this.subscriptions.set(sub.destination, sub);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
resubscribe() {
|
close(): void {
|
||||||
this.subscriptions.forEach((record) => {
|
this.cli.deactivate();
|
||||||
this.subscribe(record);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
unsbuscribe(destination: string) {
|
|
||||||
const oldSub = this.subscriptions.get(destination);
|
|
||||||
if (oldSub) {
|
|
||||||
if (oldSub.subscription && StompCli.isConnected()) {
|
|
||||||
oldSub.subscription.unsubscribe();
|
|
||||||
}
|
|
||||||
oldSub.subscription = undefined;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
unsbuscribeAll() {
|
|
||||||
this.subscriptions.forEach((record) => {
|
|
||||||
this.unsbuscribe(record.destination);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 取消所有订阅,从通用Stomp客户端移除此消息代理
|
|
||||||
*/
|
|
||||||
close() {
|
|
||||||
StompCli.removeAppMsgBroker(this);
|
|
||||||
this.unsbuscribeAll();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1 +1 @@
|
|||||||
export * from './WsMsgBroker';
|
export * from './MessageBroker';
|
||||||
|
@ -120,13 +120,14 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { Base64 } from 'js-base64';
|
import { Base64, toUint8Array } from 'js-base64';
|
||||||
import { useQuasar } from 'quasar';
|
import { useQuasar } from 'quasar';
|
||||||
import DrawProperties from 'src/components/draw-app/DrawProperties.vue';
|
import DrawProperties from 'src/components/draw-app/DrawProperties.vue';
|
||||||
import { getDrawApp, loadDrawDatas } from 'src/examples/app';
|
import { getDrawApp, loadDrawDatas } from 'src/examples/app';
|
||||||
import { getJwtToken } from 'src/examples/app/configs/TokenManage';
|
import { getJwtToken } from 'src/examples/app/configs/TokenManage';
|
||||||
import { getWebsocketUrl } from 'src/examples/app/configs/UrlManage';
|
import { getWebsocketUrl } from 'src/examples/app/configs/UrlManage';
|
||||||
import { AppStateSubscription } from 'src/jlgraphic';
|
import { graphicData } from 'src/examples/app/protos/draw_data_storage';
|
||||||
|
import { AppStateSubscription, ClientEngine } from 'src/jlgraphic';
|
||||||
import { useDrawStore } from 'src/stores/draw-store';
|
import { useDrawStore } from 'src/stores/draw-store';
|
||||||
import { Ref, onMounted, onUnmounted, ref } from 'vue';
|
import { Ref, onMounted, onUnmounted, ref } from 'vue';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
@ -164,30 +165,25 @@ onMounted(() => {
|
|||||||
const dom = document.getElementById('draw-app-container');
|
const dom = document.getElementById('draw-app-container');
|
||||||
if (dom) {
|
if (dom) {
|
||||||
const drawApp = drawStore.initDrawApp(dom);
|
const drawApp = drawStore.initDrawApp(dom);
|
||||||
drawApp.on('websocket-state-change', (app, connected) => {
|
drawApp.on('websocket-connect-state-change', (connected) => {
|
||||||
console.log('应用websocket状态变更', connected);
|
console.log('应用websocket状态变更', connected);
|
||||||
});
|
});
|
||||||
loadDrawDatas(drawApp);
|
loadDrawDatas(drawApp);
|
||||||
onResize();
|
onResize();
|
||||||
// drawApp.enableWsStomp({
|
drawApp.enableWsMassaging({
|
||||||
// wsUrl: getWebsocketUrl(),
|
engine: ClientEngine.Centrifugo,
|
||||||
// token: getJwtToken() as string,
|
protocol: 'json',
|
||||||
// onAuthenticationFailed: () => {
|
wsUrl: getWebsocketUrl(),
|
||||||
// $q.dialog({
|
token:
|
||||||
// title: '认证失败',
|
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2OTA2MTM0MzUsImlkIjo2LCJvcmlnX2lhdCI6MTY5MDUyNzAzNSwic3ViIjoiNiJ9.sRCFji8-90hXK_l_O2ScQHYSpmnw8TILmrZGCyR9RCo',
|
||||||
// message: '认证失败或登录超时,请重新登录',
|
});
|
||||||
// persistent: true,
|
drawApp.subscribe({
|
||||||
// }).onOk(() => {
|
destination: 'test2',
|
||||||
// router.push({ name: 'login' });
|
messageHandle: (msg) => {
|
||||||
// });
|
// const storage = graphicData.RtssGraphicStorage.deserialize(msg);
|
||||||
// },
|
console.log('设备消息处理', msg);
|
||||||
// });
|
},
|
||||||
// drawApp.subscribe({
|
});
|
||||||
// destination: '/queue/line/3/device',
|
|
||||||
// messageHandle: (msg) => {
|
|
||||||
// console.log('设备消息处理', msg);
|
|
||||||
// },
|
|
||||||
// });
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
94
yarn.lock
94
yarn.lock
@ -309,6 +309,59 @@
|
|||||||
resolved "https://registry.npmmirror.com/@positron/stack-trace/-/stack-trace-1.0.0.tgz#14fcc712a530038ef9be1ce6952315a839f466a8"
|
resolved "https://registry.npmmirror.com/@positron/stack-trace/-/stack-trace-1.0.0.tgz#14fcc712a530038ef9be1ce6952315a839f466a8"
|
||||||
integrity sha512-nWlGg+aMfQDhGYa5FtBhZwldeo2MtdjHdxmEQvhBXEnxgD5IhIYl0PHvex8SdwyN7qcSoMykMWdjyAX7ZxkpMw==
|
integrity sha512-nWlGg+aMfQDhGYa5FtBhZwldeo2MtdjHdxmEQvhBXEnxgD5IhIYl0PHvex8SdwyN7qcSoMykMWdjyAX7ZxkpMw==
|
||||||
|
|
||||||
|
"@protobufjs/aspromise@^1.1.1", "@protobufjs/aspromise@^1.1.2":
|
||||||
|
version "1.1.2"
|
||||||
|
resolved "https://registry.npmmirror.com/@protobufjs/aspromise/-/aspromise-1.1.2.tgz#9b8b0cc663d669a7d8f6f5d0893a14d348f30fbf"
|
||||||
|
integrity sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==
|
||||||
|
|
||||||
|
"@protobufjs/base64@^1.1.2":
|
||||||
|
version "1.1.2"
|
||||||
|
resolved "https://registry.npmmirror.com/@protobufjs/base64/-/base64-1.1.2.tgz#4c85730e59b9a1f1f349047dbf24296034bb2735"
|
||||||
|
integrity sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==
|
||||||
|
|
||||||
|
"@protobufjs/codegen@^2.0.4":
|
||||||
|
version "2.0.4"
|
||||||
|
resolved "https://registry.npmmirror.com/@protobufjs/codegen/-/codegen-2.0.4.tgz#7ef37f0d010fb028ad1ad59722e506d9262815cb"
|
||||||
|
integrity sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==
|
||||||
|
|
||||||
|
"@protobufjs/eventemitter@^1.1.0":
|
||||||
|
version "1.1.0"
|
||||||
|
resolved "https://registry.npmmirror.com/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz#355cbc98bafad5978f9ed095f397621f1d066b70"
|
||||||
|
integrity sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==
|
||||||
|
|
||||||
|
"@protobufjs/fetch@^1.1.0":
|
||||||
|
version "1.1.0"
|
||||||
|
resolved "https://registry.npmmirror.com/@protobufjs/fetch/-/fetch-1.1.0.tgz#ba99fb598614af65700c1619ff06d454b0d84c45"
|
||||||
|
integrity sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==
|
||||||
|
dependencies:
|
||||||
|
"@protobufjs/aspromise" "^1.1.1"
|
||||||
|
"@protobufjs/inquire" "^1.1.0"
|
||||||
|
|
||||||
|
"@protobufjs/float@^1.0.2":
|
||||||
|
version "1.0.2"
|
||||||
|
resolved "https://registry.npmmirror.com/@protobufjs/float/-/float-1.0.2.tgz#5e9e1abdcb73fc0a7cb8b291df78c8cbd97b87d1"
|
||||||
|
integrity sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==
|
||||||
|
|
||||||
|
"@protobufjs/inquire@^1.1.0":
|
||||||
|
version "1.1.0"
|
||||||
|
resolved "https://registry.npmmirror.com/@protobufjs/inquire/-/inquire-1.1.0.tgz#ff200e3e7cf2429e2dcafc1140828e8cc638f089"
|
||||||
|
integrity sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==
|
||||||
|
|
||||||
|
"@protobufjs/path@^1.1.2":
|
||||||
|
version "1.1.2"
|
||||||
|
resolved "https://registry.npmmirror.com/@protobufjs/path/-/path-1.1.2.tgz#6cc2b20c5c9ad6ad0dccfd21ca7673d8d7fbf68d"
|
||||||
|
integrity sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==
|
||||||
|
|
||||||
|
"@protobufjs/pool@^1.1.0":
|
||||||
|
version "1.1.0"
|
||||||
|
resolved "https://registry.npmmirror.com/@protobufjs/pool/-/pool-1.1.0.tgz#09fd15f2d6d3abfa9b65bc366506d6ad7846ff54"
|
||||||
|
integrity sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==
|
||||||
|
|
||||||
|
"@protobufjs/utf8@^1.1.0":
|
||||||
|
version "1.1.0"
|
||||||
|
resolved "https://registry.npmmirror.com/@protobufjs/utf8/-/utf8-1.1.0.tgz#a777360b5b39a1a2e5106f8e858f2fd2d060c570"
|
||||||
|
integrity sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==
|
||||||
|
|
||||||
"@quasar/app-vite@^1.0.0":
|
"@quasar/app-vite@^1.0.0":
|
||||||
version "1.2.1"
|
version "1.2.1"
|
||||||
resolved "https://registry.npmmirror.com/@quasar/app-vite/-/app-vite-1.2.1.tgz#23a634e16c74b28a38cf1ad1b3633388a220f97f"
|
resolved "https://registry.npmmirror.com/@quasar/app-vite/-/app-vite-1.2.1.tgz#23a634e16c74b28a38cf1ad1b3633388a220f97f"
|
||||||
@ -479,6 +532,11 @@
|
|||||||
resolved "https://registry.npmmirror.com/@types/node/-/node-18.16.0.tgz#4668bc392bb6938637b47e98b1f2ed5426f33316"
|
resolved "https://registry.npmmirror.com/@types/node/-/node-18.16.0.tgz#4668bc392bb6938637b47e98b1f2ed5426f33316"
|
||||||
integrity sha512-BsAaKhB+7X+H4GnSjGhJG9Qi8Tw+inU9nJDwmD5CgOmBLEI6ArdhikpLX7DjbjDRDTbqZzU2LSQNZg8WGPiSZQ==
|
integrity sha512-BsAaKhB+7X+H4GnSjGhJG9Qi8Tw+inU9nJDwmD5CgOmBLEI6ArdhikpLX7DjbjDRDTbqZzU2LSQNZg8WGPiSZQ==
|
||||||
|
|
||||||
|
"@types/node@>=13.7.0":
|
||||||
|
version "20.4.2"
|
||||||
|
resolved "https://registry.npmmirror.com/@types/node/-/node-20.4.2.tgz#129cc9ae69f93824f92fac653eebfb4812ab4af9"
|
||||||
|
integrity sha512-Dd0BYtWgnWJKwO1jkmTrzofjK2QXXcai0dmtzvIBhcA+RsG5h8R3xlyta0kGOZRNfL9GuRtb1knmPEhQrePCEw==
|
||||||
|
|
||||||
"@types/node@^12.20.21":
|
"@types/node@^12.20.21":
|
||||||
version "12.20.55"
|
version "12.20.55"
|
||||||
resolved "https://registry.npmmirror.com/@types/node/-/node-12.20.55.tgz#c329cbd434c42164f846b909bd6f85b5537f6240"
|
resolved "https://registry.npmmirror.com/@types/node/-/node-12.20.55.tgz#c329cbd434c42164f846b909bd6f85b5537f6240"
|
||||||
@ -974,6 +1032,14 @@ caniuse-lite@^1.0.30001449, caniuse-lite@^1.0.30001464:
|
|||||||
resolved "https://registry.npmmirror.com/caniuse-lite/-/caniuse-lite-1.0.30001481.tgz#f58a717afe92f9e69d0e35ff64df596bfad93912"
|
resolved "https://registry.npmmirror.com/caniuse-lite/-/caniuse-lite-1.0.30001481.tgz#f58a717afe92f9e69d0e35ff64df596bfad93912"
|
||||||
integrity sha512-KCqHwRnaa1InZBtqXzP98LPg0ajCVujMKjqKDhZEthIpAsJl/YEIa3YvXjGXPVqzZVguccuu7ga9KOE1J9rKPQ==
|
integrity sha512-KCqHwRnaa1InZBtqXzP98LPg0ajCVujMKjqKDhZEthIpAsJl/YEIa3YvXjGXPVqzZVguccuu7ga9KOE1J9rKPQ==
|
||||||
|
|
||||||
|
centrifuge@^4.0.1:
|
||||||
|
version "4.0.1"
|
||||||
|
resolved "https://registry.npmmirror.com/centrifuge/-/centrifuge-4.0.1.tgz#2607756d4b7da6201ca12666bfc6564e4e8ef6a2"
|
||||||
|
integrity sha512-akAyUfvMnyoCa6X2tdU5WPEccVqjkb9R/xxfm3iJ7ha7EIawjKu1dQmoyMkoLDpgl0jFxhorjmVgRcbojE17DA==
|
||||||
|
dependencies:
|
||||||
|
events "^3.3.0"
|
||||||
|
protobufjs "^7.2.4"
|
||||||
|
|
||||||
chalk@^4.0.0, chalk@^4.0.2, chalk@^4.1.0, chalk@^4.1.1:
|
chalk@^4.0.0, chalk@^4.0.2, chalk@^4.1.0, chalk@^4.1.1:
|
||||||
version "4.1.2"
|
version "4.1.2"
|
||||||
resolved "https://registry.npmmirror.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01"
|
resolved "https://registry.npmmirror.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01"
|
||||||
@ -1701,6 +1767,11 @@ eventemitter3@^4.0.0:
|
|||||||
resolved "https://registry.npmmirror.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f"
|
resolved "https://registry.npmmirror.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f"
|
||||||
integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==
|
integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==
|
||||||
|
|
||||||
|
events@^3.3.0:
|
||||||
|
version "3.3.0"
|
||||||
|
resolved "https://registry.npmmirror.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400"
|
||||||
|
integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==
|
||||||
|
|
||||||
express@^4.17.3:
|
express@^4.17.3:
|
||||||
version "4.18.2"
|
version "4.18.2"
|
||||||
resolved "https://registry.npmmirror.com/express/-/express-4.18.2.tgz#3fabe08296e930c796c19e3c516979386ba9fd59"
|
resolved "https://registry.npmmirror.com/express/-/express-4.18.2.tgz#3fabe08296e930c796c19e3c516979386ba9fd59"
|
||||||
@ -2320,6 +2391,11 @@ log-symbols@^4.1.0:
|
|||||||
chalk "^4.1.0"
|
chalk "^4.1.0"
|
||||||
is-unicode-supported "^0.1.0"
|
is-unicode-supported "^0.1.0"
|
||||||
|
|
||||||
|
long@^5.0.0:
|
||||||
|
version "5.2.3"
|
||||||
|
resolved "https://registry.npmmirror.com/long/-/long-5.2.3.tgz#a3ba97f3877cf1d778eccbcb048525ebb77499e1"
|
||||||
|
integrity sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==
|
||||||
|
|
||||||
lower-case@^1.1.1:
|
lower-case@^1.1.1:
|
||||||
version "1.1.4"
|
version "1.1.4"
|
||||||
resolved "https://registry.npmmirror.com/lower-case/-/lower-case-1.1.4.tgz#9a2cabd1b9e8e0ae993a4bf7d5875c39c42e8eac"
|
resolved "https://registry.npmmirror.com/lower-case/-/lower-case-1.1.4.tgz#9a2cabd1b9e8e0ae993a4bf7d5875c39c42e8eac"
|
||||||
@ -2718,6 +2794,24 @@ process-nextick-args@~2.0.0:
|
|||||||
resolved "https://registry.npmmirror.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2"
|
resolved "https://registry.npmmirror.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2"
|
||||||
integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==
|
integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==
|
||||||
|
|
||||||
|
protobufjs@^7.2.4:
|
||||||
|
version "7.2.4"
|
||||||
|
resolved "https://registry.npmmirror.com/protobufjs/-/protobufjs-7.2.4.tgz#3fc1ec0cdc89dd91aef9ba6037ba07408485c3ae"
|
||||||
|
integrity sha512-AT+RJgD2sH8phPmCf7OUZR8xGdcJRga4+1cOaXJ64hvcSkVhNcRHOwIxUatPH15+nj59WAGTDv3LSGZPEQbJaQ==
|
||||||
|
dependencies:
|
||||||
|
"@protobufjs/aspromise" "^1.1.2"
|
||||||
|
"@protobufjs/base64" "^1.1.2"
|
||||||
|
"@protobufjs/codegen" "^2.0.4"
|
||||||
|
"@protobufjs/eventemitter" "^1.1.0"
|
||||||
|
"@protobufjs/fetch" "^1.1.0"
|
||||||
|
"@protobufjs/float" "^1.0.2"
|
||||||
|
"@protobufjs/inquire" "^1.1.0"
|
||||||
|
"@protobufjs/path" "^1.1.2"
|
||||||
|
"@protobufjs/pool" "^1.1.0"
|
||||||
|
"@protobufjs/utf8" "^1.1.0"
|
||||||
|
"@types/node" ">=13.7.0"
|
||||||
|
long "^5.0.0"
|
||||||
|
|
||||||
protoc-gen-ts@^0.8.6:
|
protoc-gen-ts@^0.8.6:
|
||||||
version "0.8.6"
|
version "0.8.6"
|
||||||
resolved "https://registry.npmmirror.com/protoc-gen-ts/-/protoc-gen-ts-0.8.6.tgz#e789a6fc3fbe09bdc119acecc349b9554ec5940e"
|
resolved "https://registry.npmmirror.com/protoc-gen-ts/-/protoc-gen-ts-0.8.6.tgz#e789a6fc3fbe09bdc119acecc349b9554ec5940e"
|
||||||
|
Loading…
Reference in New Issue
Block a user