@huolala-tech/page-spy-mp-base
Advanced tools
Comparing version 1.0.5 to 1.0.6
@@ -1,2 +0,2 @@ | ||
import { Client, combineName, getRandomId } from '@huolala-tech/page-spy-base'; | ||
import { Client, getRandomId } from '@huolala-tech/page-spy-base'; | ||
import { getMPSDK, joinQuery, promisifyMPApi } from '../utils'; | ||
@@ -19,3 +19,3 @@ const getScheme = (enableSSL) => { | ||
const scheme = getScheme(enableSSL); | ||
const device = combineName(Client.info); | ||
const device = Client.getName(); | ||
const query = joinQuery({ | ||
@@ -22,0 +22,0 @@ group: project, |
import { SocketStoreBase, SocketState, SocketWrapper } from '@huolala-tech/page-spy-base'; | ||
import type { SpyMP } from '@huolala-tech/page-spy-types'; | ||
export declare class MPSocketWrapper extends SocketWrapper { | ||
@@ -14,5 +13,2 @@ socketInstance: MPSocket | null; | ||
protected socketWrapper: MPSocketWrapper; | ||
getPageSpyConfig: (() => Required<SpyMP.MPInitConfig>) | null; | ||
updateRoomInfo(): void; | ||
getSocket(): MPSocketWrapper; | ||
onOffline(): void; | ||
@@ -19,0 +15,0 @@ } |
import { __awaiter } from "tslib"; | ||
import { Client, SocketStoreBase, SocketState, SocketWrapper, combineName, UPDATE_ROOM_INFO, ROOM_SESSION_KEY, } from '@huolala-tech/page-spy-base'; | ||
import { SocketStoreBase, SocketState, SocketWrapper, ROOM_SESSION_KEY, } from '@huolala-tech/page-spy-base'; | ||
import { getMPSDK, utilAPI } from '../utils'; | ||
@@ -85,27 +85,3 @@ export class MPSocketWrapper extends SocketWrapper { | ||
this.socketWrapper = new MPSocketWrapper(); | ||
this.getPageSpyConfig = null; | ||
} | ||
updateRoomInfo() { | ||
if (this.getPageSpyConfig) { | ||
const { project, title } = this.getPageSpyConfig(); | ||
const device = combineName(Client.info); | ||
this.send({ | ||
type: UPDATE_ROOM_INFO, | ||
content: { | ||
info: { | ||
name: device, | ||
group: project, | ||
tags: { | ||
title, | ||
name: device, | ||
group: project, | ||
}, | ||
}, | ||
}, | ||
}, true); | ||
} | ||
} | ||
getSocket() { | ||
return this.socketWrapper; | ||
} | ||
// this is an abstract method of parent class, cannot be static | ||
@@ -112,0 +88,0 @@ /* eslint-disable-next-line */ |
@@ -1,2 +0,2 @@ | ||
import { Client, combineName, makeMessage } from '@huolala-tech/page-spy-base'; | ||
import { Client, makeMessage } from '@huolala-tech/page-spy-base'; | ||
import socketStore from '../helpers/socket'; | ||
@@ -31,6 +31,5 @@ class SystemPlugin { | ||
static getSystemInfo() { | ||
const deviceInfo = Client.info; | ||
return { | ||
system: { | ||
ua: combineName(deviceInfo), | ||
ua: Client.getName(), | ||
}, | ||
@@ -37,0 +36,0 @@ features: {}, |
{ | ||
"name": "@huolala-tech/page-spy-mp-base", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "The base of PageSpy for miniprogram.", | ||
@@ -19,7 +19,8 @@ "license": "MIT", | ||
"build": "yarn clean && tsc", | ||
"watch": "tsc -w", | ||
"clean": "rm -rf dist" | ||
}, | ||
"dependencies": { | ||
"@huolala-tech/page-spy-base": "^1.0.5", | ||
"@huolala-tech/page-spy-types": "^1.9.5" | ||
"@huolala-tech/page-spy-base": "^1.0.6", | ||
"@huolala-tech/page-spy-types": "^1.9.6" | ||
}, | ||
@@ -51,3 +52,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "2e1e2ca0a810c3247930fb3bb968139e21ceb36f" | ||
"gitHead": "789c4889df5bafdeb97e05a40b19d3af89b8b694" | ||
} |
64126
1726